@nebula.js/sn-bar-chart 1.34.2 → 1.34.4

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/core/esm/index.js CHANGED
@@ -1,19 +1,9 @@
1
1
  /*
2
- * @nebula.js/sn-bar-chart v1.34.2
2
+ * @nebula.js/sn-bar-chart v1.34.4
3
3
  * Copyright (c) 2023 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
6
6
 
7
- import e from"picasso.js";import t from"picasso-plugin-q";import n from"picasso-plugin-hammer";import r from"hammerjs";import i from"react";import{styled as o,ListItem as a,Button as s,Popover as l,List as u,ListItemIcon as c,ListItemText as d}from"@material-ui/core";import f from"react-dom";import{createGenerateClassName as m,StylesProvider as p,ThemeProvider as h}from"@material-ui/styles";import{useTranslator as g,useEmbed as y,useTheme as v,useState as b,useDeviceType as x,useAppLayout as q,useEffect as M,useElement as S,useOptions as w,useLayout as D,useAction as C,useStaleLayout as N,useModel as k,useApp as A,usePlugins as L,useSelections as E,useConstraints as T,useRect as O,usePromise as I,onTakeSnapshot as P,useImperativeHandle as R,useRenderState as F}from"@nebula.js/stardust";function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},j.apply(this,arguments)}function H(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var z=Object.prototype.hasOwnProperty,B=Object.prototype.toString,_=Object.defineProperty,V=Object.getOwnPropertyDescriptor,$=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===B.call(e)},U=function(e){if(!e||"[object Object]"!==B.call(e))return!1;var t,n=z.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&z.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||z.call(e,t)},W=function(e,t){_&&"__proto__"===t.name?_(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},K=function(e,t){if("__proto__"===t){if(!z.call(e,t))return;if(V)return V(e,t).value}return e[t]},G=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=K(s,n),s!==(i=K(t,n))&&(c&&i&&(U(i)||(o=$(i)))?(o?(o=!1,a=r&&$(r)?r:[]):a=r&&U(r)?r:{},W(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&W(s,{name:n,newValue:i}));return s},Y=H(G);const X="center",J="bottom";var Z={NoDataExist:{label:"NoDataExist",alignment:X,default:!0},OnlyNanData:{label:"OnlyNanData",alignment:X,default:!0},OnlyNegativeOrZeroValues:{label:"OnlyNegativeOrZeroValues",alignment:X,default:!1},LimitedData:{label:"LimitedData",alignment:J,default:!1},OnlyNanColor:{label:"OnlyNanColor",alignment:J,default:!1},NegativeOrZeroValues:{label:"NegativeOrZeroValues",alignment:J,default:!1},DataRangeIncludingZero:{label:"DataRangeIncludingZero",alignment:J,default:!1}};const Q=[["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}]],ee={};Q.forEach((([e,{width:t,height:n}])=>{ee[e]={width:t,height:n}}));const te={getLayoutModes:()=>ee,getLayoutMode(e,t){let n;for(n=0;n<Q.length;++n)if(e>=Q[n][1].width&&t>=Q[n][1].height)return Q[n][0];return"SPARK"}};function ne(e,t){return{layoutModes:te.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 re=["$date","$timestamp","$time"],ie=["D","TS","T"],oe={hasTimeTag:e=>!!(e&&e.qTags&&e.qTags.some((e=>re.some((t=>t===e))))),hasUnknownFormat:e=>!(!e||!e.qNumFormat||"U"!==e.qNumFormat.qType),hasTimeFormat:e=>!!(e&&e.qNumFormat&&ie.some((t=>t===e.qNumFormat.qType))),isTimeDimension:(e,t)=>!!(e&&t&&(oe.hasTimeTag(t)&&oe.hasUnknownFormat(t)||oe.hasTimeFormat(t))),isTime:(e,t)=>!!(t&&t.qHyperCube.qDimensionInfo&&t.qHyperCube.qDimensionInfo.length)&&(e&&oe.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,r;const i=null==e||null===(t=e.qHyperCube)||void 0===t||null===(n=t.qDimensionInfo)||void 0===n?void 0:n.filter((e=>{var t;return 7005!==(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)}));return!((null!==(r=null==i?void 0:i.length)&&void 0!==r?r:0)<1)&&oe.canBeContinuousDimension(i[0])},maxNumberOfLines:12},ae=/^[A-Z][A-z0-9_]*$/i,se={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||ae.test(e)?e:`[${e.replace(/\]/g,"]]")}]`,t},deleteUndefinedProperties:e=>{Object.keys(e).forEach((t=>{void 0===e[t]&&delete e[t]}))},shouldUseFormat:e=>!e.isCustomFormatted&&(e.qIsAutoFormat||"U"===e.qNumFormat.qType)},le=e=>se.getValue(e,"qHyperCube.qDimensionInfo",[]),ue=e=>se.getValue(e,"qHyperCube.qMeasureInfo",[]),ce=e=>se.getValue(e,"barGrouping.grouping"),de={continuous:(e,t=!1)=>!!oe.canBeContinuous(e)&&(se.getValue(e,"dimensionAxis.continuousAuto")?"function"==typeof t?t():t:!!e.preferContinuousAxis),dimensionless:e=>!le(e).length,grouped(e){return!this.dimensionless(e)&&"grouped"===ce(e)&&(le(e).length>1||ue(e).length>1)&&!this.continuous(e)},groupedByDimension(e){return this.grouped(e)&&le(e).length>1&&1===ue(e).length},groupedByMeasure(e){return this.grouped(e)&&1===le(e).length&&ue(e).length>1},stacked(e){return(!this.dimensionless(e)&&"grouped"!==ce(e)||this.continuous(e))&&(le(e).length>1||ue(e).length>1)},stackedByDimension(e){return this.stacked(e)&&le(e).length>1&&1===ue(e).length},stackedByMeasure(e){return this.stacked(e)&&1===le(e).length&&ue(e).length>1},simple:e=>0===le(e).length||1===le(e).length&&1===ue(e).length,snapshot:e=>!!se.getValue(e,"snapshotData")};function fe(e,t){const n=e.component(t);return n&&n._DO_NOT_USE_getInfo&&n._DO_NOT_USE_getInfo().offset}const me=e=>{throw e.isHandled=!0,e};const pe={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?pe.getVerticalDock(t):n?pe.getOppositeDock(pe.getHorizontalDock(t)):pe.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 he=(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 ge={stringWidthOverMWidth:e=>(12*Math.min(e,3)+6.384615384615385*Math.max(e-3,0))/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=ge.getCharacterRatios(e[n]),r.latin+=i.latin,r.cjk+=i.cjk})):e.forEach((e=>{i=ge.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=ge.getTotalCharacterRatios(t,n,r),o=i.latinRatio*e,a=i.cjkRatio*e;return Math.ceil(ge.stringWidthOverMWidth(o)+1.0909090909090908*a)}},ye="#la-vie-tooltip";function ve(){if(!document.querySelector(ye)){const e=document.createElement("div");e.id="la-vie-tooltip",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 be({key:e="tooltip",rtl:t}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){ve()},beforeUpdate(){ve()},destroyed(){!function(){const e=document.querySelector(ye);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(ye),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 xe=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),qe=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),Me=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),Se={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),isLtrChar:e=>xe.test(e),isRtlChar:e=>qe.test(e)||Me.test(e),detectTextDirection(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],Se.isLtrChar(r))return"ltr";if(Se.isRtlChar(r))return"rtl"}return"ltr"}},we={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?we.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=Se.detectTextDirection(e.title);return[{content:e.title,style:{"font-weight":"bold","text-align":t?"right":"left",direction:n},colspan:2},{}]},getDescriptionRow(e,t){const n=Se.detectTextDirection(e.value);return[{content:e.value,style:{"text-align":t?"right":"left",direction:n},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:Se.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=Se.detectTextDirection(t.color.label),i=n?[":",t.color.label]:[t.color.label,":"],o=Se.detectTextDirection(t.color.value);return[{content:i,style:{"text-align":n?"right":"left",direction:r}},{content:n?[t.color.value,we.getColorSymbol(e,t)]:[we.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=Se.detectTextDirection(e.label),a=r?[":",e.label]:[e.label,":"],s=Se.detectTextDirection(e.value);let l;return l=i?r?[e.value,we.getColorSymbol(t,n)]:[we.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 De(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ce(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ne(){}var ke=.7,Ae=1/ke,Le="\\s*([+-]?\\d+)\\s*",Ee="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Te="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Oe=/^#([0-9a-f]{3,8})$/,Ie=new RegExp(`^rgb\\(${Le},${Le},${Le}\\)$`),Pe=new RegExp(`^rgb\\(${Te},${Te},${Te}\\)$`),Re=new RegExp(`^rgba\\(${Le},${Le},${Le},${Ee}\\)$`),Fe=new RegExp(`^rgba\\(${Te},${Te},${Te},${Ee}\\)$`),je=new RegExp(`^hsl\\(${Ee},${Te},${Te}\\)$`),He=new RegExp(`^hsla\\(${Ee},${Te},${Te},${Ee}\\)$`),ze={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 Be(){return this.rgb().formatHex()}function _e(){return this.rgb().formatRgb()}function Ve(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Oe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?$e(t):3===n?new Ke(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Ue(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Ue(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=Ie.exec(e))?new Ke(t[1],t[2],t[3],1):(t=Pe.exec(e))?new Ke(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Re.exec(e))?Ue(t[1],t[2],t[3],t[4]):(t=Fe.exec(e))?Ue(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=je.exec(e))?Qe(t[1],t[2]/100,t[3]/100,1):(t=He.exec(e))?Qe(t[1],t[2]/100,t[3]/100,t[4]):ze.hasOwnProperty(e)?$e(ze[e]):"transparent"===e?new Ke(NaN,NaN,NaN,0):null}function $e(e){return new Ke(e>>16&255,e>>8&255,255&e,1)}function Ue(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ke(e,t,n,r)}function We(e){return e instanceof Ne||(e=Ve(e)),e?new Ke((e=e.rgb()).r,e.g,e.b,e.opacity):new Ke}function Ke(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Ge(){return`#${Ze(this.r)}${Ze(this.g)}${Ze(this.b)}`}function Ye(){const e=Xe(this.opacity);return`${1===e?"rgb(":"rgba("}${Je(this.r)}, ${Je(this.g)}, ${Je(this.b)}${1===e?")":`, ${e})`}`}function Xe(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Je(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ze(e){return((e=Je(e))<16?"0":"")+e.toString(16)}function Qe(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new tt(e,t,n,r)}function et(e){if(e instanceof tt)return new tt(e.h,e.s,e.l,e.opacity);if(e instanceof Ne||(e=Ve(e)),!e)return new tt;if(e instanceof tt)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 tt(a,s,l,e.opacity)}function tt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function nt(e){return(e=(e||0)%360)<0?e+360:e}function rt(e){return Math.max(0,Math.min(1,e||0))}function it(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}De(Ne,Ve,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Be,formatHex:Be,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return et(this).formatHsl()},formatRgb:_e,toString:_e}),De(Ke,(function(e,t,n,r){return 1===arguments.length?We(e):new Ke(e,t,n,null==r?1:r)}),Ce(Ne,{brighter(e){return e=null==e?Ae:Math.pow(Ae,e),new Ke(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?ke:Math.pow(ke,e),new Ke(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ke(Je(this.r),Je(this.g),Je(this.b),Xe(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:Ge,formatHex:Ge,formatHex8:function(){return`#${Ze(this.r)}${Ze(this.g)}${Ze(this.b)}${Ze(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ye,toString:Ye})),De(tt,(function(e,t,n,r){return 1===arguments.length?et(e):new tt(e,t,n,null==r?1:r)}),Ce(Ne,{brighter(e){return e=null==e?Ae:Math.pow(Ae,e),new tt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?ke:Math.pow(ke,e),new tt(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 Ke(it(e>=240?e-240:e+120,i,r),it(e,i,r),it(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new tt(nt(this.h),rt(this.s),rt(this.l),Xe(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=Xe(this.opacity);return`${1===e?"hsl(":"hsla("}${nt(this.h)}, ${100*rt(this.s)}%, ${100*rt(this.l)}%${1===e?")":`, ${e})`}`}}));const ot=Math.PI/180,at=180/Math.PI,st=.96422,lt=1,ut=.82521,ct=4/29,dt=6/29,ft=3*dt*dt,mt=dt*dt*dt;function pt(e){if(e instanceof ht)return new ht(e.l,e.a,e.b,e.opacity);if(e instanceof qt)return Mt(e);e instanceof Ke||(e=We(e));var t,n,r=bt(e.r),i=bt(e.g),o=bt(e.b),a=gt((.2225045*r+.7168786*i+.0606169*o)/lt);return r===i&&i===o?t=n=a:(t=gt((.4360747*r+.3850649*i+.1430804*o)/st),n=gt((.0139322*r+.0971045*i+.7141733*o)/ut)),new ht(116*a-16,500*(t-a),200*(a-n),e.opacity)}function ht(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function gt(e){return e>mt?Math.pow(e,1/3):e/ft+ct}function yt(e){return e>dt?e*e*e:ft*(e-ct)}function vt(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function bt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function xt(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof qt)return new qt(e.h,e.c,e.l,e.opacity);if(e instanceof ht||(e=pt(e)),0===e.a&&0===e.b)return new qt(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*at;return new qt(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new qt(e,t,n,null==r?1:r)}function qt(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Mt(e){if(isNaN(e.h))return new ht(e.l,0,0,e.opacity);var t=e.h*ot;return new ht(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}De(ht,(function(e,t,n,r){return 1===arguments.length?pt(e):new ht(e,t,n,null==r?1:r)}),Ce(Ne,{brighter(e){return new ht(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new ht(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 Ke(vt(3.1338561*(t=st*yt(t))-1.6168667*(e=lt*yt(e))-.4906146*(n=ut*yt(n))),vt(-.9787684*t+1.9161415*e+.033454*n),vt(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),De(qt,xt,Ce(Ne,{brighter(e){return new qt(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new qt(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Mt(this).rgb()}}));var St={isDark:function(e){return xt(e).l<70}};function wt(e){const t=e.qDef;!0===t.autoSort&&t.qSortCriterias.forEach((e=>{e.qSortByNumeric=1,e.qSortByAscii=1}))}function Dt(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ct(e){return 1===e.length&&(e=function(e){return function(t,n){return Dt(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 Nt=Ct(Dt).right,kt=Math.sqrt(50),At=Math.sqrt(10),Lt=Math.sqrt(2);function Et(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>=kt?10:o>=At?5:o>=Lt?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=kt?10:o>=At?5:o>=Lt?2:1)}function Tt(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>=kt?i*=10:o>=At?i*=5:o>=Lt&&(i*=2),t<e?-i:i}function Ot(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var It="$";function Pt(){}function Rt(e,t){var n=new Pt;if(e instanceof Pt)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 Ft(){}Pt.prototype=Rt.prototype={constructor:Pt,has:function(e){return It+e in this},get:function(e){return this[It+e]},set:function(e,t){return this[It+e]=t,this},remove:function(e){var t=It+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===It&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===It&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===It&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===It&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===It&&++e;return e},empty:function(){for(var e in this)if(e[0]===It)return!1;return!0},each:function(e){for(var t in this)t[0]===It&&e(this[t],t.slice(1),this)}};var jt=Rt.prototype;Ft.prototype={constructor:Ft,has:jt.has,add:function(e){return this[It+(e+="")]=e,this},remove:jt.remove,clear:jt.clear,values:jt.keys,size:jt.size,empty:jt.empty,each:jt.each};var Ht=Array.prototype,zt=Ht.map,Bt=Ht.slice;function _t(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Vt(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function $t(){}var Ut=.7,Wt=1/Ut,Kt="\\s*([+-]?\\d+)\\s*",Gt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Yt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xt=/^#([0-9a-f]{3})$/,Jt=/^#([0-9a-f]{6})$/,Zt=new RegExp("^rgb\\("+[Kt,Kt,Kt]+"\\)$"),Qt=new RegExp("^rgb\\("+[Yt,Yt,Yt]+"\\)$"),en=new RegExp("^rgba\\("+[Kt,Kt,Kt,Gt]+"\\)$"),tn=new RegExp("^rgba\\("+[Yt,Yt,Yt,Gt]+"\\)$"),nn=new RegExp("^hsl\\("+[Gt,Yt,Yt]+"\\)$"),rn=new RegExp("^hsla\\("+[Gt,Yt,Yt,Gt]+"\\)$"),on={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 an(e){var t;return e=(e+"").trim().toLowerCase(),(t=Xt.exec(e))?new dn((t=parseInt(t[1],16))>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):(t=Jt.exec(e))?sn(parseInt(t[1],16)):(t=Zt.exec(e))?new dn(t[1],t[2],t[3],1):(t=Qt.exec(e))?new dn(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=en.exec(e))?ln(t[1],t[2],t[3],t[4]):(t=tn.exec(e))?ln(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=nn.exec(e))?mn(t[1],t[2]/100,t[3]/100,1):(t=rn.exec(e))?mn(t[1],t[2]/100,t[3]/100,t[4]):on.hasOwnProperty(e)?sn(on[e]):"transparent"===e?new dn(NaN,NaN,NaN,0):null}function sn(e){return new dn(e>>16&255,e>>8&255,255&e,1)}function ln(e,t,n,r){return r<=0&&(e=t=n=NaN),new dn(e,t,n,r)}function un(e){return e instanceof $t||(e=an(e)),e?new dn((e=e.rgb()).r,e.g,e.b,e.opacity):new dn}function cn(e,t,n,r){return 1===arguments.length?un(e):new dn(e,t,n,null==r?1:r)}function dn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function fn(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function mn(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new pn(e,t,n,r)}function pn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function hn(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}_t($t,an,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),_t(dn,cn,Vt($t,{brighter:function(e){return e=null==e?Wt:Math.pow(Wt,e),new dn(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?Ut:Math.pow(Ut,e),new dn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+fn(this.r)+fn(this.g)+fn(this.b)},toString:function(){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+")")}})),_t(pn,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof pn)return new pn(e.h,e.s,e.l,e.opacity);if(e instanceof $t||(e=an(e)),!e)return new pn;if(e instanceof pn)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 pn(a,s,l,e.opacity)}(e):new pn(e,t,n,null==r?1:r)}),Vt($t,{brighter:function(e){return e=null==e?Wt:Math.pow(Wt,e),new pn(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?Ut:Math.pow(Ut,e),new pn(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 dn(hn(e>=240?e-240:e+120,i,r),hn(e,i,r),hn(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}}));var gn=Math.PI/180,yn=180/Math.PI,vn=.96422,bn=1,xn=.82521,qn=4/29,Mn=6/29,Sn=3*Mn*Mn,wn=Mn*Mn*Mn;function Dn(e){if(e instanceof Cn)return new Cn(e.l,e.a,e.b,e.opacity);if(e instanceof En){if(isNaN(e.h))return new Cn(e.l,0,0,e.opacity);var t=e.h*gn;return new Cn(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}e instanceof dn||(e=un(e));var n,r,i=Ln(e.r),o=Ln(e.g),a=Ln(e.b),s=Nn((.2225045*i+.7168786*o+.0606169*a)/bn);return i===o&&o===a?n=r=s:(n=Nn((.4360747*i+.3850649*o+.1430804*a)/vn),r=Nn((.0139322*i+.0971045*o+.7141733*a)/xn)),new Cn(116*s-16,500*(n-s),200*(s-r),e.opacity)}function Cn(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Nn(e){return e>wn?Math.pow(e,1/3):e/Sn+qn}function kn(e){return e>Mn?e*e*e:Sn*(e-qn)}function An(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Ln(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function En(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}_t(Cn,(function(e,t,n,r){return 1===arguments.length?Dn(e):new Cn(e,t,n,null==r?1:r)}),Vt($t,{brighter:function(e){return new Cn(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new Cn(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){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 dn(An(3.1338561*(t=vn*kn(t))-1.6168667*(e=bn*kn(e))-.4906146*(n=xn*kn(n))),An(-.9787684*t+1.9161415*e+.033454*n),An(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),_t(En,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof En)return new En(e.h,e.c,e.l,e.opacity);if(e instanceof Cn||(e=Dn(e)),0===e.a&&0===e.b)return new En(NaN,0,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*yn;return new En(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new En(e,t,n,null==r?1:r)}),Vt($t,{brighter:function(e){return new En(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new En(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return Dn(this).rgb()}}));var Tn=-.14861,On=1.78277,In=-.29227,Pn=-.90649,Rn=1.97294,Fn=Rn*Pn,jn=Rn*On,Hn=On*In-Pn*Tn;function zn(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Bn)return new Bn(e.h,e.s,e.l,e.opacity);e instanceof dn||(e=un(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(Hn*r+Fn*t-jn*n)/(Hn+Fn-jn),o=r-i,a=(Rn*(n-i)-In*o)/Pn,s=Math.sqrt(a*a+o*o)/(Rn*i*(1-i)),l=s?Math.atan2(a,o)*yn-120:NaN;return new Bn(l<0?l+360:l,s,i,e.opacity)}(e):new Bn(e,t,n,null==r?1:r)}function Bn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function _n(e){return function(){return e}}function Vn(e,t){return function(n){return e+n*t}}function $n(e){return 1==(e=+e)?Un: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):_n(isNaN(t)?n:t)}}function Un(e,t){var n=t-e;return n?Vn(e,n):_n(isNaN(e)?t:e)}_t(Bn,zn,Vt($t,{brighter:function(e){return e=null==e?Wt:Math.pow(Wt,e),new Bn(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?Ut:Math.pow(Ut,e),new Bn(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=isNaN(this.h)?0:(this.h+120)*gn,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new dn(255*(t+n*(Tn*r+On*i)),255*(t+n*(In*r+Pn*i)),255*(t+n*(Rn*r)),this.opacity)}}));var Wn=function e(t){var n=$n(t);function r(e,t){var r=n((e=cn(e)).r,(t=cn(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Un(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 Kn(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]=er(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 Gn(e,t){var n=new Date;return t-=e=+e,function(r){return n.setTime(e+t*r),n}}function Yn(e,t){return t-=e=+e,function(n){return e+t*n}}function Xn(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]=er(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var Jn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Zn=new RegExp(Jn.source,"g");function Qn(e,t){var n,r,i,o=Jn.lastIndex=Zn.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=Jn.exec(e))&&(r=Zn.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:Yn(n,r)})),o=Zn.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 er(e,t){var n,r=typeof t;return null==t||"boolean"===r?_n(t):("number"===r?Yn:"string"===r?(n=an(t))?(t=n,Wn):Qn:t instanceof an?Wn:t instanceof Date?Gn:Array.isArray(t)?Kn:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Xn:Yn)(e,t)}function tr(e,t){return t-=e=+e,function(n){return Math.round(e+t*n)}}function nr(e){return function t(n){function r(t,r){var i=e((t=zn(t)).h,(r=zn(r)).h),o=Un(t.s,r.s),a=Un(t.l,r.l),s=Un(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=o(e),t.l=a(Math.pow(e,n)),t.opacity=s(e),t+""}}return n=+n,r.gamma=t,r}(1)}function rr(e){return+e}nr((function(e,t){var n=t-e;return n?Vn(e,n>180||n<-180?n-360*Math.round(n/360):n):_n(isNaN(e)?t:e)})),nr(Un);var ir=[0,1];function or(e){return e}function ar(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function sr(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 lr(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=ar(i,r),o=n(a,o)):(r=ar(r,i),o=n(o,a)),function(e){return o(r(e))}}function ur(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]=ar(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=Nt(e,t,1,r)-1;return o[n](i[n](t))}}function cr(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function dr(e,t){return function(){var e,t,n,r,i,o,a=ir,s=ir,l=er,u=or;function c(){return r=Math.min(a.length,s.length)>2?ur:lr,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),Yn)))(n)))},d.domain=function(e){return arguments.length?(a=zt.call(e,rr),u===or||(u=sr(a)),c()):a.slice()},d.range=function(e){return arguments.length?(s=Bt.call(e),c()):s.slice()},d.rangeRound=function(e){return s=Bt.call(e),l=tr,c()},d.clamp=function(e){return arguments.length?(u=e?sr(a):or,d):u!==or},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 fr(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 mr(e){return(e=fr(Math.abs(e)))?e[1]:NaN}var pr,hr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function gr(e){return new yr(e)}function yr(e){if(!(t=hr.exec(e)))throw new Error("invalid format: "+e);var t;this.fill=t[1]||" ",this.align=t[2]||">",this.sign=t[3]||"-",this.symbol=t[4]||"",this.zero=!!t[5],this.width=t[6]&&+t[6],this.comma=!!t[7],this.precision=t[8]&&+t[8].slice(1),this.trim=!!t[9],this.type=t[10]||""}function vr(e,t){var n=fr(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")}gr.prototype=yr.prototype,yr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var br={"%":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.round(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 vr(100*e,t)},r:vr,s:function(e,t){var n=fr(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(pr=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")+fr(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 xr(e){return e}var qr,Mr,Sr,wr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Dr(e){var t,n,r=e.grouping&&e.thousands?(t=e.grouping,n=e.thousands,function(e,r){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}):xr,i=e.currency,o=e.decimal,a=e.numerals?function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(e.numerals):xr,s=e.percent||"%";function l(e){var t=(e=gr(e)).fill,n=e.align,l=e.sign,u=e.symbol,c=e.zero,d=e.width,f=e.comma,m=e.precision,p=e.trim,h=e.type;"n"===h?(f=!0,h="g"):br[h]||(null==m&&(m=12),p=!0,h="g"),(c||"0"===t&&"="===n)&&(c=!0,t="0",n="=");var g="$"===u?i[0]:"#"===u&&/[boxX]/.test(h)?"0"+h.toLowerCase():"",y="$"===u?i[1]:/[%p]/.test(h)?s:"",v=br[h],b=/[defgprs%]/.test(h);function x(e){var i,s,u,x=g,q=y;if("c"===h)q=v(e)+q,e="";else{var M=(e=+e)<0;if(e=v(Math.abs(e),m),p&&(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(i>0){if(!+e[r])break e;i=0}}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),M&&0==+e&&(M=!1),x=(M?"("===l?l:"-":"-"===l||"("===l?"":l)+x,q=("s"===h?wr[8+pr/3]:"")+q+(M&&"("===l?")":""),b)for(i=-1,s=e.length;++i<s;)if(48>(u=e.charCodeAt(i))||u>57){q=(46===u?o+e.slice(i+1):e.slice(i))+q,e=e.slice(0,i);break}}f&&!c&&(e=r(e,1/0));var S=x.length+e.length+q.length,w=S<d?new Array(d-S+1).join(t):"";switch(f&&c&&(e=r(w+e,w.length?d-q.length:1/0),w=""),n){case"<":e=x+e+q+w;break;case"=":e=x+w+e+q;break;case"^":e=w.slice(0,S=w.length>>1)+x+e+q+w.slice(S);break;default:e=w+x+e+q}return a(e)}return m=null==m?6:/[gprs]/.test(h)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),x.toString=function(){return e+""},x}return{format:l,formatPrefix:function(e,t){var n=l(((e=gr(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(mr(t)/3))),i=Math.pow(10,-r),o=wr[8+r/3];return function(e){return n(i*e)+o}}}}function Cr(e,t,n,r){var i,o=Tt(e,t,n);switch((r=gr(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(mr(t)/3)))-mr(Math.abs(e)))}(o,a))||(r.precision=i),Sr(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,mr(t)-mr(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,-mr(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return Mr(r)}function Nr(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=Et(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 Cr(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=Et(s,l,n))>0?r=Et(s=Math.floor(s/r)*r,l=Math.ceil(l/r)*r,n):r<0&&(r=Et(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 kr(){var e=dr(or,or);return e.copy=function(){return cr(e,kr())},Ot.apply(e,arguments),Nr(e)}qr=Dr({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),Mr=qr.format,Sr=qr.formatPrefix;var Ar=new Date,Lr=new Date;function Er(e,t,n,r){function i(t){return e(t=new Date(+t)),t}return i.floor=i,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 Er((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 Ar.setTime(+t),Lr.setTime(+r),e(Ar),e(Lr),Math.floor(n(Ar,Lr))},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 Tr=Er((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));Tr.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?Er((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):Tr:null},Tr.range;var Or=1e3,Ir=6e4,Pr=36e5,Rr=864e5,Fr=6048e5,jr=Er((function(e){e.setTime(Math.floor(e/Or)*Or)}),(function(e,t){e.setTime(+e+t*Or)}),(function(e,t){return(t-e)/Or}),(function(e){return e.getUTCSeconds()}));jr.range;var Hr=Er((function(e){e.setTime(Math.floor(e/Ir)*Ir)}),(function(e,t){e.setTime(+e+t*Ir)}),(function(e,t){return(t-e)/Ir}),(function(e){return e.getMinutes()}));Hr.range;var zr=Er((function(e){var t=e.getTimezoneOffset()*Ir%Pr;t<0&&(t+=Pr),e.setTime(Math.floor((+e-t)/Pr)*Pr+t)}),(function(e,t){e.setTime(+e+t*Pr)}),(function(e,t){return(t-e)/Pr}),(function(e){return e.getHours()}));zr.range;var Br=Er((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())*Ir)/Rr}),(function(e){return e.getDate()-1}));function _r(e){return Er((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())*Ir)/Fr}))}Br.range;var Vr=_r(0),$r=_r(1),Ur=_r(2),Wr=_r(3),Kr=_r(4),Gr=_r(5),Yr=_r(6);Vr.range,$r.range,Ur.range,Wr.range,Kr.range,Gr.range,Yr.range;var Xr=Er((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()}));Xr.range;var Jr=Er((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?Er((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 Zr=Er((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+t*Ir)}),(function(e,t){return(t-e)/Ir}),(function(e){return e.getUTCMinutes()}));Zr.range;var Qr=Er((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+t*Pr)}),(function(e,t){return(t-e)/Pr}),(function(e){return e.getUTCHours()}));Qr.range;var ei=Er((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/Rr}),(function(e){return e.getUTCDate()-1}));function ti(e){return Er((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)/Fr}))}ei.range;var ni=ti(0),ri=ti(1),ii=ti(2),oi=ti(3),ai=ti(4),si=ti(5),li=ti(6);ni.range,ri.range,ii.range,oi.range,ai.range,si.range,li.range;var ui=Er((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()}));ui.range;var ci=Er((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 di(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 fi(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 mi(e){return{y:e,m:0,d:1,H:0,M:0,S:0,L:0}}ci.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Er((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},ci.range;var pi,hi,gi,yi={"-":"",_:" ",0:"0"},vi=/^\s*\d+/,bi=/^%/,xi=/[\\^$*+?|[\]().{}]/g;function qi(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 Mi(e){return e.replace(xi,"\\$&")}function Si(e){return new RegExp("^(?:"+e.map(Mi).join("|")+")","i")}function wi(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function Di(e,t,n){var r=vi.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Ci(e,t,n){var r=vi.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Ni(e,t,n){var r=vi.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function ki(e,t,n){var r=vi.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Ai(e,t,n){var r=vi.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Li(e,t,n){var r=vi.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Ei(e,t,n){var r=vi.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Ti(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 Oi(e,t,n){var r=vi.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Ii(e,t,n){var r=vi.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Pi(e,t,n){var r=vi.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Ri(e,t,n){var r=vi.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Fi(e,t,n){var r=vi.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function ji(e,t,n){var r=vi.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Hi(e,t,n){var r=vi.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function zi(e,t,n){var r=vi.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Bi(e,t,n){var r=bi.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function _i(e,t,n){var r=vi.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Vi(e,t,n){var r=vi.exec(t.slice(n));return r?(e.Q=1e3*+r[0],n+r[0].length):-1}function $i(e,t){return qi(e.getDate(),t,2)}function Ui(e,t){return qi(e.getHours(),t,2)}function Wi(e,t){return qi(e.getHours()%12||12,t,2)}function Ki(e,t){return qi(1+Br.count(Jr(e),e),t,3)}function Gi(e,t){return qi(e.getMilliseconds(),t,3)}function Yi(e,t){return Gi(e,t)+"000"}function Xi(e,t){return qi(e.getMonth()+1,t,2)}function Ji(e,t){return qi(e.getMinutes(),t,2)}function Zi(e,t){return qi(e.getSeconds(),t,2)}function Qi(e){var t=e.getDay();return 0===t?7:t}function eo(e,t){return qi(Vr.count(Jr(e),e),t,2)}function to(e,t){var n=e.getDay();return e=n>=4||0===n?Kr(e):Kr.ceil(e),qi(Kr.count(Jr(e),e)+(4===Jr(e).getDay()),t,2)}function no(e){return e.getDay()}function ro(e,t){return qi($r.count(Jr(e),e),t,2)}function io(e,t){return qi(e.getFullYear()%100,t,2)}function oo(e,t){return qi(e.getFullYear()%1e4,t,4)}function ao(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+qi(t/60|0,"0",2)+qi(t%60,"0",2)}function so(e,t){return qi(e.getUTCDate(),t,2)}function lo(e,t){return qi(e.getUTCHours(),t,2)}function uo(e,t){return qi(e.getUTCHours()%12||12,t,2)}function co(e,t){return qi(1+ei.count(ci(e),e),t,3)}function fo(e,t){return qi(e.getUTCMilliseconds(),t,3)}function mo(e,t){return fo(e,t)+"000"}function po(e,t){return qi(e.getUTCMonth()+1,t,2)}function ho(e,t){return qi(e.getUTCMinutes(),t,2)}function go(e,t){return qi(e.getUTCSeconds(),t,2)}function yo(e){var t=e.getUTCDay();return 0===t?7:t}function vo(e,t){return qi(ni.count(ci(e),e),t,2)}function bo(e,t){var n=e.getUTCDay();return e=n>=4||0===n?ai(e):ai.ceil(e),qi(ai.count(ci(e),e)+(4===ci(e).getUTCDay()),t,2)}function xo(e){return e.getUTCDay()}function qo(e,t){return qi(ri.count(ci(e),e),t,2)}function Mo(e,t){return qi(e.getUTCFullYear()%100,t,2)}function So(e,t){return qi(e.getUTCFullYear()%1e4,t,4)}function wo(){return"+0000"}function Do(){return"%"}function Co(e){return+e}function No(e){return Math.floor(+e/1e3)}!function(e){pi=function(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,u=Si(i),c=wi(i),d=Si(o),f=wi(o),m=Si(a),p=wi(a),h=Si(s),g=wi(s),y=Si(l),v=wi(l),b={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:$i,e:$i,f:Yi,H:Ui,I:Wi,j:Ki,L:Gi,m:Xi,M:Ji,p:function(e){return i[+(e.getHours()>=12)]},Q:Co,s:No,S:Zi,u:Qi,U:eo,V:to,w:no,W:ro,x:null,X:null,y:io,Y:oo,Z:ao,"%":Do},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:so,e:so,f:mo,H:lo,I:uo,j:co,L:fo,m:po,M:ho,p:function(e){return i[+(e.getUTCHours()>=12)]},Q:Co,s:No,S:go,u:yo,U:vo,V:bo,w:xo,W:qo,x:null,X:null,y:Mo,Y:So,Z:wo,"%":Do},q={a:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return w(e,t,n,r)},d:Ii,e:Ii,f:zi,H:Ri,I:Ri,j:Pi,L:Hi,m:Oi,M:Fi,p:function(e,t,n){var r=u.exec(t.slice(n));return r?(e.p=c[r[0].toLowerCase()],n+r[0].length):-1},Q:_i,s:Vi,S:ji,u:Ci,U:Ni,V:ki,w:Di,W:Ai,x:function(e,t,r){return w(e,n,t,r)},X:function(e,t,n){return w(e,r,t,n)},y:Ei,Y:Li,Z:Ti,"%":Bi};function M(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,u=e.length;for(n instanceof Date||(n=new Date(+n));++s<u;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=yi[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function S(e,t){return function(n){var r,i,o=mi(1900);if(w(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("p"in o&&(o.H=o.H%12+12*o.p),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=fi(mi(o.y))).getUTCDay(),r=i>4||0===i?ri.ceil(r):ri(r),r=ei.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=t(mi(o.y))).getDay(),r=i>4||0===i?$r.ceil(r):$r(r),r=Br.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?fi(mi(o.y)).getUTCDay():t(mi(o.y)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,fi(o)):t(o)}}function w(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a<s;){if(r>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=q[i in yi?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=M(n,b),b.X=M(r,b),b.c=M(t,b),x.x=M(n,x),x.X=M(r,x),x.c=M(t,x),{format:function(e){var t=M(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=S(e+="",di);return t.toString=function(){return e},t},utcFormat:function(e){var t=M(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=S(e,fi);return t.toString=function(){return e},t}}}(e),pi.format,pi.parse,hi=pi.utcFormat,gi=pi.utcParse}({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"]});var ko="%Y-%m-%dT%H:%M:%S.%LZ";Date.prototype.toISOString||hi(ko),+new Date("2000-01-01T00:00:00.000Z")||gi(ko);var Ao=1e3,Lo=60*Ao,Eo=60*Lo,To=24*Eo,Oo=7*To,Io=30*To,Po=365*To;function Ro(e){return new Date(e)}function Fo(e){return e instanceof Date?+e:+new Date(+e)}function jo(e,t,n,r,i,o,a,s,l){var u=dr(or,or),c=u.invert,d=u.domain,f=l(".%L"),m=l(":%S"),p=l("%I:%M"),h=l("%I %p"),g=l("%a %d"),y=l("%b %d"),v=l("%B"),b=l("%Y"),x=[[a,1,Ao],[a,5,5*Ao],[a,15,15*Ao],[a,30,30*Ao],[o,1,Lo],[o,5,5*Lo],[o,15,15*Lo],[o,30,30*Lo],[i,1,Eo],[i,3,3*Eo],[i,6,6*Eo],[i,12,12*Eo],[r,1,To],[r,2,2*To],[n,1,Oo],[t,1,Io],[t,3,3*Io],[e,1,Po]];function q(s){return(a(s)<s?f:o(s)<s?m:i(s)<s?p:r(s)<s?h:t(s)<s?n(s)<s?g:y:e(s)<s?v:b)(s)}function M(t,n,r,i){if(null==t&&(t=10),"number"==typeof t){var o=Math.abs(r-n)/t,a=Ct((function(e){return e[2]})).right(x,o);a===x.length?(i=Tt(n/Po,r/Po,t),t=e):a?(i=(a=x[o/x[a-1][2]<x[a][2]/o?a-1:a])[1],t=a[0]):(i=Math.max(Tt(n,r,t),1),t=s)}return null==i?t:t.every(i)}return u.invert=function(e){return new Date(c(e))},u.domain=function(e){return arguments.length?d(zt.call(e,Fo)):d().map(Ro)},u.ticks=function(e,t){var n,r=d(),i=r[0],o=r[r.length-1],a=o<i;return a&&(n=i,i=o,o=n),n=(n=M(e,i,o,t))?n.range(i,o+1):[],a?n.reverse():n},u.tickFormat=function(e,t){return null==t?q:l(t)},u.nice=function(e,t){var n=d();return(e=M(e,n[0],n[n.length-1],t))?d(function(e,t){var n,r=0,i=(e=e.slice()).length-1,o=e[r],a=e[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),e[r]=t.floor(o),e[i]=t.ceil(a),e}(n,e)):u},u.copy=function(){return cr(u,jo(e,t,n,r,i,o,a,s,l))},u}function Ho(){return Ot.apply(jo(ci,ui,ni,ei,Qr,Zr,jr,Tr,hi).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}const zo={horizontal:{major:"width",minor:"height",start:"left",end:"right",shadow:{startOffset:"12px 0",endOffset:"-12px 0"}},vertical:{major:"height",minor:"width",start:"top",end:"bottom",shadow:{startOffset:"0 12px",endOffset:"0 -12px"}}},Bo=e=>`${e} 12px -12px inset rgba(0, 0, 0, 0.0625)`;var _o={defaultSettings:{settings:{orientation:"horizontal",rtl:!1,range:()=>[0,1]}},renderer:"dom",render(e){const{range:t,orientation:n,rtl:r}=this.settings.settings,[i,o]=t(),a=Math.abs(i)<1e-15,s=Math.abs(o-1)<1e-15,l=(e=>{const t=zo[e];return{base:{position:"absolute",[t.major]:12,[t.minor]:"100%"},towardsStart:{[t.start]:0,[t.end]:"auto",boxShadow:Bo(t.shadow.startOffset)},towardsEnd:{[t.start]:"auto",[t.end]:0,boxShadow:Bo(t.shadow.endOffset)}}})(n),u="horizontal"===n&&r,c=[];return a||c.push(e("div",{style:{...l.base,...u?l.towardsEnd:l.towardsStart},class:"scroll-hint--towards-start"})),s||c.push(e("div",{style:{...l.base,...u?l.towardsStart:l.towardsEnd},class:"scroll-hint--towards-end"})),c}};function Vo({viewState:e,viewCache:t,layoutService:n,dockService:r,rtl:i}){return!n.meta.isSnapshot&&{key:"scroll-hint",type:"scroll-hint",settings:{orientation:r.meta.major.orientation,rtl:i,range:()=>function({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),r=t.get("continuousMin"),i=t.get("continuousMax");return[(n.min-r)/(i-r),(n.max-r)/(i-r)]}(t,n):function(e){return e.get("viewRange")}(t)}({layoutService:n,viewState:e,viewCache:t})}}}let $o;function Uo(){$o=$o||document.createElement("canvas").getContext("2d")}const Wo={measureTextWidth(e){Uo();const{width:t}=$o.measureText(e);return t},lineWrap(e,t,n,r){let i,o;Uo();const a=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,u,c,d,f=e?e.split(/\s+/):[],m=a[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof r&&a.length>=r)return a.slice(0,r);for(n&&($o.font=n),o=0;o<a.length;o++){for(d=a[o]||"",f=d.split(/\s+/),[m]=f,c="",i=1;i<f.length;i++)if(l=`${m} ${f[i]}`,u=Wo.measureTextWidth(l),u>t&&("number"!=typeof r||r>s.length)?(s.push(m),m=f[i]):m=l,"number"==typeof r&&s.length>=r){c=f.slice(i+1).join(" ");break}"number"!=typeof r||s.length<r?s.push(m):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]||""} ${m} ${c}`}return s},wordWrap(e,t,n,r,i){if(Uo(),!e||!e.length)return[];n&&($o.font=n);let o=[];const a=e.slice();let s,l,u,c;if(a.filter((e=>!!e)),"number"!=typeof t||t<0)return e.slice();for(c=0;c<a.length;c++)u=a[c],l=null,u&&(u.length<=1||Wo.measureTextWidth(u)<=t?o.push(u):(s=Wo.splitWord(u,t,void 0,r-o.length),s.length<=1?o.push(s[0]):(l=s.pop(),o=o.concat(s),a[c+1]?Wo.measureTextWidth(`${l} ${a[c+1]}`)>t&&o.length+a.length-c<=r?a.splice(c+1,0,l):a[c+1]=`${l} ${a[c+1]}`:a.push(l))));return o.forEach(((e,t,n)=>{n[t]=e?e.trim():e})),o.length>r?(o=o.splice(0,r),o[o.length-1]=Wo.truncate(o[o.length-1],t,n,i).text):(u=o[o.length-1],u&&u.length>1&&Wo.measureTextWidth(u)>t&&(o[o.length-1]=Wo.truncate(u,t,n,i).text)),o},truncate(e,t,n,r="…"){Uo();let i,o,a,s,l=e;const u=Wo.measureTextWidth("i"),c=Math.ceil(t/u);if(n&&($o.font=n),e&&t){if(Wo.measureTextWidth(l)>t){for(i=Math.min(c,l.length);i>0;i--)if(o=l.substring(0,i-1),a=o.trim()+r,Wo.measureTextWidth(a)<=t){s=l.substring(i-1),l=a;break}i||(s=l,l="…")}}else s=void 0;return{text:l,rest:s}},isNumber:e=>"number"==typeof e&&Number.isFinite(e),explodeWord(e,t,n,r){let i;Uo();let o,a=e,s="",l=[];if(Wo.isNumber(n)&&n<=1)return[e];const u=Math.ceil(t/r);for(i=Math.min(e.length,u);i>0&&(a=e.substring(0,i),o=e.substring(i-1,i)," "===o?a=e.substring(0,i-1):a+="-",s=e.substring(i),!(Wo.measureTextWidth(a)<=t));i--);return(!i&&!a||Wo.measureTextWidth(a)>t)&&(a=e.substring(0,1),s=e.substring(1)),l.push(a),s?(Wo.measureTextWidth(s)>t?(s=Wo.explodeWord(s,t,n-1,r),l=l.concat(s)):l.push(s),l.filter((e=>""!==e.trim()))):l},splitWord:(e,t,n,r)=>(Uo(),e&&t?(n&&($o.font=n),Wo.explodeWord(e,t,r,Math.max(1,Wo.measureTextWidth("i")))):[]),wrapText(e,t,n,r,i){let o;return Number.isNaN(t)?[e]:(o=r>1?Wo.lineWrap(e,t,n,r):[e],o=Wo.wordWrap(o,t,n,r,i),o)},getFontHeight:e=>(Uo(),e&&($o.font=e),1.5*Wo.measureTextWidth("m")),tokenize(e,t,n,r,i,o,a=1){Uo(),t&&($o.font=t);const s=Wo.getFontHeight(),l=a*s;let u=[],c=0,d=[];if(o<s)return[];const f=o?Math.max(1,Math.floor(o/l)):r||1;return Array.isArray(r)?(r.forEach((e=>{c+=Number.isNaN(e)||e<=0?0:e})),r.forEach((e=>{u.push(Number.isNaN(e)||e<=0?f-c:e)}))):u=[Number.isNaN(r)||r<=0?f:Math.min(f,r)],Array.isArray(e)?e.forEach(((e,n)=>{d.length<f&&(d=d.concat(Wo.wrapText(e,i,t,u[n])))})):d=Wo.wrapText(e,i,t,u[0],n),d}},Ko={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:r,rendHeight:i,flipXY:o,symbol:a}){let s="x",l="y",u=r,c=i,d=t<.5?90:-90;return o&&(s="y",l="x",u=i,c=r,d=t<.5?180:0),a(Y({},e,{[s]:n*u,[l]:Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}},Go=Y.bind(null,!0),Yo={},{isArray:Xo}=Array;function Jo(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function Zo(e){return void 0===e}function Qo(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function ea(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach(((t,i)=>{if(i===n.length)return;r=+t;const o=isNaN(r)?{}:[];e[r||t]=Zo(e[r||t])?o:e[t],e=e[r||t]})),e}function ta(e,t){let n=!0;if(Jo(e)&&Jo(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((r=>{ta(e[r],t[r])||(n=!1)})),n);if(Xo(e)&&Xo(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n+=1)if(!ta(e[n],t[n]))return!1;return!0}return e===t}Yo.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach((i=>{const o=function(e){return e?Go({},{val:e}).val:e}(t[i]),a=e[i],s=`${n}/${i}`;ta(o,a)||Qo(t,i)||(Zo(a)?r.push({op:"add",path:s,value:o}):Jo(o)&&Jo(a)?r=r.concat(Yo.generate(a,o,s)):Xo(o)&&Xo(a)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o=-1;function a(e,t,n){if(e[n]&&Zo(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,r=e.length;n<r;n+=1)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(ta(t,i))return r;if(!Zo(t[0])&&Zo(t[0].qInfo)||0===t.length)return r.push({op:"replace",path:n,value:t}),r;for(let e=i.length-1;e>=0;e-=1)o=a(t,i[e].qInfo&&i[e].qInfo.qId,e),-1===o?(r.push({op:"remove",path:`${n}/${e}`}),i.splice(e,1)):r=r.concat(Yo.generate(i[e],t[o],`${n}/${e}`));for(let e=0,s=t.length;e<s;e+=1)o=a(i,t[e].qInfo&&t[e].qInfo.qId),-1===o?(r.push({op:"add",path:`${n}/${e}`,value:t[e]}),i.splice(e,0,t[e])):o!==e&&(r.push({op:"move",path:`${n}/${e}`,from:`${n}/${o}`}),i.splice(e,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:`${n}/${i}`,value:o}))})),Object.keys(e).forEach((i=>{Zo(t[i])&&!Qo(e,i)&&r.push({op:"remove",path:`${n}/${i}`})})),r},Yo.apply=function(e,t){t.forEach((t=>{let n=ea(e,t.path),r=t.path.split("/").splice(-1)[0],i=r&&isNaN(+r)?n[r]:n[+r]||n;const o=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(n=null,i=e),"add"===t.op||"replace"===t.op)if(Xo(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(Xo(i)&&Xo(t.value)){const e=t.value.slice();i.length=0,i.push(...e)}else if(Jo(i)&&Jo(t.value))a=i,Object.keys(a).forEach((e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!Qo(a,e)&&delete a[e]})),Go(i,t.value);else{if(!n)throw new Error("Patchee is not an object we can patch");n[r]=t.value}else if("move"===t.op){const i=ea(e,t.from);Xo(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(Xo(n)?n.splice(+r,1):delete n[r]);var a}))},Yo.clone=function(e){return Go({},e)},Yo.createPatch=function(e,t,n){const r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},Yo.updateObject=function(e,t){Object.keys(e).length?Yo.apply(e,Yo.generate(e,t)):Go(e,t)};const na=Math.log(10);function ra(e){return 10**e}const ia={pow10:ra,log:(e,t)=>e<=0||t<=0?NaN:Math.log(e)/Math.log(t),log10:e=>e<=0?NaN:Math.log(e)/na,eliminateFloatingError(e){const t=Math.round(e);return Math.abs(e-t)<1e-12?t:e},getNiceNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/na),r=e/ra(n);return t=r<=1?1:r<=2?2:r<=5?5:10,t*ra(n)*(e<0?-1:1)},getSmallNiceNumber(e){let t,n;if(0===e)return 0;t=Math.floor(Math.log(Math.abs(e))/na);const r=e/ra(t);return r<1?(n=5,t--):n=r<2?1:r<5?2:5,n*ra(t)*(e<0?-1:1)},getMagnitude(e){if(0===e)return 0;return ra(Math.floor(Math.log(Math.abs(e))/na))},getFraction(e){if(0===e)return 0;return e/ra(Math.floor(Math.log(Math.abs(e))/na))},getGoodNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/na),r=e/ra(n);return t=Math.ceil(r),7!==t&&9!==t||t++,r>1&&r<=1.5?t=1.5:r>2&&r<=2.5&&(t=2.5),t*ra(n)*(e<0?-1:1)},getValueWithOffset:(e,t=0)=>e+Math.abs(e)*t,isNumber:e=>"number"==typeof e&&!Number.isNaN(e)},oa=[[2,4,6],[2,4],[3]],aa=[,[,,[[1,2]],[[1,2,3],[1,3]],[[1,2,4],[1,4]],[[1,2,4],[1,5]],[[1,2,4,6],[2,4,6],[1,3,6],[1,6]],[[1,2,4,6],[2,4,6],[1,3,6],[1,7]],[[1,2,4,8],[2,4,8],[1,8]],[[1,2,4,8],[2,4,8],[1,3,9],[1,9]],[[1,2,4,6,10],[1,2,4,10],[1,3,10],[3,10],[1,10]]],[,,,[[2,3]],[[2,3,4],[2,4]],[[2,3,4],[2,4],[2,5]],[[2,4,6],[2,6]],[[2,4,6],[2,6],[2,7]],[[2,4,8],[2,8]],[[2,4,8],[2,8],[2,9]],[[2,4,6,10],[2,4,10],[5,10],[3,10]]],[,,,,[[3,4]],[[3,4,5],[3,5]],[[3,4,5,6],[3,6]],[[3,4,5,6],[3,5,7],[3,7]],[[3,4,5,6,8],[3,5,7],[4,8],[3,8]],[[3,4,5,6,8],[3,4,6,9],[3,4,6,8],[3,6,9],[4,8],[3,9]],[[4,6,10],[5,10],[3,10]]],[,,,,,[[4,5]],[[4,5,6],[4,6]],[[4,5,6,7],[4,5,6],[4,6]],[[4,5,6,7,8],[4,5,6,7],[4,6,8],[4,8]],[[4,5,6,7,8],[4,6,9],[4,6,8],[4,8]],[[4,6,10],[5,7,9],[5,10],[4,10]]],[,,,,,,[[5,6]],[[5,6,7],[5,7]],[[5,6,7,8],[5,6,7],[6,8]],[[5,6,7,8,9],[5,6,7,8],[5,7,9],[5,9]],[[6,8,10],[5,10]]],[,,,,,,,[[6,7]],[[6,7,8],[6,8]],[[6,7,8,9],[6,7,8],[6,9]],[[6,7,8,9,10],[6,8,10],[6,10]]],[,,,,,,,,[[7,8]],[[7,8,9],[7,9]],[[7,8,9,10],[8,10],[7,10],[7,9]]],[,,,,,,,,,[[8,9]],[[8,9,10],[8,10]]],[,,,,,,,,,,[[9,10]]]];function sa(e,t,n){const r=e?e.length:0;let i,o=void 0===t?Number.MAX_VALUE:e[0]/t;for(i=1;i<r;i++)o=Math.min(o,e[i]/e[i-1]);void 0!==n&&(o=Math.min(o,n/e[r-1])),e.splice(0,0,o)}function la(e,t,n){let r;const i=e?e.length:0;for(r=0;r<i;r++)sa(e[r],t,n)}!function(){let e,t;for(la(oa,1,10),e=0;e<aa.length;e++)if(aa[e])for(t=0;t<aa[e].length;t++)Array.isArray(aa[e][t])&&la(aa[e][t])}();const ua={isInside(e,t,n,r){if(!r)return!0;const i=e.position-e.radius,o=e.position+e.radius;return i>=t&&o<=n},getCenterDistance:(e,t)=>Math.abs(e.center-t.center),getGap(e,t){const n=e.position<t.position?e:t,r=e.position<t.position?t:e;return r.position-r.radius-(n.position+n.radius)},findSegmentPositionMeetMax(e,t){const n=Math.max(0,e.max-t);return e.center-n},findSegmentPositionMeetMin(e,t){const n=Math.max(0,t-e.min);return e.center+n},findSegmentPositionMeetMinThenMax(e,t,n){const r=ua.findSegmentPositionMeetMin(e,t);return ua.findSegmentPositionMeetMax({center:r,max:r+e.radius},n)},findSegmentPositionMeetMaxThenMin(e,t,n){const r=ua.findSegmentPositionMeetMax(e,n);return ua.findSegmentPositionMeetMin({center:r,min:r-e.radius},t)},layoutPositionFromMin(e,t,n,r=0){const i=e.length-1;let o,a,s=t;for(let t=0;t<i;t++)o=e[t],a=e[t+1],o.position=ua.findSegmentPositionMeetMaxThenMin(o,s,(o.center+a.center-r)/2),s=o.position+o.radius+r/2;a.position=ua.findSegmentPositionMeetMaxThenMin(a,s,n)},adjustPositionFromMax(e,t,n,r=0){const i=e.length-1;let o,a,s;const l=Math.max(0,e[i].position+e[i].radius-n);if(0===l)return;let u,c=0;for(o=i;o>0&&(a=e[o],s=e[o-1],u=Math.max(0,ua.getGap(s,a)-r),u-=Math.max(0,c+u-l),c+=u,a.move=u,!(c>=l));o--);for(c<l&&(u=Math.max(0,s.position-s.radius-t),u-=Math.max(0,c+u-l),c+=u,s.move=u),c=0,o=0;o<=i;o++)a=e[o],c+=a.move||0,a.move=c,a.position-=c},layout(e,t,n,r=0){const i=e.length-1;if(!(i<0))if(0!==i)ua.layoutPositionFromMin(e,t,n,r),ua.adjustPositionFromMax(e,t,n,r);else{const r=e[0];r.position=ua.findSegmentPositionMeetMaxThenMin(r,t,n)}}},ca=(e,t,n,r=1)=>{const i=e.bandwidth();return n?"start"===t?i:"end"===t?i*(1-r):i*(2-r)/2:"start"===t?0:"end"===t?i*r:i*r/2},da=e=>!1!==e.show&&0!==e.show&&"0"!==e.show,fa=e=>e.filter(da),ma=(e,t)=>fa(se.getValue(e,t,[])),pa=e=>da(e)&&(!1!==e.showValue||!1!==e.showLabel),ha=e=>e.filter(pa),ga=(e,t)=>ha(se.getValue(e,t,[])),ya=({refLineLayout:e,layoutService:t})=>t.meta.canBeContinuous?e.refLineExpr.value:e.refLineExpr.stringValue,va=(e,t,n)=>{const{dimensionRefLineInfo:r}=t;if(r[e])return r[e][n]},ba=({label:e,dataPages:t})=>{const{qArea:n={}}=t||{},{qTop:r,qHeight:i}=n;return void 0!==r&&void 0!==i&&void 0!==e.valueInfo&&e.valueInfo.maxOrder<r},xa=({label:e,dataPages:t})=>{const{qArea:n={}}=t||{},{qTop:r,qHeight:i}=n;return void 0!==r&&void 0!==i&&void 0!==e.valueInfo&&e.valueInfo.minOrder>=r+i},qa=({value:e,qMin:t})=>"NaN"!==t&&e<t,Ma=({value:e,qMax:t})=>"NaN"!==t&&e>t,Sa={isRefLineVisible:da,getVisibleRefLines:fa,getRefLines:ma,getMeasureRefLines:e=>ma(e,"refLine.refLines"),getDimensionRefLines:(e,t)=>t?[]:ma(e,"refLine.dimRefLines"),isRefLineLabelVisible:pa,getVisibleRefLineLabels:ha,getRefLineLabels:ga,getMeasureRefLineLabels:e=>ga(e,"refLine.refLines"),getDimensionRefLineLabels:(e,t)=>t?[]:ga(e,"refLine.dimRefLines"),getScaledPosition:({scale:e,size:t,value:n,valueInfo:r,align:i,invert:o=!1,layoutService:a,isContinuous:s})=>{if(!s){const s=e.pxScale(t);let l;if(a.meta.isGroupedByMeasure)return l=ca(s,i,o,a.meta.measureCount),s([n,0])+l;if(a.meta.isGroupedByDimension){if(!r)return NaN;const{innerValues:e,numInnerValues:t,minOrder:a}=r;let u;return l=ca(s,i,o,t),e&&e.length&&(u=(({pxScale:e,value:t,innerValues:n,invert:r,minOrder:i})=>{const o=(({pxScale:e,invert:t})=>e.bandwidth()*(t?-1:1))({pxScale:e,invert:r});for(let r=0;r<n.length;r++){const{id:a,order:s}=n[r],l=e([t,a]);if(void 0!==l)return l-o*(s-i)}})({pxScale:s,value:n,innerValues:e,invert:o,minOrder:a})),(void 0===u?s(n):u)+l}return l=ca(s,i,o),s(n)+l}return e(n)},getDimensionValuesInfo:({layout:e,canBeContinuous:t,discreteModel:n,layoutService:r})=>{const{isGroupedByDimension:i}=r.meta,o={},a=se.getValue(e,"qHyperCube"),s="K"===a.qMode,l=n?n.query.getCurrentDataPage():se.getValue(a,"S"===a.qMode?"qDataPages.0":"qStackedDataPages.0",[]);const u=s?"qData.0.qSubNodes":"qMatrix",c=se.getValue(l,u,[]),d=((e,t)=>e?t?"qValue":"qNum":"qText")(t,s),f=(e=>e.qArea.qTop)(l);return s?(()=>{for(let e=0;e<c.length;e++){const t=c[e],n=e+f,r=t[d];o[r]||(o[r]={id:t.qElemNo,qText:t.qText,minOrder:n,maxOrder:n})}})():i?(()=>{let e;for(let t=0;t<c.length;t++){const n=c[t][0],r=c[t][1],i=t+f,a=n[d];o[a]?(o[a].minOrder=Math.min(o[a].minOrder,i),o[a].maxOrder=Math.max(o[a].maxOrder,i),o[a].innerValues[o[a].innerValues.length]={id:r.qElemNumber,order:i}):o[a]={id:n.qElemNumber,qText:n.qText,minOrder:i,maxOrder:i,innerValues:[{id:r.qElemNumber,order:i}]},0===t?0===i&&(o[a].isMinOrderOk=!0):a!==e&&(o[a].isMinOrderOk=!0,o[e].isMaxOrderOk=!0),e=a}})():(()=>{for(let e=0;e<c.length;e++){const t=c[e][0],n=e+f,r=t[d];o[r]||(o[r]={id:t.qElemNumber,qText:t.qText,minOrder:n,maxOrder:n})}})(),o},getInputValue:ya,extractInfoFromInputValue:va,resolveValue:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const r=ya({refLineLayout:e,layoutService:n});return va(r,t,"id")},isDiscreteMinOutOfBounds:ba,isDiscreteMaxOutOfBounds:xa,isContinuousMinOutOfBounds:qa,isContinuousMaxOutOfBounds:Ma,isOutOfRange:({value:e,qMin:t,qMax:n})=>qa({value:e,qMin:t})||Ma({value:e,qMax:n}),isOutOfDataPages:({label:e,dataPages:t})=>e.valueInfo.isMinOrderOk&&xa({label:e,dataPages:t})||e.valueInfo.isMaxOrderOk&&ba({label:e,dataPages:t}),getInvert:({orientation:e,rtl:t,isContinuous:n})=>"horizontal"===e?t:n},wa="…";function Da(e,t,n=70){for(let r=0;r<e.length;r++){const i=e[r];i.lines=Wo.tokenize(i.title,t,`${wa} ${i.valueString}`,3,n),i.maxNumLines=i.lines.length}}function Ca({title:e,font:t,ellipsis:n,maxNumLines:r=5,maxWidth:i=200}){const o=Wo.tokenize(e,t,n,r,i),a=o.length;let s="";if(a){[s]=o;for(let e=1;e<a;e++)s=`${s}\n${o[e]}`}return s}function Na({oobs:e,font:t,ellipsis:n,maxNumLines:r=5,maxWidth:i=200}){const o=e.map((e=>Ca({title:e.title,font:t,ellipsis:`${n} ${e.valueString}`,maxNumLines:r,maxWidth:i}))),a=o.length;let s="";if(a){[s]=o;for(let e=1;e<a;e++)s=`${s}\n\n${o[e]}`}return s}function ka(e,t="value"){e.sort(((e,n)=>e[t]-n[t]))}const Aa=3,La=2;function Ea({inputValue:e,inputValueLabel:t,localeInfo:n}){if(void 0===e||void 0===t||e.toString()===t)return!1;if(!n)return!0;const r=`+-${n.qDecimalSep||""}${n.qThousandSep||""}`.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");return t.replace(new RegExp(`[0-9e${r}]`,"g"),"").length>0||function(e){if(e.indexOf("e")>-1)return!1;const t=e.indexOf("-");return-1!==t&&(e.lastIndexOf("-")!==t||0!==t)}(t)}const Ta=({label:e,dataPages:t,qMin:n,qMax:r})=>{if(void 0!==n&&void 0!==r){const{inputValue:t}=e;if(Sa.isContinuousMaxOutOfBounds({value:t,qMax:r}))return 1;if(Sa.isContinuousMinOutOfBounds({value:t,qMin:n}))return-1}return Sa.isDiscreteMaxOutOfBounds({label:e,dataPages:t})?1:Sa.isDiscreteMinOutOfBounds({label:e,dataPages:t})?-1:0},Oa={hasEngineFormat:Ea,calculateLabelPositions({labels:e,scale:t,size:n,layoutService:r,orientation:i,rtl:o,isContinuous:a,isDimension:s}){const l=Sa.getInvert({orientation:i,rtl:o,isContinuous:a}),u="S"===r.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",c=r.getHyperCubeValue(u),{canBeContinuous:d}=r.meta;let f,m;if(s&&d){const e=r.getLayoutValue("qHyperCube.qDimensionInfo.0");f=e.qMin,m=e.qMax}for(let i=0;i<e.length;i++){const o=e[i],{value:s,align:u,valueInfo:d}=o,p=Ta({label:o,dataPages:c,qMin:f,qMax:m});o.scaledValue=1===p?l?-.1:1.1:-1===p?l?1.1:-.1:Sa.getScaledPosition({scale:t,size:n,value:s,valueInfo:d,align:u,invert:l,layoutService:r,isContinuous:a}),o.center=o.scaledValue*n}},getTitle:e=>!1!==e.showValue?!1!==e.showLabel?`${e.text} ${e.valueString}`:e.valueString:!1!==e.showLabel?e.text:"",addLabelTitles({labels:e,formatter:t,isContinuous:n,canBeContinuous:r,localeInfo:i}){let o;if(n)for(let n=0;n<e.length;n++){const r=e[n],{value:a,inputValue:s,inputValueLabel:l}=r;o=Ea({inputValue:s,inputValueLabel:l,localeInfo:i})?l:t?t(a):a,r.valueString=`${Se.lrm}(${o})${Se.lrm}`,r.title=Oa.getTitle(r)}else if(r)for(let t=0;t<e.length;t++){const n=e[t],{valueText:r,inputValue:a,inputValueLabel:s}=n;o=Ea({inputValue:a,inputValueLabel:s,localeInfo:i})?s:r,n.valueString=`${Se.lrm}(${o})${Se.lrm}`,n.title=Oa.getTitle(n)}else for(let t=0;t<e.length;t++){const n=e[t];o=n.valueText,n.valueString=`${Se.lrm}(${o})${Se.lrm}`,n.title=Oa.getTitle(n)}},measureLabelsWidth(e,t){for(let n=0;n<e.length;n++){const r=e[n];r.totalWidth=t(r.title).width}},measureLabelMaxLineWidth:(e,t)=>Math.max(...e.lines.map((e=>t(e).width))),getMaxTextWidth(e){const t=e.map((e=>e.totalWidth));return Math.max(...t)},addLabelsNeighborInfo(e,t,n,r=0){const i=e.length-1;if(i<0)return;let o,a;if([o]=e,o.cMin=t,0!==i){for(let t=0;t<i;t++)o=e[t],a=e[t+1],o.cMax=(o.center+a.center-r)/2,a.cMin=o.cMax+r;a.cMax=n}else o.cMax=n},getTotalNumLines(e){let t=0;return e.forEach((e=>{t+=e.maxNumLines})),t},reduceLabelsHavingMaxNumLines(e,t,n){const r=t-1,i=e.filter((e=>e.maxNumLines===t)),o=Math.min(n,i.length);for(let e=i.length-1;e>=i.length-o;e--)i[e].maxNumLines=r},reduceTotalMaxNumLines(e,t,n){const r=Math.floor(n/t);let i=3;do{const t=Oa.getTotalNumLines(e)-r;if(t<=0)return;Oa.reduceLabelsHavingMaxNumLines(e,i,t),i--}while(i>1)},reduceMaxNumLines(e,t,n=0){for(let r=0;r<e.length;r++){const i=e[r];i.maxNumLines=Math.max(1,Math.min(i.maxNumLines,Math.floor((Math.max(0,i.cMax-i.cMin)+n)/t)))}},addLabelsSize(e,t,n=15,r){for(let i=0;i<e.length;i++){const o=e[i];o.width=Math.min(t,Oa.measureLabelMaxLineWidth(o,r)),o.height=o.lines.length*n}},addLabelSegments(e,t){for(let n=0;n<e.length;n++){const r=e[n],{center:i}=r,o=r[t],a=o/2;r.segment={center:i,range:o,min:i-a,max:i+a,radius:a}}},addLabelsInfo({labels:e,scale:t,majorSize:n,lowerLimit:r,upperLimit:i,gap:o,font:a,maxLabelWidth:s,lineHeight:l,majorDimension:u,orientation:c,measureText:d,rtl:f,layoutService:m,isContinuous:p,isDimension:h}){const g=e.map((e=>e)),y=n;Oa.calculateLabelPositions({labels:e,scale:t,size:y,layoutService:m,orientation:c,rtl:f,isContinuous:p,isDimension:h}),ka(e,"center"),Oa.addLabelsNeighborInfo(e,r,i,o),Da(e,a,s),Oa.reduceTotalMaxNumLines(g,l,i-(g.length-1)*o),"vertical"===c&&(Oa.reduceMaxNumLines(e,l,.05*o),function(e,t,n=70){for(let r=0;r<e.length;r++){const i=e[r];i.lines.length>i.maxNumLines&&(i.lines=Wo.tokenize(i.title,t,`${wa} ${i.valueString}`,i.maxNumLines,n))}}(e,a,s)),Oa.addLabelsSize(e,s,l,d),Oa.addLabelSegments(e,u)},createLabels({labels:e,style:t,maxLabelWidth:n,areaProps:r,area:i,lineHeight:o=15,font:a}){const{majorAxis:s,minorAxis:l,dock:u}=r,{minorCenter:c}=i,{fontSize:d,fontFamily:f,background:m}=t;let p=[];return e.forEach((e=>{const{lines:t}=e,r=t.length,i=t.map(((t,i)=>{const m={type:"text",text:t,title:Ca({title:e.title,font:a,ellipsis:`… ${e.valueString}`}),dx:0,dy:0,maxWidth:n,width:n,fontSize:d,fontFamily:f,fill:e.fill,baseline:"central",anchor:"middle",value:e.value,dock:u};return m[l]=c,m[s]=e.segment.position,m.y+=(i-(r-1)/2)*o,m}));e.background&&p.push(function({minorCenter:e,majorAxis:t,minorAxis:n,dock:r,label:i,lineHeight:o,background:a}){const{lines:s}=i,{borderRadius:l=Aa,padding:u={}}=a,{top:c=La,bottom:d=La,left:f=La,right:m=La}=u,p=s.length,h={type:"rect",rx:l,ry:l,fill:i.background.fill,width:i.width+(f+m),height:i.height+(c+d),value:i.value,dock:r};return h[n]=e,h[t]=i.segment.position,h.x-=i.width/2+f,h.y-=p*o/2+c,h}({minorCenter:c,majorAxis:s,minorAxis:l,dock:u,label:e,lineHeight:o,background:m})),p=p.concat(i)})),p}};function Ia(e,t,n){let r;const i=typeof t;if("string"===i||"object"===i)r=e.formatter(t);else if(void 0!==n&&n.data){const e=n.data()&&n.data().fields;r=e&&e[0]?e[0].formatter():null}return r}function Pa(e,t,n){return"top"===e||"bottom"===e?function(e,t){const{font:n,lineHeight:r,top:i,bottom:o,maxLabelWidth:a}=t;let s=1;return Oa.getMaxTextWidth(e)>a&&(Da(e,n,a),s=Math.max(...e.map((e=>e.lines.length)))),s*r+i+o}(t,n):function(e,t){const{left:n,right:r,maxLabelWidth:i}=t;return Math.min(i,Oa.getMaxTextWidth(e))+n+r}(t,n)}function Ra(e,t){return t?e.domain():[0,1]}function Fa(e,t,n,r="value"){let i=e.filter((e=>e[r]>=t));i=i.filter((e=>e[r]<=n));const o=e.filter((e=>e[r]<t)),a=e.filter((e=>e[r]>n));return{filteredLabels:i,minOobs:o,maxOobs:a,numMinOobs:o.length,numMaxOobs:a.length}}function ja(e){let t,n=0;for(let r=1;r<10;r++)t=e(r),n=Math.max(n,Math.sqrt(t.width*t.width+t.height*t.height));return t=e("9+"),[n,Math.max(n,Math.sqrt(t.width*t.width+t.height*t.height))]}function Ha(e,t){return e>9?t[1]:t[0]}function za({alignment:e,dockValue:t,oobs:n,style:r,rect:i,symbol:o,position:a,areaProps:s,radius:l,font:u}){const c=n?n.length:0;if(c<1)return[];const{flipXY:d,majorAxis:f,minorAxis:m,minorDimension:p,dock:h}=s,g=i[p],y=Ko.createOob({oob:Ko.getDefaultSettings({size:r.size,fill:r.fill,alignment:e}),dockValue:t,boxCenter:.5,rendWidth:i.width,rendHeight:i.height,flipXY:d,symbol:o});y.dock=h;const v=`c${f}`,b=`c${m}`,x={type:"circle",r:l,stroke:"transparent",fill:r.text.background.fill,strokeWidth:0,dock:h};x[b]=g/2,x[v]=a;const q={type:"text",text:c>9?"9+":c,title:Na({oobs:n,font:u,ellipsis:"…"}),dx:0,dy:0,maxWidth:g,width:g,fontSize:r.text.fontSize,fontFamily:r.text.fontFamily,fill:r.text.fill,baseline:"central",anchor:"middle",dock:h};return q[m]=g/2,q[f]=a,[y,x,q]}function Ba(e){const t=`normal ${e.fontSize} '${e.fontFamily}'`;return{font:t,lineHeight:Wo.getFontHeight(t)*(e.lineHeightMultiplicator||1),gap:e.gap||12,maxLabelWidth:e.maxWidth||75,top:e.padding.top||0,bottom:e.padding.bottom||0,left:e.padding.left||0,right:e.padding.right||0}}const _a=e=>e.map((e=>({...e,value:"function"==typeof e.value?e.value():e.value,valueText:"function"==typeof e.valueText?e.valueText():e.valueText,valueInfo:"function"==typeof e.valueInfo?e.valueInfo():e.valueInfo})));var Va={require:["renderer","chart","symbol"],defaultSettings:{layout:{displayOrder:0,prioOrder:0}},preferredSize(){const{scale:e}=this,{style:t,layoutService:n,isContinuous:r,localeInfo:i}=this.settings,o=!!r||n.meta.canBeContinuous,a=_a(this.settings.labels),s=Ia(this.chart,this.settings.formatter,e);Oa.addLabelTitles({labels:a,formatter:s,isContinuous:r,canBeContinuous:o,localeInfo:i});const{numMaxOobs:l,numMinOobs:u,filteredLabels:c}=(({labels:e,scale:t,isContinuous:n,canBeContinuous:r,layoutService:i})=>{if(n){const[r,i]=Ra(t,n);return Fa(e,r,i)}if(r){const t=i.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:n,qMax:r}=t;if("NaN"!==n&&"NaN"!==r)return Fa(e,n,r,"inputValue")}return{filteredLabels:e}})({labels:a,scale:e,isContinuous:r,canBeContinuous:o,layoutService:n});let d;if(this.measureText=e=>this.renderer.measureText({text:e,fontSize:t.label.fontSize,fontFamily:t.label.fontFamily}),c&&c.length){const e=Ba(t.label),{dock:n}=this.settings.layout;return Oa.measureLabelsWidth(c,this.measureText),d=Pa(n,c,e),d}const f=ja(this.measureText),m=l?Ha(l,f):0,p=u?Ha(u,f):0;return d=Math.max(m,p),d},render(){const{scale:e}=this;if(!e.domain().length)return;const{symbol:t}=this,{style:n,layoutService:r,theme:i,isContinuous:o,isDimension:a,localeInfo:s}=this.settings,l=!!o||r.meta.canBeContinuous,u=_a(this.settings.labels),{dock:c,rtl:d}=this.settings.layout,{padding:f}=n.label,m=function(e){return"left"===e||"right"===e?(e=>({dock:e,orientation:"vertical",majorAxis:"y",minorAxis:"x",majorDimension:"height",minorDimension:"width",flipXY:!1}))(e):(e=>({dock:e,orientation:"horizontal",majorAxis:"x",minorAxis:"y",majorDimension:"width",minorDimension:"height",flipXY:!0}))(e)}(c),p=function(e,t,n){const r=e[t.minorDimension];return{minorSize:r,majorSize:e[t.majorDimension],minorCenter:"vertical"===t.orientation?(r-n.right-n.left)/2+n.left:(r-n.top-n.bottom)/2+n.top}}(this.rect,m,f),{orientation:h,majorDimension:g}=m,{majorSize:y}=p,{font:v,lineHeight:b,gap:x,maxLabelWidth:q}=Ba(n.label),M=Ia(this.chart,this.settings.formatter,e),S=y;Oa.addLabelTitles({labels:u,formatter:M,isContinuous:o,canBeContinuous:l,localeInfo:s}),Oa.calculateLabelPositions({labels:u,scale:e,size:S,layoutService:r,orientation:h,rtl:d,isContinuous:o,isDimension:a});const[w,D]=Ra(e,o),{filteredLabels:C,lowerOobs:N,upperOobs:k,lowerCircleSize:A,upperCircleSize:L,lowerOobSpace:E,upperOobSpace:T}=function({labels:e,minValue:t,maxValue:n,orientation:r,rtl:i,isContinuous:o,style:a,padding:s,measureText:l,prop:u="value"}){const{maxOobs:c,minOobs:d,filteredLabels:f}=Fa(e,t,n,u),m="scaledValue"!==u&&Sa.getInvert({orientation:r,rtl:i,isContinuous:o}),p=function(e,t,n){return n?t:e}(d,c,m),h=function(e,t,n){return n?e:t}(d,c,m),g=p.length,y=h.length,v=ja(l),b=Ha(g,v),x=Ha(y,v),q=function(e,t,n,r,i){return("vertical"===r?i.top:i.left)+(e>0?t+n:0)}(g,a.oob.size,b,r,s),M=function(e,t,n,r,i){return("vertical"===r?i.bottom:i.right)+(e>0?t+n:0)}(y,a.oob.size,x,r,s);return{filteredLabels:f,lowerOobs:p,upperOobs:h,lowerCircleSize:b,upperCircleSize:x,lowerOobSpace:q,upperOobSpace:M}}({labels:u,minValue:w,maxValue:D,orientation:h,rtl:d,isContinuous:o,style:n,padding:f,measureText:this.measureText,prop:o?"value":"scaledValue"}),O=E,I=y-T;ka(N),ka(k);const P=za({alignment:0,dockValue:0,oobs:N,style:n.oob,rect:this.rect,symbol:t,position:n.oob.size+A/2,areaProps:m,radius:A/2,font:v}),R=za({alignment:1,dockValue:1,oobs:k,style:n.oob,rect:this.rect,symbol:t,position:y-(n.oob.size+L/2),areaProps:m,radius:L/2,font:v});Oa.addLabelsInfo({labels:C,scale:e,majorSize:y,lowerLimit:O,upperLimit:I,font:v,lineHeight:b,gap:x,maxLabelWidth:q,majorDimension:g,orientation:h,measureText:this.measureText,rtl:d,layoutService:r,isContinuous:o,isDimension:a}),ua.layout(C.map((e=>e.segment)),O,I,n.label.gap);const F=C.filter((e=>ua.isInside(e.segment,O,I,o)));return Oa.createLabels({labels:F,style:n.label,maxLabelWidth:q,areaProps:m,area:p,lineHeight:b,font:v,theme:i}).concat([...P,...R])}};var $a=Object.prototype.hasOwnProperty,Ua=Object.prototype.toString,Wa=Object.defineProperty,Ka=Object.getOwnPropertyDescriptor,Ga=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Ua.call(e)},Ya=function(e){if(!e||"[object Object]"!==Ua.call(e))return!1;var t,n=$a.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&$a.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||$a.call(e,t)},Xa=function(e,t){Wa&&"__proto__"===t.name?Wa(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Ja=function(e,t){if("__proto__"===t){if(!$a.call(e,t))return;if(Ka)return Ka(e,t).value}return e[t]};function Za(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Qa(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function es(){}!function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}((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=Ja(s,n),s!==(i=Ja(t,n))&&(c&&i&&(Ya(i)||(o=Ga(i)))?(o?(o=!1,a=r&&Ga(r)?r:[]):a=r&&Ya(r)?r:{},Xa(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&Xa(s,{name:n,newValue:i}));return s}));var ts=1/.7,ns="\\s*([+-]?\\d+)\\s*",rs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",is="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",os=/^#([0-9a-f]{3,8})$/,as=new RegExp(`^rgb\\(${ns},${ns},${ns}\\)$`),ss=new RegExp(`^rgb\\(${is},${is},${is}\\)$`),ls=new RegExp(`^rgba\\(${ns},${ns},${ns},${rs}\\)$`),us=new RegExp(`^rgba\\(${is},${is},${is},${rs}\\)$`),cs=new RegExp(`^hsl\\(${rs},${is},${is}\\)$`),ds=new RegExp(`^hsla\\(${rs},${is},${is},${rs}\\)$`),fs={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 ms(){return this.rgb().formatHex()}function ps(){return this.rgb().formatRgb()}function hs(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=os.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?gs(t):3===n?new xs(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?ys(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?ys(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=as.exec(e))?new xs(t[1],t[2],t[3],1):(t=ss.exec(e))?new xs(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ls.exec(e))?ys(t[1],t[2],t[3],t[4]):(t=us.exec(e))?ys(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=cs.exec(e))?Cs(t[1],t[2]/100,t[3]/100,1):(t=ds.exec(e))?Cs(t[1],t[2]/100,t[3]/100,t[4]):fs.hasOwnProperty(e)?gs(fs[e]):"transparent"===e?new xs(NaN,NaN,NaN,0):null}function gs(e){return new xs(e>>16&255,e>>8&255,255&e,1)}function ys(e,t,n,r){return r<=0&&(e=t=n=NaN),new xs(e,t,n,r)}function vs(e){return e instanceof es||(e=hs(e)),e?new xs((e=e.rgb()).r,e.g,e.b,e.opacity):new xs}function bs(e,t,n,r){return 1===arguments.length?vs(e):new xs(e,t,n,null==r?1:r)}function xs(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function qs(){return`#${Ds(this.r)}${Ds(this.g)}${Ds(this.b)}`}function Ms(){const e=Ss(this.opacity);return`${1===e?"rgb(":"rgba("}${ws(this.r)}, ${ws(this.g)}, ${ws(this.b)}${1===e?")":`, ${e})`}`}function Ss(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ws(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ds(e){return((e=ws(e))<16?"0":"")+e.toString(16)}function Cs(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ks(e,t,n,r)}function Ns(e){if(e instanceof ks)return new ks(e.h,e.s,e.l,e.opacity);if(e instanceof es||(e=hs(e)),!e)return new ks;if(e instanceof ks)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 ks(a,s,l,e.opacity)}function ks(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function As(e){return(e=(e||0)%360)<0?e+360:e}function Ls(e){return Math.max(0,Math.min(1,e||0))}function Es(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Za(es,hs,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ms,formatHex:ms,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ns(this).formatHsl()},formatRgb:ps,toString:ps}),Za(xs,bs,Qa(es,{brighter(e){return e=null==e?ts:Math.pow(ts,e),new xs(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new xs(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new xs(ws(this.r),ws(this.g),ws(this.b),Ss(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:qs,formatHex:qs,formatHex8:function(){return`#${Ds(this.r)}${Ds(this.g)}${Ds(this.b)}${Ds(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ms,toString:Ms})),Za(ks,(function(e,t,n,r){return 1===arguments.length?Ns(e):new ks(e,t,n,null==r?1:r)}),Qa(es,{brighter(e){return e=null==e?ts:Math.pow(ts,e),new ks(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ks(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 xs(Es(e>=240?e-240:e+120,i,r),Es(e,i,r),Es(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ks(As(this.h),Ls(this.s),Ls(this.l),Ss(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ss(this.opacity);return`${1===e?"hsl(":"hsla("}${As(this.h)}, ${100*Ls(this.s)}%, ${100*Ls(this.l)}%${1===e?")":`, ${e})`}`}}));const Ts=Math.PI/180,Os=180/Math.PI,Is=4/29,Ps=6/29,Rs=3*Ps*Ps;function Fs(e){if(e instanceof js)return new js(e.l,e.a,e.b,e.opacity);if(e instanceof Vs)return $s(e);e instanceof xs||(e=vs(e));var t,n,r=_s(e.r),i=_s(e.g),o=_s(e.b),a=Hs((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Hs((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Hs((.0139322*r+.0971045*i+.7141733*o)/.82521)),new js(116*a-16,500*(t-a),200*(a-n),e.opacity)}function js(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Hs(e){return e>.008856451679035631?Math.pow(e,1/3):e/Rs+Is}function zs(e){return e>Ps?e*e*e:Rs*(e-Is)}function Bs(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function _s(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Vs(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function $s(e){if(isNaN(e.h))return new js(e.l,0,0,e.opacity);var t=e.h*Ts;return new js(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Za(js,(function(e,t,n,r){return 1===arguments.length?Fs(e):new js(e,t,n,null==r?1:r)}),Qa(es,{brighter(e){return new js(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new js(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 xs(Bs(3.1338561*(t=.96422*zs(t))-1.6168667*(e=1*zs(e))-.4906146*(n=.82521*zs(n))),Bs(-.9787684*t+1.9161415*e+.033454*n),Bs(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Za(Vs,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Vs)return new Vs(e.h,e.c,e.l,e.opacity);if(e instanceof js||(e=Fs(e)),0===e.a&&0===e.b)return new Vs(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Os;return new Vs(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Vs(e,t,n,null==r?1:r)}),Qa(es,{brighter(e){return new Vs(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Vs(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return $s(this).rgb()}}));var Us=e=>()=>e;function Ws(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Us(isNaN(e)?t:e)}function Ks(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}!function e(t){var n=function(e){return 1==(e=+e)?Ws: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):Us(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=bs(e)).r,(t=bs(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Ws(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);var Gs,Ys=["__proto__","constructor"];function Xs(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!Ys.some((function(e){return r.includes(e)}))){for(var o=e,a=0;a<r.length-1;++a){var s=r[a];void 0===o[s]&&(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}}}function Js(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function Zs(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=el)):void 0===t&&(t=Qs);for(var n,r,i,o,a,s=new rl(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new rl(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(nl)}function Qs(e){return e.children}function el(e){return Array.isArray(e)?e[1]:null}function tl(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function nl(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function rl(e){this.data=e,this.depth=this.height=0,this.parent=null}rl.prototype=Zs.prototype={constructor:rl,count:function(){return this.eachAfter(Js)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(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}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(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}(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},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Zs(this).eachBefore(tl)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},Gs=function(e){
7
+ import e from"picasso.js";import t from"picasso-plugin-q";import n from"picasso-plugin-hammer";import r from"hammerjs";import i from"react";import{styled as o,ListItem as a,Button as s,Popover as l,List as u,ListItemIcon as c,ListItemText as d}from"@material-ui/core";import m from"react-dom";import{createGenerateClassName as f,StylesProvider as p,ThemeProvider as h}from"@material-ui/styles";import{useTranslator as g,useEmbed as y,useTheme as v,useState as b,useDeviceType as x,useAppLayout as q,useEffect as M,useElement as S,useOptions as D,useLayout as C,useAction as w,useStaleLayout as L,useModel as E,useApp as T,usePlugins as A,useSelections as N,useConstraints as k,useRect as O,usePromise as I,onTakeSnapshot as P,useImperativeHandle as R,useRenderState as F}from"@nebula.js/stardust";function H(){return H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H.apply(this,arguments)}function z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var j=Object.prototype.hasOwnProperty,B=Object.prototype.toString,V=Object.defineProperty,_=Object.getOwnPropertyDescriptor,U=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===B.call(e)},$=function(e){if(!e||"[object Object]"!==B.call(e))return!1;var t,n=j.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&j.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||j.call(e,t)},W=function(e,t){V&&"__proto__"===t.name?V(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},K=function(e,t){if("__proto__"===t){if(!j.call(e,t))return;if(_)return _(e,t).value}return e[t]},G=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=K(s,n),s!==(i=K(t,n))&&(c&&i&&($(i)||(o=U(i)))?(o?(o=!1,a=r&&U(r)?r:[]):a=r&&$(r)?r:{},W(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&W(s,{name:n,newValue:i}));return s},Y=z(G);const X="center",J="bottom";var Z={NoDataExist:{label:"NoDataExist",alignment:X,default:!0},OnlyNanData:{label:"OnlyNanData",alignment:X,default:!0},OnlyNegativeOrZeroValues:{label:"OnlyNegativeOrZeroValues",alignment:X,default:!1},LimitedData:{label:"LimitedData",alignment:J,default:!1},OnlyNanColor:{label:"OnlyNanColor",alignment:J,default:!1},NegativeOrZeroValues:{label:"NegativeOrZeroValues",alignment:J,default:!1},DataRangeIncludingZero:{label:"DataRangeIncludingZero",alignment:J,default:!1}};const Q=[["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}]],ee={};Q.forEach((([e,{width:t,height:n}])=>{ee[e]={width:t,height:n}}));const te={getLayoutModes:()=>ee,getLayoutMode(e,t){let n;for(n=0;n<Q.length;++n)if(e>=Q[n][1].width&&t>=Q[n][1].height)return Q[n][0];return"SPARK"}};function ne(e,t){return{layoutModes:te.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 re=["$date","$timestamp","$time"],ie=["D","TS","T"],oe={hasTimeTag:e=>!!(e&&e.qTags&&e.qTags.some((e=>re.some((t=>t===e))))),hasUnknownFormat:e=>!(!e||!e.qNumFormat||"U"!==e.qNumFormat.qType),hasTimeFormat:e=>!!(e&&e.qNumFormat&&ie.some((t=>t===e.qNumFormat.qType))),isTimeDimension:(e,t)=>!!(e&&t&&(oe.hasTimeTag(t)&&oe.hasUnknownFormat(t)||oe.hasTimeFormat(t))),isTime:(e,t)=>!!(t&&t.qHyperCube.qDimensionInfo&&t.qHyperCube.qDimensionInfo.length)&&(e&&oe.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,r;const i=null==e||null===(t=e.qHyperCube)||void 0===t||null===(n=t.qDimensionInfo)||void 0===n?void 0:n.filter((e=>{var t;return 7005!==(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)}));return!((null!==(r=null==i?void 0:i.length)&&void 0!==r?r:0)<1)&&oe.canBeContinuousDimension(i[0])},maxNumberOfLines:12},ae=/^[A-Z][A-z0-9_]*$/i,se={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||ae.test(e)?e:`[${e.replace(/\]/g,"]]")}]`,t},deleteUndefinedProperties:e=>{Object.keys(e).forEach((t=>{void 0===e[t]&&delete e[t]}))},shouldUseFormat:e=>!e.isCustomFormatted&&(e.qIsAutoFormat||"U"===e.qNumFormat.qType)},le=e=>se.getValue(e,"qHyperCube.qDimensionInfo",[]),ue=e=>se.getValue(e,"qHyperCube.qMeasureInfo",[]),ce=e=>se.getValue(e,"barGrouping.grouping"),de={continuous:(e,t=!1)=>!!oe.canBeContinuous(e)&&(se.getValue(e,"dimensionAxis.continuousAuto")?"function"==typeof t?t():t:!!e.preferContinuousAxis),dimensionless:e=>!le(e).length,grouped(e){return!this.dimensionless(e)&&"grouped"===ce(e)&&(le(e).length>1||ue(e).length>1)&&!this.continuous(e)},groupedByDimension(e){return this.grouped(e)&&le(e).length>1&&1===ue(e).length},groupedByMeasure(e){return this.grouped(e)&&1===le(e).length&&ue(e).length>1},stacked(e){return(!this.dimensionless(e)&&"grouped"!==ce(e)||this.continuous(e))&&(le(e).length>1||ue(e).length>1)},stackedByDimension(e){return this.stacked(e)&&le(e).length>1&&1===ue(e).length},stackedByMeasure(e){return this.stacked(e)&&1===le(e).length&&ue(e).length>1},simple:e=>0===le(e).length||1===le(e).length&&1===ue(e).length,snapshot:e=>!!se.getValue(e,"snapshotData")};function me(e,t){const n=e.component(t);return n&&n._DO_NOT_USE_getInfo&&n._DO_NOT_USE_getInfo().offset}const fe=e=>{throw e.isHandled=!0,e};const pe={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?pe.getVerticalDock(t):n?pe.getOppositeDock(pe.getHorizontalDock(t)):pe.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 he=(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 ge={stringWidthOverMWidth:e=>(12*Math.min(e,3)+6.384615384615385*Math.max(e-3,0))/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=ge.getCharacterRatios(e[n]),r.latin+=i.latin,r.cjk+=i.cjk})):e.forEach((e=>{i=ge.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=ge.getTotalCharacterRatios(t,n,r),o=i.latinRatio*e,a=i.cjkRatio*e;return Math.ceil(ge.stringWidthOverMWidth(o)+1.0909090909090908*a)}},ye="#la-vie-tooltip";function ve(){if(!document.querySelector(ye)){const e=document.createElement("div");e.id="la-vie-tooltip",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 be({key:e="tooltip",rtl:t}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){ve()},beforeUpdate(){ve()},destroyed(){!function(){const e=document.querySelector(ye);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(ye),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 xe=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),qe=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),Me=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),Se={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),isLtrChar:e=>xe.test(e),isRtlChar:e=>qe.test(e)||Me.test(e),detectTextDirection(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],Se.isLtrChar(r))return"ltr";if(Se.isRtlChar(r))return"rtl"}return"ltr"}},De={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?De.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=Se.detectTextDirection(e.title);return[{content:e.title,style:{"font-weight":"bold","text-align":t?"right":"left",direction:n},colspan:2},{}]},getDescriptionRow(e,t){const n=Se.detectTextDirection(e.value);return[{content:e.value,style:{"text-align":t?"right":"left",direction:n},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:Se.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=Se.detectTextDirection(t.color.label),i=n?[":",t.color.label]:[t.color.label,":"],o=Se.detectTextDirection(t.color.value);return[{content:i,style:{"text-align":n?"right":"left",direction:r}},{content:n?[t.color.value,De.getColorSymbol(e,t)]:[De.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=Se.detectTextDirection(e.label),a=r?[":",e.label]:[e.label,":"],s=Se.detectTextDirection(e.value);let l;return l=i?r?[e.value,De.getColorSymbol(t,n)]:[De.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 Ce(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function we(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Le(){}var Ee=.7,Te=1/Ee,Ae="\\s*([+-]?\\d+)\\s*",Ne="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ke="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Oe=/^#([0-9a-f]{3,8})$/,Ie=new RegExp(`^rgb\\(${Ae},${Ae},${Ae}\\)$`),Pe=new RegExp(`^rgb\\(${ke},${ke},${ke}\\)$`),Re=new RegExp(`^rgba\\(${Ae},${Ae},${Ae},${Ne}\\)$`),Fe=new RegExp(`^rgba\\(${ke},${ke},${ke},${Ne}\\)$`),He=new RegExp(`^hsl\\(${Ne},${ke},${ke}\\)$`),ze=new RegExp(`^hsla\\(${Ne},${ke},${ke},${Ne}\\)$`),je={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 Be(){return this.rgb().formatHex()}function Ve(){return this.rgb().formatRgb()}function _e(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Oe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Ue(t):3===n?new Ke(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?$e(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?$e(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=Ie.exec(e))?new Ke(t[1],t[2],t[3],1):(t=Pe.exec(e))?new Ke(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Re.exec(e))?$e(t[1],t[2],t[3],t[4]):(t=Fe.exec(e))?$e(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=He.exec(e))?Qe(t[1],t[2]/100,t[3]/100,1):(t=ze.exec(e))?Qe(t[1],t[2]/100,t[3]/100,t[4]):je.hasOwnProperty(e)?Ue(je[e]):"transparent"===e?new Ke(NaN,NaN,NaN,0):null}function Ue(e){return new Ke(e>>16&255,e>>8&255,255&e,1)}function $e(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ke(e,t,n,r)}function We(e){return e instanceof Le||(e=_e(e)),e?new Ke((e=e.rgb()).r,e.g,e.b,e.opacity):new Ke}function Ke(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Ge(){return`#${Ze(this.r)}${Ze(this.g)}${Ze(this.b)}`}function Ye(){const e=Xe(this.opacity);return`${1===e?"rgb(":"rgba("}${Je(this.r)}, ${Je(this.g)}, ${Je(this.b)}${1===e?")":`, ${e})`}`}function Xe(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Je(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ze(e){return((e=Je(e))<16?"0":"")+e.toString(16)}function Qe(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new tt(e,t,n,r)}function et(e){if(e instanceof tt)return new tt(e.h,e.s,e.l,e.opacity);if(e instanceof Le||(e=_e(e)),!e)return new tt;if(e instanceof tt)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 tt(a,s,l,e.opacity)}function tt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function nt(e){return(e=(e||0)%360)<0?e+360:e}function rt(e){return Math.max(0,Math.min(1,e||0))}function it(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Ce(Le,_e,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Be,formatHex:Be,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return et(this).formatHsl()},formatRgb:Ve,toString:Ve}),Ce(Ke,(function(e,t,n,r){return 1===arguments.length?We(e):new Ke(e,t,n,null==r?1:r)}),we(Le,{brighter(e){return e=null==e?Te:Math.pow(Te,e),new Ke(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Ee:Math.pow(Ee,e),new Ke(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ke(Je(this.r),Je(this.g),Je(this.b),Xe(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:Ge,formatHex:Ge,formatHex8:function(){return`#${Ze(this.r)}${Ze(this.g)}${Ze(this.b)}${Ze(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ye,toString:Ye})),Ce(tt,(function(e,t,n,r){return 1===arguments.length?et(e):new tt(e,t,n,null==r?1:r)}),we(Le,{brighter(e){return e=null==e?Te:Math.pow(Te,e),new tt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Ee:Math.pow(Ee,e),new tt(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 Ke(it(e>=240?e-240:e+120,i,r),it(e,i,r),it(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new tt(nt(this.h),rt(this.s),rt(this.l),Xe(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=Xe(this.opacity);return`${1===e?"hsl(":"hsla("}${nt(this.h)}, ${100*rt(this.s)}%, ${100*rt(this.l)}%${1===e?")":`, ${e})`}`}}));const ot=Math.PI/180,at=180/Math.PI,st=.96422,lt=1,ut=.82521,ct=4/29,dt=6/29,mt=3*dt*dt,ft=dt*dt*dt;function pt(e){if(e instanceof ht)return new ht(e.l,e.a,e.b,e.opacity);if(e instanceof qt)return Mt(e);e instanceof Ke||(e=We(e));var t,n,r=bt(e.r),i=bt(e.g),o=bt(e.b),a=gt((.2225045*r+.7168786*i+.0606169*o)/lt);return r===i&&i===o?t=n=a:(t=gt((.4360747*r+.3850649*i+.1430804*o)/st),n=gt((.0139322*r+.0971045*i+.7141733*o)/ut)),new ht(116*a-16,500*(t-a),200*(a-n),e.opacity)}function ht(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function gt(e){return e>ft?Math.pow(e,1/3):e/mt+ct}function yt(e){return e>dt?e*e*e:mt*(e-ct)}function vt(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function bt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function xt(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof qt)return new qt(e.h,e.c,e.l,e.opacity);if(e instanceof ht||(e=pt(e)),0===e.a&&0===e.b)return new qt(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*at;return new qt(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new qt(e,t,n,null==r?1:r)}function qt(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Mt(e){if(isNaN(e.h))return new ht(e.l,0,0,e.opacity);var t=e.h*ot;return new ht(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Ce(ht,(function(e,t,n,r){return 1===arguments.length?pt(e):new ht(e,t,n,null==r?1:r)}),we(Le,{brighter(e){return new ht(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new ht(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 Ke(vt(3.1338561*(t=st*yt(t))-1.6168667*(e=lt*yt(e))-.4906146*(n=ut*yt(n))),vt(-.9787684*t+1.9161415*e+.033454*n),vt(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Ce(qt,xt,we(Le,{brighter(e){return new qt(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new qt(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Mt(this).rgb()}}));var St={isDark:function(e){return xt(e).l<70}};function Dt(e){const t=e.qDef;!0===t.autoSort&&t.qSortCriterias.forEach((e=>{e.qSortByNumeric=1,e.qSortByAscii=1}))}function Ct(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function wt(e){return 1===e.length&&(e=function(e){return function(t,n){return Ct(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 Lt=wt(Ct).right,Et=Math.sqrt(50),Tt=Math.sqrt(10),At=Math.sqrt(2);function Nt(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>=Et?10:o>=Tt?5:o>=At?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=Et?10:o>=Tt?5:o>=At?2:1)}function kt(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>=Et?i*=10:o>=Tt?i*=5:o>=At&&(i*=2),t<e?-i:i}function Ot(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var It="$";function Pt(){}function Rt(e,t){var n=new Pt;if(e instanceof Pt)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 Ft(){}Pt.prototype=Rt.prototype={constructor:Pt,has:function(e){return It+e in this},get:function(e){return this[It+e]},set:function(e,t){return this[It+e]=t,this},remove:function(e){var t=It+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===It&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===It&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===It&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===It&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===It&&++e;return e},empty:function(){for(var e in this)if(e[0]===It)return!1;return!0},each:function(e){for(var t in this)t[0]===It&&e(this[t],t.slice(1),this)}};var Ht=Rt.prototype;Ft.prototype={constructor:Ft,has:Ht.has,add:function(e){return this[It+(e+="")]=e,this},remove:Ht.remove,clear:Ht.clear,values:Ht.keys,size:Ht.size,empty:Ht.empty,each:Ht.each};var zt=Array.prototype,jt=zt.map,Bt=zt.slice;function Vt(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _t(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ut(){}var $t=.7,Wt=1/$t,Kt="\\s*([+-]?\\d+)\\s*",Gt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Yt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xt=/^#([0-9a-f]{3})$/,Jt=/^#([0-9a-f]{6})$/,Zt=new RegExp("^rgb\\("+[Kt,Kt,Kt]+"\\)$"),Qt=new RegExp("^rgb\\("+[Yt,Yt,Yt]+"\\)$"),en=new RegExp("^rgba\\("+[Kt,Kt,Kt,Gt]+"\\)$"),tn=new RegExp("^rgba\\("+[Yt,Yt,Yt,Gt]+"\\)$"),nn=new RegExp("^hsl\\("+[Gt,Yt,Yt]+"\\)$"),rn=new RegExp("^hsla\\("+[Gt,Yt,Yt,Gt]+"\\)$"),on={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 an(e){var t;return e=(e+"").trim().toLowerCase(),(t=Xt.exec(e))?new dn((t=parseInt(t[1],16))>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):(t=Jt.exec(e))?sn(parseInt(t[1],16)):(t=Zt.exec(e))?new dn(t[1],t[2],t[3],1):(t=Qt.exec(e))?new dn(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=en.exec(e))?ln(t[1],t[2],t[3],t[4]):(t=tn.exec(e))?ln(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=nn.exec(e))?fn(t[1],t[2]/100,t[3]/100,1):(t=rn.exec(e))?fn(t[1],t[2]/100,t[3]/100,t[4]):on.hasOwnProperty(e)?sn(on[e]):"transparent"===e?new dn(NaN,NaN,NaN,0):null}function sn(e){return new dn(e>>16&255,e>>8&255,255&e,1)}function ln(e,t,n,r){return r<=0&&(e=t=n=NaN),new dn(e,t,n,r)}function un(e){return e instanceof Ut||(e=an(e)),e?new dn((e=e.rgb()).r,e.g,e.b,e.opacity):new dn}function cn(e,t,n,r){return 1===arguments.length?un(e):new dn(e,t,n,null==r?1:r)}function dn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function mn(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function fn(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new pn(e,t,n,r)}function pn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function hn(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Vt(Ut,an,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),Vt(dn,cn,_t(Ut,{brighter:function(e){return e=null==e?Wt:Math.pow(Wt,e),new dn(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?$t:Math.pow($t,e),new dn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+mn(this.r)+mn(this.g)+mn(this.b)},toString:function(){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+")")}})),Vt(pn,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof pn)return new pn(e.h,e.s,e.l,e.opacity);if(e instanceof Ut||(e=an(e)),!e)return new pn;if(e instanceof pn)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 pn(a,s,l,e.opacity)}(e):new pn(e,t,n,null==r?1:r)}),_t(Ut,{brighter:function(e){return e=null==e?Wt:Math.pow(Wt,e),new pn(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?$t:Math.pow($t,e),new pn(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 dn(hn(e>=240?e-240:e+120,i,r),hn(e,i,r),hn(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}}));var gn=Math.PI/180,yn=180/Math.PI,vn=.96422,bn=1,xn=.82521,qn=4/29,Mn=6/29,Sn=3*Mn*Mn,Dn=Mn*Mn*Mn;function Cn(e){if(e instanceof wn)return new wn(e.l,e.a,e.b,e.opacity);if(e instanceof Nn){if(isNaN(e.h))return new wn(e.l,0,0,e.opacity);var t=e.h*gn;return new wn(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}e instanceof dn||(e=un(e));var n,r,i=An(e.r),o=An(e.g),a=An(e.b),s=Ln((.2225045*i+.7168786*o+.0606169*a)/bn);return i===o&&o===a?n=r=s:(n=Ln((.4360747*i+.3850649*o+.1430804*a)/vn),r=Ln((.0139322*i+.0971045*o+.7141733*a)/xn)),new wn(116*s-16,500*(n-s),200*(s-r),e.opacity)}function wn(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Ln(e){return e>Dn?Math.pow(e,1/3):e/Sn+qn}function En(e){return e>Mn?e*e*e:Sn*(e-qn)}function Tn(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function An(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Nn(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}Vt(wn,(function(e,t,n,r){return 1===arguments.length?Cn(e):new wn(e,t,n,null==r?1:r)}),_t(Ut,{brighter:function(e){return new wn(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new wn(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){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 dn(Tn(3.1338561*(t=vn*En(t))-1.6168667*(e=bn*En(e))-.4906146*(n=xn*En(n))),Tn(-.9787684*t+1.9161415*e+.033454*n),Tn(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Vt(Nn,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Nn)return new Nn(e.h,e.c,e.l,e.opacity);if(e instanceof wn||(e=Cn(e)),0===e.a&&0===e.b)return new Nn(NaN,0,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*yn;return new Nn(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Nn(e,t,n,null==r?1:r)}),_t(Ut,{brighter:function(e){return new Nn(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new Nn(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return Cn(this).rgb()}}));var kn=-.14861,On=1.78277,In=-.29227,Pn=-.90649,Rn=1.97294,Fn=Rn*Pn,Hn=Rn*On,zn=On*In-Pn*kn;function jn(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Bn)return new Bn(e.h,e.s,e.l,e.opacity);e instanceof dn||(e=un(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(zn*r+Fn*t-Hn*n)/(zn+Fn-Hn),o=r-i,a=(Rn*(n-i)-In*o)/Pn,s=Math.sqrt(a*a+o*o)/(Rn*i*(1-i)),l=s?Math.atan2(a,o)*yn-120:NaN;return new Bn(l<0?l+360:l,s,i,e.opacity)}(e):new Bn(e,t,n,null==r?1:r)}function Bn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Vn(e){return function(){return e}}function _n(e,t){return function(n){return e+n*t}}function Un(e){return 1==(e=+e)?$n: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):Vn(isNaN(t)?n:t)}}function $n(e,t){var n=t-e;return n?_n(e,n):Vn(isNaN(e)?t:e)}Vt(Bn,jn,_t(Ut,{brighter:function(e){return e=null==e?Wt:Math.pow(Wt,e),new Bn(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?$t:Math.pow($t,e),new Bn(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=isNaN(this.h)?0:(this.h+120)*gn,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new dn(255*(t+n*(kn*r+On*i)),255*(t+n*(In*r+Pn*i)),255*(t+n*(Rn*r)),this.opacity)}}));var Wn=function e(t){var n=Un(t);function r(e,t){var r=n((e=cn(e)).r,(t=cn(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=$n(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 Kn(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]=er(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 Gn(e,t){var n=new Date;return t-=e=+e,function(r){return n.setTime(e+t*r),n}}function Yn(e,t){return t-=e=+e,function(n){return e+t*n}}function Xn(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]=er(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var Jn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Zn=new RegExp(Jn.source,"g");function Qn(e,t){var n,r,i,o=Jn.lastIndex=Zn.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=Jn.exec(e))&&(r=Zn.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:Yn(n,r)})),o=Zn.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 er(e,t){var n,r=typeof t;return null==t||"boolean"===r?Vn(t):("number"===r?Yn:"string"===r?(n=an(t))?(t=n,Wn):Qn:t instanceof an?Wn:t instanceof Date?Gn:Array.isArray(t)?Kn:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Xn:Yn)(e,t)}function tr(e,t){return t-=e=+e,function(n){return Math.round(e+t*n)}}function nr(e){return function t(n){function r(t,r){var i=e((t=jn(t)).h,(r=jn(r)).h),o=$n(t.s,r.s),a=$n(t.l,r.l),s=$n(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=o(e),t.l=a(Math.pow(e,n)),t.opacity=s(e),t+""}}return n=+n,r.gamma=t,r}(1)}function rr(e){return+e}nr((function(e,t){var n=t-e;return n?_n(e,n>180||n<-180?n-360*Math.round(n/360):n):Vn(isNaN(e)?t:e)})),nr($n);var ir=[0,1];function or(e){return e}function ar(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function sr(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 lr(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=ar(i,r),o=n(a,o)):(r=ar(r,i),o=n(o,a)),function(e){return o(r(e))}}function ur(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]=ar(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=Lt(e,t,1,r)-1;return o[n](i[n](t))}}function cr(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function dr(e,t){return function(){var e,t,n,r,i,o,a=ir,s=ir,l=er,u=or;function c(){return r=Math.min(a.length,s.length)>2?ur:lr,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),Yn)))(n)))},d.domain=function(e){return arguments.length?(a=jt.call(e,rr),u===or||(u=sr(a)),c()):a.slice()},d.range=function(e){return arguments.length?(s=Bt.call(e),c()):s.slice()},d.rangeRound=function(e){return s=Bt.call(e),l=tr,c()},d.clamp=function(e){return arguments.length?(u=e?sr(a):or,d):u!==or},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 mr(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function fr(e){return(e=mr(Math.abs(e)))?e[1]:NaN}var pr,hr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function gr(e){return new yr(e)}function yr(e){if(!(t=hr.exec(e)))throw new Error("invalid format: "+e);var t;this.fill=t[1]||" ",this.align=t[2]||">",this.sign=t[3]||"-",this.symbol=t[4]||"",this.zero=!!t[5],this.width=t[6]&&+t[6],this.comma=!!t[7],this.precision=t[8]&&+t[8].slice(1),this.trim=!!t[9],this.type=t[10]||""}function vr(e,t){var n=mr(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")}gr.prototype=yr.prototype,yr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var br={"%":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.round(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 vr(100*e,t)},r:vr,s:function(e,t){var n=mr(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(pr=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")+mr(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 xr(e){return e}var qr,Mr,Sr,Dr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Cr(e){var t,n,r=e.grouping&&e.thousands?(t=e.grouping,n=e.thousands,function(e,r){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}):xr,i=e.currency,o=e.decimal,a=e.numerals?function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(e.numerals):xr,s=e.percent||"%";function l(e){var t=(e=gr(e)).fill,n=e.align,l=e.sign,u=e.symbol,c=e.zero,d=e.width,m=e.comma,f=e.precision,p=e.trim,h=e.type;"n"===h?(m=!0,h="g"):br[h]||(null==f&&(f=12),p=!0,h="g"),(c||"0"===t&&"="===n)&&(c=!0,t="0",n="=");var g="$"===u?i[0]:"#"===u&&/[boxX]/.test(h)?"0"+h.toLowerCase():"",y="$"===u?i[1]:/[%p]/.test(h)?s:"",v=br[h],b=/[defgprs%]/.test(h);function x(e){var i,s,u,x=g,q=y;if("c"===h)q=v(e)+q,e="";else{var M=(e=+e)<0;if(e=v(Math.abs(e),f),p&&(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(i>0){if(!+e[r])break e;i=0}}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),M&&0==+e&&(M=!1),x=(M?"("===l?l:"-":"-"===l||"("===l?"":l)+x,q=("s"===h?Dr[8+pr/3]:"")+q+(M&&"("===l?")":""),b)for(i=-1,s=e.length;++i<s;)if(48>(u=e.charCodeAt(i))||u>57){q=(46===u?o+e.slice(i+1):e.slice(i))+q,e=e.slice(0,i);break}}m&&!c&&(e=r(e,1/0));var S=x.length+e.length+q.length,D=S<d?new Array(d-S+1).join(t):"";switch(m&&c&&(e=r(D+e,D.length?d-q.length:1/0),D=""),n){case"<":e=x+e+q+D;break;case"=":e=x+D+e+q;break;case"^":e=D.slice(0,S=D.length>>1)+x+e+q+D.slice(S);break;default:e=D+x+e+q}return a(e)}return f=null==f?6:/[gprs]/.test(h)?Math.max(1,Math.min(21,f)):Math.max(0,Math.min(20,f)),x.toString=function(){return e+""},x}return{format:l,formatPrefix:function(e,t){var n=l(((e=gr(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(fr(t)/3))),i=Math.pow(10,-r),o=Dr[8+r/3];return function(e){return n(i*e)+o}}}}function wr(e,t,n,r){var i,o=kt(e,t,n);switch((r=gr(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(fr(t)/3)))-fr(Math.abs(e)))}(o,a))||(r.precision=i),Sr(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,fr(t)-fr(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,-fr(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return Mr(r)}function Lr(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=Nt(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 wr(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=Nt(s,l,n))>0?r=Nt(s=Math.floor(s/r)*r,l=Math.ceil(l/r)*r,n):r<0&&(r=Nt(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 Er(){var e=dr(or,or);return e.copy=function(){return cr(e,Er())},Ot.apply(e,arguments),Lr(e)}qr=Cr({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),Mr=qr.format,Sr=qr.formatPrefix;var Tr=new Date,Ar=new Date;function Nr(e,t,n,r){function i(t){return e(t=new Date(+t)),t}return i.floor=i,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 Nr((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 Tr.setTime(+t),Ar.setTime(+r),e(Tr),e(Ar),Math.floor(n(Tr,Ar))},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 kr=Nr((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));kr.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?Nr((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):kr:null},kr.range;var Or=1e3,Ir=6e4,Pr=36e5,Rr=864e5,Fr=6048e5,Hr=Nr((function(e){e.setTime(Math.floor(e/Or)*Or)}),(function(e,t){e.setTime(+e+t*Or)}),(function(e,t){return(t-e)/Or}),(function(e){return e.getUTCSeconds()}));Hr.range;var zr=Nr((function(e){e.setTime(Math.floor(e/Ir)*Ir)}),(function(e,t){e.setTime(+e+t*Ir)}),(function(e,t){return(t-e)/Ir}),(function(e){return e.getMinutes()}));zr.range;var jr=Nr((function(e){var t=e.getTimezoneOffset()*Ir%Pr;t<0&&(t+=Pr),e.setTime(Math.floor((+e-t)/Pr)*Pr+t)}),(function(e,t){e.setTime(+e+t*Pr)}),(function(e,t){return(t-e)/Pr}),(function(e){return e.getHours()}));jr.range;var Br=Nr((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())*Ir)/Rr}),(function(e){return e.getDate()-1}));function Vr(e){return Nr((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())*Ir)/Fr}))}Br.range;var _r=Vr(0),Ur=Vr(1),$r=Vr(2),Wr=Vr(3),Kr=Vr(4),Gr=Vr(5),Yr=Vr(6);_r.range,Ur.range,$r.range,Wr.range,Kr.range,Gr.range,Yr.range;var Xr=Nr((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()}));Xr.range;var Jr=Nr((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?Nr((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 Zr=Nr((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+t*Ir)}),(function(e,t){return(t-e)/Ir}),(function(e){return e.getUTCMinutes()}));Zr.range;var Qr=Nr((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+t*Pr)}),(function(e,t){return(t-e)/Pr}),(function(e){return e.getUTCHours()}));Qr.range;var ei=Nr((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/Rr}),(function(e){return e.getUTCDate()-1}));function ti(e){return Nr((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)/Fr}))}ei.range;var ni=ti(0),ri=ti(1),ii=ti(2),oi=ti(3),ai=ti(4),si=ti(5),li=ti(6);ni.range,ri.range,ii.range,oi.range,ai.range,si.range,li.range;var ui=Nr((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()}));ui.range;var ci=Nr((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 di(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 mi(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 fi(e){return{y:e,m:0,d:1,H:0,M:0,S:0,L:0}}ci.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Nr((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},ci.range;var pi,hi,gi,yi={"-":"",_:" ",0:"0"},vi=/^\s*\d+/,bi=/^%/,xi=/[\\^$*+?|[\]().{}]/g;function qi(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 Mi(e){return e.replace(xi,"\\$&")}function Si(e){return new RegExp("^(?:"+e.map(Mi).join("|")+")","i")}function Di(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function Ci(e,t,n){var r=vi.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function wi(e,t,n){var r=vi.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Li(e,t,n){var r=vi.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Ei(e,t,n){var r=vi.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Ti(e,t,n){var r=vi.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Ai(e,t,n){var r=vi.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Ni(e,t,n){var r=vi.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ki(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 Oi(e,t,n){var r=vi.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Ii(e,t,n){var r=vi.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Pi(e,t,n){var r=vi.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Ri(e,t,n){var r=vi.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Fi(e,t,n){var r=vi.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Hi(e,t,n){var r=vi.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function zi(e,t,n){var r=vi.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function ji(e,t,n){var r=vi.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Bi(e,t,n){var r=bi.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Vi(e,t,n){var r=vi.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function _i(e,t,n){var r=vi.exec(t.slice(n));return r?(e.Q=1e3*+r[0],n+r[0].length):-1}function Ui(e,t){return qi(e.getDate(),t,2)}function $i(e,t){return qi(e.getHours(),t,2)}function Wi(e,t){return qi(e.getHours()%12||12,t,2)}function Ki(e,t){return qi(1+Br.count(Jr(e),e),t,3)}function Gi(e,t){return qi(e.getMilliseconds(),t,3)}function Yi(e,t){return Gi(e,t)+"000"}function Xi(e,t){return qi(e.getMonth()+1,t,2)}function Ji(e,t){return qi(e.getMinutes(),t,2)}function Zi(e,t){return qi(e.getSeconds(),t,2)}function Qi(e){var t=e.getDay();return 0===t?7:t}function eo(e,t){return qi(_r.count(Jr(e),e),t,2)}function to(e,t){var n=e.getDay();return e=n>=4||0===n?Kr(e):Kr.ceil(e),qi(Kr.count(Jr(e),e)+(4===Jr(e).getDay()),t,2)}function no(e){return e.getDay()}function ro(e,t){return qi(Ur.count(Jr(e),e),t,2)}function io(e,t){return qi(e.getFullYear()%100,t,2)}function oo(e,t){return qi(e.getFullYear()%1e4,t,4)}function ao(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+qi(t/60|0,"0",2)+qi(t%60,"0",2)}function so(e,t){return qi(e.getUTCDate(),t,2)}function lo(e,t){return qi(e.getUTCHours(),t,2)}function uo(e,t){return qi(e.getUTCHours()%12||12,t,2)}function co(e,t){return qi(1+ei.count(ci(e),e),t,3)}function mo(e,t){return qi(e.getUTCMilliseconds(),t,3)}function fo(e,t){return mo(e,t)+"000"}function po(e,t){return qi(e.getUTCMonth()+1,t,2)}function ho(e,t){return qi(e.getUTCMinutes(),t,2)}function go(e,t){return qi(e.getUTCSeconds(),t,2)}function yo(e){var t=e.getUTCDay();return 0===t?7:t}function vo(e,t){return qi(ni.count(ci(e),e),t,2)}function bo(e,t){var n=e.getUTCDay();return e=n>=4||0===n?ai(e):ai.ceil(e),qi(ai.count(ci(e),e)+(4===ci(e).getUTCDay()),t,2)}function xo(e){return e.getUTCDay()}function qo(e,t){return qi(ri.count(ci(e),e),t,2)}function Mo(e,t){return qi(e.getUTCFullYear()%100,t,2)}function So(e,t){return qi(e.getUTCFullYear()%1e4,t,4)}function Do(){return"+0000"}function Co(){return"%"}function wo(e){return+e}function Lo(e){return Math.floor(+e/1e3)}!function(e){pi=function(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,u=Si(i),c=Di(i),d=Si(o),m=Di(o),f=Si(a),p=Di(a),h=Si(s),g=Di(s),y=Si(l),v=Di(l),b={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:Ui,e:Ui,f:Yi,H:$i,I:Wi,j:Ki,L:Gi,m:Xi,M:Ji,p:function(e){return i[+(e.getHours()>=12)]},Q:wo,s:Lo,S:Zi,u:Qi,U:eo,V:to,w:no,W:ro,x:null,X:null,y:io,Y:oo,Z:ao,"%":Co},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:so,e:so,f:fo,H:lo,I:uo,j:co,L:mo,m:po,M:ho,p:function(e){return i[+(e.getUTCHours()>=12)]},Q:wo,s:Lo,S:go,u:yo,U:vo,V:bo,w:xo,W:qo,x:null,X:null,y:Mo,Y:So,Z:Do,"%":Co},q={a:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=m[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return D(e,t,n,r)},d:Ii,e:Ii,f:ji,H:Ri,I:Ri,j:Pi,L:zi,m:Oi,M:Fi,p:function(e,t,n){var r=u.exec(t.slice(n));return r?(e.p=c[r[0].toLowerCase()],n+r[0].length):-1},Q:Vi,s:_i,S:Hi,u:wi,U:Li,V:Ei,w:Ci,W:Ti,x:function(e,t,r){return D(e,n,t,r)},X:function(e,t,n){return D(e,r,t,n)},y:Ni,Y:Ai,Z:ki,"%":Bi};function M(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,u=e.length;for(n instanceof Date||(n=new Date(+n));++s<u;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=yi[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function S(e,t){return function(n){var r,i,o=fi(1900);if(D(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("p"in o&&(o.H=o.H%12+12*o.p),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=mi(fi(o.y))).getUTCDay(),r=i>4||0===i?ri.ceil(r):ri(r),r=ei.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=t(fi(o.y))).getDay(),r=i>4||0===i?Ur.ceil(r):Ur(r),r=Br.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?mi(fi(o.y)).getUTCDay():t(fi(o.y)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,mi(o)):t(o)}}function D(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a<s;){if(r>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=q[i in yi?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=M(n,b),b.X=M(r,b),b.c=M(t,b),x.x=M(n,x),x.X=M(r,x),x.c=M(t,x),{format:function(e){var t=M(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=S(e+="",di);return t.toString=function(){return e},t},utcFormat:function(e){var t=M(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=S(e,mi);return t.toString=function(){return e},t}}}(e),pi.format,pi.parse,hi=pi.utcFormat,gi=pi.utcParse}({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"]});var Eo="%Y-%m-%dT%H:%M:%S.%LZ";Date.prototype.toISOString||hi(Eo),+new Date("2000-01-01T00:00:00.000Z")||gi(Eo);var To=1e3,Ao=60*To,No=60*Ao,ko=24*No,Oo=7*ko,Io=30*ko,Po=365*ko;function Ro(e){return new Date(e)}function Fo(e){return e instanceof Date?+e:+new Date(+e)}function Ho(e,t,n,r,i,o,a,s,l){var u=dr(or,or),c=u.invert,d=u.domain,m=l(".%L"),f=l(":%S"),p=l("%I:%M"),h=l("%I %p"),g=l("%a %d"),y=l("%b %d"),v=l("%B"),b=l("%Y"),x=[[a,1,To],[a,5,5*To],[a,15,15*To],[a,30,30*To],[o,1,Ao],[o,5,5*Ao],[o,15,15*Ao],[o,30,30*Ao],[i,1,No],[i,3,3*No],[i,6,6*No],[i,12,12*No],[r,1,ko],[r,2,2*ko],[n,1,Oo],[t,1,Io],[t,3,3*Io],[e,1,Po]];function q(s){return(a(s)<s?m:o(s)<s?f:i(s)<s?p:r(s)<s?h:t(s)<s?n(s)<s?g:y:e(s)<s?v:b)(s)}function M(t,n,r,i){if(null==t&&(t=10),"number"==typeof t){var o=Math.abs(r-n)/t,a=wt((function(e){return e[2]})).right(x,o);a===x.length?(i=kt(n/Po,r/Po,t),t=e):a?(i=(a=x[o/x[a-1][2]<x[a][2]/o?a-1:a])[1],t=a[0]):(i=Math.max(kt(n,r,t),1),t=s)}return null==i?t:t.every(i)}return u.invert=function(e){return new Date(c(e))},u.domain=function(e){return arguments.length?d(jt.call(e,Fo)):d().map(Ro)},u.ticks=function(e,t){var n,r=d(),i=r[0],o=r[r.length-1],a=o<i;return a&&(n=i,i=o,o=n),n=(n=M(e,i,o,t))?n.range(i,o+1):[],a?n.reverse():n},u.tickFormat=function(e,t){return null==t?q:l(t)},u.nice=function(e,t){var n=d();return(e=M(e,n[0],n[n.length-1],t))?d(function(e,t){var n,r=0,i=(e=e.slice()).length-1,o=e[r],a=e[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),e[r]=t.floor(o),e[i]=t.ceil(a),e}(n,e)):u},u.copy=function(){return cr(u,Ho(e,t,n,r,i,o,a,s,l))},u}function zo(){return Ot.apply(Ho(ci,ui,ni,ei,Qr,Zr,Hr,kr,hi).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}const jo={horizontal:{major:"width",minor:"height",start:"left",end:"right",shadow:{startOffset:"12px 0",endOffset:"-12px 0"}},vertical:{major:"height",minor:"width",start:"top",end:"bottom",shadow:{startOffset:"0 12px",endOffset:"0 -12px"}}},Bo=e=>`${e} 12px -12px inset rgba(0, 0, 0, 0.0625)`;var Vo={defaultSettings:{settings:{orientation:"horizontal",rtl:!1,range:()=>[0,1]}},renderer:"dom",render(e){const{range:t,orientation:n,rtl:r}=this.settings.settings,[i,o]=t(),a=Math.abs(i)<1e-15,s=Math.abs(o-1)<1e-15,l=(e=>{const t=jo[e];return{base:{position:"absolute",[t.major]:12,[t.minor]:"100%"},towardsStart:{[t.start]:0,[t.end]:"auto",boxShadow:Bo(t.shadow.startOffset)},towardsEnd:{[t.start]:"auto",[t.end]:0,boxShadow:Bo(t.shadow.endOffset)}}})(n),u="horizontal"===n&&r,c=[];return a||c.push(e("div",{style:{...l.base,...u?l.towardsEnd:l.towardsStart},class:"scroll-hint--towards-start"})),s||c.push(e("div",{style:{...l.base,...u?l.towardsStart:l.towardsEnd},class:"scroll-hint--towards-end"})),c}};function _o({viewState:e,viewCache:t,layoutService:n,dockService:r,rtl:i}){return!n.meta.isSnapshot&&{key:"scroll-hint",type:"scroll-hint",settings:{orientation:r.meta.major.orientation,rtl:i,range:()=>function({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),r=t.get("continuousMin"),i=t.get("continuousMax");return[(n.min-r)/(i-r),(n.max-r)/(i-r)]}(t,n):function(e){return e.get("viewRange")}(t)}({layoutService:n,viewState:e,viewCache:t})}}}let Uo;function $o(){Uo=Uo||document.createElement("canvas").getContext("2d")}const Wo={measureTextWidth(e){$o();const{width:t}=Uo.measureText(e);return t},lineWrap(e,t,n,r){let i,o;$o();const a=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,u,c,d,m=e?e.split(/\s+/):[],f=a[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof r&&a.length>=r)return a.slice(0,r);for(n&&(Uo.font=n),o=0;o<a.length;o++){for(d=a[o]||"",m=d.split(/\s+/),[f]=m,c="",i=1;i<m.length;i++)if(l=`${f} ${m[i]}`,u=Wo.measureTextWidth(l),u>t&&("number"!=typeof r||r>s.length)?(s.push(f),f=m[i]):f=l,"number"==typeof r&&s.length>=r){c=m.slice(i+1).join(" ");break}"number"!=typeof r||s.length<r?s.push(f):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]||""} ${f} ${c}`}return s},wordWrap(e,t,n,r,i){if($o(),!e||!e.length)return[];n&&(Uo.font=n);let o=[];const a=e.slice();let s,l,u,c;if(a.filter((e=>!!e)),"number"!=typeof t||t<0)return e.slice();for(c=0;c<a.length;c++)u=a[c],l=null,u&&(u.length<=1||Wo.measureTextWidth(u)<=t?o.push(u):(s=Wo.splitWord(u,t,void 0,r-o.length),s.length<=1?o.push(s[0]):(l=s.pop(),o=o.concat(s),a[c+1]?Wo.measureTextWidth(`${l} ${a[c+1]}`)>t&&o.length+a.length-c<=r?a.splice(c+1,0,l):a[c+1]=`${l} ${a[c+1]}`:a.push(l))));return o.forEach(((e,t,n)=>{n[t]=e?e.trim():e})),o.length>r?(o=o.splice(0,r),o[o.length-1]=Wo.truncate(o[o.length-1],t,n,i).text):(u=o[o.length-1],u&&u.length>1&&Wo.measureTextWidth(u)>t&&(o[o.length-1]=Wo.truncate(u,t,n,i).text)),o},truncate(e,t,n,r="…"){$o();let i,o,a,s,l=e;const u=Wo.measureTextWidth("i"),c=Math.ceil(t/u);if(n&&(Uo.font=n),e&&t){if(Wo.measureTextWidth(l)>t){for(i=Math.min(c,l.length);i>0;i--)if(o=l.substring(0,i-1),a=o.trim()+r,Wo.measureTextWidth(a)<=t){s=l.substring(i-1),l=a;break}i||(s=l,l="…")}}else s=void 0;return{text:l,rest:s}},isNumber:e=>"number"==typeof e&&Number.isFinite(e),explodeWord(e,t,n,r){let i;$o();let o,a=e,s="",l=[];if(Wo.isNumber(n)&&n<=1)return[e];const u=Math.ceil(t/r);for(i=Math.min(e.length,u);i>0&&(a=e.substring(0,i),o=e.substring(i-1,i)," "===o?a=e.substring(0,i-1):a+="-",s=e.substring(i),!(Wo.measureTextWidth(a)<=t));i--);return(!i&&!a||Wo.measureTextWidth(a)>t)&&(a=e.substring(0,1),s=e.substring(1)),l.push(a),s?(Wo.measureTextWidth(s)>t?(s=Wo.explodeWord(s,t,n-1,r),l=l.concat(s)):l.push(s),l.filter((e=>""!==e.trim()))):l},splitWord:(e,t,n,r)=>($o(),e&&t?(n&&(Uo.font=n),Wo.explodeWord(e,t,r,Math.max(1,Wo.measureTextWidth("i")))):[]),wrapText(e,t,n,r,i){let o;return Number.isNaN(t)?[e]:(o=r>1?Wo.lineWrap(e,t,n,r):[e],o=Wo.wordWrap(o,t,n,r,i),o)},getFontHeight:e=>($o(),e&&(Uo.font=e),1.5*Wo.measureTextWidth("m")),tokenize(e,t,n,r,i,o,a=1){$o(),t&&(Uo.font=t);const s=Wo.getFontHeight(),l=a*s;let u=[],c=0,d=[];if(o<s)return[];const m=o?Math.max(1,Math.floor(o/l)):r||1;return Array.isArray(r)?(r.forEach((e=>{c+=Number.isNaN(e)||e<=0?0:e})),r.forEach((e=>{u.push(Number.isNaN(e)||e<=0?m-c:e)}))):u=[Number.isNaN(r)||r<=0?m:Math.min(m,r)],Array.isArray(e)?e.forEach(((e,n)=>{d.length<m&&(d=d.concat(Wo.wrapText(e,i,t,u[n])))})):d=Wo.wrapText(e,i,t,u[0],n),d}},Ko={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:r,rendHeight:i,flipXY:o,symbol:a}){let s="x",l="y",u=r,c=i,d=t<.5?90:-90;return o&&(s="y",l="x",u=i,c=r,d=t<.5?180:0),a(Y({},e,{[s]:n*u,[l]:Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}},Go=Y.bind(null,!0),Yo={},{isArray:Xo}=Array;function Jo(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function Zo(e){return void 0===e}function Qo(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function ea(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach(((t,i)=>{if(i===n.length)return;r=+t;const o=isNaN(r)?{}:[];e[r||t]=Zo(e[r||t])?o:e[t],e=e[r||t]})),e}function ta(e,t){let n=!0;if(Jo(e)&&Jo(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((r=>{ta(e[r],t[r])||(n=!1)})),n);if(Xo(e)&&Xo(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n+=1)if(!ta(e[n],t[n]))return!1;return!0}return e===t}Yo.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach((i=>{const o=function(e){return e?Go({},{val:e}).val:e}(t[i]),a=e[i],s=`${n}/${i}`;ta(o,a)||Qo(t,i)||(Zo(a)?r.push({op:"add",path:s,value:o}):Jo(o)&&Jo(a)?r=r.concat(Yo.generate(a,o,s)):Xo(o)&&Xo(a)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o=-1;function a(e,t,n){if(e[n]&&Zo(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,r=e.length;n<r;n+=1)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(ta(t,i))return r;if(!Zo(t[0])&&Zo(t[0].qInfo)||0===t.length)return r.push({op:"replace",path:n,value:t}),r;for(let e=i.length-1;e>=0;e-=1)o=a(t,i[e].qInfo&&i[e].qInfo.qId,e),-1===o?(r.push({op:"remove",path:`${n}/${e}`}),i.splice(e,1)):r=r.concat(Yo.generate(i[e],t[o],`${n}/${e}`));for(let e=0,s=t.length;e<s;e+=1)o=a(i,t[e].qInfo&&t[e].qInfo.qId),-1===o?(r.push({op:"add",path:`${n}/${e}`,value:t[e]}),i.splice(e,0,t[e])):o!==e&&(r.push({op:"move",path:`${n}/${e}`,from:`${n}/${o}`}),i.splice(e,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:`${n}/${i}`,value:o}))})),Object.keys(e).forEach((i=>{Zo(t[i])&&!Qo(e,i)&&r.push({op:"remove",path:`${n}/${i}`})})),r},Yo.apply=function(e,t){t.forEach((t=>{let n=ea(e,t.path),r=t.path.split("/").splice(-1)[0],i=r&&isNaN(+r)?n[r]:n[+r]||n;const o=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(n=null,i=e),"add"===t.op||"replace"===t.op)if(Xo(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(Xo(i)&&Xo(t.value)){const e=t.value.slice();i.length=0,i.push(...e)}else if(Jo(i)&&Jo(t.value))a=i,Object.keys(a).forEach((e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!Qo(a,e)&&delete a[e]})),Go(i,t.value);else{if(!n)throw new Error("Patchee is not an object we can patch");n[r]=t.value}else if("move"===t.op){const i=ea(e,t.from);Xo(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(Xo(n)?n.splice(+r,1):delete n[r]);var a}))},Yo.clone=function(e){return Go({},e)},Yo.createPatch=function(e,t,n){const r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},Yo.updateObject=function(e,t){Object.keys(e).length?Yo.apply(e,Yo.generate(e,t)):Go(e,t)};const na=Math.log(10);function ra(e){return 10**e}const ia={pow10:ra,log:(e,t)=>e<=0||t<=0?NaN:Math.log(e)/Math.log(t),log10:e=>e<=0?NaN:Math.log(e)/na,eliminateFloatingError(e){const t=Math.round(e);return Math.abs(e-t)<1e-12?t:e},getNiceNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/na),r=e/ra(n);return t=r<=1?1:r<=2?2:r<=5?5:10,t*ra(n)*(e<0?-1:1)},getSmallNiceNumber(e){let t,n;if(0===e)return 0;t=Math.floor(Math.log(Math.abs(e))/na);const r=e/ra(t);return r<1?(n=5,t--):n=r<2?1:r<5?2:5,n*ra(t)*(e<0?-1:1)},getMagnitude(e){if(0===e)return 0;return ra(Math.floor(Math.log(Math.abs(e))/na))},getFraction(e){if(0===e)return 0;return e/ra(Math.floor(Math.log(Math.abs(e))/na))},getGoodNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/na),r=e/ra(n);return t=Math.ceil(r),7!==t&&9!==t||t++,r>1&&r<=1.5?t=1.5:r>2&&r<=2.5&&(t=2.5),t*ra(n)*(e<0?-1:1)},getValueWithOffset:(e,t=0)=>e+Math.abs(e)*t,isNumber:e=>"number"==typeof e&&!Number.isNaN(e)},oa=[[2,4,6],[2,4],[3]],aa=[,[,,[[1,2]],[[1,2,3],[1,3]],[[1,2,4],[1,4]],[[1,2,4],[1,5]],[[1,2,4,6],[2,4,6],[1,3,6],[1,6]],[[1,2,4,6],[2,4,6],[1,3,6],[1,7]],[[1,2,4,8],[2,4,8],[1,8]],[[1,2,4,8],[2,4,8],[1,3,9],[1,9]],[[1,2,4,6,10],[1,2,4,10],[1,3,10],[3,10],[1,10]]],[,,,[[2,3]],[[2,3,4],[2,4]],[[2,3,4],[2,4],[2,5]],[[2,4,6],[2,6]],[[2,4,6],[2,6],[2,7]],[[2,4,8],[2,8]],[[2,4,8],[2,8],[2,9]],[[2,4,6,10],[2,4,10],[5,10],[3,10]]],[,,,,[[3,4]],[[3,4,5],[3,5]],[[3,4,5,6],[3,6]],[[3,4,5,6],[3,5,7],[3,7]],[[3,4,5,6,8],[3,5,7],[4,8],[3,8]],[[3,4,5,6,8],[3,4,6,9],[3,4,6,8],[3,6,9],[4,8],[3,9]],[[4,6,10],[5,10],[3,10]]],[,,,,,[[4,5]],[[4,5,6],[4,6]],[[4,5,6,7],[4,5,6],[4,6]],[[4,5,6,7,8],[4,5,6,7],[4,6,8],[4,8]],[[4,5,6,7,8],[4,6,9],[4,6,8],[4,8]],[[4,6,10],[5,7,9],[5,10],[4,10]]],[,,,,,,[[5,6]],[[5,6,7],[5,7]],[[5,6,7,8],[5,6,7],[6,8]],[[5,6,7,8,9],[5,6,7,8],[5,7,9],[5,9]],[[6,8,10],[5,10]]],[,,,,,,,[[6,7]],[[6,7,8],[6,8]],[[6,7,8,9],[6,7,8],[6,9]],[[6,7,8,9,10],[6,8,10],[6,10]]],[,,,,,,,,[[7,8]],[[7,8,9],[7,9]],[[7,8,9,10],[8,10],[7,10],[7,9]]],[,,,,,,,,,[[8,9]],[[8,9,10],[8,10]]],[,,,,,,,,,,[[9,10]]]];function sa(e,t,n){const r=e?e.length:0;let i,o=void 0===t?Number.MAX_VALUE:e[0]/t;for(i=1;i<r;i++)o=Math.min(o,e[i]/e[i-1]);void 0!==n&&(o=Math.min(o,n/e[r-1])),e.splice(0,0,o)}function la(e,t,n){let r;const i=e?e.length:0;for(r=0;r<i;r++)sa(e[r],t,n)}!function(){let e,t;for(la(oa,1,10),e=0;e<aa.length;e++)if(aa[e])for(t=0;t<aa[e].length;t++)Array.isArray(aa[e][t])&&la(aa[e][t])}();const ua={isInside(e,t,n,r){if(!r)return!0;const i=e.position-e.radius,o=e.position+e.radius;return i>=t&&o<=n},getCenterDistance:(e,t)=>Math.abs(e.center-t.center),getGap(e,t){const n=e.position<t.position?e:t,r=e.position<t.position?t:e;return r.position-r.radius-(n.position+n.radius)},findSegmentPositionMeetMax(e,t){const n=Math.max(0,e.max-t);return e.center-n},findSegmentPositionMeetMin(e,t){const n=Math.max(0,t-e.min);return e.center+n},findSegmentPositionMeetMinThenMax(e,t,n){const r=ua.findSegmentPositionMeetMin(e,t);return ua.findSegmentPositionMeetMax({center:r,max:r+e.radius},n)},findSegmentPositionMeetMaxThenMin(e,t,n){const r=ua.findSegmentPositionMeetMax(e,n);return ua.findSegmentPositionMeetMin({center:r,min:r-e.radius},t)},layoutPositionFromMin(e,t,n,r=0){const i=e.length-1;let o,a,s=t;for(let t=0;t<i;t++)o=e[t],a=e[t+1],o.position=ua.findSegmentPositionMeetMaxThenMin(o,s,(o.center+a.center-r)/2),s=o.position+o.radius+r/2;a.position=ua.findSegmentPositionMeetMaxThenMin(a,s,n)},adjustPositionFromMax(e,t,n,r=0){const i=e.length-1;let o,a,s;const l=Math.max(0,e[i].position+e[i].radius-n);if(0===l)return;let u,c=0;for(o=i;o>0&&(a=e[o],s=e[o-1],u=Math.max(0,ua.getGap(s,a)-r),u-=Math.max(0,c+u-l),c+=u,a.move=u,!(c>=l));o--);for(c<l&&(u=Math.max(0,s.position-s.radius-t),u-=Math.max(0,c+u-l),c+=u,s.move=u),c=0,o=0;o<=i;o++)a=e[o],c+=a.move||0,a.move=c,a.position-=c},layout(e,t,n,r=0){const i=e.length-1;if(!(i<0))if(0!==i)ua.layoutPositionFromMin(e,t,n,r),ua.adjustPositionFromMax(e,t,n,r);else{const r=e[0];r.position=ua.findSegmentPositionMeetMaxThenMin(r,t,n)}}},ca=(e,t,n,r=1)=>{const i=e.bandwidth();return n?"start"===t?i:"end"===t?i*(1-r):i*(2-r)/2:"start"===t?0:"end"===t?i*r:i*r/2},da=e=>!1!==e.show&&0!==e.show&&"0"!==e.show,ma=e=>e.filter(da),fa=(e,t)=>ma(se.getValue(e,t,[])),pa=e=>da(e)&&(!1!==e.showValue||!1!==e.showLabel),ha=e=>e.filter(pa),ga=(e,t)=>ha(se.getValue(e,t,[])),ya=({refLineLayout:e,layoutService:t})=>t.meta.canBeContinuous?e.refLineExpr.value:e.refLineExpr.stringValue,va=(e,t,n)=>{const{dimensionRefLineInfo:r}=t;if(r[e])return r[e][n]},ba=({label:e,dataPages:t})=>{const{qArea:n={}}=t||{},{qTop:r,qHeight:i}=n;return void 0!==r&&void 0!==i&&void 0!==e.valueInfo&&e.valueInfo.maxOrder<r},xa=({label:e,dataPages:t})=>{const{qArea:n={}}=t||{},{qTop:r,qHeight:i}=n;return void 0!==r&&void 0!==i&&void 0!==e.valueInfo&&e.valueInfo.minOrder>=r+i},qa=({value:e,qMin:t})=>"NaN"!==t&&e<t,Ma=({value:e,qMax:t})=>"NaN"!==t&&e>t,Sa={isRefLineVisible:da,getVisibleRefLines:ma,getRefLines:fa,getMeasureRefLines:e=>fa(e,"refLine.refLines"),getDimensionRefLines:(e,t)=>t?[]:fa(e,"refLine.dimRefLines"),isRefLineLabelVisible:pa,getVisibleRefLineLabels:ha,getRefLineLabels:ga,getMeasureRefLineLabels:e=>ga(e,"refLine.refLines"),getDimensionRefLineLabels:(e,t)=>t?[]:ga(e,"refLine.dimRefLines"),getScaledPosition:({scale:e,size:t,value:n,valueInfo:r,align:i,invert:o=!1,layoutService:a,isContinuous:s})=>{if(!s){const s=e.pxScale(t);let l;if(a.meta.isGroupedByMeasure)return l=ca(s,i,o,a.meta.measureCount),s([n,0])+l;if(a.meta.isGroupedByDimension){if(!r)return NaN;const{innerValues:e,numInnerValues:t,minOrder:a}=r;let u;return l=ca(s,i,o,t),e&&e.length&&(u=(({pxScale:e,value:t,innerValues:n,invert:r,minOrder:i})=>{const o=(({pxScale:e,invert:t})=>e.bandwidth()*(t?-1:1))({pxScale:e,invert:r});for(let r=0;r<n.length;r++){const{id:a,order:s}=n[r],l=e([t,a]);if(void 0!==l)return l-o*(s-i)}})({pxScale:s,value:n,innerValues:e,invert:o,minOrder:a})),(void 0===u?s(n):u)+l}return l=ca(s,i,o),s(n)+l}return e(n)},getDimensionValuesInfo:({layout:e,canBeContinuous:t,discreteModel:n,layoutService:r})=>{const{isGroupedByDimension:i}=r.meta,o={},a=se.getValue(e,"qHyperCube"),s="K"===a.qMode,l=n?n.query.getCurrentDataPage():se.getValue(a,"S"===a.qMode?"qDataPages.0":"qStackedDataPages.0",[]);const u=s?"qData.0.qSubNodes":"qMatrix",c=se.getValue(l,u,[]),d=((e,t)=>e?t?"qValue":"qNum":"qText")(t,s),m=(e=>e.qArea.qTop)(l);return s?(()=>{for(let e=0;e<c.length;e++){const t=c[e],n=e+m,r=t[d];o[r]||(o[r]={id:t.qElemNo,qText:t.qText,minOrder:n,maxOrder:n})}})():i?(()=>{let e;for(let t=0;t<c.length;t++){const n=c[t][0],r=c[t][1],i=t+m,a=n[d];o[a]?(o[a].minOrder=Math.min(o[a].minOrder,i),o[a].maxOrder=Math.max(o[a].maxOrder,i),o[a].innerValues[o[a].innerValues.length]={id:r.qElemNumber,order:i}):o[a]={id:n.qElemNumber,qText:n.qText,minOrder:i,maxOrder:i,innerValues:[{id:r.qElemNumber,order:i}]},0===t?0===i&&(o[a].isMinOrderOk=!0):a!==e&&(o[a].isMinOrderOk=!0,o[e].isMaxOrderOk=!0),e=a}})():(()=>{for(let e=0;e<c.length;e++){const t=c[e][0],n=e+m,r=t[d];o[r]||(o[r]={id:t.qElemNumber,qText:t.qText,minOrder:n,maxOrder:n})}})(),o},getInputValue:ya,extractInfoFromInputValue:va,resolveValue:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const r=ya({refLineLayout:e,layoutService:n});return va(r,t,"id")},isDiscreteMinOutOfBounds:ba,isDiscreteMaxOutOfBounds:xa,isContinuousMinOutOfBounds:qa,isContinuousMaxOutOfBounds:Ma,isOutOfRange:({value:e,qMin:t,qMax:n})=>qa({value:e,qMin:t})||Ma({value:e,qMax:n}),isOutOfDataPages:({label:e,dataPages:t})=>e.valueInfo.isMinOrderOk&&xa({label:e,dataPages:t})||e.valueInfo.isMaxOrderOk&&ba({label:e,dataPages:t}),getInvert:({orientation:e,rtl:t,isContinuous:n})=>"horizontal"===e?t:n},Da="…";function Ca(e,t,n=70){for(let r=0;r<e.length;r++){const i=e[r];i.lines=Wo.tokenize(i.title,t,`${Da} ${i.valueString}`,3,n),i.maxNumLines=i.lines.length}}function wa({title:e,font:t,ellipsis:n,maxNumLines:r=5,maxWidth:i=200}){const o=Wo.tokenize(e,t,n,r,i),a=o.length;let s="";if(a){[s]=o;for(let e=1;e<a;e++)s=`${s}\n${o[e]}`}return s}function La({oobs:e,font:t,ellipsis:n,maxNumLines:r=5,maxWidth:i=200}){const o=e.map((e=>wa({title:e.title,font:t,ellipsis:`${n} ${e.valueString}`,maxNumLines:r,maxWidth:i}))),a=o.length;let s="";if(a){[s]=o;for(let e=1;e<a;e++)s=`${s}\n\n${o[e]}`}return s}function Ea(e,t="value"){e.sort(((e,n)=>e[t]-n[t]))}const Ta=3,Aa=2;function Na({inputValue:e,inputValueLabel:t,localeInfo:n}){if(void 0===e||void 0===t||e.toString()===t)return!1;if(!n)return!0;const r=`+-${n.qDecimalSep||""}${n.qThousandSep||""}`.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");return t.replace(new RegExp(`[0-9e${r}]`,"g"),"").length>0||function(e){if(e.indexOf("e")>-1)return!1;const t=e.indexOf("-");return-1!==t&&(e.lastIndexOf("-")!==t||0!==t)}(t)}const ka=({label:e,dataPages:t,qMin:n,qMax:r})=>{if(void 0!==n&&void 0!==r){const{inputValue:t}=e;if(Sa.isContinuousMaxOutOfBounds({value:t,qMax:r}))return 1;if(Sa.isContinuousMinOutOfBounds({value:t,qMin:n}))return-1}return Sa.isDiscreteMaxOutOfBounds({label:e,dataPages:t})?1:Sa.isDiscreteMinOutOfBounds({label:e,dataPages:t})?-1:0},Oa={hasEngineFormat:Na,calculateLabelPositions({labels:e,scale:t,size:n,layoutService:r,orientation:i,rtl:o,isContinuous:a,isDimension:s}){const l=Sa.getInvert({orientation:i,rtl:o,isContinuous:a}),u="S"===r.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",c=r.getHyperCubeValue(u),{canBeContinuous:d}=r.meta;let m,f;if(s&&d){const e=r.getLayoutValue("qHyperCube.qDimensionInfo.0");m=e.qMin,f=e.qMax}for(let i=0;i<e.length;i++){const o=e[i],{value:s,align:u,valueInfo:d}=o,p=ka({label:o,dataPages:c,qMin:m,qMax:f});o.scaledValue=1===p?l?-.1:1.1:-1===p?l?1.1:-.1:Sa.getScaledPosition({scale:t,size:n,value:s,valueInfo:d,align:u,invert:l,layoutService:r,isContinuous:a}),o.center=o.scaledValue*n}},getTitle:e=>!1!==e.showValue?!1!==e.showLabel?`${e.text} ${e.valueString}`:e.valueString:!1!==e.showLabel?e.text:"",addLabelTitles({labels:e,formatter:t,isContinuous:n,canBeContinuous:r,localeInfo:i}){let o;if(n)for(let n=0;n<e.length;n++){const r=e[n],{value:a,inputValue:s,inputValueLabel:l}=r;o=Na({inputValue:s,inputValueLabel:l,localeInfo:i})?l:t?t(a):a,r.valueString=`${Se.lrm}(${o})${Se.lrm}`,r.title=Oa.getTitle(r)}else if(r)for(let t=0;t<e.length;t++){const n=e[t],{valueText:r,inputValue:a,inputValueLabel:s}=n;o=Na({inputValue:a,inputValueLabel:s,localeInfo:i})?s:r,n.valueString=`${Se.lrm}(${o})${Se.lrm}`,n.title=Oa.getTitle(n)}else for(let t=0;t<e.length;t++){const n=e[t];o=n.valueText,n.valueString=`${Se.lrm}(${o})${Se.lrm}`,n.title=Oa.getTitle(n)}},measureLabelsWidth(e,t){for(let n=0;n<e.length;n++){const r=e[n];r.totalWidth=t(r.title).width}},measureLabelMaxLineWidth:(e,t)=>Math.max(...e.lines.map((e=>t(e).width))),getMaxTextWidth(e){const t=e.map((e=>e.totalWidth));return Math.max(...t)},addLabelsNeighborInfo(e,t,n,r=0){const i=e.length-1;if(i<0)return;let o,a;if([o]=e,o.cMin=t,0!==i){for(let t=0;t<i;t++)o=e[t],a=e[t+1],o.cMax=(o.center+a.center-r)/2,a.cMin=o.cMax+r;a.cMax=n}else o.cMax=n},getTotalNumLines(e){let t=0;return e.forEach((e=>{t+=e.maxNumLines})),t},reduceLabelsHavingMaxNumLines(e,t,n){const r=t-1,i=e.filter((e=>e.maxNumLines===t)),o=Math.min(n,i.length);for(let e=i.length-1;e>=i.length-o;e--)i[e].maxNumLines=r},reduceTotalMaxNumLines(e,t,n){const r=Math.floor(n/t);let i=3;do{const t=Oa.getTotalNumLines(e)-r;if(t<=0)return;Oa.reduceLabelsHavingMaxNumLines(e,i,t),i--}while(i>1)},reduceMaxNumLines(e,t,n=0){for(let r=0;r<e.length;r++){const i=e[r];i.maxNumLines=Math.max(1,Math.min(i.maxNumLines,Math.floor((Math.max(0,i.cMax-i.cMin)+n)/t)))}},addLabelsSize(e,t,n=15,r){for(let i=0;i<e.length;i++){const o=e[i];o.width=Math.min(t,Oa.measureLabelMaxLineWidth(o,r)),o.height=o.lines.length*n}},addLabelSegments(e,t){for(let n=0;n<e.length;n++){const r=e[n],{center:i}=r,o=r[t],a=o/2;r.segment={center:i,range:o,min:i-a,max:i+a,radius:a}}},addLabelsInfo({labels:e,scale:t,majorSize:n,lowerLimit:r,upperLimit:i,gap:o,font:a,maxLabelWidth:s,lineHeight:l,majorDimension:u,orientation:c,measureText:d,rtl:m,layoutService:f,isContinuous:p,isDimension:h}){const g=e.map((e=>e)),y=n;Oa.calculateLabelPositions({labels:e,scale:t,size:y,layoutService:f,orientation:c,rtl:m,isContinuous:p,isDimension:h}),Ea(e,"center"),Oa.addLabelsNeighborInfo(e,r,i,o),Ca(e,a,s),Oa.reduceTotalMaxNumLines(g,l,i-(g.length-1)*o),"vertical"===c&&(Oa.reduceMaxNumLines(e,l,.05*o),function(e,t,n=70){for(let r=0;r<e.length;r++){const i=e[r];i.lines.length>i.maxNumLines&&(i.lines=Wo.tokenize(i.title,t,`${Da} ${i.valueString}`,i.maxNumLines,n))}}(e,a,s)),Oa.addLabelsSize(e,s,l,d),Oa.addLabelSegments(e,u)},createLabels({labels:e,style:t,maxLabelWidth:n,areaProps:r,area:i,lineHeight:o=15,font:a}){const{majorAxis:s,minorAxis:l,dock:u}=r,{minorCenter:c}=i,{fontSize:d,fontFamily:m,background:f}=t;let p=[];return e.forEach((e=>{const{lines:t}=e,r=t.length,i=t.map(((t,i)=>{const f={type:"text",text:t,title:wa({title:e.title,font:a,ellipsis:`… ${e.valueString}`}),dx:0,dy:0,maxWidth:n,width:n,fontSize:d,fontFamily:m,fill:e.fill,baseline:"central",anchor:"middle",value:e.value,dock:u};return f[l]=c,f[s]=e.segment.position,f.y+=(i-(r-1)/2)*o,f}));e.background&&p.push(function({minorCenter:e,majorAxis:t,minorAxis:n,dock:r,label:i,lineHeight:o,background:a}){const{lines:s}=i,{borderRadius:l=Ta,padding:u={}}=a,{top:c=Aa,bottom:d=Aa,left:m=Aa,right:f=Aa}=u,p=s.length,h={type:"rect",rx:l,ry:l,fill:i.background.fill,width:i.width+(m+f),height:i.height+(c+d),value:i.value,dock:r};return h[n]=e,h[t]=i.segment.position,h.x-=i.width/2+m,h.y-=p*o/2+c,h}({minorCenter:c,majorAxis:s,minorAxis:l,dock:u,label:e,lineHeight:o,background:f})),p=p.concat(i)})),p}};function Ia(e,t,n){let r;const i=typeof t;if("string"===i||"object"===i)r=e.formatter(t);else if(void 0!==n&&n.data){const e=n.data()&&n.data().fields;r=e&&e[0]?e[0].formatter():null}return r}function Pa(e,t,n){return"top"===e||"bottom"===e?function(e,t){const{font:n,lineHeight:r,top:i,bottom:o,maxLabelWidth:a}=t;let s=1;return Oa.getMaxTextWidth(e)>a&&(Ca(e,n,a),s=Math.max(...e.map((e=>e.lines.length)))),s*r+i+o}(t,n):function(e,t){const{left:n,right:r,maxLabelWidth:i}=t;return Math.min(i,Oa.getMaxTextWidth(e))+n+r}(t,n)}function Ra(e,t){return t?e.domain():[0,1]}function Fa(e,t,n,r="value"){let i=e.filter((e=>e[r]>=t));i=i.filter((e=>e[r]<=n));const o=e.filter((e=>e[r]<t)),a=e.filter((e=>e[r]>n));return{filteredLabels:i,minOobs:o,maxOobs:a,numMinOobs:o.length,numMaxOobs:a.length}}function Ha(e){let t,n=0;for(let r=1;r<10;r++)t=e(r),n=Math.max(n,Math.sqrt(t.width*t.width+t.height*t.height));return t=e("9+"),[n,Math.max(n,Math.sqrt(t.width*t.width+t.height*t.height))]}function za(e,t){return e>9?t[1]:t[0]}function ja({alignment:e,dockValue:t,oobs:n,style:r,rect:i,symbol:o,position:a,areaProps:s,radius:l,font:u}){const c=n?n.length:0;if(c<1)return[];const{flipXY:d,majorAxis:m,minorAxis:f,minorDimension:p,dock:h}=s,g=i[p],y=Ko.createOob({oob:Ko.getDefaultSettings({size:r.size,fill:r.fill,alignment:e}),dockValue:t,boxCenter:.5,rendWidth:i.width,rendHeight:i.height,flipXY:d,symbol:o});y.dock=h;const v=`c${m}`,b=`c${f}`,x={type:"circle",r:l,stroke:"transparent",fill:r.text.background.fill,strokeWidth:0,dock:h};x[b]=g/2,x[v]=a;const q={type:"text",text:c>9?"9+":c,title:La({oobs:n,font:u,ellipsis:"…"}),dx:0,dy:0,maxWidth:g,width:g,fontSize:r.text.fontSize,fontFamily:r.text.fontFamily,fill:r.text.fill,baseline:"central",anchor:"middle",dock:h};return q[f]=g/2,q[m]=a,[y,x,q]}function Ba(e){const t=`normal ${e.fontSize} '${e.fontFamily}'`;return{font:t,lineHeight:Wo.getFontHeight(t)*(e.lineHeightMultiplicator||1),gap:e.gap||12,maxLabelWidth:e.maxWidth||75,top:e.padding.top||0,bottom:e.padding.bottom||0,left:e.padding.left||0,right:e.padding.right||0}}const Va=e=>e.map((e=>({...e,value:"function"==typeof e.value?e.value():e.value,valueText:"function"==typeof e.valueText?e.valueText():e.valueText,valueInfo:"function"==typeof e.valueInfo?e.valueInfo():e.valueInfo})));var _a={require:["renderer","chart","symbol"],defaultSettings:{layout:{displayOrder:0,prioOrder:0}},preferredSize(){const{scale:e}=this,{style:t,layoutService:n,isContinuous:r,localeInfo:i}=this.settings,o=!!r||n.meta.canBeContinuous,a=Va(this.settings.labels),s=Ia(this.chart,this.settings.formatter,e);Oa.addLabelTitles({labels:a,formatter:s,isContinuous:r,canBeContinuous:o,localeInfo:i});const{numMaxOobs:l,numMinOobs:u,filteredLabels:c}=(({labels:e,scale:t,isContinuous:n,canBeContinuous:r,layoutService:i})=>{if(n){const[r,i]=Ra(t,n);return Fa(e,r,i)}if(r){const t=i.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:n,qMax:r}=t;if("NaN"!==n&&"NaN"!==r)return Fa(e,n,r,"inputValue")}return{filteredLabels:e}})({labels:a,scale:e,isContinuous:r,canBeContinuous:o,layoutService:n});let d;if(this.measureText=e=>this.renderer.measureText({text:e,fontSize:t.label.fontSize,fontFamily:t.label.fontFamily}),c&&c.length){const e=Ba(t.label),{dock:n}=this.settings.layout;return Oa.measureLabelsWidth(c,this.measureText),d=Pa(n,c,e),d}const m=Ha(this.measureText),f=l?za(l,m):0,p=u?za(u,m):0;return d=Math.max(f,p),d},render(){const{scale:e}=this;if(!e.domain().length)return;const{symbol:t}=this,{style:n,layoutService:r,theme:i,isContinuous:o,isDimension:a,localeInfo:s}=this.settings,l=!!o||r.meta.canBeContinuous,u=Va(this.settings.labels),{dock:c,rtl:d}=this.settings.layout,{padding:m}=n.label,f=function(e){return"left"===e||"right"===e?(e=>({dock:e,orientation:"vertical",majorAxis:"y",minorAxis:"x",majorDimension:"height",minorDimension:"width",flipXY:!1}))(e):(e=>({dock:e,orientation:"horizontal",majorAxis:"x",minorAxis:"y",majorDimension:"width",minorDimension:"height",flipXY:!0}))(e)}(c),p=function(e,t,n){const r=e[t.minorDimension];return{minorSize:r,majorSize:e[t.majorDimension],minorCenter:"vertical"===t.orientation?(r-n.right-n.left)/2+n.left:(r-n.top-n.bottom)/2+n.top}}(this.rect,f,m),{orientation:h,majorDimension:g}=f,{majorSize:y}=p,{font:v,lineHeight:b,gap:x,maxLabelWidth:q}=Ba(n.label),M=Ia(this.chart,this.settings.formatter,e),S=y;Oa.addLabelTitles({labels:u,formatter:M,isContinuous:o,canBeContinuous:l,localeInfo:s}),Oa.calculateLabelPositions({labels:u,scale:e,size:S,layoutService:r,orientation:h,rtl:d,isContinuous:o,isDimension:a});const[D,C]=Ra(e,o),{filteredLabels:w,lowerOobs:L,upperOobs:E,lowerCircleSize:T,upperCircleSize:A,lowerOobSpace:N,upperOobSpace:k}=function({labels:e,minValue:t,maxValue:n,orientation:r,rtl:i,isContinuous:o,style:a,padding:s,measureText:l,prop:u="value"}){const{maxOobs:c,minOobs:d,filteredLabels:m}=Fa(e,t,n,u),f="scaledValue"!==u&&Sa.getInvert({orientation:r,rtl:i,isContinuous:o}),p=function(e,t,n){return n?t:e}(d,c,f),h=function(e,t,n){return n?e:t}(d,c,f),g=p.length,y=h.length,v=Ha(l),b=za(g,v),x=za(y,v),q=function(e,t,n,r,i){return("vertical"===r?i.top:i.left)+(e>0?t+n:0)}(g,a.oob.size,b,r,s),M=function(e,t,n,r,i){return("vertical"===r?i.bottom:i.right)+(e>0?t+n:0)}(y,a.oob.size,x,r,s);return{filteredLabels:m,lowerOobs:p,upperOobs:h,lowerCircleSize:b,upperCircleSize:x,lowerOobSpace:q,upperOobSpace:M}}({labels:u,minValue:D,maxValue:C,orientation:h,rtl:d,isContinuous:o,style:n,padding:m,measureText:this.measureText,prop:o?"value":"scaledValue"}),O=N,I=y-k;Ea(L),Ea(E);const P=ja({alignment:0,dockValue:0,oobs:L,style:n.oob,rect:this.rect,symbol:t,position:n.oob.size+T/2,areaProps:f,radius:T/2,font:v}),R=ja({alignment:1,dockValue:1,oobs:E,style:n.oob,rect:this.rect,symbol:t,position:y-(n.oob.size+A/2),areaProps:f,radius:A/2,font:v});Oa.addLabelsInfo({labels:w,scale:e,majorSize:y,lowerLimit:O,upperLimit:I,font:v,lineHeight:b,gap:x,maxLabelWidth:q,majorDimension:g,orientation:h,measureText:this.measureText,rtl:d,layoutService:r,isContinuous:o,isDimension:a}),ua.layout(w.map((e=>e.segment)),O,I,n.label.gap);const F=w.filter((e=>ua.isInside(e.segment,O,I,o)));return Oa.createLabels({labels:F,style:n.label,maxLabelWidth:q,areaProps:f,area:p,lineHeight:b,font:v,theme:i}).concat([...P,...R])}};function Ua(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ua(Object(n),!0).forEach((function(t){Xa(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ua(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wa(){Wa=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,i){var o=t&&t.prototype instanceof m?t:m,a=Object.create(o.prototype),s=new C(i||[]);return r(a,"_invoke",{value:q(e,n,s)}),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d={};function m(){}function f(){}function p(){}var h={};l(h,o,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g(w([])));y&&y!==t&&n.call(y,o)&&(h=y);var v=p.prototype=m.prototype=Object.create(h);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function i(r,o,a,s){var l=c(e[r],e,o);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return i("throw",e,a,s)}))}s(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function q(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=M(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=c(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function M(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,M(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=c(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,d;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function w(e){if(e||""===e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return f.prototype=p,r(v,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:f,configurable:!0}),f.displayName=l(p,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,a,(function(){return this})),e.AsyncIterator=x,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new x(u(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(v),l(v,s,"Generator"),l(v,o,(function(){return this})),l(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=w,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(D),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),D(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;D(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:w(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function Ka(e){return Ka="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ka(e)}function Ga(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function Ya(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Ga(o,r,i,a,s,"next",e)}function s(e){Ga(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Xa(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ja(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Za(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||es(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qa(e){return function(e){if(Array.isArray(e))return ts(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||es(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function es(e,t){if(e){if("string"==typeof e)return ts(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ts(e,t):void 0}}function ts(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ns=Object.prototype.hasOwnProperty,rs=Object.prototype.toString,is=Object.defineProperty,os=Object.getOwnPropertyDescriptor,as=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===rs.call(e)},ss=function(e){if(!e||"[object Object]"!==rs.call(e))return!1;var t,n=ns.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&ns.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||ns.call(e,t)},ls=function(e,t){is&&"__proto__"===t.name?is(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},us=function(e,t){if("__proto__"===t){if(!ns.call(e,t))return;if(os)return os(e,t).value}return e[t]},cs=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((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=us(s,n),s!==(i=us(t,n))&&(c&&i&&(ss(i)||(o=as(i)))?(o?(o=!1,a=r&&as(r)?r:[]):a=r&&ss(r)?r:{},ls(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&ls(s,{name:n,newValue:i}));return s}));function ds(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map((function(e){return i[e.value%i.length]}))},valueAccessor:e.value}}function ms(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map((function(e){return i[e.row.value%i.length]}))},valueAccessor:e.value}}function fs(e,t,n,r,i){var o,a,s=i.byRow,l=i.byElemNo;if(r&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(a=(o=e.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===a?void 0:a.qArea.qHeight)||0)))return l(r,r.raw().qCardinal);if(r){var u=t.pic.extract({field:r.key(),trackBy:r.value}).length;return s(r,u)}return{}}function ps(e,t){var n=e.hc.qDimensionInfo,r=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(r.activeDimensionIndex>=0){var i=n[r.activeDimensionIndex];r=i.coloring&&i.coloring.colorMapRef?{type:"libraryItem",key:i.coloring.colorMapRef,activeDimensionIndex:r.activeDimensionIndex}:{activeDimensionIndex:r.activeDimensionIndex}}return r}function hs(e,t){var n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter((function(e){return"dimension"===e.type()}))[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(n=t.key?e.pic.field((function(e){return e.raw().colorMapRef===t.key})):void 0)&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n}function gs(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ys(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function vs(){}var bs=1/.7,xs="\\s*([+-]?\\d+)\\s*",qs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ms="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ss=/^#([0-9a-f]{3,8})$/,Ds=new RegExp(`^rgb\\(${xs},${xs},${xs}\\)$`),Cs=new RegExp(`^rgb\\(${Ms},${Ms},${Ms}\\)$`),ws=new RegExp(`^rgba\\(${xs},${xs},${xs},${qs}\\)$`),Ls=new RegExp(`^rgba\\(${Ms},${Ms},${Ms},${qs}\\)$`),Es=new RegExp(`^hsl\\(${qs},${Ms},${Ms}\\)$`),Ts=new RegExp(`^hsla\\(${qs},${Ms},${Ms},${qs}\\)$`),As={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 Ns(){return this.rgb().formatHex()}function ks(){return this.rgb().formatRgb()}function Os(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ss.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Is(t):3===n?new Hs(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Ps(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Ps(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=Ds.exec(e))?new Hs(t[1],t[2],t[3],1):(t=Cs.exec(e))?new Hs(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ws.exec(e))?Ps(t[1],t[2],t[3],t[4]):(t=Ls.exec(e))?Ps(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Es.exec(e))?Us(t[1],t[2]/100,t[3]/100,1):(t=Ts.exec(e))?Us(t[1],t[2]/100,t[3]/100,t[4]):As.hasOwnProperty(e)?Is(As[e]):"transparent"===e?new Hs(NaN,NaN,NaN,0):null}function Is(e){return new Hs(e>>16&255,e>>8&255,255&e,1)}function Ps(e,t,n,r){return r<=0&&(e=t=n=NaN),new Hs(e,t,n,r)}function Rs(e){return e instanceof vs||(e=Os(e)),e?new Hs((e=e.rgb()).r,e.g,e.b,e.opacity):new Hs}function Fs(e,t,n,r){return 1===arguments.length?Rs(e):new Hs(e,t,n,null==r?1:r)}function Hs(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function zs(){return`#${_s(this.r)}${_s(this.g)}${_s(this.b)}`}function js(){const e=Bs(this.opacity);return`${1===e?"rgb(":"rgba("}${Vs(this.r)}, ${Vs(this.g)}, ${Vs(this.b)}${1===e?")":`, ${e})`}`}function Bs(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Vs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function _s(e){return((e=Vs(e))<16?"0":"")+e.toString(16)}function Us(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ws(e,t,n,r)}function $s(e){if(e instanceof Ws)return new Ws(e.h,e.s,e.l,e.opacity);if(e instanceof vs||(e=Os(e)),!e)return new Ws;if(e instanceof Ws)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 Ws(a,s,l,e.opacity)}function Ws(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Ks(e){return(e=(e||0)%360)<0?e+360:e}function Gs(e){return Math.max(0,Math.min(1,e||0))}function Ys(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}gs(vs,Os,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ns,formatHex:Ns,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return $s(this).formatHsl()},formatRgb:ks,toString:ks}),gs(Hs,Fs,ys(vs,{brighter(e){return e=null==e?bs:Math.pow(bs,e),new Hs(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Hs(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Hs(Vs(this.r),Vs(this.g),Vs(this.b),Bs(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:zs,formatHex:zs,formatHex8:function(){return`#${_s(this.r)}${_s(this.g)}${_s(this.b)}${_s(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:js,toString:js})),gs(Ws,(function(e,t,n,r){return 1===arguments.length?$s(e):new Ws(e,t,n,null==r?1:r)}),ys(vs,{brighter(e){return e=null==e?bs:Math.pow(bs,e),new Ws(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Ws(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 Hs(Ys(e>=240?e-240:e+120,i,r),Ys(e,i,r),Ys(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ws(Ks(this.h),Gs(this.s),Gs(this.l),Bs(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=Bs(this.opacity);return`${1===e?"hsl(":"hsla("}${Ks(this.h)}, ${100*Gs(this.s)}%, ${100*Gs(this.l)}%${1===e?")":`, ${e})`}`}}));const Xs=Math.PI/180,Js=180/Math.PI,Zs=4/29,Qs=6/29,el=3*Qs*Qs;function tl(e){if(e instanceof nl)return new nl(e.l,e.a,e.b,e.opacity);if(e instanceof sl)return ll(e);e instanceof Hs||(e=Rs(e));var t,n,r=al(e.r),i=al(e.g),o=al(e.b),a=rl((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=rl((.4360747*r+.3850649*i+.1430804*o)/.96422),n=rl((.0139322*r+.0971045*i+.7141733*o)/.82521)),new nl(116*a-16,500*(t-a),200*(a-n),e.opacity)}function nl(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function rl(e){return e>.008856451679035631?Math.pow(e,1/3):e/el+Zs}function il(e){return e>Qs?e*e*e:el*(e-Zs)}function ol(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function al(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function sl(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function ll(e){if(isNaN(e.h))return new nl(e.l,0,0,e.opacity);var t=e.h*Xs;return new nl(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}gs(nl,(function(e,t,n,r){return 1===arguments.length?tl(e):new nl(e,t,n,null==r?1:r)}),ys(vs,{brighter(e){return new nl(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new nl(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 Hs(ol(3.1338561*(t=.96422*il(t))-1.6168667*(e=1*il(e))-.4906146*(n=.82521*il(n))),ol(-.9787684*t+1.9161415*e+.033454*n),ol(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),gs(sl,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof sl)return new sl(e.h,e.c,e.l,e.opacity);if(e instanceof nl||(e=tl(e)),0===e.a&&0===e.b)return new sl(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Js;return new sl(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new sl(e,t,n,null==r?1:r)}),ys(vs,{brighter(e){return new sl(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new sl(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return ll(this).rgb()}}));var ul=e=>()=>e;function cl(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):ul(isNaN(e)?t:e)}var dl=function e(t){var n=function(e){return 1==(e=+e)?cl: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):ul(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Fs(e)).r,(t=Fs(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=cl(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),ml=/^class(-pyramid)?/,fl=function(e,t,n,r){var i=void 0!==n.min?n.min:r.min(),o=void 0!==n.max?n.max:r.max(),a=i,s=o,l=t.limits,u={},c="percent"===t.limitType?l.map((function(e){return i+(o-i)*e})):l,d=t.colors.map((function(t){return e.resolveUIColor(t)}));if(i=Math.min.apply(Math,[i].concat(Qa(c))),o=Math.max.apply(Math,[o].concat(Qa(c))),u.min=i,u.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))u.type="categorical",Object.assign(u,function(e){var t=e.min,n=e.max,r=e.limits,i=e.range,o=[],a=[];if(r.length)if(r[r.length-1]<t)a.push(t,n),o.push(i[i.length-1],i[i.length-1],i[i.length-1]);else if(r[0]>n)a.push(t,n),o.push(i[0],i[0],i[0]);else{if(r[0]>t)a.push(t),o.push(i[0]);else{a.push(t);for(var s=0;s<r.length;s++)if(t<r[s]){o.push(i[s]);break}}for(var l=0;l<r.length;l++)t<r[l]&&r[l]<n&&(a.push(r[l]),o.push(i[l]));if(r[r.length-1]<n)a.push(n),o.push(i[r.length]),o.push(i[r.length]);else{a.push(n);for(var u=0;u<r.length;u++)if(r[u]>n){o.push(i[u]),o.push(i[u]);break}}}else o.push(i[0]);return{min:t,max:n,range:o,domain:a}}({min:"percent"===t.limitType?i:a,max:"percent"===t.limitType?o:s,range:d,limits:"percent"===t.limitType?c:l}));else if(t.breakTypes){var m=t.breakTypes;u.type="continuous",u.domain=[i],u.range=[d[0]];for(var f=0;f<c.length;f+=1)if(m[f]){var p=d[f],h=d[f+1],g=dl(p,h)(.5);u.range.push(g),u.domain.push(c[f]),f<c.length-1&&m[f+1]&&(u.range.push(d[f+1]),u.domain.push((c[f]+c[f+1])/2))}else u.range.push(d[f]),u.range.push(d[f+1]),u.domain.push(c[f]),u.domain.push(c[f]+Math.min(1e-6,(o-i)/1e6));u.range.push(d[d.length-1]),u.domain.push(o)}else u.domain=c,u.range=d;return u};function pl(e,t,n,r,i){var o,a,s,l=0,u=[],c=(e-t)/(r+1);if(0===c)return 1;for(o=0;o<n.length;o+=1)a=.99*(n[o]-t),s=n[o]>e?Math.floor(e/c):n[o]<t?0:Math.floor(a/c),Number.isNaN(s)||(u[s]?u[s]+=1:u[s]=1);for(o=0;o<u.length;o+=1)u[o]&&(l+=1);return l<=r||l>=i?Math.max(l,r):pl(e,t,n,r+1,i)}var hl=function(e,t,n,r){var i,o,a=t.theme,s=t.hc,l=r.f,u={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},c=[],d=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(d=!("S"===(i=n.pic.raw()).qMode&&(i.qDataPages[0]&&i.qSize.qcy>i.qDataPages[0].qArea.qHeight||!i.qDataPages.length&&i.qSize.qcy>0)||"K"===i.qMode&&i.qStackedDataPages[0]&&i.qSize.qcy>i.qStackedDataPages[0].qArea.qHeight||"T"===i.qMode&&i.qSize.qcy>i.qTreeDataPages[0].qGroupSize))&&(c=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:s.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,Qa(e))<0}}}}).filter((function(e){return e.value>=0&&!e.exclude.value})).map((function(e){return e.num.value})).filter((function(e){return"number"==typeof e})))}if(!1===n.input.autoMinMax){if(u.min=n.input.measureMin,u.max=n.input.measureMax,u.max<u.min)return{invalid:!0}}else if(l&&!d)u.min=l.min(),u.max=l.max();else if(l){if(!c.length)return{invalid:!0};u.min=Math.min.apply(Math,Qa(c)),u.max=Math.max.apply(Math,Qa(c))}if(n.input.measureScheme&&(u.palettes={quant:n.input.measureScheme}),a){var m=a.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];u.type=m&&ml.test(m.type)?"categorical":"continuous","categorical"===u.type&&(o=m.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,Qa(m.colors.map((function(e){return e?e.length:0})))):m.colors.length)}if("categorical"===u.type){for(var f=d?pl(u.max,u.min,c,1,o):o,p=(u.max-u.min)/f,h=[],g=0;g<f+1;g+=1)h.push(u.min+p*g);u.domain=h,u.range=function(e){for(var t=e.resources.theme.palette("quant",f),n=Math.max(1,Math.floor(t.length/f)),r=[],i=0;i<f;i+=1)r.push(t[i*n]);return[r[0]].concat(r,[r[r.length-1]])}}return u};function gl(e,t){var n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field((function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key})):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n||(n=e.pic.field((function(e){return void 0!==e.raw().matchMeasure})))&&(n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[n.raw().matchMeasure]),n}function yl(e){var t,n=e.cm,r=e.defaults,i=e.index,o=e.input,a=e.pic;if(!o||!o.on)return null;var s=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===s?function(e,t,n){var r=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(r=e.resolveUIColor(t.paletteColor)),$a($a({},n),{},{mode:"constant",type:"constant",primary:r})}(n,o,r):"byExpression"===s?function(e,t,n){var r="qMeasureInfo/".concat(e,"/"),i=t.field((function(e){return e.id().startsWith(r)&&"colorByMeasureExpression"===e.raw().id})),o=i;return $a($a({},n),{},o?{mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(i,a,r):null}function vl(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function bl(e,t){for(var n=(null==t?void 0:t.domain)||[],r=(null==t?void 0:t.range)||[],i=[],o=0;o<e.length;++o){var a=e[o];if("constant"===(null==a?void 0:a.mode)){var s=n.indexOf(o);-1===s?(n.push(o),r.push(a.primary)):r[s]=a.primary,e[o]=null}else if(a){i.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),r.splice(l,1))}}return{domain:n,range:r,exclude:i}}function xl(e,t,n,r){var i,o=function(e,t,n,r){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var r=t.theme,i=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?gl:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),u=hl(0,{theme:r,hc:i},n,{f:l});if(u.invalid)return u;"expression"===s.type&&(s.activeMeasureIndex<0||void 0===s.activeMeasureIndex)&&(u.label=s.label,l&&"color.altLabel"===l.raw().labelExpRef&&(u.label=n.input.altLabel)),!u.label&&l&&(u.label=l.title());var c=s.activeMeasureIndex>=0?l:null;if(!c&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(c=n.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===s.type)if(c){var d=c.raw().coloring;d&&d.gradient&&cs(u,fl(e,d.gradient,u,c))}else u.auxiliary=s;return u}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.getCDef,o=void 0===i?ps:i,a=r.getCByField,s=void 0===a?hs:a,l=r.getPersistence,u=void 0===l?fs:l,c=o(t,n),d=s(n,c),m=d?d.raw():{},f=n&&n.pic?n.pic.raw():{};if(m.qError||m.qSize&&0===m.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:d?d.key():void 0,isFieldLocked:m.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(p.label=c.label,"color.altLabel"===m.labelExpRef&&(p.label=n.input.altLabel)),!p.label&&d&&(p.label=d.title()),n.input.dimensionScheme&&(p.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===c.type&&(p.auxiliary=c),cs(p,u(t,n,c,d,{byRow:ms,byElemNo:ds})),p}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!s||!s.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:r.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=hl(0,{hc:i,theme:o},n,{f:s});return l.invalid||(l.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,r);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&i.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],u=[];"measure"===n.input.useBaseColors&&i.qMeasureInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?u.push(r.primary):u.push(i)}}));var c=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,d=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&d&&(c={categorical:d.key}),{mode:"measure",type:"categorical",palettes:c,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:u}:void 0}}if("dimension"===s){var m=[],f=[];return i.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){m.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?f.push(r.primary):f.push(i)}})),{mode:"dimension",type:"categorical",field:m.length?m[0]:void 0,explicit:m.length?{domain:m,range:f}:void 0}}var p=r.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(p=e.resolveUIColor(n.input.paletteColor));else{var h=n.input.singleColor;"number"!=typeof h||Number.isNaN(h)||(p=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][h])}return{mode:"constant",type:"constant",primary:p}}(e,n,t,r)}return{}}(e,t,n,r);return null!==(i=t.input)&&void 0!==i&&i.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map((function(n,i){return yl({cm:e,input:n,defaults:r,index:i,pic:t.pic})})),function(e,t){var n,r,i,o=t.translator;if(vl(e),1===(null===(n=e.measureOverrides)||void 0===n?void 0:n.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=bl(e.measureOverrides,e.explicit),vl(e)),null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=bl(e.measureOverrides),a}return null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}function ql(e){var t=$a({hc:null,colorProps:null,layout:null,theme:null},e),n={},r={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},i={auto:function(e){return e?(r.auto=e,i):r.auto},getDimensionColorMap:function(e){return e?(r.getDimensionColorMap=e,i):r.getDimensionColorMap},getAttributeDimension:function(e){return e?(r.getAttributeDimension=e,i):r.getAttributeDimension},getMeasure:function(e){return e?(r.getMeasure=e,i):r.getMeasure},set:function(e){var i;if(!e.colorProps)throw new Error('Missing "colorProps"');if(cs(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=r.auto(e.layout);n.input=cs(!0,{},n.input,o,{auto:!1});var a=t.theme?t.theme.getDataColorPalettes():[];a[0]&&(n.input.dimensionScheme=a[0].key);var s=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(s=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[s]&&t.hc.qDimensionInfo[s].coloring&&t.hc.qDimensionInfo[s].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(i=n.input.measureOverrides)&&void 0!==i&&i.every((function(e){return!e||!e.on}))&&(n.input=cs(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,r=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){r.push({key:"ui",colors:e.colors})})),n.palettes=r}return n.palettes},getAuxiliaryData:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var i=(e.auxiliary||{}).key;if("measure"===e.fieldType)return r.getMeasure(i,t).catch((function(){}));if("dimension"===e.fieldType){var o="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?r.getAttributeDimension(o,t).catch((function(){})):Promise.resolve(),i?r.getDimensionColorMap(i,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,r){var i=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,r).then((function(r){if(!r)return{};if("measure"===e.fieldType){if(r.coloring&&r.coloring.gradient){var o=n.pic.field(e.field);return fl(i,r.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var a={nil:e.nil,others:e.others},s=r[0],l=r[1]?r[1].colorMap:null;if(s){var u=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:s,qInterColumnSortOrder:[0,1],qMode:"S"}});a.legendDataset=u}return l?function(e,t,n,r){var i=r.external,o=r.field,a=$a({},e);cs(a,ds(o,o.raw().qCardinal));var s=i.theme?i.theme.getDataColorPalettes()[0]:null;return t.nul&&(a.nil=n.resolveUIColor(t.nul)),t.oth&&(a.others=n.resolveUIColor(t.oth)),t.usePal?(a.palettes={categorical:t.pal},s&&!t.pal&&(a.palettes.categorical=s.key,cs(a,ds(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),cs(a,ds(o))),t.colors&&t.colors.length&&(a.explicit=function(e,t,n){for(var r={},i=0;i<e.length;i+=1)r[e[i].value]=e[i].baseColor;var o=[];return{domain:function(e){var i=e.data,a=[];o=[];for(var s=0;s<i.items.length;s++){var l=i.items[s],u=(l.text||l).label;r[u]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(t.resolveUIColor(r[u])))}return a.push(-3,-2),o.push(n.others),o.push(n.nil),a},range:function(){return o}}}(t.colors,n,a)),a}(a,l,i,{external:t,field:n.pic.field(e.field)}):a}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!n.uiPalette)return e.color;var t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},r=t.theme;r&&(e=$a($a({},e),r.getDataColorSpecials())),n.settings=cs(e,xl(this,n,t,e))}return n.settings}};return i}var Ml=function(e,t){var n=e.fieldType,r={};if(t)if("measure"===n){var i=t.coloring;i&&(r.measureGradient=i.gradient)}else if("dimension"===n){var o=t[0],a=t[1];o&&(r.legendDataPage=o),a&&(r.dimValsData=a.colorMap)}return r},Sl=function(e){throw e.isHandled=!0,e},Dl=function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():r&&r.getObject?r.getObject("ColorMapModel_".concat(e)).then((function(e){return e.getLayout()})):Promise.reject()},Cl=function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():r&&r.getMeasure?r.getMeasure(e).then((function(e){return e.getMeasure()})):Promise.reject()},wl=function(e,t){var n=t.layout,r=t.model,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():r&&r.session&&i?r.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(Sl):Promise.reject()};function Ll(e){return function(t){return"object"===Ka(t.datum[e])?t.datum[e].value:void 0}}function El(e){return"object"===Ka(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function Tl(e){return-3===e.datum.value}var Al={TITLE:{COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},LABEL:{COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"}};function Nl(e){var t=e.theme,n=e.key,r=e.styleOverrides,i={title:{color:Al.TITLE.COLOR,fontSize:Al.TITLE.FONT_SIZE,fontFamily:Al.TITLE.FONT_FAMILY},label:{color:Al.LABEL.COLOR,fontSize:Al.LABEL.FONT_SIZE,fontFamily:Al.LABEL.FONT_FAMILY}};if(!t&&!r)return i;var o=r||{},a=o.title,s=o.label,l=function(e){var t=e.theme,n=e.key;return function(e,r,i,o){return void 0!==e?e:t?t.getStyle(n,r,i):o}}({theme:t,key:n});return i.title.color=l(null==a?void 0:a.color,"legend.title","color",Al.TITLE.COLOR),i.title.fontSize=l(null==a?void 0:a.fontSize,"legend.title","fontSize",Al.TITLE.FONT_SIZE),i.title.fontFamily=l(null==a?void 0:a.fontFamily,"legend.title","fontFamily",Al.TITLE.FONT_FAMILY),i.label.color=l(null==s?void 0:s.color,"legend.label","color",Al.LABEL.COLOR),i.label.fontSize=l(null==s?void 0:s.fontSize,"legend.label","fontSize",Al.LABEL.FONT_SIZE),i.label.fontFamily=l(null==s?void 0:s.fontFamily,"legend.label","fontFamily",Al.LABEL.FONT_FAMILY),i}var kl=function(e,t,n){var r=e&&e.dock||void 0;if("auto"!==r)return r||"right";if(t){var i=t.element.getBoundingClientRect();if(i.height>i.width)return"bottom"}return n?"left":"right"},Ol=function(e,t,n){return!(n.invalid||"color"===n.type||"measure"===n.mode&&t.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function Il(e,t){var n=e.styleReference,r=e.styleOverrides,i=e.chart,o=e.rtl,a=t.legendProps,s=t.coloring,l=t.theme,u=t.hc,c=Nl({theme:l,key:n,styleOverrides:r});return{layout:{minimumLayoutMode:"MEDIUM",dock:kl(a,i,o)},show:"function"==typeof a.show?function(){return Ol(a,u,s)}:Ol(a,u,s),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==a.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:s.label||"",fill:c.title.color,fontSize:c.title.fontSize,fontFamily:c.title.fontFamily}}}}function Pl(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var r=Il(e,t);if(!r.show)return!1;var i,o=e.key,a=e.styleReference,s=e.styleOverrides,l=e.viewState,u=e.rtl,c=e.settings,d=e.style,m=t.scaleKey,f=t.theme,p=t.scales,h=Nl({theme:f,key:a,styleOverrides:s}),g=r.layout.dock,y="left"===g||"right"===g?{maxLines:2,wordBreak:"break-word"}:{},v={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===t.coloring.fieldType&&(i=function(e){return e.datum.value>=0||-3===e.datum.value});var b="".concat(m,"Legend");return cs(!0,r,{type:"legend-cat",key:"".concat(o,"-cat"),scale:b in p?b:m,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(r.layout.dock)?2:1,direction:u?"rtl":"ltr",horizontal:20},item:{show:i,label:$a({fill:h.label.color,fontSize:h.label.fontSize,fontFamily:h.label.fontFamily},y)},navigation:{disabled:n,button:{content:function(e,t){var n=t.direction;return e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:v[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:c,style:d})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,r=e.key,i=e.styleReference,o=e.styleOverrides,a=e.rtl,s=e.settings,l=e.style,u=t.scaleKey,c=t.theme,d="".concat(u,"Range"),m=Il(e,t);if(!m.show)return!1;var f=Nl({theme:c,key:i,styleOverrides:o}),p=m.layout.dock,h="right"===p||"left"===p,g=null===(n=t.scales)||void 0===n?void 0:n[d];return h&&g&&(g.invert=!0),cs(!0,m,{type:"legend-seq",key:"".concat(r,"-seq"),settings:{fill:u,major:d,length:1,tick:{fill:f.label.color,fontSize:f.label.fontSize,fontFamily:f.label.fontFamily},title:{anchor:!a||"top"!==m.layout.dock&&"bottom"!==m.layout.dock?void 0:"right",padding:parseFloat(m.settings.title.fontSize)||16}}},{settings:s,style:l})}(e,t)}function Rl(e,t,n){var r=[],i=[],o=Pl(e,t,n&&n.navigationDisabled);return r.push(o),o&&"legend-cat"===o.type&&(i.push(function(e){var t=e.key,n=e.requireFailure,r=e.recognizeWith,i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var r;if(!n)return!0;if(null!=i&&null!==(r=i.interact)&&void 0!==r&&r.enabled&&!i.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),i.push(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.eventName,r=t.key,i=t.requireFailure,o=t.recognizeWith,a=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(r),type:"Pan",requireFailure:i,recognizeWith:o,options:{event:n,pointers:1,threshold:10,enable:function(e,t){var i;return this.started===n||!t||!(null!=a&&null!==(i=a.interact)&&void 0!==i&&i.enabled&&!a.interact.enabled())&&this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}).some((function(e){return e.key==="".concat(r,"-cat")}))}},events:(e={},Xa(e,"".concat(n,"start"),(function(e){e.preventDefault(),this.started!==n&&(this.started=n,this.chart.component("".concat(r,"-cat")).emit("panstart",e))})),Xa(e,"".concat(n,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panmove",e)})),Xa(e,"".concat(n,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panend",e),this.started=!1})),e)}}(e,n))),{interactions:i,components:r}}var Fl=function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")};function Hl(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=ql(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(e,t){var n=t.layout,r=t.app;return Dl(e,{layout:n,app:r})})).getMeasure((function(e,t){var n=t.layout,r=t.app;return Cl(e,{layout:n,app:r})})).getAttributeDimension((function(e,t){var n=t.layout,r=t.model,i=t.app;return wl(e,{layout:n,model:r,app:i})}));return n.getSnapshotData=Ml,n}({resources:e}),n={},r={},i=function(e){return r.settings||(e||console.warn("settings() called before auxiliarySettings()"),r.settings=t.settings()),r.settings},o={config:function(i){if(n=$a({},i),r={},!n.key)throw new Error("Missing key");t.set($a($a({},e),n))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return r.auxiliarySettings?Promise.resolve(r.auxiliarySettings):t.getAuxiliarySettings(i(!0),e).then((function(e){return r.auxiliarySettings=e||{},r.settings=$a($a({},r.settings),r.auxiliarySettings),r.scales=void 0,r.color=void 0,r.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(i())},getSnapshotData:function(e){var n=i();return t.getAuxiliaryData(n,e).then((function(e){return t.getSnapshotData(n,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=i();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=i().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(i(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,r=e.theme,i=[];if(n&&n.palettes&&r){var o=n.palettes.categorical||t.dimensionScheme,a=r.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||r.getDataColorPalettes()[0];o&&a&&i.push({key:"categorical",colors:a.colors});var s=n.palettes.metric||t.measureScheme,l=r.getDataColorScales().filter((function(e){return e.key===s}))[0];if(l){var u=l.colors[0]?l.colors:[[]].concat(Qa(l.colors.slice(1)));u=Array.isArray(u[0])?u.map((function(e){return e.slice().reverse()})):u.slice().reverse(),i.push({key:"quant",colors:u})}}return i}({coloring:i(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return r.scales=r.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,r=e.rtl,i=e.key,o=e.source,a=e.picasso,s={},l=i;if(n){var u={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(Qa((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(Qa((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var c,d=function(e){var t=e.hc,n=e.source,r=e.coloring,i={data:{extract:[{source:"dummy",field:0,filter:function(){return i.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:r.field,trackBy:r.valueAccessor,reduce:"first",props:{row:{reduce:function(){return i.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return i}({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var m=0,f={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return f[t]=m++,e[0]}}),c={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return f[e.qElemNumber]}}}}}}var p={data:d,range:n.range,domain:n.domain,explicit:u,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};s[l]=p,c&&(s["".concat(l,"Legend")]=$a($a({},p),{},{data:c})),t&&t.qHasOtherValues&&c&&((c||p.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var h={data:{field:n.field},min:n.min,max:n.max};s[l]=cs({},h,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=cs({},h,{invert:!!r}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var g={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=g}else if("measure"===n.mode){var y={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(t=t.exclude)&&void 0!==t&&t.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=y}}return s}({hc:n.hc,coloring:i(),key:n.key,source:n.source,picasso:e.picasso}),r.scales},color:function(){return r.color=r.color||function(e){var t=e.coloring,n=e.scales,r=e.key,i=Ll(r),o=Ll("".concat(r,"IsAnOther")),a=function(e,t){var r=e.fieldType,a=e.invalid,s=e.mode,l=e.nil,u=e.others,c=e.primary,d=e.type;return a?function(e){return Tl(e)||o(e)?u:l}:n[t]?function(e){return Tl(e)?u:El(e)||-2===i(e)&&"dimension"===r||"NaN"===i(e)?l:o(e)?u:e.resources.scale(t)(i(e))||u}:"constant"===s?function(e){return Tl(e)||o(e)?u:El(e)?l:c}:"color"===d?function(e){return Tl(e)||o(e)?u:El(e)?l:i(e)||u}:null},s=a(t,r);if(t.measureOverrides){var l=Ll("".concat(r,"MeasureIdx")),u=t.measureOverrides.map((function(e){return e&&a(e)}));return function(e){var t=l(e);return u[t]?u[t](e):s(e)}}return s}({coloring:i(),scales:this.scales(),key:n.key}),r.color},datumProps:function(e){return function(e){var t,n,r=e.hc,i=e.coloring,o=e.scales,a=e.key,s=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=a,c=i.nil;"field"===i.mode&&i.field?t=i.field:o[a]&&"field"===i.mode&&(t=o[a].data.field||i.field),t?(n={field:t,reduce:"first"},"color"===i.type&&(n.value=function(e){return"NaN"!==e.qNum?Fl(e.qNum):e.qText&&Os(e.qText)?e.qText:c})):"dimension"===i.mode?n=void 0!==i.field?i.field:r.qDimensionInfo.length-1:"measure"===i.mode&&(n=l);var d=Xa({},u,n);return r.qDimensionInfo.length>1&&(d["".concat(u,"IsAnOther")]={fields:r.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),s&&(d["".concat(u,"MeasureIdx")]=l),d}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:i().measureOverrides},e)},data:function(){var e=i(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,r=e.key,o=e.viewState,a=e.chart,s=e.rtl,l=e.styleReference,u=void 0===l?"object.legend":l,c=e.styleOverrides,d=e.settings,m=void 0===d?{}:d,f=e.style,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Rl({eventName:t,key:r,rtl:s,viewState:o,chart:a,styleReference:u,styleOverrides:c,settings:m,style:void 0===f?{}:f},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},p)}};return o}var zl=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function jl(e){var t=e.qHyperCube,n=t.qDimensionInfo,r=t.qMeasureInfo,i=n.some(zl),o=r.some(zl),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!i?"off":a}function Bl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return $a($a($a({},e),t),{},{colorProps:$a($a({},e.colorProps),t.colorProps||{})})}var Vl=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function _l(e){var t,n=e.qHyperCube.qDimensionInfo.some(Vl),r=e.qHyperCube.qMeasureInfo.some(Vl),i=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=i?i:r?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var Ul=function(){};function $l(e){var t,n,r,i,o=e.picasso,a=e.model,s=e.app,l=e.translator,u=e.layoutService,c=void 0===u?void 0:u,d=e.createConfig,m=void 0===d?Ul:d,f=e.config,p=void 0===f?{}:f,h=e.custom,g=void 0===h?{}:h,y=p.localeInfo,v=p.key,b=p.theme,x=void 0===b?void 0:b,q=p.auto,M=void 0===q?void 0:q,S=p.definitionPath,D=null==c||null===(t=c.getLayout)||void 0===t?void 0:t.call(c),C={theme:x,key:v,localeInfo:y,layout:D,hc:null==c||null===(n=c.getHyperCube)||void 0===n?void 0:n.call(c),legendProps:null==c||null===(r=c.getLayoutValue)||void 0===r?void 0:r.call(c,"legend"),colorProps:$a($a({},null==c||null===(i=c.getLayoutValue)||void 0===i?void 0:i.call(c,"color")),{},{useBaseColors:D?jl(D):void 0})},w=Hl({picasso:o,model:a,app:s,translator:l,auto:M});!1!==M&&w.auto((function(e){return M?M({layout:e,defaultAuto:_l}):_l(e)}));var L=!1,E={getColor:function(){return w.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return w.resolveUIColor({index:t,color:n})},getData:function(){return w.data()},getDatumProps:function(e){return w.datumProps(e)},getSnapshotData:function(){return w.getSnapshotData(S)},getSettingsForMeasure:function(e){return w.settingsForMeasure(e)},getSettings:function(){return w.settings()},getLegend:function(e,t){return w.legend(e,t)},getScales:function(){return w.scales()},getPalettes:function(){return w.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return w.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return L},custom:$a({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?m:e)({getUseBaseColors:jl}),n=Bl(C,t);return w.config(n),w.getAuxiliarySettings(S).then((function(){L=!0}))}};return E}function Wl(e){var t=e.chart,n=e.logicalSize;if(n)return n;var r=t?t.element.getBoundingClientRect():{};return{width:r.width,height:r.height}}var Kl=[{key:"FULL",size:{width:550,height:450}},{key:"MEDIUM",size:{width:400,height:220}},{key:"SMALL",size:{width:300,height:150}},{key:"XSMALL",size:{width:150,height:75}}];function Gl(e){var t=e.width,n=e.height,r=Kl.filter((function(e){return t>=e.size.width&&n>=e.size.height})).shift();return r?r.key:"SPARK"}var Yl={left:"right",right:"left",top:"bottom",bottom:"top",near:"far",far:"near"};function Xl(e){var t=e.orientation,n=e.dock,r=e.btt,i=e.rtl,o="horizontal"===t?function(e){return"bottom"===e||"near"===e?"bottom":"top"}(n):function(e,t){var n="left"===e||"near"===e?"left":"right";return t?Yl[n]:n}(n,i),a=function(e,t,n){return"vertical"===e?t?"bottom":"top":n?"right":"left"}(t,r,i);return{current:o,opposite:Yl[o],start:a,end:Yl[a]}}function Jl(e){var t=e.chart,n=e.layoutService,r=e.config,i=void 0===r?{}:r,o=i.logicalSize,a=void 0!==o&&o,s=i.rtl,l=void 0!==s&&s,u={chart:{size:void 0,mode:void 0},x:{dock:void 0,opposite:void 0,size:void 0},y:{dock:void 0,opposite:void 0,size:void 0}},c={type:"x-y",config:$a({},i),meta:u,update:function(e){u.chart.size={width:e.width,height:e.height},u.chart.mode=Gl(e);var t=Xl({orientation:"horizontal",dock:n.getLayoutValue("xAxis.dock"),btt:!1,rtl:l}),r=t.current,i=t.opposite;u.x.dock=r,u.x.opposite=i,u.x.size=e.width;var o=Xl({orientation:"vertical",dock:n.getLayoutValue("yAxis.dock"),btt:!0,rtl:l}),a=o.current,s=o.opposite;u.y.dock=a,u.y.opposite=s,u.y.size=e.height}};return c.update(Wl({chart:t,logicalSize:a})),c}var Zl="vertical",Ql="horizontal";function eu(e){var t=e.chart,n=e.layoutService,r=e.config,i=void 0===r?{}:r,o=e.typeConfig,a=void 0===o?{}:o,s=i.logicalSize,l=void 0!==s&&s,u=i.rtl,c=void 0!==u&&u,d=a.fallback===Zl?Zl:Ql,m=!!a.invert,f=a.measureAxes||[{ref:"measureAxis",name:"minor"}],p={chart:{orientation:void 0,size:void 0,mode:void 0},major:{orientation:void 0,dock:void 0,opposite:void 0,size:void 0}},h={type:"major-minor",config:$a({},i),meta:p,update:function(e){p.chart.orientation=n.getLayoutValue("orientation",d),p.chart.size={width:e.width,height:e.height},p.chart.mode=Gl(e),p.major.orientation=function(e){var t=e.chartOrientation,n=e.invert;return e.layoutService.meta.isContinuous?Ql:n?t===Zl?Ql:Zl:t}({layoutService:n,chartOrientation:p.chart.orientation,invert:m});var t=Xl({orientation:p.major.orientation,dock:n.getLayoutValue("dimensionAxis.dock"),btt:!1,rtl:c}),r=t.current,i=t.opposite;p.major.dock=r,p.major.opposite=i,p.major.size=p.major.orientation===Zl?e.height:e.width,f.forEach((function(t){var r={};r.orientation=p.major.orientation===Zl?Ql:Zl;var i=Xl({orientation:r.orientation,dock:n.getLayoutValue("".concat(t.ref,".dock")),btt:!0,rtl:c}),o=i.current,a=i.opposite,s=i.start,l=i.end;r.dock=o,r.opposite=a,r.start=s,r.end=l,r.size=r.orientation===Zl?e.height:e.width,p[t.name]=r}))}};return h.update(Wl({chart:t,logicalSize:l})),h}function tu(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}var nu=["__proto__","constructor"];function ru(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!nu.some((function(e){return r.includes(e)}))){for(var o=e,a=0;a<r.length-1;++a){var s=r[a];void 0===o[s]&&(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}}}function iu(){var e={};return{get:function(t){return e[t]},set:function(t,n){return e[t]=n,n},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}function ou(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e},n=iu();return function(r){var i=t(r);return n.has(i)?n.get(i):n.set(i,e(r))}}function au(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return function(){for(var r=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];clearTimeout(t),t=setTimeout((function(){return e.apply(r,o)}),n)}}function su(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,o=0;return function(){t=this;for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];n=s;var u=Date.now()-o,c=function(){o=Date.now(),r=0,e.apply(t,n)};r||(u>=i?c():r=setTimeout(c,i-u))}}var lu={ERROR_CODES:[7005],DIMENSION:"qDimensionInfo",MEASURE:"qMeasureInfo"},uu=function(e,t){return e[t].reduce((function(e,t,n){var r;return r=t,lu.ERROR_CODES.some((function(e){var t;return e===(null===(t=r.qError)||void 0===t?void 0:t.qErrorCode)}))?e.filtered.push(n):e.reduced.push(t),e}),{reduced:[],filtered:[]})};function cu(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[]).map((function(e){var t,n=null===(t=e.qCardinalities)||void 0===t?void 0:t.qHypercubeCardinal;if(n)return n;var r=e.qStateCounts||{},i=r.qLocked,o=void 0===i?0:i,a=r.qOption,s=void 0===a?0:a,l=r.qSelected;return o+s+(void 0===l?0:l)}))}function du(e){switch(e.qHyperCube.qMode){case"S":return function(e){var t=e.qHyperCube.qSize;return{refs:{dataPages:"qHyperCube.qDataPages"},size:{x:t.qcx,y:t.qcy,dimensions:cu(e)}}}(e);case"K":return function(e){var t=cu(e);return{refs:{dataPages:"qHyperCube.qStackedDataPages"},size:{x:e.qHyperCube.qSize.qcx,y:t[0],dimensions:t}}}(e);case"T":return function(e){var t=cu(e);return{refs:{dataPages:"qHyperCube.qTreeDataPages"},size:{x:e.qHyperCube.qSize.qcx,y:t[0],dimensions:t}}}(e);default:throw new Error("Mode not supported")}}function mu(e){var t=e.source,n=e.metaAdditionsFn,r=e.experimental,i=void 0===r?{filter:!1}:r,o=cs(!0,{},t),a=i.filter?function(e){var t=e.qHyperCube,n=uu(t,lu.DIMENSION),r=n.reduced,i=n.filtered;t[lu.DIMENSION]=r;var o=uu(t,lu.MEASURE),a=o.reduced,s=o.filtered;return t[lu.MEASURE]=a,{dimensions:i,measures:s}}(o):{dimensions:[],measures:[]},s=du(o),l=function(){var e=function(e){var t=e.layout,n=e.additionsFn,r=void 0===n?function(){return{}}:n,i=e.additionsProps,o=void 0===i?{}:i,a=t.qHyperCube,s=a.qDimensionInfo,l=a.qMeasureInfo,u=a.qMode,c=s.length,d=l.length,m=$a({mode:{S:"S"===u,P:"P"===u,K:"K"===u,T:"T"===u},dimensionCount:c,measureCount:d,hasMultipleDimensions:c>1,hasMultipleMeasures:d>1,isOneDimensional:1===c,isTwoDimensional:2===c},o);return $a($a({},m),r({layout:t,meta:m}))}({layout:o,additionsFn:n,additionsProps:{size:s.size}});return e.filteredFields=a,e},u={refs:$a({},s.refs),meta:l(),getLayout:function(){return o},getLayoutValue:function(e,t){return tu(o,e,t)},setLayoutValue:function(e,t){ru(o,e,t),s=du(o),u.meta=l()},getHyperCube:function(){return o.qHyperCube},getHyperCubeValue:function(e,t){return tu(o.qHyperCube,e,t)},setHyperCubeValue:function(e,t){ru(o.qHyperCube,e,t),s=du(o),u.meta=l()},getDataPages:function(){return tu(o,s.refs.dataPages)},setDataPages:function(e){ru(o,s.refs.dataPages,e),u.meta=l()}};return u}function fu(e){var t=e.originalArray,n=e.newArray,r=e.matchKey;return Array.isArray(t)&&t.length?(n.forEach((function(e){var n=-1;t.some((function(t,i){return t[r]&&t[r]===e[r]&&(n=i),n})),n>-1?t[n]=e:t.push(e)})),t):n}function pu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pu(Object(n),!0).forEach((function(t){gu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gu(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var yu=Object.prototype.hasOwnProperty,vu=Object.prototype.toString,bu=Object.defineProperty,xu=Object.getOwnPropertyDescriptor,qu=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===vu.call(e)},Mu=function(e){if(!e||"[object Object]"!==vu.call(e))return!1;var t,n=yu.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&yu.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||yu.call(e,t)},Su=function(e,t){bu&&"__proto__"===t.name?bu(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Du=function(e,t){if("__proto__"===t){if(!yu.call(e,t))return;if(xu)return xu(e,t).value}return e[t]},Cu=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=Du(s,n),s!==(i=Du(t,n))&&(c&&i&&(Mu(i)||(o=qu(i)))?(o?(o=!1,a=r&&qu(r)?r:[]):a=r&&Mu(r)?r:{},Su(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&Su(s,{name:n,newValue:i}));return s};function wu(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=i.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),s=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(r)&&r.some(((e,t)=>e!==t))){const e=r.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:l>=0?e=>e[a].qAttrDims.qValues[l]:s>=0?e=>e[a].qAttrExps.qValues[s]:e=>e[a]}function Lu(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function Eu(e){let{cache:t,f:n,mainCell:r,p:i,prop:o,page:a,rowIdx:s,row:l,sourceKey:u,target:c,targetProp:d,columnOrder:m}=e,f=r;if(i.field&&i.field!==n){const e=wu(i.field,a,{cache:t},m);if(-1===e)return;f=Cu({qRow:s},e(l))}c[d]=Lu(i,f,{key:u})}function Tu(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const a=t.raw(),s=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:u,main:c}=r.normalizeConfig(i[e],t),d=Object.keys(u),m=!!i[e].trackBy,f=typeof i[e].trackBy,p={},h=[],g=[];for(let t=0;t<a.qDataPages.length;t++){const o=wu(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let y=0;y<a.qDataPages[t].qMatrix.length;y++){const v=a.qDataPages[t].qArea.qTop+y,b=Cu({qRow:v},o(a.qDataPages[t].qMatrix[y])),x=Lu(c,b,{key:s});if(!c.filter||c.filter(b)){for(let e=0;e<d.length;e++){const r=u[d[e]];let i=r.fields||[r];r.fields&&(x[d[e]]=[]);for(let o=0;o<i.length;o++)Eu({cache:n,f:l,mainCell:b,p:i[o],prop:d[e],props:u,page:a.qDataPages[t],rowIdx:v,row:a.qDataPages[t].qMatrix[y],sourceKey:s,target:r.fields?x[d[e]]:x,targetProp:r.fields?o:d[e],columnOrder:a.qColumnOrder});if(r.fields){const t=x[d[e]].map((e=>e.value)),n=x[d[e]].map((e=>e.label));x[d[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[d[e]].value)}}}m&&r.track({cfg:i[e],itemData:b,obj:x,target:h,tracker:p,trackType:f}),g.push(x)}}}const y=m?r.collect(h,{main:c,propsArr:d,props:u}):g;o=[...o,...y]}return o}function Au(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function Nu(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Ou)):void 0===t&&(t=ku);for(var n,r,i,o,a,s=new Ru(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new Ru(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Pu)}function ku(e){return e.children}function Ou(e){return Array.isArray(e)?e[1]:null}function Iu(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Pu(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Ru(e){this.data=e,this.depth=this.height=0,this.parent=null}function Fu(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}Ru.prototype=Nu.prototype={constructor:Ru,count:function(){return this.eachAfter(Au)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(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}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(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}(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},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Nu(this).eachBefore(Iu)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}};var Hu={depth:-1},zu={},ju={};function Bu(e){return e.id}function Vu(e){return e.parentId}function _u(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Uu(e,t););return e.slice(0,t)}function Uu(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(0==(1&n))return!0}return!1}function $u(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=$u(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=$u(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function Wu(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...Wu(e[i].children,t-1,n)]);return r}function Ku(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const r=Math.max(0,Math.min(100,t-e));return e=>Wu(e.children,r-1,n)}return!1}const Gu=/^qDimensionInfo(?:\/(\d+))?/,Yu=/^\/?qMeasureInfo\/(\d+)/,Xu=/\/qAttrExprInfo\/(\d+)/,Ju=/\/qAttrDimInfo\/(\d+)/;function Zu(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function Qu(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,u=-1,c=-1,d=r;const m=n.qEffectiveInterColumnSortOrder,f=Zu(n);return Gu.test(d)&&(i=!0,o=+Gu.exec(d)[1],d=r.replace(Gu,"")),Yu.test(d)&&("K"===n.qMode?u=+Yu.exec(d)[1]:m&&-1!==m.indexOf(-1)?(u=+Yu.exec(d)[1],c=0):c=+Yu.exec(d)[1],d=d.replace(Yu,"")),d&&(Ju.exec(d)?s=+Ju.exec(d)[1]:Xu.exec(d)&&(a=+Xu.exec(d)[1])),l=i?"S"===n.qMode?f[o]:m?m.indexOf(o):o:m&&-1!==m.indexOf(-1)?m.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:u,measureIdx:c,attrDimIdx:s,attrIdx:a}}function ec(e,t){let n,r,i=Ku(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function tc(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function nc(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let u,c;s.fields&&(u=[],c=[]);for(let n=0;n<l.length;n++){const d=l[n];let m,f,p,h,g,y;if("primitive"===d.type?(p=d.value,y=String(d.value)):("function"==typeof d.value&&(m=e=>d.value(e,r)),"function"==typeof d.label&&(f=e=>d.label(e,r)),d.accessor?(h=d.accessor(r),Array.isArray(h)?(g=h.map(d.valueAccessor),d.attrAccessor&&(g=g.map(d.attrAccessor)),m&&(p=g.map(m),m=null),f&&(y=g.map(f),f=null),p=d.reduce?d.reduce(p):p,y=d.reduceLabel?d.reduceLabel(y,p):String(p)):(p=d.attrAccessor?d.attrAccessor(d.valueAccessor(h)):d.valueAccessor(h),y=p)):(p=i,y=i)),s.fields){const e=m?m(p):p;u.push(e),c.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=m?m(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},d.field&&(o[t[e]].source={field:d.field.key(),key:a})}}u&&(o[t[e]]={value:"function"==typeof s.value?s.value(u,r):u,label:"function"==typeof s.label?s.label(c,r):c})}}const rc=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=$u(r,e);return o&&o[0]?(t.tree=Nu(o[0],n.children||(e=>e[i])),t.tree):null};function ic(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}(e),r=e.fields(),i=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),o=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let r="__root",l=!1;for(let e=0;e<i.length;e++){var s;const t=n[i[e]],o="".concat(r,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=hu({__id:o,__parent:r,qValues:[]},t),l=!0),r=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[r].qValues.push(t)}}const l=Object.keys(a).map((e=>a[e]));return function(){var e,t=Bu,n=Vu;function r(r){var i,o,a,s,l,u,c,d,m=Array.from(r),f=t,p=n,h=new Map;if(null!=e){const t=m.map(((t,n)=>function(e){let t=(e=`${e}`).length;return Uu(e,t-1)&&!Uu(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r)))),n=t.map(_u),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(_u(e)),m.push(ju));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,i=m.length;a<i;++a)o=m[a],u=m[a]=new Ru(o),null!=(c=f(o,a,r))&&(c+="")&&(d=u.id=c,h.set(d,h.has(d)?zu:u)),null!=(c=p(o,a,r))&&(c+="")&&(u.parent=c);for(a=0;a<i;++a)if(c=(u=m[a]).parent){if(!(l=h.get(c)))throw new Error("missing: "+c);if(l===zu)throw new Error("ambiguous: "+c);l.children?l.children.push(u):l.children=[u],u.parent=l}else{if(s)throw new Error("multiple roots");s=u}if(!s)throw new Error("no root");if(null!=e){for(;s.data===ju&&1===s.children.length;)s=s.children[0],--i;for(let e=m.length-1;e>=0&&(u=m[e]).data===ju;--e)u.data=null}if(s.parent=Hu,s.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(Pu),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=Fu(e),r):t},r.parentId=function(e){return arguments.length?(n=Fu(e),r):n},r.path=function(t){return arguments.length?(e=Fu(t),r):e},r}().id((e=>e.__id)).parentId((e=>e.__parent))(l)}const oc=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields?s.fields:[s];for(let e=0;e<l.length;e++){const t=l[e];if(t.field!==a){const e=ec(o,Qu(t.field,{cube:r,cache:i}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function ac(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const i=t.raw(),o=t.key(),a="S"===i.qMode?ic(t):rc(i,n,e);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===i.qMode){let e=Zu(i)[o-1];a=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),a=n.fields[e]}const{props:s,main:u}=r.normalizeConfig(hu(hu({},e),{},{field:a?a.key():void 0}),t),c=Object.keys(s);l[o]={propsArr:c,props:s,main:u};const d=a?Qu(a,{cube:i,cache:n}):{fieldDepth:0};oc({propsArr:c,props:s,cube:i,cache:n,itemDepthObject:d,f:a})}const u=a.copy().descendants(),c=a.descendants();for(let e=0;e<c.length;e++){const t=l[c[e].depth].propsArr,n=l[c[e].depth].props,r=l[c[e].depth].main,i=u[e],a=i.data,s=tc(r,a,{key:o});nc({propsArr:t,props:n,item:i,itemData:a,ret:s,sourceKey:o,isTree:!0}),c[e].data=s}return a}function sc(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<i.length;a++)if(void 0!==i[a].field){const s=t.raw(),l=t.key();if(!rc(s,n,e))continue;const u="object"==typeof i[a].field?i[a].field:t.field(i[a].field),{props:c,main:d}=r.normalizeConfig(i[a],t),m=Object.keys(c),f=Qu(u,{cube:s,cache:n}),{nodeFn:p,attrFn:h,valueFn:g}=ec({fieldDepth:0},f);oc({propsArr:m,props:c,cube:s,cache:n,itemDepthObject:f,f:u});const y=!!i[a].trackBy,v=typeof i[a].trackBy,b={},x=[],q=p(n.tree),M=[];for(let e=0;e<q.length;e++){const t=q[e],n=h?h(g(t)):g(t);if(d.filter&&!d.filter(n))continue;const o=tc(d,n,{key:l});nc({propsArr:m,props:c,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[a],itemData:n,obj:o,target:x,tracker:b,trackType:v}),M.push(o)}const S=y?r.collect(x,{main:d,propsArr:m,props:c}):M;o=[...o,...S]}return o}var lc,uc,cc=(lc=function(e){
8
8
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
9
- e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,d,f=e.length,m=e.search(/[0-9\-\+#]/),p=m>0?e.substring(0,m):"",h=e.split("").reverse().join(""),g=h.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(m,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",y=(d=t[0]).length%l,f=d.length,b=0;b<f;b++)h+=d.charAt(b),!((b-y+1)%l)&&b<f-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},Gs({exports:{}});var il={dataRelatedPropertiesPaths:["qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","qHyperCube.qDimensionInfo[].qCardinalities","qHyperCube.qDimensionInfo[].qMax","qHyperCube.qDimensionInfo[].qMin","qHyperCube.qDimensionInfo[].qStateCounts","qHyperCube.qMeasureInfo[].qApprMaxGlyphCount","qHyperCube.qMeasureInfo[].qAttrExprInfo","qHyperCube.qMeasureInfo[].qMax","qHyperCube.qMeasureInfo[].qMin","qHyperCube.qMeasureInfo[].qTrendLines","qHyperCube.qTreeNodesOnDim","qSelectionInfo"]};function ol(e){const{qHyperCube:t,...n}=e,{qAxisData:r,qDataPages:i,qStackedDataPages:o,qTreeDataPages:a,...s}=t,l=Y(!0,{},{...n,qHyperCube:{...s,qAxisData:null,qDataPages:null,qStackedDataPages:null,qTreeDataPages:null}}),{dataRelatedPropertiesPaths:u}=il;return u.forEach((e=>{const t=e.split("[");if(1===t.length)void 0!==Ks(l,e)&&Xs(l,e,null);else{const e=t[0],n=t[1].split("].")[1];Ks(l,e,[]).forEach((e=>{void 0!==Ks(e,n)&&Xs(e,n,null)}))}})),l}var al={axes:{trackBy:function({isTime:e,isContinuous:t,isMeasure:n,isMajor:r}){return i=>{if(e||t||n){var o;if("line"===i.type)return null!==(o=i.tickValue)&&void 0!==o?o:"axis";if("text"===i.type)return`${i.tickValue} ${i.text}`;if("container"===i.type){const e=i.children.filter((e=>"text"===e.type)).map((e=>e.text));return`${i.data.value} ${e.join("")}`}return Math.random()}if(r){if("line"===i.type&&void 0===i.tickValue)return"axis";const e=i.transform&&i.transform.match(/rotate/gi)?"rotated":"horizontal";return`${i.data.group?`${i.data.group.value} `:""}${i.data.value} ${i.text} ${e}`}return Math.random()}},compensateForLayoutChanges:function({isMeasure:e,isTime:t,isContinuous:n,isHorizontal:r,dock:i}){return({currentNodes:o,currentRect:a,previousRect:s})=>{const l=a.x-s.x,u=a.y-s.y,c=a.width-s.width,d=a.height-s.height;e?("left"===i&&o.forEach((e=>{"line"===e.type?(e.x1+=c,e.x2+=c):"text"===e.type&&(e.x+=c)})),"left"!==i&&"right"!==i||o.forEach((e=>{var t;("line"===e.type&&(e.x1===e.x2?(e.y1=a.y,e.y2=e.y1+a.height):(Math.round(e.y1)<a.y||e.y1>a.y+a.height)&&(e.strokeWidth=0)),"text"===e.type)&&((e.y<a.y||e.y>a.y+a.height)&&(e.fontSize="1px","#"===(null===(t=e.fill)||void 0===t?void 0:t[0])&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`)))})),"top"!==i&&"bottom"!==i||o.forEach((e=>{var t;("line"===e.type&&(e.y1===e.y2?(e.x1=a.x,e.x2=e.x1+a.width):(Math.round(e.x1)<a.x||e.x1>a.x+a.width)&&(e.strokeWidth=0)),"text"===e.type)&&((e.x<a.x||e.x>a.x+a.width)&&(e.fontSize="1px","#"===(null===(t=e.fill)||void 0===t?void 0:t[0])&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`)))}))):t?o.forEach((e=>{"line"===e.type?e.y1===e.y2?e.x2+=c:e.x1===e.x2&&(e.x1-=l,e.x2-=l):"text"===e.type&&(e.x-=l)})):n||r?o.forEach((e=>{"line"===e.type&&e.y1===e.y2&&(e.x1+=l,e.x2+=l+c)})):o.forEach((e=>{"line"===e.type&&e.x1===e.x2&&(e.y1+=u,e.y2+=u+d)}))}}},bars:{trackBy:function(e){return e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach((e=>{e.children&&e.children.length>0&&e.children.forEach((e=>{void 0!==e.x&&void 0!==e.y?(e.x-=r,e.y-=i):e.transform=`translate(${-r}, ${-i})`}))}))}},barOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x;0===t.y-n.y&&0===r||e.forEach((e=>{e.children&&e.children.length>0&&e.children.forEach((e=>{e.opacity=0}))}))}},labels:{trackBy:function(e){if("rect"===e.type)return"-3"===e.data?Math.random():`${e.type} ${e.data} ${e.rotation}`;const t=e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal";return`${e.type} ${e.data} ${e.text} ${t}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach((e=>{e.transform&&e.transform.match(/rotate\(-90/gi)?(e.x+=i,e.y-=r):(e.x-=r,e.y-=i)}))},linkData:function(e){return e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`}},lines:{trackBy:function(e){var t;return"line"===e.type?null!==(t=e.value)&&void 0!==t?t:Math.random():"path"===e.type?`${e.generatorType} ${e.layerObj.id} ${e.data.source.key}`:Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;e.forEach((e=>{if(void 0!==e.x1&&void 0!==e.y1)e.y1===e.y2?(e.x2=e.x1+t.width,e.y1-=i,e.y2-=i):e.x1===e.x2&&(e.y2=e.y1+t.height,e.x1-=r,e.x2-=r);else{const t="x"===e.major.p?r/e.major.size:i/e.major.size,n="y"===e.minor.p?i/e.minor.size:r/e.minor.size;e.points.forEach((e=>{e.modified||(e.major-=t,e.minor-=n,e.minor0-=n,e.modified=!0)}))}}))}},lineOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x;0===t.y-n.y&&0===r||e.forEach((e=>{e.opacity=0}))}},points:{trackBy:function(e){return e.data.line?`${e.data.line.value} ${e.data.major.value}`:`${e.data.major.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach((e=>{e.cx-=r,e.cy-=i}))}},refLineLabels:{trackBy:function(e){if(void 0!==e.value){if("rect"===e.type)return`${e.value}`;if("text"===e.type)return`${e.value} ${e.text}`}return Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y,o=t.width-n.width,a=t.height-n.height;let s=-r,l=-i;e.forEach((e=>{switch(e.dock){case"right":r>0&&(s=t.width);break;case"left":o<0&&(s=-n.width);break;case"top":a<0&&(l=-n.height);break;case"bottom":i>0&&(l=t.height)}switch(e.type){case"text":case"rect":e.x+=s,e.y+=l;break;case"circle":e.cx+=s,e.cy+=l;break;case"path":e.transform=`translate(${s}, ${l})`}}))}},shadowBars:{trackBy:function(){return Math.random()}},cacheProperties:function({viewCache:e,layout:t}){const n=ol(t);e.set("dataIndependentProperties",JSON.stringify(n))},propertiesHaveChanged:function({viewCache:e,layout:t}){const n=ol(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)},nonUpdatingNode:{trackBy:function(){return Math.random()}}};const{getInputValue:sl,extractInfoFromInputValue:ll,resolveValue:ul}=Sa;var cl={resolveValue:ul,resolveInnerValues:({refLineLayout:e,refLineModel:t,layoutService:n})=>{if(n.meta.isGroupedByDimension){const r=sl({refLineLayout:e,layoutService:n});return ll(r,t,"innerValues")}},resolveNumInnerValues:({refLineLayout:e,refLineModel:t,layoutService:n})=>{if(n.meta.mode.K)return 0;const r=sl({refLineLayout:e,layoutService:n});return ll(r,t,"numInnerValues")||0},resolveValueText:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const{dimensionValuesInfo:r}=t,{canBeContinuous:i}=n.meta,o=sl({refLineLayout:e,layoutService:n});return r[o]&&i?r[o].qText:o},resolveValueInfo:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const r=sl({refLineLayout:e,layoutService:n}),{dimensionRefLineInfo:i}=t;return i[r]}};const dl=({isDimension:e,refLineLayout:t,refLineModel:n,layoutService:r,colorModel:i,dockService:o,chart:a,scale:s,axis:l,invert:u,component:c,isContinuous:d})=>{var f,m;const p={dir:l,line:{strokeWidth:(null==t||null===(f=t.style)||void 0===f?void 0:f.lineThickness)||2,strokeDasharray:null==t||null===(m=t.style)||void 0===m?void 0:m.lineType,stroke:i.resolveUIColor(t.paletteColor||{index:t.color})}};return!e||r.meta.isContinuous?(p.scale=s,p.value=t.refLineExpr.value):(p.valueInfo=cl.resolveValueInfo({refLineLayout:t,refLineModel:n,layoutService:r}),p.value=()=>{var e;const i=Sa.getScaledPosition({scale:a.scale(s),value:cl.resolveValue({refLineLayout:t,refLineModel:n,layoutService:r}),valueInfo:p.valueInfo,size:null===(e=a.component(c))||void 0===e?void 0:e.rect["horizontal"===o.meta.major.orientation?"width":"height"],align:t.align,invert:u,layoutService:r,isContinuous:d});return Number.isNaN(i)?void 0:i}),p};function fl({isDimension:e,refLineModel:t={},layoutService:n,colorModel:r,dockService:i,animationsEnabled:o,chart:a,scale:s,axis:l,rtl:u,key:c,mainComponentKey:d,path:f,minimumLayoutMode:m}){const p=e?t.dimensionRefLines:f?t.query.getRefLines(f):t.measureRefLines;if(!p.length)return!1;const h={key:c,type:"ref-line",layout:{minimumLayoutMode:m},lines:{y:[],x:[]},style:{oob:{show:!1}},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),animations:{enabled:o,trackBy:al.lines.trackBy,compensateForLayoutChanges:al.lines.compensateForLayoutChanges}},g=!(!e||"horizontal"!==i.meta.major.orientation||!u),y=!e||n.meta.isContinuous;return p.forEach((o=>{h.lines[l].push(dl({isDimension:e,refLineLayout:o,refLineModel:t,layoutService:n,colorModel:r,dockService:i,chart:a,scale:s,axis:l,invert:g,component:d,isContinuous:y}))})),h}const ml={referenceLine:{label:{name:{fontFamily:"Source Sans Pro, sans-serif",fontSize:"12px"}},outOfBounds:{backgroundColor:"#737373",color:"#e6e6e6",fontFamily:"Source Sans Pro, sans-serif",fontSize:"10px"}}},pl=({isDimension:e,layoutService:t,animationsEnabled:n,style:r,labels:i,scale:o,formatter:a,dock:s,key:l,rtl:u,theme:c,isContinuous:d,localeInfo:f})=>({key:l,type:"reference-line-labels",renderer:"svg",labels:i,formatter:a,scale:o,layoutService:t,layout:{dock:s,rtl:u},theme:c,isContinuous:d,isDimension:e,localeInfo:f,style:{label:{fontFamily:r.referenceLine.label.name.fontFamily,fontSize:r.referenceLine.label.name.fontSize,padding:{top:2,bottom:2,left:u?2:4,right:u?4:2},background:{padding:{top:1,bottom:1,left:2,right:2}},maxWidth:100,gap:"left"===s||"right"===s?10:16},oob:{size:8,fill:r.referenceLine.outOfBounds.backgroundColor,text:{fontFamily:r.referenceLine.outOfBounds.fontFamily,fontSize:r.referenceLine.outOfBounds.fontSize,fill:r.referenceLine.outOfBounds.color,background:{fill:r.referenceLine.outOfBounds.backgroundColor}}}},animations:{enabled:n,trackBy:al.refLineLabels.trackBy,compensateForLayoutChanges:al.refLineLabels.compensateForLayoutChanges}}),hl=({refLineLayout:e,refLineModel:t,layoutService:n,colorModel:r,scale:i,theme:o,isContinuous:a})=>{const s=r.resolveUIColor(e.paletteColor||{index:e.color}),l={align:e.align,text:e.label,fill:e.coloredBackground?o.getContrastingColorTo(s):s,showValue:!1!==e.showValue,showLabel:!1!==e.showLabel,inputValue:e.refLineExpr.value,inputValueLabel:e.refLineExpr.label};return e.coloredBackground&&(l.background={fill:s}),a?(l.scale=i,l.value=e.refLineExpr.value):(l.value=()=>cl.resolveValue({refLineLayout:e,refLineModel:t,layoutService:n}),l.valueText=()=>cl.resolveValueText({refLineLayout:e,refLineModel:t,layoutService:n}),l.valueInfo=()=>cl.resolveValueInfo({refLineLayout:e,refLineModel:t,layoutService:n})),l};function gl({isDimension:e,refLineModel:t={},layoutService:n,colorModel:r,animationsEnabled:i,dock:o,scale:a,style:s,formatter:l,theme:u,localeInfo:c,rtl:d,key:f,path:m}){const p=e?t.dimensionRefLineLabels:m?t.query.getRefLineLabels(m):t.measureRefLineLabels;if(!p.length)return[];const h=[],g=!e||n.meta.isContinuous,y=p.map((e=>hl({refLineLayout:e,refLineModel:t,layoutService:n,colorModel:r,scale:a,theme:u,isContinuous:g})));return h.push(pl({isDimension:e,rtl:d,style:Y(!0,ml,s),dock:o,key:f,labels:y,scale:a,formatter:l,layoutService:n,animationsEnabled:i,theme:u,isContinuous:g,localeInfo:c})),h}function yl({layoutService:e,discreteModel:t}){const{isContinuous:n,canBeContinuous:r,isGroupedByDimension:i}=e.meta,o=e.getLayout(),a="K"===o.qHyperCube.qMode,s=de.dimensionless(o),l=Sa.getMeasureRefLines(o),u=Sa.getDimensionRefLines(o,s),c=Sa.getMeasureRefLineLabels(o),d=Sa.getDimensionRefLineLabels(o,s);let f={},m={};const p=()=>!(!u||!u.length)&&!u.every((t=>{const o=Sa.getInputValue({refLineLayout:t,layoutService:e});return(t=>{if(r){const n=e.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:r,qMax:i}=n;return Sa.isOutOfRange({value:t,qMin:r,qMax:i})}return!1})(o)||(t=>{if(!m[t])return!1;if(!n&&i){const n={valueInfo:m[t]},r="S"===e.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",i=e.getHyperCubeValue(r);return Sa.isOutOfDataPages({label:n,dataPages:i})}return!0})(o)})),h={isKMode:a,canBeContinuous:r,measureRefLines:l,dimensionRefLines:u,measureRefLineLabels:c,dimensionRefLineLabels:d,dimensionRefLineInfo:m,dimensionValuesInfo:f,query:{getRefLines:e=>Sa.getRefLines(o,e),getRefLineLabels:e=>Sa.getRefLineLabels(o,e)},update:()=>{m=h.dimensionRefLineInfo,p()&&(f=Sa.getDimensionValuesInfo({layout:o,canBeContinuous:r,discreteModel:t,layoutService:e}),h.dimensionValuesInfo=f,u.forEach((t=>{const n=Sa.getInputValue({refLineLayout:t,layoutService:e});f[n]&&(m[n]?(m[n].innerValues=f[n].innerValues,m[n].minOrder=Math.min(m[n].minOrder,f[n].minOrder),m[n].maxOrder=Math.max(m[n].maxOrder,f[n].maxOrder),m[n].isMinOrderOk=m[n].isMinOrderOk||f[n].isMinOrderOk,m[n].isMaxOrderOk=m[n].isMaxOrderOk||f[n].isMaxOrderOk):m[n]={id:f[n].id,qText:f[n].qText,innerValues:f[n].innerValues,minOrder:f[n].minOrder,maxOrder:f[n].maxOrder,isMinOrderOk:f[n].isMinOrderOk,isMaxOrderOk:f[n].isMaxOrderOk},m[n].numInnerValues=(m[n].maxOrder||0)-(m[n].minOrder||0)+1)})))}};return h.update(),h}const vl={combineBounds(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,r=Number.MAX_VALUE,i=-Number.MAX_VALUE;return e.forEach((e=>{e&&(t=Math.min(t,e.x,e.x+e.width),n=Math.max(n,e.x,e.x+e.width),r=Math.min(r,e.y,e.y+e.height),i=Math.max(i,e.y,e.y+e.height))})),{x:t,y:r,width:n-t,height:i-r}}},bl=(e,t,n)=>{if(!e)return Promise.resolve();let r=Yo.generate(t,n);return Y(!0,t,n),r&&r.length?(r=r.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),e.applyPatches(r,!0)):Promise.resolve()},xl=e=>{var t;return!(!e||e.qHasSoftPatches||e.qExtendsId||!(((null===(t=e.qMeta)||void 0===t?void 0:t.privileges)||[]).indexOf("update")>-1))};var ql={exports:{}};function Ml(){}function Sl(){}Sl.resetWarningCache=Ml;ql.exports=function(){function e(e,t,n,r,i,o){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Sl,resetWarningCache:Ml};return n.PropTypes=n,n}();var wl=H(ql.exports);function Dl(e){return"large"===e?"20px":"small"===e?"12px":"16px"}function Cl({d:e,size:t,style:n={},viewBox:r="0 0 16 16"}){const o={fontSize:Dl(t),display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-.125em",textRendering:"optimizeLegibility",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...n};return i.createElement("i",{style:o},i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:r,fill:"currentColor"},i.createElement("path",{d:e})))}const Nl={d:"M15.9993744,3 L15.9993744,5 L4.99937445,5 L4.99937445,3 L15.9993744,3 Z M8.99937445,7 L15.9993744,7 L15.9993744,9 L8.99937445,9 L8.99937445,7 Z M11.9993744,11 L15.9993744,11 L15.9993744,13 L11.9993744,13 L11.9993744,11 Z M2.2,11 L7,11 L7,9.00369263 C7,8.89323568 7.08954305,8.80369263 7.2,8.80369263 C7.2549016,8.80369263 7.30738916,8.82626165 7.34515712,8.86610844 L10.1852182,11.8624926 C10.2583124,11.93961 10.258346,12.0604218 10.1852948,12.13758 L7.34523376,15.1373102 C7.2692928,15.2175206 7.14270711,15.2209817 7.06249671,15.1450407 C7.02260076,15.1072683 7,15.0547472 7,14.9998069 L7,12.9043747 C4.79351111,12.9043747 2.8018683,12.9266213 1.02507156,12.9711145 L1.02507252,12.9711526 C0.472939773,12.9849787 0.014139487,12.5485949 0.000313396522,11.9964622 C0.000104473692,11.988119 -1.32268838e-12,11.9797736 -1.3231638e-12,11.9714278 L-1.83320026e-12,3 L2,3 L2,10.8 C2,10.9104569 2.08954305,11 2.2,11 Z"},kl={d:"M13,7 L8,7 L13,7 L13,4.98151367 C13,2.23029964 10.7614237,0 8,0 C5.23857625,0 3,2.23029964 3,4.98151367 L3,7 L3.75,7 L3,7 L4.5,7 L4.5,5.33193359 C4.5,3.21561511 5.54860291,1.5 8,1.5 C10.4513971,1.5 11.5,3.21561511 11.5,5.33193359 L11.5,7 L12.25,7 L3,7 C2.44771525,7 2,7.44771525 2,8 L2,15 C2,15.5522847 2.44771525,16 3,16 L13,16 C13.5522847,16 14,15.5522847 14,15 L14,8 C14,7.44771525 13.5522847,7 13,7 L3,7 L13,7 Z"},Al={d:"M6,10 L13,3 L15,5 L8,12 L6,14 L1,9 L3,7 L6,10 Z"},Ll={d:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z"},El={d:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};function Tl(e,t,n){(function({model:e,properties:t}){return e.modifiers?e.modifiers.apply({model:e,properties:t}):Promise.resolve()})({model:e,properties:n}).then((()=>{e.colorSupport&&e.colorSupport.colorByUpdater(n,"qHyperCubeDef.");let r=Yo.generate(t,n);r&&r.length&&(r=r.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),e.applyPatches(r,!0))}))}function Ol(e,t,n,r,i,o){e.getEffectiveProperties().then((a=>{const s=a.qHyperCubeDef[r].findIndex((e=>e.qDef.cId===t)),l=a.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r].findIndex((e=>e.qDef.cId===n)),u=Y(!0,{},a),c=u.qHyperCubeDef[r][s],d=u.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r][l];d.qAttributeDimensions=c.qAttributeDimensions,c.qAttributeDimensions=[],o||(d.qAttributeExpressions=c.qAttributeExpressions,c.qAttributeExpressions=[]),u.qHyperCubeDef[r][s]=d,u.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r][l]=c,i&&i({oldItem:c,newItem:d,oldProperties:a,newProperties:u,model:e}),Tl(e,a,u)}))}const Il=(e,t)=>{const n=[],r=[];return t.forEach((t=>{t.qCalcCondition.qCond.qv&&r.push(e.evaluate(t.qCalcCondition.qCond.qv).then((e=>{"0"===e&&n.push(t.qDef.cId)})))})),Promise.all(r).then((()=>n))};function Pl({dir:e,dock:t,altList:n,model:r,translator:i,app:o,onChange:a}){return 0===n.length?null:{dir:e,dock:t,getAlternatives(){const e=Il(o,n).then((e=>Promise.all(n.filter((t=>!e.includes(t.qDef.cId))).map((e=>function(e,t,n){if(e.qLibraryId)return t.getDimension(e.qLibraryId).then((e=>e.getLayout())).catch((()=>null)).then((e=>e?"H"!==e.qDim.qGrouping&&e.qDim.qLabelExpression?e.qDim.qLabelExpression:e.qDim.title:n.get("Object.ErrorMessage.MissingDimension")));const r=e.qDef.qLabelExpression;if(r)return t.evaluate(r);const i=e.qDef.qFieldLabels[0]||e.qDef.qFieldDefs[0];return Promise.resolve(i)}(e,o,i).then((t=>({id:e.qDef.cId,selected:!1,title:t}))))))));return e},changeTo(e,t){Ol(r,e,t,"qDimensions",a)}}}function Rl(e,t,n,r="/qHyperCubeDef"){return{breadcrumbs:e.qGroupFallbackTitles.slice(0,e.qGroupPos),drilldown:"H"===e.qGrouping,index:t,locked:!!e.qLocked,text:"H"===e.qGrouping?e.qGroupFallbackTitles[e.qGroupPos]:e.qFallbackTitle,popoverText:(i=e,"H"===i.qGrouping?i.title||"":i.qFallbackTitle||""),drillUp(e){n.drillUp(r,t,e)},id:e.cId};var i}function Fl({altList:e,app:t,dir:n,dock:r,model:i,onChange:o,skipAttributeExpressions:a,translator:s}){return 0===e.length?null:{dir:n,dock:r,getAlternatives(){const n=Il(t,e).then((n=>Promise.all(e.filter((e=>!n.includes(e.qDef.cId))).map((e=>function(e,t,n){if(e.qLibraryId)return t.getMeasure(e.qLibraryId).then((e=>e.getLayout())).catch((()=>null)).then((e=>e?e.qMeasure.qLabelExpression?e.qMeasure.qLabelExpression:e.qMeasure.qLabel||e.qMeasure.qDef:n.get("Object.ErrorMessage.MissingMeasure")));const r=e.qDef.qLabelExpression;if(r)return t.evaluate(r);const i=e.qDef.qLabel||e.qDef.qDef;return Promise.resolve(i)}(e,t,s).then((t=>({id:e.qDef.cId,selected:!1,title:t}))))))));return n},changeTo(e,t){Ol(i,e,t,"qMeasures",o,a)}}}function jl(e,t){return{breadcrumbs:[],drilldown:!1,index:t,locked:!1,text:e.qFallbackTitle,popoverText:e.qFallbackTitle,id:e.cId}}const Hl={bottom:{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},top:{anchorOrigin:{vertical:"top",horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"}},left:{anchorOrigin:{vertical:"center",horizontal:"left"},transformOrigin:{vertical:"center",horizontal:"right"}},right:{anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"}}},zl={menuItem:"alternative-menu-item",titleButton:"title-button",activeTitleButton:"active-title-button"},Bl=o(a)((()=>({textAlign:"start","&:focus":{boxShadow:"inset 0 0 0 2px #177FE6 !important"}}))),_l=o((({children:e,...t})=>i.createElement(s,j({size:"small",disableRipple:!0,disableTouchRipple:!0},t),e)))((()=>({"&:focus":{boxShadow:"inset 0 0 0 2px #177FE6 !important"}})));function Vl(e){const t=e=>{if("Tab"===e.key){const t=document.querySelectorAll(`.${zl.menuItem}`);let n;e.shiftKey?null!=t&&t.length&&t[0]===e.target&&(n=t[t.length-1]):null!=t&&t.length&&t[t.length-1]===e.target&&([n]=t),n&&setTimeout((()=>{n.focus()}),50)}};function n({title:e,selected:n,onClick:r}){const o=Se.detectTextDirection(e);return i.createElement(Bl,{role:"menuitem",button:!0,onClick:r,className:zl.menuItem,onKeyDown:t},i.createElement(c,{style:{minWidth:32}},i.createElement(Cl,{d:n?Al.d:""})),i.createElement(d,{primaryTypographyProps:{dir:o}},e))}function r({alignTo:e,changeTo:t,current:r,dir:o,dock:a,list:s,onClose:c,show:d,instruction:f}){const m=s.map((e=>i.createElement(n,{key:e.id,title:e.title,onClick:()=>t(e.id)})));return i.createElement(l,j({anchorEl:e,open:d,onClose:c},Hl[a],{PaperProps:{style:{minWidth:"250px",maxHeight:"300px"}}}),i.createElement(u,{dense:!0,dir:o,"aria-label":f,component:"nav"},i.createElement(n,{title:r,selected:!0,onClick:c}),m))}n.propTypes={title:wl.string.isRequired,selected:wl.bool,onClick:wl.func.isRequired},n.defaultProps={selected:!1},r.propTypes={alignTo:wl.any,changeTo:wl.func.isRequired,current:wl.string.isRequired,dir:wl.string.isRequired,dock:wl.string.isRequired,list:wl.array,onClose:wl.func.isRequired,show:wl.bool.isRequired,instruction:wl.string.isRequired},r.defaultProps={list:[],alignTo:null};class o extends i.Component{constructor(e){super(e),this.state={open:!1,inSelection:e.selections&&e.selections.isActive(),hasValidAlternatives:!1},this.openPopover=this.openPopover.bind(this),this.closePopover=this.closePopover.bind(this),this.changeTo=this.changeTo.bind(this),this.alignToRef=i.createRef()}componentDidMount(){const{popover:e,selections:t,supportConditional:n}=this.props;t&&(this.onSelectionsActivated=()=>this.setState({inSelection:!0}),this.onSelectionsDeactivated=()=>this.setState({inSelection:!1}),t.addListener("activated",this.onSelectionsActivated),t.addListener("deactivated",this.onSelectionsDeactivated),t.addListener("canceled",this.onSelectionsDeactivated)),e&&n&&e.getAlternatives().then((e=>{this.setState({hasValidAlternatives:0!==e.length})}))}componentDidUpdate(e,t){const{popover:n,supportConditional:r}=this.props;n&&r&&n.getAlternatives().then((e=>{t.hasValidAlternatives!==(0!==e.length)&&this.setState({hasValidAlternatives:0!==e.length})}))}componentWillUnmount(){const{selections:e}=this.props;e&&(e.removeListener("activated",this.onSelectionsActivated),e.removeListener("deactivated",this.onSelectionsDeactivated),e.removeListener("canceled",this.onSelectionsDeactivated))}changeTo(e){this.props.popover.changeTo(this.props.titleData.id,e),this.closePopover(e)}openPopover(e){if(!(this.state.closeTime&&Date.now()-this.state.closeTime<20)){if(e.target){const t=e.target.closest(`.${zl.titleButton}`);t&&t.classList.add(zl.activeTitleButton)}this.props.popover.getAlternatives().then((e=>{this.setState({open:!0,alternatives:e});document.querySelector(`.${zl.menuItem}`).focus()}))}}closePopover(e){if(this.setState({open:!1,closeTime:Date.now()}),"string"==typeof e)setTimeout((()=>{const t=document.querySelector(`.${zl.titleButton}[data-id="${e}"]`);t&&t.focus()}),1e3);else{const e=document.querySelector(`.${zl.activeTitleButton}`);e&&(e.classList.remove(zl.activeTitleButton),setTimeout((()=>{e.focus()}),50))}}render(){const{titleData:e,popover:t,translator:n,disabled:o,isDimension:a,padding:s,minWidth:l,hasAlternative:u,supportConditional:c}=this.props,d={flex:"1 1 auto",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:"normal",lineHeight:"normal",...this.props.style},f=e.breadcrumbs.length,m=o||this.state.inSelection,p=e.breadcrumbs.map(((t,n)=>i.createElement(_l,{style:{display:"flex",alignItems:"center",color:m&&"rgba(89, 89, 89, 0.8)",pointerEvents:m?"none":"auto",paddingTop:0,paddingBottom:0,height:"100%"},key:n,onClick:()=>m?void 0:e.drillUp(f-n),title:t},i.createElement("span",{style:d},t),i.createElement(Cl,j({},El,{size:"small",style:{margin:"0 8px"}}))))),h=c?this.state.hasValidAlternatives:u,g=t&&!this.state.open?this.openPopover:this.closePopover,y=!t||o||this.state.inSelection,v={display:"flex",alignItems:"center",width:"100%",color:y&&"rgba(89, 89, 89, 0.8)",height:"100%",border:!a&&y&&"none",paddingTop:0,paddingBottom:0};this.state.open&&(v.background="rgba(0,0,0,0.08)");s&&(v.padding=s),l&&(v.minWidth=l);const b=Se.detectTextDirection(e.text),x=i.createElement(_l,{"aria-label":n.get("Accessibility.Alternative.Instructions",[e.text]),style:v,onClick:y?void 0:g,title:e.text,tabIndex:y?-1:0,onFocus:y?void 0:e=>{e.currentTarget.style.boxShadow="0px 0px 0px 2px #177FE6 inset",e.currentTarget.style.borderRadius="2px"},onBlur:y?void 0:e=>{e.currentTarget.style.boxShadow="none",e.currentTarget.style.borderRadius="0px"},onMouseDown:e=>{e.preventDefault()},className:`${zl.titleButton} ${e.id}`,"data-id":e.id},e.locked&&i.createElement(Cl,j({},kl,{size:"small",title:n.get("Tooltip.selections.locked")})),i.createElement("span",{style:d,dir:b},e.text),t&&h&&i.createElement(Cl,j({},Ll,{size:"small",style:{margin:"0 8px"}})));return i.createElement(i.Fragment,null,e.drilldown&&i.createElement(Cl,j({},Nl,{size:"small",title:n.get("Tooltip.dimensions.drilldown"),style:{margin:"0 4px 0 0"}})),p,i.createElement("div",{ref:this.alignToRef,style:{overflow:"hidden",pointerEvents:h?"auto":"none",height:"100%"}},x),t&&h&&i.createElement(r,{dock:t.dock,dir:t.dir,current:e.popoverText,alignTo:this.alignToRef.current,show:this.state.open,list:this.state.alternatives,onClose:this.closePopover,changeTo:this.changeTo,instruction:n.get("Accessibility.Popover.Instructions")}))}}function a(e){return{top:"bottom",bottom:"top",left:"right",right:"left"}[e]}function s(e){return!e.isDimension&&se.getValue(e,"hyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures.length")>0}return o.propTypes={disabled:wl.bool.isRequired,padding:wl.string,minWidth:wl.string,titleData:wl.shape({breadcrumbs:wl.arrayOf(wl.string).isRequired,drilldown:wl.bool.isRequired,index:wl.number.isRequired,locked:wl.bool.isRequired,text:wl.string.isRequired,popoverText:wl.string.isRequired,drillUp:wl.func,id:wl.string.isRequired}).isRequired,popover:wl.shape({dir:wl.string.isRequired,dock:wl.string.isRequired,changeTo:wl.func.isRequired,getAlternatives:wl.func.isRequired}),translator:wl.shape({get:wl.func.isRequired}).isRequired,selections:wl.shape({isActive:wl.func,addListener:wl.func,removeListener:wl.func}),style:wl.shape({fontSize:wl.string,color:wl.string,fontFamily:wl.string}).isRequired,isDimension:wl.bool.isRequired,hasAlternative:wl.bool.isRequired,supportConditional:wl.bool.isRequired},o.defaultProps={popover:null,selections:null,padding:"",minWidth:""},{renderer:"react",disableTriggers:!0,preferredSize:function(){const{height:t}=e.measureText({text:"M",fontSize:this.style.fontSize,fontFamily:this.style.fontFamily});return this.settings.settings.isDimension||s(this.settings.settings)?Math.max(28,t):Math.max(20,t)},render(){const{settings:{app:e,disabled:t,explicitItemInfos:n,hyperCube:r,hyperCubeDef:l,isDimension:u,minWidth:c,model:d,onChangeToAlternative:f,padding:m,rtl:p,selections:h,skipAttributeExpressions:g,translator:y,supportConditional:v=!1},layout:{dock:b}}=this.settings,x="top"!==b&&"bottom"!==b||!p?"ltr":"rtl",q=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",height:"100%"};return"left"===e?(n.width=`${t.height}px`,n.height=`${t.width}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left"):"right"===e&&(n.width=`${t.height}px`,n.height=`${t.width}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left"),n}(b,this.rect),M=l&&l.qLayoutExclude&&l.qLayoutExclude.qHyperCubeDef,S=M&&M[u?"qDimensions":"qMeasures"]||[],w=n||r[u?"qDimensionInfo":"qMeasureInfo"],D=u?Pl:Fl,C=u?Rl:jl,N=d&&d.colorSupport&&d.modifiers&&D({altList:S,app:e,dir:p?"rtl":"ltr",dock:a(b),model:d,onChange:f,skipAttributeExpressions:g,translator:y}),k=(A=this.settings.settings).isDimension&&se.getValue(A,"hyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.length")>0||s(this.settings.settings);var A;const L=w.map(((e,n)=>{const r="number"==typeof e.explicitColumn?e.explicitColumn:n,a=C(e,r,d),s=n===w.length-1;return i.createElement(i.Fragment,{key:e.cId},i.createElement(o,{popover:N,titleData:a,model:d,translator:y,selections:h,disabled:t(),style:this.style,isDimension:u,padding:m,minWidth:c,hasAlternative:k,supportConditional:v}),!s&&i.createElement("span",{style:{lineHeight:"normal",...this.style}},", "))}));return i.createElement("div",{style:q,dir:x},L)}}}function $l(){return $l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$l.apply(this,arguments)}function Ul(e){return Ul="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ul(e)}function Wl(e){return e&&"object"===Ul(e)&&e.constructor===Object}function Kl(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},r=n.clone?$l({},e):e;return Wl(e)&&Wl(t)&&Object.keys(t).forEach((function(i){"__proto__"!==i&&(Wl(t[i])&&i in e?r[i]=Kl(e[i],t[i],n):r[i]=t[i])})),r}function Gl(e){var t=function(e,t){if("object"!==Ul(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Ul(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ul(t)?t:String(t)}function Yl(e,t,n){return(t=Gl(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xl(e){for(var t="https://mui.com/production-error/?code="+e,n=1;n<arguments.length;n+=1)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified Material-UI error #"+e+"; visit "+t+" for the full message."}function Jl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function Zl(e){if(e.type)return e;if("#"===e.charAt(0))return Zl(function(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(Xl(3,e));var r=e.substring(t+1,e.length-1).split(",");return{type:n,values:r=r.map((function(e){return parseFloat(e)}))}}function Ql(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function eu(e){var t="hsl"===(e=Zl(e)).type?Zl(function(e){var t=(e=Zl(e)).values,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return i-o*Math.max(Math.min(t-3,9-t,1),-1)},s="rgb",l=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return"hsla"===e.type&&(s+="a",l.push(t[3])),Ql({type:s,values:l})}(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function tu(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var nu=["xs","sm","md","lg","xl"];function ru(e,t,n){var r;return $l({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return console.warn(["Material-UI: theme.mixins.gutters() is deprecated.","You can use the source of the mixin directly:","\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3),\n },\n "].join("\n")),$l({paddingLeft:t(2),paddingRight:t(2)},n,Yl({},e.up("sm"),$l({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(r={minHeight:56},Yl(r,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Yl(r,e.up("sm"),{minHeight:64}),r)},n)}var iu={black:"#000",white:"#fff"},ou={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},au={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},su={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},lu={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},uu={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},cu={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},du={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},fu={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:iu.white,default:ou[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},mu={text:{primary:iu.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:ou[800],default:"#303030"},action:{active:iu.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function pu(e,t,n,r){var i=r.light||r,o=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=function(e,t){if(e=Zl(e),t=Jl(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return Ql(e)}(e.main,i):"dark"===t&&(e.dark=function(e,t){if(e=Zl(e),t=Jl(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return Ql(e)}(e.main,o)))}function hu(e){var t=e.primary,n=void 0===t?{light:au[300],main:au[500],dark:au[700]}:t,r=e.secondary,i=void 0===r?{light:su.A200,main:su.A400,dark:su.A700}:r,o=e.error,a=void 0===o?{light:lu[300],main:lu[500],dark:lu[700]}:o,s=e.warning,l=void 0===s?{light:uu[300],main:uu[500],dark:uu[700]}:s,u=e.info,c=void 0===u?{light:cu[300],main:cu[500],dark:cu[700]}:u,d=e.success,f=void 0===d?{light:du[300],main:du[500],dark:du[700]}:d,m=e.type,p=void 0===m?"light":m,h=e.contrastThreshold,g=void 0===h?3:h,y=e.tonalOffset,v=void 0===y?.2:y,b=tu(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function x(e){var t=function(e,t){var n=eu(e),r=eu(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}(e,mu.text.primary)>=g?mu.text.primary:fu.text.primary;return t}var q=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=$l({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(Xl(4,t));if("string"!=typeof e.main)throw new Error(Xl(5,JSON.stringify(e.main)));return pu(e,"light",n,v),pu(e,"dark",r,v),e.contrastText||(e.contrastText=x(e.main)),e},M={dark:mu,light:fu};return Kl($l({common:iu,type:p,primary:q(n),secondary:q(i,"A400","A200","A700"),error:q(a),warning:q(l),info:q(c),success:q(f),grey:ou,contrastThreshold:g,getContrastText:x,augmentColor:q,tonalOffset:v},M[p]),b)}function gu(e){return Math.round(1e5*e)/1e5}function yu(e){return gu(e)}var vu={textTransform:"uppercase"},bu='"Roboto", "Helvetica", "Arial", sans-serif';function xu(e,t){var n="function"==typeof t?t(e):t,r=n.fontFamily,i=void 0===r?bu:r,o=n.fontSize,a=void 0===o?14:o,s=n.fontWeightLight,l=void 0===s?300:s,u=n.fontWeightRegular,c=void 0===u?400:u,d=n.fontWeightMedium,f=void 0===d?500:d,m=n.fontWeightBold,p=void 0===m?700:m,h=n.htmlFontSize,g=void 0===h?16:h,y=n.allVariants,v=n.pxToRem,b=tu(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]),x=a/14,q=v||function(e){return"".concat(e/g*x,"rem")},M=function(e,t,n,r,o){return $l({fontFamily:i,fontWeight:e,fontSize:q(t),lineHeight:n},i===bu?{letterSpacing:"".concat(gu(r/t),"em")}:{},o,y)},S={h1:M(l,96,1.167,-1.5),h2:M(l,60,1.2,-.5),h3:M(c,48,1.167,0),h4:M(c,34,1.235,.25),h5:M(c,24,1.334,0),h6:M(f,20,1.6,.15),subtitle1:M(c,16,1.75,.15),subtitle2:M(f,14,1.57,.1),body1:M(c,16,1.5,.15),body2:M(c,14,1.43,.15),button:M(f,14,1.75,.4,vu),caption:M(c,12,1.66,.4),overline:M(c,12,2.66,1,vu)};return Kl($l({htmlFontSize:g,pxToRem:q,round:yu,fontFamily:i,fontSize:a,fontWeightLight:l,fontWeightRegular:c,fontWeightMedium:f,fontWeightBold:p},S),b,{clone:!1})}function qu(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var Mu=["none",qu(0,2,1,-1,0,1,1,0,0,1,3,0),qu(0,3,1,-2,0,2,2,0,0,1,5,0),qu(0,3,3,-2,0,3,4,0,0,1,8,0),qu(0,2,4,-1,0,4,5,0,0,1,10,0),qu(0,3,5,-1,0,5,8,0,0,1,14,0),qu(0,3,5,-1,0,6,10,0,0,1,18,0),qu(0,4,5,-2,0,7,10,1,0,2,16,1),qu(0,5,5,-3,0,8,10,1,0,3,14,2),qu(0,5,6,-3,0,9,12,1,0,3,16,2),qu(0,6,6,-3,0,10,14,1,0,4,18,3),qu(0,6,7,-4,0,11,15,1,0,4,20,3),qu(0,7,8,-4,0,12,17,2,0,5,22,4),qu(0,7,8,-4,0,13,19,2,0,5,24,4),qu(0,7,9,-4,0,14,21,2,0,5,26,4),qu(0,8,9,-5,0,15,22,2,0,6,28,5),qu(0,8,10,-5,0,16,24,2,0,6,30,5),qu(0,8,11,-5,0,17,26,2,0,6,32,5),qu(0,9,11,-5,0,18,28,2,0,7,34,6),qu(0,9,12,-6,0,19,29,2,0,7,36,6),qu(0,10,13,-6,0,20,31,3,0,8,38,7),qu(0,10,13,-6,0,21,33,3,0,8,40,7),qu(0,10,14,-6,0,22,35,3,0,8,42,7),qu(0,11,14,-7,0,23,36,3,0,9,44,8),qu(0,11,15,-7,0,24,38,3,0,9,46,8)],Su={borderRadius:4};function wu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=function(e){var t=e.spacing||8;return"number"==typeof t?function(e){return t*e}:Array.isArray(t)?function(e){return t[e]}:"function"==typeof t?t:function(){}}({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return 0===n.length?t(1):1===n.length?t(n[0]):n.map((function(e){if("string"==typeof e)return e;var n=t(e);return"number"==typeof n?"".concat(n,"px"):n})).join(" ")};return Object.defineProperty(n,"unit",{get:function(){return e}}),n.mui=!0,n}var Du={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Cu={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Nu(e){return"".concat(Math.round(e),"ms")}var ku={easing:Du,duration:Cu,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,r=void 0===n?Cu.standard:n,i=t.easing,o=void 0===i?Du.easeInOut:i,a=t.delay,s=void 0===a?0:a;return tu(t,["duration","easing","delay"]),(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"==typeof r?r:Nu(r)," ").concat(o," ").concat("string"==typeof s?s:Nu(s))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}},Au={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Lu(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,i=void 0===r?{}:r,o=e.palette,a=void 0===o?{}:o,s=e.spacing,l=e.typography,u=void 0===l?{}:l,c=tu(e,["breakpoints","mixins","palette","spacing","typography"]),d=hu(a),f=function(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,r=e.unit,i=void 0===r?"px":r,o=e.step,a=void 0===o?5:o,s=tu(e,["values","unit","step"]);function l(e){var t="number"==typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(i,")")}function u(e,t){var r=nu.indexOf(t);return r===nu.length-1?l(e):"@media (min-width:".concat("number"==typeof n[e]?n[e]:e).concat(i,") and ")+"(max-width:".concat((-1!==r&&"number"==typeof n[nu[r+1]]?n[nu[r+1]]:t)-a/100).concat(i,")")}return $l({keys:nu,values:n,up:l,down:function(e){var t=nu.indexOf(e)+1,r=n[nu[t]];return t===nu.length?l("xs"):"@media (max-width:".concat(("number"==typeof r&&t>0?r:e)-a/100).concat(i,")")},between:u,only:function(e){return u(e,e)},width:function(e){return n[e]}},s)}(n),m=wu(s),p=Kl({breakpoints:f,direction:"ltr",mixins:ru(f,m,i),overrides:{},palette:d,props:{},shadows:Mu,typography:xu(d,u),spacing:m,shape:Su,transitions:ku,zIndex:Au},c),h=arguments.length,g=new Array(h>1?h-1:0),y=1;y<h;y++)g[y-1]=arguments[y];return p=g.reduce((function(e,t){return Kl(e,t)}),p)}const Eu=function(){return Lu.apply(void 0,arguments)}({palette:{text:{primary:"rgba(89, 89, 89, 0.8)",secondary:"rgba(0, 0, 0, 0.55)",disabled:"rgba(0, 0, 0, 0.3)"},action:{disabled:"rgba(0, 0, 0, 0.3)"}},typography:{fontFamily:'"Source Sans Pro", "Arial", "sans-serif"',button:{textTransform:"initial",fontWeight:400}},shape:{borderRadius:2},shadows:["none","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)"],props:{MuiButtonBase:{disableRipple:!0}}});const Tu=m({productionPrefix:"q974a",disableGlobal:!0,seed:""});function Ou(){function e({x:e,y:t,width:n,height:r,scaleRatio:i,margin:o}={}){const a={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0}};return a.x=Number.isNaN(e)?a.x:e,a.y=Number.isNaN(t)?a.y:t,a.width=Number.isNaN(n)?a.width:n,a.height=Number.isNaN(r)?a.height:r,void 0!==i&&(a.scaleRatio.x=Number.isNaN(i.x)?a.scaleRatio.x:i.x,a.scaleRatio.y=Number.isNaN(i.y)?a.scaleRatio.y:i.y),void 0!==o&&(a.margin.left=Number.isNaN(o.left)?0:o.left,a.margin.top=Number.isNaN(o.top)?0:o.top),a}return function(t={}){const{createElement:n=document.createElement.bind(document)}=t;let r,o=e();const a={element:()=>r,root:()=>r,appendTo:e=>(r||(r=n("div"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none"),e.appendChild(r),r),render(e){if(!r)return!1;const t=o.scaleRatio.x,n=o.scaleRatio.y;return r.style.left=`${Math.round(o.margin.left+o.x*t)}px`,r.style.top=`${Math.round(o.margin.top+o.y*n)}px`,r.style.width=`${Math.round(o.width)}px`,r.style.height=`${Math.round(o.height)}px`,r.style.transform=`scale(${t}, ${n})`,r.style.transformOrigin="top left",f.render(function(e,t){return i.createElement(p,{generateClassName:t},i.createElement(h,{theme:Eu},e))}(e,Tu),r),!0},itemsAt:()=>[],findShapes:()=>[],clear:()=>(r&&f.unmountComponentAtNode(r),a),destroy(){r&&r.parentElement&&(f.unmountComponentAtNode(r),r.parentElement.removeChild(r)),r=null},size:t=>(t&&(o=e(t)),o)};return a}}function Iu(){return function(e){e.renderer("react",Ou()),e.component("data-title",Vl(e.renderer("svg")())),e.component("disclaimer",function(){class e extends i.Component{render(){const{label:e,spanStyle:t}=this.props;return i.createElement(i.Fragment,null,i.createElement("span",{ref:this.alignToRef,style:t,title:e},e))}}return e.propTypes={label:wl.string.isRequired,spanStyle:wl.shape().isRequired},{renderer:"react",disableTriggers:!0,preferredSize:function(){return 22},render(){const{settings:{label:t,rtl:n},layout:{dock:r},style:o={}}=this.settings,a="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",s=function(e,t,n){const r={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px",fontFamily:e.fontFamily||'"Source Sans Pro", "Arial", "sans-serif"'};switch(t){case"left":r.width=`${n.height}px`,r.transform=`rotate(-90deg) translate(-${n.height}px, 0)`,r.transformOrigin="top left";break;case"right":r.width=`${n.height}px`,r.transform=`rotate(90deg) translate(0, -${n.width}px)`,r.transformOrigin="top left";break;case"center":r.width=`${n.width}px`,r.height=`${n.height}px`,r.color="#595959",r.fontStyle="normal",r.fontSize="1.2em",r.textAlign="center";break;default:r.justifyContent="flex-start",r.alignItems="flex-start"}return r}(o,r,this.rect),l="center"===r?t:`* ${t}`,u="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return i.createElement("div",{style:s,dir:a},i.createElement(i.Fragment,null,i.createElement(e,{label:l,spanStyle:u})))}}}())}}var Pu={MAX_NUM_POINTS:5e4,DEFAULT_NUM_POINTS:2e3,DEFAULT_NUM_LINES:12};const{DEFAULT_NUM_POINTS:Ru}=Pu;function Fu({layoutService:e,largeDataService:t}){const{maxNumPoints:n=Ru}=(null==t?void 0:t.meta)||{},{qHyperCube:r}=e.getLayout();return r.qSize.qcy*r.qMeasureInfo.length>n}const{DEFAULT_NUM_LINES:ju}=Pu,Hu=({layoutService:e,largeDataService:t})=>{const{maxNumLines:n=ju}=(null==t?void 0:t.meta)||{},{qHyperCube:r}=e.getLayout();return r.qDimensionInfo.length>1&&!Fu({layoutService:e,largeDataService:t})?e.meta.size.dimensions[1]+1:n},{DEFAULT_NUM_POINTS:zu}=Pu,{MAX_NUM_POINTS:Bu,DEFAULT_NUM_POINTS:_u,DEFAULT_NUM_LINES:Vu}=Pu,{DEFAULT_NUM_POINTS:$u}=Pu,Uu=({layoutService:e,largeDataService:t})=>{if(!Fu({layoutService:e,largeDataService:t})){const{maxNumPoints:e=$u}=(null==t?void 0:t.meta)||{};return e}const{dimensionCount:n}=e.meta;return n>1?(({layoutService:e,largeDataService:t})=>{var n;const{dimensions:r=[]}=(null==e||null===(n=e.meta)||void 0===n?void 0:n.size)||{},{maxNumLines:i=Vu,maxNumPoints:o=_u,hasInjectedData:a=!1}=(null==t?void 0:t.meta)||{};if(Hu({layoutService:e,largeDataService:t})*r[0]<=o)return r[0];const s=Math.max(1,Math.min(i,r[1])),l=o/s,u=Math.floor(r[0]<=l?l:l/4),c=2*s*(s+1);return a&&(s>Vu||o>_u)?Math.min(u,Math.ceil(Bu/c)):u})({layoutService:e,largeDataService:t}):(({layoutService:e,largeDataService:t})=>{const{maxNumPoints:n=zu}=(null==t?void 0:t.meta)||{},{measureCount:r=1}=(null==e?void 0:e.meta)||{},i=4+2*(r-1);return Math.floor(n/(r*i))})({layoutService:e,largeDataService:t})},Wu=({start:e,end:t,model:n,layoutService:r,largeDataService:i,definitionPath:o})=>{const a={qStart:e,qEnd:t,qNbrPoints:Uu({layoutService:r,largeDataService:i}),qMaxNbrTicks:300,qMaxNumberLines:Hu({layoutService:r,largeDataService:i})};return n.getHyperCubeContinuousData(o,a,!1)};function Ku({model:e,layoutService:t,largeDataService:n,definitionPath:r="/qHyperCubeDef"}){return{shouldFetchReduced:()=>Fu({layoutService:t,largeDataService:n}),computeNbrOfBins:()=>Uu({layoutService:t,largeDataService:n}),computeMaxNumberLines:()=>Hu({layoutService:t,largeDataService:n}),fetch:(i,o)=>Wu({start:i,end:o,model:e,layoutService:t,largeDataService:n,definitionPath:r})}}function Gu(e={}){const{cache:t={}}=e;return{fetch:()=>Promise.resolve(t.merged)}}function Yu({layoutService:e,viewCache:t}){return{fetch:()=>{const{qAxisData:t,qDataPages:n}=e.getHyperCube();return Promise.resolve({qAxisData:t,qDataPages:n})},getSnapshotData(){const n=e.getLayoutValue("snapshotData.content.chartData",{});return"zoom"in n&&"min"in n.zoom&&"max"in n.zoom?function({zoom:e}){return{zoom:e}}(n):function({scrollOffset:e=0,viewRange:t=0},n){let r=n+e,i=r+t;return 1===t&&0===e&&(r=n-.5,i=n+.5),{zoom:{min:r,max:i}}}(n,t.get("continuousMin"))}}}function Xu(){const e=()=>{},t=[],n={};return e.set=(e,r)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1),t.push(e),n[e]=r},e.forEach=e=>{t.forEach(((t,r)=>e(n[t],r)))},e.has=e=>e in n,e}function Ju(e,t,n){return n[0]&&n[0][1]&&n[0][1].qElemNumber>-1?function({start:e,end:t,matrix:n}){const r=[],i=Xu(),o=Xu();for(let a=0;a<n.length;a++){const s=n[a],l=s[1].qElemNumber.toString();s[0].qNum<e?i.set(l,s):s[0].qNum>t&&(o.has(l)||o.set(l,s)),s[0].qNum>=e&&s[0].qNum<=t&&r.push(s)}return i.forEach(((e,t)=>r.splice(t,0,e))),o.forEach((e=>r.push(e))),r}({start:e,end:t,matrix:n}):function({start:e,end:t,matrix:n}){const r=[];let i,o;for(let a=0;a<n.length;a++){const s=n[a];s[0].qNum<e?i=s:s[0].qNum>t&&(o||(o=s)),s[0].qNum>=e&&s[0].qNum<=t&&r.push(s)}return i&&r.unshift(i),o&&r.push(o),r}({start:e,end:t,matrix:n})}function Zu(e,t){return{...e,qWidth:t[0]?t[0].length:0,qHeight:t.length}}function Qu(e,t,n){const r={qDataPages:(n.qDataPages||[]).map((n=>{const r=Ju(e,t,n.qMatrix),i=Zu(n.qArea,r);return{...n,qArea:i,qMatrix:r}}))};return n.qAxisData&&n.qAxisData.qAxis&&(r.qAxisData=function(e,t,n){return{qAxis:n.qAxis.map((n=>({qName:n.qName,qTags:n.qTags,qTicks:n.qTicks.reduce(((n,r)=>((r.qStart>=e&&r.qStart<=t||r.qEnd>=e&&r.qEnd<=t||r.qStart<e&&r.qEnd>t)&&n.push(r),n)),[])})))}}(e,t,n.qAxisData)),r}const ec=2**.5,tc=1/ec,nc=1e-6,rc=tc**44;function ic(e){return e.qIsOtherCell}function oc({qDataPages:e=[]}={},t={}){const n=e.length?e[0].qMatrix:[];return t.isStackedByDimension?function(e){const t={};return e.forEach((e=>{if(!e.some(ic)){const n=e[0].qElemNumber;t[n]=void 0}})),Object.keys(t).length}(n):function(e){let t=0;return e.forEach((e=>{e.some(ic)||t++})),t}(n)}const ac={query:{getShouldProcess:()=>!1},command:{processDataPage:()=>{}}};var sc=Object.prototype.hasOwnProperty,lc=Object.prototype.toString,uc=Object.defineProperty,cc=Object.getOwnPropertyDescriptor,dc=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===lc.call(e)},fc=function(e){if(!e||"[object Object]"!==lc.call(e))return!1;var t,n=sc.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&sc.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||sc.call(e,t)},mc=function(e,t){uc&&"__proto__"===t.name?uc(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},pc=function(e,t){if("__proto__"===t){if(!sc.call(e,t))return;if(cc)return cc(e,t).value}return e[t]};function hc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function gc(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function yc(){}!function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}((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=pc(s,n),s!==(i=pc(t,n))&&(c&&i&&(fc(i)||(o=dc(i)))?(o?(o=!1,a=r&&dc(r)?r:[]):a=r&&fc(r)?r:{},mc(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&mc(s,{name:n,newValue:i}));return s}));var vc=1/.7,bc="\\s*([+-]?\\d+)\\s*",xc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Mc=/^#([0-9a-f]{3,8})$/,Sc=new RegExp(`^rgb\\(${bc},${bc},${bc}\\)$`),wc=new RegExp(`^rgb\\(${qc},${qc},${qc}\\)$`),Dc=new RegExp(`^rgba\\(${bc},${bc},${bc},${xc}\\)$`),Cc=new RegExp(`^rgba\\(${qc},${qc},${qc},${xc}\\)$`),Nc=new RegExp(`^hsl\\(${xc},${qc},${qc}\\)$`),kc=new RegExp(`^hsla\\(${xc},${qc},${qc},${xc}\\)$`),Ac={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 Lc(){return this.rgb().formatHex()}function Ec(){return this.rgb().formatRgb()}function Tc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Mc.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Oc(t):3===n?new Fc(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Ic(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Ic(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=Sc.exec(e))?new Fc(t[1],t[2],t[3],1):(t=wc.exec(e))?new Fc(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Dc.exec(e))?Ic(t[1],t[2],t[3],t[4]):(t=Cc.exec(e))?Ic(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Nc.exec(e))?Vc(t[1],t[2]/100,t[3]/100,1):(t=kc.exec(e))?Vc(t[1],t[2]/100,t[3]/100,t[4]):Ac.hasOwnProperty(e)?Oc(Ac[e]):"transparent"===e?new Fc(NaN,NaN,NaN,0):null}function Oc(e){return new Fc(e>>16&255,e>>8&255,255&e,1)}function Ic(e,t,n,r){return r<=0&&(e=t=n=NaN),new Fc(e,t,n,r)}function Pc(e){return e instanceof yc||(e=Tc(e)),e?new Fc((e=e.rgb()).r,e.g,e.b,e.opacity):new Fc}function Rc(e,t,n,r){return 1===arguments.length?Pc(e):new Fc(e,t,n,null==r?1:r)}function Fc(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function jc(){return`#${_c(this.r)}${_c(this.g)}${_c(this.b)}`}function Hc(){const e=zc(this.opacity);return`${1===e?"rgb(":"rgba("}${Bc(this.r)}, ${Bc(this.g)}, ${Bc(this.b)}${1===e?")":`, ${e})`}`}function zc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Bc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function _c(e){return((e=Bc(e))<16?"0":"")+e.toString(16)}function Vc(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Uc(e,t,n,r)}function $c(e){if(e instanceof Uc)return new Uc(e.h,e.s,e.l,e.opacity);if(e instanceof yc||(e=Tc(e)),!e)return new Uc;if(e instanceof Uc)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 Uc(a,s,l,e.opacity)}function Uc(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Wc(e){return(e=(e||0)%360)<0?e+360:e}function Kc(e){return Math.max(0,Math.min(1,e||0))}function Gc(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}hc(yc,Tc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Lc,formatHex:Lc,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return $c(this).formatHsl()},formatRgb:Ec,toString:Ec}),hc(Fc,Rc,gc(yc,{brighter(e){return e=null==e?vc:Math.pow(vc,e),new Fc(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Fc(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Fc(Bc(this.r),Bc(this.g),Bc(this.b),zc(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:jc,formatHex:jc,formatHex8:function(){return`#${_c(this.r)}${_c(this.g)}${_c(this.b)}${_c(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Hc,toString:Hc})),hc(Uc,(function(e,t,n,r){return 1===arguments.length?$c(e):new Uc(e,t,n,null==r?1:r)}),gc(yc,{brighter(e){return e=null==e?vc:Math.pow(vc,e),new Uc(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Uc(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 Fc(Gc(e>=240?e-240:e+120,i,r),Gc(e,i,r),Gc(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Uc(Wc(this.h),Kc(this.s),Kc(this.l),zc(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=zc(this.opacity);return`${1===e?"hsl(":"hsla("}${Wc(this.h)}, ${100*Kc(this.s)}%, ${100*Kc(this.l)}%${1===e?")":`, ${e})`}`}}));const Yc=Math.PI/180,Xc=180/Math.PI,Jc=4/29,Zc=6/29,Qc=3*Zc*Zc;function ed(e){if(e instanceof td)return new td(e.l,e.a,e.b,e.opacity);if(e instanceof ad)return sd(e);e instanceof Fc||(e=Pc(e));var t,n,r=od(e.r),i=od(e.g),o=od(e.b),a=nd((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=nd((.4360747*r+.3850649*i+.1430804*o)/.96422),n=nd((.0139322*r+.0971045*i+.7141733*o)/.82521)),new td(116*a-16,500*(t-a),200*(a-n),e.opacity)}function td(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function nd(e){return e>.008856451679035631?Math.pow(e,1/3):e/Qc+Jc}function rd(e){return e>Zc?e*e*e:Qc*(e-Jc)}function id(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function od(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ad(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function sd(e){if(isNaN(e.h))return new td(e.l,0,0,e.opacity);var t=e.h*Yc;return new td(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}hc(td,(function(e,t,n,r){return 1===arguments.length?ed(e):new td(e,t,n,null==r?1:r)}),gc(yc,{brighter(e){return new td(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new td(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 Fc(id(3.1338561*(t=.96422*rd(t))-1.6168667*(e=1*rd(e))-.4906146*(n=.82521*rd(n))),id(-.9787684*t+1.9161415*e+.033454*n),id(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),hc(ad,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof ad)return new ad(e.h,e.c,e.l,e.opacity);if(e instanceof td||(e=ed(e)),0===e.a&&0===e.b)return new ad(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Xc;return new ad(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new ad(e,t,n,null==r?1:r)}),gc(yc,{brighter(e){return new ad(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new ad(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return sd(this).rgb()}}));var ld,ud=e=>()=>e;function cd(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):ud(isNaN(e)?t:e)}function dd(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}function fd(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function md(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=hd)):void 0===t&&(t=pd);for(var n,r,i,o,a,s=new vd(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new vd(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(yd)}function pd(e){return e.children}function hd(e){return Array.isArray(e)?e[1]:null}function gd(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function yd(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function vd(e){this.data=e,this.depth=this.height=0,this.parent=null}!function e(t){var n=function(e){return 1==(e=+e)?cd: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):ud(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Rc(e)).r,(t=Rc(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=cd(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),vd.prototype=md.prototype={constructor:vd,count:function(){return this.eachAfter(fd)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(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}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(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}(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},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return md(this).eachBefore(gd)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},ld=function(e){
10
- /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
11
- e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,d,f=e.length,m=e.search(/[0-9\-\+#]/),p=m>0?e.substring(0,m):"",h=e.split("").reverse().join(""),g=h.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(m,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",y=(d=t[0]).length%l,f=d.length,b=0;b<f;b++)h+=d.charAt(b),!((b-y+1)%l)&&b<f-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},ld({exports:{}});var bd={created(){this.state={}},beforeUpdate(){this.state={}},beforeRender({size:e}){this.state.ticks=this.scale.ticks({distance:e.width}).filter((e=>!e.isMinor)),"linear"===this.scale.type&&function(e,t){const[,n]=e.domain();for(let e=0;e<t.length;e++){const r=t[e],i=t[e+1];r.data={},i||1===r.end?i?(r.data.start=r.value,r.data.end=i.value,r.end=i.position):(r.data.start=r.value,r.data.end=r.value):(r.data.start=r.value,r.data.end=n,r.end=1)}}(this.scale,this.state.ticks)},render(){const e=this.scale.data().fields.length?this.scale.data().fields[0].id():"",{ticks:t}=this.state,n=t.map((t=>({type:"rect",fill:"none",data:{source:{field:e},value:[t.data.start,t.data.end]},x:t.start*this.rect.width,y:0,width:(t.end-t.start)*this.rect.width,height:this.rect.height})));if(t.length&&t[0].start>0){const r=t[0];n.unshift({type:"rect",fill:"none",data:{source:{field:e},value:[this.scale.domain()[0],r.data.start]},x:0,y:0,width:r.start*this.rect.width,height:this.rect.height})}return n}};const xd="…";function qd(e,t=1){if(t%2==0)return e;let n=Math.round(e);return e-n>0?n+=.5:n-=.5,n}function Md(e,t){const{localProps:{size:n},props:{anchor:r}}=t,i=function({props:e,localProps:{size:t},style:n,renderer:r}){const i=e.label.padding,o=Math.max(0,Math.min(e.label.justify,1)),a=Math.max(0,Math.min(e.label.align,1)),s=e=>r.measureText({text:e,fontSize:n.label.fontSize,fontFamily:n.label.fontFamily});return{resolve:(e,r)=>{const l="string"==typeof e.label?e.label:"",u=s(l);let{x:c,width:d}=r;e.start===e.end&&(d=u.width+2*i,1===e.end&&(c-=d));const f={x:c+i,y:i,width:d-2*i,height:t.height-2*i},m=s(`${l[0]}${xd}`).width,p=Math.max(0,f.width-u.width),h=Math.max(0,f.height-u.height),g=o*p,y=a*h;return{show:f.width>=Math.min(m,u.width),text:l,dx:g,dy:y,rect:f,style:n.label,segment:{x:c+g,width:u.width+2*i},tickValue:e.value}}}}(t),o=function({localProps:{size:e},style:t,scale:n,props:r}){const[i,o]=n.domain(),a=Math.max(0,Math.min(1,r.guideLine.major.justify));return{resolve:(n,r)=>{const s=a*r.width,l=qd(r.x+s,t.majorGuideLine.strokeWidth);return{show:n.value>=i&&n.value<=o,x1:l,y1:0,x2:l,y2:qd(e.height,t.majorGuideLine.strokeWidth),style:t.majorGuideLine,tickValue:n.value}}}}(t),a=e.map((e=>{const t=function(e,t,n){const r=Math.abs(Math.max(e.start,0)-Math.min(e.end,1))*t.width;return{x:Math.max(e[n],0)*t.width,y:0,width:r,height:t.height}}(e,n,r);return{rect:t,label:i.resolve(e,t),guideLine:o.resolve(e,t)}}));return function(e,t){const n=e.length;if(n<2)return;const r=e[n-1],i=t[n-1].label;if(r&&r.start===r.end)for(let e=n-2;e>-1;e--){const n=t[e].label;n.show=n.show&&(o=n.segment,a=i.segment,!(o.x<a.x?o.x+o.width>=a.x:a.x+a.width>=o.x))}var o,a}(e,a),a}function Sd(e,t){const n=function({localProps:{size:e},props:t,style:n}){return{resolve:r=>{const i=Math.max(e.height-t.guideLine.minor.size,0)*Math.max(0,Math.min(t.guideLine.minor.align,1)),o=qd(r.position*e.width,n.minorGuideLine.strokeWidth);return{guideLine:{show:!0,x1:o,y1:qd(i,n.minorGuideLine.strokeWidth),x2:o,y2:qd(t.guideLine.minor.size+i,n.minorGuideLine.strokeWidth),style:n.minorGuideLine}}}}}(t);return t.props.guideLine.minor.show?e.map(n.resolve):[]}function wd(e){return e.filter((e=>e.show)).map((e=>Y({strokeWidth:1},e.style,{type:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,tickValue:e.tickValue})))}var Dd={require:["renderer"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{anchor:"start",label:{show:!0,padding:4,align:0,justify:0},line:{show:!0},guideLine:{major:{justify:0},minor:{show:!0,size:4,align:0}}},style:{label:"$label",line:"$guide-line",majorGuideLine:"$guide-line",minorGuideLine:"$guide-line"}},preferredSize:()=>({size:30,edgeBleed:{left:1,right:1}}),init(){this.props=this.settings.settings,this.localProps={},this.state={major:[],minor:[]}},created(){this.init()},beforeUpdate(){this.init()},beforeRender({size:e}){this.localProps.size=e;const t=this.scale.ticks({distance:e.width}),n=t.filter((e=>!e.isMinor)),r=t.filter((e=>e.isMinor));this.state.line=function({localProps:{size:e},style:t,props:n}){const r=qd(1,t.line.strokeWidth);return{show:n.line.show,x1:qd(0,t.line.strokeWidth),y1:r,x2:qd(e.width,t.line.strokeWidth),y2:r,style:t.line}}(this),this.state.major=Md(n,this),this.state.minor=Sd(r,this)},render(){return[...wd([this.state.line]),...(e=this.state.major.map((e=>e.label)),e.filter((e=>e.show)).map((e=>Y({},e.style,{type:"text",x:e.rect.x,y:e.rect.y,dx:e.dx,dy:e.dy,maxWidth:e.rect.width,text:e.text,title:e.text,baseline:"text-before-edge",tickValue:e.tickValue})))),...wd(this.state.major.map((e=>e.guideLine))),...wd(this.state.minor.map((e=>e.guideLine)))];var e}};function Cd(e,t){return e&&t&&e.qTicks.length===t.qTicks.length&&e.qTicks.every(((e,n)=>e.qStart===t.qTicks[n].qStart&&e.qEnd===t.qTicks[n].qEnd))}function Nd(e){return e.qTags.indexOf("$qualified")>-1}function kd({qAxis:e}){const t=[],n=[];for(let r=0;r<e.length;r++){const i=r+1,o=e[r],a=e[i];Cd(o,a)?(Nd(a)?(t.push(i),n.push(r)):(t.push(r),n.push(i)),r++):(t.push(r),n.push(r))}return{qualified:t,nonQualified:n}}function Ad({qualifiedMeta:e,nonQualifiedMeta:t}){return{resolve(n){let r,i=NaN,o=NaN,a=NaN,s=!1;for(let l=e.length-1;l>=0;l--){const u=e[l];if(u.queries.outer(n)){const e=t[l+1];if(i=u.index,r=l,u.attrs.isDayOrShorter()&&u.queries.canFitHalfDayTicks(n)){o="auto",s=!0;break}if(e&&e.queries.inner(n)){o=e.index;const r=t[l+2];r&&r.queries.minor(n)&&(a=r.index);break}}}if(!Number.isNaN(i)&&Number.isNaN(o)&&"auto"!==o){o=i,i=NaN;const e=t[r+1];e&&e.queries.minor(n)&&(a=e.index)}else Number.isNaN(i)&&(i="auto",o="auto");return{outer:i,inner:o,minor:a,isDayOrShorter:s}}}}const Ld=16;function Ed({qTicks:e,measureText:t=(()=>({width:0})),cache:n={},scale:r}){const i=n;return{isDayOrShorter:()=>(i.isDayOrShorter=e.length>0&&Math.abs(e[0].qStart-e[0].qEnd)<=1,i.isDayOrShorter),count:()=>e.length,maxRange:()=>(i.maxRange=e.length?Math.max(...e.map((e=>Math.abs(r(e.qStart)-r(e.qEnd))))):0,i.maxRange),rangeAndWidth(){const n=r.clamp();return r.clamp(!1),i.rangeAndWidth=e.map((e=>({range:Math.abs(r(e.qStart)-r(e.qEnd)),width:t(`${e.qText}`).width+Ld}))),r.clamp(n),i.rangeAndWidth}}}const Td=6;function Od({attrs:e,reqAutoFitWidth:t}){return{outer:t=>!e.rangeAndWidth().some((({width:e,range:n})=>e>n*t)),inner:t=>!e.rangeAndWidth().some((({width:e,range:n})=>e>n*t)),minor:t=>e.maxRange()*t>=Td,canFitHalfDayTicks:n=>n>=t*e.count()}}function Id({qualified:e,nonQualified:t,qAxis:n,measureText:r,reqAutoFitWidth:i,scale:o},{attributesFactory:a=Ed,queryFactory:s=Od}={attributesFactory:Ed,queryFactory:Od}){const l=n.map(((e,t)=>function(e,t){const{qTicks:n}=e,l=a({qTicks:n,measureText:r,scale:o});return{data:e,index:t,attrs:l,queries:s({attrs:l,reqAutoFitWidth:i})}}(e,t))),u=e.map((e=>l[e])),c=t.map((e=>l[e]));return{qAxisMeta:l,qualifiedMeta:u,nonQualifiedMeta:c}}function Pd({qAxis:e=[],measureText:t=(()=>({width:0})),cache:n={},reqAutoFitWidth:r=0,scale:i},{metaFactory:o=Id,mapper:a=kd,resolver:s=Ad}={metaFactory:Id,mapper:kd,resolver:Ad}){const{qualified:l,nonQualified:u}=a({qAxis:e}),{qualifiedMeta:c,nonQualifiedMeta:d}=o({qAxis:e,qualified:l,nonQualified:u,measureText:t,reqAutoFitWidth:r,scale:i}),f=s({qualifiedMeta:c,nonQualifiedMeta:d});return{resolve:t=>{const r=n.key({distance:t});if(n.get(r))return n.get(r);if(function(e){return!Array.isArray(e)||0===e.length||e.every((e=>0===e.qTicks.length))}(e))return{outer:"auto",inner:"auto",minor:NaN,isDayOrShorter:!1};const i=f.resolve(t);return n.set(r,i),i}}}const Rd=86400,Fd=864e5;function jd(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(Fd*(e-Math.floor(e)))))}const Hd=jd(0).getTime();function zd(e){return(e.getTime()-Hd)/Rd/1e3}var Bd=new Date,_d=new Date;function Vd(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 Vd((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 Bd.setTime(+t),_d.setTime(+r),e(Bd),e(_d),Math.floor(n(Bd,_d))},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 $d=36e5,Ud=Vd((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()})),Wd=Ud;Ud.range;var Kd=Vd((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+6e4*t)}),(function(e,t){return(t-e)/6e4}),(function(e){return e.getUTCMinutes()})),Gd=Kd;Kd.range;var Yd=Vd((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+t*$d)}),(function(e,t){return(t-e)/$d}),(function(e){return e.getUTCHours()})),Xd=Yd;Yd.range;var Jd=Vd((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/864e5}),(function(e){return e.getUTCDate()-1})),Zd=Jd;function Qd(e){return Vd((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)/6048e5}))}Jd.range;var ef=Qd(0),tf=Qd(1),nf=Qd(2),rf=Qd(3),of=Qd(4),af=Qd(5),sf=Qd(6);ef.range,tf.range,nf.range,rf.range,of.range,af.range,sf.range;var lf=Vd((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()})),uf=lf;lf.range;var cf=Vd((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()}));cf.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Vd((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};var df=cf;cf.range;const ff={second:1,minute:2,hour:3,day:4,month:5,year:6};function mf({timeScale:e,labels:t,distance:n,isDayOrShorter:r,cache:i,timeOnly:o,initialMin:a}){const[s,l]=e.domain(),u=i.key({distance:n});let c;i.get(u,1)?c=i.get(u,1):(c=function(e,t,n,r,i,o){function a(e){return df.filter((t=>(t.getUTCFullYear()-o.getUTCFullYear())%e==0))}const s=Wd.count(e,t),l=Gd.count(e,t),u=Xd.count(e,t),c=Zd.count(e,t),d=ef.count(e,t),f=uf.count(e,t),m=df.count(e,t),p=n/r.second.width-1,h=n/r.minute.width-1,g=n/r.date.width-1,y=n/r.year.width-1,v={type:"year",desc:"year",count:m,interval:df.every(1),formatter:r.year.formatter,offset:e=>df.offset(e,-1),floor:df.floor};if(s<=p)v.type=ff.second,v.desc="second",v.count=s,v.interval=Wd.every(1),v.formatter=r.second.formatter,v.offset=e=>Wd.offset(e,-1),v.floor=Wd.floor;else if(s/2<=p)v.type=ff.second,v.desc="every other second",v.count=s/2,v.interval=Wd.every(2),v.formatter=r.second.formatter,v.offset=e=>Wd.offset(e,-2),v.floor=Wd.floor;else if(s/5<=p)v.type=ff.second,v.desc="every 5 second",v.count=s/5,v.interval=Wd.every(5),v.formatter=r.second.formatter,v.offset=e=>Wd.offset(e,-5),v.floor=Wd.floor;else if(s/15<=p)v.type=ff.second,v.desc="every 15 second",v.count=s/15,v.interval=Wd.every(15),v.formatter=r.second.formatter,v.offset=e=>Wd.offset(e,-15),v.floor=Wd.floor;else if(s/30<=p)v.type=ff.second,v.desc="every 30 second",v.count=s/30,v.interval=Wd.every(30),v.formatter=r.second.formatter,v.offset=e=>Wd.offset(e,-30),v.floor=Wd.floor;else if(l<=h)v.type=ff.minute,v.desc="minute",v.count=l,v.interval=Gd.every(1),v.formatter=r.minute.formatter,v.offset=e=>Gd.offset(e,-1),v.floor=Gd.floor;else if(l/2<=h)v.type=ff.minute,v.desc="every 2 minute",v.count=l/2,v.interval=Gd.every(2),v.formatter=r.minute.formatter,v.offset=e=>Gd.offset(e,-2),v.floor=Gd.floor;else if(l/5<=h)v.type=ff.minute,v.desc="every 5 minute",v.count=l/5,v.interval=Gd.every(5),v.formatter=r.minute.formatter,v.offset=e=>Gd.offset(e,-5),v.floor=Gd.floor;else if(l/10<=h)v.type=ff.minute,v.desc="every 10 minute",v.count=l/10,v.interval=Gd.every(10),v.formatter=r.minute.formatter,v.offset=e=>Gd.offset(e,-10),v.floor=Gd.floor;else if(l/15<=h)v.type=ff.minute,v.desc="every 15 minute",v.count=l/15,v.interval=Gd.every(15),v.formatter=r.minute.formatter,v.offset=e=>Gd.offset(e,-15),v.floor=Gd.floor;else if(l/30<=h)v.type=ff.minute,v.desc="every 30 minute",v.count=l/30,v.interval=Gd.every(30),v.formatter=r.minute.formatter,v.offset=e=>Gd.offset(e,-30),v.floor=Gd.floor;else if(u<=h)v.type=ff.hour,v.desc="hour",v.count=u,v.interval=Xd.every(1),v.formatter=r.minute.formatter,v.offset=e=>Xd.offset(e,-1),v.floor=Xd.floor;else if(u/2<=h)v.type=ff.hour,v.desc="every 2 hour",v.count=u/2,v.interval=Xd.every(2),v.formatter=r.minute.formatter,v.offset=e=>Xd.offset(e,-2),v.floor=Xd.floor;else if(u/3<=h)v.type=ff.hour,v.desc="every 3 hour",v.count=u/3,v.interval=Xd.every(3),v.formatter=r.minute.formatter,v.offset=e=>Xd.offset(e,-3),v.floor=Xd.floor;else if(u/6<=h)v.type=ff.hour,v.desc="every 6 hour",v.count=u/6,v.interval=Xd.every(6),v.formatter=r.minute.formatter,v.offset=e=>Xd.offset(e,-6),v.floor=Xd.floor;else if(u/12<=h||i)v.type=ff.hour,v.desc="every 12 hour",v.count=u/12,v.interval=Xd.every(12),v.formatter=r.minute.formatter,v.offset=e=>Xd.offset(e,-12),v.floor=Xd.floor;else if(c<=g)v.type=ff.day,v.desc="day",v.count=c,v.interval=Zd.every(1),v.formatter=r.date.formatter,v.offset=e=>Zd.offset(e,-1),v.floor=Zd.floor;else if(c/2<=g)v.type=ff.day,v.desc="every 2 day",v.count=c/2,v.interval=Zd.every(2),v.formatter=r.date.formatter,v.offset=e=>Zd.offset(e,-2),v.floor=Zd.floor;else if(c/3<=g)v.type=ff.day,v.desc="every 3 day",v.count=c/3,v.interval=Zd.every(3),v.formatter=r.date.formatter,v.offset=e=>Zd.offset(e,-3),v.floor=Zd.floor;else if(d<=g)v.type=ff.day,v.desc="week",v.count=d,v.interval=ef.every(1),v.formatter=r.date.formatter,v.offset=e=>ef.offset(e,-1),v.floor=Zd.floor;else if(d/2<=g)v.type=ff.day,v.desc="every 2 week",v.count=d/2,v.interval=ef.every(2),v.formatter=r.date.formatter,v.offset=e=>ef.offset(e,-2),v.floor=Zd.floor;else if(f<=g)v.type=ff.month,v.desc="month",v.count=f,v.interval=uf.every(1),v.formatter=r.date.formatter,v.offset=e=>uf.offset(e,-1),v.floor=Zd.floor;else if(f/3<=g)v.type=ff.month,v.desc="quarter",v.count=f/3,v.interval=uf.every(3),v.formatter=r.date.formatter,v.offset=e=>uf.offset(e,-3),v.floor=Zd.floor;else if(f/6<=g)v.type=ff.month,v.desc="half year",v.count=f/6,v.interval=uf.every(6),v.formatter=r.date.formatter,v.offset=e=>uf.offset(e,-6),v.floor=Zd.floor;else if(m<=y)v.type=ff.year,v.desc="year",v.count=m,v.interval=df.every(1),v.formatter=r.year.formatter,v.offset=e=>df.offset(e,-1),v.floor=df.floor;else if(m/2<=y)v.type=ff.year,v.desc="every 2 year",v.count=m/2,v.interval=a(2),v.formatter=r.year.formatter,v.offset=e=>df.offset(e,-2),v.floor=df.floor;else if(m/5<=y)v.type=ff.year,v.desc="every 5 year",v.count=m/5,v.interval=a(5),v.formatter=r.year.formatter,v.offset=e=>df.offset(e,-5),v.floor=df.floor;else if(m/10<=y)v.type=ff.year,v.desc="every 10 year",v.count=m/10,v.interval=a(10),v.formatter=r.year.formatter,v.offset=e=>df.offset(e,-10),v.floor=df.floor;else{const e=Math.floor(m/y);v.type=ff.year,v.desc="every nth year",v.count=e,v.interval=a(e),v.formatter=r.year.formatter,v.offset=t=>df.offset(t,-e),v.floor=df.floor}return v}(s,l,n,t.all(),r,a),i.set(u,c,1));const d=e.ticks(c.interval);d.length?s.getTime()!==d[0].getTime()&&d.unshift(c.offset(d[0])):d.push(c.floor(s));const f=d.map(((e,t,n)=>{const r=n[t+1]?n[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+r),formatter:c.formatter}}));let m=[];if(!o&&c.type<=ff.hour){const n=t.getFormat("date"),r=e.ticks(Zd.every(1));r.length&&s.getUTCDate()!==r[0].getUTCDate()&&r.unshift(Zd.offset(r[0],-1)),m=(r.length?r:[Zd.floor(s)]).map(((e,t,r)=>{const i=r[t+1]?r[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+i),formatter:n.formatter}}))}return{inner:f,outer:m}}const pf=86400,hf=1440,gf={};function yf(e,t,n,r){return{type:e,start:new Date(Date.UTC(...t)),end:new Date(Date.UTC(...n)),formatter:r}}function vf(e,t,n){const{generator:r,anchor:i,clamp:o,level:a}=t.ticks,{qNumFormat:s}=t.formatter;e.clamp(o);const[l,u]=e.domain(),c=Ho().domain([jd(l),jd(u)]);c.clamp(o),c.range(t.invert?[1,0]:[0,1]);const d="object"==typeof r?r:{type:r};let f;f="d3"===d.type?(e,i)=>mf({timeScale:c,labels:n,distance:e,isDayOrShorter:i,cache:t.cache,timeOnly:"T"===s.qType,initialMin:void 0===d.initialMin?c.domain()[0]:jd(r.initialMin)}):e=>function(e,t,n,r,i,o=!1){if(gf[[t,n,r,r,o]])return gf[[t,n,r,r,o]];const a={year:e.getFormat("year"),date:e.getFormat("date"),minute:e.getFormat("minute"),second:e.getFormat("second")},s=jd(n),l=s.getFullYear(),u=s.getMonth(),c=s.getDate(),d=r-n,f=t/(i-r),m=f/1440,p=f/pf,h=366*f,g=3*f*30,y=a.second.width/p,v=a.minute.width/m,b=a.date.width/g,x=a.year.width/h;let q,M,S,w=0,D=0,C=null,N=null,k=null,A=null,L=null,E=null;const T={outer:[],inner:[]};for(y<1?(C=1,D=1/pf):y<2?(C=2,D=1/pf*2):y<5?(C=5,D=1/pf*5):y<10?(C=10,D=1/pf*10):y<30?(C=30,D=1/pf*30):v<1?(N=1,D=1/hf):v<2?(N=2,D=1/hf*2):v<5?(N=5,D=1/hf*5):v<10?(N=10,D=1/hf*10):v<30?(N=30,D=1/hf*30):v<60?(k=1,D=1/24):v<120?(k=2,D=2/24):v<360?(k=6,D=.25):v<720?(k=12,D=.5):b<1/90?(D=1,A=1):b<2/90?(D=2,A=2):b<7/90?(D=7,A=7):b<31/90?(L=1,D=31):b<1?(L=3,D=90):x<1?(E=1,D=366):x<2?(E=2,D=732):x<5?(E=5,D=1826.25):(E=10,D=3652.5),M=Math.floor((d+n%1)/D);w<i;){S=M+1,q=E?yf("year",[l+M*E,0,1],[l+S*E,0,1],a.year.formatter):L?yf("month",[l,u+M*L,1],[l,u+S*L,1],a.date.formatter):A?yf("day",[l,u,c+M*A],[l,u,c+S*A],a.date.formatter):k?yf("hour",[l,u,c,0+M*k],[l,u,c,0+S*k],a.minute.formatter):N?yf("minute",[l,u,c,0,0+M*N],[l,u,c,0,0+S*N],a.minute.formatter):yf("second",[l,u,c,0,0,0+M*C],[l,u,c,0,0,0+S*C],a.second.formatter),w=zd(q.start),T.inner.push(q);const e=Math.floor(w);if(!(o||E||L||A)){const t={type:"day",start:jd(e),end:jd(e+1),formatter:a.date.formatter,qStart:e};T.outer[T.outer.length-1]&&T.outer[T.outer.length-1].qStart===t.qStart||T.outer.push(t)}M++}return T.min=r,T.max=i,gf[[t,n,r,r,o]]=T,T}(n,e,d.min,l,u,"T"===s.qType);const m={transform:(t=[],{isMinor:n=!1}={})=>t.map((t=>{let r;r="start"===i?t.qStart:"end"===i?t.qEnd:(t.qStart+t.qEnd)/2;const o=e.clamp();n&&e.clamp(!1);const a=e(r),s=e(t.qStart),l=e(t.qEnd);return e.clamp(o),{value:r,position:a,start:s,end:l,label:t.qText,isMinor:n,data:n?void 0:{start:t.qStart,end:t.qEnd,scaleStart:e.domain()[0]}}})).filter((e=>e.position>=0&&e.position<=1)),generate:(t=100,n)=>f(t,n)[a].map((t=>{let n;return n="start"===i?zd(t.start):"end"===i?zd(t.end):(zd(t.start)+zd(t.end))/2,{position:c(t.start),start:c(t.start),end:c(t.end),value:n,label:t.formatter(n),isMinor:!1,data:{start:zd(t.start),end:zd(t.end),scaleStart:e.domain()[0]}}})).filter((e=>e.position>=0&&e.position<=1))};return m}const bf=41000.2343433,xf=/t+/i,qf=16,Mf=60;const Sf={min:NaN,max:NaN,invert:!1,qAxis:[],field:void 0,formatter:{fn:()=>e=>e,measureText:()=>({width:0,height:0}),localeInfo:{},qNumFormat:{}},ticks:{generator:"d3",level:"outer",anchor:void 0,clamp:!1},cache:{get:()=>!1,set:()=>{},key:()=>""}};function wf(e,t){e.instance||(e.instance=t.copy(),e.instance.domain(t.domain()),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}const Df="continuousPan";var Cf={model:function({model:e,layoutService:t,largeDataService:n,dataProcessorModel:r=ac,viewCache:i,viewState:o,definitionPath:a},s={}){const{engineFetcherFactory:l=Ku,snapshotFetcherFactory:u=Yu,cacheFetcherFactory:c=Gu,cache:d={initial:{},merged:{}}}=s,f=l({model:e,layoutService:t,largeDataService:n,definitionPath:a}),m=u({layoutService:t,viewCache:i}),p=c({cache:d}),h=e=>{throw e.isHandled=!0,e};let g,y,v;return{update(e){var n,r;({initialMin:y,initialMax:v}=function(e={}){let{qMin:t,qMax:n}=e;return t=Number.isNaN(+t)?0:t,n=Number.isNaN(+n)?0:n,{initialMin:t,initialMax:n}}(e.qHyperCube.qDimensionInfo[0])),i.set("continuousMin",y),i.set("continuousMax",v),i.set("minimiumZoomSpan",(n=y,r=v,Math.max(nc,(r-n)*rc))),g=t.meta.isSnapshot?m:f,t.meta.isSnapshot&&({zoom:{min:y,max:v}}=m.getSnapshotData()),o.preventSet("zoom",{min:y,max:v})},updateLayout(e){const{qDataPages:n,qAxisData:r}=e;return t.setHyperCubeValue("qDataPages",n),t.setHyperCubeValue("qAxisData",r),t.setHyperCubeValue("qMode","S"),t.setHyperCubeValue("qColumnOrder",[]),e},initialFetch(){return g.fetch(y,v).then((e=>{const t=function(e){return{qDataPages:e.qDataPages.map((e=>{const t=Zu(e.qArea,e.qMatrix);return{...e,qArea:t}})),qAxisData:e.qAxisData}}(e);return r.command.processDataPage({dataPage:t.qDataPages.length?t.qDataPages[0]:[]}),d.initial=t,d.merged=t,e})).then((e=>Qu(y,v,e))).then((e=>this.updateLayout(e))).catch(h)},fetch:(e,t)=>g.fetch(e,t).then((e=>function(e,t){const n={};return n.qDataPages=(e.qDataPages||[]).map(((e,n)=>{const r=function(e,t){if(!t||!t.length||!t[0].length)return e;const n=t[0][0].qNum,r=t[t.length-1][0].qNum,i=[],o=[];for(let t=0,a=e.length;t<a;t++){const a=e[t][0];a.qNum<n?i.push(e[t]):a.qNum>r&&o.push(e[t])}return[...i,...t,...o]}(e.qMatrix,t.qDataPages[n].qMatrix),i=Zu(e.qArea,r);return{...e,qArea:i,qMatrix:r}})),e.qAxisData&&e.qAxisData.qAxis&&(n.qAxisData=function(e,t){if(!t||!t.qAxis.length||t.qAxis.every((e=>!e.qTicks.length)))return e;const n=t.qAxis.map((e=>e.qName)),r=t.qAxis.map((e=>({start:e.qTicks[0].qStart,end:e.qTicks[e.qTicks.length-1].qStart}))),i=t.qAxis.map((e=>({qName:e.qName,qTags:[...e.qTags],qTicks:[...e.qTicks]})));for(let t=0,o=e.qAxis.length;t<o;t++){const o=e.qAxis[t],a=n.indexOf(o.qName),s=[],l=[];if(a>-1){const{start:e,end:t}=r[a];for(let n=0,r=o.qTicks.length;n<r;n++){const r=o.qTicks[n];r.qStart<e?s.push(r):r.qStart>t&&l.push(r)}i[a].qTicks=[...s,...i[a].qTicks,...l]}}return{qAxis:i}}(e.qAxisData,t.qAxisData)),n}(d.initial,e))).then((e=>(r.command.processDataPage({dataPage:e.qDataPages.length?e.qDataPages[0]:[]}),d.merged=e,e))).then((n=>Qu(e,t,n))).catch(h),fetchFromCache:(e,t)=>p.fetch(e,t).then((n=>Qu(e,t,n))),fetchMinMaxData:()=>Promise.resolve(d.initial.qDataPages||[]),getInitialCube(){const e=t.getHyperCube();return Y({},e,{...d.initial})},getInitialLayout(){const e=this.getInitialCube();return Y({},t.getLayout(),{qHyperCube:e})},getDimensionCardinality:()=>oc(d.initial,t.meta),setSnapshotData(e){const{qHyperCube:t}=e,n=r.query.getShouldProcess()?[r.query.getFilteredDataPage({dataPage:d.merged.qDataPages[0]})]:d.merged.qDataPages;t.qDataPages=n,t.qAxisData=d.merged.qAxisData}}},event:{onZoomChange:function(e,t){const{layoutService:n,continuousDataModel:r}=e;function i(e,n,i){return r[e](n,i).then((e=>(r.updateLayout(e),t(),e)))}const o=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return function(){for(var r=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];clearTimeout(t),t=setTimeout((function(){return e.apply(r,o)}),n)}}(((e,t)=>i("fetch",e,t)),50);return({min:e,max:t},{min:r,max:a})=>!n.meta.isContinuous||e===r&&t===a?Promise.resolve(null):i("fetchFromCache",e,t).then((n=>(o(e,t),n)))},onZoomIntercept:function({viewCache:e}){let t=NaN,n=NaN,r=NaN;return(i,o)=>(t=e.get("continuousMin"),n=e.get("continuousMax"),r=e.get("minimiumZoomSpan"),Math.abs(i.max-i.min)<r?o:{min:Math.min(i.max,Math.max(t,i.min)),max:Math.max(i.min,Math.min(n,i.max))})},onZoom:function({viewCache:e,viewState:t,chart:n},{threshold:r=50,rtl:i=!1,targetKey:o}){const a=e.get("continuousMin"),s=e.get("continuousMax");return function(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,o=0;return function(){t=this;for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];n=s;var u=Date.now()-o,c=function(){o=Date.now(),r=0,e.apply(t,n)};r||(u>=i?c():r=setTimeout(c,i-u))}}(((e,r)=>{const l=(e=>n.componentsFromPoint(e).filter((e=>e.key===o))[0])(e);if(l){const o=function(e,t,n){let{x:r}=e;return r-=t.element.getBoundingClientRect().left,r-=n.rect.x,Math.max(0,Math.min(1,r/n.rect.width))}(e,n,l),u=i?1-o:o,{min:c,max:d}=t.get("zoom"),f=Math.abs(d-c),m=f-(r>0?tc:ec)*f,p=c+m*u,h=d-m*(1-u),g=p<a?a-p:0,y=h>s?h-s:0;t.set("zoom",{min:Math.max(p-y,a),max:Math.min(h+g,s)})}}),r)}},interactions:{areaPan:function({targetKey:e,chart:t,actions:n,viewState:r,viewCache:i}){return{type:"Pan",key:"continuous:pan",options:{event:Df,pointers:1,threshold:10,enable(r,i){return this.started===Df||!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e))}},events:{[`${Df}start`](n){n.preventDefault(),this.started=Df;const{min:i,max:o}=r.get("zoom");this[Df]={min:i,max:o,size:t.component(e).rect.computedInner.width,span:o-i}},[`${Df}move`](e){e.preventDefault();const{span:t,min:n,max:o,size:a}=this[Df],s=-e.deltaX/a;r.set("zoom",{min:Math.min(n+s*t,i.get("continuousMax")-t),max:Math.max(o+s*t,i.get("continuousMin")+t)})},[`${Df}end`](e){e.preventDefault(),this.started=!1},[`${Df}cancel`](e){e.preventDefault(),this.started=!1}}}}},picassoComponents:{axisOverlay:bd,timeAxis:Dd},picassoScales:{time:function e(t,n={}){const r=function(e,t,n){const r={};return Object.keys(t).forEach((i=>{const o=e[i],a=typeof o;"function"===a?r[i]=o(n):"object"!==a||Array.isArray(o)?r[i]="undefined"===a?t[i]:o:r[i]=Y(!0,{},t[i],o)})),r}(t,Sf,n),{qAxis:i}=r,o=kr(),a={instance:null,invert:!1},{min:s,max:l}=function(e,t){let n=+e.min,r=+e.max;return Number.isNaN(n)&&Number.isNaN(r)&&Array.isArray(t)&&t.length&&(n=Math.min(...t[t.length-1].qTicks.map((e=>e.qStart))),r=Math.max(...t[t.length-1].qTicks.map((e=>e.qEnd)))),n===r&&(n-=.5,r+=.5),{min:Number.isNaN(+n)?0:n,max:Number.isNaN(+r)?1:r}}(r,i);let u,c,d=[];const f=function(e){return Number.isNaN(+e)?NaN:o(e)};f.ticks=({distance:e,resolve:t=u.resolve}={})=>{const n=t(e),o=n[r.ticks.level];if(Number.isNaN(+o)||(d=c.transform(i[o].qTicks,{isMinor:!1})),!Number.isNaN(+n.minor)){const e=c.transform(i[n.minor].qTicks,{isMinor:!0});d=d.concat(e)}return"auto"===o&&(d=c.generate(e,n.isDayOrShorter)),d},f.invert=e=>o.invert(e),f.domain=e=>Array.isArray(e)?o.domain(e):o.domain(),f.range=e=>Array.isArray(e)?o.range(e):o.range(),f.norm=e=>(wf(a,f),a.instance(e)),f.normInvert=e=>(wf(a,f),a.instance.invert(e)),f.copy=()=>e(t,n),f.clamp=(e=!0)=>(o.clamp(e),o.clamp()),f.min=()=>Math.min(s,l),f.max=()=>Math.max(s,l),o.range(r.invert?[1,0]:[0,1]),o.domain([s,l]),a.invert=r.invert;const m=function(e){const t={},{measureText:n,fn:r,localeInfo:i}=e.formatter,o={second:{type:"second",pattern:"hh:mm:ss",width:Mf,formatter:void 0},minute:{type:"minute",pattern:"hh:mm",width:Mf,formatter:void 0},date:{type:"date",pattern:"YYYY-MM-DD",width:Mf,formatter:void 0},year:{type:"year",pattern:"YYYY",width:Mf,formatter:void 0}};return i&&xf.test(i.qTimestampFmt)&&(o.minute.pattern+=" tt",o.second.pattern+=" tt"),o.date.pattern=i&&i.qDateFmt?i.qDateFmt:o.date.pattern,Object.keys(o).forEach((e=>{o[e].formatter=r(o[e].pattern),o[e].width=Math.max(o[e].width,n(o[e].formatter(bf)).width+qf)})),t.getFormat=e=>o[e],t.all=()=>o,t.getFormatFromTicks=e=>{const t=e.filter((e=>!e.isMinor)),{length:n}=t;if(!n)return o.date;const r=jd(t[0].data.start),i=jd(t[n-1].data.start);return Zd.count(r,i)/n>=1?o.date:Xd.count(r,i)/n>0?o.minute:Gd.count(r,i)/n>0?o.second:o.date},t}(r);return c=vf(o.copy(),r,m),u=Pd({qAxis:i,measureText:r.formatter.measureText,reqAutoFitWidth:2*m.getFormat("minute").width,cache:r.cache,scale:f}),f.data=()=>({fields:[{formatter:f.formatter,id:()=>`qHyperCube/${r.field}`,key:()=>r.field,raw:dd(n,"fields.0.raw",(()=>({})))}]}),f.formatter=()=>m.getFormatFromTicks(d).formatter,f}}};const Nf={MINI_CHART:{value:"miniChart",translation:"properties.scrollbar.miniChart"},BAR:{value:"bar",translation:"properties.scrollbar.bar"},NONE:{value:"none",translation:"properties.scrollbar.none"}};var kf={OPTIONS:Nf,DEFAULT:Nf.MINI_CHART};function Af({layoutService:e,discrete:t}){return({h:n,rect:r,orientation:i,minThumbSize:o})=>{const a=t.query.getCurrentDataPage(),s=e.meta.size.y,l="horizontal"===i,u=r[l?"width":"height"];let c=a.qArea.qTop/s*u,d=a.qArea.qHeight/s*u;if(d<o){const e=(o-d)/2;c=c-e+(Math.max(0,0-(c-e))-Math.max(0,c+d+e-u)),d=o}return n("div",{style:{position:"absolute",right:0,bottom:0,background:"red",opacity:.2,...l?{top:0,left:c,width:d}:{top:c,left:0,height:d}}})}}function Lf({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),r=t.get("continuousMin"),i=t.get("continuousMax");return[(n.min-r)/(i-r),(n.max-r)/(i-r)]}(t,n):function(e){return e.get("viewRange")}(t)}const Ef=e=>({miniChart:e===kf.OPTIONS.MINI_CHART.value,bar:e===kf.OPTIONS.BAR.value,none:e===kf.OPTIONS.NONE.value}),Tf=({layoutService:e})=>{const t=e.getLayoutValue("scrollbar");if(t)return Ef(t);const n=e.getLayoutValue("showMiniChartForContinuousAxis");if(void 0===n)return Ef(kf.DEFAULT.value);const r=e.getLayoutValue("dimensionAxis.continuousAuto"),i=e.getLayoutValue("preferContinuousAxis");return Ef(!n&&(r||!r&&i)?kf.OPTIONS.NONE.value:kf.OPTIONS.MINI_CHART.value)};function Of({layoutService:e,override:t}){const n=Tf({layoutService:e});return t&&t.predicate({layoutService:e,scrollbar:n})&&(n.miniChart=t.value===kf.OPTIONS.MINI_CHART.value,n.bar=t.value===kf.OPTIONS.BAR.value,n.none=t.value===kf.OPTIONS.NONE.value),n}function If({layoutService:e,dockService:t,discrete:n,continuousDataModel:r,viewState:i,viewCache:o,themeService:a,rtl:s,scrollbarOverride:l,visualizeCache:u=!1,deviceType:c}){const d=Of({layoutService:e,override:l});if(d.none)return!1;const{orientation:f}=t.meta.major,m={key:"scrollbar",type:"scrollbar",layout:{dock:"horizontal"===f?t.meta.minor.start:t.meta.minor.end,minimumLayoutMode:"XSMALL"},show:()=>e.meta.isContinuous?r.getDimensionCardinality()>1:n.query.getCanScroll(),settings:{orientation:f,rtl:s,isContinuous:e.meta.isContinuous,range:()=>Lf({layoutService:e,viewState:i,viewCache:o})}};d.bar&&(m.settings.style="slim",m.settings.size={area:"touch"===c?{max:16,min:16}:{max:8,min:8}},e.meta.isContinuous||(m.settings.size.thumb={min:4}));const p=a.getStyles();return p.color&&(m.style={standard:{thumb:{"border-color":p.color,opacity:.4},before:{background:p.color,opacity:.1},after:{background:p.color,opacity:.1}}}),e.meta.isDiscrete&&u&&(m.settings.injections=()=>[Af({layoutService:e,discrete:n})]),m}function Pf({componentKey:e,chart:t,viewState:n,viewCache:r,layoutService:i,dockService:o,rtl:a}){return s=>{const{x:l,y:u}=s.center,c=t.element.getBoundingClientRect(),d=t.component(e),f="horizontal"===o.meta.major.orientation,m=f?l-c.left-d.rect.computedInner.x:u-c.top-d.rect.computedInner.y,p=f?d.rect.computedInner.width:d.rect.computedInner.height,h=f&&a?p-m:m,g=Math.max(0,Math.min(h/p,1)),[y,v]=Lf({layoutService:i,viewState:n,viewCache:r}),b=g<y,x=g>v,q=!b&&!x;return{pixel:h,relative:g,thumb:q?h-y*p:0,beforeThumb:b,afterThumb:x,onThumb:q}}}function Rf({componentKey:e,chart:t,viewState:n,viewCache:r,layoutService:i,dockService:o}){return()=>{const a=t.component(e),{orientation:s}=o.meta.major,{width:l,height:u}=a.rect.computedInner,c="horizontal"===s?l:u,[d,f]=Lf({layoutService:i,viewState:n,viewCache:r});return{size:c,thumbSize:(f-d)*c}}}function Ff({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){const u=Pf({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),c=Rf({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a});return{type:"Tap",options:{event:"scrollbarTap",enable:(r,i)=>!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e))},events:{scrollbarTap(n){n.preventDefault();const a=u(n);if(o.meta.isContinuous){const e=r.get("zoom"),t=e.max-e.min,n=i.get("continuousMin"),o=i.get("continuousMax"),s=n+(o-n)*a.relative;r.set("zoom",{min:Math.min(s-t/2,o-t),max:Math.max(s+t/2,n+t)})}else{const e=c(),t=a.pixel-e.thumbSize/2,n=Math.max(0,t/e.size);s.command.scrollTo(n)}t.component(e).emit("render")}}}}const jf="data-scrollbar-handle";function Hf({e:e}){return(e.srcEvent||e).srcElement.getAttribute(jf)||""}const zf="scrollbarResize",Bf=e=>{const[t]=e.changedPointers;return t&&("pointerdown"===t.type||"mousedown"===t.type)};function _f({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:s}){const l=Pf({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:s});return{type:"Pan",key:`event:${zf}`,options:{event:zf,threshold:0,enable(e,t){return!(!o.meta.isContinuous||!n.scroll.enabled())&&(!t||(this[zf]=this[zf]||{},Bf(t)&&Hf({e:t})&&(this[zf].panningEvent=t.srcEvent),!!this[zf].panningEvent))}},events:{[`${zf}start`](n){n.preventDefault(),this[zf]=this[zf]||{},this[zf].panningEvent&&t.component(e).emit("dragStart",this[zf].panningEvent)},[`${zf}move`](n){if(n.preventDefault(),this[zf]=this[zf]||{},!this[zf].panningEvent)return;const o=r.get("zoom"),a=i.get("continuousMin"),s=i.get("continuousMax"),u=i.get("minimiumZoomSpan"),c=(s-a)*l(n).relative+a,d=Hf({e:this[zf].panningEvent});let f="start"===d?Math.min(c,o.max):o.min,m="end"===d?Math.max(c,o.min):o.max;f===m&&(f-="start"===d?u:0,m+="end"===d?u:0),r.set("zoom",{min:f,max:m}),t.component(e).emit("render")},[`${zf}end`](n){n.preventDefault(),this[zf]=this[zf]||{},delete this[zf].panningEvent,t.component(e).emit("dragEnd")},[`${zf}cancel`](n){n.preventDefault(),this[zf]=this[zf]||{},delete this[zf].panningEvent,t.component(e).emit("dragEnd")}}}}const Vf="scrollbarPan";function $f({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){const u=Pf({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),c=Rf({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a});return{type:"Pan",key:`event:${Vf}`,options:{event:Vf,threshold:0,enable(r,i){return this[Vf]=this[Vf]||{},!(i&&!this[Vf].isPanning)||!!n.scroll.enabled()&&((!i||i.target===t.element)&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e)))}},events:{[`${Vf}start`](n){n.preventDefault();const a=u(n);if(this[Vf]=this[Vf]||{},this[Vf].isPanning=!0,t.component(e).emit("lockState"),o.meta.isContinuous){const e=r.get("zoom"),t=e.max-e.min,n=i.get("continuousMin"),o=i.get("continuousMax"),s=n+(o-n)*a.relative;s<e.min?r.set("zoom",{min:Math.min(s,o-t),max:Math.max(s+t,n+t)}):s>e.max&&r.set("zoom",{min:Math.min(s-t,o-t),max:Math.max(s,n+t)}),this[Vf].relative=a.relative,this[Vf].zoom=r.get("zoom"),this[Vf].zoom.span=this[Vf].zoom.max-this[Vf].zoom.min,this[Vf].zoom.fullSpan=o-n}else if(a.onThumb)this[Vf].offset=a.thumb;else{const e=c();this[Vf].offset=a.beforeThumb?0:e.thumbSize}},[`${Vf}move`](n){n.preventDefault();const a=u(n);if(this[Vf]=this[Vf]||{},o.meta.isContinuous){const e=a.relative-this[Vf].relative,{fullSpan:t,span:n,min:o,max:s}=this[Vf].zoom,l=i.get("continuousMin"),u=i.get("continuousMax");r.set("zoom",{min:Math.min(o+e*t,u-n),max:Math.max(s+e*t,l+n)})}else{const e=a.pixel-(this[Vf].offset||0),t=c(),n=Math.max(0,e/t.size);s.command.scrollTo(n)}t.component(e).emit("render")},[`${Vf}end`](n){n.preventDefault(),this[Vf]=this[Vf]||{},this[Vf].isPanning=!1,t.component(e).emit("unlockState")},[`${Vf}cancel`](n){n.preventDefault(),this[Vf]=this[Vf]||{},this[Vf].isPanning=!1,t.component(e).emit("unlockState")}}}}function Uf({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){return[Ff({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}),_f({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),$f({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l})]}function Wf({componentKey:e,chart:t,actions:n,layoutService:r}){const i=(i,o)=>{if(!r.meta.isContinuous)return;const a=t.component(e);a&&a.emit&&n.scroll.enabled()&&a.emit(i,o)};return{type:"native",events:{mousemove:e=>i("hover",e),mouseleave:()=>i("leave")}}}function Kf({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){return{gestures:[...Uf({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l})],native:Wf({componentKey:e,chart:t,actions:n,layoutService:o})}}const Gf={background:"rgba(0, 0, 0, 0.1)"},Yf={top:-1,bottom:-1,width:6},Xf={width:2,background:"#595959"};var Jf={before:Gf,after:Gf,thumb:{background:"transparent",border:"1px solid rgba(68, 68, 68, 0.4)"},startHandle:Yf,endHandle:Yf,startHandleBorder:Xf,endHandleBorder:Xf};const Zf={background:"rgba(0, 0, 0, 0.1)"},Qf={top:-1,bottom:-1,width:6},em={width:2,background:"#595959"};var tm={before:Zf,after:Zf,thumb:{background:"#B0AFAE",border:"transparent"},startHandle:Qf,endHandle:Qf,startHandleBorder:em,endHandleBorder:em};const nm={position:"absolute",top:0,right:0,bottom:0,left:0,boxSizing:"border-box"},rm={pointerEvents:"initial"},im={pointerEvents:"none"};const om="ew-resize",am="default";function sm(){const{rect:e}=this,{settings:t}=this.settings,n="horizontal"===t.orientation,r=n?e.computedInner.width:e.computedInner.height,i=t.range(),o=n&&t.rtl;return{size:r,start:(o?1-i[1]:i[0])*r,end:(o?1-i[0]:i[1])*r}}function lm(){const e=this.state.hover.start||this.state.hover.end||this.state.drag.start||this.state.drag.end;this.renderer.element().ownerDocument.body.style.cursor=e?om:am}function um(e,t,n){const{min:r}=this.settings.settings.size.thumb;if(n-t<r){const i=(r-(n-t))/2,o=Math.max(0,0-(t-i))-Math.max(0,n+i-e);return{size:e,start:t-i+o,end:n+i+o}}return{size:e,start:t,end:n}}function cm(e){const t=(e.srcEvent||e).srcElement;return this.renderer.element().contains(t)}function dm(){const{size:e,start:t,end:n}=sm.call(this);this.renderer.render(this.elements(this.h,um.call(this,e,t,n)))}function fm(){const{state:e,settings:t,style:n}=this,r=t.settings.style;return e.style[r]||(e.style[r]=function({id:e,style:t}){const n="slim"===e?tm:Jf;return{container:{...nm},before:{...nm,...n.before,...t.before},after:{...nm,...n.after,...t.after},thumb:{...nm,...n.thumb,...t.thumb},startHandle:{...nm,...rm,...n.startHandle},endHandle:{...nm,...rm,...n.endHandle},startHandleBorder:{...nm,...im,...n.startHandleBorder},endHandleBorder:{...nm,...im,...n.endHandleBorder}}}({id:t.settings.style,style:n[r]})),e.style[r]}var mm={require:["renderer"],defaultSettings:{settings:{style:"standard",size:{area:{min:30,max:40,ratio:1/8},thumb:{min:4}},orientation:"horizontal",rtl:!1,isContinuous:!1,range:()=>[0,1],injections:()=>[]},style:{standard:{before:{},thumb:{},after:{}},slim:{before:{},thumb:{},after:{}}}},renderer:"dom",on:{render(){dm.call(this)},lockState(){this.state.locked=!0},unlockState(){this.state.locked=!1},hover(e){if(this.state.locked||this.state.drag.start||this.state.drag.end||!cm.call(this,e)&&this.state.hover.isPristine())return;this.state.hover.reset();const t=Hf({e:e});t&&(this.state.hover[t]=!0),lm.call(this),dm.call(this)},leave(){this.state.locked||(this.state.hover.reset(),lm.call(this),dm.call(this))},dragStart(e){if(this.state.locked)return;this.state.drag.reset();const t=Hf({e:e});t&&(this.state.drag[t]=!0),lm.call(this)},dragEnd(){this.state.locked||(this.state.drag.reset(),lm.call(this),dm.call(this))}},preferredSize({outer:e}){const{min:t,max:n,ratio:r}=this.settings.settings.size.area,i="horizontal"===this.settings.settings.orientation?"height":"width";return Math.max(t,Math.min(n,e[i]*r))},created(){this.state={style:{},locked:!1,hover:{start:!1,end:!1,reset(){this.start=!1,this.end=!1},isPristine(){return!this.start&&!this.end}},drag:{start:!1,end:!1,reset(){this.start=!1,this.end=!1}}}},render(e){this.h=e;const{size:t,start:n,end:r}=sm.call(this);return this.elements(e,um.call(this,t,n,r))},properties(){return"horizontal"===this.settings.settings.orientation?{start:"left",end:"right"}:{start:"top",end:"bottom"}},elements(e,{size:t,start:n,end:r}){const{settings:i}=this.settings,o=i.injections().map((t=>t({h:e,rect:this.rect,orientation:i.orientation,minThumbSize:i.size.thumb.min})));return function({h:e,size:t,start:n,end:r,properties:i,startHandleActive:o,endHandleActive:a,style:s,continuous:l,invert:u,injections:c}){const d={[i.end]:t-n},f={[i.start]:r},m={left:-3},p={left:1},h={right:-3,left:"auto"},g={left:3},y=e("div",{style:{...s.before,...u?f:d},class:"scrollbar--before"}),v=e("div",{style:{...s.after,...u?d:f},class:"scrollbar--after"}),b=[];if(l){const t=e("div",{style:{...s.startHandle,...u?h:m},class:"scrollbar--start-handle",[jf]:"start"},o?e("div",{style:{...s.startHandleBorder,...u?g:p}}):void 0);b.push(t);const n=e("div",{style:{...s.endHandle,...u?m:h},class:"scrollbar--end-handle",[jf]:"end"},a?e("div",{style:{...s.endHandleBorder,...u?p:g}}):void 0);b.push(n)}const x=e("div",{style:{...s.thumb,[i.start]:n,[i.end]:t-r},class:"scrollbar--thumb"},b);return e("div",{style:{...s.container}},[y,x,v,...c])}({h:e,size:t,start:n,end:r,properties:this.properties(),startHandleActive:this.state.hover.start||this.state.drag.start,endHandleActive:this.state.hover.end||this.state.drag.end,style:fm.call(this),continuous:i.isContinuous,invert:"horizontal"===i.orientation&&i.rtl,injections:o})}};const pm={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:r,rendHeight:i,flipXY:o,symbol:a}){let s="x",l="y",u=r,c=i,d=t<.5?90:-90;return o&&(s="y",l="x",u=i,c=r,d=t<.5?180:0),a(Y({},e,{[s]:n*u,[l]:c-Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}};function hm({i:e,width:t,height:n,resolved:r,keys:i,flipXY:o,calcKey:a="box"}){let s,l=null,u=null;void 0!==r.major.settings.binStart?(l=r.major.items[e].binStart,u=r.major.items[e].binEnd,s=r.major.settings.binStart.scale):(s=r.major.settings.major.scale,l=s?r.major.items[e].major:0);let c=0;s?s.bandwidth?(c=s.bandwidth(),l-=c/2):c=u-l:c=1;const d=Y({},{major:l,majorEnd:u},r.minor.items[e]);i.forEach((t=>{d[t]=r[t].items[e]}));const f=o?n:t,m=function({bandwidth:e,width:t,minWidthPx:n,maxWidthPx:r,maxMajorWidth:i}){const o=e>=0?1:-1;let a=Math.min(o*e*t,Number.isNaN(Number(r))?i:r/i);return a=Number.isNaN(Number(n))?a:Math.max(n/i,a),a*o}({bandwidth:c,width:d[a].width,minWidthPx:d[a].minWidthPx,maxWidthPx:d[a].maxWidthPx,maxMajorWidth:f}),p=(c-m)/2,h=p+d.major+m/2;return{item:d,boxCenter:h,boxWidth:m,boxPadding:p,rendWidth:t,rendHeight:n}}function gm({keys:e,data:t,defaultSettings:n,style:r,settings:i,width:o,height:a,resolver:s}){const l=Y(!0,{},n||{},r||{}),u={major:"horizontal"===i.orientation?a:o,minor:"horizontal"===i.orientation?o:a},c=i.major;let d;d="object"==typeof c&&"object"==typeof c.ref&&void 0!==c.ref.start&&void 0!==c.ref.end?s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:Y(!0,{},{binStart:{scale:i.major.scale,ref:i.major.ref.start},binEnd:{scale:i.major.scale,ref:i.major.ref.end}})}):"object"==typeof c&&void 0!==c.binStart&&void 0!==c.binEnd?s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:Y(!0,{},{binStart:{scale:i.major.scale,ref:"binStart"},binEnd:{scale:i.major.scale,ref:"binEnd"}},i.major)}):s.resolve({data:t,scaled:u,defaults:{major:.5},settings:{major:i.major}});const f=i.minor||{};let m;const p={major:d,minor:s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:Y(!0,{},{start:{scale:f.scale,ref:"start"},end:{scale:f.scale,ref:"end"},min:{scale:f.scale,ref:"min"},max:{scale:f.scale,ref:"max"},med:{scale:f.scale,ref:"med"}},f)})};for(let n=0,r=e.length;n<r;n++)m=e[n],p[m]=s.resolve({data:t,defaults:l[m],settings:i[m],scaled:u});return p}const ym=["oob"];const vm={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:10},data:{},style:{}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,{dockValue:n}=this.settings.settings,r="horizontal"===this.settings.settings.orientation,{data:i,style:o,resolver:a,symbol:s}=this,l=gm({keys:ym,data:i,defaultSettings:{oob:pm.getDefaultSettings()},style:o,settings:this.settings.settings,width:e,height:t,resolver:a}),{settings:u,items:c}=l,d=function({width:e,height:t,flipXY:n,resolved:r,keys:i,symbol:o,dockValue:a,_calcItemRenderingOpts:s=hm}){const l=[],{items:u}=r.major;for(let c=0,d=u.length;c<d;c++){const{item:d,boxCenter:f,rendWidth:m,rendHeight:p}=s({i:c,width:e,height:t,resolved:r,keys:i,flipXY:n,calcKey:"oob"}),h=u[c].data,g=[];if(d.oob.show){g.push(pm.createOob({oob:d.oob,dockValue:a,boxCenter:f,rendWidth:m,rendHeight:p,flipXY:n,symbol:o}));const e={type:"container",data:h,collider:{type:"bounds"},children:g};l.push(e)}}return l}({items:c,settings:u,width:e,height:t,flipXY:r,resolved:l,keys:ym,symbol:s,dockValue:n});return d}},bm={size:25,hat:{show:!0,fill:"#999",stroke:"#000",strokeWidth:0,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1,alignment:0}},xm=["hat"];function qm(e,t=!0){let n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?`M${r.x} ${r.y}`:`L${r.x} ${r.y}`,n+=" "}return t&&(n+="Z"),n}function Mm({item:e,boxWidth:t,boxPadding:n,rendWidth:r,rendHeight:i,flipXY:o}){let a="x",s="y",l=r,u=i,c=e.hat.alignment||0;o&&(a="y",s="x",l=i,u=r,c=1-c);const d=(n+e.major)*l;let f=[{[a]:d,[s]:0+u},{[a]:d+t*c*l,[s]:8},{[a]:d+t*l,[s]:0+u},{[a]:d+t*l,[s]:0+u+10},{[a]:d,[s]:0+u+10}];const m=Y({},e.hat,{type:"path",d:qm(f)});f=[{[a]:d,[s]:0},{[a]:d+t*(1-c)*l,[s]:0+u-8},{[a]:d+t*l,[s]:0},{[a]:d+t*l,[s]:-10},{[a]:d,[s]:-10}];return[m,Y({},e.hat,{type:"path",d:qm(f)})]}const Sm={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:25},data:{},style:{hat:"$shape"}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,n="horizontal"===this.settings.settings.orientation,{data:r,style:i,resolver:o}=this,a=gm({keys:xm,data:r,defaultSettings:bm,style:i,settings:this.settings.settings,width:e,height:t,resolver:o}),{settings:s,items:l}=a,u=function({width:e,height:t,flipXY:n,resolved:r,keys:i,_calcItemRenderingOpts:o=hm}){const a=[],{items:s}=r.major;for(let l=0,u=s.length;l<u;l++){const{item:u,boxWidth:c,boxPadding:d,rendWidth:f,rendHeight:m}=o({i:l,width:e,height:t,resolved:r,keys:i,flipXY:n,calcKey:"hat"}),p=s[l].data,h=[];u.hat.show&&h.push(...Mm({item:u,boxWidth:c,boxPadding:d,rendWidth:f,rendHeight:m,flipXY:n}));const g={type:"container",data:p,collider:{type:"bounds"},children:h};a.push(g)}return a}({items:l,settings:s,width:e,height:t,flipXY:n,resolved:a,keys:xm});return u}};function wm(e,t,n,r){const i=function(t){const n=String(t);return e(n)};return i.ticks=()=>t.map((t=>{const o=i([t.data.value,r?n-1:0]),a=i([t.data.value,r?0:n-1])+e.bandwidth();return{position:(o+a)/2,label:t.label,data:t.data,start:o,end:a}})),i.bandwidth=()=>e.bandwidth(),i.data=()=>e.data(),i.domain=()=>e.domain(),i.pxScale=function(r){const i=e.pxScale(r);return i===e?this:wm(i,t,n)},i}function Dm(e){const t=e.scale("band");e.scale("group-by-measure",(function(e={},n={},r={}){const i=t(e,n,r),o=i.domain(),a=i.ticks(),s=[],l=e.measureCount;return o.forEach(((e,t)=>{for(let t=0;t<l;++t)s.push(String([e,t]));s.push(`SPACER_${t}_SPACER`)})),s.splice(-1),i.domain(s),wm(i,a,l,e.invert)}))}const Cm=()=>({version:"1.34.2",barGrouping:{grouping:"grouped"},color:{auto:!0,autoMinMax:!0,byDimDef:void 0,byMeasureDef:void 0,colorExpression:void 0,dimensionScheme:"12",expressionIsColor:!0,expressionLabel:"",formatting:{numFormatFromTemplate:!0,isCustomFormatted:void 0},measureMin:void 0,measureMax:void 0,measureScheme:"sg",mode:"primary",paletteColor:{index:6},persistent:!1,reverseScheme:!1,singleColor:void 0,useBaseColors:"off",useDimColVal:!0,useMeasureGradient:!0},components:[],dataPoint:{showLabels:!1,showSegmentLabels:!1,showTotalLabels:!0},dimensionAxis:{axisDisplayMode:"auto",continuousAuto:!0,dock:"near",label:"auto",maxVisibleItems:10,show:"all"},footnote:"",gridLine:{auto:!0,spacing:2},legend:{dock:"auto",show:!0,showTitle:!0},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"all",spacing:1},orientation:"vertical",preferContinuousAxis:!0,qHyperCubeDef:{qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:17,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1},refLine:{refLines:[],dimRefLines:[]},scrollbar:"miniChart",scrollStartPos:0,showDetails:!0,showDisclaimer:!0,showMiniChartForContinuousAxis:!0,showTitles:!0,subtitle:"",title:"",tooltip:{auto:!0,hideBasic:!1,data:{qHyperCubeDef:void 0},chart:void 0,imageComponents:void 0}});function Nm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function km(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nm(Object(n),!0).forEach((function(t){Om(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Am(){Am=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,i){var o=t&&t.prototype instanceof f?t:f,a=Object.create(o.prototype),s=new D(i||[]);return r(a,"_invoke",{value:q(e,n,s)}),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d={};function f(){}function m(){}function p(){}var h={};l(h,o,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g(C([])));y&&y!==t&&n.call(y,o)&&(h=y);var v=p.prototype=f.prototype=Object.create(h);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function i(r,o,a,s){var l=c(e[r],e,o);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return i("throw",e,a,s)}))}s(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function q(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=M(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=c(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function M(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,M(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=c(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,d;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function D(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function C(e){if(e||""===e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}throw new TypeError(typeof e+" is not iterable")}return m.prototype=p,r(v,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:m,configurable:!0}),m.displayName=l(p,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,s,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},b(x.prototype),l(x.prototype,a,(function(){return this})),e.AsyncIterator=x,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new x(u(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(v),l(v,s,"Generator"),l(v,o,(function(){return this})),l(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=C,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;w(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function Lm(e){return Lm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lm(e)}function Em(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function Tm(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Em(o,r,i,a,s,"next",e)}function s(e){Em(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Om(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Im(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Pm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||Fm(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rm(e){return function(e){if(Array.isArray(e))return jm(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Fm(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fm(e,t){if(e){if("string"==typeof e)return jm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jm(e,t):void 0}}function jm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Hm=Object.prototype.hasOwnProperty,zm=Object.prototype.toString,Bm=Object.defineProperty,_m=Object.getOwnPropertyDescriptor,Vm=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===zm.call(e)},$m=function(e){if(!e||"[object Object]"!==zm.call(e))return!1;var t,n=Hm.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Hm.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Hm.call(e,t)},Um=function(e,t){Bm&&"__proto__"===t.name?Bm(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Wm=function(e,t){if("__proto__"===t){if(!Hm.call(e,t))return;if(_m)return _m(e,t).value}return e[t]},Km=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((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=Wm(s,n),s!==(i=Wm(t,n))&&(c&&i&&($m(i)||(o=Vm(i)))?(o?(o=!1,a=r&&Vm(r)?r:[]):a=r&&$m(r)?r:{},Um(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&Um(s,{name:n,newValue:i}));return s}));function Gm(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map((function(e){return i[e.value%i.length]}))},valueAccessor:e.value}}function Ym(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map((function(e){return i[e.row.value%i.length]}))},valueAccessor:e.value}}function Xm(e,t,n,r,i){var o,a,s=i.byRow,l=i.byElemNo;if(r&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(a=(o=e.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===a?void 0:a.qArea.qHeight)||0)))return l(r,r.raw().qCardinal);if(r){var u=t.pic.extract({field:r.key(),trackBy:r.value}).length;return s(r,u)}return{}}function Jm(e,t){var n=e.hc.qDimensionInfo,r=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(r.activeDimensionIndex>=0){var i=n[r.activeDimensionIndex];r=i.coloring&&i.coloring.colorMapRef?{type:"libraryItem",key:i.coloring.colorMapRef,activeDimensionIndex:r.activeDimensionIndex}:{activeDimensionIndex:r.activeDimensionIndex}}return r}function Zm(e,t){var n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter((function(e){return"dimension"===e.type()}))[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(n=t.key?e.pic.field((function(e){return e.raw().colorMapRef===t.key})):void 0)&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n}function Qm(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ep(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function tp(){}var np=1/.7,rp="\\s*([+-]?\\d+)\\s*",ip="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",op="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ap=/^#([0-9a-f]{3,8})$/,sp=new RegExp(`^rgb\\(${rp},${rp},${rp}\\)$`),lp=new RegExp(`^rgb\\(${op},${op},${op}\\)$`),up=new RegExp(`^rgba\\(${rp},${rp},${rp},${ip}\\)$`),cp=new RegExp(`^rgba\\(${op},${op},${op},${ip}\\)$`),dp=new RegExp(`^hsl\\(${ip},${op},${op}\\)$`),fp=new RegExp(`^hsla\\(${ip},${op},${op},${ip}\\)$`),mp={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 pp(){return this.rgb().formatHex()}function hp(){return this.rgb().formatRgb()}function gp(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ap.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?yp(t):3===n?new qp(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?vp(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?vp(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=sp.exec(e))?new qp(t[1],t[2],t[3],1):(t=lp.exec(e))?new qp(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=up.exec(e))?vp(t[1],t[2],t[3],t[4]):(t=cp.exec(e))?vp(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=dp.exec(e))?Np(t[1],t[2]/100,t[3]/100,1):(t=fp.exec(e))?Np(t[1],t[2]/100,t[3]/100,t[4]):mp.hasOwnProperty(e)?yp(mp[e]):"transparent"===e?new qp(NaN,NaN,NaN,0):null}function yp(e){return new qp(e>>16&255,e>>8&255,255&e,1)}function vp(e,t,n,r){return r<=0&&(e=t=n=NaN),new qp(e,t,n,r)}function bp(e){return e instanceof tp||(e=gp(e)),e?new qp((e=e.rgb()).r,e.g,e.b,e.opacity):new qp}function xp(e,t,n,r){return 1===arguments.length?bp(e):new qp(e,t,n,null==r?1:r)}function qp(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Mp(){return`#${Cp(this.r)}${Cp(this.g)}${Cp(this.b)}`}function Sp(){const e=wp(this.opacity);return`${1===e?"rgb(":"rgba("}${Dp(this.r)}, ${Dp(this.g)}, ${Dp(this.b)}${1===e?")":`, ${e})`}`}function wp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Dp(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Cp(e){return((e=Dp(e))<16?"0":"")+e.toString(16)}function Np(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ap(e,t,n,r)}function kp(e){if(e instanceof Ap)return new Ap(e.h,e.s,e.l,e.opacity);if(e instanceof tp||(e=gp(e)),!e)return new Ap;if(e instanceof Ap)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 Ap(a,s,l,e.opacity)}function Ap(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Lp(e){return(e=(e||0)%360)<0?e+360:e}function Ep(e){return Math.max(0,Math.min(1,e||0))}function Tp(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Qm(tp,gp,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:pp,formatHex:pp,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return kp(this).formatHsl()},formatRgb:hp,toString:hp}),Qm(qp,xp,ep(tp,{brighter(e){return e=null==e?np:Math.pow(np,e),new qp(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new qp(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new qp(Dp(this.r),Dp(this.g),Dp(this.b),wp(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:Mp,formatHex:Mp,formatHex8:function(){return`#${Cp(this.r)}${Cp(this.g)}${Cp(this.b)}${Cp(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Sp,toString:Sp})),Qm(Ap,(function(e,t,n,r){return 1===arguments.length?kp(e):new Ap(e,t,n,null==r?1:r)}),ep(tp,{brighter(e){return e=null==e?np:Math.pow(np,e),new Ap(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Ap(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 qp(Tp(e>=240?e-240:e+120,i,r),Tp(e,i,r),Tp(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ap(Lp(this.h),Ep(this.s),Ep(this.l),wp(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=wp(this.opacity);return`${1===e?"hsl(":"hsla("}${Lp(this.h)}, ${100*Ep(this.s)}%, ${100*Ep(this.l)}%${1===e?")":`, ${e})`}`}}));const Op=Math.PI/180,Ip=180/Math.PI,Pp=4/29,Rp=6/29,Fp=3*Rp*Rp;function jp(e){if(e instanceof Hp)return new Hp(e.l,e.a,e.b,e.opacity);if(e instanceof $p)return Up(e);e instanceof qp||(e=bp(e));var t,n,r=Vp(e.r),i=Vp(e.g),o=Vp(e.b),a=zp((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=zp((.4360747*r+.3850649*i+.1430804*o)/.96422),n=zp((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Hp(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Hp(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function zp(e){return e>.008856451679035631?Math.pow(e,1/3):e/Fp+Pp}function Bp(e){return e>Rp?e*e*e:Fp*(e-Pp)}function _p(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Vp(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function $p(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Up(e){if(isNaN(e.h))return new Hp(e.l,0,0,e.opacity);var t=e.h*Op;return new Hp(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Qm(Hp,(function(e,t,n,r){return 1===arguments.length?jp(e):new Hp(e,t,n,null==r?1:r)}),ep(tp,{brighter(e){return new Hp(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Hp(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 qp(_p(3.1338561*(t=.96422*Bp(t))-1.6168667*(e=1*Bp(e))-.4906146*(n=.82521*Bp(n))),_p(-.9787684*t+1.9161415*e+.033454*n),_p(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Qm($p,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof $p)return new $p(e.h,e.c,e.l,e.opacity);if(e instanceof Hp||(e=jp(e)),0===e.a&&0===e.b)return new $p(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Ip;return new $p(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new $p(e,t,n,null==r?1:r)}),ep(tp,{brighter(e){return new $p(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new $p(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Up(this).rgb()}}));var Wp=e=>()=>e;function Kp(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Wp(isNaN(e)?t:e)}var Gp=function e(t){var n=function(e){return 1==(e=+e)?Kp: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):Wp(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=xp(e)).r,(t=xp(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Kp(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),Yp=/^class(-pyramid)?/,Xp=function(e,t,n,r){var i=void 0!==n.min?n.min:r.min(),o=void 0!==n.max?n.max:r.max(),a=i,s=o,l=t.limits,u={},c="percent"===t.limitType?l.map((function(e){return i+(o-i)*e})):l,d=t.colors.map((function(t){return e.resolveUIColor(t)}));if(i=Math.min.apply(Math,[i].concat(Rm(c))),o=Math.max.apply(Math,[o].concat(Rm(c))),u.min=i,u.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))u.type="categorical",Object.assign(u,function(e){var t=e.min,n=e.max,r=e.limits,i=e.range,o=[],a=[];if(r.length)if(r[r.length-1]<t)a.push(t,n),o.push(i[i.length-1],i[i.length-1],i[i.length-1]);else if(r[0]>n)a.push(t,n),o.push(i[0],i[0],i[0]);else{if(r[0]>t)a.push(t),o.push(i[0]);else{a.push(t);for(var s=0;s<r.length;s++)if(t<r[s]){o.push(i[s]);break}}for(var l=0;l<r.length;l++)t<r[l]&&r[l]<n&&(a.push(r[l]),o.push(i[l]));if(r[r.length-1]<n)a.push(n),o.push(i[r.length]),o.push(i[r.length]);else{a.push(n);for(var u=0;u<r.length;u++)if(r[u]>n){o.push(i[u]),o.push(i[u]);break}}}else o.push(i[0]);return{min:t,max:n,range:o,domain:a}}({min:"percent"===t.limitType?i:a,max:"percent"===t.limitType?o:s,range:d,limits:"percent"===t.limitType?c:l}));else if(t.breakTypes){var f=t.breakTypes;u.type="continuous",u.domain=[i],u.range=[d[0]];for(var m=0;m<c.length;m+=1)if(f[m]){var p=d[m],h=d[m+1],g=Gp(p,h)(.5);u.range.push(g),u.domain.push(c[m]),m<c.length-1&&f[m+1]&&(u.range.push(d[m+1]),u.domain.push((c[m]+c[m+1])/2))}else u.range.push(d[m]),u.range.push(d[m+1]),u.domain.push(c[m]),u.domain.push(c[m]+Math.min(1e-6,(o-i)/1e6));u.range.push(d[d.length-1]),u.domain.push(o)}else u.domain=c,u.range=d;return u};function Jp(e,t,n,r,i){var o,a,s,l=0,u=[],c=(e-t)/(r+1);if(0===c)return 1;for(o=0;o<n.length;o+=1)a=.99*(n[o]-t),s=n[o]>e?Math.floor(e/c):n[o]<t?0:Math.floor(a/c),Number.isNaN(s)||(u[s]?u[s]+=1:u[s]=1);for(o=0;o<u.length;o+=1)u[o]&&(l+=1);return l<=r||l>=i?Math.max(l,r):Jp(e,t,n,r+1,i)}var Zp=function(e,t,n,r){var i,o,a=t.theme,s=t.hc,l=r.f,u={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},c=[],d=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(d=!("S"===(i=n.pic.raw()).qMode&&(i.qDataPages[0]&&i.qSize.qcy>i.qDataPages[0].qArea.qHeight||!i.qDataPages.length&&i.qSize.qcy>0)||"K"===i.qMode&&i.qStackedDataPages[0]&&i.qSize.qcy>i.qStackedDataPages[0].qArea.qHeight||"T"===i.qMode&&i.qSize.qcy>i.qTreeDataPages[0].qGroupSize))&&(c=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:s.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,Rm(e))<0}}}}).filter((function(e){return e.value>=0&&!e.exclude.value})).map((function(e){return e.num.value})).filter((function(e){return"number"==typeof e})))}if(!1===n.input.autoMinMax){if(u.min=n.input.measureMin,u.max=n.input.measureMax,u.max<u.min)return{invalid:!0}}else if(l&&!d)u.min=l.min(),u.max=l.max();else if(l){if(!c.length)return{invalid:!0};u.min=Math.min.apply(Math,Rm(c)),u.max=Math.max.apply(Math,Rm(c))}if(n.input.measureScheme&&(u.palettes={quant:n.input.measureScheme}),a){var f=a.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];u.type=f&&Yp.test(f.type)?"categorical":"continuous","categorical"===u.type&&(o=f.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,Rm(f.colors.map((function(e){return e?e.length:0})))):f.colors.length)}if("categorical"===u.type){for(var m=d?Jp(u.max,u.min,c,1,o):o,p=(u.max-u.min)/m,h=[],g=0;g<m+1;g+=1)h.push(u.min+p*g);u.domain=h,u.range=function(e){for(var t=e.resources.theme.palette("quant",m),n=Math.max(1,Math.floor(t.length/m)),r=[],i=0;i<m;i+=1)r.push(t[i*n]);return[r[0]].concat(r,[r[r.length-1]])}}return u};function Qp(e,t){var n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field((function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key})):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n||(n=e.pic.field((function(e){return void 0!==e.raw().matchMeasure})))&&(n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[n.raw().matchMeasure]),n}function eh(e){var t,n=e.cm,r=e.defaults,i=e.index,o=e.input,a=e.pic;if(!o||!o.on)return null;var s=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===s?function(e,t,n){var r=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(r=e.resolveUIColor(t.paletteColor)),km(km({},n),{},{mode:"constant",type:"constant",primary:r})}(n,o,r):"byExpression"===s?function(e,t,n){var r="qMeasureInfo/".concat(e,"/"),i=t.field((function(e){return e.id().startsWith(r)&&"colorByMeasureExpression"===e.raw().id})),o=i;return km(km({},n),{},o?{mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(i,a,r):null}function th(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function nh(e,t){for(var n=(null==t?void 0:t.domain)||[],r=(null==t?void 0:t.range)||[],i=[],o=0;o<e.length;++o){var a=e[o];if("constant"===(null==a?void 0:a.mode)){var s=n.indexOf(o);-1===s?(n.push(o),r.push(a.primary)):r[s]=a.primary,e[o]=null}else if(a){i.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),r.splice(l,1))}}return{domain:n,range:r,exclude:i}}function rh(e,t,n,r){var i,o=function(e,t,n,r){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var r=t.theme,i=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?Qp:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),u=Zp(0,{theme:r,hc:i},n,{f:l});if(u.invalid)return u;"expression"===s.type&&(s.activeMeasureIndex<0||void 0===s.activeMeasureIndex)&&(u.label=s.label,l&&"color.altLabel"===l.raw().labelExpRef&&(u.label=n.input.altLabel)),!u.label&&l&&(u.label=l.title());var c=s.activeMeasureIndex>=0?l:null;if(!c&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(c=n.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===s.type)if(c){var d=c.raw().coloring;d&&d.gradient&&Km(u,Xp(e,d.gradient,u,c))}else u.auxiliary=s;return u}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.getCDef,o=void 0===i?Jm:i,a=r.getCByField,s=void 0===a?Zm:a,l=r.getPersistence,u=void 0===l?Xm:l,c=o(t,n),d=s(n,c),f=d?d.raw():{},m=n&&n.pic?n.pic.raw():{};if(f.qError||f.qSize&&0===f.qSize.qcy&&!m.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:d?d.key():void 0,isFieldLocked:f.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(p.label=c.label,"color.altLabel"===f.labelExpRef&&(p.label=n.input.altLabel)),!p.label&&d&&(p.label=d.title()),n.input.dimensionScheme&&(p.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===c.type&&(p.auxiliary=c),Km(p,u(t,n,c,d,{byRow:Ym,byElemNo:Gm})),p}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!s||!s.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:r.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=Zp(0,{hc:i,theme:o},n,{f:s});return l.invalid||(l.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,r);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&i.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],u=[];"measure"===n.input.useBaseColors&&i.qMeasureInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?u.push(r.primary):u.push(i)}}));var c=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,d=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&d&&(c={categorical:d.key}),{mode:"measure",type:"categorical",palettes:c,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:u}:void 0}}if("dimension"===s){var f=[],m=[];return i.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){f.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?m.push(r.primary):m.push(i)}})),{mode:"dimension",type:"categorical",field:f.length?f[0]:void 0,explicit:f.length?{domain:f,range:m}:void 0}}var p=r.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(p=e.resolveUIColor(n.input.paletteColor));else{var h=n.input.singleColor;"number"!=typeof h||Number.isNaN(h)||(p=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][h])}return{mode:"constant",type:"constant",primary:p}}(e,n,t,r)}return{}}(e,t,n,r);return null!==(i=t.input)&&void 0!==i&&i.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map((function(n,i){return eh({cm:e,input:n,defaults:r,index:i,pic:t.pic})})),function(e,t){var n,r,i,o=t.translator;if(th(e),1===(null===(n=e.measureOverrides)||void 0===n?void 0:n.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=nh(e.measureOverrides,e.explicit),th(e)),null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=nh(e.measureOverrides),a}return null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}function ih(e){var t=km({hc:null,colorProps:null,layout:null,theme:null},e),n={},r={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},i={auto:function(e){return e?(r.auto=e,i):r.auto},getDimensionColorMap:function(e){return e?(r.getDimensionColorMap=e,i):r.getDimensionColorMap},getAttributeDimension:function(e){return e?(r.getAttributeDimension=e,i):r.getAttributeDimension},getMeasure:function(e){return e?(r.getMeasure=e,i):r.getMeasure},set:function(e){var i;if(!e.colorProps)throw new Error('Missing "colorProps"');if(Km(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=r.auto(e.layout);n.input=Km(!0,{},n.input,o,{auto:!1});var a=t.theme?t.theme.getDataColorPalettes():[];a[0]&&(n.input.dimensionScheme=a[0].key);var s=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(s=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[s]&&t.hc.qDimensionInfo[s].coloring&&t.hc.qDimensionInfo[s].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(i=n.input.measureOverrides)&&void 0!==i&&i.every((function(e){return!e||!e.on}))&&(n.input=Km(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,r=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){r.push({key:"ui",colors:e.colors})})),n.palettes=r}return n.palettes},getAuxiliaryData:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var i=(e.auxiliary||{}).key;if("measure"===e.fieldType)return r.getMeasure(i,t).catch((function(){}));if("dimension"===e.fieldType){var o="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?r.getAttributeDimension(o,t).catch((function(){})):Promise.resolve(),i?r.getDimensionColorMap(i,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,r){var i=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,r).then((function(r){if(!r)return{};if("measure"===e.fieldType){if(r.coloring&&r.coloring.gradient){var o=n.pic.field(e.field);return Xp(i,r.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var a={nil:e.nil,others:e.others},s=r[0],l=r[1]?r[1].colorMap:null;if(s){var u=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:s,qInterColumnSortOrder:[0,1],qMode:"S"}});a.legendDataset=u}return l?function(e,t,n,r){var i=r.external,o=r.field,a=km({},e);Km(a,Gm(o,o.raw().qCardinal));var s=i.theme?i.theme.getDataColorPalettes()[0]:null;return t.nul&&(a.nil=n.resolveUIColor(t.nul)),t.oth&&(a.others=n.resolveUIColor(t.oth)),t.usePal?(a.palettes={categorical:t.pal},s&&!t.pal&&(a.palettes.categorical=s.key,Km(a,Gm(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),Km(a,Gm(o))),t.colors&&t.colors.length&&(a.explicit=function(e,t,n){for(var r={},i=0;i<e.length;i+=1)r[e[i].value]=e[i].baseColor;var o=[];return{domain:function(e){var i=e.data,a=[];o=[];for(var s=0;s<i.items.length;s++){var l=i.items[s],u=(l.text||l).label;r[u]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(t.resolveUIColor(r[u])))}return a.push(-3,-2),o.push(n.others),o.push(n.nil),a},range:function(){return o}}}(t.colors,n,a)),a}(a,l,i,{external:t,field:n.pic.field(e.field)}):a}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!n.uiPalette)return e.color;var t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},r=t.theme;r&&(e=km(km({},e),r.getDataColorSpecials())),n.settings=Km(e,rh(this,n,t,e))}return n.settings}};return i}var oh=function(e,t){var n=e.fieldType,r={};if(t)if("measure"===n){var i=t.coloring;i&&(r.measureGradient=i.gradient)}else if("dimension"===n){var o=t[0],a=t[1];o&&(r.legendDataPage=o),a&&(r.dimValsData=a.colorMap)}return r},ah=function(e){throw e.isHandled=!0,e},sh=function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():r&&r.getObject?r.getObject("ColorMapModel_".concat(e)).then((function(e){return e.getLayout()})):Promise.reject()},lh=function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():r&&r.getMeasure?r.getMeasure(e).then((function(e){return e.getMeasure()})):Promise.reject()},uh=function(e,t){var n=t.layout,r=t.model,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():r&&r.session&&i?r.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(ah):Promise.reject()};function ch(e){return function(t){return"object"===Lm(t.datum[e])?t.datum[e].value:void 0}}function dh(e){return"object"===Lm(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function fh(e){return-3===e.datum.value}var mh={TITLE:{COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},LABEL:{COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"}};function ph(e){var t=e.theme,n=e.key,r=e.styleOverrides,i={title:{color:mh.TITLE.COLOR,fontSize:mh.TITLE.FONT_SIZE,fontFamily:mh.TITLE.FONT_FAMILY},label:{color:mh.LABEL.COLOR,fontSize:mh.LABEL.FONT_SIZE,fontFamily:mh.LABEL.FONT_FAMILY}};if(!t&&!r)return i;var o=r||{},a=o.title,s=o.label,l=function(e){var t=e.theme,n=e.key;return function(e,r,i,o){return void 0!==e?e:t?t.getStyle(n,r,i):o}}({theme:t,key:n});return i.title.color=l(null==a?void 0:a.color,"legend.title","color",mh.TITLE.COLOR),i.title.fontSize=l(null==a?void 0:a.fontSize,"legend.title","fontSize",mh.TITLE.FONT_SIZE),i.title.fontFamily=l(null==a?void 0:a.fontFamily,"legend.title","fontFamily",mh.TITLE.FONT_FAMILY),i.label.color=l(null==s?void 0:s.color,"legend.label","color",mh.LABEL.COLOR),i.label.fontSize=l(null==s?void 0:s.fontSize,"legend.label","fontSize",mh.LABEL.FONT_SIZE),i.label.fontFamily=l(null==s?void 0:s.fontFamily,"legend.label","fontFamily",mh.LABEL.FONT_FAMILY),i}var hh=function(e,t,n){var r=e&&e.dock||void 0;if("auto"!==r)return r||"right";if(t){var i=t.element.getBoundingClientRect();if(i.height>i.width)return"bottom"}return n?"left":"right"},gh=function(e,t,n){return!(n.invalid||"color"===n.type||"measure"===n.mode&&t.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function yh(e,t){var n=e.styleReference,r=e.styleOverrides,i=e.chart,o=e.rtl,a=t.legendProps,s=t.coloring,l=t.theme,u=t.hc,c=ph({theme:l,key:n,styleOverrides:r});return{layout:{minimumLayoutMode:"MEDIUM",dock:hh(a,i,o)},show:"function"==typeof a.show?function(){return gh(a,u,s)}:gh(a,u,s),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==a.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:s.label||"",fill:c.title.color,fontSize:c.title.fontSize,fontFamily:c.title.fontFamily}}}}function vh(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var r=yh(e,t);if(!r.show)return!1;var i,o=e.key,a=e.styleReference,s=e.styleOverrides,l=e.viewState,u=e.rtl,c=e.settings,d=e.style,f=t.scaleKey,m=t.theme,p=t.scales,h=ph({theme:m,key:a,styleOverrides:s}),g=r.layout.dock,y="left"===g||"right"===g?{maxLines:2,wordBreak:"break-word"}:{},v={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===t.coloring.fieldType&&(i=function(e){return e.datum.value>=0||-3===e.datum.value});var b="".concat(f,"Legend");return Km(!0,r,{type:"legend-cat",key:"".concat(o,"-cat"),scale:b in p?b:f,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(r.layout.dock)?2:1,direction:u?"rtl":"ltr",horizontal:20},item:{show:i,label:km({fill:h.label.color,fontSize:h.label.fontSize,fontFamily:h.label.fontFamily},y)},navigation:{disabled:n,button:{content:function(e,t){var n=t.direction;return e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:v[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:c,style:d})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,r=e.key,i=e.styleReference,o=e.styleOverrides,a=e.rtl,s=e.settings,l=e.style,u=t.scaleKey,c=t.theme,d="".concat(u,"Range"),f=yh(e,t);if(!f.show)return!1;var m=ph({theme:c,key:i,styleOverrides:o}),p=f.layout.dock,h="right"===p||"left"===p,g=null===(n=t.scales)||void 0===n?void 0:n[d];return h&&g&&(g.invert=!0),Km(!0,f,{type:"legend-seq",key:"".concat(r,"-seq"),settings:{fill:u,major:d,length:1,tick:{fill:m.label.color,fontSize:m.label.fontSize,fontFamily:m.label.fontFamily},title:{anchor:!a||"top"!==f.layout.dock&&"bottom"!==f.layout.dock?void 0:"right",padding:parseFloat(f.settings.title.fontSize)||16}}},{settings:s,style:l})}(e,t)}function bh(e,t,n){var r=[],i=[],o=vh(e,t,n&&n.navigationDisabled);return r.push(o),o&&"legend-cat"===o.type&&(i.push(function(e){var t=e.key,n=e.requireFailure,r=e.recognizeWith,i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var r;if(!n)return!0;if(null!=i&&null!==(r=i.interact)&&void 0!==r&&r.enabled&&!i.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),i.push(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.eventName,r=t.key,i=t.requireFailure,o=t.recognizeWith,a=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(r),type:"Pan",requireFailure:i,recognizeWith:o,options:{event:n,pointers:1,threshold:10,enable:function(e,t){var i;return this.started===n||!t||!(null!=a&&null!==(i=a.interact)&&void 0!==i&&i.enabled&&!a.interact.enabled())&&this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}).some((function(e){return e.key==="".concat(r,"-cat")}))}},events:(e={},Om(e,"".concat(n,"start"),(function(e){e.preventDefault(),this.started!==n&&(this.started=n,this.chart.component("".concat(r,"-cat")).emit("panstart",e))})),Om(e,"".concat(n,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panmove",e)})),Om(e,"".concat(n,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panend",e),this.started=!1})),e)}}(e,n))),{interactions:i,components:r}}var xh=function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")};function qh(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=ih(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(e,t){var n=t.layout,r=t.app;return sh(e,{layout:n,app:r})})).getMeasure((function(e,t){var n=t.layout,r=t.app;return lh(e,{layout:n,app:r})})).getAttributeDimension((function(e,t){var n=t.layout,r=t.model,i=t.app;return uh(e,{layout:n,model:r,app:i})}));return n.getSnapshotData=oh,n}({resources:e}),n={},r={},i=function(e){return r.settings||(e||console.warn("settings() called before auxiliarySettings()"),r.settings=t.settings()),r.settings},o={config:function(i){if(n=km({},i),r={},!n.key)throw new Error("Missing key");t.set(km(km({},e),n))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return r.auxiliarySettings?Promise.resolve(r.auxiliarySettings):t.getAuxiliarySettings(i(!0),e).then((function(e){return r.auxiliarySettings=e||{},r.settings=km(km({},r.settings),r.auxiliarySettings),r.scales=void 0,r.color=void 0,r.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(i())},getSnapshotData:function(e){var n=i();return t.getAuxiliaryData(n,e).then((function(e){return t.getSnapshotData(n,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=i();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=i().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(i(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,r=e.theme,i=[];if(n&&n.palettes&&r){var o=n.palettes.categorical||t.dimensionScheme,a=r.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||r.getDataColorPalettes()[0];o&&a&&i.push({key:"categorical",colors:a.colors});var s=n.palettes.metric||t.measureScheme,l=r.getDataColorScales().filter((function(e){return e.key===s}))[0];if(l){var u=l.colors[0]?l.colors:[[]].concat(Rm(l.colors.slice(1)));u=Array.isArray(u[0])?u.map((function(e){return e.slice().reverse()})):u.slice().reverse(),i.push({key:"quant",colors:u})}}return i}({coloring:i(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return r.scales=r.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,r=e.rtl,i=e.key,o=e.source,a=e.picasso,s={},l=i;if(n){var u={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(Rm((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(Rm((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var c,d=function(e){var t=e.hc,n=e.source,r=e.coloring,i={data:{extract:[{source:"dummy",field:0,filter:function(){return i.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:r.field,trackBy:r.valueAccessor,reduce:"first",props:{row:{reduce:function(){return i.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return i}({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var f=0,m={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return m[t]=f++,e[0]}}),c={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return m[e.qElemNumber]}}}}}}var p={data:d,range:n.range,domain:n.domain,explicit:u,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};s[l]=p,c&&(s["".concat(l,"Legend")]=km(km({},p),{},{data:c})),t&&t.qHasOtherValues&&c&&((c||p.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var h={data:{field:n.field},min:n.min,max:n.max};s[l]=Km({},h,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=Km({},h,{invert:!!r}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var g={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=g}else if("measure"===n.mode){var y={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(t=t.exclude)&&void 0!==t&&t.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=y}}return s}({hc:n.hc,coloring:i(),key:n.key,source:n.source,picasso:e.picasso}),r.scales},color:function(){return r.color=r.color||function(e){var t=e.coloring,n=e.scales,r=e.key,i=ch(r),o=ch("".concat(r,"IsAnOther")),a=function(e,t){var r=e.fieldType,a=e.invalid,s=e.mode,l=e.nil,u=e.others,c=e.primary,d=e.type;return a?function(e){return fh(e)||o(e)?u:l}:n[t]?function(e){return fh(e)?u:dh(e)||-2===i(e)&&"dimension"===r||"NaN"===i(e)?l:o(e)?u:e.resources.scale(t)(i(e))||u}:"constant"===s?function(e){return fh(e)||o(e)?u:dh(e)?l:c}:"color"===d?function(e){return fh(e)||o(e)?u:dh(e)?l:i(e)||u}:null},s=a(t,r);if(t.measureOverrides){var l=ch("".concat(r,"MeasureIdx")),u=t.measureOverrides.map((function(e){return e&&a(e)}));return function(e){var t=l(e);return u[t]?u[t](e):s(e)}}return s}({coloring:i(),scales:this.scales(),key:n.key}),r.color},datumProps:function(e){return function(e){var t,n,r=e.hc,i=e.coloring,o=e.scales,a=e.key,s=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=a,c=i.nil;"field"===i.mode&&i.field?t=i.field:o[a]&&"field"===i.mode&&(t=o[a].data.field||i.field),t?(n={field:t,reduce:"first"},"color"===i.type&&(n.value=function(e){return"NaN"!==e.qNum?xh(e.qNum):e.qText&&gp(e.qText)?e.qText:c})):"dimension"===i.mode?n=void 0!==i.field?i.field:r.qDimensionInfo.length-1:"measure"===i.mode&&(n=l);var d=Om({},u,n);return r.qDimensionInfo.length>1&&(d["".concat(u,"IsAnOther")]={fields:r.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),s&&(d["".concat(u,"MeasureIdx")]=l),d}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:i().measureOverrides},e)},data:function(){var e=i(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,r=e.key,o=e.viewState,a=e.chart,s=e.rtl,l=e.styleReference,u=void 0===l?"object.legend":l,c=e.styleOverrides,d=e.settings,f=void 0===d?{}:d,m=e.style,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return bh({eventName:t,key:r,rtl:s,viewState:o,chart:a,styleReference:u,styleOverrides:c,settings:f,style:void 0===m?{}:m},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},p)}};return o}var Mh=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Sh(e){var t=e.qHyperCube,n=t.qDimensionInfo,r=t.qMeasureInfo,i=n.some(Mh),o=r.some(Mh),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!i?"off":a}function wh(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return km(km(km({},e),t),{},{colorProps:km(km({},e.colorProps),t.colorProps||{})})}var Dh=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Ch(e){var t,n=e.qHyperCube.qDimensionInfo.some(Dh),r=e.qHyperCube.qMeasureInfo.some(Dh),i=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=i?i:r?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var Nh=function(){};function kh(e){var t,n,r,i,o=e.picasso,a=e.model,s=e.app,l=e.translator,u=e.layoutService,c=void 0===u?void 0:u,d=e.createConfig,f=void 0===d?Nh:d,m=e.config,p=void 0===m?{}:m,h=e.custom,g=void 0===h?{}:h,y=p.localeInfo,v=p.key,b=p.theme,x=void 0===b?void 0:b,q=p.auto,M=void 0===q?void 0:q,S=p.definitionPath,w=null==c||null===(t=c.getLayout)||void 0===t?void 0:t.call(c),D={theme:x,key:v,localeInfo:y,layout:w,hc:null==c||null===(n=c.getHyperCube)||void 0===n?void 0:n.call(c),legendProps:null==c||null===(r=c.getLayoutValue)||void 0===r?void 0:r.call(c,"legend"),colorProps:km(km({},null==c||null===(i=c.getLayoutValue)||void 0===i?void 0:i.call(c,"color")),{},{useBaseColors:w?Sh(w):void 0})},C=qh({picasso:o,model:a,app:s,translator:l,auto:M});!1!==M&&C.auto((function(e){return M?M({layout:e,defaultAuto:Ch}):Ch(e)}));var N=!1,k={getColor:function(){return C.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return C.resolveUIColor({index:t,color:n})},getData:function(){return C.data()},getDatumProps:function(e){return C.datumProps(e)},getSnapshotData:function(){return C.getSnapshotData(S)},getSettingsForMeasure:function(e){return C.settingsForMeasure(e)},getSettings:function(){return C.settings()},getLegend:function(e,t){return C.legend(e,t)},getScales:function(){return C.scales()},getPalettes:function(){return C.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return C.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return N},custom:km({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?f:e)({getUseBaseColors:Sh}),n=wh(D,t);return C.config(n),C.getAuxiliarySettings(S).then((function(){N=!0}))}};return k}function Ah(e){var t=e.chart,n=e.logicalSize;if(n)return n;var r=t?t.element.getBoundingClientRect():{};return{width:r.width,height:r.height}}var Lh=[{key:"FULL",size:{width:550,height:450}},{key:"MEDIUM",size:{width:400,height:220}},{key:"SMALL",size:{width:300,height:150}},{key:"XSMALL",size:{width:150,height:75}}];function Eh(e){var t=e.width,n=e.height,r=Lh.filter((function(e){return t>=e.size.width&&n>=e.size.height})).shift();return r?r.key:"SPARK"}var Th={left:"right",right:"left",top:"bottom",bottom:"top",near:"far",far:"near"};function Oh(e){var t=e.orientation,n=e.dock,r=e.btt,i=e.rtl,o="horizontal"===t?function(e){return"bottom"===e||"near"===e?"bottom":"top"}(n):function(e,t){var n="left"===e||"near"===e?"left":"right";return t?Th[n]:n}(n,i),a=function(e,t,n){return"vertical"===e?t?"bottom":"top":n?"right":"left"}(t,r,i);return{current:o,opposite:Th[o],start:a,end:Th[a]}}function Ih(e){var t=e.chart,n=e.layoutService,r=e.config,i=void 0===r?{}:r,o=i.logicalSize,a=void 0!==o&&o,s=i.rtl,l=void 0!==s&&s,u={chart:{size:void 0,mode:void 0},x:{dock:void 0,opposite:void 0,size:void 0},y:{dock:void 0,opposite:void 0,size:void 0}},c={type:"x-y",config:km({},i),meta:u,update:function(e){u.chart.size={width:e.width,height:e.height},u.chart.mode=Eh(e);var t=Oh({orientation:"horizontal",dock:n.getLayoutValue("xAxis.dock"),btt:!1,rtl:l}),r=t.current,i=t.opposite;u.x.dock=r,u.x.opposite=i,u.x.size=e.width;var o=Oh({orientation:"vertical",dock:n.getLayoutValue("yAxis.dock"),btt:!0,rtl:l}),a=o.current,s=o.opposite;u.y.dock=a,u.y.opposite=s,u.y.size=e.height}};return c.update(Ah({chart:t,logicalSize:a})),c}var Ph="vertical",Rh="horizontal";function Fh(e){var t=e.chart,n=e.layoutService,r=e.config,i=void 0===r?{}:r,o=e.typeConfig,a=void 0===o?{}:o,s=i.logicalSize,l=void 0!==s&&s,u=i.rtl,c=void 0!==u&&u,d=a.fallback===Ph?Ph:Rh,f=!!a.invert,m=a.measureAxes||[{ref:"measureAxis",name:"minor"}],p={chart:{orientation:void 0,size:void 0,mode:void 0},major:{orientation:void 0,dock:void 0,opposite:void 0,size:void 0}},h={type:"major-minor",config:km({},i),meta:p,update:function(e){p.chart.orientation=n.getLayoutValue("orientation",d),p.chart.size={width:e.width,height:e.height},p.chart.mode=Eh(e),p.major.orientation=function(e){var t=e.chartOrientation,n=e.invert;return e.layoutService.meta.isContinuous?Rh:n?t===Ph?Rh:Ph:t}({layoutService:n,chartOrientation:p.chart.orientation,invert:f});var t=Oh({orientation:p.major.orientation,dock:n.getLayoutValue("dimensionAxis.dock"),btt:!1,rtl:c}),r=t.current,i=t.opposite;p.major.dock=r,p.major.opposite=i,p.major.size=p.major.orientation===Ph?e.height:e.width,m.forEach((function(t){var r={};r.orientation=p.major.orientation===Ph?Rh:Ph;var i=Oh({orientation:r.orientation,dock:n.getLayoutValue("".concat(t.ref,".dock")),btt:!0,rtl:c}),o=i.current,a=i.opposite,s=i.start,l=i.end;r.dock=o,r.opposite=a,r.start=s,r.end=l,r.size=r.orientation===Ph?e.height:e.width,p[t.name]=r}))}};return h.update(Ah({chart:t,logicalSize:l})),h}function jh(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}var Hh=["__proto__","constructor"];function zh(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!Hh.some((function(e){return r.includes(e)}))){for(var o=e,a=0;a<r.length-1;++a){var s=r[a];void 0===o[s]&&(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}}}function Bh(){var e={};return{get:function(t){return e[t]},set:function(t,n){return e[t]=n,n},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}function _h(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return function(){for(var r=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];clearTimeout(t),t=setTimeout((function(){return e.apply(r,o)}),n)}}var Vh={ERROR_CODES:[7005],DIMENSION:"qDimensionInfo",MEASURE:"qMeasureInfo"},$h=function(e,t){return e[t].reduce((function(e,t,n){var r;return r=t,Vh.ERROR_CODES.some((function(e){var t;return e===(null===(t=r.qError)||void 0===t?void 0:t.qErrorCode)}))?e.filtered.push(n):e.reduced.push(t),e}),{reduced:[],filtered:[]})};function Uh(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[]).map((function(e){var t,n=null===(t=e.qCardinalities)||void 0===t?void 0:t.qHypercubeCardinal;if(n)return n;var r=e.qStateCounts||{},i=r.qLocked,o=void 0===i?0:i,a=r.qOption,s=void 0===a?0:a,l=r.qSelected;return o+s+(void 0===l?0:l)}))}function Wh(e){switch(e.qHyperCube.qMode){case"S":return function(e){var t=e.qHyperCube.qSize;return{refs:{dataPages:"qHyperCube.qDataPages"},size:{x:t.qcx,y:t.qcy,dimensions:Uh(e)}}}(e);case"K":return function(e){var t=Uh(e);return{refs:{dataPages:"qHyperCube.qStackedDataPages"},size:{x:e.qHyperCube.qSize.qcx,y:t[0],dimensions:t}}}(e);case"T":return function(e){var t=Uh(e);return{refs:{dataPages:"qHyperCube.qTreeDataPages"},size:{x:e.qHyperCube.qSize.qcx,y:t[0],dimensions:t}}}(e);default:throw new Error("Mode not supported")}}function Kh(e){var t=e.source,n=e.metaAdditionsFn,r=e.experimental,i=void 0===r?{filter:!1}:r,o=Km(!0,{},t),a=i.filter?function(e){var t=e.qHyperCube,n=$h(t,Vh.DIMENSION),r=n.reduced,i=n.filtered;t[Vh.DIMENSION]=r;var o=$h(t,Vh.MEASURE),a=o.reduced,s=o.filtered;return t[Vh.MEASURE]=a,{dimensions:i,measures:s}}(o):{dimensions:[],measures:[]},s=Wh(o),l=function(){var e=function(e){var t=e.layout,n=e.additionsFn,r=void 0===n?function(){return{}}:n,i=e.additionsProps,o=void 0===i?{}:i,a=t.qHyperCube,s=a.qDimensionInfo,l=a.qMeasureInfo,u=a.qMode,c=s.length,d=l.length,f=km({mode:{S:"S"===u,P:"P"===u,K:"K"===u,T:"T"===u},dimensionCount:c,measureCount:d,hasMultipleDimensions:c>1,hasMultipleMeasures:d>1,isOneDimensional:1===c,isTwoDimensional:2===c},o);return km(km({},f),r({layout:t,meta:f}))}({layout:o,additionsFn:n,additionsProps:{size:s.size}});return e.filteredFields=a,e},u={refs:km({},s.refs),meta:l(),getLayout:function(){return o},getLayoutValue:function(e,t){return jh(o,e,t)},setLayoutValue:function(e,t){zh(o,e,t),s=Wh(o),u.meta=l()},getHyperCube:function(){return o.qHyperCube},getHyperCubeValue:function(e,t){return jh(o.qHyperCube,e,t)},setHyperCubeValue:function(e,t){zh(o.qHyperCube,e,t),s=Wh(o),u.meta=l()},getDataPages:function(){return jh(o,s.refs.dataPages)},setDataPages:function(e){zh(o,s.refs.dataPages,e),u.meta=l()}};return u}function Gh(e){var t=e.originalArray,n=e.newArray,r=e.matchKey;return Array.isArray(t)&&t.length?(n.forEach((function(e){var n=-1;t.some((function(t,i){return t[r]&&t[r]===e[r]&&(n=i),n})),n>-1?t[n]=e:t.push(e)})),t):n}function Yh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yh(Object(n),!0).forEach((function(t){Jh(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yh(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Jh(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Zh=Object.prototype.hasOwnProperty,Qh=Object.prototype.toString,eg=Object.defineProperty,tg=Object.getOwnPropertyDescriptor,ng=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Qh.call(e)},rg=function(e){if(!e||"[object Object]"!==Qh.call(e))return!1;var t,n=Zh.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Zh.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Zh.call(e,t)},ig=function(e,t){eg&&"__proto__"===t.name?eg(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},og=function(e,t){if("__proto__"===t){if(!Zh.call(e,t))return;if(tg)return tg(e,t).value}return e[t]},ag=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=og(s,n),s!==(i=og(t,n))&&(c&&i&&(rg(i)||(o=ng(i)))?(o?(o=!1,a=r&&ng(r)?r:[]):a=r&&rg(r)?r:{},ig(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&ig(s,{name:n,newValue:i}));return s};function sg(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=i.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),s=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(r)&&r.some(((e,t)=>e!==t))){const e=r.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:l>=0?e=>e[a].qAttrDims.qValues[l]:s>=0?e=>e[a].qAttrExps.qValues[s]:e=>e[a]}function lg(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function ug(e){let{cache:t,f:n,mainCell:r,p:i,prop:o,page:a,rowIdx:s,row:l,sourceKey:u,target:c,targetProp:d,columnOrder:f}=e,m=r;if(i.field&&i.field!==n){const e=sg(i.field,a,{cache:t},f);if(-1===e)return;m=ag({qRow:s},e(l))}c[d]=lg(i,m,{key:u})}function cg(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const a=t.raw(),s=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:u,main:c}=r.normalizeConfig(i[e],t),d=Object.keys(u),f=!!i[e].trackBy,m=typeof i[e].trackBy,p={},h=[],g=[];for(let t=0;t<a.qDataPages.length;t++){const o=sg(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let y=0;y<a.qDataPages[t].qMatrix.length;y++){const v=a.qDataPages[t].qArea.qTop+y,b=ag({qRow:v},o(a.qDataPages[t].qMatrix[y])),x=lg(c,b,{key:s});if(!c.filter||c.filter(b)){for(let e=0;e<d.length;e++){const r=u[d[e]];let i=r.fields||[r];r.fields&&(x[d[e]]=[]);for(let o=0;o<i.length;o++)ug({cache:n,f:l,mainCell:b,p:i[o],prop:d[e],props:u,page:a.qDataPages[t],rowIdx:v,row:a.qDataPages[t].qMatrix[y],sourceKey:s,target:r.fields?x[d[e]]:x,targetProp:r.fields?o:d[e],columnOrder:a.qColumnOrder});if(r.fields){const t=x[d[e]].map((e=>e.value)),n=x[d[e]].map((e=>e.label));x[d[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[d[e]].value)}}}f&&r.track({cfg:i[e],itemData:b,obj:x,target:h,tracker:p,trackType:m}),g.push(x)}}}const y=f?r.collect(h,{main:c,propsArr:d,props:u}):g;o=[...o,...y]}return o}function dg(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function fg(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=pg)):void 0===t&&(t=mg);for(var n,r,i,o,a,s=new yg(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new yg(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(gg)}function mg(e){return e.children}function pg(e){return Array.isArray(e)?e[1]:null}function hg(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function gg(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function yg(e){this.data=e,this.depth=this.height=0,this.parent=null}function vg(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}yg.prototype=fg.prototype={constructor:yg,count:function(){return this.eachAfter(dg)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(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}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(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}(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},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return fg(this).eachBefore(hg)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}};var bg={depth:-1},xg={},qg={};function Mg(e){return e.id}function Sg(e){return e.parentId}function wg(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Dg(e,t););return e.slice(0,t)}function Dg(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(0==(1&n))return!0}return!1}function Cg(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=Cg(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=Cg(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function Ng(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...Ng(e[i].children,t-1,n)]);return r}function kg(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const r=Math.max(0,Math.min(100,t-e));return e=>Ng(e.children,r-1,n)}return!1}const Ag=/^qDimensionInfo(?:\/(\d+))?/,Lg=/^\/?qMeasureInfo\/(\d+)/,Eg=/\/qAttrExprInfo\/(\d+)/,Tg=/\/qAttrDimInfo\/(\d+)/;function Og(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function Ig(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,u=-1,c=-1,d=r;const f=n.qEffectiveInterColumnSortOrder,m=Og(n);return Ag.test(d)&&(i=!0,o=+Ag.exec(d)[1],d=r.replace(Ag,"")),Lg.test(d)&&("K"===n.qMode?u=+Lg.exec(d)[1]:f&&-1!==f.indexOf(-1)?(u=+Lg.exec(d)[1],c=0):c=+Lg.exec(d)[1],d=d.replace(Lg,"")),d&&(Tg.exec(d)?s=+Tg.exec(d)[1]:Eg.exec(d)&&(a=+Eg.exec(d)[1])),l=i?"S"===n.qMode?m[o]:f?f.indexOf(o):o:f&&-1!==f.indexOf(-1)?f.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:u,measureIdx:c,attrDimIdx:s,attrIdx:a}}function Pg(e,t){let n,r,i=kg(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function Rg(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function Fg(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let u,c;s.fields&&(u=[],c=[]);for(let n=0;n<l.length;n++){const d=l[n];let f,m,p,h,g,y;if("primitive"===d.type?(p=d.value,y=String(d.value)):("function"==typeof d.value&&(f=e=>d.value(e,r)),"function"==typeof d.label&&(m=e=>d.label(e,r)),d.accessor?(h=d.accessor(r),Array.isArray(h)?(g=h.map(d.valueAccessor),d.attrAccessor&&(g=g.map(d.attrAccessor)),f&&(p=g.map(f),f=null),m&&(y=g.map(m),m=null),p=d.reduce?d.reduce(p):p,y=d.reduceLabel?d.reduceLabel(y,p):String(p)):(p=d.attrAccessor?d.attrAccessor(d.valueAccessor(h)):d.valueAccessor(h),y=p)):(p=i,y=i)),s.fields){const e=f?f(p):p;u.push(e),c.push(m&&null!=y?m(y):null!=y?y:String(e))}else{const n=f?f(p):p;o[t[e]]={value:n,label:m?m(y):null!=y?y:String(n)},d.field&&(o[t[e]].source={field:d.field.key(),key:a})}}u&&(o[t[e]]={value:"function"==typeof s.value?s.value(u,r):u,label:"function"==typeof s.label?s.label(c,r):c})}}const jg=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=Cg(r,e);return o&&o[0]?(t.tree=fg(o[0],n.children||(e=>e[i])),t.tree):null};function Hg(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}(e),r=e.fields(),i=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),o=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let r="__root",l=!1;for(let e=0;e<i.length;e++){var s;const t=n[i[e]],o="".concat(r,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=Xh({__id:o,__parent:r,qValues:[]},t),l=!0),r=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[r].qValues.push(t)}}const l=Object.keys(a).map((e=>a[e]));return function(){var e,t=Mg,n=Sg;function r(r){var i,o,a,s,l,u,c,d,f=Array.from(r),m=t,p=n,h=new Map;if(null!=e){const t=f.map(((t,n)=>function(e){let t=(e=`${e}`).length;return Dg(e,t-1)&&!Dg(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r)))),n=t.map(wg),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(wg(e)),f.push(qg));m=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,i=f.length;a<i;++a)o=f[a],u=f[a]=new yg(o),null!=(c=m(o,a,r))&&(c+="")&&(d=u.id=c,h.set(d,h.has(d)?xg:u)),null!=(c=p(o,a,r))&&(c+="")&&(u.parent=c);for(a=0;a<i;++a)if(c=(u=f[a]).parent){if(!(l=h.get(c)))throw new Error("missing: "+c);if(l===xg)throw new Error("ambiguous: "+c);l.children?l.children.push(u):l.children=[u],u.parent=l}else{if(s)throw new Error("multiple roots");s=u}if(!s)throw new Error("no root");if(null!=e){for(;s.data===qg&&1===s.children.length;)s=s.children[0],--i;for(let e=f.length-1;e>=0&&(u=f[e]).data===qg;--e)u.data=null}if(s.parent=bg,s.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(gg),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=vg(e),r):t},r.parentId=function(e){return arguments.length?(n=vg(e),r):n},r.path=function(t){return arguments.length?(e=vg(t),r):e},r}().id((e=>e.__id)).parentId((e=>e.__parent))(l)}const zg=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields?s.fields:[s];for(let e=0;e<l.length;e++){const t=l[e];if(t.field!==a){const e=Pg(o,Ig(t.field,{cube:r,cache:i}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function Bg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const i=t.raw(),o=t.key(),a="S"===i.qMode?Hg(t):jg(i,n,e);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===i.qMode){let e=Og(i)[o-1];a=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),a=n.fields[e]}const{props:s,main:u}=r.normalizeConfig(Xh(Xh({},e),{},{field:a?a.key():void 0}),t),c=Object.keys(s);l[o]={propsArr:c,props:s,main:u};const d=a?Ig(a,{cube:i,cache:n}):{fieldDepth:0};zg({propsArr:c,props:s,cube:i,cache:n,itemDepthObject:d,f:a})}const u=a.copy().descendants(),c=a.descendants();for(let e=0;e<c.length;e++){const t=l[c[e].depth].propsArr,n=l[c[e].depth].props,r=l[c[e].depth].main,i=u[e],a=i.data,s=Rg(r,a,{key:o});Fg({propsArr:t,props:n,item:i,itemData:a,ret:s,sourceKey:o,isTree:!0}),c[e].data=s}return a}function _g(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<i.length;a++)if(void 0!==i[a].field){const s=t.raw(),l=t.key();if(!jg(s,n,e))continue;const u="object"==typeof i[a].field?i[a].field:t.field(i[a].field),{props:c,main:d}=r.normalizeConfig(i[a],t),f=Object.keys(c),m=Ig(u,{cube:s,cache:n}),{nodeFn:p,attrFn:h,valueFn:g}=Pg({fieldDepth:0},m);zg({propsArr:f,props:c,cube:s,cache:n,itemDepthObject:m,f:u});const y=!!i[a].trackBy,v=typeof i[a].trackBy,b={},x=[],q=p(n.tree),M=[];for(let e=0;e<q.length;e++){const t=q[e],n=h?h(g(t)):g(t);if(d.filter&&!d.filter(n))continue;const o=Rg(d,n,{key:l});Fg({propsArr:f,props:c,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[a],itemData:n,obj:o,target:x,tracker:b,trackType:v}),M.push(o)}const S=y?r.collect(x,{main:d,propsArr:f,props:c}):M;o=[...o,...S]}return o}var Vg,$g,Ug=(Vg=function(e){
12
- /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
13
- e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,d,f=e.length,m=e.search(/[0-9\-\+#]/),p=m>0?e.substring(0,m):"",h=e.split("").reverse().join(""),g=h.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(m,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",y=(d=t[0]).length%l,f=d.length,b=0;b<f;b++)h+=d.charAt(b),!((b-y+1)%l)&&b<f-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},Vg($g={exports:{}}),$g.exports);function Wg(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const Kg={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},Gg=/%\)?$/,Yg=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Xg=/^\(oct\)/i,Jg=/^\(dec\)/i,Zg=/^\(hex\)/i,Qg=/^\(bin\)/i,ey=/^\(rom\)/i,ty=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,ny=/#|0/g;function ry(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function iy(e,t,n){const r=Wg(e);return n?r:new RegExp(r||"",t)}function oy(e,t,n,r){let i,o,a,s,l,u,c,d,f,m=e.pattern;var p,h;r&&(e.abbreviate=!0),p=t,(h=n)&&(h=Wg(h)),p&&(p=Wg(p)),f=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(h,"[#0]+)?")),a=m.match(f),a=a?a[0]:"",s=a?m.substr(0,m.indexOf(a)):m,l=a?m.substring(m.indexOf(a)+a.length):"",a||(a=m?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),u=t,t=/,/.test(n)?"¤":",",u&&(a=a.replace(iy(u,"g"),t)),c=n,n=".",c&&(a=a.replace(iy(c,"g"),n)),d=a.match(/#/g),d=d?d.length:0;const g=m.split(c);let y;g[1]&&(y=g[1].match(ny)),e.prefix=s||"",e.postfix=l||"",e.pattern=m,e.maxPrecision=y?y.length:2,e.percentage=Gg.test(m),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(iy(t,null,!0),"|").concat(iy(n,null,!0)),"g"),e.groupTemp=u,e.decTemp=c,e.t=t,e.d=n,e.temp=d}class ay{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return Kg;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new ay(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],ty.test(e[0])&&(r.positive.isFunctional=!0),e[1]?ty.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?ty.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||oy(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&oy(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&oy(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,u,c=this._prepared,d="",f="",m=e;if(isNaN(e))return"".concat(m);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return c=c.zero,c.pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=function(e,t,n){let r;return Yg.test(t)?e=ry(e,Number(/\d{2}/.exec(t)[0]),t,n):Xg.test(t)?e=ry(e,8,t,n):Jg.test(t)?e=ry(e,10,t,n):Zg.test(t)?e=ry(e,16,t,n):Qg.test(t)?e=ry(e,2,t,n):ey.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=c.maxPrecision?i=o:r<=n&&!(o>0&&-n<=c.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=c.temp,l=c.numericPattern,u=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,u||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number(e.toFixed(Math.min(20,u?u.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=Ug(n,t)||"0",u){const t=Math.max(0,Math.min(14,u.length)),n=u.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),f=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=Ug(l,e)}e=e.replace(c.numericRegex,(e=>e===a?c.groupTemp:e===o?c.decTemp:"")),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+f+d+c.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function sy(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=(e=>e)}=t;let o,a,s=Object.create(null),l=Object.create(null),u=0,c=0;return o=r?function(){return a=i(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=i(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(u>=n&&(delete s[l[c]],delete l[c],u--,c++),s[e]=t,l[u]=e,u++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),u=0,c=0},o.size=()=>u,o}function ly(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ay(...t)}(i,e,t,n,r),a=sy(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const uy="IV",cy=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],dy=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],fy=["January","February","March","April","May","June","July","August","September","October","November","December"],my=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function py(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function hy(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}class gy{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:cy,qDayNames:dy,qLongMonthNames:fy,qMonthNames:my}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),t||(t={T:r.qTimeFmt||"hh:mm:ss",D:r.qDateFmt||"YYYY-MM-DD",TS:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new gy(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),r=function(e,t){let n,r=function(e){const t=e,n=24*hy(t),r=60*hy(n),i=60*hy(r),o=1e3*hy(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,u=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(u=n?n.getDay()-1:0,u<0&&(u=6));let c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:i,h:o,m:a,s:s,f:l,t:c}}(e,t));const i=(o=this,a=r,{"Y+|y+":{Y:"".concat(Number("".concat(a.year).slice(-2))),YY:py("".concat(a.year).slice(-2),2),YYY:py("".concat(a.year).slice(-3),3),def:e=>py("".concat(a.year),e.length)},"M+":{M:a.month+1,MM:py("".concat(a.month+1),2),MMM:o.locale_months_abbr[a.month],def:o.locale_months[a.month]},"W+|w+":{W:a.day,WW:py("".concat(a.day),2),WWW:o.locale_days_abbr[a.day],def:o.locale_days[a.day]},"D+|d+":{D:a.date,def:e=>py("".concat(a.date),e.length)},"h+|H+":{h:a.h,def:e=>py("".concat(a.h),e.length)},"m+":{m:a.m,def:e=>py("".concat(a.m),e.length)},"s+|S+":{s:a.s,def:e=>py("".concat(a.s),e.length)},"f+|F+":{def(e){let t="".concat(a.f),n=e.length-t.length;if(n>0)for(let e=0;e<n;e++)t+="0";else n<0&&(t=t.slice(0,e.length));return t}},"t{1,2}|T{1,2}":{def(e){let t=a.t;return e[0].toUpperCase()===e[0]&&(t=t.toUpperCase()),t=t.slice(0,e.length),t}}});var o,a;const s=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&s.push(e);const l=new RegExp(s.join("|"),"g");return t.replace(l,(e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}))}}function yy(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new gy(...t)}function vy(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=yy(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=sy(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==uy?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=yy(i,e,t),r=sy(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function by(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const u=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),c="dimension"===s?"first":"avg",d=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return vy(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),ly(n,r,i,o,t)}(t,i),f="dimension"===s?"first":(e,t)=>d(t),m={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(m)),e),min:()=>t.qMin,max:()=>t.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:c,reduceLabel:f,formatter:()=>d,tags:()=>t.qTags};return m}function xy(e,t,n,r,i){return(t[e]||[]).map(((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:by(ag({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=xy("qAttrDimInfo",t,n,a,ag({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=xy("qAttrExprInfo",t,n,a,ag({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=xy("qMeasureInfo",t,n,a,ag({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s}))}function qy(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},i=t;if(!i)throw new Error('Missing "data" input');if(!i.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=qy.util,a={cache:r,cube:i,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>e,raw:()=>i,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>r.fields.slice(),extract:e=>a.extractor(e,s,r,o),hierarchy:e=>a.hierarchy(e,s,r,o),_cache:()=>r};"K"===i.qMode||"T"===i.qMode||!i.qMode&&i.qNodesOnDim?(a.extractor=_g,a.hierarchy=Bg,a.pages="K"===i.qMode?i.qStackedDataPages:i.qTreeDataPages):"S"===i.qMode?(a.extractor=cg,a.pages=i.qDataPages,a.hierarchy=Bg):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},s,r,o);const l="S"===i.qMode?e=>e.qElemNumber:void 0,u="S"===i.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...xy("qDimensionInfo",i,e,"",ag({},a,{value:l,type:"dimension"}))),r.wrappedFields.push(...xy("qMeasureInfo",i,e,"",ag({},a,{value:u,type:"measure"}))),r.fields=r.wrappedFields.map((e=>e.instance));const c=e=>{e.forEach((e=>{r.allFields.push(e.instance),c(e.measures),c(e.attrDims),c(e.attrExps)}))};return c(r.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=s.field(t.from),i=by(Xh({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},s,r,o),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));r.virtualFields.push(i)})),r.allFields.push(...r.virtualFields),s}const My=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],Sy=/\/qDimensionInfo(?:\/(\d+))?/,wy=/\/qMeasureInfo\/(\d+)/,Dy=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,Cy=/\/qAttrExprInfo\/(\d+)/,Ny=/\/?qHyperCube/,ky=/\/?qTreeData/,Ay=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),Ly=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function Ey(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;return e.brushes().forEach((e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;Ny.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=Ay):ky.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=Ly);let s=!0;if(Sy.test(e)&&(r=+Sy.exec(e)[1]),wy.test(e)&&(i=+wy.exec(e)[1]),Dy.test(e)){i=-1,r=0;const e=+Dy.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(Cy.test(e)){const e=i;if(t){i=0;const a=Cg(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce(((e,t)=>e+t.qAttrExprInfo.length),i),r=-1):(i=a.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),i),i=a.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),i)),i+=+Cy.exec(n)[1]}else r>-1?(r=-1,i=+Cy.exec(n)[1]):i+=+Cy.exec(n)[1]+1}return My.forEach((e=>{let[t,r]=e;n=n.replace(t,r)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||s>=o)&&o>-1?n.forEach((e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})})):n.forEach((e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&s?[{method:"resetMadeSelections",params:[]}]:(a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(u=t.orMode)||void 0===u||u]}),a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o);var u}function Ty(e){qy.util=e.data("matrix").util,e.data("q",qy),e.formatter("q-number",ly),e.formatter("q-time",vy)}function Oy(e){var t=jh(e.layout||{},e.path.split("/").join("."));if(!t)return!1;var n=t.qIsOneAndOnlyOne;return void 0!==n&&n}function Iy(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(null==e||!e.length)return!1;var t=e.filter((function(e){return"object"===Lm(e.data)&&Array.isArray(e.data.fields)})).every((function(e){return e.data.fields.every((function(e){var t=e.raw();return!(!t.qLocked&&t.qCardinal)}))}));return t}function Py(e){var t=e.brush,n=e.colorField,r=e.legendAlias,i=e.useLegendCube,o=void 0!==i&&i;!n||/qAttrDimInfo/.test(n)?(t.removeKeyAlias("attrDim/qDimensionInfo/0"),r&&t.removeKeyAlias(r),t.addKeyAlias("attrDim/qDimensionInfo/0","qHyperCube/".concat(n))):o&&t.addKeyAlias(r,"qHyperCube/".concat(n))}Ty.qBrushHelper=Ey,Ty.selections=Ey;var Ry="Shift";function Fy(e){var t=e.brush,n=e.getConfig;return{interceptor:function(e){var r=t.brushes(),i=n(),o=i.allowSimultaneous,a=i.layout,s=void 0===a?{}:a;r.forEach((function(n){var r,i,a;("range"===n.type||null!==(r=e[0])&&void 0!==r&&r.key&&(null===(i=e[0])||void 0===i?void 0:i.key)!==n.id&&0!==o.indexOf(null===(a=e[0])||void 0===a?void 0:a.key))&&t.clear([])}));var l=e.filter((function(e){return-2!==e.value}));if(l.length>1){var u=function(e){var t=e.layout,n=void 0===t?{}:t,r=e.values,i=void 0===r?[]:r;if(null==i||!i.length)return[];var o=Array.from(new Set(i.map((function(e){return e.key})))),a=[];return o.forEach((function(e){var t=Oy({layout:n,path:e}),r=i.filter((function(t){return t.key===e})),o=t?[r.pop()]:r;a.push.apply(a,Rm(o))})),a.filter(Boolean)}({layout:s,values:l});return u}return l},rangeInterceptor:function(e){var r=t.brushes(),i=n().allowSimultaneous;return r.filter((function(e){return"value"===e.type})).length?(t.clear([]),e):(r.forEach((function(n){var r=n.id===e[0].key||i.includes(n.id)&&i.includes(e[0].key);"range"!==n.type||r||t.clear([])})),e)}}}var jy=function e(t,n){return n[t]?e(t+1,n):t},Hy=function(e,t){var n=t.reduce((function(e,t){return e[t]=!0,e}),{});return e.reduce((function(e,t,r){var i=jy(r,n);return n[i]=!0,e[r]=i,e}),{})};function zy(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.layout,n=e.filtered,r=void 0===n?{}:n,i=(null==t?void 0:t.qHyperCube)||{},o=i.qDimensionInfo,a=void 0===o?[]:o,s=i.qMeasureInfo,l=void 0===s?[]:s;return{dimensions:Hy(a,r.dimensions||[]),measures:Hy(l,r.measures||[])}}var By="selectHyperCubeValues",_y="selectHyperCubeContinuousRange";function Vy(e){var t=e.selection,n=e.fieldMap,r=t.method,i=t.params;if(r===By){var o=n.dimensions[i[1]];void 0!==o&&(i[1]=o)}return r===_y&&i[1].forEach((function(e){var t=n.dimensions[e.qDimIx];void 0!==t&&(e.qDimIx=t)})),t}var $y=[],Uy=0,Wy=function(e){var t=$y.filter((function(e){var t;return null===(t=e.selections)||void 0===t?void 0:t.isActive()}));t.length&&("Enter"===e.key?t.forEach((function(e){return e.selections.confirm()})):"Escape"!==e.key&&"Esc"!==e.key||t.forEach((function(e){return e.selections.cancel()})))},Ky=function(){document.addEventListener("keyup",Wy)},Gy=function(){document.removeEventListener("keyup",Wy)},Yy=function(e,t){Object.keys(t).forEach((function(n){e.on(n,t[n])}))},Xy=function(e,t){Object.keys(t).forEach((function(n){e.removeListener(n,t[n])}))};function Jy(e){var t=e.chart,n=e.document,r=e.selectionInfo,i=e.eventName,o=e.componentName,a=e.brushName,s=void 0===a?"selection":a,l=e.emit,u=void 0===l?"rangeClear":l,c=r.event===i,d=n.querySelector("[data-key='".concat(o,"-edge-0']"));if(c||!d)return!1;var f=t.component(o);return!!f&&(f.emit(u),"string"==typeof s&&t.brush(s).clear(),f)}var Zy=["chart","document","selections","selectionInfo"],Qy=function(e){e.chart,e.document,e.selections,e.selectionInfo;var t=Im(e,Zy);t.clearDiscrete(),t.clearContinuous(),t.clearMinor(),t.clearRange(),t.clearTap(),t.clearLegend()};function ev(e){var t,n=e.lasso;null!=n&&null!==(t=n.active)&&void 0!==t&&t.call(n)&&(null==n||n.action(!1))}function tv(e){var t,n=e.chart,r=e.selectionInfo,i=e.selectionActions,o=e.actions,a=void 0===o?{}:o,s=e.selections,l=e.selectionEvents;if(!1===i||!1===l)return function(){};var u=i.reset,c=void 0===u?ev:u,d=i.clear,f=!1!==d&&function(e){var t=e.clear,n=void 0===t?Qy:t,r=e.selections,i=e.selectionInfo,o=e.chart;return function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).cleared,t={selections:r,selectionInfo:i,chart:o,document:document,cleared:e};return n(km({clearDiscrete:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"discreteRange":i,a=e.componentName,s=void 0===a?"discrete-range-brush":a,l=e.cleared;return Jy({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,emit:"areaClear",brushName:e.brushName})}(km(km({},t),e))},clearContinuous:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"continuousRange":i,a=e.componentName,s=void 0===a?"continuous-range-brush":a,l=e.cleared;return Jy({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,brushName:e.brushName})}(km(km({},t),e))},clearMinor:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.componentName,o=void 0===i?"minor-range-brush":i,a=e.eventName,s=void 0===a?"minorRange":a,l=e.cleared,u=void 0!==l&&l,c=e.brushName,d=Jy({selectionInfo:t,chart:n,document:r,eventName:u?void 0:s,componentName:o,brushName:void 0!==c&&c});if(d){var f=d.settings.settings,m=f.scale,p=f.brush,h=n.scale(m).data().fields.map((function(e){return e.id()})),g=n.brush(p),y=g.brushes().filter((function(e){return"range"===e.type&&h.some((function(t){return t===e.id}))}));g&&y.length&&y.forEach((function(e){g.removeRanges(e.brush.ranges().map((function(t){return{key:e.id,range:t}})))}))}}(km(km({},t),e))},clearRange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"xAxis":o,s=e.cleared;Jy({selectionInfo:t,chart:n,document:r,eventName:void 0!==s&&s?void 0:a,componentName:"".concat(a,"-range-brush"),emit:"areaClear",brushName:!1})&&i.clear()}(km(km({},t),e))},clearTap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.chart,n=e.selectionInfo,r=e.selections,i=e.events,o=void 0===i?["tap"]:i,a=e.brushNames,s=void 0===a?[]:a;if(n&&o.includes(n.event)){var l=n.currentComponent;n.previousComponent!==l&&(r.clear(),s.forEach((function(e){return t.brush(e).end()})))}}(km(km({},t),e))},clearLegend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"legendRange":o,s=e.componentName,l=void 0===s?"legend-range-brush":s,u=e.cleared,c=void 0!==u&&u,d=e.brushName;Jy({selectionInfo:t,chart:n,document:r,eventName:c?void 0:a,componentName:l,brushName:void 0!==d&&d})&&i.clear()}(km(km({},t),e))}},t))}}({clear:d,selections:s,selectionInfo:r,chart:n}),m=function(e){var t=e.chart,n=e.actions,r=e.reset,i=e.clear,o=!1,a={deactivated:function(e){var t=(n||{}).lasso;r({e:e,lasso:void 0!==t&&t})},canceled:function(e){var o=(n||{}).lasso;r({e:e,lasso:void 0!==o&&o}),i({e:e,chart:t,document:document})},cleared:function(e){o||(o=!0,i({e:e,chart:t,document:document,cleared:!0}),o=!1)}};return!1===r&&delete a.deactivated,!1===i&&delete a.cleared,!1===r&&!1===i&&delete a.canceled,a}({chart:n,clear:f,reset:c,actions:a}),p={};Object.entries(m).forEach((function(e){var t=Pm(e,2),n=t[0],r=t[1];p[n]=function(e,t){return t?function(n){return t({event:n,defaultFunc:e})}:e}(r,l[n])}));var h=function(e){var t=e.selectionEvents,n=e.selections,r=e.selectionInfo,i=e.clear,o=e.chart,a=e.document,s=t.start,l={selections:n,selectionInfo:r,chart:o,document:a},u=function(e){return Object.assign(r,e||{})},c=function(e){var t=e.event,n=e.components;return function(){return function(e){var t=e.selectionInfo,n=e.clear,r=e.event,i=e.components,o=void 0===i?[]:i;(0,e.setSelectionInfo)(km(km({},void 0===t?{}:t),{},{event:r,components:o.map((function(e){return e.key})).filter(Boolean)})),n()}({event:t,components:n,clear:i,chart:o,selectionInfo:r,setSelectionInfo:u})}};return"function"==typeof s?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];s(km(km({defaultFunc:c({event:e,components:t}),setSelectionInfo:u,clear:i},l),{},{event:e,components:t}))}:function(e){c({event:e,components:arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]})()}}({selectionEvents:l,selections:s,selectionInfo:r,clear:f,chart:n,document:document});return null==a||null===(t=a.select)||void 0===t||t.on("start",h),Object.entries(p).forEach((function(e){var t=Pm(e,2),n=t[0],r=t[1];null==s||s.on(n,r)})),function(){var e;null==a||null===(e=a.select)||void 0===e||e.removeListener("start",h),Object.entries(p).forEach((function(e){var t=Pm(e,2),n=t[0],r=t[1];null==s||s.removeListener(n,r)}))}}var nv=[{key:"qHyperCube/qDimensionInfo/0:numeric",includeMax:!1}];function rv(e){var t=e.chart,n=e.actions,r=e.selections,i=e.picassoQ,o=e.config,a=o.allowSimultaneous,s=void 0!==a&&a,l=o.majorScale,u=void 0===l?void 0:l,c=o.selectionActions,d=void 0===c?{}:c,f=d.clear,m=d.reset,p=o.selectionEvents,h=void 0===p?{deactivated:void 0,canceled:void 0,cleared:void 0,start:void 0}:p,g=o.brushEvents,y=void 0===g?{}:g,v=o.brushName,b=void 0===v?"selection":v,x=o.brushMaxListeners,q=void 0===x?20:x,M=o.brushRanges,S=void 0!==M&&M,w=o.interceptors,D=void 0===w?{}:w,C=o.selectionsFn,N=void 0===C?i.selections:C,k=t.brush(b);if("number"==typeof q&&k.setMaxListeners(q),S){var A=!0===S?nv:S;k.configure({ranges:A})}var L={canSelect:!0,getIsSelectionLocked:!1,isInnerDimensionLocked:!1,lockedDimensions:[],singleSelectIndex:0,selectionInfo:{colorField:void 0,components:[],event:void 0,currentComponent:void 0,previousComponent:void 0}},E=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.selections,r=t.brush,i=t.majorScale,o=t.actions,a=t.selectionsFn,s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).path,l=void 0===s?"/qHyperCubeDef":s;if(!n)return{layout:function(){},filteredFields:function(){},allowSimultaneous:function(){},release:function(){}};var u=++Uy,c=null,d={dimensions:[],measures:[]},f=[],m={};n.on=n.on.bind(n),n.isActive=n.isActive.bind(n),n.addListener=n.addListener.bind(n),n.removeListener=n.removeListener.bind(n);var p=Fy({brush:r,getConfig:function(){return{layout:c,allowSimultaneous:f}}}),h=p.rangeInterceptor,g=p.interceptor;r.intercept("set-ranges",h),r.intercept("toggle-ranges",h),r.intercept("toggle-values",g),r.intercept("set-values",g),r.intercept("add-values",g),r.on("start",(function(){return n.begin(l)}));var y={activate:function(){},deactivated:function(){return r.end()},cleared:function(){return r.clear()},canceled:function(){return r.end()}};Yy(n,y);var v=null==i||null===(e=i.max)||void 0===e?void 0:e.call(i);return null!=o&&o.select?(o.select.on("start",(function(){var e;r.start(),"function"==typeof o.select.getBrushOptions&&(m=(e=o.select).getBrushOptions.apply(e,arguments))})),o.select.on("end",(function(){var e=a(r,m,c),t=zy({layout:c,filtered:d});e.forEach((function(e){var r=Vy({selection:e,fieldMap:t});(function(e,t,n){if(t&&void 0!==n&&"selectHyperCubeContinuousRange"===e.method){var r=e.params;if(r&&r[1]&&r[1][0]){var i=r[1][0],o=i.qDimIx,a=i.qRange;"undefined"!==o&&a&&!1===a.qMaxInclEq&&a.qMax>=n&&(a.qMaxInclEq=!0)}}})(r,o.select.brushSelectionIncludeMax,v),n.select(r)}))}))):r.on("update",(function(){var e=a(r,m,c),t=zy({layout:c,filtered:d});e.forEach((function(e){n.select(Vy({selection:e,fieldMap:t}))}))})),0===$y.length&&Ky(),$y.push({key:u,selections:n}),{layout:function(e){c=e},filteredFields:function(e){d=e},allowSimultaneous:function(e){f=e},release:function(){c=null;var e=$y.indexOf($y.filter((function(e){return e.key===u}))[0]);-1!==e&&$y.splice(e,1),$y.length||Gy(),Xy(n,y)}}}({brush:k,majorScale:u,actions:n,selections:r,picassoQ:i,selectionsFn:N});!function(e){var t=e.brush,n=e.interceptors,r=void 0===n?{}:n;Object.entries(r).forEach((function(e){var n=Pm(e,2),r=n[0],i=n[1];(Array.isArray(i)?i:[i]).forEach((function(e){t.intercept(r,e)}))}))}({brush:k,interceptors:D});var T=function(e){var t=e.chart,n=e.selectionActions,r=e.brush,i=e.actions,o=e.selectionInfo,a=e.selections,s=e.selectionEvents,l=function(e){var t=e.brush,n=e.chart,r=e.selectionInfo,i=e.brushEvents,o=void 0===i?{}:i,a=Object.entries(o).map((function(e){var i=Pm(e,2),o=i[0],a=i[1],s=function(){return a({chart:n,selectionInfo:r})};return t.on(o,s),[o,s]}));return function(){a.forEach((function(e){var n=Pm(e,2),r=n[0],i=n[1];t.removeListener(r,i)}))}}({brush:r,chart:t,selectionInfo:o,brushEvents:e.brushEvents}),u=tv({chart:t,selectionInfo:o,selectionActions:n,actions:i,selections:a,selectionEvents:s}),c=function(e){var t=e.actions;if(null==t||!t.lasso)return function(){};var n=!1,r=function(e){n||e.key!==Ry||(t.lasso.action(!0),n=!0)},i=function(e){e.key===Ry&&(t.lasso.action(!1),n=!1)};return document.addEventListener("keydown",r),document.addEventListener("keyup",i),function(){document.removeEventListener("keydown",r),document.removeEventListener("keyup",i)}}({actions:i});return function(){l(),u(),c()}}({chart:t,brush:k,actions:n,selections:r,selectionInfo:L.selectionInfo,selectionActions:{clear:f,reset:m},selectionEvents:h,brushEvents:y});if(s){var O=!0===s?Rm(Array(15)).map((function(e,t){return"qHyperCube/qMeasureInfo/".concat(t)})):s;E.allowSimultaneous(O)}return{unbindEvents:T,state:L,picassoSelections:E,brush:k}}var iv=["colorField","useLegendCube"];function ov(e){var t=e.chart,n=e.selections,r=e.actions,i=void 0!==r&&r,o=e.config,a=void 0===o?{}:o,s=rv({chart:t,actions:i,selections:n,picassoQ:Ty,config:a}),l=s.unbindEvents,u=s.state,c=s.picassoSelections,d=s.brush,f=a.custom,m=void 0===f?{}:f,p=a.legendAlias,h=void 0===p?void 0:p,g=a.setBrushAliases,y=void 0===g?Py:g;return{getIsDimensionLocked:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return u.lockedDimensions[e]},getIsSelectionLocked:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return null!==(e=null==n||null===(t=n.isLocked)||void 0===t?void 0:t.call(n))&&void 0!==e?e:Iy(r)},getIsSingleSelect:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.singleSelectIndex;return u.singleSelectDimensions[e]},getCanSelect:function(){return u.canSelect},getSelectionInfo:function(){return u.selectionInfo},setLayout:function(e){var t=function(e){var t,n,r,i=e.selections,o=e.picassoSelections,a=e.layout,s={lockedDimensions:[],singleSelectDimensions:[]};null!=i&&null!==(t=i.isModal)&&void 0!==t&&t.call(i)&&i.confirm(),o.layout(a);var l=(null!==(n=null==a?void 0:a.qHyperCube)&&void 0!==n?n:{}).qDimensionInfo,u=void 0===l?[]:l;return s.lockedDimensions=u.map((function(e){return!!e.qLocked})),s.singleSelectDimensions=u.map((function(e,t){return Oy({layout:a,path:"qHyperCube/qDimensionInfo/".concat(t)})})),s.singleSelectIndex=function(e){var t,n=((null==e?void 0:e.qHyperCube)||{}).qDimensionInfo,r=void 0===n?[]:n;return null!==(t=r.map((function(e,t){var n;return!(e.qLocked||(null===(n=e.qCardinalities)||void 0===n?void 0:n.qHypercubeCardinal)<=1)&&t})).filter((function(e){return"number"==typeof e}))[0])&&void 0!==t?t:Math.max(r.length-1,0)}(a),s.canSelect=0===u.length||u.some((function(e){return!e.qLocked})),s.dimensionLocked=!(null===(r=u[0])||void 0===r||!r.qLocked),s}({selections:n,picassoSelections:c,layout:e});Object.assign(u,t)},setFilteredFields:function(e){c.filteredFields(e)},setBrushAliases:function(e){var t=e.colorField,n=e.useLegendCube,r=void 0!==n&&n,i=Im(e,iv),o=km({useLegendCube:r,colorField:t,brush:d,legendAlias:h},i);y(km(km({},o),{},{defaultFunc:function(){return Py(o)}}))},destroy:function(){l(),c.release()},custom:km({},m)}}var av="'Source Sans Pro', 'Arial', 'sans-serif'",sv="#333333",lv="#595959",uv="#737373",cv="#cccccc",dv="#e6e6e6";function fv(e){var t={};return[].concat(Rm(e),Rm([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",lv],["object","axis.label.name","fontFamily",av],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",cv],["object","axis.line.minor","color",dv],["object","axis.title","color"],["object","axis.title","fontFamily",av],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",dv],["object","grid.line.major","color",cv],["object","grid.line.minor","color",dv],["object","label.value","color",lv],["object","label.value","fontFamily",av],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",lv],[!1,"label.value","lightColor",dv],["object","outOfRange","color","#999"],["object","legend.title","color",sv],["object","legend.title","fontFamily",av],["object","legend.title","fontSize","15px"],["object","legend.label","color",lv],["object","legend.label","fontFamily",av],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",sv],["object","referenceLine.label.name","fontFamily",av],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",dv],["object","referenceLine.outOfBounds","fontFamily",av],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",uv,function(e){return"transparent"===e?uv:e}]])).reduce((function(e,n){var r="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[r]||(t[r]=!0,e.push(n)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var mv=function(e){return e};function pv(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,a={},s=r.reduce((function(e,t){var n=Pm(t,2),r=n[0],i=n[1];return e[r]=i,e}),{});return o.forEach((function(e){var r=Pm(e,5),i=r[0],o=r[1],l=r[2],u=r[3],c=r[4],d=void 0===c?function(e){return e}:c,f=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,a=void 0===o?void 0:o;if(!t||!1===n)return a;var s=t.getStyle(n,r,i);return void 0===s?a:s}({theme:t,base:"object"===i&&n?"".concat("object",".").concat(n):i,path:o,attribute:l,defaultValue:u}),m=(s["".concat(o,".").concat(l)]||mv)(d(f));zh(a,[o,l].filter(Boolean).join("."),m)})),i.forEach((function(e){var t=Pm(e,2),n=t[0],r=t[1];zh(a,n,r)})),a}var hv=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],gv=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];var yv=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function vv(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],a=t.getStyle("","","fontFamilies");return Array.isArray(a)&&a.length?o.push.apply(o,Rm(new Set([r].concat(Rm(a.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(Rm(o.map((function(e){return yv(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],Rm(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?gv:hv}(i).map((function(e){return yv(e)}))))}function bv(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,a=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return a()},getOptions:function(){return vv({theme:t,translator:n,defaultValue:a(),flags:o})}}}var xv=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],qv=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function Mv(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,r=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push.apply(r,Rm(new Set([n].concat(Rm(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(Rm(r.map((function(e){return qv(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],Rm(xv.map((function(e){return qv(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function Sv(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:bv({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:Mv({theme:t,translator:n,id:r,path:i})}}const wv={CUSTOM:{EXPRESSION:"customTooltipExpression",TITLE:"customTooltipTitle",DESCRIPTION:"customTooltipDescription",QUARANTINE:"customTooltip",IMAGES:"customTooltipImages"},CHART:{CONTAINER_ID:"tooltipContainerId",STATE:"customTooltipSessionState",CHART_OBJECT_ID:"customTooltipSessionObjectId",CHART_PARENT_TYPE:"TooltipChartParent",CHART_CHILD_TYPE:"TooltipChart",STYLE:{small:"140px",medium:"200px",large:"340px"}}};function Dv(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const Cv={getImageSize(e,t){let n;function r(){n&&(clearTimeout(n),n=null)}function i(e){const t=e;t.onload=null,t.onerror=null,r()}const o={small:50,medium:200,large:340,original:340};return new Promise((a=>{const s=new Image;s.referrerPolicy="no-referrer",s.onload=()=>{let e;const{height:n,width:l}=s,u=o[t]*(n>l?1:n/l),c=o[t]*(l>n?1:l/n);!n||!l||0===n&&0===l?(e={height:20,width:20,imageError:!0},i(s)):"original"===t?(e={height:Math.min(u,n),width:Math.min(c,l)},r()):(e={height:u,width:c},r()),a(e)},s.onerror=()=>{i(s),a({height:20,width:20,imageError:!0})},s.src=e,n=setTimeout((()=>{i(s),a({height:20,width:20,imageError:!0})}),3e3)}))}};async function Nv(e,t,n){let r=e.ref.qStaticContentUrl.qUrl;const i=function(e){var t,n,r,i,o;let a,s,l,u,c,d;if(e&&(null!==(t=e.session)&&void 0!==t&&t.options||null!==(n=e.enigmaModel)&&void 0!==n&&null!==(r=n.session)&&void 0!==r&&r.sessionConfig||null!==(i=e.session)&&void 0!==i&&null!==(o=i.config)&&void 0!==o&&o.url)){var f;if(a=e.session.options||(null===(f=e.enigmaModel)||void 0===f?void 0:f.session.sessionConfig),!a){var m;a=null===(m=e.session)||void 0===m?void 0:m.config;const t=new URL(a.url);a.host=t.hostname,a.port=t.port,a.isSecure="wss:"===t.protocol}return d=void 0!==a.secure?a.secure:a.isSecure,s=d?"https://":"http://",l=a.host||"localhost",u=a.port?`:${a.port}`:"",c=a.prefix?a.prefix:"/","/"!==c[c.length-1]&&(c=`${c}/`),s+l+u+c}return""}(n);i&&(!function(e,t){const n=e.replace(t,"").replace(/^\.\.\//i,"/");n[0]}(r,i),r=r.replace(/"/g,'\\"'),r=r.replace(/'/g,"\\'"),r=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(r,i));const{height:o,width:a,imageError:s}=await Cv.getImageSize(r,t);return{src:r,size:t,height:o,width:a,imageError:s}}async function kv(e,t,n,r){var i,o,a,s,l,u;const{app:c,flags:d}=t,f=null===(i=e.layout)||void 0===i||null===(o=i.tooltip)||void 0===o?void 0:o.imageComponents;if(!f)return[];const[m]=f,p=m.size||"small",h=m.type||"media";let g=-1;for(let e=0;e<n.length;e++)if(n[e].cId===m.cId){g=e;break}const y=(null===(a=r.data)||void 0===a||null===(s=a.customTooltipAttrExps)||void 0===s?void 0:s.value)||[];let v;if(-1!==g&&y[g]&&(v=y[g]),"media"===h&&null!==(l=m.ref)&&void 0!==l&&null!==(u=l.qStaticContentUrl)&&void 0!==u&&u.qUrl)return Nv(m,p,c);if("url"===h)return async function(e,t,n,r,i){let o,a=n.ref;if(i&&i.label&&(a=i.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&null!=e&&e.getImage&&Dv(a))try{const t=`data:image/png;base64, ${await e.getImage(a)}`,{height:n,width:i,imageError:s}=await Cv.getImageSize(t,r);o={src:t,size:r,height:n,width:i,imageError:s}}catch(e){}else{const{height:e,width:t,imageError:n}=await Cv.getImageSize(a,r);o={src:a,size:r,height:e,width:t,imageError:n}}return o}(c,d,m,p,v);if(d.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===h&&v&&v.label){return async function(e,t,n,r){let i;const o=r.label,a=`qmem://${t.qFallbackTitle}/${o}`;if(Dv(a))try{const t=await e.getImage(a);if(t){const e=`data:image/png;base64, ${t}`,{height:r,width:o,imageError:a}=await Cv.getImageSize(e,n);i={src:e,size:n,height:r,width:o,imageError:a}}}catch(e){}return i}(c,n[g],p,v)}return[]}const Av={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){const i=t,o=[];for(let t=0;t<i.length;t++)o.push(kv(e,r,n,i[t]));const a=await Promise.all(o);for(let e=0;e<i.length;e++)i[e].data.customTooltipImages=[a[e]];return i},checkIfPromisesExist({customTooltipModel:e}){var t,n;const r=null===(t=e.layout)||void 0===t||null===(n=t.tooltip)||void 0===n?void 0:n.imageComponents;return!!r&&r.length>0}},Lv={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){let i=t;return i=await Av.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}),i},checkIfPromisesExist:({customTooltipModel:e})=>Av.checkIfPromisesExist({customTooltipModel:e})};const Ev=(e,t)=>{var n,r,i;const o=null==e||null===(n=e.qHyperCubeDef)||void 0===n?void 0:n.qDimensions,a=null==e||null===(r=e.qHyperCubeDef)||void 0===r?void 0:r.qMeasures,s=null==e||null===(i=e.qHyperCubeDef)||void 0===i?void 0:i.qInterColumnSortOrder,l=t;return{qInfo:{qType:wv.CHART.CHART_PARENT_TYPE,qId:wv.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:o,qMeasures:a,qInterColumnSortOrder:s,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:l}},Tv=e=>{var t,n,r;const i=null===(t=e.tooltip)||void 0===t||null===(n=t.chart)||void 0===n||null===(r=n.object)||void 0===r?void 0:r.refId;return{qInfo:{qType:wv.CHART.CHART_CHILD_TYPE},qExtendsId:i}};const Ov={createContainer:({ctx:e,layout:t})=>{var n,r;if(!((null===(n=t.qHyperCube)||void 0===n||null===(r=n.qDimensionInfo)||void 0===r?void 0:r.length)<=0))return function(e,t){var n,r,i,o;const a=null!==(n=null===(r=t.tooltip)||void 0===r||null===(i=r.chart)||void 0===i||null===(o=i.style)||void 0===o?void 0:o.size)&&void 0!==n?n:"medium",s=wv.CHART.STYLE[a];return[{content:[e.h("div",{style:{display:"flex",width:s,height:s,backgroundColor:"#FFFFFF",borderRadius:"5px",padding:"2px",color:"#595959"},colspan:2,id:wv.CHART.CONTAINER_ID})],colspan:2,style:{"text-align":e.rtl?"right":"left","max-width":s,width:"100%"}},{}]}(e,t)},show:async({app:e,properties:t,selectedNodes:n,dimIndex:r,customTooltipModel:i,rtl:o})=>{var a,s,l;const u=i,c=null==t||null===(a=t.tooltip)||void 0===a||null===(s=a.chart)||void 0===s||null===(l=s.object)||void 0===l?void 0:l.refId;if(null!=u&&u.embed&&e.removeSessionAlternateState&&e.addSessionAlternateState&&c&&!(t.qHyperCubeDef.qDimensions.length<=0)){await Ov.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:n}){const r=n,i=wv.CHART.STATE,o=t.qStateName;r.miniChartToken.alternateState||(r.miniChartToken.alternateState=i,await e.addSessionAlternateState(i,o),r.miniChartToken.alternateState=i)}({app:e,properties:t,customTooltipModel:i});const a=await async function({app:e,properties:t,customTooltipModel:n}){var r;const i=n;null!==(r=i.miniChartToken.sessionObj)&&void 0!==r&&r.id&&await e.destroySessionObject(i.miniChartToken.sessionObj.id);const o=wv.CHART.STATE,a=Ev(t,o),s=await e.createSessionObject(a),l=Tv(t);if(s.id!==wv.CHART.CHART_OBJECT_ID)return void e.destroySessionObject(s.id);i.miniChartToken.sessionObj=s;const u=await s.createChild(l);if(i.miniChartToken.sessionObj&&i.miniChartToken.sessionObj.id===s.id)return i.miniChartToken.model=u,u;e.destroySessionObject(s.id)}({app:e,properties:t,customTooltipModel:i});if(u.miniChartToken.alternateState&&u.miniChartToken.sessionObj&&a){var d,f,m,p;const e=n.length>0&&void 0!==(null===(d=n[0].data)||void 0===d?void 0:d.value)?[null===(f=n[0].data)||void 0===f?void 0:f.value]:[],a=void 0!==r?r:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===r&&n.length>0){var h,g;const e=null!==(h=n[0].data.selectionOuterDimension)&&void 0!==h?h:n[0].data.selectionDimension;if(null!=e&&null!==(g=e.source)&&void 0!==g&&g.field){var y;const t=null==e||null===(y=e.source)||void 0===y?void 0:y.field.split("/"),n=t[t.length-1],r=void 0!==e.value?[e.value]:[];r.length>0&&void 0!==n&&u.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(n),r,!1)}}e.length>0&&u.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",a,e,!1);const s=document.getElementById(wv.CHART.CONTAINER_ID),l={direction:o?"rtl":"ltr",isReadonly:!0,isPopover:!0,navigation:!1,selections:!1};u.miniChartToken.vis=await i.embed.render({element:s,model:u.miniChartToken.model,options:l,id:null===(m=u.miniChartToken.model)||void 0===m?void 0:m.id,type:null===(p=u.miniChartToken.model)||void 0===p?void 0:p.genericType})}}catch(t){await Ov.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;null!=n&&n.embed&&(Ov.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(wv.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,r=wv.CHART.STATE;n.miniChartToken.alternateState=void 0,await e.removeSessionAlternateState(r)}({app:e,customTooltipModel:t}))},destroyVisualization:({customTooltipModel:e})=>{var t,n;const r=e;"function"==typeof(null===(t=r.miniChartToken)||void 0===t||null===(n=t.vis)||void 0===n?void 0:n.destroy)&&(r.miniChartToken.vis.destroy(),r.miniChartToken.vis=void 0)}};function Iv(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function Pv(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:r}=wv.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[n]=!0,i[r]=!0,i}function Rv(e){const t=Pv();return e.filter((e=>t[e.id]))}const Fv={getNodes(e,t){const n=function(e,t){let n=0,r=0;e.center?(n+=e.center.x,r+=e.center.y):(n+=e.clientX,r+=e.clientY);const i=t.element.getBoundingClientRect();return{cx:n-i.left,cy:r-i.top}}(e,t);return t.shapesAt({x:n.cx,y:n.cy})},getDataNodes(e,t){let n,r=[];const i={container:{bar:!0,"bullet-axis":!0},circle:{"point-component":!0}};return t.forEach((t=>{var o,a,s,l;const u=null!==(o=null===(a=t.data)||void 0===a?void 0:a.selectionDimension)&&void 0!==o?o:t.data;if(!u||null!==(s=t.data)&&void 0!==s&&s.customTooltipAttrExps||i[t.type]){if(null!==(l=t.data)&&void 0!==l&&l.customTooltipAttrExps&&!t.data.customTooltipImages){const e=t;e.data.customTooltipImages=[],r.push(e)}}else{n||(n=[],Object.keys(i).forEach((t=>{n=n.concat(e.findShapes(t).filter((e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&i[t][e.key])))})));const t=n.filter((e=>{var t,n;const r=null!==(t=null!==(n=e.data.stack)&&void 0!==n?n:e.data.selectionOuterDimension)&&void 0!==t?t:e.data.selectionDimension;return r&&r.value===u.value&&r.label===u.label}));t.length>0&&(r=r.concat(t[0]))}})),r},displayTooltip(e,t,{nodes:n,opts:r={},customTooltipModel:i,extractedNodes:o=[],hide:a}){if(i&&!a){const{layout:a,chart:s}=i,{attrExps:l}=Fv.getAttrExprData(a);o.length||n.length?Lv.handlePromises({customTooltipModel:i,nodes:Fv.getDataNodes(s,o.length>0?o:n),attrExps:l,opts:r}).then((()=>{t.emit("show",e,n.length?{nodes:n}:void 0)})):t.emit("show",e,n.length?{nodes:n}:void 0)}else{var s;null!=i&&null!==(s=i.miniChartToken)&&void 0!==s&&s.alternateState&&Ov.hide({app:r.app,customTooltipModel:i}),t.emit("hide")}},checkIfPromisesExist:({customTooltipModel:e})=>Lv.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){var n;const r=t,i=null!==(n=e.qHyperCubeDef)&&void 0!==n&&n.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return r[i]||(r[i]=[]),r[i]},getAttrExprData(e){var t;let n=[],r="";const i=(null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[];if(i.length>0){var o,a,s;const t=i.length-1;n=(null===(o=e.qHyperCube)||void 0===o||null===(a=o.qDimensionInfo)||void 0===a||null===(s=a[t])||void 0===s?void 0:s.qAttrExprInfo)||[],r=`qDimensionInfo/${t}/qAttrExprInfo`}return{attrExps:n,fieldPath:r}},quarantineCustomTooltipAttrs(e,t={}){var n,r;if(!(null===(n=e.qLayoutExclude)||void 0===n||null===(r=n.quarantine)||void 0===r?void 0:r[wv.CUSTOM.QUARANTINE])){!function(e,t){const n=t;let r=n.qLayoutExclude;r||(n.qLayoutExclude={quarantine:{}},r=n.qLayoutExclude),r.quarantine||(r.quarantine={}),r.quarantine[wv.CUSTOM.QUARANTINE]=[],e.forEach((e=>{r.quarantine[wv.CUSTOM.QUARANTINE].push(e)})),n.qLayoutExclude=r}(Rv(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){var t,n;const r=e;(null===(t=e.qLayoutExclude)||void 0===t||null===(n=t.quarantine)||void 0===n?void 0:n[wv.CUSTOM.QUARANTINE])&&delete r.qLayoutExclude.quarantine[wv.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=Iv(e);if(!n)return;const r=void 0!==t?t:n.length-1;if(!n[r])return;const i=this.getAttrExps(e,n[r]);if(0===Rv(i).length){var o,a;const t=(null===(o=e.qLayoutExclude)||void 0===o||null===(a=o.quarantine)||void 0===a?void 0:a.customTooltip)||[],n=[...i,...t],s=e;s.qHyperCubeDef?s.qHyperCubeDef.qDimensions[r].qAttributeExpressions=n:s.qHyperCube.qDimensionInfo[r].qAttrExprInfo=n}},moveCustomTooltipAttrs(e,t={},n){let r=[];const i=Iv(e)||[];[...i,t].forEach((e=>{const t=Rv(e.qAttributeExpressions||[]);t.length>0&&(r=t)}));const o=Pv(),a=i.map((e=>{const t=e,n=e.qAttributeExpressions||[];return t.qAttributeExpressions=n.filter((e=>!o[e.id])),t})),s=void 0!==n?n:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(r));const l=e;e.qHyperCubeDef?l.qHyperCubeDef.qDimensions=a:l.qHyperCube.qDimensionInfo=a},addCallbackCustomTooltip(e){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e):(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},moveCallbackCustomTooltip(e,t){1===e.qHyperCubeDef.qDimensions.length&&(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e)),e.qHyperCubeDef.qDimensions.length>1&&this.moveCustomTooltipAttrs(e,t)},removeCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>0?this.moveCustomTooltipAttrs(e,t):this.quarantineCustomTooltipAttrs(e,t)},replaceCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e,t):(this.quarantineCustomTooltipAttrs(e,t),this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},shouldIgnoreDefaultRows(e){var t;return(null===(t=e.tooltip)||void 0===t?void 0:t.hideBasic)||0},DEBOUNCE_THRESHOLD:50,getFooterRow:(e,t)=>[{content:e,style:{"font-style":"italic","font-size":"12px","line-height":"16px",color:"rgba(255, 255, 255, 0.6)","text-align":t?"right":"left",direction:Se.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=Se.detectTextDirection(e.src),r=[],i={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){r.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const n=e.imageError?`${e.src}?${Math.random()}`:e.src;r.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:n,referrerpolicy:"no-referrer"})),i.style["text-align"]="center",i.style["white-space"]="nowrap"}else i.style["background-size"]="contain",i.style["background-repeat"]="no-repeat",i.style["background-position"]="center",i.style["background-image"]=`url('${e.src}')`;return[{content:[t.h("div",i,r),""],style:{"text-align":t.rtl?"right":"left",direction:n,"max-width":e.width},colspan:2},{}]}};function jv(e,t,n,r){var i,o,a;const s=(null===(i=t.qHyperCube)||void 0===i||null===(o=i[n])||void 0===o||null===(a=o[r])||void 0===a?void 0:a.qAttrExprInfo)||[],l=[],u=e.qSubNodes&&e.qSubNodes[r]?e.qSubNodes[r].qAttrExps:e.qAttrExps;return u?(s.forEach(((e,t)=>{const i=u.qValues&&u.qValues[t]?u.qValues[t]:void 0,o=void 0===i?"NaN":function(e,t){let n;switch(e.id){case wv.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case wv.CUSTOM.TITLE:case wv.CUSTOM.DESCRIPTION:case wv.CUSTOM.IMAGES:n=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:n="NaN"}return n}(e,i);l.push({source:{key:"qHyperCube",field:`${n}/${r}/qAttrExprInfo/${t}`},label:o,value:"value"})})),l):l}const Hv={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,r="qDimensionInfo";return{field:`${r}/${n}`,value:t=>jv(t,e,r,n)}}};const zv={getCustomAttrExps(e,t,n){var r,i;const o={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},a=(null===(r=t.data)||void 0===r||null===(i=r.customTooltipAttrExps)||void 0===i?void 0:i.value)||[];if(Number.isNaN(a))return o;return function(e,t,n,r){const i={[wv.CUSTOM.TITLE]:!0,[wv.CUSTOM.DESCRIPTION]:!0},{attrExps:o,fieldPath:a}=Fv.getAttrExprData(e);return 0===t.length||0===o.length||""===a||o.forEach(((e,o)=>{const s=t[o];if(e.id===wv.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,i="NaN"===s.value||e.isCustomFormatted?s.value:n("qHyperCube").field(`${a}/${o}`).formatter()(s.value);r.customTooltipAttrExpsArr.push({label:t,value:i})}else if(i[e.id]&&s){const t="-"!==s.value&&"NaN"!==s.value?s.value:s.label;t&&"undefined"!==t&&r.customTooltipInfoAttrExpsArr.push({...e.id===wv.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}})),r}(n,a.map((t=>we.getMeasure(e,t))),e,o)}};function Bv({nodes:e,layout:t,dataset:n}){const r=function(e,t,n){const r=[];return e.forEach((e=>{r.push(zv.getCustomAttrExps(n,e,t))})),r}(e,t,n);return r.reduce(((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)})),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}function _v(e){const t=wv.CUSTOM.EXPRESSION,{qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}=e.qDef;return e.qLibraryId?{qLibraryId:e.qLibraryId,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}:{qExpression:e.qDef.qDef,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}}function Vv(e){var t;const n=null===(t=e.qHyperCubeDef)||void 0===t?void 0:t.qDimensions;return n[n.length-1].qAttributeExpressions||[]}const $v={migrateProperties(e){var t,n,r,i;const o=Y(!0,{},e),a=(null===(t=o.tooltip)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.qHyperCubeDef)||void 0===r?void 0:r.qMeasures)||[];let s=Vv(o);return s=function(e,t){return t.concat(e.map((e=>_v(e))))}(a,s),function(e,t){var n;const r=null===(n=t.qHyperCubeDef)||void 0===n?void 0:n.qDimensions;r[r.length-1].qAttributeExpressions=e}(s,o),null===(i=o.tooltip)||void 0===i||delete i.data,o},getPatches(e){var t,n,r,i;const o=(null===(t=e.tooltip)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.qHyperCubeDef)||void 0===r?void 0:r.qMeasures)||[],a=(null===(i=e.qHyperCubeDef)||void 0===i?void 0:i.qDimensions.length)-1,s=function(e,t,n){let r=e.length;const i=[];return t.forEach((e=>{const t=_v(e),o=JSON.stringify(t);i.push({qPath:`/qHyperCubeDef/qDimensions/${n}/qAttributeExpressions/${r}`,qOp:"add",qValue:o}),r++})),i.push({qPath:"/tooltip/data",qOp:"remove"}),i}(Vv(e),o,a);return s},checkForBackwardCompatibility:(e,t)=>(e.qMeasureInfo||[]).length>0&&t.length>0,updateProperties(e,t){const n=new Promise((n=>{var r,i,o,a,s;const l=(null===(r=t.qHyperCube)||void 0===r?void 0:r.qDimensionInfo)||[],u=(null===(i=t.tooltip)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.qHyperCube)||{},c=null===(a=t.qMeta)||void 0===a||null===(s=a.privileges)||void 0===s?void 0:s.includes("update");e&&e.getEffectiveProperties&&this.checkForBackwardCompatibility(u,l)&&e.getEffectiveProperties().then((t=>{if(c){const r=this.migrateProperties(t);e.setProperties(r).then((()=>{e.app.clearUndoBuffer(),n(!0)}))}else{const r=this.getPatches(t);e.applyPatches(r,!0).then((()=>{e.app.clearUndoBuffer(),n(!0)}))}})),n(!1)}));return n}};var Uv={attrExpr:$v};var Wv=Object.prototype.hasOwnProperty,Kv=Object.prototype.toString,Gv=Object.defineProperty,Yv=Object.getOwnPropertyDescriptor,Xv=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Kv.call(e)},Jv=function(e){if(!e||"[object Object]"!==Kv.call(e))return!1;var t,n=Wv.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Wv.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Wv.call(e,t)},Zv=function(e,t){Gv&&"__proto__"===t.name?Gv(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Qv=function(e,t){if("__proto__"===t){if(!Wv.call(e,t))return;if(Yv)return Yv(e,t).value}return e[t]};function eb(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function tb(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function nb(){}!function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}((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=Qv(s,n),s!==(i=Qv(t,n))&&(c&&i&&(Jv(i)||(o=Xv(i)))?(o?(o=!1,a=r&&Xv(r)?r:[]):a=r&&Jv(r)?r:{},Zv(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&Zv(s,{name:n,newValue:i}));return s}));var rb=1/.7,ib="\\s*([+-]?\\d+)\\s*",ob="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ab="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sb=/^#([0-9a-f]{3,8})$/,lb=new RegExp(`^rgb\\(${ib},${ib},${ib}\\)$`),ub=new RegExp(`^rgb\\(${ab},${ab},${ab}\\)$`),cb=new RegExp(`^rgba\\(${ib},${ib},${ib},${ob}\\)$`),db=new RegExp(`^rgba\\(${ab},${ab},${ab},${ob}\\)$`),fb=new RegExp(`^hsl\\(${ob},${ab},${ab}\\)$`),mb=new RegExp(`^hsla\\(${ob},${ab},${ab},${ob}\\)$`),pb={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 hb(){return this.rgb().formatHex()}function gb(){return this.rgb().formatRgb()}function yb(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=sb.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?vb(t):3===n?new Mb(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?bb(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?bb(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=lb.exec(e))?new Mb(t[1],t[2],t[3],1):(t=ub.exec(e))?new Mb(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=cb.exec(e))?bb(t[1],t[2],t[3],t[4]):(t=db.exec(e))?bb(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=fb.exec(e))?kb(t[1],t[2]/100,t[3]/100,1):(t=mb.exec(e))?kb(t[1],t[2]/100,t[3]/100,t[4]):pb.hasOwnProperty(e)?vb(pb[e]):"transparent"===e?new Mb(NaN,NaN,NaN,0):null}function vb(e){return new Mb(e>>16&255,e>>8&255,255&e,1)}function bb(e,t,n,r){return r<=0&&(e=t=n=NaN),new Mb(e,t,n,r)}function xb(e){return e instanceof nb||(e=yb(e)),e?new Mb((e=e.rgb()).r,e.g,e.b,e.opacity):new Mb}function qb(e,t,n,r){return 1===arguments.length?xb(e):new Mb(e,t,n,null==r?1:r)}function Mb(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Sb(){return`#${Nb(this.r)}${Nb(this.g)}${Nb(this.b)}`}function wb(){const e=Db(this.opacity);return`${1===e?"rgb(":"rgba("}${Cb(this.r)}, ${Cb(this.g)}, ${Cb(this.b)}${1===e?")":`, ${e})`}`}function Db(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Cb(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Nb(e){return((e=Cb(e))<16?"0":"")+e.toString(16)}function kb(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Lb(e,t,n,r)}function Ab(e){if(e instanceof Lb)return new Lb(e.h,e.s,e.l,e.opacity);if(e instanceof nb||(e=yb(e)),!e)return new Lb;if(e instanceof Lb)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 Lb(a,s,l,e.opacity)}function Lb(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Eb(e){return(e=(e||0)%360)<0?e+360:e}function Tb(e){return Math.max(0,Math.min(1,e||0))}function Ob(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}eb(nb,yb,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:hb,formatHex:hb,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ab(this).formatHsl()},formatRgb:gb,toString:gb}),eb(Mb,qb,tb(nb,{brighter(e){return e=null==e?rb:Math.pow(rb,e),new Mb(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Mb(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Mb(Cb(this.r),Cb(this.g),Cb(this.b),Db(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:Sb,formatHex:Sb,formatHex8:function(){return`#${Nb(this.r)}${Nb(this.g)}${Nb(this.b)}${Nb(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:wb,toString:wb})),eb(Lb,(function(e,t,n,r){return 1===arguments.length?Ab(e):new Lb(e,t,n,null==r?1:r)}),tb(nb,{brighter(e){return e=null==e?rb:Math.pow(rb,e),new Lb(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Lb(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 Mb(Ob(e>=240?e-240:e+120,i,r),Ob(e,i,r),Ob(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Lb(Eb(this.h),Tb(this.s),Tb(this.l),Db(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=Db(this.opacity);return`${1===e?"hsl(":"hsla("}${Eb(this.h)}, ${100*Tb(this.s)}%, ${100*Tb(this.l)}%${1===e?")":`, ${e})`}`}}));const Ib=Math.PI/180,Pb=180/Math.PI,Rb=4/29,Fb=6/29,jb=3*Fb*Fb;function Hb(e){if(e instanceof zb)return new zb(e.l,e.a,e.b,e.opacity);if(e instanceof Ub)return Wb(e);e instanceof Mb||(e=xb(e));var t,n,r=$b(e.r),i=$b(e.g),o=$b(e.b),a=Bb((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Bb((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Bb((.0139322*r+.0971045*i+.7141733*o)/.82521)),new zb(116*a-16,500*(t-a),200*(a-n),e.opacity)}function zb(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Bb(e){return e>.008856451679035631?Math.pow(e,1/3):e/jb+Rb}function _b(e){return e>Fb?e*e*e:jb*(e-Rb)}function Vb(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function $b(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ub(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Wb(e){if(isNaN(e.h))return new zb(e.l,0,0,e.opacity);var t=e.h*Ib;return new zb(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}eb(zb,(function(e,t,n,r){return 1===arguments.length?Hb(e):new zb(e,t,n,null==r?1:r)}),tb(nb,{brighter(e){return new zb(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new zb(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 Mb(Vb(3.1338561*(t=.96422*_b(t))-1.6168667*(e=1*_b(e))-.4906146*(n=.82521*_b(n))),Vb(-.9787684*t+1.9161415*e+.033454*n),Vb(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),eb(Ub,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Ub)return new Ub(e.h,e.c,e.l,e.opacity);if(e instanceof zb||(e=Hb(e)),0===e.a&&0===e.b)return new Ub(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Pb;return new Ub(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Ub(e,t,n,null==r?1:r)}),tb(nb,{brighter(e){return new Ub(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Ub(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Wb(this).rgb()}}));var Kb,Gb=e=>()=>e;function Yb(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Gb(isNaN(e)?t:e)}function Xb(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function Jb(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Qb)):void 0===t&&(t=Zb);for(var n,r,i,o,a,s=new nx(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new nx(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(tx)}function Zb(e){return e.children}function Qb(e){return Array.isArray(e)?e[1]:null}function ex(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function tx(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function nx(e){this.data=e,this.depth=this.height=0,this.parent=null}!function e(t){var n=function(e){return 1==(e=+e)?Yb: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):Gb(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=qb(e)).r,(t=qb(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Yb(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),nx.prototype=Jb.prototype={constructor:nx,count:function(){return this.eachAfter(Xb)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(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}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(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}(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},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Jb(this).eachBefore(ex)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},Kb=function(e){
14
- /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
15
- e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,d,f=e.length,m=e.search(/[0-9\-\+#]/),p=m>0?e.substring(0,m):"",h=e.split("").reverse().join(""),g=h.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(m,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",y=(d=t[0]).length%l,f=d.length,b=0;b<f;b++)h+=d.charAt(b),!((b-y+1)%l)&&b<f-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},Kb({exports:{}});var rx=7005;const ix=e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==rx},ox=e=>{if(e.qHyperCubeDef.qDimensions.length>1&&1===e.qHyperCubeDef.qMeasures.length){const t=e.qHyperCubeDef.qInterColumnSortOrder.indexOf(0);0!==t&&se.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,t,0)}},ax=(e,t)=>{t>10?1!==e.qHyperCubeDef.qInterColumnSortOrder[0]&&se.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,1,0):0!==e.qHyperCubeDef.qInterColumnSortOrder[0]&&se.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,1,0)},sx=e=>{if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures;1===t.length&&1===n.length&&(n[0].qSortBy.qSortByNumeric=-1,e.qHyperCubeDef.qInterColumnSortOrder.splice(0,e.qHyperCubeDef.qInterColumnSortOrder.length,1,0))},lx=(e,t)=>{const n=e.qHyperCubeDef.qDimensions,r=e.qHyperCubeDef.qMeasures;if(1===n.length&&1===r.length){const r=n[0];return r.qLibraryId?t.getDimension(r.qLibraryId).then((e=>e.getLayout())).then((t=>{if(t&&t.qDimInfos&&t.qDimInfos[0]){const n=t.qDimInfos[0].qCardinal;ax(e,n)}return r})):t.getField(r.qDef.qFieldDefs[0]).then((t=>t.getCardinal().then((t=>(ax(e,t),r)))),(()=>r))}return ox(e),Promise.resolve()};function ux(e){const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures,{color:{mode:r}}=e;t.length>1&&e.color?zh(e,"color.persistent",!0):"byDimension"===r&&n.length>1?zh(e,"color.mode","byMultiple"):"byExpression"===r&&0===n.length?zh(e,"color.mode","primary"):0===t.length&&n.length>0&&(zh(e,"color.byMeasureDef",void 0),zh(e,"color.byDimDef",void 0),1===n.length&&zh(e,"color.mode","primary"))}const cx=(e,t)=>{ux(t),wt(e),Fv.addCallbackCustomTooltip(t)},dx=e=>{ux(e)};function fx({translator:e}){return{dimensions:{min:0,max:e=>e>1?1:2,description(t,n,r,i){let o;const a=null!=i&&i.layout?i.layout.qHyperCube.qDimensionInfo.filter((e=>ix(e))).length:t.qHyperCubeDef.qDimensions.length;return r.isAutoChart&&n>a-1?o="Visualizations.Descriptions.Color":a>1&&0===n?"stacked"===t.barGrouping.grouping?o="Visualizations.Descriptions.Stack":(o="Visualizations.Descriptions.Group",t.qHyperCubeDef.qColumnOrder=[0,1,2]):o="Visualizations.Descriptions.Bars",e.get(o)},add:(e,t,n)=>(t.qHyperCubeDef.qDimensions.length>1&&"stacked"===t.barGrouping.grouping&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),null!=n&&n.app?lx(t,n.app).then((()=>(cx(e,t),e))):(sx(t),cx(e,t),e)),move(e,t,n){const r=n.layout.qHyperCube.qDimensionInfo.filter((e=>ix(e))).length;r>1&&"stacked"===t.barGrouping.grouping&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),ox(t),ux(t),Fv.moveCallbackCustomTooltip(t,e)},remove(e,t){const n=t.qHyperCubeDef.qDimensions;ux(t),1===n.length&&(t.qHyperCubeDef.qMode="S"),Fv.removeCallbackCustomTooltip(t,e)},replace(e,t,n,r){Fv.replaceCallbackCustomTooltip(r,t)}},measures:{min:1,max:e=>e>1?1:15,description:()=>e.get("Visualizations.Descriptions.LengthBars"),add:(e,t,n)=>null!=n&&n.app?lx(t,n.app).then((()=>(e.qSortBy.qSortByNumeric=-1,dx(t),e))):(sx(t),dx(t),e),move(e,t){ox(t),ux(t)},remove(e,t){const n=t.qHyperCubeDef.qDimensions;ux(t),n.length>1&&"stacked"===t.barGrouping.grouping?(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0):1===n.length&&(t.qHyperCubeDef.qMode="S")}}}}function mx(e){return{properties:Cm(),data:{targets:[{path:"/qHyperCubeDef",...fx(e)}]}}}var px={properties_dataPoints_labelmode_share:{id:"properties.dataPoints.labelmode.share",locale:{"en-US":"Share","zh-TW":"佔有率","zh-CN":"份额","tr-TR":"Pay","sv-SE":"Andel","it-IT":"Percentuale","es-ES":"Cuota","de-DE":"Anteil","pl-PL":"Udział","nl-NL":"Aandeel","ko-KR":"공유","pt-BR":"Percentual","fr-FR":"Part","ja-JP":"割合","ru-RU":"Доля"}},Tooltip_selections_locked:{id:"Tooltip.selections.locked",locale:{"en-US":"Selections on this dimension are locked","zh-TW":"已鎖定此維度上的選項","zh-CN":"相关维度的选择已锁定","tr-TR":"Bu boyuttaki seçimler kilitli","sv-SE":"Urval i den här dimensionen är låsta","it-IT":"Le selezioni in questa dimensione sono bloccate","es-ES":"Las selecciones de esta dimensión están bloqueadas.","de-DE":"Auswahlen sind für diese Dimension gesperrt","pl-PL":"Selekcje dotyczące tego wymiaru są zablokowane","nl-NL":"Selecties voor deze dimensie zijn vergrendeld","ko-KR":"이 차원의 선택은 잠겨 있습니다.","pt-BR":"Seleções estão bloqueadas nesta dimensão","fr-FR":"Sélections verrouillées pour cette dimension","ja-JP":"この軸での選択はロックされています","ru-RU":"Выборки для данного измерения заблокированы"}},Tooltip_dimensions_drilldown:{id:"Tooltip.dimensions.drilldown",locale:{"en-US":"Drill-down dimension","zh-TW":"向下探查維度","zh-CN":"下钻维度","tr-TR":"Detaya inme boyutu","sv-SE":"Hierarkisk dimension","it-IT":"Dimensione di drill-down","es-ES":"Dimensión jerárquica","de-DE":"Drilldown-Dimension:","pl-PL":"Wymiar hierarchiczny","nl-NL":"Drill-downdimensie","ko-KR":"드릴다운 차원","pt-BR":"Dimensão da hierarquia","fr-FR":"Descendre dans la hiérarchie de la dimension","ja-JP":"軸のドリルダウン","ru-RU":"Измерение с детализацией"}},Object_ErrorMessage_MissingDimension:{id:"Object.ErrorMessage.MissingDimension",locale:{"en-US":"Dimension not found","zh-TW":"找不到維度","zh-CN":"未找到维度","tr-TR":"Boyut bulunamadı","sv-SE":"Dimensionen hittades inte","it-IT":"Dimensione non trovata","es-ES":"No se ha encontrado la dimensión","de-DE":"Dimension nicht gefunden","pl-PL":"Wymiar nie został znaleziony","nl-NL":"Dimensie niet gevonden","ko-KR":"차원을 찾지 못했습니다.","pt-BR":"Dimensão não encontrada","fr-FR":"Dimension introuvable","ja-JP":"軸が見つかりません","ru-RU":"Измерение не найдено"}},Object_ErrorMessage_MissingMeasure:{id:"Object.ErrorMessage.MissingMeasure",locale:{"en-US":"Measure not found","zh-TW":"找不到量值","zh-CN":"未找到度量","tr-TR":"Hesaplama bulunamadı","sv-SE":"Måttet hittades inte","it-IT":"Misura non trovata","es-ES":"No se ha encontrado la medida","de-DE":"Kennzahl nicht gefunden","pl-PL":"Miara nie została znaleziona","nl-NL":"Meting niet gevonden","ko-KR":"측정값을 찾지 못했습니다.","pt-BR":"Medida não encontrada","fr-FR":"Mesure introuvable","ja-JP":"メジャーが見つかりません","ru-RU":"Мера не найдена"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"en-US":"Currently showing a limited data set.","zh-TW":"目前顯示的是有限的資料集。","zh-CN":"当前正显示有限的数据集。","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","sv-SE":"Just nu visas en begränsad uppsättning data.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","pt-BR":"Mostrando um conjunto de dados limitado.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","ja-JP":"現在、限定的なデータ セットを表示しています。","ru-RU":"В настоящее время отображается ограниченный набор данных."}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"en-US":"The chart is not displayed because it contains only negative or zero values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。","zh-CN":"未显示图表,因为它仅包含负值或零值。","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa eller nollvärden","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","es-ES":"El gráfico no se muestra porque sólo contiene valores negativos o valores cero.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości ujemne lub zerowe.","nl-NL":"De grafiek wordt niet weergegeven omdat het alleen negatieve waarden of nulwaarden bevat.","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения."}},Object_Disclaimer_NegativeOrZeroValues:{id:"Object.Disclaimer.NegativeOrZeroValues",locale:{"en-US":"The data set contains negative or zero values that cannot be shown in this chart.","zh-TW":"資料集包含無法在此圖表中顯示的負值或零值。","zh-CN":"数据集中包含无法在此图表中显示的负值或零值。","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif veya sıfır değerlerini içeriyor.","sv-SE":"Datauppsättningen innehåller negativa värden eller nollvärden som inte kan visas i detta diagram.","it-IT":"La serie di dati contiene valori negativi o uguali a zero che non possono essere visualizzati in questo grafico.","es-ES":"El conjunto de datos contiene valores negativos o cero que no se pueden mostrar en este gráfico.","de-DE":"Die in den Datensätzen enthaltenen negativen oder 0-Werte können nicht in diesem Diagramm dargestellt werden.","pl-PL":"Zestaw danych zawiera wartości ujemne lub zerowe, których nie można przedstawić w tym wykresie.","nl-NL":"De gegevensverzameling bevat negatieve waarden of nulwaarden die niet kunnen worden weergegeven in deze grafiek.","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값 또는 zero 값이 포함되어 있습니다.","pt-BR":"O conjunto de dados contém valores negativos ou iguais a zero que não podem ser mostrados neste gráfico.","fr-FR":"L'ensemble de données contient des valeurs négatives ou égales à zéro impossibles à afficher dans ce graphique.","ja-JP":"データ セットには、本チャートに表示できない負の値またはゼロ値が含まれています。","ru-RU":"Набор данных содержит отрицательные или нулевые значения, которые невозможно показать в этой диаграмме."}},Object_Disclaimer_DataRangeIncludingZero:{id:"Object.Disclaimer.DataRangeIncludingZero",locale:{"en-US":"The logarithmic scale has been replaced by a linear scale because the data range includes zero.","zh-TW":"對數刻度已遭線性刻度取代,因為資料範圍包含零。","zh-CN":"对数刻度已替换为线性刻度,因为该数据范围包括零。","tr-TR":"Veri aralığı sıfır değerini içerdiğinden, logaritmik ölçek yerine doğrusal ölçek kullanıldı.","sv-SE":"Den logaritmiska skalan har ersatts av en linjär skala eftersom dataintervallet innehåller värdet noll.","it-IT":"La scala logaritmica è stata sostituita da una scala lineare perché l'intervallo di dati include zero.","es-ES":"La escala logarítmica ha sido reemplazada por una escala lineal porque el rango de datos incluye cero.","de-DE":"Die logarithmische Skala wurde durch die lineare Skala ersetzt, weil der Datenbereich NULL enthält.","pl-PL":"Skala logarytmiczna została zastąpiona liniową, ponieważ zakres danych zawiera zero.","nl-NL":"De logaritmische schaal is vervangen door een lineaire schaal omdat het gegevensbereik nullen bevat.","ko-KR":"데이터 범위에 0이 포함되어 있으므로 로그 눈금이 선형 눈금으로 바뀌었습니다.","pt-BR":"A escala logarítmica foi substituída por uma escala linear, pois o intervalo de dados inclui zero.","fr-FR":"L'échelle logarithmique a été remplacée par une échelle linéaire, car la plage de données comprend la valeur zéro.","ja-JP":"データ範囲にゼロが含まれるため、Log スケールは Linear スケールで置換されています。","ru-RU":"Логарифмический масштаб заменен линейным масштабом, поскольку диапазон данных включает ноль."}},Object_Disclaimer_NoDataExist:{id:"Object.Disclaimer.NoDataExist",locale:{"en-US":"The selections generated no data for this chart.","zh-TW":"此選項無法產生任何適用於此圖表的資料。","zh-CN":"选择未生成此图表的数据。","tr-TR":"Seçimler bu grafik için hiç veri oluşturmadı.","sv-SE":"Urvalen genererade inga data för detta diagram.","it-IT":"Le selezioni non hanno generato dati per questo grafico.","es-ES":"Las selecciones no han generado datos para este gráfico.","de-DE":"Die Auswahlen haben für dieses Diagramm keine Daten generiert.","pl-PL":"Selekcje nie spowodowały wygenerowania danych dla tego wykresu.","nl-NL":"De selecties hebben geen gegevens voor de grafiek gegenereerd.","ko-KR":"선택 내용으로 해당 차트에 대한 데이터가 생성되지 않았습니다.","pt-BR":"As seleções não geraram dados para este gráfico.","fr-FR":"Les sélections n'ont pas généré de données pour ce graphique.","ja-JP":"このチャートには選択からデータが生成されませんでした。","ru-RU":"В результате выборок данные для этой диаграммы не созданы."}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"en-US":"The chart is not displayed because it contains only undefined values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。","zh-CN":"未显示图表,因为它仅包含未定义的值。","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości niezdefiniowane.","nl-NL":"De grafiek wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения."}},Object_ChartTooltip_NMore:{id:"Object.ChartTooltip.NMore",locale:{"en-US":"+{0} more","zh-TW":"再加 {0} 個","zh-CN":"+{0} 个","tr-TR":"+{0} öğe daha","sv-SE":"+{0} till","it-IT":"Altre +{0}","es-ES":"+{0} más","de-DE":"+{0} mehr","pl-PL":"+ {0} więcej","nl-NL":"+ {0} meer","ko-KR":"+추가 {0}개","pt-BR":"+{0} mais","fr-FR":"+ {0} de plus","ja-JP":"さらに {0}","ru-RU":"+ дополнительно: {0}"}},Object_ChartTooltip_sumOfPositives:{id:"Object.ChartTooltip.sumOfPositives",locale:{"en-US":"Sum of positives","zh-TW":"正數總和","zh-CN":"正值总和","tr-TR":"Pozitif değerlerin toplamı","sv-SE":"Summan av positiva","it-IT":"Somma valori positivi","es-ES":"Suma de positivos","de-DE":"Summe positiver Werte","pl-PL":"Suma dodatnich","nl-NL":"Som positieven","ko-KR":"양수 합계","pt-BR":"Soma de positivos","fr-FR":"Sommes des valeurs positives","ja-JP":"正の合計","ru-RU":"Сумма положительных значений"}},Object_ChartTooltip_sumOfNegatives:{id:"Object.ChartTooltip.sumOfNegatives",locale:{"en-US":"Sum of negatives","zh-TW":"負數總和","zh-CN":"负值总和","tr-TR":"Negatif değerlerin toplamı","sv-SE":"Summan av negativa","it-IT":"Somma valori negativi","es-ES":"Suma de negativos","de-DE":"Summe negativer Werte","pl-PL":"Suma ujemnych","nl-NL":"Som negatieven","ko-KR":"음수 합계","pt-BR":"Soma de negativos","fr-FR":"Somme des valeurs négatives","ja-JP":"負の合計","ru-RU":"Сумма отрицательных значений"}},Object_ChartTooltip_ColorExpression:{id:"Object.ChartTooltip.ColorExpression",locale:{"en-US":"Color expression","zh-TW":"色彩運算式","zh-CN":"颜色表达式","tr-TR":"Renk ifadesi","sv-SE":"Färguttryck","it-IT":"Espressione colore","es-ES":"Expresión de color","de-DE":"Farbformel","pl-PL":"Wyrażenie koloru","nl-NL":"Kleuruitdrukking","ko-KR":"색상 표현식","pt-BR":"Expressão de cor","fr-FR":"Expression de couleur","ja-JP":"カラー表現","ru-RU":"Выражение для цвета"}},Object_Disclaimer_OnlyNanColor:{id:"Object.Disclaimer.OnlyNanColor",locale:{"en-US":"The data used to color this visualization only contains undefined values.","zh-TW":"用以定義此視覺化的色彩的資料只包含未定義的值。","zh-CN":"用于将该可视化着色的数据仅包含未定义的值。","tr-TR":"Bu görselleştirmeyi renklendirmek için kullanılan veriler yalnızca tanımlanmamış değerler içeriyor.","sv-SE":"Data som används för att färgsätta denna visualisering innehåller enbart odefinierade värden.","it-IT":"I dati utilizzati per colorare questa visualizzazione contengono solo valori non definiti.","es-ES":"Los datos utilizados para colorear esta visualización solo contienen valores indefinidos.","de-DE":"Die verwendeten Daten für die Farbgebung dieser Visualisierung enthalten undefinierte Werte.","pl-PL":"Dane używane do kolorowania tej wizualizacji zawierają wyłącznie niezdefiniowane wartości.","nl-NL":"De gegevens die worden gebruikt om deze visualisatie kleur te geven bevatten uitsluitend ongedefinieerde waarden.","ko-KR":"이 시각화에 색을 지정하는 데 사용된 데이터에는 정의되지 않은 값만 포함되어 있습니다.","pt-BR":"Os dados usados para colorir esse visualização contém somente valores indefinidos.","fr-FR":"Les données utilisées pour colorer cette visualisation ne comportent que des valeurs non définies.","ja-JP":"このビジュアライゼーションの色の割り当てに使用したデータには、未定義の値が含まれています。","ru-RU":"Данные, используемые для выбора цвета визуализации, содержат только неопределенные значения."}},properties_trendlines_types_average:{id:"properties.trendlines.types.average",locale:{"en-US":"Average","zh-TW":"平均值","zh-CN":"平均值","tr-TR":"Ortalama","sv-SE":"Medel","it-IT":"Media","es-ES":"Media","de-DE":"Durchschnitt","pl-PL":"Średnia","nl-NL":"Gemiddelde","ko-KR":"평균","pt-BR":"Média","fr-FR":"Moyenne","ja-JP":"平均値","ru-RU":"Среднее"}},properties_trendlines_types_linear:{id:"properties.trendlines.types.linear",locale:{"en-US":"Linear","zh-TW":"線性","zh-CN":"线性","tr-TR":"Doğrusal","sv-SE":"Linjär","it-IT":"Lineare","es-ES":"Lineal","de-DE":"Linear","pl-PL":"Liniowa","nl-NL":"Lineair","ko-KR":"선형","pt-BR":"Linear","fr-FR":"Linéaire","ja-JP":"線形","ru-RU":"Линейный"}},properties_trendlines_types_polynomial2:{id:"properties.trendlines.types.polynomial2",locale:{"en-US":"Second degree polynomial","zh-TW":"第二度多項式","zh-CN":"二次多项式","tr-TR":"İkinci derece polinom","sv-SE":"Polynomial, andra graden","it-IT":"Polinomio di secondo grado","es-ES":"Polinómica de segundo grado","de-DE":"Polynom zweiten Grades","pl-PL":"Wielomianowa drugiego stopnia","nl-NL":"Tweedegraadspolynoom","ko-KR":"2차 다항식","pt-BR":"Polinômio de segundo grau","fr-FR":"Polynomial du 2ème degré","ja-JP":"2 番目の角度の多項式近似","ru-RU":"Полиномиальный второй степени"}},properties_trendlines_types_polynomial3:{id:"properties.trendlines.types.polynomial3",locale:{"en-US":"Third degree polynomial","zh-TW":"第三度多項式","zh-CN":"三次多项式","tr-TR":"Üçüncü derece polinom","sv-SE":"Polynomial, tredje graden","it-IT":"Polinomio di terzo grado","es-ES":"Polinómica de tercer grado","de-DE":"Polynom dritten Grades","pl-PL":"Wielomianowa trzeciego stopnia","nl-NL":"Derdegraadspolynoom","ko-KR":"3차 다항식","pt-BR":"Polinômio de terceiro grau","fr-FR":"Polynomial du 3ème degré","ja-JP":"3 番目の角度の多項式近似","ru-RU":"Полиномиальный третьей степени"}},properties_trendlines_types_polynomial4:{id:"properties.trendlines.types.polynomial4",locale:{"en-US":"Fourth degree polynomial","zh-TW":"第四度多項式","zh-CN":"四次多项式","tr-TR":"Dördüncü derece polinom","sv-SE":"Polynomial, fjärde graden","it-IT":"Polinomio di quarto grado","es-ES":"Polinómica de cuarto grado","de-DE":"Polynom vierten Grades","pl-PL":"Wielomianowa czwartego stopnia","nl-NL":"Vierdegraadspolynoom","ko-KR":"4차 다항식","pt-BR":"Polinômio de quarto grau","fr-FR":"Polynomial du 4ème degré","ja-JP":"4 番目の角度の多項式近似","ru-RU":"Полиномиальный четвертой степени"}},properties_trendlines_types_exponential:{id:"properties.trendlines.types.exponential",locale:{"en-US":"Exponential","zh-TW":"指數","zh-CN":"指数","tr-TR":"Üstel","sv-SE":"Exponentiell","it-IT":"Esponenziale","es-ES":"Exponencial","de-DE":"Exponentiell","pl-PL":"Wykładnicze","nl-NL":"Exponentieel","ko-KR":"지수","pt-BR":"Exponencial","fr-FR":"Exponentiel","ja-JP":"指数","ru-RU":"Экспоненциальный"}},properties_trendlines_types_logarithmic:{id:"properties.trendlines.types.logarithmic",locale:{"en-US":"Logarithmic","zh-TW":"對數","zh-CN":"对数","tr-TR":"Logaritmik","sv-SE":"Logaritmisk","it-IT":"Logaritmica","es-ES":"Logarítmica","de-DE":"Logarithmisch","pl-PL":"Logarytmiczna","nl-NL":"Logaritmisch","ko-KR":"로그","pt-BR":"Logarítmico","fr-FR":"Logarithmique","ja-JP":"対数","ru-RU":"Логарифмический"}},properties_trendlines_types_power:{id:"properties.trendlines.types.power",locale:{"en-US":"Power","zh-TW":"乘冪","zh-CN":"幂","tr-TR":"Üs","sv-SE":"Potens","it-IT":"Potenza","es-ES":"Potencia","de-DE":"Potenz","pl-PL":"Potęgowa","nl-NL":"Macht","ko-KR":"거듭제곱","pt-BR":"Potência","fr-FR":"Puissance","ja-JP":"累乗","ru-RU":"Силовой"}},Common_Measures:{id:"Common.Measures",locale:{"en-US":"Measures","de-DE":"Kennzahlen","fr-FR":"Mesures","it-IT":"Misure","ja-JP":"メジャー","ko-KR":"측정값","es-ES":"Medidas","nl-NL":"Metingen","pl-PL":"Miary","pt-BR":"Medidas","sv-SE":"Mått","tr-TR":"Hesaplamalar","zh-CN":"度量","zh-TW":"量值","ru-RU":"Меры"}},Tooltip_ToggleOnLassoSelection:{id:"Tooltip.ToggleOnLassoSelection",locale:{"en-US":"Turn on lasso selection","de-DE":"Lasso-Auswahl aktivieren","fr-FR":"Activer la sélection au lasso","it-IT":"Attiva selezione lazo","ja-JP":"囲み選択をオンにする","ko-KR":"올가미 선택 켜기","es-ES":"Activar la selección de contorno","nl-NL":"Lassoselectie inschakelen","pl-PL":"Włącz zaznaczenie lasso","pt-BR":"Ativar seleção de laço","sv-SE":"Slå på lassourval","tr-TR":"Serbest seçimi aç","zh-CN":"开启套索选择方法","zh-TW":"開啟套索選取","ru-RU":"Включить выбор лассо"}},Tooltip_ToggleOffLassoSelection:{id:"Tooltip.ToggleOffLassoSelection",locale:{"en-US":"Turn off lasso selection","de-DE":"Lasso-Auswahl deaktivieren","fr-FR":"Désactiver la sélection au lasso","it-IT":"Disattiva selezione lazo","ja-JP":"囲み選択をオフにする","ko-KR":"올가미 선택 끄기","es-ES":"Desactivar la selección de contorno","nl-NL":"Lassoselectie uitschakelen","pl-PL":"Wyłącz zaznaczenie lasso","pt-BR":"Desativar seleção de laço","sv-SE":"Stäng av lassourval","tr-TR":"Serbest seçimi kapat","zh-CN":"关闭套索选择方法","zh-TW":"關閉套索選取","ru-RU":"Выключить выбор лассо"}}};function hx({env:e}){var t,n;const{flags:r}=e,i=null===(t=e.anything)||void 0===t||null===(n=t.sense)||void 0===n?void 0:n.isUnsupportedFeature,o=g();!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(px).forEach((t=>{e.add(px[t])}))}}(e.translator);const a=y(),s=v(),[l,u]=b(),c=x(),d=q(),{qLocaleInfo:f}=d;return M((()=>{u({translator:o,theme:s,embed:a,deviceType:c,localeInfo:f,isUnsupportedFeature:i,flags:r})}),[f,i,o.language(),s.name(),c]),l}function gx(){const[e]=b((()=>Bh())),[t]=b((()=>function(e){var t=km({},e),n={},r={},i=!1,o={get:function(e){return t[e]},set:function(e,o){var a=t[e];!i&&n[e]?t[e]=n[e](o,a):t[e]=o,!i&&r[e]&&r[e](t[e],a)},preventSet:function(e,t){i=!0,o.set(e,t),i=!1},intercept:function(e,t){n[e]=t},onChanged:function(e,t){r[e]=t}};return o}({viewRange:[0,1],scrollOffset:void 0})));return{viewCache:e,viewState:t}}var yx=Object.prototype.hasOwnProperty,vx=Object.prototype.toString,bx=Object.defineProperty,xx=Object.getOwnPropertyDescriptor,qx=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===vx.call(e)},Mx=function(e){if(!e||"[object Object]"!==vx.call(e))return!1;var t,n=yx.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&yx.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||yx.call(e,t)},Sx=function(e,t){bx&&"__proto__"===t.name?bx(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},wx=function(e,t){if("__proto__"===t){if(!yx.call(e,t))return;if(xx)return xx(e,t).value}return e[t]};function Dx(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Cx(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Nx(){}!function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}((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=wx(s,n),s!==(i=wx(t,n))&&(c&&i&&(Mx(i)||(o=qx(i)))?(o?(o=!1,a=r&&qx(r)?r:[]):a=r&&Mx(r)?r:{},Sx(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&Sx(s,{name:n,newValue:i}));return s}));var kx=1/.7,Ax="\\s*([+-]?\\d+)\\s*",Lx="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ex="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Tx=/^#([0-9a-f]{3,8})$/,Ox=new RegExp(`^rgb\\(${Ax},${Ax},${Ax}\\)$`),Ix=new RegExp(`^rgb\\(${Ex},${Ex},${Ex}\\)$`),Px=new RegExp(`^rgba\\(${Ax},${Ax},${Ax},${Lx}\\)$`),Rx=new RegExp(`^rgba\\(${Ex},${Ex},${Ex},${Lx}\\)$`),Fx=new RegExp(`^hsl\\(${Lx},${Ex},${Ex}\\)$`),jx=new RegExp(`^hsla\\(${Lx},${Ex},${Ex},${Lx}\\)$`),Hx={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 zx(){return this.rgb().formatHex()}function Bx(){return this.rgb().formatRgb()}function _x(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Tx.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Vx(t):3===n?new Kx(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?$x(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?$x(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=Ox.exec(e))?new Kx(t[1],t[2],t[3],1):(t=Ix.exec(e))?new Kx(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Px.exec(e))?$x(t[1],t[2],t[3],t[4]):(t=Rx.exec(e))?$x(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Fx.exec(e))?Qx(t[1],t[2]/100,t[3]/100,1):(t=jx.exec(e))?Qx(t[1],t[2]/100,t[3]/100,t[4]):Hx.hasOwnProperty(e)?Vx(Hx[e]):"transparent"===e?new Kx(NaN,NaN,NaN,0):null}function Vx(e){return new Kx(e>>16&255,e>>8&255,255&e,1)}function $x(e,t,n,r){return r<=0&&(e=t=n=NaN),new Kx(e,t,n,r)}function Ux(e){return e instanceof Nx||(e=_x(e)),e?new Kx((e=e.rgb()).r,e.g,e.b,e.opacity):new Kx}function Wx(e,t,n,r){return 1===arguments.length?Ux(e):new Kx(e,t,n,null==r?1:r)}function Kx(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Gx(){return`#${Zx(this.r)}${Zx(this.g)}${Zx(this.b)}`}function Yx(){const e=Xx(this.opacity);return`${1===e?"rgb(":"rgba("}${Jx(this.r)}, ${Jx(this.g)}, ${Jx(this.b)}${1===e?")":`, ${e})`}`}function Xx(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Jx(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Zx(e){return((e=Jx(e))<16?"0":"")+e.toString(16)}function Qx(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new tq(e,t,n,r)}function eq(e){if(e instanceof tq)return new tq(e.h,e.s,e.l,e.opacity);if(e instanceof Nx||(e=_x(e)),!e)return new tq;if(e instanceof tq)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 tq(a,s,l,e.opacity)}function tq(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function nq(e){return(e=(e||0)%360)<0?e+360:e}function rq(e){return Math.max(0,Math.min(1,e||0))}function iq(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Dx(Nx,_x,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:zx,formatHex:zx,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return eq(this).formatHsl()},formatRgb:Bx,toString:Bx}),Dx(Kx,Wx,Cx(Nx,{brighter(e){return e=null==e?kx:Math.pow(kx,e),new Kx(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Kx(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Kx(Jx(this.r),Jx(this.g),Jx(this.b),Xx(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:Gx,formatHex:Gx,formatHex8:function(){return`#${Zx(this.r)}${Zx(this.g)}${Zx(this.b)}${Zx(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Yx,toString:Yx})),Dx(tq,(function(e,t,n,r){return 1===arguments.length?eq(e):new tq(e,t,n,null==r?1:r)}),Cx(Nx,{brighter(e){return e=null==e?kx:Math.pow(kx,e),new tq(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new tq(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 Kx(iq(e>=240?e-240:e+120,i,r),iq(e,i,r),iq(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new tq(nq(this.h),rq(this.s),rq(this.l),Xx(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=Xx(this.opacity);return`${1===e?"hsl(":"hsla("}${nq(this.h)}, ${100*rq(this.s)}%, ${100*rq(this.l)}%${1===e?")":`, ${e})`}`}}));const oq=Math.PI/180,aq=180/Math.PI,sq=4/29,lq=6/29,uq=3*lq*lq;function cq(e){if(e instanceof dq)return new dq(e.l,e.a,e.b,e.opacity);if(e instanceof gq)return yq(e);e instanceof Kx||(e=Ux(e));var t,n,r=hq(e.r),i=hq(e.g),o=hq(e.b),a=fq((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=fq((.4360747*r+.3850649*i+.1430804*o)/.96422),n=fq((.0139322*r+.0971045*i+.7141733*o)/.82521)),new dq(116*a-16,500*(t-a),200*(a-n),e.opacity)}function dq(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function fq(e){return e>.008856451679035631?Math.pow(e,1/3):e/uq+sq}function mq(e){return e>lq?e*e*e:uq*(e-sq)}function pq(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function hq(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function gq(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function yq(e){if(isNaN(e.h))return new dq(e.l,0,0,e.opacity);var t=e.h*oq;return new dq(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Dx(dq,(function(e,t,n,r){return 1===arguments.length?cq(e):new dq(e,t,n,null==r?1:r)}),Cx(Nx,{brighter(e){return new dq(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new dq(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 Kx(pq(3.1338561*(t=.96422*mq(t))-1.6168667*(e=1*mq(e))-.4906146*(n=.82521*mq(n))),pq(-.9787684*t+1.9161415*e+.033454*n),pq(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Dx(gq,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof gq)return new gq(e.h,e.c,e.l,e.opacity);if(e instanceof dq||(e=cq(e)),0===e.a&&0===e.b)return new gq(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*aq;return new gq(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new gq(e,t,n,null==r?1:r)}),Cx(Nx,{brighter(e){return new gq(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new gq(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return yq(this).rgb()}}));var vq,bq=e=>()=>e;function xq(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):bq(isNaN(e)?t:e)}function qq(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function Mq(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=wq)):void 0===t&&(t=Sq);for(var n,r,i,o,a,s=new Nq(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new Nq(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Cq)}function Sq(e){return e.children}function wq(e){return Array.isArray(e)?e[1]:null}function Dq(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Cq(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Nq(e){this.data=e,this.depth=this.height=0,this.parent=null}!function e(t){var n=function(e){return 1==(e=+e)?xq: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):bq(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Wx(e)).r,(t=Wx(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=xq(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),Nq.prototype=Mq.prototype={constructor:Nq,count:function(){return this.eachAfter(qq)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(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}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(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}(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},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Mq(this).eachBefore(Dq)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},vq=function(e){
16
- /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
17
- e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,d,f=e.length,m=e.search(/[0-9\-\+#]/),p=m>0?e.substring(0,m):"",h=e.split("").reverse().join(""),g=h.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(m,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",y=(d=t[0]).length%l,f=d.length,b=0;b<f;b++)h+=d.charAt(b),!((b-y+1)%l)&&b<f-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},vq({exports:{}});const kq="REJECTED",Aq=()=>{},Lq=1e4,Eq={MULTIPLIER:2,MINIMUM:20,MAXIMUM:200},Tq=50,Oq=10,Iq=100;var Pq={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qLeft<=t.qLeft&&n.qLeft+n.qWidth>=t.qLeft+t.qWidth&&n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qMatrix.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qMatrix.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),r=Math.max(0,t.qWidth)-Math.abs(Math.min(0,t.qLeft-e.qArea.qLeft)),i=Math.max(t.qTop,e.qArea.qTop),o=Math.max(t.qLeft,e.qArea.qLeft),a=Math.max(0,i-e.qArea.qTop),s=Math.min(i+n-e.qArea.qTop,e.qArea.qHeight),l=Math.max(0,o-e.qArea.qLeft),u=Math.min(o+r-e.qArea.qLeft,e.qArea.qWidth),c={qArea:{qHeight:s-a,qWidth:u-l,qTop:i,qLeft:o},qMatrix:[]};for(let t=a;t<s;t++)c.qMatrix.push(e.qMatrix[t].slice(l,u));return c},cacheWarden:function({bounds:e={width:0,height:0}}){return{release(t,n){const r=n.qTop-Oq<=t.qTop,i=n.qLeft+n.qWidth+Oq>=t.qLeft+t.qWidth,o=n.qTop+n.qHeight+Oq>=t.qTop+t.qHeight,a=n.qLeft-Oq<=t.qLeft;return r&&t.qTop>0||i&&t.qLeft+t.qWidth<e.width||o&&t.qTop+t.qHeight<e.height||a&&t.qLeft>0}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeData",args:[e,[t]]})}};var Rq={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qData[0].qSubNodes.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qData.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),r=Math.max(t.qTop,e.qArea.qTop),i=Math.max(t.qLeft,e.qArea.qLeft),o=Math.max(0,r-e.qArea.qTop),a=Math.min(r+n-e.qArea.qTop,e.qArea.qHeight),s=e.qData[0].qUp+e.qArea.qHeight+e.qData[0].qDown-r-(a-o),l={qArea:{qHeight:a-o,qWidth:e.qArea.qWidth,qTop:r,qLeft:i},qData:[{...e.qData[0],qUp:r,qDown:s,qSubNodes:[]}]};for(let t=o;t<a;t++)l.qData[0].qSubNodes.push(e.qData[0].qSubNodes[t]);return l},cacheWarden:function({bounds:e={height:0}}){return{release(t,n){const r=n.qTop-Oq<=t.qTop,i=n.qTop+n.qHeight+Oq>=t.qTop+t.qHeight;return r&&t.qTop>0||i&&t.qTop+t.qHeight<e.height}}},request:function({layoutService:e,definitionPath:t}){const n=e.getLayoutValue("dimensionAxis.axisDisplayMode","auto");return e=>{const r={method:"getHyperCubeStackData",args:[t,[e]]};return"auto"===n&&r.args.push(600),r}}};var Fq={contains:function(){return!1},patcher:function(){const e=e=>e;return e.should=()=>!1,e},slicer:function(e){return e},cacheWarden:function(){return{release:()=>!0}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeTreeData",args:[e,[t]]})}};const jq="pages";const Hq="discretePan",zq=10;function Bq({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o}){return{type:"Pan",key:"discrete:pan",options:{event:Hq,pointers:1,threshold:zq,enable(r,i){return this.started===Hq||!i||!(!t.scroll.enabled()||!o.enabled())&&e.componentsFromPoint({x:i.center.x,y:i.center.y}).some((e=>e.key===n))}},events:{[`${Hq}start`](e){e.preventDefault(),this.started=Hq;const t="horizontal"===r.meta.major.orientation?e.deltaX:e.deltaY;this.previousTotalDelta=t<0?-zq:zq},[`${Hq}move`](e){e.preventDefault();const t="horizontal"===r.meta.major.orientation,n=t?e.deltaX:e.deltaY,a=t&&i?-1:1,s=(n-this.previousTotalDelta)*a;this.previousTotalDelta=n,o.scroll(s)},[`${Hq}end`](e){e.preventDefault(),this.started=!1},[`${Hq}cancel`](e){e.preventDefault(),this.started=!1}}}}function _q({chart:e,componentKey:t,actions:n,scroller:r}){return function(i){if(!n.scroll.enabled()||!r.enabled())return;const[o]=e.componentsFromPoint({x:i.clientX,y:i.clientY}).filter((e=>e.key===t));if(!o)return;i.preventDefault();const a=Math.abs(i.deltaY)>Math.abs(i.deltaX)?i.deltaY:i.deltaX,s=Math.sign(-a)*Iq;r.scroll(s)}}function Vq({layoutService:e}){const t=function({layoutService:e}){const t=Math.floor(Lq/(e.meta.dimensionCount+e.meta.measureCount));return function({width:e,height:n}){const r=Math.min(t,Math.max(Eq.MAXIMUM,n));return{width:e,height:Math.max(Eq.MINIMUM,Math.min(n*Eq.MULTIPLIER,r))}}}({layoutService:e}),n={width:e.meta.size.x,height:e.meta.size.y};return function(e){const{width:r,height:i}=t({width:e.qWidth,height:e.qHeight}),o=i?Math.ceil((i-e.qHeight)/2):0,a=r?Math.ceil((r-e.qWidth)/2):0;return{qHeight:i?Math.min(i,n.height):e.qHeight,qWidth:r?Math.min(r,n.width):e.qWidth,qTop:i?Math.max(0,Math.min(e.qTop-o,n.height-i)):e.qTop,qLeft:r?Math.max(0,Math.min(e.qLeft-a,n.width-r)):e.qLeft}}}function $q(e){let t,n;const r=i=>{t=i;const{method:o,args:a}=t.request;e[o](...a).then((e=>{if(t.canceled||n)return t.reject(kq),t=null,void(n&&(r(n),n=null));t.resolve(e[0]),t=null}))},i=e=>new Promise(((i,o)=>{const a={request:e,resolve:i,reject:o,canceled:!1,cancel:()=>{a.canceled=!0}};t?(e=>{n&&n.reject(kq),n=e})(a):r(a)}));return i.isProcessing=()=>!!t,i.hasQueued=()=>!!n,i.cancel=()=>{i.isProcessing()&&t.cancel(),i.hasQueued()&&(n.reject(kq),n=null)},i}const Uq={command:{update:()=>{}}};function Wq({dataStore:e,composition:t,enigmaModel:n,layoutService:r,trendLineModel:i=Uq,definitionPath:o,processDataPage:a}){const{slicer:s,cacheWarden:l,request:u}=t,c=function({dataStore:e,slice:t,warden:n,expand:r,request:i,process:o,connectionless:a,processDataPage:s}){return(l,{onProcessing:u}={})=>{if(e.contains(l)){const r=e.getCurrent();if(a)return Promise.resolve(t(r,l));const i=n.release(r.qArea,l),s=o.isProcessing();if(!i&&s&&o.cancel(),!i||s)return Promise.resolve(t(r,l))}if(a)return Promise.resolve(e.getCurrent());o.isProcessing()&&u&&u();const c=r(l);return o(i(c)).then((n=>(s(n),e.add(n),t(n,l))))}}({dataStore:e,slice:s,warden:l({bounds:{width:r.meta.size.x,height:r.meta.size.y}}),expand:Vq({layoutService:r}),request:u({layoutService:r,definitionPath:o}),process:$q(n),connectionless:r.meta.isSnapshot,processDataPage:a}),d=function(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,o=0;return function(){t=this;for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];n=s;var u=Date.now()-o,c=function(){o=Date.now(),r=0,e.apply(t,n)};r||(u>=i?c():r=setTimeout(c,i-u))}}(((e,{onProcessing:t,onData:n})=>{c(e,{onProcessing:t}).then((e=>n(e))).catch((e=>{if(e!==kq)throw e}))}),Tq);return function(e,{onProcessing:t=Aq,onDataPage:n=Aq}={}){d(e,{onProcessing:t,onData:e=>{r.setDataPages(e?[e]:[]),i.command.update(),n(e)}})}}var Kq={inTotal:function({layoutService:e}){return e.meta.size.x},area:function({layoutService:e}){return{qTop:0,qHeight:1,qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const{pixel:i}=t,o=e.getDataPages()[0],a=i/r;return[a,n.inView>=n.inTotal?a+1:a+o.qArea.qWidth/n.inView]}};var Gq={inTotal:function({layoutService:e}){if(e.meta.isSnapshot&&!e.getLayoutValue("reducedHyperCube")){const[t]=e.getDataPages();if(t)return t.qArea.qHeight}return e.meta.size.y},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:r}){const i=void 0===r?4:r,o=Math.max(0,Math.floor(t)-i/2);return{qTop:o,qHeight:Math.min(e.meta.size.y-o,Math.max(0,Math.ceil(n+i))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const{pixel:i}=t,o=e.getDataPages()[0],a=r/n.inView,s=(i+o.qArea.qTop*a)/r;return[s,n.inView>=n.inTotal?s+1:s+o.qArea.qHeight/n.inView]}};function Yq(e){const{groupSize:t,measureCount:n}=e.meta;return null!=t?t:n}function Xq(e,t){const n=[];for(let r=0;r<e.length;r++){const i=t(e[r]);-1===n.indexOf(i)&&n.push(i)}return n.length}function Jq(e){return Xq(e.qMatrix,(e=>e[0].qElemNumber))-1}var Zq={inTotal:function({layoutService:e}){const t=Yq(e);return e.meta.size.y*t*(1+1/t)-1},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:r}){const i=Yq(e),o=void 0===r?i:r,a=t/(i+1),s=Math.max(0,Math.floor((t-a-o/2)/i));return{qTop:s,qHeight:Math.min(e.meta.size.y-s,Math.max(0,Math.ceil((n+o)/i+1))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const i=Yq(e),o=e.getDataPages()[0],a=r/n.inView,{pixel:s}=t,l=Jq(o),u=o.qArea.qHeight*i+l,c=(s+(o.qArea.qTop*i+o.qArea.qTop)*a)/r;return[c,n.inView>=n.inTotal?c+1:c+u/n.inView]}};const Qq=(e,t)=>t/(e.meta.size.y/e.meta.size.dimensions[0]+1),eM=(e,t)=>{const n={successful:!0,count:0};let r=Math.abs(Math.floor(t));const i=[];for(let t=0;t<=r;t++){if(!e[t])return n.successful=!1,n;const o=e[t][0].qElemNumber;-1===i.indexOf(o)&&(i.push(o),r--)}return n.count=i.length-1,n};function tM(e){return{itemOffset(t,n){if(0!==t.qArea.qTop)return Qq(e,n);const r=eM(t.qMatrix,n);return r.successful?r.count:Qq(e,n)},area(t,n,r){if(0!==t.qArea.qTop)return Qq(e,n);return Xq(t.qMatrix.slice(0,r.qTop+1),(e=>e[0].qElemNumber))-1}}}var nM={inTotal:function({layoutService:e}){return e.meta.size.y+e.meta.size.dimensions[0]-1},area:function({getDataPages:e,layoutService:t,itemOffset:n,inView:r}){const i=tM(t).itemOffset(e(),n),o=Math.max(0,Math.floor(n-i));return{qTop:o,qHeight:Math.min(t.meta.size.y-o,Math.max(0,Math.ceil(r+1))),qLeft:0,qWidth:t.meta.size.x}},scaleRange:function({getDataPages:e,layoutService:t,offsets:n,items:r,viewSize:i,upperBound:o}){const a=t.getDataPages()[0],s=i/r.inView,{item:l,pixel:u}=n,c=tM(t).area(e(),l,a.qArea),d=Jq(a),f=a.qArea.qHeight+d,m=u===o?(r.inView-f)*s/i:(u+(a.qArea.qTop+c)*s)/i;return[m,r.inView>=r.inTotal?m+1:m+f/r.inView]}};function rM({chart:e,rect:t,dockService:n,itemWidths:r,axisKey:i,renderer:o,isGrouped:a,dimensionAxis:s,inTotal:l,isMajorLabelless:u,maxDataRows:c}){const{DEFAULT:d,SQUEEZE:f,LABELLESS:m}=r[n.meta.chart.mode],p="horizontal"===n.meta.major.orientation,{axisDisplayMode:h="auto",maxVisibleItems:g=10,label:y}=s,v=p?t.width:t.height,b=v/l>=f;switch(h){case"max":return Math.min(l,c);case"custom":return Math.min(g,c);default:return u?v/m:b?function({chart:e,isHorizontal:t,axisKey:n,renderer:r={},isGrouped:i,itemSize:o,label:a}){if(i||"auto"!==a&&"tilted"!==a)return!1;const s=e.component(n),{measureText:l}=r;if(!s||!l)return!0;const{fontFamily:u,fontSize:c,tiltAngle:d}=s.settings.settings.labels,{height:f}=l({fontFamily:u,fontSize:c,text:"M"});if(!t)return f>o;const m=(90-d)*(Math.PI/180);return f>Math.cos(m)*o}({chart:e,isHorizontal:p,axisKey:i,renderer:o,isGrouped:a,itemSize:f,label:y})?v/d:l:v/d}}function iM({chart:e,getRect:t,getDataPages:n,layoutService:r,dockService:i,getItemWidths:o,axisKey:a,renderer:s,areaBuffer:l,rtl:u}){const{inTotal:c,area:d,scaleRange:f}=function({layoutService:e}){const{isDimensionless:t,isGrouped:n,isGroupedByMeasure:r}=e.meta;return t?Kq:n?r?Zq:nM:Gq}({layoutService:r}),m=()=>"horizontal"===i.meta.major.orientation?t().width:t().height,p=e=>e?m()/e:0,h=(e,t)=>-(e-t)*p(t);return{getItems(){const n=r.getLayoutValue("dimensionAxis"),l=c({layoutService:r});return{inTotal:l,inView:rM({chart:e,rect:t(),dockService:i,itemWidths:o(),axisKey:a,renderer:s,isGrouped:r.meta.isGrouped,dimensionAxis:n,inTotal:l,isMajorLabelless:"none"===n.show||"title"===n.show,maxDataRows:Math.floor(Lq/(r.meta.dimensionCount+r.meta.measureCount))})}},getItemSize({items:e}){const{inView:t}=e;return p(t)},getOffsets({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t,i=Math.min(0,Math.max(e,h(n,r))),o=r?Math.abs(r*i/m()):0;return{start:{pixel:i,item:o},end:{item:Math.min(o+(r||0),n)}}},getUpperBound({items:e}){const{inTotal:t,inView:n}=e;return h(t,n)},getViewRange({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t;return function({viewSize:e,inTotal:t,inView:n,pixelOffset:r}){const i=e/n*t,o=Math.abs(r)/i;return[o,Math.min(1,o+e/i)]}({viewSize:m(),inTotal:n,inView:r,pixelOffset:e})},getArea:({itemOffset:e,items:t})=>d({getDataPages:n,layoutService:r,itemOffset:e,inView:t.inView,areaBuffer:l}),getScaleRange({offsets:e,items:t}){const o=f({getDataPages:n,layoutService:r,offsets:e,items:t,viewSize:m(),upperBound:h(t.inTotal,t.inView)});return"horizontal"===i.meta.major.orientation&&u?function(e){return[1-e[1],1-e[0]]}(o):o},validate:{offset({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t;return e<=0&&e>=h(n,r)}},convert:{itemToPixelOffset({itemOffset:e,items:t}){const{inView:n}=t,r=e*p(n);return Number.isFinite(r)?-r:0},relativeToPixelOffset({relativeOffset:e,items:t}){const{inTotal:n,inView:r}=t;return-e*(p(r)*n)}}}}function oM({chart:e,componentKey:t,state:n,dataStore:r,pageData:i,layoutService:o,dockService:a,itemWidths:s,getRect:l,axisKey:u,renderer:c,areaBuffer:d,viewState:f,rtl:m}){n.set("rect",{width:0,height:0}),n.set("itemWidths",{}),n.set("itemSize",0),n.set("items",{}),n.set("offsets",{}),n.set("finished",0),n.set("scaleRange",[0,1]);const p=iM({chart:e,getRect:()=>n.get("rect"),getDataPages:r.getCurrent,layoutService:o,dockService:a,getItemWidths:()=>n.get("itemWidths"),axisKey:u,renderer:c,areaBuffer:d,rtl:m}),h=()=>{const e=p.getItems();return n.set("items",e),e},g=({pixelOffset:e,items:t})=>{const r=p.getOffsets({pixelOffset:e,items:t});return n.set("offsets",r),r},y=e=>{const t=Date.now(),r=h(),a=g({pixelOffset:e,items:r}),s=p.getArea({itemOffset:a.start.item,items:r});if((e=>{const[{qArea:t}]=o.getDataPages();return!!t&&Object.keys(e).every((n=>e[n]===t[n]))})(s))return void((p.validate.offset({pixelOffset:e,items:r})||f.get("scrollOffset").start!==a.start.item)&&(n.set("finished",t),n.set("scaleRange",p.getScaleRange({offsets:a.start,items:r})),f.preventSet("viewRange",p.getViewRange({pixelOffset:a.start.pixel,items:r})),f.set("scrollOffset",{start:a.start.item,end:a.end.item})));f.preventSet("viewRange",p.getViewRange({pixelOffset:a.start.pixel,items:r}));const l=()=>{n.get("finished")>t||(n.set("finished",t),n.set("scaleRange",p.getScaleRange({offsets:a.start,items:r})),f.set("scrollOffset",{start:a.start.item,end:a.end.item}))};i(s,{onProcessing:l,onDataPage:l})};return{enabled(){const{inTotal:e,inView:t}=n.get("items");return e>t},itemSize:()=>n.get("itemSize"),scaleRange:()=>n.get("scaleRange"),initialize(){const r=e.component(t);if(!r)return Promise.resolve();n.set("rect","function"==typeof l?l():r.rect),n.set("itemWidths","function"==typeof s?s():s);const a=h();n.set("itemSize",p.getItemSize({items:a}));const u=(({items:e})=>{const t=o.getLayoutValue("scrollStartPos"),n=f.get("scrollOffset");if(void 0===n)return 1===t?p.getUpperBound({items:e}):0;if("number"==typeof n)return p.convert.itemToPixelOffset({itemOffset:n,items:e});const{start:r,end:i}=n,a=1===t&&i?i-e.inView:r;return p.convert.itemToPixelOffset({itemOffset:a,items:e})})({items:a}),c=g({pixelOffset:u,items:a});f.preventSet("viewRange",p.getViewRange({pixelOffset:c.start.pixel,items:a}));const d=p.getArea({itemOffset:c.start.item,items:a});return new Promise((e=>{i(d,{onDataPage:()=>{n.set("scaleRange",p.getScaleRange({offsets:c.start,items:a})),f.preventSet("scrollOffset",{start:c.start.item,end:c.end.item}),e()}})}))},scroll(e){const t=n.get("offsets").start.pixel+e;y(t)},scrollToRelative(e){const t=n.get("items"),r=p.convert.relativeToPixelOffset({relativeOffset:e,items:t});y(r)}}}function aM({chart:e,actions:t,componentKey:n,enigmaModel:r,layoutService:i,dockService:o,trendLineModel:a,itemWidths:s,viewState:l,rtl:u,options:{definitionPath:c="/qHyperCubeDef",getRect:d,axisKey:f,renderer:m,areaBuffer:p,processDataPage:h=(()=>{})}={}}){const g=function(){var e={};return{get:function(t){return e[t]},set:function(t,n){return e[t]=n,n},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}(),y=function({qMode:e}){switch(e){case"S":default:return Pq;case"K":return Rq;case"T":return Fq}}({qMode:i.getHyperCubeValue("qMode")}),v=function({state:e,contains:t}){return e.set(jq,[]),{add:t=>{const n=e.get(jq);n.length=0,n.push(t)},getCurrent:()=>e.get(jq)[0],getAll:()=>e.get(jq),contains:n=>t(e.get(jq)[0],n)}}({state:g,contains:y.contains});!function({layoutService:e,dataStore:t,composition:n}){const r=e.getDataPages()[0];if(!r)return;const i=n.patcher({layoutService:e});i.should(r)&&i(r),t.add(r)}({layoutService:i,dataStore:v,composition:y});const b=function({buffer:e}){return void 0===e?void 0:2*Math.round(e/2)}({buffer:p}),x=Wq({dataStore:v,composition:y,enigmaModel:r,layoutService:i,trendLineModel:a,definitionPath:c,processDataPage:h}),q=oM({chart:e,componentKey:n,state:g,dataStore:v,pageData:x,layoutService:i,dockService:o,itemWidths:s,getRect:d,axisKey:f,renderer:m,areaBuffer:b,viewState:l,rtl:u}),M=function({layoutService:e,dataStore:t}){return function(n){const r=function(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}(n,`${e.refs.dataPages}`);r.length=0,r.push(t.getCurrent())}}({layoutService:i,dataStore:v}),S=function({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o}){return{gestures:[Bq({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o})],native:{type:"native",events:{wheel:_q({chart:e,actions:t,componentKey:n,scroller:o})}}}}({chart:e,actions:t,componentKey:n,dockService:o,rtl:u,scroller:q});return{interactions:S,query:{getCanScroll:()=>q.enabled(),getItemSize:()=>q.itemSize(),getScaleRange:()=>q.scaleRange(),getCurrentDataPage:()=>v.getCurrent()},command:{initialize:()=>q.initialize(),scrollTo:e=>q.scrollToRelative(e),setSnapshotData:e=>M(e)}}}var sM=Object.prototype.hasOwnProperty,lM=Object.prototype.toString,uM=Object.defineProperty,cM=Object.getOwnPropertyDescriptor,dM=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===lM.call(e)},fM=function(e){if(!e||"[object Object]"!==lM.call(e))return!1;var t,n=sM.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&sM.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||sM.call(e,t)},mM=function(e,t){uM&&"__proto__"===t.name?uM(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},pM=function(e,t){if("__proto__"===t){if(!sM.call(e,t))return;if(cM)return cM(e,t).value}return e[t]};function hM(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function gM(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function yM(){}!function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}((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=pM(s,n),s!==(i=pM(t,n))&&(c&&i&&(fM(i)||(o=dM(i)))?(o?(o=!1,a=r&&dM(r)?r:[]):a=r&&fM(r)?r:{},mM(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&mM(s,{name:n,newValue:i}));return s}));var vM=1/.7,bM="\\s*([+-]?\\d+)\\s*",xM="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qM="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",MM=/^#([0-9a-f]{3,8})$/,SM=new RegExp(`^rgb\\(${bM},${bM},${bM}\\)$`),wM=new RegExp(`^rgb\\(${qM},${qM},${qM}\\)$`),DM=new RegExp(`^rgba\\(${bM},${bM},${bM},${xM}\\)$`),CM=new RegExp(`^rgba\\(${qM},${qM},${qM},${xM}\\)$`),NM=new RegExp(`^hsl\\(${xM},${qM},${qM}\\)$`),kM=new RegExp(`^hsla\\(${xM},${qM},${qM},${xM}\\)$`),AM={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 LM(){return this.rgb().formatHex()}function EM(){return this.rgb().formatRgb()}function TM(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=MM.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?OM(t):3===n?new FM(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?IM(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?IM(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=SM.exec(e))?new FM(t[1],t[2],t[3],1):(t=wM.exec(e))?new FM(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=DM.exec(e))?IM(t[1],t[2],t[3],t[4]):(t=CM.exec(e))?IM(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=NM.exec(e))?VM(t[1],t[2]/100,t[3]/100,1):(t=kM.exec(e))?VM(t[1],t[2]/100,t[3]/100,t[4]):AM.hasOwnProperty(e)?OM(AM[e]):"transparent"===e?new FM(NaN,NaN,NaN,0):null}function OM(e){return new FM(e>>16&255,e>>8&255,255&e,1)}function IM(e,t,n,r){return r<=0&&(e=t=n=NaN),new FM(e,t,n,r)}function PM(e){return e instanceof yM||(e=TM(e)),e?new FM((e=e.rgb()).r,e.g,e.b,e.opacity):new FM}function RM(e,t,n,r){return 1===arguments.length?PM(e):new FM(e,t,n,null==r?1:r)}function FM(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function jM(){return`#${_M(this.r)}${_M(this.g)}${_M(this.b)}`}function HM(){const e=zM(this.opacity);return`${1===e?"rgb(":"rgba("}${BM(this.r)}, ${BM(this.g)}, ${BM(this.b)}${1===e?")":`, ${e})`}`}function zM(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function BM(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function _M(e){return((e=BM(e))<16?"0":"")+e.toString(16)}function VM(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new UM(e,t,n,r)}function $M(e){if(e instanceof UM)return new UM(e.h,e.s,e.l,e.opacity);if(e instanceof yM||(e=TM(e)),!e)return new UM;if(e instanceof UM)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 UM(a,s,l,e.opacity)}function UM(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function WM(e){return(e=(e||0)%360)<0?e+360:e}function KM(e){return Math.max(0,Math.min(1,e||0))}function GM(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}hM(yM,TM,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:LM,formatHex:LM,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return $M(this).formatHsl()},formatRgb:EM,toString:EM}),hM(FM,RM,gM(yM,{brighter(e){return e=null==e?vM:Math.pow(vM,e),new FM(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new FM(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new FM(BM(this.r),BM(this.g),BM(this.b),zM(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:jM,formatHex:jM,formatHex8:function(){return`#${_M(this.r)}${_M(this.g)}${_M(this.b)}${_M(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:HM,toString:HM})),hM(UM,(function(e,t,n,r){return 1===arguments.length?$M(e):new UM(e,t,n,null==r?1:r)}),gM(yM,{brighter(e){return e=null==e?vM:Math.pow(vM,e),new UM(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new UM(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 FM(GM(e>=240?e-240:e+120,i,r),GM(e,i,r),GM(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new UM(WM(this.h),KM(this.s),KM(this.l),zM(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=zM(this.opacity);return`${1===e?"hsl(":"hsla("}${WM(this.h)}, ${100*KM(this.s)}%, ${100*KM(this.l)}%${1===e?")":`, ${e})`}`}}));const YM=Math.PI/180,XM=180/Math.PI,JM=4/29,ZM=6/29,QM=3*ZM*ZM;function eS(e){if(e instanceof tS)return new tS(e.l,e.a,e.b,e.opacity);if(e instanceof aS)return sS(e);e instanceof FM||(e=PM(e));var t,n,r=oS(e.r),i=oS(e.g),o=oS(e.b),a=nS((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=nS((.4360747*r+.3850649*i+.1430804*o)/.96422),n=nS((.0139322*r+.0971045*i+.7141733*o)/.82521)),new tS(116*a-16,500*(t-a),200*(a-n),e.opacity)}function tS(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function nS(e){return e>.008856451679035631?Math.pow(e,1/3):e/QM+JM}function rS(e){return e>ZM?e*e*e:QM*(e-JM)}function iS(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function oS(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function aS(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function sS(e){if(isNaN(e.h))return new tS(e.l,0,0,e.opacity);var t=e.h*YM;return new tS(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}hM(tS,(function(e,t,n,r){return 1===arguments.length?eS(e):new tS(e,t,n,null==r?1:r)}),gM(yM,{brighter(e){return new tS(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new tS(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 FM(iS(3.1338561*(t=.96422*rS(t))-1.6168667*(e=1*rS(e))-.4906146*(n=.82521*rS(n))),iS(-.9787684*t+1.9161415*e+.033454*n),iS(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),hM(aS,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof aS)return new aS(e.h,e.c,e.l,e.opacity);if(e instanceof tS||(e=eS(e)),0===e.a&&0===e.b)return new aS(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*XM;return new aS(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new aS(e,t,n,null==r?1:r)}),gM(yM,{brighter(e){return new aS(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new aS(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return sS(this).rgb()}}));var lS,uS=e=>()=>e;function cS(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):uS(isNaN(e)?t:e)}function dS(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}function fS(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function mS(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=hS)):void 0===t&&(t=pS);for(var n,r,i,o,a,s=new vS(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new vS(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(yS)}function pS(e){return e.children}function hS(e){return Array.isArray(e)?e[1]:null}function gS(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function yS(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function vS(e){this.data=e,this.depth=this.height=0,this.parent=null}!function e(t){var n=function(e){return 1==(e=+e)?cS: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):uS(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=RM(e)).r,(t=RM(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=cS(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),vS.prototype=mS.prototype={constructor:vS,count:function(){return this.eachAfter(fS)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(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}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(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}(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},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return mS(this).eachBefore(gS)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},lS=function(e){
18
- /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
19
- e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,d,f=e.length,m=e.search(/[0-9\-\+#]/),p=m>0?e.substring(0,m):"",h=e.split("").reverse().join(""),g=h.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(m,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",y=(d=t[0]).length%l,f=d.length,b=0;b<f;b++)h+=d.charAt(b),!((b-y+1)%l)&&b<f-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},lS({exports:{}});var bS="AVERAGE",xS="LINEAR",qS="POLYNOMIAL2",MS="POLYNOMIAL3",SS="POLYNOMIAL4",wS="EXPONENTIAL",DS="LOG",CS="POWER";function NS({dimValue:e,value:t,qTrendLine:n}){const{qType:r,qCoeff:i}=n,o={x:e,y:i[2]*t**2+i[1]*t+i[0]};switch(r){default:case qS:return o;case MS:return o.y+=i[3]*t**3,o;case SS:return o.y+=i[4]*t**4+i[3]*t**3,o}}var kS={average:function({dimValue:e,qTrendLine:t}){return{x:e,y:t.qCoeff[0]}},linear:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]*t+n.qCoeff[0]}},polynomial2:NS,polynomial3:NS,polynomial4:NS,exponential:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:Math.exp(n.qCoeff[0]+t*n.qCoeff[1])}},log:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]+n.qCoeff[0]*Math.log(t)}},power:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:10**(n.qCoeff[0]+n.qCoeff[1]*Math.log(t)*Math.LOG10E)}}};const AS=500;function LS(e,t){const n=kS[t.qType.toLowerCase()],r=Math.max(1,e/AS);let i=1/0,o=-1/0;for(let a=0;a<e;a+=r){const{y:e}=n({dimValue:null,value:a+1,qTrendLine:t});i=Math.min(e,i),o=Math.max(e,o)}return{min:i,max:o}}const ES=100;function TS(e){return kS[e.qType.toLowerCase()]}function OS(e,t){return e.meta.isContinuous?function(e,t){return{generate:(e,n,r)=>{const i=[],o=TS(e),{min:a,max:s}=t.get("zoom"),l=(s-a)/ES;if(l>0){const t=t=>{const a=o({dimValue:t,value:t,qTrendLine:e});a.layerId=n,a.measureIndex=r,a.dimValue=t,i.push(a)};let u=a;for(let e=a;e<=s;e+=l)t(e),u=e;u!==s&&t(s)}return i},calculate:(e,t)=>TS(e)({dimValue:t,value:t,qTrendLine:e}),findMinMax(e,t){const n=this.generate(t).map((({y:e})=>e));return{min:Math.min(...n),max:Math.max(...n)}}}}(0,t):e.meta.mode.K?function(e){return{generate:(t,n,r)=>{const i=[],o=e.getDataPages()[0],a=o.qData[0].qSubNodes,s=o.qArea.qTop,l=kS[t.qType.toLowerCase()];for(let e=0;e<a.length;e++){const o=a[e],u=l({dimValue:o.qElemNo,value:e+s+1,qTrendLine:t});u.layerId=n,u.measureIndex=r,u.dimValue=o.qText,i.push(u)}return i},findMinMax:LS}}(e):function(e){return{generate:(t,n,r)=>{const i=[],o=e.getDataPages()[0],a=o.qMatrix,s=o.qArea.qTop,l=kS[t.qType.toLowerCase()];for(let e=0;e<a.length;e++){const o=a[e][0],u=e+s+1,c=l({dimValue:o.qElemNumber,value:u,qTrendLine:t});c.layerId=n,c.measureIndex=r,c.dimValue=o.qText,i.push(c)}return i},calculate:(e,t,n)=>(0,kS[e.qType.toLowerCase()])({dimValue:n,value:t,qTrendLine:e}),findMinMax:LS}}(e)}var IS={TYPES:{AVERAGE:"properties.trendlines.types.average",LINEAR:"properties.trendlines.types.linear",POLYNOMIAL2:"properties.trendlines.types.polynomial2",POLYNOMIAL3:"properties.trendlines.types.polynomial3",POLYNOMIAL4:"properties.trendlines.types.polynomial4",EXPONENTIAL:"properties.trendlines.types.exponential",LOG:"properties.trendlines.types.logarithmic",POWER:"properties.trendlines.types.power"},STYLE:{DASHED:"properties.trendlines.style.dashed"},TYPE:"properties.trendlines.type",HEADER:"properties.trendlines",ADD_BUTTON:"properties.trendlines.button.add"},PS={color:"#f93f17",index:9};const{isDark:RS}=St,FS={x:NaN,y:NaN,layerId:NaN,measureIndex:NaN},jS=({layoutService:e,viewState:t,colorModel:n,chart:r,env:i,keys:{colorScale:o},isEnabled:a=(()=>!1)})=>{const{translator:s}=i,l=[FS],u=[],c=[],d=OS(e,t);e.getLayoutValue("qHyperCube.qMeasureInfo",[]).forEach(((e,t)=>{Array.isArray(e.qTrendLines)&&(u.push(...e.qTrendLines),c.push(...e.qTrendLines.map((()=>t))))}));const f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e},n=function(){var e={};return{get:function(t){return e[t]},set:function(t,n){return e[t]=n,n},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}();return function(r){var i=t(r);return n.has(i)?n.get(i):n.set(i,e(r))}}((e=>{const{style:t}=u[e]||{},i=n.settings();if(t.autoColor){if("measure"===i.mode){const t=c[e],n=r.scale(o)(t);return RS(n)?function(e){const t=xt(e);return t.l<30?t.l+=15:t.l<50?t.l+=10:t.l+=5,t.toString()}(n):function(e){const t=xt(e);return t.l-=5,t.toString()}(n)}return n.resolveUIColor(PS)}return t.paletteColor?n.resolveUIColor(t.paletteColor):"none"}));return{query:{hasTrendLines:()=>!!u.length&&a(),getData:()=>l,getStroke:f,getLineDash:e=>{const{style:t}=u[e]||{};return t.lineDash},getLabel:e=>(u[e]||{}).label,getType:e=>{const{qType:t}=u[e]||{};return s.get(IS.TYPES[t])},getMinMax:()=>{let t=1/0,n=-1/0;return u.forEach((r=>{const i=d.findMinMax(e.meta.size.y,r);t=Math.min(i.min,t),n=Math.max(i.max,n)})),{min:t,max:n}},getCalculatedValue:(e,t,n)=>{const r=u[e];return d.calculate(r,t,n)}},command:{update:()=>{l.length=0,u.forEach(((e,t)=>{const n=d.generate(e,t,c[t]);l.push(...n)}))}}}};var HS={source:"trend",extract:{field:"x",props:{minor:{field:"y"},layer:{field:"layerId"},measureIndex:{field:"measureIndex"},dimValue:{field:"dimValue"}}}};const zS=({meta:e})=>e.isContinuous?({scale:e,datum:t})=>e(t.value):e.isGroupedByMeasure?({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2:({scale:e,datum:t})=>e(t.value)+e.bandwidth()/2,BS=(e,{layoutService:t,trendLineModel:n,dockService:r,animationsEnabled:i})=>{if(!n.query.hasTrendLines())return[];const o=(({majorScale:e,minorScale:t},{trendLineModel:n,layoutService:r,dockService:i,animationsEnabled:o})=>{const a=zS(r);return{key:"trend-lines",type:"line",layout:{dock:"center"},data:HS,settings:{connect:!0,orientation:i.meta.major.orientation,coordinates:{major:{scale:e,fn:a},minor:{scale:t},layerId:{ref:"layer"}},layers:{curve:"monotone",line:{strokeWidth:2,stroke:({datum:e})=>n.query.getStroke(e.layer.value),strokeDasharray:({datum:e})=>n.query.getLineDash(e.layer.value)}}},animations:{enabled:o,trackBy:al.nonUpdatingNode.trackBy,compensateForLayoutChanges:al.lines.compensateForLayoutChanges}}})(e,{trendLineModel:n,layoutService:t,dockService:r,animationsEnabled:i}),a=(({majorScale:e,minorScale:t,tooltipOverlay:n="trend-lines-tooltip-overlay"},{layoutService:r,dockService:i})=>{const o=zS(r),a="horizontal"===i.meta.major.orientation,s={scale:e,fn:o},l={scale:t,ref:"minor"};return{key:n,type:"point",layout:{dock:"center"},data:HS,settings:{x:a?s:l,y:a?l:s,opacity:0,size:1,sizeLimits:{maxPx:8,minPx:8}}}})(e,{layoutService:t,dockService:r});return[o,a]};function _S(e,t){const{getLabel:n,getType:r,getLineDash:i,getStroke:o}=t.query;return({node:t,resources:a})=>{const s={type:"icon",style:{stroke:o(t.data.layer.value),"min-width":"16px","vertical-align":"middle","stroke-dasharray":i(t.data.layer.value)}},l={content:[{content:n(t.data.layer.value),style:{"font-weight":"bold"}},{content:r(t.data.layer.value)}],style:{"min-width":"136px"}};return{title:t.data.dimValue.label,row:[s,l,{content:a.formatter(e.formatter)(t.data.minor.value)}]}}}const VS=16,$S=2;function US(e,t){return Array.isArray(t.content)?e("div",{style:{display:"flex","flex-direction":"column"}},t.content.map((t=>e("span",{style:t.style,direction:Se.detectTextDirection(t.content)},t.content)))):"icon"===t.type?function(e){const t=e("line",{x1:"0px",y1:`${VS}px`,x2:`${VS}px`,y2:"0px","stroke-width":"3px"});return e("svg",{xlms:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:`0 0 ${VS} ${VS}`},t)}(e):t.content}function WS(e,t){return({h:n,data:r,style:i})=>{const o=r[0].title,a=r.filter((e=>e.title===o)),s=function(e,t){const n=e("td",{colspan:3,style:{"font-weight":"bold"},direction:Se.detectTextDirection(t)},t);return e("tr",{},n)}(n,o),l=[s];if(a.slice(0,$S).forEach((e=>{l.push(n("tr",{},function(e,{h:t,style:n}){return e.map((e=>{const r={style:{direction:"string"==typeof e.content?Se.detectTextDirection(e.content):void 0,...n.cell||{},...e.style||{}},class:e.class};e.colspan&&(r.colspan=e.colspan);const i=US(t,e);return t("td",r,i)}))}(e.row,{h:n,style:i})))})),r.length>$S){const i=r.length-$S;l.push(...function(e,t,n,r){const i=t?t.get("Object.ChartTooltip.NMore",r):`+${r} more`,o=Se.detectTextDirection(i);return[e("tr",{},e("td",{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:3},"")),e("tr",{},e("td",{style:{"font-weight":"bold","text-align":n?"right":"left",direction:o},colspan:3},i))]}(n,e,t,i))}return l}}function KS(e,{trendLineModel:t,translator:n},r={}){if(!t.query.hasTrendLines())return!1;const{rtl:i}=r,o=be({key:e.tooltip,rtl:i});return Y(!0,o,{settings:{extract:_S(e,t),content:WS(n,i),placement:"pointer",direction:r.rtl?"rtl":"ltr"}})}function GS(e,t){const n=t.element.getBoundingClientRect();return{x:(e.center?e.center.x:e.clientX)-n.left,y:(e.center?e.center.y:e.clientY)-n.top}}function YS(e,{chart:t,viewState:n,trendLineModel:r,layoutService:i,rtl:o}){const{isContinuous:a}=i.meta;let s={components:[{key:e.tooltipOverlay}],propagation:"stop"},l=e=>{const n=GS(e,t);return t.shapesAt(n,s)};if(a){const{getCalculatedValue:i}=r.query;s={components:[{key:"trend-lines"}],propagation:"stop"},l=(r,a)=>{const l=GS(r,t),u=t.shapesAt(function(e){return{cx:e.x,cy:e.y,r:3}}(l),s);if(u.length){const r=function(e,t,n,r){let i=(e.x-t.rect.computed.x)/t.rect.computed.width;i=r?1-i:i;const{min:o,max:a}=n.get("zoom");return o+(a-o)*i}(l,a,n,o),s=t.scale(e.majorInnerScale),c=(null!=s&&s.formatter?s.formatter():t.formatter({data:{fields:["qDimensionInfo/0"]}}))(r);u.forEach((e=>{e.data.dimValue.value=r,e.data.dimValue.label=c,e.data.minor.value=i(e.data.layer.value,r).y}))}return u}}return n=>{const r=t.component(e.tooltip);if(r&&(n=>t.componentsFromPoint({x:n.center?n.center.x:n.clientX,y:n.center?n.center.y:n.clientY}).some((t=>t.key===e.tooltipOverlay)))(n)){const e=l(n,r);return e.length?(r.emit("show",n,{nodes:e}),!0):(r.emit("hide"),!1)}return!1}}const XS=e=>{e.style.dashed?e.style.lineDash="8, 4":e.style.lineDash=""},JS=e=>{XS(e),e.qMultiDimMode="Sum",e.qXColIx=0};function ZS(e={}){const{translator:t,events:n={onGlobalChange:()=>{}},allowStackedByDimension:r=!1}=e;return{show:(e,t,{layout:n})=>!de.dimensionless(n)&&!de.groupedByDimension(n)&&(r||!de.stackedByDimension(n)),type:"array",ref:"qTrendLines",titleTranslation:IS.HEADER,itemTitleRef:e=>{const n=typeof e.label;return"string"===n&&e.label?e.label:"object"===n?e.label.qStringExpression?e.label.qStringExpression.qExpr:e.label.qValueExpression.qExpr:t.get(IS.TYPES[e.qType])},max:8,allowAdd:!0,allowRemove:!0,allowMove:!1,addTranslation:IS.ADD_BUTTON,add:JS,globalChange:e=>{const t=dS(e,"qHyperCubeDef.qMeasures",[]).reduce(((e,t)=>(Array.isArray(t.qTrendLines)&&e.push(...t.qTrendLines),e)),[]),r=(e=>!dS(e,"dimensionAxis.continuousAuto",!1)&&e.preferContinuousAxis)(e)?"Possible":"Never";t.forEach((e=>{e.qContinuousXAxis=r})),n.onGlobalChange(e,t)},items:{label:{ref:"label",type:"string",expression:"optional",translation:"Common.Label",defaultValue:""},type:{ref:"qType",type:"string",component:"dropdown",translation:IS.TYPE,options:[{value:bS,translation:IS.TYPES.AVERAGE},{value:xS,translation:IS.TYPES.LINEAR},{value:qS,translation:IS.TYPES.POLYNOMIAL2},{value:MS,translation:IS.TYPES.POLYNOMIAL3},{value:SS,translation:IS.TYPES.POLYNOMIAL4},{value:wS,translation:IS.TYPES.EXPONENTIAL},{value:DS,translation:IS.TYPES.LOG},{value:CS,translation:IS.TYPES.POWER}],defaultValue:bS},autoColor:{ref:"style.autoColor",type:"boolean",translation:"properties.colors",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},paletteColor:{ref:"style.paletteColor",translation:"properties.color",type:"object",component:"color-picker",dualOutput:!0,defaultValue:PS,show:e=>!e.style.autoColor},dashed:{ref:"style.dashed",translation:IS.STYLE.DASHED,type:"boolean",defaultValue:!0,change:XS}}}}var QS={};function ew(){ew.init.call(this)}QS.isObject=function(e){return"object"==typeof e&&null!==e},QS.isNumber=function(e){return"number"==typeof e},QS.isUndefined=function(e){return void 0===e},QS.isFunction=function(e){return"function"==typeof e};var tw=ew;ew.EventEmitter=ew,ew.prototype._events=void 0,ew.prototype._maxListeners=void 0,ew.defaultMaxListeners=10,ew.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},ew.prototype.setMaxListeners=function(e){if(!QS.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},ew.prototype.emit=function(e){var t,n,r,i,o,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],QS.isUndefined(n))return!1;if(QS.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(QS.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(a=n.slice()).length,o=0;o<r;o++)a[o].apply(this,i)}return!0},ew.prototype.addListener=function(e,t){var n;if(!QS.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,QS.isFunction(t.listener)?t.listener:t),this._events[e]?QS.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,QS.isObject(this._events[e])&&!this._events[e].warned)&&((n=QS.isUndefined(this._maxListeners)?ew.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,QS.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),QS.isFunction(console.trace)&&console.trace()));return this},ew.prototype.on=ew.prototype.addListener,ew.prototype.once=function(e,t){if(!QS.isFunction(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},ew.prototype.removeListener=function(e,t){var n,r,i,o;if(!QS.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||QS.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(QS.isObject(n)){for(o=i;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},ew.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],QS.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},ew.prototype.listeners=function(e){return this._events&&this._events[e]?QS.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},ew.listenerCount=function(e,t){return e._events&&e._events[t]?QS.isFunction(e._events[t])?1:e._events[t].length:0};var nw=H(tw);const rw={shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]};const iw=e=>(Object.keys(nw.prototype).forEach((t=>{e[t]=nw.prototype[t]})),nw.init(e),e);function ow(){const[e]=b({}),[t]=b({}),n=function(){var e,t,n,r;const i=D(),o=g(),a=!(null==i||null===(e=i.qSelectionInfo)||void 0===e||!e.qInSelections),s=!(null==i||null===(t=i.qHyperCube)||void 0===t||null===(n=t.qDimensionInfo)||void 0===n||null===(r=n[0])||void 0===r||!r.qIsOneAndOnlyOne),[l,u]=b(!1),[c,d]=b(!1),[f,m]=b({key:"lasso",enabled:()=>!1,active:()=>!1,action:()=>!1}),p=e=>{d("boolean"==typeof e?e:!c)};return C((()=>(m({key:"lasso",action:p,enabled:()=>l,active:()=>c}),{key:"lasso",label:o.get(c?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),icon:rw,hidden:!l||!a||s,active:c,action:p})),[a,s,c,l,o.language()]),{get:()=>f,setAllows:e=>{u(!!e)}}}(),[r,i]=b();return M((()=>{const r={};r.scroll={key:"scroll",isActive:!0,isEnabled:!0,action(){this.isActive=!this.isActive},active(){return this.isActive},enabled(){const{layoutService:n,discrete:r}=e;return t.allowScroll&&((null==n?void 0:n.meta.isContinuous)||(null==r?void 0:r.query.getCanScroll()))}},r.interact={key:"interact",isEnabled:!0,enabled:()=>t.allowInteract},r.tooltip={key:"tooltip",isActive:!0,isEnabled:!0,action(e){this.isActive=!!e},active(){return this.isActive},enabled:()=>t.allowTooltip},r.select={key:"select",isActive:!1,isEnabled:!0,action(){this.isActive=!this.isActive},active(){return this.isActive},enabled:()=>t.allowSelect},r.lasso=n.get(),Object.keys(r).forEach((e=>iw(r[e]))),i(r)}),[]),M((()=>{r&&n&&(r.lasso={...r.lasso,...n.get()})}),[n]),{get:()=>r,setAllows:e=>{Object.assign(t,e),n.setAllows(null==e?void 0:e.allowSelect)},setContext:t=>{Object.assign(e,t)},destroy:()=>{Object.keys(r).forEach((e=>r[e].removeAllListeners()))}}}var aw={SPARK:{DEFAULT:7,SQUEEZE:7,LABELLESS:7},XSMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},SMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},MEDIUM:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},FULL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20}},sw={SCALE:{MAIN:{MINOR:"minor",MAJOR:"major",MAJOR_INNER:"majorInner",MAJOR_NUM:"majorNum",COLOR:"fill"},REDUCED:{MINOR:"miniMinor",MAJOR:"miniMajor",COLOR:"reducedFill"}},COMPONENT:{BAR:"bar",GHOST_BAR_OOB:"ghost-bar",STACK:"stack",BAR_AXIS:"bar-axis",GROUP_AXIS:"group-axis",BAR_OOB_MAX:"bar-oob-max",BAR_OOB_MIN:"bar-oob-min",STACK_TOTAL_BAR:"stack-total-bar",BASE_TOOLTIP:"tooltip",LEGEND_CAT_TOOLTIP:"legend-cat-tooltip",LEGEND_COLOR_CAT:"legend-color-cat",MEASURE_REF_LINE:"mes-ref-line",DIMENSION_REF_LINE:"dim-ref-line",MEASURE_REF_LINE_LABEL:"mes-ref-line-label",DIMENSION_REF_LINE_LABEL:"dim-ref-line-label",TREND_LINES_TOOLTIP:"trend-lines-tooltip",TREND_LINES_TOOLTIP_OVERLAY:"trend-lines-tooltip-overlay"},COLLECTION:{MAIN:"main-collection",MINI:"mini-collection",MINI_STACK:"mini-stack-collection",MINI_CONTINUOUS:"mini-continuous-collection",STACK_TOTAL:"stack-total-collection"},FORMATTER:{MINOR:"bar",COLOR:"fill"},STYLING:{AXIS:"axis"}};function lw({layout:e}){const t=oe.canBeContinuous(e),n=de.continuous(e),r=de.dimensionless(e);return{canBeContinuous:t,isDiscrete:!n,isContinuous:n,isTime:oe.isTime(n,e),isDimensionless:r,isSimple:de.simple(e),isGrouped:de.grouped(e),isGroupedByMeasure:de.groupedByMeasure(e),isGroupedByDimension:de.groupedByDimension(e),isStacked:de.stacked(e),isStackedByDimension:de.stackedByDimension(e),isStackedByMeasure:de.stackedByMeasure(e),isSnapshot:de.snapshot(e)}}const uw={extractDimsAndNode(e){const t=[];let n;return e.forEach((e=>{if(e.key===sw.COMPONENT.BAR){n=e;const r=jh(e,"data.selectionDimension",!1);r&&(t.push(r.label),r.label!==e.data.label&&t.push(e.data.label))}})),{nodeDims:t,node:n}}};function cw(e,t,n="/qHyperCubeDef"){return{fetch(){return function(e,t,n){return e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).catch(me).then((e=>{var n;const r=t.getHyperCubeValue("qMode"),i=t.getHyperCubeValue("qDimensionInfo"),o="K"===r&&i.length>1&&(null===(n=e[0])||void 0===n?void 0:n.qIsReduced),a=e.slice(),s=t.getHyperCubeValue("qMeasureInfo"),l=o?[]:t.getHyperCubeValue("qColumnOrder");return{reducedCube:{qDataPages:a,qDimensionInfo:i.slice(),qEffectiveInterColumnSortOrder:[1,0],qMeasureInfo:o?[s[0],s[0]]:s.slice(),qStackedDataPages:[],qMode:"S",qHasOtherValues:t.getHyperCubeValue("qHasOtherValues"),qSize:t.getHyperCubeValue("qSize"),qColumnOrder:l}}}))}(e,t,this.settings())},settings(){const e=t.getHyperCubeValue("qDimensionInfo"),r=t.meta.isStacked&&e.length>1?1:0,i=t.getHyperCubeValue("qMeasureInfo");return{path:n,rect:{qTop:0,qLeft:r,qWidth:e.length+i.length+r,qHeight:Math.min(2e3,1e4/(i.length+1))},zoomLevel:-1,filter:"D1"}}}}function dw({enigma:e,layoutService:t,viewModel:n,definitionPath:r,reducedHyperCubePath:i},o={}){const a=cw(e,t,r),s=function(e,t="reducedHyperCube"){return{fetch:()=>Promise.resolve({reducedCube:e.getLayoutValue(t)||e.getHyperCube()})}}(t,i),l=function(e){return{fetch:()=>{const t=e.getHyperCube(),n={...t,qDataPages:t.qDataPages.slice()};return Promise.resolve({reducedCube:n})}}}(t),u=function({layoutService:e}){const{isSnapshot:t,isStackedByDimension:n}=e.meta,r=e=>{e.qDimensionInfo.unshift({key:"dummy-patch-dimension"})};return r.should=e=>t&&n&&1===e.qDimensionInfo.length,r}({layoutService:t}),c={mode:{isReduced:!1}};return{fetch(){if(t.meta.isSnapshot)return s.fetch();if(t.meta.isContinuous)return l.fetch();if(!t.meta.isStacked){if(t.getHyperCubeValue("qSize.qcy",NaN)===t.getHyperCubeValue("qDataPages.0.qArea.qHeight",NaN))return l.fetch()}return a.fetch()},model:()=>c,update(e){var r;u.should(e)&&u(e),c.mode=Y(c.mode,t.meta),c.mode.isReduced=e.qDataPages[0]&&e.qDataPages[0].qIsReduced,c.mode.isStackedByDimension=c.mode.isStacked&&(2===(r=e).qDimensionInfo.length&&2===r.qMeasureInfo.length),c.mode.isStackedByMeasure=c.mode.isStacked&&function(e){return e.qMeasureInfo.length>1&&1===e.qDimensionInfo.length}(e),c.fields={major:c.mode.isStackedByDimension?"qDimensionInfo/"+(e.qDimensionInfo.length-1):n.fields.major,majorGroup:n.fields.majorGroup,minor:c.mode.isStackedByDimension?e.qMeasureInfo.map(((e,t)=>`qMeasureInfo/${t}`)):n.fields.minor},c.scales={major:sw.SCALE.REDUCED.MAJOR,minor:sw.SCALE.REDUCED.MINOR},c.cube=e,o.qDataPages=e.qDataPages},fetchMinMaxData(){if(o.qDataPages)return Promise.resolve(o.qDataPages);let n=a.settings();const r="K"===t.getHyperCubeValue("qMode")?1:n.rect.qHeight;return n=Y(!0,{},n,{rect:{qHeight:r}}),e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).then((e=>e))},setSnapshotData(e){e.reducedHyperCube=c.cube}}}function fw({clearMinor:e,clearLegend:t,clearDiscrete:n,clearContinuous:r,selectionInfo:i}){t({componentName:"legendRangeBrush"}),e({eventName:"measureRange",componentName:"measureRangeBrush"}),n({eventName:"discreteRange",componentName:"discreteRangeBrush",brushName:!1}),"tap"!==i.event&&r({componentName:"continuousRangeBrush",brushName:!1})}const mw=e=>{const t=e.qDimensionInfo.length;for(let n=0;n<t;n++){const r=e.qDimensionInfo[n];if(!(r.qLocked||r.qCardinalities.qHypercubeCardinal<=1&&n<t-1))return n}};function pw({layout:e,defaultAuto:t}){return e.qHyperCube.qDimensionInfo.length>1?{mode:"byDimension",useDimColVal:!0,useBaseColors:"dimension",byDimDef:{activeDimensionIndex:1}}:e.qHyperCube.qMeasureInfo.length>1?{mode:"primary",useBaseColors:"measure",paletteColor:null}:t(e)}function hw({picasso:e,chart:t,environment:n,viewState:r,viewCache:i}){const o=N(),a=k(),s=A(),l=L(),u=E(),c=w(),[d,f]=b(),[m,p]=b(),[h,g]=b(),y=T(),v=ow();return M((()=>{if(!t)return()=>{};const e=v.get(),n=function({chart:e,actions:t,selections:n}){const r=e.scale(sw.SCALE.MAIN.MAJOR);return ov({chart:e,actions:t,selections:n,config:{allowSimultaneous:!0,brushRanges:!0,majorScale:r,selectionActions:{reset(){e.brushSelectionIncludeMax=void 0,t.lasso.active()&&t.lasso.action(!1)},clear:fw},custom:{getActions:()=>t},setBrushAliases({defaultFunc:e,brush:t}){e(),t.addKeyAlias("miniCube/qDimensionInfo/0","qHyperCube/qDimensionInfo/0"),t.addKeyAlias("miniCube/qDimensionInfo/1","qHyperCube/qDimensionInfo/1")}}})}({chart:t,actions:e,selections:u});return p(e),g(n),()=>{n.destroy(),v.destroy()}}),[t]),M((()=>{if(!y)return;const e={allowScroll:!y.active,allowInteract:!y.active,allowTooltip:!y.passive,allowSelect:!y.select&&!y.active};v.setAllows(e)}),[y]),M((()=>{if(!h||!n)return;const{theme:u,translator:d,localeInfo:p,flags:g,embed:y}=n,{direction:b="ltr"}=c,x=Kh({source:o,metaAdditionsFn:lw,experimental:{filter:g.isEnabled("IM_1579_HIDE_DIM_MEA")}});h.setFilteredFields(x.meta.filteredFields);const q=function(e){return e.color.auto?e.qHyperCube.qDimensionInfo.length>1:"byDimension"===e.color.mode&&e.color.byDimDef&&e.color.byDimDef.activeDimensionIndex>-1}(x.getLayout())?Kh({source:x.getLayout()}):void 0,M=function({layout:e,options:t={}}){return!(null==e||!e.snapshotData||t.freeResize)&&{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h}}({layout:o,options:c}),S=function({layoutService:e,viewCache:t,flags:n,options:r}){const i={};return i.fields=function(e){const{meta:t}=e,n={majorGroup:t.isGroupedByDimension?"qDimensionInfo/0":void 0,majorStack:t.isStacked?"qDimensionInfo/0":void 0,major:t.isDimensionless?void 0:"qDimensionInfo/"+(t.dimensionCount-1),majors:e.getHyperCubeValue("qDimensionInfo").map(((e,t)=>`qDimensionInfo/${t}`)),minor:e.getHyperCubeValue("qMeasureInfo").map(((e,t)=>`qMeasureInfo/${t}`))};return n.majorNumeric=`${t.isStackedByDimension?n.majorStack:n.major}:numeric`,n}(e),i.selectionDimensionIdx=mw(e.getHyperCube()),i.isDimensionLocked=t=>e.getHyperCube().qDimensionInfo[t].qLocked,i.selectionDimensionProp=e=>void 0===i.selectionDimensionIdx||void 0!==e&&i.selectionDimensionIdx!==e?{}:{selectionDimension:{field:i.selectionDimensionIdx}},i.animations={enabled:()=>!1!==r.chartAnimations&&!!n.isEnabled("IM_1355_ANIMATIONS_BAR")&&!(i.animations.isPartialUpdating||i.animations.isSizeChanging||i.animations.hasSlicedHats)&&!al.propertiesHaveChanged({viewCache:t,layout:e.getLayout()}),isPartialUpdating:!1,isSizeChanging:!1,hasSlicedHats:!1},i}({layoutService:x,viewCache:i,flags:g,options:c}),w=function(e){var t=e.chart,n=e.layoutService,r=e.config,i=void 0===r?{}:r,o=e.typeConfig,a=void 0===o?{}:o;return("x-y"===a.type?Ih:Fh)({chart:t,layoutService:n,config:i,typeConfig:a})}({chart:t,layoutService:x,config:{logicalSize:M,rtl:"rtl"===b},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0}}),D=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,a=void 0===o?[]:o,s=r.transform,l=void 0===s?[]:s,u=r.extend,c=void 0===u?[]:u,d={theme:t,matrix:fv(a),styles:void 0};return d.styles=pv({theme:t,id:i,transform:l,extend:c,matrix:d.matrix}),{getStyles:function(){return d.styles},getTheme:function(){return d.theme},setTheme:function(e){d.theme=e,d.styles=pv({theme:e,id:i,transform:l,extend:c,matrix:d.matrix})}}}({theme:u,config:{id:"barChart",transform:[["label.value.fontSize",e=>parseInt(e,10)]]}}),C=function({layoutService:e,themeService:t,flags:n}){const r=t.getStyles(),i=t=>n.isEnabled("CLIENT_IM_747")?(e.getLayoutValue("components",[])||[]).find((e=>e.key===t)):void 0;return{axis:{title:{getStyle:()=>{var e,t,n,o,a,s,l,u,c,d,f,m,p;return{fontFamily:null!==(e=null===(t=i("axis"))||void 0===t||null===(n=t.axis)||void 0===n||null===(o=n.title)||void 0===o?void 0:o.fontFamily)&&void 0!==e?e:r.axis.title.fontFamily,fontSize:null!==(a=null===(s=i("axis"))||void 0===s||null===(l=s.axis)||void 0===l||null===(u=l.title)||void 0===u?void 0:u.fontSize)&&void 0!==a?a:r.axis.title.fontSize,color:null!==(c=null===(d=i("axis"))||void 0===d||null===(f=d.axis)||void 0===f||null===(m=f.title)||void 0===m||null===(p=m.color)||void 0===p?void 0:p.color)&&void 0!==c?c:r.axis.title.color}}},label:{getStyle:()=>{var e,t,n,o,a,s,l,u,c,d,f,m,p,h,g,y;return{fill:null!==(e=null===(t=i("axis"))||void 0===t||null===(n=t.axis)||void 0===n||null===(o=n.label)||void 0===o||null===(a=o.name)||void 0===a||null===(s=a.color)||void 0===s?void 0:s.color)&&void 0!==e?e:r.axis.label.name.color,fontSize:null!==(l=null===(u=i("axis"))||void 0===u||null===(c=u.axis)||void 0===c||null===(d=c.label)||void 0===d||null===(f=d.name)||void 0===f?void 0:f.fontSize)&&void 0!==l?l:r.axis.label.name.fontSize,fontFamily:null!==(m=null===(p=i("axis"))||void 0===p||null===(h=p.axis)||void 0===h||null===(g=h.label)||void 0===g||null===(y=g.name)||void 0===y?void 0:y.fontFamily)&&void 0!==m?m:r.axis.label.name.fontFamily}}}},legend:{title:{getStyle:()=>{var e,t,n,o,a,s,l,u,c,d,f,m,p;return{fontFamily:null!==(e=null===(t=i("legend"))||void 0===t||null===(n=t.legend)||void 0===n||null===(o=n.title)||void 0===o?void 0:o.fontFamily)&&void 0!==e?e:r.legend.title.fontFamily,fontSize:null!==(a=null===(s=i("legend"))||void 0===s||null===(l=s.legend)||void 0===l||null===(u=l.title)||void 0===u?void 0:u.fontSize)&&void 0!==a?a:r.legend.title.fontSize,color:null!==(c=null===(d=i("legend"))||void 0===d||null===(f=d.legend)||void 0===f||null===(m=f.title)||void 0===m||null===(p=m.color)||void 0===p?void 0:p.color)&&void 0!==c?c:r.legend.title.color}}},label:{getStyle:()=>{var e,t,n,o,a,s,l,u,c,d,f,m,p;return{fontFamily:null!==(e=null===(t=i("legend"))||void 0===t||null===(n=t.legend)||void 0===n||null===(o=n.label)||void 0===o?void 0:o.fontFamily)&&void 0!==e?e:r.legend.label.fontFamily,fontSize:null!==(a=null===(s=i("legend"))||void 0===s||null===(l=s.legend)||void 0===l||null===(u=l.label)||void 0===u?void 0:u.fontSize)&&void 0!==a?a:r.legend.label.fontSize,color:null!==(c=null===(d=i("legend"))||void 0===d||null===(f=d.legend)||void 0===f||null===(m=f.label)||void 0===m||null===(p=m.color)||void 0===p?void 0:p.color)&&void 0!==c?c:r.legend.label.color}}}},label:{getStyle:()=>{var e,t,n,o,a,s,l,u,c,d,f,m,p,h,g,y,v;return{fill:null!==(e=null===(t=i("label"))||void 0===t||null===(n=t.label)||void 0===n||null===(o=n.value)||void 0===o||null===(a=o.color)||void 0===a?void 0:a.color)&&void 0!==e?e:r.label.value.color,useContrastColor:null===(s=null===(l=i("label"))||void 0===l||null===(u=l.label)||void 0===u||null===(c=u.value)||void 0===c?void 0:c.useContrastColor)||void 0===s||s,fontSize:null!==(d=null===(f=i("label"))||void 0===f||null===(m=f.label)||void 0===m||null===(p=m.value)||void 0===p?void 0:p.fontSize)&&void 0!==d?d:r.label.value.fontSize,fontFamily:null!==(h=null===(g=i("label"))||void 0===g||null===(y=g.label)||void 0===y||null===(v=y.value)||void 0===v?void 0:v.fontFamily)&&void 0!==h?h:r.label.value.fontFamily}}}}}({layoutService:x,themeService:D,flags:g}),N=Cf.model({model:a,layoutService:x,viewCache:i,viewState:r}),k=dw({enigma:a,layoutService:x,viewModel:S});!function({layoutService:e,viewState:t,viewStateOptions:n={}}){const r=e.meta.isSnapshot?e.getLayoutValue("snapshotData.content.chartData",{}):n;t.preventSet("scrollOffset",r.scrollOffset),t.preventSet("legendScrollOffset",r.legendScrollOffset||0),r.zoom&&t.preventSet("zoom",r.zoom)}({layoutService:x,viewState:r,viewStateOptions:null==c?void 0:c.viewState});const A=function({app:e,model:t,translator:n,picasso:r,localeInfo:i,theme:o,continuousDataModel:a,layoutService:s,legendLayoutService:l,reducedDataModel:u}){const{isContinuous:c,isStacked:d}=s.meta,f={main:void 0,mini:{getScales:()=>({}),getColor:()=>e=>e,getDatumProps:()=>({}),getAuxiliarySettings:()=>{}}};return{initialize:()=>{const m=[],{isReduced:p}=u.model().mode,h=c||p||d,g=!c&&(p||d)&&l?l.getHyperCube():void 0,y=g?"legendCube":void 0;return f.main=kh({app:e,model:t,translator:n,picasso:r,layoutService:s,config:{localeInfo:i,auto:pw,key:sw.SCALE.MAIN.COLOR},createConfig:()=>({hc:h?g||s.getHyperCube():u.model().cube,source:h?y:"miniCube",theme:o})}),m.push(f.main.initialize()),c&&(f.mini=kh({app:e,model:t,translator:n,picasso:r,layoutService:s,config:{localeInfo:i,auto:pw,key:sw.SCALE.REDUCED.COLOR},createConfig:()=>({layout:a.getInitialLayout(),hc:a.getInitialCube(),source:"miniCube",theme:o})}),m.push(f.mini.initialize())),Promise.all(m)},getMain:()=>f.main,getMini:()=>f.mini}}({picasso:e,model:a,app:s,translator:d,localeInfo:p,theme:u,continuousDataModel:N,layoutService:x,legendLayoutService:q,reducedDataModel:k}),L=jS({layoutService:x,viewState:r,colorModel:{settings:()=>A.getMain().getSettings(),resolveUIColor:e=>A.getMain().getPaletteColor(e)},chart:t,env:n,keys:{colorScale:sw.SCALE.MAIN.COLOR},isEnabled:()=>!x.meta.isGroupedByDimension&&(!x.meta.isStackedByDimension||g.isEnabled("TRENDLINES_STACKED_DIM"))&&!x.meta.isDimensionless});Uv.attrExpr.updateProperties(a,o);const E=function({layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:Fv,miniChartToken:{},embed:s}}({layout:o,app:s,model:a,picasso:e,chart:t,translator:d,localeInfo:p,embed:y,extractDimsAndNode:uw.extractDimsAndNode});let T;x.meta.isDiscrete&&(T=aM({chart:t,actions:m,componentKey:sw.COMPONENT.BAR,enigmaModel:a,layoutService:x,dockService:w,trendLineModel:L,itemWidths:aw,viewState:r,rtl:"rtl"===b,options:{axisKey:sw.COMPONENT.BAR_AXIS,renderer:e.renderer("svg")()}}));const O=yl({layoutService:x,discreteModel:T}),I=function(e){return{layout:e.getLayout(),keys:{SCALE:{MAIN:{MINOR:sw.SCALE.MAIN.MINOR,MAJOR:sw.SCALE.MAIN.MAJOR}},COMPONENT:{BAR:sw.COMPONENT.BAR,BAR_AXIS:sw.COMPONENT.BAR_AXIS,Y_AXIS:"y-axis",MEASURE_TITLE:"measure-title",DIMENSION_TITLE:"dimension-title"},COLLECTION:{MAIN:sw.COLLECTION.MAIN}}}}(x),P=function(e){var t=e.picassoInstance,n=e.plugins,r=e.pluginArgs,i=void 0===r?{}:r,o={initialized:!1,definitions:[]};return{initialize:function(){return Tm(Am().mark((function e(){var r,a,s,l;return Am().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o.initialized){e.next=2;break}return e.abrupt("return");case 2:return a=Promise.all(n.filter((function(e){return"custom-component"===e.info.type})).map(function(){var e=Tm(Am().mark((function e(n){var r;return Am().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.info.componentName){e.next=2;break}throw new Error("plugin-service: Custom component is missing componentName");case 2:return e.next=4,n.fn(km({},i));case 4:if("object"===Lm(r=e.sent)){e.next=7;break}throw new Error("plugin-service: Custom component needs to be an object");case 7:t.component(n.info.componentName,r);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())),s=Promise.all(n.filter((function(e){return"component-definition"===e.info.type})).map((function(e){return e.fn(km({},i))}))),e.next=6,Promise.all([a,s]);case 6:l=e.sent,o.initialized=!0,(r=o.definitions).push.apply(r,Rm(l[1]));case 9:case"end":return e.stop()}}),e)})))()},extendComponents:function(e){return o.initialized?(o.definitions.filter(Boolean).forEach((function(t){var n=Pm(e.filter((function(e){return e.key&&e.key===t.key})),1)[0];if(n){var r=Km(!0,{},n.brush);Km(!0,n,t),t.brush&&(n.brush=function(e,t){return"object"===Lm(e)&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=Gh({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=Gh({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(r,t.brush))}else e.push(t)})),e):e}}}({picassoInstance:e,plugins:l||[],pluginArgs:I});v.setContext({discrete:T,layoutService:x}),f({discrete:T,continuous:Cf,legendLayoutService:q,layoutService:x,viewModel:S,dockService:w,themeService:D,styleService:C,continuousDataModel:N,reducedDataModel:k,colorService:A,trendLineModel:L,refLineModel:O,pluginService:P,customTooltipModel:E,selectionService:h,logicalSize:M})}),[h,c,n,o]),d}function gw(e){return e.qIsOtherCell||-3===e.qElemNumber||-3===e.qElemNo}function yw(e){return e.some(gw)}function vw(e,t){let n=NaN,r=NaN;return e.forEach((e=>{yw(e)||e.slice(-t).forEach((e=>{"NaN"!==e.qNum&&(n=Number.isNaN(n)?e.qNum:Math.min(e.qNum,n),r=Number.isNaN(r)?e.qNum:Math.max(e.qNum,r))}))})),{min:n,max:r}}function bw(e){let t=NaN,n=NaN;if(!e.getLayoutValue("measureAxis.autoMinMax",!1)){const r=e.getLayoutValue("measureAxis.minMax");"min"!==r&&"minMax"!==r||(t=+e.getLayoutValue("measureAxis.min")),"max"!==r&&"minMax"!==r||(n=+e.getLayoutValue("measureAxis.max"))}return{min:t,max:n,isExplicitMin:!Number.isNaN(t),isExplicitMax:!Number.isNaN(n)}}function xw(e,t){let n=NaN,r=NaN;return e.forEach((e=>{if(!yw(e)){let i=0,o=0;e.slice(-t).forEach((e=>{"NaN"!==e.qNum&&(e.qNum>=0?o+=e.qNum:i+=e.qNum)})),n=Number.isNaN(n)?i:Math.min(i,n),r=Number.isNaN(r)?o:Math.max(o,r)}})),{min:n,max:r}}function qw(e,t){const n={};e.forEach((e=>{if(!yw(e)){const r=e[0].qElemNumber;n[r]=n[r]?n[r]:{min:0,max:0,cId:r},e.slice(t).forEach((e=>{"NaN"!==e.qNum&&(e.qNum>=0?n[r].max+=e.qNum:n[r].min+=e.qNum)}))}}));let r=NaN,i=NaN;return Object.keys(n).forEach((e=>{r=Number.isNaN(r)?n[e].min:Math.min(n[e].min,r),i=Number.isNaN(i)?n[e].max:Math.max(n[e].max,i)})),{min:r,max:i}}function Mw(e){return"number"==typeof e&&!Number.isNaN(e)}function Sw(e){const t=e.getHyperCubeValue("qMeasureInfo");return{min:Math.min(...t.filter((e=>Mw(e.qMin))).map((e=>e.qMin))),max:Math.max(...t.filter((e=>Mw(e.qMax))).map((e=>e.qMax)))}}function ww(e,t,n){for(let n=e.length-1;n>-1;n--)if(t(e[n]))return e[n];return n}function Dw(e){return!Number.isNaN(+e.qNum)}function Cw(e){return e.qNum}function Nw(e){return!Number.isNaN(+e.qNum)}function kw(e){return e.qNum}function Aw(e,t){return e.push(...t),e}const{getValueWithOffset:Lw,isNumber:Ew}=ia,Tw=5,Ow=.2;function Iw(e,t){return Math.abs(e/t)<Tw||0===t}function Pw({layoutService:e,trendLineModel:t},n={}){const{stackedByMeasureExtractor:r=xw,stackedByDimensionExtractor:i=qw,straightExtractor:o=vw,measureInfoExtractor:a=Sw,explicitExtractor:s=bw}=n,{meta:l}=e;return{extract({qDataPages:e,qStackedDataPages:n,others:r,count:i}){let o,a;if(Array.isArray(n)?({min:o,max:a}=this.extractFromStacked(n)):({min:o,max:a}=this.extractFromStraight(e,i)),t.query.hasTrendLines()){const{min:e,max:n}=t.query.getMinMax();o=Number.isFinite(e)?Math.min(o,e):o,a=Number.isFinite(n)?Math.max(a,n):a}const{min:s,max:l}=this.extractOthers(r),u=this.extractExplicit(),c=[0,o,a].filter((e=>Ew(e)));let d=Math.min(...c),f=Math.max(...c);d=Iw(s,d)?Math.min(d,s):d,f=Iw(l,f)?Math.max(f,l):f;const m=[u.explicitMin,u.explicitMax,d,f].filter((e=>Ew(e)));return o=Number.isNaN(u.explicitMin)?Math.min(...m):u.explicitMin,a=Number.isNaN(u.explicitMax)?Math.max(...m):u.explicitMax,o===a&&(Number.isNaN(u.explicitMin)?o=Lw(o,-Ow):Number.isNaN(u.explicitMax)&&(a=Lw(a,Ow))),{min:o,max:a,implicitMin:d,implicitMax:f,otherMin:s,otherMax:l,hasOtherMin:s<o,hasOtherMax:l>a,...u}},extractExplicit(){const{min:t,max:n,isExplicitMin:r,isExplicitMax:i}=s(e);return{hasExplicitMinMax:r||i,hasExplicitMin:r,hasExplicitMax:i,explicitMin:t,explicitMax:n}},extractFromStacked(e){const t=e.length?e[0].qData:[];return(n=t).length?{min:Math.min(...n[0].qSubNodes.map((e=>e.qMinNeg))),max:Math.max(...n[0].qSubNodes.map((e=>e.qMaxPos)))}:{min:0,max:0};var n},extractFromStraight(t,n){const s=t.length?t[0].qMatrix:[];return l.isStackedByMeasure?r(s,n):l.isStackedByDimension?i(s,n):e.getHyperCubeValue("qHasOtherValues")?o(s,n):a(e)},extractOthers:e=>l.isStackedByDimension?function(e){const t=ww(jh(e,"0.qData.0.qSubNodes",[]),gw,{qMaxPos:0,qMinNeg:0});return{min:t.qMinNeg,max:t.qMaxPos}}(e):l.isGroupedByDimension?function(e){const t=jh(e,"0.qMatrix",[]).filter(yw).reduce(Aw,[]).filter(Nw).map(kw);return{min:Math.min(0,...t),max:Math.max(0,...t)}}(e):function(e){const t=ww(jh(e,"0.qMatrix",[]),yw,[]).filter(Dw).map(Cw);return{min:Math.min(0,...t),max:Math.max(0,...t)}}(e)}}function Rw(e){const t=function({reducedDataModel:e,layoutService:t,continuousDataModel:n}){const{meta:r,getHyperCubeValue:i}=t,o=e=>!e.length&&r.mode.K,a=e=>{const t=i("qStackedDataPages",[]);return{qStackedDataPages:t,others:e?t:[]}};return{resolve(){const t=i("qMeasureInfo").length,s=i("qDimensionInfo").length,l=i("qHasOtherValues");if(!r.isStacked&&!l)return Promise.resolve({qDataPages:[{}],count:t});if(r.isContinuous){const e=r.isStackedByDimension?s:t;return n.fetchMinMaxData().then((t=>({qDataPages:t,count:e})))}const u=r.isStackedByDimension?1:t;return e.fetchMinMaxData().then((e=>{if(o(e))return a(l);let t=[];return l&&(t=r.mode.K?i("qStackedDataPages",[]):i("qDataPages",[])),{qDataPages:e,count:u,others:t}}))}}}(e),n=Pw(e);return t.resolve().then((e=>n.extract(e)))}const Fw=({key:e,components:t})=>({key:e,type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:t},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}}),jw="lasso",Hw=({key:e,componentTargetKey:t,requireFailure:n,recognizeWith:r},i)=>({key:`event:${e}`,type:"Pan",requireFailure:n,recognizeWith:r,options:{event:jw,enable(e,n){if(this.started===jw||!n)return!0;if(!i.actions.select.enabled()||!i.actions.lasso.enabled()||!i.actions.lasso.active())return!1;return this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter((e=>e.key===t)).length>0}},events:{lassostart(t){t.preventDefault(),this.started!==jw&&(i.actions.select.emit("start",jw),this.chart.component(e).emit("lassoStart",t),this.started=jw)},lassomove(t){t.preventDefault(),this.chart.component(e).emit("lassoMove",t),"function"==typeof i.updateOnMove&&i.updateOnMove(this.chart)},lassoend(t){t.preventDefault(),this.started=!1,this.chart.component(e).emit("lassoEnd",t),i.actions.select.emit("end",jw),"function"==typeof i.updateOnEnd&&i.updateOnEnd()}}});const zw=({targets:e,requireFailure:t,recognizeWith:n,components:r,eventName:i="tap"},o)=>{let a;const s=o.customTooltipModel?o.customTooltipModel.utils:void 0,l=s?o.debouncer(s.displayTooltip,s.DEBOUNCE_THRESHOLD):void 0;return{key:"event:tap",type:"Tap",requireFailure:t,recognizeWith:n,options:{event:i,interval:10,pointers:1,enable(t,n){return!n||!(!o.actions.select.enabled()&&!o.actions.tooltip.enabled())&&(a=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter((t=>-1!==e.indexOf(t.key))),a.length>0)}},events:{[i](t){t.preventDefault();const n=function(e,t){const n=t.element.getBoundingClientRect();let r,i;return e.center?(({x:r}=e.center),({y:i}=e.center)):(r=e.clientX,i=e.clientY),{x:r-n.left,y:i-n.top}}(t,this.chart),u=o.hitRadius?o.hitRadius(a):0,c=u>0?{cx:n.x,cy:n.y,r:u}:n,d=o.shapesAt?o.shapesAt(c):this.chart.shapesAt(c,{components:e.map((e=>({key:e,propagation:"stop"}))),propagation:"stop"}),f=this.chart.component("tooltip"),m="mouse"!==t.pointerType&&f&&f.show;if(!o.isLocked(a)&&!o.tooltipOnly&&o.actions.select.enabled()){const e=this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}),n=e.some((e=>"legend-cat"===e.type));if(!d.length&&n||(this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1,o.actions.select.emit("start",i,e)),d.length&&r){this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1;const e="function"==typeof r?r(t,d):r;this.chart.brushFromShapes(d,{components:e}),o.actions.select.emit("end",i),(({largeDataService:e,chart:t})=>{((null==e?void 0:e.meta)||{}).isLargeNumPoints&&t.brush("lazySelection")._state(t.brush("selection")._state())})({largeDataService:o.largeDataService,chart:this.chart})}}if(f&&o.actions.tooltip.enabled())if(d.length){const{customTooltipModel:e}=o;if(null!=e&&e.useCustomTooltip&&s.checkIfPromisesExist({customTooltipModel:e})){const n=s.getNodes(t,this.chart);l(t,f,{nodes:n,opts:o,customTooltipModel:e})}else f.emit("show",t,{nodes:d})}else m&&f.emit("hide")}}}};const Bw=({key:e,requireFailure:t,recognizeWith:n,eventName:r="tap"},i)=>({prio:1,key:`event:${e}-tap`,type:"Tap",requireFailure:t,recognizeWith:n,options:{event:`${r}-${e}-tap`,interval:10,pointers:1,enable:(t,n)=>!!n&&(!!i.actions.select.enabled()&&(!(!n.target||"INPUT"!==n.target.nodeName)||!(!n.target||!n.target.hasAttribute("data-other-value"))&&(n.target.getAttribute("data-key")||"").split("-bubble")[0]===e))},events:{[`${r}-${e}-tap`](t){(t.target.getAttribute("data-key")||"").split("-bubble")[0]&&(t.preventDefault(),this.chart.component(e).emit("bubbleStart",t))}}});const _w=({eventName:e,key:t,fillTargets:n=[],requireFailure:r,recognizeWith:i},o,a)=>({key:`event:${t}`,type:"Pan",requireFailure:r,recognizeWith:i,options:{event:e,enable(r,i){if(this.started===e||!i)return!0;if(!o.actions.select.enabled())return!1;const a=this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter((e=>-1!==n.indexOf(e.key))),s=0===a.length&&function(e,t){const{target:n}=e.srcEvent;return!(!n||0!==(n.getAttribute("data-key")||"").indexOf(`${t}-`))}(i,t);return s?(this.started=e,!0):a.length>0}},events:{[`${e}start`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),o.actions.select.emit("start",e),this.chart.component(t).emit(`${a}Start`,n),this.started=e},[`${e}move`](e){e.preventDefault(),this.chart.component(t).emit(`${a}Move`,e),"function"==typeof o.updateOnMove&&o.updateOnMove(this.chart)},[`${e}end`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),this.chart.component(t).emit(`${a}End`,n),o.actions.select.emit("end",e),this.started=!1,"function"==typeof o.updateOnEnd&&o.updateOnEnd()}}});function Vw(e,t){const n=function(e){const{key:t,targets:n,fillTargets:r,targetSelector:i,targetFillSelector:o,dock:a,scale:s,bubblesPlacement:l="inside",observeBrush:u=!1,multiple:c=!1,toLabel:d,onEdited:f}=e;return{key:t,type:"brush-range",layout:{dock:n.map((e=>`@${e}`)).join(",")},on:f?{bubbleEnd(){f()}}:{},settings:{brush:u?{context:"selection",observe:!0}:"selection",scale:s,multiple:c,direction:"left"===a||"right"===a?"vertical":"horizontal",bubbles:{align:"left"===a||"top"===a?"end":"start",placement:l,label:d},target:{components:r,selector:i,fillSelector:o,fill:"rgba(82,204,82,0.2)"}}}}(e),r=_w(e,t,"range");return{interactions:[e.onEdited?Bw(e,t):null,r].filter(Boolean),components:[n]}}const $w={refLines:{minimumLayoutMode:"SPARK"},measureAxisTitle:{minimumLayoutMode:"XSMALL"},dimensionAxisTitle:{minimumLayoutMode:"XSMALL"},measureAxis:{minimumLayoutMode:"XSMALL"},dimensionAxis:{minimumLayoutMode:"XSMALL"},gridLines:{minimumLayoutMode:"XSMALL"},refLinesLabels:{minimumLayoutMode:"SMALL"},horizontalDimensionAxis:{minimumLayoutMode:{width:"XSMALL",height:"SMALL"}},verticalDimensionAxis:{minimumLayoutMode:{width:"SMALL",height:"XSMALL"}},horizontalDimensionAxisTitle:{minimumLayoutMode:{width:"XSMALL",height:"MEDIUM"}},verticalDimensionAxisTitle:{minimumLayoutMode:{width:"MEDIUM",height:"XSMALL"}}},Uw="inner-time-axis",Ww="outer-time-axis";const Kw={getMaxGlyphCount(e,t){const{qDimensionInfo:n}=e,{qApprMaxGlyphCount:r}=n[t];return r},getDimensionSize(e){var t;const n=null==e||null===(t=e.qCardinalities)||void 0===t?void 0:t.qHypercubeCardinal,{qLocked:r=0,qOption:i=0,qSelected:o=0}=(null==e?void 0:e.qStateCounts)||{};return[void 0,0].includes(n)?r+i+o:n}},Gw={getMajorAxisMaxGlyphCount(e,t){let n=0;if(e.qDimensionInfo.length){const r=t?0:e.qDimensionInfo.length-1;n=Kw.getMaxGlyphCount(e,r)}else e.qMeasureInfo.forEach((e=>{n=Math.max(n,e.qFallbackTitle.length)}));return n},getAxisData(e,t){let n;return n=e.qDimensionInfo.length?jh(e,t?"qStackedDataPages.0.qData.0.qSubNodes":"qDataPages.0.qMatrix"):e.qMeasureInfo,n},getBarAxisMaxGlyphCount(e,t){if(!e)return;const n=Gw.getAxisData(e,t),r=!e.qDimensionInfo.length,i=r||t?void 0:e.qDimensionInfo.length-1,o=Gw.getMajorAxisMaxGlyphCount(e,t),a=r?"qFallbackTitle":"qText";return ge.getAdjustedMaxGlyphCount(o,n,i,a)},getGroupAxisMaxGlyphCount(e){if(!e)return;const t=Gw.getAxisData(e),n=Kw.getMaxGlyphCount(e,0);return ge.getAdjustedMaxGlyphCount(n,t,0)}};var Yw={LOWERGLYPHCOUNT:3,UPPERGLYPHCOUNT:13};function Xw(e,t,n,r){const{meta:i}=t.layoutService,o=[],a=!("none"===e.measureAxis.show),s=!("title"===e.measureAxis.show);i.isContinuous?o.push(...function(e,t,n,r){const{meta:i}=t.layoutService,{axis:o,grid:a}=t.themeService.getStyles(),s=t.styleService.axis.label.getStyle(),{auto:l,spacing:u}=t.layoutService.getLayoutValue("gridLine",{}),c=[],d="none"!==e.dimensionAxis.show&&"title"!==e.dimensionAxis.show,f=$w[`${t.dockService.meta.major.orientation}DimensionAxis`].minimumLayoutMode,m={type:"grid-line",x:{},layout:{minimumLayoutMode:$w.gridLines.minimumLayoutMode},ticks:{stroke:a.line.major.color},minorTicks:{show:!1,stroke:a.line.minor.color},animations:{enabled:t.viewModel.animations.enabled,trackBy:al.lines.trackBy,compensateForLayoutChanges:al.lines.compensateForLayoutChanges}},p=!!e.showMiniChartForContinuousAxis&&{type:"range",key:"range-brush-highlighter",layout:{dock:"@scrollbar"},settings:{scale:t.reducedDataModel.scales.major,brush:"selection",fill:"#6CB33F",opacity:.2}};if(i.isTime){if(d){const e=n?"end":"start",r=n?1:0,i="bottom"===t.dockService.meta.major.dock?0:1,a={label:{fill:s.fill,fontSize:s.fontSize,fontFamily:s.fontFamily},majorGuideLine:{stroke:o.line.major.color},minorGuideLine:{stroke:o.line.minor.color}},d={type:"time-axis",renderer:"svg",layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:f},preferredSize:()=>({size:2*parseFloat(s.fontSize),edgeBleed:{left:1,right:1}}),settings:{anchor:e,label:{align:i,justify:r},guideLine:{major:{justify:r},minor:{align:i}}},style:a,animations:{enabled:t.viewModel.animations.enabled,trackBy:al.axes.trackBy({isTime:!0}),compensateForLayoutChanges:al.axes.compensateForLayoutChanges({isTime:!0})}};c.push(Y(!0,{},d,{key:Uw,scale:sw.SCALE.MAIN.MAJOR_INNER,settings:{guideLine:{minor:{show:!0}},line:{show:!l&&0===u}},style:Y(!0,{},a,{line:{stroke:o.line.major.color},majorGuideLine:{stroke:o.line.minor.color},minorGuideLine:{stroke:o.line.major.color}})})),c.push(Y(!0,{},d,{key:Ww,scale:sw.SCALE.MAIN.MAJOR,settings:{guideLine:{minor:{show:!1}},line:{show:!1}}})),c.push({type:"axis-overlay",key:"outer-axis-overlay",scale:sw.SCALE.MAIN.MAJOR,layout:{dock:`@${Ww}`,minimumLayoutMode:f}}),c.push({type:"axis-overlay",key:"inner-axis-overlay",scale:sw.SCALE.MAIN.MAJOR_INNER,layout:{dock:`@${Uw}`,minimumLayoutMode:f}}),c.push(p)}return c.push(Y(!0,{},m,{key:"inner-time-grid",x:{scale:sw.SCALE.MAIN.MAJOR_INNER},ticks:{stroke:a.line.minor.color}})),c.push(Y(!0,{},m,{key:"outer-time-grid",x:{scale:sw.SCALE.MAIN.MAJOR}})),c}if(i.isContinuous){const e="continuous-axis";d&&(c.push({type:"axis",key:e,scale:sw.SCALE.MAIN.MAJOR,layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:f},settings:{labels:{align:0,offset:4,fill:s.fill,fontSize:s.fontSize,fontFamily:s.fontFamily},ticks:{show:!0,stroke:o.line.major.color},line:{show:!r},minorTicks:{show:!1}},animations:{enabled:t.viewModel.animations.enabled,trackBy:al.axes.trackBy({isContinuous:!0}),compensateForLayoutChanges:al.axes.compensateForLayoutChanges({isContinuous:!0})}}),c.push({type:"axis-overlay",key:"inner-axis-overlay",scale:sw.SCALE.MAIN.MAJOR,layout:{dock:`@${e}`,minimumLayoutMode:f}}),c.push(p)),c.push(Y(!0,{},m,{key:"continuous-grid",x:{scale:sw.SCALE.MAIN.MAJOR},minorTicks:{show:!0}}))}return c}(e,t,n,r)):o.push(...function(e,t,n,r){if("none"===e.dimensionAxis.show)return[];const{meta:i}=t.layoutService,o=t.themeService.getStyles(),a=[],s=function(e,t){return!t.layoutService.meta.isGroupedByDimension||!e.legend.show||t.colorService.getMain().getSettings().field!==t.viewModel.fields.major}(e,t),l=function(e,t){return!(!t.layoutService.meta.isGroupedByDimension||e.legend.show&&t.colorService.getMain().getSettings().field===t.viewModel.fields.majorGroup)}(e,t),u="horizontal"===t.dockService.meta.major.orientation,c=u?e.dimensionAxis.label:"auto",d="horizontal"===c?void 0:t.dockService.meta.minor.size/4,f=t.styleService.axis.label.getStyle(),m={type:"axis",layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:$w[`${t.dockService.meta.major.orientation}DimensionAxis`].minimumLayoutMode},settings:{labels:{show:!("title"===e.dimensionAxis.show),mode:c,tiltAngle:n?-40:40,maxEdgeBleed:50,maxLengthPx:d,...f},line:{show:!r,stroke:o.axis.line.major.color}},brush:{consume:[{context:"selection",data:["selectionDimension","axisSelectionDimension"],style:{inactive:{opacity:.3}}}]},animations:{enabled:t.viewModel.animations.enabled,trackBy:al.axes.trackBy({isMajor:!0}),compensateForLayoutChanges:al.axes.compensateForLayoutChanges({isHorizontal:u})}};l&&a.push(Y(!0,{},m,{key:"group-axis",scale:sw.SCALE.MAIN.MAJOR_INNER,settings:{paddingEnd:s?10:4,labels:{mode:s?"horizontal":m.settings.labels.mode,maxGlyphCount:Gw.getGroupAxisMaxGlyphCount(e.qHyperCube),maxLengthPx:d},line:{show:(u||!s)&&m.settings.line.show}}}));const p=Gw.getBarAxisMaxGlyphCount(e.qHyperCube,i.isStackedByDimension);return s&&a.push(Y(!0,{},m,{key:sw.COMPONENT.BAR_AXIS,scale:sw.SCALE.MAIN.MAJOR,settings:{paddingEnd:4,labels:{maxGlyphCount:p,maxLengthPx:d,tiltThreshold:p>Yw.LOWERGLYPHCOUNT&&p<Yw.UPPERGLYPHCOUNT?1:void 0},line:{show:!(u&&l)&&m.settings.line.show}}})),u||2!==a.length?a:[a[1],a[0]]}(e,t,n,r));const l=t.themeService.getStyles(),u=t.styleService.axis.label.getStyle();return a&&o.push({type:"axis",key:"y-axis",formatter:sw.FORMATTER.MINOR,layout:{dock:t.dockService.meta.minor.dock,minimumLayoutMode:$w.measureAxis.minimumLayoutMode},scale:sw.SCALE.MAIN.MINOR,settings:{labels:{show:s,...u},line:{stroke:l.axis.line.major.color},ticks:{stroke:l.axis.line.major.color},minorTicks:{stroke:l.axis.line.minor.color}},animations:{enabled:t.viewModel.animations.enabled,trackBy:al.axes.trackBy({isMeasure:!0}),compensateForLayoutChanges:al.axes.compensateForLayoutChanges({isMeasure:!0,dock:t.dockService.meta.minor.dock})}}),o}var Jw={BAR:{WIDTH:.7,STROKE:{COLOR:"#205891",WIDTH:{NONE:0,SMALL:1,MEDIUM:2,LARGE:4}}}};const Zw=.7,Qw=.9;function eD({layoutService:e,discrete:t,componentKey:n}){var r;const{isContinuous:i,isGrouped:o}=e.meta;if(i)return 1;const a=(e.getLayoutValue("components",[])||[]).filter((e=>e.key===n))[0];if(null!=a&&null!==(r=a.style)&&void 0!==r&&r.width){const{style:e}=a;return e.strokeWidth&&"none"!==e.strokeWidth?function(){const n=Jw.BAR.STROKE.WIDTH[e.strokeWidth.toUpperCase()]/t.query.getItemSize(),r=e.width+n;return r>1?e.width-(r-1):e.width}:e.width}return o?Qw:Zw}const tD={FULL:16,MEDIUM:14,SMALL:12,XSMALL:8,SPARK:4};function nD(e,t,n={}){return({data:r})=>{const i=e.chart.component(t).rect;if(!r.items.length||!i)return 2;const{min:o,max:a}=e.viewState.get("zoom");if(n[[o,a]])return n[[o,a]];const s=tD[te.getLayoutMode(i.width,Number.MAX_VALUE)];n={};const l=Math.abs(a-o),u=Math.abs(e.viewCache.get("continuousMax")-e.viewCache.get("continuousMin"));if(0===u)return s;const c=function(e,t,n){return e*(1-n)+t*n}(2,s,1-Math.min(l/u/.2,1));return n[[o,a]]=Math.max(2,Math.min(s,c)),n[[o,a]]}}function rD(e,t){const{hasExplicitMax:n,explicitMax:r}=t;return!!n&&e>r&&r<=0}function iD(e,t){const{hasExplicitMin:n,explicitMin:r}=t;return!!n&&e<r&&r>=0}function oD(e,t){const{hasExplicitMax:n,explicitMax:r}=t;return!!n&&e>r&&r>0}function aD(e,t){const{hasExplicitMin:n,explicitMin:r}=t;return!!n&&e<r&&r<0}const sD={MAX:"max",MIN:"min"},lD={min:"Min",max:"Max"};function uD(e,t,n){return void 0===n?rD(e,t)||iD(e,t):n===sD.MAX?rD(e,t):iD(e,t)}function cD({minorMinMax:e,type:t}){return!(function({minorMinMax:e,type:t}){return!e[`hasExplicit${lD[t]}`]}({minorMinMax:e,type:t})||function({minorMinMax:e,type:t}){const n=t===sD.MAX?e.implicitMax:e.implicitMin;return!uD(Number(n.toFixed(13)),e,t)}({minorMinMax:e,type:t}))}function dD(e,{barComponent:t,type:n,isStacked:r}){const{viewCache:i,dockService:o,themeService:a}=e,s=i.get("minorMinMax");if(!s.hasExplicitMinMax)return!1;const l=n===sD.MAX?s.implicitMax:s.implicitMin;if(!uD(Number(l.toFixed(13)),s,n))return!1;const{orientation:u}=t.settings,c=n===sD.MAX?o.meta.minor.end:o.meta.minor.start;let d="end";r&&(d=n===sD.MAX?"sumOfPositives":"sumOfNegatives");const f=a.getStyles();return{type:"box-out-of-bounds",key:`bar-oob-${n}`,layout:{dock:c},data:t.data,brush:t.brush,settings:{orientation:u,major:t.settings.major,minor:t.settings.minor,dockValue:pe.getDockValue(c),oob:Y({},t.settings.box,{fill:f.outOfRange.color,alignment:1,opacity:1,show:function(e){var t;return!0!==(null===(t=e.datum.null)||void 0===t?void 0:t.value)&&((!r||0!==e.datum[d].value)&&uD(e.datum[d].value,s,n))}})},animations:{enabled:e.viewModel.animations.enabled,compensateForLayoutChanges:al.barOobs.compensateForLayoutChanges}}}function fD(e){return Math.min(Math.max(0,e),1)}const mD=(e,{chart:t,type:n,componentKey:r,collectionKey:i})=>{const{layoutService:o,dockService:a,viewCache:s}=e,{isStacked:l}=o.meta,u=s.get("minorMinMax"),{meta:c}=e.layoutService;if(!cD({minorMinMax:u,type:n}))return!1;let d;c.isGroupedByDimension?d=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:c.isGroupedByMeasure&&(d=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2);const f={type:"box",key:`${sw.COMPONENT.GHOST_BAR_OOB}-${n}`,data:{collection:i},settings:{orientation:a.meta.minor.orientation,major:{scale:sw.SCALE.MAIN.MAJOR,fn:d},minor:{scale:sw.SCALE.MAIN.MINOR,start(e){var n,r;return fD(t.scale(sw.SCALE.MAIN.MINOR)((null==e||null===(n=e.datum)||void 0===n||null===(r=n.start)||void 0===r?void 0:r.value)||0))},end(e){const r=t.scale(sw.SCALE.MAIN.MINOR);let i="end";l&&(i="max"===n?"sumOfPositives":"sumOfNegatives");const o=e.datum[i]?e.datum[i].value:r[n]();return fD(r(o))}},box:{width:eD({layoutService:e.layoutService,discrete:e.discrete,componentKey:r}),minWidthPx:2,fill:"none",stroke:"transparent",show:e=>{const r=t.scale(sw.SCALE.MAIN.MINOR);let i="end";l&&(i="max"===n?"sumOfPositives":"sumOfNegatives");const o=e.datum[i]?e.datum[i].value:r.max();return"max"===n?o>r.max():o<r.min()}},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}}};return f};function pD(e,t){const{style:n,styleService:r,dockService:i}=t,o=r.label.getStyle(),a=o.useContrastColor&&!e.onBackground?function(e){return function(t){return St.isDark(t.node.attrs.fill)?e.lightColor:e.darkColor}}(n):o.fill,s="horizontal"===i.meta.major.orientation,l=e.padding||{left:s?0:4,right:s?0:4,top:s?4:0,bottom:s?4:0};return{position:e.position,justify:e.justify,fill:a,overflow:e.overflow,background:e.background,padding:l}}function hD(e){return{placements:e.simplifiedPlacements.map((t=>pD(t,e))),label:e.label}}function gD(e,t){if(t){if(function(e,t){return rD(e,t)}(e,t))return-1;if(function(e,t){return iD(e,t)}(e,t))return 1}return function(e,t){if(t&&0===e){const{min:e,max:n}=t;return 0===n&&0===e?1:n<=0?-1:e>=0||n>=-e?1:-1}return e>=0?1:-1}(e,t)}const yD="vertical",vD="horizontal";function bD(e,t,n,r){const i=gD(e,r);let o="up";return t===yD&&i<0?o="down":t===vD&&(o=i>=0&&!n||i<0&&n?"right":"left"),o}function xD(e,t){const{dataPoint:n}=e;if(!n.showLabels)return!1;const{isStacked:r,isContinuous:i}=t.layoutService.meta;return!r||!i&&!!n.showSegmentLabels}function qD(e,t){const{dataPoint:n}=e;if(!n.showLabels)return!1;const{isStacked:r,isContinuous:i}=t.layoutService.meta;return!!r&&(!!i||!1!==n.showTotalLabels)}function MD(e,t,n,r){const i=[];return void 0!==e&&(i[e]={position:"outside",onBackground:!0,justify:0,overflow:r}),void 0!==t&&(i[t]={position:"inside",onBackground:!1,justify:n}),i}function SD({layout:e,component:t,minorScale:n},r,i){if(!xD(e,r))return!1;const{viewModel:o,ds:a,viewCache:s,layoutService:l,dockService:u,themeService:c}=r,{meta:d}=l,f=s.get("minorMinMax"),m=c.getStyles(),p=r.styleService.label.getStyle();let h;!d.isStacked&&(h=d.isStacked?1:0);const g=0===h?1:0,y=d.isStacked?.5:1,v=o.fields.minor[0],b=void 0===v?void 0:a.field(v).formatter();let x,q=-1;x=d.isStacked?d.isStackedByMeasure||!b?function(e){return e.data.segment.label}:function(e){return Math.abs(e.data.segment.value)>q?b(e.data.segment.value):""}:function(e){return e.data.end.label};const M={label:x,simplifiedPlacements:MD(h,g,y,d.isContinuous),style:m.label.value},S=[hD(Y(r,M))],w={component:t,selector:"rect",strategy:{type:"bar",settings:{direction:e=>bD(e.data.end.value,u.meta.minor.orientation,i,f),labels:S,fontSize:parseInt(p.fontSize,10),fontFamily:p.fontFamily,linkData:al.labels.linkData}}},D={key:"bar-labels",type:"labels",layout:{minimumLayoutMode:"XSMALL"},settings:{sources:[w]},animations:{enabled:r.viewModel.animations.enabled,trackBy:al.labels.trackBy,compensateForLayoutChanges:al.labels.compensateForLayoutChanges}};return d.isStackedByDimension&&b&&(D.beforeRender=()=>{q=function(e,t,n){const r="vertical"===t.dockService.meta.minor.orientation?"height":"width",i=t.chart.component(e),o=i&&i.rect?i.rect[r]:1,a=n?n.min():0;return 9.999*((n?n.max():0)-a)/o}(t,r,n)}),D}const wD={isSameMeasureAndColorRow:(e,t,n)=>t&&e&&t[0].content[0]===e[0].content[0]&&t[0].content[1]===e[0].content[1]&&t[1].content[n?0:1]===e[1].content[0],getTitle(e,t){const n=e.data;let r;return t.isStackedByDimension?r=n.stack?n.stack.label:void 0:t.isGroupedByDimension&&(r=n.group?n.group.label:void 0),void 0!==r?`${n.label}, ${r}`:n.label},getMeasure(e,t,n,r,i){if(n.isStacked&&("bar-oob-max"===t.key||"bar-oob-min"===t.key))return!1;const o=t.data,a=n.isStacked?r.viewModel.fields.minor[n.isStackedByDimension?0:o.measureIndex.value]:void 0,s=n.isStacked?{source:{key:o.source.key,field:a},label:!0===(null===(l=o.null)||void 0===l?void 0:l.value)?"":n.isStackedByDimension&&i?i(o.segment.value):o.segment.label}:o.end;var l;return we.getMeasure(e,s)},getMeasures(e,t,n,r,i){const o=e.resources.dataset;return t.map((e=>wD.getMeasure(o,e,n,r,i))).filter(Boolean)},getCustomTooltipAttrExps(e,t,n){const r=e.resources.dataset;return Bv({nodes:t,layout:n.layoutService.getLayout(),dataset:r})},extractBarTooltipData(e,t,n,r,i){const o={title:wD.getTitle(t,n),color:we.getColor(e,t,r),measures:wD.getMeasures(e,t.childrenNodes?t.childrenNodes:[t],n,r,i)};if(wD.useCustomTooltip(r)){var a,s,l,u;const n=wD.getCustomTooltipAttrExps(e,t.childrenNodes?t.childrenNodes:[t],r);o.customMeasures=n.customTooltipAttrExpsArr,o.customTitle=n.customTooltipInfoAttrExpsArr.filter((e=>e.id===wv.CUSTOM.TITLE)),o.customDescription=n.customTooltipInfoAttrExpsArr.filter((e=>e.id===wv.CUSTOM.DESCRIPTION));let i=[];(t.childrenNodes?t.childrenNodes:[t]).forEach((e=>{var t;(null===(t=e.data.customTooltipImages)||void 0===t?void 0:t.length)>0&&!Array.isArray(e.data.customTooltipImages[0])&&(i=e.data.customTooltipImages)})),i.length>0&&(o.customImages=i);const p=r.layoutService.getLayout();var c,d,f,m;if(null!==(a=p.tooltip)&&void 0!==a&&null!==(s=a.chart)&&void 0!==s&&null!==(l=s.object)&&void 0!==l&&l.refId&&r.app&&r.customTooltipModel.embed&&"function"==typeof(null===(u=r.customTooltipModel.model)||void 0===u?void 0:u.getEffectiveProperties))if(null!==(c=(d=r.app).isInModalSelection)&&void 0!==c&&c.call(d)){if((null==p||null===(f=p.qHyperCube)||void 0===f||null===(m=f.qDimensionInfo)||void 0===m?void 0:m.length)>0){Ov.destroyVisualization({customTooltipModel:r.customTooltipModel});const e=r.customTooltipModel.translator.get("properties.tooltip.notselectedmessage");o.customLimitation=e}}else{const t=Ov.createContainer({ctx:e,layout:p});o.customChart=t}}return o},getTotalStackTitle:(e,t)=>e>0?t?t.get("Object.ChartTooltip.sumOfPositives"):"Sum of positives":e<0?t?t.get("Object.ChartTooltip.sumOfNegatives"):"Sum of negatives":"",extractStackTotalBarTooltipData(e,t,n){const r=e.data.label,i=[e.data.sumOfPositives.value,e.data.sumOfNegatives.value].filter((e=>0!==e)).map((e=>({label:`${wD.getTotalStackTitle(e,t)}`,value:n?n(e):e})));return{title:r,measures:i}},extractTooltipData(e,t){const n=t.chart.formatter(sw.FORMATTER.MINOR),{meta:r}=t.layoutService,i=e.node.childrenNodes?e.node.childrenNodes:[e.node],o=Math.max(0,i.length-6);i.length=Math.min(i.length,6);const{stackTotalBarNodes:a}=e.node,s=a&&a.length?a.map((e=>wD.extractStackTotalBarTooltipData(e,t.translator,n))):[];return{barTooltipData:i.map((i=>wD.extractBarTooltipData(e,i,r,t,n))),stackTotalBarTooltipData:s,numInvisibleNodesPhase1:o}},extractBarNodeData(e,t,n,r,i,o,a){let s=!i&&we.getTitleRow(t,r);const l=we.hideColorRow(t,n),u=!o&&!l&&we.getColorRow(e,t,r),c=t.measures.map((i=>!a&&we.getMeasureRow(i,e,t,r,l&&i.field===n.coloring.field))),d=c.filter((e=>!wD.isSameMeasureAndColorRow(e,u,r)));if(wD.useCustomTooltip(n)){const n=i?[]:t.customMeasures.map((n=>we.getMeasureRow(n,e,t,r,!1))),o=!(!t.customTitle[0]||i)&&we.getTitleRow(t.customTitle[0],r),a=!(!t.customDescription[0]||i)&&we.getDescriptionRow(t.customDescription[0],r);s=!wD.shouldIgnoreTitleRowForCtt(o,a,d,n)&&s;const l=[o,a,s,u,...d,...n];if(t.customChart&&l.push(t.customChart),t.customLimitation&&l.push(Fv.getFooterRow(t.customLimitation,r)),t.customImages){const n=t.customImages.map((t=>Fv.getImageRow(t,e)));l.push(...n)}return l.filter(Boolean)}return[s,u,...d].filter(Boolean)},extractStackTotalBarNodeData(e,t,n){const r=!!t.measures.length&&we.getTitleRow(t,n),i=t.measures.map((r=>we.getMeasureRow(r,e,t,n,!1)));return[r,...i].filter(Boolean)},useCustomTooltip:e=>jh(e,"customTooltipModel.useCustomTooltip",!1),shouldIgnoreTitleRow:(e,t)=>e.isDimensionless||t>0&&!e.isGroupedByDimension&&!e.isStackedByDimension,shouldIgnoreTitleRowForCtt:(e,t,n,r)=>!1===n[0]&&0===r.length&&(e.length>0||t.length>0),shouldIgnoreColorRow:(e,t)=>t>0&&(e.isGroupedByMeasure||e.isStackedByMeasure),shouldIgnoreMeasureRow:(e,t,n)=>e&&t.measures.some((e=>e.field===n.coloring.field)),shouldIgnoreDefaultRows:(e,t)=>wD.useCustomTooltip(t)&&jh(e,"tooltip.hideBasic",0),extractBarsData(e,t,n,r){const{meta:i}=t.layoutService,o=t.layoutService.getLayout(),a=r.length;let s,l,u=[];const c=wD.shouldIgnoreDefaultRows(o,t);for(s=0;s<a;s++){l=r[s];const o=wD.shouldIgnoreTitleRow(i,s),d=c||wD.shouldIgnoreColorRow(i,s),f=c||wD.shouldIgnoreMeasureRow(d,l,t);if(u=u.concat(wD.extractBarNodeData(e,l,t,n,o,d,f)),u.length>=6||l.customImages||l.customChart||l.customLimitation)return{barsData:u,numInvisibleNodesPhase2:a-(s+1)}}return{barsData:u,numInvisibleNodesPhase2:0}},extractStackTotalBarsData(e,t,n){let r=[];return n.some((e=>e.measures.length))&&n.forEach((n=>{r=r.concat(wD.extractStackTotalBarNodeData(e,n,t))})),r},extractData(e,t,n){const{barTooltipData:r,numInvisibleNodesPhase1:i,stackTotalBarTooltipData:o}=wD.extractTooltipData(e,t),a=wD.extractStackTotalBarsData(e,n,o);a.length&&a.push(we.getSeparatorRow());const{barsData:s,numInvisibleNodesPhase2:l}=wD.extractBarsData(e,t,n,r),u=a.concat(s),c=i+l;return c&&u.push(we.getNMoreRow(c,t.translator,n)),u},calculateBoundsFromBars(e){const t=e.filter((e=>{const t=e.bounds;return t.width>0&&t.height>0})),n=t.length?t:e;return vl.combineBounds(n.map((e=>e.bounds)))},calculateBoundsFromScale({opts:e,barKey:t,scale:n,majorScale:r,data:i,groupProp:o}){const a=e.chart.component(t).rect,{orientation:s}=e.dockService.meta.major,l="horizontal"===s?"width":"height",u=e.chart.scale(n).pxScale(a[l]);let c,d,f;if(e.layoutService.meta.isGroupedByMeasure){const t=e.viewModel.fields.minor.length;c=i.value,d=n===r&&void 0!==c?(u([c,0])+u([c,t-1]))/2:0,f=n===r&&void 0!==c?u.bandwidth([c,0]):0}else{const{value:e}=i;c=i[o]?i[o].value:void 0,d=u(n===r&&void 0!==c?[c,e]:e),f=n===r&&void 0!==c?u.bandwidth([c,e]):u.bandwidth(e)}const m=(d+f/2)*a[l],p={width:0,height:0};return"horizontal"===s?(p.x=m,p.y=a.height):(p.y=m,p.x=0),p},calculateTotalBounds({opts:e,labels:t,bars:n,barKey:r,barAxisKey:i,majorScale:o,majorInnerScale:a,groupProp:s}){const l=n.filter((e=>e.children&&e.children.length));let u;return u=l.length?wD.calculateBoundsFromBars(l):wD.calculateBoundsFromScale({opts:e,barKey:r,scale:t[0].key===i?o:a,majorScale:o,data:t[0].data,groupProp:s}),u},filterNodesOnKeys:(e,t)=>e.filter((e=>e.data&&t.indexOf(e.key)>-1)),isBarMatchingLabel:(e,t)=>t.data.value===e.data.value,isBarMatchingLabelOnProp:(e,t,n)=>t.data.value===(e.data[n]?e.data[n].value:e.data.value),findBarsMatchingLabels(e,t,n,r){const i=e.filter((e=>t.some((t=>n(e,t,r)))));return i},findBarsFromGroupLabelsInGroupedByDim(e,t,n){const r=wD.isBarMatchingLabelOnProp;return wD.findBarsMatchingLabels(e,t,r,n)},findBarsFromBarLabelsInGroupedByDim:(e,t,n)=>e.filter((e=>t.some((t=>t.data.group&&t.data.group.value===e.data[n].value&&t.data.value===e.data.value)))),findBarsFromLabelsInSingleDim(e,t){const n=wD.isBarMatchingLabel;return wD.findBarsMatchingLabels(e,t,n)},findBarsFromLabelsInGroupedByDim(e,t,n,r){const i=t.filter((e=>e.key===n)),o=t.filter((e=>e.key!==n)),a=wD.findBarsFromBarLabelsInGroupedByDim(e,i,r),s=wD.findBarsFromGroupLabelsInGroupedByDim(e,o,r);return a.concat(s)},findStackTotalBarsFromLabelsInStackedByDim(e,t){const n=wD.isBarMatchingLabel;return wD.findBarsMatchingLabels(e,t,n)},findStackTotalBarsFromLabelsInStackedByMeasure(e,t){const n=wD.isBarMatchingLabel;return wD.findBarsMatchingLabels(e,t,n)},findBarsFromLabelsInStackedByDim(e,t,n){const r=wD.isBarMatchingLabelOnProp;return wD.findBarsMatchingLabels(e,t,r,n)},findBarsFromLabelsInStackedByMeasure:(e,t)=>wD.findBarsFromLabelsInSingleDim(e,t),findBarsFromLabels({labels:e,opts:t,filterKeys:n,barAxisKey:r,groupProp:i,stackProp:o}){const{meta:a}=t.layoutService,s=wD.filterNodesOnKeys(t.chart.findShapes("container"),n);return a.isStackedByDimension?wD.findBarsFromLabelsInStackedByDim(s,e,o):a.isStackedByMeasure?wD.findBarsFromLabelsInStackedByMeasure(s,e):a.isGroupedByDimension?wD.findBarsFromLabelsInGroupedByDim(s,e,r,i):wD.findBarsFromLabelsInSingleDim(s,e)},findStackTotalBarsFromLabels({labels:e,opts:t,stackTotalBarKey:n}){const{meta:r}=t.layoutService;if(r.isStacked){const i=wD.filterNodesOnKeys(t.chart.findShapes("container"),[n]);return r.isStackedByDimension?wD.findStackTotalBarsFromLabelsInStackedByDim(i,e):wD.findStackTotalBarsFromLabelsInStackedByMeasure(i,e)}return[]},isSingleBarMode:(e,t)=>(e.isSimple||1===t.length)&&t[0].children&&t[0].children.length,filterNodesOnLabels({labels:e,opts:t,barKey:n,stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:o,barOobMinKey:a,groupProp:s,stackProp:l,majorScale:u,majorInnerScale:c,filterFn:d}){const{meta:f}=t.layoutService;if(e.length){let m=wD.findBarsFromLabels({labels:e,opts:t,filterKeys:[n],stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:o,barOobMinKey:a,groupProp:s,stackProp:l});if(d&&(m=m.filter(d)),wD.isSingleBarMode(f,m))return[m[0]];if(m.length){let f=wD.findBarsFromLabels({labels:e,opts:t,filterKeys:[n,o,a],stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:o,barOobMinKey:a,groupProp:s,stackProp:l});d&&(f=f.filter(d));const p=wD.calculateTotalBounds({opts:t,labels:e,bars:f,barKey:n,barAxisKey:i,groupProp:s,majorScale:u,majorInnerScale:c}),h=wD.findStackTotalBarsFromLabels({labels:e,opts:t,stackTotalBarKey:r});return[{key:n,bounds:p,childrenNodes:m,data:m.map((e=>e.data)),stackTotalBarNodes:h}]}return[]}return[]},filterNodesForOob:(e,t,n)=>e.key===t&&0===e.children.length||e.key===n,filterNodes({nodes:e,opts:t,barKey:n,stackTotalBarKey:r,barAxisKey:i,groupAxisKey:o,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d}){let f=wD.filterNodesOnKeys(e,[i,o]),m=f&&f.length?[f[0]]:[];const p=wD.filterNodesOnLabels({labels:m,opts:t,barKey:n,stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d});if(p&&p.length)return p;const{meta:h}=t.layoutService;if(h.isStackedByMeasure){f=wD.filterNodesOnKeys(e,[a,s]),m=f&&f.length?[f[0]]:[];const o=e=>wD.filterNodesForOob(e,n,a),p=wD.filterNodesOnLabels({labels:f,opts:t,barKey:n,stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d,filterFn:o});if(p&&p.length)return p[0].stackTotalBarNodes=void 0,p}if(h.isStackedByDimension){f=wD.filterNodesOnKeys(e,[a,s]),m=f&&f.length?[f[0]]:[];const o=e=>wD.filterNodesForOob(e,n,a),p=wD.filterNodesOnLabels({labels:f,opts:t,barKey:n,stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d,filterFn:o});if(p&&p.length)return p[0].stackTotalBarNodes=void 0,p}const g=wD.filterNodesOnKeys(e,[n,a,s]);return g.length?[g[0]]:[]}};function DD(e,t={},n){let r=[];const i=be({key:sw.COMPONENT.BASE_TOOLTIP,rtl:n});return Y(!0,i,{scale:sw.SCALE.MAIN.COLOR,settings:{filter:e=>wD.filterNodes({nodes:e,opts:t,barKey:sw.COMPONENT.BAR,stackTotalBarKey:sw.COMPONENT.STACK_TOTAL_BAR,barAxisKey:sw.COMPONENT.BAR_AXIS,groupAxisKey:sw.COMPONENT.GROUP_AXIS,barOobMaxKey:sw.COMPONENT.BAR_OOB_MAX,barOobMinKey:sw.COMPONENT.BAR_OOB_MIN,groupProp:"group",stackProp:"stack",majorScale:"major",majorInnerScale:"majorInner"}),extract:e=>(r=e.node.childrenNodes?e.node.childrenNodes:[e.node],wD.extractData(e,t,n)),placement:"bounds",afterShow:()=>{var e;const{app:i,properties:o,customTooltipModel:a}=t;i&&(null===(e=i.isInModalSelection)||void 0===e||!e.call(i))&&a.useCustomTooltip&&a.embed&&Ov.show({app:i,properties:o,selectedNodes:r,customTooltipModel:a,rtl:n})}},style:{content:{fontFamily:t.themeService.getStyles().fontFamily}}})}const CD={extractData:(e,t)=>[we.getTitleRow({title:e.node.data.label},t)],filterNodes(e,t){const n=e.filter((e=>e.data&&e.key===t));return n.length?[n[0]]:[]}};function ND(e,t={},n){if("categorical"!==t.colorService.getMain().getSettings().type)return!1;const r=be({key:sw.COMPONENT.LEGEND_CAT_TOOLTIP,rtl:n});return Y(!0,r,{scale:sw.SCALE.MAIN.COLOR,settings:{filter:e=>CD.filterNodes(e,sw.COMPONENT.LEGEND_COLOR_CAT),extract:e=>CD.extractData(e,n),placement:"pointer",direction:n?"rtl":"ltr"},style:{content:{fontFamily:t.themeService.getStyles().fontFamily}}})}function kD(e){return"NaN"===e.qMin&&"NaN"===e.qMax}function AD({layout:e},t,n){const r=function(e,t){if(e.qHyperCube.qSize.qcx*e.qHyperCube.qSize.qcy==0)return"NoDataExist";if(e.qHyperCube.qMeasureInfo.every(kD))return"OnlyNanData";let n=!1;if(t.layoutService.meta.isContinuous&&2===e.qHyperCube.qDimensionInfo.length){const t=e.qHyperCube.qDimensionInfo[1];n=Kw.getDimensionSize(t)>oe.maxNumberOfLines}return!!n&&"LimitedData"}(e,t),{fontFamily:i}=t.themeService.getStyles();return function(e,t,n,r={}){if(!e)return!1;const{translator:i}=t,{rtl:o}=n;return{key:"disclaimer",type:"disclaimer",layout:{dock:Z[e].alignment},settings:{label:i.get(`Object.Disclaimer.${e}`),rtl:o},style:r}}(r,t,{rtl:n},{fontFamily:i})}function LD(e,{fill:t}){return{[sw.FORMATTER.MINOR]:{data:{fields:e.viewModel.fields.minor}},[sw.FORMATTER.COLOR]:t&&t.data&&t.data.field?{data:{field:t.data.field}}:{}}}const ED=1,TD=3;function OD(e){return e.getLayoutValue("gridLine.auto")}function ID(e){return!OD(e)&&e.getLayoutValue("gridLine.spacing")===ED}function PD(e){return!OD(e)&&e.getLayoutValue("gridLine.spacing")===TD}const RD=e=>({enabled:e.animations.enabled,trackBy:al.lines.trackBy,compensateForLayoutChanges:al.lines.compensateForLayoutChanges}),FD=(e,{themeService:t,layoutService:n,dockService:r,viewModel:i})=>{if(!OD(n)&&function(e){return!e.getLayoutValue("gridLine.spacing")}(n))return!1;const{grid:o}=t.getStyles(),a={key:"grid-line",type:"grid-line",layout:{minimumLayoutMode:$w.measureAxis.minimumLayoutMode},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),ticks:{show:!ID(n)||((e,t)=>t%2==0),stroke:o.line.major.color},minorTicks:{show:PD(n),stroke:o.line.minor.color},animations:RD(i)};return a["horizontal"===r.meta.major.orientation?"y":"x"]=sw.SCALE.MAIN.MINOR,a};function jD(e,t){const n=[FD(0,t)];return n[0]&&n.push((({dockService:e,themeService:t,viewCache:n,viewModel:r})=>{const i=n.get("minorMinMax");if(i.min>0||i.max<0)return!1;const o=t.getStyles(),a={};return a["horizontal"===e.meta.minor.orientation?"x":"y"]=[{value:0,scale:sw.SCALE.MAIN.MINOR,line:{stroke:o.grid.line.highContrast.color}}],{key:"high-contrast-grid-line",type:"ref-line",scale:sw.SCALE.MAIN.MINOR,lines:a,animations:RD(r)}})(t)),n}const HD="areaPan",zD=e=>({type:"Pan",key:"panorama",options:{event:HD,pointers:1,threshold:10,enable(t,n){return this.started===HD||!n||!!e.actions.scroll.enabled()&&e.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((e=>e.key===sw.COMPONENT.BAR))}},events:{areaPanstart(t){t.preventDefault(),this.started=HD;const n=e.viewState.get("zoom");this[HD]={min:n.min,max:n.max,size:e.chart.component(sw.COMPONENT.BAR).rect.computedInner.width,span:n.max-n.min}},areaPanmove(t){t.preventDefault();const{span:n,min:r,max:i,size:o}=this[HD],a=-t.deltaX/o;e.viewState.set("zoom",{min:Math.min(r+a*n,e.viewCache.get("continuousMax")-n),max:Math.max(i+a*n,e.viewCache.get("continuousMin")+n)})},areaPanend(e){e.preventDefault(),this.started=!1},areaPancancel(e){e.preventDefault(),this.started=!1}}});function BD(e,t){if(e.layoutService.meta.isDiscrete)return{};const{viewCache:n,viewState:r,chart:i}=e,{rtl:o}=t,a=Cf.event.onZoom({viewCache:n,viewState:r,chart:i},{threshold:100,rtl:o,targetKey:sw.COMPONENT.BAR}),s={last:0,diff:0};return{type:"Pinch",key:"continuous-pinch-zoom",options:{event:"zoom",pointers:2,threshold:0,enable:(t,n)=>!n||!!e.actions.scroll.enabled()&&e.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((e=>e.key===sw.COMPONENT.BAR))},events:{zoomstart(e){s.last=e.scale,e.preventDefault()},zoommove(e){const t=e.scale-s.last;(function(e){return Math.abs(e)>.01})(t)&&a(e.center,t>0?1:-1),e.preventDefault(),s.last=e.scale}}}}function _D({chart:e},t,n){const r=e.component(sw.COMPONENT.BASE_TOOLTIP);var i;r&&r.show&&(r.emit("hide"),null!=n&&null!==(i=n.customTooltipModel)&&void 0!==i&&i.useCustomTooltip&&t&&t({},r,{nodes:[],opts:n,customTooltipModel:n.customTooltipModel,hide:!0}));const o=e.component(sw.COMPONENT.LEGEND_CAT_TOOLTIP);o&&o.show&&o.emit("hide");const a=e.component(sw.COMPONENT.TREND_LINES_TOOLTIP);a&&a.show&&a.emit("hide")}function VD(e,t){const{viewCache:n,viewState:r,chart:i,trendLineModel:o,layoutService:a}=e,{rtl:s}=t,l=e.layoutService.meta.isContinuous?Cf.event.onZoom({viewCache:n,viewState:r,chart:i},{rtl:s,threshold:50,targetKey:sw.COMPONENT.BAR}):void 0,u=YS({majorInnerScale:sw.SCALE.MAIN.MAJOR_INNER,tooltip:sw.COMPONENT.TREND_LINES_TOOLTIP,tooltipOverlay:sw.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{chart:i,viewState:r,trendLineModel:o,layoutService:a,rtl:s}),c=[sw.COMPONENT.BAR,sw.COMPONENT.BAR_AXIS,sw.COMPONENT.GROUP_AXIS,sw.COMPONENT.BAR_OOB_MAX,sw.COMPONENT.BAR_OOB_MIN],d=e.customTooltipModel.utils,f=e.debouncer(d.displayTooltip,d.DEBOUNCE_THRESHOLD);return{type:"native",events:{wheel(t){let n,r=!1;if(e.actions.scroll.enabled()){const i={x:t.clientX,y:t.clientY};[n]=e.chart.componentsFromPoint(i).filter((e=>e.key===sw.COMPONENT.BAR)),n&&(e.layoutService.meta.isContinuous&&l(i,Math.sign(-t.deltaY)),r=!0)}!r&&e.actions.interact.enabled()&&([n]=e.chart.componentsFromPoint(t).filter((e=>e.key===sw.COMPONENT.LEGEND_COLOR_CAT)),n&&(r=!0,function(e,t){const n=(Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY)>=0?"next":"prev";t.emit(n)}(t,n))),r&&t.preventDefault(),_D(e,f,e)},mousemove(t){if(e.actions.tooltip.enabled()){if(u(t))return;const n=this.chart.componentsFromPoint({x:t.clientX,y:t.clientY}),r=this.chart.component(sw.COMPONENT.BASE_TOOLTIP);if(r&&r.show)if(n.some((e=>c.indexOf(e.key)>-1))){const{customTooltipModel:n}=e;if(n.useCustomTooltip&&d.checkIfPromisesExist({customTooltipModel:n})){const i=d.getNodes(t,this.chart);f(t,r,{nodes:i,opts:e,customTooltipModel:n})}else r.emit("show",t)}else r.emit("hide");const i=this.chart.component(sw.COMPONENT.LEGEND_CAT_TOOLTIP);i&&i.show&&(n.some((e=>e.key===sw.COMPONENT.LEGEND_COLOR_CAT))?i.emit("show",t):i.emit("hide"))}},mouseup(t){2===t.button&&_D(this,f,e)},mouseleave(){_D(this,f,e)}}}}const $D=(e,t)=>({type:"hammer",enable:!0,gestures:[...(t.hammer||{}).gestures||[],...Kf({...e,componentKey:"scrollbar",rtl:t.rtl}).gestures,...e.layoutService.meta.isDiscrete?e.discrete.interactions.gestures:[zD(e,t.rtl),BD(e,t)]]});function UD(e,t){const n=[$D(e,t),VD(e,t),Kf({...e,componentKey:"scrollbar",rtl:t.rtl}).native];return e.layoutService.meta.isDiscrete&&n.push(e.discrete.interactions.native),n}const WD=e=>({enabled:e.animations.enabled,compensateForLayoutChanges:al.bars.compensateForLayoutChanges});const KD=(e,t,{collectionKey:n})=>{if(!Of({layoutService:t.layoutService}).miniChart)return!1;if(t.reducedDataModel.mode.isContinuous)return function(e,{reducedDataModel:t,colorService:n,continuousDataModel:r,viewModel:i},{collectionKey:o}){return{type:"box",key:"mini-marker",layout:{dock:"@scrollbar"},show:()=>r.getDimensionCardinality()>1,data:{collection:o},settings:{box:Y(!0,{},e.settings.box,{minWidthPx:2,fill:n.getMini().getColor(),strokeWidth:0}),major:Y(!0,{},e.settings.major,{scale:t.scales.major}),minor:e.settings.minor,orientation:e.settings.orientation,oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:WD(i)}}(e,t,{collectionKey:n});const{mode:r,scales:i}=t.reducedDataModel;let o;return r.isGroupedByDimension&&!r.isReduced?o=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:r.isGroupedByMeasure&&(o=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2),{type:"box",key:"mini-marker",layout:{dock:"@scrollbar"},show:()=>t.discrete.query.getCanScroll(),data:{collection:n},settings:{box:{...e.settings.box,fill:r.isReduced||r.isStackedByDimension?t.colorService.getMain().getSettings().others:t.colorService.getMain().getColor(),strokeWidth:0},major:{scale:i.major,fn:o},minor:{scale:i.minor},orientation:e.settings.orientation,oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:WD(t.viewModel)}},{measureText:GD}=e.renderer("svg")();function YD(e,t,n){const r=function(e){const t=Y(!0,{},e);return delete t.data,t}(t.minor),i=function(e,t,{majorScaleInvert:n,maxPxStep:r,align:i,getProp:o}){let a={invert:n,data:{extract:e.mode.isDimensionless?e.fields.minor.map(((e,t)=>({field:e,value:t}))):{source:"miniCube",field:"qDimensionInfo/0"}},type:e.mode.isDimensionless?"band":void 0,maxPxStep:r,align:i};return e.mode.isStackedByDimension?a.data.extract.field="qDimensionInfo/1":e.mode.isGroupedByDimension?e.mode.isReduced||(a.data={source:"miniCube",hierarchy:{value:e=>e.qElemNumber}}):e.mode.isGroupedByMeasure?(a=Y(!0,{},t),a.data.extract.source="miniCube"):e.mode.isContinuous&&(a=Y(!0,{},t,{min:()=>o("continuousMin"),max:()=>o("continuousMax")})),a}(e,t.major,n);return{reducedMinor:r,reducedMajor:i}}const XD=125,JD={NARROW:50,MEDIUM:100,WIDE:200};function ZD(e,t){const n=function(e){const t=e.getLayoutValue("measureAxis.spacing",1);switch(t){case.5:return JD.NARROW;case 1:return JD.MEDIUM;case 2:return JD.WIDE;default:return t*XD}}(t);return Math.max(1,Math.round(e/n))}const QD=10;function eC(e,t,n){return 0===t||t===Math.floor((n.length-1)/2)||t===n.length-1}function tC(e,t,n){return 0===t||0===e||t===n.length-1}function nC(e){for(let t=1;t<e.length;t++)if(e[t]===e[t-1])return!0;return!1}function rC(e,t,n,r,i){e.domain([t,n]),e.nice(QD);const[o,a]=e.domain();let s=e.ticks(QD);const l=function(e){return e.length%2==0}(s),u=function(e){const t=Math.round(.3*e.length),n=t,r=e.length-t;return e.slice(n,r).some((e=>0===e))}(s),c=u?tC:eC;s=s.filter(c),l&&!u&&!r&&s.length>1&&(s=[s[0],(s[0]+s[s.length-1])/2,s[s.length-1]]);const d=i?i.formatter(sw.FORMATTER.MINOR):void 0;return nC(d?s.map(d):s)&&(s=[s[0],s[s.length-1]]),{roundedMin:o,roundedMax:a,ticks:s}}function iC(e,t,n,r,i,o,a,s){const l=o.formatter(sw.FORMATTER.MINOR),u=s.getStyles(),c="horizontal"===a.meta.major.orientation?"height":"width",d=e=>GD({text:e,fontSize:u.axis.label.name.fontSize,fontFamily:u.axis.label.name.fontFamily})[c];let[f,m]=e.domain(),p=e.ticks(r);function h(){const e=p.map(l);return!nC(e)&&function(e){const t=i/p.length;return Math.max(...e.map(d))<=t}(e)}for(let i=r-1;i>0&&!h();i--)e.domain([t,n]),e.nice(i),[f,m]=e.domain(),p=e.ticks(i);return{roundedMin:f,roundedMax:m,ticks:p}}const oC=(e,t)=>e.value-t.value,aC=e=>({value:e,isMinor:!1}),sC=e=>({value:e,isMinor:!0});function lC(e,t,n){const r=Number.isNaN(t)&&Number.isNaN(n)?3:2;return e.filter((e=>(e=>Number.isNaN(t)||e>=t)(e)&&(e=>Number.isNaN(n)||e<=n)(e))).length<=r}function uC({chart:e,viewCache:t,dockService:n,layoutService:r,themeService:i}){const{explicitMin:o,explicitMax:a,hasExplicitMin:s,hasExplicitMax:l}=t.get("minorMinMax"),{min:u,max:c}=function(e){let{min:t,max:n}=e.get("minorMinMax");return t===n&&0===t&&(t-=1,n+=1),{min:t,max:n}}(t),d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e},n=Bh();return function(r){var i=t(r);return n.has(i)?n.get(i):n.set(i,e(r))}}((()=>{const d=function(e,t,n){let r;return e?r=n.meta.chart.size:({rect:r}=t.component(sw.COMPONENT.BAR)),"horizontal"===n.meta.major.orientation?r.height:r.width}(t.get("isPreRender"),e,n),f=ZD(d,r),m=function(e,t,n){const r=kr().domain([e,t]);return r.nice(n),r}(u,c,f);let p,h,g=[];"SPARK"===n.meta.chart.mode?({roundedMin:p,roundedMax:h}=function(e,t){return{roundedMin:e,roundedMax:t}}(u,c)):(({roundedMin:p,roundedMax:h,ticks:g}=iC(m,u,c,f,d,e,n,i)),lC(g,o,a)&&({roundedMin:p,roundedMax:h,ticks:g}=rC(m,u,c,s||l,e)));const y=function(e,t){const n=[];for(let r=0;r<e.length-1;r++){const i=e[r],o=(e[r+1]-i)/(t+1);for(let e=1;e<=t;e++)n.push(i+o*e)}return n}(g,1);g=function(e,t,n){return e&&n.length&&!n.some((e=>e===t))?(n.unshift(t),n.filter((e=>e>=t))):n}(s,o,g),g=function(e,t,n){return e&&n.length&&!n.some((e=>e===t))?(n.push(t),n.filter((e=>e<=t))):n}(l,a,g);const v=function(e,t){return[...e.map(aC),...t.map(sC)].sort(oC)}(g,y);return{roundedMin:p,roundedMax:h,ticks:v}}),(()=>t.get("isPreRender")));return{values:()=>d().ticks,min:()=>s?o:d().roundedMin,max:()=>l?a:d().roundedMax}}function cC(e,{picasso:t,discrete:n,layoutService:r,dockService:i,viewModel:o,viewCache:a,reducedDataModel:s,colorService:l,themeService:u,viewState:c,chart:d},{localeInfo:f,rtl:m}){const{meta:p}=r,{fields:h}=o,g=()=>{if("custom"!==r.getLayoutValue("dimensionAxis.axisDisplayMode"))return Math.min(200,i.meta.chart.size["horizontal"===i.meta.major.orientation?"height":"width"]/4)},y=!("none"===r.getLayoutValue("measureAxis.show"))?(v=i.meta.minor.orientation,b=i.meta.minor.dock,"vertical"===v?"near"===b||"left"===b?0:1:"near"===b||"bottom"===b?1:0):.5;var v,b;const x={},q="vertical"===i.meta.minor.orientation&&m,M=l.getMain().getScales(),S=l.getMini().getScales();if(Object.assign(x,M,{reducedFill:S.reducedFill}),x[sw.SCALE.MAIN.MINOR]=function({chart:e,viewModel:{fields:t},dockService:n,viewCache:r,layoutService:i,themeService:o},{rtl:a}){const s=uC({chart:e,dockService:n,viewCache:r,layoutService:i,themeService:o}),l={invert:"vertical"===n.meta.minor.orientation||a,ticks:{values:s.values},minorTicks:{count:1},min:s.min,max:s.max};return i.meta.isStacked||(l.data={source:"qHyperCube",fields:t.minor}),l}({chart:d,viewModel:o,dockService:i,viewCache:a,layoutService:r,themeService:u},{rtl:m}),p.isGroupedByDimension)[sw.SCALE.MAIN.MAJOR_INNER,sw.SCALE.MAIN.MAJOR].forEach(((e,t)=>{x[e]={invert:q,data:{source:"qHyperCube",hierarchy:{label:e=>e.qText?e.qText:"",value:e=>e.qElemNumber,props:{...o.selectionDimensionProp(t),group:p.isGroupedByDimension?{field:h.majorGroup}:void 0}}},label:({datum:e})=>e.label,ticks:{depth:t+1},maxPxStep:g,align:y}})),o.isDimensionLocked(0)||(x[sw.SCALE.MAIN.MAJOR_INNER].data.hierarchy.props.axisSelectionDimension={field:0});else if(p.isGroupedByMeasure)x[sw.SCALE.MAIN.MAJOR]={type:"group-by-measure",invert:q,data:{extract:{source:"qHyperCube",field:"qDimensionInfo/0",props:{axisSelectionDimension:{field:0}}}},measureCount:e.qHyperCube.qMeasureInfo.length,maxPxStep:g,align:y};else if(p.isTime){const{innerTime:e,outerTime:n}=function(e,t){const{layoutService:n,viewModel:r,viewCache:i,picasso:o,viewState:a,localeInfo:s,themeService:l}=e,u=()=>n.getHyperCubeValue("qAxisData.qAxis",[]),c=o.formatter("q-time"),d=l.getStyles(),f=e=>GD({text:e,fontSize:d.axis.label.name.fontSize,fontFamily:d.axis.label.name.fontFamily});i.set("qTimeAxisCache",[]);const m={get:(e,t=0)=>{const n=i.get("qTimeAxisCache");return n[t]&&n[t][0]===e?n[t][1]:void 0},set:(e,t,n=0)=>{i.get("qTimeAxisCache")[n]=[e,t]},key:({distance:e})=>{const{min:t,max:n}=a.get("zoom"),r=(n-t)/(i.get("continuousMax")-i.get("continuousMin")),o=u().map((e=>e.qName));return[e,Number.parseFloat(r).toFixed(12),...o].toString()}};return{innerTime:{data:{field:r.fields.majorNumeric},type:"q-time-axis",qAxis:u,field:r.fields.majorNumeric,min:()=>a.get("zoom").min,max:()=>a.get("zoom").max,invert:!!t,formatter:{fn:c,localeInfo:s,qNumFormat:n.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:f},ticks:{generator:{type:"d3",initialMin:a.get("zoom").min},level:"inner",anchor:"start",clamp:!0},cache:m},outerTime:{data:{field:r.fields.majorNumeric},type:"q-time-axis",qAxis:u,field:r.fields.majorNumeric,min:()=>a.get("zoom").min,max:()=>a.get("zoom").max,invert:!!t,formatter:{fn:c,localeInfo:s,qNumFormat:n.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:f},ticks:{generator:{type:"d3"},level:"outer",anchor:"start",clamp:!0},cache:m}}}({picasso:t,localeInfo:f,viewState:c,viewModel:o,viewCache:a,themeService:u,layoutService:r},m);x[sw.SCALE.MAIN.MAJOR_INNER]=e,x[sw.SCALE.MAIN.MAJOR]=n}else p.isContinuous?x[sw.SCALE.MAIN.MAJOR]={type:"linear",invert:q,data:{extract:{key:"qHyperCube",field:h.majorNumeric}},ticks:{forceBounds:!0,count:c.get("zoom").min===c.get("zoom").max?1:void 0},minorTicks:{count:1},min:()=>c.get("zoom").min,max:()=>c.get("zoom").max}:x[sw.SCALE.MAIN.MAJOR]={invert:q,data:{extract:p.isDimensionless?h.minor.map(((t,n)=>({field:t,label:()=>e.qHyperCube.qMeasureInfo[n].qFallbackTitle,value:n}))):{source:"qHyperCube",field:"qDimensionInfo/0",props:{axisSelectionDimension:{field:0}}}},type:p.isDimensionless?"band":void 0,maxPxStep:g,align:y};const{reducedMinor:w,reducedMajor:D}=YD(s,{major:x[sw.SCALE.MAIN.MAJOR],minor:x[sw.SCALE.MAIN.MINOR]},{majorScaleInvert:q,maxPxStep:g,align:y,getProp:a.get});return p.isDiscrete&&(x[sw.SCALE.MAIN.MAJOR].range=n.query.getScaleRange,p.isGroupedByDimension&&(x[sw.SCALE.MAIN.MAJOR_INNER].range=n.query.getScaleRange)),x[s.scales.major]=D,x[s.scales.minor]=w,x}function dC(e,t,n){const{layoutService:r,colorService:i}=e;return function(e,t){if(!e.targets)throw new Error("Missing 'targets' property");return{interactions:[zw(e,t)],components:[]}}({targets:[r.meta.isStackedByDimension&&r.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1?sw.COMPONENT.STACK_TOTAL_BAR:sw.COMPONENT.BAR,sw.COMPONENT.BAR_AXIS,sw.COMPONENT.GROUP_AXIS,"outer-axis-overlay","inner-axis-overlay",sw.COMPONENT.LEGEND_COLOR_CAT],components(e,t){const r={action:e.srcEvent.ctrlKey||n?"set":"toggle",contexts:["selection"],key:t[0].key};return sw.COMPONENT.BAR===t[0].key?[{...r,data:["selectionDimension"]}]:[sw.COMPONENT.BAR_AXIS,sw.COMPONENT.GROUP_AXIS].includes(t[0].key)?[{...r,data:["selectionDimension","axisSelectionDimension"]}]:[r]}},{...e,isLocked:n=>n.some((e=>e.key===sw.COMPONENT.LEGEND_COLOR_CAT))?i.getMain().isSelectionLocked({isMeasureSelectionLocked:t}):e.isLocked(n)})}function fC(e){const t=e.layoutService.meta.isStackedByDimension&&e.layoutService.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1;return function(e,t){if(!e.componentTargetKey)throw new Error("Missing 'componentTargetKey' property");const n={key:"lasso",...e},r=Fw(n);return{interactions:[Hw(n,t)],components:[r]}}({key:"lasso",componentTargetKey:sw.COMPONENT.BAR,components:[t?{key:sw.COMPONENT.STACK_TOTAL_BAR,contexts:["selection"],action:"add"}:{key:sw.COMPONENT.BAR,contexts:["selection"],action:"add",data:["selectionDimension"]}]},e)}function mC(e){return function(e,t){const n=function(e){const{key:t,targets:n,components:r,fillTargets:i,dock:o}=e;return{key:t,type:"brush-area-dir",layout:{dock:n.map((e=>`@${e}`)).join(",")},settings:{multiple:!0,brush:{components:r},direction:"left"===o||"right"===o?"vertical":"horizontal",bubbles:{align:"left"===o||"top"===o?"end":"start",placement:"inside"},target:{components:i,fill:"rgba(82,204,82,0.2)"}}}}(e);return{interactions:[_w(e,t,"area")],components:[n]}}({eventName:"discreteRange",components:[{key:sw.COMPONENT.BAR,contexts:["selection"],action:"set",data:["selectionDimension"]}],key:"discreteRangeBrush",targets:["group-axis",sw.COMPONENT.BAR_AXIS,sw.COMPONENT.BAR],fillTargets:["group-axis",sw.COMPONENT.BAR_AXIS],dock:e.dockService.meta.major.dock},e)}function pC(e,t,n){const{selectionService:r}=e,{isUnsupportedFeature:i}=t,o=void 0===n,a=r.getIsSingleSelect(n),s=dC(e,o,a);if(o||a)return{components:[...s.components],gestures:[...s.interactions]};const l=fC(e),u=function(e,t){return e.layoutService.meta.isStacked||null!=t&&t("rangeSelections")?{components:[],interactions:[]}:Vw({eventName:"measureRange",key:"measureRangeBrush",targets:["y-axis",sw.COMPONENT.BAR],fillTargets:["y-axis"],dock:e.dockService.meta.minor.dock,scale:sw.SCALE.MAIN.MINOR,onEdited(){e.actions.select.emit("end","measureRange")}},e)}(e,i),c=function(e){return e.layoutService.meta.isContinuous?Vw({eventName:"continuousRange",key:"continuousRangeBrush",targets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis",sw.COMPONENT.BAR]:["continuous-axis",sw.COMPONENT.BAR],fillTargets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis"]:["continuous-axis"],observeBrush:!0,multiple:!0,dock:e.dockService.meta.major.dock,scale:e.layoutService.meta.isTime?sw.SCALE.MAIN.MAJOR_INNER:sw.SCALE.MAIN.MAJOR,toLabel({datum:t,data:n,scale:r}){const i=e.layoutService.meta.isTime?r.formatter():e.chart.formatter(sw.FORMATTER.MINOR),o=e.chart&&e.chart.brushSelectionIncludeMax;return`${t!==Math.max(...n)||o?"":"<"}${i(t)}`}},e):{components:[],interactions:[]}}(e),d=mC(e);return{components:[...s.components,...l.components,...u.components,...d.components,...c.components],gestures:[...l.interactions,...s.interactions,...u.interactions,...d.interactions,...c.interactions]}}function hC({layoutService:e,viewModel:t,dockService:n}){var r;const{meta:i}=e;if(!i.isStackedByDimension||i.isContinuous)return!1;const{fields:o}=t,a=e.getLayoutValue("components",null),s=a?a.filter((e=>"bar"===e.key))[0]:null;return{key:"shadow-bar",type:"box",data:{extract:[{field:o.majorStack,filter:e=>0!==e.qDown||0!==e.qUp,props:{start:{value:e=>{return t=e.qSubNodes,Number(t.map((e=>e.qMaxPos)).reduce(((e,t)=>e+t),0).toFixed(13));var t}},end:{value:e=>Number(e.qMaxPos.toFixed(13))}}},{field:o.majorStack,filter:e=>0!==e.qDown||0!==e.qUp,props:{start:{value:e=>{return t=e.qSubNodes,Number(t.map((e=>e.qMinNeg)).reduce(((e,t)=>e+t),0).toFixed(13));var t}},end:{value:e=>Number(e.qMinNeg.toFixed(13))}}}]},settings:{major:{scale:sw.SCALE.MAIN.MAJOR},minor:{scale:sw.SCALE.MAIN.MINOR},orientation:n.meta.minor.orientation,box:{width:null!=s&&null!==(r=s.style)&&void 0!==r&&r.width&&s.style.width>0?s.style.width:.7,fill:()=>({type:"pattern",fill:"rgba(165, 165, 165, 0.8)",width:4,height:4,shapes:[{type:"rect",x:0,y:3,width:1,height:1},{type:"rect",x:1,y:2,width:1,height:1},{type:"rect",x:2,y:1,width:1,height:1},{type:"rect",x:3,y:0,width:1,height:1}]})},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:{enabled:t.animations.enabled,trackBy:al.shadowBars.trackBy,compensateForLayoutChanges:al.bars.compensateForLayoutChanges}}}const gC={min:"Min",max:"Max"};function yC(e,t,n){const r=n?e.implicitMax:e.implicitMin;return!function(e,t,n){return void 0===n?oD(e,t)||aD(e,t):n===sD.MAX?oD(e,t):aD(e,t)}(Number(r.toFixed(13)),e,t)}function vC(e,{barComponent:t,type:n,isStacked:r}){var i,o,a,s;const{viewCache:l,layoutService:u,dockService:c}=e,d=l.get("minorMinMax"),f=n===sD.MAX;if(function(e,t){return!e[`hasOther${gC[t]}`]}(d,n)){if(function(e,t){return!e[`hasExplicit${gC[t]}`]}(d,n))return!1;if(yC(d,n,f))return!1}if(function(e,t,n){const r=n?e=>e<0:e=>e>0;return e[`hasExplicit${gC[t]}`]&&r(e[`explicit${gC[t]}`])}(d,n,f))return!1;let m="end";r&&(m=f?"sumOfPositives":"sumOfNegatives");const p=function(e){let t;return()=>(void 0===t&&(t=e()),t)}((()=>e.chart.scale(sw.SCALE.MAIN.MINOR)[n]())),h=f?e=>e.datum[m].value>p():e=>e.datum[m].value<p(),g=sw.COMPONENT.BAR,y=e.layoutService.getLayoutValue("components",[]),v=y?y.filter((e=>e.key===g))[0]:null;return{type:"box-sliced-hat",key:`sliced-hat-${n}`,layout:{dock:f?c.meta.minor.end:c.meta.minor.start},data:t.data,brush:t.brush,settings:{orientation:t.settings.orientation,major:t.settings.major,minor:t.settings.minor,hat:Y({},t.settings.box,{fill:u.meta.isStacked?"#999":t.settings.box.fill,alignment:1,opacity:1,show:h,width:eD({layoutService:e.layoutService,discrete:e.discrete,componentKey:g}),strokeWidth:null!=v&&null!==(i=v.style)&&void 0!==i&&i.strokeWidth?Jw.BAR.STROKE.WIDTH[v.style.strokeWidth.toUpperCase()]:Jw.BAR.STROKE.WIDTH.NONE,stroke:null!==(o=null==v||null===(a=v.style)||void 0===a||null===(s=a.strokeColor)||void 0===s?void 0:s.color)&&void 0!==o?o:Jw.BAR.STROKE.COLOR})}}}function bC(e,t){var n;let r;return r=e.isContinuous?1:.7,!e.isContinuous&&null!=t&&null!==(n=t.style)&&void 0!==n&&n.width&&t.style.width>0?t.style.width:r}function xC(e,{collectionKey:t},n){const{meta:r}=e.layoutService,{fields:i}=e.viewModel,o=r.isStackedByDimension&&!r.isContinuous?"qValue":"qNum",a=e=>"NaN"===e[o]?0:e[o];function s(t){const n=e.ds.field(t).raw(),r=e.ds.field(t).formatter(),i=se.shouldUseFormat(n);return{field:t,reduceLabel:"none",value:a,label:e=>i?(e=>"NaN"===e[o]?"-":r(e[o]))(e):e.qText}}const l=r.isStackedByDimension?e=>"NaN"===e.qValue:e=>!!e.qIsNull;const u={key:t,data:{extract:i.minor.map(((t,o)=>{const a=e.colorService.getMain().getDatumProps(o),u=e.colorService.getMini().getDatumProps(o),c=a[Object.keys(a)[0]],d=null==c?void 0:c.field,f=d?{field:d,reduceLabel:"none",value:e=>void 0!==e.qNum&&"NaN"!==e.qNum?e.qNum:e.qText||"-"}:void 0,m={field:r.isDimensionless?t:i.major,props:{...e.viewModel.selectionDimensionProp(),axisSelectionDimension:{field:0},start:0,end:s(t),null:(p=t,{field:p,reduceLabel:"none",reduce:"first",value:l}),segment:r.isStacked?s(t):void 0,group:r.isGroupedByDimension?{field:i.majorGroup}:void 0,stack:r.isStacked?{field:i.majorStack}:void 0,measureIndex:r.isGroupedByDimension||r.isStackedByDimension?void 0:o,timeStart:r.isContinuous?{field:i.majorNumeric}:void 0,timeEnd:r.isContinuous?{field:i.majorNumeric}:void 0,fillTooltip:f,...a,...u,id:{value:e=>`r${e.qRow}e${e.qElemNumber}m${o}`},customTooltipAttrExps:0!==r.dimensionCount?Hv.getNode(e.layoutService.getLayout(),r):void 0}};var p;return r.isDimensionless&&(m.value=o),void 0!==n&&(m.source=n),se.deleteUndefinedProperties(m.props),m}))}};return r.isStacked&&(u.data.stack={stackKey:e=>e.stack.value,value:e=>e.end.value,offset:"diverging"}),u}function qC({layoutService:e,viewModel:t},{collectionKey:n}){const{meta:r}=e,{fields:i}=t;if(!r.isStacked)return!1;let o;return o=r.isStackedByMeasure?function(e,t){const n={field:0,props:{sumOfPositives:{fields:t.minor.map((e=>({field:e}))),value:e=>e.reduce(((e,t)=>t>0?e+t:e),0),reduceLabel:"none"},sumOfNegatives:{fields:t.minor.map((e=>({field:e}))),value:e=>e.reduce(((e,t)=>t<0?e+t:e),0),reduceLabel:"none"},null:{fields:t.minor.map((e=>({field:e}))),value:e=>Array.isArray(e)&&e.every((e=>"NaN"===e)),reduceLabel:"none"}}};if(e.isContinuous){const e={field:t.major,value:e=>e.qNum,reduceLabel:"none"};n.props.timeStart=e,n.props.timeEnd=e,n.value=e=>e.qNum}return n}(r,i):function(e,t){if(!e.isContinuous)return{field:t.majorStack,reduceLabel:"none",props:{sumOfPositives:{value:e=>Number(e.qMaxPos.toFixed(13))},sumOfNegatives:{value:e=>Number(e.qMinNeg.toFixed(13))},null:{value:e=>{const{qSubNodes:t=[]}=e;return t.every((e=>"NaN"===((e.qSubNodes||[])[0]||{}).qValue))}}}};const n={field:t.majors[0],value:e=>e.qNum,reduceLabel:"none"};return{field:t.majorStack,trackBy:e=>e.qNum,reduce:e=>e[0],props:{sumOfPositives:{field:t.minor[0],reduceLabel:"none",reduce:e=>e.reduce(((e,t)=>t>0?e+t:e),0)},sumOfNegatives:{field:t.minor[0],reduceLabel:"none",reduce:e=>e.reduce(((e,t)=>t<0?e+t:e),0)},timeStart:n,timeEnd:n}}}(r,i),{key:n,data:{extract:o}}}const MC="main-collection",SC="stack-total-collection";const wC="mini-collection",DC="mini-stack-collection",CC="mini-continuous-collection",NC="miniCube",kC=(e,t)=>{const n=(e=>{const t=[xC(e,{collectionKey:MC})];return e.layoutService.meta.isStacked&&t.push(qC(e,{collectionKey:SC})),t})(t),r=((e,t)=>{const n=[];return Of({layoutService:t.layoutService}).miniChart&&(t.reducedDataModel.mode.isContinuous?n.push(xC(t,{collectionKey:CC},NC)):t.layoutService.meta.isStacked?n.push(function(e,{collectionKey:t}){const{colorService:n,reducedDataModel:{fields:r,mode:i}}=e;return{key:t,data:{extract:r.minor.map(((e,t)=>{const o={end:{field:e,reduceLabel:"none"},...i.isStackedByMeasure&&!i.isReduced?n.getMain().getDatumProps(t):{}};return i.isContinuous&&(o.timeStart={field:r.major,value:e=>e.qNum},o.timeEnd=o.timeStart),{source:"miniCube",field:r.major,props:o}})),stack:{stackKey:e=>e.value,value:e=>e.end.value,offset:"diverging"}}}}(t,{collectionKey:DC})):n.push(function(e,{collectionKey:t}){const{colorService:n,reducedDataModel:{fields:r,mode:i}}=e;return{key:t,data:{extract:r.minor.map(((e,t)=>{const o=i.isReduced?{}:n.getMain().getDatumProps(t),a={end:{field:e},start:0,group:{field:r.majorGroup},measureIndex:t,...o},s={source:"miniCube",field:i.isDimensionless?e:r.major,props:a};return i.isDimensionless&&(s.value=t),s}))}}}(t,{collectionKey:wC}))),n})(0,t);return n.concat(r)};function AC(e,t,n,r){const i=[{position:e,onBackground:!0,justify:0,overflow:r}];if(t){const t={fill:"#e6e6e6",padding:{left:2,right:2,top:2,bottom:2}};i.push({position:"inside",onBackground:!1,justify:"outside"===e?1:0,background:n?t:void 0})}return i}function LC({layout:e,component:t},n,r){if(!qD(e,n))return!1;const{layoutService:i,chart:o,dockService:a,viewModel:s,themeService:l,styleService:u}=n,{meta:c}=i,d=!xD(e,n),f=l.getStyles(),m=u.label.getStyle(),p=m.useContrastColor;function h(e){const t=o.formatter(sw.FORMATTER.MINOR);return t?t(e):e}const g={label:function(e){return 0===e.data.sumOfPositives.value&&0!==e.data.sumOfNegatives.value?"":h(e.data.sumOfPositives.value)},simplifiedPlacements:AC("outside",d,p,c.isContinuous),style:f.label.value},y={label:function(e){return 0===e.data.sumOfNegatives.value&&0!==e.data.sumOfPositives.value?"":h(e.data.sumOfNegatives.value)},simplifiedPlacements:AC("opposite",d,p,c.isContinuous),style:f.label.value};return{key:"stack-total-labels",type:"labels",layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:t,selector:"rect",strategy:{type:"bar",settings:{direction:e=>bD(e.data.sumOfPositives.value,a.meta.minor.orientation,r),labels:[hD(Y(n,g)),hD(Y(n,y))],fontSize:parseInt(m.fontSize,10),fontFamily:m.fontFamily,linkData:al.labels.linkData}}}]},animations:{enabled:s.animations.enabled,trackBy:al.labels.trackBy,compensateForLayoutChanges:al.labels.compensateForLayoutChanges}}}function EC(e,t,n){const r=[{position:e,justify:0,overflow:n,background:{padding:{left:1,right:1,top:1,bottom:1}}}];return t&&r.push({position:"inside",onBackground:!1,justify:1,background:{padding:{left:2,right:2,top:2,bottom:2}}}),r}function TC({layout:e,type:t},n){const{layoutService:r,viewCache:i,themeService:o,styleService:a}=n,{meta:s}=r,{isStacked:l}=s;if(!l&&!xD(e,n)||l&&!qD(e,n))return!1;const u=i.get("minorMinMax");if(!u.hasExplicitMinMax||t===sD.MAX&&0===u.max||t===sD.MIN&&0===u.min)return!1;if(!uD(t===sD.MAX?u.implicitMax:u.implicitMin,u,t))return!1;const c=o.getStyles(),d=a.label.getStyle();let f=e=>e.data.end.label;s.isStacked&&(f=t===sD.MAX?function(e){if(uD(e.data.sumOfNegatives.value,u,t)){const t=0===e.data.sumOfNegatives.value?e.data.sumOfPositives.value:e.data.sumOfNegatives.value,r=n.chart.formatter(sw.FORMATTER.MINOR);return r?r(t):t}return""}:function(e){if(uD(e.data.sumOfPositives.value,u,t)){const t=0===e.data.sumOfPositives.value?e.data.sumOfNegatives.value:e.data.sumOfPositives.value,r=n.chart.formatter(sw.FORMATTER.MINOR);return r?r(t):t}return""});const m={label:f,simplifiedPlacements:EC("outside",true,s.isContinuous),styles:c},p={label:f,simplifiedPlacements:EC("opposite",true,s.isContinuous),styles:c},h=[hD(Y(n,m)),hD(Y(n,p))],g="vertical"===n.dockService.meta.minor.orientation?"down":"right",y={component:`${sw.COMPONENT.GHOST_BAR_OOB}-${t}`,selector:"rect",strategy:{type:"bar",settings:{direction:g,labels:h,fontSize:parseInt(d.fontSize,10),fontFamily:d.fontFamily,linkData:al.labels.linkData}}};return{key:`bar-oob-labels-${t}`,type:"labels",layout:{minimumLayoutMode:"XSMALL"},settings:{sources:[y]},animations:{enabled:n.viewModel.animations.enabled,trackBy:al.labels.trackBy,compensateForLayoutChanges:al.labels.compensateForLayoutChanges}}}function OC(e){return"all"===e||"title"===e}function IC(e,t,n){if(!OC(e.dimensionAxis.show)||t.layoutService.meta.isDimensionless)return!1;const{actions:r,properties:i}=t,o={hyperCube:e.qHyperCube,hyperCubeDef:i&&i.qHyperCubeDef,isDimension:!0,disabled:()=>{var e;return!(null!=r&&null!==(e=r.interact)&&void 0!==e&&e.enabled())},model:t.model,app:t.app,translator:t.translator,rtl:n,selections:t.selections,supportConditional:t.flags.isEnabled("IM_1579_HIDE_DIM_MEA")},a=t.styleService.axis.title.getStyle();return t.layoutService.meta.hasMultipleDimensions&&(o.padding="0",o.minWidth="auto"),{key:"dimension-title",type:"data-title",layout:{minimumLayoutMode:$w[`${t.dockService.meta.major.orientation}DimensionAxisTitle`].minimumLayoutMode,dock:t.dockService.meta.major.dock},settings:o,style:a}}function PC(e,t,n){if(!OC(e.measureAxis.show))return!1;const{layoutService:r,actions:i}=t,o=t.properties,a=r.getLayoutValue("qUndoExclude")?"qUndoExclude.qHyperCubeDef":"qHyperCubeDef",s={hyperCube:r.getHyperCube(),hyperCubeDef:jh(o,a),isDimension:!1,disabled:()=>!i.interact.enabled(),model:t.model,app:t.app,translator:t.translator,rtl:n,selections:t.selections,supportConditional:t.flags.isEnabled("IM_1579_HIDE_DIM_MEA")},l=t.styleService.axis.title.getStyle();return t.layoutService.meta.hasMultipleMeasures&&(s.padding="0",s.minWidth="auto"),{key:"measure-title",type:"data-title",layout:{minimumLayoutMode:"SMALL",dock:t.dockService.meta.minor.dock},settings:s,style:l}}function RC({environment:e,rtl:t,refLineModel:n,layoutService:r,colorService:i,dockService:o,themeService:a,viewModel:s,chart:l}){const{theme:u,localeInfo:c}=e,d={resolveUIColor:i.getMain().getPaletteColor},f=a.getStyles(),m=s.animations.enabled;return[fl({refLineModel:n,layoutService:r,colorModel:d,dockService:o,animationsEnabled:m,chart:l,scale:sw.SCALE.MAIN.MINOR,axis:"horizontal"===o.meta.major.orientation?"y":"x",key:sw.COMPONENT.MEASURE_REF_LINE,minimumLayoutMode:$w.refLines.minimumLayoutMode}),fl({isDimension:!0,refLineModel:n,layoutService:r,colorModel:d,dockService:o,animationsEnabled:m,chart:l,scale:sw.SCALE.MAIN.MAJOR,axis:"horizontal"===o.meta.major.orientation?"x":"y",rtl:t,key:sw.COMPONENT.DIMENSION_REF_LINE,mainComponentKey:sw.COMPONENT.BAR,minimumLayoutMode:$w.refLines.minimumLayoutMode}),...gl({refLineModel:n,layoutService:r,colorModel:d,animationsEnabled:m,dock:o.meta.minor.opposite,scale:sw.SCALE.MAIN.MINOR,style:f,formatter:sw.FORMATTER.MINOR,theme:u,localeInfo:c,rtl:t,key:sw.COMPONENT.MEASURE_REF_LINE_LABEL}),...gl({isDimension:!0,refLineModel:n,layoutService:r,colorModel:d,animationsEnabled:m,dock:o.meta.major.opposite,scale:sw.SCALE.MAIN.MAJOR,style:f,theme:u,localeInfo:c,rtl:t,key:sw.COMPONENT.DIMENSION_REF_LINE_LABEL})]}const FC=(e,t,n)=>{var r;const{layoutService:i,dockService:o,colorService:a,chart:s,actions:l,discrete:u,continuousDataModel:c,reducedDataModel:d,viewModel:f,viewState:m,viewCache:p,themeService:h,refLineModel:g,pluginService:y,rtl:v,logicalSize:b,trendLineModel:x}=t,{localeInfo:q}=n,M=AD({layout:e},t,v);if(M&&"center"===M.layout.dock)return{components:[M]};const S=cC(e,t,{localeInfo:q,rtl:v}),w=!(null!=l&&null!==(r=l.interact)&&void 0!==r&&r.enabled()),D=a.getMain().getLegend({eventName:"legend-c",key:"legend-color",viewState:m,chart:s,styleReference:"object.barChart",styleOverrides:{title:t.styleService.legend.title.getStyle(),label:t.styleService.legend.label.getStyle()},rtl:v,settings:{item:{shape:{size:10}}}},{actions:l,navigationDisabled:w}),C=D.components[0];if(C){const{dock:e}=C.layout;if(S.fillRange&&(["right","left"].includes(e)||v)&&(S.fillRange.invert=!0),"legend-seq"===C.type&&void 0!==f.selectionDimensionIdx&&S.fillRange&&S.fillRange.min<S.fillRange.max){const e=Vw({eventName:"legendRange",key:"legendRangeBrush",targets:[C.key],fillTargets:[C.key],targetSelector:'[id="legend-seq-target"]',targetFillSelector:'[id="legend-seq-ticks"]',dock:C.layout.dock,scale:"fillRange",bubblesPlacement:"outside",onEdited:()=>{l.select.emit("end","legendRange")}},t);D.components.push(...e.components),D.interactions.unshift(...e.interactions)}}else S.fillRange&&v&&(S.fillRange.invert=!0);const N=((e,{componentKey:t,collectionKey:n})=>{var r,i,o,a;const{meta:s}=e.layoutService;let l,u;s.isGroupedByDimension?l=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:s.isGroupedByMeasure&&(l=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2);let c=2;s.isContinuous?(u={start:"timeStart",end:"timeEnd"},c=nD(e,t)):s.isStacked&&(u="stack");const d=s.isStackedByDimension&&e.layoutService.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1,f=e=>{var t;return!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value)},m=e.layoutService.getLayoutValue("components",null),p=m?m.filter((e=>e.key===t))[0]:null;return{key:t,type:"box",data:{collection:n},preferredSize:s.isContinuous?()=>({size:0,edgeBleed:{left:1,right:1}}):void 0,brush:{consume:[{context:"selection",data:["selectionDimension","axisSelectionDimension","end","fill","timeEnd"],style:{active:{strokeWidth:s.isContinuous||d?0:2,stroke:"#000"},inactive:{opacity:.3}}}]},settings:{major:{scale:sw.SCALE.MAIN.MAJOR,fn:l,ref:u},minor:{scale:sw.SCALE.MAIN.MINOR},orientation:e.dockService.meta.minor.orientation,box:{width:eD({layoutService:e.layoutService,discrete:e.discrete,componentKey:t}),minWidthPx:c,fill:e.colorService.getMain().getColor(),opacity:e=>f(e)?0:void 0,minHeightPx:function(e){return s.isStacked?.1:f(e)?.01:.3},strokeWidth:null!=p&&null!==(r=p.style)&&void 0!==r&&r.strokeWidth?Jw.BAR.STROKE.WIDTH[p.style.strokeWidth.toUpperCase()]:Jw.BAR.STROKE.WIDTH.NONE,stroke:null!==(i=null==p||null===(o=p.style)||void 0===o||null===(a=o.strokeColor)||void 0===a?void 0:a.color)&&void 0!==i?i:Jw.BAR.STROKE.COLOR},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:{enabled:e.viewModel.animations.enabled,isMainComponent:!0,trackBy:al.bars.trackBy,compensateForLayoutChanges:al.bars.compensateForLayoutChanges}}})(t,{componentKey:sw.COMPONENT.BAR,collectionKey:sw.COLLECTION.MAIN}),k=((e,{componentKey:t,collectionKey:n})=>{const{meta:r}=e.layoutService;if(!r.isStacked)return!1;let i=2;r.isContinuous&&(i=nD(e,t));const o=e.layoutService.getLayoutValue("components",null),a=o?o.filter((e=>e.key===t))[0]:null,s={key:t,type:"box",data:{collection:n},settings:{major:{scale:sw.SCALE.MAIN.MAJOR},minor:{scale:sw.SCALE.MAIN.MINOR,start:{ref:"sumOfNegatives"},end:{ref:"sumOfPositives"}},orientation:e.dockService.meta.minor.orientation,box:{width:bC(r,a),minWidthPx:i,opacity:0,fill:"none"},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},brush:{consume:[{context:"selection",data:[""],style:{active:{strokeWidth:2,stroke:"#000",opacity:e=>{var t,n;return!0===(null===(t=e.data)||void 0===t||null===(n=t.null)||void 0===n?void 0:n.value)?0:1}},inactive:{opacity:e=>{var t,n;return!0===(null===(t=e.data)||void 0===t||null===(n=t.null)||void 0===n?void 0:n.value)?0:.3}}}}]}};return r.isContinuous&&(s.settings.major.ref={start:"timeStart",end:"timeEnd"}),s})(t,{componentKey:sw.COMPONENT.STACK_TOTAL_BAR,collectionKey:sw.COLLECTION.STACK_TOTAL}),A=pC(t,n,f.selectionDimensionIdx),{isStacked:L}=i.meta;let E;E=d.mode.isContinuous?sw.COLLECTION.MINI_CONTINUOUS:L?sw.COLLECTION.MINI_STACK:sw.COLLECTION.MINI;const T=L?k:N,O=jD(0,t),I=[...O,vC(t,{barComponent:T,type:"max",isStacked:L}),vC(t,{barComponent:T,type:"min",isStacked:L}),dD(t,{barComponent:T,type:"max",isStacked:L}),dD(t,{barComponent:T,type:"min",isStacked:L}),mD(t,{chart:s,barComponent:T,type:"max",scales:S,collectionKey:L?sw.COLLECTION.STACK_TOTAL:sw.COLLECTION.MAIN}),mD(t,{chart:s,barComponent:T,type:"min",scales:S,collectionKey:L?sw.COLLECTION.STACK_TOTAL:sw.COLLECTION.MAIN}),...Xw(e,t,v,!!O[0]),N,k,hC({layoutService:i,viewModel:f,layout:e,dockService:o}),IC(e,t,v),PC(e,t,v),...RC({environment:n,rtl:v,refLineModel:g,layoutService:i,colorService:a,dockService:o,themeService:h,viewModel:f,chart:s}),Vo({viewState:m,viewCache:p,layoutService:i,dockService:o,rtl:v}),KD(N,t,{collectionKey:E}),If({layoutService:i,dockService:o,discrete:u,continuousDataModel:c,viewState:m,viewCache:p,themeService:h,rtl:v,deviceType:n.deviceType}),...BS({majorScale:sw.SCALE.MAIN.MAJOR,minorScale:sw.SCALE.MAIN.MINOR,tooltipOverlay:sw.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{layoutService:i,trendLineModel:x,dockService:o,animationsEnabled:f.animations.enabled}),...D.components,SD({layout:e,component:sw.COMPONENT.BAR,minorScale:S.minor},t,v),LC({layout:e,component:sw.COMPONENT.STACK_TOTAL_BAR},t,v),TC({layout:e,component:"bar-oob-max",type:"max"},t),TC({layout:e,component:"bar-oob-min",type:"min"},t),...A.components,DD(0,{...t,coloring:a.getMain().getSettings()},v),ND(0,{...t,coloring:a.getMain().getSettings()},v),(!1!==e.showDisclaimer||!t.flags.isEnabled("SHOW_DISCLAIMER"))&&M,KS({tooltip:sw.COMPONENT.TREND_LINES_TOOLTIP,formatter:sw.FORMATTER.MINOR,majorScale:sw.SCALE.MAIN.MAJOR},t,{rtl:v})].filter(Boolean);!function(e){if(e&&0!==e.length)for(let t=0;t<e.length;t++)e[t].layout=e[t].layout||{},e[t].layout.displayOrder=t}(I);const P=[...D.interactions,...A.gestures].sort(((e,t)=>(t.prio||0)-(e.prio||0)));return{interactions:UD(t,{rtl:v,hammer:{gestures:P}}),scales:S,palettes:a.getMain().getPalettes(),components:y.extendComponents(I),strategy:ne(0,{logicalSize:b,minCenterRatio:0}),formatters:LD(t,S),collections:kC(0,t)}};function jC({picasso:e,chart:t,services:n,environment:r,viewState:i,viewCache:o,bootstrapped:a}){const{width:s,height:l}=O(),u=k(),c=E(),d=w(),[f,m]=b(),[p,h]=b(),[g,y]=b(),[v,x]=b(),q=A();function S(){if(!t.layoutComponents)return Promise.resolve();const{discrete:a,layoutService:s,viewModel:l}=n;o.set("isPreRender",!0);const m=function(a={}){const{selectionService:s,refLineModel:l,discrete:m,reducedDataModel:p,continuousDataModel:h,trendLineModel:g,pluginService:y,colorService:v,viewModel:b,dockService:x,themeService:M,customTooltipModel:S,layoutService:w,logicalSize:D,styleService:C}=n,N=s.custom.getActions(),k=e.data("q")(f.prepPicassoDataSet()),A={picasso:e,ds:k,rtl:"rtl"===(null==d?void 0:d.direction),model:u,app:q,chart:t,actions:N,localeInfo:r.localeInfo,logicalSize:D,flags:r.flags,translator:r.translator,selections:c,isLocked:s.getIsSelectionLocked,viewCache:o,viewState:i,layoutService:w,dockService:x,viewModel:b,colorService:v,selectionService:s,themeService:M,trendLineModel:g,discrete:m,continuousDataModel:h,reducedDataModel:p.model(),customTooltipModel:S,debouncer:_h,refLineModel:l,pluginService:y,styleService:C,...a};return FC(w.getLayout(),A,r)}(p);f.extractDataPages(),t.layoutComponents({settings:m,data:g}),o.set("isPreRender",!1),f.insertDataPages(),l.animations.hasSlicedHats=m.components.filter((e=>"box-sliced-hat"===e.type)).length>0;const h=[];return 1!==m.components.length&&s.meta.isDiscrete&&h.push(a.command.initialize()),Promise.all(h)}const[[D,C]=[]]=I((()=>{var s,l;if(!(e&&t&&n&&r&&i&&o&&a))return Promise.resolve();const{layoutService:u,selectionService:c,refLineModel:d,discrete:f,continuous:m,reducedDataModel:p,continuousDataModel:h,trendLineModel:g,legendLayoutService:y,colorService:v,pluginService:b,viewModel:q,customTooltipModel:M}=n;if(null==c||null===(s=c.custom)||void 0===s||!s.getActions())return Promise.resolve();const{flags:S}=r;if(null!=S&&null!==(l=S.isEnabled)&&void 0!==l&&l.call(S,"IM_1579_HIDE_DIM_MEA")){const{properties:e}=a,t=null==e?void 0:e.qHyperCubeDef.qDimensions.some((e=>{var t,n;return null===(t=e.qCalcCondition)||void 0===t||null===(n=t.qCond)||void 0===n?void 0:n.qv}));t&&(M.useCustomTooltip=!1)}const w=()=>{x(Date.now()),q.animations.isPartialUpdating=!0};i.onChanged("scrollOffset",(()=>{y&&y.setDataPages([f.query.getCurrentDataPage()]),d&&d.update(),w()})),i.onChanged("legendScrollOffset",w),i.intercept("zoom",m.event.onZoomIntercept({viewCache:o})),i.onChanged("zoom",m.event.onZoomChange({layoutService:u,continuousDataModel:h},w)),c.setLayout(u.getLayout());const D=[];u.meta.isContinuous&&(h.update(u.getLayout()),D.push(h.initialFetch())),g.command.update(),D.push(p.fetch().then((({reducedCube:e})=>{p.update(e)}))),D.push(Promise.resolve({properties:a.properties}));return Promise.all(D).then((e=>Promise.all([b.initialize(),v.initialize(),Rw({reducedDataModel:p,layoutService:u,continuousDataModel:h,trendLineModel:g})]).then((t=>[e,t.pop()]))))}),[a]);M((()=>{var e;if(null==n||null===(e=n.colorService)||void 0===e||!e.getMain()||!C)return;const{layoutService:t,selectionService:i,reducedDataModel:a,continuousDataModel:s,trendLineModel:l,legendLayoutService:u,colorService:c,viewModel:d}=n;o.set("minorMinMax",C);const f=t.getHyperCube(),p=t.meta.isContinuous?s.getInitialCube():a.model().cube,{field:g}=c.getMain().getSettings(),y=!t.meta.isContinuous&&(a.model().mode.isReduced||t.meta.isStacked)&&u,v=y?u.getHyperCube():void 0;i.setBrushAliases({colorField:g,useLegendCube:y,legendAlias:`legendCube/${g}`});const b=function({mainCube:e,miniCube:t,legendCube:n,localeInfo:r,layoutService:i,viewModel:o,trendLineModel:a}){const s=i.refs.dataPages.split(".").pop();let l=[],u=[];const c=i.meta.isContinuous?[{key:o.fields.majorNumeric,from:i.meta.isStackedByDimension?o.fields.majorStack:o.fields.major,override:{value:e=>e.qNum}}]:void 0;return{prepPicassoDataSet:()=>({key:"qHyperCube",data:e,config:{localeInfo:r,virtualFields:c}}),prepPicassoData(i){const o=[{type:"q",key:"qHyperCube",data:e,config:{localeInfo:r,virtualFields:c}},{type:"q",key:"miniCube",data:t,config:{localeInfo:r,virtualFields:c}},...i];return n&&o.push({type:"q",key:"legendCube",data:n,config:{localeInfo:r,virtualFields:c}}),a.query.hasTrendLines()&&o.push({key:"trend",data:a.query.getData()}),o},extractDataPages(){l=e[s],u=t.qDataPages,e[s]=[],t.qDataPages=[]},insertDataPages(){e[s]=l,t.qDataPages=u}}}({mainCube:f,miniCube:p,legendCube:v,localeInfo:r.localeInfo,layoutService:t,viewModel:d,trendLineModel:l}),x=D[D.length-1];h({localeInfo:r.localeInfo,...x}),m(b)}),[C]),M((()=>{if(!n||!p||!f)return;const e=n.colorService.getMain();if(!e)return;f.prepPicassoDataSet();const t=f.prepPicassoData(e.getData());y(t)}),[p]),M((()=>{var e;null!=n&&null!==(e=n.colorService)&&void 0!==e&&e.getMain()&&t.update&&f&&g&&S().then((()=>{const{layoutService:e,discrete:r,legendLayoutService:i}=n;if(i){1===e.getLayoutValue("scrollStartPos")&&i.setDataPages([r.query.getCurrentDataPage()])}t.update(),al.cacheProperties({viewCache:o,layout:e.getLayout()})}))}),[g]),M((()=>{if(!(s&&l&&f&&null!=t&&t.update&&null!=n&&n.colorService.getMain()))return;const{viewModel:e}=n;e.animations.isSizeChanging=!0;const{dockService:i,themeService:o}=n;i.update({width:s,height:l}),o.setTheme(r.theme),S().then((()=>{t.update&&t.update()}))}),[s,l]),M((()=>{if(null==t||!t.update)return;const{viewModel:e}=n;t.update({partialData:!0,excludeFromUpdate:["mini-marker","dim-title","measure-title","ref-line","grid-line"]}),e.animations.isPartialUpdating=!1}),[v])}const HC=({properties:e,layout:t,isStacked:n,isContinuous:r,model:i})=>{var o,a;const s=t.qHyperCube.qDimensionInfo.filter((e=>{var t;return 7005!==(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)})),l=t.qHyperCube.qMeasureInfo.filter((e=>{var t;return 7005!==(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)})),u=Y(!0,{},e);return((e,t,n)=>{const{color:{mode:r}}=n;e.length>1&&n.color?n.color.persistent=!0:"byDimension"===r&&t.length>1?n.color.mode="byMultiple":"byExpression"===r&&0===t.length?n.color.mode="primary":0===e.length&&t.length>0&&(n.color.byMeasureDef=void 0,n.color.byDimDef=void 0,1===t.length&&(n.color.mode="primary"))})(s,l,e),s.length>1&&n&&!r&&"S"===e.qHyperCubeDef.qMode&&(e.qHyperCubeDef.qMode="K"),s.length<2&&"K"===e.qHyperCubeDef.qMode&&(e.qHyperCubeDef.qMode="S"),null===(o=i.colorSupport)||void 0===o||null===(a=o.colorByUpdater)||void 0===a||a.call(o,e,"qHyperCubeDef.",t),JSON.stringify(u)!==JSON.stringify(e)&&(e.hash=Math.random(),!0)};var zC={exports:{}};self,zC.exports=(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,u,c,d=arguments[0],f=1,m=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<m;++f)if(null!=(t=arguments[f]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(p&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&a(r)?r:{},s(d,{name:n,newValue:e(p,c,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}},645:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,u,c,d=arguments[0],f=1,m=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<m;++f)if(null!=(t=arguments[f]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(p&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&a(r)?r:{},s(d,{name:n,newValue:e(p,c,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Ee});var e=r(229),t=r.n(e);const n=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},o=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function u(e){return s+e+l}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function f(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function m(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function h(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function v(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function b(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var u=v(c(r[0],i),p(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(r&&2===r.length){var d=c(r[0],i),f=c(r[1],i),m=p(0),h=p(1),g=v(d,m),y=v(f,h);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function q(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const M={isFullRange:d,getNumDimensions:q,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=u(m(t));if(!n.showExcludedValues)return a;var s=b({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=p(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var d=p(0),f=p(1);return"If(Count(".concat(d,") * Count(").concat(f,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:f,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return f(e,t)},getAboveCompPrefix:h,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return h(e,t)+n+g(r)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===q({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:m,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:c,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=q({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=n.qHyperCubeDef.qMeasures.find((function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null}));i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=a.OPTIONS.find((function(t){return t.value===e.decomposition}));return t?a.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find((function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[n]&&r.includes(a.EXPRESSIONS[n].toLowerCase())&&(t=n),n})),t}};function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}var D=t().bind(null,!0),C={},N=Array.isArray;function k(e){return null!=e&&!Array.isArray(e)&&"object"===w(e)}function A(e){return void 0===e}function L(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function E(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach((function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=A(e[n||t])?o:e[t],e=e[n||t]}})),e}function T(e,t){var n=!0;if(k(e)&&k(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){T(e[r],t[r])||(n=!1)})),n);if(N(e)&&N(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!T(e[r],t[r]))return!1;return!0}return e===t}C.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?D({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);T(o,a)||L(t,i)||(A(a)?r.push({op:"add",path:s,value:o}):k(o)&&k(a)?r=r.concat(C.generate(a,o,s)):N(o)&&N(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&A(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(T(t,i))return r;if(!A(t[0])&&A(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(C.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){A(t[i])&&!L(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},C.apply=function(e,t){t.forEach((function(t){var n,r,i=E(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(N(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(N(a)&&N(t.value)){var l,u=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return S(e)}(r=u)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(k(a)&&k(t.value))n=a,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!L(n,e)&&delete n[e]})),D(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var c=E(e,t.from);N(i)?i.splice(+o,0,c.splice(+s,1)[0]):(i[o]=c[s],delete c[s])}else"remove"===t.op&&(N(i)?i.splice(+o,1):delete i[o])}))},C.clone=function(e){return D({},e)},C.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},C.updateObject=function(e,t){Object.keys(e).length?C.apply(e,C.generate(e,t)):D(e,t)};const O=C,I=function(e,n,r){if(!e)return Promise.resolve();var i=O.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(i,!0)):Promise.resolve()};var P="accumulation";function R(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===P)return n[r]}function F(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===P)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var j={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const H={translationKey:"properties.modifier.accumulation",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=M.getNumStepComp(n,l),f=M.getAboveComp(n,l,c,d),m=M.getRangeComp("RangeSum",f);if(M.needDimension({modifier:n,properties:r,layout:i})){var p=M.getDimComp(u,1),h=M.getDimComp(u,0),g=M.getAggrComp(m,p,h);m=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return m},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,j)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(F(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(F(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(F(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(F(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=R(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=R(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(F(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(P))return!1;var o=R(t,e);return o&&!o.disabled}};return n}};var z="movingAverage";function B(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===z)return n[r]}function _(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===z)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var V={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const $={translationKey:"properties.modifier.movingAverage",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var u=s;void 0===u&&(u=M.getNumDimensions({properties:i,layout:a}));var c=o(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,f=M.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:d}),m=M.getNumStepComp(r,u),p=M.getAboveComp(r,u,f,m);if(r.nullSuppression)t=M.getRangeComp("RangeAvg",p);else{var h=M.getRangeComp("RangeSum",p),g=function(e,t){var n=M.getRowNoComp(e,t);if(!M.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,u);t="".concat(h," / ").concat(g)}var y=t;if(M.needDimension({modifier:r,properties:i,layout:a})){var v=M.getDimComp(c,1),b=M.getDimComp(c,0),x=M.getAggrComp(y,v,b);y=r.showExcludedValues?M.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,V)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(_(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(_(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(_(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(_(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=B(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=B(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(_(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(_(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(z))return!1;var o=B(t,e);return o&&!o.disabled}};return n}};var U="timeSeriesDecomposition";function W(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===U)return n[r]}function K(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===U)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var G={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const Y={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?M.generateTSDExpression(n,t,r):t},extractInputExpression:M.extractInputExpression,initModifier:function(e,t){M.initModifier(e,G),""===e.decomposition&&t&&(e.decomposition=M.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(K(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:a.OPTIONS},steps:{refFn:function(t){return"".concat(K(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=W(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map((function(e){return e.qDef.modifiers.map((function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e})),e}))}},show:function(t){var n=W(t,e);return n&&!n.fullRange}}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(U))return!1;var o=W(t,e);return o&&!o.disabled}};return n}};var X="difference";function J(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===X)return n[r]}function Z(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===X)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=M.getAboveComp(n,l,c),f="".concat(c," - ").concat(d);if(M.needDimension({modifier:n,properties:r,layout:i})){var m=M.getDimComp(u,1),p=M.getDimComp(u,0),h=M.getAggrComp(f,m,p);f=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:h}):h}return f},initModifier:function(e){Object.keys(Q).forEach((function(t){void 0===e[t]&&(e[t]=Q[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(Z(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(X))return!1;var o=J(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,n){return 1===e?"{$<".concat(M.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ue(e,t,n){return 0===e&&t>1?"<".concat(M.getDimDefWithWrapper(n),">"):""}const ce={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=n.selectionScope,f=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=ae(t),l=se(t,n,r),u=""===s&&""===l?"":s||l,c=le(i,o),d=ue(i,o,a),f=function(e){for(var t=[],n=0;n<e;n++)t[n]=M.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(d," Aggr(").concat(u," ").concat(e,", ").concat(f,"))")}(c,d,n.field,n.value,f,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach((function(t){void 0===e[t]&&(e[t]=oe[t])}))},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var r=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return r=function(e,t,n){if(1===e){var r=ie(t,0);t.splice(r,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(re(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(re(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,r){return function(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t,n){if(e<2){var r=ie(t,0);t.splice(r,1)}return t}(i,o),o=function(e,t,n){if(0===e){var r=ie(t,1);t.splice(r,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ue};var de="qDef.base",fe="qDef.qDef",me="qDef.base.qDef",pe="qLibraryId",he="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,me);return void 0!==t?t:o(e,fe)},getExpressionRef:function(e){return void 0!==o(e,me)?me:fe},getLibraryIdRef:function(e){return o(e,he)?he:pe},getLibraryId:function(e){return o(e,he)||o(e,pe)},getLabelRef:function(e){return o(e,de)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,de)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",qe="qDef.qLabel",Me="qDef.qLabelExpression",Se="qDef.base.qLabel",we="qDef.base.qLabelExpression",De="qDef.qAggrFunc",Ce="qDef.base.qAggrFunc",Ne={initBase:function(e,t){(t||Ne.isValid(e))&&(n(e,ve,o(e,ye)),n(e,xe,o(e,be)),n(e,Se,o(e,qe)),n(e,we,o(e,Me)))},restoreBase:function(e){Ne.isValid(e)&&(n(e,ye,o(e,ve)),n(e,be,o(e,xe)),n(e,qe,o(e,Se)),n(e,Me,o(e,we)),o(e,De)&&o(e,Ce)&&n(e,De,o(e,Ce)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),n=o(e,xe);return void 0!==t||void 0!==n}};const ke=Ne;function Ae(e){return Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ae(e)}var Le={accumulation:H,movingAverage:$,difference:ee,normalization:ce,timeSeriesDecomposition:Y};const Ee={modifiers:Le,apply:Oe,applyModifiers:Ie,cleanUpMeasure:Pe,destroy:function(e){e&&Te[e.id]&&Te[e.id].masterItemSubscriber&&(Te[e.id].masterItemSubscriber&&Te[e.id].masterItemSubscriber.unsubscribe(),delete Te[e.id])},hasActiveModifiers:Re,getActiveModifier:Fe,initBase:ke.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return Le[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return Le[e]&&Le[e].isApplicable({properties:n,layout:r})}))},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=ze(e);Ke({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ze({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:je};var Te={};function Oe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,a=void 0!==i&&i,s=e.masterItem,l=!1;Te[n.id]=Te[n.id]||{isFirstTime:!0};var u=Te[n.id].isFirstTime;if(Te[n.id].isFirstTime=!1,r&&"object"===Ae(r))return Ie({model:n,properties:r});var c=n?n.layout:void 0,d=o(c,"qSelectionInfo.qInSelections");if(a||d)return Promise.resolve(l);var f=o(c,"qHyperCube.qMeasureInfo"),m=Te[n.id].lastReloadTime;if(Te[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Re({measures:f,layout:c})){var p=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return We({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:f,layout:c,model:n,lastReloadTime:m});return p||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return Ke({modifiers:ze(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:f,layout:c,masterItem:s,isFirstTime:u})?n.getEffectiveProperties().then((function(e){var r=t()(!0,{},e);_e(r);var i=Qe(r);return Ge({model:n}).then((function(t){return Ye({libraryIds:i,model:n}).then((function(i){return p&&function(e){var t=e.properties;He(t).forEach((function(e){return function(e){var t=e.measure;if(We({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===Ae(e)&&!e.disabled){if(n++,"object"!==Ae(Le[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=Le[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&$e(t)&&M.simplifyExpression(t.qDef.base.qDef)!==M.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:r}),Ie({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:i,dimensionAndFieldList:t})}))}))})):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===Ae(e.base)}))}(f)?n.getEffectiveProperties().then((function(e){return function(e){var n=e.model,r=e.properties,i=Qe(r);return et({model:n,libraryIds:i}).then((function(){var e=t()(!0,{},r);return He(r).forEach((function(e){return Pe(e)})),Je({oldProperties:e,newProperties:r,model:n})}))}({model:n,properties:e})})):Promise.resolve(l)}function Ie(e){var n=e.model,r=e.oldProperties,i=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),_e(i);var f=Qe(i);return et({model:n,libraryIds:f,masterItem:u}).then((function(){return function(e){var n=e.measures,r=e.properties,i=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=He(r)),!n.length)return Promise.resolve();if(!Re({measures:n,properties:r}))return n.forEach((function(e){return Pe(e)})),Promise.resolve();var l=a?void 0:Qe(r);return Ge({model:i,dimensionAndFieldList:s}).then((function(e){return Ye({libraryIds:l,model:i,libraryItemsProps:a}).then((function(i){n.forEach((function(n){Ke({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;ke.isValid(n)||ke.initBase(n,!0);var l=n.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach((function(e){if("object"===Ae(e)&&!e.disabled){if(s++,"object"!==Ae(Le[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Le[e.type].initModifier(e,n);var l=n.qLibraryId||c&&c.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Le[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||a.qMeasure.qLabel)&&(n.qDef.qLabel=a.qMeasure.qLabel),(n.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=a.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(n.qDef.qNumFormat=a.qMeasure.qNumFormat,n.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=a.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:a}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof Le[r.type].updateModifier&&Le[r.type].updateModifier(r,i.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:Le[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=s,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:a}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||je(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&je(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}}))}({measure:n,properties:r,libraryItemsProps:i,dimensionAndFieldList:e}),Ve(n)):Pe(n)}))}))}))}({measures:a,properties:i,model:n,libraryItemsProps:c,dimensionAndFieldList:d}).then((function(){return l?Je({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)}))}))}function Pe(e){!function(e){var t=ze(e);return Array.isArray(t)&&t.some((function(e){return"object"===Ae(e)&&!e.disabled&&!Le[e.type]}))}(e)?ke.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Ve(e)}function Re(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ke({modifiers:ze(e),properties:n,layout:r})}))}function Fe(e){var t=ze(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Le[r.type]&&!r.disabled)return r}}function je(e){var t=Fe(e);return!t||Le[t.type].enableTotalsFunction(e)}function He(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function ze(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Be(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function _e(e){He(e).forEach((function(e){return function(e){var n=Fe(e);n&&(void 0!==n.outputExpression&&Be(n)!==e.qDef.qDef?delete e.qDef.base:!ke.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)}))}function Ve(e){var t=ze(e);Array.isArray(t)&&t.forEach((function(t){"object"===Ae(t)&&(t.disabled||!Le[t.type]&&Be(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function $e(e){return e.base||e.qDef&&e.qDef.base}function Ue(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function We(e){var t=e.measure,n=e.properties,r=e.layout;return!Ue(t)&&Ke({modifiers:ze(t),properties:n,layout:r})}function Ke(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==Ae(e)||e.disabled||!Le[e.type])&&(void 0===i[e.type]&&(i[e.type]=Le[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function Ge(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then((function(e){i.dimensionList=e}));r.push(o);var a=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(a),Promise.all(r).then((function(){return i}))}function Ye(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),Promise.all(s).then((function(){return a}))}function Xe(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Xe)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):I(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Ze(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===Ae(e)&&!e.disabled&&Le[e.type]&&Le[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function Qe(e){var t=He(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=ze(t);if(Ke({modifiers:r,properties:e})){var o=Ue(t);o&&n.push(o),i=i||Ze({modifiers:r,properties:e})}})),o(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Te[t.id].masterItemSubscriber=Te[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=o(e,n)})),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function c(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),a={},t.forEach((function(e){a[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach((function(e){i[e]||a[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&s.push(c(e,"getMeasure"))})),Object.keys(a).forEach((function(e){a[e]&&!r[e]&&s.push(c(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return Oe({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),Te[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}n.d(r,{default:()=>_e});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}const d={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:c};var f=n(645),m=n.n(f);const p=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},h=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&d.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},v=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},b=function(e){e.forEach((function(e){m().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))};function x(e,t,n){var r,i,a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((i=(i=(r=JSON.stringify(a)).match(/:\{/g))?i.length:0)>2)return;a=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var s=o.getValue(e,"qLayoutExclude.quarantine");s[n]||(s[n]={}),s[n][t]=a}var q=n(229),M=n.n(q);function S(e,t){var n=M()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function w(e,t){return M()(!0,{},t,e)}function D(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var C=Math.pow(2,53)-1;function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const A=function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},L=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},E=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},T=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},O=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},I=function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=S(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var u=S(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},P=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=w(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var u=w(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},R=function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=D(a.max,i.dimensions.length,C),l=D(a.min,i.dimensions.length,0);return{maxDimensions:D(o.max,s,C),minDimensions:D(o.min,l,0),maxMeasures:s,minMeasures:l}},F=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(d.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,d.indexRemoved(n.qInterColumnSortOrder,o))},j=function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=M()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]})),null===(i=M()(!0,{},n,i)).components&&(i.components=[]),i},H=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},z=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},B=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return N(e)}(t=a.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return N(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?N(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qDimensions=[],s.forEach((function(e){a.qDimensions.push(e),r.dimensions.added(e,n)}))}},_=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return k(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qMeasures=[],s.forEach((function(e){a.qMeasures.push(e),r.measures.added(e,n)}))}},V=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&m().isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))};function $(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}const U={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p({exportFormat:i,qHyperCubeDef:l}),h({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),v({exportFormat:i,properties:a}),r||b(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(x(i.properties,"filters","storedFilters"),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(x(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(x(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,u=e.hypercubePath,c=e.extension,d=e.supportedFilters,f=void 0===d||d,m=e.isHCModifierSupported,p=void 0===m||m,h={qChildren:[]},g=j({exportFormat:t,initialProperties:r,hypercubePath:u}),y=o.getValue(r,u||"").qHyperCubeDef,v=o.getValue(g,u||"").qHyperCubeDef,b=R({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,q=b.minDimensions,M=b.maxMeasures,S=b.minMeasures,w=l.defaultDimension,D=void 0===w?T():w,C=l.defaultMeasure,N=void 0===C?O():C;v.qDimensions.length=0,v.qMeasures.length=0,H({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:M,minMeasures:S})&&z({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:M,minMeasures:S,newHyperCubeDef:v}),I({exportFormat:t,maxDimensions:x,minDimensions:q,newHyperCubeDef:v,defaultDimension:D}),P({exportFormat:t,maxMeasures:M,minMeasures:S,newHyperCubeDef:v,defaultMeasure:N}),B({newProperties:g,dataDefinition:a,hypercubePath:u}),_({newProperties:g,dataDefinition:a,hypercubePath:u}),F({exportFormat:t,newHyperCubeDef:v}),L("qMaxStackedCells",y,v),L("qNoOfLeftDims",y,v),E("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),E("qMode",y,v,"S"),E("qReductionMode",y,v,"N"),E("qSortbyYValue",y,v),E("qIndentMode",y,v),E("qShowTotalsAbove",y,v),A(g,t,r),h.qProperty=g;var k=o.getValue(c||{},"support.modifiers");return V({measures:v.qMeasures,modifierTypes:k}),f&&$(h.qProperty,"storedFilters"),"S"===v.qMode&&p&&$(h.qProperty,"dynamicScript"),h}};var W={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function K(e,t,n,r){t=t||[];var i=c(e,r,n),o=c(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function G(e,t){return e.length!==t}const Y={create:function(e,t){if(!e||!W[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(K(a,t,r,i),G(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},X={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},J={colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>0&&X.getNumMeasures(e)<=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>0},expression:function(e){return X.getNumMeasures(e)>=1}}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}};var Q={scatterplot:Z,"sn-scatter-plot":Z,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)<=1},expression:function(e){return X.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>=1},expression:function(e){return X.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=d.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=Y.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})),t.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}))}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;te(r,i);var l=r[r.length-1];if(l){var u=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),f=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var m=Y.create(Y.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:m,label:s,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:f});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:m,measures:a,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:f})}n?(m.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(m)):l.qAttributeExpressions.push(m)}}}function ie(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":i=function(e,t){return t?e.qLibraryId:m().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return m().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,n,r){var i=n?"expression":t.type,o=e.color,a=o.mode,s=X.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||X.wrapFieldName(t.name),key:X.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:n||s,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}r||(o.auto=!1,o.mode=a)}function se(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,ae(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=Y.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return ae(e,ie("dimension",!!a,a||r)),!!a}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ue=function(e,t){var n={primary:!0};if(e){var r=(Q[t]||J).colorModeOptions||J.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ce=function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},de=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),a=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(a,l):!(n={auto:i,colorMode:r,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:i,colorMode:r,dimensions:a,measures:s,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,ae(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=Y.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return ae(e,ie("measure",!!s,s||r[0])),!!s}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,a)}(e,t)},fe=function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},me=function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},pe=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},he=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=U.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=Y.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return Y.moveByIdFromGroup(a,[],"qAttributeDimensions",u),Y.moveByIdFromGroup(a,[],"qAttributeExpressions",u),Y.moveByIdFromGroup(s,[],"qAttributeExpressions",c),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=U.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty,f=o.getValue(d,"visualization"),m=o.getValue(d,"qHyperCubeDef.qDimensions",[]),p=o.getValue(d,"color.mode",""),h=o.getValue(d,"color.auto",""),g=ue(d,f),y=ce({canColorBy:g,autoColor:h,colorMode:p,dimensions:m});return g[p]?me({shouldUpdateColorBy:y,properties:d})&&pe(d):he(d),y&&de(d,"qHyperCubeDef."),ge(d)&&le(d,"color.persistent",!0),fe(m),c}};var ve=["bar","marker","line"];const be=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?$(n,"unsupportedAutoMinMax")||M()(n.measureAxis,t.measureAxis):$(n,"supportedAutoMinMax")||M()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),ve.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(a);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&M()(s,n.properties.measureAxes[t[0].axis])):M()(s,n.properties.measureAxes[0])}},qe=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},Me={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(x(s,"measureAxis.min","supportedAutoMinMax"),x(s,"measureAxis.max","supportedAutoMinMax")):(x(s,"measureAxis.min","unsupportedAutoMinMax"),x(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty;return be({initialProperties:n,properties:d}),xe({exportFormat:t,initialProperties:n,properties:d,measureType:a}),qe(d.qHyperCubeDef),d.qHyperCubeDef.qColumnOrder=[],d.qHyperCubeDef.columnOrder=[],c}};function Se(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function we(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var u=Se(n,r,l);o.setValue(t,u,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}function De(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=Se(n,r,s),u=o.getValue(t,l);void 0!==u&&(o.setValue(i,a,u),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}var Ce="qHyperCubeDef.qMeasures",Ne="conditionalColoring",ke="measures",Ae="qDef.conditionalColoring";const Le={quarantine:function(e){we({properties:e,arrayPath:Ce,quarantineName:Ne,arrayName:ke,itemPath:Ae})},unquarantine:function(e){De({properties:e,arrayPath:Ce,itemPath:Ae,arrayName:ke,quarantineName:Ne})}};var Ee="qHyperCubeDef.qMeasures",Te="measures",Oe="qHyperCubeDef.qDimensions",Ie="dimensions",Pe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Re="alternativeMeasures",Fe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",je="alternativeDimensions",He="qCalcCondition",ze="conditionalShowHide";const Be={quarantine:function(e){we({properties:e,arrayPath:Ee,quarantineName:ze,arrayName:Te,itemPath:He}),we({properties:e,arrayPath:Oe,quarantineName:ze,arrayName:Ie,itemPath:He})},unquarantine:function(e){De({properties:e,arrayPath:Ee,quarantineName:ze,arrayName:Te,itemPath:He}),De({properties:e,arrayPath:Oe,quarantineName:ze,arrayName:Ie,itemPath:He})},quarantineAlternative:function(e){we({properties:e,arrayPath:Pe,quarantineName:ze,arrayName:Re,itemPath:He}),we({properties:e,arrayPath:Fe,quarantineName:ze,arrayName:je,itemPath:He})},unquarantineAlternative:function(e){De({properties:e,arrayPath:Pe,quarantineName:ze,arrayName:Re,itemPath:He}),De({properties:e,arrayPath:Fe,quarantineName:ze,arrayName:je,itemPath:He})}},_e={hypercube:U,colorChart:ye,axisChart:Me,quarantineProperty:x,unquarantineProperty:$,quarantineArrayProp:we,unquarantineArrayProp:De,conditionalColoring:Le,conditionalShow:Be}})(),r.default})();var BC=H(zC.exports);function _C(e,t){if("custom"===e.dimensionAxis.axisDisplayMode){const n=t.layout.qHyperCube.qMeasureInfo.filter((e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==rx})).length,r=t.layout.qHyperCube.qDimensionInfo.filter((e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==rx})).length,i=e.dimensionAxis.maxVisibleItems;i<1?e.dimensionAxis.maxVisibleItems=10:i>1e4/(r+n)&&(e.dimensionAxis.maxVisibleItems=Math.min(i,Math.floor(1e4/(r+n))))}}const VC=.7,$C=.9,UC=[{translation:"Common.None",value:"none"},{translation:"Common.Small",value:"small"},{translation:"Common.Medium",value:"medium"},{translation:"Common.Large",value:"large"}],WC=(e,t)=>{var n,r,i,o,a;const s=null===(n=t.qHyperCube)||void 0===n||null===(r=n.qMeasureInfo)||void 0===r?void 0:r.filter((e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==rx})).length,l=null===(i=t.qHyperCube)||void 0===i||null===(o=i.qDimensionInfo)||void 0===o?void 0:o.filter((e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==rx})).length,u="grouped"===(null===(a=e.barGrouping)||void 0===a?void 0:a.grouping)&&l>0&&s+l>2;return de.continuous(t)?1:u?$C:VC},KC=(e,t,n)=>{const r=`${e}.fontFamily`,i=`${e}.fontSize`;return{fontFamilyItem:{component:"dropdown",ref:r,options:()=>t.getOptions(r),defaultValue:()=>t.getDefaultValue(r)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:i,options:()=>t.getOptions(i),defaultValue:()=>t.getDefaultValue(i)},fontColorItem:{component:"color-picker",width:!1,ref:`${e}.color`,defaultValue:()=>({color:n.getStyle("object.barChart",e,"color")})}}}}};function GC(e,t,n){const r=function(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,a=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:i}),s=a.id,l=a.paths,u={};l.forEach((function(e){for(var r=e.split("."),i=u,a=0;a<r.length;a++){var l=r[a];a===r.length-1?i[l]=Sv({theme:t,translator:n,id:s,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}}));var c=function(e){for(var t=e.split("."),n=u,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return u.getDefaultValue=function(e){return c(e).getDefaultValue()},u.getOptions=function(e){return c(e).getOptions()},u}({theme:e,translator:n,config:{id:"barChart",paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]},flags:t});return{component:"styling-panel",show:!0,chartType:"barchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.BarChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:null==t?void 0:t.isEnabled("SENSECLIENT_IM_2428_BARCHART_BG"),items:{outlineSection:{translation:"properties.Outline",component:"panel-section",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",options:Object.keys(UC).map((e=>UC[e])),defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#205891"},schemaIgnore:!0,width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"panel-section",show:(e,t)=>!de.continuous(t.layout),items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",component:"slider",min:.01,max:1,step:.01,defaultValue(e,t,n){const{properties:r}=n,{barGrouping:i,qHyperCubeDef:o}=r,a=o.qMeasures.length,s=o.qDimensions.length,l="grouped"===i.grouping&&s>0&&a+s>2;return de.continuous(r)?1:l?$C:VC},schemaIgnore:!0}}}}},axisTitleSection:null!=t&&t.isEnabled("CLIENT_IM_747")?{translation:"properties.axis.title",component:"panel-section",items:{axisTitleItems:{component:"items",ref:"components",key:"axis",items:KC("axis.title",r,e)}}}:void 0,axisLabelSection:null!=t&&t.isEnabled("CLIENT_IM_747")?{translation:"properties.axis.label",component:"panel-section",items:{axisLabelItems:{component:"items",ref:"components",key:"axis",items:KC("axis.label.name",r,e)}}}:void 0,labelSection:null!=t&&t.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.labelmode",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:{...KC("label.value",r,e),contrastColor:{component:"checkbox",type:"boolean",ref:"label.value.useContrastColor",translation:"properties.dataPoints.valuelabel.contrast",defaultValue:!0}}}}}:void 0,legendTitleSection:null!=t&&t.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.title",component:"panel-section",items:{legendTitleSection:{component:"items",ref:"components",key:"legend",items:KC("legend.title",r,e)}}}:void 0,legendLabelSection:null!=t&&t.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.label",component:"panel-section",items:{legendLabelSection:{component:"items",ref:"components",key:"legend",items:KC("legend.label",r,e)}}}:void 0}}}function YC(e=!1,t,n,r){return e?function(e){return{classification:{section:"styling",tags:["simple"],exclusive:!0},component:"items",show:!0,chartType:"barchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.BarChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:null==e?void 0:e.isEnabled("SENSECLIENT_IM_2428_BARCHART_BG"),items:{outlineSection:{translation:"LayerStyleEditor.style.strokeWidth",component:"items",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",translation:"LayerStyleEditor.style.strokeWidth",options:Object.keys(UC).map((e=>UC[e])),schemaIgnore:!0,defaultValue:UC[0].value},strokeColor:{ref:"style.strokeColor",schemaIgnore:!0,defaultValue:{color:"#205891",index:-1},width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"items",show:(e,t)=>!de.continuous(t.layout),items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",translation:"LayerStyleEditor.style.barWidth",component:"slider",min:.01,max:1,step:.01,schemaIgnore:!0,defaultValue:(e,t,n)=>WC(n.properties,n.layout)}}}}},optionsSection:{translation:"LayerStyleEditor.label.Options",component:"items",items:{wrapperItem:{component:"items",items:{optionsHeader:{component:"header",translation:"LayerStyleEditor.label.Options"},scrollbar:{ref:"scrollbar",translation:"properties.scrollbar",component:"dropdown",type:"string",options:Object.keys(kf.OPTIONS).map((e=>kf.OPTIONS[e])),schemaIgnore:!0,defaultValue:kf.DEFAULT.value},scrollAlignment:{ref:"scrollStartPos",translation:"properties.ScrollAlignment",component:"dropdown",schemaIgnore:!0,defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}]},gridLines:{type:"items",items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}}}}}}}}}(n):GC(t,n,r)}const XC={component:"style-editor",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",resetBtnTranslation:"LayerStyleEditor.component.resetAll",key:"bar",ref:"components",defaultValues:(e,t)=>({key:"bar",style:{width:WC(e,t.layout),strokeColor:{index:-1,color:"#205891"},strokeWidth:"none"}}),items:{bar:{components:"items",type:"items",uses:"styling.box",items:{strokeWidth:{show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"LayerStyleEditor.style.strokeWidth.none"},{value:"small",translation:"LayerStyleEditor.style.strokeWidth.small"},{value:"medium",translation:"LayerStyleEditor.style.strokeWidth.medium"},{value:"large",translation:"LayerStyleEditor.style.strokeWidth.large"}],defaultValue:"none"},strokeColor:{show:e=>"none"!==e.style.strokeWidth},width:{show:(e,t,n)=>!de.continuous(n.layout),component:"slider",min:.01,max:1,step:.01,defaultValue:VC}}}}},JC=e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==rx},ZC=(e,t)=>e.qHyperCube[t].filter((e=>JC(e))),QC=e=>({get:(t,n,r)=>de.continuous(r.layout)?e:t(n.type),set(e,t,n){const r=he(n.type,n);t(n.type,e,r)}}),eN=e=>{if(!e)return!1;const t=Y(!0,{},e);return t.qHyperCube.qMeasureInfo=ZC(e,"qMeasureInfo"),t.qHyperCube.qDimensionInfo=ZC(e,"qDimensionInfo"),t&&!de.continuous(t)&&de.stacked(t)},tN=({translator:e,flags:t,anything:n})=>{var r,i,o;const a=null==n||null===(r=n.sense)||void 0===r||null===(i=r.isUnsupportedFeature)||void 0===i?void 0:i.call(r,"continuousData"),s={items:{labels:{items:{header:{show:(e,t,n)=>ZC(n.layout,"qMeasureInfo").length},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",translation:"Simple.Label.Value",show:(e,t,n)=>!eN(t.layout)&&ZC(n.layout,"qMeasureInfo").length},segmentLabels:{component:"checkbox",ref:"dataPoint.showSegmentLabels",type:"boolean",translation:"properties.dataPoints.segmentLabelMode",defaultValue:!1,show:(e,t)=>eN(t.layout),convertFunctions:{get:(e,t,n,r)=>r.dataPoint.showLabels&&r.dataPoint.showSegmentLabels,set(e,t,n,r,i){i.dataPoint.showSegmentLabels=e,i.dataPoint.showLabels=i.dataPoint.showSegmentLabels||i.dataPoint.showTotalLabels}}},totalLabels:{component:"checkbox",ref:"dataPoint.showTotalLabels",type:"boolean",translation:"properties.dataPoints.totalLabelMode",defaultValue:!0,show:(e,t)=>eN(t.layout),convertFunctions:{get:(e,t,n,r)=>r.dataPoint.showLabels&&r.dataPoint.showTotalLabels,set(e,t,n,r,i){i.dataPoint.showTotalLabels=e,i.dataPoint.showLabels=i.dataPoint.showSegmentLabels||i.dataPoint.showTotalLabels}}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:(e,t,n)=>ZC(n.layout,"qDimensionInfo").length&&ZC(n.layout,"qMeasureInfo").length,convertFunctions:{get:(e,t,n,r)=>"labels"===r.dimensionAxis.show||"none"===r.dimensionAxis.show,set(e,t,n,r,i){i.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show:(e,t,n)=>ZC(n.layout,"qMeasureInfo").length,convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}},l=null==n||null===(o=n.sense)||void 0===o?void 0:o.theme,u={uses:"settings",items:{simpleStyling:YC(!0,l,t,e),simpleLabels:s,general:{items:{showDisclaimer:null!=t&&t.isEnabled("SHOW_DISCLAIMER")?{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}:void 0}},presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:{boxStyling:null!=t&&t.isEnabled("SENSECLIENT_PS_17478_STYLINGPANEL_BARCHART")?YC(!1,l,t,e):XC,grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",defaultValue:"grouped",horizontal:!0,items:[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}],show(e,t){const n=ZC(t.layout,"qMeasureInfo").length,r=ZC(t.layout,"qDimensionInfo").length;return r>0&&n+r>2},change(e,t){ZC(t.layout,"qDimensionInfo").length>1&&"stacked"===e.barGrouping.grouping?(e.qHyperCubeDef.qMode="K",e.qHyperCubeDef.qAlwaysFullyExpanded=!0):e.qHyperCubeDef.qMode="S"},readOnly:(e,t,n)=>de.continuous(n.layout),convertFunctions:QC("stacked")},orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"vertical",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],readOnly:(e,t,n)=>de.continuous(n.layout),convertFunctions:QC("vertical")},scroll:{type:"items",items:{scrollbar:{type:"string",component:"dropdown",ref:"scrollbar",translation:"properties.scrollbar",options:Object.keys(kf.OPTIONS).map((e=>kf.OPTIONS[e])),defaultValue:kf.DEFAULT.value},scrollStartPos:{ref:"scrollStartPos",type:"number",translation:"properties.ScrollAlignment",component:"dropdown",defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}],show:(e,t,n)=>!de.continuous(n.layout)}}},gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}},valueLabels:{type:"items",snapshot:{tid:"property-valueLabels"},items:{showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!1,options:[{value:!0,label:(t,n)=>((e,t,n)=>n&&n.get(eN(t.layout)?"properties.on":"Common.Auto"))(0,n,e)},{value:!1,translation:"properties.off"}]},showSegmentLabels:{ref:"dataPoint.showSegmentLabels",type:"boolean",translation:"properties.dataPoints.segmentLabelMode",component:"switch",defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showLabels&&eN(n.layout)},showTotalLabels:{ref:"dataPoint.showTotalLabels",type:"boolean",translation:"properties.dataPoints.totalLabelMode",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showLabels&&eN(n.layout)}}}}},colorsAndLegend:{uses:"colorsAndLegend",items:{legend:{items:{show:{snapshot:{tid:"property-legend"}}}}}},dimensionAxis:{uses:"axis.dimensionAxis",items:{axisDisplaySettings:{components:"items",type:"items",show:(e,n,r)=>t&&t.isEnabled("BC_XAXIS_MODE")&&!de.continuous(r.layout),items:{axisDisplayMode:{ref:"dimensionAxis.axisDisplayMode",type:"string",translation:"properties.axis.displaymode",component:"dropdown",defaultValue:"auto",options:[{value:"auto",translation:"properties.axis.displaymode.auto"},{value:"max",translation:"properties.axis.displaymode.max"},{value:"custom",translation:"properties.axis.displaymode.custom"}]},maxVisibleItems:{ref:"dimensionAxis.maxVisibleItems",translation:"properties.axis.maxvisiblevalues",expression:"optional",type:"integer",invalid(e,t,n){const r=ZC(n.layout,"qMeasureInfo").length,i=ZC(n.layout,"qDimensionInfo").length,o=e.dimensionAxis.maxVisibleItems;return o<0||o>1e4/(i+r)},globalChange:_C,defaultValue:10,show:e=>"custom"===e.dimensionAxis.axisDisplayMode},hint:{component:"text",translation:"properties.axis.maxvisiblevalues.hint",style:"hint",show:e=>["custom","max"].indexOf(e.dimensionAxis.axisDisplayMode)>-1}}},continuousGroup:{items:{miniChart:null},show:!a}}},measureAxis:{uses:"axis.flippableMeasureAxis"},tooltip:{uses:"tooltip"}}};return null!=t&&t.isEnabled("SENSECLIENT_LAYERED_LABELS")&&(u.items.dimensionAxis.items.othersGroup={items:{label:{options:[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]}}}),u},nN={uses:"sortingWithDisclaimer",items:{defaultSorting:{items:{dimensions:{locked:(e,t,n)=>1===n.getMeasures().length&&2===n.getDimensions().length&&0===e,items:{autoSort:{change(e){wt(e)}}}},interColumnSorting:{reset:(e,t)=>{const{qDimensions:n,qMeasures:r,qInterColumnSortOrder:i}=e.qHyperCubeDef,{qCardinal:o}=t.layout.qHyperCube.qDimensionInfo[0],a=i.length,s=[...Array(a).keys()];1===n.length&&r.length>=1&&o>10&&([s[0],s[1]]=[s[1],s[0]]),e.qHyperCubeDef.qInterColumnSortOrder=s}}}}}},rN={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}},refLines:{uses:"reflines"},dimRefLines:{uses:"dimReflines"}}},iN=({translator:e,flags:t,anything:n})=>{var r,i;return{uses:"data",items:{dimensions:{items:{nullSuppression:{show(e,t,r){var i,o;if(null!=n&&null!==(i=n.sense)&&void 0!==i&&null!==(o=i.isUnsupportedFeature)&&void 0!==o&&o.call(i,"includeZeroValues"))return!1;const a=((e,t)=>{var n,r,i,o,a,s;const l=null===(n=t.layout)||void 0===n||null===(r=n.qHyperCube)||void 0===r||null===(i=r.qDimensionInfo)||void 0===i?void 0:i.findIndex((e=>JC(e)));return(null===(o=t.properties)||void 0===o||null===(a=o.qHyperCubeDef)||void 0===a||null===(s=a.qDimensions)||void 0===s?void 0:s[l])===e})(e,t),s=de.continuous(r.layout);return!(a&&s)}},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Dimensions.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0,show:()=>t.isEnabled("IM_1579_HIDE_DIM_MEA")}}},measures:{items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Measures.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0,show:()=>t.isEnabled("IM_1579_HIDE_DIM_MEA")},trendLines:null!=n&&null!==(r=n.sense)&&void 0!==r&&null!==(i=r.isUnsupportedFeature)&&void 0!==i&&i.call(r,"trendlines")?void 0:ZS({translator:e,allowStackedByDimension:t&&t.isEnabled("TRENDLINES_STACKED_DIM")})}}}}};function oN({translator:e,flags:t,anything:n}){return{type:"items",component:"accordion",items:{data:iN({translator:e,flags:t,anything:n}),sorting:nN,addons:rN,settings:tN({translator:e,flags:t,anything:n})}}}const aN=e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==rx};function sN(){return{type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sortWithDisclaimer",items:{sort:{items:{dimensions:{locked(e,t,n){const r=n.qHyperCube.qMeasureInfo.length,i=n.qHyperCube.qDimensionInfo.filter((e=>aN(e))).length;return 1===r&&2===i&&0===e}}}}}},presentation:{uses:"presentation",items:{showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",horizontal:!0,items:[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}],show(e,t){const n=t.qHyperCube.qMeasureInfo.filter((e=>aN(e))).length,r=t.qHyperCube.qDimensionInfo.filter((e=>aN(e))).length;return n+r>2&&!de.continuous(t)&&!((null==(i=t)||null===(o=i.qHyperCube)||void 0===o||null===(a=o.qDimensionInfo)||void 0===a?void 0:a.filter((e=>aN(e))).length)>1&&(null==i||null===(s=i.qHyperCube)||void 0===s?void 0:s.isHCEnabled));var i,o,a,s},change(e){e.qHyperCubeDef.qDimensions.length>1&&"stacked"===e.barGrouping.grouping?(e.qHyperCubeDef.qMode="K",e.qHyperCubeDef.qAlwaysFullyExpanded=!0):e.qHyperCubeDef.qMode="S"}},orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],show:(e,t)=>!de.continuous(t)}}},color:{uses:"color"}}}}function lN(e){const t={},n=jh(e,"components"),r=jh(e,"dimensionAxis.axisDisplayMode"),i=jh(e,"dimensionAxis.maxVisibleItems"),o=n?n.filter((e=>"bar"===e.key))[0]:void 0,a=jh(e,"tooltip");if(o&&o.style&&Object.keys(o.style).forEach((e=>{t[`chart_style_${e}`]=o.style[e]})),i&&(t.chart_dimaxis_maxVisibleItems=i),r&&(t.chart_dimaxis_axisDisplayMode=r),a){t.chart_tooltip_custom=!a.auto;const e=jh(a,"chart.object.refId");!a.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}const uN=e=>!!(e&&e.qHyperCube.qSize.qcy>0),cN={ACCUMULATIONS:"accumulation",MOVING_AVERAGE:"movingAverage",DIFFERENCE:"difference",NORMALIZATION:"normalization"};function dN(){const e=[];return Object.keys(cN).forEach((t=>{e.push(cN[t])})),e}function fN(e){const{flags:t}=e;return{definition:oN(e),softDefinition:sN(),support:{snapshot:uN,export:uN,exportData:!0,sharing:uN,viewData:!0,effects:!0,modifiers:dN()},importProperties:(n,r,i,o)=>{const a={layout:{templateId:r.templateId}};i.mapProperties(a);const s={defaultDimension:i.getDefaultDimensionProperties(),defaultMeasure:i.getDefaultMeasureProperties()},l=BC.axisChart.importProperties({exportFormat:n,initialProperties:r,dataDefinition:fx(e),defaultPropertyValues:s,hypercubePath:o,extension:i}),u=l.qProperty;return u.qHyperCubeDef.qDimensions.length>1&&"stacked"===u.barGrouping.grouping&&(u.qHyperCubeDef.qMode="K",u.qHyperCubeDef.qAlwaysFullyExpanded=!0),t.isEnabled("IM_1579_HIDE_DIM_MEA")&&(BC.conditionalShow.unquarantine(u),BC.conditionalShow.unquarantineAlternative(u)),l},exportProperties:(e,n,r)=>{t.isEnabled("IM_1579_HIDE_DIM_MEA")&&(BC.conditionalShow.quarantine(e.qProperty),BC.conditionalShow.quarantineAlternative(e.qProperty));return BC.axisChart.exportProperties({propertyTree:e,hyperCubePath:n,viewDataMode:r})},migrate:{properties:e=>(e.qExtendsId||(function(e){e.qHyperCubeDef.qDimensions.forEach(wt)}(e),function({properties:e}){const{scrollbar:t,dimensionAxis:n,preferContinuousAxis:r,showMiniChartForContinuousAxis:i}=e;if(t||!1!==i)return;const{continuousAuto:o}=n;(o||!o&&r)&&(e.scrollbar=kf.OPTIONS.NONE.value)}({properties:e})),e)},extendMetrics:lN}}function mN(i){const o=function(){const i=e();return i.use(t),i.use(n(r)),i.use(Iu()),i.use(Dm),i.component("box-sliced-hat",Sm),i.component("box-out-of-bounds",vm),i.component("scrollbar",mm),i.component("scroll-hint",_o),i.component("reference-line-labels",Va),i.component("axis-overlay",Cf.picassoComponents.axisOverlay),i.component("time-axis",Cf.picassoComponents.timeAxis),i.scale("q-time-axis",Cf.picassoScales.time),i}();return{qae:mx(i),ext:fN(i),component(){const e=hx({env:i}),{viewState:t,viewCache:n}=gx(),r=function({picasso:e}){const t=S(),n=w(),[r,i]=b();return M((()=>{if(!e)return()=>{};t.style.overflow="hidden";const r=e({renderer:{prio:[(null==n?void 0:n.renderer)||"canvas"]}}).chart({element:t,data:[],settings:{}});i(r);const{destroy:o}=r;return()=>{o()}}),[n.renderer]),r}({picasso:o}),a=hw({picasso:o,chart:r,environment:e,viewState:t,viewCache:n}),s=function({env:e,services:t}){const n=A(),r=k(),i=F(),[o,a]=I((async()=>{if(!e||!t)return Promise.resolve();const{flags:o}=e,{layoutService:a}=t,{isSnapshot:s,isStacked:l,isContinuous:u}=a.meta,c=[];return s||c.push(r.getEffectiveProperties()),Promise.all(c).then((async e=>{const t=e[0]||void 0;if(o.isEnabled("IM_1579_HIDE_DIM_MEA")&&null!=t&&t.qHyperCubeDef){const e=a.getLayout(),o=Y(!0,{},t);if(HC({properties:t,layout:e,isStacked:l,isContinuous:u,model:r}))return i.pending(),xl(e)?r.setProperties(t).then((()=>{n.clearUndoBuffer()})):void await bl(r,o,t);i.restore()}return{properties:t}}))}),[e,t]);if(a&&!a.isHandled)throw a;return o}({env:i,services:a});jC({picasso:o,chart:r,services:a,environment:e,viewState:t,viewCache:n,bootstrapped:s}),(({environment:e,services:t,chart:n,viewState:r,bootstrapped:i})=>{P((o=>{var a;if(!e||!t||!i)return;const{flags:s}=e,{layoutService:l,dockService:u,colorService:c,discrete:d,continuousDataModel:f,reducedDataModel:m}=t,{width:p,height:h}=u.meta.chart.size;if(o.snapshotData=o.snapshotData||{},o.snapshotData.content={size:{w:p,h:h}},l.meta.isSnapshot)return Promise.resolve();if(o.snapshotData.content.chartData={scrollOffset:r.get("scrollOffset"),zoom:r.get("zoom"),legendScrollOffset:fe(n,sw.COMPONENT.LEGEND_COLOR_CAT)},null!=s&&null!==(a=s.isEnabled)&&void 0!==a&&a.call(s,"IM_1579_HIDE_DIM_MEA")){const{properties:e}=i,t=null==e?void 0:e.qHyperCubeDef.qDimensions.some((e=>{var t,n;return null===(t=e.qCalcCondition)||void 0===t||null===(n=t.qCond)||void 0===n?void 0:n.qv}));t&&(o.tooltip.auto=!0)}return l.meta.isDiscrete?(d.command.setSnapshotData(o),m.setSnapshotData(o)):f.setSnapshotData(o),c.getMain().getSnapshotData().then((e=>{o.snapshotData.content.chartData={...o.snapshotData.content.chartData,...e}})).catch((()=>{}))})),R((()=>({getViewState(){if(r&&n)return{scrollOffset:r.get("scrollOffset"),zoom:r.get("zoom"),legendScrollOffset:fe(n,sw.COMPONENT.LEGEND_COLOR_CAT)}}})),[r,n])})({environment:e,services:a,chart:r,viewState:t,bootstrapped:s})}}}export{mN as default};
9
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,d,m=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",h=e.split("").reverse().join(""),g=h.search(/[0-9\-\+#]/),y=m-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,m):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",y=(d=t[0]).length%l,m=d.length,b=0;b<m;b++)h+=d.charAt(b),!((b-y+1)%l)&&b<m-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},lc(uc={exports:{}}),uc.exports);function dc(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const mc={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},fc=/%\)?$/,pc=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,hc=/^\(oct\)/i,gc=/^\(dec\)/i,yc=/^\(hex\)/i,vc=/^\(bin\)/i,bc=/^\(rom\)/i,xc=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,qc=/#|0/g;function Mc(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function Sc(e,t,n){const r=dc(e);return n?r:new RegExp(r||"",t)}function Dc(e,t,n,r){let i,o,a,s,l,u,c,d,m,f=e.pattern;var p,h;r&&(e.abbreviate=!0),p=t,(h=n)&&(h=dc(h)),p&&(p=dc(p)),m=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(h,"[#0]+)?")),a=f.match(m),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),u=t,t=/,/.test(n)?"¤":",",u&&(a=a.replace(Sc(u,"g"),t)),c=n,n=".",c&&(a=a.replace(Sc(c,"g"),n)),d=a.match(/#/g),d=d?d.length:0;const g=f.split(c);let y;g[1]&&(y=g[1].match(qc)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=y?y.length:2,e.percentage=fc.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(Sc(t,null,!0),"|").concat(Sc(n,null,!0)),"g"),e.groupTemp=u,e.decTemp=c,e.t=t,e.d=n,e.temp=d}class Cc{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return mc;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new Cc(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],xc.test(e[0])&&(r.positive.isFunctional=!0),e[1]?xc.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?xc.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||Dc(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&Dc(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&Dc(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,u,c=this._prepared,d="",m="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return c=c.zero,c.pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=function(e,t,n){let r;return pc.test(t)?e=Mc(e,Number(/\d{2}/.exec(t)[0]),t,n):hc.test(t)?e=Mc(e,8,t,n):gc.test(t)?e=Mc(e,10,t,n):yc.test(t)?e=Mc(e,16,t,n):vc.test(t)?e=Mc(e,2,t,n):bc.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=c.maxPrecision?i=o:r<=n&&!(o>0&&-n<=c.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=c.temp,l=c.numericPattern,u=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,u||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number(e.toFixed(Math.min(20,u?u.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=cc(n,t)||"0",u){const t=Math.max(0,Math.min(14,u.length)),n=u.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),m=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=cc(l,e)}e=e.replace(c.numericRegex,(e=>e===a?c.groupTemp:e===o?c.decTemp:"")),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+m+d+c.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function wc(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=(e=>e)}=t;let o,a,s=Object.create(null),l=Object.create(null),u=0,c=0;return o=r?function(){return a=i(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=i(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(u>=n&&(delete s[l[c]],delete l[c],u--,c++),s[e]=t,l[u]=e,u++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),u=0,c=0},o.size=()=>u,o}function Lc(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Cc(...t)}(i,e,t,n,r),a=wc(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const Ec="IV",Tc=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Ac=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Nc=["January","February","March","April","May","June","July","August","September","October","November","December"],kc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Oc(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Ic(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}class Pc{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:Tc,qDayNames:Ac,qLongMonthNames:Nc,qMonthNames:kc}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),t||(t={T:r.qTimeFmt||"hh:mm:ss",D:r.qDateFmt||"YYYY-MM-DD",TS:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new Pc(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),r=function(e,t){let n,r=function(e){const t=e,n=24*Ic(t),r=60*Ic(n),i=60*Ic(r),o=1e3*Ic(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,u=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(u=n?n.getDay()-1:0,u<0&&(u=6));let c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:i,h:o,m:a,s:s,f:l,t:c}}(e,t));const i=(o=this,a=r,{"Y+|y+":{Y:"".concat(Number("".concat(a.year).slice(-2))),YY:Oc("".concat(a.year).slice(-2),2),YYY:Oc("".concat(a.year).slice(-3),3),def:e=>Oc("".concat(a.year),e.length)},"M+":{M:a.month+1,MM:Oc("".concat(a.month+1),2),MMM:o.locale_months_abbr[a.month],def:o.locale_months[a.month]},"W+|w+":{W:a.day,WW:Oc("".concat(a.day),2),WWW:o.locale_days_abbr[a.day],def:o.locale_days[a.day]},"D+|d+":{D:a.date,def:e=>Oc("".concat(a.date),e.length)},"h+|H+":{h:a.h,def:e=>Oc("".concat(a.h),e.length)},"m+":{m:a.m,def:e=>Oc("".concat(a.m),e.length)},"s+|S+":{s:a.s,def:e=>Oc("".concat(a.s),e.length)},"f+|F+":{def(e){let t="".concat(a.f),n=e.length-t.length;if(n>0)for(let e=0;e<n;e++)t+="0";else n<0&&(t=t.slice(0,e.length));return t}},"t{1,2}|T{1,2}":{def(e){let t=a.t;return e[0].toUpperCase()===e[0]&&(t=t.toUpperCase()),t=t.slice(0,e.length),t}}});var o,a;const s=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&s.push(e);const l=new RegExp(s.join("|"),"g");return t.replace(l,(e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}))}}function Rc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Pc(...t)}function Fc(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=Rc(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=wc(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==Ec?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=Rc(i,e,t),r=wc(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function Hc(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const u=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),c="dimension"===s?"first":"avg",d=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return Fc(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),Lc(n,r,i,o,t)}(t,i),m="dimension"===s?"first":(e,t)=>d(t),f={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(f)),e),min:()=>t.qMin,max:()=>t.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:c,reduceLabel:m,formatter:()=>d,tags:()=>t.qTags};return f}function zc(e,t,n,r,i){return(t[e]||[]).map(((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:Hc(Cu({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=zc("qAttrDimInfo",t,n,a,Cu({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=zc("qAttrExprInfo",t,n,a,Cu({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=zc("qMeasureInfo",t,n,a,Cu({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s}))}function jc(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},i=t;if(!i)throw new Error('Missing "data" input');if(!i.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=jc.util,a={cache:r,cube:i,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>e,raw:()=>i,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>r.fields.slice(),extract:e=>a.extractor(e,s,r,o),hierarchy:e=>a.hierarchy(e,s,r,o),_cache:()=>r};"K"===i.qMode||"T"===i.qMode||!i.qMode&&i.qNodesOnDim?(a.extractor=sc,a.hierarchy=ac,a.pages="K"===i.qMode?i.qStackedDataPages:i.qTreeDataPages):"S"===i.qMode?(a.extractor=Tu,a.pages=i.qDataPages,a.hierarchy=ac):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},s,r,o);const l="S"===i.qMode?e=>e.qElemNumber:void 0,u="S"===i.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...zc("qDimensionInfo",i,e,"",Cu({},a,{value:l,type:"dimension"}))),r.wrappedFields.push(...zc("qMeasureInfo",i,e,"",Cu({},a,{value:u,type:"measure"}))),r.fields=r.wrappedFields.map((e=>e.instance));const c=e=>{e.forEach((e=>{r.allFields.push(e.instance),c(e.measures),c(e.attrDims),c(e.attrExps)}))};return c(r.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=s.field(t.from),i=Hc(hu({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},s,r,o),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));r.virtualFields.push(i)})),r.allFields.push(...r.virtualFields),s}const Bc=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],Vc=/\/qDimensionInfo(?:\/(\d+))?/,_c=/\/qMeasureInfo\/(\d+)/,Uc=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,$c=/\/qAttrExprInfo\/(\d+)/,Wc=/\/?qHyperCube/,Kc=/\/?qTreeData/,Gc=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),Yc=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function Xc(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;return e.brushes().forEach((e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;Wc.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=Gc):Kc.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=Yc);let s=!0;if(Vc.test(e)&&(r=+Vc.exec(e)[1]),_c.test(e)&&(i=+_c.exec(e)[1]),Uc.test(e)){i=-1,r=0;const e=+Uc.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if($c.test(e)){const e=i;if(t){i=0;const a=$u(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce(((e,t)=>e+t.qAttrExprInfo.length),i),r=-1):(i=a.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),i),i=a.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),i)),i+=+$c.exec(n)[1]}else r>-1?(r=-1,i=+$c.exec(n)[1]):i+=+$c.exec(n)[1]+1}return Bc.forEach((e=>{let[t,r]=e;n=n.replace(t,r)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||s>=o)&&o>-1?n.forEach((e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})})):n.forEach((e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&s?[{method:"resetMadeSelections",params:[]}]:(a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(u=t.orMode)||void 0===u||u]}),a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o);var u}function Jc(e){jc.util=e.data("matrix").util,e.data("q",jc),e.formatter("q-number",Lc),e.formatter("q-time",Fc)}function Zc(e){var t=tu(e.layout||{},e.path.split("/").join("."));if(!t)return!1;var n=t.qIsOneAndOnlyOne;return void 0!==n&&n}function Qc(e){var t=e.brush,n=e.colorField,r=e.legendAlias,i=e.useLegendCube,o=void 0!==i&&i;!n||/qAttrDimInfo/.test(n)?(t.removeKeyAlias("attrDim/qDimensionInfo/0"),r&&t.removeKeyAlias(r),t.addKeyAlias("attrDim/qDimensionInfo/0","qHyperCube/".concat(n))):o&&t.addKeyAlias(r,"qHyperCube/".concat(n))}Jc.qBrushHelper=Xc,Jc.selections=Xc;var ed="Shift";function td(e){var t=e.brush,n=e.getConfig;return{interceptor:function(e){var r=t.brushes(),i=n(),o=i.allowSimultaneous,a=i.layout,s=void 0===a?{}:a;r.forEach((function(n){var r,i,a;("range"===n.type||null!==(r=e[0])&&void 0!==r&&r.key&&(null===(i=e[0])||void 0===i?void 0:i.key)!==n.id&&0!==o.indexOf(null===(a=e[0])||void 0===a?void 0:a.key))&&t.clear([])}));var l=e.filter((function(e){return-2!==e.value}));if(l.length>1){var u=function(e){var t=e.layout,n=void 0===t?{}:t,r=e.values,i=void 0===r?[]:r;if(null==i||!i.length)return[];var o=Array.from(new Set(i.map((function(e){return e.key})))),a=[];return o.forEach((function(e){var t=Zc({layout:n,path:e}),r=i.filter((function(t){return t.key===e})),o=t?[r.pop()]:r;a.push.apply(a,Qa(o))})),a.filter(Boolean)}({layout:s,values:l});return u}return l},rangeInterceptor:function(e){var r=t.brushes(),i=n().allowSimultaneous;return r.filter((function(e){return"value"===e.type})).length?(t.clear([]),e):(r.forEach((function(n){var r=n.id===e[0].key||i.includes(n.id)&&i.includes(e[0].key);"range"!==n.type||r||t.clear([])})),e)}}}var nd=function e(t,n){return n[t]?e(t+1,n):t},rd=function(e,t){var n=t.reduce((function(e,t){return e[t]=!0,e}),{});return e.reduce((function(e,t,r){var i=nd(r,n);return n[i]=!0,e[r]=i,e}),{})};function id(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.layout,n=e.filtered,r=void 0===n?{}:n,i=(null==t?void 0:t.qHyperCube)||{},o=i.qDimensionInfo,a=void 0===o?[]:o,s=i.qMeasureInfo,l=void 0===s?[]:s;return{dimensions:rd(a,r.dimensions||[]),measures:rd(l,r.measures||[])}}var od="selectHyperCubeValues",ad="selectHyperCubeContinuousRange";function sd(e){var t=e.selection,n=e.fieldMap,r=t.method,i=t.params;if(r===od){var o=n.dimensions[i[1]];void 0!==o&&(i[1]=o)}return r===ad&&i[1].forEach((function(e){var t=n.dimensions[e.qDimIx];void 0!==t&&(e.qDimIx=t)})),t}var ld=[],ud=0,cd=function(e){var t=ld.filter((function(e){var t;return null===(t=e.selections)||void 0===t?void 0:t.isActive()}));t.length&&("Enter"===e.key?t.forEach((function(e){return e.selections.confirm()})):"Escape"!==e.key&&"Esc"!==e.key||t.forEach((function(e){return e.selections.cancel()})))},dd=function(){document.addEventListener("keyup",cd)},md=function(){document.removeEventListener("keyup",cd)},fd=function(e,t){Object.keys(t).forEach((function(n){e.on(n,t[n])}))},pd=function(e,t){Object.keys(t).forEach((function(n){e.removeListener(n,t[n])}))};function hd(e){var t=e.chart,n=e.document,r=e.selectionInfo,i=e.eventName,o=e.componentName,a=e.brushName,s=void 0===a?"selection":a,l=e.emit,u=void 0===l?"rangeClear":l,c=r.event===i,d=n.querySelector("[data-key='".concat(o,"-edge-0']"));if(c||!d)return!1;var m=t.component(o);return!!m&&(m.emit(u),"string"==typeof s&&t.brush(s).clear(),m)}var gd=["chart","document","selections","selectionInfo"],yd=function(e){e.chart,e.document,e.selections,e.selectionInfo;var t=Ja(e,gd);t.clearDiscrete(),t.clearContinuous(),t.clearMinor(),t.clearRange(),t.clearTap(),t.clearLegend()};function vd(e){var t,n=e.lasso;null!=n&&null!==(t=n.active)&&void 0!==t&&t.call(n)&&(null==n||n.action(!1))}function bd(e){var t,n=e.chart,r=e.selectionInfo,i=e.selectionActions,o=e.actions,a=void 0===o?{}:o,s=e.selections,l=e.selectionEvents;if(!1===i||!1===l)return function(){};var u=i.reset,c=void 0===u?vd:u,d=i.clear,m=!1!==d&&function(e){var t=e.clear,n=void 0===t?yd:t,r=e.selections,i=e.selectionInfo,o=e.chart;return function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).cleared,t={selections:r,selectionInfo:i,chart:o,document:document,cleared:e};return n($a({clearDiscrete:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"discreteRange":i,a=e.componentName,s=void 0===a?"discrete-range-brush":a,l=e.cleared;return hd({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,emit:"areaClear",brushName:e.brushName})}($a($a({},t),e))},clearContinuous:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"continuousRange":i,a=e.componentName,s=void 0===a?"continuous-range-brush":a,l=e.cleared;return hd({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,brushName:e.brushName})}($a($a({},t),e))},clearMinor:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.componentName,o=void 0===i?"minor-range-brush":i,a=e.eventName,s=void 0===a?"minorRange":a,l=e.cleared,u=void 0!==l&&l,c=e.brushName,d=hd({selectionInfo:t,chart:n,document:r,eventName:u?void 0:s,componentName:o,brushName:void 0!==c&&c});if(d){var m=d.settings.settings,f=m.scale,p=m.brush,h=n.scale(f).data().fields.map((function(e){return e.id()})),g=n.brush(p),y=g.brushes().filter((function(e){return"range"===e.type&&h.some((function(t){return t===e.id}))}));g&&y.length&&y.forEach((function(e){g.removeRanges(e.brush.ranges().map((function(t){return{key:e.id,range:t}})))}))}}($a($a({},t),e))},clearRange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"xAxis":o,s=e.cleared;hd({selectionInfo:t,chart:n,document:r,eventName:void 0!==s&&s?void 0:a,componentName:"".concat(a,"-range-brush"),emit:"areaClear",brushName:!1})&&i.clear()}($a($a({},t),e))},clearTap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.chart,n=e.selectionInfo,r=e.selections,i=e.events,o=void 0===i?["tap"]:i,a=e.brushNames,s=void 0===a?[]:a;if(n&&o.includes(n.event)){var l=n.currentComponent;n.previousComponent!==l&&(r.clear(),s.forEach((function(e){return t.brush(e).end()})))}}($a($a({},t),e))},clearLegend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"legendRange":o,s=e.componentName,l=void 0===s?"legend-range-brush":s,u=e.cleared,c=void 0!==u&&u,d=e.brushName;hd({selectionInfo:t,chart:n,document:r,eventName:c?void 0:a,componentName:l,brushName:void 0!==d&&d})&&i.clear()}($a($a({},t),e))}},t))}}({clear:d,selections:s,selectionInfo:r,chart:n}),f=function(e){var t=e.chart,n=e.actions,r=e.reset,i=e.clear,o=!1,a={deactivated:function(e){var t=(n||{}).lasso;r({e:e,lasso:void 0!==t&&t})},canceled:function(e){var o=(n||{}).lasso;r({e:e,lasso:void 0!==o&&o}),i({e:e,chart:t,document:document})},cleared:function(e){o||(o=!0,i({e:e,chart:t,document:document,cleared:!0}),o=!1)}};return!1===r&&delete a.deactivated,!1===i&&delete a.cleared,!1===r&&!1===i&&delete a.canceled,a}({chart:n,clear:m,reset:c,actions:a}),p={};Object.entries(f).forEach((function(e){var t=Za(e,2),n=t[0],r=t[1];p[n]=function(e,t){return t?function(n){return t({event:n,defaultFunc:e})}:e}(r,l[n])}));var h=function(e){var t=e.selectionEvents,n=e.selections,r=e.selectionInfo,i=e.clear,o=e.chart,a=e.document,s=t.start,l={selections:n,selectionInfo:r,chart:o,document:a},u=function(e){return Object.assign(r,e||{})},c=function(e){var t=e.event,n=e.components;return function(){return function(e){var t=e.selectionInfo,n=e.clear,r=e.event,i=e.components,o=void 0===i?[]:i;(0,e.setSelectionInfo)($a($a({},void 0===t?{}:t),{},{event:r,components:o.map((function(e){return e.key})).filter(Boolean)})),n()}({event:t,components:n,clear:i,chart:o,selectionInfo:r,setSelectionInfo:u})}};return"function"==typeof s?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];s($a($a({defaultFunc:c({event:e,components:t}),setSelectionInfo:u,clear:i},l),{},{event:e,components:t}))}:function(e){c({event:e,components:arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]})()}}({selectionEvents:l,selections:s,selectionInfo:r,clear:m,chart:n,document:document});return null==a||null===(t=a.select)||void 0===t||t.on("start",h),Object.entries(p).forEach((function(e){var t=Za(e,2),n=t[0],r=t[1];null==s||s.on(n,r)})),function(){var e;null==a||null===(e=a.select)||void 0===e||e.removeListener("start",h),Object.entries(p).forEach((function(e){var t=Za(e,2),n=t[0],r=t[1];null==s||s.removeListener(n,r)}))}}var xd=[{key:"qHyperCube/qDimensionInfo/0:numeric",includeMax:!1}];function qd(e){var t=e.chart,n=e.actions,r=e.selections,i=e.picassoQ,o=e.config,a=o.allowSimultaneous,s=void 0!==a&&a,l=o.majorScale,u=void 0===l?void 0:l,c=o.selectionActions,d=void 0===c?{}:c,m=d.clear,f=d.reset,p=o.selectionEvents,h=void 0===p?{deactivated:void 0,canceled:void 0,cleared:void 0,start:void 0}:p,g=o.brushEvents,y=void 0===g?{}:g,v=o.brushName,b=void 0===v?"selection":v,x=o.brushMaxListeners,q=void 0===x?20:x,M=o.brushRanges,S=void 0!==M&&M,D=o.interceptors,C=void 0===D?{}:D,w=o.selectionsFn,L=void 0===w?i.selections:w,E=t.brush(b);if("number"==typeof q&&E.setMaxListeners(q),S){var T=!0===S?xd:S;E.configure({ranges:T})}var A={canSelect:!0,getIsSelectionLocked:!1,isInnerDimensionLocked:!1,lockedDimensions:[],singleSelectIndex:0,selectionInfo:{colorField:void 0,components:[],event:void 0,currentComponent:void 0,previousComponent:void 0}},N=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.selections,r=t.brush,i=t.majorScale,o=t.actions,a=t.selectionsFn,s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).path,l=void 0===s?"/qHyperCubeDef":s;if(!n)return{layout:function(){},filteredFields:function(){},allowSimultaneous:function(){},release:function(){}};var u=++ud,c=null,d={dimensions:[],measures:[]},m=[],f={};n.on=n.on.bind(n),n.isActive=n.isActive.bind(n),n.addListener=n.addListener.bind(n),n.removeListener=n.removeListener.bind(n);var p=td({brush:r,getConfig:function(){return{layout:c,allowSimultaneous:m}}}),h=p.rangeInterceptor,g=p.interceptor;r.intercept("set-ranges",h),r.intercept("toggle-ranges",h),r.intercept("toggle-values",g),r.intercept("set-values",g),r.intercept("add-values",g),r.on("start",(function(){return n.begin(l)}));var y={activate:function(){},deactivated:function(){return r.end()},cleared:function(){return r.clear()},canceled:function(){return r.end()}};fd(n,y);var v=null==i||null===(e=i.max)||void 0===e?void 0:e.call(i);return null!=o&&o.select?(o.select.on("start",(function(){var e;r.start(),"function"==typeof o.select.getBrushOptions&&(f=(e=o.select).getBrushOptions.apply(e,arguments))})),o.select.on("end",(function(){var e=a(r,f,c),t=id({layout:c,filtered:d});e.forEach((function(e){var r=sd({selection:e,fieldMap:t});(function(e,t,n){if(t&&void 0!==n&&"selectHyperCubeContinuousRange"===e.method){var r=e.params;if(r&&r[1]&&r[1][0]){var i=r[1][0],o=i.qDimIx,a=i.qRange;"undefined"!==o&&a&&!1===a.qMaxInclEq&&a.qMax>=n&&(a.qMaxInclEq=!0)}}})(r,o.select.brushSelectionIncludeMax,v),n.select(r)}))}))):r.on("update",(function(){var e=a(r,f,c),t=id({layout:c,filtered:d});e.forEach((function(e){n.select(sd({selection:e,fieldMap:t}))}))})),0===ld.length&&dd(),ld.push({key:u,selections:n}),{layout:function(e){c=e},filteredFields:function(e){d=e},allowSimultaneous:function(e){m=e},release:function(){c=null;var e=ld.indexOf(ld.filter((function(e){return e.key===u}))[0]);-1!==e&&ld.splice(e,1),ld.length||md(),pd(n,y)}}}({brush:E,majorScale:u,actions:n,selections:r,picassoQ:i,selectionsFn:L});!function(e){var t=e.brush,n=e.interceptors,r=void 0===n?{}:n;Object.entries(r).forEach((function(e){var n=Za(e,2),r=n[0],i=n[1];(Array.isArray(i)?i:[i]).forEach((function(e){t.intercept(r,e)}))}))}({brush:E,interceptors:C});var k=function(e){var t=e.chart,n=e.selectionActions,r=e.brush,i=e.actions,o=e.selectionInfo,a=e.selections,s=e.selectionEvents,l=function(e){var t=e.brush,n=e.chart,r=e.selectionInfo,i=e.brushEvents,o=void 0===i?{}:i,a=Object.entries(o).map((function(e){var i=Za(e,2),o=i[0],a=i[1],s=function(){return a({chart:n,selectionInfo:r})};return t.on(o,s),[o,s]}));return function(){a.forEach((function(e){var n=Za(e,2),r=n[0],i=n[1];t.removeListener(r,i)}))}}({brush:r,chart:t,selectionInfo:o,brushEvents:e.brushEvents}),u=bd({chart:t,selectionInfo:o,selectionActions:n,actions:i,selections:a,selectionEvents:s}),c=function(e){var t=e.actions;if(null==t||!t.lasso)return function(){};var n=!1,r=function(e){n||e.key!==ed||(t.lasso.action(!0),n=!0)},i=function(e){e.key===ed&&(t.lasso.action(!1),n=!1)};return document.addEventListener("keydown",r),document.addEventListener("keyup",i),function(){document.removeEventListener("keydown",r),document.removeEventListener("keyup",i)}}({actions:i});return function(){l(),u(),c()}}({chart:t,brush:E,actions:n,selections:r,selectionInfo:A.selectionInfo,selectionActions:{clear:m,reset:f},selectionEvents:h,brushEvents:y});if(s){var O=!0===s?Qa(Array(15)).map((function(e,t){return"qHyperCube/qMeasureInfo/".concat(t)})):s;N.allowSimultaneous(O)}return{unbindEvents:k,state:A,picassoSelections:N,brush:E}}var Md=["colorField","useLegendCube"];function Sd(e){var t=e.chart,n=e.selections,r=e.actions,i=void 0!==r&&r,o=e.config,a=void 0===o?{}:o,s=qd({chart:t,actions:i,selections:n,picassoQ:Jc,config:a}),l=s.unbindEvents,u=s.state,c=s.picassoSelections,d=s.brush,m=a.custom,f=void 0===m?{}:m,p=a.legendAlias,h=void 0===p?void 0:p,g=a.setBrushAliases,y=void 0===g?Qc:g;return{getIsDimensionLocked:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return u.lockedDimensions[e]},getIsSelectionLocked:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return null!==(e=null==n||null===(t=n.isLocked)||void 0===t?void 0:t.call(n))&&void 0!==e?e:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(null==e||!e.length)return!1;var t=e.filter((function(e){return"object"===Ka(e.data)&&Array.isArray(e.data.fields)})).every((function(e){return e.data.fields.every((function(e){var t=e.raw();return!(!t.qLocked&&t.qCardinal)}))}));return t}(r)},getIsSingleSelect:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.singleSelectIndex;return u.singleSelectDimensions[e]},getCanSelect:function(){return u.canSelect},getSelectionInfo:function(){return u.selectionInfo},setLayout:function(e){var t=function(e){var t,n,r,i=e.selections,o=e.picassoSelections,a=e.layout,s={lockedDimensions:[],singleSelectDimensions:[]};null!=i&&null!==(t=i.isModal)&&void 0!==t&&t.call(i)&&i.confirm(),o.layout(a);var l=(null!==(n=null==a?void 0:a.qHyperCube)&&void 0!==n?n:{}).qDimensionInfo,u=void 0===l?[]:l;return s.lockedDimensions=u.map((function(e){return!!e.qLocked})),s.singleSelectDimensions=u.map((function(e,t){return Zc({layout:a,path:"qHyperCube/qDimensionInfo/".concat(t)})})),s.singleSelectIndex=function(e){var t,n=((null==e?void 0:e.qHyperCube)||{}).qDimensionInfo,r=void 0===n?[]:n;return null!==(t=r.map((function(e,t){var n;return!(e.qLocked||(null===(n=e.qCardinalities)||void 0===n?void 0:n.qHypercubeCardinal)<=1)&&t})).filter((function(e){return"number"==typeof e}))[0])&&void 0!==t?t:Math.max(r.length-1,0)}(a),s.canSelect=0===u.length||u.some((function(e){return!e.qLocked})),s.dimensionLocked=!(null===(r=u[0])||void 0===r||!r.qLocked),s}({selections:n,picassoSelections:c,layout:e});Object.assign(u,t)},setFilteredFields:function(e){c.filteredFields(e)},setBrushAliases:function(e){var t=e.colorField,n=e.useLegendCube,r=void 0!==n&&n,i=Ja(e,Md),o=$a({useLegendCube:r,colorField:t,brush:d,legendAlias:h},i);y($a($a({},o),{},{defaultFunc:function(){return Qc(o)}}))},destroy:function(){l(),c.release()},custom:$a({},f)}}var Dd="'Source Sans Pro', 'Arial', 'sans-serif'",Cd="#333333",wd="#595959",Ld="#737373",Ed="#cccccc",Td="#e6e6e6";function Ad(e){var t={};return[].concat(Qa(e),Qa([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",wd],["object","axis.label.name","fontFamily",Dd],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",Ed],["object","axis.line.minor","color",Td],["object","axis.title","color"],["object","axis.title","fontFamily",Dd],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",Td],["object","grid.line.major","color",Ed],["object","grid.line.minor","color",Td],["object","label.value","color",wd],["object","label.value","fontFamily",Dd],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",wd],[!1,"label.value","lightColor",Td],["object","outOfRange","color","#999"],["object","legend.title","color",Cd],["object","legend.title","fontFamily",Dd],["object","legend.title","fontSize","15px"],["object","legend.label","color",wd],["object","legend.label","fontFamily",Dd],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",Cd],["object","referenceLine.label.name","fontFamily",Dd],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",Td],["object","referenceLine.outOfBounds","fontFamily",Dd],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",Ld,function(e){return"transparent"===e?Ld:e}]])).reduce((function(e,n){var r="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[r]||(t[r]=!0,e.push(n)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var Nd=function(e){return e};function kd(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,a={},s=r.reduce((function(e,t){var n=Za(t,2),r=n[0],i=n[1];return e[r]=i,e}),{});return o.forEach((function(e){var r=Za(e,5),i=r[0],o=r[1],l=r[2],u=r[3],c=r[4],d=void 0===c?function(e){return e}:c,m=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,a=void 0===o?void 0:o;if(!t||!1===n)return a;var s=t.getStyle(n,r,i);return void 0===s?a:s}({theme:t,base:"object"===i&&n?"".concat("object",".").concat(n):i,path:o,attribute:l,defaultValue:u}),f=(s["".concat(o,".").concat(l)]||Nd)(d(m));ru(a,[o,l].filter(Boolean).join("."),f)})),i.forEach((function(e){var t=Za(e,2),n=t[0],r=t[1];ru(a,n,r)})),a}var Od=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],Id=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];var Pd=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function Rd(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],a=t.getStyle("","","fontFamilies");return Array.isArray(a)&&a.length?o.push.apply(o,Qa(new Set([r].concat(Qa(a.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(Qa(o.map((function(e){return Pd(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],Qa(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?Id:Od}(i).map((function(e){return Pd(e)}))))}function Fd(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,a=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return a()},getOptions:function(){return Rd({theme:t,translator:n,defaultValue:a(),flags:o})}}}var Hd=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],zd=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function jd(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,r=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push.apply(r,Qa(new Set([n].concat(Qa(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(Qa(r.map((function(e){return zd(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],Qa(Hd.map((function(e){return zd(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function Bd(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:Fd({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:jd({theme:t,translator:n,id:r,path:i})}}var Vd={dataRelatedPropertiesPaths:["qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","qHyperCube.qDimensionInfo[].qCardinalities","qHyperCube.qDimensionInfo[].qMax","qHyperCube.qDimensionInfo[].qMin","qHyperCube.qDimensionInfo[].qStateCounts","qHyperCube.qMeasureInfo[].qApprMaxGlyphCount","qHyperCube.qMeasureInfo[].qAttrExprInfo","qHyperCube.qMeasureInfo[].qMax","qHyperCube.qMeasureInfo[].qMin","qHyperCube.qMeasureInfo[].qTrendLines","qHyperCube.qTreeNodesOnDim","qSelectionInfo"]};function _d(e){const{qHyperCube:t,...n}=e,{qAxisData:r,qDataPages:i,qStackedDataPages:o,qTreeDataPages:a,...s}=t,l=Y(!0,{},{...n,qHyperCube:{...s,qAxisData:null,qDataPages:null,qStackedDataPages:null,qTreeDataPages:null}}),{dataRelatedPropertiesPaths:u}=Vd;return u.forEach((e=>{const t=e.split("[");if(1===t.length)void 0!==tu(l,e)&&ru(l,e,null);else{const e=t[0],n=t[1].split("].")[1];tu(l,e,[]).forEach((e=>{void 0!==tu(e,n)&&ru(e,n,null)}))}})),l}var Ud={axes:{trackBy:function({isTime:e,isContinuous:t,isMeasure:n,isMajor:r}){return i=>{if(e||t||n){var o;if("line"===i.type)return null!==(o=i.tickValue)&&void 0!==o?o:"axis";if("text"===i.type)return`${i.tickValue} ${i.text}`;if("container"===i.type){const e=i.children.filter((e=>"text"===e.type)).map((e=>e.text));return`${i.data.value} ${e.join("")}`}return Math.random()}if(r){if("line"===i.type&&void 0===i.tickValue)return"axis";const e=i.transform&&i.transform.match(/rotate/gi)?"rotated":"horizontal";return`${i.data.group?`${i.data.group.value} `:""}${i.data.value} ${i.text} ${e}`}return Math.random()}},compensateForLayoutChanges:function({isMeasure:e,isTime:t,isContinuous:n,isHorizontal:r,dock:i}){return({currentNodes:o,currentRect:a,previousRect:s})=>{const l=a.x-s.x,u=a.y-s.y,c=a.width-s.width,d=a.height-s.height;e?("left"===i&&o.forEach((e=>{"line"===e.type?(e.x1+=c,e.x2+=c):"text"===e.type&&(e.x+=c)})),"left"!==i&&"right"!==i||o.forEach((e=>{var t;("line"===e.type&&(e.x1===e.x2?(e.y1=a.y,e.y2=e.y1+a.height):(Math.round(e.y1)<a.y||e.y1>a.y+a.height)&&(e.strokeWidth=0)),"text"===e.type)&&((e.y<a.y||e.y>a.y+a.height)&&(e.fontSize="1px","#"===(null===(t=e.fill)||void 0===t?void 0:t[0])&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`)))})),"top"!==i&&"bottom"!==i||o.forEach((e=>{var t;("line"===e.type&&(e.y1===e.y2?(e.x1=a.x,e.x2=e.x1+a.width):(Math.round(e.x1)<a.x||e.x1>a.x+a.width)&&(e.strokeWidth=0)),"text"===e.type)&&((e.x<a.x||e.x>a.x+a.width)&&(e.fontSize="1px","#"===(null===(t=e.fill)||void 0===t?void 0:t[0])&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`)))}))):t?o.forEach((e=>{"line"===e.type?e.y1===e.y2?e.x2+=c:e.x1===e.x2&&(e.x1-=l,e.x2-=l):"text"===e.type&&(e.x-=l)})):n||r?o.forEach((e=>{"line"===e.type&&e.y1===e.y2&&(e.x1+=l,e.x2+=l+c)})):o.forEach((e=>{"line"===e.type&&e.x1===e.x2&&(e.y1+=u,e.y2+=u+d)}))}}},bars:{trackBy:function(e){return e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach((e=>{e.children&&e.children.length>0&&e.children.forEach((e=>{void 0!==e.x&&void 0!==e.y?(e.x-=r,e.y-=i):e.transform=`translate(${-r}, ${-i})`}))}))}},barOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x;0===t.y-n.y&&0===r||e.forEach((e=>{e.children&&e.children.length>0&&e.children.forEach((e=>{e.opacity=0}))}))}},labels:{trackBy:function(e){if("rect"===e.type)return"-3"===e.data?Math.random():`${e.type} ${e.data} ${e.rotation}`;const t=e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal";return`${e.type} ${e.data} ${e.text} ${t}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach((e=>{e.transform&&e.transform.match(/rotate\(-90/gi)?(e.x+=i,e.y-=r):(e.x-=r,e.y-=i)}))},linkData:function(e){return e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`}},lines:{trackBy:function(e){var t;return"line"===e.type?null!==(t=e.value)&&void 0!==t?t:Math.random():"path"===e.type?`${e.generatorType} ${e.layerObj.id} ${e.data.source.key}`:Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;e.forEach((e=>{if(void 0!==e.x1&&void 0!==e.y1)e.y1===e.y2?(e.x2=e.x1+t.width,e.y1-=i,e.y2-=i):e.x1===e.x2&&(e.y2=e.y1+t.height,e.x1-=r,e.x2-=r);else{const t="x"===e.major.p?r/e.major.size:i/e.major.size,n="y"===e.minor.p?i/e.minor.size:r/e.minor.size;e.points.forEach((e=>{e.modified||(e.major-=t,e.minor-=n,e.minor0-=n,e.modified=!0)}))}}))}},lineOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x;0===t.y-n.y&&0===r||e.forEach((e=>{e.opacity=0}))}},points:{trackBy:function(e){return e.data.line?`${e.data.line.value} ${e.data.major.value}`:`${e.data.major.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach((e=>{e.cx-=r,e.cy-=i}))}},refLineLabels:{trackBy:function(e){if(void 0!==e.value){if("rect"===e.type)return`${e.value}`;if("text"===e.type)return`${e.value} ${e.text}`}return Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y,o=t.width-n.width,a=t.height-n.height;let s=-r,l=-i;e.forEach((e=>{switch(e.dock){case"right":r>0&&(s=t.width);break;case"left":o<0&&(s=-n.width);break;case"top":a<0&&(l=-n.height);break;case"bottom":i>0&&(l=t.height)}switch(e.type){case"text":case"rect":e.x+=s,e.y+=l;break;case"circle":e.cx+=s,e.cy+=l;break;case"path":e.transform=`translate(${s}, ${l})`}}))}},shadowBars:{trackBy:function(){return Math.random()}},cacheProperties:function({viewCache:e,layout:t}){const n=_d(t);e.set("dataIndependentProperties",JSON.stringify(n))},propertiesHaveChanged:function({viewCache:e,layout:t}){const n=_d(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)},nonUpdatingNode:{trackBy:function(){return Math.random()}}};const{getInputValue:$d,extractInfoFromInputValue:Wd,resolveValue:Kd}=Sa;var Gd={resolveValue:Kd,resolveInnerValues:({refLineLayout:e,refLineModel:t,layoutService:n})=>{if(n.meta.isGroupedByDimension){const r=$d({refLineLayout:e,layoutService:n});return Wd(r,t,"innerValues")}},resolveNumInnerValues:({refLineLayout:e,refLineModel:t,layoutService:n})=>{if(n.meta.mode.K)return 0;const r=$d({refLineLayout:e,layoutService:n});return Wd(r,t,"numInnerValues")||0},resolveValueText:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const{dimensionValuesInfo:r}=t,{canBeContinuous:i}=n.meta,o=$d({refLineLayout:e,layoutService:n});return r[o]&&i?r[o].qText:o},resolveValueInfo:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const r=$d({refLineLayout:e,layoutService:n}),{dimensionRefLineInfo:i}=t;return i[r]}};const Yd=({isDimension:e,refLineLayout:t,refLineModel:n,layoutService:r,colorModel:i,dockService:o,chart:a,scale:s,axis:l,invert:u,component:c,isContinuous:d})=>{var m,f;const p={dir:l,line:{strokeWidth:(null==t||null===(m=t.style)||void 0===m?void 0:m.lineThickness)||2,strokeDasharray:null==t||null===(f=t.style)||void 0===f?void 0:f.lineType,stroke:i.resolveUIColor(t.paletteColor||{index:t.color})}};return!e||r.meta.isContinuous?(p.scale=s,p.value=t.refLineExpr.value):(p.valueInfo=Gd.resolveValueInfo({refLineLayout:t,refLineModel:n,layoutService:r}),p.value=()=>{var e;const i=Sa.getScaledPosition({scale:a.scale(s),value:Gd.resolveValue({refLineLayout:t,refLineModel:n,layoutService:r}),valueInfo:p.valueInfo,size:null===(e=a.component(c))||void 0===e?void 0:e.rect["horizontal"===o.meta.major.orientation?"width":"height"],align:t.align,invert:u,layoutService:r,isContinuous:d});return Number.isNaN(i)?void 0:i}),p};function Xd({isDimension:e,refLineModel:t={},layoutService:n,colorModel:r,dockService:i,animationsEnabled:o,chart:a,scale:s,axis:l,rtl:u,key:c,mainComponentKey:d,path:m,minimumLayoutMode:f}){const p=e?t.dimensionRefLines:m?t.query.getRefLines(m):t.measureRefLines;if(!p.length)return!1;const h={key:c,type:"ref-line",layout:{minimumLayoutMode:f},lines:{y:[],x:[]},style:{oob:{show:!1}},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),animations:{enabled:o,trackBy:Ud.lines.trackBy,compensateForLayoutChanges:Ud.lines.compensateForLayoutChanges}},g=!(!e||"horizontal"!==i.meta.major.orientation||!u),y=!e||n.meta.isContinuous;return p.forEach((o=>{h.lines[l].push(Yd({isDimension:e,refLineLayout:o,refLineModel:t,layoutService:n,colorModel:r,dockService:i,chart:a,scale:s,axis:l,invert:g,component:d,isContinuous:y}))})),h}const Jd={referenceLine:{label:{name:{fontFamily:"Source Sans Pro, sans-serif",fontSize:"12px"}},outOfBounds:{backgroundColor:"#737373",color:"#e6e6e6",fontFamily:"Source Sans Pro, sans-serif",fontSize:"10px"}}},Zd=({isDimension:e,layoutService:t,animationsEnabled:n,style:r,labels:i,scale:o,formatter:a,dock:s,key:l,rtl:u,theme:c,isContinuous:d,localeInfo:m})=>({key:l,type:"reference-line-labels",renderer:"svg",labels:i,formatter:a,scale:o,layoutService:t,layout:{dock:s,rtl:u},theme:c,isContinuous:d,isDimension:e,localeInfo:m,style:{label:{fontFamily:r.referenceLine.label.name.fontFamily,fontSize:r.referenceLine.label.name.fontSize,padding:{top:2,bottom:2,left:u?2:4,right:u?4:2},background:{padding:{top:1,bottom:1,left:2,right:2}},maxWidth:100,gap:"left"===s||"right"===s?10:16},oob:{size:8,fill:r.referenceLine.outOfBounds.backgroundColor,text:{fontFamily:r.referenceLine.outOfBounds.fontFamily,fontSize:r.referenceLine.outOfBounds.fontSize,fill:r.referenceLine.outOfBounds.color,background:{fill:r.referenceLine.outOfBounds.backgroundColor}}}},animations:{enabled:n,trackBy:Ud.refLineLabels.trackBy,compensateForLayoutChanges:Ud.refLineLabels.compensateForLayoutChanges}}),Qd=({refLineLayout:e,refLineModel:t,layoutService:n,colorModel:r,scale:i,theme:o,isContinuous:a})=>{const s=r.resolveUIColor(e.paletteColor||{index:e.color}),l={align:e.align,text:e.label,fill:e.coloredBackground?o.getContrastingColorTo(s):s,showValue:!1!==e.showValue,showLabel:!1!==e.showLabel,inputValue:e.refLineExpr.value,inputValueLabel:e.refLineExpr.label};return e.coloredBackground&&(l.background={fill:s}),a?(l.scale=i,l.value=e.refLineExpr.value):(l.value=()=>Gd.resolveValue({refLineLayout:e,refLineModel:t,layoutService:n}),l.valueText=()=>Gd.resolveValueText({refLineLayout:e,refLineModel:t,layoutService:n}),l.valueInfo=()=>Gd.resolveValueInfo({refLineLayout:e,refLineModel:t,layoutService:n})),l};function em({isDimension:e,refLineModel:t={},layoutService:n,colorModel:r,animationsEnabled:i,dock:o,scale:a,style:s,formatter:l,theme:u,localeInfo:c,rtl:d,key:m,path:f}){const p=e?t.dimensionRefLineLabels:f?t.query.getRefLineLabels(f):t.measureRefLineLabels;if(!p.length)return[];const h=[],g=!e||n.meta.isContinuous,y=p.map((e=>Qd({refLineLayout:e,refLineModel:t,layoutService:n,colorModel:r,scale:a,theme:u,isContinuous:g})));return h.push(Zd({isDimension:e,rtl:d,style:Y(!0,Jd,s),dock:o,key:m,labels:y,scale:a,formatter:l,layoutService:n,animationsEnabled:i,theme:u,isContinuous:g,localeInfo:c})),h}function tm({layoutService:e,discreteModel:t}){const{isContinuous:n,canBeContinuous:r,isGroupedByDimension:i}=e.meta,o=e.getLayout(),a="K"===o.qHyperCube.qMode,s=de.dimensionless(o),l=Sa.getMeasureRefLines(o),u=Sa.getDimensionRefLines(o,s),c=Sa.getMeasureRefLineLabels(o),d=Sa.getDimensionRefLineLabels(o,s);let m={},f={};const p=()=>!(!u||!u.length)&&!u.every((t=>{const o=Sa.getInputValue({refLineLayout:t,layoutService:e});return(t=>{if(r){const n=e.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:r,qMax:i}=n;return Sa.isOutOfRange({value:t,qMin:r,qMax:i})}return!1})(o)||(t=>{if(!f[t])return!1;if(!n&&i){const n={valueInfo:f[t]},r="S"===e.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",i=e.getHyperCubeValue(r);return Sa.isOutOfDataPages({label:n,dataPages:i})}return!0})(o)})),h={isKMode:a,canBeContinuous:r,measureRefLines:l,dimensionRefLines:u,measureRefLineLabels:c,dimensionRefLineLabels:d,dimensionRefLineInfo:f,dimensionValuesInfo:m,query:{getRefLines:e=>Sa.getRefLines(o,e),getRefLineLabels:e=>Sa.getRefLineLabels(o,e)},update:()=>{f=h.dimensionRefLineInfo,p()&&(m=Sa.getDimensionValuesInfo({layout:o,canBeContinuous:r,discreteModel:t,layoutService:e}),h.dimensionValuesInfo=m,u.forEach((t=>{const n=Sa.getInputValue({refLineLayout:t,layoutService:e});m[n]&&(f[n]?(f[n].innerValues=m[n].innerValues,f[n].minOrder=Math.min(f[n].minOrder,m[n].minOrder),f[n].maxOrder=Math.max(f[n].maxOrder,m[n].maxOrder),f[n].isMinOrderOk=f[n].isMinOrderOk||m[n].isMinOrderOk,f[n].isMaxOrderOk=f[n].isMaxOrderOk||m[n].isMaxOrderOk):f[n]={id:m[n].id,qText:m[n].qText,innerValues:m[n].innerValues,minOrder:m[n].minOrder,maxOrder:m[n].maxOrder,isMinOrderOk:m[n].isMinOrderOk,isMaxOrderOk:m[n].isMaxOrderOk},f[n].numInnerValues=(f[n].maxOrder||0)-(f[n].minOrder||0)+1)})))}};return h.update(),h}const nm={combineBounds(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,r=Number.MAX_VALUE,i=-Number.MAX_VALUE;return e.forEach((e=>{e&&(t=Math.min(t,e.x,e.x+e.width),n=Math.max(n,e.x,e.x+e.width),r=Math.min(r,e.y,e.y+e.height),i=Math.max(i,e.y,e.y+e.height))})),{x:t,y:r,width:n-t,height:i-r}}},rm=(e,t,n)=>{if(!e)return Promise.resolve();let r=Yo.generate(t,n);return Y(!0,t,n),r&&r.length?(r=r.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),e.applyPatches(r,!0)):Promise.resolve()},im=e=>{var t;return!(!e||e.qHasSoftPatches||e.qExtendsId||!(((null===(t=e.qMeta)||void 0===t?void 0:t.privileges)||[]).indexOf("update")>-1))};function om(e){if(null!=e&&e.isEnabled("IM_4962_SVG_CHART_LABELS"))return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}const am={ref:null,refFn:e=>{var t;const n=null===(t=e.qHyperCubeDef.qMeasures)||void 0===t?void 0:t.findIndex((e=>{var t,n;return"colorByExpression"===(null===(t=e.qAttributeExpressions)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.id)}));return`qHyperCubeDef.qMeasures.${-1===n?0:n}.qAttributeExpressions.0.qExpression`},change(e){var t,n;const r=null===(t=e.qHyperCubeDef)||void 0===t||null===(n=t.qMeasures)||void 0===n?void 0:n.findIndex((e=>{var t,n;return"colorByExpression"===(null===(t=e.qAttributeExpressions)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.id)})),i=se.getValue(e,`qHyperCubeDef.qMeasures.${-1===r?0:r}.qAttributeExpressions.0`),o=se.getValue(e,"color");i&&(i.id="colorByExpression",o&&(o.colorExpression=i.qExpression))}};var sm={exports:{}};function lm(){}function um(){}um.resetWarningCache=lm;sm.exports=function(){function e(e,t,n,r,i,o){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:um,resetWarningCache:lm};return n.PropTypes=n,n}();var cm=z(sm.exports);function dm(e){return"large"===e?"20px":"small"===e?"12px":"16px"}function mm({d:e,size:t,style:n={},viewBox:r="0 0 16 16"}){const o={fontSize:dm(t),display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-.125em",textRendering:"optimizeLegibility",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...n};return i.createElement("i",{style:o},i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:r,fill:"currentColor"},i.createElement("path",{d:e})))}const fm={d:"M15.9993744,3 L15.9993744,5 L4.99937445,5 L4.99937445,3 L15.9993744,3 Z M8.99937445,7 L15.9993744,7 L15.9993744,9 L8.99937445,9 L8.99937445,7 Z M11.9993744,11 L15.9993744,11 L15.9993744,13 L11.9993744,13 L11.9993744,11 Z M2.2,11 L7,11 L7,9.00369263 C7,8.89323568 7.08954305,8.80369263 7.2,8.80369263 C7.2549016,8.80369263 7.30738916,8.82626165 7.34515712,8.86610844 L10.1852182,11.8624926 C10.2583124,11.93961 10.258346,12.0604218 10.1852948,12.13758 L7.34523376,15.1373102 C7.2692928,15.2175206 7.14270711,15.2209817 7.06249671,15.1450407 C7.02260076,15.1072683 7,15.0547472 7,14.9998069 L7,12.9043747 C4.79351111,12.9043747 2.8018683,12.9266213 1.02507156,12.9711145 L1.02507252,12.9711526 C0.472939773,12.9849787 0.014139487,12.5485949 0.000313396522,11.9964622 C0.000104473692,11.988119 -1.32268838e-12,11.9797736 -1.3231638e-12,11.9714278 L-1.83320026e-12,3 L2,3 L2,10.8 C2,10.9104569 2.08954305,11 2.2,11 Z"},pm={d:"M13,7 L8,7 L13,7 L13,4.98151367 C13,2.23029964 10.7614237,0 8,0 C5.23857625,0 3,2.23029964 3,4.98151367 L3,7 L3.75,7 L3,7 L4.5,7 L4.5,5.33193359 C4.5,3.21561511 5.54860291,1.5 8,1.5 C10.4513971,1.5 11.5,3.21561511 11.5,5.33193359 L11.5,7 L12.25,7 L3,7 C2.44771525,7 2,7.44771525 2,8 L2,15 C2,15.5522847 2.44771525,16 3,16 L13,16 C13.5522847,16 14,15.5522847 14,15 L14,8 C14,7.44771525 13.5522847,7 13,7 L3,7 L13,7 Z"},hm={d:"M6,10 L13,3 L15,5 L8,12 L6,14 L1,9 L3,7 L6,10 Z"},gm={d:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z"},ym={d:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};function vm(e,t,n){(function({model:e,properties:t}){return e.modifiers?e.modifiers.apply({model:e,properties:t}):Promise.resolve()})({model:e,properties:n}).then((()=>{e.colorSupport&&e.colorSupport.colorByUpdater(n,"qHyperCubeDef.");let r=Yo.generate(t,n);r&&r.length&&(r=r.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),e.applyPatches(r,!0))}))}function bm(e,t,n,r,i,o){e.getEffectiveProperties().then((a=>{const s=a.qHyperCubeDef[r].findIndex((e=>e.qDef.cId===t)),l=a.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r].findIndex((e=>e.qDef.cId===n)),u=Y(!0,{},a),c=u.qHyperCubeDef[r][s],d=u.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r][l];d.qAttributeDimensions=c.qAttributeDimensions,c.qAttributeDimensions=[],o||(d.qAttributeExpressions=c.qAttributeExpressions,c.qAttributeExpressions=[]),u.qHyperCubeDef[r][s]=d,u.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r][l]=c,i&&i({oldItem:c,newItem:d,oldProperties:a,newProperties:u,model:e}),vm(e,a,u)}))}const xm=(e,t)=>{const n=[],r=[];return t.forEach((t=>{t.qCalcCondition.qCond.qv&&r.push(e.evaluate(t.qCalcCondition.qCond.qv).then((e=>{"0"===e&&n.push(t.qDef.cId)})))})),Promise.all(r).then((()=>n))};function qm({dir:e,dock:t,altList:n,model:r,translator:i,app:o,onChange:a}){return 0===n.length?null:{dir:e,dock:t,getAlternatives(){const e=xm(o,n).then((e=>Promise.all(n.filter((t=>!e.includes(t.qDef.cId))).map((e=>function(e,t,n){if(e.qLibraryId)return t.getDimension(e.qLibraryId).then((e=>e.getLayout())).catch((()=>null)).then((e=>e?"H"!==e.qDim.qGrouping&&e.qDim.qLabelExpression?e.qDim.qLabelExpression:e.qDim.title:n.get("Object.ErrorMessage.MissingDimension")));const r=e.qDef.qLabelExpression;if(r)return t.evaluate(r);const i=e.qDef.qFieldLabels[0]||e.qDef.qFieldDefs[0];return Promise.resolve(i)}(e,o,i).then((t=>({id:e.qDef.cId,selected:!1,title:t}))))))));return e},changeTo(e,t){bm(r,e,t,"qDimensions",a)}}}function Mm(e,t,n,r="/qHyperCubeDef"){return{breadcrumbs:e.qGroupFallbackTitles.slice(0,e.qGroupPos),drilldown:"H"===e.qGrouping,index:t,locked:!!e.qLocked,text:"H"===e.qGrouping?e.qGroupFallbackTitles[e.qGroupPos]:e.qFallbackTitle,popoverText:(i=e,"H"===i.qGrouping?i.title||"":i.qFallbackTitle||""),drillUp(e){n.drillUp(r,t,e)},id:e.cId};var i}function Sm({altList:e,app:t,dir:n,dock:r,model:i,onChange:o,skipAttributeExpressions:a,translator:s}){return 0===e.length?null:{dir:n,dock:r,getAlternatives(){const n=xm(t,e).then((n=>Promise.all(e.filter((e=>!n.includes(e.qDef.cId))).map((e=>function(e,t,n){if(e.qLibraryId)return t.getMeasure(e.qLibraryId).then((e=>e.getLayout())).catch((()=>null)).then((e=>e?e.qMeasure.qLabelExpression?e.qMeasure.qLabelExpression:e.qMeasure.qLabel||e.qMeasure.qDef:n.get("Object.ErrorMessage.MissingMeasure")));const r=e.qDef.qLabelExpression;if(r)return t.evaluate(r);const i=e.qDef.qLabel||e.qDef.qDef;return Promise.resolve(i)}(e,t,s).then((t=>({id:e.qDef.cId,selected:!1,title:t}))))))));return n},changeTo(e,t){bm(i,e,t,"qMeasures",o,a)}}}function Dm(e,t){return{breadcrumbs:[],drilldown:!1,index:t,locked:!1,text:e.qFallbackTitle,popoverText:e.qFallbackTitle,id:e.cId}}const Cm={bottom:{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},top:{anchorOrigin:{vertical:"top",horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"}},left:{anchorOrigin:{vertical:"center",horizontal:"left"},transformOrigin:{vertical:"center",horizontal:"right"}},right:{anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"}}},wm={menuItem:"alternative-menu-item",titleButton:"title-button",activeTitleButton:"active-title-button"},Lm=o(a)((()=>({textAlign:"start","&:focus":{boxShadow:"inset 0 0 0 2px #177FE6 !important"}}))),Em=o((({children:e,...t})=>i.createElement(s,H({size:"small",disableRipple:!0,disableTouchRipple:!0},t),e)))((()=>({"&:focus":{boxShadow:"inset 0 0 0 2px #177FE6 !important"}})));function Tm(e){const t=e=>{if("Tab"===e.key){const t=document.querySelectorAll(`.${wm.menuItem}`);let n;e.shiftKey?null!=t&&t.length&&t[0]===e.target&&(n=t[t.length-1]):null!=t&&t.length&&t[t.length-1]===e.target&&([n]=t),n&&setTimeout((()=>{n.focus()}),50)}};function n({title:e,selected:n,onClick:r}){const o=Se.detectTextDirection(e);return i.createElement(Lm,{role:"menuitem",button:!0,onClick:r,className:wm.menuItem,onKeyDown:t},i.createElement(c,{style:{minWidth:32}},i.createElement(mm,{d:n?hm.d:""})),i.createElement(d,{primaryTypographyProps:{dir:o}},e))}function r({alignTo:e,changeTo:t,current:r,dir:o,dock:a,list:s,onClose:c,show:d,instruction:m}){const f=s.map((e=>i.createElement(n,{key:e.id,title:e.title,onClick:()=>t(e.id)})));return i.createElement(l,H({anchorEl:e,open:d,onClose:c},Cm[a],{PaperProps:{style:{minWidth:"250px",maxHeight:"300px"}}}),i.createElement(u,{dense:!0,dir:o,"aria-label":m,component:"nav"},i.createElement(n,{title:r,selected:!0,onClick:c}),f))}n.propTypes={title:cm.string.isRequired,selected:cm.bool,onClick:cm.func.isRequired},n.defaultProps={selected:!1},r.propTypes={alignTo:cm.any,changeTo:cm.func.isRequired,current:cm.string.isRequired,dir:cm.string.isRequired,dock:cm.string.isRequired,list:cm.array,onClose:cm.func.isRequired,show:cm.bool.isRequired,instruction:cm.string.isRequired},r.defaultProps={list:[],alignTo:null};class o extends i.Component{constructor(e){super(e),this.state={open:!1,inSelection:e.selections&&e.selections.isActive(),hasValidAlternatives:!1},this.openPopover=this.openPopover.bind(this),this.closePopover=this.closePopover.bind(this),this.changeTo=this.changeTo.bind(this),this.alignToRef=i.createRef()}componentDidMount(){const{popover:e,selections:t,supportConditional:n}=this.props;t&&(this.onSelectionsActivated=()=>this.setState({inSelection:!0}),this.onSelectionsDeactivated=()=>this.setState({inSelection:!1}),t.addListener("activated",this.onSelectionsActivated),t.addListener("deactivated",this.onSelectionsDeactivated),t.addListener("canceled",this.onSelectionsDeactivated)),e&&n&&e.getAlternatives().then((e=>{this.setState({hasValidAlternatives:0!==e.length})}))}componentDidUpdate(e,t){const{popover:n,supportConditional:r}=this.props;n&&r&&n.getAlternatives().then((e=>{t.hasValidAlternatives!==(0!==e.length)&&this.setState({hasValidAlternatives:0!==e.length})}))}componentWillUnmount(){const{selections:e}=this.props;e&&(e.removeListener("activated",this.onSelectionsActivated),e.removeListener("deactivated",this.onSelectionsDeactivated),e.removeListener("canceled",this.onSelectionsDeactivated))}changeTo(e){this.props.popover.changeTo(this.props.titleData.id,e),this.closePopover(e)}openPopover(e){if(!(this.state.closeTime&&Date.now()-this.state.closeTime<20)){if(e.target){const t=e.target.closest(`.${wm.titleButton}`);t&&t.classList.add(wm.activeTitleButton)}this.props.popover.getAlternatives().then((e=>{this.setState({open:!0,alternatives:e});document.querySelector(`.${wm.menuItem}`).focus()}))}}closePopover(e){if(this.setState({open:!1,closeTime:Date.now()}),"string"==typeof e)setTimeout((()=>{const t=document.querySelector(`.${wm.titleButton}[data-id="${e}"]`);t&&t.focus()}),1e3);else{const e=document.querySelector(`.${wm.activeTitleButton}`);e&&(e.classList.remove(wm.activeTitleButton),setTimeout((()=>{e.focus()}),50))}}render(){const{titleData:e,popover:t,translator:n,disabled:o,isDimension:a,padding:s,minWidth:l,hasAlternative:u,supportConditional:c}=this.props,d={flex:"1 1 auto",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:"normal",lineHeight:"normal",...this.props.style},m=e.breadcrumbs.length,f=o||this.state.inSelection,p=e.breadcrumbs.map(((t,n)=>i.createElement(Em,{style:{display:"flex",alignItems:"center",color:f&&"rgba(89, 89, 89, 0.8)",pointerEvents:f?"none":"auto",paddingTop:0,paddingBottom:0,height:"100%"},key:n,onClick:()=>f?void 0:e.drillUp(m-n),title:t},i.createElement("span",{style:d},t),i.createElement(mm,H({},ym,{size:"small",style:{margin:"0 8px"}}))))),h=c?this.state.hasValidAlternatives:u,g=t&&!this.state.open?this.openPopover:this.closePopover,y=!t||o||this.state.inSelection,v={display:"flex",alignItems:"center",width:"100%",color:y&&"rgba(89, 89, 89, 0.8)",height:"100%",border:!a&&y&&"none",paddingTop:0,paddingBottom:0};this.state.open&&(v.background="rgba(0,0,0,0.08)");s&&(v.padding=s),l&&(v.minWidth=l);const b=Se.detectTextDirection(e.text),x=i.createElement(Em,{"aria-label":n.get("Accessibility.Alternative.Instructions",[e.text]),style:v,onClick:y?void 0:g,title:e.text,tabIndex:y?-1:0,onFocus:y?void 0:e=>{e.currentTarget.style.boxShadow="0px 0px 0px 2px #177FE6 inset",e.currentTarget.style.borderRadius="2px"},onBlur:y?void 0:e=>{e.currentTarget.style.boxShadow="none",e.currentTarget.style.borderRadius="0px"},onMouseDown:e=>{e.preventDefault()},className:`${wm.titleButton} ${e.id}`,"data-id":e.id},e.locked&&i.createElement(mm,H({},pm,{size:"small",title:n.get("Tooltip.selections.locked")})),i.createElement("span",{style:d,dir:b},e.text),t&&h&&i.createElement(mm,H({},gm,{size:"small",style:{margin:"0 8px"}})));return i.createElement(i.Fragment,null,e.drilldown&&i.createElement(mm,H({},fm,{size:"small",title:n.get("Tooltip.dimensions.drilldown"),style:{margin:"0 4px 0 0"}})),p,i.createElement("div",{ref:this.alignToRef,style:{overflow:"hidden",pointerEvents:h?"auto":"none",height:"100%"}},x),t&&h&&i.createElement(r,{dock:t.dock,dir:t.dir,current:e.popoverText,alignTo:this.alignToRef.current,show:this.state.open,list:this.state.alternatives,onClose:this.closePopover,changeTo:this.changeTo,instruction:n.get("Accessibility.Popover.Instructions")}))}}function a(e){return{top:"bottom",bottom:"top",left:"right",right:"left"}[e]}function s(e){return!e.isDimension&&se.getValue(e,"hyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures.length")>0}return o.propTypes={disabled:cm.bool.isRequired,padding:cm.string,minWidth:cm.string,titleData:cm.shape({breadcrumbs:cm.arrayOf(cm.string).isRequired,drilldown:cm.bool.isRequired,index:cm.number.isRequired,locked:cm.bool.isRequired,text:cm.string.isRequired,popoverText:cm.string.isRequired,drillUp:cm.func,id:cm.string.isRequired}).isRequired,popover:cm.shape({dir:cm.string.isRequired,dock:cm.string.isRequired,changeTo:cm.func.isRequired,getAlternatives:cm.func.isRequired}),translator:cm.shape({get:cm.func.isRequired}).isRequired,selections:cm.shape({isActive:cm.func,addListener:cm.func,removeListener:cm.func}),style:cm.shape({fontSize:cm.string,color:cm.string,fontFamily:cm.string}).isRequired,isDimension:cm.bool.isRequired,hasAlternative:cm.bool.isRequired,supportConditional:cm.bool.isRequired},o.defaultProps={popover:null,selections:null,padding:"",minWidth:""},{renderer:"react",disableTriggers:!0,preferredSize:function(){const{height:t}=e.measureText({text:"M",fontSize:this.style.fontSize,fontFamily:this.style.fontFamily});return this.settings.settings.isDimension||s(this.settings.settings)?Math.max(28,t):Math.max(20,t)},render(){const{settings:{app:e,disabled:t,explicitItemInfos:n,hyperCube:r,hyperCubeDef:l,isDimension:u,minWidth:c,model:d,onChangeToAlternative:m,padding:f,rtl:p,selections:h,skipAttributeExpressions:g,translator:y,supportConditional:v=!1},layout:{dock:b}}=this.settings,x="top"!==b&&"bottom"!==b||!p?"ltr":"rtl",q=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",height:"100%"};return"left"===e?(n.width=`${t.height}px`,n.height=`${t.width}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left"):"right"===e&&(n.width=`${t.height}px`,n.height=`${t.width}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left"),n}(b,this.rect),M=l&&l.qLayoutExclude&&l.qLayoutExclude.qHyperCubeDef,S=M&&M[u?"qDimensions":"qMeasures"]||[],D=n||r[u?"qDimensionInfo":"qMeasureInfo"],C=u?qm:Sm,w=u?Mm:Dm,L=d&&d.colorSupport&&d.modifiers&&C({altList:S,app:e,dir:p?"rtl":"ltr",dock:a(b),model:d,onChange:m,skipAttributeExpressions:g,translator:y}),E=(T=this.settings.settings).isDimension&&se.getValue(T,"hyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.length")>0||s(this.settings.settings);var T;const A=D.map(((e,n)=>{const r="number"==typeof e.explicitColumn?e.explicitColumn:n,a=w(e,r,d),s=n===D.length-1;return i.createElement(i.Fragment,{key:e.cId},i.createElement(o,{popover:L,titleData:a,model:d,translator:y,selections:h,disabled:t(),style:this.style,isDimension:u,padding:f,minWidth:c,hasAlternative:E,supportConditional:v}),!s&&i.createElement("span",{style:{lineHeight:"normal",...this.style}},", "))}));return i.createElement("div",{style:q,dir:x},A)}}}function Am(){return Am=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Am.apply(this,arguments)}function Nm(e){return Nm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nm(e)}function km(e){return e&&"object"===Nm(e)&&e.constructor===Object}function Om(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},r=n.clone?Am({},e):e;return km(e)&&km(t)&&Object.keys(t).forEach((function(i){"__proto__"!==i&&(km(t[i])&&i in e?r[i]=Om(e[i],t[i],n):r[i]=t[i])})),r}function Im(e){var t=function(e,t){if("object"!==Nm(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Nm(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Nm(t)?t:String(t)}function Pm(e,t,n){return(t=Im(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rm(e){for(var t="https://mui.com/production-error/?code="+e,n=1;n<arguments.length;n+=1)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified Material-UI error #"+e+"; visit "+t+" for the full message."}function Fm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function Hm(e){if(e.type)return e;if("#"===e.charAt(0))return Hm(function(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map((function(e){return e+e}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(Rm(3,e));var r=e.substring(t+1,e.length-1).split(",");return{type:n,values:r=r.map((function(e){return parseFloat(e)}))}}function zm(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function jm(e){var t="hsl"===(e=Hm(e)).type?Hm(function(e){var t=(e=Hm(e)).values,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return i-o*Math.max(Math.min(t-3,9-t,1),-1)},s="rgb",l=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return"hsla"===e.type&&(s+="a",l.push(t[3])),zm({type:s,values:l})}(e)).values:e.values;return t=t.map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Bm(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var Vm=["xs","sm","md","lg","xl"];function _m(e,t,n){var r;return Am({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return console.warn(["Material-UI: theme.mixins.gutters() is deprecated.","You can use the source of the mixin directly:","\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3),\n },\n "].join("\n")),Am({paddingLeft:t(2),paddingRight:t(2)},n,Pm({},e.up("sm"),Am({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(r={minHeight:56},Pm(r,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Pm(r,e.up("sm"),{minHeight:64}),r)},n)}var Um={black:"#000",white:"#fff"},$m={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},Wm={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},Km={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},Gm={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Ym={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},Xm={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Jm={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},Zm={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Um.white,default:$m[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},Qm={text:{primary:Um.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:$m[800],default:"#303030"},action:{active:Um.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function ef(e,t,n,r){var i=r.light||r,o=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=function(e,t){if(e=Hm(e),t=Fm(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return zm(e)}(e.main,i):"dark"===t&&(e.dark=function(e,t){if(e=Hm(e),t=Fm(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return zm(e)}(e.main,o)))}function tf(e){var t=e.primary,n=void 0===t?{light:Wm[300],main:Wm[500],dark:Wm[700]}:t,r=e.secondary,i=void 0===r?{light:Km.A200,main:Km.A400,dark:Km.A700}:r,o=e.error,a=void 0===o?{light:Gm[300],main:Gm[500],dark:Gm[700]}:o,s=e.warning,l=void 0===s?{light:Ym[300],main:Ym[500],dark:Ym[700]}:s,u=e.info,c=void 0===u?{light:Xm[300],main:Xm[500],dark:Xm[700]}:u,d=e.success,m=void 0===d?{light:Jm[300],main:Jm[500],dark:Jm[700]}:d,f=e.type,p=void 0===f?"light":f,h=e.contrastThreshold,g=void 0===h?3:h,y=e.tonalOffset,v=void 0===y?.2:y,b=Bm(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function x(e){var t=function(e,t){var n=jm(e),r=jm(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}(e,Qm.text.primary)>=g?Qm.text.primary:Zm.text.primary;return t}var q=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(e=Am({},e)).main&&e[t]&&(e.main=e[t]),!e.main)throw new Error(Rm(4,t));if("string"!=typeof e.main)throw new Error(Rm(5,JSON.stringify(e.main)));return ef(e,"light",n,v),ef(e,"dark",r,v),e.contrastText||(e.contrastText=x(e.main)),e},M={dark:Qm,light:Zm};return Om(Am({common:Um,type:p,primary:q(n),secondary:q(i,"A400","A200","A700"),error:q(a),warning:q(l),info:q(c),success:q(m),grey:$m,contrastThreshold:g,getContrastText:x,augmentColor:q,tonalOffset:v},M[p]),b)}function nf(e){return Math.round(1e5*e)/1e5}function rf(e){return nf(e)}var of={textTransform:"uppercase"},af='"Roboto", "Helvetica", "Arial", sans-serif';function sf(e,t){var n="function"==typeof t?t(e):t,r=n.fontFamily,i=void 0===r?af:r,o=n.fontSize,a=void 0===o?14:o,s=n.fontWeightLight,l=void 0===s?300:s,u=n.fontWeightRegular,c=void 0===u?400:u,d=n.fontWeightMedium,m=void 0===d?500:d,f=n.fontWeightBold,p=void 0===f?700:f,h=n.htmlFontSize,g=void 0===h?16:h,y=n.allVariants,v=n.pxToRem,b=Bm(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]),x=a/14,q=v||function(e){return"".concat(e/g*x,"rem")},M=function(e,t,n,r,o){return Am({fontFamily:i,fontWeight:e,fontSize:q(t),lineHeight:n},i===af?{letterSpacing:"".concat(nf(r/t),"em")}:{},o,y)},S={h1:M(l,96,1.167,-1.5),h2:M(l,60,1.2,-.5),h3:M(c,48,1.167,0),h4:M(c,34,1.235,.25),h5:M(c,24,1.334,0),h6:M(m,20,1.6,.15),subtitle1:M(c,16,1.75,.15),subtitle2:M(m,14,1.57,.1),body1:M(c,16,1.5,.15),body2:M(c,14,1.43,.15),button:M(m,14,1.75,.4,of),caption:M(c,12,1.66,.4),overline:M(c,12,2.66,1,of)};return Om(Am({htmlFontSize:g,pxToRem:q,round:rf,fontFamily:i,fontSize:a,fontWeightLight:l,fontWeightRegular:c,fontWeightMedium:m,fontWeightBold:p},S),b,{clone:!1})}function lf(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var uf=["none",lf(0,2,1,-1,0,1,1,0,0,1,3,0),lf(0,3,1,-2,0,2,2,0,0,1,5,0),lf(0,3,3,-2,0,3,4,0,0,1,8,0),lf(0,2,4,-1,0,4,5,0,0,1,10,0),lf(0,3,5,-1,0,5,8,0,0,1,14,0),lf(0,3,5,-1,0,6,10,0,0,1,18,0),lf(0,4,5,-2,0,7,10,1,0,2,16,1),lf(0,5,5,-3,0,8,10,1,0,3,14,2),lf(0,5,6,-3,0,9,12,1,0,3,16,2),lf(0,6,6,-3,0,10,14,1,0,4,18,3),lf(0,6,7,-4,0,11,15,1,0,4,20,3),lf(0,7,8,-4,0,12,17,2,0,5,22,4),lf(0,7,8,-4,0,13,19,2,0,5,24,4),lf(0,7,9,-4,0,14,21,2,0,5,26,4),lf(0,8,9,-5,0,15,22,2,0,6,28,5),lf(0,8,10,-5,0,16,24,2,0,6,30,5),lf(0,8,11,-5,0,17,26,2,0,6,32,5),lf(0,9,11,-5,0,18,28,2,0,7,34,6),lf(0,9,12,-6,0,19,29,2,0,7,36,6),lf(0,10,13,-6,0,20,31,3,0,8,38,7),lf(0,10,13,-6,0,21,33,3,0,8,40,7),lf(0,10,14,-6,0,22,35,3,0,8,42,7),lf(0,11,14,-7,0,23,36,3,0,9,44,8),lf(0,11,15,-7,0,24,38,3,0,9,46,8)],cf={borderRadius:4};function df(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=function(e){var t=e.spacing||8;return"number"==typeof t?function(e){return t*e}:Array.isArray(t)?function(e){return t[e]}:"function"==typeof t?t:function(){}}({spacing:e}),n=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return 0===n.length?t(1):1===n.length?t(n[0]):n.map((function(e){if("string"==typeof e)return e;var n=t(e);return"number"==typeof n?"".concat(n,"px"):n})).join(" ")};return Object.defineProperty(n,"unit",{get:function(){return e}}),n.mui=!0,n}var mf={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},ff={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function pf(e){return"".concat(Math.round(e),"ms")}var hf={easing:mf,duration:ff,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,r=void 0===n?ff.standard:n,i=t.easing,o=void 0===i?mf.easeInOut:i,a=t.delay,s=void 0===a?0:a;return Bm(t,["duration","easing","delay"]),(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"==typeof r?r:pf(r)," ").concat(o," ").concat("string"==typeof s?s:pf(s))})).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}},gf={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function yf(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,i=void 0===r?{}:r,o=e.palette,a=void 0===o?{}:o,s=e.spacing,l=e.typography,u=void 0===l?{}:l,c=Bm(e,["breakpoints","mixins","palette","spacing","typography"]),d=tf(a),m=function(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,r=e.unit,i=void 0===r?"px":r,o=e.step,a=void 0===o?5:o,s=Bm(e,["values","unit","step"]);function l(e){var t="number"==typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(i,")")}function u(e,t){var r=Vm.indexOf(t);return r===Vm.length-1?l(e):"@media (min-width:".concat("number"==typeof n[e]?n[e]:e).concat(i,") and ")+"(max-width:".concat((-1!==r&&"number"==typeof n[Vm[r+1]]?n[Vm[r+1]]:t)-a/100).concat(i,")")}return Am({keys:Vm,values:n,up:l,down:function(e){var t=Vm.indexOf(e)+1,r=n[Vm[t]];return t===Vm.length?l("xs"):"@media (max-width:".concat(("number"==typeof r&&t>0?r:e)-a/100).concat(i,")")},between:u,only:function(e){return u(e,e)},width:function(e){return n[e]}},s)}(n),f=df(s),p=Om({breakpoints:m,direction:"ltr",mixins:_m(m,f,i),overrides:{},palette:d,props:{},shadows:uf,typography:sf(d,u),spacing:f,shape:cf,transitions:hf,zIndex:gf},c),h=arguments.length,g=new Array(h>1?h-1:0),y=1;y<h;y++)g[y-1]=arguments[y];return p=g.reduce((function(e,t){return Om(e,t)}),p)}const vf=function(){return yf.apply(void 0,arguments)}({palette:{text:{primary:"rgba(89, 89, 89, 0.8)",secondary:"rgba(0, 0, 0, 0.55)",disabled:"rgba(0, 0, 0, 0.3)"},action:{disabled:"rgba(0, 0, 0, 0.3)"}},typography:{fontFamily:'"Source Sans Pro", "Arial", "sans-serif"',button:{textTransform:"initial",fontWeight:400}},shape:{borderRadius:2},shadows:["none","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)"],props:{MuiButtonBase:{disableRipple:!0}}});const bf=f({productionPrefix:"q9b31",disableGlobal:!0,seed:""});function xf(){function e({x:e,y:t,width:n,height:r,scaleRatio:i,margin:o}={}){const a={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0}};return a.x=Number.isNaN(e)?a.x:e,a.y=Number.isNaN(t)?a.y:t,a.width=Number.isNaN(n)?a.width:n,a.height=Number.isNaN(r)?a.height:r,void 0!==i&&(a.scaleRatio.x=Number.isNaN(i.x)?a.scaleRatio.x:i.x,a.scaleRatio.y=Number.isNaN(i.y)?a.scaleRatio.y:i.y),void 0!==o&&(a.margin.left=Number.isNaN(o.left)?0:o.left,a.margin.top=Number.isNaN(o.top)?0:o.top),a}return function(t={}){const{createElement:n=document.createElement.bind(document)}=t;let r,o=e();const a={element:()=>r,root:()=>r,appendTo:e=>(r||(r=n("div"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none"),e.appendChild(r),r),render(e){if(!r)return!1;const t=o.scaleRatio.x,n=o.scaleRatio.y;return r.style.left=`${Math.round(o.margin.left+o.x*t)}px`,r.style.top=`${Math.round(o.margin.top+o.y*n)}px`,r.style.width=`${Math.round(o.width)}px`,r.style.height=`${Math.round(o.height)}px`,r.style.transform=`scale(${t}, ${n})`,r.style.transformOrigin="top left",m.render(function(e,t){return i.createElement(p,{generateClassName:t},i.createElement(h,{theme:vf},e))}(e,bf),r),!0},itemsAt:()=>[],findShapes:()=>[],clear:()=>(r&&m.unmountComponentAtNode(r),a),destroy(){r&&r.parentElement&&(m.unmountComponentAtNode(r),r.parentElement.removeChild(r)),r=null},size:t=>(t&&(o=e(t)),o)};return a}}function qf(){return function(e){e.renderer("react",xf()),e.component("data-title",Tm(e.renderer("svg")())),e.component("disclaimer",function(){class e extends i.Component{render(){const{label:e,spanStyle:t}=this.props;return i.createElement(i.Fragment,null,i.createElement("span",{ref:this.alignToRef,style:t,title:e},e))}}return e.propTypes={label:cm.string.isRequired,spanStyle:cm.shape().isRequired},{renderer:"react",disableTriggers:!0,preferredSize:function(){return 22},render(){const{settings:{label:t,rtl:n},layout:{dock:r},style:o={}}=this.settings,a="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",s=function(e,t,n){const r={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px",fontFamily:e.fontFamily||'"Source Sans Pro", "Arial", "sans-serif"'};switch(t){case"left":r.width=`${n.height}px`,r.transform=`rotate(-90deg) translate(-${n.height}px, 0)`,r.transformOrigin="top left";break;case"right":r.width=`${n.height}px`,r.transform=`rotate(90deg) translate(0, -${n.width}px)`,r.transformOrigin="top left";break;case"center":r.width=`${n.width}px`,r.height=`${n.height}px`,r.color="#595959",r.fontStyle="normal",r.fontSize="1.2em",r.textAlign="center";break;default:r.justifyContent="flex-start",r.alignItems="flex-start"}return r}(o,r,this.rect),l="center"===r?t:`* ${t}`,u="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return i.createElement("div",{style:s,dir:a},i.createElement(i.Fragment,null,i.createElement(e,{label:l,spanStyle:u})))}}}())}}var Mf={MAX_NUM_POINTS:5e4,DEFAULT_NUM_POINTS:2e3,DEFAULT_NUM_LINES:12};const{DEFAULT_NUM_POINTS:Sf}=Mf;function Df({layoutService:e,largeDataService:t}){const{maxNumPoints:n=Sf}=(null==t?void 0:t.meta)||{},{qHyperCube:r}=e.getLayout();return r.qSize.qcy*r.qMeasureInfo.length>n}const{DEFAULT_NUM_LINES:Cf}=Mf,wf=({layoutService:e,largeDataService:t})=>{const{maxNumLines:n=Cf}=(null==t?void 0:t.meta)||{},{qHyperCube:r}=e.getLayout();return r.qDimensionInfo.length>1&&!Df({layoutService:e,largeDataService:t})?e.meta.size.dimensions[1]+1:n},{DEFAULT_NUM_POINTS:Lf}=Mf,{MAX_NUM_POINTS:Ef,DEFAULT_NUM_POINTS:Tf,DEFAULT_NUM_LINES:Af}=Mf,{DEFAULT_NUM_POINTS:Nf}=Mf,kf=({layoutService:e,largeDataService:t})=>{if(!Df({layoutService:e,largeDataService:t})){const{maxNumPoints:e=Nf}=(null==t?void 0:t.meta)||{};return e}const{dimensionCount:n}=e.meta;return n>1?(({layoutService:e,largeDataService:t})=>{var n;const{dimensions:r=[]}=(null==e||null===(n=e.meta)||void 0===n?void 0:n.size)||{},{maxNumLines:i=Af,maxNumPoints:o=Tf,hasInjectedData:a=!1}=(null==t?void 0:t.meta)||{};if(wf({layoutService:e,largeDataService:t})*r[0]<=o)return r[0];const s=Math.max(1,Math.min(i,r[1])),l=o/s,u=Math.floor(r[0]<=l?l:l/4),c=2*s*(s+1);return a&&(s>Af||o>Tf)?Math.min(u,Math.ceil(Ef/c)):u})({layoutService:e,largeDataService:t}):(({layoutService:e,largeDataService:t})=>{const{maxNumPoints:n=Lf}=(null==t?void 0:t.meta)||{},{measureCount:r=1}=(null==e?void 0:e.meta)||{},i=4+2*(r-1);return Math.floor(n/(r*i))})({layoutService:e,largeDataService:t})},Of=({start:e,end:t,model:n,layoutService:r,largeDataService:i,definitionPath:o})=>{const a={qStart:e,qEnd:t,qNbrPoints:kf({layoutService:r,largeDataService:i}),qMaxNbrTicks:300,qMaxNumberLines:wf({layoutService:r,largeDataService:i})};return n.getHyperCubeContinuousData(o,a,!1)};function If({model:e,layoutService:t,largeDataService:n,definitionPath:r="/qHyperCubeDef"}){return{shouldFetchReduced:()=>Df({layoutService:t,largeDataService:n}),computeNbrOfBins:()=>kf({layoutService:t,largeDataService:n}),computeMaxNumberLines:()=>wf({layoutService:t,largeDataService:n}),fetch:(i,o)=>Of({start:i,end:o,model:e,layoutService:t,largeDataService:n,definitionPath:r})}}function Pf(e={}){const{cache:t={}}=e;return{fetch:()=>Promise.resolve(t.merged)}}function Rf({layoutService:e,viewCache:t}){return{fetch:()=>{const{qAxisData:t,qDataPages:n}=e.getHyperCube();return Promise.resolve({qAxisData:t,qDataPages:n})},getSnapshotData(){const n=e.getLayoutValue("snapshotData.content.chartData",{});return"zoom"in n&&"min"in n.zoom&&"max"in n.zoom?function({zoom:e}){return{zoom:e}}(n):function({scrollOffset:e=0,viewRange:t=0},n){let r=n+e,i=r+t;return 1===t&&0===e&&(r=n-.5,i=n+.5),{zoom:{min:r,max:i}}}(n,t.get("continuousMin"))}}}function Ff(){const e=()=>{},t=[],n={};return e.set=(e,r)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1),t.push(e),n[e]=r},e.forEach=e=>{t.forEach(((t,r)=>e(n[t],r)))},e.has=e=>e in n,e}function Hf(e,t,n){return n[0]&&n[0][1]&&n[0][1].qElemNumber>-1?function({start:e,end:t,matrix:n}){const r=[],i=Ff(),o=Ff();for(let a=0;a<n.length;a++){const s=n[a],l=s[1].qElemNumber.toString();s[0].qNum<e?i.set(l,s):s[0].qNum>t&&(o.has(l)||o.set(l,s)),s[0].qNum>=e&&s[0].qNum<=t&&r.push(s)}return i.forEach(((e,t)=>r.splice(t,0,e))),o.forEach((e=>r.push(e))),r}({start:e,end:t,matrix:n}):function({start:e,end:t,matrix:n}){const r=[];let i,o;for(let a=0;a<n.length;a++){const s=n[a];s[0].qNum<e?i=s:s[0].qNum>t&&(o||(o=s)),s[0].qNum>=e&&s[0].qNum<=t&&r.push(s)}return i&&r.unshift(i),o&&r.push(o),r}({start:e,end:t,matrix:n})}function zf(e,t){return{...e,qWidth:t[0]?t[0].length:0,qHeight:t.length}}function jf(e,t,n){const r={qDataPages:(n.qDataPages||[]).map((n=>{const r=Hf(e,t,n.qMatrix),i=zf(n.qArea,r);return{...n,qArea:i,qMatrix:r}}))};return n.qAxisData&&n.qAxisData.qAxis&&(r.qAxisData=function(e,t,n){return{qAxis:n.qAxis.map((n=>({qName:n.qName,qTags:n.qTags,qTicks:n.qTicks.reduce(((n,r)=>((r.qStart>=e&&r.qStart<=t||r.qEnd>=e&&r.qEnd<=t||r.qStart<e&&r.qEnd>t)&&n.push(r),n)),[])})))}}(e,t,n.qAxisData)),r}const Bf=2**.5,Vf=1/Bf,_f=1e-6,Uf=Vf**44;function $f(e){return e.qIsOtherCell}function Wf({qDataPages:e=[]}={},t={}){const n=e.length?e[0].qMatrix:[];return t.isStackedByDimension?function(e){const t={};return e.forEach((e=>{if(!e.some($f)){const n=e[0].qElemNumber;t[n]=void 0}})),Object.keys(t).length}(n):function(e){let t=0;return e.forEach((e=>{e.some($f)||t++})),t}(n)}const Kf={query:{getShouldProcess:()=>!1},command:{processDataPage:()=>{}}};var Gf={created(){this.state={}},beforeUpdate(){this.state={}},beforeRender({size:e}){this.state.ticks=this.scale.ticks({distance:e.width}).filter((e=>!e.isMinor)),"linear"===this.scale.type&&function(e,t){const[,n]=e.domain();for(let e=0;e<t.length;e++){const r=t[e],i=t[e+1];r.data={},i||1===r.end?i?(r.data.start=r.value,r.data.end=i.value,r.end=i.position):(r.data.start=r.value,r.data.end=r.value):(r.data.start=r.value,r.data.end=n,r.end=1)}}(this.scale,this.state.ticks)},render(){const e=this.scale.data().fields.length?this.scale.data().fields[0].id():"",{ticks:t}=this.state,n=t.map((t=>({type:"rect",fill:"none",data:{source:{field:e},value:[t.data.start,t.data.end]},x:t.start*this.rect.width,y:0,width:(t.end-t.start)*this.rect.width,height:this.rect.height})));if(t.length&&t[0].start>0){const r=t[0];n.unshift({type:"rect",fill:"none",data:{source:{field:e},value:[this.scale.domain()[0],r.data.start]},x:0,y:0,width:r.start*this.rect.width,height:this.rect.height})}return n}};const Yf="…";function Xf(e,t=1){if(t%2==0)return e;let n=Math.round(e);return e-n>0?n+=.5:n-=.5,n}function Jf(e,t){const{localProps:{size:n},props:{anchor:r}}=t,i=function({props:e,localProps:{size:t},style:n,renderer:r}){const i=e.label.padding,o=Math.max(0,Math.min(e.label.justify,1)),a=Math.max(0,Math.min(e.label.align,1)),s=e=>r.measureText({text:e,fontSize:n.label.fontSize,fontFamily:n.label.fontFamily});return{resolve:(e,r)=>{const l="string"==typeof e.label?e.label:"",u=s(l);let{x:c,width:d}=r;e.start===e.end&&(d=u.width+2*i,1===e.end&&(c-=d));const m={x:c+i,y:i,width:d-2*i,height:t.height-2*i},f=s(`${l[0]}${Yf}`).width,p=Math.max(0,m.width-u.width),h=Math.max(0,m.height-u.height),g=o*p,y=a*h;return{show:m.width>=Math.min(f,u.width),text:l,dx:g,dy:y,rect:m,style:n.label,segment:{x:c+g,width:u.width+2*i},tickValue:e.value}}}}(t),o=function({localProps:{size:e},style:t,scale:n,props:r}){const[i,o]=n.domain(),a=Math.max(0,Math.min(1,r.guideLine.major.justify));return{resolve:(n,r)=>{const s=a*r.width,l=Xf(r.x+s,t.majorGuideLine.strokeWidth);return{show:n.value>=i&&n.value<=o,x1:l,y1:0,x2:l,y2:Xf(e.height,t.majorGuideLine.strokeWidth),style:t.majorGuideLine,tickValue:n.value}}}}(t),a=e.map((e=>{const t=function(e,t,n){const r=Math.abs(Math.max(e.start,0)-Math.min(e.end,1))*t.width;return{x:Math.max(e[n],0)*t.width,y:0,width:r,height:t.height}}(e,n,r);return{rect:t,label:i.resolve(e,t),guideLine:o.resolve(e,t)}}));return function(e,t){const n=e.length;if(n<2)return;const r=e[n-1],i=t[n-1].label;if(r&&r.start===r.end)for(let e=n-2;e>-1;e--){const n=t[e].label;n.show=n.show&&(o=n.segment,a=i.segment,!(o.x<a.x?o.x+o.width>=a.x:a.x+a.width>=o.x))}var o,a}(e,a),a}function Zf(e,t){const n=function({localProps:{size:e},props:t,style:n}){return{resolve:r=>{const i=Math.max(e.height-t.guideLine.minor.size,0)*Math.max(0,Math.min(t.guideLine.minor.align,1)),o=Xf(r.position*e.width,n.minorGuideLine.strokeWidth);return{guideLine:{show:!0,x1:o,y1:Xf(i,n.minorGuideLine.strokeWidth),x2:o,y2:Xf(t.guideLine.minor.size+i,n.minorGuideLine.strokeWidth),style:n.minorGuideLine}}}}}(t);return t.props.guideLine.minor.show?e.map(n.resolve):[]}function Qf(e){return e.filter((e=>e.show)).map((e=>Y({strokeWidth:1},e.style,{type:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,tickValue:e.tickValue})))}var ep={require:["renderer"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{anchor:"start",label:{show:!0,padding:4,align:0,justify:0},line:{show:!0},guideLine:{major:{justify:0},minor:{show:!0,size:4,align:0}}},style:{label:"$label",line:"$guide-line",majorGuideLine:"$guide-line",minorGuideLine:"$guide-line"}},preferredSize:()=>({size:30,edgeBleed:{left:1,right:1}}),init(){this.props=this.settings.settings,this.localProps={},this.state={major:[],minor:[]}},created(){this.init()},beforeUpdate(){this.init()},beforeRender({size:e}){this.localProps.size=e;const t=this.scale.ticks({distance:e.width}),n=t.filter((e=>!e.isMinor)),r=t.filter((e=>e.isMinor));this.state.line=function({localProps:{size:e},style:t,props:n}){const r=Xf(1,t.line.strokeWidth);return{show:n.line.show,x1:Xf(0,t.line.strokeWidth),y1:r,x2:Xf(e.width,t.line.strokeWidth),y2:r,style:t.line}}(this),this.state.major=Jf(n,this),this.state.minor=Zf(r,this)},render(){return[...Qf([this.state.line]),...(e=this.state.major.map((e=>e.label)),e.filter((e=>e.show)).map((e=>Y({},e.style,{type:"text",x:e.rect.x,y:e.rect.y,dx:e.dx,dy:e.dy,maxWidth:e.rect.width,text:e.text,title:e.text,baseline:"text-before-edge",tickValue:e.tickValue})))),...Qf(this.state.major.map((e=>e.guideLine))),...Qf(this.state.minor.map((e=>e.guideLine)))];var e}};function tp(e,t){return e&&t&&e.qTicks.length===t.qTicks.length&&e.qTicks.every(((e,n)=>e.qStart===t.qTicks[n].qStart&&e.qEnd===t.qTicks[n].qEnd))}function np(e){return e.qTags.indexOf("$qualified")>-1}function rp({qAxis:e}){const t=[],n=[];for(let r=0;r<e.length;r++){const i=r+1,o=e[r],a=e[i];tp(o,a)?(np(a)?(t.push(i),n.push(r)):(t.push(r),n.push(i)),r++):(t.push(r),n.push(r))}return{qualified:t,nonQualified:n}}function ip({qualifiedMeta:e,nonQualifiedMeta:t}){return{resolve(n){let r,i=NaN,o=NaN,a=NaN,s=!1;for(let l=e.length-1;l>=0;l--){const u=e[l];if(u.queries.outer(n)){const e=t[l+1];if(i=u.index,r=l,u.attrs.isDayOrShorter()&&u.queries.canFitHalfDayTicks(n)){o="auto",s=!0;break}if(e&&e.queries.inner(n)){o=e.index;const r=t[l+2];r&&r.queries.minor(n)&&(a=r.index);break}}}if(!Number.isNaN(i)&&Number.isNaN(o)&&"auto"!==o){o=i,i=NaN;const e=t[r+1];e&&e.queries.minor(n)&&(a=e.index)}else Number.isNaN(i)&&(i="auto",o="auto");return{outer:i,inner:o,minor:a,isDayOrShorter:s}}}}const op=16;function ap({qTicks:e,measureText:t=(()=>({width:0})),cache:n={},scale:r}){const i=n;return{isDayOrShorter:()=>(i.isDayOrShorter=e.length>0&&Math.abs(e[0].qStart-e[0].qEnd)<=1,i.isDayOrShorter),count:()=>e.length,maxRange:()=>(i.maxRange=e.length?Math.max(...e.map((e=>Math.abs(r(e.qStart)-r(e.qEnd))))):0,i.maxRange),rangeAndWidth(){const n=r.clamp();return r.clamp(!1),i.rangeAndWidth=e.map((e=>({range:Math.abs(r(e.qStart)-r(e.qEnd)),width:t(`${e.qText}`).width+op}))),r.clamp(n),i.rangeAndWidth}}}const sp=6;function lp({attrs:e,reqAutoFitWidth:t}){return{outer:t=>!e.rangeAndWidth().some((({width:e,range:n})=>e>n*t)),inner:t=>!e.rangeAndWidth().some((({width:e,range:n})=>e>n*t)),minor:t=>e.maxRange()*t>=sp,canFitHalfDayTicks:n=>n>=t*e.count()}}function up({qualified:e,nonQualified:t,qAxis:n,measureText:r,reqAutoFitWidth:i,scale:o},{attributesFactory:a=ap,queryFactory:s=lp}={attributesFactory:ap,queryFactory:lp}){const l=n.map(((e,t)=>function(e,t){const{qTicks:n}=e,l=a({qTicks:n,measureText:r,scale:o});return{data:e,index:t,attrs:l,queries:s({attrs:l,reqAutoFitWidth:i})}}(e,t))),u=e.map((e=>l[e])),c=t.map((e=>l[e]));return{qAxisMeta:l,qualifiedMeta:u,nonQualifiedMeta:c}}function cp({qAxis:e=[],measureText:t=(()=>({width:0})),cache:n={},reqAutoFitWidth:r=0,scale:i},{metaFactory:o=up,mapper:a=rp,resolver:s=ip}={metaFactory:up,mapper:rp,resolver:ip}){const{qualified:l,nonQualified:u}=a({qAxis:e}),{qualifiedMeta:c,nonQualifiedMeta:d}=o({qAxis:e,qualified:l,nonQualified:u,measureText:t,reqAutoFitWidth:r,scale:i}),m=s({qualifiedMeta:c,nonQualifiedMeta:d});return{resolve:t=>{const r=n.key({distance:t});if(n.get(r))return n.get(r);if(function(e){return!Array.isArray(e)||0===e.length||e.every((e=>0===e.qTicks.length))}(e))return{outer:"auto",inner:"auto",minor:NaN,isDayOrShorter:!1};const i=m.resolve(t);return n.set(r,i),i}}}const dp=86400,mp=864e5;function fp(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(mp*(e-Math.floor(e)))))}const pp=fp(0).getTime();function hp(e){return(e.getTime()-pp)/dp/1e3}const gp=new Date,yp=new Date;function vp(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(s<n&&n<r);return a},i.filter=n=>vp((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((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=(t,r)=>(gp.setTime(+t),yp.setTime(+r),e(gp),e(yp),Math.floor(n(gp,yp))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e==0:t=>i.count(0,t)%e==0):i:null)),i}const bp=1e3,xp=6e4,qp=36e5,Mp=864e5,Sp=6048e5,Dp=vp((e=>{e.setTime(e-e.getMilliseconds())}),((e,t)=>{e.setTime(+e+t*bp)}),((e,t)=>(t-e)/bp),(e=>e.getUTCSeconds()));Dp.range;const Cp=vp((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*bp)}),((e,t)=>{e.setTime(+e+t*xp)}),((e,t)=>(t-e)/xp),(e=>e.getMinutes()));Cp.range;const wp=vp((e=>{e.setUTCSeconds(0,0)}),((e,t)=>{e.setTime(+e+t*xp)}),((e,t)=>(t-e)/xp),(e=>e.getUTCMinutes()));wp.range;const Lp=vp((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*bp-e.getMinutes()*xp)}),((e,t)=>{e.setTime(+e+t*qp)}),((e,t)=>(t-e)/qp),(e=>e.getHours()));Lp.range;const Ep=vp((e=>{e.setUTCMinutes(0,0,0)}),((e,t)=>{e.setTime(+e+t*qp)}),((e,t)=>(t-e)/qp),(e=>e.getUTCHours()));Ep.range;const Tp=vp((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*xp)/Mp),(e=>e.getDate()-1));Tp.range;const Ap=vp((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/Mp),(e=>e.getUTCDate()-1));Ap.range;const Np=vp((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/Mp),(e=>Math.floor(e/Mp)));function kp(e){return vp((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*xp)/Sp))}Np.range;const Op=kp(0),Ip=kp(1),Pp=kp(2),Rp=kp(3),Fp=kp(4),Hp=kp(5),zp=kp(6);function jp(e){return vp((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/Sp))}Op.range,Ip.range,Pp.range,Rp.range,Fp.range,Hp.range,zp.range;const Bp=jp(0),Vp=jp(1),_p=jp(2),Up=jp(3),$p=jp(4),Wp=jp(5),Kp=jp(6);Bp.range,Vp.range,_p.range,Up.range,$p.range,Wp.range,Kp.range;const Gp=vp((e=>{e.setDate(1),e.setHours(0,0,0,0)}),((e,t)=>{e.setMonth(e.getMonth()+t)}),((e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())),(e=>e.getMonth()));Gp.range;const Yp=vp((e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)}),((e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())),(e=>e.getUTCMonth()));Yp.range;const Xp=vp((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()));Xp.every=e=>isFinite(e=Math.floor(e))&&e>0?vp((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)})):null,Xp.range;const Jp=vp((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()));Jp.every=e=>isFinite(e=Math.floor(e))&&e>0?vp((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)})):null,Jp.range;const Zp={second:1,minute:2,hour:3,day:4,month:5,year:6};function Qp({timeScale:e,labels:t,distance:n,isDayOrShorter:r,cache:i,timeOnly:o,initialMin:a}){const[s,l]=e.domain(),u=i.key({distance:n});let c;i.get(u,1)?c=i.get(u,1):(c=function(e,t,n,r,i,o){function a(e){return Jp.filter((t=>(t.getUTCFullYear()-o.getUTCFullYear())%e==0))}const s=Dp.count(e,t),l=wp.count(e,t),u=Ep.count(e,t),c=Ap.count(e,t),d=Bp.count(e,t),m=Yp.count(e,t),f=Jp.count(e,t),p=n/r.second.width-1,h=n/r.minute.width-1,g=n/r.date.width-1,y=n/r.year.width-1,v={type:"year",desc:"year",count:f,interval:Jp.every(1),formatter:r.year.formatter,offset:e=>Jp.offset(e,-1),floor:Jp.floor};if(s<=p)v.type=Zp.second,v.desc="second",v.count=s,v.interval=Dp.every(1),v.formatter=r.second.formatter,v.offset=e=>Dp.offset(e,-1),v.floor=Dp.floor;else if(s/2<=p)v.type=Zp.second,v.desc="every other second",v.count=s/2,v.interval=Dp.every(2),v.formatter=r.second.formatter,v.offset=e=>Dp.offset(e,-2),v.floor=Dp.floor;else if(s/5<=p)v.type=Zp.second,v.desc="every 5 second",v.count=s/5,v.interval=Dp.every(5),v.formatter=r.second.formatter,v.offset=e=>Dp.offset(e,-5),v.floor=Dp.floor;else if(s/15<=p)v.type=Zp.second,v.desc="every 15 second",v.count=s/15,v.interval=Dp.every(15),v.formatter=r.second.formatter,v.offset=e=>Dp.offset(e,-15),v.floor=Dp.floor;else if(s/30<=p)v.type=Zp.second,v.desc="every 30 second",v.count=s/30,v.interval=Dp.every(30),v.formatter=r.second.formatter,v.offset=e=>Dp.offset(e,-30),v.floor=Dp.floor;else if(l<=h)v.type=Zp.minute,v.desc="minute",v.count=l,v.interval=wp.every(1),v.formatter=r.minute.formatter,v.offset=e=>wp.offset(e,-1),v.floor=wp.floor;else if(l/2<=h)v.type=Zp.minute,v.desc="every 2 minute",v.count=l/2,v.interval=wp.every(2),v.formatter=r.minute.formatter,v.offset=e=>wp.offset(e,-2),v.floor=wp.floor;else if(l/5<=h)v.type=Zp.minute,v.desc="every 5 minute",v.count=l/5,v.interval=wp.every(5),v.formatter=r.minute.formatter,v.offset=e=>wp.offset(e,-5),v.floor=wp.floor;else if(l/10<=h)v.type=Zp.minute,v.desc="every 10 minute",v.count=l/10,v.interval=wp.every(10),v.formatter=r.minute.formatter,v.offset=e=>wp.offset(e,-10),v.floor=wp.floor;else if(l/15<=h)v.type=Zp.minute,v.desc="every 15 minute",v.count=l/15,v.interval=wp.every(15),v.formatter=r.minute.formatter,v.offset=e=>wp.offset(e,-15),v.floor=wp.floor;else if(l/30<=h)v.type=Zp.minute,v.desc="every 30 minute",v.count=l/30,v.interval=wp.every(30),v.formatter=r.minute.formatter,v.offset=e=>wp.offset(e,-30),v.floor=wp.floor;else if(u<=h)v.type=Zp.hour,v.desc="hour",v.count=u,v.interval=Ep.every(1),v.formatter=r.minute.formatter,v.offset=e=>Ep.offset(e,-1),v.floor=Ep.floor;else if(u/2<=h)v.type=Zp.hour,v.desc="every 2 hour",v.count=u/2,v.interval=Ep.every(2),v.formatter=r.minute.formatter,v.offset=e=>Ep.offset(e,-2),v.floor=Ep.floor;else if(u/3<=h)v.type=Zp.hour,v.desc="every 3 hour",v.count=u/3,v.interval=Ep.every(3),v.formatter=r.minute.formatter,v.offset=e=>Ep.offset(e,-3),v.floor=Ep.floor;else if(u/6<=h)v.type=Zp.hour,v.desc="every 6 hour",v.count=u/6,v.interval=Ep.every(6),v.formatter=r.minute.formatter,v.offset=e=>Ep.offset(e,-6),v.floor=Ep.floor;else if(u/12<=h||i)v.type=Zp.hour,v.desc="every 12 hour",v.count=u/12,v.interval=Ep.every(12),v.formatter=r.minute.formatter,v.offset=e=>Ep.offset(e,-12),v.floor=Ep.floor;else if(c<=g)v.type=Zp.day,v.desc="day",v.count=c,v.interval=Ap.every(1),v.formatter=r.date.formatter,v.offset=e=>Ap.offset(e,-1),v.floor=Ap.floor;else if(c/2<=g)v.type=Zp.day,v.desc="every 2 day",v.count=c/2,v.interval=Ap.every(2),v.formatter=r.date.formatter,v.offset=e=>Ap.offset(e,-2),v.floor=Ap.floor;else if(c/3<=g)v.type=Zp.day,v.desc="every 3 day",v.count=c/3,v.interval=Ap.every(3),v.formatter=r.date.formatter,v.offset=e=>Ap.offset(e,-3),v.floor=Ap.floor;else if(d<=g)v.type=Zp.day,v.desc="week",v.count=d,v.interval=Bp.every(1),v.formatter=r.date.formatter,v.offset=e=>Bp.offset(e,-1),v.floor=Ap.floor;else if(d/2<=g)v.type=Zp.day,v.desc="every 2 week",v.count=d/2,v.interval=Bp.every(2),v.formatter=r.date.formatter,v.offset=e=>Bp.offset(e,-2),v.floor=Ap.floor;else if(m<=g)v.type=Zp.month,v.desc="month",v.count=m,v.interval=Yp.every(1),v.formatter=r.date.formatter,v.offset=e=>Yp.offset(e,-1),v.floor=Ap.floor;else if(m/3<=g)v.type=Zp.month,v.desc="quarter",v.count=m/3,v.interval=Yp.every(3),v.formatter=r.date.formatter,v.offset=e=>Yp.offset(e,-3),v.floor=Ap.floor;else if(m/6<=g)v.type=Zp.month,v.desc="half year",v.count=m/6,v.interval=Yp.every(6),v.formatter=r.date.formatter,v.offset=e=>Yp.offset(e,-6),v.floor=Ap.floor;else if(f<=y)v.type=Zp.year,v.desc="year",v.count=f,v.interval=Jp.every(1),v.formatter=r.year.formatter,v.offset=e=>Jp.offset(e,-1),v.floor=Jp.floor;else if(f/2<=y)v.type=Zp.year,v.desc="every 2 year",v.count=f/2,v.interval=a(2),v.formatter=r.year.formatter,v.offset=e=>Jp.offset(e,-2),v.floor=Jp.floor;else if(f/5<=y)v.type=Zp.year,v.desc="every 5 year",v.count=f/5,v.interval=a(5),v.formatter=r.year.formatter,v.offset=e=>Jp.offset(e,-5),v.floor=Jp.floor;else if(f/10<=y)v.type=Zp.year,v.desc="every 10 year",v.count=f/10,v.interval=a(10),v.formatter=r.year.formatter,v.offset=e=>Jp.offset(e,-10),v.floor=Jp.floor;else{const e=Math.floor(f/y);v.type=Zp.year,v.desc="every nth year",v.count=e,v.interval=a(e),v.formatter=r.year.formatter,v.offset=t=>Jp.offset(t,-e),v.floor=Jp.floor}return v}(s,l,n,t.all(),r,a),i.set(u,c,1));const d=e.ticks(c.interval);d.length?s.getTime()!==d[0].getTime()&&d.unshift(c.offset(d[0])):d.push(c.floor(s));const m=d.map(((e,t,n)=>{const r=n[t+1]?n[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+r),formatter:c.formatter}}));let f=[];if(!o&&c.type<=Zp.hour){const n=t.getFormat("date"),r=e.ticks(Ap.every(1));r.length&&s.getUTCDate()!==r[0].getUTCDate()&&r.unshift(Ap.offset(r[0],-1)),f=(r.length?r:[Ap.floor(s)]).map(((e,t,r)=>{const i=r[t+1]?r[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+i),formatter:n.formatter}}))}return{inner:m,outer:f}}const eh=86400,th=1440,nh={};function rh(e,t,n,r){return{type:e,start:new Date(Date.UTC(...t)),end:new Date(Date.UTC(...n)),formatter:r}}function ih(e,t,n){const{generator:r,anchor:i,clamp:o,level:a}=t.ticks,{qNumFormat:s}=t.formatter;e.clamp(o);const[l,u]=e.domain(),c=zo().domain([fp(l),fp(u)]);c.clamp(o),c.range(t.invert?[1,0]:[0,1]);const d="object"==typeof r?r:{type:r};let m;m="d3"===d.type?(e,i)=>Qp({timeScale:c,labels:n,distance:e,isDayOrShorter:i,cache:t.cache,timeOnly:"T"===s.qType,initialMin:void 0===d.initialMin?c.domain()[0]:fp(r.initialMin)}):e=>function(e,t,n,r,i,o=!1){if(nh[[t,n,r,r,o]])return nh[[t,n,r,r,o]];const a={year:e.getFormat("year"),date:e.getFormat("date"),minute:e.getFormat("minute"),second:e.getFormat("second")},s=fp(n),l=s.getFullYear(),u=s.getMonth(),c=s.getDate(),d=r-n,m=t/(i-r),f=m/1440,p=m/eh,h=366*m,g=3*m*30,y=a.second.width/p,v=a.minute.width/f,b=a.date.width/g,x=a.year.width/h;let q,M,S,D=0,C=0,w=null,L=null,E=null,T=null,A=null,N=null;const k={outer:[],inner:[]};for(y<1?(w=1,C=1/eh):y<2?(w=2,C=1/eh*2):y<5?(w=5,C=1/eh*5):y<10?(w=10,C=1/eh*10):y<30?(w=30,C=1/eh*30):v<1?(L=1,C=1/th):v<2?(L=2,C=1/th*2):v<5?(L=5,C=1/th*5):v<10?(L=10,C=1/th*10):v<30?(L=30,C=1/th*30):v<60?(E=1,C=1/24):v<120?(E=2,C=2/24):v<360?(E=6,C=.25):v<720?(E=12,C=.5):b<1/90?(C=1,T=1):b<2/90?(C=2,T=2):b<7/90?(C=7,T=7):b<31/90?(A=1,C=31):b<1?(A=3,C=90):x<1?(N=1,C=366):x<2?(N=2,C=732):x<5?(N=5,C=1826.25):(N=10,C=3652.5),M=Math.floor((d+n%1)/C);D<i;){S=M+1,q=N?rh("year",[l+M*N,0,1],[l+S*N,0,1],a.year.formatter):A?rh("month",[l,u+M*A,1],[l,u+S*A,1],a.date.formatter):T?rh("day",[l,u,c+M*T],[l,u,c+S*T],a.date.formatter):E?rh("hour",[l,u,c,0+M*E],[l,u,c,0+S*E],a.minute.formatter):L?rh("minute",[l,u,c,0,0+M*L],[l,u,c,0,0+S*L],a.minute.formatter):rh("second",[l,u,c,0,0,0+M*w],[l,u,c,0,0,0+S*w],a.second.formatter),D=hp(q.start),k.inner.push(q);const e=Math.floor(D);if(!(o||N||A||T)){const t={type:"day",start:fp(e),end:fp(e+1),formatter:a.date.formatter,qStart:e};k.outer[k.outer.length-1]&&k.outer[k.outer.length-1].qStart===t.qStart||k.outer.push(t)}M++}return k.min=r,k.max=i,nh[[t,n,r,r,o]]=k,k}(n,e,d.min,l,u,"T"===s.qType);const f={transform:(t=[],{isMinor:n=!1}={})=>t.map((t=>{let r;r="start"===i?t.qStart:"end"===i?t.qEnd:(t.qStart+t.qEnd)/2;const o=e.clamp();n&&e.clamp(!1);const a=e(r),s=e(t.qStart),l=e(t.qEnd);return e.clamp(o),{value:r,position:a,start:s,end:l,label:t.qText,isMinor:n,data:n?void 0:{start:t.qStart,end:t.qEnd,scaleStart:e.domain()[0]}}})).filter((e=>e.position>=0&&e.position<=1)),generate:(t=100,n)=>m(t,n)[a].map((t=>{let n;return n="start"===i?hp(t.start):"end"===i?hp(t.end):(hp(t.start)+hp(t.end))/2,{position:c(t.start),start:c(t.start),end:c(t.end),value:n,label:t.formatter(n),isMinor:!1,data:{start:hp(t.start),end:hp(t.end),scaleStart:e.domain()[0]}}})).filter((e=>e.position>=0&&e.position<=1))};return f}const oh=41000.2343433,ah=/t+/i,sh=16,lh=60;const uh={min:NaN,max:NaN,invert:!1,qAxis:[],field:void 0,formatter:{fn:()=>e=>e,measureText:()=>({width:0,height:0}),localeInfo:{},qNumFormat:{}},ticks:{generator:"d3",level:"outer",anchor:void 0,clamp:!1},cache:{get:()=>!1,set:()=>{},key:()=>""}};function ch(e,t){e.instance||(e.instance=t.copy(),e.instance.domain(t.domain()),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}const dh="continuousPan";var mh={model:function({model:e,layoutService:t,largeDataService:n,dataProcessorModel:r=Kf,viewCache:i,viewState:o,definitionPath:a},s={}){const{engineFetcherFactory:l=If,snapshotFetcherFactory:u=Rf,cacheFetcherFactory:c=Pf,cache:d={initial:{},merged:{}}}=s,m=l({model:e,layoutService:t,largeDataService:n,definitionPath:a}),f=u({layoutService:t,viewCache:i}),p=c({cache:d}),h=e=>{throw e.isHandled=!0,e};let g,y,v;return{update(e){var n,r;({initialMin:y,initialMax:v}=function(e={}){let{qMin:t,qMax:n}=e;return t=Number.isNaN(+t)?0:t,n=Number.isNaN(+n)?0:n,{initialMin:t,initialMax:n}}(e.qHyperCube.qDimensionInfo[0])),i.set("continuousMin",y),i.set("continuousMax",v),i.set("minimiumZoomSpan",(n=y,r=v,Math.max(_f,(r-n)*Uf))),g=t.meta.isSnapshot?f:m,t.meta.isSnapshot&&({zoom:{min:y,max:v}}=f.getSnapshotData()),o.preventSet("zoom",{min:y,max:v})},updateLayout(e){const{qDataPages:n,qAxisData:r}=e;return t.setHyperCubeValue("qDataPages",n),t.setHyperCubeValue("qAxisData",r),t.setHyperCubeValue("qMode","S"),t.setHyperCubeValue("qColumnOrder",[]),e},initialFetch(){return g.fetch(y,v).then((e=>{const t=function(e){return{qDataPages:e.qDataPages.map((e=>{const t=zf(e.qArea,e.qMatrix);return{...e,qArea:t}})),qAxisData:e.qAxisData}}(e);return r.command.processDataPage({dataPage:t.qDataPages.length?t.qDataPages[0]:[]}),d.initial=t,d.merged=t,e})).then((e=>jf(y,v,e))).then((e=>this.updateLayout(e))).catch(h)},fetch:(e,t)=>g.fetch(e,t).then((e=>function(e,t){const n={};return n.qDataPages=(e.qDataPages||[]).map(((e,n)=>{const r=function(e,t){if(!t||!t.length||!t[0].length)return e;const n=t[0][0].qNum,r=t[t.length-1][0].qNum,i=[],o=[];for(let t=0,a=e.length;t<a;t++){const a=e[t][0];a.qNum<n?i.push(e[t]):a.qNum>r&&o.push(e[t])}return[...i,...t,...o]}(e.qMatrix,t.qDataPages[n].qMatrix),i=zf(e.qArea,r);return{...e,qArea:i,qMatrix:r}})),e.qAxisData&&e.qAxisData.qAxis&&(n.qAxisData=function(e,t){if(!t||!t.qAxis.length||t.qAxis.every((e=>!e.qTicks.length)))return e;const n=t.qAxis.map((e=>e.qName)),r=t.qAxis.map((e=>({start:e.qTicks[0].qStart,end:e.qTicks[e.qTicks.length-1].qStart}))),i=t.qAxis.map((e=>({qName:e.qName,qTags:[...e.qTags],qTicks:[...e.qTicks]})));for(let t=0,o=e.qAxis.length;t<o;t++){const o=e.qAxis[t],a=n.indexOf(o.qName),s=[],l=[];if(a>-1){const{start:e,end:t}=r[a];for(let n=0,r=o.qTicks.length;n<r;n++){const r=o.qTicks[n];r.qStart<e?s.push(r):r.qStart>t&&l.push(r)}i[a].qTicks=[...s,...i[a].qTicks,...l]}}return{qAxis:i}}(e.qAxisData,t.qAxisData)),n}(d.initial,e))).then((e=>(r.command.processDataPage({dataPage:e.qDataPages.length?e.qDataPages[0]:[]}),d.merged=e,e))).then((n=>jf(e,t,n))).catch(h),fetchFromCache:(e,t)=>p.fetch(e,t).then((n=>jf(e,t,n))),fetchMinMaxData:()=>Promise.resolve(d.initial.qDataPages||[]),getInitialCube(){const e=t.getHyperCube();return Y({},e,{...d.initial})},getInitialLayout(){const e=this.getInitialCube();return Y({},t.getLayout(),{qHyperCube:e})},getDimensionCardinality:()=>Wf(d.initial,t.meta),setSnapshotData(e){const{qHyperCube:t}=e,n=r.query.getShouldProcess()?[r.query.getFilteredDataPage({dataPage:d.merged.qDataPages[0]})]:d.merged.qDataPages;t.qDataPages=n,t.qAxisData=d.merged.qAxisData}}},event:{onZoomChange:function(e,t){const{layoutService:n,continuousDataModel:r}=e;function i(e,n,i){return r[e](n,i).then((e=>(r.updateLayout(e),t(),e)))}const o=au(((e,t)=>i("fetch",e,t)),50);return({min:e,max:t},{min:r,max:a})=>!n.meta.isContinuous||e===r&&t===a?Promise.resolve(null):i("fetchFromCache",e,t).then((n=>(o(e,t),n)))},onZoomIntercept:function({viewCache:e}){let t=NaN,n=NaN,r=NaN;return(i,o)=>(t=e.get("continuousMin"),n=e.get("continuousMax"),r=e.get("minimiumZoomSpan"),Math.abs(i.max-i.min)<r?o:{min:Math.min(i.max,Math.max(t,i.min)),max:Math.max(i.min,Math.min(n,i.max))})},onZoom:function({viewCache:e,viewState:t,chart:n},{threshold:r=50,rtl:i=!1,targetKey:o}){const a=e.get("continuousMin"),s=e.get("continuousMax");return su(((e,r)=>{const l=(e=>n.componentsFromPoint(e).filter((e=>e.key===o))[0])(e);if(l){const o=function(e,t,n){let{x:r}=e;return r-=t.element.getBoundingClientRect().left,r-=n.rect.x,Math.max(0,Math.min(1,r/n.rect.width))}(e,n,l),u=i?1-o:o,{min:c,max:d}=t.get("zoom"),m=Math.abs(d-c),f=m-(r>0?Vf:Bf)*m,p=c+f*u,h=d-f*(1-u),g=p<a?a-p:0,y=h>s?h-s:0;t.set("zoom",{min:Math.max(p-y,a),max:Math.min(h+g,s)})}}),r)}},interactions:{areaPan:function({targetKey:e,chart:t,actions:n,viewState:r,viewCache:i}){return{type:"Pan",key:"continuous:pan",options:{event:dh,pointers:1,threshold:10,enable(r,i){return this.started===dh||!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e))}},events:{[`${dh}start`](n){n.preventDefault(),this.started=dh;const{min:i,max:o}=r.get("zoom");this[dh]={min:i,max:o,size:t.component(e).rect.computedInner.width,span:o-i}},[`${dh}move`](e){e.preventDefault();const{span:t,min:n,max:o,size:a}=this[dh],s=-e.deltaX/a;r.set("zoom",{min:Math.min(n+s*t,i.get("continuousMax")-t),max:Math.max(o+s*t,i.get("continuousMin")+t)})},[`${dh}end`](e){e.preventDefault(),this.started=!1},[`${dh}cancel`](e){e.preventDefault(),this.started=!1}}}}},picassoComponents:{axisOverlay:Gf,timeAxis:ep},picassoScales:{time:function e(t,n={}){const r=function(e,t,n){const r={};return Object.keys(t).forEach((i=>{const o=e[i],a=typeof o;"function"===a?r[i]=o(n):"object"!==a||Array.isArray(o)?r[i]="undefined"===a?t[i]:o:r[i]=Y(!0,{},t[i],o)})),r}(t,uh,n),{qAxis:i}=r,o=Er(),a={instance:null,invert:!1},{min:s,max:l}=function(e,t){let n=+e.min,r=+e.max;return Number.isNaN(n)&&Number.isNaN(r)&&Array.isArray(t)&&t.length&&(n=Math.min(...t[t.length-1].qTicks.map((e=>e.qStart))),r=Math.max(...t[t.length-1].qTicks.map((e=>e.qEnd)))),n===r&&(n-=.5,r+=.5),{min:Number.isNaN(+n)?0:n,max:Number.isNaN(+r)?1:r}}(r,i);let u,c,d=[];const m=function(e){return Number.isNaN(+e)?NaN:o(e)};m.ticks=({distance:e,resolve:t=u.resolve}={})=>{const n=t(e),o=n[r.ticks.level];if(Number.isNaN(+o)||(d=c.transform(i[o].qTicks,{isMinor:!1})),!Number.isNaN(+n.minor)){const e=c.transform(i[n.minor].qTicks,{isMinor:!0});d=d.concat(e)}return"auto"===o&&(d=c.generate(e,n.isDayOrShorter)),d},m.invert=e=>o.invert(e),m.domain=e=>Array.isArray(e)?o.domain(e):o.domain(),m.range=e=>Array.isArray(e)?o.range(e):o.range(),m.norm=e=>(ch(a,m),a.instance(e)),m.normInvert=e=>(ch(a,m),a.instance.invert(e)),m.copy=()=>e(t,n),m.clamp=(e=!0)=>(o.clamp(e),o.clamp()),m.min=()=>Math.min(s,l),m.max=()=>Math.max(s,l),o.range(r.invert?[1,0]:[0,1]),o.domain([s,l]),a.invert=r.invert;const f=function(e){const t={},{measureText:n,fn:r,localeInfo:i}=e.formatter,o={second:{type:"second",pattern:"hh:mm:ss",width:lh,formatter:void 0},minute:{type:"minute",pattern:"hh:mm",width:lh,formatter:void 0},date:{type:"date",pattern:"YYYY-MM-DD",width:lh,formatter:void 0},year:{type:"year",pattern:"YYYY",width:lh,formatter:void 0}};return i&&ah.test(i.qTimestampFmt)&&(o.minute.pattern+=" tt",o.second.pattern+=" tt"),o.date.pattern=i&&i.qDateFmt?i.qDateFmt:o.date.pattern,Object.keys(o).forEach((e=>{o[e].formatter=r(o[e].pattern),o[e].width=Math.max(o[e].width,n(o[e].formatter(oh)).width+sh)})),t.getFormat=e=>o[e],t.all=()=>o,t.getFormatFromTicks=e=>{const t=e.filter((e=>!e.isMinor)),{length:n}=t;if(!n)return o.date;const r=fp(t[0].data.start),i=fp(t[n-1].data.start);return Ap.count(r,i)/n>=1?o.date:Ep.count(r,i)/n>0?o.minute:wp.count(r,i)/n>0?o.second:o.date},t}(r);return c=ih(o.copy(),r,f),u=cp({qAxis:i,measureText:r.formatter.measureText,reqAutoFitWidth:2*f.getFormat("minute").width,cache:r.cache,scale:m}),m.data=()=>({fields:[{formatter:m.formatter,id:()=>`qHyperCube/${r.field}`,key:()=>r.field,raw:tu(n,"fields.0.raw",(()=>({})))}]}),m.formatter=()=>f.getFormatFromTicks(d).formatter,m}}};const fh={MINI_CHART:{value:"miniChart",translation:"properties.scrollbar.miniChart"},BAR:{value:"bar",translation:"properties.scrollbar.bar"},NONE:{value:"none",translation:"properties.scrollbar.none"}};var ph={OPTIONS:fh,DEFAULT:fh.MINI_CHART};function hh({layoutService:e,discrete:t}){return({h:n,rect:r,orientation:i,minThumbSize:o})=>{const a=t.query.getCurrentDataPage(),s=e.meta.size.y,l="horizontal"===i,u=r[l?"width":"height"];let c=a.qArea.qTop/s*u,d=a.qArea.qHeight/s*u;if(d<o){const e=(o-d)/2;c=c-e+(Math.max(0,0-(c-e))-Math.max(0,c+d+e-u)),d=o}return n("div",{style:{position:"absolute",right:0,bottom:0,background:"red",opacity:.2,...l?{top:0,left:c,width:d}:{top:c,left:0,height:d}}})}}function gh({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),r=t.get("continuousMin"),i=t.get("continuousMax");return[(n.min-r)/(i-r),(n.max-r)/(i-r)]}(t,n):function(e){return e.get("viewRange")}(t)}const yh=e=>({miniChart:e===ph.OPTIONS.MINI_CHART.value,bar:e===ph.OPTIONS.BAR.value,none:e===ph.OPTIONS.NONE.value}),vh=({layoutService:e})=>{const t=e.getLayoutValue("scrollbar");if(t)return yh(t);const n=e.getLayoutValue("showMiniChartForContinuousAxis");if(void 0===n)return yh(ph.DEFAULT.value);const r=e.getLayoutValue("dimensionAxis.continuousAuto"),i=e.getLayoutValue("preferContinuousAxis");return yh(!n&&(r||!r&&i)?ph.OPTIONS.NONE.value:ph.OPTIONS.MINI_CHART.value)};function bh({layoutService:e,override:t}){const n=vh({layoutService:e});return t&&t.predicate({layoutService:e,scrollbar:n})&&(n.miniChart=t.value===ph.OPTIONS.MINI_CHART.value,n.bar=t.value===ph.OPTIONS.BAR.value,n.none=t.value===ph.OPTIONS.NONE.value),n}function xh({layoutService:e,dockService:t,discrete:n,continuousDataModel:r,viewState:i,viewCache:o,themeService:a,rtl:s,scrollbarOverride:l,visualizeCache:u=!1,deviceType:c}){const d=bh({layoutService:e,override:l});if(d.none)return!1;const{orientation:m}=t.meta.major,f={key:"scrollbar",type:"scrollbar",layout:{dock:"horizontal"===m?t.meta.minor.start:t.meta.minor.end,minimumLayoutMode:"XSMALL"},show:()=>e.meta.isContinuous?r.getDimensionCardinality()>1:n.query.getCanScroll(),settings:{orientation:m,rtl:s,isContinuous:e.meta.isContinuous,range:()=>gh({layoutService:e,viewState:i,viewCache:o})}};d.bar&&(f.settings.style="slim",f.settings.size={area:"touch"===c?{max:16,min:16}:{max:8,min:8}},e.meta.isContinuous||(f.settings.size.thumb={min:4}));const p=a.getStyles();return p.color&&(f.style={standard:{thumb:{"border-color":p.color,opacity:.4},before:{background:p.color,opacity:.1},after:{background:p.color,opacity:.1}}}),e.meta.isDiscrete&&u&&(f.settings.injections=()=>[hh({layoutService:e,discrete:n})]),f}function qh({componentKey:e,chart:t,viewState:n,viewCache:r,layoutService:i,dockService:o,rtl:a}){return s=>{const{x:l,y:u}=s.center,c=t.element.getBoundingClientRect(),d=t.component(e),m="horizontal"===o.meta.major.orientation,f=m?l-c.left-d.rect.computedInner.x:u-c.top-d.rect.computedInner.y,p=m?d.rect.computedInner.width:d.rect.computedInner.height,h=m&&a?p-f:f,g=Math.max(0,Math.min(h/p,1)),[y,v]=gh({layoutService:i,viewState:n,viewCache:r}),b=g<y,x=g>v,q=!b&&!x;return{pixel:h,relative:g,thumb:q?h-y*p:0,beforeThumb:b,afterThumb:x,onThumb:q}}}function Mh({componentKey:e,chart:t,viewState:n,viewCache:r,layoutService:i,dockService:o}){return()=>{const a=t.component(e),{orientation:s}=o.meta.major,{width:l,height:u}=a.rect.computedInner,c="horizontal"===s?l:u,[d,m]=gh({layoutService:i,viewState:n,viewCache:r});return{size:c,thumbSize:(m-d)*c}}}function Sh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){const u=qh({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),c=Mh({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a});return{type:"Tap",options:{event:"scrollbarTap",enable:(r,i)=>!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e))},events:{scrollbarTap(n){n.preventDefault();const a=u(n);if(o.meta.isContinuous){const e=r.get("zoom"),t=e.max-e.min,n=i.get("continuousMin"),o=i.get("continuousMax"),s=n+(o-n)*a.relative;r.set("zoom",{min:Math.min(s-t/2,o-t),max:Math.max(s+t/2,n+t)})}else{const e=c(),t=a.pixel-e.thumbSize/2,n=Math.max(0,t/e.size);s.command.scrollTo(n)}t.component(e).emit("render")}}}}const Dh="data-scrollbar-handle";function Ch({e:e}){return(e.srcEvent||e).srcElement.getAttribute(Dh)||""}const wh="scrollbarResize",Lh=e=>{const[t]=e.changedPointers;return t&&("pointerdown"===t.type||"mousedown"===t.type)};function Eh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:s}){const l=qh({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:s});return{type:"Pan",key:`event:${wh}`,options:{event:wh,threshold:0,enable(e,t){return!(!o.meta.isContinuous||!n.scroll.enabled())&&(!t||(this[wh]=this[wh]||{},Lh(t)&&Ch({e:t})&&(this[wh].panningEvent=t.srcEvent),!!this[wh].panningEvent))}},events:{[`${wh}start`](n){n.preventDefault(),this[wh]=this[wh]||{},this[wh].panningEvent&&t.component(e).emit("dragStart",this[wh].panningEvent)},[`${wh}move`](n){if(n.preventDefault(),this[wh]=this[wh]||{},!this[wh].panningEvent)return;const o=r.get("zoom"),a=i.get("continuousMin"),s=i.get("continuousMax"),u=i.get("minimiumZoomSpan"),c=(s-a)*l(n).relative+a,d=Ch({e:this[wh].panningEvent});let m="start"===d?Math.min(c,o.max):o.min,f="end"===d?Math.max(c,o.min):o.max;m===f&&(m-="start"===d?u:0,f+="end"===d?u:0),r.set("zoom",{min:m,max:f}),t.component(e).emit("render")},[`${wh}end`](n){n.preventDefault(),this[wh]=this[wh]||{},delete this[wh].panningEvent,t.component(e).emit("dragEnd")},[`${wh}cancel`](n){n.preventDefault(),this[wh]=this[wh]||{},delete this[wh].panningEvent,t.component(e).emit("dragEnd")}}}}const Th="scrollbarPan";function Ah({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){const u=qh({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),c=Mh({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a});return{type:"Pan",key:`event:${Th}`,options:{event:Th,threshold:0,enable(r,i){return this[Th]=this[Th]||{},!(i&&!this[Th].isPanning)||!!n.scroll.enabled()&&((!i||i.target===t.element)&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some((t=>t.key===e)))}},events:{[`${Th}start`](n){n.preventDefault();const a=u(n);if(this[Th]=this[Th]||{},this[Th].isPanning=!0,t.component(e).emit("lockState"),o.meta.isContinuous){const e=r.get("zoom"),t=e.max-e.min,n=i.get("continuousMin"),o=i.get("continuousMax"),s=n+(o-n)*a.relative;s<e.min?r.set("zoom",{min:Math.min(s,o-t),max:Math.max(s+t,n+t)}):s>e.max&&r.set("zoom",{min:Math.min(s-t,o-t),max:Math.max(s,n+t)}),this[Th].relative=a.relative,this[Th].zoom=r.get("zoom"),this[Th].zoom.span=this[Th].zoom.max-this[Th].zoom.min,this[Th].zoom.fullSpan=o-n}else if(a.onThumb)this[Th].offset=a.thumb;else{const e=c();this[Th].offset=a.beforeThumb?0:e.thumbSize}},[`${Th}move`](n){n.preventDefault();const a=u(n);if(this[Th]=this[Th]||{},o.meta.isContinuous){const e=a.relative-this[Th].relative,{fullSpan:t,span:n,min:o,max:s}=this[Th].zoom,l=i.get("continuousMin"),u=i.get("continuousMax");r.set("zoom",{min:Math.min(o+e*t,u-n),max:Math.max(s+e*t,l+n)})}else{const e=a.pixel-(this[Th].offset||0),t=c(),n=Math.max(0,e/t.size);s.command.scrollTo(n)}t.component(e).emit("render")},[`${Th}end`](n){n.preventDefault(),this[Th]=this[Th]||{},this[Th].isPanning=!1,t.component(e).emit("unlockState")},[`${Th}cancel`](n){n.preventDefault(),this[Th]=this[Th]||{},this[Th].isPanning=!1,t.component(e).emit("unlockState")}}}}function Nh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){return[Sh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}),Eh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),Ah({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l})]}function kh({componentKey:e,chart:t,actions:n,layoutService:r}){const i=(i,o)=>{if(!r.meta.isContinuous)return;const a=t.component(e);a&&a.emit&&n.scroll.enabled()&&a.emit(i,o)};return{type:"native",events:{mousemove:e=>i("hover",e),mouseleave:()=>i("leave")}}}function Oh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){return{gestures:[...Nh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l})],native:kh({componentKey:e,chart:t,actions:n,layoutService:o})}}const Ih={background:"rgba(0, 0, 0, 0.1)"},Ph={top:-1,bottom:-1,width:6},Rh={width:2,background:"#595959"};var Fh={before:Ih,after:Ih,thumb:{background:"transparent",border:"1px solid rgba(68, 68, 68, 0.4)"},startHandle:Ph,endHandle:Ph,startHandleBorder:Rh,endHandleBorder:Rh};const Hh={background:"rgba(0, 0, 0, 0.1)"},zh={top:-1,bottom:-1,width:6},jh={width:2,background:"#595959"};var Bh={before:Hh,after:Hh,thumb:{background:"#B0AFAE",border:"transparent"},startHandle:zh,endHandle:zh,startHandleBorder:jh,endHandleBorder:jh};const Vh={position:"absolute",top:0,right:0,bottom:0,left:0,boxSizing:"border-box"},_h={pointerEvents:"initial"},Uh={pointerEvents:"none"};const $h="ew-resize",Wh="default";function Kh(){const{rect:e}=this,{settings:t}=this.settings,n="horizontal"===t.orientation,r=n?e.computedInner.width:e.computedInner.height,i=t.range(),o=n&&t.rtl;return{size:r,start:(o?1-i[1]:i[0])*r,end:(o?1-i[0]:i[1])*r}}function Gh(){const e=this.state.hover.start||this.state.hover.end||this.state.drag.start||this.state.drag.end;this.renderer.element().ownerDocument.body.style.cursor=e?$h:Wh}function Yh(e,t,n){const{min:r}=this.settings.settings.size.thumb;if(n-t<r){const i=(r-(n-t))/2,o=Math.max(0,0-(t-i))-Math.max(0,n+i-e);return{size:e,start:t-i+o,end:n+i+o}}return{size:e,start:t,end:n}}function Xh(e){const t=(e.srcEvent||e).srcElement;return this.renderer.element().contains(t)}function Jh(){const{size:e,start:t,end:n}=Kh.call(this);this.renderer.render(this.elements(this.h,Yh.call(this,e,t,n)))}function Zh(){const{state:e,settings:t,style:n}=this,r=t.settings.style;return e.style[r]||(e.style[r]=function({id:e,style:t}){const n="slim"===e?Bh:Fh;return{container:{...Vh},before:{...Vh,...n.before,...t.before},after:{...Vh,...n.after,...t.after},thumb:{...Vh,...n.thumb,...t.thumb},startHandle:{...Vh,..._h,...n.startHandle},endHandle:{...Vh,..._h,...n.endHandle},startHandleBorder:{...Vh,...Uh,...n.startHandleBorder},endHandleBorder:{...Vh,...Uh,...n.endHandleBorder}}}({id:t.settings.style,style:n[r]})),e.style[r]}var Qh={require:["renderer"],defaultSettings:{settings:{style:"standard",size:{area:{min:30,max:40,ratio:1/8},thumb:{min:4}},orientation:"horizontal",rtl:!1,isContinuous:!1,range:()=>[0,1],injections:()=>[]},style:{standard:{before:{},thumb:{},after:{}},slim:{before:{},thumb:{},after:{}}}},renderer:"dom",on:{render(){Jh.call(this)},lockState(){this.state.locked=!0},unlockState(){this.state.locked=!1},hover(e){if(this.state.locked||this.state.drag.start||this.state.drag.end||!Xh.call(this,e)&&this.state.hover.isPristine())return;this.state.hover.reset();const t=Ch({e:e});t&&(this.state.hover[t]=!0),Gh.call(this),Jh.call(this)},leave(){this.state.locked||(this.state.hover.reset(),Gh.call(this),Jh.call(this))},dragStart(e){if(this.state.locked)return;this.state.drag.reset();const t=Ch({e:e});t&&(this.state.drag[t]=!0),Gh.call(this)},dragEnd(){this.state.locked||(this.state.drag.reset(),Gh.call(this),Jh.call(this))}},preferredSize({outer:e}){const{min:t,max:n,ratio:r}=this.settings.settings.size.area,i="horizontal"===this.settings.settings.orientation?"height":"width";return Math.max(t,Math.min(n,e[i]*r))},created(){this.state={style:{},locked:!1,hover:{start:!1,end:!1,reset(){this.start=!1,this.end=!1},isPristine(){return!this.start&&!this.end}},drag:{start:!1,end:!1,reset(){this.start=!1,this.end=!1}}}},render(e){this.h=e;const{size:t,start:n,end:r}=Kh.call(this);return this.elements(e,Yh.call(this,t,n,r))},properties(){return"horizontal"===this.settings.settings.orientation?{start:"left",end:"right"}:{start:"top",end:"bottom"}},elements(e,{size:t,start:n,end:r}){const{settings:i}=this.settings,o=i.injections().map((t=>t({h:e,rect:this.rect,orientation:i.orientation,minThumbSize:i.size.thumb.min})));return function({h:e,size:t,start:n,end:r,properties:i,startHandleActive:o,endHandleActive:a,style:s,continuous:l,invert:u,injections:c}){const d={[i.end]:t-n},m={[i.start]:r},f={left:-3},p={left:1},h={right:-3,left:"auto"},g={left:3},y=e("div",{style:{...s.before,...u?m:d},class:"scrollbar--before"}),v=e("div",{style:{...s.after,...u?d:m},class:"scrollbar--after"}),b=[];if(l){const t=e("div",{style:{...s.startHandle,...u?h:f},class:"scrollbar--start-handle",[Dh]:"start"},o?e("div",{style:{...s.startHandleBorder,...u?g:p}}):void 0);b.push(t);const n=e("div",{style:{...s.endHandle,...u?f:h},class:"scrollbar--end-handle",[Dh]:"end"},a?e("div",{style:{...s.endHandleBorder,...u?p:g}}):void 0);b.push(n)}const x=e("div",{style:{...s.thumb,[i.start]:n,[i.end]:t-r},class:"scrollbar--thumb"},b);return e("div",{style:{...s.container}},[y,x,v,...c])}({h:e,size:t,start:n,end:r,properties:this.properties(),startHandleActive:this.state.hover.start||this.state.drag.start,endHandleActive:this.state.hover.end||this.state.drag.end,style:Zh.call(this),continuous:i.isContinuous,invert:"horizontal"===i.orientation&&i.rtl,injections:o})}};const eg={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:r,rendHeight:i,flipXY:o,symbol:a}){let s="x",l="y",u=r,c=i,d=t<.5?90:-90;return o&&(s="y",l="x",u=i,c=r,d=t<.5?180:0),a(Y({},e,{[s]:n*u,[l]:c-Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}};function tg({i:e,width:t,height:n,resolved:r,keys:i,flipXY:o,calcKey:a="box"}){let s,l=null,u=null;void 0!==r.major.settings.binStart?(l=r.major.items[e].binStart,u=r.major.items[e].binEnd,s=r.major.settings.binStart.scale):(s=r.major.settings.major.scale,l=s?r.major.items[e].major:0);let c=0;s?s.bandwidth?(c=s.bandwidth(),l-=c/2):c=u-l:c=1;const d=Y({},{major:l,majorEnd:u},r.minor.items[e]);i.forEach((t=>{d[t]=r[t].items[e]}));const m=o?n:t,f=function({bandwidth:e,width:t,minWidthPx:n,maxWidthPx:r,maxMajorWidth:i}){const o=e>=0?1:-1;let a=Math.min(o*e*t,Number.isNaN(Number(r))?i:r/i);return a=Number.isNaN(Number(n))?a:Math.max(n/i,a),a*o}({bandwidth:c,width:d[a].width,minWidthPx:d[a].minWidthPx,maxWidthPx:d[a].maxWidthPx,maxMajorWidth:m}),p=(c-f)/2,h=p+d.major+f/2;return{item:d,boxCenter:h,boxWidth:f,boxPadding:p,rendWidth:t,rendHeight:n}}function ng({keys:e,data:t,defaultSettings:n,style:r,settings:i,width:o,height:a,resolver:s}){const l=Y(!0,{},n||{},r||{}),u={major:"horizontal"===i.orientation?a:o,minor:"horizontal"===i.orientation?o:a},c=i.major;let d;d="object"==typeof c&&"object"==typeof c.ref&&void 0!==c.ref.start&&void 0!==c.ref.end?s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:Y(!0,{},{binStart:{scale:i.major.scale,ref:i.major.ref.start},binEnd:{scale:i.major.scale,ref:i.major.ref.end}})}):"object"==typeof c&&void 0!==c.binStart&&void 0!==c.binEnd?s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:Y(!0,{},{binStart:{scale:i.major.scale,ref:"binStart"},binEnd:{scale:i.major.scale,ref:"binEnd"}},i.major)}):s.resolve({data:t,scaled:u,defaults:{major:.5},settings:{major:i.major}});const m=i.minor||{};let f;const p={major:d,minor:s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:Y(!0,{},{start:{scale:m.scale,ref:"start"},end:{scale:m.scale,ref:"end"},min:{scale:m.scale,ref:"min"},max:{scale:m.scale,ref:"max"},med:{scale:m.scale,ref:"med"}},m)})};for(let n=0,r=e.length;n<r;n++)f=e[n],p[f]=s.resolve({data:t,defaults:l[f],settings:i[f],scaled:u});return p}const rg=["oob"];const ig={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:10},data:{},style:{}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,{dockValue:n}=this.settings.settings,r="horizontal"===this.settings.settings.orientation,{data:i,style:o,resolver:a,symbol:s}=this,l=ng({keys:rg,data:i,defaultSettings:{oob:eg.getDefaultSettings()},style:o,settings:this.settings.settings,width:e,height:t,resolver:a}),{settings:u,items:c}=l,d=function({width:e,height:t,flipXY:n,resolved:r,keys:i,symbol:o,dockValue:a,_calcItemRenderingOpts:s=tg}){const l=[],{items:u}=r.major;for(let c=0,d=u.length;c<d;c++){const{item:d,boxCenter:m,rendWidth:f,rendHeight:p}=s({i:c,width:e,height:t,resolved:r,keys:i,flipXY:n,calcKey:"oob"}),h=u[c].data,g=[];if(d.oob.show){g.push(eg.createOob({oob:d.oob,dockValue:a,boxCenter:m,rendWidth:f,rendHeight:p,flipXY:n,symbol:o}));const e={type:"container",data:h,collider:{type:"bounds"},children:g};l.push(e)}}return l}({items:c,settings:u,width:e,height:t,flipXY:r,resolved:l,keys:rg,symbol:s,dockValue:n});return d}},og={size:25,hat:{show:!0,fill:"#999",stroke:"#000",strokeWidth:0,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1,alignment:0}},ag=["hat"];function sg(e,t=!0){let n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?`M${r.x} ${r.y}`:`L${r.x} ${r.y}`,n+=" "}return t&&(n+="Z"),n}function lg({item:e,boxWidth:t,boxPadding:n,rendWidth:r,rendHeight:i,flipXY:o}){let a="x",s="y",l=r,u=i,c=e.hat.alignment||0;o&&(a="y",s="x",l=i,u=r,c=1-c);const d=(n+e.major)*l;let m=[{[a]:d,[s]:0+u},{[a]:d+t*c*l,[s]:8},{[a]:d+t*l,[s]:0+u},{[a]:d+t*l,[s]:0+u+10},{[a]:d,[s]:0+u+10}];const f=Y({},e.hat,{type:"path",d:sg(m)});m=[{[a]:d,[s]:0},{[a]:d+t*(1-c)*l,[s]:0+u-8},{[a]:d+t*l,[s]:0},{[a]:d+t*l,[s]:-10},{[a]:d,[s]:-10}];return[f,Y({},e.hat,{type:"path",d:sg(m)})]}const ug={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:25},data:{},style:{hat:"$shape"}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,n="horizontal"===this.settings.settings.orientation,{data:r,style:i,resolver:o}=this,a=ng({keys:ag,data:r,defaultSettings:og,style:i,settings:this.settings.settings,width:e,height:t,resolver:o}),{settings:s,items:l}=a,u=function({width:e,height:t,flipXY:n,resolved:r,keys:i,_calcItemRenderingOpts:o=tg}){const a=[],{items:s}=r.major;for(let l=0,u=s.length;l<u;l++){const{item:u,boxWidth:c,boxPadding:d,rendWidth:m,rendHeight:f}=o({i:l,width:e,height:t,resolved:r,keys:i,flipXY:n,calcKey:"hat"}),p=s[l].data,h=[];u.hat.show&&h.push(...lg({item:u,boxWidth:c,boxPadding:d,rendWidth:m,rendHeight:f,flipXY:n}));const g={type:"container",data:p,collider:{type:"bounds"},children:h};a.push(g)}return a}({items:l,settings:s,width:e,height:t,flipXY:n,resolved:a,keys:ag});return u}};function cg(e,t,n,r){const i=function(t){const n=String(t);return e(n)};return i.ticks=()=>t.map((t=>{const o=i([t.data.value,r?n-1:0]),a=i([t.data.value,r?0:n-1])+e.bandwidth();return{position:(o+a)/2,label:t.label,data:t.data,start:o,end:a}})),i.bandwidth=()=>e.bandwidth(),i.data=()=>e.data(),i.domain=()=>e.domain(),i.pxScale=function(r){const i=e.pxScale(r);return i===e?this:cg(i,t,n)},i}function dg(e){const t=e.scale("band");e.scale("group-by-measure",(function(e={},n={},r={}){const i=t(e,n,r),o=i.domain(),a=i.ticks(),s=[],l=e.measureCount;return o.forEach(((e,t)=>{for(let t=0;t<l;++t)s.push(String([e,t]));s.push(`SPACER_${t}_SPACER`)})),s.splice(-1),i.domain(s),cg(i,a,l,e.invert)}))}const mg=()=>({version:"1.34.4",barGrouping:{grouping:"grouped"},color:{auto:!0,autoMinMax:!0,byDimDef:void 0,byMeasureDef:void 0,colorExpression:void 0,dimensionScheme:"12",expressionIsColor:!0,expressionLabel:"",formatting:{numFormatFromTemplate:!0,isCustomFormatted:void 0},measureMin:void 0,measureMax:void 0,measureScheme:"sg",mode:"primary",paletteColor:{index:6},persistent:!1,reverseScheme:!1,singleColor:void 0,useBaseColors:"off",useDimColVal:!0,useMeasureGradient:!0},components:[],dataPoint:{showLabels:!1,showSegmentLabels:!1,showTotalLabels:!0},dimensionAxis:{axisDisplayMode:"auto",continuousAuto:!0,dock:"near",label:"auto",maxVisibleItems:10,show:"all"},footnote:"",gridLine:{auto:!0,spacing:2},legend:{dock:"auto",show:!0,showTitle:!0},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"all",spacing:1},orientation:"vertical",preferContinuousAxis:!0,qHyperCubeDef:{qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:17,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1},refLine:{refLines:[],dimRefLines:[]},scrollbar:"miniChart",scrollStartPos:0,showDetails:!0,showDisclaimer:!0,showMiniChartForContinuousAxis:!0,showTitles:!0,subtitle:"",title:"",tooltip:{auto:!0,hideBasic:!1,data:{qHyperCubeDef:void 0},chart:void 0,imageComponents:void 0}}),fg={CUSTOM:{EXPRESSION:"customTooltipExpression",TITLE:"customTooltipTitle",DESCRIPTION:"customTooltipDescription",QUARANTINE:"customTooltip",IMAGES:"customTooltipImages"},CHART:{CONTAINER_ID:"tooltipContainerId",STATE:"customTooltipSessionState",CHART_OBJECT_ID:"customTooltipSessionObjectId",CHART_PARENT_TYPE:"TooltipChartParent",CHART_CHILD_TYPE:"TooltipChart",STYLE:{small:"140px",medium:"200px",large:"340px"}}};function pg(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const hg={getImageSize(e,t){let n;function r(){n&&(clearTimeout(n),n=null)}function i(e){const t=e;t.onload=null,t.onerror=null,r()}const o={small:50,medium:200,large:340,original:340};return new Promise((a=>{const s=new Image;s.referrerPolicy="no-referrer",s.onload=()=>{let e;const{height:n,width:l}=s,u=o[t]*(n>l?1:n/l),c=o[t]*(l>n?1:l/n);!n||!l||0===n&&0===l?(e={height:20,width:20,imageError:!0},i(s)):"original"===t?(e={height:Math.min(u,n),width:Math.min(c,l)},r()):(e={height:u,width:c},r()),a(e)},s.onerror=()=>{i(s),a({height:20,width:20,imageError:!0})},s.src=e,n=setTimeout((()=>{i(s),a({height:20,width:20,imageError:!0})}),3e3)}))}};async function gg(e,t,n){let r=e.ref.qStaticContentUrl.qUrl;const i=function(e){var t,n,r,i,o;let a,s,l,u,c,d;if(e&&(null!==(t=e.session)&&void 0!==t&&t.options||null!==(n=e.enigmaModel)&&void 0!==n&&null!==(r=n.session)&&void 0!==r&&r.sessionConfig||null!==(i=e.session)&&void 0!==i&&null!==(o=i.config)&&void 0!==o&&o.url)){var m;if(a=e.session.options||(null===(m=e.enigmaModel)||void 0===m?void 0:m.session.sessionConfig),!a){var f;a=null===(f=e.session)||void 0===f?void 0:f.config;const t=new URL(a.url);a.host=t.hostname,a.port=t.port,a.isSecure="wss:"===t.protocol}return d=void 0!==a.secure?a.secure:a.isSecure,s=d?"https://":"http://",l=a.host||"localhost",u=a.port?`:${a.port}`:"",c=a.prefix?a.prefix:"/","/"!==c[c.length-1]&&(c=`${c}/`),s+l+u+c}return""}(n);i&&(!function(e,t){const n=e.replace(t,"").replace(/^\.\.\//i,"/");n[0]}(r,i),r=r.replace(/"/g,'\\"'),r=r.replace(/'/g,"\\'"),r=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(r,i));const{height:o,width:a,imageError:s}=await hg.getImageSize(r,t);return{src:r,size:t,height:o,width:a,imageError:s}}async function yg(e,t,n,r){var i,o,a,s,l,u;const{app:c,flags:d}=t,m=null===(i=e.layout)||void 0===i||null===(o=i.tooltip)||void 0===o?void 0:o.imageComponents;if(!m)return[];const[f]=m,p=f.size||"small",h=f.type||"media";let g=-1;for(let e=0;e<n.length;e++)if(n[e].cId===f.cId){g=e;break}const y=(null===(a=r.data)||void 0===a||null===(s=a.customTooltipAttrExps)||void 0===s?void 0:s.value)||[];let v;if(-1!==g&&y[g]&&(v=y[g]),"media"===h&&null!==(l=f.ref)&&void 0!==l&&null!==(u=l.qStaticContentUrl)&&void 0!==u&&u.qUrl)return gg(f,p,c);if("url"===h)return async function(e,t,n,r,i){let o,a=n.ref;if(i&&i.label&&(a=i.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&null!=e&&e.getImage&&pg(a))try{const t=`data:image/png;base64, ${await e.getImage(a)}`,{height:n,width:i,imageError:s}=await hg.getImageSize(t,r);o={src:t,size:r,height:n,width:i,imageError:s}}catch(e){}else{const{height:e,width:t,imageError:n}=await hg.getImageSize(a,r);o={src:a,size:r,height:e,width:t,imageError:n}}return o}(c,d,f,p,v);if(d.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===h&&v&&v.label){return async function(e,t,n,r){let i;const o=r.label,a=`qmem://${t.qFallbackTitle}/${o}`;if(pg(a))try{const t=await e.getImage(a);if(t){const e=`data:image/png;base64, ${t}`,{height:r,width:o,imageError:a}=await hg.getImageSize(e,n);i={src:e,size:n,height:r,width:o,imageError:a}}}catch(e){}return i}(c,n[g],p,v)}return[]}const vg={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){const i=t,o=[];for(let t=0;t<i.length;t++)o.push(yg(e,r,n,i[t]));const a=await Promise.all(o);for(let e=0;e<i.length;e++)i[e].data.customTooltipImages=[a[e]];return i},checkIfPromisesExist({customTooltipModel:e}){var t,n;const r=null===(t=e.layout)||void 0===t||null===(n=t.tooltip)||void 0===n?void 0:n.imageComponents;return!!r&&r.length>0}},bg={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){let i=t;return i=await vg.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}),i},checkIfPromisesExist:({customTooltipModel:e})=>vg.checkIfPromisesExist({customTooltipModel:e})};const xg=(e,t)=>{var n,r,i;const o=null==e||null===(n=e.qHyperCubeDef)||void 0===n?void 0:n.qDimensions,a=null==e||null===(r=e.qHyperCubeDef)||void 0===r?void 0:r.qMeasures,s=null==e||null===(i=e.qHyperCubeDef)||void 0===i?void 0:i.qInterColumnSortOrder,l=t;return{qInfo:{qType:fg.CHART.CHART_PARENT_TYPE,qId:fg.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:o,qMeasures:a,qInterColumnSortOrder:s,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:l}},qg=e=>{var t,n,r;const i=null===(t=e.tooltip)||void 0===t||null===(n=t.chart)||void 0===n||null===(r=n.object)||void 0===r?void 0:r.refId;return{qInfo:{qType:fg.CHART.CHART_CHILD_TYPE},qExtendsId:i}};const Mg={createContainer:({ctx:e,layout:t})=>{var n,r;if(!((null===(n=t.qHyperCube)||void 0===n||null===(r=n.qDimensionInfo)||void 0===r?void 0:r.length)<=0))return function(e,t){var n,r,i,o;const a=null!==(n=null===(r=t.tooltip)||void 0===r||null===(i=r.chart)||void 0===i||null===(o=i.style)||void 0===o?void 0:o.size)&&void 0!==n?n:"medium",s=fg.CHART.STYLE[a];return[{content:[e.h("div",{style:{display:"flex",width:s,height:s,backgroundColor:"#FFFFFF",borderRadius:"5px",padding:"2px",color:"#595959"},colspan:2,id:fg.CHART.CONTAINER_ID})],colspan:2,style:{"text-align":e.rtl?"right":"left","max-width":s,width:"100%"}},{}]}(e,t)},show:async({app:e,properties:t,selectedNodes:n,dimIndex:r,customTooltipModel:i,rtl:o})=>{var a,s,l;const u=i,c=null==t||null===(a=t.tooltip)||void 0===a||null===(s=a.chart)||void 0===s||null===(l=s.object)||void 0===l?void 0:l.refId;if(null!=u&&u.embed&&e.removeSessionAlternateState&&e.addSessionAlternateState&&c&&!(t.qHyperCubeDef.qDimensions.length<=0)){await Mg.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:n}){const r=n,i=fg.CHART.STATE,o=t.qStateName;r.miniChartToken.alternateState||(r.miniChartToken.alternateState=i,await e.addSessionAlternateState(i,o),r.miniChartToken.alternateState=i)}({app:e,properties:t,customTooltipModel:i});const a=await async function({app:e,properties:t,customTooltipModel:n}){var r;const i=n;null!==(r=i.miniChartToken.sessionObj)&&void 0!==r&&r.id&&await e.destroySessionObject(i.miniChartToken.sessionObj.id);const o=fg.CHART.STATE,a=xg(t,o),s=await e.createSessionObject(a),l=qg(t);if(s.id!==fg.CHART.CHART_OBJECT_ID)return void e.destroySessionObject(s.id);i.miniChartToken.sessionObj=s;const u=await s.createChild(l);if(i.miniChartToken.sessionObj&&i.miniChartToken.sessionObj.id===s.id)return i.miniChartToken.model=u,u;e.destroySessionObject(s.id)}({app:e,properties:t,customTooltipModel:i});if(u.miniChartToken.alternateState&&u.miniChartToken.sessionObj&&a){var d,m,f,p;const e=n.length>0&&void 0!==(null===(d=n[0].data)||void 0===d?void 0:d.value)?[null===(m=n[0].data)||void 0===m?void 0:m.value]:[],a=void 0!==r?r:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===r&&n.length>0){var h,g;const e=null!==(h=n[0].data.selectionOuterDimension)&&void 0!==h?h:n[0].data.selectionDimension;if(null!=e&&null!==(g=e.source)&&void 0!==g&&g.field){var y;const t=null==e||null===(y=e.source)||void 0===y?void 0:y.field.split("/"),n=t[t.length-1],r=void 0!==e.value?[e.value]:[];r.length>0&&void 0!==n&&u.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(n),r,!1)}}e.length>0&&u.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",a,e,!1);const s=document.getElementById(fg.CHART.CONTAINER_ID),l={direction:o?"rtl":"ltr",isReadonly:!0,isPopover:!0,navigation:!1,selections:!1};u.miniChartToken.vis=await i.embed.render({element:s,model:u.miniChartToken.model,options:l,id:null===(f=u.miniChartToken.model)||void 0===f?void 0:f.id,type:null===(p=u.miniChartToken.model)||void 0===p?void 0:p.genericType})}}catch(t){await Mg.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;null!=n&&n.embed&&(Mg.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(fg.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,r=fg.CHART.STATE;n.miniChartToken.alternateState=void 0,await e.removeSessionAlternateState(r)}({app:e,customTooltipModel:t}))},destroyVisualization:({customTooltipModel:e})=>{var t,n;const r=e;"function"==typeof(null===(t=r.miniChartToken)||void 0===t||null===(n=t.vis)||void 0===n?void 0:n.destroy)&&(r.miniChartToken.vis.destroy(),r.miniChartToken.vis=void 0)}};function Sg(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function Dg(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:r}=fg.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[n]=!0,i[r]=!0,i}function Cg(e){const t=Dg();return e.filter((e=>t[e.id]))}const wg={getNodes(e,t){const n=function(e,t){let n=0,r=0;e.center?(n+=e.center.x,r+=e.center.y):(n+=e.clientX,r+=e.clientY);const i=t.element.getBoundingClientRect();return{cx:n-i.left,cy:r-i.top}}(e,t);return t.shapesAt({x:n.cx,y:n.cy})},getDataNodes(e,t){let n,r=[];const i={container:{bar:!0,"bullet-axis":!0},circle:{"point-component":!0}};return t.forEach((t=>{var o,a,s,l;const u=null!==(o=null===(a=t.data)||void 0===a?void 0:a.selectionDimension)&&void 0!==o?o:t.data;if(!u||null!==(s=t.data)&&void 0!==s&&s.customTooltipAttrExps||i[t.type]){if(null!==(l=t.data)&&void 0!==l&&l.customTooltipAttrExps&&!t.data.customTooltipImages){const e=t;e.data.customTooltipImages=[],r.push(e)}}else{n||(n=[],Object.keys(i).forEach((t=>{n=n.concat(e.findShapes(t).filter((e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&i[t][e.key])))})));const t=n.filter((e=>{var t,n;const r=null!==(t=null!==(n=e.data.stack)&&void 0!==n?n:e.data.selectionOuterDimension)&&void 0!==t?t:e.data.selectionDimension;return r&&r.value===u.value&&r.label===u.label}));t.length>0&&(r=r.concat(t[0]))}})),r},displayTooltip(e,t,{nodes:n,opts:r={},customTooltipModel:i,extractedNodes:o=[],hide:a}){if(i&&!a){const{layout:a,chart:s}=i,{attrExps:l}=wg.getAttrExprData(a);o.length||n.length?bg.handlePromises({customTooltipModel:i,nodes:wg.getDataNodes(s,o.length>0?o:n),attrExps:l,opts:r}).then((()=>{t.emit("show",e,n.length?{nodes:n}:void 0)})):t.emit("show",e,n.length?{nodes:n}:void 0)}else{var s;null!=i&&null!==(s=i.miniChartToken)&&void 0!==s&&s.alternateState&&Mg.hide({app:r.app,customTooltipModel:i}),t.emit("hide")}},checkIfPromisesExist:({customTooltipModel:e})=>bg.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){var n;const r=t,i=null!==(n=e.qHyperCubeDef)&&void 0!==n&&n.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return r[i]||(r[i]=[]),r[i]},getAttrExprData(e){var t;let n=[],r="";const i=(null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[];if(i.length>0){var o,a,s;const t=i.length-1;n=(null===(o=e.qHyperCube)||void 0===o||null===(a=o.qDimensionInfo)||void 0===a||null===(s=a[t])||void 0===s?void 0:s.qAttrExprInfo)||[],r=`qDimensionInfo/${t}/qAttrExprInfo`}return{attrExps:n,fieldPath:r}},quarantineCustomTooltipAttrs(e,t={}){var n,r;if(!(null===(n=e.qLayoutExclude)||void 0===n||null===(r=n.quarantine)||void 0===r?void 0:r[fg.CUSTOM.QUARANTINE])){!function(e,t){const n=t;let r=n.qLayoutExclude;r||(n.qLayoutExclude={quarantine:{}},r=n.qLayoutExclude),r.quarantine||(r.quarantine={}),r.quarantine[fg.CUSTOM.QUARANTINE]=[],e.forEach((e=>{r.quarantine[fg.CUSTOM.QUARANTINE].push(e)})),n.qLayoutExclude=r}(Cg(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){var t,n;const r=e;(null===(t=e.qLayoutExclude)||void 0===t||null===(n=t.quarantine)||void 0===n?void 0:n[fg.CUSTOM.QUARANTINE])&&delete r.qLayoutExclude.quarantine[fg.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=Sg(e);if(!n)return;const r=void 0!==t?t:n.length-1;if(!n[r])return;const i=this.getAttrExps(e,n[r]);if(0===Cg(i).length){var o,a;const t=(null===(o=e.qLayoutExclude)||void 0===o||null===(a=o.quarantine)||void 0===a?void 0:a.customTooltip)||[],n=[...i,...t],s=e;s.qHyperCubeDef?s.qHyperCubeDef.qDimensions[r].qAttributeExpressions=n:s.qHyperCube.qDimensionInfo[r].qAttrExprInfo=n}},moveCustomTooltipAttrs(e,t={},n){let r=[];const i=Sg(e)||[];[...i,t].forEach((e=>{const t=Cg(e.qAttributeExpressions||[]);t.length>0&&(r=t)}));const o=Dg(),a=i.map((e=>{const t=e,n=e.qAttributeExpressions||[];return t.qAttributeExpressions=n.filter((e=>!o[e.id])),t})),s=void 0!==n?n:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(r));const l=e;e.qHyperCubeDef?l.qHyperCubeDef.qDimensions=a:l.qHyperCube.qDimensionInfo=a},addCallbackCustomTooltip(e){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e):(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},moveCallbackCustomTooltip(e,t){1===e.qHyperCubeDef.qDimensions.length&&(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e)),e.qHyperCubeDef.qDimensions.length>1&&this.moveCustomTooltipAttrs(e,t)},removeCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>0?this.moveCustomTooltipAttrs(e,t):this.quarantineCustomTooltipAttrs(e,t)},replaceCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e,t):(this.quarantineCustomTooltipAttrs(e,t),this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},shouldIgnoreDefaultRows(e){var t;return(null===(t=e.tooltip)||void 0===t?void 0:t.hideBasic)||0},DEBOUNCE_THRESHOLD:50,getFooterRow:(e,t)=>[{content:e,style:{"font-style":"italic","font-size":"12px","line-height":"16px",color:"rgba(255, 255, 255, 0.6)","text-align":t?"right":"left",direction:Se.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=Se.detectTextDirection(e.src),r=[],i={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){r.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const n=e.imageError?`${e.src}?${Math.random()}`:e.src;r.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:n,referrerpolicy:"no-referrer"})),i.style["text-align"]="center",i.style["white-space"]="nowrap"}else i.style["background-size"]="contain",i.style["background-repeat"]="no-repeat",i.style["background-position"]="center",i.style["background-image"]=`url('${e.src}')`;return[{content:[t.h("div",i,r),""],style:{"text-align":t.rtl?"right":"left",direction:n,"max-width":e.width},colspan:2},{}]}};function Lg(e,t,n,r){var i,o,a;const s=(null===(i=t.qHyperCube)||void 0===i||null===(o=i[n])||void 0===o||null===(a=o[r])||void 0===a?void 0:a.qAttrExprInfo)||[],l=[],u=e.qSubNodes&&e.qSubNodes[r]?e.qSubNodes[r].qAttrExps:e.qAttrExps;return u?(s.forEach(((e,t)=>{const i=u.qValues&&u.qValues[t]?u.qValues[t]:void 0,o=void 0===i?"NaN":function(e,t){let n;switch(e.id){case fg.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case fg.CUSTOM.TITLE:case fg.CUSTOM.DESCRIPTION:case fg.CUSTOM.IMAGES:n=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:n="NaN"}return n}(e,i);l.push({source:{key:"qHyperCube",field:`${n}/${r}/qAttrExprInfo/${t}`},label:o,value:"value"})})),l):l}const Eg={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,r="qDimensionInfo";return{field:`${r}/${n}`,value:t=>Lg(t,e,r,n)}}};const Tg={getCustomAttrExps(e,t,n){var r,i;const o={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},a=(null===(r=t.data)||void 0===r||null===(i=r.customTooltipAttrExps)||void 0===i?void 0:i.value)||[];if(Number.isNaN(a))return o;return function(e,t,n,r){const i={[fg.CUSTOM.TITLE]:!0,[fg.CUSTOM.DESCRIPTION]:!0},{attrExps:o,fieldPath:a}=wg.getAttrExprData(e);return 0===t.length||0===o.length||""===a||o.forEach(((e,o)=>{const s=t[o];if(e.id===fg.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,i="NaN"===s.value||e.isCustomFormatted?s.value:n("qHyperCube").field(`${a}/${o}`).formatter()(s.value);r.customTooltipAttrExpsArr.push({label:t,value:i})}else if(i[e.id]&&s){const t="-"!==s.value&&"NaN"!==s.value?s.value:s.label;t&&"undefined"!==t&&r.customTooltipInfoAttrExpsArr.push({...e.id===fg.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}})),r}(n,a.map((t=>De.getMeasure(e,t))),e,o)}};function Ag({nodes:e,layout:t,dataset:n}){const r=function(e,t,n){const r=[];return e.forEach((e=>{r.push(Tg.getCustomAttrExps(n,e,t))})),r}(e,t,n);return r.reduce(((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)})),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}function Ng(e){const t=fg.CUSTOM.EXPRESSION,{qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}=e.qDef;return e.qLibraryId?{qLibraryId:e.qLibraryId,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}:{qExpression:e.qDef.qDef,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}}function kg(e){var t;const n=null===(t=e.qHyperCubeDef)||void 0===t?void 0:t.qDimensions;return n[n.length-1].qAttributeExpressions||[]}const Og={migrateProperties(e){var t,n,r,i;const o=Y(!0,{},e),a=(null===(t=o.tooltip)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.qHyperCubeDef)||void 0===r?void 0:r.qMeasures)||[];let s=kg(o);return s=function(e,t){return t.concat(e.map((e=>Ng(e))))}(a,s),function(e,t){var n;const r=null===(n=t.qHyperCubeDef)||void 0===n?void 0:n.qDimensions;r[r.length-1].qAttributeExpressions=e}(s,o),null===(i=o.tooltip)||void 0===i||delete i.data,o},getPatches(e){var t,n,r,i;const o=(null===(t=e.tooltip)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.qHyperCubeDef)||void 0===r?void 0:r.qMeasures)||[],a=(null===(i=e.qHyperCubeDef)||void 0===i?void 0:i.qDimensions.length)-1,s=function(e,t,n){let r=e.length;const i=[];return t.forEach((e=>{const t=Ng(e),o=JSON.stringify(t);i.push({qPath:`/qHyperCubeDef/qDimensions/${n}/qAttributeExpressions/${r}`,qOp:"add",qValue:o}),r++})),i.push({qPath:"/tooltip/data",qOp:"remove"}),i}(kg(e),o,a);return s},checkForBackwardCompatibility:(e,t)=>(e.qMeasureInfo||[]).length>0&&t.length>0,updateProperties(e,t){const n=new Promise((n=>{var r,i,o,a,s;const l=(null===(r=t.qHyperCube)||void 0===r?void 0:r.qDimensionInfo)||[],u=(null===(i=t.tooltip)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.qHyperCube)||{},c=null===(a=t.qMeta)||void 0===a||null===(s=a.privileges)||void 0===s?void 0:s.includes("update");e&&e.getEffectiveProperties&&this.checkForBackwardCompatibility(u,l)&&e.getEffectiveProperties().then((t=>{if(c){const r=this.migrateProperties(t);e.setProperties(r).then((()=>{e.app.clearUndoBuffer(),n(!0)}))}else{const r=this.getPatches(t);e.applyPatches(r,!0).then((()=>{e.app.clearUndoBuffer(),n(!0)}))}})),n(!1)}));return n}};var Ig={attrExpr:Og},Pg=7005;const Rg=e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==Pg},Fg=e=>{if(e.qHyperCubeDef.qDimensions.length>1&&1===e.qHyperCubeDef.qMeasures.length){const t=e.qHyperCubeDef.qInterColumnSortOrder.indexOf(0);0!==t&&se.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,t,0)}},Hg=(e,t)=>{t>10?1!==e.qHyperCubeDef.qInterColumnSortOrder[0]&&se.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,1,0):0!==e.qHyperCubeDef.qInterColumnSortOrder[0]&&se.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,1,0)},zg=e=>{if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures;1===t.length&&1===n.length&&(n[0].qSortBy.qSortByNumeric=-1,e.qHyperCubeDef.qInterColumnSortOrder.splice(0,e.qHyperCubeDef.qInterColumnSortOrder.length,1,0))},jg=(e,t)=>{const n=e.qHyperCubeDef.qDimensions,r=e.qHyperCubeDef.qMeasures;if(1===n.length&&1===r.length){const r=n[0];return r.qLibraryId?t.getDimension(r.qLibraryId).then((e=>e.getLayout())).then((t=>{if(t&&t.qDimInfos&&t.qDimInfos[0]){const n=t.qDimInfos[0].qCardinal;Hg(e,n)}return r})):t.getField(r.qDef.qFieldDefs[0]).then((t=>t.getCardinal().then((t=>(Hg(e,t),r)))),(()=>r))}return Fg(e),Promise.resolve()};function Bg(e){const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures,{color:{mode:r}}=e;t.length>1&&e.color?ru(e,"color.persistent",!0):"byDimension"===r&&n.length>1?ru(e,"color.mode","byMultiple"):"byExpression"===r&&0===n.length?ru(e,"color.mode","primary"):0===t.length&&n.length>0&&(ru(e,"color.byMeasureDef",void 0),ru(e,"color.byDimDef",void 0),1===n.length&&ru(e,"color.mode","primary"))}const Vg=(e,t)=>{Bg(t),Dt(e),wg.addCallbackCustomTooltip(t)},_g=e=>{Bg(e)};function Ug({translator:e}){return{dimensions:{min:0,max:e=>e>1?1:2,description(t,n,r,i){let o;const a=null!=i&&i.layout?i.layout.qHyperCube.qDimensionInfo.filter((e=>Rg(e))).length:t.qHyperCubeDef.qDimensions.length;return r.isAutoChart&&n>a-1?o="Visualizations.Descriptions.Color":a>1&&0===n?"stacked"===t.barGrouping.grouping?o="Visualizations.Descriptions.Stack":(o="Visualizations.Descriptions.Group",t.qHyperCubeDef.qColumnOrder=[0,1,2]):o="Visualizations.Descriptions.Bars",e.get(o)},add:(e,t,n)=>(t.qHyperCubeDef.qDimensions.length>1&&"stacked"===t.barGrouping.grouping&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),null!=n&&n.app?jg(t,n.app).then((()=>(Vg(e,t),e))):(zg(t),Vg(e,t),e)),move(e,t,n){const r=n.layout.qHyperCube.qDimensionInfo.filter((e=>Rg(e))).length;r>1&&"stacked"===t.barGrouping.grouping&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),Fg(t),Bg(t),wg.moveCallbackCustomTooltip(t,e)},remove(e,t){const n=t.qHyperCubeDef.qDimensions;Bg(t),1===n.length&&(t.qHyperCubeDef.qMode="S"),wg.removeCallbackCustomTooltip(t,e)},replace(e,t,n,r){wg.replaceCallbackCustomTooltip(r,t)}},measures:{min:1,max:e=>e>1?1:15,description:()=>e.get("Visualizations.Descriptions.LengthBars"),add:(e,t,n)=>null!=n&&n.app?jg(t,n.app).then((()=>(e.qSortBy.qSortByNumeric=-1,_g(t),e))):(zg(t),_g(t),e),move(e,t){Fg(t),Bg(t)},remove(e,t){const n=t.qHyperCubeDef.qDimensions;Bg(t),n.length>1&&"stacked"===t.barGrouping.grouping?(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0):1===n.length&&(t.qHyperCubeDef.qMode="S")}}}}function $g(e){return{properties:mg(),data:{targets:[{path:"/qHyperCubeDef",...Ug(e)}]}}}var Wg={properties_dataPoints_labelmode_share:{id:"properties.dataPoints.labelmode.share",locale:{"en-US":"Share","zh-TW":"佔有率","zh-CN":"份额","tr-TR":"Pay","sv-SE":"Andel","it-IT":"Percentuale","es-ES":"Cuota","de-DE":"Anteil","pl-PL":"Udział","nl-NL":"Aandeel","ko-KR":"공유","pt-BR":"Percentual","fr-FR":"Part","ja-JP":"割合","ru-RU":"Доля"}},Tooltip_selections_locked:{id:"Tooltip.selections.locked",locale:{"en-US":"Selections on this dimension are locked","zh-TW":"已鎖定此維度上的選項","zh-CN":"相关维度的选择已锁定","tr-TR":"Bu boyuttaki seçimler kilitli","sv-SE":"Urval i den här dimensionen är låsta","it-IT":"Le selezioni in questa dimensione sono bloccate","es-ES":"Las selecciones de esta dimensión están bloqueadas.","de-DE":"Auswahlen sind für diese Dimension gesperrt","pl-PL":"Selekcje dotyczące tego wymiaru są zablokowane","nl-NL":"Selecties voor deze dimensie zijn vergrendeld","ko-KR":"이 차원의 선택은 잠겨 있습니다.","pt-BR":"Seleções estão bloqueadas nesta dimensão","fr-FR":"Sélections verrouillées pour cette dimension","ja-JP":"この軸での選択はロックされています","ru-RU":"Выборки для данного измерения заблокированы"}},Tooltip_dimensions_drilldown:{id:"Tooltip.dimensions.drilldown",locale:{"en-US":"Drill-down dimension","zh-TW":"向下探查維度","zh-CN":"下钻维度","tr-TR":"Detaya inme boyutu","sv-SE":"Hierarkisk dimension","it-IT":"Dimensione di drill-down","es-ES":"Dimensión jerárquica","de-DE":"Drilldown-Dimension:","pl-PL":"Wymiar hierarchiczny","nl-NL":"Drill-downdimensie","ko-KR":"드릴다운 차원","pt-BR":"Dimensão da hierarquia","fr-FR":"Descendre dans la hiérarchie de la dimension","ja-JP":"軸のドリルダウン","ru-RU":"Измерение с детализацией"}},Object_ErrorMessage_MissingDimension:{id:"Object.ErrorMessage.MissingDimension",locale:{"en-US":"Dimension not found","zh-TW":"找不到維度","zh-CN":"未找到维度","tr-TR":"Boyut bulunamadı","sv-SE":"Dimensionen hittades inte","it-IT":"Dimensione non trovata","es-ES":"No se ha encontrado la dimensión","de-DE":"Dimension nicht gefunden","pl-PL":"Wymiar nie został znaleziony","nl-NL":"Dimensie niet gevonden","ko-KR":"차원을 찾지 못했습니다.","pt-BR":"Dimensão não encontrada","fr-FR":"Dimension introuvable","ja-JP":"軸が見つかりません","ru-RU":"Измерение не найдено"}},Object_ErrorMessage_MissingMeasure:{id:"Object.ErrorMessage.MissingMeasure",locale:{"en-US":"Measure not found","zh-TW":"找不到量值","zh-CN":"未找到度量","tr-TR":"Hesaplama bulunamadı","sv-SE":"Måttet hittades inte","it-IT":"Misura non trovata","es-ES":"No se ha encontrado la medida","de-DE":"Kennzahl nicht gefunden","pl-PL":"Miara nie została znaleziona","nl-NL":"Meting niet gevonden","ko-KR":"측정값을 찾지 못했습니다.","pt-BR":"Medida não encontrada","fr-FR":"Mesure introuvable","ja-JP":"メジャーが見つかりません","ru-RU":"Мера не найдена"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"en-US":"Currently showing a limited data set.","zh-TW":"目前顯示的是有限的資料集。","zh-CN":"当前正显示有限的数据集。","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","sv-SE":"Just nu visas en begränsad uppsättning data.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","pt-BR":"Mostrando um conjunto de dados limitado.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","ja-JP":"現在、限定的なデータ セットを表示しています。","ru-RU":"В настоящее время отображается ограниченный набор данных."}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"en-US":"The chart is not displayed because it contains only negative or zero values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。","zh-CN":"未显示图表,因为它仅包含负值或零值。","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa eller nollvärden","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","es-ES":"El gráfico no se muestra porque sólo contiene valores negativos o valores cero.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości ujemne lub zerowe.","nl-NL":"De grafiek wordt niet weergegeven omdat het alleen negatieve waarden of nulwaarden bevat.","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения."}},Object_Disclaimer_NegativeOrZeroValues:{id:"Object.Disclaimer.NegativeOrZeroValues",locale:{"en-US":"The data set contains negative or zero values that cannot be shown in this chart.","zh-TW":"資料集包含無法在此圖表中顯示的負值或零值。","zh-CN":"数据集中包含无法在此图表中显示的负值或零值。","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif veya sıfır değerlerini içeriyor.","sv-SE":"Datauppsättningen innehåller negativa värden eller nollvärden som inte kan visas i detta diagram.","it-IT":"La serie di dati contiene valori negativi o uguali a zero che non possono essere visualizzati in questo grafico.","es-ES":"El conjunto de datos contiene valores negativos o cero que no se pueden mostrar en este gráfico.","de-DE":"Die in den Datensätzen enthaltenen negativen oder 0-Werte können nicht in diesem Diagramm dargestellt werden.","pl-PL":"Zestaw danych zawiera wartości ujemne lub zerowe, których nie można przedstawić w tym wykresie.","nl-NL":"De gegevensverzameling bevat negatieve waarden of nulwaarden die niet kunnen worden weergegeven in deze grafiek.","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값 또는 zero 값이 포함되어 있습니다.","pt-BR":"O conjunto de dados contém valores negativos ou iguais a zero que não podem ser mostrados neste gráfico.","fr-FR":"L'ensemble de données contient des valeurs négatives ou égales à zéro impossibles à afficher dans ce graphique.","ja-JP":"データ セットには、本チャートに表示できない負の値またはゼロ値が含まれています。","ru-RU":"Набор данных содержит отрицательные или нулевые значения, которые невозможно показать в этой диаграмме."}},Object_Disclaimer_DataRangeIncludingZero:{id:"Object.Disclaimer.DataRangeIncludingZero",locale:{"en-US":"The logarithmic scale has been replaced by a linear scale because the data range includes zero.","zh-TW":"對數刻度已遭線性刻度取代,因為資料範圍包含零。","zh-CN":"对数刻度已替换为线性刻度,因为该数据范围包括零。","tr-TR":"Veri aralığı sıfır değerini içerdiğinden, logaritmik ölçek yerine doğrusal ölçek kullanıldı.","sv-SE":"Den logaritmiska skalan har ersatts av en linjär skala eftersom dataintervallet innehåller värdet noll.","it-IT":"La scala logaritmica è stata sostituita da una scala lineare perché l'intervallo di dati include zero.","es-ES":"La escala logarítmica ha sido reemplazada por una escala lineal porque el rango de datos incluye cero.","de-DE":"Die logarithmische Skala wurde durch die lineare Skala ersetzt, weil der Datenbereich NULL enthält.","pl-PL":"Skala logarytmiczna została zastąpiona liniową, ponieważ zakres danych zawiera zero.","nl-NL":"De logaritmische schaal is vervangen door een lineaire schaal omdat het gegevensbereik nullen bevat.","ko-KR":"데이터 범위에 0이 포함되어 있으므로 로그 눈금이 선형 눈금으로 바뀌었습니다.","pt-BR":"A escala logarítmica foi substituída por uma escala linear, pois o intervalo de dados inclui zero.","fr-FR":"L'échelle logarithmique a été remplacée par une échelle linéaire, car la plage de données comprend la valeur zéro.","ja-JP":"データ範囲にゼロが含まれるため、Log スケールは Linear スケールで置換されています。","ru-RU":"Логарифмический масштаб заменен линейным масштабом, поскольку диапазон данных включает ноль."}},Object_Disclaimer_NoDataExist:{id:"Object.Disclaimer.NoDataExist",locale:{"en-US":"The selections generated no data for this chart.","zh-TW":"此選項無法產生任何適用於此圖表的資料。","zh-CN":"选择未生成此图表的数据。","tr-TR":"Seçimler bu grafik için hiç veri oluşturmadı.","sv-SE":"Urvalen genererade inga data för detta diagram.","it-IT":"Le selezioni non hanno generato dati per questo grafico.","es-ES":"Las selecciones no han generado datos para este gráfico.","de-DE":"Die Auswahlen haben für dieses Diagramm keine Daten generiert.","pl-PL":"Selekcje nie spowodowały wygenerowania danych dla tego wykresu.","nl-NL":"De selecties hebben geen gegevens voor de grafiek gegenereerd.","ko-KR":"선택 내용으로 해당 차트에 대한 데이터가 생성되지 않았습니다.","pt-BR":"As seleções não geraram dados para este gráfico.","fr-FR":"Les sélections n'ont pas généré de données pour ce graphique.","ja-JP":"このチャートには選択からデータが生成されませんでした。","ru-RU":"В результате выборок данные для этой диаграммы не созданы."}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"en-US":"The chart is not displayed because it contains only undefined values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。","zh-CN":"未显示图表,因为它仅包含未定义的值。","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości niezdefiniowane.","nl-NL":"De grafiek wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения."}},Object_ChartTooltip_NMore:{id:"Object.ChartTooltip.NMore",locale:{"en-US":"+{0} more","zh-TW":"再加 {0} 個","zh-CN":"+{0} 个","tr-TR":"+{0} öğe daha","sv-SE":"+{0} till","it-IT":"Altre +{0}","es-ES":"+{0} más","de-DE":"+{0} mehr","pl-PL":"+ {0} więcej","nl-NL":"+ {0} meer","ko-KR":"+추가 {0}개","pt-BR":"+{0} mais","fr-FR":"+ {0} de plus","ja-JP":"さらに {0}","ru-RU":"+ дополнительно: {0}"}},Object_ChartTooltip_sumOfPositives:{id:"Object.ChartTooltip.sumOfPositives",locale:{"en-US":"Sum of positives","zh-TW":"正數總和","zh-CN":"正值总和","tr-TR":"Pozitif değerlerin toplamı","sv-SE":"Summan av positiva","it-IT":"Somma valori positivi","es-ES":"Suma de positivos","de-DE":"Summe positiver Werte","pl-PL":"Suma dodatnich","nl-NL":"Som positieven","ko-KR":"양수 합계","pt-BR":"Soma de positivos","fr-FR":"Sommes des valeurs positives","ja-JP":"正の合計","ru-RU":"Сумма положительных значений"}},Object_ChartTooltip_sumOfNegatives:{id:"Object.ChartTooltip.sumOfNegatives",locale:{"en-US":"Sum of negatives","zh-TW":"負數總和","zh-CN":"负值总和","tr-TR":"Negatif değerlerin toplamı","sv-SE":"Summan av negativa","it-IT":"Somma valori negativi","es-ES":"Suma de negativos","de-DE":"Summe negativer Werte","pl-PL":"Suma ujemnych","nl-NL":"Som negatieven","ko-KR":"음수 합계","pt-BR":"Soma de negativos","fr-FR":"Somme des valeurs négatives","ja-JP":"負の合計","ru-RU":"Сумма отрицательных значений"}},Object_ChartTooltip_ColorExpression:{id:"Object.ChartTooltip.ColorExpression",locale:{"en-US":"Color expression","zh-TW":"色彩運算式","zh-CN":"颜色表达式","tr-TR":"Renk ifadesi","sv-SE":"Färguttryck","it-IT":"Espressione colore","es-ES":"Expresión de color","de-DE":"Farbformel","pl-PL":"Wyrażenie koloru","nl-NL":"Kleuruitdrukking","ko-KR":"색상 표현식","pt-BR":"Expressão de cor","fr-FR":"Expression de couleur","ja-JP":"カラー表現","ru-RU":"Выражение для цвета"}},Object_Disclaimer_OnlyNanColor:{id:"Object.Disclaimer.OnlyNanColor",locale:{"en-US":"The data used to color this visualization only contains undefined values.","zh-TW":"用以定義此視覺化的色彩的資料只包含未定義的值。","zh-CN":"用于将该可视化着色的数据仅包含未定义的值。","tr-TR":"Bu görselleştirmeyi renklendirmek için kullanılan veriler yalnızca tanımlanmamış değerler içeriyor.","sv-SE":"Data som används för att färgsätta denna visualisering innehåller enbart odefinierade värden.","it-IT":"I dati utilizzati per colorare questa visualizzazione contengono solo valori non definiti.","es-ES":"Los datos utilizados para colorear esta visualización solo contienen valores indefinidos.","de-DE":"Die verwendeten Daten für die Farbgebung dieser Visualisierung enthalten undefinierte Werte.","pl-PL":"Dane używane do kolorowania tej wizualizacji zawierają wyłącznie niezdefiniowane wartości.","nl-NL":"De gegevens die worden gebruikt om deze visualisatie kleur te geven bevatten uitsluitend ongedefinieerde waarden.","ko-KR":"이 시각화에 색을 지정하는 데 사용된 데이터에는 정의되지 않은 값만 포함되어 있습니다.","pt-BR":"Os dados usados para colorir esse visualização contém somente valores indefinidos.","fr-FR":"Les données utilisées pour colorer cette visualisation ne comportent que des valeurs non définies.","ja-JP":"このビジュアライゼーションの色の割り当てに使用したデータには、未定義の値が含まれています。","ru-RU":"Данные, используемые для выбора цвета визуализации, содержат только неопределенные значения."}},properties_trendlines_types_average:{id:"properties.trendlines.types.average",locale:{"en-US":"Average","zh-TW":"平均值","zh-CN":"平均值","tr-TR":"Ortalama","sv-SE":"Medel","it-IT":"Media","es-ES":"Media","de-DE":"Durchschnitt","pl-PL":"Średnia","nl-NL":"Gemiddelde","ko-KR":"평균","pt-BR":"Média","fr-FR":"Moyenne","ja-JP":"平均値","ru-RU":"Среднее"}},properties_trendlines_types_linear:{id:"properties.trendlines.types.linear",locale:{"en-US":"Linear","zh-TW":"線性","zh-CN":"线性","tr-TR":"Doğrusal","sv-SE":"Linjär","it-IT":"Lineare","es-ES":"Lineal","de-DE":"Linear","pl-PL":"Liniowa","nl-NL":"Lineair","ko-KR":"선형","pt-BR":"Linear","fr-FR":"Linéaire","ja-JP":"線形","ru-RU":"Линейный"}},properties_trendlines_types_polynomial2:{id:"properties.trendlines.types.polynomial2",locale:{"en-US":"Second degree polynomial","zh-TW":"第二度多項式","zh-CN":"二次多项式","tr-TR":"İkinci derece polinom","sv-SE":"Polynomial, andra graden","it-IT":"Polinomio di secondo grado","es-ES":"Polinómica de segundo grado","de-DE":"Polynom zweiten Grades","pl-PL":"Wielomianowa drugiego stopnia","nl-NL":"Tweedegraadspolynoom","ko-KR":"2차 다항식","pt-BR":"Polinômio de segundo grau","fr-FR":"Polynomial du 2ème degré","ja-JP":"2 番目の角度の多項式近似","ru-RU":"Полиномиальный второй степени"}},properties_trendlines_types_polynomial3:{id:"properties.trendlines.types.polynomial3",locale:{"en-US":"Third degree polynomial","zh-TW":"第三度多項式","zh-CN":"三次多项式","tr-TR":"Üçüncü derece polinom","sv-SE":"Polynomial, tredje graden","it-IT":"Polinomio di terzo grado","es-ES":"Polinómica de tercer grado","de-DE":"Polynom dritten Grades","pl-PL":"Wielomianowa trzeciego stopnia","nl-NL":"Derdegraadspolynoom","ko-KR":"3차 다항식","pt-BR":"Polinômio de terceiro grau","fr-FR":"Polynomial du 3ème degré","ja-JP":"3 番目の角度の多項式近似","ru-RU":"Полиномиальный третьей степени"}},properties_trendlines_types_polynomial4:{id:"properties.trendlines.types.polynomial4",locale:{"en-US":"Fourth degree polynomial","zh-TW":"第四度多項式","zh-CN":"四次多项式","tr-TR":"Dördüncü derece polinom","sv-SE":"Polynomial, fjärde graden","it-IT":"Polinomio di quarto grado","es-ES":"Polinómica de cuarto grado","de-DE":"Polynom vierten Grades","pl-PL":"Wielomianowa czwartego stopnia","nl-NL":"Vierdegraadspolynoom","ko-KR":"4차 다항식","pt-BR":"Polinômio de quarto grau","fr-FR":"Polynomial du 4ème degré","ja-JP":"4 番目の角度の多項式近似","ru-RU":"Полиномиальный четвертой степени"}},properties_trendlines_types_exponential:{id:"properties.trendlines.types.exponential",locale:{"en-US":"Exponential","zh-TW":"指數","zh-CN":"指数","tr-TR":"Üstel","sv-SE":"Exponentiell","it-IT":"Esponenziale","es-ES":"Exponencial","de-DE":"Exponentiell","pl-PL":"Wykładnicze","nl-NL":"Exponentieel","ko-KR":"지수","pt-BR":"Exponencial","fr-FR":"Exponentiel","ja-JP":"指数","ru-RU":"Экспоненциальный"}},properties_trendlines_types_logarithmic:{id:"properties.trendlines.types.logarithmic",locale:{"en-US":"Logarithmic","zh-TW":"對數","zh-CN":"对数","tr-TR":"Logaritmik","sv-SE":"Logaritmisk","it-IT":"Logaritmica","es-ES":"Logarítmica","de-DE":"Logarithmisch","pl-PL":"Logarytmiczna","nl-NL":"Logaritmisch","ko-KR":"로그","pt-BR":"Logarítmico","fr-FR":"Logarithmique","ja-JP":"対数","ru-RU":"Логарифмический"}},properties_trendlines_types_power:{id:"properties.trendlines.types.power",locale:{"en-US":"Power","zh-TW":"乘冪","zh-CN":"幂","tr-TR":"Üs","sv-SE":"Potens","it-IT":"Potenza","es-ES":"Potencia","de-DE":"Potenz","pl-PL":"Potęgowa","nl-NL":"Macht","ko-KR":"거듭제곱","pt-BR":"Potência","fr-FR":"Puissance","ja-JP":"累乗","ru-RU":"Силовой"}},Common_Measures:{id:"Common.Measures",locale:{"en-US":"Measures","de-DE":"Kennzahlen","fr-FR":"Mesures","it-IT":"Misure","ja-JP":"メジャー","ko-KR":"측정값","es-ES":"Medidas","nl-NL":"Metingen","pl-PL":"Miary","pt-BR":"Medidas","sv-SE":"Mått","tr-TR":"Hesaplamalar","zh-CN":"度量","zh-TW":"量值","ru-RU":"Меры"}},Tooltip_ToggleOnLassoSelection:{id:"Tooltip.ToggleOnLassoSelection",locale:{"en-US":"Turn on lasso selection","de-DE":"Lasso-Auswahl aktivieren","fr-FR":"Activer la sélection au lasso","it-IT":"Attiva selezione lazo","ja-JP":"囲み選択をオンにする","ko-KR":"올가미 선택 켜기","es-ES":"Activar la selección de contorno","nl-NL":"Lassoselectie inschakelen","pl-PL":"Włącz zaznaczenie lasso","pt-BR":"Ativar seleção de laço","sv-SE":"Slå på lassourval","tr-TR":"Serbest seçimi aç","zh-CN":"开启套索选择方法","zh-TW":"開啟套索選取","ru-RU":"Включить выбор лассо"}},Tooltip_ToggleOffLassoSelection:{id:"Tooltip.ToggleOffLassoSelection",locale:{"en-US":"Turn off lasso selection","de-DE":"Lasso-Auswahl deaktivieren","fr-FR":"Désactiver la sélection au lasso","it-IT":"Disattiva selezione lazo","ja-JP":"囲み選択をオフにする","ko-KR":"올가미 선택 끄기","es-ES":"Desactivar la selección de contorno","nl-NL":"Lassoselectie uitschakelen","pl-PL":"Wyłącz zaznaczenie lasso","pt-BR":"Desativar seleção de laço","sv-SE":"Stäng av lassourval","tr-TR":"Serbest seçimi kapat","zh-CN":"关闭套索选择方法","zh-TW":"關閉套索選取","ru-RU":"Выключить выбор лассо"}}};function Kg({env:e}){var t,n;const{flags:r}=e,i=null===(t=e.anything)||void 0===t||null===(n=t.sense)||void 0===n?void 0:n.isUnsupportedFeature,o=g();!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(Wg).forEach((t=>{e.add(Wg[t])}))}}(e.translator);const a=y(),s=v(),[l,u]=b(),c=x(),d=q(),{qLocaleInfo:m}=d;return M((()=>{u({translator:o,theme:s,embed:a,deviceType:c,localeInfo:m,isUnsupportedFeature:i,flags:r})}),[m,i,o.language(),s.name(),c]),l}function Gg(){const[e]=b((()=>iu())),[t]=b((()=>function(e){var t=$a({},e),n={},r={},i=!1,o={get:function(e){return t[e]},set:function(e,o){var a=t[e];!i&&n[e]?t[e]=n[e](o,a):t[e]=o,!i&&r[e]&&r[e](t[e],a)},preventSet:function(e,t){i=!0,o.set(e,t),i=!1},intercept:function(e,t){n[e]=t},onChanged:function(e,t){r[e]=t}};return o}({viewRange:[0,1],scrollOffset:void 0})));return{viewCache:e,viewState:t}}const Yg="REJECTED",Xg=()=>{},Jg=1e4,Zg={MULTIPLIER:2,MINIMUM:20,MAXIMUM:200},Qg=50,ey=10,ty=100;var ny={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qLeft<=t.qLeft&&n.qLeft+n.qWidth>=t.qLeft+t.qWidth&&n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qMatrix.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qMatrix.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),r=Math.max(0,t.qWidth)-Math.abs(Math.min(0,t.qLeft-e.qArea.qLeft)),i=Math.max(t.qTop,e.qArea.qTop),o=Math.max(t.qLeft,e.qArea.qLeft),a=Math.max(0,i-e.qArea.qTop),s=Math.min(i+n-e.qArea.qTop,e.qArea.qHeight),l=Math.max(0,o-e.qArea.qLeft),u=Math.min(o+r-e.qArea.qLeft,e.qArea.qWidth),c={qArea:{qHeight:s-a,qWidth:u-l,qTop:i,qLeft:o},qMatrix:[]};for(let t=a;t<s;t++)c.qMatrix.push(e.qMatrix[t].slice(l,u));return c},cacheWarden:function({bounds:e={width:0,height:0}}){return{release(t,n){const r=n.qTop-ey<=t.qTop,i=n.qLeft+n.qWidth+ey>=t.qLeft+t.qWidth,o=n.qTop+n.qHeight+ey>=t.qTop+t.qHeight,a=n.qLeft-ey<=t.qLeft;return r&&t.qTop>0||i&&t.qLeft+t.qWidth<e.width||o&&t.qTop+t.qHeight<e.height||a&&t.qLeft>0}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeData",args:[e,[t]]})}};var ry={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qData[0].qSubNodes.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qData.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),r=Math.max(t.qTop,e.qArea.qTop),i=Math.max(t.qLeft,e.qArea.qLeft),o=Math.max(0,r-e.qArea.qTop),a=Math.min(r+n-e.qArea.qTop,e.qArea.qHeight),s=e.qData[0].qUp+e.qArea.qHeight+e.qData[0].qDown-r-(a-o),l={qArea:{qHeight:a-o,qWidth:e.qArea.qWidth,qTop:r,qLeft:i},qData:[{...e.qData[0],qUp:r,qDown:s,qSubNodes:[]}]};for(let t=o;t<a;t++)l.qData[0].qSubNodes.push(e.qData[0].qSubNodes[t]);return l},cacheWarden:function({bounds:e={height:0}}){return{release(t,n){const r=n.qTop-ey<=t.qTop,i=n.qTop+n.qHeight+ey>=t.qTop+t.qHeight;return r&&t.qTop>0||i&&t.qTop+t.qHeight<e.height}}},request:function({layoutService:e,definitionPath:t}){const n=e.getLayoutValue("dimensionAxis.axisDisplayMode","auto");return e=>{const r={method:"getHyperCubeStackData",args:[t,[e]]};return"auto"===n&&r.args.push(600),r}}};var iy={contains:function(){return!1},patcher:function(){const e=e=>e;return e.should=()=>!1,e},slicer:function(e){return e},cacheWarden:function(){return{release:()=>!0}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeTreeData",args:[e,[t]]})}};const oy="pages";const ay="discretePan",sy=10;function ly({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o}){return{type:"Pan",key:"discrete:pan",options:{event:ay,pointers:1,threshold:sy,enable(r,i){return this.started===ay||!i||!(!t.scroll.enabled()||!o.enabled())&&e.componentsFromPoint({x:i.center.x,y:i.center.y}).some((e=>e.key===n))}},events:{[`${ay}start`](e){e.preventDefault(),this.started=ay;const t="horizontal"===r.meta.major.orientation?e.deltaX:e.deltaY;this.previousTotalDelta=t<0?-sy:sy},[`${ay}move`](e){e.preventDefault();const t="horizontal"===r.meta.major.orientation,n=t?e.deltaX:e.deltaY,a=t&&i?-1:1,s=(n-this.previousTotalDelta)*a;this.previousTotalDelta=n,o.scroll(s)},[`${ay}end`](e){e.preventDefault(),this.started=!1},[`${ay}cancel`](e){e.preventDefault(),this.started=!1}}}}function uy({chart:e,componentKey:t,actions:n,scroller:r}){return function(i){if(!n.scroll.enabled()||!r.enabled())return;const[o]=e.componentsFromPoint({x:i.clientX,y:i.clientY}).filter((e=>e.key===t));if(!o)return;i.preventDefault();const a=Math.abs(i.deltaY)>Math.abs(i.deltaX)?i.deltaY:i.deltaX,s=Math.sign(-a)*ty;r.scroll(s)}}function cy({layoutService:e}){const t=function({layoutService:e}){const t=Math.floor(Jg/(e.meta.dimensionCount+e.meta.measureCount));return function({width:e,height:n}){const r=Math.min(t,Math.max(Zg.MAXIMUM,n));return{width:e,height:Math.max(Zg.MINIMUM,Math.min(n*Zg.MULTIPLIER,r))}}}({layoutService:e}),n={width:e.meta.size.x,height:e.meta.size.y};return function(e){const{width:r,height:i}=t({width:e.qWidth,height:e.qHeight}),o=i?Math.ceil((i-e.qHeight)/2):0,a=r?Math.ceil((r-e.qWidth)/2):0;return{qHeight:i?Math.min(i,n.height):e.qHeight,qWidth:r?Math.min(r,n.width):e.qWidth,qTop:i?Math.max(0,Math.min(e.qTop-o,n.height-i)):e.qTop,qLeft:r?Math.max(0,Math.min(e.qLeft-a,n.width-r)):e.qLeft}}}function dy(e){let t,n;const r=i=>{t=i;const{method:o,args:a}=t.request;e[o](...a).then((e=>{if(t.canceled||n)return t.reject(Yg),t=null,void(n&&(r(n),n=null));t.resolve(e[0]),t=null}))},i=e=>new Promise(((i,o)=>{const a={request:e,resolve:i,reject:o,canceled:!1,cancel:()=>{a.canceled=!0}};t?(e=>{n&&n.reject(Yg),n=e})(a):r(a)}));return i.isProcessing=()=>!!t,i.hasQueued=()=>!!n,i.cancel=()=>{i.isProcessing()&&t.cancel(),i.hasQueued()&&(n.reject(Yg),n=null)},i}const my={command:{update:()=>{}}};function fy({dataStore:e,composition:t,enigmaModel:n,layoutService:r,trendLineModel:i=my,definitionPath:o,processDataPage:a}){const{slicer:s,cacheWarden:l,request:u}=t,c=function({dataStore:e,slice:t,warden:n,expand:r,request:i,process:o,connectionless:a,processDataPage:s}){return(l,{onProcessing:u}={})=>{if(e.contains(l)){const r=e.getCurrent();if(a)return Promise.resolve(t(r,l));const i=n.release(r.qArea,l),s=o.isProcessing();if(!i&&s&&o.cancel(),!i||s)return Promise.resolve(t(r,l))}if(a)return Promise.resolve(e.getCurrent());o.isProcessing()&&u&&u();const c=r(l);return o(i(c)).then((n=>(s(n),e.add(n),t(n,l))))}}({dataStore:e,slice:s,warden:l({bounds:{width:r.meta.size.x,height:r.meta.size.y}}),expand:cy({layoutService:r}),request:u({layoutService:r,definitionPath:o}),process:dy(n),connectionless:r.meta.isSnapshot,processDataPage:a}),d=su(((e,{onProcessing:t,onData:n})=>{c(e,{onProcessing:t}).then((e=>n(e))).catch((e=>{if(e!==Yg)throw e}))}),Qg);return function(e,{onProcessing:t=Xg,onDataPage:n=Xg}={}){d(e,{onProcessing:t,onData:e=>{r.setDataPages(e?[e]:[]),i.command.update(),n(e)}})}}var py={inTotal:function({layoutService:e}){return e.meta.size.x},area:function({layoutService:e}){return{qTop:0,qHeight:1,qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const{pixel:i}=t,o=e.getDataPages()[0],a=i/r;return[a,n.inView>=n.inTotal?a+1:a+o.qArea.qWidth/n.inView]}};var hy={inTotal:function({layoutService:e}){if(e.meta.isSnapshot&&!e.getLayoutValue("reducedHyperCube")){const[t]=e.getDataPages();if(t)return t.qArea.qHeight}return e.meta.size.y},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:r}){const i=void 0===r?4:r,o=Math.max(0,Math.floor(t)-i/2);return{qTop:o,qHeight:Math.min(e.meta.size.y-o,Math.max(0,Math.ceil(n+i))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const{pixel:i}=t,o=e.getDataPages()[0],a=r/n.inView,s=(i+o.qArea.qTop*a)/r;return[s,n.inView>=n.inTotal?s+1:s+o.qArea.qHeight/n.inView]}};function gy(e){const{groupSize:t,measureCount:n}=e.meta;return null!=t?t:n}function yy(e,t){const n=[];for(let r=0;r<e.length;r++){const i=t(e[r]);-1===n.indexOf(i)&&n.push(i)}return n.length}function vy(e){return yy(e.qMatrix,(e=>e[0].qElemNumber))-1}var by={inTotal:function({layoutService:e}){const t=gy(e);return e.meta.size.y*t*(1+1/t)-1},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:r}){const i=gy(e),o=void 0===r?i:r,a=t/(i+1),s=Math.max(0,Math.floor((t-a-o/2)/i));return{qTop:s,qHeight:Math.min(e.meta.size.y-s,Math.max(0,Math.ceil((n+o)/i+1))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const i=gy(e),o=e.getDataPages()[0],a=r/n.inView,{pixel:s}=t,l=vy(o),u=o.qArea.qHeight*i+l,c=(s+(o.qArea.qTop*i+o.qArea.qTop)*a)/r;return[c,n.inView>=n.inTotal?c+1:c+u/n.inView]}};const xy=(e,t)=>t/(e.meta.size.y/e.meta.size.dimensions[0]+1),qy=(e,t)=>{const n={successful:!0,count:0};let r=Math.abs(Math.floor(t));const i=[];for(let t=0;t<=r;t++){if(!e[t])return n.successful=!1,n;const o=e[t][0].qElemNumber;-1===i.indexOf(o)&&(i.push(o),r--)}return n.count=i.length-1,n};function My(e){return{itemOffset(t,n){if(0!==t.qArea.qTop)return xy(e,n);const r=qy(t.qMatrix,n);return r.successful?r.count:xy(e,n)},area(t,n,r){if(0!==t.qArea.qTop)return xy(e,n);return yy(t.qMatrix.slice(0,r.qTop+1),(e=>e[0].qElemNumber))-1}}}var Sy={inTotal:function({layoutService:e}){return e.meta.size.y+e.meta.size.dimensions[0]-1},area:function({getDataPages:e,layoutService:t,itemOffset:n,inView:r}){const i=My(t).itemOffset(e(),n),o=Math.max(0,Math.floor(n-i));return{qTop:o,qHeight:Math.min(t.meta.size.y-o,Math.max(0,Math.ceil(r+1))),qLeft:0,qWidth:t.meta.size.x}},scaleRange:function({getDataPages:e,layoutService:t,offsets:n,items:r,viewSize:i,upperBound:o}){const a=t.getDataPages()[0],s=i/r.inView,{item:l,pixel:u}=n,c=My(t).area(e(),l,a.qArea),d=vy(a),m=a.qArea.qHeight+d,f=u===o?(r.inView-m)*s/i:(u+(a.qArea.qTop+c)*s)/i;return[f,r.inView>=r.inTotal?f+1:f+m/r.inView]}};function Dy({chart:e,rect:t,dockService:n,itemWidths:r,axisKey:i,renderer:o,isGrouped:a,dimensionAxis:s,inTotal:l,isMajorLabelless:u,maxDataRows:c}){const{DEFAULT:d,SQUEEZE:m,LABELLESS:f}=r[n.meta.chart.mode],p="horizontal"===n.meta.major.orientation,{axisDisplayMode:h="auto",maxVisibleItems:g=10,label:y}=s,v=p?t.width:t.height,b=v/l>=m;switch(h){case"max":return Math.min(l,c);case"custom":return Math.min(g,c);default:return u?v/f:b?function({chart:e,isHorizontal:t,axisKey:n,renderer:r={},isGrouped:i,itemSize:o,label:a}){if(i||"auto"!==a&&"tilted"!==a)return!1;const s=e.component(n),{measureText:l}=r;if(!s||!l)return!0;const{fontFamily:u,fontSize:c,tiltAngle:d}=s.settings.settings.labels,{height:m}=l({fontFamily:u,fontSize:c,text:"M"});if(!t)return m>o;const f=(90-d)*(Math.PI/180);return m>Math.cos(f)*o}({chart:e,isHorizontal:p,axisKey:i,renderer:o,isGrouped:a,itemSize:m,label:y})?v/d:l:v/d}}function Cy({chart:e,getRect:t,getDataPages:n,layoutService:r,dockService:i,getItemWidths:o,axisKey:a,renderer:s,areaBuffer:l,rtl:u}){const{inTotal:c,area:d,scaleRange:m}=function({layoutService:e}){const{isDimensionless:t,isGrouped:n,isGroupedByMeasure:r}=e.meta;return t?py:n?r?by:Sy:hy}({layoutService:r}),f=()=>"horizontal"===i.meta.major.orientation?t().width:t().height,p=e=>e?f()/e:0,h=(e,t)=>-(e-t)*p(t);return{getItems(){const n=r.getLayoutValue("dimensionAxis"),l=c({layoutService:r});return{inTotal:l,inView:Dy({chart:e,rect:t(),dockService:i,itemWidths:o(),axisKey:a,renderer:s,isGrouped:r.meta.isGrouped,dimensionAxis:n,inTotal:l,isMajorLabelless:"none"===n.show||"title"===n.show,maxDataRows:Math.floor(Jg/(r.meta.dimensionCount+r.meta.measureCount))})}},getItemSize({items:e}){const{inView:t}=e;return p(t)},getOffsets({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t,i=Math.min(0,Math.max(e,h(n,r))),o=r?Math.abs(r*i/f()):0;return{start:{pixel:i,item:o},end:{item:Math.min(o+(r||0),n)}}},getUpperBound({items:e}){const{inTotal:t,inView:n}=e;return h(t,n)},getViewRange({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t;return function({viewSize:e,inTotal:t,inView:n,pixelOffset:r}){const i=e/n*t,o=Math.abs(r)/i;return[o,Math.min(1,o+e/i)]}({viewSize:f(),inTotal:n,inView:r,pixelOffset:e})},getArea:({itemOffset:e,items:t})=>d({getDataPages:n,layoutService:r,itemOffset:e,inView:t.inView,areaBuffer:l}),getScaleRange({offsets:e,items:t}){const o=m({getDataPages:n,layoutService:r,offsets:e,items:t,viewSize:f(),upperBound:h(t.inTotal,t.inView)});return"horizontal"===i.meta.major.orientation&&u?function(e){return[1-e[1],1-e[0]]}(o):o},validate:{offset({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t;return e<=0&&e>=h(n,r)}},convert:{itemToPixelOffset({itemOffset:e,items:t}){const{inView:n}=t,r=e*p(n);return Number.isFinite(r)?-r:0},relativeToPixelOffset({relativeOffset:e,items:t}){const{inTotal:n,inView:r}=t;return-e*(p(r)*n)}}}}function wy({chart:e,componentKey:t,state:n,dataStore:r,pageData:i,layoutService:o,dockService:a,itemWidths:s,getRect:l,axisKey:u,renderer:c,areaBuffer:d,viewState:m,rtl:f}){n.set("rect",{width:0,height:0}),n.set("itemWidths",{}),n.set("itemSize",0),n.set("items",{}),n.set("offsets",{}),n.set("finished",0),n.set("scaleRange",[0,1]);const p=Cy({chart:e,getRect:()=>n.get("rect"),getDataPages:r.getCurrent,layoutService:o,dockService:a,getItemWidths:()=>n.get("itemWidths"),axisKey:u,renderer:c,areaBuffer:d,rtl:f}),h=()=>{const e=p.getItems();return n.set("items",e),e},g=({pixelOffset:e,items:t})=>{const r=p.getOffsets({pixelOffset:e,items:t});return n.set("offsets",r),r},y=e=>{const t=Date.now(),r=h(),a=g({pixelOffset:e,items:r}),s=p.getArea({itemOffset:a.start.item,items:r});if((e=>{const[{qArea:t}]=o.getDataPages();return!!t&&Object.keys(e).every((n=>e[n]===t[n]))})(s))return void((p.validate.offset({pixelOffset:e,items:r})||m.get("scrollOffset").start!==a.start.item)&&(n.set("finished",t),n.set("scaleRange",p.getScaleRange({offsets:a.start,items:r})),m.preventSet("viewRange",p.getViewRange({pixelOffset:a.start.pixel,items:r})),m.set("scrollOffset",{start:a.start.item,end:a.end.item})));m.preventSet("viewRange",p.getViewRange({pixelOffset:a.start.pixel,items:r}));const l=()=>{n.get("finished")>t||(n.set("finished",t),n.set("scaleRange",p.getScaleRange({offsets:a.start,items:r})),m.set("scrollOffset",{start:a.start.item,end:a.end.item}))};i(s,{onProcessing:l,onDataPage:l})};return{enabled(){const{inTotal:e,inView:t}=n.get("items");return e>t},itemSize:()=>n.get("itemSize"),scaleRange:()=>n.get("scaleRange"),initialize(){const r=e.component(t);if(!r)return Promise.resolve();n.set("rect","function"==typeof l?l():r.rect),n.set("itemWidths","function"==typeof s?s():s);const a=h();n.set("itemSize",p.getItemSize({items:a}));const u=(({items:e})=>{const t=o.getLayoutValue("scrollStartPos"),n=m.get("scrollOffset");if(void 0===n)return 1===t?p.getUpperBound({items:e}):0;if("number"==typeof n)return p.convert.itemToPixelOffset({itemOffset:n,items:e});const{start:r,end:i}=n,a=1===t&&i?i-e.inView:r;return p.convert.itemToPixelOffset({itemOffset:a,items:e})})({items:a}),c=g({pixelOffset:u,items:a});m.preventSet("viewRange",p.getViewRange({pixelOffset:c.start.pixel,items:a}));const d=p.getArea({itemOffset:c.start.item,items:a});return new Promise((e=>{i(d,{onDataPage:()=>{n.set("scaleRange",p.getScaleRange({offsets:c.start,items:a})),m.preventSet("scrollOffset",{start:c.start.item,end:c.end.item}),e()}})}))},scroll(e){const t=n.get("offsets").start.pixel+e;y(t)},scrollToRelative(e){const t=n.get("items"),r=p.convert.relativeToPixelOffset({relativeOffset:e,items:t});y(r)}}}function Ly({chart:e,actions:t,componentKey:n,enigmaModel:r,layoutService:i,dockService:o,trendLineModel:a,itemWidths:s,viewState:l,rtl:u,options:{definitionPath:c="/qHyperCubeDef",getRect:d,axisKey:m,renderer:f,areaBuffer:p,processDataPage:h=(()=>{})}={}}){const g=iu(),y=function({qMode:e}){switch(e){case"S":default:return ny;case"K":return ry;case"T":return iy}}({qMode:i.getHyperCubeValue("qMode")}),v=function({state:e,contains:t}){return e.set(oy,[]),{add:t=>{const n=e.get(oy);n.length=0,n.push(t)},getCurrent:()=>e.get(oy)[0],getAll:()=>e.get(oy),contains:n=>t(e.get(oy)[0],n)}}({state:g,contains:y.contains});!function({layoutService:e,dataStore:t,composition:n}){const r=e.getDataPages()[0];if(!r)return;const i=n.patcher({layoutService:e});i.should(r)&&i(r),t.add(r)}({layoutService:i,dataStore:v,composition:y});const b=function({buffer:e}){return void 0===e?void 0:2*Math.round(e/2)}({buffer:p}),x=fy({dataStore:v,composition:y,enigmaModel:r,layoutService:i,trendLineModel:a,definitionPath:c,processDataPage:h}),q=wy({chart:e,componentKey:n,state:g,dataStore:v,pageData:x,layoutService:i,dockService:o,itemWidths:s,getRect:d,axisKey:m,renderer:f,areaBuffer:b,viewState:l,rtl:u}),M=function({layoutService:e,dataStore:t}){return function(n){const r=tu(n,`${e.refs.dataPages}`);r.length=0,r.push(t.getCurrent())}}({layoutService:i,dataStore:v}),S=function({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o}){return{gestures:[ly({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o})],native:{type:"native",events:{wheel:uy({chart:e,actions:t,componentKey:n,scroller:o})}}}}({chart:e,actions:t,componentKey:n,dockService:o,rtl:u,scroller:q});return{interactions:S,query:{getCanScroll:()=>q.enabled(),getItemSize:()=>q.itemSize(),getScaleRange:()=>q.scaleRange(),getCurrentDataPage:()=>v.getCurrent()},command:{initialize:()=>q.initialize(),scrollTo:e=>q.scrollToRelative(e),setSnapshotData:e=>M(e)}}}var Ey="AVERAGE",Ty="LINEAR",Ay="POLYNOMIAL2",Ny="POLYNOMIAL3",ky="POLYNOMIAL4",Oy="EXPONENTIAL",Iy="LOG",Py="POWER";function Ry({dimValue:e,value:t,qTrendLine:n}){const{qType:r,qCoeff:i}=n,o={x:e,y:i[2]*t**2+i[1]*t+i[0]};switch(r){default:case Ay:return o;case Ny:return o.y+=i[3]*t**3,o;case ky:return o.y+=i[4]*t**4+i[3]*t**3,o}}var Fy={average:function({dimValue:e,qTrendLine:t}){return{x:e,y:t.qCoeff[0]}},linear:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]*t+n.qCoeff[0]}},polynomial2:Ry,polynomial3:Ry,polynomial4:Ry,exponential:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:Math.exp(n.qCoeff[0]+t*n.qCoeff[1])}},log:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]+n.qCoeff[0]*Math.log(t)}},power:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:10**(n.qCoeff[0]+n.qCoeff[1]*Math.log(t)*Math.LOG10E)}}};const Hy=500;function zy(e,t){const n=Fy[t.qType.toLowerCase()],r=Math.max(1,e/Hy);let i=1/0,o=-1/0;for(let a=0;a<e;a+=r){const{y:e}=n({dimValue:null,value:a+1,qTrendLine:t});i=Math.min(e,i),o=Math.max(e,o)}return{min:i,max:o}}const jy=100;function By(e){return Fy[e.qType.toLowerCase()]}function Vy(e,t){return e.meta.isContinuous?function(e,t){return{generate:(e,n,r)=>{const i=[],o=By(e),{min:a,max:s}=t.get("zoom"),l=(s-a)/jy;if(l>0){const t=t=>{const a=o({dimValue:t,value:t,qTrendLine:e});a.layerId=n,a.measureIndex=r,a.dimValue=t,i.push(a)};let u=a;for(let e=a;e<=s;e+=l)t(e),u=e;u!==s&&t(s)}return i},calculate:(e,t)=>By(e)({dimValue:t,value:t,qTrendLine:e}),findMinMax(e,t){const n=this.generate(t).map((({y:e})=>e));return{min:Math.min(...n),max:Math.max(...n)}}}}(0,t):e.meta.mode.K?function(e){return{generate:(t,n,r)=>{const i=[],o=e.getDataPages()[0],a=o.qData[0].qSubNodes,s=o.qArea.qTop,l=Fy[t.qType.toLowerCase()];for(let e=0;e<a.length;e++){const o=a[e],u=l({dimValue:o.qElemNo,value:e+s+1,qTrendLine:t});u.layerId=n,u.measureIndex=r,u.dimValue=o.qText,i.push(u)}return i},findMinMax:zy}}(e):function(e){return{generate:(t,n,r)=>{const i=[],o=e.getDataPages()[0],a=o.qMatrix,s=o.qArea.qTop,l=Fy[t.qType.toLowerCase()];for(let e=0;e<a.length;e++){const o=a[e][0],u=e+s+1,c=l({dimValue:o.qElemNumber,value:u,qTrendLine:t});c.layerId=n,c.measureIndex=r,c.dimValue=o.qText,i.push(c)}return i},calculate:(e,t,n)=>(0,Fy[e.qType.toLowerCase()])({dimValue:n,value:t,qTrendLine:e}),findMinMax:zy}}(e)}var _y={TYPES:{AVERAGE:"properties.trendlines.types.average",LINEAR:"properties.trendlines.types.linear",POLYNOMIAL2:"properties.trendlines.types.polynomial2",POLYNOMIAL3:"properties.trendlines.types.polynomial3",POLYNOMIAL4:"properties.trendlines.types.polynomial4",EXPONENTIAL:"properties.trendlines.types.exponential",LOG:"properties.trendlines.types.logarithmic",POWER:"properties.trendlines.types.power"},STYLE:{DASHED:"properties.trendlines.style.dashed"},TYPE:"properties.trendlines.type",HEADER:"properties.trendlines",ADD_BUTTON:"properties.trendlines.button.add"},Uy={color:"#f93f17",index:9};const{isDark:$y}=St,Wy={x:NaN,y:NaN,layerId:NaN,measureIndex:NaN},Ky=({layoutService:e,viewState:t,colorModel:n,chart:r,env:i,keys:{colorScale:o},isEnabled:a=(()=>!1)})=>{const{translator:s}=i,l=[Wy],u=[],c=[],d=Vy(e,t);e.getLayoutValue("qHyperCube.qMeasureInfo",[]).forEach(((e,t)=>{Array.isArray(e.qTrendLines)&&(u.push(...e.qTrendLines),c.push(...e.qTrendLines.map((()=>t))))}));const m=ou((e=>{const{style:t}=u[e]||{},i=n.settings();if(t.autoColor){if("measure"===i.mode){const t=c[e],n=r.scale(o)(t);return $y(n)?function(e){const t=xt(e);return t.l<30?t.l+=15:t.l<50?t.l+=10:t.l+=5,t.toString()}(n):function(e){const t=xt(e);return t.l-=5,t.toString()}(n)}return n.resolveUIColor(Uy)}return t.paletteColor?n.resolveUIColor(t.paletteColor):"none"}));return{query:{hasTrendLines:()=>!!u.length&&a(),getData:()=>l,getStroke:m,getLineDash:e=>{const{style:t}=u[e]||{};return t.lineDash},getLabel:e=>(u[e]||{}).label,getType:e=>{const{qType:t}=u[e]||{};return s.get(_y.TYPES[t])},getMinMax:()=>{let t=1/0,n=-1/0;return u.forEach((r=>{const i=d.findMinMax(e.meta.size.y,r);t=Math.min(i.min,t),n=Math.max(i.max,n)})),{min:t,max:n}},getCalculatedValue:(e,t,n)=>{const r=u[e];return d.calculate(r,t,n)}},command:{update:()=>{l.length=0,u.forEach(((e,t)=>{const n=d.generate(e,t,c[t]);l.push(...n)}))}}}};var Gy={source:"trend",extract:{field:"x",props:{minor:{field:"y"},layer:{field:"layerId"},measureIndex:{field:"measureIndex"},dimValue:{field:"dimValue"}}}};const Yy=({meta:e})=>e.isContinuous?({scale:e,datum:t})=>e(t.value):e.isGroupedByMeasure?({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2:({scale:e,datum:t})=>e(t.value)+e.bandwidth()/2,Xy=(e,{layoutService:t,trendLineModel:n,dockService:r,animationsEnabled:i})=>{if(!n.query.hasTrendLines())return[];const o=(({majorScale:e,minorScale:t},{trendLineModel:n,layoutService:r,dockService:i,animationsEnabled:o})=>{const a=Yy(r);return{key:"trend-lines",type:"line",layout:{dock:"center"},data:Gy,settings:{connect:!0,orientation:i.meta.major.orientation,coordinates:{major:{scale:e,fn:a},minor:{scale:t},layerId:{ref:"layer"}},layers:{curve:"monotone",line:{strokeWidth:2,stroke:({datum:e})=>n.query.getStroke(e.layer.value),strokeDasharray:({datum:e})=>n.query.getLineDash(e.layer.value)}}},animations:{enabled:o,trackBy:Ud.nonUpdatingNode.trackBy,compensateForLayoutChanges:Ud.lines.compensateForLayoutChanges}}})(e,{trendLineModel:n,layoutService:t,dockService:r,animationsEnabled:i}),a=(({majorScale:e,minorScale:t,tooltipOverlay:n="trend-lines-tooltip-overlay"},{layoutService:r,dockService:i})=>{const o=Yy(r),a="horizontal"===i.meta.major.orientation,s={scale:e,fn:o},l={scale:t,ref:"minor"};return{key:n,type:"point",layout:{dock:"center"},data:Gy,settings:{x:a?s:l,y:a?l:s,opacity:0,size:1,sizeLimits:{maxPx:8,minPx:8}}}})(e,{layoutService:t,dockService:r});return[o,a]};function Jy(e,t){const{getLabel:n,getType:r,getLineDash:i,getStroke:o}=t.query;return({node:t,resources:a})=>{const s={type:"icon",style:{stroke:o(t.data.layer.value),"min-width":"16px","vertical-align":"middle","stroke-dasharray":i(t.data.layer.value)}},l={content:[{content:n(t.data.layer.value),style:{"font-weight":"bold"}},{content:r(t.data.layer.value)}],style:{"min-width":"136px"}};return{title:t.data.dimValue.label,row:[s,l,{content:a.formatter(e.formatter)(t.data.minor.value)}]}}}const Zy=16,Qy=2;function ev(e,t){return Array.isArray(t.content)?e("div",{style:{display:"flex","flex-direction":"column"}},t.content.map((t=>e("span",{style:t.style,direction:Se.detectTextDirection(t.content)},t.content)))):"icon"===t.type?function(e){const t=e("line",{x1:"0px",y1:`${Zy}px`,x2:`${Zy}px`,y2:"0px","stroke-width":"3px"});return e("svg",{xlms:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:`0 0 ${Zy} ${Zy}`},t)}(e):t.content}function tv(e,t){return({h:n,data:r,style:i})=>{const o=r[0].title,a=r.filter((e=>e.title===o)),s=function(e,t){const n=e("td",{colspan:3,style:{"font-weight":"bold"},direction:Se.detectTextDirection(t)},t);return e("tr",{},n)}(n,o),l=[s];if(a.slice(0,Qy).forEach((e=>{l.push(n("tr",{},function(e,{h:t,style:n}){return e.map((e=>{const r={style:{direction:"string"==typeof e.content?Se.detectTextDirection(e.content):void 0,...n.cell||{},...e.style||{}},class:e.class};e.colspan&&(r.colspan=e.colspan);const i=ev(t,e);return t("td",r,i)}))}(e.row,{h:n,style:i})))})),r.length>Qy){const i=r.length-Qy;l.push(...function(e,t,n,r){const i=t?t.get("Object.ChartTooltip.NMore",r):`+${r} more`,o=Se.detectTextDirection(i);return[e("tr",{},e("td",{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:3},"")),e("tr",{},e("td",{style:{"font-weight":"bold","text-align":n?"right":"left",direction:o},colspan:3},i))]}(n,e,t,i))}return l}}function nv(e,{trendLineModel:t,translator:n},r={}){if(!t.query.hasTrendLines())return!1;const{rtl:i}=r,o=be({key:e.tooltip,rtl:i});return Y(!0,o,{settings:{extract:Jy(e,t),content:tv(n,i),placement:"pointer",direction:r.rtl?"rtl":"ltr"}})}function rv(e,t){const n=t.element.getBoundingClientRect();return{x:(e.center?e.center.x:e.clientX)-n.left,y:(e.center?e.center.y:e.clientY)-n.top}}function iv(e,{chart:t,viewState:n,trendLineModel:r,layoutService:i,rtl:o}){const{isContinuous:a}=i.meta;let s={components:[{key:e.tooltipOverlay}],propagation:"stop"},l=e=>{const n=rv(e,t);return t.shapesAt(n,s)};if(a){const{getCalculatedValue:i}=r.query;s={components:[{key:"trend-lines"}],propagation:"stop"},l=(r,a)=>{const l=rv(r,t),u=t.shapesAt(function(e){return{cx:e.x,cy:e.y,r:3}}(l),s);if(u.length){const r=function(e,t,n,r){let i=(e.x-t.rect.computed.x)/t.rect.computed.width;i=r?1-i:i;const{min:o,max:a}=n.get("zoom");return o+(a-o)*i}(l,a,n,o),s=t.scale(e.majorInnerScale),c=(null!=s&&s.formatter?s.formatter():t.formatter({data:{fields:["qDimensionInfo/0"]}}))(r);u.forEach((e=>{e.data.dimValue.value=r,e.data.dimValue.label=c,e.data.minor.value=i(e.data.layer.value,r).y}))}return u}}return n=>{const r=t.component(e.tooltip);if(r&&(n=>t.componentsFromPoint({x:n.center?n.center.x:n.clientX,y:n.center?n.center.y:n.clientY}).some((t=>t.key===e.tooltipOverlay)))(n)){const e=l(n,r);return e.length?(r.emit("show",n,{nodes:e}),!0):(r.emit("hide"),!1)}return!1}}const ov=e=>{e.style.dashed?e.style.lineDash="8, 4":e.style.lineDash=""},av=e=>{ov(e),e.qMultiDimMode="Sum",e.qXColIx=0};function sv(e={}){const{translator:t,events:n={onGlobalChange:()=>{}},allowStackedByDimension:r=!1}=e;return{show:(e,t,{layout:n})=>!de.dimensionless(n)&&!de.groupedByDimension(n)&&(r||!de.stackedByDimension(n)),type:"array",ref:"qTrendLines",titleTranslation:_y.HEADER,itemTitleRef:e=>{const n=typeof e.label;return"string"===n&&e.label?e.label:"object"===n?e.label.qStringExpression?e.label.qStringExpression.qExpr:e.label.qValueExpression.qExpr:t.get(_y.TYPES[e.qType])},max:8,allowAdd:!0,allowRemove:!0,allowMove:!1,addTranslation:_y.ADD_BUTTON,add:av,globalChange:e=>{const t=tu(e,"qHyperCubeDef.qMeasures",[]).reduce(((e,t)=>(Array.isArray(t.qTrendLines)&&e.push(...t.qTrendLines),e)),[]),r=(e=>!tu(e,"dimensionAxis.continuousAuto",!1)&&e.preferContinuousAxis)(e)?"Possible":"Never";t.forEach((e=>{e.qContinuousXAxis=r})),n.onGlobalChange(e,t)},items:{label:{ref:"label",type:"string",expression:"optional",translation:"Common.Label",defaultValue:""},type:{ref:"qType",type:"string",component:"dropdown",translation:_y.TYPE,options:[{value:Ey,translation:_y.TYPES.AVERAGE},{value:Ty,translation:_y.TYPES.LINEAR},{value:Ay,translation:_y.TYPES.POLYNOMIAL2},{value:Ny,translation:_y.TYPES.POLYNOMIAL3},{value:ky,translation:_y.TYPES.POLYNOMIAL4},{value:Oy,translation:_y.TYPES.EXPONENTIAL},{value:Iy,translation:_y.TYPES.LOG},{value:Py,translation:_y.TYPES.POWER}],defaultValue:Ey},autoColor:{ref:"style.autoColor",type:"boolean",translation:"properties.colors",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},paletteColor:{ref:"style.paletteColor",translation:"properties.color",type:"object",component:"color-picker",dualOutput:!0,defaultValue:Uy,show:e=>!e.style.autoColor},dashed:{ref:"style.dashed",translation:_y.STYLE.DASHED,type:"boolean",defaultValue:!0,change:ov}}}}var lv={};function uv(){uv.init.call(this)}lv.isObject=function(e){return"object"==typeof e&&null!==e},lv.isNumber=function(e){return"number"==typeof e},lv.isUndefined=function(e){return void 0===e},lv.isFunction=function(e){return"function"==typeof e};var cv=uv;uv.EventEmitter=uv,uv.prototype._events=void 0,uv.prototype._maxListeners=void 0,uv.defaultMaxListeners=10,uv.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},uv.prototype.setMaxListeners=function(e){if(!lv.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},uv.prototype.emit=function(e){var t,n,r,i,o,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],lv.isUndefined(n))return!1;if(lv.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(lv.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(a=n.slice()).length,o=0;o<r;o++)a[o].apply(this,i)}return!0},uv.prototype.addListener=function(e,t){var n;if(!lv.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,lv.isFunction(t.listener)?t.listener:t),this._events[e]?lv.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,lv.isObject(this._events[e])&&!this._events[e].warned)&&((n=lv.isUndefined(this._maxListeners)?uv.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,lv.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),lv.isFunction(console.trace)&&console.trace()));return this},uv.prototype.on=uv.prototype.addListener,uv.prototype.once=function(e,t){if(!lv.isFunction(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},uv.prototype.removeListener=function(e,t){var n,r,i,o;if(!lv.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||lv.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(lv.isObject(n)){for(o=i;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},uv.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],lv.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},uv.prototype.listeners=function(e){return this._events&&this._events[e]?lv.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},uv.listenerCount=function(e,t){return e._events&&e._events[t]?lv.isFunction(e._events[t])?1:e._events[t].length:0};var dv=z(cv);const mv={shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]};const fv=e=>(Object.keys(dv.prototype).forEach((t=>{e[t]=dv.prototype[t]})),dv.init(e),e);function pv(){const[e]=b({}),[t]=b({}),n=function(){var e,t,n,r;const i=C(),o=g(),a=!(null==i||null===(e=i.qSelectionInfo)||void 0===e||!e.qInSelections),s=!(null==i||null===(t=i.qHyperCube)||void 0===t||null===(n=t.qDimensionInfo)||void 0===n||null===(r=n[0])||void 0===r||!r.qIsOneAndOnlyOne),[l,u]=b(!1),[c,d]=b(!1),[m,f]=b({key:"lasso",enabled:()=>!1,active:()=>!1,action:()=>!1}),p=e=>{d("boolean"==typeof e?e:!c)};return w((()=>(f({key:"lasso",action:p,enabled:()=>l,active:()=>c}),{key:"lasso",label:o.get(c?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),icon:mv,hidden:!l||!a||s,active:c,action:p})),[a,s,c,l,o.language()]),{get:()=>m,setAllows:e=>{u(!!e)}}}(),[r,i]=b();return M((()=>{const r={};r.scroll={key:"scroll",isActive:!0,isEnabled:!0,action(){this.isActive=!this.isActive},active(){return this.isActive},enabled(){const{layoutService:n,discrete:r}=e;return t.allowScroll&&((null==n?void 0:n.meta.isContinuous)||(null==r?void 0:r.query.getCanScroll()))}},r.interact={key:"interact",isEnabled:!0,enabled:()=>t.allowInteract},r.tooltip={key:"tooltip",isActive:!0,isEnabled:!0,action(e){this.isActive=!!e},active(){return this.isActive},enabled:()=>t.allowTooltip},r.select={key:"select",isActive:!1,isEnabled:!0,action(){this.isActive=!this.isActive},active(){return this.isActive},enabled:()=>t.allowSelect},r.lasso=n.get(),Object.keys(r).forEach((e=>fv(r[e]))),i(r)}),[]),M((()=>{r&&n&&(r.lasso={...r.lasso,...n.get()})}),[n]),{get:()=>r,setAllows:e=>{Object.assign(t,e),n.setAllows(null==e?void 0:e.allowSelect)},setContext:t=>{Object.assign(e,t)},destroy:()=>{Object.keys(r).forEach((e=>r[e].removeAllListeners()))}}}var hv={SPARK:{DEFAULT:7,SQUEEZE:7,LABELLESS:7},XSMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},SMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},MEDIUM:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},FULL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20}},gv={SCALE:{MAIN:{MINOR:"minor",MAJOR:"major",MAJOR_INNER:"majorInner",MAJOR_NUM:"majorNum",COLOR:"fill"},REDUCED:{MINOR:"miniMinor",MAJOR:"miniMajor",COLOR:"reducedFill"}},COMPONENT:{BAR:"bar",GHOST_BAR_OOB:"ghost-bar",STACK:"stack",BAR_AXIS:"bar-axis",GROUP_AXIS:"group-axis",BAR_OOB_MAX:"bar-oob-max",BAR_OOB_MIN:"bar-oob-min",STACK_TOTAL_BAR:"stack-total-bar",BASE_TOOLTIP:"tooltip",LEGEND_CAT_TOOLTIP:"legend-cat-tooltip",LEGEND_COLOR_CAT:"legend-color-cat",MEASURE_REF_LINE:"mes-ref-line",DIMENSION_REF_LINE:"dim-ref-line",MEASURE_REF_LINE_LABEL:"mes-ref-line-label",DIMENSION_REF_LINE_LABEL:"dim-ref-line-label",TREND_LINES_TOOLTIP:"trend-lines-tooltip",TREND_LINES_TOOLTIP_OVERLAY:"trend-lines-tooltip-overlay"},COLLECTION:{MAIN:"main-collection",MINI:"mini-collection",MINI_STACK:"mini-stack-collection",MINI_CONTINUOUS:"mini-continuous-collection",STACK_TOTAL:"stack-total-collection"},FORMATTER:{MINOR:"bar",COLOR:"fill"},STYLING:{AXIS:"axis"}};function yv({layout:e}){const t=oe.canBeContinuous(e),n=de.continuous(e),r=de.dimensionless(e);return{canBeContinuous:t,isDiscrete:!n,isContinuous:n,isTime:oe.isTime(n,e),isDimensionless:r,isSimple:de.simple(e),isGrouped:de.grouped(e),isGroupedByMeasure:de.groupedByMeasure(e),isGroupedByDimension:de.groupedByDimension(e),isStacked:de.stacked(e),isStackedByDimension:de.stackedByDimension(e),isStackedByMeasure:de.stackedByMeasure(e),isSnapshot:de.snapshot(e)}}const vv={extractDimsAndNode(e){const t=[];let n;return e.forEach((e=>{if(e.key===gv.COMPONENT.BAR){n=e;const r=tu(e,"data.selectionDimension",!1);r&&(t.push(r.label),r.label!==e.data.label&&t.push(e.data.label))}})),{nodeDims:t,node:n}}};function bv(e,t,n="/qHyperCubeDef"){return{fetch(){return function(e,t,n){return e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).catch(fe).then((e=>{var n;const r=t.getHyperCubeValue("qMode"),i=t.getHyperCubeValue("qDimensionInfo"),o="K"===r&&i.length>1&&(null===(n=e[0])||void 0===n?void 0:n.qIsReduced),a=e.slice(),s=t.getHyperCubeValue("qMeasureInfo"),l=o?[]:t.getHyperCubeValue("qColumnOrder");return{reducedCube:{qDataPages:a,qDimensionInfo:i.slice(),qEffectiveInterColumnSortOrder:[1,0],qMeasureInfo:o?[s[0],s[0]]:s.slice(),qStackedDataPages:[],qMode:"S",qHasOtherValues:t.getHyperCubeValue("qHasOtherValues"),qSize:t.getHyperCubeValue("qSize"),qColumnOrder:l}}}))}(e,t,this.settings())},settings(){const e=t.getHyperCubeValue("qDimensionInfo"),r=t.meta.isStacked&&e.length>1?1:0,i=t.getHyperCubeValue("qMeasureInfo");return{path:n,rect:{qTop:0,qLeft:r,qWidth:e.length+i.length+r,qHeight:Math.min(2e3,1e4/(i.length+1))},zoomLevel:-1,filter:"D1"}}}}function xv({enigma:e,layoutService:t,viewModel:n,definitionPath:r,reducedHyperCubePath:i},o={}){const a=bv(e,t,r),s=function(e,t="reducedHyperCube"){return{fetch:()=>Promise.resolve({reducedCube:e.getLayoutValue(t)||e.getHyperCube()})}}(t,i),l=function(e){return{fetch:()=>{const t=e.getHyperCube(),n={...t,qDataPages:t.qDataPages.slice()};return Promise.resolve({reducedCube:n})}}}(t),u=function({layoutService:e}){const{isSnapshot:t,isStackedByDimension:n}=e.meta,r=e=>{e.qDimensionInfo.unshift({key:"dummy-patch-dimension"})};return r.should=e=>t&&n&&1===e.qDimensionInfo.length,r}({layoutService:t}),c={mode:{isReduced:!1}};return{fetch(){if(t.meta.isSnapshot)return s.fetch();if(t.meta.isContinuous)return l.fetch();if(!t.meta.isStacked){if(t.getHyperCubeValue("qSize.qcy",NaN)===t.getHyperCubeValue("qDataPages.0.qArea.qHeight",NaN))return l.fetch()}return a.fetch()},model:()=>c,update(e){var r;u.should(e)&&u(e),c.mode=Y(c.mode,t.meta),c.mode.isReduced=e.qDataPages[0]&&e.qDataPages[0].qIsReduced,c.mode.isStackedByDimension=c.mode.isStacked&&(2===(r=e).qDimensionInfo.length&&2===r.qMeasureInfo.length),c.mode.isStackedByMeasure=c.mode.isStacked&&function(e){return e.qMeasureInfo.length>1&&1===e.qDimensionInfo.length}(e),c.fields={major:c.mode.isStackedByDimension?"qDimensionInfo/"+(e.qDimensionInfo.length-1):n.fields.major,majorGroup:n.fields.majorGroup,minor:c.mode.isStackedByDimension?e.qMeasureInfo.map(((e,t)=>`qMeasureInfo/${t}`)):n.fields.minor},c.scales={major:gv.SCALE.REDUCED.MAJOR,minor:gv.SCALE.REDUCED.MINOR},c.cube=e,o.qDataPages=e.qDataPages},fetchMinMaxData(){if(o.qDataPages)return Promise.resolve(o.qDataPages);let n=a.settings();const r="K"===t.getHyperCubeValue("qMode")?1:n.rect.qHeight;return n=Y(!0,{},n,{rect:{qHeight:r}}),e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).then((e=>e))},setSnapshotData(e){e.reducedHyperCube=c.cube}}}function qv({clearMinor:e,clearLegend:t,clearDiscrete:n,clearContinuous:r,selectionInfo:i}){t({componentName:"legendRangeBrush"}),e({eventName:"measureRange",componentName:"measureRangeBrush"}),n({eventName:"discreteRange",componentName:"discreteRangeBrush",brushName:!1}),"tap"!==i.event&&r({componentName:"continuousRangeBrush",brushName:!1})}const Mv=e=>{const t=e.qDimensionInfo.length;for(let n=0;n<t;n++){const r=e.qDimensionInfo[n];if(!(r.qLocked||r.qCardinalities.qHypercubeCardinal<=1&&n<t-1))return n}};function Sv({layout:e,defaultAuto:t}){return e.qHyperCube.qDimensionInfo.length>1?{mode:"byDimension",useDimColVal:!0,useBaseColors:"dimension",byDimDef:{activeDimensionIndex:1}}:e.qHyperCube.qMeasureInfo.length>1?{mode:"primary",useBaseColors:"measure",paletteColor:null}:t(e)}function Dv({picasso:e,chart:t,environment:n,viewState:r,viewCache:i}){const o=L(),a=E(),s=T(),l=A(),u=N(),c=D(),[d,m]=b(),[f,p]=b(),[h,g]=b(),y=k(),v=pv();return M((()=>{if(!t)return()=>{};const e=v.get(),n=function({chart:e,actions:t,selections:n}){const r=e.scale(gv.SCALE.MAIN.MAJOR);return Sd({chart:e,actions:t,selections:n,config:{allowSimultaneous:!0,brushRanges:!0,majorScale:r,selectionActions:{reset(){e.brushSelectionIncludeMax=void 0,t.lasso.active()&&t.lasso.action(!1)},clear:qv},custom:{getActions:()=>t},setBrushAliases({defaultFunc:e,brush:t}){e(),t.addKeyAlias("miniCube/qDimensionInfo/0","qHyperCube/qDimensionInfo/0"),t.addKeyAlias("miniCube/qDimensionInfo/1","qHyperCube/qDimensionInfo/1")}}})}({chart:t,actions:e,selections:u});return p(e),g(n),()=>{n.destroy(),v.destroy()}}),[t]),M((()=>{if(!y)return;const e={allowScroll:!y.active,allowInteract:!y.active,allowTooltip:!y.passive,allowSelect:!y.select&&!y.active};v.setAllows(e)}),[y]),M((()=>{if(!h||!n)return;const{theme:u,translator:d,localeInfo:p,flags:g,embed:y}=n,{direction:b="ltr"}=c,x=mu({source:o,metaAdditionsFn:yv,experimental:{filter:g.isEnabled("IM_1579_HIDE_DIM_MEA")}});h.setFilteredFields(x.meta.filteredFields);const q=function(e){return e.color.auto?e.qHyperCube.qDimensionInfo.length>1:"byDimension"===e.color.mode&&e.color.byDimDef&&e.color.byDimDef.activeDimensionIndex>-1}(x.getLayout())?mu({source:x.getLayout()}):void 0,M=function({layout:e,options:t={}}){return!(null==e||!e.snapshotData||t.freeResize)&&{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h}}({layout:o,options:c}),S=function({layoutService:e,viewCache:t,flags:n,options:r}){const i={};return i.fields=function(e){const{meta:t}=e,n={majorGroup:t.isGroupedByDimension?"qDimensionInfo/0":void 0,majorStack:t.isStacked?"qDimensionInfo/0":void 0,major:t.isDimensionless?void 0:"qDimensionInfo/"+(t.dimensionCount-1),majors:e.getHyperCubeValue("qDimensionInfo").map(((e,t)=>`qDimensionInfo/${t}`)),minor:e.getHyperCubeValue("qMeasureInfo").map(((e,t)=>`qMeasureInfo/${t}`))};return n.majorNumeric=`${t.isStackedByDimension?n.majorStack:n.major}:numeric`,n}(e),i.selectionDimensionIdx=Mv(e.getHyperCube()),i.isDimensionLocked=t=>e.getHyperCube().qDimensionInfo[t].qLocked,i.selectionDimensionProp=e=>void 0===i.selectionDimensionIdx||void 0!==e&&i.selectionDimensionIdx!==e?{}:{selectionDimension:{field:i.selectionDimensionIdx}},i.animations={enabled:()=>!1!==r.chartAnimations&&!!n.isEnabled("IM_1355_ANIMATIONS_BAR")&&!(i.animations.isPartialUpdating||i.animations.isSizeChanging||i.animations.hasSlicedHats)&&!Ud.propertiesHaveChanged({viewCache:t,layout:e.getLayout()}),isPartialUpdating:!1,isSizeChanging:!1,hasSlicedHats:!1},i}({layoutService:x,viewCache:i,flags:g,options:c}),D=function(e){var t=e.chart,n=e.layoutService,r=e.config,i=void 0===r?{}:r,o=e.typeConfig,a=void 0===o?{}:o;return("x-y"===a.type?Jl:eu)({chart:t,layoutService:n,config:i,typeConfig:a})}({chart:t,layoutService:x,config:{logicalSize:M,rtl:"rtl"===b},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0}}),C=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,a=void 0===o?[]:o,s=r.transform,l=void 0===s?[]:s,u=r.extend,c=void 0===u?[]:u,d={theme:t,matrix:Ad(a),styles:void 0};return d.styles=kd({theme:t,id:i,transform:l,extend:c,matrix:d.matrix}),{getStyles:function(){return d.styles},getTheme:function(){return d.theme},setTheme:function(e){d.theme=e,d.styles=kd({theme:e,id:i,transform:l,extend:c,matrix:d.matrix})}}}({theme:u,config:{id:"barChart",transform:[["label.value.fontSize",e=>parseInt(e,10)]]}}),w=function({layoutService:e,themeService:t,flags:n}){const r=t.getStyles(),i=t=>n.isEnabled("CLIENT_IM_747")?(e.getLayoutValue("components",[])||[]).find((e=>e.key===t)):void 0;return{axis:{title:{getStyle:()=>{var e,t,n,o,a,s,l,u,c,d,m,f,p;return{fontFamily:null!==(e=null===(t=i("axis"))||void 0===t||null===(n=t.axis)||void 0===n||null===(o=n.title)||void 0===o?void 0:o.fontFamily)&&void 0!==e?e:r.axis.title.fontFamily,fontSize:null!==(a=null===(s=i("axis"))||void 0===s||null===(l=s.axis)||void 0===l||null===(u=l.title)||void 0===u?void 0:u.fontSize)&&void 0!==a?a:r.axis.title.fontSize,color:null!==(c=null===(d=i("axis"))||void 0===d||null===(m=d.axis)||void 0===m||null===(f=m.title)||void 0===f||null===(p=f.color)||void 0===p?void 0:p.color)&&void 0!==c?c:r.axis.title.color}}},label:{getStyle:()=>{var e,t,n,o,a,s,l,u,c,d,m,f,p,h,g,y;return{fill:null!==(e=null===(t=i("axis"))||void 0===t||null===(n=t.axis)||void 0===n||null===(o=n.label)||void 0===o||null===(a=o.name)||void 0===a||null===(s=a.color)||void 0===s?void 0:s.color)&&void 0!==e?e:r.axis.label.name.color,fontSize:null!==(l=null===(u=i("axis"))||void 0===u||null===(c=u.axis)||void 0===c||null===(d=c.label)||void 0===d||null===(m=d.name)||void 0===m?void 0:m.fontSize)&&void 0!==l?l:r.axis.label.name.fontSize,fontFamily:null!==(f=null===(p=i("axis"))||void 0===p||null===(h=p.axis)||void 0===h||null===(g=h.label)||void 0===g||null===(y=g.name)||void 0===y?void 0:y.fontFamily)&&void 0!==f?f:r.axis.label.name.fontFamily}}}},legend:{title:{getStyle:()=>{var e,t,n,o,a,s,l,u,c,d,m,f,p;return{fontFamily:null!==(e=null===(t=i("legend"))||void 0===t||null===(n=t.legend)||void 0===n||null===(o=n.title)||void 0===o?void 0:o.fontFamily)&&void 0!==e?e:r.legend.title.fontFamily,fontSize:null!==(a=null===(s=i("legend"))||void 0===s||null===(l=s.legend)||void 0===l||null===(u=l.title)||void 0===u?void 0:u.fontSize)&&void 0!==a?a:r.legend.title.fontSize,color:null!==(c=null===(d=i("legend"))||void 0===d||null===(m=d.legend)||void 0===m||null===(f=m.title)||void 0===f||null===(p=f.color)||void 0===p?void 0:p.color)&&void 0!==c?c:r.legend.title.color}}},label:{getStyle:()=>{var e,t,n,o,a,s,l,u,c,d,m,f,p;return{fontFamily:null!==(e=null===(t=i("legend"))||void 0===t||null===(n=t.legend)||void 0===n||null===(o=n.label)||void 0===o?void 0:o.fontFamily)&&void 0!==e?e:r.legend.label.fontFamily,fontSize:null!==(a=null===(s=i("legend"))||void 0===s||null===(l=s.legend)||void 0===l||null===(u=l.label)||void 0===u?void 0:u.fontSize)&&void 0!==a?a:r.legend.label.fontSize,color:null!==(c=null===(d=i("legend"))||void 0===d||null===(m=d.legend)||void 0===m||null===(f=m.label)||void 0===f||null===(p=f.color)||void 0===p?void 0:p.color)&&void 0!==c?c:r.legend.label.color}}}},label:{getStyle:()=>{var e,t,n,o,a,s,l,u,c,d,m,f,p,h,g,y,v;return{fill:null!==(e=null===(t=i("label"))||void 0===t||null===(n=t.label)||void 0===n||null===(o=n.value)||void 0===o||null===(a=o.color)||void 0===a?void 0:a.color)&&void 0!==e?e:r.label.value.color,useContrastColor:null===(s=null===(l=i("label"))||void 0===l||null===(u=l.label)||void 0===u||null===(c=u.value)||void 0===c?void 0:c.useContrastColor)||void 0===s||s,fontSize:null!==(d=null===(m=i("label"))||void 0===m||null===(f=m.label)||void 0===f||null===(p=f.value)||void 0===p?void 0:p.fontSize)&&void 0!==d?d:r.label.value.fontSize,fontFamily:null!==(h=null===(g=i("label"))||void 0===g||null===(y=g.label)||void 0===y||null===(v=y.value)||void 0===v?void 0:v.fontFamily)&&void 0!==h?h:r.label.value.fontFamily}}}}}({layoutService:x,themeService:C,flags:g}),L=mh.model({model:a,layoutService:x,viewCache:i,viewState:r}),E=xv({enigma:a,layoutService:x,viewModel:S});!function({layoutService:e,viewState:t,viewStateOptions:n={}}){const r=e.meta.isSnapshot?e.getLayoutValue("snapshotData.content.chartData",{}):n;t.preventSet("scrollOffset",r.scrollOffset),t.preventSet("legendScrollOffset",r.legendScrollOffset||0),r.zoom&&t.preventSet("zoom",r.zoom)}({layoutService:x,viewState:r,viewStateOptions:null==c?void 0:c.viewState});const T=function({app:e,model:t,translator:n,picasso:r,localeInfo:i,theme:o,continuousDataModel:a,layoutService:s,legendLayoutService:l,reducedDataModel:u}){const{isContinuous:c,isStacked:d}=s.meta,m={main:void 0,mini:{getScales:()=>({}),getColor:()=>e=>e,getDatumProps:()=>({}),getAuxiliarySettings:()=>{}}};return{initialize:()=>{const f=[],{isReduced:p}=u.model().mode,h=c||p||d,g=!c&&(p||d)&&l?l.getHyperCube():void 0,y=g?"legendCube":void 0;return m.main=$l({app:e,model:t,translator:n,picasso:r,layoutService:s,config:{localeInfo:i,auto:Sv,key:gv.SCALE.MAIN.COLOR},createConfig:()=>({hc:h?g||s.getHyperCube():u.model().cube,source:h?y:"miniCube",theme:o})}),f.push(m.main.initialize()),c&&(m.mini=$l({app:e,model:t,translator:n,picasso:r,layoutService:s,config:{localeInfo:i,auto:Sv,key:gv.SCALE.REDUCED.COLOR},createConfig:()=>({layout:a.getInitialLayout(),hc:a.getInitialCube(),source:"miniCube",theme:o})}),f.push(m.mini.initialize())),Promise.all(f)},getMain:()=>m.main,getMini:()=>m.mini}}({picasso:e,model:a,app:s,translator:d,localeInfo:p,theme:u,continuousDataModel:L,layoutService:x,legendLayoutService:q,reducedDataModel:E}),A=Ky({layoutService:x,viewState:r,colorModel:{settings:()=>T.getMain().getSettings(),resolveUIColor:e=>T.getMain().getPaletteColor(e)},chart:t,env:n,keys:{colorScale:gv.SCALE.MAIN.COLOR},isEnabled:()=>!x.meta.isGroupedByDimension&&(!x.meta.isStackedByDimension||g.isEnabled("TRENDLINES_STACKED_DIM"))&&!x.meta.isDimensionless});Ig.attrExpr.updateProperties(a,o);const N=function({layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:wg,miniChartToken:{},embed:s}}({layout:o,app:s,model:a,picasso:e,chart:t,translator:d,localeInfo:p,embed:y,extractDimsAndNode:vv.extractDimsAndNode});let k;x.meta.isDiscrete&&(k=Ly({chart:t,actions:f,componentKey:gv.COMPONENT.BAR,enigmaModel:a,layoutService:x,dockService:D,trendLineModel:A,itemWidths:hv,viewState:r,rtl:"rtl"===b,options:{axisKey:gv.COMPONENT.BAR_AXIS,renderer:e.renderer("svg")()}}));const O=tm({layoutService:x,discreteModel:k}),I=function(e){return{layout:e.getLayout(),keys:{SCALE:{MAIN:{MINOR:gv.SCALE.MAIN.MINOR,MAJOR:gv.SCALE.MAIN.MAJOR}},COMPONENT:{BAR:gv.COMPONENT.BAR,BAR_AXIS:gv.COMPONENT.BAR_AXIS,Y_AXIS:"y-axis",MEASURE_TITLE:"measure-title",DIMENSION_TITLE:"dimension-title"},COLLECTION:{MAIN:gv.COLLECTION.MAIN}}}}(x),P=function(e){var t=e.picassoInstance,n=e.plugins,r=e.pluginArgs,i=void 0===r?{}:r,o={initialized:!1,definitions:[]};return{initialize:function(){return Ya(Wa().mark((function e(){var r,a,s,l;return Wa().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o.initialized){e.next=2;break}return e.abrupt("return");case 2:return a=Promise.all(n.filter((function(e){return"custom-component"===e.info.type})).map(function(){var e=Ya(Wa().mark((function e(n){var r;return Wa().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.info.componentName){e.next=2;break}throw new Error("plugin-service: Custom component is missing componentName");case 2:return e.next=4,n.fn($a({},i));case 4:if("object"===Ka(r=e.sent)){e.next=7;break}throw new Error("plugin-service: Custom component needs to be an object");case 7:t.component(n.info.componentName,r);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())),s=Promise.all(n.filter((function(e){return"component-definition"===e.info.type})).map((function(e){return e.fn($a({},i))}))),e.next=6,Promise.all([a,s]);case 6:l=e.sent,o.initialized=!0,(r=o.definitions).push.apply(r,Qa(l[1]));case 9:case"end":return e.stop()}}),e)})))()},extendComponents:function(e){return o.initialized?(o.definitions.filter(Boolean).forEach((function(t){var n=Za(e.filter((function(e){return e.key&&e.key===t.key})),1)[0];if(n){var r=cs(!0,{},n.brush);cs(!0,n,t),t.brush&&(n.brush=function(e,t){return"object"===Ka(e)&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=fu({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=fu({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(r,t.brush))}else e.push(t)})),e):e}}}({picassoInstance:e,plugins:l||[],pluginArgs:I});v.setContext({discrete:k,layoutService:x}),m({discrete:k,continuous:mh,legendLayoutService:q,layoutService:x,viewModel:S,dockService:D,themeService:C,styleService:w,continuousDataModel:L,reducedDataModel:E,colorService:T,trendLineModel:A,refLineModel:O,pluginService:P,customTooltipModel:N,selectionService:h,logicalSize:M})}),[h,c,n,o]),d}function Cv(e){return e.qIsOtherCell||-3===e.qElemNumber||-3===e.qElemNo}function wv(e){return e.some(Cv)}function Lv(e,t){let n=NaN,r=NaN;return e.forEach((e=>{wv(e)||e.slice(-t).forEach((e=>{"NaN"!==e.qNum&&(n=Number.isNaN(n)?e.qNum:Math.min(e.qNum,n),r=Number.isNaN(r)?e.qNum:Math.max(e.qNum,r))}))})),{min:n,max:r}}function Ev(e){let t=NaN,n=NaN;if(!e.getLayoutValue("measureAxis.autoMinMax",!1)){const r=e.getLayoutValue("measureAxis.minMax");"min"!==r&&"minMax"!==r||(t=+e.getLayoutValue("measureAxis.min")),"max"!==r&&"minMax"!==r||(n=+e.getLayoutValue("measureAxis.max"))}return{min:t,max:n,isExplicitMin:!Number.isNaN(t),isExplicitMax:!Number.isNaN(n)}}function Tv(e,t){let n=NaN,r=NaN;return e.forEach((e=>{if(!wv(e)){let i=0,o=0;e.slice(-t).forEach((e=>{"NaN"!==e.qNum&&(e.qNum>=0?o+=e.qNum:i+=e.qNum)})),n=Number.isNaN(n)?i:Math.min(i,n),r=Number.isNaN(r)?o:Math.max(o,r)}})),{min:n,max:r}}function Av(e,t){const n={};e.forEach((e=>{if(!wv(e)){const r=e[0].qElemNumber;n[r]=n[r]?n[r]:{min:0,max:0,cId:r},e.slice(t).forEach((e=>{"NaN"!==e.qNum&&(e.qNum>=0?n[r].max+=e.qNum:n[r].min+=e.qNum)}))}}));let r=NaN,i=NaN;return Object.keys(n).forEach((e=>{r=Number.isNaN(r)?n[e].min:Math.min(n[e].min,r),i=Number.isNaN(i)?n[e].max:Math.max(n[e].max,i)})),{min:r,max:i}}function Nv(e){return"number"==typeof e&&!Number.isNaN(e)}function kv(e){const t=e.getHyperCubeValue("qMeasureInfo");return{min:Math.min(...t.filter((e=>Nv(e.qMin))).map((e=>e.qMin))),max:Math.max(...t.filter((e=>Nv(e.qMax))).map((e=>e.qMax)))}}function Ov(e,t,n){for(let n=e.length-1;n>-1;n--)if(t(e[n]))return e[n];return n}function Iv(e){return!Number.isNaN(+e.qNum)}function Pv(e){return e.qNum}function Rv(e){return!Number.isNaN(+e.qNum)}function Fv(e){return e.qNum}function Hv(e,t){return e.push(...t),e}const{getValueWithOffset:zv,isNumber:jv}=ia,Bv=5,Vv=.2;function _v(e,t){return Math.abs(e/t)<Bv||0===t}function Uv({layoutService:e,trendLineModel:t},n={}){const{stackedByMeasureExtractor:r=Tv,stackedByDimensionExtractor:i=Av,straightExtractor:o=Lv,measureInfoExtractor:a=kv,explicitExtractor:s=Ev}=n,{meta:l}=e;return{extract({qDataPages:e,qStackedDataPages:n,others:r,count:i}){let o,a;if(Array.isArray(n)?({min:o,max:a}=this.extractFromStacked(n)):({min:o,max:a}=this.extractFromStraight(e,i)),t.query.hasTrendLines()){const{min:e,max:n}=t.query.getMinMax();o=Number.isFinite(e)?Math.min(o,e):o,a=Number.isFinite(n)?Math.max(a,n):a}const{min:s,max:l}=this.extractOthers(r),u=this.extractExplicit(),c=[0,o,a].filter((e=>jv(e)));let d=Math.min(...c),m=Math.max(...c);d=_v(s,d)?Math.min(d,s):d,m=_v(l,m)?Math.max(m,l):m;const f=[u.explicitMin,u.explicitMax,d,m].filter((e=>jv(e)));return o=Number.isNaN(u.explicitMin)?Math.min(...f):u.explicitMin,a=Number.isNaN(u.explicitMax)?Math.max(...f):u.explicitMax,o===a&&(Number.isNaN(u.explicitMin)?o=zv(o,-Vv):Number.isNaN(u.explicitMax)&&(a=zv(a,Vv))),{min:o,max:a,implicitMin:d,implicitMax:m,otherMin:s,otherMax:l,hasOtherMin:s<o,hasOtherMax:l>a,...u}},extractExplicit(){const{min:t,max:n,isExplicitMin:r,isExplicitMax:i}=s(e);return{hasExplicitMinMax:r||i,hasExplicitMin:r,hasExplicitMax:i,explicitMin:t,explicitMax:n}},extractFromStacked(e){const t=e.length?e[0].qData:[];return(n=t).length?{min:Math.min(...n[0].qSubNodes.map((e=>e.qMinNeg))),max:Math.max(...n[0].qSubNodes.map((e=>e.qMaxPos)))}:{min:0,max:0};var n},extractFromStraight(t,n){const s=t.length?t[0].qMatrix:[];return l.isStackedByMeasure?r(s,n):l.isStackedByDimension?i(s,n):e.getHyperCubeValue("qHasOtherValues")?o(s,n):a(e)},extractOthers:e=>l.isStackedByDimension?function(e){const t=Ov(tu(e,"0.qData.0.qSubNodes",[]),Cv,{qMaxPos:0,qMinNeg:0});return{min:t.qMinNeg,max:t.qMaxPos}}(e):l.isGroupedByDimension?function(e){const t=tu(e,"0.qMatrix",[]).filter(wv).reduce(Hv,[]).filter(Rv).map(Fv);return{min:Math.min(0,...t),max:Math.max(0,...t)}}(e):function(e){const t=Ov(tu(e,"0.qMatrix",[]),wv,[]).filter(Iv).map(Pv);return{min:Math.min(0,...t),max:Math.max(0,...t)}}(e)}}function $v(e){const t=function({reducedDataModel:e,layoutService:t,continuousDataModel:n}){const{meta:r,getHyperCubeValue:i}=t,o=e=>!e.length&&r.mode.K,a=e=>{const t=i("qStackedDataPages",[]);return{qStackedDataPages:t,others:e?t:[]}};return{resolve(){const t=i("qMeasureInfo").length,s=i("qDimensionInfo").length,l=i("qHasOtherValues");if(!r.isStacked&&!l)return Promise.resolve({qDataPages:[{}],count:t});if(r.isContinuous){const e=r.isStackedByDimension?s:t;return n.fetchMinMaxData().then((t=>({qDataPages:t,count:e})))}const u=r.isStackedByDimension?1:t;return e.fetchMinMaxData().then((e=>{if(o(e))return a(l);let t=[];return l&&(t=r.mode.K?i("qStackedDataPages",[]):i("qDataPages",[])),{qDataPages:e,count:u,others:t}}))}}}(e),n=Uv(e);return t.resolve().then((e=>n.extract(e)))}const Wv=({key:e,components:t})=>({key:e,type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:t},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}}),Kv="lasso",Gv=({key:e,componentTargetKey:t,requireFailure:n,recognizeWith:r},i)=>({key:`event:${e}`,type:"Pan",requireFailure:n,recognizeWith:r,options:{event:Kv,enable(e,n){if(this.started===Kv||!n)return!0;if(!i.actions.select.enabled()||!i.actions.lasso.enabled()||!i.actions.lasso.active())return!1;return this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter((e=>e.key===t)).length>0}},events:{lassostart(t){t.preventDefault(),this.started!==Kv&&(i.actions.select.emit("start",Kv),this.chart.component(e).emit("lassoStart",t),this.started=Kv)},lassomove(t){t.preventDefault(),this.chart.component(e).emit("lassoMove",t),"function"==typeof i.updateOnMove&&i.updateOnMove(this.chart)},lassoend(t){t.preventDefault(),this.started=!1,this.chart.component(e).emit("lassoEnd",t),i.actions.select.emit("end",Kv),"function"==typeof i.updateOnEnd&&i.updateOnEnd()}}});const Yv=({targets:e,requireFailure:t,recognizeWith:n,components:r,eventName:i="tap"},o)=>{let a;const s=o.customTooltipModel?o.customTooltipModel.utils:void 0,l=s?o.debouncer(s.displayTooltip,s.DEBOUNCE_THRESHOLD):void 0;return{key:"event:tap",type:"Tap",requireFailure:t,recognizeWith:n,options:{event:i,interval:10,pointers:1,enable(t,n){return!n||!(!o.actions.select.enabled()&&!o.actions.tooltip.enabled())&&(a=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter((t=>-1!==e.indexOf(t.key))),a.length>0)}},events:{[i](t){t.preventDefault();const n=function(e,t){const n=t.element.getBoundingClientRect();let r,i;return e.center?(({x:r}=e.center),({y:i}=e.center)):(r=e.clientX,i=e.clientY),{x:r-n.left,y:i-n.top}}(t,this.chart),u=o.hitRadius?o.hitRadius(a):0,c=u>0?{cx:n.x,cy:n.y,r:u}:n,d=o.shapesAt?o.shapesAt(c):this.chart.shapesAt(c,{components:e.map((e=>({key:e,propagation:"stop"}))),propagation:"stop"}),m=this.chart.component("tooltip"),f="mouse"!==t.pointerType&&m&&m.show;if(!o.isLocked(a)&&!o.tooltipOnly&&o.actions.select.enabled()){const e=this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}),n=e.some((e=>"legend-cat"===e.type));if(!d.length&&n||(this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1,o.actions.select.emit("start",i,e)),d.length&&r){this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1;const e="function"==typeof r?r(t,d):r;this.chart.brushFromShapes(d,{components:e}),o.actions.select.emit("end",i),(({largeDataService:e,chart:t})=>{((null==e?void 0:e.meta)||{}).isLargeNumPoints&&t.brush("lazySelection")._state(t.brush("selection")._state())})({largeDataService:o.largeDataService,chart:this.chart})}}if(m&&o.actions.tooltip.enabled())if(d.length){const{customTooltipModel:e}=o;if(null!=e&&e.useCustomTooltip&&s.checkIfPromisesExist({customTooltipModel:e})){const n=s.getNodes(t,this.chart);l(t,m,{nodes:n,opts:o,customTooltipModel:e})}else m.emit("show",t,{nodes:d})}else f&&m.emit("hide")}}}};const Xv=({key:e,requireFailure:t,recognizeWith:n,eventName:r="tap"},i)=>({prio:1,key:`event:${e}-tap`,type:"Tap",requireFailure:t,recognizeWith:n,options:{event:`${r}-${e}-tap`,interval:10,pointers:1,enable:(t,n)=>!!n&&(!!i.actions.select.enabled()&&(!(!n.target||"INPUT"!==n.target.nodeName)||!(!n.target||!n.target.hasAttribute("data-other-value"))&&(n.target.getAttribute("data-key")||"").split("-bubble")[0]===e))},events:{[`${r}-${e}-tap`](t){(t.target.getAttribute("data-key")||"").split("-bubble")[0]&&(t.preventDefault(),this.chart.component(e).emit("bubbleStart",t))}}});const Jv=({eventName:e,key:t,fillTargets:n=[],requireFailure:r,recognizeWith:i},o,a)=>({key:`event:${t}`,type:"Pan",requireFailure:r,recognizeWith:i,options:{event:e,enable(r,i){if(this.started===e||!i)return!0;if(!o.actions.select.enabled())return!1;const a=this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter((e=>-1!==n.indexOf(e.key))),s=0===a.length&&function(e,t){const{target:n}=e.srcEvent;return!(!n||0!==(n.getAttribute("data-key")||"").indexOf(`${t}-`))}(i,t);return s?(this.started=e,!0):a.length>0}},events:{[`${e}start`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),o.actions.select.emit("start",e),this.chart.component(t).emit(`${a}Start`,n),this.started=e},[`${e}move`](e){e.preventDefault(),this.chart.component(t).emit(`${a}Move`,e),"function"==typeof o.updateOnMove&&o.updateOnMove(this.chart)},[`${e}end`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),this.chart.component(t).emit(`${a}End`,n),o.actions.select.emit("end",e),this.started=!1,"function"==typeof o.updateOnEnd&&o.updateOnEnd()}}});function Zv(e,t){const n=function(e){const{key:t,targets:n,fillTargets:r,targetSelector:i,targetFillSelector:o,dock:a,scale:s,bubblesPlacement:l="inside",observeBrush:u=!1,multiple:c=!1,toLabel:d,onEdited:m}=e;return{key:t,type:"brush-range",layout:{dock:n.map((e=>`@${e}`)).join(",")},on:m?{bubbleEnd(){m()}}:{},settings:{brush:u?{context:"selection",observe:!0}:"selection",scale:s,multiple:c,direction:"left"===a||"right"===a?"vertical":"horizontal",bubbles:{align:"left"===a||"top"===a?"end":"start",placement:l,label:d},target:{components:r,selector:i,fillSelector:o,fill:"rgba(82,204,82,0.2)"}}}}(e),r=Jv(e,t,"range");return{interactions:[e.onEdited?Xv(e,t):null,r].filter(Boolean),components:[n]}}const Qv={refLines:{minimumLayoutMode:"SPARK"},measureAxisTitle:{minimumLayoutMode:"XSMALL"},dimensionAxisTitle:{minimumLayoutMode:"XSMALL"},measureAxis:{minimumLayoutMode:"XSMALL"},dimensionAxis:{minimumLayoutMode:"XSMALL"},gridLines:{minimumLayoutMode:"XSMALL"},refLinesLabels:{minimumLayoutMode:"SMALL"},horizontalDimensionAxis:{minimumLayoutMode:{width:"XSMALL",height:"SMALL"}},verticalDimensionAxis:{minimumLayoutMode:{width:"SMALL",height:"XSMALL"}},horizontalDimensionAxisTitle:{minimumLayoutMode:{width:"XSMALL",height:"MEDIUM"}},verticalDimensionAxisTitle:{minimumLayoutMode:{width:"MEDIUM",height:"XSMALL"}}},eb="inner-time-axis",tb="outer-time-axis";const nb={getMaxGlyphCount(e,t){const{qDimensionInfo:n}=e,{qApprMaxGlyphCount:r}=n[t];return r},getDimensionSize(e){var t;const n=null==e||null===(t=e.qCardinalities)||void 0===t?void 0:t.qHypercubeCardinal,{qLocked:r=0,qOption:i=0,qSelected:o=0}=(null==e?void 0:e.qStateCounts)||{};return[void 0,0].includes(n)?r+i+o:n}},rb={getMajorAxisMaxGlyphCount(e,t){let n=0;if(e.qDimensionInfo.length){const r=t?0:e.qDimensionInfo.length-1;n=nb.getMaxGlyphCount(e,r)}else e.qMeasureInfo.forEach((e=>{n=Math.max(n,e.qFallbackTitle.length)}));return n},getAxisData(e,t){let n;return n=e.qDimensionInfo.length?tu(e,t?"qStackedDataPages.0.qData.0.qSubNodes":"qDataPages.0.qMatrix"):e.qMeasureInfo,n},getBarAxisMaxGlyphCount(e,t){if(!e)return;const n=rb.getAxisData(e,t),r=!e.qDimensionInfo.length,i=r||t?void 0:e.qDimensionInfo.length-1,o=rb.getMajorAxisMaxGlyphCount(e,t),a=r?"qFallbackTitle":"qText";return ge.getAdjustedMaxGlyphCount(o,n,i,a)},getGroupAxisMaxGlyphCount(e){if(!e)return;const t=rb.getAxisData(e),n=nb.getMaxGlyphCount(e,0);return ge.getAdjustedMaxGlyphCount(n,t,0)}};var ib={LOWERGLYPHCOUNT:3,UPPERGLYPHCOUNT:13};function ob(e,t,n,r){const{meta:i}=t.layoutService,o=[],a=!("none"===e.measureAxis.show),s=!("title"===e.measureAxis.show);i.isContinuous?o.push(...function(e,t,n,r){const{meta:i}=t.layoutService,{axis:o,grid:a}=t.themeService.getStyles(),s=t.styleService.axis.label.getStyle(),{auto:l,spacing:u}=t.layoutService.getLayoutValue("gridLine",{}),c=[],d="none"!==e.dimensionAxis.show&&"title"!==e.dimensionAxis.show,m=Qv[`${t.dockService.meta.major.orientation}DimensionAxis`].minimumLayoutMode,f={type:"grid-line",x:{},layout:{minimumLayoutMode:Qv.gridLines.minimumLayoutMode},ticks:{stroke:a.line.major.color},minorTicks:{show:!1,stroke:a.line.minor.color},animations:{enabled:t.viewModel.animations.enabled,trackBy:Ud.lines.trackBy,compensateForLayoutChanges:Ud.lines.compensateForLayoutChanges}},p=!!e.showMiniChartForContinuousAxis&&{type:"range",key:"range-brush-highlighter",layout:{dock:"@scrollbar"},settings:{scale:t.reducedDataModel.scales.major,brush:"selection",fill:"#6CB33F",opacity:.2}};if(i.isTime){if(d){const e=n?"end":"start",r=n?1:0,i="bottom"===t.dockService.meta.major.dock?0:1,a={label:{fill:s.fill,fontSize:s.fontSize,fontFamily:s.fontFamily},majorGuideLine:{stroke:o.line.major.color},minorGuideLine:{stroke:o.line.minor.color}},d={type:"time-axis",renderer:"svg",layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:m},preferredSize:()=>({size:2*parseFloat(s.fontSize),edgeBleed:{left:1,right:1}}),settings:{anchor:e,label:{align:i,justify:r},guideLine:{major:{justify:r},minor:{align:i}}},style:a,animations:{enabled:t.viewModel.animations.enabled,trackBy:Ud.axes.trackBy({isTime:!0}),compensateForLayoutChanges:Ud.axes.compensateForLayoutChanges({isTime:!0})}};c.push(Y(!0,{},d,{key:eb,scale:gv.SCALE.MAIN.MAJOR_INNER,settings:{guideLine:{minor:{show:!0}},line:{show:!l&&0===u}},style:Y(!0,{},a,{line:{stroke:o.line.major.color},majorGuideLine:{stroke:o.line.minor.color},minorGuideLine:{stroke:o.line.major.color}})})),c.push(Y(!0,{},d,{key:tb,scale:gv.SCALE.MAIN.MAJOR,settings:{guideLine:{minor:{show:!1}},line:{show:!1}}})),c.push({type:"axis-overlay",key:"outer-axis-overlay",scale:gv.SCALE.MAIN.MAJOR,layout:{dock:`@${tb}`,minimumLayoutMode:m}}),c.push({type:"axis-overlay",key:"inner-axis-overlay",scale:gv.SCALE.MAIN.MAJOR_INNER,layout:{dock:`@${eb}`,minimumLayoutMode:m}}),c.push(p)}return c.push(Y(!0,{},f,{key:"inner-time-grid",x:{scale:gv.SCALE.MAIN.MAJOR_INNER},ticks:{stroke:a.line.minor.color}})),c.push(Y(!0,{},f,{key:"outer-time-grid",x:{scale:gv.SCALE.MAIN.MAJOR}})),c}if(i.isContinuous){const e="continuous-axis";d&&(c.push({type:"axis",key:e,renderer:om(t.flags),scale:gv.SCALE.MAIN.MAJOR,layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:m},settings:{labels:{align:0,offset:4,fill:s.fill,fontSize:s.fontSize,fontFamily:s.fontFamily},ticks:{show:!0,stroke:o.line.major.color},line:{show:!r},minorTicks:{show:!1}},animations:{enabled:t.viewModel.animations.enabled,trackBy:Ud.axes.trackBy({isContinuous:!0}),compensateForLayoutChanges:Ud.axes.compensateForLayoutChanges({isContinuous:!0})}}),c.push({type:"axis-overlay",key:"inner-axis-overlay",scale:gv.SCALE.MAIN.MAJOR,layout:{dock:`@${e}`,minimumLayoutMode:m}}),c.push(p)),c.push(Y(!0,{},f,{key:"continuous-grid",x:{scale:gv.SCALE.MAIN.MAJOR},minorTicks:{show:!0}}))}return c}(e,t,n,r)):o.push(...function(e,t,n,r){if("none"===e.dimensionAxis.show)return[];const{meta:i}=t.layoutService,o=t.themeService.getStyles(),a=[],s=function(e,t){return!t.layoutService.meta.isGroupedByDimension||!e.legend.show||t.colorService.getMain().getSettings().field!==t.viewModel.fields.major}(e,t),l=function(e,t){return!(!t.layoutService.meta.isGroupedByDimension||e.legend.show&&t.colorService.getMain().getSettings().field===t.viewModel.fields.majorGroup)}(e,t),u="horizontal"===t.dockService.meta.major.orientation,c=u?e.dimensionAxis.label:"auto",d="horizontal"===c?void 0:t.dockService.meta.minor.size/4,m=t.styleService.axis.label.getStyle(),f={type:"axis",renderer:om(t.flags),layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:Qv[`${t.dockService.meta.major.orientation}DimensionAxis`].minimumLayoutMode},settings:{labels:{show:!("title"===e.dimensionAxis.show),mode:c,tiltAngle:n?-40:40,maxEdgeBleed:50,maxLengthPx:d,...m},line:{show:!r,stroke:o.axis.line.major.color}},brush:{consume:[{context:"selection",data:["selectionDimension","axisSelectionDimension"],style:{inactive:{opacity:.3}}}]},animations:{enabled:t.viewModel.animations.enabled,trackBy:Ud.axes.trackBy({isMajor:!0}),compensateForLayoutChanges:Ud.axes.compensateForLayoutChanges({isHorizontal:u})}};l&&a.push(Y(!0,{},f,{key:"group-axis",scale:gv.SCALE.MAIN.MAJOR_INNER,settings:{paddingEnd:s?10:4,labels:{mode:s?"horizontal":f.settings.labels.mode,maxGlyphCount:rb.getGroupAxisMaxGlyphCount(e.qHyperCube),maxLengthPx:d},line:{show:(u||!s)&&f.settings.line.show}}}));const p=rb.getBarAxisMaxGlyphCount(e.qHyperCube,i.isStackedByDimension);return s&&a.push(Y(!0,{},f,{key:gv.COMPONENT.BAR_AXIS,scale:gv.SCALE.MAIN.MAJOR,settings:{paddingEnd:4,labels:{maxGlyphCount:p,maxLengthPx:d,tiltThreshold:p>ib.LOWERGLYPHCOUNT&&p<ib.UPPERGLYPHCOUNT?1:void 0},line:{show:!(u&&l)&&f.settings.line.show}}})),u||2!==a.length?a:[a[1],a[0]]}(e,t,n,r));const l=t.themeService.getStyles(),u=t.styleService.axis.label.getStyle();return a&&o.push({type:"axis",key:"y-axis",renderer:om(t.flags),formatter:gv.FORMATTER.MINOR,layout:{dock:t.dockService.meta.minor.dock,minimumLayoutMode:Qv.measureAxis.minimumLayoutMode},scale:gv.SCALE.MAIN.MINOR,settings:{labels:{show:s,...u},line:{stroke:l.axis.line.major.color},ticks:{stroke:l.axis.line.major.color},minorTicks:{stroke:l.axis.line.minor.color}},animations:{enabled:t.viewModel.animations.enabled,trackBy:Ud.axes.trackBy({isMeasure:!0}),compensateForLayoutChanges:Ud.axes.compensateForLayoutChanges({isMeasure:!0,dock:t.dockService.meta.minor.dock})}}),o}var ab={BAR:{WIDTH:.7,STROKE:{COLOR:"#205891",WIDTH:{NONE:0,SMALL:1,MEDIUM:2,LARGE:4}}}};const sb=.7,lb=.9;function ub({layoutService:e,discrete:t,componentKey:n}){var r;const{isContinuous:i,isGrouped:o}=e.meta;if(i)return 1;const a=(e.getLayoutValue("components",[])||[]).filter((e=>e.key===n))[0];if(null!=a&&null!==(r=a.style)&&void 0!==r&&r.width){const{style:e}=a;return e.strokeWidth&&"none"!==e.strokeWidth?function(){const n=ab.BAR.STROKE.WIDTH[e.strokeWidth.toUpperCase()]/t.query.getItemSize(),r=e.width+n;return r>1?e.width-(r-1):e.width}:e.width}return o?lb:sb}const cb={FULL:16,MEDIUM:14,SMALL:12,XSMALL:8,SPARK:4};function db(e,t,n={}){return({data:r})=>{const i=e.chart.component(t).rect;if(!r.items.length||!i)return 2;const{min:o,max:a}=e.viewState.get("zoom");if(n[[o,a]])return n[[o,a]];const s=cb[te.getLayoutMode(i.width,Number.MAX_VALUE)];n={};const l=Math.abs(a-o),u=Math.abs(e.viewCache.get("continuousMax")-e.viewCache.get("continuousMin"));if(0===u)return s;const c=function(e,t,n){return e*(1-n)+t*n}(2,s,1-Math.min(l/u/.2,1));return n[[o,a]]=Math.max(2,Math.min(s,c)),n[[o,a]]}}function mb(e,t){const{hasExplicitMax:n,explicitMax:r}=t;return!!n&&e>r&&r<=0}function fb(e,t){const{hasExplicitMin:n,explicitMin:r}=t;return!!n&&e<r&&r>=0}function pb(e,t){const{hasExplicitMax:n,explicitMax:r}=t;return!!n&&e>r&&r>0}function hb(e,t){const{hasExplicitMin:n,explicitMin:r}=t;return!!n&&e<r&&r<0}const gb={MAX:"max",MIN:"min"},yb={min:"Min",max:"Max"};function vb(e,t,n){return void 0===n?mb(e,t)||fb(e,t):n===gb.MAX?mb(e,t):fb(e,t)}function bb({minorMinMax:e,type:t}){return!(function({minorMinMax:e,type:t}){return!e[`hasExplicit${yb[t]}`]}({minorMinMax:e,type:t})||function({minorMinMax:e,type:t}){const n=t===gb.MAX?e.implicitMax:e.implicitMin;return!vb(Number(n.toFixed(13)),e,t)}({minorMinMax:e,type:t}))}function xb(e,{barComponent:t,type:n,isStacked:r}){const{viewCache:i,dockService:o,themeService:a}=e,s=i.get("minorMinMax");if(!s.hasExplicitMinMax)return!1;const l=n===gb.MAX?s.implicitMax:s.implicitMin;if(!vb(Number(l.toFixed(13)),s,n))return!1;const{orientation:u}=t.settings,c=n===gb.MAX?o.meta.minor.end:o.meta.minor.start;let d="end";r&&(d=n===gb.MAX?"sumOfPositives":"sumOfNegatives");const m=a.getStyles();return{type:"box-out-of-bounds",key:`bar-oob-${n}`,layout:{dock:c},data:t.data,brush:t.brush,settings:{orientation:u,major:t.settings.major,minor:t.settings.minor,dockValue:pe.getDockValue(c),oob:Y({},t.settings.box,{fill:m.outOfRange.color,alignment:1,opacity:1,show:function(e){var t;return!0!==(null===(t=e.datum.null)||void 0===t?void 0:t.value)&&((!r||0!==e.datum[d].value)&&vb(e.datum[d].value,s,n))}})},animations:{enabled:e.viewModel.animations.enabled,compensateForLayoutChanges:Ud.barOobs.compensateForLayoutChanges}}}function qb(e){return Math.min(Math.max(0,e),1)}const Mb=(e,{chart:t,type:n,componentKey:r,collectionKey:i})=>{const{layoutService:o,dockService:a,viewCache:s}=e,{isStacked:l}=o.meta,u=s.get("minorMinMax"),{meta:c}=e.layoutService;if(!bb({minorMinMax:u,type:n}))return!1;let d;c.isGroupedByDimension?d=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:c.isGroupedByMeasure&&(d=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2);const m={type:"box",key:`${gv.COMPONENT.GHOST_BAR_OOB}-${n}`,data:{collection:i},settings:{orientation:a.meta.minor.orientation,major:{scale:gv.SCALE.MAIN.MAJOR,fn:d},minor:{scale:gv.SCALE.MAIN.MINOR,start(e){var n,r;return qb(t.scale(gv.SCALE.MAIN.MINOR)((null==e||null===(n=e.datum)||void 0===n||null===(r=n.start)||void 0===r?void 0:r.value)||0))},end(e){const r=t.scale(gv.SCALE.MAIN.MINOR);let i="end";l&&(i="max"===n?"sumOfPositives":"sumOfNegatives");const o=e.datum[i]?e.datum[i].value:r[n]();return qb(r(o))}},box:{width:ub({layoutService:e.layoutService,discrete:e.discrete,componentKey:r}),minWidthPx:2,fill:"none",stroke:"transparent",show:e=>{const r=t.scale(gv.SCALE.MAIN.MINOR);let i="end";l&&(i="max"===n?"sumOfPositives":"sumOfNegatives");const o=e.datum[i]?e.datum[i].value:r.max();return"max"===n?o>r.max():o<r.min()}},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}}};return m};function Sb(e,t){const{style:n,styleService:r,dockService:i}=t,o=r.label.getStyle(),a=o.useContrastColor&&!e.onBackground?function(e){return function(t){return St.isDark(t.node.attrs.fill)?e.lightColor:e.darkColor}}(n):o.fill,s="horizontal"===i.meta.major.orientation,l=e.padding||{left:s?0:4,right:s?0:4,top:s?4:0,bottom:s?4:0};return{position:e.position,justify:e.justify,fill:a,overflow:e.overflow,background:e.background,padding:l}}function Db(e){return{placements:e.simplifiedPlacements.map((t=>Sb(t,e))),label:e.label}}function Cb(e,t){if(t){if(function(e,t){return mb(e,t)}(e,t))return-1;if(function(e,t){return fb(e,t)}(e,t))return 1}return function(e,t){if(t&&0===e){const{min:e,max:n}=t;return 0===n&&0===e?1:n<=0?-1:e>=0||n>=-e?1:-1}return e>=0?1:-1}(e,t)}const wb="vertical",Lb="horizontal";function Eb(e,t,n,r){const i=Cb(e,r);let o="up";return t===wb&&i<0?o="down":t===Lb&&(o=i>=0&&!n||i<0&&n?"right":"left"),o}function Tb(e,t){const{dataPoint:n}=e;if(!n.showLabels)return!1;const{isStacked:r,isContinuous:i}=t.layoutService.meta;return!r||!i&&!!n.showSegmentLabels}function Ab(e,t){const{dataPoint:n}=e;if(!n.showLabels)return!1;const{isStacked:r,isContinuous:i}=t.layoutService.meta;return!!r&&(!!i||!1!==n.showTotalLabels)}function Nb(e,t,n,r){const i=[];return void 0!==e&&(i[e]={position:"outside",onBackground:!0,justify:0,overflow:r}),void 0!==t&&(i[t]={position:"inside",onBackground:!1,justify:n}),i}function kb({layout:e,component:t,minorScale:n},r,i){if(!Tb(e,r))return!1;const{viewModel:o,ds:a,viewCache:s,layoutService:l,dockService:u,themeService:c}=r,{meta:d}=l,m=s.get("minorMinMax"),f=c.getStyles(),p=r.styleService.label.getStyle();let h;!d.isStacked&&(h=d.isStacked?1:0);const g=0===h?1:0,y=d.isStacked?.5:1,v=o.fields.minor[0],b=void 0===v?void 0:a.field(v).formatter();let x,q=-1;x=d.isStacked?d.isStackedByMeasure||!b?function(e){return e.data.segment.label}:function(e){return Math.abs(e.data.segment.value)>q?b(e.data.segment.value):""}:function(e){return e.data.end.label};const M={label:x,simplifiedPlacements:Nb(h,g,y,d.isContinuous),style:f.label.value},S=[Db(Y(r,M))],D={component:t,selector:"rect",strategy:{type:"bar",settings:{direction:e=>Eb(e.data.end.value,u.meta.minor.orientation,i,m),labels:S,fontSize:parseInt(p.fontSize,10),fontFamily:p.fontFamily,linkData:Ud.labels.linkData}}},C=[D],w={key:"bar-labels",type:"labels",renderer:om(r.flags),layout:{minimumLayoutMode:"XSMALL"},settings:{sources:C},animations:{enabled:r.viewModel.animations.enabled,trackBy:Ud.labels.trackBy,compensateForLayoutChanges:Ud.labels.compensateForLayoutChanges}};return d.isStackedByDimension&&b&&(w.beforeRender=()=>{q=function(e,t,n){const r="vertical"===t.dockService.meta.minor.orientation?"height":"width",i=t.chart.component(e),o=i&&i.rect?i.rect[r]:1,a=n?n.min():0;return 9.999*((n?n.max():0)-a)/o}(t,r,n)}),w}const Ob={isSameMeasureAndColorRow:(e,t,n)=>t&&e&&t[0].content[0]===e[0].content[0]&&t[0].content[1]===e[0].content[1]&&t[1].content[n?0:1]===e[1].content[0],getTitle(e,t){const n=e.data;let r;return t.isStackedByDimension?r=n.stack?n.stack.label:void 0:t.isGroupedByDimension&&(r=n.group?n.group.label:void 0),void 0!==r?`${n.label}, ${r}`:n.label},getMeasure(e,t,n,r,i){if(n.isStacked&&("bar-oob-max"===t.key||"bar-oob-min"===t.key))return!1;const o=t.data,a=n.isStacked?r.viewModel.fields.minor[n.isStackedByDimension?0:o.measureIndex.value]:void 0,s=n.isStacked?{source:{key:o.source.key,field:a},label:!0===(null===(l=o.null)||void 0===l?void 0:l.value)?"":n.isStackedByDimension&&i?i(o.segment.value):o.segment.label}:o.end;var l;return De.getMeasure(e,s)},getMeasures(e,t,n,r,i){const o=e.resources.dataset;return t.map((e=>Ob.getMeasure(o,e,n,r,i))).filter(Boolean)},getCustomTooltipAttrExps(e,t,n){const r=e.resources.dataset;return Ag({nodes:t,layout:n.layoutService.getLayout(),dataset:r})},extractBarTooltipData(e,t,n,r,i){const o={title:Ob.getTitle(t,n),color:De.getColor(e,t,r),measures:Ob.getMeasures(e,t.childrenNodes?t.childrenNodes:[t],n,r,i)};if(Ob.useCustomTooltip(r)){var a,s,l,u;const n=Ob.getCustomTooltipAttrExps(e,t.childrenNodes?t.childrenNodes:[t],r);o.customMeasures=n.customTooltipAttrExpsArr,o.customTitle=n.customTooltipInfoAttrExpsArr.filter((e=>e.id===fg.CUSTOM.TITLE)),o.customDescription=n.customTooltipInfoAttrExpsArr.filter((e=>e.id===fg.CUSTOM.DESCRIPTION));let i=[];(t.childrenNodes?t.childrenNodes:[t]).forEach((e=>{var t;(null===(t=e.data.customTooltipImages)||void 0===t?void 0:t.length)>0&&!Array.isArray(e.data.customTooltipImages[0])&&(i=e.data.customTooltipImages)})),i.length>0&&(o.customImages=i);const p=r.layoutService.getLayout();var c,d,m,f;if(null!==(a=p.tooltip)&&void 0!==a&&null!==(s=a.chart)&&void 0!==s&&null!==(l=s.object)&&void 0!==l&&l.refId&&r.app&&r.customTooltipModel.embed&&"function"==typeof(null===(u=r.customTooltipModel.model)||void 0===u?void 0:u.getEffectiveProperties))if(null!==(c=(d=r.app).isInModalSelection)&&void 0!==c&&c.call(d)){if((null==p||null===(m=p.qHyperCube)||void 0===m||null===(f=m.qDimensionInfo)||void 0===f?void 0:f.length)>0){Mg.destroyVisualization({customTooltipModel:r.customTooltipModel});const e=r.customTooltipModel.translator.get("properties.tooltip.notselectedmessage");o.customLimitation=e}}else{const t=Mg.createContainer({ctx:e,layout:p});o.customChart=t}}return o},getTotalStackTitle:(e,t)=>e>0?t?t.get("Object.ChartTooltip.sumOfPositives"):"Sum of positives":e<0?t?t.get("Object.ChartTooltip.sumOfNegatives"):"Sum of negatives":"",extractStackTotalBarTooltipData(e,t,n){const r=e.data.label,i=[e.data.sumOfPositives.value,e.data.sumOfNegatives.value].filter((e=>0!==e)).map((e=>({label:`${Ob.getTotalStackTitle(e,t)}`,value:n?n(e):e})));return{title:r,measures:i}},extractTooltipData(e,t){const n=t.chart.formatter(gv.FORMATTER.MINOR),{meta:r}=t.layoutService,i=e.node.childrenNodes?e.node.childrenNodes:[e.node],o=Math.max(0,i.length-6);i.length=Math.min(i.length,6);const{stackTotalBarNodes:a}=e.node,s=a&&a.length?a.map((e=>Ob.extractStackTotalBarTooltipData(e,t.translator,n))):[];return{barTooltipData:i.map((i=>Ob.extractBarTooltipData(e,i,r,t,n))),stackTotalBarTooltipData:s,numInvisibleNodesPhase1:o}},extractBarNodeData(e,t,n,r,i,o,a){let s=!i&&De.getTitleRow(t,r);const l=De.hideColorRow(t,n),u=!o&&!l&&De.getColorRow(e,t,r),c=t.measures.map((i=>!a&&De.getMeasureRow(i,e,t,r,l&&i.field===n.coloring.field))),d=c.filter((e=>!Ob.isSameMeasureAndColorRow(e,u,r)));if(Ob.useCustomTooltip(n)){const n=i?[]:t.customMeasures.map((n=>De.getMeasureRow(n,e,t,r,!1))),o=!(!t.customTitle[0]||i)&&De.getTitleRow(t.customTitle[0],r),a=!(!t.customDescription[0]||i)&&De.getDescriptionRow(t.customDescription[0],r);s=!Ob.shouldIgnoreTitleRowForCtt(o,a,d,n)&&s;const l=[o,a,s,u,...d,...n];if(t.customChart&&l.push(t.customChart),t.customLimitation&&l.push(wg.getFooterRow(t.customLimitation,r)),t.customImages){const n=t.customImages.map((t=>wg.getImageRow(t,e)));l.push(...n)}return l.filter(Boolean)}return[s,u,...d].filter(Boolean)},extractStackTotalBarNodeData(e,t,n){const r=!!t.measures.length&&De.getTitleRow(t,n),i=t.measures.map((r=>De.getMeasureRow(r,e,t,n,!1)));return[r,...i].filter(Boolean)},useCustomTooltip:e=>tu(e,"customTooltipModel.useCustomTooltip",!1),shouldIgnoreTitleRow:(e,t)=>e.isDimensionless||t>0&&!e.isGroupedByDimension&&!e.isStackedByDimension,shouldIgnoreTitleRowForCtt:(e,t,n,r)=>!1===n[0]&&0===r.length&&(e.length>0||t.length>0),shouldIgnoreColorRow:(e,t)=>t>0&&(e.isGroupedByMeasure||e.isStackedByMeasure),shouldIgnoreMeasureRow:(e,t,n)=>e&&t.measures.some((e=>e.field===n.coloring.field)),shouldIgnoreDefaultRows:(e,t)=>Ob.useCustomTooltip(t)&&tu(e,"tooltip.hideBasic",0),extractBarsData(e,t,n,r){const{meta:i}=t.layoutService,o=t.layoutService.getLayout(),a=r.length;let s,l,u=[];const c=Ob.shouldIgnoreDefaultRows(o,t);for(s=0;s<a;s++){l=r[s];const o=Ob.shouldIgnoreTitleRow(i,s),d=c||Ob.shouldIgnoreColorRow(i,s),m=c||Ob.shouldIgnoreMeasureRow(d,l,t);if(u=u.concat(Ob.extractBarNodeData(e,l,t,n,o,d,m)),u.length>=6||l.customImages||l.customChart||l.customLimitation)return{barsData:u,numInvisibleNodesPhase2:a-(s+1)}}return{barsData:u,numInvisibleNodesPhase2:0}},extractStackTotalBarsData(e,t,n){let r=[];return n.some((e=>e.measures.length))&&n.forEach((n=>{r=r.concat(Ob.extractStackTotalBarNodeData(e,n,t))})),r},extractData(e,t,n){const{barTooltipData:r,numInvisibleNodesPhase1:i,stackTotalBarTooltipData:o}=Ob.extractTooltipData(e,t),a=Ob.extractStackTotalBarsData(e,n,o);a.length&&a.push(De.getSeparatorRow());const{barsData:s,numInvisibleNodesPhase2:l}=Ob.extractBarsData(e,t,n,r),u=a.concat(s),c=i+l;return c&&u.push(De.getNMoreRow(c,t.translator,n)),u},calculateBoundsFromBars(e){const t=e.filter((e=>{const t=e.bounds;return t.width>0&&t.height>0})),n=t.length?t:e;return nm.combineBounds(n.map((e=>e.bounds)))},calculateBoundsFromScale({opts:e,barKey:t,scale:n,majorScale:r,data:i,groupProp:o}){const a=e.chart.component(t).rect,{orientation:s}=e.dockService.meta.major,l="horizontal"===s?"width":"height",u=e.chart.scale(n).pxScale(a[l]);let c,d,m;if(e.layoutService.meta.isGroupedByMeasure){const t=e.viewModel.fields.minor.length;c=i.value,d=n===r&&void 0!==c?(u([c,0])+u([c,t-1]))/2:0,m=n===r&&void 0!==c?u.bandwidth([c,0]):0}else{const{value:e}=i;c=i[o]?i[o].value:void 0,d=u(n===r&&void 0!==c?[c,e]:e),m=n===r&&void 0!==c?u.bandwidth([c,e]):u.bandwidth(e)}const f=(d+m/2)*a[l],p={width:0,height:0};return"horizontal"===s?(p.x=f,p.y=a.height):(p.y=f,p.x=0),p},calculateTotalBounds({opts:e,labels:t,bars:n,barKey:r,barAxisKey:i,majorScale:o,majorInnerScale:a,groupProp:s}){const l=n.filter((e=>e.children&&e.children.length));let u;return u=l.length?Ob.calculateBoundsFromBars(l):Ob.calculateBoundsFromScale({opts:e,barKey:r,scale:t[0].key===i?o:a,majorScale:o,data:t[0].data,groupProp:s}),u},filterNodesOnKeys:(e,t)=>e.filter((e=>e.data&&t.indexOf(e.key)>-1)),isBarMatchingLabel:(e,t)=>t.data.value===e.data.value,isBarMatchingLabelOnProp:(e,t,n)=>t.data.value===(e.data[n]?e.data[n].value:e.data.value),findBarsMatchingLabels(e,t,n,r){const i=e.filter((e=>t.some((t=>n(e,t,r)))));return i},findBarsFromGroupLabelsInGroupedByDim(e,t,n){const r=Ob.isBarMatchingLabelOnProp;return Ob.findBarsMatchingLabels(e,t,r,n)},findBarsFromBarLabelsInGroupedByDim:(e,t,n)=>e.filter((e=>t.some((t=>t.data.group&&t.data.group.value===e.data[n].value&&t.data.value===e.data.value)))),findBarsFromLabelsInSingleDim(e,t){const n=Ob.isBarMatchingLabel;return Ob.findBarsMatchingLabels(e,t,n)},findBarsFromLabelsInGroupedByDim(e,t,n,r){const i=t.filter((e=>e.key===n)),o=t.filter((e=>e.key!==n)),a=Ob.findBarsFromBarLabelsInGroupedByDim(e,i,r),s=Ob.findBarsFromGroupLabelsInGroupedByDim(e,o,r);return a.concat(s)},findStackTotalBarsFromLabelsInStackedByDim(e,t){const n=Ob.isBarMatchingLabel;return Ob.findBarsMatchingLabels(e,t,n)},findStackTotalBarsFromLabelsInStackedByMeasure(e,t){const n=Ob.isBarMatchingLabel;return Ob.findBarsMatchingLabels(e,t,n)},findBarsFromLabelsInStackedByDim(e,t,n){const r=Ob.isBarMatchingLabelOnProp;return Ob.findBarsMatchingLabels(e,t,r,n)},findBarsFromLabelsInStackedByMeasure:(e,t)=>Ob.findBarsFromLabelsInSingleDim(e,t),findBarsFromLabels({labels:e,opts:t,filterKeys:n,barAxisKey:r,groupProp:i,stackProp:o}){const{meta:a}=t.layoutService,s=Ob.filterNodesOnKeys(t.chart.findShapes("container"),n);return a.isStackedByDimension?Ob.findBarsFromLabelsInStackedByDim(s,e,o):a.isStackedByMeasure?Ob.findBarsFromLabelsInStackedByMeasure(s,e):a.isGroupedByDimension?Ob.findBarsFromLabelsInGroupedByDim(s,e,r,i):Ob.findBarsFromLabelsInSingleDim(s,e)},findStackTotalBarsFromLabels({labels:e,opts:t,stackTotalBarKey:n}){const{meta:r}=t.layoutService;if(r.isStacked){const i=Ob.filterNodesOnKeys(t.chart.findShapes("container"),[n]);return r.isStackedByDimension?Ob.findStackTotalBarsFromLabelsInStackedByDim(i,e):Ob.findStackTotalBarsFromLabelsInStackedByMeasure(i,e)}return[]},isSingleBarMode:(e,t)=>(e.isSimple||1===t.length)&&t[0].children&&t[0].children.length,filterNodesOnLabels({labels:e,opts:t,barKey:n,stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:o,barOobMinKey:a,groupProp:s,stackProp:l,majorScale:u,majorInnerScale:c,filterFn:d}){const{meta:m}=t.layoutService;if(e.length){let f=Ob.findBarsFromLabels({labels:e,opts:t,filterKeys:[n],stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:o,barOobMinKey:a,groupProp:s,stackProp:l});if(d&&(f=f.filter(d)),Ob.isSingleBarMode(m,f))return[f[0]];if(f.length){let m=Ob.findBarsFromLabels({labels:e,opts:t,filterKeys:[n,o,a],stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:o,barOobMinKey:a,groupProp:s,stackProp:l});d&&(m=m.filter(d));const p=Ob.calculateTotalBounds({opts:t,labels:e,bars:m,barKey:n,barAxisKey:i,groupProp:s,majorScale:u,majorInnerScale:c}),h=Ob.findStackTotalBarsFromLabels({labels:e,opts:t,stackTotalBarKey:r});return[{key:n,bounds:p,childrenNodes:f,data:f.map((e=>e.data)),stackTotalBarNodes:h}]}return[]}return[]},filterNodesForOob:(e,t,n)=>e.key===t&&0===e.children.length||e.key===n,filterNodes({nodes:e,opts:t,barKey:n,stackTotalBarKey:r,barAxisKey:i,groupAxisKey:o,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d}){let m=Ob.filterNodesOnKeys(e,[i,o]),f=m&&m.length?[m[0]]:[];const p=Ob.filterNodesOnLabels({labels:f,opts:t,barKey:n,stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d});if(p&&p.length)return p;const{meta:h}=t.layoutService;if(h.isStackedByMeasure){m=Ob.filterNodesOnKeys(e,[a,s]),f=m&&m.length?[m[0]]:[];const o=e=>Ob.filterNodesForOob(e,n,a),p=Ob.filterNodesOnLabels({labels:m,opts:t,barKey:n,stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d,filterFn:o});if(p&&p.length)return p[0].stackTotalBarNodes=void 0,p}if(h.isStackedByDimension){m=Ob.filterNodesOnKeys(e,[a,s]),f=m&&m.length?[m[0]]:[];const o=e=>Ob.filterNodesForOob(e,n,a),p=Ob.filterNodesOnLabels({labels:m,opts:t,barKey:n,stackTotalBarKey:r,barAxisKey:i,barOobMaxKey:a,barOobMinKey:s,groupProp:l,stackProp:u,majorScale:c,majorInnerScale:d,filterFn:o});if(p&&p.length)return p[0].stackTotalBarNodes=void 0,p}const g=Ob.filterNodesOnKeys(e,[n,a,s]);return g.length?[g[0]]:[]}};function Ib(e,t={},n){let r=[];const i=be({key:gv.COMPONENT.BASE_TOOLTIP,rtl:n});return Y(!0,i,{scale:gv.SCALE.MAIN.COLOR,settings:{filter:e=>Ob.filterNodes({nodes:e,opts:t,barKey:gv.COMPONENT.BAR,stackTotalBarKey:gv.COMPONENT.STACK_TOTAL_BAR,barAxisKey:gv.COMPONENT.BAR_AXIS,groupAxisKey:gv.COMPONENT.GROUP_AXIS,barOobMaxKey:gv.COMPONENT.BAR_OOB_MAX,barOobMinKey:gv.COMPONENT.BAR_OOB_MIN,groupProp:"group",stackProp:"stack",majorScale:"major",majorInnerScale:"majorInner"}),extract:e=>(r=e.node.childrenNodes?e.node.childrenNodes:[e.node],Ob.extractData(e,t,n)),placement:"bounds",afterShow:()=>{var e;const{app:i,properties:o,customTooltipModel:a}=t;i&&(null===(e=i.isInModalSelection)||void 0===e||!e.call(i))&&a.useCustomTooltip&&a.embed&&Mg.show({app:i,properties:o,selectedNodes:r,customTooltipModel:a,rtl:n})}},style:{content:{fontFamily:t.themeService.getStyles().fontFamily}}})}const Pb={extractData:(e,t)=>[De.getTitleRow({title:e.node.data.label},t)],filterNodes(e,t){const n=e.filter((e=>e.data&&e.key===t));return n.length?[n[0]]:[]}};function Rb(e,t={},n){if("categorical"!==t.colorService.getMain().getSettings().type)return!1;const r=be({key:gv.COMPONENT.LEGEND_CAT_TOOLTIP,rtl:n});return Y(!0,r,{scale:gv.SCALE.MAIN.COLOR,settings:{filter:e=>Pb.filterNodes(e,gv.COMPONENT.LEGEND_COLOR_CAT),extract:e=>Pb.extractData(e,n),placement:"pointer",direction:n?"rtl":"ltr"},style:{content:{fontFamily:t.themeService.getStyles().fontFamily}}})}function Fb(e){return"NaN"===e.qMin&&"NaN"===e.qMax}function Hb({layout:e},t,n){const r=function(e,t){if(e.qHyperCube.qSize.qcx*e.qHyperCube.qSize.qcy==0)return"NoDataExist";if(e.qHyperCube.qMeasureInfo.every(Fb))return"OnlyNanData";let n=!1;if(t.layoutService.meta.isContinuous&&2===e.qHyperCube.qDimensionInfo.length){const t=e.qHyperCube.qDimensionInfo[1];n=nb.getDimensionSize(t)>oe.maxNumberOfLines}return!!n&&"LimitedData"}(e,t),{fontFamily:i}=t.themeService.getStyles();return function(e,t,n,r={}){if(!e)return!1;const{translator:i}=t,{rtl:o}=n;return{key:"disclaimer",type:"disclaimer",layout:{dock:Z[e].alignment},settings:{label:i.get(`Object.Disclaimer.${e}`),rtl:o},style:r}}(r,t,{rtl:n},{fontFamily:i})}function zb(e,{fill:t}){return{[gv.FORMATTER.MINOR]:{data:{fields:e.viewModel.fields.minor}},[gv.FORMATTER.COLOR]:t&&t.data&&t.data.field?{data:{field:t.data.field}}:{}}}const jb=1,Bb=3;function Vb(e){return e.getLayoutValue("gridLine.auto")}function _b(e){return!Vb(e)&&e.getLayoutValue("gridLine.spacing")===jb}function Ub(e){return!Vb(e)&&e.getLayoutValue("gridLine.spacing")===Bb}const $b=e=>({enabled:e.animations.enabled,trackBy:Ud.lines.trackBy,compensateForLayoutChanges:Ud.lines.compensateForLayoutChanges}),Wb=(e,{themeService:t,layoutService:n,dockService:r,viewModel:i})=>{if(!Vb(n)&&function(e){return!e.getLayoutValue("gridLine.spacing")}(n))return!1;const{grid:o}=t.getStyles(),a={key:"grid-line",type:"grid-line",layout:{minimumLayoutMode:Qv.measureAxis.minimumLayoutMode},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),ticks:{show:!_b(n)||((e,t)=>t%2==0),stroke:o.line.major.color},minorTicks:{show:Ub(n),stroke:o.line.minor.color},animations:$b(i)};return a["horizontal"===r.meta.major.orientation?"y":"x"]=gv.SCALE.MAIN.MINOR,a};function Kb(e,t){const n=[Wb(0,t)];return n[0]&&n.push((({dockService:e,themeService:t,viewCache:n,viewModel:r})=>{const i=n.get("minorMinMax");if(i.min>0||i.max<0)return!1;const o=t.getStyles(),a={};return a["horizontal"===e.meta.minor.orientation?"x":"y"]=[{value:0,scale:gv.SCALE.MAIN.MINOR,line:{stroke:o.grid.line.highContrast.color}}],{key:"high-contrast-grid-line",type:"ref-line",scale:gv.SCALE.MAIN.MINOR,lines:a,animations:$b(r)}})(t)),n}const Gb="areaPan",Yb=e=>({type:"Pan",key:"panorama",options:{event:Gb,pointers:1,threshold:10,enable(t,n){return this.started===Gb||!n||!!e.actions.scroll.enabled()&&e.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((e=>e.key===gv.COMPONENT.BAR))}},events:{areaPanstart(t){t.preventDefault(),this.started=Gb;const n=e.viewState.get("zoom");this[Gb]={min:n.min,max:n.max,size:e.chart.component(gv.COMPONENT.BAR).rect.computedInner.width,span:n.max-n.min}},areaPanmove(t){t.preventDefault();const{span:n,min:r,max:i,size:o}=this[Gb],a=-t.deltaX/o;e.viewState.set("zoom",{min:Math.min(r+a*n,e.viewCache.get("continuousMax")-n),max:Math.max(i+a*n,e.viewCache.get("continuousMin")+n)})},areaPanend(e){e.preventDefault(),this.started=!1},areaPancancel(e){e.preventDefault(),this.started=!1}}});function Xb(e,t){if(e.layoutService.meta.isDiscrete)return{};const{viewCache:n,viewState:r,chart:i}=e,{rtl:o}=t,a=mh.event.onZoom({viewCache:n,viewState:r,chart:i},{threshold:100,rtl:o,targetKey:gv.COMPONENT.BAR}),s={last:0,diff:0};return{type:"Pinch",key:"continuous-pinch-zoom",options:{event:"zoom",pointers:2,threshold:0,enable:(t,n)=>!n||!!e.actions.scroll.enabled()&&e.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((e=>e.key===gv.COMPONENT.BAR))},events:{zoomstart(e){s.last=e.scale,e.preventDefault()},zoommove(e){const t=e.scale-s.last;(function(e){return Math.abs(e)>.01})(t)&&a(e.center,t>0?1:-1),e.preventDefault(),s.last=e.scale}}}}function Jb({chart:e},t,n){const r=e.component(gv.COMPONENT.BASE_TOOLTIP);var i;r&&r.show&&(r.emit("hide"),null!=n&&null!==(i=n.customTooltipModel)&&void 0!==i&&i.useCustomTooltip&&t&&t({},r,{nodes:[],opts:n,customTooltipModel:n.customTooltipModel,hide:!0}));const o=e.component(gv.COMPONENT.LEGEND_CAT_TOOLTIP);o&&o.show&&o.emit("hide");const a=e.component(gv.COMPONENT.TREND_LINES_TOOLTIP);a&&a.show&&a.emit("hide")}function Zb(e,t){const{viewCache:n,viewState:r,chart:i,trendLineModel:o,layoutService:a}=e,{rtl:s}=t,l=e.layoutService.meta.isContinuous?mh.event.onZoom({viewCache:n,viewState:r,chart:i},{rtl:s,threshold:50,targetKey:gv.COMPONENT.BAR}):void 0,u=iv({majorInnerScale:gv.SCALE.MAIN.MAJOR_INNER,tooltip:gv.COMPONENT.TREND_LINES_TOOLTIP,tooltipOverlay:gv.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{chart:i,viewState:r,trendLineModel:o,layoutService:a,rtl:s}),c=[gv.COMPONENT.BAR,gv.COMPONENT.BAR_AXIS,gv.COMPONENT.GROUP_AXIS,gv.COMPONENT.BAR_OOB_MAX,gv.COMPONENT.BAR_OOB_MIN],d=e.customTooltipModel.utils,m=e.debouncer(d.displayTooltip,d.DEBOUNCE_THRESHOLD);return{type:"native",events:{wheel(t){let n,r=!1;if(e.actions.scroll.enabled()){const i={x:t.clientX,y:t.clientY};[n]=e.chart.componentsFromPoint(i).filter((e=>e.key===gv.COMPONENT.BAR)),n&&(e.layoutService.meta.isContinuous&&l(i,Math.sign(-t.deltaY)),r=!0)}!r&&e.actions.interact.enabled()&&([n]=e.chart.componentsFromPoint(t).filter((e=>e.key===gv.COMPONENT.LEGEND_COLOR_CAT)),n&&(r=!0,function(e,t){const n=(Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY)>=0?"next":"prev";t.emit(n)}(t,n))),r&&t.preventDefault(),Jb(e,m,e)},mousemove(t){if(e.actions.tooltip.enabled()){if(u(t))return;const n=this.chart.componentsFromPoint({x:t.clientX,y:t.clientY}),r=this.chart.component(gv.COMPONENT.BASE_TOOLTIP);if(r&&r.show)if(n.some((e=>c.indexOf(e.key)>-1))){const{customTooltipModel:n}=e;if(n.useCustomTooltip&&d.checkIfPromisesExist({customTooltipModel:n})){const i=d.getNodes(t,this.chart);m(t,r,{nodes:i,opts:e,customTooltipModel:n})}else r.emit("show",t)}else r.emit("hide");const i=this.chart.component(gv.COMPONENT.LEGEND_CAT_TOOLTIP);i&&i.show&&(n.some((e=>e.key===gv.COMPONENT.LEGEND_COLOR_CAT))?i.emit("show",t):i.emit("hide"))}},mouseup(t){2===t.button&&Jb(this,m,e)},mouseleave(){Jb(this,m,e)}}}}const Qb=(e,t)=>({type:"hammer",enable:!0,gestures:[...(t.hammer||{}).gestures||[],...Oh({...e,componentKey:"scrollbar",rtl:t.rtl}).gestures,...e.layoutService.meta.isDiscrete?e.discrete.interactions.gestures:[Yb(e,t.rtl),Xb(e,t)]]});function ex(e,t){const n=[Qb(e,t),Zb(e,t),Oh({...e,componentKey:"scrollbar",rtl:t.rtl}).native];return e.layoutService.meta.isDiscrete&&n.push(e.discrete.interactions.native),n}const tx=e=>({enabled:e.animations.enabled,compensateForLayoutChanges:Ud.bars.compensateForLayoutChanges});const nx=(e,t,{collectionKey:n})=>{if(!bh({layoutService:t.layoutService}).miniChart)return!1;if(t.reducedDataModel.mode.isContinuous)return function(e,{reducedDataModel:t,colorService:n,continuousDataModel:r,viewModel:i},{collectionKey:o}){return{type:"box",key:"mini-marker",layout:{dock:"@scrollbar"},show:()=>r.getDimensionCardinality()>1,data:{collection:o},settings:{box:Y(!0,{},e.settings.box,{minWidthPx:2,fill:n.getMini().getColor(),strokeWidth:0}),major:Y(!0,{},e.settings.major,{scale:t.scales.major}),minor:e.settings.minor,orientation:e.settings.orientation,oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:tx(i)}}(e,t,{collectionKey:n});const{mode:r,scales:i}=t.reducedDataModel;let o;return r.isGroupedByDimension&&!r.isReduced?o=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:r.isGroupedByMeasure&&(o=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2),{type:"box",key:"mini-marker",layout:{dock:"@scrollbar"},show:()=>t.discrete.query.getCanScroll(),data:{collection:n},settings:{box:{...e.settings.box,fill:r.isReduced||r.isStackedByDimension?t.colorService.getMain().getSettings().others:t.colorService.getMain().getColor(),strokeWidth:0},major:{scale:i.major,fn:o},minor:{scale:i.minor},orientation:e.settings.orientation,oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:tx(t.viewModel)}},{measureText:rx}=e.renderer("svg")();function ix(e,t,n){const r=function(e){const t=Y(!0,{},e);return delete t.data,t}(t.minor),i=function(e,t,{majorScaleInvert:n,maxPxStep:r,align:i,getProp:o}){let a={invert:n,data:{extract:e.mode.isDimensionless?e.fields.minor.map(((e,t)=>({field:e,value:t}))):{source:"miniCube",field:"qDimensionInfo/0"}},type:e.mode.isDimensionless?"band":void 0,maxPxStep:r,align:i};return e.mode.isStackedByDimension?a.data.extract.field="qDimensionInfo/1":e.mode.isGroupedByDimension?e.mode.isReduced||(a.data={source:"miniCube",hierarchy:{value:e=>e.qElemNumber}}):e.mode.isGroupedByMeasure?(a=Y(!0,{},t),a.data.extract.source="miniCube"):e.mode.isContinuous&&(a=Y(!0,{},t,{min:()=>o("continuousMin"),max:()=>o("continuousMax")})),a}(e,t.major,n);return{reducedMinor:r,reducedMajor:i}}const ox=125,ax={NARROW:50,MEDIUM:100,WIDE:200};function sx(e,t){const n=function(e){const t=e.getLayoutValue("measureAxis.spacing",1);switch(t){case.5:return ax.NARROW;case 1:return ax.MEDIUM;case 2:return ax.WIDE;default:return t*ox}}(t);return Math.max(1,Math.round(e/n))}const lx=10;function ux(e,t,n){return 0===t||t===Math.floor((n.length-1)/2)||t===n.length-1}function cx(e,t,n){return 0===t||0===e||t===n.length-1}function dx(e){for(let t=1;t<e.length;t++)if(e[t]===e[t-1])return!0;return!1}function mx(e,t,n,r,i){e.domain([t,n]),e.nice(lx);const[o,a]=e.domain();let s=e.ticks(lx);const l=function(e){return e.length%2==0}(s),u=function(e){const t=Math.round(.3*e.length),n=t,r=e.length-t;return e.slice(n,r).some((e=>0===e))}(s),c=u?cx:ux;s=s.filter(c),l&&!u&&!r&&s.length>1&&(s=[s[0],(s[0]+s[s.length-1])/2,s[s.length-1]]);const d=i?i.formatter(gv.FORMATTER.MINOR):void 0;return dx(d?s.map(d):s)&&(s=[s[0],s[s.length-1]]),{roundedMin:o,roundedMax:a,ticks:s}}function fx(e,t,n,r,i,o,a,s){const l=o.formatter(gv.FORMATTER.MINOR),u=s.getStyles(),c="horizontal"===a.meta.major.orientation?"height":"width",d=e=>rx({text:e,fontSize:u.axis.label.name.fontSize,fontFamily:u.axis.label.name.fontFamily})[c];let[m,f]=e.domain(),p=e.ticks(r);function h(){const e=p.map(l);return!dx(e)&&function(e){const t=i/p.length;return Math.max(...e.map(d))<=t}(e)}for(let i=r-1;i>0&&!h();i--)e.domain([t,n]),e.nice(i),[m,f]=e.domain(),p=e.ticks(i);return{roundedMin:m,roundedMax:f,ticks:p}}const px=(e,t)=>e.value-t.value,hx=e=>({value:e,isMinor:!1}),gx=e=>({value:e,isMinor:!0});function yx(e,t,n){const r=Number.isNaN(t)&&Number.isNaN(n)?3:2;return e.filter((e=>(e=>Number.isNaN(t)||e>=t)(e)&&(e=>Number.isNaN(n)||e<=n)(e))).length<=r}function vx({chart:e,viewCache:t,dockService:n,layoutService:r,themeService:i}){const{explicitMin:o,explicitMax:a,hasExplicitMin:s,hasExplicitMax:l}=t.get("minorMinMax"),{min:u,max:c}=function(e){let{min:t,max:n}=e.get("minorMinMax");return t===n&&0===t&&(t-=1,n+=1),{min:t,max:n}}(t),d=ou((()=>{const d=function(e,t,n){let r;return e?r=n.meta.chart.size:({rect:r}=t.component(gv.COMPONENT.BAR)),"horizontal"===n.meta.major.orientation?r.height:r.width}(t.get("isPreRender"),e,n),m=sx(d,r),f=function(e,t,n){const r=Er().domain([e,t]);return r.nice(n),r}(u,c,m);let p,h,g=[];"SPARK"===n.meta.chart.mode?({roundedMin:p,roundedMax:h}=function(e,t){return{roundedMin:e,roundedMax:t}}(u,c)):(({roundedMin:p,roundedMax:h,ticks:g}=fx(f,u,c,m,d,e,n,i)),yx(g,o,a)&&({roundedMin:p,roundedMax:h,ticks:g}=mx(f,u,c,s||l,e)));const y=function(e,t){const n=[];for(let r=0;r<e.length-1;r++){const i=e[r],o=(e[r+1]-i)/(t+1);for(let e=1;e<=t;e++)n.push(i+o*e)}return n}(g,1);g=function(e,t,n){return e&&n.length&&!n.some((e=>e===t))?(n.unshift(t),n.filter((e=>e>=t))):n}(s,o,g),g=function(e,t,n){return e&&n.length&&!n.some((e=>e===t))?(n.push(t),n.filter((e=>e<=t))):n}(l,a,g);const v=function(e,t){return[...e.map(hx),...t.map(gx)].sort(px)}(g,y);return{roundedMin:p,roundedMax:h,ticks:v}}),(()=>t.get("isPreRender")));return{values:()=>d().ticks,min:()=>s?o:d().roundedMin,max:()=>l?a:d().roundedMax}}function bx(e,{picasso:t,discrete:n,layoutService:r,dockService:i,viewModel:o,viewCache:a,reducedDataModel:s,colorService:l,themeService:u,viewState:c,chart:d},{localeInfo:m,rtl:f}){const{meta:p}=r,{fields:h}=o,g=()=>{if("custom"!==r.getLayoutValue("dimensionAxis.axisDisplayMode"))return Math.min(200,i.meta.chart.size["horizontal"===i.meta.major.orientation?"height":"width"]/4)},y=!("none"===r.getLayoutValue("measureAxis.show"))?(v=i.meta.minor.orientation,b=i.meta.minor.dock,"vertical"===v?"near"===b||"left"===b?0:1:"near"===b||"bottom"===b?1:0):.5;var v,b;const x={},q="vertical"===i.meta.minor.orientation&&f,M=l.getMain().getScales(),S=l.getMini().getScales();if(Object.assign(x,M,{reducedFill:S.reducedFill}),x[gv.SCALE.MAIN.MINOR]=function({chart:e,viewModel:{fields:t},dockService:n,viewCache:r,layoutService:i,themeService:o},{rtl:a}){const s=vx({chart:e,dockService:n,viewCache:r,layoutService:i,themeService:o}),l={invert:"vertical"===n.meta.minor.orientation||a,ticks:{values:s.values},minorTicks:{count:1},min:s.min,max:s.max};return i.meta.isStacked||(l.data={source:"qHyperCube",fields:t.minor}),l}({chart:d,viewModel:o,dockService:i,viewCache:a,layoutService:r,themeService:u},{rtl:f}),p.isGroupedByDimension)[gv.SCALE.MAIN.MAJOR_INNER,gv.SCALE.MAIN.MAJOR].forEach(((e,t)=>{x[e]={invert:q,data:{source:"qHyperCube",hierarchy:{label:e=>e.qText?e.qText:"",value:e=>e.qElemNumber,props:{...o.selectionDimensionProp(t),group:p.isGroupedByDimension?{field:h.majorGroup}:void 0}}},label:({datum:e})=>e.label,ticks:{depth:t+1},maxPxStep:g,align:y}})),o.isDimensionLocked(0)||(x[gv.SCALE.MAIN.MAJOR_INNER].data.hierarchy.props.axisSelectionDimension={field:0});else if(p.isGroupedByMeasure)x[gv.SCALE.MAIN.MAJOR]={type:"group-by-measure",invert:q,data:{extract:{source:"qHyperCube",field:"qDimensionInfo/0",props:{axisSelectionDimension:{field:0}}}},measureCount:e.qHyperCube.qMeasureInfo.length,maxPxStep:g,align:y};else if(p.isTime){const{innerTime:e,outerTime:n}=function(e,t){const{layoutService:n,viewModel:r,viewCache:i,picasso:o,viewState:a,localeInfo:s,themeService:l}=e,u=()=>n.getHyperCubeValue("qAxisData.qAxis",[]),c=o.formatter("q-time"),d=l.getStyles(),m=e=>rx({text:e,fontSize:d.axis.label.name.fontSize,fontFamily:d.axis.label.name.fontFamily});i.set("qTimeAxisCache",[]);const f={get:(e,t=0)=>{const n=i.get("qTimeAxisCache");return n[t]&&n[t][0]===e?n[t][1]:void 0},set:(e,t,n=0)=>{i.get("qTimeAxisCache")[n]=[e,t]},key:({distance:e})=>{const{min:t,max:n}=a.get("zoom"),r=(n-t)/(i.get("continuousMax")-i.get("continuousMin")),o=u().map((e=>e.qName));return[e,Number.parseFloat(r).toFixed(12),...o].toString()}};return{innerTime:{data:{field:r.fields.majorNumeric},type:"q-time-axis",qAxis:u,field:r.fields.majorNumeric,min:()=>a.get("zoom").min,max:()=>a.get("zoom").max,invert:!!t,formatter:{fn:c,localeInfo:s,qNumFormat:n.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:m},ticks:{generator:{type:"d3",initialMin:a.get("zoom").min},level:"inner",anchor:"start",clamp:!0},cache:f},outerTime:{data:{field:r.fields.majorNumeric},type:"q-time-axis",qAxis:u,field:r.fields.majorNumeric,min:()=>a.get("zoom").min,max:()=>a.get("zoom").max,invert:!!t,formatter:{fn:c,localeInfo:s,qNumFormat:n.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:m},ticks:{generator:{type:"d3"},level:"outer",anchor:"start",clamp:!0},cache:f}}}({picasso:t,localeInfo:m,viewState:c,viewModel:o,viewCache:a,themeService:u,layoutService:r},f);x[gv.SCALE.MAIN.MAJOR_INNER]=e,x[gv.SCALE.MAIN.MAJOR]=n}else p.isContinuous?x[gv.SCALE.MAIN.MAJOR]={type:"linear",invert:q,data:{extract:{key:"qHyperCube",field:h.majorNumeric}},ticks:{forceBounds:!0,count:c.get("zoom").min===c.get("zoom").max?1:void 0},minorTicks:{count:1},min:()=>c.get("zoom").min,max:()=>c.get("zoom").max}:x[gv.SCALE.MAIN.MAJOR]={invert:q,data:{extract:p.isDimensionless?h.minor.map(((t,n)=>({field:t,label:()=>e.qHyperCube.qMeasureInfo[n].qFallbackTitle,value:n}))):{source:"qHyperCube",field:"qDimensionInfo/0",props:{axisSelectionDimension:{field:0}}}},type:p.isDimensionless?"band":void 0,maxPxStep:g,align:y};const{reducedMinor:D,reducedMajor:C}=ix(s,{major:x[gv.SCALE.MAIN.MAJOR],minor:x[gv.SCALE.MAIN.MINOR]},{majorScaleInvert:q,maxPxStep:g,align:y,getProp:a.get});return p.isDiscrete&&(x[gv.SCALE.MAIN.MAJOR].range=n.query.getScaleRange,p.isGroupedByDimension&&(x[gv.SCALE.MAIN.MAJOR_INNER].range=n.query.getScaleRange)),x[s.scales.major]=C,x[s.scales.minor]=D,x}function xx(e,t,n){const{layoutService:r,colorService:i}=e;return function(e,t){if(!e.targets)throw new Error("Missing 'targets' property");return{interactions:[Yv(e,t)],components:[]}}({targets:[r.meta.isStackedByDimension&&r.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1?gv.COMPONENT.STACK_TOTAL_BAR:gv.COMPONENT.BAR,gv.COMPONENT.BAR_AXIS,gv.COMPONENT.GROUP_AXIS,"outer-axis-overlay","inner-axis-overlay",gv.COMPONENT.LEGEND_COLOR_CAT],components(e,t){const r={action:e.srcEvent.ctrlKey||n?"set":"toggle",contexts:["selection"],key:t[0].key};return gv.COMPONENT.BAR===t[0].key?[{...r,data:["selectionDimension"]}]:[gv.COMPONENT.BAR_AXIS,gv.COMPONENT.GROUP_AXIS].includes(t[0].key)?[{...r,data:["selectionDimension","axisSelectionDimension"]}]:[r]}},{...e,isLocked:n=>n.some((e=>e.key===gv.COMPONENT.LEGEND_COLOR_CAT))?i.getMain().isSelectionLocked({isMeasureSelectionLocked:t}):e.isLocked(n)})}function qx(e){const t=e.layoutService.meta.isStackedByDimension&&e.layoutService.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1;return function(e,t){if(!e.componentTargetKey)throw new Error("Missing 'componentTargetKey' property");const n={key:"lasso",...e},r=Wv(n);return{interactions:[Gv(n,t)],components:[r]}}({key:"lasso",componentTargetKey:gv.COMPONENT.BAR,components:[t?{key:gv.COMPONENT.STACK_TOTAL_BAR,contexts:["selection"],action:"add"}:{key:gv.COMPONENT.BAR,contexts:["selection"],action:"add",data:["selectionDimension"]}]},e)}function Mx(e){return function(e,t){const n=function(e){const{key:t,targets:n,components:r,fillTargets:i,dock:o}=e;return{key:t,type:"brush-area-dir",layout:{dock:n.map((e=>`@${e}`)).join(",")},settings:{multiple:!0,brush:{components:r},direction:"left"===o||"right"===o?"vertical":"horizontal",bubbles:{align:"left"===o||"top"===o?"end":"start",placement:"inside"},target:{components:i,fill:"rgba(82,204,82,0.2)"}}}}(e);return{interactions:[Jv(e,t,"area")],components:[n]}}({eventName:"discreteRange",components:[{key:gv.COMPONENT.BAR,contexts:["selection"],action:"set",data:["selectionDimension"]}],key:"discreteRangeBrush",targets:["group-axis",gv.COMPONENT.BAR_AXIS,gv.COMPONENT.BAR],fillTargets:["group-axis",gv.COMPONENT.BAR_AXIS],dock:e.dockService.meta.major.dock},e)}function Sx(e,t,n){const{selectionService:r}=e,{isUnsupportedFeature:i}=t,o=void 0===n,a=r.getIsSingleSelect(n),s=xx(e,o,a);if(o||a)return{components:[...s.components],gestures:[...s.interactions]};const l=qx(e),u=function(e,t){return e.layoutService.meta.isStacked||null!=t&&t("rangeSelections")?{components:[],interactions:[]}:Zv({eventName:"measureRange",key:"measureRangeBrush",targets:["y-axis",gv.COMPONENT.BAR],fillTargets:["y-axis"],dock:e.dockService.meta.minor.dock,scale:gv.SCALE.MAIN.MINOR,onEdited(){e.actions.select.emit("end","measureRange")}},e)}(e,i),c=function(e){return e.layoutService.meta.isContinuous?Zv({eventName:"continuousRange",key:"continuousRangeBrush",targets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis",gv.COMPONENT.BAR]:["continuous-axis",gv.COMPONENT.BAR],fillTargets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis"]:["continuous-axis"],observeBrush:!0,multiple:!0,dock:e.dockService.meta.major.dock,scale:e.layoutService.meta.isTime?gv.SCALE.MAIN.MAJOR_INNER:gv.SCALE.MAIN.MAJOR,toLabel({datum:t,data:n,scale:r}){const i=e.layoutService.meta.isTime?r.formatter():e.chart.formatter(gv.FORMATTER.MINOR),o=e.chart&&e.chart.brushSelectionIncludeMax;return`${t!==Math.max(...n)||o?"":"<"}${i(t)}`}},e):{components:[],interactions:[]}}(e),d=Mx(e);return{components:[...s.components,...l.components,...u.components,...d.components,...c.components],gestures:[...l.interactions,...s.interactions,...u.interactions,...d.interactions,...c.interactions]}}function Dx({layoutService:e,viewModel:t,dockService:n}){var r;const{meta:i}=e;if(!i.isStackedByDimension||i.isContinuous)return!1;const{fields:o}=t,a=e.getLayoutValue("components",null),s=a?a.filter((e=>"bar"===e.key))[0]:null;return{key:"shadow-bar",type:"box",data:{extract:[{field:o.majorStack,filter:e=>0!==e.qDown||0!==e.qUp,props:{start:{value:e=>{return t=e.qSubNodes,Number(t.map((e=>e.qMaxPos)).reduce(((e,t)=>e+t),0).toFixed(13));var t}},end:{value:e=>Number(e.qMaxPos.toFixed(13))}}},{field:o.majorStack,filter:e=>0!==e.qDown||0!==e.qUp,props:{start:{value:e=>{return t=e.qSubNodes,Number(t.map((e=>e.qMinNeg)).reduce(((e,t)=>e+t),0).toFixed(13));var t}},end:{value:e=>Number(e.qMinNeg.toFixed(13))}}}]},settings:{major:{scale:gv.SCALE.MAIN.MAJOR},minor:{scale:gv.SCALE.MAIN.MINOR},orientation:n.meta.minor.orientation,box:{width:null!=s&&null!==(r=s.style)&&void 0!==r&&r.width&&s.style.width>0?s.style.width:.7,fill:()=>({type:"pattern",fill:"rgba(165, 165, 165, 0.8)",width:4,height:4,shapes:[{type:"rect",x:0,y:3,width:1,height:1},{type:"rect",x:1,y:2,width:1,height:1},{type:"rect",x:2,y:1,width:1,height:1},{type:"rect",x:3,y:0,width:1,height:1}]})},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:{enabled:t.animations.enabled,trackBy:Ud.shadowBars.trackBy,compensateForLayoutChanges:Ud.bars.compensateForLayoutChanges}}}const Cx={min:"Min",max:"Max"};function wx(e,t,n){const r=n?e.implicitMax:e.implicitMin;return!function(e,t,n){return void 0===n?pb(e,t)||hb(e,t):n===gb.MAX?pb(e,t):hb(e,t)}(Number(r.toFixed(13)),e,t)}function Lx(e,{barComponent:t,type:n,isStacked:r}){var i,o,a,s;const{viewCache:l,layoutService:u,dockService:c}=e,d=l.get("minorMinMax"),m=n===gb.MAX;if(function(e,t){return!e[`hasOther${Cx[t]}`]}(d,n)){if(function(e,t){return!e[`hasExplicit${Cx[t]}`]}(d,n))return!1;if(wx(d,n,m))return!1}if(function(e,t,n){const r=n?e=>e<0:e=>e>0;return e[`hasExplicit${Cx[t]}`]&&r(e[`explicit${Cx[t]}`])}(d,n,m))return!1;let f="end";r&&(f=m?"sumOfPositives":"sumOfNegatives");const p=function(e){let t;return()=>(void 0===t&&(t=e()),t)}((()=>e.chart.scale(gv.SCALE.MAIN.MINOR)[n]())),h=m?e=>e.datum[f].value>p():e=>e.datum[f].value<p(),g=gv.COMPONENT.BAR,y=e.layoutService.getLayoutValue("components",[]),v=y?y.filter((e=>e.key===g))[0]:null;return{type:"box-sliced-hat",key:`sliced-hat-${n}`,layout:{dock:m?c.meta.minor.end:c.meta.minor.start},data:t.data,brush:t.brush,settings:{orientation:t.settings.orientation,major:t.settings.major,minor:t.settings.minor,hat:Y({},t.settings.box,{fill:u.meta.isStacked?"#999":t.settings.box.fill,alignment:1,opacity:1,show:h,width:ub({layoutService:e.layoutService,discrete:e.discrete,componentKey:g}),strokeWidth:null!=v&&null!==(i=v.style)&&void 0!==i&&i.strokeWidth?ab.BAR.STROKE.WIDTH[v.style.strokeWidth.toUpperCase()]:ab.BAR.STROKE.WIDTH.NONE,stroke:null!==(o=null==v||null===(a=v.style)||void 0===a||null===(s=a.strokeColor)||void 0===s?void 0:s.color)&&void 0!==o?o:ab.BAR.STROKE.COLOR})}}}function Ex(e,t){var n;let r;return r=e.isContinuous?1:.7,!e.isContinuous&&null!=t&&null!==(n=t.style)&&void 0!==n&&n.width&&t.style.width>0?t.style.width:r}function Tx(e,{collectionKey:t},n){const{meta:r}=e.layoutService,{fields:i}=e.viewModel,o=r.isStackedByDimension&&!r.isContinuous?"qValue":"qNum",a=e=>"NaN"===e[o]?0:e[o];function s(t){const n=e.ds.field(t).raw(),r=e.ds.field(t).formatter(),i=se.shouldUseFormat(n);return{field:t,reduceLabel:"none",value:a,label:e=>i?(e=>"NaN"===e[o]?"-":r(e[o]))(e):e.qText}}const l=r.isStackedByDimension?e=>"NaN"===e.qValue:e=>!!e.qIsNull;const u={key:t,data:{extract:i.minor.map(((t,o)=>{const a=e.colorService.getMain().getDatumProps(o),u=e.colorService.getMini().getDatumProps(o),c=a[Object.keys(a)[0]],d=null==c?void 0:c.field,m=d?{field:d,reduceLabel:"none",value:e=>void 0!==e.qNum&&"NaN"!==e.qNum?e.qNum:e.qText||"-"}:void 0,f={field:r.isDimensionless?t:i.major,props:{...e.viewModel.selectionDimensionProp(),axisSelectionDimension:{field:0},start:0,end:s(t),null:(p=t,{field:p,reduceLabel:"none",reduce:"first",value:l}),segment:r.isStacked?s(t):void 0,group:r.isGroupedByDimension?{field:i.majorGroup}:void 0,stack:r.isStacked?{field:i.majorStack}:void 0,measureIndex:r.isGroupedByDimension||r.isStackedByDimension?void 0:o,timeStart:r.isContinuous?{field:i.majorNumeric}:void 0,timeEnd:r.isContinuous?{field:i.majorNumeric}:void 0,fillTooltip:m,...a,...u,id:{value:e=>`r${e.qRow}e${e.qElemNumber}m${o}`},customTooltipAttrExps:0!==r.dimensionCount?Eg.getNode(e.layoutService.getLayout(),r):void 0}};var p;return r.isDimensionless&&(f.value=o),void 0!==n&&(f.source=n),se.deleteUndefinedProperties(f.props),f}))}};return r.isStacked&&(u.data.stack={stackKey:e=>e.stack.value,value:e=>e.end.value,offset:"diverging"}),u}function Ax({layoutService:e,viewModel:t},{collectionKey:n}){const{meta:r}=e,{fields:i}=t;if(!r.isStacked)return!1;let o;return o=r.isStackedByMeasure?function(e,t){const n={field:0,props:{sumOfPositives:{fields:t.minor.map((e=>({field:e}))),value:e=>e.reduce(((e,t)=>t>0?e+t:e),0),reduceLabel:"none"},sumOfNegatives:{fields:t.minor.map((e=>({field:e}))),value:e=>e.reduce(((e,t)=>t<0?e+t:e),0),reduceLabel:"none"},null:{fields:t.minor.map((e=>({field:e}))),value:e=>Array.isArray(e)&&e.every((e=>"NaN"===e)),reduceLabel:"none"}}};if(e.isContinuous){const e={field:t.major,value:e=>e.qNum,reduceLabel:"none"};n.props.timeStart=e,n.props.timeEnd=e,n.value=e=>e.qNum}return n}(r,i):function(e,t){if(!e.isContinuous)return{field:t.majorStack,reduceLabel:"none",props:{sumOfPositives:{value:e=>Number(e.qMaxPos.toFixed(13))},sumOfNegatives:{value:e=>Number(e.qMinNeg.toFixed(13))},null:{value:e=>{const{qSubNodes:t=[]}=e;return t.every((e=>"NaN"===((e.qSubNodes||[])[0]||{}).qValue))}}}};const n={field:t.majors[0],value:e=>e.qNum,reduceLabel:"none"};return{field:t.majorStack,trackBy:e=>e.qNum,reduce:e=>e[0],props:{sumOfPositives:{field:t.minor[0],reduceLabel:"none",reduce:e=>e.reduce(((e,t)=>t>0?e+t:e),0)},sumOfNegatives:{field:t.minor[0],reduceLabel:"none",reduce:e=>e.reduce(((e,t)=>t<0?e+t:e),0)},timeStart:n,timeEnd:n}}}(r,i),{key:n,data:{extract:o}}}const Nx="main-collection",kx="stack-total-collection";const Ox="mini-collection",Ix="mini-stack-collection",Px="mini-continuous-collection",Rx="miniCube",Fx=(e,t)=>{const n=(e=>{const t=[Tx(e,{collectionKey:Nx})];return e.layoutService.meta.isStacked&&t.push(Ax(e,{collectionKey:kx})),t})(t),r=((e,t)=>{const n=[];return bh({layoutService:t.layoutService}).miniChart&&(t.reducedDataModel.mode.isContinuous?n.push(Tx(t,{collectionKey:Px},Rx)):t.layoutService.meta.isStacked?n.push(function(e,{collectionKey:t}){const{colorService:n,reducedDataModel:{fields:r,mode:i}}=e;return{key:t,data:{extract:r.minor.map(((e,t)=>{const o={end:{field:e,reduceLabel:"none"},...i.isStackedByMeasure&&!i.isReduced?n.getMain().getDatumProps(t):{}};return i.isContinuous&&(o.timeStart={field:r.major,value:e=>e.qNum},o.timeEnd=o.timeStart),{source:"miniCube",field:r.major,props:o}})),stack:{stackKey:e=>e.value,value:e=>e.end.value,offset:"diverging"}}}}(t,{collectionKey:Ix})):n.push(function(e,{collectionKey:t}){const{colorService:n,reducedDataModel:{fields:r,mode:i}}=e;return{key:t,data:{extract:r.minor.map(((e,t)=>{const o=i.isReduced?{}:n.getMain().getDatumProps(t),a={end:{field:e},start:0,group:{field:r.majorGroup},measureIndex:t,...o},s={source:"miniCube",field:i.isDimensionless?e:r.major,props:a};return i.isDimensionless&&(s.value=t),s}))}}}(t,{collectionKey:Ox}))),n})(0,t);return n.concat(r)};function Hx(e,t,n,r){const i=[{position:e,onBackground:!0,justify:0,overflow:r}];if(t){const t={fill:"#e6e6e6",padding:{left:2,right:2,top:2,bottom:2}};i.push({position:"inside",onBackground:!1,justify:"outside"===e?1:0,background:n?t:void 0})}return i}function zx({layout:e,component:t},n,r){if(!Ab(e,n))return!1;const{layoutService:i,chart:o,dockService:a,viewModel:s,themeService:l,styleService:u}=n,{meta:c}=i,d=!Tb(e,n),m=l.getStyles(),f=u.label.getStyle(),p=f.useContrastColor;function h(e){const t=o.formatter(gv.FORMATTER.MINOR);return t?t(e):e}const g={label:function(e){return 0===e.data.sumOfPositives.value&&0!==e.data.sumOfNegatives.value?"":h(e.data.sumOfPositives.value)},simplifiedPlacements:Hx("outside",d,p,c.isContinuous),style:m.label.value},y={label:function(e){return 0===e.data.sumOfNegatives.value&&0!==e.data.sumOfPositives.value?"":h(e.data.sumOfNegatives.value)},simplifiedPlacements:Hx("opposite",d,p,c.isContinuous),style:m.label.value},v=[Db(Y(n,g)),Db(Y(n,y))];return{key:"stack-total-labels",type:"labels",renderer:om(n.flags),layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:t,selector:"rect",strategy:{type:"bar",settings:{direction:e=>Eb(e.data.sumOfPositives.value,a.meta.minor.orientation,r),labels:v,fontSize:parseInt(f.fontSize,10),fontFamily:f.fontFamily,linkData:Ud.labels.linkData}}}]},animations:{enabled:s.animations.enabled,trackBy:Ud.labels.trackBy,compensateForLayoutChanges:Ud.labels.compensateForLayoutChanges}}}function jx(e,t,n){const r=[{position:e,justify:0,overflow:n,background:{padding:{left:1,right:1,top:1,bottom:1}}}];return t&&r.push({position:"inside",onBackground:!1,justify:1,background:{padding:{left:2,right:2,top:2,bottom:2}}}),r}function Bx({layout:e,type:t},n){const{layoutService:r,viewCache:i,themeService:o,styleService:a}=n,{meta:s}=r,{isStacked:l}=s;if(!l&&!Tb(e,n)||l&&!Ab(e,n))return!1;const u=i.get("minorMinMax");if(!u.hasExplicitMinMax||t===gb.MAX&&0===u.max||t===gb.MIN&&0===u.min)return!1;if(!vb(t===gb.MAX?u.implicitMax:u.implicitMin,u,t))return!1;const c=o.getStyles(),d=a.label.getStyle();let m=e=>e.data.end.label;s.isStacked&&(m=t===gb.MAX?function(e){if(vb(e.data.sumOfNegatives.value,u,t)){const t=0===e.data.sumOfNegatives.value?e.data.sumOfPositives.value:e.data.sumOfNegatives.value,r=n.chart.formatter(gv.FORMATTER.MINOR);return r?r(t):t}return""}:function(e){if(vb(e.data.sumOfPositives.value,u,t)){const t=0===e.data.sumOfPositives.value?e.data.sumOfNegatives.value:e.data.sumOfPositives.value,r=n.chart.formatter(gv.FORMATTER.MINOR);return r?r(t):t}return""});const f={label:m,simplifiedPlacements:jx("outside",true,s.isContinuous),styles:c},p={label:m,simplifiedPlacements:jx("opposite",true,s.isContinuous),styles:c},h=[Db(Y(n,f)),Db(Y(n,p))],g="vertical"===n.dockService.meta.minor.orientation?"down":"right",y=[{component:`${gv.COMPONENT.GHOST_BAR_OOB}-${t}`,selector:"rect",strategy:{type:"bar",settings:{direction:g,labels:h,fontSize:parseInt(d.fontSize,10),fontFamily:d.fontFamily,linkData:Ud.labels.linkData}}}];return{key:`bar-oob-labels-${t}`,type:"labels",renderer:om(n.flags),layout:{minimumLayoutMode:"XSMALL"},settings:{sources:y},animations:{enabled:n.viewModel.animations.enabled,trackBy:Ud.labels.trackBy,compensateForLayoutChanges:Ud.labels.compensateForLayoutChanges}}}function Vx(e){return"all"===e||"title"===e}function _x(e,t,n){if(!Vx(e.dimensionAxis.show)||t.layoutService.meta.isDimensionless)return!1;const{actions:r,properties:i}=t,o={hyperCube:e.qHyperCube,hyperCubeDef:i&&i.qHyperCubeDef,isDimension:!0,disabled:()=>{var e;return!(null!=r&&null!==(e=r.interact)&&void 0!==e&&e.enabled())},model:t.model,app:t.app,translator:t.translator,rtl:n,selections:t.selections,supportConditional:t.flags.isEnabled("IM_1579_HIDE_DIM_MEA")},a=t.styleService.axis.title.getStyle();return t.layoutService.meta.hasMultipleDimensions&&(o.padding="0",o.minWidth="auto"),{key:"dimension-title",type:"data-title",layout:{minimumLayoutMode:Qv[`${t.dockService.meta.major.orientation}DimensionAxisTitle`].minimumLayoutMode,dock:t.dockService.meta.major.dock},settings:o,style:a}}function Ux(e,t,n){if(!Vx(e.measureAxis.show))return!1;const{layoutService:r,actions:i}=t,o=t.properties,a=r.getLayoutValue("qUndoExclude")?"qUndoExclude.qHyperCubeDef":"qHyperCubeDef",s={hyperCube:r.getHyperCube(),hyperCubeDef:tu(o,a),isDimension:!1,disabled:()=>!i.interact.enabled(),model:t.model,app:t.app,translator:t.translator,rtl:n,selections:t.selections,supportConditional:t.flags.isEnabled("IM_1579_HIDE_DIM_MEA")},l=t.styleService.axis.title.getStyle();return t.layoutService.meta.hasMultipleMeasures&&(s.padding="0",s.minWidth="auto"),{key:"measure-title",type:"data-title",layout:{minimumLayoutMode:"SMALL",dock:t.dockService.meta.minor.dock},settings:s,style:l}}function $x({environment:e,rtl:t,refLineModel:n,layoutService:r,colorService:i,dockService:o,themeService:a,viewModel:s,chart:l}){const{theme:u,localeInfo:c}=e,d={resolveUIColor:i.getMain().getPaletteColor},m=a.getStyles(),f=s.animations.enabled;return[Xd({refLineModel:n,layoutService:r,colorModel:d,dockService:o,animationsEnabled:f,chart:l,scale:gv.SCALE.MAIN.MINOR,axis:"horizontal"===o.meta.major.orientation?"y":"x",key:gv.COMPONENT.MEASURE_REF_LINE,minimumLayoutMode:Qv.refLines.minimumLayoutMode}),Xd({isDimension:!0,refLineModel:n,layoutService:r,colorModel:d,dockService:o,animationsEnabled:f,chart:l,scale:gv.SCALE.MAIN.MAJOR,axis:"horizontal"===o.meta.major.orientation?"x":"y",rtl:t,key:gv.COMPONENT.DIMENSION_REF_LINE,mainComponentKey:gv.COMPONENT.BAR,minimumLayoutMode:Qv.refLines.minimumLayoutMode}),...em({refLineModel:n,layoutService:r,colorModel:d,animationsEnabled:f,dock:o.meta.minor.opposite,scale:gv.SCALE.MAIN.MINOR,style:m,formatter:gv.FORMATTER.MINOR,theme:u,localeInfo:c,rtl:t,key:gv.COMPONENT.MEASURE_REF_LINE_LABEL}),...em({isDimension:!0,refLineModel:n,layoutService:r,colorModel:d,animationsEnabled:f,dock:o.meta.major.opposite,scale:gv.SCALE.MAIN.MAJOR,style:m,theme:u,localeInfo:c,rtl:t,key:gv.COMPONENT.DIMENSION_REF_LINE_LABEL})]}const Wx=(e,t,n)=>{var r;const{layoutService:i,dockService:o,colorService:a,chart:s,actions:l,discrete:u,continuousDataModel:c,reducedDataModel:d,viewModel:m,viewState:f,viewCache:p,themeService:h,refLineModel:g,pluginService:y,rtl:v,logicalSize:b,trendLineModel:x}=t,{localeInfo:q}=n,M=Hb({layout:e},t,v);if(M&&"center"===M.layout.dock)return{components:[M]};const S=bx(e,t,{localeInfo:q,rtl:v}),D=!(null!=l&&null!==(r=l.interact)&&void 0!==r&&r.enabled()),C=a.getMain().getLegend({eventName:"legend-c",key:"legend-color",viewState:f,chart:s,styleReference:"object.barChart",styleOverrides:{title:t.styleService.legend.title.getStyle(),label:t.styleService.legend.label.getStyle()},rtl:v,settings:{item:{shape:{size:10}}}},{actions:l,navigationDisabled:D}),w=C.components[0];if(w){const{dock:e}=w.layout;if(S.fillRange&&(["right","left"].includes(e)||v)&&(S.fillRange.invert=!0),"legend-seq"===w.type&&void 0!==m.selectionDimensionIdx&&S.fillRange&&S.fillRange.min<S.fillRange.max){const e=Zv({eventName:"legendRange",key:"legendRangeBrush",targets:[w.key],fillTargets:[w.key],targetSelector:'[id="legend-seq-target"]',targetFillSelector:'[id="legend-seq-ticks"]',dock:w.layout.dock,scale:"fillRange",bubblesPlacement:"outside",onEdited:()=>{l.select.emit("end","legendRange")}},t);C.components.push(...e.components),C.interactions.unshift(...e.interactions)}}else S.fillRange&&v&&(S.fillRange.invert=!0);const L=((e,{componentKey:t,collectionKey:n})=>{var r,i,o,a;const{meta:s}=e.layoutService;let l,u;s.isGroupedByDimension?l=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:s.isGroupedByMeasure&&(l=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2);let c=2;s.isContinuous?(u={start:"timeStart",end:"timeEnd"},c=db(e,t)):s.isStacked&&(u="stack");const d=s.isStackedByDimension&&e.layoutService.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1,m=e=>{var t;return!0===(null===(t=e.datum.null)||void 0===t?void 0:t.value)},f=e.layoutService.getLayoutValue("components",null),p=f?f.filter((e=>e.key===t))[0]:null;return{key:t,type:"box",data:{collection:n},preferredSize:s.isContinuous?()=>({size:0,edgeBleed:{left:1,right:1}}):void 0,brush:{consume:[{context:"selection",data:["selectionDimension","axisSelectionDimension","end","fill","timeEnd"],style:{active:{strokeWidth:s.isContinuous||d?0:2,stroke:"#000"},inactive:{opacity:.3}}}]},settings:{major:{scale:gv.SCALE.MAIN.MAJOR,fn:l,ref:u},minor:{scale:gv.SCALE.MAIN.MINOR},orientation:e.dockService.meta.minor.orientation,box:{width:ub({layoutService:e.layoutService,discrete:e.discrete,componentKey:t}),minWidthPx:c,fill:e.colorService.getMain().getColor(),opacity:e=>m(e)?0:void 0,minHeightPx:function(e){return s.isStacked?.1:m(e)?.01:.3},strokeWidth:null!=p&&null!==(r=p.style)&&void 0!==r&&r.strokeWidth?ab.BAR.STROKE.WIDTH[p.style.strokeWidth.toUpperCase()]:ab.BAR.STROKE.WIDTH.NONE,stroke:null!==(i=null==p||null===(o=p.style)||void 0===o||null===(a=o.strokeColor)||void 0===a?void 0:a.color)&&void 0!==i?i:ab.BAR.STROKE.COLOR},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:{enabled:e.viewModel.animations.enabled,isMainComponent:!0,trackBy:Ud.bars.trackBy,compensateForLayoutChanges:Ud.bars.compensateForLayoutChanges}}})(t,{componentKey:gv.COMPONENT.BAR,collectionKey:gv.COLLECTION.MAIN}),E=((e,{componentKey:t,collectionKey:n})=>{const{meta:r}=e.layoutService;if(!r.isStacked)return!1;let i=2;r.isContinuous&&(i=db(e,t));const o=e.layoutService.getLayoutValue("components",null),a=o?o.filter((e=>e.key===t))[0]:null,s={key:t,type:"box",data:{collection:n},settings:{major:{scale:gv.SCALE.MAIN.MAJOR},minor:{scale:gv.SCALE.MAIN.MINOR,start:{ref:"sumOfNegatives"},end:{ref:"sumOfPositives"}},orientation:e.dockService.meta.minor.orientation,box:{width:Ex(r,a),minWidthPx:i,opacity:0,fill:"none"},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},brush:{consume:[{context:"selection",data:[""],style:{active:{strokeWidth:2,stroke:"#000",opacity:e=>{var t,n;return!0===(null===(t=e.data)||void 0===t||null===(n=t.null)||void 0===n?void 0:n.value)?0:1}},inactive:{opacity:e=>{var t,n;return!0===(null===(t=e.data)||void 0===t||null===(n=t.null)||void 0===n?void 0:n.value)?0:.3}}}}]}};return r.isContinuous&&(s.settings.major.ref={start:"timeStart",end:"timeEnd"}),s})(t,{componentKey:gv.COMPONENT.STACK_TOTAL_BAR,collectionKey:gv.COLLECTION.STACK_TOTAL}),T=Sx(t,n,m.selectionDimensionIdx),{isStacked:A}=i.meta;let N;N=d.mode.isContinuous?gv.COLLECTION.MINI_CONTINUOUS:A?gv.COLLECTION.MINI_STACK:gv.COLLECTION.MINI;const k=A?E:L,O=Kb(0,t),I=[...O,Lx(t,{barComponent:k,type:"max",isStacked:A}),Lx(t,{barComponent:k,type:"min",isStacked:A}),xb(t,{barComponent:k,type:"max",isStacked:A}),xb(t,{barComponent:k,type:"min",isStacked:A}),Mb(t,{chart:s,barComponent:k,type:"max",scales:S,collectionKey:A?gv.COLLECTION.STACK_TOTAL:gv.COLLECTION.MAIN}),Mb(t,{chart:s,barComponent:k,type:"min",scales:S,collectionKey:A?gv.COLLECTION.STACK_TOTAL:gv.COLLECTION.MAIN}),...ob(e,t,v,!!O[0]),L,E,Dx({layoutService:i,viewModel:m,layout:e,dockService:o}),_x(e,t,v),Ux(e,t,v),...$x({environment:n,rtl:v,refLineModel:g,layoutService:i,colorService:a,dockService:o,themeService:h,viewModel:m,chart:s}),_o({viewState:f,viewCache:p,layoutService:i,dockService:o,rtl:v}),nx(L,t,{collectionKey:N}),xh({layoutService:i,dockService:o,discrete:u,continuousDataModel:c,viewState:f,viewCache:p,themeService:h,rtl:v,deviceType:n.deviceType}),...Xy({majorScale:gv.SCALE.MAIN.MAJOR,minorScale:gv.SCALE.MAIN.MINOR,tooltipOverlay:gv.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{layoutService:i,trendLineModel:x,dockService:o,animationsEnabled:m.animations.enabled}),...C.components,kb({layout:e,component:gv.COMPONENT.BAR,minorScale:S.minor},t,v),zx({layout:e,component:gv.COMPONENT.STACK_TOTAL_BAR},t,v),Bx({layout:e,component:"bar-oob-max",type:"max"},t),Bx({layout:e,component:"bar-oob-min",type:"min"},t),...T.components,Ib(0,{...t,coloring:a.getMain().getSettings()},v),Rb(0,{...t,coloring:a.getMain().getSettings()},v),(!1!==e.showDisclaimer||!t.flags.isEnabled("SHOW_DISCLAIMER"))&&M,nv({tooltip:gv.COMPONENT.TREND_LINES_TOOLTIP,formatter:gv.FORMATTER.MINOR,majorScale:gv.SCALE.MAIN.MAJOR},t,{rtl:v})].filter(Boolean);!function(e){if(e&&0!==e.length)for(let t=0;t<e.length;t++)e[t].layout=e[t].layout||{},e[t].layout.displayOrder=t}(I);const P=[...C.interactions,...T.gestures].sort(((e,t)=>(t.prio||0)-(e.prio||0)));return{interactions:ex(t,{rtl:v,hammer:{gestures:P}}),scales:S,palettes:a.getMain().getPalettes(),components:y.extendComponents(I),strategy:ne(0,{logicalSize:b,minCenterRatio:0}),formatters:zb(t,S),collections:Fx(0,t)}};function Kx({picasso:e,chart:t,services:n,environment:r,viewState:i,viewCache:o,bootstrapped:a}){const{width:s,height:l}=O(),u=E(),c=N(),d=D(),[m,f]=b(),[p,h]=b(),[g,y]=b(),[v,x]=b(),q=T();function S(){if(!t.layoutComponents)return Promise.resolve();const{discrete:a,layoutService:s,viewModel:l}=n;o.set("isPreRender",!0);const f=function(a={}){const{selectionService:s,refLineModel:l,discrete:f,reducedDataModel:p,continuousDataModel:h,trendLineModel:g,pluginService:y,colorService:v,viewModel:b,dockService:x,themeService:M,customTooltipModel:S,layoutService:D,logicalSize:C,styleService:w}=n,L=s.custom.getActions(),E=e.data("q")(m.prepPicassoDataSet()),T={picasso:e,ds:E,rtl:"rtl"===(null==d?void 0:d.direction),model:u,app:q,chart:t,actions:L,localeInfo:r.localeInfo,logicalSize:C,flags:r.flags,translator:r.translator,selections:c,isLocked:s.getIsSelectionLocked,viewCache:o,viewState:i,layoutService:D,dockService:x,viewModel:b,colorService:v,selectionService:s,themeService:M,trendLineModel:g,discrete:f,continuousDataModel:h,reducedDataModel:p.model(),customTooltipModel:S,debouncer:au,refLineModel:l,pluginService:y,styleService:w,...a};return Wx(D.getLayout(),T,r)}(p);m.extractDataPages(),t.layoutComponents({settings:f,data:g}),o.set("isPreRender",!1),m.insertDataPages(),l.animations.hasSlicedHats=f.components.filter((e=>"box-sliced-hat"===e.type)).length>0;const h=[];return 1!==f.components.length&&s.meta.isDiscrete&&h.push(a.command.initialize()),Promise.all(h)}const[[C,w]=[]]=I((()=>{var s,l;if(!(e&&t&&n&&r&&i&&o&&a))return Promise.resolve();const{layoutService:u,selectionService:c,refLineModel:d,discrete:m,continuous:f,reducedDataModel:p,continuousDataModel:h,trendLineModel:g,legendLayoutService:y,colorService:v,pluginService:b,viewModel:q,customTooltipModel:M}=n;if(null==c||null===(s=c.custom)||void 0===s||!s.getActions())return Promise.resolve();const{flags:S}=r;if(null!=S&&null!==(l=S.isEnabled)&&void 0!==l&&l.call(S,"IM_1579_HIDE_DIM_MEA")){const{properties:e}=a,t=null==e?void 0:e.qHyperCubeDef.qDimensions.some((e=>{var t,n;return null===(t=e.qCalcCondition)||void 0===t||null===(n=t.qCond)||void 0===n?void 0:n.qv}));t&&(M.useCustomTooltip=!1)}const D=()=>{x(Date.now()),q.animations.isPartialUpdating=!0};i.onChanged("scrollOffset",(()=>{y&&y.setDataPages([m.query.getCurrentDataPage()]),d&&d.update(),D()})),i.onChanged("legendScrollOffset",D),i.intercept("zoom",f.event.onZoomIntercept({viewCache:o})),i.onChanged("zoom",f.event.onZoomChange({layoutService:u,continuousDataModel:h},D)),c.setLayout(u.getLayout());const C=[];u.meta.isContinuous&&(h.update(u.getLayout()),C.push(h.initialFetch())),g.command.update(),C.push(p.fetch().then((({reducedCube:e})=>{p.update(e)}))),C.push(Promise.resolve({properties:a.properties}));return Promise.all(C).then((e=>Promise.all([b.initialize(),v.initialize(),$v({reducedDataModel:p,layoutService:u,continuousDataModel:h,trendLineModel:g})]).then((t=>[e,t.pop()]))))}),[a]);M((()=>{var e;if(null==n||null===(e=n.colorService)||void 0===e||!e.getMain()||!w)return;const{layoutService:t,selectionService:i,reducedDataModel:a,continuousDataModel:s,trendLineModel:l,legendLayoutService:u,colorService:c,viewModel:d}=n;o.set("minorMinMax",w);const m=t.getHyperCube(),p=t.meta.isContinuous?s.getInitialCube():a.model().cube,{field:g}=c.getMain().getSettings(),y=!t.meta.isContinuous&&(a.model().mode.isReduced||t.meta.isStacked)&&u,v=y?u.getHyperCube():void 0;i.setBrushAliases({colorField:g,useLegendCube:y,legendAlias:`legendCube/${g}`});const b=function({mainCube:e,miniCube:t,legendCube:n,localeInfo:r,layoutService:i,viewModel:o,trendLineModel:a}){const s=i.refs.dataPages.split(".").pop();let l=[],u=[];const c=i.meta.isContinuous?[{key:o.fields.majorNumeric,from:i.meta.isStackedByDimension?o.fields.majorStack:o.fields.major,override:{value:e=>e.qNum}}]:void 0;return{prepPicassoDataSet:()=>({key:"qHyperCube",data:e,config:{localeInfo:r,virtualFields:c}}),prepPicassoData(i){const o=[{type:"q",key:"qHyperCube",data:e,config:{localeInfo:r,virtualFields:c}},{type:"q",key:"miniCube",data:t,config:{localeInfo:r,virtualFields:c}},...i];return n&&o.push({type:"q",key:"legendCube",data:n,config:{localeInfo:r,virtualFields:c}}),a.query.hasTrendLines()&&o.push({key:"trend",data:a.query.getData()}),o},extractDataPages(){l=e[s],u=t.qDataPages,e[s]=[],t.qDataPages=[]},insertDataPages(){e[s]=l,t.qDataPages=u}}}({mainCube:m,miniCube:p,legendCube:v,localeInfo:r.localeInfo,layoutService:t,viewModel:d,trendLineModel:l}),x=C[C.length-1];h({localeInfo:r.localeInfo,...x}),f(b)}),[w]),M((()=>{if(!n||!p||!m)return;const e=n.colorService.getMain();if(!e)return;m.prepPicassoDataSet();const t=m.prepPicassoData(e.getData());y(t)}),[p]),M((()=>{var e;null!=n&&null!==(e=n.colorService)&&void 0!==e&&e.getMain()&&t.update&&m&&g&&S().then((()=>{const{layoutService:e,discrete:r,legendLayoutService:i}=n;if(i){1===e.getLayoutValue("scrollStartPos")&&i.setDataPages([r.query.getCurrentDataPage()])}t.update(),Ud.cacheProperties({viewCache:o,layout:e.getLayout()})}))}),[g]),M((()=>{if(!(s&&l&&m&&null!=t&&t.update&&null!=n&&n.colorService.getMain()))return;const{viewModel:e}=n;e.animations.isSizeChanging=!0;const{dockService:i,themeService:o}=n;i.update({width:s,height:l}),o.setTheme(r.theme),S().then((()=>{t.update&&t.update()}))}),[s,l]),M((()=>{if(null==t||!t.update)return;const{viewModel:e}=n;t.update({partialData:!0,excludeFromUpdate:["mini-marker","dim-title","measure-title","ref-line","grid-line"]}),e.animations.isPartialUpdating=!1}),[v])}const Gx=({properties:e,layout:t,isStacked:n,isContinuous:r,model:i,layoutService:o})=>{var a,s;const l=t.qHyperCube.qDimensionInfo.filter((e=>{var t;return 7005!==(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)})),u=t.qHyperCube.qMeasureInfo.filter((e=>{var t;return 7005!==(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)})),c=Y(!0,{},e);return((e,t,n)=>{const{color:{mode:r}}=n;e.length>1&&n.color?n.color.persistent=!0:"byDimension"===r&&t.length>1?n.color.mode="byMultiple":"byExpression"===r&&0===t.length?n.color.mode="primary":0===e.length&&t.length>0&&(n.color.byMeasureDef=void 0,n.color.byDimDef=void 0,1===t.length&&(n.color.mode="primary"))})(l,u,e),l.length>1&&n&&!r&&"S"===e.qHyperCubeDef.qMode&&(e.qHyperCubeDef.qMode="K"),l.length<2&&"K"===e.qHyperCubeDef.qMode&&(e.qHyperCubeDef.qMode="S"),null===(a=i.colorSupport)||void 0===a||null===(s=a.colorByUpdater)||void 0===s||s.call(a,e,"qHyperCubeDef.",t),function({properties:e,layoutService:t}){const{filteredFields:n}=t.meta;if(!(n.measures.length>0))return;const{mode:r}=e.color||{};if("byExpression"===r){var i,o,a,s;if("colorByExpression"===(null===(i=t.getLayout().qHyperCube.qMeasureInfo)||void 0===i||null===(o=i[0])||void 0===o||null===(a=o.qAttrExprInfo)||void 0===a||null===(s=a[0])||void 0===s?void 0:s.id))return;const{current:r,target:l}=function({properties:e,filtered:t}){const{qMeasures:n}=e.qHyperCubeDef||[],{current:r,target:i}=n.reduce(((e,n,r)=>{var i;return"colorByExpression"===(null===(i=n.qAttributeExpressions[0])||void 0===i?void 0:i.id)&&(e.current=r),void 0!==e.target||t.includes(r)||(e.target=r),e}),{current:void 0,target:void 0});return{current:r,target:i}}({properties:e,filtered:n.measures});if(void 0===r)return;const u=e.qHyperCubeDef.qMeasures[r].qAttributeExpressions[0];e.qHyperCubeDef.qMeasures[r].qAttributeExpressions.splice(0,1),e.qHyperCubeDef.qMeasures[l].qAttributeExpressions.splice(0,0,u)}}({properties:e,layoutService:o}),JSON.stringify(c)!==JSON.stringify(e)&&(e.hash=Math.random(),!0)};var Yx={exports:{}};self,Yx.exports=(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,u,c,d=arguments[0],m=1,f=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},m=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});m<f;++m)if(null!=(t=arguments[m]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(p&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&a(r)?r:{},s(d,{name:n,newValue:e(p,c,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}},645:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,u,c,d=arguments[0],m=1,f=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},m=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});m<f;++m)if(null!=(t=arguments[m]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(p&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&a(r)?r:{},s(d,{name:n,newValue:e(p,c,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Ne});var e=r(229),t=r.n(e);const n=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},o=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function u(e){return s+e+l}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function h(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function v(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function b(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var u=v(c(r[0],i),p(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(r&&2===r.length){var d=c(r[0],i),m=c(r[1],i),f=p(0),h=p(1),g=v(d,f),y=v(m,h);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function q(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const M={isFullRange:d,getNumDimensions:q,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=u(f(t));if(!n.showExcludedValues)return a;var s=b({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=p(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var d=p(0),m=p(1);return"If(Count(".concat(d,") * Count(").concat(m,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:m,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return m(e,t)},getAboveCompPrefix:h,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return h(e,t)+n+g(r)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===q({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:c,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=q({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=n.qHyperCubeDef.qMeasures.find((function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null}));i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=a.OPTIONS.find((function(t){return t.value===e.decomposition}));return t?a.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find((function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[n]&&r.includes(a.EXPRESSIONS[n].toLowerCase())&&(t=n),n})),t}};function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function D(e){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D(e)}var C=t().bind(null,!0),w={},L=Array.isArray;function E(e){return null!=e&&!Array.isArray(e)&&"object"===D(e)}function T(e){return void 0===e}function A(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function N(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach((function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=T(e[n||t])?o:e[t],e=e[n||t]}})),e}function k(e,t){var n=!0;if(E(e)&&E(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){k(e[r],t[r])||(n=!1)})),n);if(L(e)&&L(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!k(e[r],t[r]))return!1;return!0}return e===t}w.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?C({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);k(o,a)||A(t,i)||(T(a)?r.push({op:"add",path:s,value:o}):E(o)&&E(a)?r=r.concat(w.generate(a,o,s)):L(o)&&L(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&T(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(k(t,i))return r;if(!T(t[0])&&T(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(w.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){T(t[i])&&!A(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},w.apply=function(e,t){t.forEach((function(t){var n,r,i=N(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(L(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(L(a)&&L(t.value)){var l,u=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return S(e)}(r=u)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(E(a)&&E(t.value))n=a,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!A(n,e)&&delete n[e]})),C(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var c=N(e,t.from);L(i)?i.splice(+o,0,c.splice(+s,1)[0]):(i[o]=c[s],delete c[s])}else"remove"===t.op&&(L(i)?i.splice(+o,1):delete i[o])}))},w.clone=function(e){return C({},e)},w.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},w.updateObject=function(e,t){Object.keys(e).length?w.apply(e,w.generate(e,t)):C(e,t)};const O=w,I=function(e,n,r){if(!e)return Promise.resolve();var i=O.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(i,!0)):Promise.resolve()};var P="accumulation";function R(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===P)return n[r]}function F(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===P)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var H={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const z={translationKey:"properties.modifier.accumulation",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=M.getNumStepComp(n,l),m=M.getAboveComp(n,l,c,d),f=M.getRangeComp("RangeSum",m);if(M.needDimension({modifier:n,properties:r,layout:i})){var p=M.getDimComp(u,1),h=M.getDimComp(u,0),g=M.getAggrComp(f,p,h);f=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return f},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(F(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(F(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(F(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(F(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=R(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=R(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(F(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(P))return!1;var o=R(t,e);return o&&!o.disabled}};return n}};var j="movingAverage";function B(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===j)return n[r]}function V(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===j)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var _={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const U={translationKey:"properties.modifier.movingAverage",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var u=s;void 0===u&&(u=M.getNumDimensions({properties:i,layout:a}));var c=o(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,m=M.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:d}),f=M.getNumStepComp(r,u),p=M.getAboveComp(r,u,m,f);if(r.nullSuppression)t=M.getRangeComp("RangeAvg",p);else{var h=M.getRangeComp("RangeSum",p),g=function(e,t){var n=M.getRowNoComp(e,t);if(!M.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,u);t="".concat(h," / ").concat(g)}var y=t;if(M.needDimension({modifier:r,properties:i,layout:a})){var v=M.getDimComp(c,1),b=M.getDimComp(c,0),x=M.getAggrComp(y,v,b);y=r.showExcludedValues?M.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,_)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(V(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(V(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(V(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(V(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=B(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=B(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(V(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(V(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(j))return!1;var o=B(t,e);return o&&!o.disabled}};return n}};var $="timeSeriesDecomposition";function W(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===$)return n[r]}function K(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===$)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var G={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const Y={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?M.generateTSDExpression(n,t,r):t},extractInputExpression:M.extractInputExpression,initModifier:function(e,t){M.initModifier(e,G),""===e.decomposition&&t&&(e.decomposition=M.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(K(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:a.OPTIONS},steps:{refFn:function(t){return"".concat(K(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=W(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map((function(e){return e.qDef.modifiers.map((function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e})),e}))}},show:function(t){var n=W(t,e);return n&&!n.fullRange}}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf($))return!1;var o=W(t,e);return o&&!o.disabled}};return n}};var X="difference";function J(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===X)return n[r]}function Z(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===X)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=M.getAboveComp(n,l,c),m="".concat(c," - ").concat(d);if(M.needDimension({modifier:n,properties:r,layout:i})){var f=M.getDimComp(u,1),p=M.getDimComp(u,0),h=M.getAggrComp(m,f,p);m=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:h}):h}return m},initModifier:function(e){Object.keys(Q).forEach((function(t){void 0===e[t]&&(e[t]=Q[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(Z(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(X))return!1;var o=J(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,n){return 1===e?"{$<".concat(M.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ue(e,t,n){return 0===e&&t>1?"<".concat(M.getDimDefWithWrapper(n),">"):""}const ce={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=n.selectionScope,m=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=ae(t),l=se(t,n,r),u=""===s&&""===l?"":s||l,c=le(i,o),d=ue(i,o,a),m=function(e){for(var t=[],n=0;n<e;n++)t[n]=M.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(d," Aggr(").concat(u," ").concat(e,", ").concat(m,"))")}(c,d,n.field,n.value,m,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach((function(t){void 0===e[t]&&(e[t]=oe[t])}))},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var r=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return r=function(e,t,n){if(1===e){var r=ie(t,0);t.splice(r,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(re(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(re(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,r){return function(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t,n){if(e<2){var r=ie(t,0);t.splice(r,1)}return t}(i,o),o=function(e,t,n){if(0===e){var r=ie(t,1);t.splice(r,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ue};var de="qDef.base",me="qDef.qDef",fe="qDef.base.qDef",pe="qLibraryId",he="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,fe);return void 0!==t?t:o(e,me)},getExpressionRef:function(e){return void 0!==o(e,fe)?fe:me},getLibraryIdRef:function(e){return o(e,he)?he:pe},getLibraryId:function(e){return o(e,he)||o(e,pe)},getLabelRef:function(e){return o(e,de)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,de)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",qe="qDef.qLabel",Me="qDef.qLabelExpression",Se="qDef.base.qLabel",De="qDef.base.qLabelExpression",Ce="qDef.qAggrFunc",we="qDef.base.qAggrFunc",Le={initBase:function(e,t){(t||Le.isValid(e))&&(n(e,ve,o(e,ye)),n(e,xe,o(e,be)),n(e,Se,o(e,qe)),n(e,De,o(e,Me)))},restoreBase:function(e){Le.isValid(e)&&(n(e,ye,o(e,ve)),n(e,be,o(e,xe)),n(e,qe,o(e,Se)),n(e,Me,o(e,De)),o(e,Ce)&&o(e,we)&&n(e,Ce,o(e,we)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),n=o(e,xe);return void 0!==t||void 0!==n}};const Ee=Le;function Te(e){return Te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Te(e)}var Ae={accumulation:z,movingAverage:U,difference:ee,normalization:ce,timeSeriesDecomposition:Y};const Ne={modifiers:Ae,apply:Oe,applyModifiers:Ie,cleanUpMeasure:Pe,destroy:function(e){e&&ke[e.id]&&ke[e.id].masterItemSubscriber&&(ke[e.id].masterItemSubscriber&&ke[e.id].masterItemSubscriber.unsubscribe(),delete ke[e.id])},hasActiveModifiers:Re,getActiveModifier:Fe,initBase:Ee.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return Ae[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return Ae[e]&&Ae[e].isApplicable({properties:n,layout:r})}))},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=je(e);Ke({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ze({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:He};var ke={};function Oe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,a=void 0!==i&&i,s=e.masterItem,l=!1;ke[n.id]=ke[n.id]||{isFirstTime:!0};var u=ke[n.id].isFirstTime;if(ke[n.id].isFirstTime=!1,r&&"object"===Te(r))return Ie({model:n,properties:r});var c=n?n.layout:void 0,d=o(c,"qSelectionInfo.qInSelections");if(a||d)return Promise.resolve(l);var m=o(c,"qHyperCube.qMeasureInfo"),f=ke[n.id].lastReloadTime;if(ke[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Re({measures:m,layout:c})){var p=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return We({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:m,layout:c,model:n,lastReloadTime:f});return p||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return Ke({modifiers:je(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:m,layout:c,masterItem:s,isFirstTime:u})?n.getEffectiveProperties().then((function(e){var r=t()(!0,{},e);Ve(r);var i=Qe(r);return Ge({model:n}).then((function(t){return Ye({libraryIds:i,model:n}).then((function(i){return p&&function(e){var t=e.properties;ze(t).forEach((function(e){return function(e){var t=e.measure;if(We({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===Te(e)&&!e.disabled){if(n++,"object"!==Te(Ae[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=Ae[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Ue(t)&&M.simplifyExpression(t.qDef.base.qDef)!==M.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:r}),Ie({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:i,dimensionAndFieldList:t})}))}))})):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===Te(e.base)}))}(m)?n.getEffectiveProperties().then((function(e){return function(e){var n=e.model,r=e.properties,i=Qe(r);return et({model:n,libraryIds:i}).then((function(){var e=t()(!0,{},r);return ze(r).forEach((function(e){return Pe(e)})),Je({oldProperties:e,newProperties:r,model:n})}))}({model:n,properties:e})})):Promise.resolve(l)}function Ie(e){var n=e.model,r=e.oldProperties,i=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),Ve(i);var m=Qe(i);return et({model:n,libraryIds:m,masterItem:u}).then((function(){return function(e){var n=e.measures,r=e.properties,i=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=ze(r)),!n.length)return Promise.resolve();if(!Re({measures:n,properties:r}))return n.forEach((function(e){return Pe(e)})),Promise.resolve();var l=a?void 0:Qe(r);return Ge({model:i,dimensionAndFieldList:s}).then((function(e){return Ye({libraryIds:l,model:i,libraryItemsProps:a}).then((function(i){n.forEach((function(n){Ke({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;Ee.isValid(n)||Ee.initBase(n,!0);var l=n.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach((function(e){if("object"===Te(e)&&!e.disabled){if(s++,"object"!==Te(Ae[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Ae[e.type].initModifier(e,n);var l=n.qLibraryId||c&&c.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Ae[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||a.qMeasure.qLabel)&&(n.qDef.qLabel=a.qMeasure.qLabel),(n.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=a.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(n.qDef.qNumFormat=a.qMeasure.qNumFormat,n.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=a.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:a}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof Ae[r.type].updateModifier&&Ae[r.type].updateModifier(r,i.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:Ae[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=s,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:a}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||He(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&He(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}}))}({measure:n,properties:r,libraryItemsProps:i,dimensionAndFieldList:e}),_e(n)):Pe(n)}))}))}))}({measures:a,properties:i,model:n,libraryItemsProps:c,dimensionAndFieldList:d}).then((function(){return l?Je({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)}))}))}function Pe(e){!function(e){var t=je(e);return Array.isArray(t)&&t.some((function(e){return"object"===Te(e)&&!e.disabled&&!Ae[e.type]}))}(e)?Ee.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,_e(e)}function Re(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ke({modifiers:je(e),properties:n,layout:r})}))}function Fe(e){var t=je(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Ae[r.type]&&!r.disabled)return r}}function He(e){var t=Fe(e);return!t||Ae[t.type].enableTotalsFunction(e)}function ze(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function je(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Be(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function Ve(e){ze(e).forEach((function(e){return function(e){var n=Fe(e);n&&(void 0!==n.outputExpression&&Be(n)!==e.qDef.qDef?delete e.qDef.base:!Ee.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)}))}function _e(e){var t=je(e);Array.isArray(t)&&t.forEach((function(t){"object"===Te(t)&&(t.disabled||!Ae[t.type]&&Be(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function Ue(e){return e.base||e.qDef&&e.qDef.base}function $e(e){var t=Ue(e);return e.qLibraryId||t&&t.qLibraryId}function We(e){var t=e.measure,n=e.properties,r=e.layout;return!$e(t)&&Ke({modifiers:je(t),properties:n,layout:r})}function Ke(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==Te(e)||e.disabled||!Ae[e.type])&&(void 0===i[e.type]&&(i[e.type]=Ae[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function Ge(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then((function(e){i.dimensionList=e}));r.push(o);var a=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(a),Promise.all(r).then((function(){return i}))}function Ye(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),Promise.all(s).then((function(){return a}))}function Xe(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Xe)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):I(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Ze(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===Te(e)&&!e.disabled&&Ae[e.type]&&Ae[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function Qe(e){var t=ze(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=je(t);if(Ke({modifiers:r,properties:e})){var o=$e(t);o&&n.push(o),i=i||Ze({modifiers:r,properties:e})}})),o(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(ke[t.id].masterItemSubscriber=ke[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=o(e,n)})),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function c(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),a={},t.forEach((function(e){a[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach((function(e){i[e]||a[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&s.push(c(e,"getMeasure"))})),Object.keys(a).forEach((function(e){a[e]&&!r[e]&&s.push(c(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return Oe({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),ke[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}n.d(r,{default:()=>Ve});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}const d={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:c};var m=n(645),f=n.n(m);const p=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},h=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&d.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},v=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},b=function(e){e.forEach((function(e){f().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))};function x(e,t,n){var r,i,a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((i=(i=(r=JSON.stringify(a)).match(/:\{/g))?i.length:0)>2)return;a=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var s=o.getValue(e,"qLayoutExclude.quarantine");s[n]||(s[n]={}),s[n][t]=a}var q=n(229),M=n.n(q);function S(e,t){var n=M()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function D(e,t){return M()(!0,{},t,e)}function C(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var w=Math.pow(2,53)-1;function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const T=function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},A=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},N=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},k=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},O=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},I=function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=S(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var u=S(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},P=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=D(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var u=D(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},R=function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=C(a.max,i.dimensions.length,w),l=C(a.min,i.dimensions.length,0);return{maxDimensions:C(o.max,s,w),minDimensions:C(o.min,l,0),maxMeasures:s,minMeasures:l}},F=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(d.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,d.indexRemoved(n.qInterColumnSortOrder,o))},H=function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=M()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]})),null===(i=M()(!0,{},n,i)).components&&(i.components=[]),i},z=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},j=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},B=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return L(e)}(t=a.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return L(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qDimensions=[],s.forEach((function(e){a.qDimensions.push(e),r.dimensions.added(e,n)}))}},V=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return E(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qMeasures=[],s.forEach((function(e){a.qMeasures.push(e),r.measures.added(e,n)}))}},_=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f().isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))};function U(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}const $={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p({exportFormat:i,qHyperCubeDef:l}),h({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),v({exportFormat:i,properties:a}),r||b(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(x(i.properties,"filters","storedFilters"),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(x(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(x(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,u=e.hypercubePath,c=e.extension,d=e.supportedFilters,m=void 0===d||d,f=e.isHCModifierSupported,p=void 0===f||f,h={qChildren:[]},g=H({exportFormat:t,initialProperties:r,hypercubePath:u}),y=o.getValue(r,u||"").qHyperCubeDef,v=o.getValue(g,u||"").qHyperCubeDef,b=R({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,q=b.minDimensions,M=b.maxMeasures,S=b.minMeasures,D=l.defaultDimension,C=void 0===D?k():D,w=l.defaultMeasure,L=void 0===w?O():w;v.qDimensions.length=0,v.qMeasures.length=0,z({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:M,minMeasures:S})&&j({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:M,minMeasures:S,newHyperCubeDef:v}),I({exportFormat:t,maxDimensions:x,minDimensions:q,newHyperCubeDef:v,defaultDimension:C}),P({exportFormat:t,maxMeasures:M,minMeasures:S,newHyperCubeDef:v,defaultMeasure:L}),B({newProperties:g,dataDefinition:a,hypercubePath:u}),V({newProperties:g,dataDefinition:a,hypercubePath:u}),F({exportFormat:t,newHyperCubeDef:v}),A("qMaxStackedCells",y,v),A("qNoOfLeftDims",y,v),N("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),N("qMode",y,v,"S"),N("qReductionMode",y,v,"N"),N("qSortbyYValue",y,v),N("qIndentMode",y,v),N("qShowTotalsAbove",y,v),T(g,t,r),h.qProperty=g;var E=o.getValue(c||{},"support.modifiers");return _({measures:v.qMeasures,modifierTypes:E}),m&&U(h.qProperty,"storedFilters"),"S"===v.qMode&&p&&U(h.qProperty,"dynamicScript"),h}};var W={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function K(e,t,n,r){t=t||[];var i=c(e,r,n),o=c(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function G(e,t){return e.length!==t}const Y={create:function(e,t){if(!e||!W[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(K(a,t,r,i),G(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},X={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},J={colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>0&&X.getNumMeasures(e)<=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>0},expression:function(e){return X.getNumMeasures(e)>=1}}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}};var Q={scatterplot:Z,"sn-scatter-plot":Z,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)<=1},expression:function(e){return X.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>=1},expression:function(e){return X.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=d.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=Y.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})),t.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}))}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;te(r,i);var l=r[r.length-1];if(l){var u=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),m=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var f=Y.create(Y.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:s,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:m});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:f,measures:a,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:m})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function ie(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":i=function(e,t){return t?e.qLibraryId:f().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return f().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,n,r){var i=n?"expression":t.type,o=e.color,a=o.mode,s=X.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||X.wrapFieldName(t.name),key:X.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:n||s,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}r||(o.auto=!1,o.mode=a)}function se(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,ae(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=Y.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return ae(e,ie("dimension",!!a,a||r)),!!a}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ue=function(e,t){var n={primary:!0};if(e){var r=(Q[t]||J).colorModeOptions||J.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ce=function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},de=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),a=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(a,l):!(n={auto:i,colorMode:r,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:i,colorMode:r,dimensions:a,measures:s,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,ae(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=Y.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return ae(e,ie("measure",!!s,s||r[0])),!!s}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,a)}(e,t)},me=function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},fe=function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},pe=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},he=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=$.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=Y.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return Y.moveByIdFromGroup(a,[],"qAttributeDimensions",u),Y.moveByIdFromGroup(a,[],"qAttributeExpressions",u),Y.moveByIdFromGroup(s,[],"qAttributeExpressions",c),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=$.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty,m=o.getValue(d,"visualization"),f=o.getValue(d,"qHyperCubeDef.qDimensions",[]),p=o.getValue(d,"color.mode",""),h=o.getValue(d,"color.auto",""),g=ue(d,m),y=ce({canColorBy:g,autoColor:h,colorMode:p,dimensions:f});return g[p]?fe({shouldUpdateColorBy:y,properties:d})&&pe(d):he(d),y&&de(d,"qHyperCubeDef."),ge(d)&&le(d,"color.persistent",!0),me(f),c}};var ve=["bar","marker","line"];const be=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?U(n,"unsupportedAutoMinMax")||M()(n.measureAxis,t.measureAxis):U(n,"supportedAutoMinMax")||M()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),ve.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(a);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&M()(s,n.properties.measureAxes[t[0].axis])):M()(s,n.properties.measureAxes[0])}},qe=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},Me={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(x(s,"measureAxis.min","supportedAutoMinMax"),x(s,"measureAxis.max","supportedAutoMinMax")):(x(s,"measureAxis.min","unsupportedAutoMinMax"),x(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty;return be({initialProperties:n,properties:d}),xe({exportFormat:t,initialProperties:n,properties:d,measureType:a}),qe(d.qHyperCubeDef),d.qHyperCubeDef.qColumnOrder=[],d.qHyperCubeDef.columnOrder=[],c}};function Se(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function De(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var u=Se(n,r,l);o.setValue(t,u,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}function Ce(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=Se(n,r,s),u=o.getValue(t,l);void 0!==u&&(o.setValue(i,a,u),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}var we="qHyperCubeDef.qMeasures",Le="conditionalColoring",Ee="measures",Te="qDef.conditionalColoring";const Ae={quarantine:function(e){De({properties:e,arrayPath:we,quarantineName:Le,arrayName:Ee,itemPath:Te})},unquarantine:function(e){Ce({properties:e,arrayPath:we,itemPath:Te,arrayName:Ee,quarantineName:Le})}};var Ne="qHyperCubeDef.qMeasures",ke="measures",Oe="qHyperCubeDef.qDimensions",Ie="dimensions",Pe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Re="alternativeMeasures",Fe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",He="alternativeDimensions",ze="qCalcCondition",je="conditionalShowHide";const Be={quarantine:function(e){De({properties:e,arrayPath:Ne,quarantineName:je,arrayName:ke,itemPath:ze}),De({properties:e,arrayPath:Oe,quarantineName:je,arrayName:Ie,itemPath:ze})},unquarantine:function(e){Ce({properties:e,arrayPath:Ne,quarantineName:je,arrayName:ke,itemPath:ze}),Ce({properties:e,arrayPath:Oe,quarantineName:je,arrayName:Ie,itemPath:ze})},quarantineAlternative:function(e){De({properties:e,arrayPath:Pe,quarantineName:je,arrayName:Re,itemPath:ze}),De({properties:e,arrayPath:Fe,quarantineName:je,arrayName:He,itemPath:ze})},unquarantineAlternative:function(e){Ce({properties:e,arrayPath:Pe,quarantineName:je,arrayName:Re,itemPath:ze}),Ce({properties:e,arrayPath:Fe,quarantineName:je,arrayName:He,itemPath:ze})}},Ve={hypercube:$,colorChart:ye,axisChart:Me,quarantineProperty:x,unquarantineProperty:U,quarantineArrayProp:De,unquarantineArrayProp:Ce,conditionalColoring:Ae,conditionalShow:Be}})(),r.default})();var Xx=z(Yx.exports);function Jx(e,t){if("custom"===e.dimensionAxis.axisDisplayMode){const n=t.layout.qHyperCube.qMeasureInfo.filter((e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==Pg})).length,r=t.layout.qHyperCube.qDimensionInfo.filter((e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==Pg})).length,i=e.dimensionAxis.maxVisibleItems;i<1?e.dimensionAxis.maxVisibleItems=10:i>1e4/(r+n)&&(e.dimensionAxis.maxVisibleItems=Math.min(i,Math.floor(1e4/(r+n))))}}const Zx=.7,Qx=.9,eq=[{translation:"Common.None",value:"none"},{translation:"Common.Small",value:"small"},{translation:"Common.Medium",value:"medium"},{translation:"Common.Large",value:"large"}],tq=(e,t)=>{var n,r,i,o,a;const s=null===(n=t.qHyperCube)||void 0===n||null===(r=n.qMeasureInfo)||void 0===r?void 0:r.filter((e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==Pg})).length,l=null===(i=t.qHyperCube)||void 0===i||null===(o=i.qDimensionInfo)||void 0===o?void 0:o.filter((e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==Pg})).length,u="grouped"===(null===(a=e.barGrouping)||void 0===a?void 0:a.grouping)&&l>0&&s+l>2;return de.continuous(t)?1:u?Qx:Zx},nq=(e,t,n)=>{const r=`${e}.fontFamily`,i=`${e}.fontSize`;return{fontFamilyItem:{component:"dropdown",ref:r,options:()=>t.getOptions(r),defaultValue:()=>t.getDefaultValue(r)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:i,options:()=>t.getOptions(i),defaultValue:()=>t.getDefaultValue(i)},fontColorItem:{component:"color-picker",width:!1,ref:`${e}.color`,defaultValue:()=>({color:n.getStyle("object.barChart",e,"color")})}}}}};function rq(e,t,n){const r=function(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,a=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:i}),s=a.id,l=a.paths,u={};l.forEach((function(e){for(var r=e.split("."),i=u,a=0;a<r.length;a++){var l=r[a];a===r.length-1?i[l]=Bd({theme:t,translator:n,id:s,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}}));var c=function(e){for(var t=e.split("."),n=u,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return u.getDefaultValue=function(e){return c(e).getDefaultValue()},u.getOptions=function(e){return c(e).getOptions()},u}({theme:e,translator:n,config:{id:"barChart",paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]},flags:t});return{component:"styling-panel",show:!0,chartType:"barchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.BarChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:null==t?void 0:t.isEnabled("SENSECLIENT_IM_2428_BARCHART_BG"),items:{outlineSection:{translation:"properties.Outline",component:"panel-section",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",options:Object.keys(eq).map((e=>eq[e])),defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#205891"},schemaIgnore:!0,width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"panel-section",show:(e,t)=>!de.continuous(t.layout),items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",component:"slider",min:.01,max:1,step:.01,defaultValue(e,t,n){const{properties:r}=n,{barGrouping:i,qHyperCubeDef:o}=r,a=o.qMeasures.length,s=o.qDimensions.length,l="grouped"===i.grouping&&s>0&&a+s>2;return de.continuous(r)?1:l?Qx:Zx},schemaIgnore:!0}}}}},axisTitleSection:null!=t&&t.isEnabled("CLIENT_IM_747")?{translation:"properties.axis.title",component:"panel-section",items:{axisTitleItems:{component:"items",ref:"components",key:"axis",items:nq("axis.title",r,e)}}}:void 0,axisLabelSection:null!=t&&t.isEnabled("CLIENT_IM_747")?{translation:"properties.axis.label",component:"panel-section",items:{axisLabelItems:{component:"items",ref:"components",key:"axis",items:nq("axis.label.name",r,e)}}}:void 0,labelSection:null!=t&&t.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.labelmode",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:{...nq("label.value",r,e),contrastColor:{component:"checkbox",type:"boolean",ref:"label.value.useContrastColor",translation:"properties.dataPoints.valuelabel.contrast",defaultValue:!0}}}}}:void 0,legendTitleSection:null!=t&&t.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.title",component:"panel-section",items:{legendTitleSection:{component:"items",ref:"components",key:"legend",items:nq("legend.title",r,e)}}}:void 0,legendLabelSection:null!=t&&t.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.label",component:"panel-section",items:{legendLabelSection:{component:"items",ref:"components",key:"legend",items:nq("legend.label",r,e)}}}:void 0}}}function iq(e=!1,t,n,r){return e?function(e){return{classification:{section:"styling",tags:["simple"],exclusive:!0},component:"items",show:!0,chartType:"barchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.BarChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:null==e?void 0:e.isEnabled("SENSECLIENT_IM_2428_BARCHART_BG"),items:{outlineSection:{translation:"LayerStyleEditor.style.strokeWidth",component:"items",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",translation:"LayerStyleEditor.style.strokeWidth",options:Object.keys(eq).map((e=>eq[e])),schemaIgnore:!0,defaultValue:eq[0].value},strokeColor:{ref:"style.strokeColor",schemaIgnore:!0,defaultValue:{color:"#205891",index:-1},width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"items",show:(e,t)=>!de.continuous(t.layout),items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",translation:"LayerStyleEditor.style.barWidth",component:"slider",min:.01,max:1,step:.01,schemaIgnore:!0,defaultValue:(e,t,n)=>tq(n.properties,n.layout)}}}}},optionsSection:{translation:"LayerStyleEditor.label.Options",component:"items",items:{wrapperItem:{component:"items",items:{optionsHeader:{component:"header",translation:"LayerStyleEditor.label.Options"},scrollbar:{ref:"scrollbar",translation:"properties.scrollbar",component:"dropdown",type:"string",options:Object.keys(ph.OPTIONS).map((e=>ph.OPTIONS[e])),schemaIgnore:!0,defaultValue:ph.DEFAULT.value},scrollAlignment:{ref:"scrollStartPos",translation:"properties.ScrollAlignment",component:"dropdown",schemaIgnore:!0,defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}]},gridLines:{type:"items",items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}}}}}}}}}(n):rq(t,n,r)}const oq={component:"style-editor",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",resetBtnTranslation:"LayerStyleEditor.component.resetAll",key:"bar",ref:"components",defaultValues:(e,t)=>({key:"bar",style:{width:tq(e,t.layout),strokeColor:{index:-1,color:"#205891"},strokeWidth:"none"}}),items:{bar:{components:"items",type:"items",uses:"styling.box",items:{strokeWidth:{show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"LayerStyleEditor.style.strokeWidth.none"},{value:"small",translation:"LayerStyleEditor.style.strokeWidth.small"},{value:"medium",translation:"LayerStyleEditor.style.strokeWidth.medium"},{value:"large",translation:"LayerStyleEditor.style.strokeWidth.large"}],defaultValue:"none"},strokeColor:{show:e=>"none"!==e.style.strokeWidth},width:{show:(e,t,n)=>!de.continuous(n.layout),component:"slider",min:.01,max:1,step:.01,defaultValue:Zx}}}}},aq=e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==Pg},sq=(e,t)=>e.qHyperCube[t].filter((e=>aq(e))),lq=e=>({get:(t,n,r)=>de.continuous(r.layout)?e:t(n.type),set(e,t,n){const r=he(n.type,n);t(n.type,e,r)}}),uq=e=>{if(!e)return!1;const t=Y(!0,{},e);return t.qHyperCube.qMeasureInfo=sq(e,"qMeasureInfo"),t.qHyperCube.qDimensionInfo=sq(e,"qDimensionInfo"),t&&!de.continuous(t)&&de.stacked(t)},cq=({translator:e,flags:t,anything:n})=>{var r,i,o;const a=null==n||null===(r=n.sense)||void 0===r||null===(i=r.isUnsupportedFeature)||void 0===i?void 0:i.call(r,"continuousData"),s={items:{labels:{items:{header:{show:(e,t,n)=>sq(n.layout,"qMeasureInfo").length},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",translation:"Simple.Label.Value",show:(e,t,n)=>!uq(t.layout)&&sq(n.layout,"qMeasureInfo").length},segmentLabels:{component:"checkbox",ref:"dataPoint.showSegmentLabels",type:"boolean",translation:"properties.dataPoints.segmentLabelMode",defaultValue:!1,show:(e,t)=>uq(t.layout),convertFunctions:{get:(e,t,n,r)=>r.dataPoint.showLabels&&r.dataPoint.showSegmentLabels,set(e,t,n,r,i){i.dataPoint.showSegmentLabels=e,i.dataPoint.showLabels=i.dataPoint.showSegmentLabels||i.dataPoint.showTotalLabels}}},totalLabels:{component:"checkbox",ref:"dataPoint.showTotalLabels",type:"boolean",translation:"properties.dataPoints.totalLabelMode",defaultValue:!0,show:(e,t)=>uq(t.layout),convertFunctions:{get:(e,t,n,r)=>r.dataPoint.showLabels&&r.dataPoint.showTotalLabels,set(e,t,n,r,i){i.dataPoint.showTotalLabels=e,i.dataPoint.showLabels=i.dataPoint.showSegmentLabels||i.dataPoint.showTotalLabels}}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:(e,t,n)=>sq(n.layout,"qDimensionInfo").length&&sq(n.layout,"qMeasureInfo").length,convertFunctions:{get:(e,t,n,r)=>"labels"===r.dimensionAxis.show||"none"===r.dimensionAxis.show,set(e,t,n,r,i){i.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show:(e,t,n)=>sq(n.layout,"qMeasureInfo").length,convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}},l=null==n||null===(o=n.sense)||void 0===o?void 0:o.theme,u={uses:"settings",items:{simpleStyling:iq(!0,l,t,e),simpleLabels:s,general:{items:{showDisclaimer:null!=t&&t.isEnabled("SHOW_DISCLAIMER")?{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}:void 0}},presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:{boxStyling:null!=t&&t.isEnabled("SENSECLIENT_PS_17478_STYLINGPANEL_BARCHART")?iq(!1,l,t,e):oq,grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",defaultValue:"grouped",horizontal:!0,items:[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}],show(e,t){const n=sq(t.layout,"qMeasureInfo").length,r=sq(t.layout,"qDimensionInfo").length;return r>0&&n+r>2},change(e,t){sq(t.layout,"qDimensionInfo").length>1&&"stacked"===e.barGrouping.grouping?(e.qHyperCubeDef.qMode="K",e.qHyperCubeDef.qAlwaysFullyExpanded=!0):e.qHyperCubeDef.qMode="S"},readOnly:(e,t,n)=>de.continuous(n.layout),convertFunctions:lq("stacked")},orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"vertical",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],readOnly:(e,t,n)=>de.continuous(n.layout),convertFunctions:lq("vertical")},scroll:{type:"items",items:{scrollbar:{type:"string",component:"dropdown",ref:"scrollbar",translation:"properties.scrollbar",options:Object.keys(ph.OPTIONS).map((e=>ph.OPTIONS[e])),defaultValue:ph.DEFAULT.value},scrollStartPos:{ref:"scrollStartPos",type:"number",translation:"properties.ScrollAlignment",component:"dropdown",defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}],show:(e,t,n)=>!de.continuous(n.layout)}}},gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}},valueLabels:{type:"items",snapshot:{tid:"property-valueLabels"},items:{showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!1,options:[{value:!0,label:(t,n)=>((e,t,n)=>n&&n.get(uq(t.layout)?"properties.on":"Common.Auto"))(0,n,e)},{value:!1,translation:"properties.off"}]},showSegmentLabels:{ref:"dataPoint.showSegmentLabels",type:"boolean",translation:"properties.dataPoints.segmentLabelMode",component:"switch",defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showLabels&&uq(n.layout)},showTotalLabels:{ref:"dataPoint.showTotalLabels",type:"boolean",translation:"properties.dataPoints.totalLabelMode",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showLabels&&uq(n.layout)}}}}},colorsAndLegend:{uses:"colorsAndLegend",items:{colors:{items:{attributeExpression:am}},legend:{items:{show:{snapshot:{tid:"property-legend"}}}}}},dimensionAxis:{uses:"axis.dimensionAxis",items:{axisDisplaySettings:{components:"items",type:"items",show:(e,n,r)=>t&&t.isEnabled("BC_XAXIS_MODE")&&!de.continuous(r.layout),items:{axisDisplayMode:{ref:"dimensionAxis.axisDisplayMode",type:"string",translation:"properties.axis.displaymode",component:"dropdown",defaultValue:"auto",options:[{value:"auto",translation:"properties.axis.displaymode.auto"},{value:"max",translation:"properties.axis.displaymode.max"},{value:"custom",translation:"properties.axis.displaymode.custom"}]},maxVisibleItems:{ref:"dimensionAxis.maxVisibleItems",translation:"properties.axis.maxvisiblevalues",expression:"optional",type:"integer",invalid(e,t,n){const r=sq(n.layout,"qMeasureInfo").length,i=sq(n.layout,"qDimensionInfo").length,o=e.dimensionAxis.maxVisibleItems;return o<0||o>1e4/(i+r)},globalChange:Jx,defaultValue:10,show:e=>"custom"===e.dimensionAxis.axisDisplayMode},hint:{component:"text",translation:"properties.axis.maxvisiblevalues.hint",style:"hint",show:e=>["custom","max"].indexOf(e.dimensionAxis.axisDisplayMode)>-1}}},continuousGroup:{items:{miniChart:null},show:!a}}},measureAxis:{uses:"axis.flippableMeasureAxis"},tooltip:{uses:"tooltip"}}};return null!=t&&t.isEnabled("SENSECLIENT_LAYERED_LABELS")&&(u.items.dimensionAxis.items.othersGroup={items:{label:{options:[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]}}}),u},dq={uses:"sortingWithDisclaimer",items:{defaultSorting:{items:{dimensions:{locked:(e,t,n)=>1===n.getMeasures().length&&2===n.getDimensions().length&&0===e,items:{autoSort:{change(e){Dt(e)}}}},interColumnSorting:{reset:(e,t)=>{const{qDimensions:n,qMeasures:r,qInterColumnSortOrder:i}=e.qHyperCubeDef,{qCardinal:o}=t.layout.qHyperCube.qDimensionInfo[0],a=i.length,s=[...Array(a).keys()];1===n.length&&r.length>=1&&o>10&&([s[0],s[1]]=[s[1],s[0]]),e.qHyperCubeDef.qInterColumnSortOrder=s}}}}}},mq={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}},refLines:{uses:"reflines"},dimRefLines:{uses:"dimReflines"}}},fq=({translator:e,flags:t,anything:n})=>{var r,i;return{uses:"data",items:{dimensions:{items:{nullSuppression:{show(e,t,r){var i,o;if(null!=n&&null!==(i=n.sense)&&void 0!==i&&null!==(o=i.isUnsupportedFeature)&&void 0!==o&&o.call(i,"includeZeroValues"))return!1;const a=((e,t)=>{var n,r,i,o,a,s;const l=null===(n=t.layout)||void 0===n||null===(r=n.qHyperCube)||void 0===r||null===(i=r.qDimensionInfo)||void 0===i?void 0:i.findIndex((e=>aq(e)));return(null===(o=t.properties)||void 0===o||null===(a=o.qHyperCubeDef)||void 0===a||null===(s=a.qDimensions)||void 0===s?void 0:s[l])===e})(e,t),s=de.continuous(r.layout);return!(a&&s)}},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Dimensions.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0,show:()=>t.isEnabled("IM_1579_HIDE_DIM_MEA")}}},measures:{items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Measures.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0,show:()=>t.isEnabled("IM_1579_HIDE_DIM_MEA")},trendLines:null!=n&&null!==(r=n.sense)&&void 0!==r&&null!==(i=r.isUnsupportedFeature)&&void 0!==i&&i.call(r,"trendlines")?void 0:sv({translator:e,allowStackedByDimension:t&&t.isEnabled("TRENDLINES_STACKED_DIM")})}}}}};function pq({translator:e,flags:t,anything:n}){return{type:"items",component:"accordion",items:{data:fq({translator:e,flags:t,anything:n}),sorting:dq,addons:mq,settings:cq({translator:e,flags:t,anything:n})}}}const hq=e=>{var t;return(null===(t=e.qError)||void 0===t?void 0:t.qErrorCode)!==Pg};function gq(){return{type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sortWithDisclaimer",items:{sort:{items:{dimensions:{locked(e,t,n){const r=n.qHyperCube.qMeasureInfo.length,i=n.qHyperCube.qDimensionInfo.filter((e=>hq(e))).length;return 1===r&&2===i&&0===e}}}}}},presentation:{uses:"presentation",items:{showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",horizontal:!0,items:[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}],show(e,t){const n=t.qHyperCube.qMeasureInfo.filter((e=>hq(e))).length,r=t.qHyperCube.qDimensionInfo.filter((e=>hq(e))).length;return n+r>2&&!de.continuous(t)&&!((null==(i=t)||null===(o=i.qHyperCube)||void 0===o||null===(a=o.qDimensionInfo)||void 0===a?void 0:a.filter((e=>hq(e))).length)>1&&(null==i||null===(s=i.qHyperCube)||void 0===s?void 0:s.isHCEnabled));var i,o,a,s},change(e){e.qHyperCubeDef.qDimensions.length>1&&"stacked"===e.barGrouping.grouping?(e.qHyperCubeDef.qMode="K",e.qHyperCubeDef.qAlwaysFullyExpanded=!0):e.qHyperCubeDef.qMode="S"}},orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],show:(e,t)=>!de.continuous(t)}}},color:{uses:"color"}}}}function yq(e){const t={},n=tu(e,"components"),r=tu(e,"dimensionAxis.axisDisplayMode"),i=tu(e,"dimensionAxis.maxVisibleItems"),o=n?n.filter((e=>"bar"===e.key))[0]:void 0,a=tu(e,"tooltip");if(o&&o.style&&Object.keys(o.style).forEach((e=>{t[`chart_style_${e}`]=o.style[e]})),i&&(t.chart_dimaxis_maxVisibleItems=i),r&&(t.chart_dimaxis_axisDisplayMode=r),a){t.chart_tooltip_custom=!a.auto;const e=tu(a,"chart.object.refId");!a.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}const vq=e=>!!(e&&e.qHyperCube.qSize.qcy>0),bq={ACCUMULATIONS:"accumulation",MOVING_AVERAGE:"movingAverage",DIFFERENCE:"difference",NORMALIZATION:"normalization"};function xq(){const e=[];return Object.keys(bq).forEach((t=>{e.push(bq[t])})),e}function qq(e){const{flags:t}=e;return{definition:pq(e),softDefinition:gq(),support:{snapshot:vq,export:vq,exportData:!0,sharing:vq,viewData:!0,effects:!0,modifiers:xq()},importProperties:(n,r,i,o)=>{const a={layout:{templateId:r.templateId}};i.mapProperties(a);const s={defaultDimension:i.getDefaultDimensionProperties(),defaultMeasure:i.getDefaultMeasureProperties()},l=Xx.axisChart.importProperties({exportFormat:n,initialProperties:r,dataDefinition:Ug(e),defaultPropertyValues:s,hypercubePath:o,extension:i}),u=l.qProperty;return u.qHyperCubeDef.qDimensions.length>1&&"stacked"===u.barGrouping.grouping&&(u.qHyperCubeDef.qMode="K",u.qHyperCubeDef.qAlwaysFullyExpanded=!0),t.isEnabled("IM_1579_HIDE_DIM_MEA")&&(Xx.conditionalShow.unquarantine(u),Xx.conditionalShow.unquarantineAlternative(u)),l},exportProperties:(e,n,r)=>{t.isEnabled("IM_1579_HIDE_DIM_MEA")&&(Xx.conditionalShow.quarantine(e.qProperty),Xx.conditionalShow.quarantineAlternative(e.qProperty));return Xx.axisChart.exportProperties({propertyTree:e,hyperCubePath:n,viewDataMode:r})},migrate:{properties:e=>(e.qExtendsId||(function(e){var t,n;e.qHyperCubeDef.qDimensions.forEach(Dt),null!==(t=e.qHyperCubeDef.qLayoutExclude)&&void 0!==t&&null!==(n=t.qHyperCubeDef)&&void 0!==n&&n.qDimensions&&e.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.forEach(Dt)}(e),function({properties:e}){const{scrollbar:t,dimensionAxis:n,preferContinuousAxis:r,showMiniChartForContinuousAxis:i}=e;if(t||!1!==i)return;const{continuousAuto:o}=n;(o||!o&&r)&&(e.scrollbar=ph.OPTIONS.NONE.value)}({properties:e})),e)},extendMetrics:yq}}function Mq(i){const o=function(){const i=e();return i.use(t),i.use(n(r)),i.use(qf()),i.use(dg),i.component("box-sliced-hat",ug),i.component("box-out-of-bounds",ig),i.component("scrollbar",Qh),i.component("scroll-hint",Vo),i.component("reference-line-labels",_a),i.component("axis-overlay",mh.picassoComponents.axisOverlay),i.component("time-axis",mh.picassoComponents.timeAxis),i.scale("q-time-axis",mh.picassoScales.time),i}();return{qae:$g(i),ext:qq(i),component(){const e=Kg({env:i}),{viewState:t,viewCache:n}=Gg(),r=function({picasso:e}){const t=S(),n=D(),[r,i]=b();return M((()=>{if(!e)return()=>{};t.style.overflow="hidden";const r=e({renderer:{prio:[(null==n?void 0:n.renderer)||"canvas"]}}).chart({element:t,data:[],settings:{}});i(r);const{destroy:o}=r;return()=>{o()}}),[n.renderer]),r}({picasso:o}),a=Dv({picasso:o,chart:r,environment:e,viewState:t,viewCache:n}),s=function({env:e,services:t}){const n=T(),r=E(),i=F(),[o,a]=I((async()=>{if(!e||!t)return Promise.resolve();const{flags:o}=e,{layoutService:a}=t,{isSnapshot:s,isStacked:l,isContinuous:u}=a.meta,c=[];return s||c.push(r.getEffectiveProperties()),Promise.all(c).then((async e=>{const t=e[0]||void 0;if(o.isEnabled("IM_1579_HIDE_DIM_MEA")&&null!=t&&t.qHyperCubeDef){const e=a.getLayout(),o=Y(!0,{},t);if(Gx({properties:t,layout:e,isStacked:l,isContinuous:u,model:r,layoutService:a}))return i.pending(),im(e)?r.setProperties(t).then((()=>{n.clearUndoBuffer()})):void await rm(r,o,t);i.restore()}return{properties:t}}))}),[e,t]);if(a&&!a.isHandled)throw a;return o}({env:i,services:a});Kx({picasso:o,chart:r,services:a,environment:e,viewState:t,viewCache:n,bootstrapped:s}),(({environment:e,services:t,chart:n,viewState:r,bootstrapped:i})=>{P((o=>{var a;if(!e||!t||!i)return;const{flags:s}=e,{layoutService:l,dockService:u,colorService:c,discrete:d,continuousDataModel:m,reducedDataModel:f}=t,{width:p,height:h}=u.meta.chart.size;if(o.snapshotData=o.snapshotData||{},o.snapshotData.content={size:{w:p,h:h}},l.meta.isSnapshot)return Promise.resolve();if(o.snapshotData.content.chartData={scrollOffset:r.get("scrollOffset"),zoom:r.get("zoom"),legendScrollOffset:me(n,gv.COMPONENT.LEGEND_COLOR_CAT)},null!=s&&null!==(a=s.isEnabled)&&void 0!==a&&a.call(s,"IM_1579_HIDE_DIM_MEA")){const{properties:e}=i,t=null==e?void 0:e.qHyperCubeDef.qDimensions.some((e=>{var t,n;return null===(t=e.qCalcCondition)||void 0===t||null===(n=t.qCond)||void 0===n?void 0:n.qv}));t&&(o.tooltip.auto=!0)}return l.meta.isDiscrete?(d.command.setSnapshotData(o),f.setSnapshotData(o)):m.setSnapshotData(o),c.getMain().getSnapshotData().then((e=>{o.snapshotData.content.chartData={...o.snapshotData.content.chartData,...e}})).catch((()=>{}))})),R((()=>({getViewState(){if(r&&n)return{scrollOffset:r.get("scrollOffset"),zoom:r.get("zoom"),legendScrollOffset:me(n,gv.COMPONENT.LEGEND_COLOR_CAT)}}})),[r,n])})({environment:e,services:a,chart:r,viewState:t,bootstrapped:s})}}}export{Mq as default};