@orbcharts/plugin-basic 4.0.0-pre-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/dist/orbcharts-plugin-basic.es.js +25335 -0
- package/dist/orbcharts-plugin-basic.umd.js +341 -0
- package/dist/plugin-basic/src/baseLayers/BaseBars.d.ts +38 -0
- package/dist/plugin-basic/src/baseLayers/BaseBarsTriangle.d.ts +37 -0
- package/dist/plugin-basic/src/baseLayers/BaseCategoryAxis.d.ts +42 -0
- package/dist/plugin-basic/src/baseLayers/BaseDots.d.ts +38 -0
- package/dist/plugin-basic/src/baseLayers/BaseLegend.d.ts +31 -0
- package/dist/plugin-basic/src/baseLayers/BaseLineAreas.d.ts +36 -0
- package/dist/plugin-basic/src/baseLayers/BaseLines.d.ts +36 -0
- package/dist/plugin-basic/src/baseLayers/BaseStackedBars.d.ts +41 -0
- package/dist/plugin-basic/src/baseLayers/BaseTooltip.d.ts +47 -0
- package/dist/plugin-basic/src/baseLayers/BaseValueAxis.d.ts +38 -0
- package/dist/plugin-basic/src/baseLayers/BaseXAxis.d.ts +25 -0
- package/dist/plugin-basic/src/baseLayers/BaseXZoom.d.ts +22 -0
- package/dist/plugin-basic/src/baseLayers/BaseYAxis.d.ts +23 -0
- package/dist/plugin-basic/src/baseLayers/types.d.ts +171 -0
- package/dist/plugin-basic/src/const/layerIndex.d.ts +10 -0
- package/dist/plugin-basic/src/const/sharedPluginParams.d.ts +6 -0
- package/dist/plugin-basic/src/index.d.ts +2 -0
- package/dist/plugin-basic/src/plugins/CompositionPlot/CompositionPlot.d.ts +22 -0
- package/dist/plugin-basic/src/plugins/CompositionPlot/contextObservables.d.ts +40 -0
- package/dist/plugin-basic/src/plugins/CompositionPlot/defaults.d.ts +10 -0
- package/dist/plugin-basic/src/plugins/CompositionPlot/index.d.ts +3 -0
- package/dist/plugin-basic/src/plugins/CompositionPlot/layers/Bubbles.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/CompositionPlot/layers/Indicator.d.ts +0 -0
- package/dist/plugin-basic/src/plugins/CompositionPlot/layers/Pie.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/CompositionPlot/layers/PieEventTexts.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/CompositionPlot/layers/PieLabels.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/CompositionPlot/layers/Rose.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/CompositionPlot/layers/RoseLabels.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/CompositionPlot/layers/Waffle.d.ts +0 -0
- package/dist/plugin-basic/src/plugins/CompositionPlot/types.d.ts +110 -0
- package/dist/plugin-basic/src/plugins/CompositionPlot/utils.d.ts +19 -0
- package/dist/plugin-basic/src/plugins/HierarchyPlot/HierarchyPlot.d.ts +22 -0
- package/dist/plugin-basic/src/plugins/HierarchyPlot/contextObservables.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/HierarchyPlot/defaults.d.ts +4 -0
- package/dist/plugin-basic/src/plugins/HierarchyPlot/index.d.ts +3 -0
- package/dist/plugin-basic/src/plugins/HierarchyPlot/layers/TreeMap.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/HierarchyPlot/types.d.ts +29 -0
- package/dist/plugin-basic/src/plugins/Legend/Legend.d.ts +22 -0
- package/dist/plugin-basic/src/plugins/Legend/contextObservables.d.ts +9 -0
- package/dist/plugin-basic/src/plugins/Legend/defaults.d.ts +4 -0
- package/dist/plugin-basic/src/plugins/Legend/index.d.ts +3 -0
- package/dist/plugin-basic/src/plugins/Legend/layers/Legend.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/Legend/types.d.ts +31 -0
- package/dist/plugin-basic/src/plugins/Legend/utils.d.ts +19 -0
- package/dist/plugin-basic/src/plugins/NetworkPlot/NetworkPlot.d.ts +22 -0
- package/dist/plugin-basic/src/plugins/NetworkPlot/contextObservables.d.ts +19 -0
- package/dist/plugin-basic/src/plugins/NetworkPlot/defaults.d.ts +5 -0
- package/dist/plugin-basic/src/plugins/NetworkPlot/index.d.ts +3 -0
- package/dist/plugin-basic/src/plugins/NetworkPlot/layers/ForceDirected.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/NetworkPlot/layers/ForceDirectedBubbles.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/NetworkPlot/types.d.ts +117 -0
- package/dist/plugin-basic/src/plugins/ScatterPlot/ScatterPlot.d.ts +22 -0
- package/dist/plugin-basic/src/plugins/ScatterPlot/contextObservables.d.ts +140 -0
- package/dist/plugin-basic/src/plugins/ScatterPlot/defaults.d.ts +8 -0
- package/dist/plugin-basic/src/plugins/ScatterPlot/index.d.ts +3 -0
- package/dist/plugin-basic/src/plugins/ScatterPlot/layers/Scatter.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/ScatterPlot/layers/ScatterBubbles.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/ScatterPlot/layers/XYAux.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/ScatterPlot/layers/XYAxes.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/ScatterPlot/layers/XZoom.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/ScatterPlot/types.d.ts +146 -0
- package/dist/plugin-basic/src/plugins/SeriesPlot/SeriesPlot.d.ts +22 -0
- package/dist/plugin-basic/src/plugins/SeriesPlot/contextObservables.d.ts +77 -0
- package/dist/plugin-basic/src/plugins/SeriesPlot/defaults.d.ts +15 -0
- package/dist/plugin-basic/src/plugins/SeriesPlot/index.d.ts +3 -0
- package/dist/plugin-basic/src/plugins/SeriesPlot/layers/Bars.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/SeriesPlot/layers/BarsPN.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/SeriesPlot/layers/BarsTriangle.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/SeriesPlot/layers/CategoryAux.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/SeriesPlot/layers/CategoryAxis.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/SeriesPlot/layers/CategoryZoom.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/SeriesPlot/layers/Dots.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/SeriesPlot/layers/LineAreas.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/SeriesPlot/layers/Lines.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/SeriesPlot/layers/StackedBars.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/SeriesPlot/layers/StackedValueAxis.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/SeriesPlot/layers/ValueAxis.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/SeriesPlot/types.d.ts +140 -0
- package/dist/plugin-basic/src/plugins/Tooltip/Tooltip.d.ts +22 -0
- package/dist/plugin-basic/src/plugins/Tooltip/contextObservables.d.ts +9 -0
- package/dist/plugin-basic/src/plugins/Tooltip/defaults.d.ts +4 -0
- package/dist/plugin-basic/src/plugins/Tooltip/index.d.ts +3 -0
- package/dist/plugin-basic/src/plugins/Tooltip/layers/Tooltip.d.ts +16 -0
- package/dist/plugin-basic/src/plugins/Tooltip/types.d.ts +35 -0
- package/dist/plugin-basic/src/plugins/Tooltip/utils.d.ts +19 -0
- package/dist/plugin-basic/src/plugins/index.d.ts +7 -0
- package/dist/plugin-basic/src/types/BaseLayer.d.ts +3 -0
- package/dist/plugin-basic/src/types/Common.d.ts +14 -0
- package/dist/plugin-basic/src/types/ComputedData.d.ts +27 -0
- package/dist/plugin-basic/src/types/PluginParams.d.ts +66 -0
- package/dist/plugin-basic/src/types/index.d.ts +3 -0
- package/dist/plugin-basic/src/utils/commonUtils.d.ts +3 -0
- package/dist/plugin-basic/src/utils/d3Graphics.d.ts +24 -0
- package/dist/plugin-basic/src/utils/d3Scale.d.ts +28 -0
- package/dist/plugin-basic/src/utils/d3Utils.d.ts +14 -0
- package/dist/plugin-basic/src/utils/graphObservables.d.ts +0 -0
- package/dist/plugin-basic/src/utils/gridObservables.d.ts +51 -0
- package/dist/plugin-basic/src/utils/multivariateObservables.d.ts +74 -0
- package/dist/plugin-basic/src/utils/observables.d.ts +34 -0
- package/dist/plugin-basic/src/utils/orbchartsUtils.d.ts +26 -0
- package/dist/plugin-basic/src/utils/seriesObservables.d.ts +22 -0
- package/dist/plugin-basic/vite.config.d.ts +2 -0
- package/dist/src/index.d.ts +1 -0
- package/package.json +62 -0
- package/src/baseLayers/BaseBars.ts +783 -0
- package/src/baseLayers/BaseBarsTriangle.ts +692 -0
- package/src/baseLayers/BaseCategoryAxis.ts +708 -0
- package/src/baseLayers/BaseDots.ts +495 -0
- package/src/baseLayers/BaseLegend.ts +684 -0
- package/src/baseLayers/BaseLineAreas.ts +644 -0
- package/src/baseLayers/BaseLines.ts +721 -0
- package/src/baseLayers/BaseStackedBars.ts +818 -0
- package/src/baseLayers/BaseTooltip.ts +435 -0
- package/src/baseLayers/BaseValueAxis.ts +612 -0
- package/src/baseLayers/BaseXAxis.ts +412 -0
- package/src/baseLayers/BaseXZoom.ts +250 -0
- package/src/baseLayers/BaseYAxis.ts +371 -0
- package/src/baseLayers/types.ts +174 -0
- package/src/const/layerIndex.ts +36 -0
- package/src/const/sharedPluginParams.ts +29 -0
- package/src/index.ts +3 -0
- package/src/plugins/CompositionPlot/CompositionPlot.ts +308 -0
- package/src/plugins/CompositionPlot/contextObservables.ts +251 -0
- package/src/plugins/CompositionPlot/defaults.ts +162 -0
- package/src/plugins/CompositionPlot/index.ts +3 -0
- package/src/plugins/CompositionPlot/layers/Bubbles.ts +808 -0
- package/src/plugins/CompositionPlot/layers/Indicator.ts +0 -0
- package/src/plugins/CompositionPlot/layers/Pie.ts +776 -0
- package/src/plugins/CompositionPlot/layers/PieEventTexts.ts +326 -0
- package/src/plugins/CompositionPlot/layers/PieLabels.ts +651 -0
- package/src/plugins/CompositionPlot/layers/Rose.ts +546 -0
- package/src/plugins/CompositionPlot/layers/RoseLabels.ts +616 -0
- package/src/plugins/CompositionPlot/layers/Waffle.ts +0 -0
- package/src/plugins/CompositionPlot/types.ts +129 -0
- package/src/plugins/CompositionPlot/utils.ts +53 -0
- package/src/plugins/HierarchyPlot/HierarchyPlot.ts +190 -0
- package/src/plugins/HierarchyPlot/contextObservables.ts +136 -0
- package/src/plugins/HierarchyPlot/defaults.ts +31 -0
- package/src/plugins/HierarchyPlot/index.ts +3 -0
- package/src/plugins/HierarchyPlot/layers/TreeMap.ts +371 -0
- package/src/plugins/HierarchyPlot/types.ts +36 -0
- package/src/plugins/Legend/Legend.ts +151 -0
- package/src/plugins/Legend/contextObservables.ts +55 -0
- package/src/plugins/Legend/defaults.ts +37 -0
- package/src/plugins/Legend/index.ts +3 -0
- package/src/plugins/Legend/layers/Legend.ts +114 -0
- package/src/plugins/Legend/types.ts +45 -0
- package/src/plugins/Legend/utils.ts +53 -0
- package/src/plugins/NetworkPlot/NetworkPlot.ts +228 -0
- package/src/plugins/NetworkPlot/contextObservables.ts +123 -0
- package/src/plugins/NetworkPlot/defaults.ts +147 -0
- package/src/plugins/NetworkPlot/index.ts +3 -0
- package/src/plugins/NetworkPlot/layers/ForceDirected.ts +1048 -0
- package/src/plugins/NetworkPlot/layers/ForceDirectedBubbles.ts +1318 -0
- package/src/plugins/NetworkPlot/types.ts +146 -0
- package/src/plugins/ScatterPlot/ScatterPlot.ts +569 -0
- package/src/plugins/ScatterPlot/contextObservables.ts +901 -0
- package/src/plugins/ScatterPlot/defaults.ts +212 -0
- package/src/plugins/ScatterPlot/index.ts +3 -0
- package/src/plugins/ScatterPlot/layers/Scatter.ts +518 -0
- package/src/plugins/ScatterPlot/layers/ScatterBubbles.ts +670 -0
- package/src/plugins/ScatterPlot/layers/XYAux.ts +686 -0
- package/src/plugins/ScatterPlot/layers/XYAxes.ts +205 -0
- package/src/plugins/ScatterPlot/layers/XZoom.ts +48 -0
- package/src/plugins/ScatterPlot/types.ts +179 -0
- package/src/plugins/SeriesPlot/SeriesPlot.ts +494 -0
- package/src/plugins/SeriesPlot/contextObservables.ts +726 -0
- package/src/plugins/SeriesPlot/defaults.ts +142 -0
- package/src/plugins/SeriesPlot/index.ts +3 -0
- package/src/plugins/SeriesPlot/layers/Bars.ts +84 -0
- package/src/plugins/SeriesPlot/layers/BarsPN.ts +85 -0
- package/src/plugins/SeriesPlot/layers/BarsTriangle.ts +89 -0
- package/src/plugins/SeriesPlot/layers/CategoryAux.ts +1131 -0
- package/src/plugins/SeriesPlot/layers/CategoryAxis.ts +92 -0
- package/src/plugins/SeriesPlot/layers/CategoryZoom.ts +233 -0
- package/src/plugins/SeriesPlot/layers/Dots.ts +91 -0
- package/src/plugins/SeriesPlot/layers/LineAreas.ts +82 -0
- package/src/plugins/SeriesPlot/layers/Lines.ts +75 -0
- package/src/plugins/SeriesPlot/layers/StackedBars.ts +85 -0
- package/src/plugins/SeriesPlot/layers/StackedValueAxis.ts +111 -0
- package/src/plugins/SeriesPlot/layers/ValueAxis.ts +111 -0
- package/src/plugins/SeriesPlot/types.ts +201 -0
- package/src/plugins/Tooltip/Tooltip.ts +159 -0
- package/src/plugins/Tooltip/contextObservables.ts +55 -0
- package/src/plugins/Tooltip/defaults.ts +458 -0
- package/src/plugins/Tooltip/index.ts +3 -0
- package/src/plugins/Tooltip/layers/Tooltip.ts +90 -0
- package/src/plugins/Tooltip/types.ts +55 -0
- package/src/plugins/Tooltip/utils.ts +53 -0
- package/src/plugins/index.ts +8 -0
- package/src/types/BaseLayer.ts +3 -0
- package/src/types/Common.ts +20 -0
- package/src/types/ComputedData.ts +55 -0
- package/src/types/PluginParams.ts +81 -0
- package/src/types/index.ts +3 -0
- package/src/utils/commonUtils.ts +31 -0
- package/src/utils/d3Graphics.ts +177 -0
- package/src/utils/d3Scale.ts +198 -0
- package/src/utils/d3Utils.ts +92 -0
- package/src/utils/graphObservables.ts +0 -0
- package/src/utils/gridObservables.ts +637 -0
- package/src/utils/multivariateObservables.ts +790 -0
- package/src/utils/observables.ts +357 -0
- package/src/utils/orbchartsUtils.ts +335 -0
- package/src/utils/seriesObservables.ts +172 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
(function(le,G){typeof exports=="object"&&typeof module<"u"?G(exports,require("@orbcharts/core")):typeof define=="function"&&define.amd?define(["exports","@orbcharts/core"],G):(le=typeof globalThis<"u"?globalThis:le||self,G(le.orbchartsPluginBasic={},le.orbchartsCore))})(this,function(le,G){"use strict";var pl=function(e,t){return pl=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])},pl(e,t)};function Nt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");pl(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function Gb(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{l(r.next(c))}catch(h){a(h)}}function u(c){try{l(r.throw(c))}catch(h){a(h)}}function l(c){c.done?o(c.value):i(c.value).then(s,u)}l((r=r.apply(e,t||[])).next())})}function sh(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(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){n.label=l[1];break}if(l[0]===6&&n.label<o[1]){n.label=o[1],o=l;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(l);break}o[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(c){l=[6,c],i=0}finally{r=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function mr(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 En(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(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 br(e){return this instanceof br?(this.v=e,this):new br(e)}function Vb(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(p){return function(d){return Promise.resolve(d).then(p,h)}}function s(p,d){r[p]&&(i[p]=function(g){return new Promise(function(m,y){o.push([p,g,m,y])>1||u(p,g)})},d&&(i[p]=d(i[p])))}function u(p,d){try{l(r[p](d))}catch(g){f(o[0][3],g)}}function l(p){p.value instanceof br?Promise.resolve(p.value.v).then(c,h):f(o[0][2],p)}function c(p){u("next",p)}function h(p){u("throw",p)}function f(p,d){p(d),o.shift(),o.length&&u(o[0][0],o[0][1])}}function jb(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,u){a=e[o](a),i(s,u,a.done,a.value)})}}function i(o,a,s,u){Promise.resolve(u).then(function(l){o({value:l,done:s})},a)}}typeof SuppressedError=="function"&&SuppressedError;function Se(e){return typeof e=="function"}function dl(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 gl=dl(function(e){return function(n){e(this),this.message=n?n.length+` errors occurred during unsubscription:
|
|
2
|
+
`+n.map(function(r,i){return i+1+") "+r.toString()}).join(`
|
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=n}});function Eo(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var ci=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),u=s.next();!u.done;u=s.next()){var l=u.value;l.remove(this)}}catch(g){t={error:g}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}else a.remove(this);var c=this.initialTeardown;if(Se(c))try{c()}catch(g){o=g instanceof gl?g.errors:[g]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var f=mr(h),p=f.next();!p.done;p=f.next()){var d=p.value;try{ch(d)}catch(g){o=o??[],g instanceof gl?o=yr(yr([],En(o)),En(g.errors)):o.push(g)}}}catch(g){r={error:g}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}if(o)throw new gl(o)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)ch(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)&&Eo(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&Eo(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),lh=ci.EMPTY;function uh(e){return e instanceof ci||e&&"closed"in e&&Se(e.remove)&&Se(e.add)&&Se(e.unsubscribe)}function ch(e){Se(e)?e():e.unsubscribe()}var Ub={Promise:void 0},Hb={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],En(n)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function fh(e){Hb.setTimeout(function(){throw e})}function ml(){}function No(e){e()}var yl=function(e){Nt(t,e);function t(n){var r=e.call(this)||this;return r.isStopped=!1,n?(r.destination=n,uh(n)&&n.add(r)):r.destination=Jb,r}return t.create=function(n,r,i){return new fi(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}(ci),qb=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){Bo(r)}},e.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(r){Bo(r)}else Bo(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(n){Bo(n)}},e}(),fi=function(e){Nt(t,e);function t(n,r,i){var o=e.call(this)||this,a;return Se(n)||!n?a={next:n??void 0,error:r??void 0,complete:i??void 0}:a=n,o.destination=new qb(a),o}return t}(yl);function Bo(e){fh(e)}function Zb(e){throw e}var Jb={closed:!0,next:ml,error:Zb,complete:ml},bl=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function xr(e){return e}function Kb(e){return e.length===0?xr: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=ex(t)?t:new fi(t,n,r);return No(function(){var a=i,s=a.operator,u=a.source;o.add(s?s.call(o,u):u?i._subscribe(o):i._trySubscribe(o))}),o},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=hh(n),new n(function(i,o){var a=new fi({next:function(s){try{t(s)}catch(u){o(u),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[bl]=function(){return this},e.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Kb(t)(this)},e.prototype.toPromise=function(t){var n=this;return t=hh(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 hh(e){var t;return(t=e??Ub.Promise)!==null&&t!==void 0?t:Promise}function Qb(e){return e&&Se(e.next)&&Se(e.error)&&Se(e.complete)}function ex(e){return e&&e instanceof yl||Qb(e)&&uh(e)}function tx(e){return Se(e==null?void 0:e.lift)}function ht(e){return function(t){if(tx(t))return t.lift(function(n){try{return e(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function lt(e,t,n,r,i){return new nx(e,t,n,r,i)}var nx=function(e){Nt(t,e);function t(n,r,i,o,a,s){var u=e.call(this,n)||this;return u.onFinalize=a,u.shouldUnsubscribe=s,u._next=r?function(l){try{r(l)}catch(c){n.error(c)}}:e.prototype._next,u._error=o?function(l){try{o(l)}catch(c){n.error(c)}finally{this.unsubscribe()}}:e.prototype._error,u._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:e.prototype._complete,u}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}(yl),rx=dl(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),ee=function(e){Nt(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 ph(this,this);return r.operator=n,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new rx},t.prototype.next=function(n){var r=this;No(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=mr(r.currentObservers),s=a.next();!s.done;s=a.next()){var u=s.value;u.next(n)}}catch(l){i={error:l}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},t.prototype.error=function(n){var r=this;No(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;No(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?lh:(this.currentObservers=null,s.push(n),new ci(function(){r.currentObservers=null,Eo(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 ph(n,r)},t}(de),ph=function(e){Nt(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:lh},t}(ee),hi=function(e){Nt(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}(ee),xl={now:function(){return(xl.delegate||Date).now()},delegate:void 0},ix=function(e){Nt(t,e);function t(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=xl);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,u=r._windowTime;i||(o.push(n),!a&&o.push(s.now()+u)),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(),u=0;u<s.length&&!n.closed;u+=o?1:2)n.next(s[u]);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 u=i.now(),l=0,c=1;c<o.length&&o[c]<=u;c+=2)l=c;l&&o.splice(0,l+1)}},t}(ee),ox=function(e){Nt(t,e);function t(n,r){return e.call(this)||this}return t.prototype.schedule=function(n,r){return this},t}(ci),dh={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],En(n)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},ax=function(e){Nt(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),dh.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&&dh.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,Eo(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(ox),gh=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=xl.now,e}(),sx=function(e){Nt(t,e);function t(n,r){r===void 0&&(r=gh.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}(gh),lx=new sx(ax),zo=new de(function(e){return e.complete()});function ux(e){return e&&Se(e.schedule)}function vl(e){return e[e.length-1]}function cx(e){return Se(vl(e))?e.pop():void 0}function Sl(e){return ux(vl(e))?e.pop():void 0}function fx(e,t){return typeof vl(e)=="number"?e.pop():t}var $l=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function mh(e){return Se(e==null?void 0:e.then)}function yh(e){return Se(e[bl])}function bh(e){return Symbol.asyncIterator&&Se(e==null?void 0:e[Symbol.asyncIterator])}function xh(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 hx(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var vh=hx();function Sh(e){return Se(e==null?void 0:e[vh])}function $h(e){return Vb(this,arguments,function(){var n,r,i,o;return sh(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,br(n.read())];case 3:return r=a.sent(),i=r.value,o=r.done,o?[4,br(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,br(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function wh(e){return Se(e==null?void 0:e.getReader)}function bt(e){if(e instanceof de)return e;if(e!=null){if(yh(e))return px(e);if($l(e))return dx(e);if(mh(e))return gx(e);if(bh(e))return _h(e);if(Sh(e))return mx(e);if(wh(e))return yx(e)}throw xh(e)}function px(e){return new de(function(t){var n=e[bl]();if(Se(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function dx(e){return new de(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function gx(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,fh)})}function mx(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 _h(e){return new de(function(t){bx(e,t).catch(function(n){return t.error(n)})})}function yx(e){return _h($h(e))}function bx(e,t){var n,r,i,o;return Gb(this,void 0,void 0,function(){var a,s;return sh(this,function(u){switch(u.label){case 0:u.trys.push([0,5,6,11]),n=jb(e),u.label=1;case 1:return[4,n.next()];case 2:if(r=u.sent(),!!r.done)return[3,4];if(a=r.value,t.next(a),t.closed)return[2];u.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=u.sent(),i={error:s},[3,11];case 6:return u.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:u.sent(),u.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function pn(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 Th(e,t){return t===void 0&&(t=0),ht(function(n,r){n.subscribe(lt(r,function(i){return pn(r,e,function(){return r.next(i)},t)},function(){return pn(r,e,function(){return r.complete()},t)},function(i){return pn(r,e,function(){return r.error(i)},t)}))})}function Ah(e,t){return t===void 0&&(t=0),ht(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function xx(e,t){return bt(e).pipe(Ah(t),Th(t))}function vx(e,t){return bt(e).pipe(Ah(t),Th(t))}function Sx(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 $x(e,t){return new de(function(n){var r;return pn(n,t,function(){r=e[vh](),pn(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 Se(r==null?void 0:r.return)&&r.return()}})}function Dh(e,t){if(!e)throw new Error("Iterable cannot be null");return new de(function(n){pn(n,t,function(){var r=e[Symbol.asyncIterator]();pn(n,t,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function wx(e,t){return Dh($h(e),t)}function _x(e,t){if(e!=null){if(yh(e))return xx(e,t);if($l(e))return Sx(e,t);if(mh(e))return vx(e,t);if(bh(e))return Dh(e,t);if(Sh(e))return $x(e,t);if(wh(e))return wx(e,t)}throw xh(e)}function Oo(e,t){return t?_x(e,t):bt(e)}function Io(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Sl(e);return Oo(e,n)}var Mh=dl(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function T(e,t){return ht(function(n,r){var i=0;n.subscribe(lt(r,function(o){r.next(e.call(t,o,i++))}))})}var Tx=Array.isArray;function Ax(e,t){return Tx(t)?e.apply(void 0,yr([],En(t))):e(t)}function Ph(e){return T(function(t){return Ax(e,t)})}var Dx=Array.isArray,Mx=Object.getPrototypeOf,Px=Object.prototype,Cx=Object.keys;function Lx(e){if(e.length===1){var t=e[0];if(Dx(t))return{args:t,keys:null};if(kx(t)){var n=Cx(t);return{args:n.map(function(r){return t[r]}),keys:n}}}return{args:e,keys:null}}function kx(e){return e&&typeof e=="object"&&Mx(e)===Px}function Rx(e,t){return e.reduce(function(n,r,i){return n[r]=t[i],n},{})}function O(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Sl(e),r=cx(e),i=Lx(e),o=i.args,a=i.keys;if(o.length===0)return Oo([],n);var s=new de(Ex(o,n,a?function(u){return Rx(a,u)}:xr));return r?s.pipe(Ph(r)):s}function Ex(e,t,n){return n===void 0&&(n=xr),function(r){Ch(t,function(){for(var i=e.length,o=new Array(i),a=i,s=i,u=function(c){Ch(t,function(){var h=Oo(e[c],t),f=!1;h.subscribe(lt(r,function(p){o[c]=p,f||(f=!0,s--),s||r.next(n(o.slice()))},function(){--a||r.complete()}))},r)},l=0;l<i;l++)u(l)},r)}}function Ch(e,t,n){e?pn(n,e,t):t()}function Nx(e,t,n,r,i,o,a,s){var u=[],l=0,c=0,h=!1,f=function(){h&&!u.length&&!l&&t.complete()},p=function(g){return l<r?d(g):u.push(g)},d=function(g){l++;var m=!1;bt(n(g,c++)).subscribe(lt(t,function(y){t.next(y)},function(){m=!0},void 0,function(){if(m)try{l--;for(var y=function(){var b=u.shift();a||d(b)};u.length&&l<r;)y();f()}catch(b){t.error(b)}}))};return e.subscribe(lt(t,p,function(){h=!0,f()})),function(){}}function wl(e,t,n){return n===void 0&&(n=1/0),Se(t)?wl(function(r,i){return T(function(o,a){return t(r,o,i,a)})(bt(e(r,i)))},n):(typeof t=="number"&&(n=t),ht(function(r,i){return Nx(r,i,e,n)}))}function Bx(e){return e===void 0&&(e=1/0),wl(xr,e)}function zx(e){return new de(function(t){bt(e()).subscribe(t)})}var Ox=["addListener","removeListener"],Ix=["addEventListener","removeEventListener"],Fx=["on","off"];function _l(e,t,n,r){if(Se(n)&&(r=n,n=void 0),r)return _l(e,t,n).pipe(Ph(r));var i=En(Xx(e)?Ix.map(function(s){return function(u){return e[s](t,u,n)}}):Yx(e)?Ox.map(Lh(e,t)):Wx(e)?Fx.map(Lh(e,t)):[],2),o=i[0],a=i[1];if(!o&&$l(e))return wl(function(s){return _l(s,t,n)})(bt(e));if(!o)throw new TypeError("Invalid event target");return new de(function(s){var u=function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];return s.next(1<l.length?l:l[0])};return o(u),function(){return a(u)}})}function Lh(e,t){return function(n){return function(r){return e[n](t,r)}}}function Yx(e){return Se(e.addListener)&&Se(e.removeListener)}function Wx(e){return Se(e.on)&&Se(e.off)}function Xx(e){return Se(e.addEventListener)&&Se(e.removeEventListener)}function Nn(e,t,n){return zx(function(){return e()?t:n})}function Fo(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Sl(e),r=fx(e,1/0),i=e;return i.length?i.length===1?bt(i[0]):Bx(r)(Oo(i,n)):zo}function Ut(e,t){return ht(function(n,r){var i=0;n.subscribe(lt(r,function(o){return e.call(t,o,i++)&&r.next(o)}))})}function X(e,t){return t===void 0&&(t=lx),ht(function(n,r){var i=null,o=null,a=null,s=function(){if(i){i.unsubscribe(),i=null;var l=o;o=null,r.next(l)}};function u(){var l=a+e,c=t.now();if(c<l){i=this.schedule(void 0,l-c),r.add(i);return}s()}n.subscribe(lt(r,function(l){o=l,a=t.now(),i||(i=t.schedule(u,e),r.add(i))},function(){s(),r.complete()},void 0,function(){o=i=null}))})}function Gx(e){return ht(function(t,n){var r=!1;t.subscribe(lt(n,function(i){r=!0,n.next(i)},function(){r||n.next(e),n.complete()}))})}function Vx(e){return e<=0?function(){return zo}:ht(function(t,n){var r=0;t.subscribe(lt(n,function(i){++r<=e&&(n.next(i),e<=r&&n.complete())}))})}function H(e,t){return t===void 0&&(t=xr),e=e??jx,ht(function(n,r){var i,o=!0;n.subscribe(lt(r,function(a){var s=t(a);(o||!e(i,s))&&(o=!1,i=s,r.next(a))}))})}function jx(e,t){return e===t}function Ux(e){return e===void 0&&(e=Hx),ht(function(t,n){var r=!1;t.subscribe(lt(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(e())}))})}function Hx(){return new Mh}function Tl(e,t){var n=arguments.length>=2;return function(r){return r.pipe(xr,Vx(1),n?Gx(t):Ux(function(){return new Mh}))}}function qx(e){e===void 0&&(e={});var t=e.connector,n=t===void 0?function(){return new ee}:t,r=e.resetOnError,i=r===void 0?!0:r,o=e.resetOnComplete,a=o===void 0?!0:o,s=e.resetOnRefCountZero,u=s===void 0?!0:s;return function(l){var c,h,f,p=0,d=!1,g=!1,m=function(){h==null||h.unsubscribe(),h=void 0},y=function(){m(),c=f=void 0,d=g=!1},b=function(){var x=c;y(),x==null||x.unsubscribe()};return ht(function(x,v){p++,!g&&!d&&m();var _=f=f??n();v.add(function(){p--,p===0&&!g&&!d&&(h=Al(b,u))}),_.subscribe(v),!c&&p>0&&(c=new fi({next:function(w){return _.next(w)},error:function(w){g=!0,m(),h=Al(y,i,w),_.error(w)},complete:function(){d=!0,m(),h=Al(y,a),_.complete()}}),bt(x).subscribe(c))})(l)}}function Al(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 fi({next:function(){i.unsubscribe(),e()}});return bt(t.apply(void 0,yr([],En(n)))).subscribe(i)}}function W(e,t,n){var r,i=!1;return r=e,qx({connector:function(){return new ix(r,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:i})}function U(e,t){return ht(function(n,r){var i=null,o=0,a=!1,s=function(){return a&&!i&&r.complete()};n.subscribe(lt(r,function(u){i==null||i.unsubscribe();var l=0,c=o++;bt(e(u,c)).subscribe(i=lt(r,function(h){return r.next(t?t(u,h,c,l++):h)},function(){i=null,s()}))},function(){a=!0,s()}))})}function k(e){return ht(function(t,n){bt(e).subscribe(lt(n,function(){return n.complete()},ml)),!n.closed&&t.subscribe(n)})}const pt={position:"left",scaleDomain:["auto","auto"],scaleRange:[0,.9],label:""},Zx={position:"bottom",scaleDomain:[0,"max"],scalePadding:.5,label:""},kh={scaleDomain:["auto","auto"],scaleRange:[0,.9],label:""},Dl={columnAmount:1,rowAmount:1,columnGap:"auto",rowGap:"auto"},Ml={styles:{padding:{top:20,right:60,bottom:80,left:60},highlightTarget:"datum",highlightDefault:null,unhighlightedOpacity:.3,transitionDuration:800,transitionEase:"easeCubic"},visibleFilter:e=>!0,container:{...Dl},xAxis:{...kh},yAxis:{...kh},separateSeries:!1,datasetIndex:0};Ml.visibleFilter.toString=()=>"(datum) => true";const Rh={radius:5,fillColorType:"data",strokeColorType:"data",strokeWidth:0},Eh={fillColorType:"data",strokeColorType:"data",strokeWidth:0,valueLinearOpacity:[.8,.8],arcScaleType:"area",sizeAdjust:.5},Yo={xAxis:{showLine:!0,showLabel:!0,lineDashArray:"3, 3",lineColorType:"primary",labelColorType:"primary",labelTextColorType:"background",labelTextFormat:e=>{if(e===null||Number.isNaN(e)==!0)return e||0;const t=Math.abs(e);if(t>0&&t<1){const i=e.toString().match(/0\.(0*)([1-9])/);if(i){const o=i[1].length+1;return e.toFixed(o)}return e.toString()}const n=e.toString().split(".");return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),n[0]},labelPadding:20},yAxis:{showLine:!0,showLabel:!0,lineDashArray:"3, 3",lineColorType:"primary",labelColorType:"primary",labelTextColorType:"background",labelTextFormat:e=>{if(e===null||Number.isNaN(e)==!0)return e||0;const t=Math.abs(e);if(t>0&&t<1){const i=e.toString().match(/0\.(0*)([1-9])/);if(i){const o=i[1].length+1;return e.toFixed(o)}return e.toString()}const n=e.toString().split(".");return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),n[0]},labelPadding:20}};Yo.xAxis.labelTextFormat.toString=()=>`num => {
|
|
4
|
+
if (num === null || Number.isNaN(num) == true) {
|
|
5
|
+
return num || 0
|
|
6
|
+
}
|
|
7
|
+
const absNum = Math.abs(num)
|
|
8
|
+
if (absNum > 0 && absNum < 1) {
|
|
9
|
+
const strNum = num.toString()
|
|
10
|
+
const match = strNum.match(/0.(0*)([1-9])/)
|
|
11
|
+
if (match) {
|
|
12
|
+
const precision = match[1].length + 1
|
|
13
|
+
return num.toFixed(precision)
|
|
14
|
+
}
|
|
15
|
+
return num.toString()
|
|
16
|
+
}
|
|
17
|
+
const parts = num.toString().split('.')
|
|
18
|
+
parts[0] = parts[0].replace(/B(?=(d{3})+(?!d))/g, ',')
|
|
19
|
+
return parts[0]
|
|
20
|
+
}`,Yo.yAxis.labelTextFormat.toString=()=>`num => {
|
|
21
|
+
if (num === null || Number.isNaN(num) == true) {
|
|
22
|
+
return num || 0
|
|
23
|
+
}
|
|
24
|
+
const absNum = Math.abs(num)
|
|
25
|
+
if (absNum > 0 && absNum < 1) {
|
|
26
|
+
const strNum = num.toString()
|
|
27
|
+
const match = strNum.match(/0.(0*)([1-9])/)
|
|
28
|
+
if (match) {
|
|
29
|
+
const precision = match[1].length + 1
|
|
30
|
+
return num.toFixed(precision)
|
|
31
|
+
}
|
|
32
|
+
return num.toString()
|
|
33
|
+
}
|
|
34
|
+
const parts = num.toString().split('.')
|
|
35
|
+
parts[0] = parts[0].replace(/B(?=(d{3})+(?!d))/g, ',')
|
|
36
|
+
return parts[0]
|
|
37
|
+
}`;const Wo={xAxis:{labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:null,tickFormat:e=>{if(e===null||Number.isNaN(e)==!0)return e||0;const t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")},tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextColorType:"primary"},yAxis:{labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:null,tickFormat:e=>{if(e===null||Number.isNaN(e)==!0)return e||0;const t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")},tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextColorType:"primary"}};Wo.xAxis.tickFormat.toString=()=>`num => {
|
|
38
|
+
if (num === null || Number.isNaN(num) == true) {
|
|
39
|
+
return num || 0
|
|
40
|
+
}
|
|
41
|
+
const parts = num.toString().split('.')
|
|
42
|
+
parts[0] = parts[0].replace(/B(?=(d{3})+(?!d))/g, ',')
|
|
43
|
+
return parts.join('.')
|
|
44
|
+
}`,Wo.yAxis.tickFormat.toString=()=>`num => {
|
|
45
|
+
if (num === null || Number.isNaN(num) == true) {
|
|
46
|
+
return num || 0
|
|
47
|
+
}
|
|
48
|
+
const parts = num.toString().split('.')
|
|
49
|
+
parts[0] = parts[0].replace(/B(?=(d{3})+(?!d))/g, ',')
|
|
50
|
+
return parts.join('.')
|
|
51
|
+
}`;const Nh={};function pi(e,t){let n=new de(()=>{});return e.each(function(){const r=_l(this,t);n=Fo(n,r)}),n}function Bn({size$:e,padding$:t}){return O({size:e,padding:t}).pipe(X(0),T(n=>{const r=n.size.width-n.padding.left-n.padding.right,i=n.size.height-n.padding.top-n.padding.bottom;return{rootWidth:n.size.width,rootHeight:n.size.height,width:r>0?r:0,height:i>0?i:0,left:n.padding.left,right:n.padding.right,top:n.padding.top,bottom:n.padding.bottom}}),H((n,r)=>JSON.stringify(n)===JSON.stringify(r)),W(1))}const vr=({datumList$:e,styles$:t,event$:n})=>{const r=new ee,i=t.pipe(k(r),T(h=>h.highlightDefault||null),H(),T(h=>({id:h,label:h,series:h,category:h})),W(1)),a=t.pipe(k(r),T(h=>h.highlightTarget),H(),W(1)).pipe(U(h=>n.pipe(k(r),Ut(f=>f.eventName==="mouseover"),T(f=>f.target?{id:f.target.id,label:null,series:h==="series"?f.target.series:null,category:h==="category"?f.target.category:null}:{id:null,label:null,series:null,category:null})))),s=n.pipe(k(r),Ut(h=>h.eventName==="mouseout"),U(h=>i));function u(h,f,p){return f==null&&p==null?[]:h.filter(d=>d.id===f||d.name===p)}function l(h,f){return f==null?[]:h.filter(p=>p.series===f)}function c(h,f){return f==null?[]:h.filter(p=>p.category===f)}return new de(h=>(O({target:Fo(a,s,i),datumList:e,styles:t}).pipe(k(r),X(0)).subscribe(f=>{let p=[];f.styles.highlightTarget==="datum"?p=u(f.datumList,f.target.id,f.target.label):f.styles.highlightTarget==="series"?p=l(f.datumList,f.target.series):f.styles.highlightTarget==="category"&&(p=c(f.datumList,f.target.category)),h.next(p)}),function(){r.next(void 0)}))},di=({datumList$:e})=>e.pipe(T(t=>{const n=new Map;return t.forEach(r=>{const i=n.get(r.series)??[];i.push(r),n.set(r.series,i)}),n})),gi=({datumList$:e})=>e.pipe(T(t=>{const n=new Map;return t.filter(r=>r.category!=null).forEach(r=>{const i=n.get(r.category)??[];i.push(r),n.set(r.category,i)}),n})),dn=e=>e.pipe(T(t=>t.fontSize),H(),T(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})),Bh=({layout$:e,containerPosition$:t,container$:n})=>{const r=t.pipe(T(o=>o.reduce((s,u)=>u.rowIndex>s?u.rowIndex:s,0)+1),H()),i=t.pipe(T(o=>o.reduce((s,u)=>u.columnIndex>s?u.columnIndex:s,0)+1),H());return O({layout:e,rowAmount:r,columnAmount:i,container:n}).pipe(X(0),T(o=>{const a=o.container.columnGap==="auto"?o.layout.left+o.layout.right:o.container.columnGap,s=o.container.rowGap==="auto"?o.layout.top+o.layout.bottom:o.container.rowGap,u=(o.layout.rootWidth-o.layout.left-o.layout.right-a*(o.columnAmount-1))/o.columnAmount,l=(o.layout.rootHeight-o.layout.top-o.layout.bottom-s*(o.rowAmount-1))/o.rowAmount;return{width:u,height:l}}),H((o,a)=>o.width===a.width&&o.height===a.height))};function mi(e,t=10){var i;const n=document.createElement("canvas").getContext("2d");return(((i=n==null?void 0:n.measureText(e))==null?void 0:i.width)??0)*t/10}function Sr(e){const t=[0,0];return e.length?e.reduce((r,i)=>[i<r[0]?i:r[0],i>r[1]?i:r[1]],[e[0],e[0]]):t}function Jx(e){if(e===null||Number.isNaN(e)==!0)return String(e||0);const t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")}function Ae(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function zh(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Xo(e){let t,n,r;e.length!==2?(t=Ae,n=(s,u)=>Ae(e(s),u),r=(s,u)=>e(s)-u):(t=e===Ae||e===zh?e:Kx,n=e,r=e);function i(s,u,l=0,c=s.length){if(l<c){if(t(u,u)!==0)return c;do{const h=l+c>>>1;n(s[h],u)<0?l=h+1:c=h}while(l<c)}return l}function o(s,u,l=0,c=s.length){if(l<c){if(t(u,u)!==0)return c;do{const h=l+c>>>1;n(s[h],u)<=0?l=h+1:c=h}while(l<c)}return l}function a(s,u,l=0,c=s.length){const h=i(s,u,l,c-1);return h>l&&r(s[h-1],u)>-r(s[h],u)?h-1:h}return{left:i,center:a,right:o}}function Kx(){return 0}function Go(e){return e===null?NaN:+e}function*Qx(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 Oh=Xo(Ae),gn=Oh.right,ev=Oh.left,tv=Xo(Go).center;function nv(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=Pl(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 Ih=Fh(Pl),rv=Fh(iv);function Fh(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),u=r&&e(r),l=i.slice();return s&&u?($r(s,l,i,o,a),$r(s,i,l,o,a),$r(s,l,i,o,a),wr(u,i,l,o,a),wr(u,l,i,o,a),wr(u,i,l,o,a)):s?($r(s,i,l,o,a),$r(s,l,i,o,a),$r(s,i,l,o,a)):u&&(wr(u,i,l,o,a),wr(u,l,i,o,a),wr(u,i,l,o,a)),t}}function $r(e,t,n,r,i){for(let o=0,a=r*i;o<a;)e(t,n,o,o+=r,1)}function wr(e,t,n,r,i){for(let o=0,a=r*i;o<r;++o)e(t,n,o,o+a,r)}function iv(e){const t=Pl(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 Pl(e){const t=Math.floor(e);if(t===e)return ov(e);const n=e-t,r=2*e+1;return(i,o,a,s,u)=>{if(!((s-=u)>=a))return;let l=t*o[a];const c=u*t,h=c+u;for(let f=a,p=a+c;f<p;f+=u)l+=o[Math.min(s,f)];for(let f=a,p=s;f<=p;f+=u)l+=o[Math.min(s,f+c)],i[f]=(l+n*(o[Math.max(a,f-h)]+o[Math.min(s,f+h)]))/r,l-=o[Math.max(a,f-c)]}}function ov(e){const t=2*e+1;return(n,r,i,o,a)=>{if(!((o-=a)>=i))return;let s=e*r[i];const u=a*e;for(let l=i,c=i+u;l<c;l+=a)s+=r[Math.min(o,l)];for(let l=i,c=o;l<=c;l+=a)s+=r[Math.min(o,l+u)],n[l]=s/t,s-=r[Math.max(i,l-u)]}}function Vo(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 av(e){return e.length|0}function sv(e){return!(e>0)}function lv(e){return typeof e!="object"||"length"in e?e:Array.from(e)}function uv(e){return t=>e(...t)}function cv(...e){const t=typeof e[e.length-1]=="function"&&uv(e.pop());e=e.map(lv);const n=e.map(av),r=e.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||n.some(sv))return o;for(;;){o.push(i.map((s,u)=>e[u][s]));let a=r;for(;++i[a]===n[a];){if(a===0)return t?o.map(t):o;i[a--]=0}}}function fv(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 Yh(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 Wh(e,t){const n=Yh(e,t);return n&&Math.sqrt(n)}function yi(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 Re{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 hv(e,t){const n=new Re;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 pv(e,t){const n=new Re;let r=-1;return Float64Array.from(e,t===void 0?i=>n.add(+i||0):i=>n.add(+t(i,++r,e)||0))}class bi extends Map{constructor(t,n=Vh){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(Cl(this,t))}has(t){return super.has(Cl(this,t))}set(t,n){return super.set(Xh(this,t),n)}delete(t){return super.delete(Gh(this,t))}}class zn extends Set{constructor(t,n=Vh){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(Cl(this,t))}add(t){return super.add(Xh(this,t))}delete(t){return super.delete(Gh(this,t))}}function Cl({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Xh({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Gh({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Vh(e){return e!==null&&typeof e=="object"?e.valueOf():e}function _r(e){return e}function jh(e,...t){return Tr(e,_r,_r,t)}function Uh(e,...t){return Tr(e,Array.from,_r,t)}function Hh(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 dv(e,...t){return Hh(Uh(e,...t),t)}function gv(e,t,...n){return Hh(Zh(e,t,...n),n)}function qh(e,t,...n){return Tr(e,_r,t,n)}function Zh(e,t,...n){return Tr(e,Array.from,t,n)}function mv(e,...t){return Tr(e,_r,Jh,t)}function yv(e,...t){return Tr(e,Array.from,Jh,t)}function Jh(e){if(e.length!==1)throw new Error("duplicate key");return e[0]}function Tr(e,t,n,r){return function i(o,a){if(a>=r.length)return n(o);const s=new bi,u=r[a++];let l=-1;for(const c of o){const h=u(c,++l,o),f=s.get(h);f?f.push(c):s.set(h,[c])}for(const[c,h]of s)s.set(c,i(h,a));return t(s)}(e,0)}function Kh(e,t){return Array.from(t,n=>e[n])}function Ll(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=Ar(a[i],a[o]);if(s)return s}})):(n=e.map(n),r.sort((i,o)=>Ar(n[i],n[o]))),Kh(e,r)}return e.sort(kl(n))}function kl(e=Ae){if(e===Ae)return Ar;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 Ar(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function bv(e,t,n){return(t.length!==2?Ll(qh(e,t,n),([r,i],[o,a])=>Ae(i,a)||Ae(r,o)):Ll(jh(e,n),([r,i],[o,a])=>t(i,a)||Ae(r,o))).map(([r])=>r)}var xv=Array.prototype,vv=xv.slice;function Rl(e){return()=>e}const Sv=Math.sqrt(50),$v=Math.sqrt(10),wv=Math.sqrt(2);function jo(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>=Sv?10:o>=$v?5:o>=wv?2:1;let s,u,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(e*l),u=Math.round(t*l),s/l<e&&++s,u/l>t&&--u,l=-l):(l=Math.pow(10,i)*a,s=Math.round(e/l),u=Math.round(t/l),s*l<e&&++s,u*l>t&&--u),u<s&&.5<=n&&n<2?jo(e,t,n*2):[s,u,l]}function On(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?jo(t,e,n):jo(e,t,n);if(!(o>=i))return[];const s=o-i+1,u=new Array(s);if(r)if(a<0)for(let l=0;l<s;++l)u[l]=(o-l)/-a;else for(let l=0;l<s;++l)u[l]=(o-l)*a;else if(a<0)for(let l=0;l<s;++l)u[l]=(i+l)/-a;else for(let l=0;l<s;++l)u[l]=(i+l)*a;return u}function In(e,t,n){return t=+t,e=+e,n=+n,jo(e,t,n)[2]}function Uo(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?In(t,e,n):In(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function El(e,t,n){let r;for(;;){const i=In(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 Nl(e){return Math.max(1,Math.ceil(Math.log(Vo(e))/Math.LN2)+1)}function Qh(){var e=_r,t=yi,n=Nl;function r(i){Array.isArray(i)||(i=Array.from(i));var o,a=i.length,s,u,l=new Array(a);for(o=0;o<a;++o)l[o]=e(i[o],o,i);var c=t(l),h=c[0],f=c[1],p=n(l,h,f);if(!Array.isArray(p)){const x=f,v=+p;if(t===yi&&([h,f]=El(h,f,v)),p=On(h,f,v),p[0]<=h&&(u=In(h,f,v)),p[p.length-1]>=f)if(x>=f&&t===yi){const _=In(h,f,v);isFinite(_)&&(_>0?f=(Math.floor(f/_)+1)*_:_<0&&(f=(Math.ceil(f*-_)+1)/-_))}else p.pop()}for(var d=p.length,g=0,m=d;p[g]<=h;)++g;for(;p[m-1]>f;)--m;(g||m<d)&&(p=p.slice(g,m),d=m-g);var y=new Array(d+1),b;for(o=0;o<=d;++o)b=y[o]=[],b.x0=o>0?p[o-1]:h,b.x1=o<d?p[o]:f;if(isFinite(u)){if(u>0)for(o=0;o<a;++o)(s=l[o])!=null&&h<=s&&s<=f&&y[Math.min(d,Math.floor((s-h)/u))].push(i[o]);else if(u<0){for(o=0;o<a;++o)if((s=l[o])!=null&&h<=s&&s<=f){const x=Math.floor((h-s)*u);y[Math.min(d,x+(p[x]<=s))].push(i[o])}}}else for(o=0;o<a;++o)(s=l[o])!=null&&h<=s&&s<=f&&y[gn(p,s,0,d)].push(i[o]);return y}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:Rl(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:Rl([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:Rl(Array.isArray(i)?vv.call(i):i),r):n},r}function xi(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 Bl(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 Ho(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 zl(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 qo(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?Ar:kl(i);r>n;){if(r-n>600){const u=r-n+1,l=t-n+1,c=Math.log(u),h=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*h*(u-h)/u)*(l-u/2<0?-1:1),p=Math.max(n,Math.floor(t-l*h/u+f)),d=Math.min(r,Math.floor(t+(u-l)*h/u+f));qo(e,t,p,d,i)}const o=e[t];let a=n,s=r;for(vi(e,n,t),i(e[r],o)>0&&vi(e,n,r);a<s;){for(vi(e,a,s),++a,--s;i(e[a],o)<0;)++a;for(;i(e[s],o)>0;)--s}i(e[n],o)===0?vi(e,n,s):(++s,vi(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function vi(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function ep(e,t=Ae){let n,r=!1;if(t.length===1){let i;for(const o of e){const a=t(o);(r?Ae(a,i)>0:Ae(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 Si(e,t,n){if(e=Float64Array.from(Qx(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Ho(e);if(t>=1)return xi(e);var r,i=(r-1)*t,o=Math.floor(i),a=xi(qo(e,o).subarray(0,o+1)),s=Ho(e.subarray(o+1));return a+(s-a)*(i-o)}}function tp(e,t,n=Go){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 np(e,t,n=Go){if(!isNaN(t=+t)){if(r=Float64Array.from(e,(s,u)=>Go(n(e[u],u,e))),t<=0)return zl(r);if(t>=1)return Bl(r);var r,i=Uint32Array.from(e,(s,u)=>u),o=r.length-1,a=Math.floor(o*t);return qo(i,a,0,o,(s,u)=>Ar(r[s],r[u])),a=ep(i.subarray(0,a+1),s=>r[s]),a>=0?a:-1}}function _v(e,t,n){const r=Vo(e),i=Si(e,.75)-Si(e,.25);return r&&i?Math.ceil((n-t)/(2*i*Math.pow(r,-1/3))):1}function Tv(e,t,n){const r=Vo(e),i=Wh(e);return r&&i?Math.ceil((n-t)*Math.cbrt(r)/(3.49*i)):1}function Av(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 Dv(e,t){return Si(e,.5,t)}function Mv(e,t){return np(e,.5,t)}function*Pv(e){for(const t of e)yield*t}function Ol(e){return Array.from(Pv(e))}function Cv(e,t){const n=new bi;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 Lv(e,t=kv){const n=[];let r,i=!1;for(const o of e)i&&n.push(t(r,o)),r=o,i=!0;return n}function kv(e,t){return[e,t]}function mn(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 Rv(e,t=Ae){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=Ae);const i=(s,u)=>t(n[s],n[u]);let o,a;return e=Uint32Array.from(n,(s,u)=>u),e.sort(t===Ae?(s,u)=>Ar(n[s],n[u]):kl(i)),e.forEach((s,u)=>{const l=i(s,o===void 0?s:o);l>=0?((o===void 0||l>0)&&(o=s,a=u),r[s]=a):r[s]=NaN}),r}function Ev(e,t=Ae){let n,r=!1;if(t.length===1){let i;for(const o of e){const a=t(o);(r?Ae(a,i)<0:Ae(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 rp(e,t=Ae){if(t.length===1)return zl(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 Nv(e,t=Ae){if(t.length===1)return Bl(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 Bv(e,t){const n=rp(e,t);return n<0?void 0:n}const zv=ip(Math.random);function ip(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 Il(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 op(e){if(!(o=e.length))return[];for(var t=-1,n=Ho(e,Ov),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 Ov(e){return e.length}function Iv(){return op(arguments)}function Fv(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 Yv(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 Wv(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 Xv(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 Gv(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 Vv(e){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");return Array.from(e).reverse()}function jv(e,...t){e=new zn(e);for(const n of t)for(const r of n)e.delete(r);return e}function Uv(e,t){const n=t[Symbol.iterator](),r=new zn;for(const i of e){if(r.has(i))return!1;let o,a;for(;({value:o,done:a}=n.next())&&!a;){if(Object.is(i,o))return!1;r.add(o)}}return!0}function Hv(e,...t){e=new zn(e),t=t.map(qv);e:for(const n of e)for(const r of t)if(!r.has(n)){e.delete(n);continue e}return e}function qv(e){return e instanceof zn?e:new zn(e)}function ap(e,t){const n=e[Symbol.iterator](),r=new Set;for(const i of t){const o=sp(i);if(r.has(o))continue;let a,s;for(;{value:a,done:s}=n.next();){if(s)return!1;const u=sp(a);if(r.add(u),Object.is(o,u))break}}return!0}function sp(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Zv(e,t){return ap(t,e)}function Jv(...e){const t=new zn;for(const n of e)for(const r of n)t.add(r);return t}function Kv(e){return e}var Zo=1,Jo=2,Fl=3,$i=4,lp=1e-6;function Qv(e){return"translate("+e+",0)"}function e2(e){return"translate(0,"+e+")"}function t2(e){return t=>+e(t)}function n2(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function r2(){return!this.__axis}function Ko(e,t){var n=[],r=null,i=null,o=6,a=6,s=3,u=typeof window<"u"&&window.devicePixelRatio>1?0:.5,l=e===Zo||e===$i?-1:1,c=e===$i||e===Jo?"x":"y",h=e===Zo||e===Fl?Qv:e2;function f(p){var d=r??(t.ticks?t.ticks.apply(t,n):t.domain()),g=i??(t.tickFormat?t.tickFormat.apply(t,n):Kv),m=Math.max(o,0)+s,y=t.range(),b=+y[0]+u,x=+y[y.length-1]+u,v=(t.bandwidth?n2:t2)(t.copy(),u),_=p.selection?p.selection():p,w=_.selectAll(".domain").data([null]),P=_.selectAll(".tick").data(d,t).order(),C=P.exit(),L=P.enter().append("g").attr("class","tick"),E=P.select("line"),N=P.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),P=P.merge(L),E=E.merge(L.append("line").attr("stroke","currentColor").attr(c+"2",l*o)),N=N.merge(L.append("text").attr("fill","currentColor").attr(c,l*m).attr("dy",e===Zo?"0em":e===Fl?"0.71em":"0.32em")),p!==_&&(w=w.transition(p),P=P.transition(p),E=E.transition(p),N=N.transition(p),C=C.transition(p).attr("opacity",lp).attr("transform",function(A){return isFinite(A=v(A))?h(A+u):this.getAttribute("transform")}),L.attr("opacity",lp).attr("transform",function(A){var R=this.parentNode.__axis;return h((R&&isFinite(R=R(A))?R:v(A))+u)})),C.remove(),w.attr("d",e===$i||e===Jo?a?"M"+l*a+","+b+"H"+u+"V"+x+"H"+l*a:"M"+u+","+b+"V"+x:a?"M"+b+","+l*a+"V"+u+"H"+x+"V"+l*a:"M"+b+","+u+"H"+x),P.attr("opacity",1).attr("transform",function(A){return h(v(A)+u)}),E.attr(c+"2",l*o),N.attr(c,l*m).text(g),_.filter(r2).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Jo?"start":e===$i?"end":"middle"),_.each(function(){this.__axis=v})}return f.scale=function(p){return arguments.length?(t=p,f):t},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(p){return arguments.length?(n=p==null?[]:Array.from(p),f):n.slice()},f.tickValues=function(p){return arguments.length?(r=p==null?null:Array.from(p),f):r&&r.slice()},f.tickFormat=function(p){return arguments.length?(i=p,f):i},f.tickSize=function(p){return arguments.length?(o=a=+p,f):o},f.tickSizeInner=function(p){return arguments.length?(o=+p,f):o},f.tickSizeOuter=function(p){return arguments.length?(a=+p,f):a},f.tickPadding=function(p){return arguments.length?(s=+p,f):s},f.offset=function(p){return arguments.length?(u=+p,f):u},f}function Yl(e){return Ko(Zo,e)}function i2(e){return Ko(Jo,e)}function up(e){return Ko(Fl,e)}function Wl(e){return Ko($i,e)}var o2={value:()=>{}};function Fn(){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 Qo(n)}function Qo(e){this._=e}function a2(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}})}Qo.prototype=Fn.prototype={constructor:Qo,on:function(e,t){var n=this._,r=a2(e+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(e=r[o]).type)&&(i=s2(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]=cp(n[i],e.name,t);else if(t==null)for(i in n)n[i]=cp(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 Qo(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 s2(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function cp(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=o2,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Xl="http://www.w3.org/1999/xhtml";const Gl={svg:"http://www.w3.org/2000/svg",xhtml:Xl,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function wi(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Gl.hasOwnProperty(t)?{space:Gl[t],local:e}:e}function l2(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Xl&&t.documentElement.namespaceURI===Xl?t.createElement(e):t.createElementNS(n,e)}}function u2(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ea(e){var t=wi(e);return(t.local?u2:l2)(t)}function c2(){}function ta(e){return e==null?c2:function(){return this.querySelector(e)}}function f2(e){typeof e!="function"&&(e=ta(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),u,l,c=0;c<a;++c)(u=o[c])&&(l=e.call(u,u.__data__,c,o))&&("__data__"in u&&(l.__data__=u.__data__),s[c]=l);return new Je(r,this._parents)}function fp(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function h2(){return[]}function Vl(e){return e==null?h2:function(){return this.querySelectorAll(e)}}function p2(e){return function(){return fp(e.apply(this,arguments))}}function d2(e){typeof e=="function"?e=p2(e):e=Vl(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var a=t[o],s=a.length,u,l=0;l<s;++l)(u=a[l])&&(r.push(e.call(u,u.__data__,l,a)),i.push(u));return new Je(r,i)}function jl(e){return function(){return this.matches(e)}}function hp(e){return function(t){return t.matches(e)}}var g2=Array.prototype.find;function m2(e){return function(){return g2.call(this.children,e)}}function y2(){return this.firstElementChild}function b2(e){return this.select(e==null?y2:m2(typeof e=="function"?e:hp(e)))}var x2=Array.prototype.filter;function v2(){return Array.from(this.children)}function S2(e){return function(){return x2.call(this.children,e)}}function $2(e){return this.selectAll(e==null?v2:S2(typeof e=="function"?e:hp(e)))}function w2(e){typeof e!="function"&&(e=jl(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]=[],u,l=0;l<a;++l)(u=o[l])&&e.call(u,u.__data__,l,o)&&s.push(u);return new Je(r,this._parents)}function pp(e){return new Array(e.length)}function _2(){return new Je(this._enter||this._groups.map(pp),this._parents)}function na(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}na.prototype={constructor:na,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 T2(e){return function(){return e}}function A2(e,t,n,r,i,o){for(var a=0,s,u=t.length,l=o.length;a<l;++a)(s=t[a])?(s.__data__=o[a],r[a]=s):n[a]=new na(e,o[a]);for(;a<u;++a)(s=t[a])&&(i[a]=s)}function D2(e,t,n,r,i,o,a){var s,u,l=new Map,c=t.length,h=o.length,f=new Array(c),p;for(s=0;s<c;++s)(u=t[s])&&(f[s]=p=a.call(u,u.__data__,s,t)+"",l.has(p)?i[s]=u:l.set(p,u));for(s=0;s<h;++s)p=a.call(e,o[s],s,o)+"",(u=l.get(p))?(r[s]=u,u.__data__=o[s],l.delete(p)):n[s]=new na(e,o[s]);for(s=0;s<c;++s)(u=t[s])&&l.get(f[s])===u&&(i[s]=u)}function M2(e){return e.__data__}function P2(e,t){if(!arguments.length)return Array.from(this,M2);var n=t?D2:A2,r=this._parents,i=this._groups;typeof e!="function"&&(e=T2(e));for(var o=i.length,a=new Array(o),s=new Array(o),u=new Array(o),l=0;l<o;++l){var c=r[l],h=i[l],f=h.length,p=C2(e.call(c,c&&c.__data__,l,r)),d=p.length,g=s[l]=new Array(d),m=a[l]=new Array(d),y=u[l]=new Array(f);n(c,h,g,m,y,p,t);for(var b=0,x=0,v,_;b<d;++b)if(v=g[b]){for(b>=x&&(x=b+1);!(_=m[x])&&++x<d;);v._next=_||null}}return a=new Je(a,r),a._enter=s,a._exit=u,a}function C2(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function L2(){return new Je(this._exit||this._groups.map(pp),this._parents)}function k2(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 R2(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),u=0;u<a;++u)for(var l=n[u],c=r[u],h=l.length,f=s[u]=new Array(h),p,d=0;d<h;++d)(p=l[d]||c[d])&&(f[d]=p);for(;u<i;++u)s[u]=n[u];return new Je(s,this._parents)}function E2(){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 N2(e){e||(e=B2);function t(h,f){return h&&f?e(h.__data__,f.__data__):!h-!f}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],s=a.length,u=i[o]=new Array(s),l,c=0;c<s;++c)(l=a[c])&&(u[c]=l);u.sort(t)}return new Je(i,this._parents).order()}function B2(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function z2(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function O2(){return Array.from(this)}function I2(){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 F2(){let e=0;for(const t of this)++e;return e}function Y2(){return!this.node()}function W2(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 X2(e){return function(){this.removeAttribute(e)}}function G2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function V2(e,t){return function(){this.setAttribute(e,t)}}function j2(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function U2(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function H2(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 q2(e,t){var n=wi(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?G2:X2:typeof t=="function"?n.local?H2:U2:n.local?j2:V2)(n,t))}function Ul(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Z2(e){return function(){this.style.removeProperty(e)}}function J2(e,t,n){return function(){this.style.setProperty(e,t,n)}}function K2(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Q2(e,t,n){return arguments.length>1?this.each((t==null?Z2:typeof t=="function"?K2:J2)(e,t,n??"")):Yn(this.node(),e)}function Yn(e,t){return e.style.getPropertyValue(t)||Ul(e).getComputedStyle(e,null).getPropertyValue(t)}function eS(e){return function(){delete this[e]}}function tS(e,t){return function(){this[e]=t}}function nS(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function rS(e,t){return arguments.length>1?this.each((t==null?eS:typeof t=="function"?nS:tS)(e,t)):this.node()[e]}function dp(e){return e.trim().split(/^|\s+/)}function Hl(e){return e.classList||new gp(e)}function gp(e){this._node=e,this._names=dp(e.getAttribute("class")||"")}gp.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 mp(e,t){for(var n=Hl(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function yp(e,t){for(var n=Hl(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function iS(e){return function(){mp(this,e)}}function oS(e){return function(){yp(this,e)}}function aS(e,t){return function(){(t.apply(this,arguments)?mp:yp)(this,e)}}function sS(e,t){var n=dp(e+"");if(arguments.length<2){for(var r=Hl(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?aS:t?iS:oS)(n,t))}function lS(){this.textContent=""}function uS(e){return function(){this.textContent=e}}function cS(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function fS(e){return arguments.length?this.each(e==null?lS:(typeof e=="function"?cS:uS)(e)):this.node().textContent}function hS(){this.innerHTML=""}function pS(e){return function(){this.innerHTML=e}}function dS(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function gS(e){return arguments.length?this.each(e==null?hS:(typeof e=="function"?dS:pS)(e)):this.node().innerHTML}function mS(){this.nextSibling&&this.parentNode.appendChild(this)}function yS(){return this.each(mS)}function bS(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function xS(){return this.each(bS)}function vS(e){var t=typeof e=="function"?e:ea(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function SS(){return null}function $S(e,t){var n=typeof e=="function"?e:ea(e),r=t==null?SS:typeof t=="function"?t:ta(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function wS(){var e=this.parentNode;e&&e.removeChild(this)}function _S(){return this.each(wS)}function TS(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function AS(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function DS(e){return this.select(e?AS:TS)}function MS(e){return arguments.length?this.property("__data__",e):this.node().__data__}function PS(e){return function(t){e.call(this,t,this.__data__)}}function CS(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 LS(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 kS(e,t,n){return function(){var r=this.__on,i,o=PS(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 RS(e,t,n){var r=CS(e+""),i,o=r.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var u=0,l=s.length,c;u<l;++u)for(i=0,c=s[u];i<o;++i)if((a=r[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=t?kS:LS,i=0;i<o;++i)this.each(s(r[i],t,n));return this}function bp(e,t,n){var r=Ul(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 ES(e,t){return function(){return bp(this,e,t)}}function NS(e,t){return function(){return bp(this,e,t.apply(this,arguments))}}function BS(e,t){return this.each((typeof t=="function"?NS:ES)(e,t))}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,a;i<o;++i)(a=r[i])&&(yield a)}var ql=[null];function Je(e,t){this._groups=e,this._parents=t}function Wn(){return new Je([[document.documentElement]],ql)}function OS(){return this}Je.prototype=Wn.prototype={constructor:Je,select:f2,selectAll:d2,selectChild:b2,selectChildren:$2,filter:w2,data:P2,enter:_2,exit:L2,join:k2,merge:R2,selection:OS,order:E2,sort:N2,call:z2,nodes:O2,node:I2,size:F2,empty:Y2,each:W2,attr:q2,style:Q2,property:rS,classed:sS,text:fS,html:gS,raise:yS,lower:xS,append:vS,insert:$S,remove:_S,clone:DS,datum:MS,on:RS,dispatch:BS,[Symbol.iterator]:zS};function I(e){return typeof e=="string"?new Je([[document.querySelector(e)]],[document.documentElement]):new Je([[e]],ql)}function IS(e){return I(ea(e).call(document.documentElement))}var FS=0;function xp(){return new Zl}function Zl(){this._="@"+(++FS).toString(36)}Zl.prototype=xp.prototype={constructor:Zl,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 vp(e){let t;for(;t=e.sourceEvent;)e=t;return e}function dt(e,t){if(e=vp(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 YS(e,t){return e.target&&(e=vp(e),t===void 0&&(t=e.currentTarget),e=e.touches||[e]),Array.from(e,n=>dt(n,t))}function Sp(e){return typeof e=="string"?new Je([document.querySelectorAll(e)],[document.documentElement]):new Je([fp(e)],ql)}const WS={passive:!1},_i={capture:!0,passive:!1};function Jl(e){e.stopImmediatePropagation()}function Dr(e){e.preventDefault(),e.stopImmediatePropagation()}function ra(e){var t=e.document.documentElement,n=I(e).on("dragstart.drag",Dr,_i);"onselectstart"in t?n.on("selectstart.drag",Dr,_i):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ia(e,t){var n=e.document.documentElement,r=I(e).on("dragstart.drag",null);t&&(r.on("click.drag",Dr,_i),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 oa=e=>()=>e;function Kl(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:a,y:s,dx:u,dy:l,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:u,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:c}})}Kl.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function XS(e){return!e.ctrlKey&&!e.button}function GS(){return this.parentNode}function VS(e,t){return t??{x:e.x,y:e.y}}function jS(){return navigator.maxTouchPoints||"ontouchstart"in this}function aa(){var e=XS,t=GS,n=VS,r=jS,i={},o=Fn("start","drag","end"),a=0,s,u,l,c,h=0;function f(v){v.on("mousedown.drag",p).filter(r).on("touchstart.drag",m).on("touchmove.drag",y,WS).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(v,_){if(!(c||!e.call(this,v,_))){var w=x(this,t.call(this,v,_),v,_,"mouse");w&&(I(v.view).on("mousemove.drag",d,_i).on("mouseup.drag",g,_i),ra(v.view),Jl(v),l=!1,s=v.clientX,u=v.clientY,w("start",v))}}function d(v){if(Dr(v),!l){var _=v.clientX-s,w=v.clientY-u;l=_*_+w*w>h}i.mouse("drag",v)}function g(v){I(v.view).on("mousemove.drag mouseup.drag",null),ia(v.view,l),Dr(v),i.mouse("end",v)}function m(v,_){if(e.call(this,v,_)){var w=v.changedTouches,P=t.call(this,v,_),C=w.length,L,E;for(L=0;L<C;++L)(E=x(this,P,v,_,w[L].identifier,w[L]))&&(Jl(v),E("start",v,w[L]))}}function y(v){var _=v.changedTouches,w=_.length,P,C;for(P=0;P<w;++P)(C=i[_[P].identifier])&&(Dr(v),C("drag",v,_[P]))}function b(v){var _=v.changedTouches,w=_.length,P,C;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),P=0;P<w;++P)(C=i[_[P].identifier])&&(Jl(v),C("end",v,_[P]))}function x(v,_,w,P,C,L){var E=o.copy(),N=dt(L||w,_),A,R,S;if((S=n.call(v,new Kl("beforestart",{sourceEvent:w,target:f,identifier:C,active:a,x:N[0],y:N[1],dx:0,dy:0,dispatch:E}),P))!=null)return A=S.x-N[0]||0,R=S.y-N[1]||0,function M($,B,D){var z=N,F;switch($){case"start":i[C]=M,F=a++;break;case"end":delete i[C],--a;case"drag":N=dt(D||B,_),F=a;break}E.call($,v,new Kl($,{sourceEvent:B,subject:S,target:f,identifier:C,active:F,x:N[0]+A,y:N[1]+R,dx:N[0]-z[0],dy:N[1]-z[1],dispatch:E}),P)}}return f.filter=function(v){return arguments.length?(e=typeof v=="function"?v:oa(!!v),f):e},f.container=function(v){return arguments.length?(t=typeof v=="function"?v:oa(v),f):t},f.subject=function(v){return arguments.length?(n=typeof v=="function"?v:oa(v),f):n},f.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:oa(!!v),f):r},f.on=function(){var v=o.on.apply(o,arguments);return v===o?f:v},f.clickDistance=function(v){return arguments.length?(h=(v=+v)*v,f):Math.sqrt(h)},f}function Mr(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ti(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function yn(){}var Xn=.7,Pr=1/Xn,Cr="\\s*([+-]?\\d+)\\s*",Ai="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Bt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",US=/^#([0-9a-f]{3,8})$/,HS=new RegExp(`^rgb\\(${Cr},${Cr},${Cr}\\)$`),qS=new RegExp(`^rgb\\(${Bt},${Bt},${Bt}\\)$`),ZS=new RegExp(`^rgba\\(${Cr},${Cr},${Cr},${Ai}\\)$`),JS=new RegExp(`^rgba\\(${Bt},${Bt},${Bt},${Ai}\\)$`),KS=new RegExp(`^hsl\\(${Ai},${Bt},${Bt}\\)$`),QS=new RegExp(`^hsla\\(${Ai},${Bt},${Bt},${Ai}\\)$`),$p={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};Mr(yn,bn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:wp,formatHex:wp,formatHex8:e$,formatHsl:t$,formatRgb:_p,toString:_p});function wp(){return this.rgb().formatHex()}function e$(){return this.rgb().formatHex8()}function t$(){return Pp(this).formatHsl()}function _p(){return this.rgb().formatRgb()}function bn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=US.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Tp(t):n===3?new Ne(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?sa(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?sa(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=HS.exec(e))?new Ne(t[1],t[2],t[3],1):(t=qS.exec(e))?new Ne(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ZS.exec(e))?sa(t[1],t[2],t[3],t[4]):(t=JS.exec(e))?sa(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=KS.exec(e))?Mp(t[1],t[2]/100,t[3]/100,1):(t=QS.exec(e))?Mp(t[1],t[2]/100,t[3]/100,t[4]):$p.hasOwnProperty(e)?Tp($p[e]):e==="transparent"?new Ne(NaN,NaN,NaN,0):null}function Tp(e){return new Ne(e>>16&255,e>>8&255,e&255,1)}function sa(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ne(e,t,n,r)}function Ql(e){return e instanceof yn||(e=bn(e)),e?(e=e.rgb(),new Ne(e.r,e.g,e.b,e.opacity)):new Ne}function Lr(e,t,n,r){return arguments.length===1?Ql(e):new Ne(e,t,n,r??1)}function Ne(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Mr(Ne,Lr,Ti(yn,{brighter(e){return e=e==null?Pr:Math.pow(Pr,e),new Ne(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Xn:Math.pow(Xn,e),new Ne(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ne(Gn(this.r),Gn(this.g),Gn(this.b),la(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:Ap,formatHex:Ap,formatHex8:n$,formatRgb:Dp,toString:Dp}));function Ap(){return`#${Vn(this.r)}${Vn(this.g)}${Vn(this.b)}`}function n$(){return`#${Vn(this.r)}${Vn(this.g)}${Vn(this.b)}${Vn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Dp(){const e=la(this.opacity);return`${e===1?"rgb(":"rgba("}${Gn(this.r)}, ${Gn(this.g)}, ${Gn(this.b)}${e===1?")":`, ${e})`}`}function la(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 Vn(e){return e=Gn(e),(e<16?"0":"")+e.toString(16)}function Mp(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 Pp(e){if(e instanceof Mt)return new Mt(e.h,e.s,e.l,e.opacity);if(e instanceof yn||(e=bn(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,u=(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/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new Mt(a,s,u,e.opacity)}function ua(e,t,n,r){return arguments.length===1?Pp(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}Mr(Mt,ua,Ti(yn,{brighter(e){return e=e==null?Pr:Math.pow(Pr,e),new Mt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Xn:Math.pow(Xn,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 Ne(eu(e>=240?e-240:e+120,i,r),eu(e,i,r),eu(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Mt(Cp(this.h),ca(this.s),ca(this.l),la(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=la(this.opacity);return`${e===1?"hsl(":"hsla("}${Cp(this.h)}, ${ca(this.s)*100}%, ${ca(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Cp(e){return e=(e||0)%360,e<0?e+360:e}function ca(e){return Math.max(0,Math.min(1,e||0))}function eu(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 Lp=Math.PI/180,kp=180/Math.PI,fa=18,Rp=.96422,Ep=1,Np=.82521,Bp=4/29,kr=6/29,zp=3*kr*kr,r$=kr*kr*kr;function Op(e){if(e instanceof Pt)return new Pt(e.l,e.a,e.b,e.opacity);if(e instanceof zt)return Fp(e);e instanceof Ne||(e=Ql(e));var t=iu(e.r),n=iu(e.g),r=iu(e.b),i=tu((.2225045*t+.7168786*n+.0606169*r)/Ep),o,a;return t===n&&n===r?o=a=i:(o=tu((.4360747*t+.3850649*n+.1430804*r)/Rp),a=tu((.0139322*t+.0971045*n+.7141733*r)/Np)),new Pt(116*i-16,500*(o-i),200*(i-a),e.opacity)}function i$(e,t){return new Pt(e,0,0,t??1)}function Di(e,t,n,r){return arguments.length===1?Op(e):new Pt(e,t,n,r??1)}function Pt(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}Mr(Pt,Di,Ti(yn,{brighter(e){return new Pt(this.l+fa*(e??1),this.a,this.b,this.opacity)},darker(e){return new Pt(this.l-fa*(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=Rp*nu(t),e=Ep*nu(e),n=Np*nu(n),new Ne(ru(3.1338561*t-1.6168667*e-.4906146*n),ru(-.9787684*t+1.9161415*e+.033454*n),ru(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function tu(e){return e>r$?Math.pow(e,1/3):e/zp+Bp}function nu(e){return e>kr?e*e*e:zp*(e-Bp)}function ru(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function iu(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ip(e){if(e instanceof zt)return new zt(e.h,e.c,e.l,e.opacity);if(e instanceof Pt||(e=Op(e)),e.a===0&&e.b===0)return new zt(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*kp;return new zt(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function o$(e,t,n,r){return arguments.length===1?Ip(e):new zt(n,t,e,r??1)}function ha(e,t,n,r){return arguments.length===1?Ip(e):new zt(e,t,n,r??1)}function zt(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Fp(e){if(isNaN(e.h))return new Pt(e.l,0,0,e.opacity);var t=e.h*Lp;return new Pt(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Mr(zt,ha,Ti(yn,{brighter(e){return new zt(this.h,this.c,this.l+fa*(e??1),this.opacity)},darker(e){return new zt(this.h,this.c,this.l-fa*(e??1),this.opacity)},rgb(){return Fp(this).rgb()}}));var Yp=-.14861,ou=1.78277,au=-.29227,pa=-.90649,Mi=1.97294,Wp=Mi*pa,Xp=Mi*ou,Gp=ou*au-pa*Yp;function a$(e){if(e instanceof jn)return new jn(e.h,e.s,e.l,e.opacity);e instanceof Ne||(e=Ql(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(Gp*r+Wp*t-Xp*n)/(Gp+Wp-Xp),o=r-i,a=(Mi*(n-i)-au*o)/pa,s=Math.sqrt(a*a+o*o)/(Mi*i*(1-i)),u=s?Math.atan2(a,o)*kp-120:NaN;return new jn(u<0?u+360:u,s,i,e.opacity)}function Ct(e,t,n,r){return arguments.length===1?a$(e):new jn(e,t,n,r??1)}function jn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Mr(jn,Ct,Ti(yn,{brighter(e){return e=e==null?Pr:Math.pow(Pr,e),new jn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Xn:Math.pow(Xn,e),new jn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Lp,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Ne(255*(t+n*(Yp*r+ou*i)),255*(t+n*(au*r+pa*i)),255*(t+n*(Mi*r)),this.opacity)}}));function Vp(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 jp(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 Vp((n-r/t)*t,a,i,o,s)}}function Up(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 Vp((n-r/t)*t,i,o,a,s)}}const da=e=>()=>e;function Hp(e,t){return function(n){return e+n*t}}function s$(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 ga(e,t){var n=t-e;return n?Hp(e,n>180||n<-180?n-360*Math.round(n/360):n):da(isNaN(e)?t:e)}function l$(e){return(e=+e)==1?Be:function(t,n){return n-t?s$(t,n,e):da(isNaN(t)?n:t)}}function Be(e,t){var n=t-e;return n?Hp(e,n):da(isNaN(e)?t:e)}const Pi=function e(t){var n=l$(t);function r(i,o){var a=n((i=Lr(i)).r,(o=Lr(o)).r),s=n(i.g,o.g),u=n(i.b,o.b),l=Be(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=u(c),i.opacity=l(c),i+""}}return r.gamma=e,r}(1);function qp(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=Lr(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(u){return s.r=r(u),s.g=i(u),s.b=o(u),s+""}}}var Zp=qp(jp),u$=qp(Up);function su(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 Jp(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function c$(e,t){return(Jp(t)?su:Kp)(e,t)}function Kp(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]=Ht(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 Qp(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function xt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function ed(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]=Ht(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var lu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,uu=new RegExp(lu.source,"g");function f$(e){return function(){return e}}function h$(e){return function(t){return e(t)+""}}function cu(e,t){var n=lu.lastIndex=uu.lastIndex=0,r,i,o,a=-1,s=[],u=[];for(e=e+"",t=t+"";(r=lu.exec(e))&&(i=uu.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,u.push({i:a,x:xt(r,i)})),n=uu.lastIndex;return n<t.length&&(o=t.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?u[0]?h$(u[0].x):f$(t):(t=u.length,function(l){for(var c=0,h;c<t;++c)s[(h=u[c]).i]=h.x(l);return s.join("")})}function Ht(e,t){var n=typeof t,r;return t==null||n==="boolean"?da(t):(n==="number"?xt:n==="string"?(r=bn(t))?(t=r,Pi):cu:t instanceof bn?Pi:t instanceof Date?Qp:Jp(t)?su:Array.isArray(t)?Kp:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?ed:xt)(e,t)}function p$(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}function d$(e,t){var n=ga(+e,+t);return function(r){var i=n(r);return i-360*Math.floor(i/360)}}function ma(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var td=180/Math.PI,fu={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function nd(e,t,n,r,i,o){var a,s,u;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),e*r<t*n&&(e=-e,t=-t,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*td,skewX:Math.atan(u)*td,scaleX:a,scaleY:s}}var ya;function g$(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?fu:nd(t.a,t.b,t.c,t.d,t.e,t.f)}function m$(e){return e==null||(ya||(ya=document.createElementNS("http://www.w3.org/2000/svg","g")),ya.setAttribute("transform",e),!(e=ya.transform.baseVal.consolidate()))?fu:(e=e.matrix,nd(e.a,e.b,e.c,e.d,e.e,e.f))}function rd(e,t,n,r){function i(l){return l.length?l.pop()+" ":""}function o(l,c,h,f,p,d){if(l!==h||c!==f){var g=p.push("translate(",null,t,null,n);d.push({i:g-4,x:xt(l,h)},{i:g-2,x:xt(c,f)})}else(h||f)&&p.push("translate("+h+t+f+n)}function a(l,c,h,f){l!==c?(l-c>180?c+=360:c-l>180&&(l+=360),f.push({i:h.push(i(h)+"rotate(",null,r)-2,x:xt(l,c)})):c&&h.push(i(h)+"rotate("+c+r)}function s(l,c,h,f){l!==c?f.push({i:h.push(i(h)+"skewX(",null,r)-2,x:xt(l,c)}):c&&h.push(i(h)+"skewX("+c+r)}function u(l,c,h,f,p,d){if(l!==h||c!==f){var g=p.push(i(p)+"scale(",null,",",null,")");d.push({i:g-4,x:xt(l,h)},{i:g-2,x:xt(c,f)})}else(h!==1||f!==1)&&p.push(i(p)+"scale("+h+","+f+")")}return function(l,c){var h=[],f=[];return l=e(l),c=e(c),o(l.translateX,l.translateY,c.translateX,c.translateY,h,f),a(l.rotate,c.rotate,h,f),s(l.skewX,c.skewX,h,f),u(l.scaleX,l.scaleY,c.scaleX,c.scaleY,h,f),l=c=null,function(p){for(var d=-1,g=f.length,m;++d<g;)h[(m=f[d]).i]=m.x(p);return h.join("")}}}var id=rd(g$,"px, ","px)","deg)"),od=rd(m$,", ",")",")"),y$=1e-12;function ad(e){return((e=Math.exp(e))+1/e)/2}function b$(e){return((e=Math.exp(e))-1/e)/2}function x$(e){return((e=Math.exp(2*e))-1)/(e+1)}const sd=function e(t,n,r){function i(o,a){var s=o[0],u=o[1],l=o[2],c=a[0],h=a[1],f=a[2],p=c-s,d=h-u,g=p*p+d*d,m,y;if(g<y$)y=Math.log(f/l)/t,m=function(P){return[s+P*p,u+P*d,l*Math.exp(t*P*y)]};else{var b=Math.sqrt(g),x=(f*f-l*l+r*g)/(2*l*n*b),v=(f*f-l*l-r*g)/(2*f*n*b),_=Math.log(Math.sqrt(x*x+1)-x),w=Math.log(Math.sqrt(v*v+1)-v);y=(w-_)/t,m=function(P){var C=P*y,L=ad(_),E=l/(n*b)*(L*x$(t*C+_)-b$(_));return[s+E*p,u+E*d,l*L/ad(t*C+_)]}}return m.duration=y*1e3*t/Math.SQRT2,m}return i.rho=function(o){var a=Math.max(.001,+o),s=a*a,u=s*s;return e(a,s,u)},i}(Math.SQRT2,2,4);function ld(e){return function(t,n){var r=e((t=ua(t)).h,(n=ua(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 v$=ld(ga);var S$=ld(Be);function $$(e,t){var n=Be((e=Di(e)).l,(t=Di(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 ud(e){return function(t,n){var r=e((t=ha(t)).h,(n=ha(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 w$=ud(ga);var _$=ud(Be);function cd(e){return function t(n){n=+n;function r(i,o){var a=e((i=Ct(i)).h,(o=Ct(o)).h),s=Be(i.s,o.s),u=Be(i.l,o.l),l=Be(i.opacity,o.opacity);return function(c){return i.h=a(c),i.s=s(c),i.l=u(Math.pow(c,n)),i.opacity=l(c),i+""}}return r.gamma=t,r}(1)}const T$=cd(ga);var ba=cd(Be);function fd(e,t){t===void 0&&(t=e,e=Ht);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 A$(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e(r/(t-1));return n}var Rr=0,Ci=0,Li=0,hd=1e3,xa,ki,va=0,Un=0,Sa=0,Ri=typeof performance=="object"&&performance.now?performance:Date,pd=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ei(){return Un||(pd(D$),Un=Ri.now()+Sa)}function D$(){Un=0}function Ni(){this._call=this._time=this._next=null}Ni.prototype=$a.prototype={constructor:Ni,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ei():+n)+(t==null?0:+t),!this._next&&ki!==this&&(ki?ki._next=this:xa=this,ki=this),this._call=e,this._time=n,hu()},stop:function(){this._call&&(this._call=null,this._time=1/0,hu())}};function $a(e,t,n){var r=new Ni;return r.restart(e,t,n),r}function dd(){Ei(),++Rr;for(var e=xa,t;e;)(t=Un-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Rr}function gd(){Un=(va=Ri.now())+Sa,Rr=Ci=0;try{dd()}finally{Rr=0,P$(),Un=0}}function M$(){var e=Ri.now(),t=e-va;t>hd&&(Sa-=t,va=e)}function P$(){for(var e,t=xa,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:xa=n);ki=e,hu(r)}function hu(e){if(!Rr){Ci&&(Ci=clearTimeout(Ci));var t=e-Un;t>24?(e<1/0&&(Ci=setTimeout(gd,e-Ri.now()-Sa)),Li&&(Li=clearInterval(Li))):(Li||(va=Ri.now(),Li=setInterval(M$,hd)),Rr=1,pd(gd))}}function pu(e,t,n){var r=new Ni;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}function C$(e,t,n){var r=new Ni,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?Ei():+s,r._restart(function u(l){l+=i,r._restart(u,i+=a,s),o(l)},a,s)},r.restart(e,t,n),r)}var L$=Fn("start","end","cancel","interrupt"),k$=[],md=0,du=1,gu=2,wa=3,yd=4,mu=5,_a=6;function Ta(e,t,n,r,i,o){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;R$(e,n,{name:t,index:r,group:i,on:L$,tween:k$,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:md})}function yu(e,t){var n=Lt(e,t);if(n.state>md)throw new Error("too late; already scheduled");return n}function Ot(e,t){var n=Lt(e,t);if(n.state>wa)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 R$(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=$a(o,0,n.time);function o(l){n.state=du,n.timer.restart(a,n.delay,n.time),n.delay<=l&&a(l-n.delay)}function a(l){var c,h,f,p;if(n.state!==du)return u();for(c in r)if(p=r[c],p.name===n.name){if(p.state===wa)return pu(a);p.state===yd?(p.state=_a,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[c]):+c<t&&(p.state=_a,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[c])}if(pu(function(){n.state===wa&&(n.state=yd,n.timer.restart(s,n.delay,n.time),s(l))}),n.state=gu,n.on.call("start",e,e.__data__,n.index,n.group),n.state===gu){for(n.state=wa,i=new Array(f=n.tween.length),c=0,h=-1;c<f;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++h]=p);i.length=h+1}}function s(l){for(var c=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(u),n.state=mu,1),h=-1,f=i.length;++h<f;)i[h].call(e,c);n.state===mu&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=_a,n.timer.stop(),delete r[t];for(var l in r)return;delete e.__transition}}function Hn(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>gu&&r.state<mu,r.state=_a,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}o&&delete e.__transition}}function E$(e){return this.each(function(){Hn(this,e)})}function N$(e,t){var n,r;return function(){var i=Ot(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 B$(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=Ot(this,e),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:t,value:n},u=0,l=i.length;u<l;++u)if(i[u].name===t){i[u]=s;break}u===l&&i.push(s)}o.tween=i}}function z$(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?N$:B$)(n,e,t))}function bu(e,t,n){var r=e._id;return e.each(function(){var i=Ot(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Lt(i,r).value[t]}}function bd(e,t){var n;return(typeof t=="number"?xt:t instanceof bn?Pi:(n=bn(t))?(t=n,Pi):cu)(e,t)}function O$(e){return function(){this.removeAttribute(e)}}function I$(e){return function(){this.removeAttributeNS(e.space,e.local)}}function F$(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 Y$(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 W$(e,t,n){var r,i,o;return function(){var a,s=n(this),u;return s==null?void this.removeAttribute(e):(a=this.getAttribute(e),u=s+"",a===u?null:a===r&&u===i?o:(i=u,o=t(r=a,s)))}}function X$(e,t,n){var r,i,o;return function(){var a,s=n(this),u;return s==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),u=s+"",a===u?null:a===r&&u===i?o:(i=u,o=t(r=a,s)))}}function G$(e,t){var n=wi(e),r=n==="transform"?od:bd;return this.attrTween(e,typeof t=="function"?(n.local?X$:W$)(n,r,bu(this,"attr."+e,t)):t==null?(n.local?I$:O$)(n):(n.local?Y$:F$)(n,r,t))}function V$(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function j$(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function U$(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&j$(e,o)),n}return i._value=t,i}function H$(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&V$(e,o)),n}return i._value=t,i}function q$(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=wi(e);return this.tween(n,(r.local?U$:H$)(r,t))}function Z$(e,t){return function(){yu(this,e).delay=+t.apply(this,arguments)}}function J$(e,t){return t=+t,function(){yu(this,e).delay=t}}function K$(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Z$:J$)(t,e)):Lt(this.node(),t).delay}function Q$(e,t){return function(){Ot(this,e).duration=+t.apply(this,arguments)}}function ew(e,t){return t=+t,function(){Ot(this,e).duration=t}}function tw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Q$:ew)(t,e)):Lt(this.node(),t).duration}function nw(e,t){if(typeof t!="function")throw new Error;return function(){Ot(this,e).ease=t}}function rw(e){var t=this._id;return arguments.length?this.each(nw(t,e)):Lt(this.node(),t).ease}function iw(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ot(this,e).ease=n}}function ow(e){if(typeof e!="function")throw new Error;return this.each(iw(this._id,e))}function aw(e){typeof e!="function"&&(e=jl(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]=[],u,l=0;l<a;++l)(u=o[l])&&e.call(u,u.__data__,l,o)&&s.push(u);return new It(r,this._parents,this._name,this._id)}function sw(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 u=t[s],l=n[s],c=u.length,h=a[s]=new Array(c),f,p=0;p<c;++p)(f=u[p]||l[p])&&(h[p]=f);for(;s<r;++s)a[s]=t[s];return new It(a,this._parents,this._name,this._id)}function lw(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 uw(e,t,n){var r,i,o=lw(t)?yu:Ot;return function(){var a=o(this,e),s=a.on;s!==r&&(i=(r=s).copy()).on(t,n),a.on=i}}function cw(e,t){var n=this._id;return arguments.length<2?Lt(this.node(),n).on.on(e):this.each(uw(n,e,t))}function fw(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function hw(){return this.on("end.remove",fw(this._id))}function pw(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ta(e));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s=r[a],u=s.length,l=o[a]=new Array(u),c,h,f=0;f<u;++f)(c=s[f])&&(h=e.call(c,c.__data__,f,s))&&("__data__"in c&&(h.__data__=c.__data__),l[f]=h,Ta(l[f],t,n,f,l,Lt(c,n)));return new It(o,this._parents,t,n)}function dw(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Vl(e));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var u=r[s],l=u.length,c,h=0;h<l;++h)if(c=u[h]){for(var f=e.call(c,c.__data__,h,u),p,d=Lt(c,n),g=0,m=f.length;g<m;++g)(p=f[g])&&Ta(p,t,n,g,f,d);o.push(f),a.push(c)}return new It(o,a,t,n)}var gw=Wn.prototype.constructor;function mw(){return new gw(this._groups,this._parents)}function yw(e,t){var n,r,i;return function(){var o=Yn(this,e),a=(this.style.removeProperty(e),Yn(this,e));return o===a?null:o===n&&a===r?i:i=t(n=o,r=a)}}function xd(e){return function(){this.style.removeProperty(e)}}function bw(e,t,n){var r,i=n+"",o;return function(){var a=Yn(this,e);return a===i?null:a===r?o:o=t(r=a,n)}}function xw(e,t,n){var r,i,o;return function(){var a=Yn(this,e),s=n(this),u=s+"";return s==null&&(u=s=(this.style.removeProperty(e),Yn(this,e))),a===u?null:a===r&&u===i?o:(i=u,o=t(r=a,s))}}function vw(e,t){var n,r,i,o="style."+t,a="end."+o,s;return function(){var u=Ot(this,e),l=u.on,c=u.value[o]==null?s||(s=xd(t)):void 0;(l!==n||i!==c)&&(r=(n=l).copy()).on(a,i=c),u.on=r}}function Sw(e,t,n){var r=(e+="")=="transform"?id:bd;return t==null?this.styleTween(e,yw(e,r)).on("end.style."+e,xd(e)):typeof t=="function"?this.styleTween(e,xw(e,r,bu(this,"style."+e,t))).each(vw(this._id,e)):this.styleTween(e,bw(e,r,t),n).on("end.style."+e,null)}function $w(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function ww(e,t,n){var r,i;function o(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&$w(e,a,n)),r}return o._value=t,o}function _w(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,ww(e,t,n??""))}function Tw(e){return function(){this.textContent=e}}function Aw(e){return function(){var t=e(this);this.textContent=t??""}}function Dw(e){return this.tween("text",typeof e=="function"?Aw(bu(this,"text",e)):Tw(e==null?"":e+""))}function Mw(e){return function(t){this.textContent=e.call(this,t)}}function Pw(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Mw(i)),t}return r._value=e,r}function Cw(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,Pw(e))}function Lw(){for(var e=this._name,t=this._id,n=Sd(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,u,l=0;l<s;++l)if(u=a[l]){var c=Lt(u,t);Ta(u,e,n,l,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new It(r,this._parents,e,n)}function kw(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var s={value:a},u={value:function(){--i===0&&o()}};n.each(function(){var l=Ot(this,r),c=l.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(u)),l.on=t}),i===0&&o()})}var Rw=0;function It(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function vd(e){return Wn().transition(e)}function Sd(){return++Rw}var qt=Wn.prototype;It.prototype=vd.prototype={constructor:It,select:pw,selectAll:dw,selectChild:qt.selectChild,selectChildren:qt.selectChildren,filter:aw,merge:sw,selection:mw,transition:Lw,call:qt.call,nodes:qt.nodes,node:qt.node,size:qt.size,empty:qt.empty,each:qt.each,on:cw,attr:G$,attrTween:q$,style:Sw,styleTween:_w,text:Dw,textTween:Cw,remove:hw,tween:z$,delay:K$,duration:tw,ease:rw,easeVarying:ow,end:kw,[Symbol.iterator]:qt[Symbol.iterator]};const Bi=e=>+e;function Ew(e){return e*e}function Nw(e){return e*(2-e)}function $d(e){return((e*=2)<=1?e*e:--e*(2-e)+1)/2}function Bw(e){return e*e*e}function zw(e){return--e*e*e+1}function zi(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var xu=3,Ow=function e(t){t=+t;function n(r){return Math.pow(r,t)}return n.exponent=e,n}(xu),Iw=function e(t){t=+t;function n(r){return 1-Math.pow(1-r,t)}return n.exponent=e,n}(xu),wd=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}(xu),_d=Math.PI,Td=_d/2;function Fw(e){return+e==1?1:1-Math.cos(e*Td)}function Yw(e){return Math.sin(e*Td)}function Ad(e){return(1-Math.cos(_d*e))/2}function xn(e){return(Math.pow(2,-10*e)-.0009765625)*1.0009775171065494}function Ww(e){return xn(1-+e)}function Xw(e){return 1-xn(e)}function Dd(e){return((e*=2)<=1?xn(1-e):2-xn(e-1))/2}function Gw(e){return 1-Math.sqrt(1-e*e)}function Vw(e){return Math.sqrt(1- --e*e)}function Md(e){return((e*=2)<=1?1-Math.sqrt(1-e*e):Math.sqrt(1-(e-=2)*e)+1)/2}var vu=4/11,jw=6/11,Uw=8/11,Hw=3/4,qw=9/11,Zw=10/11,Jw=15/16,Kw=21/22,Qw=63/64,Aa=1/vu/vu;function e_(e){return 1-Oi(1-e)}function Oi(e){return(e=+e)<vu?Aa*e*e:e<Uw?Aa*(e-=jw)*e+Hw:e<Zw?Aa*(e-=qw)*e+Jw:Aa*(e-=Kw)*e+Qw}function t_(e){return((e*=2)<=1?1-Oi(1-e):Oi(e-1)+1)/2}var Su=1.70158,n_=function e(t){t=+t;function n(r){return(r=+r)*r*(t*(r-1)+r)}return n.overshoot=e,n}(Su),r_=function e(t){t=+t;function n(r){return--r*r*((r+1)*t+r)+1}return n.overshoot=e,n}(Su),Pd=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}(Su),Er=2*Math.PI,$u=1,wu=.3,i_=function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Er);function i(o){return t*xn(- --o)*Math.sin((r-o)/n)}return i.amplitude=function(o){return e(o,n*Er)},i.period=function(o){return e(t,o)},i}($u,wu),qn=function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Er);function i(o){return 1-t*xn(o=+o)*Math.sin((o+r)/n)}return i.amplitude=function(o){return e(o,n*Er)},i.period=function(o){return e(t,o)},i}($u,wu),o_=function e(t,n){var r=Math.asin(1/(t=Math.max(1,t)))*(n/=Er);function i(o){return((o=o*2-1)<0?t*xn(-o)*Math.sin((r-o)/n):2-t*xn(o)*Math.sin((r+o)/n))/2}return i.amplitude=function(o){return e(o,n*Er)},i.period=function(o){return e(t,o)},i}($u,wu),a_={time:null,delay:0,duration:250,ease:zi};function s_(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 l_(e){var t,n;e instanceof It?(t=e._id,e=e._name):(t=Sd(),(n=a_).time=Ei(),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,u,l=0;l<s;++l)(u=a[l])&&Ta(u,e,t,l,a,n||s_(u,t));return new It(r,this._parents,e,t)}Wn.prototype.interrupt=E$,Wn.prototype.transition=l_;var u_=[null];function c_(e,t){var n=e.__transition,r,i;if(n){t=t==null?null:t+"";for(i in n)if((r=n[i]).state>du&&r.name===t)return new It([[e]],u_,t,+i)}return null}const _u=e=>()=>e;function f_(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 h_(e){e.stopImmediatePropagation()}function Tu(e){e.preventDefault(),e.stopImmediatePropagation()}var Cd={name:"drag"},Au={name:"space"},Nr={name:"handle"},Br={name:"center"};const{abs:Ld,max:je,min:Ue}=Math;function kd(e){return[+e[0],+e[1]]}function Du(e){return[kd(e[0]),kd(e[1])]}var Da={name:"x",handles:["w","e"].map(Ii),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]]}},Ma={name:"y",handles:["n","s"].map(Ii),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]]}},p_={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Ii),input:function(e){return e==null?null:Du(e)},output:function(e){return e}},Zt={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"},Rd={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Ed={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},d_={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},g_={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Ii(e){return{type:e}}function m_(e){return!e.ctrlKey&&!e.button}function y_(){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 b_(){return navigator.maxTouchPoints||"ontouchstart"in this}function Mu(e){for(;!e.__brush;)if(!(e=e.parentNode))return;return e.__brush}function x_(e){return e[0][0]===e[1][0]||e[0][1]===e[1][1]}function v_(e){var t=e.__brush;return t?t.dim.output(t.selection):null}function S_(){return Pu(Da)}function $_(){return Pu(Ma)}function w_(){return Pu(p_)}function Pu(e){var t=y_,n=m_,r=b_,i=!0,o=Fn("start","brush","end"),a=6,s;function u(m){var y=m.property("__brush",g).selectAll(".overlay").data([Ii("overlay")]);y.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Zt.overlay).merge(y).each(function(){var x=Mu(this).extent;I(this).attr("x",x[0][0]).attr("y",x[0][1]).attr("width",x[1][0]-x[0][0]).attr("height",x[1][1]-x[0][1])}),m.selectAll(".selection").data([Ii("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Zt.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var b=m.selectAll(".handle").data(e.handles,function(x){return x.type});b.exit().remove(),b.enter().append("rect").attr("class",function(x){return"handle handle--"+x.type}).attr("cursor",function(x){return Zt[x.type]}),m.each(l).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",f).filter(r).on("touchstart.brush",f).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",d).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}u.move=function(m,y,b){m.tween?m.on("start.brush",function(x){c(this,arguments).beforestart().start(x)}).on("interrupt.brush end.brush",function(x){c(this,arguments).end(x)}).tween("brush",function(){var x=this,v=x.__brush,_=c(x,arguments),w=v.selection,P=e.input(typeof y=="function"?y.apply(this,arguments):y,v.extent),C=Ht(w,P);function L(E){v.selection=E===1&&P===null?null:C(E),l.call(x),_.brush()}return w!==null&&P!==null?L:L(1)}):m.each(function(){var x=this,v=arguments,_=x.__brush,w=e.input(typeof y=="function"?y.apply(x,v):y,_.extent),P=c(x,v).beforestart();Hn(x),_.selection=w===null?null:w,l.call(x),P.start(b).brush(b).end(b)})},u.clear=function(m,y){u.move(m,null,y)};function l(){var m=I(this),y=Mu(this).selection;y?(m.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]),m.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})):m.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function c(m,y,b){var x=m.__brush.emitter;return x&&(!b||!x.clean)?x:new h(m,y,b)}function h(m,y,b){this.that=m,this.args=y,this.state=m.__brush,this.active=0,this.clean=b}h.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(m,y){return this.starting?(this.starting=!1,this.emit("start",m,y)):this.emit("brush",m),this},brush:function(m,y){return this.emit("brush",m,y),this},end:function(m,y){return--this.active===0&&(delete this.state.emitter,this.emit("end",m,y)),this},emit:function(m,y,b){var x=I(this.that).datum();o.call(m,this.that,new f_(m,{sourceEvent:y,target:u,selection:e.output(this.state.selection),mode:b,dispatch:o}),x)}};function f(m){if(s&&!m.touches||!n.apply(this,arguments))return;var y=this,b=m.target.__data__.type,x=(i&&m.metaKey?b="overlay":b)==="selection"?Cd:i&&m.altKey?Br:Nr,v=e===Ma?null:d_[b],_=e===Da?null:g_[b],w=Mu(y),P=w.extent,C=w.selection,L=P[0][0],E,N,A=P[0][1],R,S,M=P[1][0],$,B,D=P[1][1],z,F,j=0,K=0,se,te=v&&_&&i&&m.shiftKey,Y,J,ie=Array.from(m.touches||[m],fe=>{const Le=fe.identifier;return fe=dt(fe,y),fe.point0=fe.slice(),fe.identifier=Le,fe});Hn(y);var ue=c(y,arguments,!0).beforestart();if(b==="overlay"){C&&(se=!0);const fe=[ie[0],ie[1]||ie[0]];w.selection=C=[[E=e===Ma?L:Ue(fe[0][0],fe[1][0]),R=e===Da?A:Ue(fe[0][1],fe[1][1])],[$=e===Ma?M:je(fe[0][0],fe[1][0]),z=e===Da?D:je(fe[0][1],fe[1][1])]],ie.length>1&&ve(m)}else E=C[0][0],R=C[0][1],$=C[1][0],z=C[1][1];N=E,S=R,B=$,F=z;var q=I(y).attr("pointer-events","none"),re=q.selectAll(".overlay").attr("cursor",Zt[b]);if(m.touches)ue.moved=V,ue.ended=be;else{var ce=I(m.view).on("mousemove.brush",V,!0).on("mouseup.brush",be,!0);i&&ce.on("keydown.brush",Ye,!0).on("keyup.brush",We,!0),ra(m.view)}l.call(y),ue.start(m,x.name);function V(fe){for(const Le of fe.changedTouches||[fe])for(const Ro of ie)Ro.identifier===Le.identifier&&(Ro.cur=dt(Le,y));if(te&&!Y&&!J&&ie.length===1){const Le=ie[0];Ld(Le.cur[0]-Le[0])>Ld(Le.cur[1]-Le[1])?J=!0:Y=!0}for(const Le of ie)Le.cur&&(Le[0]=Le.cur[0],Le[1]=Le.cur[1]);se=!0,Tu(fe),ve(fe)}function ve(fe){const Le=ie[0],Ro=Le.point0;var Rn;switch(j=Le[0]-Ro[0],K=Le[1]-Ro[1],x){case Au:case Cd:{v&&(j=je(L-E,Ue(M-$,j)),N=E+j,B=$+j),_&&(K=je(A-R,Ue(D-z,K)),S=R+K,F=z+K);break}case Nr:{ie[1]?(v&&(N=je(L,Ue(M,ie[0][0])),B=je(L,Ue(M,ie[1][0])),v=1),_&&(S=je(A,Ue(D,ie[0][1])),F=je(A,Ue(D,ie[1][1])),_=1)):(v<0?(j=je(L-E,Ue(M-E,j)),N=E+j,B=$):v>0&&(j=je(L-$,Ue(M-$,j)),N=E,B=$+j),_<0?(K=je(A-R,Ue(D-R,K)),S=R+K,F=z):_>0&&(K=je(A-z,Ue(D-z,K)),S=R,F=z+K));break}case Br:{v&&(N=je(L,Ue(M,E-j*v)),B=je(L,Ue(M,$+j*v))),_&&(S=je(A,Ue(D,R-K*_)),F=je(A,Ue(D,z+K*_)));break}}B<N&&(v*=-1,Rn=E,E=$,$=Rn,Rn=N,N=B,B=Rn,b in Rd&&re.attr("cursor",Zt[b=Rd[b]])),F<S&&(_*=-1,Rn=R,R=z,z=Rn,Rn=S,S=F,F=Rn,b in Ed&&re.attr("cursor",Zt[b=Ed[b]])),w.selection&&(C=w.selection),Y&&(N=C[0][0],B=C[1][0]),J&&(S=C[0][1],F=C[1][1]),(C[0][0]!==N||C[0][1]!==S||C[1][0]!==B||C[1][1]!==F)&&(w.selection=[[N,S],[B,F]],l.call(y),ue.brush(fe,x.name))}function be(fe){if(h_(fe),fe.touches){if(fe.touches.length)return;s&&clearTimeout(s),s=setTimeout(function(){s=null},500)}else ia(fe.view,se),ce.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);q.attr("pointer-events","all"),re.attr("cursor",Zt.overlay),w.selection&&(C=w.selection),x_(C)&&(w.selection=null,l.call(y)),ue.end(fe,x.name)}function Ye(fe){switch(fe.keyCode){case 16:{te=v&&_;break}case 18:{x===Nr&&(v&&($=B-j*v,E=N+j*v),_&&(z=F-K*_,R=S+K*_),x=Br,ve(fe));break}case 32:{(x===Nr||x===Br)&&(v<0?$=B-j:v>0&&(E=N-j),_<0?z=F-K:_>0&&(R=S-K),x=Au,re.attr("cursor",Zt.selection),ve(fe));break}default:return}Tu(fe)}function We(fe){switch(fe.keyCode){case 16:{te&&(Y=J=te=!1,ve(fe));break}case 18:{x===Br&&(v<0?$=B:v>0&&(E=N),_<0?z=F:_>0&&(R=S),x=Nr,ve(fe));break}case 32:{x===Au&&(fe.altKey?(v&&($=B-j*v,E=N+j*v),_&&(z=F-K*_,R=S+K*_),x=Br):(v<0?$=B:v>0&&(E=N),_<0?z=F:_>0&&(R=S),x=Nr),re.attr("cursor",Zt[b]),ve(fe));break}default:return}Tu(fe)}}function p(m){c(this,arguments).moved(m)}function d(m){c(this,arguments).ended(m)}function g(){var m=this.__brush||{selection:null};return m.extent=Du(t.apply(this,arguments)),m.dim=e,m}return u.extent=function(m){return arguments.length?(t=typeof m=="function"?m:_u(Du(m)),u):t},u.filter=function(m){return arguments.length?(n=typeof m=="function"?m:_u(!!m),u):n},u.touchable=function(m){return arguments.length?(r=typeof m=="function"?m:_u(!!m),u):r},u.handleSize=function(m){return arguments.length?(a=+m,u):a},u.keyModifiers=function(m){return arguments.length?(i=!!m,u):i},u.on=function(){var m=o.on.apply(o,arguments);return m===o?u:m},u}var Nd=Math.abs,zr=Math.cos,Or=Math.sin,Bd=Math.PI,Pa=Bd/2,zd=Bd*2,Od=Math.max,Cu=1e-12;function Lu(e,t){return Array.from({length:t-e},(n,r)=>e+r)}function __(e){return function(t,n){return e(t.source.value+t.target.value,n.source.value+n.target.value)}}function T_(){return ku(!1,!1)}function A_(){return ku(!1,!0)}function D_(){return ku(!0,!1)}function ku(e,t){var n=0,r=null,i=null,o=null;function a(s){var u=s.length,l=new Array(u),c=Lu(0,u),h=new Array(u*u),f=new Array(u),p=0,d;s=Float64Array.from({length:u*u},t?(g,m)=>s[m%u][m/u|0]:(g,m)=>s[m/u|0][m%u]);for(let g=0;g<u;++g){let m=0;for(let y=0;y<u;++y)m+=s[g*u+y]+e*s[y*u+g];p+=l[g]=m}p=Od(0,zd-n*u)/p,d=p?n:zd/u;{let g=0;r&&c.sort((m,y)=>r(l[m],l[y]));for(const m of c){const y=g;if(e){const b=Lu(~u+1,u).filter(x=>x<0?s[~x*u+m]:s[m*u+x]);i&&b.sort((x,v)=>i(x<0?-s[~x*u+m]:s[m*u+x],v<0?-s[~v*u+m]:s[m*u+v]));for(const x of b)if(x<0){const v=h[~x*u+m]||(h[~x*u+m]={source:null,target:null});v.target={index:m,startAngle:g,endAngle:g+=s[~x*u+m]*p,value:s[~x*u+m]}}else{const v=h[m*u+x]||(h[m*u+x]={source:null,target:null});v.source={index:m,startAngle:g,endAngle:g+=s[m*u+x]*p,value:s[m*u+x]}}f[m]={index:m,startAngle:y,endAngle:g,value:l[m]}}else{const b=Lu(0,u).filter(x=>s[m*u+x]||s[x*u+m]);i&&b.sort((x,v)=>i(s[m*u+x],s[m*u+v]));for(const x of b){let v;if(m<x?(v=h[m*u+x]||(h[m*u+x]={source:null,target:null}),v.source={index:m,startAngle:g,endAngle:g+=s[m*u+x]*p,value:s[m*u+x]}):(v=h[x*u+m]||(h[x*u+m]={source:null,target:null}),v.target={index:m,startAngle:g,endAngle:g+=s[m*u+x]*p,value:s[m*u+x]},m===x&&(v.source=v.target)),v.source&&v.target&&v.source.value<v.target.value){const _=v.source;v.source=v.target,v.target=_}}f[m]={index:m,startAngle:y,endAngle:g,value:l[m]}}g+=d}}return h=Object.values(h),h.groups=f,o?h.sort(o):h}return a.padAngle=function(s){return arguments.length?(n=Od(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=__(s))._=s,a):o&&o._},a}const Ru=Math.PI,Eu=2*Ru,Zn=1e-6,M_=Eu-Zn;function Id(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function P_(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Id;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 Fi=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Id:P_(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,u=r-t,l=i-n,c=a-t,h=s-n,f=c*c+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(f>Zn)if(!(Math.abs(h*u-l*c)>Zn)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-a,d=i-s,g=u*u+l*l,m=p*p+d*d,y=Math.sqrt(g),b=Math.sqrt(f),x=o*Math.tan((Ru-Math.acos((g+f-m)/(2*y*b)))/2),v=x/b,_=x/y;Math.abs(v-1)>Zn&&this._append`L${t+v*c},${n+v*h}`,this._append`A${o},${o},0,0,${+(h*p>c*d)},${this._x1=t+_*u},${this._y1=n+_*l}`}}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),u=r*Math.sin(i),l=t+s,c=n+u,h=1^a,f=a?i-o:o-i;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Zn||Math.abs(this._y1-c)>Zn)&&this._append`L${l},${c}`,r&&(f<0&&(f=f%Eu+Eu),f>M_?this._append`A${r},${r},0,1,${h},${t-s},${n-u}A${r},${r},0,1,${h},${this._x1=l},${this._y1=c}`:f>Zn&&this._append`A${r},${r},0,${+(f>=Ru)},${h},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function Nu(){return new Fi}Nu.prototype=Fi.prototype;function C_(e=3){return new Fi(+e)}var L_=Array.prototype.slice;function Jn(e){return function(){return e}}function k_(e){return e.source}function R_(e){return e.target}function Fd(e){return e.radius}function E_(e){return e.startAngle}function N_(e){return e.endAngle}function B_(){return 0}function z_(){return 10}function Yd(e){var t=k_,n=R_,r=Fd,i=Fd,o=E_,a=N_,s=B_,u=null;function l(){var c,h=t.apply(this,arguments),f=n.apply(this,arguments),p=s.apply(this,arguments)/2,d=L_.call(arguments),g=+r.apply(this,(d[0]=h,d)),m=o.apply(this,d)-Pa,y=a.apply(this,d)-Pa,b=+i.apply(this,(d[0]=f,d)),x=o.apply(this,d)-Pa,v=a.apply(this,d)-Pa;if(u||(u=c=Nu()),p>Cu&&(Nd(y-m)>p*2+Cu?y>m?(m+=p,y-=p):(m-=p,y+=p):m=y=(m+y)/2,Nd(v-x)>p*2+Cu?v>x?(x+=p,v-=p):(x-=p,v+=p):x=v=(x+v)/2),u.moveTo(g*zr(m),g*Or(m)),u.arc(0,0,g,m,y),m!==x||y!==v)if(e){var _=+e.apply(this,arguments),w=b-_,P=(x+v)/2;u.quadraticCurveTo(0,0,w*zr(x),w*Or(x)),u.lineTo(b*zr(P),b*Or(P)),u.lineTo(w*zr(v),w*Or(v))}else u.quadraticCurveTo(0,0,b*zr(x),b*Or(x)),u.arc(0,0,b,x,v);if(u.quadraticCurveTo(0,0,g*zr(m),g*Or(m)),u.closePath(),c)return u=null,c+""||null}return e&&(l.headRadius=function(c){return arguments.length?(e=typeof c=="function"?c:Jn(+c),l):e}),l.radius=function(c){return arguments.length?(r=i=typeof c=="function"?c:Jn(+c),l):r},l.sourceRadius=function(c){return arguments.length?(r=typeof c=="function"?c:Jn(+c),l):r},l.targetRadius=function(c){return arguments.length?(i=typeof c=="function"?c:Jn(+c),l):i},l.startAngle=function(c){return arguments.length?(o=typeof c=="function"?c:Jn(+c),l):o},l.endAngle=function(c){return arguments.length?(a=typeof c=="function"?c:Jn(+c),l):a},l.padAngle=function(c){return arguments.length?(s=typeof c=="function"?c:Jn(+c),l):s},l.source=function(c){return arguments.length?(t=c,l):t},l.target=function(c){return arguments.length?(n=c,l):n},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function O_(){return Yd()}function I_(){return Yd(z_)}var F_=Array.prototype,Wd=F_.slice;function Y_(e,t){return e-t}function W_(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 vn=e=>()=>e;function X_(e,t){for(var n=-1,r=t.length,i;++n<r;)if(i=G_(e,t[n]))return i;return 0}function G_(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 u=e[o],l=u[0],c=u[1],h=e[s],f=h[0],p=h[1];if(V_(u,h,t))return 0;c>r!=p>r&&n<(f-l)*(r-c)/(p-c)+l&&(i=-i)}return i}function V_(e,t,n){var r;return j_(e,t,n)&&U_(e[r=+(e[0]===t[0])],n[r],t[r])}function j_(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function U_(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function H_(){}var Jt=[[],[[[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 Bu(){var e=1,t=1,n=Nl,r=u;function i(l){var c=n(l);if(Array.isArray(c))c=c.slice().sort(Y_);else{const h=yi(l,q_);for(c=On(...El(h[0],h[1],c),c);c[c.length-1]>=h[1];)c.pop();for(;c[1]<h[0];)c.shift()}return c.map(h=>o(l,h))}function o(l,c){const h=c==null?NaN:+c;if(isNaN(h))throw new Error(`invalid value: ${c}`);var f=[],p=[];return a(l,h,function(d){r(d,l,h),W_(d)>0?f.push([d]):p.push(d)}),p.forEach(function(d){for(var g=0,m=f.length,y;g<m;++g)if(X_((y=f[g])[0],d)!==-1){y.push(d);return}}),{type:"MultiPolygon",value:c,coordinates:f}}function a(l,c,h){var f=new Array,p=new Array,d,g,m,y,b,x;for(d=g=-1,y=Kn(l[0],c),Jt[y<<1].forEach(v);++d<e-1;)m=y,y=Kn(l[d+1],c),Jt[m|y<<1].forEach(v);for(Jt[y<<0].forEach(v);++g<t-1;){for(d=-1,y=Kn(l[g*e+e],c),b=Kn(l[g*e],c),Jt[y<<1|b<<2].forEach(v);++d<e-1;)m=y,y=Kn(l[g*e+e+d+1],c),x=b,b=Kn(l[g*e+d+1],c),Jt[m|y<<1|b<<2|x<<3].forEach(v);Jt[y|b<<3].forEach(v)}for(d=-1,b=l[g*e]>=c,Jt[b<<2].forEach(v);++d<e-1;)x=b,b=Kn(l[g*e+d+1],c),Jt[b<<2|x<<3].forEach(v);Jt[b<<3].forEach(v);function v(_){var w=[_[0][0]+d,_[0][1]+g],P=[_[1][0]+d,_[1][1]+g],C=s(w),L=s(P),E,N;(E=p[C])?(N=f[L])?(delete p[E.end],delete f[N.start],E===N?(E.ring.push(P),h(E.ring)):f[E.start]=p[N.end]={start:E.start,end:N.end,ring:E.ring.concat(N.ring)}):(delete p[E.end],E.ring.push(P),p[E.end=L]=E):(E=f[L])?(N=p[C])?(delete f[E.start],delete p[N.end],E===N?(E.ring.push(P),h(E.ring)):f[N.start]=p[E.end]={start:N.start,end:E.end,ring:N.ring.concat(E.ring)}):(delete f[E.start],E.ring.unshift(w),f[E.start=C]=E):f[C]=p[L]={start:C,end:L,ring:[w,P]}}}function s(l){return l[0]*2+l[1]*(e+1)*4}function u(l,c,h){l.forEach(function(f){var p=f[0],d=f[1],g=p|0,m=d|0,y=zu(c[m*e+g]);p>0&&p<e&&g===p&&(f[0]=Xd(p,zu(c[m*e+g-1]),y,h)),d>0&&d<t&&m===d&&(f[1]=Xd(d,zu(c[(m-1)*e+g]),y,h))})}return i.contour=o,i.size=function(l){if(!arguments.length)return[e,t];var c=Math.floor(l[0]),h=Math.floor(l[1]);if(!(c>=0&&h>=0))throw new Error("invalid size");return e=c,t=h,i},i.thresholds=function(l){return arguments.length?(n=typeof l=="function"?l:Array.isArray(l)?vn(Wd.call(l)):vn(l),i):n},i.smooth=function(l){return arguments.length?(r=l?u:H_,i):r===u},i}function q_(e){return isFinite(e)?e:NaN}function Kn(e,t){return e==null?!1:+e>=t}function zu(e){return e==null||isNaN(e=+e)?-1/0:e}function Xd(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 Z_(e){return e[0]}function J_(e){return e[1]}function K_(){return 1}function Q_(){var e=Z_,t=J_,n=K_,r=960,i=500,o=20,a=2,s=o*3,u=r+s*2>>a,l=i+s*2>>a,c=vn(20);function h(b){var x=new Float32Array(u*l),v=Math.pow(2,-a),_=-1;for(const R of b){var w=(e(R,++_,b)+s)*v,P=(t(R,_,b)+s)*v,C=+n(R,_,b);if(C&&w>=0&&w<u&&P>=0&&P<l){var L=Math.floor(w),E=Math.floor(P),N=w-L-.5,A=P-E-.5;x[L+E*u]+=(1-N)*(1-A)*C,x[L+1+E*u]+=N*(1-A)*C,x[L+1+(E+1)*u]+=N*A*C,x[L+(E+1)*u]+=(1-N)*A*C}}return Ih({data:x,width:u,height:l},o*v),x}function f(b){var x=h(b),v=c(x),_=Math.pow(2,2*a);return Array.isArray(v)||(v=On(Number.MIN_VALUE,xi(x)/_,v)),Bu().size([u,l]).thresholds(v.map(w=>w*_))(x).map((w,P)=>(w.value=+v[P],p(w)))}f.contours=function(b){var x=h(b),v=Bu().size([u,l]),_=Math.pow(2,2*a),w=P=>{P=+P;var C=p(v.contour(x,P*_));return C.value=P,C};return Object.defineProperty(w,"max",{get:()=>xi(x)/_}),w};function p(b){return b.coordinates.forEach(d),b}function d(b){b.forEach(g)}function g(b){b.forEach(m)}function m(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,u=r+s*2>>a,l=i+s*2>>a,f}return f.x=function(b){return arguments.length?(e=typeof b=="function"?b:vn(+b),f):e},f.y=function(b){return arguments.length?(t=typeof b=="function"?b:vn(+b),f):t},f.weight=function(b){return arguments.length?(n=typeof b=="function"?b:vn(+b),f):n},f.size=function(b){if(!arguments.length)return[r,i];var x=+b[0],v=+b[1];if(!(x>=0&&v>=0))throw new Error("invalid size");return r=x,i=v,y()},f.cellSize=function(b){if(!arguments.length)return 1<<a;if(!((b=+b)>=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(b)/Math.LN2),y()},f.thresholds=function(b){return arguments.length?(c=typeof b=="function"?b:Array.isArray(b)?vn(Wd.call(b)):vn(b),f):c},f.bandwidth=function(b){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((b=+b)>=0))throw new Error("invalid bandwidth");return o=(Math.sqrt(4*b*b+1)-1)/2,y()},f}const Kt=11102230246251565e-32,He=134217729,eT=(3+8*Kt)*Kt;function Ou(e,t,n,r,i){let o,a,s,u,l=t[0],c=r[0],h=0,f=0;c>l==c>-l?(o=l,l=t[++h]):(o=c,c=r[++f]);let p=0;if(h<e&&f<n)for(c>l==c>-l?(a=l+o,s=o-(a-l),l=t[++h]):(a=c+o,s=o-(a-c),c=r[++f]),o=a,s!==0&&(i[p++]=s);h<e&&f<n;)c>l==c>-l?(a=o+l,u=a-o,s=o-(a-u)+(l-u),l=t[++h]):(a=o+c,u=a-o,s=o-(a-u)+(c-u),c=r[++f]),o=a,s!==0&&(i[p++]=s);for(;h<e;)a=o+l,u=a-o,s=o-(a-u)+(l-u),l=t[++h],o=a,s!==0&&(i[p++]=s);for(;f<n;)a=o+c,u=a-o,s=o-(a-u)+(c-u),c=r[++f],o=a,s!==0&&(i[p++]=s);return(o!==0||p===0)&&(i[p++]=o),p}function tT(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}function Yi(e){return new Float64Array(e)}const nT=(3+16*Kt)*Kt,rT=(2+12*Kt)*Kt,iT=(9+64*Kt)*Kt*Kt,Ir=Yi(4),Gd=Yi(8),Vd=Yi(12),jd=Yi(16),Ke=Yi(4);function oT(e,t,n,r,i,o,a){let s,u,l,c,h,f,p,d,g,m,y,b,x,v,_,w,P,C;const L=e-i,E=n-i,N=t-o,A=r-o;v=L*A,f=He*L,p=f-(f-L),d=L-p,f=He*A,g=f-(f-A),m=A-g,_=d*m-(v-p*g-d*g-p*m),w=N*E,f=He*N,p=f-(f-N),d=N-p,f=He*E,g=f-(f-E),m=E-g,P=d*m-(w-p*g-d*g-p*m),y=_-P,h=_-y,Ir[0]=_-(y+h)+(h-P),b=v+y,h=b-v,x=v-(b-h)+(y-h),y=x-w,h=x-y,Ir[1]=x-(y+h)+(h-w),C=b+y,h=C-b,Ir[2]=b-(C-h)+(y-h),Ir[3]=C;let R=tT(4,Ir),S=rT*a;if(R>=S||-R>=S||(h=e-L,s=e-(L+h)+(h-i),h=n-E,l=n-(E+h)+(h-i),h=t-N,u=t-(N+h)+(h-o),h=r-A,c=r-(A+h)+(h-o),s===0&&u===0&&l===0&&c===0)||(S=iT*a+eT*Math.abs(R),R+=L*c+A*s-(N*l+E*u),R>=S||-R>=S))return R;v=s*A,f=He*s,p=f-(f-s),d=s-p,f=He*A,g=f-(f-A),m=A-g,_=d*m-(v-p*g-d*g-p*m),w=u*E,f=He*u,p=f-(f-u),d=u-p,f=He*E,g=f-(f-E),m=E-g,P=d*m-(w-p*g-d*g-p*m),y=_-P,h=_-y,Ke[0]=_-(y+h)+(h-P),b=v+y,h=b-v,x=v-(b-h)+(y-h),y=x-w,h=x-y,Ke[1]=x-(y+h)+(h-w),C=b+y,h=C-b,Ke[2]=b-(C-h)+(y-h),Ke[3]=C;const M=Ou(4,Ir,4,Ke,Gd);v=L*c,f=He*L,p=f-(f-L),d=L-p,f=He*c,g=f-(f-c),m=c-g,_=d*m-(v-p*g-d*g-p*m),w=N*l,f=He*N,p=f-(f-N),d=N-p,f=He*l,g=f-(f-l),m=l-g,P=d*m-(w-p*g-d*g-p*m),y=_-P,h=_-y,Ke[0]=_-(y+h)+(h-P),b=v+y,h=b-v,x=v-(b-h)+(y-h),y=x-w,h=x-y,Ke[1]=x-(y+h)+(h-w),C=b+y,h=C-b,Ke[2]=b-(C-h)+(y-h),Ke[3]=C;const $=Ou(M,Gd,4,Ke,Vd);v=s*c,f=He*s,p=f-(f-s),d=s-p,f=He*c,g=f-(f-c),m=c-g,_=d*m-(v-p*g-d*g-p*m),w=u*l,f=He*u,p=f-(f-u),d=u-p,f=He*l,g=f-(f-l),m=l-g,P=d*m-(w-p*g-d*g-p*m),y=_-P,h=_-y,Ke[0]=_-(y+h)+(h-P),b=v+y,h=b-v,x=v-(b-h)+(y-h),y=x-w,h=x-y,Ke[1]=x-(y+h)+(h-w),C=b+y,h=C-b,Ke[2]=b-(C-h)+(y-h),Ke[3]=C;const B=Ou($,Vd,4,Ke,jd);return jd[B-1]}function Ca(e,t,n,r,i,o){const a=(t-o)*(n-i),s=(e-i)*(r-o),u=a-s,l=Math.abs(a+s);return Math.abs(u)>=nT*l?u:-oT(e,t,n,r,i,o,l)}const Ud=Math.pow(2,-52),La=new Uint32Array(512);class ka{static from(t,n=cT,r=fT){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 ka(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,u=1/0,l=-1/0,c=-1/0;for(let L=0;L<a;L++){const E=t[2*L],N=t[2*L+1];E<s&&(s=E),N<u&&(u=N),E>l&&(l=E),N>c&&(c=N),this._ids[L]=L}const h=(s+l)/2,f=(u+c)/2;let p,d,g;for(let L=0,E=1/0;L<a;L++){const N=Iu(h,f,t[2*L],t[2*L+1]);N<E&&(p=L,E=N)}const m=t[2*p],y=t[2*p+1];for(let L=0,E=1/0;L<a;L++){if(L===p)continue;const N=Iu(m,y,t[2*L],t[2*L+1]);N<E&&N>0&&(d=L,E=N)}let b=t[2*d],x=t[2*d+1],v=1/0;for(let L=0;L<a;L++){if(L===p||L===d)continue;const E=lT(m,y,b,x,t[2*L],t[2*L+1]);E<v&&(g=L,v=E)}let _=t[2*g],w=t[2*g+1];if(v===1/0){for(let N=0;N<a;N++)this._dists[N]=t[2*N]-t[0]||t[2*N+1]-t[1];Fr(this._ids,this._dists,0,a-1);const L=new Uint32Array(a);let E=0;for(let N=0,A=-1/0;N<a;N++){const R=this._ids[N],S=this._dists[R];S>A&&(L[E++]=R,A=S)}this.hull=L.subarray(0,E),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Ca(m,y,b,x,_,w)<0){const L=d,E=b,N=x;d=g,b=_,x=w,g=L,_=E,w=N}const P=uT(m,y,b,x,_,w);this._cx=P.x,this._cy=P.y;for(let L=0;L<a;L++)this._dists[L]=Iu(t[2*L],t[2*L+1],P.x,P.y);Fr(this._ids,this._dists,0,a-1),this._hullStart=p;let C=3;r[p]=n[g]=d,r[d]=n[p]=g,r[g]=n[d]=p,i[p]=0,i[d]=1,i[g]=2,o.fill(-1),o[this._hashKey(m,y)]=p,o[this._hashKey(b,x)]=d,o[this._hashKey(_,w)]=g,this.trianglesLen=0,this._addTriangle(p,d,g,-1,-1,-1);for(let L=0,E,N;L<this._ids.length;L++){const A=this._ids[L],R=t[2*A],S=t[2*A+1];if(L>0&&Math.abs(R-E)<=Ud&&Math.abs(S-N)<=Ud||(E=R,N=S,A===p||A===d||A===g))continue;let M=0;for(let F=0,j=this._hashKey(R,S);F<this._hashSize&&(M=o[(j+F)%this._hashSize],!(M!==-1&&M!==r[M]));F++);M=n[M];let $=M,B;for(;B=r[$],Ca(R,S,t[2*$],t[2*$+1],t[2*B],t[2*B+1])>=0;)if($=B,$===M){$=-1;break}if($===-1)continue;let D=this._addTriangle($,A,r[$],-1,-1,i[$]);i[A]=this._legalize(D+2),i[$]=D,C++;let z=r[$];for(;B=r[z],Ca(R,S,t[2*z],t[2*z+1],t[2*B],t[2*B+1])<0;)D=this._addTriangle(z,A,B,i[A],-1,i[z]),i[A]=this._legalize(D+2),r[z]=z,C--,z=B;if($===M)for(;B=n[$],Ca(R,S,t[2*B],t[2*B+1],t[2*$],t[2*$+1])<0;)D=this._addTriangle(B,A,$,-1,i[$],i[B]),this._legalize(D+2),i[B]=D,r[$]=$,C--,$=B;this._hullStart=n[A]=$,r[$]=n[z]=A,r[A]=z,o[this._hashKey(R,S)]=A,o[this._hashKey(t[2*$],t[2*$+1])]=$}this.hull=new Uint32Array(C);for(let L=0,E=this._hullStart;L<C;L++)this.hull[L]=E,E=r[E];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(aT(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],u=t-t%3;if(a=u+(t+2)%3,s===-1){if(o===0)break;t=La[--o];continue}const l=s-s%3,c=u+(t+1)%3,h=l+(s+2)%3,f=n[a],p=n[t],d=n[c],g=n[h];if(sT(i[2*f],i[2*f+1],i[2*p],i[2*p+1],i[2*d],i[2*d+1],i[2*g],i[2*g+1])){n[t]=g,n[s]=f;const y=r[h];if(y===-1){let x=this._hullStart;do{if(this._hullTri[x]===h){this._hullTri[x]=t;break}x=this._hullPrev[x]}while(x!==this._hullStart)}this._link(t,y),this._link(s,r[a]),this._link(a,h);const b=l+(s+1)%3;o<La.length&&(La[o++]=b)}else{if(o===0)break;t=La[--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 aT(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function Iu(e,t,n,r){const i=e-n,o=t-r;return i*i+o*o}function sT(e,t,n,r,i,o,a,s){const u=e-a,l=t-s,c=n-a,h=r-s,f=i-a,p=o-s,d=u*u+l*l,g=c*c+h*h,m=f*f+p*p;return u*(h*m-g*p)-l*(c*m-g*f)+d*(c*p-h*f)<0}function lT(e,t,n,r,i,o){const a=n-e,s=r-t,u=i-e,l=o-t,c=a*a+s*s,h=u*u+l*l,f=.5/(a*l-s*u),p=(l*c-s*h)*f,d=(a*h-u*c)*f;return p*p+d*d}function uT(e,t,n,r,i,o){const a=n-e,s=r-t,u=i-e,l=o-t,c=a*a+s*s,h=u*u+l*l,f=.5/(a*l-s*u),p=e+(l*c-s*h)*f,d=t+(a*h-u*c)*f;return{x:p,y:d}}function Fr(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;Wi(e,i,o),t[e[n]]>t[e[r]]&&Wi(e,n,r),t[e[o]]>t[e[r]]&&Wi(e,o,r),t[e[n]]>t[e[o]]&&Wi(e,n,o);const s=e[o],u=t[s];for(;;){do o++;while(t[e[o]]<u);do a--;while(t[e[a]]>u);if(a<o)break;Wi(e,o,a)}e[n+1]=e[a],e[a]=s,r-o+1>=a-n?(Fr(e,t,o,r),Fr(e,t,n,a-1)):(Fr(e,t,n,a-1),Fr(e,t,o,r))}}function Wi(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function cT(e){return e[0]}function fT(e){return e[1]}const Hd=1e-6;class Qn{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)>Hd||Math.abs(this._y1-o)>Hd)&&(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 Fu{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 qd{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 g=0,m=0,y=r.length,b,x;g<y;g+=3,m+=2){const v=r[g]*2,_=r[g+1]*2,w=r[g+2]*2,P=t[v],C=t[v+1],L=t[_],E=t[_+1],N=t[w],A=t[w+1],R=L-P,S=E-C,M=N-P,$=A-C,B=(R*$-S*M)*2;if(Math.abs(B)<1e-9){if(o===void 0){o=a=0;for(const z of n)o+=t[z*2],a+=t[z*2+1];o/=n.length,a/=n.length}const D=1e9*Math.sign((o-P)*$-(a-C)*M);b=(P+N)/2-D*$,x=(C+A)/2+D*M}else{const D=1/B,z=R*R+S*S,F=M*M+$*$;b=P+($*z-S*F)*D,x=C+(R*F-M*z)*D}s[m]=b,s[m+1]=x}let u=n[n.length-1],l,c=u*4,h,f=t[2*u],p,d=t[2*u+1];i.fill(0);for(let g=0;g<n.length;++g)u=n[g],l=c,h=f,p=d,c=u*4,f=t[2*u],d=t[2*u+1],i[l+2]=i[c]=p-d,i[l+3]=i[c+1]=f-h}render(t){const n=t==null?t=new Qn:void 0,{delaunay:{halfedges:r,inedges:i,hull:o},circumcenters:a,vectors:s}=this;if(o.length<=1)return null;for(let c=0,h=r.length;c<h;++c){const f=r[c];if(f<c)continue;const p=Math.floor(c/3)*2,d=Math.floor(f/3)*2,g=a[p],m=a[p+1],y=a[d],b=a[d+1];this._renderSegment(g,m,y,b,t)}let u,l=o[o.length-1];for(let c=0;c<o.length;++c){u=l,l=o[c];const h=Math.floor(i[l]/3)*2,f=a[h],p=a[h+1],d=u*4,g=this._project(f,p,s[d+2],s[d+3]);g&&this._renderSegment(f,p,g[0],g[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new Qn: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 Qn: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 Fu;return this.renderCell(t,n),n.value()}_renderSegment(t,n,r,i,o){let a;const s=this._regioncode(t,n),u=this._regioncode(r,i);s===0&&u===0?(o.moveTo(t,n),o.lineTo(r,i)):(a=this._clipSegment(t,n,r,i,s,u))&&(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,u=i.length;s<u;s+=2)if(n[o]===i[s]&&n[o+1]===i[s+1]&&n[(o+2)%a]===i[(s+u-2)%u]&&n[(o+3)%a]===i[(s+u-1)%u]){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 u=a;do{const l=Math.floor(u/3);if(s.push(n[l*2],n[l*2+1]),u=u%3===2?u-2:u+1,o[u]!==t)break;u=i[u]}while(u!==a&&u!==-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],u=n[r-1],l,c=this._regioncode(s,u),h,f=0;for(let p=0;p<r;p+=2)if(o=s,a=u,s=n[p],u=n[p+1],l=c,c=this._regioncode(s,u),l===0&&c===0)h=f,f=0,i?i.push(s,u):i=[s,u];else{let d,g,m,y,b;if(l===0){if((d=this._clipSegment(o,a,s,u,l,c))===null)continue;[g,m,y,b]=d}else{if((d=this._clipSegment(s,u,o,a,c,l))===null)continue;[y,b,g,m]=d,h=f,f=this._edgecode(g,m),h&&f&&this._edge(t,h,f,i,i.length),i?i.push(g,m):i=[g,m]}h=f,f=this._edgecode(y,b),h&&f&&this._edge(t,h,f,i,i.length),i?i.push(y,b):i=[y,b]}if(i)h=f,f=this._edgecode(i[0],i[1]),h&&f&&this._edge(t,h,f,i,i.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return i}_clipSegment(t,n,r,i,o,a){const s=o<a;for(s&&([t,n,r,i,o,a]=[r,i,t,n,a,o]);;){if(o===0&&a===0)return s?[r,i,t,n]:[t,n,r,i];if(o&a)return null;let u,l,c=o||a;c&8?(u=t+(r-t)*(this.ymax-n)/(i-n),l=this.ymax):c&4?(u=t+(r-t)*(this.ymin-n)/(i-n),l=this.ymin):c&2?(l=n+(i-n)*(this.xmax-t)/(r-t),u=this.xmax):(l=n+(i-n)*(this.xmin-t)/(r-t),u=this.xmin),o?(t=u,n=l,o=this._regioncode(t,n)):(r=u,i=l,a=this._regioncode(r,i))}}_clipInfinite(t,n,r,i,o,a){let s=Array.from(n),u;if((u=this._project(s[0],s[1],r,i))&&s.unshift(u[0],u[1]),(u=this._project(s[s.length-2],s[s.length-1],o,a))&&s.push(u[0],u[1]),s=this._clipFinite(t,s))for(let l=0,c=s.length,h,f=this._edgecode(s[c-2],s[c-1]);l<c;l+=2)h=f,f=this._edgecode(s[l],s[l+1]),h&&f&&(l=this._edge(t,h,f,s,l),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,u;if(i<0){if(n<=this.ymin)return null;(a=(this.ymin-n)/i)<o&&(u=this.ymin,s=t+(o=a)*r)}else if(i>0){if(n>=this.ymax)return null;(a=(this.ymax-n)/i)<o&&(u=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,u=n+(o=a)*i)}else if(r<0){if(t<=this.xmin)return null;(a=(this.xmin-t)/r)<o&&(s=this.xmin,u=n+(o=a)*i)}return[s,u]}_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 hT=2*Math.PI,Yr=Math.pow;function pT(e){return e[0]}function dT(e){return e[1]}function gT(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 mT(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class Yu{static from(t,n=pT,r=dT,i){return new Yu("length"in t?yT(t,n,r,i):Float64Array.from(bT(t,n,r,i)))}constructor(t){this._delaunator=new ka(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&&gT(t)){this.collinear=Int32Array.from({length:n.length/2},(f,p)=>p).sort((f,p)=>n[2*f]-n[2*p]||n[2*f+1]-n[2*p+1]);const u=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[n[2*u],n[2*u+1],n[2*l],n[2*l+1]],h=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let f=0,p=n.length/2;f<p;++f){const d=mT(n[2*f],n[2*f+1],h);n[2*f]=d[0],n[2*f+1]=d[1]}this._delaunator=new ka(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 u=0,l=r.length;u<l;++u){const c=o[u%3===2?u-2:u+1];(r[u]===-1||a[c]===-1)&&(a[c]=u)}for(let u=0,l=i.length;u<l;++u)s[i[u]]=u;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 qd(this,t)}*neighbors(t){const{inedges:n,hull:r,_hullIndex:i,halfedges:o,triangles:a,collinear:s}=this;if(s){const h=s.indexOf(t);h>0&&(yield s[h-1]),h<s.length-1&&(yield s[h+1]);return}const u=n[t];if(u===-1)return;let l=u,c=-1;do{if(yield c=a[l],l=l%3===2?l-2:l+1,a[l]!==t)return;if(l=o[l],l===-1){const h=r[(i[t]+1)%r.length];h!==c&&(yield h);return}}while(l!==u)}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:u,points:l}=this;if(i[t]===-1||!l.length)return(t+1)%(l.length>>1);let c=t,h=Yr(n-l[t*2],2)+Yr(r-l[t*2+1],2);const f=i[t];let p=f;do{let d=u[p];const g=Yr(n-l[d*2],2)+Yr(r-l[d*2+1],2);if(g<h&&(h=g,c=d),p=p%3===2?p-2:p+1,u[p]!==t)break;if(p=s[p],p===-1){if(p=o[(a[t]+1)%o.length],p!==d&&Yr(n-l[p*2],2)+Yr(r-l[p*2+1],2)<h)return p;break}}while(p!==f);return c}render(t){const n=t==null?t=new Qn:void 0,{points:r,halfedges:i,triangles:o}=this;for(let a=0,s=i.length;a<s;++a){const u=i[a];if(u<a)continue;const l=o[a]*2,c=o[u]*2;t.moveTo(r[l],r[l+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 Qn:void 0,{points:i}=this;for(let o=0,a=i.length;o<a;o+=2){const s=i[o],u=i[o+1];t.moveTo(s+n,u),t.arc(s,u,n,0,hT)}return r&&r.value()}renderHull(t){const n=t==null?t=new Qn: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 u=2*r[s];t.lineTo(i[u],i[u+1])}return t.closePath(),n&&n.value()}hullPolygon(){const t=new Fu;return this.renderHull(t),t.value()}renderTriangle(t,n){const r=n==null?n=new Qn:void 0,{points:i,triangles:o}=this,a=o[t*=3]*2,s=o[t+1]*2,u=o[t+2]*2;return n.moveTo(i[a],i[a+1]),n.lineTo(i[s],i[s+1]),n.lineTo(i[u],i[u+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 Fu;return this.renderTriangle(t,n),n.value()}}function yT(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*bT(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 Zd={},Wu={},Xu=34,Xi=10,Gu=13;function Jd(e){return new Function("d","return {"+e.map(function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'}).join(",")+"}")}function xT(e,t){var n=Jd(e);return function(r,i){return t(n(r),i,e)}}function Kd(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 ut(e,t){var n=e+"",r=n.length;return r<t?new Array(t-r+1).join(0)+n:n}function vT(e){return e<0?"-"+ut(-e,6):e>9999?"+"+ut(e,6):ut(e,4)}function ST(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),r=e.getUTCSeconds(),i=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":vT(e.getUTCFullYear())+"-"+ut(e.getUTCMonth()+1,2)+"-"+ut(e.getUTCDate(),2)+(i?"T"+ut(t,2)+":"+ut(n,2)+":"+ut(r,2)+"."+ut(i,3)+"Z":r?"T"+ut(t,2)+":"+ut(n,2)+":"+ut(r,2)+"Z":n||t?"T"+ut(t,2)+":"+ut(n,2)+"Z":"")}function Ra(e){var t=new RegExp('["'+e+`
|
|
52
|
+
\r]`),n=e.charCodeAt(0);function r(h,f){var p,d,g=i(h,function(m,y){if(p)return p(m,y-1);d=m,p=f?xT(m,f):Jd(m)});return g.columns=d||[],g}function i(h,f){var p=[],d=h.length,g=0,m=0,y,b=d<=0,x=!1;h.charCodeAt(d-1)===Xi&&--d,h.charCodeAt(d-1)===Gu&&--d;function v(){if(b)return Wu;if(x)return x=!1,Zd;var w,P=g,C;if(h.charCodeAt(P)===Xu){for(;g++<d&&h.charCodeAt(g)!==Xu||h.charCodeAt(++g)===Xu;);return(w=g)>=d?b=!0:(C=h.charCodeAt(g++))===Xi?x=!0:C===Gu&&(x=!0,h.charCodeAt(g)===Xi&&++g),h.slice(P+1,w-1).replace(/""/g,'"')}for(;g<d;){if((C=h.charCodeAt(w=g++))===Xi)x=!0;else if(C===Gu)x=!0,h.charCodeAt(g)===Xi&&++g;else if(C!==n)continue;return h.slice(P,w)}return b=!0,h.slice(P,d)}for(;(y=v())!==Wu;){for(var _=[];y!==Zd&&y!==Wu;)_.push(y),y=v();f&&(_=f(_,m++))==null||p.push(_)}return p}function o(h,f){return h.map(function(p){return f.map(function(d){return c(p[d])}).join(e)})}function a(h,f){return f==null&&(f=Kd(h)),[f.map(c).join(e)].concat(o(h,f)).join(`
|
|
53
|
+
`)}function s(h,f){return f==null&&(f=Kd(h)),o(h,f).join(`
|
|
54
|
+
`)}function u(h){return h.map(l).join(`
|
|
55
|
+
`)}function l(h){return h.map(c).join(e)}function c(h){return h==null?"":h instanceof Date?ST(h):t.test(h+="")?'"'+h.replace(/"/g,'""')+'"':h}return{parse:r,parseRows:i,format:a,formatBody:s,formatRows:u,formatRow:l,formatValue:c}}var er=Ra(","),Qd=er.parse,$T=er.parseRows,wT=er.format,_T=er.formatBody,TT=er.formatRows,AT=er.formatRow,DT=er.formatValue,tr=Ra(" "),eg=tr.parse,MT=tr.parseRows,PT=tr.format,CT=tr.formatBody,LT=tr.formatRows,kT=tr.formatRow,RT=tr.formatValue;function ET(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})?)?$/))NT&&i[4]&&!i[7]&&(n=n.replace(/-/g,"/").replace(/T/," ")),n=new Date(n);else continue;e[t]=n}return e}const NT=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours();function BT(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.blob()}function zT(e,t){return fetch(e,t).then(BT)}function OT(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.arrayBuffer()}function IT(e,t){return fetch(e,t).then(OT)}function FT(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.text()}function Ea(e,t){return fetch(e,t).then(FT)}function tg(e){return function(t,n,r){return arguments.length===2&&typeof n=="function"&&(r=n,n=void 0),Ea(t,n).then(function(i){return e(i,r)})}}function YT(e,t,n,r){arguments.length===3&&typeof n=="function"&&(r=n,n=void 0);var i=Ra(e);return Ea(t,n).then(function(o){return i.parse(o,r)})}var WT=tg(Qd),XT=tg(eg);function GT(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 VT(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);if(!(e.status===204||e.status===205))return e.json()}function jT(e,t){return fetch(e,t).then(VT)}function Vu(e){return(t,n)=>Ea(t,n).then(r=>new DOMParser().parseFromString(r,e))}const UT=Vu("application/xml");var HT=Vu("text/html"),qT=Vu("image/svg+xml");function ju(e,t){var n,r=1;e==null&&(e=0),t==null&&(t=0);function i(){var o,a=n.length,s,u=0,l=0;for(o=0;o<a;++o)s=n[o],u+=s.x,l+=s.y;for(u=(u/a-e)*r,l=(l/a-t)*r,o=0;o<a;++o)s=n[o],s.x-=u,s.y-=l}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 ZT(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return ng(this.cover(t,n),t,n,e)}function ng(e,t,n,r){if(isNaN(t)||isNaN(n))return e;var i,o=e._root,a={data:r},s=e._x0,u=e._y0,l=e._x1,c=e._y1,h,f,p,d,g,m,y,b;if(!o)return e._root=a,e;for(;o.length;)if((g=t>=(h=(s+l)/2))?s=h:l=h,(m=n>=(f=(u+c)/2))?u=f:c=f,i=o,!(o=o[y=m<<1|g]))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),(g=t>=(h=(s+l)/2))?s=h:l=h,(m=n>=(f=(u+c)/2))?u=f:c=f;while((y=m<<1|g)===(b=(d>=f)<<1|p>=h));return i[b]=o,i[y]=a,e}function JT(e){var t,n,r=e.length,i,o,a=new Array(r),s=new Array(r),u=1/0,l=1/0,c=-1/0,h=-1/0;for(n=0;n<r;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(o=+this._y.call(null,t))||(a[n]=i,s[n]=o,i<u&&(u=i),i>c&&(c=i),o<l&&(l=o),o>h&&(h=o));if(u>c||l>h)return this;for(this.cover(u,l).cover(c,h),n=0;n<r;++n)ng(this,a[n],s[n],e[n]);return this}function KT(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,u,l;n>e||e>=i||r>t||t>=o;)switch(l=(t<r)<<1|e<n,u=new Array(4),u[l]=s,s=u,a*=2,l){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 QT(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function eA(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 tA(e,t,n){var r,i=this._x0,o=this._y0,a,s,u,l,c=this._x1,h=this._y1,f=[],p=this._root,d,g;for(p&&f.push(new Qe(p,i,o,c,h)),n==null?n=1/0:(i=e-n,o=t-n,c=e+n,h=t+n,n*=n);d=f.pop();)if(!(!(p=d.node)||(a=d.x0)>c||(s=d.y0)>h||(u=d.x1)<i||(l=d.y1)<o))if(p.length){var m=(a+u)/2,y=(s+l)/2;f.push(new Qe(p[3],m,y,u,l),new Qe(p[2],a,y,m,l),new Qe(p[1],m,s,u,y),new Qe(p[0],a,s,m,y)),(g=(t>=y)<<1|e>=m)&&(d=f[f.length-1],f[f.length-1]=f[f.length-1-g],f[f.length-1-g]=d)}else{var b=e-+this._x.call(null,p.data),x=t-+this._y.call(null,p.data),v=b*b+x*x;if(v<n){var _=Math.sqrt(n=v);i=e-_,o=t-_,c=e+_,h=t+_,r=p.data}}return r}function nA(e){if(isNaN(c=+this._x.call(null,e))||isNaN(h=+this._y.call(null,e)))return this;var t,n=this._root,r,i,o,a=this._x0,s=this._y0,u=this._x1,l=this._y1,c,h,f,p,d,g,m,y;if(!n)return this;if(n.length)for(;;){if((d=c>=(f=(a+u)/2))?a=f:u=f,(g=h>=(p=(s+l)/2))?s=p:l=p,t=n,!(n=n[m=g<<1|d]))return this;if(!n.length)break;(t[m+1&3]||t[m+2&3]||t[m+3&3])&&(r=t,y=m)}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[m]=o:delete t[m],(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 rA(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function iA(){return this._root}function oA(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function aA(e){var t=[],n,r=this._root,i,o,a,s,u;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,u=n.y1)&&r.length){var l=(o+s)/2,c=(a+u)/2;(i=r[3])&&t.push(new Qe(i,l,c,s,u)),(i=r[2])&&t.push(new Qe(i,o,c,l,u)),(i=r[1])&&t.push(new Qe(i,l,a,s,c)),(i=r[0])&&t.push(new Qe(i,o,a,l,c))}return this}function sA(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,u=r.x1,l=r.y1,c=(a+u)/2,h=(s+l)/2;(o=i[0])&&t.push(new Qe(o,a,s,c,h)),(o=i[1])&&t.push(new Qe(o,c,s,u,h)),(o=i[2])&&t.push(new Qe(o,a,h,c,l)),(o=i[3])&&t.push(new Qe(o,c,h,u,l))}n.push(r)}for(;r=n.pop();)e(r.node,r.x0,r.y0,r.x1,r.y1);return this}function lA(e){return e[0]}function uA(e){return arguments.length?(this._x=e,this):this._x}function cA(e){return e[1]}function fA(e){return arguments.length?(this._y=e,this):this._y}function Na(e,t,n){var r=new Uu(t??lA,n??cA,NaN,NaN,NaN,NaN);return e==null?r:r.addAll(e)}function Uu(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 rg(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var et=Na.prototype=Uu.prototype;et.copy=function(){var e=new Uu(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=rg(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]=rg(r));return e},et.add=ZT,et.addAll=JT,et.cover=KT,et.data=QT,et.extent=eA,et.find=tA,et.remove=nA,et.removeAll=rA,et.root=iA,et.size=oA,et.visit=aA,et.visitAfter=sA,et.x=uA,et.y=fA;function Ee(e){return function(){return e}}function Sn(e){return(e()-.5)*1e-6}function hA(e){return e.x+e.vx}function pA(e){return e.y+e.vy}function Ba(e){var t,n,r,i=1,o=1;typeof e!="function"&&(e=Ee(e==null?1:+e));function a(){for(var l,c=t.length,h,f,p,d,g,m,y=0;y<o;++y)for(h=Na(t,hA,pA).visitAfter(s),l=0;l<c;++l)f=t[l],g=n[f.index],m=g*g,p=f.x+f.vx,d=f.y+f.vy,h.visit(b);function b(x,v,_,w,P){var C=x.data,L=x.r,E=g+L;if(C){if(C.index>f.index){var N=p-C.x-C.vx,A=d-C.y-C.vy,R=N*N+A*A;R<E*E&&(N===0&&(N=Sn(r),R+=N*N),A===0&&(A=Sn(r),R+=A*A),R=(E-(R=Math.sqrt(R)))/R*i,f.vx+=(N*=R)*(E=(L*=L)/(m+L)),f.vy+=(A*=R)*E,C.vx-=N*(E=1-E),C.vy-=A*E)}return}return v>p+E||w<p-E||_>d+E||P<d-E}}function s(l){if(l.data)return l.r=n[l.data.index];for(var c=l.r=0;c<4;++c)l[c]&&l[c].r>l.r&&(l.r=l[c].r)}function u(){if(t){var l,c=t.length,h;for(n=new Array(c),l=0;l<c;++l)h=t[l],n[h.index]=+e(h,l,t)}}return a.initialize=function(l,c){t=l,r=c,u()},a.iterations=function(l){return arguments.length?(o=+l,a):o},a.strength=function(l){return arguments.length?(i=+l,a):i},a.radius=function(l){return arguments.length?(e=typeof l=="function"?l:Ee(+l),u(),a):e},a}function dA(e){return e.index}function ig(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function Hu(e){var t=dA,n=h,r,i=Ee(30),o,a,s,u,l,c=1;e==null&&(e=[]);function h(m){return 1/Math.min(s[m.source.index],s[m.target.index])}function f(m){for(var y=0,b=e.length;y<c;++y)for(var x=0,v,_,w,P,C,L,E;x<b;++x)v=e[x],_=v.source,w=v.target,P=w.x+w.vx-_.x-_.vx||Sn(l),C=w.y+w.vy-_.y-_.vy||Sn(l),L=Math.sqrt(P*P+C*C),L=(L-o[x])/L*m*r[x],P*=L,C*=L,w.vx-=P*(E=u[x]),w.vy-=C*E,_.vx+=P*(E=1-E),_.vy+=C*E}function p(){if(a){var m,y=a.length,b=e.length,x=new Map(a.map((_,w)=>[t(_,w,a),_])),v;for(m=0,s=new Array(y);m<b;++m)v=e[m],v.index=m,typeof v.source!="object"&&(v.source=ig(x,v.source)),typeof v.target!="object"&&(v.target=ig(x,v.target)),s[v.source.index]=(s[v.source.index]||0)+1,s[v.target.index]=(s[v.target.index]||0)+1;for(m=0,u=new Array(b);m<b;++m)v=e[m],u[m]=s[v.source.index]/(s[v.source.index]+s[v.target.index]);r=new Array(b),d(),o=new Array(b),g()}}function d(){if(a)for(var m=0,y=e.length;m<y;++m)r[m]=+n(e[m],m,e)}function g(){if(a)for(var m=0,y=e.length;m<y;++m)o[m]=+i(e[m],m,e)}return f.initialize=function(m,y){a=m,l=y,p()},f.links=function(m){return arguments.length?(e=m,p(),f):e},f.id=function(m){return arguments.length?(t=m,f):t},f.iterations=function(m){return arguments.length?(c=+m,f):c},f.strength=function(m){return arguments.length?(n=typeof m=="function"?m:Ee(+m),d(),f):n},f.distance=function(m){return arguments.length?(i=typeof m=="function"?m:Ee(+m),g(),f):i},f}const gA=1664525,mA=1013904223,og=4294967296;function yA(){let e=1;return()=>(e=(gA*e+mA)%og)/og}function bA(e){return e.x}function xA(e){return e.y}var vA=10,SA=Math.PI*(3-Math.sqrt(5));function za(e){var t,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,u=$a(h),l=Fn("tick","end"),c=yA();e==null&&(e=[]);function h(){f(),l.call("tick",t),n<r&&(u.stop(),l.call("end",t))}function f(g){var m,y=e.length,b;g===void 0&&(g=1);for(var x=0;x<g;++x)for(n+=(o-n)*i,s.forEach(function(v){v(n)}),m=0;m<y;++m)b=e[m],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 g=0,m=e.length,y;g<m;++g){if(y=e[g],y.index=g,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=vA*Math.sqrt(.5+g),x=g*SA;y.x=b*Math.cos(x),y.y=b*Math.sin(x)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function d(g){return g.initialize&&g.initialize(e,c),g}return p(),t={tick:f,restart:function(){return u.restart(h),t},stop:function(){return u.stop(),t},nodes:function(g){return arguments.length?(e=g,p(),s.forEach(d),t):e},alpha:function(g){return arguments.length?(n=+g,t):n},alphaMin:function(g){return arguments.length?(r=+g,t):r},alphaDecay:function(g){return arguments.length?(i=+g,t):+i},alphaTarget:function(g){return arguments.length?(o=+g,t):o},velocityDecay:function(g){return arguments.length?(a=1-g,t):1-a},randomSource:function(g){return arguments.length?(c=g,s.forEach(d),t):c},force:function(g,m){return arguments.length>1?(m==null?s.delete(g):s.set(g,d(m)),t):s.get(g)},find:function(g,m,y){var b=0,x=e.length,v,_,w,P,C;for(y==null?y=1/0:y*=y,b=0;b<x;++b)P=e[b],v=g-P.x,_=m-P.y,w=v*v+_*_,w<y&&(C=P,y=w);return C},on:function(g,m){return arguments.length>1?(l.on(g,m),t):l.on(g)}}}function Oa(){var e,t,n,r,i=Ee(-30),o,a=1,s=1/0,u=.81;function l(p){var d,g=e.length,m=Na(e,bA,xA).visitAfter(h);for(r=p,d=0;d<g;++d)t=e[d],m.visit(f)}function c(){if(e){var p,d=e.length,g;for(o=new Array(d),p=0;p<d;++p)g=e[p],o[g.index]=+i(g,p,e)}}function h(p){var d=0,g,m,y=0,b,x,v;if(p.length){for(b=x=v=0;v<4;++v)(g=p[v])&&(m=Math.abs(g.value))&&(d+=g.value,y+=m,b+=m*g.x,x+=m*g.y);p.x=b/y,p.y=x/y}else{g=p,g.x=g.data.x,g.y=g.data.y;do d+=o[g.data.index];while(g=g.next)}p.value=d}function f(p,d,g,m){if(!p.value)return!0;var y=p.x-t.x,b=p.y-t.y,x=m-d,v=y*y+b*b;if(x*x/u<v)return v<s&&(y===0&&(y=Sn(n),v+=y*y),b===0&&(b=Sn(n),v+=b*b),v<a&&(v=Math.sqrt(a*v)),t.vx+=y*p.value*r/v,t.vy+=b*p.value*r/v),!0;if(p.length||v>=s)return;(p.data!==t||p.next)&&(y===0&&(y=Sn(n),v+=y*y),b===0&&(b=Sn(n),v+=b*b),v<a&&(v=Math.sqrt(a*v)));do p.data!==t&&(x=o[p.data.index]*r/v,t.vx+=y*x,t.vy+=b*x);while(p=p.next)}return l.initialize=function(p,d){e=p,n=d,c()},l.strength=function(p){return arguments.length?(i=typeof p=="function"?p:Ee(+p),c(),l):i},l.distanceMin=function(p){return arguments.length?(a=p*p,l):Math.sqrt(a)},l.distanceMax=function(p){return arguments.length?(s=p*p,l):Math.sqrt(s)},l.theta=function(p){return arguments.length?(u=p*p,l):Math.sqrt(u)},l}function $A(e,t,n){var r,i=Ee(.1),o,a;typeof e!="function"&&(e=Ee(+e)),t==null&&(t=0),n==null&&(n=0);function s(l){for(var c=0,h=r.length;c<h;++c){var f=r[c],p=f.x-t||1e-6,d=f.y-n||1e-6,g=Math.sqrt(p*p+d*d),m=(a[c]-g)*o[c]*l/g;f.vx+=p*m,f.vy+=d*m}}function u(){if(r){var l,c=r.length;for(o=new Array(c),a=new Array(c),l=0;l<c;++l)a[l]=+e(r[l],l,r),o[l]=isNaN(a[l])?0:+i(r[l],l,r)}}return s.initialize=function(l){r=l,u()},s.strength=function(l){return arguments.length?(i=typeof l=="function"?l:Ee(+l),u(),s):i},s.radius=function(l){return arguments.length?(e=typeof l=="function"?l:Ee(+l),u(),s):e},s.x=function(l){return arguments.length?(t=+l,s):t},s.y=function(l){return arguments.length?(n=+l,s):n},s}function ag(e){var t=Ee(.1),n,r,i;typeof e!="function"&&(e=Ee(e==null?0:+e));function o(s){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vx+=(i[u]-c.x)*r[u]*s}function a(){if(n){var s,u=n.length;for(r=new Array(u),i=new Array(u),s=0;s<u;++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:Ee(+s),a(),o):t},o.x=function(s){return arguments.length?(e=typeof s=="function"?s:Ee(+s),a(),o):e},o}function sg(e){var t=Ee(.1),n,r,i;typeof e!="function"&&(e=Ee(e==null?0:+e));function o(s){for(var u=0,l=n.length,c;u<l;++u)c=n[u],c.vy+=(i[u]-c.y)*r[u]*s}function a(){if(n){var s,u=n.length;for(r=new Array(u),i=new Array(u),s=0;s<u;++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:Ee(+s),a(),o):t},o.y=function(s){return arguments.length?(e=typeof s=="function"?s:Ee(+s),a(),o):e},o}function wA(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ia(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 Wr(e){return e=Ia(Math.abs(e)),e?e[1]:NaN}function _A(e,t){return function(n,r){for(var i=n.length,o=[],a=0,s=e[0],u=0;i>0&&s>0&&(u+s+1>r&&(s=Math.max(1,r-u)),o.push(n.substring(i-=s,i+s)),!((u+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(t)}}function TA(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var AA=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Xr(e){if(!(t=AA.exec(e)))throw new Error("invalid format: "+e);var t;return new Fa({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]})}Xr.prototype=Fa.prototype;function Fa(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+""}Fa.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 DA(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 lg;function MA(e,t){var n=Ia(e,t);if(!n)return e+"";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")+Ia(e,Math.max(0,t+o-1))[0]}function ug(e,t){var n=Ia(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 cg={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:wA,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)=>ug(e*100,t),r:ug,s:MA,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function fg(e){return e}var hg=Array.prototype.map,pg=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function dg(e){var t=e.grouping===void 0||e.thousands===void 0?fg:_A(hg.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?fg:TA(hg.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",u=e.nan===void 0?"NaN":e.nan+"";function l(h){h=Xr(h);var f=h.fill,p=h.align,d=h.sign,g=h.symbol,m=h.zero,y=h.width,b=h.comma,x=h.precision,v=h.trim,_=h.type;_==="n"?(b=!0,_="g"):cg[_]||(x===void 0&&(x=12),v=!0,_="g"),(m||f==="0"&&p==="=")&&(m=!0,f="0",p="=");var w=g==="$"?n:g==="#"&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",P=g==="$"?r:/[%p]/.test(_)?a:"",C=cg[_],L=/[defgprs%]/.test(_);x=x===void 0?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function E(N){var A=w,R=P,S,M,$;if(_==="c")R=C(N)+R,N="";else{N=+N;var B=N<0||1/N<0;if(N=isNaN(N)?u:C(Math.abs(N),x),v&&(N=DA(N)),B&&+N==0&&d!=="+"&&(B=!1),A=(B?d==="("?d:s:d==="-"||d==="("?"":d)+A,R=(_==="s"?pg[8+lg/3]:"")+R+(B&&d==="("?")":""),L){for(S=-1,M=N.length;++S<M;)if($=N.charCodeAt(S),48>$||$>57){R=($===46?i+N.slice(S+1):N.slice(S))+R,N=N.slice(0,S);break}}}b&&!m&&(N=t(N,1/0));var D=A.length+N.length+R.length,z=D<y?new Array(y-D+1).join(f):"";switch(b&&m&&(N=t(z+N,z.length?y-R.length:1/0),z=""),p){case"<":N=A+N+R+z;break;case"=":N=A+z+N+R;break;case"^":N=z.slice(0,D=z.length>>1)+A+N+R+z.slice(D);break;default:N=z+A+N+R;break}return o(N)}return E.toString=function(){return h+""},E}function c(h,f){var p=l((h=Xr(h),h.type="f",h)),d=Math.max(-8,Math.min(8,Math.floor(Wr(f)/3)))*3,g=Math.pow(10,-d),m=pg[8+d/3];return function(y){return p(g*y)+m}}return{format:l,formatPrefix:c}}var Ya,Gi,qu;gg({thousands:",",grouping:[3],currency:["$",""]});function gg(e){return Ya=dg(e),Gi=Ya.format,qu=Ya.formatPrefix,Ya}function mg(e){return Math.max(0,-Wr(Math.abs(e)))}function yg(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Wr(t)/3)))*3-Wr(Math.abs(e)))}function bg(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Wr(t)-Wr(e))+1}var oe=1e-6,Vi=1e-12,ge=Math.PI,Pe=ge/2,Wa=ge/4,tt=ge*2,$e=180/ge,ae=ge/180,me=Math.abs,Gr=Math.atan,nt=Math.atan2,ne=Math.cos,Xa=Math.ceil,xg=Math.exp,Zu=Math.hypot,Ga=Math.log,Ju=Math.pow,Q=Math.sin,vt=Math.sign||function(e){return e>0?1:e<0?-1:0},ze=Math.sqrt,Ku=Math.tan;function vg(e){return e>1?0:e<-1?ge:Math.acos(e)}function rt(e){return e>1?Pe:e<-1?-Pe:Math.asin(e)}function Sg(e){return(e=Q(e/2))*e}function De(){}function Va(e,t){e&&wg.hasOwnProperty(e.type)&&wg[e.type](e,t)}var $g={Feature:function(e,t){Va(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)Va(n[r].geometry,t)}},wg={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){Qu(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)Qu(n[r],t,0)},Polygon:function(e,t){_g(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)_g(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)Va(n[r],t)}};function Qu(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 _g(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)Qu(e[n],t,1);t.polygonEnd()}function kt(e,t){e&&$g.hasOwnProperty(e.type)?$g[e.type](e,t):Va(e,t)}var ja=new Re,Ua=new Re,Tg,Ag,ec,tc,nc,Ft={point:De,lineStart:De,lineEnd:De,polygonStart:function(){ja=new Re,Ft.lineStart=PA,Ft.lineEnd=CA},polygonEnd:function(){var e=+ja;Ua.add(e<0?tt+e:e),this.lineStart=this.lineEnd=this.point=De},sphere:function(){Ua.add(tt)}};function PA(){Ft.point=LA}function CA(){Dg(Tg,Ag)}function LA(e,t){Ft.point=Dg,Tg=e,Ag=t,e*=ae,t*=ae,ec=e,tc=ne(t=t/2+Wa),nc=Q(t)}function Dg(e,t){e*=ae,t*=ae,t=t/2+Wa;var n=e-ec,r=n>=0?1:-1,i=r*n,o=ne(t),a=Q(t),s=nc*a,u=tc*o+s*ne(i),l=s*r*Q(i);ja.add(nt(l,u)),ec=e,tc=o,nc=a}function kA(e){return Ua=new Re,kt(e,Ft),Ua*2}function Ha(e){return[nt(e[1],e[0]),rt(e[2])]}function nr(e){var t=e[0],n=e[1],r=ne(n);return[r*ne(t),r*Q(t),Q(n)]}function qa(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Vr(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 rc(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Za(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Ja(e){var t=ze(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var Me,ct,Ce,gt,rr,Mg,Pg,jr,ji,$n,Qt,en={point:ic,lineStart:Lg,lineEnd:kg,polygonStart:function(){en.point=Rg,en.lineStart=RA,en.lineEnd=EA,ji=new Re,Ft.polygonStart()},polygonEnd:function(){Ft.polygonEnd(),en.point=ic,en.lineStart=Lg,en.lineEnd=kg,ja<0?(Me=-(Ce=180),ct=-(gt=90)):ji>oe?gt=90:ji<-oe&&(ct=-90),Qt[0]=Me,Qt[1]=Ce},sphere:function(){Me=-(Ce=180),ct=-(gt=90)}};function ic(e,t){$n.push(Qt=[Me=e,Ce=e]),t<ct&&(ct=t),t>gt&&(gt=t)}function Cg(e,t){var n=nr([e*ae,t*ae]);if(jr){var r=Vr(jr,n),i=[r[1],-r[0],0],o=Vr(i,r);Ja(o),o=Ha(o);var a=e-rr,s=a>0?1:-1,u=o[0]*$e*s,l,c=me(a)>180;c^(s*rr<u&&u<s*e)?(l=o[1]*$e,l>gt&&(gt=l)):(u=(u+360)%360-180,c^(s*rr<u&&u<s*e)?(l=-o[1]*$e,l<ct&&(ct=l)):(t<ct&&(ct=t),t>gt&&(gt=t))),c?e<rr?mt(Me,e)>mt(Me,Ce)&&(Ce=e):mt(e,Ce)>mt(Me,Ce)&&(Me=e):Ce>=Me?(e<Me&&(Me=e),e>Ce&&(Ce=e)):e>rr?mt(Me,e)>mt(Me,Ce)&&(Ce=e):mt(e,Ce)>mt(Me,Ce)&&(Me=e)}else $n.push(Qt=[Me=e,Ce=e]);t<ct&&(ct=t),t>gt&&(gt=t),jr=n,rr=e}function Lg(){en.point=Cg}function kg(){Qt[0]=Me,Qt[1]=Ce,en.point=ic,jr=null}function Rg(e,t){if(jr){var n=e-rr;ji.add(me(n)>180?n+(n>0?360:-360):n)}else Mg=e,Pg=t;Ft.point(e,t),Cg(e,t)}function RA(){Ft.lineStart()}function EA(){Rg(Mg,Pg),Ft.lineEnd(),me(ji)>oe&&(Me=-(Ce=180)),Qt[0]=Me,Qt[1]=Ce,jr=null}function mt(e,t){return(t-=e)<0?t+360:t}function NA(e,t){return e[0]-t[0]}function Eg(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function BA(e){var t,n,r,i,o,a,s;if(gt=Ce=-(Me=ct=1/0),$n=[],kt(e,en),n=$n.length){for($n.sort(NA),t=1,r=$n[0],o=[r];t<n;++t)i=$n[t],Eg(r,i[0])||Eg(r,i[1])?(mt(r[0],i[1])>mt(r[0],r[1])&&(r[1]=i[1]),mt(i[0],r[1])>mt(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=mt(r[1],i[0]))>a&&(a=s,Me=i[0],Ce=r[1])}return $n=Qt=null,Me===1/0||ct===1/0?[[NaN,NaN],[NaN,NaN]]:[[Me,ct],[Ce,gt]]}var Ui,Ka,Qa,es,ts,ns,rs,is,oc,ac,sc,Ng,Bg,it,ot,at,Rt={sphere:De,point:lc,lineStart:zg,lineEnd:Og,polygonStart:function(){Rt.lineStart=IA,Rt.lineEnd=FA},polygonEnd:function(){Rt.lineStart=zg,Rt.lineEnd=Og}};function lc(e,t){e*=ae,t*=ae;var n=ne(t);Hi(n*ne(e),n*Q(e),Q(t))}function Hi(e,t,n){++Ui,Qa+=(e-Qa)/Ui,es+=(t-es)/Ui,ts+=(n-ts)/Ui}function zg(){Rt.point=zA}function zA(e,t){e*=ae,t*=ae;var n=ne(t);it=n*ne(e),ot=n*Q(e),at=Q(t),Rt.point=OA,Hi(it,ot,at)}function OA(e,t){e*=ae,t*=ae;var n=ne(t),r=n*ne(e),i=n*Q(e),o=Q(t),a=nt(ze((a=ot*o-at*i)*a+(a=at*r-it*o)*a+(a=it*i-ot*r)*a),it*r+ot*i+at*o);Ka+=a,ns+=a*(it+(it=r)),rs+=a*(ot+(ot=i)),is+=a*(at+(at=o)),Hi(it,ot,at)}function Og(){Rt.point=lc}function IA(){Rt.point=YA}function FA(){Ig(Ng,Bg),Rt.point=lc}function YA(e,t){Ng=e,Bg=t,e*=ae,t*=ae,Rt.point=Ig;var n=ne(t);it=n*ne(e),ot=n*Q(e),at=Q(t),Hi(it,ot,at)}function Ig(e,t){e*=ae,t*=ae;var n=ne(t),r=n*ne(e),i=n*Q(e),o=Q(t),a=ot*o-at*i,s=at*r-it*o,u=it*i-ot*r,l=Zu(a,s,u),c=rt(l),h=l&&-c/l;oc.add(h*a),ac.add(h*s),sc.add(h*u),Ka+=c,ns+=c*(it+(it=r)),rs+=c*(ot+(ot=i)),is+=c*(at+(at=o)),Hi(it,ot,at)}function WA(e){Ui=Ka=Qa=es=ts=ns=rs=is=0,oc=new Re,ac=new Re,sc=new Re,kt(e,Rt);var t=+oc,n=+ac,r=+sc,i=Zu(t,n,r);return i<Vi&&(t=ns,n=rs,r=is,Ka<oe&&(t=Qa,n=es,r=ts),i=Zu(t,n,r),i<Vi)?[NaN,NaN]:[nt(n,t)*$e,rt(r/i)*$e]}function Ur(e){return function(){return e}}function uc(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 cc(e,t){return me(e)>ge&&(e-=Math.round(e/tt)*tt),[e,t]}cc.invert=cc;function fc(e,t,n){return(e%=tt)?t||n?uc(Yg(e),Wg(t,n)):Yg(e):t||n?Wg(t,n):cc}function Fg(e){return function(t,n){return t+=e,me(t)>ge&&(t-=Math.round(t/tt)*tt),[t,n]}}function Yg(e){var t=Fg(e);return t.invert=Fg(-e),t}function Wg(e,t){var n=ne(e),r=Q(e),i=ne(t),o=Q(t);function a(s,u){var l=ne(u),c=ne(s)*l,h=Q(s)*l,f=Q(u),p=f*n+c*r;return[nt(h*i-p*o,c*n-f*r),rt(p*i+h*o)]}return a.invert=function(s,u){var l=ne(u),c=ne(s)*l,h=Q(s)*l,f=Q(u),p=f*i-h*o;return[nt(h*i+f*o,c*n+p*r),rt(p*n-c*r)]},a}function Xg(e){e=fc(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]*=$e,n[1]*=$e,n}return t.invert=function(n){return n=e.invert(n[0]*ae,n[1]*ae),n[0]*=$e,n[1]*=$e,n},t}function Gg(e,t,n,r,i,o){if(n){var a=ne(t),s=Q(t),u=r*n;i==null?(i=t+r*tt,o=t-u/2):(i=Vg(a,i),o=Vg(a,o),(r>0?i<o:i>o)&&(i+=r*tt));for(var l,c=i;r>0?c>o:c<o;c-=u)l=Ha([a,-s*ne(c),-s*Q(c)]),e.point(l[0],l[1])}}function Vg(e,t){t=nr(t),t[0]-=e,Ja(t);var n=vg(-t[1]);return((-t[2]<0?-n:n)+tt-oe)%tt}function XA(){var e=Ur([0,0]),t=Ur(90),n=Ur(2),r,i,o={point:a};function a(u,l){r.push(u=i(u,l)),u[0]*=$e,u[1]*=$e}function s(){var u=e.apply(this,arguments),l=t.apply(this,arguments)*ae,c=n.apply(this,arguments)*ae;return r=[],i=fc(-u[0]*ae,-u[1]*ae,0).invert,Gg(o,l,c,1),u={type:"Polygon",coordinates:[r]},r=i=null,u}return s.center=function(u){return arguments.length?(e=typeof u=="function"?u:Ur([+u[0],+u[1]]),s):e},s.radius=function(u){return arguments.length?(t=typeof u=="function"?u:Ur(+u),s):t},s.precision=function(u){return arguments.length?(n=typeof u=="function"?u:Ur(+u),s):n},s}function jg(){var e=[],t;return{point:function(n,r,i){t.push([n,r,i])},lineStart:function(){e.push(t=[])},lineEnd:De,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function os(e,t){return me(e[0]-t[0])<oe&&me(e[1]-t[1])<oe}function as(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 Ug(e,t,n,r,i){var o=[],a=[],s,u;if(e.forEach(function(d){if(!((g=d.length-1)<=0)){var g,m=d[0],y=d[g],b;if(os(m,y)){if(!m[2]&&!y[2]){for(i.lineStart(),s=0;s<g;++s)i.point((m=d[s])[0],m[1]);i.lineEnd();return}y[0]+=2*oe}o.push(b=new as(m,d,null,!0)),a.push(b.o=new as(m,null,b,!1)),o.push(b=new as(y,d,null,!1)),a.push(b.o=new as(y,null,b,!0))}}),!!o.length){for(a.sort(t),Hg(o),Hg(a),s=0,u=a.length;s<u;++s)a[s].e=n=!n;for(var l=o[0],c,h;;){for(var f=l,p=!0;f.v;)if((f=f.n)===l)return;c=f.z,i.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(s=0,u=c.length;s<u;++s)i.point((h=c[s])[0],h[1]);else r(f.x,f.n.x,1,i);f=f.n}else{if(p)for(c=f.p.z,s=c.length-1;s>=0;--s)i.point((h=c[s])[0],h[1]);else r(f.x,f.p.x,-1,i);f=f.p}f=f.o,c=f.z,p=!p}while(!f.v);i.lineEnd()}}}function Hg(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 hc(e){return me(e[0])<=ge?e[0]:vt(e[0])*((me(e[0])+ge)%tt-ge)}function qg(e,t){var n=hc(t),r=t[1],i=Q(r),o=[Q(n),-ne(n),0],a=0,s=0,u=new Re;i===1?r=Pe+oe:i===-1&&(r=-Pe-oe);for(var l=0,c=e.length;l<c;++l)if(f=(h=e[l]).length)for(var h,f,p=h[f-1],d=hc(p),g=p[1]/2+Wa,m=Q(g),y=ne(g),b=0;b<f;++b,d=v,m=w,y=P,p=x){var x=h[b],v=hc(x),_=x[1]/2+Wa,w=Q(_),P=ne(_),C=v-d,L=C>=0?1:-1,E=L*C,N=E>ge,A=m*w;if(u.add(nt(A*L*Q(E),y*P+A*ne(E))),a+=N?C+L*tt:C,N^d>=n^v>=n){var R=Vr(nr(p),nr(x));Ja(R);var S=Vr(o,R);Ja(S);var M=(N^C>=0?-1:1)*rt(S[2]);(r>M||r===M&&(R[0]||R[1]))&&(s+=N^C>=0?1:-1)}}return(a<-oe||a<oe&&u<-Vi)^s&1}function Zg(e,t,n,r){return function(i){var o=t(i),a=jg(),s=t(a),u=!1,l,c,h,f={point:p,lineStart:g,lineEnd:m,polygonStart:function(){f.point=y,f.lineStart=b,f.lineEnd=x,c=[],l=[]},polygonEnd:function(){f.point=p,f.lineStart=g,f.lineEnd=m,c=Ol(c);var v=qg(l,r);c.length?(u||(i.polygonStart(),u=!0),Ug(c,VA,v,n,i)):v&&(u||(i.polygonStart(),u=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),u&&(i.polygonEnd(),u=!1),c=l=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function p(v,_){e(v,_)&&i.point(v,_)}function d(v,_){o.point(v,_)}function g(){f.point=d,o.lineStart()}function m(){f.point=p,o.lineEnd()}function y(v,_){h.push([v,_]),s.point(v,_)}function b(){s.lineStart(),h=[]}function x(){y(h[0][0],h[0][1]),s.lineEnd();var v=s.clean(),_=a.result(),w,P=_.length,C,L,E;if(h.pop(),l.push(h),h=null,!!P){if(v&1){if(L=_[0],(C=L.length-1)>0){for(u||(i.polygonStart(),u=!0),i.lineStart(),w=0;w<C;++w)i.point((E=L[w])[0],E[1]);i.lineEnd()}return}P>1&&v&2&&_.push(_.pop().concat(_.shift())),c.push(_.filter(GA))}}return f}}function GA(e){return e.length>1}function VA(e,t){return((e=e.x)[0]<0?e[1]-Pe-oe:Pe-e[1])-((t=t.x)[0]<0?t[1]-Pe-oe:Pe-t[1])}const pc=Zg(function(){return!0},jA,HA,[-ge,-Pe]);function jA(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(o,a){var s=o>0?ge:-ge,u=me(o-t);me(u-ge)<oe?(e.point(t,n=(n+a)/2>0?Pe:-Pe),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(s,n),e.point(o,n),i=0):r!==s&&u>=ge&&(me(t-r)<oe&&(t-=r*oe),me(o-s)<oe&&(o-=s*oe),n=UA(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 UA(e,t,n,r){var i,o,a=Q(e-n);return me(a)>oe?Gr((Q(t)*(o=ne(r))*Q(n)-Q(r)*(i=ne(t))*Q(e))/(i*o*a)):(t+r)/2}function HA(e,t,n,r){var i;if(e==null)i=n*Pe,r.point(-ge,i),r.point(0,i),r.point(ge,i),r.point(ge,0),r.point(ge,-i),r.point(0,-i),r.point(-ge,-i),r.point(-ge,0),r.point(-ge,i);else if(me(e[0]-t[0])>oe){var o=e[0]<t[0]?ge:-ge;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])}function Jg(e){var t=ne(e),n=2*ae,r=t>0,i=me(t)>oe;function o(c,h,f,p){Gg(p,e,n,f,c,h)}function a(c,h){return ne(c)*ne(h)>t}function s(c){var h,f,p,d,g;return{lineStart:function(){d=p=!1,g=1},point:function(m,y){var b=[m,y],x,v=a(m,y),_=r?v?0:l(m,y):v?l(m+(m<0?ge:-ge),y):0;if(!h&&(d=p=v)&&c.lineStart(),v!==p&&(x=u(h,b),(!x||os(h,x)||os(b,x))&&(b[2]=1)),v!==p)g=0,v?(c.lineStart(),x=u(b,h),c.point(x[0],x[1])):(x=u(h,b),c.point(x[0],x[1],2),c.lineEnd()),h=x;else if(i&&h&&r^v){var w;!(_&f)&&(w=u(b,h,!0))&&(g=0,r?(c.lineStart(),c.point(w[0][0],w[0][1]),c.point(w[1][0],w[1][1]),c.lineEnd()):(c.point(w[1][0],w[1][1]),c.lineEnd(),c.lineStart(),c.point(w[0][0],w[0][1],3)))}v&&(!h||!os(h,b))&&c.point(b[0],b[1]),h=b,p=v,f=_},lineEnd:function(){p&&c.lineEnd(),h=null},clean:function(){return g|(d&&p)<<1}}}function u(c,h,f){var p=nr(c),d=nr(h),g=[1,0,0],m=Vr(p,d),y=qa(m,m),b=m[0],x=y-b*b;if(!x)return!f&&c;var v=t*y/x,_=-t*b/x,w=Vr(g,m),P=Za(g,v),C=Za(m,_);rc(P,C);var L=w,E=qa(P,L),N=qa(L,L),A=E*E-N*(qa(P,P)-1);if(!(A<0)){var R=ze(A),S=Za(L,(-E-R)/N);if(rc(S,P),S=Ha(S),!f)return S;var M=c[0],$=h[0],B=c[1],D=h[1],z;$<M&&(z=M,M=$,$=z);var F=$-M,j=me(F-ge)<oe,K=j||F<oe;if(!j&&D<B&&(z=B,B=D,D=z),K?j?B+D>0^S[1]<(me(S[0]-M)<oe?B:D):B<=S[1]&&S[1]<=D:F>ge^(M<=S[0]&&S[0]<=$)){var se=Za(L,(-E+R)/N);return rc(se,P),[S,Ha(se)]}}}function l(c,h){var f=r?e:ge-e,p=0;return c<-f?p|=1:c>f&&(p|=2),h<-f?p|=4:h>f&&(p|=8),p}return Zg(a,s,o,r?[0,-e]:[-ge,e-ge])}function qA(e,t,n,r,i,o){var a=e[0],s=e[1],u=t[0],l=t[1],c=0,h=1,f=u-a,p=l-s,d;if(d=n-a,!(!f&&d>0)){if(d/=f,f<0){if(d<c)return;d<h&&(h=d)}else if(f>0){if(d>h)return;d>c&&(c=d)}if(d=i-a,!(!f&&d<0)){if(d/=f,f<0){if(d>h)return;d>c&&(c=d)}else if(f>0){if(d<c)return;d<h&&(h=d)}if(d=r-s,!(!p&&d>0)){if(d/=p,p<0){if(d<c)return;d<h&&(h=d)}else if(p>0){if(d>h)return;d>c&&(c=d)}if(d=o-s,!(!p&&d<0)){if(d/=p,p<0){if(d>h)return;d>c&&(c=d)}else if(p>0){if(d<c)return;d<h&&(h=d)}return c>0&&(e[0]=a+c*f,e[1]=s+c*p),h<1&&(t[0]=a+h*f,t[1]=s+h*p),!0}}}}}var qi=1e9,ss=-qi;function ls(e,t,n,r){function i(l,c){return e<=l&&l<=n&&t<=c&&c<=r}function o(l,c,h,f){var p=0,d=0;if(l==null||(p=a(l,h))!==(d=a(c,h))||u(l,c)<0^h>0)do f.point(p===0||p===3?e:n,p>1?r:t);while((p=(p+h+4)%4)!==d);else f.point(c[0],c[1])}function a(l,c){return me(l[0]-e)<oe?c>0?0:3:me(l[0]-n)<oe?c>0?2:1:me(l[1]-t)<oe?c>0?1:0:c>0?3:2}function s(l,c){return u(l.x,c.x)}function u(l,c){var h=a(l,1),f=a(c,1);return h!==f?h-f:h===0?c[1]-l[1]:h===1?l[0]-c[0]:h===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,h=jg(),f,p,d,g,m,y,b,x,v,_,w,P={point:C,lineStart:A,lineEnd:R,polygonStart:E,polygonEnd:N};function C(M,$){i(M,$)&&c.point(M,$)}function L(){for(var M=0,$=0,B=p.length;$<B;++$)for(var D=p[$],z=1,F=D.length,j=D[0],K,se,te=j[0],Y=j[1];z<F;++z)K=te,se=Y,j=D[z],te=j[0],Y=j[1],se<=r?Y>r&&(te-K)*(r-se)>(Y-se)*(e-K)&&++M:Y<=r&&(te-K)*(r-se)<(Y-se)*(e-K)&&--M;return M}function E(){c=h,f=[],p=[],w=!0}function N(){var M=L(),$=w&&M,B=(f=Ol(f)).length;($||B)&&(l.polygonStart(),$&&(l.lineStart(),o(null,null,1,l),l.lineEnd()),B&&Ug(f,s,M,o,l),l.polygonEnd()),c=l,f=p=d=null}function A(){P.point=S,p&&p.push(d=[]),_=!0,v=!1,b=x=NaN}function R(){f&&(S(g,m),y&&v&&h.rejoin(),f.push(h.result())),P.point=C,v&&c.lineEnd()}function S(M,$){var B=i(M,$);if(p&&d.push([M,$]),_)g=M,m=$,y=B,_=!1,B&&(c.lineStart(),c.point(M,$));else if(B&&v)c.point(M,$);else{var D=[b=Math.max(ss,Math.min(qi,b)),x=Math.max(ss,Math.min(qi,x))],z=[M=Math.max(ss,Math.min(qi,M)),$=Math.max(ss,Math.min(qi,$))];qA(D,z,e,t,n,r)?(v||(c.lineStart(),c.point(D[0],D[1])),c.point(z[0],z[1]),B||c.lineEnd(),w=!1):B&&(c.lineStart(),c.point(M,$),w=!1)}b=M,x=$,v=B}return P}}function ZA(){var e=0,t=0,n=960,r=500,i,o,a;return a={stream:function(s){return i&&o===s?i:i=ls(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 dc,gc,us,cs,Hr={sphere:De,point:De,lineStart:JA,lineEnd:De,polygonStart:De,polygonEnd:De};function JA(){Hr.point=QA,Hr.lineEnd=KA}function KA(){Hr.point=Hr.lineEnd=De}function QA(e,t){e*=ae,t*=ae,gc=e,us=Q(t),cs=ne(t),Hr.point=eD}function eD(e,t){e*=ae,t*=ae;var n=Q(t),r=ne(t),i=me(e-gc),o=ne(i),a=Q(i),s=r*a,u=cs*n-us*r*o,l=us*n+cs*r*o;dc.add(nt(ze(s*s+u*u),l)),gc=e,us=n,cs=r}function Kg(e){return dc=new Re,kt(e,Hr),+dc}var mc=[null,null],tD={type:"LineString",coordinates:mc};function fs(e,t){return mc[0]=e,mc[1]=t,Kg(tD)}var Qg={Feature:function(e,t){return hs(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)if(hs(n[r].geometry,t))return!0;return!1}},e0={Sphere:function(){return!0},Point:function(e,t){return t0(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(t0(n[r],t))return!0;return!1},LineString:function(e,t){return n0(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(n0(n[r],t))return!0;return!1},Polygon:function(e,t){return r0(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(r0(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)if(hs(n[r],t))return!0;return!1}};function hs(e,t){return e&&e0.hasOwnProperty(e.type)?e0[e.type](e,t):!1}function t0(e,t){return fs(e,t)===0}function n0(e,t){for(var n,r,i,o=0,a=e.length;o<a;o++){if(r=fs(e[o],t),r===0||o>0&&(i=fs(e[o],e[o-1]),i>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<Vi*i))return!0;n=r}return!1}function r0(e,t){return!!qg(e.map(nD),i0(t))}function nD(e){return e=e.map(i0),e.pop(),e}function i0(e){return[e[0]*ae,e[1]*ae]}function rD(e,t){return(e&&Qg.hasOwnProperty(e.type)?Qg[e.type]:hs)(e,t)}function o0(e,t,n){var r=mn(e,t-oe,n).concat(t);return function(i){return r.map(function(o){return[i,o]})}}function a0(e,t,n){var r=mn(e,t-oe,n).concat(t);return function(i){return r.map(function(o){return[o,i]})}}function s0(){var e,t,n,r,i,o,a,s,u=10,l=u,c=90,h=360,f,p,d,g,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return mn(Xa(r/c)*c,n,c).map(d).concat(mn(Xa(s/h)*h,a,h).map(g)).concat(mn(Xa(t/u)*u,e,u).filter(function(x){return me(x%c)>oe}).map(f)).concat(mn(Xa(o/l)*l,i,l).filter(function(x){return me(x%h)>oe}).map(p))}return y.lines=function(){return b().map(function(x){return{type:"LineString",coordinates:x}})},y.outline=function(){return{type:"Polygon",coordinates:[d(r).concat(g(a).slice(1),d(n).reverse().slice(1),g(s).reverse().slice(1))]}},y.extent=function(x){return arguments.length?y.extentMajor(x).extentMinor(x):y.extentMinor()},y.extentMajor=function(x){return arguments.length?(r=+x[0][0],n=+x[1][0],s=+x[0][1],a=+x[1][1],r>n&&(x=r,r=n,n=x),s>a&&(x=s,s=a,a=x),y.precision(m)):[[r,s],[n,a]]},y.extentMinor=function(x){return arguments.length?(t=+x[0][0],e=+x[1][0],o=+x[0][1],i=+x[1][1],t>e&&(x=t,t=e,e=x),o>i&&(x=o,o=i,i=x),y.precision(m)):[[t,o],[e,i]]},y.step=function(x){return arguments.length?y.stepMajor(x).stepMinor(x):y.stepMinor()},y.stepMajor=function(x){return arguments.length?(c=+x[0],h=+x[1],y):[c,h]},y.stepMinor=function(x){return arguments.length?(u=+x[0],l=+x[1],y):[u,l]},y.precision=function(x){return arguments.length?(m=+x,f=o0(o,i,90),p=a0(t,e,m),d=o0(s,a,90),g=a0(r,n,m),y):m},y.extentMajor([[-180,-90+oe],[180,90-oe]]).extentMinor([[-180,-80-oe],[180,80+oe]])}function iD(){return s0()()}function oD(e,t){var n=e[0]*ae,r=e[1]*ae,i=t[0]*ae,o=t[1]*ae,a=ne(r),s=Q(r),u=ne(o),l=Q(o),c=a*ne(n),h=a*Q(n),f=u*ne(i),p=u*Q(i),d=2*rt(ze(Sg(o-r)+a*u*Sg(i-n))),g=Q(d),m=d?function(y){var b=Q(y*=d)/g,x=Q(d-y)/g,v=x*c+b*f,_=x*h+b*p,w=x*s+b*l;return[nt(_,v)*$e,nt(w,ze(v*v+_*_))*$e]}:function(){return[n*$e,r*$e]};return m.distance=d,m}const Zi=e=>e;var yc=new Re,bc=new Re,l0,u0,xc,vc,tn={point:De,lineStart:De,lineEnd:De,polygonStart:function(){tn.lineStart=aD,tn.lineEnd=lD},polygonEnd:function(){tn.lineStart=tn.lineEnd=tn.point=De,yc.add(me(bc)),bc=new Re},result:function(){var e=yc/2;return yc=new Re,e}};function aD(){tn.point=sD}function sD(e,t){tn.point=c0,l0=xc=e,u0=vc=t}function c0(e,t){bc.add(vc*e-xc*t),xc=e,vc=t}function lD(){c0(l0,u0)}var qr=1/0,ps=qr,Ji=-qr,ds=Ji,gs={point:uD,lineStart:De,lineEnd:De,polygonStart:De,polygonEnd:De,result:function(){var e=[[qr,ps],[Ji,ds]];return Ji=ds=-(ps=qr=1/0),e}};function uD(e,t){e<qr&&(qr=e),e>Ji&&(Ji=e),t<ps&&(ps=t),t>ds&&(ds=t)}var Sc=0,$c=0,Ki=0,ms=0,ys=0,Zr=0,wc=0,_c=0,Qi=0,f0,h0,Yt,Wt,St={point:ir,lineStart:p0,lineEnd:d0,polygonStart:function(){St.lineStart=hD,St.lineEnd=pD},polygonEnd:function(){St.point=ir,St.lineStart=p0,St.lineEnd=d0},result:function(){var e=Qi?[wc/Qi,_c/Qi]:Zr?[ms/Zr,ys/Zr]:Ki?[Sc/Ki,$c/Ki]:[NaN,NaN];return Sc=$c=Ki=ms=ys=Zr=wc=_c=Qi=0,e}};function ir(e,t){Sc+=e,$c+=t,++Ki}function p0(){St.point=cD}function cD(e,t){St.point=fD,ir(Yt=e,Wt=t)}function fD(e,t){var n=e-Yt,r=t-Wt,i=ze(n*n+r*r);ms+=i*(Yt+e)/2,ys+=i*(Wt+t)/2,Zr+=i,ir(Yt=e,Wt=t)}function d0(){St.point=ir}function hD(){St.point=dD}function pD(){g0(f0,h0)}function dD(e,t){St.point=g0,ir(f0=Yt=e,h0=Wt=t)}function g0(e,t){var n=e-Yt,r=t-Wt,i=ze(n*n+r*r);ms+=i*(Yt+e)/2,ys+=i*(Wt+t)/2,Zr+=i,i=Wt*e-Yt*t,wc+=i*(Yt+e),_c+=i*(Wt+t),Qi+=i*3,ir(Yt=e,Wt=t)}function m0(e){this._context=e}m0.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,tt);break}}},result:De};var Tc=new Re,Ac,y0,b0,eo,to,no={point:De,lineStart:function(){no.point=gD},lineEnd:function(){Ac&&x0(y0,b0),no.point=De},polygonStart:function(){Ac=!0},polygonEnd:function(){Ac=null},result:function(){var e=+Tc;return Tc=new Re,e}};function gD(e,t){no.point=x0,y0=eo=e,b0=to=t}function x0(e,t){eo-=e,to-=t,Tc.add(ze(eo*eo+to*to)),eo=e,to=t}let v0,bs,S0,$0;class w0{constructor(t){this._append=t==null?_0:mD(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!==S0||this._append!==bs){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`,S0=r,bs=this._append,$0=this._,this._=i}this._+=$0;break}}}result(){const t=this._;return this._="",t.length?t:null}}function _0(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function mD(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return _0;if(t!==v0){const n=10**t;v0=t,bs=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 bs}function yD(e,t){let n=3,r=4.5,i,o;function a(s){return s&&(typeof r=="function"&&o.pointRadius(+r.apply(this,arguments)),kt(s,i(o))),o.result()}return a.area=function(s){return kt(s,i(tn)),tn.result()},a.measure=function(s){return kt(s,i(no)),no.result()},a.bounds=function(s){return kt(s,i(gs)),gs.result()},a.centroid=function(s){return kt(s,i(St)),St.result()},a.projection=function(s){return arguments.length?(i=s==null?(e=null,Zi):(e=s).stream,a):e},a.context=function(s){return arguments.length?(o=s==null?(t=null,new w0(n)):new m0(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 u=Math.floor(s);if(!(u>=0))throw new RangeError(`invalid digits: ${s}`);n=u}return t===null&&(o=new w0(n)),a},a.projection(e).digits(n).context(t)}function bD(e){return{stream:ro(e)}}function ro(e){return function(t){var n=new Dc;for(var r in e)n[r]=e[r];return n.stream=t,n}}function Dc(){}Dc.prototype={constructor:Dc,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 Mc(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),kt(n,e.stream(gs)),t(gs.result()),r!=null&&e.clipExtent(r),e}function xs(e,t,n){return Mc(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,u=+t[0][1]+(o-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([s,u])},n)}function Pc(e,t,n){return xs(e,[[0,0],t],n)}function Cc(e,t,n){return Mc(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 Lc(e,t,n){return Mc(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 T0=16,xD=ne(30*ae);function A0(e,t){return+t?SD(e,t):vD(e)}function vD(e){return ro({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function SD(e,t){function n(r,i,o,a,s,u,l,c,h,f,p,d,g,m){var y=l-r,b=c-i,x=y*y+b*b;if(x>4*t&&g--){var v=a+f,_=s+p,w=u+d,P=ze(v*v+_*_+w*w),C=rt(w/=P),L=me(me(w)-1)<oe||me(o-h)<oe?(o+h)/2:nt(_,v),E=e(L,C),N=E[0],A=E[1],R=N-r,S=A-i,M=b*R-y*S;(M*M/x>t||me((y*R+b*S)/x-.5)>.3||a*f+s*p+u*d<xD)&&(n(r,i,o,a,s,u,N,A,L,v/=P,_/=P,w,g,m),m.point(N,A),n(N,A,L,v,_,w,l,c,h,f,p,d,g,m))}}return function(r){var i,o,a,s,u,l,c,h,f,p,d,g,m={point:y,lineStart:b,lineEnd:v,polygonStart:function(){r.polygonStart(),m.lineStart=_},polygonEnd:function(){r.polygonEnd(),m.lineStart=b}};function y(C,L){C=e(C,L),r.point(C[0],C[1])}function b(){h=NaN,m.point=x,r.lineStart()}function x(C,L){var E=nr([C,L]),N=e(C,L);n(h,f,c,p,d,g,h=N[0],f=N[1],c=C,p=E[0],d=E[1],g=E[2],T0,r),r.point(h,f)}function v(){m.point=y,r.lineEnd()}function _(){b(),m.point=w,m.lineEnd=P}function w(C,L){x(i=C,L),o=h,a=f,s=p,u=d,l=g,m.point=x}function P(){n(h,f,c,p,d,g,o,a,i,s,u,l,T0,r),m.lineEnd=v,v()}return m}}var $D=ro({point:function(e,t){this.stream.point(e*ae,t*ae)}});function wD(e){return ro({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function _D(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 D0(e,t,n,r,i,o){if(!o)return _D(e,t,n,r,i);var a=ne(o),s=Q(o),u=a*e,l=s*e,c=a/e,h=s/e,f=(s*n-a*t)/e,p=(s*t+a*n)/e;function d(g,m){return g*=r,m*=i,[u*g-l*m+t,n-l*g-u*m]}return d.invert=function(g,m){return[r*(c*g-h*m+f),i*(p-h*g-c*m)]},d}function Xt(e){return kc(function(){return e})()}function kc(e){var t,n=150,r=480,i=250,o=0,a=0,s=0,u=0,l=0,c,h=0,f=1,p=1,d=null,g=pc,m=null,y,b,x,v=Zi,_=.5,w,P,C,L,E;function N(M){return C(M[0]*ae,M[1]*ae)}function A(M){return M=C.invert(M[0],M[1]),M&&[M[0]*$e,M[1]*$e]}N.stream=function(M){return L&&E===M?L:L=$D(wD(c)(g(w(v(E=M)))))},N.preclip=function(M){return arguments.length?(g=M,d=void 0,S()):g},N.postclip=function(M){return arguments.length?(v=M,m=y=b=x=null,S()):v},N.clipAngle=function(M){return arguments.length?(g=+M?Jg(d=M*ae):(d=null,pc),S()):d*$e},N.clipExtent=function(M){return arguments.length?(v=M==null?(m=y=b=x=null,Zi):ls(m=+M[0][0],y=+M[0][1],b=+M[1][0],x=+M[1][1]),S()):m==null?null:[[m,y],[b,x]]},N.scale=function(M){return arguments.length?(n=+M,R()):n},N.translate=function(M){return arguments.length?(r=+M[0],i=+M[1],R()):[r,i]},N.center=function(M){return arguments.length?(o=M[0]%360*ae,a=M[1]%360*ae,R()):[o*$e,a*$e]},N.rotate=function(M){return arguments.length?(s=M[0]%360*ae,u=M[1]%360*ae,l=M.length>2?M[2]%360*ae:0,R()):[s*$e,u*$e,l*$e]},N.angle=function(M){return arguments.length?(h=M%360*ae,R()):h*$e},N.reflectX=function(M){return arguments.length?(f=M?-1:1,R()):f<0},N.reflectY=function(M){return arguments.length?(p=M?-1:1,R()):p<0},N.precision=function(M){return arguments.length?(w=A0(P,_=M*M),S()):ze(_)},N.fitExtent=function(M,$){return xs(N,M,$)},N.fitSize=function(M,$){return Pc(N,M,$)},N.fitWidth=function(M,$){return Cc(N,M,$)},N.fitHeight=function(M,$){return Lc(N,M,$)};function R(){var M=D0(n,0,0,f,p,h).apply(null,t(o,a)),$=D0(n,r-M[0],i-M[1],f,p,h);return c=fc(s,u,l),P=uc(t,$),C=uc(c,P),w=A0(P,_),S()}function S(){return L=E=null,N}return function(){return t=e.apply(this,arguments),N.invert=t.invert&&A,R()}}function Rc(e){var t=0,n=ge/3,r=kc(e),i=r(t,n);return i.parallels=function(o){return arguments.length?r(t=o[0]*ae,n=o[1]*ae):[t*$e,n*$e]},i}function TD(e){var t=ne(e);function n(r,i){return[r*t,Q(i)/t]}return n.invert=function(r,i){return[r/t,rt(i*t)]},n}function M0(e,t){var n=Q(e),r=(n+Q(t))/2;if(me(r)<oe)return TD(e);var i=1+n*(2*r-n),o=ze(i)/r;function a(s,u){var l=ze(i-2*r*Q(u))/r;return[l*Q(s*=r),o-l*ne(s)]}return a.invert=function(s,u){var l=o-u,c=nt(s,me(l))*vt(l);return l*r<0&&(c-=ge*vt(s)*vt(l)),[c/r,rt((i-(s*s+l*l)*r*r)/(2*r))]},a}function vs(){return Rc(M0).scale(155.424).center([0,33.6442])}function P0(){return vs().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function AD(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 DD(){var e,t,n=P0(),r,i=vs().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o,a=vs().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s,u,l={point:function(f,p){u=[f,p]}};function c(f){var p=f[0],d=f[1];return u=null,r.point(p,d),u||(o.point(p,d),u)||(s.point(p,d),u)}c.invert=function(f){var p=n.scale(),d=n.translate(),g=(f[0]-d[0])/p,m=(f[1]-d[1])/p;return(m>=.12&&m<.234&&g>=-.425&&g<-.214?i:m>=.166&&m<.234&&g>=-.214&&g<-.115?a:n).invert(f)},c.stream=function(f){return e&&t===f?e:e=AD([n.stream(t=f),i.stream(f),a.stream(f)])},c.precision=function(f){return arguments.length?(n.precision(f),i.precision(f),a.precision(f),h()):n.precision()},c.scale=function(f){return arguments.length?(n.scale(f),i.scale(f*.35),a.scale(f),c.translate(n.translate())):n.scale()},c.translate=function(f){if(!arguments.length)return n.translate();var p=n.scale(),d=+f[0],g=+f[1];return r=n.translate(f).clipExtent([[d-.455*p,g-.238*p],[d+.455*p,g+.238*p]]).stream(l),o=i.translate([d-.307*p,g+.201*p]).clipExtent([[d-.425*p+oe,g+.12*p+oe],[d-.214*p-oe,g+.234*p-oe]]).stream(l),s=a.translate([d-.205*p,g+.212*p]).clipExtent([[d-.214*p+oe,g+.166*p+oe],[d-.115*p-oe,g+.234*p-oe]]).stream(l),h()},c.fitExtent=function(f,p){return xs(c,f,p)},c.fitSize=function(f,p){return Pc(c,f,p)},c.fitWidth=function(f,p){return Cc(c,f,p)},c.fitHeight=function(f,p){return Lc(c,f,p)};function h(){return e=t=null,c}return c.scale(1070)}function C0(e){return function(t,n){var r=ne(t),i=ne(n),o=e(r*i);return o===1/0?[2,0]:[o*i*Q(t),o*Q(n)]}}function io(e){return function(t,n){var r=ze(t*t+n*n),i=e(r),o=Q(i),a=ne(i);return[nt(t*o,r*a),rt(r&&n*o/r)]}}var Ec=C0(function(e){return ze(2/(1+e))});Ec.invert=io(function(e){return 2*rt(e/2)});function MD(){return Xt(Ec).scale(124.75).clipAngle(180-.001)}var Nc=C0(function(e){return(e=vg(e))&&e/Q(e)});Nc.invert=io(function(e){return e});function PD(){return Xt(Nc).scale(79.4188).clipAngle(180-.001)}function oo(e,t){return[e,Ga(Ku((Pe+t)/2))]}oo.invert=function(e,t){return[e,2*Gr(xg(t))-Pe]};function CD(){return L0(oo).scale(961/tt)}function L0(e){var t=Xt(e),n=t.center,r=t.scale,i=t.translate,o=t.clipExtent,a=null,s,u,l;t.scale=function(h){return arguments.length?(r(h),c()):r()},t.translate=function(h){return arguments.length?(i(h),c()):i()},t.center=function(h){return arguments.length?(n(h),c()):n()},t.clipExtent=function(h){return arguments.length?(h==null?a=s=u=l=null:(a=+h[0][0],s=+h[0][1],u=+h[1][0],l=+h[1][1]),c()):a==null?null:[[a,s],[u,l]]};function c(){var h=ge*r(),f=t(Xg(t.rotate()).invert([0,0]));return o(a==null?[[f[0]-h,f[1]-h],[f[0]+h,f[1]+h]]:e===oo?[[Math.max(f[0]-h,a),s],[Math.min(f[0]+h,u),l]]:[[a,Math.max(f[1]-h,s)],[u,Math.min(f[1]+h,l)]])}return c()}function Ss(e){return Ku((Pe+e)/2)}function k0(e,t){var n=ne(e),r=e===t?Q(e):Ga(n/ne(t))/Ga(Ss(t)/Ss(e)),i=n*Ju(Ss(e),r)/r;if(!r)return oo;function o(a,s){i>0?s<-Pe+oe&&(s=-Pe+oe):s>Pe-oe&&(s=Pe-oe);var u=i/Ju(Ss(s),r);return[u*Q(r*a),i-u*ne(r*a)]}return o.invert=function(a,s){var u=i-s,l=vt(r)*ze(a*a+u*u),c=nt(a,me(u))*vt(u);return u*r<0&&(c-=ge*vt(a)*vt(u)),[c/r,2*Gr(Ju(i/l,1/r))-Pe]},o}function LD(){return Rc(k0).scale(109.5).parallels([30,30])}function ao(e,t){return[e,t]}ao.invert=ao;function kD(){return Xt(ao).scale(152.63)}function R0(e,t){var n=ne(e),r=e===t?Q(e):(n-ne(t))/(t-e),i=n/r+e;if(me(r)<oe)return ao;function o(a,s){var u=i-s,l=r*a;return[u*Q(l),i-u*ne(l)]}return o.invert=function(a,s){var u=i-s,l=nt(a,me(u))*vt(u);return u*r<0&&(l-=ge*vt(a)*vt(u)),[l/r,i-vt(r)*ze(a*a+u*u)]},o}function RD(){return Rc(R0).scale(131.154).center([0,13.9389])}var so=1.340264,lo=-.081106,uo=893e-6,co=.003796,$s=ze(3)/2,ED=12;function Bc(e,t){var n=rt($s*Q(t)),r=n*n,i=r*r*r;return[e*ne(n)/($s*(so+3*lo*r+i*(7*uo+9*co*r))),n*(so+lo*r+i*(uo+co*r))]}Bc.invert=function(e,t){for(var n=t,r=n*n,i=r*r*r,o=0,a,s,u;o<ED&&(s=n*(so+lo*r+i*(uo+co*r))-t,u=so+3*lo*r+i*(7*uo+9*co*r),n-=a=s/u,r=n*n,i=r*r*r,!(me(a)<Vi));++o);return[$s*e*(so+3*lo*r+i*(7*uo+9*co*r))/ne(n),rt(Q(n)/$s)]};function ND(){return Xt(Bc).scale(177.158)}function zc(e,t){var n=ne(t),r=ne(e)*n;return[n*Q(e)/r,Q(t)/r]}zc.invert=io(Gr);function BD(){return Xt(zc).scale(144.049).clipAngle(60)}function zD(){var e=1,t=0,n=0,r=1,i=1,o=0,a,s,u=null,l,c,h,f=1,p=1,d=ro({point:function(v,_){var w=x([v,_]);this.stream.point(w[0],w[1])}}),g=Zi,m,y;function b(){return f=e*r,p=e*i,m=y=null,x}function x(v){var _=v[0]*f,w=v[1]*p;if(o){var P=w*a-_*s;_=_*a+w*s,w=P}return[_+t,w+n]}return x.invert=function(v){var _=v[0]-t,w=v[1]-n;if(o){var P=w*a+_*s;_=_*a-w*s,w=P}return[_/f,w/p]},x.stream=function(v){return m&&y===v?m:m=d(g(y=v))},x.postclip=function(v){return arguments.length?(g=v,u=l=c=h=null,b()):g},x.clipExtent=function(v){return arguments.length?(g=v==null?(u=l=c=h=null,Zi):ls(u=+v[0][0],l=+v[0][1],c=+v[1][0],h=+v[1][1]),b()):u==null?null:[[u,l],[c,h]]},x.scale=function(v){return arguments.length?(e=+v,b()):e},x.translate=function(v){return arguments.length?(t=+v[0],n=+v[1],b()):[t,n]},x.angle=function(v){return arguments.length?(o=v%360*ae,s=Q(o),a=ne(o),b()):o*$e},x.reflectX=function(v){return arguments.length?(r=v?-1:1,b()):r<0},x.reflectY=function(v){return arguments.length?(i=v?-1:1,b()):i<0},x.fitExtent=function(v,_){return xs(x,v,_)},x.fitSize=function(v,_){return Pc(x,v,_)},x.fitWidth=function(v,_){return Cc(x,v,_)},x.fitHeight=function(v,_){return Lc(x,v,_)},x}function Oc(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)))]}Oc.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(me(i)>oe&&--r>0);return[e/(.8707+(o=n*n)*(-.131979+o*(-.013791+o*o*o*(.003971-.001529*o)))),n]};function OD(){return Xt(Oc).scale(175.295)}function Ic(e,t){return[ne(t)*Q(e),Q(t)]}Ic.invert=io(rt);function ID(){return Xt(Ic).scale(249.5).clipAngle(90+oe)}function Fc(e,t){var n=ne(t),r=1+ne(e)*n;return[n*Q(e)/r,Q(t)/r]}Fc.invert=io(function(e){return 2*Gr(e)});function FD(){return Xt(Fc).scale(250).clipAngle(142)}function Yc(e,t){return[Ga(Ku((Pe+t)/2)),-e]}Yc.invert=function(e,t){return[-t,2*Gr(xg(e))-Pe]};function YD(){var e=L0(Yc),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 WD(e,t){return e.parent===t.parent?1:2}function XD(e){return e.reduce(GD,0)/e.length}function GD(e,t){return e+t.x}function VD(e){return 1+e.reduce(jD,0)}function jD(e,t){return Math.max(e,t.y)}function UD(e){for(var t;t=e.children;)e=t[0];return e}function HD(e){for(var t;t=e.children;)e=t[t.length-1];return e}function qD(){var e=WD,t=1,n=1,r=!1;function i(o){var a,s=0;o.eachAfter(function(f){var p=f.children;p?(f.x=XD(p),f.y=VD(p)):(f.x=a?s+=e(f,a):0,f.y=0,a=f)});var u=UD(o),l=HD(o),c=u.x-e(u,l)/2,h=l.x+e(l,u)/2;return o.eachAfter(r?function(f){f.x=(f.x-o.x)*t,f.y=(o.y-f.y)*n}:function(f){f.x=(f.x-c)/(h-c)*t,f.y=(1-(o.y?f.y/o.y:1))*n})}return i.separation=function(o){return arguments.length?(e=o,i):e},i.size=function(o){return arguments.length?(r=!1,t=+o[0],n=+o[1],i):r?null:[t,n]},i.nodeSize=function(o){return arguments.length?(r=!0,t=+o[0],n=+o[1],i):r?[t,n]:null},i}function ZD(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 JD(){return this.eachAfter(ZD)}function KD(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function QD(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 eM(e,t){for(var n=this,r=[n],i=[],o,a,s,u=-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,++u,this);return this}function tM(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function nM(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 rM(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function iM(e){for(var t=this,n=oM(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 oM(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 aM(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function sM(){return Array.from(this)}function lM(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function uM(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*cM(){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 ws(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=pM)):t===void 0&&(t=hM);for(var n=new or(e),r,i=[n],o,a,s,u;r=i.pop();)if((a=t(r.data))&&(u=(a=Array.from(a)).length))for(r.children=a,s=u-1;s>=0;--s)i.push(o=a[s]=new or(a[s])),o.parent=r,o.depth=r.depth+1;return n.eachBefore(E0)}function fM(){return ws(this).eachBefore(dM)}function hM(e){return e.children}function pM(e){return Array.isArray(e)?e[1]:null}function dM(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function E0(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function or(e){this.data=e,this.depth=this.height=0,this.parent=null}or.prototype=ws.prototype={constructor:or,count:JD,each:KD,eachAfter:eM,eachBefore:QD,find:tM,sum:nM,sort:rM,path:iM,ancestors:aM,descendants:sM,leaves:lM,links:uM,copy:fM,[Symbol.iterator]:cM};function _s(e){return e==null?null:N0(e)}function N0(e){if(typeof e!="function")throw new Error;return e}function ar(){return 0}function Jr(e){return function(){return e}}const gM=1664525,mM=1013904223,B0=4294967296;function Wc(){let e=1;return()=>(e=(gM*e+mM)%B0)/B0}function yM(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function bM(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 xM(e){return z0(e,Wc())}function z0(e,t){for(var n=0,r=(e=bM(Array.from(e),t)).length,i=[],o,a;n<r;)o=e[n],a&&O0(a,o)?++n:(a=SM(i=vM(i,o)),n=0);return a}function vM(e,t){var n,r;if(Xc(t,e))return[t];for(n=0;n<e.length;++n)if(Ts(t,e[n])&&Xc(fo(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(Ts(fo(e[n],e[r]),t)&&Ts(fo(e[n],t),e[r])&&Ts(fo(e[r],t),e[n])&&Xc(I0(e[n],e[r],t),e))return[e[n],e[r],t];throw new Error}function Ts(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 O0(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 Xc(e,t){for(var n=0;n<t.length;++n)if(!O0(e,t[n]))return!1;return!0}function SM(e){switch(e.length){case 1:return $M(e[0]);case 2:return fo(e[0],e[1]);case 3:return I0(e[0],e[1],e[2])}}function $M(e){return{x:e.x,y:e.y,r:e.r}}function fo(e,t){var n=e.x,r=e.y,i=e.r,o=t.x,a=t.y,s=t.r,u=o-n,l=a-r,c=s-i,h=Math.sqrt(u*u+l*l);return{x:(n+o+u/h*c)/2,y:(r+a+l/h*c)/2,r:(h+i+s)/2}}function I0(e,t,n){var r=e.x,i=e.y,o=e.r,a=t.x,s=t.y,u=t.r,l=n.x,c=n.y,h=n.r,f=r-a,p=r-l,d=i-s,g=i-c,m=u-o,y=h-o,b=r*r+i*i-o*o,x=b-a*a-s*s+u*u,v=b-l*l-c*c+h*h,_=p*d-f*g,w=(d*v-g*x)/(_*2)-r,P=(g*m-d*y)/_,C=(p*x-f*v)/(_*2)-i,L=(f*y-p*m)/_,E=P*P+L*L-1,N=2*(o+w*P+C*L),A=w*w+C*C-o*o,R=-(Math.abs(E)>1e-6?(N+Math.sqrt(N*N-4*E*A))/(2*E):A/N);return{x:r+w+P*R,y:i+C+L*R,r:R}}function F0(e,t,n){var r=e.x-t.x,i,o,a=e.y-t.y,s,u,l=r*r+a*a;l?(o=t.r+n.r,o*=o,u=e.r+n.r,u*=u,o>u?(i=(l+u-o)/(2*l),s=Math.sqrt(Math.max(0,u/l-i*i)),n.x=e.x-i*r-s*a,n.y=e.y-i*a+s*r):(i=(l+o-u)/(2*l),s=Math.sqrt(Math.max(0,o/l-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 Y0(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 W0(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 As(e){this._=e,this.next=null,this.previous=null}function X0(e,t){if(!(o=(e=yM(e)).length))return 0;var n,r,i,o,a,s,u,l,c,h,f;if(n=e[0],n.x=0,n.y=0,!(o>1))return n.r;if(r=e[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;F0(r,n,i=e[2]),n=new As(n),r=new As(r),i=new As(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;e:for(u=3;u<o;++u){F0(n._,r._,i=e[u]),i=new As(i),l=r.next,c=n.previous,h=r._.r,f=n._.r;do if(h<=f){if(Y0(l._,i._)){r=l,n.next=r,r.previous=n,--u;continue e}h+=l._.r,l=l.next}else{if(Y0(c._,i._)){n=c,n.next=r,r.previous=n,--u;continue e}f+=c._.r,c=c.previous}while(l!==c.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=W0(n);(i=i.next)!==r;)(s=W0(i))<a&&(n=i,a=s);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=z0(n,t),u=0;u<o;++u)n=e[u],n.x-=i.x,n.y-=i.y;return i.r}function wM(e){return X0(e,Wc()),e}function _M(e){return Math.sqrt(e.value)}function TM(){var e=null,t=1,n=1,r=ar;function i(o){const a=Wc();return o.x=t/2,o.y=n/2,e?o.eachBefore(G0(e)).eachAfter(Gc(r,.5,a)).eachBefore(V0(1)):o.eachBefore(G0(_M)).eachAfter(Gc(ar,1,a)).eachAfter(Gc(r,o.r/Math.min(t,n),a)).eachBefore(V0(Math.min(t,n)/(2*o.r))),o}return i.radius=function(o){return arguments.length?(e=_s(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:Jr(+o),i):r},i}function G0(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Gc(e,t,n){return function(r){if(i=r.children){var i,o,a=i.length,s=e(r)*t||0,u;if(s)for(o=0;o<a;++o)i[o].r+=s;if(u=X0(i,n),s)for(o=0;o<a;++o)i[o].r-=s;r.r=u+s}}}function V0(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 j0(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 ho(e,t,n,r,i){for(var o=e.children,a,s=-1,u=o.length,l=e.value&&(r-t)/e.value;++s<u;)a=o[s],a.y0=n,a.y1=i,a.x0=t,a.x1=t+=a.value*l}function AM(){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(j0),a}function o(a,s){return function(u){u.children&&ho(u,u.x0,a*(u.depth+1)/s,u.x1,a*(u.depth+2)/s);var l=u.x0,c=u.y0,h=u.x1-n,f=u.y1-n;h<l&&(l=h=(l+h)/2),f<c&&(c=f=(c+f)/2),u.x0=l,u.y0=c,u.x1=h,u.y1=f}}return i.round=function(a){return arguments.length?(r=!!a,i):r},i.size=function(a){return arguments.length?(e=+a[0],t=+a[1],i):[e,t]},i.padding=function(a){return arguments.length?(n=+a,i):n},i}var DM={depth:-1},U0={},Vc={};function MM(e){return e.id}function PM(e){return e.parentId}function CM(){var e=MM,t=PM,n;function r(i){var o=Array.from(i),a=e,s=t,u,l,c,h,f,p,d,g,m=new Map;if(n!=null){const y=o.map((v,_)=>LM(n(v,_,i))),b=y.map(H0),x=new Set(y).add("");for(const v of b)x.has(v)||(x.add(v),y.push(v),b.push(H0(v)),o.push(Vc));a=(v,_)=>y[_],s=(v,_)=>b[_]}for(c=0,u=o.length;c<u;++c)l=o[c],p=o[c]=new or(l),(d=a(l,c,i))!=null&&(d+="")&&(g=p.id=d,m.set(g,m.has(g)?U0:p)),(d=s(l,c,i))!=null&&(d+="")&&(p.parent=d);for(c=0;c<u;++c)if(p=o[c],d=p.parent){if(f=m.get(d),!f)throw new Error("missing: "+d);if(f===U0)throw new Error("ambiguous: "+d);f.children?f.children.push(p):f.children=[p],p.parent=f}else{if(h)throw new Error("multiple roots");h=p}if(!h)throw new Error("no root");if(n!=null){for(;h.data===Vc&&h.children.length===1;)h=h.children[0],--u;for(let y=o.length-1;y>=0&&(p=o[y],p.data===Vc);--y)p.data=null}if(h.parent=DM,h.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(E0),h.parent=null,u>0)throw new Error("cycle");return h}return r.id=function(i){return arguments.length?(e=_s(i),r):e},r.parentId=function(i){return arguments.length?(t=_s(i),r):t},r.path=function(i){return arguments.length?(n=_s(i),r):n},r}function LM(e){e=`${e}`;let t=e.length;return jc(e,t-1)&&!jc(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function H0(e){let t=e.length;if(t<2)return"";for(;--t>1&&!jc(e,t););return e.slice(0,t)}function jc(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function kM(e,t){return e.parent===t.parent?1:2}function Uc(e){var t=e.children;return t?t[0]:e.t}function Hc(e){var t=e.children;return t?t[t.length-1]:e.t}function RM(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 EM(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 NM(e,t,n){return e.a.parent===t.parent?e.a:n}function Ds(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}Ds.prototype=Object.create(or.prototype);function BM(e){for(var t=new Ds(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 Ds(o[a],a)),i.parent=n;return(t.parent=new Ds(null,0)).children=[t],t}function zM(){var e=kM,t=1,n=1,r=null;function i(l){var c=BM(l);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)l.eachBefore(u);else{var h=l,f=l,p=l;l.eachBefore(function(b){b.x<h.x&&(h=b),b.x>f.x&&(f=b),b.depth>p.depth&&(p=b)});var d=h===f?1:e(h,f)/2,g=d-h.x,m=t/(f.x+d+g),y=n/(p.depth||1);l.eachBefore(function(b){b.x=(b.x+g)*m,b.y=b.depth*y})}return l}function o(l){var c=l.children,h=l.parent.children,f=l.i?h[l.i-1]:null;if(c){EM(l);var p=(c[0].z+c[c.length-1].z)/2;f?(l.z=f.z+e(l._,f._),l.m=l.z-p):l.z=p}else f&&(l.z=f.z+e(l._,f._));l.parent.A=s(l,f,l.parent.A||h[0])}function a(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function s(l,c,h){if(c){for(var f=l,p=l,d=c,g=f.parent.children[0],m=f.m,y=p.m,b=d.m,x=g.m,v;d=Hc(d),f=Uc(f),d&&f;)g=Uc(g),p=Hc(p),p.a=l,v=d.z+b-f.z-m+e(d._,f._),v>0&&(RM(NM(d,l,h),l,v),m+=v,y+=v),b+=d.m,m+=f.m,x+=g.m,y+=p.m;d&&!Hc(p)&&(p.t=d,p.m+=b-y),f&&!Uc(g)&&(g.t=f,g.m+=m-x,h=l)}return h}function u(l){l.x*=t,l.y=l.depth*n}return i.separation=function(l){return arguments.length?(e=l,i):e},i.size=function(l){return arguments.length?(r=!1,t=+l[0],n=+l[1],i):r?null:[t,n]},i.nodeSize=function(l){return arguments.length?(r=!0,t=+l[0],n=+l[1],i):r?[t,n]:null},i}function Ms(e,t,n,r,i){for(var o=e.children,a,s=-1,u=o.length,l=e.value&&(i-n)/e.value;++s<u;)a=o[s],a.x0=t,a.x1=r,a.y0=n,a.y1=n+=a.value*l}var q0=(1+Math.sqrt(5))/2;function Z0(e,t,n,r,i,o){for(var a=[],s=t.children,u,l,c=0,h=0,f=s.length,p,d,g=t.value,m,y,b,x,v,_,w;c<f;){p=i-n,d=o-r;do m=s[h++].value;while(!m&&h<f);for(y=b=m,_=Math.max(d/p,p/d)/(g*e),w=m*m*_,v=Math.max(b/w,w/y);h<f;++h){if(m+=l=s[h].value,l<y&&(y=l),l>b&&(b=l),w=m*m*_,x=Math.max(b/w,w/y),x>v){m-=l;break}v=x}a.push(u={value:m,dice:p<d,children:s.slice(c,h)}),u.dice?ho(u,n,r,i,g?r+=d*m/g:o):Ms(u,n,r,g?n+=p*m/g:i,o),g-=m,c=h}return a}const qc=function e(t){function n(r,i,o,a,s){Z0(t,r,i,o,a,s)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(q0);function J0(){var e=qc,t=!1,n=1,r=1,i=[0],o=ar,a=ar,s=ar,u=ar,l=ar;function c(f){return f.x0=f.y0=0,f.x1=n,f.y1=r,f.eachBefore(h),i=[0],t&&f.eachBefore(j0),f}function h(f){var p=i[f.depth],d=f.x0+p,g=f.y0+p,m=f.x1-p,y=f.y1-p;m<d&&(d=m=(d+m)/2),y<g&&(g=y=(g+y)/2),f.x0=d,f.y0=g,f.x1=m,f.y1=y,f.children&&(p=i[f.depth+1]=o(f)/2,d+=l(f)-p,g+=a(f)-p,m-=s(f)-p,y-=u(f)-p,m<d&&(d=m=(d+m)/2),y<g&&(g=y=(g+y)/2),e(f,d,g,m,y))}return c.round=function(f){return arguments.length?(t=!!f,c):t},c.size=function(f){return arguments.length?(n=+f[0],r=+f[1],c):[n,r]},c.tile=function(f){return arguments.length?(e=N0(f),c):e},c.padding=function(f){return arguments.length?c.paddingInner(f).paddingOuter(f):c.paddingInner()},c.paddingInner=function(f){return arguments.length?(o=typeof f=="function"?f:Jr(+f),c):o},c.paddingOuter=function(f){return arguments.length?c.paddingTop(f).paddingRight(f).paddingBottom(f).paddingLeft(f):c.paddingTop()},c.paddingTop=function(f){return arguments.length?(a=typeof f=="function"?f:Jr(+f),c):a},c.paddingRight=function(f){return arguments.length?(s=typeof f=="function"?f:Jr(+f),c):s},c.paddingBottom=function(f){return arguments.length?(u=typeof f=="function"?f:Jr(+f),c):u},c.paddingLeft=function(f){return arguments.length?(l=typeof f=="function"?f:Jr(+f),c):l},c}function OM(e,t,n,r,i){var o=e.children,a,s=o.length,u,l=new Array(s+1);for(l[0]=u=a=0;a<s;++a)l[a+1]=u+=o[a].value;c(0,s,e.value,t,n,r,i);function c(h,f,p,d,g,m,y){if(h>=f-1){var b=o[h];b.x0=d,b.y0=g,b.x1=m,b.y1=y;return}for(var x=l[h],v=p/2+x,_=h+1,w=f-1;_<w;){var P=_+w>>>1;l[P]<v?_=P+1:w=P}v-l[_-1]<l[_]-v&&h+1<_&&--_;var C=l[_]-x,L=p-C;if(m-d>y-g){var E=p?(d*L+m*C)/p:m;c(h,_,C,d,g,E,y),c(_,f,L,E,g,m,y)}else{var N=p?(g*L+y*C)/p:y;c(h,_,C,d,g,m,N),c(_,f,L,d,N,m,y)}}}function IM(e,t,n,r,i){(e.depth&1?Ms:ho)(e,t,n,r,i)}const FM=function e(t){function n(r,i,o,a,s){if((u=r._squarify)&&u.ratio===t)for(var u,l,c,h,f=-1,p,d=u.length,g=r.value;++f<d;){for(l=u[f],c=l.children,h=l.value=0,p=c.length;h<p;++h)l.value+=c[h].value;l.dice?ho(l,i,o,a,g?o+=(s-o)*l.value/g:s):Ms(l,i,o,g?i+=(a-i)*l.value/g:a,s),g-=l.value}else r._squarify=u=Z0(t,r,i,o,a,s),u.ratio=t}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(q0);function YM(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 WM(e){for(var t=-1,n=e.length,r=0,i=0,o,a=e[n-1],s,u=0;++t<n;)o=a,a=e[t],u+=s=o[0]*a[1]-a[0]*o[1],r+=(o[0]+a[0])*s,i+=(o[1]+a[1])*s;return u*=3,[r/u,i/u]}function XM(e,t,n){return(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])}function GM(e,t){return e[0]-t[0]||e[1]-t[1]}function K0(e){const t=e.length,n=[0,1];let r=2,i;for(i=2;i<t;++i){for(;r>1&&XM(e[n[r-2]],e[n[r-1]],e[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function VM(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(GM),t=0;t<n;++t)i[t]=[r[t][0],-r[t][1]];var o=K0(r),a=K0(i),s=a[0]===o[0],u=a[a.length-1]===o[o.length-1],l=[];for(t=o.length-1;t>=0;--t)l.push(e[r[o[t]][2]]);for(t=+s;t<a.length-u;++t)l.push(e[r[a[t]][2]]);return l}function jM(e,t){for(var n=e.length,r=e[n-1],i=t[0],o=t[1],a=r[0],s=r[1],u,l,c=!1,h=0;h<n;++h)r=e[h],u=r[0],l=r[1],l>o!=s>o&&i<(a-u)*(o-l)/(s-l)+u&&(c=!c),a=u,s=l;return c}function UM(e){for(var t=-1,n=e.length,r=e[n-1],i,o,a=r[0],s=r[1],u=0;++t<n;)i=a,o=s,r=e[t],a=r[0],s=r[1],i-=a,o-=s,u+=Math.hypot(i,o);return u}const Xe=Math.random,HM=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}(Xe),qM=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}(Xe),Zc=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}(Xe),ZM=function e(t){var n=Zc.source(t);function r(){var i=n.apply(this,arguments);return function(){return Math.exp(i())}}return r.source=e,r}(Xe),Q0=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}(Xe),JM=function e(t){var n=Q0.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}(Xe),KM=function e(t){function n(r){return function(){return-Math.log1p(-t())/r}}return n.source=e,n}(Xe),QM=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}(Xe),e3=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}(Xe),em=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}(Xe),Jc=function e(t){var n=Zc.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)),u=i<1?()=>Math.pow(t(),1/i):()=>1;return function(){do{do var l=n(),c=1+s*l;while(c<=0);c*=c*c;var h=1-t()}while(h>=1-.0331*l*l*l*l&&Math.log(h)>=.5*l*l+a*(1-c+Math.log(c)));return a*c*u()*o}}return r.source=e,r}(Xe),tm=function e(t){var n=Jc.source(t);function r(i,o){var a=n(i),s=n(o);return function(){var u=a();return u===0?0:u/(u+s())}}return r.source=e,r}(Xe),nm=function e(t){var n=em.source(t),r=tm.source(t);function i(o,a){return o=+o,(a=+a)>=1?()=>o:a<=0?()=>0:function(){for(var s=0,u=o,l=a;u*l>16&&u*(1-l)>16;){var c=Math.floor((u+1)*l),h=r(c,u-c+1)();h<=l?(s+=c,u-=c,l=(l-h)/(1-h)):(u=c-1,l/=h)}for(var f=l<.5,p=f?l:1-l,d=n(p),g=d(),m=0;g<=u;++m)g+=d();return s+(f?m:u-m)}}return i.source=e,i}(Xe),t3=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}(Xe),n3=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}(Xe),r3=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}(Xe),i3=function e(t){var n=Jc.source(t),r=nm.source(t);function i(o){return function(){for(var a=0,s=o;s>16;){var u=Math.floor(.875*s),l=n(u)();if(l>s)return a+r(u-1,s/l)();a+=u,s-=l}for(var c=-Math.log1p(-t()),h=0;c<=s;++h)c-=Math.log1p(-t());return a+h}}return i.source=e,i}(Xe),o3=1664525,a3=1013904223,rm=1/4294967296;function s3(e=Math.random()){let t=(0<=e&&e<1?e/rm:Math.abs(e))|0;return()=>(t=o3*t+a3|0,rm*(t>>>0))}function $t(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function nn(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 Kc=Symbol("implicit");function Qc(){var e=new bi,t=[],n=[],r=Kc;function i(o){let a=e.get(o);if(a===void 0){if(r!==Kc)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 bi;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 Qc(t,n).unknown(r)},$t.apply(i,arguments),i}function ef(){var e=Qc().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,a,s=!1,u=0,l=0,c=.5;delete e.unknown;function h(){var f=t().length,p=i<r,d=p?i:r,g=p?r:i;o=(g-d)/Math.max(1,f-u+l*2),s&&(o=Math.floor(o)),d+=(g-d-o*(f-u))*c,a=o*(1-u),s&&(d=Math.round(d),a=Math.round(a));var m=mn(f).map(function(y){return d+o*y});return n(p?m.reverse():m)}return e.domain=function(f){return arguments.length?(t(f),h()):t()},e.range=function(f){return arguments.length?([r,i]=f,r=+r,i=+i,h()):[r,i]},e.rangeRound=function(f){return[r,i]=f,r=+r,i=+i,s=!0,h()},e.bandwidth=function(){return a},e.step=function(){return o},e.round=function(f){return arguments.length?(s=!!f,h()):s},e.padding=function(f){return arguments.length?(u=Math.min(1,l=+f),h()):u},e.paddingInner=function(f){return arguments.length?(u=Math.min(1,f),h()):u},e.paddingOuter=function(f){return arguments.length?(l=+f,h()):l},e.align=function(f){return arguments.length?(c=Math.max(0,Math.min(1,f)),h()):c},e.copy=function(){return ef(t(),[r,i]).round(s).paddingInner(u).paddingOuter(l).align(c)},$t.apply(h(),arguments)}function im(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return im(t())},e}function tf(){return im(ef.apply(null,arguments).paddingInner(1))}function l3(e){return function(){return e}}function Ps(e){return+e}var om=[0,1];function st(e){return e}function nf(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:l3(isNaN(t)?NaN:.5)}function u3(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function c3(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=nf(i,r),o=n(a,o)):(r=nf(r,i),o=n(o,a)),function(s){return o(r(s))}}function f3(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]=nf(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(s){var u=gn(e,s,1,r)-1;return o[u](i[u](s))}}function po(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Cs(){var e=om,t=om,n=Ht,r,i,o,a=st,s,u,l;function c(){var f=Math.min(e.length,t.length);return a!==st&&(a=u3(e[0],e[f-1])),s=f>2?f3:c3,u=l=null,h}function h(f){return f==null||isNaN(f=+f)?o:(u||(u=s(e.map(r),t,n)))(r(a(f)))}return h.invert=function(f){return a(i((l||(l=s(t,e.map(r),xt)))(f)))},h.domain=function(f){return arguments.length?(e=Array.from(f,Ps),c()):e.slice()},h.range=function(f){return arguments.length?(t=Array.from(f),c()):t.slice()},h.rangeRound=function(f){return t=Array.from(f),n=ma,c()},h.clamp=function(f){return arguments.length?(a=f?!0:st,c()):a!==st},h.interpolate=function(f){return arguments.length?(n=f,c()):n},h.unknown=function(f){return arguments.length?(o=f,h):o},function(f,p){return r=f,i=p,c()}}function rf(){return Cs()(st,st)}function am(e,t,n,r){var i=Uo(e,t,n),o;switch(r=Xr(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=yg(i,a))&&(r.precision=o),qu(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=bg(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=mg(i))&&(r.precision=o-(r.type==="%")*2);break}}return Gi(r)}function wn(e){var t=e.domain;return e.ticks=function(n){var r=t();return On(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return am(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],u,l,c=10;for(s<a&&(l=a,a=s,s=l,l=i,i=o,o=l);c-- >0;){if(l=In(a,s,n),l===u)return r[i]=a,r[o]=s,t(r);if(l>0)a=Math.floor(a/l)*l,s=Math.ceil(s/l)*l;else if(l<0)a=Math.ceil(a*l)/l,s=Math.floor(s*l)/l;else break;u=l}return e},e}function Et(){var e=rf();return e.copy=function(){return po(e,Et())},$t.apply(e,arguments),wn(e)}function sm(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,Ps),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return sm(e).unknown(t)},e=arguments.length?Array.from(e,Ps):[0,1],wn(n)}function lm(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 um(e){return Math.log(e)}function cm(e){return Math.exp(e)}function h3(e){return-Math.log(-e)}function p3(e){return-Math.exp(-e)}function d3(e){return isFinite(e)?+("1e"+e):e<0?0:e}function g3(e){return e===10?d3:e===Math.E?Math.exp:t=>Math.pow(e,t)}function m3(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 fm(e){return(t,n)=>-e(-t,n)}function of(e){const t=e(um,cm),n=t.domain;let r=10,i,o;function a(){return i=m3(r),o=g3(r),n()[0]<0?(i=fm(i),o=fm(o),e(h3,p3)):e(um,cm),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 u=n();let l=u[0],c=u[u.length-1];const h=c<l;h&&([l,c]=[c,l]);let f=i(l),p=i(c),d,g;const m=s==null?10:+s;let y=[];if(!(r%1)&&p-f<m){if(f=Math.floor(f),p=Math.ceil(p),l>0){for(;f<=p;++f)for(d=1;d<r;++d)if(g=f<0?d/o(-f):d*o(f),!(g<l)){if(g>c)break;y.push(g)}}else for(;f<=p;++f)for(d=r-1;d>=1;--d)if(g=f>0?d/o(-f):d*o(f),!(g<l)){if(g>c)break;y.push(g)}y.length*2<m&&(y=On(l,c,m))}else y=On(f,p,Math.min(p-f,m)).map(o);return h?y.reverse():y},t.tickFormat=(s,u)=>{if(s==null&&(s=10),u==null&&(u=r===10?"s":","),typeof u!="function"&&(!(r%1)&&(u=Xr(u)).precision==null&&(u.trim=!0),u=Gi(u)),s===1/0)return u;const l=Math.max(1,r*s/t.ticks().length);return c=>{let h=c/o(Math.round(i(c)));return h*r<r-.5&&(h*=r),h<=l?u(c):""}},t.nice=()=>n(lm(n(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),t}function hm(){const e=of(Cs()).domain([1,10]);return e.copy=()=>po(e,hm()).base(e.base()),$t.apply(e,arguments),e}function pm(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function dm(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function af(e){var t=1,n=e(pm(t),dm(t));return n.constant=function(r){return arguments.length?e(pm(t=+r),dm(t)):t},wn(n)}function gm(){var e=af(Cs());return e.copy=function(){return po(e,gm()).constant(e.constant())},$t.apply(e,arguments)}function mm(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function y3(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function b3(e){return e<0?-e*e:e*e}function sf(e){var t=e(st,st),n=1;function r(){return n===1?e(st,st):n===.5?e(y3,b3):e(mm(n),mm(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},wn(t)}function _n(){var e=sf(Cs());return e.copy=function(){return po(e,_n()).exponent(e.exponent())},$t.apply(e,arguments),e}function x3(){return _n.apply(null,arguments).exponent(.5)}function ym(e){return Math.sign(e)*e*e}function v3(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function bm(){var e=rf(),t=[0,1],n=!1,r;function i(o){var a=v3(e(o));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(o){return e.invert(ym(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,Ps)).map(ym)),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 bm(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},$t.apply(i,arguments),wn(i)}function xm(){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]=tp(e,a/s);return o}function o(a){return a==null||isNaN(a=+a)?r:t[gn(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(Ae),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 xm().domain(e).range(t).unknown(r)},$t.apply(o,arguments)}function lf(){var e=0,t=1,n=1,r=[.5],i=[0,1],o;function a(u){return u!=null&&u<=u?i[gn(r,u,0,n)]:o}function s(){var u=-1;for(r=new Array(n);++u<n;)r[u]=((u+1)*t-(u-n)*e)/(n+1);return a}return a.domain=function(u){return arguments.length?([e,t]=u,e=+e,t=+t,s()):[e,t]},a.range=function(u){return arguments.length?(n=(i=Array.from(u)).length-1,s()):i.slice()},a.invertExtent=function(u){var l=i.indexOf(u);return l<0?[NaN,NaN]:l<1?[e,r[0]]:l>=n?[r[n-1],t]:[r[l-1],r[l]]},a.unknown=function(u){return arguments.length&&(o=u),a},a.thresholds=function(){return r.slice()},a.copy=function(){return lf().domain([e,t]).range(i).unknown(o)},$t.apply(wn(a),arguments)}function vm(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[gn(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 vm().domain(e).range(t).unknown(n)},$t.apply(i,arguments)}const uf=new Date,cf=new Date;function ke(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 u=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o<a)||!(s>0))return u;let l;do u.push(l=new Date(+o)),t(o,s),e(o);while(l<o&&o<a);return u},i.filter=o=>ke(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)=>(uf.setTime(+o),cf.setTime(+a),e(uf),e(cf),Math.floor(n(uf,cf))),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 Kr=ke(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Kr.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ke(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Kr);const Sm=Kr.range,rn=1e3,wt=rn*60,on=wt*60,an=on*24,ff=an*7,$m=an*30,hf=an*365,sn=ke(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*rn)},(e,t)=>(t-e)/rn,e=>e.getUTCSeconds()),wm=sn.range,Ls=ke(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*rn)},(e,t)=>{e.setTime(+e+t*wt)},(e,t)=>(t-e)/wt,e=>e.getMinutes()),S3=Ls.range,ks=ke(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*wt)},(e,t)=>(t-e)/wt,e=>e.getUTCMinutes()),$3=ks.range,Rs=ke(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*rn-e.getMinutes()*wt)},(e,t)=>{e.setTime(+e+t*on)},(e,t)=>(t-e)/on,e=>e.getHours()),w3=Rs.range,Es=ke(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*on)},(e,t)=>(t-e)/on,e=>e.getUTCHours()),_3=Es.range,Qr=ke(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*wt)/an,e=>e.getDate()-1),T3=Qr.range,go=ke(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/an,e=>e.getUTCDate()-1),A3=go.range,pf=ke(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/an,e=>Math.floor(e/an)),D3=pf.range;function sr(e){return ke(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)/ff)}const ei=sr(0),mo=sr(1),_m=sr(2),Tm=sr(3),lr=sr(4),Am=sr(5),Dm=sr(6),Mm=ei.range,M3=mo.range,P3=_m.range,C3=Tm.range,L3=lr.range,k3=Am.range,R3=Dm.range;function ur(e){return ke(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)/ff)}const ti=ur(0),yo=ur(1),Pm=ur(2),Cm=ur(3),cr=ur(4),Lm=ur(5),km=ur(6),Rm=ti.range,E3=yo.range,N3=Pm.range,B3=Cm.range,z3=cr.range,O3=Lm.range,I3=km.range,Ns=ke(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()),F3=Ns.range,Bs=ke(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()),Y3=Bs.range,Gt=ke(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());Gt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ke(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 W3=Gt.range,Vt=ke(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());Vt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ke(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 X3=Vt.range;function Em(e,t,n,r,i,o){const a=[[sn,1,rn],[sn,5,5*rn],[sn,15,15*rn],[sn,30,30*rn],[o,1,wt],[o,5,5*wt],[o,15,15*wt],[o,30,30*wt],[i,1,on],[i,3,3*on],[i,6,6*on],[i,12,12*on],[r,1,an],[r,2,2*an],[n,1,ff],[t,1,$m],[t,3,3*$m],[e,1,hf]];function s(l,c,h){const f=c<l;f&&([l,c]=[c,l]);const p=h&&typeof h.range=="function"?h:u(l,c,h),d=p?p.range(l,+c+1):[];return f?d.reverse():d}function u(l,c,h){const f=Math.abs(c-l)/h,p=Xo(([,,m])=>m).right(a,f);if(p===a.length)return e.every(Uo(l/hf,c/hf,h));if(p===0)return Kr.every(Math.max(Uo(l,c,h),1));const[d,g]=a[f/a[p-1][2]<a[p][2]/f?p-1:p];return d.every(g)}return[s,u]}const[Nm,Bm]=Em(Vt,Bs,ti,pf,Es,ks),[zm,Om]=Em(Gt,Ns,ei,Qr,Rs,Ls);function df(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 gf(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 bo(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Im(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,u=e.shortMonths,l=xo(i),c=vo(i),h=xo(o),f=vo(o),p=xo(a),d=vo(a),g=xo(s),m=vo(s),y=xo(u),b=vo(u),x={a:B,A:D,b:z,B:F,c:null,d:Vm,e:Vm,f:hP,g:$P,G:_P,H:uP,I:cP,j:fP,L:jm,m:pP,M:dP,p:j,q:K,Q:Km,s:Qm,S:gP,u:mP,U:yP,V:bP,w:xP,W:vP,x:null,X:null,y:SP,Y:wP,Z:TP,"%":Jm},v={a:se,A:te,b:Y,B:J,c:null,d:Hm,e:Hm,f:PP,g:IP,G:YP,H:AP,I:DP,j:MP,L:qm,m:CP,M:LP,p:ie,q:ue,Q:Km,s:Qm,S:kP,u:RP,U:EP,V:NP,w:BP,W:zP,x:null,X:null,y:OP,Y:FP,Z:WP,"%":Jm},_={a:E,A:N,b:A,B:R,c:S,d:Xm,e:Xm,f:oP,g:Wm,G:Ym,H:Gm,I:Gm,j:tP,L:iP,m:eP,M:nP,p:L,q:Q3,Q:sP,s:lP,S:rP,u:H3,U:q3,V:Z3,w:U3,W:J3,x:M,X:$,y:Wm,Y:Ym,Z:K3,"%":aP};x.x=w(n,x),x.X=w(r,x),x.c=w(t,x),v.x=w(n,v),v.X=w(r,v),v.c=w(t,v);function w(q,re){return function(ce){var V=[],ve=-1,be=0,Ye=q.length,We,fe,Le;for(ce instanceof Date||(ce=new Date(+ce));++ve<Ye;)q.charCodeAt(ve)===37&&(V.push(q.slice(be,ve)),(fe=Fm[We=q.charAt(++ve)])!=null?We=q.charAt(++ve):fe=We==="e"?" ":"0",(Le=re[We])&&(We=Le(ce,fe)),V.push(We),be=ve+1);return V.push(q.slice(be,ve)),V.join("")}}function P(q,re){return function(ce){var V=bo(1900,void 0,1),ve=C(V,q,ce+="",0),be,Ye;if(ve!=ce.length)return null;if("Q"in V)return new Date(V.Q);if("s"in V)return new Date(V.s*1e3+("L"in V?V.L:0));if(re&&!("Z"in V)&&(V.Z=0),"p"in V&&(V.H=V.H%12+V.p*12),V.m===void 0&&(V.m="q"in V?V.q:0),"V"in V){if(V.V<1||V.V>53)return null;"w"in V||(V.w=1),"Z"in V?(be=gf(bo(V.y,0,1)),Ye=be.getUTCDay(),be=Ye>4||Ye===0?yo.ceil(be):yo(be),be=go.offset(be,(V.V-1)*7),V.y=be.getUTCFullYear(),V.m=be.getUTCMonth(),V.d=be.getUTCDate()+(V.w+6)%7):(be=df(bo(V.y,0,1)),Ye=be.getDay(),be=Ye>4||Ye===0?mo.ceil(be):mo(be),be=Qr.offset(be,(V.V-1)*7),V.y=be.getFullYear(),V.m=be.getMonth(),V.d=be.getDate()+(V.w+6)%7)}else("W"in V||"U"in V)&&("w"in V||(V.w="u"in V?V.u%7:"W"in V?1:0),Ye="Z"in V?gf(bo(V.y,0,1)).getUTCDay():df(bo(V.y,0,1)).getDay(),V.m=0,V.d="W"in V?(V.w+6)%7+V.W*7-(Ye+5)%7:V.w+V.U*7-(Ye+6)%7);return"Z"in V?(V.H+=V.Z/100|0,V.M+=V.Z%100,gf(V)):df(V)}}function C(q,re,ce,V){for(var ve=0,be=re.length,Ye=ce.length,We,fe;ve<be;){if(V>=Ye)return-1;if(We=re.charCodeAt(ve++),We===37){if(We=re.charAt(ve++),fe=_[We in Fm?re.charAt(ve++):We],!fe||(V=fe(q,ce,V))<0)return-1}else if(We!=ce.charCodeAt(V++))return-1}return V}function L(q,re,ce){var V=l.exec(re.slice(ce));return V?(q.p=c.get(V[0].toLowerCase()),ce+V[0].length):-1}function E(q,re,ce){var V=p.exec(re.slice(ce));return V?(q.w=d.get(V[0].toLowerCase()),ce+V[0].length):-1}function N(q,re,ce){var V=h.exec(re.slice(ce));return V?(q.w=f.get(V[0].toLowerCase()),ce+V[0].length):-1}function A(q,re,ce){var V=y.exec(re.slice(ce));return V?(q.m=b.get(V[0].toLowerCase()),ce+V[0].length):-1}function R(q,re,ce){var V=g.exec(re.slice(ce));return V?(q.m=m.get(V[0].toLowerCase()),ce+V[0].length):-1}function S(q,re,ce){return C(q,t,re,ce)}function M(q,re,ce){return C(q,n,re,ce)}function $(q,re,ce){return C(q,r,re,ce)}function B(q){return a[q.getDay()]}function D(q){return o[q.getDay()]}function z(q){return u[q.getMonth()]}function F(q){return s[q.getMonth()]}function j(q){return i[+(q.getHours()>=12)]}function K(q){return 1+~~(q.getMonth()/3)}function se(q){return a[q.getUTCDay()]}function te(q){return o[q.getUTCDay()]}function Y(q){return u[q.getUTCMonth()]}function J(q){return s[q.getUTCMonth()]}function ie(q){return i[+(q.getUTCHours()>=12)]}function ue(q){return 1+~~(q.getUTCMonth()/3)}return{format:function(q){var re=w(q+="",x);return re.toString=function(){return q},re},parse:function(q){var re=P(q+="",!1);return re.toString=function(){return q},re},utcFormat:function(q){var re=w(q+="",v);return re.toString=function(){return q},re},utcParse:function(q){var re=P(q+="",!0);return re.toString=function(){return q},re}}}var Fm={"-":"",_:" ",0:"0"},Oe=/^\s*\d+/,G3=/^%/,V3=/[\\^$*+?|[\]().{}]/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 j3(e){return e.replace(V3,"\\$&")}function xo(e){return new RegExp("^(?:"+e.map(j3).join("|")+")","i")}function vo(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function U3(e,t,n){var r=Oe.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function H3(e,t,n){var r=Oe.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function q3(e,t,n){var r=Oe.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Z3(e,t,n){var r=Oe.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function J3(e,t,n){var r=Oe.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Ym(e,t,n){var r=Oe.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Wm(e,t,n){var r=Oe.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function K3(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 Q3(e,t,n){var r=Oe.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function eP(e,t,n){var r=Oe.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Xm(e,t,n){var r=Oe.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function tP(e,t,n){var r=Oe.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Gm(e,t,n){var r=Oe.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function nP(e,t,n){var r=Oe.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function rP(e,t,n){var r=Oe.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function iP(e,t,n){var r=Oe.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function oP(e,t,n){var r=Oe.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function aP(e,t,n){var r=G3.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function sP(e,t,n){var r=Oe.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function lP(e,t,n){var r=Oe.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Vm(e,t){return ye(e.getDate(),t,2)}function uP(e,t){return ye(e.getHours(),t,2)}function cP(e,t){return ye(e.getHours()%12||12,t,2)}function fP(e,t){return ye(1+Qr.count(Gt(e),e),t,3)}function jm(e,t){return ye(e.getMilliseconds(),t,3)}function hP(e,t){return jm(e,t)+"000"}function pP(e,t){return ye(e.getMonth()+1,t,2)}function dP(e,t){return ye(e.getMinutes(),t,2)}function gP(e,t){return ye(e.getSeconds(),t,2)}function mP(e){var t=e.getDay();return t===0?7:t}function yP(e,t){return ye(ei.count(Gt(e)-1,e),t,2)}function Um(e){var t=e.getDay();return t>=4||t===0?lr(e):lr.ceil(e)}function bP(e,t){return e=Um(e),ye(lr.count(Gt(e),e)+(Gt(e).getDay()===4),t,2)}function xP(e){return e.getDay()}function vP(e,t){return ye(mo.count(Gt(e)-1,e),t,2)}function SP(e,t){return ye(e.getFullYear()%100,t,2)}function $P(e,t){return e=Um(e),ye(e.getFullYear()%100,t,2)}function wP(e,t){return ye(e.getFullYear()%1e4,t,4)}function _P(e,t){var n=e.getDay();return e=n>=4||n===0?lr(e):lr.ceil(e),ye(e.getFullYear()%1e4,t,4)}function TP(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ye(t/60|0,"0",2)+ye(t%60,"0",2)}function Hm(e,t){return ye(e.getUTCDate(),t,2)}function AP(e,t){return ye(e.getUTCHours(),t,2)}function DP(e,t){return ye(e.getUTCHours()%12||12,t,2)}function MP(e,t){return ye(1+go.count(Vt(e),e),t,3)}function qm(e,t){return ye(e.getUTCMilliseconds(),t,3)}function PP(e,t){return qm(e,t)+"000"}function CP(e,t){return ye(e.getUTCMonth()+1,t,2)}function LP(e,t){return ye(e.getUTCMinutes(),t,2)}function kP(e,t){return ye(e.getUTCSeconds(),t,2)}function RP(e){var t=e.getUTCDay();return t===0?7:t}function EP(e,t){return ye(ti.count(Vt(e)-1,e),t,2)}function Zm(e){var t=e.getUTCDay();return t>=4||t===0?cr(e):cr.ceil(e)}function NP(e,t){return e=Zm(e),ye(cr.count(Vt(e),e)+(Vt(e).getUTCDay()===4),t,2)}function BP(e){return e.getUTCDay()}function zP(e,t){return ye(yo.count(Vt(e)-1,e),t,2)}function OP(e,t){return ye(e.getUTCFullYear()%100,t,2)}function IP(e,t){return e=Zm(e),ye(e.getUTCFullYear()%100,t,2)}function FP(e,t){return ye(e.getUTCFullYear()%1e4,t,4)}function YP(e,t){var n=e.getUTCDay();return e=n>=4||n===0?cr(e):cr.ceil(e),ye(e.getUTCFullYear()%1e4,t,4)}function WP(){return"+0000"}function Jm(){return"%"}function Km(e){return+e}function Qm(e){return Math.floor(+e/1e3)}var ni,mf,ey,zs,yf;ty({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 ty(e){return ni=Im(e),mf=ni.format,ey=ni.parse,zs=ni.utcFormat,yf=ni.utcParse,ni}var ny="%Y-%m-%dT%H:%M:%S.%LZ";function XP(e){return e.toISOString()}var GP=Date.prototype.toISOString?XP:zs(ny);function VP(e){var t=new Date(e);return isNaN(t)?null:t}var jP=+new Date("2000-01-01T00:00:00.000Z")?VP:yf(ny);function UP(e){return new Date(e)}function HP(e){return e instanceof Date?+e:+new Date(+e)}function bf(e,t,n,r,i,o,a,s,u,l){var c=rf(),h=c.invert,f=c.domain,p=l(".%L"),d=l(":%S"),g=l("%I:%M"),m=l("%I %p"),y=l("%a %d"),b=l("%b %d"),x=l("%B"),v=l("%Y");function _(w){return(u(w)<w?p:s(w)<w?d:a(w)<w?g:o(w)<w?m:r(w)<w?i(w)<w?y:b:n(w)<w?x:v)(w)}return c.invert=function(w){return new Date(h(w))},c.domain=function(w){return arguments.length?f(Array.from(w,HP)):f().map(UP)},c.ticks=function(w){var P=f();return e(P[0],P[P.length-1],w??10)},c.tickFormat=function(w,P){return P==null?_:l(P)},c.nice=function(w){var P=f();return(!w||typeof w.range!="function")&&(w=t(P[0],P[P.length-1],w??10)),w?f(lm(P,w)):c},c.copy=function(){return po(c,bf(e,t,n,r,i,o,a,s,u,l))},c}function qP(){return $t.apply(bf(zm,Om,Gt,Ns,ei,Qr,Rs,Ls,sn,mf).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function ZP(){return $t.apply(bf(Nm,Bm,Vt,Bs,ti,go,Es,ks,sn,zs).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Os(){var e=0,t=1,n,r,i,o,a=st,s=!1,u;function l(h){return h==null||isNaN(h=+h)?u:a(i===0?.5:(h=(o(h)-n)*i,s?Math.max(0,Math.min(1,h)):h))}l.domain=function(h){return arguments.length?([e,t]=h,n=o(e=+e),r=o(t=+t),i=n===r?0:1/(r-n),l):[e,t]},l.clamp=function(h){return arguments.length?(s=!!h,l):s},l.interpolator=function(h){return arguments.length?(a=h,l):a};function c(h){return function(f){var p,d;return arguments.length?([p,d]=f,a=h(p,d),l):[a(0),a(1)]}}return l.range=c(Ht),l.rangeRound=c(ma),l.unknown=function(h){return arguments.length?(u=h,l):u},function(h){return o=h,n=h(e),r=h(t),i=n===r?0:1/(r-n),l}}function Tn(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function ry(){var e=wn(Os()(st));return e.copy=function(){return Tn(e,ry())},nn.apply(e,arguments)}function iy(){var e=of(Os()).domain([1,10]);return e.copy=function(){return Tn(e,iy()).base(e.base())},nn.apply(e,arguments)}function oy(){var e=af(Os());return e.copy=function(){return Tn(e,oy()).constant(e.constant())},nn.apply(e,arguments)}function xf(){var e=sf(Os());return e.copy=function(){return Tn(e,xf()).exponent(e.exponent())},nn.apply(e,arguments)}function JP(){return xf.apply(null,arguments).exponent(.5)}function ay(){var e=[],t=st;function n(r){if(r!=null&&!isNaN(r=+r))return t((gn(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(Ae),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)=>Si(e,o/r))},n.copy=function(){return ay(t).domain(e)},nn.apply(n,arguments)}function Is(){var e=0,t=.5,n=1,r=1,i,o,a,s,u,l=st,c,h=!1,f;function p(g){return isNaN(g=+g)?f:(g=.5+((g=+c(g))-o)*(r*g<r*o?s:u),l(h?Math.max(0,Math.min(1,g)):g))}p.domain=function(g){return arguments.length?([e,t,n]=g,i=c(e=+e),o=c(t=+t),a=c(n=+n),s=i===o?0:.5/(o-i),u=o===a?0:.5/(a-o),r=o<i?-1:1,p):[e,t,n]},p.clamp=function(g){return arguments.length?(h=!!g,p):h},p.interpolator=function(g){return arguments.length?(l=g,p):l};function d(g){return function(m){var y,b,x;return arguments.length?([y,b,x]=m,l=fd(g,[y,b,x]),p):[l(0),l(.5),l(1)]}}return p.range=d(Ht),p.rangeRound=d(ma),p.unknown=function(g){return arguments.length?(f=g,p):f},function(g){return c=g,i=g(e),o=g(t),a=g(n),s=i===o?0:.5/(o-i),u=o===a?0:.5/(a-o),r=o<i?-1:1,p}}function sy(){var e=wn(Is()(st));return e.copy=function(){return Tn(e,sy())},nn.apply(e,arguments)}function ly(){var e=of(Is()).domain([.1,1,10]);return e.copy=function(){return Tn(e,ly()).base(e.base())},nn.apply(e,arguments)}function uy(){var e=af(Is());return e.copy=function(){return Tn(e,uy()).constant(e.constant())},nn.apply(e,arguments)}function vf(){var e=sf(Is());return e.copy=function(){return Tn(e,vf()).exponent(e.exponent())},nn.apply(e,arguments)}function KP(){return vf.apply(null,arguments).exponent(.5)}function pe(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 QP=pe("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),e5=pe("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),t5=pe("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),n5=pe("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),r5=pe("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),i5=pe("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),o5=pe("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),a5=pe("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),s5=pe("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),l5=pe("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),u5=pe("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab"),we=e=>Zp(e[e.length-1]);var cy=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(pe);const c5=we(cy);var fy=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(pe);const f5=we(fy);var hy=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(pe);const h5=we(hy);var py=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(pe);const p5=we(py);var dy=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(pe);const d5=we(dy);var gy=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(pe);const g5=we(gy);var my=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(pe);const m5=we(my);var yy=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(pe);const y5=we(yy);var by=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(pe);const b5=we(by);var xy=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(pe);const x5=we(xy);var vy=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(pe);const v5=we(vy);var Sy=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(pe);const S5=we(Sy);var $y=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(pe);const $5=we($y);var wy=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(pe);const w5=we(wy);var _y=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(pe);const _5=we(_y);var Ty=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(pe);const T5=we(Ty);var Ay=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(pe);const A5=we(Ay);var Dy=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(pe);const D5=we(Dy);var My=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(pe);const M5=we(My);var Py=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(pe);const P5=we(Py);var Cy=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(pe);const C5=we(Cy);var Ly=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(pe);const L5=we(Ly);var ky=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(pe);const k5=we(ky);var Ry=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(pe);const R5=we(Ry);var Ey=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(pe);const E5=we(Ey);var Ny=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(pe);const N5=we(Ny);var By=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(pe);const B5=we(By);function z5(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 O5=ba(Ct(300,.5,0),Ct(-240,.5,1));var I5=ba(Ct(-100,.75,.35),Ct(80,1.5,.8)),F5=ba(Ct(260,.75,.35),Ct(80,1.5,.8)),Fs=Ct();function Y5(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return Fs.h=360*e-100,Fs.s=1.5-1.5*t,Fs.l=.8-.9*t,Fs+""}var Ys=Lr(),W5=Math.PI/3,X5=Math.PI*2/3;function G5(e){var t;return e=(.5-e)*Math.PI,Ys.r=255*(t=Math.sin(e))*t,Ys.g=255*(t=Math.sin(e+W5))*t,Ys.b=255*(t=Math.sin(e+X5))*t,Ys+""}function V5(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 Ws(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const j5=Ws(pe("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var U5=Ws(pe("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),H5=Ws(pe("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),q5=Ws(pe("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function he(e){return function(){return e}}const zy=Math.abs,qe=Math.atan2,ln=Math.cos,Z5=Math.max,ri=Math.min,ft=Math.sin,_e=Math.sqrt,Ze=1e-12,An=Math.PI,Xs=An/2,Dn=2*An;function J5(e){return e>1?0:e<-1?An:Math.acos(e)}function Oy(e){return e>=1?Xs:e<=-1?-Xs:Math.asin(e)}function So(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 Fi(t)}function K5(e){return e.innerRadius}function Q5(e){return e.outerRadius}function e6(e){return e.startAngle}function t6(e){return e.endAngle}function n6(e){return e&&e.padAngle}function r6(e,t,n,r,i,o,a,s){var u=n-e,l=r-t,c=a-i,h=s-o,f=h*u-c*l;if(!(f*f<Ze))return f=(c*(t-o)-h*(e-i))/f,[e+f*u,t+f*l]}function Gs(e,t,n,r,i,o,a){var s=e-n,u=t-r,l=(a?o:-o)/_e(s*s+u*u),c=l*u,h=-l*s,f=e+c,p=t+h,d=n+c,g=r+h,m=(f+d)/2,y=(p+g)/2,b=d-f,x=g-p,v=b*b+x*x,_=i-o,w=f*g-d*p,P=(x<0?-1:1)*_e(Z5(0,_*_*v-w*w)),C=(w*x-b*P)/v,L=(-w*b-x*P)/v,E=(w*x+b*P)/v,N=(-w*b+x*P)/v,A=C-m,R=L-y,S=E-m,M=N-y;return A*A+R*R>S*S+M*M&&(C=E,L=N),{cx:C,cy:L,x01:-c,y01:-h,x11:C*(i/_-1),y11:L*(i/_-1)}}function Vs(){var e=K5,t=Q5,n=he(0),r=null,i=e6,o=t6,a=n6,s=null,u=So(l);function l(){var c,h,f=+e.apply(this,arguments),p=+t.apply(this,arguments),d=i.apply(this,arguments)-Xs,g=o.apply(this,arguments)-Xs,m=zy(g-d),y=g>d;if(s||(s=c=u()),p<f&&(h=p,p=f,f=h),!(p>Ze))s.moveTo(0,0);else if(m>Dn-Ze)s.moveTo(p*ln(d),p*ft(d)),s.arc(0,0,p,d,g,!y),f>Ze&&(s.moveTo(f*ln(g),f*ft(g)),s.arc(0,0,f,g,d,y));else{var b=d,x=g,v=d,_=g,w=m,P=m,C=a.apply(this,arguments)/2,L=C>Ze&&(r?+r.apply(this,arguments):_e(f*f+p*p)),E=ri(zy(p-f)/2,+n.apply(this,arguments)),N=E,A=E,R,S;if(L>Ze){var M=Oy(L/f*ft(C)),$=Oy(L/p*ft(C));(w-=M*2)>Ze?(M*=y?1:-1,v+=M,_-=M):(w=0,v=_=(d+g)/2),(P-=$*2)>Ze?($*=y?1:-1,b+=$,x-=$):(P=0,b=x=(d+g)/2)}var B=p*ln(b),D=p*ft(b),z=f*ln(_),F=f*ft(_);if(E>Ze){var j=p*ln(x),K=p*ft(x),se=f*ln(v),te=f*ft(v),Y;if(m<An)if(Y=r6(B,D,se,te,j,K,z,F)){var J=B-Y[0],ie=D-Y[1],ue=j-Y[0],q=K-Y[1],re=1/ft(J5((J*ue+ie*q)/(_e(J*J+ie*ie)*_e(ue*ue+q*q)))/2),ce=_e(Y[0]*Y[0]+Y[1]*Y[1]);N=ri(E,(f-ce)/(re-1)),A=ri(E,(p-ce)/(re+1))}else N=A=0}P>Ze?A>Ze?(R=Gs(se,te,B,D,p,A,y),S=Gs(j,K,z,F,p,A,y),s.moveTo(R.cx+R.x01,R.cy+R.y01),A<E?s.arc(R.cx,R.cy,A,qe(R.y01,R.x01),qe(S.y01,S.x01),!y):(s.arc(R.cx,R.cy,A,qe(R.y01,R.x01),qe(R.y11,R.x11),!y),s.arc(0,0,p,qe(R.cy+R.y11,R.cx+R.x11),qe(S.cy+S.y11,S.cx+S.x11),!y),s.arc(S.cx,S.cy,A,qe(S.y11,S.x11),qe(S.y01,S.x01),!y))):(s.moveTo(B,D),s.arc(0,0,p,b,x,!y)):s.moveTo(B,D),!(f>Ze)||!(w>Ze)?s.lineTo(z,F):N>Ze?(R=Gs(z,F,j,K,f,-N,y),S=Gs(B,D,se,te,f,-N,y),s.lineTo(R.cx+R.x01,R.cy+R.y01),N<E?s.arc(R.cx,R.cy,N,qe(R.y01,R.x01),qe(S.y01,S.x01),!y):(s.arc(R.cx,R.cy,N,qe(R.y01,R.x01),qe(R.y11,R.x11),!y),s.arc(0,0,f,qe(R.cy+R.y11,R.cx+R.x11),qe(S.cy+S.y11,S.cx+S.x11),y),s.arc(S.cx,S.cy,N,qe(S.y11,S.x11),qe(S.y01,S.x01),!y))):s.arc(0,0,f,_,v,y)}if(s.closePath(),c)return s=null,c+""||null}return l.centroid=function(){var c=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,h=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-An/2;return[ln(h)*c,ft(h)*c]},l.innerRadius=function(c){return arguments.length?(e=typeof c=="function"?c:he(+c),l):e},l.outerRadius=function(c){return arguments.length?(t=typeof c=="function"?c:he(+c),l):t},l.cornerRadius=function(c){return arguments.length?(n=typeof c=="function"?c:he(+c),l):n},l.padRadius=function(c){return arguments.length?(r=c==null?null:typeof c=="function"?c:he(+c),l):r},l.startAngle=function(c){return arguments.length?(i=typeof c=="function"?c:he(+c),l):i},l.endAngle=function(c){return arguments.length?(o=typeof c=="function"?c:he(+c),l):o},l.padAngle=function(c){return arguments.length?(a=typeof c=="function"?c:he(+c),l):a},l.context=function(c){return arguments.length?(s=c??null,l):s},l}var i6=Array.prototype.slice;function js(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Iy(e){this._context=e}Iy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Us(e){return new Iy(e)}function Sf(e){return e[0]}function $f(e){return e[1]}function Hs(e,t){var n=he(!0),r=null,i=Us,o=null,a=So(s);e=typeof e=="function"?e:e===void 0?Sf:he(e),t=typeof t=="function"?t:t===void 0?$f:he(t);function s(u){var l,c=(u=js(u)).length,h,f=!1,p;for(r==null&&(o=i(p=a())),l=0;l<=c;++l)!(l<c&&n(h=u[l],l,u))===f&&((f=!f)?o.lineStart():o.lineEnd()),f&&o.point(+e(h,l,u),+t(h,l,u));if(p)return o=null,p+""||null}return s.x=function(u){return arguments.length?(e=typeof u=="function"?u:he(+u),s):e},s.y=function(u){return arguments.length?(t=typeof u=="function"?u:he(+u),s):t},s.defined=function(u){return arguments.length?(n=typeof u=="function"?u:he(!!u),s):n},s.curve=function(u){return arguments.length?(i=u,r!=null&&(o=i(r)),s):i},s.context=function(u){return arguments.length?(u==null?r=o=null:o=i(r=u),s):r},s}function wf(e,t,n){var r=null,i=he(!0),o=null,a=Us,s=null,u=So(l);e=typeof e=="function"?e:e===void 0?Sf:he(+e),t=typeof t=="function"?t:he(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?$f:he(+n);function l(h){var f,p,d,g=(h=js(h)).length,m,y=!1,b,x=new Array(g),v=new Array(g);for(o==null&&(s=a(b=u())),f=0;f<=g;++f){if(!(f<g&&i(m=h[f],f,h))===y)if(y=!y)p=f,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=f-1;d>=p;--d)s.point(x[d],v[d]);s.lineEnd(),s.areaEnd()}y&&(x[f]=+e(m,f,h),v[f]=+t(m,f,h),s.point(r?+r(m,f,h):x[f],n?+n(m,f,h):v[f]))}if(b)return s=null,b+""||null}function c(){return Hs().defined(i).curve(a).context(o)}return l.x=function(h){return arguments.length?(e=typeof h=="function"?h:he(+h),r=null,l):e},l.x0=function(h){return arguments.length?(e=typeof h=="function"?h:he(+h),l):e},l.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:he(+h),l):r},l.y=function(h){return arguments.length?(t=typeof h=="function"?h:he(+h),n=null,l):t},l.y0=function(h){return arguments.length?(t=typeof h=="function"?h:he(+h),l):t},l.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:he(+h),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(r).y(t)},l.defined=function(h){return arguments.length?(i=typeof h=="function"?h:he(!!h),l):i},l.curve=function(h){return arguments.length?(a=h,o!=null&&(s=a(o)),l):a},l.context=function(h){return arguments.length?(h==null?o=s=null:s=a(o=h),l):o},l}function o6(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function a6(e){return e}function Fy(){var e=a6,t=o6,n=null,r=he(0),i=he(Dn),o=he(0);function a(s){var u,l=(s=js(s)).length,c,h,f=0,p=new Array(l),d=new Array(l),g=+r.apply(this,arguments),m=Math.min(Dn,Math.max(-Dn,i.apply(this,arguments)-g)),y,b=Math.min(Math.abs(m)/l,o.apply(this,arguments)),x=b*(m<0?-1:1),v;for(u=0;u<l;++u)(v=d[p[u]=u]=+e(s[u],u,s))>0&&(f+=v);for(t!=null?p.sort(function(_,w){return t(d[_],d[w])}):n!=null&&p.sort(function(_,w){return n(s[_],s[w])}),u=0,h=f?(m-l*x)/f:0;u<l;++u,g=y)c=p[u],v=d[c],y=g+(v>0?v*h:0)+x,d[c]={data:s[c],index:u,value:v,startAngle:g,endAngle:y,padAngle:b};return d}return a.value=function(s){return arguments.length?(e=typeof s=="function"?s:he(+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:he(+s),a):r},a.endAngle=function(s){return arguments.length?(i=typeof s=="function"?s:he(+s),a):i},a.padAngle=function(s){return arguments.length?(o=typeof s=="function"?s:he(+s),a):o},a}var Yy=_f(Us);function Wy(e){this._curve=e}Wy.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 _f(e){function t(n){return new Wy(e(n))}return t._curve=e,t}function $o(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(_f(n)):t()._curve},e}function Xy(){return $o(Hs().curve(Yy))}function Gy(){var e=wf().curve(Yy),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 $o(n())},delete e.lineX0,e.lineEndAngle=function(){return $o(r())},delete e.lineX1,e.lineInnerRadius=function(){return $o(i())},delete e.lineY0,e.lineOuterRadius=function(){return $o(o())},delete e.lineY1,e.curve=function(a){return arguments.length?t(_f(a)):t()._curve},e}function wo(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}class Vy{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 s6{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=wo(this._x0,this._y0),i=wo(this._x0,this._y0=(this._y0+n)/2),o=wo(t,this._y0),a=wo(t,n);this._context.moveTo(...r),this._context.bezierCurveTo(...i,...o,...a)}this._x0=t,this._y0=n}}function jy(e){return new Vy(e,!0)}function Uy(e){return new Vy(e,!1)}function l6(e){return new s6(e)}function u6(e){return e.source}function c6(e){return e.target}function qs(e){let t=u6,n=c6,r=Sf,i=$f,o=null,a=null,s=So(u);function u(){let l;const c=i6.call(arguments),h=t.apply(this,c),f=n.apply(this,c);if(o==null&&(a=e(l=s())),a.lineStart(),c[0]=h,a.point(+r.apply(this,c),+i.apply(this,c)),c[0]=f,a.point(+r.apply(this,c),+i.apply(this,c)),a.lineEnd(),l)return a=null,l+""||null}return u.source=function(l){return arguments.length?(t=l,u):t},u.target=function(l){return arguments.length?(n=l,u):n},u.x=function(l){return arguments.length?(r=typeof l=="function"?l:he(+l),u):r},u.y=function(l){return arguments.length?(i=typeof l=="function"?l:he(+l),u):i},u.context=function(l){return arguments.length?(l==null?o=a=null:a=e(o=l),u):o},u}function f6(){return qs(jy)}function h6(){return qs(Uy)}function p6(){const e=qs(l6);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e}const d6=_e(3),Hy={draw(e,t){const n=_e(t+ri(t/28,.75))*.59436,r=n/2,i=r*d6;e.moveTo(0,n),e.lineTo(0,-n),e.moveTo(-i,-r),e.lineTo(i,r),e.moveTo(-i,r),e.lineTo(i,-r)}},Zs={draw(e,t){const n=_e(t/An);e.moveTo(n,0),e.arc(0,0,n,0,Dn)}},qy={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()}},Zy=_e(1/3),g6=Zy*2,Jy={draw(e,t){const n=_e(t/g6),r=n*Zy;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Ky={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()}},Qy={draw(e,t){const n=_e(t-ri(t/7,2))*.87559;e.moveTo(-n,0),e.lineTo(n,0),e.moveTo(0,n),e.lineTo(0,-n)}},e1={draw(e,t){const n=_e(t),r=-n/2;e.rect(r,r,n,n)}},t1={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()}},m6=.8908130915292852,n1=ft(An/10)/ft(7*An/10),y6=ft(Dn/10)*n1,b6=-ln(Dn/10)*n1,r1={draw(e,t){const n=_e(t*m6),r=y6*n,i=b6*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const a=Dn*o/5,s=ln(a),u=ft(a);e.lineTo(u*n,-s*n),e.lineTo(s*r-u*i,u*r+s*i)}e.closePath()}},Tf=_e(3),i1={draw(e,t){const n=-_e(t/(Tf*3));e.moveTo(0,n*2),e.lineTo(-Tf*n,-n),e.lineTo(Tf*n,-n),e.closePath()}},x6=_e(3),o1={draw(e,t){const n=_e(t)*.6824,r=n/2,i=n*x6/2;e.moveTo(0,-n),e.lineTo(i,r),e.lineTo(-i,r),e.closePath()}},_t=-.5,Tt=_e(3)/2,Af=1/_e(12),v6=(Af/2+1)*3,a1={draw(e,t){const n=_e(t/v6),r=n/2,i=n*Af,o=r,a=n*Af+n,s=-o,u=a;e.moveTo(r,i),e.lineTo(o,a),e.lineTo(s,u),e.lineTo(_t*r-Tt*i,Tt*r+_t*i),e.lineTo(_t*o-Tt*a,Tt*o+_t*a),e.lineTo(_t*s-Tt*u,Tt*s+_t*u),e.lineTo(_t*r+Tt*i,_t*i-Tt*r),e.lineTo(_t*o+Tt*a,_t*a-Tt*o),e.lineTo(_t*s+Tt*u,_t*u-Tt*s),e.closePath()}},Df={draw(e,t){const n=_e(t-ri(t/6,1.7))*.6189;e.moveTo(-n,-n),e.lineTo(n,n),e.moveTo(-n,n),e.lineTo(n,-n)}},s1=[Zs,qy,Jy,e1,r1,i1,a1],S6=[Zs,Qy,Df,o1,Hy,t1,Ky];function $6(e,t){let n=null,r=So(i);e=typeof e=="function"?e:he(e||Zs),t=typeof t=="function"?t:he(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:he(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:he(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function Mn(){}function Js(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 Ks(e){this._context=e}Ks.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:Js(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:Js(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function w6(e){return new Ks(e)}function l1(e){this._context=e}l1.prototype={areaStart:Mn,areaEnd:Mn,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:Js(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _6(e){return new l1(e)}function u1(e){this._context=e}u1.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:Js(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function T6(e){return new u1(e)}function c1(e,t){this._basis=new Ks(e),this._beta=t}c1.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,u;++s<=n;)u=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+u*o),this._beta*t[s]+(1-this._beta)*(i+u*a));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const A6=function e(t){function n(r){return t===1?new Ks(r):new c1(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function Qs(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 Mf(e,t){this._context=e,this._k=(1-t)/6}Mf.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:Qs(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:Qs(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 D6=function e(t){function n(r){return new Mf(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Pf(e,t){this._context=e,this._k=(1-t)/6}Pf.prototype={areaStart:Mn,areaEnd:Mn,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:Qs(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 M6=function e(t){function n(r){return new Pf(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Cf(e,t){this._context=e,this._k=(1-t)/6}Cf.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:Qs(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 P6=function e(t){function n(r){return new Cf(r,t)}return n.tension=function(r){return e(+r)},n}(0);function Lf(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>Ze){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>Ze){var l=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*l+e._x1*e._l23_2a-t*e._l12_2a)/c,a=(a*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}function f1(e,t){this._context=e,this._alpha=t}f1.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:Lf(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 C6=function e(t){function n(r){return t?new f1(r,t):new Mf(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function h1(e,t){this._context=e,this._alpha=t}h1.prototype={areaStart:Mn,areaEnd:Mn,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:Lf(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 L6=function e(t){function n(r){return t?new h1(r,t):new Pf(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function p1(e,t){this._context=e,this._alpha=t}p1.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:Lf(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 k6=function e(t){function n(r){return t?new p1(r,t):new Cf(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function d1(e){this._context=e}d1.prototype={areaStart:Mn,areaEnd:Mn,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 R6(e){return new d1(e)}function g1(e){return e<0?-1:1}function m1(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(g1(o)+g1(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function y1(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function kf(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 el(e){this._context=e}el.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:kf(this,this._t0,y1(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,kf(this,y1(this,n=m1(this,e,t)),n);break;default:kf(this,this._t0,n=m1(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function b1(e){this._context=new x1(e)}(b1.prototype=Object.create(el.prototype)).point=function(e,t){el.prototype.point.call(this,t,e)};function x1(e){this._context=e}x1.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 E6(e){return new el(e)}function N6(e){return new b1(e)}function v1(e){this._context=e}v1.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=S1(e),i=S1(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 S1(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 B6(e){return new v1(e)}function tl(e,t){this._context=e,this._t=t}tl.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 z6(e){return new tl(e,.5)}function O6(e){return new tl(e,0)}function I6(e){return new tl(e,1)}function ii(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 oi(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function F6(e,t){return e[t]}function Y6(e){const t=[];return t.key=e,t}function W6(){var e=he([]),t=oi,n=ii,r=F6;function i(o){var a=Array.from(e.apply(this,arguments),Y6),s,u=a.length,l=-1,c;for(const h of o)for(s=0,++l;s<u;++s)(a[s][l]=[0,+r(h,a[s].key,l,o)]).data=h;for(s=0,c=js(t(a));s<u;++s)a[c[s]].index=s;return n(a,c),a}return i.keys=function(o){return arguments.length?(e=typeof o=="function"?o:he(Array.from(o)),i):e},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:he(+o),i):r},i.order=function(o){return arguments.length?(t=o==null?oi:typeof o=="function"?o:he(Array.from(o)),i):t},i.offset=function(o){return arguments.length?(n=o??ii,i):n},i}function X6(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}ii(e,t)}}function G6(e,t){if((u=e.length)>0)for(var n,r=0,i,o,a,s,u,l=e[t[0]].length;r<l;++r)for(a=s=0,n=0;n<u;++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 V6(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}ii(e,t)}}function j6(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,u=0,l=0;s<a;++s){for(var c=e[t[s]],h=c[r][1]||0,f=c[r-1][1]||0,p=(h-f)/2,d=0;d<s;++d){var g=e[t[d]],m=g[r][1]||0,y=g[r-1][1]||0;p+=m-y}u+=h,l+=p*h}i[r-1][1]+=i[r-1][0]=n,u&&(n-=l/u)}i[r-1][1]+=i[r-1][0]=n,ii(e,t)}}function $1(e){var t=e.map(U6);return oi(e).sort(function(n,r){return t[n]-t[r]})}function U6(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 w1(e){var t=e.map(_1);return oi(e).sort(function(n,r){return t[n]-t[r]})}function _1(e){for(var t=0,n=-1,r=e.length,i;++n<r;)(i=+e[n][1])&&(t+=i);return t}function H6(e){return w1(e).reverse()}function q6(e){var t=e.length,n,r,i=e.map(_1),o=$1(e),a=0,s=0,u=[],l=[];for(n=0;n<t;++n)r=o[n],a<s?(a+=i[r],u.push(r)):(s+=i[r],l.push(r));return l.reverse().concat(u)}function Z6(e){return oi(e).reverse()}const nl=e=>()=>e;function J6(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 ai=new jt(1,0,0);T1.prototype=jt.prototype;function T1(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ai;return e.__zoom}function Rf(e){e.stopImmediatePropagation()}function _o(e){e.preventDefault(),e.stopImmediatePropagation()}function K6(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Q6(){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 A1(){return this.__zoom||ai}function e8(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function t8(){return navigator.maxTouchPoints||"ontouchstart"in this}function n8(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 un(){var e=K6,t=Q6,n=n8,r=e8,i=t8,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,u=sd,l=Fn("start","zoom","end"),c,h,f,p=500,d=150,g=0,m=10;function y(S){S.property("__zoom",A1).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",E).filter(i).on("touchstart.zoom",N).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",R).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(S,M,$,B){var D=S.selection?S.selection():S;D.property("__zoom",A1),S!==D?_(S,M,$,B):D.interrupt().each(function(){w(this,arguments).event(B).start().zoom(null,typeof M=="function"?M.apply(this,arguments):M).end()})},y.scaleBy=function(S,M,$,B){y.scaleTo(S,function(){var D=this.__zoom.k,z=typeof M=="function"?M.apply(this,arguments):M;return D*z},$,B)},y.scaleTo=function(S,M,$,B){y.transform(S,function(){var D=t.apply(this,arguments),z=this.__zoom,F=$==null?v(D):typeof $=="function"?$.apply(this,arguments):$,j=z.invert(F),K=typeof M=="function"?M.apply(this,arguments):M;return n(x(b(z,K),F,j),D,a)},$,B)},y.translateBy=function(S,M,$,B){y.transform(S,function(){return n(this.__zoom.translate(typeof M=="function"?M.apply(this,arguments):M,typeof $=="function"?$.apply(this,arguments):$),t.apply(this,arguments),a)},null,B)},y.translateTo=function(S,M,$,B,D){y.transform(S,function(){var z=t.apply(this,arguments),F=this.__zoom,j=B==null?v(z):typeof B=="function"?B.apply(this,arguments):B;return n(ai.translate(j[0],j[1]).scale(F.k).translate(typeof M=="function"?-M.apply(this,arguments):-M,typeof $=="function"?-$.apply(this,arguments):-$),z,a)},B,D)};function b(S,M){return M=Math.max(o[0],Math.min(o[1],M)),M===S.k?S:new jt(M,S.x,S.y)}function x(S,M,$){var B=M[0]-$[0]*S.k,D=M[1]-$[1]*S.k;return B===S.x&&D===S.y?S:new jt(S.k,B,D)}function v(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function _(S,M,$,B){S.on("start.zoom",function(){w(this,arguments).event(B).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(B).end()}).tween("zoom",function(){var D=this,z=arguments,F=w(D,z).event(B),j=t.apply(D,z),K=$==null?v(j):typeof $=="function"?$.apply(D,z):$,se=Math.max(j[1][0]-j[0][0],j[1][1]-j[0][1]),te=D.__zoom,Y=typeof M=="function"?M.apply(D,z):M,J=u(te.invert(K).concat(se/te.k),Y.invert(K).concat(se/Y.k));return function(ie){if(ie===1)ie=Y;else{var ue=J(ie),q=se/ue[2];ie=new jt(q,K[0]-ue[0]*q,K[1]-ue[1]*q)}F.zoom(null,ie)}})}function w(S,M,$){return!$&&S.__zooming||new P(S,M)}function P(S,M){this.that=S,this.args=M,this.active=0,this.sourceEvent=null,this.extent=t.apply(S,M),this.taps=0}P.prototype={event:function(S){return S&&(this.sourceEvent=S),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(S,M){return this.mouse&&S!=="mouse"&&(this.mouse[1]=M.invert(this.mouse[0])),this.touch0&&S!=="touch"&&(this.touch0[1]=M.invert(this.touch0[0])),this.touch1&&S!=="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(S){var M=I(this.that).datum();l.call(S,this.that,new J6(S,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:l}),M)}};function C(S,...M){if(!e.apply(this,arguments))return;var $=w(this,M).event(S),B=this.__zoom,D=Math.max(o[0],Math.min(o[1],B.k*Math.pow(2,r.apply(this,arguments)))),z=dt(S);if($.wheel)($.mouse[0][0]!==z[0]||$.mouse[0][1]!==z[1])&&($.mouse[1]=B.invert($.mouse[0]=z)),clearTimeout($.wheel);else{if(B.k===D)return;$.mouse=[z,B.invert(z)],Hn(this),$.start()}_o(S),$.wheel=setTimeout(F,d),$.zoom("mouse",n(x(b(B,D),$.mouse[0],$.mouse[1]),$.extent,a));function F(){$.wheel=null,$.end()}}function L(S,...M){if(f||!e.apply(this,arguments))return;var $=S.currentTarget,B=w(this,M,!0).event(S),D=I(S.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",se,!0),z=dt(S,$),F=S.clientX,j=S.clientY;ra(S.view),Rf(S),B.mouse=[z,this.__zoom.invert(z)],Hn(this),B.start();function K(te){if(_o(te),!B.moved){var Y=te.clientX-F,J=te.clientY-j;B.moved=Y*Y+J*J>g}B.event(te).zoom("mouse",n(x(B.that.__zoom,B.mouse[0]=dt(te,$),B.mouse[1]),B.extent,a))}function se(te){D.on("mousemove.zoom mouseup.zoom",null),ia(te.view,B.moved),_o(te),B.event(te).end()}}function E(S,...M){if(e.apply(this,arguments)){var $=this.__zoom,B=dt(S.changedTouches?S.changedTouches[0]:S,this),D=$.invert(B),z=$.k*(S.shiftKey?.5:2),F=n(x(b($,z),B,D),t.apply(this,M),a);_o(S),s>0?I(this).transition().duration(s).call(_,F,B,S):I(this).call(y.transform,F,B,S)}}function N(S,...M){if(e.apply(this,arguments)){var $=S.touches,B=$.length,D=w(this,M,S.changedTouches.length===B).event(S),z,F,j,K;for(Rf(S),F=0;F<B;++F)j=$[F],K=dt(j,this),K=[K,this.__zoom.invert(K),j.identifier],D.touch0?!D.touch1&&D.touch0[2]!==K[2]&&(D.touch1=K,D.taps=0):(D.touch0=K,z=!0,D.taps=1+!!c);c&&(c=clearTimeout(c)),z&&(D.taps<2&&(h=K[0],c=setTimeout(function(){c=null},p)),Hn(this),D.start())}}function A(S,...M){if(this.__zooming){var $=w(this,M).event(S),B=S.changedTouches,D=B.length,z,F,j,K;for(_o(S),z=0;z<D;++z)F=B[z],j=dt(F,this),$.touch0&&$.touch0[2]===F.identifier?$.touch0[0]=j:$.touch1&&$.touch1[2]===F.identifier&&($.touch1[0]=j);if(F=$.that.__zoom,$.touch1){var se=$.touch0[0],te=$.touch0[1],Y=$.touch1[0],J=$.touch1[1],ie=(ie=Y[0]-se[0])*ie+(ie=Y[1]-se[1])*ie,ue=(ue=J[0]-te[0])*ue+(ue=J[1]-te[1])*ue;F=b(F,Math.sqrt(ie/ue)),j=[(se[0]+Y[0])/2,(se[1]+Y[1])/2],K=[(te[0]+J[0])/2,(te[1]+J[1])/2]}else if($.touch0)j=$.touch0[0],K=$.touch0[1];else return;$.zoom("touch",n(x(F,j,K),$.extent,a))}}function R(S,...M){if(this.__zooming){var $=w(this,M).event(S),B=S.changedTouches,D=B.length,z,F;for(Rf(S),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),z=0;z<D;++z)F=B[z],$.touch0&&$.touch0[2]===F.identifier?delete $.touch0:$.touch1&&$.touch1[2]===F.identifier&&delete $.touch1;if($.touch1&&!$.touch0&&($.touch0=$.touch1,delete $.touch1),$.touch0)$.touch0[1]=this.__zoom.invert($.touch0[0]);else if($.end(),$.taps===2&&(F=dt(F,this),Math.hypot(h[0]-F[0],h[1]-F[1])<m)){var j=I(this).on("dblclick.zoom");j&&j.apply(this,arguments)}}}return y.wheelDelta=function(S){return arguments.length?(r=typeof S=="function"?S:nl(+S),y):r},y.filter=function(S){return arguments.length?(e=typeof S=="function"?S:nl(!!S),y):e},y.touchable=function(S){return arguments.length?(i=typeof S=="function"?S:nl(!!S),y):i},y.extent=function(S){return arguments.length?(t=typeof S=="function"?S:nl([[+S[0][0],+S[0][1]],[+S[1][0],+S[1][1]]]),y):t},y.scaleExtent=function(S){return arguments.length?(o[0]=+S[0],o[1]=+S[1],y):[o[0],o[1]]},y.translateExtent=function(S){return arguments.length?(a[0][0]=+S[0][0],a[1][0]=+S[1][0],a[0][1]=+S[0][1],a[1][1]=+S[1][1],y):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},y.constrain=function(S){return arguments.length?(n=S,y):n},y.duration=function(S){return arguments.length?(s=+S,y):s},y.interpolate=function(S){return arguments.length?(u=S,y):u},y.on=function(){var S=l.on.apply(l,arguments);return S===l?y:S},y.clickDistance=function(S){return arguments.length?(g=(S=+S)*S,y):Math.sqrt(g)},y.tapDistance=function(S){return arguments.length?(m=+S,y):m},y}const Ef=Object.freeze(Object.defineProperty({__proto__:null,Adder:Re,Delaunay:Yu,FormatSpecifier:Fa,InternMap:bi,InternSet:zn,Node:or,Path:Fi,Voronoi:qd,ZoomTransform:jt,active:c_,arc:Vs,area:wf,areaRadial:Gy,ascending:Ae,autoType:ET,axisBottom:up,axisLeft:Wl,axisRight:i2,axisTop:Yl,bin:Qh,bisect:gn,bisectCenter:tv,bisectLeft:ev,bisectRight:gn,bisector:Xo,blob:zT,blur:nv,blur2:Ih,blurImage:rv,brush:w_,brushSelection:v_,brushX:S_,brushY:$_,buffer:IT,chord:T_,chordDirected:D_,chordTranspose:A_,cluster:qD,color:bn,contourDensity:Q_,contours:Bu,count:Vo,create:IS,creator:ea,cross:cv,csv:WT,csvFormat:wT,csvFormatBody:_T,csvFormatRow:AT,csvFormatRows:TT,csvFormatValue:DT,csvParse:Qd,csvParseRows:$T,cubehelix:Ct,cumsum:fv,curveBasis:w6,curveBasisClosed:_6,curveBasisOpen:T6,curveBumpX:jy,curveBumpY:Uy,curveBundle:A6,curveCardinal:D6,curveCardinalClosed:M6,curveCardinalOpen:P6,curveCatmullRom:C6,curveCatmullRomClosed:L6,curveCatmullRomOpen:k6,curveLinear:Us,curveLinearClosed:R6,curveMonotoneX:E6,curveMonotoneY:N6,curveNatural:B6,curveStep:z6,curveStepAfter:I6,curveStepBefore:O6,descending:zh,deviation:Wh,difference:jv,disjoint:Uv,dispatch:Fn,drag:aa,dragDisable:ra,dragEnable:ia,dsv:YT,dsvFormat:Ra,easeBack:Pd,easeBackIn:n_,easeBackInOut:Pd,easeBackOut:r_,easeBounce:Oi,easeBounceIn:e_,easeBounceInOut:t_,easeBounceOut:Oi,easeCircle:Md,easeCircleIn:Gw,easeCircleInOut:Md,easeCircleOut:Vw,easeCubic:zi,easeCubicIn:Bw,easeCubicInOut:zi,easeCubicOut:zw,easeElastic:qn,easeElasticIn:i_,easeElasticInOut:o_,easeElasticOut:qn,easeExp:Dd,easeExpIn:Ww,easeExpInOut:Dd,easeExpOut:Xw,easeLinear:Bi,easePoly:wd,easePolyIn:Ow,easePolyInOut:wd,easePolyOut:Iw,easeQuad:$d,easeQuadIn:Ew,easeQuadInOut:$d,easeQuadOut:Nw,easeSin:Ad,easeSinIn:Fw,easeSinInOut:Ad,easeSinOut:Yw,every:Fv,extent:yi,fcumsum:pv,filter:Wv,flatGroup:dv,flatRollup:gv,forceCenter:ju,forceCollide:Ba,forceLink:Hu,forceManyBody:Oa,forceRadial:$A,forceSimulation:za,forceX:ag,forceY:sg,get format(){return Gi},formatDefaultLocale:gg,formatLocale:dg,get formatPrefix(){return qu},formatSpecifier:Xr,fsum:hv,geoAlbers:P0,geoAlbersUsa:DD,geoArea:kA,geoAzimuthalEqualArea:MD,geoAzimuthalEqualAreaRaw:Ec,geoAzimuthalEquidistant:PD,geoAzimuthalEquidistantRaw:Nc,geoBounds:BA,geoCentroid:WA,geoCircle:XA,geoClipAntimeridian:pc,geoClipCircle:Jg,geoClipExtent:ZA,geoClipRectangle:ls,geoConicConformal:LD,geoConicConformalRaw:k0,geoConicEqualArea:vs,geoConicEqualAreaRaw:M0,geoConicEquidistant:RD,geoConicEquidistantRaw:R0,geoContains:rD,geoDistance:fs,geoEqualEarth:ND,geoEqualEarthRaw:Bc,geoEquirectangular:kD,geoEquirectangularRaw:ao,geoGnomonic:BD,geoGnomonicRaw:zc,geoGraticule:s0,geoGraticule10:iD,geoIdentity:zD,geoInterpolate:oD,geoLength:Kg,geoMercator:CD,geoMercatorRaw:oo,geoNaturalEarth1:OD,geoNaturalEarth1Raw:Oc,geoOrthographic:ID,geoOrthographicRaw:Ic,geoPath:yD,geoProjection:Xt,geoProjectionMutator:kc,geoRotation:Xg,geoStereographic:FD,geoStereographicRaw:Fc,geoStream:kt,geoTransform:bD,geoTransverseMercator:YD,geoTransverseMercatorRaw:Yc,gray:i$,greatest:ep,greatestIndex:Nv,group:jh,groupSort:bv,groups:Uh,hcl:ha,hierarchy:ws,histogram:Qh,hsl:ua,html:HT,image:GT,index:mv,indexes:yv,interpolate:Ht,interpolateArray:c$,interpolateBasis:jp,interpolateBasisClosed:Up,interpolateBlues:L5,interpolateBrBG:c5,interpolateBuGn:x5,interpolateBuPu:v5,interpolateCividis:z5,interpolateCool:F5,interpolateCubehelix:T$,interpolateCubehelixDefault:O5,interpolateCubehelixLong:ba,interpolateDate:Qp,interpolateDiscrete:p$,interpolateGnBu:S5,interpolateGreens:k5,interpolateGreys:R5,interpolateHcl:w$,interpolateHclLong:_$,interpolateHsl:v$,interpolateHslLong:S$,interpolateHue:d$,interpolateInferno:H5,interpolateLab:$$,interpolateMagma:U5,interpolateNumber:xt,interpolateNumberArray:su,interpolateObject:ed,interpolateOrRd:$5,interpolateOranges:B5,interpolatePRGn:f5,interpolatePiYG:h5,interpolatePlasma:q5,interpolatePuBu:_5,interpolatePuBuGn:w5,interpolatePuOr:p5,interpolatePuRd:T5,interpolatePurples:E5,interpolateRainbow:Y5,interpolateRdBu:d5,interpolateRdGy:g5,interpolateRdPu:A5,interpolateRdYlBu:m5,interpolateRdYlGn:y5,interpolateReds:N5,interpolateRgb:Pi,interpolateRgbBasis:Zp,interpolateRgbBasisClosed:u$,interpolateRound:ma,interpolateSinebow:G5,interpolateSpectral:b5,interpolateString:cu,interpolateTransformCss:id,interpolateTransformSvg:od,interpolateTurbo:V5,interpolateViridis:j5,interpolateWarm:I5,interpolateYlGn:M5,interpolateYlGnBu:D5,interpolateYlOrBr:P5,interpolateYlOrRd:C5,interpolateZoom:sd,interrupt:Hn,intersection:Hv,interval:C$,isoFormat:GP,isoParse:jP,json:jT,lab:Di,lch:o$,least:Ev,leastIndex:rp,line:Hs,lineRadial:Xy,link:qs,linkHorizontal:f6,linkRadial:p6,linkVertical:h6,local:xp,map:Xv,matcher:jl,max:xi,maxIndex:Bl,mean:Av,median:Dv,medianIndex:Mv,merge:Ol,min:Ho,minIndex:zl,mode:Cv,namespace:wi,namespaces:Gl,nice:El,now:Ei,pack:TM,packEnclose:xM,packSiblings:wM,pairs:Lv,partition:AM,path:Nu,pathRound:C_,permute:Kh,pie:Fy,piecewise:fd,pointRadial:wo,pointer:dt,pointers:YS,polygonArea:YM,polygonCentroid:WM,polygonContains:jM,polygonHull:VM,polygonLength:UM,precisionFixed:mg,precisionPrefix:yg,precisionRound:bg,quadtree:Na,quantile:Si,quantileIndex:np,quantileSorted:tp,quantize:A$,quickselect:qo,radialArea:Gy,radialLine:Xy,randomBates:JM,randomBernoulli:e3,randomBeta:tm,randomBinomial:nm,randomCauchy:n3,randomExponential:KM,randomGamma:Jc,randomGeometric:em,randomInt:qM,randomIrwinHall:Q0,randomLcg:s3,randomLogNormal:ZM,randomLogistic:r3,randomNormal:Zc,randomPareto:QM,randomPoisson:i3,randomUniform:HM,randomWeibull:t3,range:mn,rank:Rv,reduce:Gv,reverse:Vv,rgb:Lr,ribbon:O_,ribbonArrow:I_,rollup:qh,rollups:Zh,scaleBand:ef,scaleDiverging:sy,scaleDivergingLog:ly,scaleDivergingPow:vf,scaleDivergingSqrt:KP,scaleDivergingSymlog:uy,scaleIdentity:sm,scaleImplicit:Kc,scaleLinear:Et,scaleLog:hm,scaleOrdinal:Qc,scalePoint:tf,scalePow:_n,scaleQuantile:xm,scaleQuantize:lf,scaleRadial:bm,scaleSequential:ry,scaleSequentialLog:iy,scaleSequentialPow:xf,scaleSequentialQuantile:ay,scaleSequentialSqrt:JP,scaleSequentialSymlog:oy,scaleSqrt:x3,scaleSymlog:gm,scaleThreshold:vm,scaleTime:qP,scaleUtc:ZP,scan:Bv,schemeAccent:e5,schemeBlues:Ly,schemeBrBG:cy,schemeBuGn:xy,schemeBuPu:vy,schemeCategory10:QP,schemeDark2:t5,schemeGnBu:Sy,schemeGreens:ky,schemeGreys:Ry,schemeObservable10:n5,schemeOrRd:$y,schemeOranges:By,schemePRGn:fy,schemePaired:r5,schemePastel1:i5,schemePastel2:o5,schemePiYG:hy,schemePuBu:_y,schemePuBuGn:wy,schemePuOr:py,schemePuRd:Ty,schemePurples:Ey,schemeRdBu:dy,schemeRdGy:gy,schemeRdPu:Ay,schemeRdYlBu:my,schemeRdYlGn:yy,schemeReds:Ny,schemeSet1:a5,schemeSet2:s5,schemeSet3:l5,schemeSpectral:by,schemeTableau10:u5,schemeYlGn:My,schemeYlGnBu:Dy,schemeYlOrBr:Py,schemeYlOrRd:Cy,select:I,selectAll:Sp,selection:Wn,selector:ta,selectorAll:Vl,shuffle:zv,shuffler:ip,some:Yv,sort:Ll,stack:W6,stackOffsetDiverging:G6,stackOffsetExpand:X6,stackOffsetNone:ii,stackOffsetSilhouette:V6,stackOffsetWiggle:j6,stackOrderAppearance:$1,stackOrderAscending:w1,stackOrderDescending:H6,stackOrderInsideOut:q6,stackOrderNone:oi,stackOrderReverse:Z6,stratify:CM,style:Yn,subset:Zv,sum:Il,superset:ap,svg:qT,symbol:$6,symbolAsterisk:Hy,symbolCircle:Zs,symbolCross:qy,symbolDiamond:Jy,symbolDiamond2:Ky,symbolPlus:Qy,symbolSquare:e1,symbolSquare2:t1,symbolStar:r1,symbolTimes:Df,symbolTriangle:i1,symbolTriangle2:o1,symbolWye:a1,symbolX:Df,symbols:s1,symbolsFill:s1,symbolsStroke:S6,text:Ea,thresholdFreedmanDiaconis:_v,thresholdScott:Tv,thresholdSturges:Nl,tickFormat:am,tickIncrement:In,tickStep:Uo,ticks:On,timeDay:Qr,timeDays:T3,get timeFormat(){return mf},timeFormatDefaultLocale:ty,timeFormatLocale:Im,timeFriday:Am,timeFridays:k3,timeHour:Rs,timeHours:w3,timeInterval:ke,timeMillisecond:Kr,timeMilliseconds:Sm,timeMinute:Ls,timeMinutes:S3,timeMonday:mo,timeMondays:M3,timeMonth:Ns,timeMonths:F3,get timeParse(){return ey},timeSaturday:Dm,timeSaturdays:R3,timeSecond:sn,timeSeconds:wm,timeSunday:ei,timeSundays:Mm,timeThursday:lr,timeThursdays:L3,timeTickInterval:Om,timeTicks:zm,timeTuesday:_m,timeTuesdays:P3,timeWednesday:Tm,timeWednesdays:C3,timeWeek:ei,timeWeeks:Mm,timeYear:Gt,timeYears:W3,timeout:pu,timer:$a,timerFlush:dd,transition:vd,transpose:op,tree:zM,treemap:J0,treemapBinary:OM,treemapDice:ho,treemapResquarify:FM,treemapSlice:Ms,treemapSliceDice:IM,treemapSquarify:qc,tsv:XT,tsvFormat:PT,tsvFormatBody:CT,tsvFormatRow:kT,tsvFormatRows:LT,tsvFormatValue:RT,tsvParse:eg,tsvParseRows:MT,union:Jv,unixDay:pf,unixDays:D3,utcDay:go,utcDays:A3,get utcFormat(){return zs},utcFriday:Lm,utcFridays:O3,utcHour:Es,utcHours:_3,utcMillisecond:Kr,utcMilliseconds:Sm,utcMinute:ks,utcMinutes:$3,utcMonday:yo,utcMondays:E3,utcMonth:Bs,utcMonths:Y3,get utcParse(){return yf},utcSaturday:km,utcSaturdays:I3,utcSecond:sn,utcSeconds:wm,utcSunday:ti,utcSundays:Rm,utcThursday:cr,utcThursdays:z3,utcTickInterval:Bm,utcTicks:Nm,utcTuesday:Pm,utcTuesdays:N3,utcWednesday:Cm,utcWednesdays:B3,utcWeek:ti,utcWeeks:Rm,utcYear:Vt,utcYears:X3,variance:Yh,window:Ul,xml:UT,zip:Iv,zoom:un,zoomIdentity:ai,zoomTransform:T1},Symbol.toStringTag,{value:"Module"})),yt=({maxValue:e=1,minValue:t=0,axisWidth:n,scaleDomain:r=pt.scaleDomain,scaleRange:i=pt.scaleRange,reverse:o=!1})=>{const a=r[0]??pt.scaleDomain[0],s=r[1]??pt.scaleDomain[1],u=i[0]??pt.scaleRange[0],l=i[1]??pt.scaleRange[1];let c=a==="auto"?t<0?t:0:a==="min"?t:a,h=s==="auto"?e>=0?e:0:s==="max"?e:s;const f=e-(e-c)/(1-u),p=h/l;return o?Et().domain([f,p]).range([n,0]):Et().domain([f,p]).range([0,n])},D1=({maxValue:e=1,minValue:t=0,axisWidth:n,scaleDomain:r=pt.scaleDomain,scaleRange:i=pt.scaleRange,reverse:o=!1})=>{t===e&&(e+=1,t-=1);const a=r[0]??pt.scaleDomain[0],s=r[1]??pt.scaleDomain[1],u=i[0]??pt.scaleRange[0],l=i[1]??pt.scaleRange[1];let c=a==="auto"?t<0?t:0:a==="min"?t:a,h=s==="auto"?e>=0?e:0:s==="max"?e:s;const f=e-(e-c)/(1-u),p=h/l;return o?Et().domain([n,0]).range([f,p]):Et().domain([0,n]).range([f,p])},M1=({axisLabels:e,axisWidth:t,padding:n=0,reverse:r=!1})=>{let i=e.map((u,l)=>l);r&&i.reverse(),i.length||(i=[0]);const o=i.length-1+n*2,a=t/o,s=a*n-a*.5;return lf().domain([s,t-s]).range(i)};function P1(e){try{return e.node().getBBox()}catch(t){throw new Error(t)}}function r8(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 To(e){return e.substring(0,4)!=="ease"?zi:Ef[e]??zi}function rl({axisWidth:e,innerRadius:t,outerRadius:n,padAngle:r,cornerRadius:i}){const o=Et().domain([0,1]).range([0,e/2]),a=o(n);return Vs().innerRadius(o(t)).outerRadius(a).padAngle(r).padRadius(a).cornerRadius(i)}const fr=(e,t)=>{if(t instanceof Function){const n=t(e);return String(n??"")}return Gi(t)(e)};function Nf(e){return!(Di(e).l<=60)}function Bf(e){const t=e.filter(n=>n.value!=null&&n.visible!=!1).map(n=>n.value);return Sr(t)}function Ao(e){return e==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function xe(e,t){const n=Ao(t.colorScheme),r=t.colors[n];return e==="data"?r.data[0]:e==="dataContrast"?Nf(r.data[0])?r.dataContrast[1]:r.dataContrast[0]:e=="none"?"none":r[e]!=null?r[e]:r.primary}function Te({datum:e,colorType:t,theme:n}){const r=n.colors[Ao(n.colorScheme)];if(t==="data"){const i=e.color;return i||r.data[0]}else if(t==="dataContrast"){const i=e.color;return i?Nf(i)?r.dataContrast[1]:r.dataContrast[0]:Nf(r.data[0])?r.dataContrast[1]:r.dataContrast[0]}return t=="none"?"none":r[t]!=null?r[t]:r.primary}function Z(e,t,n,r){const i=r?`--${r}`:"";return`${G.createLayerClassName(e,t)}__${n}${i}`}function At(e,t,n){const i=Math.random().toString(36).substr(2,5);return Z(e,t,n,i)}function C1(e){let t=Math.floor(Math.sqrt(e)),n=Math.ceil(e/t);for(;t*n<e;)n++;return{rowAmount:t,columnAmount:n}}function i8(e,t,n){const r=t.columnGap==="auto"?e.left+e.right:t.columnGap,i=t.rowGap==="auto"?e.top+e.bottom:t.rowGap,{rowAmount:o,columnAmount:a}=t.rowAmount*t.columnAmount>=n?t:C1(n);return new Array(n).fill(null).map((s,u)=>{const l=u%a,c=Math.floor(u/a),h=(e.width-r*(a-1))/a,f=(e.height-i*(o-1))/o,p=l*h+l*r,d=c*f+c*i;return{slotIndex:u,rowIndex:c,columnIndex:l,startX:p,startY:d,centerX:p+h/2,centerY:d+f/2,width:h,height:f}})}function il(e,t,n){const r=t.columnGap==="auto"?e.left+e.right:t.columnGap,i=t.rowGap==="auto"?e.top+e.bottom:t.rowGap,{rowAmount:o,columnAmount:a}=t.rowAmount*t.columnAmount>=n?t:C1(n);return new Array(n).fill(null).map((s,u)=>{const l=u%a,c=Math.floor(u/a),h=(e.width-r*(a-1))/a,f=(e.height-i*(o-1))/o,p=l*h+l*r,d=c*f+c*i,g=[p,d],m=[h/e.width,f/e.height];return{slotIndex:u,rowIndex:c,columnIndex:l,translate:g,scale:m}})}const L1=0,ol=1,o8=({selectedMultivariateData$:e,pluginParams$:t})=>O({selectedMultivariateData:e,pluginParams:t}).pipe(X(0),T(({selectedMultivariateData:n,pluginParams:r})=>n.map(i=>i.map((o,a)=>{const s=r.visibleFilter;return{...o,visible:s?s(o):!0}}))));function a8(e,t){return`value${t}`}const s8=({encoding$:e})=>e.pipe(T(t=>t.multivariate.map((n,r)=>n.name??a8("multivariate",r))),H((t,n)=>JSON.stringify(t)===JSON.stringify(n))),l8=({computedData$:e,xyValueIndex$:t})=>O({computedData:e,xyValueIndex:t}).pipe(T(n=>{const r=n.computedData.flat(),[i,o]=Sr(r.map(u=>u.multivariate[n.xyValueIndex[0]].value)),[a,s]=Sr(r.map(u=>u.multivariate[n.xyValueIndex[1]].value));return{minX:i,maxX:o,minY:a,maxY:s}})),u8=({computedData$:e,xyMinMax$:t,xyValueIndex$:n,layout$:r})=>{function i(a,s){let u=a.maxX,l=a.minX;return l===u&&u===0&&(u=1),yt({maxValue:u,minValue:l,axisWidth:s.width,scaleDomain:["auto","auto"],scaleRange:[0,1]})}function o(a,s){let u=a.maxY,l=a.minY;return l===u&&u===0&&(u=1),yt({maxValue:u,minValue:l,axisWidth:s.height,scaleDomain:["auto","auto"],scaleRange:[0,1],reverse:!0})}return O({computedData:e,xyMinMax:t,xyValueIndex:n,layout:r}).pipe(U(async a=>a),T(a=>{const s=i(a.xyMinMax,a.layout),u=o(a.xyMinMax,a.layout);return a.computedData.map((l,c)=>l.map((h,f)=>({...h,axisX:s(h.multivariate[a.xyValueIndex[0]].value??0),axisY:u(h.multivariate[a.xyValueIndex[1]].value??0)})))}))},c8=({computedData$:e})=>e.pipe(T(t=>t.map(n=>n[0]?n[0].series:"")),H((t,n)=>JSON.stringify(t)===JSON.stringify(n))),f8=({computedData$:e})=>e.pipe(T(t=>t.map(n=>n.filter(r=>r.visible==!0)).filter(n=>n.length>0))),h8=({visibleComputedData$:e,xAxis$:t})=>O({visibleComputedData:e,xAxis:t}).pipe(T(n=>{let r=n.visibleComputedData[0]&&n.visibleComputedData[0][0]&&n.visibleComputedData[0][0].multivariate.length?n.visibleComputedData[0][0].multivariate.length-1:0;return[n.xAxis.scaleDomain[0]==="auto"||n.xAxis.scaleDomain[0]==="min"?0:n.xAxis.scaleDomain[0],n.xAxis.scaleDomain[1]==="auto"||n.xAxis.scaleDomain[1]==="max"?r:n.xAxis.scaleDomain[1]]}),H((n,r)=>n[0]===r[0]&&n[1]===r[1])),p8=({visibleComputedData$:e,ordinalScaleDomain$:t})=>O({visibleComputedData:e,ordinalScaleDomain:t}).pipe(T(n=>n.visibleComputedData.map(r=>r.map((i,o)=>{let a=i;return a.sum=a.multivariate.filter((s,u)=>u>=n.ordinalScaleDomain[0]&&u<=n.ordinalScaleDomain[1]).reduce((s,u)=>s+u.value,0),a})))),d8=({xyValueIndex$:e,isSeriesSeprate$:t,visibleComputedData$:n})=>O({isSeriesSeprate:t,xyValueIndex:e,visibleComputedData:n}).pipe(U(async r=>r),T(r=>{const i=r.xyValueIndex[0];return r.isSeriesSeprate?r.visibleComputedData.map(o=>o.sort((a,s)=>{const u=s.multivariate[i].value??-1/0,l=a.multivariate[i].value??-1/0;return u-l})):[r.visibleComputedData.flat().sort((o,a)=>{const s=a.multivariate[i].value??-1/0,u=o.multivariate[i].value??-1/0;return s-u})]})),g8=({isSeriesSeprate$:e,visibleComputedSumData$:t})=>O({isSeriesSeprate:e,visibleComputedSumData:t}).pipe(U(async n=>n),T(n=>n.isSeriesSeprate?n.visibleComputedSumData.map(r=>r.sort((i,o)=>o.sum-i.sum)):[n.visibleComputedSumData.flat().sort((r,i)=>i.sum-r.sum)])),m8=({computedXYData$:e})=>e.pipe(T(t=>t.map(n=>n.filter(r=>r.visible==!0)).filter(n=>n.length>0))),y8=({computedData$:e,pluginParams$:t,layout$:n})=>O({computedData:e,pluginParams:t,layout:n}).pipe(X(0),T(i=>{if(i.computedData.length===0)return[{slotIndex:0,rowIndex:0,columnIndex:0,translate:[0,0],scale:[1,1]}];if(i.pluginParams.separateSeries)return il(i.layout,i.pluginParams.container,i.computedData.length);{const o=il(i.layout,i.pluginParams.container,1);return i.computedData.map((a,s)=>o[0])}})),b8=({visibleComputedXYData$:e,xyMinMax$:t,xyValueIndex$:n,xAxis$:r,yAxis$:i})=>O({visibleComputedXYData:e,xyMinMax:t,xyValueIndex:n,xAxis:r,yAxis:i}).pipe(T(o=>{const{minX:a,maxX:s,minY:u,maxY:l}=(()=>{let{minX:g,maxX:m,minY:y,maxY:b}=o.xyMinMax;return o.xAxis.scaleDomain[0]==="auto"&&g>0?g=0:typeof o.xAxis.scaleDomain[0]=="number"&&(g=o.xAxis.scaleDomain[0]),o.xAxis.scaleDomain[1]==="auto"&&m<0?m=0:typeof o.xAxis.scaleDomain[1]=="number"&&(m=o.xAxis.scaleDomain[1]),o.yAxis.scaleDomain[0]==="auto"&&y>0?y=0:typeof o.yAxis.scaleDomain[0]=="number"&&(y=o.yAxis.scaleDomain[0]),o.yAxis.scaleDomain[1]==="auto"&&b<0?b=0:typeof o.yAxis.scaleDomain[1]=="number"&&(b=o.yAxis.scaleDomain[1]),{minX:g,maxX:m,minY:y,maxY:b}})();let c=[],h=null,f=null,p=null,d=null;for(let g of o.visibleComputedXYData)for(let m of g){const y=m.multivariate[o.xyValueIndex[0]].value,b=m.multivariate[o.xyValueIndex[1]].value;y>=a&&y<=s&&b>=u&&b<=l&&(c.push(m),(h==null||y<h.multivariate[o.xyValueIndex[0]].value)&&(h=m),(f==null||y>f.multivariate[o.xyValueIndex[0]].value)&&(f=m),(p==null||b<p.multivariate[o.xyValueIndex[1]].value)&&(p=m),(d==null||b>d.multivariate[o.xyValueIndex[1]].value)&&(d=m))}return{datumList:c,minXDatum:h,maxXDatum:f,minYDatum:p,maxYDatum:d}})),x8=({xyMinMax$:e,xyValueIndex$:t,filteredXYMinMaxData$:n,xAxis$:r,yAxis$:i,layout$:o})=>{const a=new ee;function s({xyMinMax:u,xyValueIndex:l,filteredXYMinMaxData:c,xAxis:h,yAxis:f,width:p,height:d}){let g=0,m=0,y=0,b=0,{minX:x,maxX:v,minY:_,maxY:w}=u,P=c.minXDatum.multivariate[l[0]].value??0,C=c.maxXDatum.multivariate[l[0]].value??0,L=c.minYDatum.multivariate[l[1]].value??0,E=c.maxYDatum.multivariate[l[1]].value??0;P===C&&C===0&&(C=1),L===E&&E===0&&(E=1),x===v&&v===0&&(v=1),_===w&&w===0&&(w=1);const N=yt({maxValue:C,minValue:P,axisWidth:p,scaleDomain:h.scaleDomain,scaleRange:h.scaleRange}),A=N(x>0?0:x),R=N(v<0?0:v);g=A,y=(R-A)/p;const M=yt({maxValue:E,minValue:L,axisWidth:d,scaleDomain:f.scaleDomain,scaleRange:f.scaleRange,reverse:!0}),$=M(_>0?0:_),B=M(w<0?0:w);return m=B,b=($-B)/d,{translate:[g,m],scale:[y,b],rotate:0,rotateX:0,rotateY:0,value:`translate(${g}px, ${m}px) scale(${y}, ${b})`}}return new de(u=>(O({xyMinMax:e,xyValueIndex:t,filteredXYMinMaxData:n,xAxis:r,yAxis:i,layout:o}).pipe(k(a),X(0)).subscribe(l=>{if(!l.filteredXYMinMaxData.minXDatum||!l.filteredXYMinMaxData.maxXDatum||l.filteredXYMinMaxData.minXDatum.multivariate[l.xyValueIndex[0]].value==null||l.filteredXYMinMaxData.maxXDatum.multivariate[l.xyValueIndex[0]].value==null||!l.filteredXYMinMaxData.minYDatum||!l.filteredXYMinMaxData.maxYDatum||l.filteredXYMinMaxData.minYDatum.multivariate[l.xyValueIndex[1]].value==null||l.filteredXYMinMaxData.maxYDatum.multivariate[l.xyValueIndex[1]].value==null)return;const c=s({xyMinMax:l.xyMinMax,xyValueIndex:l.xyValueIndex,filteredXYMinMaxData:l.filteredXYMinMaxData,xAxis:l.xAxis,yAxis:l.yAxis,width:l.layout.width,height:l.layout.height});u.next(c)}),function(){a.next(void 0)}))},v8=({containerPosition$:e,graphicTransform$:t})=>O({containerPosition:e,graphicTransform:t}).pipe(X(0),T(n=>n.containerPosition.map((r,i)=>[1/n.graphicTransform.scale[0]/n.containerPosition[i].scale[0],1/n.graphicTransform.scale[1]/n.containerPosition[i].scale[1]]))),S8=({visibleComputedSumData$:e,filteredXYMinMaxData$:t,xAxis$:n,containerSize$:r})=>O({visibleComputedSumData:e,xAxis:n,containerSize:r,filteredXYMinMaxData:t}).pipe(X(0),T(i=>{if(!i.filteredXYMinMaxData.minXDatum||!i.filteredXYMinMaxData.maxXDatum)return;let o=i.filteredXYMinMaxData.maxXDatum.multivariate[L1].value,a=i.filteredXYMinMaxData.minXDatum.multivariate[L1].value;return o===a&&o===0&&(o=1),yt({maxValue:o,minValue:a,axisWidth:i.containerSize.width,scaleDomain:i.xAxis.scaleDomain,scaleRange:i.xAxis.scaleRange})})),$8=({yAxis$:e,filteredXYMinMaxData$:t,containerSize$:n})=>O({yAxis:e,containerSize:n,filteredXYMinMaxData:t}).pipe(X(0),T(r=>{if(!r.filteredXYMinMaxData.minYDatum||!r.filteredXYMinMaxData.maxYDatum||r.filteredXYMinMaxData.minYDatum.multivariate[ol].value==null||r.filteredXYMinMaxData.maxYDatum.multivariate[ol].value==null)return;let i=r.filteredXYMinMaxData.maxYDatum.multivariate[ol].value,o=r.filteredXYMinMaxData.minYDatum.multivariate[ol].value;return i===o&&i===0&&(i=1),yt({maxValue:i,minValue:o,axisWidth:r.containerSize.height,scaleDomain:r.yAxis.scaleDomain,scaleRange:r.yAxis.scaleRange,reverse:!0})})),zf=({selection:e,pluginName:t,layerName:n,clipPathID:r,seriesLabels$:i,containerPosition$:o,graphicTransform$:a})=>{const s=Z(t,n,"category"),u=Z(t,n,"axes"),l=Z(t,n,"graphic"),c=i.pipe(T((d,g)=>e.selectAll(`g.${s}`).data(d,m=>m).join(m=>m.append("g").classed(s,!0).each((y,b,x)=>{I(x[b]).selectAll(`g.${u}`).data([b]).join(v=>v.append("g").classed(u,!0).attr("clip-path",`url(#${r})`).each((_,w,P)=>{I(P[w]).selectAll("defs").data([w]).join("defs"),I(P[w]).selectAll("g").data([w]).join("g").classed(l,!0)}),v=>v,v=>v.remove())}),m=>m,m=>m.remove())),W(1));O({seriesSelection:c,containerPosition:o}).pipe(X(0)).subscribe(d=>{d.seriesSelection.transition().attr("transform",(g,m)=>{const y=d.containerPosition[m]??d.containerPosition[0],b=y.translate,x=y.scale;return`translate(${b[0]}, ${b[1]}) scale(${x[0]}, ${x[1]})`})});const h=c.pipe(T(d=>d.select(`g.${u}`)),W(1)),f=h.pipe(T(d=>d.select("defs")),W(1)),p=O({axesSelection:h,graphicTransform:a}).pipe(X(0),T(d=>{const g=d.axesSelection.select(`g.${l}`);return g.transition().duration(50).style("transform",d.graphicTransform.value),g}),W(1));return{seriesSelection$:c,axesSelection$:h,defsSelection$:f,graphicGSelection$:p}},k1=({selection:e,pluginName:t,layerName:n,clipPathID:r,computedData$:i,containerPosition$:o,isSeriesSeprate$:a})=>{const s=Z(t,n,"container"),u=O({computedData:i.pipe(H((l,c)=>l.length===c.length)),isSeriesSeprate:a}).pipe(U(async l=>l),T(l=>l.isSeriesSeprate?l.computedData:[l.computedData[0]]),T((l,c)=>e.selectAll(`g.${s}`).data(l,h=>h&&h[0]?h[0].categoryIndex:c).join("g").classed(s,!0).attr("clip-path",h=>"none")),W(1));return O({containerSelection:u,gridContainerPosition:o}).pipe(X(0)).subscribe(l=>{l.containerSelection.attr("transform",(c,h)=>{const f=l.gridContainerPosition[h]??l.gridContainerPosition[0],p=f.translate;return f.scale,`translate(${p[0]}, ${p[1]})`})}),u},w8=({rootSelection:e,xAxis$:t,yAxis$:n,xyValueIndex$:r,filteredXYMinMaxData$:i,containerPosition$:o,containerSize$:a,layout$:s})=>{const u=pi(e,"mousemove").pipe(X(2)),l=new de(h=>{O({containerSize:a,filteredXYMinMaxData:i,xAxis:t,yAxis:n,xyValueIndex:r}).pipe(X(0)).subscribe(f=>{const[p,d]=f.xyValueIndex;if(!f.filteredXYMinMaxData.minXDatum||!f.filteredXYMinMaxData.maxXDatum||f.filteredXYMinMaxData.minXDatum.multivariate[p].value==null||f.filteredXYMinMaxData.maxXDatum.multivariate[p].value==null||!f.filteredXYMinMaxData.minYDatum||!f.filteredXYMinMaxData.maxYDatum||f.filteredXYMinMaxData.minYDatum.multivariate[d].value==null||f.filteredXYMinMaxData.maxYDatum.multivariate[d].value==null)return;const g=D1({maxValue:f.filteredXYMinMaxData.maxXDatum.multivariate[p].value,minValue:f.filteredXYMinMaxData.minXDatum.multivariate[p].value,axisWidth:f.containerSize.width,scaleDomain:f.xAxis.scaleDomain,scaleRange:f.xAxis.scaleRange}),m=D1({maxValue:f.filteredXYMinMaxData.maxYDatum.multivariate[d].value,minValue:f.filteredXYMinMaxData.minYDatum.multivariate[d].value,axisWidth:f.containerSize.height,scaleDomain:f.yAxis.scaleDomain,scaleRange:f.yAxis.scaleRange,reverse:!0});h.next({xScale:g,yScale:m})})}),c=O({rootMousemove:u,layout:s,containerPosition:o}).pipe(X(0),T(h=>{const f=(()=>{let d=h.rootMousemove.offsetX;const m=h.containerPosition.map((y,b)=>{var x;return[y.translate[0],((x=h.containerPosition[b+1])==null?void 0:x.translate[0])??h.layout.rootWidth]}).filter(y=>y[0]<y[1]).find(y=>d>=y[0]&&d<=y[1]);return m&&(d=d-m[0]),d-h.layout.left})(),p=(()=>{let d=h.rootMousemove.offsetY;const m=h.containerPosition.map((y,b)=>{var x;return[y.translate[1],((x=h.containerPosition[b+1])==null?void 0:x.translate[1])??h.layout.rootHeight]}).filter(y=>y[0]<y[1]).find(y=>d>=y[0]&&d<=y[1]);return m&&(d=d-m[0]),d-h.layout.top})();return{x:f,y:p}}));return O({xyScale:l,axisValue:c,containerPosition:o}).pipe(X(0),T(h=>({x:h.axisValue.x/h.containerPosition[0].scale[0],y:h.axisValue.y/h.containerPosition[0].scale[1],xValue:h.xyScale.xScale(h.axisValue.x),yValue:h.xyScale.yScale(h.axisValue.y)})))},_8=0,al=2,R1=3,T8=4,Dt=5,A8=6,Of=7,E1=8,D8=9,Pn="ScatterPlot",cn="Scatter";function M8({graphicGSelection:e,circleGClassName:t,circleClassName:n,visibleComputedXYData:r,layerParams:i,styles:o,theme:a,graphicReverseScale:s}){const u=h=>{const f=h.size();return o.transitionDuration/f};let l=0;return e.each((h,f,p)=>{I(p[f]).selectAll("g").data(r[f],d=>d.id).join(d=>(l=u(d),d.append("g").classed(t,!0)),d=>d,d=>d.remove()).attr("transform",d=>`translate(${d.axisX}, ${d.axisY})`).each((d,g,m)=>{I(m[g]).selectAll("circle").data([d]).join(y=>y.append("circle").style("cursor","pointer").style("vector-effect","non-scaling-stroke").classed(n,!0).attr("opacity",0).transition().delay((b,x)=>g*l).attr("opacity",1),y=>y.transition().duration(50).attr("opacity",1),y=>y.remove()).attr("r",i.radius).attr("fill",(y,b)=>Te({datum:y,colorType:i.fillColorType,theme:a})).attr("stroke",(y,b)=>Te({datum:y,colorType:i.strokeColorType,theme:a})).attr("stroke-width",i.strokeWidth).attr("transform",`scale(${s[f][0]??1}, ${s[f][1]??1})`)})}),e.selectAll(`circle.${n}`)}function P8({selection:e,ids:t,styles: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)?I(o[i]).style("opacity",1).transition("highlight").duration(200):I(o[i]).style("opacity",n.unhighlightedOpacity).transition("highlight").duration(200)})}function C8({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)=>{I(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 L8=G.defineSVGLayer({name:cn,defaultParams:Rh,layerIndex:Dt,initShow:!0,validator:e=>G.validateObject(e,{radius:{toBeTypes:["number"]},fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]}}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee;r.layout$.pipe(k(i)).subscribe(d=>{I(e).attr("transform",`translate(${d.left}, ${d.top})`)});const o=At(Pn,cn,"clipPath-box"),a=Z(Pn,cn,"circleG"),s=Z(Pn,cn,"circle"),{defsSelection$:u,graphicGSelection$:l}=zf({selection:I(e),pluginName:Pn,layerName:cn,clipPathID:o,seriesLabels$:r.seriesLabels$,containerPosition$:r.containerPosition$,graphicTransform$:r.graphicTransform$}),c=O({computedData:r.computedData$,graphicReverseScale:r.graphicReverseScale$}).pipe(k(i),X(0),T(d=>d.computedData.map((g,m)=>d.graphicReverseScale[m])));O({defsSelection:u,layout:r.layout$}).pipe(k(i),X(0)).subscribe(d=>{const g=[{id:o,width:d.layout.width,height:d.layout.height}];C8({defsSelection:d.defsSelection,clipPathData:g})});const h=O({graphicGSelection:l,visibleComputedXYData:r.visibleComputedXYData$,layerParams:n,graphicReverseScale:c,styles:t.pipe(T(d=>d.styles)),theme:r.theme$}).pipe(k(i),X(0),T(d=>M8({graphicGSelection:d.graphicGSelection,circleGClassName:a,circleClassName:s,visibleComputedXYData:d.visibleComputedXYData,layerParams:d.layerParams,styles:d.styles,theme:d.theme,graphicReverseScale:d.graphicReverseScale}))),f=r.valueLabels$.pipe(k(i),T(d=>[d[0]??"X",d[1]??"Y"]),H((d,g)=>d[0]===g[0]&&d[1]===g[1])),p=t.pipe(k(i),T(d=>d.styles.highlightTarget),H());return O({graphicSelection:h,computedData:r.computedData$,highlightTarget:p,valueLabels:f}).pipe(k(i),X(0)).subscribe(d=>{d.graphicSelection.on("mouseover",(g,m)=>{r.eventTrigger$.next({eventName:"mouseover",pluginName:Pn,layerName:cn,target:m,event:g})}).on("mousemove",(g,m)=>{r.eventTrigger$.next({eventName:"mousemove",pluginName:Pn,layerName:cn,target:m,event:g})}).on("mouseout",(g,m)=>{r.eventTrigger$.next({eventName:"mouseout",pluginName:Pn,layerName:cn,target:m,event:g})}).on("click",(g,m)=>{r.eventTrigger$.next({eventName:"click",pluginName:Pn,layerName:cn,target:m,event:g})})}),O({graphicSelection:h,highlight:r.highlight$.pipe(T(d=>d.map(g=>g.id))),styles:t.pipe(T(d=>d.styles))}).pipe(k(i),U(async d=>d)).subscribe(d=>{P8({selection:d.graphicSelection,ids:d.highlight,styles:d.styles})}),()=>{i.next(void 0)}}}),Cn="ScatterPlot",fn="ScatterBubbles",k8=.9;function R8({graphicGSelection:e,circleGClassName:t,circleClassName:n,bubbleData:r,layerParams:i,styles:o,theme:a,graphicReverseScale:s}){const u=h=>{const f=h.size();return o.transitionDuration/f};let l=0;return e.each((h,f,p)=>{I(p[f]).selectAll("g").data(r[f],d=>d.id).join(d=>(l=u(d),d.append("g").classed(t,!0)),d=>d,d=>d.remove()).attr("transform",d=>`translate(${d.axisX}, ${d.axisY})`).each((d,g,m)=>{I(m[g]).selectAll("circle").data([d]).join(y=>y.append("circle").style("cursor","pointer").style("vector-effect","non-scaling-stroke").classed(n,!0).attr("opacity",0).transition().delay((b,x)=>g*l).attr("opacity",b=>b.opacity),y=>y.transition().duration(50).attr("opacity",b=>b.opacity),y=>y.remove()).attr("r",y=>y.r).attr("fill",(y,b)=>Te({datum:y,colorType:i.fillColorType,theme:a})).attr("stroke",(y,b)=>Te({datum:y,colorType:i.strokeColorType,theme:a})).attr("stroke-width",i.strokeWidth).attr("transform",`scale(${s[f][0]??1}, ${s[f][1]??1})`)})}),e.selectAll(`circle.${n}`)}function E8({selection:e,ids:t,styles: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)?I(o[i]).style("opacity",s=>s.opacity).transition("highlight").duration(200):I(o[i]).style("opacity",n.unhighlightedOpacity).transition("highlight").duration(200)})}function N8({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)=>{I(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 B8=G.defineSVGLayer({name:fn,defaultParams:Eh,layerIndex:A8,initShow:!1,validator:e=>G.validateObject(e,{fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},valueLinearOpacity:{toBeTypes:["number[]"]},arcScaleType:{toBe:"ArcScaleType",test:n=>n==="area"||n==="radius"},sizeAdjust:{toBeTypes:["number"]}}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee;r.layout$.pipe(k(i)).subscribe(w=>{I(e).attr("transform",`translate(${w.left}, ${w.top})`)});const o=At(Cn,fn,"clipPath-box"),a=Z(Cn,fn,"circleG"),s=Z(Cn,fn,"circle"),{defsSelection$:u,graphicGSelection$:l}=zf({selection:I(e),pluginName:Cn,layerName:fn,clipPathID:o,seriesLabels$:r.seriesLabels$,containerPosition$:r.containerPosition$,graphicTransform$:r.graphicTransform$}),c=O({computedData:r.computedData$,graphicReverseScale:r.graphicReverseScale$}).pipe(k(i),X(0),T(w=>w.computedData.map((P,C)=>w.graphicReverseScale[C])));O({defsSelection:u,layout:r.layout$}).pipe(k(i),X(0)).subscribe(w=>{const P=[{id:o,width:w.layout.width,height:w.layout.height}];N8({defsSelection:w.defsSelection,clipPathData:P})});const h=r.filteredXYMinMaxData$.pipe(k(i),T(w=>w.datumList.flat().map(P=>{var C;return((C=P.multivariate[2])==null?void 0:C.value)??0})),W(1)),f=r.filteredXYMinMaxData$.pipe(k(i),T(w=>Sr(w.datumList.flat().map(P=>{var C;return((C=P.multivariate[2])==null?void 0:C.value)??0})))),p=O({filteredMinMaxValue:f,layerParams:n}).pipe(k(i),X(0),T(w=>Et().domain(w.filteredMinMaxValue).range(w.layerParams.valueLinearOpacity))),d=O({layout:r.layout$,layerParams:n}).pipe(k(i),T(w=>Math.min(w.layout.width,w.layout.height)/2*w.layerParams.sizeAdjust)),g=h.pipe(k(i),T(w=>w.reduce((P,C)=>P+C,0)),Ut(w=>w>0)),m=O({totalR:d,totalValue:g,layerParams:n}).pipe(k(i),X(0),T(w=>_n().domain([0,w.totalValue]).range([0,w.totalR]).exponent(w.layerParams.arcScaleType==="area"?.5:1))),y=O({radiusScale:m,layerParams:n,totalR:d,filteredValueList:h}).pipe(k(i),X(0),T(w=>w.layerParams.arcScaleType==="area"?1:(()=>{const P=w.totalR*w.totalR*Math.PI;return Math.sqrt(P/Il(w.filteredValueList,C=>Math.PI*Math.pow(w.radiusScale(C),2)))})())),b=O({visibleComputedXYData:r.visibleComputedXYData$,opacityScale:p,radiusScale:m,scaleFactor:y,layerParams:n}).pipe(k(i),X(0),T(w=>w.visibleComputedXYData.map(P=>P.map(C=>{const L=C;return L.r=w.radiusScale(L.multivariate[2].value)*w.scaleFactor*k8,L.opacity=w.opacityScale(L.multivariate[2].value),L})))),x=O({graphicGSelection:l,bubbleData:b,graphicReverseScale:c,theme:r.theme$,styles:t.pipe(T(w=>w.styles)),layerParams:n}).pipe(k(i),X(0),T(w=>R8({graphicGSelection:w.graphicGSelection,circleGClassName:a,circleClassName:s,bubbleData:w.bubbleData,layerParams:w.layerParams,styles:w.styles,theme:w.theme,graphicReverseScale:w.graphicReverseScale}))),v=r.encoding$.pipe(k(i),T(w=>[w.multivariate[0].name??"X",w.multivariate[1].name??"Y",w.multivariate[2].name??"Value"]),H((w,P)=>w[0]===P[0]&&w[1]===P[1]&&w[2]===P[2])),_=t.pipe(k(i),T(w=>w.styles.highlightTarget),H());return O({graphicSelection:x,computedData:r.computedData$,highlightTarget:_,valueLabels:v}).pipe(k(i),X(0)).subscribe(w=>{w.graphicSelection.on("mouseover",(P,C)=>{r.eventTrigger$.next({eventName:"mouseover",pluginName:Cn,layerName:fn,target:C,event:P})}).on("mousemove",(P,C)=>{r.eventTrigger$.next({eventName:"mousemove",pluginName:Cn,layerName:fn,target:C,event:P})}).on("mouseout",(P,C)=>{r.eventTrigger$.next({eventName:"mouseout",pluginName:Cn,layerName:fn,target:C,event:P})}).on("click",(P,C)=>{r.eventTrigger$.next({eventName:"click",pluginName:Cn,layerName:fn,target:C,event:P})})}),O({graphicSelection:x,highlight:r.highlight$.pipe(T(w=>w.map(P=>P.id))),styles:t.pipe(T(w=>w.styles))}).pipe(k(i),U(async w=>w)).subscribe(w=>{E8({selection:w.graphicSelection,ids:w.highlight,styles:w.styles})}),()=>{i.next(void 0)}}});function N1(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 u(p){var g;const d=document.createElement("canvas").getContext("2d");return((g=d==null?void 0:d.measureText(p))==null?void 0:g.width)??0}function l(p){const d=u(p.trim());return Math.sqrt(d*r)}function c(p,d){let g={width:0,text:""},m=1/0;const y=[];let b=" ";i&&(b="");for(let x=0,v=p.length;x<v;++x){const _=(g.text?g.text+b:"")+p[x],w=u(_);(m+w)/2<d?(g.width=m=w,g.text=_):(m=u(p[x]),g={width:m,text:p[x]},y.push(g))}return y}function h(p){let d=0;for(let g=0,m=p.length;g<m;++g){const y=(Math.abs(g-m/2+.5)+.5)*r,b=p[g].width/2;d=Math.max(d,Math.sqrt(b**2+y**2))}return d}function f(p,d){o>0&&(d=s(d,o));const g=a(d),m=l(d),y=c(g,m),b=h(y);let x=p.select("text");x.size()||(x=p.append("text")),x.attr("transform",`translate(0,0) scale(${n/b})`);const v=x.selectAll("tspan").data(y),_=v.enter().append("tspan").attr("x",0).merge(v).attr("y",(w,P)=>(P-y.length/2+.8)*r).text(w=>w.text);return v.exit().remove(),v.merge(_)}return f(e,t)}function If(e,{textArr:t,textSizePx:n,categoryAxisPosition:r,isContainerRotated:i}){e.text(null);const o=Number(e.attr("x"));let a=Number(e.attr("y"));i&&r==="top"&&(a-=(t.length-1)*n),e.selectAll("tspan").data(t).join("tspan").attr("x",o).attr("y",(s,u)=>a+u*n).text(s=>s)}function B1(e,{textArr:t,fontSizePx: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 sl="ScatterPlot",Do="XYAux",Ff=Z(sl,Do,"label-box");function z8({axisX:e,axisY:t,layout:n,layerParams: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 O8({axisX:e,axisY:t,xValue:n,yValue:r,layerParams:i,fontSizePx:o,layout:a,columnAmount:s,rowAmount:u}){if(!(e>=0&&e<=a.width&&t>=0&&t<=a.height))return[];const l=6,c=3,h=e,f=a.height+i.xAxis.labelPadding*u,p=fr(n,i.xAxis.labelTextFormat),d=p.split(`
|
|
56
|
+
`),g=d.reduce((j,K)=>K.length>j.length?K:j,""),m=mi(g,o),y=o*d.length,b=m+l*2,x=y+c*2,v=-b/2,_=-c,w=v+l,P=_+c,C=-(i.yAxis.labelPadding*s),L=t,E=fr(r,i.yAxis.labelTextFormat),N=E.split(`
|
|
57
|
+
`),A=N.reduce((j,K)=>K.length>j.length?K:j,""),R=mi(A,o),S=o*N.length,M=R+l*2,$=S+c*2,B=-R-l,D=-c-S/2,z=B+l,F=D+c;return[{id:"label-x",x:h,y:f,text:p,textArr:d,textWidth:m,textHeight:y,colorType:i.xAxis.labelColorType,textColorType:i.xAxis.labelTextColorType,rectWidth:b,rectHeight:x,rectX:v,rectY:_,textX:w,textY:P},{id:"label-y",x:C,y:L,text:E,textArr:N,textWidth:R,textHeight:S,colorType:i.yAxis.labelColorType,textColorType:i.xAxis.labelTextColorType,rectWidth:M,rectHeight:$,rectX:B,rectY:D,textX:z,textY:F}]}function I8({selection:e,pluginName:t,lineData:n,theme:r}){const i=Z(t,Do,"auxline");return e.selectAll(`line.${i}`).data(n).join(a=>a.append("line").classed(i,!0).style("stroke-width",1).style("pointer-events","none").style("vector-effect","non-scaling-stroke").attr("x1",s=>s.x1).attr("y1",s=>s.y1).attr("x2",s=>s.x2).attr("y2",s=>s.y2),a=>a.transition().duration(50).attr("x1",u=>u.x1).attr("y1",u=>u.y1).attr("x2",u=>u.x2).attr("y2",u=>u.y2),a=>a.remove()).style("stroke",a=>xe(a.colorType,r)).style("stroke-dasharray",a=>a.dashArray)}function F8(e){e.selectAll("line").data([]).exit().remove()}function Y8({selection:e,labelData:t,layerParams:n,theme:r,textReverseTransform:i,fontSizePx:o}){return e.selectAll(`g.${Ff}`).data(t).join(s=>s.append("g").classed(Ff,!0).style("cursor","pointer").attr("transform",(u,l)=>`translate(${u.x}, ${u.y})`),s=>s.transition().duration(50).attr("transform",(l,c)=>`translate(${l.x}, ${l.y})`),s=>s.remove()).each((s,u,l)=>{I(l[u]).selectAll("rect").data([s]).join(c=>c.append("rect").style("cursor","pointer").attr("rx",5).attr("ry",5),c=>c,c=>c.remove()).attr("width",c=>`${c.rectWidth}px`).attr("height",c=>`${c.rectHeight}px`).attr("fill",c=>xe(c.colorType,r)).attr("x",c=>c.rectX).attr("y",c=>c.rectY).style("transform",i),I(l[u]).selectAll("text").data([s]).join(c=>c.append("text").style("dominant-baseline","hanging").style("cursor","pointer").style("pointer-events","none"),c=>c,c=>c.remove()).style("transform",i).attr("fill",c=>xe(c.textColorType,r)).attr("font-size",r.fontSize).attr("x",c=>c.textX).attr("y",c=>c.textY).each((c,h,f)=>{If(I(f[h]),{textArr:s.textArr,textSizePx:o,categoryAxisPosition:h===0?"bottom":"left",isContainerRotated:!1})})})}function W8(e){e.selectAll(`g.${Ff}`).data([]).exit().remove()}const X8=G.defineSVGLayer({name:Do,defaultParams:Yo,layerIndex:R1,initShow:!0,validator:e=>{const t=G.validateObject(e,{xAxis:{toBeTypes:["object"]},yAxis:{toBeTypes:["object"]}});if(e.xAxis){const n=G.validateObject(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(n.status==="error")return n}if(e.yAxis){const n=G.validateObject(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(n.status==="error")return n}return t},setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee;r.layout$.pipe(k(i)).subscribe(p=>{I(e).attr("transform",`translate(${p.left}, ${p.top})`)});const o=I(r.svg),a=o.insert("rect","g").classed(Z(sl,Do,"rect"),!0).attr("opacity",0),{axesSelection$:s}=zf({selection:I(e),pluginName:sl,layerName:Do,clipPathID:"XYAuxClipPath",seriesLabels$:r.isSeriesSeprate$.pipe(U(p=>Nn(()=>p,r.seriesLabels$,r.seriesLabels$.pipe(T(d=>[d[0]]))))),containerPosition$:r.containerPosition$,graphicTransform$:r.graphicTransform$});r.layout$.pipe(k(i)).subscribe(p=>{a.attr("width",p.rootWidth).attr("height",p.rootHeight)});const u=r.containerPosition$.pipe(T(p=>p.reduce((g,m)=>m.columnIndex>g?m.columnIndex:g,0)+1),H()),l=r.containerPosition$.pipe(T(p=>p.reduce((g,m)=>m.rowIndex>g?m.rowIndex:g,0)+1),H()),c=r.containerPosition$.pipe(k(i),X(0),T(p=>`${`scale(${1/p[0].scale[0]}, ${1/p[0].scale[1]})`}`),H()),h=w8({rootSelection:o,xAxis$:r.zoomedXAxis$,yAxis$:r.yAxis$,xyValueIndex$:r.xyValueIndex$,filteredXYMinMaxData$:r.filteredXYMinMaxData$,containerPosition$:r.containerPosition$,containerSize$:r.containerSize$,layout$:r.layout$}).pipe(k(i));O({axesSelection:s,layout:r.layout$,xyPosition:h,layerParams:n,theme:r.theme$,textReverseTransform:c,fontSizePx:r.fontSizePx$,columnAmount:u,rowAmount:l}).pipe(k(i),X(0)).subscribe(p=>{const{x:d,y:g,xValue:m,yValue:y}=p.xyPosition,b=z8({axisX:d,axisY:g,layout:p.layout,layerParams:p.layerParams});I8({selection:p.axesSelection,pluginName:sl,lineData:b,theme:p.theme});const x=O8({axisX:d,axisY:g,xValue:m,yValue:y,layerParams:p.layerParams,fontSizePx:p.fontSizePx,layout:p.layout,columnAmount:p.columnAmount,rowAmount:p.rowAmount});Y8({selection:p.axesSelection,labelData:x,layerParams:p.layerParams,theme:p.theme,textReverseTransform:p.textReverseTransform,fontSizePx:p.fontSizePx})});const f=pi(a,"mouseout").pipe(k(i));return O({rootRectMouseout:f,axesSelection:s}).pipe(k(i),X(0)).subscribe(p=>{setTimeout(()=>{F8(p.axesSelection),W8(p.axesSelection)})}),()=>{i.next(void 0),a.remove()}}}),G8=6,V8="middle",j8="hanging",U8="start",H8="hanging";function q8({selection:e,position:t,xLabelClassName:n,layerParams:r,containerSize:i,xAxis:o,theme:a}){let u=r.tickPadding+r.labelOffset[0],l,c;t==="top"?(l=0,c=-r.tickPadding-r.labelOffset[1]):(l=i.height,c=r.tickPadding+r.labelOffset[1]);let h=c;e.selectAll(`g.${n}`).data([r]).join("g").classed(n,!0).each((f,p,d)=>{I(d[p]).selectAll("text").data([f]).join(g=>g.append("text").style("font-weight","bold"),g=>g,g=>g.remove()).attr("text-anchor",U8).attr("dominant-baseline",H8).attr("font-size",a.fontSize).style("fill",xe(r.labelColorType,a)).attr("x",u).attr("y",h).text(g=>o.label)}).attr("transform",f=>`translate(${i.width}, ${l})`)}function Z8({selection:e,position:t,xAxisClassName:n,layerParams:r,containerSize:i,theme:o,xScale:a,transitionDuration:s}){let u,l;t==="top"?(u=0,l=Yl(a)):(u=i.height,l=up(a));const c=e.selectAll(`g.${n}`).data([r]).join("g").classed(n,!0).attr("transform",`translate(0, ${u})`);let h=r.tickPadding;const f=l.scale(a).ticks(r.ticks).tickFormat(g=>fr(g,r.tickFormat)).tickSize(r.tickFullLine==!0?-i.height:G8).tickSizeOuter(-i.height).tickPadding(h),p=c.transition().duration(s).ease(Bi).call(f);return p.selectAll("line").style("fill","none").style("stroke",r.tickLineVisible==!0?xe(r.tickColorType,o):"none").style("stroke-dasharray",r.tickFullLineDasharray).attr("pointer-events","none"),p.selectAll("path").style("fill","none").style("stroke",r.axisLineVisible==!0?xe(r.axisLineColorType,o):"none").style("shape-rendering","crispEdges"),c.selectAll("text").attr("font-size",o.fontSize).style("color",xe(r.tickTextColorType,o)).attr("text-anchor",V8).attr("dominant-baseline",j8).attr("dy",0),c}const J8=({selection:e,pluginName:t,layerName:n,position$:r,computedData$:i,layerParams$:o,xAxis$:a,theme$:s,isSeriesSeprate$:u,containerPosition$:l,containerSize$:c,xScale$:h,transitionDuration$:f})=>{const p=new ee,d=Z(t,n,"xAxisG"),g=Z(t,n,"xAxis"),m=Z(t,n,"xLabel"),b=k1({selection:e,pluginName:t,layerName:n,clipPathID:null,computedData$:i,containerPosition$:l,isSeriesSeprate$:u}).pipe(k(p)).pipe(k(p),T((x,v)=>x.selectAll(`g.${d}`).data([d]).join("g").classed(d,!0)));return O({axisSelection:b,position:r,layerParams:o,computedData:i,containerSize:c,xAxis:a,theme:s,xScale:h,transitionDuration:f}).pipe(k(p),U(async x=>x)).subscribe(x=>{Z8({selection:x.axisSelection,position:x.position,xAxisClassName:g,layerParams:x.layerParams,theme:x.theme,containerSize:x.containerSize,xScale:x.xScale,transitionDuration:x.transitionDuration}),q8({selection:x.axisSelection,position:x.position,xLabelClassName:m,layerParams:x.layerParams,containerSize:x.containerSize,xAxis:x.xAxis,theme:x.theme})}),()=>{p.next(void 0)}},K8=6,Q8="end",eC="middle",tC="end",nC="auto";function rC({selection:e,yLabelClassName:t,layerParams:n,yAxis:r,theme:i}){const o=n.tickPadding-n.labelOffset[0],a=n.tickPadding+n.labelOffset[1];let s=-o,u=-a;e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0).each((l,c,h)=>{I(h[c]).selectAll("text").data([l]).join(f=>f.append("text").style("font-weight","bold"),f=>f,f=>f.remove()).attr("text-anchor",tC).attr("dominant-baseline",nC).attr("font-size",i.fontSize).style("fill",xe(n.labelColorType,i)).attr("x",s).attr("y",u).text(f=>r.label)})}function iC({selection:e,yAxisClassName:t,layerParams:n,containerSize:r,theme:i,yScale:o}){const a=e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0);let s=n.tickPadding;const u=Wl(o).scale(o).ticks(n.ticks).tickFormat(c=>fr(c,n.tickFormat)).tickSize(n.tickFullLine==!0?-r.width:K8).tickPadding(s),l=a.transition().duration(100).ease(Bi).call(u);return l.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?xe(n.tickColorType,i):"none").style("stroke-dasharray",n.tickFullLineDasharray).attr("pointer-events","none"),l.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?xe(n.axisLineColorType,i):"none").style("shape-rendering","crispEdges"),a.selectAll("text").attr("font-size",i.fontSize).style("color",xe(n.tickTextColorType,i)).attr("text-anchor",Q8).attr("dominant-baseline",eC).attr("x",-s).attr("dy",0),a}const oC=({selection:e,pluginName:t,layerName:n,computedData$:r,layerParams$:i,yAxis$:o,theme$:a,isSeriesSeprate$:s,containerPosition$:u,containerSize$:l,yScale$:c})=>{const h=new ee,f=Z(t,n,"yAxisG"),p=Z(t,n,"yAxis"),d=Z(t,n,"yLabel"),m=k1({selection:e,pluginName:t,layerName:n,clipPathID:null,computedData$:r,containerPosition$:u,isSeriesSeprate$:s}).pipe(k(h)).pipe(k(h),T((y,b)=>y.selectAll(`g.${f}`).data([f]).join("g").classed(f,!0)));return O({axisSelection:m,layerParams:i,computedData:r,containerSize:l,yAxis:o,yScale:c,theme:a}).pipe(k(h),U(async y=>y)).subscribe(y=>{iC({selection:y.axisSelection,yAxisClassName:p,layerParams:y.layerParams,containerSize:y.containerSize,theme:y.theme,yScale:y.yScale}),rC({selection:y.axisSelection,yLabelClassName:d,layerParams:y.layerParams,yAxis:y.yAxis,theme:y.theme})}),()=>{h.next(void 0)}},z1="ScatterPlot",Yf="XYAxes",aC=G.defineSVGLayer({name:Yf,defaultParams:Wo,layerIndex:al,initShow:!0,validator:e=>{const t=G.validateObject(e,{xAxis:{toBeTypes:["object"]},yAxis:{toBeTypes:["object"]}});if(e.xAxis){const n=G.validateObject(e.xAxis,{labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextColorType:{toBeOption:"ColorType"}});if(n.status==="error")return n}if(e.yAxis){const n=G.validateObject(e.yAxis,{labelOffset:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBeTypes:["number","null"]},tickFormat:{toBeTypes:["string","Function"]},tickLineVisible:{toBeTypes:["boolean"]},tickPadding:{toBeTypes:["number"]},tickFullLine:{toBeTypes:["boolean"]},tickFullLineDasharray:{toBeTypes:["string"]},tickColorType:{toBeOption:"ColorType"},tickTextColorType:{toBeOption:"ColorType"}});if(n.status==="error")return n}return t},setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee;r.layout$.pipe(k(i)).subscribe(l=>{I(e).attr("transform",`translate(${l.left}, ${l.top})`)});const o=n.pipe(k(i),T(l=>l.xAxis),H((l,c)=>JSON.stringify(l)===JSON.stringify(c))),a=n.pipe(k(i),T(l=>l.yAxis),H((l,c)=>JSON.stringify(l)===JSON.stringify(c))),s=J8({selection:I(e),pluginName:z1,layerName:`${Yf}-x`,position$:Io("bottom"),transitionDuration$:Io(100),computedData$:r.computedData$,layerParams$:o,theme$:r.theme$,xAxis$:r.zoomedXAxis$,isSeriesSeprate$:r.isSeriesSeprate$,containerPosition$:r.containerPosition$,containerSize$:r.containerSize$,xScale$:r.xScale$}),u=oC({selection:I(e),pluginName:z1,layerName:`${Yf}-y`,computedData$:r.computedData$,layerParams$:a,theme$:r.theme$,yAxis$:r.yAxis$,isSeriesSeprate$:r.isSeriesSeprate$,containerPosition$:r.containerPosition$,containerSize$:r.containerSize$,yScale$:r.yScale$});return()=>{i.next(void 0),s(),u()}}}),sC=({rootSelection:e,pluginName:t,layerName:n,initXAxis$:r,initYAxis$:i,xyMinMax$:o,layout$:a,eventTrigger$:s})=>{const u=new ee;let l={k:1,x:0,y:0};const c=new de(f=>{O({initXAxis:r,layout:a,xyMinMax:o}).pipe(k(u),X(0)).subscribe(p=>{const d=yt({maxValue:p.xyMinMax.maxX,minValue:p.xyMinMax.minX,axisWidth:p.layout.width,scaleDomain:p.initXAxis.scaleDomain,scaleRange:p.initXAxis.scaleRange});f.next(d)})}),h=O({initXAxis:r,initYAxis:i,xyMinMax:o}).pipe(k(u),X(0),T(f=>{let p=f.xyMinMax.minX,d=f.xyMinMax.maxX,g=f.xyMinMax.minY,m=f.xyMinMax.maxY;return f.initXAxis.scaleDomain[0]==="auto"&&p>0&&(p=0),f.initXAxis.scaleDomain[1]==="auto"&&d<0&&(d=0),f.initYAxis.scaleDomain[0]==="auto"&&g>0&&(g=0),f.initYAxis.scaleDomain[1]==="auto"&&m<0&&(m=0),{minX:p,maxX:d,minY:g,maxY:m}}));return O({initXScale:c,minMaxScaleDomain:h}).pipe(k(u),X(0)).subscribe(f=>{const p=f.initXScale.copy(),d=un().on("zoom",function(m){const y=m.transform,b=v=>{const _=Math.round(v);return Math.min(f.minMaxScaleDomain.maxX,Math.max(f.minMaxScaleDomain.minX,_))},x=y.rescaleX(p).domain().map(b);x[0]<=f.minMaxScaleDomain.minX&&x[1]>=f.minMaxScaleDomain.maxX?y.k<l.k&&(y.k=l.k,y.x=l.x,y.y=l.y):x[1]-x[0]<=1&&y.k>l.k&&(y.k=l.k,y.x=l.x,y.y=l.y),l.k=y.k,l.x=y.x,l.y=y.y,s.next({eventName:"zoom",pluginName:t,layerName:n,target:null,data:{scaleDomain:x}})});e.call(d)}),()=>{u.next(void 0),e.call(un().on("zoom",null))}},lC="ScatterPlot",O1="XZoom",uC=G.defineSVGLayer({name:O1,defaultParams:Nh,layerIndex:al,initShow:!0,validator:e=>({status:"success",columnName:"",expectToBe:""}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee,o=sC({rootSelection:I(r.svg),pluginName:lC,layerName:O1,initXAxis$:t.pipe(T(a=>a.xAxis)),initYAxis$:t.pipe(T(a=>a.yAxis)),xyMinMax$:r.xyMinMax$,layout$:r.layout$,eventTrigger$:r.eventTrigger$});return()=>{i.next(void 0),o()}}}),cC=new L8,fC=new B8,hC=new X8,pC=new aC,dC=new uC,gC=G.defineSVGPlugin({name:"ScatterPlot",defaultParams:Ml,layers:[cC,fC,hC,pC,dC],setup:e=>{const t=new hi(void 0);e.context.event$.subscribe(S=>{S.eventName==="zoom"&&S.data&&S.data.scaleDomain&&t.next(S.data.scaleDomain)});const n=e.pluginParams$.pipe(U(({xAxis:S})=>t.pipe(T(M=>M?{...S,scaleDomain:M}:S))),W(1)),r=e.pluginParams$.pipe(T(S=>S.yAxis),W(1)),i=O({multivariateData:e.context.multivariateData$,datasetIndex:e.pluginParams$.pipe(T(S=>S.datasetIndex))}).pipe(X(0),T(({multivariateData:S,datasetIndex:M})=>S[M]),W(1)),o=Bn({size$:e.context.size$,padding$:e.pluginParams$.pipe(T(S=>S.styles.padding))}).pipe(W(1)),a=o8({selectedMultivariateData$:i,pluginParams$:e.pluginParams$}).pipe(W(1)),s=dn(e.context.theme$).pipe(W(1)),u=e.pluginParams$.pipe(T(S=>S.separateSeries),H(),W(1)),l=y8({computedData$:a,pluginParams$:e.pluginParams$,layout$:o}).pipe(W(1)),c=Bh({layout$:o,containerPosition$:l,container$:e.pluginParams$.pipe(T(S=>S.container))}).pipe(W(1)),h=e.context.encoding$.pipe(T(S=>[0,1]),H((S,M)=>S[0]===M[0]&&S[1]===M[1]),W(1)),f=a.pipe(T(S=>S.flat())).pipe(W(1)),p=vr({datumList$:f,styles$:e.pluginParams$.pipe(T(S=>S.styles)),event$:e.context.event$}).pipe(W(1)),d=c8({computedData$:a}),g=di({datumList$:f}).pipe(W(1)),m=s8({encoding$:e.context.encoding$}).pipe(W(1)),y=l8({computedData$:a,xyValueIndex$:h}).pipe(W(1)),b=f8({computedData$:a}).pipe(W(1)),x=h8({xAxis$:n,visibleComputedData$:b}).pipe(W(1)),v=p8({visibleComputedData$:b,ordinalScaleDomain$:x}).pipe(W(1)),_=d8({isSeriesSeprate$:u,visibleComputedData$:b,xyValueIndex$:h}).pipe(W(1));g8({isSeriesSeprate$:u,visibleComputedSumData$:v}).pipe(W(1));const w=u8({computedData$:a,xyMinMax$:y,xyValueIndex$:h,layout$:o}).pipe(W(1)),P=m8({computedXYData$:w}).pipe(W(1)),C=b8({visibleComputedXYData$:P,xyMinMax$:y,xyValueIndex$:h,xAxis$:n,yAxis$:r}).pipe(W(1)),L=x8({xyMinMax$:y,xyValueIndex$:h,filteredXYMinMaxData$:C,xAxis$:n,yAxis$:r,layout$:o}).pipe(W(1)),E=v8({containerPosition$:l,graphicTransform$:L}).pipe(W(1)),N=S8({visibleComputedSumData$:v,xAxis$:n,filteredXYMinMaxData$:C,containerSize$:c}).pipe(W(1)),A=$8({yAxis$:r,filteredXYMinMaxData$:C,containerSize$:c}).pipe(W(1)),R={layout$:o,computedData$:a,fontSizePx$:s,isSeriesSeprate$:u,containerPosition$:l,containerSize$:c,highlight$:p,seriesLabels$:d,SeriesDataMap$:g,valueLabels$:m,xyMinMax$:y,xyValueIndex$:h,filteredXYMinMaxData$:C,visibleComputedData$:b,visibleComputedRankingByIndexData$:_,visibleComputedXYData$:P,graphicTransform$:L,graphicReverseScale$:E,xScale$:N,yScale$:A,zoomedXAxis$:n,yAxis$:r};return e.context={...e.context,...R},()=>{}},validator:e=>{const t=G.validateObject(e,{styles:{toBeTypes:["object"]},visibleFilter:{toBeTypes:["Function"]},container:{toBeTypes:["object"]},xAxis:{toBeTypes:["object"]},yAxis:{toBeTypes:["object"]},separateSeries:{toBeTypes:["boolean"]},datasetIndex:{toBeTypes:["number"]}});if(t.status==="error")return t;if(e.styles){const n=G.validateObject(e.styles,{padding:{toBeTypes:["object"]},highlightTarget:{toBeTypes:["string"]},highlightDefault:{toBeTypes:["string","null"]},unhighlightedOpacity:{toBeTypes:["number"]},transitionDuration:{toBeTypes:["number"]},transitionEase:{toBeTypes:["string"]}});if(n.status==="error")return n;if(e.styles.padding){const r=G.validateObject(e.styles.padding,{top:{toBeTypes:["number"]},right:{toBeTypes:["number"]},bottom:{toBeTypes:["number"]},left:{toBeTypes:["number"]}});if(r.status==="error")return r}}if(e.container){const n=G.validateObject(e.container,{columnAmount:{toBeTypes:["number"]},rowAmount:{toBeTypes:["number"]},columnGap:{toBe:'number | "auto"',test:r=>typeof r=="number"||r==="auto"},rowGap:{toBe:'number | "auto"',test:r=>typeof r=="number"||r==="auto"}});if(n.status==="error")return n}if(e.yAxis){const n=G.validateObject(e.yAxis,{scaleDomain:{toBe:'[number | "min" | "auto", number | "max" | "auto"]',test:r=>Array.isArray(r)&&r.length===2&&(typeof r[0]=="number"||r[0]==="min"||r[0]==="auto")&&(typeof r[1]=="number"||r[1]==="max"||r[1]==="auto")},scaleRange:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},label:{toBeTypes:["string"]}});if(n.status==="error")return n}if(e.xAxis){const n=G.validateObject(e.xAxis,{scaleDomain:{toBe:'[number | "min" | "auto", number | "max" | "auto"]',test:r=>Array.isArray(r)&&r.length===2&&(typeof r[0]=="number"||r[0]==="min"||r[0]==="auto")&&(typeof r[1]=="number"||r[1]==="max"||r[1]==="auto")},scaleRange:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},label:{toBeTypes:["string"]}});if(n.status==="error")return n}return t}}),Wf={styles:{padding:{top:20,right:60,bottom:80,left:60},highlightTarget:"datum",highlightDefault:null,unhighlightedOpacity:.3,transitionDuration:800,transitionEase:"easeCubic"},visibleFilter:e=>!0,container:{...Dl},valueAxis:{...pt},categoryAxis:{...Zx},separateSeries:!1,datasetIndex:0};Wf.visibleFilter.toString=()=>"(datum) => true";const I1={lineCurve:"curveLinear",lineWidth:2},F1={lineCurve:"curveLinear",linearGradientOpacity:[1,0]},Y1={radius:4,fillColorType:"background",strokeColorType:"data",strokeWidth:2,onlyShowHighlighted:!1},Xf={showLine:!0,showLabel:!0,lineDashArray:"3, 3",lineColorType:"primary",labelColorType:"primary",labelTextColorType:"background",labelTextFormat:e=>e,labelPadding:20,labelRotate:0};Xf.labelTextFormat.toString=()=>"text => text";const Gf={barWidth:0,barPadding:1,barGroupPadding:40,barRadius:!1},mC={...Gf},W1={barWidth:0,barGroupPadding:10,barRadius:!1},X1={barWidth:0,barPadding:1,barGroupPadding:20,linearGradientOpacity:[1,0]},Vf={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"};Vf.tickFormat.toString=()=>"text => text";const ll={labelOffset:[0,0],labelColorType:"primary",axisLineVisible:!1,axisLineColorType:"primary",ticks:null,tickFormat:e=>{if(e===null||Number.isNaN(e)==!0)return e||0;const t=e.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")},tickLineVisible:!0,tickPadding:20,tickFullLine:!0,tickFullLineDasharray:"none",tickColorType:"secondary",tickTextRotate:0,tickTextColorType:"primary"};ll.tickFormat.toString=()=>`num => {
|
|
58
|
+
if (num === null || Number.isNaN(num) == true) {
|
|
59
|
+
return num || 0
|
|
60
|
+
}
|
|
61
|
+
const parts = num.toString().split('.')
|
|
62
|
+
parts[0] = parts[0].replace(/B(?=(d{3})+(?!d))/g, ',')
|
|
63
|
+
return parts.join('.')
|
|
64
|
+
}`;const G1={...ll},V1={},yC=({selectedGridData$:e,pluginParams$:t})=>O({selectedGridData:e,pluginParams:t}).pipe(X(0),T(({selectedGridData:n,pluginParams:r})=>n.map(i=>i.map((o,a)=>{const s=r.visibleFilter;return{...o,visible:s?s(o):!0}})))),bC=({computedData$:e,categoryAxis$:t,valueAxis$:n,layout$:r})=>{function i(a,s,u){const l=s.position==="top"||s.position==="bottom"?u.width:u.height,c=a[0]?a[0].length-1:0;return yt({maxValue:c,minValue:0,axisWidth:l,scaleDomain:[0,c],scaleRange:[0,1]})}function o(a,s,u){const l=s.position==="left"||s.position==="right"?u.height:u.width,c=a.flat();let[h,f]=Bf(c);return h===f&&f===0&&(f=1),yt({maxValue:f,minValue:h,axisWidth:l,scaleDomain:["auto","auto"],scaleRange:[0,1]})}return O({computedData:e,categoryAxis:t,valueAxis:n,layout:r}).pipe(X(0),T(a=>{const s=i(a.computedData,a.categoryAxis,a.layout),u=o(a.computedData,a.valueAxis,a.layout),l=u(0);return a.computedData.map((c,h)=>c.map((f,p)=>{const d=s(p),g=u(f.value??0);return{...f,axisX:d,axisY:g,axisYFromZero:g-l}}))}))},j1=({categoryAxis$:e,valueAxis$:t,layout$:n})=>{const r=new ee;function i({xAxisPosition:s,yAxisPosition:u,width:l,height:c}){return(s==="bottom"||s==="top")&&(u==="left"||u==="right")?{width:l,height:c}:(s==="left"||s==="right")&&(u==="bottom"||u==="top")?{width:c,height:l}:{width:l,height:c}}const o=e.pipe(T(s=>s.position),H()),a=t.pipe(T(s=>s.position),H());return new de(s=>{O({categoryAxisPosition:o,valueAxisPosition:a,layout:n}).pipe(k(r),X(0)).subscribe(u=>{const l=i({xAxisPosition:u.categoryAxisPosition,yAxisPosition:u.valueAxisPosition,width:u.layout.width,height:u.layout.height});return s.next(l),function(){r.next(void 0)}})})},xC=({categoryAxis$:e,valueAxis$:t,containerSize$:n})=>j1({categoryAxis$:e,valueAxis$:t,layout$:n}),vC=({computedData$:e})=>e.pipe(T(t=>t.filter(n=>n.length).map(n=>n[0].series)),H((t,n)=>JSON.stringify(t)===JSON.stringify(n))),SC=({computedData$:e})=>e.pipe(T(t=>t.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),$C=({computedAxesData$:e})=>e.pipe(T(t=>t.map(r=>r.filter(i=>i.visible==!0)).filter(r=>r.length))),wC=({selectedGridData$:e,pluginParams$:t,layout$:n})=>O({selectedGridData:e,pluginParams:t,layout:n}).pipe(X(0),T(i=>{if(i.selectedGridData.length===0)return[{slotIndex:0,rowIndex:0,columnIndex:0,translate:[0,0],scale:[1,1]}];if(i.pluginParams.separateSeries)return il(i.layout,i.pluginParams.container,i.selectedGridData.length);{const o=il(i.layout,i.pluginParams.container,1);return i.selectedGridData.map((a,s)=>o[0])}})),_C=({isSeriesSeprate$:e,computedData$:t})=>{const n=t.pipe(T(r=>{const i=new Array(r[0]?r[0].length:0).fill(null).map((a,s)=>r.reduce((u,l)=>{if(l&&l[s]){const c=l[s].value==null||l[s].visible==!1?0:l[s].value;return u+c}return u},0));return r.map((a,s)=>a.map((u,l)=>({...u,value:i[l]})))}));return e.pipe(U(r=>Nn(()=>r,t,n)))},TC=({selectedGridData$:e,categoryAxis$:t})=>O({selectedGridData:e,categoryAxis:t}).pipe(X(0),T(n=>{const r=n.categoryAxis,i=n.selectedGridData[0]?n.selectedGridData[0].length-1:0,o=r.scaleDomain[0]-r.scalePadding,a=r.scaleDomain[1]==="max"?i+r.scalePadding:r.scaleDomain[1]+r.scalePadding;return[o,a]})),U1=({computedData$:e,categoryScaleDomainValue$:t})=>O({computedData:e,categoryScaleDomainValue:t}).pipe(T(n=>{const r=n.computedData.map((o,a)=>o.filter((s,u)=>u>=n.categoryScaleDomainValue[0]&&u<=n.categoryScaleDomainValue[1]&&s.visible==!0));return Bf(r.flat())})),AC=({categoryAxis$:e,valueAxis$:t,layout$:n})=>{const r=new ee;function i({xAxis:o,yAxis:a,width:s,height:u}){if(!o||!a)return{translate:[0,0],scale:[1,1],rotate:0,rotateX:0,rotateY:0,value:""};let l=0,c=0,h=0,f=0,p=0;return o.position==="bottom"?a.position==="left"?(f=180,c=u):a.position==="right"?(f=180,p=180,l=s,c=u):(f=180,c=u):o.position==="top"?a.position==="left"||(a.position==="right"?(p=180,l=s):(f=180,c=u)):o.position==="left"?a.position==="bottom"?(h=-90,c=u):a.position==="top"?(h=-90,p=180):(f=180,c=u):o.position==="right"?a.position==="bottom"?(h=-90,f=180,c=u,l=s):a.position==="top"?(h=-90,f=180,p=180,l=s):(f=180,c=u):(f=180,c=u),{translate:[l,c],scale:[1,1],rotate:h,rotateX:f,rotateY:p,value:`translate(${l}px, ${c}px) rotate(${h}deg) rotateX(${f}deg) rotateY(${p}deg)`}}return new de(o=>(O({categoryAxis:e,valueAxis:t,layout:n}).pipe(k(r),X(0)).subscribe(a=>{const s=i({xAxis:a.categoryAxis,yAxis:a.valueAxis,width:a.layout.width,height:a.layout.height});o.next(s)}),function(){r.next(void 0)}))},DC=({gridAxesTransform$:e})=>e.pipe(T(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)`}})),MC=({computedData$:e,categoryScaleDomainValue$:t,filteredMinMaxValue$:n,categoryAxis$:r,valueAxis$:i,layout$:o})=>{const a=new ee;function s({data:u,categoryAxis:l,valueAxis:c,categoryScaleDomainValue:h,filteredMinMaxValue:f,width:p,height:d}){let g=0,m=0,y=0,b=0;const x=l.position==="top"||l.position==="bottom"?p:d,v=0,_=u[0]?u[0].length-1:0,w=yt({maxValue:_,minValue:v,axisWidth:x,scaleDomain:h,scaleRange:[0,1]}),P=w(v),C=w(_);v==_?(g=0,y=1):(g=P,y=(C-P)/x);const L=f[0];let E=f[1];L===E&&E===0&&(E=1);const N=c.position==="left"||c.position==="right"?d:p,A=yt({maxValue:E,minValue:L,axisWidth:N,scaleDomain:c.scaleDomain,scaleRange:c.scaleRange}),R=Bf(u.flat());R[0],R[1];const S=A(R[0]>0?0:R[0]),M=A(R[1]<0?0:R[1]);return m=S,b=(M-S)/N,{translate:[g,m],scale:[y,b],rotate:0,rotateX:0,rotateY:0,value:`translate(${g}px, ${m}px) scale(${y}, ${b})`}}return new de(u=>(O({computedData:e,categoryScaleDomainValue:t,filteredMinMaxValue:n,categoryAxis:r,valueAxis:i,layout:o}).pipe(k(a),X(0)).subscribe(l=>{const c=s({data:l.computedData,categoryAxis:l.categoryAxis,valueAxis:l.valueAxis,categoryScaleDomainValue:l.categoryScaleDomainValue,filteredMinMaxValue:l.filteredMinMaxValue,width:l.layout.width,height:l.layout.height});u.next(c)}),function(){a.next(void 0)}))},PC=({gridContainerPosition$:e,gridAxesTransform$:t,gridGraphicTransform$:n})=>O({gridContainerPosition:e,gridAxesTransform:t,gridGraphicTransform:n}).pipe(X(0),T(r=>r.gridAxesTransform.rotate==0||r.gridAxesTransform.rotate==180?r.gridContainerPosition.map((i,o)=>[1/r.gridGraphicTransform.scale[0]/r.gridContainerPosition[o].scale[0],1/r.gridGraphicTransform.scale[1]/r.gridContainerPosition[o].scale[1]]):r.gridContainerPosition.map((i,o)=>[1/r.gridGraphicTransform.scale[0]/r.gridContainerPosition[o].scale[1],1/r.gridGraphicTransform.scale[1]/r.gridContainerPosition[o].scale[0]]))),hr=({selection:e,pluginName:t,layerName:n,clipPathID:r,seriesLabels$:i,gridContainerPosition$:o,gridAxesTransform$:a,gridGraphicTransform$:s})=>{const u=Z(t,n,"series"),l=Z(t,n,"axes"),c=Z(t,n,"graphic"),h=i.pipe(T((g,m)=>e.selectAll(`g.${u}`).data(g,y=>y).join(y=>y.append("g").classed(u,!0).each((b,x,v)=>{I(v[x]).selectAll(`g.${l}`).data([x]).join(_=>_.append("g").classed(l,!0).attr("clip-path",`url(#${r})`).each((w,P,C)=>{I(C[P]).selectAll("defs").data([P]).join("defs"),I(C[P]).selectAll("g").data([P]).join("g").classed(c,!0)}),_=>_,_=>_.remove())}),y=>y,y=>y.remove())),W(1));O({seriesSelection:h,gridContainerPosition:o}).pipe(U(async g=>g)).subscribe(g=>{g.seriesSelection.transition().attr("transform",(m,y)=>{const b=g.gridContainerPosition[y]??g.gridContainerPosition[0],x=b.translate,v=b.scale;return`translate(${x[0]}, ${x[1]}) scale(${v[0]}, ${v[1]})`})});const f=O({seriesSelection:h,gridAxesTransform:a}).pipe(U(async g=>g),T(g=>g.seriesSelection.select(`g.${l}`).style("transform",g.gridAxesTransform.value)),W(1)),p=f.pipe(T(g=>g.select("defs")),W(1)),d=O({axesSelection:f,gridGraphicTransform:s}).pipe(U(async g=>g),T(g=>{const m=g.axesSelection.select(`g.${c}`);return m.transition().duration(50).style("transform",g.gridGraphicTransform.value),m}),W(1));return{seriesSelection$:h,axesSelection$:f,defsSelection$:p,graphicGSelection$:d}},CC=({selection:e,pluginName:t,layerName:n,computedData$:r,gridContainerPosition$:i,isSeriesSeprate$:o})=>{const a=Z(t,n,"container"),s=O({computedData:r.pipe(H((u,l)=>u.length===l.length)),isSeriesSeprate:o}).pipe(U(async u=>u),T(u=>u.isSeriesSeprate?u.computedData:[u.computedData[0]]),T((u,l)=>e.selectAll(`g.${a}`).data(u,c=>c&&c[0]?c[0].seriesIndex:l).join("g").classed(a,!0)),W(1));return O({containerSelection:s,gridContainerPosition:i}).pipe(U(async u=>u)).subscribe(u=>{u.containerSelection.attr("transform",(l,c)=>{const h=u.gridContainerPosition[c]??u.gridContainerPosition[0],f=h.translate,p=h.scale;return`translate(${f[0]}, ${f[1]}) scale(${p[0]}, ${p[1]})`})}),s},H1=({pluginParams$:e,gridAxesSize$:t,computedData$:n,gridContainerPosition$:r,layout$:i})=>{const o=new ee,a=O({pluginParams:e,gridAxesSize:t,computedData:n}).pipe(U(async h=>h),T(h=>{const f=h.computedData[0]?h.computedData[0].length-1:0,p=h.pluginParams.categoryAxis.scaleDomain[0]-h.pluginParams.categoryAxis.scalePadding,d=h.pluginParams.categoryAxis.scaleDomain[1]==="max"?f+h.pluginParams.categoryAxis.scalePadding:h.pluginParams.categoryAxis.scaleDomain[1]+h.pluginParams.categoryAxis.scalePadding;return[p,d]}),W(1)),s=O({pluginParams:e,computedData:n}).pipe(U(async h=>h),T(h=>(h.computedData[0]??[]).map(f=>f.category))),u=O({categoryScaleDomain:a,categoryLabels:s}).pipe(U(async h=>h),T(h=>h.categoryLabels.filter((f,p)=>p>=h.categoryScaleDomain[0]&&p<=h.categoryScaleDomain[1]))),l=r.pipe(T(h=>h.reduce((p,d)=>d.columnIndex>p?d.columnIndex:p,0)+1),H()),c=r.pipe(T(h=>h.reduce((p,d)=>d.rowIndex>p?d.rowIndex:p,0)+1),H());return new de(h=>{O({pluginParams:e,axisSize:t,scaleRangeCategoryLabels:u,categoryLabels:s,categoryScaleDomain:a,columnAmount:l,rowAmount:c,layout:i}).pipe(k(o),U(async f=>f)).subscribe(f=>{const p=f.pluginParams.valueAxis.position==="right"||f.pluginParams.valueAxis.position==="bottom",d=M1({axisLabels:f.scaleRangeCategoryLabels,axisWidth:f.axisSize.width,padding:f.pluginParams.categoryAxis.scalePadding,reverse:p}),g=y=>f.pluginParams.categoryAxis.position==="bottom"||f.pluginParams.categoryAxis.position==="top"?y.offsetX-f.pluginParams.styles.padding.left:y.offsetY-f.pluginParams.styles.padding.top,m=y=>{const b={offsetX:y.offsetX*f.columnAmount%f.layout.rootWidth,offsetY:y.offsetY*f.rowAmount%f.layout.rootHeight},x=g(b),v=d(x),_=Math.ceil(f.categoryScaleDomain[0]),w=v+_;return{categoryIndex:w,categoryLabel:f.categoryLabels[w]??""}};return h.next(m),function(){o.next(void 0)}})})},LC=({rootSelection:e,pluginParams$:t,gridAxesContainerSize$:n,computedData$:r,gridContainerPosition$:i,layout$:o})=>{const a=pi(e,"mousemove"),s=O({pluginParams:t,computedData:r}).pipe(U(async g=>g),T(g=>{const m=g.computedData[0]?g.computedData[0].length-1:0,y=g.pluginParams.categoryAxis.scaleDomain[0]-g.pluginParams.categoryAxis.scalePadding,b=g.pluginParams.categoryAxis.scaleDomain[1]==="max"?m+g.pluginParams.categoryAxis.scalePadding:g.pluginParams.categoryAxis.scaleDomain[1]+g.pluginParams.categoryAxis.scalePadding;return[y,b]}),W(1)),u=O({pluginParams:t,computedData:r}).pipe(U(async g=>g),T(g=>(g.computedData[0]??[]).map(m=>m.category))),l=O({categoryScaleDomain:s,categoryLabels:u}).pipe(U(async g=>g),T(g=>g.categoryLabels.filter((m,y)=>y>=g.categoryScaleDomain[0]&&y<=g.categoryScaleDomain[1]))),c=t.pipe(T(g=>g.valueAxis.position==="right"||g.valueAxis.position==="bottom")),h=O({reverse:c,gridAxesContainerSize:n,scaleRangeCategoryLabels:l,pluginParams:t}).pipe(U(async g=>g),T(g=>M1({axisLabels:g.scaleRangeCategoryLabels,axisWidth:g.gridAxesContainerSize.width,padding:g.pluginParams.categoryAxis.scalePadding,reverse:g.reverse}))),f=O({pluginParams:t,rootMousemove:a,gridContainerPosition:i,layout:o}).pipe(U(async g=>g),T(g=>{if(g.pluginParams.categoryAxis.position==="bottom"||g.pluginParams.categoryAxis.position==="top"){let m=g.rootMousemove.offsetX;const b=g.gridContainerPosition.map((x,v)=>{var _;return[x.translate[0],((_=g.gridContainerPosition[v+1])==null?void 0:_.translate[0])??g.layout.rootWidth]}).filter(x=>x[0]<x[1]).find(x=>m>=x[0]&&m<=x[1]);return b&&(m=m-b[0]),m-g.layout.left}else{let m=g.rootMousemove.offsetY;const b=g.gridContainerPosition.map((x,v)=>{var _;return[x.translate[1],((_=g.gridContainerPosition[v+1])==null?void 0:_.translate[1])??g.layout.rootHeight]}).filter(x=>x[0]<x[1]).find(x=>m>=x[0]&&m<=x[1]);return b&&(m=m-b[0]),m-g.layout.top}})),p=O({xIndexScale:h,axisValue:f,categoryScaleDomain:s}).pipe(U(async g=>g),T(g=>{const m=g.xIndexScale(g.axisValue),y=Math.ceil(g.categoryScaleDomain[0]);return m+y})),d=O({categoryIndex:p,categoryLabels:u}).pipe(U(async g=>g),T(g=>g.categoryLabels[g.categoryIndex]??""));return O({categoryIndex:p,categoryLabel:d}).pipe(U(async g=>g),T(g=>({categoryIndex:g.categoryIndex,categoryLabel:g.categoryLabel})))},q1=.3;function Z1({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 kC(e,t,n){const r=e/2,i=e*t.length+n.barPadding*t.length;return tf().domain(t).range([-i/2+r,i/2-r])}function RC(e,t){return e<=1?0:t/(e-1)*q1}function EC(e,t){return e<=1?t:t*(1-q1)}function NC({graphicGSelection:e,rectClassName:t,visibleComputedAxesData:n,zeroYArr:r,barScale:i,styles:o,barWidth:a,transformedBarRadius:s,delayGroup:u,transitionItem:l,isSeriesSeprate:c}){const h=a/2;return e.each((p,d,g)=>{I(g[d]).selectAll(`rect.${t}`).data(n[d]??[],m=>m.id).join(m=>m.append("rect").classed(t,!0).attr("cursor","pointer").attr("height",y=>1),m=>m,m=>m.remove()).attr("transform",(m,y)=>`translate(${(m?m.axisX:0)-h}, 0)`).attr("fill",m=>m.color).attr("y",m=>m.axisY<r[d]?m.axisY:r[d]).attr("x",m=>c?0:i(m.series)).attr("width",a).attr("rx",s[d][0]??1).attr("ry",s[d][1]??1).transition().duration(l).ease(To(o.transitionEase)).delay((m,y)=>m.categoryIndex*u).attr("height",m=>Math.abs(m.axisYFromZero)||1)}),e.selectAll(`rect.${t}`)}function BC({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)=>{I(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 zC({selection:e,ids:t,styles: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)?I(o[i]).style("opacity",1):I(o[i]).style("opacity",n.unhighlightedOpacity)})}const OC=({selection:e,pluginName:t,layerName:n,computedData$:r,visibleComputedData$:i,visibleComputedAxesData$:o,seriesLabels$:a,SeriesDataMap$:s,CategoryDataMap$:u,baseBarsParams$:l,gridAxesTransform$:c,gridGraphicTransform$:h,gridGraphicReverseScale$:f,gridAxesSize$:p,gridHighlight$:d,gridContainerPosition$:g,isSeriesSeprate$:m,styles$:y,eventTrigger$:b})=>{const x=new ee,v=At(t,n,"clipPath-box"),_=Z(t,n,"rect"),{defsSelection$:w,graphicGSelection$:P}=hr({selection:e,pluginName:t,layerName:n,clipPathID:v,seriesLabels$:a,gridContainerPosition$:g,gridAxesTransform$:c,gridGraphicTransform$:h}),C=o.pipe(k(x),T(D=>D.map(z=>z[0]?z[0].axisY-z[0].axisYFromZero:0)),H()),L=O({computedData:r,visibleComputedData:i,params:l,gridAxesSize:p,isSeriesSeprate:m}).pipe(k(x),X(0),T(D=>D.params.barWidth?D.params.barWidth:D.isSeriesSeprate?Z1({axisWidth:D.gridAxesSize.width,groupAmount:D.computedData[0]?D.computedData[0].length:0,barAmountOfGroup:1,barPadding:D.params.barPadding,barGroupPadding:D.params.barGroupPadding}):Z1({axisWidth:D.gridAxesSize.width,groupAmount:D.computedData[0]?D.computedData[0].length:0,barAmountOfGroup:D.visibleComputedData.length,barPadding:D.params.barPadding,barGroupPadding:D.params.barGroupPadding})),H()),E=O({computedData:r,barWidth:L,params:l,gridGraphicReverseScale:f}).pipe(k(x),X(0),T(D=>{const z=D.barWidth/2,F=D.params.barRadius===!0?z:D.params.barRadius===!1?0:typeof D.params.barRadius=="number"?D.params.barRadius:0;return D.computedData.map((j,K)=>{const se=D.gridGraphicReverseScale[K]??D.gridGraphicReverseScale[0];let te=F*se[0],Y=F*se[1];if(te>z){const J=z/te;te=te*J,Y=Y*J}return[te,Y]})})),N=i.pipe(k(x),T(D=>{const z=new Set;return D.forEach(F=>{F.forEach(j=>{z.add(j.category)})}),Array.from(z)})),A=O({seriesLabels:a,barWidth:L,params:l}).pipe(k(x),X(0),T(D=>kC(D.barWidth,D.seriesLabels,D.params))),R=y.pipe(k(x),T(D=>D.transitionDuration),H()),S=new de(D=>{O({categoryLabels:N,transitionDuration:R}).pipe(X(0)).subscribe(z=>{const F=RC(z.categoryLabels.length,z.transitionDuration);D.next(F)})}).pipe(k(x),H()),M=new de(D=>{O({categoryLabels:N,transitionDuration:R}).pipe(X(0)).subscribe(z=>{const F=EC(z.categoryLabels.length,z.transitionDuration);D.next(F)})}).pipe(k(x),H());O({defsSelection:w,gridAxesSize:p}).pipe(k(x),X(0)).subscribe(D=>{const z=[{id:v,width:D.gridAxesSize.width,height:D.gridAxesSize.height}];BC({defsSelection:D.defsSelection,clipPathData:z})});const $=y.pipe(k(x),T(D=>D.highlightTarget),H()),B=O({graphicGSelection:P,visibleComputedAxesData:o,zeroYArr:C,categoryLabels:N,barScale:A,params:l,styles:y,highlightTarget:$,barWidth:L,transformedBarRadius:E,delayGroup:S,transitionItem:M,isSeriesSeprate:m}).pipe(k(x),U(async D=>D),T(D=>NC({graphicGSelection:D.graphicGSelection,rectClassName:_,visibleComputedAxesData:D.visibleComputedAxesData,zeroYArr:D.zeroYArr,barScale:D.barScale,styles:D.styles,barWidth:D.barWidth,transformedBarRadius:D.transformedBarRadius,delayGroup:D.delayGroup,transitionItem:D.transitionItem,isSeriesSeprate:D.isSeriesSeprate})));return O({barSelection:B,computedData:r,highlightTarget:$,SeriesDataMap:s,CategoryDataMap:u}).pipe(k(x),U(async D=>D)).subscribe(D=>{D.barSelection.on("mouseover",(z,F)=>{z.stopPropagation(),b.next({eventName:"mouseover",pluginName:t,layerName:n,target:F,event:z})}).on("mousemove",(z,F)=>{z.stopPropagation(),b.next({eventName:"mousemove",pluginName:t,layerName:n,target:F,event:z})}).on("mouseout",(z,F)=>{z.stopPropagation(),b.next({eventName:"mouseout",pluginName:t,layerName:n,target:F,event:z})}).on("click",(z,F)=>{z.stopPropagation(),b.next({eventName:"click",pluginName:t,layerName:n,target:F,event:z})})}),O({barSelection:B,highlight:d.pipe(T(D=>D.map(z=>z.id))),styles:y}).pipe(k(x),X(0)).subscribe(D=>{zC({selection:D.barSelection,ids:D.highlight,styles:D.styles})}),()=>{x.next(void 0)}},IC="SeriesPlot",J1="Bars",FC=G.defineSVGLayer({name:J1,defaultParams:Gf,layerIndex:Dt,initShow:!0,validator:e=>G.validateObject(e,{barWidth:{toBeTypes:["number"]},barPadding:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee;r.layout$.pipe(k(i)).subscribe(a=>{I(e).attr("transform",`translate(${a.left}, ${a.top})`)});const o=OC({selection:I(e),pluginName:IC,layerName:J1,computedData$:r.computedData$,visibleComputedData$:r.visibleComputedData$,visibleComputedAxesData$:r.visibleComputedAxesData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,CategoryDataMap$:r.CategoryDataMap$,baseBarsParams$:n,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$,styles$:t.pipe(T(a=>a.styles)),eventTrigger$:r.eventTrigger$});return()=>{i.next(void 0),o()}}}),K1=.3;function Q1({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 YC(e,t,n){const r=e/2,i=e*t.length+n.barPadding*t.length;return tf().domain(t).range([-i/2+r,i/2-r])}function WC(e,t){return e<=1?0:t/(e-1)*K1}function XC(e,t){return e<=1?t:t*(1-K1)}function GC({graphicGSelection:e,pathGClassName:t,pathClassName:n,visibleComputedAxesData:r,linearGradientIds:i,zeroYArr:o,barScale:a,styles:s,barWidth:u,delayGroup:l,transitionItem:c,isSeriesSeprate:h}){const f=u/2;return e.each((d,g,m)=>{I(m[g]).selectAll(`g.${t}`).data(r[g]??[]).join(b=>{const x=b.append("g").classed(t,!0).attr("cursor","pointer");return x.append("path").classed(n,!0).style("vector-effect","non-scaling-stroke").attr("d",v=>{const _=-f,w=o[g],P=o[g];return`M${_},${w} L${_+u/2},${P} ${_+u},${w}`}),x},b=>b,b=>b.remove()).attr("transform",b=>`translate(${h?0:a(b.series)}, 0)`).select(`path.${n}`).attr("height",b=>Math.abs(b.axisYFromZero)||1).attr("y",b=>b.axisY<o[g]?b.axisY:o[g]).attr("x",b=>h?0:a(b.series)).style("fill",b=>`url(#${i[b.seriesIndex]})`).attr("stroke",b=>b.color).attr("transform",b=>`translate(${b?b.axisX:0}, 0)`).transition().duration(c).ease(To(s.transitionEase)).delay((b,x)=>b.categoryIndex*l).attr("d",b=>{const x=-f,v=o[g],_=b.axisY;return`M${x},${v} L${x+u/2},${_} ${x+u},${v}`})}),e.selectAll(`path.${n}`)}function VC({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`
|
|
65
|
+
<stop offset="0%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[0]}"/>
|
|
66
|
+
<stop offset="100%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[1]}"/>
|
|
67
|
+
`})}function jC({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)=>{I(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 UC({selection:e,ids:t,styles: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)?I(a[o]).style("opacity",1):I(a[o]).style("opacity",n.unhighlightedOpacity)})}const HC=({selection:e,pluginName:t,layerName:n,computedData$:r,visibleComputedData$:i,visibleComputedAxesData$:o,seriesLabels$:a,SeriesDataMap$:s,CategoryDataMap$:u,baseBarsTriangleParams$:l,styles$:c,gridAxesTransform$:h,gridGraphicTransform$:f,gridAxesSize$:p,gridHighlight$:d,gridContainerPosition$:g,isSeriesSeprate$:m,eventTrigger$:y})=>{const b=new ee,x=At(t,n,"clipPath-box"),v=Z(t,n,"pathG"),_=Z(t,n,"path"),{defsSelection$:w,graphicGSelection$:P}=hr({selection:e,pluginName:t,layerName:n,clipPathID:x,seriesLabels$:a,gridContainerPosition$:g,gridAxesTransform$:h,gridGraphicTransform$:f});f.pipe(k(b),T(D=>-D.translate[1]/D.scale[1]));const C=o.pipe(T(D=>D.map(z=>z[0]?z[0].axisY-z[0].axisYFromZero:0)),H()),L=O({computedData:r,visibleComputedData:i,params:l,gridAxesSize:p,isSeriesSeprate:m}).pipe(k(b),X(0),T(D=>D.params.barWidth?D.params.barWidth:D.isSeriesSeprate?Q1({axisWidth:D.gridAxesSize.width,groupAmount:D.computedData[0]?D.computedData[0].length:0,barAmountOfGroup:1,barPadding:D.params.barPadding,barGroupPadding:D.params.barGroupPadding}):Q1({axisWidth:D.gridAxesSize.width,groupAmount:D.computedData[0]?D.computedData[0].length:0,barAmountOfGroup:D.visibleComputedData.length,barPadding:D.params.barPadding,barGroupPadding:D.params.barGroupPadding}))),E=i.pipe(k(b),T(D=>{const z=new Set;return D.forEach(F=>{F.forEach(j=>{z.add(j.category)})}),Array.from(z)})),N=new de(D=>{O({seriesLabels:a,barWidth:L,params:l}).pipe(k(b),X(0)).subscribe(z=>{const F=YC(z.barWidth,z.seriesLabels,z.params);D.next(F)})}),A=c.pipe(k(b),T(D=>D.transitionDuration),H()),R=new de(D=>{O({groupLabels:E,transitionDuration:A}).pipe(X(0)).subscribe(z=>{const F=WC(z.groupLabels.length,z.transitionDuration);D.next(F)})}).pipe(k(b),H()),S=new de(D=>{O({groupLabels:E,transitionDuration:A}).pipe(X(0)).subscribe(z=>{const F=XC(z.groupLabels.length,z.transitionDuration);D.next(F)})}).pipe(k(b),H());O({defsSelection:w,gridAxesSize:p}).pipe(k(b),X(0)).subscribe(D=>{const z=[{id:x,width:D.gridAxesSize.width,height:D.gridAxesSize.height}];jC({defsSelection:D.defsSelection,clipPathData:z})});const M=c.pipe(k(b),T(D=>D.highlightTarget),H()),$=a.pipe(k(b),T(D=>D.map((z,F)=>At(t,n,`lineargradient-${z}`)))),B=O({graphicGSelection:P,defsSelection:w,computedData:r,visibleComputedAxesData:o,linearGradientIds:$,zeroYArr:C,groupLabels:E,barScale:N,params:l,styles:c,barWidth:L,delayGroup:R,transitionItem:S,isSeriesSeprate:m}).pipe(k(b),U(async D=>D),T(D=>(VC({defsSelection:D.defsSelection,computedData:D.computedData,linearGradientIds:D.linearGradientIds,params:D.params}),GC({graphicGSelection:D.graphicGSelection,pathGClassName:v,pathClassName:_,visibleComputedAxesData:D.visibleComputedAxesData,linearGradientIds:D.linearGradientIds,zeroYArr:D.zeroYArr,barScale:D.barScale,styles:D.styles,barWidth:D.barWidth,delayGroup:D.delayGroup,transitionItem:D.transitionItem,isSeriesSeprate:D.isSeriesSeprate}))));return O({barSelection:B,computedData:r,highlightTarget:M,SeriesDataMap:s,CategoryDataMap:u}).subscribe(D=>{D.barSelection.on("mouseover",(z,F)=>{z.stopPropagation(),y.next({eventName:"mouseover",pluginName:t,layerName:n,target:F,event:z})}).on("mousemove",(z,F)=>{z.stopPropagation(),y.next({eventName:"mousemove",pluginName:t,layerName:n,target:F,event:z})}).on("mouseout",(z,F)=>{z.stopPropagation(),y.next({eventName:"mouseout",pluginName:t,layerName:n,target:F,event:z})}).on("click",(z,F)=>{z.stopPropagation(),y.next({eventName:"click",pluginName:t,layerName:n,target:F,event:z})})}),O({barSelection:B,highlight:d.pipe(T(D=>D.map(z=>z.id))),styles:c}).pipe(k(b),X(0)).subscribe(D=>{UC({selection:D.barSelection,ids:D.highlight,styles:D.styles})}),()=>{b.next(void 0)}},qC="SeriesPlot",eb="BarsTriangle",ZC=G.defineSVGLayer({name:eb,defaultParams:X1,layerIndex:Dt,initShow:!1,validator:e=>G.validateObject(e,{barWidth:{toBeTypes:["number"]},barPadding:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},linearGradientOpacity:{toBe:"[number, number]",test:n=>Array.isArray(n)&&n.length===2&&typeof n[0]=="number"&&typeof n[1]=="number"}}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee;r.layout$.pipe(k(i)).subscribe(a=>{I(e).attr("transform",`translate(${a.left}, ${a.top})`)});const o=HC({selection:I(e),pluginName:qC,layerName:eb,computedData$:r.computedData$,visibleComputedData$:r.visibleComputedData$,visibleComputedAxesData$:r.visibleComputedAxesData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,CategoryDataMap$:r.CategoryDataMap$,baseBarsTriangleParams$:n,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$,styles$:t.pipe(T(a=>a.styles)),eventTrigger$:r.eventTrigger$});return()=>{i.next(void 0),o()}}}),Ln="SeriesPlot",hn="CategoryAux",jf=Z(Ln,hn,"label-box"),Uf=6,tb=3;function JC({categoryLabel:e,axisX:t,axisHeight:n,layerParams:r}){return r.showLine&&e?[{id:e,x1:t,x2:t,y1:0,y2:n}]:[]}function KC({categoryLabel:e,axisX:t,layerParams:n,textSizePx:r,rowAmount:i}){const o=fr(e,n.labelTextFormat),a=o.split(`
|
|
68
|
+
`),s=a.reduce((c,h)=>h.length>c.length?h:c,""),u=mi(s,r),l=r*a.length;return n.showLabel&&e?[{id:e,x:t,y:-n.labelPadding*i,text:o,textArr:a,textWidth:u,textHeight:l}]:[]}function QC({selection:e,pluginName:t,lineData:n,layerParams:r,theme:i}){const o=Z(t,hn,"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",u=>u.x1).attr("y1",u=>u.y1).attr("x2",u=>u.x2).attr("y2",u=>u.y2),s=>s.transition().duration(50).attr("x1",l=>l.x1).attr("y1",l=>l.y1).attr("x2",l=>l.x2).attr("y2",l=>l.y2),s=>s.remove()).style("stroke",s=>xe(r.lineColorType,i)).style("stroke-dasharray",r.lineDashArray??"none")}function e4(e){e.selectAll("line").data([]).exit().remove()}function t4({selection:e,labelData:t,pluginParams:n,layerParams:r,theme:i,textReverseTransformWithRotate:o,fontSizePx:a}){return e.selectAll(`g.${jf}`).data(t).join(u=>u.append("g").classed(jf,!0).style("cursor","pointer").attr("transform",(l,c)=>`translate(${l.x}, ${l.y})`),u=>u.transition().duration(50).attr("transform",(c,h)=>`translate(${c.x}, ${c.y})`),u=>u.remove()).each((u,l,c)=>{const h=I(c[l]),f=u.textWidth+Uf*2,p=u.textHeight+tb*2;let d=-f/2,g=-2,m=d,y=g-3;n.categoryAxis.position==="bottom"?(d=r.labelRotate?-f+p:-f/2,g=2,m=d,y=g-3):n.categoryAxis.position==="left"?(d=-f+2,g=-p/2,m=d,y=g-3,r.labelRotate&&(y+=p)):n.categoryAxis.position==="right"?(d=-2,g=-p/2,m=d,y=g-3,r.labelRotate&&(y+=p)):n.categoryAxis.position==="top"&&(d=r.labelRotate?-f+p:-f/2,g=-p+6,m=-p,y=g-3);const b=h.selectAll("rect").data([u]).join(w=>w.append("rect").style("cursor","pointer").attr("rx",5).attr("ry",5),w=>w,w=>w.remove()).attr("width",w=>`${f}px`).attr("height",`${p}px`).attr("fill",w=>xe(r.labelColorType,i)).attr("x",m).attr("y",y).style("transform",o),x=h.selectAll("text").data([u]).join(w=>w.append("text").style("dominant-baseline","hanging").style("cursor","pointer"),w=>w,w=>w.remove()).style("transform",o).attr("fill",w=>xe(r.labelTextColorType,i)).attr("font-size",i.fontSize).attr("x",m+Uf).attr("y",y+tb).each((w,P,C)=>{If(I(C[P]),{textArr:u.textArr,textSizePx:a,categoryAxisPosition:n.categoryAxis.position,isContainerRotated:!1})});let v=[];x.selectAll("tspan").each((w,P,C)=>{const E=I(C[P]).node();E&&E.getBBox()&&v.push(E.getBBox().width)});const _=Math.max(...v);b.attr("width",_+Uf*2)})}function n4(e){e.selectAll(`g.${jf}`).data([]).exit().remove()}const r4=G.defineSVGLayer({name:hn,defaultParams:Xf,layerIndex:R1,initShow:!1,validator:e=>G.validateObject(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"]}}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee;r.layout$.pipe(k(i)).subscribe(b=>{I(e).attr("transform",`translate(${b.left}, ${b.top})`)});let o=!1;const a=I(e.parentElement),s=a.insert("rect","g").classed(Z(Ln,hn,"rect"),!0).attr("opacity",0),{axesSelection$:u}=hr({selection:I(e),pluginName:Ln,layerName:hn,clipPathID:"test",seriesLabels$:r.isSeriesSeprate$.pipe(U(b=>Nn(()=>b,r.seriesLabels$,r.seriesLabels$.pipe(T(x=>[x[0]]))))),gridContainerPosition$:r.gridContainerPosition$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$});r.layout$.pipe(k(i)).subscribe(b=>{s.attr("width",b.rootWidth).attr("height",b.rootHeight)});const l=O({categoryScaleDomainValue:r.categoryScaleDomainValue$,gridAxesSize:r.gridAxesSize$}).pipe(k(i),X(0),T(b=>Et().domain(b.categoryScaleDomainValue).range([0,b.gridAxesSize.width]))),c=t.pipe(k(i),T(b=>b.styles.highlightTarget),H()),h=pi(a,"mousemove").pipe(k(i)),f=O({gridAxesReverseTransform:r.gridAxesReverseTransform$,gridContainerPosition:r.gridContainerPosition$}).pipe(k(i),X(0),T(b=>{const x=`rotateX(${b.gridAxesReverseTransform.rotateX}deg) rotateY(${b.gridAxesReverseTransform.rotateY}deg)`,v=`rotate(${b.gridAxesReverseTransform.rotate}deg)`,_=`scale(${1/b.gridContainerPosition[0].scale[0]}, ${1/b.gridContainerPosition[0].scale[1]})`;return`${x} ${v} ${_}`}),H()),p=O({textReverseTransform:f,layerParams:n}).pipe(k(i),X(0),T(b=>`${b.textReverseTransform} rotate(${b.layerParams.labelRotate}deg)`)),d=r.gridContainerPosition$.pipe(k(i),T(b=>b.reduce((v,_)=>_.columnIndex>v?_.columnIndex:v,0)+1),H()),g=r.gridContainerPosition$.pipe(k(i),T(b=>b.reduce((v,_)=>_.rowIndex>v?_.rowIndex:v,0)+1),H()),m=LC({rootSelection:a,pluginParams$:t,gridAxesContainerSize$:r.gridAxesContainerSize$,computedData$:r.computedData$,gridContainerPosition$:r.gridContainerPosition$,layout$:r.layout$}).pipe(k(i));O({axesSelection:u,columnAmount:d,rowAmount:g,layout:r.layout$,rootMousemove:h,gridGroupPosition:m,computedData:r.computedData$,groupScale:l,gridAxesSize:r.gridAxesSize$,pluginParams:t,layerParams:n,theme:r.theme$,highlightTarget:c,textReverseTransformWithRotate:p,fontSizePx:r.fontSizePx$}).pipe(k(i),U(async b=>b)).subscribe(b=>{const{categoryIndex:x,categoryLabel:v}=b.gridGroupPosition,_=b.groupScale(x)??0,w=JC({categoryLabel:v,axisX:_,axisHeight:b.gridAxesSize.height,layerParams:b.layerParams});QC({selection:b.axesSelection,pluginName:Ln,lineData:w,layerParams:b.layerParams,theme:b.theme});const P=KC({categoryLabel:v,axisX:_,layerParams:b.layerParams,textSizePx:b.fontSizePx,rowAmount:b.rowAmount});t4({selection:b.axesSelection,labelData:P,pluginParams:b.pluginParams,layerParams:b.layerParams,textReverseTransformWithRotate:b.textReverseTransformWithRotate,theme:b.theme,fontSizePx:b.fontSizePx}).on("mouseover",(L,E)=>{L.stopPropagation(),o=!0,r.eventTrigger$.next({eventName:"mouseover",pluginName:Ln,layerName:hn,target:null,event:L})}).on("mousemove",(L,E)=>{L.stopPropagation(),r.eventTrigger$.next({eventName:"mousemove",pluginName:Ln,layerName:hn,target:null,event:L})}).on("mouseout",(L,E)=>{L.stopPropagation(),o=!1,r.eventTrigger$.next({eventName:"mouseout",pluginName:Ln,layerName:hn,target:null,event:L})}).on("click",(L,E)=>{L.stopPropagation(),r.eventTrigger$.next({eventName:"click",pluginName:Ln,layerName:hn,target:null,event:L})})});const y=pi(s,"mouseout").pipe(k(i));return O({rootRectMouseout:y,axesSelection:u}).pipe(k(i),U(async b=>b)).subscribe(b=>{setTimeout(()=>{o!=!0&&(e4(b.axesSelection),n4(b.axesSelection))})}),()=>{i.next(void 0),s.remove()}}}),Hf=6;function i4(e,t){return e.map((n,r)=>{const i=fr(n,t),o=typeof i=="string"?i.split(`
|
|
69
|
+
`):[i];return{text:i,textArr:o}})}function o4({selection:e,categoryLabelClassName:t,baseCategoryAxisParams:n,axisLabelAlign:r,gridAxesSize:i,categoryAxis:o,valueAxis:a,styles:s,theme:u,textReverseTransform:l}){const c=n.tickPadding+n.labelOffset[0],h=n.tickPadding+n.labelOffset[1];let f=0,p=0;o.position==="bottom"?(p=h,a.position==="left"?f=c:a.position==="right"&&(f=-c)):o.position==="top"?(p=-h,a.position==="left"?f=c:a.position==="right"&&(f=-c)):o.position==="left"?(f=-c,a.position==="bottom"?p=-h:a.position==="top"&&(p=h)):o.position==="right"&&(f=c,a.position==="bottom"?p=-h:a.position==="top"&&(p=h)),e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0).each((d,g,m)=>{I(m[g]).selectAll("text").data([d]).join(y=>y.append("text").style("font-weight","bold"),y=>y,y=>y.remove()).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("font-size",u.fontSize).style("fill",xe(n.labelColorType,u)).style("transform",l).attr("x",f).attr("y",p).text(y=>o.label)}).attr("transform",d=>`translate(${i.width}, 0)`)}function a4({selection:e,xAxisClassName:t,baseCategoryAxisParams:n,tickTextAlign:r,gridAxesSize:i,categoryAxis:o,categoryScale:a,categoryScaleDomain:s,categoryLabelData:u,textReverseTransformWithRotate:l,theme:c,fontSizePx:h}){const f=e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0),p=Math.floor(s[1])-Math.ceil(s[0])+1;let d=0,g=0;o.position==="left"?(d=0,g=-n.tickPadding):o.position==="right"?(d=0,g=n.tickPadding):o.position==="bottom"?(n.tickFullLine==!0?d=-n.tickPadding:d=-n.tickPadding-Hf,g=0):o.position==="top"&&(n.tickFullLine==!0?d=n.tickPadding:d=n.tickPadding-Hf,g=-0);const m=Yl(a).scale(a).ticks(n.ticks==="all"||n.ticks>p?p:n.ticks).tickSize(n.tickFullLine==!0?-i.height:Hf).tickSizeOuter(0).tickFormat(x=>{var v;return((v=u[x])==null?void 0:v.text)??""}).tickPadding(d),y=f.transition().duration(100).ease(Bi).call(m).on("end",(x,v)=>{f.selectAll(".tick text").each((_,w,P)=>{var L;const C=((L=u[_])==null?void 0:L.textArr)??[];If(I(P[w]),{textArr:C,textSizePx:h,categoryAxisPosition:o.position,isContainerRotated:!0})})});return y.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?xe(n.tickColorType,c):"none").style("stroke-dasharray",n.tickFullLineDasharray).style("vector-effect","non-scaling-stroke").attr("pointer-events","none"),y.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?xe(n.axisLineColorType,c):"none").style("shape-rendering","crispEdges"),f.selectAll("text").attr("font-size",c.fontSize).attr("fill",xe(n.tickTextColorType,c)).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("x",g).style("transform",l).attr("dy",0),f}const s4=({selection:e,pluginName:t,layerName:n,computedData$:r,baseCategoryAxisParams$:i,categoryAxis$:o,valueAxis$:a,theme$:s,styles$:u,gridAxesTransform$:l,gridAxesReverseTransform$:c,gridAxesSize$:h,gridContainerPosition$:f,isSeriesSeprate$:p,fontSizePx$:d})=>{const g=new ee,m=Z(t,n,"container"),y=Z(t,n,"xAxisG"),b=Z(t,n,"xAxis"),x=Z(t,n,"categoryLabel"),v=O({computedData:r.pipe(H((S,M)=>S.length===M.length)),isSeriesSeprate:p}).pipe(k(g),U(async S=>S),T(S=>S.isSeriesSeprate?S.computedData:[S.computedData[0]]),T((S,M)=>e.selectAll(`g.${m}`).data(S,$=>$&&$[0]?$[0].seriesIndex:M).join("g").classed(m,!0))),_=v.pipe(k(g),T((S,M)=>S.selectAll(`g.${y}`).data([y]).join("g").classed(y,!0)));O({containerSelection:v,gridContainerPosition:f}).pipe(k(g),X(0)).subscribe(S=>{S.containerSelection.attr("transform",(M,$)=>{const B=S.gridContainerPosition[$]??S.gridContainerPosition[0],D=B.translate,z=B.scale;return`translate(${D[0]}, ${D[1]}) scale(${z[0]}, ${z[1]})`})}),O({axisSelection:_,gridAxesTransform:l}).pipe(k(g),X(0)).subscribe(S=>{S.axisSelection.style("transform",S.gridAxesTransform.value)});const w=O({gridAxesReverseTransform:c,gridContainerPosition:f}).pipe(k(g),U(async S=>S),T(S=>{const M=`rotateX(${S.gridAxesReverseTransform.rotateX}deg) rotateY(${S.gridAxesReverseTransform.rotateY}deg)`,$=`rotate(${S.gridAxesReverseTransform.rotate}deg)`,B=`scale(${1/S.gridContainerPosition[0].scale[0]}, ${1/S.gridContainerPosition[0].scale[1]})`;return`${M} ${$} ${B}`}),H()),P=O({textReverseTransform:w,baseCategoryAxisParams:i}).pipe(k(g),U(async S=>S),T(S=>`${S.textReverseTransform} rotate(${S.baseCategoryAxisParams.tickTextRotate}deg)`)),C=O({categoryAxis:o,valueAxis:a,gridAxesSize:h,computedData:r}).pipe(k(g),U(async S=>S),T(S=>{const M=S.computedData[0]?S.computedData[0].length-1:0,$=S.categoryAxis.scaleDomain[0]-S.categoryAxis.scalePadding,B=S.categoryAxis.scaleDomain[1]==="max"?M+S.categoryAxis.scalePadding:S.categoryAxis.scaleDomain[1]+S.categoryAxis.scalePadding;return[$,B]}),W(1)),L=O({categoryScaleDomain:C,gridAxesSize:h}).pipe(k(g),U(async S=>S),T(S=>Et().domain(S.categoryScaleDomain).range([0,S.gridAxesSize.width]))),E=r.pipe(T(S=>(S[0]??[]).map(M=>M.category))),N=O({categoryAxis:o,baseCategoryAxisParams:i}).pipe(k(g),U(async S=>S),T(S=>{let M="middle",$="hanging";return S.categoryAxis.position==="bottom"?(M=S.baseCategoryAxisParams.tickTextRotate?"end":"middle",$="hanging"):S.categoryAxis.position==="top"?(M=S.baseCategoryAxisParams.tickTextRotate?"start":"middle",$="auto"):S.categoryAxis.position==="left"?(M="end",$="middle"):S.categoryAxis.position==="right"&&(M="start",$="middle"),{textAnchor:M,dominantBaseline:$}})),A=O({categoryAxis:o,valueAxis:a}).pipe(k(g),X(0),T(S=>{let M="start",$="hanging";return S.categoryAxis.position==="bottom"?$="hanging":S.categoryAxis.position==="top"?$="auto":S.categoryAxis.position==="left"?M="end":S.categoryAxis.position==="right"&&(M="start"),S.valueAxis.position==="left"?M="start":S.valueAxis.position==="right"?M="end":S.valueAxis.position==="bottom"?$="auto":S.valueAxis.position==="top"&&($="hanging"),{textAnchor:M,dominantBaseline:$}})),R=O({categoryLabels:E,baseCategoryAxisParams:i}).pipe(k(g),U(async S=>S),T(S=>i4(S.categoryLabels,S.baseCategoryAxisParams.tickFormat)));return O({axisSelection:_,baseCategoryAxisParams:i,tickTextAlign:N,axisLabelAlign:A,gridAxesSize:h,categoryAxis:o,valueAxis:a,theme:s,styles:u,categoryScale:L,categoryScaleDomain:C,categoryLabelData:R,textReverseTransform:w,textReverseTransformWithRotate:P,fontSizePx:d}).pipe(k(g),U(async S=>S)).subscribe(S=>{a4({selection:S.axisSelection,xAxisClassName:b,baseCategoryAxisParams:S.baseCategoryAxisParams,tickTextAlign:S.tickTextAlign,gridAxesSize:S.gridAxesSize,categoryAxis:S.categoryAxis,theme:S.theme,categoryScale:S.categoryScale,categoryScaleDomain:S.categoryScaleDomain,categoryLabelData:S.categoryLabelData,textReverseTransformWithRotate:S.textReverseTransformWithRotate,fontSizePx:S.fontSizePx}),o4({selection:S.axisSelection,categoryLabelClassName:x,baseCategoryAxisParams:S.baseCategoryAxisParams,axisLabelAlign:S.axisLabelAlign,gridAxesSize:S.gridAxesSize,categoryAxis:S.categoryAxis,valueAxis:S.valueAxis,theme:S.theme,styles:S.styles,textReverseTransform:S.textReverseTransform})}),()=>{g.next(void 0)}},l4="SeriesPlot",nb="CategoryAxis",u4=G.defineSVGLayer({name:nb,defaultParams:Vf,layerIndex:E1,initShow:!1,validator:e=>G.validateObject(e,{labelOffset:{toBe:"[number, number]",test:n=>Array.isArray(n)&&n.length===2&&typeof n[0]=="number"&&typeof n[1]=="number"},labelColorType:{toBeOption:"ColorType"},axisLineVisible:{toBeTypes:["boolean"]},axisLineColorType:{toBeOption:"ColorType"},ticks:{toBe:'number | null | "all"',test:n=>n===null||n==="all"||typeof n=="number"}}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee;r.layout$.pipe(k(i)).subscribe(a=>{I(e).attr("transform",`translate(${a.left}, ${a.top})`)});const o=s4({selection:I(e),pluginName:l4,layerName:nb,computedData$:r.computedData$,baseCategoryAxisParams$:n,gridAxesTransform$:r.gridAxesTransform$,gridAxesReverseTransform$:r.gridAxesReverseTransform$,gridAxesSize$:r.gridAxesSize$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$,fontSizePx$:r.fontSizePx$,categoryAxis$:r.zoomedCategoryAxis$,valueAxis$:t.pipe(T(a=>a.valueAxis)),styles$:t.pipe(T(a=>a.styles)),theme$:r.theme$});return()=>{i.next(void 0),o()}}}),c4="SeriesPlot",rb="CategoryZoom",f4=G.defineSVGLayer({name:rb,defaultParams:V1,layerIndex:_8,initShow:!1,validator:e=>({status:"success",columnName:"",expectToBe:""}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee,o=I(r.svg);let a={k:1,x:0,y:0};const s=r.computedData$.pipe(T(c=>c[0]?c[0].length-1:0),H()),u=t.pipe(T(c=>c.categoryAxis)),l=O({initCategoryAxis:u,categoryMaxIndex:s,layout:r.layout$,axisSize:r.gridAxesSize$}).pipe(k(i),X(0),T(c=>{const h=c.initCategoryAxis.scaleDomain[0]-c.initCategoryAxis.scalePadding,f=c.initCategoryAxis.scaleDomain[1]==="max"?c.categoryMaxIndex+c.initCategoryAxis.scalePadding:c.initCategoryAxis.scaleDomain[1]+c.initCategoryAxis.scalePadding;return yt({maxValue:c.categoryMaxIndex,minValue:0,axisWidth:c.axisSize.width,scaleDomain:[h,f],scaleRange:[0,1]})}));return O({initGroupScale:l,pluginParams:t,categoryMaxIndex:s}).pipe(k(i),X(0)).subscribe(c=>{const f=c.initGroupScale.copy(),p=un().on("zoom",function(g){const m=g.transform,y=x=>{const v=Math.round(x);return Math.min(c.categoryMaxIndex,Math.max(0,v))},b=c.pluginParams.categoryAxis.position==="bottom"||c.pluginParams.categoryAxis.position==="top"?m.rescaleX(f).domain().map(y):m.rescaleY(f).domain().map(y);b[0]<=0&&b[1]>=c.categoryMaxIndex?m.k<a.k&&(m.k=a.k,m.x=a.x,m.y=a.y):b[1]-b[0]<=1&&m.k>a.k&&(m.k=a.k,m.x=a.x,m.y=a.y),a.k=m.k,a.x=m.x,a.y=m.y,r.eventTrigger$.next({eventName:"zoom",pluginName:c4,layerName:rb,target:null,data:{scaleDomain:b}})});o.call(p)}),()=>{i.next(void 0),o.call(un().on("zoom",null))}}});function h4({graphicGSelection:e,circleGClassName:t,circleClassName:n,visibleComputedAxesData:r,baseDotsParams:i,styles:o,theme:a,graphicReverseScale:s}){const u=h=>{const f=h.size();return o.transitionDuration/f};let l=0;return e.each((h,f,p)=>{I(p[f]).selectAll("g").data(r[f],d=>d.id).join(d=>(l=u(d),d.append("g").classed(t,!0)),d=>d,d=>d.remove()).attr("transform",d=>`translate(${d.axisX}, ${d.axisY})`).each((d,g,m)=>{I(m[g]).selectAll("circle").data([d]).join(y=>y.append("circle").style("cursor","pointer").style("vector-effect","non-scaling-stroke").classed(n,!0).attr("opacity",0).transition().delay((b,x)=>g*l).attr("opacity",1),y=>y.transition().duration(50).attr("opacity",1),y=>y.remove()).attr("r",i.radius).attr("fill",(y,b)=>Te({datum:y,colorType:i.fillColorType,theme:a})).attr("stroke",(y,b)=>Te({datum:y,colorType:i.strokeColorType,theme:a})).attr("stroke-width",i.strokeWidth).attr("transform",`scale(${s[f][0]??1}, ${s[f][1]??1})`)})}),e.selectAll(`circle.${n}`)}function p4({selection:e,ids:t,onlyShowHighlighted:n,styles: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)?I(a[o]).style("opacity",1).transition("highlight").duration(200):I(a[o]).style("opacity",n===!0?0:r.unhighlightedOpacity).transition("highlight").duration(200)})}function d4({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)=>{I(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 g4=({selection:e,pluginName:t,layerName:n,computedData$:r,visibleComputedAxesData$:i,seriesLabels$:o,SeriesDataMap$:a,CategoryDataMap$:s,baseDotsParams$:u,styles$:l,theme$:c,gridAxesTransform$:h,gridGraphicTransform$:f,gridGraphicReverseScale$:p,gridAxesSize$:d,gridHighlight$:g,gridContainerPosition$:m,eventTrigger$:y})=>{const b=new ee,x=At(t,n,"clipPath-box"),v=Z(t,n,"circleG"),_=Z(t,n,"circle"),{defsSelection$:w,graphicGSelection$:P}=hr({selection:e,pluginName:t,layerName:n,clipPathID:x,seriesLabels$:o,gridContainerPosition$:m,gridAxesTransform$:h,gridGraphicTransform$:f}),C=O({computedData:r,gridGraphicReverseScale:p}).pipe(k(b),U(async A=>A),T(A=>A.computedData.map((R,S)=>A.gridGraphicReverseScale[S])));O({defsSelection:w,gridAxesSize:d}).pipe(k(b),U(async A=>A)).subscribe(A=>{const R=[{id:x,width:A.gridAxesSize.width,height:A.gridAxesSize.height}];d4({defsSelection:A.defsSelection,clipPathData:R})});const L=l.pipe(k(b),T(A=>A.highlightTarget),H()),E=O({graphicGSelection:P,visibleComputedAxesData:i,graphicReverseScale:C,styles:l,theme:c,baseDotsParams:u}).pipe(k(b),U(async A=>A),T(A=>h4({graphicGSelection:A.graphicGSelection,circleGClassName:v,circleClassName:_,visibleComputedAxesData:A.visibleComputedAxesData,baseDotsParams:A.baseDotsParams,styles:A.styles,theme:A.theme,graphicReverseScale:A.graphicReverseScale})));O({graphicSelection:E,computedData:r,SeriesDataMap:a,CategoryDataMap:s,highlightTarget:L}).pipe(k(b),U(async A=>A)).subscribe(A=>{A.graphicSelection.on("mouseover",(R,S)=>{y.next({eventName:"mouseover",pluginName:t,layerName:n,target:S,event:R})}).on("mousemove",(R,S)=>{y.next({eventName:"mousemove",pluginName:t,layerName:n,target:S,event:R})}).on("mouseout",(R,S)=>{y.next({eventName:"mouseout",pluginName:t,layerName:n,target:S,event:R})}).on("click",(R,S)=>{y.next({eventName:"click",pluginName:t,layerName:n,target:S,event:R})})});const N=u.pipe(k(b),T(A=>A.onlyShowHighlighted),H());return O({graphicSelection:E,highlight:g.pipe(T(A=>A.map(R=>R.id))),onlyShowHighlighted:N,styles:l}).pipe(k(b),X(0)).subscribe(A=>{p4({selection:A.graphicSelection,ids:A.highlight,onlyShowHighlighted:A.onlyShowHighlighted,styles:A.styles})}),()=>{b.next(void 0)}},m4="SeriesPlot",ib="Dots",y4=G.defineSVGLayer({name:ib,defaultParams:Y1,layerIndex:Dt,initShow:!1,validator:e=>G.validateObject(e,{radius:{toBeTypes:["number"]},fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},onlyShowHighlighted:{toBeTypes:["boolean"]}}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee;r.layout$.pipe(k(i)).subscribe(a=>{I(e).attr("transform",`translate(${a.left}, ${a.top})`)});const o=g4({selection:I(e),pluginName:m4,layerName:ib,computedData$:r.computedData$,visibleComputedAxesData$:r.visibleComputedAxesData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,CategoryDataMap$:r.CategoryDataMap$,baseDotsParams$:n,styles$:t.pipe(T(a=>a.styles)),theme$:r.theme$,gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,eventTrigger$:r.eventTrigger$});return()=>{i.next(void 0),o()}}});function b4(e="curveLinear",t){return wf().x(n=>n.axisX).y0(n=>t).y1(n=>n.axisY).curve(Ef[e])}function x4(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 v4({selection:e,pathClassName:t,segmentData:n,areaPath:r,linearGradientIds:i,params:o}){return e.selectAll("path").data(n,(s,u)=>s.length?`${s[0].id}_${s[s.length-1].id}`:u).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,u)=>s[0]?`url(#${i[s[0].seriesIndex]})`:"").attr("d",s=>r(s))}function S4({selection:e,seriesLabel:t,styles:n}){if(e.interrupt("highlight"),!t){e.transition("highlight").duration(200).style("opacity",1);return}e.each((r,i,o)=>{r===t?I(o[i]).style("opacity",1):I(o[i]).style("opacity",n.unhighlightedOpacity)})}function $4({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`
|
|
70
|
+
<stop offset="0%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[0]}"/>
|
|
71
|
+
<stop offset="100%" stop-color="${a}" stop-opacity="${r.linearGradientOpacity[1]}"/>
|
|
72
|
+
`})}function w4({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)=>{I(a[o]).selectAll("rect").data([i]).join(s=>{const u=s.append("rect");return u.transition().duration(n).ease(To(r)).tween("tween",(l,c,h)=>f=>{const p=l.width*f;u.attr("x",0).attr("y",0).attr("width",d=>p).attr("height",d=>d.height)}),u},s=>s.attr("x",0).attr("y",0).attr("width",u=>u.width).attr("height",u=>u.height),s=>s.remove())})}const _4=({selection:e,pluginName:t,layerName:n,computedData$:r,visibleComputedAxesData$:i,seriesLabels$:o,SeriesDataMap$:a,CategoryDataMap$:s,pluginParams$:u,baseLineAreasParams$:l,styles$:c,gridAxesTransform$:h,gridGraphicTransform$:f,gridAxesSize$:p,gridHighlight$:d,gridContainerPosition$:g,layout$:m,eventTrigger$:y})=>{const b=new ee,x=At(t,n,"clipPath-box"),v=Z(t,n,"path"),{defsSelection$:_,graphicGSelection$:w}=hr({selection:e,pluginName:t,layerName:n,clipPathID:x,seriesLabels$:o,gridContainerPosition$:g,gridAxesTransform$:h,gridGraphicTransform$:f}),P=f.pipe(k(b),T($=>-$.translate[1]/$.scale[1])),C=new de($=>{const B=O({baseLineAreasParams:l,valueAxisStart:P}).pipe(k(b)).subscribe(D=>{const z=b4(D.baseLineAreasParams.lineCurve,D.valueAxisStart);$.next(z)});return()=>{B.unsubscribe()}}),L=c.pipe(T($=>$.transitionDuration),H()),E=c.pipe(T($=>$.transitionEase),H());O({defsSelection:_,seriesLabels:o,axisSize:p,transitionDuration:L,transitionEase:E}).pipe(k(b),U(async $=>$)).subscribe($=>{const D=[{id:x,width:$.axisSize.width,height:$.axisSize.height}].concat($.seriesLabels.map(z=>({id:`orbcharts__clipPath_${z}`,width:$.axisSize.width,height:$.axisSize.height})));w4({defsSelection:$.defsSelection,clipPathData:D,transitionDuration:$.transitionDuration,transitionEase:$.transitionEase})});const N=r.pipe(T($=>{const B=new Map;return $.flat().forEach(D=>B.set(D.id,D)),B})),A=H1({pluginParams$:u,gridAxesSize$:p,computedData$:r,gridContainerPosition$:g,layout$:m}),R=c.pipe(k(b),T($=>$.highlightTarget),H()),S=o.pipe(k(b),T($=>$.map((B,D)=>At(t,n,`lineargradient-${B}`)))),M=O({graphicGSelection:w,defsSelection:_,visibleComputedAxesData:i,linearGradientIds:S,areaPath:C,params:l}).pipe(k(b),U(async $=>$),T($=>{let B=[];return $.graphicGSelection.each((D,z,F)=>{const j=x4($.visibleComputedAxesData[z]??[]);B[z]=v4({selection:I(F[z]),pathClassName:v,areaPath:$.areaPath,segmentData:j,linearGradientIds:$.linearGradientIds,params:$.params}),$4({defsSelection:$.defsSelection,computedData:$.visibleComputedAxesData,linearGradientIds:$.linearGradientIds,params:$.params})}),B}));return O({pathSelectionArr:M,computedData:r,SeriesDataMap:a,CategoryDataMap:s,highlightTarget:R,gridCategoryPositionFn:A}).pipe(k(b),U(async $=>$)).subscribe($=>{$.pathSelectionArr.forEach(B=>{B.on("mouseover",(D,z)=>{const F=z[0]?z[0].series:"",{categoryIndex:j,categoryLabel:K}=$.gridCategoryPositionFn(D),Y=$.CategoryDataMap.get(K).find(J=>J.series===F)??z[0];y.next({eventName:"mouseover",pluginName:t,layerName:n,target:Y,event:D})}).on("mousemove",(D,z)=>{const F=z[0]?z[0].series:"",{categoryIndex:j,categoryLabel:K}=$.gridCategoryPositionFn(D),Y=$.CategoryDataMap.get(K).find(J=>J.series===F)??z[0];y.next({eventName:"mousemove",pluginName:t,layerName:n,target:Y,event:D})}).on("mouseout",(D,z)=>{const F=z[0]?z[0].series:"",{categoryIndex:j,categoryLabel:K}=$.gridCategoryPositionFn(D),Y=$.CategoryDataMap.get(K).find(J=>J.series===F)??z[0];y.next({eventName:"mouseout",pluginName:t,layerName:n,target:Y,event:D})}).on("click",(D,z)=>{const F=z[0]?z[0].series:"",{categoryIndex:j,categoryLabel:K}=$.gridCategoryPositionFn(D),Y=$.CategoryDataMap.get(K).find(J=>J.series===F)??z[0];y.next({eventName:"click",pluginName:t,layerName:n,target:Y,event:D})})})}),c.pipe(k(b),Ut($=>$.highlightTarget==="series"),U($=>O({graphicGSelection:w,gridHighlight:d,DataMap:N,styles:c}).pipe(k(b),U(async B=>B)))).subscribe($=>{const B=$.gridHighlight[0]?$.gridHighlight[0].series:null;S4({selection:$.graphicGSelection,seriesLabel:B,styles:$.styles})}),()=>{b.next(void 0)}},T4="SeriesPlot",ob="LineAreas",A4=G.defineSVGLayer({name:ob,defaultParams:F1,layerIndex:T8,initShow:!1,validator:e=>G.validateObject(e,{lineCurve:{toBeTypes:["string"]},linearGradientOpacity:{toBe:"[number, number]",test:n=>Array.isArray(n)&&n.length===2&&typeof n[0]=="number"&&typeof n[1]=="number"}}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee;r.layout$.pipe(k(i)).subscribe(a=>{I(e).attr("transform",`translate(${a.left}, ${a.top})`)});const o=_4({selection:I(e),pluginName:T4,layerName:ob,computedData$:r.computedData$,visibleComputedAxesData$:r.visibleComputedAxesData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,CategoryDataMap$:r.CategoryDataMap$,baseLineAreasParams$:n,pluginParams$:t,styles$:t.pipe(T(a=>a.styles)),gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,allContainerPosition$:r.gridContainerPosition$,layout$:r.layout$,eventTrigger$:r.eventTrigger$});return()=>{i.next(void 0),o()}}});function D4(e="curveLinear"){return Hs().x(t=>t.axisX).y(t=>t.axisY).curve(Ef[e])}function M4(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 P4({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 C4({selection:e,seriesLabel:t,styles:n}){if(e.interrupt("highlight"),!t){e.transition("highlight").duration(200).style("opacity",1);return}e.each((r,i,o)=>{r===t?I(o[i]).style("opacity",1):I(o[i]).style("opacity",n.unhighlightedOpacity)})}function L4({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)=>{I(a[o]).selectAll("rect").data([i]).join(s=>{const u=s.append("rect");return u.transition().duration(n).ease(To(r)).tween("tween",(l,c,h)=>f=>{const p=l.width*f;u.attr("x",0).attr("y",0).attr("width",d=>p).attr("height",d=>d.height)}),u},s=>s.attr("x",0).attr("y",0).attr("width",u=>u.width).attr("height",u=>u.height),s=>s.remove())})}const k4=({selection:e,pluginName:t,layerName:n,computedData$:r,visibleComputedAxesData$:i,seriesLabels$:o,SeriesDataMap$:a,CategoryDataMap$:s,pluginParams$:u,baseLinesParams$:l,styles$:c,gridAxesTransform$:h,gridGraphicTransform$:f,gridAxesSize$:p,gridHighlight$:d,gridContainerPosition$:g,allContainerPosition$:m,layout$:y,eventTrigger$:b})=>{const x=new ee,v=At(t,n,"clipPath-box"),_=Z(t,n,"path"),{defsSelection$:w,graphicGSelection$:P}=hr({selection:e,pluginName:t,layerName:n,clipPathID:v,seriesLabels$:o,gridContainerPosition$:g,gridAxesTransform$:h,gridGraphicTransform$:f}),C=new de(M=>{const $=l.pipe(k(x)).subscribe(B=>{if(!B)return;const D=D4(B.lineCurve);M.next(D)});return()=>{$.unsubscribe()}}),L=c.pipe(T(M=>M.transitionDuration),H()),E=c.pipe(T(M=>M.transitionEase),H());O({defsSelection:w,seriesLabels:o,axisSize:p,transitionDuration:L,transitionEase:E}).pipe(k(x),U(async M=>M)).subscribe(M=>{const B=[{id:v,width:M.axisSize.width,height:M.axisSize.height}].concat(M.seriesLabels.map(D=>({id:`orbcharts__clipPath_${D}`,width:M.axisSize.width,height:M.axisSize.height})));L4({defsSelection:M.defsSelection,clipPathData:B,transitionDuration:M.transitionDuration,transitionEase:M.transitionEase})});const N=r.pipe(T(M=>{const $=new Map;return M.flat().forEach(B=>$.set(B.id,B)),$})),A=H1({pluginParams$:u,gridAxesSize$:p,computedData$:r,gridContainerPosition$:m,layout$:y}),R=c.pipe(k(x),T(M=>M.highlightTarget),H()),S=O({graphicGSelection:P,visibleComputedAxesData:i,linePath:C,params:l}).pipe(k(x),U(async M=>M),T(M=>{let $=[];return M.graphicGSelection.each((B,D,z)=>{const F=M4(M.visibleComputedAxesData[D]??[]);$[D]=P4({selection:I(z[D]),pathClassName:_,linePath:M.linePath,segmentData:F,params:M.params})}),$}));return O({pathSelectionArr:S,computedData:r,SeriesDataMap:a,CategoryDataMap:s,highlightTarget:R,gridGroupPositionFn:A}).pipe(k(x),U(async M=>M)).subscribe(M=>{M.pathSelectionArr.forEach($=>{$.on("mouseover",(B,D)=>{const z=D[0]?D[0].series:"",{categoryIndex:F,categoryLabel:j}=M.gridGroupPositionFn(B),te=M.CategoryDataMap.get(j).find(Y=>Y.series===z)??D[0];b.next({eventName:"mouseover",pluginName:t,layerName:n,target:te,event:B})}).on("mousemove",(B,D)=>{const z=D[0]?D[0].series:"",{categoryIndex:F,categoryLabel:j}=M.gridGroupPositionFn(B),te=M.CategoryDataMap.get(j).find(Y=>Y.series===z)??D[0];b.next({eventName:"mousemove",pluginName:t,layerName:n,target:te,event:B})}).on("mouseout",(B,D)=>{const z=D[0]?D[0].series:"",{categoryIndex:F,categoryLabel:j}=M.gridGroupPositionFn(B),te=M.CategoryDataMap.get(j).find(Y=>Y.series===z)??D[0];b.next({eventName:"mouseout",pluginName:t,layerName:n,target:te,event:B})}).on("click",(B,D)=>{const z=D[0]?D[0].series:"",{categoryIndex:F,categoryLabel:j}=M.gridGroupPositionFn(B),te=M.CategoryDataMap.get(j).find(Y=>Y.series===z)??D[0];b.next({eventName:"click",pluginName:t,layerName:n,target:te,event:B})})})}),c.pipe(k(x),Ut(M=>M.highlightTarget==="series"),U(M=>O({graphicGSelection:P,gridHighlight:d,DataMap:N,styles:c}).pipe(k(x),X(0)))).subscribe(M=>{const $=M.gridHighlight[0]?M.gridHighlight[0].series:null;C4({selection:M.graphicGSelection,seriesLabel:$,styles:M.styles})}),()=>{x.next(void 0)}},R4="SeriesPlot",ab="Lines",E4=G.defineSVGLayer({name:ab,defaultParams:I1,layerIndex:Dt,initShow:!1,validator:e=>G.validateObject(e,{lineCurve:{toBeTypes:["string"]},lineWidth:{toBeTypes:["number"]}}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee;r.layout$.pipe(k(i)).subscribe(a=>{I(e).attr("transform",`translate(${a.left}, ${a.top})`)});const o=k4({selection:I(e),pluginName:R4,layerName:ab,computedData$:r.computedData$,visibleComputedAxesData$:r.visibleComputedAxesData$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,CategoryDataMap$:r.CategoryDataMap$,baseLinesParams$:n,pluginParams$:t,styles$:t.pipe(T(a=>a.styles)),gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,allContainerPosition$:r.gridContainerPosition$,layout$:r.layout$,eventTrigger$:r.eventTrigger$});return()=>{i.next(void 0),o()}}}),sb=.3;function N4({axisWidth:e,groupAmount:t,barGroupPadding:n=0}){const i=(t>1?e/(t-1):e)-n;return i>1?i:1}function B4(e,t){return e<=1?0:t/(e-1)*sb}function z4(e,t){return e<=1?t:t*(1-sb)}function O4({graphicGSelection:e,rectClassName:t,barData:n,zeroY:r,styles:i,barWidth:o,transformedBarRadius:a,delayGroup:s,transitionItem:u}){const l=o/2;return e.each((h,f,p)=>{I(p[f]).selectAll(`rect.${t}`).data(n[f]??[],d=>d.id).join(d=>d.append("rect").classed(t,!0).attr("cursor","pointer").attr("height",g=>1),d=>d,d=>d.remove()).attr("transform",(d,g)=>`translate(${(d?d.axisX:0)-l}, 0)`).attr("fill",d=>d.color).attr("y",d=>r).attr("x",d=>0).attr("width",o).attr("rx",a[f][0]??1).attr("ry",a[f][1]??1).transition().duration(u).ease(To(i.transitionEase)).delay((d,g)=>d.categoryIndex*s).attr("y",d=>d._barStartY).attr("height",d=>d._barHeight>0?Math.abs(d._barHeight):1)}),e.selectAll(`rect.${t}`)}function I4({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)=>{I(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 F4({selection:e,ids:t,styles: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)?I(o[i]).style("opacity",1):I(o[i]).style("opacity",n.unhighlightedOpacity)})}const Y4=({selection:e,pluginName:t,layerName:n,computedData$:r,computedAxesData$:i,visibleComputedData$:o,visibleComputedAxesData$:a,filteredMinMaxValue$:s,filteredStackedMinMaxValue$:u,seriesLabels$:l,SeriesDataMap$:c,CategoryDataMap$:h,baseStackedBarParams$:f,pluginParams$:p,styles$:d,gridAxesTransform$:g,gridGraphicTransform$:m,gridGraphicReverseScale$:y,gridAxesSize$:b,gridHighlight$:x,gridContainerPosition$:v,isSeriesSeprate$:_,eventTrigger$:w})=>{const P=new ee,C=At(t,n,"clipPath-box"),L=Z(t,n,"rect"),{defsSelection$:E,graphicGSelection$:N}=hr({selection:e,pluginName:t,layerName:n,clipPathID:C,seriesLabels$:l,gridContainerPosition$:v,gridAxesTransform$:g,gridGraphicTransform$:m}),A=a.pipe(k(P),T(Y=>Y[0]&&Y[0][0]?Y[0][0].axisY-Y[0][0].axisYFromZero:0),H()),R=O({computedData:r,params:f,axisSize:b,isSeriesSeprate:_}).pipe(k(P),U(async Y=>Y),T(Y=>Y.params.barWidth?Y.params.barWidth:N4({axisWidth:Y.axisSize.width,groupAmount:Y.computedData[0]?Y.computedData[0].length:0,barGroupPadding:Y.params.barGroupPadding})),H()),S=O({computedData:r,barWidth:R,params:f,gridGraphicReverseScale:y}).pipe(k(P),U(async Y=>Y),T(Y=>{const J=Y.barWidth/2,ie=Y.params.barRadius===!0?J:Y.params.barRadius===!1?0:typeof Y.params.barRadius=="number"?Y.params.barRadius:0;return Y.computedData.map((ue,q)=>{const re=Y.gridGraphicReverseScale[q]??Y.gridGraphicReverseScale[0],ce=ie*re[0],V=ie*re[1];return[ce,V]})})),M=o.pipe(k(P),T(Y=>{const J=new Set;return Y.forEach(ie=>{ie.forEach(ue=>{J.add(ue.category)})}),Array.from(J)}),W(1)),$=d.pipe(k(P),T(Y=>Y.transitionDuration),H()),B=new de(Y=>{O({groupLabels:M,transitionDuration:$}).pipe(U(async J=>J)).subscribe(J=>{const ie=B4(J.groupLabels.length,J.transitionDuration);Y.next(ie)})}).pipe(k(P),H()),D=new de(Y=>{O({groupLabels:M,transitionDuration:$}).pipe(U(async J=>J)).subscribe(J=>{const ie=z4(J.groupLabels.length,J.transitionDuration);Y.next(ie)})}).pipe(k(P),H());O({computedData:r,pluginParams:p}).pipe(k(P),U(async Y=>Y),T(Y=>{const J=Y.computedData[0]?Y.computedData[0].length-1:0,ie=Y.pluginParams.categoryAxis.scaleDomain[0],ue=Y.pluginParams.categoryAxis.scaleDomain[1]==="max"?J:Y.pluginParams.categoryAxis.scaleDomain[1];return[ie,ue]}));const z=O({filteredMinMaxValue:s,filteredStackedMinMaxValue:u}).pipe(k(P),U(async Y=>Y),T(Y=>Y.filteredMinMaxValue[1]/Y.filteredStackedMinMaxValue[1])),F=O({computedAxesData:i,yRatio:z,zeroY:A}).pipe(k(P),T(Y=>{let J=Y.computedAxesData[0]?Y.computedAxesData[0].map(()=>Y.zeroY):[];return Y.computedAxesData.map((ie,ue)=>ie.map((q,re)=>{J[re]||(J[re]=0);const ce=J[re];let V=0;return q.visible&&(V=q.axisYFromZero*Y.yRatio,J[re]=J[re]+V),{...q,_barStartY:ce,_barHeight:V}}))})),j=O({computedAxesData:i,zeroY:A}).pipe(k(P),T(Y=>Y.computedAxesData.map((J,ie)=>J.map((ue,q)=>({...ue,_barStartY:Y.zeroY,_barHeight:ue.axisYFromZero}))))),K=_.pipe(U(Y=>Nn(()=>Y,j,F)));O({defsSelection:E,gridAxesSize:b}).pipe(k(P),U(async Y=>Y)).subscribe(Y=>{const J=[{id:C,width:Y.gridAxesSize.width,height:Y.gridAxesSize.height}];I4({defsSelection:Y.defsSelection,clipPathData:J})});const se=d.pipe(k(P),T(Y=>Y.highlightTarget),H()),te=O({graphicGSelection:N,graphicData:K,zeroY:A,groupLabels:M,params:f,styles:d,highlightTarget:se,barWidth:R,transformedBarRadius:S,delayGroup:B,transitionItem:D,isSeriesSeprate:_}).pipe(k(P),U(async Y=>Y),T(Y=>O4({graphicGSelection:Y.graphicGSelection,rectClassName:L,barData:Y.graphicData,zeroY:Y.zeroY,styles:Y.styles,barWidth:Y.barWidth,transformedBarRadius:Y.transformedBarRadius,delayGroup:Y.delayGroup,transitionItem:Y.transitionItem})));return O({barSelection:te,computedData:r,highlightTarget:se,SeriesDataMap:c,CategoryDataMap:h}).subscribe(Y=>{Y.barSelection.on("mouseover",(J,ie)=>{J.stopPropagation(),w.next({eventName:"mouseover",pluginName:t,layerName:n,target:ie,event:J})}).on("mousemove",(J,ie)=>{J.stopPropagation(),w.next({eventName:"mousemove",pluginName:t,layerName:n,target:ie,event:J})}).on("mouseout",(J,ie)=>{J.stopPropagation(),w.next({eventName:"mouseout",pluginName:t,layerName:n,target:ie,event:J})}).on("click",(J,ie)=>{J.stopPropagation(),w.next({eventName:"click",pluginName:t,layerName:n,target:ie,event:J})})}),O({barSelection:te,highlight:x.pipe(T(Y=>Y.map(J=>J.id))),styles:d}).pipe(k(P),U(async Y=>Y)).subscribe(Y=>{F4({selection:Y.barSelection,ids:Y.highlight,styles:Y.styles})}),()=>{P.next(void 0)}},W4="SeriesPlot",lb="StackedBars",X4=G.defineSVGLayer({name:lb,defaultParams:W1,layerIndex:Dt,initShow:!1,validator:e=>G.validateObject(e,{barWidth:{toBeTypes:["number"]},barGroupPadding:{toBeTypes:["number"]},barRadius:{toBeTypes:["number","boolean"]}}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee;r.layout$.pipe(k(i)).subscribe(a=>{I(e).attr("transform",`translate(${a.left}, ${a.top})`)});const o=Y4({selection:I(e),pluginName:W4,layerName:lb,computedData$:r.computedData$,computedAxesData$:r.computedAxesData$,visibleComputedData$:r.visibleComputedData$,visibleComputedAxesData$:r.visibleComputedAxesData$,filteredMinMaxValue$:r.filteredMinMaxValue$,filteredStackedMinMaxValue$:r.filteredStackedMinMaxValue$,seriesLabels$:r.seriesLabels$,SeriesDataMap$:r.SeriesDataMap$,CategoryDataMap$:r.CategoryDataMap$,baseStackedBarParams$:n,pluginParams$:t,styles$:t.pipe(T(a=>a.styles)),gridAxesTransform$:r.gridAxesTransform$,gridGraphicTransform$:r.gridGraphicTransform$,gridGraphicReverseScale$:r.gridGraphicReverseScale$,gridAxesSize$:r.gridAxesSize$,gridHighlight$:r.gridHighlight$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$,eventTrigger$:r.eventTrigger$});return()=>{i.next(void 0),o()}}}),G4=6;function V4({selection:e,textClassName:t,baseValueAxisParams:n,axisLabelAlign:r,gridAxesSize:i,categoryAxis:o,valueAxis:a,theme:s,textReverseTransform:u}){const l=n.tickPadding-n.labelOffset[0],c=n.tickPadding+n.labelOffset[1];let h=0,f=0;o.position==="bottom"?(f=-c,a.position==="left"?h=-l:a.position==="right"&&(h=l)):o.position==="top"?(f=c,a.position==="left"?h=-l:a.position==="right"&&(h=l)):o.position==="left"?(h=l,a.position==="bottom"?f=c:a.position==="top"&&(f=-c)):o.position==="right"&&(h=-l,a.position==="bottom"?f=c:a.position==="top"&&(f=-c)),e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0).each((p,d,g)=>{I(g[d]).selectAll("text").data([p]).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",s.fontSize).style("fill",xe(n.labelColorType,s)).style("transform",u).attr("x",h).attr("y",f).text(m=>a.label)}).attr("transform",p=>`translate(0, ${i.height})`)}function j4({selection:e,yAxisClassName:t,baseValueAxisParams:n,tickTextAlign:r,gridAxesSize:i,valueAxis:o,valueScale:a,textReverseTransformWithRotate:s,theme:u}){const l=e.selectAll(`g.${t}`).data([n]).join("g").classed(t,!0);let c=0,h=0;o.position==="left"?(c=n.tickPadding,h=0):o.position==="right"?(c=-n.tickPadding,h=0):o.position==="bottom"?(c=0,h=n.tickPadding):o.position==="top"&&(c=0,h=-n.tickPadding);const f=Wl(a).scale(a).ticks(n.ticks).tickFormat(g=>fr(g,n.tickFormat)).tickSize(n.tickFullLine==!0?-i.width:G4).tickPadding(c),p=l.transition().duration(100).ease(Bi).call(f);p.selectAll("line").style("fill","none").style("stroke",n.tickLineVisible==!0?xe(n.tickColorType,u):"none").style("stroke-dasharray",n.tickFullLineDasharray).style("vector-effect","non-scaling-stroke").attr("pointer-events","none"),p.selectAll("path").style("fill","none").style("stroke",n.axisLineVisible==!0?xe(n.axisLineColorType,u):"none").style("shape-rendering","crispEdges");const d=l.selectAll("text").attr("font-size",u.fontSize).style("color",xe(n.tickTextColorType,u)).attr("text-anchor",r.textAnchor).attr("dominant-baseline",r.dominantBaseline).attr("y",h).attr("dy",0);return d.style("transform",s),(o.position==="bottom"||o.position==="top")&&d.attr("dy",0),l}const ub=({selection:e,pluginName:t,layerName:n,computedData$:r,filteredMinMaxValue$:i,baseValueAxisParams$:o,categoryAxis$:a,valueAxis$:s,theme$:u,gridAxesSize$:l,gridAxesTransform$:c,gridAxesReverseTransform$:h,gridContainerPosition$:f,isSeriesSeprate$:p})=>{const d=new ee;Z(t,n,"container");const g=Z(t,n,"yAxisG"),m=Z(t,n,"yAxis"),y=Z(t,n,"text"),x=CC({selection:e,pluginName:t,layerName:n,computedData$:r,gridContainerPosition$:f,isSeriesSeprate$:p}).pipe(k(d),T((L,E)=>L.selectAll(`g.${g}`).data([g]).join("g").classed(g,!0)));O({axisSelection:x,gridAxesTransform:c}).pipe(k(d),X(0)).subscribe(L=>{L.axisSelection.style("transform",L.gridAxesTransform.value)});const v=O({gridAxesReverseTransform:h,gridContainerPosition:f}).pipe(k(d),X(0),T(L=>{const E=`rotateX(${L.gridAxesReverseTransform.rotateX}deg) rotateY(${L.gridAxesReverseTransform.rotateY}deg)`,N=`rotate(${L.gridAxesReverseTransform.rotate}deg)`,A=`scale(${1/L.gridContainerPosition[0].scale[0]}, ${1/L.gridContainerPosition[0].scale[1]})`;return`${E} ${N} ${A}`}),H()),_=O({textReverseTransform:v,baseValueAxisParams:o}).pipe(k(d),X(0),T(L=>`${L.textReverseTransform} rotate(${L.baseValueAxisParams.tickTextRotate}deg)`)),w=new de(L=>{O({valueAxis:s,gridAxesSize:l,filteredMinMaxValue:i}).pipe(k(d),X(0)).subscribe(E=>{let N=E.filteredMinMaxValue[1],A=E.filteredMinMaxValue[0];N===A&&N===0&&(N=1);const R=yt({maxValue:N,minValue:A,axisWidth:E.gridAxesSize.height,scaleDomain:E.valueAxis.scaleDomain,scaleRange:E.valueAxis.scaleRange});L.next(R)})}),P=O({categoryAxis:a,valueAxis:s,baseValueAxisParams:o}).pipe(k(d),X(0),T(L=>{let E="start",N="hanging";return L.valueAxis.position==="left"?(E="end",N="middle"):L.valueAxis.position==="right"?(E="start",N="middle"):L.valueAxis.position==="bottom"?(E=L.baseValueAxisParams.tickTextRotate?"end":"middle",N="hanging"):L.valueAxis.position==="top"&&(E=L.baseValueAxisParams.tickTextRotate?"start":"middle",N="auto"),{textAnchor:E,dominantBaseline:N}})),C=O({categoryAxis:a,valueAxis:s}).pipe(k(d),X(0),T(L=>{let E="start",N="hanging";return L.categoryAxis.position==="bottom"?N="auto":L.categoryAxis.position==="top"?N="hanging":L.categoryAxis.position==="left"?E="start":L.categoryAxis.position==="right"&&(E="end"),L.valueAxis.position==="left"?E="end":L.valueAxis.position==="right"?E="start":L.valueAxis.position==="bottom"?N="hanging":L.valueAxis.position==="top"&&(N="auto"),{textAnchor:E,dominantBaseline:N}}));return O({axisSelection:x,baseValueAxisParams:o,tickTextAlign:P,axisLabelAlign:C,computedData:r,gridAxesSize:l,categoryAxis:a,valueAxis:s,valueScale:w,textReverseTransform:v,textReverseTransformWithRotate:_,theme:u}).pipe(k(d),X(0)).subscribe(L=>{j4({selection:L.axisSelection,yAxisClassName:m,baseValueAxisParams:L.baseValueAxisParams,tickTextAlign:L.tickTextAlign,gridAxesSize:L.gridAxesSize,valueAxis:L.valueAxis,valueScale:L.valueScale,textReverseTransformWithRotate:L.textReverseTransformWithRotate,theme:L.theme}),V4({selection:L.axisSelection,textClassName:y,baseValueAxisParams:L.baseValueAxisParams,axisLabelAlign:L.axisLabelAlign,gridAxesSize:L.gridAxesSize,categoryAxis:L.categoryAxis,valueAxis:L.valueAxis,theme:L.theme,textReverseTransform:L.textReverseTransform})}),()=>{d.next(void 0)}},U4="SeriesPlot",cb="StackedValueAxis",H4=G.defineSVGLayer({name:cb,defaultParams:G1,layerIndex:al,initShow:!1,validator:e=>G.validateObject(e,{labelOffset:{toBe:"[number, number]",test:n=>Array.isArray(n)&&n.length===2&&typeof n[0]=="number"&&typeof n[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"}}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee;r.layout$.pipe(k(i)).subscribe(a=>{I(e).attr("transform",`translate(${a.left}, ${a.top})`)});const o=ub({selection:I(e),pluginName:U4,layerName:cb,computedData$:r.computedStackedData$,filteredMinMaxValue$:r.filteredStackedMinMaxValue$,baseValueAxisParams$:n,categoryAxis$:t.pipe(T(a=>a.categoryAxis)),valueAxis$:t.pipe(T(a=>a.valueAxis)),theme$:r.theme$,gridAxesTransform$:r.gridAxesTransform$,gridAxesReverseTransform$:r.gridAxesReverseTransform$,gridAxesSize$:r.gridAxesSize$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$});return()=>{i.next(void 0),o()}}}),q4="SeriesPlot",fb="ValueAxis",Z4=G.defineSVGLayer({name:fb,defaultParams:ll,layerIndex:al,initShow:!1,validator:e=>G.validateObject(e,{labelOffset:{toBe:"[number, number]",test:n=>Array.isArray(n)&&n.length===2&&typeof n[0]=="number"&&typeof n[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"}}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee;r.layout$.pipe(k(i)).subscribe(a=>{I(e).attr("transform",`translate(${a.left}, ${a.top})`)});const o=ub({selection:I(e),pluginName:q4,layerName:fb,computedData$:r.computedData$,filteredMinMaxValue$:r.filteredMinMaxValue$,baseValueAxisParams$:n,categoryAxis$:t.pipe(T(a=>a.categoryAxis)),valueAxis$:t.pipe(T(a=>a.valueAxis)),theme$:r.theme$,gridAxesTransform$:r.gridAxesTransform$,gridAxesReverseTransform$:r.gridAxesReverseTransform$,gridAxesSize$:r.gridAxesSize$,gridContainerPosition$:r.gridContainerPosition$,isSeriesSeprate$:r.isSeriesSeprate$});return()=>{i.next(void 0),o()}}}),J4=new FC,K4=new ZC,Q4=new r4,e7=new u4,t7=new f4,n7=new y4,r7=new A4,i7=new E4,o7=new X4,a7=new H4,s7=new Z4,l7=G.defineSVGPlugin({name:"SeriesPlot",defaultParams:Wf,layers:[J4,K4,Q4,e7,t7,n7,r7,i7,o7,a7,s7],setup:e=>{const t=new hi(void 0);e.context.event$.subscribe(S=>{S.eventName==="zoom"&&S.data&&S.data.scaleDomain&&t.next(S.data.scaleDomain)});const n=e.pluginParams$.pipe(T(S=>S.categoryAxis),U(S=>t.pipe(T(M=>M?{...S,scaleDomain:M}:S))),W(1)),r=e.pluginParams$.pipe(T(S=>S.valueAxis),W(1)),i=O({gridData:e.context.gridData$,datasetIndex:e.pluginParams$.pipe(T(S=>S.datasetIndex))}).pipe(X(0),T(({gridData:S,datasetIndex:M})=>S[M]),W(1)),o=Bn({size$:e.context.size$,padding$:e.pluginParams$.pipe(T(S=>S.styles.padding))}).pipe(W(1)),a=yC({selectedGridData$:i,pluginParams$:e.pluginParams$}).pipe(W(1)),s=dn(e.context.theme$).pipe(W(1)),u=e.pluginParams$.pipe(T(S=>S.separateSeries),H(),W(1)),l=wC({selectedGridData$:i,pluginParams$:e.pluginParams$,layout$:o}).pipe(W(1)),c=Bh({layout$:o,containerPosition$:l,container$:e.pluginParams$.pipe(T(S=>S.container))}).pipe(W(1)),h=j1({categoryAxis$:n,valueAxis$:r,layout$:o}).pipe(W(1)),f=xC({categoryAxis$:n,valueAxis$:r,containerSize$:c}).pipe(W(1)),p=a.pipe(T(S=>S.flat())).pipe(W(1)),d=vr({datumList$:p,styles$:e.pluginParams$.pipe(T(S=>S.styles)),event$:e.context.event$}).pipe(W(1)),g=vC({computedData$:a}),m=di({datumList$:p}).pipe(W(1)),y=gi({datumList$:p}).pipe(W(1)),b=bC({computedData$:a,categoryAxis$:n,valueAxis$:r,layout$:o}).pipe(W(1)),x=SC({computedData$:a}).pipe(W(1)),v=$C({computedAxesData$:b}).pipe(W(1)),_=_C({computedData$:a,isSeriesSeprate$:u}).pipe(W(1)),w=TC({selectedGridData$:i,categoryAxis$:n}).pipe(W(1)),P=U1({computedData$:a,categoryScaleDomainValue$:w}).pipe(W(1)),C=U1({computedData$:_,categoryScaleDomainValue$:w}).pipe(W(1)),L=AC({categoryAxis$:n,valueAxis$:r,layout$:o}).pipe(W(1)),E=DC({gridAxesTransform$:L}).pipe(W(1)),N=MC({computedData$:a,categoryScaleDomainValue$:w,filteredMinMaxValue$:P,categoryAxis$:n,valueAxis$:r,layout$:o}).pipe(W(1)),A=PC({gridContainerPosition$:l,gridAxesTransform$:L,gridGraphicTransform$:N}).pipe(W(1)),R={layout$:o,computedData$:a,fontSizePx$:s,isSeriesSeprate$:u,gridContainerPosition$:l,containerSize$:c,gridAxesSize$:h,gridAxesContainerSize$:f,gridHighlight$:d,seriesLabels$:g,SeriesDataMap$:m,CategoryDataMap$:y,computedAxesData$:b,visibleComputedData$:x,visibleComputedAxesData$:v,computedStackedData$:_,categoryScaleDomainValue$:w,filteredMinMaxValue$:P,filteredStackedMinMaxValue$:C,gridAxesTransform$:L,gridAxesReverseTransform$:E,gridGraphicTransform$:N,gridGraphicReverseScale$:A,zoomedCategoryAxis$:n};return e.context={...e.context,...R},()=>{}},validator:e=>{const t=G.validateObject(e,{styles:{toBeTypes:["object"]},visibleFilter:{toBeTypes:["Function"]},container:{toBeTypes:["object"]},valueAxis:{toBeTypes:["object"]},categoryAxis:{toBeTypes:["object"]},separateSeries:{toBeTypes:["boolean"]},datasetIndex:{toBeTypes:["number"]}});if(t.status==="error")return t;if(e.styles){const n=G.validateObject(e.styles,{padding:{toBeTypes:["object"]},highlightTarget:{toBeTypes:["string"]},highlightDefault:{toBeTypes:["string","null"]},unhighlightedOpacity:{toBeTypes:["number"]},transitionDuration:{toBeTypes:["number"]},transitionEase:{toBeTypes:["string"]}});if(n.status==="error")return n;if(e.styles.padding){const r=G.validateObject(e.styles.padding,{top:{toBeTypes:["number"]},right:{toBeTypes:["number"]},bottom:{toBeTypes:["number"]},left:{toBeTypes:["number"]}});if(r.status==="error")return r}}if(e.container){const n=G.validateObject(e.container,{columnAmount:{toBeTypes:["number"]},rowAmount:{toBeTypes:["number"]},columnGap:{toBe:'number | "auto"',test:r=>typeof r=="number"||r==="auto"},rowGap:{toBe:'number | "auto"',test:r=>typeof r=="number"||r==="auto"}});if(n.status==="error")return n}if(e.valueAxis){const n=G.validateObject(e.valueAxis,{position:{toBe:'"bottom" | "left" | "top" | "right"',test:r=>r==="bottom"||r==="left"||r==="top"||r==="right"},scaleDomain:{toBe:'[number | "min" | "auto", number | "max" | "auto"]',test:r=>Array.isArray(r)&&r.length===2&&(typeof r[0]=="number"||r[0]==="min"||r[0]==="auto")&&(typeof r[1]=="number"||r[1]==="max"||r[1]==="auto")},scaleRange:{toBe:"[number, number]",test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"},label:{toBeTypes:["string"]}});if(n.status==="error")return n}if(e.categoryAxis){const n=G.validateObject(e.categoryAxis,{position:{toBe:'"bottom" | "left" | "top" | "right"',test:r=>r==="bottom"||r==="left"||r==="top"||r==="right"},scaleDomain:{toBe:'[number, number | "max"]',test:r=>Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&(typeof r[1]=="number"||r[1]==="max")},scalePadding:{toBeTypes:["number"]},label:{toBeTypes:["string"]}});if(n.status==="error")return n}return t}}),hb={styles:{padding:{top:20,right:20,bottom:60,left:20},highlightTarget:"datum",highlightDefault:null,unhighlightedOpacity:.3,transitionDuration:800,transitionEase:"easeCubic"},visibleFilter:e=>!0,datasetIndex:0},qf={paddingInner:2,paddingOuter:2,labelColorType:"dataContrast",squarifyRatio:1.618034,sort:(e,t)=>t.value-e.value};qf.sort.toString=()=>"(a, b) => b.value - a.value";const u7=({selectedTreeData$:e,pluginParams$:t})=>O({selectedTreeData:e,pluginParams:t}).pipe(X(0),T(({selectedTreeData:n,pluginParams:r})=>{function i(o,a=!0){const s=a&&(!r.visibleFilter||r.visibleFilter(o));return{...o,visible:s,children:(o.children||[]).map(u=>i(u,s))}}return i(n)})),c7=({computedData$:e})=>e.pipe(T(t=>{function n(r,i){return r.push(i),i.children&&i.children.forEach(o=>{r=n(r,o)}),r}return n([],t)})),f7=e=>e.pipe(T(t=>Array.from(t.keys())),H((t,n)=>JSON.stringify(t)===JSON.stringify(n))),h7=({computedData$:e})=>e.pipe(T(t=>{function n(r){const i=(r.children||[]).filter(o=>o.visible!==!1).map(o=>n(o));return{...r,children:i}}return n(t)})),si="HierarchyPlot",pr="TreeMap",pb=Z(si,pr,"tree"),db=Z(si,pr,"tile");function p7({selection:e,treeData:t,layerParams:n,theme:r,fontSizePx:i}){const o=i/2,a=i,s=e.selectAll(`g.${pb}`).data(t,u=>u.data.id).join("g").attr("class",pb);return s.attr("transform",u=>!u.x0||!u.y0?null:`translate(${u.x0},${u.y0})`).each((u,l,c)=>{const h=I(c[l]);h.selectAll(`rect.${db}`).data([u],f=>f.data.id).join("rect").attr("id",f=>f.data.id).attr("class",db).attr("cursor","pointer").attr("width",f=>f.x1-f.x0).attr("height",f=>f.y1-f.y0).attr("fill",f=>f.data.color).attr("data-name",f=>f.data.name).attr("data-category",f=>f.data.series).attr("data-value",f=>f.data.value),h.selectAll("g").data([u]).join("g").each((f,p,d)=>{I(d[p]).selectAll("text").data([f]).join("text").text(m=>m.data.name).attr("dominant-baseline","hanging").attr("x",o).attr("y",o).attr("font-size",r.fontSize).each(function(m){const y=I(this),b=m.data.name.split(/\s+/).reverse();let x,v=[];const _=y.attr("x");let w=y.attr("y"),P=0,C=y.text(null).append("tspan").attr("cursor","pointer").attr("fill",Te({colorType:n.labelColorType,datum:m.data,theme:r})).attr("font-size",r.fontSize).attr("x",_).attr("y",w);for(;x=b.pop();)v.push(x),C.text(v.join(" ")),C.node().getComputedTextLength()>m.x1-m.x0-o&&(v.pop(),C.text(v.join(" ")),v=[x],P+=a,C=y.append("tspan").attr("cursor","pointer").attr("fill",Te({colorType:n.labelColorType,datum:m.data,theme:r})).attr("font-size",r.fontSize).attr("x",_).attr("y",w).attr("dy",P+"px").text(x))})})}),s}function d7({selection:e,ids:t,styles: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)?I(o[i]).style("opacity",1):I(o[i]).style("opacity",n.unhighlightedOpacity)})}const g7=G.defineSVGLayer({name:pr,defaultParams:qf,layerIndex:Dt,initShow:!0,validator:e=>G.validateObject(e,{paddingInner:{toBeTypes:["number"]},paddingOuter:{toBeTypes:["number"]},labelColorType:{toBeOption:"ColorType"},squarifyRatio:{toBeTypes:["number"]},sort:{toBeTypes:["Function"]}}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee,o=I(e);r.layout$.pipe(k(i)).subscribe(u=>{o.attr("transform",`translate(${u.left}, ${u.top})`)});const a=O({layout:r.layout$,visibleComputedData:r.visibleComputedData$,layerParams:n}).pipe(k(i),X(0),T(u=>{const l=J0().size([u.layout.width,u.layout.height]).paddingInner(u.layerParams.paddingInner).paddingOuter(u.layerParams.paddingOuter).round(!0).tile(qc.ratio(u.layerParams.squarifyRatio)),c=ws(u.visibleComputedData).sum(f=>f.value).sort(u.layerParams.sort);return l(c),c.leaves()})),s=O({selection:Io(o),treeData:a,layerParams:n,theme:r.theme$,fontSizePx:r.fontSizePx$}).pipe(k(i),X(0),T(u=>p7({selection:o,treeData:u.treeData,layerParams:u.layerParams,theme:u.theme,fontSizePx:u.fontSizePx})));return s.subscribe(u=>{u.on("mouseover",(l,c)=>{l.stopPropagation(),r.eventTrigger$.next({eventName:"mouseover",pluginName:si,layerName:pr,target:c.data,event:l})}).on("mousemove",(l,c)=>{l.stopPropagation(),r.eventTrigger$.next({eventName:"mousemove",pluginName:si,layerName:pr,target:c.data,event:l})}).on("mouseout",(l,c)=>{l.stopPropagation(),r.eventTrigger$.next({eventName:"mouseout",pluginName:si,layerName:pr,target:c.data,event:l})}).on("click",(l,c)=>{l.stopPropagation(),r.eventTrigger$.next({eventName:"click",pluginName:si,layerName:pr,target:c.data,event:l})})}),O({cellSelection:s,highlight:r.treeHighlight$.pipe(T(u=>u.map(l=>l.id))),styles:t.pipe(T(u=>u.styles))}).pipe(k(i),X(0)).subscribe(u=>{d7({selection:u.cellSelection,ids:u.highlight,styles:u.styles})}),()=>{i.next(void 0)}}}),m7=new g7,y7=G.defineSVGPlugin({name:"HierarchyPlot",defaultParams:hb,layers:[m7],setup:e=>{const t=O({treeData:e.context.treeData$,datasetIndex:e.pluginParams$.pipe(T(h=>h.datasetIndex))}).pipe(X(0),T(({treeData:h,datasetIndex:f})=>h[f]),W(1)),n=Bn({size$:e.context.size$,padding$:e.pluginParams$.pipe(T(h=>h.styles.padding))}).pipe(W(1)),r=u7({selectedTreeData$:t,pluginParams$:e.pluginParams$}).pipe(W(1)),i=dn(e.context.theme$).pipe(W(1)),o=c7({computedData$:r}).pipe(W(1)),a=vr({datumList$:o,styles$:e.pluginParams$.pipe(T(h=>h.styles)),event$:e.context.event$}).pipe(W(1)),s=gi({datumList$:o}).pipe(W(1)),u=f7(s).pipe(W(1)),l=h7({computedData$:r}).pipe(W(1)),c={layout$:n,computedData$:r,fontSizePx$:i,treeHighlight$:a,categoryLabels$:u,CategoryDataMap$:s,visibleComputedData$:l};return e.context={...e.context,...c},()=>{}},validator:e=>{const t=G.validateObject(e,{styles:{toBeTypes:["object"]},visibleFilter:{toBeTypes:["Function"]},datasetIndex:{toBeTypes:["number"]}});if(t.status==="error")return t;if(e.styles){const n=G.validateObject(e.styles,{padding:{toBeTypes:["object"]},highlightTarget:{toBeTypes:["string"]},highlightDefault:{toBeTypes:["string","null"]},unhighlightedOpacity:{toBeTypes:["number"]},transitionDuration:{toBeTypes:["number"]},transitionEase:{toBeTypes:["string"]}});if(n.status==="error")return n;if(e.styles.padding){const r=G.validateObject(e.styles.padding,{top:{toBeTypes:["number"]},right:{toBeTypes:["number"]},bottom:{toBeTypes:["number"]},left:{toBeTypes:["number"]}});if(r.status==="error")return r}}return t}}),Zf={styles:{padding:{top:60,right:60,bottom:60,left:60},highlightTarget:"datum",highlightDefault:null,unhighlightedOpacity:.3,transitionDuration:800,transitionEase:"easeCubic"},visibleFilter:e=>!0,sort:null,datasetIndex:0};Zf.visibleFilter.toString=()=>"(datum) => true";const gb={placement:"bottom",padding:5,backgroundFill:"none",backgroundStroke:"none",gap:10,listRectWidth:14,listRectHeight:14,listRectRadius:0,textColorType:"primary"},b7=({selectedSeriesData$:e,pluginParams$:t})=>O({selectedSeriesData:e,pluginParams:t}).pipe(X(0),T(({selectedSeriesData:n,pluginParams:r})=>n.flat().sort(r.sort??void 0).map((i,o)=>{const a=r.visibleFilter;return{...i,visible:a?a(i):!0,seq:o}}).sort((i,o)=>i.index-o.index).reduce((i,o)=>(i[o.seriesIndex]||(i[o.seriesIndex]=[]),i[o.seriesIndex].push(o),i),[]))),x7=" - ",v7={listRectWidth:14,listRectHeight:14,listRectRadius:0};function mb(e,t){const n=e<t.colors[Ao(t.colorScheme)].data.length?e:e%t.colors[Ao(t.colorScheme)].data.length;return t.colors[Ao(t.colorScheme)].data[n]}const S7=({pluginName:e,layerName:t,rootSelection:n,legendLabels$:r,baseLegendParams$:i,layout$:o,theme$:a,fontSizePx$:s})=>{const u=Z(e,t,"root-position"),l=Z(e,t,"legend-card"),c=Z(e,t,"legend-list"),h=Z(e,t,"legend-item"),f=new ee,p=O({legendLabels:r,theme:a}).pipe(k(f),X(0),T(A=>{const R=new Map;let S=0;return A.legendLabels.forEach((M,$)=>{if(!R.has(M)){const B=mb(S,A.theme);R.set(M,B),S++}}),R})),d=r.pipe(k(f),T(A=>{const R=new Set;let S=[];return A.forEach(M=>{R.has(M)?S.push(!1):S.push(!0),R.add(M)}),S})),g=i.pipe(k(f),T(A=>A.placement==="top"||A.placement==="top-start"||A.placement==="top-end"?"top":A.placement==="bottom"||A.placement==="bottom-start"||A.placement==="bottom-end"?"bottom":A.placement==="left"||A.placement==="left-start"||A.placement==="left-end"?"left":"right"),H((A,R)=>A===R),W(1)),m=i.pipe(k(f),T(A=>A.placement==="top-start"||A.placement==="bottom-start"||A.placement==="left-start"||A.placement==="right-start"?"start":A.placement==="top-end"||A.placement==="bottom-end"||A.placement==="left-end"||A.placement==="right-end"?"end":(A.placement==="top"||A.placement==="bottom"||A.placement==="left"||A.placement==="right","center")),H((A,R)=>A===R),W(1)),y=g.pipe(k(f),T(A=>A==="bottom"||A==="top"?"row":"column"),H((A,R)=>A===R),W(1)),b=O({baseLegendParams:i,position:g,layout:o}).pipe(k(f),X(0),T(A=>{const R=A.baseLegendParams.padding*2+A.baseLegendParams.gap*2;return A.position==="bottom"||A.position==="top"?A.layout.rootWidth-R:A.layout.rootHeight-R})),v=O({layout:o,position:g,justify:m}).pipe(k(f),X(0),T(A=>{let R=0,S=0;return A.position==="bottom"?(S=A.layout.rootHeight,A.justify==="start"?R=0:A.justify==="center"?R=A.layout.rootWidth/2:A.justify==="end"&&(R=A.layout.rootWidth)):A.position==="right"?(R=A.layout.rootWidth,A.justify==="start"?S=0:A.justify==="center"?S=A.layout.rootHeight/2:A.justify==="end"&&(S=A.layout.rootHeight)):A.position==="top"?(S=0,A.justify==="start"?R=0:A.justify==="center"?R=A.layout.rootWidth/2:A.justify==="end"&&(R=A.layout.rootWidth)):A.position==="left"&&(R=0,A.justify==="start"?S=0:A.justify==="center"?S=A.layout.rootHeight/2:A.justify==="end"&&(S=A.layout.rootHeight)),{x:R,y:S}})).pipe(k(f),T(A=>n.selectAll(`g.${u}`).data([A]).join(R=>R.append("g").classed(u,!0).attr("transform",S=>`translate(${S.x}, ${S.y})`),R=>R.transition().attr("transform",S=>`translate(${S.x}, ${S.y})`),R=>R.remove()))),_=i.pipe(k(f),T(A=>A.labelList[0]?A.labelList[0]:v7)),w=O({visibleList:d,baseLegendParams:i,legendLabels:r,lineDirection:y,lineMaxSize:b,defaultListStyle:_,SeriesLabelColorMap:p,fontSizePx:s}).pipe(k(f),X(0),T(A=>A.legendLabels.reduce((R,S,M)=>{if(!A.visibleList[M])return R;const $=S!==""?S:x7,B=mi($,A.fontSizePx),D=A.fontSizePx*1.5+B,z=A.SeriesLabelColorMap.get(S),F=R[0]&&R[0][0]?R[R.length-1][R[R.length-1].length-1]:null,{translateX:j,translateY:K,lineIndex:se,itemIndex:te}=((J,ie,ue)=>{let q=0,re=0,ce=0,V=0;if(J.lineDirection==="column"){let ve=ue?ue.translateY+J.fontSizePx+J.baseLegendParams.gap:0;if(ve+J.fontSizePx>J.lineMaxSize){ce=ue.lineIndex+1,V=0,re=0;const be=ie[ie.length-1].reduce((Ye,We)=>We.itemWidth>Ye?We.itemWidth:Ye,0);q=ue.translateX+be+J.baseLegendParams.gap}else ce=ue?ue.lineIndex:0,V=ue?ue.itemIndex+1:0,re=ve,q=ue?ue.translateX:0}else{let ve=ue?ue.translateX+ue.itemWidth+J.baseLegendParams.gap:0;ve+D>J.lineMaxSize?(ce=ue.lineIndex+1,V=0,q=0):(ce=ue?ue.lineIndex:0,V=ue?ue.itemIndex+1:0,q=ve),re=(J.fontSizePx+J.baseLegendParams.gap)*ce}return{translateX:q,translateY:re,lineIndex:ce,itemIndex:V}})(A,R,F);R[se]||(R[se]=[]);const Y=A.baseLegendParams.labelList[te]?A.baseLegendParams.labelList[te]:A.defaultListStyle;return R[se].push({id:$,seriesLabel:$,seriesIndex:M,lineIndex:se,itemIndex:te,text:$,itemWidth:D,translateX:j,translateY:K,color:z,listRectWidth:Y.listRectWidth,listRectHeight:Y.listRectHeight,listRectRadius:Y.listRectRadius}),R},[])),W(1)),P=O({baseLegendParams:i,lineDirection:y,lengendItems:w,fontSizePx:s}).pipe(k(f),X(0),T(A=>{const{width:R,height:S}=((M,$)=>{let B=0,D=0;if(!$.length||!$[0].length)return{width:B,height:D};const z=$[0][$[0].length-1];return M.lineDirection==="column"?(B=$.reduce((F,j)=>{const K=j.reduce((se,te)=>te.itemWidth>se?te.itemWidth:se,0);return F+K},0),B+=M.baseLegendParams.gap*($.length-1),D=z.translateY+M.fontSizePx):(B=z.translateX+z.itemWidth,D=M.fontSizePx*$.length+M.baseLegendParams.gap*($.length-1)),{width:B,height:D}})(A,A.lengendItems);return{direction:A.lineDirection,width:R,height:S,translateX:A.baseLegendParams.gap,translateY:A.baseLegendParams.gap}}),W(1)),C=O({baseLegendParams:i,position:g,justify:m,lengendList:P}).pipe(k(f),X(0),T(A=>{const R=A.lengendList.width+A.baseLegendParams.gap*2,S=A.lengendList.height+A.baseLegendParams.gap*2;let M=0,$=0;return A.position==="left"?A.justify==="start"?(M=A.baseLegendParams.padding,$=A.baseLegendParams.padding):A.justify==="center"?(M=A.baseLegendParams.padding,$=-S/2):A.justify==="end"&&(M=A.baseLegendParams.padding,$=-S-A.baseLegendParams.padding):A.position==="right"?A.justify==="start"?(M=-R-A.baseLegendParams.padding,$=A.baseLegendParams.padding):A.justify==="center"?(M=-R-A.baseLegendParams.padding,$=-S/2):A.justify==="end"&&(M=-R-A.baseLegendParams.padding,$=-S-A.baseLegendParams.padding):A.position==="top"?A.justify==="start"?(M=A.baseLegendParams.padding,$=A.baseLegendParams.padding):A.justify==="center"?(M=-R/2,$=A.baseLegendParams.padding):A.justify==="end"&&(M=-R-A.baseLegendParams.padding,$=A.baseLegendParams.padding):A.justify==="start"?(M=A.baseLegendParams.padding,$=-S-A.baseLegendParams.padding):A.justify==="center"?(M=-R/2,$=-S-A.baseLegendParams.padding):A.justify==="end"&&(M=-R-A.baseLegendParams.padding,$=-S-A.baseLegendParams.padding),{width:R,height:S,translateX:M,translateY:$}})),L=O({rootPositionSelection:v,baseLegendParams:i,theme:a,legendCard:C}).pipe(k(f),X(0),T(A=>A.rootPositionSelection.selectAll("g").data([A.legendCard]).join(R=>R.append("g").classed(l,!0).attr("transform",S=>`translate(${S.translateX}, ${S.translateY})`),R=>R.transition().attr("transform",S=>`translate(${S.translateX}, ${S.translateY})`),R=>R.remove()).each((R,S,M)=>{I(M[S]).selectAll("rect").data([R]).join("rect").attr("width",$=>$.width).attr("height",$=>$.height).attr("fill",xe(A.baseLegendParams.backgroundFill,A.theme)).attr("stroke",xe(A.baseLegendParams.backgroundStroke,A.theme))}))),E=O({lengendCardSelection:L,baseLegendParams:i,lengendList:P}).pipe(k(f),X(0),T(A=>A.lengendCardSelection.selectAll("g").data([A.lengendList]).join(R=>R.append("g").classed(c,!0).attr("transform",S=>`translate(${S.translateX}, ${S.translateY})`),R=>R.transition().attr("transform",S=>`translate(${S.translateX}, ${S.translateY})`),R=>R.remove())));return O({lengendListSelection:E,baseLegendParams:i,theme:a,lengendItems:w,fontSizePx:s}).pipe(k(f),X(0),T(A=>{const R=A.lengendItems[0]?A.lengendItems.flat():[];return A.lengendListSelection.selectAll(`g.${h}`).data(R).join(S=>S.append("g").classed(h,!0).attr("cursor","default"),S=>S,S=>S.remove()).attr("transform",(S,M)=>`translate(${S.translateX}, ${S.translateY})`).each((S,M,$)=>{const B=A.fontSizePx/2,D=-S.listRectWidth/2,z=-S.listRectHeight/2;I($[M]).selectAll("rect").data([S]).join("rect").attr("x",B).attr("y",B).attr("width",F=>F.listRectWidth).attr("height",F=>F.listRectHeight).attr("transform",F=>`translate(${D}, ${z})`).attr("fill",F=>F.color).attr("rx",F=>F.listRectRadius),I($[M]).selectAll("text").data([S]).join(F=>F.append("text").attr("dominant-baseline","hanging"),F=>F,F=>F.remove()).attr("x",A.fontSizePx*1.5).attr("font-size",A.theme.fontSize).attr("fill",F=>A.baseLegendParams.textColorType==="data"?mb(F.seriesIndex,A.theme):xe(A.baseLegendParams.textColorType,A.theme)).text(F=>F.text)})})).subscribe(),()=>{n.select(`g.${u}`).remove(),f.next(void 0)}},$7="Legend",yb="Legend",w7=G.defineSVGLayer({name:yb,defaultParams:gb,layerIndex:E1,initShow:!0,validator:e=>G.validateObject(e,{placement:{toBe:'"top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end"',test:n=>["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].includes(n)},padding:{toBeTypes:["number"]},backgroundFill:{toBeOption:"ColorType"},backgroundStroke:{toBeOption:"ColorType"},gap:{toBeTypes:["number"]},listRectWidth:{toBeTypes:["number"]},listRectHeight:{toBeTypes:["number"]},listRectRadius:{toBeTypes:["number"]},textColorType:{toBeOption:"ColorType"}}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee,o=r.SeriesDataMap$.pipe(k(i),T(u=>Array.from(u.keys()))),a=n.pipe(k(i),T(u=>{const l=[{listRectWidth:u.listRectWidth,listRectHeight:u.listRectHeight,listRectRadius:u.listRectRadius}];return{...u,labelList:l}})),s=S7({pluginName:$7,layerName:yb,rootSelection:I(r.svg),legendLabels$:o,baseLegendParams$:a,layout$:r.layout$,theme$:r.theme$,fontSizePx$:r.fontSizePx$});return()=>{i.next(void 0),s()}}}),_7=new w7,T7=G.defineSVGPlugin({name:"Legend",defaultParams:Zf,layers:[_7],setup:e=>{const t=O({seriesData:e.context.seriesData$,datasetIndex:e.pluginParams$.pipe(T(u=>u.datasetIndex))}).pipe(X(0),T(({seriesData:u,datasetIndex:l})=>u[l]),W(1)),n=Bn({size$:e.context.size$,padding$:e.pluginParams$.pipe(T(u=>u.styles.padding))}).pipe(W(1)),r=b7({selectedSeriesData$:t,pluginParams$:e.pluginParams$}).pipe(W(1)),i=dn(e.context.theme$).pipe(W(1)),o=r.pipe(T(u=>u.flat())).pipe(W(1)),a=di({datumList$:o}).pipe(W(1)),s={layout$:n,fontSizePx$:i,SeriesDataMap$:a};return e.context={...e.context,...s},()=>{}},validator:e=>{const t=G.validateObject(e,{styles:{toBeTypes:["object"]},datasetIndex:{toBeTypes:["number"]}});if(e.styles){const n=G.validateObject(e.styles,{padding:{toBeTypes:["object"]},highlightTarget:{toBeTypes:["string"]},highlightDefault:{toBeTypes:["string","null"]},unhighlightedOpacity:{toBeTypes:["number"]},transitionDuration:{toBeTypes:["number"]},transitionEase:{toBeTypes:["string"]}});if(n.status==="error")return n;if(e.styles.padding){const r=G.validateObject(e.styles.padding,{top:{toBeTypes:["number"]},right:{toBeTypes:["number"]},bottom:{toBeTypes:["number"]},left:{toBeTypes:["number"]}});if(r.status==="error")return r}}return t}}),bb={styles:{padding:{top:20,right:20,bottom:20,left:20},highlightTarget:"datum",highlightDefault:null,unhighlightedOpacity:.3,transitionDuration:800,transitionEase:"easeCubic"},visibleFilter:e=>!0,datasetIndex:0},li={dot:{radius:10,fillColorType:"data",strokeColorType:"data",strokeWidth:1,styleFn:e=>""},dotLabel:{colorType:"primary",sizeFixed:!1,styleFn:e=>""},arrow:{colorType:"primary",strokeWidth:1.5,pointerWidth:5,pointerHeight:5,styleFn:e=>""},arrowLabel:{colorType:"primary",sizeFixed:!1,styleFn:e=>""},force:{nodeStrength:-500,linkDistance:100,velocityDecay:.1,alphaDecay:.05},zoomable:!0,transform:{x:0,y:0,k:1},scaleExtent:{min:0,max:1/0}};li.dot.styleFn.toString=()=>"(node) => ''",li.dotLabel.styleFn.toString=()=>"(node) => ''",li.arrow.styleFn.toString=()=>"(edge) => ''",li.arrowLabel.styleFn.toString=()=>"(edge) => ''";const ui={bubble:{radiusMin:15,radiusMax:45,arcScaleType:"area",fillColorType:"data",strokeColorType:"data",strokeWidth:1,styleFn:e=>""},bubbleLabel:{fillRate:.9,lineHeight:1,maxLineLength:6,wordBreakAll:!0,colorType:"dataContrast",styleFn:e=>""},arrow:{colorType:"primary",strokeWidthMin:1.5,strokeWidthMax:4.5,pointerWidth:5,pointerHeight:5,styleFn:e=>""},arrowLabel:{colorType:"primary",sizeFixed:!1,styleFn:e=>""},force:{nodeStrength:-500,linkDistance:130,velocityDecay:.1,alphaDecay:.05},zoomable:!0,transform:{x:0,y:0,k:1},scaleExtent:{min:0,max:1/0}};ui.bubble.styleFn.toString=()=>"(node) => ''",ui.bubbleLabel.styleFn.toString=()=>"(node) => ''",ui.arrow.styleFn.toString=()=>"(edge) => ''",ui.arrowLabel.styleFn.toString=()=>"(edge) => ''";const A7=({selectedGraphData$:e,pluginParams$:t})=>O({selectedGraphData:e,pluginParams:t}).pipe(X(0),T(({selectedGraphData:n,pluginParams:r})=>{const i=n.nodes.map((s,u)=>{const l=r.visibleFilter;return{...s,visible:l?l(s):!0}}),o=new Map(i.map(s=>[s.id,s])),a=n.edges.map((s,u)=>{const l=o.get(s.source),c=o.get(s.target);return{...s,visible:!!(l&&c&&l.visible&&c.visible)}});return{nodes:i,edges:a}})),D7=(e,t)=>O({CategoryNodeMap:e,CategoryEdgeMap:t}).pipe(U(async n=>n),T(n=>[...Array.from(n.CategoryNodeMap.keys()),...Array.from(n.CategoryEdgeMap.keys())]),H((n,r)=>JSON.stringify(n)===JSON.stringify(r))),M7=e=>e.pipe(T(t=>{const n=new Map;return t.nodes.forEach(r=>{n.set(r.id,r)}),n})),P7=e=>e.pipe(T(t=>{const n=new Map;return t.edges.forEach(r=>{n.set(r.id,r)}),n})),C7=({computedData$:e,NodeMap$:t})=>O({computedData:e,NodeMap:t}).pipe(U(async n=>n),T(n=>({nodes:n.computedData.nodes.filter(r=>r.visible),edges:n.computedData.edges.filter(r=>r.visible).filter(r=>n.NodeMap.has(r.source)&&n.NodeMap.has(r.target))}))),Ge="NetworkPlot",Ie="ForceDirected",L7=Z(Ge,Ie,"zoom-area"),xb=At(Ge,Ie,"arrow"),vb=Z(Ge,Ie,"arrow-marker"),k7=Z(Ge,Ie,"edge-list-g"),R7=Z(Ge,Ie,"edge-g"),Sb=Z(Ge,Ie,"edge-arrow-path"),$b=Z(Ge,Ie,"edge-label-g"),wb=Z(Ge,Ie,"edge-label"),E7=Z(Ge,Ie,"node-list-g"),N7=Z(Ge,Ie,"node-g"),_b=Z(Ge,Ie,"node-circle"),Tb=Z(Ge,Ie,"node-label-g"),Ab=Z(Ge,Ie,"node-label");function B7(e,t){return za().velocityDecay(t.force.velocityDecay).alphaDecay(t.force.alphaDecay).force("link",Hu().id(n=>n.id).strength(1).distance(n=>t.force.linkDistance)).force("charge",Oa().strength(t.force.nodeStrength)).force("collision",Ba(t.dot.radius).strength(1)).force("center",ju(e.width/2,e.height/2))}function z7(e){return"translate("+e.x+","+e.y+")"}function O7(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 I7(e){return"M"+e._source.x+","+e._source.y+" L"+e._target.x+","+e._target.y}function F7(e,t,n){return e.selectAll(`marker.${vb}`).data([t]).join(r=>{const i=r.append("marker").classed(vb,!0).attr("id",xb).attr("fill",o=>xe(t.arrow.colorType,n)).attr("viewBox",o=>`-${o.arrow.pointerWidth} -${o.arrow.pointerHeight/2} ${o.arrow.pointerWidth} ${o.arrow.pointerHeight}`).attr("orient","auto");return i.append("path").attr("d",o=>`M${-o.arrow.pointerWidth},${-o.arrow.pointerHeight/2}L0,0L${-o.arrow.pointerWidth},${o.arrow.pointerHeight/2}`),i},r=>r,r=>r.remove()).attr("markerWidth",r=>r.arrow.pointerWidth).attr("markerHeight",r=>r.arrow.pointerHeight).attr("refX",r=>(r.dot.radius+t.dot.strokeWidth/2)/r.arrow.strokeWidth-1).attr("refY",0)}function Y7(e,t){function n(o,a){o.active||e.alphaTarget(.3).restart(),o.subject.fx=o.x,o.subject.fy=o.y,t.next("start")}function r(o,a){o.subject.fx=o.x,o.subject.fy=o.y,t.next("drag")}function i(o,a){o.active||e.alphaTarget(0),o.subject.fx=null,o.subject.fy=null,t.next("end")}return aa().on("start",n).on("drag",r).on("end",i)}function W7({nodeListGSelection:e,nodes:t}){return e.selectAll("g").data(t,n=>n.id).join(n=>n.append("g").classed(N7,!0),n=>n,n=>n.remove())}function X7({nodeGSelection:e,layerParams:t,theme:n}){return e.each((r,i,o)=>{I(o[i]).selectAll("circle").data([r]).join(s=>s.append("circle").classed(_b,!0).attr("cursor","pointer"),s=>s,s=>s.remove()).attr("r",t.dot.radius).attr("fill",s=>Te({datum:s,colorType:t.dot.fillColorType,theme:n})).attr("stroke",s=>Te({datum:s,colorType:t.dot.strokeColorType,theme:n})).attr("stroke-width",t.dot.strokeWidth).attr("style",s=>t.dot.styleFn(s))}),e.select(`circle.${_b}`)}function G7({nodeGSelection:e,layerParams:t}){return e.each((n,r,i)=>{I(i[r]).selectAll("g").data([n]).join(a=>a.append("g").classed(Tb,!0),a=>a,a=>a.remove()).attr("transform",`translate(0, ${-t.dot.radius-10})`)}),e.select(`g.${Tb}`)}function V7({nodeLabelGSelection:e,layerParams:t,theme:n}){return e.each((r,i,o)=>{I(o[i]).selectAll("text").data([r],s=>s.id).join(s=>s.append("text").classed(Ab,!0).attr("text-anchor","middle").attr("pointer-events","none"),s=>s,s=>s.remove()).text(s=>s.name).attr("fill",s=>Te({datum:s,colorType:t.dotLabel.colorType,theme:n})).attr("font-size",n.fontSize).attr("style",s=>t.dotLabel.styleFn(s))}),e.select(`text.${Ab}`)}function j7({edgeListGSelection:e,edges:t}){return e.selectAll("g").data(t,n=>n.id).join(n=>n.append("g").classed(R7,!0),n=>n,n=>n.remove())}function U7({edgeGSelection:e,layerParams:t,theme:n}){return e.each((r,i,o)=>{I(o[i]).selectAll("path").data([r]).join(s=>s.append("path").classed(Sb,!0).attr("marker-end",`url(#${xb})`),s=>s,s=>s.remove()).attr("stroke",s=>Te({datum:s.data,colorType:t.arrow.colorType,theme:n})).attr("stroke-width",t.arrow.strokeWidth).attr("style",s=>t.arrow.styleFn(s))}),e.select(`path.${Sb}`)}function H7({edgeGSelection:e}){return e.each((t,n,r)=>{I(r[n]).selectAll("g").data([t]).join(o=>o.append("g").classed($b,!0),o=>o,o=>o.remove())}),e.select(`g.${$b}`)}function q7({edgeLabelGSelection:e,layerParams:t,theme:n}){return e.each((r,i,o)=>{I(o[i]).selectAll("text").data([r],s=>s.id).join(s=>s.append("text").classed(wb,!0).attr("text-anchor","middle").attr("pointer-events","none"),s=>s,s=>s.remove()).text(s=>s.name).attr("fill",s=>Te({datum:s,colorType:t.arrowLabel.colorType,theme:n})).attr("font-size",n.fontSize).attr("style",s=>t.arrowLabel.styleFn(s))}),e.select(`text.${wb}`)}function Z7({nodeGSelection:e,edgeGSelection:t,highlightIds:n,styles:r}){if(e.interrupt("highlight"),t.interrupt("highlight"),!n.length){e.transition("highlight").style("opacity",1),t.transition("highlight").style("opacity",1);return}t.style("opacity",r.unhighlightedOpacity),e.each((i,o,a)=>{const s=I(a[o]);n.includes(i.id)?s.style("opacity",1).transition("highlight").ease(qn).duration(500):s.style("opacity",r.unhighlightedOpacity)})}const J7=G.defineSVGLayer({name:Ie,defaultParams:li,layerIndex:Dt,initShow:!0,validator:e=>{const t=G.validateObject(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 n=G.validateObject(e.dot,{radius:{toBeTypes:["number"]},fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},styleFn:{toBeTypes:["Function"]}});if(n.status==="error")return n}if(e.dotLabel){const n=G.validateObject(e.dotLabel,{colorType:{toBeOption:"ColorType"},sizeFixed:{toBeTypes:["boolean"]},styleFn:{toBeTypes:["Function"]}});if(n.status==="error")return n}if(e.arrow){const n=G.validateObject(e.arrow,{colorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},pointerWidth:{toBeTypes:["number"]},pointerHeight:{toBeTypes:["number"]},styleFn:{toBeTypes:["Function"]}});if(n.status==="error")return n}if(e.arrowLabel){const n=G.validateObject(e.arrowLabel,{colorType:{toBeOption:"ColorType"},sizeFixed:{toBeTypes:["boolean"]},styleFn:{toBeTypes:["Function"]}});if(n.status==="error")return n}if(e.force){const n=G.validateObject(e.force,{nodeStrength:{toBeTypes:["number"]},linkDistance:{toBeTypes:["number"]},velocityDecay:{toBeTypes:["number"]},alphaDecay:{toBeTypes:["number"]}});if(n.status==="error")return n}if(e.transform){const n=G.validateObject(e.transform,{x:{toBeTypes:["number"]},y:{toBeTypes:["number"]},k:{toBeTypes:["number"]}});if(n.status==="error")return n}if(e.scaleExtent){const n=G.validateObject(e.scaleExtent,{min:{toBeTypes:["number"]},max:{toBeTypes:["number"]}});if(n.status==="error")return n}return t},setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee,o=I(r.svg),a=I(e),s=a.append("g").classed(L7,!0),u=s.append("defs"),l=s.append("g").classed(k7,!0),c=s.append("g").classed(E7,!0);let h,f,p,d,g,m,y,b;const x=new hi("end"),v=new ee;r.layout$.pipe(k(i)).subscribe(C=>{a.attr("transform",`translate(${C.left}, ${C.top})`)}),O({layerParams:n,theme:r.theme$}).pipe(k(i),X(0),T(({layerParams:C,theme:L})=>F7(u,C,L))).subscribe();const _=n.pipe(k(i),T(C=>{let L=C.zoomable?un().on("zoom",E=>{s.attr("transform",`translate(
|
|
73
|
+
${E.transform.x},
|
|
74
|
+
${E.transform.y}
|
|
75
|
+
) scale(
|
|
76
|
+
${E.transform.k}
|
|
77
|
+
)`),C.dotLabel.sizeFixed&&d&&d.attr("transform",`scale(${1/E.transform.k})`),C.arrowLabel.sizeFixed&&b&&b.attr("transform",`scale(${1/E.transform.k})`)}):un().on("zoom",null);return C.scaleExtent&&L.scaleExtent([C.scaleExtent.min,C.scaleExtent.max]),o.call(L),L}));O({d3Zoom:_,transform:n.pipe(k(i),T(C=>C.transform))}).pipe(k(i),X(0)).subscribe(C=>{a.call(C.d3Zoom.transform,ai.translate(C.transform.x,C.transform.y).scale(C.transform.k))});const w=O({layout:r.layout$.pipe(Tl()),layerParams:n}).pipe(k(i),X(0),T(C=>B7(C.layout,C.layerParams)),W(1)),P=O({visibleComputedData:r.visibleComputedData$,NodeMap:r.NodeMap$}).pipe(k(i),T(C=>({nodes:C.visibleComputedData.nodes,edges:C.visibleComputedData.edges.map(L=>{let E=L;return E._source=C.NodeMap.get(L.source),E._target=C.NodeMap.get(L.target),E})})),W(1));return O({renderData:P,simulation:w,layerParams:n,theme:r.theme$}).pipe(k(i),X(0)).subscribe(C=>{h=W7({nodeListGSelection:c,nodes:C.renderData.nodes}),f=X7({nodeGSelection:h,layerParams:C.layerParams,theme:C.theme}),h.call(Y7(C.simulation,x)),p=G7({nodeGSelection:h,layerParams:C.layerParams}),d=V7({nodeLabelGSelection:p,layerParams:C.layerParams,theme:C.theme}),g=j7({edgeListGSelection:l,edges:C.renderData.edges}),m=U7({edgeGSelection:g,layerParams:C.layerParams,theme:C.theme}),y=H7({edgeGSelection:g}),b=q7({edgeLabelGSelection:y,layerParams:C.layerParams,theme:C.theme}),C.simulation.nodes(C.renderData.nodes).on("tick",()=>{m.attr("d",I7),h.attr("transform",z7),y.attr("transform",L=>O7(L))}),C.simulation.force("link").links(C.renderData.edges),C.simulation.alpha(.3).restart(),f.on("mouseover",(L,E)=>{L.stopPropagation(),v.next({eventName:"mouseover",pluginName:Ge,layerName:Ie,target:E,event:L})}).on("mousemove",(L,E)=>{L.stopPropagation(),v.next({eventName:"mousemove",pluginName:Ge,layerName:Ie,target:E,event:L})}).on("mouseout",(L,E)=>{L.stopPropagation(),v.next({eventName:"mouseout",pluginName:Ge,layerName:Ie,target:E,event:L})}).on("click",(L,E)=>{L.stopPropagation(),v.next({eventName:"click",pluginName:Ge,layerName:Ie,target:E,event:L})})}),x.pipe(H((C,L)=>C===L),U(C=>Nn(()=>C==="end",v,zo))).subscribe(C=>{r.eventTrigger$.next(C)}),O({renderData:P,highlightNodes:r.graphHighlightNodes$.pipe(T(C=>C.map(L=>L.id))),styles:t.pipe(T(C=>C.styles))}).pipe(k(i),X(0)).subscribe(C=>{!h||!g||Z7({nodeGSelection:h,edgeGSelection:g,styles:C.styles,highlightIds:C.highlightNodes})}),()=>{i.next(void 0)}}}),Ve="NetworkPlot",Fe="ForceDirectedBubbles",Db=12,K7=Z(Ve,Fe,"zoom-area"),Q7=At(Ve,Fe,"arrow"),Mb=Z(Ve,Fe,"arrow-marker"),e9=Z(Ve,Fe,"edge-list-g"),t9=Z(Ve,Fe,"edge-g"),Pb=Z(Ve,Fe,"edge-arrow-path"),Cb=Z(Ve,Fe,"edge-label-g"),Lb=Z(Ve,Fe,"edge-label"),n9=Z(Ve,Fe,"node-list-g"),r9=Z(Ve,Fe,"node-g"),kb=Z(Ve,Fe,"node-circle");Z(Ve,Fe,"node-label-g"),Z(Ve,Fe,"node-label");function i9(e,t){return za().velocityDecay(t.force.velocityDecay).alphaDecay(t.force.alphaDecay).force("link",Hu().id(n=>n.id).strength(1).distance(n=>t.force.linkDistance)).force("charge",Oa().strength(t.force.nodeStrength)).force("collision",Ba(t.bubble.radiusMax).strength(1)).force("center",ju(e.width/2,e.height/2))}function o9(e){return"translate("+e.x+","+e.y+")"}function a9(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 s9(e){return"M"+e._source.x+","+e._source.y+" L"+e._target.x+","+e._target.y}function l9({defsSelection:e,markerParams:t,markerData:n,layerParams:r,theme:i}){return e.selectAll(`marker.${Mb}`).data(n).join(o=>{const a=o.append("marker").classed(Mb,!0).attr("viewBox",t.viewBox).attr("orient","auto");return a.append("path").attr("d",t.d),a},o=>o,o=>o.remove()).attr("id",o=>o.id).attr("fill",o=>xe(r.arrow.colorType,i)).attr("markerWidth",t.pointerWidth).attr("markerHeight",t.pointerHeight).attr("refX",o=>o.refX).attr("refY",0)}function u9(e,t){function n(o,a){o.active||e.alphaTarget(.3).restart(),o.subject.fx=o.subject.x,o.subject.fy=o.subject.y,t.next("start")}function r(o,a){o.subject.fx=o.x,o.subject.fy=o.y,t.next("drag")}function i(o,a){o.active||e.alphaTarget(0),o.subject.fx=null,o.subject.fy=null,t.next("end")}return aa().on("start",n).on("drag",r).on("end",i)}function c9({nodeListGSelection:e,nodes:t}){return e.selectAll("g").data(t,n=>n.id).join(n=>n.append("g").classed(r9,!0),n=>n,n=>n.remove())}function f9({nodeGSelection:e,layerParams:t,theme:n}){return e.each((r,i,o)=>{I(o[i]).selectAll("circle").data([r]).join(s=>s.append("circle").classed(kb,!0).attr("cursor","pointer"),s=>s,s=>s.remove()).attr("r",s=>s.r).attr("fill",s=>Te({datum:s,colorType:t.bubble.fillColorType,theme:n})).attr("stroke",s=>Te({datum:s,colorType:t.bubble.strokeColorType,theme:n})).attr("stroke-width",t.bubble.strokeWidth).attr("style",s=>t.bubble.styleFn(s))}).attr("text-anchor","middle").attr("font-size",Db).each((r,i,o)=>{const a=I(o[i]);a.call(N1,{text:r.name,radius:r.r*t.bubbleLabel.fillRate,lineHeight:Db*t.bubbleLabel.lineHeight,isBreakAll:r.name.length<=t.bubbleLabel.maxLineLength?!1:t.bubbleLabel.wordBreakAll}),a.select("text").attr("fill",s=>Te({datum:r,colorType:t.bubbleLabel.colorType,theme:n}))}),e.select("text").attr("pointer-events","none").attr("style",r=>t.bubbleLabel.styleFn(r)),e.select(`circle.${kb}`)}function h9({edgeListGSelection:e,edges:t}){return e.selectAll("g").data(t,n=>n.id).join(n=>n.append("g").classed(t9,!0),n=>n,n=>n.remove())}function p9({edgeGSelection:e,layerParams:t,theme:n}){return e.each((r,i,o)=>{I(o[i]).selectAll("path").data([r]).join(s=>s.append("path").classed(Pb,!0),s=>s,s=>s.remove()).attr("marker-end",s=>`url(#${s.markerId})`).attr("stroke",s=>Te({datum:s.data,colorType:t.arrow.colorType,theme:n})).attr("stroke-width",s=>s.strokeWidth).attr("style",s=>t.arrow.styleFn(s))}),e.select(`path.${Pb}`)}function d9({edgeGSelection:e}){return e.each((t,n,r)=>{I(r[n]).selectAll("g").data([t]).join(o=>o.append("g").classed(Cb,!0),o=>o,o=>o.remove())}),e.select(`g.${Cb}`)}function g9({edgeLabelGSelection:e,layerParams:t,theme:n}){return e.each((r,i,o)=>{I(o[i]).selectAll("text").data([r],s=>s.id).join(s=>s.append("text").classed(Lb,!0).attr("text-anchor","middle").attr("pointer-events","none"),s=>s,s=>s.remove()).text(s=>s.name).attr("fill",s=>Te({datum:s,colorType:t.arrowLabel.colorType,theme:n})).attr("font-size",n.fontSize).attr("style",s=>t.arrowLabel.styleFn(s))}),e.select(`text.${Lb}`)}function m9({nodeGSelection:e,edgeGSelection:t,highlightIds:n,styles:r}){if(e.interrupt("highlight"),t.interrupt("highlight"),!n.length){e.transition("highlight").style("opacity",1),t.transition("highlight").style("opacity",1);return}t.style("opacity",r.unhighlightedOpacity),e.each((i,o,a)=>{const s=I(a[o]);n.includes(i.id)?s.style("opacity",1).transition("highlight").ease(qn).duration(500):s.style("opacity",r.unhighlightedOpacity)})}const y9=G.defineSVGLayer({name:Fe,defaultParams:ui,layerIndex:Dt,initShow:!1,validator:e=>{const t=G.validateObject(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 n=G.validateObject(e.bubble,{radiusMin:{toBeTypes:["number"]},radiusMax:{toBeTypes:["number"]},arcScaleType:{toBe:'"area" | "radius"',test:r=>r==="area"||r==="radius"},fillColorType:{toBeOption:"ColorType"},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},styleFn:{toBeTypes:["Function"]}});if(n.status==="error")return n}if(e.bubbleLabel){const n=G.validateObject(e.bubbleLabel,{fillRate:{toBeTypes:["number"]},lineHeight:{toBeTypes:["number"]},maxLineLength:{toBeTypes:["number"]},colorType:{toBeOption:"ColorType"},styleFn:{toBeTypes:["Function"]}});if(n.status==="error")return n}if(e.arrow){const n=G.validateObject(e.arrow,{colorType:{toBeOption:"ColorType"},strokeWidthMin:{toBeTypes:["number"]},strokeWidthMax:{toBeTypes:["number"]},pointerWidth:{toBeTypes:["number"]},pointerHeight:{toBeTypes:["number"]},styleFn:{toBeTypes:["Function"]}});if(n.status==="error")return n}if(e.arrowLabel){const n=G.validateObject(e.arrowLabel,{colorType:{toBeOption:"ColorType"},sizeFixed:{toBeTypes:["boolean"]},styleFn:{toBeTypes:["Function"]}});if(n.status==="error")return n}if(e.force){const n=G.validateObject(e.force,{nodeStrength:{toBeTypes:["number"]},linkDistance:{toBeTypes:["number"]},velocityDecay:{toBeTypes:["number"]},alphaDecay:{toBeTypes:["number"]}});if(n.status==="error")return n}if(e.transform){const n=G.validateObject(e.transform,{x:{toBeTypes:["number"]},y:{toBeTypes:["number"]},k:{toBeTypes:["number"]}});if(n.status==="error")return n}if(e.scaleExtent){const n=G.validateObject(e.scaleExtent,{min:{toBeTypes:["number"]},max:{toBeTypes:["number"]}});if(n.status==="error")return n}return t},setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee,o=I(r.svg),a=I(e),s=a.append("g").classed(K7,!0),u=s.append("defs"),l=s.append("g").classed(e9,!0),c=s.append("g").classed(n9,!0);let h,f,p,d,g,m;const y=new hi("end"),b=new ee;r.layout$.pipe(k(i)).subscribe($=>{a.attr("transform",`translate(${$.left}, ${$.top})`)});const x=n.pipe(k(i),T($=>{let B=$.zoomable?un().on("zoom",D=>{s.attr("transform",`translate(
|
|
78
|
+
${D.transform.x},
|
|
79
|
+
${D.transform.y}
|
|
80
|
+
) scale(
|
|
81
|
+
${D.transform.k}
|
|
82
|
+
)`),$.arrowLabel.sizeFixed&&m&&m.attr("transform",`scale(${1/D.transform.k})`)}):un().on("zoom",null);return $.scaleExtent&&B.scaleExtent([$.scaleExtent.min,$.scaleExtent.max]),o.call(B),B}));O({d3Zoom:x,transform:n.pipe(k(i),T($=>$.transform))}).pipe(k(i),X(0)).subscribe($=>{a.call($.d3Zoom.transform,ai.translate($.transform.x,$.transform.y).scale($.transform.k))});const v=O({layout:r.layout$.pipe(Tl()),layerParams:n}).pipe(k(i),X(0),T($=>i9($.layout,$.layerParams)),W(1)),_=r.computedData$.pipe(k(i),T($=>{const B=$.nodes.filter(z=>z.value!=null);if(!B.length)return[0,2];const D=Sr($.nodes.map(z=>z.value));return B.length==1||D[0]===D[1]?[D[0]-1,D[1]+1]:D}),W(1)),w=r.computedData$.pipe(k(i),T($=>{const B=$.edges.filter(z=>z.value!=null);if(!B.length)return[0,2];const D=Sr($.edges.map(z=>z.value));return B.length==1||D[0]===D[1]?[D[0]-1,D[1]+1]:D}),W(1)),P=_.pipe(k(i),T($=>($[1]-$[0])/2)),C=w.pipe(k(i),T($=>($[1]-$[0])/2)),L=O({nodeMinMaxValue:_,layerParams:n}).pipe(k(i),U(async $=>$),T($=>_n().domain($.nodeMinMaxValue).range([$.layerParams.bubble.radiusMin,$.layerParams.bubble.radiusMax]).exponent($.layerParams.bubble.arcScaleType==="area"?.5:1))),E=O({edgeMinMaxValue:w,layerParams:n}).pipe(k(i),U(async $=>$),T($=>Et().domain($.edgeMinMaxValue).range([$.layerParams.arrow.strokeWidthMin,$.layerParams.arrow.strokeWidthMax]))),N=O({computedData:r.computedData$,radiusScale:L,defaultNodeValue:P}).pipe(k(i),U(async $=>$),T($=>new Map($.computedData.nodes.map(B=>{let D=B;return D.r=$.radiusScale(D.value??$.defaultNodeValue),[D.id,D]})))),A=O({computedData:r.computedData$,strokeWidthScale:E,defaultEdgeValue:C,NodeMap:N}).pipe(k(i),U(async $=>$),T($=>new Map($.computedData.edges.map(B=>{let D=B;return D._source=$.NodeMap.get(B.source),D._target=$.NodeMap.get(B.target),D.strokeWidth=$.strokeWidthScale(D.value??$.defaultEdgeValue),D.markerId=`${Q7}__${D.id}`,[D.id,D]})))),R=O({visibleComputedData:r.visibleComputedData$,RenderNodeMap:N,RenderEdgeMap:A}).pipe(k(i),U(async $=>$),T($=>({nodes:$.visibleComputedData.nodes.map(B=>$.RenderNodeMap.get(B.id)),edges:$.visibleComputedData.edges.map(B=>$.RenderEdgeMap.get(B.id))})),W(1)),S=n.pipe(k(i),T($=>({viewBox:`-${$.arrow.pointerWidth} -${$.arrow.pointerHeight/2} ${$.arrow.pointerWidth} ${$.arrow.pointerHeight}`,d:`M${-$.arrow.pointerWidth},${-$.arrow.pointerHeight/2}L0,0L${-$.arrow.pointerWidth},${$.arrow.pointerHeight/2}`,pointerWidth:$.arrow.pointerWidth,pointerHeight:$.arrow.pointerHeight}))),M=O({computedData:r.computedData$,layerParams:n,RenderNodeMap:N,RenderEdgeMap:A}).pipe(k(i),X(0),T($=>$.computedData.edges.map(B=>{const D=$.RenderEdgeMap.get(B.id),z=$.RenderNodeMap.get(B.target);return{id:D.markerId,edgeId:B.id,strokeWidth:D.strokeWidth,refX:(z.r+$.layerParams.bubble.strokeWidth/2)/D.strokeWidth-1}})));return O({defsSelection:u,markerParams:S,markerData:M,layerParams:n,theme:r.theme$}).pipe(k(i),X(0),T($=>l9({defsSelection:u,markerParams:$.markerParams,markerData:$.markerData,layerParams:$.layerParams,theme:$.theme}))).subscribe(),O({renderData:R,simulation:v,layerParams:n,theme:r.theme$}).pipe(k(i),X(0)).subscribe($=>{h=c9({nodeListGSelection:c,nodes:$.renderData.nodes}),f=f9({nodeGSelection:h,layerParams:$.layerParams,theme:$.theme}),h.call(u9($.simulation,y)),p=h9({edgeListGSelection:l,edges:$.renderData.edges}),d=p9({edgeGSelection:p,layerParams:$.layerParams,theme:$.theme}),g=d9({edgeGSelection:p}),m=g9({edgeLabelGSelection:g,layerParams:$.layerParams,theme:$.theme}),$.simulation.nodes($.renderData.nodes).on("tick",()=>{d.attr("d",s9),h.attr("transform",o9),g.attr("transform",B=>a9(B))}),$.simulation.force("link").links($.renderData.edges),$.simulation.alpha(.3).restart(),f.on("mouseover",(B,D)=>{B.stopPropagation(),b.next({eventName:"mouseover",pluginName:Ve,layerName:Fe,target:D,event:B})}).on("mousemove",(B,D)=>{B.stopPropagation(),b.next({eventName:"mousemove",pluginName:Ve,layerName:Fe,target:D,event:B})}).on("mouseout",(B,D)=>{B.stopPropagation(),b.next({eventName:"mouseout",pluginName:Ve,layerName:Fe,target:D,event:B})}).on("click",(B,D)=>{B.stopPropagation(),b.next({eventName:"click",pluginName:Ve,layerName:Fe,target:D,event:B})})}),y.pipe(H(($,B)=>$===B),U($=>Nn(()=>$==="end",b,zo))).subscribe($=>{r.eventTrigger$.next($)}),O({highlightNodes:r.graphHighlightNodes$.pipe(T($=>$.map(B=>B.id))),styles:t.pipe(T($=>$.styles))}).pipe(k(i),X(0)).subscribe($=>{!h||!p||m9({nodeGSelection:h,edgeGSelection:p,highlightIds:$.highlightNodes,styles:$.styles})}),()=>{i.next(void 0)}}}),b9=new J7,x9=new y9,v9=G.defineSVGPlugin({name:"NetworkPlot",defaultParams:bb,layers:[b9,x9],setup:e=>{const t=O({graphData:e.context.graphData$,datasetIndex:e.pluginParams$.pipe(T(d=>d.datasetIndex))}).pipe(X(0),T(({graphData:d,datasetIndex:g})=>d[g]),W(1)),n=Bn({size$:e.context.size$,padding$:e.pluginParams$.pipe(T(d=>d.styles.padding))}).pipe(W(1)),r=A7({selectedGraphData$:t,pluginParams$:e.pluginParams$}).pipe(W(1)),i=dn(e.context.theme$).pipe(W(1)),o=vr({datumList$:r.pipe(T(d=>d.nodes)),styles$:e.pluginParams$.pipe(T(d=>d.styles)),event$:e.context.event$}).pipe(W(1)),a=vr({datumList$:r.pipe(T(d=>d.edges)),styles$:e.pluginParams$.pipe(T(d=>d.styles)),event$:e.context.event$}).pipe(W(1)),s=gi({datumList$:r.pipe(T(d=>d.nodes))}).pipe(W(1)),u=gi({datumList$:r.pipe(T(d=>d.edges))}).pipe(W(1)),l=M7(r).pipe(W(1)),c=P7(r).pipe(W(1)),h=D7(s,u).pipe(W(1)),f=C7({computedData$:r,NodeMap$:l}).pipe(W(1)),p={layout$:n,computedData$:r,fontSizePx$:i,graphHighlightNodes$:o,graphHighlightEdges$:a,categoryLabels$:h,CategoryNodeMap$:s,CategoryEdgeMap$:u,NodeMap$:l,EdgeMap$:c,visibleComputedData$:f};return e.context={...e.context,...p},()=>{}},validator:e=>{const t=G.validateObject(e,{styles:{toBeTypes:["object"]},visibleFilter:{toBeTypes:["Function"]},datasetIndex:{toBeTypes:["number"]}});if(t.status==="error")return t;if(e.styles){const n=G.validateObject(e.styles,{padding:{toBeTypes:["object"]},highlightTarget:{toBeTypes:["string"]},highlightDefault:{toBeTypes:["string","null"]},unhighlightedOpacity:{toBeTypes:["number"]},transitionDuration:{toBeTypes:["number"]},transitionEase:{toBeTypes:["string"]}});if(n.status==="error")return n;if(e.styles.padding){const r=G.validateObject(e.styles.padding,{top:{toBeTypes:["number"]},right:{toBeTypes:["number"]},bottom:{toBeTypes:["number"]},left:{toBeTypes:["number"]}});if(r.status==="error")return r}}return t}}),Jf={styles:{padding:{top:60,right:60,bottom:60,left:60},highlightTarget:"datum",highlightDefault:null,unhighlightedOpacity:.3,transitionDuration:800,transitionEase:"easeCubic"},visibleFilter:e=>!0,sort:null,datasetIndex:0};Jf.visibleFilter.toString=()=>"(datum) => true";const Kf={backgroundColorType:"background",strokeColorType:"primary",backgroundOpacity:.8,textColorType:"primary",offset:[20,5],padding:10,renderFn:(e,{styles:t,utils:n,categoryData:r})=>{function i(){const l=e.target.series.slice(0,7)!=="series_",c=e.target.name.slice(0,7)!=="series_",h=n.toCurrency(e.target.value),f=t.textSizePx*.7,p=t.textSizePx/2-f/2,d=l?`<rect width="${f}" height="${f}" x="${p}" y="${p-1}" rx="${f/2}" fill="${e.target.color}"></rect>
|
|
83
|
+
<text x="${t.textSizePx*1.5}" font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
|
|
84
|
+
<tspan>${e.target.name}</tspan>
|
|
85
|
+
</text>`:"",g=c?`<tspan>${e.target.name}</tspan> `:"",m=l?n.measureTextWidth(`${e.target.series}${h}`,t.textSizePx)+t.textSizePx*1.5:0,y=c?n.measureTextWidth(`${e.target.name}${h}`,t.textSizePx):0,b=Math.max(m,y),x=c?b+t.textSizePx*1.5:0,v=c?"end":"start",_=`<text font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
|
|
86
|
+
${g}<tspan font-weight="bold" text-anchor="${v}" x="${x}">${h}</tspan>
|
|
87
|
+
</text>`;return`${d}
|
|
88
|
+
<g ${l?`transform="translate(0, ${t.textSizePx*2})"`:""}>
|
|
89
|
+
${_}
|
|
90
|
+
</g>`}function o(){const l=t.textSizePx*.7,c=t.textSizePx/2-l/2,h=`<g><text dominant-baseline="hanging" font-size="${t.textSizePx}" fill="${t.textColor}">${e.target.category}</text></g>`,f=n.measureTextWidth(e.target.category,t.textSizePx),p=r.reduce((y,b)=>{const x=`${b.series}${n.toCurrency(b.value)}`,v=n.measureTextWidth(x,t.textSizePx);return v>y?v:y},0),g=Math.max(f,p)+t.textSizePx*3,m=r.map((y,b)=>{const x=b*t.textSizePx*1.5,v=y.id===(e.target&&e.target.id);return`<g transform="translate(0, ${t.textSizePx*2})">
|
|
91
|
+
<rect width="${l}" height="${l}" x="${c}" y="${x+c}" rx="${l/2}" fill="${y.color}"></rect>
|
|
92
|
+
<text x="${t.textSizePx*1.5}" y="${x}" font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
|
|
93
|
+
<tspan font-weight="${v?"bold":""}">${y.series}</tspan>
|
|
94
|
+
<tspan font-weight="bold" text-anchor="end" x="${g}">${n.toCurrency(y.value)}</tspan>
|
|
95
|
+
</text>
|
|
96
|
+
</g>`}).join("");return`${h}
|
|
97
|
+
${m}`}function a(){const l=e.target.category!=="",c=!(e==null||e.target.name.slice(0,11)==="multiValue_"),h=t.textSizePx*.7,f=t.textSizePx/2-h/2,p=l?`<rect width="${h}" height="${h}" x="${f}" y="${f-1}" rx="${h/2}" fill="${e.target.color}"></rect>
|
|
98
|
+
<text x="${t.textSizePx*1.5}" font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
|
|
99
|
+
<tspan>${e.target.category}</tspan>
|
|
100
|
+
</text>`:"",d=c?`<text font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
|
|
101
|
+
<tspan>${e.target.name}</tspan>
|
|
102
|
+
</text>`:"",g=(()=>{const b=n.measureTextWidth(e.target.category,t.textSizePx),x=c?n.measureTextWidth(e.target.name,t.textSizePx):0,v=e.target.multivariate.reduce((_,w)=>{const P=`${w.name}${n.toCurrency(w.value)}`,C=n.measureTextWidth(P,t.textSizePx);return C>_?C:_},0);return Math.max(b,x,v)})(),m=e.target.multivariate.map((b,x)=>{const v=x*t.textSizePx*1.5+(d?t.textSizePx*2:0),_=g+t.textSizePx*3;return`<text x="0" y="${v}" font-weight="bold" font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
|
|
103
|
+
<tspan>${b.name}</tspan>
|
|
104
|
+
<tspan text-anchor="end" x="${_}">${n.toCurrency(b.value)}</tspan>
|
|
105
|
+
</text>`}).join(""),y=d||m?`<g ${l?`transform="translate(0, ${t.textSizePx*2})"`:""}>
|
|
106
|
+
${d}
|
|
107
|
+
${m}
|
|
108
|
+
</g>`:"";return`${p}
|
|
109
|
+
${y}`}function s(){const l=!!e.target.category,c=!!e.target.name,h=n.toCurrency(e.target.value),f=t.textSizePx*.7,p=t.textSizePx/2-f/2,d=l?`<rect width="${f}" height="${f}" x="${p}" y="${p-1}" rx="${f/2}" fill="${e.target.color}"></rect>
|
|
110
|
+
<text x="${t.textSizePx*1.5}" font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
|
|
111
|
+
<tspan>${e.target.category}</tspan>
|
|
112
|
+
</text>`:"",g=c?`<tspan>${e.target.name}</tspan> `:"",m=l?n.measureTextWidth(`${e.target.category}${h}`,t.textSizePx)+t.textSizePx*1.5:0,y=c?n.measureTextWidth(`${e.target.name}${h}`,t.textSizePx):0,b=Math.max(m,y),x=c?b+t.textSizePx*.5:0,v=c?"end":"start",_=`<text font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
|
|
113
|
+
${g}<tspan font-weight="bold" text-anchor="${v}" x="${x}">${h}</tspan>
|
|
114
|
+
</text>`;return`${d}
|
|
115
|
+
<g ${l?`transform="translate(0, ${t.textSizePx*2})"`:""}>
|
|
116
|
+
${_}
|
|
117
|
+
</g>`}function u(){const l=!!e.target.category,c=!!e.target.name,h=n.toCurrency(e.target.value),f=t.textSizePx*.7,p=t.textSizePx/2-f/2,d=l?`<rect width="${f}" height="${f}" x="${p}" y="${p-1}" rx="${f/2}" fill="${e.target.color}"></rect>
|
|
118
|
+
<text x="${t.textSizePx*1.5}" font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
|
|
119
|
+
<tspan>${e.target.category}</tspan>
|
|
120
|
+
</text>`:"",g=c?`<tspan>${e.target.name}</tspan> `:"",m=l?n.measureTextWidth(`${e.target.category}${h}`,t.textSizePx)+t.textSizePx*1.5:0,y=c?n.measureTextWidth(`${e.target.name}${h}`,t.textSizePx):0,b=Math.max(m,y),x=c?b+t.textSizePx*.5:0,v=c?"end":"start",_=`<text font-size="${t.textSizePx}" dominant-baseline="hanging" fill="${t.textColor}">
|
|
121
|
+
${g}<tspan font-weight="bold" text-anchor="${v}" x="${x}">${h}</tspan>
|
|
122
|
+
</text>`;return`${d}
|
|
123
|
+
<g ${l?`transform="translate(0, ${t.textSizePx*2})"`:""}>
|
|
124
|
+
${_}
|
|
125
|
+
</g>`}return e.target.modelType==="series"?i():e.target.modelType==="grid"?o():e.target.modelType==="multivariate"?a():e.target.modelType==="graph"?s():e.target.modelType==="tree"?u():""}};Kf.renderFn.toString=()=>`(eventData, { styles, utils }) => {
|
|
126
|
+
function renderSeriesData () {
|
|
127
|
+
const hasSeriesLabel = eventData.target.series.slice(0, 7) === 'series_' ? false : true
|
|
128
|
+
const hasDatumLabel = eventData.target.name.slice(0, 7) === 'series_' ? false : true
|
|
129
|
+
const valueText = utils.toCurrency(eventData.target.value)
|
|
130
|
+
const bulletWidth = styles.textSizePx * 0.7
|
|
131
|
+
const offset = (styles.textSizePx / 2) - (bulletWidth / 2)
|
|
132
|
+
const seriesSvg = hasSeriesLabel
|
|
133
|
+
? \`<rect width="\${bulletWidth}" height="\${bulletWidth}" x="\${offset}" y="\${offset - 1}" rx="\${bulletWidth / 2}" fill="\${eventData.target.color}"></rect>
|
|
134
|
+
<text x="\${styles.textSizePx * 1.5}" font-size="\${styles.textSizePx}" dominant-baseline="hanging" fill="\${styles.textColor}">
|
|
135
|
+
<tspan>\${eventData.target.name}</tspan>
|
|
136
|
+
</text>\`
|
|
137
|
+
: ''
|
|
138
|
+
const datumLabelSvg = hasDatumLabel
|
|
139
|
+
? \`<tspan>\${eventData.target.name}</tspan> \`
|
|
140
|
+
: ''
|
|
141
|
+
const seriesLabelTextWidth = hasSeriesLabel
|
|
142
|
+
? utils.measureTextWidth(\`\${eventData.target.series}\${valueText}\`, styles.textSizePx) + styles.textSizePx * 1.5
|
|
143
|
+
: 0
|
|
144
|
+
const datumLabelTextWidth = hasDatumLabel
|
|
145
|
+
? utils.measureTextWidth(\`\${eventData.target.name}\${valueText}\`, styles.textSizePx)
|
|
146
|
+
: 0
|
|
147
|
+
const maxTextWidth = Math.max(seriesLabelTextWidth, datumLabelTextWidth)
|
|
148
|
+
const lineEndX = hasDatumLabel
|
|
149
|
+
? maxTextWidth + styles.textSizePx * 1.5
|
|
150
|
+
: 0
|
|
151
|
+
const valueTextAnchor = hasDatumLabel ? 'end' : 'start'
|
|
152
|
+
const datumSvg = \`<text font-size="\${styles.textSizePx}" dominant-baseline="hanging" fill="\${styles.textColor}">
|
|
153
|
+
\${datumLabelSvg}<tspan font-weight="bold" text-anchor="\${valueTextAnchor}" x="\${lineEndX}">\${valueText}</tspan>
|
|
154
|
+
</text>\`
|
|
155
|
+
|
|
156
|
+
return \`\${seriesSvg}
|
|
157
|
+
<g \${hasSeriesLabel ? \`transform="translate(0, \${styles.textSizePx * 2})"\` : ''}>
|
|
158
|
+
\${datumSvg}
|
|
159
|
+
</g>\`
|
|
160
|
+
}
|
|
161
|
+
function renderGridData () {
|
|
162
|
+
const bulletWidth = styles.textSizePx * 0.7
|
|
163
|
+
const offset = (styles.textSizePx / 2) - (bulletWidth / 2)
|
|
164
|
+
|
|
165
|
+
const titleSvg = \`<g><text dominant-baseline="hanging" font-size="\${styles.textSizePx}" fill="\${styles.textColor}">\${eventData.target.category}</text></g>\`
|
|
166
|
+
const categoryLabelTextWidth = utils.measureTextWidth(eventData.target.category, styles.textSizePx)
|
|
167
|
+
const listTextWidth = categoryData.reduce((acc, category) => {
|
|
168
|
+
const text = \`\${category.series}\${utils.toCurrency(category.value)}\`
|
|
169
|
+
const _maxTextWidth = utils.measureTextWidth(text, styles.textSizePx)
|
|
170
|
+
return _maxTextWidth > acc ? _maxTextWidth : acc
|
|
171
|
+
}, 0)
|
|
172
|
+
const maxTextWidth = Math.max(categoryLabelTextWidth, listTextWidth)
|
|
173
|
+
const lineEndX = maxTextWidth + styles.textSizePx * 3
|
|
174
|
+
const contentSvg = categoryData
|
|
175
|
+
.map((category, i) => {
|
|
176
|
+
const y = i * styles.textSizePx * 1.5
|
|
177
|
+
const isHighlight = category.id === (eventData.target && eventData.target.id)
|
|
178
|
+
return \`<g transform="translate(0, \${styles.textSizePx * 2})">
|
|
179
|
+
<rect width="\${bulletWidth}" height="\${bulletWidth}" x="\${offset}" y="\${y + offset}" rx="\${bulletWidth / 2}" fill="\${category.color}"></rect>
|
|
180
|
+
<text x="\${styles.textSizePx * 1.5}" y="\${y}" font-size="\${styles.textSizePx}" dominant-baseline="hanging" fill="\${styles.textColor}">
|
|
181
|
+
<tspan font-weight="\${isHighlight ? 'bold' : ''}">\${category.series}</tspan>
|
|
182
|
+
<tspan font-weight="bold" text-anchor="end" x="\${lineEndX}">\${utils.toCurrency(category.value)}</tspan>
|
|
183
|
+
</text>
|
|
184
|
+
</g>\`
|
|
185
|
+
})
|
|
186
|
+
.join('')
|
|
187
|
+
return \`\${titleSvg}
|
|
188
|
+
\${contentSvg}\`
|
|
189
|
+
}
|
|
190
|
+
function renderMultivariateData () {
|
|
191
|
+
const hasCategoryLabel = eventData.target.category === '' ? false : true
|
|
192
|
+
const hasDatumLabel = eventData == null || eventData.target.name.slice(0, 11) === 'multiValue_' ? false : true
|
|
193
|
+
const bulletWidth = styles.textSizePx * 0.7
|
|
194
|
+
const offset = (styles.textSizePx / 2) - (bulletWidth / 2)
|
|
195
|
+
const categorySvg = hasCategoryLabel
|
|
196
|
+
? \`<rect width="\${bulletWidth}" height="\${bulletWidth}" x="\${offset}" y="\${offset - 1}" rx="\${bulletWidth / 2}" fill="\${eventData.target.color}"></rect>
|
|
197
|
+
<text x="\${styles.textSizePx * 1.5}" font-size="\${styles.textSizePx}" dominant-baseline="hanging" fill="\${styles.textColor}">
|
|
198
|
+
<tspan>\${eventData.target.category}</tspan>
|
|
199
|
+
</text>\`
|
|
200
|
+
: ''
|
|
201
|
+
|
|
202
|
+
const datumLabelSvg = hasDatumLabel
|
|
203
|
+
? \`<text font-size="\${styles.textSizePx}" dominant-baseline="hanging" fill="\${styles.textColor}">
|
|
204
|
+
<tspan>\${eventData.target.name}</tspan>
|
|
205
|
+
</text>\`
|
|
206
|
+
: ''
|
|
207
|
+
|
|
208
|
+
const maxTextWidth = (() => {
|
|
209
|
+
const categoryLabelTextWidth = utils.measureTextWidth(eventData.target.category, styles.textSizePx)
|
|
210
|
+
const datumLabelTextWidth = hasDatumLabel ? utils.measureTextWidth(eventData.target.name, styles.textSizePx) : 0
|
|
211
|
+
const valueDetailTextWidth = (eventData.target as ModelDatumMultivariate).multivariate.reduce((acc, detail) => {
|
|
212
|
+
const text = \`\${detail.name}\${utils.toCurrency(detail.value)}\`
|
|
213
|
+
const _maxTextWidth = utils.measureTextWidth(text, styles.textSizePx)
|
|
214
|
+
return _maxTextWidth > acc ? _maxTextWidth : acc
|
|
215
|
+
}, 0)
|
|
216
|
+
return Math.max(categoryLabelTextWidth, datumLabelTextWidth, valueDetailTextWidth)
|
|
217
|
+
})()
|
|
218
|
+
|
|
219
|
+
const valueDetailSvg = (eventData.target as ModelDatumMultivariate).multivariate.map((detail, i) => {
|
|
220
|
+
const y = (i * styles.textSizePx * 1.5) + (datumLabelSvg ? styles.textSizePx * 2 : 0)
|
|
221
|
+
const lineEndX = maxTextWidth + styles.textSizePx * 3
|
|
222
|
+
return \`<text x="0" y="\${y}" font-weight="bold" font-size="\${styles.textSizePx}" dominant-baseline="hanging" fill="\${styles.textColor}">
|
|
223
|
+
<tspan>\${detail.name}</tspan>
|
|
224
|
+
<tspan text-anchor="end" x="\${lineEndX}">\${utils.toCurrency(detail.value)}</tspan>
|
|
225
|
+
</text>\`
|
|
226
|
+
}).join('')
|
|
227
|
+
|
|
228
|
+
const datumDetailSvg = datumLabelSvg || valueDetailSvg
|
|
229
|
+
? \`<g \${hasCategoryLabel ? \`transform="translate(0, \${styles.textSizePx * 2})"\` : ''}>
|
|
230
|
+
\${datumLabelSvg}
|
|
231
|
+
\${valueDetailSvg}
|
|
232
|
+
</g>\`
|
|
233
|
+
: ''
|
|
234
|
+
|
|
235
|
+
return \`\${categorySvg}
|
|
236
|
+
\${datumDetailSvg}\`
|
|
237
|
+
}
|
|
238
|
+
function renderGraphData () {
|
|
239
|
+
const hasCategoryLabel = eventData.target.category ? true : false
|
|
240
|
+
const hasDatumLabel = eventData.target.name ? true : false
|
|
241
|
+
const valueText = utils.toCurrency(eventData.target.value)
|
|
242
|
+
const bulletWidth = styles.textSizePx * 0.7
|
|
243
|
+
const offset = (styles.textSizePx / 2) - (bulletWidth / 2)
|
|
244
|
+
const categorySvg = hasCategoryLabel
|
|
245
|
+
? \`<rect width="\${bulletWidth}" height="\${bulletWidth}" x="\${offset}" y="\${offset - 1}" rx="\${bulletWidth / 2}" fill="\${eventData.target.color}"></rect>
|
|
246
|
+
<text x="\${styles.textSizePx * 1.5}" font-size="\${styles.textSizePx}" dominant-baseline="hanging" fill="\${styles.textColor}">
|
|
247
|
+
<tspan>\${eventData.target.category}</tspan>
|
|
248
|
+
</text>\`
|
|
249
|
+
: ''
|
|
250
|
+
const datumLabelSvg = hasDatumLabel
|
|
251
|
+
? \`<tspan>\${eventData.target.name}</tspan> \`
|
|
252
|
+
: ''
|
|
253
|
+
const categoryLabelTextWidth = hasCategoryLabel
|
|
254
|
+
? utils.measureTextWidth(\`\${eventData.target.category}\${valueText}\`, styles.textSizePx) + styles.textSizePx * 1.5
|
|
255
|
+
: 0
|
|
256
|
+
const datumLabelTextWidth = hasDatumLabel
|
|
257
|
+
? utils.measureTextWidth(\`\${eventData.target.name}\${valueText}\`, styles.textSizePx)
|
|
258
|
+
: 0
|
|
259
|
+
const maxTextWidth = Math.max(categoryLabelTextWidth, datumLabelTextWidth)
|
|
260
|
+
const lineEndX = hasDatumLabel
|
|
261
|
+
? maxTextWidth + styles.textSizePx * 0.5
|
|
262
|
+
: 0
|
|
263
|
+
const valueTextAnchor = hasDatumLabel ? 'end' : 'start'
|
|
264
|
+
const datumSvg = \`<text font-size="\${styles.textSizePx}" dominant-baseline="hanging" fill="\${styles.textColor}">
|
|
265
|
+
\${datumLabelSvg}<tspan font-weight="bold" text-anchor="\${valueTextAnchor}" x="\${lineEndX}">\${valueText}</tspan>
|
|
266
|
+
</text>\`
|
|
267
|
+
|
|
268
|
+
return \`\${categorySvg}
|
|
269
|
+
<g \${hasCategoryLabel ? \`transform="translate(0, \${styles.textSizePx * 2})"\` : ''}>
|
|
270
|
+
\${datumSvg}
|
|
271
|
+
</g>\`
|
|
272
|
+
}
|
|
273
|
+
function renderTreeData () {
|
|
274
|
+
const hasCategoryLabel = eventData.target.category ? true : false
|
|
275
|
+
const hasDatumLabel = eventData.target.name ? true : false
|
|
276
|
+
const valueText = utils.toCurrency(eventData.target.value)
|
|
277
|
+
const bulletWidth = styles.textSizePx * 0.7
|
|
278
|
+
const offset = (styles.textSizePx / 2) - (bulletWidth / 2)
|
|
279
|
+
const categorySvg = hasCategoryLabel
|
|
280
|
+
? \`<rect width="\${bulletWidth}" height="\${bulletWidth}" x="\${offset}" y="\${offset - 1}" rx="\${bulletWidth / 2}" fill="\${eventData.target.color}"></rect>
|
|
281
|
+
<text x="\${styles.textSizePx * 1.5}" font-size="\${styles.textSizePx}" dominant-baseline="hanging" fill="\${styles.textColor}">
|
|
282
|
+
<tspan>\${eventData.target.category}</tspan>
|
|
283
|
+
</text>\`
|
|
284
|
+
: ''
|
|
285
|
+
const datumLabelSvg = hasDatumLabel
|
|
286
|
+
? \`<tspan>\${eventData.target.name}</tspan> \`
|
|
287
|
+
: ''
|
|
288
|
+
const categoryLabelTextWidth = hasCategoryLabel
|
|
289
|
+
? utils.measureTextWidth(\`\${eventData.target.category}\${valueText}\`, styles.textSizePx) + styles.textSizePx * 1.5
|
|
290
|
+
: 0
|
|
291
|
+
const datumLabelTextWidth = hasDatumLabel
|
|
292
|
+
? utils.measureTextWidth(\`\${eventData.target.name}\${valueText}\`, styles.textSizePx)
|
|
293
|
+
: 0
|
|
294
|
+
const maxTextWidth = Math.max(categoryLabelTextWidth, datumLabelTextWidth)
|
|
295
|
+
const lineEndX = hasDatumLabel
|
|
296
|
+
? maxTextWidth + styles.textSizePx * 0.5
|
|
297
|
+
: 0
|
|
298
|
+
const valueTextAnchor = hasDatumLabel ? 'end' : 'start'
|
|
299
|
+
const datumSvg = \`<text font-size="\${styles.textSizePx}" dominant-baseline="hanging" fill="\${styles.textColor}">
|
|
300
|
+
\${datumLabelSvg}<tspan font-weight="bold" text-anchor="\${valueTextAnchor}" x="\${lineEndX}">\${valueText}</tspan>
|
|
301
|
+
</text>\`
|
|
302
|
+
|
|
303
|
+
return \`\${categorySvg}
|
|
304
|
+
<g \${hasCategoryLabel ? \`transform="translate(0, \${styles.textSizePx * 2})"\` : ''}>
|
|
305
|
+
\${datumSvg}
|
|
306
|
+
</g>\`
|
|
307
|
+
}
|
|
308
|
+
if (eventData.target.modelType === 'series') {
|
|
309
|
+
return renderSeriesData()
|
|
310
|
+
} else if (eventData.target.modelType === 'grid') {
|
|
311
|
+
return renderGridData()
|
|
312
|
+
} else if (eventData.target.modelType === 'multivariate') {
|
|
313
|
+
return renderMultivariateData()
|
|
314
|
+
} else if (eventData.target.modelType === 'graph') {
|
|
315
|
+
return renderGraphData()
|
|
316
|
+
} else if (eventData.target.modelType === 'tree') {
|
|
317
|
+
return renderTreeData()
|
|
318
|
+
}
|
|
319
|
+
return ''
|
|
320
|
+
}`;const S9=({selectedSeriesData$:e,pluginParams$:t})=>O({selectedSeriesData:e,pluginParams:t}).pipe(X(0),T(({selectedSeriesData:n,pluginParams:r})=>n.flat().sort(r.sort??void 0).map((i,o)=>{const a=r.visibleFilter;return{...i,visible:a?a(i):!0,seq:o}}).sort((i,o)=>i.index-o.index).reduce((i,o)=>(i[o.seriesIndex]||(i[o.seriesIndex]=[]),i[o.seriesIndex].push(o),i),[])));function Rb(e,t){const n=t.textSizePx*1.5,i=(e==null?[]:Array.isArray(e)?e:typeof e=="string"?e.split(`
|
|
321
|
+
`):[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">
|
|
322
|
+
${i}
|
|
323
|
+
</text>`:""}function $9({rootSelection:e,pluginName:t,layerName:n,gClassName:r,boxClassName:i,rootWidth:o,rootHeight:a,svgString:s,tooltipStyle:u,event:l}){e.interrupt("fadeout");const c=5,h=s?[s]:[],f=s?[u]:[],d=e.selectAll(`g.${r}`).data(h).join(P=>P.append("g").classed(r,!0).attr("pointer-events","none"),P=>P,P=>P.style("opacity",0).remove()).attr("transform",()=>`translate(${l.offsetX}, ${l.offsetY})`).selectAll(`g.${i}`).data(f).join(P=>P.append("g").classed(Z(t,n,"box"),!0)),g=d.selectAll("rect").data(f).join(P=>P.append("rect").attr("rx",c).attr("ry",c)).attr("fill",P=>P.backgroundColor).attr("stroke",P=>P.strokeColor).attr("opacity",P=>P.backgroundOpacity),m=d.selectAll("g").data(h).join(P=>P.append("g").classed(Z(t,n,"content"),!0).attr("transform",()=>`translate(${u.padding}, ${u.padding})`));h.length&&r8(m,h[0]);const y=m!=null&&m.node()?P1(m):{width:0,height:0};g.attr("width",y.width+u.padding*2).attr("height",y.height+u.padding*2);const b=d!=null&&d.node()?P1(d):{width:0,height:0},x=o-b.width,v=a-b.height,_=l.offsetX+u.offset[0]>x?x-l.offsetX:u.offset[0],w=l.offsetY+u.offset[1]>v?v-l.offsetY:u.offset[1];d.attr("transform",P=>`translate(${_}, ${w})`),d.attr("transform",P=>`translate(${_}, ${w})`)}function w9(e){Sp(`g.${e}`).remove()}const _9=({pluginName:e,layerName:t,rootSelection:n,baseTooltipParams$:r,theme$:i,layout$:o,event$:a,SeriesDataMap$:s,CategoryDataMap$:u})=>{const l=new ee,c=Z(e,t,"g"),h=Z(e,t,"box"),f=a.pipe(k(l),Ut(_=>_.eventName==="mouseover"||_.eventName==="mousemove")),p=a.pipe(k(l),Ut(_=>_.eventName==="mouseout")),d=dn(i),g=O({theme:i,fontSizePx:d,baseTooltipParams:r}).pipe(k(l),X(0),T(_=>({backgroundColor:xe(_.baseTooltipParams.backgroundColorType,_.theme),backgroundOpacity:_.baseTooltipParams.backgroundOpacity,strokeColor:xe(_.baseTooltipParams.strokeColorType,_.theme),offset:_.baseTooltipParams.offset,padding:_.baseTooltipParams.padding,textSize:_.theme.fontSize,textSizePx:_.fontSizePx,textColor:xe(_.baseTooltipParams.textColorType,_.theme)}))),m=O({baseTooltipParams:r,tooltipStyle:g,SeriesDataMap:s,CategoryDataMap:u}).pipe(k(l),X(0),T(_=>w=>{const P=_.baseTooltipParams.renderFn(w,{utils:{toCurrency:Jx,measureTextWidth:mi},styles:_.tooltipStyle,seriesData:w.target.series?_.SeriesDataMap.get(w.target.series):[],categoryData:w.target.category?_.CategoryDataMap.get(w.target.category):[]});if(typeof P=="string"){const C=P.trim();if(C.slice(0,1)==="<"&&C.slice(C.length-1,C.length)===">")return P;{const E=P.split(`
|
|
324
|
+
`);return Rb(E,_.tooltipStyle)}}else if(Array.isArray(P))return Rb(P,_.tooltipStyle);return""})),y=O({event:f,contentRenderFn:m}).pipe(k(l),X(0),T(_=>_.contentRenderFn(_.event))),b=p.pipe(k(l),T(_=>"")),x=Fo(y,b).pipe(k(l),H((_,w)=>_===w)),v=Fo(f,p).pipe(k(l));return O({svgString:x,layout:o,tooltipStyle:g}).pipe(k(l),X(0),U(_=>v.pipe(T(w=>({svgString:_.svgString,layout:_.layout,tooltipStyle:_.tooltipStyle,eventTooltip:w}))))).subscribe(_=>{if(_.eventTooltip.eventName==="mouseout"){w9(c);return}$9({rootSelection:n,pluginName:e,layerName:t,gClassName:c,boxClassName:h,rootWidth:_.layout.rootWidth,rootHeight:_.layout.rootHeight,svgString:_.svgString,tooltipStyle:_.tooltipStyle,event:_.eventTooltip.event})}),()=>{l.next(void 0)}},T9="Tooltip",Eb="Tooltip",A9=G.defineSVGLayer({name:Eb,defaultParams:Kf,layerIndex:D8,initShow:!0,validator:e=>G.validateObject(e,{backgroundColorType:{toBe:"ColorType",test:n=>typeof n=="string"&&["data","primary","secondary","dataContrast","background","none"].includes(n)},backgroundOpacity:{toBeTypes:["number"]},strokeColorType:{toBe:"ColorType",test:n=>typeof n=="string"&&["data","primary","secondary","dataContrast","background","none"].includes(n)},offset:{toBe:"[number, number]",test:n=>Array.isArray(n)&&n.length===2&&typeof n[0]=="number"&&typeof n[1]=="number"},padding:{toBeTypes:["number"]},textColorType:{toBe:"ColorType",test:n=>typeof n=="string"&&["data","primary","secondary","dataContrast","background","none"].includes(n)},renderFn:{toBeTypes:["Function"]}}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee,o=_9({rootSelection:I(e),pluginName:T9,layerName:Eb,baseTooltipParams$:n,theme$:r.theme$,layout$:r.layout$,event$:r.event$,SeriesDataMap$:r.SeriesDataMap$,CategoryDataMap$:r.CategoryDataMap$});return()=>{i.next(void 0),o()}}}),D9=new A9,M9=G.defineSVGPlugin({name:"Tooltip",defaultParams:Jf,layers:[D9],setup:e=>{const t=O({seriesData:e.context.seriesData$,datasetIndex:e.pluginParams$.pipe(T(l=>l.datasetIndex))}).pipe(X(0),T(({seriesData:l,datasetIndex:c})=>l[c]),W(1)),n=Bn({size$:e.context.size$,padding$:e.pluginParams$.pipe(T(l=>l.styles.padding))}).pipe(W(1)),r=S9({selectedSeriesData$:t,pluginParams$:e.pluginParams$}).pipe(W(1)),i=dn(e.context.theme$).pipe(W(1)),o=r.pipe(T(l=>l.flat())).pipe(W(1)),a=di({datumList$:o}).pipe(W(1)),s=gi({datumList$:o}).pipe(W(1)),u={layout$:n,fontSizePx$:i,SeriesDataMap$:a,CategoryDataMap$:s};return e.context={...e.context,...u},()=>{}},validator:e=>{const t=G.validateObject(e,{styles:{toBeTypes:["object"]},datasetIndex:{toBeTypes:["number"]}});if(e.styles){const n=G.validateObject(e.styles,{padding:{toBeTypes:["object"]},highlightTarget:{toBeTypes:["string"]},highlightDefault:{toBeTypes:["string","null"]},unhighlightedOpacity:{toBeTypes:["number"]},transitionDuration:{toBeTypes:["number"]},transitionEase:{toBeTypes:["string"]}});if(n.status==="error")return n;if(e.styles.padding){const r=G.validateObject(e.styles.padding,{top:{toBeTypes:["number"]},right:{toBeTypes:["number"]},bottom:{toBeTypes:["number"]},left:{toBeTypes:["number"]}});if(r.status==="error")return r}}return t}}),Qf={styles:{padding:{top:20,right:20,bottom:60,left:20},highlightTarget:"datum",highlightDefault:null,unhighlightedOpacity:.3,transitionDuration:800,transitionEase:"easeCubic"},visibleFilter:e=>!0,sort:null,container:{...Dl},separateSeries:!1,separateName:!1,datasetIndex:0};Qf.visibleFilter.toString=()=>"(datum) => true";const eh={force:{strength:.08,velocityDecay:.3,collisionSpacing:2},bubbleLabel:{labelFn:e=>String(e.name),colorType:"dataContrast",fillRate:.6,lineHeight:1,maxLineLength:6,wordBreakAll:!0},arcScaleType:"area"};eh.bubbleLabel.labelFn.toString=()=>"d => String(d.name)";const Nb={outerRadius:.85,innerRadius:0,outerRadiusWhileHighlight:.9,startAngle:0,endAngle:Math.PI*2,padAngle:0,strokeColorType:"background",strokeWidth:1,cornerRadius:0},th={renderFn:e=>e.eventName==="mouseover"||e.eventName==="mousemove"?[String(e.target.value)]:[],textAttrs:[{transform:"translate(0, 0)"}],textStyles:[{"font-weight":"bold","text-anchor":"middle","pointer-events":"none","dominant-baseline":"middle","font-size":64,fill:"#000"}]};th.renderFn.toString=()=>`(eventData) => {
|
|
325
|
+
if (eventData.eventName === 'mouseover' || eventData.eventName === 'mousemove') {
|
|
326
|
+
return [String(eventData.target.value)]
|
|
327
|
+
}
|
|
328
|
+
return [
|
|
329
|
+
String(
|
|
330
|
+
Math.round(
|
|
331
|
+
eventData.data.reduce((acc, seriesData) => {
|
|
332
|
+
return acc + seriesData.reduce((_acc, data) => {
|
|
333
|
+
return _acc + (data.value ?? 0)
|
|
334
|
+
}, 0)
|
|
335
|
+
}, 0) * (eventData.tween ?? 1)
|
|
336
|
+
)
|
|
337
|
+
)
|
|
338
|
+
]
|
|
339
|
+
}`;const nh={outerRadius:.85,outerRadiusWhileHighlight:.9,startAngle:0,endAngle:Math.PI*2,labelCentroid:2.1,labelColorType:"primary",labelFn:e=>String(e.name)};nh.labelFn.toString=()=>"d => String(d.name)";const Bb={outerRadius:.95,padAngle:0,strokeColorType:"background",strokeWidth:.5,cornerRadius:0,arcScaleType:"area",angleIncreaseWhileHighlight:.05},rh={outerRadius:.95,labelCentroid:2.1,labelFn:e=>String(e.name),labelColorType:"primary",arcScaleType:"area"};rh.labelFn.toString=()=>"d => String(d.name)";const P9={startAngle:-Math.PI/2,endAngle:Math.PI/2,radius:.6,indicatorType:"needle",size:10,colorType:"data",value:0},C9=({selectedSeriesData$:e,pluginParams$:t})=>O({selectedSeriesData:e,pluginParams:t}).pipe(X(0),T(({selectedSeriesData:n,pluginParams:r})=>n.flat().sort(r.sort??void 0).map((i,o)=>{const a=r.visibleFilter;return{...i,visible:a?a(i):!0,seq:o}}).sort((i,o)=>i.index-o.index).reduce((i,o)=>(i[o.seriesIndex]||(i[o.seriesIndex]=[]),i[o.seriesIndex].push(o),i),[]))),L9=({selectedSeriesData$:e})=>{const t=new Set;return e.pipe(T(n=>(n.forEach(r=>{r.forEach(i=>{t.add(i.name)})}),Array.from(t))))},k9=({pluginParams$:e})=>e.pipe(T(t=>t.separateSeries),H()),R9=({pluginParams$:e})=>e.pipe(T(t=>t.separateName),H()),E9=({selectedSeriesData$:e})=>e.pipe(T(t=>{const n=t.filter(r=>r.length).map(r=>r[0].series);return Array.from(new Set(n))}),H((t,n)=>JSON.stringify(t)===JSON.stringify(n))),N9=({seriesComputedData$:e})=>e.pipe(T(t=>t.map(n=>n.filter(r=>r.visible!=!1)))),B9=({seriesComputedData$:e,separateSeries$:t,separateName$:n,datumLabels$:r})=>O({seriesComputedData:e,separateSeries:t,separateName:n,datumLabels:r}).pipe(U(async i=>i),T(i=>{const o=i.separateSeries==!0?i.seriesComputedData:[i.seriesComputedData.flat()],a=i.separateName==!0?(()=>{const s=i.datumLabels.reduce((u,l,c)=>(u[l]=c,u),{});return o.map(u=>u.reduce((l,c)=>{const h=s[c.name];return l[h]==null&&(l[h]=[]),l[h].push(c),l},[])).flat()})():o;return i.separateSeries==!0&&i.separateName==!0?a.sort((s,u)=>s[0].seq-u[0].seq):a.map(s=>s.sort((u,l)=>u.seq-l.seq))})),z9=({computedSortedData$:e,pluginParams$:t,layout$:n})=>O({computedSortedData:e,pluginParams:t,layout:n}).pipe(U(async i=>i),T(i=>{const o=i.computedSortedData.length;return i8(i.layout,i.pluginParams.container,o)})),O9=({seriesContainerPosition$:e,computedSortedData$:t})=>O({seriesContainerPosition:e,computedSortedData:t}).pipe(U(async n=>n),T(n=>new Map(n.computedSortedData.map((r,i)=>r.map(o=>[o.id,n.seriesContainerPosition[i]])).flat()))),ul="CompositionPlot",Mo="Bubbles",zb=12;function I9(e,t){return za().velocityDecay(t.force.velocityDecay).force("collision",Ba().radius(n=>n.r+t.force.collisionSpacing)).force("charge",Oa().strength(n=>-Math.pow(n.r,2)*t.force.strength)).on("tick",()=>{e.attr("transform",n=>`translate(${n.x},${n.y})`)})}function F9({selection:e,bubblesData:t,fullParams:n,theme:r}){const i=e.selectAll("g").data(t,o=>o.id).join(o=>{const a=o.append("g").attr("cursor","pointer").attr("font-size",zb).style("fill","#ffffff").attr("text-anchor","middle");return a.append("circle").attr("class","node").attr("cx",0).attr("cy",0).attr("fill",s=>s.color),a.append("text").style("opacity",.8).attr("pointer-events","none"),a},o=>o,o=>o.remove()).attr("transform",o=>`translate(${o.x},${o.y})`);return i.select("circle").transition().duration(200).attr("r",o=>o.r).attr("fill",o=>o.color),i.each((o,a,s)=>{const u=I(s[a]),l=o.renderLabel;u.call(N1,{text:l,radius:o.r*n.bubbleLabel.fillRate,lineHeight:zb*n.bubbleLabel.lineHeight,isBreakAll:l.length<=n.bubbleLabel.maxLineLength?!1:n.bubbleLabel.wordBreakAll}),u.select("text").attr("fill",c=>Te({datum:o,colorType:n.bubbleLabel.colorType,theme:r}))}),i}function Y9(e){return aa().on("start",(t,n)=>{t.active||e.alpha(1).restart(),n.fx=n.x,n.fy=n.y}).on("drag",(t,n)=>{t.active||e.alphaTarget(0),n.fx=t.x,n.fy=t.y}).on("end",(t,n)=>{n.fx=null,n.fy=null,e.alpha(1).restart()})}function W9({_simulation:e,fullParams:t,DatumContainerPositionMap:n}){e.force("x",ag().strength(t.force.strength).x(r=>{let i=n.get(r.id);return i||(i=n.get(Array.from(n.keys())[0])),(i==null?void 0:i.centerX)??null})).force("y",sg().strength(t.force.strength).y(r=>{let i=n.get(r.id);return i||(i=n.get(Array.from(n.keys())[0])),(i==null?void 0:i.centerY)??null}))}function X9({bubblesSelection:e,highlightIds:t,pluginParams:n}){if(e.interrupt("highlight"),!t.length){e.transition("highlight").style("opacity",1);return}e.each((r,i,o)=>{const a=I(o[i]);t.includes(r.id)?a.style("opacity",1).transition("highlight").ease(qn).duration(500):a.style("opacity",n.styles.unhighlightedOpacity)})}const G9=G.defineSVGLayer({name:Mo,defaultParams:eh,layerIndex:Dt,initShow:!0,validator:e=>{const t=G.validateObject(e,{force:{toBeTypes:["object"]},bubbleLabel:{toBeTypes:["object"]},arcScaleType:{toBe:'"area" | "radius"',test:n=>n==="area"||n==="radius"}});if(e.force){const n=G.validateObject(e.force,{velocityDecay:{toBeTypes:["number"]},collisionSpacing:{toBeTypes:["number"]},strength:{toBeTypes:["number"]}});if(n.status==="error")return n}if(e.bubbleLabel){const n=G.validateObject(e.bubbleLabel,{labelFn:{toBeTypes:["Function"]},colorType:{toBeOption:"ColorType"},fillRate:{toBeTypes:["number"]},lineHeight:{toBeTypes:["number"]},maxLineLength:{toBeTypes:["number"]}});if(n.status==="error")return n}return t},setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee;r.layout$.pipe(k(i)).subscribe(g=>{I(e).attr("transform",`translate(${g.left}, ${g.top})`)});let o;const a=n.pipe(k(i),T(g=>g.arcScaleType),H(),W(1)),s=r.layout$.pipe(k(i),T(g=>Math.min(g.width,g.height)/2),H(),W(1)),u=r.visibleComputedSortedData$.pipe(k(i),T(g=>g.flat().reduce((m,y)=>m+y.value,0)),H(),W(1)),l=O({totalR:s,totalValue:u,scaleType:a}).pipe(k(i),U(async g=>g),T(g=>_n().domain([0,g.totalValue]).range([0,g.totalR]).exponent(g.scaleType==="area"?.5:1)),W(1)),c=a.pipe(k(i),U(g=>Nn(()=>g==="area",Io(1),O({totalR:s,radiusScale:l,visibleComputedSortedData:r.visibleComputedSortedData$}).pipe(U(async m=>m),T(m=>{const y=m.totalR*m.totalR*Math.PI;return Math.sqrt(y/Il(m.visibleComputedSortedData.flat(),b=>Math.PI*Math.pow(m.radiusScale(b.value),2)))}))))),h=O({visibleComputedSortedData:r.visibleComputedSortedData$,radiusScale:l,scaleFactor:c}).pipe(k(i),U(async g=>g),T(g=>new Map(g.visibleComputedSortedData.flat().map(y=>[y.id,g.radiusScale(y.value??0)*g.scaleFactor*.9]))),W(1)),f=r.DatumContainerPositionMap$.pipe(k(i),Ut(g=>g.size>0),T(g=>new Map(Array.from(g).map(([m,y])=>[m,{x:y.startX+y.width*Math.random(),y:y.startY+y.height*Math.random()}]))),Tl(),W(1)),p=O({visibleComputedSortedData:r.visibleComputedSortedData$,DatumRMap:h,DatumInitXYMap:f,fullParams:n}).pipe(k(i),U(async g=>g),T(g=>g.visibleComputedSortedData.flat().map(m=>{const y=m;if(y.x===void 0||y.y===void 0){let b=g.DatumInitXYMap.get(y.id);b||(b=g.DatumInitXYMap.get(Array.from(g.DatumInitXYMap.keys())[0])),y.x=b.x,y.y=b.y}return y.r=g.DatumRMap.get(y.id),y._originR=y.r,y.renderLabel=g.fullParams.bubbleLabel.labelFn(y),y})),W(1)),d=O({bubblesData:p,fullParams:n,theme:r.theme$,DatumContainerPositionMap:r.DatumContainerPositionMap$}).pipe(k(i),U(async g=>g),T(g=>{o&&o.stop();const m=F9({selection:I(e),bubblesData:g.bubblesData,fullParams:g.fullParams,theme:g.theme});return o=I9(m,g.fullParams),o.nodes(g.bubblesData),W9({_simulation:o,fullParams:g.fullParams,DatumContainerPositionMap:g.DatumContainerPositionMap}),o.alpha(1).restart(),m}),W(1));return O({bubblesSelection:d,computedData:r.computedData$}).pipe(k(i),U(async g=>g)).subscribe(g=>{g.bubblesSelection.on("mouseover",(m,y)=>{r.eventTrigger$.next({eventName:"mouseover",pluginName:ul,layerName:Mo,target:y,event:m})}).on("mousemove",(m,y)=>{r.eventTrigger$.next({eventName:"mousemove",pluginName:ul,layerName:Mo,target:y,event:m})}).on("mouseout",(m,y)=>{r.eventTrigger$.next({eventName:"mouseout",pluginName:ul,layerName:Mo,target:y,event:m})}).on("click",(m,y)=>{r.eventTrigger$.next({eventName:"click",pluginName:ul,layerName:Mo,target:y,event:m})}).call(Y9(o))}),O({bubblesSelection:d,highlight:r.seriesHighlight$.pipe(T(g=>g.map(m=>m.id))),pluginParams:t}).pipe(k(i),X(0)).subscribe(g=>{X9({bubblesSelection:g.bubblesSelection,highlightIds:g.highlight,pluginParams:g.pluginParams})}),()=>{i.next(void 0),o&&(o.stop(),o=void 0)}}});function V9({selection:e,pluginName:t,layerName:n,visibleComputedSortedData$:r}){const i=Z(t,n,"series");return r.pipe(T(o=>o.map(a=>a[0]?`${a[0].series}_${a[0].name}`:"")),H((o,a)=>JSON.stringify(o)===JSON.stringify(a)),T(o=>e.selectAll(`g.${i}`).data(o,a=>a).join(a=>a.append("g").classed(i,!0),a=>a,a=>a.remove())),W(1))}const Po=({selection:e,pluginName:t,layerName:n,visibleComputedSortedData$:r,seriesContainerPosition$:i})=>{const o=V9({selection:e,pluginName:t,layerName:n,visibleComputedSortedData$:r});return O({seriesCenterSelection:o,seriesContainerPosition:i}).pipe(U(async a=>a),H((a,s)=>a.seriesContainerPosition.length===s.seriesContainerPosition.length)).subscribe(a=>{a.seriesCenterSelection.attr("transform",(s,u)=>{const l=a.seriesContainerPosition[u]??a.seriesContainerPosition[0];return`translate(${l.centerX}, ${l.centerY})`})}),O({seriesCenterSelection:o,seriesContainerPosition:i}).pipe(U(async a=>a)).subscribe(a=>{a.seriesCenterSelection.transition().attr("transform",(s,u)=>{const l=a.seriesContainerPosition[u]??a.seriesContainerPosition[0];return`translate(${l.centerX}, ${l.centerY})`})}),{seriesCenterSelection$:o}};function Ob({data:e,startAngle:t,endAngle:n}){return Fy().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})}const dr="CompositionPlot",kn="Pie";function j9({enter:e,exit:t,data:n,lastTweenData:r,fullParams:i}){return!e.size()&&!t.size()?o=>{const a=n.map((s,u)=>{const l=r[u]??{startAngle:0,endAngle:0,value:0};return{...s,startAngle:s.startAngle*o+l.startAngle*(1-o),endAngle:s.endAngle*o+l.endAngle*(1-o),value:s.value*o+l.value*(1-o)}});return ih(a,i.startAngle,i.endAngle,1)}:o=>ih(n,i.startAngle,i.endAngle,o)}function ih(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 Ib({selection:e,data:t,arc:n,pathClassName:r,fullParams:i,theme:o}){return e.selectAll("path").data(t,s=>s.id).join("path").classed(r,!0).style("cursor","pointer").attr("fill",(s,u)=>s.data.color).attr("stroke",(s,u)=>Te({datum:s.data,colorType:i.strokeColorType,theme:o})).attr("stroke-width",i.strokeWidth).attr("d",(s,u)=>n(s))}function U9({pathSelection:e,ids:t,styles: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 u=I(s[a]);t.includes(o.data.id)?u.style("opacity",1).transition("highlight").ease(qn).duration(500).attr("d",l=>i(l)):u.style("opacity",n.unhighlightedOpacity).transition("highlight").attr("d",l=>r(l))})}function H9(e){const t=new ee,n=Z(dr,kn,"path");let r=[],i=[];const o=e.seriesContainerPosition$.pipe(k(t),T(h=>h.width<h.height?h.width:h.height),H()),a=new de(h=>{O({containerVisibleComputedSortedData:e.containerVisibleComputedSortedData$,fullParams:e.fullParams$}).pipe(k(t),X(0)).subscribe(f=>{const p=Ob({data:f.containerVisibleComputedSortedData,startAngle:f.fullParams.startAngle,endAngle:f.fullParams.endAngle});h.next(p)})}),s=new de(h=>{O({shorterSideWith:o,fullParams:e.fullParams$}).pipe(k(t),X(0)).subscribe(f=>{const p=rl({axisWidth:f.shorterSideWith,innerRadius:f.fullParams.innerRadius,outerRadius:f.fullParams.outerRadius,padAngle:f.fullParams.padAngle,cornerRadius:f.fullParams.cornerRadius});h.next(p)})}),u=new de(h=>{O({shorterSideWith:o,fullParams:e.fullParams$}).pipe(k(t),X(0)).subscribe(f=>{const p=rl({axisWidth:f.shorterSideWith,innerRadius:f.fullParams.innerRadius,outerRadius:f.fullParams.outerRadiusWhileHighlight,padAngle:f.fullParams.padAngle,cornerRadius:f.fullParams.cornerRadius});h.next(p)})}),l=e.pluginParams$.pipe(k(t),T(h=>h.styles.highlightTarget),H());e.seriesHighlight$.pipe(k(t)).subscribe(h=>h);const c=new de(h=>{O({pieData:a,arc:s,fullParams:e.fullParams$,styles:e.pluginParams$.pipe(T(f=>f.styles)),theme:e.theme$}).pipe(k(t),X(0)).subscribe(f=>{e.containerSelection.interrupt("graphicMove");const p=e.containerSelection.selectAll("path").data(f.pieData,y=>y.id),d=p.enter(),g=p.exit(),m=j9({enter:d,exit:g,data:f.pieData,lastTweenData:r,fullParams:f.fullParams});e.containerSelection.transition("graphicMove").duration(f.styles.transitionDuration).tween("move",(y,b)=>x=>{i=m(x),Ib({selection:e.containerSelection,data:i,arc:f.arc,pathClassName:n,fullParams:f.fullParams,theme:f.theme})}).on("end",(y,b)=>{i=ih(f.pieData,f.fullParams.startAngle,f.fullParams.endAngle,1);const x=Ib({selection:e.containerSelection,data:i,arc:f.arc,pathClassName:n,fullParams:f.fullParams,theme:f.theme});h.next(x),r=Object.assign([],f.pieData),e.eventTrigger$.next({eventName:"transitionEnd",pluginName:dr,layerName:kn,target:null,event:void 0})})})}).pipe(W(1));return O({pathSelection:c,highlightTarget:l}).pipe(k(t),X(0)).subscribe(h=>{h.pathSelection.on("mouseover",(f,p)=>{e.eventTrigger$.next({eventName:"mouseover",pluginName:dr,layerName:kn,target:p.data,event:f})}).on("mousemove",(f,p)=>{f.stopPropagation(),e.eventTrigger$.next({eventName:"mousemove",pluginName:dr,layerName:kn,target:p.data,event:f})}).on("mouseout",(f,p)=>{f.stopPropagation(),e.eventTrigger$.next({eventName:"mouseout",pluginName:dr,layerName:kn,target:p.data,event:f})}).on("click",(f,p)=>{f.stopPropagation(),e.eventTrigger$.next({eventName:"click",pluginName:dr,layerName:kn,target:p.data,event:f})})}),O({pathSelection:c,highlight:e.seriesHighlight$.pipe(T(h=>h.map(f=>f.id))),styles:e.pluginParams$.pipe(T(h=>h.styles)),arc:s,arcHighlight:u}).pipe(k(t),X(0)).subscribe(h=>{U9({pathSelection:h.pathSelection,ids:h.highlight,styles:h.styles,arc:h.arc,arcHighlight:h.arcHighlight})}),()=>{t.next(void 0)}}const q9=G.defineSVGLayer({name:kn,defaultParams:Nb,layerIndex:Dt,initShow:!1,validator:e=>G.validateObject(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"]}}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee;r.layout$.pipe(k(i)).subscribe(s=>{I(e).attr("transform",`translate(${s.left}, ${s.top})`)});const{seriesCenterSelection$:o}=Po({selection:I(e),pluginName:dr,layerName:kn,visibleComputedSortedData$:r.visibleComputedSortedData$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(k(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const h=I(c[l]),f=r.visibleComputedSortedData$.pipe(k(i),T(d=>d[l]??d[0])),p=r.seriesContainerPosition$.pipe(k(i),T(d=>d[l]??d[0]));a[l]=H9({containerSelection:h,containerVisibleComputedSortedData$:f,fullParams$:n,theme$:r.theme$,pluginParams$:t,seriesHighlight$:r.seriesHighlight$,seriesContainerPosition$:p,eventTrigger$:r.eventTrigger$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}}),cl="CompositionPlot",Co="PieEventTexts",Fb=Z(cl,Co,"text");function oh(e,t){const n=e.selectAll(`text.${Fb}`).data(t),r=n.enter().append("text").classed(Fb,!0),i=n.merge(r);return i.each((o,a,s)=>{const u=I(s[a]).text(o.text);Object.keys(o.attr).forEach(l=>{u.attr(l,o.attr[l])}),Object.keys(o.style).forEach(l=>{u.style(l,o.style[l])})}),n.exit().remove(),i}function ah({eventData:e,renderFn:t,textAttrs:n,textStyles:r}){const i=t(e);return i===null?null:(Array.isArray(i)?i:[i]).map((a,s)=>({text:a,attr:n[s],style:r[s]}))}function Z9(e){const t=new ee;let n;const r=e.pluginParams$.pipe(k(t),T(o=>o.styles.highlightTarget),H());let i=[];return e.seriesHighlight$.pipe(k(t)).subscribe(o=>i=o),O({computedData:e.computedData$,layerParams:e.layerParams$,pluginParams:e.pluginParams$,highlightTarget:r}).pipe(k(t),U(async o=>o)).subscribe(o=>{e.containerSelection.transition("move").duration(o.pluginParams.styles.transitionDuration).tween("move",(a,s)=>u=>{const l=ah({eventData:{eventName:"mousemove",pluginName:cl,layerName:Co,target:i[0]||null,event:a},renderFn:o.layerParams.renderFn,textAttrs:o.layerParams.textAttrs,textStyles:o.layerParams.textStyles});l!=null&&oh(e.containerSelection,l)}).on("end",(a,s)=>{const u=ah({eventData:{eventName:"mousemove",pluginName:cl,layerName:Co,target:i[0]||null,event:a},renderFn:o.layerParams.renderFn,textAttrs:o.layerParams.textAttrs,textStyles:o.layerParams.textStyles});u!=null&&oh(e.containerSelection,u),n&&n.unsubscribe(),n=e.eventTrigger$.subscribe(l=>{const c=ah({eventData:l,renderFn:o.layerParams.renderFn,textAttrs:o.layerParams.textAttrs,textStyles:o.layerParams.textStyles});c!=null&&oh(e.containerSelection,c)})})}),()=>{t.next(void 0)}}const J9=G.defineSVGLayer({name:Co,defaultParams:th,layerIndex:Of,initShow:!1,validator:e=>G.validateObject(e,{renderFn:{toBeTypes:["Function"]},textAttrs:{toBeTypes:["object[]"]},textStyles:{toBeTypes:["object[]"]}}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee;r.layout$.pipe(k(i)).subscribe(s=>{I(e).attr("transform",`translate(${s.left}, ${s.top})`)});const{seriesCenterSelection$:o}=Po({selection:I(e),pluginName:cl,layerName:Co,visibleComputedSortedData$:r.visibleComputedSortedData$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(k(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const h=I(c[l]);r.computedSortedData$.pipe(k(i),T(f=>f[l]??f[0])),r.seriesContainerPosition$.pipe(k(i),T(f=>f[l]??f[0])),a[l]=Z9({containerSelection:h,computedData$:r.computedData$,SeriesDataMap$:r.SeriesDataMap$,layerParams$:n,pluginParams$:t,seriesHighlight$:r.seriesHighlight$,eventTrigger$:r.eventTrigger$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}}),fl="CompositionPlot",Lo="PieLabels",K9=Z(fl,Lo,"label-g"),Q9=Z(fl,Lo,"line-g"),eL=Z(fl,Lo,"text"),Yb=2;function tL({pieData:e,arc:t,arcMouseover:n,labelCentroid:r,lineStartCentroid:i,layerParams:o}){return e.map((a,s)=>{const[u,l]=t.centroid(a),[c,h]=n.centroid(a),f=o.labelFn(a.data);return{pieDatum:a,arcIndex:s,arcLabels:f.split(`
|
|
340
|
+
`),lineStartX:u*i,lineStartY:l*i,lineStartMouseoverX:c*i,lineStartMouseoverY:h*i,x:u*r,y:l*r,mouseoverX:c*r,mouseoverY:h*r,textWidth:0,collisionShiftX:0,collisionShiftY:0,quadrant:u>=0&&l<=0?1:u<0&&l<=0?2:u<0&&l>0?3:4}}).filter(a=>a.pieDatum.data.visible)}function nL({labelGSelection:e,data:t,layerParams:n,pluginParams:r,theme:i,fontSizePx:o}){const a=e.selectAll("text").data(t,s=>s.pieDatum.id).join("text").classed(eL,!0).attr("font-weight","bold").attr("text-anchor",s=>s.quadrant==1||s.quadrant==4?"start":"end").style("dominant-baseline",s=>s.quadrant==1||s.quadrant==2?"auto":"hanging").style("cursor",s=>r.styles.highlightTarget&&r.styles.highlightTarget!="none"?"pointer":"none").attr("font-size",o).attr("x",0).attr("y",0).attr("fill",(s,u)=>Te({datum:s.pieDatum.data,colorType:n.labelColorType,theme:i})).each((s,u,l)=>{B1(I(l[u]),{textArr:s.arcLabels,fontSizePx:o,quadrant:s.quadrant})});return a.transition().attr("transform",s=>"translate("+s.x+","+s.y+")"),a}function rL(e,t,n){const r=e.nodes(),i=n,o=r.map((a,s)=>{const u=a.getBBox(),l=[t[s].x,t[s].y];return{node:a,x:l[0],y:l[1],width:u.width,height:u.height}});for(let a=0;a<o.length;a++){const s=o[a];for(let u=a+1;u<o.length;u++){const l=o[u];t[a].textWidth=s.width;const c=s.x+t[a].collisionShiftX,h=s.y+t[a].collisionShiftY,f=l.x+t[u].collisionShiftX,p=l.y+t[u].collisionShiftY;if(!(c+s.width/2<f-l.width/2||c-s.width/2>f+l.width/2||h+s.height/2<p-l.height/2||h-s.height/2>p+l.height/2)){if(t[u].quadrant==2){const d=p>h?-i*2:-i;t[u].collisionShiftY+=d}else if(t[u].quadrant==4){const d=p>h?i:i*2;t[u].collisionShiftY+=d}}}}for(let a=o.length-1;a>=0;a--){const s=o[a];for(let u=a-1;u>=0;u--){const l=o[u];t[a].textWidth=s.width;const c=s.x+t[a].collisionShiftX,h=s.y+t[a].collisionShiftY,f=l.x+t[u].collisionShiftX,p=l.y+t[u].collisionShiftY;if(!(c+s.width/2<f-l.width/2||c-s.width/2>f+l.width/2||h+s.height/2<p-l.height/2||h-s.height/2>p+l.height/2)){if(t[u].quadrant==1){const d=p>h?-i*2:-i;t[u].collisionShiftY+=d}else if(t[u].quadrant==3){const d=p>h?i:i*2;t[u].collisionShiftY+=d}}}}e.data(t).transition().attr("transform",a=>`translate(${a.x+a.collisionShiftX},${a.y+a.collisionShiftY})`)}function iL({lineGSelection:e,data:t,layerParams:n,theme: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=>Te({datum:a.pieDatum.data,colorType:n.labelColorType,theme:r})).attr("stroke-width",1).attr("fill","none").attr("points",a=>[[a.lineStartX,a.lineStartY],[a.lineStartX,a.lineStartY]]);return o.transition().attr("points",a=>{let s=a.x+a.collisionShiftX,u=a.y+a.collisionShiftY;return[[s,u],[a.lineStartX,a.lineStartY]]}),o}function oL({textSelection:e,lineSelection:t,ids:n,pluginParams: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=I(a[o]);n.includes(i.pieDatum.id)?s.style("opacity",1).transition("highlight").duration(200).attr("transform",u=>u.collisionShiftX||u.collisionShiftY?`translate(${u.x+u.collisionShiftX},${u.y+u.collisionShiftY})`:`translate(${u.mouseoverX+u.collisionShiftX},${u.mouseoverY+u.collisionShiftY})`):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200).attr("transform",u=>`translate(${u.x+u.collisionShiftX},${u.y+u.collisionShiftY})`)}),t.each((i,o,a)=>{const s=I(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 aL(e){const t=new ee;e.containerSelection.selectAll("g").remove();const n=e.containerSelection.append("g");n.classed(Q9,!0);const r=e.containerSelection.append("g");r.classed(K9,!0);const i=new ee,o=new ee;let a=[];const s=e.seriesContainerPosition$.pipe(k(t),T(l=>l.width<l.height?l.width:l.height),H()),u=e.layerParams$.pipe(k(t),T(l=>l.labelCentroid>=Yb?Yb:l.labelCentroid));return O({shorterSideWith:s,containerVisibleComputedSortedData:e.containerVisibleComputedSortedData$,layerParams:e.layerParams$,pluginParams:e.pluginParams$,theme:e.theme$,fontSizePx:e.fontSizePx$,lineStartCentroid:u}).pipe(k(t),U(async l=>l)).subscribe(l=>{const c=rl({axisWidth:l.shorterSideWith,innerRadius:0,outerRadius:l.layerParams.outerRadius,padAngle:0,cornerRadius:0}),h=rl({axisWidth:l.shorterSideWith,innerRadius:0,outerRadius:l.layerParams.outerRadiusWhileHighlight,padAngle:0,cornerRadius:0}),f=Ob({data:l.containerVisibleComputedSortedData,startAngle:l.layerParams.startAngle,endAngle:l.layerParams.endAngle});a=tL({pieData:f,arc:c,arcMouseover:h,labelCentroid:l.layerParams.labelCentroid,lineStartCentroid:l.lineStartCentroid,layerParams:l.layerParams}),n.selectAll("polyline").remove();const p=nL({labelGSelection:r,data:a,layerParams:l.layerParams,pluginParams:l.pluginParams,theme:l.theme,fontSizePx:l.fontSizePx});setTimeout(()=>{rL(p,a,l.fontSizePx);const d=iL({lineGSelection:n,data:a,layerParams:l.layerParams,theme:l.theme});o.next(d)},1e3),i.next(p)}),O({textSelection:i,lineSelection:o,highlight:e.seriesHighlight$.pipe(T(l=>l.map(c=>c.id))),pluginParams:e.pluginParams$}).pipe(k(t),X(0)).subscribe(l=>{oL({textSelection:l.textSelection,lineSelection:l.lineSelection,ids:l.highlight,pluginParams:l.pluginParams})}),()=>{t.next(void 0)}}const sL=G.defineSVGLayer({name:Lo,defaultParams:nh,layerIndex:Of,initShow:!1,validator:e=>G.validateObject(e,{outerRadius:{toBeTypes:["number"]},outerRadiusWhileHighlight:{toBeTypes:["number"]},startAngle:{toBeTypes:["number"]},endAngle:{toBeTypes:["number"]},labelCentroid:{toBeTypes:["number"]},labelFn:{toBeTypes:["Function"]},labelColorType:{toBeOption:"ColorType"}}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee;r.layout$.pipe(k(i)).subscribe(s=>{I(e).attr("transform",`translate(${s.left}, ${s.top})`)});const{seriesCenterSelection$:o}=Po({selection:I(e),pluginName:fl,layerName:Lo,visibleComputedSortedData$:r.visibleComputedSortedData$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(k(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const h=I(c[l]),f=r.visibleComputedSortedData$.pipe(k(i),T(d=>d[l]??d[0])),p=r.seriesContainerPosition$.pipe(k(i),T(d=>d[l]??d[0]));a[l]=aL({containerSelection:h,containerVisibleComputedSortedData$:f,layerParams$:n,pluginParams$:t,theme$:r.theme$,fontSizePx$:r.fontSizePx$,seriesHighlight$:r.seriesHighlight$,seriesContainerPosition$:p,eventTrigger$:r.eventTrigger$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}}),Wb="CompositionPlot",gr="Rose",lL=Math.PI*2;function uL({cornerRadius:e,outerRadius:t,axisWidth:n,maxValue:r,arcScaleType:i,layerParams:o}){const a=n/2*t,s=i==="area"?.5:1,u=_n().domain([0,r]).range([0,a]).exponent(s);return l=>{const c=u(l.prevValue),h=u(l.value),f=Ht(c,h);return p=>{const d=f(p);return Vs().innerRadius(0).outerRadius(d).padAngle(o.padAngle).padRadius(d).cornerRadius(e)(l)}}}function cL({pathSelection:e,ids:t,layerParams:n,pluginParams: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 u=I(s[a]);t.includes(o.data.id)?u.style("opacity",1).transition("highlight").ease(qn).duration(500).attr("d",l=>i({...l,startAngle:l.startAngle-n.angleIncreaseWhileHighlight,endAngle:l.endAngle+n.angleIncreaseWhileHighlight})(1)):u.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").attr("d",l=>i(l)(1))})}function fL(e,t){const n=new ee,r=Z(e,gr,"path");let i=[];const o=t.seriesContainerPosition$.pipe(k(n),T(p=>p.width<p.height?p.width:p.height),H()),a=O({containerVisibleComputedSortedData:t.containerVisibleComputedSortedData$,layerParams:t.layerParams$}).pipe(k(n),U(async p=>p),T(p=>{const d=lL/p.containerVisibleComputedSortedData.length;return p.containerVisibleComputedSortedData.map((g,m)=>({id:g.id,data:g,index:m,value:g.value,startAngle:d*m,endAngle:d*(m+1),padAngle:p.layerParams.padAngle,prevValue:i[m]&&i[m].id===g.id?i[m].value:0}))})),s=t.pluginParams$.pipe(k(n),T(p=>p.styles.highlightTarget),H()),u=t.visibleComputedSortedData$.pipe(T(p=>Math.max(...p.flat().map(d=>d.value))),H()),l=O({layerParams:t.layerParams$,axisWidth:o,maxValue:u}).pipe(k(n),X(0),T(p=>uL({cornerRadius:p.layerParams.cornerRadius,outerRadius:p.layerParams.outerRadius,axisWidth:p.axisWidth,maxValue:p.maxValue,arcScaleType:p.layerParams.arcScaleType,layerParams:p.layerParams}))),c=t.pluginParams$.pipe(k(n),T(p=>p.styles.transitionDuration),H()),h=new hi(!1),f=new de(p=>{O({roseData:a,tweenArc:l,transitionDuration:c,layerParams:t.layerParams$,pluginParams:t.pluginParams$,theme:t.theme$}).pipe(k(n),X(0)).subscribe(d=>{const g=d.roseData.map((y,b)=>(y.prevValue=i[b]&&i[b].id===y.id?i[b].value:0,y));h.next(!0);const m=t.containerSelection.selectAll("path").data(g,y=>y.id).join("path").classed(r,!0).style("cursor","pointer").attr("fill",(y,b)=>y.data.color).attr("stroke",(y,b)=>Te({datum:y.data,colorType:d.layerParams.strokeColorType,theme:d.theme})).attr("stroke-width",d.layerParams.strokeWidth);m.interrupt("graphicMove"),m.transition("graphicMove").duration(d.transitionDuration).attrTween("d",d.tweenArc).on("end",()=>{p.next(m),h.next(!1)}),i=Object.assign([],g)})}).pipe(W(1));return O({pathSelection:f,SeriesDataMap:t.SeriesDataMap$,computedData:t.computedData$,highlightTarget:s}).pipe(k(n),X(0)).subscribe(p=>{p.pathSelection.on("mouseover",(d,g)=>{d.stopPropagation(),t.eventTrigger$.next({eventName:"mouseover",pluginName:e,layerName:gr,target:g.data,event:d})}).on("mousemove",(d,g)=>{d.stopPropagation(),t.eventTrigger$.next({eventName:"mousemove",pluginName:e,layerName:gr,target:g.data,event:d})}).on("mouseout",(d,g)=>{d.stopPropagation(),t.eventTrigger$.next({eventName:"mouseout",pluginName:e,layerName:gr,target:g.data,event:d})}).on("click",(d,g)=>{d.stopPropagation(),t.eventTrigger$.next({eventName:"click",pluginName:e,layerName:gr,target:g.data,event:d})})}),O({pathSelection:f,highlight:t.seriesHighlight$.pipe(T(p=>p.map(d=>d.id))),layerParams:t.layerParams$,pluginParams:t.pluginParams$,tweenArc:l,isTransitionMoving:h}).pipe(k(n),X(0),Ut(p=>!p.isTransitionMoving)).subscribe(p=>{cL({pathSelection:p.pathSelection,ids:p.highlight,layerParams:p.layerParams,pluginParams:p.pluginParams,tweenArc:p.tweenArc})}),()=>{n.next(void 0)}}const hL=G.defineSVGLayer({name:gr,defaultParams:Bb,layerIndex:Dt,initShow:!1,validator:e=>G.validateObject(e,{outerRadius:{toBeTypes:["number"]},padAngle:{toBeTypes:["number"]},strokeColorType:{toBeOption:"ColorType"},strokeWidth:{toBeTypes:["number"]},cornerRadius:{toBeTypes:["number"]},arcScaleType:{toBe:'"area" | "radius"',test:n=>n==="area"||n==="radius"},angleIncreaseWhileHighlight:{toBeTypes:["number"]}}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee;r.layout$.pipe(k(i)).subscribe(s=>{I(e).attr("transform",`translate(${s.left}, ${s.top})`)});const{seriesCenterSelection$:o}=Po({selection:I(e),pluginName:Wb,layerName:gr,visibleComputedSortedData$:r.visibleComputedSortedData$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(k(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const h=I(c[l]),f=r.visibleComputedSortedData$.pipe(k(i),T(d=>JSON.parse(JSON.stringify(d[l]??d[0])))),p=r.seriesContainerPosition$.pipe(k(i),T(d=>JSON.parse(JSON.stringify(d[l]??d[0]))));a[l]=fL(Wb,{containerSelection:h,computedData$:r.computedData$,visibleComputedSortedData$:r.visibleComputedSortedData$,containerVisibleComputedSortedData$:f,SeriesDataMap$:r.SeriesDataMap$,layerParams$:n,pluginParams$:t,theme$:r.theme$,seriesHighlight$:r.seriesHighlight$,seriesContainerPosition$:p,eventTrigger$:r.eventTrigger$})})}),()=>{i.next(void 0),a.forEach(s=>s())}}}),hl="CompositionPlot",ko="RoseLabels",pL=Z(hl,ko,"label-g"),dL=Z(hl,ko,"line-g"),gL=Z(hl,ko,"text"),Xb=2;function mL({pieData:e,labelCentroid:t,arcScaleType:n,maxValue:r,axisWidth:i,outerRadius:o,lineStartCentroid:a,layerParams:s}){const u=i/2*o,l=n==="area"?.5:1,c=_n().domain([0,r]).range([0,u]).exponent(l);return e.map((h,f)=>{const p=c(h.value),d=Vs().innerRadius(0).outerRadius(p).padAngle(0).padRadius(p).cornerRadius(0),[g,m]=d.centroid(h),[y,b]=[g,m],x=s.labelFn(h.data);return{pieDatum:h,arcIndex:f,arcLabels:x.split(`
|
|
341
|
+
`),lineStartX:g*a,lineStartY:m*a,lineStartMouseoverX:y*a,lineStartMouseoverY:b*a,x:g*t,y:m*t,mouseoverX:y*t,mouseoverY:b*t,textWidth:0,collisionShiftX:0,collisionShiftY:0,quadrant:g>=0&&m<=0?1:g<0&&m<=0?2:g<0&&m>0?3:4}}).filter(h=>h.pieDatum.data.visible)}function yL({labelGSelection:e,data:t,layerParams:n,pluginParams:r,theme:i,fontSizePx:o}){const a=e.selectAll("text").data(t,s=>s.pieDatum.id).join("text").classed(gL,!0).attr("font-weight","bold").attr("text-anchor",s=>s.quadrant==1||s.quadrant==4?"start":"end").style("dominant-baseline",s=>s.quadrant==1||s.quadrant==2?"auto":"hanging").style("cursor",s=>r.styles.highlightTarget&&r.styles.highlightTarget!="none"?"pointer":"none").attr("font-size",o).attr("fill",(s,u)=>Te({datum:s.pieDatum.data,colorType:n.labelColorType,theme:i})).each((s,u,l)=>{B1(I(l[u]),{textArr:s.arcLabels,fontSizePx:o,quadrant:s.quadrant})});return a.transition().attr("transform",s=>"translate("+s.x+","+s.y+")"),a}function bL(e,t,n){const r=e.nodes(),i=n,o=r.map((a,s)=>{const u=a.getBBox(),l=[t[s].x,t[s].y];return{node:a,x:l[0],y:l[1],width:u.width,height:u.height}});for(let a=0;a<o.length;a++){const s=o[a];for(let u=a+1;u<o.length;u++){const l=o[u];t[a].textWidth=s.width;const c=s.x+t[a].collisionShiftX,h=s.y+t[a].collisionShiftY,f=l.x+t[u].collisionShiftX,p=l.y+t[u].collisionShiftY;if(!(c+s.width/2<f-l.width/2||c-s.width/2>f+l.width/2||h+s.height/2<p-l.height/2||h-s.height/2>p+l.height/2)){if(t[u].quadrant==2){const d=p>h?-i*2:-i;t[u].collisionShiftY+=d}else if(t[u].quadrant==4){const d=p>h?i:i*2;t[u].collisionShiftY+=d}}}}for(let a=o.length-1;a>=0;a--){const s=o[a];for(let u=a-1;u>=0;u--){const l=o[u];t[a].textWidth=s.width;const c=s.x+t[a].collisionShiftX,h=s.y+t[a].collisionShiftY,f=l.x+t[u].collisionShiftX,p=l.y+t[u].collisionShiftY;if(!(c+s.width/2<f-l.width/2||c-s.width/2>f+l.width/2||h+s.height/2<p-l.height/2||h-s.height/2>p+l.height/2)){if(t[u].quadrant==1){const d=p>h?-i*2:-i;t[u].collisionShiftY+=d}else if(t[u].quadrant==3){const d=p>h?i:i*2;t[u].collisionShiftY+=d}}}}e.data(t).transition().attr("transform",a=>`translate(${a.x+a.collisionShiftX},${a.y+a.collisionShiftY})`)}function xL({lineGSelection:e,data:t,layerParams:n,theme: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=>Te({datum:a.pieDatum.data,colorType:n.labelColorType,theme:r})).attr("stroke-width",1).attr("fill","none").attr("points",a=>[[a.lineStartX,a.lineStartY],[a.lineStartX,a.lineStartY]]);return o.transition().attr("points",a=>{let s=a.x+a.collisionShiftX,u=a.y+a.collisionShiftY;return[[s,u],[a.lineStartX,a.lineStartY]]}),o}function vL({textSelection:e,lineSelection:t,ids:n,pluginParams: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=I(a[o]);n.includes(i.pieDatum.data.id)?s.style("opacity",1).transition("highlight").duration(200).attr("transform",u=>`translate(${u.mouseoverX+u.collisionShiftX},${u.mouseoverY+u.collisionShiftY})`):s.style("opacity",r.styles.unhighlightedOpacity).transition("highlight").duration(200).attr("transform",u=>`translate(${u.x+u.collisionShiftX},${u.y+u.collisionShiftY})`)}),t.each((i,o,a)=>{const s=I(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 SL(e){const t=new ee;e.containerSelection.selectAll("g").remove();const n=e.containerSelection.append("g");n.classed(dL,!0);const r=e.containerSelection.append("g");r.classed(pL,!0);const i=new ee,o=new ee;let a=[];const s=e.seriesContainerPosition$.pipe(k(t),T(c=>c.width<c.height?c.width:c.height),H()),u=e.visibleComputedSortedData$.pipe(T(c=>Math.max(...c.flat().map(h=>h.value))),H()),l=e.layerParams$.pipe(k(t),T(c=>c.labelCentroid>=Xb?Xb:c.labelCentroid));return O({shorterSideWith:s,containerVisibleComputedSortedData:e.containerVisibleComputedSortedData$,maxValue:u,layerParams:e.layerParams$,pluginParams:e.pluginParams$,theme:e.theme$,fontSizePx:e.fontSizePx$,lineStartCentroid:l}).pipe(k(t),U(async c=>c)).subscribe(c=>{const h=Math.PI*2/c.containerVisibleComputedSortedData.length,f=c.containerVisibleComputedSortedData.map((d,g)=>({id:d.id,data:d,index:g,value:d.value,startAngle:h*g,endAngle:h*(g+1),padAngle:0}));a=mL({pieData:f,labelCentroid:c.layerParams.labelCentroid,arcScaleType:c.layerParams.arcScaleType,maxValue:c.maxValue,axisWidth:c.shorterSideWith,outerRadius:c.layerParams.outerRadius,lineStartCentroid:c.lineStartCentroid,layerParams:c.layerParams}),n.selectAll("polyline").remove();const p=yL({labelGSelection:r,data:a,layerParams:c.layerParams,pluginParams:c.pluginParams,theme:c.theme,fontSizePx:c.fontSizePx});setTimeout(()=>{bL(p,a,c.fontSizePx);const d=xL({lineGSelection:n,data:a,layerParams:c.layerParams,theme:c.theme});o.next(d)},1e3),i.next(p)}),O({textSelection:i,lineSelection:o,highlight:e.seriesHighlight$.pipe(T(c=>c.map(h=>h.id))),pluginParams:e.pluginParams$}).pipe(k(t),X(0)).subscribe(c=>{vL({textSelection:c.textSelection,lineSelection:c.lineSelection,ids:c.highlight,pluginParams:c.pluginParams})}),()=>{t.next(void 0)}}const $L=G.defineSVGLayer({name:ko,defaultParams:rh,layerIndex:Of,initShow:!1,validator:e=>G.validateObject(e,{outerRadius:{toBeTypes:["number"]},labelCentroid:{toBeTypes:["number"]},labelFn:{toBeTypes:["Function"]},labelColorType:{toBeOption:"ColorType"},arcScaleType:{toBe:'"area" | "radius"',test:n=>n==="area"||n==="radius"}}),setup:({svgG:e,pluginParams$:t,layerParams$:n,context:r})=>{const i=new ee;r.layout$.pipe(k(i)).subscribe(s=>{I(e).attr("transform",`translate(${s.left}, ${s.top})`)});const{seriesCenterSelection$:o}=Po({selection:I(e),pluginName:hl,layerName:ko,visibleComputedSortedData$:r.visibleComputedSortedData$,seriesContainerPosition$:r.seriesContainerPosition$}),a=[];return o.pipe(k(i)).subscribe(s=>{a.forEach(u=>u()),s.each((u,l,c)=>{const h=I(c[l]),f=r.visibleComputedSortedData$.pipe(k(i),T(d=>JSON.parse(JSON.stringify(d[l]??d[0])))),p=r.seriesContainerPosition$.pipe(k(i),T(d=>JSON.parse(JSON.stringify(d[l]??d[0]))));a[l]=SL({containerSelection:h,visibleComputedSortedData$:r.visibleComputedSortedData$,containerVisibleComputedSortedData$:f,layerParams$:n,pluginParams$:t,theme$:r.theme$,fontSizePx$:r.fontSizePx$,seriesHighlight$:r.seriesHighlight$,seriesContainerPosition$:p,eventTrigger$:r.eventTrigger$})})}),()=>{i.next(void 0)}}}),wL=new G9,_L=new q9,TL=new J9,AL=new sL,DL=new hL,ML=new $L,PL=G.defineSVGPlugin({name:"CompositionPlot",defaultParams:Qf,layers:[wL,_L,TL,AL,DL,ML],setup:e=>{const t=O({seriesData:e.context.seriesData$,datasetIndex:e.pluginParams$.pipe(T(y=>y.datasetIndex))}).pipe(X(0),T(({seriesData:y,datasetIndex:b})=>y[b]),W(1)),n=Bn({size$:e.context.size$,padding$:e.pluginParams$.pipe(T(y=>y.styles.padding))}).pipe(W(1)),r=C9({selectedSeriesData$:t,pluginParams$:e.pluginParams$}).pipe(W(1)),i=dn(e.context.theme$).pipe(W(1)),o=L9({selectedSeriesData$:t}).pipe(W(1)),a=k9({pluginParams$:e.pluginParams$}).pipe(W(1)),s=R9({pluginParams$:e.pluginParams$}).pipe(W(1)),u=B9({seriesComputedData$:r,separateSeries$:a,separateName$:s,datumLabels$:o}).pipe(W(1)),l=N9({seriesComputedData$:u}).pipe(W(1)),c=r.pipe(T(y=>y.flat())).pipe(W(1)),h=vr({datumList$:c,styles$:e.pluginParams$.pipe(T(y=>y.styles)),event$:e.context.event$}).pipe(W(1)),f=E9({selectedSeriesData$:t}).pipe(W(1)),p=di({datumList$:c}).pipe(W(1)),d=z9({computedSortedData$:u,pluginParams$:e.pluginParams$,layout$:n}).pipe(W(1)),g=O9({seriesContainerPosition$:d,computedSortedData$:u}).pipe(W(1)),m={layout$:n,computedData$:r,fontSizePx$:i,datumLabels$:o,separateSeries$:a,separateName$:s,computedSortedData$:u,visibleComputedSortedData$:l,datumList$:c,seriesHighlight$:h,seriesLabels$:f,SeriesDataMap$:p,seriesContainerPosition$:d,DatumContainerPositionMap$:g};return e.context={...e.context,...m},()=>{}},validator:e=>{const t=G.validateObject(e,{styles:{toBeTypes:["object"]},visibleFilter:{toBeTypes:["Function","null"]},sort:{toBeTypes:["Function","null"]},container:{toBeTypes:["object"]},separateSeries:{toBeTypes:["boolean"]},separateName:{toBeTypes:["boolean"]},datasetIndex:{toBeTypes:["number"]}});if(t.status==="error")return t;if(e.styles){const n=G.validateObject(e.styles,{padding:{toBeTypes:["object"]},highlightTarget:{toBeTypes:["string"]},highlightDefault:{toBeTypes:["string","null"]},unhighlightedOpacity:{toBeTypes:["number"]},transitionDuration:{toBeTypes:["number"]},transitionEase:{toBeTypes:["string"]}});if(n.status==="error")return n;if(e.styles.padding){const r=G.validateObject(e.styles.padding,{top:{toBeTypes:["number"]},right:{toBeTypes:["number"]},bottom:{toBeTypes:["number"]},left:{toBeTypes:["number"]}});if(r.status==="error")return r}}if(e.container){const n=G.validateObject(e.container,{columnAmount:{toBeTypes:["number"]},rowAmount:{toBeTypes:["number"]},columnGap:{toBe:'number | "auto"',test:r=>typeof r=="number"||r==="auto"},rowGap:{toBe:'number | "auto"',test:r=>typeof r=="number"||r==="auto"}});if(n.status==="error")return n}return t}});le.CompositionPlot=PL,le.DEFAULT_BARS_DIVERGING_PARAMS=mC,le.DEFAULT_BARS_PARAMS=Gf,le.DEFAULT_BARS_TRIANGLE_PARAMS=X1,le.DEFAULT_BUBBLES_PARAMS=eh,le.DEFAULT_CATEGORY_AUX_PARAMS=Xf,le.DEFAULT_CATEGORY_AXIS_PARAMS=Vf,le.DEFAULT_CATEGORY_ZOOM_PARAMS=V1,le.DEFAULT_COMPOSITION_PLOT_PARAMS=Qf,le.DEFAULT_DOTS_PARAMS=Y1,le.DEFAULT_FORCE_DIRECTED_BUBBLES_PARAMS=ui,le.DEFAULT_FORCE_DIRECTED_PARAMS=li,le.DEFAULT_HIERARCHY_PLOT_PARAMS=hb,le.DEFAULT_INDICATOR_PARAMS=P9,le.DEFAULT_LINES_PARAMS=I1,le.DEFAULT_LINE_AREAS_PARAMS=F1,le.DEFAULT_NETWORK_PLOT_PARAMS=bb,le.DEFAULT_PIE_EVENT_TEXTS_PARAMS=th,le.DEFAULT_PIE_LABELS_PARAMS=nh,le.DEFAULT_PIE_PARAMS=Nb,le.DEFAULT_ROSE_LABELS_PARAMS=rh,le.DEFAULT_ROSE_PARAMS=Bb,le.DEFAULT_SCATTER_BUBBLES_PARAMS=Eh,le.DEFAULT_SCATTER_PARAMS=Rh,le.DEFAULT_SCATTER_PLOT_PARAMS=Ml,le.DEFAULT_SERIES_LEGEND_PARAMS=gb,le.DEFAULT_SERIES_LEGEND_PLUGIN_PARAMS=Zf,le.DEFAULT_SERIES_PLOT_PARAMS=Wf,le.DEFAULT_SERIES_TOOLTIP_PARAMS=Kf,le.DEFAULT_SERIES_TOOLTIP_PLUGIN_PARAMS=Jf,le.DEFAULT_STACKED_BARS_PARAMS=W1,le.DEFAULT_STACKED_VALUE_AXIS_PARAMS=G1,le.DEFAULT_TREE_MAP_PARAMS=qf,le.DEFAULT_VALUE_AXIS_PARAMS=ll,le.DEFAULT_X_Y_AUX_PARAMS=Yo,le.DEFAULT_X_Y_AXES_PARAMS=Wo,le.DEFAULT_X_ZOOM_PARAMS=Nh,le.HierarchyPlot=y7,le.Legend=T7,le.NetworkPlot=v9,le.ScatterPlot=gC,le.SeriesPlot=l7,le.Tooltip=M9,Object.defineProperty(le,Symbol.toStringTag,{value:"Module"})});
|