@nebula.js/sn-gauge 0.8.13 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-specifications/properties.json +8 -4
- package/core/esm/index.js +4 -4
- package/dist/sn-gauge.esm.js +5 -5
- package/dist/sn-gauge.js +5 -5
- package/dist/sn-gauge.systemjs.js +3 -3
- package/package.json +27 -27
- package/sn-gauge-ext/dist/sn-gauge.js +5 -5
- package/sn-gauge-ext/sn-gauge.qext +1 -1
package/core/esm/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/sn-gauge v0.
|
|
3
|
-
* Copyright (c)
|
|
2
|
+
* @nebula.js/sn-gauge v0.9.0
|
|
3
|
+
* Copyright (c) 2026 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import{useElement as e,useOptions as t,useState as n,useEffect as r,useAppLayout as i,useStaleLayout as o,useTheme as a,useApp as s,useModel as l,useRect as u,useTranslator as c,useInteractionState as p,usePromise as f,onTakeSnapshot as d}from"@nebula.js/stardust";import m from"picasso-plugin-q";import h from"picasso.js";function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){y(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||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 q(e){return function(e){if(Array.isArray(e))return g(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 D(e){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D(e)}function S(e,t){if(e){if("string"==typeof e)return g(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(e,t):void 0}}var M,A="top",w="top-right",I="right",k="bottom-right",C="bottom",L="bottom-left",E="left",N="top-left";y(y(y(y(y(y(y(y(y(y(M={},"equal-equal",[A,C]),"equal-higher",[C,k]),"equal-lower",[A,w]),"equal-void",[A,C]),"higher-equal",[E,L,A,w]),"higher-higher-acute",[C,L,E,w]),"higher-higher-obtuse",[C,A]),"higher-lower-negative",[A,w,I]),"higher-lower-positive",[C,L,E]),"higher-void",[A]),y(y(y(y(y(y(y(y(y(y(M,"lower-equal",[A]),"lower-higher-negative",[A,N]),"lower-higher-positive",[k]),"lower-lower-acute",[A,N,E,w,I]),"lower-lower-obtuse",[A,C]),"lower-void",[A]),"void-equal",[A]),"void-higher",[A,C]),"void-lower",[A,C,E]),"void-void",[A]),y(M,"unclassified",[A,C,I,E,w,k,L,N]);var P=["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"],O=["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 F=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function T(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],a=t.getStyle("","","fontFamilies");return Array.isArray(a)&&a.length?o.push.apply(o,q(new Set([r].concat(q(a.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(q(o.map((function(e){return F(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],q(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?O:P}(i).map((function(e){return F(e)}))))}function R(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,a=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return a()},getOptions:function(){return T({theme:t,translator:n,defaultValue:a(),flags:o})}}}var V,H,j=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],z=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function _(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,r=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push.apply(r,q(new Set([n].concat(q(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(q(r.map((function(e){return z(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],q(j.map((function(e){return z(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function B(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:R({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:_({theme:t,translator:n,id:r,path:i})}}var $,G=function(){if(H)return V;H=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},a=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},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return V=function e(){var t,n,r,l,u,c,p=arguments[0],f=1,d=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},f=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});f<d;++f)if(null!=(t=arguments[f]))for(n in t)r=s(p,n),p!==(l=s(t,n))&&(m&&l&&(o(l)||(u=i(l)))?(u?(u=!1,c=r&&i(r)?r:[]):c=r&&o(r)?r:{},a(p,{name:n,newValue:e(m,c,l)})):void 0!==l&&a(p,{name:n,newValue:l}));return p},V}(),U=($=G)&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$;function W(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map((function(e){return i[e.value%i.length]}))},valueAccessor:e.value}}function K(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map((function(e){return i[e.row.value%i.length]}))},valueAccessor:e.value}}function X(e,t,n,r,i){var o,a,s=i.byRow,l=i.byElemNo;if(r&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(a=(o=e.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===a?void 0:a.qArea.qHeight)||0)))return l(r,r.raw().qCardinal);if(r){var u=t.pic.extract({field:r.key(),trackBy:r.value}).length;return s(r,u)}return{}}function Z(e,t){var n=e.hc.qDimensionInfo,r=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(r.activeDimensionIndex>=0){var i=n[r.activeDimensionIndex];r=i.coloring&&i.coloring.colorMapRef?{type:"libraryItem",key:i.coloring.colorMapRef,activeDimensionIndex:r.activeDimensionIndex}:{activeDimensionIndex:r.activeDimensionIndex}}return r}function Y(e,t){var n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter((function(e){return"dimension"===e.type()}))[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(n=t.key?e.pic.field((function(e){return e.raw().colorMapRef===t.key})):void 0)&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n}function J(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Q(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ee(){}var te=1/.7,ne="\\s*([+-]?\\d+)\\s*",re="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ie="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",oe=/^#([0-9a-f]{3,8})$/,ae=new RegExp(`^rgb\\(${ne},${ne},${ne}\\)$`),se=new RegExp(`^rgb\\(${ie},${ie},${ie}\\)$`),le=new RegExp(`^rgba\\(${ne},${ne},${ne},${re}\\)$`),ue=new RegExp(`^rgba\\(${ie},${ie},${ie},${re}\\)$`),ce=new RegExp(`^hsl\\(${re},${ie},${ie}\\)$`),pe=new RegExp(`^hsla\\(${re},${ie},${ie},${re}\\)$`),fe={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 de(){return this.rgb().formatHex()}function me(){return this.rgb().formatRgb()}function he(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=oe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?ge(t):3===n?new xe(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?ye(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?ye(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=ae.exec(e))?new xe(t[1],t[2],t[3],1):(t=se.exec(e))?new xe(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=le.exec(e))?ye(t[1],t[2],t[3],t[4]):(t=ue.exec(e))?ye(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ce.exec(e))?we(t[1],t[2]/100,t[3]/100,1):(t=pe.exec(e))?we(t[1],t[2]/100,t[3]/100,t[4]):fe.hasOwnProperty(e)?ge(fe[e]):"transparent"===e?new xe(NaN,NaN,NaN,0):null}function ge(e){return new xe(e>>16&255,e>>8&255,255&e,1)}function ye(e,t,n,r){return r<=0&&(e=t=n=NaN),new xe(e,t,n,r)}function ve(e){return e instanceof ee||(e=he(e)),e?new xe((e=e.rgb()).r,e.g,e.b,e.opacity):new xe}function be(e,t,n,r){return 1===arguments.length?ve(e):new xe(e,t,n,null==r?1:r)}function xe(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function qe(){return`#${Ae(this.r)}${Ae(this.g)}${Ae(this.b)}`}function De(){const e=Se(this.opacity);return`${1===e?"rgb(":"rgba("}${Me(this.r)}, ${Me(this.g)}, ${Me(this.b)}${1===e?")":`, ${e})`}`}function Se(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Me(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ae(e){return((e=Me(e))<16?"0":"")+e.toString(16)}function we(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ke(e,t,n,r)}function Ie(e){if(e instanceof ke)return new ke(e.h,e.s,e.l,e.opacity);if(e instanceof ee||(e=he(e)),!e)return new ke;if(e instanceof ke)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new ke(a,s,l,e.opacity)}function ke(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Ce(e){return(e=(e||0)%360)<0?e+360:e}function Le(e){return Math.max(0,Math.min(1,e||0))}function Ee(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}J(ee,he,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:de,formatHex:de,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ie(this).formatHsl()},formatRgb:me,toString:me}),J(xe,be,Q(ee,{brighter(e){return e=null==e?te:Math.pow(te,e),new xe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new xe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new xe(Me(this.r),Me(this.g),Me(this.b),Se(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:qe,formatHex:qe,formatHex8:function(){return`#${Ae(this.r)}${Ae(this.g)}${Ae(this.b)}${Ae(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:De,toString:De})),J(ke,(function(e,t,n,r){return 1===arguments.length?Ie(e):new ke(e,t,n,null==r?1:r)}),Q(ee,{brighter(e){return e=null==e?te:Math.pow(te,e),new ke(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ke(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new xe(Ee(e>=240?e-240:e+120,i,r),Ee(e,i,r),Ee(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ke(Ce(this.h),Le(this.s),Le(this.l),Se(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=Se(this.opacity);return`${1===e?"hsl(":"hsla("}${Ce(this.h)}, ${100*Le(this.s)}%, ${100*Le(this.l)}%${1===e?")":`, ${e})`}`}}));const Ne=Math.PI/180,Pe=180/Math.PI,Oe=4/29,Fe=6/29,Te=3*Fe*Fe;function Re(e){if(e instanceof Ve)return new Ve(e.l,e.a,e.b,e.opacity);if(e instanceof Be)return $e(e);e instanceof xe||(e=ve(e));var t,n,r=_e(e.r),i=_e(e.g),o=_e(e.b),a=He((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=He((.4360747*r+.3850649*i+.1430804*o)/.96422),n=He((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Ve(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Ve(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function He(e){return e>.008856451679035631?Math.pow(e,1/3):e/Te+Oe}function je(e){return e>Fe?e*e*e:Te*(e-Oe)}function ze(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function _e(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Be(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function $e(e){if(isNaN(e.h))return new Ve(e.l,0,0,e.opacity);var t=e.h*Ne;return new Ve(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}J(Ve,(function(e,t,n,r){return 1===arguments.length?Re(e):new Ve(e,t,n,null==r?1:r)}),Q(ee,{brighter(e){return new Ve(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Ve(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new xe(ze(3.1338561*(t=.96422*je(t))-1.6168667*(e=1*je(e))-.4906146*(n=.82521*je(n))),ze(-.9787684*t+1.9161415*e+.033454*n),ze(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),J(Be,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Be)return new Be(e.h,e.c,e.l,e.opacity);if(e instanceof Ve||(e=Re(e)),0===e.a&&0===e.b)return new Be(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Pe;return new Be(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Be(e,t,n,null==r?1:r)}),Q(ee,{brighter(e){return new Be(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Be(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return $e(this).rgb()}}));var Ge=e=>()=>e;function Ue(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Ge(isNaN(e)?t:e)}var We=function e(t){var n=function(e){return 1==(e=+e)?Ue:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Ge(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=be(e)).r,(t=be(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Ue(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1),Ke=/^class(-pyramid)?/,Xe=function(e,t,n,r){var i=void 0!==n.min?n.min:r.min(),o=void 0!==n.max?n.max:r.max(),a=i,s=o,l=t.limits,u={},c="percent"===t.limitType?l.map((function(e){return i+(o-i)*e})):l,p=t.colors.map((function(t){return e.resolveUIColor(t)}));if(i=Math.min.apply(Math,[i].concat(q(c))),o=Math.max.apply(Math,[o].concat(q(c))),u.min=i,u.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))u.type="categorical",Object.assign(u,function(e){var t=e.min,n=e.max,r=e.limits,i=e.range,o=[],a=[];if(r.length)if(r[r.length-1]<t)a.push(t,n),o.push(i[i.length-1],i[i.length-1],i[i.length-1]);else if(r[0]>n)a.push(t,n),o.push(i[0],i[0],i[0]);else{if(r[0]>t)a.push(t),o.push(i[0]);else{a.push(t);for(var s=0;s<r.length;s++)if(t<r[s]){o.push(i[s]);break}}for(var l=0;l<r.length;l++)t<r[l]&&r[l]<n&&(a.push(r[l]),o.push(i[l]));if(r[r.length-1]<n)a.push(n),o.push(i[r.length]),o.push(i[r.length]);else{a.push(n);for(var u=0;u<r.length;u++)if(r[u]>n){o.push(i[u]),o.push(i[u]);break}}}else o.push(i[0]);return{min:t,max:n,range:o,domain:a}}({min:"percent"===t.limitType?i:a,max:"percent"===t.limitType?o:s,range:p,limits:"percent"===t.limitType?c:l}));else if(t.breakTypes){var f=t.breakTypes;u.type="continuous",u.domain=[i],u.range=[p[0]];for(var d=0;d<c.length;d+=1)if(f[d]){var m=p[d],h=p[d+1],g=We(m,h)(.5);u.range.push(g),u.domain.push(c[d]),d<c.length-1&&f[d+1]&&(u.range.push(p[d+1]),u.domain.push((c[d]+c[d+1])/2))}else u.range.push(p[d]),u.range.push(p[d+1]),u.domain.push(c[d]),u.domain.push(c[d]+Math.min(1e-6,(o-i)/1e6));u.range.push(p[p.length-1]),u.domain.push(o)}else u.domain=c,u.range=p;return u};function Ze(e,t,n,r,i){var o,a,s,l=0,u=[],c=(e-t)/(r+1);if(0===c)return 1;for(o=0;o<n.length;o+=1)a=.99*(n[o]-t),s=n[o]>e?Math.floor(e/c):n[o]<t?0:Math.floor(a/c),Number.isNaN(s)||(u[s]?u[s]+=1:u[s]=1);for(o=0;o<u.length;o+=1)u[o]&&(l+=1);return l<=r||l>=i?Math.max(l,r):Ze(e,t,n,r+1,i)}var Ye=function(e,t,n,r){var i,o,a=t.theme,s=t.hc,l=r.f,u={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},c=[],p=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(p=!("S"===(i=n.pic.raw()).qMode&&(i.qDataPages[0]&&i.qSize.qcy>i.qDataPages[0].qArea.qHeight||!i.qDataPages.length&&i.qSize.qcy>0)||"K"===i.qMode&&i.qStackedDataPages[0]&&i.qSize.qcy>i.qStackedDataPages[0].qArea.qHeight||"T"===i.qMode&&i.qSize.qcy>i.qTreeDataPages[0].qGroupSize))&&(c=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:s.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,q(e))<0}}}}).filter((function(e){return e.value>=0&&!e.exclude.value})).map((function(e){return e.num.value})).filter((function(e){return"number"==typeof e})))}if(!1===n.input.autoMinMax){if(u.min=n.input.measureMin,u.max=n.input.measureMax,u.max<u.min)return{invalid:!0}}else if(l&&!p)u.min=l.min(),u.max=l.max();else if(l){if(!c.length)return{invalid:!0};u.min=Math.min.apply(Math,q(c)),u.max=Math.max.apply(Math,q(c))}if(n.input.measureScheme&&(u.palettes={quant:n.input.measureScheme}),a){var f=a.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];u.type=f&&Ke.test(f.type)?"categorical":"continuous","categorical"===u.type&&(o=f.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,q(f.colors.map((function(e){return e?e.length:0})))):f.colors.length)}if("categorical"===u.type){for(var d=p?Ze(u.max,u.min,c,1,o):o,m=(u.max-u.min)/d,h=[],g=0;g<d+1;g+=1)h.push(u.min+m*g);u.domain=h,u.range=function(e){for(var t=e.resources.theme.palette("quant",d),n=Math.max(1,Math.floor(t.length/d)),r=[],i=0;i<d;i+=1)r.push(t[i*n]);return[r[0]].concat(r,[r[r.length-1]])}}return u};function Je(e,t){var n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field((function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key})):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n||(n=e.pic.field((function(e){return void 0!==e.raw().matchMeasure})))&&(n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[n.raw().matchMeasure]),n}function Qe(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function et(e,t){for(var n=(null==t?void 0:t.domain)||[],r=(null==t?void 0:t.range)||[],i=[],o=0;o<e.length;++o){var a=e[o];if("constant"===(null==a?void 0:a.mode)){var s=n.indexOf(o);-1===s?(n.push(o),r.push(a.primary)):r[s]=a.primary,e[o]=null}else if(a){i.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),r.splice(l,1))}}return{domain:n,range:r,exclude:i}}function tt(e,t,n,r){var i,o=function(e,t,n,r){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var r=t.theme,i=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?Je:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),u=Ye(0,{theme:r,hc:i},n,{f:l});if(u.invalid)return u;"expression"===s.type&&(s.activeMeasureIndex<0||void 0===s.activeMeasureIndex)&&(u.label=s.label,l&&"color.altLabel"===l.raw().labelExpRef&&(u.label=n.input.altLabel)),!u.label&&l&&(u.label=l.title());var c=s.activeMeasureIndex>=0?l:null;if(!c&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(c=n.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===s.type)if(c){var p=c.raw().coloring;p&&p.gradient&&U(u,Xe(e,p.gradient,u,c))}else u.auxiliary=s;return u}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.getCDef,o=void 0===i?Z:i,a=r.getCByField,s=void 0===a?Y:a,l=r.getPersistence,u=void 0===l?X:l,c=o(t,n),p=s(n,c),f=p?p.raw():{},d=n&&n.pic?n.pic.raw():{};if(f.qError||f.qSize&&0===f.qSize.qcy&&!d.qHasOtherValues)return{invalid:!0};var m={mode:"field",fieldType:"dimension",type:"categorical",field:p?p.key():void 0,isFieldLocked:f.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(m.label=c.label,"color.altLabel"===f.labelExpRef&&(m.label=n.input.altLabel)),!m.label&&p&&(m.label=p.title()),n.input.dimensionScheme&&(m.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===c.type&&(m.auxiliary=c),U(m,u(t,n,c,p,{byRow:K,byElemNo:W})),m}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!s||!s.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:r.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=Ye(0,{hc:i,theme:o},n,{f:s});return l.invalid||(l.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,r);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&i.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],u=[];"measure"===n.input.useBaseColors&&i.qMeasureInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?u.push(r.primary):u.push(i)}}));var c=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,p=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&p&&(c={categorical:p.key}),{mode:"measure",type:"categorical",palettes:c,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:u}:void 0}}if("dimension"===s){var f=[],d=[];return i.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){f.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?d.push(r.primary):d.push(i)}})),{mode:"dimension",type:"categorical",field:f.length?f[0]:void 0,explicit:f.length?{domain:f,range:d}:void 0}}var m=r.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(m=e.resolveUIColor(n.input.paletteColor));else{var h=n.input.singleColor;"number"!=typeof h||Number.isNaN(h)||(m=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][h])}return{mode:"constant",type:"constant",primary:m}}(e,n,t,r)}return{}}(e,t,n,r);return null!==(i=t.input)&&void 0!==i&&i.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map((function(n,i){return function(e){var t,n=e.cm,r=e.defaults,i=e.index,o=e.input,a=e.pic;if(!o||!o.on)return null;var s=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===s?function(e,t,n){var r=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(r=e.resolveUIColor(t.paletteColor)),b(b({},n),{},{mode:"constant",type:"constant",primary:r})}(n,o,r):"byExpression"===s?function(e,t,n){var r="qMeasureInfo/".concat(e,"/"),i=t.field((function(e){return e.id().startsWith(r)&&"colorByMeasureExpression"===e.raw().id})),o=i;return b(b({},n),{},o?{mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(i,a,r):null}({cm:e,input:n,defaults:r,index:i,pic:t.pic})})),function(e,t){var n,r,i,o=t.translator;if(Qe(e),1===(null===(n=e.measureOverrides)||void 0===n?void 0:n.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=et(e.measureOverrides,e.explicit),Qe(e)),null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=et(e.measureOverrides),a}return null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}var nt=function(e,t){var n=e.fieldType,r={};if(t)if("measure"===n){var i=t.coloring;i&&(r.measureGradient=i.gradient)}else if("dimension"===n){var o=t[0],a=t[1];o&&(r.legendDataPage=o),a&&(r.dimValsData=a.colorMap)}return r},rt=function(e){throw e.isHandled=!0,e};function it(e){return function(t){return"object"===D(t.datum[e])?t.datum[e].value:void 0}}function ot(e){return"object"===D(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function at(e){return-3===e.datum.value}var st={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},lt={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"};function ut(e){var t=e.theme,n=e.key,r=e.styleOverrides,i={title:{color:st.COLOR,fontSize:st.FONT_SIZE,fontFamily:st.FONT_FAMILY},label:{color:lt.COLOR,fontSize:lt.FONT_SIZE,fontFamily:lt.FONT_FAMILY}};if(!t&&!r)return i;var o=r||{},a=o.title,s=o.label,l=function(e){var t=e.theme,n=e.key;return function(e,r,i,o){return void 0!==e?e:t?t.getStyle(n,r,i):o}}({theme:t,key:n});return i.title.color=l(null==a?void 0:a.color,"legend.title","color",st.COLOR),i.title.fontSize=l(null==a?void 0:a.fontSize,"legend.title","fontSize",st.FONT_SIZE),i.title.fontFamily=l(null==a?void 0:a.fontFamily,"legend.title","fontFamily",st.FONT_FAMILY),i.label.color=l(null==s?void 0:s.color,"legend.label","color",lt.COLOR),i.label.fontSize=l(null==s?void 0:s.fontSize,"legend.label","fontSize",lt.FONT_SIZE),i.label.fontFamily=l(null==s?void 0:s.fontFamily,"legend.label","fontFamily",lt.FONT_FAMILY),i}var ct=function(e,t,n){var r=e&&e.dock||void 0;if("auto"!==r)return r||"right";if(t){var i=t.element.getBoundingClientRect();if(i.height>i.width)return"bottom"}return n?"left":"right"},pt=function(e,t,n){return!(n.invalid||"color"===n.type||"measure"===n.mode&&t.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function ft(e,t){var n=e.styleReference,r=e.styleOverrides,i=e.chart,o=e.rtl,a=t.legendProps,s=t.coloring,l=t.theme,u=t.hc,c=ut({theme:l,key:n,styleOverrides:r});return{layout:{minimumLayoutMode:"MEDIUM",dock:ct(a,i,o)},show:"function"==typeof a.show?function(){return pt(a,u,s)}:pt(a,u,s),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==a.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:s.label||"",fill:c.title.color,fontSize:c.title.fontSize,fontFamily:c.title.fontFamily}}}}function dt(e,t,n){var r=[],i=[],o=function(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var r=ft(e,t);if(!r.show)return!1;var i,o=e.key,a=e.styleReference,s=e.styleOverrides,l=e.viewState,u=e.rtl,c=e.settings,p=e.style,f=t.scaleKey,d=t.theme,m=t.scales,h=ut({theme:d,key:a,styleOverrides:s}),g=r.layout.dock,y="left"===g||"right"===g?{maxLines:2,wordBreak:"break-word"}:{},v={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===t.coloring.fieldType&&(i=function(e){return e.datum.value>=0||-3===e.datum.value});var x="".concat(f,"Legend");return U(!0,r,{type:"legend-cat",key:"".concat(o,"-cat"),scale:x in m?x:f,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(r.layout.dock)?2:1,direction:u?"rtl":"ltr",horizontal:20},item:{show:i,label:b({fill:h.label.color,fontSize:h.label.fontSize,fontFamily:h.label.fontFamily},y)},navigation:{disabled:n,button:{content:function(e,t){var n=t.direction;return e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:v[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:c,style:p})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,r=e.key,i=e.styleReference,o=e.styleOverrides,a=e.rtl,s=e.settings,l=e.style,u=t.scaleKey,c=t.theme,p="".concat(u,"Range"),f=ft(e,t);if(!f.show)return!1;var d=ut({theme:c,key:i,styleOverrides:o}),m=f.layout.dock,h="right"===m||"left"===m,g=null===(n=t.scales)||void 0===n?void 0:n[p];return h&&g&&(g.invert=!0),U(!0,f,{type:"legend-seq",key:"".concat(r,"-seq"),settings:{fill:u,major:p,length:1,tick:{fill:d.label.color,fontSize:d.label.fontSize,fontFamily:d.label.fontFamily},title:{anchor:!a||"top"!==f.layout.dock&&"bottom"!==f.layout.dock?void 0:"right",padding:parseFloat(f.settings.title.fontSize)||16}}},{settings:s,style:l})}(e,t)}(e,t,n&&n.navigationDisabled);return r.push(o),o&&"legend-cat"===o.type&&(i.push(function(e){var t=e.key,n=e.requireFailure,r=e.recognizeWith,i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var r;if(!n)return!0;if(null!=i&&null!==(r=i.interact)&&void 0!==r&&r.enabled&&!i.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),i.push(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,n=e.key,r=e.requireFailure,i=e.recognizeWith,o=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(n),type:"Pan",requireFailure:r,recognizeWith:i,options:{event:t,pointers:1,threshold:10,enable:function(e,r){var i;return this.started===t||!r||!(null!=o&&null!==(i=o.interact)&&void 0!==i&&i.enabled&&!o.interact.enabled())&&this.chart.componentsFromPoint({x:r.center.x,y:r.center.y}).some((function(e){return e.key==="".concat(n,"-cat")}))}},events:y(y(y({},"".concat(t,"start"),(function(e){e.preventDefault(),this.started!==t&&(this.started=t,this.chart.component("".concat(n,"-cat")).emit("panstart",e))})),"".concat(t,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panmove",e)})),"".concat(t,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panend",e),this.started=!1}))}}(e,n))),{interactions:i,components:r}}function mt(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=function(e){var t=b({hc:null,colorProps:null,layout:null,theme:null},e),n={},r={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},i={auto:function(e){return e?(r.auto=e,i):r.auto},getDimensionColorMap:function(e){return e?(r.getDimensionColorMap=e,i):r.getDimensionColorMap},getAttributeDimension:function(e){return e?(r.getAttributeDimension=e,i):r.getAttributeDimension},getMeasure:function(e){return e?(r.getMeasure=e,i):r.getMeasure},set:function(e){var i;if(!e.colorProps)throw new Error('Missing "colorProps"');if(U(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=r.auto(e.layout);n.input=U(!0,{},n.input,o,{auto:!1});var a=t.theme?t.theme.getDataColorPalettes():[];a[0]&&(n.input.dimensionScheme=a[0].key);var s=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(s=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[s]&&t.hc.qDimensionInfo[s].coloring&&t.hc.qDimensionInfo[s].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(i=n.input.measureOverrides)&&void 0!==i&&i.every((function(e){return!e||!e.on}))&&(n.input=U(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,r=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){r.push({key:"ui",colors:e.colors})})),n.palettes=r}return n.palettes},getAuxiliaryData:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var i=(e.auxiliary||{}).key;if("measure"===e.fieldType)return r.getMeasure(i,t).catch((function(){}));if("dimension"===e.fieldType){var o="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?r.getAttributeDimension(o,t).catch((function(){})):Promise.resolve(),i?r.getDimensionColorMap(i,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,r){var i=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,r).then((function(r){if(!r)return{};if("measure"===e.fieldType){if(r.coloring&&r.coloring.gradient){var o=n.pic.field(e.field);return Xe(i,r.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var a={nil:e.nil,others:e.others},s=r[0],l=r[1]?r[1].colorMap:null;if(s){var u=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:s,qInterColumnSortOrder:[0,1],qMode:"S"}});a.legendDataset=u}return l?function(e,t,n,r){var i=r.external,o=r.field,a=b({},e);U(a,W(o,o.raw().qCardinal));var s=i.theme?i.theme.getDataColorPalettes()[0]:null;return t.nul&&(a.nil=n.resolveUIColor(t.nul)),t.oth&&(a.others=n.resolveUIColor(t.oth)),t.usePal?(a.palettes={categorical:t.pal},s&&!t.pal&&(a.palettes.categorical=s.key,U(a,W(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),U(a,W(o))),t.colors&&t.colors.length&&(a.explicit=function(e,t,n){for(var r={},i=0;i<e.length;i+=1)r[e[i].value]=e[i].baseColor;var o=[];return{domain:function(e){var i=e.data,a=[];o=[];for(var s=0;s<i.items.length;s++){var l=i.items[s],u=(l.text||l).label;r[u]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(t.resolveUIColor(r[u])))}return a.push(-3,-2),o.push(n.others),o.push(n.nil),a},range:function(){return o}}}(t.colors,n,a)),a}(a,l,i,{external:t,field:n.pic.field(e.field)}):a}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!n.uiPalette)return e.color;var t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},r=t.theme;r&&(e=b(b({},e),r.getDataColorSpecials())),n.settings=U(e,tt(this,n,t,e))}return n.settings}};return i}(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 n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():r&&r.getObject?r.getObject("ColorMapModel_".concat(e)).then((function(e){return e.getLayout()})):Promise.reject()}(e,{layout:t.layout,app:t.app})})).getMeasure((function(e,t){return function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():r&&r.getMeasure?r.getMeasure(e).then((function(e){return e.getMeasure()})):Promise.reject()}(e,{layout:t.layout,app:t.app})})).getAttributeDimension((function(e,t){return function(e,t){var n=t.layout,r=t.model,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():r&&r.session&&i?r.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(rt):Promise.reject()}(e,{layout:t.layout,model:t.model,app:t.app})}));return n.getSnapshotData=nt,n}({resources:e}),n={},r={},i=function(e){return r.settings||(e||console.warn("settings() called before auxiliarySettings()"),r.settings=t.settings()),r.settings},o={config:function(i){if(n=b({},i),r={},!n.key)throw new Error("Missing key");t.set(b(b({},e),n))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return r.auxiliarySettings?Promise.resolve(r.auxiliarySettings):t.getAuxiliarySettings(i(!0),e).then((function(e){return r.auxiliarySettings=e||{},r.settings=b(b({},r.settings),r.auxiliarySettings),r.scales=void 0,r.color=void 0,r.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(i())},getSnapshotData:function(e){var n=i();return t.getAuxiliaryData(n,e).then((function(e){return t.getSnapshotData(n,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=i();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=i().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(i(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,r=e.theme,i=[];if(n&&n.palettes&&r){var o=n.palettes.categorical||t.dimensionScheme,a=r.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||r.getDataColorPalettes()[0];o&&a&&i.push({key:"categorical",colors:a.colors});var s=n.palettes.metric||t.measureScheme,l=r.getDataColorScales().filter((function(e){return e.key===s}))[0]||r.getDataColorScales()[0];if(l){var u=l.colors[0]?l.colors:[[]].concat(q(l.colors.slice(1)));u=Array.isArray(u[0])?u.map((function(e){return e.slice().reverse()})):u.slice().reverse(),i.push({key:"quant",colors:u})}}return i}({coloring:i(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return r.scales=r.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,r=e.rtl,i=e.key,o=e.source,a=e.picasso,s={},l=i;if(n){var u={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(q((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(q((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var c,p=function(e){var t=e.hc,n=e.source,r=e.coloring,i={data:{extract:[{source:"dummy",field:0,filter:function(){return i.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:r.field,trackBy:r.valueAccessor,reduce:"first",props:{row:{reduce:function(){return i.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return i}({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var f=0,d={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return d[t]=f++,e[0]}}),c={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return d[e.qElemNumber]}}}}}}var m={data:p,range:n.range,domain:n.domain,explicit:u,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};s[l]=m,c&&(s["".concat(l,"Legend")]=b(b({},m),{},{data:c})),t&&t.qHasOtherValues&&c&&((c||m.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var h={data:{field:n.field},min:n.min,max:n.max};s[l]=U({},h,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=U({},h,{invert:!!r}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var g={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=g}else if("measure"===n.mode){var y={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(t=t.exclude)&&void 0!==t&&t.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=y}}return s}({hc:n.hc,coloring:i(),key:n.key,source:n.source,picasso:e.picasso}),r.scales},color:function(){return r.color=r.color||function(e){var t=e.coloring,n=e.scales,r=e.key,i=it(r),o=it("".concat(r,"IsAnOther")),a=function(e,t){var r=e.fieldType,a=e.invalid,s=e.mode,l=e.nil,u=e.others,c=e.primary,p=e.type;return a?function(e){return at(e)||o(e)?u:l}:n[t]?function(e){return at(e)?u:ot(e)||-2===i(e)&&"dimension"===r||"NaN"===i(e)?l:o(e)?u:e.resources.scale(t)(i(e))||u}:"constant"===s?function(e){return at(e)||o(e)?u:ot(e)?l:c}:"color"===p?function(e){return at(e)||o(e)?u:ot(e)?l:i(e)||u}:null},s=a(t,r);if(t.measureOverrides){var l=it("".concat(r,"MeasureIdx")),u=t.measureOverrides.map((function(e){return e&&a(e)}));return function(e){var t=l(e);return u[t]?u[t](e):s(e)}}return s}({coloring:i(),scales:this.scales(),key:n.key}),r.color},datumProps:function(e){return function(e){var t,n,r=e.hc,i=e.coloring,o=e.scales,a=e.key,s=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=a,c=i.nil;"field"===i.mode&&i.field?t=i.field:o[a]&&"field"===i.mode&&(t=o[a].data.field||i.field),t?(n={field:t,reduce:"first"},"color"===i.type&&(n.value=function(e){return"NaN"!==e.qNum?function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")}(e.qNum):e.qText&&he(e.qText)?e.qText:c})):"dimension"===i.mode?n=void 0!==i.field?i.field:r.qDimensionInfo.length-1:"measure"===i.mode&&(n=l);var p=y({},u,n);return r.qDimensionInfo.length>1&&(p["".concat(u,"IsAnOther")]={fields:r.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),s&&(p["".concat(u,"MeasureIdx")]=l),p}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:i().measureOverrides},e)},data:function(){var e=i(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,r=e.key,o=e.viewState,a=e.chart,s=e.rtl,l=e.styleReference,u=void 0===l?"object.legend":l,c=e.styleOverrides,p=e.settings,f=void 0===p?{}:p,d=e.style,m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return dt({eventName:t,key:r,rtl:s,viewState:o,chart:a,styleReference:u,styleOverrides:c,settings:f,style:void 0===d?{}:d},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},m)}};return o}var ht=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function gt(e){var t=e.qHyperCube,n=t.qDimensionInfo,r=t.qMeasureInfo,i=n.some(ht),o=r.some(ht),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!i?"off":a}var yt=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function vt(e){var t,n=e.qHyperCube.qDimensionInfo.some(yt),r=e.qHyperCube.qMeasureInfo.some(yt),i=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=i?i:r?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var bt=function(){};function xt(e){var t,n,r,i,o=e.picasso,a=e.model,s=e.app,l=e.translator,u=e.layoutService,c=void 0===u?void 0:u,p=e.createConfig,f=void 0===p?bt:p,d=e.config,m=void 0===d?{}:d,h=e.custom,g=void 0===h?{}:h,y=m.localeInfo,v=m.key,x=m.theme,q=void 0===x?void 0:x,D=m.auto,S=void 0===D?void 0:D,M=m.definitionPath,A=null==c||null===(t=c.getLayout)||void 0===t?void 0:t.call(c),w={theme:q,key:v,localeInfo:y,layout:A,hc:null==c||null===(n=c.getHyperCube)||void 0===n?void 0:n.call(c),legendProps:null==c||null===(r=c.getLayoutValue)||void 0===r?void 0:r.call(c,"legend"),colorProps:b(b({},null==c||null===(i=c.getLayoutValue)||void 0===i?void 0:i.call(c,"color")),{},{useBaseColors:A?gt(A):void 0})},I=mt({picasso:o,model:a,app:s,translator:l,auto:S});!1!==S&&I.auto((function(e){return S?S({layout:e,defaultAuto:vt}):vt(e)}));var k=!1,C={getColor:function(){return I.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return I.resolveUIColor({index:t,color:n})},getData:function(){return I.data()},getDatumProps:function(e){return I.datumProps(e)},getSnapshotData:function(){return I.getSnapshotData(M)},getSettingsForMeasure:function(e){return I.settingsForMeasure(e)},getSettings:function(){return I.settings()},getLegend:function(e,t){return I.legend(e,t)},getScales:function(){return I.scales()},getPalettes:function(){return I.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return I.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return k},custom:b({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?f:e)({getUseBaseColors:gt}),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return b(b(b({},e),t),{},{colorProps:b(b({},e.colorProps),t.colorProps||{})})}(w,t);return I.config(n),I.getAuxiliarySettings(M).then((function(){k=!0}))}};return C}var qt="center",Dt="bottom";function St(e){var t=e.chart,n=e.logicalSize;if(n)return n;var r=t?t.element.getBoundingClientRect():{};return{width:r.width,height:r.height}}[{key:"NoDataExist",alignment:qt,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:qt,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:qt,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:qt},{key:"DataRangeIncludingZero",alignment:Dt},{key:"LimitedData",alignment:Dt},{key:"NegativeOrZeroValues",alignment:Dt}].reduce((function(e,t){return e[t.key]=t,e}),{});var Mt=[{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 At(e){var t=e.width,n=e.height,r=Mt.filter((function(e){return t>=e.size.width&&n>=e.size.height})).shift();return r?r.key:"SPARK"}var wt={left:"right",right:"left",top:"bottom",bottom:"top",near:"far",far:"near"};function It(e){var t=e.orientation,n=e.dock,r=e.btt,i=e.rtl,o="horizontal"===t?function(e){return"bottom"===e||"near"===e?"bottom":"top"}(n):function(e,t){var n="left"===e||"near"===e?"left":"right";return t?wt[n]:n}(n,i),a=function(e,t,n){return"vertical"===e?t?"bottom":"top":n?"right":"left"}(t,r,i);return{current:o,opposite:wt[o],start:a,end:wt[a]}}function kt(e){var t=e.chart,n=e.layoutService,r=e.config,i=void 0===r?{}:r,o=i.logicalSize,a=void 0!==o&&o,s=i.rtl,l=void 0!==s&&s,u={chart:{size:void 0,mode:void 0},x:{dock:void 0,opposite:void 0,size:void 0},y:{dock:void 0,opposite:void 0,size:void 0}},c={type:"x-y",config:b({},i),meta:u,update:function(e){u.chart.size={width:e.width,height:e.height},u.chart.mode=At(e);var t=It({orientation:"horizontal",dock:n.getLayoutValue("xAxis.dock"),btt:!1,rtl:l}),r=t.current,i=t.opposite;u.x.dock=r,u.x.opposite=i,u.x.size=e.width;var o=It({orientation:"vertical",dock:n.getLayoutValue("yAxis.dock"),btt:!0,rtl:l}),a=o.current,s=o.opposite;u.y.dock=a,u.y.opposite=s,u.y.size=e.height}};return c.update(St({chart:t,logicalSize:a})),c}var Ct="vertical",Lt="horizontal";function Et(e){var t=e.chart,n=e.layoutService,r=e.config,i=void 0===r?{}:r,o=e.typeConfig,a=void 0===o?{}:o,s=i.logicalSize,l=void 0!==s&&s,u=i.rtl,c=void 0!==u&&u,p=a.fallback===Ct?Ct:Lt,f=!!a.invert,d=a.measureAxes||[{ref:"measureAxis",name:"minor"}],m={chart:{orientation:void 0,size:void 0,mode:void 0},major:{orientation:void 0,dock:void 0,opposite:void 0,size:void 0}},h={type:"major-minor",config:b({},i),meta:m,update:function(e){m.chart.orientation=n.getLayoutValue("orientation",p),m.chart.size={width:e.width,height:e.height},m.chart.mode=At(e),m.major.orientation=function(e){var t=e.chartOrientation,n=e.invert;return e.layoutService.meta.isContinuous?Lt:n?t===Ct?Lt:Ct:t}({layoutService:n,chartOrientation:m.chart.orientation,invert:f});var t=It({orientation:m.major.orientation,dock:n.getLayoutValue("dimensionAxis.dock"),btt:!1,rtl:c}),r=t.current,i=t.opposite;m.major.dock=r,m.major.opposite=i,m.major.size=m.major.orientation===Ct?e.height:e.width,d.forEach((function(t){var r={};r.orientation=m.major.orientation===Ct?Lt:Ct;var i=It({orientation:r.orientation,dock:n.getLayoutValue("".concat(t.ref,".dock")),btt:!0,rtl:c}),o=i.current,a=i.opposite,s=i.start,l=i.end;r.dock=o,r.opposite=a,r.start=s,r.end=l,r.size=r.orientation===Ct?e.height:e.width,m[t.name]=r}))}};return h.update(St({chart:t,logicalSize:l})),h}function Nt(e){var t=e.chart,n=e.layoutService,r=e.config,i=void 0===r?{}:r,o=e.typeConfig,a=void 0===o?{}:o;return("x-y"===a.type?kt:Et)({chart:t,layoutService:n,config:i,typeConfig:a})}function Pt(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}var Ot=["__proto__","constructor"];function Ft(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!Ot.some((function(e){return r.includes(e)}))){for(var o=e,a=0;a<r.length-1;++a){var s=r[a];void 0===o[s]&&(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}}}function Tt(){var e={};return{get:function(t){return e[t]},set:function(t,n){return e[t]=n,n},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}var Rt,Vt={ERROR_CODES:[7005],DIMENSION:"qDimensionInfo",MEASURE:"qMeasureInfo"},Ht=function(e,t){return e[t].reduce((function(e,t,n){var r;return r=t,Vt.ERROR_CODES.some((function(e){var t;return e===(null===(t=r.qError)||void 0===t?void 0:t.qErrorCode)}))?e.filtered.push(n):e.reduced.push(t),e}),{reduced:[],filtered:[]})};function jt(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[]).map((function(e){var t,n=null===(t=e.qCardinalities)||void 0===t?void 0:t.qHypercubeCardinal;if(n)return n;var r=e.qStateCounts||{},i=r.qLocked,o=void 0===i?0:i,a=r.qOption,s=void 0===a?0:a,l=r.qSelected;return o+s+(void 0===l?0:l)}))}function zt(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:jt(e)}}}(e);case"K":return function(e){var t=jt(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=jt(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 _t(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function Bt(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Gt)):void 0===t&&(t=$t);for(var n,r,i,o,a,s=new Kt(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new Kt(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Wt)}function $t(e){return e.children}function Gt(e){return Array.isArray(e)?e[1]:null}function Ut(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Wt(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Kt(e){this.data=e,this.depth=this.height=0,this.parent=null}Kt.prototype=Bt.prototype={constructor:Kt,count:function(){return this.eachAfter(_t)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return Bt(this).eachBefore(Ut)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},Rt=function(e){
|
|
7
|
+
import{useElement as e,useOptions as t,useState as r,useEffect as n,useAppLayout as i,useStaleLayout as o,useTheme as a,useApp as s,useModel as l,useRect as u,useTranslator as c,useInteractionState as p,usePromise as f,onTakeSnapshot as d}from"@nebula.js/stardust";import m from"picasso-plugin-q";import h from"picasso.js";function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function y(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach(function(t){y(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}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 q(e){return function(e){if(Array.isArray(e))return g(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 D(e){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D(e)}function S(e,t){if(e){if("string"==typeof e)return g(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}var M,A="top",w="top-right",I="right",k="bottom-right",C="bottom",L="bottom-left",E="left",N="top-left";y(y(y(y(y(y(y(y(y(y(M={},"equal-equal",[A,C]),"equal-higher",[C,k]),"equal-lower",[A,w]),"equal-void",[A,C]),"higher-equal",[E,L,A,w]),"higher-higher-acute",[C,L,E,w]),"higher-higher-obtuse",[C,A]),"higher-lower-negative",[A,w,I]),"higher-lower-positive",[C,L,E]),"higher-void",[A]),y(y(y(y(y(y(y(y(y(y(M,"lower-equal",[A]),"lower-higher-negative",[A,N]),"lower-higher-positive",[k]),"lower-lower-acute",[A,N,E,w,I]),"lower-lower-obtuse",[A,C]),"lower-void",[A]),"void-equal",[A]),"void-higher",[A,C]),"void-lower",[A,C,E]),"void-void",[A]),y(M,"unclassified",[A,C,I,E,w,k,L,N]);var P="object",O=["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"],F=["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 T=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function R(e){var t=e.theme,r=e.translator,n=e.defaultValue,i=e.flags,o=[],a=t.getStyle("","","fontFamilies");return Array.isArray(a)&&a.length?o.push.apply(o,q(new Set([n].concat(q(a.map(function(e){return e.split(",").map(function(e){return e.trim()}).map(function(e){return e.replace(/\s+/g," ").trim()}).filter(Boolean).join(", ")})))))):o.push(n),[{value:"ThemeHeader",label:r.get("properties.themeFonts"),metaText:r.get("properties.theme"),groupHeader:!0}].concat(q(o.map(function(e){return T(e)})),[{value:"DefaultHeader",label:r.get("properties.allFonts"),metaText:r.get("properties.default"),groupHeader:!0}],q(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?F:O}(i).map(function(e){return T(e)})))}function V(e){var t=e.theme,r=e.translator,n=e.id,i=e.path,o=e.flags,a=function(){return t.getStyle(n,i,"fontFamily")};return{getDefaultValue:function(){return a()},getOptions:function(){return R({theme:t,translator:r,defaultValue:a(),flags:o})}}}var H=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],j=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function z(e){var t=e.theme,r=e.translator,n=e.id,i=e.path,o=function(){return t.getStyle(n,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,r=e.defaultValue,n=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?n.push.apply(n,q(new Set([r].concat(q(i))))):n.push(r),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(q(n.map(function(e){return j(e)})),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],q(H.map(function(e){return j(e)})))}({theme:t,translator:r,defaultValue:o()})}}}function _(e){var t=e.theme,r=e.translator,n=e.id,i=e.path;return{fontFamily:V({theme:t,translator:r,id:n,path:i,flags:e.flags}),fontSize:z({theme:t,translator:r,id:n,path:i})}}var B,$,G=["__proto__","constructor"],U=function(e){if(G.some(function(t){return e.includes(t)}))throw new Error("font-resolver: Forbidden property.")};var W,K=function(){if($)return B;$=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(r){if(!r||"[object Object]"!==t.call(r))return!1;var n,i=e.call(r,"constructor"),o=r.constructor&&r.constructor.prototype&&e.call(r.constructor.prototype,"isPrototypeOf");if(r.constructor&&!i&&!o)return!1;for(n in r);return void 0===n||e.call(r,n)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,r){if("__proto__"===r){if(!e.call(t,r))return;if(n)return n(t,r).value}return t[r]};return B=function e(){var t,r,n,l,u,c,p=arguments[0],f=1,d=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},f=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});f<d;++f)if(null!=(t=arguments[f]))for(r in t)n=s(p,r),p!==(l=s(t,r))&&(m&&l&&(o(l)||(u=i(l)))?(u?(u=!1,c=n&&i(n)?n:[]):c=n&&o(n)?n:{},a(p,{name:r,newValue:e(m,c,l)})):void 0!==l&&a(p,{name:r,newValue:l}));return p},B}(),X=(W=K)&&W.__esModule&&Object.prototype.hasOwnProperty.call(W,"default")?W.default:W;function Z(e,t){return{range:function(e){var r=e.resources,n=e.data,i=r.theme.palette("categorical",0===t?n.items.length:t);return n.items.map(function(e){return i[e.value%i.length]})},valueAccessor:e.value}}function Y(e,t){return{range:function(e){var r=e.resources,n=e.data,i=r.theme.palette("categorical",0===t?n.items.length:t);return n.items.map(function(e){return i[e.row.value%i.length]})},valueAccessor:e.value}}function J(e,t,r,n,i){var o,a,s=i.byRow,l=i.byElemNo;if(n&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===r.activeDimensionIndex&&e.hc.qSize.qcy>((null===(a=(o=e.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===a?void 0:a.qArea.qHeight)||0)))return l(n,n.raw().qCardinal);if(n){var u=t.pic.extract({field:n.key(),trackBy:n.value}).length;return s(n,u)}return{}}function Q(e,t){var r=e.hc.qDimensionInfo,n=t.input.byDimDef||{activeDimensionIndex:r.length-1};if(n.activeDimensionIndex>=0){var i=r[n.activeDimensionIndex];n=i.coloring&&i.coloring.colorMapRef?{type:"libraryItem",key:i.coloring.colorMapRef,activeDimensionIndex:n.activeDimensionIndex}:{activeDimensionIndex:n.activeDimensionIndex}}return n}function ee(e,t){var r;return t.activeDimensionIndex>=0?r=e.pic.fields().filter(function(e){return"dimension"===e.type()})[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(r=t.key?e.pic.field(function(e){return e.raw().colorMapRef===t.key}):void 0)&&(r=e.pic.field(function(e){return"colorByAlternative"===e.raw().id})):"expression"===t.type&&(r=e.pic.field(function(e){return"colorByAlternative"===e.raw().id})),r}function te(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function re(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function ne(){}var ie=.7,oe=1/ie,ae="\\s*([+-]?\\d+)\\s*",se="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",le="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ue=/^#([0-9a-f]{3,8})$/,ce=new RegExp(`^rgb\\(${ae},${ae},${ae}\\)$`),pe=new RegExp(`^rgb\\(${le},${le},${le}\\)$`),fe=new RegExp(`^rgba\\(${ae},${ae},${ae},${se}\\)$`),de=new RegExp(`^rgba\\(${le},${le},${le},${se}\\)$`),me=new RegExp(`^hsl\\(${se},${le},${le}\\)$`),he=new RegExp(`^hsla\\(${se},${le},${le},${se}\\)$`),ge={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 ye(){return this.rgb().formatHex()}function ve(){return this.rgb().formatRgb()}function be(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=ue.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?xe(t):3===r?new Me(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?qe(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?qe(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=ce.exec(e))?new Me(t[1],t[2],t[3],1):(t=pe.exec(e))?new Me(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=fe.exec(e))?qe(t[1],t[2],t[3],t[4]):(t=de.exec(e))?qe(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=me.exec(e))?Le(t[1],t[2]/100,t[3]/100,1):(t=he.exec(e))?Le(t[1],t[2]/100,t[3]/100,t[4]):ge.hasOwnProperty(e)?xe(ge[e]):"transparent"===e?new Me(NaN,NaN,NaN,0):null}function xe(e){return new Me(e>>16&255,e>>8&255,255&e,1)}function qe(e,t,r,n){return n<=0&&(e=t=r=NaN),new Me(e,t,r,n)}function De(e){return e instanceof ne||(e=be(e)),e?new Me((e=e.rgb()).r,e.g,e.b,e.opacity):new Me}function Se(e,t,r,n){return 1===arguments.length?De(e):new Me(e,t,r,null==n?1:n)}function Me(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function Ae(){return`#${Ce(this.r)}${Ce(this.g)}${Ce(this.b)}`}function we(){const e=Ie(this.opacity);return`${1===e?"rgb(":"rgba("}${ke(this.r)}, ${ke(this.g)}, ${ke(this.b)}${1===e?")":`, ${e})`}`}function Ie(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ke(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ce(e){return((e=ke(e))<16?"0":"")+e.toString(16)}function Le(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Ne(e,t,r,n)}function Ee(e){if(e instanceof Ne)return new Ne(e.h,e.s,e.l,e.opacity);if(e instanceof ne||(e=be(e)),!e)return new Ne;if(e instanceof Ne)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(r-n)/s+6*(r<n):r===o?(n-t)/s+2:(t-r)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Ne(a,s,l,e.opacity)}function Ne(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function Pe(e){return(e=(e||0)%360)<0?e+360:e}function Oe(e){return Math.max(0,Math.min(1,e||0))}function Fe(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}te(ne,be,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ye,formatHex:ye,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Ee(this).formatHsl()},formatRgb:ve,toString:ve}),te(Me,Se,re(ne,{brighter(e){return e=null==e?oe:Math.pow(oe,e),new Me(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?ie:Math.pow(ie,e),new Me(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Me(ke(this.r),ke(this.g),ke(this.b),Ie(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:Ae,formatHex:Ae,formatHex8:function(){return`#${Ce(this.r)}${Ce(this.g)}${Ce(this.b)}${Ce(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:we,toString:we})),te(Ne,function(e,t,r,n){return 1===arguments.length?Ee(e):new Ne(e,t,r,null==n?1:n)},re(ne,{brighter(e){return e=null==e?oe:Math.pow(oe,e),new Ne(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?ie:Math.pow(ie,e),new Ne(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,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Me(Fe(e>=240?e-240:e+120,i,n),Fe(e,i,n),Fe(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Ne(Pe(this.h),Oe(this.s),Oe(this.l),Ie(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=Ie(this.opacity);return`${1===e?"hsl(":"hsla("}${Pe(this.h)}, ${100*Oe(this.s)}%, ${100*Oe(this.l)}%${1===e?")":`, ${e})`}`}}));const Te=Math.PI/180,Re=180/Math.PI,Ve=.96422,He=.82521,je=4/29,ze=6/29,_e=3*ze*ze,Be=ze*ze*ze;function $e(e){if(e instanceof Ge)return new Ge(e.l,e.a,e.b,e.opacity);if(e instanceof Ze)return Ye(e);e instanceof Me||(e=De(e));var t,r,n=Xe(e.r),i=Xe(e.g),o=Xe(e.b),a=Ue((.2225045*n+.7168786*i+.0606169*o)/1);return n===i&&i===o?t=r=a:(t=Ue((.4360747*n+.3850649*i+.1430804*o)/Ve),r=Ue((.0139322*n+.0971045*i+.7141733*o)/He)),new Ge(116*a-16,500*(t-a),200*(a-r),e.opacity)}function Ge(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function Ue(e){return e>Be?Math.pow(e,1/3):e/_e+je}function We(e){return e>ze?e*e*e:_e*(e-je)}function Ke(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Xe(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ze(e,t,r,n){this.h=+e,this.c=+t,this.l=+r,this.opacity=+n}function Ye(e){if(isNaN(e.h))return new Ge(e.l,0,0,e.opacity);var t=e.h*Te;return new Ge(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}te(Ge,function(e,t,r,n){return 1===arguments.length?$e(e):new Ge(e,t,r,null==n?1:n)},re(ne,{brighter(e){return new Ge(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Ge(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,r=isNaN(this.b)?e:e-this.b/200;return new Me(Ke(3.1338561*(t=Ve*We(t))-1.6168667*(e=1*We(e))-.4906146*(r=He*We(r))),Ke(-.9787684*t+1.9161415*e+.033454*r),Ke(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}})),te(Ze,function(e,t,r,n){return 1===arguments.length?function(e){if(e instanceof Ze)return new Ze(e.h,e.c,e.l,e.opacity);if(e instanceof Ge||(e=$e(e)),0===e.a&&0===e.b)return new Ze(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Re;return new Ze(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Ze(e,t,r,null==n?1:n)},re(ne,{brighter(e){return new Ze(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Ze(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Ye(this).rgb()}}));var Je=e=>()=>e;function Qe(e,t){var r=t-e;return r?function(e,t){return function(r){return e+r*t}}(e,r):Je(isNaN(e)?t:e)}var et=function e(t){var r=function(e){return 1===(e=+e)?Qe:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):Je(isNaN(t)?r:t)}}(t);function n(e,t){var n=r((e=Se(e)).r,(t=Se(t)).r),i=r(e.g,t.g),o=r(e.b,t.b),a=Qe(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return n.gamma=e,n}(1),tt=/^class(-pyramid)?/,rt=function(e,t,r,n){var i=void 0!==r.min?r.min:n.min(),o=void 0!==r.max?r.max:n.max(),a=i,s=o,l=t.limits,u={},c="percent"===t.limitType?l.map(function(e){return i+(o-i)*e}):l,p=t.colors.map(function(t){return e.resolveUIColor(t)});if(i=Math.min.apply(Math,[i].concat(q(c))),o=Math.max.apply(Math,[o].concat(q(c))),u.min=i,u.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))u.type="categorical",Object.assign(u,function(e){var t=e.min,r=e.max,n=e.limits,i=e.range,o=[],a=[];if(n.length)if(n[n.length-1]<t)a.push(t,r),o.push(i[i.length-1],i[i.length-1],i[i.length-1]);else if(n[0]>r)a.push(t,r),o.push(i[0],i[0],i[0]);else{if(n[0]>t)a.push(t),o.push(i[0]);else{a.push(t);for(var s=0;s<n.length;s++)if(t<n[s]){o.push(i[s]);break}}for(var l=0;l<n.length;l++)t<n[l]&&n[l]<r&&(a.push(n[l]),o.push(i[l]));if(n[n.length-1]<r)a.push(r),o.push(i[n.length]),o.push(i[n.length]);else{a.push(r);for(var u=0;u<n.length;u++)if(n[u]>r){o.push(i[u]),o.push(i[u]);break}}}else o.push(i[0]);return{min:t,max:r,range:o,domain:a}}({min:"percent"===t.limitType?i:a,max:"percent"===t.limitType?o:s,range:p,limits:"percent"===t.limitType?c:l}));else if(t.breakTypes){var f=t.breakTypes;u.type="continuous",u.domain=[i],u.range=[p[0]];for(var d=0;d<c.length;d+=1)if(f[d]){var m=p[d],h=p[d+1],g=et(m,h)(.5);u.range.push(g),u.domain.push(c[d]),d<c.length-1&&f[d+1]&&(u.range.push(p[d+1]),u.domain.push((c[d]+c[d+1])/2))}else u.range.push(p[d]),u.range.push(p[d+1]),u.domain.push(c[d]),u.domain.push(c[d]+Math.min(1e-6,(o-i)/1e6));u.range.push(p[p.length-1]),u.domain.push(o)}else u.domain=c,u.range=p;return u};function nt(e,t,r,n,i){var o,a,s,l=0,u=[],c=(e-t)/(n+1);if(0===c)return 1;for(o=0;o<r.length;o+=1)a=.99*(r[o]-t),s=r[o]>e?Math.floor(e/c):r[o]<t?0:Math.floor(a/c),Number.isNaN(s)||(u[s]?u[s]+=1:u[s]=1);for(o=0;o<u.length;o+=1)u[o]&&(l+=1);return l<=n||l>=i?Math.max(l,n):nt(e,t,r,n+1,i)}var it=function(e,t,r,n){var i,o,a=t.theme,s=t.hc,l=n.f,u={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:r.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},c=[],p=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(p=!("S"===(i=r.pic.raw()).qMode&&(i.qDataPages[0]&&i.qSize.qcy>i.qDataPages[0].qArea.qHeight||!i.qDataPages.length&&i.qSize.qcy>0)||"K"===i.qMode&&i.qStackedDataPages[0]&&i.qSize.qcy>i.qStackedDataPages[0].qArea.qHeight||"T"===i.qMode&&i.qSize.qcy>i.qTreeDataPages[0].qGroupSize))&&(c=r.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,q(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===r.input.autoMinMax){if(u.min=r.input.measureMin,u.max=r.input.measureMax,u.max<u.min)return{invalid:!0}}else if(l&&!p)u.min=l.min(),u.max=l.max();else if(l){if(!c.length)return{invalid:!0};u.min=Math.min.apply(Math,q(c)),u.max=Math.max.apply(Math,q(c))}if(r.input.measureScheme&&(u.palettes={quant:r.input.measureScheme}),a){var f=a.getDataColorScales().filter(function(e){return e.key===r.input.measureScheme})[0];u.type=f&&tt.test(f.type)?"categorical":"continuous","categorical"===u.type&&(o=f.colors.some(function(e){return Array.isArray(e)})?Math.max.apply(Math,q(f.colors.map(function(e){return e?e.length:0}))):f.colors.length)}if("categorical"===u.type){for(var d=p?nt(u.max,u.min,c,1,o):o,m=(u.max-u.min)/d,h=[],g=0;g<d+1;g+=1)h.push(u.min+m*g);u.domain=h,u.range=function(e){for(var t=e.resources.theme.palette("quant",d),r=Math.max(1,Math.floor(t.length/d)),n=[],i=0;i<d;i+=1)n.push(t[i*r]);return[n[0]].concat(n,[n[n.length-1]])}}return u};function ot(e,t){var r;return t.activeMeasureIndex>=0?r=e.pic.fields().filter(function(e){return"measure"===e.type()})[t.activeMeasureIndex]:"libraryItem"===t.type?r=e.pic.field(function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key}):"expression"===t.type&&(r=e.pic.field(function(e){return"colorByAlternative"===e.raw().id})),r||(r=e.pic.field(function(e){return void 0!==e.raw().matchMeasure}))&&(r=e.pic.fields().filter(function(e){return"measure"===e.type()})[r.raw().matchMeasure]),r}function at(e){e.measureOverrides.every(function(e){return!e})&&(e.measureOverrides=null)}function st(e,t){for(var r=(null==t?void 0:t.domain)||[],n=(null==t?void 0:t.range)||[],i=[],o=0;o<e.length;++o){var a=e[o];if("constant"===(null==a?void 0:a.mode)){var s=r.indexOf(o);-1===s?(r.push(o),n.push(a.primary)):n[s]=a.primary,e[o]=null}else if(a){i.push(o);var l=r.indexOf(o);-1!==l&&(r.splice(l,1),n.splice(l,1))}}return{domain:r,range:n,exclude:i}}function lt(e,t,r,n){var i,o=function(e,t,r,n){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,r){var n=t.theme,i=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?ot:o,s=r.input.byMeasureDef||{activeMeasureIndex:0},l=a(r,s),u=it(0,{theme:n,hc:i},r,{f:l});if(u.invalid)return u;"expression"===s.type&&(s.activeMeasureIndex<0||void 0===s.activeMeasureIndex)&&(u.label=s.label,l&&"color.altLabel"===l.raw().labelExpRef&&(u.label=r.input.altLabel)),!u.label&&l&&(u.label=l.title());var c=s.activeMeasureIndex>=0?l:null;if(!c&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(c=r.pic.fields().filter(function(e){return"measure"===e.type()})[l.raw().matchMeasure]),r.input.useMeasureGradient&&"libraryItem"===s.type)if(c){var p=c.raw().coloring;p&&p.gradient&&X(u,rt(e,p.gradient,u,c))}else u.auxiliary=s;return u}(e,r,t);if("byDimension"===t.input.mode)return function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=n.getCDef,o=void 0===i?Q:i,a=n.getCByField,s=void 0===a?ee:a,l=n.getPersistence,u=void 0===l?J:l,c=o(t,r),p=s(r,c),f=p?p.raw():{},d=r&&r.pic?r.pic.raw():{};if(f.qError||f.qSize&&0===f.qSize.qcy&&!d.qHasOtherValues)return{invalid:!0};var m={mode:"field",fieldType:"dimension",type:"categorical",field:p?p.key():void 0,isFieldLocked:f.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(m.label=c.label,"color.altLabel"===f.labelExpRef&&(m.label=r.input.altLabel)),!m.label&&p&&(m.label=p.title()),r.input.dimensionScheme&&(m.palettes={categorical:r.input.dimensionScheme}),r.input.useDimColVal&&"libraryItem"===c.type&&(m.auxiliary=c),X(m,u(t,r,c,p,{byRow:Y,byElemNo:Z})),m}(e,r,t);if("byExpression"===t.input.mode)return function(e,t,r,n){var i=t.hc,o=t.theme,a=t.translator,s=r.pic.field(function(e){return"colorByExpression"===e.raw().id});if(!s||!s.raw().qFallbackTitle&&!r.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||r.input.expressionIsColor))return{mode:"constant",type:"constant",primary:n.nil};if(r.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=it(0,{hc:i,theme:o},r,{f:s});return l.invalid||(l.label=r.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,r,t,n);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,r,n){var i=t.hc,o=t.theme,a=t.translator,s=r.input.useBaseColors;if(("byMultiple"===r.input.mode||"primary"===r.input.mode&&"measure"===r.input.useBaseColors)&&i.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],u=[];"measure"===r.input.useBaseColors&&i.qMeasureInfo.forEach(function(t,r){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(r);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?u.push(n.primary):u.push(i)}});var c=r.input.dimensionScheme?{categorical:r.input.dimensionScheme}:void 0,p=o?o.getDataColorPalettes()[0]:void 0;return"measure"===r.input.useBaseColors&&p&&(c={categorical:p.key}),{mode:"measure",type:"categorical",palettes:c,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:u}:void 0}}if("dimension"===s){var f=[],d=[];return i.qDimensionInfo.forEach(function(t,r){if(t.baseColor||t.coloring&&t.coloring.baseColor){f.push(r);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?d.push(n.primary):d.push(i)}}),{mode:"dimension",type:"categorical",field:f.length?f[0]:void 0,explicit:f.length?{domain:f,range:d}:void 0}}var m=n.primary;if(void 0!==r.input.paletteColor)r.input.paletteColor&&(m=e.resolveUIColor(r.input.paletteColor));else{var h=r.input.singleColor;"number"!=typeof h||Number.isNaN(h)||(m=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][h])}return{mode:"constant",type:"constant",primary:m}}(e,r,t,n)}return{}}(e,t,r,n);return null!==(i=t.input)&&void 0!==i&&i.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map(function(r,i){return function(e){var t,r=e.cm,n=e.defaults,i=e.index,o=e.input,a=e.pic;if(!o||!o.on)return null;var s=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===s?function(e,t,r){var n=r.primary;return void 0!==t.paletteColor&&t.paletteColor&&(n=e.resolveUIColor(t.paletteColor)),b(b({},r),{},{mode:"constant",type:"constant",primary:n})}(r,o,n):"byExpression"===s?function(e,t,r){var n="qMeasureInfo/".concat(e,"/"),i=t.field(function(e){return e.id().startsWith(n)&&"colorByMeasureExpression"===e.raw().id}),o=i;return b(b({},r),{},o?{mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:r.nil})}(i,a,n):null}({cm:e,input:r,defaults:n,index:i,pic:t.pic})}),function(e,t){var r,n,i,o=t.translator;if(at(e),1===(null===(r=e.measureOverrides)||void 0===r?void 0:r.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=st(e.measureOverrides,e.explicit),at(e)),null!==(n=e.measureOverrides)&&void 0!==n&&n.every(function(e){return"constant"===(null==e?void 0:e.mode)})){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=st(e.measureOverrides),a}return null!==(i=e.measureOverrides)&&void 0!==i&&i.every(function(e){return e})?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,r)):o}var ut=function(e,t){var r=e.fieldType,n={};if(t)if("measure"===r){var i=t.coloring;i&&(n.measureGradient=i.gradient)}else if("dimension"===r){var o=t[0],a=t[1];o&&(n.legendDataPage=o),a&&(n.dimValsData=a.colorMap)}return n},ct=function(e){throw e.isHandled=!0,e};function pt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,r=function(e){var t=b({hc:null,colorProps:null,layout:null,theme:null},e),r={},n={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},i={auto:function(e){return e?(n.auto=e,i):n.auto},getDimensionColorMap:function(e){return e?(n.getDimensionColorMap=e,i):n.getDimensionColorMap},getAttributeDimension:function(e){return e?(n.getAttributeDimension=e,i):n.getAttributeDimension},getMeasure:function(e){return e?(n.getMeasure=e,i):n.getMeasure},set:function(e){var i;if(!e.colorProps)throw new Error('Missing "colorProps"');if(X(t,e),(r={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=n.auto(e.layout);r.input=X(!0,{},r.input,o,{auto:!1});var a=t.theme?t.theme.getDataColorPalettes():[];a[0]&&(r.input.dimensionScheme=a[0].key);var s=0;r.input.byDimDef&&+r.input.byDimDef.activeDimensionIndex>=0&&(s=+r.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[s]&&t.hc.qDimensionInfo[s].coloring&&t.hc.qDimensionInfo[s].coloring.colorMapRef&&r.input.byDimDef&&(r.input.byDimDef.type="libraryItem",r.input.byDimDef.key=t.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(i=r.input.measureOverrides)&&void 0!==i&&i.every(function(e){return!e||!e.on})&&(r.input=X(!1,{},r.input,{measureOverrides:null}))},palettes:function(){if(!r.palettes){var e=t.theme,n=[];(e&&e.getDataColorPickerPalettes()||[]).forEach(function(e){n.push({key:"ui",colors:e.colors})}),r.palettes=n}return r.palettes},getAuxiliaryData:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var i=(e.auxiliary||{}).key;if("measure"===e.fieldType)return n.getMeasure(i,t).catch(function(){});if("dimension"===e.fieldType){var o="".concat(r,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?n.getAttributeDimension(o,t).catch(function(){}):Promise.resolve(),i?n.getDimensionColorMap(i,t).catch(function(){}):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,n){var i=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 o=r.pic.field(e.field);return rt(i,n.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var a={nil:e.nil,others:e.others},s=n[0],l=n[1]?n[1].colorMap:null;if(s){var u=t.picasso.data("q")({data:{qDimensionInfo:[r.pic.field(e.field).raw(),r.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:s,qInterColumnSortOrder:[0,1],qMode:"S"}});a.legendDataset=u}return l?function(e,t,r,n){var i=n.external,o=n.field,a=b({},e);X(a,Z(o,o.raw().qCardinal));var s=i.theme?i.theme.getDataColorPalettes()[0]:null;return t.nul&&(a.nil=r.resolveUIColor(t.nul)),t.oth&&(a.others=r.resolveUIColor(t.oth)),t.usePal?(a.palettes={categorical:t.pal},s&&!t.pal&&(a.palettes.categorical=s.key,X(a,Z(o)))):!1===t.autoFill&&t.single?a.range=[r.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),X(a,Z(o))),t.colors&&t.colors.length&&(a.explicit=function(e,t,r){for(var n={},i=0;i<e.length;i+=1)n[e[i].value]=e[i].baseColor;var o=[];return{domain:function(e){var i=e.data,a=[];o=[];for(var s=0;s<i.items.length;s++){var l=i.items[s],u=(l.text||l).label;n[u]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(t.resolveUIColor(n[u])))}return a.push(-3,-2),o.push(r.others),o.push(r.nil),a},range:function(){return o}}}(t.colors,r,a)),a}(a,l,i,{external:t,field:r.pic.field(e.field)}):a}return{}})):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===r.uiPalette&&(r.uiPalette=this.palettes().filter(function(e){return"ui"===e.key})[0]||!1),!r.uiPalette)return e.color;var t="none"===r.uiPalette.colors[0]?e.index:e.index-1;return void 0===r.uiPalette.colors[t]?e.color:r.uiPalette.colors[t]},settings:function(){if(this.palettes(),!r.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},n=t.theme;n&&(e=b(b({},e),n.getDataColorSpecials())),r.settings=X(e,lt(this,r,t,e))}return r.settings}};return i}(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 r=t.layout,n=t.app;return r&&r.snapshotData?r.snapshotData.content&&r.snapshotData.content.chartData&&r.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:r.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 r=t.layout,n=t.app;return r&&r.snapshotData?r.snapshotData.content&&r.snapshotData.content.chartData&&r.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:r.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 r=t.layout,n=t.model,i=t.app;return r&&r.snapshotData?r.snapshotData.content&&r.snapshotData.content.chartData&&r.snapshotData.content.chartData.legendDataPage?Promise.resolve(r.snapshotData.content.chartData.legendDataPage):Promise.reject():n&&n.session&&i?n.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(ct):Promise.reject()}(e,{layout:t.layout,model:t.model,app:t.app})});return r.getSnapshotData=ut,r}function ft(e){return function(t){return"object"===D(t.datum[e])?t.datum[e].value:void 0}}function dt(e){return"object"===D(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function mt(e){return-3===e.datum.value}var ht={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},gt={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},yt="legend.title",vt="legend.label";function bt(e){var t=e.theme,r=e.key,n=e.styleOverrides,i={title:{color:ht.COLOR,fontSize:ht.FONT_SIZE,fontFamily:ht.FONT_FAMILY},label:{color:gt.COLOR,fontSize:gt.FONT_SIZE,fontFamily:gt.FONT_FAMILY}};if(!t&&!n)return i;var o=n||{},a=o.title,s=o.label,l=function(e){var t=e.theme,r=e.key;return function(e,n,i,o){return void 0!==e?e:t?t.getStyle(r,n,i):o}}({theme:t,key:r});return i.title.color=l(null==a?void 0:a.color,yt,"color",ht.COLOR),i.title.fontSize=l(null==a?void 0:a.fontSize,yt,"fontSize",ht.FONT_SIZE),i.title.fontFamily=l(null==a?void 0:a.fontFamily,yt,"fontFamily",ht.FONT_FAMILY),i.label.color=l(null==s?void 0:s.color,vt,"color",gt.COLOR),i.label.fontSize=l(null==s?void 0:s.fontSize,vt,"fontSize",gt.FONT_SIZE),i.label.fontFamily=l(null==s?void 0:s.fontFamily,vt,"fontFamily",gt.FONT_FAMILY),i}var xt=function(e,t,r){var n=e&&e.dock||void 0;if("auto"!==n)return n||"right";if(t){var i=t.element.getBoundingClientRect();if(i.height>i.width)return"bottom"}return r?"left":"right"},qt=function(e,t,r){return!(r.invalid||"color"===r.type||"measure"===r.mode&&t.qMeasureInfo.length<=1||"dimension"===r.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function Dt(e,t){var r=e.styleReference,n=e.styleOverrides,i=e.chart,o=e.rtl,a=t.legendProps,s=t.coloring,l=t.theme,u=t.hc,c=bt({theme:l,key:r,styleOverrides:n});return{layout:{minimumLayoutMode:"MEDIUM",dock:xt(a,i,o)},show:"function"==typeof a.show?function(){return qt(a,u,s)}:qt(a,u,s),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==a.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:s.label||"",fill:c.title.color,fontSize:c.title.fontSize,fontFamily:c.title.fontFamily}}}}function St(e,t,r){var n=[],i=[],o=function(e,t,r){return"categorical"===t.coloring.type?function(e,t,r){var n=Dt(e,t);if(!n.show)return!1;var i,o=e.key,a=e.styleReference,s=e.styleOverrides,l=e.viewState,u=e.rtl,c=e.settings,p=e.style,f=t.scaleKey,d=t.theme,m=t.scales,h=bt({theme:d,key:a,styleOverrides:s}),g=n.layout.dock,y="left"===g||"right"===g?{maxLines:2,wordBreak:"break-word"}:{},v={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===t.coloring.fieldType&&(i=function(e){return e.datum.value>=0||-3===e.datum.value});var x="".concat(f,"Legend");return X(!0,n,{type:"legend-cat",key:"".concat(o,"-cat"),scale:x in m?x:f,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(n.layout.dock)?2:1,direction:u?"rtl":"ltr",horizontal:20},item:{show:i,label:b({fill:h.label.color,fontSize:h.label.fontSize,fontFamily:h.label.fontFamily},y)},navigation:{disabled:r,button:{content:function(e,t){var r=t.direction;return e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:v[r]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:c,style:p})}(e,t,r):"continuous"===t.coloring.type&&function(e,t){var r,n=e.key,i=e.styleReference,o=e.styleOverrides,a=e.rtl,s=e.settings,l=e.style,u=t.scaleKey,c=t.theme,p="".concat(u,"Range"),f=Dt(e,t);if(!f.show)return!1;var d=bt({theme:c,key:i,styleOverrides:o}),m=f.layout.dock,h="right"===m||"left"===m,g=null===(r=t.scales)||void 0===r?void 0:r[p];return h&&g&&(g.invert=!0),X(!0,f,{type:"legend-seq",key:"".concat(n,"-seq"),settings:{fill:u,major:p,length:1,tick:{fill:d.label.color,fontSize:d.label.fontSize,fontFamily:d.label.fontFamily},title:{anchor:!a||"top"!==f.layout.dock&&"bottom"!==f.layout.dock?void 0:"right",padding:parseFloat(f.settings.title.fontSize)||16}}},{settings:s,style:l})}(e,t)}(e,t,r&&r.navigationDisabled);return n.push(o),o&&"legend-cat"===o.type&&(i.push(function(e){var t=e.key,r=e.requireFailure,n=e.recognizeWith,i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:r,recognizeWith:n,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,r){var n;if(!r)return!0;if(null!=i&&null!==(n=i.interact)&&void 0!==n&&n.enabled&&!i.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:r.center.x,y:r.center.y}).some(function(e){return e.key==="".concat(t,"-cat")}))return!1;var o=r.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,r)),i.push(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,r=e.key,n=e.requireFailure,i=e.recognizeWith,o=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(r),type:"Pan",requireFailure:n,recognizeWith:i,options:{event:t,pointers:1,threshold:10,enable:function(e,n){var i;return this.started===t||!n||!(null!=o&&null!==(i=o.interact)&&void 0!==i&&i.enabled&&!o.interact.enabled())&&this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(function(e){return e.key==="".concat(r,"-cat")})}},events:y(y(y({},"".concat(t,"start"),function(e){e.preventDefault(),this.started!==t&&(this.started=t,this.chart.component("".concat(r,"-cat")).emit("panstart",e))}),"".concat(t,"move"),function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panmove",e)}),"".concat(t,"end"),function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panend",e),this.started=!1})}}(e,r))),{interactions:i,components:n}}function Mt(e){var t=pt({resources:e}),r={},n={},i=function(e){return n.settings||(e||console.warn("settings() called before auxiliarySettings()"),n.settings=t.settings()),n.settings},o={config:function(i){if(r=b({},i),n={},!r.key)throw new Error("Missing key");t.set(b(b({},e),r))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return n.auxiliarySettings?Promise.resolve(n.auxiliarySettings):t.getAuxiliarySettings(i(!0),e).then(function(e){return n.auxiliarySettings=e||{},n.settings=b(b({},n.settings),n.auxiliarySettings),n.scales=void 0,n.color=void 0,n.auxiliarySettings})},getAuxiliaryData:function(){return t.getAuxiliaryData(i())},getSnapshotData:function(e){var r=i();return t.getAuxiliaryData(r,e).then(function(e){return t.getSnapshotData(r,e)})},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=i();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=i().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var r=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||r)}(i(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,r=e.coloring,n=e.theme,i=[];if(r&&r.palettes&&n){var o=r.palettes.categorical||t.dimensionScheme,a=n.getDataColorPalettes().filter(function(e){return e.key===o})[0]||n.getDataColorPalettes()[0];o&&a&&i.push({key:"categorical",colors:a.colors});var s=r.palettes.metric||t.measureScheme,l=n.getDataColorScales().filter(function(e){return e.key===s})[0]||n.getDataColorScales()[0];if(l){var u=l.colors[0]?l.colors:[[]].concat(q(l.colors.slice(1)));u=Array.isArray(u[0])?u.map(function(e){return e.slice().reverse()}):u.slice().reverse(),i.push({key:"quant",colors:u})}}return i}({coloring:i(),colorProps:r.colorProps,theme:r.theme})},scales:function(){return n.scales=n.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,r=e.coloring,n=e.rtl,i=e.key,o=e.source,a=e.picasso,s={},l=i;if(r){var u={override:!0,domain:r.explicit&&"function"==typeof r.explicit.domain?r.explicit.domain:[].concat(q((r.explicit||{}).domain||[]),[-3,-2]),range:r.explicit&&"function"==typeof r.explicit.range?r.explicit.range:[].concat(q((r.explicit||{}).range||[]),[r.others,r.nil])};if("field"===r.mode){if("dimension"===r.fieldType){var c,p=function(e){var t=e.hc,r=e.coloring,n={data:{extract:[{source:"dummy",field:0,filter:function(){return n.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:e.source,field:r.field,trackBy:r.valueAccessor,reduce:"first",props:{row:{reduce:function(){return n.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return n}({hc:t,source:o,coloring:r}),f=p.data;if(r.legendDataset){var d=0,m={};a.data("q")({data:t}).extract({field:r.field,trackBy:r.valueAccessor,reduce:function(e){var t=e[0];return m[t]=d++,e[0]}}),c={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return m[e.qElemNumber]}}}}}}var h={data:f,range:r.range,domain:r.domain,explicit:u,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};s[l]=h,c&&(s["".concat(l,"Legend")]=b(b({},h),{},{data:c})),t&&t.qHasOtherValues&&c&&((c||h.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===r.fieldType){var g={data:{field:r.field},min:r.min,max:r.max};s[l]=X({},g,{type:"categorical"===r.type?"threshold-color":"sequential-color",range:r.range,domain:r.domain,invert:r.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=X({},g,{invert:!!n}))}else if("color"!==r.type)throw new Error("UNUSED FIELD")}else if("dimension"===r.mode){var y={data:t.qDimensionInfo.map(function(e,t){return t}),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=y}else if("measure"===r.mode){var v={data:t.qMeasureInfo.map(function(e,t){return t}).filter(function(e){var t;return!(null!==(t=r.explicit)&&void 0!==t&&null!==(t=t.exclude)&&void 0!==t&&t.includes(e))}),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=v}}return s}({hc:r.hc,coloring:i(),key:r.key,source:r.source,picasso:e.picasso}),n.scales},color:function(){return n.color=n.color||function(e){var t=e.coloring,r=e.scales,n=e.key,i=ft(n),o=ft("".concat(n,"IsAnOther")),a=function(e,t){var n=e.fieldType,a=e.invalid,s=e.mode,l=e.nil,u=e.others,c=e.primary,p=e.type;return a?function(e){return mt(e)||o(e)?u:l}:r[t]?function(e){return mt(e)?u:dt(e)||-2===i(e)&&"dimension"===n||"NaN"===i(e)?l:o(e)?u:e.resources.scale(t)(i(e))||u}:"constant"===s?function(e){return mt(e)||o(e)?u:dt(e)?l:c}:"color"===p?function(e){return mt(e)||o(e)?u:dt(e)?l:i(e)||u}:null},s=a(t,n);if(t.measureOverrides){var l=ft("".concat(n,"MeasureIdx")),u=t.measureOverrides.map(function(e){return e&&a(e)});return function(e){var t=l(e);return u[t]?u[t](e):s(e)}}return s}({coloring:i(),scales:this.scales(),key:r.key}),n.color},datumProps:function(e){return function(e){var t,r,n=e.hc,i=e.coloring,o=e.scales,a=e.key,s=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=a,c=i.nil;"field"===i.mode&&i.field?t=i.field:o[a]&&"field"===i.mode&&(t=o[a].data.field||i.field),t?(r={field:t,reduce:"first"},"color"===i.type&&(r.value=function(e){return"NaN"!==e.qNum?(t=e.qNum,"rgba(".concat([(16711680&t)>>16,(65280&t)>>8,255&t,((4278190080&t)>>>24)/255].join(","),")")):e.qText&&be(e.qText)?e.qText:c;var t})):"dimension"===i.mode?r=void 0!==i.field?i.field:n.qDimensionInfo.length-1:"measure"===i.mode&&(r=l);var p=y({},u,r);return n.qDimensionInfo.length>1&&(p["".concat(u,"IsAnOther")]={fields:n.qDimensionInfo.map(function(e,t){return{field:"qDimensionInfo/".concat(t)}}),value:function(e){return-1!==e.indexOf(-3)}}),s&&(p["".concat(u,"MeasureIdx")]=l),p}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:r.key,hc:r.hc,addMeasureIx:i().measureOverrides},e)},data:function(){var e=i(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:r.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,n=e.key,o=e.viewState,a=e.chart,s=e.rtl,l=e.styleReference,u=void 0===l?"object.legend":l,c=e.styleOverrides,p=e.settings,f=void 0===p?{}:p,d=e.style,m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return St({eventName:t,key:n,rtl:s,viewState:o,chart:a,styleReference:u,styleOverrides:c,settings:f,style:void 0===d?{}:d},{legendProps:r.legendProps,scaleKey:r.key,coloring:i(),theme:r.theme,hc:r.hc,scales:this.scales()},m)}};return o}var At=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function wt(e){var t=e.qHyperCube,r=t.qDimensionInfo,n=t.qMeasureInfo,i=r.some(At),o=n.some(At),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!i?"off":a}var It=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function kt(e){var t,r=e.qHyperCube.qDimensionInfo.some(It),n=e.qHyperCube.qMeasureInfo.some(It),i=r?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=i?i:n?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var Ct=function(){};var Lt="center",Et="bottom";function Nt(e){var t=e.chart,r=e.logicalSize;if(r)return r;var n=t?t.element.getBoundingClientRect():{};return{width:n.width,height:n.height}}[{key:"NoDataExist",alignment:Lt,condition:function(e){var t=e.layoutService;if(!t)return!1;var r=t.meta.size;return r.x*r.y===0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:Lt,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:Lt,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var r=t.getHyperCubeValue("qDimensionInfo.0");return r&&(r.qMax<r.qMin||"NaN"===r.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:Lt},{key:"DataRangeIncludingZero",alignment:Et},{key:"LimitedData",alignment:Et},{key:"NegativeOrZeroValues",alignment:Et}].reduce(function(e,t){return e[t.key]=t,e},{});var Pt=[{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 Ot(e){var t=e.width,r=e.height,n=Pt.filter(function(e){return t>=e.size.width&&r>=e.size.height}).shift();return n?n.key:"SPARK"}var Ft={left:"right",right:"left",top:"bottom",bottom:"top",near:"far",far:"near"};function Tt(e){var t=e.orientation,r=e.dock,n=e.btt,i=e.rtl,o="horizontal"===t?function(e){return"bottom"===e||"near"===e?"bottom":"top"}(r):function(e,t){var r="left"===e||"near"===e?"left":"right";return t?Ft[r]:r}(r,i),a=function(e,t,r){return"vertical"===e?t?"bottom":"top":r?"right":"left"}(t,n,i);return{current:o,opposite:Ft[o],start:a,end:Ft[a]}}function Rt(e){var t=e.chart,r=e.layoutService,n=e.config,i=void 0===n?{}:n,o=i.logicalSize,a=void 0!==o&&o,s=i.rtl,l=void 0!==s&&s,u={chart:{size:void 0,mode:void 0},x:{dock:void 0,opposite:void 0,size:void 0},y:{dock:void 0,opposite:void 0,size:void 0}},c={type:"x-y",config:b({},i),meta:u,update:function(e){u.chart.size={width:e.width,height:e.height},u.chart.mode=Ot(e);var t=Tt({orientation:"horizontal",dock:r.getLayoutValue("xAxis.dock"),btt:!1,rtl:l}),n=t.current,i=t.opposite;u.x.dock=n,u.x.opposite=i,u.x.size=e.width;var o=Tt({orientation:"vertical",dock:r.getLayoutValue("yAxis.dock"),btt:!0,rtl:l}),a=o.current,s=o.opposite;u.y.dock=a,u.y.opposite=s,u.y.size=e.height}};return c.update(Nt({chart:t,logicalSize:a})),c}var Vt="vertical",Ht="horizontal";function jt(e){var t=e.chart,r=e.layoutService,n=e.config,i=void 0===n?{}:n,o=e.typeConfig,a=void 0===o?{}:o,s=i.logicalSize,l=void 0!==s&&s,u=i.rtl,c=void 0!==u&&u,p=a.fallback===Vt?Vt:Ht,f=!!a.invert,d=a.measureAxes||[{ref:"measureAxis",name:"minor"}],m={chart:{orientation:void 0,size:void 0,mode:void 0},major:{orientation:void 0,dock:void 0,opposite:void 0,size:void 0}},h={type:"major-minor",config:b({},i),meta:m,update:function(e){m.chart.orientation=r.getLayoutValue("orientation",p),m.chart.size={width:e.width,height:e.height},m.chart.mode=Ot(e),m.major.orientation=function(e){var t=e.chartOrientation,r=e.invert;return e.layoutService.meta.isContinuous?Ht:r?t===Vt?Ht:Vt:t}({layoutService:r,chartOrientation:m.chart.orientation,invert:f});var t=Tt({orientation:m.major.orientation,dock:r.getLayoutValue("dimensionAxis.dock"),btt:!1,rtl:c}),n=t.current,i=t.opposite;m.major.dock=n,m.major.opposite=i,m.major.size=m.major.orientation===Vt?e.height:e.width,d.forEach(function(t){var n={};n.orientation=m.major.orientation===Vt?Ht:Vt;var i=Tt({orientation:n.orientation,dock:r.getLayoutValue("".concat(t.ref,".dock")),btt:!0,rtl:c}),o=i.current,a=i.opposite,s=i.start,l=i.end;n.dock=o,n.opposite=a,n.start=s,n.end=l,n.size=n.orientation===Vt?e.height:e.width,m[t.name]=n})}};return h.update(Nt({chart:t,logicalSize:l})),h}function zt(e){var t=e.chart,r=e.layoutService,n=e.config,i=void 0===n?{}:n,o=e.typeConfig,a=void 0===o?{}:o;return("x-y"===a.type?Rt:jt)({chart:t,layoutService:r,config:i,typeConfig:a})}function _t(e,t,r){if(void 0===e||void 0===t)return r;for(var n=t.split("."),i=e,o=0;o<n.length;++o){var a=n[o];if(void 0===i[a])return r;i=i[a]}return i}var Bt=["__proto__","constructor"];function $t(e,t,r){if(void 0!==e&&void 0!==t){var n=t.split("."),i=n[n.length-1];if(!Bt.some(function(e){return n.includes(e)})){for(var o=e,a=0;a<n.length-1;++a){var s=n[a];void 0===o[s]&&(o[s]=Number.isNaN(+n[a+1])?{}:[]),o=o[s]}void 0!==r?o[i]=r:delete o[i]}}}function Gt(){var e={};return{get:function(t){return e[t]},set:function(t,r){return e[t]=r,r},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}var Ut,Wt={ERROR_CODES:[7005],DIMENSION:"qDimensionInfo",MEASURE:"qMeasureInfo"},Kt=function(e,t){return e[t].reduce(function(e,t,r){var n;return n=t,Wt.ERROR_CODES.some(function(e){var t;return e===(null===(t=n.qError)||void 0===t?void 0:t.qErrorCode)})?e.filtered.push(r):e.reduced.push(t),e},{reduced:[],filtered:[]})};function Xt(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[]).map(function(e){var t,r=null===(t=e.qCardinalities)||void 0===t?void 0:t.qHypercubeCardinal;if(r)return r;var n=e.qStateCounts||{},i=n.qLocked,o=void 0===i?0:i,a=n.qOption,s=void 0===a?0:a,l=n.qSelected;return o+s+(void 0===l?0:l)})}function Zt(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:Xt(e)}}}(e);case"K":return function(e){var t=Xt(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=Xt(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 Yt(e){var t=0,r=e.children,n=r&&r.length;if(n)for(;--n>=0;)t+=r[n].value;else t=1;e.value=t}function Jt(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=er)):void 0===t&&(t=Qt);for(var r,n,i,o,a,s=new nr(e),l=[s];r=l.pop();)if((i=t(r.data))&&(a=(i=Array.from(i)).length))for(r.children=i,o=a-1;o>=0;--o)l.push(n=i[o]=new nr(i[o])),n.parent=r,n.depth=r.depth+1;return s.eachBefore(rr)}function Qt(e){return e.children}function er(e){return Array.isArray(e)?e[1]:null}function tr(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function rr(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function nr(e){this.data=e,this.depth=this.height=0,this.parent=null}nr.prototype=Jt.prototype={constructor:nr,count:function(){return this.eachAfter(Yt)},each:function(e,t){let r=-1;for(const n of this)e.call(t,n,++r,this);return this},eachAfter:function(e,t){for(var r,n,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),r=o.children)for(n=0,i=r.length;n<i;++n)a.push(r[n]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var r,n,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),r=i.children)for(n=r.length-1;n>=0;--n)o.push(r[n]);return this},find:function(e,t){let r=-1;for(const n of this)if(e.call(t,n,++r,this))return n},sum:function(e){return this.eachAfter(function(t){for(var r=+e(t.data)||0,n=t.children,i=n&&n.length;--i>=0;)r+=n[i].value;t.value=r})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(e){for(var t=this,r=function(e,t){if(e===t)return e;var r=e.ancestors(),n=t.ancestors(),i=null;for(e=r.pop(),t=n.pop();e===t;)i=e,e=r.pop(),t=n.pop();return i}(t,e),n=[t];t!==r;)t=t.parent,n.push(t);for(var i=n.length;e!==r;)n.splice(i,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(r){r!==e&&t.push({source:r.parent,target:r})}),t},copy:function(){return Jt(this).eachBefore(tr)},[Symbol.iterator]:function*(){var e,t,r,n,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(r=0,n=t.length;r<n;++r)o.push(t[r])}while(o.length)}},Ut=function(e){
|
|
8
8
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
9
|
-
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,p,f=e.length,d=e.search(/[0-9\-\+#]/),m=d>0?e.substring(0,d):"",h=e.split("").reverse().join(""),g=h.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(d,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",y=(p=t[0]).length%l,f=p.length,b=0;b<f;b++)h+=p.charAt(b),!((b-y+1)%l)&&b<f-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),m+(n?"-":"")+r+x}},Rt({exports:{}});var Xt="'Source Sans Pro', 'Arial', 'sans-serif'",Zt="#333333",Yt="#595959",Jt="#737373",Qt="#cccccc",en="#e6e6e6";function tn(e){var t={};return[].concat(q(e),q([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",Yt],["object","axis.label.name","fontFamily",Xt],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",Qt],["object","axis.line.minor","color",en],["object","axis.title","color"],["object","axis.title","fontFamily",Xt],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",en],["object","grid.line.major","color",Qt],["object","grid.line.minor","color",en],["object","label.value","color",Yt],["object","label.value","fontFamily",Xt],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",Yt],[!1,"label.value","lightColor",en],["object","outOfRange","color","#999"],["object","legend.title","color",Zt],["object","legend.title","fontFamily",Xt],["object","legend.title","fontSize","15px"],["object","legend.label","color",Yt],["object","legend.label","fontFamily",Xt],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",Zt],["object","referenceLine.label.name","fontFamily",Xt],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",en],["object","referenceLine.outOfBounds","fontFamily",Xt],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",Jt,function(e){return"transparent"===e?Jt:e}]])).reduce((function(e,n){var r="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[r]||(t[r]=!0,e.push(n)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var nn=function(e){return e};function rn(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,a={},s=r.reduce((function(e,t){var n=x(t,2),r=n[0],i=n[1];return e[r]=i,e}),{});return o.forEach((function(e){var r=x(e,5),i=r[0],o=r[1],l=r[2],u=r[3],c=r[4],p=void 0===c?function(e){return e}:c,f=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,a=void 0===o?void 0:o;if(!t||!1===n)return a;var s=t.getStyle(n,r,i);return void 0===s?a:s}({theme:t,base:"object"===i&&n?"".concat("object",".").concat(n):i,path:o,attribute:l,defaultValue:u}),d=(s["".concat(o,".").concat(l)]||nn)(p(f));Ft(a,[o,l].filter(Boolean).join("."),d)})),i.forEach((function(e){var t=x(e,2),n=t[0],r=t[1];Ft(a,n,r)})),a}function on(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var an,sn={exports:{}};var ln=(an||(an=1,self,sn.exports=(()=>{var e={909:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,u,c,p=arguments[0],f=1,d=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},f=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});f<d;++f)if(null!=(t=arguments[f]))for(n in t)r=l(p,n),p!==(i=l(t,n))&&(m&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&a(r)?r:{},s(p,{name:n,newValue:e(m,c,i)})):void 0!==i&&s(p,{name:n,newValue:i}));return p}},8:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,u,c,p=arguments[0],f=1,d=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},f=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});f<d;++f)if(null!=(t=arguments[f]))for(n in t)r=l(p,n),p!==(i=l(t,n))&&(m&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&a(r)?r:{},s(p,{name:n,newValue:e(m,c,i)})):void 0!==i&&s(p,{name:n,newValue:i}));return p}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Ee});var e=r(229),t=r.n(e);const n=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},o=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function u(e){return s+e+l}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function p(e){return!(!e.fullAccumulation&&!e.fullRange)}function f(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function d(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function m(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function h(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function v(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function b(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var u=v(c(r[0],i),m(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(r&&2===r.length){var p=c(r[0],i),f=c(r[1],i),d=m(0),h=m(1),g=v(p,d),y=v(f,h);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function q(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const D={isFullRange:p,getNumDimensions:q,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=u(d(t));if(!n.showExcludedValues)return a;var s=b({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=m(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var p=m(0),f=m(1);return"If(Count(".concat(p,") * Count(").concat(f,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:f,getNumStepComp:function(e,t){if(!p(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return f(e,t)},getAboveCompPrefix:h,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return h(e,t)+n+g(r)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===q({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=m(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:d,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:c,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=q({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:m,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=n.qHyperCubeDef.qMeasures.find((function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null}));i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=a.OPTIONS.find((function(t){return t.value===e.decomposition}));return t?a.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find((function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[n]&&r.includes(a.EXPRESSIONS[n].toLowerCase())&&(t=n),n})),t}};function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function 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)}var A=t().bind(null,!0),w={},I=Array.isArray;function k(e){return null!=e&&!Array.isArray(e)&&"object"===M(e)}function C(e){return void 0===e}function L(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function E(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach((function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=C(e[n||t])?o:e[t],e=e[n||t]}})),e}function N(e,t){var n=!0;if(k(e)&&k(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){N(e[r],t[r])||(n=!1)})),n);if(I(e)&&I(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!N(e[r],t[r]))return!1;return!0}return e===t}w.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?A({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);N(o,a)||L(t,i)||(C(a)?r.push({op:"add",path:s,value:o}):k(o)&&k(a)?r=r.concat(w.generate(a,o,s)):I(o)&&I(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&C(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(N(t,i))return r;if(!C(t[0])&&C(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(w.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){C(t[i])&&!L(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},w.apply=function(e,t){t.forEach((function(t){var n,r,i=E(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(I(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(I(a)&&I(t.value)){var l,u=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return S(e)}(r=u)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(k(a)&&k(t.value))n=a,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!L(n,e)&&delete n[e]})),A(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var c=E(e,t.from);I(i)?i.splice(+o,0,c.splice(+s,1)[0]):(i[o]=c[s],delete c[s])}else"remove"===t.op&&(I(i)?i.splice(+o,1):delete i[o])}))},w.clone=function(e){return A({},e)},w.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},w.updateObject=function(e,t){Object.keys(e).length?w.apply(e,w.generate(e,t)):A(e,t)};const P=w,O=function(e,n,r){if(!e)return Promise.resolve();var i=P.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(i,!0)):Promise.resolve()};var F="accumulation";function T(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===F)return n[r]}function R(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===F)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var V={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const H={translationKey:"properties.modifier.accumulation",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=D.getNumStepComp(n,l),f=D.getAboveComp(n,l,c,p),d=D.getRangeComp("RangeSum",f);if(D.needDimension({modifier:n,properties:r,layout:i})){var m=D.getDimComp(u,1),h=D.getDimComp(u,0),g=D.getAggrComp(d,m,h);d=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return d},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.initModifier(e,V)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(R(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(R(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(R(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(R(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=T(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=T(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(R(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(F))return!1;var o=T(t,e);return o&&!o.disabled}};return n}};var j="movingAverage";function z(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===j)return n[r]}function _(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===j)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var B={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const $={translationKey:"properties.modifier.movingAverage",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var u=s;void 0===u&&(u=D.getNumDimensions({properties:i,layout:a}));var c=o(i,"qHyperCubeDef.qDimensions",[]),p=r.showExcludedValues&&r.nullSuppression,f=D.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:p}),d=D.getNumStepComp(r,u),m=D.getAboveComp(r,u,f,d);if(r.nullSuppression)t=D.getRangeComp("RangeAvg",m);else{var h=D.getRangeComp("RangeSum",m),g=function(e,t){var n=D.getRowNoComp(e,t);if(!D.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,u);t="".concat(h," / ").concat(g)}var y=t;if(D.needDimension({modifier:r,properties:i,layout:a})){var v=D.getDimComp(c,1),b=D.getDimComp(c,0),x=D.getAggrComp(y,v,b);y=r.showExcludedValues?D.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.initModifier(e,B)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(_(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(_(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(_(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(_(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=z(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=z(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(_(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(_(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(j))return!1;var o=z(t,e);return o&&!o.disabled}};return n}};var G="timeSeriesDecomposition";function U(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===G)return n[r]}function W(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===G)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var K={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const X={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?D.generateTSDExpression(n,t,r):t},extractInputExpression:D.extractInputExpression,initModifier:function(e,t){D.initModifier(e,K),""===e.decomposition&&t&&(e.decomposition=D.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(W(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:a.OPTIONS},steps:{refFn:function(t){return"".concat(W(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=U(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map((function(e){return e.qDef.modifiers.map((function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e})),e}))}},show:function(t){var n=U(t,e);return n&&!n.fullRange}}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(G))return!1;var o=U(t,e);return o&&!o.disabled}};return n}};var Z="difference";function Y(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===Z)return n[r]}function J(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===Z)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:D.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=D.getAboveComp(n,l,c),f="".concat(c," - ").concat(p);if(D.needDimension({modifier:n,properties:r,layout:i})){var d=D.getDimComp(u,1),m=D.getDimComp(u,0),h=D.getAggrComp(f,d,m);f=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:h}):h}return f},initModifier:function(e){Object.keys(Q).forEach((function(t){void 0===e[t]&&(e[t]=Q[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(J(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(J(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(J(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(Z))return!1;var o=Y(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,n){return 1===e?"{$<".concat(D.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ue(e,t,n){return 0===e&&t>1?"<".concat(D.getDimDefWithWrapper(n),">"):""}const ce={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:D.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=n.selectionScope,f=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=ae(t),l=se(t,n,r),u=""===s&&""===l?"":s||l,c=le(i,o),p=ue(i,o,a),f=function(e){for(var t=[],n=0;n<e;n++)t[n]=D.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(p," Aggr(").concat(u," ").concat(e,", ").concat(f,"))")}(c,p,n.field,n.value,f,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach((function(t){void 0===e[t]&&(e[t]=oe[t])}))},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var r=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(re(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(re(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,r){return function(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ue};var pe="qDef.base",fe="qDef.qDef",de="qDef.base.qDef",me="qLibraryId",he="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,de);return void 0!==t?t:o(e,fe)},getExpressionRef:function(e){return void 0!==o(e,de)?de:fe},getLibraryIdRef:function(e){return o(e,he)?he:me},getLibraryId:function(e){return o(e,he)||o(e,me)},getLabelRef:function(e){return o(e,pe)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,pe)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",qe="qDef.qLabel",De="qDef.qLabelExpression",Se="qDef.base.qLabel",Me="qDef.base.qLabelExpression",Ae="qDef.qAggrFunc",we="qDef.base.qAggrFunc",Ie={initBase:function(e,t){(t||Ie.isValid(e))&&(n(e,ve,o(e,ye)),n(e,xe,o(e,be)),n(e,Se,o(e,qe)),n(e,Me,o(e,De)))},restoreBase:function(e){Ie.isValid(e)&&(n(e,ye,o(e,ve)),n(e,be,o(e,xe)),n(e,qe,o(e,Se)),n(e,De,o(e,Me)),o(e,Ae)&&o(e,we)&&n(e,Ae,o(e,we)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),n=o(e,xe);return void 0!==t||void 0!==n}};const ke=Ie;function Ce(e){return Ce="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},Ce(e)}var Le={accumulation:H,movingAverage:$,difference:ee,normalization:ce,timeSeriesDecomposition:X};const Ee={modifiers:Le,apply:Pe,applyModifiers:Oe,cleanUpMeasure:Fe,destroy:function(e){e&&Ne[e.id]&&Ne[e.id].masterItemSubscriber&&(Ne[e.id].masterItemSubscriber&&Ne[e.id].masterItemSubscriber.unsubscribe(),delete Ne[e.id])},hasActiveModifiers:Te,getActiveModifier:Re,initBase:ke.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return Le[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return Le[e]&&Le[e].isApplicable({properties:n,layout:r})}))},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=je(e);We({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Je({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:Ve};var Ne={};function Pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,a=void 0!==i&&i,s=e.masterItem,l=!1;Ne[n.id]=Ne[n.id]||{isFirstTime:!0};var u=Ne[n.id].isFirstTime;if(Ne[n.id].isFirstTime=!1,r&&"object"===Ce(r))return Oe({model:n,properties:r});var c=n?n.layout:void 0,p=o(c,"qSelectionInfo.qInSelections");if(a||p)return Promise.resolve(l);var f=o(c,"qHyperCube.qMeasureInfo"),d=Ne[n.id].lastReloadTime;if(Ne[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Te({measures:f,layout:c})){var m=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ue({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:f,layout:c,model:n,lastReloadTime:d});return m||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return We({modifiers:je(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:f,layout:c,masterItem:s,isFirstTime:u})?n.getEffectiveProperties().then((function(e){var r=t()(!0,{},e);_e(r);var i=Qe(r);return Ke({model:n}).then((function(t){return Xe({libraryIds:i,model:n}).then((function(i){return m&&function(e){var t=e.properties;He(t).forEach((function(e){return function(e){var t=e.measure;if(Ue({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===Ce(e)&&!e.disabled){if(n++,"object"!==Ce(Le[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=Le[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&$e(t)&&D.simplifyExpression(t.qDef.base.qDef)!==D.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:r}),Oe({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:i,dimensionAndFieldList:t})}))}))})):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===Ce(e.base)}))}(f)?n.getEffectiveProperties().then((function(e){return function(e){var n=e.model,r=e.properties,i=Qe(r);return et({model:n,libraryIds:i}).then((function(){var e=t()(!0,{},r);return He(r).forEach((function(e){return Fe(e)})),Ye({oldProperties:e,newProperties:r,model:n})}))}({model:n,properties:e})})):Promise.resolve(l)}function Oe(e){var n=e.model,r=e.oldProperties,i=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,p=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),_e(i);var f=Qe(i);return et({model:n,libraryIds:f,masterItem:u}).then((function(){return function(e){var n=e.measures,r=e.properties,i=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=He(r)),!n.length)return Promise.resolve();if(!Te({measures:n,properties:r}))return n.forEach((function(e){return Fe(e)})),Promise.resolve();var l=a?void 0:Qe(r);return Ke({model:i,dimensionAndFieldList:s}).then((function(e){return Xe({libraryIds:l,model:i,libraryItemsProps:a}).then((function(i){n.forEach((function(n){We({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;ke.isValid(n)||ke.initBase(n,!0);var l=n.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach((function(e){if("object"===Ce(e)&&!e.disabled){if(s++,"object"!==Ce(Le[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Le[e.type].initModifier(e,n);var l=n.qLibraryId||c&&c.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Le[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||a.qMeasure.qLabel)&&(n.qDef.qLabel=a.qMeasure.qLabel),(n.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=a.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(n.qDef.qNumFormat=a.qMeasure.qNumFormat,n.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=a.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:a}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof Le[r.type].updateModifier&&Le[r.type].updateModifier(r,i.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:Le[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=s,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:a}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||Ve(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&Ve(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}}))}({measure:n,properties:r,libraryItemsProps:i,dimensionAndFieldList:e}),Be(n)):Fe(n)}))}))}))}({measures:a,properties:i,model:n,libraryItemsProps:c,dimensionAndFieldList:p}).then((function(){return l?Ye({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)}))}))}function Fe(e){!function(e){var t=je(e);return Array.isArray(t)&&t.some((function(e){return"object"===Ce(e)&&!e.disabled&&!Le[e.type]}))}(e)?ke.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Be(e)}function Te(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return We({modifiers:je(e),properties:n,layout:r})}))}function Re(e){var t=je(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Le[r.type]&&!r.disabled)return r}}function Ve(e){var t=Re(e);return!t||Le[t.type].enableTotalsFunction(e)}function He(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function je(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function ze(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function _e(e){He(e).forEach((function(e){return function(e){var n=Re(e);n&&(void 0!==n.outputExpression&&ze(n)!==e.qDef.qDef?delete e.qDef.base:!ke.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)}))}function Be(e){var t=je(e);Array.isArray(t)&&t.forEach((function(t){"object"===Ce(t)&&(t.disabled||!Le[t.type]&&ze(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function $e(e){return e.base||e.qDef&&e.qDef.base}function Ge(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function Ue(e){var t=e.measure,n=e.properties,r=e.layout;return!Ge(t)&&We({modifiers:je(t),properties:n,layout:r})}function We(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==Ce(e)||e.disabled||!Le[e.type])&&(void 0===i[e.type]&&(i[e.type]=Le[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function Ke(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then((function(e){i.dimensionList=e}));r.push(o);var a=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(a),Promise.all(r).then((function(){return i}))}function Xe(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),Promise.all(s).then((function(){return a}))}function Ze(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ye(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Ze)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Ze)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ze)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ze);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):O(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Je(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===Ce(e)&&!e.disabled&&Le[e.type]&&Le[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function Qe(e){var t=He(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=je(t);if(We({modifiers:r,properties:e})){var o=Ge(t);o&&n.push(o),i=i||Je({modifiers:r,properties:e})}})),o(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Ne[t.id].masterItemSubscriber=Ne[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=o(e,n)})),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function c(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),a={},t.forEach((function(e){a[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach((function(e){i[e]||a[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&s.push(c(e,"getMeasure"))})),Object.keys(a).forEach((function(e){a[e]&&!r[e]&&s.push(c(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return Pe({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),Ne[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}n.d(r,{default:()=>_e});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}const p={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:c};var f=n(8),d=n.n(f);const m=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},h=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&p.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},v=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},b=function(e){e.forEach((function(e){d().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))};function x(e,t,n){var r,i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2&&!a)return;s=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var l=o.getValue(e,"qLayoutExclude.quarantine");l[n]||(l[n]={}),l[n][t]=s}var q=n(909),D=n.n(q);function S(e,t){var n=D()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function M(e,t){return D()(!0,{},t,e)}function A(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var w=Math.pow(2,53)-1;function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const C=function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},L=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},E=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},N=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},P=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},O=function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=S(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var u=S(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},F=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=M(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var u=M(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},T=function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=A(a.max,i.dimensions.length,w),l=A(a.min,i.dimensions.length,0);return{maxDimensions:A(o.max,s,w),minDimensions:A(o.min,l,0),maxMeasures:s,minMeasures:l}},R=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(p.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,p.indexRemoved(n.qInterColumnSortOrder,o))},V=function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=D()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]})),null===(i=D()(!0,{},n,i)).components&&(i.components=[]),i},H=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},j=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},z=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return I(e)}(t=a.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return I(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?I(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qDimensions=[],s.forEach((function(e){a.qDimensions.push(e),r.dimensions.added(e,n)}))}},_=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return k(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qMeasures=[],s.forEach((function(e){a.qMeasures.push(e),r.measures.added(e,n)}))}},B=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&d().isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))};function $(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}const G={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),m({exportFormat:i,qHyperCubeDef:l}),h({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),v({exportFormat:i,properties:a}),r||b(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(x(i.properties,"filters","storedFilters",!0),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(x(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(x(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,u=e.hypercubePath,c=e.extension,p=e.supportedFilters,f=void 0===p||p,d=e.isHCModifierSupported,m=void 0===d||d,h={qChildren:[]},g=V({exportFormat:t,initialProperties:r,hypercubePath:u}),y=o.getValue(r,u||"").qHyperCubeDef,v=o.getValue(g,u||"").qHyperCubeDef,b=T({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,q=b.minDimensions,D=b.maxMeasures,S=b.minMeasures,M=l.defaultDimension,A=void 0===M?N():M,w=l.defaultMeasure,I=void 0===w?P():w;v.qDimensions.length=0,v.qMeasures.length=0,H({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S})&&j({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S,newHyperCubeDef:v}),O({exportFormat:t,maxDimensions:x,minDimensions:q,newHyperCubeDef:v,defaultDimension:A}),F({exportFormat:t,maxMeasures:D,minMeasures:S,newHyperCubeDef:v,defaultMeasure:I}),z({newProperties:g,dataDefinition:a,hypercubePath:u}),_({newProperties:g,dataDefinition:a,hypercubePath:u}),R({exportFormat:t,newHyperCubeDef:v}),L("qMaxStackedCells",y,v),L("qNoOfLeftDims",y,v),E("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),E("qMode",y,v,"S"),E("qReductionMode",y,v,"N"),E("qSortbyYValue",y,v),E("qIndentMode",y,v),E("qShowTotalsAbove",y,v),C(g,t,r),h.qProperty=g;var k=o.getValue(c||{},"support.modifiers");return B({measures:v.qMeasures,modifierTypes:k}),f&&$(h.qProperty,"storedFilters"),"S"===v.qMode&&m&&$(h.qProperty,"dynamicScript"),h}};var U={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function W(e,t,n,r){t=t||[];var i=c(e,r,n),o=c(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function K(e,t){return e.length!==t}const X={create:function(e,t){if(!e||!U[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(W(a,t,r,i),K(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},Z={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},Y={colorModeOptions:{primary:function(){return!0},dimension:function(e){return Z.getNumDimensions(e)>0&&Z.getNumMeasures(e)<=1},multiColor:function(e){return Z.getNumMeasures(e)>1},measure:function(e){return Z.getNumDimensions(e)>0},expression:function(e){return Z.getNumMeasures(e)>=1}}},J={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return Z.getNumMeasures(e)>=1}}};var Q={scatterplot:J,"sn-scatter-plot":J,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return Z.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return Z.getNumDimensions(e)>1},multiColor:function(e){return Z.getNumMeasures(e)>1},measure:function(e){return Z.getNumDimensions(e)<=1},expression:function(e){return Z.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return Z.getNumDimensions(e)>=1},multiColor:function(e){return Z.getNumMeasures(e)>1},measure:function(e){return Z.getNumDimensions(e)>=1},expression:function(e){return Z.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return Z.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=p.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=X.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})),t.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}))}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;te(r,i);var l=r[r.length-1];if(l){var u=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),f=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var d=X.create(X.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:d,label:s,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:f});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=p.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:d,measures:a,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:f})}n?(d.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(d)):l.qAttributeExpressions.push(d)}}}function ie(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":i=function(e,t){return t?e.qLibraryId:d().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return d().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,n,r){var i=t.type,o=e.color,a=o.mode,s=Z.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||Z.wrapFieldName(t.name),key:Z.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:s,key:t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}o.auto=!1,o.mode=a}function se(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,ae(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=X.IDMAP.COLOR_BY_ALTERNATIVE,a=p.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return ae(e,ie("dimension",!!a,a||r)),!!a}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ue=function(e,t){var n={primary:!0};if(e){var r=(Q[t]||Y).colorModeOptions||Y.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ce=function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},pe=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),a=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(a,l):!(n={auto:i,colorMode:r,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:i,colorMode:r,dimensions:a,measures:s,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,ae(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=X.IDMAP.COLOR_BY_ALTERNATIVE,s=p.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return ae(e,ie("measure",!!s,s||r[0])),!!s}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,a)}(e,t)},fe=function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},de=function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},me=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},he=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=G.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=X.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return X.moveByIdFromGroup(a,[],"qAttributeDimensions",u),X.moveByIdFromGroup(a,[],"qAttributeExpressions",u),X.moveByIdFromGroup(s,[],"qAttributeExpressions",c),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=G.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty,f=o.getValue(p,"visualization"),d=o.getValue(p,"qHyperCubeDef.qDimensions",[]),m=o.getValue(p,"color.mode",""),h=o.getValue(p,"color.auto",""),g=ue(p,f),y=ce({canColorBy:g,autoColor:h,colorMode:m,dimensions:d});return g[m]?de({shouldUpdateColorBy:y,properties:p})&&me(p):he(p),y&&pe(p,"qHyperCubeDef."),ge(p)&&le(p,"color.persistent",!0),fe(d),c}};var ve=["bar","marker","line"];const be=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?$(n,"unsupportedAutoMinMax")||D()(n.measureAxis,t.measureAxis):$(n,"supportedAutoMinMax")||D()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),ve.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(a);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&D()(s,n.properties.measureAxes[t[0].axis])):D()(s,n.properties.measureAxes[0])}},qe=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},De={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(x(s,"measureAxis.min","supportedAutoMinMax"),x(s,"measureAxis.max","supportedAutoMinMax")):(x(s,"measureAxis.min","unsupportedAutoMinMax"),x(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty;return be({initialProperties:n,properties:p}),xe({exportFormat:t,initialProperties:n,properties:p,measureType:a}),qe(p.qHyperCubeDef),p.qHyperCubeDef.qColumnOrder=[],p.qHyperCubeDef.columnOrder=[],c}};function Se(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Me(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var u=Se(n,r,l);o.setValue(t,u,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}function Ae(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=Se(n,r,s),u=o.getValue(t,l);void 0!==u&&(o.setValue(i,a,u),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}var we="qHyperCubeDef.qMeasures",Ie="conditionalColoring",ke="measures",Ce="qDef.conditionalColoring";const Le={quarantine:function(e){Me({properties:e,arrayPath:we,quarantineName:Ie,arrayName:ke,itemPath:Ce})},unquarantine:function(e){Ae({properties:e,arrayPath:we,itemPath:Ce,arrayName:ke,quarantineName:Ie})}};var Ee="qHyperCubeDef.qMeasures",Ne="measures",Pe="qHyperCubeDef.qDimensions",Oe="dimensions",Fe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Te="alternativeMeasures",Re="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",Ve="alternativeDimensions",He="qCalcCondition",je="conditionalShowHide";const ze={quarantine:function(e){Me({properties:e,arrayPath:Ee,quarantineName:je,arrayName:Ne,itemPath:He}),Me({properties:e,arrayPath:Pe,quarantineName:je,arrayName:Oe,itemPath:He})},unquarantine:function(e){Ae({properties:e,arrayPath:Ee,quarantineName:je,arrayName:Ne,itemPath:He}),Ae({properties:e,arrayPath:Pe,quarantineName:je,arrayName:Oe,itemPath:He})},quarantineAlternative:function(e){Me({properties:e,arrayPath:Fe,quarantineName:je,arrayName:Te,itemPath:He}),Me({properties:e,arrayPath:Re,quarantineName:je,arrayName:Ve,itemPath:He})},unquarantineAlternative:function(e){Ae({properties:e,arrayPath:Fe,quarantineName:je,arrayName:Te,itemPath:He}),Ae({properties:e,arrayPath:Re,quarantineName:je,arrayName:Ve,itemPath:He})}},_e={hypercube:G,colorChart:ye,axisChart:De,quarantineProperty:x,unquarantineProperty:$,quarantineArrayProp:Me,unquarantineArrayProp:Ae,conditionalColoring:Le,conditionalShow:ze}})(),r.default})()),sn.exports),un=on(ln);function cn(e){return{dimensions:{min:0,max:0},measures:{min:1,max:1,description:()=>e.translator.get("Visualizations.Descriptions.Gauge.Measure")}}}const pn=(e,t,n)=>{const r=function(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,a=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:i}),s=a.id,l=a.paths,u={};l.forEach((function(e){for(var r=e.split("."),i=u,a=0;a<r.length;a++){var l=r[a];a===r.length-1?i[l]=B({theme:t,translator:n,id:s,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}}));var c=function(e){for(var t=e.split("."),n=u,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return u.getDefaultValue=function(e){return c(e).getDefaultValue()},u.getOptions=function(e){return c(e).getOptions()},u}({theme:n,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:()=>r.getOptions("axis.title.fontFamily"),defaultValue:()=>r.getDefaultValue("axis.title.fontFamily")},fontColor:{ref:"axis.title.color",component:"color-picker",defaultValue:()=>({color:n.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:()=>r.getOptions("axis.label.name.fontFamily"),defaultValue:()=>r.getDefaultValue("axis.label.name.fontFamily"),width:!0},fontColor:{ref:"axis.label.name.color",component:"color-picker",defaultValue:()=>({color:n.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:()=>r.getOptions("label.value.fontFamily"),defaultValue:()=>r.getDefaultValue("label.value.fontFamily"),width:!0},fontColor:{ref:"label.value.color",component:"color-picker",defaultValue:()=>({color:n.getStyle("object.gauge","label.value","color")}),width:!1}}}}}}}}}};let fn;function dn(e){return"measure"===Pt(e,"color.useBaseColors")}function mn(e){const{flags:t,translator:n,sense:r}=e,i=null==r?void 0:r.theme,o=()=>{var e;if(!i)return-1;const{primary:t}=i.getDataColorSpecials(),n=null===(e=i.getDataColorPickerPalettes()[0])||void 0===e?void 0:e.colors,r=n.indexOf(t);return{index:-1===r?Math.min(6,n.length-1):r}};return{definition:{type:"items",component:"accordion",items:{data:{uses:"data",items:{measures:{disabledRef:""}}},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,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}},presentation:{type:"items",grouped:!0,translation:"properties.presentation",items:{styleEditor:pn(t,n,i),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,change(e){Ft(e,"disclaimerClosed",!0)}},max:{ref:"measureAxis.max",translation:"Common.Max",type:"number",expression:"optional",defaultValue:100,invalid:e=>e.measureAxis&&e.measureAxis.min>=e.measureAxis.max,change(e){Ft(e,"disclaimerClosed",!0)}}}},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"}],change(e){"radial"===e.gaugetype?(fn=e.orientation,e.orientation="horizontal"):e.orientation=fn}},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},segments:{type:"items",items:{useSegments:{ref:"useSegments",type:"boolean",component:"switch",defaultValue:!1,translation:"properties.gauge.useSegments",change(e){const t=function(e){const{paletteColors:t,colors:n}=e;return t&&t.length?t:n&&n.length?n.map((e=>({index:e.color}))):void 0}(e.segmentInfo);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:o,show(e){if(!Pt(e,"paletteProgressColor")){let t=function({progressColor:e,theme:t}){var n;const r=null===(n=t.getDataColorPickerPalettes()[0])||void 0===n?void 0:n.colors;return null!=e?void 0!==e.index&&-1!==e.index&&r[e.index]?r[e.index]:void 0!==e.color?e.color?e.color:"none":r[e]?r[e]:e||"none":"none"}({progressColor:Pt(e,"progressColor"),theme:i}),n=-1;t&&"none"!==t||(t=o(),n=t.index),Ft(e,"paletteProgressColor",{index:n,color:t})}return!dn(e)&&!e.useSegments}},segmentInfo:{ref:"segments",type:"items",component:"color-scale-creator",show:e=>!dn(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}}},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",label:(t,n)=>(t=>{let n;const r=t.getMeasureLayouts()[0];return n=r&&!r.qError?`${e.translator.get("properties.measureAxis")}: ${r.qFallbackTitle}`:e.translator.get("properties.measureAxis"),n})(n),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},importProperties:(t,n,r,i)=>un.axisChart.importProperties({exportFormat:t,initialProperties:n,hypercubePath:i,extension:r,dataDefinition:cn(e)}),exportProperties:(e,t,n)=>un.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:n,supportedAutoMinMax:!1})}}const hn={require:["chart","renderer"],renderer:"dom",render(e){var t;return function({chart:e,settings:t,h:n}){if(!e)return[];const r=function({h:e,settings:t}){if(!t)return[];const{isRtl:n,title:r,text:i}=t,o={disclaimer:{borderRadius:"10px",border:"1px solid #404040",position:"absolute",top:"10%",left:"50%",margin:"0 0 0 -150px",width:"298px",cursor:"default",background:"white",direction:n?"rtl":"ltr"},closeIcon:{position:"absolute",[n?"left":"right"]:"5px",top:"3px",cursor:"pointer",color:"#595959",pointerEvents:"auto"},dmHeader:{color:"#575859",fontSize:"18px",paddingLeft:"20px",paddingTop:"10px",paddingRight:"20px",paddingBottom:"0px",maxHeight:"44px",overflow:"hidden"},dmMain:{display:"block",color:"#575859",paddingLeft:"20px",paddingRight:"20px",paddingTop:"10px",paddingBottom:"10px"},dmP:{paddingBottom:"10px"}};return[e("div",{style:o.disclaimer},e("div",{style:o.closeIcon,onClick:()=>null==t?void 0:t.close()},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},e("defs",{},e("path",{id:"remove-a",d:"M9.41421356,8 L11.8890873,5.52512627 C12.065864,5.34834957 12.0305087,4.95944084 11.8183766,4.74730881 L11.2526912,4.18162338 C11.0405592,3.96949135 10.6516504,3.93413601 10.4748737,4.1109127 L8,6.58578644 L5.52512627,4.1109127 C5.34834957,3.93413601 4.95944084,3.96949135 4.74730881,4.18162338 L4.25233406,4.67659813 C3.96949135,4.95944084 3.93413601,5.34834957 4.1109127,5.52512627 L6.58578644,8 L4.1109127,10.4748737 C3.93413601,10.6516504 3.96949135,11.0405592 4.18162338,11.2526912 L4.67659813,11.7476659 C4.95944084,12.0305087 5.34834957,12.065864 5.52512627,11.8890873 L8,9.41421356 L10.4748737,11.8890873 C10.6516504,12.065864 11.0405592,12.0305087 11.2526912,11.8183766 L11.8183766,11.2526912 C12.0305087,11.0405592 12.065864,10.6516504 11.8890873,10.4748737 L9.41421356,8 Z M8,0 C12.4,0 16,3.6 16,8 C16,12.4 12.4,16 8,16 C3.6,16 0,12.4 0,8 C0,3.6 3.6,0 8,0 Z"})),e("use",{xlinkHref:"#remove-a"}))),e("header",{style:o.dmHeader},r),e("main",{style:o.dmMain},e("p",{style:o.dmP},i)))]}({settings:t,h:n});return r}({chart:this.chart,settings:null===(t=this.settings)||void 0===t?void 0:t.settings,h:e})}},gn=52,yn=-.7*Math.PI,vn=.7*Math.PI,bn="#EEEEEE",xn=2.38,qn={MIN:12,MAX:60},Dn={MIN:100,MAX:1e3},Sn={LEFT:4,RIGHT:4},Mn={VERTICAL_ALIGNMENT_FACTOR:.4},An={VERTICAL_ALIGNMENT_FACTOR:.5},wn=1.15,In=2,kn=1.2,Cn="#595959",Ln="#E6E6E6",En=.4,Nn=1,Pn=2,On=.15,Fn=20,Tn=150,Rn=12,Vn=8,Hn=70,jn=3,zn={MEASURE:"measure"},_n={BAR:"bar",SEGMENT_BAR:"segment-bar",LABEL_BAR:"label-bar",BACKGROUND_BAR:"background-bar",MARK:"mark",OOB_INDICATOR:"oob-indicator",BAR_AXIS:"bar-axis",AXIS_TITLE:"axis-title",GAUGE_LABEL:"gauge-label",RADIAL_AXIS:"radial-axis",RADIAL_GAUGE_NEEDLE:"radial-gauge-needle",RADIAL_OOB_INDICATOR_MIN:"radial-oob-indicator-min",RADIAL_OOB_INDICATOR_MAX:"radial-oob-indicator-max",RADIAL_GAUGE:"radial-gauge",CIRCLE_GAUGE:"circle-gauge",REFERENCE_LINES_AND_LABELS:"reference-lines-and-labels",RADIAL_SPARK:"radial-spark",RADIAL_GAUGE_LABEL:"radial-gauge-label",RADIAL_REFERENCE_LINES:"radial-reference-lines",SEGMENT_RADIAL_GAUGE:"segment-radial-gauge",LABEL_RADIAL_GAUGE:"label-radial-gauge"},Bn="color",$n=1e-4,Gn="XSMALL",Un="XSMALL_VERTICAL",Wn="XSMALL_HORIZONTAL",Kn="SMALL",Xn="MEDIUM",Zn={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}},Yn=600,Jn=200,Qn=500;function er(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function tr(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function nr(){}var rr=.7,ir=1/rr,or="\\s*([+-]?\\d+)\\s*",ar="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",sr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",lr=/^#([0-9a-f]{3,8})$/,ur=new RegExp(`^rgb\\(${or},${or},${or}\\)$`),cr=new RegExp(`^rgb\\(${sr},${sr},${sr}\\)$`),pr=new RegExp(`^rgba\\(${or},${or},${or},${ar}\\)$`),fr=new RegExp(`^rgba\\(${sr},${sr},${sr},${ar}\\)$`),dr=new RegExp(`^hsl\\(${ar},${sr},${sr}\\)$`),mr=new RegExp(`^hsla\\(${ar},${sr},${sr},${ar}\\)$`),hr={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 gr(){return this.rgb().formatHex()}function yr(){return this.rgb().formatRgb()}function vr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=lr.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?br(t):3===n?new Sr(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?xr(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?xr(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=ur.exec(e))?new Sr(t[1],t[2],t[3],1):(t=cr.exec(e))?new Sr(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=pr.exec(e))?xr(t[1],t[2],t[3],t[4]):(t=fr.exec(e))?xr(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=dr.exec(e))?Cr(t[1],t[2]/100,t[3]/100,1):(t=mr.exec(e))?Cr(t[1],t[2]/100,t[3]/100,t[4]):hr.hasOwnProperty(e)?br(hr[e]):"transparent"===e?new Sr(NaN,NaN,NaN,0):null}function br(e){return new Sr(e>>16&255,e>>8&255,255&e,1)}function xr(e,t,n,r){return r<=0&&(e=t=n=NaN),new Sr(e,t,n,r)}function qr(e){return e instanceof nr||(e=vr(e)),e?new Sr((e=e.rgb()).r,e.g,e.b,e.opacity):new Sr}function Dr(e,t,n,r){return 1===arguments.length?qr(e):new Sr(e,t,n,null==r?1:r)}function Sr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Mr(){return`#${kr(this.r)}${kr(this.g)}${kr(this.b)}`}function Ar(){const e=wr(this.opacity);return`${1===e?"rgb(":"rgba("}${Ir(this.r)}, ${Ir(this.g)}, ${Ir(this.b)}${1===e?")":`, ${e})`}`}function wr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ir(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function kr(e){return((e=Ir(e))<16?"0":"")+e.toString(16)}function Cr(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Er(e,t,n,r)}function Lr(e){if(e instanceof Er)return new Er(e.h,e.s,e.l,e.opacity);if(e instanceof nr||(e=vr(e)),!e)return new Er;if(e instanceof Er)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Er(a,s,l,e.opacity)}function Er(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Nr(e){return(e=(e||0)%360)<0?e+360:e}function Pr(e){return Math.max(0,Math.min(1,e||0))}function Or(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}er(nr,vr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:gr,formatHex:gr,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Lr(this).formatHsl()},formatRgb:yr,toString:yr}),er(Sr,Dr,tr(nr,{brighter(e){return e=null==e?ir:Math.pow(ir,e),new Sr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?rr:Math.pow(rr,e),new Sr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Sr(Ir(this.r),Ir(this.g),Ir(this.b),wr(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:Mr,formatHex:Mr,formatHex8:function(){return`#${kr(this.r)}${kr(this.g)}${kr(this.b)}${kr(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ar,toString:Ar})),er(Er,(function(e,t,n,r){return 1===arguments.length?Lr(e):new Er(e,t,n,null==r?1:r)}),tr(nr,{brighter(e){return e=null==e?ir:Math.pow(ir,e),new Er(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?rr:Math.pow(rr,e),new Er(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Sr(Or(e>=240?e-240:e+120,i,r),Or(e,i,r),Or(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Er(Nr(this.h),Pr(this.s),Pr(this.l),wr(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=wr(this.opacity);return`${1===e?"hsl(":"hsla("}${Nr(this.h)}, ${100*Pr(this.s)}%, ${100*Pr(this.l)}%${1===e?")":`, ${e})`}`}}));const Fr=Math.PI/180,Tr=180/Math.PI,Rr=.96422,Vr=.82521,Hr=4/29,jr=6/29,zr=3*jr*jr,_r=jr*jr*jr;function Br(e){if(e instanceof $r)return new $r(e.l,e.a,e.b,e.opacity);if(e instanceof Zr)return Yr(e);e instanceof Sr||(e=qr(e));var t,n,r=Kr(e.r),i=Kr(e.g),o=Kr(e.b),a=Gr((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Gr((.4360747*r+.3850649*i+.1430804*o)/Rr),n=Gr((.0139322*r+.0971045*i+.7141733*o)/Vr)),new $r(116*a-16,500*(t-a),200*(a-n),e.opacity)}function $r(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Gr(e){return e>_r?Math.pow(e,1/3):e/zr+Hr}function Ur(e){return e>jr?e*e*e:zr*(e-Hr)}function Wr(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Kr(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Xr(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Zr)return new Zr(e.h,e.c,e.l,e.opacity);if(e instanceof $r||(e=Br(e)),0===e.a&&0===e.b)return new Zr(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Tr;return new Zr(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Zr(e,t,n,null==r?1:r)}function Zr(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Yr(e){if(isNaN(e.h))return new $r(e.l,0,0,e.opacity);var t=e.h*Fr;return new $r(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function Jr(e){return function(e){return Xr(e).l<70}(e)?Ln:Cn}function Qr(e,t=!0){let n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?`M${r.x} ${r.y}`:`L${r.x} ${r.y}`,n+=" "}return t&&(n+="Z"),n}function ei(e){const{angle:t,origin:n}=e,r=e.points.map((e=>function(e,t,n={x:0,y:0}){const r=Math.cos(t),i=Math.sin(t),o=(s=n,{x:(a=e).x-s.x,y:a.y-s.y});var a,s;return function(e,t){return{x:e.x+t.x,y:e.y+t.y}}({x:r*o.x-i*o.y,y:i*o.x+r*o.y},n)}(e,t,n)));return{type:"path",fill:e.fill,d:Qr(r)}}er($r,(function(e,t,n,r){return 1===arguments.length?Br(e):new $r(e,t,n,null==r?1:r)}),tr(nr,{brighter(e){return new $r(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new $r(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new Sr(Wr(3.1338561*(t=Rr*Ur(t))-1.6168667*(e=1*Ur(e))-.4906146*(n=Vr*Ur(n))),Wr(-.9787684*t+1.9161415*e+.033454*n),Wr(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),er(Zr,Xr,tr(nr,{brighter(e){return new Zr(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Zr(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Yr(this).rgb()}}));const ti={require:["chart"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t}){if(!e||!t)return[];const{size:n,component:r,selector:i,pointingTo:o,isRtl:a,width:s,height:l}=t;if(!e.component(t.component))return[];const u=e.findShapes(i).filter((e=>e.key===r));if(null==u||!u.length)return[];let c=s/2,p=l/2,f=-Math.PI/2;const d=n/3;switch(o){case"top":p=d;break;case"bottom":p=l-d,f=3*Math.PI/2-Math.PI;break;case"right":c=s-d,f=0;break;case"left":c=d,f=Math.PI}const m=[];for(let e=0;e<u.length;e+=1){const t=u[e];let i=["top",...a?["left"]:["right"]].includes(o)?t.attrs.fill:bn;if(r===_n.SEGMENT_BAR){const{stops:e}=t.attrs.fill;if(["top","right"].includes(o)){const t=e.find((e=>1===e.offset));i=(null==t?void 0:t.color)||Cn}else{const t=e.toReversed().find((e=>0===e.offset));i=(null==t?void 0:t.color)||Cn}}const s=Jr(i),l={x:c,y:p},d=n/6,h=ei({points:[{x:l.x+2*d,y:l.y},{x:l.x,y:l.y+d},{x:l.x,y:l.y-d}],angle:f,fill:s,origin:l});m.push(h)}return m}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings})}};function ni({services:e}){var t;const{colorService:n,layoutService:r,themeService:i}=e,{useBaseColors:o}=r.getLayout().color||{},{baseColor:a}=(null===(t=r.getLayout().qHyperCube)||void 0===t?void 0:t.qMeasureInfo[0].coloring)||{};if("off"===o)return n.getColor();let s;if(!a)return n.getColor();{var l,u,c;const e=(null===(l=i.getTheme().getDataColorPickerPalettes()[0])||void 0===l?void 0:l.colors)||[];s=null!==(u=a.color)&&void 0!==u?u:Cn;const t=null!==(c=a.index)&&void 0!==c?c:-1;e.length>0&&t>-1&&t<e.length&&(s=e[t])}return()=>s}function ri(e,t,n,r){const i=Math.floor(Math.min(e,t)),o=Math.abs(r-n),a=.02*Math.tan(-o/4+Math.PI/2),s=2*(.4+a)-2*si(e,t)/i;return{innerRadius:s-2*(i>500?50:Math.max(i/Qn*50,10))/i,outerRadius:s,radiusIncrease:a,labelGaugeRadius:1.39*(.4+a)}}function ii(e,t,n,r){const i=r-Math.PI/2;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function oi({innerRadius:e,outerRadius:t,width:n,height:r}){return(t-e)*Math.min(n,r)/2}function ai(e){return!1!==e.show&&0!==e.show&&"0"!==e.show}function si(e,t){return Math.min(6,Math.min(e,t)/Jn)}function li(e,t){return 4*ri(e,t,yn,vn).radiusIncrease*Math.min(e,t)}const ui={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:n}){if(!e||!t||!n)return[];if(!e.component(t.component))return[];const{valueAngle:r,width:i,height:o}=t,{outerRadius:a,innerRadius:s}=ri(i,o,yn,vn),l=oi({innerRadius:s,outerRadius:a,width:i,height:o}),u=i/2,c=o/2,p=a*Math.min(i,o)/2,f=ii(u,c,p,t.valueAngle),d=f.x,m=f.y,h=[],g=bn,y=t.fill||Jr(g),v={x:d,y:m},b=l/6,x=[{x:v.x+.3*b,y:v.y},{x:v.x-7.5*b,y:v.y+b},{x:v.x-7.5*b,y:v.y-b}],q=r-Math.PI/2,D=ei({points:x,angle:q,fill:y,origin:v});return D.data={pointerWidth:b,angle:q,radius:p,fill:y},h.push(D),h}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}};const ci={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:n}){if(!e||!t||!n)return[];const{size:r,component:i,selector:o,angle:a,radius:s,width:l,height:u}=t;if(!e.component(t.component))return[];const c=e.findShapes(o).filter((e=>e.key===i));if(null==c||!c.length)return[];const p=l/2,f=u/2,{x:d,y:m}=ii(p,f,s,a),h=[],g=t.fill,y=a===yn?-1:1,v={x:d,y:m},b=r/6,x=ei({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:a,fill:g,origin:v});return h.push(x),h}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}};var pi,fi;var di=function(){if(fi)return pi;fi=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},a=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},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return pi=function e(){var t,n,r,l,u,c,p=arguments[0],f=1,d=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},f=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});f<d;++f)if(null!=(t=arguments[f]))for(n in t)r=s(p,n),p!==(l=s(t,n))&&(m&&l&&(o(l)||(u=i(l)))?(u?(u=!1,c=r&&i(r)?r:[]):c=r&&o(r)?r:{},a(p,{name:n,newValue:e(m,c,l)})):void 0!==l&&a(p,{name:n,newValue:l}));return p},pi}(),mi=on(di);let hi;function gi(){hi=hi||document.createElement("canvas").getContext("2d")}const yi={measureTextWidth(e){gi();const{width:t}=hi.measureText(e);return t},lineWrap(e,t,n,r){let i,o;gi();const a=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,u,c,p,f=e?e.split(/\s+/):[],d=a[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof r&&a.length>=r)return a.slice(0,r);for(n&&(hi.font=n),o=0;o<a.length;o++){for(p=a[o],f=p.split(/\s+/),[d]=f,c="",i=1;i<f.length;i++)if(l=`${d} ${f[i]}`,u=yi.measureTextWidth(l),u>t&&("number"!=typeof r||r>s.length)?(s.push(d),d=f[i]):d=l,"number"==typeof r&&s.length>=r){c=f.slice(i+1).join(" ");break}"number"!=typeof r||s.length<r?s.push(d):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]} ${d} ${c}`}return s},wordWrap(e,t,n,r,i){if(gi(),!e||!e.length)return[];n&&(hi.font=n);let o=[];const a=e.slice();let s,l,u,c="";if(a.filter((e=>!!e)),"number"!=typeof t||t<0)return e.slice();for(u=0;u<a.length;u++){var p;if(l=a[u],c="",l.length<=1||yi.measureTextWidth(l)<=t)o.push(l);else if(s=yi.splitWord(l,t,void 0,void 0===r?void 0:r-o.length),s.length<=1)o.push(s[0]);else c=null!==(p=s.pop())&&void 0!==p?p:"",o=o.concat(s),a[u+1]?yi.measureTextWidth(`${c} ${a[u+1]}`)>t&&(void 0===r||o.length+a.length-u<=r)?a.splice(u+1,0,c):a[u+1]=`${c} ${a[u+1]}`:a.push(c)}return o.forEach(((e,t,n)=>{n[t]=e.trim()})),void 0!==r&&o.length>r?(o=o.splice(0,r),o[o.length-1]=yi.truncate(o[o.length-1],t,n,i).text):(l=o[o.length-1],l&&l.length>1&&yi.measureTextWidth(l)>t&&(o[o.length-1]=yi.truncate(l,t,n,i).text)),o},truncate(e,t,n,r="…"){gi();let i,o,a,s,l=e;const u=yi.measureTextWidth("i");if(n&&(hi.font=n),e&&t){if(yi.measureTextWidth(l)>t){const e=Math.ceil(t/u);for(i=Math.min(e,l.length);i>0;i--)if(o=l.substring(0,i-1),a=o.trim()+r,yi.measureTextWidth(a)<=t){s=l.substring(i-1),l=a;break}i||(s=l,l="…")}}else s=void 0;return{text:l,rest:s}},isNumber:e=>"number"==typeof e&&Number.isFinite(e),explodeWord(e,t,n,r){let i;gi();let o,a=e,s="",l=[];if(void 0!==n&&yi.isNumber(n)&&n<=1)return[e];const u=Math.ceil(t/r);for(i=Math.min(e.length,u);i>0&&(a=e.substring(0,i),o=e.substring(i-1,i)," "===o?a=e.substring(0,i-1):a+="-",s=e.substring(i),!(yi.measureTextWidth(a)<=t));i--);return(!i&&!a||yi.measureTextWidth(a)>t)&&(a=e.substring(0,1),s=e.substring(1)),l.push(a),s?(yi.measureTextWidth(s)>t?l=l.concat(yi.explodeWord(s,t,void 0===n?void 0:n-1,r)):l.push(s),l.filter((e=>""!==e.trim()))):l},splitWord:(e,t,n,r)=>(gi(),e&&t?(n&&(hi.font=n),yi.explodeWord(e,t,r,Math.max(1,yi.measureTextWidth("i")))):[]),wrapText(e,t,n,r,i="…"){let o;return Number.isNaN(t)||!t?[e]:(o=void 0===r||r>1?yi.lineWrap(e,t,n,r):[e],o=yi.wordWrap(o,t,n,r,i),o)},getFontHeight:e=>(gi(),e&&(hi.font=e),1.5*yi.measureTextWidth("m")),tokenize(e,t,n,r,i,o,a=1){gi(),t&&(hi.font=t);const s=yi.getFontHeight(),l=a*s;let u=[],c=[];if(void 0!==o&&o<s)return[];const p=o?Math.max(1,Math.floor(o/l)):r||1;return u=[void 0===r||Number.isNaN(r)||r<=0?p:Math.min(p,r)],Array.isArray(e)?e.forEach(((e,n)=>{c.length<p&&(c=c.concat(yi.wrapText(e,i,t,u[n])))})):c=yi.wrapText(e,i,t,u[0],n),c}};function vi({chart:e,renderer:t,refLine:n,settings:r,width:i,height:o,barWidth:a}){if(!e||!t||!r)return{};const{position:s,scale:l,value:u,label:c,line:p,formatter:f,cId:d}=n,m=n.radius?n.radius*(Math.min(i,o)/2):i/2,h=(vn-yn)*s+yn-Math.PI/2,g={x:i/2,y:o/2},y=mi(!0,{},r.style.line,p||{}),v={type:"line",cId:d,...{x1:g.x+Math.cos(h)*m,y1:g.y+Math.sin(h)*m,x2:g.x+Math.cos(h)*(m+a),y2:g.y+Math.sin(h)*(m+a)},data:{angle:h,innerRadius:m},stroke:y.stroke,strokeWidth:y.strokeWidth,strokeDasharray:y.strokeDasharray};let b;if(c){const n=mi(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},r.style.label||{},{fill:y.stroke},c),{fontFamily:s,fontSize:p,fill:v,opacity:x}=n,q=!1!==c.showLabel?n.text:"";let D,S="";if("string"==typeof f||"object"==typeof f)D=e.formatter(f);else if(void 0!==l&&"string"!=typeof l&&"function"==typeof l.data){const e=l.data()&&l.data().fields;D=e&&e[0]?e[0].formatter():null}!1!==c.showValue&&(D?S=` (${D("function"==typeof u?u():u)})`:l&&(S=` (${u})`));const M=e=>t.measureText({text:e,fontFamily:s,fontSize:p}),A=M("M").height,w=`normal ${p} ${s}`;let I,k=jn;const C=`${q}${S}`||"",L=Math.min(i,o),E=Math.min(8,L/200),N=ii(g.x,g.y,m+a+E,h+Math.PI/2),P=M(C).width;I=Math.min(N.x,i-N.x-xn,Hn),k=function(e,t,n){const r=Math.min(Math.floor((e+xn)/t),Math.floor((n-e)/t));return Math.min(r,jn)}(N.y,A,o);let O=yi.tokenize(C,w,`... ${S}`,k,I,void 0);const F=function(e){let t="start";const n=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:n}}(h);N.y-2*A>0&&N.y+2*A<o&&(N.x-P+xn<0&&"end"===F.textAnchor||N.x+P-xn>i)&&(O=yi.tokenize(C,w,`... ${S}`,k,I,void 0)),b={fill:v,opacity:x,fontFamily:s,fontSize:p,linePosition:N,lineHeight:A,align:"left",baseline:F.baseline,textAnchor:F.textAnchor,lines:O,cId:d}}return{lineNode:v,labelNode:b}}const bi={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){var e,t;const{settings:n,chart:r,renderer:i,rect:o}=this;if(!(r&&o&&n&&i))return[];const{width:a,height:s}=o,l=null!==(e=null==n||null===(t=n.settings)||void 0===t?void 0:t.barWidth)&&void 0!==e?e:0;let u=(null==n?void 0:n.lines)&&n.lines.radial||[];if(0===u.length)return[];u=u.map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){const t=null==r?void 0:r.scale("string"==typeof e.scale?e.scale:""),n=t(e.value);return mi(e,{scale:t,position:n})}return mi(e,{position:e.value})}));const c=[],p=[];[...u].forEach((e=>{if(e.position>=0&&e.position<=1){const{lineNode:t,labelNode:o}=vi({chart:r,renderer:i,refLine:e,settings:n,width:a,height:s,barWidth:l});t&&c.push(t),o&&p.push(o)}}));const f=[];p.forEach((e=>{const{fill:t,opacity:n,fontFamily:r,fontSize:i,lines:o,lineHeight:a,textAnchor:s,linePosition:l,baseline:u,cId:c}=e,p=l,d=o.length-1,m=o.map(((e,o)=>{let l=p.y;return d>0&&("baseline"===u?l-=(d-o)*a:l+=o*a),{type:"text",text:e,cId:c,baseline:u,anchor:s,fill:t,opacity:n,fontFamily:r,fontSize:i,x:p.x,y:l}}));f.push(...m)}));const{MEDIUM:d,SMALLER:m}=Zn,h=a>=d.width&&s>=d.height;return[...a>=m.width&&s>=m.height?c:[],...h?f:[]]}};const xi={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:n}){if(!e||!t||!n)return[];const{valueAngle:r,width:i,height:o}=t,a=.4*Math.min(i,o),s=[],l=t.fill,u={x:i/2,y:o/2},c=ei({points:[{x:u.x-a/2,y:u.y+a/2},{x:u.x,y:u.y-a},{x:u.x+a/2,y:u.y+a/2}],angle:r,fill:l,origin:u});return s.push(c),s}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}},qi={getGap(e,t){const n=e.position<t.position?e:t,r=e.position<t.position?t:e;return r.position-r.radius-(n.position+n.radius)},findSegmentPositionMeetMaxThenMin(e,t,n){const r=e.position+e.radius,i=e.position-Math.max(0,r-n),o=i-e.radius;return i+Math.max(0,t-o)},layoutPositionFromMin(e,t,n,r=0){const i=e.length-1;let o,a,s,l=t;for(let t=0;t<i;t++)o=e[t],a=e[t+1],s=(o.position+a.position)/2-r/2,o.position=qi.findSegmentPositionMeetMaxThenMin(o,l,s),l=o.position+o.radius+r;a&&(a.position=qi.findSegmentPositionMeetMaxThenMin(a,l,n))},adjustPositionFromMax(e,t,n,r=0){const i=e.length-1,o=Math.max(0,e[i].position+e[i].radius-n);if(0===o)return;let a,s,l,u,c=0;for(a=i;a>0&&(s=e[a],l=e[a-1],u=Math.max(0,qi.getGap(l,s)-r),u-=Math.max(0,c+u-o),c+=u,s.move=u,!(c>=o));a--);for(c<o&&l&&(u=Math.max(0,l.position-l.radius-t),u-=Math.max(0,c+u-o),c+=u,l.move=u),c=0,a=0;a<=i;a++)s=e[a],c+=s.move||0,s.move=c,s.position-=c},createLayout(e,t,n,r=0){const i=e.map((e=>e.segment)),o=i.length-1;if(o<0)return[];if(0===o){const e=i[0];e.position=qi.findSegmentPositionMeetMaxThenMin(e,t,n)}else qi.layoutPositionFromMin(i,t,n,r),qi.adjustPositionFromMax(i,t,n,r);return e.filter((e=>{const r=Math.ceil(e.segment.position-e.segment.radius),i=e.segment.position+e.segment.radius;return r>=t&&i<=n}))}};const Di={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){var e,t;const{settings:n,chart:r,renderer:i,rect:o}=this;if(!(r&&o&&n&&i))return[];const{width:a,height:s}=o,{barWidth:l,needlePosition:u}=n.settings,c=null!==(e=null===(t=n.settings)||void 0===t?void 0:t.isRtl)&&void 0!==e&&e,p=c?-1:1,f=(null==n?void 0:n.lines)&&n.lines.x||[],d=(null==n?void 0:n.lines)&&n.lines.y||[];let m=f.length>0?f:d;if(0===m.length)return[];const h=f.length>0;m=m.map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){const t=null==r?void 0:r.scale("string"==typeof e.scale?e.scale:""),n=t(e.value);return mi(e,{scale:t,position:n})}return mi(e,{position:e.value})}));const g=[],y=[];[...m].forEach((e=>{if(ai(e)&&e.position>=0&&e.position<=1){const{lineNode:t,labelNode:o}=function({chart:e,renderer:t,refLine:n,settings:r,width:i,height:o,isVerticalRefLine:a,barWidth:s}){if(!e||!t||!r)return{};const{position:l,scale:u,value:c,label:p,line:f,formatter:d,cId:m}=n,h=mi(!0,{},r.style.line,f||{}),g={type:"line",cId:m,...a?{x1:l*i,x2:l*i,y1:o/2-s/2,y2:o/2+s/2}:{x1:i/2-s/2,x2:i/2+s/2,y1:l*o,y2:l*o},stroke:h.stroke,strokeWidth:h.strokeWidth,strokeDasharray:h.strokeDasharray};let y;if(p){const n=mi(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},r.style.label||{},{fill:h.stroke},p),{fontFamily:f,fontSize:g,fill:v,opacity:b}=n,x=!1!==p.showLabel?n.text:"";let q,D="";if("string"==typeof d||"object"==typeof d)q=e.formatter(d);else if(void 0!==u&&"string"!=typeof u&&"function"==typeof u.data){const e=u.data()&&u.data().fields;q=e&&e[0]?e[0].formatter():null}!1!==p.showValue&&(q?D=` (${q("function"==typeof c?c():c)})`:u&&(D=` (${c})`));const S=e=>t.measureText({text:e,fontFamily:f,fontSize:g}),M=S("M").height,A=`normal ${g} ${f}`,w=a?Tn:i/2-s/2-Rn,I=a?2:1,k=`${x}${D}`||"",C=yi.tokenize(k,A,`... ${D}`,I,w,void 0),L=(a?i:o)*l,E=Math.min(w,Math.max(...C.map((e=>S(e).width)))),N=C.length*M;y={fill:v,opacity:b,fontFamily:f,fontSize:g,linePosition:L,lineHeight:M,lines:C,cId:m,segment:{position:L,radius:a?E/2:N/2}}}return{lineNode:g,labelNode:y}}({chart:r,renderer:i,refLine:e,settings:n,width:a,height:s,isVerticalRefLine:h,barWidth:l});t&&g.push(t),o&&y.push(o)}}));const{MEDIUM:v,SMALLER:b}=Zn,x=a>=v.width&&s>=v.height;if(!(a>=b.width&&s>=b.height))return[];const q=[...g];if(!x||0===y.length)return q;let D=[];if(y.sort(((e,t)=>e.segment.position-t.segment.position)),h)D=qi.createLayout(y,0,a,Vn);else{const{attrs:e}=r.findShapes("text").filter((e=>e.key===_n.GAUGE_LABEL))[0],{"font-size":t}=e,n=parseFloat(t),i=y.filter((e=>e.segment.position<s-u)),o=y.filter((e=>e.segment.position>=s-u)),a=qi.createLayout(i,0,e.y-n/2),l=qi.createLayout(o,e.y+n/2,s);D=0===a.length&&i.length>0?qi.createLayout(y,e.y+n/2,s):0===l.length&&o.length>0?qi.createLayout(y,0,e.y-n/2):[...a,...l]}return D.forEach((e=>{const{fill:t,opacity:n,fontFamily:r,fontSize:i,lines:o,segment:u,linePosition:f,lineHeight:d,cId:m}=e,{position:g}=u;if(f!==g&&""!==e.lines[0]){let e={x1:a/2+p*(l/2),x2:a/2+p*(l/2+.75*Rn),y1:f,y2:g};h&&(e={y1:s/2+l/2,y2:s/2+l/2+Rn,x1:f,x2:g});const n={type:"line",...e,stroke:t,strokeWidth:1,isConnector:!0,cId:m};q.push(n)}const y=o.map(((e,o)=>{let u=h?s/2+l/2+d/2+Rn:g;return u+=o*d,{type:"text",text:e,cId:m,baseline:"central",anchor:h?"middle":c?"end":"start",fill:t,opacity:n,fontFamily:r,fontSize:i,x:h?g:a/2+p*(l/2+Rn),y:u}}));q.push(...y)})),q}};var Si={dataRelatedPropertiesPaths:["filters[].options","qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","qHyperCube.qDimensionInfo[].qCardinalities","qHyperCube.qDimensionInfo[].qMax","qHyperCube.qDimensionInfo[].qMin","qHyperCube.qDimensionInfo[].qStateCounts","qHyperCube.qMeasureInfo[].qApprMaxGlyphCount","qHyperCube.qMeasureInfo[].qFallbackTitle","qHyperCube.qMeasureInfo[].qMax","qHyperCube.qMeasureInfo[].qMin","qHyperCube.qMeasureInfo[].qNumFormat","qHyperCube.qMeasureInfo[].qTrendLines","qHyperCube.qTreeNodesOnDim","measureAxis.min","measureAxis.max","refLine.refLines[].refLineExpr"]};function Mi(e){const{qHyperCube:t,...n}=e,{...r}=t||{},i=mi(!0,{},{...n,qHyperCube:{...r,qDataPages:null,qStackedDataPages:null,qTreeDataPages:null}}),{dataRelatedPropertiesPaths:o}=Si;return o.forEach((e=>{const t=e.split("[");if(1===t.length)void 0!==Pt(i,e)&&Ft(i,e,null);else{const e=t[0],n=t[1].split("].")[1];Pt(i,e,[]).forEach((e=>{void 0!==Pt(e,n)&&Ft(e,n,null)}))}})),i}const Ai=({core:t,services:n,settings:o})=>{const a=e(),{qLocaleInfo:s}=i();r((()=>{if(!n)return;const{chart:e,cache:r}=t;if(!e)return;const{colorService:i,layoutService:l,dockService:u}=n;if("radial"===l.meta.gaugetype){const{width:e,height:t}=u.meta.chart.size;a.style.transform=`translateY(${li(e,t)}px)`}else a.style.transform="";e.update({data:[{type:"q",key:"qHyperCube",data:l.getHyperCube(),config:{localeInfo:s}},...i.getData()],settings:o}),r&&function({cache:e,layout:t}){const n=Mi(t);e.set("dataIndependentProperties",JSON.stringify(n))}({cache:r,layout:l.getLayout()})}),[t,o])};function wi({layout:e,options:t}){return e.snapshotData&&!t.freeResize?{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h,preserveAspectRatio:!0,align:.5}:void 0}function Ii({options:e,cache:t,layoutService:n}){const r={isSizeChanging:!1};return{enabled:()=>!1!==e.chartAnimations&&!r.isSizeChanging&&!function({cache:e,layout:t}){const n=Mi(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)}({cache:t,layout:n.getLayout()}),meta:r}}function ki({layout:e,rect:t}){var n;const{measureAxis:r,qHyperCube:i,autoOrientation:o,gaugetype:a,useSegments:s,refLine:l}=e,u=null===(n=e.qHyperCube)||void 0===n?void 0:n.qMeasureInfo[0].qFallbackTitle,{width:c,height:p}=t;let f=e.orientation;o&&(f=c>=p?"horizontal":"vertical");const d="vertical"===f,m=function({measureAxis:e,qHyperCube:t}){if(!e||!t)return{min:0,max:1};let{min:n,max:r}=e;if(n=Number(n),r=Number(r),n!==r)return{min:Math.min(n,r),max:Math.max(n,r)};const i=t.qDataPages[0].qMatrix[0][0].qNum;let o=Math.abs(i-n)/2;return 0===o&&(o=0!==n?Math.abs(n)/2:Number.MAX_VALUE/2),{min:n-o,max:r+o}}({measureAxis:r,qHyperCube:i}),h=(null==l?void 0:l.refLines)||[],g=(null==r?void 0:r.spacing)||1,y=null==r?void 0:r.show,v=function({layout:e,rangeLimits:t}){var n,r;const{gradient:i}=(null===(n=e.qHyperCube)||void 0===n?void 0:n.qMeasureInfo[0].coloring)||{};if("measure"!==(null===(r=e.color)||void 0===r?void 0:r.useBaseColors)||!i)return e.segmentInfo;const{min:o,max:a}=t,{limits:s,limitType:l,breakTypes:u,colors:c}=i;return{limits:s.map(((e,t)=>({value:"percent"===l?o+e*(a-o):e,gradient:u[t]}))),paletteColors:c}}({layout:e,rangeLimits:m});return{measureAxisTitle:u,measureAxisSpacing:g,measureAxisShow:y,rangeLimits:m,qHyperCube:i,orientation:f,autoOrientation:o,gaugetype:a,isVertical:d,useSegments:s,segmentInfo:v,refLines:h}}function Ci({dockService:e,layoutService:t}){const{width:n,height:r}=e.meta.chart.size,{orientation:i,autoOrientation:o}=t.meta;return o?n<r:"vertical"===i}function Li(e,t,n){if(e>=n)return 1;if(e<=t)return 0;const r=Math.min(1,Math.max(0,(e-t)/(n-t)));return Number.isNaN(r)?0:r}function Ei(e,t,n){const r="none"===e||"labels"===e,i=t<Zn.SMALL.width||n<Zn.SMALL.height;return!(r||i)}function Ni(e){return"none"!==e&&"title"!==e}const Pi=({core:e})=>{const f=o(),d=a(),m=s(),h=l(),g=u(),y=c(),{qLocaleInfo:v}=i(),[x,q]=n(null),D=t(),S=p();return r((()=>{if(!f||!e)return;const{picassoInstance:t,chart:n,cache:r}=e;if(!n)return;f.color||(f.color={useBaseColors:"off"});const i=function(e){var t=e.source,n=e.metaAdditionsFn,r=e.experimental,i=void 0===r?{filter:!1}:r,o=U(!0,{},t),a=i.filter?function(e){var t=e.qHyperCube,n=Ht(t,Vt.DIMENSION),r=n.reduced,i=n.filtered;t[Vt.DIMENSION]=r;var o=Ht(t,Vt.MEASURE),a=o.reduced,s=o.filtered;return t[Vt.MEASURE]=a,{dimensions:i,measures:s}}(o):{dimensions:[],measures:[]},s=zt(o),l=function(){var e=function(e){var t=e.layout,n=e.additionsFn,r=void 0===n?function(){return{}}:n,i=e.additionsProps,o=void 0===i?{}:i,a=t.qHyperCube,s=a.qDimensionInfo,l=a.qMeasureInfo,u=a.qMode,c=s.length,p=l.length,f=b({mode:{S:"S"===u,P:"P"===u,K:"K"===u,T:"T"===u},dimensionCount:c,measureCount:p,hasMultipleDimensions:c>1,hasMultipleMeasures:p>1,isOneDimensional:1===c,isTwoDimensional:2===c},o);return b(b({},f),r({layout:t,meta:f}))}({layout:o,additionsFn:n,additionsProps:{size:s.size}});return e.filteredFields=a,e},u={refs:b({},s.refs),meta:l(),getLayout:function(){return o},getLayoutValue:function(e,t){return Pt(o,e,t)},setLayoutValue:function(e,t){Ft(o,e,t),s=zt(o),u.meta=l()},getHyperCube:function(){return o.qHyperCube},getHyperCubeValue:function(e,t){return Pt(o.qHyperCube,e,t)},setHyperCubeValue:function(e,t){Ft(o.qHyperCube,e,t),s=zt(o),u.meta=l()},getDataPages:function(){return Pt(o,s.refs.dataPages)},setDataPages:function(e){Ft(o,s.refs.dataPages,e),u.meta=l()}};return u}({source:f,metaAdditionsFn:()=>ki({layout:f,rect:g})}),{direction:o="ltr"}=D,a=wi({layout:i.getLayout(),options:D}),s=Nt({chart:n,layoutService:i,config:{rtl:"rtl"===o,logicalSize:a},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0}}),l=xt({app:m,model:h,translator:y,picasso:t,layoutService:i,config:{key:Bn,localeInfo:v,theme:d,auto:()=>({mode:"primary",byMeasureDef:{activeMeasureIndex:0,type:"expression",label:""}})},createConfig:()=>({colorProps:{auto:!0,paletteColor:f.paletteProgressColor||{index:f.progressColor}}})}),u=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,a=void 0===o?[]:o,s=r.transform,l=void 0===s?[]:s,u=r.extend,c=void 0===u?[]:u,p={theme:t,matrix:tn(a),styles:void 0};return p.styles=rn({theme:t,id:i,transform:l,extend:c,matrix:p.matrix}),{getStyles:function(){return p.styles},getTheme:function(){return p.theme},setTheme:function(e){p.theme=e,p.styles=rn({theme:e,id:i,transform:l,extend:c,matrix:p.matrix})}}}({theme:d,config:{id:"gauge"}}),c=function({chart:e,layoutService:t,dockService:n}){function r(){const{width:e,height:r}=n.meta.chart.size,i=Ci({dockService:n,layoutService:t});return Math.min(gn,i?e/10:r/10)}function i(){const{width:e,height:r}=n.meta.chart.size;return Ci({dockService:n,layoutService:t})?r:e}function o(e){const{min:n,max:r}=t.meta.rangeLimits,o=e?r-(t.meta.qHyperCube.qDataPages[0].qMatrix[0][0].qNum-n):t.meta.qHyperCube.qDataPages[0].qMatrix[0][0].qNum;return i()*Li(o,n,r)}const a={getBottomPadding(a){if(Ci({dockService:n,layoutService:t})){const e=o(!1)+-a.height*Mn.VERTICAL_ALIGNMENT_FACTOR,t=0,n=i()-a.height/wn;return e<t?t:e>n?n:e}const s=r(),{VERTICAL_ALIGNMENT_FACTOR:l}=An;let u=.5*s+a.height/2+s*l;return u=function({refLabels:e,valueLabel:t}){return e.forEach((e=>{(function(e,t){const n=t.x-t.width/2>=e.x+e.width/2||t.x+t.width/2<=e.x-e.width/2,r=t.y-t.height/2>=e.y+e.height/2;return!(n||r)})(e,t)&&(t.y=e.y+e.height/2+t.height/2)})),t.y}({refLabels:e.findShapes("text").filter((e=>e.key===_n.REFERENCE_LINES_AND_LABELS)).map((e=>{const{x:t,y:r,"font-size":i}=e.attrs,o=parseFloat(i);return{x:t,y:r-n.meta.chart.size.height/2,height:o,width:Tn}})),valueLabel:{x:o(n.config.rtl),y:u,...a}}),-u},getTopPadding:e=>-a.getBottomPadding(e),getLeftPadding(e){const{width:a}=n.meta.chart.size,s=n.config.rtl,l=r(),u=Ci({dockService:n,layoutService:t}),c=Math.min(e.width,a*En);if(u)return s?a/5-l-c:a/5+l;const p=o(s)-e.width/2,f=Sn.RIGHT,d=i()-e.width-Sn.LEFT;return p<f?f:p>d?d:p},getRightPadding:e=>-a.getLeftPadding(e)},s={getLeftPadding(i){if(!Ci({dockService:n,layoutService:t}))return 0;const o=e.findShapes("container").filter((e=>e.key===_n.BAR_AXIS));if(1!==o.length)return 0;const a=o[0],s=Ni(t.meta.measureAxisShow)?Math.max(...a.children.filter((e=>"text"===e.type)).map((e=>e.bounds.width))):0,l=Math.max(...a.children.filter((e=>"line"===e.type)).map((e=>e.bounds.width)));let u=r()/2+s+l+1.9*i.height;const{width:c}=n.meta.chart.size;return u>c/2-i.height/4&&(u=c/2-i.height/4),n.config.rtl?u:-u},getRightPadding:e=>-s.getLeftPadding(e),getTopPadding(){if(Ci({dockService:n,layoutService:t}))return-4;const i=e.findShapes("container").filter((e=>e.key===_n.BAR_AXIS));if(1!==i.length)return 0;const o=i[0],a=Ni(t.meta.measureAxisShow)?Math.max(...o.children.filter((e=>"text"===e.type)).map((e=>e.bounds.height))):0,s=Math.max(...o.children.filter((e=>"line"===e.type)).map((e=>e.bounds.height))),l=r();return-(l/2+a+s+Fn+l*On)},getBottomPadding:()=>-s.getTopPadding()};return{getBarWidthInPixels:r,getValueLabelFontSize:function(e,t){const{width:r,height:i}=n.meta.chart.size,o=Li(Math.min(i,r),Dn.MIN,Dn.MAX);return e+Math.round(o*(t-e))},getNeedlePosition:o,barValueLabel:a,barAxisTitle:s}}({chart:n,layoutService:i,dockService:s}),p=function({layoutService:e,themeService:t,colorService:n}){const r=t.getStyles(),i=t=>{var n;return null===(n=e.getLayoutValue("components",[]))||void 0===n?void 0:n.find((e=>e.key===t))},o=e=>e?n.getPaletteColor(e):void 0;return{query:{axis:{title:{getStyle:()=>{var e,t,n,a;return{fontFamily:null!==(e=null===(t=i("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:r.axis.title.fontFamily,fontSize:r.axis.title.fontSize,color:null!==(n=o(null===(a=i("axis"))||void 0===a||null===(a=a.axis)||void 0===a||null===(a=a.title)||void 0===a?void 0:a.color))&&void 0!==n?n:r.axis.title.color}}},label:{getStyle:()=>{var e,t,n,a;return{fontFamily:null!==(e=null===(t=i("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:r.axis.label.name.fontFamily,fontSize:r.axis.label.name.fontSize,fill:null!==(n=o(null===(a=i("axis"))||void 0===a||null===(a=a.axis)||void 0===a||null===(a=a.label)||void 0===a||null===(a=a.name)||void 0===a?void 0:a.color))&&void 0!==n?n:r.axis.label.name.color}}}},label:{getStyle:()=>{var e,t,n,a;return{fontFamily:null!==(e=null===(t=i("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:r.label.value.fontFamily,fill:null!==(n=o(null===(a=i("value"))||void 0===a||null===(a=a.label)||void 0===a||null===(a=a.value)||void 0===a?void 0:a.color))&&void 0!==n?n:r.label.value.color}}}}}}({layoutService:i,themeService:u,colorService:l}),x=Ii({options:D,cache:r,layoutService:i}),M=function({layout:e,model:t,translator:n,interactionState:r}){return{isClosed:()=>e.disclaimerClosed,close:()=>{t.getProperties().then((e=>{e.disclaimerClosed=!0,t.setProperties(e)}))},translator:n,isEditMode:r.edit}}({layout:f,model:h,translator:y,interactionState:S});q({layoutService:i,colorService:l,dockService:s,labelService:c,themeService:u,styleService:p,animationsService:x,disclaimerService:M})}),[h,m,f,d.name(),y.language(),e,D.direction,S.edit]),x};function Oi({width:e,height:t,fontSize:n}){const{FULL:r}=Zn;if(e>=r.width&&t>=r.height){let e=Number.parseFloat(n);return e=Math.floor(e*kn),`${e}px`}return n}var Fi=e=>()=>e;function Ti(e){return 1==(e=+e)?Ri:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Fi(isNaN(t)?n:t)}}function Ri(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Fi(isNaN(e)?t:e)}var Vi=function e(t){var n=Ti(t);function r(e,t){var r=n((e=Dr(e)).r,(t=Dr(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Ri(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function Hi({thisColor:e,paletteColors:t,paletteIndex:n,limit:r,isLeft:i=!1,themeService:o}){const a=i?0:1,s=0===Object.entries(r).length,l=r.gradient;let u=n+(i?-1:1);s&&(u=i?0:t.length-1);const c=o.getTheme().getColorPickerColor(u<t.length&&u>=0?t[u]:t[0]);return{color:l?Vi(e,c)(.5):e,offset:a,gradient:l}}function ji({limits:e,paletteColors:t,paletteIndex:n,themeService:r}){const i=Pt(e,""+(n-1),{}),o=Pt(e,`${n}`,{}),a=[i,o].map((e=>e.gradient)).includes(!0),s=r.getTheme().getColorPickerColor(t[n]);if(!a)return[{offset:0,color:s},{offset:1,color:s}];const l=[Hi({thisColor:s,paletteColors:t,paletteIndex:n,limit:i,isLeft:!0,themeService:r}),Hi({thisColor:s,paletteColors:t,paletteIndex:n,limit:o,isLeft:!1,themeService:r})];2===l.filter((e=>e.gradient)).length&&l.splice(1,0,{offset:.5,color:s,gradient:!0});const u=l.map((({offset:e,color:t,gradient:n})=>({offset:e,color:t,gradient:n})));return u}function zi({themeService:e,segmentInfo:t,rangeLimits:n}){const{limits:r,colors:i}=t;let{paletteColors:o}=t;o&&0!==o.length||!i||(o=i.map((e=>({index:e.color}))));const{min:a,max:s}=n;r.sort(((e,t)=>e.value-t.value));const l=[a,...r.map((e=>e.value)),s],u=[];for(let t=0;t<o.length;t++){const n=ji({limits:r,paletteColors:o,paletteIndex:t,themeService:e}).map((e=>({offset:Li(l[t]+e.offset*(l[t+1]-l[t]),a,s),color:e.color,gradient:"gradient"in e?e.gradient:void 0})));u.push(...n)}return u}function _i(e){return e.map((e=>({...e,offset:1-e.offset}))).reverse()}function Bi({themeService:e,isVertical:t,segmentInfo:n,rangeLimits:r,isRtl:i}){return{type:"gradient",x1:0,x2:t?0:1,y1:t?1:0,y2:0,stops:i&&!t?_i(zi({themeService:e,segmentInfo:n,rangeLimits:r})):zi({themeService:e,segmentInfo:n,rangeLimits:r})}}function $i(e){const t=function(e){if(e=e.replace("#",""),6!==e.length)throw new Error("Invalid hex color");const t=parseInt(e.substring(0,2),16),n=parseInt(e.substring(2,4),16),r=parseInt(e.substring(4,6),16);return{r:t,g:n,b:r}}(e),n=.21*t.r+.72*t.g+.07*t.b>127.5?-50:50;return`rgb(${t.r+n}, ${t.g+n}, ${t.b+n})`}function Gi({services:e}){const{dockService:t,disclaimerService:n}=e,{translator:r,isClosed:i,isEditMode:o}=n;if(i()||!o)return!1;const a=t.config.rtl;return{key:"disclaimer-component",type:"disclaimer-component",layout:{displayOrder:5,minimumLayoutMode:Xn},settings:{isRtl:a,close:e.disclaimerService.close,title:r.get("Object.Gauge.RangeIsDefaultTitle"),text:r.get("Object.Gauge.RangeIsDefault")}}}function Ui({services:e}){const{dockService:t,layoutService:n,themeService:r,animationsService:i}=e,{qHyperCube:o,useSegments:a,segmentInfo:s,rangeLimits:l}=n.meta,u=Ci({dockService:t,layoutService:n}),c=u?"vertical":"horizontal";if(!a)return!1;const{min:p,max:f}=l,d=o.qDataPages[0].qMatrix[0][0].qNum,m=Math.max(p,Math.min(f,d)),h={type:"box",key:_n.MARK,data:{extract:{field:"qMeasureInfo/0",props:{start:m,end:m,measureIndex:0}}},settings:{minor:{scale:"m"},orientation:c,box:{width:.1,maxWidthPx:gn,minHeightPx:In,fill:()=>function({themeService:e,isVertical:t,segmentInfo:n,rangeLimits:r,value:i}){const o=Bi({themeService:e,isVertical:t,segmentInfo:n,rangeLimits:r,isRtl:!1}),{min:a,max:s}=r,l=Li(i,a,s),{stops:u}=o;let c="black";for(let e=0;e<u.length;e++){const t=u[e].offset,n=u[e+1].offset;if(l>=t&&l<=n){const r=Li(l,t,n);c=Jr(Vi(u[e].color,u[e+1].color)(r));break}}return c}({value:d,themeService:r,isVertical:u,segmentInfo:s,rangeLimits:l}),stroke:"transparent"}},animations:{enabled:i.enabled,trackBy:e=>`${e.data.measureIndex.value}`}};return h}function Wi({services:e}){const{dockService:t,themeService:n,styleService:r,layoutService:i,animationsService:o}=e;if(!Ni(i.meta.measureAxisShow))return[];const{width:a,height:s}=t.meta.chart.size,l=ri(a,s,yn,vn),{innerRadius:u,outerRadius:c,radiusIncrease:p}=l,f=4*p,d=Math.min(a,s)/2,m=n.getStyles(),h=r.query.axis.label.getStyle(),{tickLength:g,labelPadding:y}=function({width:e,height:t,defaultTickSize:n,defaultLabelPadding:r}){const i=Math.min(Math.min(e,t)/Yn,1);return{tickLength:n*i,labelPadding:r*i}}({width:a,height:s,defaultTickSize:8,defaultLabelPadding:20}),v=si(a,s);return[{key:_n.RADIAL_AXIS,type:"axis",rendererSettings:{disableScreenReader:!0},dock:"center",layout:{minimumLayoutMode:Kn},scale:"m",settings:{arc:{radius:c,startAngle:yn,endAngle:vn,offset:-10*f*(c-u)*d},align:"top",line:{show:!1,stroke:"#cdcdcd"},ticks:{tickSize:g,stroke:m.axis.line.major.color,margin:v},labels:{margin:-6-2*g+y,fontFamily:h.fontFamily,fill:h.fill,fontSize:h.fontSize}},animations:{enabled:o.enabled,trackBy:e=>{const{type:t,text:n,x:r,y:i,x1:o,y1:a,value:s}=e;return"text"===t?`text-${n}-${r}-${i}`:`tick-${s}-${o}-${a}`}}}]}function Ki(e,t,n,r){const i=r?_i(zi({themeService:t,segmentInfo:n,rangeLimits:e})):zi({themeService:t,segmentInfo:n,rangeLimits:e}),o=(vn-yn)/(2*Math.PI),a=i.map((e=>{""!==e.color&&void 0!==e.color||(e.color="#000000");return{offset:e.offset*o,color:e.color}}));return{type:"gradient",orientation:"conic",startAngle:yn-Math.PI/2,x:0,y:0,stops:a}}function Xi({services:e}){const{dockService:t,themeService:n,layoutService:r,animationsService:i}=e,{rangeLimits:o,useSegments:a,segmentInfo:s,qHyperCube:l}=r.meta,{width:u,height:c}=t.meta.chart.size,p=t.config.rtl,{outerRadius:f,innerRadius:d,labelGaugeRadius:m}=ri(u,c,yn,vn),h=o.max,g=l.qDataPages[0].qMatrix[0][0].qNum,y=h-g,v=[{value:Math.max($n,g-o.min),valueLabel:"Measure"},{value:Math.max($n,y),valueLabel:"Remaining"}],b=function({themeService:e,segmentInfo:t,rangeLimits:n}){const r=zi({themeService:e,segmentInfo:t,rangeLimits:n});let i=0,o=0;const a=r.map((e=>(""!==e.color&&void 0!==e.color||(e.color="#000000"),o=0===n.max?e.offset*(n.max-n.min)-i:e.offset*n.max-i,i+=o,{value:o,color:e.color,gradient:e.gradient}))).filter((e=>0!==e.value||!0===e.gradient));return a.forEach((e=>{e.value=Math.abs(e.value)})),a}({themeService:n,segmentInfo:s,rangeLimits:o});p&&(v.reverse(),b.reverse());const x={type:"pie",key:_n.RADIAL_GAUGE,data:{items:v},settings:{startAngle:yn,endAngle:vn,slice:{arc:{ref:"value"},outerRadius:()=>f,innerRadius:()=>d,fill:(t,n)=>{const r=ni({services:e});return p?1===n?r(t):bn:0===n?r(t):bn},strokeWidth:e=>e.datum.value.value===$n?0:1,stroke:(t,n)=>{const r=$i(ni({services:e})(t));return p?1===n?r:"#0000":0===n?r:"#0000"}}},animations:{enabled:i.enabled,trackBy:e=>e.data.value.valueLabel}},q={type:"pie",key:_n.SEGMENT_RADIAL_GAUGE,renderer:"canvas",displayOrder:1,data:{items:b},settings:{startAngle:yn,endAngle:vn,slice:{arc:{ref:"value"},outerRadius:()=>f,innerRadius:()=>d,strokeWidth:0,fill:(e,t)=>{var r,i;return(p?e.datum.value.gradient||(null===(r=b[t+1])||void 0===r?void 0:r.gradient):e.datum.value.gradient||(null===(i=b[t-1])||void 0===i?void 0:i.gradient))?Ki(o,n,s,p):e.datum.value.color}}},animations:{enabled:i.enabled,trackBy:e=>e.data.value.color}},D={type:"pie",key:_n.CIRCLE_GAUGE,renderer:"canvas",displayOrder:0,data:{items:[{value:Math.max(g,$n),valueLabel:"Measure"}]},settings:{startAngle:0,endAngle:2*Math.PI,slice:{arc:{ref:"value"},outerRadius:()=>f,innerRadius:()=>d,fill:()=>function(e,t,n,r){const i=Ki(e,t,n,r),o={offset:(vn-yn)/(2*Math.PI),color:"rgba(0, 0, 0, 0)"};return i.stops.push(o),i.stops.push({offset:1,color:"rgba(0, 0, 0, 0)"}),i}(o,n,s,p),strokeWidth:0,opacity:a?1:0}},animations:{enabled:i.enabled,trackBy:e=>e.data.value.valueLabel,isMainComponent:!0}},S={type:"pie",key:_n.LABEL_RADIAL_GAUGE,renderer:"canvas",displayOrder:0,data:{items:[{value:Math.max(g,$n),valueLabel:"Measure"}]},settings:{startAngle:0,endAngle:2*Math.PI,slice:{arc:{ref:"value"},outerRadius:()=>m+.01,innerRadius:()=>m,opacity:0}},animations:{enabled:i.enabled,trackBy:e=>e.data.value.valueLabel,isMainComponent:!0}};return a?[D,S,q]:[S,x]}function Zi({chart:e,services:t}){const{layoutService:n,styleService:r,labelService:i,animationsService:o,dockService:a}=t,{width:s,height:l}=a.meta.chart.size,{getValueLabelFontSize:u}=i,c=r.query.axis.title.getStyle(),p=u(qn.MIN,qn.MAX),f=Number.parseFloat(Oi({width:s,height:l,fontSize:c.fontSize})),d=function({width:e,height:t,totalFontHeight:n}){const r=ri(e,t,yn,vn).labelGaugeRadius*Math.min(e,t)*.9-n;return(li(e,t)-2*si(e,t))/r}({width:s,height:l,totalFontHeight:p+f}),m=.5-d,h=Ei(n.meta.measureAxisShow,s,l),{qHyperCube:g}=n.meta,y=g.qMeasureInfo[0].qFallbackTitle,v=g.qDataPages[0].qMatrix[0][0].qNum,b=r.query.label.getStyle();return[{type:"labels",key:_n.RADIAL_GAUGE_LABEL,layout:{displayOrder:4},settings:{sources:[{component:_n.LABEL_RADIAL_GAUGE,selector:"path",strategy:{type:"rows",settings:{fill:"#000",padding:0,justify:m,labels:[{fontSize:p,fontFamily:b.fontFamily,fill:b.fill,label({data:t}){const n=e.formatter(zn.MEASURE);return t&&n?n(v):""},linkData:({data:e})=>e?{value:e.value.value,formatter:zn.MEASURE}:null},{fontSize:f,fontFamily:c.fontFamily,fill:c.color,label:()=>h?y:""}]}}}]},animations:{enabled:o.enabled,trackBy:e=>"text"+(e.data?"value-label":"axis-title"),adjustTweenedNodes(t){t.forEach((t=>{const{type:n,data:r}=t;if("text"===n&&r&&r.value&&r.formatter&&(t.text=e.formatter(r.formatter)(r.value),t.ellipsed&&"0"!==t.ellipsed)){const{text:e,fontSize:n,fontFamily:r,maxWidth:i}=t,o=`normal ${n} ${r}`,a="…",s=1;t.ellipsed=yi.tokenize(e,o,a,s,i)[0]}}))}}}]}function Yi({services:e}){const{dockService:t,layoutService:n,animationsService:r}=e,{width:i,height:o}=t.meta.chart.size,a=t.config.rtl,{rangeLimits:s,qHyperCube:l}=n.meta,{min:u,max:c}=s;let p,f=l.qDataPages[0].qMatrix[0][0].qNum;(f>c||f<u)&&(p="#00000000"),a&&(f=c-(f-u));const d=yn+Li(f,u,c)*(vn-yn);return{type:"radial-gauge-needle",key:_n.RADIAL_GAUGE_NEEDLE,layout:{displayOrder:2},settings:{component:_n.SEGMENT_RADIAL_GAUGE,fill:p,valueAngle:d,width:i,height:o},animations:{enabled:r.enabled,trackBy:e=>e.type,adjustTweenedNodes(e){e.forEach((e=>{const{data:t}=e;if(t){const{pointerWidth:n,angle:r,radius:a,fill:s}=t,l=ii(i/2,o/2,a,r+Math.PI/2),{x:u,y:c}=l,p=[{x:u+.3*n,y:c},{x:u-7.5*n,y:c+n},{x:u-7.5*n,y:c-n}],{d:f}=ei({points:p,angle:r,fill:s,origin:l});e.d=f}}))}}}}function Ji({services:e}){const{dockService:t,layoutService:n,animationsService:r}=e,{width:i,height:o}=t.meta.chart.size,a=t.config.rtl,{rangeLimits:s,useSegments:l,qHyperCube:u}=n.meta,{min:c,max:p}=s,f=u.qDataPages[0].qMatrix[0][0].qNum,{outerRadius:d,innerRadius:m}=ri(i,o,yn,vn),h=(m+(d-m)/2)*Math.min(i,o)/2,{RADIAL_OOB_INDICATOR_MIN:g,RADIAL_OOB_INDICATOR_MAX:y,SEGMENT_RADIAL_GAUGE:v,RADIAL_GAUGE:b}=_n;return[g,y].map(((t,n)=>{const s=l?v:b,u=function(e,t){const n=ni({services:e})({datum:{value:()=>0}});return t?"#595959":n}(e,l);let g=0;(0===n&&f<c||1===n&&f>p)&&(g=oi({innerRadius:m,outerRadius:d,width:i,height:o}));let y=yn;return(0===n&&a||1===n&&!a)&&(y=vn),{type:"radial-oob-indicator",key:t,layout:{displayOrder:2},settings:{component:s,selector:"path",angle:y,radius:h,size:g,fill:u,width:i,height:o},animations:{enabled:r.enabled,trackBy:e=>e.type}}}))}function Qi({core:e,services:t}){const{chart:n}=e;if(!n)return[];const{dockService:r,layoutService:i}=t,{width:o,height:a}=r.meta.chart.size,{useSegments:s}=i.meta,l=Ci({dockService:r,layoutService:i}),u=[Gi({services:t})];if("bar"===t.layoutService.meta.gaugetype){u.push(...function({services:e}){const{dockService:t,layoutService:n,styleService:r,themeService:i,animationsService:o}=e;if("none"===n.meta.measureAxisShow)return[];const{width:a,height:s}=t.meta.chart.size,l=t.config.rtl,u=Ci({dockService:t,layoutService:n}),c=i.getStyles(),p=r.query.axis.label.getStyle(),{fontFamily:f,fill:d,fontSize:m}=p,h=Ni(n.meta.measureAxisShow);return[{type:"axis",rendererSettings:{disableScreenReader:!0},key:_n.BAR_AXIS,dock:"center",scale:"m",layout:{minimumLayoutMode:Gn},settings:{align:u?l?"right":"left":"top",line:{show:!u,stroke:c.axis.line.major.color},labels:{show:h,minLengthPx:20,fontFamily:f,fill:d,fontSize:Oi({width:a,height:s,fontSize:m})},paddingStart:()=>{if(u){const e=Math.min(a/10,gn);return a/2+e/2}const e=Math.min(s/10,gn);return s/2+e/2+Pn},ticks:{stroke:c.axis.line.major.color}},animations:{enabled:o.enabled,trackBy:e=>void 0===e.tickValue?"axis":"text"===e.type?`label: ${e.tickValue}`:`mark: ${e.tickValue}`}}]}({services:t}),...function({services:e}){const{themeService:t,dockService:n,layoutService:r,animationsService:i}=e,{rangeLimits:o,segmentInfo:a,useSegments:s}=r.meta,l=n.config.rtl,u=Ci({dockService:n,layoutService:r}),c=u?"vertical":"horizontal",{min:p,max:f}=o,d=l&&!u?f:p,m={type:"box",key:_n.BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:p,end:{field:"qMeasureInfo/0"},measureIndex:0}}},settings:{minor:{scale:"m"},orientation:c,box:{width:.1,maxWidthPx:gn,fill:ni({services:e}),strokeWidth:e=>e.datum.value<=p?0:1,stroke:t=>$i(ni({services:e})(t))}},animations:{enabled:i.enabled,isMainComponent:!0,trackBy:e=>`${e.data.measureIndex.value}`}},h={type:"box",key:_n.SEGMENT_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:p,end:f,measureIndex:0}}},settings:{minor:{scale:"m"},orientation:c,box:{width:.1,maxWidthPx:gn,fill:()=>Bi({themeService:t,isVertical:u,segmentInfo:a,rangeLimits:o,isRtl:l}),stroke:"transparent"}},animations:{enabled:i.enabled,trackBy:e=>`${e.data.measureIndex.value}`}},g={type:"box",key:_n.BACKGROUND_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:p,end:f}}},settings:{minor:{scale:"m"},orientation:c,box:{width:.1,maxWidthPx:gn,fill:bn}}},y={type:"box",key:_n.LABEL_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:d,end:d}}},settings:{minor:{scale:"m"},orientation:c,box:{width:u?En:Nn,opacity:0}}};return s?[y,h]:[y,g,m]}({services:t}),...function({services:e}){const{dockService:t,labelService:n,styleService:r,layoutService:i}=e,{width:o,height:a}=t.meta.chart.size;if(!Ei(i.meta.measureAxisShow,o,a))return[];const s=Ci({dockService:t,layoutService:i}),{measureAxisTitle:l,useSegments:u}=i.meta,{getTopPadding:c,getBottomPadding:p,getLeftPadding:f,getRightPadding:d}=n.barAxisTitle,m=r.query.axis.title.getStyle(),{fontFamily:h,fontSize:g,color:y}=m;return[{type:"labels",key:_n.AXIS_TITLE,settings:{sources:[{component:u?_n.SEGMENT_BAR:_n.BACKGROUND_BAR,selector:"rect",strategy:{type:"bar",settings:{direction:s?"up":"right",align:.5,justify:.5,labels:[{fontFamily:h,fill:y,fontSize:Number.parseFloat(Oi({width:o,height:a,fontSize:g})),label:()=>l,dock:s&&t.config.rtl?"right":"left",placements:[{position:"inside",padding:{top:c,bottom:p,left:f,right:d},overflow:!0}]}]}}}]}}]}({services:t}),function({services:e}){const{layoutService:t,dockService:n,labelService:r,animationsService:i}=e,{qHyperCube:o,rangeLimits:a,useSegments:s}=t.meta,{width:l,height:u}=n.meta.chart.size,c=n.config.rtl,p=Ci({dockService:n,layoutService:t}),{min:f,max:d}=a,m=o.qDataPages[0].qMatrix[0][0].qNum;let h=r.getBarWidthInPixels();m<=d&&m>=f&&(h=0);let g=p?"bottom":c?"right":"left";return m>d&&(g=p?"top":c?"left":"right"),{type:"oob-indicator",key:_n.OOB_INDICATOR,layout:{displayOrder:2},settings:{component:s?_n.SEGMENT_BAR:_n.BAR,isRtl:c,selector:"rect",pointingTo:g,size:h,width:l,height:u},animations:{enabled:i.enabled,trackBy:e=>e.type}}}({services:t}),Ui({services:t}));const e=function({chart:e,services:t}){if(!e.formatter)return!1;const{labelService:n,styleService:r,dockService:i,layoutService:o,animationsService:a}=t,s=Ci({dockService:i,layoutService:o}),{getValueLabelFontSize:l,barValueLabel:u}=n,{getTopPadding:c,getBottomPadding:p,getLeftPadding:f,getRightPadding:d}=u,m=l(qn.MIN,qn.MAX),h=r.query.label.getStyle();return{type:"labels",key:_n.GAUGE_LABEL,layout:{minimumLayoutMode:s?Un:Wn},settings:{sources:[{component:_n.LABEL_BAR,selector:"rect",formatter:"measure",strategy:{type:"bar",settings:{direction:s?"up":"right",orientation:"horizontal",fontFamily:h.fontFamily,fill:h.fill,fontSize:m,align:s?0:.5,justify:0,labels:[{label:({data:t})=>t?e.formatter(zn.MEASURE)(t.value):"",linkData:({data:e})=>e?{value:e.value,formatter:zn.MEASURE}:null,placements:[{position:"outside",padding:{top:c,bottom:p,left:f,right:d},overflow:!0}]}]}}}]},animations:{enabled:a.enabled,trackBy:e=>e.type,adjustTweenedNodes(t){t.forEach((t=>{const{type:n,data:r}=t;"text"===n&&r&&r.value&&r.formatter&&(t.text=e.formatter(r.formatter)(r.value))}))}}}}({chart:n,services:t}),r=function({services:e}){const{dockService:t,layoutService:n,labelService:r,themeService:i,colorService:o,animationsService:a}=e,{refLines:s}=n.meta,l=t.config.rtl,u=Ci({dockService:t,layoutService:n}),c=i.getStyles();return{type:"custom-ref-line",key:_n.REFERENCE_LINES_AND_LABELS,settings:{barWidth:r.getBarWidthInPixels(),isRtl:l,needlePosition:r.getNeedlePosition(!1)},lines:{[u?"y":"x"]:s.filter(ai).map((e=>{var t,n;return{scale:"m",value:e.refLineExpr.value,cId:e.cId,label:{text:e.label,...c.referenceLine.label.name,showValue:e.showValue,showLabel:e.showLabel},line:{stroke:o.getPaletteColor(e.paletteColor||{index:e.color}),strokeWidth:(null===(t=e.style)||void 0===t?void 0:t.lineThickness)||2,strokeDasharray:null===(n=e.style)||void 0===n?void 0:n.lineType}}}))},animations:{enabled:a.enabled,trackBy:e=>{const{type:t,cId:n,text:r,isConnector:i}=e;return"text"===t?`${n}-text-${r}`:"line"===t?i?`${n}-connector`:`${n}-line`:Math.random()}}}}({services:t});l?(u.push(e),u.push(r)):(u.push(r),u.push(e))}else o>=Zn.SPARK.width&&a>=Zn.SPARK.height?u.push(...Xi({services:t}),...Zi({chart:n,services:t}),...Wi({services:t}),...s?[Yi({services:t})]:[],...Ji({services:t}),function({services:e}){const{dockService:t,themeService:n,colorService:r,layoutService:i,animationsService:o}=e,{width:a,height:s}=t.meta.chart.size,{refLines:l}=i.meta,u=n.getStyles(),c=ri(a,s,yn,vn),{innerRadius:p,outerRadius:f}=c,d=oi({innerRadius:p,outerRadius:f,width:a,height:s}),m={type:"radial-custom-ref-line",key:_n.RADIAL_REFERENCE_LINES,displayOrder:1,settings:{barWidth:d},lines:{radial:l.filter(ai).map((e=>{var t,n;return{scale:"r",value:e.refLineExpr.value,cId:e.cId,label:{text:e.label,...u.referenceLine.label.name,showValue:e.showValue,showLabel:e.showLabel},radius:c.innerRadius,line:{stroke:r.getPaletteColor(e.paletteColor||{index:e.color}),strokeWidth:(null===(t=e.style)||void 0===t?void 0:t.lineThickness)||2,strokeDasharray:null===(n=e.style)||void 0===n?void 0:n.lineType}}}))},animations:{enabled:o.enabled,trackBy:e=>{const{type:t,cId:n}=e;return"line"===t?`${n}-line`:Math.random()},adjustTweenedNodes(e){e.forEach((e=>{const{type:t,data:n}=e;if("line"===t){const{angle:t,innerRadius:r}=n;e.x1=a/2+Math.cos(t)*r,e.y1=s/2+Math.sin(t)*r,e.x2=a/2+Math.cos(t)*(r+d),e.y2=s/2+Math.sin(t)*(r+d)}}))}}};return m}({services:t})):u.push(function({services:e}){const{dockService:t,layoutService:n,themeService:r,animationsService:i}=e,{width:o,height:a}=t.meta.chart.size,{rangeLimits:s,useSegments:l,segmentInfo:u,qHyperCube:c}=n.meta,{min:p,max:f}=s,d=c.qDataPages[0].qMatrix[0][0].qNum,m=ri(o,a,yn,vn).outerRadius;let h;h=d<p?yn:d>f?vn:yn+(d-p)/(f-p)*(vn-yn);const g=ni({services:e}),y=l?function({value:e,segmentInfo:t,themeService:n}){const{paletteColors:r,limits:i}=t,o=n.getTheme();if(!i.length)return o.getColorPickerColor(r[0]);const a=i.findIndex((t=>e<=t.value)),s=-1===a?r.length-1:a;return o.getColorPickerColor(r[s]||r[r.length-1])}({value:d,segmentInfo:u,themeService:r}):g({datum:{value:()=>0}});return{type:"radial-spark",key:_n.RADIAL_SPARK,layout:{displayOrder:2},settings:{fill:y,radius:m,valueAngle:h,width:o,height:a},animations:{enabled:i.enabled,trackBy:e=>e.type}}}({services:t}));return u}const eo=Math.log(10),to={log:(e,t)=>e<=0||t<=0?NaN:Math.log(e)/Math.log(t),log10:e=>e<=0?NaN:Math.log(e)/eo,getNiceNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/eo),r=e/10**n;return t=r<=1?1:r<=2?2:r<=5?5:10,t*10**n*(e<0?-1:1)},getSmallNiceNumber(e){let t;if(0===e)return 0;let n=Math.floor(Math.log(Math.abs(e))/eo);const r=e/10**n;return r<1?(t=5,n--):t=r<2?1:r<5?2:5,t*10**n*(e<0?-1:1)},getGoodNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/eo),r=e/10**n;return t=Math.ceil(r),7!==t&&9!==t||t++,r>1&&r<=1.5?t=1.5:r>2&&r<=2.5&&(t=2.5),t*10**n*(e<0?-1:1)},calculateTicks(e,t,n,r,i,o){return this.plotSize=e,this.explicitPlotMin=t,this.explicitPlotMax=n,this.minTickSpacingInPixel=r,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=o||0,this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),this.fontHeight=i,this.tickBaseValue=0,this.spaceUseLimit=.6,0===e?(this.plotMin=this.explicitPlotMin,this.plotMax=this.explicitPlotMax,this.tickDataSpacingNN=this.tickDataSpacing,co.call(this),fo.call(this)):(this.maxNumIntervals<1?oo.call(this):(this.explicitPlotMax>0&&this.explicitPlotMin<0?1===this.maxNumIntervals?io.call(this,!0):this.maxNumIntervals>=5?ro.call(this):this.maxNumIntervals<2?ao.call(this):so.call(this):ro.call(this),this.tickMaxIndex<this.tickMinIndex?(this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),oo.call(this)):lo.call(this)),co.call(this),fo.call(this))}};function no(e,t,n){void 0===e&&(e=null!==this.explicitPlotMin),void 0===t&&(t=null!==this.explicitPlotMax),this.tickDataSpacingNN=n?to.getGoodNumber(this.tickDataSpacing):to.getNiceNumber(this.tickDataSpacing),po.apply(this,[e,t])}function ro(){no.call(this);const e=this.tickMaxIndex-this.tickMinIndex;let t=this.plotMax-this.plotMin;this.spaceUseFactor=t/this.plotRange;let n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;if(n&&this.maxNumIntervals>=5){for(;this.tickDataSpacing<=this.absMax&&n;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),no.call(this),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;if(!n)return}for(this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),(n||e<=2&&this.maxNumIntervals>=2*e)&&no.apply(this,[void 0,void 0,!0]),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;this.tickDataSpacing<=this.absMax&&n;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),no.apply(this,[void 0,void 0,!0]),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel}function io(e){e?(this.tickDataSpacingNN=to.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=to.getNiceNumber(this.absMax),this.tickDataSpacingNN===this.absMax&&(this.tickDataSpacingNN=to.getNiceNumber(1.1*this.absMax)))}function oo(){let e;this.tickDataSpacingNN=to.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=to.getSmallNiceNumber(this.plotRange),this.tickBaseValue=Math.ceil(this.plotMin/e)*e)}function ao(){const e=this.explicitPlotMax>=-this.explicitPlotMin,t=e||null!==this.explicitPlotMin,n=!e||null!==this.explicitPlotMax;no.apply(this,[t,n,!0]);const r=(this.absMax+(1-this.spaceUseLimit)*this.absMin)/this.spaceUseLimit*1.0001;for(;this.tickDataSpacing<=r&&this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),no.apply(this,[t,n,!0]);const i=this.plotMax-this.plotMin;this.spaceUseFactor=i/this.plotRange}function so(){ro.call(this);const e=this.plotMax-this.plotMin;this.spaceUseFactor=e/this.plotRange}function lo(){const e=to.getNiceNumber(this.tickDataSpacingNN);if(this.tickDataSpacingNN===e||0!==this.tickBaseValue)return;const t=this.tickDataSpacingNN,n=this.tickMinIndex,r=this.tickMaxIndex,i=r-n,o=this.plotMin,a=this.plotMax;this.tickDataSpacingNN=e,po.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,u=this.tickMaxIndex-this.tickMinIndex;!l&&(u===i||u>=10||u>=3&&1.5*u>=i)||(this.tickDataSpacingNN=t,this.tickMinIndex=n,this.tickMaxIndex=r,this.plotMin=o,this.plotMax=a,this.plotRange=this.plotMax-this.plotMin)}function uo(){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 co(){let e,t;if(this.mainTickValues=[],this.secondaryTickValues=[],uo.call(this),0===this.plotSize)return;e=this.tickBaseValue;const n=this.tickMaxIndex-this.tickMinIndex;if(!(n<1)){for(t=0;t<=n;t++)this.mainTickValues.push(e+(t+this.tickMinIndex)*this.tickDataSpacingNN);for(e=this.tickBaseValue+this.tickDataSpacingNN/2,t=0;t<n;t++)this.secondaryTickValues.push(e+(t+this.tickMinIndex)*this.tickDataSpacingNN)}}function po(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 fo(){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 mo({core:e,dockService:t,rangeLimits:n,measureAxisSpacing:r,isRadial:i,isVertical:o,styleService:a}){const s=n.min,l=n.max,{width:u,height:c}=function(e){return{width:e.meta.chart.size.width,height:e.meta.chart.size.height}}(t);let p,f=96*r;if(i)p=Math.min(c,u);else{p=o?c:u;const{chart:t,picassoInstance:n}=e;if(t&&n){const e=t.formatter(zn.MEASURE),i=n.renderer("svg")(),d=a.query.axis.label.getStyle(),{fontFamily:m,fontSize:h}=d,g=e=>i.measureText({text:e,fontSize:Oi({width:u,height:c,fontSize:h}),fontFamily:m}),y=Math.max(96,...[s,l,(l-s)/2].map((t=>g(e(t)).width)));f=o?4*g("M").height:y;f=p/(Math.max(2,p/f/r+1)-1)}}const d=function({plotSize:e,rangeMax:t,rangeMin:n,minTickSpacingInPixel:r}){const i=to.calculateTicks(e,n,t,r,20,0);i.tickSpacing;const o=i.mainTickValues;0===o.length&&o.push(i.minTickValue);const a=o[0];o[0]=i.plotMin,a-i.plotMin>=i.tickSpacing/2&&o.splice(1,0,a);const s=i.mainTickValues[i.mainTickValues.length-1];return i.plotMax-s<=i.tickSpacing/2?o[i.mainTickValues.length-1]=i.plotMax:o.push(i.plotMax),o}({plotSize:p,rangeMin:s,rangeMax:l,minTickSpacingInPixel:f});return{values:d}}function ho({isRadial:e,dockService:t,isVertical:n}){return e?!t.config.rtl:!!n||t.config.rtl}function go({core:e,services:t,logicalSize:n}){if(!t.layoutService.meta.qHyperCube)throw new Error("Layout is missing a hypercube");const r=Qi({core:e,services:t}),i=function({core:e,services:t}){const{dockService:n,styleService:r,colorService:i,layoutService:o}=t,{rangeLimits:a,measureAxisSpacing:s,gaugetype:l}=o.meta,u=Ci({dockService:n,layoutService:o}),c="radial"===l,p=mo({core:e,dockService:n,rangeLimits:a,measureAxisSpacing:s,isRadial:c,isVertical:u,styleService:r});return{m:{data:{field:"qMeasureInfo/0"},type:"linear",invert:ho({isRadial:c,dockService:n,isVertical:u}),min:a.min,max:a.max,ticks:{values:p.values}},r:{data:{field:"qMeasureInfo/0"},invert:n.config.rtl,min:a.min,max:a.max},...i.getScales()}}({core:e,services:t});return{scales:i,components:r,formatters:{[zn.MEASURE]:{data:{field:"qMeasureInfo/0"}}},strategy:{layoutModes:Zn,logicalSize:n}}}const yo={Object_Gauge_RangeIsDefault:{id:"Object.Gauge.RangeIsDefault",locale:{"de-DE":"Max. und Min. auf Standardwerte festgelegt. Sie können über das Eigenschaften-Fenster unter Darstellung > Präsentation geändert werden.","en-US":"Max. and Min. set to default values. You can change them via the properties window under Display > Presentation.","es-ES":"Máx y mín se han configurado como valores predefinidos. Puede cambiarlos en el panel de propiedades en Aspecto > Presentación.","fr-FR":"Les valeurs max. et min. par défaut sont définies. Vous pouvez les modifier via le panneau des propriétés sous Aspect > Présentation.","it-IT":"Il massimo e il minimo vengono impostati sui valori predefiniti. È possibile modificarli nel pannello delle proprietà in Aspetto > Presentazione.","ja-JP":"最大値と最小値は規定値に設定されています。これは、スタイル > プレゼンテーションからプロパティ パネルで変更できます。","ko-KR":"최대 및 최소 값이 기본값으로 설정됩니다. 모양 > 프레젠테이션 아래 속성 패널에서 이를 변경할 수 있습니다.","nl-NL":"Max. en min. zijn ingesteld op standaardwaarden. U kunt deze wijzigen in het eigenschappenvenster onder Uiterlijk > Presentatie.","pl-PL":"Maks. i Min. są ustawione na wartości domyślne. Można je zmienić w panelu właściwości, w obszarze Wygląd > Prezentacja.","pr-BR":"Máx. e mín. estão definidos com valores padrão. É possível alterá-los no painel de propriedades, em Aparência > Apresentação.","ru-RU":"Максимальные и минимальные значения установлены по умолчанию. Эти значения можно изменить на панели свойств в меню Вид > Представление.","sv-SE":"Max och min är inställda på standardvärden. Du kan ändra dem i egenskapspanelen under Utseende > Presentation.","tr-TR":"Maks. ve min. değerleri varsayılan değerlere ayarlanmıştır. Görünüş > Sunum altındaki özellikler panelinden bu değerleri değiştirebilirsiniz.","zh-CN":"最大值和最小值已设置为默认值。您可以在“外观”>“显示”下的属性面板中进行更改。","zh-TW":"最大值與最小值均設為預設值。您可以在 [外觀] > [呈現方式] 之下的屬性面板中變更這些值。"}},Object_Gauge_RangeIsDefaultTitle:{id:"Object.Gauge.RangeIsDefaultTitle",locale:{"de-DE":"Bereich auf Standardwerte eingestellt","en-US":"Range set to default values","es-ES":"Rango fijado a valores predeterminados","fr-FR":"Plage définie sur les valeurs par défaut","it-IT":"Scala impostata sui valori predefiniti","ja-JP":"範囲は規定値に設定されています","ko-KR":"범위가 기본값으로 설정됩니다.","nl-NL":"Bereik ingesteld op standaardwaarden","pl-PL":"Zakres ustawiony na wartości domyślne","pt-BR":"Intervalo definido com valores padrão","ru-RU":"Значения диапазона установлены по умолчанию","sv-SE":"Intervallet har standardvärden","tr-TR":"Varsayılan değerlere ayarlı aralık","zh-CN":"范围设置为默认值","zh-TW":"範圍會設為預設值"}}};const vo={version:JSON.stringify("0.8.13"),qHyperCubeDef:{qMeasures:[],qInitialDataFetch:[{qWidth:1,qHeight:1}],qSuppressZero:!1,qSuppressMissing:!0},showTitles:!0,title:"",subtitle:"",footnote:"",measureAxis:{min:0,max:100,show:"all",spacing:1},orientation:"horizontal",segmentInfo:{limits:[],paletteColors:[{index:6}]},refLine:{refLines:[]},showDetails:!0,components:[],gaugetype:"radial",autoOrientation:!0,useSegments:!1,color:{useBaseColors:"measure"},paletteProgressColor:{index:6},angle:.7};function bo(e){return{properties:vo,data:{targets:[{path:"/qHyperCubeDef",...cn(e)}]}}}function xo(i){return function(e){if(e&&e.get&&e.add){const t="Object.Gauge.RangeIsDefault";if(e.get(t)!==t)return;Object.keys(yo).forEach((t=>{e.add(yo[t])}))}}(i.translator),{qae:bo(i),ext:mn(i),component(){const i=(()=>{const i=e(),o=t(),[a,s]=n({});return r((()=>{i.style.overflow="hidden";const e=h();e.use(m),e.component("oob-indicator",ti),e.component("radial-gauge-needle",ui),e.component("radial-custom-ref-line",bi),e.component("custom-ref-line",Di),e.component("radial-oob-indicator",ci),e.component("radial-spark",xi),e.component("disclaimer-component",hn);const t=e({renderer:{prio:[o.renderer||"svg"]}}),n=t.chart({element:i,data:[],settings:{}});return s({picassoInstance:t,chart:n,cache:Tt()}),()=>{n.destroy()}}),[]),a})(),o=Pi({core:i}),a=(({core:e,services:i})=>{const[o,a]=n({}),s=t(),l=u();return f((async()=>{if(!i)return Promise.resolve();const{colorService:t}=i;return t.initialize().then((()=>{const{layoutService:t}=i,n=wi({layout:t.getLayout(),options:s}),r=go({core:e,services:i,logicalSize:n});a(r)}))}),[i]),r((()=>{if(i&&i.dockService&&i.layoutService){const{dockService:t,layoutService:n,animationsService:r}=i;r.meta.isSizeChanging=!0;const o=wi({layout:n.getLayout(),options:s});t.update(o||l);const u=go({core:e,services:i,logicalSize:o});a(u)}}),[l]),o})({core:i,services:o});Ai({core:i,settings:a,services:o}),(({services:e})=>{d((t=>{if(e){const{dockService:n}=e,{width:r,height:i}=n.meta.chart.size;t.snapshotData=t.snapshotData||{content:{size:{w:r,h:i}}},t.snapshotData.content={size:{w:r,h:i}}}return Promise.resolve(t)}))})({services:o})}}}export{xo as default};
|
|
9
|
+
e.exports=function(e,t){if(!e||isNaN(+t))return t;var r,n,i,o,a,s,l,u,c,p,f=e.length,d=e.search(/[0-9\-\+#]/),m=d>0?e.substring(0,d):"",h=e.split("").reverse().join(""),g=h.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(r=(t="-"===(e=e.substring(d,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(n=e.match(/[^\d\-\+#]/g))&&n[n.length-1]||".",o=n&&n[1]&&n[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0===+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",y=(p=t[0]).length%l,f=p.length,b=0;b<f;b++)h+=p.charAt(b),!((b-y+1)%l)&&b<f-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(n=t.join(""))&&""!==n||(r=!1),m+(r?"-":"")+n+x}},Ut({exports:{}});var ir="'Source Sans Pro', 'Arial', 'sans-serif'",or="#333333",ar="#595959",sr="#737373",lr="#cccccc",ur="#e6e6e6";function cr(e){var t={};return[].concat(q(e),q([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",ar],["object","axis.label.name","fontFamily",ir],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",lr],["object","axis.line.minor","color",ur],["object","axis.title","color"],["object","axis.title","fontFamily",ir],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",ur],["object","grid.line.major","color",lr],["object","grid.line.minor","color",ur],["object","label.value","color",ar],["object","label.value","fontFamily",ir],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",ar],[!1,"label.value","lightColor",ur],["object","outOfRange","color","#999"],["object","legend.title","color",or],["object","legend.title","fontFamily",ir],["object","legend.title","fontSize","15px"],["object","legend.label","color",ar],["object","legend.label","fontFamily",ir],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",or],["object","referenceLine.label.name","fontFamily",ir],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",ur],["object","referenceLine.outOfBounds","fontFamily",ir],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",sr,function(e){return"transparent"===e?sr:e}]])).reduce(function(e,r){var n="".concat(r[0],"-").concat(r[1],"-").concat(r[2],"}");return t[n]||(t[n]=!0,e.push(r)),e},[]).sort(function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)})}var pr="object",fr=function(e){return e};function dr(e){var t=e.theme,r=e.id,n=e.transform,i=e.extend,o=e.matrix,a={},s=n.reduce(function(e,t){var r=x(t,2),n=r[0],i=r[1];return e[n]=i,e},{});return o.forEach(function(e){var n=x(e,5),i=n[0],o=n[1],l=n[2],u=n[3],c=n[4],p=void 0===c?function(e){return e}:c,f=function(e){var t=e.theme,r=e.base,n=e.path,i=e.attribute,o=e.defaultValue,a=void 0===o?void 0:o;if(!t||!1===r)return a;var s=t.getStyle(r,n,i);return void 0===s?a:s}({theme:t,base:i===pr&&r?"".concat(pr,".").concat(r):i,path:o,attribute:l,defaultValue:u}),d=(s["".concat(o,".").concat(l)]||fr)(p(f));$t(a,[o,l].filter(Boolean).join("."),d)}),i.forEach(function(e){var t=x(e,2),r=t[0],n=t[1];$t(a,r,n)}),a}function mr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hr,gr={exports:{}};var yr=(hr||(hr=1,self,gr.exports=(()=>{var e={909:e=>{var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},a=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var n,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(n in e);return void 0===n||t.call(e,n)},s=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},l=function(e,r){if("__proto__"===r){if(!t.call(e,r))return;if(i)return i(e,r).value}return e[r]};e.exports=function e(){var t,r,n,i,u,c,p=arguments[0],f=1,d=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},f=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});f<d;++f)if(null!=(t=arguments[f]))for(r in t)n=l(p,r),p!==(i=l(t,r))&&(m&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=n&&o(n)?n:[]):c=n&&a(n)?n:{},s(p,{name:r,newValue:e(m,c,i)})):void 0!==i&&s(p,{name:r,newValue:i}));return p}},8:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},a=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var n,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(n in e);return void 0===n||t.call(e,n)},s=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},l=function(e,r){if("__proto__"===r){if(!t.call(e,r))return;if(i)return i(e,r).value}return e[r]};e.exports=function e(){var t,r,n,i,u,c,p=arguments[0],f=1,d=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},f=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});f<d;++f)if(null!=(t=arguments[f]))for(r in t)n=l(p,r),p!==(i=l(t,r))&&(m&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=n&&o(n)?n:[]):c=n&&a(n)?n:{},s(p,{name:r,newValue:e(m,c,i)})):void 0!==i&&s(p,{name:r,newValue:i}));return p}}},r={};function n(t){var i=r[t];if(void 0!==i)return i.exports;var o=r[t]={exports:{}};return e[t](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{n.r(i),n.d(i,{default:()=>Ee});var e=n(229),t=n.n(e);const r=function(e,t,r){if(!t)return!1;var n,i=t.split("."),o=i[i.length-1],a=e;for(n=0;n<i.length-1;++n)void 0===a[i[n]]&&(a[i[n]]=Number.isNaN(+i[n+1])?{}:[]),a=a[i[n]];if(void 0!==r){var s=a[o];return a[o]=r,{updated:r,previous:s}}return delete a[o],!1},o=function(e,t,r){var n,i=t.split("."),o=e;if(void 0===o)return r;for(n=0;n<i.length;++n){if(void 0===o[i[n]])return r;o=o[i[n]]}return o},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function u(e){return s+e+l}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var r=function(e,t){if(!t)return null;var r,n;for(r=0;r<t.length;r++)if((n=t[r]).qInfo.qId===e)return n;return null}(e.qLibraryId,t.dimensionList);return r&&r.qData.info[0].qTags.indexOf("$numeric")>-1}var n=function(e,t){if(!t)return null;var r,n,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var r=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(r)&&(t=(t=t.substring(1,r)).trim()),t}(e);for(r=0;r<t.length;r++){if((n=t[r]).qName===i)return n;if(n.qDerivedFieldData)for(var o=0;o<n.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=n.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return n&&n.qTags.indexOf("$numeric")>-1}function p(e){return!(!e.fullAccumulation&&!e.fullRange)}function f(e,t){var r=e.crossAllDimensions;return 2===t&&r?"RowNo(Total)":"RowNo()"}function d(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),r=t.trim();return"="===r.substring(0,1)?r.substring(1).trim():r}function m(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function h(e,t){var r=e.crossAllDimensions;return 2===t&&r?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function v(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function b(e){var t=e.modifier,r=void 0===t?{}:t,n=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!r.showExcludedValues)return"";if(n&&1===n.length){var u=v(c(n[0],i),m(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(n&&2===n.length){var p=c(n[0],i),f=c(n[1],i),d=m(0),h=m(1),g=v(p,d),y=v(f,h);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function q(e){var t=e.properties,r=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(r,"qHyperCube.qDimensionInfo",[])).length}const D={isFullRange:p,getNumDimensions:q,getExpressionWithExcludedComp:function(e){var t=e.expression,r=e.modifier,n=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=u(d(t));if(!r.showExcludedValues)return a;var s=b({modifier:r,dimensions:n,dimensionAndFieldList:i}),l=o?"":", 0";if(n&&1===n.length){var c=m(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(n&&2===n.length){var p=m(0),f=m(1);return"If(Count(".concat(p,") * Count(").concat(f,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:f,getNumStepComp:function(e,t){if(!p(e)){var r=e.steps;return"number"!=typeof r||Number.isNaN(r)?6:r}return f(e,t)},getAboveCompPrefix:h,getAboveCompSuffix:g,getAboveComp:function(e,t,r,n){return h(e,t)+r+g(n)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,r){return"Aggr(".concat(e,", ").concat(t,", ").concat(r,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,r=e.properties,n=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===q({properties:r,layout:n})},getDimComp:function(e,t){var r=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),n=m(t);if(!r.qSortByExpression&&!r.qSortByNumeric&&!r.qSortByAscii)return n;var i=["Descending","Ascending"],o=r.qSortByNumeric?"(Numeric, ".concat(i[(r.qSortByNumeric+1)/2],")"):"",a=r.qSortByAscii?"(Text, ".concat(i[(r.qSortByAscii+1)/2],")"):"";return r.qSortByNumeric&&r.qSortByAscii?"(".concat(n,", ").concat(o,", ").concat(a,")"):r.qSortByNumeric?"(".concat(n,", ").concat(o,")"):r.qSortByAscii?"(".concat(n,", ").concat(a,")"):n},simplifyExpression:d,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var r=t.indexOf(s);if(-1!==r){var n=t.indexOf(l);if(-1!==n)return t.substring(r+s.length,n)}}},initModifier:function(e,t){Object.keys(t).forEach(function(r){void 0===e[r]&&(e[r]=t[r])})},isNumeric:c,isApplicable:function(e){var t=e.properties,r=e.layout,n=e.minDimensions,i=void 0===n?1:n,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!r)return!0;var s=q({properties:t,layout:r});return s>=i&&s<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(s),r=e.indexOf(l);return t>-1&&r>-1&&t<r},getDimDefWithWrapper:m,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,r){var n=t||e.outputExpression;if(e.base&&e.base.qDef&&(n=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=r.qHyperCubeDef.qMeasures.find(function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null});i&&t!==i.qDef.qLabel&&(n=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=a.OPTIONS.find(function(t){return t.value===e.decomposition});return t?a.EXPRESSIONS[t.value]:""}(e);n=n.startsWith("=")?n.substr(1):n,n="".concat(o,"(").concat(n,", ").concat(e.steps,")")}return n},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find(function(r){var n=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[r]&&n.includes(a.EXPRESSIONS[r].toLowerCase())&&(t=r),r}),t}};function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}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)}var A=t().bind(null,!0),w={},I=Array.isArray;function k(e){return null!=e&&!Array.isArray(e)&&"object"===M(e)}function C(e){return void 0===e}function L(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function E(e,t){var r,n=t.substring(1).split("/").slice(0,-1);return n.forEach(function(t,i){if(i!==n.length){r=+t;var o=Number.isNaN(r)?{}:[];e[r||t]=C(e[r||t])?o:e[t],e=e[r||t]}}),e}function N(e,t){var r=!0;if(k(e)&&k(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(n){N(e[n],t[n])||(r=!1)}),r);if(I(e)&&I(t)){if(e.length!==t.length)return!1;for(var n=0,i=e.length;n<i;n+=1)if(!N(e[n],t[n]))return!1;return!0}return e===t}w.generate=function(e,t,r){r=r||"";var n=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?A({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(r,"/").concat(i);N(o,a)||L(t,i)||(C(a)?n.push({op:"add",path:s,value:o}):k(o)&&k(a)?n=n.concat(w.generate(a,o,s)):I(o)&&I(a)?n=n.concat(function(e,t,r){var n=[],i=e.slice(),o=-1;function a(e,t,r){if(e[r]&&C(e[r].qInfo))return null;if(e[r]&&e[r].qInfo.qId===t)return r;for(var n=0,i=e.length;n<i;n+=1)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(N(t,i))return n;if(!C(t[0])&&C(t[0].qInfo))return n.push({op:"replace",path:r,value:t}),n;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(n.push({op:"remove",path:"".concat(r,"/").concat(s)}),i.splice(s,1)):n=n.concat(w.generate(i[s],t[o],"".concat(r,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(n.push({op:"add",path:"".concat(r,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(n.push({op:"move",path:"".concat(r,"/").concat(l),from:"".concat(r,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return n}(a,o,s)):n.push({op:"replace",path:"".concat(r,"/").concat(i),value:o}))}),Object.keys(e).forEach(function(i){C(t[i])&&!L(e,i)&&n.push({op:"remove",path:"".concat(r,"/").concat(i)})}),n},w.apply=function(e,t){t.forEach(function(t){var r,n,i=E(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(I(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(I(a)&&I(t.value)){var l,u=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return S(e)}(n=u)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(e,t):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(k(a)&&k(t.value))r=a,Object.keys(r).forEach(function(e){Object.getOwnPropertyDescriptor(r,e).configurable&&!L(r,e)&&delete r[e]}),A(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var c=E(e,t.from);I(i)?i.splice(+o,0,c.splice(+s,1)[0]):(i[o]=c[s],delete c[s])}else"remove"===t.op&&(I(i)?i.splice(+o,1):delete i[o])})},w.clone=function(e){return A({},e)},w.createPatch=function(e,t,r){var n={op:e.toLowerCase(),path:r};return"move"===n.op?n.from=t:void 0!==t&&(n.value=t),n},w.updateObject=function(e,t){Object.keys(e).length?w.apply(e,w.generate(e,t)):A(e,t)};const P=w,O=function(e,r,n){if(!e)return Promise.resolve();var i=P.generate(r,n);return t()(!0,r,n),i&&i.length?(i=i.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),e.applyPatches(i,!0)):Promise.resolve()};var F="accumulation";function T(e,t){var r=o(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===F)return r[n]}function R(e,t){var r=function(e,t){var r=o(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===F)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}var V={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const H={translationKey:"properties.modifier.accumulation",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,r=e.layout;return D.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,r=e.modifier,n=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!r)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:n,layout:i}));var u=o(n,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:r,dimensions:u,dimensionAndFieldList:s}),p=D.getNumStepComp(r,l),f=D.getAboveComp(r,l,c,p),d=D.getRangeComp("RangeSum",f);if(D.needDimension({modifier:r,properties:n,layout:i})){var m=D.getDimComp(u,1),h=D.getDimComp(u,0),g=D.getAggrComp(d,m,h);d=r.showExcludedValues?D.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return d},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.initModifier(e,V)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(R(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(R(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(R(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(R(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var r=T(t,e);if(r){var n=r.steps;r.steps="number"!=typeof n||Number.isNaN(n)?6:Math.abs(n)}},show:function(t){var r=T(t,e);return r&&!r.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(R(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,r,n){var i=n.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(F))return!1;var o=T(t,e);return o&&!o.disabled}};return r}};var j="movingAverage";function z(e,t){var r=o(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===j)return r[n]}function _(e,t){var r=function(e,t){var r=o(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===j)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}var B={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const $={translationKey:"properties.modifier.movingAverage",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,r=e.layout;return D.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,r=e.expression,n=e.modifier,i=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!n)return r;var u=s;void 0===u&&(u=D.getNumDimensions({properties:i,layout:a}));var c=o(i,"qHyperCubeDef.qDimensions",[]),p=n.showExcludedValues&&n.nullSuppression,f=D.getExpressionWithExcludedComp({expression:r,modifier:n,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:p}),d=D.getNumStepComp(n,u),m=D.getAboveComp(n,u,f,d);if(n.nullSuppression)t=D.getRangeComp("RangeAvg",m);else{var h=D.getRangeComp("RangeSum",m),g=function(e,t){var r=D.getRowNoComp(e,t);if(!D.isFullRange(e)){var n=e.steps,i="number"!=typeof n||Number.isNaN(n)?6:n;return"RangeMin(".concat(i,", ").concat(r,")")}return r}(n,u);t="".concat(h," / ").concat(g)}var y=t;if(D.needDimension({modifier:n,properties:i,layout:a})){var v=D.getDimComp(c,1),b=D.getDimComp(c,0),x=D.getAggrComp(y,v,b);y=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.initModifier(e,B)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(_(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(_(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(_(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(_(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var r=z(t,e);if(r){var n=r.steps;r.steps="number"!=typeof n||Number.isNaN(n)?6:Math.abs(n)}},show:function(t){var r=z(t,e);return r&&!r.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(_(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(_(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,r,n){var i=n.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(j))return!1;var o=z(t,e);return o&&!o.disabled}};return r}};var G="timeSeriesDecomposition";function U(e,t){var r=o(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===G)return r[n]}function W(e,t){var r=function(e,t){var r=o(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===G)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}var K={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const X={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,r=e.layout;return D.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,r=e.modifier,n=e.properties;return r?D.generateTSDExpression(r,t,n):t},extractInputExpression:D.extractInputExpression,initModifier:function(e,t){D.initModifier(e,K),""===e.decomposition&&t&&(e.decomposition=D.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(W(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:a.OPTIONS},steps:{refFn:function(t){return"".concat(W(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,r){var n=U(t,e);if(n){var i=n.steps;n.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),r.properties.qHyperCubeDef.qMeasures=r.properties.qHyperCubeDef.qMeasures.map(function(e){return e.qDef.modifiers.map(function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e}),e})}},show:function(t){var r=U(t,e);return r&&!r.fullRange}}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,r,n){var i=n.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(G))return!1;var o=U(t,e);return o&&!o.disabled}};return r}};var Z="difference";function Y(e,t){var r=o(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===Z)return r[n]}function J(e,t){var r=function(e,t){var r=o(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===Z)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,r=e.layout;return D.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},extractInputExpression:D.extractInputExpression,generateExpression:function(e){var t=e.expression,r=e.modifier,n=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!r)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:n,layout:i}));var u=o(n,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:r,dimensions:u,dimensionAndFieldList:s}),p=D.getAboveComp(r,l,c),f="".concat(c," - ").concat(p);if(D.needDimension({modifier:r,properties:n,layout:i})){var d=D.getDimComp(u,1),m=D.getDimComp(u,0),h=D.getAggrComp(f,d,m);f=r.showExcludedValues?D.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:h}):h}return f},initModifier:function(e){Object.keys(Q).forEach(function(t){void 0===e[t]&&(e[t]=Q[t])})},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(J(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(J(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(J(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,r,n){var i=n.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(Z))return!1;var o=Y(t,e);return o&&!o.disabled}};return r}};var te="normalization";function re(e,t){var r=o(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===te)return r[n]}function ne(e,t){var r=function(e,t){var r=o(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===te)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}function ie(e,t){for(var r=0;r<e.length;r++)if(e[r].value===t)return r;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,r){return 1===e?"{$<".concat(D.getFieldWithWrapper(t),"={'").concat(r,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ue(e,t,r){return 0===e&&t>1?"<".concat(D.getDimDefWithWrapper(r),">"):""}const ce={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,r=e.layout;return D.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},extractInputExpression:D.extractInputExpression,generateExpression:function(e){var t=e.expression,r=e.modifier,n=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!r)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:n,layout:i}));var u=o(n,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:r,dimensions:u,dimensionAndFieldList:s}),p=r.selectionScope,f=r.dimensionalScope;return function(e,t,r,n,i,o,a){var s=ae(t),l=se(t,r,n),u=""===s&&""===l?"":s||l,c=le(i,o),p=ue(i,o,a),f=function(e){for(var t=[],r=0;r<e;r++)t[r]=D.getDimDefWithWrapper(r);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(p," Aggr(").concat(u," ").concat(e,", ").concat(f,"))")}(c,p,r.field,r.value,f,l,r.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach(function(t){void 0===e[t]&&(e[t]=oe[t])})},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(ne(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(r){return function(e,t,r){var n=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return n=function(e,t){if(1===e){var r=ie(t,0);t.splice(r,1)}return t}(re(e,r).dimensionalScope,n),n}(r,t,e)}},field:{refFn:function(t){return"".concat(ne(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,r){return r.app.getFieldList().then(function(e){return e.map(function(e){return{label:e.qName,value:e.qName}})})},show:function(t){return 1===re(t,e).selectionScope}},value:{refFn:function(t){return"".concat(ne(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===re(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(ne(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(r,n){return function(e,t,r,n){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:r.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:r.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:r.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:r.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:r.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:r.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var r=ie(t,0);t.splice(r,1)}return t}(i,o),o=function(e,t){if(0===e){var r=ie(t,1);t.splice(r,1)}return t}(re(e,n).selectionScope,o),o}(r,n,t,e)}},primaryDimension:{refFn:function(t){return"".concat(ne(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(t,r){return 0===(re(t,e).dimensionalScope||0)&&r.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,r,n){var i=n.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=re(t,e);return o&&!o.disabled}};return r},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ue};var pe="qDef.base",fe="qDef.qDef",de="qDef.base.qDef",me="qLibraryId",he="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,de);return void 0!==t?t:o(e,fe)},getExpressionRef:function(e){return void 0!==o(e,de)?de:fe},getLibraryIdRef:function(e){return o(e,he)?he:me},getLibraryId:function(e){return o(e,he)||o(e,me)},getLabelRef:function(e){return o(e,pe)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,pe)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",qe="qDef.qLabel",De="qDef.qLabelExpression",Se="qDef.base.qLabel",Me="qDef.base.qLabelExpression",Ae="qDef.qAggrFunc",we="qDef.base.qAggrFunc",Ie={initBase:function(e,t){(t||Ie.isValid(e))&&(r(e,ve,o(e,ye)),r(e,xe,o(e,be)),r(e,Se,o(e,qe)),r(e,Me,o(e,De)))},restoreBase:function(e){Ie.isValid(e)&&(r(e,ye,o(e,ve)),r(e,be,o(e,xe)),r(e,qe,o(e,Se)),r(e,De,o(e,Me)),o(e,Ae)&&o(e,we)&&r(e,Ae,o(e,we)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),r=o(e,xe);return void 0!==t||void 0!==r}};const ke=Ie;function Ce(e){return Ce="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},Ce(e)}var Le={accumulation:H,movingAverage:$,difference:ee,normalization:ce,timeSeriesDecomposition:X};const Ee={modifiers:Le,apply:Pe,applyModifiers:Oe,cleanUpMeasure:Fe,destroy:function(e){e&&Ne[e.id]&&Ne[e.id].masterItemSubscriber&&(Ne[e.id].masterItemSubscriber&&Ne[e.id].masterItemSubscriber.unsubscribe(),delete Ne[e.id])},hasActiveModifiers:Te,getActiveModifier:Re,initBase:ke.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Le[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,r=e.properties,n=e.layout;return Array.isArray(t)&&t.some(function(e){return Le[e]&&Le[e].isApplicable({properties:r,layout:n})})},measureBase:ge,limitedSorting:function(e){var t=e.measures,r=e.properties,n=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=je(e);We({modifiers:t,properties:r,layout:n})&&(i=!0,o=o||Je({modifiers:t,properties:r,layout:n}))}),i&&!o},ifEnableTotalsFunction:Ve};var Ne={};function Pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.model,n=e.properties,i=e.isSnapshot,a=void 0!==i&&i,s=e.masterItem,l=!1;Ne[r.id]=Ne[r.id]||{isFirstTime:!0};var u=Ne[r.id].isFirstTime;if(Ne[r.id].isFirstTime=!1,n&&"object"===Ce(n))return Oe({model:r,properties:n});var c=r?r.layout:void 0,p=o(c,"qSelectionInfo.qInSelections");if(a||p)return Promise.resolve(l);var f=o(c,"qHyperCube.qMeasureInfo"),d=Ne[r.id].lastReloadTime;if(Ne[r.id].lastReloadTime=o(r,"app.layout.qLastReloadTime"),Te({measures:f,layout:c})){var m=function(e){var t=e.measures,r=e.layout,n=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==n&&function(e){var t=e.measures,r=e.properties,n=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ue({measure:e,properties:r,layout:n})})}({measures:t,layout:r})}({measures:f,layout:c,model:r,lastReloadTime:d});return m||function(e){var t=e.measures,r=e.layout,n=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||n||t.some(function(e){return function(e){var t=e.measure,r=e.layout;return We({modifiers:je(t),layout:r})?!t.base:!!t.base}({measure:e,layout:r})}))}({measures:f,layout:c,masterItem:s,isFirstTime:u})?r.getEffectiveProperties().then(function(e){var n=t()(!0,{},e);_e(n);var i=Qe(n);return Ke({model:r}).then(function(t){return Xe({libraryIds:i,model:r}).then(function(i){return m&&function(e){var t=e.properties;He(t).forEach(function(e){return function(e){var t=e.measure;if(Ue({measure:t,properties:e.properties})){var r=0,n=t.qDef.modifiers;Array.isArray(n)&&n.forEach(function(e){if("object"===Ce(e)&&!e.disabled){if(r++,"object"!==Ce(Le[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(r>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var n=Le[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==n&&$e(t)&&D.simplifyExpression(t.qDef.base.qDef)!==D.simplifyExpression(n)&&(t.qDef.base.qDef=n)}})}}({measure:e,properties:t})})}({properties:n}),Oe({model:r,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:i,dimensionAndFieldList:t})})})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===Ce(e.base)})}(f)?r.getEffectiveProperties().then(function(e){return function(e){var r=e.model,n=e.properties,i=Qe(n);return et({model:r,libraryIds:i}).then(function(){var e=t()(!0,{},n);return He(n).forEach(function(e){return Fe(e)}),Ye({oldProperties:e,newProperties:n,model:r})})}({model:r,properties:e})}):Promise.resolve(l)}function Oe(e){var r=e.model,n=e.oldProperties,i=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,p=e.dimensionAndFieldList;void 0===n&&(n=l?t()(!0,{},i):i),_e(i);var f=Qe(i);return et({model:r,libraryIds:f,masterItem:u}).then(function(){return function(e){var r=e.measures,n=e.properties,i=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(r||(r=He(n)),!r.length)return Promise.resolve();if(!Te({measures:r,properties:n}))return r.forEach(function(e){return Fe(e)}),Promise.resolve();var l=a?void 0:Qe(n);return Ke({model:i,dimensionAndFieldList:s}).then(function(e){return Xe({libraryIds:l,model:i,libraryItemsProps:a}).then(function(i){r.forEach(function(r){We({modifiers:r.qDef.modifiers,properties:n})?(function(e){var r=e.measure,n=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;ke.isValid(r)||ke.initBase(r,!0);var l=r.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach(function(e){if("object"===Ce(e)&&!e.disabled){if(s++,"object"!==Ce(Le[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Le[e.type].initModifier(e,r);var l=r.qLibraryId||c&&c.qLibraryId;l?function(e){var r=e.measure,n=e.modifier,i=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Le[n.type].generateExpression({expression:s,modifier:n,properties:i,dimensionAndFieldList:o});n.outputExpression=l,r.qDef.qDef=n.outputExpression,(r.qDef.qLabel||a.qMeasure.qLabel)&&(r.qDef.qLabel=a.qMeasure.qLabel),(r.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(r.qDef.qLabelExpression=a.qMeasure.qLabelExpression),r.qDef.quarantine&&r.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(r.qDef.qNumFormat=a.qMeasure.qNumFormat,r.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete r.qLibraryId,r.qDef.coloring=a.qMeasure.coloring,n.base=t()(!0,{},r.qDef.base)}({measure:r,modifier:e,libraryId:l,properties:n,libraryItemsProps:i,dimensionAndFieldList:a}):function(e){var r=e.measure,n=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof Le[n.type].updateModifier&&Le[n.type].updateModifier(n,i.qHyperCubeDef);var a=ge.getExpression(r),s=""===a?a:Le[n.type].generateExpression({expression:a,modifier:n,properties:i,dimensionAndFieldList:o});n.outputExpression=s,r.qDef.qDef=n.outputExpression,r.qDef.base.qLabelExpression?r.qDef.qLabelExpression=r.qDef.base.qLabelExpression:r.qDef.qLabel=r.qDef.base.qLabel||a,n.base=t()(!0,{},r.qDef.base)}({measure:r,modifier:e,properties:n,dimensionAndFieldList:a}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||Ve(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&Ve(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(r)}})}({measure:r,properties:n,libraryItemsProps:i,dimensionAndFieldList:e}),Be(r)):Fe(r)})})})}({measures:a,properties:i,model:r,libraryItemsProps:c,dimensionAndFieldList:p}).then(function(){return l?Ye({oldProperties:n,newProperties:i,model:r}):Promise.resolve(!1)})})}function Fe(e){!function(e){var t=je(e);return Array.isArray(t)&&t.some(function(e){return"object"===Ce(e)&&!e.disabled&&!Le[e.type]})}(e)?ke.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Be(e)}function Te(e){var t=e.measures,r=e.properties,n=e.layout;return!!Array.isArray(t)&&t.some(function(e){return We({modifiers:je(e),properties:r,layout:n})})}function Re(e){var t=je(e);if(Array.isArray(t))for(var r=0;r<t.length;r++){var n=t[r];if(Le[n.type]&&!n.disabled)return n}}function Ve(e){var t=Re(e);return!t||Le[t.type].enableTotalsFunction(e)}function He(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function je(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function ze(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function _e(e){He(e).forEach(function(e){return function(e){var r=Re(e);r&&(void 0!==r.outputExpression&&ze(r)!==e.qDef.qDef?delete e.qDef.base:!ke.isValid(e)&&r.base&&(e.qDef.base=t()(!0,{},r.base)))}(e)})}function Be(e){var t=je(e);Array.isArray(t)&&t.forEach(function(t){"object"===Ce(t)&&(t.disabled||!Le[t.type]&&ze(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function $e(e){return e.base||e.qDef&&e.qDef.base}function Ge(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function Ue(e){var t=e.measure,r=e.properties,n=e.layout;return!Ge(t)&&We({modifiers:je(t),properties:r,layout:n})}function We(e){var t=e.modifiers,r=e.properties,n=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==Ce(e)||e.disabled||!Le[e.type])&&(void 0===i[e.type]&&(i[e.type]=Le[e.type].isApplicable({properties:r,layout:n})),i[e.type])})}function Ke(e){var t=e.model,r=e.dimensionAndFieldList;if(r)return Promise.resolve(r);var n=[],i={},o=t.app.getDimensionList().then(function(e){i.dimensionList=e});n.push(o);var a=t.app.getFieldList().then(function(e){i.fieldList=e});return n.push(a),Promise.all(n).then(function(){return i})}function Xe(e){var t=e.libraryIds,r=e.model,n=e.libraryItemsProps;if(n)return Promise.resolve(n);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach(function(e){var t=r.app.getMeasure(e).then(function(t){return t.getProperties().then(function(t){a[e]=t})});s.push(t)}),o.forEach(function(e){var t=r.app.getDimension(e).then(function(t){return t.getProperties().then(function(t){a[e]=t})});s.push(t)}),Promise.all(s).then(function(){return a})}function Ze(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ye(e){var t=e.oldProperties,r=e.newProperties,n=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Ze)!==JSON.stringify(o(r,"qHyperCubeDef.qMeasures"),Ze)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ze)!==JSON.stringify(o(r,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ze);return i?function(e){var t=e.model,r=e.oldProperties,n=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(n):O(t,r,n)}({model:n,oldProperties:t,newProperties:r}).then(function(){return i}):Promise.resolve(i)}function Je(e){var t=e.modifiers,r=e.properties,n=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===Ce(e)&&!e.disabled&&Le[e.type]&&Le[e.type].needDimension({modifier:e,properties:r,layout:n})})}function Qe(e){var t=He(e),r=[],n=[],i=!1;return t.forEach(function(t){var n=je(t);if(We({modifiers:n,properties:e})){var o=Ge(t);o&&r.push(o),i=i||Je({modifiers:n,properties:e})}}),o(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&n.push(t)}),{measureLibraryIds:r,dimensionLibraryIds:n}}function et(e){var t=e.model,r=e.libraryIds;return!e.masterItem&&r&&(r.measureLibraryIds.length||r.dimensionLibraryIds.length)?(Ne[t.id].masterItemSubscriber=Ne[t.id].masterItemSubscriber||function(e){var t=e.model,r=e.callback,n={},i={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},r=o(e,"qInfo.qType");return r&&s[r]&&s[r].forEach(function(r){t[r]=o(e,r)}),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(n[t]){var i=l(e);n[t].properties!==i&&(n[t].properties=i,"function"==typeof r&&n[t].enabled&&r(e)),n[t].enabled=!0}}function c(e,r){return t.app[r](e).then(function(t){n[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}})}return{subscribe:function(e){var r=e.measureLibraryIds,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach(function(e){i[e]=!0}),a={},t.forEach(function(e){a[e]=!0})}({measureLibraryIds:r,dimensionLibraryIds:o}),Object.keys(n).forEach(function(e){i[e]||a[e]||(n[e].listener.dispose(),delete n[e])}),t.app&&(Object.keys(i).forEach(function(e){i[e]&&!n[e]&&s.push(c(e,"getMeasure"))}),Object.keys(a).forEach(function(e){a[e]&&!n[e]&&s.push(c(e,"getDimension"))})),Promise.all(s)},unsubscribe:function(){Object.keys(n).forEach(function(e){n[e].listener.dispose()}),n={}}}}({model:t,callback:function(e){return Pe({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),Ne[t.id].masterItemSubscriber.subscribe(r)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};return(()=>{function e(t){var r,n=t;return n>9?(r=65+n-10)>90&&(r+=6):n="".concat(n).charCodeAt(0),[48,111,79,105,73,108].indexOf(r)>-1?e(n+1):String.fromCharCode(r)}function t(r){var n=e(r%62),i=Math.floor(r/62);return i>0?t(i)+n:n}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}r.d(n,{default:()=>_e});const o={getValue:function(e,t,r){if(null==e||null==t)return r;for(var n=t.split("."),i=e,o=0;o<n.length;++o){var a=n[o];if(""!==a){if(void 0===i[a]||null===i[a])return r;i=i[a]}}return i},setValue:function(e,t,r){if(null!=e&&null!=t){for(var n=t.split("."),i=n[n.length-1],o=e,a=0;a<n.length-1;++a){var s=n[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+n[a+1])?{}:[]),o=o[s]}void 0!==r?o[i]=r:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t,r){if(e){for(var n=0;n<e.length;n++)if(e[n][t]===r)return n;return-1}return-1}const p={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var r=e.indexOf(t[0]);if(-1!==r){for(var n=0;n<t.length;n++){var i=e.indexOf(t[n]);if(r>i)return!1;r=i}return!0}return!1},indexAdded:function(e,t){var r;for(r=0;r<e.length;++r)e[r]>=0&&e[r]>=t&&++e[r];e.push(t)},indexRemoved:function(e,t){var r,n=0;for(r=0;r<e.length;++r)e[r]>t?--e[r]:e[r]===t&&(n=r);return e.splice(n,1),n},findItemByPropertyValue:function(e,t,r){if(e){for(var n=0;n<e.length;n++)if(e[n][t]===r)return e[n];return null}return null},findIndexByPropertyValue:c};var f=r(8),d=r.n(f);const m=function(e){var t,r=e.exportFormat,n=e.qHyperCubeDef,i=r.data[0];(t=i.dimensions).push.apply(t,a(n.qDimensions));var s,l=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},h=function(e){var t,r=e.exportFormat,n=e.qHyperCubeDef,i=r.data[0];(t=i.measures).push.apply(t,l(n.qMeasures));var a,s=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,r=e.qHyperCubeDef,n=t.data[0];r.qInterColumnSortOrder||(r.qInterColumnSortOrder=[]),n.interColumnSortOrder=r.qInterColumnSortOrder.concat();var i=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&p.isOrderedSubset(i,n.interColumnSortOrder)&&(n.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,r=e.properties;Object.keys(r).forEach(function(e){t.properties[e]=r[e]})},v=function(e){var t=e.exportFormat,r=e.properties;r.qLayoutExclude||(r.qLayoutExclude={}),r.qLayoutExclude.disabled&&(Object.keys(r.qLayoutExclude.disabled).forEach(function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=r.qLayoutExclude.disabled[e])}),delete r.qLayoutExclude.disabled),r.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach(function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)})}(r),delete r.qLayoutExclude.changed),r.qLayoutExclude.quarantine&&!o.isEmpty(r.qLayoutExclude.quarantine)||delete r.qLayoutExclude},b=function(e){e.forEach(function(e){d().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)})};function x(e,t,r){var n,i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(n=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2&&!a)return;s=JSON.parse(n)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var l=o.getValue(e,"qLayoutExclude.quarantine");l[r]||(l[r]={}),l[r][t]=s}var q=r(909),D=r.n(q);function S(e,t){var r=D()(!0,{},t,e);return o.getValue(r,"qOtherTotalSpec.qOtherCounted")||o.setValue(r,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(r,"qOtherTotalSpec.qOtherLimit")||o.setValue(r,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),r.hasOwnProperty("othersLabel")||(r.othersLabel="Others"),r}function M(e,t){return D()(!0,{},t,e)}function A(e,t,r){return"function"==typeof e?e(t):Number.isNaN(+e)?r:e}var w=Math.pow(2,53)-1;function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}const C=function(e,t,r){var n="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(r,"qInfo.qType");o.setValue(e,"qInfo.qType",n),e.visualization=r.visualization},L=function(e,t,r){t.hasOwnProperty(e)&&(r[e]=t[e])},E=function(e,t,r,n){t.hasOwnProperty(e)?r[e]=t[e]:r[e]=n},N=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},P=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},O=function(e){var t,r=e.exportFormat,n=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=r.data[0];for(t=0;t<s.dimensions.length;++t){var l=S(s.dimensions[t],a);o.qDimensions.length<n?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var u=S(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},F=function(e){var t,r=e.exportFormat,n=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=r.data[0];for(t=0;t<s.measures.length;++t){var l=M(s.measures[t],a);o.qMeasures.length<n?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var u=M(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},T=function(e){var t=e.exportFormat,r=e.dataDefinition,n=void 0===r?{}:r,i=t.data[0],o=n.dimensions||{max:0},a=n.measures||{max:0},s=A(a.max,i.dimensions.length,w),l=A(a.min,i.dimensions.length,0);return{maxDimensions:A(o.max,s,w),minDimensions:A(o.min,l,0),maxMeasures:s,minMeasures:l}},R=function(e){var t=e.exportFormat,r=e.newHyperCubeDef,n=t.data[0],i=r.qDimensions.length+r.qMeasures.length;r.qInterColumnSortOrder=n.interColumnSortOrder.concat();var o=r.qInterColumnSortOrder.length;if(o!==i)for(r.qLayoutExclude&&(r.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=n.interColumnSortOrder.concat());o!==i;)o<i?(p.indexAdded(r.qInterColumnSortOrder,o),++o):(--o,p.indexRemoved(r.qInterColumnSortOrder,o))},V=function(e){var t=e.exportFormat,r=e.initialProperties,n=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach(function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=D()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&n?o.setValue(i,"".concat(n,".qHyperCubeDef"),t.properties.qHyperCubeDef):r.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some(function(e){return"general"===e.key})}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]}),null===(i=D()(!0,{},r,i)).components&&(i.components=[]),i},H=function(e){var t=e.exportFormat,r=e.maxDimensions,n=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>r&&r>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>n||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!r&&a.dimensions.length>0},j=function(e){var t=e.exportFormat,r=e.maxDimensions,n=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>r&&r>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>n)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!r&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},z=function(e){var t,r=e.newProperties,n=e.dataDefinition,i=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var a=o.getValue(r,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return I(e)}(t=a.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return I(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?I(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qDimensions=[],s.forEach(function(e){a.qDimensions.push(e),n.dimensions.added(e,r)})}},_=function(e){var t,r=e.newProperties,n=e.dataDefinition,i=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var a=o.getValue(r,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return k(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?k(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qMeasures=[],s.forEach(function(e){a.qMeasures.push(e),n.measures.added(e,r)})}},B=function(e){var t=e.measures,r=e.modifierTypes;t&&r&&d().isSupportedModifiers(r)&&t.forEach(function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store})};function $(e,t){var r=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!r&&(Object.keys(r).forEach(function(t){o.setValue(e,t,r[t])}),delete e.qLayoutExclude.quarantine[t],!0)}const G={exportProperties:function(e){var t=e.propertyTree,r=e.hypercubePath,n=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},r=0;r<e;++r)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,r||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),m({exportFormat:i,qHyperCubeDef:l}),h({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:a}),r&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),v({exportFormat:i,properties:a}),n||b(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(x(i.properties,"filters","storedFilters",!0),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(x(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(x(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,r=e.initialProperties,n=void 0===r?{}:r,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,u=e.hypercubePath,c=e.extension,p=e.supportedFilters,f=void 0===p||p,d=e.isHCModifierSupported,m=void 0===d||d,h={qChildren:[]},g=V({exportFormat:t,initialProperties:n,hypercubePath:u}),y=o.getValue(n,u||"").qHyperCubeDef,v=o.getValue(g,u||"").qHyperCubeDef,b=T({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,q=b.minDimensions,D=b.maxMeasures,S=b.minMeasures,M=l.defaultDimension,A=void 0===M?N():M,w=l.defaultMeasure,I=void 0===w?P():w;v.qDimensions.length=0,v.qMeasures.length=0,H({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S})&&j({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S,newHyperCubeDef:v}),O({exportFormat:t,maxDimensions:x,minDimensions:q,newHyperCubeDef:v,defaultDimension:A}),F({exportFormat:t,maxMeasures:D,minMeasures:S,newHyperCubeDef:v,defaultMeasure:I}),z({newProperties:g,dataDefinition:a,hypercubePath:u}),_({newProperties:g,dataDefinition:a,hypercubePath:u}),R({exportFormat:t,newHyperCubeDef:v}),L("qMaxStackedCells",y,v),L("qNoOfLeftDims",y,v),E("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),E("qMode",y,v,"S"),E("qReductionMode",y,v,"N"),E("qSortbyYValue",y,v),E("qIndentMode",y,v),E("qShowTotalsAbove",y,v),C(g,t,n),h.qProperty=g;var k=o.getValue(c||{},"support.modifiers");return B({measures:v.qMeasures,modifierTypes:k}),f&&$(h.qProperty,"storedFilters"),"S"===v.qMode&&m&&$(h.qProperty,"dynamicScript"),h}};var U={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function W(e,t,r,n){t=t||[];var i=c(e,n,r),o=c(t,n,r);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function K(e,t){return e.length!==t}const X={create:function(e,t){if(!e||!U[e])throw new Error("Attribute Expressions Util: ID required");var r={};return t&&Object.keys(t).forEach(function(e){r[e]=t[e]}),r.id=e,r.qAttribute=!0,r},moveByIdFromGroup:function(e,t,r,n,i){r=r||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][r],s=t.length;if(W(a,t,n,i),K(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},Z={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},Y={colorModeOptions:{primary:function(){return!0},dimension:function(e){return Z.getNumDimensions(e)>0&&Z.getNumMeasures(e)<=1},multiColor:function(e){return Z.getNumMeasures(e)>1},measure:function(e){return Z.getNumDimensions(e)>0},expression:function(e){return Z.getNumMeasures(e)>=1}}},J={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return Z.getNumMeasures(e)>=1}}};var Q={scatterplot:J,"sn-scatter-plot":J,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return Z.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return Z.getNumDimensions(e)>1},multiColor:function(e){return Z.getNumMeasures(e)>1},measure:function(e){return Z.getNumDimensions(e)<=1},expression:function(e){return Z.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return Z.getNumDimensions(e)>=1},multiColor:function(e){return Z.getNumMeasures(e)>1},measure:function(e){return Z.getNumDimensions(e)>=1},expression:function(e){return Z.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return Z.getNumDimensions(e)>=1}}}};function ee(e,t,r){if(Array.isArray(e[t])){var n=p.findIndexByPropertyValue(e[t],"id",r);n>=0&&e[t].splice(n,1)}else e[t]=[]}function te(e,t){var r=X.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach(function(e){ee(e,"qAttributeDimensions",r),ee(e,"qAttributeExpressions",r)}),t.forEach(function(e){ee(e,"qAttributeDimensions",r),ee(e,"qAttributeExpressions",r)})}function re(e,t){if(t){var r="="===t.charAt(0);e.color.altLabel=r?{qStringExpression:{qExpr:t.substr(1)}}:t}}function ne(e){var t=e.properties,r=e.isDimension,n=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;te(n,i);var l=n[n.length-1];if(l){var u=r?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),f=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var d=X.create(X.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,r=e.label,n=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=r||n.label,i?t.qDef=n.key:(t.qExpression=n.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=n.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:d,label:s,item:u,isDimension:r,qNumFormat:c,isCustomFormatted:f});break;case"libraryItem":!function(e){var t=e.attributeExpression,r=e.measures,n=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=p.findIndexByPropertyValue(r,"qLibraryId",n.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==n.expression?t.qExpression=n.expression:t.qLibraryId=n.key,t.colorMapRef=n.key}({attributeExpression:d,measures:a,item:u,isDimension:r,qNumFormat:c,isCustomFormatted:f})}r?(d.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(d)):l.qAttributeExpressions.push(d)}}}function ie(e,t,r,n){var i,o,a,s={};switch(e){case"dimension":r.qLibraryId?(s.type="dimension",s.name=r.qLibraryId,s.id=r.qLibraryId):(s.type="field",t?(s.name=r.label||r.qDef,s.id=r.qDef):(s.name=r.qDef.qFieldDefs[0],s.label=(a=r.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":i=function(e,t){return t?e.qLibraryId:d().measureBase.getLibraryId(e)}(r,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return d().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(r,n),o&&(s.expression=o)):(s.type="expression",t?(s.name=r.label||r.qExpression,s.id=r.qExpression):(s.name=r.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(r)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,r,n){var i=t.type,o=e.color,a=o.mode,s=Z.getItemLabel(t);switch(re(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||Z.wrapFieldName(t.name),key:Z.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:s,key:t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}o.auto=!1,o.mode=a}function se(e,t){var r=o.getValue(e,"".concat(t,"qDimensions"),[]),n=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&re(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var r=o.getValue(e,"".concat(t,"qDimensions"),[]),n=o.getValue(e,"color.byDimDef");n.activeDimensionIndex=Math.min(n.activeDimensionIndex,r.length-1);var i=ie("dimension",!1,r[n.activeDimensionIndex]);i.activeDimensionIndex=n.activeDimensionIndex,ae(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var r=o.getValue(e,"".concat(t,"qDimensions"),[]),n=r[function(e,t,r){var n=o.getValue(t,"visualization"),i=r.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===n&&"point"===s}(r,e,t)?0:r.length-1],i=X.IDMAP.COLOR_BY_ALTERNATIVE,a=p.findItemByPropertyValue(n.qAttributeDimensions,"id",i);return ae(e,ie("dimension",!!a,a||n)),!!a}(e,t))return;ne({properties:e,isDimension:!0,dimensions:r,excludedDimensions:i,measures:n,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,r){o.setValue(e,t,r),o.isAtomicValue(r)&&function(e,t,r){var n=e.qLayoutExclude;n&&(n.changed||(n.changed={}),n.changed[t]={from:o.getValue(e,t),to:r})}(e,t,r)},ue=function(e,t){var r={primary:!0};if(e){var n=(Q[t]||Y).colorModeOptions||Y.colorModeOptions;r.byDimension=n.dimension(e),r.byMeasure=n.measure(e),r.byMultiple=n.multiColor(e),r.byExpression=n.expression(e)}return r},ce=function(e){var t=e.canColorBy,r=e.autoColor,n=e.colorMode,i=e.dimensions;return!(t[n]&&!r&&("byDimension"!==n&&"byMeasure"!==n||!i.length))},pe=function(e,t){var r,n=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),a=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(a,l):!(r={auto:i,colorMode:n,dimensions:a}).auto&&"byDimension"===r.colorMode&&r.dimensions.length>0?se(e,t):function(e){var t=e.auto,r=e.colorMode,n=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==r||!n.length||"map"!==s&&!i.length)}({auto:i,colorMode:n,dimensions:a,measures:s,properties:e})?function(e,t){var r=o.getValue(e,"".concat(t,"qDimensions"),[]),n=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&re(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var r=o.getValue(e,"".concat(t,"qMeasures"),[]),n=o.getValue(e,"color.byMeasureDef");if(n.activeMeasureIndex=Math.min(n.activeMeasureIndex,r.length-1),n.activeMeasureIndex>-1){var i=ie("measure",!1,r[n.activeMeasureIndex],!0);i.activeMeasureIndex=n.activeMeasureIndex,ae(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,n)&&function(e,t){var r=o.getValue(e,"".concat(t,"qDimensions"),[]),n=o.getValue(e,"".concat(t,"qMeasures"),[]),i=r[r.length-1],a=X.IDMAP.COLOR_BY_ALTERNATIVE,s=p.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return ae(e,ie("measure",!!s,s||n[0])),!!s}(e,t))return;ne({properties:e,isDimension:!1,dimensions:r,excludedDimensions:i,measures:n,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var r=o.getValue(e,"color.mode"),n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===r&&i.length<2&&o.setValue(e,"color.mode","primary"),te(n,a)}(e,t)},fe=function(e){e.forEach(function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode})},de=function(e){var t=e.shouldUpdateColorBy,r=e.properties,n=o.getValue(r,"qHyperCubeDef.qMeasures",[]),i=o.getValue(r,"color.mode","");return!t&&"byExpression"===i&&n.length>0},me=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),r=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:r,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},he=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),r=o.getValue(e,"color.persistent",!1);return t.length>1&&!r},ye={exportProperties:function(e){var t=e.propertyTree,r=e.hypercubePath,n=e.viewDataMode,i=G.exportProperties({propertyTree:t,hypercubePath:r,viewDataMode:n}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=X.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return X.moveByIdFromGroup(a,[],"qAttributeDimensions",u),X.moveByIdFromGroup(a,[],"qAttributeExpressions",u),X.moveByIdFromGroup(s,[],"qAttributeExpressions",c),i},importProperties:function(e){var t=e.exportFormat,r=e.initialProperties,n=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=G.importProperties({exportFormat:t,initialProperties:r,dataDefinition:n,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty,f=o.getValue(p,"visualization"),d=o.getValue(p,"qHyperCubeDef.qDimensions",[]),m=o.getValue(p,"color.mode",""),h=o.getValue(p,"color.auto",""),g=ue(p,f),y=ce({canColorBy:g,autoColor:h,colorMode:m,dimensions:d});return g[m]?de({shouldUpdateColorBy:y,properties:p})&&me(p):he(p),y&&pe(p,"qHyperCubeDef."),ge(p)&&le(p,"color.persistent",!0),fe(d),c}};var ve=["bar","marker","line"];const be=function(e){var t=e.initialProperties,r=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?$(r,"unsupportedAutoMinMax")||D()(r.measureAxis,t.measureAxis):$(r,"supportedAutoMinMax")||D()(r.measureAxis,t.measureAxis)},xe=function(e){var t,r=e.exportFormat,n=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:r,initialProperties:n})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach(function(e){if(e.qDef.series){var r=e.qDef.series,n=r.type,i=r.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),ve.includes(n)&&t[i].type[n]++,t[i].type.total++}}),t}(a);l.length?(o&&(t=l.filter(function(e){return e.type[o]>0}).sort(function(e,t){return t.type[o]-e.type[o]})),t&&t.length||(t=l.sort(function(e,t){return t.type.total-e.type.total})),t&&t[0]&&D()(s,r.properties.measureAxes[t[0].axis])):D()(s,r.properties.measureAxes[0])}},qe=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var r=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=r}}},De={exportProperties:function(e){var t=e.propertyTree,r=e.hypercubePath,n=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=ye.exportProperties({propertyTree:t,hypercubePath:r,viewDataMode:n}),s=a.properties;return o?(x(s,"measureAxis.min","supportedAutoMinMax"),x(s,"measureAxis.max","supportedAutoMinMax")):(x(s,"measureAxis.min","unsupportedAutoMinMax"),x(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,r=e.initialProperties,n=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=ye.importProperties({exportFormat:t,initialProperties:r,dataDefinition:n,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty;return be({initialProperties:r,properties:p}),xe({exportFormat:t,initialProperties:r,properties:p,measureType:a}),qe(p.qHyperCubeDef),p.qHyperCubeDef.qColumnOrder=[],p.qHyperCubeDef.columnOrder=[],c}};function Se(e,t,r){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(r)}function Me(e){var t=e.properties,r=e.arrayPath,n=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,r,[]).forEach(function(e){return function(e){var t=e.properties,r=e.quarantineName,n=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var u=Se(r,n,l);o.setValue(t,u,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:n,arrayName:i,item:e,itemPath:a})})}function Ae(e){var t=e.properties,r=e.arrayPath,n=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,r,[]).forEach(function(e){return function(e){var t=e.properties,r=e.quarantineName,n=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=Se(r,n,s),u=o.getValue(t,l);void 0!==u&&(o.setValue(i,a,u),o.setValue(t,l,void 0))}}({properties:t,quarantineName:n,arrayName:i,item:e,itemPath:a})})}var we="qHyperCubeDef.qMeasures",Ie="conditionalColoring",ke="measures",Ce="qDef.conditionalColoring";const Le={quarantine:function(e){Me({properties:e,arrayPath:we,quarantineName:Ie,arrayName:ke,itemPath:Ce})},unquarantine:function(e){Ae({properties:e,arrayPath:we,itemPath:Ce,arrayName:ke,quarantineName:Ie})}};var Ee="qHyperCubeDef.qMeasures",Ne="measures",Pe="qHyperCubeDef.qDimensions",Oe="dimensions",Fe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Te="alternativeMeasures",Re="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",Ve="alternativeDimensions",He="qCalcCondition",je="conditionalShowHide";const ze={quarantine:function(e){Me({properties:e,arrayPath:Ee,quarantineName:je,arrayName:Ne,itemPath:He}),Me({properties:e,arrayPath:Pe,quarantineName:je,arrayName:Oe,itemPath:He})},unquarantine:function(e){Ae({properties:e,arrayPath:Ee,quarantineName:je,arrayName:Ne,itemPath:He}),Ae({properties:e,arrayPath:Pe,quarantineName:je,arrayName:Oe,itemPath:He})},quarantineAlternative:function(e){Me({properties:e,arrayPath:Fe,quarantineName:je,arrayName:Te,itemPath:He}),Me({properties:e,arrayPath:Re,quarantineName:je,arrayName:Ve,itemPath:He})},unquarantineAlternative:function(e){Ae({properties:e,arrayPath:Fe,quarantineName:je,arrayName:Te,itemPath:He}),Ae({properties:e,arrayPath:Re,quarantineName:je,arrayName:Ve,itemPath:He})}},_e={hypercube:G,colorChart:ye,axisChart:De,quarantineProperty:x,unquarantineProperty:$,quarantineArrayProp:Me,unquarantineArrayProp:Ae,conditionalColoring:Le,conditionalShow:ze}})(),n.default})()),gr.exports),vr=mr(yr);function br(e){return{dimensions:{min:0,max:0},measures:{min:1,max:1,description:()=>e.translator.get("Visualizations.Descriptions.Gauge.Measure")}}}const xr=(e,t,r)=>{const n=function(e){var t=e.theme,r=e.translator,n=e.config,i=void 0===n?{}:n,o=e.flags,a=function(e){var t=e.config,r=void 0===t?{}:t,n=r.id,i=r.paths;return{id:void 0===n?P:"".concat(P,".").concat(n),paths:Array.isArray(i)?i:[]}}({config:i}),s=a.id,l=a.paths,u={};l.forEach(function(e){var n=e.split(".");U(n);for(var i=u,a=0;a<n.length;a++){var l=n[a];a===n.length-1?i[l]=_({theme:t,translator:r,id:s,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}});var c=function(e){var t=e.split(".");U(t);for(var r=u,n=0;n<t.length;n++){var i=t[n];if(void 0===r[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));r=r[i]}return r};return u.getDefaultValue=function(e){return c(e).getDefaultValue()},u.getOptions=function(e){return c(e).getOptions()},u}({theme:r,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:r.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:r.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:r.getStyle("object.gauge","label.value","color")}),width:!1}}}}}}}}}};let qr;function Dr(e){return"measure"===_t(e,"color.useBaseColors")}function Sr(e){const{flags:t,translator:r,sense:n}=e,i=n?.theme,o=()=>{if(!i)return-1;const{primary:e}=i.getDataColorSpecials(),t=i.getDataColorPickerPalettes()[0]?.colors,r=t.indexOf(e);return{index:-1===r?Math.min(6,t.length-1):r}};return{definition:{type:"items",component:"accordion",items:{data:{uses:"data",items:{measures:{disabledRef:""}}},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=>e.qHyperCubeDef.qMeasures?.length},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show:e=>e.qHyperCubeDef.qMeasures?.length,convertFunctions:{get:(e,t,r,n)=>"labels"===n.measureAxis.show||"none"===n.measureAxis.show,set(e,t,r,n,i){i.measureAxis.show=e?"labels":"all"}}}}}}},presentation:{type:"items",grouped:!0,translation:"properties.presentation",items:{styleEditor:xr(t,r,i),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,change(e){$t(e,"disclaimerClosed",!0)}},max:{ref:"measureAxis.max",translation:"Common.Max",type:"number",expression:"optional",defaultValue:100,invalid:e=>e.measureAxis&&e.measureAxis.min>=e.measureAxis.max,change(e){$t(e,"disclaimerClosed",!0)}}}},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"}],change(e){"radial"===e.gaugetype?(qr=e.orientation,e.orientation="horizontal"):e.orientation=qr}},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},segments:{type:"items",items:{useSegments:{ref:"useSegments",type:"boolean",component:"switch",defaultValue:!1,translation:"properties.gauge.useSegments",change(e){const t=function(e){const{paletteColors:t,colors:r}=e;return t&&t.length?t:r&&r.length?r.map(e=>({index:e.color})):void 0}(e.segmentInfo);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:o,show(e){if(!_t(e,"paletteProgressColor")){let t=function({progressColor:e,theme:t}){const r=t.getDataColorPickerPalettes()[0]?.colors;return null!=e?void 0!==e.index&&-1!==e.index&&r[e.index]?r[e.index]:void 0!==e.color?e.color?e.color:"none":r[e]?r[e]:e||"none":"none"}({progressColor:_t(e,"progressColor"),theme:i}),r=-1;t&&"none"!==t||(t=o(),r=t.index),$t(e,"paletteProgressColor",{index:r,color:t})}return!Dr(e)&&!e.useSegments}},segmentInfo:{ref:"segments",type:"items",component:"color-scale-creator",show:e=>!Dr(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}}},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",label:(t,r)=>(t=>{let r;const n=t.getMeasureLayouts()[0];return r=n&&!n.qError?`${e.translator.get("properties.measureAxis")}: ${n.qFallbackTitle}`:e.translator.get("properties.measureAxis"),r})(r),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},importProperties:(t,r,n,i)=>vr.axisChart.importProperties({exportFormat:t,initialProperties:r,hypercubePath:i,extension:n,dataDefinition:br(e)}),exportProperties:(e,t,r)=>vr.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:r,supportedAutoMinMax:!1})}}const Mr={require:["chart","renderer"],renderer:"dom",render(e){return function({chart:e,settings:t,h:r}){if(!e)return[];const n=function({h:e,settings:t}){if(!t)return[];const{isRtl:r,title:n,text:i}=t,o={disclaimer:{borderRadius:"10px",border:"1px solid #404040",position:"absolute",top:"10%",left:"50%",margin:"0 0 0 -150px",width:"298px",cursor:"default",background:"white",direction:r?"rtl":"ltr"},closeIcon:{position:"absolute",[r?"left":"right"]:"5px",top:"3px",cursor:"pointer",color:"#595959",pointerEvents:"auto"},dmHeader:{color:"#575859",fontSize:"18px",paddingLeft:"20px",paddingTop:"10px",paddingRight:"20px",paddingBottom:"0px",maxHeight:"44px",overflow:"hidden"},dmMain:{display:"block",color:"#575859",paddingLeft:"20px",paddingRight:"20px",paddingTop:"10px",paddingBottom:"10px"},dmP:{paddingBottom:"10px"}};return[e("div",{style:o.disclaimer},e("div",{style:o.closeIcon,onClick:()=>t?.close()},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},e("defs",{},e("path",{id:"remove-a",d:"M9.41421356,8 L11.8890873,5.52512627 C12.065864,5.34834957 12.0305087,4.95944084 11.8183766,4.74730881 L11.2526912,4.18162338 C11.0405592,3.96949135 10.6516504,3.93413601 10.4748737,4.1109127 L8,6.58578644 L5.52512627,4.1109127 C5.34834957,3.93413601 4.95944084,3.96949135 4.74730881,4.18162338 L4.25233406,4.67659813 C3.96949135,4.95944084 3.93413601,5.34834957 4.1109127,5.52512627 L6.58578644,8 L4.1109127,10.4748737 C3.93413601,10.6516504 3.96949135,11.0405592 4.18162338,11.2526912 L4.67659813,11.7476659 C4.95944084,12.0305087 5.34834957,12.065864 5.52512627,11.8890873 L8,9.41421356 L10.4748737,11.8890873 C10.6516504,12.065864 11.0405592,12.0305087 11.2526912,11.8183766 L11.8183766,11.2526912 C12.0305087,11.0405592 12.065864,10.6516504 11.8890873,10.4748737 L9.41421356,8 Z M8,0 C12.4,0 16,3.6 16,8 C16,12.4 12.4,16 8,16 C3.6,16 0,12.4 0,8 C0,3.6 3.6,0 8,0 Z"})),e("use",{xlinkHref:"#remove-a"}))),e("header",{style:o.dmHeader},n),e("main",{style:o.dmMain},e("p",{style:o.dmP},i)))]}({settings:t,h:r});return n}({chart:this.chart,settings:this.settings?.settings,h:e})}},Ar=52,wr=-.7*Math.PI,Ir=.7*Math.PI,kr="#EEEEEE",Cr=2.38,Lr={MIN:12,MAX:60},Er={MIN:100,MAX:1e3},Nr={LEFT:4,RIGHT:4},Pr={VERTICAL_ALIGNMENT_FACTOR:.4},Or={VERTICAL_ALIGNMENT_FACTOR:.5},Fr=1.15,Tr=2,Rr=1.2,Vr="#595959",Hr="#E6E6E6",jr=.4,zr=1,_r=2,Br=.15,$r=20,Gr=150,Ur=12,Wr=8,Kr=70,Xr=3,Zr={MEASURE:"measure"},Yr={BAR:"bar",SEGMENT_BAR:"segment-bar",LABEL_BAR:"label-bar",BACKGROUND_BAR:"background-bar",MARK:"mark",OOB_INDICATOR:"oob-indicator",BAR_AXIS:"bar-axis",AXIS_TITLE:"axis-title",GAUGE_LABEL:"gauge-label",RADIAL_AXIS:"radial-axis",RADIAL_GAUGE_NEEDLE:"radial-gauge-needle",RADIAL_OOB_INDICATOR_MIN:"radial-oob-indicator-min",RADIAL_OOB_INDICATOR_MAX:"radial-oob-indicator-max",RADIAL_GAUGE:"radial-gauge",CIRCLE_GAUGE:"circle-gauge",REFERENCE_LINES_AND_LABELS:"reference-lines-and-labels",RADIAL_SPARK:"radial-spark",RADIAL_GAUGE_LABEL:"radial-gauge-label",RADIAL_REFERENCE_LINES:"radial-reference-lines",SEGMENT_RADIAL_GAUGE:"segment-radial-gauge",LABEL_RADIAL_GAUGE:"label-radial-gauge"},Jr="color",Qr=1e-4,en="XSMALL",tn="XSMALL_VERTICAL",rn="XSMALL_HORIZONTAL",nn="SMALL",on="MEDIUM",an={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}},sn=600,ln=200,un=500;function cn(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function pn(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function fn(){}var dn=.7,mn=1/dn,hn="\\s*([+-]?\\d+)\\s*",gn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",yn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",vn=/^#([0-9a-f]{3,8})$/,bn=new RegExp(`^rgb\\(${hn},${hn},${hn}\\)$`),xn=new RegExp(`^rgb\\(${yn},${yn},${yn}\\)$`),qn=new RegExp(`^rgba\\(${hn},${hn},${hn},${gn}\\)$`),Dn=new RegExp(`^rgba\\(${yn},${yn},${yn},${gn}\\)$`),Sn=new RegExp(`^hsl\\(${gn},${yn},${yn}\\)$`),Mn=new RegExp(`^hsla\\(${gn},${yn},${yn},${gn}\\)$`),An={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 wn(){return this.rgb().formatHex()}function In(){return this.rgb().formatRgb()}function kn(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=vn.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?Cn(t):3===r?new Pn(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?Ln(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?Ln(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=bn.exec(e))?new Pn(t[1],t[2],t[3],1):(t=xn.exec(e))?new Pn(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=qn.exec(e))?Ln(t[1],t[2],t[3],t[4]):(t=Dn.exec(e))?Ln(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Sn.exec(e))?Hn(t[1],t[2]/100,t[3]/100,1):(t=Mn.exec(e))?Hn(t[1],t[2]/100,t[3]/100,t[4]):An.hasOwnProperty(e)?Cn(An[e]):"transparent"===e?new Pn(NaN,NaN,NaN,0):null}function Cn(e){return new Pn(e>>16&255,e>>8&255,255&e,1)}function Ln(e,t,r,n){return n<=0&&(e=t=r=NaN),new Pn(e,t,r,n)}function En(e){return e instanceof fn||(e=kn(e)),e?new Pn((e=e.rgb()).r,e.g,e.b,e.opacity):new Pn}function Nn(e,t,r,n){return 1===arguments.length?En(e):new Pn(e,t,r,null==n?1:n)}function Pn(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function On(){return`#${Vn(this.r)}${Vn(this.g)}${Vn(this.b)}`}function Fn(){const e=Tn(this.opacity);return`${1===e?"rgb(":"rgba("}${Rn(this.r)}, ${Rn(this.g)}, ${Rn(this.b)}${1===e?")":`, ${e})`}`}function Tn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Rn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Vn(e){return((e=Rn(e))<16?"0":"")+e.toString(16)}function Hn(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new zn(e,t,r,n)}function jn(e){if(e instanceof zn)return new zn(e.h,e.s,e.l,e.opacity);if(e instanceof fn||(e=kn(e)),!e)return new zn;if(e instanceof zn)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(r-n)/s+6*(r<n):r===o?(n-t)/s+2:(t-r)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new zn(a,s,l,e.opacity)}function zn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function _n(e){return(e=(e||0)%360)<0?e+360:e}function Bn(e){return Math.max(0,Math.min(1,e||0))}function $n(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}cn(fn,kn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:wn,formatHex:wn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return jn(this).formatHsl()},formatRgb:In,toString:In}),cn(Pn,Nn,pn(fn,{brighter(e){return e=null==e?mn:Math.pow(mn,e),new Pn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?dn:Math.pow(dn,e),new Pn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Pn(Rn(this.r),Rn(this.g),Rn(this.b),Tn(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:On,formatHex:On,formatHex8:function(){return`#${Vn(this.r)}${Vn(this.g)}${Vn(this.b)}${Vn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Fn,toString:Fn})),cn(zn,function(e,t,r,n){return 1===arguments.length?jn(e):new zn(e,t,r,null==n?1:n)},pn(fn,{brighter(e){return e=null==e?mn:Math.pow(mn,e),new zn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?dn:Math.pow(dn,e),new zn(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,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Pn($n(e>=240?e-240:e+120,i,n),$n(e,i,n),$n(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new zn(_n(this.h),Bn(this.s),Bn(this.l),Tn(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=Tn(this.opacity);return`${1===e?"hsl(":"hsla("}${_n(this.h)}, ${100*Bn(this.s)}%, ${100*Bn(this.l)}%${1===e?")":`, ${e})`}`}}));const Gn=Math.PI/180,Un=180/Math.PI,Wn=.96422,Kn=.82521,Xn=4/29,Zn=6/29,Yn=3*Zn*Zn,Jn=Zn*Zn*Zn;function Qn(e){if(e instanceof ei)return new ei(e.l,e.a,e.b,e.opacity);if(e instanceof ai)return si(e);e instanceof Pn||(e=En(e));var t,r,n=ii(e.r),i=ii(e.g),o=ii(e.b),a=ti((.2225045*n+.7168786*i+.0606169*o)/1);return n===i&&i===o?t=r=a:(t=ti((.4360747*n+.3850649*i+.1430804*o)/Wn),r=ti((.0139322*n+.0971045*i+.7141733*o)/Kn)),new ei(116*a-16,500*(t-a),200*(a-r),e.opacity)}function ei(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function ti(e){return e>Jn?Math.pow(e,1/3):e/Yn+Xn}function ri(e){return e>Zn?e*e*e:Yn*(e-Xn)}function ni(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function ii(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function oi(e,t,r,n){return 1===arguments.length?function(e){if(e instanceof ai)return new ai(e.h,e.c,e.l,e.opacity);if(e instanceof ei||(e=Qn(e)),0===e.a&&0===e.b)return new ai(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Un;return new ai(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new ai(e,t,r,null==n?1:n)}function ai(e,t,r,n){this.h=+e,this.c=+t,this.l=+r,this.opacity=+n}function si(e){if(isNaN(e.h))return new ei(e.l,0,0,e.opacity);var t=e.h*Gn;return new ei(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function li(e){return function(e){return oi(e).l<70}(e)?Hr:Vr}function ui(e,t=!0){let r="";for(let t=0;t<e.length;t++){const n=e[t];r+=0===t?`M${n.x} ${n.y}`:`L${n.x} ${n.y}`,r+=" "}return t&&(r+="Z"),r}function ci(e){const{angle:t,origin:r}=e,n=e.points.map(e=>function(e,t,r={x:0,y:0}){const n=Math.cos(t),i=Math.sin(t),o=(s=r,{x:(a=e).x-s.x,y:a.y-s.y});var a,s;return function(e,t){return{x:e.x+t.x,y:e.y+t.y}}({x:n*o.x-i*o.y,y:i*o.x+n*o.y},r)}(e,t,r));return{type:"path",fill:e.fill,d:ui(n)}}cn(ei,function(e,t,r,n){return 1===arguments.length?Qn(e):new ei(e,t,r,null==n?1:n)},pn(fn,{brighter(e){return new ei(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new ei(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,r=isNaN(this.b)?e:e-this.b/200;return new Pn(ni(3.1338561*(t=Wn*ri(t))-1.6168667*(e=1*ri(e))-.4906146*(r=Kn*ri(r))),ni(-.9787684*t+1.9161415*e+.033454*r),ni(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}})),cn(ai,oi,pn(fn,{brighter(e){return new ai(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new ai(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return si(this).rgb()}}));const pi={require:["chart"],defaultSettings:{settings:{},style:{}},render(){return function({chart:e,settings:t}){if(!e||!t)return[];const{size:r,component:n,selector:i,pointingTo:o,isRtl:a,width:s,height:l}=t;if(!e.component(t.component))return[];const u=e.findShapes(i).filter(e=>e.key===n);if(!u?.length)return[];let c=s/2,p=l/2,f=-Math.PI/2;const d=r/3;switch(o){case"top":p=d;break;case"bottom":p=l-d,f=3*Math.PI/2-Math.PI;break;case"right":c=s-d,f=0;break;case"left":c=d,f=Math.PI}const m=[];for(let e=0;e<u.length;e+=1){const t=u[e];let i=["top",...a?["left"]:["right"]].includes(o)?t.attrs.fill:kr;if(n===Yr.SEGMENT_BAR){const{stops:e}=t.attrs.fill;if(["top","right"].includes(o)){const t=e.find(e=>1===e.offset);i=t?.color||Vr}else{const t=e.toReversed().find(e=>0===e.offset);i=t?.color||Vr}}const s=li(i),l={x:c,y:p},d=r/6,h=ci({points:[{x:l.x+2*d,y:l.y},{x:l.x,y:l.y+d},{x:l.x,y:l.y-d}],angle:f,fill:s,origin:l});m.push(h)}return m}({chart:this.chart,settings:this.settings?.settings})}};function fi({services:e}){const{colorService:t,layoutService:r,themeService:n}=e,{useBaseColors:i}=r.getLayout().color||{},{baseColor:o}=r.getLayout().qHyperCube?.qMeasureInfo[0].coloring||{};if("off"===i)return t.getColor();let a;if(!o)return t.getColor();{const e=n.getTheme().getDataColorPickerPalettes()[0]?.colors||[];a=o.color??Vr;const t=o.index??-1;e.length>0&&t>-1&&t<e.length&&(a=e[t])}return()=>a}function di(e,t,r,n){const i=Math.floor(Math.min(e,t)),o=Math.abs(n-r),a=.02*Math.tan(-o/4+Math.PI/2),s=2*(.4+a)-2*yi(e,t)/i;return{innerRadius:s-2*(i>500?50:Math.max(i/un*50,10))/i,outerRadius:s,radiusIncrease:a,labelGaugeRadius:1.39*(.4+a)}}function mi(e,t,r,n){const i=n-Math.PI/2;return{x:e+r*Math.cos(i),y:t+r*Math.sin(i)}}function hi({innerRadius:e,outerRadius:t,width:r,height:n}){return(t-e)*Math.min(r,n)/2}function gi(e){return!1!==e.show&&0!==e.show&&"0"!==e.show}function yi(e,t){return Math.min(6,Math.min(e,t)/ln)}function vi(e,t){return 4*di(e,t,wr,Ir).radiusIncrease*Math.min(e,t)}const bi={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){return function({chart:e,settings:t,symbol:r}){if(!e||!t||!r)return[];if(!e.component(t.component))return[];const{valueAngle:n,width:i,height:o}=t,{outerRadius:a,innerRadius:s}=di(i,o,wr,Ir),l=hi({innerRadius:s,outerRadius:a,width:i,height:o}),u=i/2,c=o/2,p=a*Math.min(i,o)/2,f=mi(u,c,p,t.valueAngle),d=f.x,m=f.y,h=[],g=kr,y=t.fill||li(g),v={x:d,y:m},b=l/6,x=[{x:v.x+.3*b,y:v.y},{x:v.x-7.5*b,y:v.y+b},{x:v.x-7.5*b,y:v.y-b}],q=n-Math.PI/2,D=ci({points:x,angle:q,fill:y,origin:v});return D.data={pointerWidth:b,angle:q,radius:p,fill:y},h.push(D),h}({chart:this.chart,settings:this.settings?.settings,symbol:this.symbol})}};const xi={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){return function({chart:e,settings:t,symbol:r}){if(!e||!t||!r)return[];const{size:n,component:i,selector:o,angle:a,radius:s,width:l,height:u}=t;if(!e.component(t.component))return[];const c=e.findShapes(o).filter(e=>e.key===i);if(!c?.length)return[];const p=l/2,f=u/2,{x:d,y:m}=mi(p,f,s,a),h=[],g=t.fill,y=a===wr?-1:1,v={x:d,y:m},b=n/6,x=ci({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:a,fill:g,origin:v});return h.push(x),h}({chart:this.chart,settings:this.settings?.settings,symbol:this.symbol})}};var qi,Di;var Si=function(){if(Di)return qi;Di=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(r){if(!r||"[object Object]"!==t.call(r))return!1;var n,i=e.call(r,"constructor"),o=r.constructor&&r.constructor.prototype&&e.call(r.constructor.prototype,"isPrototypeOf");if(r.constructor&&!i&&!o)return!1;for(n in r);return void 0===n||e.call(r,n)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,r){if("__proto__"===r){if(!e.call(t,r))return;if(n)return n(t,r).value}return t[r]};return qi=function e(){var t,r,n,l,u,c,p=arguments[0],f=1,d=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},f=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});f<d;++f)if(null!=(t=arguments[f]))for(r in t)n=s(p,r),p!==(l=s(t,r))&&(m&&l&&(o(l)||(u=i(l)))?(u?(u=!1,c=n&&i(n)?n:[]):c=n&&o(n)?n:{},a(p,{name:r,newValue:e(m,c,l)})):void 0!==l&&a(p,{name:r,newValue:l}));return p},qi}(),Mi=mr(Si);let Ai;function wi(){Ai=Ai||document.createElement("canvas").getContext("2d")}const Ii={measureTextWidth(e){wi();const{width:t}=Ai.measureText(e);return t},lineWrap(e,t,r,n){let i,o;wi();const a=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,u,c,p,f=e?e.split(/\s+/):[],d=a[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof n&&a.length>=n)return a.slice(0,n);for(r&&(Ai.font=r),o=0;o<a.length;o++){for(p=a[o],f=p.split(/\s+/),[d]=f,c="",i=1;i<f.length;i++)if(l=`${d} ${f[i]}`,u=Ii.measureTextWidth(l),u>t&&("number"!=typeof n||n>s.length)?(s.push(d),d=f[i]):d=l,"number"==typeof n&&s.length>=n){c=f.slice(i+1).join(" ");break}"number"!=typeof n||s.length<n?s.push(d):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]} ${d} ${c}`}return s},wordWrap(e,t,r,n,i){if(wi(),!e||!e.length)return[];r&&(Ai.font=r);let o=[];const a=e.slice();let s,l,u,c="";if(a.filter(e=>!!e),"number"!=typeof t||t<0)return e.slice();for(u=0;u<a.length;u++)l=a[u],c="",l.length<=1||Ii.measureTextWidth(l)<=t?o.push(l):(s=Ii.splitWord(l,t,void 0,void 0===n?void 0:n-o.length),s.length<=1?o.push(s[0]):(c=s.pop()??"",o=o.concat(s),a[u+1]?Ii.measureTextWidth(`${c} ${a[u+1]}`)>t&&(void 0===n||o.length+a.length-u<=n)?a.splice(u+1,0,c):a[u+1]=`${c} ${a[u+1]}`:a.push(c)));return o.forEach((e,t,r)=>{r[t]=e.trim()}),void 0!==n&&o.length>n?(o=o.splice(0,n),o[o.length-1]=Ii.truncate(o[o.length-1],t,r,i).text):(l=o[o.length-1],l&&l.length>1&&Ii.measureTextWidth(l)>t&&(o[o.length-1]=Ii.truncate(l,t,r,i).text)),o},truncate(e,t,r,n="…"){wi();let i,o,a,s,l=e;const u=Ii.measureTextWidth("i");if(r&&(Ai.font=r),e&&t){if(Ii.measureTextWidth(l)>t){const e=Math.ceil(t/u);for(i=Math.min(e,l.length);i>0;i--)if(o=l.substring(0,i-1),a=o.trim()+n,Ii.measureTextWidth(a)<=t){s=l.substring(i-1),l=a;break}i||(s=l,l="…")}}else s=void 0;return{text:l,rest:s}},isNumber:e=>"number"==typeof e&&Number.isFinite(e),explodeWord(e,t,r,n){let i;wi();let o,a=e,s="",l=[];if(void 0!==r&&Ii.isNumber(r)&&r<=1)return[e];const u=Math.ceil(t/n);for(i=Math.min(e.length,u);i>0&&(a=e.substring(0,i),o=e.substring(i-1,i)," "===o?a=e.substring(0,i-1):a+="-",s=e.substring(i),!(Ii.measureTextWidth(a)<=t));i--);return(!i&&!a||Ii.measureTextWidth(a)>t)&&(a=e.substring(0,1),s=e.substring(1)),l.push(a),s?(Ii.measureTextWidth(s)>t?l=l.concat(Ii.explodeWord(s,t,void 0===r?void 0:r-1,n)):l.push(s),l.filter(e=>""!==e.trim())):l},splitWord:(e,t,r,n)=>(wi(),e&&t?(r&&(Ai.font=r),Ii.explodeWord(e,t,n,Math.max(1,Ii.measureTextWidth("i")))):[]),wrapText(e,t,r,n,i="…"){let o;return Number.isNaN(t)||!t?[e]:(o=void 0===n||n>1?Ii.lineWrap(e,t,r,n):[e],o=Ii.wordWrap(o,t,r,n,i),o)},getFontHeight:e=>(wi(),e&&(Ai.font=e),1.5*Ii.measureTextWidth("m")),tokenize(e,t,r,n,i,o,a=1){wi(),t&&(Ai.font=t);const s=Ii.getFontHeight(),l=a*s;let u=[],c=[];if(void 0!==o&&o<s)return[];const p=o?Math.max(1,Math.floor(o/l)):n||1;return u=[void 0===n||Number.isNaN(n)||n<=0?p:Math.min(p,n)],Array.isArray(e)?e.forEach((e,r)=>{c.length<p&&(c=c.concat(Ii.wrapText(e,i,t,u[r])))}):c=Ii.wrapText(e,i,t,u[0],r),c}};function ki({chart:e,renderer:t,refLine:r,settings:n,width:i,height:o,barWidth:a}){if(!e||!t||!n)return{};const{position:s,scale:l,value:u,label:c,line:p,formatter:f,cId:d}=r,m=r.radius?r.radius*(Math.min(i,o)/2):i/2,h=(Ir-wr)*s+wr-Math.PI/2,g={x:i/2,y:o/2},y=Mi(!0,{},n.style.line,p||{}),v={type:"line",cId:d,...{x1:g.x+Math.cos(h)*m,y1:g.y+Math.sin(h)*m,x2:g.x+Math.cos(h)*(m+a),y2:g.y+Math.sin(h)*(m+a)},data:{angle:h,innerRadius:m},stroke:y.stroke,strokeWidth:y.strokeWidth,strokeDasharray:y.strokeDasharray};let b;if(c){const r=Mi(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},n.style.label||{},{fill:y.stroke},c),{fontFamily:s,fontSize:p,fill:v,opacity:x}=r,q=!1!==c.showLabel?r.text:"";let D,S="";if("string"==typeof f||"object"==typeof f)D=e.formatter(f);else if(void 0!==l&&"string"!=typeof l&&"function"==typeof l.data){const e=l.data()&&l.data().fields;D=e&&e[0]?e[0].formatter():null}!1!==c.showValue&&(D?S=` (${D("function"==typeof u?u():u)})`:l&&(S=` (${u})`));const M=e=>t.measureText({text:e,fontFamily:s,fontSize:p}),A=M("M").height,w=`normal ${p} ${s}`;let I,k=Xr;const C=`${q}${S}`||"",L=Math.min(i,o),E=Math.min(8,L/200),N=mi(g.x,g.y,m+a+E,h+Math.PI/2),P=M(C).width;I=Math.min(N.x,i-N.x-Cr,Kr),k=function(e,t,r){const n=Math.min(Math.floor((e+Cr)/t),Math.floor((r-e)/t));return Math.min(n,Xr)}(N.y,A,o);let O=Ii.tokenize(C,w,`... ${S}`,k,I,void 0);const F=function(e){let t="start";const r=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:r}}(h);N.y-2*A>0&&N.y+2*A<o&&(N.x-P+Cr<0&&"end"===F.textAnchor||N.x+P-Cr>i)&&(O=Ii.tokenize(C,w,`... ${S}`,k,I,void 0)),b={fill:v,opacity:x,fontFamily:s,fontSize:p,linePosition:N,lineHeight:A,align:"left",baseline:F.baseline,textAnchor:F.textAnchor,lines:O,cId:d}}return{lineNode:v,labelNode:b}}const Ci={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){const{settings:e,chart:t,renderer:r,rect:n}=this;if(!(t&&n&&e&&r))return[];const{width:i,height:o}=n,a=e?.settings?.barWidth??0;let s=e?.lines&&e.lines.radial||[];if(0===s.length)return[];s=s.map(e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){const r=t?.scale("string"==typeof e.scale?e.scale:""),n=r(e.value);return Mi(e,{scale:r,position:n})}return Mi(e,{position:e.value})});const l=[],u=[];[...s].forEach(n=>{if(n.position>=0&&n.position<=1){const{lineNode:s,labelNode:c}=ki({chart:t,renderer:r,refLine:n,settings:e,width:i,height:o,barWidth:a});s&&l.push(s),c&&u.push(c)}});const c=[];u.forEach(e=>{const{fill:t,opacity:r,fontFamily:n,fontSize:i,lines:o,lineHeight:a,textAnchor:s,linePosition:l,baseline:u,cId:p}=e,f=l,d=o.length-1,m=o.map((e,o)=>{let l=f.y;return d>0&&("baseline"===u?l-=(d-o)*a:l+=o*a),{type:"text",text:e,cId:p,baseline:u,anchor:s,fill:t,opacity:r,fontFamily:n,fontSize:i,x:f.x,y:l}});c.push(...m)});const{MEDIUM:p,SMALLER:f}=an,d=i>=p.width&&o>=p.height;return[...i>=f.width&&o>=f.height?l:[],...d?c:[]]}};const Li={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){return function({chart:e,settings:t,symbol:r}){if(!e||!t||!r)return[];const{valueAngle:n,width:i,height:o}=t,a=.4*Math.min(i,o),s=[],l=t.fill,u={x:i/2,y:o/2},c=ci({points:[{x:u.x-a/2,y:u.y+a/2},{x:u.x,y:u.y-a},{x:u.x+a/2,y:u.y+a/2}],angle:n,fill:l,origin:u});return s.push(c),s}({chart:this.chart,settings:this.settings?.settings,symbol:this.symbol})}},Ei={getGap(e,t){const r=e.position<t.position?e:t,n=e.position<t.position?t:e;return n.position-n.radius-(r.position+r.radius)},findSegmentPositionMeetMaxThenMin(e,t,r){const n=e.position+e.radius,i=e.position-Math.max(0,n-r),o=i-e.radius;return i+Math.max(0,t-o)},layoutPositionFromMin(e,t,r,n=0){const i=e.length-1;let o,a,s,l=t;for(let t=0;t<i;t++)o=e[t],a=e[t+1],s=(o.position+a.position)/2-n/2,o.position=Ei.findSegmentPositionMeetMaxThenMin(o,l,s),l=o.position+o.radius+n;a&&(a.position=Ei.findSegmentPositionMeetMaxThenMin(a,l,r))},adjustPositionFromMax(e,t,r,n=0){const i=e.length-1,o=Math.max(0,e[i].position+e[i].radius-r);if(0===o)return;let a,s,l,u,c=0;for(a=i;a>0&&(s=e[a],l=e[a-1],u=Math.max(0,Ei.getGap(l,s)-n),u-=Math.max(0,c+u-o),c+=u,s.move=u,!(c>=o));a--);for(c<o&&l&&(u=Math.max(0,l.position-l.radius-t),u-=Math.max(0,c+u-o),c+=u,l.move=u),c=0,a=0;a<=i;a++)s=e[a],c+=s.move||0,s.move=c,s.position-=c},createLayout(e,t,r,n=0){const i=e.map(e=>e.segment),o=i.length-1;if(o<0)return[];if(0===o){const e=i[0];e.position=Ei.findSegmentPositionMeetMaxThenMin(e,t,r)}else Ei.layoutPositionFromMin(i,t,r,n),Ei.adjustPositionFromMax(i,t,r,n);return e.filter(e=>{const n=Math.ceil(e.segment.position-e.segment.radius),i=e.segment.position+e.segment.radius;return n>=t&&i<=r})}};const Ni={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){const{settings:e,chart:t,renderer:r,rect:n}=this;if(!(t&&n&&e&&r))return[];const{width:i,height:o}=n,{barWidth:a,needlePosition:s}=e.settings,l=e.settings?.isRtl??!1,u=l?-1:1,c=e?.lines&&e.lines.x||[],p=e?.lines&&e.lines.y||[];let f=c.length>0?c:p;if(0===f.length)return[];const d=c.length>0;f=f.map(e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){const r=t?.scale("string"==typeof e.scale?e.scale:""),n=r(e.value);return Mi(e,{scale:r,position:n})}return Mi(e,{position:e.value})});const m=[],h=[];[...f].forEach(n=>{if(gi(n)&&n.position>=0&&n.position<=1){const{lineNode:s,labelNode:l}=function({chart:e,renderer:t,refLine:r,settings:n,width:i,height:o,isVerticalRefLine:a,barWidth:s}){if(!e||!t||!n)return{};const{position:l,scale:u,value:c,label:p,line:f,formatter:d,cId:m}=r,h=Mi(!0,{},n.style.line,f||{}),g={type:"line",cId:m,...a?{x1:l*i,x2:l*i,y1:o/2-s/2,y2:o/2+s/2}:{x1:i/2-s/2,x2:i/2+s/2,y1:l*o,y2:l*o},stroke:h.stroke,strokeWidth:h.strokeWidth,strokeDasharray:h.strokeDasharray};let y;if(p){const r=Mi(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},n.style.label||{},{fill:h.stroke},p),{fontFamily:f,fontSize:g,fill:v,opacity:b}=r,x=!1!==p.showLabel?r.text:"";let q,D="";if("string"==typeof d||"object"==typeof d)q=e.formatter(d);else if(void 0!==u&&"string"!=typeof u&&"function"==typeof u.data){const e=u.data()&&u.data().fields;q=e&&e[0]?e[0].formatter():null}!1!==p.showValue&&(q?D=` (${q("function"==typeof c?c():c)})`:u&&(D=` (${c})`));const S=e=>t.measureText({text:e,fontFamily:f,fontSize:g}),M=S("M").height,A=`normal ${g} ${f}`,w=a?Gr:i/2-s/2-Ur,I=a?2:1,k=`${x}${D}`||"",C=Ii.tokenize(k,A,`... ${D}`,I,w,void 0),L=(a?i:o)*l,E=Math.min(w,Math.max(...C.map(e=>S(e).width))),N=C.length*M;y={fill:v,opacity:b,fontFamily:f,fontSize:g,linePosition:L,lineHeight:M,lines:C,cId:m,segment:{position:L,radius:a?E/2:N/2}}}return{lineNode:g,labelNode:y}}({chart:t,renderer:r,refLine:n,settings:e,width:i,height:o,isVerticalRefLine:d,barWidth:a});s&&m.push(s),l&&h.push(l)}});const{MEDIUM:g,SMALLER:y}=an,v=i>=g.width&&o>=g.height;if(!(i>=y.width&&o>=y.height))return[];const b=[...m];if(!v||0===h.length)return b;let x=[];if(h.sort((e,t)=>e.segment.position-t.segment.position),d)x=Ei.createLayout(h,0,i,Wr);else{const{attrs:e}=t.findShapes("text").filter(e=>e.key===Yr.GAUGE_LABEL)[0],{"font-size":r}=e,n=parseFloat(r),i=h.filter(e=>e.segment.position<o-s),a=h.filter(e=>e.segment.position>=o-s),l=Ei.createLayout(i,0,e.y-n/2),u=Ei.createLayout(a,e.y+n/2,o);x=0===l.length&&i.length>0?Ei.createLayout(h,e.y+n/2,o):0===u.length&&a.length>0?Ei.createLayout(h,0,e.y-n/2):[...l,...u]}return x.forEach(e=>{const{fill:t,opacity:r,fontFamily:n,fontSize:s,lines:c,segment:p,linePosition:f,lineHeight:m,cId:h}=e,{position:g}=p;if(f!==g&&""!==e.lines[0]){let e={x1:i/2+u*(a/2),x2:i/2+u*(a/2+.75*Ur),y1:f,y2:g};d&&(e={y1:o/2+a/2,y2:o/2+a/2+Ur,x1:f,x2:g});const r={type:"line",...e,stroke:t,strokeWidth:1,isConnector:!0,cId:h};b.push(r)}const y=c.map((e,c)=>{let p=d?o/2+a/2+m/2+Ur:g;return p+=c*m,{type:"text",text:e,cId:h,baseline:"central",anchor:d?"middle":l?"end":"start",fill:t,opacity:r,fontFamily:n,fontSize:s,x:d?g:i/2+u*(a/2+Ur),y:p}});b.push(...y)}),b}};var Pi={dataRelatedPropertiesPaths:["filters[].options","qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","qHyperCube.qDimensionInfo[].qCardinalities","qHyperCube.qDimensionInfo[].qMax","qHyperCube.qDimensionInfo[].qMin","qHyperCube.qDimensionInfo[].qStateCounts","qHyperCube.qMeasureInfo[].qApprMaxGlyphCount","qHyperCube.qMeasureInfo[].qFallbackTitle","qHyperCube.qMeasureInfo[].qMax","qHyperCube.qMeasureInfo[].qMin","qHyperCube.qMeasureInfo[].qNumFormat","qHyperCube.qMeasureInfo[].qTrendLines","qHyperCube.qTreeNodesOnDim","measureAxis.min","measureAxis.max","refLine.refLines[].refLineExpr"]};function Oi(e){const{qHyperCube:t,...r}=e,{...n}=t||{},i=Mi(!0,{},{...r,qHyperCube:{...n,qDataPages:null,qStackedDataPages:null,qTreeDataPages:null}}),{dataRelatedPropertiesPaths:o}=Pi;return o.forEach(e=>{const t=e.split("[");if(1===t.length)void 0!==_t(i,e)&&$t(i,e,null);else{const e=t[0],r=t[1].split("].")[1];_t(i,e,[]).forEach(e=>{void 0!==_t(e,r)&&$t(e,r,null)})}}),i}const Fi=({core:t,services:r,settings:o})=>{const a=e(),{qLocaleInfo:s}=i();n(()=>{if(!r)return;const{chart:e,cache:n}=t;if(!e)return;const{colorService:i,layoutService:l,dockService:u}=r;if("radial"===l.meta.gaugetype){const{width:e,height:t}=u.meta.chart.size;a.style.transform=`translateY(${vi(e,t)}px)`}else a.style.transform="";e.update({data:[{type:"q",key:"qHyperCube",data:l.getHyperCube(),config:{localeInfo:s}},...i.getData()],settings:o}),n&&function({cache:e,layout:t}){const r=Oi(t);e.set("dataIndependentProperties",JSON.stringify(r))}({cache:n,layout:l.getLayout()})},[t,o])};function Ti({layout:e,options:t}){return e.snapshotData&&!t.freeResize?{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h,preserveAspectRatio:!0,align:.5}:void 0}function Ri({options:e,cache:t,layoutService:r}){const n={isSizeChanging:!1};return{enabled:()=>!1!==e.chartAnimations&&!n.isSizeChanging&&!function({cache:e,layout:t}){const r=Oi(t);return e.get("dataIndependentProperties")!==JSON.stringify(r)}({cache:t,layout:r.getLayout()}),meta:n}}function Vi({layout:e,rect:t}){const{measureAxis:r,qHyperCube:n,autoOrientation:i,gaugetype:o,useSegments:a,refLine:s}=e,l=e.qHyperCube?.qMeasureInfo[0].qFallbackTitle,{width:u,height:c}=t;let p=e.orientation;i&&(p=u>=c?"horizontal":"vertical");const f="vertical"===p,d=function({measureAxis:e,qHyperCube:t}){if(!e||!t)return{min:0,max:1};let{min:r,max:n}=e;if(r=Number(r),n=Number(n),r!==n)return{min:Math.min(r,n),max:Math.max(r,n)};const i=t.qDataPages[0].qMatrix[0][0].qNum;let o=Math.abs(i-r)/2;return 0===o&&(o=0!==r?Math.abs(r)/2:1),{min:r-o,max:n+o}}({measureAxis:r,qHyperCube:n}),m=s?.refLines||[],h=r?.spacing||1,g=r?.show,y=function({layout:e,rangeLimits:t}){const{gradient:r}=e.qHyperCube?.qMeasureInfo[0].coloring||{};if("measure"!==e.color?.useBaseColors||!r)return e.segmentInfo;const{min:n,max:i}=t,{limits:o,limitType:a,breakTypes:s,colors:l}=r;return{limits:o.map((e,t)=>({value:"percent"===a?n+e*(i-n):e,gradient:s[t]})),paletteColors:l}}({layout:e,rangeLimits:d});return{measureAxisTitle:l,measureAxisSpacing:h,measureAxisShow:g,rangeLimits:d,qHyperCube:n,orientation:p,autoOrientation:i,gaugetype:o,isVertical:f,useSegments:a,segmentInfo:y,refLines:m}}function Hi({dockService:e,layoutService:t}){const{width:r,height:n}=e.meta.chart.size,{orientation:i,autoOrientation:o}=t.meta;return o?r<n:"vertical"===i}function ji(e,t,r){if(e>=r)return 1;if(e<=t)return 0;const n=Math.min(1,Math.max(0,(e-t)/(r-t)));return Number.isNaN(n)?0:n}function zi(e,t,r){const n="none"===e||"labels"===e,i=t<an.SMALL.width||r<an.SMALL.height;return!(n||i)}function _i(e){return"none"!==e&&"title"!==e}const Bi=({core:e})=>{const f=o(),d=a(),m=s(),h=l(),g=u(),y=c(),{qLocaleInfo:v}=i(),[x,q]=r(null),D=t(),S=p();return n(()=>{if(!f||!e)return;const{picassoInstance:t,chart:r,cache:n}=e;if(!r)return;f.color||(f.color={useBaseColors:"off"});const i=function(e){var t=e.source,r=e.metaAdditionsFn,n=e.experimental,i=void 0===n?{filter:!1}:n,o=X(!0,{},t),a=i.filter?function(e){var t=e.qHyperCube,r=Kt(t,Wt.DIMENSION),n=r.reduced,i=r.filtered;t[Wt.DIMENSION]=n;var o=Kt(t,Wt.MEASURE),a=o.reduced,s=o.filtered;return t[Wt.MEASURE]=a,{dimensions:i,measures:s}}(o):{dimensions:[],measures:[]},s=Zt(o),l=function(){var e=function(e){var t=e.layout,r=e.additionsFn,n=void 0===r?function(){return{}}:r,i=e.additionsProps,o=void 0===i?{}:i,a=t.qHyperCube,s=a.qDimensionInfo,l=a.qMeasureInfo,u=a.qMode,c=s.length,p=l.length,f=b({mode:{S:"S"===u,P:"P"===u,K:"K"===u,T:"T"===u},dimensionCount:c,measureCount:p,hasMultipleDimensions:c>1,hasMultipleMeasures:p>1,isOneDimensional:1===c,isTwoDimensional:2===c},o);return b(b({},f),n({layout:t,meta:f}))}({layout:o,additionsFn:r,additionsProps:{size:s.size}});return e.filteredFields=a,e},u={refs:b({},s.refs),meta:l(),getLayout:function(){return o},getLayoutValue:function(e,t){return _t(o,e,t)},setLayoutValue:function(e,t){$t(o,e,t),s=Zt(o),u.meta=l()},getHyperCube:function(){return o.qHyperCube},getHyperCubeValue:function(e,t){return _t(o.qHyperCube,e,t)},setHyperCubeValue:function(e,t){$t(o.qHyperCube,e,t),s=Zt(o),u.meta=l()},getDataPages:function(){return _t(o,s.refs.dataPages)},setDataPages:function(e){$t(o,s.refs.dataPages,e),u.meta=l()}};return u}({source:f,metaAdditionsFn:()=>Vi({layout:f,rect:g})}),{direction:o="ltr"}=D,a=Ti({layout:i.getLayout(),options:D}),s=zt({chart:r,layoutService:i,config:{rtl:"rtl"===o,logicalSize:a},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0}}),l=function(e){var t,r,n,i,o=e.picasso,a=e.model,s=e.app,l=e.translator,u=e.layoutService,c=void 0===u?void 0:u,p=e.createConfig,f=void 0===p?Ct:p,d=e.config,m=void 0===d?{}:d,h=e.custom,g=void 0===h?{}:h,y=m.localeInfo,v=m.key,x=m.theme,q=void 0===x?void 0:x,D=m.auto,S=void 0===D?void 0:D,M=m.definitionPath,A=null==c||null===(t=c.getLayout)||void 0===t?void 0:t.call(c),w={theme:q,key:v,localeInfo:y,layout:A,hc:null==c||null===(r=c.getHyperCube)||void 0===r?void 0:r.call(c),legendProps:null==c||null===(n=c.getLayoutValue)||void 0===n?void 0:n.call(c,"legend"),colorProps:b(b({},null==c||null===(i=c.getLayoutValue)||void 0===i?void 0:i.call(c,"color")),{},{useBaseColors:A?wt(A):void 0})},I=Mt({picasso:o,model:a,app:s,translator:l,auto:S});!1!==S&&I.auto(function(e){return S?S({layout:e,defaultAuto:kt}):kt(e)});var k=!1,C={getColor:function(){return I.color()},getPaletteColor:function(e){var t=e.index,r=e.color;return I.resolveUIColor({index:t,color:r})},getData:function(){return I.data()},getDatumProps:function(e){return I.datumProps(e)},getSnapshotData:function(){return I.getSnapshotData(M)},getSettingsForMeasure:function(e){return I.settingsForMeasure(e)},getSettings:function(){return I.settings()},getLegend:function(e,t){return I.legend(e,t)},getScales:function(){return I.scales()},getPalettes:function(){return I.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return I.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return k},custom:b({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?f:e)({getUseBaseColors:wt}),r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return b(b(b({},e),t),{},{colorProps:b(b({},e.colorProps),t.colorProps||{})})}(w,t);return I.config(r),I.getAuxiliarySettings(M).then(function(){k=!0})}};return C}({app:m,model:h,translator:y,picasso:t,layoutService:i,config:{key:Jr,localeInfo:v,theme:d,auto:()=>({mode:"primary",byMeasureDef:{activeMeasureIndex:0,type:"expression",label:""}})},createConfig:()=>({colorProps:{auto:!0,paletteColor:f.paletteProgressColor||{index:f.progressColor}}})}),u=function(e){var t=e.theme,r=e.config,n=void 0===r?{}:r,i=n.id,o=n.resolve,a=void 0===o?[]:o,s=n.transform,l=void 0===s?[]:s,u=n.extend,c=void 0===u?[]:u,p={theme:t,matrix:cr(a),styles:void 0};return p.styles=dr({theme:t,id:i,transform:l,extend:c,matrix:p.matrix}),{getStyles:function(){return p.styles},getTheme:function(){return p.theme},setTheme:function(e){p.theme=e,p.styles=dr({theme:e,id:i,transform:l,extend:c,matrix:p.matrix})}}}({theme:d,config:{id:"gauge"}}),c=function({chart:e,layoutService:t,dockService:r}){function n(){const{width:e,height:n}=r.meta.chart.size,i=Hi({dockService:r,layoutService:t});return Math.min(Ar,i?e/10:n/10)}function i(){const{width:e,height:n}=r.meta.chart.size;return Hi({dockService:r,layoutService:t})?n:e}function o(e){const{min:r,max:n}=t.meta.rangeLimits,o=e?n-(t.meta.qHyperCube.qDataPages[0].qMatrix[0][0].qNum-r):t.meta.qHyperCube.qDataPages[0].qMatrix[0][0].qNum;return i()*ji(o,r,n)}const a={getBottomPadding(a){if(Hi({dockService:r,layoutService:t})){const e=o(!1)+-a.height*Pr.VERTICAL_ALIGNMENT_FACTOR,t=0,r=i()-a.height/Fr;return e<t?t:e>r?r:e}const s=n(),{VERTICAL_ALIGNMENT_FACTOR:l}=Or;let u=.5*s+a.height/2+s*l;return u=function({refLabels:e,valueLabel:t}){return e.forEach(e=>{(function(e,t){const r=t.x-t.width/2>=e.x+e.width/2||t.x+t.width/2<=e.x-e.width/2,n=t.y-t.height/2>=e.y+e.height/2;return!(r||n)})(e,t)&&(t.y=e.y+e.height/2+t.height/2)}),t.y}({refLabels:e.findShapes("text").filter(e=>e.key===Yr.REFERENCE_LINES_AND_LABELS).map(e=>{const{x:t,y:n,"font-size":i}=e.attrs,o=parseFloat(i);return{x:t,y:n-r.meta.chart.size.height/2,height:o,width:Gr}}),valueLabel:{x:o(r.config.rtl),y:u,...a}}),-u},getTopPadding:e=>-a.getBottomPadding(e),getLeftPadding(e){const{width:a}=r.meta.chart.size,s=r.config.rtl,l=n(),u=Hi({dockService:r,layoutService:t}),c=Math.min(e.width,a*jr);if(u)return s?a/5-l-c:a/5+l;const p=o(s)-e.width/2,f=Nr.RIGHT,d=i()-e.width-Nr.LEFT;return p<f?f:p>d?d:p},getRightPadding:e=>-a.getLeftPadding(e)},s={getLeftPadding(i){if(!Hi({dockService:r,layoutService:t}))return 0;const o=e.findShapes("container").filter(e=>e.key===Yr.BAR_AXIS);if(1!==o.length)return 0;const a=o[0],s=_i(t.meta.measureAxisShow)?Math.max(...a.children.filter(e=>"text"===e.type).map(e=>e.bounds.width)):0,l=Math.max(...a.children.filter(e=>"line"===e.type).map(e=>e.bounds.width));let u=n()/2+s+l+1.9*i.height;const{width:c}=r.meta.chart.size;return u>c/2-i.height/4&&(u=c/2-i.height/4),r.config.rtl?u:-u},getRightPadding:e=>-s.getLeftPadding(e),getTopPadding(){if(Hi({dockService:r,layoutService:t}))return-4;const i=e.findShapes("container").filter(e=>e.key===Yr.BAR_AXIS);if(1!==i.length)return 0;const o=i[0],a=_i(t.meta.measureAxisShow)?Math.max(...o.children.filter(e=>"text"===e.type).map(e=>e.bounds.height)):0,s=Math.max(...o.children.filter(e=>"line"===e.type).map(e=>e.bounds.height)),l=n();return-(l/2+a+s+$r+l*Br)},getBottomPadding:()=>-s.getTopPadding()};return{getBarWidthInPixels:n,getValueLabelFontSize:function(e,t){const{width:n,height:i}=r.meta.chart.size,o=ji(Math.min(i,n),Er.MIN,Er.MAX);return e+Math.round(o*(t-e))},getNeedlePosition:o,barValueLabel:a,barAxisTitle:s}}({chart:r,layoutService:i,dockService:s}),p=function({layoutService:e,themeService:t,colorService:r}){const n=t.getStyles(),i=t=>{const r=e.getLayoutValue("components",[])?.find(e=>e.key===t);return r},o=e=>e?r.getPaletteColor(e):void 0;return{query:{axis:{title:{getStyle:()=>({fontFamily:i("axis")?.axis?.title?.fontFamily??n.axis.title.fontFamily,fontSize:n.axis.title.fontSize,color:o(i("axis")?.axis?.title?.color)??n.axis.title.color})},label:{getStyle:()=>({fontFamily:i("axis")?.axis?.label?.name?.fontFamily??n.axis.label.name.fontFamily,fontSize:n.axis.label.name.fontSize,fill:o(i("axis")?.axis?.label?.name?.color)??n.axis.label.name.color})}},label:{getStyle:()=>({fontFamily:i("value")?.label?.value?.fontFamily??n.label.value.fontFamily,fill:o(i("value")?.label?.value?.color)??n.label.value.color})}}}}({layoutService:i,themeService:u,colorService:l}),x=Ri({options:D,cache:n,layoutService:i}),M=function({layout:e,model:t,translator:r,interactionState:n}){return{isClosed:()=>e.disclaimerClosed,close:()=>{t.getProperties().then(e=>{e.disclaimerClosed=!0,t.setProperties(e)})},translator:r,isEditMode:n.edit}}({layout:f,model:h,translator:y,interactionState:S});q({layoutService:i,colorService:l,dockService:s,labelService:c,themeService:u,styleService:p,animationsService:x,disclaimerService:M})},[h,m,f,d.name(),y.language(),e,D.direction,S.edit]),x};function $i({width:e,height:t,fontSize:r}){const{FULL:n}=an;if(e>=n.width&&t>=n.height){let e=Number.parseFloat(r);return e=Math.floor(e*Rr),`${e}px`}return r}var Gi=e=>()=>e;function Ui(e){return 1===(e=+e)?Wi:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):Gi(isNaN(t)?r:t)}}function Wi(e,t){var r=t-e;return r?function(e,t){return function(r){return e+r*t}}(e,r):Gi(isNaN(e)?t:e)}var Ki=function e(t){var r=Ui(t);function n(e,t){var n=r((e=Nn(e)).r,(t=Nn(t)).r),i=r(e.g,t.g),o=r(e.b,t.b),a=Wi(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return n.gamma=e,n}(1);function Xi({thisColor:e,paletteColors:t,paletteIndex:r,limit:n,isLeft:i=!1,themeService:o}){const a=i?0:1,s=0===Object.entries(n).length,l=n.gradient;let u=r+(i?-1:1);s&&(u=i?0:t.length-1);const c=o.getTheme().getColorPickerColor(u<t.length&&u>=0?t[u]:t[0]);return{color:l?Ki(e,c)(.5):e,offset:a,gradient:l}}function Zi({limits:e,paletteColors:t,paletteIndex:r,themeService:n}){const i=_t(e,""+(r-1),{}),o=_t(e,`${r}`,{}),a=[i,o].map(e=>e.gradient).includes(!0),s=n.getTheme().getColorPickerColor(t[r]);if(!a)return[{offset:0,color:s},{offset:1,color:s}];const l=[Xi({thisColor:s,paletteColors:t,paletteIndex:r,limit:i,isLeft:!0,themeService:n}),Xi({thisColor:s,paletteColors:t,paletteIndex:r,limit:o,isLeft:!1,themeService:n})];2===l.filter(e=>e.gradient).length&&l.splice(1,0,{offset:.5,color:s,gradient:!0});const u=l.map(({offset:e,color:t,gradient:r})=>({offset:e,color:t,gradient:r}));return u}function Yi({themeService:e,segmentInfo:t,rangeLimits:r}){const{limits:n,colors:i}=t;let{paletteColors:o}=t;o&&0!==o.length||!i||(o=i.map(e=>({index:e.color})));const{min:a,max:s}=r;n.sort((e,t)=>e.value-t.value);const l=[a,...n.map(e=>e.value),s],u=[];for(let t=0;t<o.length;t++){const r=Zi({limits:n,paletteColors:o,paletteIndex:t,themeService:e}).map(e=>({offset:ji(l[t]+e.offset*(l[t+1]-l[t]),a,s),color:e.color,gradient:"gradient"in e?e.gradient:void 0}));u.push(...r)}return u}function Ji(e){return e.map(e=>({...e,offset:1-e.offset})).reverse()}function Qi({themeService:e,isVertical:t,segmentInfo:r,rangeLimits:n,isRtl:i}){return{type:"gradient",x1:0,x2:t?0:1,y1:t?1:0,y2:0,stops:i&&!t?Ji(Yi({themeService:e,segmentInfo:r,rangeLimits:n})):Yi({themeService:e,segmentInfo:r,rangeLimits:n})}}function eo(e){const t=function(e){if(e=e.replace("#",""),6!==e.length)throw new Error("Invalid hex color");const t=parseInt(e.substring(0,2),16),r=parseInt(e.substring(2,4),16),n=parseInt(e.substring(4,6),16);return{r:t,g:r,b:n}}(e),r=.21*t.r+.72*t.g+.07*t.b>127.5?-50:50;return`rgb(${t.r+r}, ${t.g+r}, ${t.b+r})`}function to({services:e}){const{dockService:t,disclaimerService:r}=e,{translator:n,isClosed:i,isEditMode:o}=r;if(i()||!o)return!1;const a=t.config.rtl;return{key:"disclaimer-component",type:"disclaimer-component",layout:{displayOrder:5,minimumLayoutMode:on},settings:{isRtl:a,close:e.disclaimerService.close,title:n.get("Object.Gauge.RangeIsDefaultTitle"),text:n.get("Object.Gauge.RangeIsDefault")}}}function ro({services:e}){const{dockService:t,layoutService:r,themeService:n,animationsService:i}=e,{qHyperCube:o,useSegments:a,segmentInfo:s,rangeLimits:l}=r.meta,u=Hi({dockService:t,layoutService:r}),c=u?"vertical":"horizontal";if(!a)return!1;const{min:p,max:f}=l,d=o.qDataPages[0].qMatrix[0][0].qNum,m=Math.max(p,Math.min(f,d)),h={type:"box",key:Yr.MARK,data:{extract:{field:"qMeasureInfo/0",props:{start:m,end:m,measureIndex:0}}},settings:{minor:{scale:"m"},orientation:c,box:{width:.1,maxWidthPx:Ar,minHeightPx:Tr,fill:()=>function({themeService:e,isVertical:t,segmentInfo:r,rangeLimits:n,value:i}){const o=Qi({themeService:e,isVertical:t,segmentInfo:r,rangeLimits:n,isRtl:!1}),{min:a,max:s}=n,l=ji(i,a,s),{stops:u}=o;let c="black";for(let e=0;e<u.length;e++){const t=u[e].offset,r=u[e+1].offset;if(l>=t&&l<=r){const n=ji(l,t,r);c=li(Ki(u[e].color,u[e+1].color)(n));break}}return c}({value:d,themeService:n,isVertical:u,segmentInfo:s,rangeLimits:l}),stroke:"transparent"}},animations:{enabled:i.enabled,trackBy:e=>`${e.data.measureIndex.value}`}};return h}function no({services:e}){const{dockService:t,themeService:r,styleService:n,layoutService:i,animationsService:o}=e;if(!_i(i.meta.measureAxisShow))return[];const{width:a,height:s}=t.meta.chart.size,l=di(a,s,wr,Ir),{innerRadius:u,outerRadius:c,radiusIncrease:p}=l,f=4*p,d=Math.min(a,s)/2,m=r.getStyles(),h=n.query.axis.label.getStyle(),{tickLength:g,labelPadding:y}=function({width:e,height:t,defaultTickSize:r,defaultLabelPadding:n}){const i=Math.min(Math.min(e,t)/sn,1);return{tickLength:r*i,labelPadding:n*i}}({width:a,height:s,defaultTickSize:8,defaultLabelPadding:20}),v=yi(a,s);return[{key:Yr.RADIAL_AXIS,type:"axis",rendererSettings:{disableScreenReader:!0},dock:"center",layout:{minimumLayoutMode:nn},scale:"m",settings:{arc:{radius:c,startAngle:wr,endAngle:Ir,offset:-10*f*(c-u)*d},align:"top",line:{show:!1,stroke:"#cdcdcd"},ticks:{tickSize:g,stroke:m.axis.line.major.color,margin:v},labels:{margin:-6-2*g+y,fontFamily:h.fontFamily,fill:h.fill,fontSize:h.fontSize}},animations:{enabled:o.enabled,trackBy:e=>{const{type:t,text:r,x:n,y:i,x1:o,y1:a,value:s}=e;return"text"===t?`text-${r}-${n}-${i}`:`tick-${s}-${o}-${a}`}}}]}function io(e,t,r,n){const i=n?Ji(Yi({themeService:t,segmentInfo:r,rangeLimits:e})):Yi({themeService:t,segmentInfo:r,rangeLimits:e}),o=(Ir-wr)/(2*Math.PI),a=i.map(e=>{""!==e.color&&void 0!==e.color||(e.color="#000000");return{offset:e.offset*o,color:e.color}});return{type:"gradient",orientation:"conic",startAngle:wr-Math.PI/2,x:0,y:0,stops:a}}function oo({services:e}){const{dockService:t,themeService:r,layoutService:n,animationsService:i}=e,{rangeLimits:o,useSegments:a,segmentInfo:s,qHyperCube:l}=n.meta,{width:u,height:c}=t.meta.chart.size,p=t.config.rtl,{outerRadius:f,innerRadius:d,labelGaugeRadius:m}=di(u,c,wr,Ir),h=o.max,g=l.qDataPages[0].qMatrix[0][0].qNum,y=h-g,v=[{value:Math.max(Qr,g-o.min),valueLabel:"Measure"},{value:Math.max(Qr,y),valueLabel:"Remaining"}],b=function({themeService:e,segmentInfo:t,rangeLimits:r}){const n=Yi({themeService:e,segmentInfo:t,rangeLimits:r});let i=0,o=0;const a=n.map(e=>(""!==e.color&&void 0!==e.color||(e.color="#000000"),o=0===r.max?e.offset*(r.max-r.min)-i:e.offset*r.max-i,i+=o,{value:o,color:e.color,gradient:e.gradient})).filter(e=>0!==e.value||!0===e.gradient);return a.forEach(e=>{e.value=Math.abs(e.value)}),a}({themeService:r,segmentInfo:s,rangeLimits:o});p&&(v.reverse(),b.reverse());const x={type:"pie",key:Yr.RADIAL_GAUGE,data:{items:v},settings:{startAngle:wr,endAngle:Ir,slice:{arc:{ref:"value"},outerRadius:()=>f,innerRadius:()=>d,fill:(t,r)=>{const n=fi({services:e});return p?1===r?n(t):kr:0===r?n(t):kr},strokeWidth:e=>e.datum.value.value===Qr?0:1,stroke:(t,r)=>{const n=eo(fi({services:e})(t));return p?1===r?n:"#0000":0===r?n:"#0000"}}},animations:{enabled:i.enabled,trackBy:e=>e.data.value.valueLabel}},q={type:"pie",key:Yr.SEGMENT_RADIAL_GAUGE,renderer:"canvas",displayOrder:1,data:{items:b},settings:{startAngle:wr,endAngle:Ir,slice:{arc:{ref:"value"},outerRadius:()=>f,innerRadius:()=>d,strokeWidth:0,fill:(e,t)=>(p?e.datum.value.gradient||b[t+1]?.gradient:e.datum.value.gradient||b[t-1]?.gradient)?io(o,r,s,p):e.datum.value.color}},animations:{enabled:i.enabled,trackBy:e=>e.data.value.color}},D={type:"pie",key:Yr.CIRCLE_GAUGE,renderer:"canvas",displayOrder:0,data:{items:[{value:Math.max(g,Qr),valueLabel:"Measure"}]},settings:{startAngle:0,endAngle:2*Math.PI,slice:{arc:{ref:"value"},outerRadius:()=>f,innerRadius:()=>d,fill:()=>function(e,t,r,n){const i=io(e,t,r,n),o={offset:(Ir-wr)/(2*Math.PI),color:"rgba(0, 0, 0, 0)"};return i.stops.push(o),i.stops.push({offset:1,color:"rgba(0, 0, 0, 0)"}),i}(o,r,s,p),strokeWidth:0,opacity:a?1:0}},animations:{enabled:i.enabled,trackBy:e=>e.data.value.valueLabel,isMainComponent:!0}},S={type:"pie",key:Yr.LABEL_RADIAL_GAUGE,renderer:"canvas",displayOrder:0,data:{items:[{value:Math.max(g,Qr),valueLabel:"Measure"}]},settings:{startAngle:0,endAngle:2*Math.PI,slice:{arc:{ref:"value"},outerRadius:()=>m+.01,innerRadius:()=>m,opacity:0}},animations:{enabled:i.enabled,trackBy:e=>e.data.value.valueLabel,isMainComponent:!0}};return a?[D,S,q]:[S,x]}function ao({chart:e,services:t}){const{layoutService:r,styleService:n,labelService:i,animationsService:o,dockService:a}=t,{width:s,height:l}=a.meta.chart.size,{getValueLabelFontSize:u}=i,c=n.query.axis.title.getStyle(),p=u(Lr.MIN,Lr.MAX),f=Number.parseFloat($i({width:s,height:l,fontSize:c.fontSize})),d=function({width:e,height:t,totalFontHeight:r}){const n=di(e,t,wr,Ir).labelGaugeRadius*Math.min(e,t)*.9-r;return(vi(e,t)-2*yi(e,t))/n}({width:s,height:l,totalFontHeight:p+f}),m=.5-d,h=zi(r.meta.measureAxisShow,s,l),{qHyperCube:g}=r.meta,y=g.qMeasureInfo[0].qFallbackTitle,v=g.qDataPages[0].qMatrix[0][0].qNum,b=n.query.label.getStyle();return[{type:"labels",key:Yr.RADIAL_GAUGE_LABEL,layout:{displayOrder:4},settings:{sources:[{component:Yr.LABEL_RADIAL_GAUGE,selector:"path",strategy:{type:"rows",settings:{fill:"#000",padding:0,justify:m,labels:[{fontSize:p,fontFamily:b.fontFamily,fill:b.fill,label({data:t}){const r=e.formatter(Zr.MEASURE);return t&&r?r(v):""},linkData:({data:e})=>e?{value:e.value.value,formatter:Zr.MEASURE}:null},{fontSize:f,fontFamily:c.fontFamily,fill:c.color,label:()=>h?y:""}]}}}]},animations:{enabled:o.enabled,trackBy:e=>"text"+(e.data?"value-label":"axis-title"),adjustTweenedNodes(t){t.forEach(t=>{const{type:r,data:n}=t;if("text"===r&&n&&n.value&&n.formatter&&(t.text=e.formatter(n.formatter)(n.value),t.ellipsed&&"0"!==t.ellipsed)){const{text:e,fontSize:r,fontFamily:n,maxWidth:i}=t,o=`normal ${r} ${n}`,a="…",s=1;t.ellipsed=Ii.tokenize(e,o,a,s,i)[0]}})}}}]}function so({services:e}){const{dockService:t,layoutService:r,animationsService:n}=e,{width:i,height:o}=t.meta.chart.size,a=t.config.rtl,{rangeLimits:s,qHyperCube:l}=r.meta,{min:u,max:c}=s;let p,f=l.qDataPages[0].qMatrix[0][0].qNum;(f>c||f<u)&&(p="#00000000"),a&&(f=c-(f-u));const d=wr+ji(f,u,c)*(Ir-wr);return{type:"radial-gauge-needle",key:Yr.RADIAL_GAUGE_NEEDLE,layout:{displayOrder:2},settings:{component:Yr.SEGMENT_RADIAL_GAUGE,fill:p,valueAngle:d,width:i,height:o},animations:{enabled:n.enabled,trackBy:e=>e.type,adjustTweenedNodes(e){e.forEach(e=>{const{data:t}=e;if(t){const{pointerWidth:r,angle:n,radius:a,fill:s}=t,l=mi(i/2,o/2,a,n+Math.PI/2),{x:u,y:c}=l,p=[{x:u+.3*r,y:c},{x:u-7.5*r,y:c+r},{x:u-7.5*r,y:c-r}],{d:f}=ci({points:p,angle:n,fill:s,origin:l});e.d=f}})}}}}function lo({services:e}){const{dockService:t,layoutService:r,animationsService:n}=e,{width:i,height:o}=t.meta.chart.size,a=t.config.rtl,{rangeLimits:s,useSegments:l,qHyperCube:u}=r.meta,{min:c,max:p}=s,f=u.qDataPages[0].qMatrix[0][0].qNum,{outerRadius:d,innerRadius:m}=di(i,o,wr,Ir),h=(m+(d-m)/2)*Math.min(i,o)/2,{RADIAL_OOB_INDICATOR_MIN:g,RADIAL_OOB_INDICATOR_MAX:y,SEGMENT_RADIAL_GAUGE:v,RADIAL_GAUGE:b}=Yr;return[g,y].map((t,r)=>{const s=l?v:b,u=function(e,t){const r=fi({services:e})({datum:{value:()=>0}});return t?"#595959":r}(e,l);let g=0;(0===r&&f<c||1===r&&f>p)&&(g=hi({innerRadius:m,outerRadius:d,width:i,height:o}));let y=wr;return(0===r&&a||1===r&&!a)&&(y=Ir),{type:"radial-oob-indicator",key:t,layout:{displayOrder:2},settings:{component:s,selector:"path",angle:y,radius:h,size:g,fill:u,width:i,height:o},animations:{enabled:n.enabled,trackBy:e=>e.type}}})}function uo({core:e,services:t}){const{chart:r}=e;if(!r)return[];const{dockService:n,layoutService:i}=t,{width:o,height:a}=n.meta.chart.size,{useSegments:s}=i.meta,l=Hi({dockService:n,layoutService:i}),u=[to({services:t})];if("bar"===t.layoutService.meta.gaugetype){u.push(...function({services:e}){const{dockService:t,layoutService:r,styleService:n,themeService:i,animationsService:o}=e;if("none"===r.meta.measureAxisShow)return[];const{width:a,height:s}=t.meta.chart.size,l=t.config.rtl,u=Hi({dockService:t,layoutService:r}),c=i.getStyles(),p=n.query.axis.label.getStyle(),{fontFamily:f,fill:d,fontSize:m}=p,h=_i(r.meta.measureAxisShow);return[{type:"axis",rendererSettings:{disableScreenReader:!0},key:Yr.BAR_AXIS,dock:"center",scale:"m",layout:{minimumLayoutMode:en},settings:{align:u?l?"right":"left":"top",line:{show:!u,stroke:c.axis.line.major.color},labels:{show:h,minLengthPx:20,fontFamily:f,fill:d,fontSize:$i({width:a,height:s,fontSize:m})},paddingStart:()=>{if(u){const e=Math.min(a/10,Ar);return a/2+e/2}const e=Math.min(s/10,Ar);return s/2+e/2+_r},ticks:{stroke:c.axis.line.major.color}},animations:{enabled:o.enabled,trackBy:e=>void 0===e.tickValue?"axis":"text"===e.type?`label: ${e.tickValue}`:`mark: ${e.tickValue}`}}]}({services:t}),...function({services:e}){const{themeService:t,dockService:r,layoutService:n,animationsService:i}=e,{rangeLimits:o,segmentInfo:a,useSegments:s}=n.meta,l=r.config.rtl,u=Hi({dockService:r,layoutService:n}),c=u?"vertical":"horizontal",{min:p,max:f}=o,d=l&&!u?f:p,m={type:"box",key:Yr.BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:p,end:{field:"qMeasureInfo/0"},measureIndex:0}}},settings:{minor:{scale:"m"},orientation:c,box:{width:.1,maxWidthPx:Ar,fill:fi({services:e}),strokeWidth:e=>e.datum.value<=p?0:1,stroke:t=>eo(fi({services:e})(t))}},animations:{enabled:i.enabled,isMainComponent:!0,trackBy:e=>`${e.data.measureIndex.value}`}},h={type:"box",key:Yr.SEGMENT_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:p,end:f,measureIndex:0}}},settings:{minor:{scale:"m"},orientation:c,box:{width:.1,maxWidthPx:Ar,fill:()=>Qi({themeService:t,isVertical:u,segmentInfo:a,rangeLimits:o,isRtl:l}),stroke:"transparent"}},animations:{enabled:i.enabled,trackBy:e=>`${e.data.measureIndex.value}`}},g={type:"box",key:Yr.BACKGROUND_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:p,end:f}}},settings:{minor:{scale:"m"},orientation:c,box:{width:.1,maxWidthPx:Ar,fill:kr}}},y={type:"box",key:Yr.LABEL_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:d,end:d}}},settings:{minor:{scale:"m"},orientation:c,box:{width:u?jr:zr,opacity:0}}};return s?[y,h]:[y,g,m]}({services:t}),...function({services:e}){const{dockService:t,labelService:r,styleService:n,layoutService:i}=e,{width:o,height:a}=t.meta.chart.size;if(!zi(i.meta.measureAxisShow,o,a))return[];const s=Hi({dockService:t,layoutService:i}),{measureAxisTitle:l,useSegments:u}=i.meta,{getTopPadding:c,getBottomPadding:p,getLeftPadding:f,getRightPadding:d}=r.barAxisTitle,m=n.query.axis.title.getStyle(),{fontFamily:h,fontSize:g,color:y}=m;return[{type:"labels",key:Yr.AXIS_TITLE,settings:{sources:[{component:u?Yr.SEGMENT_BAR:Yr.BACKGROUND_BAR,selector:"rect",strategy:{type:"bar",settings:{direction:s?"up":"right",align:.5,justify:.5,labels:[{fontFamily:h,fill:y,fontSize:Number.parseFloat($i({width:o,height:a,fontSize:g})),label:()=>l,dock:s&&t.config.rtl?"right":"left",placements:[{position:"inside",padding:{top:c,bottom:p,left:f,right:d},overflow:!0}]}]}}}]}}]}({services:t}),function({services:e}){const{layoutService:t,dockService:r,labelService:n,animationsService:i}=e,{qHyperCube:o,rangeLimits:a,useSegments:s}=t.meta,{width:l,height:u}=r.meta.chart.size,c=r.config.rtl,p=Hi({dockService:r,layoutService:t}),{min:f,max:d}=a,m=o.qDataPages[0].qMatrix[0][0].qNum;let h=n.getBarWidthInPixels();m<=d&&m>=f&&(h=0);let g=p?"bottom":c?"right":"left";return m>d&&(g=p?"top":c?"left":"right"),{type:"oob-indicator",key:Yr.OOB_INDICATOR,layout:{displayOrder:2},settings:{component:s?Yr.SEGMENT_BAR:Yr.BAR,isRtl:c,selector:"rect",pointingTo:g,size:h,width:l,height:u},animations:{enabled:i.enabled,trackBy:e=>e.type}}}({services:t}),ro({services:t}));const e=function({chart:e,services:t}){if(!e.formatter)return!1;const{labelService:r,styleService:n,dockService:i,layoutService:o,animationsService:a}=t,s=Hi({dockService:i,layoutService:o}),{getValueLabelFontSize:l,barValueLabel:u}=r,{getTopPadding:c,getBottomPadding:p,getLeftPadding:f,getRightPadding:d}=u,m=l(Lr.MIN,Lr.MAX),h=n.query.label.getStyle();return{type:"labels",key:Yr.GAUGE_LABEL,layout:{minimumLayoutMode:s?tn:rn},settings:{sources:[{component:Yr.LABEL_BAR,selector:"rect",formatter:"measure",strategy:{type:"bar",settings:{direction:s?"up":"right",orientation:"horizontal",fontFamily:h.fontFamily,fill:h.fill,fontSize:m,align:s?0:.5,justify:0,labels:[{label:({data:t})=>t?e.formatter(Zr.MEASURE)(t.value):"",linkData:({data:e})=>e?{value:e.value,formatter:Zr.MEASURE}:null,placements:[{position:"outside",padding:{top:c,bottom:p,left:f,right:d},overflow:!0}]}]}}}]},animations:{enabled:a.enabled,trackBy:e=>e.type,adjustTweenedNodes(t){t.forEach(t=>{const{type:r,data:n}=t;"text"===r&&n&&n.value&&n.formatter&&(t.text=e.formatter(n.formatter)(n.value))})}}}}({chart:r,services:t}),n=function({services:e}){const{dockService:t,layoutService:r,labelService:n,themeService:i,colorService:o,animationsService:a}=e,{refLines:s}=r.meta,l=t.config.rtl,u=Hi({dockService:t,layoutService:r}),c=i.getStyles();return{type:"custom-ref-line",key:Yr.REFERENCE_LINES_AND_LABELS,settings:{barWidth:n.getBarWidthInPixels(),isRtl:l,needlePosition:n.getNeedlePosition(!1)},lines:{[u?"y":"x"]:s.filter(gi).map(e=>({scale:"m",value:e.refLineExpr.value,cId:e.cId,label:{text:e.label,...c.referenceLine.label.name,showValue:e.showValue,showLabel:e.showLabel},line:{stroke:o.getPaletteColor(e.paletteColor||{index:e.color}),strokeWidth:e.style?.lineThickness||2,strokeDasharray:e.style?.lineType}}))},animations:{enabled:a.enabled,trackBy:e=>{const{type:t,cId:r,text:n,isConnector:i}=e;return"text"===t?`${r}-text-${n}`:"line"===t?i?`${r}-connector`:`${r}-line`:Math.random()}}}}({services:t});l?(u.push(e),u.push(n)):(u.push(n),u.push(e))}else o>=an.SPARK.width&&a>=an.SPARK.height?u.push(...oo({services:t}),...ao({chart:r,services:t}),...no({services:t}),...s?[so({services:t})]:[],...lo({services:t}),function({services:e}){const{dockService:t,themeService:r,colorService:n,layoutService:i,animationsService:o}=e,{width:a,height:s}=t.meta.chart.size,{refLines:l}=i.meta,u=r.getStyles(),c=di(a,s,wr,Ir),{innerRadius:p,outerRadius:f}=c,d=hi({innerRadius:p,outerRadius:f,width:a,height:s}),m={type:"radial-custom-ref-line",key:Yr.RADIAL_REFERENCE_LINES,displayOrder:1,settings:{barWidth:d},lines:{radial:l.filter(gi).map(e=>({scale:"r",value:e.refLineExpr.value,cId:e.cId,label:{text:e.label,...u.referenceLine.label.name,showValue:e.showValue,showLabel:e.showLabel},radius:c.innerRadius,line:{stroke:n.getPaletteColor(e.paletteColor||{index:e.color}),strokeWidth:e.style?.lineThickness||2,strokeDasharray:e.style?.lineType}}))},animations:{enabled:o.enabled,trackBy:e=>{const{type:t,cId:r}=e;return"line"===t?`${r}-line`:Math.random()},adjustTweenedNodes(e){e.forEach(e=>{const{type:t,data:r}=e;if("line"===t){const{angle:t,innerRadius:n}=r;e.x1=a/2+Math.cos(t)*n,e.y1=s/2+Math.sin(t)*n,e.x2=a/2+Math.cos(t)*(n+d),e.y2=s/2+Math.sin(t)*(n+d)}})}}};return m}({services:t})):u.push(function({services:e}){const{dockService:t,layoutService:r,themeService:n,animationsService:i}=e,{width:o,height:a}=t.meta.chart.size,{rangeLimits:s,useSegments:l,segmentInfo:u,qHyperCube:c}=r.meta,{min:p,max:f}=s,d=c.qDataPages[0].qMatrix[0][0].qNum,m=di(o,a,wr,Ir).outerRadius;let h;h=d<p?wr:d>f?Ir:wr+(d-p)/(f-p)*(Ir-wr);const g=fi({services:e}),y=l?function({value:e,segmentInfo:t,themeService:r}){const{paletteColors:n,limits:i}=t,o=r.getTheme();if(!i.length)return o.getColorPickerColor(n[0]);const a=i.findIndex(t=>e<=t.value),s=-1===a?n.length-1:a;return o.getColorPickerColor(n[s]||n[n.length-1])}({value:d,segmentInfo:u,themeService:n}):g({datum:{value:()=>0}});return{type:"radial-spark",key:Yr.RADIAL_SPARK,layout:{displayOrder:2},settings:{fill:y,radius:m,valueAngle:h,width:o,height:a},animations:{enabled:i.enabled,trackBy:e=>e.type}}}({services:t}));return u}const co=Math.log(10),po={log:(e,t)=>e<=0||t<=0?NaN:Math.log(e)/Math.log(t),log10:e=>e<=0?NaN:Math.log(e)/co,getNiceNumber(e){let t;if(0===e)return 0;const r=Math.floor(Math.log(Math.abs(e))/co),n=e/10**r;return t=n<=1?1:n<=2?2:n<=5?5:10,t*10**r*(e<0?-1:1)},getSmallNiceNumber(e){let t;if(0===e)return 0;let r=Math.floor(Math.log(Math.abs(e))/co);const n=e/10**r;return n<1?(t=5,r--):t=n<2?1:n<5?2:5,t*10**r*(e<0?-1:1)},getGoodNumber(e){let t;if(0===e)return 0;const r=Math.floor(Math.log(Math.abs(e))/co),n=e/10**r;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**r*(e<0?-1:1)},calculateTicks(e,t,r,n,i,o){return this.plotSize=e,this.explicitPlotMin=t,this.explicitPlotMax=r,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=o||0,this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),this.fontHeight=i,this.tickBaseValue=0,this.spaceUseLimit=.6,0===e?(this.plotMin=this.explicitPlotMin,this.plotMax=this.explicitPlotMax,this.tickDataSpacingNN=this.tickDataSpacing,qo.call(this),So.call(this)):(this.maxNumIntervals<1?go.call(this):(this.explicitPlotMax>0&&this.explicitPlotMin<0?1===this.maxNumIntervals?ho.call(this,!0):this.maxNumIntervals>=5?mo.call(this):this.maxNumIntervals<2?yo.call(this):vo.call(this):mo.call(this),this.tickMaxIndex<this.tickMinIndex?(this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),go.call(this)):bo.call(this)),qo.call(this),So.call(this))}};function fo(e,t,r){void 0===e&&(e=null!==this.explicitPlotMin),void 0===t&&(t=null!==this.explicitPlotMax),this.tickDataSpacingNN=r?po.getGoodNumber(this.tickDataSpacing):po.getNiceNumber(this.tickDataSpacing),Do.apply(this,[e,t])}function mo(){fo.call(this);const e=this.tickMaxIndex-this.tickMinIndex;let t=this.plotMax-this.plotMin;this.spaceUseFactor=t/this.plotRange;let r=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;if(r&&this.maxNumIntervals>=5){for(;this.tickDataSpacing<=this.absMax&&r;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),fo.call(this),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,r=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;if(!r)return}for(this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),(r||e<=2&&this.maxNumIntervals>=2*e)&&fo.apply(this,[void 0,void 0,!0]),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,r=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;this.tickDataSpacing<=this.absMax&&r;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),fo.apply(this,[void 0,void 0,!0]),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,r=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel}function ho(e){e?(this.tickDataSpacingNN=po.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=po.getNiceNumber(this.absMax),this.tickDataSpacingNN===this.absMax&&(this.tickDataSpacingNN=po.getNiceNumber(1.1*this.absMax)))}function go(){let e;this.tickDataSpacingNN=po.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=po.getSmallNiceNumber(this.plotRange),this.tickBaseValue=Math.ceil(this.plotMin/e)*e)}function yo(){const e=this.explicitPlotMax>=-this.explicitPlotMin,t=e||null!==this.explicitPlotMin,r=!e||null!==this.explicitPlotMax;fo.apply(this,[t,r,!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),fo.apply(this,[t,r,!0]);const i=this.plotMax-this.plotMin;this.spaceUseFactor=i/this.plotRange}function vo(){mo.call(this);const e=this.plotMax-this.plotMin;this.spaceUseFactor=e/this.plotRange}function bo(){const e=po.getNiceNumber(this.tickDataSpacingNN);if(this.tickDataSpacingNN===e||0!==this.tickBaseValue)return;const t=this.tickDataSpacingNN,r=this.tickMinIndex,n=this.tickMaxIndex,i=n-r,o=this.plotMin,a=this.plotMax;this.tickDataSpacingNN=e,Do.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,u=this.tickMaxIndex-this.tickMinIndex;!l&&(u===i||u>=10||u>=3&&1.5*u>=i)||(this.tickDataSpacingNN=t,this.tickMinIndex=r,this.tickMaxIndex=n,this.plotMin=o,this.plotMax=a,this.plotRange=this.plotMax-this.plotMin)}function xo(){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 qo(){let e,t;if(this.mainTickValues=[],this.secondaryTickValues=[],xo.call(this),0===this.plotSize)return;e=this.tickBaseValue;const r=this.tickMaxIndex-this.tickMinIndex;if(!(r<1)){for(t=0;t<=r;t++)this.mainTickValues.push(e+(t+this.tickMinIndex)*this.tickDataSpacingNN);for(e=this.tickBaseValue+this.tickDataSpacingNN/2,t=0;t<r;t++)this.secondaryTickValues.push(e+(t+this.tickMinIndex)*this.tickDataSpacingNN)}}function Do(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 So(){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 Mo({core:e,dockService:t,rangeLimits:r,measureAxisSpacing:n,isRadial:i,isVertical:o,styleService:a}){const s=r.min,l=r.max,{width:u,height:c}=function(e){return{width:e.meta.chart.size.width,height:e.meta.chart.size.height}}(t);let p,f=96*n;if(i)p=Math.min(c,u);else{p=o?c:u;const{chart:t,picassoInstance:r}=e;if(t&&r){const e=t.formatter(Zr.MEASURE),i=r.renderer("svg")(),d=a.query.axis.label.getStyle(),{fontFamily:m,fontSize:h}=d,g=e=>i.measureText({text:e,fontSize:$i({width:u,height:c,fontSize:h}),fontFamily:m}),y=Math.max(96,...[s,l,(l-s)/2].map(t=>g(e(t)).width));f=o?4*g("M").height:y;f=p/(Math.max(2,p/f/n+1)-1)}}const d=function({plotSize:e,rangeMax:t,rangeMin:r,minTickSpacingInPixel:n}){const i=po.calculateTicks(e,r,t,n,20,0);i.tickSpacing;const o=i.mainTickValues;0===o.length&&o.push(i.minTickValue);const a=o[0];o[0]=i.plotMin,a-i.plotMin>=i.tickSpacing/2&&o.splice(1,0,a);const s=i.mainTickValues[i.mainTickValues.length-1];return i.plotMax-s<=i.tickSpacing/2?o[i.mainTickValues.length-1]=i.plotMax:o.push(i.plotMax),o}({plotSize:p,rangeMin:s,rangeMax:l,minTickSpacingInPixel:f});return{values:d}}function Ao({isRadial:e,dockService:t,isVertical:r}){return e?!t.config.rtl:!!r||t.config.rtl}function wo({core:e,services:t,logicalSize:r}){if(!t.layoutService.meta.qHyperCube)throw new Error("Layout is missing a hypercube");const n=uo({core:e,services:t}),i=function({core:e,services:t}){const{dockService:r,styleService:n,colorService:i,layoutService:o}=t,{rangeLimits:a,measureAxisSpacing:s,gaugetype:l}=o.meta,u=Hi({dockService:r,layoutService:o}),c="radial"===l,p=Mo({core:e,dockService:r,rangeLimits:a,measureAxisSpacing:s,isRadial:c,isVertical:u,styleService:n});return{m:{data:{field:"qMeasureInfo/0"},type:"linear",invert:Ao({isRadial:c,dockService:r,isVertical:u}),min:a.min,max:a.max,ticks:{values:p.values}},r:{data:{field:"qMeasureInfo/0"},invert:r.config.rtl,min:a.min,max:a.max},...i.getScales()}}({core:e,services:t});return{scales:i,components:n,formatters:{[Zr.MEASURE]:{data:{field:"qMeasureInfo/0"}}},strategy:{layoutModes:an,logicalSize:r}}}const Io={Object_Gauge_RangeIsDefault:{id:"Object.Gauge.RangeIsDefault",locale:{"de-DE":"Max. und Min. auf Standardwerte festgelegt. Sie können über das Eigenschaften-Fenster unter Darstellung > Präsentation geändert werden.","en-US":"Max. and Min. set to default values. You can change them via the properties window under Display > Presentation.","es-ES":"Máx y mín se han configurado como valores predefinidos. Puede cambiarlos en el panel de propiedades en Aspecto > Presentación.","fr-FR":"Les valeurs max. et min. par défaut sont définies. Vous pouvez les modifier via le panneau des propriétés sous Aspect > Présentation.","it-IT":"Il massimo e il minimo vengono impostati sui valori predefiniti. È possibile modificarli nel pannello delle proprietà in Aspetto > Presentazione.","ja-JP":"最大値と最小値は規定値に設定されています。これは、スタイル > プレゼンテーションからプロパティ パネルで変更できます。","ko-KR":"최대 및 최소 값이 기본값으로 설정됩니다. 모양 > 프레젠테이션 아래 속성 패널에서 이를 변경할 수 있습니다.","nl-NL":"Max. en min. zijn ingesteld op standaardwaarden. U kunt deze wijzigen in het eigenschappenvenster onder Uiterlijk > Presentatie.","pl-PL":"Maks. i Min. są ustawione na wartości domyślne. Można je zmienić w panelu właściwości, w obszarze Wygląd > Prezentacja.","pr-BR":"Máx. e mín. estão definidos com valores padrão. É possível alterá-los no painel de propriedades, em Aparência > Apresentação.","ru-RU":"Максимальные и минимальные значения установлены по умолчанию. Эти значения можно изменить на панели свойств в меню Вид > Представление.","sv-SE":"Max och min är inställda på standardvärden. Du kan ändra dem i egenskapspanelen under Utseende > Presentation.","tr-TR":"Maks. ve min. değerleri varsayılan değerlere ayarlanmıştır. Görünüş > Sunum altındaki özellikler panelinden bu değerleri değiştirebilirsiniz.","zh-CN":"最大值和最小值已设置为默认值。您可以在“外观”>“显示”下的属性面板中进行更改。","zh-TW":"最大值與最小值均設為預設值。您可以在 [外觀] > [呈現方式] 之下的屬性面板中變更這些值。"}},Object_Gauge_RangeIsDefaultTitle:{id:"Object.Gauge.RangeIsDefaultTitle",locale:{"de-DE":"Bereich auf Standardwerte eingestellt","en-US":"Range set to default values","es-ES":"Rango fijado a valores predeterminados","fr-FR":"Plage définie sur les valeurs par défaut","it-IT":"Scala impostata sui valori predefiniti","ja-JP":"範囲は規定値に設定されています","ko-KR":"범위가 기본값으로 설정됩니다.","nl-NL":"Bereik ingesteld op standaardwaarden","pl-PL":"Zakres ustawiony na wartości domyślne","pt-BR":"Intervalo definido com valores padrão","ru-RU":"Значения диапазона установлены по умолчанию","sv-SE":"Intervallet har standardvärden","tr-TR":"Varsayılan değerlere ayarlı aralık","zh-CN":"范围设置为默认值","zh-TW":"範圍會設為預設值"}}};function ko(e){return{version:JSON.stringify("0.9.0"),qHyperCubeDef:{qMeasures:[],qInitialDataFetch:[{qWidth:1,qHeight:1}],qSuppressZero:!1,qSuppressMissing:!0},showTitles:!0,title:"",subtitle:"",footnote:"",disableNavMenu:!!e?.flags?.isEnabled?.("TLV_1804_DEFAULT_CHART_SETTINGS"),measureAxis:{min:0,max:100,show:"all",spacing:1},orientation:"horizontal",segmentInfo:{limits:[],paletteColors:[{index:6}]},refLine:{refLines:[]},showDetails:!0,components:[],gaugetype:"radial",autoOrientation:!0,useSegments:!1,color:{useBaseColors:"measure"},paletteProgressColor:{index:6},angle:.7}}function Co(e){return{properties:ko(e),data:{targets:[{path:"/qHyperCubeDef",...br(e)}]}}}function Lo(i){return function(e){if(e&&e.get&&e.add){const t="Object.Gauge.RangeIsDefault";if(e.get(t)!==t)return;Object.keys(Io).forEach(t=>{e.add(Io[t])})}}(i.translator),{qae:Co(i),ext:Sr(i),component(){const i=(()=>{const i=e(),o=t(),[a,s]=r({});return n(()=>{i.style.overflow="hidden";const e=h();e.use(m),e.component("oob-indicator",pi),e.component("radial-gauge-needle",bi),e.component("radial-custom-ref-line",Ci),e.component("custom-ref-line",Ni),e.component("radial-oob-indicator",xi),e.component("radial-spark",Li),e.component("disclaimer-component",Mr);const t=e({renderer:{prio:[o.renderer||"svg"]}}),r=t.chart({element:i,data:[],settings:{}});return s({picassoInstance:t,chart:r,cache:Gt()}),()=>{r.destroy()}},[]),a})(),o=Bi({core:i}),a=(({core:e,services:i})=>{const[o,a]=r({}),s=t(),l=u();return f(async()=>{if(!i)return Promise.resolve();const{colorService:t}=i;return t.initialize().then(()=>{const{layoutService:t}=i,r=Ti({layout:t.getLayout(),options:s}),n=wo({core:e,services:i,logicalSize:r});a(n)})},[i]),n(()=>{if(i&&i.dockService&&i.layoutService){const{dockService:t,layoutService:r,animationsService:n}=i;n.meta.isSizeChanging=!0;const o=Ti({layout:r.getLayout(),options:s});t.update(o||l);const u=wo({core:e,services:i,logicalSize:o});a(u)}},[l]),o})({core:i,services:o});Fi({core:i,settings:a,services:o}),(({services:e})=>{d(t=>{if(e){const{dockService:r}=e,{width:n,height:i}=r.meta.chart.size;t.snapshotData=t.snapshotData||{content:{size:{w:n,h:i}}},t.snapshotData.content={size:{w:n,h:i}}}return Promise.resolve(t)})})({services:o})}}}export{Lo as default};
|