@nebula.js/sn-bar-chart
Version:
Bar chart supernova
7 lines (6 loc) • 702 kB
JavaScript
/*
* @nebula.js/sn-bar-chart v1.39.1
* Copyright (c) 2025 QlikTech International AB
* Released under the MIT license.
*/
import e from"picasso.js";import t from"picasso-plugin-q";import n from"picasso-plugin-hammer";import r from"hammerjs";import i,{useState as o,useEffect as a,useRef as s}from"react";import{ListItemText as l,ListItemIcon as u,ListItem as c,Divider as d,Popover as m,List as f,styled as p,Button as h}from"@material-ui/core";import{makeStyles as g,createStyles as y,createGenerateClassName as v,StylesProvider as b,ThemeProvider as x}from"@material-ui/styles";import q from"react-dom";import{styled as S,Button as M,ListItemButton as C,ListItemIcon as D,Divider as w,createTheme as L,SvgIcon as E,Popover as k,List as T,ListItemText as O,ThemeProvider as A}from"@mui/material";import{useTranslator as N,useEmbed as I,useTheme as P,useState as R,useDeviceType as F,useAppLayout as z,useEffect as j,useElement as H,useOptions as B,useLayout as V,useAction as _,useStaleLayout as $,useModel as U,useApp as W,usePlugins as G,useSelections as K,useConstraints as Y,useRect as X,usePromise as J,onTakeSnapshot as Z,useImperativeHandle as Q,useRenderState as ee}from"@nebula.js/stardust";function te(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ne=Object.prototype.hasOwnProperty,re=Object.prototype.toString,ie=Object.defineProperty,oe=Object.getOwnPropertyDescriptor,ae=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===re.call(e)},se=function(e){if(!e||"[object Object]"!==re.call(e))return!1;var t,n=ne.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&ne.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||ne.call(e,t)},le=function(e,t){ie&&"__proto__"===t.name?ie(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},ue=function(e,t){if("__proto__"===t){if(!ne.call(e,t))return;if(oe)return oe(e,t).value}return e[t]},ce=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=ue(s,n),s!==(i=ue(t,n))&&(c&&i&&(se(i)||(o=ae(i)))?(o?(o=!1,a=r&&ae(r)?r:[]):a=r&&se(r)?r:{},le(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&le(s,{name:n,newValue:i}));return s},de=te(ce);const me=[["FULL",{width:550,height:450}],["MEDIUM",{width:400,height:220}],["SMALL",{width:300,height:150}],["XSMALL",{width:150,height:75}],["SPARK",{width:0,height:0}]],fe={};me.forEach((([e,{width:t,height:n}])=>{fe[e]={width:t,height:n}}));const pe={getLayoutModes:()=>fe,getLayoutMode(e,t){let n;for(n=0;n<me.length;++n)if(e>=me[n][1].width&&t>=me[n][1].height)return me[n][0];return"SPARK"}};function he(e,t){return{layoutModes:pe.getLayoutModes(),center:void 0!==t.minCenterRatio?{minWidthRatio:t.minCenterRatio,minHeightRatio:t.minCenterRatio}:void 0,logicalSize:t.logicalSize?{align:.5,preserveAspectRatio:!0,...t.logicalSize}:void 0}}const ge=["$date","$timestamp","$time"],ye=["D","TS","T"],ve={hasTimeTag:e=>!!(e&&e.qTags&&e.qTags.some((e=>ge.some((t=>t===e))))),hasUnknownFormat:e=>!(!e||!e.qNumFormat||"U"!==e.qNumFormat.qType),hasTimeFormat:e=>!!(e&&e.qNumFormat&&ye.some((t=>t===e.qNumFormat.qType))),isTimeDimension:(e,t)=>!!(e&&t&&(ve.hasTimeTag(t)&&ve.hasUnknownFormat(t)||ve.hasTimeFormat(t))),isTime:(e,t)=>!!(t&&t.qHyperCube.qDimensionInfo&&t.qHyperCube.qDimensionInfo.length)&&(e&&ve.isTimeDimension(e,t.qHyperCube.qDimensionInfo.filter((e=>{var t;return 7005!==(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)}))[0])),canBeContinuousDimension(e){if(!e)return!1;const t=e.qTags||[];return!(!e.qContinuousAxes||!t.some((e=>"$numeric"===e)))},canBeContinuous(e){var t,n;const r=null==e||null===(t=e.qHyperCube)||void 0===t||null===(t=t.qDimensionInfo)||void 0===t?void 0:t.filter((e=>{var t;return 7005!==(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)}));return!((null!==(n=null==r?void 0:r.length)&&void 0!==n?n:0)<1)&&ve.canBeContinuousDimension(r[0])},maxNumberOfLines:12},be=/^[A-Z][A-z0-9_]*$/i,xe={getChar(e){let t=e,n=-1;return t>9?(n=65+t-10,n>90&&(n+=6)):t=`${t}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?this.getChar(t+1):String.fromCharCode(n)},base62(e){const t=this.getChar(e%62),n=Math.floor(e/62);return n>0?this.base62(n)+t:t},id(){return this.base62(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}},qe={setValue:(e,t,n)=>{if(!t)return!1;const r=t.split("."),i=r[r.length-1];let o,a=e;for(o=0;o<r.length-1;++o)void 0===a[r[o]]&&(a[r[o]]=Number.isNaN(+r[o+1])?{}:[]),a=a[r[o]];if(void 0!==n){const e=a[i];return a[i]=n,{updated:n,previous:e}}return delete a[i],!1},getValue:(e,t,n)=>{const r=t.split(".");let i,o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(void 0===o[r[i]])return n;o=o[r[i]]}return o},moveArrayElement:(e,t,n)=>{if(n>=e.length){let t=n-e.length;for(;1+t--;)e.push(void 0)}e.splice(n,0,e.splice(t,1)[0])},escapeField:e=>{let t;return t=!e||"]"===e||be.test(e)?e:`[${e.replace(/\]/g,"]]")}]`,t},deleteUndefinedProperties:e=>{Object.keys(e).forEach((t=>{void 0===e[t]&&delete e[t]}))},generateId:()=>xe.id(),shouldUseFormat:e=>!e.isCustomFormatted&&(e.qIsAutoFormat||"U"===e.qNumFormat.qType)},Se=e=>qe.getValue(e,"qHyperCube.qDimensionInfo",[]),Me=e=>qe.getValue(e,"qHyperCube.qMeasureInfo",[]),Ce=e=>qe.getValue(e,"barGrouping.grouping"),De={continuous:(e,t=!1)=>!!ve.canBeContinuous(e)&&(qe.getValue(e,"dimensionAxis.continuousAuto")?"function"==typeof t?t():t:!!e.preferContinuousAxis),dimensionless:e=>!Se(e).length,grouped(e){return!this.dimensionless(e)&&"grouped"===Ce(e)&&(Se(e).length>1||Me(e).length>1)&&!this.continuous(e)},groupedByDimension(e){return this.grouped(e)&&Se(e).length>1&&1===Me(e).length},groupedByMeasure(e){return this.grouped(e)&&1===Se(e).length&&Me(e).length>1},stacked(e){return(!this.dimensionless(e)&&"grouped"!==Ce(e)&&"butterfly"!==Ce(e)||this.continuous(e))&&(Se(e).length>1||Me(e).length>1)},stackedByDimension(e){return this.stacked(e)&&Se(e).length>1&&1===Me(e).length},stackedByMeasure(e){return this.stacked(e)&&1===Se(e).length&&Me(e).length>1},simple:e=>0===Se(e).length||1===Se(e).length&&1===Me(e).length,snapshot:e=>!!qe.getValue(e,"snapshotData")};function we(e,t){const n=e.component(t);return n&&n._DO_NOT_USE_getInfo&&n._DO_NOT_USE_getInfo().offset}const Le=e=>{throw e.isHandled=!0,e};const Ee={getDockValue:e=>"near"===e||"left"===e||"top"===e?0:1,getOppositeDock(e){switch(e){case"left":return"right";case"right":return"left";case"top":return"bottom";case"bottom":return"top";case"near":default:return"far";case"far":return"near"}},getHorizontalDock:e=>"near"===e||"left"===e?"left":"right",getVerticalDock:e=>"near"===e||"bottom"===e?"bottom":"top",getDock:(e,t,n)=>"vertical"===e||"y"===e?Ee.getVerticalDock(t):n?Ee.getOppositeDock(Ee.getHorizontalDock(t)):Ee.getHorizontalDock(t),getInvertedOrientation:e=>"vertical"===e?"horizontal":"vertical",getMinorScaleAxis:e=>"vertical"===e?"y":"x",getMajorScaleAxis:e=>"vertical"===e?"x":"y",getAlignment:(e,t)=>"vertical"===e?"near"===t||"bottom"===t?1:0:"near"===t||"left"===t?0:1,getMeasureScaleInvert:(e,t)=>"vertical"===e||t,getDimensionScaleInvert:(e,t)=>"horizontal"===e&&t,getSize:(e,{width:t,height:n})=>"vertical"===e?t:n};var ke=(e,t)=>{if("function"==typeof t.defaultValue)return t.defaultValue();if(void 0!==t.defaultValue)return t.defaultValue;if(Array.isArray(t.options))return t.options[0].value;switch(e){case"array":return[];case"string":return"";case"integer":case"number":return 0;case"boolean":return!1;default:return null}};const Te=166/26,Oe=12/11,Ae={stringWidthOverMWidth:e=>(12*Math.min(e,3)+Math.max(e-3,0)*Te)/11,getCharacterRatios(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),n=e.match(/[\u3040-\u309F]/g),r=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,n=n?n.length:0,r=r?r.length:0;const i=t+n+r;return{latin:e.length-i,cjk:i}},getTotalCharacterRatios(e,t,n="qText"){if(!e)return{latinRatio:1,cjkRatio:0};const r={latin:0,cjk:0};let i;void 0===t?e.forEach((e=>{i=Ae.getCharacterRatios(e[n]),r.latin+=i.latin,r.cjk+=i.cjk})):e.forEach((e=>{i=Ae.getCharacterRatios(e[t][n]),r.latin+=i.latin,r.cjk+=i.cjk}));const o=Math.max(1,r.latin+r.cjk);return r.latinRatio=r.latin/o,r.cjkRatio=r.cjk/o,r},getAdjustedMaxGlyphCount(e,t,n,r="qText"){const i=Ae.getTotalCharacterRatios(t,n,r),o=i.latinRatio*e,a=i.cjkRatio*e;return Math.ceil(Ae.stringWidthOverMWidth(o)+a*Oe)}},Ne="#la-vie-tooltip";function Ie(){if(!document.querySelector(Ne)){const e=document.createElement("div");e.id="la-vie-tooltip",e.setAttribute("data-qs-css",""),e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function Pe({key:e="tooltip",rtl:t}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){Ie()},beforeUpdate(){Ie()},destroyed(){!function(){const e=document.querySelector(Ne);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(Ne),content:({h:e,data:t,style:n})=>t[0].map((t=>e("tr",{},function(e,{h:t,style:n}){return e.map((e=>{const r={style:{...n.cell||{},...e.style||{}},class:e.class};return e.colspan&&(r.colspan=e.colspan),t("td",r,e.content)}))}(t,{h:e,style:n})))),direction:t?"rtl":"ltr"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:'"Source Sans Pro", "Arial", "sans-serif"',"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const Re=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Fe=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),ze=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),je={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),isLtrChar:e=>Re.test(e),isRtlChar:e=>Fe.test(e)||ze.test(e),detectTextDirection(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],je.isLtrChar(r))return"ltr";if(je.isRtlChar(r))return"rtl"}return"ltr"}},He={getColorSymbol:(e,t)=>e.h("div",{style:{display:"inline-block",width:"10px",height:"10px","background-color":t.color.fill,margin:"0 8px"}}),getNodeFillColor:e=>e.attrs&&void 0!==e.attrs.fill?e.attrs.fill:e.children&&e.children[0]&&e.children[0].attrs&&void 0!==e.children[0].attrs.fill?e.children[0].attrs.fill:void 0,getColor(e,t,n){const r=t.data,i=e.resources.formatter,o=e.resources.dataset,a={};if(n.coloring.label&&(a.label=`${n.coloring.label}`),"color"!==n.coloring.type&&r.fillTooltip){const e=i("fill"),t="measure"===n.coloring.fieldType;if(a.value=t&&e?e(r.fillTooltip.value):r.fillTooltip.label?r.fillTooltip.label:r.fillTooltip.value,!n.coloring.label){const e=o(r.fillTooltip.source.key).field(r.fillTooltip.source.field).title();a.label=`${e}`}}return a.fill=void 0===r._fillColor?He.getNodeFillColor(t):r._fillColor,a},getMeasure:(e,t)=>({label:`${e(t.source.key).field(t.source.field).title()}`,value:""===t.label||"NaN"===t.label?"-":t.label,field:t.source.field}),hideColorRow:(e,t)=>void 0===e.color.value||e.measures.some((e=>e.field===t.coloring.field)),getTitleRow(e,t){const n=je.detectTextDirection(e.title);return[{content:e.title,style:{"font-weight":"bold","text-align":t?"right":"left",direction:n,"white-space":"pre-wrap"},colspan:2},{}]},getDescriptionRow(e,t){const n=je.detectTextDirection(e.value);return[{content:e.value,style:{"text-align":t?"right":"left",direction:n,"white-space":"pre-wrap"},colspan:2},{}]},getNMoreRow(e,t,n){const r=t?t.get("Object.ChartTooltip.NMore",e):`+${e} more`;return[{content:r,style:{"font-weight":"bold","text-align":n?"right":"left",direction:je.detectTextDirection(r)},colspan:2},{}]},getSeparatorRow:()=>[{content:"",style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:2},{}],getColorRow(e,t,n){const r=je.detectTextDirection(t.color.label),i=n?[":",t.color.label]:[t.color.label,":"],o=je.detectTextDirection(t.color.value);return[{content:i,style:{"text-align":n?"right":"left",direction:r}},{content:n?[t.color.value,He.getColorSymbol(e,t)]:[He.getColorSymbol(e,t),t.color.value],style:{"text-align":n?"left":"right",direction:o,"vertical-align":"middle"}}]},getMeasureRow(e,t,n,r,i=!1){const o=je.detectTextDirection(e.label),a=r?[":",e.label]:[e.label,":"],s=je.detectTextDirection(e.value);let l;return l=i?r?[e.value,He.getColorSymbol(t,n)]:[He.getColorSymbol(t,n),e.value]:[e.value],[{content:a,style:{"text-align":r?"right":"left",direction:o}},{content:l,style:{"text-align":r?"left":"right",direction:s,"vertical-align":"middle"}}]}};function Be(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ve(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function _e(){}var $e=.7,Ue=1/$e,We="\\s*([+-]?\\d+)\\s*",Ge="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ke="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ye=/^#([0-9a-f]{3,8})$/,Xe=new RegExp(`^rgb\\(${We},${We},${We}\\)$`),Je=new RegExp(`^rgb\\(${Ke},${Ke},${Ke}\\)$`),Ze=new RegExp(`^rgba\\(${We},${We},${We},${Ge}\\)$`),Qe=new RegExp(`^rgba\\(${Ke},${Ke},${Ke},${Ge}\\)$`),et=new RegExp(`^hsl\\(${Ge},${Ke},${Ke}\\)$`),tt=new RegExp(`^hsla\\(${Ge},${Ke},${Ke},${Ge}\\)$`),nt={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};function rt(){return this.rgb().formatHex()}function it(){return this.rgb().formatRgb()}function ot(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ye.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?at(t):3===n?new ut(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?st(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?st(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Xe.exec(e))?new ut(t[1],t[2],t[3],1):(t=Je.exec(e))?new ut(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Ze.exec(e))?st(t[1],t[2],t[3],t[4]):(t=Qe.exec(e))?st(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=et.exec(e))?ht(t[1],t[2]/100,t[3]/100,1):(t=tt.exec(e))?ht(t[1],t[2]/100,t[3]/100,t[4]):nt.hasOwnProperty(e)?at(nt[e]):"transparent"===e?new ut(NaN,NaN,NaN,0):null}function at(e){return new ut(e>>16&255,e>>8&255,255&e,1)}function st(e,t,n,r){return r<=0&&(e=t=n=NaN),new ut(e,t,n,r)}function lt(e){return e instanceof _e||(e=ot(e)),e?new ut((e=e.rgb()).r,e.g,e.b,e.opacity):new ut}function ut(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function ct(){return`#${pt(this.r)}${pt(this.g)}${pt(this.b)}`}function dt(){const e=mt(this.opacity);return`${1===e?"rgb(":"rgba("}${ft(this.r)}, ${ft(this.g)}, ${ft(this.b)}${1===e?")":`, ${e})`}`}function mt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ft(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function pt(e){return((e=ft(e))<16?"0":"")+e.toString(16)}function ht(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new yt(e,t,n,r)}function gt(e){if(e instanceof yt)return new yt(e.h,e.s,e.l,e.opacity);if(e instanceof _e||(e=ot(e)),!e)return new yt;if(e instanceof yt)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new yt(a,s,l,e.opacity)}function yt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function vt(e){return(e=(e||0)%360)<0?e+360:e}function bt(e){return Math.max(0,Math.min(1,e||0))}function xt(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Be(_e,ot,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:rt,formatHex:rt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return gt(this).formatHsl()},formatRgb:it,toString:it}),Be(ut,(function(e,t,n,r){return 1===arguments.length?lt(e):new ut(e,t,n,null==r?1:r)}),Ve(_e,{brighter(e){return e=null==e?Ue:Math.pow(Ue,e),new ut(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?$e:Math.pow($e,e),new ut(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ut(ft(this.r),ft(this.g),ft(this.b),mt(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:ct,formatHex:ct,formatHex8:function(){return`#${pt(this.r)}${pt(this.g)}${pt(this.b)}${pt(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:dt,toString:dt})),Be(yt,(function(e,t,n,r){return 1===arguments.length?gt(e):new yt(e,t,n,null==r?1:r)}),Ve(_e,{brighter(e){return e=null==e?Ue:Math.pow(Ue,e),new yt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?$e:Math.pow($e,e),new yt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ut(xt(e>=240?e-240:e+120,i,r),xt(e,i,r),xt(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new yt(vt(this.h),bt(this.s),bt(this.l),mt(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=mt(this.opacity);return`${1===e?"hsl(":"hsla("}${vt(this.h)}, ${100*bt(this.s)}%, ${100*bt(this.l)}%${1===e?")":`, ${e})`}`}}));const qt=Math.PI/180,St=180/Math.PI,Mt=.96422,Ct=.82521,Dt=4/29,wt=6/29,Lt=3*wt*wt,Et=wt*wt*wt;function kt(e){if(e instanceof Tt)return new Tt(e.l,e.a,e.b,e.opacity);if(e instanceof Rt)return Ft(e);e instanceof ut||(e=lt(e));var t,n,r=It(e.r),i=It(e.g),o=It(e.b),a=Ot((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Ot((.4360747*r+.3850649*i+.1430804*o)/Mt),n=Ot((.0139322*r+.0971045*i+.7141733*o)/Ct)),new Tt(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Tt(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Ot(e){return e>Et?Math.pow(e,1/3):e/Lt+Dt}function At(e){return e>wt?e*e*e:Lt*(e-Dt)}function Nt(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function It(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Pt(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Rt)return new Rt(e.h,e.c,e.l,e.opacity);if(e instanceof Tt||(e=kt(e)),0===e.a&&0===e.b)return new Rt(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*St;return new Rt(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Rt(e,t,n,null==r?1:r)}function Rt(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Ft(e){if(isNaN(e.h))return new Tt(e.l,0,0,e.opacity);var t=e.h*qt;return new Tt(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Be(Tt,(function(e,t,n,r){return 1===arguments.length?kt(e):new Tt(e,t,n,null==r?1:r)}),Ve(_e,{brighter(e){return new Tt(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Tt(this.l-18*(null==e?1:e),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 new ut(Nt(3.1338561*(t=Mt*At(t))-1.6168667*(e=1*At(e))-.4906146*(n=Ct*At(n))),Nt(-.9787684*t+1.9161415*e+.033454*n),Nt(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Be(Rt,Pt,Ve(_e,{brighter(e){return new Rt(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Rt(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Ft(this).rgb()}}));var zt={isDark:function(e){return Pt(e).l<70}};function jt(e){const t=e.qDef;!0===t.autoSort&&t.qSortCriterias.forEach((e=>{e.qSortByNumeric=1,e.qSortByAscii=1}))}function Ht(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Bt(e){return 1===e.length&&(e=function(e){return function(t,n){return Ht(e(t),n)}}(e)),{left:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)<0?r=o+1:i=o}return r},right:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)>0?i=o:r=o+1}return r}}}var Vt=Bt(Ht).right,_t=Math.sqrt(50),$t=Math.sqrt(10),Ut=Math.sqrt(2);function Wt(e,t,n){var r=(t-e)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=_t?10:o>=$t?5:o>=Ut?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=_t?10:o>=$t?5:o>=Ut?2:1)}function Gt(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=_t?i*=10:o>=$t?i*=5:o>=Ut&&(i*=2),t<e?-i:i}function Kt(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var Yt="$";function Xt(){}function Jt(e,t){var n=new Xt;if(e instanceof Xt)e.each((function(e,t){n.set(t,e)}));else if(Array.isArray(e)){var r,i=-1,o=e.length;if(null==t)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(t(r=e[i],i,e),r)}else if(e)for(var a in e)n.set(a,e[a]);return n}function Zt(){}Xt.prototype=Jt.prototype={constructor:Xt,has:function(e){return Yt+e in this},get:function(e){return this[Yt+e]},set:function(e,t){return this[Yt+e]=t,this},remove:function(e){var t=Yt+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===Yt&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===Yt&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===Yt&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===Yt&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===Yt&&++e;return e},empty:function(){for(var e in this)if(e[0]===Yt)return!1;return!0},each:function(e){for(var t in this)t[0]===Yt&&e(this[t],t.slice(1),this)}};var Qt=Jt.prototype;Zt.prototype={constructor:Zt,has:Qt.has,add:function(e){return this[Yt+(e+="")]=e,this},remove:Qt.remove,clear:Qt.clear,values:Qt.keys,size:Qt.size,empty:Qt.empty,each:Qt.each};var en=Array.prototype,tn=en.map,nn=en.slice;function rn(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function on(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function an(){}var sn=.7,ln=1/sn,un="\\s*([+-]?\\d+)\\s*",cn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",dn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",mn=/^#([0-9a-f]{3,8})$/,fn=new RegExp("^rgb\\("+[un,un,un]+"\\)$"),pn=new RegExp("^rgb\\("+[dn,dn,dn]+"\\)$"),hn=new RegExp("^rgba\\("+[un,un,un,cn]+"\\)$"),gn=new RegExp("^rgba\\("+[dn,dn,dn,cn]+"\\)$"),yn=new RegExp("^hsl\\("+[cn,dn,dn]+"\\)$"),vn=new RegExp("^hsla\\("+[cn,dn,dn,cn]+"\\)$"),bn={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};function xn(){return this.rgb().formatHex()}function qn(){return this.rgb().formatRgb()}function Sn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=mn.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Mn(t):3===n?new wn(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Cn(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Cn(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=fn.exec(e))?new wn(t[1],t[2],t[3],1):(t=pn.exec(e))?new wn(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=hn.exec(e))?Cn(t[1],t[2],t[3],t[4]):(t=gn.exec(e))?Cn(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=yn.exec(e))?Tn(t[1],t[2]/100,t[3]/100,1):(t=vn.exec(e))?Tn(t[1],t[2]/100,t[3]/100,t[4]):bn.hasOwnProperty(e)?Mn(bn[e]):"transparent"===e?new wn(NaN,NaN,NaN,0):null}function Mn(e){return new wn(e>>16&255,e>>8&255,255&e,1)}function Cn(e,t,n,r){return r<=0&&(e=t=n=NaN),new wn(e,t,n,r)}function Dn(e,t,n,r){return 1===arguments.length?function(e){return e instanceof an||(e=Sn(e)),e?new wn((e=e.rgb()).r,e.g,e.b,e.opacity):new wn}(e):new wn(e,t,n,null==r?1:r)}function wn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Ln(){return"#"+kn(this.r)+kn(this.g)+kn(this.b)}function En(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function kn(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Tn(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new An(e,t,n,r)}function On(e){if(e instanceof An)return new An(e.h,e.s,e.l,e.opacity);if(e instanceof an||(e=Sn(e)),!e)return new An;if(e instanceof An)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new An(a,s,l,e.opacity)}function An(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Nn(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function In(e){return function(){return e}}function Pn(e){return 1==(e=+e)?Rn:function(t,n){return n-t?function(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)}}(t,n,e):In(isNaN(t)?n:t)}}function Rn(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):In(isNaN(e)?t:e)}rn(an,Sn,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:xn,formatHex:xn,formatHsl:function(){return On(this).formatHsl()},formatRgb:qn,toString:qn}),rn(wn,Dn,on(an,{brighter:function(e){return e=null==e?ln:Math.pow(ln,e),new wn(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?sn:Math.pow(sn,e),new wn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){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:Ln,formatHex:Ln,formatRgb:En,toString:En})),rn(An,(function(e,t,n,r){return 1===arguments.length?On(e):new An(e,t,n,null==r?1:r)}),on(an,{brighter:function(e){return e=null==e?ln:Math.pow(ln,e),new An(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?sn:Math.pow(sn,e),new An(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),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 wn(Nn(e>=240?e-240:e+120,i,r),Nn(e,i,r),Nn(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var Fn=function e(t){var n=Pn(t);function r(e,t){var r=n((e=Dn(e)).r,(t=Dn(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Rn(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function zn(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function jn(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=Wn(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}function Hn(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Bn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Vn(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=Wn(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var _n=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$n=new RegExp(_n.source,"g");function Un(e,t){var n,r,i,o=_n.lastIndex=$n.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=_n.exec(e))&&(r=$n.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:Bn(n,r)})),o=$n.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function Wn(e,t){var n,r=typeof t;return null==t||"boolean"===r?In(t):("number"===r?Bn:"string"===r?(n=Sn(t))?(t=n,Fn):Un:t instanceof Sn?Fn:t instanceof Date?Hn:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?zn:Array.isArray(t)?jn:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Vn:Bn)(e,t)}function Gn(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Kn(e){return+e}var Yn=[0,1];function Xn(e){return e}function Jn(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function Zn(e){var t,n=e[0],r=e[e.length-1];return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function Qn(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=Jn(i,r),o=n(a,o)):(r=Jn(r,i),o=n(o,a)),function(e){return o(r(e))}}function er(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Jn(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=Vt(e,t,1,r)-1;return o[n](i[n](t))}}function tr(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function nr(e,t){return function(){var e,t,n,r,i,o,a=Yn,s=Yn,l=Wn,u=Xn;function c(){return r=Math.min(a.length,s.length)>2?er:Qn,i=o=null,d}function d(t){return isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(u(t)))}return d.invert=function(n){return u(t((o||(o=r(s,a.map(e),Bn)))(n)))},d.domain=function(e){return arguments.length?(a=tn.call(e,Kn),u===Xn||(u=Zn(a)),c()):a.slice()},d.range=function(e){return arguments.length?(s=nn.call(e),c()):s.slice()},d.rangeRound=function(e){return s=nn.call(e),l=Gn,c()},d.clamp=function(e){return arguments.length?(u=e?Zn(a):Xn,d):u!==Xn},d.interpolate=function(e){return arguments.length?(l=e,c()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,c()}}()(e,t)}function rr(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 ir(e){return(e=rr(Math.abs(e)))?e[1]:NaN}var or,ar=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function sr(e){if(!(t=ar.exec(e)))throw new Error("invalid format: "+e);var t;return new lr({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]})}function lr(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function ur(e,t){var n=rr(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")}sr.prototype=lr.prototype,lr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var cr={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return ur(100*e,t)},r:ur,s:function(e,t){var n=rr(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(or=3*Math.max(-8,Math.min(8,Math.floor(i/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")+rr(e,Math.max(0,t+o-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function dr(e){return e}var mr,fr,pr,hr=Array.prototype.map,gr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function yr(e){var t=void 0===e.grouping||void 0===e.thousands?dr:function(e,t){return function(n,r){for(var i=n.length,o=[],a=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(t)}}(hr.call(e.grouping,Number),e.thousands+""),n=void 0===e.currency?"":e.currency[0]+"",r=void 0===e.currency?"":e.currency[1]+"",i=e.decimal+"",o=void 0===e.numerals?dr:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(hr.call(e.numerals,String)),a=void 0===e.percent?"%":e.percent+"",s=e.minus+"",l=void 0===e.nan?"NaN":e.nan+"";function u(e){var u=(e=sr(e)).fill,c=e.align,d=e.sign,m=e.symbol,f=e.zero,p=e.width,h=e.comma,g=e.precision,y=e.trim,v=e.type;"n"===v?(h=!0,v="g"):cr[v]||(void 0===g&&(g=12),y=!0,v="g"),(f||"0"===u&&"="===c)&&(f=!0,u="0",c="=");var b="$"===m?n:"#"===m&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===m?r:/[%p]/.test(v)?a:"",q=cr[v],S=/[defgprs%]/.test(v);function M(e){var n,r,a,m=b,M=x;if("c"===v)M=q(e)+M,e="";else{var C=(e=+e)<0||1/e<0;if(e=isNaN(e)?l:q(Math.abs(e),g),y&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),C&&0==+e&&"+"!==d&&(C=!1),m=(C?"("===d?d:s:"-"===d||"("===d?"":d)+m,M=("s"===v?gr[8+or/3]:"")+M+(C&&"("===d?")":""),S)for(n=-1,r=e.length;++n<r;)if(48>(a=e.charCodeAt(n))||a>57){M=(46===a?i+e.slice(n+1):e.slice(n))+M,e=e.slice(0,n);break}}h&&!f&&(e=t(e,1/0));var D=m.length+e.length+M.length,w=D<p?new Array(p-D+1).join(u):"";switch(h&&f&&(e=t(w+e,w.length?p-M.length:1/0),w=""),c){case"<":e=m+e+M+w;break;case"=":e=m+w+e+M;break;case"^":e=w.slice(0,D=w.length>>1)+m+e+M+w.slice(D);break;default:e=w+m+e+M}return o(e)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),M.toString=function(){return e+""},M}return{format:u,formatPrefix:function(e,t){var n=u(((e=sr(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(ir(t)/3))),i=Math.pow(10,-r),o=gr[8+r/3];return function(e){return n(i*e)+o}}}}function vr(e,t,n,r){var i,o=Gt(e,t,n);switch((r=sr(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ir(t)/3)))-ir(Math.abs(e)))}(o,a))||(r.precision=i),pr(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ir(t)-ir(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-ir(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return fr(r)}function br(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){var r,i,o,a,s=-1;if(n=+n,(e=+e)==(t=+t)&&n>0)return[e];if((r=t<e)&&(i=e,e=t,t=i),0===(a=Wt(e,t,n))||!isFinite(a))return[];if(a>0)for(e=Math.ceil(e/a),t=Math.floor(t/a),o=new Array(i=Math.ceil(t-e+1));++s<i;)o[s]=(e+s)*a;else for(e=Math.floor(e*a),t=Math.ceil(t*a),o=new Array(i=Math.ceil(e-t+1));++s<i;)o[s]=(e-s)/a;return r&&o.reverse(),o}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return vr(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i=t(),o=0,a=i.length-1,s=i[o],l=i[a];return l<s&&(r=s,s=l,l=r,r=o,o=a,a=r),(r=Wt(s,l,n))>0?r=Wt(s=Math.floor(s/r)*r,l=Math.ceil(l/r)*r,n):r<0&&(r=Wt(s=Math.ceil(s*r)/r,l=Math.floor(l*r)/r,n)),r>0?(i[o]=Math.floor(s/r)*r,i[a]=Math.ceil(l/r)*r,t(i)):r<0&&(i[o]=Math.ceil(s*r)/r,i[a]=Math.floor(l*r)/r,t(i)),e},e}function xr(){var e=nr(Xn,Xn);return e.copy=function(){return tr(e,xr())},Kt.apply(e,arguments),br(e)}mr=yr({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),fr=mr.format,pr=mr.formatPrefix;var qr=new Date,Sr=new Date;function Mr(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<r);return s},i.filter=function(n){return Mr((function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return qr.setTime(+t),Sr.setTime(+r),e(qr),e(Sr),Math.floor(n(qr,Sr))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var Cr=Mr((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));Cr.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?Mr((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):Cr:null},Cr.range;var Dr=6e4,wr=36e5,Lr=864e5,Er=6048e5,kr=Mr((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+1e3*t)}),(function(e,t){return(t-e)/1e3}),(function(e){return e.getUTCSeconds()}));kr.range;var Tr=Mr((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Dr)/Lr}),(function(e){return e.getDate()-1}));function Or(e){return Mr((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Dr)/Er}))}Tr.range;var Ar=Or(0),Nr=Or(1),Ir=Or(2),Pr=Or(3),Rr=Or(4),Fr=Or(5),zr=Or(6);Ar.range,Nr.range,Ir.range,Pr.range,Rr.range,Fr.range,zr.range;var jr=Mr((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));jr.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Mr((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null},jr.range;var Hr=Mr((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+t*Dr)}),(function(e,t){return(t-e)/Dr}),(function(e){return e.getUTCMinutes()}));Hr.range;var Br=Mr((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+t*wr)}),(function(e,t){return(t-e)/wr}),(function(e){return e.getUTCHours()}));Br.range;var Vr=Mr((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/Lr}),(function(e){return e.getUTCDate()-1}));function _r(e){return Mr((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/Er}))}Vr.range;var $r=_r(0),Ur=_r(1),Wr=_r(2),Gr=_r(3),Kr=_r(4),Yr=_r(5),Xr=_r(6);$r.range,Ur.range,Wr.range,Gr.range,Kr.range,Yr.range,Xr.range;var Jr=Mr((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()}));Jr.range;var Zr=Mr((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));function Qr(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 ei(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 ti(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}Zr.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Mr((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null},Zr.range;var ni,ri,ii={"-":"",_:" ",0:"0"},oi=/^\s*\d+/,ai=/^%/,si=/[\\^$*+?|[\]().{}]/g;function li(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 ui(e){return e.replace(si,"\\$&")}function ci(e){return new RegExp("^(?:"+e.map(ui).join("|")+")","i")}function di(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function mi(e,t,n){var r=oi.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function fi(e,t,n){var r=oi.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function pi(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function hi(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function gi(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function yi(e,t,n){var r=oi.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function vi(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function bi(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 xi(e,t,n){var r=oi.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function qi(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Si(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Mi(e,t,n){var r=oi.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Ci(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Di(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function wi(e,t,n){var r=oi.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Li(e,t,n){var r=oi.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Ei(e,t,n){var r=oi.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function ki(e,t,n){var r=ai.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Ti(e,t,n){var r=oi.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Oi(e,t,n){var r=oi.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Ai(e,t){return li(e.getDate(),t,2)}function Ni(e,t){return li(e.getHours(),t,2)}function Ii(e,t){return li(e.getHours()%12||12,t,2)}function Pi(e,t){return li(1+Tr.count(jr(e),e),t,3)}function Ri(e,t){return li(e.getMilliseconds(),t,3)}function Fi(e,t){return Ri(e,t)+"000"}function zi(e,t){return li(e.getMonth()+1,t,2)}function ji(e,t){return li(e.getMinutes(),t,2)}function Hi(e,t){return li(e.getSeconds(),t,2)}function Bi(e){var t=e.getDay();return 0===t?7:t}function Vi(e,t){return li(Ar.count(jr(e)-1,e),t,2)}function _i(e){var t=e.getDay();return t>=4||0===t?Rr(e):Rr.ceil(e)}function $i(e,t){return e=_i(e),li(Rr.count(jr(e),e)+(4===jr(e).getDay()),t,2)}function Ui(e){return e.getDay()}function Wi(e,t){return li(Nr.count(jr(e)-1,e),t,2)}function Gi(e,t){return li(e.getFullYear()%100,t,2)}function Ki(e,t){return li((e=_i(e)).getFullYear()%100,t,2)}function Yi(e,t){return li(e.getFullYear()%1e4,t,4)}function Xi(e,t){var n=e.getDay();return li((e=n>=4||0===n?Rr(e):Rr.ceil(e)).getFullYear()%1e4,t,4)}function Ji(e){var t=e.getTi