@nebula.js/sn-gauge 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +18 -0
- package/core/esm/index.js +9 -0
- package/core/package.json +10 -0
- package/dist/sn-gauge.esm.js +11 -0
- package/dist/sn-gauge.js +11 -0
- package/dist/sn-gauge.systemjs.js +9 -0
- package/package.json +109 -0
- package/sn-gauge-ext/dist/sn-gauge.js +11 -0
- package/sn-gauge-ext/sn-gauge.js +1 -0
- package/sn-gauge-ext/sn-gauge.qext +9 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Qlik - Open Source Software
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# sn-gauge
|
|
2
|
+
|
|
3
|
+
## !Experimental
|
|
4
|
+
|
|
5
|
+
A nebula.js supernova picasso gauge chart
|
|
6
|
+
|
|
7
|
+
## Developing
|
|
8
|
+
|
|
9
|
+
The following procedure ensures we have both the current gauge chart and the sn-gauge (this repo) working, making it easy to compare. What's more, it's fast to update sn-gauge chart after changing code (just one browser refresh).
|
|
10
|
+
|
|
11
|
+
Note: you only need to do step 2, 3, 4 once
|
|
12
|
+
|
|
13
|
+
1. Install with `pnpm install`
|
|
14
|
+
2. Build extension with `pnpm build` and upload it to your tenant. I use V&P team tenant (fualn).
|
|
15
|
+
3. In sense-client, in "web/assets/objects/extension/extension-loader/load-qlik-extension-system.ts", add `'sn-gauge': 'sn-gauge',` into `const enabledCharts` object.
|
|
16
|
+
4. In qmfe dev tool, add new override with name "sn-gauge", address "https://localhost:8000/pkg/sn-gauge"
|
|
17
|
+
5. Also use override of sense-client with your local change from step 3
|
|
18
|
+
6. Run your local sn-gauge with `pnpm start:mfe`. Note: you may have to change the port in step 4 based on what presented in your terminal at this step.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @nebula.js/sn-gauge v0.7.0
|
|
3
|
+
* Copyright (c) 2025 QlikTech International AB
|
|
4
|
+
* Released under the MIT license.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import{useElement as e,useOptions as t,useState as i,useEffect as n,useStaleLayout as r,useTheme as a,useApp as o,useModel as s,useRect as l,useTranslator as c,useAppLayout as u,usePromise as h,onTakeSnapshot as f}from"@nebula.js/stardust";import p from"picasso-plugin-q";import d from"picasso.js";function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function g(e,t,i){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function y(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function v(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?y(Object(i),!0).forEach((function(t){g(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):y(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,a,o,s=[],l=!0,c=!1;try{if(a=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=a.call(i)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(c)throw r}}return s}}(e,t)||S(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 x(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||S(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 M(e){return M="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},M(e)}function S(e,t){if(e){if("string"==typeof e)return m(e,t);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?m(e,t):void 0}}var k=["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"],w=["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 N=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function I(e){var t=e.theme,i=e.translator,n=e.defaultValue,r=e.flags,a=[],o=t.getStyle("","","fontFamilies");return Array.isArray(o)&&o.length?a.push.apply(a,x(new Set([n].concat(x(o.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):a.push(n),[{value:"ThemeHeader",label:i.get("properties.themeFonts"),metaText:i.get("properties.theme"),groupHeader:!0}].concat(x(a.map((function(e){return N(e)}))),[{value:"DefaultHeader",label:i.get("properties.allFonts"),metaText:i.get("properties.default"),groupHeader:!0}],x(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?w:k}(r).map((function(e){return N(e)}))))}function D(e){var t=e.theme,i=e.translator,n=e.id,r=e.path,a=e.flags,o=function(){return t.getStyle(n,r,"fontFamily")};return{getDefaultValue:function(){return o()},getOptions:function(){return I({theme:t,translator:i,defaultValue:o(),flags:a})}}}var A,C,L=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],q=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function P(e){var t=e.theme,i=e.translator,n=e.id,r=e.path,a=function(){return t.getStyle(n,r,"fontSize")};return{getDefaultValue:function(){return a()},getOptions:function(){return function(e){var t=e.translator,i=e.defaultValue,n=[],r=e.theme.getStyle("","","fontSizes");return Array.isArray(r)&&r.length?n.push.apply(n,x(new Set([i].concat(x(r))))):n.push(i),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(x(n.map((function(e){return q(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],x(L.map((function(e){return q(e)}))))}({theme:t,translator:i,defaultValue:a()})}}}function T(e){var t=e.theme,i=e.translator,n=e.id,r=e.path;return{fontFamily:D({theme:t,translator:i,id:n,path:r,flags:e.flags}),fontSize:P({theme:t,translator:i,id:n,path:r})}}var O,R=function(){if(C)return A;C=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},a=function(i){if(!i||"[object Object]"!==t.call(i))return!1;var n,r=e.call(i,"constructor"),a=i.constructor&&i.constructor.prototype&&e.call(i.constructor.prototype,"isPrototypeOf");if(i.constructor&&!r&&!a)return!1;for(n in i);return void 0===n||e.call(i,n)},o=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,i){if("__proto__"===i){if(!e.call(t,i))return;if(n)return n(t,i).value}return t[i]};return A=function e(){var t,i,n,l,c,u,h=arguments[0],f=1,p=arguments.length,d=!1;for("boolean"==typeof h&&(d=h,h=arguments[1]||{},f=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});f<p;++f)if(null!=(t=arguments[f]))for(i in t)n=s(h,i),h!==(l=s(t,i))&&(d&&l&&(a(l)||(c=r(l)))?(c?(c=!1,u=n&&r(n)?n:[]):u=n&&a(n)?n:{},o(h,{name:i,newValue:e(d,u,l)})):void 0!==l&&o(h,{name:i,newValue:l}));return h},A}(),E=(O=R)&&O.__esModule&&Object.prototype.hasOwnProperty.call(O,"default")?O.default:O;function z(e,t){return{range:function(e){var i=e.resources,n=e.data,r=i.theme.palette("categorical",0===t?n.items.length:t);return n.items.map((function(e){return r[e.value%r.length]}))},valueAccessor:e.value}}function F(e,t){return{range:function(e){var i=e.resources,n=e.data,r=i.theme.palette("categorical",0===t?n.items.length:t);return n.items.map((function(e){return r[e.row.value%r.length]}))},valueAccessor:e.value}}function V(e,t,i,n,r){var a,o,s=r.byRow,l=r.byElemNo;if(n&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===i.activeDimensionIndex&&e.hc.qSize.qcy>((null===(o=(a=e.hc).qDataPages[0]||a.qStackedDataPages[0])||void 0===o?void 0:o.qArea.qHeight)||0)))return l(n,n.raw().qCardinal);if(n){var c=t.pic.extract({field:n.key(),trackBy:n.value}).length;return s(n,c)}return{}}function j(e,t){var i=e.hc.qDimensionInfo,n=t.input.byDimDef||{activeDimensionIndex:i.length-1};if(n.activeDimensionIndex>=0){var r=i[n.activeDimensionIndex];n=r.coloring&&r.coloring.colorMapRef?{type:"libraryItem",key:r.coloring.colorMapRef,activeDimensionIndex:n.activeDimensionIndex}:{activeDimensionIndex:n.activeDimensionIndex}}return n}function $(e,t){var i;return t.activeDimensionIndex>=0?i=e.pic.fields().filter((function(e){return"dimension"===e.type()}))[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(i=t.key?e.pic.field((function(e){return e.raw().colorMapRef===t.key})):void 0)&&(i=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))):"expression"===t.type&&(i=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),i}function H(e,t,i){e.prototype=t.prototype=i,i.constructor=e}function _(e,t){var i=Object.create(e.prototype);for(var n in t)i[n]=t[n];return i}function B(){}var W=1/.7,U="\\s*([+-]?\\d+)\\s*",G="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",X="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",K=/^#([0-9a-f]{3,8})$/,Z=new RegExp(`^rgb\\(${U},${U},${U}\\)$`),Y=new RegExp(`^rgb\\(${X},${X},${X}\\)$`),Q=new RegExp(`^rgba\\(${U},${U},${U},${G}\\)$`),J=new RegExp(`^rgba\\(${X},${X},${X},${G}\\)$`),ee=new RegExp(`^hsl\\(${G},${X},${X}\\)$`),te=new RegExp(`^hsla\\(${G},${X},${X},${G}\\)$`),ie={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 ne(){return this.rgb().formatHex()}function re(){return this.rgb().formatRgb()}function ae(e){var t,i;return e=(e+"").trim().toLowerCase(),(t=K.exec(e))?(i=t[1].length,t=parseInt(t[1],16),6===i?oe(t):3===i?new ue(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===i?se(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===i?se(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=Z.exec(e))?new ue(t[1],t[2],t[3],1):(t=Y.exec(e))?new ue(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Q.exec(e))?se(t[1],t[2],t[3],t[4]):(t=J.exec(e))?se(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ee.exec(e))?ge(t[1],t[2]/100,t[3]/100,1):(t=te.exec(e))?ge(t[1],t[2]/100,t[3]/100,t[4]):ie.hasOwnProperty(e)?oe(ie[e]):"transparent"===e?new ue(NaN,NaN,NaN,0):null}function oe(e){return new ue(e>>16&255,e>>8&255,255&e,1)}function se(e,t,i,n){return n<=0&&(e=t=i=NaN),new ue(e,t,i,n)}function le(e){return e instanceof B||(e=ae(e)),e?new ue((e=e.rgb()).r,e.g,e.b,e.opacity):new ue}function ce(e,t,i,n){return 1===arguments.length?le(e):new ue(e,t,i,null==n?1:n)}function ue(e,t,i,n){this.r=+e,this.g=+t,this.b=+i,this.opacity=+n}function he(){return`#${me(this.r)}${me(this.g)}${me(this.b)}`}function fe(){const e=pe(this.opacity);return`${1===e?"rgb(":"rgba("}${de(this.r)}, ${de(this.g)}, ${de(this.b)}${1===e?")":`, ${e})`}`}function pe(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function de(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function me(e){return((e=de(e))<16?"0":"")+e.toString(16)}function ge(e,t,i,n){return n<=0?e=t=i=NaN:i<=0||i>=1?e=t=NaN:t<=0&&(e=NaN),new ve(e,t,i,n)}function ye(e){if(e instanceof ve)return new ve(e.h,e.s,e.l,e.opacity);if(e instanceof B||(e=ae(e)),!e)return new ve;if(e instanceof ve)return e;var t=(e=e.rgb()).r/255,i=e.g/255,n=e.b/255,r=Math.min(t,i,n),a=Math.max(t,i,n),o=NaN,s=a-r,l=(a+r)/2;return s?(o=t===a?(i-n)/s+6*(i<n):i===a?(n-t)/s+2:(t-i)/s+4,s/=l<.5?a+r:2-a-r,o*=60):s=l>0&&l<1?0:o,new ve(o,s,l,e.opacity)}function ve(e,t,i,n){this.h=+e,this.s=+t,this.l=+i,this.opacity=+n}function be(e){return(e=(e||0)%360)<0?e+360:e}function xe(e){return Math.max(0,Math.min(1,e||0))}function Me(e,t,i){return 255*(e<60?t+(i-t)*e/60:e<180?i:e<240?t+(i-t)*(240-e)/60:t)}H(B,ae,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ne,formatHex:ne,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ye(this).formatHsl()},formatRgb:re,toString:re}),H(ue,ce,_(B,{brighter(e){return e=null==e?W:Math.pow(W,e),new ue(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ue(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ue(de(this.r),de(this.g),de(this.b),pe(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:he,formatHex:he,formatHex8:function(){return`#${me(this.r)}${me(this.g)}${me(this.b)}${me(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:fe,toString:fe})),H(ve,(function(e,t,i,n){return 1===arguments.length?ye(e):new ve(e,t,i,null==n?1:n)}),_(B,{brighter(e){return e=null==e?W:Math.pow(W,e),new ve(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ve(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,i=this.l,n=i+(i<.5?i:1-i)*t,r=2*i-n;return new ue(Me(e>=240?e-240:e+120,r,n),Me(e,r,n),Me(e<120?e+240:e-120,r,n),this.opacity)},clamp(){return new ve(be(this.h),xe(this.s),xe(this.l),pe(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=pe(this.opacity);return`${1===e?"hsl(":"hsla("}${be(this.h)}, ${100*xe(this.s)}%, ${100*xe(this.l)}%${1===e?")":`, ${e})`}`}}));const Se=Math.PI/180,ke=180/Math.PI,we=4/29,Ne=6/29,Ie=3*Ne*Ne;function De(e){if(e instanceof Ae)return new Ae(e.l,e.a,e.b,e.opacity);if(e instanceof Te)return Oe(e);e instanceof ue||(e=le(e));var t,i,n=Pe(e.r),r=Pe(e.g),a=Pe(e.b),o=Ce((.2225045*n+.7168786*r+.0606169*a)/1);return n===r&&r===a?t=i=o:(t=Ce((.4360747*n+.3850649*r+.1430804*a)/.96422),i=Ce((.0139322*n+.0971045*r+.7141733*a)/.82521)),new Ae(116*o-16,500*(t-o),200*(o-i),e.opacity)}function Ae(e,t,i,n){this.l=+e,this.a=+t,this.b=+i,this.opacity=+n}function Ce(e){return e>.008856451679035631?Math.pow(e,1/3):e/Ie+we}function Le(e){return e>Ne?e*e*e:Ie*(e-we)}function qe(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Pe(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Te(e,t,i,n){this.h=+e,this.c=+t,this.l=+i,this.opacity=+n}function Oe(e){if(isNaN(e.h))return new Ae(e.l,0,0,e.opacity);var t=e.h*Se;return new Ae(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}H(Ae,(function(e,t,i,n){return 1===arguments.length?De(e):new Ae(e,t,i,null==n?1:n)}),_(B,{brighter(e){return new Ae(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Ae(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,i=isNaN(this.b)?e:e-this.b/200;return new ue(qe(3.1338561*(t=.96422*Le(t))-1.6168667*(e=1*Le(e))-.4906146*(i=.82521*Le(i))),qe(-.9787684*t+1.9161415*e+.033454*i),qe(.0719453*t-.2289914*e+1.4052427*i),this.opacity)}})),H(Te,(function(e,t,i,n){return 1===arguments.length?function(e){if(e instanceof Te)return new Te(e.h,e.c,e.l,e.opacity);if(e instanceof Ae||(e=De(e)),0===e.a&&0===e.b)return new Te(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*ke;return new Te(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Te(e,t,i,null==n?1:n)}),_(B,{brighter(e){return new Te(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Te(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Oe(this).rgb()}}));var Re=e=>()=>e;function Ee(e,t){var i=t-e;return i?function(e,t){return function(i){return e+i*t}}(e,i):Re(isNaN(e)?t:e)}var ze=function e(t){var i=function(e){return 1==(e=+e)?Ee:function(t,i){return i-t?function(e,t,i){return e=Math.pow(e,i),t=Math.pow(t,i)-e,i=1/i,function(n){return Math.pow(e+n*t,i)}}(t,i,e):Re(isNaN(t)?i:t)}}(t);function n(e,t){var n=i((e=ce(e)).r,(t=ce(t)).r),r=i(e.g,t.g),a=i(e.b,t.b),o=Ee(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=r(t),e.b=a(t),e.opacity=o(t),e+""}}return n.gamma=e,n}(1),Fe=/^class(-pyramid)?/,Ve=function(e,t,i,n){var r=void 0!==i.min?i.min:n.min(),a=void 0!==i.max?i.max:n.max(),o=r,s=a,l=t.limits,c={},u="percent"===t.limitType?l.map((function(e){return r+(a-r)*e})):l,h=t.colors.map((function(t){return e.resolveUIColor(t)}));if(r=Math.min.apply(Math,[r].concat(x(u))),a=Math.max.apply(Math,[a].concat(x(u))),c.min=r,c.max=a,t.breakTypes&&-1===t.breakTypes.indexOf(!0))c.type="categorical",Object.assign(c,function(e){var t=e.min,i=e.max,n=e.limits,r=e.range,a=[],o=[];if(n.length)if(n[n.length-1]<t)o.push(t,i),a.push(r[r.length-1],r[r.length-1],r[r.length-1]);else if(n[0]>i)o.push(t,i),a.push(r[0],r[0],r[0]);else{if(n[0]>t)o.push(t),a.push(r[0]);else{o.push(t);for(var s=0;s<n.length;s++)if(t<n[s]){a.push(r[s]);break}}for(var l=0;l<n.length;l++)t<n[l]&&n[l]<i&&(o.push(n[l]),a.push(r[l]));if(n[n.length-1]<i)o.push(i),a.push(r[n.length]),a.push(r[n.length]);else{o.push(i);for(var c=0;c<n.length;c++)if(n[c]>i){a.push(r[c]),a.push(r[c]);break}}}else a.push(r[0]);return{min:t,max:i,range:a,domain:o}}({min:"percent"===t.limitType?r:o,max:"percent"===t.limitType?a:s,range:h,limits:"percent"===t.limitType?u:l}));else if(t.breakTypes){var f=t.breakTypes;c.type="continuous",c.domain=[r],c.range=[h[0]];for(var p=0;p<u.length;p+=1)if(f[p]){var d=h[p],m=h[p+1],g=ze(d,m)(.5);c.range.push(g),c.domain.push(u[p]),p<u.length-1&&f[p+1]&&(c.range.push(h[p+1]),c.domain.push((u[p]+u[p+1])/2))}else c.range.push(h[p]),c.range.push(h[p+1]),c.domain.push(u[p]),c.domain.push(u[p]+Math.min(1e-6,(a-r)/1e6));c.range.push(h[h.length-1]),c.domain.push(a)}else c.domain=u,c.range=h;return c};function je(e,t,i,n,r){var a,o,s,l=0,c=[],u=(e-t)/(n+1);if(0===u)return 1;for(a=0;a<i.length;a+=1)o=.99*(i[a]-t),s=i[a]>e?Math.floor(e/u):i[a]<t?0:Math.floor(o/u),Number.isNaN(s)||(c[s]?c[s]+=1:c[s]=1);for(a=0;a<c.length;a+=1)c[a]&&(l+=1);return l<=n||l>=r?Math.max(l,n):je(e,t,i,n+1,r)}var $e=function(e,t,i,n){var r,a,o=t.theme,s=t.hc,l=n.f,c={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:i.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},u=[],h=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(h=!("S"===(r=i.pic.raw()).qMode&&(r.qDataPages[0]&&r.qSize.qcy>r.qDataPages[0].qArea.qHeight||!r.qDataPages.length&&r.qSize.qcy>0)||"K"===r.qMode&&r.qStackedDataPages[0]&&r.qSize.qcy>r.qStackedDataPages[0].qArea.qHeight||"T"===r.qMode&&r.qSize.qcy>r.qTreeDataPages[0].qGroupSize))&&(u=i.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,x(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===i.input.autoMinMax){if(c.min=i.input.measureMin,c.max=i.input.measureMax,c.max<c.min)return{invalid:!0}}else if(l&&!h)c.min=l.min(),c.max=l.max();else if(l){if(!u.length)return{invalid:!0};c.min=Math.min.apply(Math,x(u)),c.max=Math.max.apply(Math,x(u))}if(i.input.measureScheme&&(c.palettes={quant:i.input.measureScheme}),o){var f=o.getDataColorScales().filter((function(e){return e.key===i.input.measureScheme}))[0];c.type=f&&Fe.test(f.type)?"categorical":"continuous","categorical"===c.type&&(a=f.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,x(f.colors.map((function(e){return e?e.length:0})))):f.colors.length)}if("categorical"===c.type){for(var p=h?je(c.max,c.min,u,1,a):a,d=(c.max-c.min)/p,m=[],g=0;g<p+1;g+=1)m.push(c.min+d*g);c.domain=m,c.range=function(e){for(var t=e.resources.theme.palette("quant",p),i=Math.max(1,Math.floor(t.length/p)),n=[],r=0;r<p;r+=1)n.push(t[r*i]);return[n[0]].concat(n,[n[n.length-1]])}}return c};function He(e,t){var i;return t.activeMeasureIndex>=0?i=e.pic.fields().filter((function(e){return"measure"===e.type()}))[t.activeMeasureIndex]:"libraryItem"===t.type?i=e.pic.field((function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key})):"expression"===t.type&&(i=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),i||(i=e.pic.field((function(e){return void 0!==e.raw().matchMeasure})))&&(i=e.pic.fields().filter((function(e){return"measure"===e.type()}))[i.raw().matchMeasure]),i}function _e(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function Be(e,t){for(var i=(null==t?void 0:t.domain)||[],n=(null==t?void 0:t.range)||[],r=[],a=0;a<e.length;++a){var o=e[a];if("constant"===(null==o?void 0:o.mode)){var s=i.indexOf(a);-1===s?(i.push(a),n.push(o.primary)):n[s]=o.primary,e[a]=null}else if(o){r.push(a);var l=i.indexOf(a);-1!==l&&(i.splice(l,1),n.splice(l,1))}}return{domain:i,range:n,exclude:r}}function We(e,t,i,n){var r,a=function(e,t,i,n){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,i){var n=t.theme,r=t.hc,a=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,o=void 0===a?He:a,s=i.input.byMeasureDef||{activeMeasureIndex:0},l=o(i,s),c=$e(0,{theme:n,hc:r},i,{f:l});if(c.invalid)return c;"expression"===s.type&&(s.activeMeasureIndex<0||void 0===s.activeMeasureIndex)&&(c.label=s.label,l&&"color.altLabel"===l.raw().labelExpRef&&(c.label=i.input.altLabel)),!c.label&&l&&(c.label=l.title());var u=s.activeMeasureIndex>=0?l:null;if(!u&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(u=i.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),i.input.useMeasureGradient&&"libraryItem"===s.type)if(u){var h=u.raw().coloring;h&&h.gradient&&E(c,Ve(e,h.gradient,c,u))}else c.auxiliary=s;return c}(e,i,t);if("byDimension"===t.input.mode)return function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=n.getCDef,a=void 0===r?j:r,o=n.getCByField,s=void 0===o?$:o,l=n.getPersistence,c=void 0===l?V:l,u=a(t,i),h=s(i,u),f=h?h.raw():{},p=i&&i.pic?i.pic.raw():{};if(f.qError||f.qSize&&0===f.qSize.qcy&&!p.qHasOtherValues)return{invalid:!0};var d={mode:"field",fieldType:"dimension",type:"categorical",field:h?h.key():void 0,isFieldLocked:f.qLocked};return("expression"===u.type||u.activeDimensionIndex<0)&&(d.label=u.label,"color.altLabel"===f.labelExpRef&&(d.label=i.input.altLabel)),!d.label&&h&&(d.label=h.title()),i.input.dimensionScheme&&(d.palettes={categorical:i.input.dimensionScheme}),i.input.useDimColVal&&"libraryItem"===u.type&&(d.auxiliary=u),E(d,c(t,i,u,h,{byRow:F,byElemNo:z})),d}(e,i,t);if("byExpression"===t.input.mode)return function(e,t,i,n){var r=t.hc,a=t.theme,o=t.translator,s=i.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!s||!s.raw().qFallbackTitle&&!i.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||i.input.expressionIsColor))return{mode:"constant",type:"constant",primary:n.nil};if(i.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=$e(0,{hc:r,theme:a},i,{f:s});return l.invalid||(l.label=i.input.expressionLabel||o.get("Object.ChartTooltip.ColorExpression")),l}(0,i,t,n);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,i,n){var r=t.hc,a=t.theme,o=t.translator,s=i.input.useBaseColors;if(("byMultiple"===i.input.mode||"primary"===i.input.mode&&"measure"===i.input.useBaseColors)&&r.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],c=[];"measure"===i.input.useBaseColors&&r.qMeasureInfo.forEach((function(t,i){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(i);var r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?c.push(n.primary):c.push(r)}}));var u=i.input.dimensionScheme?{categorical:i.input.dimensionScheme}:void 0,h=a?a.getDataColorPalettes()[0]:void 0;return"measure"===i.input.useBaseColors&&h&&(u={categorical:h.key}),{mode:"measure",type:"categorical",palettes:u,label:o?o.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:c}:void 0}}if("dimension"===s){var f=[],p=[];return r.qDimensionInfo.forEach((function(t,i){if(t.baseColor||t.coloring&&t.coloring.baseColor){f.push(i);var r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?p.push(n.primary):p.push(r)}})),{mode:"dimension",type:"categorical",field:f.length?f[0]:void 0,explicit:f.length?{domain:f,range:p}:void 0}}var d=n.primary;if(void 0!==i.input.paletteColor)i.input.paletteColor&&(d=e.resolveUIColor(i.input.paletteColor));else{var m=i.input.singleColor;"number"!=typeof m||Number.isNaN(m)||(d=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][m])}return{mode:"constant",type:"constant",primary:d}}(e,i,t,n)}return{}}(e,t,i,n);return null!==(r=t.input)&&void 0!==r&&r.measureOverrides?(a.measureOverrides=t.input.measureOverrides.map((function(i,r){return function(e){var t,i=e.cm,n=e.defaults,r=e.index,a=e.input,o=e.pic;if(!a||!a.on)return null;var s=null!==(t=a.mode)&&void 0!==t?t:"primary";return"primary"===s?function(e,t,i){var n=i.primary;return void 0!==t.paletteColor&&t.paletteColor&&(n=e.resolveUIColor(t.paletteColor)),v(v({},i),{},{mode:"constant",type:"constant",primary:n})}(i,a,n):"byExpression"===s?function(e,t,i){var n="qMeasureInfo/".concat(e,"/"),r=t.field((function(e){return e.id().startsWith(n)&&"colorByMeasureExpression"===e.raw().id})),a=r;return v(v({},i),{},a?{mode:"field",fieldType:"expression",field:r?r.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:i.nil})}(r,o,n):null}({cm:e,input:i,defaults:n,index:r,pic:t.pic})})),function(e,t){var i,n,r,a=t.translator;if(_e(e),1===(null===(i=e.measureOverrides)||void 0===i?void 0:i.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=Be(e.measureOverrides,e.explicit),_e(e)),null!==(n=e.measureOverrides)&&void 0!==n&&n.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var o={mode:"measure",type:"categorical",label:null==a?void 0:a.get("Common.Measures")};return o.explicit=Be(e.measureOverrides),o}return null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(a,i)):a}var Ue=function(e,t){var i=e.fieldType,n={};if(t)if("measure"===i){var r=t.coloring;r&&(n.measureGradient=r.gradient)}else if("dimension"===i){var a=t[0],o=t[1];a&&(n.legendDataPage=a),o&&(n.dimValsData=o.colorMap)}return n},Ge=function(e){throw e.isHandled=!0,e};function Xe(e){return function(t){return"object"===M(t.datum[e])?t.datum[e].value:void 0}}function Ke(e){return"object"===M(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function Ze(e){return-3===e.datum.value}var Ye={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},Qe={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"};function Je(e){var t=e.theme,i=e.key,n=e.styleOverrides,r={title:{color:Ye.COLOR,fontSize:Ye.FONT_SIZE,fontFamily:Ye.FONT_FAMILY},label:{color:Qe.COLOR,fontSize:Qe.FONT_SIZE,fontFamily:Qe.FONT_FAMILY}};if(!t&&!n)return r;var a=n||{},o=a.title,s=a.label,l=function(e){var t=e.theme,i=e.key;return function(e,n,r,a){return void 0!==e?e:t?t.getStyle(i,n,r):a}}({theme:t,key:i});return r.title.color=l(null==o?void 0:o.color,"legend.title","color",Ye.COLOR),r.title.fontSize=l(null==o?void 0:o.fontSize,"legend.title","fontSize",Ye.FONT_SIZE),r.title.fontFamily=l(null==o?void 0:o.fontFamily,"legend.title","fontFamily",Ye.FONT_FAMILY),r.label.color=l(null==s?void 0:s.color,"legend.label","color",Qe.COLOR),r.label.fontSize=l(null==s?void 0:s.fontSize,"legend.label","fontSize",Qe.FONT_SIZE),r.label.fontFamily=l(null==s?void 0:s.fontFamily,"legend.label","fontFamily",Qe.FONT_FAMILY),r}var et=function(e,t,i){var n=e&&e.dock||void 0;if("auto"!==n)return n||"right";if(t){var r=t.element.getBoundingClientRect();if(r.height>r.width)return"bottom"}return i?"left":"right"},tt=function(e,t,i){return!(i.invalid||"color"===i.type||"measure"===i.mode&&t.qMeasureInfo.length<=1||"dimension"===i.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function it(e,t){var i=e.styleReference,n=e.styleOverrides,r=e.chart,a=e.rtl,o=t.legendProps,s=t.coloring,l=t.theme,c=t.hc,u=Je({theme:l,key:i,styleOverrides:n});return{layout:{minimumLayoutMode:"MEDIUM",dock:et(o,r,a)},show:"function"==typeof o.show?function(){return tt(o,c,s)}:tt(o,c,s),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==o.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:s.label||"",fill:u.title.color,fontSize:u.title.fontSize,fontFamily:u.title.fontFamily}}}}function nt(e,t,i){var n=[],r=[],a=function(e,t,i){return"categorical"===t.coloring.type?function(e,t,i){var n=it(e,t);if(!n.show)return!1;var r,a=e.key,o=e.styleReference,s=e.styleOverrides,l=e.viewState,c=e.rtl,u=e.settings,h=e.style,f=t.scaleKey,p=t.theme,d=t.scales,m=Je({theme:p,key:o,styleOverrides:s}),g=n.layout.dock,y="left"===g||"right"===g?{maxLines:2,wordBreak:"break-word"}:{},b={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&&(r=function(e){return e.datum.value>=0||-3===e.datum.value});var x="".concat(f,"Legend");return E(!0,n,{type:"legend-cat",key:"".concat(a,"-cat"),scale:x in d?x:f,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(n.layout.dock)?2:1,direction:c?"rtl":"ltr",horizontal:20},item:{show:r,label:v({fill:m.label.color,fontSize:m.label.fontSize,fontFamily:m.label.fontFamily},y)},navigation:{disabled:i,button:{content:function(e,t){var i=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:b[i]})])])}}}},brush:{consume:[{context:"selection",data:["",a],style:{inactive:{opacity:.3}}}]}},{settings:u,style:h})}(e,t,i):"continuous"===t.coloring.type&&function(e,t){var i,n=e.key,r=e.styleReference,a=e.styleOverrides,o=e.rtl,s=e.settings,l=e.style,c=t.scaleKey,u=t.theme,h="".concat(c,"Range"),f=it(e,t);if(!f.show)return!1;var p=Je({theme:u,key:r,styleOverrides:a}),d=f.layout.dock,m="right"===d||"left"===d,g=null===(i=t.scales)||void 0===i?void 0:i[h];return m&&g&&(g.invert=!0),E(!0,f,{type:"legend-seq",key:"".concat(n,"-seq"),settings:{fill:c,major:h,length:1,tick:{fill:p.label.color,fontSize:p.label.fontSize,fontFamily:p.label.fontFamily},title:{anchor:!o||"top"!==f.layout.dock&&"bottom"!==f.layout.dock?void 0:"right",padding:parseFloat(f.settings.title.fontSize)||16}}},{settings:s,style:l})}(e,t)}(e,t,i&&i.navigationDisabled);return n.push(a),a&&"legend-cat"===a.type&&(r.push(function(e){var t=e.key,i=e.requireFailure,n=e.recognizeWith,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:i,recognizeWith:n,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,i){var n;if(!i)return!0;if(null!=r&&null!==(n=r.interact)&&void 0!==n&&n.enabled&&!r.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var a=i.srcEvent.target;return!!(a&&a.hasAttribute("data-action")&&a.hasAttribute("data-component-key"))||!(!a||!a.childNodes[0]||"BUTTON"!==a.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,i)),r.push(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,i=e.key,n=e.requireFailure,r=e.recognizeWith,a=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(i),type:"Pan",requireFailure:n,recognizeWith:r,options:{event:t,pointers:1,threshold:10,enable:function(e,n){var r;return this.started===t||!n||!(null!=a&&null!==(r=a.interact)&&void 0!==r&&r.enabled&&!a.interact.enabled())&&this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(i,"-cat")}))}},events:g(g(g({},"".concat(t,"start"),(function(e){e.preventDefault(),this.started!==t&&(this.started=t,this.chart.component("".concat(i,"-cat")).emit("panstart",e))})),"".concat(t,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(i,"-cat")).emit("panmove",e)})),"".concat(t,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(i,"-cat")).emit("panend",e),this.started=!1}))}}(e,i))),{interactions:r,components:n}}function rt(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,i=function(e){var t=v({hc:null,colorProps:null,layout:null,theme:null},e),i={},n={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},r={auto:function(e){return e?(n.auto=e,r):n.auto},getDimensionColorMap:function(e){return e?(n.getDimensionColorMap=e,r):n.getDimensionColorMap},getAttributeDimension:function(e){return e?(n.getAttributeDimension=e,r):n.getAttributeDimension},getMeasure:function(e){return e?(n.getMeasure=e,r):n.getMeasure},set:function(e){var r;if(!e.colorProps)throw new Error('Missing "colorProps"');if(E(t,e),(i={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var a=n.auto(e.layout);i.input=E(!0,{},i.input,a,{auto:!1});var o=t.theme?t.theme.getDataColorPalettes():[];o[0]&&(i.input.dimensionScheme=o[0].key);var s=0;i.input.byDimDef&&+i.input.byDimDef.activeDimensionIndex>=0&&(s=+i.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[s]&&t.hc.qDimensionInfo[s].coloring&&t.hc.qDimensionInfo[s].coloring.colorMapRef&&i.input.byDimDef&&(i.input.byDimDef.type="libraryItem",i.input.byDimDef.key=t.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(r=i.input.measureOverrides)&&void 0!==r&&r.every((function(e){return!e||!e.on}))&&(i.input=E(!1,{},i.input,{measureOverrides:null}))},palettes:function(){if(!i.palettes){var e=t.theme,n=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){n.push({key:"ui",colors:e.colors})})),i.palettes=n}return i.palettes},getAuxiliaryData:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var r=(e.auxiliary||{}).key;if("measure"===e.fieldType)return n.getMeasure(r,t).catch((function(){}));if("dimension"===e.fieldType){var a="".concat(i,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?n.getAttributeDimension(a,t).catch((function(){})):Promise.resolve(),r?n.getDimensionColorMap(r,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,n){var r=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,n).then((function(n){if(!n)return{};if("measure"===e.fieldType){if(n.coloring&&n.coloring.gradient){var a=i.pic.field(e.field);return Ve(r,n.coloring.gradient,e,a)}return{}}if("dimension"===e.fieldType){var o={nil:e.nil,others:e.others},s=n[0],l=n[1]?n[1].colorMap:null;if(s){var c=t.picasso.data("q")({data:{qDimensionInfo:[i.pic.field(e.field).raw(),i.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:s,qInterColumnSortOrder:[0,1],qMode:"S"}});o.legendDataset=c}return l?function(e,t,i,n){var r=n.external,a=n.field,o=v({},e);E(o,z(a,a.raw().qCardinal));var s=r.theme?r.theme.getDataColorPalettes()[0]:null;return t.nul&&(o.nil=i.resolveUIColor(t.nul)),t.oth&&(o.others=i.resolveUIColor(t.oth)),t.usePal?(o.palettes={categorical:t.pal},s&&!t.pal&&(o.palettes.categorical=s.key,E(o,z(a)))):!1===t.autoFill&&t.single?o.range=[i.resolveUIColor(t.single)]:t.autoFill&&(s&&(o.palettes={categorical:s.key}),E(o,z(a))),t.colors&&t.colors.length&&(o.explicit=function(e,t,i){for(var n={},r=0;r<e.length;r+=1)n[e[r].value]=e[r].baseColor;var a=[];return{domain:function(e){var r=e.data,o=[];a=[];for(var s=0;s<r.items.length;s++){var l=r.items[s],c=(l.text||l).label;n[c]&&-1===o.indexOf(l.value)&&(o.push(l.value),a.push(t.resolveUIColor(n[c])))}return o.push(-3,-2),a.push(i.others),a.push(i.nil),o},range:function(){return a}}}(t.colors,i,o)),o}(o,l,r,{external:t,field:i.pic.field(e.field)}):o}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===i.uiPalette&&(i.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!i.uiPalette)return e.color;var t="none"===i.uiPalette.colors[0]?e.index:e.index-1;return void 0===i.uiPalette.colors[t]?e.color:i.uiPalette.colors[t]},settings:function(){if(this.palettes(),!i.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},n=t.theme;n&&(e=v(v({},e),n.getDataColorSpecials())),i.settings=E(e,We(this,i,t,e))}return i.settings}};return r}(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(e,t){return function(e,t){var i=t.layout,n=t.app;return i&&i.snapshotData?i.snapshotData.content&&i.snapshotData.content.chartData&&i.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:i.snapshotData.content.chartData.dimValsData}):Promise.reject():n&&n.getObject?n.getObject("ColorMapModel_".concat(e)).then((function(e){return e.getLayout()})):Promise.reject()}(e,{layout:t.layout,app:t.app})})).getMeasure((function(e,t){return function(e,t){var i=t.layout,n=t.app;return i&&i.snapshotData?i.snapshotData.content&&i.snapshotData.content.chartData&&i.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:i.snapshotData.content.chartData.measureGradient}}):Promise.reject():n&&n.getMeasure?n.getMeasure(e).then((function(e){return e.getMeasure()})):Promise.reject()}(e,{layout:t.layout,app:t.app})})).getAttributeDimension((function(e,t){return function(e,t){var i=t.layout,n=t.model,r=t.app;return i&&i.snapshotData?i.snapshotData.content&&i.snapshotData.content.chartData&&i.snapshotData.content.chartData.legendDataPage?Promise.resolve(i.snapshotData.content.chartData.legendDataPage):Promise.reject():n&&n.session&&r?n.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(Ge):Promise.reject()}(e,{layout:t.layout,model:t.model,app:t.app})}));return i.getSnapshotData=Ue,i}({resources:e}),i={},n={},r=function(e){return n.settings||(e||console.warn("settings() called before auxiliarySettings()"),n.settings=t.settings()),n.settings},a={config:function(r){if(i=v({},r),n={},!i.key)throw new Error("Missing key");t.set(v(v({},e),i))},auto:function(e){return e?(t.auto(e),a):t.auto()},getAuxiliarySettings:function(e){return n.auxiliarySettings?Promise.resolve(n.auxiliarySettings):t.getAuxiliarySettings(r(!0),e).then((function(e){return n.auxiliarySettings=e||{},n.settings=v(v({},n.settings),n.auxiliarySettings),n.scales=void 0,n.color=void 0,n.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(r())},getSnapshotData:function(e){var i=r();return t.getAuxiliaryData(i,e).then((function(e){return t.getSnapshotData(i,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=r();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=r().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var i=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||i)}(r(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,i=e.coloring,n=e.theme,r=[];if(i&&i.palettes&&n){var a=i.palettes.categorical||t.dimensionScheme,o=n.getDataColorPalettes().filter((function(e){return e.key===a}))[0]||n.getDataColorPalettes()[0];a&&o&&r.push({key:"categorical",colors:o.colors});var s=i.palettes.metric||t.measureScheme,l=n.getDataColorScales().filter((function(e){return e.key===s}))[0]||n.getDataColorScales()[0];if(l){var c=l.colors[0]?l.colors:[[]].concat(x(l.colors.slice(1)));c=Array.isArray(c[0])?c.map((function(e){return e.slice().reverse()})):c.slice().reverse(),r.push({key:"quant",colors:c})}}return r}({coloring:r(),colorProps:i.colorProps,theme:i.theme})},scales:function(){return n.scales=n.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,i=e.coloring,n=e.rtl,r=e.key,a=e.source,o=e.picasso,s={},l=r;if(i){var c={override:!0,domain:i.explicit&&"function"==typeof i.explicit.domain?i.explicit.domain:[].concat(x((i.explicit||{}).domain||[]),[-3,-2]),range:i.explicit&&"function"==typeof i.explicit.range?i.explicit.range:[].concat(x((i.explicit||{}).range||[]),[i.others,i.nil])};if("field"===i.mode){if("dimension"===i.fieldType){var u,h=function(e){var t=e.hc,i=e.source,n=e.coloring,r={data:{extract:[{source:"dummy",field:0,filter:function(){return r.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:i,field:n.field,trackBy:n.valueAccessor,reduce:"first",props:{row:{reduce:function(){return r.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return r}({hc:t,source:a,coloring:i}).data;if(i.legendDataset){var f=0,p={};o.data("q")({data:t}).extract({field:i.field,trackBy:i.valueAccessor,reduce:function(e){var t=e[0];return p[t]=f++,e[0]}}),u={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return p[e.qElemNumber]}}}}}}var d={data:h,range:i.range,domain:i.domain,explicit:c,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};s[l]=d,u&&(s["".concat(l,"Legend")]=v(v({},d),{},{data:u})),t&&t.qHasOtherValues&&u&&((u||d.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===i.fieldType){var m={data:{field:i.field},min:i.min,max:i.max};s[l]=E({},m,{type:"categorical"===i.type?"threshold-color":"sequential-color",range:i.range,domain:i.domain,invert:i.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=E({},m,{invert:!!n}))}else if("color"!==i.type)throw new Error("UNUSED FIELD")}else if("dimension"===i.mode){var g={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};s[l]=g}else if("measure"===i.mode){var y={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t;return!(null!==(t=i.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:c,type:"categorical-color"};s[l]=y}}return s}({hc:i.hc,coloring:r(),key:i.key,source:i.source,picasso:e.picasso}),n.scales},color:function(){return n.color=n.color||function(e){var t=e.coloring,i=e.scales,n=e.key,r=Xe(n),a=Xe("".concat(n,"IsAnOther")),o=function(e,t){var n=e.fieldType,o=e.invalid,s=e.mode,l=e.nil,c=e.others,u=e.primary,h=e.type;return o?function(e){return Ze(e)||a(e)?c:l}:i[t]?function(e){return Ze(e)?c:Ke(e)||-2===r(e)&&"dimension"===n||"NaN"===r(e)?l:a(e)?c:e.resources.scale(t)(r(e))||c}:"constant"===s?function(e){return Ze(e)||a(e)?c:Ke(e)?l:u}:"color"===h?function(e){return Ze(e)||a(e)?c:Ke(e)?l:r(e)||c}:null},s=o(t,n);if(t.measureOverrides){var l=Xe("".concat(n,"MeasureIdx")),c=t.measureOverrides.map((function(e){return e&&o(e)}));return function(e){var t=l(e);return c[t]?c[t](e):s(e)}}return s}({coloring:r(),scales:this.scales(),key:i.key}),n.color},datumProps:function(e){return function(e){var t,i,n=e.hc,r=e.coloring,a=e.scales,o=e.key,s=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=o,u=r.nil;"field"===r.mode&&r.field?t=r.field:a[o]&&"field"===r.mode&&(t=a[o].data.field||r.field),t?(i={field:t,reduce:"first"},"color"===r.type&&(i.value=function(e){return"NaN"!==e.qNum?function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")}(e.qNum):e.qText&&ae(e.qText)?e.qText:u})):"dimension"===r.mode?i=void 0!==r.field?r.field:n.qDimensionInfo.length-1:"measure"===r.mode&&(i=l);var h=g({},c,i);return n.qDimensionInfo.length>1&&(h["".concat(c,"IsAnOther")]={fields:n.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),s&&(h["".concat(c,"MeasureIdx")]=l),h}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:i.key,hc:i.hc,addMeasureIx:r().measureOverrides},e)},data:function(){var e=r(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:i.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,n=e.key,a=e.viewState,o=e.chart,s=e.rtl,l=e.styleReference,c=void 0===l?"object.legend":l,u=e.styleOverrides,h=e.settings,f=void 0===h?{}:h,p=e.style,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return nt({eventName:t,key:n,rtl:s,viewState:a,chart:o,styleReference:c,styleOverrides:u,settings:f,style:void 0===p?{}:p},{legendProps:i.legendProps,scaleKey:i.key,coloring:r(),theme:i.theme,hc:i.hc,scales:this.scales()},d)}};return a}var at=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function ot(e){var t=e.qHyperCube,i=t.qDimensionInfo,n=t.qMeasureInfo,r=i.some(at),a=n.some(at),o=e.color.useBaseColors;return"measure"===o&&!a||"dimension"===o&&!r?"off":o}var st=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function lt(e){var t,i=e.qHyperCube.qDimensionInfo.some(st),n=e.qHyperCube.qMeasureInfo.some(st),r=i?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=r?r:n?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var ct=function(){};function ut(e){var t,i,n,r,a=e.picasso,o=e.model,s=e.app,l=e.translator,c=e.layoutService,u=void 0===c?void 0:c,h=e.createConfig,f=void 0===h?ct:h,p=e.config,d=void 0===p?{}:p,m=e.custom,g=void 0===m?{}:m,y=d.localeInfo,b=d.key,x=d.theme,M=void 0===x?void 0:x,S=d.auto,k=void 0===S?void 0:S,w=d.definitionPath,N=null==u||null===(t=u.getLayout)||void 0===t?void 0:t.call(u),I={theme:M,key:b,localeInfo:y,layout:N,hc:null==u||null===(i=u.getHyperCube)||void 0===i?void 0:i.call(u),legendProps:null==u||null===(n=u.getLayoutValue)||void 0===n?void 0:n.call(u,"legend"),colorProps:v(v({},null==u||null===(r=u.getLayoutValue)||void 0===r?void 0:r.call(u,"color")),{},{useBaseColors:N?ot(N):void 0})},D=rt({picasso:a,model:o,app:s,translator:l,auto:k});!1!==k&&D.auto((function(e){return k?k({layout:e,defaultAuto:lt}):lt(e)}));var A=!1,C={getColor:function(){return D.color()},getPaletteColor:function(e){var t=e.index,i=e.color;return D.resolveUIColor({index:t,color:i})},getData:function(){return D.data()},getDatumProps:function(e){return D.datumProps(e)},getSnapshotData:function(){return D.getSnapshotData(w)},getSettingsForMeasure:function(e){return D.settingsForMeasure(e)},getSettings:function(){return D.settings()},getLegend:function(e,t){return D.legend(e,t)},getScales:function(){return D.scales()},getPalettes:function(){return D.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return D.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return A},custom:v({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?f:e)({getUseBaseColors:ot}),i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return v(v(v({},e),t),{},{colorProps:v(v({},e.colorProps),t.colorProps||{})})}(I,t);return D.config(i),D.getAuxiliarySettings(w).then((function(){A=!0}))}};return C}var ht="center",ft="bottom";function pt(e){var t=e.chart,i=e.logicalSize;if(i)return i;var n=t?t.element.getBoundingClientRect():{};return{width:n.width,height:n.height}}[{key:"NoDataExist",alignment:ht,condition:function(e){var t=e.layoutService;if(!t)return!1;var i=t.meta.size;return i.x*i.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:ht,condition:function(e){var t=e.layoutService;return!!t&&t.getHyperCubeValue("qMeasureInfo").every((function(e){return"NaN"===e.qMin&&"NaN"===e.qMax}))}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:ht,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var i=t.getHyperCubeValue("qDimensionInfo.0");return i&&(i.qMax<i.qMin||"NaN"===i.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:ht},{key:"DataRangeIncludingZero",alignment:ft},{key:"LimitedData",alignment:ft},{key:"NegativeOrZeroValues",alignment:ft}].reduce((function(e,t){return e[t.key]=t,e}),{});var dt=[{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 mt(e){var t=e.width,i=e.height,n=dt.filter((function(e){return t>=e.size.width&&i>=e.size.height})).shift();return n?n.key:"SPARK"}var gt={left:"right",right:"left",top:"bottom",bottom:"top",near:"far",far:"near"};function yt(e){var t=e.orientation,i=e.dock,n=e.btt,r=e.rtl,a="horizontal"===t?function(e){return"bottom"===e||"near"===e?"bottom":"top"}(i):function(e,t){var i="left"===e||"near"===e?"left":"right";return t?gt[i]:i}(i,r),o=function(e,t,i){return"vertical"===e?t?"bottom":"top":i?"right":"left"}(t,n,r);return{current:a,opposite:gt[a],start:o,end:gt[o]}}function vt(e){var t=e.chart,i=e.layoutService,n=e.config,r=void 0===n?{}:n,a=r.logicalSize,o=void 0!==a&&a,s=r.rtl,l=void 0!==s&&s,c={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}},u={type:"x-y",config:v({},r),meta:c,update:function(e){c.chart.size={width:e.width,height:e.height},c.chart.mode=mt(e);var t=yt({orientation:"horizontal",dock:i.getLayoutValue("xAxis.dock"),btt:!1,rtl:l}),n=t.current,r=t.opposite;c.x.dock=n,c.x.opposite=r,c.x.size=e.width;var a=yt({orientation:"vertical",dock:i.getLayoutValue("yAxis.dock"),btt:!0,rtl:l}),o=a.current,s=a.opposite;c.y.dock=o,c.y.opposite=s,c.y.size=e.height}};return u.update(pt({chart:t,logicalSize:o})),u}var bt="vertical",xt="horizontal";function Mt(e){var t=e.chart,i=e.layoutService,n=e.config,r=void 0===n?{}:n,a=e.typeConfig,o=void 0===a?{}:a,s=r.logicalSize,l=void 0!==s&&s,c=r.rtl,u=void 0!==c&&c,h=o.fallback===bt?bt:xt,f=!!o.invert,p=o.measureAxes||[{ref:"measureAxis",name:"minor"}],d={chart:{orientation:void 0,size:void 0,mode:void 0},major:{orientation:void 0,dock:void 0,opposite:void 0,size:void 0}},m={type:"major-minor",config:v({},r),meta:d,update:function(e){d.chart.orientation=i.getLayoutValue("orientation",h),d.chart.size={width:e.width,height:e.height},d.chart.mode=mt(e),d.major.orientation=function(e){var t=e.chartOrientation,i=e.invert;return e.layoutService.meta.isContinuous?xt:i?t===bt?xt:bt:t}({layoutService:i,chartOrientation:d.chart.orientation,invert:f});var t=yt({orientation:d.major.orientation,dock:i.getLayoutValue("dimensionAxis.dock"),btt:!1,rtl:u}),n=t.current,r=t.opposite;d.major.dock=n,d.major.opposite=r,d.major.size=d.major.orientation===bt?e.height:e.width,p.forEach((function(t){var n={};n.orientation=d.major.orientation===bt?xt:bt;var r=yt({orientation:n.orientation,dock:i.getLayoutValue("".concat(t.ref,".dock")),btt:!0,rtl:u}),a=r.current,o=r.opposite,s=r.start,l=r.end;n.dock=a,n.opposite=o,n.start=s,n.end=l,n.size=n.orientation===bt?e.height:e.width,d[t.name]=n}))}};return m.update(pt({chart:t,logicalSize:l})),m}function St(e){var t=e.chart,i=e.layoutService,n=e.config,r=void 0===n?{}:n,a=e.typeConfig,o=void 0===a?{}:a;return("x-y"===o.type?vt:Mt)({chart:t,layoutService:i,config:r,typeConfig:o})}function kt(e,t,i){if(void 0===e||void 0===t)return i;for(var n=t.split("."),r=e,a=0;a<n.length;++a){var o=n[a];if(void 0===r[o])return i;r=r[o]}return r}var wt=["__proto__","constructor"];function Nt(e,t,i){if(void 0!==e&&void 0!==t){var n=t.split("."),r=n[n.length-1];if(!wt.some((function(e){return n.includes(e)}))){for(var a=e,o=0;o<n.length-1;++o){var s=n[o];void 0===a[s]&&(a[s]=Number.isNaN(+n[o+1])?{}:[]),a=a[s]}void 0!==i?a[r]=i:delete a[r]}}}var It,Dt={ERROR_CODES:[7005],DIMENSION:"qDimensionInfo",MEASURE:"qMeasureInfo"},At=function(e,t){return e[t].reduce((function(e,t,i){var n;return n=t,Dt.ERROR_CODES.some((function(e){var t;return e===(null===(t=n.qError)||void 0===t?void 0:t.qErrorCode)}))?e.filtered.push(i):e.reduced.push(t),e}),{reduced:[],filtered:[]})};function Ct(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[]).map((function(e){var t,i=null===(t=e.qCardinalities)||void 0===t?void 0:t.qHypercubeCardinal;if(i)return i;var n=e.qStateCounts||{},r=n.qLocked,a=void 0===r?0:r,o=n.qOption,s=void 0===o?0:o,l=n.qSelected;return a+s+(void 0===l?0:l)}))}function Lt(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:Ct(e)}}}(e);case"K":return function(e){var t=Ct(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=Ct(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 qt(e){var t=0,i=e.children,n=i&&i.length;if(n)for(;--n>=0;)t+=i[n].value;else t=1;e.value=t}function Pt(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Ot)):void 0===t&&(t=Tt);for(var i,n,r,a,o,s=new zt(e),l=[s];i=l.pop();)if((r=t(i.data))&&(o=(r=Array.from(r)).length))for(i.children=r,a=o-1;a>=0;--a)l.push(n=r[a]=new zt(r[a])),n.parent=i,n.depth=i.depth+1;return s.eachBefore(Et)}function Tt(e){return e.children}function Ot(e){return Array.isArray(e)?e[1]:null}function Rt(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Et(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function zt(e){this.data=e,this.depth=this.height=0,this.parent=null}zt.prototype=Pt.prototype={constructor:zt,count:function(){return this.eachAfter(qt)},each:function(e,t){let i=-1;for(const n of this)e.call(t,n,++i,this);return this},eachAfter:function(e,t){for(var i,n,r,a=this,o=[a],s=[],l=-1;a=o.pop();)if(s.push(a),i=a.children)for(n=0,r=i.length;n<r;++n)o.push(i[n]);for(;a=s.pop();)e.call(t,a,++l,this);return this},eachBefore:function(e,t){for(var i,n,r=this,a=[r],o=-1;r=a.pop();)if(e.call(t,r,++o,this),i=r.children)for(n=i.length-1;n>=0;--n)a.push(i[n]);return this},find:function(e,t){let i=-1;for(const n of this)if(e.call(t,n,++i,this))return n},sum:function(e){return this.eachAfter((function(t){for(var i=+e(t.data)||0,n=t.children,r=n&&n.length;--r>=0;)i+=n[r].value;t.value=i}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,i=function(e,t){if(e===t)return e;var i=e.ancestors(),n=t.ancestors(),r=null;for(e=i.pop(),t=n.pop();e===t;)r=e,e=i.pop(),t=n.pop();return r}(t,e),n=[t];t!==i;)t=t.parent,n.push(t);for(var r=n.length;e!==i;)n.splice(r,0,e),e=e.parent;return n},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(i){i!==e&&t.push({source:i.parent,target:i})})),t},copy:function(){return Pt(this).eachBefore(Rt)},[Symbol.iterator]:function*(){var e,t,i,n,r=this,a=[r];do{for(e=a.reverse(),a=[];r=e.pop();)if(yield r,t=r.children)for(i=0,n=t.length;i<n;++i)a.push(t[i])}while(a.length)}},It=function(e){
|
|
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 i,n,r,a,o,s,l,c,u,h,f=e.length,p=e.search(/[0-9\-\+#]/),d=p>0?e.substring(0,p):"",m=e.split("").reverse().join(""),g=m.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(i=(t="-"===(e=e.substring(p,b)).charAt(0)?-t:+t)<0?t=-t:0,r=(n=e.match(/[^\d\-\+#]/g))&&n[n.length-1]||".",a=n&&n[1]&&n[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(a),e[0]=u.join(""),(o=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-o;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(h=t[0]).length%l,f=h.length,b=0;b<f;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<f-l&&(m+=a);t[0]=m}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(n=t.join(""))&&""!==n||(i=!1),d+(i?"-":"")+n+x}},It({exports:{}});var Ft="'Source Sans Pro', 'Arial', 'sans-serif'",Vt="#333333",jt="#595959",$t="#737373",Ht="#cccccc",_t="#e6e6e6";function Bt(e){var t={};return[].concat(x(e),x([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",jt],["object","axis.label.name","fontFamily",Ft],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",Ht],["object","axis.line.minor","color",_t],["object","axis.title","color"],["object","axis.title","fontFamily",Ft],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",_t],["object","grid.line.major","color",Ht],["object","grid.line.minor","color",_t],["object","label.value","color",jt],["object","label.value","fontFamily",Ft],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",jt],[!1,"label.value","lightColor",_t],["object","outOfRange","color","#999"],["object","legend.title","color",Vt],["object","legend.title","fontFamily",Ft],["object","legend.title","fontSize","15px"],["object","legend.label","color",jt],["object","legend.label","fontFamily",Ft],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",Vt],["object","referenceLine.label.name","fontFamily",Ft],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",_t],["object","referenceLine.outOfBounds","fontFamily",Ft],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",$t,function(e){return"transparent"===e?$t:e}]])).reduce((function(e,i){var n="".concat(i[0],"-").concat(i[1],"-").concat(i[2],"}");return t[n]||(t[n]=!0,e.push(i)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var Wt=function(e){return e};function Ut(e){var t=e.theme,i=e.id,n=e.transform,r=e.extend,a=e.matrix,o={},s=n.reduce((function(e,t){var i=b(t,2),n=i[0],r=i[1];return e[n]=r,e}),{});return a.forEach((function(e){var n=b(e,5),r=n[0],a=n[1],l=n[2],c=n[3],u=n[4],h=void 0===u?function(e){return e}:u,f=function(e){var t=e.theme,i=e.base,n=e.path,r=e.attribute,a=e.defaultValue,o=void 0===a?void 0:a;if(!t||!1===i)return o;var s=t.getStyle(i,n,r);return void 0===s?o:s}({theme:t,base:"object"===r&&i?"".concat("object",".").concat(i):r,path:a,attribute:l,defaultValue:c}),p=(s["".concat(a,".").concat(l)]||Wt)(h(f));Nt(o,[a,l].filter(Boolean).join("."),p)})),r.forEach((function(e){var t=b(e,2),i=t[0],n=t[1];Nt(o,i,n)})),o}const Gt=(e,t,i)=>{const n=function(e){var t=e.theme,i=e.translator,n=e.config,r=void 0===n?{}:n,a=e.flags,o=function(e){var t=e.config,i=void 0===t?{}:t,n=i.id,r=i.paths;return{id:void 0===n?"object":"".concat("object",".").concat(n),paths:Array.isArray(r)?r:[]}}({config:r}),s=o.id,l=o.paths,c={};l.forEach((function(e){for(var n=e.split("."),r=c,o=0;o<n.length;o++){var l=n[o];o===n.length-1?r[l]=T({theme:t,translator:i,id:s,path:e,flags:a}):void 0===r[l]&&(r[l]={}),r=r[l]}}));var u=function(e){for(var t=e.split("."),i=c,n=0;n<t.length;n++){var r=t[n];if(void 0===i[r])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));i=i[r]}return i};return c.getDefaultValue=function(e){return u(e).getDefaultValue()},c.getOptions=function(e){return u(e).getOptions()},c}({theme:i,translator:t,flags:e,config:{id:"gauge",paths:["axis.title","axis.label.name","label.value"]}});return{component:"styling-panel",chartTitle:"Object.Gauge",translation:"LayerStyleEditor.component.styling",useBackground:!0,subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,items:{axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:{labelSection:{component:"items",ref:"components",key:"axis",items:{fontWrapper:{component:"inline-wrapper",items:{fontFamily:{ref:"axis.title.fontFamily",component:"dropdown",options:()=>n.getOptions("axis.title.fontFamily"),defaultValue:()=>n.getDefaultValue("axis.title.fontFamily")},fontColor:{ref:"axis.title.color",component:"color-picker",defaultValue:()=>({color:i.getStyle("object.gauge","axis.title","color")}),width:!1}}}}}}},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:{labelSection:{component:"items",ref:"components",key:"axis",items:{fontWrapper:{component:"inline-wrapper",items:{fontFamily:{ref:"axis.label.name.fontFamily",component:"dropdown",options:()=>n.getOptions("axis.label.name.fontFamily"),defaultValue:()=>n.getDefaultValue("axis.label.name.fontFamily"),width:!0},fontColor:{ref:"axis.label.name.color",component:"color-picker",defaultValue:()=>({color:i.getStyle("object.gauge","axis.label.name","color")}),width:!1}}}}}}},valueLabelSection:{translation:"properties.value.label",component:"panel-section",items:{labelSection:{component:"items",ref:"components",key:"value",items:{fontWrapper:{component:"inline-wrapper",items:{fontFamily:{ref:"label.value.fontFamily",component:"dropdown",options:()=>n.getOptions("label.value.fontFamily"),defaultValue:()=>n.getDefaultValue("label.value.fontFamily"),width:!0},fontColor:{ref:"label.value.color",component:"color-picker",defaultValue:()=>({color:i.getStyle("object.gauge","label.value","color")}),width:!1}}}}}}}}}};function Xt(e){return"measure"===kt(e,"color.useBaseColors")}function Kt(e){const{flags:t,translator:i,sense:n}=e,r=n.theme;return{definition:{type:"items",component:"accordion",items:{data:{uses:"data"},addons:{type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{suppressZero:null,calcCond:{uses:"calcCond"}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},settings:{type:"items",uses:"settings",component:"expandable-items",translation:"Common.Appearance",items:{simpleLabels:{items:{labels:{items:{header:{show(e){var t;return null===(t=e.qHyperCubeDef.qMeasures)||void 0===t?void 0:t.length}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show(e){var t;return null===(t=e.qHyperCubeDef.qMeasures)||void 0===t?void 0:t.length},convertFunctions:{get:(e,t,i,n)=>"labels"===n.measureAxis.show||"none"===n.measureAxis.show,set(e,t,i,n,r){r.measureAxis.show=e?"labels":"all"}}}}}}},presentation:{type:"items",grouped:!0,translation:"properties.presentation",items:{styleEditor:Gt(t,i,r),rangeLimits:{type:"items",items:{text:{component:"text",translation:"properties.axis.rangeLimits",style:"sHeader"},min:{ref:"measureAxis.min",translation:"properties.axis.min",type:"number",expression:"optional",invalid:e=>e.measureAxis&&e.measureAxis.min>=e.measureAxis.max},max:{ref:"measureAxis.max",translation:"Common.Max",type:"number",expression:"optional",defaultValue:100,invalid:e=>e.measureAxis&&e.measureAxis.min>=e.measureAxis.max}}},type:{ref:"gaugetype",type:"string",component:"item-selection-list",defaultValue:"radial",horizontal:!0,items:[{icon:"gauge_gauge",component:"icon-item",labelPlacement:"bottom",translation:"properties.gauge.radial",value:"radial"},{icon:"gauge_vertical_bar",component:"icon-item",labelPlacement:"bottom",translation:"properties.gauge.bar",value:"bar"}]},autoOrientation:{ref:"autoOrientation",translation:"properties.orientation",type:"boolean",defaultValue:!0,component:"switch",undefinedValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],show:e=>"bar"===e.gaugetype},orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"horizontal",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],show:e=>"bar"===e.gaugetype&&!e.autoOrientation},angle:{ref:"angle",translation:"properties.gauge.angle",type:"number",component:"slider",min:.2,max:.98,step:.1,defaultValue:.7,show:()=>!1},segments:{type:"items",items:{useSegments:{ref:"useSegments",type:"boolean",component:"switch",defaultValue:!1,translation:"properties.gauge.useSegments",change(e){const t=(i=e.segmentInfo).paletteColors&&i.paletteColors.length?i.paletteColors:i.colors&&i.colors.length?i.colors:void 0;var i;t&&(e.useSegments&&1===t.length?e.segmentInfo.paletteColors=[e.paletteProgressColor||e.progressColor]:e.paletteProgressColor=t[0])},options:[{value:!1,translation:"properties.off"},{value:!0,translation:"properties.on"}]},useBaseColor:{ref:"color.useBaseColors",type:"string",defaultValue:"measure",translation:"properties.useLibraryMeasureColors",component:"switch",show:e=>(e.color||(e.color={}),e.color.useBaseColors||(e.color.useBaseColors="off"),!0),options:[{value:"off",translation:"properties.off"},{value:"measure",translation:"properties.on"}]},paletteProgressColor:{component:"color-picker",translation:"properties.color",ref:"paletteProgressColor",type:"object",dualOutput:!0,defaultValue:()=>{var e;if(!r)return-1;const{primary:t}=r.getDataColorSpecials(),i=null===(e=r.getDataColorPickerPalettes()[0])||void 0===e?void 0:e.colors,n=i.indexOf(t);return{index:-1===n?Math.min(6,i.length-1):n}},show:e=>!Xt(e)&&!e.useSegments},maxSegments:{ref:"maxSegments",type:"number",defaultValue:6,show:!1},segmentInfo:{ref:"segments",type:"items",component:"color-scale-creator",show:e=>!Xt(e)&&e.useSegments,items:{limits:{ref:"segmentInfo.limits",type:"array",items:{value:{ref:"value",type:"number",expression:"optional",invalid:(e,t)=>"number"==typeof e.value&&(e.value<t.measureAxis.min||e.value>t.measureAxis.max),defaultValue:1},gradient:{translation:"properties.gradient",ref:"gradient",type:"boolean",show:!1}}},paletteColors:{items:{color:{ref:"color",type:"string"},index:{ref:"index",type:"integer",defaultValue:6}},type:"array",ref:"segmentInfo.paletteColors"}}}}},disclaimerClosed:{ref:"disclaimerClosed",type:"boolean",defaultValue:!1,show:!1}}},measureAxis:{type:"items",translation:"properties.measureAxis",grouped:!0,items:{axis:{type:"items",snapshot:{title:"properties.measureAxis",tid:"property-yAxis"},items:{show:{ref:"measureAxis.show",translation:"properties.axis.labelsAndTitle",type:"string",component:"dropdown",options:[{value:"all",translation:"properties.axis.show.all"},{value:"labels",translation:"properties.axis.show.labels"},{value:"title",translation:"properties.axis.show.title"},{value:"none",translation:"Common.None"}],defaultValue:"all"},spacing:{ref:"measureAxis.spacing",translation:"properties.axis.scale",type:"number",component:"dropdown",defaultValue:1,show:e=>e.measureAxis&&"none"!==e.measureAxis.show&&"title"!==e.measureAxis.show,options:[{value:2,translation:"properties.gridLine.wide"},{value:1,translation:"properties.gridLine.medium"},{value:.5,translation:"properties.gridLine.narrow"}]}}}}}}}}},support:{cssScaling:!1,snapshot:!0,export:!0,sharing:!0,exportData:!0,viewData:!0}}}const Zt=52,Yt=-2*Math.PI/3,Qt=2*Math.PI/3,Jt="#EEEEEE",ei=2.38,ti={MIN:12,MAX:60},ii={MIN:100,MAX:1e3},ni={TOP:-4,BOTTOM:0,LEFT:4,RIGHT:4},ri={VERTICAL_ALIGNMENT_FACTOR:.4},ai={VERTICAL_ALIGNMENT_FACTOR:1.25},oi=1.2,si={DARK:"#595959",LIGHT:"#E6E6E6"},li=.4,ci=1,ui=2,hi=.75,fi=.75,pi={MAX_WIDTH:150,MAX_LINES:2,CLEARANCE:12,ESTIMATED_LINE_HEIGHT:16,GAP:8},di=70,mi=3,gi={MEASURE:"measure"},yi={BAR:"bar",LABEL_BAR:"label-bar",BACKGROUND_BAR:"background-bar",OOB_INDICATOR:"oob-indicator",BAR_AXIS:"bar-axis",AXIS_TITLE:"axis-title",GAUGE_LABEL:"gauge-label",RADIAL_GAUGE_NEEDLE:"radial-gauge-needle",RADIAL_OOB_INDICATOR:"radial-oob-indicator",RADIAL_GAUGE:"radial-gauge",REFERENCE_LINES_AND_LABELS:"reference-lines-and-labels",RADIAL_SPARK:"radial-spark",RADIAL_GAUGE_LABEL:"radial-gauge-label"},vi="XSMALL",bi="SMALL",xi="XSMALL_VERTICAL",Mi="XSMALL_HORIZONTAL",Si="SMALL",ki={FULL:{width:550,height:450},MEDIUM:{width:300,height:150},SMALL:{width:150,height:84},SMALLER:{width:150,height:75},XSMALL:{width:84,height:84},XSMALL_VERTICAL:{width:105,height:0},XSMALL_HORIZONTAL:{width:0,height:104},SPARK:{height:75,width:50}},wi=600,Ni=200,Ii=500;function Di(e,t,i){e.prototype=t.prototype=i,i.constructor=e}function Ai(e,t){var i=Object.create(e.prototype);for(var n in t)i[n]=t[n];return i}function Ci(){}var Li=.7,qi=1/Li,Pi="\\s*([+-]?\\d+)\\s*",Ti="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Oi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ri=/^#([0-9a-f]{3,8})$/,Ei=new RegExp(`^rgb\\(${Pi},${Pi},${Pi}\\)$`),zi=new RegExp(`^rgb\\(${Oi},${Oi},${Oi}\\)$`),Fi=new RegExp(`^rgba\\(${Pi},${Pi},${Pi},${Ti}\\)$`),Vi=new RegExp(`^rgba\\(${Oi},${Oi},${Oi},${Ti}\\)$`),ji=new RegExp(`^hsl\\(${Ti},${Oi},${Oi}\\)$`),$i=new RegExp(`^hsla\\(${Ti},${Oi},${Oi},${Ti}\\)$`),Hi={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 _i(){return this.rgb().formatHex()}function Bi(){return this.rgb().formatRgb()}function Wi(e){var t,i;return e=(e+"").trim().toLowerCase(),(t=Ri.exec(e))?(i=t[1].length,t=parseInt(t[1],16),6===i?Ui(t):3===i?new Zi(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===i?Gi(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===i?Gi(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=Ei.exec(e))?new Zi(t[1],t[2],t[3],1):(t=zi.exec(e))?new Zi(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Fi.exec(e))?Gi(t[1],t[2],t[3],t[4]):(t=Vi.exec(e))?Gi(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ji.exec(e))?nn(t[1],t[2]/100,t[3]/100,1):(t=$i.exec(e))?nn(t[1],t[2]/100,t[3]/100,t[4]):Hi.hasOwnProperty(e)?Ui(Hi[e]):"transparent"===e?new Zi(NaN,NaN,NaN,0):null}function Ui(e){return new Zi(e>>16&255,e>>8&255,255&e,1)}function Gi(e,t,i,n){return n<=0&&(e=t=i=NaN),new Zi(e,t,i,n)}function Xi(e){return e instanceof Ci||(e=Wi(e)),e?new Zi((e=e.rgb()).r,e.g,e.b,e.opacity):new Zi}function Ki(e,t,i,n){return 1===arguments.length?Xi(e):new Zi(e,t,i,null==n?1:n)}function Zi(e,t,i,n){this.r=+e,this.g=+t,this.b=+i,this.opacity=+n}function Yi(){return`#${tn(this.r)}${tn(this.g)}${tn(this.b)}`}function Qi(){const e=Ji(this.opacity);return`${1===e?"rgb(":"rgba("}${en(this.r)}, ${en(this.g)}, ${en(this.b)}${1===e?")":`, ${e})`}`}function Ji(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function en(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function tn(e){return((e=en(e))<16?"0":"")+e.toString(16)}function nn(e,t,i,n){return n<=0?e=t=i=NaN:i<=0||i>=1?e=t=NaN:t<=0&&(e=NaN),new an(e,t,i,n)}function rn(e){if(e instanceof an)return new an(e.h,e.s,e.l,e.opacity);if(e instanceof Ci||(e=Wi(e)),!e)return new an;if(e instanceof an)return e;var t=(e=e.rgb()).r/255,i=e.g/255,n=e.b/255,r=Math.min(t,i,n),a=Math.max(t,i,n),o=NaN,s=a-r,l=(a+r)/2;return s?(o=t===a?(i-n)/s+6*(i<n):i===a?(n-t)/s+2:(t-i)/s+4,s/=l<.5?a+r:2-a-r,o*=60):s=l>0&&l<1?0:o,new an(o,s,l,e.opacity)}function an(e,t,i,n){this.h=+e,this.s=+t,this.l=+i,this.opacity=+n}function on(e){return(e=(e||0)%360)<0?e+360:e}function sn(e){return Math.max(0,Math.min(1,e||0))}function ln(e,t,i){return 255*(e<60?t+(i-t)*e/60:e<180?i:e<240?t+(i-t)*(240-e)/60:t)}Di(Ci,Wi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:_i,formatHex:_i,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return rn(this).formatHsl()},formatRgb:Bi,toString:Bi}),Di(Zi,Ki,Ai(Ci,{brighter(e){return e=null==e?qi:Math.pow(qi,e),new Zi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Li:Math.pow(Li,e),new Zi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Zi(en(this.r),en(this.g),en(this.b),Ji(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:Yi,formatHex:Yi,formatHex8:function(){return`#${tn(this.r)}${tn(this.g)}${tn(this.b)}${tn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Qi,toString:Qi})),Di(an,(function(e,t,i,n){return 1===arguments.length?rn(e):new an(e,t,i,null==n?1:n)}),Ai(Ci,{brighter(e){return e=null==e?qi:Math.pow(qi,e),new an(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Li:Math.pow(Li,e),new an(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,i=this.l,n=i+(i<.5?i:1-i)*t,r=2*i-n;return new Zi(ln(e>=240?e-240:e+120,r,n),ln(e,r,n),ln(e<120?e+240:e-120,r,n),this.opacity)},clamp(){return new an(on(this.h),sn(this.s),sn(this.l),Ji(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=Ji(this.opacity);return`${1===e?"hsl(":"hsla("}${on(this.h)}, ${100*sn(this.s)}%, ${100*sn(this.l)}%${1===e?")":`, ${e})`}`}}));const cn=Math.PI/180,un=180/Math.PI,hn=.96422,fn=.82521,pn=4/29,dn=6/29,mn=3*dn*dn,gn=dn*dn*dn;function yn(e){if(e instanceof vn)return new vn(e.l,e.a,e.b,e.opacity);if(e instanceof wn)return Nn(e);e instanceof Zi||(e=Xi(e));var t,i,n=Sn(e.r),r=Sn(e.g),a=Sn(e.b),o=bn((.2225045*n+.7168786*r+.0606169*a)/1);return n===r&&r===a?t=i=o:(t=bn((.4360747*n+.3850649*r+.1430804*a)/hn),i=bn((.0139322*n+.0971045*r+.7141733*a)/fn)),new vn(116*o-16,500*(t-o),200*(o-i),e.opacity)}function vn(e,t,i,n){this.l=+e,this.a=+t,this.b=+i,this.opacity=+n}function bn(e){return e>gn?Math.pow(e,1/3):e/mn+pn}function xn(e){return e>dn?e*e*e:mn*(e-pn)}function Mn(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Sn(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function kn(e,t,i,n){return 1===arguments.length?function(e){if(e instanceof wn)return new wn(e.h,e.c,e.l,e.opacity);if(e instanceof vn||(e=yn(e)),0===e.a&&0===e.b)return new wn(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*un;return new wn(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new wn(e,t,i,null==n?1:n)}function wn(e,t,i,n){this.h=+e,this.c=+t,this.l=+i,this.opacity=+n}function Nn(e){if(isNaN(e.h))return new vn(e.l,0,0,e.opacity);var t=e.h*cn;return new vn(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function In(e){return function(e){return kn(e).l<70}(e)?si.LIGHT:si.DARK}function Dn(e,t=!0){let i="";for(let t=0;t<e.length;t++){const n=e[t];i+=0===t?`M${n.x} ${n.y}`:`L${n.x} ${n.y}`,i+=" "}return t&&(i+="Z"),i}function An(e){const{angle:t,origin:i}=e,n=e.points.map((e=>function(e,t,i={x:0,y:0}){const n=Math.cos(t),r=Math.sin(t),a=(s=i,{x:(o=e).x-s.x,y:o.y-s.y});var o,s;return function(e,t){return{x:e.x+t.x,y:e.y+t.y}}({x:n*a.x-r*a.y,y:r*a.x+n*a.y},i)}(e,t,i)));return{type:"path",fill:e.fill,d:Dn(n)}}Di(vn,(function(e,t,i,n){return 1===arguments.length?yn(e):new vn(e,t,i,null==n?1:n)}),Ai(Ci,{brighter(e){return new vn(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new vn(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,i=isNaN(this.b)?e:e-this.b/200;return new Zi(Mn(3.1338561*(t=hn*xn(t))-1.6168667*(e=1*xn(e))-.4906146*(i=fn*xn(i))),Mn(-.9787684*t+1.9161415*e+.033454*i),Mn(.0719453*t-.2289914*e+1.4052427*i),this.opacity)}})),Di(wn,kn,Ai(Ci,{brighter(e){return new wn(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new wn(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Nn(this).rgb()}}));const Cn={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:i}){if(!e||!t||!i)return[];const{size:n,component:r,selector:a,pointingTo:o}=t;if(!e.component(t.component))return[];const s=e.findShapes(a).filter((e=>e.key===r));if(null==s||!s.length)return[];const{clientWidth:l,clientHeight:c}=e.element;let u=l/2,h=c/2,f=-Math.PI/2;const p=n/3;switch(o){case"top":h=p;break;case"bottom":h=c-p,f=3*Math.PI/2-Math.PI;break;case"right":u=l-p,f=0;break;case"left":u=p,f=Math.PI}const d=[];for(let e=0;e<s.length;e+=1){const t=s[e],i=In(["top","right"].includes(o)?t.attrs.fill:Jt),r={x:u,y:h},a=n/6,l=An({points:[{x:r.x+2*a,y:r.y},{x:r.x,y:r.y+a},{x:r.x,y:r.y-a}],angle:f,fill:i,origin:r});d.push(l)}return d}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}};function Ln(e,t,i,n){const r=Math.floor(Math.min(e,t)),a=Math.abs(n-i),o=.02*Math.tan(-a/4+Math.PI/2),s=2*(.4+o)-Rn(e,t)/r;return{innerRadius:s-2*(r>500?50:Math.max(r/Ii*50,10))/r,outerRadius:s,radiusIncrease:o}}function qn(e,t,i,n){const r=n-Math.PI/2;return{x:e+i*Math.cos(r),y:t+i*Math.sin(r)}}function Pn(e,t){const i=e.getColor()({datum:{value:()=>0}});return t?"#595959":i}function Tn({innerRadius:e,outerRadius:t,width:i,height:n}){return(t-e)*Math.min(i,n)/2}function On(e){return!1!==e.show&&0!==e.show&&"0"!==e.show}function Rn(e,t){return Math.min(6,Math.min(e,t)/Ni)}const En={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:i}){if(!e||!t||!i)return[];const{valueAngle:n}=t;if(!e.component(t.component))return[];const{clientWidth:r,clientHeight:a}=e.element,{outerRadius:o,innerRadius:s}=Ln(r,a,Yt,Qt),l=Tn({innerRadius:s,outerRadius:o,width:r,height:a});let c=qn(r/2,a/2,o*Math.min(r,a)/2,t.valueAngle),u=c.x,h=c.y;const f=[],p=In(Jt),d={x:u,y:h},m=l/6,g=An({points:[{x:d.x,y:d.y},{x:d.x-8*m,y:d.y+m},{x:d.x-8*m,y:d.y-m}],angle:n-Math.PI/2,fill:p,origin:d});return f.push(g),f}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}};const zn={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:i}){if(!e||!t||!i)return[];const{size:n,component:r,selector:a,angle:o,radius:s}=t;if(!e.component(t.component))return[];const l=e.findShapes(a).filter((e=>e.key===r));if(null==l||!l.length)return[];const{clientWidth:c,clientHeight:u}=e.element;let h=c/2,f=u/2,{x:p,y:d}=qn(h,f,s,o);const m=[],g=t.fill,y=o===Yt?-1:1,v={x:p,y:d},b=n/6,x=An({points:[{x:v.x+(2*b+1)*y,y:v.y+.5},{x:v.x+1*y,y:v.y+b+.5},{x:v.x+1*y,y:v.y-b+.5}],angle:o,fill:g,origin:v});return m.push(x),m}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}};function Fn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vn=Object.prototype.hasOwnProperty,jn=Object.prototype.toString,$n=Object.defineProperty,Hn=Object.getOwnPropertyDescriptor,_n=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===jn.call(e)},Bn=function(e){if(!e||"[object Object]"!==jn.call(e))return!1;var t,i=Vn.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&Vn.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!n)return!1;for(t in e);return void 0===t||Vn.call(e,t)},Wn=function(e,t){$n&&"__proto__"===t.name?$n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Un=function(e,t){if("__proto__"===t){if(!Vn.call(e,t))return;if(Hn)return Hn(e,t).value}return e[t]},Gn=Fn((function e(){var t,i,n,r,a,o,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(i in t)n=Un(s,i),s!==(r=Un(t,i))&&(u&&r&&(Bn(r)||(a=_n(r)))?(a?(a=!1,o=n&&_n(n)?n:[]):o=n&&Bn(n)?n:{},Wn(s,{name:i,newValue:e(u,o,r)})):void 0!==r&&Wn(s,{name:i,newValue:r}));return s}));let Xn;function Kn(){Xn=Xn||document.createElement("canvas").getContext("2d")}const Zn={measureTextWidth(e){Kn();const{width:t}=Xn.measureText(e);return t},lineWrap(e,t,i,n){let r,a;Kn();const o=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,c,u,h,f=e?e.split(/\s+/):[],p=o[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof n&&o.length>=n)return o.slice(0,n);for(i&&(Xn.font=i),a=0;a<o.length;a++){for(h=o[a],f=h.split(/\s+/),[p]=f,u="",r=1;r<f.length;r++)if(l=`${p} ${f[r]}`,c=Zn.measureTextWidth(l),c>t&&("number"!=typeof n||n>s.length)?(s.push(p),p=f[r]):p=l,"number"==typeof n&&s.length>=n){u=f.slice(r+1).join(" ");break}"number"!=typeof n||s.length<n?s.push(p):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]} ${p} ${u}`}return s},wordWrap(e,t,i,n,r){if(Kn(),!e||!e.length)return[];i&&(Xn.font=i);let a=[];const o=e.slice();let s,l,c,u="";if(o.filter((e=>!!e)),"number"!=typeof t||t<0)return e.slice();for(c=0;c<o.length;c++){var h;if(l=o[c],u="",l.length<=1||Zn.measureTextWidth(l)<=t)a.push(l);else if(s=Zn.splitWord(l,t,void 0,void 0===n?void 0:n-a.length),s.length<=1)a.push(s[0]);else u=null!==(h=s.pop())&&void 0!==h?h:"",a=a.concat(s),o[c+1]?Zn.measureTextWidth(`${u} ${o[c+1]}`)>t&&(void 0===n||a.length+o.length-c<=n)?o.splice(c+1,0,u):o[c+1]=`${u} ${o[c+1]}`:o.push(u)}return a.forEach(((e,t,i)=>{i[t]=e.trim()})),void 0!==n&&a.length>n?(a=a.splice(0,n),a[a.length-1]=Zn.truncate(a[a.length-1],t,i,r).text):(l=a[a.length-1],l&&l.length>1&&Zn.measureTextWidth(l)>t&&(a[a.length-1]=Zn.truncate(l,t,i,r).text)),a},truncate(e,t,i,n="…"){Kn();let r,a,o,s,l=e;const c=Zn.measureTextWidth("i");if(i&&(Xn.font=i),e&&t){if(Zn.measureTextWidth(l)>t){const e=Math.ceil(t/c);for(r=Math.min(e,l.length);r>0;r--)if(a=l.substring(0,r-1),o=a.trim()+n,Zn.measureTextWidth(o)<=t){s=l.substring(r-1),l=o;break}r||(s=l,l="…")}}else s=void 0;return{text:l,rest:s}},isNumber:e=>"number"==typeof e&&Number.isFinite(e),explodeWord(e,t,i,n){let r;Kn();let a,o=e,s="",l=[];if(void 0!==i&&Zn.isNumber(i)&&i<=1)return[e];const c=Math.ceil(t/n);for(r=Math.min(e.length,c);r>0&&(o=e.substring(0,r),a=e.substring(r-1,r)," "===a?o=e.substring(0,r-1):o+="-",s=e.substring(r),!(Zn.measureTextWidth(o)<=t));r--);return(!r&&!o||Zn.measureTextWidth(o)>t)&&(o=e.substring(0,1),s=e.substring(1)),l.push(o),s?(Zn.measureTextWidth(s)>t?l=l.concat(Zn.explodeWord(s,t,void 0===i?void 0:i-1,n)):l.push(s),l.filter((e=>""!==e.trim()))):l},splitWord:(e,t,i,n)=>(Kn(),e&&t?(i&&(Xn.font=i),Zn.explodeWord(e,t,n,Math.max(1,Zn.measureTextWidth("i")))):[]),wrapText(e,t,i,n,r="…"){let a;return Number.isNaN(t)||!t?[e]:(a=void 0===n||n>1?Zn.lineWrap(e,t,i,n):[e],a=Zn.wordWrap(a,t,i,n,r),a)},getFontHeight:e=>(Kn(),e&&(Xn.font=e),1.5*Zn.measureTextWidth("m")),tokenize(e,t,i,n,r,a,o=1){Kn(),t&&(Xn.font=t);const s=Zn.getFontHeight(),l=o*s;let c=[],u=[];if(void 0!==a&&a<s)return[];const h=a?Math.max(1,Math.floor(a/l)):n||1;return c=[void 0===n||Number.isNaN(n)||n<=0?h:Math.min(h,n)],Array.isArray(e)?e.forEach(((e,i)=>{u.length<h&&(u=u.concat(Zn.wrapText(e,r,t,c[i])))})):u=Zn.wrapText(e,r,t,c[0],i),u}};function Yn({chart:e,renderer:t,refLine:i,settings:n,width:r,height:a,barWidth:o}){if(!e||!t||!n)return{};const{position:s,scale:l,value:c,label:u,line:h,formatter:f}=i,p=i.radius?i.radius*(Math.min(r,a)/2):r/2,d=(Qt-Yt)*s+Yt-Math.PI/2,m={x:r/2,y:a/2};let g=Gn(!0,{},n.style.line,h||{});const y={type:"line",...{x1:m.x+Math.cos(d)*p,y1:m.y+Math.sin(d)*p,x2:m.x+Math.cos(d)*(p+o),y2:m.y+Math.sin(d)*(p+o)},stroke:g.stroke,strokeWidth:g.strokeWidth,strokeDasharray:g.strokeDasharray};let v;if(u){const i=Gn(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},n.style.label||{},{fill:g.stroke},u),{fontFamily:s,fontSize:h,fill:y,opacity:b}=i,x=u.showLabel?i.text:"";let M,S="";if("string"==typeof f||"object"==typeof f)M=e.formatter(f);else if(void 0!==l&&"string"!=typeof l&&"function"==typeof l.data){const e=l.data()&&l.data().fields;M=e&&e[0]?e[0].formatter():null}!1!==u.showValue&&(M?S=` (${M("function"==typeof c?c():c)})`:l&&(S=` (${c})`));const k=e=>t.measureText({text:e,fontFamily:s,fontSize:h}),w=k("M").height,N=`normal ${h} ${s}`;let I,D=mi;const A=`${x}${S}`||"",C=Math.min(r,a),L=Math.min(8,C/200),q=qn(m.x,m.y,p+o+L,d+Math.PI/2),P=k(A).width;I=Math.min(q.x,r-q.x-ei,di),D=function(e,t,i){const n=Math.min(Math.floor((e+ei)/t),Math.floor((i-e)/t));return Math.min(n,mi)}(q.y,w,a);let T=Zn.tokenize(A,N,`... ${S}`,D,I,void 0);const O=function(e){let t="start";const i=e>-Math.PI&&e<0?"baseline":"hanging";return(e+=Math.PI/2)<0&&e>-Math.PI?t="end":e>0&&e<Math.PI&&(t="start"),{textAnchor:t,baseline:i}}(d);q.y-2*w>0&&q.y+2*w<a&&(q.x-P+ei<0&&"end"===O.textAnchor||q.x+P-ei>r)&&(T=Zn.tokenize(A,N,`... ${S}`,D,I,void 0)),v={fill:y,opacity:b,fontFamily:s,fontSize:h,linePosition:q,lineHeight:w,align:"left",baseline:O.baseline,textAnchor:O.textAnchor,lines:T}}return{lineNode:y,labelNode:v}}const Qn={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){var e,t;let{settings:i,chart:n,renderer:r,rect:a}=this;if(!(n&&a&&i&&r))return[];const{width:o,height:s}=a,l=null!==(e=null==i||null===(t=i.settings)||void 0===t?void 0:t.barWidth)&&void 0!==e?e:0;let c=(null==i?void 0:i.lines)&&i.lines.radial||[];if(0===c.length)return[];c=c.map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=null==n?void 0:n.scale("string"==typeof e.scale?e.scale:"");const i=t(e.value);return Gn(e,{scale:t,position:i})}return Gn(e,{position:e.value})}));const u=[];let h=[];[...c].forEach((e=>{if(e.position>0&&e.position<1){const{lineNode:t,labelNode:a}=Yn({chart:n,renderer:r,refLine:e,settings:i,width:o,height:s,barWidth:l});t&&u.push(t),a&&h.push(a)}}));const f=[];h.forEach((e=>{const{fill:t,opacity:i,fontFamily:n,fontSize:r,lines:a,lineHeight:o,textAnchor:s,linePosition:l,baseline:c}=e,u=l,h=a.length-1,p=a.map(((e,a)=>{let l=u.y;return h>0&&("baseline"===c?l-=(h-a)*o:l+=a*o),{type:"text",text:e,baseline:c,anchor:s,fill:t,opacity:i,fontFamily:n,fontSize:r,x:u.x,y:l}}));f.push(...p)}));const{MEDIUM:p,SMALLER:d}=ki,m=o>=p.width&&s>=p.height;return[...o>=d.width&&s>=d.height?u:[],...m?f:[]]}};const Jn={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:i}){if(!e||!t||!i)return[];const{valueAngle:n}=t,{clientWidth:r,clientHeight:a}=e.element,o=.4*Math.min(r,a),s=[],l=t.fill,c={x:r/2,y:a/2},u=An({points:[{x:c.x-o/2,y:c.y+o/2},{x:c.x,y:c.y-o},{x:c.x+o/2,y:c.y+o/2}],angle:n,fill:l,origin:c});return s.push(u),s}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}},er={getGap(e,t){const i=e.position<t.position?e:t,n=e.position<t.position?t:e;return n.position-n.radius-(i.position+i.radius)},findSegmentPositionMeetMaxThenMin(e,t,i){const n=e.position+e.radius,r=e.position-Math.max(0,n-i),a=r-e.radius;return r+Math.max(0,t-a)},layoutPositionFromMin(e,t,i,n=0){const r=e.length-1;let a,o,s,l=t;for(let t=0;t<r;t++)a=e[t],o=e[t+1],s=(a.position+o.position)/2-n/2,a.position=er.findSegmentPositionMeetMaxThenMin(a,l,s),l=a.position+a.radius+n;o&&(o.position=er.findSegmentPositionMeetMaxThenMin(o,l,i))},adjustPositionFromMax(e,t,i,n=0){const r=e.length-1,a=Math.max(0,e[r].position+e[r].radius-i);if(0===a)return;let o,s,l,c,u=0;for(o=r;o>0&&(s=e[o],l=e[o-1],c=Math.max(0,er.getGap(l,s)-n),c-=Math.max(0,u+c-a),u+=c,s.move=c,!(u>=a));o--);for(u<a&&l&&(c=Math.max(0,l.position-l.radius-t),c-=Math.max(0,u+c-a),u+=c,l.move=c),u=0,o=0;o<=r;o++)s=e[o],u+=s.move||0,s.move=u,s.position-=u},createLayout(e,t,i,n=0){const r=e.map((e=>e.segment)),a=r.length-1;if(a<0)return[];if(0===a){const e=r[0];e.position=er.findSegmentPositionMeetMaxThenMin(e,t,i)}else er.layoutPositionFromMin(r,t,i,n),er.adjustPositionFromMax(r,t,i,n);return e.filter((e=>{const n=Math.ceil(e.segment.position-e.segment.radius),r=e.segment.position+e.segment.radius;return n>=t&&r<=i}))}};const tr={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){var e,t;let{settings:i,chart:n,renderer:r,rect:a}=this;if(!(n&&a&&i&&r))return[];const{width:o,height:s}=a,l=null!==(e=null==i||null===(t=i.settings)||void 0===t?void 0:t.barWidth)&&void 0!==e?e:0,c=(null==i?void 0:i.lines)&&i.lines.x||[],u=(null==i?void 0:i.lines)&&i.lines.y||[];let h=c.length>0?c:u;if(0===h.length)return[];const f=c.length>0;h=h.map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=null==n?void 0:n.scale("string"==typeof e.scale?e.scale:"");const i=t(e.value);return Gn(e,{scale:t,position:i})}return Gn(e,{position:e.value})}));const p=[];let d=[];if([...h].forEach((e=>{if(On(e)&&e.position>0&&e.position<1){const{lineNode:t,labelNode:a}=function({chart:e,renderer:t,refLine:i,settings:n,width:r,height:a,isVerticalRefLine:o,barWidth:s}){if(!e||!t||!n)return{};const{position:l,scale:c,value:u,label:h,line:f,formatter:p}=i;let d=Gn(!0,{},n.style.line,f||{});const m={type:"line",...o?{x1:l*r,x2:l*r,y1:a/2-s/2,y2:a/2+s/2}:{x1:r/2-s/2,x2:r/2+s/2,y1:l*a,y2:l*a},stroke:d.stroke,strokeWidth:d.strokeWidth,strokeDasharray:d.strokeDasharray};let g;if(h){const i=Gn(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},n.style.label||{},{fill:d.stroke},h),{fontFamily:f,fontSize:m,fill:y,opacity:v}=i,b=h.showLabel?i.text:"";let x,M="";if("string"==typeof p||"object"==typeof p)x=e.formatter(p);else if(void 0!==c&&"string"!=typeof c&&"function"==typeof c.data){const e=c.data()&&c.data().fields;x=e&&e[0]?e[0].formatter():null}!1!==h.showValue&&(x?M=` (${x("function"==typeof u?u():u)})`:c&&(M=` (${u})`));const S=e=>t.measureText({text:e,fontFamily:f,fontSize:m}),k=S("M").height,w=`normal ${m} ${f}`,N=o?pi.MAX_WIDTH:r/2-s/2-pi.CLEARANCE,I=o?2:1,D=`${b}${M}`||"",A=Zn.tokenize(D,w,`... ${M}`,I,N,void 0),C=(o?r:a)*l,L=Math.min(N,Math.max(...A.map((e=>S(e).width)))),q=A.length*k;g={fill:y,opacity:v,fontFamily:f,fontSize:m,linePosition:C,lineHeight:k,lines:A,segment:{position:C,radius:o?L/2:q/2}}}return{lineNode:m,labelNode:g}}({chart:n,renderer:r,refLine:e,settings:i,width:o,height:s,isVerticalRefLine:f,barWidth:l});t&&p.push(t),a&&d.push(a)}})),f)d=er.createLayout(d,0,o,pi.GAP);else{const{attrs:e}=n.findShapes("text").filter((e=>e.key===yi.GAUGE_LABEL))[0],{"font-size":t}=e,i=parseFloat(t);let r=d.filter((t=>t.segment.position<e.y)),a=d.filter((t=>t.segment.position>e.y));r.sort(((e,t)=>e.segment.position-t.segment.position)),a.sort(((e,t)=>e.segment.position-t.segment.position)),r=er.createLayout(r,0,e.y-i/2),a=er.createLayout(a,e.y+i/2,s),d=[...r,...a]}const m=[],g=[];d.forEach((e=>{const{fill:t,opacity:i,fontFamily:n,fontSize:r,lines:a,segment:c,linePosition:u,lineHeight:h}=e,{position:p}=c;if(u!==p&&""!==e.lines[0]){let e={x1:o/2+l/2,x2:o/2+l/2+.75*pi.CLEARANCE,y1:u,y2:p};f&&(e={y1:s/2+l/2,y2:s/2+l/2+pi.CLEARANCE,x1:u,x2:p});const i={type:"line",...e,stroke:t,strokeWidth:1};g.push(i)}const d=a.map(((e,a)=>{let c=f?s/2+l/2+h/2+pi.CLEARANCE:p;return c+=a*h,{type:"text",text:e,baseline:"central",anchor:f?"middle":"start",fill:t,opacity:i,fontFamily:n,fontSize:r,x:f?p:o/2+l/2+pi.CLEARANCE,y:c}}));m.push(...d)}));const{MEDIUM:y,SMALLER:v}=ki,b=o>=y.width&&s>=y.height;return[...o>=v.width&&s>=v.height?p:[],...b?m:[],...b?g:[]]}};function ir({layout:e,options:t}){return e.snapshotData&&!t.freeResize?{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h}:void 0}function nr(e,t,i){if(e>=i)return 1;if(e<=t)return 0;const n=Math.min(1,Math.max(0,(e-t)/(i-t)));return Number.isNaN(n)?0:n}function rr({chart:e,layoutService:t,dockService:i}){const{width:n,height:r}=i.meta.chart.size,{isVertical:a}=t.meta,o=Math.min(Zt,a?n/10:r/10),s=a?r:n;function l(){const{min:e,max:i}=t.meta.rangeLimits,n=t.meta.qHyperCube.qDataPages[0].qMatrix[0][0].qNum;return s*nr(n,e,i)}const c={getBottomPadding(e){if(a){const t=l()+-e.height*ri.VERTICAL_ALIGNMENT_FACTOR,i=ni.BOTTOM,n=s-e.height-ni.TOP;return t<i?i:t>n?n:t}const{MAX_LINES:i,ESTIMATED_LINE_HEIGHT:c,CLEARANCE:u}=pi,h=function(){const{MEDIUM:e}=ki,i=n>=e.width&&r>=e.height,{refLines:a}=t.meta;return a&&a.filter(On).length>0&&i}()?i*c+u:0;return-o*ai.VERTICAL_ALIGNMENT_FACTOR-h},getTopPadding:e=>-c.getBottomPadding(e),getLeftPadding(e){if(a)return n/5+o;const t=l()-e.width/2,i=ni.RIGHT,r=s-e.width-ni.LEFT;return t<i?i:t>r?r:t},getRightPadding:e=>-c.getLeftPadding(e)},u={getLeftPadding(t){if(!a)return 0;const i=e.findShapes("container").filter((e=>e.key===yi.BAR_AXIS));if(1!==i.length)return 0;const r=i[0],s=Math.max(...r.children.filter((e=>"text"===e.type)).map((e=>e.bounds.width))),l=Math.max(...r.children.filter((e=>"line"===e.type)).map((e=>e.bounds.width)));let c=o/2+s+l+o*fi;return c>n/2-t.height/4&&(c=n/2-t.height/4),-c},getRightPadding:e=>-u.getLeftPadding(e),getTopPadding(){if(a)return-4;const t=e.findShapes("container").filter((e=>e.key===yi.BAR_AXIS));if(1!==t.length)return 0;const i=t[0],n=Math.max(...i.children.filter((e=>"text"===e.type)).map((e=>e.bounds.height))),r=Math.max(...i.children.filter((e=>"line"===e.type)).map((e=>e.bounds.height)));return-(o/2+n+r+o*hi)},getBottomPadding:()=>-u.getTopPadding()};return{getBarWidthInPixels:()=>o,getValueLabelFontSize:function(e,t){const i=nr(Math.min(r,n),ii.MIN,ii.MAX);return e+Math.round(i*(t-e))},barValueLabel:c,barAxisTitle:u}}const ar=({core:e})=>{const h=r(),f=a(),p=o(),d=s(),m=l(),g=t(),y=c(),{qLocaleInfo:b}=u(),[x,M]=i(null);return n((()=>{if(!h||!e)return;const{picassoInstance:t,chart:i}=e;if(!i)return;const n=function(e){var t=e.source,i=e.metaAdditionsFn,n=e.experimental,r=void 0===n?{filter:!1}:n,a=E(!0,{},t),o=r.filter?function(e){var t=e.qHyperCube,i=At(t,Dt.DIMENSION),n=i.reduced,r=i.filtered;t[Dt.DIMENSION]=n;var a=At(t,Dt.MEASURE),o=a.reduced,s=a.filtered;return t[Dt.MEASURE]=o,{dimensions:r,measures:s}}(a):{dimensions:[],measures:[]},s=Lt(a),l=function(){var e=function(e){var t=e.layout,i=e.additionsFn,n=void 0===i?function(){return{}}:i,r=e.additionsProps,a=void 0===r?{}:r,o=t.qHyperCube,s=o.qDimensionInfo,l=o.qMeasureInfo,c=o.qMode,u=s.length,h=l.length,f=v({mode:{S:"S"===c,P:"P"===c,K:"K"===c,T:"T"===c},dimensionCount:u,measureCount:h,hasMultipleDimensions:u>1,hasMultipleMeasures:h>1,isOneDimensional:1===u,isTwoDimensional:2===u},a);return v(v({},f),n({layout:t,meta:f}))}({layout:a,additionsFn:i,additionsProps:{size:s.size}});return e.filteredFields=o,e},c={refs:v({},s.refs),meta:l(),getLayout:function(){return a},getLayoutValue:function(e,t){return kt(a,e,t)},setLayoutValue:function(e,t){Nt(a,e,t),s=Lt(a),c.meta=l()},getHyperCube:function(){return a.qHyperCube},getHyperCubeValue:function(e,t){return kt(a.qHyperCube,e,t)},setHyperCubeValue:function(e,t){Nt(a.qHyperCube,e,t),s=Lt(a),c.meta=l()},getDataPages:function(){return kt(a,s.refs.dataPages)},setDataPages:function(e){Nt(a,s.refs.dataPages,e),c.meta=l()}};return c}({source:h,metaAdditionsFn:function({layout:e}){var t;const{measureAxis:i,qHyperCube:n,autoOrientation:r,gaugetype:a,useSegments:o,segmentInfo:s,refLine:l}=e,c=null===(t=e.qHyperCube)||void 0===t?void 0:t.qMeasureInfo[0].qFallbackTitle,{width:u,height:h}=m;let f=e.orientation;r&&(f=u>=h?"horizontal":"vertical");const p="vertical"===f,d=function({measureAxis:e,qHyperCube:t}){if(!e||!t)return{min:0,max:1};let{min:i,max:n}=e;if(i=Number(i),n=Number(n),i!==n)return{min:Math.min(i,n),max:Math.max(i,n)};const r=t.qDataPages[0].qMatrix[0][0].qNum;let a=Math.abs(r-i)/2;return 0===a&&(a=0!==i?Math.abs(i)/2:Number.MAX_VALUE/2),{min:i-a,max:n+a}}({measureAxis:i,qHyperCube:n}),g=(null==l?void 0:l.refLines)||[];return{measureAxisTitle:c,measureAxisSpacing:null==i?void 0:i.spacing,rangeLimits:d,qHyperCube:n,orientation:f,autoOrientation:r,gaugetype:a,isVertical:p,useSegments:o,segmentInfo:s,refLines:g}}}),r=ir({layout:n.getLayout(),options:g}),a=St({chart:i,layoutService:n,config:{logicalSize:r},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0}}),o=ut({app:p,model:d,translator:y,picasso:t,layoutService:n,config:{key:"color",localeInfo:b,theme:f,auto:()=>({mode:"primary",byMeasureDef:{activeMeasureIndex:0,type:"expression",label:""}})}}),s=function(e){var t=e.theme,i=e.config,n=void 0===i?{}:i,r=n.id,a=n.resolve,o=void 0===a?[]:a,s=n.transform,l=void 0===s?[]:s,c=n.extend,u=void 0===c?[]:c,h={theme:t,matrix:Bt(o),styles:void 0};return h.styles=Ut({theme:t,id:r,transform:l,extend:u,matrix:h.matrix}),{getStyles:function(){return h.styles},getTheme:function(){return h.theme},setTheme:function(e){h.theme=e,h.styles=Ut({theme:e,id:r,transform:l,extend:u,matrix:h.matrix})}}}({theme:f,config:{id:"gauge"}}),l=rr({chart:i,layoutService:n,dockService:a}),c=function({layoutService:e,themeService:t,colorService:i}){const n=t.getStyles(),r=t=>{var i;return null===(i=e.getLayoutValue("components",[]))||void 0===i?void 0:i.find((e=>e.key===t))},a=e=>e?i.getPaletteColor(e):void 0;return{query:{axis:{title:{getStyle:()=>{var e,t,i,o;return{fontFamily:null!==(e=null===(t=r("axis"))||void 0===t||null===(t=t.axis)||void 0===t||null===(t=t.title)||void 0===t?void 0:t.fontFamily)&&void 0!==e?e:n.axis.title.fontFamily,fontSize:n.axis.title.fontSize,color:null!==(i=a(null===(o=r("axis"))||void 0===o||null===(o=o.axis)||void 0===o||null===(o=o.title)||void 0===o?void 0:o.color))&&void 0!==i?i:n.axis.title.color}}},label:{getStyle:()=>{var e,t,i,o;return{fontFamily:null!==(e=null===(t=r("axis"))||void 0===t||null===(t=t.axis)||void 0===t||null===(t=t.label)||void 0===t||null===(t=t.name)||void 0===t?void 0:t.fontFamily)&&void 0!==e?e:n.axis.label.name.fontFamily,fontSize:n.axis.label.name.fontSize,fill:null!==(i=a(null===(o=r("axis"))||void 0===o||null===(o=o.axis)||void 0===o||null===(o=o.label)||void 0===o||null===(o=o.name)||void 0===o?void 0:o.color))&&void 0!==i?i:n.axis.label.name.color}}}},label:{getStyle:()=>{var e,t,i,o;return{fontFamily:null!==(e=null===(t=r("value"))||void 0===t||null===(t=t.label)||void 0===t||null===(t=t.value)||void 0===t?void 0:t.fontFamily)&&void 0!==e?e:n.label.value.fontFamily,fill:null!==(i=a(null===(o=r("value"))||void 0===o||null===(o=o.label)||void 0===o||null===(o=o.value)||void 0===o?void 0:o.color))&&void 0!==i?i:n.label.value.color}}}}}}({layoutService:n,themeService:s,colorService:o});M({layoutService:n,colorService:o,dockService:a,labelService:l,themeService:s,styleService:c})}),[d,p,h,f.name(),y.language(),e,m]),x};function or({width:e,height:t,fontSize:i}){const{FULL:n}=ki;if(e>=n.width&&t>=n.height){let e=Number.parseFloat(i);return e=Math.floor(e*oi),`${e}px`}return i}function sr({width:e,height:t,isVertical:i,styleService:n,themeService:r}){const a=r.getStyles(),o=n.query.axis.label.getStyle(),{fontFamily:s,fill:l,fontSize:c}=o;return[{type:"axis",key:yi.BAR_AXIS,dock:"center",scale:"m",layout:{minimumLayoutMode:vi},settings:{align:i?"left":"top",line:{show:!i},labels:{minLengthPx:20,fontFamily:s,fill:l,fontSize:or({width:e,height:t,fontSize:c})},paddingStart:()=>{if(i){const t=Math.min(e/10,Zt);return e/2+t/2}const n=Math.min(t/10,Zt);return t/2+n/2+ui},ticks:{stroke:a.axis.line.major.color}}}]}function lr({width:e,height:t,measureAxisTitle:i,isVertical:n,labelService:r,styleService:a}){const{getTopPadding:o,getBottomPadding:s,getLeftPadding:l,getRightPadding:c}=r.barAxisTitle,u=a.query.axis.title.getStyle(),{fontFamily:h,fontSize:f,color:p}=u;return[{type:"labels",key:yi.AXIS_TITLE,layout:{minimumLayoutMode:bi},settings:{sources:[{component:yi.BACKGROUND_BAR,selector:"rect",strategy:{type:"bar",settings:{direction:n?"up":"right",align:.5,justify:.5,labels:[{fontFamily:h,fill:p,fontSize:Number.parseFloat(or({width:e,height:t,fontSize:f})),label:()=>i,placements:[{position:"inside",padding:{top:o,bottom:s,left:l,right:c},overflow:!0}]}]}}}]}}]}var cr=e=>()=>e;function ur(e){return 1==(e=+e)?hr:function(t,i){return i-t?function(e,t,i){return e=Math.pow(e,i),t=Math.pow(t,i)-e,i=1/i,function(n){return Math.pow(e+n*t,i)}}(t,i,e):cr(isNaN(t)?i:t)}}function hr(e,t){var i=t-e;return i?function(e,t){return function(i){return e+i*t}}(e,i):cr(isNaN(e)?t:e)}var fr=function e(t){var i=ur(t);function n(e,t){var n=i((e=Ki(e)).r,(t=Ki(t)).r),r=i(e.g,t.g),a=i(e.b,t.b),o=hr(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=r(t),e.b=a(t),e.opacity=o(t),e+""}}return n.gamma=e,n}(1);function pr({thisColor:e,paletteColors:t,paletteIndex:i,limit:n,isLeft:r=!1,themeService:a}){const o=r?0:1,s=0===Object.entries(n).length,l=n.gradient;let c=i+(r?-1:1);s&&(c=r?0:t.length-1);const u=a.getTheme().getColorPickerColor(c<t.length&&c>=0?t[c]:t[0]);return{color:l?fr(e,u)(.5):e,offset:o,gradient:l}}function dr({limits:e,paletteColors:t,paletteIndex:i,themeService:n}){const r=kt(e,""+(i-1),{}),a=kt(e,`${i}`,{}),o=[r,a].map((e=>e.gradient)).includes(!0),s=n.getTheme().getColorPickerColor(t[i]);if(!o)return[{offset:0,color:s},{offset:1,color:s}];const l=[pr({thisColor:s,paletteColors:t,paletteIndex:i,limit:r,isLeft:!0,themeService:n}),pr({thisColor:s,paletteColors:t,paletteIndex:i,limit:a,isLeft:!1,themeService:n})];2===l.filter((e=>e.gradient)).length&&l.splice(1,0,{offset:.5,color:s,gradient:!0});const c=l.map((({offset:e,color:t,gradient:i})=>({offset:e,color:t,gradient:i})));return c}function mr({themeService:e,segmentInfo:t,rangeLimits:i}){const{limits:n,paletteColors:r}=t,{min:a,max:o}=i;n.sort(((e,t)=>e.value-t.value));const s=[a,...n.map((e=>e.value)),o],l=[];for(let t=0;t<r.length;t++){const i=dr({limits:n,paletteColors:r,paletteIndex:t,themeService:e}).map((e=>({offset:nr(s[t]+e.offset*(s[t+1]-s[t]),a,o),color:e.color,gradient:"gradient"in e?e.gradient:void 0})));l.push(...i)}return l}function gr(e,t,i){const n=mr({themeService:t,segmentInfo:i,rangeLimits:e}),r=(Qt-Yt)/(2*Math.PI),a=n.map((e=>({offset:e.offset*r,color:e.color})));return{type:"gradient",orientation:"conic",startAngle:Yt-Math.PI/2,x:0,y:0,stops:a}}function yr({orientation:e,colorService:t,rangeLimits:i,isVertical:n,useSegments:r,themeService:a,segmentInfo:o}){let{min:s,max:l}=i;const c={type:"box",key:yi.BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:s,end:{field:"qMeasureInfo/0"}}}},settings:{minor:{scale:"m"},orientation:e,box:{width:.1,maxWidthPx:Zt,fill:t.getColor()}}},u={type:"box",key:yi.BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:s,end:l}}},settings:{minor:{scale:"m"},orientation:e,box:{width:.1,maxWidthPx:Zt,fill:()=>function({themeService:e,isVertical:t,segmentInfo:i,rangeLimits:n}){return{type:"gradient",x1:0,x2:t?0:1,y1:t?1:0,y2:0,stops:mr({themeService:e,segmentInfo:i,rangeLimits:n})}}({themeService:a,isVertical:n,segmentInfo:o,rangeLimits:i})}}},h={type:"box",key:yi.BACKGROUND_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:s,end:l}}},settings:{minor:{scale:"m"},orientation:e,box:{width:.1,maxWidthPx:Zt,fill:Jt}}};return[{type:"box",key:yi.LABEL_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:s,end:s}}},settings:{minor:{scale:"m"},orientation:e,box:{width:n?li:ci,opacity:0}}},h,r?u:c]}function vr({isVertical:e,chart:t,labelService:i,styleService:n}){if(!t.formatter)return[];const{getValueLabelFontSize:r,barValueLabel:a}=i,{getTopPadding:o,getBottomPadding:s,getLeftPadding:l,getRightPadding:c}=a,u=r(ti.MIN,ti.MAX),h=n.query.label.getStyle();return[{type:"labels",key:yi.GAUGE_LABEL,layout:{minimumLayoutMode:e?xi:Mi},settings:{sources:[{component:yi.LABEL_BAR,selector:"rect",formatter:"measure",strategy:{type:"bar",settings:{direction:e?"up":"right",orientation:"horizontal",fontFamily:h.fontFamily,fill:h.fill,fontSize:u,align:e?0:.5,justify:0,labels:[{label:({data:e})=>e?t.formatter(gi.MEASURE)(e.value):"",placements:[{position:"outside",padding:{top:o,bottom:s,left:l,right:c},overflow:!0}]}]}}}]}}]}function br({labelService:e,rangeLimits:t,qHyperCube:i,isVertical:n}){const{min:r,max:a}=t,o=i.qDataPages[0].qMatrix[0][0].qNum;if(o<=a&&o>=r)return!1;let s=n?"bottom":"left";return o>a&&(s=n?"top":"right"),{type:"oob-indicator",key:yi.OOB_INDICATOR,layout:{displayOrder:2},settings:{component:"bar",selector:"rect",pointingTo:s,size:e.getBarWidthInPixels()}}}function xr({width:e,height:t,styleService:i,themeService:n}){const r=Ln(e,t,Yt,Qt),{innerRadius:a,outerRadius:o,radiusIncrease:s}=r,l=4*s,c=Math.min(e,t)/2,u=n.getStyles(),h=i.query.axis.label.getStyle(),{tickLength:f,labelPadding:p}=function({width:e,height:t,defaultTickSize:i,defaultLabelPadding:n}){const r=Math.min(Math.min(e,t)/wi,1);return{tickLength:i*r,labelPadding:n*r}}({width:e,height:t,defaultTickSize:8,defaultLabelPadding:20}),d=Rn(e,t);return[{type:"axis",dock:"center",layout:{minimumLayoutMode:Si},scale:"m",settings:{arc:{radius:o,startAngle:Yt,endAngle:Qt,offset:-10*l*(o-a)*c},align:"top",line:{show:!1,stroke:"#cdcdcd"},ticks:{tickSize:f,stroke:u.axis.line.major.color,margin:d},labels:{margin:-6-2*f+p,fontFamily:h.fontFamily,fill:h.fill,fontSize:h.fontSize}}}]}function Mr({qHyperCube:e,rangeLimits:t,width:i,height:n,colorService:r,themeService:a,segmentInfo:o,useSegments:s}){const{outerRadius:l,innerRadius:c}=Ln(i,n,Yt,Qt),u=t.max,h=e.qDataPages[0].qMatrix[0][0].qNum,f=u-h,p=[{value:h-t.min,valueLabel:"Measure"},{value:f,valueLabel:"Remaining"}],d=function({themeService:e,segmentInfo:t,rangeLimits:i}){const n=mr({themeService:e,segmentInfo:t,rangeLimits:i});let r=0,a=0,o=n.map((e=>(a=0===i.max?e.offset*(i.max-i.min)-r:e.offset*i.max-r,r+=a,{value:a,color:e.color,gradient:e.gradient}))).filter((e=>0!==e.value));return o.forEach((e=>{e.value=Math.abs(e.value)})),o}({themeService:a,segmentInfo:o,rangeLimits:t}),m={type:"pie",key:yi.RADIAL_GAUGE,data:{items:p},settings:{startAngle:Yt,endAngle:Qt,slice:{arc:{ref:"value"},outerRadius:()=>l,innerRadius:()=>c,fill:(e,t)=>{const i=r.getColor();return 0===t?i(e):Jt},strokeWidth:0}}},g={type:"pie",key:yi.RADIAL_GAUGE,renderer:"canvas",displayOrder:1,data:{items:d},settings:{startAngle:Yt,endAngle:Qt,slice:{arc:{ref:"value"},outerRadius:()=>l,innerRadius:()=>c,strokeWidth:0,fill:(e,i)=>{var n;return e.datum.value.gradient||null!==(n=d[i-1])&&void 0!==n&&n.gradient?gr(t,a,o):e.datum.value.color}}}},y={type:"pie",key:"circle-gauge",renderer:"canvas",displayOrder:0,data:{items:[{value:h,valueLabel:"Measure"}]},settings:{startAngle:0,endAngle:2*Math.PI,slice:{arc:{ref:"value"},outerRadius:()=>l,innerRadius:()=>c,fill:()=>function(e,t,i){let n=gr(e,t,i);const r={offset:(Qt-Yt)/(2*Math.PI),color:"rgba(0, 0, 0, 0)"};return n.stops.push(r),n.stops.push({offset:1,color:"rgba(0, 0, 0, 0)"}),n}(t,a,o),opacity:s?1:0}}};return[y,s?g:m]}function Sr({qHyperCube:e,chart:t,styleService:i,labelService:n}){const r=e.qMeasureInfo[0].qFallbackTitle,a=i.query.label.getStyle(),o=i.query.axis.title.getStyle(),{getValueLabelFontSize:s}=n,l=s(ti.MIN,ti.MAX);return[{type:"labels",key:yi.RADIAL_GAUGE_LABEL,layout:{displayOrder:4},settings:{sources:[{component:"circle-gauge",selector:"path",strategy:{type:"rows",settings:{fill:"#000",padding:0,labels:[{fontSize:l,fontFamily:a.fontFamily,fill:a.fill,label({data:e}){const i=t.formatter(gi.MEASURE);return e&&i?i(e.value.value):""}},{fontSize:Number.parseFloat(o.fontSize),fontFamily:o.fontFamily,fill:o.color,label:()=>r}]}}}]}}]}function kr({width:e,height:t,rangeLimits:i,qHyperCube:n}){const{min:r,max:a}=i,o=n.qDataPages[0].qMatrix[0][0].qNum;if(o>a||o<r)return!1;const s=Ln(e,t,Yt,Qt).outerRadius,l=Yt+(o-r)/(a-r)*(Qt-Yt);return{type:"radial-gauge-needle",key:yi.RADIAL_GAUGE_NEEDLE,layout:{displayOrder:2},settings:{component:"radial-gauge",selector:"path",radius:s,valueAngle:l}}}function wr({rangeLimits:e,qHyperCube:t,width:i,height:n,colorService:r,useSegments:a}){const{min:o,max:s}=e,l=t.qDataPages[0].qMatrix[0][0].qNum,{outerRadius:c,innerRadius:u}=Ln(i,n,Yt,Qt),h=(u+(c-u)/2)*Math.min(i,n)/2;if(l<=s&&l>=o)return!1;let f=Yt;return l>s&&(f=Qt),{type:"radial-oob-indicator",key:yi.RADIAL_OOB_INDICATOR,layout:{displayOrder:2},settings:{component:"radial-gauge",selector:"path",angle:f,radius:h,size:Tn({innerRadius:u,outerRadius:c,width:i,height:n}),fill:Pn(r,a)}}}function Nr({refLines:e,colorService:t,themeService:i,width:n,height:r}){const a=i.getStyles(),o=Ln(n,r,Yt,Qt);return{type:"radial-custom-ref-line",key:"radial-reference-lines",displayOrder:1,settings:{barWidth:Tn({innerRadius:o.innerRadius,outerRadius:o.outerRadius,width:n,height:r})},lines:{radial:e.filter(On).map((e=>{var i,n;return{scale:"m",value:e.refLineExpr.value,label:{text:e.label,...a.referenceLine.label.name,showValue:e.showValue,showLabel:e.showLabel},radius:o.innerRadius,line:{stroke:t.getPaletteColor(e.paletteColor||{index:e.color}),strokeWidth:(null===(i=e.style)||void 0===i?void 0:i.lineThickness)||2,strokeDasharray:null===(n=e.style)||void 0===n?void 0:n.lineType}}}))}}}function Ir({width:e,height:t,rangeLimits:i,qHyperCube:n,colorService:r,useSegments:a,segmentInfo:o}){const{min:s,max:l}=i,c=n.qDataPages[0].qMatrix[0][0].qNum,u=Ln(e,t,Yt,Qt).outerRadius;let h;h=c<s?Yt:c>l?Qt:Yt+(c-s)/(l-s)*(Qt-Yt);const f=r.getColor()({datum:{value:()=>0}}),p=o.paletteColors[0].color||f;return{type:"radial-spark",key:yi.RADIAL_SPARK,layout:{displayOrder:2},settings:{fill:a?p:f,radius:u,valueAngle:h}}}function Dr({refLines:e,isVertical:t,labelService:i,colorService:n,themeService:r}){const a=r.getStyles();return{type:"custom-ref-line",key:yi.REFERENCE_LINES_AND_LABELS,settings:{barWidth:i.getBarWidthInPixels()},lines:{[t?"y":"x"]:e.filter(On).map((e=>{var t,i;return{scale:"m",value:e.refLineExpr.value,label:{text:e.label,...a.referenceLine.label.name,showValue:e.showValue,showLabel:e.showLabel},line:{stroke:n.getPaletteColor(e.paletteColor||{index:e.color}),strokeWidth:(null===(t=e.style)||void 0===t?void 0:t.lineThickness)||2,strokeDasharray:null===(i=e.style)||void 0===i?void 0:i.lineType}}}))}}}const Ar=Math.log(10),Cr={log:(e,t)=>e<=0||t<=0?NaN:Math.log(e)/Math.log(t),log10:e=>e<=0?NaN:Math.log(e)/Ar,getNiceNumber(e){let t;if(0===e)return 0;const i=Math.floor(Math.log(Math.abs(e))/Ar),n=e/10**i;return t=n<=1?1:n<=2?2:n<=5?5:10,t*10**i*(e<0?-1:1)},getSmallNiceNumber(e){let t;if(0===e)return 0;let i=Math.floor(Math.log(Math.abs(e))/Ar);const n=e/10**i;return n<1?(t=5,i--):t=n<2?1:n<5?2:5,t*10**i*(e<0?-1:1)},getGoodNumber(e){let t;if(0===e)return 0;const i=Math.floor(Math.log(Math.abs(e))/Ar),n=e/10**i;return t=Math.ceil(n),7!==t&&9!==t||t++,n>1&&n<=1.5?t=1.5:n>2&&n<=2.5&&(t=2.5),t*10**i*(e<0?-1:1)},calculateTicks(e,t,i,n,r,a){return this.plotSize=e,this.explicitPlotMin=t,this.explicitPlotMax=i,this.minTickSpacingInPixel=n,this.absMax=Math.abs(this.explicitPlotMax),this.absMin=Math.abs(this.explicitPlotMin),this.usedDataRange=this.explicitPlotMax-this.explicitPlotMin,this.maxNumIntervals=this.plotSize/this.minTickSpacingInPixel,this.maxNumTicks=this.maxNumIntervals+1,this.minTickDataSpacing=a||0,this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),this.fontHeight=r,this.tickBaseValue=0,this.spaceUseLimit=.6,0===e?(this.plotMin=this.explicitPlotMin,this.plotMax=this.explicitPlotMax,this.tickDataSpacingNN=this.tickDataSpacing,Fr.call(this),jr.call(this)):(this.maxNumIntervals<1?Tr.call(this):(this.explicitPlotMax>0&&this.explicitPlotMin<0?1===this.maxNumIntervals?Pr.call(this,!0):this.maxNumIntervals>=5?qr.call(this):this.maxNumIntervals<2?Or.call(this):Rr.call(this):qr.call(this),this.tickMaxIndex<this.tickMinIndex?(this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),Tr.call(this)):Er.call(this)),Fr.call(this),jr.call(this))}};function Lr(e,t,i){void 0===e&&(e=null!==this.explicitPlotMin),void 0===t&&(t=null!==this.explicitPlotMax),this.tickDataSpacingNN=i?Cr.getGoodNumber(this.tickDataSpacing):Cr.getNiceNumber(this.tickDataSpacing),Vr.apply(this,[e,t])}function qr(){Lr.call(this);const e=this.tickMaxIndex-this.tickMinIndex;let t=this.plotMax-this.plotMin;this.spaceUseFactor=t/this.plotRange;let i=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;if(i&&this.maxNumIntervals>=5){for(;this.tickDataSpacing<=this.absMax&&i;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),Lr.call(this),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,i=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;if(!i)return}for(this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),(i||e<=2&&this.maxNumIntervals>=2*e)&&Lr.apply(this,[void 0,void 0,!0]),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,i=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;this.tickDataSpacing<=this.absMax&&i;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),Lr.apply(this,[void 0,void 0,!0]),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,i=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel}function Pr(e){e?(this.tickDataSpacingNN=Cr.getGoodNumber(this.absMax),this.tickBaseValue=-this.tickDataSpacingNN,this.plotMin=this.explicitPlotMin,this.plotMax=this.explicitPlotMax,this.tickMinIndex=1,this.tickMaxIndex=1,this.tickDataSpacingNN*=2):(this.plotMax=this.explicitPlotMax,this.plotMin=this.explicitPlotMin,this.plotRange=this.plotMax-this.plotMin,this.tickMinIndex=0,this.tickMaxIndex=0,this.tickDataSpacingNN=Cr.getNiceNumber(this.absMax),this.tickDataSpacingNN===this.absMax&&(this.tickDataSpacingNN=Cr.getNiceNumber(1.1*this.absMax)))}function Tr(){let e;this.tickDataSpacingNN=Cr.getNiceNumber(this.tickDataSpacing),this.plotMin=this.explicitPlotMin,this.plotMax=this.explicitPlotMax,this.plotRange=this.plotMax-this.plotMin,this.tickMinIndex=0,this.tickMaxIndex=0,(this.explicitPlotMax<0||this.explicitPlotMin>0)&&(e=Cr.getSmallNiceNumber(this.plotRange),this.tickBaseValue=Math.ceil(this.plotMin/e)*e)}function Or(){const e=this.explicitPlotMax>=-this.explicitPlotMin,t=e||null!==this.explicitPlotMin,i=!e||null!==this.explicitPlotMax;Lr.apply(this,[t,i,!0]);const n=(this.absMax+(1-this.spaceUseLimit)*this.absMin)/this.spaceUseLimit*1.0001;for(;this.tickDataSpacing<=n&&this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),Lr.apply(this,[t,i,!0]);const r=this.plotMax-this.plotMin;this.spaceUseFactor=r/this.plotRange}function Rr(){qr.call(this);const e=this.plotMax-this.plotMin;this.spaceUseFactor=e/this.plotRange}function Er(){const e=Cr.getNiceNumber(this.tickDataSpacingNN);if(this.tickDataSpacingNN===e||0!==this.tickBaseValue)return;const t=this.tickDataSpacingNN,i=this.tickMinIndex,n=this.tickMaxIndex,r=n-i,a=this.plotMin,o=this.plotMax;this.tickDataSpacingNN=e,Vr.apply(this,[null!==this.explicitPlotMin,null!==this.explicitPlotMax]);const s=this.plotMax-this.plotMin;this.spaceUseFactor=s/this.plotRange;const l=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel,c=this.tickMaxIndex-this.tickMinIndex;!l&&(c===r||c>=10||c>=3&&1.5*c>=r)||(this.tickDataSpacingNN=t,this.tickMinIndex=i,this.tickMaxIndex=n,this.plotMin=a,this.plotMax=o,this.plotRange=this.plotMax-this.plotMin)}function zr(){this.plotMax===this.plotMin||0===this.plotSize?(this.minTickValue=this.plotMin,this.maxTickValue=this.plotMax):(this.minTickValue=this.tickBaseValue+this.tickMinIndex*this.tickDataSpacingNN,this.maxTickValue=this.tickBaseValue+this.tickMaxIndex*this.tickDataSpacingNN)}function Fr(){let e,t;if(this.mainTickValues=[],this.secondaryTickValues=[],zr.call(this),0===this.plotSize)return;e=this.tickBaseValue;const i=this.tickMaxIndex-this.tickMinIndex;if(!(i<1)){for(t=0;t<=i;t++)this.mainTickValues.push(e+(t+this.tickMinIndex)*this.tickDataSpacingNN);for(e=this.tickBaseValue+this.tickDataSpacingNN/2,t=0;t<i;t++)this.secondaryTickValues.push(e+(t+this.tickMinIndex)*this.tickDataSpacingNN)}}function Vr(e,t){this.tickMinIndex=e?Math.ceil(this.explicitPlotMin/this.tickDataSpacingNN):Math.floor(this.explicitPlotMin/this.tickDataSpacingNN),this.tickMaxIndex=t?Math.floor(this.explicitPlotMax/this.tickDataSpacingNN):Math.ceil(this.explicitPlotMax/this.tickDataSpacingNN),this.plotMin=e?this.explicitPlotMin:this.tickMinIndex*this.tickDataSpacingNN,this.plotMax=t?this.explicitPlotMax:this.tickMaxIndex*this.tickDataSpacingNN,this.plotRange=this.plotMax-this.plotMin}function jr(){return{plotMin:this.plotMin,plotMax:this.plotMax,tickSpacing:this.tickDataSpacingNN,tickBaseValue:this.tickBaseValue,tickMinIndex:this.tickMinIndex,tickMaxIndex:this.tickMaxIndex,minTickValue:this.minTickValue,maxTickValue:this.maxTickValue,mainTickValues:this.mainTickValues,secondaryTickValues:this.secondaryTickValues}}function $r({core:e,dockService:t,rangeLimits:i,measureAxisSpacing:n,isRadial:r,isVertical:a,styleService:o}){const s=i.min,l=i.max,{width:c,height:u}=function(e){return{width:e.meta.chart.size.width,height:e.meta.chart.size.height}}(t);let h,f=96*n;if(r)h=Math.min(u,c);else{h=a?u:c;const{chart:t,picassoInstance:i}=e;if(t&&i){const e=t.formatter(gi.MEASURE),r=i.renderer("svg")(),p=o.query.axis.label.getStyle(),{fontFamily:d,fontSize:m}=p,g=e=>r.measureText({text:e,fontSize:or({width:c,height:u,fontSize:m}),fontFamily:d}),y=Math.max(96,...[s,l,(l-s)/2].map((t=>g(e(t)).width)));f=a?4*g("M").height:y;f=h/(Math.max(2,h/f/n+1)-1)}}const p=function({plotSize:e,rangeMax:t,rangeMin:i,minTickSpacingInPixel:n}){const r=Cr.calculateTicks(e,i,t,n,20,0);r.tickSpacing;let a=r.mainTickValues;0===a.length&&a.push(r.minTickValue);const o=a[0];a[0]=r.plotMin,o-r.plotMin>=r.tickSpacing/2&&a.splice(1,0,o);const s=r.mainTickValues[r.mainTickValues.length-1];return r.plotMax-s<=r.tickSpacing/2?a[r.mainTickValues.length-1]=Math.round(r.plotMax):a.push(Math.round(r.plotMax)),a}({plotSize:h,rangeMin:s,rangeMax:l,minTickSpacingInPixel:f});return{values:p}}function Hr({core:e,services:t,logicalSize:i}){const{layoutService:n,dockService:r,colorService:a,labelService:o,themeService:s,styleService:l}=t;if(!n.meta.qHyperCube)throw new Error("Layout is missing a hypercube");const{width:c,height:u}=r.meta.chart.size,{autoOrientation:h,gaugetype:f,rangeLimits:p,measureAxisTitle:d,qHyperCube:m,useSegments:g,segmentInfo:y,refLines:v,measureAxisSpacing:b}=n.meta;let x,M;M="radial"===f,x=h?c>=u?"horizontal":"vertical":n.meta.orientation;const S="vertical"===x,k=function({width:e,height:t,isVertical:i,orientation:n,measureAxisTitle:r,qHyperCube:a,rangeLimits:o,gaugetype:s,colorService:l,core:c,labelService:u,useSegments:h,themeService:f,segmentInfo:p,refLines:d,styleService:m}){const{chart:g}=c;if(!g)return[];let y=[];return y="bar"===s?[...sr({width:e,height:t,isVertical:i,styleService:m,themeService:f}),...yr({orientation:n,colorService:l,rangeLimits:o,isVertical:i,useSegments:h,themeService:f,segmentInfo:p}),...lr({width:e,height:t,labelService:u,measureAxisTitle:r,isVertical:i,styleService:m}),...vr({isVertical:i,chart:g,labelService:u,styleService:m}),br({labelService:u,rangeLimits:o,qHyperCube:a,isVertical:i}),Dr({refLines:d,isVertical:i,labelService:u,colorService:l,themeService:f})]:e>=ki.SPARK.width&&t>=ki.SPARK.height?[...Mr({qHyperCube:a,rangeLimits:o,width:e,height:t,colorService:l,themeService:f,segmentInfo:p,useSegments:h}),...Sr({qHyperCube:a,chart:g,styleService:m,labelService:u}),...xr({width:e,height:t,styleService:m,themeService:f}),...h?[kr({width:e,height:t,rangeLimits:o,qHyperCube:a})]:[],wr({rangeLimits:o,qHyperCube:a,width:e,height:t,colorService:l,useSegments:h}),Nr({refLines:d,isVertical:i,labelService:u,colorService:l,themeService:f,width:e,height:t})]:[Ir({width:e,height:t,rangeLimits:o,qHyperCube:a,colorService:l,useSegments:h,segmentInfo:p})],y}({width:c,height:u,isVertical:S,orientation:x,measureAxisTitle:d,qHyperCube:m,rangeLimits:p,gaugetype:f,colorService:a,core:e,labelService:o,themeService:s,useSegments:g,segmentInfo:y,refLines:v,styleService:l}),w=function({core:e,colorService:t,isVertical:i,isRadial:n,dockService:r,rangeLimits:a,measureAxisSpacing:o,styleService:s}){const l=$r({core:e,dockService:r,rangeLimits:a,measureAxisSpacing:o,isRadial:n,isVertical:i,styleService:s});return{m:{data:{field:"qMeasureInfo/0"},type:"linear",invert:!!n||i,min:a.min,max:a.max,ticks:{values:l.values}},...t.getScales()}}({core:e,measureAxisSpacing:b,isVertical:S,colorService:a,isRadial:M,dockService:r,rangeLimits:p,styleService:l});return{scales:w,components:k,formatters:{[gi.MEASURE]:{data:{field:"qMeasureInfo/0"}}},strategy:{layoutModes:ki,logicalSize:i}}}function _r(o){return{qae:{properties:{qHyperCubeDef:{qMeasures:[],qInitialDataFetch:[{qWidth:2,qHeight:5e3}],qSuppressZero:!1,qSuppressMissing:!0},showTitles:!0,title:"",subtitle:"",footnote:"",measureAxis:{min:0,max:10},orientation:"vertical",segmentInfo:{limits:[],colors:[{color:3}]}},data:{targets:[{path:"/qHyperCubeDef",dimensions:{min:0,max:0},measures:{min:1,max:1}}]}},ext:Kt(o),component(){const o=(()=>{const r=e(),a=t(),[o,s]=i({});return n((()=>{r.style.overflow="hidden";const e=d();e.use(p),e.component("oob-indicator",Cn),e.component("radial-gauge-needle",En),e.component("radial-custom-ref-line",Qn),e.component("custom-ref-line",tr),e.component("radial-oob-indicator",zn),e.component("radial-spark",Jn);const t=e({renderer:{prio:[a.renderer||"svg"]}}),i=t.chart({element:r,data:[],settings:{}});return s({picassoInstance:t,chart:i}),()=>{i.destroy()}}),[]),o})(),s=ar({core:o}),c=(({core:e,services:o})=>{const[s,c]=i({}),f=t(),p=l(),d=a(),m=r(),{qLocaleInfo:g}=u();return h((async()=>{if(!o)return Promise.resolve();const{colorService:t}=o;return t.initialize({createConfig:()=>({theme:d,layout:m,localeInfo:g,hc:m.qHyperCube,colorProps:{...m.color,auto:!0,useBaseColors:"off",paletteColor:m.paletteProgressColor}})}).then((()=>{const{layoutService:t}=o,i=ir({layout:t.getLayout(),options:f}),n=Hr({core:e,services:o,logicalSize:i});c(n)}))}),[o]),n((()=>{if(o&&o.dockService&&o.layoutService){const{dockService:t,layoutService:i}=o,n=ir({layout:i.getLayout(),options:f});t.update(n||p);const r=Hr({core:e,services:o,logicalSize:n});c(r)}}),[p]),s})({core:o,services:s});(({core:e,services:t,settings:i})=>{n((()=>{if(!i||!e||!t)return;const{chart:n}=e;n&&n.update({data:[{type:"q",key:"qHyperCube",data:t.layoutService.getHyperCube()},...t.colorService.getData()],settings:i})}),[e,i])})({core:o,settings:c,services:s}),(({services:e})=>{f((t=>{if(e){const{dockService:i}=e,{width:n,height:r}=i.meta.chart.size;t.snapshotData=t.snapshotData||{content:{size:{w:n,h:r}}},t.snapshotData.content={size:{w:n,h:r}}}return Promise.resolve(t)}))})({services:s})}}}export{_r as default};
|