@nebula.js/sn-pivot-table 2.0.0-alpha.0 → 2.0.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.
@@ -0,0 +1,9 @@
1
+ /*
2
+ * @nebula.js/sn-pivot-table v2.0.0
3
+ * Copyright (c) 2023 QlikTech International AB
4
+ * Released under the MIT license.
5
+ */
6
+
7
+ System.register(["@nebula.js/stardust","react","react-dom"],(function(e){"use strict";var t,r,n,o,i,a,l,s,u,c,d,p,f,m,h,y,v,g,b,q,x,C,D,w,S,I,M;return{setters:[function(e){t=e.useMemo,r=e.useState,n=e.usePromise,o=e.useEffect,i=e.onTakeSnapshot,a=e.useTranslator,l=e.useElement,s=e.useStaleLayout,u=e.useModel,c=e.useConstraints,d=e.useSelections,p=e.useTheme,f=e.useRect},function(e){m=e.default,h=e.createContext,y=e.useContext,v=e.useRef,g=e.useMemo,b=e.useCallback,q=e.useState,x=e.createElement,C=e.PureComponent,D=e.memo,w=e.useLayoutEffect,S=e.useEffect,I=e.forwardRef},function(e){M=e.default}],execute:function(){function L(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function E(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function T(){}e("default",(function(e){return{qae:{properties:{initial:ii},data:Ft(e)},ext:Dr(e),component(){oi()}}}));var A=1/.7,P="\\s*([+-]?\\d+)\\s*",O="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",N="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",F=/^#([0-9a-f]{3,8})$/,k=new RegExp("^rgb\\("+[P,P,P]+"\\)$"),H=new RegExp("^rgb\\("+[N,N,N]+"\\)$"),_=new RegExp("^rgba\\("+[P,P,P,O]+"\\)$"),R=new RegExp("^rgba\\("+[N,N,N,O]+"\\)$"),V=new RegExp("^hsl\\("+[O,N,N]+"\\)$"),z=new RegExp("^hsla\\("+[O,N,N,O]+"\\)$"),j={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 W(){return this.rgb().formatHex()}function B(){return this.rgb().formatRgb()}function $(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=F.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?U(t):3===r?new X(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?G(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?G(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=k.exec(e))?new X(t[1],t[2],t[3],1):(t=H.exec(e))?new X(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=_.exec(e))?G(t[1],t[2],t[3],t[4]):(t=R.exec(e))?G(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=V.exec(e))?Q(t[1],t[2]/100,t[3]/100,1):(t=z.exec(e))?Q(t[1],t[2]/100,t[3]/100,t[4]):j.hasOwnProperty(e)?U(j[e]):"transparent"===e?new X(NaN,NaN,NaN,0):null}function U(e){return new X(e>>16&255,e>>8&255,255&e,1)}function G(e,t,r,n){return n<=0&&(e=t=r=NaN),new X(e,t,r,n)}function Y(e,t,r,n){return 1===arguments.length?function(e){return e instanceof T||(e=$(e)),e?new X((e=e.rgb()).r,e.g,e.b,e.opacity):new X}(e):new X(e,t,r,null==n?1:n)}function X(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function J(){return"#"+Z(this.r)+Z(this.g)+Z(this.b)}function K(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function Z(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Q(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new te(e,t,r,n)}function ee(e){if(e instanceof te)return new te(e.h,e.s,e.l,e.opacity);if(e instanceof T||(e=$(e)),!e)return new te;if(e instanceof te)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,o=Math.min(t,r,n),i=Math.max(t,r,n),a=NaN,l=i-o,s=(i+o)/2;return l?(a=t===i?(r-n)/l+6*(r<n):r===i?(n-t)/l+2:(t-r)/l+4,l/=s<.5?i+o:2-i-o,a*=60):l=s>0&&s<1?0:a,new te(a,l,s,e.opacity)}function te(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function re(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}function ne(e){return function(){return e}}function oe(e,t){var r=t-e;return r?function(e,t){return function(r){return e+r*t}}(e,r):ne(isNaN(e)?t:e)}function ie(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function ae(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function le(){}L(T,$,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:W,formatHex:W,formatHsl:function(){return ee(this).formatHsl()},formatRgb:B,toString:B}),L(X,Y,E(T,{brighter:function(e){return e=null==e?A:Math.pow(A,e),new X(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new X(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:J,formatHex:J,formatRgb:K,toString:K})),L(te,(function(e,t,r,n){return 1===arguments.length?ee(e):new te(e,t,r,null==n?1:n)}),E(T,{brighter:function(e){return e=null==e?A:Math.pow(A,e),new te(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new te(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,o=2*r-n;return new X(re(e>=240?e-240:e+120,o,n),re(e,o,n),re(e<120?e+240:e-120,o,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}})),function e(t){var r=function(e){return 1==(e=+e)?oe: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):ne(isNaN(t)?r:t)}}(t);function n(e,t){var n=r((e=Y(e)).r,(t=Y(t)).r),o=r(e.g,t.g),i=r(e.b,t.b),a=oe(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=o(t),e.b=i(t),e.opacity=a(t),e+""}}return n.gamma=e,n}(1);var se=1/.7,ue="\\s*([+-]?\\d+)\\s*",ce="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",de="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pe=/^#([0-9a-f]{3,8})$/,fe=new RegExp(`^rgb\\(${ue},${ue},${ue}\\)$`),me=new RegExp(`^rgb\\(${de},${de},${de}\\)$`),he=new RegExp(`^rgba\\(${ue},${ue},${ue},${ce}\\)$`),ye=new RegExp(`^rgba\\(${de},${de},${de},${ce}\\)$`),ve=new RegExp(`^hsl\\(${ce},${de},${de}\\)$`),ge=new RegExp(`^hsla\\(${ce},${de},${de},${ce}\\)$`),be={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 qe(){return this.rgb().formatHex()}function xe(){return this.rgb().formatRgb()}function Ce(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=pe.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?De(t):3===r?new Ie(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?we(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?we(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=fe.exec(e))?new Ie(t[1],t[2],t[3],1):(t=me.exec(e))?new Ie(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=he.exec(e))?we(t[1],t[2],t[3],t[4]):(t=ye.exec(e))?we(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ve.exec(e))?Pe(t[1],t[2]/100,t[3]/100,1):(t=ge.exec(e))?Pe(t[1],t[2]/100,t[3]/100,t[4]):be.hasOwnProperty(e)?De(be[e]):"transparent"===e?new Ie(NaN,NaN,NaN,0):null}function De(e){return new Ie(e>>16&255,e>>8&255,255&e,1)}function we(e,t,r,n){return n<=0&&(e=t=r=NaN),new Ie(e,t,r,n)}function Se(e){return e instanceof le||(e=Ce(e)),e?new Ie((e=e.rgb()).r,e.g,e.b,e.opacity):new Ie}function Ie(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function Me(){return`#${Ae(this.r)}${Ae(this.g)}${Ae(this.b)}`}function Le(){const e=Ee(this.opacity);return`${1===e?"rgb(":"rgba("}${Te(this.r)}, ${Te(this.g)}, ${Te(this.b)}${1===e?")":`, ${e})`}`}function Ee(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Te(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ae(e){return((e=Te(e))<16?"0":"")+e.toString(16)}function Pe(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 Oe(e){if(e instanceof Ne)return new Ne(e.h,e.s,e.l,e.opacity);if(e instanceof le||(e=Ce(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,o=Math.min(t,r,n),i=Math.max(t,r,n),a=NaN,l=i-o,s=(i+o)/2;return l?(a=t===i?(r-n)/l+6*(r<n):r===i?(n-t)/l+2:(t-r)/l+4,l/=s<.5?i+o:2-i-o,a*=60):l=s>0&&s<1?0:a,new Ne(a,l,s,e.opacity)}function Ne(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function Fe(e){return(e=(e||0)%360)<0?e+360:e}function ke(e){return Math.max(0,Math.min(1,e||0))}function He(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}ie(le,Ce,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:qe,formatHex:qe,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Oe(this).formatHsl()},formatRgb:xe,toString:xe}),ie(Ie,(function(e,t,r,n){return 1===arguments.length?Se(e):new Ie(e,t,r,null==n?1:n)}),ae(le,{brighter(e){return e=null==e?se:Math.pow(se,e),new Ie(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Ie(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ie(Te(this.r),Te(this.g),Te(this.b),Ee(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:Me,formatHex:Me,formatHex8:function(){return`#${Ae(this.r)}${Ae(this.g)}${Ae(this.b)}${Ae(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Le,toString:Le})),ie(Ne,(function(e,t,r,n){return 1===arguments.length?Oe(e):new Ne(e,t,r,null==n?1:n)}),ae(le,{brighter(e){return e=null==e?se:Math.pow(se,e),new Ne(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,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,o=2*r-n;return new Ie(He(e>=240?e-240:e+120,o,n),He(e,o,n),He(e<120?e+240:e-120,o,n),this.opacity)},clamp(){return new Ne(Fe(this.h),ke(this.s),ke(this.l),Ee(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=Ee(this.opacity);return`${1===e?"hsl(":"hsla("}${Fe(this.h)}, ${100*ke(this.s)}%, ${100*ke(this.l)}%${1===e?")":`, ${e})`}`}}));const _e=Math.PI/180,Re=180/Math.PI,Ve=4/29,ze=6/29,je=3*ze*ze;function We(e){if(e instanceof Be)return new Be(e.l,e.a,e.b,e.opacity);if(e instanceof Xe)return Je(e);e instanceof Ie||(e=Se(e));var t,r,n=Ye(e.r),o=Ye(e.g),i=Ye(e.b),a=$e((.2225045*n+.7168786*o+.0606169*i)/1);return n===o&&o===i?t=r=a:(t=$e((.4360747*n+.3850649*o+.1430804*i)/.96422),r=$e((.0139322*n+.0971045*o+.7141733*i)/.82521)),new Be(116*a-16,500*(t-a),200*(a-r),e.opacity)}function Be(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function $e(e){return e>.008856451679035631?Math.pow(e,1/3):e/je+Ve}function Ue(e){return e>ze?e*e*e:je*(e-Ve)}function Ge(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Ye(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Xe(e,t,r,n){this.h=+e,this.c=+t,this.l=+r,this.opacity=+n}function Je(e){if(isNaN(e.h))return new Be(e.l,0,0,e.opacity);var t=e.h*_e;return new Be(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function Ke(e,t,r){if(void 0!==e&&void 0!==t){for(var n=t.split("."),o=n[n.length-1],i=e,a=0;a<n.length-1;++a){var l=n[a];void 0===i[l]&&(i[l]=Number.isNaN(+n[a+1])?{}:[]),i=i[l]}void 0!==r?i[o]=r:delete i[o]}}function Ze(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e},r=function(){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={}}}}();return function(n){var o=t(n);return r.has(o)?r.get(o):r.set(o,e(n))}}function Qe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function et(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function tt(e,t,r){return t&&et(e.prototype,t),r&&et(e,r),e}function rt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nt(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 ot(e,t){var r,n,o,i,a,l=new st(e),s=+e.value&&(l.value=e.value),u=[l];for(null==t&&(t=it);r=u.pop();)if(s&&(r.value=+r.data.value),(o=t(r.data))&&(a=o.length))for(r.children=new Array(a),i=a-1;i>=0;--i)u.push(n=r.children[i]=new st(o[i])),n.parent=r,n.depth=r.depth+1;return l.eachBefore(lt)}function it(e){return e.children}function at(e){e.data=e.data.data}function lt(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function st(e){this.data=e,this.depth=this.height=0,this.parent=null}ie(Be,(function(e,t,r,n){return 1===arguments.length?We(e):new Be(e,t,r,null==n?1:n)}),ae(le,{brighter(e){return new Be(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Be(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 Ie(Ge(3.1338561*(t=.96422*Ue(t))-1.6168667*(e=1*Ue(e))-.4906146*(r=.82521*Ue(r))),Ge(-.9787684*t+1.9161415*e+.033454*r),Ge(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}})),ie(Xe,(function(e,t,r,n){return 1===arguments.length?function(e){if(e instanceof Xe)return new Xe(e.h,e.c,e.l,e.opacity);if(e instanceof Be||(e=We(e)),0===e.a&&0===e.b)return new Xe(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Re;return new Xe(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Xe(e,t,r,null==n?1:n)}),ae(le,{brighter(e){return new Xe(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Xe(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Je(this).rgb()}})),st.prototype=ot.prototype={constructor:st,count:function(){return this.eachAfter(nt)},each:function(e){var t,r,n,o,i=this,a=[i];do{for(t=a.reverse(),a=[];i=t.pop();)if(e(i),r=i.children)for(n=0,o=r.length;n<o;++n)a.push(r[n])}while(a.length);return this},eachAfter:function(e){for(var t,r,n,o=this,i=[o],a=[];o=i.pop();)if(a.push(o),t=o.children)for(r=0,n=t.length;r<n;++r)i.push(t[r]);for(;o=a.pop();)e(o);return this},eachBefore:function(e){for(var t,r,n=this,o=[n];n=o.pop();)if(e(n),t=n.children)for(r=t.length-1;r>=0;--r)o.push(t[r]);return this},sum:function(e){return this.eachAfter((function(t){for(var r=+e(t.data)||0,n=t.children,o=n&&n.length;--o>=0;)r+=n[o].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(),o=null;for(e=r.pop(),t=n.pop();e===t;)o=e,e=r.pop(),t=n.pop();return o}(t,e),n=[t];t!==r;)t=t.parent,n.push(t);for(var o=n.length;e!==r;)n.splice(o,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(){var e=[];return this.each((function(t){e.push(t)})),e},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 ot(this).eachBefore(at)}};var ut,ct,dt=(ut=function(e){
8
+ /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
9
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var r,n,o,i,a,l,s,u,c,d,p=e.length,f=e.search(/[0-9\-\+#]/),m=f>0?e.substring(0,f):"",h=e.split("").reverse().join(""),y=h.search(/[0-9\-\+#]/),v=p-y,g=e.substring(v,v+1),b=v+("."===g||","===g?1:0),q=y>0?e.substring(b,p):"";if(r=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,o=(n=e.match(/[^\d\-\+#]/g))&&n[n.length-1]||".",i=n&&n[1]&&n[0]||",",e=e.split(o),t=+(t=t.toFixed(e[1]&&e[1].length))+"",l=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=l)&&(t=(+t).toFixed(l+1)),c=e[0].split(i),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],s=c[1]&&c[c.length-1].length){for(h="",v=(d=t[0]).length%s,p=d.length,b=0;b<p;b++)h+=d.charAt(b),!((b-v+1)%s)&&b<p-s&&(h+=i);t[0]=h}return t[1]=e[1]&&t[1]?o+t[1]:"","0"!==(n=t.join(""))&&""!==n||(r=!1),m+(r?"-":"")+n+q}},ut(ct={exports:{}}),ct.exports);function pt(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}var ft={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},mt=/%$/,ht=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,yt=/^\(oct\)/i,vt=/^\(dec\)/i,gt=/^\(hex\)/i,bt=/^\(bin\)/i,qt=/^\(rom\)/i,xt=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Ct=/#|0/g;function Dt(e,t,r,n){return e=e.toString(t),r[1]===r[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",n||".")}function wt(e,t,r){var n=pt(e);return r?n:new RegExp(n||"",t)}function St(e,t,r){var n,o,i,a,l,s,u,c,d,p,f,m=e.pattern;m.indexOf("A")>=0&&(m=m.replace("A",""),e.abbreviate=!0),p=t,(f=r)&&(f=pt(f)),p&&(p=pt(p)),d=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(f,"[#0]+)?")),a=(i=(i=m.match(d))?i[0]:"")?m.substr(0,m.indexOf(i)):m,l=i?m.substring(m.indexOf(i)+i.length):"",i||(i=m?"#":"##########"),t&&t===r&&(o=(n=i.split(r)).pop(),i=n.join("")+r+o,t=""),s=t,t=/,/.test(r)?"¤":",",s&&(i=i.replace(wt(s,"g"),t)),u=r,r=".",u&&(i=i.replace(wt(u,"g"),r)),c=(c=i.match(/#/g))?c.length:0;var h,y=m.split(u);y[1]&&(h=y[1].match(Ct)),e.prefix=a||"",e.postfix=l||"",e.pattern=m,e.maxPrecision=h?h.length:2,e.percentage=mt.test(m),e.numericPattern=i||"",e.numericRegex=new RegExp("".concat(wt(t,null,!0),"|").concat(wt(r,null,!0)),"g"),e.groupTemp=s,e.decTemp=u,e.t=t,e.d=r,e.temp=c}!function(){function e(t,r,n,o,i){Qe(this,e),this.localeInfo=t,this.pattern=r,this.thousandDelimiter=n||",",this.decimalDelimiter=o||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return ft;var r={};return e.qNumericalAbbreviation.split(t).forEach((function(e){var t=e.split(":");2===t.length&&(r[t[0]]=t[1])})),r}(t,this.patternSeparator),this.prepare()}tt(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t,r,n){return this.prepare(t,r,n),this.formatValue(e)}},{key:"prepare",value:function(e,t,r){var n;void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===r&&(r=this.decimalDelimiter),e?(this._prepared={positive:{d:r,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:r,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:r,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},n=this._prepared,e=e.split(this.patternSeparator),n.positive.pattern=e[0],n.negative.pattern=e[1],n.zero.pattern=e[2],xt.test(e[0])&&(n.positive.isFunctional=!0),e[1]?xt.test(e[1])&&(n.negative.isFunctional=!0):n.negative=!1,e[2]?xt.test(e[2])&&(n.zero.isFunctional=!0):n.zero=!1,n.positive.isFunctional||St(n.positive,t,r),n.negative&&!n.negative.isFunctional&&St(n.negative,t,r),n.zero&&!n.zero.isFunctional&&St(n.zero,t,r)):this._prepared={pattern:!1}}},{key:"formatValue",value:function(e){var t,r,n,o,i,a,l,s,u,c=this._prepared,d="",p="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return(c=c.zero).pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,i=c.d,a=c.t,c.isFunctional)e=function(e,t,r){var n;return ht.test(t)?e=Dt(e,Number(/\d{2}/.exec(t)[0]),t,r):yt.test(t)?e=Dt(e,8,t,r):vt.test(t)?e=Dt(e,10,t,r):gt.test(t)?e=Dt(e,16,t,r):bt.test(t)?e=Dt(e,2,t,r):qt.test(t)&&(n="",e<0&&(n="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){for(var r,n="",o=Number(String(e).slice(-3)),i=(e-o)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),l=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();o>0;)for(r=0;r<a.length;r++)if(a[r]<=o){n+=l[r],o-=a[r];break}for(r=0;r<i;r++)n="M".concat(n);return t[1]!==t[1].toUpperCase()&&(n=n.toLowerCase()),n}(e,t),e=n+e):e=t+n+e.toExponential(0)),e}(e,c.pattern,i);else{if(c.percentage&&(e*=100),c.abbreviate){var m,h,y=Object.keys(this.abbreviations).map((function(e){return parseInt(e,10)})).sort((function(e,t){return e-t})),v=y[0];for(l=0,r=Number(Number(e).toExponential().split("e")[1]);v<=r&&l<y.length;)v=y[++l];l>0&&(m=y[l-1]),m&&r>0&&m>0?h=m:(r<0&&m<0||!m)&&(v<0&&v-r<=c.maxPrecision?h=v:m<=r&&!(v>0&&-r<=c.maxPrecision)&&(h=m)),h&&(d=this.abbreviations[h],e/=Math.pow(10,h))}if(n=Math.abs(e),t=c.temp,u=(s=c.numericPattern).split(i)[1],"I"===this.type&&(e=Math.round(e)),o=e,u||"#"!==s.slice(-1)[0])if(n>=1e15||n>0&&n<=1e-14)e=n?n.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{var g=Number(e.toFixed(Math.min(20,u?u.length:0)).split(".")[0]),b=s.split(i)[0];if(e=dt(b+=i,g)||"0",u){var q=Math.max(0,Math.min(14,u.length)),x=u.replace(/#+$/,"").length,C=("I"===this.type?0:n%1).toFixed(q).slice(2).replace(/0+$/,"");for(l=C.length;l<x;l++)C+="0";C&&(e+=i+C)}else 0===g&&(o=0)}else if(n>=Math.pow(10,t)||n<1||n<1e-4)0===e?e="0":n<1e-4||n>=1e20?(e=(e=o.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),p=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",i));else{for(s+=i,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(n)/Math.log(10)))),l=0;l<t;l++)s+="#";e=dt(s,e)}e=e.replace(c.numericRegex,(function(e){return e===a?c.groupTemp:e===i?c.decTemp:""})),o<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+p+d+c.postfix}}],[{key:"getStaticFormatter",value:function(){return{prepare:function(){},formatValue:function(e){return"".concat(e)}}}}])}();var It=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Mt=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Lt=["January","February","March","April","May","June","July","August","September","October","November","December"],Et=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Tt(e,t){for(var r=e.length;r<t;r++)e="0".concat(e);return e}function At(e){var t=e.toString().split(".");return t[1]?t=Number("0.".concat(t[1])):0}function Pt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}!function(){function e(t,r,n){Qe(this,e);var o,i=t||{};i.qCalendarStrings||(i.qCalendarStrings={qLongDayNames:It,qDayNames:Mt,qLongMonthNames:Lt,qMonthNames:Et}),this.localeInfo=i,this.locale_days=i.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=i.qCalendarStrings.qDayNames.slice(),this.locale_months=i.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=i.qCalendarStrings.qMonthNames.slice(),r||(r=(rt(o={},"T",i.qTimeFmt||"hh:mm:ss"),rt(o,"D",i.qDateFmt||"YYYY-MM-DD"),rt(o,"TS",i.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"),o)[n]),this.pattern=r}tt(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");var r,n,o,i,a,l=/t+/gi.test(t);e instanceof Date?(o=l,i=(n=e).getUTCHours(),o&&((i%=12)||(i=12)),(a=n.getUTCDay()-1)<0&&(a=6),r={year:n.getUTCFullYear(),month:n.getUTCMonth(),day:a,date:n.getUTCDate(),h:i,m:n.getUTCMinutes(),s:n.getUTCSeconds(),f:n.getUTCMilliseconds(),t:n.getUTCHours()>=12?"pm":"am"}):(e<0&&(e=-e,t="-".concat(t)),r=function(e,t){var r,n=function(e){var t=e,r=24*At(t),n=60*At(r),o=60*At(n),i=1e3*At(o);return{d:Math.floor(t),h:Math.floor(r),m:Math.floor(n),s:Math.floor(o),f:Math.round(i)}}(e),o=n.d,i=n.h,a=n.m,l=n.s,s=n.f,u=0;/w+|t+/gi.test(t)&&(r=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(r.getTime())&&(r=null)),/D+/gi.test(t)||(i+=24*o),/h+/gi.test(t)||(a+=60*i),/m+/gi.test(t)||(l+=60*a),/w+/gi.test(t)&&(u=r?r.getDay()-1:0)<0&&(u=6);var c="";return r&&(c=r.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:o,h:i,m:a,s:l,f:s,t:c}}(e,t));var s=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Tt("".concat(t.year).slice(-2),2),YYY:Tt("".concat(t.year).slice(-3),3),def:function(e){return Tt("".concat(t.year),e.length)}},"M+":{M:t.month+1,MM:Tt("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Tt("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:function(e){return Tt("".concat(t.date),e.length)}},"h+|H+":{h:t.h,def:function(e){return Tt("".concat(t.h),e.length)}},"m+":{m:t.m,def:function(e){return Tt("".concat(t.m),e.length)}},"s+|S+":{s:t.s,def:function(e){return Tt("".concat(t.s),e.length)}},"f+|F+":{def:function(e){var r="".concat(t.f),n=e.length-r.length;if(n>0)for(var o=0;o<n;o++)r+="0";else n<0&&(r=r.slice(0,e.length));return r}},"t{1,2}|T{1,2}":{def:function(e){var r=t.t;return e[0].toUpperCase()===e[0]&&(r=r.toUpperCase()),r.slice(0,e.length)}}}}(this,r),u=[];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&u.push(c);var d=new RegExp(u.join("|"),"g"),p=t.replace(d,(function(e){var t,r,n;for(r in s)if(Object.prototype.hasOwnProperty.call(s,r)&&(t=new RegExp(r)).test(e))break;if(!t)return"";for(var o in s[r])if(o===e||o.toLowerCase()===e){void 0===(n=s[r][o])&&(n=s[r][o.toLowerCase()]);break}return void 0===n&&(n=s[r].def),"function"==typeof n&&(n=n(e)),n}));return p}}])}();var Ot={exports:{}};window,Ot.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/conversion/",r(r.s=2)}([function(e,t,r){var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===o.call(e)},s=function(e){if(!e||"[object Object]"!==o.call(e))return!1;var t,r=n.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!i)return!1;for(t in e);return void 0===t||n.call(e,t)},u=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,t){if("__proto__"===t){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,r,n,o,i,a,d=arguments[0],p=1,f=arguments.length,m=!1;for("boolean"==typeof d&&(m=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<f;++p)if(null!=(t=arguments[p]))for(r in t)n=c(d,r),d!==(o=c(t,r))&&(m&&o&&(s(o)||(i=l(o)))?(i?(i=!1,a=n&&l(n)?n:[]):a=n&&s(n)?n:{},u(d,{name:r,newValue:e(m,a,o)})):void 0!==o&&u(d,{name:r,newValue:o}));return d}},function(e,t,r){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/qlik-modifiers/",r(r.s=1)}([function(e,t,r){var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===o.call(e)},s=function(e){if(!e||"[object Object]"!==o.call(e))return!1;var t,r=n.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!i)return!1;for(t in e);return void 0===t||n.call(e,t)},u=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,t){if("__proto__"===t){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,r,n,o,i,a,d=arguments[0],p=1,f=arguments.length,m=!1;for("boolean"==typeof d&&(m=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<f;++p)if(null!=(t=arguments[p]))for(r in t)n=c(d,r),d!==(o=c(t,r))&&(m&&o&&(s(o)||(i=l(o)))?(i?(i=!1,a=n&&l(n)?n:[]):a=n&&s(n)?n:{},u(d,{name:r,newValue:e(m,a,o)})):void 0!==o&&u(d,{name:r,newValue:o}));return d}},function(e,t,r){r.r(t);var n=r(0),o=r.n(n),i=function(e,t,r){if(!t)return!1;var n,o=t.split("."),i=o[o.length-1],a=e;for(n=0;n<o.length-1;++n)void 0===a[o[n]]&&(a[o[n]]=Number.isNaN(+o[n+1])?{}:[]),a=a[o[n]];if(void 0!==r){var l=a[i];return a[i]=r,{updated:r,previous:l}}return delete a[i],!1},a=function(e,t,r){var n,o=t.split("."),i=e;if(void 0===i)return r;for(n=0;n<o.length;++n){if(void 0===i[o[n]])return r;i=i[o[n]]}return i},l="".concat(" ","(").concat(" "),s="".concat(" ",")").concat(" ");function u(e){return l+e+s}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,o=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===o)return n;if(n.qDerivedFieldData)for(var i=0;i<n.qDerivedFieldData.qDerivedFieldLists.length;++i)for(var a=n.qDerivedFieldData.qDerivedFieldLists[i],l=0;l<a.qFieldDefs.length;++l){var s=a.qFieldDefs[l];if(s.qName===o)return s}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return n&&n.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function p(e,t){var r=e.crossAllDimensions;return 2===t&&r?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e).trim();return"="===t.substring(0,1)?t.substring(1).trim():t}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 y(e){return void 0===e?")":", 0, ".concat(e,")")}function v(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=MinString(").concat(t,"))' and Only({1}").concat(t,")<='$(=MaxString(").concat(t,"))'\"}")}function g(e){var t=e.modifier,r=void 0===t?{}:t,n=e.dimensions,o=e.dimensionAndFieldList,i=e.funcComp,a=void 0===i?"Sum":i,l=e.valueComp,s=void 0===l?"0":l;if(!r.showExcludedValues)return"";if(n&&1===n.length){var u=v(c(n[0],o),m(0));return"".concat(a,"({1<").concat(u,">}").concat(s,")")}if(n&&2===n.length){var d=c(n[0],o),p=c(n[1],o),f=m(0),h=m(1),y=v(d,f),g=v(p,h);return"".concat(a,"({1<").concat(y,",").concat(g,">}").concat(s,")")}return"".concat(a,"({1}").concat(s,")")}function b(e){return"".concat(e,"(")}function q(e){var t=e.properties,r=e.layout;return a(t,"qHyperCubeDef.qDimensions",a(r,"qHyperCube.qDimensionInfo",[])).length}var x={isFullRange:d,getNumDimensions:q,getExpressionWithExcludedComp:function(e){var t=e.expression,r=e.modifier,n=e.dimensions,o=e.dimensionAndFieldList,i=e.treatMissingAsNull,a=u(f(t));if(!r.showExcludedValues)return a;var l=g({modifier:r,dimensions:n,dimensionAndFieldList:o}),s=i?"":", 0";if(n&&1===n.length){var c=m(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(l).concat(s,")")}if(n&&2===n.length){var d=m(0),p=m(1);return"If(Count(".concat(d,") * Count(").concat(p,") > 0, ").concat(a," + ").concat(l).concat(s,")")}return a},getRowNoComp:p,getNumStepComp:function(e,t){if(!d(e)){var r=e.steps;return"number"!=typeof r||Number.isNaN(r)?6:r}return p(e,t)},getAboveCompPrefix:h,getAboveCompSuffix:y,getAboveComp:function(e,t,r,n){return h(e,t)+r+y(n)},getFunctionPrefix:b,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return b(e)+t+")"},getAggrComp:function(e,t,r){return"Aggr(".concat(e,", ").concat(t,", ").concat(r,")")},getExcludedComp:g,needDimension:function(e){var t=e.modifier,r=e.properties,n=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&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 o=["Descending","Ascending"],i=r.qSortByNumeric?"(Numeric, ".concat(o[(r.qSortByNumeric+1)/2],")"):"",a=r.qSortByAscii?"(Text, ".concat(o[(r.qSortByAscii+1)/2],")"):"";return r.qSortByNumeric&&r.qSortByAscii?"(".concat(n,", ").concat(i,", ").concat(a,")"):r.qSortByNumeric?"(".concat(n,", ").concat(i,")"):r.qSortByAscii?"(".concat(n,", ").concat(a,")"):n},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var r=t.indexOf(l);if(-1!==r){var n=t.indexOf(s);if(-1!==n)return t.substring(r+l.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,o=void 0===n?1:n,i=e.maxDimensions,a=void 0===i?2:i;if(!t&&!r)return!0;var l=q({properties:t,layout:r});return l>=o&&l<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(l),r=e.indexOf(s);return t>-1&&r>-1&&t<r},getDimDefWithWrapper:m,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")}};function C(e){return(C="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})(e)}var D=o.a.bind(null,!0),w={},S=Array.isArray;function I(e){return null!=e&&!Array.isArray(e)&&"object"===C(e)}function M(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,o){if(o!==n.length){r=+t;var i=Number.isNaN(r)?{}:[];e[r||t]=M(e[r||t])?i:e[t],e=e[r||t]}})),e}function T(e,t){var r=!0;if(I(e)&&I(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(n){T(e[n],t[n])||(r=!1)})),r);if(S(e)&&S(t)){if(e.length!==t.length)return!1;for(var n=0,o=e.length;n<o;n+=1)if(!T(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(o){var i=function(e){return e?D({},{val:e}).val:e}(t[o]),a=e[o],l="".concat(r,"/").concat(o);T(i,a)||L(t,o)||(M(a)?n.push({op:"add",path:l,value:i}):I(i)&&I(a)?n=n.concat(w.generate(a,i,l)):S(i)&&S(a)?n=n.concat(function(e,t,r){var n=[],o=e.slice(),i=-1;function a(e,t,r){if(e[r]&&M(e[r].qInfo))return null;if(e[r]&&e[r].qInfo.qId===t)return r;for(var n=0,o=e.length;n<o;n+=1)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(T(t,o))return n;if(!M(t[0])&&M(t[0].qInfo))return n.push({op:"replace",path:r,value:t}),n;for(var l=o.length-1;l>=0;l-=1)-1===(i=a(t,o[l].qInfo&&o[l].qInfo.qId,l))?(n.push({op:"remove",path:"".concat(r,"/").concat(l)}),o.splice(l,1)):n=n.concat(w.generate(o[l],t[i],"".concat(r,"/").concat(l)));for(var s=0,u=t.length;s<u;s+=1)-1===(i=a(o,t[s].qInfo&&t[s].qInfo.qId))?(n.push({op:"add",path:"".concat(r,"/").concat(s),value:t[s]}),o.splice(s,0,t[s])):i!==s&&(n.push({op:"move",path:"".concat(r,"/").concat(s),from:"".concat(r,"/").concat(i)}),o.splice(s,0,o.splice(i,1)[0]));return n}(a,i,l)):n.push({op:"replace",path:"".concat(r,"/").concat(o),value:i}))})),Object.keys(e).forEach((function(o){M(t[o])&&!L(e,o)&&n.push({op:"remove",path:"".concat(r,"/").concat(o)})})),n},w.apply=function(e,t){t.forEach((function(t){var r,n=E(e,t.path),o=t.path.split("/").splice(-1)[0],i=o&&Number.isNaN(+o)?n[o]:n[+o]||n,a=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(n=null,i=e),"add"===t.op||"replace"===t.op)if(S(n))"-"===o&&(o=n.length),n.splice(+o,"add"===t.op?0:1,t.value);else if(S(i)&&S(t.value)){var l,s=t.value.slice();i.length=0,(l=i).push.apply(l,function(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(s))}else if(I(i)&&I(t.value))r=i,Object.keys(r).forEach((function(e){Object.getOwnPropertyDescriptor(r,e).configurable&&!L(r,e)&&delete r[e]})),D(i,t.value);else{if(!n)throw new Error("Patchee is not an object we can patch");n[o]=t.value}else if("move"===t.op){var u=E(e,t.from);S(n)?n.splice(+o,0,u.splice(+a,1)[0]):(n[o]=u[a],delete u[a])}else"remove"===t.op&&(S(n)?n.splice(+o,1):delete n[o])}))},w.clone=function(e){return D({},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)):D(e,t)};var A=w,P=function(e,t,r){if(!e)return Promise.resolve();var n=A.generate(t,r);return o()(!0,t,r),n&&n.length?(n=n.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(n,!0)):Promise.resolve()},O="accumulation";function N(e,t){var r=a(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===O)return r[n]}function F(e,t){var r=function(e,t){var r=a(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===O)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}var k={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""},H={translationKey:"properties.modifier.accumulation",needDimension:x.needDimension,isApplicable:function(e){var t=e.properties,r=e.layout;return x.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,r=e.modifier,n=e.properties,o=e.layout,i=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return t;var s=i;void 0===s&&(s=x.getNumDimensions({properties:n,layout:o}));var u=a(n,"qHyperCubeDef.qDimensions",[]),c=x.getExpressionWithExcludedComp({expression:t,modifier:r,dimensions:u,dimensionAndFieldList:l}),d=x.getNumStepComp(r,s),p=x.getAboveComp(r,s,c,d),f=x.getRangeComp("RangeSum",p);if(x.needDimension({modifier:r,properties:n,layout:o})){var m=x.getDimComp(u,1),h=x.getDimComp(u,0),y=x.getAggrComp(f,m,h);f=r.showExcludedValues?x.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,valueComp:y}):y}return f},extractInputExpression:x.extractInputExpression,initModifier:function(e){x.initModifier(e,k)},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!x.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(F(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(F(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(F(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(F(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var r=N(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=N(t,e);return r&&!r.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(F(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return x.isApplicable({properties:t.properties})}}},show:function(t,r,n){var o=n.ext.support.modifiers;if(!Array.isArray(o)||-1===o.indexOf(O))return!1;var i=N(t,e);return i&&!i.disabled}};return r}},_="movingAverage";function R(e,t){var r=a(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===_)return r[n]}function V(e,t){var r=function(e,t){var r=a(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===_)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}var z={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},j={translationKey:"properties.modifier.movingAverage",needDimension:x.needDimension,isApplicable:function(e){var t=e.properties,r=e.layout;return x.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,r=e.expression,n=e.modifier,o=e.properties,i=e.layout,l=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return r;var u=l;void 0===u&&(u=x.getNumDimensions({properties:o,layout:i}));var c=a(o,"qHyperCubeDef.qDimensions",[]),d=n.showExcludedValues&&n.nullSuppression,p=x.getExpressionWithExcludedComp({expression:r,modifier:n,dimensions:c,dimensionAndFieldList:s,treatMissingAsNull:d}),f=x.getNumStepComp(n,u),m=x.getAboveComp(n,u,p,f);if(n.nullSuppression)t=x.getRangeComp("RangeAvg",m);else{var h=x.getRangeComp("RangeSum",m),y=function(e,t){var r=x.getRowNoComp(e,t);if(!x.isFullRange(e)){var n=e.steps,o="number"!=typeof n||Number.isNaN(n)?6:n;return"RangeMin(".concat(o,", ").concat(r,")")}return r}(n,u);t="".concat(h," / ").concat(y)}var v=t;if(x.needDimension({modifier:n,properties:o,layout:i})){var g=x.getDimComp(c,1),b=x.getDimComp(c,0),q=x.getAggrComp(v,g,b);v=n.showExcludedValues?x.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,funcComp:"Only",valueComp:q}):q}return v},extractInputExpression:x.extractInputExpression,initModifier:function(e){x.initModifier(e,z)},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!x.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(V(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(V(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(V(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(V(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var r=R(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=R(t,e);return r&&!r.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(V(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(V(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return x.isApplicable({properties:t.properties})}}},show:function(t,r,n){var o=n.ext.support.modifiers;if(!Array.isArray(o)||-1===o.indexOf(_))return!1;var i=R(t,e);return i&&!i.disabled}};return r}},W="difference";function B(e,t){var r=a(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===W)return r[n]}function $(e,t){var r=function(e,t){var r=a(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===W)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}var U={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""},G={translationKey:"properties.modifier.difference",needDimension:x.needDimension,isApplicable:function(e){var t=e.properties,r=e.layout;return x.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},extractInputExpression:x.extractInputExpression,generateExpression:function(e){var t=e.expression,r=e.modifier,n=e.properties,o=e.layout,i=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return t;var s=i;void 0===s&&(s=x.getNumDimensions({properties:n,layout:o}));var u=a(n,"qHyperCubeDef.qDimensions",[]),c=x.getExpressionWithExcludedComp({expression:t,modifier:r,dimensions:u,dimensionAndFieldList:l}),d=x.getAboveComp(r,s,c),p="".concat(c," - ").concat(d);if(x.needDimension({modifier:r,properties:n,layout:o})){var f=x.getDimComp(u,1),m=x.getDimComp(u,0),h=x.getAggrComp(p,f,m);p=r.showExcludedValues?x.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:h}):h}return p},initModifier:function(e){Object.keys(U).forEach((function(t){void 0===e[t]&&(e[t]=U[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!x.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.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($(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($(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return x.isApplicable({properties:t.properties})}}},show:function(t,r,n){var o=n.ext.support.modifiers;if(!Array.isArray(o)||-1===o.indexOf(W))return!1;var i=B(t,e);return i&&!i.disabled}};return r}},Y={CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},X={ONE_DIMENSION:0,ALL_DIMENSIOANS:1,DISREGARD_ALL_DIMENSIONS:2},J="normalization";function K(e,t){var r=a(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===J)return r[n]}function Z(e,t){var r=function(e,t){var r=a(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}function Q(e,t){for(var r=0;r<e.length;r++)if(e[r].value===t)return r;return-1}function ee(e,t,r,n){var o=t.layout.qHyperCube.qDimensionInfo.length,i=[{value:X.ONE_DIMENSION,translation:r.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:r.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:X.ALL_DIMENSIOANS,translation:r.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===o?"respectAllDimensions":"respectDimension"),tooltipTranslation:r.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===o?"respectAllDimensions":"respectDimension",".tooltip")},{value:X.DISREGARD_ALL_DIMENSIONS,translation:r.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===o?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:r.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===o?"disregardAllDimensions":"disregardDimension",".tooltip")}];return i=function(e,t,r){if(e<2){var n=Q(t,0);t.splice(n,1)}return t}(o,i),function(e,t,r){if(0===e){var n=Q(t,1);t.splice(n,1)}return t}(K(e,n).selectionScope,i)}function te(e,t,r){var n=[{value:Y.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:Y.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:Y.DISREGARD_SELECTION,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return function(e,t,r){if(1===e){var n=Q(t,0);t.splice(n,1)}return t}(K(e,r).dimensionalScope,n)}var re={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:X.DISREGARD_ALL_DIMENSIONS,selectionScope:Y.DISREGARD_SELECTION};function ne(e){return 2===e?"{1}":""}function oe(e,t,r){return 1===e?"{$<".concat(x.getFieldWithWrapper(t),"={'").concat(r,"'}>}"):""}function ie(e,t){return 0===e&&t>1||2===e?"Total":""}function ae(e,t,r){return 0===e&&t>1?"<".concat(x.getDimDefWithWrapper(r),">"):""}var le={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,r=e.layout;return x.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},extractInputExpression:x.extractInputExpression,generateExpression:function(e){var t=e.expression,r=e.modifier,n=e.properties,o=e.layout,i=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return t;var s=i;void 0===s&&(s=x.getNumDimensions({properties:n,layout:o}));var u=a(n,"qHyperCubeDef.qDimensions",[]),c=x.getExpressionWithExcludedComp({expression:t,modifier:r,dimensions:u,dimensionAndFieldList:l}),d=r.selectionScope,p=r.dimensionalScope;return function(e,t,r,n,o,i,a){var l=ne(t),s=oe(t,r,n),u=""===l&&""===s?"":l||s,c=ie(o,i),d=ae(o,i,a),p=function(e){for(var t=[],r=0;r<e;r++)t[r]=x.getDimDefWithWrapper(r);return t.join(", ")}(i);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(d," Aggr(").concat(u," ").concat(e,", ").concat(p,"))")}(c,d,r.field,r.value,p,s,r.primaryDimension)},initModifier:function(e){Object.keys(re).forEach((function(t){void 0===e[t]&&(e[t]=re[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!x.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(Z(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:Y.DISREGARD_SELECTION,options:function(r){return te(r,t,e)}},field:{refFn:function(t){return"".concat(Z(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 K(t,e).selectionScope===Y.SELECT_FIELD_VALUE}},value:{refFn:function(t){return"".concat(Z(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return K(t,e).selectionScope===Y.SELECT_FIELD_VALUE}},dimensionalScope:{refFn:function(t){return"".concat(Z(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:X.DISREGARD_ALL_DIMENSIONS,supportTooltip:!0,options:function(r,n){return ee(r,n,t,e)}},primaryDimension:{refFn:function(t){return"".concat(Z(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(K(t,e).dimensionalScope||0)===X.ONE_DIMENSION&&r.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return x.isApplicable({properties:t.properties})}}},show:function(t,r,n){var o=n.ext.support.modifiers;if(!Array.isArray(o)||-1===o.indexOf(J))return!1;var i=K(t,e);return i&&!i.disabled}};return r},getDisregardSelectionComp:ne,getFieldSelectionComp:oe,getTotalComp:ie,getSelectedDimComp:ae},se={getExpression:function(e){return a(e,"qDef.base.qDef")||a(e,"qDef.qDef")},getExpressionRef:function(e){return a(e,"qDef.base.qDef")?"qDef.base.qDef":"qDef.qDef"},getLibraryIdRef:function(e){return a(e,"qDef.base.qLibraryId")?"qDef.base.qLibraryId":"qLibraryId"},getLibraryId:function(e){return a(e,"qDef.base.qLibraryId")||a(e,"qLibraryId")},getLabelRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}},ue={initBase:function(e,t){(t||ue.isValid(e))&&(i(e,"qDef.base.qDef",a(e,"qDef.qDef")),i(e,"qDef.base.qLibraryId",a(e,"qLibraryId")),i(e,"qDef.base.qLabel",a(e,"qDef.qLabel")),i(e,"qDef.base.qLabelExpression",a(e,"qDef.qLabelExpression")))},restoreBase:function(e){ue.isValid(e)&&(i(e,"qDef.qDef",a(e,"qDef.base.qDef")),i(e,"qLibraryId",a(e,"qDef.base.qLibraryId")),i(e,"qDef.qLabel",a(e,"qDef.base.qLabel")),i(e,"qDef.qLabelExpression",a(e,"qDef.base.qLabelExpression")),a(e,"qDef.qAggrFunc")&&a(e,"qDef.base.qAggrFunc")&&i(e,"qDef.qAggrFunc",a(e,"qDef.base.qAggrFunc")),delete e.qDef.base)},isValid:function(e){var t=a(e,"qDef.base.qDef"),r=a(e,"qDef.base.qLibraryId");return void 0!==t||void 0!==r}},ce=ue;function de(e){return(de="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})(e)}var pe={accumulation:H,movingAverage:j,difference:G,normalization:le},fe=(t.default={modifiers:pe,apply:me,applyModifiers:he,cleanUpMeasure:ye,destroy:function(e){e&&fe[e.id]&&fe[e.id].masterItemSubscriber&&(fe[e.id].masterItemSubscriber&&fe[e.id].masterItemSubscriber.unsubscribe(),delete fe[e.id])},hasActiveModifiers:ve,getActiveModifier:ge,initBase:ce.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return pe[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,r=e.properties,n=e.layout;return Array.isArray(t)&&t.some((function(e){return pe[e]&&pe[e].isApplicable({properties:r,layout:n})}))},measureBase:se,limitedSorting:function(e){var t=e.measures,r=e.properties,n=e.layout,o=!1,i=!1;return t.forEach((function(e){var t=xe(e);Le({modifiers:t,properties:r,layout:n})&&(o=!0,i=i||Oe({modifiers:t,properties:r,layout:n}))})),o&&!i},ifEnableTotalsFunction:be},{});function me(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,r=e.properties,n=e.isSnapshot,i=void 0!==n&&n,l=e.masterItem;fe[t.id]=fe[t.id]||{isFirstTime:!0};var s=fe[t.id].isFirstTime;if(fe[t.id].isFirstTime=!1,r&&"object"===de(r))return he({model:t,properties:r});var u=t?t.layout:void 0,c=a(u,"qSelectionInfo.qInSelections");if(i||c)return Promise.resolve(!1);var d=a(u,"qHyperCube.qMeasureInfo"),p=fe[t.id].lastReloadTime;if(fe[t.id].lastReloadTime=a(t,"app.layout.qLastReloadTime"),ve({measures:d,layout:u})){var f=function(e){var t=e.measures,r=e.layout,n=e.lastReloadTime;return a(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 Me({measure:e,properties:r,layout:n})}))}({measures:t,layout:r})}({measures:d,layout:u,model:t,lastReloadTime:p});return f||function(e){var t=e.measures,r=e.layout,n=e.masterItem,o=e.isFirstTime;return!!Array.isArray(t)&&(o||n||t.some((function(e){return function(e){var t=e.measure,r=e.layout;return Le({modifiers:xe(t),layout:r})?!t.base:!!t.base}({measure:e,layout:r})})))}({measures:d,layout:u,masterItem:l,isFirstTime:s})?t.getEffectiveProperties().then((function(e){var r=o()(!0,{},e);De(r);var n=Ne(r);return Ee({model:t}).then((function(o){return Te({libraryIds:n,model:t}).then((function(n){return f&&function(e){var t=e.properties;qe(t).forEach((function(e){return function(e){var t=e.measure;if(Me({measure:t,properties:e.properties})){var r=0,n=t.qDef.modifiers;Array.isArray(n)&&n.forEach((function(e){if("object"===de(e)&&!e.disabled){if(r++,"object"!==de(pe[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=pe[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==n&&Se(t)&&x.simplifyExpression(t.qDef.base.qDef)!==x.simplifyExpression(n)&&(t.qDef.base.qDef=n)}}))}}({measure:e,properties:t})}))}({properties:r}),he({model:t,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:l,libraryItemsProps:n,dimensionAndFieldList:o})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===de(e.base)}))}(d)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,r=e.properties,n=Ne(r);return Fe({model:t,libraryIds:n}).then((function(){var e=o()(!0,{},r);return qe(r).forEach((function(e){return ye(e)})),Pe({oldProperties:e,newProperties:r,model:t})}))}({model:t,properties:e})})):Promise.resolve(!1)}function he(e){var t=e.model,r=e.oldProperties,n=e.properties,i=e.measures,l=e.runUpdateIfChange,s=void 0!==l&&l,u=e.masterItem,c=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===r&&(r=s?o()(!0,{},n):n),De(n);var p=Ne(n);return Fe({model:t,libraryIds:p,masterItem:u}).then((function(){return function(e){var t=e.measures,r=e.properties,n=e.model,i=e.libraryItemsProps,l=e.dimensionAndFieldList;if(t||(t=qe(r)),!t.length)return Promise.resolve();if(!ve({measures:t,properties:r}))return t.forEach((function(e){return ye(e)})),Promise.resolve();var s=i?void 0:Ne(r);return Ee({model:n,dimensionAndFieldList:l}).then((function(e){return Te({libraryIds:s,model:n,libraryItemsProps:i}).then((function(n){t.forEach((function(t){Le({modifiers:t.qDef.modifiers,properties:r})?(function(e){var t=e.measure,r=e.properties,n=e.libraryItemsProps,i=e.dimensionAndFieldList,l=0;ce.isValid(t)||ce.initBase(t,!0);var s=t.qDef,u=s.modifiers,c=s.base;Array.isArray(u)&&u.forEach((function(e){if("object"===de(e)&&!e.disabled){if(l++,"object"!==de(pe[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(l>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");pe[e.type].initModifier(e);var s=t.qLibraryId||c&&c.qLibraryId;s?function(e){var t=e.measure,r=e.modifier,n=e.properties,i=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],l=a.qMeasure.qDef,s=pe[r.type].generateExpression({expression:l,modifier:r,properties:n,dimensionAndFieldList:i});r.outputExpression=s,t.qDef.qDef=r.outputExpression,(t.qDef.qLabel||a.qMeasure.qLabel)&&(t.qDef.qLabel=a.qMeasure.qLabel),(t.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=a.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(t.qDef.qNumFormat=a.qMeasure.qNumFormat,t.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=a.qMeasure.coloring,r.base=o()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:s,properties:r,libraryItemsProps:n,dimensionAndFieldList:i}):function(e){var t=e.measure,r=e.modifier,n=e.properties,i=e.dimensionAndFieldList;"function"==typeof pe[r.type].updateModifier&&pe[r.type].updateModifier(r,n.qHyperCubeDef);var a=se.getExpression(t),l=pe[r.type].generateExpression({expression:a,modifier:r,properties:n,dimensionAndFieldList:i});r.outputExpression=l,t.qDef.qDef=r.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||a,r.base=o()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:r,dimensionAndFieldList:i}),function(e){var t=a(e,"qDef.qAggrFunc");"Expr"!==t||be(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&be(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(t)}}))}({measure:t,properties:r,libraryItemsProps:n,dimensionAndFieldList:e}),we(t)):ye(t)}))}))}))}({measures:i,properties:n,model:t,libraryItemsProps:c,dimensionAndFieldList:d}).then((function(){return s?Pe({oldProperties:r,newProperties:n,model:t}):Promise.resolve(!1)}))}))}function ye(e){!function(e){var t=xe(e);return Array.isArray(t)&&t.some((function(e){return"object"===de(e)&&!e.disabled&&!pe[e.type]}))}(e)?ce.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,we(e)}function ve(e){var t=e.measures,r=e.properties,n=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Le({modifiers:xe(e),properties:r,layout:n})}))}function ge(e){var t=xe(e);if(Array.isArray(t))for(var r=0;r<t.length;r++){var n=t[r];if(pe[n.type]&&!n.disabled)return n}}function be(e){var t=ge(e);return!t||pe[t.type].enableTotalsFunction(e)}function qe(e){return a(e,"qHyperCubeDef.qMeasures",[]).concat(a(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function xe(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Ce(e){return a(e,"outputExpression.qValueExpression.qExpr")||a(e,"outputExpression")}function De(e){qe(e).forEach((function(e){return function(e){var t=ge(e);t&&(void 0!==t.outputExpression&&Ce(t)!==e.qDef.qDef?delete e.qDef.base:!ce.isValid(e)&&t.base&&(e.qDef.base=o()(!0,{},t.base)))}(e)}))}function we(e){var t=xe(e);Array.isArray(t)&&t.forEach((function(t){"object"===de(t)&&(t.disabled||!pe[t.type]&&Ce(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function Se(e){return e.base||e.qDef&&e.qDef.base}function Ie(e){var t=Se(e);return e.qLibraryId||t&&t.qLibraryId}function Me(e){var t=e.measure,r=e.properties,n=e.layout;return!Ie(t)&&Le({modifiers:xe(t),properties:r,layout:n})}function Le(e){var t=e.modifiers,r=e.properties,n=e.layout,o={};return Array.isArray(t)&&t.some((function(e){return!("object"!==de(e)||e.disabled||!pe[e.type])&&(void 0===o[e.type]&&(o[e.type]=pe[e.type].isApplicable({properties:r,layout:n})),o[e.type])}))}function Ee(e){var t=e.model,r=e.dimensionAndFieldList;if(r)return Promise.resolve(r);var n=[],o={},i=t.app.getDimensionList().then((function(e){o.dimensionList=e}));n.push(i);var a=t.app.getFieldList().then((function(e){o.fieldList=e}));return n.push(a),Promise.all(n).then((function(){return o}))}function Te(e){var t=e.libraryIds,r=e.model,n=e.libraryItemsProps;if(n)return Promise.resolve(n);var o=t.measureLibraryIds,i=t.dimensionLibraryIds,a={},l=[];return o.forEach((function(e){var t=r.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));l.push(t)})),i.forEach((function(e){var t=r.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));l.push(t)})),Promise.all(l).then((function(){return a}))}function Ae(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Pe(e){var t=e.oldProperties,r=e.newProperties,n=e.model,o=JSON.stringify(a(t,"qHyperCubeDef.qMeasures"),Ae)!==JSON.stringify(a(r,"qHyperCubeDef.qMeasures"),Ae)||JSON.stringify(a(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ae)!==JSON.stringify(a(r,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ae);return o?function(e){var t=e.model,r=e.oldProperties,n=e.newProperties,o=t.layout;return o&&!o.qHasSoftPatches&&!o.qExtendsId&&a(o,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(n):P(t,r,n)}({model:n,oldProperties:t,newProperties:r}).then((function(){return o})):Promise.resolve(o)}function Oe(e){var t=e.modifiers,r=e.properties,n=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===de(e)&&!e.disabled&&pe[e.type]&&pe[e.type].needDimension({modifier:e,properties:r,layout:n})}))}function Ne(e){var t=qe(e),r=[],n=[],o=!1;return t.forEach((function(t){var n=xe(t);if(Le({modifiers:n,properties:e})){var i=Ie(t);i&&r.push(i),o=o||Oe({modifiers:n,properties:e})}})),a(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&n.push(t)})),{measureLibraryIds:r,dimensionLibraryIds:n}}function Fe(e){var t=e.model,r=e.libraryIds;return!e.masterItem&&r&&(r.measureLibraryIds.length||r.dimensionLibraryIds.length)?(fe[t.id].masterItemSubscriber=fe[t.id].masterItemSubscriber||function(e){var t=e.model,r=e.callback,n={},o={},i={},l={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function s(e){var t={},r=a(e,"qInfo.qType");return r&&l[r]&&l[r].forEach((function(r){t[r]=a(e,r)})),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(n[t]){var o=s(e);n[t].properties!==o&&(n[t].properties=o,"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:s(t.layout)}}))}return{subscribe:function(e){var r=e.measureLibraryIds,a=e.dimensionLibraryIds,l=[];return function(e){var t=e.dimensionLibraryIds;o={},e.measureLibraryIds.forEach((function(e){o[e]=!0})),i={},t.forEach((function(e){i[e]=!0}))}({measureLibraryIds:r,dimensionLibraryIds:a}),Object.keys(n).forEach((function(e){o[e]||i[e]||(n[e].listener.dispose(),delete n[e])})),t.app&&(Object.keys(o).forEach((function(e){o[e]&&!n[e]&&l.push(c(e,"getMeasure"))})),Object.keys(i).forEach((function(e){i[e]&&!n[e]&&l.push(c(e,"getDimension"))}))),Promise.all(l)},unsubscribe:function(){Object.keys(n).forEach((function(e){n[e].listener.dispose()})),n={}}}}({model:t,callback:function(e){return me({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),fe[t.id].masterItemSubscriber.subscribe(r)):Promise.resolve()}}])},function(e,t,r){function n(e){var t=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)}(e%62),r=Math.floor(e/62);return r>0?n(r)+t:t}function o(e){return(o="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})(e)}r.r(t);var i={getValue:function(e,t,r){if(null==e||null==t)return r;for(var n=t.split("."),o=e,i=0;i<n.length;++i){var a=n[i];if(""!==a){if(void 0===o[a]||null===o[a])return r;o=o[a]}}return o},setValue:function(e,t,r){if(null!=e&&null!=t){for(var n=t.split("."),o=n[n.length-1],i=e,a=0;a<n.length-1;++a){var l=n[a];void 0!==i[l]&&null!==i[l]||(i[l]=Number.isNaN(+n[a+1])?{}:[]),i=i[l]}void 0!==r?i[o]=r:delete i[o]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(o(e))},generateId:function(){return n(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return l(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 l(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)?l(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 l(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 s(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}var d={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 o=e.indexOf(t[n]);if(r>o)return!1;r=o}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},p=r(1),f=r.n(p),m={addDimensions:function(e){var t,r=e.exportFormat,n=e.qHyperCubeDef,o=r.data[0];(t=o.dimensions).push.apply(t,a(n.qDimensions));var l,s=i.getValue(n,"qLayoutExclude.qHyperCubeDef.qDimensions");s&&(l=o.excludedDimensions).push.apply(l,a(s))},addMeasures:function(e){var t,r=e.exportFormat,n=e.qHyperCubeDef,o=r.data[0];(t=o.measures).push.apply(t,s(n.qMeasures));var a,l=i.getValue(n,"qLayoutExclude.qHyperCubeDef.qMeasures");l&&(a=o.excludedMeasures).push.apply(a,s(l))},setInterColumnSortOrder:function(e){var t=e.exportFormat,r=e.qHyperCubeDef,n=t.data[0];r.qInterColumnSortOrder||(r.qInterColumnSortOrder=[]),n.interColumnSortOrder=r.qInterColumnSortOrder.concat();var o=i.getValue(r,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");o&&d.isOrderedSubset(o,n.interColumnSortOrder)&&(n.interColumnSortOrder=o.concat())},copyProperties:function(e){var t=e.exportFormat,r=e.properties;Object.keys(r).forEach((function(e){t.properties[e]=r[e]}))},updateLayoutExclude: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===i.getValue(e,t)&&i.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(r),delete r.qLayoutExclude.changed),r.qLayoutExclude.quarantine&&!i.isEmpty(r.qLayoutExclude.quarantine)||delete r.qLayoutExclude},storeMeasuresModifiers:function(e){e.forEach((function(e){f.a.cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))}};function h(e,t,r){var n,o,a=i.getValue(e,t);if(!i.isAtomicValue(a))try{if((o=(o=(n=JSON.stringify(a)).match(/:\{/g))?o.length:0)>2)return;a=JSON.parse(n)}catch(e){return}i.getValue(e,"qLayoutExclude.quarantine")||i.setValue(e,"qLayoutExclude.quarantine",{});var l=i.getValue(e,"qLayoutExclude.quarantine");l[r]||(l[r]={}),l[r][t]=a}var y=r(0),v=r.n(y);function g(e,t){var r=v()(!0,{},t,e);return i.getValue(r,"qOtherTotalSpec.qOtherCounted")||i.setValue(r,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),i.getValue(r,"qOtherTotalSpec.qOtherLimit")||i.setValue(r,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),r.hasOwnProperty("othersLabel")||(r.othersLabel="Others"),r}function b(e,t){return v()(!0,{},t,e)}function q(e,t,r){return"function"==typeof e?e(t):Number.isNaN(+e)?r:e}var x=Math.pow(2,53)-1;function C(e){return function(e){if(Array.isArray(e))return D(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 D(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)?D(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 D(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 w(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}var I={importCommonProperties:function(e,t,r){var n="masterobject"===i.getValue(t,"properties.qInfo.qType")?"masterobject":i.getValue(r,"qInfo.qType");i.setValue(e,"qInfo.qType",n),e.visualization=r.visualization},copyPropertyIfExist:function(e,t,r){t.hasOwnProperty(e)&&(r[e]=t[e])},copyPropertyOrSetDefault:function(e,t,r,n){t.hasOwnProperty(e)?r[e]=t[e]:r[e]=n},getDefaultDimension: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}}},getDefaultMeasure:function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},addDimensions:function(e){var t,r=e.exportFormat,n=e.maxDimensions,o=e.minDimensions,i=e.newHyperCubeDef,a=e.defaultDimension,l=r.data[0];for(t=0;t<l.dimensions.length;++t){var s=g(l.dimensions[t],a);i.qDimensions.length<n?i.qDimensions.push(s):i.qLayoutExclude.qHyperCubeDef.qDimensions.push(s)}for(t=0;t<l.excludedDimensions.length;++t){var u=g(l.excludedDimensions[t],a);i.qDimensions.length<o?i.qDimensions.push(u):i.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},addMeasures:function(e){var t,r=e.exportFormat,n=e.maxMeasures,o=e.minMeasures,i=e.newHyperCubeDef,a=e.defaultMeasure,l=r.data[0];for(t=0;t<l.measures.length;++t){var s=b(l.measures[t],a);i.qMeasures.length<n?i.qMeasures.push(s):i.qLayoutExclude.qHyperCubeDef.qMeasures.push(s)}for(t=0;t<l.excludedMeasures.length;++t){var u=b(l.excludedMeasures[t],a);i.qMeasures.length<o?i.qMeasures.push(u):i.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},getMaxMinDimensionMeasure:function(e){var t=e.exportFormat,r=e.dataDefinition,n=void 0===r?{}:r,o=t.data[0],i=n.dimensions||{max:0},a=n.measures||{max:0},l=q(a.max,o.dimensions.length,x),s=q(a.min,o.dimensions.length,0);return{maxDimensions:q(i.max,l,x),minDimensions:q(i.min,s,0),maxMeasures:l,minMeasures:s}},setInterColumnSortOrder:function(e){var t=e.exportFormat,r=e.newHyperCubeDef,n=t.data[0],o=r.qDimensions.length+r.qMeasures.length;r.qInterColumnSortOrder=n.interColumnSortOrder.concat();var i=r.qInterColumnSortOrder.length;if(i!==o)for(r.qLayoutExclude&&(r.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=n.interColumnSortOrder.concat());i!==o;)i<o?(d.indexAdded(r.qInterColumnSortOrder,i),++i):(--i,d.indexRemoved(r.qInterColumnSortOrder,i))},createNewProperties:function(e){var t=e.exportFormat,r=e.initialProperties,n=e.hypercubePath,o={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(o.qLayoutExclude.quarantine=v()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&n?i.setValue(o,"".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)?o[e]=t.properties[e]:o.qLayoutExclude.disabled[e]=t.properties[e]})),null===(o=v()(!0,{},r,o)).components&&(o.components=[]),o},shouldInitLayoutExclude:function(e){var t=e.exportFormat,r=e.maxDimensions,n=e.minDimensions,o=e.maxMeasures,i=e.minMeasures,a=t.data[0];return a.dimensions.length>r&&r>0||a.measures.length>o&&o>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>n||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>i||!o&&a.measures.length>0||!r&&a.dimensions.length>0},initLayoutExclude:function(e){var t=e.exportFormat,r=e.maxDimensions,n=e.minDimensions,o=e.maxMeasures,i=e.minMeasures,a=e.newHyperCubeDef,l=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(l.dimensions.length>r&&r>0||l.excludedDimensions&&l.excludedDimensions.length&&l.dimensions.length+l.excludedDimensions.length>n)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(l.measures.length>o&&o>0||l.excludedMeasures&&l.excludedMeasures.length&&l.measures.length+l.excludedMeasures.length>i)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!o&&l.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!r&&l.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},updateDimensionsOnAdded:function(e){var t=e.newProperties,r=e.dataDefinition,n=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var o=i.getValue(t,n||"").qHyperCubeDef,a=C(o.qDimensions);o.qDimensions=[],a.forEach((function(e){o.qDimensions.push(e),r.dimensions.added(e,t)}))}},updateMeasuresOnAdded:function(e){var t=e.newProperties,r=e.dataDefinition,n=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var o=i.getValue(t,n||"").qHyperCubeDef,a=w(o.qMeasures);o.qMeasures=[],a.forEach((function(e){o.qMeasures.push(e),r.measures.added(e,t)}))}},restoreMeasuresModifiers:function(e){var t=e.measures,r=e.modifierTypes;t&&r&&f.a.isSupportedModifiers(r)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))}};function M(e,t){var r=i.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!r&&(Object.keys(r).forEach((function(t){i.setValue(e,t,r[t])})),delete e.qLayoutExclude.quarantine[t],!0)}var L={exportProperties:function(e){var t=e.propertyTree,r=e.hypercubePath,n=e.viewDataMode,o=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,l=i.getValue(a,r||""),s=l.qHyperCubeDef;return s.qInterColumnSortOrder||(s.qInterColumnSortOrder=[]),m.addDimensions({exportFormat:o,qHyperCubeDef:s}),m.addMeasures({exportFormat:o,qHyperCubeDef:s}),m.setInterColumnSortOrder({exportFormat:o,qHyperCubeDef:s}),delete s.qLayoutExclude,m.copyProperties({exportFormat:o,properties:a}),r&&(o.properties.qHyperCubeDef=s,delete l.qHyperCubeDef),m.updateLayoutExclude({exportFormat:o,properties:a}),n||m.storeMeasuresModifiers(o.properties.qHyperCubeDef.qMeasures),Array.isArray(o.properties.filters)&&(h(o.properties,"filters","storedFilters"),delete o.properties.filters),o.properties.qHyperCubeDef.qContextSetExpression&&(h(o.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),o.properties.qHyperCubeDef.qContextSetExpression=""),o.properties.qHyperCubeDef.qDynamicScript&&o.properties.qHyperCubeDef.qDynamicScript.length&&(h(o.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),o.properties.qHyperCubeDef.qDynamicScript=[]),o},importProperties:function(e){var t=e.exportFormat,r=e.initialProperties,n=void 0===r?{}:r,o=e.dataDefinition,a=void 0===o?{}:o,l=e.defaultPropertyValues,s=void 0===l?{}:l,u=e.hypercubePath,c=e.extension,d=e.supportedFilters,p=void 0===d||d,f=e.isHCModifierSupported,m=void 0===f||f,h={qChildren:[]},y=I.createNewProperties({exportFormat:t,initialProperties:n,hypercubePath:u}),v=i.getValue(n,u||"").qHyperCubeDef,g=i.getValue(y,u||"").qHyperCubeDef,b=I.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:a}),q=b.maxDimensions,x=b.minDimensions,C=b.maxMeasures,D=b.minMeasures,w=s.defaultDimension,S=void 0===w?I.getDefaultDimension():w,L=s.defaultMeasure,E=void 0===L?I.getDefaultMeasure():L;g.qDimensions.length=0,g.qMeasures.length=0,I.shouldInitLayoutExclude({exportFormat:t,maxDimensions:q,minDimensions:x,maxMeasures:C,minMeasures:D})&&I.initLayoutExclude({exportFormat:t,maxDimensions:q,minDimensions:x,maxMeasures:C,minMeasures:D,newHyperCubeDef:g}),I.addDimensions({exportFormat:t,maxDimensions:q,minDimensions:x,newHyperCubeDef:g,defaultDimension:S}),I.addMeasures({exportFormat:t,maxMeasures:C,minMeasures:D,newHyperCubeDef:g,defaultMeasure:E}),I.updateDimensionsOnAdded({newProperties:y,dataDefinition:a,hypercubePath:u}),I.updateMeasuresOnAdded({newProperties:y,dataDefinition:a,hypercubePath:u}),I.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:g}),I.copyPropertyIfExist("qMaxStackedCells",v,g),I.copyPropertyIfExist("qNoOfLeftDims",v,g),I.copyPropertyOrSetDefault("qInitialDataFetch",v,g,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),I.copyPropertyOrSetDefault("qMode",v,g,"S"),I.copyPropertyOrSetDefault("qReductionMode",v,g,"N"),I.copyPropertyOrSetDefault("qSortbyYValue",v,g),I.copyPropertyOrSetDefault("qIndentMode",v,g),I.copyPropertyOrSetDefault("qShowTotalsAbove",v,g),I.importCommonProperties(y,t,n),h.qProperty=y;var T=i.getValue(c||{},"support.modifiers");return I.restoreMeasuresModifiers({measures:g.qMeasures,modifierTypes:T}),p&&M(h.qProperty,"storedFilters"),"S"===g.qMode&&m&&M(h.qProperty,"dynamicScript"),h}},E={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function T(e,t,r,n){t=t||[];var o=c(e,n,r),i=c(t,n,r);if(-1!==o&&-1===i){var a=e.splice(o,1);t.push(a[0])}return t}function A(e,t){return e.length!==t}var P={create:function(e,t){if(!e||!E[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,o){r=r||"qAttributeExpressions",o=o||"id";for(var i=0;i<e.length;i++){var a=e[i][r],l=t.length;if(T(a,t,n,o),A(t,l))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"}},O={getNumDimensions:function(e){return i.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return i.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}},N={colorModeOptions:{primary:function(){return!0},dimension:function(e){return O.getNumDimensions(e)>0&&O.getNumMeasures(e)<=1},multiColor:function(e){return O.getNumMeasures(e)>1},measure:function(e){return O.getNumDimensions(e)>0},expression:function(e){return O.getNumMeasures(e)>=1}}},F={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return O.getNumMeasures(e)>=1}}},k={scatterplot:F,"sn-scatter-plot":F,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return O.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return O.getNumDimensions(e)>1},multiColor:function(e){return O.getNumMeasures(e)>1},measure:function(e){return O.getNumDimensions(e)<=1},expression:function(e){return O.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return O.getNumDimensions(e)>=1},multiColor:function(e){return O.getNumMeasures(e)>1},measure:function(e){return O.getNumDimensions(e)>=1},expression:function(e){return O.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 O.getNumDimensions(e)>=1}}}};function H(e,t,r){if(Array.isArray(e[t])){var n=d.findIndexByPropertyValue(e[t],"id",r);n>=0&&e[t].splice(n,1)}else e[t]=[]}function _(e,t){var r=P.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){H(e,"qAttributeDimensions",r),H(e,"qAttributeExpressions",r)})),t.forEach((function(e){H(e,"qAttributeDimensions",r),H(e,"qAttributeExpressions",r)}))}function R(e,t){if(t){var r="="===t.charAt(0);e.color.altLabel=r?{qStringExpression:{qExpr:t.substr(1)}}:t}}function V(e){var t=e.properties,r=e.isDimension,n=e.dimensions,o=e.excludedDimensions,a=e.measures,l=e.label;_(n,o);var s=n[n.length-1];if(s){var u=r?i.getValue(t,"color.byDimDef"):i.getValue(t,"color.byMeasureDef"),c=i.getValue(t,"color.formatting.qNumFormat"),p=i.getValue(t,"color.formatting.isCustomFormatted");if(u){var f=P.create(P.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,r=e.label,n=e.item,o=e.isDimension,i=e.qNumFormat,a=e.isCustomFormatted;t.label=r||n.label,o?t.qDef=n.key:(t.qExpression=n.key,i&&(t.qNumFormat=i,t.isCustomFormatted=a)),t.matchMeasure=n.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:l,item:u,isDimension:r,qNumFormat:c,isCustomFormatted:p});break;case"libraryItem":!function(e){var t=e.attributeExpression,r=e.measures,n=e.item,o=e.isDimension,i=e.qNumFormat,a=e.isCustomFormatted;o||(t.matchMeasure=d.findIndexByPropertyValue(r,"qLibraryId",n.key),i&&(t.qNumFormat=i,t.isCustomFormatted=a)),void 0!==n.expression?t.qExpression=n.expression:t.qLibraryId=n.key,t.colorMapRef=n.key}({attributeExpression:f,measures:a,item:u,isDimension:r,qNumFormat:c,isCustomFormatted:p})}r?(f.qSortBy={qSortByAscii:1},s.qAttributeDimensions.push(f)):s.qAttributeExpressions.push(f)}}}function z(e,t,r,n){var o,i,a,l={};switch(e){case"dimension":r.qLibraryId?(l.type="dimension",l.name=r.qLibraryId,l.id=r.qLibraryId):(l.type="field",t?(l.name=r.label||r.qDef,l.id=r.qDef):(l.name=r.qDef.qFieldDefs[0],l.label=(a=r.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":(o=function(e,t){return t?e.qLibraryId:f.a.measureBase.getLibraryId(e)}(r,t))?(l.type="measure",l.name=o,l.id=o,(i=function(e,t){return f.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(r,n))&&(l.expression=i)):(l.type="expression",t?(l.name=r.label||r.qExpression,l.id=r.qExpression):(l.name=r.qDef.qDef,l.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 l}var j={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function W(e,t,r,n){var o=r?"expression":t.type,i=e.color,a=i.mode,l=O.getItemLabel(t);switch(R(e,l||""),o){case"field":a="byDimension",i.byDimDef={label:t.label||O.wrapFieldName(t.name),key:O.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",i.byMeasureDef={label:r||l,key:r||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",i.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",i.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},i.formatting&&j.useMasterNumberFormat(i.formatting)}n||(i.auto=!1,i.mode=a)}function B(e,t){var r=i.getValue(e,"".concat(t,"qDimensions"),[]),n=r[function(e,t,r){var n=i.getValue(t,"visualization"),o=r.split("."),a=Number(o[1]),l=i.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===n&&"point"===l}(r,e,t)?0:r.length-1],o=P.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(n.qAttributeDimensions,"id",o);return W(e,z("dimension",!!a,a||n)),!!a}function $(e,t){var r=i.getValue(e,"".concat(t,"qDimensions"),[]),n=i.getValue(e,"".concat(t,"qMeasures"),[]),o=i.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=i.getValue(e,"color.byDimDef");if(a&&R(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var r=i.getValue(e,"".concat(t,"qDimensions"),[]),n=i.getValue(e,"color.byDimDef");n.activeDimensionIndex=Math.min(n.activeDimensionIndex,r.length-1);var o=z("dimension",!1,r[n.activeDimensionIndex]);o.activeDimensionIndex=n.activeDimensionIndex,W(e,o)}(e,t);else if(function(e){return!e||!e.key}(a)&&B(e,t))return;V({properties:e,isDimension:!0,dimensions:r,excludedDimensions:o,measures:n,label:i.getValue(e,"color.byDimDef.label")})}function U(e,t){var r=i.getValue(e,"".concat(t,"qDimensions"),[]),n=i.getValue(e,"".concat(t,"qMeasures"),[]),o=i.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=i.getValue(e,"color.byMeasureDef");if(a&&R(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var r=i.getValue(e,"".concat(t,"qMeasures"),[]),n=i.getValue(e,"color.byMeasureDef");if(n.activeMeasureIndex=Math.min(n.activeMeasureIndex,r.length-1),n.activeMeasureIndex>-1){var o=z("measure",!1,r[n.activeMeasureIndex],!0);o.activeMeasureIndex=n.activeMeasureIndex,W(e,o)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,n)&&function(e,t){var r=i.getValue(e,"".concat(t,"qDimensions"),[]),n=i.getValue(e,"".concat(t,"qMeasures"),[]),o=r[r.length-1],a=P.IDMAP.COLOR_BY_ALTERNATIVE,l=d.findItemByPropertyValue(o.qAttributeExpressions,"id",a);return W(e,z("measure",!!l,l||n[0])),!!l}(e,t))return;V({properties:e,isDimension:!1,dimensions:r,excludedDimensions:o,measures:n,label:i.getValue(e,"color.byMeasureDef.label")})}var G={changeProperty:function(e,t,r){i.setValue(e,t,r),i.isAtomicValue(r)&&function(e,t,r){var n=e.qLayoutExclude;n&&(n.changed||(n.changed={}),n.changed[t]={from:i.getValue(e,t),to:r})}(e,t,r)},getCanColorBy:function(e,t){var r={primary:!0};if(e){var n=(k[t]||N).colorModeOptions||N.colorModeOptions;r.byDimension=n.dimension(e),r.byMeasure=n.measure(e),r.byMultiple=n.multiColor(e),r.byExpression=n.expression(e)}return r},shouldUpdateColorBy:function(e){var t=e.canColorBy,r=e.autoColor,n=e.colorMode,o=e.dimensions;return!(t[n]&&!r&&("byDimension"!==n&&"byMeasure"!==n||!o.length))},updateColorBy:function(e,t){var r=i.getValue(e,"color.mode"),n=i.getValue(e,"color.auto"),o=i.getValue(e,"".concat(t,"qDimensions"),[]),a=i.getValue(e,"".concat(t,"qMeasures"),[]),l=i.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);n?_(o,l):function(e){var t=e.auto,r=e.colorMode,n=e.dimensions;return!t&&"byDimension"===r&&n.length>0}({auto:n,colorMode:r,dimensions:o})?$(e,t):function(e){var t=e.auto,r=e.colorMode,n=e.dimensions,o=e.measures,a=e.properties,l=i.getValue(a,"visualization");return!(t||"byMeasure"!==r||!n.length||"map"!==l&&!o.length)}({auto:n,colorMode:r,dimensions:o,measures:a,properties:e})?U(e,t):function(e,t){var r=i.getValue(e,"color.mode"),n=i.getValue(e,"".concat(t,"qDimensions"),[]),o=i.getValue(e,"".concat(t,"qMeasures"),[]),a=i.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===r&&o.length<2&&i.setValue(e,"color.mode","primary"),_(n,a)}(e,t)},deleteTotalMode:function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},shouldAddColorByExpression:function(e){var t=e.shouldUpdateColorBy,r=e.properties,n=i.getValue(r,"qHyperCubeDef.qMeasures",[]),o=i.getValue(r,"color.mode","");return!t&&"byExpression"===o&&n.length>0},addColorByExpression:function(e){var t=i.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),r=i.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:r,id:"colorByExpression"}),i.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},switchToAutoColor:function(e){i.setValue(e,"color.mode","primary"),i.setValue(e,"color.auto",!0)},shouldSwitchToColorPersistent:function(e){var t=i.getValue(e,"qHyperCubeDef.qDimensions",[]),r=i.getValue(e,"color.persistent",!1);return t.length>1&&!r}},Y={exportProperties:function(e){var t=e.propertyTree,r=e.hypercubePath,n=e.viewDataMode,o=L.exportProperties({propertyTree:t,hypercubePath:r,viewDataMode:n}),i=o.data[0],a=i.dimensions.concat(i.excludedDimensions),l=i.measures.concat(i.excludedMeasures),s=P.IDMAP,u=s.COLOR_BY_ALTERNATIVE,c=s.COLOR_BY_EXPRESSION;return P.moveByIdFromGroup(a,[],"qAttributeDimensions",u),P.moveByIdFromGroup(a,[],"qAttributeExpressions",u),P.moveByIdFromGroup(l,[],"qAttributeExpressions",c),o},importProperties:function(e){var t=e.exportFormat,r=e.initialProperties,n=e.dataDefinition,o=e.defaultPropertyValues,a=e.hypercubePath,l=e.extension,s=e.supportedFilters,u=e.isHCModifierSupported,c=L.importProperties({exportFormat:t,initialProperties:r,dataDefinition:n,defaultPropertyValues:o,hypercubePath:a,extension:l,supportedFilters:s,isHCModifierSupported:u}),d=c.qProperty,p=i.getValue(d,"visualization"),f=i.getValue(d,"qHyperCubeDef.qDimensions",[]),m=i.getValue(d,"color.mode",""),h=i.getValue(d,"color.auto",""),y=G.getCanColorBy(d,p),v=G.shouldUpdateColorBy({canColorBy:y,autoColor:h,colorMode:m,dimensions:f});return y[m]?G.shouldAddColorByExpression({shouldUpdateColorBy:v,properties:d})&&G.addColorByExpression(d):G.switchToAutoColor(d),v&&G.updateColorBy(d,"qHyperCubeDef."),G.shouldSwitchToColorPersistent(d)&&G.changeProperty(d,"color.persistent",!0),G.deleteTotalMode(f),c}},X=["bar","marker","line"],J={handleAutoMinMax:function(e){var t=e.initialProperties,r=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?M(r,"unsupportedAutoMinMax")||v()(r.measureAxis,t.measureAxis):M(r,"supportedAutoMinMax")||v()(r.measureAxis,t.measureAxis)},handleMeasuresAxis:function(e){var t,r=e.exportFormat,n=e.initialProperties,o=e.properties,i=e.measureType,a=o.qHyperCubeDef,l=o.measureAxis;if(function(e){var t=e.exportFormat,r=e.initialProperties;return!(!t.properties.measureAxes||r.measureAxes||!r.measureAxis||void 0===r.measureAxis.autoMinMax)}({exportFormat:r,initialProperties:n})){var s=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,o=r.axis;t[o]||(t[o]={axis:o,type:{line:0,marker:0,bar:0,total:0}}),X.includes(n)&&t[o].type[n]++,t[o].type.total++}})),t}(a);s.length?(i&&(t=s.filter((function(e){return e.type[i]>0})).sort((function(e,t){return t.type[i]-e.type[i]}))),t&&t.length||(t=s.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&v()(l,r.properties.measureAxes[t[0].axis])):v()(l,r.properties.measureAxes[0])}},setInterColumnSortOrder: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}}}},K={exportProperties:function(e){var t=e.propertyTree,r=e.hypercubePath,n=e.viewDataMode,o=e.supportedAutoMinMax,i=void 0===o||o,a=Y.exportProperties({propertyTree:t,hypercubePath:r,viewDataMode:n}),l=a.properties;return i?(h(l,"measureAxis.min","supportedAutoMinMax"),h(l,"measureAxis.max","supportedAutoMinMax")):(h(l,"measureAxis.min","unsupportedAutoMinMax"),h(l,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,r=e.initialProperties,n=e.dataDefinition,o=e.defaultPropertyValues,i=e.hypercubePath,a=e.measureType,l=e.extension,s=e.supportedFilters,u=e.isHCModifierSupported,c=Y.importProperties({exportFormat:t,initialProperties:r,dataDefinition:n,defaultPropertyValues:o,hypercubePath:i,extension:l,supportedFilters:s,isHCModifierSupported:u}),d=c.qProperty;return J.handleAutoMinMax({initialProperties:r,properties:d}),J.handleMeasuresAxis({exportFormat:t,initialProperties:r,properties:d,measureType:a}),J.setInterColumnSortOrder(d.qHyperCubeDef),d.qHyperCubeDef.qColumnOrder=[],d.qHyperCubeDef.columnOrder=[],c}};function Z(e,t,r){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(r)}function Q(e){var t=e.properties,r=e.arrayPath,n=e.quarantineName,o=e.arrayName,a=e.itemPath;i.getValue(t,r,[]).forEach((function(e){return function(e){var t=e.properties,r=e.quarantineName,n=e.arrayName,o=e.item,a=e.itemPath,l=i.getValue(o,a);if(void 0!==l){var s=i.getValue(o,"qDef.cId");s||(s=i.generateId(),i.setValue(o,"qDef.cId",s));var u=Z(r,n,s);i.setValue(t,u,l),i.setValue(o,a,void 0)}}({properties:t,quarantineName:n,arrayName:o,item:e,itemPath:a})}))}function ee(e){var t=e.properties,r=e.arrayPath,n=e.quarantineName,o=e.arrayName,a=e.itemPath;i.getValue(t,r,[]).forEach((function(e){return function(e){var t=e.properties,r=e.quarantineName,n=e.arrayName,o=e.item,a=e.itemPath,l=i.getValue(o,"qDef.cId");if(l){var s=Z(r,n,l),u=i.getValue(t,s);void 0!==u&&(i.setValue(o,a,u),i.setValue(t,s,void 0))}}({properties:t,quarantineName:n,arrayName:o,item:e,itemPath:a})}))}var te={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalColoring",arrayName:"measures",itemPath:"qDef.conditionalColoring"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",itemPath:"qDef.conditionalColoring",arrayName:"measures",quarantineName:"conditionalColoring"})}},re={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},quarantineAlternative:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})},unquarantineAlternative:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})}};t.default={hypercube:L,colorChart:Y,axisChart:K,quarantineProperty:h,unquarantineProperty:M,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:re}}]);var Nt=Pt(Ot.exports);function Ft(e){const{translator:t}=e;return{targets:[{path:"/qHyperCubeDef",dimensions:{min:1,max:1e3,description(e,r,n){const o=n&&"rows"===n.type?"Visualizations.Descriptions.Row":"Visualizations.Descriptions.Column";return t.get(o)}},measures:{min:1,max:1e3,description:()=>t.get("Visualizations.Descriptions.Values")}}]}}const kt="qHyperCubeDef.qDimensions",Ht="dimensions",_t="qOtherTotalSpec.qTotalMode",Rt="totalMode",Vt={quarantine(e){Nt.quarantineArrayProp({properties:e,arrayPath:kt,quarantineName:Rt,arrayName:Ht,itemPath:_t})},unquarantine(e){Nt.unquarantineArrayProp({properties:e,arrayPath:kt,quarantineName:Rt,arrayName:Ht,itemPath:_t})}};function zt(e){const t=Ft(e);return(e,r,n,o)=>{var i,a,l,s,u,c,d,p,f,m,h,y,v;const g=Nt.hypercube.importProperties({exportFormat:e,initialProperties:r,dataDefinition:t.targets[0],hypercubePath:o}),b=((null===(i=g.qProperty)||void 0===i||null===(a=i.qHyperCubeDef)||void 0===a?void 0:a.qDimensions)||[]).length,q=(null===(l=g.qProperty)||void 0===l||null===(s=l.qHyperCubeDef)||void 0===s||null===(u=s.qMeasures)||void 0===u?void 0:u.length)||0;let x,C=(null===(c=g.qProperty)||void 0===c||null===(d=c.qHyperCubeDef)||void 0===d?void 0:d.qInterColumnSortOrder)||[],D=!0;b+q===C.length&&Ke(g,"qProperty.qLayoutExclude.quarantine.interColSortOrder",C.concat());const w=(null==g||null===(p=g.qProperty)||void 0===p||null===(f=p.qLayoutExclude)||void 0===f||null===(m=f.quarantine)||void 0===m?void 0:m.pivotInterColSortOrder)||void 0;w?(C=w,x=[...w],Ke(g,"qProperty.qHyperCubeDef.qInterColumnSortOrder",C),delete g.qProperty.qLayoutExclude.quarantine.pivotInterColSortOrder):C.length=0;const S=+(C.indexOf(-1)>-1),I=b+S;if(I>C.length)for(let e=C.length;e<I;e++)C.indexOf(e)<0&&C.push(e-S);for(let e=C.length-1;e>=0;e--)C[e]>=b&&C.splice(e,1);q>1&&C.indexOf(-1)<0?C.push(-1):q<2&&C.indexOf(-1)>-1&&C.splice(C.indexOf(-1),1);const M=null!==(h=null==g||null===(y=g.qProperty)||void 0===y||null===(v=y.qHyperCubeDef)||void 0===v?void 0:v.qNoOfLeftDims)&&void 0!==h?h:-1;if(b>0&&-1===M&&Ke(g,"qProperty.qHyperCubeDef.qNoOfLeftDims",b),x&&C&&x.length===C.length){for(let e=0;e<x.length;e++)if(x[e]!==C[e]){D=!1;break}D&&Nt.unquarantineProperty(g.qProperty,"noOfLeftDims")}return Nt.conditionalShow.unquarantine(g.qProperty),Vt.unquarantine(g.qProperty),g}}function jt(e,t){var r,n,o,i,a,l;const s=null!==(r=null==e||null===(n=e.qProperty)||void 0===n||null===(o=n.qHyperCubeDef)||void 0===o?void 0:o.qInterColumnSortOrder)&&void 0!==r?r:[],u=s.slice(),c=s.indexOf(-1);c>-1&&s.splice(c,1);const d=Nt.hypercube.exportProperties({propertyTree:e,hyperCubePath:t}),p=d.properties.qHyperCubeDef,f=p.qDimensions.length,m=p.qMeasures.length;let h=p.qInterColumnSortOrder;Ke(d,"properties.qLayoutExclude.quarantine.pivotInterColSortOrder",u),Nt.quarantineProperty(d.properties,"qHyperCubeDef.qNoOfLeftDims","noOfLeftDims"),delete d.properties.qHyperCubeDef.qNoOfLeftDims;const y=null==d||null===(i=d.properties)||void 0===i||null===(a=i.qLayoutExclude)||void 0===a||null===(l=a.quarantine)||void 0===l?void 0:l.interColSortOrder;y&&(h=y,Ke(d,"properties.qHyperCubeDef.qInterColumnSortOrder",h),Ke(d,"data.0.interColumnSortOrder",h),delete d.properties.qLayoutExclude.quarantine.interColSortOrder);for(let e=h.length;e<f+m;e++)h.length<=e&&h.push(e);return Nt.conditionalShow.quarantine(d.properties),Vt.quarantine(d.properties),d}const Wt={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}}}},Bt="TOTAL_OFF";function $t(e,t,r){if(!r.properties.qHyperCubeDef.qIndentMode)return!0;const n=r.properties.qHyperCubeDef.qInterColumnSortOrder.indexOf(-1);let o=r.properties.qHyperCubeDef.qNoOfLeftDims;n>-1&&n<o&&(o-=1);const i=r.properties.qHyperCubeDef.qDimensions.indexOf(e);return 0===i||i>=o}const Ut=e=>{var t,r;const{translator:n,anything:o}=e;return{type:"items",component:"pivot-data",translation:"properties.data",addTranslation:"Properties.AddData",items:{dimensions:{type:"array",component:"dimensions",translation:"Common.Dimensions",alternativeTranslation:"properties.alternative.dimensions",ref:"qHyperCubeDef.qDimensions",disabledRef:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",min:1,allowAdd:!0,allowRemove:!0,allowMove:!0,addTranslation:"properties.dimensions.add",grouped:!0,items:{libraryId:{type:"string",component:"library-item",libraryItemType:"dimension",ref:"qLibraryId",translation:"Common.Dimension",show:e=>!!e.qLibraryId},inlineDimension:{component:"inline-dimension",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},nullSuppression:{type:"boolean",ref:"qNullSuppression",defaultValue:!1,translation:"properties.dimensions.showNull",inverted:!0},totalMode:{type:"string",component:"switch",translation:"properties.showTotals",ref:"qOtherTotalSpec.qTotalMode",defaultValue:Bt,trueOption:{value:"TOTAL_EXPR",translation:"properties.on"},falseOption:{value:Bt,translation:"properties.off"},show:(null===(t=o.sense)||void 0===t||null===(r=t.isUnsupportedFeature)||void 0===r||!r.call(t,"totals"))&&$t},totalsLabel:{type:"string",component:"expression",expressionType:"StringExpr",ref:"qTotalLabel",translation:"properties.totals.label",defaultValue:()=>n.get("Object.Table.Totals"),show(e,t,r){var n,i,a;return!(null!==(n=o.sense)&&void 0!==n&&null!==(i=n.isUnsupportedFeature)&&void 0!==i&&i.call(n,"totals"))&&(null===(a=e.qOtherTotalSpec)||void 0===a?void 0:a.qTotalMode)!==Bt&&$t(e,0,r)}},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0}}},measures:{type:"array",component:"measures",translation:"Common.Measures",ref:"qHyperCubeDef.qMeasures",disabledRef:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",min:1,allowAdd:!0,allowRemove:!0,allowMove:!0,addTranslation:"properties.measures.add",grouped:!0,items:{libraryId:{type:"string",component:"library-item",libraryItemType:"measure",ref:"qLibraryId",translation:"Common.Measure",show:e=>!!e.qLibraryId},inlineMeasure:{component:"inline-measure",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1}}}}}},Gt="12px",Yt="Source Sans Pro, Arial, sans-serif",Xt=4/3,Jt=1;var Kt;!function(e){e.PrimaryText="#404040",e.Black3="rgba(0, 0, 0, 0.03)",e.Black5="rgba(0, 0, 0, 0.05)",e.Black15="rgba(0, 0, 0, 0.15)",e.Black55="rgba(0, 0, 0, 0.55)",e.Black60="rgba(0, 0, 0, 0.6)",e.Transparent="transparent"}(Kt||(Kt={}));const Zt={borderStyle:"solid"},Qt={boxSizing:"border-box",padding:4},er={...Qt,...Zt,borderLeftWidth:0,borderBottomWidth:1,borderRightWidth:1,borderTopWidth:0},tr={...Qt,...Zt,borderLeftWidth:0,borderBottomWidth:1,borderRightWidth:0,borderTopWidth:0},rr={...Qt,...Zt,borderLeftWidth:0,borderBottomWidth:0,borderRightWidth:1,borderTopWidth:0},nr={lineHeight:"calc(1.3333333333333333)",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},or={borderStyle:"solid"},ir=e=>({whiteSpace:"unset",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical",lineBreak:"anywhere"}),ar={width:"fit-content",maxWidth:"100%",position:"sticky",left:4,top:4},lr=(e,t,r)=>e&&t?Qt:e?{...rr,borderColor:r}:t?{...tr,borderColor:r}:{...er,borderColor:r},sr=(e,t,r)=>({ref:e,translation:t,dualOutput:!0,type:"object",component:"color-picker",width:"auto",defaultValue(e,t,n){const o=n.theme.current();return{color:r(o)}}}),ur=(e,t=!1)=>{return{value:e,label:t?(r=e,r.charAt(0).toUpperCase()+r.slice(1)):e,groupHeader:!1,disabled:!1};var r},cr=["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",Yt,"Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],dr=({ref:e,themeAccessor:t,translator:r})=>({component:"dropdown",ref:e,options:(e,n,o)=>{const i=o.theme.current();return((e,t,r)=>{var n;const o=t.fontFamily,i=null!==(n=t.fontFamilies)&&void 0!==n?n:[],a=Array.from(new Set([e,o,...i])),l=[{value:"ThemeHeader",label:r.get("properties.themeFonts"),metaText:r.get("properties.theme"),groupHeader:!0},...a.sort().map((e=>ur(e,!0)))],s=[{value:"DefaultHeader",label:r.get("properties.allFonts"),metaText:r.get("properties.default"),groupHeader:!0},...cr.filter((e=>!a.includes(e))).map((e=>ur(e,!0)))];return[...l,...s.length>1?s:[]]})(t(i),i,r)},defaultValue:(e,r,n)=>t(n.theme.current())}),pr=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],fr=({ref:e,themeAccessor:t,translator:r})=>({component:"dropdown",ref:e,options:(e,n,o)=>{const i=o.theme.current();return((e,t,r)=>{var n;const o=t.fontSize,i=null!==(n=t.fontSizes)&&void 0!==n?n:[],a=Array.from(new Set([e,o,...i])),l=[{value:"ThemeHeader",label:r.get("properties.themeFontSizes"),metaText:r.get("properties.theme"),groupHeader:!0},...a.sort(((e,t)=>parseInt(e,10)-parseInt(t,10))).map((e=>ur(e,!1)))],s=[{value:"DefaultHeader",label:r.get("properties.allFontSizes"),metaText:r.get("properties.default"),groupHeader:!0},...pr.filter((e=>!a.includes(e))).map((e=>ur(e,!1)))];return[...l,...s.length>1?s:[]]})(t(i),i,r)},defaultValue:(e,r,n)=>t(n.theme.current())}),mr=e=>({component:"panel-section",translation:"properties.Content",items:{content:{component:"items",ref:"components",key:"theme",items:{fontSize:fr({ref:"content.fontSize",themeAccessor:e=>{var t,r,n,o;return null!==(t=null===(r=e.object)||void 0===r||null===(n=r.pivotTableV2)||void 0===n||null===(o=n.content)||void 0===o?void 0:o.fontSize)&&void 0!==t?t:e.fontSize},translator:e}),fontFamily:dr({ref:"content.fontFamily",themeAccessor:e=>{var t,r,n,o;return null!==(t=null===(r=e.object)||void 0===r||null===(n=r.pivotTableV2)||void 0===n||null===(o=n.content)||void 0===o?void 0:o.fontFamily)&&void 0!==t?t:e.fontFamily},translator:e}),fontColor:sr("content.fontColor","properties.fontColor",(e=>{var t,r,n,o;return null!==(t=null===(r=e.object)||void 0===r||null===(n=r.pivotTableV2)||void 0===n||null===(o=n.content)||void 0===o?void 0:o.color)&&void 0!==t?t:e.color})),background:sr("content.background","properties.background",(e=>{var t,r,n,o;return null!==(t=null===(r=e.object)||void 0===r||null===(n=r.pivotTableV2)||void 0===n||null===(o=n.content)||void 0===o?void 0:o.background)&&void 0!==t?t:Kt.Transparent})),nullValues:{component:"header",label:e.get("library.colors.nullvalues")},nullValueFontColor:sr("content.nullValue.fontColor","properties.fontColor",(e=>{var t,r,n,o,i;return null!==(t=null===(r=e.object)||void 0===r||null===(n=r.pivotTableV2)||void 0===n||null===(o=n.content)||void 0===o||null===(i=o.nullValue)||void 0===i?void 0:i.color)&&void 0!==t?t:e.color})),nullValueBackground:sr("content.nullValue.background","properties.background",(e=>{var t,r,n,o,i;return null!==(t=null===(r=e.object)||void 0===r||null===(n=r.pivotTableV2)||void 0===n||null===(o=n.content)||void 0===o||null===(i=o.nullValue)||void 0===i?void 0:i.background)&&void 0!==t?t:Kt.Transparent})),totalsHeader:{component:"header",label:e.get("properties.totals")},totalValueFontColor:sr("content.totalValue.fontColor","properties.fontColor",(e=>{var t,r,n,o,i;return null!==(t=null===(r=e.object)||void 0===r||null===(n=r.pivotTableV2)||void 0===n||null===(o=n.content)||void 0===o||null===(i=o.totalValue)||void 0===i?void 0:i.color)&&void 0!==t?t:e.color})),totalValueBackground:sr("content.totalValue.background","properties.background",(e=>{var t,r,n,o,i;return null!==(t=null===(r=e.object)||void 0===r||null===(n=r.pivotTableV2)||void 0===n||null===(o=n.content)||void 0===o||null===(i=o.totalValue)||void 0===i?void 0:i.background)&&void 0!==t?t:Kt.Transparent}))}}}}),hr=(e,t)=>({component:"panel-section",translation:`properties.pivot.${e}`,items:{content:{component:"items",ref:"components",key:"theme",items:{fontSize:fr({ref:`${e}.fontSize`,themeAccessor:t=>{var r,n,o,i;return null!==(r=null===(n=t.object)||void 0===n||null===(o=n.pivotTableV2)||void 0===o||null===(i=o[e])||void 0===i?void 0:i.fontSize)&&void 0!==r?r:t.fontSize},translator:t}),fontFamily:dr({ref:`${e}.fontFamily`,themeAccessor:t=>{var r,n,o,i;return null!==(r=null===(n=t.object)||void 0===n||null===(o=n.pivotTableV2)||void 0===o||null===(i=o[e])||void 0===i?void 0:i.fontFamily)&&void 0!==r?r:t.fontFamily},translator:t}),fontColor:sr(`${e}.fontColor`,"properties.fontColor",(t=>{var r,n,o,i;return null!==(r=null===(n=t.object)||void 0===n||null===(o=n.pivotTableV2)||void 0===o||null===(i=o[e])||void 0===i?void 0:i.color)&&void 0!==r?r:t.color})),background:sr(`${e}.background`,"properties.background",(t=>{var r,n,o,i;return null!==(r=null===(n=t.object)||void 0===n||null===(o=n.pivotTableV2)||void 0===o||null===(i=o[e])||void 0===i?void 0:i.background)&&void 0!==r?r:Kt.Transparent})),nullValues:{component:"header",label:t.get("library.colors.nullvalues")},nullValueFontColor:sr(`${e}.nullValue.fontColor`,"properties.fontColor",(t=>{var r,n,o,i,a;return null!==(r=null===(n=t.object)||void 0===n||null===(o=n.pivotTableV2)||void 0===o||null===(i=o[e])||void 0===i||null===(a=i.nullValue)||void 0===a?void 0:a.color)&&void 0!==r?r:t.color})),nullValueBackground:sr(`${e}.nullValue.background`,"properties.background",(t=>{var r,n,o,i,a;return null!==(r=null===(n=t.object)||void 0===n||null===(o=n.pivotTableV2)||void 0===o||null===(i=o[e])||void 0===i||null===(a=i.nullValue)||void 0===a?void 0:a.background)&&void 0!==r?r:Kt.Transparent})),totalsHeader:{component:"header",label:t.get("properties.totals")},totalLabelFontColor:sr(`${e}.totalLabel.fontColor`,"properties.fontColor",(t=>{var r,n,o,i,a;return null!==(r=null===(n=t.object)||void 0===n||null===(o=n.pivotTableV2)||void 0===o||null===(i=o[e])||void 0===i||null===(a=i.totalLabel)||void 0===a?void 0:a.color)&&void 0!==r?r:t.color})),totalLabelBackground:sr(`${e}.totalLabel.background`,"properties.background",(t=>{var r,n,o,i,a;return null!==(r=null===(n=t.object)||void 0===n||null===(o=n.pivotTableV2)||void 0===o||null===(i=o[e])||void 0===i||null===(a=i.totalLabel)||void 0===a?void 0:a.background)&&void 0!==r?r:Kt.Transparent}))}}}}),yr={translation:"properties.filterpane.grid",component:"panel-section",items:{rowHeightItem:{component:"items",ref:"components",key:"theme",items:{lineCount:{component:"inline-wrapper",items:{rowHeight:{component:"dropdown",ref:"grid.lineCount",translation:"ThemeStyleEditor.style.rowHeight",options:[...Array(10).keys()].map((e=>({value:e+1,translation:e+1}))),defaultValue:1}}},border:sr("grid.border","properties.border",(e=>{var t,r,n,o;return null!==(t=null===(r=e.object)||void 0===r||null===(n=r.pivotTableV2)||void 0===n||null===(o=n.grid)||void 0===o?void 0:o.border)&&void 0!==t?t:Kt.Black15})),divider:sr("grid.divider","properties.pivot.divider",(e=>{var t,r,n,o;return null!==(t=null===(r=e.object)||void 0===r||null===(n=r.pivotTableV2)||void 0===n||null===(o=n.grid)||void 0===o?void 0:o.divider)&&void 0!==t?t:Kt.Black60}))}}}},vr=e=>({translation:"properties.Header",component:"panel-section",items:{headerFontItem:{component:"items",ref:"components",key:"theme",items:{fontSize:fr({ref:"header.fontSize",themeAccessor:e=>{var t,r,n,o;return null!==(t=null===(r=e.object)||void 0===r||null===(n=r.pivotTableV2)||void 0===n||null===(o=n.header)||void 0===o?void 0:o.fontSize)&&void 0!==t?t:e.fontSize},translator:e}),fontFamily:dr({ref:"header.fontFamily",translator:e,themeAccessor:e=>{var t,r,n,o;return null!==(t=null===(r=e.object)||void 0===r||null===(n=r.pivotTableV2)||void 0===n||null===(o=n.header)||void 0===o?void 0:o.fontFamily)&&void 0!==t?t:e.fontFamily}}),background:sr("header.background","properties.background",(e=>{var t,r,n,o;return null!==(t=null===(r=e.object)||void 0===r||null===(n=r.pivotTableV2)||void 0===n||null===(o=n.header)||void 0===o?void 0:o.background)&&void 0!==t?t:Kt.Transparent})),rowTitleHeader:{component:"header",label:e.get("Common.Rows")},rowTitleFontColor:sr("header.rowTitle.fontColor","properties.fontColor",(e=>{var t,r,n,o,i;return null!==(t=null===(r=e.object)||void 0===r||null===(n=r.pivotTableV2)||void 0===n||null===(o=n.header)||void 0===o||null===(i=o.rowTitle)||void 0===i?void 0:i.color)&&void 0!==t?t:e.color})),rowTitleBackground:sr("header.rowTitle.background","properties.background",(e=>{var t,r,n,o,i;return null!==(t=null===(r=e.object)||void 0===r||null===(n=r.pivotTableV2)||void 0===n||null===(o=n.header)||void 0===o||null===(i=o.rowTitle)||void 0===i?void 0:i.background)&&void 0!==t?t:Kt.Transparent})),columntTitleHeader:{component:"header",label:e.get("Common.Columns")},columnTitleFontColor:sr("header.columnTitle.fontColor","properties.fontColor",(e=>{var t,r,n,o,i;return null!==(t=null===(r=e.object)||void 0===r||null===(n=r.pivotTableV2)||void 0===n||null===(o=n.header)||void 0===o||null===(i=o.columnTitle)||void 0===i?void 0:i.color)&&void 0!==t?t:e.color})),columnTitleBackground:sr("header.columnTitle.background","properties.background",(e=>{var t,r,n,o,i;return null!==(t=null===(r=e.object)||void 0===r||null===(n=r.pivotTableV2)||void 0===n||null===(o=n.header)||void 0===o||null===(i=o.columnTitle)||void 0===i?void 0:i.background)&&void 0!==t?t:Kt.Transparent}))}}}}),gr=e=>({type:"items",items:[{component:"styling-panel",chartTitle:"Object.PivotTable",subtitle:"LayerStyleEditor.component.styling",translation:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,defaultValue:[],items:{headerSection:vr(e),contentSection:mr(e),rowContentSection:hr("rowContent",e),columnContentSection:hr("columnContent",e),gridSection:yr}}]}),br=e=>({uses:"settings",items:{presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:[gr(e),{type:"items",items:{nullValueText:{ref:"nullValueRepresentation.text",type:"string",translation:"properties.pivot.nullValueText",defaultValue:"-"},alwaysFullyExpanded:{ref:"qHyperCubeDef.qAlwaysFullyExpanded",type:"boolean",translation:"properties.pivot.fullyExpanded",defaultValue:!1},showTotalsAbove:{ref:"qHyperCubeDef.qShowTotalsAbove",type:"boolean",translation:"properties.pivot.showTotalsAbove",defaultValue:!0,show(e){var t,r;return null===(t=e.qHyperCubeDef)||void 0===t||null===(r=t.qDimensions)||void 0===r?void 0:r.some((e=>{var t;return"TOTAL_EXPR"===(null===(t=e.qOtherTotalSpec)||void 0===t?void 0:t.qTotalMode)}))}},resetProperties:{type:"object",component:"button",translation:"properties.pivot.resetExpansionButton",disabled:e=>e.qHyperCubeDef.qAlwaysFullyExpanded,action(e,t,r,n){e.qHyperCubeDef.qExpansionState=[],n.$emit("saveProperties",e)}}}}]}}}),qr="auto",xr={type:"items",translation:"properties.sorting",items:{sortbyY:{type:"items",items:{sortbyYToggle:{ref:"qHyperCubeDef.qSortbyYValue",type:"boolean",component:"switch",translation:"properties.sorting.sortByY.label",convertFunctions:{get:e=>!!e("integer"),set:(e,t)=>t("integer",e?-1:0)},options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}]},sortbyYOrder:{ref:"qHyperCubeDef.qSortbyYValue",type:"string",component:"dropdown",defaultValue:0,options:[{value:1,translation:"properties.sorting.ascending"},{value:-1,translation:"properties.sorting.descending"}],show:e=>{var t;return!(null==e||null===(t=e.qHyperCubeDef)||void 0===t||!t.qSortbyYValue)}}}},defaultSorting:{uses:"sorting",items:{dimensions:{showPriority:!1,allowMove:!1},measures:{included:!1}}},searchSorting:{ref:"search.sorting",type:"string",component:"dropdown",defaultValue:qr,translation:"Object.Table.SortingInSearch",options:[{value:qr,translation:"Common.Auto"},{value:"inherit",translation:"Object.Table.SortingInSearch.InheritFromDimension"}]}}};function Cr(e){const{translator:t}=e;return{type:"items",component:"accordion",items:{data:Ut(e),sorting:xr,addons:Wt,settings:br(t)}}}function Dr(e){return{support:{cssScaling:!1,snapshot:!1,export:!0,sharing:!1,exportData:!0,viewData:!0},usePropertyHandler:"pivot-data",definition:Cr(e),importProperties:zt(e),exportProperties:jt}}var wr,Sr=M;wr=Sr.createRoot,Sr.hydrateRoot;const Ir=h({}),Mr=()=>y(Ir),Lr=({children:e,styleService:t})=>m.createElement(Ir.Provider,{value:t},e),Er=({styleService:e,translator:t})=>{const r=t.get("SNPivotTable.LimitedData"),{fontFamily:n}=e.content;return m.createElement("div",{style:{width:"100%",height:"22px"}},m.createElement("span",{style:{...nr,fontFamily:n,fontSize:"13px",fontStyle:"italic",lineHeight:"22px",color:"#7b7a78"}},r))},Tr={display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",width:"100%",height:"28px",padding:"0 8px",boxSizing:"border-box"},Ar={margin:"8px"},Pr={display:"flex",alignItems:"center"},Or=({pageInfo:e,updatePageInfo:t})=>{const{totalPages:r,rowsPerPage:n,currentPage:o,totalRowCount:i}=e,a=0===o,l=o===r-1,s=[{key:1,label:"first",disabled:a,onClick:()=>t({currentPage:0})},{key:2,label:"prev",disabled:a,onClick:()=>t({currentPage:o-1})},{key:3,label:"next",disabled:l,onClick:()=>t({currentPage:o+1})},{key:4,label:"last",disabled:l,onClick:()=>t({currentPage:r-1})}];return m.createElement("div",{style:Tr},m.createElement("span",{style:Ar,"data-testid":"page-info"},"page: ",m.createElement("b",null,o+1)," of ",m.createElement("b",null,r)),m.createElement("span",{style:Ar,"data-testid":"data-range-info"},o*n+1," - ",Math.min((o+1)*n,i)," of ",i),m.createElement("div",{style:Pr},s.map((({label:e,...t})=>m.createElement("button",{...t,"data-testid":`${e}`,type:"button"},e)))))},Nr="/qHyperCubeDef",Fr=50,kr=-1,Hr="M",_r=25;function Rr(e,t){const r=v(null);g((()=>{null===r.current&&(r.current=document.createElement("canvas").getContext("2d"))}),[]),g((()=>{null!==r.current&&(r.current.font=`${e} ${t}`)}),[e,t]);const n=g((()=>null===r.current?null:Ze(r.current.measureText.bind(r.current))),[]);return{estimateWidth:b((e=>null===r.current||null===n?0:n(Hr).width*e),[n]),measureText:b((e=>null===r.current||null===n?0:n(e).width+_r),[n])}}const Vr=(e,t,r)=>{var n;const{qDimensionInfo:o}=e,i=((e,t,r)=>{const n=Array(r.length).fill(null).map((()=>Array.from({length:t},(()=>null))));return r.forEach(((r,o)=>{if(r===kr)n[o][t-1]={id:"PSEUDO-DIM",title:""};else{var i,a;const l=e[r],s=null!==(i=null!==(a=l.cId)&&void 0!==a?a:l.qLibraryId)&&void 0!==i?i:`${r}-${l.qFallbackTitle}`;n[o][t-1]={id:s,title:e[r].qFallbackTitle}}})),n})(o,Math.max(t,1),r);return{data:i,size:{x:i.length,y:(null===(n=i[0])||void 0===n?void 0:n.length)||0}}},zr=(e,t,r,n,o,i,a)=>({ref:e,x:n,y:o,dataY:i,parent:t,root:r,leafCount:a?0:e.qUp+e.qDown,distanceToNextCell:0,incrementLeafCount(){this.leafCount+=1,t&&t.incrementLeafCount()}}),jr=(e,t,r,n,o)=>{if(!t.length)return e;let i=0;return function t(a,l,s,u=0){e[u]||(e[u]={}),s.forEach(((s,c)=>{i+=0===c?0:1;const d=r.qTop-n.currentPage*n.rowsPerPage,p=Math.max(0,d+i-s.qUp),f=r.qTop+i-s.qUp,m=zr(s,l,a,u,p,f,o);var h;(e[u][p]=m,s.qSubNodes.length)?t(a||m,m,s.qSubNodes,u+1):null===(h=m.parent)||void 0===h||h.incrementLeafCount()}))}(null,null,t,0),e},Wr=(e,t,r)=>{e.slice(0,-1).forEach((e=>{Object.values(e).forEach(((e,n,o)=>{const i=o[n+1];e.distanceToNextCell=i?i[t]-(e[t]+e.leafCount):r[t]-(e[t]+e.leafCount)}))}))};var Br,$r;!function(e){e.NX_DIM_CELL_VALUE="V",e.NX_DIM_CELL_EMPTY="E",e.NX_DIM_CELL_NORMAL="N",e.NX_DIM_CELL_TOTAL="T",e.NX_DIM_CELL_OTHER="O",e.NX_DIM_CELL_AGGR="A",e.NX_DIM_CELL_PSEUDO="P",e.NX_DIM_CELL_ROOT="R",e.NX_DIM_CELL_NULL="U",e.NX_DIM_CELL_GENERATED="G"}(Br||(Br={})),function(e){e.NX_CELL_DATA="D",e.NX_CELL_TOP="T",e.NX_CELL_LEFT="L"}($r||($r={}));var Ur=Br;const Gr=(e,t)=>(r,n)=>{const o=n+e;return Object.values(r)[0].ref.qType===Ur.NX_DIM_CELL_PSEUDO?kr:t[o]},Yr=({prevData:e,nextDataPage:t,pageInfo:r})=>{const{qLeft:n,qArea:o}=t;if(!n.length)return e;const i=jr(e.grid,n,o,r,!1);return Wr(i,"y",e.layoutSize),{...e,grid:i,columnCount:i.length}},Xr=(e,t,r,n)=>{const o=[...t];return r.forEach(((t,r)=>{t.forEach(((t,i)=>{const a=e.qTop-n.currentPage*n.rowsPerPage;Array.isArray(o[a+r])||(o[a+r]=[]),o[a+r][e.qLeft+i]=t}))})),o},Jr=({prevData:e,nextDataPage:t,pageInfo:r})=>{const{qData:n,qArea:o}=t;return n.length?Xr(o,e,n,r):e},Kr=(e,t,r,n)=>{if(!t.length)return e;let o=0;return function t(i,a,l,s=0){e[s]||(e[s]={}),l.forEach(((l,u)=>{o+=0===u?0:1;const c=r.qLeft+o-l.qUp,d=zr(l,a,i,c,s,s,n);var p;(e[s][c]=d,l.qSubNodes.length)?t(i||d,d,l.qSubNodes,s+1):null===(p=d.parent)||void 0===p||p.incrementLeafCount()}))}(null,null,t),e},Zr=({prevData:e,nextDataPage:t})=>{const{qTop:r,qArea:n}=t;if(!r.length)return e;const o=Kr(e.grid,r,n,!1);return Wr(o,"x",e.layoutSize),{...e,grid:o,rowCount:o.length}};function Qr(e,t){const[r,n]=q(t);r.some(((e,r)=>e!==t[r]))&&(n(t),e())}const en=(e,t,r)=>{const{qHyperCube:n}=t.layout,[o,i]=q(null),a=b((()=>e.slice(1).reduce(((e,t)=>Jr({prevData:e,nextDataPage:t,pageInfo:r})),((e,t)=>{const{qData:r,qArea:n}=e;return Xr(n,[],r,t)})(e[0],r))),[e,r]),l=b((()=>e.slice(1).reduce(((e,t)=>Zr({prevData:e,nextDataPage:t})),((e,t)=>{const{qHyperCube:r}=t.layout,{qArea:n,qTop:o}=e,{qEffectiveInterColumnSortOrder:i,qNoOfLeftDims:a}=r,l=Kr([],o,n,t.isSnapshot);Wr(l,"x",t.size);const s=l.map(Gr(a,i));return{grid:l,dimensionInfoIndexMap:s,rowCount:l.length,layoutSize:t.size}})(e[0],t))),[t,e]),s=b((()=>e.slice(1).reduce(((e,t)=>Yr({prevData:e,nextDataPage:t,pageInfo:r})),((e,t,r)=>{const{qHyperCube:n}=t.layout,{qArea:o,qLeft:i}=e,{qEffectiveInterColumnSortOrder:a}=n,l=jr([],i,o,r,t.isSnapshot);Wr(l,"y",t.size);const s=l.map(Gr(0,a));return{grid:l,dimensionInfoIndexMap:s,columnCount:l.length,layoutSize:t.size}})(e[0],t,r))),[t,e,r]),[u,c]=q((()=>a())),[d,p]=q((()=>l())),[f,m]=q((()=>s()));Qr((()=>{c(a())}),[a]),Qr((()=>{p(l())}),[l]),Qr((()=>{m(s())}),[s]),Qr((()=>{o&&(c((e=>Jr({prevData:e,nextDataPage:o,pageInfo:r}))),p((e=>Zr({prevData:e,nextDataPage:o}))),m((e=>Yr({prevData:e,nextDataPage:o,pageInfo:r}))))}),[o]);const h=g((()=>Vr(n,d.rowCount,f.dimensionInfoIndexMap)),[n,d.rowCount,f.dimensionInfoIndexMap]),y=b((e=>{i(e)}),[]);return{headersData:h,measureData:u,topDimensionData:d,leftDimensionData:f,nextPageHandler:y}};const tn=({width:e,height:t,children:r})=>m.createElement("div",{"data-testid":"full-size-container",style:{display:"block",width:e,height:t}},r),rn=(e,t)=>{const{rect:r,children:n,onScroll:o,constraints:i}=e;return m.createElement("div",{ref:t,"data-testid":"scrollable-container",style:{overflow:i.active?"hidden":"auto",width:r.width,height:r.height},onScroll:o},n)};var nn=m.forwardRef(rn);const on=({rect:e,children:t,leftColumnsWidth:r,rightColumnsWidth:n,topRowsHeight:o,bottomRowsHeight:i})=>m.createElement("div",{"data-testid":"sticky-container",style:{display:"grid",position:"sticky",top:0,left:0,gridTemplateColumns:r?`${r}px ${n}px`:`${n}px`,gridTemplateRows:`${o}px ${i}px`,width:e.width,height:e.height}},t);function an(){return an=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},an.apply(this,arguments)}function ln(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sn(e,t){return sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},sn(e,t)}function un(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,sn(e,t)}var cn=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function dn(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(n=e[r],o=t[r],!(n===o||cn(n)&&cn(o)))return!1;var n,o;return!0}function pn(e,t){var r;void 0===t&&(t=dn);var n,o=[],i=!1;return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return i&&r===this&&t(a,o)||(n=e.apply(this,a),i=!0,r=this,o=a),n}}function fn(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}var mn="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function hn(e){cancelAnimationFrame(e.id)}function yn(e,t){var r=mn();var n={id:requestAnimationFrame((function o(){mn()-r>=t?e.call(null):n.id=requestAnimationFrame(o)}))};return n}var vn=-1;function gn(e){if(void 0===e&&(e=!1),-1===vn||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),vn=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return vn}var bn=null;function qn(e){if(void 0===e&&(e=!1),null===bn||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),o=n.style;return o.width="100px",o.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?bn="positive-descending":(t.scrollLeft=1,bn=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),bn}return bn}var xn=function(e){var t=e.columnIndex;return e.data,e.rowIndex+":"+t};function Cn(e){var t,r=e.getColumnOffset,n=e.getColumnStartIndexForOffset,o=e.getColumnStopIndexForStartIndex,i=e.getColumnWidth,a=e.getEstimatedTotalHeight,l=e.getEstimatedTotalWidth,s=e.getOffsetForColumnAndAlignment,u=e.getOffsetForRowAndAlignment,c=e.getRowHeight,d=e.getRowOffset,p=e.getRowStartIndexForOffset,f=e.getRowStopIndexForStartIndex,m=e.initInstanceProps,h=e.shouldResetStyleCacheOnItemSizeChange,y=e.validateProps;return(t=function(e){function t(t){var n;return(n=e.call(this,t)||this)._instanceProps=m(n.props,ln(n)),n._resetIsScrollingTimeoutId=null,n._outerRef=void 0,n.state={instance:ln(n),isScrolling:!1,horizontalScrollDirection:"forward",scrollLeft:"number"==typeof n.props.initialScrollLeft?n.props.initialScrollLeft:0,scrollTop:"number"==typeof n.props.initialScrollTop?n.props.initialScrollTop:0,scrollUpdateWasRequested:!1,verticalScrollDirection:"forward"},n._callOnItemsRendered=void 0,n._callOnItemsRendered=pn((function(e,t,r,o,i,a,l,s){return n.props.onItemsRendered({overscanColumnStartIndex:e,overscanColumnStopIndex:t,overscanRowStartIndex:r,overscanRowStopIndex:o,visibleColumnStartIndex:i,visibleColumnStopIndex:a,visibleRowStartIndex:l,visibleRowStopIndex:s})})),n._callOnScroll=void 0,n._callOnScroll=pn((function(e,t,r,o,i){return n.props.onScroll({horizontalScrollDirection:r,scrollLeft:e,scrollTop:t,verticalScrollDirection:o,scrollUpdateWasRequested:i})})),n._getItemStyle=void 0,n._getItemStyle=function(e,t){var o,a=n.props,l=a.columnWidth,s=a.direction,u=a.rowHeight,p=n._getItemStyleCache(h&&l,h&&s,h&&u),f=e+":"+t;if(p.hasOwnProperty(f))o=p[f];else{var m=r(n.props,t,n._instanceProps),y="rtl"===s;p[f]=o={position:"absolute",left:y?void 0:m,right:y?m:void 0,top:d(n.props,e,n._instanceProps),height:c(n.props,e,n._instanceProps),width:i(n.props,t,n._instanceProps)}}return o},n._getItemStyleCache=void 0,n._getItemStyleCache=pn((function(e,t,r){return{}})),n._onScroll=function(e){var t=e.currentTarget,r=t.clientHeight,o=t.clientWidth,i=t.scrollLeft,a=t.scrollTop,l=t.scrollHeight,s=t.scrollWidth;n.setState((function(e){if(e.scrollLeft===i&&e.scrollTop===a)return null;var t=n.props.direction,u=i;if("rtl"===t)switch(qn()){case"negative":u=-i;break;case"positive-descending":u=s-o-i}u=Math.max(0,Math.min(u,s-o));var c=Math.max(0,Math.min(a,l-r));return{isScrolling:!0,horizontalScrollDirection:e.scrollLeft<i?"forward":"backward",scrollLeft:u,scrollTop:c,verticalScrollDirection:e.scrollTop<a?"forward":"backward",scrollUpdateWasRequested:!1}}),n._resetIsScrollingDebounced)},n._outerRefSetter=function(e){var t=n.props.outerRef;n._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},n._resetIsScrollingDebounced=function(){null!==n._resetIsScrollingTimeoutId&&hn(n._resetIsScrollingTimeoutId),n._resetIsScrollingTimeoutId=yn(n._resetIsScrolling,150)},n._resetIsScrolling=function(){n._resetIsScrollingTimeoutId=null,n.setState({isScrolling:!1},(function(){n._getItemStyleCache(-1)}))},n}un(t,e),t.getDerivedStateFromProps=function(e,t){return Dn(e,t),y(e),null};var v=t.prototype;return v.scrollTo=function(e){var t=e.scrollLeft,r=e.scrollTop;void 0!==t&&(t=Math.max(0,t)),void 0!==r&&(r=Math.max(0,r)),this.setState((function(e){return void 0===t&&(t=e.scrollLeft),void 0===r&&(r=e.scrollTop),e.scrollLeft===t&&e.scrollTop===r?null:{horizontalScrollDirection:e.scrollLeft<t?"forward":"backward",scrollLeft:t,scrollTop:r,scrollUpdateWasRequested:!0,verticalScrollDirection:e.scrollTop<r?"forward":"backward"}}),this._resetIsScrollingDebounced)},v.scrollToItem=function(e){var t=e.align,r=void 0===t?"auto":t,n=e.columnIndex,o=e.rowIndex,i=this.props,c=i.columnCount,d=i.height,p=i.rowCount,f=i.width,m=this.state,h=m.scrollLeft,y=m.scrollTop,v=gn();void 0!==n&&(n=Math.max(0,Math.min(n,c-1))),void 0!==o&&(o=Math.max(0,Math.min(o,p-1)));var g=a(this.props,this._instanceProps),b=l(this.props,this._instanceProps)>f?v:0,q=g>d?v:0;this.scrollTo({scrollLeft:void 0!==n?s(this.props,n,r,h,this._instanceProps,q):h,scrollTop:void 0!==o?u(this.props,o,r,y,this._instanceProps,b):y})},v.componentDidMount=function(){var e=this.props,t=e.initialScrollLeft,r=e.initialScrollTop;if(null!=this._outerRef){var n=this._outerRef;"number"==typeof t&&(n.scrollLeft=t),"number"==typeof r&&(n.scrollTop=r)}this._callPropsCallbacks()},v.componentDidUpdate=function(){var e=this.props.direction,t=this.state,r=t.scrollLeft,n=t.scrollTop;if(t.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("rtl"===e)switch(qn()){case"negative":o.scrollLeft=-r;break;case"positive-ascending":o.scrollLeft=r;break;default:var i=o.clientWidth,a=o.scrollWidth;o.scrollLeft=a-i-r}else o.scrollLeft=Math.max(0,r);o.scrollTop=Math.max(0,n)}this._callPropsCallbacks()},v.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&hn(this._resetIsScrollingTimeoutId)},v.render=function(){var e=this.props,t=e.children,r=e.className,n=e.columnCount,o=e.direction,i=e.height,s=e.innerRef,u=e.innerElementType,c=e.innerTagName,d=e.itemData,p=e.itemKey,f=void 0===p?xn:p,m=e.outerElementType,h=e.outerTagName,y=e.rowCount,v=e.style,g=e.useIsScrolling,b=e.width,q=this.state.isScrolling,C=this._getHorizontalRangeToRender(),D=C[0],w=C[1],S=this._getVerticalRangeToRender(),I=S[0],M=S[1],L=[];if(n>0&&y)for(var E=I;E<=M;E++)for(var T=D;T<=w;T++)L.push(x(t,{columnIndex:T,data:d,isScrolling:g?q:void 0,key:f({columnIndex:T,data:d,rowIndex:E}),rowIndex:E,style:this._getItemStyle(E,T)}));var A=a(this.props,this._instanceProps),P=l(this.props,this._instanceProps);return x(m||h||"div",{className:r,onScroll:this._onScroll,ref:this._outerRefSetter,style:an({position:"relative",height:i,width:b,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},v)},x(u||c||"div",{children:L,ref:s,style:{height:A,pointerEvents:q?"none":void 0,width:P}}))},v._callPropsCallbacks=function(){var e=this.props,t=e.columnCount,r=e.onItemsRendered,n=e.onScroll,o=e.rowCount;if("function"==typeof r&&t>0&&o>0){var i=this._getHorizontalRangeToRender(),a=i[0],l=i[1],s=i[2],u=i[3],c=this._getVerticalRangeToRender(),d=c[0],p=c[1],f=c[2],m=c[3];this._callOnItemsRendered(a,l,d,p,s,u,f,m)}if("function"==typeof n){var h=this.state,y=h.horizontalScrollDirection,v=h.scrollLeft,g=h.scrollTop,b=h.scrollUpdateWasRequested,q=h.verticalScrollDirection;this._callOnScroll(v,g,y,q,b)}},v._getHorizontalRangeToRender=function(){var e=this.props,t=e.columnCount,r=e.overscanColumnCount,i=e.overscanColumnsCount,a=e.overscanCount,l=e.rowCount,s=this.state,u=s.horizontalScrollDirection,c=s.isScrolling,d=s.scrollLeft,p=r||i||a||1;if(0===t||0===l)return[0,0,0,0];var f=n(this.props,d,this._instanceProps),m=o(this.props,f,d,this._instanceProps),h=c&&"backward"!==u?1:Math.max(1,p),y=c&&"forward"!==u?1:Math.max(1,p);return[Math.max(0,f-h),Math.max(0,Math.min(t-1,m+y)),f,m]},v._getVerticalRangeToRender=function(){var e=this.props,t=e.columnCount,r=e.overscanCount,n=e.overscanRowCount,o=e.overscanRowsCount,i=e.rowCount,a=this.state,l=a.isScrolling,s=a.verticalScrollDirection,u=a.scrollTop,c=n||o||r||1;if(0===t||0===i)return[0,0,0,0];var d=p(this.props,u,this._instanceProps),m=f(this.props,d,u,this._instanceProps),h=l&&"backward"!==s?1:Math.max(1,c),y=l&&"forward"!==s?1:Math.max(1,c);return[Math.max(0,d-h),Math.max(0,Math.min(i-1,m+y)),d,m]},t}(C)).defaultProps={direction:"ltr",itemData:void 0,useIsScrolling:!1},t}var Dn=function(e,t){e.children,e.direction,e.height,e.innerTagName,e.outerTagName,e.overscanColumnsCount,e.overscanCount,e.overscanRowsCount,e.width,t.instance},wn=function(e,t){var r=e.rowCount,n=t.rowMetadataMap,o=t.estimatedRowHeight,i=t.lastMeasuredRowIndex,a=0;if(i>=r&&(i=r-1),i>=0){var l=n[i];a=l.offset+l.size}return a+(r-i-1)*o},Sn=function(e,t){var r=e.columnCount,n=t.columnMetadataMap,o=t.estimatedColumnWidth,i=t.lastMeasuredColumnIndex,a=0;if(i>=r&&(i=r-1),i>=0){var l=n[i];a=l.offset+l.size}return a+(r-i-1)*o},In=function(e,t,r,n){var o,i,a;if("column"===e?(o=n.columnMetadataMap,i=t.columnWidth,a=n.lastMeasuredColumnIndex):(o=n.rowMetadataMap,i=t.rowHeight,a=n.lastMeasuredRowIndex),r>a){var l=0;if(a>=0){var s=o[a];l=s.offset+s.size}for(var u=a+1;u<=r;u++){var c=i(u);o[u]={offset:l,size:c},l+=c}"column"===e?n.lastMeasuredColumnIndex=r:n.lastMeasuredRowIndex=r}return o[r]},Mn=function(e,t,r,n){var o,i;return"column"===e?(o=r.columnMetadataMap,i=r.lastMeasuredColumnIndex):(o=r.rowMetadataMap,i=r.lastMeasuredRowIndex),(i>0?o[i].offset:0)>=n?Ln(e,t,r,i,0,n):En(e,t,r,Math.max(0,i),n)},Ln=function(e,t,r,n,o,i){for(;o<=n;){var a=o+Math.floor((n-o)/2),l=In(e,t,a,r).offset;if(l===i)return a;l<i?o=a+1:l>i&&(n=a-1)}return o>0?o-1:0},En=function(e,t,r,n,o){for(var i="column"===e?t.columnCount:t.rowCount,a=1;n<i&&In(e,t,n,r).offset<o;)n+=a,a*=2;return Ln(e,t,r,Math.min(n,i-1),Math.floor(n/2),o)},Tn=function(e,t,r,n,o,i,a){var l="column"===e?t.width:t.height,s=In(e,t,r,i),u="column"===e?Sn(t,i):wn(t,i),c=Math.max(0,Math.min(u-l,s.offset)),d=Math.max(0,s.offset-l+a+s.size);switch("smart"===n&&(n=o>=d-l&&o<=c+l?"auto":"center"),n){case"start":return c;case"end":return d;case"center":return Math.round(d+(c-d)/2);default:return o>=d&&o<=c?o:d>c||o<d?d:c}},An=Cn({getColumnOffset:function(e,t,r){return In("column",e,t,r).offset},getColumnStartIndexForOffset:function(e,t,r){return Mn("column",e,r,t)},getColumnStopIndexForStartIndex:function(e,t,r,n){for(var o=e.columnCount,i=e.width,a=In("column",e,t,n),l=r+i,s=a.offset+a.size,u=t;u<o-1&&s<l;)u++,s+=In("column",e,u,n).size;return u},getColumnWidth:function(e,t,r){return r.columnMetadataMap[t].size},getEstimatedTotalHeight:wn,getEstimatedTotalWidth:Sn,getOffsetForColumnAndAlignment:function(e,t,r,n,o,i){return Tn("column",e,t,r,n,o,i)},getOffsetForRowAndAlignment:function(e,t,r,n,o,i){return Tn("row",e,t,r,n,o,i)},getRowOffset:function(e,t,r){return In("row",e,t,r).offset},getRowHeight:function(e,t,r){return r.rowMetadataMap[t].size},getRowStartIndexForOffset:function(e,t,r){return Mn("row",e,r,t)},getRowStopIndexForStartIndex:function(e,t,r,n){for(var o=e.rowCount,i=e.height,a=In("row",e,t,n),l=r+i,s=a.offset+a.size,u=t;u<o-1&&s<l;)u++,s+=In("row",e,u,n).size;return u},initInstanceProps:function(e,t){var r=e,n={columnMetadataMap:{},estimatedColumnWidth:r.estimatedColumnWidth||50,estimatedRowHeight:r.estimatedRowHeight||50,lastMeasuredColumnIndex:-1,lastMeasuredRowIndex:-1,rowMetadataMap:{}};return t.resetAfterColumnIndex=function(e,r){void 0===r&&(r=!0),t.resetAfterIndices({columnIndex:e,shouldForceUpdate:r})},t.resetAfterRowIndex=function(e,r){void 0===r&&(r=!0),t.resetAfterIndices({rowIndex:e,shouldForceUpdate:r})},t.resetAfterIndices=function(e){var r=e.columnIndex,o=e.rowIndex,i=e.shouldForceUpdate,a=void 0===i||i;"number"==typeof r&&(n.lastMeasuredColumnIndex=Math.min(n.lastMeasuredColumnIndex,r-1)),"number"==typeof o&&(n.lastMeasuredRowIndex=Math.min(n.lastMeasuredRowIndex,o-1)),t._getItemStyleCache(-1),a&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.columnWidth,e.rowHeight}}),Pn=function(e,t){return e};function On(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,o=e.getItemSize,i=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,l=e.getStopIndexForStartIndex,s=e.initInstanceProps,u=e.shouldResetStyleCacheOnItemSizeChange,c=e.validateProps;return t=function(e){function t(t){var n;return(n=e.call(this,t)||this)._instanceProps=s(n.props,ln(n)),n._outerRef=void 0,n._resetIsScrollingTimeoutId=null,n.state={instance:ln(n),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof n.props.initialScrollOffset?n.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},n._callOnItemsRendered=void 0,n._callOnItemsRendered=pn((function(e,t,r,o){return n.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:r,visibleStopIndex:o})})),n._callOnScroll=void 0,n._callOnScroll=pn((function(e,t,r){return n.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:r})})),n._getItemStyle=void 0,n._getItemStyle=function(e){var t,i=n.props,a=i.direction,l=i.itemSize,s=i.layout,c=n._getItemStyleCache(u&&l,u&&s,u&&a);if(c.hasOwnProperty(e))t=c[e];else{var d=r(n.props,e,n._instanceProps),p=o(n.props,e,n._instanceProps),f="horizontal"===a||"horizontal"===s,m="rtl"===a,h=f?d:0;c[e]=t={position:"absolute",left:m?void 0:h,right:m?h:void 0,top:f?0:d,height:f?"100%":p,width:f?p:"100%"}}return t},n._getItemStyleCache=void 0,n._getItemStyleCache=pn((function(e,t,r){return{}})),n._onScrollHorizontal=function(e){var t=e.currentTarget,r=t.clientWidth,o=t.scrollLeft,i=t.scrollWidth;n.setState((function(e){if(e.scrollOffset===o)return null;var t=n.props.direction,a=o;if("rtl"===t)switch(qn()){case"negative":a=-o;break;case"positive-descending":a=i-r-o}return a=Math.max(0,Math.min(a,i-r)),{isScrolling:!0,scrollDirection:e.scrollOffset<o?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!1}}),n._resetIsScrollingDebounced)},n._onScrollVertical=function(e){var t=e.currentTarget,r=t.clientHeight,o=t.scrollHeight,i=t.scrollTop;n.setState((function(e){if(e.scrollOffset===i)return null;var t=Math.max(0,Math.min(i,o-r));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}}),n._resetIsScrollingDebounced)},n._outerRefSetter=function(e){var t=n.props.outerRef;n._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},n._resetIsScrollingDebounced=function(){null!==n._resetIsScrollingTimeoutId&&hn(n._resetIsScrollingTimeoutId),n._resetIsScrollingTimeoutId=yn(n._resetIsScrolling,150)},n._resetIsScrolling=function(){n._resetIsScrollingTimeoutId=null,n.setState({isScrolling:!1},(function(){n._getItemStyleCache(-1,null)}))},n}un(t,e),t.getDerivedStateFromProps=function(e,t){return Nn(e,t),c(e),null};var d=t.prototype;return d.scrollTo=function(e){e=Math.max(0,e),this.setState((function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}}),this._resetIsScrollingDebounced)},d.scrollToItem=function(e,t){void 0===t&&(t="auto");var r=this.props,n=r.itemCount,o=r.layout,a=this.state.scrollOffset;e=Math.max(0,Math.min(e,n-1));var l=0;if(this._outerRef){var s=this._outerRef;l="vertical"===o?s.scrollWidth>s.clientWidth?gn():0:s.scrollHeight>s.clientHeight?gn():0}this.scrollTo(i(this.props,e,t,a,this._instanceProps,l))},d.componentDidMount=function(){var e=this.props,t=e.direction,r=e.initialScrollOffset,n=e.layout;if("number"==typeof r&&null!=this._outerRef){var o=this._outerRef;"horizontal"===t||"horizontal"===n?o.scrollLeft=r:o.scrollTop=r}this._callPropsCallbacks()},d.componentDidUpdate=function(){var e=this.props,t=e.direction,r=e.layout,n=this.state,o=n.scrollOffset;if(n.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("horizontal"===t||"horizontal"===r)if("rtl"===t)switch(qn()){case"negative":i.scrollLeft=-o;break;case"positive-ascending":i.scrollLeft=o;break;default:var a=i.clientWidth,l=i.scrollWidth;i.scrollLeft=l-a-o}else i.scrollLeft=o;else i.scrollTop=o}this._callPropsCallbacks()},d.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&hn(this._resetIsScrollingTimeoutId)},d.render=function(){var e=this.props,t=e.children,r=e.className,o=e.direction,i=e.height,a=e.innerRef,l=e.innerElementType,s=e.innerTagName,u=e.itemCount,c=e.itemData,d=e.itemKey,p=void 0===d?Pn:d,f=e.layout,m=e.outerElementType,h=e.outerTagName,y=e.style,v=e.useIsScrolling,g=e.width,b=this.state.isScrolling,q="horizontal"===o||"horizontal"===f,C=q?this._onScrollHorizontal:this._onScrollVertical,D=this._getRangeToRender(),w=D[0],S=D[1],I=[];if(u>0)for(var M=w;M<=S;M++)I.push(x(t,{data:c,key:p(M,c),index:M,isScrolling:v?b:void 0,style:this._getItemStyle(M)}));var L=n(this.props,this._instanceProps);return x(m||h||"div",{className:r,onScroll:C,ref:this._outerRefSetter,style:an({position:"relative",height:i,width:g,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},y)},x(l||s||"div",{children:I,ref:a,style:{height:q?"100%":L,pointerEvents:b?"none":void 0,width:q?L:"100%"}}))},d._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],r=e[1],n=e[2],o=e[3];this._callOnItemsRendered(t,r,n,o)}if("function"==typeof this.props.onScroll){var i=this.state,a=i.scrollDirection,l=i.scrollOffset,s=i.scrollUpdateWasRequested;this._callOnScroll(a,l,s)}},d._getRangeToRender=function(){var e=this.props,t=e.itemCount,r=e.overscanCount,n=this.state,o=n.isScrolling,i=n.scrollDirection,s=n.scrollOffset;if(0===t)return[0,0,0,0];var u=a(this.props,s,this._instanceProps),c=l(this.props,u,s,this._instanceProps),d=o&&"backward"!==i?1:Math.max(1,r),p=o&&"forward"!==i?1:Math.max(1,r);return[Math.max(0,u-d),Math.max(0,Math.min(t-1,c+p)),u,c]},t}(C),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Nn=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},Fn=function(e,t,r){var n=e.itemSize,o=r.itemMetadataMap,i=r.lastMeasuredIndex;if(t>i){var a=0;if(i>=0){var l=o[i];a=l.offset+l.size}for(var s=i+1;s<=t;s++){var u=n(s);o[s]={offset:a,size:u},a+=u}r.lastMeasuredIndex=t}return o[t]},kn=function(e,t,r,n,o){for(;n<=r;){var i=n+Math.floor((r-n)/2),a=Fn(e,i,t).offset;if(a===o)return i;a<o?n=i+1:a>o&&(r=i-1)}return n>0?n-1:0},Hn=function(e,t,r,n){for(var o=e.itemCount,i=1;r<o&&Fn(e,r,t).offset<n;)r+=i,i*=2;return kn(e,t,Math.min(r,o-1),Math.floor(r/2),n)},_n=function(e,t){var r=e.itemCount,n=t.itemMetadataMap,o=t.estimatedItemSize,i=t.lastMeasuredIndex,a=0;if(i>=r&&(i=r-1),i>=0){var l=n[i];a=l.offset+l.size}return a+(r-i-1)*o},Rn=On({getItemOffset:function(e,t,r){return Fn(e,t,r).offset},getItemSize:function(e,t,r){return r.itemMetadataMap[t].size},getEstimatedTotalSize:_n,getOffsetForIndexAndAlignment:function(e,t,r,n,o,i){var a=e.direction,l=e.height,s=e.layout,u=e.width,c="horizontal"===a||"horizontal"===s?u:l,d=Fn(e,t,o),p=_n(e,o),f=Math.max(0,Math.min(p-c,d.offset)),m=Math.max(0,d.offset-c+d.size+i);switch("smart"===r&&(r=n>=m-c&&n<=f+c?"auto":"center"),r){case"start":return f;case"end":return m;case"center":return Math.round(m+(f-m)/2);default:return n>=m&&n<=f?n:n<m?m:f}},getStartIndexForOffset:function(e,t,r){return function(e,t,r){var n=t.itemMetadataMap,o=t.lastMeasuredIndex;return(o>0?n[o].offset:0)>=r?kn(e,t,o,0,r):Hn(e,t,Math.max(0,o),r)}(e,r,t)},getStopIndexForStartIndex:function(e,t,r,n){for(var o=e.direction,i=e.height,a=e.itemCount,l=e.layout,s=e.width,u="horizontal"===o||"horizontal"===l?s:i,c=Fn(e,t,n),d=r+u,p=c.offset+c.size,f=t;f<a-1&&p<d;)f++,p+=Fn(e,f,n).size;return f},initInstanceProps:function(e,t){var r={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,n){void 0===n&&(n=!0),r.lastMeasuredIndex=Math.min(r.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),n&&t.forceUpdate()},r},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.itemSize}});function Vn(e,t){for(var r in e)if(!(r in t))return!0;for(var n in t)if(e[n]!==t[n])return!0;return!1}var zn=["style"],jn=["style"];function Wn(e,t){var r=e.style,n=fn(e,zn),o=t.style,i=fn(t,jn);return!Vn(r,o)&&!Vn(n,i)}const Bn=({style:e,index:t,isLastRow:r,isLastColumn:n})=>{const{grid:{border:o}}=Mr();return m.createElement("div",{style:{...e,...lr(r,n,o)},"data-testid":"empty-cell","data-index":t})},$n={display:"flex",flexDirection:"row",alignItems:"center",height:"100%"},Un={alignItems:"center",display:"flex",flexDirection:"row",height:"100%",backgroundClip:"padding-box"},Gn={justifyContent:"center"},Yn=({columnIndex:e,rowIndex:t,style:r,data:n})=>{var o;const i=Mr(),{fontFamily:a,fontSize:l,color:s,background:u}=i.content,{grid:c,layoutService:d}=n,p=null===(o=c[t])||void 0===o?void 0:o[e],f=t===d.size.y-1,h=e===d.size.x-1;if(!p)return m.createElement(Bn,{style:{...r,background:u},isLastRow:f,isLastColumn:h});const{qText:y,qType:v}=p,g=v===Ur.NX_DIM_CELL_NULL,b=g?d.getNullValueText():y,q=!g||!Number.isNaN(+b),x={...g?{...Un,...i.content.nullValue}:{...$n,color:s,background:u},...lr(f,h,i.grid.border),display:"flex",justifyContent:q?"flex-end":"center"};return m.createElement("div",{title:b,style:{...r,...Gn},"data-testid":"measure-cell"},m.createElement("div",{style:x},m.createElement("span",{style:{...nr,...!q&&(C=i.lineClamp,{overflow:"hidden",textOverflow:"ellipsis",...ir(C)}),alignSelf:"flex-start",fontFamily:a,fontSize:l}},b)));var C};var Xn=m.memo(Yn,Wn);const Jn={...or,overflow:"hidden",boxSizing:"content-box"},Kn={...Jn,borderWidth:"1px 0px 0px 1px"},Zn={...Jn,borderWidth:"1px 0px 0px 0px"},Qn=function(e){var t,r,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,i=0;return function(){t=this;for(var a=arguments.length,l=new Array(a),s=0;s<a;s++)l[s]=arguments[s];r=l;var u=Date.now()-i,c=function(){i=Date.now(),n=0,e.apply(t,r)};n||(u>=o?c():n=setTimeout(c,o-u))}}((async(e,t,r,n,o,i)=>{((e,t,r,n,o)=>{for(let a=n;a<=o;a++)for(let n=t;n<=r;n++){var i;if(null===(i=e[a])||void 0===i||!i[n])return!0}return!1})(t,r,n,o,i)&&await e.fetchMoreData(r,o,n-r+1,i-o+1)}),100);var eo=D((({dataModel:e,dataGridRef:t,getMeasureInfoWidth:r,height:n,rowHightCallback:o,width:i,viewService:a,layoutService:l,measureData:s})=>{const{grid:{divider:u},contentCellHeight:c}=Mr(),{qMeasureInfo:d}=l.layout.qHyperCube,p={...l.hasLeftDimensions?Kn:Zn,borderColor:u,willChange:"auto"};Qr((()=>{t.current&&t.current.resetAfterColumnIndex(0,!1)}),[t,e,s]),w((()=>{t.current&&t.current.resetAfterIndices({columnIndex:0,rowIndex:0,shouldForceUpdate:!0})}),[i,n,t,c]);const f=b((async({overscanColumnStartIndex:t,overscanColumnStopIndex:r,overscanRowStartIndex:n,overscanRowStopIndex:o,visibleColumnStartIndex:i})=>{a.gridColumnStartIndex=i,a.gridRowStartIndex=n,a.gridWidth=r-t+1,a.gridHeight=o-n+1,await Qn(e,s,t,r,n,o)}),[a,e,s]),h=b((e=>r(l.getMeasureInfoIndexFromCellIndex(e))),[r,l]),y=g((()=>d.reduce(((e,t,n)=>e+r(n)),0)),[r,d]);return 0===l.size.x?null:m.createElement(An,{ref:t,style:p,columnCount:l.size.x,columnWidth:h,height:n,rowCount:l.size.y,rowHeight:o,width:i,itemData:{layoutService:l,grid:s,dataModel:e},onItemsRendered:f,estimatedRowHeight:o(),estimatedColumnWidth:y/d.length},Xn)}));const to={...nr,fontWeight:"600",alignSelf:"flex-end",flexGrow:1},ro=({cell:e,style:t,isLastColumn:r})=>{const n=Mr(),{fontSize:o,fontFamily:i}=n.header;return m.createElement("div",{title:e,style:{...t,...lr(!0,r,n.grid.border),...n.header.rowTitle,display:"flex"},"data-testid":"title-cell"},m.createElement("div",{style:{...to,fontSize:o,fontFamily:i}},e))},no={backgroundColor:"transparent",height:"100%",width:"100%"},oo=({columnWidths:e})=>m.createElement("div",{style:{gridColumn:`span ${e.length}`}},m.createElement("div",{style:no})),io={display:"grid",background:"red"};var ao=D((({columnWidthCallback:e,rowHight:t,headersData:r})=>{const n=Mr();if(0===r.size.x)return null;const o=r.size.y>1,i=r.data.map(((t,r)=>e(r)));return m.createElement("div",{style:{...io,gridTemplateColumns:i.map((e=>`${e}px`)).join(" "),gridTemplateRows:o?`1fr ${t}px`:void 0,background:n.header.background}},o&&m.createElement(oo,{columnWidths:i}),r.data.map(((e,n)=>{const o=e[e.length-1];return m.createElement(ro,{key:o.id,cell:o.title,style:{width:i[n],height:t},isLastColumn:n===r.size.x-1})})))}));const lo=h({select:()=>()=>Promise.resolve(),isSelected:()=>!1,isActive:!1,isLocked:()=>!1}),so=({children:e,selections:t})=>{const r=function(e){const t=e.isActive(),[r,n]=q([]);S((()=>{const t=()=>n([]),r=()=>n([]);return e.on("deactivated",t),e.on("canceled",r),e.on("confirmed",r),e.on("cleared",t),()=>{e.removeListener("deactivated",t),e.removeListener("canceled",r),e.removeListener("confirmed",r),e.removeListener("cleared",t)}}),[e]);const o=b(((e,t,n)=>{switch(e){case $r.NX_CELL_LEFT:return!!r.find((e=>e.qType===$r.NX_CELL_TOP||e.qType===$r.NX_CELL_LEFT&&e.qCol!==n));case $r.NX_CELL_TOP:return!!r.find((e=>e.qType===$r.NX_CELL_LEFT||e.qType===$r.NX_CELL_TOP&&e.qRow!==t));default:return!1}}),[r]),i=b(((t,r,i)=>async()=>{e.isActive()||await e.begin([Nr]),o(t,r,i)||n((n=>{const o=[...n],a=o.findIndex((e=>e.qType===t&&e.qRow===r&&e.qCol===i));return a>-1?o.splice(a,1):o.push({qType:t,qRow:r,qCol:i}),e.select({method:"selectPivotCells",params:[Nr,o]}).catch((()=>{})),o}))}),[e,o]),a=b(((e,t,n)=>!!r.find((r=>r.qType===e&&r.qRow===t&&r.qCol===n))),[r]);return g((()=>({select:i,isSelected:a,isActive:t,isLocked:o})),[i,a,t,o])}(t);return m.createElement(lo.Provider,{value:r},e)};function uo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const co=(e,t)=>m.createElement("svg",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){uo(e,t,r[t])}))}return e}({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t},e),m.createElement("path",{d:"M8 15c-3.848 0-7-3.152-7-7s3.152-7 7-7 7 3.152 7 7-3.152 7-7 7Zm0 1c4.4 0 8-3.6 8-8s-3.6-8-8-8-8 3.6-8 8 3.6 8 8 8Zm4-7.5H4v-1h8v1Z"})),po=I(co),fo=({color:e,opacity:t,testid:r,onClick:n})=>m.createElement(po,{opacity:t,color:e,"data-testid":r,onClick:n,height:"13px"});function mo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ho=(e,t)=>m.createElement("svg",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){mo(e,t,r[t])}))}return e}({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t},e),m.createElement("path",{d:"M8 15c-3.848 0-7-3.152-7-7s3.152-7 7-7 7 3.152 7 7-3.152 7-7 7Zm0 1c4.4 0 8-3.6 8-8s-3.6-8-8-8-8 3.6-8 8 3.6 8 8 8Zm4-7.5H4v-1h8v1ZM8.5 4v8h-1V4h1Z"})),yo=I(ho),vo=({color:e,opacity:t,testid:r,onClick:n})=>m.createElement(yo,{opacity:t,color:e,"data-testid":r,onClick:n,height:"13px"}),go={background:"#0aaf54",color:"white"},bo={cursor:"pointer"},qo={backgroundImage:"repeating-linear-gradient(-45deg, #f8f8f8, #f8f8f8 2px, transparent 2px, transparent 4px)",color:"#bebebe"},xo={display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},Co=()=>{},Do=({dataModel:e,isLeftColumn:t,rowIndex:r,colIndex:n,constraints:o,isActive:i})=>{if(o.active||i||!e)return;const a=t?()=>e.expandLeft(r,n):()=>e.expandTop(r,n);return e=>{a(),e.stopPropagation()}},wo=({dataModel:e,isLeftColumn:t,rowIndex:r,colIndex:n,constraints:o,isActive:i})=>{if(o.active||i||!e)return;const a=t?()=>e.collapseLeft(r,n):()=>e.collapseTop(r,n);return e=>{a(),e.stopPropagation()}},So=({cell:e,rowIndex:t,colIndex:r,style:n,isLeftColumn:o,data:i,isLastRow:a,isLastColumn:l})=>{const{qText:s,qCanCollapse:u,qCanExpand:c,qType:d}=e.ref,{constraints:p={active:!1,passive:!1,select:!1},dataModel:f,layoutService:h}=i,v=Mr(),{select:g,isSelected:b,isActive:q,isLocked:x}=y(lo),C=d===Ur.NX_DIM_CELL_NULL,D=o?$r.NX_CELL_LEFT:$r.NX_CELL_TOP,w=x(D,t,r)||h.isDimensionLocked(D,t,r),S=w||d===Ur.NX_DIM_CELL_EMPTY||p.active||C,I=b(D,t,r),M=(({styleService:e,isLeftColumn:t,qCanCollapse:r,qCanExpand:n,isCellSelected:o,isNull:i})=>{const{nullValue:a,totalLabel:l,measureLabel:s,background:u,...c}=t?e.rowContent:e.columnContent;return{...c,...nr,...i&&{color:a.color},...o&&{color:go.color},fontWeight:n||r?"600":void 0,overflow:"hidden",textOverflow:"ellipsis",...ir(e.lineClamp)}})({isLeftColumn:o,styleService:v,qCanExpand:c,qCanCollapse:u,isCellSelected:I,isNull:C}),L=(e=>({...xo,...ar,alignSelf:e?"flex-start":"flex-end"}))(o),E=(({isCellLocked:e,isNull:t,style:r,isLastColumn:n,isLastRow:o,isNonSelectableCell:i,isCellSelected:a,styleService:l,isLeftColumn:s})=>{const u=a?go:{},c=e?qo:{},d=i?{}:bo,{nullValue:p,background:f}=s?l.rowContent:l.columnContent,m=t?p:{background:f};return{...r,...c,...d,...lr(o,n,l.grid.border),...m,...u,display:"flex"}})({style:n,isCellLocked:w,isNull:C,isLastColumn:l,isLastRow:a,isNonSelectableCell:S,isCellSelected:I,styleService:v,isLeftColumn:o}),T=S?void 0:g(D,e.dataY,r),A=C?h.getNullValueText():s,P=o?v.rowContent:v.columnContent;let O=null;return c?O=m.createElement(vo,{color:C?P.nullValue.color:P.color,opacity:q?.4:1,testid:"expand-icon",onClick:Do({dataModel:f,isLeftColumn:o,rowIndex:e.dataY,colIndex:r,constraints:p,isActive:q})}):u&&(O=m.createElement(fo,{color:C?P.nullValue.color:P.color,opacity:q?.4:1,testid:"collapse-icon",onClick:wo({dataModel:f,isLeftColumn:o,rowIndex:e.dataY,colIndex:r,constraints:p,isActive:q})})),m.createElement("div",{title:A,style:E,"aria-hidden":"true",onClick:T,onKeyUp:Co,role:"button",tabIndex:0,"data-testid":"dim-cell","data-row-idx":t,"data-column-idx":r},m.createElement("div",{style:L},O,m.createElement("span",{style:M},A)))},Io={display:"flex",justifyContent:"flex-start",alignItems:"flex-end"},Mo={display:"flex",alignItems:"flex-start"},Lo=({cell:e,style:t,isLeftColumn:r,isLastRow:n,isLastColumn:o})=>{const i=Mr(),a=r?{fontSize:i.rowContent.fontSize,fontFamily:i.rowContent.fontFamily,...i.rowContent.measureLabel}:{fontSize:i.columnContent.fontSize,fontFamily:i.columnContent.fontFamily,...i.columnContent.measureLabel},l=r?Mo:Io;return m.createElement("div",{title:e.ref.qText,style:{...t,...lr(n,o,i.grid.border),...l,...a},"data-testid":"pseudo-dimension-cell"},m.createElement("div",{style:{...(s=i.lineClamp,{...nr,overflow:"hidden",textOverflow:"ellipsis",...ir(s)}),...ar}},e.ref.qText));var s},Eo={...nr,fontWeight:"600"},To=({cell:e,style:t,isLeftColumn:r,isLastRow:n,isLastColumn:o})=>{const i=Mr(),a=r?i.rowContent.totalLabel:i.columnContent.totalLabel,{fontSize:l,fontFamily:s}=r?i.rowContent:i.columnContent;return m.createElement("div",{style:{...t,...lr(n,o,i.grid.border),...a},"data-testid":"totals-cell"},m.createElement("div",{style:{...Eo,fontSize:l,fontFamily:s}},e.ref.qText))},Ao=({index:e,style:t,data:r})=>{const n=Mr(),{list:o,isLeftColumn:i=!1,isLast:a,itemCount:l}=r,s=i?e===l-1:a,u=i?a:e===l-1,c=a?o[e]:Object.values(o)[e];if(void 0===c||c.ref.qType===Ur.NX_DIM_CELL_EMPTY){const r=i?n.rowContent.background:n.columnContent.background;return m.createElement(Bn,{style:{...t,background:r},index:e,isLastRow:s,isLastColumn:u})}return c.ref.qType===Ur.NX_DIM_CELL_PSEUDO?m.createElement(Lo,{cell:c,style:t,isLeftColumn:i,isLastRow:s,isLastColumn:u}):c.ref.qType===Ur.NX_DIM_CELL_TOTAL&&-1===c.ref.qElemNo?m.createElement(To,{cell:c,style:t,isLeftColumn:i,isLastRow:s,isLastColumn:u}):m.createElement(So,{cell:c,data:r,rowIndex:c.y,colIndex:c.x,style:t,isLeftColumn:i,isLastRow:s,isLastColumn:u})};var Po=m.memo(Ao,Wn);const Oo=(e,t)=>{var r;return`${null===(r=t.list[e])||void 0===r?void 0:r.ref.qElemNo}-${e}`},No=(e,t,r)=>n=>{const o=r?e[n]:Object.values(e)[n];return 0===n&&(null==o?void 0:o.y)>0?(o.leafCount+o.y)*t:(null==o?void 0:o.leafCount)>0?(o.leafCount+o.distanceToNextCell)*t:t},Fo=({list:e,isLastRow:t,layoutService:r,allMeasuresWidth:n,getMeasureInfoWidth:o})=>i=>{var a;const l=t?e[i]:Object.values(e)[i],s=r.layout.qHyperCube.qMeasureInfo.length;return 0===i&&(null==l?void 0:l.x)>0?(l.leafCount+l.x)/s*n:(null==l?void 0:l.leafCount)>0?(l.leafCount+l.distanceToNextCell)/s*n:o(r.getMeasureInfoIndexFromCellIndex(null!==(a=null==l?void 0:l.x)&&void 0!==a?a:i))},ko=(e,t)=>e===kr?"-1":`${t[e].qFallbackTitle}-${e}`,Ho=(e,t,r,n)=>{let o,i=Object.keys(e).length;return n&&(i=r,o=t/i),{itemCount:i,estimatedItemSize:o}},_o=(e,t)=>r=>{e.current&&(e.current[t]=r)},Ro={display:"flex",height:"fit-content",borderWidth:"1px 0px 0px 0px",...or},Vo={overflow:"hidden",willChange:"auto"};var zo=D((({dataModel:e,leftGridRef:t,getLeftColumnWidth:r,width:n,height:o,constraints:i,getScrollTop:a,layoutService:l,leftDimensionData:s})=>{const{qDimensionInfo:u}=l.layout.qHyperCube,{contentCellHeight:c,grid:{divider:d}}=Mr();Qr((()=>{t.current&&t.current.forEach((e=>null==e?void 0:e.resetAfterIndex(0,!1)))}),[e,n,o,s,t,c]),w((()=>{t.current&&t.current.forEach((e=>null==e?void 0:e.scrollTo(a())))}),[a,l,t]);const p=l.size.y*c;return 0===s.columnCount?null:m.createElement("div",{style:{...Ro,borderColor:d}},s.grid.map(((n,a)=>{const d=a===s.columnCount-1,{itemCount:f,estimatedItemSize:h}=Ho(n,p,l.size.y,d),y=ko(s.dimensionInfoIndexMap[a],u);return m.createElement(Rn,{key:y,ref:_o(t,a),style:Vo,height:o,width:r(a),itemCount:f,itemSize:No(n,c,d),layout:"vertical",itemData:{layoutService:l,dataModel:e,constraints:i,list:n,isLeftColumn:!0,isLast:d&&!l.layout.snapshotData,itemCount:f},itemKey:Oo,estimatedItemSize:h},Po)})))}));const jo={overflow:"hidden",willChange:"auto"},Wo={...or,borderWidth:"0px 0px 0px 1px"},Bo={...or,borderWidth:"0px"};var $o=D((({dataModel:e,topGridRef:t,getMeasureInfoWidth:r,rowHightCallback:n,width:o,height:i,constraints:a,getScrollLeft:l,layoutService:s,topDimensionData:u})=>{const{grid:{divider:c},headerCellHeight:d}=Mr(),{qMeasureInfo:p,qDimensionInfo:f}=s.layout.qHyperCube,h={...s.hasLeftDimensions?Wo:Bo,borderColor:c};Qr((()=>{t.current&&t.current.forEach((e=>null==e?void 0:e.resetAfterIndex(0,!1)))}),[e,o,i,u,t,d]),w((()=>{t.current&&t.current.forEach((e=>null==e?void 0:e.scrollTo(l())))}),[s,l,t]);const y=g((()=>p.reduce(((e,t,n)=>e+r(n)),0)),[r,p]),v=s.size.x*(y/p.length);return 0===u.rowCount?m.createElement("div",{style:{width:o,height:i,...Wo}}):m.createElement("div",{style:h},u.grid.map(((i,l)=>{const c=l===u.rowCount-1,{itemCount:d,estimatedItemSize:p}=Ho(i,v,s.size.x,c),h=ko(u.dimensionInfoIndexMap[l],f);return m.createElement(Rn,{key:h,ref:_o(t,l),style:jo,height:n(),width:o,itemCount:d,itemSize:Fo({list:i,isLastRow:c,layoutService:s,getMeasureInfoWidth:r,allMeasuresWidth:y}),layout:"horizontal",itemData:{layoutService:s,dataModel:e,constraints:a,list:i,isLast:c&&!s.layout.snapshotData,itemCount:d},itemKey:Oo,estimatedItemSize:p},Po)})))}));const Uo=({model:e,rect:t,constraints:r,viewService:n,layoutService:o,qPivotDataPages:i,pageInfo:a})=>{const{headerCellHeight:l,contentCellHeight:s}=Mr(),u=v(null),c=v([]),d=v([]),p=v(null),f=v(0),h=v(0),y=((e,t,r)=>g((()=>{let{height:n}=e;return t.hasLimitedData&&(n-=22),r&&(n-=28),{...e,height:n}}),[e,t,r]))(t,o,a.shouldShowPagination),{headersData:q,measureData:x,topDimensionData:C,leftDimensionData:D,nextPageHandler:S}=en(i,o,a),I=function({model:e,nextPageHandler:t,pageInfo:r}){const n=g((()=>({isLoading:!1})),[]),o=e,i=b((async(e,t)=>{var r;await(null==o||null===(r=o.collapseLeft)||void 0===r?void 0:r.call(o,Nr,e,t,!1))}),[o]),a=b((async(e,t)=>{await(null==o?void 0:o.collapseTop(Nr,e,t,!1))}),[o]),l=b((async(e,t)=>{await(null==o?void 0:o.expandLeft(Nr,e,t,!1))}),[o]),s=b((async(e,t)=>{await(null==o?void 0:o.expandTop(Nr,e,t,!1))}),[o]),u=b((async(e,i,a,l)=>{if(null==o||!o.getHyperCubePivotData)return!1;if(n.isLoading)return!1;n.isLoading=!0;try{const s={qLeft:e,qTop:r.currentPage*r.rowsPerPage+i,qWidth:a,qHeight:l},[u]=await o.getHyperCubePivotData(Nr,[s]);return t(u),n.isLoading=!1,!0}catch(e){return console.error(e),n.isLoading=!1,!1}}),[o,t,n,r]);return g((()=>({fetchMoreData:u,collapseLeft:i,collapseTop:a,expandLeft:l,expandTop:s})),[u,i,a,l,s])}({model:e,nextPageHandler:S,pageInfo:a}),{leftGridWidth:M,rightGridWidth:L,getLeftColumnWidth:E,getMeasureInfoWidth:T,getTotalWidth:A}=function(e,t,r){const n=Mr(),{estimateWidth:o,measureText:i}=Rr(n.content.fontSize,n.content.fontFamily),{measureText:a}=Rr(n.header.fontSize,n.header.fontFamily),{qDimensionInfo:l,qMeasureInfo:s,qNoOfLeftDims:u}=e.layout.qHyperCube,c=g((()=>r.dimensionInfoIndexMap.some((e=>e===kr))),[r.dimensionInfoIndexMap]),d=g((()=>{const e=r.dimensionInfoIndexMap.map(((e,r)=>{if(e===kr){const e=Math.max(...s.map((e=>i(e.qFallbackTitle))));return e/t.width}const{qFallbackTitle:n,qApprMaxGlyphCount:c}=l[e],d=r<u-1?30:0;return Math.max(a(n),o(c)+d)/t.width})),n=e.reduce(((e,t)=>e+t),0);if(n<.75)return e;const c=.75/n;return e.map((e=>e*c))}),[o,i,a,r.dimensionInfoIndexMap,t.width,l,s,u]),p=b((e=>d[e]*t.width),[d,t.width]),f=g((()=>r.grid.reduce(((e,t,r)=>e+p(r)),0)),[r.grid,p]),m=g((()=>Math.max(t.width-f-Jt)),[f,t.width]),h=g((()=>c?s.reduce(((e,{qApprMaxGlyphCount:t})=>Math.max(e,100,o(t))),0):s.reduce(((e,{qApprMaxGlyphCount:t,qFallbackTitle:r})=>e+Math.max(100,o(t),a(r))),0)),[s,o,a,c]),y=g((()=>Ze((t=>{const r=(t,r=!0)=>{const{qApprMaxGlyphCount:n,qFallbackTitle:i}=s[t],l=h>=m?0:m;return Math.max(100,l/e.size.x,o(n),r?a(i):0)};return c?Math.max(...s.map(((e,t)=>r(t,!1)))):r(t)}))),[m,e.size.x,h,o,a,s,c]),v=b((e=>{const t=e%s.length;return y(t)}),[y,s]),q=b((()=>Array.from({length:e.size.x},(()=>null)).reduce(((e,t,r)=>e+v(r)),f)),[v,f,e.size.x]),x=g((()=>s.reduce(((e,t,r)=>e+v(r)),0)),[s,v]);return{leftGridWidth:f,rightGridWidth:m,totalMeasureInfoColumnWidth:x,getLeftColumnWidth:p,getDataColumnWidth:v,getMeasureInfoWidth:y,getTotalWidth:q}}(o,y,D);w((()=>{o.layout.qHyperCube.qLastExpandedPos||u.current&&(u.current.scrollLeft=0,u.current.scrollTop=0)}),[o]),w((()=>{u.current&&(u.current.scrollLeft=0,u.current.scrollTop=0)}),[a.currentPage]);const P=b((()=>l),[l]),O=b((()=>s),[s]),N=b((()=>f.current),[f]),F=b((()=>h.current),[h]),k=o.size.y*s+Jt,H=k+l*C.rowCount,_=l*q.size.y,R=l*Math.max(C.rowCount,1),V=Math.min(y.height-_,k),z=Math.min(y.height-R,k);return m.createElement(nn,{ref:u,rect:y,onScroll:e=>{c.current&&c.current.forEach((t=>null==t?void 0:t.scrollTo(e.currentTarget.scrollLeft))),d.current&&d.current.forEach((t=>null==t?void 0:t.scrollTo(e.currentTarget.scrollTop))),p.current&&p.current.scrollTo({scrollLeft:e.currentTarget.scrollLeft,scrollTop:e.currentTarget.scrollTop}),void 0!==f.current&&(f.current=e.currentTarget.scrollLeft),void 0!==h.current&&(h.current=e.currentTarget.scrollTop)},constraints:r},m.createElement(tn,{width:A(),height:H},m.createElement(on,{rect:y,leftColumnsWidth:M,rightColumnsWidth:L,topRowsHeight:R,bottomRowsHeight:z},m.createElement(ao,{columnWidthCallback:E,rowHight:l,headersData:q}),m.createElement($o,{dataModel:I,constraints:r,topGridRef:c,getMeasureInfoWidth:T,rowHightCallback:P,width:L,height:R,getScrollLeft:N,layoutService:o,topDimensionData:C}),m.createElement(zo,{dataModel:I,constraints:r,leftGridRef:d,getLeftColumnWidth:E,width:M,height:V,getScrollTop:F,layoutService:o,leftDimensionData:D}),m.createElement(eo,{dataModel:I,dataGridRef:p,getMeasureInfoWidth:T,rowHightCallback:O,width:L,height:z,viewService:n,layoutService:o,measureData:x}))))},Go=e=>{const{layoutService:{hasLimitedData:t},translator:r,pageInfo:n,updatePageInfo:o}=e,i=Mr();return m.createElement(m.Fragment,null,m.createElement(Uo,{...e}),t&&m.createElement(Er,{styleService:i,translator:r}),n.shouldShowPagination&&m.createElement(Or,{pageInfo:n,updatePageInfo:o}))};var Yo,Xo;!function(e){e.Header="header",e.Content="content",e.RowContent="rowContent",e.RowTitle="rowTitle",e.ColumnContent="columnContent",e.ColumnTitle="columnTitle",e.Grid="grid",e.NullValue="nullValue",e.TotalValue="totalValue",e.TotalLabel="totalLabel",e.MeasureLabel="measureLabel",e.Root=""}(Yo||(Yo={})),function(e){e.FontSize="fontSize",e.FontFamily="fontFamily",e.FontColor="fontColor",e.Color="color",e.CellHeight="cellHeight",e.LineClamp="lineClamp",e.Background="background",e.RowHeight="rowHeight",e.LineCount="lineCount",e.Border="border",e.Divider="divider"}(Xo||(Xo={}));const Jo=e=>e?`${parseInt(e,10)}px`:void 0,Ko=(e,t)=>t?e.getColorPickerColor(t):void 0,Zo=(e,t)=>+(parseInt(e,10)*Xt*t+8).toFixed(2),Qo=e=>t((()=>(e=>{var t,r,n,o;const{qHyperCube:i,nullValueRepresentation:a,snapshotData:l}=e,{qNoOfLeftDims:s,qEffectiveInterColumnSortOrder:u,qMeasureInfo:c,qDimensionInfo:d}=i,p=d.slice(0,s),f=d.slice(s),m=!!l,h=null!==(t=null==l||null===(r=l.content)||void 0===r||null===(n=r.qPivotDataPages)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.qArea)&&void 0!==t?t:{qWidth:0,qHeight:0},y={x:m?h.qWidth:Math.min(e.qHyperCube.qSize.qcx,15e3),y:m?h.qHeight:Math.min(e.qHyperCube.qSize.qcy,15e3)};return{layout:e,getNullValueText:()=>{var e;return null!==(e=null==a?void 0:a.text)&&void 0!==e?e:"-"},getMeasureInfoIndexFromCellIndex:e=>u.findIndex((e=>e===kr))<s?0:e%c.length,isDimensionLocked:(e,t,r)=>{var n,o;return e===$r.NX_CELL_LEFT?!(null===(n=p[r])||void 0===n||!n.qLocked):e===$r.NX_CELL_TOP&&!(null===(o=f[t])||void 0===o||!o.qLocked)},size:y,isSnapshot:m,hasLimitedData:!m&&y.x<e.qHyperCube.qSize.qcx,hasLeftDimensions:0!==e.qHyperCube.qNoOfLeftDims}})(e)),[e]),ei=({model:e,layoutService:o,viewService:i,pageInfo:a})=>{const{qHyperCube:l,snapshotData:s}=o.layout,{qLastExpandedPos:u}=l,c=t((()=>({isLoading:!0})),[o,a]),[d,p]=r([]);return n((async()=>{var t,r;if(o.isSnapshot)p((null===(t=o.layout.snapshotData)||void 0===t||null===(r=t.content)||void 0===r?void 0:r.qPivotDataPages)||[]);else if(null!=e&&e.getHyperCubePivotData&&(((e,t)=>!!e&&(t.gridColumnStartIndex+t.gridWidth>=Fr||t.gridRowStartIndex+t.gridHeight>=Fr))(u,i)||((e,t)=>{var r,n;const{qHyperCube:{qPivotDataPages:o,qSize:i}}=e.layout,{qTop:a,qWidth:l,qHeight:s}=null!==(r=null===(n=o[0])||void 0===n?void 0:n.qArea)&&void 0!==r?r:{qTop:0,qWidth:0,qHeight:0};return a<t.currentPage*t.rowsPerPage||l<Math.min(Fr,i.qcx)||s<Math.min(Fr,i.qcy)})(o,a)))try{const t={qLeft:u?i.gridColumnStartIndex:0,qTop:a.currentPage*a.rowsPerPage+(u?i.gridRowStartIndex:0),qWidth:i.gridWidth?i.gridWidth:Fr,qHeight:i.gridHeight?i.gridHeight:Fr},r=await e.getHyperCubePivotData(Nr,[t]);p(r)}catch(e){console.error(e)}else l.qPivotDataPages.length&&p(l.qPivotDataPages);c.isLoading=!1}),[o.layout,e,i,s,a]),{qPivotDataPages:d,isLoading:c.isLoading}},ti=e=>{const t=Math.min(e,15e3);return{rowsPerPage:t,totalPages:Math.ceil(e/t),totalRowCount:e}};var ri={SNPivotTable_LimitedData:{id:"SNPivotTable.LimitedData",locale:{"de-DE":"* Derzeit wird eine begrenzte Anzahl Spalten angezeigt","en-US":"* Currently showing a limited number of columns","es-ES":"* Actualmente mostrando un número limitado de columnas","fr-FR":"*Affichage actuel d'un nombre limité de colonnes","it-IT":"* Attualmente visualizzato un numero limitato di colonne","ja-JP":"* 現在、限られた列の数を表示","ko-KR":"* 현재 제한된 수의 열만 표시","nl-NL":"* Op dit moment wordt slechts een beperkt aantal kolommen getoond","pl-PL":"* Obecnie wyświetlana jest ograniczona liczba kolumn","pt-BR":"* Atualmente mostrando um número limitado de colunas","ru-RU":"* В настоящее время отображается ограниченное количество столбцов","sv-SE":"* Visar för närvarande ett begränsat antal kolumner","tr-TR":"*Şu anda sınırlı sayıda sütun gösteriliyor","zh-CN":"* 当前显示的列数有限","zh-TW":"* 目前顯示有限欄數"}}};const ni=()=>{const e=a(),r=e.language();return t((()=>function(e){if(e.get&&e.add){const t="SNPivotTable_LimitedData";if(e.get(t)!==t)return;Object.keys(ri).forEach((t=>{e.add(ri[t])}))}}(e)),[e,r]),{translator:e,language:r}},oi=()=>{const e=(e=>{const r=t((()=>wr(e)),[e]);return o((()=>()=>r.unmount()),[r]),r})(l()),a=s(),h=u(),y=c(),v=Qo(a),g=d(),b=p(),{translator:q,language:x}=ni(),{pageInfo:C,updatePageInfo:D}=(e=>{const{size:t,layout:{qHyperCube:{qSize:n}}}=e,[i,a]=r({currentPage:0,shouldShowPagination:n.qcy>t.y,...ti(n.qcy)});return o((()=>{a((t=>({...t,...ti(e.layout.qHyperCube.qSize.qcy)})))}),[e.layout.qHyperCube.qSize.qcy,a]),{pageInfo:i,updatePageInfo:e=>a({...i,...e})}})(v),w=(e=>t((()=>({gridColumnStartIndex:0,gridRowStartIndex:0,gridWidth:0,gridHeight:0})),[e.currentPage]))(C),S=(({layoutService:e,viewService:t,rect:r,model:n})=>{var o;return i((async e=>{if(!e.snapshotData)return e;if(!n)return e;if(!e.snapshotData.content){if(null!=n&&n.getHyperCubePivotData){const r=await n.getHyperCubePivotData(Nr,[{qLeft:t.gridColumnStartIndex,qTop:t.gridRowStartIndex,qWidth:t.gridWidth,qHeight:t.gridHeight}]);e.snapshotData.content={qPivotDataPages:r}}return e.snapshotData.object.size.w=r.width,e.snapshotData.object.size.h=r.height,e}return e})),null!==(o=e.layout.snapshotData)&&void 0!==o&&o.content?{left:r.left,top:r.top,width:e.layout.snapshotData.object.size.w,height:e.layout.snapshotData.object.size.h}:r})({rect:f(),layoutService:v,viewService:w,model:h}),{qPivotDataPages:I,isLoading:M}=ei({model:h,layoutService:v,viewService:w,pageInfo:C}),L=t((()=>((e,t)=>{var r,n,o,i,a,l,s,u,c,d,p,f,m,h,y,v,g,b,q,x,C,D,w,S,I,M,L,E,T,A,P,O,N,F,k,H,_,R,V,z,j,W,B,$,U,G,Y,X,J,K,Z,Q,ee,te,re,ne,oe,ie,ae,le,se,ue,ce,de,pe,fe,me,he,ye,ve,ge,be,qe,xe,Ce,De,we,Se,Ie,Me,Le,Ee,Te,Ae,Pe,Oe,Ne,Fe,ke,He,_e,Re,Ve,ze,je,We,Be,$e,Ue,Ge;const Ye=null===(r=t.layout.components)||void 0===r?void 0:r.find((e=>"theme"===e.key)),Xe=null==Ye?void 0:Ye[Yo.Header],Je=null==Ye?void 0:Ye[Yo.Content],Ke=null==Ye?void 0:Ye[Yo.RowContent],Ze=null==Ye?void 0:Ye[Yo.ColumnContent],Qe=null==Ye?void 0:Ye[Yo.Grid],et=(t,r)=>e.getStyle("object.pivotTableV2",t.join("."),r),tt=null!==(n=null==Qe?void 0:Qe.lineCount)&&void 0!==n?n:1,rt={lineClamp:tt,header:{fontSize:null!==(o=null!==(i=Jo(null==Xe?void 0:Xe[Xo.FontSize]))&&void 0!==i?i:et([Yo.Header],Xo.FontSize))&&void 0!==o?o:Gt,fontFamily:null!==(a=null!==(l=null==Xe?void 0:Xe[Xo.FontFamily])&&void 0!==l?l:et([Yo.Header],Xo.FontFamily))&&void 0!==a?a:Yt,background:null!==(s=null!==(u=Ko(e,null==Xe?void 0:Xe[Xo.Background]))&&void 0!==u?u:et([Yo.Header],Xo.Background))&&void 0!==s?s:"transparent",rowTitle:{color:null!==(c=null!==(d=Ko(e,null==Xe||null===(p=Xe[Yo.RowTitle])||void 0===p?void 0:p[Xo.FontColor]))&&void 0!==d?d:et([Yo.Header,Yo.RowTitle],Xo.Color))&&void 0!==c?c:Kt.PrimaryText,background:null!==(f=null!==(m=Ko(e,null==Xe||null===(h=Xe[Yo.RowTitle])||void 0===h?void 0:h[Xo.Background]))&&void 0!==m?m:et([Yo.Header,Yo.RowTitle],Xo.Background))&&void 0!==f?f:Kt.Black3},columnTitle:{color:null!==(y=null!==(v=Ko(e,null==Xe||null===(g=Xe[Yo.ColumnTitle])||void 0===g?void 0:g[Xo.FontColor]))&&void 0!==v?v:et([Yo.Header,Yo.ColumnTitle],Xo.Color))&&void 0!==y?y:Kt.PrimaryText,background:null!==(b=null!==(q=Ko(e,null==Xe||null===(x=Xe[Yo.ColumnTitle])||void 0===x?void 0:x[Xo.Background]))&&void 0!==q?q:et([Yo.Header,Yo.ColumnTitle],Xo.Background))&&void 0!==b?b:Kt.Black3}},content:{fontSize:null!==(C=null!==(D=Jo(null==Je?void 0:Je[Xo.FontSize]))&&void 0!==D?D:et([Yo.Content],Xo.FontSize))&&void 0!==C?C:Gt,fontFamily:null!==(w=null!==(S=null==Je?void 0:Je[Xo.FontFamily])&&void 0!==S?S:et([Yo.Content],Xo.FontFamily))&&void 0!==w?w:Yt,color:null!==(I=null!==(M=Ko(e,null==Je?void 0:Je[Xo.FontColor]))&&void 0!==M?M:et([Yo.Content],Xo.Color))&&void 0!==I?I:Kt.Black55,background:null!==(L=null!==(E=Ko(e,null==Je?void 0:Je[Xo.Background]))&&void 0!==E?E:et([Yo.Content],Xo.Background))&&void 0!==L?L:Kt.Transparent,nullValue:{color:null!==(T=null!==(A=Ko(e,null==Je||null===(P=Je[Yo.NullValue])||void 0===P?void 0:P[Xo.FontColor]))&&void 0!==A?A:et([Yo.Content,Yo.NullValue],Xo.Color))&&void 0!==T?T:Kt.PrimaryText,background:null!==(O=null!==(N=Ko(e,null==Je||null===(F=Je[Yo.NullValue])||void 0===F?void 0:F[Xo.Background]))&&void 0!==N?N:et([Yo.Content,Yo.NullValue],Xo.Background))&&void 0!==O?O:Kt.Black5},totalValue:{color:null!==(k=null!==(H=Ko(e,null==Je||null===(_=Je[Yo.TotalValue])||void 0===_?void 0:_[Xo.FontColor]))&&void 0!==H?H:et([Yo.Content,Yo.TotalValue],Xo.Color))&&void 0!==k?k:Kt.PrimaryText,background:null!==(R=null!==(V=Ko(e,null==Je||null===(z=Je[Yo.TotalValue])||void 0===z?void 0:z[Xo.Background]))&&void 0!==V?V:et([Yo.Content,Yo.TotalValue],Xo.Background))&&void 0!==R?R:Kt.Transparent}},rowContent:{fontSize:null!==(j=null!==(W=Jo(null==Ke?void 0:Ke[Xo.FontSize]))&&void 0!==W?W:et([Yo.RowContent],Xo.FontSize))&&void 0!==j?j:Gt,fontFamily:null!==(B=null!==($=null==Ke?void 0:Ke[Xo.FontFamily])&&void 0!==$?$:et([Yo.RowContent],Xo.FontFamily))&&void 0!==B?B:Yt,color:null!==(U=null!==(G=Ko(e,null==Ke?void 0:Ke[Xo.FontColor]))&&void 0!==G?G:et([Yo.RowContent],Xo.Color))&&void 0!==U?U:Kt.PrimaryText,background:null!==(Y=null!==(X=Ko(e,null==Ke?void 0:Ke[Xo.Background]))&&void 0!==X?X:et([Yo.RowContent],Xo.Background))&&void 0!==Y?Y:Kt.Transparent,nullValue:{color:null!==(J=null!==(K=Ko(e,null==Ke||null===(Z=Ke[Yo.NullValue])||void 0===Z?void 0:Z[Xo.FontColor]))&&void 0!==K?K:et([Yo.RowContent,Yo.NullValue],Xo.Color))&&void 0!==J?J:Kt.PrimaryText,background:null!==(Q=null!==(ee=Ko(e,null==Ke||null===(te=Ke[Yo.NullValue])||void 0===te?void 0:te[Xo.Background]))&&void 0!==ee?ee:et([Yo.RowContent,Yo.NullValue],Xo.Background))&&void 0!==Q?Q:Kt.Black5},totalLabel:{color:null!==(re=null!==(ne=Ko(e,null==Ke||null===(oe=Ke[Yo.TotalLabel])||void 0===oe?void 0:oe[Xo.FontColor]))&&void 0!==ne?ne:et([Yo.RowContent,Yo.TotalLabel],Xo.Color))&&void 0!==re?re:Kt.PrimaryText,background:null!==(ie=null!==(ae=Ko(e,null==Ke||null===(le=Ke[Yo.TotalLabel])||void 0===le?void 0:le[Xo.Background]))&&void 0!==ae?ae:et([Yo.RowContent,Yo.TotalLabel],Xo.Background))&&void 0!==ie?ie:Kt.Transparent},measureLabel:{color:null!==(se=null!==(ue=Ko(e,null==Ke||null===(ce=Ke[Yo.MeasureLabel])||void 0===ce?void 0:ce[Xo.FontColor]))&&void 0!==ue?ue:et([Yo.RowContent,Yo.MeasureLabel],Xo.Color))&&void 0!==se?se:Kt.Black55,background:null!==(de=null!==(pe=Ko(e,null==Ke||null===(fe=Ke[Yo.MeasureLabel])||void 0===fe?void 0:fe[Xo.Background]))&&void 0!==pe?pe:et([Yo.RowContent,Yo.MeasureLabel],Xo.Background))&&void 0!==de?de:Kt.Transparent}},columnContent:{fontSize:null!==(me=null!==(he=Jo(null==Ze?void 0:Ze[Xo.FontSize]))&&void 0!==he?he:et([Yo.ColumnContent],Xo.FontSize))&&void 0!==me?me:Gt,fontFamily:null!==(ye=null!==(ve=null==Ze?void 0:Ze[Xo.FontFamily])&&void 0!==ve?ve:et([Yo.ColumnContent],Xo.FontFamily))&&void 0!==ye?ye:Yt,color:null!==(ge=null!==(be=Ko(e,null==Ze?void 0:Ze[Xo.FontColor]))&&void 0!==be?be:et([Yo.ColumnContent],Xo.Color))&&void 0!==ge?ge:Kt.PrimaryText,background:null!==(qe=null!==(xe=Ko(e,null==Ze?void 0:Ze[Xo.Background]))&&void 0!==xe?xe:et([Yo.ColumnContent],Xo.Background))&&void 0!==qe?qe:"transparent",nullValue:{color:null!==(Ce=null!==(De=Ko(e,null==Ze||null===(we=Ze[Yo.NullValue])||void 0===we?void 0:we[Xo.FontColor]))&&void 0!==De?De:et([Yo.ColumnContent,Yo.NullValue],Xo.Color))&&void 0!==Ce?Ce:Kt.PrimaryText,background:null!==(Se=null!==(Ie=Ko(e,null==Ze||null===(Me=Ze[Yo.NullValue])||void 0===Me?void 0:Me[Xo.Background]))&&void 0!==Ie?Ie:et([Yo.ColumnContent,Yo.NullValue],Xo.Background))&&void 0!==Se?Se:Kt.Black5},totalLabel:{color:null!==(Le=null!==(Ee=Ko(e,null==Ze||null===(Te=Ze[Yo.TotalLabel])||void 0===Te?void 0:Te[Xo.FontColor]))&&void 0!==Ee?Ee:et([Yo.ColumnContent,Yo.TotalLabel],Xo.Color))&&void 0!==Le?Le:Kt.PrimaryText,background:null!==(Ae=null!==(Pe=Ko(e,null==Ze||null===(Oe=Ze[Yo.TotalLabel])||void 0===Oe?void 0:Oe[Xo.Background]))&&void 0!==Pe?Pe:et([Yo.ColumnContent,Yo.TotalLabel],Xo.Background))&&void 0!==Ae?Ae:Kt.Transparent},measureLabel:{color:null!==(Ne=null!==(Fe=Ko(e,null==Ze||null===(ke=Ze[Yo.MeasureLabel])||void 0===ke?void 0:ke[Xo.FontColor]))&&void 0!==Fe?Fe:et([Yo.ColumnContent,Yo.MeasureLabel],Xo.Color))&&void 0!==Ne?Ne:Kt.Black55,background:null!==(He=null!==(_e=Ko(e,null==Ze||null===(Re=Ze[Yo.MeasureLabel])||void 0===Re?void 0:Re[Xo.Background]))&&void 0!==_e?_e:et([Yo.ColumnContent,Yo.MeasureLabel],Xo.Background))&&void 0!==He?He:Kt.Transparent}},grid:{rowHeight:null!==(Ve=null!==(ze=null==Qe?void 0:Qe[Xo.RowHeight])&&void 0!==ze?ze:et([Yo.Grid],Xo.RowHeight))&&void 0!==Ve?Ve:"compact",lineCount:null!==(je=null!==(We=null==Qe?void 0:Qe[Xo.LineCount])&&void 0!==We?We:et([Yo.Grid],Xo.LineCount))&&void 0!==je?je:1,border:null!==(Be=null!==($e=Ko(e,null==Qe?void 0:Qe[Xo.Border]))&&void 0!==$e?$e:et([Yo.Grid],Xo.Border))&&void 0!==Be?Be:Kt.Black15,divider:null!==(Ue=null!==(Ge=Ko(e,null==Qe?void 0:Qe[Xo.Divider]))&&void 0!==Ge?Ge:et([Yo.Grid],Xo.Divider))&&void 0!==Ue?Ue:Kt.Black60}};return rt.headerCellHeight=Math.max(Zo(rt.header.fontSize,tt),Zo(rt.columnContent.fontSize,tt),24),rt.contentCellHeight=Math.max(Zo(rt.content.fontSize,tt),Zo(rt.rowContent.fontSize,tt),24),rt})(b,v)),[b.name(),v]),E=(e=>{const[t,r]=n((()=>Promise.all(e.map((e=>document.fonts.load(e))))),[e]);return r?(console.warn("Failed to load font:",r),!0):!!t})(t((()=>[`600 ${L.header.fontSize} ${L.header.fontFamily}`,`600 ${L.columnContent.fontSize} ${L.columnContent.fontFamily}`,`${L.columnContent.fontSize} ${L.columnContent.fontFamily}`,`600 ${L.rowContent.fontSize} ${L.rowContent.fontFamily}`,`${L.rowContent.fontSize} ${L.rowContent.fontFamily}`,`${L.content.fontSize} ${L.content.fontFamily}`]),[L]));o((()=>{!M&&h&&(null==S?void 0:S.width)&&(null==S?void 0:S.height)&&y&&g&&w&&v&&L&&!!I&&E&&((e,t)=>{const{selections:r,styleService:n}=t;e.render(m.createElement(m.StrictMode,null,m.createElement(so,{selections:r},m.createElement(Lr,{styleService:n},m.createElement(Go,{...t})))))})(e,{model:h,rect:S,constraints:y,selections:g,viewService:w,layoutService:v,qPivotDataPages:I,styleService:L,translator:q,pageInfo:C,updatePageInfo:D})}),[h,S,null==S?void 0:S.width,null==S?void 0:S.height,y,g,w,v,M,I,L,e,E,q,x,C,D])},ii={version:"2.0.0",qHyperCubeDef:{qAlwaysFullyExpanded:!1,qDimensions:[],qMeasures:[],qMode:"P",qSuppressMissing:!0,qSuppressZero:!1,qShowTotalsAbove:!0,qInitialDataFetch:[{qTop:0,qLeft:0,qWidth:50,qHeight:50}],qIndentMode:!1},showTitles:!0,title:"",subtitle:"",footnote:"",nullValueRepresentation:{text:"-"},components:[]}}}}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nebula.js/sn-pivot-table",
3
- "version": "2.0.0-alpha.0",
3
+ "version": "2.0.0",
4
4
  "description": "Pivot table supernova",
5
5
  "keywords": [
6
6
  "qlik",
@@ -35,7 +35,7 @@
35
35
  "locale:verify": "node src/locale/tools/verify-translations.mjs",
36
36
  "prepare": "husky install",
37
37
  "sense": "nebula sense",
38
- "spec": "scriptappy-from-jsdoc -c ./scriptappy.config.js",
38
+ "spec": "npx @scriptappy/cli from-jsdoc -c ./scriptappy.config.js",
39
39
  "start": "yarn run locale:generate && nebula serve --type sn-pivot-table",
40
40
  "start:mfe": "nebula serve --mfe --type sn-pivot-table",
41
41
  "test:local:rendering": "./test/rendering/scripts/run-rendering-test.sh",
@@ -86,16 +86,19 @@
86
86
  "@babel/preset-typescript": "7.21.5",
87
87
  "@commitlint/cli": "17.6.3",
88
88
  "@commitlint/config-conventional": "17.6.3",
89
- "@nebula.js/cli": "4.0.1",
90
- "@nebula.js/cli-build": "4.0.1",
91
- "@nebula.js/cli-sense": "4.0.1",
92
- "@nebula.js/cli-serve": "4.0.1",
93
- "@playwright/test": "1.33.0",
94
- "@qlik/eslint-config": "0.0.12",
95
- "@qlik/eslint-config-react": "0.0.12",
96
- "@qlik/prettier-config": "0.1.1",
89
+ "@nebula.js/cli": "4.0.3",
90
+ "@nebula.js/cli-build": "4.0.3",
91
+ "@nebula.js/cli-sense": "4.0.3",
92
+ "@nebula.js/cli-serve": "4.0.3",
93
+ "@playwright/test": "1.34.0",
94
+ "@qlik-trial/sprout": "2.51.0",
95
+ "@qlik/eslint-config": "0.0.16",
96
+ "@qlik/eslint-config-react": "0.0.15",
97
+ "@qlik/prettier-config": "0.1.2",
97
98
  "@qlik/tsconfig": "0.1.3",
98
- "@rollup/plugin-typescript": "11.1.0",
99
+ "@rollup/plugin-typescript": "11.1.1",
100
+ "@scriptappy/cli": "0.8.0",
101
+ "@scriptappy/from-jsdoc": "0.17.0",
99
102
  "@testing-library/jest-dom": "5.16.5",
100
103
  "@testing-library/react": "14.0.0",
101
104
  "@testing-library/user-event": "14.4.3",
@@ -105,7 +108,7 @@
105
108
  "@types/react-window": "1.8.5",
106
109
  "babel-eslint": "10.1.0",
107
110
  "conventional-changelog-cli": "2.2.2",
108
- "eslint": "8.40.0",
111
+ "eslint": "8.41.0",
109
112
  "globby": "13.1.4",
110
113
  "husky": "8.0.3",
111
114
  "jest": "29.5.0",
@@ -118,12 +121,12 @@
118
121
  "react": "18.2.0",
119
122
  "react-dom": "18.2.0",
120
123
  "react-window": "1.8.9",
121
- "scriptappy-from-jsdoc": "0.7.0",
122
- "tslib": "2.5.0",
124
+ "tslib": "2.5.2",
123
125
  "typescript": "5.0.4"
124
126
  },
125
127
  "peerDependencies": {
126
- "@nebula.js/stardust": ">=3.x"
128
+ "@nebula.js/stardust": ">=4.0.3",
129
+ "@qlik-trial/sprout": ">=2.51.0"
127
130
  },
128
131
  "engines": {
129
132
  "node": ">=16"