@nebula.js/sn-distributionplot 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/esm/index.js +3 -3
- package/core/esm/index.js.map +1 -1
- package/dist/sn-distplot.js +4 -4
- package/dist/sn-distplot.js.map +1 -1
- package/dist/sn-distplot.systemjs.js +5 -5
- package/dist/sn-distplot.systemjs.js.map +1 -1
- package/package.json +5 -5
- package/sn-distributionplot-ext/dist/sn-distplot.js +4 -4
- package/sn-distributionplot-ext/sn-distributionplot.qext +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/sn-distributionplot v1.0.
|
|
2
|
+
* @nebula.js/sn-distributionplot v1.0.3
|
|
3
3
|
* Copyright (c) 2025 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -21,9 +21,9 @@ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,h,d=e.le
|
|
|
21
21
|
* http://hammerjs.github.io/
|
|
22
22
|
*
|
|
23
23
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
24
|
-
* Licensed under the MIT license */var gg=(pg||(pg=1,function(e){!function(t,n,r,i){var o,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),l=Math.round,c=Math.abs,u=Date.now;function h(e,t,n){return setTimeout(v(e,n),t)}function d(e,t,n){return!!Array.isArray(e)&&(f(e,n[t],n),!0)}function f(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function p(e,n,r){var i="DEPRECATED METHOD: "+n+"\n"+r+" AT \n";return function(){var n=new Error("get-stack-trace"),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,i,r),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===i||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==i&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign;var m=p(function(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;)(!n||n&&e[r[o]]===i)&&(e[r[o]]=t[r[o]]),o++;return e},"extend","Use `assign`."),g=p(function(e,t){return m(e,t,!0)},"merge","Use `assign`.");function y(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&o(r,n)}function v(e,t){return function(){return e.apply(t,arguments)}}function b(e,t){return"function"==typeof e?e.apply(t&&t[0]||i,t):e}function x(e,t){return e===i?t:e}function w(e,t,n){f(D(t),function(t){e.addEventListener(t,n,!1)})}function q(e,t,n){f(D(t),function(t){e.removeEventListener(t,n,!1)})}function M(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function S(e,t){return e.indexOf(t)>-1}function D(e){return e.trim().split(/\s+/g)}function _(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function k(e){return Array.prototype.slice.call(e,0)}function C(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var s=e[o][t];_(i,s)<0&&r.push(e[o]),i[o]=s,o++}return r=r.sort(function(e,n){return e[t]>n[t]}),r}function E(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),a=0;a<s.length;){if((r=(n=s[a])?n+o:t)in e)return r;a++}return i}var A=1;function T(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var I="ontouchstart"in t,N=E(t,"PointerEvent")!==i,R=I&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),O="touch",P="mouse",L=24,F=["x","y"],j=["clientX","clientY"];function z(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){b(e.options.enable,[e])&&n.handler(t)},this.init()}function H(e,t,n){var r=n.pointers.length,o=n.changedPointers.length,s=1&t&&r-o===0,a=12&t&&r-o===0;n.isFirst=!!s,n.isFinal=!!a,s&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,o=r.length;n.firstInput||(n.firstInput=B(t)),o>1&&!n.firstMultiple?n.firstMultiple=B(t):1===o&&(n.firstMultiple=!1);var s=n.firstInput,a=n.firstMultiple,l=a?a.center:s.center,h=t.center=V(r);t.timeStamp=u(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=Y(l,h),t.distance=U(l,h),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=W(t.deltaX,t.deltaY);var d=$(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=c(d.x)>c(d.y)?d.x:d.y,t.scale=a?function(e,t){return U(t[0],t[1],j)/U(e[0],e[1],j)}(a.pointers,r):1,t.rotation=a?function(e,t){return Y(t[1],t[0],j)+Y(e[1],e[0],j)}(a.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,o,s,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(8!=t.eventType&&(l>25||a.velocity===i)){var u=t.deltaX-a.deltaX,h=t.deltaY-a.deltaY,d=$(l,u,h);r=d.x,o=d.y,n=c(d.x)>c(d.y)?d.x:d.y,s=W(u,h),e.lastInterval=t}else n=a.velocity,r=a.velocityX,o=a.velocityY,s=a.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=s}(n,t);var f=e.element;M(t.srcEvent.target,f)&&(f=t.srcEvent.target),t.target=f}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function B(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:l(e.pointers[n].clientX),clientY:l(e.pointers[n].clientY)},n++;return{timeStamp:u(),pointers:t,center:V(t),deltaX:e.deltaX,deltaY:e.deltaY}}function V(e){var t=e.length;if(1===t)return{x:l(e[0].clientX),y:l(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:l(n/t),y:l(r/t)}}function $(e,t,n){return{x:t/e||0,y:n/e||0}}function W(e,t){return e===t?1:c(e)>=c(t)?e<0?2:4:t<0?8:16}function U(e,t,n){n||(n=F);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function Y(e,t,n){n||(n=F);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}z.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(T(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&q(this.element,this.evEl,this.domHandler),this.evTarget&&q(this.target,this.evTarget,this.domHandler),this.evWin&&q(T(this.element),this.evWin,this.domHandler)}};var K={mousedown:1,mousemove:2,mouseup:4},X="mousedown",G="mousemove mouseup";function J(){this.evEl=X,this.evWin=G,this.pressed=!1,z.apply(this,arguments)}y(J,z,{handler:function(e){var t=K[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:P,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Q={2:O,3:"pen",4:P,5:"kinect"},ee="pointerdown",te="pointermove pointerup pointercancel";function ne(){this.evEl=ee,this.evWin=te,z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),y(ne,z,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=Z[r],o=Q[e.pointerType]||e.pointerType,s=o==O,a=_(t,e.pointerId,"pointerId");1&i&&(0===e.button||s)?a<0&&(t.push(e),a=t.length-1):12&i&&(n=!0),a<0||(t[a]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(a,1))}});var re={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ie(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,z.apply(this,arguments)}function oe(e,t){var n=k(e.touches),r=k(e.changedTouches);return 12&t&&(n=C(n.concat(r),"identifier")),[n,r]}y(ie,z,{handler:function(e){var t=re[e.type];if(1===t&&(this.started=!0),this.started){var n=oe.call(this,e,t);12&t&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:O,srcEvent:e})}}});var se={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ae="touchstart touchmove touchend touchcancel";function le(){this.evTarget=ae,this.targetIds={},z.apply(this,arguments)}function ce(e,t){var n=k(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,s=k(e.changedTouches),a=[],l=this.target;if(o=n.filter(function(e){return M(e.target,l)}),1===t)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<s.length;)r[s[i].identifier]&&a.push(s[i]),12&t&&delete r[s[i].identifier],i++;return a.length?[C(o.concat(a),"identifier"),a]:void 0}function ue(){z.apply(this,arguments);var e=v(this.handler,this);this.touch=new le(this.manager,e),this.mouse=new J(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function he(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,de.call(this,t)):12&e&&de.call(this,t)}function de(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout(function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)},2500)}}function fe(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),s=Math.abs(n-i.y);if(o<=25&&s<=25)return!0}return!1}y(le,z,{handler:function(e){var t=se[e.type],n=ce.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:O,srcEvent:e})}}),y(ue,z,{handler:function(e,t,n){var r=n.pointerType==O,i=n.pointerType==P;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)he.call(this,t,n);else if(i&&fe.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var pe=E(a.style,"touchAction"),me=pe!==i,ge="compute",ye="auto",ve="manipulation",be="none",xe="pan-x",we="pan-y",qe=function(){if(!me)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(r){e[r]=!n||t.CSS.supports("touch-action",r)}),e}();function Me(e,t){this.manager=e,this.set(t)}Me.prototype={set:function(e){e==ge&&(e=this.compute()),me&&this.manager.element.style&&qe[e]&&(this.manager.element.style[pe]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return f(this.manager.recognizers,function(t){b(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),function(e){if(S(e,be))return be;var t=S(e,xe),n=S(e,we);return t&&n?be:t||n?t?xe:we:S(e,ve)?ve:ye}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=S(r,be)&&!qe[be],o=S(r,we)&&!qe[we],s=S(r,xe)&&!qe[xe];if(i){var a=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(a&&l&&c)return}if(!s||!o)return i||o&&6&n||s&&n&L?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Se=32;function De(e){this.options=o({},this.defaults,e||{}),this.id=A++,this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function _e(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function ke(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Ce(e,t){var n=t.manager;return n?n.get(e):e}function Ee(){De.apply(this,arguments)}function Ae(){Ee.apply(this,arguments),this.pX=null,this.pY=null}function Te(){Ee.apply(this,arguments)}function Ie(){De.apply(this,arguments),this._timer=null,this._input=null}function Ne(){Ee.apply(this,arguments)}function Re(){Ee.apply(this,arguments)}function Oe(){De.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Pe(e,t){return(t=t||{}).recognizers=x(t.recognizers,Pe.defaults.preset),new Le(e,t)}function Le(e,t){var n;this.options=o({},Pe.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(N?ne:R?le:I?ue:J))(n,H),this.touchAction=new Me(this,this.options.touchAction),Fe(this,!0),f(this.options.recognizers,function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}function Fe(e,t){var n,r=e.element;r.style&&(f(e.options.cssProps,function(i,o){n=E(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""}),t||(e.oldCssProps={}))}De.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(d(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Ce(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return d(e,"dropRecognizeWith",this)||(e=Ce(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(d(e,"requireFailure",this))return this;var t=this.requireFail;return-1===_(t,e=Ce(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(d(e,"dropRequireFailure",this))return this;e=Ce(e,this);var t=_(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+_e(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+_e(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Se},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!b(this.options.enable,[this,t]))return this.reset(),void(this.state=Se);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},y(Ee,De,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(8&n||!i)?16|t:r||i?4&n?8|t:2&t?4|t:2:Se}}),y(Ae,Ee,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(we),e&L&&t.push(xe),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,s=e.deltaY;return i&t.direction||(6&t.direction?(i=0===o?1:o<0?2:4,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===s?1:s<0?8:16,n=s!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return Ee.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=ke(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),y(Te,Ee,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[be]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),y(Ie,De,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ye]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=h(function(){this.state=8,this.tryEmit()},t.time,this);else if(4&e.eventType)return 8;return Se},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}}),y(Ne,Ee,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[be]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),y(Re,Ee,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ae.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:n&L&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&c(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=ke(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),y(Oe,De,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ve]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(r&&i&&n){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,s=!this.pCenter||U(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,s&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=h(function(){this.state=8,this.tryEmit()},t.interval,this),2):8}return Se},failTimeout:function(){return this._timer=h(function(){this.state=Se},this.options.interval,this),Se},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Pe.VERSION="2.0.7",Pe.defaults={domEvents:!1,touchAction:ge,enable:!0,inputTarget:null,inputClass:null,preset:[[Ne,{enable:!1}],[Te,{enable:!1},["rotate"]],[Re,{direction:6}],[Ae,{direction:6},["swipe"]],[Oe],[Oe,{event:"doubletap",taps:2},["tap"]],[Ie]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Le.prototype={set:function(e){return o(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof De)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(d(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(d(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=_(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==i&&t!==i){var n=this.handlers;return f(D(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this}},off:function(e,t){if(e!==i){var n=this.handlers;return f(D(e),function(e){t?n[e]&&n[e].splice(_(n[e],t),1):delete n[e]}),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var r=n.createEvent("Event");r.initEvent(e,!0,!0),r.gesture=t,t.target.dispatchEvent(r)}(e,t);var r=this.handlers[e]&&this.handlers[e].slice();if(r&&r.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var i=0;i<r.length;)r[i](t),i++}},destroy:function(){this.element&&Fe(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(Pe,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Se,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:L,DIRECTION_ALL:30,Manager:Le,Input:z,TouchAction:Me,TouchInput:le,MouseInput:J,PointerEventInput:ne,TouchMouseInput:ue,SingleTouchInput:ie,Recognizer:De,AttrRecognizer:Ee,Tap:Oe,Pan:Ae,Swipe:Re,Pinch:Te,Rotate:Ne,Press:Ie,on:w,off:q,each:f,merge:g,extend:m,assign:o,inherit:y,bindFn:v,prefixed:E}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=Pe,e.exports?e.exports=Pe:t.Hammer=Pe}(window,document)}(mg)),mg.exports),yg=n(gg);function vg(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var bg={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:r}}=this.settings,i="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",o=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":n.width=`${t.height}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left";break;case"right":n.width=`${t.height}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left";break;case"center":n.width=`${t.width}px`,n.height=`${t.height}px`,n.color="#595959",n.fontStyle="normal",n.fontSize="1.2em",n.textAlign="center";break;default:n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(r,this.rect),s="center"===r?t:`* ${t}`,a="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:o,dir:i},e("span",{ref:this.alignToRef,style:a,title:s},s))}};function xg(e){const t=qp();return t.renderer.prio([e||"canvas"]),t.use(ug),t.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",fg(e))};e.interaction("hammer",fg(Hammer))}(yg)),t.use(vg),t.component("disclaimer",bg),t}const wg={shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]};var qg,Mg;function Sg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dg=function(){if(Mg)return qg;Mg=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},s=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return qg=function e(){var t,n,r,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=a(h,n),h!==(l=a(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},s(h,{name:n,newValue:e(p,u,l)})):void 0!==l&&s(h,{name:n,newValue:l}));return h},qg}();function _g(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function kg(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Cg(){}Sg(Dg);var Eg=1/.7,Ag="\\s*([+-]?\\d+)\\s*",Tg="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ig="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ng=/^#([0-9a-f]{3,8})$/,Rg=new RegExp(`^rgb\\(${Ag},${Ag},${Ag}\\)$`),Og=new RegExp(`^rgb\\(${Ig},${Ig},${Ig}\\)$`),Pg=new RegExp(`^rgba\\(${Ag},${Ag},${Ag},${Tg}\\)$`),Lg=new RegExp(`^rgba\\(${Ig},${Ig},${Ig},${Tg}\\)$`),Fg=new RegExp(`^hsl\\(${Tg},${Ig},${Ig}\\)$`),jg=new RegExp(`^hsla\\(${Tg},${Ig},${Ig},${Tg}\\)$`),zg={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 Hg(){return this.rgb().formatHex()}function Bg(){return this.rgb().formatRgb()}function Vg(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ng.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?$g(t):3===n?new Kg(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Wg(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Wg(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=Rg.exec(e))?new Kg(t[1],t[2],t[3],1):(t=Og.exec(e))?new Kg(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Pg.exec(e))?Wg(t[1],t[2],t[3],t[4]):(t=Lg.exec(e))?Wg(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Fg.exec(e))?ey(t[1],t[2]/100,t[3]/100,1):(t=jg.exec(e))?ey(t[1],t[2]/100,t[3]/100,t[4]):zg.hasOwnProperty(e)?$g(zg[e]):"transparent"===e?new Kg(NaN,NaN,NaN,0):null}function $g(e){return new Kg(e>>16&255,e>>8&255,255&e,1)}function Wg(e,t,n,r){return r<=0&&(e=t=n=NaN),new Kg(e,t,n,r)}function Ug(e){return e instanceof Cg||(e=Vg(e)),e?new Kg((e=e.rgb()).r,e.g,e.b,e.opacity):new Kg}function Yg(e,t,n,r){return 1===arguments.length?Ug(e):new Kg(e,t,n,null==r?1:r)}function Kg(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Xg(){return`#${Qg(this.r)}${Qg(this.g)}${Qg(this.b)}`}function Gg(){const e=Jg(this.opacity);return`${1===e?"rgb(":"rgba("}${Zg(this.r)}, ${Zg(this.g)}, ${Zg(this.b)}${1===e?")":`, ${e})`}`}function Jg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Zg(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Qg(e){return((e=Zg(e))<16?"0":"")+e.toString(16)}function ey(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ny(e,t,n,r)}function ty(e){if(e instanceof ny)return new ny(e.h,e.s,e.l,e.opacity);if(e instanceof Cg||(e=Vg(e)),!e)return new ny;if(e instanceof ny)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new ny(s,a,l,e.opacity)}function ny(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function ry(e){return(e=(e||0)%360)<0?e+360:e}function iy(e){return Math.max(0,Math.min(1,e||0))}function oy(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}_g(Cg,Vg,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Hg,formatHex:Hg,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ty(this).formatHsl()},formatRgb:Bg,toString:Bg}),_g(Kg,Yg,kg(Cg,{brighter(e){return e=null==e?Eg:Math.pow(Eg,e),new Kg(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Kg(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Kg(Zg(this.r),Zg(this.g),Zg(this.b),Jg(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:Xg,formatHex:Xg,formatHex8:function(){return`#${Qg(this.r)}${Qg(this.g)}${Qg(this.b)}${Qg(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Gg,toString:Gg})),_g(ny,function(e,t,n,r){return 1===arguments.length?ty(e):new ny(e,t,n,null==r?1:r)},kg(Cg,{brighter(e){return e=null==e?Eg:Math.pow(Eg,e),new ny(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ny(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Kg(oy(e>=240?e-240:e+120,i,r),oy(e,i,r),oy(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ny(ry(this.h),iy(this.s),iy(this.l),Jg(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=Jg(this.opacity);return`${1===e?"hsl(":"hsla("}${ry(this.h)}, ${100*iy(this.s)}%, ${100*iy(this.l)}%${1===e?")":`, ${e})`}`}}));const sy=Math.PI/180,ay=180/Math.PI,ly=4/29,cy=6/29,uy=3*cy*cy;function hy(e){if(e instanceof dy)return new dy(e.l,e.a,e.b,e.opacity);if(e instanceof yy)return vy(e);e instanceof Kg||(e=Ug(e));var t,n,r=gy(e.r),i=gy(e.g),o=gy(e.b),s=fy((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=s:(t=fy((.4360747*r+.3850649*i+.1430804*o)/.96422),n=fy((.0139322*r+.0971045*i+.7141733*o)/.82521)),new dy(116*s-16,500*(t-s),200*(s-n),e.opacity)}function dy(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function fy(e){return e>.008856451679035631?Math.pow(e,1/3):e/uy+ly}function py(e){return e>cy?e*e*e:uy*(e-ly)}function my(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function gy(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function yy(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function vy(e){if(isNaN(e.h))return new dy(e.l,0,0,e.opacity);var t=e.h*sy;return new dy(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}_g(dy,function(e,t,n,r){return 1===arguments.length?hy(e):new dy(e,t,n,null==r?1:r)},kg(Cg,{brighter(e){return new dy(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new dy(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new Kg(my(3.1338561*(t=.96422*py(t))-1.6168667*(e=1*py(e))-.4906146*(n=.82521*py(n))),my(-.9787684*t+1.9161415*e+.033454*n),my(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),_g(yy,function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof yy)return new yy(e.h,e.c,e.l,e.opacity);if(e instanceof dy||(e=hy(e)),0===e.a&&0===e.b)return new yy(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*ay;return new yy(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new yy(e,t,n,null==r?1:r)},kg(Cg,{brighter(e){return new yy(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new yy(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return vy(this).rgb()}}));var by=-.14861,xy=1.78277,wy=-.29227,qy=-.90649,My=1.97294,Sy=My*qy,Dy=My*xy,_y=-.6557636667999999;function ky(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Cy)return new Cy(e.h,e.s,e.l,e.opacity);e instanceof Kg||(e=Ug(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(_y*r+Sy*t-Dy*n)/-5.9615122912,o=r-i,s=(My*(n-i)-wy*o)/qy,a=Math.sqrt(s*s+o*o)/(My*i*(1-i)),l=a?Math.atan2(s,o)*ay-120:NaN;return new Cy(l<0?l+360:l,a,i,e.opacity)}(e):new Cy(e,t,n,null==r?1:r)}function Cy(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}_g(Cy,ky,kg(Cg,{brighter(e){return e=null==e?Eg:Math.pow(Eg,e),new Cy(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Cy(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*sy,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Kg(255*(t+n*(by*r+xy*i)),255*(t+n*(wy*r+qy*i)),255*(t+n*(My*r)),this.opacity)}}));var Ey=e=>()=>e;function Ay(e,t){return function(n){return e+n*t}}function Ty(e,t){var n=t-e;return n?Ay(e,n):Ey(isNaN(e)?t:e)}function Iy(e){return((e=Math.exp(e))+1/e)/2}function Ny(e){return function t(n){function r(t,r){var i=e((t=ky(t)).h,(r=ky(r)).h),o=Ty(t.s,r.s),s=Ty(t.l,r.l),a=Ty(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=o(e),t.l=s(Math.pow(e,n)),t.opacity=a(e),t+""}}return n=+n,r.gamma=t,r}(1)}!function e(t){var n=function(e){return 1==(e=+e)?Ty:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Ey(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Yg(e)).r,(t=Yg(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=Ty(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1),function e(t,n,r){function i(e,i){var o,s,a=e[0],l=e[1],c=e[2],u=i[0],h=i[1],d=i[2],f=u-a,p=h-l,m=f*f+p*p;if(m<1e-12)s=Math.log(d/c)/t,o=function(e){return[a+e*f,l+e*p,c*Math.exp(t*e*s)]};else{var g=Math.sqrt(m),y=(d*d-c*c+r*m)/(2*c*n*g),v=(d*d-c*c-r*m)/(2*d*n*g),b=Math.log(Math.sqrt(y*y+1)-y),x=Math.log(Math.sqrt(v*v+1)-v);s=(x-b)/t,o=function(e){var r,i=e*s,o=Iy(b),u=c/(n*g)*(o*(r=t*i+b,((r=Math.exp(2*r))-1)/(r+1))-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[a+u*f,l+u*p,c*o/Iy(t*i+b)]}}return o.duration=1e3*s*t/Math.SQRT2,o}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i}(Math.SQRT2,2,4),Ny(function(e,t){var n=t-e;return n?Ay(e,n>180||n<-180?n-360*Math.round(n/360):n):Ey(isNaN(e)?t:e)}),Ny(Ty);var Ry="center",Oy="bottom";function Py(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var s=r[o];if(void 0===i[s])return n;i=i[s]}return i}[{key:"NoDataExist",alignment:Ry,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:Ry,condition:function(e){var t=e.layoutService;return!!t&&t.getHyperCubeValue("qMeasureInfo").every(function(e){return"NaN"===e.qMin&&"NaN"===e.qMax})}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:Ry,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:Ry},{key:"DataRangeIncludingZero",alignment:Oy},{key:"LimitedData",alignment:Oy},{key:"NegativeOrZeroValues",alignment:Oy}].reduce(function(e,t){return e[t.key]=t,e},{});var Ly=["__proto__","constructor"];function Fy(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!Ly.some(function(e){return r.includes(e)})){for(var o=e,s=0;s<r.length-1;++s){var a=r[s];void 0===o[a]&&(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}void 0!==n?o[i]=n:delete o[i]}}}var jy,zy={exports:{}},Hy=jy?zy.exports:(jy=1,zy.exports=function(){function e(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function n(n){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(s)return s(e,t).value}return e[t]},h=function e(){var t,n,r,i,o,s,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=u(h,n),h!==(i=u(t,n))&&(p&&i&&(l(i)||(o=a(i)))?(o?(o=!1,s=r&&a(r)?r:[]):s=r&&l(r)?r:{},c(h,{name:n,newValue:e(p,s,i)})):void 0!==i&&c(h,{name:n,newValue:i}));return h};function d(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=i.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map(e=>e.instance).indexOf(e),a=i.wrappedFields[t].attrExps.map(e=>e.instance).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(r)&&r.some((e,t)=>e!==t)){const e=r.indexOf(s);-1!==e&&(s=e)}return s-=t.qArea.qLeft,s<0||s>=t.qArea.qWidth?-1:l>=0?e=>e[s].qAttrDims.qValues[l]:a>=0?e=>e[s].qAttrExps.qValues[a]:e=>e[s]}function f(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function p(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:s,row:a,sourceKey:l,target:c,targetProp:u,columnOrder:p}=e,m=r;if(i.field&&i.field!==n){const e=d(i.field,o,{cache:t},p);if(-1===e)return;m=h({qRow:s},e(a))}c[u]=f(i,m,{key:l})}function m(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const s=t.raw(),a=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:c,main:u}=r.normalizeConfig(i[e],t),m=Object.keys(c),g=!!i[e].trackBy,y=typeof i[e].trackBy,v={},b=[],x=[];for(let t=0;t<s.qDataPages.length;t++){const o=d(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let d=0;d<s.qDataPages[t].qMatrix.length;d++){const w=s.qDataPages[t].qArea.qTop+d,q=h({qRow:w},o(s.qDataPages[t].qMatrix[d])),M=f(u,q,{key:a});if(!u.filter||u.filter(q)){for(let e=0;e<m.length;e++){const r=c[m[e]];let i=r.fields||[r];r.fields&&(M[m[e]]=[]);for(let o=0;o<i.length;o++)p({cache:n,f:l,mainCell:q,p:i[o],prop:m[e],page:s.qDataPages[t],rowIdx:w,row:s.qDataPages[t].qMatrix[d],sourceKey:a,target:r.fields?M[m[e]]:M,targetProp:r.fields?o:m[e],columnOrder:s.qColumnOrder});if(r.fields){const t=M[m[e]].map(e=>e.value),n=M[m[e]].map(e=>e.label);M[m[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(M[m[e]].value)}}}g&&r.track({cfg:i[e],itemData:q,obj:M,target:b,tracker:v,trackType:y}),x.push(M)}}}const w=g?r.collect(b,{main:u,propsArr:m,props:c}):x;o=[...o,...w]}return o}function g(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function y(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=b)):void 0===t&&(t=v);for(var n,r,i,o,s,a=new q(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new q(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(w)}function v(e){return e.children}function b(e){return Array.isArray(e)?e[1]:null}function x(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function w(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function q(e){this.data=e,this.depth=this.height=0,this.parent=null}function M(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}q.prototype=y.prototype={constructor:q,count:function(){return this.eachAfter(g)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t},copy:function(){return y(this).eachBefore(x)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}};var S={depth:-1},D={},_={};function k(e){return e.id}function C(e){return e.parentId}function E(){var e,t=k,n=C;function r(r){var i,o,s,a,l,c,u,h,d=Array.from(r),f=t,p=n,m=new Map;if(null!=e){const t=d.map((t,n)=>function(e){let t=(e=`${e}`).length;return T(e,t-1)&&!T(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r))),n=t.map(A),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(A(e)),d.push(_));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,i=d.length;s<i;++s)o=d[s],c=d[s]=new q(o),null!=(u=f(o,s,r))&&(u+="")&&(h=c.id=u,m.set(h,m.has(h)?D:c)),null!=(u=p(o,s,r))&&(u+="")&&(c.parent=u);for(s=0;s<i;++s)if(u=(c=d[s]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===D)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===_&&1===a.children.length;)a=a.children[0],--i;for(let e=d.length-1;e>=0&&(c=d[e]).data===_;--e)c.data=null}if(a.parent=S,a.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(w),a.parent=null,i>0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=M(e),r):t},r.parentId=function(e){return arguments.length?(n=M(e),r):n},r.path=function(t){return arguments.length?(e=M(t),r):e},r}function A(e){let t=e.length;if(t<2)return"";for(;--t>1&&!T(e,t););return e.slice(0,t)}function T(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function I(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=I(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=I(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function N(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...N(e[i].children,t-1,n)]);return r}function R(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const r=Math.max(0,Math.min(100,t-e));return e=>N(e.children,r-1,n)}return!1}const O=/^qDimensionInfo(?:\/(\d+))?/,P=/^\/?qMeasureInfo\/(\d+)/,L=/\/qAttrExprInfo\/(\d+)/,F=/\/qAttrDimInfo\/(\d+)/;function j(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function z(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,s=-1,a=-1,l=-1,c=-1,u=-1,h=r;const d=n.qEffectiveInterColumnSortOrder,f=j(n);return O.test(h)&&(i=!0,o=+O.exec(h)[1],h=r.replace(O,"")),P.test(h)&&("K"===n.qMode?c=+P.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+P.exec(h)[1],u=0):u=+P.exec(h)[1],h=h.replace(P,"")),h&&(F.exec(h)?a=+F.exec(h)[1]:L.exec(h)&&(s=+L.exec(h)[1])),l=i?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function H(e,t){let n,r,i=R(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function B(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function V(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,m,g,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,r)),"function"==typeof h.label&&(f=e=>h.label(e,r)),h.accessor?(m=h.accessor(r),Array.isArray(m)?(g=m.map(h.valueAccessor),h.attrAccessor&&(g=g.map(h.attrAccessor)),d&&(p=g.map(d),d=null),f&&(y=g.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(m)):h.valueAccessor(m),y=p)):(p=i,y=i)),a.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,r):c,label:"function"==typeof a.label?a.label(u,r):u})}}const $=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=I(r,e);return o&&o[0]?(t.tree=y(o[0],n.children||(e=>e[i])),t.tree):null};const W=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:s}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],a=i.fields?i.fields:[i];for(let e=0;e<a.length;e++){const t=a[e];if(t.field!==s){const e=H(o,z(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function U(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const o=t.raw(),s=t.key(),a="S"===o.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],r=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}(e),i=e.fields(),o=e.fields().filter(e=>"dimension"===e.type()).map(e=>r.indexOf(i.indexOf(e))),s=e.fields().filter(e=>"measure"===e.type()).map(e=>r.indexOf(i.indexOf(e))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const r=t[e];let i="__root",c=!1;for(let e=0;e<o.length;e++){var l;const t=r[o[e]],s="".concat(i,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);a[s]||(a[s]=n({__id:s,__parent:i,qValues:[]},t),c=!0),i=s}if(c)for(let e=0;e<s.length;e++){const t=r[s[e]];a[i].qValues.push(t)}}const c=Object.keys(a).map(e=>a[e]);return E().id(e=>e.__id).parentId(e=>e.__parent)(c)}(t):$(o,r,e);if(!a)return null;const l=a.height,c=[];for(let s=0;s<=l;s++){let a=null;if(s>0)if("S"===o.qMode){let e=j(o)[s-1];a=r.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[s-1];s>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),a=r.fields[e]}const{props:l,main:u}=i.normalizeConfig(n(n({},e),{},{field:a?a.key():void 0}),t),h=Object.keys(l);c[s]={propsArr:h,props:l,main:u};const d=a?z(a,{cube:o}):{fieldDepth:0};W({propsArr:h,props:l,cube:o,cache:r,itemDepthObject:d,f:a})}const u=a.copy().descendants(),h=a.descendants();for(let e=0;e<h.length;e++){const t=c[h[e].depth].propsArr,n=c[h[e].depth].props,r=c[h[e].depth].main,i=u[e],o=i.data,a=B(r,o,{key:s});V({propsArr:t,props:n,item:i,itemData:o,ret:a,sourceKey:s}),h[e].data=a}return a}function Y(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<i.length;s++)if(void 0!==i[s].field){const a=t.raw(),l=t.key();if(!$(a,n,e))continue;const c="object"==typeof i[s].field?i[s].field:t.field(i[s].field),{props:u,main:h}=r.normalizeConfig(i[s],t),d=Object.keys(u),f=z(c,{cube:a}),{nodeFn:p,attrFn:m,valueFn:g}=H({fieldDepth:0},f);W({propsArr:d,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!i[s].trackBy,v=typeof i[s].trackBy,b={},x=[],w=p(n.tree),q=[];for(let e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(h.filter&&!h.filter(n))continue;const o=B(h,n,{key:l});V({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[s],itemData:n,obj:o,target:x,tracker:b,trackType:v}),q.push(o)}const M=y?r.collect(x,{main:h,propsArr:d,props:u}):q;o=[...o,...M]}return o}var K=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e){var t;t=function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(h=t[0]).length%l,d=h.length,b=0;b<d;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},e.exports=t()});function X(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const G={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"},J=/%\)?$/,Z=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Q=/^\(oct\)/i,ee=/^\(dec\)/i,te=/^\(hex\)/i,ne=/^\(bin\)/i,re=/^\(rom\)/i,ie=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,oe=/#|0/g;function se(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function ae(e,t,n){let r;return Z.test(t)?e=se(e,Number(/\d{2}/.exec(t)[0]),t,n):Q.test(t)?e=se(e,8,t,n):ee.test(t)?e=se(e,10,t,n):te.test(t)?e=se(e,16,t,n):ne.test(t)?e=se(e,2,t,n):re.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<s.length;n++)if(s[n]<=i){r+=a[n],i-=s[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t)):t+r+e.toExponential(0)),e}function le(e,t,n){const r=X(e);return n?r:new RegExp(r||"",t)}function ce(e,t,n,r){let i,o,s,a,l,c,u,h,d,f=e.pattern;r&&(e.abbreviate=!0),d=function(e,t){return t&&(t=X(t)),e&&(e=X(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}(t,n),s=f.match(d),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(i=s.split(n),o=i.pop(),s=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(le(c,"g"),t)),u=n,n=".",u&&(s=s.replace(le(u,"g"),n)),h=s.match(/#/g),h=h?h.length:0;const p=f.split(u);let m;p[1]&&(m=p[1].match(oe)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=m?m.length:2,e.percentage=J.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(le(t,null,!0),"|").concat(le(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class ue{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return G;const n={};return e.qNumericalAbbreviation.split(t).forEach(e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])}),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new ue(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],ie.test(e[0])&&(r.positive.isFunctional=!0),e[1]?ie.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?ie.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||ce(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&ce(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&ce(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=ae(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let r,i,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(r=t[a-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(h=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=K(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(a=i.length;a<n;a++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),a=0;a<t;a++)l+="#";e=K(l,e)}e=e.replace(u.numericRegex,e=>e===s?u.groupTemp:e===o?u.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function he(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=e=>e}=t;let o,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return s=i(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=i(t),o.has(s)?o.get(s):o.set(s,e(t))),o.set=(e,t)=>(c>=n&&(delete a[l[u]],delete l[u],c--,u++),a[e]=t,l[c]=e,c++,t),o.get=e=>a[e],o.has=e=>e in a,o.clear=()=>{a=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function de(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ue(...t)}(i,e,t,n,r),s=he(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,r){return s.clear(),o.format(t,e,n,r)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const fe="D",pe="T",me="TS",ge="IV",ye=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ve=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],be=["January","February","March","April","May","June","July","August","September","October","November","December"],xe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function we(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function qe(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Me(e,t){let n,r=function(e){const t=e,n=24*qe(t),r=60*qe(n),i=60*qe(r),o=1e3*qe(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,s=r.m,a=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:s,s:a,f:l,t:u}}class Se{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:ye,qDayNames:ve,qLongMonthNames:be,qMonthNames:xe}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),t||(t={[pe]:r.qTimeFmt||"hh:mm:ss",[fe]:r.qDateFmt||"YYYY-MM-DD",[me]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new Se(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),r=Me(e,t));const i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:we("".concat(t.year).slice(-2),2),YYY:we("".concat(t.year).slice(-3),3),def:e=>we("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:we("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:we("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>we("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>we("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>we("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>we("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const s=new RegExp(o.join("|"),"g");return t.replace(s,e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r})}}function De(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Se(...t)}function _e(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=De(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=he(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==ge?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=De(i,e,t),r=he(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function ke(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:s,type:a,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=s||("dimension"===a?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u="dimension"===a?"first":"avg",h=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return _e(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",s=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(i,"##"),o="U"),de(n,r,i,o,t)}(t,i),d={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>a,origin:()=>l,items:()=>(e||(e=o(d)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:e=>(null==e?void 0:e.qText)||"",reduce:u,reduceLabel:"dimension"===a?"first":(e,t)=>h(t),formatter:()=>h,tags:()=>t.qTags};return d}function Ce(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const s="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),a={instance:ke(h({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},i))};return a.attrDims=Ce("qAttrDimInfo",t,n,s,h({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=Ce("qAttrExprInfo",t,n,s,h({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=Ce("qMeasureInfo",t,n,s,h({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a})}function Ee(){let{key:e,data:t,config:r={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=t;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=Ee.util,a={cache:i,cube:o,localeInfo:r.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:r.virtualFields},l={key:()=>e,raw:()=>o,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>i.fields.slice(),extract:e=>a.extractor(e,l,i,s),hierarchy:e=>a.hierarchy(e,l,i,s),_cache:()=>i};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(a.extractor=Y,a.hierarchy=U,a.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(a.extractor=m,a.pages=o.qDataPages,a.hierarchy=U):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},l,i,s);const c="S"===o.qMode?e=>e.qElemNumber:void 0,u="S"===o.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...Ce("qDimensionInfo",o,e,"",h({},a,{value:c,type:"dimension"}))),i.wrappedFields.push(...Ce("qMeasureInfo",o,e,"",h({},a,{value:u,type:"measure"}))),i.fields=i.wrappedFields.map(e=>e.instance);const d=e=>{e.forEach(e=>{i.allFields.push(e.instance),d(e.measures),d(e.attrDims),d(e.attrExps)})};return d(i.wrappedFields),(r.virtualFields||[]).forEach(t=>{const r=l.field(t.from),o=ke(n({meta:r.raw(),id:"".concat(e,"/").concat(t.key),sourceField:r,fieldExtractor:e=>a.extractor({field:e},l,i,s),key:t.key,type:r.type(),localeInfo:a.localeInfo,value:r.value},t.override||{}));i.virtualFields.push(o)}),i.allFields.push(...i.virtualFields),l}const Ae=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],Te=/\/qDimensionInfo(?:\/(\d+))?/,Ie=/\/qMeasureInfo\/(\d+)/,Ne=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,Re=/\/qAttrExprInfo\/(\d+)/,Oe=/\/?qHyperCube/,Pe=/\/?qTreeData/,Le=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),Fe=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function je(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],s={},a=e.isActive();let l=!1;return e.brushes().forEach(e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",s=e=>e;Oe.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=Le):Pe.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=Fe);let a=!0;if(Te.test(e)&&(r=+Te.exec(e)[1]),Ie.test(e)&&(i=+Ie.exec(e)[1]),Ne.test(e)){i=-1,r=0;const e=+Ne.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),a=!1}if(Re.test(e)){const e=i;if(t){i=0;const s=I(o,t);i+=(s.qMeasureInfo||[]).length,r>-1?(i=s.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=s.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=s.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+Re.exec(n)[1]}else r>-1?(r=-1,i=+Re.exec(n)[1]):i+=+Re.exec(n)[1]+1}return Ae.forEach(e=>{let[t,r]=e;n=n.replace(t,r)}),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach(e=>s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach(e=>s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach(e=>s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,a=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));(0===o||a>=o)&&o>-1?n.forEach(e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})}):n.forEach(e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})}),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map(e=>+e).filter(e=>!isNaN(e)),l=!!s.selectHyperCubeCells.values.length);else{const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}}),!l&&a?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]}),s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o);var c}function ze(e){Ee.util=e.data("matrix").util,e.data("q",Ee),e.formatter("q-number",de),e.formatter("q-time",_e)}return ze.qBrushHelper=je,ze.selections=je,ze}());Sg(Hy);const By=/xyz/.test(()=>{})?/\b_super\b/:/.*/,Vy=function(){};function $y(e,t,n,r){0===arguments.length?this.set(0,0,0,0):this.set(e,t,n,r)}Vy.extend=function e(t,n){const r=this.prototype;"string"!=typeof t&&(n=t,t="Class");const i=Object.create(this.prototype);for(const e in n)i[e]="function"==typeof n[e]&&"function"==typeof r[e]&&By.test(n[e])?function(e,t){return function(){const n=this._super;this._super=r[e];const i=t.apply(this,arguments);return this._super=n,i}}(e,n[e]):n[e];if(!/^[_a-z][_a-z\d]*$/i.test(t))throw new Error("Invalid subclass name. Alphanumericals only.");const o=new Function(`return (function ${t}(){ typeof this.init === 'function' && this.init.apply(this, [].slice.call(arguments)) });`)();return o.prototype=i,o.prototype.constructor=o,o.extend=e,o},$y.prototype={toString(){return`${this.x} ${this.y} ${this.width} ${this.height}`},clone(){return new $y(this.x,this.y,this.width,this.height)},set(e,t,n,r){n>=0?(this.x=e,this.width=n):(this.x=e+n,this.width=-n),r>=0?(this.y=t,this.height=r):(this.y=t+r,this.height=-r)},setLTRB(e,t,n,r){e<=n?(this.x=e,this.width=n-e):(this.x=n,this.width=e-n),t<=r?(this.y=t,this.height=r-t):(this.y=r,this.height=t-r)},equal(e){return e&&this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height},combineWith(e){const t=Math.max(e.getRight(),this.getRight()),n=Math.max(e.getBottom(),this.getBottom()),r=Math.min(e.x,this.x),i=Math.min(e.y,this.y);return new $y(r,i,Math.max(0,t-r),Math.max(0,n-i))},intersectsWith(e){return!!e&&(this.x<=e.getRight()&&e.x<=this.getRight()&&this.y<=e.getBottom()&&e.y<=this.getBottom())},intersectsRect(e){return this.intersectsWith(e)},intersection(e,t){if(this.intersectsWith(e)){const t=Math.max(this.x,e.x),n=Math.max(this.y,e.y);return new $y(t,n,Math.min(this.getRight(),e.getRight())-t,Math.min(this.getBottom(),e.getBottom())-n)}return t?null:new $y(this.x,this.y,this.width,this.height)},union(e){const t=Math.min(this.x,e.x),n=Math.min(this.y,e.y);return new $y(t,n,Math.max(this.getRight(),e.getRight())-t,Math.max(this.getBottom(),e.getBottom())-n)},pointInside(e,t){return e>=this.x&&e<=this.getRight()&&t>=this.y&&t<=this.getBottom()},rectInside(e){const t=e.getPoints();let n;for(n=0;n<4;n++)if(!this.pointInside(t[n].x,t[n].y))return!1;return!0},getPoints(){const e=[];return e.push({x:this.x,y:this.y}),e.push({x:this.getRight(),y:this.y}),e.push({x:this.getRight(),y:this.getBottom()}),e.push({x:this.x,y:this.getBottom()}),e},getRight(){return this.x+this.width},getBottom(){return this.y+this.height},getCenterPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}},getBoundingRect(){return this},scale(e){const t=e-1,n=t*this.width/2,r=t*this.height/2;this.x-=n,this.y-=r,this.width*=e,this.height*=e},hasNaN(){return Number.isNaN(+this.x)||Number.isNaN(+this.y)||Number.isNaN(+this.width)||Number.isNaN(+this.height)}};const Wy=new $y(0,0,0,0),Uy=new $y(0,0,0,0),Yy=Vy.extend("CubeSlicer",{init(){this.pages=[]},get(e){return e.map(e=>this.getPage(e))},getPage(e){let t,n;const r=[];let i;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,Wy.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),Uy.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),i=Uy.intersection(Wy,!0),r.push({coverage:i?i.clone():new $y(0,0,0,0),idx:n}),t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n]);return r.sort((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height),r[0].coverage.height>0&&r[0].coverage.width>0?this._extract(e,this.pages[r[0].idx]):{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qMatrix:[]}},destroy(){this.clear()},isEmpty(){return!(this.pages&&this.pages[0]&&this.pages[0].qArea.qHeight&&this.pages[0].qArea.qWidth)},clear(){this.pages=[]},store(e){this.pages=e},containsArea(e){let t;for(let n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return!0;return!1},contains(e){return!(!this.pages||!this.pages.length)&&0===e.filter(e=>!this.containsArea(e)).length},_extract(e,t){Wy.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),Uy.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=Wy.intersection(Uy,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qMatrix:[]};const r=Math.max(0,e.qTop-t.qArea.qTop),i=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qMatrix.slice(r,r+n.height).map(e=>e.slice(i,i+n.width));return{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qMatrix:o}}});let Ky;function Xy(e,t){let n;const r={};for(n in e)"qSubNodes"!==n&&e.hasOwnProperty(n)&&(r[n]=e[n]);return t.push(r),r}function Gy(e,t,n){let r,i,o;const s=[];let a=[],l=0,c=0;for(n.length&&(l=n[0].qUp||0,c=n[n.length-1].qDown||0),r=0;r<n.length;++r)if(i=n[r],i.qSubNodes.length>0&&(a=Gy(e,t,i.qSubNodes)),o=null,(0===i.qSubNodes.length&&Ky>=e&&Ky<=e+t||a.length>0)&&(o=Xy(i,s),void 0!==o.qUp&&1===s.length&&(o.qUp=l+r),o.qSubNodes=a),0===i.qSubNodes.length&&Ky++,Ky===e+t){o&&void 0!==o.qDown&&(o.qDown=c+(n.length-1-r));break}return s}function Jy(e,t,n){return Ky=0,Gy(e,t,n)}const Zy=new $y(0,0,0,0),Qy=new $y(0,0,0,0),ev=Yy.extend("PivotCubeSlicer",{init(){this._super(),this.requestedAreas=[]},getPage(e){let t,n;const r=[];let i;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,Zy.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),Qy.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),i=Qy.intersection(Zy,!0),r.push({coverage:i?i.clone():new $y(0,0,0,0),idx:n}),t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n]);return r.sort((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height),r[0].coverage.height>0&&r[0].coverage.width>0?this._extract(e,this.pages[r[0].idx]):{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}}},_extract(e,t){Zy.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),Qy.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=Zy.intersection(Qy,!0);if(!n)return{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}};const r=Math.max(0,e.qTop-t.qArea.qTop),i=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qData.slice(r,r+n.height).map(e=>e.slice(i,i+n.width));return{qLeft:Jy(r,n.height,t.qLeft),qTop:Jy(i,n.width,t.qTop),qData:o,qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height}}}});function tv(e){if("pivot-table"===e.visualization)this.responseProperty="qPivotDataPages",this.slicer=new ev;else{if("table"!==e.visualization)return;this.slicer=new Yy}let t=e.snapshotData.object.origDataPages;t||(t=e.qHyperCube[this.responseProperty]),this.slicer.store(t.filter(e=>e))}class nv{constructor(e,t,n){this.layout=e,this.dataPath=t,this.responseProperty=n,tv.call(this,e)}getData(e){!function(e,t,n,r){if(e){t.snapshotData.object.origDataPages||(t.snapshotData.object.origDataPages=t.qHyperCube[r]);for(let e=0;e<n.length;e++)n[e].qHeight=Math.min(t.qHyperCube.qSize.qcy,n[e].qHeight),n[e].qTop=t.snapshotData.object.origDataPages[e].qArea.qTop;t.qHyperCube[r]=e.get(n)}}(this.slicer,this.layout,e,this.responseProperty);const t=Py(this.layout,`${this.dataPath}.${this.responseProperty}`);return Promise.resolve(t)}setCacheOptions(){}updateCache(){}}const rv={version:"1.0.2",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"K",qAlwaysFullyExpanded:!0,qSuppressZero:!1,qSuppressMissing:!0},color:{box:{paletteColor:{index:-1,color:"#e6e6e6"}},expressionLabel:"",point:{auto:!0,mode:"primary",useBaseColors:"off",expressionIsColor:!0}},dataPoint:{bubbleScales:100,displacement:"none"},dimensionAxis:{dock:"near",label:"auto",show:"all"},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"all",spacing:1},gridlines:{auto:!0,spacing:2},orientation:"horizontal",presentation:{visibleComponents:"points_box"},refLine:{refLines:[]},sorting:{autoSort:!0},showTitles:!0,subtitle:"",title:"",footnote:""};function iv(e){2===e.qHyperCubeDef.qInterColumnSortOrder.length?e.qHyperCubeDef.qInterColumnSortOrder=[1,0]:3===e.qHyperCubeDef.qInterColumnSortOrder.length&&(e.qHyperCubeDef.qInterColumnSortOrder=[1,2,0])}function ov(e){e.qHyperCubeDef.qDimensions.length>1&&e.color&&(e.color.point.persistent=!0)}function sv(e){const{translator:t}=e,n={min:1,max:2,description(e,n){let r;return r=0===n?"Visualizations.Descriptions.Point":"horizontal"===e.orientation?"properties.yAxis":"properties.xAxis",t.get(r)},added(e,t){iv(t),ov(t)},moved(e,t){iv(t),ov(t)},removed(e,t){iv(t),ov(t)}},r={min:1,max:1,description(e){const n="horizontal"===e.orientation?"properties.xAxis":"properties.yAxis";return t.get(n)}};return{path:"/qHyperCubeDef",dimensions:n,measures:r}}var av,lv={exports:{}};var cv=(av||(av=1,function(e){self,e.exports=(()=>{var e={909:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},s=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(h,n),h!==(i=l(t,n))&&(p&&i&&(s(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},a(h,{name:n,newValue:e(p,u,i)})):void 0!==i&&a(h,{name:n,newValue:i}));return h}},8:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},s=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(h,n),h!==(i=l(t,n))&&(p&&i&&(s(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},a(h,{name:n,newValue:e(p,u,i)})):void 0!==i&&a(h,{name:n,newValue:i}));return h}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Te});var e=r(229),t=r.n(e);const n=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],s=e;for(r=0;r<i.length-1;++r)void 0===s[i[r]]&&(s[i[r]]=Number.isNaN(+i[r+1])?{}:[]),s=s[i[r]];if(void 0!==n){var a=s[o];return s[o]=n,{updated:n,previous:a}}return delete s[o],!1},o=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},s={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var a="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function c(e){return a+e+l}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var s=r.qDerivedFieldData.qDerivedFieldLists[o],a=0;a<s.qFieldDefs.length;++a){var l=s.qFieldDefs[a];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function h(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function v(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function b(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,s=void 0===o?"Sum":o,a=e.valueComp,l=void 0===a?"0":a;if(!n.showExcludedValues)return"";if(r&&1===r.length){var c=v(u(r[0],i),p(0));return"".concat(s,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var h=u(r[0],i),d=u(r[1],i),f=p(0),m=p(1),g=v(h,f),y=v(d,m);return"".concat(s,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(s,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function w(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const q={isFullRange:h,getNumDimensions:w,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,s=c(f(t));if(!n.showExcludedValues)return s;var a=b({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var u=p(0);return"If(Count(".concat(u,") > 0, ").concat(s," + ").concat(a).concat(l,")")}if(r&&2===r.length){var h=p(0),d=p(1);return"If(Count(".concat(h,") * Count(").concat(d,") > 0, ").concat(s," + ").concat(a).concat(l,")")}return s},getRowNoComp:d,getNumStepComp:function(e,t){if(!h(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return m(e,t)+n+g(r)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===w({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",s=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(s,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(s,")"):r},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(a);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+a.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach(function(n){void 0===e[n]&&(e[n]=t[n])})},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,s=void 0===o?2:o;if(!t&&!n)return!0;var a=w({properties:t,layout:n});return a>=i&&a<=s},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(a),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=n.qHyperCubeDef.qMeasures.find(function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null});i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=s.OPTIONS.find(function(t){return t.value===e.decomposition});return t?s.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(s.EXPRESSIONS).find(function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return s.EXPRESSIONS[n]&&r.includes(s.EXPRESSIONS[n].toLowerCase())&&(t=n),n}),t}};function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function S(e){return S="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},S(e)}var D=t().bind(null,!0),_={},k=Array.isArray;function C(e){return null!=e&&!Array.isArray(e)&&"object"===S(e)}function E(e){return void 0===e}function A(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function T(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach(function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=E(e[n||t])?o:e[t],e=e[n||t]}}),e}function I(e,t){var n=!0;if(C(e)&&C(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){I(e[r],t[r])||(n=!1)}),n);if(k(e)&&k(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!I(e[r],t[r]))return!1;return!0}return e===t}_.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?D({},{val:e}).val:e}(t[i]),s=e[i],a="".concat(n,"/").concat(i);I(o,s)||A(t,i)||(E(s)?r.push({op:"add",path:a,value:o}):C(o)&&C(s)?r=r.concat(_.generate(s,o,a)):k(o)&&k(s)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function s(e,t,n){if(e[n]&&E(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(I(t,i))return r;if(!E(t[0])&&E(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var a=i.length-1;a>=0;a-=1)-1===(o=s(t,i[a].qInfo&&i[a].qInfo.qId,a))?(r.push({op:"remove",path:"".concat(n,"/").concat(a)}),i.splice(a,1)):r=r.concat(_.generate(i[a],t[o],"".concat(n,"/").concat(a)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=s(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(s,o,a)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))}),Object.keys(e).forEach(function(i){E(t[i])&&!A(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},_.apply=function(e,t){t.forEach(function(t){var n,r,i=T(e,t.path),o=t.path.split("/").splice(-1)[0],s=o&&Number.isNaN(+o)?i[o]:i[+o]||i,a=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,s=e),"add"===t.op||"replace"===t.op)if(k(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(k(s)&&k(t.value)){var l,c=t.value.slice();s.length=0,(l=s).push.apply(l,function(e){if(Array.isArray(e))return M(e)}(r=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(C(s)&&C(t.value))n=s,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!A(n,e)&&delete n[e]}),D(s,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var u=T(e,t.from);k(i)?i.splice(+o,0,u.splice(+a,1)[0]):(i[o]=u[a],delete u[a])}else"remove"===t.op&&(k(i)?i.splice(+o,1):delete i[o])})},_.clone=function(e){return D({},e)},_.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},_.updateObject=function(e,t){Object.keys(e).length?_.apply(e,_.generate(e,t)):D(e,t)};const N=_,R=function(e,n,r){if(!e)return Promise.resolve();var i=N.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),e.applyPatches(i,!0)):Promise.resolve()};var O="accumulation";function P(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===O)return n[r]}function L(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===O)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var F={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const j={translationKey:"properties.modifier.accumulation",needDimension:q.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,s=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=s;void 0===l&&(l=q.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=q.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=q.getNumStepComp(n,l),d=q.getAboveComp(n,l,u,h),f=q.getRangeComp("RangeSum",d);if(q.needDimension({modifier:n,properties:r,layout:i})){var p=q.getDimComp(c,1),m=q.getDimComp(c,0),g=q.getAggrComp(f,p,m);f=n.showExcludedValues?q.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,valueComp:g}):g}return f},extractInputExpression:q.extractInputExpression,initModifier:function(e){q.initModifier(e,F)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!q.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(L(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(L(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(L(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(L(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=P(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=P(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(L(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return q.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(O))return!1;var o=P(t,e);return o&&!o.disabled}};return n}};var z="movingAverage";function H(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===z)return n[r]}function B(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===z)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var V={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const $={translationKey:"properties.modifier.movingAverage",needDimension:q.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,s=e.layout,a=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=a;void 0===c&&(c=q.getNumDimensions({properties:i,layout:s}));var u=o(i,"qHyperCubeDef.qDimensions",[]),h=r.showExcludedValues&&r.nullSuppression,d=q.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:h}),f=q.getNumStepComp(r,c),p=q.getAboveComp(r,c,d,f);if(r.nullSuppression)t=q.getRangeComp("RangeAvg",p);else{var m=q.getRangeComp("RangeSum",p),g=function(e,t){var n=q.getRowNoComp(e,t);if(!q.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,c);t="".concat(m," / ").concat(g)}var y=t;if(q.needDimension({modifier:r,properties:i,layout:s})){var v=q.getDimComp(u,1),b=q.getDimComp(u,0),x=q.getAggrComp(y,v,b);y=r.showExcludedValues?q.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:q.extractInputExpression,initModifier:function(e){q.initModifier(e,V)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!q.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(B(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(B(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(B(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(B(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=H(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=H(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(B(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(B(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return q.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(z))return!1;var o=H(t,e);return o&&!o.disabled}};return n}};var W="timeSeriesDecomposition";function U(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===W)return n[r]}function Y(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===W)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var K={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const X={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:q.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?q.generateTSDExpression(n,t,r):t},extractInputExpression:q.extractInputExpression,initModifier:function(e,t){q.initModifier(e,K),""===e.decomposition&&t&&(e.decomposition=q.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!q.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(Y(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:s.OPTIONS},steps:{refFn:function(t){return"".concat(Y(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=U(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map(function(e){return e.qDef.modifiers.map(function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e}),e})}},show:function(t){var n=U(t,e);return n&&!n.fullRange}}},show:function(e,t){return q.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(W))return!1;var o=U(t,e);return o&&!o.disabled}};return n}};var G="difference";function J(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===G)return n[r]}function Z(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===G)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:q.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:q.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,s=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=s;void 0===l&&(l=q.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=q.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=q.getAboveComp(n,l,u),d="".concat(u," - ").concat(h);if(q.needDimension({modifier:n,properties:r,layout:i})){var f=q.getDimComp(c,1),p=q.getDimComp(c,0),m=q.getAggrComp(d,f,p);d=n.showExcludedValues?q.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,funcComp:"Only",valueComp:m}):m}return d},initModifier:function(e){Object.keys(Q).forEach(function(t){void 0===e[t]&&(e[t]=Q[t])})},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!q.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(Z(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return q.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(G))return!1;var o=J(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function se(e){return 2===e?"{1}":""}function ae(e,t,n){return 1===e?"{$<".concat(q.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ce(e,t,n){return 0===e&&t>1?"<".concat(q.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:q.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,s=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=s;void 0===l&&(l=q.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=q.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,r,i,o,s){var a=se(t),l=ae(t,n,r),c=""===a&&""===l?"":a||l,u=le(i,o),h=ce(i,o,s),d=function(e){for(var t=[],n=0;n<e;n++)t[n]=q.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(h," Aggr(").concat(c," ").concat(e,", ").concat(d,"))")}(u,h,n.field,n.value,d,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach(function(t){void 0===e[t]&&(e[t]=oe[t])})},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!q.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var r=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then(function(e){return e.map(function(e){return{label:e.qName,value:e.qName}})})},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(re(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(re(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,r){return function(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return q.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:se,getFieldSelectionComp:ae,getTotalComp:le,getSelectedDimComp:ce};var he="qDef.base",de="qDef.qDef",fe="qDef.base.qDef",pe="qLibraryId",me="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,fe);return void 0!==t?t:o(e,de)},getExpressionRef:function(e){return void 0!==o(e,fe)?fe:de},getLibraryIdRef:function(e){return o(e,me)?me:pe},getLibraryId:function(e){return o(e,me)||o(e,pe)},getLabelRef:function(e){return o(e,he)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,he)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",we="qDef.qLabel",qe="qDef.qLabelExpression",Me="qDef.base.qLabel",Se="qDef.base.qLabelExpression",De="qDef.qAggrFunc",_e="qDef.base.qAggrFunc",ke={initBase:function(e,t){(t||ke.isValid(e))&&(n(e,ve,o(e,ye)),n(e,xe,o(e,be)),n(e,Me,o(e,we)),n(e,Se,o(e,qe)))},restoreBase:function(e){ke.isValid(e)&&(n(e,ye,o(e,ve)),n(e,be,o(e,xe)),n(e,we,o(e,Me)),n(e,qe,o(e,Se)),o(e,De)&&o(e,_e)&&n(e,De,o(e,_e)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),n=o(e,xe);return void 0!==t||void 0!==n}};const Ce=ke;function Ee(e){return Ee="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},Ee(e)}var Ae={accumulation:j,movingAverage:$,difference:ee,normalization:ue,timeSeriesDecomposition:X};const Te={modifiers:Ae,apply:Ne,applyModifiers:Re,cleanUpMeasure:Oe,destroy:function(e){e&&Ie[e.id]&&Ie[e.id].masterItemSubscriber&&(Ie[e.id].masterItemSubscriber&&Ie[e.id].masterItemSubscriber.unsubscribe(),delete Ie[e.id])},hasActiveModifiers:Pe,getActiveModifier:Le,initBase:Ce.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Ae[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return Ae[e]&&Ae[e].isApplicable({properties:n,layout:r})})},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=ze(e);Ye({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ze({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:Fe};var Ie={};function Ne(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,s=void 0!==i&&i,a=e.masterItem,l=!1;Ie[n.id]=Ie[n.id]||{isFirstTime:!0};var c=Ie[n.id].isFirstTime;if(Ie[n.id].isFirstTime=!1,r&&"object"===Ee(r))return Re({model:n,properties:r});var u=n?n.layout:void 0,h=o(u,"qSelectionInfo.qInSelections");if(s||h)return Promise.resolve(l);var d=o(u,"qHyperCube.qMeasureInfo"),f=Ie[n.id].lastReloadTime;if(Ie[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Pe({measures:d,layout:u})){var p=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ue({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:d,layout:u,model:n,lastReloadTime:f});return p||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some(function(e){return function(e){var t=e.measure,n=e.layout;return Ye({modifiers:ze(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:d,layout:u,masterItem:a,isFirstTime:c})?n.getEffectiveProperties().then(function(e){var r=t()(!0,{},e);Be(r);var i=Qe(r);return Ke({model:n}).then(function(t){return Xe({libraryIds:i,model:n}).then(function(i){return p&&function(e){var t=e.properties;je(t).forEach(function(e){return function(e){var t=e.measure;if(Ue({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===Ee(e)&&!e.disabled){if(n++,"object"!==Ee(Ae[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=Ae[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&$e(t)&&q.simplifyExpression(t.qDef.base.qDef)!==q.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:r}),Re({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:a,libraryItemsProps:i,dimensionAndFieldList:t})})})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===Ee(e.base)})}(d)?n.getEffectiveProperties().then(function(e){return function(e){var n=e.model,r=e.properties,i=Qe(r);return et({model:n,libraryIds:i}).then(function(){var e=t()(!0,{},r);return je(r).forEach(function(e){return Oe(e)}),Je({oldProperties:e,newProperties:r,model:n})})}({model:n,properties:e})}):Promise.resolve(l)}function Re(e){var n=e.model,r=e.oldProperties,i=e.properties,s=e.measures,a=e.runUpdateIfChange,l=void 0!==a&&a,c=e.masterItem,u=e.libraryItemsProps,h=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),Be(i);var d=Qe(i);return et({model:n,libraryIds:d,masterItem:c}).then(function(){return function(e){var n=e.measures,r=e.properties,i=e.model,s=e.libraryItemsProps,a=e.dimensionAndFieldList;if(n||(n=je(r)),!n.length)return Promise.resolve();if(!Pe({measures:n,properties:r}))return n.forEach(function(e){return Oe(e)}),Promise.resolve();var l=s?void 0:Qe(r);return Ke({model:i,dimensionAndFieldList:a}).then(function(e){return Xe({libraryIds:l,model:i,libraryItemsProps:s}).then(function(i){n.forEach(function(n){Ye({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,s=e.dimensionAndFieldList,a=0;Ce.isValid(n)||Ce.initBase(n,!0);var l=n.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach(function(e){if("object"===Ee(e)&&!e.disabled){if(a++,"object"!==Ee(Ae[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(a>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Ae[e.type].initModifier(e,n);var l=n.qLibraryId||u&&u.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,s=e.libraryItemsProps[e.libraryId],a=s.qMeasure.qDef,l=""===a?a:Ae[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||s.qMeasure.qLabel)&&(n.qDef.qLabel=s.qMeasure.qLabel),(n.qDef.qLabelExpression||s.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=s.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&s.qMeasure.qNumFormat&&(n.qDef.qNumFormat=s.qMeasure.qNumFormat,n.qDef.isCustomFormatted=s.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=s.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:s}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof Ae[r.type].updateModifier&&Ae[r.type].updateModifier(r,i.qHyperCubeDef);var s=ge.getExpression(n),a=""===s?s:Ae[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=a,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||s,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:s}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||Fe(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&Fe(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}})}({measure:n,properties:r,libraryItemsProps:i,dimensionAndFieldList:e}),Ve(n)):Oe(n)})})})}({measures:s,properties:i,model:n,libraryItemsProps:u,dimensionAndFieldList:h}).then(function(){return l?Je({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)})})}function Oe(e){!function(e){var t=ze(e);return Array.isArray(t)&&t.some(function(e){return"object"===Ee(e)&&!e.disabled&&!Ae[e.type]})}(e)?Ce.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Ve(e)}function Pe(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ye({modifiers:ze(e),properties:n,layout:r})})}function Le(e){var t=ze(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Ae[r.type]&&!r.disabled)return r}}function Fe(e){var t=Le(e);return!t||Ae[t.type].enableTotalsFunction(e)}function je(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function ze(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function He(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function Be(e){je(e).forEach(function(e){return function(e){var n=Le(e);n&&(void 0!==n.outputExpression&&He(n)!==e.qDef.qDef?delete e.qDef.base:!Ce.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)})}function Ve(e){var t=ze(e);Array.isArray(t)&&t.forEach(function(t){"object"===Ee(t)&&(t.disabled||!Ae[t.type]&&He(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function $e(e){return e.base||e.qDef&&e.qDef.base}function We(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function Ue(e){var t=e.measure,n=e.properties,r=e.layout;return!We(t)&&Ye({modifiers:ze(t),properties:n,layout:r})}function Ye(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==Ee(e)||e.disabled||!Ae[e.type])&&(void 0===i[e.type]&&(i[e.type]=Ae[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Ke(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then(function(e){i.dimensionList=e});r.push(o);var s=t.app.getFieldList().then(function(e){i.fieldList=e});return r.push(s),Promise.all(r).then(function(){return i})}function Xe(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,s={},a=[];return i.forEach(function(e){var t=n.app.getMeasure(e).then(function(t){return t.getProperties().then(function(t){s[e]=t})});a.push(t)}),o.forEach(function(e){var t=n.app.getDimension(e).then(function(t){return t.getProperties().then(function(t){s[e]=t})});a.push(t)}),Promise.all(a).then(function(){return s})}function Ge(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Ge)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Ge)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ge)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ge);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):R(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Ze(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===Ee(e)&&!e.disabled&&Ae[e.type]&&Ae[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Qe(e){var t=je(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=ze(t);if(Ye({modifiers:r,properties:e})){var o=We(t);o&&n.push(o),i=i||Ze({modifiers:r,properties:e})}}),o(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&r.push(t)}),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Ie[t.id].masterItemSubscriber=Ie[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},s={},a={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&a[n]&&a[n].forEach(function(n){t[n]=o(e,n)}),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function u(e,n){return t.app[n](e).then(function(t){r[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}})}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,a=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach(function(e){i[e]=!0}),s={},t.forEach(function(e){s[e]=!0})}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach(function(e){i[e]||s[e]||(r[e].listener.dispose(),delete r[e])}),t.app&&(Object.keys(i).forEach(function(e){i[e]&&!r[e]&&a.push(u(e,"getMeasure"))}),Object.keys(s).forEach(function(e){s[e]&&!r[e]&&a.push(u(e,"getDimension"))})),Promise.all(a)},unsubscribe:function(){Object.keys(r).forEach(function(e){r[e].listener.dispose()}),r={}}}}({model:t,callback:function(e){return Ne({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),Ie[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}n.d(r,{default:()=>Be});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var s=r[o];if(""!==s){if(void 0===i[s]||null===i[s])return n;i=i[s]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,s=0;s<r.length-1;++s){var a=r[s];void 0!==o[a]&&null!==o[a]||(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function s(e){return function(e){if(Array.isArray(e))return a(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 a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(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 a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return c(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 c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(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 c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}const h={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:u};var d=n(8),f=n.n(d);const p=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,s(r.qDimensions));var a,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(a=i.excludedDimensions).push.apply(a,s(l))},m=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var s,a=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");a&&(s=i.excludedMeasures).push.apply(s,l(a))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&h.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach(function(e){t.properties[e]=n[e]})},v=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach(function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])}),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach(function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)})}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},b=function(e){e.forEach(function(e){f().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)})};function x(e,t,n){var r,i,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((i=(i=(r=JSON.stringify(a)).match(/:\{/g))?i.length:0)>2&&!s)return;a=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var l=o.getValue(e,"qLayoutExclude.quarantine");l[n]||(l[n]={}),l[n][t]=a}var w=n(909),q=n.n(w);function M(e,t){var n=q()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function S(e,t){return q()(!0,{},t,e)}function D(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var _=Math.pow(2,53)-1;function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const E=function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},A=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},T=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},I=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}}},N=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},R=function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,s=e.defaultDimension,a=n.data[0];for(t=0;t<a.dimensions.length;++t){var l=M(a.dimensions[t],s);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<a.excludedDimensions.length;++t){var c=M(a.excludedDimensions[t],s);o.qDimensions.length<i?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},O=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,s=e.defaultMeasure,a=n.data[0];for(t=0;t<a.measures.length;++t){var l=S(a.measures[t],s);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<a.excludedMeasures.length;++t){var c=S(a.excludedMeasures[t],s);o.qMeasures.length<i?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},P=function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},s=r.measures||{max:0},a=D(s.max,i.dimensions.length,_),l=D(s.min,i.dimensions.length,0);return{maxDimensions:D(o.max,a,_),minDimensions:D(o.min,l,0),maxMeasures:a,minMeasures:l}},L=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(h.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,h.indexRemoved(n.qInterColumnSortOrder,o))},F=function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach(function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=q()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some(function(e){return"general"===e.key})}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]}),null===(i=q()(!0,{},n,i)).components&&(i.components=[]),i},j=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=t.data[0];return s.dimensions.length>n&&n>0||s.measures.length>i&&i>0||s.excludedDimensions.length>0&&s.dimensions.length+s.excludedDimensions.length>r||s.excludedMeasures.length>0&&s.measures.length+s.excludedMeasures.length>o||!i&&s.measures.length>0||!n&&s.dimensions.length>0},z=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=e.newHyperCubeDef,a=t.data[0];s.qLayoutExclude||(s.qLayoutExclude={}),s.qLayoutExclude.qHyperCubeDef||(s.qLayoutExclude.qHyperCubeDef={}),(a.dimensions.length>n&&n>0||a.excludedDimensions&&a.excludedDimensions.length&&a.dimensions.length+a.excludedDimensions.length>r)&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(a.measures.length>i&&i>0||a.excludedMeasures&&a.excludedMeasures.length&&a.measures.length+a.excludedMeasures.length>o)&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&a.measures.length&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&a.dimensions.length&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},H=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var s=o.getValue(n,i||"").qHyperCubeDef,a=function(e){if(Array.isArray(e))return k(e)}(t=s.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();s.qDimensions=[],a.forEach(function(e){s.qDimensions.push(e),r.dimensions.added(e,n)})}},B=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var s=o.getValue(n,i||"").qHyperCubeDef,a=function(e){if(Array.isArray(e))return C(e)}(t=s.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();s.qMeasures=[],a.forEach(function(e){s.qMeasures.push(e),r.measures.added(e,n)})}},V=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f().isSupportedModifiers(n)&&t.forEach(function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store})};function $(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach(function(t){o.setValue(e,t,n[t])}),delete e.qLayoutExclude.quarantine[t],!0)}const W={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),s=t.qProperty,a=o.getValue(s,n||""),l=a.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p({exportFormat:i,qHyperCubeDef:l}),m({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:s}),n&&(i.properties.qHyperCubeDef=l,delete a.qHyperCubeDef),v({exportFormat:i,properties:s}),r||b(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(x(i.properties,"filters","storedFilters",!0),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(x(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(x(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,s=void 0===i?{}:i,a=e.defaultPropertyValues,l=void 0===a?{}:a,c=e.hypercubePath,u=e.extension,h=e.supportedFilters,d=void 0===h||h,f=e.isHCModifierSupported,p=void 0===f||f,m={qChildren:[]},g=F({exportFormat:t,initialProperties:r,hypercubePath:c}),y=o.getValue(r,c||"").qHyperCubeDef,v=o.getValue(g,c||"").qHyperCubeDef,b=P({exportFormat:t,dataDefinition:s}),x=b.maxDimensions,w=b.minDimensions,q=b.maxMeasures,M=b.minMeasures,S=l.defaultDimension,D=void 0===S?I():S,_=l.defaultMeasure,k=void 0===_?N():_;v.qDimensions.length=0,v.qMeasures.length=0,j({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:q,minMeasures:M})&&z({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:q,minMeasures:M,newHyperCubeDef:v}),R({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:v,defaultDimension:D}),O({exportFormat:t,maxMeasures:q,minMeasures:M,newHyperCubeDef:v,defaultMeasure:k}),H({newProperties:g,dataDefinition:s,hypercubePath:c}),B({newProperties:g,dataDefinition:s,hypercubePath:c}),L({exportFormat:t,newHyperCubeDef:v}),A("qMaxStackedCells",y,v),A("qNoOfLeftDims",y,v),T("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),T("qMode",y,v,"S"),T("qReductionMode",y,v,"N"),T("qSortbyYValue",y,v),T("qIndentMode",y,v),T("qShowTotalsAbove",y,v),E(g,t,r),m.qProperty=g;var C=o.getValue(u||{},"support.modifiers");return V({measures:v.qMeasures,modifierTypes:C}),d&&$(m.qProperty,"storedFilters"),"S"===v.qMode&&p&&$(m.qProperty,"dynamicScript"),m}};var U={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function Y(e,t,n,r){t=t||[];var i=u(e,r,n),o=u(t,r,n);if(-1!==i&&-1===o){var s=e.splice(i,1);t.push(s[0])}return t}function K(e,t){return e.length!==t}const X={create:function(e,t){if(!e||!U[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach(function(e){n[e]=t[e]}),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var s=e[o][n],a=t.length;if(Y(s,t,r,i),K(t,a))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"}},G={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},J={colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>0&&G.getNumMeasures(e)<=1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)>0},expression:function(e){return G.getNumMeasures(e)>=1}}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return G.getNumMeasures(e)>=1}}};var Q={scatterplot:Z,"sn-scatter-plot":Z,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return G.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)<=1},expression:function(e){return G.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>=1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)>=1},expression:function(e){return G.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 G.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=h.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=X.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}),t.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,s=e.measures,a=e.label;te(r,i);var l=r[r.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var f=X.create(X.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=s)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=h.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:f,measures:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function ie(e,t,n,r){var i,o,s,a={};switch(e){case"dimension":n.qLibraryId?(a.type="dimension",a.name=n.qLibraryId,a.id=n.qLibraryId):(a.type="field",t?(a.name=n.label||n.qDef,a.id=n.qDef):(a.name=n.qDef.qFieldDefs[0],a.label=(s=n.qDef).qLabelExpression?s.qLabelExpression:s.qFieldLabels&&s.qFieldLabels[0]?s.qFieldLabels[0]:s.qFieldDefs[0]));break;case"measure":i=function(e,t){return t?e.qLibraryId:f().measureBase.getLibraryId(e)}(n,t),i?(a.type="measure",a.name=i,a.id=i,o=function(e,t){return f().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(a.expression=o)):(a.type="expression",t?(a.name=n.label||n.qExpression,a.id=n.qExpression):(a.name=n.qDef.qDef,a.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return a}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function se(e,t,n,r){var i=t.type,o=e.color,s=o.mode,a=G.getItemLabel(t);switch(ne(e,a||""),i){case"field":s="byDimension",o.byDimDef={label:t.label||G.wrapFieldName(t.name),key:G.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":s="byMeasure",o.byMeasureDef={label:a,key:t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":s="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":s="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}o.auto=!1,o.mode=s}function ae(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byDimDef");if(s&&ne(e,s.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,se(e,i)}(e,t);else if(function(e){return!e||!e.key}(s)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),s=Number(i[1]),a=o.getValue(t,"layers.".concat(s,".type"));return 2===e.length&&"map"===r&&"point"===a}(n,e,t)?0:n.length-1],i=X.IDMAP.COLOR_BY_ALTERNATIVE,s=h.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return se(e,ie("dimension",!!s,s||r)),!!s}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ce=function(e,t){var n={primary:!0};if(e){var r=(Q[t]||J).colorModeOptions||J.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ue=function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},he=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),s=o.getValue(e,"".concat(t,"qDimensions"),[]),a=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(s,l):!(n={auto:i,colorMode:r,dimensions:s}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?ae(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,s=e.properties,a=o.getValue(s,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==a&&!i.length)}({auto:i,colorMode:r,dimensions:s,measures:a,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byMeasureDef");if(s&&ne(e,s.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,se(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(s,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],s=X.IDMAP.COLOR_BY_ALTERNATIVE,a=h.findItemByPropertyValue(i.qAttributeExpressions,"id",s);return se(e,ie("measure",!!a,a||r[0])),!!a}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,s)}(e,t)},de=function(e){e.forEach(function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode})},fe=function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},pe=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},me=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=W.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],s=o.dimensions.concat(o.excludedDimensions),a=o.measures.concat(o.excludedMeasures),l=X.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return X.moveByIdFromGroup(s,[],"qAttributeDimensions",c),X.moveByIdFromGroup(s,[],"qAttributeExpressions",c),X.moveByIdFromGroup(a,[],"qAttributeExpressions",u),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,s=e.hypercubePath,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=W.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:s,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty,d=o.getValue(h,"visualization"),f=o.getValue(h,"qHyperCubeDef.qDimensions",[]),p=o.getValue(h,"color.mode",""),m=o.getValue(h,"color.auto",""),g=ce(h,d),y=ue({canColorBy:g,autoColor:m,colorMode:p,dimensions:f});return g[p]?fe({shouldUpdateColorBy:y,properties:h})&&pe(h):me(h),y&&he(h,"qHyperCubeDef."),ge(h)&&le(h,"color.persistent",!0),de(f),u}};var ve=["bar","marker","line"];const be=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?$(n,"unsupportedAutoMinMax")||q()(n.measureAxis,t.measureAxis):$(n,"supportedAutoMinMax")||q()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,s=i.qHyperCubeDef,a=i.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach(function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),ve.includes(r)&&t[i].type[r]++,t[i].type.total++}}),t}(s);l.length?(o&&(t=l.filter(function(e){return e.type[o]>0}).sort(function(e,t){return t.type[o]-e.type[o]})),t&&t.length||(t=l.sort(function(e,t){return t.type.total-e.type.total})),t&&t[0]&&q()(a,n.properties.measureAxes[t[0].axis])):q()(a,n.properties.measureAxes[0])}},we=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},qe={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,s=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),a=s.properties;return o?(x(a,"measureAxis.min","supportedAutoMinMax"),x(a,"measureAxis.max","supportedAutoMinMax")):(x(a,"measureAxis.min","unsupportedAutoMinMax"),x(a,"measureAxis.max","unsupportedAutoMinMax")),s},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,s=e.measureType,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty;return be({initialProperties:n,properties:h}),xe({exportFormat:t,initialProperties:n,properties:h,measureType:s}),we(h.qHyperCubeDef),h.qHyperCubeDef.qColumnOrder=[],h.qHyperCubeDef.columnOrder=[],u}};function Me(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Se(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,s=e.itemPath,a=o.getValue(i,s);if(void 0!==a){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var c=Me(n,r,l);o.setValue(t,c,a),o.setValue(i,s,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})})}function De(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,s=e.itemPath,a=o.getValue(i,"qDef.cId");if(a){var l=Me(n,r,a),c=o.getValue(t,l);void 0!==c&&(o.setValue(i,s,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})})}var _e="qHyperCubeDef.qMeasures",ke="conditionalColoring",Ce="measures",Ee="qDef.conditionalColoring";const Ae={quarantine:function(e){Se({properties:e,arrayPath:_e,quarantineName:ke,arrayName:Ce,itemPath:Ee})},unquarantine:function(e){De({properties:e,arrayPath:_e,itemPath:Ee,arrayName:Ce,quarantineName:ke})}};var Te="qHyperCubeDef.qMeasures",Ie="measures",Ne="qHyperCubeDef.qDimensions",Re="dimensions",Oe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Pe="alternativeMeasures",Le="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",Fe="alternativeDimensions",je="qCalcCondition",ze="conditionalShowHide";const He={quarantine:function(e){Se({properties:e,arrayPath:Te,quarantineName:ze,arrayName:Ie,itemPath:je}),Se({properties:e,arrayPath:Ne,quarantineName:ze,arrayName:Re,itemPath:je})},unquarantine:function(e){De({properties:e,arrayPath:Te,quarantineName:ze,arrayName:Ie,itemPath:je}),De({properties:e,arrayPath:Ne,quarantineName:ze,arrayName:Re,itemPath:je})},quarantineAlternative:function(e){Se({properties:e,arrayPath:Oe,quarantineName:ze,arrayName:Pe,itemPath:je}),Se({properties:e,arrayPath:Le,quarantineName:ze,arrayName:Fe,itemPath:je})},unquarantineAlternative:function(e){De({properties:e,arrayPath:Oe,quarantineName:ze,arrayName:Pe,itemPath:je}),De({properties:e,arrayPath:Le,quarantineName:ze,arrayName:Fe,itemPath:je})}},Be={hypercube:W,colorChart:ye,axisChart:qe,quarantineProperty:x,unquarantineProperty:$,quarantineArrayProp:Se,unquarantineArrayProp:De,conditionalColoring:Ae,conditionalShow:He}})(),r.default})()}(lv)),lv.exports),uv=n(cv);function hv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function dv(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fv(Object(n),!0).forEach(function(t){dv(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function mv(e){return function(e){if(Array.isArray(e))return hv(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 hv(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hv(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 gv(e){return gv="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},gv(e)}var yv,vv="top",bv="top-right",xv="right",wv="bottom-right",qv="bottom",Mv="bottom-left",Sv="left",Dv="top-left";dv(dv(dv(dv(dv(dv(dv(dv(dv(dv(yv={},"equal-equal",[vv,qv]),"equal-higher",[qv,wv]),"equal-lower",[vv,bv]),"equal-void",[vv,qv]),"higher-equal",[Sv,Mv,vv,bv]),"higher-higher-acute",[qv,Mv,Sv,bv]),"higher-higher-obtuse",[qv,vv]),"higher-lower-negative",[vv,bv,xv]),"higher-lower-positive",[qv,Mv,Sv]),"higher-void",[vv]),dv(dv(dv(dv(dv(dv(dv(dv(dv(dv(yv,"lower-equal",[vv]),"lower-higher-negative",[vv,Dv]),"lower-higher-positive",[wv]),"lower-lower-acute",[vv,Dv,Sv,bv,xv]),"lower-lower-obtuse",[vv,qv]),"lower-void",[vv]),"void-equal",[vv]),"void-higher",[vv,qv]),"void-lower",[vv,qv,Sv]),"void-void",[vv]),dv(yv,"unclassified",[vv,qv,xv,Sv,bv,wv,Mv,Dv]);var _v=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],kv=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];var Cv=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function Ev(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],s=t.getStyle("","","fontFamilies");return Array.isArray(s)&&s.length?o.push.apply(o,mv(new Set([r].concat(mv(s.map(function(e){return e.split(",").map(function(e){return e.trim()}).map(function(e){return e.replace(/\s+/g," ").trim()}).filter(Boolean).join(", ")})))))):o.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(mv(o.map(function(e){return Cv(e)})),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],mv(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?kv:_v}(i).map(function(e){return Cv(e)})))}function Av(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,s=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return s()},getOptions:function(){return Ev({theme:t,translator:n,defaultValue:s(),flags:o})}}}var Tv,Iv,Nv=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Rv=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function Ov(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,r=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push.apply(r,mv(new Set([n].concat(mv(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(mv(r.map(function(e){return Rv(e)})),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],mv(Nv.map(function(e){return Rv(e)})))}({theme:t,translator:n,defaultValue:o()})}}}function Pv(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:Av({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:Ov({theme:t,translator:n,id:r,path:i})}}function Lv(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,s=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:i}),a=s.id,l=s.paths,c={};l.forEach(function(e){for(var r=e.split("."),i=c,s=0;s<r.length;s++){var l=r[s];s===r.length-1?i[l]=Pv({theme:t,translator:n,id:a,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}});var u=function(e){for(var t=e.split("."),n=c,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return c.getDefaultValue=function(e){return u(e).getDefaultValue()},c.getOptions=function(e){return u(e).getOptions()},c}var Fv,jv=function(){if(Iv)return Tv;Iv=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},s=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return Tv=function e(){var t,n,r,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=a(h,n),h!==(l=a(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},s(h,{name:n,newValue:e(p,u,l)})):void 0!==l&&s(h,{name:n,newValue:l}));return h},Tv}(),zv=(Fv=jv)&&Fv.__esModule&&Object.prototype.hasOwnProperty.call(Fv,"default")?Fv.default:Fv;function Hv(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map(function(e){return i[e.value%i.length]})},valueAccessor:e.value}}function Bv(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map(function(e){return i[e.row.value%i.length]})},valueAccessor:e.value}}function Vv(e,t,n,r,i){var o,s,a=i.byRow,l=i.byElemNo;if(r&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(s=(o=e.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===s?void 0:s.qArea.qHeight)||0)))return l(r,r.raw().qCardinal);if(r){var c=t.pic.extract({field:r.key(),trackBy:r.value}).length;return a(r,c)}return{}}function $v(e,t){var n=e.hc.qDimensionInfo,r=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(r.activeDimensionIndex>=0){var i=n[r.activeDimensionIndex];r=i.coloring&&i.coloring.colorMapRef?{type:"libraryItem",key:i.coloring.colorMapRef,activeDimensionIndex:r.activeDimensionIndex}:{activeDimensionIndex:r.activeDimensionIndex}}return r}function Wv(e,t){var n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter(function(e){return"dimension"===e.type()})[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(n=t.key?e.pic.field(function(e){return e.raw().colorMapRef===t.key}):void 0)&&(n=e.pic.field(function(e){return"colorByAlternative"===e.raw().id})):"expression"===t.type&&(n=e.pic.field(function(e){return"colorByAlternative"===e.raw().id})),n}function Uv(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Yv(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Kv(){}var Xv=1/.7,Gv="\\s*([+-]?\\d+)\\s*",Jv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Zv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Qv=/^#([0-9a-f]{3,8})$/,eb=new RegExp(`^rgb\\(${Gv},${Gv},${Gv}\\)$`),tb=new RegExp(`^rgb\\(${Zv},${Zv},${Zv}\\)$`),nb=new RegExp(`^rgba\\(${Gv},${Gv},${Gv},${Jv}\\)$`),rb=new RegExp(`^rgba\\(${Zv},${Zv},${Zv},${Jv}\\)$`),ib=new RegExp(`^hsl\\(${Jv},${Zv},${Zv}\\)$`),ob=new RegExp(`^hsla\\(${Jv},${Zv},${Zv},${Jv}\\)$`),sb={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 ab(){return this.rgb().formatHex()}function lb(){return this.rgb().formatRgb()}function cb(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Qv.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?ub(t):3===n?new pb(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?hb(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?hb(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=eb.exec(e))?new pb(t[1],t[2],t[3],1):(t=tb.exec(e))?new pb(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=nb.exec(e))?hb(t[1],t[2],t[3],t[4]):(t=rb.exec(e))?hb(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ib.exec(e))?xb(t[1],t[2]/100,t[3]/100,1):(t=ob.exec(e))?xb(t[1],t[2]/100,t[3]/100,t[4]):sb.hasOwnProperty(e)?ub(sb[e]):"transparent"===e?new pb(NaN,NaN,NaN,0):null}function ub(e){return new pb(e>>16&255,e>>8&255,255&e,1)}function hb(e,t,n,r){return r<=0&&(e=t=n=NaN),new pb(e,t,n,r)}function db(e){return e instanceof Kv||(e=cb(e)),e?new pb((e=e.rgb()).r,e.g,e.b,e.opacity):new pb}function fb(e,t,n,r){return 1===arguments.length?db(e):new pb(e,t,n,null==r?1:r)}function pb(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function mb(){return`#${bb(this.r)}${bb(this.g)}${bb(this.b)}`}function gb(){const e=yb(this.opacity);return`${1===e?"rgb(":"rgba("}${vb(this.r)}, ${vb(this.g)}, ${vb(this.b)}${1===e?")":`, ${e})`}`}function yb(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function vb(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function bb(e){return((e=vb(e))<16?"0":"")+e.toString(16)}function xb(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new qb(e,t,n,r)}function wb(e){if(e instanceof qb)return new qb(e.h,e.s,e.l,e.opacity);if(e instanceof Kv||(e=cb(e)),!e)return new qb;if(e instanceof qb)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new qb(s,a,l,e.opacity)}function qb(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Mb(e){return(e=(e||0)%360)<0?e+360:e}function Sb(e){return Math.max(0,Math.min(1,e||0))}function Db(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Uv(Kv,cb,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ab,formatHex:ab,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return wb(this).formatHsl()},formatRgb:lb,toString:lb}),Uv(pb,fb,Yv(Kv,{brighter(e){return e=null==e?Xv:Math.pow(Xv,e),new pb(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new pb(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new pb(vb(this.r),vb(this.g),vb(this.b),yb(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:mb,formatHex:mb,formatHex8:function(){return`#${bb(this.r)}${bb(this.g)}${bb(this.b)}${bb(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:gb,toString:gb})),Uv(qb,function(e,t,n,r){return 1===arguments.length?wb(e):new qb(e,t,n,null==r?1:r)},Yv(Kv,{brighter(e){return e=null==e?Xv:Math.pow(Xv,e),new qb(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new qb(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new pb(Db(e>=240?e-240:e+120,i,r),Db(e,i,r),Db(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new qb(Mb(this.h),Sb(this.s),Sb(this.l),yb(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=yb(this.opacity);return`${1===e?"hsl(":"hsla("}${Mb(this.h)}, ${100*Sb(this.s)}%, ${100*Sb(this.l)}%${1===e?")":`, ${e})`}`}}));const _b=Math.PI/180,kb=180/Math.PI,Cb=4/29,Eb=6/29,Ab=3*Eb*Eb;function Tb(e){if(e instanceof Ib)return new Ib(e.l,e.a,e.b,e.opacity);if(e instanceof Lb)return Fb(e);e instanceof pb||(e=db(e));var t,n,r=Pb(e.r),i=Pb(e.g),o=Pb(e.b),s=Nb((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=s:(t=Nb((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Nb((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Ib(116*s-16,500*(t-s),200*(s-n),e.opacity)}function Ib(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Nb(e){return e>.008856451679035631?Math.pow(e,1/3):e/Ab+Cb}function Rb(e){return e>Eb?e*e*e:Ab*(e-Cb)}function Ob(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Pb(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Lb(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Fb(e){if(isNaN(e.h))return new Ib(e.l,0,0,e.opacity);var t=e.h*_b;return new Ib(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Uv(Ib,function(e,t,n,r){return 1===arguments.length?Tb(e):new Ib(e,t,n,null==r?1:r)},Yv(Kv,{brighter(e){return new Ib(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Ib(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new pb(Ob(3.1338561*(t=.96422*Rb(t))-1.6168667*(e=1*Rb(e))-.4906146*(n=.82521*Rb(n))),Ob(-.9787684*t+1.9161415*e+.033454*n),Ob(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Uv(Lb,function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Lb)return new Lb(e.h,e.c,e.l,e.opacity);if(e instanceof Ib||(e=Tb(e)),0===e.a&&0===e.b)return new Lb(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*kb;return new Lb(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Lb(e,t,n,null==r?1:r)},Yv(Kv,{brighter(e){return new Lb(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Lb(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Fb(this).rgb()}}));var jb=e=>()=>e;function zb(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):jb(isNaN(e)?t:e)}var Hb=function e(t){var n=function(e){return 1==(e=+e)?zb:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):jb(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=fb(e)).r,(t=fb(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=zb(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1),Bb=/^class(-pyramid)?/,Vb=function(e,t,n,r){var i=void 0!==n.min?n.min:r.min(),o=void 0!==n.max?n.max:r.max(),s=i,a=o,l=t.limits,c={},u="percent"===t.limitType?l.map(function(e){return i+(o-i)*e}):l,h=t.colors.map(function(t){return e.resolveUIColor(t)});if(i=Math.min.apply(Math,[i].concat(mv(u))),o=Math.max.apply(Math,[o].concat(mv(u))),c.min=i,c.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))c.type="categorical",Object.assign(c,function(e){var t=e.min,n=e.max,r=e.limits,i=e.range,o=[],s=[];if(r.length)if(r[r.length-1]<t)s.push(t,n),o.push(i[i.length-1],i[i.length-1],i[i.length-1]);else if(r[0]>n)s.push(t,n),o.push(i[0],i[0],i[0]);else{if(r[0]>t)s.push(t),o.push(i[0]);else{s.push(t);for(var a=0;a<r.length;a++)if(t<r[a]){o.push(i[a]);break}}for(var l=0;l<r.length;l++)t<r[l]&&r[l]<n&&(s.push(r[l]),o.push(i[l]));if(r[r.length-1]<n)s.push(n),o.push(i[r.length]),o.push(i[r.length]);else{s.push(n);for(var c=0;c<r.length;c++)if(r[c]>n){o.push(i[c]),o.push(i[c]);break}}}else o.push(i[0]);return{min:t,max:n,range:o,domain:s}}({min:"percent"===t.limitType?i:s,max:"percent"===t.limitType?o:a,range:h,limits:"percent"===t.limitType?u:l}));else if(t.breakTypes){var d=t.breakTypes;c.type="continuous",c.domain=[i],c.range=[h[0]];for(var f=0;f<u.length;f+=1)if(d[f]){var p=h[f],m=h[f+1],g=Hb(p,m)(.5);c.range.push(g),c.domain.push(u[f]),f<u.length-1&&d[f+1]&&(c.range.push(h[f+1]),c.domain.push((u[f]+u[f+1])/2))}else c.range.push(h[f]),c.range.push(h[f+1]),c.domain.push(u[f]),c.domain.push(u[f]+Math.min(1e-6,(o-i)/1e6));c.range.push(h[h.length-1]),c.domain.push(o)}else c.domain=u,c.range=h;return c};function $b(e,t,n,r,i){var o,s,a,l=0,c=[],u=(e-t)/(r+1);if(0===u)return 1;for(o=0;o<n.length;o+=1)s=.99*(n[o]-t),a=n[o]>e?Math.floor(e/u):n[o]<t?0:Math.floor(s/u),Number.isNaN(a)||(c[a]?c[a]+=1:c[a]=1);for(o=0;o<c.length;o+=1)c[o]&&(l+=1);return l<=r||l>=i?Math.max(l,r):$b(e,t,n,r+1,i)}var Wb=function(e,t,n,r){var i,o,s=t.theme,a=t.hc,l=r.f,c={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},u=[],h=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(h=!("S"===(i=n.pic.raw()).qMode&&(i.qDataPages[0]&&i.qSize.qcy>i.qDataPages[0].qArea.qHeight||!i.qDataPages.length&&i.qSize.qcy>0)||"K"===i.qMode&&i.qStackedDataPages[0]&&i.qSize.qcy>i.qStackedDataPages[0].qArea.qHeight||"T"===i.qMode&&i.qSize.qcy>i.qTreeDataPages[0].qGroupSize))&&(u=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:a.qDimensionInfo.map(function(e,t){return{field:"qDimensionInfo/".concat(t)}}),value:function(e){return Math.min.apply(Math,mv(e))<0}}}}).filter(function(e){return e.value>=0&&!e.exclude.value}).map(function(e){return e.num.value}).filter(function(e){return"number"==typeof e}))}if(!1===n.input.autoMinMax){if(c.min=n.input.measureMin,c.max=n.input.measureMax,c.max<c.min)return{invalid:!0}}else if(l&&!h)c.min=l.min(),c.max=l.max();else if(l){if(!u.length)return{invalid:!0};c.min=Math.min.apply(Math,mv(u)),c.max=Math.max.apply(Math,mv(u))}if(n.input.measureScheme&&(c.palettes={quant:n.input.measureScheme}),s){var d=s.getDataColorScales().filter(function(e){return e.key===n.input.measureScheme})[0];c.type=d&&Bb.test(d.type)?"categorical":"continuous","categorical"===c.type&&(o=d.colors.some(function(e){return Array.isArray(e)})?Math.max.apply(Math,mv(d.colors.map(function(e){return e?e.length:0}))):d.colors.length)}if("categorical"===c.type){for(var f=h?$b(c.max,c.min,u,1,o):o,p=(c.max-c.min)/f,m=[],g=0;g<f+1;g+=1)m.push(c.min+p*g);c.domain=m,c.range=function(e){for(var t=e.resources.theme.palette("quant",f),n=Math.max(1,Math.floor(t.length/f)),r=[],i=0;i<f;i+=1)r.push(t[i*n]);return[r[0]].concat(r,[r[r.length-1]])}}return c};function Ub(e,t){var n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter(function(e){return"measure"===e.type()})[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field(function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key}):"expression"===t.type&&(n=e.pic.field(function(e){return"colorByAlternative"===e.raw().id})),n||(n=e.pic.field(function(e){return void 0!==e.raw().matchMeasure}))&&(n=e.pic.fields().filter(function(e){return"measure"===e.type()})[n.raw().matchMeasure]),n}function Yb(e){e.measureOverrides.every(function(e){return!e})&&(e.measureOverrides=null)}function Kb(e,t){for(var n=(null==t?void 0:t.domain)||[],r=(null==t?void 0:t.range)||[],i=[],o=0;o<e.length;++o){var s=e[o];if("constant"===(null==s?void 0:s.mode)){var a=n.indexOf(o);-1===a?(n.push(o),r.push(s.primary)):r[a]=s.primary,e[o]=null}else if(s){i.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),r.splice(l,1))}}return{domain:n,range:r,exclude:i}}function Xb(e,t,n,r){var i,o=function(e,t,n,r){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var r=t.theme,i=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,s=void 0===o?Ub:o,a=n.input.byMeasureDef||{activeMeasureIndex:0},l=s(n,a),c=Wb(0,{theme:r,hc:i},n,{f:l});if(c.invalid)return c;"expression"===a.type&&(a.activeMeasureIndex<0||void 0===a.activeMeasureIndex)&&(c.label=a.label,l&&"color.altLabel"===l.raw().labelExpRef&&(c.label=n.input.altLabel)),!c.label&&l&&(c.label=l.title());var u=a.activeMeasureIndex>=0?l:null;if(!u&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(u=n.pic.fields().filter(function(e){return"measure"===e.type()})[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===a.type)if(u){var h=u.raw().coloring;h&&h.gradient&&zv(c,Vb(e,h.gradient,c,u))}else c.auxiliary=a;return c}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.getCDef,o=void 0===i?$v:i,s=r.getCByField,a=void 0===s?Wv:s,l=r.getPersistence,c=void 0===l?Vv:l,u=o(t,n),h=a(n,u),d=h?h.raw():{},f=n&&n.pic?n.pic.raw():{};if(d.qError||d.qSize&&0===d.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:h?h.key():void 0,isFieldLocked:d.qLocked};return("expression"===u.type||u.activeDimensionIndex<0)&&(p.label=u.label,"color.altLabel"===d.labelExpRef&&(p.label=n.input.altLabel)),!p.label&&h&&(p.label=h.title()),n.input.dimensionScheme&&(p.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===u.type&&(p.auxiliary=u),zv(p,c(t,n,u,h,{byRow:Bv,byElemNo:Hv})),p}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,s=t.translator,a=n.pic.field(function(e){return"colorByExpression"===e.raw().id});if(!a||!a.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(a.raw().qMin)&&Number.isFinite(a.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:r.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:a?a.key():void 0,type:"color"};var l=Wb(0,{hc:i,theme:o},n,{f:a});return l.invalid||(l.label=n.input.expressionLabel||s.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,r);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,s=t.translator,a=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&i.qMeasureInfo.length>1&&(a="measure"),"measure"===a){var l=[],c=[];"measure"===n.input.useBaseColors&&i.qMeasureInfo.forEach(function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?c.push(r.primary):c.push(i)}});var u=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,h=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&h&&(u={categorical:h.key}),{mode:"measure",type:"categorical",palettes:u,label:s?s.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:c}:void 0}}if("dimension"===a){var d=[],f=[];return i.qDimensionInfo.forEach(function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){d.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?f.push(r.primary):f.push(i)}}),{mode:"dimension",type:"categorical",field:d.length?d[0]:void 0,explicit:d.length?{domain:d,range:f}:void 0}}var p=r.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(p=e.resolveUIColor(n.input.paletteColor));else{var m=n.input.singleColor;"number"!=typeof m||Number.isNaN(m)||(p=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][m])}return{mode:"constant",type:"constant",primary:p}}(e,n,t,r)}return{}}(e,t,n,r);return null!==(i=t.input)&&void 0!==i&&i.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map(function(n,i){return function(e){var t,n=e.cm,r=e.defaults,i=e.index,o=e.input,s=e.pic;if(!o||!o.on)return null;var a=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===a?function(e,t,n){var r=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(r=e.resolveUIColor(t.paletteColor)),pv(pv({},n),{},{mode:"constant",type:"constant",primary:r})}(n,o,r):"byExpression"===a?function(e,t,n){var r="qMeasureInfo/".concat(e,"/"),i=t.field(function(e){return e.id().startsWith(r)&&"colorByMeasureExpression"===e.raw().id}),o=i;return pv(pv({},n),{},o?{mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(i,s,r):null}({cm:e,input:n,defaults:r,index:i,pic:t.pic})}),function(e,t){var n,r,i,o=t.translator;if(Yb(e),1===(null===(n=e.measureOverrides)||void 0===n?void 0:n.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=Kb(e.measureOverrides,e.explicit),Yb(e)),null!==(r=e.measureOverrides)&&void 0!==r&&r.every(function(e){return"constant"===(null==e?void 0:e.mode)})){var s={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return s.explicit=Kb(e.measureOverrides),s}return null!==(i=e.measureOverrides)&&void 0!==i&&i.every(function(e){return e})?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}var Gb=function(e,t){var n=e.fieldType,r={};if(t)if("measure"===n){var i=t.coloring;i&&(r.measureGradient=i.gradient)}else if("dimension"===n){var o=t[0],s=t[1];o&&(r.legendDataPage=o),s&&(r.dimValsData=s.colorMap)}return r},Jb=function(e){throw e.isHandled=!0,e};function Zb(e){return function(t){return"object"===gv(t.datum[e])?t.datum[e].value:void 0}}function Qb(e){return"object"===gv(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function ex(e){return-3===e.datum.value}var tx={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},nx={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"};function rx(e){var t=e.theme,n=e.key,r=e.styleOverrides,i={title:{color:tx.COLOR,fontSize:tx.FONT_SIZE,fontFamily:tx.FONT_FAMILY},label:{color:nx.COLOR,fontSize:nx.FONT_SIZE,fontFamily:nx.FONT_FAMILY}};if(!t&&!r)return i;var o=r||{},s=o.title,a=o.label,l=function(e){var t=e.theme,n=e.key;return function(e,r,i,o){return void 0!==e?e:t?t.getStyle(n,r,i):o}}({theme:t,key:n});return i.title.color=l(null==s?void 0:s.color,"legend.title","color",tx.COLOR),i.title.fontSize=l(null==s?void 0:s.fontSize,"legend.title","fontSize",tx.FONT_SIZE),i.title.fontFamily=l(null==s?void 0:s.fontFamily,"legend.title","fontFamily",tx.FONT_FAMILY),i.label.color=l(null==a?void 0:a.color,"legend.label","color",nx.COLOR),i.label.fontSize=l(null==a?void 0:a.fontSize,"legend.label","fontSize",nx.FONT_SIZE),i.label.fontFamily=l(null==a?void 0:a.fontFamily,"legend.label","fontFamily",nx.FONT_FAMILY),i}var ix=function(e,t,n){var r=e&&e.dock||void 0;if("auto"!==r)return r||"right";if(t){var i=t.element.getBoundingClientRect();if(i.height>i.width)return"bottom"}return n?"left":"right"},ox=function(e,t,n){return!(n.invalid||"color"===n.type||"measure"===n.mode&&t.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function sx(e,t){var n=e.styleReference,r=e.styleOverrides,i=e.chart,o=e.rtl,s=t.legendProps,a=t.coloring,l=t.theme,c=t.hc,u=rx({theme:l,key:n,styleOverrides:r});return{layout:{minimumLayoutMode:"MEDIUM",dock:ix(s,i,o)},show:"function"==typeof s.show?function(){return ox(s,c,a)}:ox(s,c,a),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==s.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:a.label||"",fill:u.title.color,fontSize:u.title.fontSize,fontFamily:u.title.fontFamily}}}}function ax(e,t,n){var r=[],i=[],o=function(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var r=sx(e,t);if(!r.show)return!1;var i,o=e.key,s=e.styleReference,a=e.styleOverrides,l=e.viewState,c=e.rtl,u=e.settings,h=e.style,d=t.scaleKey,f=t.theme,p=t.scales,m=rx({theme:f,key:s,styleOverrides:a}),g=r.layout.dock,y="left"===g||"right"===g?{maxLines:2,wordBreak:"break-word"}:{},v={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===t.coloring.fieldType&&(i=function(e){return e.datum.value>=0||-3===e.datum.value});var b="".concat(d,"Legend");return zv(!0,r,{type:"legend-cat",key:"".concat(o,"-cat"),scale:b in p?b:d,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(r.layout.dock)?2:1,direction:c?"rtl":"ltr",horizontal:20},item:{show:i,label:pv({fill:m.label.color,fontSize:m.label.fontSize,fontFamily:m.label.fontFamily},y)},navigation:{disabled:n,button:{content:function(e,t){var n=t.direction;return e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:v[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:u,style:h})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,r=e.key,i=e.styleReference,o=e.styleOverrides,s=e.rtl,a=e.settings,l=e.style,c=t.scaleKey,u=t.theme,h="".concat(c,"Range"),d=sx(e,t);if(!d.show)return!1;var f=rx({theme:u,key:i,styleOverrides:o}),p=d.layout.dock,m="right"===p||"left"===p,g=null===(n=t.scales)||void 0===n?void 0:n[h];return m&&g&&(g.invert=!0),zv(!0,d,{type:"legend-seq",key:"".concat(r,"-seq"),settings:{fill:c,major:h,length:1,tick:{fill:f.label.color,fontSize:f.label.fontSize,fontFamily:f.label.fontFamily},title:{anchor:!s||"top"!==d.layout.dock&&"bottom"!==d.layout.dock?void 0:"right",padding:parseFloat(d.settings.title.fontSize)||16}}},{settings:a,style:l})}(e,t)}(e,t,n&&n.navigationDisabled);return r.push(o),o&&"legend-cat"===o.type&&(i.push(function(e){var t=e.key,n=e.requireFailure,r=e.recognizeWith,i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var r;if(!n)return!0;if(null!=i&&null!==(r=i.interact)&&void 0!==r&&r.enabled&&!i.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(function(e){return e.key==="".concat(t,"-cat")}))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),i.push(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,n=e.key,r=e.requireFailure,i=e.recognizeWith,o=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(n),type:"Pan",requireFailure:r,recognizeWith:i,options:{event:t,pointers:1,threshold:10,enable:function(e,r){var i;return this.started===t||!r||!(null!=o&&null!==(i=o.interact)&&void 0!==i&&i.enabled&&!o.interact.enabled())&&this.chart.componentsFromPoint({x:r.center.x,y:r.center.y}).some(function(e){return e.key==="".concat(n,"-cat")})}},events:dv(dv(dv({},"".concat(t,"start"),function(e){e.preventDefault(),this.started!==t&&(this.started=t,this.chart.component("".concat(n,"-cat")).emit("panstart",e))}),"".concat(t,"move"),function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panmove",e)}),"".concat(t,"end"),function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panend",e),this.started=!1})}}(e,n))),{interactions:i,components:r}}function lx(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=function(e){var t=pv({hc:null,colorProps:null,layout:null,theme:null},e),n={},r={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},i={auto:function(e){return e?(r.auto=e,i):r.auto},getDimensionColorMap:function(e){return e?(r.getDimensionColorMap=e,i):r.getDimensionColorMap},getAttributeDimension:function(e){return e?(r.getAttributeDimension=e,i):r.getAttributeDimension},getMeasure:function(e){return e?(r.getMeasure=e,i):r.getMeasure},set:function(e){var i;if(!e.colorProps)throw new Error('Missing "colorProps"');if(zv(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=r.auto(e.layout);n.input=zv(!0,{},n.input,o,{auto:!1});var s=t.theme?t.theme.getDataColorPalettes():[];s[0]&&(n.input.dimensionScheme=s[0].key);var a=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(a=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[a]&&t.hc.qDimensionInfo[a].coloring&&t.hc.qDimensionInfo[a].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[a].coloring.colorMapRef)}null!==(i=n.input.measureOverrides)&&void 0!==i&&i.every(function(e){return!e||!e.on})&&(n.input=zv(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,r=[];(e&&e.getDataColorPickerPalettes()||[]).forEach(function(e){r.push({key:"ui",colors:e.colors})}),n.palettes=r}return n.palettes},getAuxiliaryData:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var i=(e.auxiliary||{}).key;if("measure"===e.fieldType)return r.getMeasure(i,t).catch(function(){});if("dimension"===e.fieldType){var o="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?r.getAttributeDimension(o,t).catch(function(){}):Promise.resolve(),i?r.getDimensionColorMap(i,t).catch(function(){}):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,r){var i=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,r).then(function(r){if(!r)return{};if("measure"===e.fieldType){if(r.coloring&&r.coloring.gradient){var o=n.pic.field(e.field);return Vb(i,r.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var s={nil:e.nil,others:e.others},a=r[0],l=r[1]?r[1].colorMap:null;if(a){var c=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:a,qInterColumnSortOrder:[0,1],qMode:"S"}});s.legendDataset=c}return l?function(e,t,n,r){var i=r.external,o=r.field,s=pv({},e);zv(s,Hv(o,o.raw().qCardinal));var a=i.theme?i.theme.getDataColorPalettes()[0]:null;return t.nul&&(s.nil=n.resolveUIColor(t.nul)),t.oth&&(s.others=n.resolveUIColor(t.oth)),t.usePal?(s.palettes={categorical:t.pal},a&&!t.pal&&(s.palettes.categorical=a.key,zv(s,Hv(o)))):!1===t.autoFill&&t.single?s.range=[n.resolveUIColor(t.single)]:t.autoFill&&(a&&(s.palettes={categorical:a.key}),zv(s,Hv(o))),t.colors&&t.colors.length&&(s.explicit=function(e,t,n){for(var r={},i=0;i<e.length;i+=1)r[e[i].value]=e[i].baseColor;var o=[];return{domain:function(e){var i=e.data,s=[];o=[];for(var a=0;a<i.items.length;a++){var l=i.items[a],c=(l.text||l).label;r[c]&&-1===s.indexOf(l.value)&&(s.push(l.value),o.push(t.resolveUIColor(r[c])))}return s.push(-3,-2),o.push(n.others),o.push(n.nil),s},range:function(){return o}}}(t.colors,n,s)),s}(s,l,i,{external:t,field:n.pic.field(e.field)}):s}return{}})):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter(function(e){return"ui"===e.key})[0]||!1),!n.uiPalette)return e.color;var t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},r=t.theme;r&&(e=pv(pv({},e),r.getDataColorSpecials())),n.settings=zv(e,Xb(this,n,t,e))}return n.settings}};return i}(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap(function(e,t){return function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():r&&r.getObject?r.getObject("ColorMapModel_".concat(e)).then(function(e){return e.getLayout()}):Promise.reject()}(e,{layout:t.layout,app:t.app})}).getMeasure(function(e,t){return function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():r&&r.getMeasure?r.getMeasure(e).then(function(e){return e.getMeasure()}):Promise.reject()}(e,{layout:t.layout,app:t.app})}).getAttributeDimension(function(e,t){return function(e,t){var n=t.layout,r=t.model,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():r&&r.session&&i?r.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(Jb):Promise.reject()}(e,{layout:t.layout,model:t.model,app:t.app})});return n.getSnapshotData=Gb,n}({resources:e}),n={},r={},i=function(e){return r.settings||(e||console.warn("settings() called before auxiliarySettings()"),r.settings=t.settings()),r.settings},o={config:function(i){if(n=pv({},i),r={},!n.key)throw new Error("Missing key");t.set(pv(pv({},e),n))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return r.auxiliarySettings?Promise.resolve(r.auxiliarySettings):t.getAuxiliarySettings(i(!0),e).then(function(e){return r.auxiliarySettings=e||{},r.settings=pv(pv({},r.settings),r.auxiliarySettings),r.scales=void 0,r.color=void 0,r.auxiliarySettings})},getAuxiliaryData:function(){return t.getAuxiliaryData(i())},getSnapshotData:function(e){var n=i();return t.getAuxiliaryData(n,e).then(function(e){return t.getSnapshotData(n,e)})},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=i();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=i().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(i(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,r=e.theme,i=[];if(n&&n.palettes&&r){var o=n.palettes.categorical||t.dimensionScheme,s=r.getDataColorPalettes().filter(function(e){return e.key===o})[0]||r.getDataColorPalettes()[0];o&&s&&i.push({key:"categorical",colors:s.colors});var a=n.palettes.metric||t.measureScheme,l=r.getDataColorScales().filter(function(e){return e.key===a})[0]||r.getDataColorScales()[0];if(l){var c=l.colors[0]?l.colors:[[]].concat(mv(l.colors.slice(1)));c=Array.isArray(c[0])?c.map(function(e){return e.slice().reverse()}):c.slice().reverse(),i.push({key:"quant",colors:c})}}return i}({coloring:i(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return r.scales=r.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,r=e.rtl,i=e.key,o=e.source,s=e.picasso,a={},l=i;if(n){var c={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(mv((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(mv((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var u,h=function(e){var t=e.hc,n=e.source,r=e.coloring,i={data:{extract:[{source:"dummy",field:0,filter:function(){return i.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:r.field,trackBy:r.valueAccessor,reduce:"first",props:{row:{reduce:function(){return i.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return i}({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var d=0,f={};s.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return f[t]=d++,e[0]}}),u={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return f[e.qElemNumber]}}}}}}var p={data:h,range:n.range,domain:n.domain,explicit:c,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};a[l]=p,u&&(a["".concat(l,"Legend")]=pv(pv({},p),{},{data:u})),t&&t.qHasOtherValues&&u&&((u||p.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var m={data:{field:n.field},min:n.min,max:n.max};a[l]=zv({},m,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===a[l].type&&(a["".concat(l,"Range")]=zv({},m,{invert:!!r}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var g={data:t.qDimensionInfo.map(function(e,t){return t}),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};a[l]=g}else if("measure"===n.mode){var y={data:t.qMeasureInfo.map(function(e,t){return t}).filter(function(e){var t;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(t=t.exclude)&&void 0!==t&&t.includes(e))}),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};a[l]=y}}return a}({hc:n.hc,coloring:i(),key:n.key,source:n.source,picasso:e.picasso}),r.scales},color:function(){return r.color=r.color||function(e){var t=e.coloring,n=e.scales,r=e.key,i=Zb(r),o=Zb("".concat(r,"IsAnOther")),s=function(e,t){var r=e.fieldType,s=e.invalid,a=e.mode,l=e.nil,c=e.others,u=e.primary,h=e.type;return s?function(e){return ex(e)||o(e)?c:l}:n[t]?function(e){return ex(e)?c:Qb(e)||-2===i(e)&&"dimension"===r||"NaN"===i(e)?l:o(e)?c:e.resources.scale(t)(i(e))||c}:"constant"===a?function(e){return ex(e)||o(e)?c:Qb(e)?l:u}:"color"===h?function(e){return ex(e)||o(e)?c:Qb(e)?l:i(e)||c}:null},a=s(t,r);if(t.measureOverrides){var l=Zb("".concat(r,"MeasureIdx")),c=t.measureOverrides.map(function(e){return e&&s(e)});return function(e){var t=l(e);return c[t]?c[t](e):a(e)}}return a}({coloring:i(),scales:this.scales(),key:n.key}),r.color},datumProps:function(e){return function(e){var t,n,r=e.hc,i=e.coloring,o=e.scales,s=e.key,a=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=s,u=i.nil;"field"===i.mode&&i.field?t=i.field:o[s]&&"field"===i.mode&&(t=o[s].data.field||i.field),t?(n={field:t,reduce:"first"},"color"===i.type&&(n.value=function(e){return"NaN"!==e.qNum?function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")}(e.qNum):e.qText&&cb(e.qText)?e.qText:u})):"dimension"===i.mode?n=void 0!==i.field?i.field:r.qDimensionInfo.length-1:"measure"===i.mode&&(n=l);var h=dv({},c,n);return r.qDimensionInfo.length>1&&(h["".concat(c,"IsAnOther")]={fields:r.qDimensionInfo.map(function(e,t){return{field:"qDimensionInfo/".concat(t)}}),value:function(e){return-1!==e.indexOf(-3)}}),a&&(h["".concat(c,"MeasureIdx")]=l),h}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:i().measureOverrides},e)},data:function(){var e=i(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,r=e.key,o=e.viewState,s=e.chart,a=e.rtl,l=e.styleReference,c=void 0===l?"object.legend":l,u=e.styleOverrides,h=e.settings,d=void 0===h?{}:h,f=e.style,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ax({eventName:t,key:r,rtl:a,viewState:o,chart:s,styleReference:c,styleOverrides:u,settings:d,style:void 0===f?{}:f},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},p)}};return o}var cx=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function ux(e){var t=e.qHyperCube,n=t.qDimensionInfo,r=t.qMeasureInfo,i=n.some(cx),o=r.some(cx),s=e.color.useBaseColors;return"measure"===s&&!o||"dimension"===s&&!i?"off":s}var hx=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function dx(e){var t,n=e.qHyperCube.qDimensionInfo.some(hx),r=e.qHyperCube.qMeasureInfo.some(hx),i=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=i?i:r?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var fx=function(){};function px(e){var t,n,r,i,o=e.picasso,s=e.model,a=e.app,l=e.translator,c=e.layoutService,u=void 0===c?void 0:c,h=e.createConfig,d=void 0===h?fx:h,f=e.config,p=void 0===f?{}:f,m=e.custom,g=void 0===m?{}:m,y=p.localeInfo,v=p.key,b=p.theme,x=void 0===b?void 0:b,w=p.auto,q=void 0===w?void 0:w,M=p.definitionPath,S=null==u||null===(t=u.getLayout)||void 0===t?void 0:t.call(u),D={theme:x,key:v,localeInfo:y,layout:S,hc:null==u||null===(n=u.getHyperCube)||void 0===n?void 0:n.call(u),legendProps:null==u||null===(r=u.getLayoutValue)||void 0===r?void 0:r.call(u,"legend"),colorProps:pv(pv({},null==u||null===(i=u.getLayoutValue)||void 0===i?void 0:i.call(u,"color")),{},{useBaseColors:S?ux(S):void 0})},_=lx({picasso:o,model:s,app:a,translator:l,auto:q});!1!==q&&_.auto(function(e){return q?q({layout:e,defaultAuto:dx}):dx(e)});var k=!1,C={getColor:function(){return _.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return _.resolveUIColor({index:t,color:n})},getData:function(){return _.data()},getDatumProps:function(e){return _.datumProps(e)},getSnapshotData:function(){return _.getSnapshotData(M)},getSettingsForMeasure:function(e){return _.settingsForMeasure(e)},getSettings:function(){return _.settings()},getLegend:function(e,t){return _.legend(e,t)},getScales:function(){return _.scales()},getPalettes:function(){return _.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return _.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return k},custom:pv({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?d:e)({getUseBaseColors:ux}),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return pv(pv(pv({},e),t),{},{colorProps:pv(pv({},e.colorProps),t.colorProps||{})})}(D,t);return _.config(n),_.getAuxiliarySettings(M).then(function(){k=!0})}};return C}var mx="center",gx="bottom";function yx(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var s=r[o];if(void 0===i[s])return n;i=i[s]}return i}[{key:"NoDataExist",alignment:mx,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:mx,condition:function(e){var t=e.layoutService;return!!t&&t.getHyperCubeValue("qMeasureInfo").every(function(e){return"NaN"===e.qMin&&"NaN"===e.qMax})}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:mx,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:mx},{key:"DataRangeIncludingZero",alignment:gx},{key:"LimitedData",alignment:gx},{key:"NegativeOrZeroValues",alignment:gx}].reduce(function(e,t){return e[t.key]=t,e},{});var vx,bx=["__proto__","constructor"];function xx(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!bx.some(function(e){return r.includes(e)})){for(var o=e,s=0;s<r.length-1;++s){var a=r[s];void 0===o[a]&&(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}void 0!==n?o[i]=n:delete o[i]}}}function wx(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function qx(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Sx)):void 0===t&&(t=Mx);for(var n,r,i,o,s,a=new kx(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new kx(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(_x)}function Mx(e){return e.children}function Sx(e){return Array.isArray(e)?e[1]:null}function Dx(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function _x(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function kx(e){this.data=e,this.depth=this.height=0,this.parent=null}kx.prototype=qx.prototype={constructor:kx,count:function(){return this.eachAfter(wx)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t},copy:function(){return qx(this).eachBefore(Dx)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},vx=function(e){
|
|
24
|
+
* Licensed under the MIT license */var gg=(pg||(pg=1,function(e){!function(t,n,r,i){var o,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),l=Math.round,c=Math.abs,u=Date.now;function h(e,t,n){return setTimeout(v(e,n),t)}function d(e,t,n){return!!Array.isArray(e)&&(f(e,n[t],n),!0)}function f(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function p(e,n,r){var i="DEPRECATED METHOD: "+n+"\n"+r+" AT \n";return function(){var n=new Error("get-stack-trace"),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,i,r),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===i||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==i&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign;var m=p(function(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;)(!n||n&&e[r[o]]===i)&&(e[r[o]]=t[r[o]]),o++;return e},"extend","Use `assign`."),g=p(function(e,t){return m(e,t,!0)},"merge","Use `assign`.");function y(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&o(r,n)}function v(e,t){return function(){return e.apply(t,arguments)}}function b(e,t){return"function"==typeof e?e.apply(t&&t[0]||i,t):e}function x(e,t){return e===i?t:e}function w(e,t,n){f(D(t),function(t){e.addEventListener(t,n,!1)})}function q(e,t,n){f(D(t),function(t){e.removeEventListener(t,n,!1)})}function M(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function S(e,t){return e.indexOf(t)>-1}function D(e){return e.trim().split(/\s+/g)}function _(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function k(e){return Array.prototype.slice.call(e,0)}function C(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var s=e[o][t];_(i,s)<0&&r.push(e[o]),i[o]=s,o++}return r=r.sort(function(e,n){return e[t]>n[t]}),r}function E(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),a=0;a<s.length;){if((r=(n=s[a])?n+o:t)in e)return r;a++}return i}var A=1;function T(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var I="ontouchstart"in t,N=E(t,"PointerEvent")!==i,R=I&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),O="touch",P="mouse",L=24,F=["x","y"],j=["clientX","clientY"];function z(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){b(e.options.enable,[e])&&n.handler(t)},this.init()}function H(e,t,n){var r=n.pointers.length,o=n.changedPointers.length,s=1&t&&r-o===0,a=12&t&&r-o===0;n.isFirst=!!s,n.isFinal=!!a,s&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,o=r.length;n.firstInput||(n.firstInput=B(t)),o>1&&!n.firstMultiple?n.firstMultiple=B(t):1===o&&(n.firstMultiple=!1);var s=n.firstInput,a=n.firstMultiple,l=a?a.center:s.center,h=t.center=V(r);t.timeStamp=u(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=Y(l,h),t.distance=U(l,h),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=W(t.deltaX,t.deltaY);var d=$(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=d.x,t.overallVelocityY=d.y,t.overallVelocity=c(d.x)>c(d.y)?d.x:d.y,t.scale=a?function(e,t){return U(t[0],t[1],j)/U(e[0],e[1],j)}(a.pointers,r):1,t.rotation=a?function(e,t){return Y(t[1],t[0],j)+Y(e[1],e[0],j)}(a.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,o,s,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(8!=t.eventType&&(l>25||a.velocity===i)){var u=t.deltaX-a.deltaX,h=t.deltaY-a.deltaY,d=$(l,u,h);r=d.x,o=d.y,n=c(d.x)>c(d.y)?d.x:d.y,s=W(u,h),e.lastInterval=t}else n=a.velocity,r=a.velocityX,o=a.velocityY,s=a.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=s}(n,t);var f=e.element;M(t.srcEvent.target,f)&&(f=t.srcEvent.target),t.target=f}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function B(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:l(e.pointers[n].clientX),clientY:l(e.pointers[n].clientY)},n++;return{timeStamp:u(),pointers:t,center:V(t),deltaX:e.deltaX,deltaY:e.deltaY}}function V(e){var t=e.length;if(1===t)return{x:l(e[0].clientX),y:l(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:l(n/t),y:l(r/t)}}function $(e,t,n){return{x:t/e||0,y:n/e||0}}function W(e,t){return e===t?1:c(e)>=c(t)?e<0?2:4:t<0?8:16}function U(e,t,n){n||(n=F);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function Y(e,t,n){n||(n=F);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}z.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(T(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&q(this.element,this.evEl,this.domHandler),this.evTarget&&q(this.target,this.evTarget,this.domHandler),this.evWin&&q(T(this.element),this.evWin,this.domHandler)}};var K={mousedown:1,mousemove:2,mouseup:4},X="mousedown",G="mousemove mouseup";function J(){this.evEl=X,this.evWin=G,this.pressed=!1,z.apply(this,arguments)}y(J,z,{handler:function(e){var t=K[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:P,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Q={2:O,3:"pen",4:P,5:"kinect"},ee="pointerdown",te="pointermove pointerup pointercancel";function ne(){this.evEl=ee,this.evWin=te,z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),y(ne,z,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=Z[r],o=Q[e.pointerType]||e.pointerType,s=o==O,a=_(t,e.pointerId,"pointerId");1&i&&(0===e.button||s)?a<0&&(t.push(e),a=t.length-1):12&i&&(n=!0),a<0||(t[a]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(a,1))}});var re={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ie(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,z.apply(this,arguments)}function oe(e,t){var n=k(e.touches),r=k(e.changedTouches);return 12&t&&(n=C(n.concat(r),"identifier")),[n,r]}y(ie,z,{handler:function(e){var t=re[e.type];if(1===t&&(this.started=!0),this.started){var n=oe.call(this,e,t);12&t&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:O,srcEvent:e})}}});var se={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ae="touchstart touchmove touchend touchcancel";function le(){this.evTarget=ae,this.targetIds={},z.apply(this,arguments)}function ce(e,t){var n=k(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,s=k(e.changedTouches),a=[],l=this.target;if(o=n.filter(function(e){return M(e.target,l)}),1===t)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<s.length;)r[s[i].identifier]&&a.push(s[i]),12&t&&delete r[s[i].identifier],i++;return a.length?[C(o.concat(a),"identifier"),a]:void 0}function ue(){z.apply(this,arguments);var e=v(this.handler,this);this.touch=new le(this.manager,e),this.mouse=new J(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function he(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,de.call(this,t)):12&e&&de.call(this,t)}function de(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout(function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)},2500)}}function fe(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),s=Math.abs(n-i.y);if(o<=25&&s<=25)return!0}return!1}y(le,z,{handler:function(e){var t=se[e.type],n=ce.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:O,srcEvent:e})}}),y(ue,z,{handler:function(e,t,n){var r=n.pointerType==O,i=n.pointerType==P;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)he.call(this,t,n);else if(i&&fe.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var pe=E(a.style,"touchAction"),me=pe!==i,ge="compute",ye="auto",ve="manipulation",be="none",xe="pan-x",we="pan-y",qe=function(){if(!me)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(r){e[r]=!n||t.CSS.supports("touch-action",r)}),e}();function Me(e,t){this.manager=e,this.set(t)}Me.prototype={set:function(e){e==ge&&(e=this.compute()),me&&this.manager.element.style&&qe[e]&&(this.manager.element.style[pe]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return f(this.manager.recognizers,function(t){b(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),function(e){if(S(e,be))return be;var t=S(e,xe),n=S(e,we);return t&&n?be:t||n?t?xe:we:S(e,ve)?ve:ye}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=S(r,be)&&!qe[be],o=S(r,we)&&!qe[we],s=S(r,xe)&&!qe[xe];if(i){var a=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(a&&l&&c)return}if(!s||!o)return i||o&&6&n||s&&n&L?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Se=32;function De(e){this.options=o({},this.defaults,e||{}),this.id=A++,this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function _e(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function ke(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Ce(e,t){var n=t.manager;return n?n.get(e):e}function Ee(){De.apply(this,arguments)}function Ae(){Ee.apply(this,arguments),this.pX=null,this.pY=null}function Te(){Ee.apply(this,arguments)}function Ie(){De.apply(this,arguments),this._timer=null,this._input=null}function Ne(){Ee.apply(this,arguments)}function Re(){Ee.apply(this,arguments)}function Oe(){De.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Pe(e,t){return(t=t||{}).recognizers=x(t.recognizers,Pe.defaults.preset),new Le(e,t)}function Le(e,t){var n;this.options=o({},Pe.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(N?ne:R?le:I?ue:J))(n,H),this.touchAction=new Me(this,this.options.touchAction),Fe(this,!0),f(this.options.recognizers,function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}function Fe(e,t){var n,r=e.element;r.style&&(f(e.options.cssProps,function(i,o){n=E(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""}),t||(e.oldCssProps={}))}De.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(d(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Ce(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return d(e,"dropRecognizeWith",this)||(e=Ce(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(d(e,"requireFailure",this))return this;var t=this.requireFail;return-1===_(t,e=Ce(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(d(e,"dropRequireFailure",this))return this;e=Ce(e,this);var t=_(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+_e(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+_e(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Se},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!b(this.options.enable,[this,t]))return this.reset(),void(this.state=Se);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},y(Ee,De,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(8&n||!i)?16|t:r||i?4&n?8|t:2&t?4|t:2:Se}}),y(Ae,Ee,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(we),e&L&&t.push(xe),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,s=e.deltaY;return i&t.direction||(6&t.direction?(i=0===o?1:o<0?2:4,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===s?1:s<0?8:16,n=s!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return Ee.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=ke(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),y(Te,Ee,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[be]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),y(Ie,De,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ye]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=h(function(){this.state=8,this.tryEmit()},t.time,this);else if(4&e.eventType)return 8;return Se},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}}),y(Ne,Ee,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[be]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),y(Re,Ee,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Ae.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:n&L&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&c(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=ke(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),y(Oe,De,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ve]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(r&&i&&n){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,s=!this.pCenter||U(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,s&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=h(function(){this.state=8,this.tryEmit()},t.interval,this),2):8}return Se},failTimeout:function(){return this._timer=h(function(){this.state=Se},this.options.interval,this),Se},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Pe.VERSION="2.0.7",Pe.defaults={domEvents:!1,touchAction:ge,enable:!0,inputTarget:null,inputClass:null,preset:[[Ne,{enable:!1}],[Te,{enable:!1},["rotate"]],[Re,{direction:6}],[Ae,{direction:6},["swipe"]],[Oe],[Oe,{event:"doubletap",taps:2},["tap"]],[Ie]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Le.prototype={set:function(e){return o(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof De)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(d(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(d(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=_(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==i&&t!==i){var n=this.handlers;return f(D(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this}},off:function(e,t){if(e!==i){var n=this.handlers;return f(D(e),function(e){t?n[e]&&n[e].splice(_(n[e],t),1):delete n[e]}),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var r=n.createEvent("Event");r.initEvent(e,!0,!0),r.gesture=t,t.target.dispatchEvent(r)}(e,t);var r=this.handlers[e]&&this.handlers[e].slice();if(r&&r.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var i=0;i<r.length;)r[i](t),i++}},destroy:function(){this.element&&Fe(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(Pe,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Se,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:L,DIRECTION_ALL:30,Manager:Le,Input:z,TouchAction:Me,TouchInput:le,MouseInput:J,PointerEventInput:ne,TouchMouseInput:ue,SingleTouchInput:ie,Recognizer:De,AttrRecognizer:Ee,Tap:Oe,Pan:Ae,Swipe:Re,Pinch:Te,Rotate:Ne,Press:Ie,on:w,off:q,each:f,merge:g,extend:m,assign:o,inherit:y,bindFn:v,prefixed:E}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=Pe,e.exports?e.exports=Pe:t.Hammer=Pe}(window,document)}(mg)),mg.exports),yg=n(gg);function vg(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var bg={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:r}}=this.settings,i="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",o=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":n.width=`${t.height}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left";break;case"right":n.width=`${t.height}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left";break;case"center":n.width=`${t.width}px`,n.height=`${t.height}px`,n.color="#595959",n.fontStyle="normal",n.fontSize="1.2em",n.textAlign="center";break;default:n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(r,this.rect),s="center"===r?t:`* ${t}`,a="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:o,dir:i},e("span",{ref:this.alignToRef,style:a,title:s},s))}};function xg(e){const t=qp();return t.renderer.prio([e||"canvas"]),t.use(ug),t.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",fg(e))};e.interaction("hammer",fg(Hammer))}(yg)),t.use(vg),t.component("disclaimer",bg),t}const wg={shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]};var qg,Mg;function Sg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dg=function(){if(Mg)return qg;Mg=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},s=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return qg=function e(){var t,n,r,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=a(h,n),h!==(l=a(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},s(h,{name:n,newValue:e(p,u,l)})):void 0!==l&&s(h,{name:n,newValue:l}));return h},qg}();function _g(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function kg(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Cg(){}Sg(Dg);var Eg=1/.7,Ag="\\s*([+-]?\\d+)\\s*",Tg="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ig="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ng=/^#([0-9a-f]{3,8})$/,Rg=new RegExp(`^rgb\\(${Ag},${Ag},${Ag}\\)$`),Og=new RegExp(`^rgb\\(${Ig},${Ig},${Ig}\\)$`),Pg=new RegExp(`^rgba\\(${Ag},${Ag},${Ag},${Tg}\\)$`),Lg=new RegExp(`^rgba\\(${Ig},${Ig},${Ig},${Tg}\\)$`),Fg=new RegExp(`^hsl\\(${Tg},${Ig},${Ig}\\)$`),jg=new RegExp(`^hsla\\(${Tg},${Ig},${Ig},${Tg}\\)$`),zg={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 Hg(){return this.rgb().formatHex()}function Bg(){return this.rgb().formatRgb()}function Vg(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ng.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?$g(t):3===n?new Kg(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Wg(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Wg(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=Rg.exec(e))?new Kg(t[1],t[2],t[3],1):(t=Og.exec(e))?new Kg(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Pg.exec(e))?Wg(t[1],t[2],t[3],t[4]):(t=Lg.exec(e))?Wg(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Fg.exec(e))?ey(t[1],t[2]/100,t[3]/100,1):(t=jg.exec(e))?ey(t[1],t[2]/100,t[3]/100,t[4]):zg.hasOwnProperty(e)?$g(zg[e]):"transparent"===e?new Kg(NaN,NaN,NaN,0):null}function $g(e){return new Kg(e>>16&255,e>>8&255,255&e,1)}function Wg(e,t,n,r){return r<=0&&(e=t=n=NaN),new Kg(e,t,n,r)}function Ug(e){return e instanceof Cg||(e=Vg(e)),e?new Kg((e=e.rgb()).r,e.g,e.b,e.opacity):new Kg}function Yg(e,t,n,r){return 1===arguments.length?Ug(e):new Kg(e,t,n,null==r?1:r)}function Kg(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Xg(){return`#${Qg(this.r)}${Qg(this.g)}${Qg(this.b)}`}function Gg(){const e=Jg(this.opacity);return`${1===e?"rgb(":"rgba("}${Zg(this.r)}, ${Zg(this.g)}, ${Zg(this.b)}${1===e?")":`, ${e})`}`}function Jg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Zg(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Qg(e){return((e=Zg(e))<16?"0":"")+e.toString(16)}function ey(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ny(e,t,n,r)}function ty(e){if(e instanceof ny)return new ny(e.h,e.s,e.l,e.opacity);if(e instanceof Cg||(e=Vg(e)),!e)return new ny;if(e instanceof ny)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new ny(s,a,l,e.opacity)}function ny(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function ry(e){return(e=(e||0)%360)<0?e+360:e}function iy(e){return Math.max(0,Math.min(1,e||0))}function oy(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}_g(Cg,Vg,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Hg,formatHex:Hg,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ty(this).formatHsl()},formatRgb:Bg,toString:Bg}),_g(Kg,Yg,kg(Cg,{brighter(e){return e=null==e?Eg:Math.pow(Eg,e),new Kg(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Kg(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Kg(Zg(this.r),Zg(this.g),Zg(this.b),Jg(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:Xg,formatHex:Xg,formatHex8:function(){return`#${Qg(this.r)}${Qg(this.g)}${Qg(this.b)}${Qg(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Gg,toString:Gg})),_g(ny,function(e,t,n,r){return 1===arguments.length?ty(e):new ny(e,t,n,null==r?1:r)},kg(Cg,{brighter(e){return e=null==e?Eg:Math.pow(Eg,e),new ny(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ny(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Kg(oy(e>=240?e-240:e+120,i,r),oy(e,i,r),oy(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ny(ry(this.h),iy(this.s),iy(this.l),Jg(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=Jg(this.opacity);return`${1===e?"hsl(":"hsla("}${ry(this.h)}, ${100*iy(this.s)}%, ${100*iy(this.l)}%${1===e?")":`, ${e})`}`}}));const sy=Math.PI/180,ay=180/Math.PI,ly=4/29,cy=6/29,uy=3*cy*cy;function hy(e){if(e instanceof dy)return new dy(e.l,e.a,e.b,e.opacity);if(e instanceof yy)return vy(e);e instanceof Kg||(e=Ug(e));var t,n,r=gy(e.r),i=gy(e.g),o=gy(e.b),s=fy((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=s:(t=fy((.4360747*r+.3850649*i+.1430804*o)/.96422),n=fy((.0139322*r+.0971045*i+.7141733*o)/.82521)),new dy(116*s-16,500*(t-s),200*(s-n),e.opacity)}function dy(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function fy(e){return e>.008856451679035631?Math.pow(e,1/3):e/uy+ly}function py(e){return e>cy?e*e*e:uy*(e-ly)}function my(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function gy(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function yy(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function vy(e){if(isNaN(e.h))return new dy(e.l,0,0,e.opacity);var t=e.h*sy;return new dy(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}_g(dy,function(e,t,n,r){return 1===arguments.length?hy(e):new dy(e,t,n,null==r?1:r)},kg(Cg,{brighter(e){return new dy(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new dy(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new Kg(my(3.1338561*(t=.96422*py(t))-1.6168667*(e=1*py(e))-.4906146*(n=.82521*py(n))),my(-.9787684*t+1.9161415*e+.033454*n),my(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),_g(yy,function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof yy)return new yy(e.h,e.c,e.l,e.opacity);if(e instanceof dy||(e=hy(e)),0===e.a&&0===e.b)return new yy(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*ay;return new yy(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new yy(e,t,n,null==r?1:r)},kg(Cg,{brighter(e){return new yy(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new yy(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return vy(this).rgb()}}));var by=-.14861,xy=1.78277,wy=-.29227,qy=-.90649,My=1.97294,Sy=My*qy,Dy=My*xy,_y=-.6557636667999999;function ky(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Cy)return new Cy(e.h,e.s,e.l,e.opacity);e instanceof Kg||(e=Ug(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(_y*r+Sy*t-Dy*n)/-5.9615122912,o=r-i,s=(My*(n-i)-wy*o)/qy,a=Math.sqrt(s*s+o*o)/(My*i*(1-i)),l=a?Math.atan2(s,o)*ay-120:NaN;return new Cy(l<0?l+360:l,a,i,e.opacity)}(e):new Cy(e,t,n,null==r?1:r)}function Cy(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}_g(Cy,ky,kg(Cg,{brighter(e){return e=null==e?Eg:Math.pow(Eg,e),new Cy(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Cy(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*sy,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Kg(255*(t+n*(by*r+xy*i)),255*(t+n*(wy*r+qy*i)),255*(t+n*(My*r)),this.opacity)}}));var Ey=e=>()=>e;function Ay(e,t){return function(n){return e+n*t}}function Ty(e,t){var n=t-e;return n?Ay(e,n):Ey(isNaN(e)?t:e)}function Iy(e){return((e=Math.exp(e))+1/e)/2}function Ny(e){return function t(n){function r(t,r){var i=e((t=ky(t)).h,(r=ky(r)).h),o=Ty(t.s,r.s),s=Ty(t.l,r.l),a=Ty(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=o(e),t.l=s(Math.pow(e,n)),t.opacity=a(e),t+""}}return n=+n,r.gamma=t,r}(1)}!function e(t){var n=function(e){return 1==(e=+e)?Ty:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Ey(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Yg(e)).r,(t=Yg(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=Ty(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1),function e(t,n,r){function i(e,i){var o,s,a=e[0],l=e[1],c=e[2],u=i[0],h=i[1],d=i[2],f=u-a,p=h-l,m=f*f+p*p;if(m<1e-12)s=Math.log(d/c)/t,o=function(e){return[a+e*f,l+e*p,c*Math.exp(t*e*s)]};else{var g=Math.sqrt(m),y=(d*d-c*c+r*m)/(2*c*n*g),v=(d*d-c*c-r*m)/(2*d*n*g),b=Math.log(Math.sqrt(y*y+1)-y),x=Math.log(Math.sqrt(v*v+1)-v);s=(x-b)/t,o=function(e){var r,i=e*s,o=Iy(b),u=c/(n*g)*(o*(r=t*i+b,((r=Math.exp(2*r))-1)/(r+1))-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[a+u*f,l+u*p,c*o/Iy(t*i+b)]}}return o.duration=1e3*s*t/Math.SQRT2,o}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i}(Math.SQRT2,2,4),Ny(function(e,t){var n=t-e;return n?Ay(e,n>180||n<-180?n-360*Math.round(n/360):n):Ey(isNaN(e)?t:e)}),Ny(Ty);var Ry="center",Oy="bottom";function Py(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var s=r[o];if(void 0===i[s])return n;i=i[s]}return i}[{key:"NoDataExist",alignment:Ry,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:Ry,condition:function(e){var t=e.layoutService;return!!t&&t.getHyperCubeValue("qMeasureInfo").every(function(e){return"NaN"===e.qMin&&"NaN"===e.qMax})}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:Ry,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:Ry},{key:"DataRangeIncludingZero",alignment:Oy},{key:"LimitedData",alignment:Oy},{key:"NegativeOrZeroValues",alignment:Oy}].reduce(function(e,t){return e[t.key]=t,e},{});var Ly=["__proto__","constructor"];function Fy(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!Ly.some(function(e){return r.includes(e)})){for(var o=e,s=0;s<r.length-1;++s){var a=r[s];void 0===o[a]&&(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}void 0!==n?o[i]=n:delete o[i]}}}var jy,zy={exports:{}},Hy=jy?zy.exports:(jy=1,zy.exports=function(){function e(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function n(n){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(s)return s(e,t).value}return e[t]},h=function e(){var t,n,r,i,o,s,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=u(h,n),h!==(i=u(t,n))&&(p&&i&&(l(i)||(o=a(i)))?(o?(o=!1,s=r&&a(r)?r:[]):s=r&&l(r)?r:{},c(h,{name:n,newValue:e(p,s,i)})):void 0!==i&&c(h,{name:n,newValue:i}));return h};function d(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=i.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map(e=>e.instance).indexOf(e),a=i.wrappedFields[t].attrExps.map(e=>e.instance).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(r)&&r.some((e,t)=>e!==t)){const e=r.indexOf(s);-1!==e&&(s=e)}return s-=t.qArea.qLeft,s<0||s>=t.qArea.qWidth?-1:l>=0?e=>e[s].qAttrDims.qValues[l]:a>=0?e=>e[s].qAttrExps.qValues[a]:e=>e[s]}function f(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function p(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:s,row:a,sourceKey:l,target:c,targetProp:u,columnOrder:p}=e,m=r;if(i.field&&i.field!==n){const e=d(i.field,o,{cache:t},p);if(-1===e)return;m=h({qRow:s},e(a))}c[u]=f(i,m,{key:l})}function m(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const s=t.raw(),a=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:c,main:u}=r.normalizeConfig(i[e],t),m=Object.keys(c),g=!!i[e].trackBy,y=typeof i[e].trackBy,v={},b=[],x=[];for(let t=0;t<s.qDataPages.length;t++){const o=d(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let d=0;d<s.qDataPages[t].qMatrix.length;d++){const w=s.qDataPages[t].qArea.qTop+d,q=h({qRow:w},o(s.qDataPages[t].qMatrix[d])),M=f(u,q,{key:a});if(!u.filter||u.filter(q)){for(let e=0;e<m.length;e++){const r=c[m[e]];let i=r.fields||[r];r.fields&&(M[m[e]]=[]);for(let o=0;o<i.length;o++)p({cache:n,f:l,mainCell:q,p:i[o],prop:m[e],page:s.qDataPages[t],rowIdx:w,row:s.qDataPages[t].qMatrix[d],sourceKey:a,target:r.fields?M[m[e]]:M,targetProp:r.fields?o:m[e],columnOrder:s.qColumnOrder});if(r.fields){const t=M[m[e]].map(e=>e.value),n=M[m[e]].map(e=>e.label);M[m[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(M[m[e]].value)}}}g&&r.track({cfg:i[e],itemData:q,obj:M,target:b,tracker:v,trackType:y}),x.push(M)}}}const w=g?r.collect(b,{main:u,propsArr:m,props:c}):x;o=[...o,...w]}return o}function g(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function y(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=b)):void 0===t&&(t=v);for(var n,r,i,o,s,a=new q(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new q(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(w)}function v(e){return e.children}function b(e){return Array.isArray(e)?e[1]:null}function x(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function w(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function q(e){this.data=e,this.depth=this.height=0,this.parent=null}function M(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}q.prototype=y.prototype={constructor:q,count:function(){return this.eachAfter(g)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t},copy:function(){return y(this).eachBefore(x)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}};var S={depth:-1},D={},_={};function k(e){return e.id}function C(e){return e.parentId}function E(){var e,t=k,n=C;function r(r){var i,o,s,a,l,c,u,h,d=Array.from(r),f=t,p=n,m=new Map;if(null!=e){const t=d.map((t,n)=>function(e){let t=(e=`${e}`).length;return T(e,t-1)&&!T(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r))),n=t.map(A),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(A(e)),d.push(_));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,i=d.length;s<i;++s)o=d[s],c=d[s]=new q(o),null!=(u=f(o,s,r))&&(u+="")&&(h=c.id=u,m.set(h,m.has(h)?D:c)),null!=(u=p(o,s,r))&&(u+="")&&(c.parent=u);for(s=0;s<i;++s)if(u=(c=d[s]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===D)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===_&&1===a.children.length;)a=a.children[0],--i;for(let e=d.length-1;e>=0&&(c=d[e]).data===_;--e)c.data=null}if(a.parent=S,a.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(w),a.parent=null,i>0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=M(e),r):t},r.parentId=function(e){return arguments.length?(n=M(e),r):n},r.path=function(t){return arguments.length?(e=M(t),r):e},r}function A(e){let t=e.length;if(t<2)return"";for(;--t>1&&!T(e,t););return e.slice(0,t)}function T(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function I(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=I(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=I(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function N(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...N(e[i].children,t-1,n)]);return r}function R(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const r=Math.max(0,Math.min(100,t-e));return e=>N(e.children,r-1,n)}return!1}const O=/^qDimensionInfo(?:\/(\d+))?/,P=/^\/?qMeasureInfo\/(\d+)/,L=/\/qAttrExprInfo\/(\d+)/,F=/\/qAttrDimInfo\/(\d+)/;function j(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function z(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,s=-1,a=-1,l=-1,c=-1,u=-1,h=r;const d=n.qEffectiveInterColumnSortOrder,f=j(n);return O.test(h)&&(i=!0,o=+O.exec(h)[1],h=r.replace(O,"")),P.test(h)&&("K"===n.qMode?c=+P.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+P.exec(h)[1],u=0):u=+P.exec(h)[1],h=h.replace(P,"")),h&&(F.exec(h)?a=+F.exec(h)[1]:L.exec(h)&&(s=+L.exec(h)[1])),l=i?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function H(e,t){let n,r,i=R(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function B(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function V(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,m,g,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,r)),"function"==typeof h.label&&(f=e=>h.label(e,r)),h.accessor?(m=h.accessor(r),Array.isArray(m)?(g=m.map(h.valueAccessor),h.attrAccessor&&(g=g.map(h.attrAccessor)),d&&(p=g.map(d),d=null),f&&(y=g.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(m)):h.valueAccessor(m),y=p)):(p=i,y=i)),a.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,r):c,label:"function"==typeof a.label?a.label(u,r):u})}}const $=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=I(r,e);return o&&o[0]?(t.tree=y(o[0],n.children||(e=>e[i])),t.tree):null};const W=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:s}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],a=i.fields?i.fields:[i];for(let e=0;e<a.length;e++){const t=a[e];if(t.field!==s){const e=H(o,z(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function U(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const o=t.raw(),s=t.key(),a="S"===o.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],r=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}(e),i=e.fields(),o=e.fields().filter(e=>"dimension"===e.type()).map(e=>r.indexOf(i.indexOf(e))),s=e.fields().filter(e=>"measure"===e.type()).map(e=>r.indexOf(i.indexOf(e))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const r=t[e];let i="__root",c=!1;for(let e=0;e<o.length;e++){var l;const t=r[o[e]],s="".concat(i,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);a[s]||(a[s]=n({__id:s,__parent:i,qValues:[]},t),c=!0),i=s}if(c)for(let e=0;e<s.length;e++){const t=r[s[e]];a[i].qValues.push(t)}}const c=Object.keys(a).map(e=>a[e]);return E().id(e=>e.__id).parentId(e=>e.__parent)(c)}(t):$(o,r,e);if(!a)return null;const l=a.height,c=[];for(let s=0;s<=l;s++){let a=null;if(s>0)if("S"===o.qMode){let e=j(o)[s-1];a=r.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[s-1];s>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),a=r.fields[e]}const{props:l,main:u}=i.normalizeConfig(n(n({},e),{},{field:a?a.key():void 0}),t),h=Object.keys(l);c[s]={propsArr:h,props:l,main:u};const d=a?z(a,{cube:o}):{fieldDepth:0};W({propsArr:h,props:l,cube:o,cache:r,itemDepthObject:d,f:a})}const u=a.copy().descendants(),h=a.descendants();for(let e=0;e<h.length;e++){const t=c[h[e].depth].propsArr,n=c[h[e].depth].props,r=c[h[e].depth].main,i=u[e],o=i.data,a=B(r,o,{key:s});V({propsArr:t,props:n,item:i,itemData:o,ret:a,sourceKey:s}),h[e].data=a}return a}function Y(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<i.length;s++)if(void 0!==i[s].field){const a=t.raw(),l=t.key();if(!$(a,n,e))continue;const c="object"==typeof i[s].field?i[s].field:t.field(i[s].field),{props:u,main:h}=r.normalizeConfig(i[s],t),d=Object.keys(u),f=z(c,{cube:a}),{nodeFn:p,attrFn:m,valueFn:g}=H({fieldDepth:0},f);W({propsArr:d,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!i[s].trackBy,v=typeof i[s].trackBy,b={},x=[],w=p(n.tree),q=[];for(let e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(h.filter&&!h.filter(n))continue;const o=B(h,n,{key:l});V({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[s],itemData:n,obj:o,target:x,tracker:b,trackType:v}),q.push(o)}const M=y?r.collect(x,{main:h,propsArr:d,props:u}):q;o=[...o,...M]}return o}var K=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e){var t;t=function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(h=t[0]).length%l,d=h.length,b=0;b<d;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},e.exports=t()});function X(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const G={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"},J=/%\)?$/,Z=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Q=/^\(oct\)/i,ee=/^\(dec\)/i,te=/^\(hex\)/i,ne=/^\(bin\)/i,re=/^\(rom\)/i,ie=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,oe=/#|0/g;function se(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function ae(e,t,n){let r;return Z.test(t)?e=se(e,Number(/\d{2}/.exec(t)[0]),t,n):Q.test(t)?e=se(e,8,t,n):ee.test(t)?e=se(e,10,t,n):te.test(t)?e=se(e,16,t,n):ne.test(t)?e=se(e,2,t,n):re.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<s.length;n++)if(s[n]<=i){r+=a[n],i-=s[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t)):t+r+e.toExponential(0)),e}function le(e,t,n){const r=X(e);return n?r:new RegExp(r||"",t)}function ce(e,t,n,r){let i,o,s,a,l,c,u,h,d,f=e.pattern;r&&(e.abbreviate=!0),d=function(e,t){return t&&(t=X(t)),e&&(e=X(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}(t,n),s=f.match(d),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(i=s.split(n),o=i.pop(),s=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(le(c,"g"),t)),u=n,n=".",u&&(s=s.replace(le(u,"g"),n)),h=s.match(/#/g),h=h?h.length:0;const p=f.split(u);let m;p[1]&&(m=p[1].match(oe)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=m?m.length:2,e.percentage=J.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(le(t,null,!0),"|").concat(le(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class ue{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return G;const n={};return e.qNumericalAbbreviation.split(t).forEach(e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])}),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new ue(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],ie.test(e[0])&&(r.positive.isFunctional=!0),e[1]?ie.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?ie.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||ce(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&ce(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&ce(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=ae(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let r,i,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(r=t[a-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(h=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=K(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(a=i.length;a<n;a++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),a=0;a<t;a++)l+="#";e=K(l,e)}e=e.replace(u.numericRegex,e=>e===s?u.groupTemp:e===o?u.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function he(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=e=>e}=t;let o,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return s=i(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=i(t),o.has(s)?o.get(s):o.set(s,e(t))),o.set=(e,t)=>(c>=n&&(delete a[l[u]],delete l[u],c--,u++),a[e]=t,l[c]=e,c++,t),o.get=e=>a[e],o.has=e=>e in a,o.clear=()=>{a=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function de(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ue(...t)}(i,e,t,n,r),s=he(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,r){return s.clear(),o.format(t,e,n,r)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const fe="D",pe="T",me="TS",ge="IV",ye=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ve=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],be=["January","February","March","April","May","June","July","August","September","October","November","December"],xe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function we(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function qe(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Me(e,t){let n,r=function(e){const t=e,n=24*qe(t),r=60*qe(n),i=60*qe(r),o=1e3*qe(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,s=r.m,a=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:s,s:a,f:l,t:u}}class Se{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:ye,qDayNames:ve,qLongMonthNames:be,qMonthNames:xe}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),t||(t={[pe]:r.qTimeFmt||"hh:mm:ss",[fe]:r.qDateFmt||"YYYY-MM-DD",[me]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new Se(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),r=Me(e,t));const i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:we("".concat(t.year).slice(-2),2),YYY:we("".concat(t.year).slice(-3),3),def:e=>we("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:we("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:we("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>we("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>we("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>we("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>we("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const s=new RegExp(o.join("|"),"g");return t.replace(s,e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r})}}function De(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Se(...t)}function _e(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=De(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=he(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==ge?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=De(i,e,t),r=he(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function ke(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:s,type:a,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=s||("dimension"===a?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u="dimension"===a?"first":"avg",h=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return _e(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",s=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(i,"##"),o="U"),de(n,r,i,o,t)}(t,i),d={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>a,origin:()=>l,items:()=>(e||(e=o(d)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:e=>(null==e?void 0:e.qText)||"",reduce:u,reduceLabel:"dimension"===a?"first":(e,t)=>h(t),formatter:()=>h,tags:()=>t.qTags};return d}function Ce(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const s="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),a={instance:ke(h({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},i))};return a.attrDims=Ce("qAttrDimInfo",t,n,s,h({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=Ce("qAttrExprInfo",t,n,s,h({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=Ce("qMeasureInfo",t,n,s,h({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a})}function Ee(){let{key:e,data:t,config:r={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=t;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=Ee.util,a={cache:i,cube:o,localeInfo:r.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:r.virtualFields},l={key:()=>e,raw:()=>o,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>i.fields.slice(),extract:e=>a.extractor(e,l,i,s),hierarchy:e=>a.hierarchy(e,l,i,s),_cache:()=>i};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(a.extractor=Y,a.hierarchy=U,a.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(a.extractor=m,a.pages=o.qDataPages,a.hierarchy=U):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},l,i,s);const c="S"===o.qMode?e=>e.qElemNumber:void 0,u="S"===o.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...Ce("qDimensionInfo",o,e,"",h({},a,{value:c,type:"dimension"}))),i.wrappedFields.push(...Ce("qMeasureInfo",o,e,"",h({},a,{value:u,type:"measure"}))),i.fields=i.wrappedFields.map(e=>e.instance);const d=e=>{e.forEach(e=>{i.allFields.push(e.instance),d(e.measures),d(e.attrDims),d(e.attrExps)})};return d(i.wrappedFields),(r.virtualFields||[]).forEach(t=>{const r=l.field(t.from),o=ke(n({meta:r.raw(),id:"".concat(e,"/").concat(t.key),sourceField:r,fieldExtractor:e=>a.extractor({field:e},l,i,s),key:t.key,type:r.type(),localeInfo:a.localeInfo,value:r.value},t.override||{}));i.virtualFields.push(o)}),i.allFields.push(...i.virtualFields),l}const Ae=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],Te=/\/qDimensionInfo(?:\/(\d+))?/,Ie=/\/qMeasureInfo\/(\d+)/,Ne=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,Re=/\/qAttrExprInfo\/(\d+)/,Oe=/\/?qHyperCube/,Pe=/\/?qTreeData/,Le=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),Fe=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function je(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],s={},a=e.isActive();let l=!1;return e.brushes().forEach(e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",s=e=>e;Oe.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=Le):Pe.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=Fe);let a=!0;if(Te.test(e)&&(r=+Te.exec(e)[1]),Ie.test(e)&&(i=+Ie.exec(e)[1]),Ne.test(e)){i=-1,r=0;const e=+Ne.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),a=!1}if(Re.test(e)){const e=i;if(t){i=0;const s=I(o,t);i+=(s.qMeasureInfo||[]).length,r>-1?(i=s.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=s.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=s.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+Re.exec(n)[1]}else r>-1?(r=-1,i=+Re.exec(n)[1]):i+=+Re.exec(n)[1]+1}return Ae.forEach(e=>{let[t,r]=e;n=n.replace(t,r)}),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach(e=>s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach(e=>s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach(e=>s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,a=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));(0===o||a>=o)&&o>-1?n.forEach(e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})}):n.forEach(e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})}),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map(e=>+e).filter(e=>!isNaN(e)),l=!!s.selectHyperCubeCells.values.length);else{const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}}),!l&&a?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]}),s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o);var c}function ze(e){Ee.util=e.data("matrix").util,e.data("q",Ee),e.formatter("q-number",de),e.formatter("q-time",_e)}return ze.qBrushHelper=je,ze.selections=je,ze}());Sg(Hy);const By=/xyz/.test(()=>{})?/\b_super\b/:/.*/,Vy=function(){};function $y(e,t,n,r){0===arguments.length?this.set(0,0,0,0):this.set(e,t,n,r)}Vy.extend=function e(t,n){const r=this.prototype;"string"!=typeof t&&(n=t,t="Class");const i=Object.create(this.prototype);for(const e in n)i[e]="function"==typeof n[e]&&"function"==typeof r[e]&&By.test(n[e])?function(e,t){return function(){const n=this._super;this._super=r[e];const i=t.apply(this,arguments);return this._super=n,i}}(e,n[e]):n[e];if(!/^[_a-z][_a-z\d]*$/i.test(t))throw new Error("Invalid subclass name. Alphanumericals only.");const o=new Function(`return (function ${t}(){ typeof this.init === 'function' && this.init.apply(this, [].slice.call(arguments)) });`)();return o.prototype=i,o.prototype.constructor=o,o.extend=e,o},$y.prototype={toString(){return`${this.x} ${this.y} ${this.width} ${this.height}`},clone(){return new $y(this.x,this.y,this.width,this.height)},set(e,t,n,r){n>=0?(this.x=e,this.width=n):(this.x=e+n,this.width=-n),r>=0?(this.y=t,this.height=r):(this.y=t+r,this.height=-r)},setLTRB(e,t,n,r){e<=n?(this.x=e,this.width=n-e):(this.x=n,this.width=e-n),t<=r?(this.y=t,this.height=r-t):(this.y=r,this.height=t-r)},equal(e){return e&&this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height},combineWith(e){const t=Math.max(e.getRight(),this.getRight()),n=Math.max(e.getBottom(),this.getBottom()),r=Math.min(e.x,this.x),i=Math.min(e.y,this.y);return new $y(r,i,Math.max(0,t-r),Math.max(0,n-i))},intersectsWith(e){return!!e&&(this.x<=e.getRight()&&e.x<=this.getRight()&&this.y<=e.getBottom()&&e.y<=this.getBottom())},intersectsRect(e){return this.intersectsWith(e)},intersection(e,t){if(this.intersectsWith(e)){const t=Math.max(this.x,e.x),n=Math.max(this.y,e.y);return new $y(t,n,Math.min(this.getRight(),e.getRight())-t,Math.min(this.getBottom(),e.getBottom())-n)}return t?null:new $y(this.x,this.y,this.width,this.height)},union(e){const t=Math.min(this.x,e.x),n=Math.min(this.y,e.y);return new $y(t,n,Math.max(this.getRight(),e.getRight())-t,Math.max(this.getBottom(),e.getBottom())-n)},pointInside(e,t){return e>=this.x&&e<=this.getRight()&&t>=this.y&&t<=this.getBottom()},rectInside(e){const t=e.getPoints();let n;for(n=0;n<4;n++)if(!this.pointInside(t[n].x,t[n].y))return!1;return!0},getPoints(){const e=[];return e.push({x:this.x,y:this.y}),e.push({x:this.getRight(),y:this.y}),e.push({x:this.getRight(),y:this.getBottom()}),e.push({x:this.x,y:this.getBottom()}),e},getRight(){return this.x+this.width},getBottom(){return this.y+this.height},getCenterPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}},getBoundingRect(){return this},scale(e){const t=e-1,n=t*this.width/2,r=t*this.height/2;this.x-=n,this.y-=r,this.width*=e,this.height*=e},hasNaN(){return Number.isNaN(+this.x)||Number.isNaN(+this.y)||Number.isNaN(+this.width)||Number.isNaN(+this.height)}};const Wy=new $y(0,0,0,0),Uy=new $y(0,0,0,0),Yy=Vy.extend("CubeSlicer",{init(){this.pages=[]},get(e){return e.map(e=>this.getPage(e))},getPage(e){let t,n;const r=[];let i;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,Wy.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),Uy.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),i=Uy.intersection(Wy,!0),r.push({coverage:i?i.clone():new $y(0,0,0,0),idx:n}),t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n]);return r.sort((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height),r[0].coverage.height>0&&r[0].coverage.width>0?this._extract(e,this.pages[r[0].idx]):{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qMatrix:[]}},destroy(){this.clear()},isEmpty(){return!(this.pages&&this.pages[0]&&this.pages[0].qArea.qHeight&&this.pages[0].qArea.qWidth)},clear(){this.pages=[]},store(e){this.pages=e},containsArea(e){let t;for(let n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return!0;return!1},contains(e){return!(!this.pages||!this.pages.length)&&0===e.filter(e=>!this.containsArea(e)).length},_extract(e,t){Wy.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),Uy.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=Wy.intersection(Uy,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qMatrix:[]};const r=Math.max(0,e.qTop-t.qArea.qTop),i=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qMatrix.slice(r,r+n.height).map(e=>e.slice(i,i+n.width));return{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qMatrix:o}}});let Ky;function Xy(e,t){let n;const r={};for(n in e)"qSubNodes"!==n&&e.hasOwnProperty(n)&&(r[n]=e[n]);return t.push(r),r}function Gy(e,t,n){let r,i,o;const s=[];let a=[],l=0,c=0;for(n.length&&(l=n[0].qUp||0,c=n[n.length-1].qDown||0),r=0;r<n.length;++r)if(i=n[r],i.qSubNodes.length>0&&(a=Gy(e,t,i.qSubNodes)),o=null,(0===i.qSubNodes.length&&Ky>=e&&Ky<=e+t||a.length>0)&&(o=Xy(i,s),void 0!==o.qUp&&1===s.length&&(o.qUp=l+r),o.qSubNodes=a),0===i.qSubNodes.length&&Ky++,Ky===e+t){o&&void 0!==o.qDown&&(o.qDown=c+(n.length-1-r));break}return s}function Jy(e,t,n){return Ky=0,Gy(e,t,n)}const Zy=new $y(0,0,0,0),Qy=new $y(0,0,0,0),ev=Yy.extend("PivotCubeSlicer",{init(){this._super(),this.requestedAreas=[]},getPage(e){let t,n;const r=[];let i;for(n=0;n<this.pages.length;n++)if(t=this.pages[n].qArea,Zy.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),Qy.set(t.qLeft,t.qTop,t.qWidth,t.qHeight),i=Qy.intersection(Zy,!0),r.push({coverage:i?i.clone():new $y(0,0,0,0),idx:n}),t.qLeft<=e.qLeft&&t.qLeft+t.qWidth>=e.qLeft+e.qWidth&&t.qTop<=e.qTop&&t.qTop+t.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n]);return r.sort((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height),r[0].coverage.height>0&&r[0].coverage.width>0?this._extract(e,this.pages[r[0].idx]):{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}}},_extract(e,t){Zy.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),Qy.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=Zy.intersection(Qy,!0);if(!n)return{qLeft:[],qTop:[],qData:[],qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0}};const r=Math.max(0,e.qTop-t.qArea.qTop),i=Math.max(0,e.qLeft-t.qArea.qLeft),o=t.qData.slice(r,r+n.height).map(e=>e.slice(i,i+n.width));return{qLeft:Jy(r,n.height,t.qLeft),qTop:Jy(i,n.width,t.qTop),qData:o,qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height}}}});function tv(e){if("pivot-table"===e.visualization)this.responseProperty="qPivotDataPages",this.slicer=new ev;else{if("table"!==e.visualization)return;this.slicer=new Yy}let t=e.snapshotData.object.origDataPages;t||(t=e.qHyperCube[this.responseProperty]),this.slicer.store(t.filter(e=>e))}class nv{constructor(e,t,n){this.layout=e,this.dataPath=t,this.responseProperty=n,tv.call(this,e)}getData(e){!function(e,t,n,r){if(e){t.snapshotData.object.origDataPages||(t.snapshotData.object.origDataPages=t.qHyperCube[r]);for(let e=0;e<n.length;e++)n[e].qHeight=Math.min(t.qHyperCube.qSize.qcy,n[e].qHeight),n[e].qTop=t.snapshotData.object.origDataPages[e].qArea.qTop;t.qHyperCube[r]=e.get(n)}}(this.slicer,this.layout,e,this.responseProperty);const t=Py(this.layout,`${this.dataPath}.${this.responseProperty}`);return Promise.resolve(t)}setCacheOptions(){}updateCache(){}}const rv={version:"1.0.3",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"K",qAlwaysFullyExpanded:!0,qSuppressZero:!1,qSuppressMissing:!0},color:{box:{paletteColor:{index:-1,color:"#e6e6e6"}},expressionLabel:"",point:{auto:!0,mode:"primary",useBaseColors:"off",expressionIsColor:!0}},dataPoint:{bubbleScales:100,displacement:"none"},dimensionAxis:{dock:"near",label:"auto",show:"all"},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"all",spacing:1},gridlines:{auto:!0,spacing:2},orientation:"horizontal",presentation:{visibleComponents:"points_box"},refLine:{refLines:[]},sorting:{autoSort:!0},showTitles:!0,subtitle:"",title:"",footnote:""};function iv(e){2===e.qHyperCubeDef.qInterColumnSortOrder.length?e.qHyperCubeDef.qInterColumnSortOrder=[1,0]:3===e.qHyperCubeDef.qInterColumnSortOrder.length&&(e.qHyperCubeDef.qInterColumnSortOrder=[1,2,0])}function ov(e){e.qHyperCubeDef.qDimensions.length>1&&e.color&&(e.color.point.persistent=!0)}function sv(e){const{translator:t}=e,n={min:1,max:2,description(e,n){let r;return r=0===n?"Visualizations.Descriptions.Point":"horizontal"===e.orientation?"properties.yAxis":"properties.xAxis",t.get(r)},added(e,t){iv(t),ov(t)},moved(e,t){iv(t),ov(t)},removed(e,t){iv(t),ov(t)}},r={min:1,max:1,description(e){const n="horizontal"===e.orientation?"properties.xAxis":"properties.yAxis";return t.get(n)}};return{path:"/qHyperCubeDef",dimensions:n,measures:r}}var av,lv={exports:{}};var cv=(av||(av=1,function(e){self,e.exports=(()=>{var e={909:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},s=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(h,n),h!==(i=l(t,n))&&(p&&i&&(s(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},a(h,{name:n,newValue:e(p,u,i)})):void 0!==i&&a(h,{name:n,newValue:i}));return h}},8:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},s=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(h,n),h!==(i=l(t,n))&&(p&&i&&(s(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},a(h,{name:n,newValue:e(p,u,i)})):void 0!==i&&a(h,{name:n,newValue:i}));return h}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Te});var e=r(229),t=r.n(e);const n=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],s=e;for(r=0;r<i.length-1;++r)void 0===s[i[r]]&&(s[i[r]]=Number.isNaN(+i[r+1])?{}:[]),s=s[i[r]];if(void 0!==n){var a=s[o];return s[o]=n,{updated:n,previous:a}}return delete s[o],!1},o=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},s={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var a="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function c(e){return a+e+l}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var s=r.qDerivedFieldData.qDerivedFieldLists[o],a=0;a<s.qFieldDefs.length;++a){var l=s.qFieldDefs[a];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function h(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function v(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function b(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,s=void 0===o?"Sum":o,a=e.valueComp,l=void 0===a?"0":a;if(!n.showExcludedValues)return"";if(r&&1===r.length){var c=v(u(r[0],i),p(0));return"".concat(s,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var h=u(r[0],i),d=u(r[1],i),f=p(0),m=p(1),g=v(h,f),y=v(d,m);return"".concat(s,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(s,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function w(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const q={isFullRange:h,getNumDimensions:w,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,s=c(f(t));if(!n.showExcludedValues)return s;var a=b({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var u=p(0);return"If(Count(".concat(u,") > 0, ").concat(s," + ").concat(a).concat(l,")")}if(r&&2===r.length){var h=p(0),d=p(1);return"If(Count(".concat(h,") * Count(").concat(d,") > 0, ").concat(s," + ").concat(a).concat(l,")")}return s},getRowNoComp:d,getNumStepComp:function(e,t){if(!h(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return m(e,t)+n+g(r)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===w({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",s=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(s,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(s,")"):r},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(a);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+a.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach(function(n){void 0===e[n]&&(e[n]=t[n])})},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,s=void 0===o?2:o;if(!t&&!n)return!0;var a=w({properties:t,layout:n});return a>=i&&a<=s},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(a),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=n.qHyperCubeDef.qMeasures.find(function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null});i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=s.OPTIONS.find(function(t){return t.value===e.decomposition});return t?s.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(s.EXPRESSIONS).find(function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return s.EXPRESSIONS[n]&&r.includes(s.EXPRESSIONS[n].toLowerCase())&&(t=n),n}),t}};function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function S(e){return S="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},S(e)}var D=t().bind(null,!0),_={},k=Array.isArray;function C(e){return null!=e&&!Array.isArray(e)&&"object"===S(e)}function E(e){return void 0===e}function A(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function T(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach(function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=E(e[n||t])?o:e[t],e=e[n||t]}}),e}function I(e,t){var n=!0;if(C(e)&&C(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){I(e[r],t[r])||(n=!1)}),n);if(k(e)&&k(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!I(e[r],t[r]))return!1;return!0}return e===t}_.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?D({},{val:e}).val:e}(t[i]),s=e[i],a="".concat(n,"/").concat(i);I(o,s)||A(t,i)||(E(s)?r.push({op:"add",path:a,value:o}):C(o)&&C(s)?r=r.concat(_.generate(s,o,a)):k(o)&&k(s)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function s(e,t,n){if(e[n]&&E(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(I(t,i))return r;if(!E(t[0])&&E(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var a=i.length-1;a>=0;a-=1)-1===(o=s(t,i[a].qInfo&&i[a].qInfo.qId,a))?(r.push({op:"remove",path:"".concat(n,"/").concat(a)}),i.splice(a,1)):r=r.concat(_.generate(i[a],t[o],"".concat(n,"/").concat(a)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=s(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(s,o,a)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))}),Object.keys(e).forEach(function(i){E(t[i])&&!A(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},_.apply=function(e,t){t.forEach(function(t){var n,r,i=T(e,t.path),o=t.path.split("/").splice(-1)[0],s=o&&Number.isNaN(+o)?i[o]:i[+o]||i,a=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,s=e),"add"===t.op||"replace"===t.op)if(k(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(k(s)&&k(t.value)){var l,c=t.value.slice();s.length=0,(l=s).push.apply(l,function(e){if(Array.isArray(e))return M(e)}(r=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return M(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(C(s)&&C(t.value))n=s,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!A(n,e)&&delete n[e]}),D(s,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var u=T(e,t.from);k(i)?i.splice(+o,0,u.splice(+a,1)[0]):(i[o]=u[a],delete u[a])}else"remove"===t.op&&(k(i)?i.splice(+o,1):delete i[o])})},_.clone=function(e){return D({},e)},_.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},_.updateObject=function(e,t){Object.keys(e).length?_.apply(e,_.generate(e,t)):D(e,t)};const N=_,R=function(e,n,r){if(!e)return Promise.resolve();var i=N.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),e.applyPatches(i,!0)):Promise.resolve()};var O="accumulation";function P(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===O)return n[r]}function L(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===O)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var F={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const j={translationKey:"properties.modifier.accumulation",needDimension:q.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,s=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=s;void 0===l&&(l=q.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=q.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=q.getNumStepComp(n,l),d=q.getAboveComp(n,l,u,h),f=q.getRangeComp("RangeSum",d);if(q.needDimension({modifier:n,properties:r,layout:i})){var p=q.getDimComp(c,1),m=q.getDimComp(c,0),g=q.getAggrComp(f,p,m);f=n.showExcludedValues?q.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,valueComp:g}):g}return f},extractInputExpression:q.extractInputExpression,initModifier:function(e){q.initModifier(e,F)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!q.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(L(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(L(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(L(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(L(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=P(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=P(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(L(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return q.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(O))return!1;var o=P(t,e);return o&&!o.disabled}};return n}};var z="movingAverage";function H(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===z)return n[r]}function B(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===z)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var V={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const $={translationKey:"properties.modifier.movingAverage",needDimension:q.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,s=e.layout,a=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=a;void 0===c&&(c=q.getNumDimensions({properties:i,layout:s}));var u=o(i,"qHyperCubeDef.qDimensions",[]),h=r.showExcludedValues&&r.nullSuppression,d=q.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:h}),f=q.getNumStepComp(r,c),p=q.getAboveComp(r,c,d,f);if(r.nullSuppression)t=q.getRangeComp("RangeAvg",p);else{var m=q.getRangeComp("RangeSum",p),g=function(e,t){var n=q.getRowNoComp(e,t);if(!q.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,c);t="".concat(m," / ").concat(g)}var y=t;if(q.needDimension({modifier:r,properties:i,layout:s})){var v=q.getDimComp(u,1),b=q.getDimComp(u,0),x=q.getAggrComp(y,v,b);y=r.showExcludedValues?q.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:q.extractInputExpression,initModifier:function(e){q.initModifier(e,V)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!q.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(B(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(B(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(B(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(B(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=H(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=H(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(B(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(B(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return q.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(z))return!1;var o=H(t,e);return o&&!o.disabled}};return n}};var W="timeSeriesDecomposition";function U(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===W)return n[r]}function Y(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===W)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var K={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const X={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:q.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?q.generateTSDExpression(n,t,r):t},extractInputExpression:q.extractInputExpression,initModifier:function(e,t){q.initModifier(e,K),""===e.decomposition&&t&&(e.decomposition=q.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!q.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(Y(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:s.OPTIONS},steps:{refFn:function(t){return"".concat(Y(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=U(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map(function(e){return e.qDef.modifiers.map(function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e}),e})}},show:function(t){var n=U(t,e);return n&&!n.fullRange}}},show:function(e,t){return q.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(W))return!1;var o=U(t,e);return o&&!o.disabled}};return n}};var G="difference";function J(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===G)return n[r]}function Z(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===G)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:q.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:q.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,s=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=s;void 0===l&&(l=q.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=q.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=q.getAboveComp(n,l,u),d="".concat(u," - ").concat(h);if(q.needDimension({modifier:n,properties:r,layout:i})){var f=q.getDimComp(c,1),p=q.getDimComp(c,0),m=q.getAggrComp(d,f,p);d=n.showExcludedValues?q.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,funcComp:"Only",valueComp:m}):m}return d},initModifier:function(e){Object.keys(Q).forEach(function(t){void 0===e[t]&&(e[t]=Q[t])})},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!q.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(Z(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return q.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(G))return!1;var o=J(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function se(e){return 2===e?"{1}":""}function ae(e,t,n){return 1===e?"{$<".concat(q.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ce(e,t,n){return 0===e&&t>1?"<".concat(q.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return q.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:q.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,s=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=s;void 0===l&&(l=q.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=q.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),h=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,r,i,o,s){var a=se(t),l=ae(t,n,r),c=""===a&&""===l?"":a||l,u=le(i,o),h=ce(i,o,s),d=function(e){for(var t=[],n=0;n<e;n++)t[n]=q.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(h," Aggr(").concat(c," ").concat(e,", ").concat(d,"))")}(u,h,n.field,n.value,d,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach(function(t){void 0===e[t]&&(e[t]=oe[t])})},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!q.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var r=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then(function(e){return e.map(function(e){return{label:e.qName,value:e.qName}})})},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(re(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(re(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,r){return function(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return q.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:se,getFieldSelectionComp:ae,getTotalComp:le,getSelectedDimComp:ce};var he="qDef.base",de="qDef.qDef",fe="qDef.base.qDef",pe="qLibraryId",me="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,fe);return void 0!==t?t:o(e,de)},getExpressionRef:function(e){return void 0!==o(e,fe)?fe:de},getLibraryIdRef:function(e){return o(e,me)?me:pe},getLibraryId:function(e){return o(e,me)||o(e,pe)},getLabelRef:function(e){return o(e,he)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,he)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",we="qDef.qLabel",qe="qDef.qLabelExpression",Me="qDef.base.qLabel",Se="qDef.base.qLabelExpression",De="qDef.qAggrFunc",_e="qDef.base.qAggrFunc",ke={initBase:function(e,t){(t||ke.isValid(e))&&(n(e,ve,o(e,ye)),n(e,xe,o(e,be)),n(e,Me,o(e,we)),n(e,Se,o(e,qe)))},restoreBase:function(e){ke.isValid(e)&&(n(e,ye,o(e,ve)),n(e,be,o(e,xe)),n(e,we,o(e,Me)),n(e,qe,o(e,Se)),o(e,De)&&o(e,_e)&&n(e,De,o(e,_e)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),n=o(e,xe);return void 0!==t||void 0!==n}};const Ce=ke;function Ee(e){return Ee="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},Ee(e)}var Ae={accumulation:j,movingAverage:$,difference:ee,normalization:ue,timeSeriesDecomposition:X};const Te={modifiers:Ae,apply:Ne,applyModifiers:Re,cleanUpMeasure:Oe,destroy:function(e){e&&Ie[e.id]&&Ie[e.id].masterItemSubscriber&&(Ie[e.id].masterItemSubscriber&&Ie[e.id].masterItemSubscriber.unsubscribe(),delete Ie[e.id])},hasActiveModifiers:Pe,getActiveModifier:Le,initBase:Ce.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Ae[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return Ae[e]&&Ae[e].isApplicable({properties:n,layout:r})})},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=ze(e);Ye({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ze({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:Fe};var Ie={};function Ne(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,s=void 0!==i&&i,a=e.masterItem,l=!1;Ie[n.id]=Ie[n.id]||{isFirstTime:!0};var c=Ie[n.id].isFirstTime;if(Ie[n.id].isFirstTime=!1,r&&"object"===Ee(r))return Re({model:n,properties:r});var u=n?n.layout:void 0,h=o(u,"qSelectionInfo.qInSelections");if(s||h)return Promise.resolve(l);var d=o(u,"qHyperCube.qMeasureInfo"),f=Ie[n.id].lastReloadTime;if(Ie[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Pe({measures:d,layout:u})){var p=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ue({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:d,layout:u,model:n,lastReloadTime:f});return p||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some(function(e){return function(e){var t=e.measure,n=e.layout;return Ye({modifiers:ze(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:d,layout:u,masterItem:a,isFirstTime:c})?n.getEffectiveProperties().then(function(e){var r=t()(!0,{},e);Be(r);var i=Qe(r);return Ke({model:n}).then(function(t){return Xe({libraryIds:i,model:n}).then(function(i){return p&&function(e){var t=e.properties;je(t).forEach(function(e){return function(e){var t=e.measure;if(Ue({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===Ee(e)&&!e.disabled){if(n++,"object"!==Ee(Ae[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=Ae[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&$e(t)&&q.simplifyExpression(t.qDef.base.qDef)!==q.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:r}),Re({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:a,libraryItemsProps:i,dimensionAndFieldList:t})})})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===Ee(e.base)})}(d)?n.getEffectiveProperties().then(function(e){return function(e){var n=e.model,r=e.properties,i=Qe(r);return et({model:n,libraryIds:i}).then(function(){var e=t()(!0,{},r);return je(r).forEach(function(e){return Oe(e)}),Je({oldProperties:e,newProperties:r,model:n})})}({model:n,properties:e})}):Promise.resolve(l)}function Re(e){var n=e.model,r=e.oldProperties,i=e.properties,s=e.measures,a=e.runUpdateIfChange,l=void 0!==a&&a,c=e.masterItem,u=e.libraryItemsProps,h=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),Be(i);var d=Qe(i);return et({model:n,libraryIds:d,masterItem:c}).then(function(){return function(e){var n=e.measures,r=e.properties,i=e.model,s=e.libraryItemsProps,a=e.dimensionAndFieldList;if(n||(n=je(r)),!n.length)return Promise.resolve();if(!Pe({measures:n,properties:r}))return n.forEach(function(e){return Oe(e)}),Promise.resolve();var l=s?void 0:Qe(r);return Ke({model:i,dimensionAndFieldList:a}).then(function(e){return Xe({libraryIds:l,model:i,libraryItemsProps:s}).then(function(i){n.forEach(function(n){Ye({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,s=e.dimensionAndFieldList,a=0;Ce.isValid(n)||Ce.initBase(n,!0);var l=n.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach(function(e){if("object"===Ee(e)&&!e.disabled){if(a++,"object"!==Ee(Ae[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(a>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Ae[e.type].initModifier(e,n);var l=n.qLibraryId||u&&u.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,s=e.libraryItemsProps[e.libraryId],a=s.qMeasure.qDef,l=""===a?a:Ae[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||s.qMeasure.qLabel)&&(n.qDef.qLabel=s.qMeasure.qLabel),(n.qDef.qLabelExpression||s.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=s.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&s.qMeasure.qNumFormat&&(n.qDef.qNumFormat=s.qMeasure.qNumFormat,n.qDef.isCustomFormatted=s.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=s.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:s}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof Ae[r.type].updateModifier&&Ae[r.type].updateModifier(r,i.qHyperCubeDef);var s=ge.getExpression(n),a=""===s?s:Ae[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=a,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||s,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:s}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||Fe(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&Fe(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}})}({measure:n,properties:r,libraryItemsProps:i,dimensionAndFieldList:e}),Ve(n)):Oe(n)})})})}({measures:s,properties:i,model:n,libraryItemsProps:u,dimensionAndFieldList:h}).then(function(){return l?Je({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)})})}function Oe(e){!function(e){var t=ze(e);return Array.isArray(t)&&t.some(function(e){return"object"===Ee(e)&&!e.disabled&&!Ae[e.type]})}(e)?Ce.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Ve(e)}function Pe(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ye({modifiers:ze(e),properties:n,layout:r})})}function Le(e){var t=ze(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Ae[r.type]&&!r.disabled)return r}}function Fe(e){var t=Le(e);return!t||Ae[t.type].enableTotalsFunction(e)}function je(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function ze(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function He(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function Be(e){je(e).forEach(function(e){return function(e){var n=Le(e);n&&(void 0!==n.outputExpression&&He(n)!==e.qDef.qDef?delete e.qDef.base:!Ce.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)})}function Ve(e){var t=ze(e);Array.isArray(t)&&t.forEach(function(t){"object"===Ee(t)&&(t.disabled||!Ae[t.type]&&He(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function $e(e){return e.base||e.qDef&&e.qDef.base}function We(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function Ue(e){var t=e.measure,n=e.properties,r=e.layout;return!We(t)&&Ye({modifiers:ze(t),properties:n,layout:r})}function Ye(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==Ee(e)||e.disabled||!Ae[e.type])&&(void 0===i[e.type]&&(i[e.type]=Ae[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Ke(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then(function(e){i.dimensionList=e});r.push(o);var s=t.app.getFieldList().then(function(e){i.fieldList=e});return r.push(s),Promise.all(r).then(function(){return i})}function Xe(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,s={},a=[];return i.forEach(function(e){var t=n.app.getMeasure(e).then(function(t){return t.getProperties().then(function(t){s[e]=t})});a.push(t)}),o.forEach(function(e){var t=n.app.getDimension(e).then(function(t){return t.getProperties().then(function(t){s[e]=t})});a.push(t)}),Promise.all(a).then(function(){return s})}function Ge(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Ge)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Ge)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ge)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ge);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):R(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Ze(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===Ee(e)&&!e.disabled&&Ae[e.type]&&Ae[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Qe(e){var t=je(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=ze(t);if(Ye({modifiers:r,properties:e})){var o=We(t);o&&n.push(o),i=i||Ze({modifiers:r,properties:e})}}),o(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&r.push(t)}),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Ie[t.id].masterItemSubscriber=Ie[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},s={},a={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&a[n]&&a[n].forEach(function(n){t[n]=o(e,n)}),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function u(e,n){return t.app[n](e).then(function(t){r[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}})}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,a=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach(function(e){i[e]=!0}),s={},t.forEach(function(e){s[e]=!0})}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach(function(e){i[e]||s[e]||(r[e].listener.dispose(),delete r[e])}),t.app&&(Object.keys(i).forEach(function(e){i[e]&&!r[e]&&a.push(u(e,"getMeasure"))}),Object.keys(s).forEach(function(e){s[e]&&!r[e]&&a.push(u(e,"getDimension"))})),Promise.all(a)},unsubscribe:function(){Object.keys(r).forEach(function(e){r[e].listener.dispose()}),r={}}}}({model:t,callback:function(e){return Ne({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),Ie[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}n.d(r,{default:()=>Be});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var s=r[o];if(""!==s){if(void 0===i[s]||null===i[s])return n;i=i[s]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,s=0;s<r.length-1;++s){var a=r[s];void 0!==o[a]&&null!==o[a]||(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function s(e){return function(e){if(Array.isArray(e))return a(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 a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(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 a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return c(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 c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(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 c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}const h={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:u};var d=n(8),f=n.n(d);const p=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,s(r.qDimensions));var a,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(a=i.excludedDimensions).push.apply(a,s(l))},m=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var s,a=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");a&&(s=i.excludedMeasures).push.apply(s,l(a))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&h.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach(function(e){t.properties[e]=n[e]})},v=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach(function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])}),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach(function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)})}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},b=function(e){e.forEach(function(e){f().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)})};function x(e,t,n){var r,i,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((i=(i=(r=JSON.stringify(a)).match(/:\{/g))?i.length:0)>2&&!s)return;a=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var l=o.getValue(e,"qLayoutExclude.quarantine");l[n]||(l[n]={}),l[n][t]=a}var w=n(909),q=n.n(w);function M(e,t){var n=q()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function S(e,t){return q()(!0,{},t,e)}function D(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var _=Math.pow(2,53)-1;function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const E=function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},A=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},T=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},I=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}}},N=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},R=function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,s=e.defaultDimension,a=n.data[0];for(t=0;t<a.dimensions.length;++t){var l=M(a.dimensions[t],s);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<a.excludedDimensions.length;++t){var c=M(a.excludedDimensions[t],s);o.qDimensions.length<i?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},O=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,s=e.defaultMeasure,a=n.data[0];for(t=0;t<a.measures.length;++t){var l=S(a.measures[t],s);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<a.excludedMeasures.length;++t){var c=S(a.excludedMeasures[t],s);o.qMeasures.length<i?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},P=function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},s=r.measures||{max:0},a=D(s.max,i.dimensions.length,_),l=D(s.min,i.dimensions.length,0);return{maxDimensions:D(o.max,a,_),minDimensions:D(o.min,l,0),maxMeasures:a,minMeasures:l}},L=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(h.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,h.indexRemoved(n.qInterColumnSortOrder,o))},F=function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach(function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=q()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some(function(e){return"general"===e.key})}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]}),null===(i=q()(!0,{},n,i)).components&&(i.components=[]),i},j=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=t.data[0];return s.dimensions.length>n&&n>0||s.measures.length>i&&i>0||s.excludedDimensions.length>0&&s.dimensions.length+s.excludedDimensions.length>r||s.excludedMeasures.length>0&&s.measures.length+s.excludedMeasures.length>o||!i&&s.measures.length>0||!n&&s.dimensions.length>0},z=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=e.newHyperCubeDef,a=t.data[0];s.qLayoutExclude||(s.qLayoutExclude={}),s.qLayoutExclude.qHyperCubeDef||(s.qLayoutExclude.qHyperCubeDef={}),(a.dimensions.length>n&&n>0||a.excludedDimensions&&a.excludedDimensions.length&&a.dimensions.length+a.excludedDimensions.length>r)&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(a.measures.length>i&&i>0||a.excludedMeasures&&a.excludedMeasures.length&&a.measures.length+a.excludedMeasures.length>o)&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&a.measures.length&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&a.dimensions.length&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},H=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var s=o.getValue(n,i||"").qHyperCubeDef,a=function(e){if(Array.isArray(e))return k(e)}(t=s.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();s.qDimensions=[],a.forEach(function(e){s.qDimensions.push(e),r.dimensions.added(e,n)})}},B=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var s=o.getValue(n,i||"").qHyperCubeDef,a=function(e){if(Array.isArray(e))return C(e)}(t=s.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();s.qMeasures=[],a.forEach(function(e){s.qMeasures.push(e),r.measures.added(e,n)})}},V=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f().isSupportedModifiers(n)&&t.forEach(function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store})};function $(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach(function(t){o.setValue(e,t,n[t])}),delete e.qLayoutExclude.quarantine[t],!0)}const W={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),s=t.qProperty,a=o.getValue(s,n||""),l=a.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p({exportFormat:i,qHyperCubeDef:l}),m({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:s}),n&&(i.properties.qHyperCubeDef=l,delete a.qHyperCubeDef),v({exportFormat:i,properties:s}),r||b(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(x(i.properties,"filters","storedFilters",!0),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(x(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(x(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,s=void 0===i?{}:i,a=e.defaultPropertyValues,l=void 0===a?{}:a,c=e.hypercubePath,u=e.extension,h=e.supportedFilters,d=void 0===h||h,f=e.isHCModifierSupported,p=void 0===f||f,m={qChildren:[]},g=F({exportFormat:t,initialProperties:r,hypercubePath:c}),y=o.getValue(r,c||"").qHyperCubeDef,v=o.getValue(g,c||"").qHyperCubeDef,b=P({exportFormat:t,dataDefinition:s}),x=b.maxDimensions,w=b.minDimensions,q=b.maxMeasures,M=b.minMeasures,S=l.defaultDimension,D=void 0===S?I():S,_=l.defaultMeasure,k=void 0===_?N():_;v.qDimensions.length=0,v.qMeasures.length=0,j({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:q,minMeasures:M})&&z({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:q,minMeasures:M,newHyperCubeDef:v}),R({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:v,defaultDimension:D}),O({exportFormat:t,maxMeasures:q,minMeasures:M,newHyperCubeDef:v,defaultMeasure:k}),H({newProperties:g,dataDefinition:s,hypercubePath:c}),B({newProperties:g,dataDefinition:s,hypercubePath:c}),L({exportFormat:t,newHyperCubeDef:v}),A("qMaxStackedCells",y,v),A("qNoOfLeftDims",y,v),T("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),T("qMode",y,v,"S"),T("qReductionMode",y,v,"N"),T("qSortbyYValue",y,v),T("qIndentMode",y,v),T("qShowTotalsAbove",y,v),E(g,t,r),m.qProperty=g;var C=o.getValue(u||{},"support.modifiers");return V({measures:v.qMeasures,modifierTypes:C}),d&&$(m.qProperty,"storedFilters"),"S"===v.qMode&&p&&$(m.qProperty,"dynamicScript"),m}};var U={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function Y(e,t,n,r){t=t||[];var i=u(e,r,n),o=u(t,r,n);if(-1!==i&&-1===o){var s=e.splice(i,1);t.push(s[0])}return t}function K(e,t){return e.length!==t}const X={create:function(e,t){if(!e||!U[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach(function(e){n[e]=t[e]}),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var s=e[o][n],a=t.length;if(Y(s,t,r,i),K(t,a))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"}},G={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},J={colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>0&&G.getNumMeasures(e)<=1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)>0},expression:function(e){return G.getNumMeasures(e)>=1}}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return G.getNumMeasures(e)>=1}}};var Q={scatterplot:Z,"sn-scatter-plot":Z,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return G.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)<=1},expression:function(e){return G.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>=1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)>=1},expression:function(e){return G.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 G.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=h.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=X.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}),t.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,s=e.measures,a=e.label;te(r,i);var l=r[r.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var f=X.create(X.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=s)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=h.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:f,measures:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function ie(e,t,n,r){var i,o,s,a={};switch(e){case"dimension":n.qLibraryId?(a.type="dimension",a.name=n.qLibraryId,a.id=n.qLibraryId):(a.type="field",t?(a.name=n.label||n.qDef,a.id=n.qDef):(a.name=n.qDef.qFieldDefs[0],a.label=(s=n.qDef).qLabelExpression?s.qLabelExpression:s.qFieldLabels&&s.qFieldLabels[0]?s.qFieldLabels[0]:s.qFieldDefs[0]));break;case"measure":i=function(e,t){return t?e.qLibraryId:f().measureBase.getLibraryId(e)}(n,t),i?(a.type="measure",a.name=i,a.id=i,o=function(e,t){return f().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(a.expression=o)):(a.type="expression",t?(a.name=n.label||n.qExpression,a.id=n.qExpression):(a.name=n.qDef.qDef,a.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return a}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function se(e,t,n,r){var i=t.type,o=e.color,s=o.mode,a=G.getItemLabel(t);switch(ne(e,a||""),i){case"field":s="byDimension",o.byDimDef={label:t.label||G.wrapFieldName(t.name),key:G.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":s="byMeasure",o.byMeasureDef={label:a,key:t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":s="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":s="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}o.auto=!1,o.mode=s}function ae(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byDimDef");if(s&&ne(e,s.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,se(e,i)}(e,t);else if(function(e){return!e||!e.key}(s)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),s=Number(i[1]),a=o.getValue(t,"layers.".concat(s,".type"));return 2===e.length&&"map"===r&&"point"===a}(n,e,t)?0:n.length-1],i=X.IDMAP.COLOR_BY_ALTERNATIVE,s=h.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return se(e,ie("dimension",!!s,s||r)),!!s}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ce=function(e,t){var n={primary:!0};if(e){var r=(Q[t]||J).colorModeOptions||J.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ue=function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},he=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),s=o.getValue(e,"".concat(t,"qDimensions"),[]),a=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(s,l):!(n={auto:i,colorMode:r,dimensions:s}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?ae(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,s=e.properties,a=o.getValue(s,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==a&&!i.length)}({auto:i,colorMode:r,dimensions:s,measures:a,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byMeasureDef");if(s&&ne(e,s.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,se(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(s,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],s=X.IDMAP.COLOR_BY_ALTERNATIVE,a=h.findItemByPropertyValue(i.qAttributeExpressions,"id",s);return se(e,ie("measure",!!a,a||r[0])),!!a}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,s)}(e,t)},de=function(e){e.forEach(function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode})},fe=function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},pe=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},me=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=W.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],s=o.dimensions.concat(o.excludedDimensions),a=o.measures.concat(o.excludedMeasures),l=X.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return X.moveByIdFromGroup(s,[],"qAttributeDimensions",c),X.moveByIdFromGroup(s,[],"qAttributeExpressions",c),X.moveByIdFromGroup(a,[],"qAttributeExpressions",u),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,s=e.hypercubePath,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=W.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:s,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty,d=o.getValue(h,"visualization"),f=o.getValue(h,"qHyperCubeDef.qDimensions",[]),p=o.getValue(h,"color.mode",""),m=o.getValue(h,"color.auto",""),g=ce(h,d),y=ue({canColorBy:g,autoColor:m,colorMode:p,dimensions:f});return g[p]?fe({shouldUpdateColorBy:y,properties:h})&&pe(h):me(h),y&&he(h,"qHyperCubeDef."),ge(h)&&le(h,"color.persistent",!0),de(f),u}};var ve=["bar","marker","line"];const be=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?$(n,"unsupportedAutoMinMax")||q()(n.measureAxis,t.measureAxis):$(n,"supportedAutoMinMax")||q()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,s=i.qHyperCubeDef,a=i.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach(function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),ve.includes(r)&&t[i].type[r]++,t[i].type.total++}}),t}(s);l.length?(o&&(t=l.filter(function(e){return e.type[o]>0}).sort(function(e,t){return t.type[o]-e.type[o]})),t&&t.length||(t=l.sort(function(e,t){return t.type.total-e.type.total})),t&&t[0]&&q()(a,n.properties.measureAxes[t[0].axis])):q()(a,n.properties.measureAxes[0])}},we=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},qe={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,s=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),a=s.properties;return o?(x(a,"measureAxis.min","supportedAutoMinMax"),x(a,"measureAxis.max","supportedAutoMinMax")):(x(a,"measureAxis.min","unsupportedAutoMinMax"),x(a,"measureAxis.max","unsupportedAutoMinMax")),s},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,s=e.measureType,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:a,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty;return be({initialProperties:n,properties:h}),xe({exportFormat:t,initialProperties:n,properties:h,measureType:s}),we(h.qHyperCubeDef),h.qHyperCubeDef.qColumnOrder=[],h.qHyperCubeDef.columnOrder=[],u}};function Me(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Se(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,s=e.itemPath,a=o.getValue(i,s);if(void 0!==a){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var c=Me(n,r,l);o.setValue(t,c,a),o.setValue(i,s,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})})}function De(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,s=e.itemPath,a=o.getValue(i,"qDef.cId");if(a){var l=Me(n,r,a),c=o.getValue(t,l);void 0!==c&&(o.setValue(i,s,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})})}var _e="qHyperCubeDef.qMeasures",ke="conditionalColoring",Ce="measures",Ee="qDef.conditionalColoring";const Ae={quarantine:function(e){Se({properties:e,arrayPath:_e,quarantineName:ke,arrayName:Ce,itemPath:Ee})},unquarantine:function(e){De({properties:e,arrayPath:_e,itemPath:Ee,arrayName:Ce,quarantineName:ke})}};var Te="qHyperCubeDef.qMeasures",Ie="measures",Ne="qHyperCubeDef.qDimensions",Re="dimensions",Oe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Pe="alternativeMeasures",Le="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",Fe="alternativeDimensions",je="qCalcCondition",ze="conditionalShowHide";const He={quarantine:function(e){Se({properties:e,arrayPath:Te,quarantineName:ze,arrayName:Ie,itemPath:je}),Se({properties:e,arrayPath:Ne,quarantineName:ze,arrayName:Re,itemPath:je})},unquarantine:function(e){De({properties:e,arrayPath:Te,quarantineName:ze,arrayName:Ie,itemPath:je}),De({properties:e,arrayPath:Ne,quarantineName:ze,arrayName:Re,itemPath:je})},quarantineAlternative:function(e){Se({properties:e,arrayPath:Oe,quarantineName:ze,arrayName:Pe,itemPath:je}),Se({properties:e,arrayPath:Le,quarantineName:ze,arrayName:Fe,itemPath:je})},unquarantineAlternative:function(e){De({properties:e,arrayPath:Oe,quarantineName:ze,arrayName:Pe,itemPath:je}),De({properties:e,arrayPath:Le,quarantineName:ze,arrayName:Fe,itemPath:je})}},Be={hypercube:W,colorChart:ye,axisChart:qe,quarantineProperty:x,unquarantineProperty:$,quarantineArrayProp:Se,unquarantineArrayProp:De,conditionalColoring:Ae,conditionalShow:He}})(),r.default})()}(lv)),lv.exports),uv=n(cv);function hv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function dv(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fv(Object(n),!0).forEach(function(t){dv(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function mv(e){return function(e){if(Array.isArray(e))return hv(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 hv(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hv(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 gv(e){return gv="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},gv(e)}var yv,vv="top",bv="top-right",xv="right",wv="bottom-right",qv="bottom",Mv="bottom-left",Sv="left",Dv="top-left";dv(dv(dv(dv(dv(dv(dv(dv(dv(dv(yv={},"equal-equal",[vv,qv]),"equal-higher",[qv,wv]),"equal-lower",[vv,bv]),"equal-void",[vv,qv]),"higher-equal",[Sv,Mv,vv,bv]),"higher-higher-acute",[qv,Mv,Sv,bv]),"higher-higher-obtuse",[qv,vv]),"higher-lower-negative",[vv,bv,xv]),"higher-lower-positive",[qv,Mv,Sv]),"higher-void",[vv]),dv(dv(dv(dv(dv(dv(dv(dv(dv(dv(yv,"lower-equal",[vv]),"lower-higher-negative",[vv,Dv]),"lower-higher-positive",[wv]),"lower-lower-acute",[vv,Dv,Sv,bv,xv]),"lower-lower-obtuse",[vv,qv]),"lower-void",[vv]),"void-equal",[vv]),"void-higher",[vv,qv]),"void-lower",[vv,qv,Sv]),"void-void",[vv]),dv(yv,"unclassified",[vv,qv,xv,Sv,bv,wv,Mv,Dv]);var _v=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],kv=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];var Cv=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function Ev(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],s=t.getStyle("","","fontFamilies");return Array.isArray(s)&&s.length?o.push.apply(o,mv(new Set([r].concat(mv(s.map(function(e){return e.split(",").map(function(e){return e.trim()}).map(function(e){return e.replace(/\s+/g," ").trim()}).filter(Boolean).join(", ")})))))):o.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(mv(o.map(function(e){return Cv(e)})),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],mv(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?kv:_v}(i).map(function(e){return Cv(e)})))}function Av(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,s=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return s()},getOptions:function(){return Ev({theme:t,translator:n,defaultValue:s(),flags:o})}}}var Tv,Iv,Nv=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Rv=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function Ov(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,r=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push.apply(r,mv(new Set([n].concat(mv(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(mv(r.map(function(e){return Rv(e)})),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],mv(Nv.map(function(e){return Rv(e)})))}({theme:t,translator:n,defaultValue:o()})}}}function Pv(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:Av({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:Ov({theme:t,translator:n,id:r,path:i})}}function Lv(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,s=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:i}),a=s.id,l=s.paths,c={};l.forEach(function(e){for(var r=e.split("."),i=c,s=0;s<r.length;s++){var l=r[s];s===r.length-1?i[l]=Pv({theme:t,translator:n,id:a,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}});var u=function(e){for(var t=e.split("."),n=c,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return c.getDefaultValue=function(e){return u(e).getDefaultValue()},c.getOptions=function(e){return u(e).getOptions()},c}var Fv,jv=function(){if(Iv)return Tv;Iv=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},s=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return Tv=function e(){var t,n,r,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=a(h,n),h!==(l=a(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},s(h,{name:n,newValue:e(p,u,l)})):void 0!==l&&s(h,{name:n,newValue:l}));return h},Tv}(),zv=(Fv=jv)&&Fv.__esModule&&Object.prototype.hasOwnProperty.call(Fv,"default")?Fv.default:Fv;function Hv(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map(function(e){return i[e.value%i.length]})},valueAccessor:e.value}}function Bv(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map(function(e){return i[e.row.value%i.length]})},valueAccessor:e.value}}function Vv(e,t,n,r,i){var o,s,a=i.byRow,l=i.byElemNo;if(r&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(s=(o=e.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===s?void 0:s.qArea.qHeight)||0)))return l(r,r.raw().qCardinal);if(r){var c=t.pic.extract({field:r.key(),trackBy:r.value}).length;return a(r,c)}return{}}function $v(e,t){var n=e.hc.qDimensionInfo,r=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(r.activeDimensionIndex>=0){var i=n[r.activeDimensionIndex];r=i.coloring&&i.coloring.colorMapRef?{type:"libraryItem",key:i.coloring.colorMapRef,activeDimensionIndex:r.activeDimensionIndex}:{activeDimensionIndex:r.activeDimensionIndex}}return r}function Wv(e,t){var n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter(function(e){return"dimension"===e.type()})[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(n=t.key?e.pic.field(function(e){return e.raw().colorMapRef===t.key}):void 0)&&(n=e.pic.field(function(e){return"colorByAlternative"===e.raw().id})):"expression"===t.type&&(n=e.pic.field(function(e){return"colorByAlternative"===e.raw().id})),n}function Uv(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Yv(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Kv(){}var Xv=1/.7,Gv="\\s*([+-]?\\d+)\\s*",Jv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Zv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Qv=/^#([0-9a-f]{3,8})$/,eb=new RegExp(`^rgb\\(${Gv},${Gv},${Gv}\\)$`),tb=new RegExp(`^rgb\\(${Zv},${Zv},${Zv}\\)$`),nb=new RegExp(`^rgba\\(${Gv},${Gv},${Gv},${Jv}\\)$`),rb=new RegExp(`^rgba\\(${Zv},${Zv},${Zv},${Jv}\\)$`),ib=new RegExp(`^hsl\\(${Jv},${Zv},${Zv}\\)$`),ob=new RegExp(`^hsla\\(${Jv},${Zv},${Zv},${Jv}\\)$`),sb={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 ab(){return this.rgb().formatHex()}function lb(){return this.rgb().formatRgb()}function cb(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Qv.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?ub(t):3===n?new pb(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?hb(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?hb(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=eb.exec(e))?new pb(t[1],t[2],t[3],1):(t=tb.exec(e))?new pb(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=nb.exec(e))?hb(t[1],t[2],t[3],t[4]):(t=rb.exec(e))?hb(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ib.exec(e))?xb(t[1],t[2]/100,t[3]/100,1):(t=ob.exec(e))?xb(t[1],t[2]/100,t[3]/100,t[4]):sb.hasOwnProperty(e)?ub(sb[e]):"transparent"===e?new pb(NaN,NaN,NaN,0):null}function ub(e){return new pb(e>>16&255,e>>8&255,255&e,1)}function hb(e,t,n,r){return r<=0&&(e=t=n=NaN),new pb(e,t,n,r)}function db(e){return e instanceof Kv||(e=cb(e)),e?new pb((e=e.rgb()).r,e.g,e.b,e.opacity):new pb}function fb(e,t,n,r){return 1===arguments.length?db(e):new pb(e,t,n,null==r?1:r)}function pb(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function mb(){return`#${bb(this.r)}${bb(this.g)}${bb(this.b)}`}function gb(){const e=yb(this.opacity);return`${1===e?"rgb(":"rgba("}${vb(this.r)}, ${vb(this.g)}, ${vb(this.b)}${1===e?")":`, ${e})`}`}function yb(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function vb(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function bb(e){return((e=vb(e))<16?"0":"")+e.toString(16)}function xb(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new qb(e,t,n,r)}function wb(e){if(e instanceof qb)return new qb(e.h,e.s,e.l,e.opacity);if(e instanceof Kv||(e=cb(e)),!e)return new qb;if(e instanceof qb)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new qb(s,a,l,e.opacity)}function qb(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Mb(e){return(e=(e||0)%360)<0?e+360:e}function Sb(e){return Math.max(0,Math.min(1,e||0))}function Db(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Uv(Kv,cb,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ab,formatHex:ab,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return wb(this).formatHsl()},formatRgb:lb,toString:lb}),Uv(pb,fb,Yv(Kv,{brighter(e){return e=null==e?Xv:Math.pow(Xv,e),new pb(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new pb(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new pb(vb(this.r),vb(this.g),vb(this.b),yb(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:mb,formatHex:mb,formatHex8:function(){return`#${bb(this.r)}${bb(this.g)}${bb(this.b)}${bb(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:gb,toString:gb})),Uv(qb,function(e,t,n,r){return 1===arguments.length?wb(e):new qb(e,t,n,null==r?1:r)},Yv(Kv,{brighter(e){return e=null==e?Xv:Math.pow(Xv,e),new qb(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new qb(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new pb(Db(e>=240?e-240:e+120,i,r),Db(e,i,r),Db(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new qb(Mb(this.h),Sb(this.s),Sb(this.l),yb(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=yb(this.opacity);return`${1===e?"hsl(":"hsla("}${Mb(this.h)}, ${100*Sb(this.s)}%, ${100*Sb(this.l)}%${1===e?")":`, ${e})`}`}}));const _b=Math.PI/180,kb=180/Math.PI,Cb=4/29,Eb=6/29,Ab=3*Eb*Eb;function Tb(e){if(e instanceof Ib)return new Ib(e.l,e.a,e.b,e.opacity);if(e instanceof Lb)return Fb(e);e instanceof pb||(e=db(e));var t,n,r=Pb(e.r),i=Pb(e.g),o=Pb(e.b),s=Nb((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=s:(t=Nb((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Nb((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Ib(116*s-16,500*(t-s),200*(s-n),e.opacity)}function Ib(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Nb(e){return e>.008856451679035631?Math.pow(e,1/3):e/Ab+Cb}function Rb(e){return e>Eb?e*e*e:Ab*(e-Cb)}function Ob(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Pb(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Lb(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Fb(e){if(isNaN(e.h))return new Ib(e.l,0,0,e.opacity);var t=e.h*_b;return new Ib(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Uv(Ib,function(e,t,n,r){return 1===arguments.length?Tb(e):new Ib(e,t,n,null==r?1:r)},Yv(Kv,{brighter(e){return new Ib(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Ib(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new pb(Ob(3.1338561*(t=.96422*Rb(t))-1.6168667*(e=1*Rb(e))-.4906146*(n=.82521*Rb(n))),Ob(-.9787684*t+1.9161415*e+.033454*n),Ob(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Uv(Lb,function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Lb)return new Lb(e.h,e.c,e.l,e.opacity);if(e instanceof Ib||(e=Tb(e)),0===e.a&&0===e.b)return new Lb(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*kb;return new Lb(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Lb(e,t,n,null==r?1:r)},Yv(Kv,{brighter(e){return new Lb(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Lb(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Fb(this).rgb()}}));var jb=e=>()=>e;function zb(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):jb(isNaN(e)?t:e)}var Hb=function e(t){var n=function(e){return 1==(e=+e)?zb:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):jb(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=fb(e)).r,(t=fb(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=zb(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1),Bb=/^class(-pyramid)?/,Vb=function(e,t,n,r){var i=void 0!==n.min?n.min:r.min(),o=void 0!==n.max?n.max:r.max(),s=i,a=o,l=t.limits,c={},u="percent"===t.limitType?l.map(function(e){return i+(o-i)*e}):l,h=t.colors.map(function(t){return e.resolveUIColor(t)});if(i=Math.min.apply(Math,[i].concat(mv(u))),o=Math.max.apply(Math,[o].concat(mv(u))),c.min=i,c.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))c.type="categorical",Object.assign(c,function(e){var t=e.min,n=e.max,r=e.limits,i=e.range,o=[],s=[];if(r.length)if(r[r.length-1]<t)s.push(t,n),o.push(i[i.length-1],i[i.length-1],i[i.length-1]);else if(r[0]>n)s.push(t,n),o.push(i[0],i[0],i[0]);else{if(r[0]>t)s.push(t),o.push(i[0]);else{s.push(t);for(var a=0;a<r.length;a++)if(t<r[a]){o.push(i[a]);break}}for(var l=0;l<r.length;l++)t<r[l]&&r[l]<n&&(s.push(r[l]),o.push(i[l]));if(r[r.length-1]<n)s.push(n),o.push(i[r.length]),o.push(i[r.length]);else{s.push(n);for(var c=0;c<r.length;c++)if(r[c]>n){o.push(i[c]),o.push(i[c]);break}}}else o.push(i[0]);return{min:t,max:n,range:o,domain:s}}({min:"percent"===t.limitType?i:s,max:"percent"===t.limitType?o:a,range:h,limits:"percent"===t.limitType?u:l}));else if(t.breakTypes){var d=t.breakTypes;c.type="continuous",c.domain=[i],c.range=[h[0]];for(var f=0;f<u.length;f+=1)if(d[f]){var p=h[f],m=h[f+1],g=Hb(p,m)(.5);c.range.push(g),c.domain.push(u[f]),f<u.length-1&&d[f+1]&&(c.range.push(h[f+1]),c.domain.push((u[f]+u[f+1])/2))}else c.range.push(h[f]),c.range.push(h[f+1]),c.domain.push(u[f]),c.domain.push(u[f]+Math.min(1e-6,(o-i)/1e6));c.range.push(h[h.length-1]),c.domain.push(o)}else c.domain=u,c.range=h;return c};function $b(e,t,n,r,i){var o,s,a,l=0,c=[],u=(e-t)/(r+1);if(0===u)return 1;for(o=0;o<n.length;o+=1)s=.99*(n[o]-t),a=n[o]>e?Math.floor(e/u):n[o]<t?0:Math.floor(s/u),Number.isNaN(a)||(c[a]?c[a]+=1:c[a]=1);for(o=0;o<c.length;o+=1)c[o]&&(l+=1);return l<=r||l>=i?Math.max(l,r):$b(e,t,n,r+1,i)}var Wb=function(e,t,n,r){var i,o,s=t.theme,a=t.hc,l=r.f,c={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},u=[],h=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(h=!("S"===(i=n.pic.raw()).qMode&&(i.qDataPages[0]&&i.qSize.qcy>i.qDataPages[0].qArea.qHeight||!i.qDataPages.length&&i.qSize.qcy>0)||"K"===i.qMode&&i.qStackedDataPages[0]&&i.qSize.qcy>i.qStackedDataPages[0].qArea.qHeight||"T"===i.qMode&&i.qSize.qcy>i.qTreeDataPages[0].qGroupSize))&&(u=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:a.qDimensionInfo.map(function(e,t){return{field:"qDimensionInfo/".concat(t)}}),value:function(e){return Math.min.apply(Math,mv(e))<0}}}}).filter(function(e){return e.value>=0&&!e.exclude.value}).map(function(e){return e.num.value}).filter(function(e){return"number"==typeof e}))}if(!1===n.input.autoMinMax){if(c.min=n.input.measureMin,c.max=n.input.measureMax,c.max<c.min)return{invalid:!0}}else if(l&&!h)c.min=l.min(),c.max=l.max();else if(l){if(!u.length)return{invalid:!0};c.min=Math.min.apply(Math,mv(u)),c.max=Math.max.apply(Math,mv(u))}if(n.input.measureScheme&&(c.palettes={quant:n.input.measureScheme}),s){var d=s.getDataColorScales().filter(function(e){return e.key===n.input.measureScheme})[0];c.type=d&&Bb.test(d.type)?"categorical":"continuous","categorical"===c.type&&(o=d.colors.some(function(e){return Array.isArray(e)})?Math.max.apply(Math,mv(d.colors.map(function(e){return e?e.length:0}))):d.colors.length)}if("categorical"===c.type){for(var f=h?$b(c.max,c.min,u,1,o):o,p=(c.max-c.min)/f,m=[],g=0;g<f+1;g+=1)m.push(c.min+p*g);c.domain=m,c.range=function(e){for(var t=e.resources.theme.palette("quant",f),n=Math.max(1,Math.floor(t.length/f)),r=[],i=0;i<f;i+=1)r.push(t[i*n]);return[r[0]].concat(r,[r[r.length-1]])}}return c};function Ub(e,t){var n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter(function(e){return"measure"===e.type()})[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field(function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key}):"expression"===t.type&&(n=e.pic.field(function(e){return"colorByAlternative"===e.raw().id})),n||(n=e.pic.field(function(e){return void 0!==e.raw().matchMeasure}))&&(n=e.pic.fields().filter(function(e){return"measure"===e.type()})[n.raw().matchMeasure]),n}function Yb(e){e.measureOverrides.every(function(e){return!e})&&(e.measureOverrides=null)}function Kb(e,t){for(var n=(null==t?void 0:t.domain)||[],r=(null==t?void 0:t.range)||[],i=[],o=0;o<e.length;++o){var s=e[o];if("constant"===(null==s?void 0:s.mode)){var a=n.indexOf(o);-1===a?(n.push(o),r.push(s.primary)):r[a]=s.primary,e[o]=null}else if(s){i.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),r.splice(l,1))}}return{domain:n,range:r,exclude:i}}function Xb(e,t,n,r){var i,o=function(e,t,n,r){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var r=t.theme,i=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,s=void 0===o?Ub:o,a=n.input.byMeasureDef||{activeMeasureIndex:0},l=s(n,a),c=Wb(0,{theme:r,hc:i},n,{f:l});if(c.invalid)return c;"expression"===a.type&&(a.activeMeasureIndex<0||void 0===a.activeMeasureIndex)&&(c.label=a.label,l&&"color.altLabel"===l.raw().labelExpRef&&(c.label=n.input.altLabel)),!c.label&&l&&(c.label=l.title());var u=a.activeMeasureIndex>=0?l:null;if(!u&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(u=n.pic.fields().filter(function(e){return"measure"===e.type()})[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===a.type)if(u){var h=u.raw().coloring;h&&h.gradient&&zv(c,Vb(e,h.gradient,c,u))}else c.auxiliary=a;return c}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.getCDef,o=void 0===i?$v:i,s=r.getCByField,a=void 0===s?Wv:s,l=r.getPersistence,c=void 0===l?Vv:l,u=o(t,n),h=a(n,u),d=h?h.raw():{},f=n&&n.pic?n.pic.raw():{};if(d.qError||d.qSize&&0===d.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:h?h.key():void 0,isFieldLocked:d.qLocked};return("expression"===u.type||u.activeDimensionIndex<0)&&(p.label=u.label,"color.altLabel"===d.labelExpRef&&(p.label=n.input.altLabel)),!p.label&&h&&(p.label=h.title()),n.input.dimensionScheme&&(p.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===u.type&&(p.auxiliary=u),zv(p,c(t,n,u,h,{byRow:Bv,byElemNo:Hv})),p}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,s=t.translator,a=n.pic.field(function(e){return"colorByExpression"===e.raw().id});if(!a||!a.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(a.raw().qMin)&&Number.isFinite(a.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:r.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:a?a.key():void 0,type:"color"};var l=Wb(0,{hc:i,theme:o},n,{f:a});return l.invalid||(l.label=n.input.expressionLabel||s.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,r);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,s=t.translator,a=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&i.qMeasureInfo.length>1&&(a="measure"),"measure"===a){var l=[],c=[];"measure"===n.input.useBaseColors&&i.qMeasureInfo.forEach(function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?c.push(r.primary):c.push(i)}});var u=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,h=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&h&&(u={categorical:h.key}),{mode:"measure",type:"categorical",palettes:u,label:s?s.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:c}:void 0}}if("dimension"===a){var d=[],f=[];return i.qDimensionInfo.forEach(function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){d.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?f.push(r.primary):f.push(i)}}),{mode:"dimension",type:"categorical",field:d.length?d[0]:void 0,explicit:d.length?{domain:d,range:f}:void 0}}var p=r.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(p=e.resolveUIColor(n.input.paletteColor));else{var m=n.input.singleColor;"number"!=typeof m||Number.isNaN(m)||(p=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][m])}return{mode:"constant",type:"constant",primary:p}}(e,n,t,r)}return{}}(e,t,n,r);return null!==(i=t.input)&&void 0!==i&&i.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map(function(n,i){return function(e){var t,n=e.cm,r=e.defaults,i=e.index,o=e.input,s=e.pic;if(!o||!o.on)return null;var a=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===a?function(e,t,n){var r=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(r=e.resolveUIColor(t.paletteColor)),pv(pv({},n),{},{mode:"constant",type:"constant",primary:r})}(n,o,r):"byExpression"===a?function(e,t,n){var r="qMeasureInfo/".concat(e,"/"),i=t.field(function(e){return e.id().startsWith(r)&&"colorByMeasureExpression"===e.raw().id}),o=i;return pv(pv({},n),{},o?{mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(i,s,r):null}({cm:e,input:n,defaults:r,index:i,pic:t.pic})}),function(e,t){var n,r,i,o=t.translator;if(Yb(e),1===(null===(n=e.measureOverrides)||void 0===n?void 0:n.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=Kb(e.measureOverrides,e.explicit),Yb(e)),null!==(r=e.measureOverrides)&&void 0!==r&&r.every(function(e){return"constant"===(null==e?void 0:e.mode)})){var s={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return s.explicit=Kb(e.measureOverrides),s}return null!==(i=e.measureOverrides)&&void 0!==i&&i.every(function(e){return e})?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}var Gb=function(e,t){var n=e.fieldType,r={};if(t)if("measure"===n){var i=t.coloring;i&&(r.measureGradient=i.gradient)}else if("dimension"===n){var o=t[0],s=t[1];o&&(r.legendDataPage=o),s&&(r.dimValsData=s.colorMap)}return r},Jb=function(e){throw e.isHandled=!0,e};function Zb(e){return function(t){return"object"===gv(t.datum[e])?t.datum[e].value:void 0}}function Qb(e){return"object"===gv(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function ex(e){return-3===e.datum.value}var tx={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},nx={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"};function rx(e){var t=e.theme,n=e.key,r=e.styleOverrides,i={title:{color:tx.COLOR,fontSize:tx.FONT_SIZE,fontFamily:tx.FONT_FAMILY},label:{color:nx.COLOR,fontSize:nx.FONT_SIZE,fontFamily:nx.FONT_FAMILY}};if(!t&&!r)return i;var o=r||{},s=o.title,a=o.label,l=function(e){var t=e.theme,n=e.key;return function(e,r,i,o){return void 0!==e?e:t?t.getStyle(n,r,i):o}}({theme:t,key:n});return i.title.color=l(null==s?void 0:s.color,"legend.title","color",tx.COLOR),i.title.fontSize=l(null==s?void 0:s.fontSize,"legend.title","fontSize",tx.FONT_SIZE),i.title.fontFamily=l(null==s?void 0:s.fontFamily,"legend.title","fontFamily",tx.FONT_FAMILY),i.label.color=l(null==a?void 0:a.color,"legend.label","color",nx.COLOR),i.label.fontSize=l(null==a?void 0:a.fontSize,"legend.label","fontSize",nx.FONT_SIZE),i.label.fontFamily=l(null==a?void 0:a.fontFamily,"legend.label","fontFamily",nx.FONT_FAMILY),i}var ix=function(e,t,n){var r=e&&e.dock||void 0;if("auto"!==r)return r||"right";if(t){var i=t.element.getBoundingClientRect();if(i.height>i.width)return"bottom"}return n?"left":"right"},ox=function(e,t,n){return!(n.invalid||"color"===n.type||"measure"===n.mode&&t.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function sx(e,t){var n=e.styleReference,r=e.styleOverrides,i=e.chart,o=e.rtl,s=t.legendProps,a=t.coloring,l=t.theme,c=t.hc,u=rx({theme:l,key:n,styleOverrides:r});return{layout:{minimumLayoutMode:"MEDIUM",dock:ix(s,i,o)},show:"function"==typeof s.show?function(){return ox(s,c,a)}:ox(s,c,a),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==s.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:a.label||"",fill:u.title.color,fontSize:u.title.fontSize,fontFamily:u.title.fontFamily}}}}function ax(e,t,n){var r=[],i=[],o=function(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var r=sx(e,t);if(!r.show)return!1;var i,o=e.key,s=e.styleReference,a=e.styleOverrides,l=e.viewState,c=e.rtl,u=e.settings,h=e.style,d=t.scaleKey,f=t.theme,p=t.scales,m=rx({theme:f,key:s,styleOverrides:a}),g=r.layout.dock,y="left"===g||"right"===g?{maxLines:2,wordBreak:"break-word"}:{},v={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===t.coloring.fieldType&&(i=function(e){return e.datum.value>=0||-3===e.datum.value});var b="".concat(d,"Legend");return zv(!0,r,{type:"legend-cat",key:"".concat(o,"-cat"),scale:b in p?b:d,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(r.layout.dock)?2:1,direction:c?"rtl":"ltr",horizontal:20},item:{show:i,label:pv({fill:m.label.color,fontSize:m.label.fontSize,fontFamily:m.label.fontFamily},y)},navigation:{disabled:n,button:{content:function(e,t){var n=t.direction;return e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:v[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:u,style:h})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,r=e.key,i=e.styleReference,o=e.styleOverrides,s=e.rtl,a=e.settings,l=e.style,c=t.scaleKey,u=t.theme,h="".concat(c,"Range"),d=sx(e,t);if(!d.show)return!1;var f=rx({theme:u,key:i,styleOverrides:o}),p=d.layout.dock,m="right"===p||"left"===p,g=null===(n=t.scales)||void 0===n?void 0:n[h];return m&&g&&(g.invert=!0),zv(!0,d,{type:"legend-seq",key:"".concat(r,"-seq"),settings:{fill:c,major:h,length:1,tick:{fill:f.label.color,fontSize:f.label.fontSize,fontFamily:f.label.fontFamily},title:{anchor:!s||"top"!==d.layout.dock&&"bottom"!==d.layout.dock?void 0:"right",padding:parseFloat(d.settings.title.fontSize)||16}}},{settings:a,style:l})}(e,t)}(e,t,n&&n.navigationDisabled);return r.push(o),o&&"legend-cat"===o.type&&(i.push(function(e){var t=e.key,n=e.requireFailure,r=e.recognizeWith,i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var r;if(!n)return!0;if(null!=i&&null!==(r=i.interact)&&void 0!==r&&r.enabled&&!i.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(function(e){return e.key==="".concat(t,"-cat")}))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),i.push(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,n=e.key,r=e.requireFailure,i=e.recognizeWith,o=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(n),type:"Pan",requireFailure:r,recognizeWith:i,options:{event:t,pointers:1,threshold:10,enable:function(e,r){var i;return this.started===t||!r||!(null!=o&&null!==(i=o.interact)&&void 0!==i&&i.enabled&&!o.interact.enabled())&&this.chart.componentsFromPoint({x:r.center.x,y:r.center.y}).some(function(e){return e.key==="".concat(n,"-cat")})}},events:dv(dv(dv({},"".concat(t,"start"),function(e){e.preventDefault(),this.started!==t&&(this.started=t,this.chart.component("".concat(n,"-cat")).emit("panstart",e))}),"".concat(t,"move"),function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panmove",e)}),"".concat(t,"end"),function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panend",e),this.started=!1})}}(e,n))),{interactions:i,components:r}}function lx(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=function(e){var t=pv({hc:null,colorProps:null,layout:null,theme:null},e),n={},r={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},i={auto:function(e){return e?(r.auto=e,i):r.auto},getDimensionColorMap:function(e){return e?(r.getDimensionColorMap=e,i):r.getDimensionColorMap},getAttributeDimension:function(e){return e?(r.getAttributeDimension=e,i):r.getAttributeDimension},getMeasure:function(e){return e?(r.getMeasure=e,i):r.getMeasure},set:function(e){var i;if(!e.colorProps)throw new Error('Missing "colorProps"');if(zv(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=r.auto(e.layout);n.input=zv(!0,{},n.input,o,{auto:!1});var s=t.theme?t.theme.getDataColorPalettes():[];s[0]&&(n.input.dimensionScheme=s[0].key);var a=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(a=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[a]&&t.hc.qDimensionInfo[a].coloring&&t.hc.qDimensionInfo[a].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[a].coloring.colorMapRef)}null!==(i=n.input.measureOverrides)&&void 0!==i&&i.every(function(e){return!e||!e.on})&&(n.input=zv(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,r=[];(e&&e.getDataColorPickerPalettes()||[]).forEach(function(e){r.push({key:"ui",colors:e.colors})}),n.palettes=r}return n.palettes},getAuxiliaryData:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var i=(e.auxiliary||{}).key;if("measure"===e.fieldType)return r.getMeasure(i,t).catch(function(){});if("dimension"===e.fieldType){var o="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?r.getAttributeDimension(o,t).catch(function(){}):Promise.resolve(),i?r.getDimensionColorMap(i,t).catch(function(){}):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,r){var i=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,r).then(function(r){if(!r)return{};if("measure"===e.fieldType){if(r.coloring&&r.coloring.gradient){var o=n.pic.field(e.field);return Vb(i,r.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var s={nil:e.nil,others:e.others},a=r[0],l=r[1]?r[1].colorMap:null;if(a){var c=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:a,qInterColumnSortOrder:[0,1],qMode:"S"}});s.legendDataset=c}return l?function(e,t,n,r){var i=r.external,o=r.field,s=pv({},e);zv(s,Hv(o,o.raw().qCardinal));var a=i.theme?i.theme.getDataColorPalettes()[0]:null;return t.nul&&(s.nil=n.resolveUIColor(t.nul)),t.oth&&(s.others=n.resolveUIColor(t.oth)),t.usePal?(s.palettes={categorical:t.pal},a&&!t.pal&&(s.palettes.categorical=a.key,zv(s,Hv(o)))):!1===t.autoFill&&t.single?s.range=[n.resolveUIColor(t.single)]:t.autoFill&&(a&&(s.palettes={categorical:a.key}),zv(s,Hv(o))),t.colors&&t.colors.length&&(s.explicit=function(e,t,n){for(var r={},i=0;i<e.length;i+=1)r[e[i].value]=e[i].baseColor;var o=[];return{domain:function(e){var i=e.data,s=[];o=[];for(var a=0;a<i.items.length;a++){var l=i.items[a],c=(l.text||l).label;r[c]&&-1===s.indexOf(l.value)&&(s.push(l.value),o.push(t.resolveUIColor(r[c])))}return s.push(-3,-2),o.push(n.others),o.push(n.nil),s},range:function(){return o}}}(t.colors,n,s)),s}(s,l,i,{external:t,field:n.pic.field(e.field)}):s}return{}})):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter(function(e){return"ui"===e.key})[0]||!1),!n.uiPalette)return e.color;var t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},r=t.theme;r&&(e=pv(pv({},e),r.getDataColorSpecials())),n.settings=zv(e,Xb(this,n,t,e))}return n.settings}};return i}(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap(function(e,t){return function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():r&&r.getObject?r.getObject("ColorMapModel_".concat(e)).then(function(e){return e.getLayout()}):Promise.reject()}(e,{layout:t.layout,app:t.app})}).getMeasure(function(e,t){return function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():r&&r.getMeasure?r.getMeasure(e).then(function(e){return e.getMeasure()}):Promise.reject()}(e,{layout:t.layout,app:t.app})}).getAttributeDimension(function(e,t){return function(e,t){var n=t.layout,r=t.model,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():r&&r.session&&i?r.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(Jb):Promise.reject()}(e,{layout:t.layout,model:t.model,app:t.app})});return n.getSnapshotData=Gb,n}({resources:e}),n={},r={},i=function(e){return r.settings||(e||console.warn("settings() called before auxiliarySettings()"),r.settings=t.settings()),r.settings},o={config:function(i){if(n=pv({},i),r={},!n.key)throw new Error("Missing key");t.set(pv(pv({},e),n))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return r.auxiliarySettings?Promise.resolve(r.auxiliarySettings):t.getAuxiliarySettings(i(!0),e).then(function(e){return r.auxiliarySettings=e||{},r.settings=pv(pv({},r.settings),r.auxiliarySettings),r.scales=void 0,r.color=void 0,r.auxiliarySettings})},getAuxiliaryData:function(){return t.getAuxiliaryData(i())},getSnapshotData:function(e){var n=i();return t.getAuxiliaryData(n,e).then(function(e){return t.getSnapshotData(n,e)})},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=i();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=i().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(i(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,r=e.theme,i=[];if(n&&n.palettes&&r){var o=n.palettes.categorical||t.dimensionScheme,s=r.getDataColorPalettes().filter(function(e){return e.key===o})[0]||r.getDataColorPalettes()[0];o&&s&&i.push({key:"categorical",colors:s.colors});var a=n.palettes.metric||t.measureScheme,l=r.getDataColorScales().filter(function(e){return e.key===a})[0]||r.getDataColorScales()[0];if(l){var c=l.colors[0]?l.colors:[[]].concat(mv(l.colors.slice(1)));c=Array.isArray(c[0])?c.map(function(e){return e.slice().reverse()}):c.slice().reverse(),i.push({key:"quant",colors:c})}}return i}({coloring:i(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return r.scales=r.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,r=e.rtl,i=e.key,o=e.source,s=e.picasso,a={},l=i;if(n){var c={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(mv((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(mv((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var u,h=function(e){var t=e.hc,n=e.source,r=e.coloring,i={data:{extract:[{source:"dummy",field:0,filter:function(){return i.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:r.field,trackBy:r.valueAccessor,reduce:"first",props:{row:{reduce:function(){return i.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return i}({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var d=0,f={};s.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return f[t]=d++,e[0]}}),u={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return f[e.qElemNumber]}}}}}}var p={data:h,range:n.range,domain:n.domain,explicit:c,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};a[l]=p,u&&(a["".concat(l,"Legend")]=pv(pv({},p),{},{data:u})),t&&t.qHasOtherValues&&u&&((u||p.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var m={data:{field:n.field},min:n.min,max:n.max};a[l]=zv({},m,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===a[l].type&&(a["".concat(l,"Range")]=zv({},m,{invert:!!r}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var g={data:t.qDimensionInfo.map(function(e,t){return t}),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};a[l]=g}else if("measure"===n.mode){var y={data:t.qMeasureInfo.map(function(e,t){return t}).filter(function(e){var t;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(t=t.exclude)&&void 0!==t&&t.includes(e))}),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};a[l]=y}}return a}({hc:n.hc,coloring:i(),key:n.key,source:n.source,picasso:e.picasso}),r.scales},color:function(){return r.color=r.color||function(e){var t=e.coloring,n=e.scales,r=e.key,i=Zb(r),o=Zb("".concat(r,"IsAnOther")),s=function(e,t){var r=e.fieldType,s=e.invalid,a=e.mode,l=e.nil,c=e.others,u=e.primary,h=e.type;return s?function(e){return ex(e)||o(e)?c:l}:n[t]?function(e){return ex(e)?c:Qb(e)||-2===i(e)&&"dimension"===r||"NaN"===i(e)?l:o(e)?c:e.resources.scale(t)(i(e))||c}:"constant"===a?function(e){return ex(e)||o(e)?c:Qb(e)?l:u}:"color"===h?function(e){return ex(e)||o(e)?c:Qb(e)?l:i(e)||c}:null},a=s(t,r);if(t.measureOverrides){var l=Zb("".concat(r,"MeasureIdx")),c=t.measureOverrides.map(function(e){return e&&s(e)});return function(e){var t=l(e);return c[t]?c[t](e):a(e)}}return a}({coloring:i(),scales:this.scales(),key:n.key}),r.color},datumProps:function(e){return function(e){var t,n,r=e.hc,i=e.coloring,o=e.scales,s=e.key,a=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=s,u=i.nil;"field"===i.mode&&i.field?t=i.field:o[s]&&"field"===i.mode&&(t=o[s].data.field||i.field),t?(n={field:t,reduce:"first"},"color"===i.type&&(n.value=function(e){return"NaN"!==e.qNum?function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")}(e.qNum):e.qText&&cb(e.qText)?e.qText:u})):"dimension"===i.mode?n=void 0!==i.field?i.field:r.qDimensionInfo.length-1:"measure"===i.mode&&(n=l);var h=dv({},c,n);return r.qDimensionInfo.length>1&&(h["".concat(c,"IsAnOther")]={fields:r.qDimensionInfo.map(function(e,t){return{field:"qDimensionInfo/".concat(t)}}),value:function(e){return-1!==e.indexOf(-3)}}),a&&(h["".concat(c,"MeasureIdx")]=l),h}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:i().measureOverrides},e)},data:function(){var e=i(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,r=e.key,o=e.viewState,s=e.chart,a=e.rtl,l=e.styleReference,c=void 0===l?"object.legend":l,u=e.styleOverrides,h=e.settings,d=void 0===h?{}:h,f=e.style,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return ax({eventName:t,key:r,rtl:a,viewState:o,chart:s,styleReference:c,styleOverrides:u,settings:d,style:void 0===f?{}:f},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},p)}};return o}var cx=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function ux(e){var t=e.qHyperCube,n=t.qDimensionInfo,r=t.qMeasureInfo,i=n.some(cx),o=r.some(cx),s=e.color.useBaseColors;return"measure"===s&&!o||"dimension"===s&&!i?"off":s}var hx=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function dx(e){var t,n=e.qHyperCube.qDimensionInfo.some(hx),r=e.qHyperCube.qMeasureInfo.some(hx),i=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=i?i:r?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var fx=function(){};function px(e){var t,n,r,i,o=e.picasso,s=e.model,a=e.app,l=e.translator,c=e.layoutService,u=void 0===c?void 0:c,h=e.createConfig,d=void 0===h?fx:h,f=e.config,p=void 0===f?{}:f,m=e.custom,g=void 0===m?{}:m,y=p.localeInfo,v=p.key,b=p.theme,x=void 0===b?void 0:b,w=p.auto,q=void 0===w?void 0:w,M=p.definitionPath,S=null==u||null===(t=u.getLayout)||void 0===t?void 0:t.call(u),D={theme:x,key:v,localeInfo:y,layout:S,hc:null==u||null===(n=u.getHyperCube)||void 0===n?void 0:n.call(u),legendProps:null==u||null===(r=u.getLayoutValue)||void 0===r?void 0:r.call(u,"legend"),colorProps:pv(pv({},null==u||null===(i=u.getLayoutValue)||void 0===i?void 0:i.call(u,"color")),{},{useBaseColors:S?ux(S):void 0})},_=lx({picasso:o,model:s,app:a,translator:l,auto:q});!1!==q&&_.auto(function(e){return q?q({layout:e,defaultAuto:dx}):dx(e)});var k=!1,C={getColor:function(){return _.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return _.resolveUIColor({index:t,color:n})},getData:function(){return _.data()},getDatumProps:function(e){return _.datumProps(e)},getSnapshotData:function(){return _.getSnapshotData(M)},getSettingsForMeasure:function(e){return _.settingsForMeasure(e)},getSettings:function(){return _.settings()},getLegend:function(e,t){return _.legend(e,t)},getScales:function(){return _.scales()},getPalettes:function(){return _.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return _.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return k},custom:pv({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?d:e)({getUseBaseColors:ux}),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return pv(pv(pv({},e),t),{},{colorProps:pv(pv({},e.colorProps),t.colorProps||{})})}(D,t);return _.config(n),_.getAuxiliarySettings(M).then(function(){k=!0})}};return C}var mx="center",gx="bottom";function yx(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var s=r[o];if(void 0===i[s])return n;i=i[s]}return i}[{key:"NoDataExist",alignment:mx,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:mx,condition:function(e){var t=e.layoutService;return!!t&&t.getHyperCubeValue("qMeasureInfo").every(function(e){return"NaN"===e.qMin&&"NaN"===e.qMax})}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:mx,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:mx},{key:"DataRangeIncludingZero",alignment:gx},{key:"LimitedData",alignment:gx},{key:"NegativeOrZeroValues",alignment:gx}].reduce(function(e,t){return e[t.key]=t,e},{});var vx,bx=["__proto__","constructor"];function xx(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!bx.some(function(e){return r.includes(e)})){for(var o=e,s=0;s<r.length-1;++s){var a=r[s];void 0===o[a]&&(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}void 0!==n?o[i]=n:delete o[i]}}}function wx(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function qx(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Sx)):void 0===t&&(t=Mx);for(var n,r,i,o,s,a=new kx(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new kx(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(_x)}function Mx(e){return e.children}function Sx(e){return Array.isArray(e)?e[1]:null}function Dx(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function _x(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function kx(e){this.data=e,this.depth=this.height=0,this.parent=null}kx.prototype=qx.prototype={constructor:kx,count:function(){return this.eachAfter(wx)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t},copy:function(){return qx(this).eachBefore(Dx)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},vx=function(e){
|
|
25
25
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
26
|
-
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(h=t[0]).length%l,d=h.length,b=0;b<d;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},vx({exports:{}});const Cx=["altLabel","auto","autoMinMax","byDimDef","byMeasureDef","dimensionScheme","expressionIsColor","expressionLabel","measureMax","measureMin","measureScheme","mode","paletteColor","persistent","reverseScheme","useBaseColors","useDimColVal"];function Ex(e,t,n){for(let r=0;r<n.length;++r){const i=n[r];void 0!==e[i]&&(t[i]=e[i],delete e[i])}}var Ax={importColors:function(e){e.color.point=e.color.point||{},Ex(e.color,e.color.point,Cx),e.color.colorExpression&&(e.color.point.expression={qValueExpression:{qExpr:e.color.colorExpression}},delete e.color.colorExpression),e.color.point.expressionIsColor=!0},exportColors:function(e){Ex(e.color.point,e.color,Cx),e.color.colorExpression=yx(e,"color.point.expression.qValueExpression.qExpr",""),delete e.color.point.expression}};function Tx({dataDefinition:e,defaultPropertyValues:t,exportFormat:n,initialProperties:r}){const i=uv.axisChart.importProperties({exportFormat:n,initialProperties:r,dataDefinition:e,defaultPropertyValues:t}),o=i.qProperty;return 3===o.qHyperCubeDef.qInterColumnSortOrder.length&&(o.qHyperCubeDef.qInterColumnSortOrder=[1,2,0]),Ax.importColors(o),o.qHyperCubeDef.qAlwaysFullyExpanded=!0,i}function Ix({propertyTree:e,viewDataMode:t}){const n=uv.axisChart.exportProperties({propertyTree:e,viewDataMode:t});return Ax.exportColors(e.qProperty),n}var Nx,Rx,Ox=e=>{const t=sv(e);return{properties:rv,data:{targets:[t]},importProperties:({exportFormat:e,initialProperties:n})=>Tx({dataDefinition:t,exportFormat:e,initialProperties:n}),exportProperties:Ix}};var Px=function(){if(Rx)return Nx;Rx=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},s=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return Nx=function e(){var t,n,r,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=a(h,n),h!==(l=a(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},s(h,{name:n,newValue:e(p,u,l)})):void 0!==l&&s(h,{name:n,newValue:l}));return h},Nx}(),Lx=n(Px);const Fx={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const jx={replaceExpressionTokens:function(e,t,n){const r={start:n&&n.start||"{{",end:n&&n.end||"}}"};let i,o,s=e;for(const e in t)i=t[e],o=r.start+e+r.end,s=s.replace(zx(o,!0),i);return s},createRegExp:zx};function zx(e,t,n){const r=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const i=n?`(${r})`:r;return t?new RegExp(i,"g"):new RegExp(i)}const Hx={generateExpression:function(e,t){const n={};if(t)for(const e in t){const r=t[e],i=r.wrap?Fx.wrapExpression(r.value):r.value;n[e]=i;(r.variations||[]).forEach(t=>{const r=Bx(t,i,e);n[t]=r})}return jx.replaceExpressionTokens(e,n)}};function Bx(e,t,n){if(""===t)return"";const r=jx.createRegExp(n,!0,!0),i=e.split(r);let o="";return i.forEach(e=>{o+=e!==n?e:t}),o}const Vx={generateHyperCubeDef:function(e,t,n,r,i){return function(e,t,n,r){const i={};let o,s;const a=[];let l;e.forEach(e=>{o=Kx(e.match(Yx("Dim"))),o.forEach(e=>{a.push($x(t.qDimensions[e],r,e,n).then(t=>{i[`Dim[${e}]`]={value:t,wrap:!0}}))}),s=Kx(e.match(Yx("Mea"))),s.forEach(e=>{a.push(Wx(t.qMeasures[e],r).then(t=>{i[`Mea[${e}]`]={value:t}}))})}),l=a.length?Promise.all(a).then(()=>Promise.resolve(i)):Promise.resolve(i);return l}(e.dimensions.concat(e.measures),t,n,r).then(n=>{const r=Lx({},n,i),o=Lx(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach(e=>{o.qDimensions.push({qDef:{qFieldDefs:[`=${Hx.generateExpression(e,r)}`]}})}),e.measures.forEach(e=>{o.qMeasures.push({qDef:{qDef:Hx.generateExpression(e,r)}})}),o})},getAllHyperCubeExpressions:async function(e,t,n){const r=e.qDimensions.map((e,r)=>$x(e,n,r,t)),i=e.qMeasures.map(e=>Wx(e,n));return{dimensions:await Promise.all(r),measures:await Promise.all(i)}}};function $x(e,t,n,r){if(e.qLibraryId)return Ux(e.qLibraryId,"dimension",t,n,r);const i=r.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[i])}function Wx(e,t){return e.qLibraryId?Ux(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function Ux(e,t,n,r,i){if(!n)return console.warn("No app provided, returning library id"),e;return n["dimension"===t?"getDimension":"getMeasure"](e).then(e=>e.getProperties().then(e=>"dimension"===t?e.qDim.qFieldDefs[i.qDimensionInfo[r].qGroupPos]:e.qMeasure.qDef))}function Yx(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function Kx(e){return e?e.map(e=>e.substr(6,1)):[]}function Xx(e){return e=e||function(){return!1},{get(t){const n=e()?-1:1;switch(t("integer")*n){case-1:return"descending";case 1:return"ascending";default:return"disabled"}},set(t,n){const r=e();switch(t){case"descending":n("integer",r?1:-1);break;case"ascending":n("integer",r?-1:1);break;case"disabled":n("integer",0);break;default:n("integer",void 0)}}}}var Gx={booleanConvertFunctions:function(e,t){return e=e||function(){return!1},t=t||1,{get:e=>!!e("integer"),set(n,r){if(n){let n=e()?-1:1;n*=t,r("integer",n)}else r("integer",0)}}},enumConvertFunctions:Xx,invertedEnumConvertFunctions:function(e){return Xx(function(){return!e||!e()})}};const Jx=[{value:"ascending",translation:"properties.sorting.ascending"},{value:"descending",translation:"properties.sorting.descending"}];function Zx(e,t,n){return{type:"items",items:{toggled:{type:"boolean",ref:e,translation:t,convertFunctions:n.toggled},order:{type:"string",component:"dropdown",ref:e,options:Jx,convertFunctions:n.sorting,show:t=>0!==Py(t,e,0)}}}}var Qx={state:function(e,t){return Zx(e=e||"qSortByState","properties.sorting.sortByState",{toggled:Gx.booleanConvertFunctions(t),sorting:Gx.invertedEnumConvertFunctions(t)})},ascii:function(e,t){return Zx(e=e||"qSortByAscii","properties.sorting.sortByAlphabetic",{toggled:Gx.booleanConvertFunctions(t),sorting:Gx.enumConvertFunctions(t)})},numeric:function(e,t){return Zx(e=e||"qSortByNumeric","properties.sorting.sortByNumeric",{toggled:Gx.booleanConvertFunctions(t,-1),sorting:Gx.enumConvertFunctions(t)})},expression:function(e,t){e=e||"qSortByExpression";const n={toggled:Gx.booleanConvertFunctions(t),sorting:Gx.enumConvertFunctions(t)},r=Zx(e,"properties.sorting.sortByExpression",n);return r.items.expression={type:"number",component:"expression",expressionType:"ValueExpr",ref:"qExpression",translation:"Common.Expression",defaultValue:"",show:t=>0!==Py(t,e,0)},r},frequency:function(e,t){return Zx(e=e||"qSortByFrequency","properties.sorting.sortByFrequency",{toggled:Gx.booleanConvertFunctions(t),sorting:Gx.invertedEnumConvertFunctions(t)})}};const ew=(e,t)=>(t.components||[]).find(t=>t.key===e),tw=(e,t,n)=>{var r,i,o,s;const a=null===(r=ew("axis",n))||void 0===r?void 0:r.axis;return{text:{fontFamily:(null==a||null===(i=a.title)||void 0===i?void 0:i.fontFamily)||t.getStyle(e,"axis.title","fontFamily"),fontSize:(null==a||null===(o=a.title)||void 0===o?void 0:o.fontSize)||t.getStyle(e,"axis.title","fontSize"),fill:(null==a||null===(s=a.title)||void 0===s||null===(s=s.fontColor)||void 0===s?void 0:s.color)||t.getStyle(e,"axis.title","color")}}},nw=(e,t,n)=>{var r,i,o,s;const a=null===(r=ew("axis",n))||void 0===r?void 0:r.axis;return{labels:{fontFamily:(null==a||null===(i=a.label)||void 0===i||null===(i=i.name)||void 0===i?void 0:i.fontFamily)||t.getStyle(e,"axis.label.name","fontFamily"),fontSize:(null==a||null===(o=a.label)||void 0===o||null===(o=o.name)||void 0===o?void 0:o.fontSize)||t.getStyle(e,"axis.label.name","fontSize"),fill:(null==a||null===(s=a.label)||void 0===s||null===(s=s.name)||void 0===s||null===(s=s.fontColor)||void 0===s?void 0:s.color)||t.getStyle(e,"axis.label.name","color")}}},rw=(e,t,n,r)=>{var i,o,s,a;const l=r.isEnabled("CLIENT_IM_3051")?null===(i=ew("legend",n))||void 0===i?void 0:i.legend:{};return{fontFamily:(null==l||null===(o=l.title)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"legend.title","fontFamily"),fontSize:(null==l||null===(s=l.title)||void 0===s?void 0:s.fontSize)||t.getStyle(e,"legend.title","fontSize"),color:(null==l||null===(a=l.title)||void 0===a||null===(a=a.fontColor)||void 0===a?void 0:a.color)||t.getStyle(e,"legend.title","color")}},iw=(e,t,n,r)=>{var i,o,s,a;const l=r.isEnabled("CLIENT_IM_3051")?null===(i=ew("legend",n))||void 0===i?void 0:i.legend:{};return{fontFamily:(null==l||null===(o=l.label)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"legend.label","fontFamily"),fontSize:(null==l||null===(s=l.label)||void 0===s?void 0:s.fontSize)||t.getStyle(e,"legend.label","fontSize"),color:(null==l||null===(a=l.label)||void 0===a||null===(a=a.fontColor)||void 0===a?void 0:a.color)||t.getStyle(e,"legend.label","color")}},ow={DATA_PATH:"qUndoExclude",HYPERCUBE_DEF_PATH:"qHyperCubeDef",HYPERCUBE_PATH:"qHyperCube",CHART_ID:"object.distributionPlot",AUTO_SORT:"sorting.autoSort",SORT_CRITERIA:"sorting.sortCriteria",SORTING_ELEMENT_ID:"sorting.elementId",SORTING_ELEMENT_MIN_ID:"distplot-exp-min",SORTING_ELEMENT_MAX_ID:"distplot-exp-max",SORTING_EXPRESSION:"sorting.expression",MAX_GLYPH_COUNT:20,MAX_STACKED_VALUES:3e3,HORIZONTAL:"horizontal",BOX_PADDING:2,POINT_BANDWIDTH_BASE_RATIO:.35,MAX_POINT_BASE_SIZE_PX:34,MIN_POINT_PIXELS:5,JITTER_PARAMETER:3,BUBBLE_SCALES_MAX:100};function sw(e){return e.qHyperCubeDef&&e.qHyperCubeDef.qDimensions.length>1||e.qHyperCube&&e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1}Object.freeze(ow);const aw={hasMultipleDimensions:sw,getOuterDimensionCardinality:function(e){const t=yx(e,ow.HYPERCUBE_PATH);return sw(e)?t&&t.qDimensionInfo[1].qCardinal:1},isAutoSort:function(e){return yx(e,ow.AUTO_SORT,!1)},isSortByExpression:function(e){return 0!==yx(e,`${ow.SORT_CRITERIA}.sortByExpression`,0)},isSortByNumeric:function(e){return 0!==yx(e,`${ow.SORT_CRITERIA}.sortByNumeric`,0)},isSortByAscii:function(e){return 0!==yx(e,`${ow.SORT_CRITERIA}.sortByAscii`,0)}},lw={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};var cw={create(e,t){if(!e||!lw[e])throw new Error("Attribute Expressions Util: ID required");const n={};return t&&Object.keys(t).forEach(e=>{n[e]=t[e]}),n.id=e,n.qAttribute=!0,n},getById:(e,t,n)=>!!e&&(n=n||"id",e.filter(e=>e[n]===t)[0]),getIndexById(e,t,n){let r=-1;return e&&(n=n||"id",e.forEach((e,i)=>{e[n]===t&&(r=i)})),r},moveById(e,t,n,r){const i=this.getIndexById(e,n,r);t=t||[];const o=this.getIndexById(t,n,r);if(-1!==i&&-1===o){const n=e.splice(i,1);t.push(n[0])}return t},moveAllById(e,t,n,r){const i=e.filter(e=>e.id===n),o=t.filter(e=>e.id===n),s=i.filter(e=>!(o.filter(t=>t[r]===e[r]).length>0));return[...t,...s]},moveByIdFromGroup(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(let o=0;o<e.length;o++){const s=e[o][n],a=t.length;if(this.moveById(s,t,r,i),a!==t.length)return t}return t},clean:e=>e.filter(e=>e&&e.id),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"}};var uw={getColorByDefinition:function(e,t,n){const r={};let i,o,s;if("dimension"!==e)throw new Error("Default-property-logic.js: getColorByDefinition: Illegal input");return n.qLibraryId?(r.type="dimension",r.name=n.qLibraryId,r.id=n.qLibraryId):(r.type="field",t?(r.name=n.label||n.qDef,r.id=n.qDef):(i=n.qDef,o=!!i.qLabelExpression,s=i.qFieldLabels&&i.qFieldLabels[0],r.name=i.qFieldDefs[0],r.label=o?i.qLabelExpression:s?i.qFieldLabels[0]:i.qFieldDefs[0])),r}};var hw={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0},useLocalFormat:function(e){var t,n;e.qNumFormat=(null===(t=e.quarantine)||void 0===t?void 0:t.qNumFormat)||{},e.isCustomFormatted=(null===(n=e.quarantine)||void 0===n?void 0:n.isCustomFormatted)||!1,e.quarantine=void 0},isUsingMasterNumberFormat:function(e){var t,n;return null!==(t=!(null==e||null===(n=e.quarantine)||void 0===n||!n.qNumFormat))&&void 0!==t&&t}};const dw=["scatterplot","map"],fw=["map"];var pw={baseColor:{isSupported:e=>e&&e.length&&-1===dw.indexOf(e),isDimSupported:e=>e&&e.length&&-1!==fw.indexOf(e)},colorBy:{},colorByUpdater(e,t,n,r){this.updateColorDef(e,r,n),this.updateHypercubeAttributes(e,t,n)},updateColorDef(e,t,n){const r=Py(n,"mode"),i=Py(n,"auto"),o=Py(e,`${t}qDimensions`,[]),s=Py(e,`${t}qMeasures`,[]);let a,l,c,u;if(!i&&"byDimension"===r&&o.length)a=Py(n,"byDimDef"),a&&xw(n,a.label),a&&a.activeDimensionIndex>-1?(a.activeDimensionIndex=Math.min(a.activeDimensionIndex,o.length-1),l=o[a.activeDimensionIndex],u=uw.getColorByDefinition("dimension",!1,l),u.activeDimensionIndex=a.activeDimensionIndex,vw(n,u)):a&&a.key||(l=o[o.length-1],c=cw.getById(l.qAttributeDimensions,cw.IDMAP.COLOR_BY_ALTERNATIVE),vw(n,uw.getColorByDefinition("dimension",!!c,c||l)));else{if(!i&&"byMeasure"===r&&o.length)throw new Error("not suported in any 444-chart");"byMultiple"===r&&s.length<2&&Fy(n,"mode","primary")}},updateHypercubeAttributes(e,t,n){const r=Py(n,"mode"),i=Py(n,"auto"),o=Py(e,`${t}qDimensions`,[]),s=Py(e,`${t}qMeasures`,[]),a=Py(e,`${t}qLayoutExclude.qHyperCubeDef.qDimensions`,[]);!i&&"byDimension"===r&&o.length?bw(n,!0,o,a,s,Py(n,"byDimDef.label")):!i&&"byMeasure"===r&&o.length?bw(n,!1,o,a,s,Py(n,"byMeasureDef.label")):mw(o,a)},setColorByPropertyDef:vw,resolveColorByPropertyDef:bw,clearColorByItem:mw};function mw(e,t){e.forEach(e=>{gw(e,cw.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),gw(e,cw.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")}),t.forEach(e=>{gw(e,cw.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),gw(e,cw.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")})}function gw(e,t,n){if(e[n]){const r=cw.getIndexById(e[n],t);r>=0&&e[n].splice(r,1)}else e[n]=[]}function yw(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?`[${e}]`:e}function vw(e,t,n,r){const i=n?"expression":t.type;let o=e.mode;switch(xw(e,t.label||t.name||""),i){case"field":o="byDimension",e.byDimDef={label:t.label||yw(t.name),key:yw(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":o="byMeasure",e.byMeasureDef={label:n||t.label||t.name,key:n||t.name,type:"expression"};break;case"dimension":o="byDimension",e.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":o="byMeasure",e.byMeasureDef={label:t.name,key:t.id,type:"libraryItem"},e.formatting&&hw.useMasterNumberFormat(e.formatting)}r||(e.auto=!1,e.mode=o)}function bw(e,t,n,r,i,o){mw(n,r);const s=n[n.length-1];if(s){const n=Py(e,t?"byDimDef":"byMeasureDef"),r=Py(e,"formatting.qNumFormat"),a=Py(e,"formatting.isCustomFormatted");if(n){const e=cw.create(cw.IDMAP.COLOR_BY_ALTERNATIVE);switch(n.type){case"expression":e.label=o||n.label,t?e.qDef=n.key:(e.qExpression=n.key,r&&(e.qNumFormat=r,e.isCustomFormatted=a)),e.label&&"="===e.label.charAt(0)&&(e.labelExpRef="color.altLabel");break;case"libraryItem":if(!t){let t=-1;i.forEach((e,r)=>{n.key===e.qLibraryId&&(t=r)}),e.matchMeasure=t,r&&(e.qNumFormat=r,e.isCustomFormatted=a)}e.qLibraryId=n.key,e.colorMapRef=n.key}t?(e.qSortBy={qSortByAscii:1},s.qAttributeDimensions.push(e)):s.qAttributeExpressions.push(e)}}}function xw(e,t){if(!t)return;const n="="===t.charAt(0);e.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}function ww(e){return!!e&&(e.coloring&&e.coloring.baseColor&&e.coloring.baseColor.color?e.coloring.baseColor:!(!e.baseColor||!e.baseColor.color)&&e.baseColor)}function qw(e){return"libraryItem"===yx(e,"color.point.byDimDef.type")}function Mw(e){return"libraryItem"===yx(e,"color.point.byMeasureDef.type")}function Sw(e){return!0===yx(e,"color.point.auto")}function Dw(e){return!Sw(e)&&"byDimension"===yx(e,"color.point.mode")}function _w(e){return!Sw(e)&&"byMeasure"===yx(e,"color.point.mode")}var kw={measuresHasBaseColors:function(e){return yx(e,"layout.qHyperCube.qMeasureInfo",[]).filter(e=>!!ww(e)).length>0},dimensionsHasBaseColors:function(e){return yx(e,"layout.qHyperCube.qDimensionInfo",[]).filter(e=>!!ww(e)).length>0},onGlobalChangeColors:function(e){pw.updateColorDef(e,"qHyperCubeDef.",e.color.point)},onChangeCalcCond:function(e){var t;const n=null==e?void 0:e.qHyperCubeDef,r=null==e||null===(t=e.qUndoExclude)||void 0===t?void 0:t.qHyperCubeDef;n&&r&&(r.qCalcCond=n.qCalcCond,r.qCalcCondition=n.qCalcCondition)},isColorByDimension:Dw,isColorByMeasure:_w,isColorAuto:Sw,isColorByExpression:function(e){return!Sw(e)&&"byExpression"===yx(e,"color.point.mode")},isColorBySingle:function(e){return!Sw(e)&&"primary"===yx(e,"color.point.mode","primary")},isDimensionLibraryItem:qw,isMeasureLibraryItem:Mw,showLegend:function(e){const t=yx(e,"color.point.mode","primary");return"primary"!==t&&"byExpression"!==t&&!1===Sw(e)},showColorByLabel:function(e){const t=Dw(e)&&!1===qw(e),n=_w(e)&&!1===Mw(e),r=yx(e,"color.point.byDimDef.activeDimensionIndex")>-1;return t&&!r||n},hasDimValueColors:function(e,t){var n,r;return null===(n=null===(r=e.layout.qHyperCube.qDimensionInfo[t])||void 0===r||null===(r=r.coloring)||void 0===r?void 0:r.hasValueColors)||void 0===n||n}};function Cw(e,t){this.getSettings=e,this.getElements=t}function Ew(e){const t=e.qDef.qSortCriterias;t[0]||t.push({});const n=t[0],r=this.getSettings();Fy(n,"qSortByExpression",r.SORT_BY_EXPRESSION),Fy(n,"qSortByAscii",r.SORT_BY_ASCII),Fy(n,"qSortByNumeric",r.SORT_BY_NUMERIC),Fy(n,"qSortByLoadOrder",r.SORT_BY_LOAD_ORDER),n.qExpression||(n.qExpression={});const i=Aw(this.getElements());n.qExpression.qv=i.exp}function Aw(e){const t=e.filter(e=>e.isDefault);return 0===t.length?e[0]:t[0]}Cw.prototype.applyAutoSorting=Ew,Cw.prototype.applyDefaultCustomSorting=function(e,t){Ew.call(this,e);const n=Aw(this.getElements()),r=e.qDef.qSortCriterias[0];t.elementId=n.id,t.sortCriteria={},Fy(t.sortCriteria,"sortByExpression",r.qSortByExpression),Fy(t.sortCriteria,"sortByAscii",r.qSortByAscii),Fy(t.sortCriteria,"sortByNumeric",r.qSortByNumeric),Fy(t.sortCriteria,"sortByLoadOrder",r.qSortByLoadOrder)},Cw.prototype.applyCustomSorting=function(e,t){const n=e.qDef.qSortCriterias[0];if(Fy(n,"qSortByExpression",t.sortCriteria.sortByExpression),Fy(n,"qSortByAscii",t.sortCriteria.sortByAscii),Fy(n,"qSortByNumeric",t.sortCriteria.sortByNumeric),Fy(n,"qSortByLoadOrder",t.sortCriteria.sortByLoadOrder),1!==n.qSortByExpression&&-1!==n.qSortByExpression)return;n.qExpression||(n.qExpression={});if(t.elementId){const e=function(e,t){const n=e.filter(e=>e.id===t);0===n.length&&function(e){throw new Error(`Sorter: ${e}`)}(`Could not find any element matching the element '${t}'`);return n[0]}(this.getElements(),t.elementId);n.qExpression.qv=e.exp}else n.qExpression.qv=t.expression.qValueExpression.qExpr};const Tw={create:function(e,t){return new Cw(e,t)}};const Iw={applySorting:function(e,t,n){const r=n.autoSort,i=!!n.sortCriteria;r?e.applyAutoSorting(t):i?e.applyCustomSorting(t,n):e.applyDefaultCustomSorting(t,n)}};const Nw={ASCII:{ELEMENT:void 0,SORT_BY_EXPRESSION:void 0,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}};Object.freeze(Nw.ASCII),Object.freeze(Nw);const Rw=Lx(!0,{DIST_MAX:{ELEMENT:"distplot-exp-max",SORT_BY_EXPRESSION:-1,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}},Nw);const Ow={getSettings:function(e){return yx(e,"qHyperCube.qDimensionInfo.1.qCardinal",1)>10?Rw.DIST_MAX:Rw.ASCII}};function Pw(e,t,n,r){let i="Fractile";0===e?i="Min":1===e&&(i="Max");const o=t?Fx.wrapExpression(t):"",s=n?Fx.wrapExpression(n):"";return`${i}( total {{<outerDimString>}} Aggr( {{innerMeasureString}}, {{outerDimString,}} {{innerDimString}} ), ${e} )`.replace(/{{innerDimString}}/g,o).replace(/{{outerDimString}}/g,s).replace(/{{<outerDimString>}}/g,n?`<${s}>`:"").replace(/{{outerDimString,}}/g,n?`${s},`:"").replace(/{{innerMeasureString}}/g,(r||"").replace(/^=/,""))}const Lw={getElementIds:function(){return[ow.SORTING_ELEMENT_MIN_ID,ow.SORTING_ELEMENT_MAX_ID]},getElements:function(e,t,n,r){const i=t[0],o=t[1],s=e[0],a=Pw(0,i,o,s),l=Pw(1,i,o,s);return[{id:ow.SORTING_ELEMENT_MIN_ID,label:r.get("properties.distributionPlot.min"),exp:a,isDefault:ow.SORTING_ELEMENT_MIN_ID===n.ELEMENT},{id:ow.SORTING_ELEMENT_MAX_ID,label:r.get("properties.distributionPlot.max"),exp:l,isDefault:ow.SORTING_ELEMENT_MAX_ID===n.ELEMENT}]},getFractileExpression:Pw};function Fw(e){throw new Error(`distributionplot-sorter.applySorting: ${e}`)}function jw(e,t,n,r){if(!e.qUndoExclude)return;e.sorting||(e.sorting={autoSort:!0});const i=e.qUndoExclude.qHyperCubeDef.qDimensions;i.length>=2?e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[0,2,1]:e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0];const o=function(){return Ow.getSettings(t)},s=Tw.create(o,function(){const e=o();return Lw.getElements(n.measures,n.dimensions,e,r)}),a=i[0],l=e.sorting;Iw.applySorting(s,a,l)}const zw={applySorting:function(e,t,n,r,i){return function(e){const t=e.qHyperCubeDef;t?t.qDimensions?t.qMeasures?(!t.qDimensions.length||t.qDimensions.length<2)&&Fw("'qHyperCubeDef.qDimensions' has no outer dimension"):Fw("no 'qHyperCubeDef.qMeasures' in properties arg"):Fw("no 'qHyperCubeDef.qDimensions' in properties arg"):Fw("no 'qHyperCubeDef' in properties arg")}(e),r?jw(e,t,r,i):Vx.getAllHyperCubeExpressions(e.qHyperCubeDef,t.qHyperCube,n).then(n=>{jw(e,t,n,i)})}},Hw=`${ow.SORT_CRITERIA}.sortByExpression`;const Bw={updateSortOrder:function(e,t){if(!t)return;const n=yx(e,Hw);if(!(-1===n||1===n))return;const r=yx(e,ow.SORTING_ELEMENT_ID),i=yx(t,ow.SORTING_ELEMENT_ID),o=r===ow.SORTING_ELEMENT_MAX_ID,s=r===ow.SORTING_ELEMENT_MIN_ID&&i===ow.SORTING_ELEMENT_MAX_ID,a=o&&(!!!i||i===ow.SORTING_ELEMENT_MIN_ID),l=yx(t,Hw),c=o&&!(-1===l||1===l)&&1===n;s?xx(e,Hw,1):(a||c)&&xx(e,Hw,-1)}},Vw=(e,t)=>{const n={};return n.axisTitleSection={translation:"properties.axis.title",component:"panel-section",items:t.getOptions("axis","axis.title")},n.axisLabelSection={translation:"properties.axis.label",component:"panel-section",items:t.getOptions("axis","axis.label.name")},null!=e&&e.isEnabled("CLIENT_IM_3051")&&(n.legendTitleSection={translation:"properties.legend.title",component:"panel-section",items:t.getOptions("legend","legend.title")},n.legendLabelSection={translation:"properties.legend.label",component:"panel-section",items:t.getOptions("legend","legend.label")}),Object.keys(n).length>0?n:void 0},$w=(e,t,n)=>({component:"styling-panel",chartTitle:"Object.DistributionPlot",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e,items:Vw(n,t)});function Ww(e){return!yx(e,"color.point.auto")&&"byDimension"===yx(e,"color.point.mode")&&yx(e,"qHyperCubeDef.qMeasures.length",0)<=1}function Uw(e){const{flags:t,translator:n}=e,r=e.theme,i=e.flags.isEnabled("SENSECLIENT_IM_2018_STYLINGPANEL_DIST_PLOT"),o=e.flags.isEnabled("SENSECLIENT_IM_2018_DIST_BG"),s=e=>({color:e,index:r.getDataColorPickerPalettes()[0].colors.indexOf(e)}),a={translation:"properties.colors",type:"items",items:{colors:{type:"items",items:{pointColor:{type:"items",translation:"properties.colorsAndLegend",grouped:!0,items:{colors:{type:"items",items:{autoColor:{ref:"color.point.auto",type:"boolean",translation:"properties.colors",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},colorMode:{ref:"color.point.mode",type:"string",component:"dropdown",options:()=>[{value:"primary",translation:"properties.colorMode.primary"},{value:"byExpression",translation:"properties.colorMode.byExpression"}],defaultValue:"primary",show:e=>!yx(e,"color.point.auto",!0)},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=r.getStyle(ow.CHART_ID,"box","fill");return s(e)}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",type:"object",component:"color-picker",dualOutput:!0,show:e=>!yx(e,"color.point.auto",!0)&&"primary"===yx(e,"color.point.mode","primary"),defaultValue(){const e=r.getDataColorSpecials().primary;return s(e)}},attributeExpression:{type:"string",component:"expression",expressionType:"measure",schemaIgnore:!0,ref:"color.point.expression.qValueExpression.qExpr",translation:"Common.Expression",show:e=>!yx(e,"color.point.auto")&&"byExpression"===yx(e,"color.point.mode")},expressionIsColor:{ref:"color.point.expressionIsColor",translation:"properties.expressionIsColor",type:"boolean",defaultValue:!0,show:!1}}}}}}}}},l={items:{showDisclaimer:{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",show:()=>t.isEnabled("SHOW_DISCLAIMER"),defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}}},c=((e,t,n,r,i)=>r({theme:e,translator:t,flags:i,config:{id:n,paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}}))(r,n,ow.CHART_ID,Lv,t),u=((e,t,n)=>{const r={getOptions:(r,i)=>{const o=(e,t)=>({ref:`${i}.fontColor`,component:"color-picker",width:!1,defaultValue:()=>{const n=e.getStyle(t,`${i}.color`,"color");return{color:n,index:e.getDataColorPickerPalettes()[0].colors.indexOf(n)}}});return{labelSection:{component:"items",ref:"components",key:r,items:{fontFamily:{ref:`${i}.fontFamily`,component:"dropdown",options:()=>e.getOptions(`${i}.fontFamily`),defaultValue:()=>e.getDefaultValue(`${i}.fontFamily`)},...((t,n)=>({fontWrapper:{component:"inline-wrapper",items:{fontSize:{ref:`${i}.fontSize`,component:"dropdown",width:!0,options:()=>e.getOptions(`${i}.fontSize`),defaultValue:()=>e.getDefaultValue(`${i}.fontSize`)},fontColor:{...o(t,n)}}}}))(t,n)}}}}};return r})(c,r,ow.CHART_ID),h={type:"items",translation:"properties.presentation",items:{stylingPanel:i&&$w(o,u,t),orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"horizontal",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}]},showDistBackground:{ref:"presentation.visibleComponents",translation:"properties.show",type:"string",component:"dropdown",defaultValue:"points_box",options:[{value:"points_box",translation:"properties.distributionPlot.pointsAndBox"},{value:"points",translation:"properties.distributionPlot.pointsOnly"},{value:"box",translation:"properties.distributionPlot.boxOnly"}]},gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridlines.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridlines.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridlines&&!e.gridlines.auto}}}}};h.items.bubbleScaleItems={type:"items",items:{bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:ow.BUBBLE_SCALES_MAX,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents}}},h.items.jitter={type:"string",component:"switch",ref:"dataPoint.displacement",translation:"properties.distributionPlot.jitter",defaultValue:"none",options:[{value:"none",translation:"properties.off"},{value:"jitter",translation:"properties.on"}],show:e=>"box"!==e.presentation.visibleComponents};const d={uses:"axis.picasso.measureAxis",items:{startAt:{type:"string",component:"dropdown",translation:"properties.axis.startAt",readOnly:e=>!(e.measureAxis.autoMinMax||"min"===e.measureAxis.minMax&&0===e.measureAxis.min),options:[{value:"zero",translation:"properties.axis.startAt.zero"},{value:"lowest",translation:"properties.axis.startAt.lowest"}],defaultValue:"lowest",convertFunctions:{get(e,t,n,r){const{autoMinMax:i,minMax:o,min:s}=(null==r?void 0:r.measureAxis)||{};return!0===i?"lowest":i||"min"!==o||0!==s?e(t.type):"zero"},set(e,t,n,r,i){"zero"===e?(xx(i,"measureAxis.autoMinMax",!1),xx(i,"measureAxis.minMax","min"),xx(i,"measureAxis.min",0)):xx(i,"measureAxis.autoMinMax",!0)}},classification:{section:"axis",tags:["simple"],exclusive:!0}}}},f={uses:"axis.picasso.dimensionAxis",show:(e,t)=>yx(t.layout,`${ow.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,items:{dimensionAxisTitle:{component:"header",type:"string",show:(e,t)=>yx(t.layout,`${ow.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,classification:{section:"axis",tags:["simple"],exclusive:!0}},othersGroup:{items:{label:{show:(e,t)=>yx(t.layout,`${ow.HYPERCUBE_PATH}.qDimensionInfo.length`)>1&&"horizontal"!==yx(t.layout,"orientation"),options:t.isEnabled("SENSECLIENT_LAYERED_LABELS")?[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]:void 0},dock:{show:(e,t)=>yx(t.layout,`${ow.HYPERCUBE_PATH}.qDimensionInfo.length`)>1}}}}};function p(e,t){const n=yx(e,t,void 0);n&&void 0!==n.label&&("="===n.label.charAt(0)?e.color.point.altLabel={qStringExpression:{qExpr:n.label.substr(1)}}:e.color.point.altLabel=n.label)}const m=(e,t)=>{var n,r,i;if("libraryItem"===(null===(n=e.color.point.byDimDef)||void 0===n?void 0:n.type)){var o,s,a,l;const n=null!==(o=null===(s=e.color.point.byDimDef)||void 0===s?void 0:s.key)&&void 0!==o?o:"",r=null!==(a=null===(l=t.handler.layout.qUndoExclude)||void 0===l||null===(l=l.qHyperCube)||void 0===l?void 0:l.qDimensionInfo)&&void 0!==a?a:[];for(let e=0;e<r.length;e++){const t=r[e].qAttrDimInfo;if(t)for(let e=0;e<t.length;e++)if(t[e].colorMapRef===n)return t[e].qFallbackTitle}return""}return null!==(r=null===(i=e.color.point.byDimDef)||void 0===i?void 0:i.label)&&void 0!==r?r:""},g=(e,t,r)=>{var i;if(null!==(i=e.qHyperCubeDef)&&void 0!==i&&null!==(i=i.qDimensions)&&void 0!==i&&i.length){var o,s,a;const t=null===(o=e.qHyperCubeDef)||void 0===o?void 0:o.qDimensions.map((e,t)=>({value:t,label:n.get("properties.colorBy.currentDimension",t+1)}));return(null!==(s=null===(a=e.color)||void 0===a||null===(a=a.point)||void 0===a||null===(a=a.byDimDef)||void 0===a?void 0:a.activeDimensionIndex)&&void 0!==s?s:-1)<0&&t.push({value:-1,label:m(e,r)}),t}return[]},y={items:{disclaimer:{show:!1},simpleItems:{show:!0,items:{autoColor:{ref:"color.point.auto",undefinedValue:!1,label:e=>yx(e,"color.point.auto")?n.get("Simple.Color.Auto",n.get("properties.colorMode.primary")):n.get("Common.Custom"),change:e=>{yx(e,"color.point.auto")||(xx(e,"color.point.mode","primary"),xx(e,"color.point.useBaseColors","off"))}},colorMode:{ref:"color.point.mode",options:e=>{const t=[{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}];return"byExpression"===yx(e,"color.point.mode")&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!kw.isColorAuto(e),change(e){if("primary"===yx(e,"color.point.mode",void 0)){const t=yx(e,"color.point.useBaseColors",void 0);void 0!==t&&"off"!==t&&xx(e,"color.point.useBaseColors","off")}},globalChange(){}},colorByDimension:{ref:"color.point.byDimDef.activeDimensionIndex",options:g,show:(e,t,n)=>kw.isColorByDimension(e)&&g(e,0,n).length>1,change(e){p(e,"color.point.byDimDef")}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,t){const n=yx(e,"color.point.mode","primary");return!kw.isColorAuto(e)&&"primary"===n&&(kw.measuresHasBaseColors(t)||kw.dimensionsHasBaseColors(t))}}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show:(e,t)=>{const n="measure"===yx(e,"color.point.useBaseColors")&&kw.measuresHasBaseColors(t),r="dimension"===yx(e,"color.point.useBaseColors")&&kw.dimensionsHasBaseColors(t);return kw.isColorBySingle(e)&&!n&&!r}},useDimColVal:{ref:"color.point.useDimColVal",show(e,t,n){var r,i;const o=null!==(r=null===(i=e.color.point)||void 0===i||null===(i=i.byDimDef)||void 0===i?void 0:i.activeDimensionIndex)&&void 0!==r?r:null;return kw.hasDimValueColors(n.handler,o)&&kw.isColorByDimension(e)&&kw.isDimensionLibraryItem(e)}},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=r.getStyle(ow.CHART_ID,"box","fill");return s(e)},show:e=>!yx(e,"color.point.auto",!0)}}}}},v={uses:"colorsAndLegend",items:{colors:{globalChange:kw.onGlobalChangeColors,items:{autoColor:{ref:"color.point.auto",undefinedValue:!1},colorMode:{ref:"color.point.mode",options(e){const t=[];return t.push({value:"primary",translation:"properties.colorMode.primary"}),t.push({value:"byDimension",translation:"properties.colorMode.byDimension"}),yx(e,"qHyperCubeDef.qDimensions.length",0)>=1&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!kw.isColorAuto(e),globalChange(){}},colorByDimension:{ref:"color.point.byDimDef",show:e=>kw.isColorByDimension(e),change(e){p(e,"color.point.byDimDef")}},colorByMeasure:{ref:"color.point.byMeasureDef",show:e=>kw.isColorByMeasure(e),change(e){p(e,"color.point.byMeasureDef")}},colorByLabel:{ref:"color.point.altLabel",show:kw.showColorByLabel,change(e){const t=yx(e,"color.point.mode"),n=yx(e,"color.point.altLabel","");let r;switch(t){case"byMeasure":r=e.color.point.byMeasureDef;break;case"byDimension":r=e.color.point.byDimDef}r&&(r.label=n.qStringExpression?`=${n.qStringExpression.qExpr}`:n)}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,t){const n=yx(e,"color.point.mode","primary");return!kw.isColorAuto(e)&&"primary"===n&&(kw.measuresHasBaseColors(t)||kw.dimensionsHasBaseColors(t))}},measureColor:{translation:"properties.libraryColors",component:"measure-color",show:(e,t)=>!yx(e,"color.point.auto")&&"byMultiple"===yx(e,"color.point.mode")&&"measure"===yx(e,"color.point.useBaseColors")&&t.layout.qHyperCube.qMeasureInfo.length>1&&kw.measuresHasBaseColors(t)}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show(e,t){const n="measure"===yx(e,"color.point.useBaseColors")&&kw.measuresHasBaseColors(t),r="dimension"===yx(e,"color.point.useBaseColors")&&kw.dimensionsHasBaseColors(t);return kw.isColorBySingle(e)&&!n&&!r}},useDimColVal:{ref:"color.point.useDimColVal",show:e=>kw.isColorByDimension(e)&&kw.isDimensionLibraryItem(e)},useMeasureGradient:{ref:"color.point.useMeasureGradient",translation:"properties.libraryColors",type:"boolean",component:"switch",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}],show(e){const t=yx(e,"color.point.auto"),n=yx(e,"color.point.mode");return!t&&"byMeasure"===n&&"libraryItem"===yx(e,"color.point.byMeasureDef.type")}},persistentColors:{ref:"color.point.persistent",show:e=>yx(e,"color.point.auto")||"byDimension"!==yx(e,"color.point.mode")||"libraryItem"!==yx(e,"color.point.byDimDef.type")?Ww(e):Ww(e)&&!yx(e,"color.point.useDimColVal")},colorSchemeMeasure:{ref:"color.point.measureScheme",show:e=>!kw.isColorAuto(e)&&kw.isColorByMeasure(e)},reverseScheme:{ref:"color.point.reverseScheme",change(e){e.color.reverseScheme=e.color.point.reverseScheme},show:e=>!kw.isColorAuto(e)&&kw.isColorByMeasure(e)},colorSchemeDimension:{ref:"color.point.dimensionScheme",show:e=>kw.isColorByDimension(e)&&(!kw.isDimensionLibraryItem(e)||!yx(e,"color.point.useDimColVal"))},customRange:{show:e=>!kw.isColorAuto(e),items:{autoMinMax:{ref:"color.point.autoMinMax",show:e=>kw.isColorByMeasure(e)},min:{ref:"color.point.measureMin",show:e=>kw.isColorByMeasure(e)&&!1===yx(e,"color.point.autoMinMax"),invalid:e=>"minMax"===yx(e,"color.point.minMax")&&yx(e,"color.point.measureMin")>=yx(e,"color.point.measureMax")},max:{ref:"color.point.measureMax",show:e=>kw.isColorByMeasure(e)&&!1===yx(e,"color.point.autoMinMax"),invalid:e=>"minMax"===yx(e,"color.point.minMax")&&yx(e,"color.point.measureMin")>=yx(e,"color.point.measureMax")}}},attributeExpression:{ref:"color.point.expression.qValueExpression.qExpr",show:e=>kw.isColorByExpression(e)},expressionIsColor:{ref:"color.point.expressionIsColor",show:!1},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=r.getStyle(ow.CHART_ID,"box","fill");return s(e)},show:e=>!yx(e,"color.point.auto",!0)}}},simpleColors:y,legend:{show:kw.showLegend,type:"items",items:{show:{snapshot:{tid:"property-legend"}},dock:{show:e=>kw.showLegend(e)&&yx(e,"legend.show",!0)},showTitle:{show:e=>kw.showLegend(e)&&yx(e,"legend.show",!0)}}}}},b={items:{labels:{items:{header:{show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)>1&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)},convertFunctions:{get:(e,t,n,r)=>"labels"===r.dimensionAxis.show||"none"===r.dimensionAxis.show,set(e,t,n,r,i){i.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show(e){var t,n;return(null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length)&&(null===(n=e.qHyperCubeDef.qMeasures)||void 0===n?void 0:n.length)},convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}},x={uses:"settings",items:{simpleLabels:b,general:l,presentation:h,colors:v||a,measureAxis:d,dimensionAxis:f}},w={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:kw.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},q=Qx.expression(`${ow.SORT_CRITERIA}.sortByExpression`),M={type:"items",items:{toggled:q.items.toggled,sortByElement:{component:"sort-by-element",expressionRef:ow.SORTING_EXPRESSION,elementRef:ow.SORTING_ELEMENT_ID,show:aw.isSortByExpression,elements:e=>Vx.getAllHyperCubeExpressions(e.properties.qHyperCubeDef,e.layout.qHyperCube,e.model.app).then(t=>{const r=Ow.getSettings(e.layout);return Lw.getElements(t.measures,t.dimensions,r,n)})},order:q.items.order}},S={type:"items",translation:"properties.sorting",schemaIgnore:!0,grouped:!1,globalChange(e,t,n){n&&Bw.updateSortOrder(e,n.prevProperties)},items:{autoSort:{ref:ow.AUTO_SORT,type:"boolean",translation:"properties.sorting",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],show:aw.hasMultipleDimensions,change(e,t,r,i){if(e&&aw.hasMultipleDimensions(e)&&t.layout)return zw.applySorting(e,t.layout,i.model.app,null,n)},classification:{section:"sorting",tags:["simple"]},reset(e){e.sorting={autoSort:!0}}},simpleSorting:{component:"sorting-with-elements",expressionRef:ow.SORTING_EXPRESSION,elementRef:ow.SORTING_ELEMENT_ID,sortCriteriasRef:ow.SORT_CRITERIA,show:e=>aw.hasMultipleDimensions(e)&&!aw.isAutoSort(e),elements:e=>Vx.getAllHyperCubeExpressions(e.handler.properties.qHyperCubeDef,e.handler.layout.qHyperCube,e.model.app).then(t=>{const r=Ow.getSettings(e.layout);return Lw.getElements(t.measures,t.dimensions,r,n)}),classification:{section:"sorting",tags:["simple"],exclusive:!0}},sortingItems:{type:"items",grouped:!0,show:e=>aw.hasMultipleDimensions(e)&&!aw.isAutoSort(e),items:{expression:M,numeric:Qx.numeric(`${ow.SORT_CRITERIA}.sortByNumeric`),ascii:Qx.ascii(`${ow.SORT_CRITERIA}.sortByAscii`),defaultSortMessage:{component:"text",translation:"properties.sorting.defaultSortingMessage",show:e=>!aw.isSortByExpression(e)&&!aw.isSortByNumeric(e)&&!aw.isSortByAscii(e)}}},noData:{component:"text",translation:"Common.NoData",style:"hint",show:e=>!aw.hasMultipleDimensions(e),classification:{section:"sorting",tags:["simple"]}}}};return{type:"items",component:"accordion",items:{data:{uses:"data",grouped:!0,items:{dimensions:{uses:"dimensions"},measures:{uses:"measures"}}},sorting:S,addons:w,settings:x}}}const Yw={buildDefinition:function(e,t,n,r,i){const o=`${n}.qDef.qSortCriterias.0.`,s={type:"items",translation:"properties.sorting",icon:"ascending",show:t=>Py(t,`${e}.qDimensions.length`,0)>1,items:{sortingOptions:{component:"radio-list",type:"number",diffs:[`${o}qSortByExpression`,`${o}qSortByNumeric`,`${o}qSortByAscii`],options:[{value:1,translation:"properties.sorting.ascending"},{value:-1,translation:"properties.sorting.descending"}],setPropertyValue(e,n,s){const a=s.layout;let l=Kw(e,o).chart;l||(l="sortByAscii");const c=Py(e,t);if(c.sortCriteria||(c.sortCriteria={}),c.autoSort){const t=r(a);if(t.ELEMENT)c.elementId=t.ELEMENT;else{const t=i(e,a);c.elementId=t[0]}}c.autoSort=!1,function(e,t){const n=e.sortCriteria;"sortByNumeric"!==t&&"sortByAscii"!==t||(n.sortByExpression=0);"sortByAscii"===t&&(n.sortByNumeric=0)}(c,l),c.sortCriteria[l]=n},getValue(e){const t=Kw(e,o).dimension;return t?Py(e,o+t):0}}}};return s}};function Kw(e,t){const n={chart:"",dimension:""};return 0!==Py(e,`${t}qSortByExpression`,0)?(n.chart="sortByExpression",n.dimension="qSortByExpression"):0!==Py(e,`${t}qSortByNumeric`,0)?(n.chart="sortByNumeric",n.dimension="qSortByNumeric"):0!==Py(e,`${t}qSortByAscii`,0)&&(n.chart="sortByAscii",n.dimension="qSortByAscii"),n}const Xw={type:"items",component:"accordion",items:{data:{uses:"data"},sorting:Yw.buildDefinition("qHyperCubeDef","sorting","qUndoExclude.qHyperCubeDef.qDimensions.0",Ow.getSettings,Lw.getElementIds),presentation:{uses:"presentation",items:{orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}]},bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:100,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents},jitter:{type:"string",component:"switch",ref:"dataPoint.displacement",translation:"properties.distributionPlot.jitter",defaultValue:"none",options:[{value:"none",translation:"properties.off"},{value:"jitter",translation:"properties.on"}],show:e=>"box"!==e.presentation.visibleComponents}}}}},Gw={items:{color:{uses:"color",items:{mode:{options:[{value:"auto",translation:"Common.Auto"},{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}],diffs:["color.point.mode","color.point.auto"],setPropertyValue(e,t){"auto"===t?e.color.point.auto=!0:(e.color.point.auto=!1,e.color.point.mode=t)},getValue:e=>kw.isColorAuto(e)?"auto":e.color.point.mode},dimension:{show:e=>kw.isColorByDimension(e),items:{colorScheme:{ref:"color.point.dimensionScheme"},persistentColors:{ref:"color.point.persistent"}}},measure:{show:e=>kw.isColorByMeasure(e),items:{sequential:{ref:"color.point.measureScheme"}}},legend:{show:kw.showLegend}}}}};function Jw(e){return{definition:Uw(e),softDefinition:Xw,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},options:{usingDerivedProperties:!0,colorByPath:"color.point"},onSoftPropertyChange(e,t){kw.onGlobalChangeColors(t)},importProperties:(t,n,r)=>{const i=sv(e);r.mapProperties();return Tx({dataDefinition:i,defaultPropertyValues:{defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},exportFormat:t,initialProperties:n})},exportProperties:(e,t,n)=>Ix({propertyTree:e,viewDataMode:n})}}Lx(!0,Xw,Gw);const Zw={getChar(e){let t,n=e;return n>9?(t=65+n-10,t>90&&(t+=6)):n=`${n}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(t)>-1?this.getChar(n+1):String.fromCharCode(t)},base62(e){const t=this.getChar(e%62),n=Math.floor(e/62);return n>0?this.base62(n)+t:t},id(){return this.base62(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function Qw(){return Zw.id()}const eq="scrollbar";function tq(e,t,n){return"y"===e?nq(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function nq(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var rq={getAxisDock:tq,getOppositeAxisDock:function(e,t,n){return tq(e,"far"===t?"near":"far",n)},getYAxisDock:nq};const iq=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),oq=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),sq=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function aq(e){return iq.test(e)}function lq(e){return oq.test(e)||sq.test(e)}var cq={lrm:String.fromCharCode(8206),detectTextDirection:function(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],aq(r))return"ltr";if(lq(r))return"rtl"}return"ltr"}};var uq={lineSettings:function(e,t){var n;const r={value:0,line:{stroke:void 0!==t.paletteColor?t.theme.getColorPickerColor(t.paletteColor):"transparent",strokeDasharray:null==t||null===(n=t.style)||void 0===n?void 0:n.lineType}};return Lx(!0,r,e||{})},lineLabelSettings:function(e,t){const n=t&&t.chartID;let r=t.theme.getStyle(n,"referenceLine.label.name","color");const i=t.theme.getStyle(n,"referenceLine.label.name","fontSize"),o=t.theme.getStyle(n,"referenceLine.label.name","fontFamily");return t.paletteColor?r=t.theme.getColorPickerColor(t.paletteColor):r||(r="transparent"),Lx(!0,{value:0,line:{stroke:"transparent"},label:{align:"center",vAlign:"middle",text:"",fill:r,fontFamily:o,fontSize:i,maxWidthPx:135}},e||{})},isVisible:e=>e&&!1!==e.show&&0!==e.show&&"0"!==e.show&&void 0!==e.refLineExpr,getRefLineTitle:function({refLine:e,label:t,valueString:n}){return!1!==e.showValue?!1!==e.showLabel?`${t} ${cq.lrm}(${n})${cq.lrm}`:`${cq.lrm}(${n})${cq.lrm}`:!1!==e.showLabel?t:""}};const hq={SHOW_AXIS_LABELS_OPTIONS:["all","labels"],SHOW_TITLE_OPTIONS:["all","title"],HORIZONTAL:"horizontal",VERTICAL:"vertical",LAYOUTSETTINGS:{lasso:{displayOrder:1e4},rangeDim:{displayOrder:1e4},rangeMeasure:{displayOrder:1e4},rangeMinor:{displayOrder:1e4},scrollBar:{minimumLayoutMode:"SPARK",prioOrder:-1,displayOrder:100},refLines:{layout:{minimumLayoutMode:"SPARK",prioOrder:60,displayOrder:1110}},measureAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},dimensionAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},measureAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},dimensionAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},gridLines:{minimumLayoutMode:"XSMALL",displayOrder:-100},refLinesLabels:{minimumLayoutMode:"SMALL",prioOrder:60,displayOrder:0}}};hq.DEFAULT_CHART_ORIENTATION=hq.HORIZONTAL;function dq(e,t){const n=t||{},r=n.measureAxisProperties||{},i=n.dimensionAxisProperties||{},o=n.orientation||hq.DEFAULT_CHART_ORIENTATION,s=o===hq.HORIZONTAL,a=s?"x":"y",l=s?"y":"x",c=hq.SHOW_AXIS_LABELS_OPTIONS,u=hq.SHOW_TITLE_OPTIONS,h=c.includes(r.show),d=!!n.measureTitleText&&u.includes(r.show),f=n.includeDimensionAxis&&c.includes(i.show),p=n.includeDimensionAxis&&!!n.dimensionTitleText&&u.includes(i.show),m=n.gridlines&&!(!n.gridlines.auto&&0===n.gridlines.spacing),g=n.refLines&&n.refLines.some(e=>e.show),y=[];if(h&&function(e,t,n,r){let i={scale:"measure",settings:t.axisLabelStyle||{},forceBounds:r&&!r.autoMinMax&&r.showBounds};i=Lx(i,hq.LAYOUTSETTINGS.measureAxis);const o=pq(t,n);e.addComponent(`${n}-axis`,i,o)}(e,n,a,r),d&&function(e,t,n){let r={text:t.measureTitleText,style:t.axisTitleStyle||{}};r=Lx(r,hq.LAYOUTSETTINGS.measureAxisTitle);const i=function(e,t){return pq(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,a),function(e,t,n,r){let i=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:r};r&&r.spacing>0&&(i=Lx(!0,i||{},{component:{ticks:{distance:100*r.spacing}}}));e.addScale("measure-scale",i,o)}(e,n,o,r),f&&function(e,t,n){let r={scale:"dimension",settings:t.axisLabelStyle||{}};r=Lx(r,hq.LAYOUTSETTINGS.dimensionAxis);const i=mq(t,n);Lx(!0,r,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,r,i)}(e,n,l),p&&function(e,t,n){let r={text:t.dimensionTitleText,style:t.axisTitleStyle||{}};r=Lx(r,hq.LAYOUTSETTINGS.dimensionAxisTitle);const i=function(e,t){return mq(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,l),n.includeDimensionAxis&&function(e,t,n){const r={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===hq.HORIZONTAL?hq.VERTICAL:hq.HORIZONTAL};e.addScale("dimension-scale",t.dimensionScaleSettings,r)}(e,n,o),m&&function(e,t,n){let r={ticks:{show:!0},minorTicks:{show:!t.auto&&!t.auto&&3===t.spacing}};r=Lx(r,hq.LAYOUTSETTINGS.gridLines),r[n]={scale:"measure"},e.addComponent("grid-line",r)}(e,n.gridlines,a),n.hasNavigation&&function(e,t,n,r){const i=e.getSettings();i.scroll={dimension:{viewSize:n.scrollSettings&&n.scrollSettings.viewSize||0,max:n.scrollSettings&&n.scrollSettings.max||0}};const o={isRtl:n.isRtl,chartID:n.chartID,isHorizontal:!r},s=Lx({},hq.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",s,o),fq(t,function(e){function t(t,n){if(!n||!e())return!1;const r={x:n.center.x-n.deltaX,y:n.center.y-n.deltaY};return this.chart.componentsFromPoint(r).some(e=>e.settings.key===eq)}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(eq).emit("tap",e)}}},r={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(eq).emit("panStart",e)},pan(e){this.chart.component(eq).emit("panMove",e)},panend(e){this.chart.component(eq).emit("panEnd",e)},pancancel(e){this.chart.component(eq).emit("panCancel",e)}}};return[n,r]}(n.isNavigationEnabledFn))}(e,y,n,s),g&&function(e,t,n,r){const i=rq.getAxisDock(n,r.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=Lx(o,hq.LAYOUTSETTINGS.refLines);let s={key:`ref-line-labels-${Qw()}`,require:["renderer","chart"],dock:rq.getOppositeAxisDock(n,r.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,r=this.chart.formatter({data:e.settings.scales.measure.data}),i=s.lines.y.map(e=>{const n=!1!==e.label.showValue?`(${r(e.value)})`:"",i=`${e.label.text} ${n}`,o=e.label.text&&n?` ${n}`:n;return{wanted:t({text:i,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}}),o=i[0];for(let e=1;e<i.length;e++)i[e].wanted>o.wanted&&(o.wanted=i[e].wanted),i[e].required>o.required&&(o.required=i[e].required);const a=12;return o.required+a>100?o.required+a:Math.min(o.wanted+a,100)},lines:{x:[],y:[]}};s=Lx(s,hq.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach(r=>{if(!r.show)return;const a=r.refLineExpr&&r.refLineExpr.value,l=Lx(!0,{},t,{paletteColor:r.paletteColor,style:r.style,chartID:e.options.chartID}),c=uq.lineSettings({scale:"measure",dir:n,value:a},l);o.lines[n].push(c);const u=uq.lineLabelSettings({scale:"measure",value:a,label:{text:!1!==r.showLabel?r.label:"",showValue:!1!==r.showValue}},l);"x"===n?u.label.vAlign="near"===i?1:0:u.label.align="near"===i?0:1,s.lines[n].push(u)}),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",s,{})}(e,n,a,r),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",hq.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeDim"};o=Lx(o,hq.LAYOUTSETTINGS.rangeDim);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:r,isRtl:i};e.addComponent("range",o,s)}(e,n.dimRange||{},s,mq(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMeasure"};o=Lx(o,hq.LAYOUTSETTINGS.rangeMeasure);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:r,isRtl:i};e.addComponent("range",o,s)}(e,n.measureRange||{},s,pq(n,a).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMinor"};o=Lx(o,hq.LAYOUTSETTINGS.rangeMinor);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushData:t.brushData,brushArea:t.brushArea,brushComponents:t.brushComponents,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:"measure"===t.brushScale?n:!n,dock:r,isRtl:i,chartInstance:t.chartInstance};e.addComponent("range-area",o,s)}(e,n.areaRange||{},s,mq(n,l).dock,n.isRtl)}n.brushActions&&fq(y,n.brushActions),y.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,y)}function fq(e,t){t.forEach(t=>{e.push(t)})}function pq(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function mq(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function gq(e,t){const n=t||{},r=!n.orientation||"horizontal"===n.orientation,i=!!n.isRtl,o={name:n.name||"scale",component:{invert:r&&i,minorTicks:{count:1},range:n.range||void 0,domain:n.domain||void 0,trackBy:n.trackBy||"id"}};return Lx(!0,{},o,e||{})}function yq(e){var t;if(null!=e&&null!==(t=e.isEnabled)&&void 0!==t&&t.call(e,"IM_5791_SVG_LABEL_RENDERING"))return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}function vq(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.line.major","color"),a=t.theme.getStyle(n,"axis.title","fontSize"),l=t.theme.getStyle(n,"axis.title","color"),c=t.theme.getStyle(n,"axis.label.name","color"),u=t.theme.getStyle(n,"axis.label.name","fontSize"),h=t.theme.getStyle(n,"axis.title","fontFamily"),d=t.theme.getStyle(n,"axis.label.name","fontFamily"),f={key:"axis",type:"axis",renderer:yq(t.flags),dock:rq.getAxisDock(i,r,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:a,fontFamily:h,fill:l},line:{show:!0,strokeWidth:1,stroke:s},labels:{fill:c,fontSize:u,fontFamily:d,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:s},minorTicks:{stroke:s}}},p=Lx(!0,{},f,e||{});return p.brush.consume.forEach(e=>{e.style.active.strokeWidth=0}),p}function bq(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.title","fontSize"),a=t.theme.getStyle(n,"axis.title","color"),l=t.theme.getStyle(n,"axis.title","fontFamily"),c={key:"text",type:"text",dock:rq.getAxisDock(i,r,o)||"bottom",displayOrder:0,style:{text:{fontSize:s,fontFamily:l,fill:a}}};return Lx(!0,{},c,e||{})}gq.measureScale=function(e,t){let n=(t||{}).source||[];"string"==typeof n&&(n=[n]);const r={name:"measure",component:{expand:.1,data:{fields:n.map(e=>({field:e}))}}},i=t&&t.measureAxisProperties;i&&!i.autoMinMax&&(["min","minMax"].includes(i.minMax)&&(r.component.min=i.min),["max","minMax"].includes(i.minMax)&&(r.component.max=i.max));const o=gq(Lx(!0,r,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},gq.dimensionScale=function(e,t){const n={name:"dimension",component:{trackBy:"id",type:"band",data:{extract:{field:t&&t.source||"",props:{label:e=>e.qText||""}}},label:e=>e.datum.label.value}};return gq(Lx(!0,n,e||{}),t)},vq.xAxis=function(e,t){return vq(Lx(!0,{key:"x-axis",scale:"x"},e||{}),t)},vq.yAxis=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis",scale:"y",dock:rq.getYAxisDock(n,r)};return vq(Lx(!0,i,e||{}),t)},bq.xAxisTitle=function(e,t){return bq(Lx(!0,{key:"x-axis-title"},e||{}),t)},bq.yAxisTitle=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis-title",dock:rq.getYAxisDock(n,r)||"left"};return bq(Lx(!0,i,e||{}),t)};var xq={getBublesAlign:function(e,t,n){let r=e&&"far"!==t||!e&&"far"===t;return!e&&n&&(r=!r),r?"start":"end"},getDock:function(e,t){const n=[];let r;return e&&n.push(`@${e}`),t&&n.push(`@${t}`),n.length&&(r=n.join(",")),r}};const wq={SPARK:{width:0,height:0},XSMALL:{width:150,height:75},SMALL:{width:300,height:150},MEDIUM:{width:400,height:220},FULL:{width:550,height:450}};function qq(){return wq}function Mq(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}qq.getLayoutModeKeys=function(){const e=[];let t;for(t in wq)e.push(t);return e};const Sq={left:"left",right:"right",up:"top",down:"bottom"};function Dq(e,t,n){switch(e){case"scale":return gq(t,n);case"measure-scale":return gq.measureScale(t,n);case"dimension-scale":return gq.dimensionScale(t,n);case"axis":return vq(t,n);case"box-marker":return function(e){return Lx(!0,{},{key:"box-marker",type:"box-marker",settings:{minor:{scale:"x"},orientation:"horizontal"},brush:{trigger:[],consume:[]}},e||{})}(t);case"point-marker":return function(e){return Lx(!0,{},{key:"point-marker",type:"point-marker",settings:{},brush:{trigger:[],consume:[]}},e||{})}(t);case"scrollbar":return function(e,t){const n=t&&t.isRtl,r=t&&t.chartID,i=t&&t.isHorizontal,o={key:"scrollbar",type:"scrollbar",scroll:"dimension",dock:i?"bottom":n?"left":"right",settings:{backgroundColor:t.theme.getStyle(r,"","backgroundColor"),invert:n&&i}};return Lx(!0,{},o,e||{})}(t,n);case"text":return bq(t,n);case"lasso":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushComponents?t.brushComponents:[],i=t&&t.brushData?t.brushData:["elemNo"],o={type:"brush-lasso",key:"lasso",displayOrder:99,settings:{brush:{components:[]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"rgba(102,102,102,1)",strokeWidth:2,opacity:1,strokeDasharray:null},startPoint:{r:10,fill:"rgba(0, 152, 69, 1)",strokeWidth:0,opacity:1}}};return r.forEach(e=>{o.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:i})}),Lx(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushArea,o=t&&t.brushScale,s=t&&t.isHorizontal,a=t&&t.dock,l=t&&t.isRtl,c={type:"brush-range",key:"range",displayOrder:99,dock:xq.getDock(r,i),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:s?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:xq.getBublesAlign(s,a,l)}}};return Lx(!0,{},c,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushComponents?t.brushComponents:[],o=t&&t.brushData?t.brushData:["elemNo"],s=t&&t.brushArea,a=t&&t.isHorizontal,l=t&&t.dock,c=t&&t.isRtl,u=t&&t.chartInstance;let h=!0;const d={type:"brush-area-dir",key:"area",displayOrder:99,dock:xq.getDock(r,s),settings:{brush:{components:[]},direction:a?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:xq.getBublesAlign(a,l,c),label:e=>h?(h=!1,u.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(h=!0,u.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return i.forEach(e=>{d.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})}),Lx(!0,{},d,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t&&t.dock||"auto";const o=t&&t.show;"auto"===i&&(i=t.chartHeight/t.chartWidth<1?r?"left":"right":"bottom");const s=t.theme.getStyle(n,"legend.title","color"),a=t.theme.getStyle(n,"legend.title","fontSize"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.title","fontFamily"),h=t.theme.getStyle(n,"legend.label","fontFamily"),d={key:"legend",type:"legend-cat",renderer:yq(t.flags),dock:i,show:o,scale:{type:"color"},settings:{title:{anchor:"middle"},layout:{direction:r?"rtl":"ltr",size:"top"===i||"bottom"===i?2:1,vertical:"top"===i||"bottom"===i?16:8},navigation:{button:{class:{"lui-fade-button":!0},content:(e,t)=>e("span",{style:{pointerEvents:"none"},class:["lui-button__icon","lui-icon",`lui-icon--triangle-${Sq[t.direction]}`].join(" ")})}}},style:{item:{label:{fontSize:c,fontFamily:h,fill:l,lineHeight:1,wordBreak:"break-word"},margin:{top:5,left:10,right:10,bottom:10},shape:{type:t.type?t.type:"square",size:3*parseInt(c,10)/4}},title:{show:t.showTitle,fontSize:a,fontFamily:u,fill:s}}};return Lx(!0,{},d,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t.dock||"auto";"auto"===i&&(i=t.chartHeight<t.chartWidth?r?"left":"right":"bottom");const o=t.theme.getStyle(n,"legend.title","color"),s=t.theme.getStyle(n,"legend.title","fontSize"),a=t.theme.getStyle(n,"legend.title","fontFamily"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.label","fontFamily");function h(e){switch(e){case"left":return 0;case"right":return 1;default:return.5}}const d={key:"seqlegend",type:"legend-seq",dock:i,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:h(r?"right":"left"),major:{invert:"left"===i||"right"===i||r},title:{show:t.showTitle,fontSize:s,fontFamily:a,fill:o},tick:{fill:l,fontSize:c,fontFamily:u}}};return Lx(!0,{},d,e)}(t,n);case"x-axis":return vq.xAxis(t,n);case"y-axis":return vq.yAxis(t,n);case"x-axis-title":return bq.xAxisTitle(t,n);case"y-axis-title":return bq.yAxisTitle(t,n);case"grid-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"grid.line.major","color");return Lx(!0,{},{displayOrder:-1,key:"grid-line",type:"grid-line",x:null,y:null,ticks:{stroke:r},minorTicks:{stroke:r}},e||{})}(t,n);case"interaction":return function(e,t){const n=t&&t.gestures||[];return Lx(!0,{},{type:"hammer",key:"hammered",gestures:n},e||{})}(t,n);case"ref-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"referenceLine.outOfBounds","color"),i=t.theme.getStyle(n,"referenceLine.outOfBounds","backgroundColor");return Lx(!0,{},{key:"ref-line",type:"ref-line",dock:"center",prioOrder:-1,lines:{x:[],y:[]},style:{oob:{width:7,fill:i,text:{fill:r},padding:{x:7,y:5}}}},e||{})}(t,n);case"event-area":return function(e){return Lx(!0,{},{type:"event-area",key:"event-area"},e||{})}(t);case"labels":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"label.value","color"),i=t.theme.getStyle(n,"label.value","fontSize"),o=t.theme.getStyle(n,"label.value","fontFamily"),s={key:"labels",type:"labels",renderer:yq(t.flags),displayOrder:1,settings:{sources:[{component:"box-marker",selector:"rect",strategy:{type:"bar",settings:{direction:"up",fontFamily:o,fontSize:parseFloat(i),align:.5,labels:[{placements:[{position:"outside",fill:r,justify:0},{position:"inside",fill:e&&e.settings.sources[0].strategy.settings.labels[0].placements[1].fill,justify:1}],label:Mq}]}}}]}};return Lx(!0,{},s,e||{})}(t,n);default:return}}function _q(e){this.options=e||{},this.settings={dockLayout:{layoutModes:qq()},components:[],scales:{}}}_q.prototype.addComponent=function(e,t,n){const r=Dq(e,t,Lx(!0,{},this.options,n||{}));return this.settings.components.push(r),r},_q.prototype.addInteraction=function(e,t){const n=Dq("interaction",e,Lx(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},_q.prototype.addScale=function(e,t,n){const r=Dq(e,t,Lx(!0,{},this.options,n||{}));this.settings.scales[r.name]=r.component},_q.prototype.getSettings=function(){return this.settings},_q.prototype.getComponent=function(e){return this.settings.components.filter(t=>t.key===e)[0]},_q.prototype.addPreset=function(e,t){!function(e,t,n){if("dimension-measure-chart"!==e)throw Error("There is no chart preset with that type");dq(t,n)}(e,this,t)},_q.validateComponentKeys=function(e){const t={};return e.map(e=>{const n=e.key;return n?t[n]?`Duplicate key for component ${e.type}`:(t[n]=!0,null):`Missing key for component ${e.type}`}).filter(e=>!!e)},_q.create=function(e){return new _q(e)},_q.createComponent=Dq;const kq={CENTER:0,BOTTOM:1};var Cq={DISCLAIMERS:[{label:"NoDataExist",alignment:kq.CENTER,default:!0},{label:"RequireNumericDimension",alignment:kq.CENTER,default:!1},{label:"OnlyNanData",alignment:kq.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:kq.CENTER,default:!1},{label:"LimitedData",alignment:kq.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:kq.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:kq.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:kq.BOTTOM,default:!1}],ALIGNMENT:kq};const Eq={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx===0,getLimitedDataAttribute(e,t){let n,r=!1;var i;return e?void 0!==t.explicitLimitedData?r=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?r=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(i=e.qStackedDataPages)&&i[0]&&i[0].qData[0]&&i[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,r=e.qDimensionInfo.length>=n?e.qStackedDataPages[0].qData[0].qSubNodes.some(e=>e.qDown>0):e.qStackedDataPages[0].qData[0].qSubNodes.length<e.qStackedDataPages[0].qArea.qHeight):r=!0===t.explicitLimitedData,r},getNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.some(e=>e.qMin<=0),getOnlyNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.every(e=>e.qMax<=0&&e.qMax>=e.qMin)||0===e.qSize.qcy,getOnlyNanDataAttribute:(e,t)=>void 0!==t.explicitOnlyNanData?t.explicitOnlyNanData:e.qMeasureInfo.every(e=>e.qMax<e.qMin||"NaN"===e.qMax),getDataRangeIncludingZeroAttribute:(e,t)=>!t.supportRangeOverZero&&function(e,t){const n=t.length;let r,i,o,s,a;for(e&&(i=!(e.autoMinMax||"min"!==e.minMax&&"minMax"!==e.minMax||null===e.min||Number.isNaN(+e.min)),o=!(e.autoMinMax||"max"!==e.minMax&&"minMax"!==e.minMax||null===e.max||Number.isNaN(+e.max))),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,r=0;r<n;r++)if(s=Math.min(s,t[r].qMin),a=Math.max(a,t[r].qMax),s<=0&&a>=0)return!0;return s=i?e.min:s,a=o?e.max:a,s<=0&&a>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},r={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,Cq.DISCLAIMERS.forEach(e=>{r[e.label]=!1}),t&&t.qHyperCube?(r.NoDataExist=this.getNoDataExistAttribute(t.qHyperCube),r.NoDataExist?r:(r.RequireNumericDimension=n.explicitRequireNumericDimension,r.RequireNumericDimension||(r.LimitedData=this.getLimitedDataAttribute(t.qHyperCube,n),r.NegativeOrZeroValues=this.getNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNegativeOrZeroValues=this.getOnlyNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNanData=this.getOnlyNanDataAttribute(t.qHyperCube,n),r.DataRangeIncludingZero=this.getDataRangeIncludingZeroAttribute(t,n)),r)):r}};function Aq(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function Tq(e,t){return e&&t&&t[e]}function Iq(e){this.environment=e,this.clear()}Aq.prototype.isValidAndSupported=function(e,t){return Tq(e.label,this.dataAttributes)&&(e.default||Tq(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},Aq.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach(r=>{n.isValidAndSupported(r,e)&&(t=!0)}),t},Aq.prototype.getMessage=function(e,t){let n="";const r=this;return t&&this.disclaimersConfig.forEach(i=>{r.isValidAndSupported(i,e)&&(n+=`${t.get(`Object.Disclaimer.${i.label}`)} `)}),n},Iq.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},Iq._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach(e=>{void 0===n[e.label]&&(n[e.label]=e.default)}),n},Iq.prototype.getComponentSettings=function(){var e;const{translator:t}=this.environment,n=Lx(!0,{},this.vizAttributes.supportedDisclaimers),r=new Aq(Cq.DISCLAIMERS,this.dataAttributes,n);let i,o;if(r.isAnyValidDisclaimer(Cq.ALIGNMENT.CENTER))i=r.getMessage(Cq.ALIGNMENT.CENTER,t),o="center";else{if(!r.isAnyValidDisclaimer(Cq.ALIGNMENT.BOTTOM))return;i=r.getMessage(Cq.ALIGNMENT.BOTTOM,t),o="bottom"}return{key:"disclaimer",type:"disclaimer",layout:{displayOrder:1e3,dock:o},settings:{label:i,rtl:"rtl"===(null===(e=this.environment)||void 0===e||null===(e=e.options)||void 0===e?void 0:e.direction)}}},Iq.prototype.set=function(e){if(this.clear(),!e)throw new Error(Iq.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=Eq.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},Iq.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const Nq=Vy.extend({init(e,t,n,r,i){this.$element=t,this.environment=n,this.backendApi=r,this._selectionsApi=i,this._on=!1,this._disclaimer=new Iq(n),this._dataPaths=["qHyperCube"];const o=this;this.picassoElement=t[0],this.picassoElement.className+=" picasso-chart",this.chartInstance=e.chart({element:this.picassoElement,settings:{components:[_q.createComponent("event-area",{mounted(e){o.dataAreaElem=e}})]}})},updateEnvironment(e){this.environment=e},isRtl(){var e;return"rtl"===(null===(e=this.environment.options)||void 0===e?void 0:e.direction)},setDataPaths(e){this._dataPaths=e},getData:(e,t,n)=>function(e,t,n){let r,i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,r=Math.floor(1e4/e);i={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,r):r}}else i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};r="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([i],null,t).then(e=>{t[r]=e})}(e,t,n),hasValidData:()=>!0,paint(){if(this.hasValidData()){var e;this._disclaimer.set(this.getDisclaimerAttributes(this.layout));const t=this._disclaimer.getComponentSettings(),n="center"===(null==t||null===(e=t.layout)||void 0===e?void 0:e.dock),r=this.createChartSettings(this.layout);n?r.components=[t]:t&&r.components.push(t),_q.validateComponentKeys(r.components).forEach(e=>{console.error(e)}),this.updateChart(this.layout,r),this._painted=!0}return Promise.resolve()},resize(){if(this.layout)return this.paint()},createChartSettings(){throw new Error('Subclass must implement "createChartSettings" function')},addSnapshotChartSettings(e,t){const{freeResize:n}=this.environment.options;!n&&t.snapshotData&&(e.dockLayout.logicalSize={width:t.snapshotData.content.size.w,height:t.snapshotData.content.size.h,preserveAspectRatio:!0})},updateData(e){return this._destroyed?Promise.reject():(this.layout=Lx(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){var r,i;const o=null!==(r=null===(i=this.environment.appLayout)||void 0===i?void 0:i.qLocaleInfo)&&void 0!==r?r:{},s=this._dataPaths.map(t=>({type:"q",key:t,config:{localeInfo:o},data:Py(e,t.replace(/\//g,"."))}));this.colorService&&s.push(...this.colorService.getData()),this.chartInstance.update({data:s,settings:t,partialData:n});this.picassoElement.setAttribute("data-state",2)},destroy(){this._destroyed=!0,this.off(),this.chartInstance.destroy()},getViewState:()=>({}),isLassoDisabled:()=>!0,setSnapshotData(e){e.snapshotData||(e.snapshotData={}),e.snapshotData.content={chartData:{},size:{w:this.$element.width(),h:this.$element.height()}}},getDisclaimerAttributes:e=>({data:e})});function Rq(e){let t=0;if(!e||!e.length)return t;for(let n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n),t&=t}return t}const Oq={generateHash:function(e){return Rq(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=Oq.generateHash(t)}};const Pq={getDefaultHashDataForHyperCube:function(e,t,n){return function(e,t){const n=[];if(!e.qMeasures)return Promise.resolve(n);return e.qMeasures.forEach(e=>{e.qLibraryId?n.push(function(e,t){return t.getMeasure(e).then(e=>e.getProperties().then(e=>e.qMeasure.qDef))}(e.qLibraryId,t)):n.push(Promise.resolve())}),Promise.all(n)}(e,n).then(e=>({drillLevel:Fq(t),dimensionExpressions:Lq(t),measureExpressions:e}))}};function Lq(e){return e.qDimensionInfo.map(e=>e.qGroupFieldDefs)}function Fq(e){const t=function(e){return Py(e,"qDimensionInfo",[])}(e);return t.map(e=>e.qGroupPos)}const jq={},zq=Lx.bind(null,!0);function Hq(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const Bq=Array.isArray,Vq=function(e){return void 0===e};function $q(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function Wq(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach((t,i)=>{i!==n.length&&(r=+t,e[r||t]=Vq(e[r||t])?Number.isNaN(+r)?{}:[]:e[t],e=e[r||t])}),e}function Uq(e,t){if(Hq(e)&&Hq(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!Uq(e[n],t[n]))return!1;return!0}if(Bq(e)&&Bq(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(!Uq(e[n],t[n]))return!1;return!0}return e===t}jq.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach(i=>{const o=function(e){return e&&(e=zq({},{val:e}).val),e}(t[i]),s=e[i],a=`${n}/${i}`;Uq(o,s)||$q(t,i)||(Vq(s)?r.push({op:"add",path:a,value:o}):Hq(o)&&Hq(s)?r=r.concat(jq.generate(s,o,a)):Bq(o)&&Bq(s)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o,s,a=-1;function l(e,t,n){if(e[n]&&Vq(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,r=e.length;n<r;n++)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(Uq(t,i))return r;if(null===t[0]||!Vq(t[0])&&Vq(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(o=i.length-1;o>=0;--o)a=l(t,i[o]&&i[o].qInfo&&i[o].qInfo.qId,o),-1===a?(r.push({op:"remove",path:`${n}/${o}`}),i.splice(o,1)):r=r.concat(jq.generate(i[o],t[a],`${n}/${o}`));for(o=0,s=t.length;o<s;++o)a=l(i,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===a?(r.push({op:"add",path:`${n}/${o}`,value:t[o]}),i.splice(o,0,t[o])):a!==o&&(r.push({op:"move",path:`${n}/${o}`,from:`${n}/${a}`}),i.splice(o,0,i.splice(a,1)[0]));return r}(s,o,a)):r.push({op:"replace",path:`${n}/${i}`,value:o}))}),Object.keys(e).forEach(i=>{Vq(t[i])&&!$q(e,i)&&r.push({op:"remove",path:`${n}/${i}`})}),r},jq.apply=function(e,t){t.forEach(t=>{const n=Wq(e,t.path);let r=t.path.split("/").splice(-1)[0];const i=r&&Number.isNaN(+r)?n[r]:n[+r]||n,o=t.from?t.from.split("/").splice(-1)[0]:null;if("add"===t.op||"replace"===t.op)if(Bq(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(Bq(i)&&Bq(t.value)){const e=t.value.slice();i.length=0,i.push.apply(i,e)}else Hq(i)&&Hq(t.value)?(s=i,Object.keys(s).forEach(e=>{Object.getOwnPropertyDescriptor(s,e).configurable&&!$q(s,e)&&delete s[e]}),zq(i,t.value)):n[r]=t.value;else if("move"===t.op){const i=Wq(e,t.from);Bq(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(Bq(n)?n.splice(+r,1):delete n[r]);var s})},jq.clone=function(e){return zq({},e)},jq.createPatch=function(e,t,n){const r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},jq.updateObject=function(e,t){Object.keys(e).length?jq.apply(e,jq.generate(e,t)):zq(e,t)};class Yq{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=jq.generate(e,t);return Lx(!0,e,t),n&&n.length?(n=n.map(e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path})),this._model.applyPatches(n,!0).then(()=>!0)):Promise.resolve(!1)}async mergeSoftPatches(){if(!this._model)return;const e=this._model.getProperties(),t=this._model.getEffectiveProperties(),n=await e,r=await t;if(n.qExtendsId)return;const i=jq.generate(n,r);jq.apply(n,i);const o=this;o._model.setProperties(n).then(()=>{o._model.clearSoftPatches()})}}var Kq={canModifyHardProperties:function(e){if(e.qHasSoftPatches||e.qExtendsId)return!1;if(e.permissions)return e.permissions.update;return-1!==e.qMeta.privileges.indexOf("update")}};var Xq={saveDerivedProperties:function(e,t,n,r){if(Kq.canModifyHardProperties(t))return e.setProperties(n);return new Yq(e).saveSoftProperties(r,n)}};var Gq={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function Jq(){this._generationInProgress=!1}function Zq(e){Gq.validate(e);const t=e.properties,n=Oq.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}Jq.prototype.isDerivedUpToDate=Zq,Jq.prototype.updateDerivedProperties=function(e){if(Gq.validate(e),this._generationInProgress)return Promise.resolve(!0);if(Zq(e)){const t=e.layout.qUndoExclude&&e.layout.qUndoExclude.hashCode===e.properties.qUndoExclude.hashCode;return Promise.resolve(!t)}const t=this,n=e.model,r=e.layout,i=Lx(!0,{},e.properties),o=Lx(!0,{},i);return this._generationInProgress=!0,Oq.updateHash(i,e.hashData),e.generateDerivedProperties(r,i).then(()=>Xq.saveDerivedProperties(n,r,i,o).then(()=>(t._generationInProgress=!1,Promise.resolve(!0))))},Jq.prototype.addDefaultHyperCubeHash=function(e,t,n,r){return Pq.getDefaultHashDataForHyperCube(e,t,n).then(e=>Lx(!0,r,e))};var Qq,eM={exports:{}};var tM=(Qq||(Qq=1,function(e){e.exports=function(){function e(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function r(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?n(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function i(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function o(e){var t=i(e,"string");return"symbol"==typeof t?t:t+""}var s=Object.prototype.hasOwnProperty,a=Object.prototype.toString,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===a.call(e)},h=function(e){if(!e||"[object Object]"!==a.call(e))return!1;var t,n=s.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&s.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||s.call(e,t)},d=function(e,t){l&&"__proto__"===t.name?l(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},f=function(e,t){if("__proto__"===t){if(!s.call(e,t))return;if(c)return c(e,t).value}return e[t]},p=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,p=!1;for("boolean"==typeof a&&(p=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=f(a,n),a!==(i=f(t,n))&&(p&&i&&(h(i)||(o=u(i)))?(o?(o=!1,s=r&&u(r)?r:[]):s=r&&h(r)?r:{},d(a,{name:n,newValue:e(p,s,i)})):void 0!==i&&d(a,{name:n,newValue:i}));return a};function m(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=i.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map(e=>e.instance).indexOf(e),a=i.wrappedFields[t].attrExps.map(e=>e.instance).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(r)&&r.some((e,t)=>e!==t)){const e=r.indexOf(s);-1!==e&&(s=e)}return s-=t.qArea.qLeft,s<0||s>=t.qArea.qWidth?-1:l>=0?e=>e[s].qAttrDims.qValues[l]:a>=0?e=>e[s].qAttrExps.qValues[a]:e=>e[s]}function g(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function y(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:s,row:a,sourceKey:l,target:c,targetProp:u,columnOrder:h}=e,d=r;if(i.field&&i.field!==n){const e=m(i.field,o,{cache:t},h);if(-1===e)return;d=p({qRow:s},e(a))}c[u]=g(i,d,{key:l})}function v(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const s=t.raw(),a=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:c,main:u}=r.normalizeConfig(i[e],t),h=Object.keys(c),d=!!i[e].trackBy,f=typeof i[e].trackBy,v={},b=[],x=[];for(let t=0;t<s.qDataPages.length;t++){const o=m(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let m=0;m<s.qDataPages[t].qMatrix.length;m++){const w=s.qDataPages[t].qArea.qTop+m,q=p({qRow:w},o(s.qDataPages[t].qMatrix[m])),M=g(u,q,{key:a});if(!u.filter||u.filter(q)){for(let e=0;e<h.length;e++){const r=c[h[e]];let i=r.fields||[r];r.fields&&(M[h[e]]=[]);for(let o=0;o<i.length;o++)y({cache:n,f:l,mainCell:q,p:i[o],prop:h[e],page:s.qDataPages[t],rowIdx:w,row:s.qDataPages[t].qMatrix[m],sourceKey:a,target:r.fields?M[h[e]]:M,targetProp:r.fields?o:h[e],columnOrder:s.qColumnOrder});if(r.fields){const t=M[h[e]].map(e=>e.value),n=M[h[e]].map(e=>e.label);M[h[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(M[h[e]].value)}}}d&&r.track({cfg:i[e],itemData:q,obj:M,target:b,tracker:v,trackType:f}),x.push(M)}}}const w=d?r.collect(b,{main:u,propsArr:h,props:c}):x;o=[...o,...w]}return o}function b(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function x(){return this.eachAfter(b)}function w(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function q(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this}function M(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this}function S(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function D(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function _(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function k(e){for(var t=this,n=C(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function C(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function E(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function A(){return Array.from(this)}function T(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function I(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*N(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}function R(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=L)):void 0===t&&(t=P);for(var n,r,i,o,s,a=new z(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new z(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(j)}function O(){return R(this).eachBefore(F)}function P(e){return e.children}function L(e){return Array.isArray(e)?e[1]:null}function F(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function j(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function z(e){this.data=e,this.depth=this.height=0,this.parent=null}function H(e){return null==e?null:B(e)}function B(e){if("function"!=typeof e)throw new Error;return e}z.prototype=R.prototype={constructor:z,count:x,each:w,eachAfter:M,eachBefore:q,find:S,sum:D,sort:_,path:k,ancestors:E,descendants:A,leaves:T,links:I,copy:O,[Symbol.iterator]:N};var V={depth:-1},$={},W={};function U(e){return e.id}function Y(e){return e.parentId}function K(){var e,t=U,n=Y;function r(r){var i,o,s,a,l,c,u,h,d=Array.from(r),f=t,p=n,m=new Map;if(null!=e){const t=d.map((t,n)=>X(e(t,n,r))),n=t.map(G),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(G(e)),d.push(W));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,i=d.length;s<i;++s)o=d[s],c=d[s]=new z(o),null!=(u=f(o,s,r))&&(u+="")&&(h=c.id=u,m.set(h,m.has(h)?$:c)),null!=(u=p(o,s,r))&&(u+="")&&(c.parent=u);for(s=0;s<i;++s)if(u=(c=d[s]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===$)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===W&&1===a.children.length;)a=a.children[0],--i;for(let e=d.length-1;e>=0&&(c=d[e]).data===W;--e)c.data=null}if(a.parent=V,a.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(j),a.parent=null,i>0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=H(e),r):t},r.parentId=function(e){return arguments.length?(n=H(e),r):n},r.path=function(t){return arguments.length?(e=H(t),r):e},r}function X(e){let t=(e=`${e}`).length;return J(e,t-1)&&!J(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}function G(e){let t=e.length;if(t<2)return"";for(;--t>1&&!J(e,t););return e.slice(0,t)}function J(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function Z(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=Z(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=Z(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function Q(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...Q(e[i].children,t-1,n)]);return r}function ee(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const r=Math.max(0,Math.min(100,t-e));return e=>Q(e.children,r-1,n)}return!1}function te(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}const ne=/^qDimensionInfo(?:\/(\d+))?/,re=/^\/?qMeasureInfo\/(\d+)/,ie=/\/qAttrExprInfo\/(\d+)/,oe=/\/qAttrDimInfo\/(\d+)/;function se(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}function ae(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function le(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,s=-1,a=-1,l=-1,c=-1,u=-1,h=r;const d=n.qEffectiveInterColumnSortOrder,f=ae(n);return ne.test(h)&&(i=!0,o=+ne.exec(h)[1],h=r.replace(ne,"")),re.test(h)&&("K"===n.qMode?c=+re.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+re.exec(h)[1],u=0):u=+re.exec(h)[1],h=h.replace(re,"")),h&&(oe.exec(h)?a=+oe.exec(h)[1]:ie.exec(h)&&(s=+ie.exec(h)[1])),l=i?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function ce(e,t){let n,r,i=ee(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function ue(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function he(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,m,g,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,r)),"function"==typeof h.label&&(f=e=>h.label(e,r)),h.accessor?(m=h.accessor(r),Array.isArray(m)?(g=m.map(h.valueAccessor),h.attrAccessor&&(g=g.map(h.attrAccessor)),d&&(p=g.map(d),d=null),f&&(y=g.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(m)):h.valueAccessor(m),y=p)):(p=i,y=i)),a.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,r):c,label:"function"==typeof a.label?a.label(u,r):u})}}const de=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=Z(r,e);return o&&o[0]?(t.tree=R(o[0],n.children||(e=>e[i])),t.tree):null};function fe(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=se(e),i=e.fields(),o=e.fields().filter(e=>"dimension"===e.type()).map(e=>n.indexOf(i.indexOf(e))),s=e.fields().filter(e=>"measure"===e.type()).map(e=>n.indexOf(i.indexOf(e))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let i="__root",c=!1;for(let e=0;e<o.length;e++){var l;const t=n[o[e]],s="".concat(i,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);a[s]||(a[s]=r({__id:s,__parent:i,qValues:[]},t),c=!0),i=s}if(c)for(let e=0;e<s.length;e++){const t=n[s[e]];a[i].qValues.push(t)}}const c=Object.keys(a).map(e=>a[e]);return K().id(e=>e.__id).parentId(e=>e.__parent)(c)}const pe=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:s}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],a=i.fields?i.fields:[i];for(let e=0;e<a.length;e++){const t=a[e];if(t.field!==s){const e=ce(o,le(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function me(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const o=t.raw(),s=t.key(),a="S"===o.qMode?fe(t):de(o,n,e);if(!a)return null;const l=a.height,c=[];for(let s=0;s<=l;s++){let a=null;if(s>0)if("S"===o.qMode){let e=ae(o)[s-1];a=n.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[s-1];s>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),a=n.fields[e]}const{props:l,main:u}=i.normalizeConfig(r(r({},e),{},{field:a?a.key():void 0}),t),h=Object.keys(l);c[s]={propsArr:h,props:l,main:u};const d=a?le(a,{cube:o}):{fieldDepth:0};pe({propsArr:h,props:l,cube:o,cache:n,itemDepthObject:d,f:a})}const u=a.copy().descendants(),h=a.descendants();for(let e=0;e<h.length;e++){const t=c[h[e].depth].propsArr,n=c[h[e].depth].props,r=c[h[e].depth].main,i=u[e],o=i.data,a=ue(r,o,{key:s});he({propsArr:t,props:n,item:i,itemData:o,ret:a,sourceKey:s}),h[e].data=a}return a}function ge(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<i.length;s++)if(void 0!==i[s].field){const a=t.raw(),l=t.key();if(!de(a,n,e))continue;const c="object"==typeof i[s].field?i[s].field:t.field(i[s].field),{props:u,main:h}=r.normalizeConfig(i[s],t),d=Object.keys(u),f=le(c,{cube:a}),{nodeFn:p,attrFn:m,valueFn:g}=ce({fieldDepth:0},f);pe({propsArr:d,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!i[s].trackBy,v=typeof i[s].trackBy,b={},x=[],w=p(n.tree),q=[];for(let e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(h.filter&&!h.filter(n))continue;const o=ue(h,n,{key:l});he({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[s],itemData:n,obj:o,target:x,tracker:b,trackType:v}),q.push(o)}const M=y?r.collect(x,{main:h,propsArr:d,props:u}):q;o=[...o,...M]}return o}function ye(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self;var ve=ye(function(e){
|
|
26
|
+
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(h=t[0]).length%l,d=h.length,b=0;b<d;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},vx({exports:{}});const Cx=["altLabel","auto","autoMinMax","byDimDef","byMeasureDef","dimensionScheme","expressionIsColor","expressionLabel","measureMax","measureMin","measureScheme","mode","paletteColor","persistent","reverseScheme","useBaseColors","useDimColVal"];function Ex(e,t,n){for(let r=0;r<n.length;++r){const i=n[r];void 0!==e[i]&&(t[i]=e[i],delete e[i])}}var Ax={importColors:function(e){e.color.point=e.color.point||{},Ex(e.color,e.color.point,Cx),e.color.colorExpression&&(e.color.point.expression={qValueExpression:{qExpr:e.color.colorExpression}},delete e.color.colorExpression),e.color.point.expressionIsColor=!0},exportColors:function(e){Ex(e.color.point,e.color,Cx),e.color.colorExpression=yx(e,"color.point.expression.qValueExpression.qExpr",""),delete e.color.point.expression}};function Tx({dataDefinition:e,defaultPropertyValues:t,exportFormat:n,initialProperties:r}){const i=uv.axisChart.importProperties({exportFormat:n,initialProperties:r,dataDefinition:e,defaultPropertyValues:t}),o=i.qProperty;return 3===o.qHyperCubeDef.qInterColumnSortOrder.length&&(o.qHyperCubeDef.qInterColumnSortOrder=[1,2,0]),Ax.importColors(o),o.qHyperCubeDef.qAlwaysFullyExpanded=!0,i}function Ix({propertyTree:e,viewDataMode:t}){const n=uv.axisChart.exportProperties({propertyTree:e,viewDataMode:t});return Ax.exportColors(e.qProperty),n}var Nx,Rx,Ox=e=>{const t=sv(e);return{properties:rv,data:{targets:[t]},importProperties:({exportFormat:e,initialProperties:n})=>Tx({dataDefinition:t,exportFormat:e,initialProperties:n}),exportProperties:Ix}};var Px=function(){if(Rx)return Nx;Rx=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},s=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},a=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return Nx=function e(){var t,n,r,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=a(h,n),h!==(l=a(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},s(h,{name:n,newValue:e(p,u,l)})):void 0!==l&&s(h,{name:n,newValue:l}));return h},Nx}(),Lx=n(Px);const Fx={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const jx={replaceExpressionTokens:function(e,t,n){const r={start:n&&n.start||"{{",end:n&&n.end||"}}"};let i,o,s=e;for(const e in t)i=t[e],o=r.start+e+r.end,s=s.replace(zx(o,!0),i);return s},createRegExp:zx};function zx(e,t,n){const r=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const i=n?`(${r})`:r;return t?new RegExp(i,"g"):new RegExp(i)}const Hx={generateExpression:function(e,t){const n={};if(t)for(const e in t){const r=t[e],i=r.wrap?Fx.wrapExpression(r.value):r.value;n[e]=i;(r.variations||[]).forEach(t=>{const r=Bx(t,i,e);n[t]=r})}return jx.replaceExpressionTokens(e,n)}};function Bx(e,t,n){if(""===t)return"";const r=jx.createRegExp(n,!0,!0),i=e.split(r);let o="";return i.forEach(e=>{o+=e!==n?e:t}),o}const Vx={generateHyperCubeDef:function(e,t,n,r,i){return function(e,t,n,r){const i={};let o,s;const a=[];let l;e.forEach(e=>{o=Kx(e.match(Yx("Dim"))),o.forEach(e=>{a.push($x(t.qDimensions[e],r,e,n).then(t=>{i[`Dim[${e}]`]={value:t,wrap:!0}}))}),s=Kx(e.match(Yx("Mea"))),s.forEach(e=>{a.push(Wx(t.qMeasures[e],r).then(t=>{i[`Mea[${e}]`]={value:t}}))})}),l=a.length?Promise.all(a).then(()=>Promise.resolve(i)):Promise.resolve(i);return l}(e.dimensions.concat(e.measures),t,n,r).then(n=>{const r=Lx({},n,i),o=Lx(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach(e=>{o.qDimensions.push({qDef:{qFieldDefs:[`=${Hx.generateExpression(e,r)}`]}})}),e.measures.forEach(e=>{o.qMeasures.push({qDef:{qDef:Hx.generateExpression(e,r)}})}),o})},getAllHyperCubeExpressions:async function(e,t,n){const r=e.qDimensions.map((e,r)=>$x(e,n,r,t)),i=e.qMeasures.map(e=>Wx(e,n));return{dimensions:await Promise.all(r),measures:await Promise.all(i)}}};function $x(e,t,n,r){if(e.qLibraryId)return Ux(e.qLibraryId,"dimension",t,n,r);const i=r.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[i])}function Wx(e,t){return e.qLibraryId?Ux(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function Ux(e,t,n,r,i){if(!n)return console.warn("No app provided, returning library id"),e;return n["dimension"===t?"getDimension":"getMeasure"](e).then(e=>e.getProperties().then(e=>"dimension"===t?e.qDim.qFieldDefs[i.qDimensionInfo[r].qGroupPos]:e.qMeasure.qDef))}function Yx(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function Kx(e){return e?e.map(e=>e.substr(6,1)):[]}function Xx(e){return e=e||function(){return!1},{get(t){const n=e()?-1:1;switch(t("integer")*n){case-1:return"descending";case 1:return"ascending";default:return"disabled"}},set(t,n){const r=e();switch(t){case"descending":n("integer",r?1:-1);break;case"ascending":n("integer",r?-1:1);break;case"disabled":n("integer",0);break;default:n("integer",void 0)}}}}var Gx={booleanConvertFunctions:function(e,t){return e=e||function(){return!1},t=t||1,{get:e=>!!e("integer"),set(n,r){if(n){let n=e()?-1:1;n*=t,r("integer",n)}else r("integer",0)}}},enumConvertFunctions:Xx,invertedEnumConvertFunctions:function(e){return Xx(function(){return!e||!e()})}};const Jx=[{value:"ascending",translation:"properties.sorting.ascending"},{value:"descending",translation:"properties.sorting.descending"}];function Zx(e,t,n){return{type:"items",items:{toggled:{type:"boolean",ref:e,translation:t,convertFunctions:n.toggled},order:{type:"string",component:"dropdown",ref:e,options:Jx,convertFunctions:n.sorting,show:t=>0!==Py(t,e,0)}}}}var Qx={state:function(e,t){return Zx(e=e||"qSortByState","properties.sorting.sortByState",{toggled:Gx.booleanConvertFunctions(t),sorting:Gx.invertedEnumConvertFunctions(t)})},ascii:function(e,t){return Zx(e=e||"qSortByAscii","properties.sorting.sortByAlphabetic",{toggled:Gx.booleanConvertFunctions(t),sorting:Gx.enumConvertFunctions(t)})},numeric:function(e,t){return Zx(e=e||"qSortByNumeric","properties.sorting.sortByNumeric",{toggled:Gx.booleanConvertFunctions(t,-1),sorting:Gx.enumConvertFunctions(t)})},expression:function(e,t){e=e||"qSortByExpression";const n={toggled:Gx.booleanConvertFunctions(t),sorting:Gx.enumConvertFunctions(t)},r=Zx(e,"properties.sorting.sortByExpression",n);return r.items.expression={type:"number",component:"expression",expressionType:"ValueExpr",ref:"qExpression",translation:"Common.Expression",defaultValue:"",show:t=>0!==Py(t,e,0)},r},frequency:function(e,t){return Zx(e=e||"qSortByFrequency","properties.sorting.sortByFrequency",{toggled:Gx.booleanConvertFunctions(t),sorting:Gx.invertedEnumConvertFunctions(t)})}};const ew=(e,t)=>(t.components||[]).find(t=>t.key===e),tw=(e,t,n)=>{const r=ew("axis",n)?.axis;return{text:{fontFamily:r?.title?.fontFamily||t.getStyle(e,"axis.title","fontFamily"),fontSize:r?.title?.fontSize||t.getStyle(e,"axis.title","fontSize"),fill:r?.title?.fontColor?.color||t.getStyle(e,"axis.title","color")}}},nw=(e,t,n)=>{const r=ew("axis",n)?.axis;return{labels:{fontFamily:r?.label?.name?.fontFamily||t.getStyle(e,"axis.label.name","fontFamily"),fontSize:r?.label?.name?.fontSize||t.getStyle(e,"axis.label.name","fontSize"),fill:r?.label?.name?.fontColor?.color||t.getStyle(e,"axis.label.name","color")}}},rw=(e,t,n,r)=>{const i=r.isEnabled("CLIENT_IM_3051")?ew("legend",n)?.legend:{};return{fontFamily:i?.title?.fontFamily||t.getStyle(e,"legend.title","fontFamily"),fontSize:i?.title?.fontSize||t.getStyle(e,"legend.title","fontSize"),color:i?.title?.fontColor?.color||t.getStyle(e,"legend.title","color")}},iw=(e,t,n,r)=>{const i=r.isEnabled("CLIENT_IM_3051")?ew("legend",n)?.legend:{};return{fontFamily:i?.label?.fontFamily||t.getStyle(e,"legend.label","fontFamily"),fontSize:i?.label?.fontSize||t.getStyle(e,"legend.label","fontSize"),color:i?.label?.fontColor?.color||t.getStyle(e,"legend.label","color")}},ow={DATA_PATH:"qUndoExclude",HYPERCUBE_DEF_PATH:"qHyperCubeDef",HYPERCUBE_PATH:"qHyperCube",CHART_ID:"object.distributionPlot",AUTO_SORT:"sorting.autoSort",SORT_CRITERIA:"sorting.sortCriteria",SORTING_ELEMENT_ID:"sorting.elementId",SORTING_ELEMENT_MIN_ID:"distplot-exp-min",SORTING_ELEMENT_MAX_ID:"distplot-exp-max",SORTING_EXPRESSION:"sorting.expression",MAX_GLYPH_COUNT:20,MAX_STACKED_VALUES:3e3,HORIZONTAL:"horizontal",BOX_PADDING:2,POINT_BANDWIDTH_BASE_RATIO:.35,MAX_POINT_BASE_SIZE_PX:34,MIN_POINT_PIXELS:5,JITTER_PARAMETER:3,BUBBLE_SCALES_MAX:100};function sw(e){return e.qHyperCubeDef&&e.qHyperCubeDef.qDimensions.length>1||e.qHyperCube&&e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1}Object.freeze(ow);const aw={hasMultipleDimensions:sw,getOuterDimensionCardinality:function(e){const t=yx(e,ow.HYPERCUBE_PATH);return sw(e)?t&&t.qDimensionInfo[1].qCardinal:1},isAutoSort:function(e){return yx(e,ow.AUTO_SORT,!1)},isSortByExpression:function(e){return 0!==yx(e,`${ow.SORT_CRITERIA}.sortByExpression`,0)},isSortByNumeric:function(e){return 0!==yx(e,`${ow.SORT_CRITERIA}.sortByNumeric`,0)},isSortByAscii:function(e){return 0!==yx(e,`${ow.SORT_CRITERIA}.sortByAscii`,0)}},lw={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};var cw={create(e,t){if(!e||!lw[e])throw new Error("Attribute Expressions Util: ID required");const n={};return t&&Object.keys(t).forEach(e=>{n[e]=t[e]}),n.id=e,n.qAttribute=!0,n},getById:(e,t,n)=>!!e&&(n=n||"id",e.filter(e=>e[n]===t)[0]),getIndexById(e,t,n){let r=-1;return e&&(n=n||"id",e.forEach((e,i)=>{e[n]===t&&(r=i)})),r},moveById(e,t,n,r){const i=this.getIndexById(e,n,r);t=t||[];const o=this.getIndexById(t,n,r);if(-1!==i&&-1===o){const n=e.splice(i,1);t.push(n[0])}return t},moveAllById(e,t,n,r){const i=e.filter(e=>e.id===n),o=t.filter(e=>e.id===n),s=i.filter(e=>!(o.filter(t=>t[r]===e[r]).length>0));return[...t,...s]},moveByIdFromGroup(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(let o=0;o<e.length;o++){const s=e[o][n],a=t.length;if(this.moveById(s,t,r,i),a!==t.length)return t}return t},clean:e=>e.filter(e=>e&&e.id),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"}};var uw={getColorByDefinition:function(e,t,n){const r={};let i,o,s;if("dimension"!==e)throw new Error("Default-property-logic.js: getColorByDefinition: Illegal input");return n.qLibraryId?(r.type="dimension",r.name=n.qLibraryId,r.id=n.qLibraryId):(r.type="field",t?(r.name=n.label||n.qDef,r.id=n.qDef):(i=n.qDef,o=!!i.qLabelExpression,s=i.qFieldLabels&&i.qFieldLabels[0],r.name=i.qFieldDefs[0],r.label=o?i.qLabelExpression:s?i.qFieldLabels[0]:i.qFieldDefs[0])),r}};var hw={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0},useLocalFormat:function(e){e.qNumFormat=e.quarantine?.qNumFormat||{},e.isCustomFormatted=e.quarantine?.isCustomFormatted||!1,e.quarantine=void 0},isUsingMasterNumberFormat:function(e){return!!e?.quarantine?.qNumFormat??!1}};const dw=["scatterplot","map"],fw=["map"];var pw={baseColor:{isSupported:e=>e&&e.length&&-1===dw.indexOf(e),isDimSupported:e=>e&&e.length&&-1!==fw.indexOf(e)},colorBy:{},colorByUpdater(e,t,n,r){this.updateColorDef(e,r,n),this.updateHypercubeAttributes(e,t,n)},updateColorDef(e,t,n){const r=Py(n,"mode"),i=Py(n,"auto"),o=Py(e,`${t}qDimensions`,[]),s=Py(e,`${t}qMeasures`,[]);let a,l,c,u;if(!i&&"byDimension"===r&&o.length)a=Py(n,"byDimDef"),a&&xw(n,a.label),a&&a.activeDimensionIndex>-1?(a.activeDimensionIndex=Math.min(a.activeDimensionIndex,o.length-1),l=o[a.activeDimensionIndex],u=uw.getColorByDefinition("dimension",!1,l),u.activeDimensionIndex=a.activeDimensionIndex,vw(n,u)):a&&a.key||(l=o[o.length-1],c=cw.getById(l.qAttributeDimensions,cw.IDMAP.COLOR_BY_ALTERNATIVE),vw(n,uw.getColorByDefinition("dimension",!!c,c||l)));else{if(!i&&"byMeasure"===r&&o.length)throw new Error("not suported in any 444-chart");"byMultiple"===r&&s.length<2&&Fy(n,"mode","primary")}},updateHypercubeAttributes(e,t,n){const r=Py(n,"mode"),i=Py(n,"auto"),o=Py(e,`${t}qDimensions`,[]),s=Py(e,`${t}qMeasures`,[]),a=Py(e,`${t}qLayoutExclude.qHyperCubeDef.qDimensions`,[]);!i&&"byDimension"===r&&o.length?bw(n,!0,o,a,s,Py(n,"byDimDef.label")):!i&&"byMeasure"===r&&o.length?bw(n,!1,o,a,s,Py(n,"byMeasureDef.label")):mw(o,a)},setColorByPropertyDef:vw,resolveColorByPropertyDef:bw,clearColorByItem:mw};function mw(e,t){e.forEach(e=>{gw(e,cw.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),gw(e,cw.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")}),t.forEach(e=>{gw(e,cw.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeDimensions"),gw(e,cw.IDMAP.COLOR_BY_ALTERNATIVE,"qAttributeExpressions")})}function gw(e,t,n){if(e[n]){const r=cw.getIndexById(e[n],t);r>=0&&e[n].splice(r,1)}else e[n]=[]}function yw(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?`[${e}]`:e}function vw(e,t,n,r){const i=n?"expression":t.type;let o=e.mode;switch(xw(e,t.label||t.name||""),i){case"field":o="byDimension",e.byDimDef={label:t.label||yw(t.name),key:yw(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":o="byMeasure",e.byMeasureDef={label:n||t.label||t.name,key:n||t.name,type:"expression"};break;case"dimension":o="byDimension",e.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":o="byMeasure",e.byMeasureDef={label:t.name,key:t.id,type:"libraryItem"},e.formatting&&hw.useMasterNumberFormat(e.formatting)}r||(e.auto=!1,e.mode=o)}function bw(e,t,n,r,i,o){mw(n,r);const s=n[n.length-1];if(s){const n=Py(e,t?"byDimDef":"byMeasureDef"),r=Py(e,"formatting.qNumFormat"),a=Py(e,"formatting.isCustomFormatted");if(n){const e=cw.create(cw.IDMAP.COLOR_BY_ALTERNATIVE);switch(n.type){case"expression":e.label=o||n.label,t?e.qDef=n.key:(e.qExpression=n.key,r&&(e.qNumFormat=r,e.isCustomFormatted=a)),e.label&&"="===e.label.charAt(0)&&(e.labelExpRef="color.altLabel");break;case"libraryItem":if(!t){let t=-1;i.forEach((e,r)=>{n.key===e.qLibraryId&&(t=r)}),e.matchMeasure=t,r&&(e.qNumFormat=r,e.isCustomFormatted=a)}e.qLibraryId=n.key,e.colorMapRef=n.key}t?(e.qSortBy={qSortByAscii:1},s.qAttributeDimensions.push(e)):s.qAttributeExpressions.push(e)}}}function xw(e,t){if(!t)return;const n="="===t.charAt(0);e.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}function ww(e){return!!e&&(e.coloring&&e.coloring.baseColor&&e.coloring.baseColor.color?e.coloring.baseColor:!(!e.baseColor||!e.baseColor.color)&&e.baseColor)}function qw(e){return"libraryItem"===yx(e,"color.point.byDimDef.type")}function Mw(e){return"libraryItem"===yx(e,"color.point.byMeasureDef.type")}function Sw(e){return!0===yx(e,"color.point.auto")}function Dw(e){return!Sw(e)&&"byDimension"===yx(e,"color.point.mode")}function _w(e){return!Sw(e)&&"byMeasure"===yx(e,"color.point.mode")}var kw={measuresHasBaseColors:function(e){return yx(e,"layout.qHyperCube.qMeasureInfo",[]).filter(e=>!!ww(e)).length>0},dimensionsHasBaseColors:function(e){return yx(e,"layout.qHyperCube.qDimensionInfo",[]).filter(e=>!!ww(e)).length>0},onGlobalChangeColors:function(e){pw.updateColorDef(e,"qHyperCubeDef.",e.color.point)},onChangeCalcCond:function(e){const t=e?.qHyperCubeDef,n=e?.qUndoExclude?.qHyperCubeDef;t&&n&&(n.qCalcCond=t.qCalcCond,n.qCalcCondition=t.qCalcCondition)},isColorByDimension:Dw,isColorByMeasure:_w,isColorAuto:Sw,isColorByExpression:function(e){return!Sw(e)&&"byExpression"===yx(e,"color.point.mode")},isColorBySingle:function(e){return!Sw(e)&&"primary"===yx(e,"color.point.mode","primary")},isDimensionLibraryItem:qw,isMeasureLibraryItem:Mw,showLegend:function(e){const t=yx(e,"color.point.mode","primary");return"primary"!==t&&"byExpression"!==t&&!1===Sw(e)},showColorByLabel:function(e){const t=Dw(e)&&!1===qw(e),n=_w(e)&&!1===Mw(e),r=yx(e,"color.point.byDimDef.activeDimensionIndex")>-1;return t&&!r||n},hasDimValueColors:function(e,t){return e.layout.qHyperCube.qDimensionInfo[t]?.coloring?.hasValueColors??!0}};function Cw(e,t){this.getSettings=e,this.getElements=t}function Ew(e){const t=e.qDef.qSortCriterias;t[0]||t.push({});const n=t[0],r=this.getSettings();Fy(n,"qSortByExpression",r.SORT_BY_EXPRESSION),Fy(n,"qSortByAscii",r.SORT_BY_ASCII),Fy(n,"qSortByNumeric",r.SORT_BY_NUMERIC),Fy(n,"qSortByLoadOrder",r.SORT_BY_LOAD_ORDER),n.qExpression||(n.qExpression={});const i=Aw(this.getElements());n.qExpression.qv=i.exp}function Aw(e){const t=e.filter(e=>e.isDefault);return 0===t.length?e[0]:t[0]}Cw.prototype.applyAutoSorting=Ew,Cw.prototype.applyDefaultCustomSorting=function(e,t){Ew.call(this,e);const n=Aw(this.getElements()),r=e.qDef.qSortCriterias[0];t.elementId=n.id,t.sortCriteria={},Fy(t.sortCriteria,"sortByExpression",r.qSortByExpression),Fy(t.sortCriteria,"sortByAscii",r.qSortByAscii),Fy(t.sortCriteria,"sortByNumeric",r.qSortByNumeric),Fy(t.sortCriteria,"sortByLoadOrder",r.qSortByLoadOrder)},Cw.prototype.applyCustomSorting=function(e,t){const n=e.qDef.qSortCriterias[0];if(Fy(n,"qSortByExpression",t.sortCriteria.sortByExpression),Fy(n,"qSortByAscii",t.sortCriteria.sortByAscii),Fy(n,"qSortByNumeric",t.sortCriteria.sortByNumeric),Fy(n,"qSortByLoadOrder",t.sortCriteria.sortByLoadOrder),1!==n.qSortByExpression&&-1!==n.qSortByExpression)return;n.qExpression||(n.qExpression={});if(t.elementId){const e=function(e,t){const n=e.filter(e=>e.id===t);0===n.length&&function(e){throw new Error(`Sorter: ${e}`)}(`Could not find any element matching the element '${t}'`);return n[0]}(this.getElements(),t.elementId);n.qExpression.qv=e.exp}else n.qExpression.qv=t.expression.qValueExpression.qExpr};const Tw={create:function(e,t){return new Cw(e,t)}};const Iw={applySorting:function(e,t,n){const r=n.autoSort,i=!!n.sortCriteria;r?e.applyAutoSorting(t):i?e.applyCustomSorting(t,n):e.applyDefaultCustomSorting(t,n)}};const Nw={ASCII:{ELEMENT:void 0,SORT_BY_EXPRESSION:void 0,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}};Object.freeze(Nw.ASCII),Object.freeze(Nw);const Rw=Lx(!0,{DIST_MAX:{ELEMENT:"distplot-exp-max",SORT_BY_EXPRESSION:-1,SORT_BY_ASCII:1,SORT_BY_NUMERIC:1,SORT_BY_LOAD_ORDER:1}},Nw);const Ow={getSettings:function(e){return yx(e,"qHyperCube.qDimensionInfo.1.qCardinal",1)>10?Rw.DIST_MAX:Rw.ASCII}};function Pw(e,t,n,r){let i="Fractile";0===e?i="Min":1===e&&(i="Max");const o=t?Fx.wrapExpression(t):"",s=n?Fx.wrapExpression(n):"";return`${i}( total {{<outerDimString>}} Aggr( {{innerMeasureString}}, {{outerDimString,}} {{innerDimString}} ), ${e} )`.replace(/{{innerDimString}}/g,o).replace(/{{outerDimString}}/g,s).replace(/{{<outerDimString>}}/g,n?`<${s}>`:"").replace(/{{outerDimString,}}/g,n?`${s},`:"").replace(/{{innerMeasureString}}/g,(r||"").replace(/^=/,""))}const Lw={getElementIds:function(){return[ow.SORTING_ELEMENT_MIN_ID,ow.SORTING_ELEMENT_MAX_ID]},getElements:function(e,t,n,r){const i=t[0],o=t[1],s=e[0],a=Pw(0,i,o,s),l=Pw(1,i,o,s);return[{id:ow.SORTING_ELEMENT_MIN_ID,label:r.get("properties.distributionPlot.min"),exp:a,isDefault:ow.SORTING_ELEMENT_MIN_ID===n.ELEMENT},{id:ow.SORTING_ELEMENT_MAX_ID,label:r.get("properties.distributionPlot.max"),exp:l,isDefault:ow.SORTING_ELEMENT_MAX_ID===n.ELEMENT}]},getFractileExpression:Pw};function Fw(e){throw new Error(`distributionplot-sorter.applySorting: ${e}`)}function jw(e,t,n,r){if(!e.qUndoExclude)return;e.sorting||(e.sorting={autoSort:!0});const i=e.qUndoExclude.qHyperCubeDef.qDimensions;i.length>=2?e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[0,2,1]:e.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0];const o=function(){return Ow.getSettings(t)},s=Tw.create(o,function(){const e=o();return Lw.getElements(n.measures,n.dimensions,e,r)}),a=i[0],l=e.sorting;Iw.applySorting(s,a,l)}const zw={applySorting:function(e,t,n,r,i){return function(e){const t=e.qHyperCubeDef;t?t.qDimensions?t.qMeasures?(!t.qDimensions.length||t.qDimensions.length<2)&&Fw("'qHyperCubeDef.qDimensions' has no outer dimension"):Fw("no 'qHyperCubeDef.qMeasures' in properties arg"):Fw("no 'qHyperCubeDef.qDimensions' in properties arg"):Fw("no 'qHyperCubeDef' in properties arg")}(e),r?jw(e,t,r,i):Vx.getAllHyperCubeExpressions(e.qHyperCubeDef,t.qHyperCube,n).then(n=>{jw(e,t,n,i)})}},Hw=`${ow.SORT_CRITERIA}.sortByExpression`;const Bw={updateSortOrder:function(e,t){if(!t)return;const n=yx(e,Hw);if(!(-1===n||1===n))return;const r=yx(e,ow.SORTING_ELEMENT_ID),i=yx(t,ow.SORTING_ELEMENT_ID),o=r===ow.SORTING_ELEMENT_MAX_ID,s=r===ow.SORTING_ELEMENT_MIN_ID&&i===ow.SORTING_ELEMENT_MAX_ID,a=o&&(!!!i||i===ow.SORTING_ELEMENT_MIN_ID),l=yx(t,Hw),c=o&&!(-1===l||1===l)&&1===n;s?xx(e,Hw,1):(a||c)&&xx(e,Hw,-1)}},Vw=(e,t)=>{const n={};return n.axisTitleSection={translation:"properties.axis.title",component:"panel-section",items:t.getOptions("axis","axis.title")},n.axisLabelSection={translation:"properties.axis.label",component:"panel-section",items:t.getOptions("axis","axis.label.name")},e?.isEnabled("CLIENT_IM_3051")&&(n.legendTitleSection={translation:"properties.legend.title",component:"panel-section",items:t.getOptions("legend","legend.title")},n.legendLabelSection={translation:"properties.legend.label",component:"panel-section",items:t.getOptions("legend","legend.label")}),Object.keys(n).length>0?n:void 0},$w=(e,t,n)=>({component:"styling-panel",chartTitle:"Object.DistributionPlot",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e,items:Vw(n,t)});function Ww(e){return!yx(e,"color.point.auto")&&"byDimension"===yx(e,"color.point.mode")&&yx(e,"qHyperCubeDef.qMeasures.length",0)<=1}function Uw(e){const{flags:t,translator:n}=e,r=e.theme,i=e.flags.isEnabled("SENSECLIENT_IM_2018_STYLINGPANEL_DIST_PLOT"),o=e.flags.isEnabled("SENSECLIENT_IM_2018_DIST_BG"),s=e=>({color:e,index:r.getDataColorPickerPalettes()[0].colors.indexOf(e)}),a={translation:"properties.colors",type:"items",items:{colors:{type:"items",items:{pointColor:{type:"items",translation:"properties.colorsAndLegend",grouped:!0,items:{colors:{type:"items",items:{autoColor:{ref:"color.point.auto",type:"boolean",translation:"properties.colors",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},colorMode:{ref:"color.point.mode",type:"string",component:"dropdown",options:()=>[{value:"primary",translation:"properties.colorMode.primary"},{value:"byExpression",translation:"properties.colorMode.byExpression"}],defaultValue:"primary",show:e=>!yx(e,"color.point.auto",!0)},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=r.getStyle(ow.CHART_ID,"box","fill");return s(e)}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",type:"object",component:"color-picker",dualOutput:!0,show:e=>!yx(e,"color.point.auto",!0)&&"primary"===yx(e,"color.point.mode","primary"),defaultValue(){const e=r.getDataColorSpecials().primary;return s(e)}},attributeExpression:{type:"string",component:"expression",expressionType:"measure",schemaIgnore:!0,ref:"color.point.expression.qValueExpression.qExpr",translation:"Common.Expression",show:e=>!yx(e,"color.point.auto")&&"byExpression"===yx(e,"color.point.mode")},expressionIsColor:{ref:"color.point.expressionIsColor",translation:"properties.expressionIsColor",type:"boolean",defaultValue:!0,show:!1}}}}}}}}},l={items:{showDisclaimer:{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",show:()=>t.isEnabled("SHOW_DISCLAIMER"),defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}}},c=((e,t,n,r,i)=>r({theme:e,translator:t,flags:i,config:{id:n,paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}}))(r,n,ow.CHART_ID,Lv,t),u=((e,t,n)=>{const r={getOptions:(r,i)=>{const o=(e,t)=>({ref:`${i}.fontColor`,component:"color-picker",width:!1,defaultValue:()=>{const n=e.getStyle(t,`${i}.color`,"color");return{color:n,index:e.getDataColorPickerPalettes()[0].colors.indexOf(n)}}});return{labelSection:{component:"items",ref:"components",key:r,items:{fontFamily:{ref:`${i}.fontFamily`,component:"dropdown",options:()=>e.getOptions(`${i}.fontFamily`),defaultValue:()=>e.getDefaultValue(`${i}.fontFamily`)},...((t,n)=>({fontWrapper:{component:"inline-wrapper",items:{fontSize:{ref:`${i}.fontSize`,component:"dropdown",width:!0,options:()=>e.getOptions(`${i}.fontSize`),defaultValue:()=>e.getDefaultValue(`${i}.fontSize`)},fontColor:{...o(t,n)}}}}))(t,n)}}}}};return r})(c,r,ow.CHART_ID),h={type:"items",translation:"properties.presentation",items:{stylingPanel:i&&$w(o,u,t),orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"horizontal",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}]},showDistBackground:{ref:"presentation.visibleComponents",translation:"properties.show",type:"string",component:"dropdown",defaultValue:"points_box",options:[{value:"points_box",translation:"properties.distributionPlot.pointsAndBox"},{value:"points",translation:"properties.distributionPlot.pointsOnly"},{value:"box",translation:"properties.distributionPlot.boxOnly"}]},gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridlines.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridlines.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridlines&&!e.gridlines.auto}}}}};h.items.bubbleScaleItems={type:"items",items:{bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:ow.BUBBLE_SCALES_MAX,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents}}},h.items.jitter={type:"string",component:"switch",ref:"dataPoint.displacement",translation:"properties.distributionPlot.jitter",defaultValue:"none",options:[{value:"none",translation:"properties.off"},{value:"jitter",translation:"properties.on"}],show:e=>"box"!==e.presentation.visibleComponents};const d={uses:"axis.picasso.measureAxis",items:{startAt:{type:"string",component:"dropdown",translation:"properties.axis.startAt",readOnly:e=>!(e.measureAxis.autoMinMax||"min"===e.measureAxis.minMax&&0===e.measureAxis.min),options:[{value:"zero",translation:"properties.axis.startAt.zero"},{value:"lowest",translation:"properties.axis.startAt.lowest"}],defaultValue:"lowest",convertFunctions:{get(e,t,n,r){const{autoMinMax:i,minMax:o,min:s}=r?.measureAxis||{};return!0===i?"lowest":i||"min"!==o||0!==s?e(t.type):"zero"},set(e,t,n,r,i){"zero"===e?(xx(i,"measureAxis.autoMinMax",!1),xx(i,"measureAxis.minMax","min"),xx(i,"measureAxis.min",0)):xx(i,"measureAxis.autoMinMax",!0)}},classification:{section:"axis",tags:["simple"],exclusive:!0}}}},f={uses:"axis.picasso.dimensionAxis",show:(e,t)=>yx(t.layout,`${ow.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,items:{dimensionAxisTitle:{component:"header",type:"string",show:(e,t)=>yx(t.layout,`${ow.HYPERCUBE_PATH}.qDimensionInfo.length`)>1,classification:{section:"axis",tags:["simple"],exclusive:!0}},othersGroup:{items:{label:{show:(e,t)=>yx(t.layout,`${ow.HYPERCUBE_PATH}.qDimensionInfo.length`)>1&&"horizontal"!==yx(t.layout,"orientation"),options:[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]},dock:{show:(e,t)=>yx(t.layout,`${ow.HYPERCUBE_PATH}.qDimensionInfo.length`)>1}}}}};function p(e,t){const n=yx(e,t,void 0);n&&void 0!==n.label&&("="===n.label.charAt(0)?e.color.point.altLabel={qStringExpression:{qExpr:n.label.substr(1)}}:e.color.point.altLabel=n.label)}const m=(e,t)=>{if("libraryItem"===e.color.point.byDimDef?.type){const n=e.color.point.byDimDef?.key??"",r=t.handler.layout.qUndoExclude?.qHyperCube?.qDimensionInfo??[];for(let e=0;e<r.length;e++){const t=r[e].qAttrDimInfo;if(t)for(let e=0;e<t.length;e++)if(t[e].colorMapRef===n)return t[e].qFallbackTitle}return""}return e.color.point.byDimDef?.label??""},g=(e,t,r)=>{if(e.qHyperCubeDef?.qDimensions?.length){const t=e.qHyperCubeDef?.qDimensions.map((e,t)=>({value:t,label:n.get("properties.colorBy.currentDimension",t+1)}));return(e.color?.point?.byDimDef?.activeDimensionIndex??-1)<0&&t.push({value:-1,label:m(e,r)}),t}return[]},y={items:{disclaimer:{show:!1},simpleItems:{show:!0,items:{autoColor:{ref:"color.point.auto",undefinedValue:!1,label:e=>yx(e,"color.point.auto")?n.get("Simple.Color.Auto",n.get("properties.colorMode.primary")):n.get("Common.Custom"),change:e=>{yx(e,"color.point.auto")||(xx(e,"color.point.mode","primary"),xx(e,"color.point.useBaseColors","off"))}},colorMode:{ref:"color.point.mode",options:e=>{const t=[{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}];return"byExpression"===yx(e,"color.point.mode")&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!kw.isColorAuto(e),change(e){if("primary"===yx(e,"color.point.mode",void 0)){const t=yx(e,"color.point.useBaseColors",void 0);void 0!==t&&"off"!==t&&xx(e,"color.point.useBaseColors","off")}},globalChange(){}},colorByDimension:{ref:"color.point.byDimDef.activeDimensionIndex",options:g,show:(e,t,n)=>kw.isColorByDimension(e)&&g(e,0,n).length>1,change(e){p(e,"color.point.byDimDef")}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,t){const n=yx(e,"color.point.mode","primary");return!kw.isColorAuto(e)&&"primary"===n&&(kw.measuresHasBaseColors(t)||kw.dimensionsHasBaseColors(t))}}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show:(e,t)=>{const n="measure"===yx(e,"color.point.useBaseColors")&&kw.measuresHasBaseColors(t),r="dimension"===yx(e,"color.point.useBaseColors")&&kw.dimensionsHasBaseColors(t);return kw.isColorBySingle(e)&&!n&&!r}},useDimColVal:{ref:"color.point.useDimColVal",show(e,t,n){const r=e.color.point?.byDimDef?.activeDimensionIndex??null;return kw.hasDimValueColors(n.handler,r)&&kw.isColorByDimension(e)&&kw.isDimensionLibraryItem(e)}},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=r.getStyle(ow.CHART_ID,"box","fill");return s(e)},show:e=>!yx(e,"color.point.auto",!0)}}}}},v={uses:"colorsAndLegend",items:{colors:{globalChange:kw.onGlobalChangeColors,items:{autoColor:{ref:"color.point.auto",undefinedValue:!1},colorMode:{ref:"color.point.mode",options(e){const t=[];return t.push({value:"primary",translation:"properties.colorMode.primary"}),t.push({value:"byDimension",translation:"properties.colorMode.byDimension"}),yx(e,"qHyperCubeDef.qDimensions.length",0)>=1&&t.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),t},show:e=>!kw.isColorAuto(e),globalChange(){}},colorByDimension:{ref:"color.point.byDimDef",show:e=>kw.isColorByDimension(e),change(e){p(e,"color.point.byDimDef")}},colorByMeasure:{ref:"color.point.byMeasureDef",show:e=>kw.isColorByMeasure(e),change(e){p(e,"color.point.byMeasureDef")}},colorByLabel:{ref:"color.point.altLabel",show:kw.showColorByLabel,change(e){const t=yx(e,"color.point.mode"),n=yx(e,"color.point.altLabel","");let r;switch(t){case"byMeasure":r=e.color.point.byMeasureDef;break;case"byDimension":r=e.color.point.byDimDef}r&&(r.label=n.qStringExpression?`=${n.qStringExpression.qExpr}`:n)}},baseColors:{type:"items",items:{useBaseColor:{ref:"color.point.useBaseColors",show(e,t){const n=yx(e,"color.point.mode","primary");return!kw.isColorAuto(e)&&"primary"===n&&(kw.measuresHasBaseColors(t)||kw.dimensionsHasBaseColors(t))}},measureColor:{translation:"properties.libraryColors",component:"measure-color",show:(e,t)=>!yx(e,"color.point.auto")&&"byMultiple"===yx(e,"color.point.mode")&&"measure"===yx(e,"color.point.useBaseColors")&&t.layout.qHyperCube.qMeasureInfo.length>1&&kw.measuresHasBaseColors(t)}}},paletteColor:{ref:"color.point.paletteColor",translation:"properties.distributionPlot.pointColor",show(e,t){const n="measure"===yx(e,"color.point.useBaseColors")&&kw.measuresHasBaseColors(t),r="dimension"===yx(e,"color.point.useBaseColors")&&kw.dimensionsHasBaseColors(t);return kw.isColorBySingle(e)&&!n&&!r}},useDimColVal:{ref:"color.point.useDimColVal",show:e=>kw.isColorByDimension(e)&&kw.isDimensionLibraryItem(e)},useMeasureGradient:{ref:"color.point.useMeasureGradient",translation:"properties.libraryColors",type:"boolean",component:"switch",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}],show(e){const t=yx(e,"color.point.auto"),n=yx(e,"color.point.mode");return!t&&"byMeasure"===n&&"libraryItem"===yx(e,"color.point.byMeasureDef.type")}},persistentColors:{ref:"color.point.persistent",show:e=>yx(e,"color.point.auto")||"byDimension"!==yx(e,"color.point.mode")||"libraryItem"!==yx(e,"color.point.byDimDef.type")?Ww(e):Ww(e)&&!yx(e,"color.point.useDimColVal")},colorSchemeMeasure:{ref:"color.point.measureScheme",show:e=>!kw.isColorAuto(e)&&kw.isColorByMeasure(e)},reverseScheme:{ref:"color.point.reverseScheme",change(e){e.color.reverseScheme=e.color.point.reverseScheme},show:e=>!kw.isColorAuto(e)&&kw.isColorByMeasure(e)},colorSchemeDimension:{ref:"color.point.dimensionScheme",show:e=>kw.isColorByDimension(e)&&(!kw.isDimensionLibraryItem(e)||!yx(e,"color.point.useDimColVal"))},customRange:{show:e=>!kw.isColorAuto(e),items:{autoMinMax:{ref:"color.point.autoMinMax",show:e=>kw.isColorByMeasure(e)},min:{ref:"color.point.measureMin",show:e=>kw.isColorByMeasure(e)&&!1===yx(e,"color.point.autoMinMax"),invalid:e=>"minMax"===yx(e,"color.point.minMax")&&yx(e,"color.point.measureMin")>=yx(e,"color.point.measureMax")},max:{ref:"color.point.measureMax",show:e=>kw.isColorByMeasure(e)&&!1===yx(e,"color.point.autoMinMax"),invalid:e=>"minMax"===yx(e,"color.point.minMax")&&yx(e,"color.point.measureMin")>=yx(e,"color.point.measureMax")}}},attributeExpression:{ref:"color.point.expression.qValueExpression.qExpr",show:e=>kw.isColorByExpression(e)},expressionIsColor:{ref:"color.point.expressionIsColor",show:!1},boxColor:{ref:"color.box.paletteColor",translation:"properties.distributionPlot.boxColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue(){const e=r.getStyle(ow.CHART_ID,"box","fill");return s(e)},show:e=>!yx(e,"color.point.auto",!0)}}},simpleColors:y,legend:{show:kw.showLegend,type:"items",items:{show:{snapshot:{tid:"property-legend"}},dock:{show:e=>kw.showLegend(e)&&yx(e,"legend.show",!0)},showTitle:{show:e=>kw.showLegend(e)&&yx(e,"legend.show",!0)}}}}},b={items:{labels:{items:{header:{show:e=>e.qHyperCubeDef.qDimensions?.length&&e.qHyperCubeDef.qMeasures?.length},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:e=>e.qHyperCubeDef.qDimensions?.length>1&&e.qHyperCubeDef.qMeasures?.length,convertFunctions:{get:(e,t,n,r)=>"labels"===r.dimensionAxis.show||"none"===r.dimensionAxis.show,set(e,t,n,r,i){i.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show:e=>e.qHyperCubeDef.qDimensions?.length&&e.qHyperCubeDef.qMeasures?.length,convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}},x={uses:"settings",items:{simpleLabels:b,general:l,presentation:h,colors:v||a,measureAxis:d,dimensionAxis:f}},w={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:kw.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},q=Qx.expression(`${ow.SORT_CRITERIA}.sortByExpression`),M={type:"items",items:{toggled:q.items.toggled,sortByElement:{component:"sort-by-element",expressionRef:ow.SORTING_EXPRESSION,elementRef:ow.SORTING_ELEMENT_ID,show:aw.isSortByExpression,elements:e=>Vx.getAllHyperCubeExpressions(e.properties.qHyperCubeDef,e.layout.qHyperCube,e.model.app).then(t=>{const r=Ow.getSettings(e.layout);return Lw.getElements(t.measures,t.dimensions,r,n)})},order:q.items.order}},S={type:"items",translation:"properties.sorting",schemaIgnore:!0,grouped:!1,globalChange(e,t,n){n&&Bw.updateSortOrder(e,n.prevProperties)},items:{autoSort:{ref:ow.AUTO_SORT,type:"boolean",translation:"properties.sorting",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],show:aw.hasMultipleDimensions,change(e,t,r,i){if(e&&aw.hasMultipleDimensions(e)&&t.layout)return zw.applySorting(e,t.layout,i.model.app,null,n)},classification:{section:"sorting",tags:["simple"]},reset(e){e.sorting={autoSort:!0}}},simpleSorting:{component:"sorting-with-elements",expressionRef:ow.SORTING_EXPRESSION,elementRef:ow.SORTING_ELEMENT_ID,sortCriteriasRef:ow.SORT_CRITERIA,show:e=>aw.hasMultipleDimensions(e)&&!aw.isAutoSort(e),elements:e=>Vx.getAllHyperCubeExpressions(e.handler.properties.qHyperCubeDef,e.handler.layout.qHyperCube,e.model.app).then(t=>{const r=Ow.getSettings(e.layout);return Lw.getElements(t.measures,t.dimensions,r,n)}),classification:{section:"sorting",tags:["simple"],exclusive:!0}},sortingItems:{type:"items",grouped:!0,show:e=>aw.hasMultipleDimensions(e)&&!aw.isAutoSort(e),items:{expression:M,numeric:Qx.numeric(`${ow.SORT_CRITERIA}.sortByNumeric`),ascii:Qx.ascii(`${ow.SORT_CRITERIA}.sortByAscii`),defaultSortMessage:{component:"text",translation:"properties.sorting.defaultSortingMessage",show:e=>!aw.isSortByExpression(e)&&!aw.isSortByNumeric(e)&&!aw.isSortByAscii(e)}}},noData:{component:"text",translation:"Common.NoData",style:"hint",show:e=>!aw.hasMultipleDimensions(e),classification:{section:"sorting",tags:["simple"]}}}};return{type:"items",component:"accordion",items:{data:{uses:"data",grouped:!0,items:{dimensions:{uses:"dimensions"},measures:{uses:"measures"}}},sorting:S,addons:w,settings:x}}}const Yw={buildDefinition:function(e,t,n,r,i){const o=`${n}.qDef.qSortCriterias.0.`,s={type:"items",translation:"properties.sorting",icon:"ascending",show:t=>Py(t,`${e}.qDimensions.length`,0)>1,items:{sortingOptions:{component:"radio-list",type:"number",diffs:[`${o}qSortByExpression`,`${o}qSortByNumeric`,`${o}qSortByAscii`],options:[{value:1,translation:"properties.sorting.ascending"},{value:-1,translation:"properties.sorting.descending"}],setPropertyValue(e,n,s){const a=s.layout;let l=Kw(e,o).chart;l||(l="sortByAscii");const c=Py(e,t);if(c.sortCriteria||(c.sortCriteria={}),c.autoSort){const t=r(a);if(t.ELEMENT)c.elementId=t.ELEMENT;else{const t=i(e,a);c.elementId=t[0]}}c.autoSort=!1,function(e,t){const n=e.sortCriteria;"sortByNumeric"!==t&&"sortByAscii"!==t||(n.sortByExpression=0);"sortByAscii"===t&&(n.sortByNumeric=0)}(c,l),c.sortCriteria[l]=n},getValue(e){const t=Kw(e,o).dimension;return t?Py(e,o+t):0}}}};return s}};function Kw(e,t){const n={chart:"",dimension:""};return 0!==Py(e,`${t}qSortByExpression`,0)?(n.chart="sortByExpression",n.dimension="qSortByExpression"):0!==Py(e,`${t}qSortByNumeric`,0)?(n.chart="sortByNumeric",n.dimension="qSortByNumeric"):0!==Py(e,`${t}qSortByAscii`,0)&&(n.chart="sortByAscii",n.dimension="qSortByAscii"),n}const Xw={type:"items",component:"accordion",items:{data:{uses:"data"},sorting:Yw.buildDefinition("qHyperCubeDef","sorting","qUndoExclude.qHyperCubeDef.qDimensions.0",Ow.getSettings,Lw.getElementIds),presentation:{uses:"presentation",items:{orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}]},bubbleScales:{type:"integer",component:"slider",ref:"dataPoint.bubbleScales",translation:"properties.dataPoints.bubbleSizes",min:20,max:100,step:5,defaultValue:100,show:e=>e.qHyperCubeDef.qMeasures.length<2&&"box"!==e.presentation.visibleComponents},jitter:{type:"string",component:"switch",ref:"dataPoint.displacement",translation:"properties.distributionPlot.jitter",defaultValue:"none",options:[{value:"none",translation:"properties.off"},{value:"jitter",translation:"properties.on"}],show:e=>"box"!==e.presentation.visibleComponents}}}}},Gw={items:{color:{uses:"color",items:{mode:{options:[{value:"auto",translation:"Common.Auto"},{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}],diffs:["color.point.mode","color.point.auto"],setPropertyValue(e,t){"auto"===t?e.color.point.auto=!0:(e.color.point.auto=!1,e.color.point.mode=t)},getValue:e=>kw.isColorAuto(e)?"auto":e.color.point.mode},dimension:{show:e=>kw.isColorByDimension(e),items:{colorScheme:{ref:"color.point.dimensionScheme"},persistentColors:{ref:"color.point.persistent"}}},measure:{show:e=>kw.isColorByMeasure(e),items:{sequential:{ref:"color.point.measureScheme"}}},legend:{show:kw.showLegend}}}}};function Jw(e){return{definition:Uw(e),softDefinition:Xw,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},options:{usingDerivedProperties:!0,colorByPath:"color.point"},onSoftPropertyChange(e,t){kw.onGlobalChangeColors(t)},importProperties:(t,n,r)=>{const i=sv(e);r.mapProperties();return Tx({dataDefinition:i,defaultPropertyValues:{defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},exportFormat:t,initialProperties:n})},exportProperties:(e,t,n)=>Ix({propertyTree:e,viewDataMode:n})}}Lx(!0,Xw,Gw);const Zw={getChar(e){let t,n=e;return n>9?(t=65+n-10,t>90&&(t+=6)):n=`${n}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(t)>-1?this.getChar(n+1):String.fromCharCode(t)},base62(e){const t=this.getChar(e%62),n=Math.floor(e/62);return n>0?this.base62(n)+t:t},id(){return this.base62(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function Qw(){return Zw.id()}const eq="scrollbar";function tq(e,t,n){return"y"===e?nq(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function nq(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var rq={getAxisDock:tq,getOppositeAxisDock:function(e,t,n){return tq(e,"far"===t?"near":"far",n)},getYAxisDock:nq};const iq=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),oq=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),sq=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function aq(e){return iq.test(e)}function lq(e){return oq.test(e)||sq.test(e)}var cq={lrm:String.fromCharCode(8206),detectTextDirection:function(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],aq(r))return"ltr";if(lq(r))return"rtl"}return"ltr"}};var uq={lineSettings:function(e,t){const n=void 0!==t.paletteColor?t.theme.getColorPickerColor(t.paletteColor):"transparent";return Lx(!0,{value:0,line:{stroke:n,strokeDasharray:t?.style?.lineType}},e||{})},lineLabelSettings:function(e,t){const n=t&&t.chartID;let r=t.theme.getStyle(n,"referenceLine.label.name","color");const i=t.theme.getStyle(n,"referenceLine.label.name","fontSize"),o=t.theme.getStyle(n,"referenceLine.label.name","fontFamily");return t.paletteColor?r=t.theme.getColorPickerColor(t.paletteColor):r||(r="transparent"),Lx(!0,{value:0,line:{stroke:"transparent"},label:{align:"center",vAlign:"middle",text:"",fill:r,fontFamily:o,fontSize:i,maxWidthPx:135}},e||{})},isVisible:e=>e&&!1!==e.show&&0!==e.show&&"0"!==e.show&&void 0!==e.refLineExpr,getRefLineTitle:function({refLine:e,label:t,valueString:n}){return!1!==e.showValue?!1!==e.showLabel?`${t} ${cq.lrm}(${n})${cq.lrm}`:`${cq.lrm}(${n})${cq.lrm}`:!1!==e.showLabel?t:""}};const hq={SHOW_AXIS_LABELS_OPTIONS:["all","labels"],SHOW_TITLE_OPTIONS:["all","title"],HORIZONTAL:"horizontal",VERTICAL:"vertical",LAYOUTSETTINGS:{lasso:{displayOrder:1e4},rangeDim:{displayOrder:1e4},rangeMeasure:{displayOrder:1e4},rangeMinor:{displayOrder:1e4},scrollBar:{minimumLayoutMode:"SPARK",prioOrder:-1,displayOrder:100},refLines:{layout:{minimumLayoutMode:"SPARK",prioOrder:60,displayOrder:1110}},measureAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},dimensionAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},measureAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},dimensionAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},gridLines:{minimumLayoutMode:"XSMALL",displayOrder:-100},refLinesLabels:{minimumLayoutMode:"SMALL",prioOrder:60,displayOrder:0}}};hq.DEFAULT_CHART_ORIENTATION=hq.HORIZONTAL;function dq(e,t){const n=t||{},r=n.measureAxisProperties||{},i=n.dimensionAxisProperties||{},o=n.orientation||hq.DEFAULT_CHART_ORIENTATION,s=o===hq.HORIZONTAL,a=s?"x":"y",l=s?"y":"x",c=hq.SHOW_AXIS_LABELS_OPTIONS,u=hq.SHOW_TITLE_OPTIONS,h=c.includes(r.show),d=!!n.measureTitleText&&u.includes(r.show),f=n.includeDimensionAxis&&c.includes(i.show),p=n.includeDimensionAxis&&!!n.dimensionTitleText&&u.includes(i.show),m=n.gridlines&&!(!n.gridlines.auto&&0===n.gridlines.spacing),g=n.refLines&&n.refLines.some(e=>e.show),y=[];if(h&&function(e,t,n,r){let i={scale:"measure",settings:t.axisLabelStyle||{},forceBounds:r&&!r.autoMinMax&&r.showBounds};i=Lx(i,hq.LAYOUTSETTINGS.measureAxis);const o=pq(t,n);e.addComponent(`${n}-axis`,i,o)}(e,n,a,r),d&&function(e,t,n){let r={text:t.measureTitleText,style:t.axisTitleStyle||{}};r=Lx(r,hq.LAYOUTSETTINGS.measureAxisTitle);const i=function(e,t){return pq(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,a),function(e,t,n,r){let i=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:r};r&&r.spacing>0&&(i=Lx(!0,i||{},{component:{ticks:{distance:100*r.spacing}}}));e.addScale("measure-scale",i,o)}(e,n,o,r),f&&function(e,t,n){let r={scale:"dimension",settings:t.axisLabelStyle||{}};r=Lx(r,hq.LAYOUTSETTINGS.dimensionAxis);const i=mq(t,n);Lx(!0,r,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,r,i)}(e,n,l),p&&function(e,t,n){let r={text:t.dimensionTitleText,style:t.axisTitleStyle||{}};r=Lx(r,hq.LAYOUTSETTINGS.dimensionAxisTitle);const i=function(e,t){return mq(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,l),n.includeDimensionAxis&&function(e,t,n){const r={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===hq.HORIZONTAL?hq.VERTICAL:hq.HORIZONTAL};e.addScale("dimension-scale",t.dimensionScaleSettings,r)}(e,n,o),m&&function(e,t,n){let r={ticks:{show:!0},minorTicks:{show:!t.auto&&!t.auto&&3===t.spacing}};r=Lx(r,hq.LAYOUTSETTINGS.gridLines),r[n]={scale:"measure"},e.addComponent("grid-line",r)}(e,n.gridlines,a),n.hasNavigation&&function(e,t,n,r){const i=e.getSettings();i.scroll={dimension:{viewSize:n.scrollSettings&&n.scrollSettings.viewSize||0,max:n.scrollSettings&&n.scrollSettings.max||0}};const o={isRtl:n.isRtl,chartID:n.chartID,isHorizontal:!r},s=Lx({},hq.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",s,o),fq(t,function(e){function t(t,n){if(!n||!e())return!1;const r={x:n.center.x-n.deltaX,y:n.center.y-n.deltaY};return this.chart.componentsFromPoint(r).some(e=>e.settings.key===eq)}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(eq).emit("tap",e)}}},r={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(eq).emit("panStart",e)},pan(e){this.chart.component(eq).emit("panMove",e)},panend(e){this.chart.component(eq).emit("panEnd",e)},pancancel(e){this.chart.component(eq).emit("panCancel",e)}}};return[n,r]}(n.isNavigationEnabledFn))}(e,y,n,s),g&&function(e,t,n,r){const i=rq.getAxisDock(n,r.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=Lx(o,hq.LAYOUTSETTINGS.refLines);let s={key:`ref-line-labels-${Qw()}`,require:["renderer","chart"],dock:rq.getOppositeAxisDock(n,r.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,r=this.chart.formatter({data:e.settings.scales.measure.data}),i=s.lines.y.map(e=>{const n=!1!==e.label.showValue?`(${r(e.value)})`:"",i=`${e.label.text} ${n}`,o=e.label.text&&n?` ${n}`:n;return{wanted:t({text:i,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}}),o=i[0];for(let e=1;e<i.length;e++)i[e].wanted>o.wanted&&(o.wanted=i[e].wanted),i[e].required>o.required&&(o.required=i[e].required);const a=12;return o.required+a>100?o.required+a:Math.min(o.wanted+a,100)},lines:{x:[],y:[]}};s=Lx(s,hq.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach(r=>{if(!r.show)return;const a=r.refLineExpr&&r.refLineExpr.value,l=Lx(!0,{},t,{paletteColor:r.paletteColor,style:r.style,chartID:e.options.chartID}),c=uq.lineSettings({scale:"measure",dir:n,value:a},l);o.lines[n].push(c);const u=uq.lineLabelSettings({scale:"measure",value:a,label:{text:!1!==r.showLabel?r.label:"",showValue:!1!==r.showValue}},l);"x"===n?u.label.vAlign="near"===i?1:0:u.label.align="near"===i?0:1,s.lines[n].push(u)}),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",s,{})}(e,n,a,r),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",hq.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeDim"};o=Lx(o,hq.LAYOUTSETTINGS.rangeDim);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:r,isRtl:i};e.addComponent("range",o,s)}(e,n.dimRange||{},s,mq(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMeasure"};o=Lx(o,hq.LAYOUTSETTINGS.rangeMeasure);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:r,isRtl:i};e.addComponent("range",o,s)}(e,n.measureRange||{},s,pq(n,a).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMinor"};o=Lx(o,hq.LAYOUTSETTINGS.rangeMinor);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushData:t.brushData,brushArea:t.brushArea,brushComponents:t.brushComponents,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:"measure"===t.brushScale?n:!n,dock:r,isRtl:i,chartInstance:t.chartInstance};e.addComponent("range-area",o,s)}(e,n.areaRange||{},s,mq(n,l).dock,n.isRtl)}n.brushActions&&fq(y,n.brushActions),y.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,y)}function fq(e,t){t.forEach(t=>{e.push(t)})}function pq(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function mq(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function gq(e,t){const n=t||{},r=!n.orientation||"horizontal"===n.orientation,i=!!n.isRtl,o={name:n.name||"scale",component:{invert:r&&i,minorTicks:{count:1},range:n.range||void 0,domain:n.domain||void 0,trackBy:n.trackBy||"id"}};return Lx(!0,{},o,e||{})}function yq(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}function vq(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.line.major","color"),a=t.theme.getStyle(n,"axis.title","fontSize"),l=t.theme.getStyle(n,"axis.title","color"),c=t.theme.getStyle(n,"axis.label.name","color"),u=t.theme.getStyle(n,"axis.label.name","fontSize"),h=t.theme.getStyle(n,"axis.title","fontFamily"),d=t.theme.getStyle(n,"axis.label.name","fontFamily"),f={key:"axis",type:"axis",renderer:yq(),dock:rq.getAxisDock(i,r,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:a,fontFamily:h,fill:l},line:{show:!0,strokeWidth:1,stroke:s},labels:{fill:c,fontSize:u,fontFamily:d,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:s},minorTicks:{stroke:s}}},p=Lx(!0,{},f,e||{});return p.brush.consume.forEach(e=>{e.style.active.strokeWidth=0}),p}function bq(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.title","fontSize"),a=t.theme.getStyle(n,"axis.title","color"),l=t.theme.getStyle(n,"axis.title","fontFamily"),c={key:"text",type:"text",dock:rq.getAxisDock(i,r,o),displayOrder:0,style:{text:{fontSize:s,fontFamily:l,fill:a}}};return Lx(!0,{},c,e||{})}gq.measureScale=function(e,t){let n=(t||{}).source||[];"string"==typeof n&&(n=[n]);const r={name:"measure",component:{expand:.1,data:{fields:n.map(e=>({field:e}))}}},i=t&&t.measureAxisProperties;i&&!i.autoMinMax&&(["min","minMax"].includes(i.minMax)&&(r.component.min=i.min),["max","minMax"].includes(i.minMax)&&(r.component.max=i.max));const o=gq(Lx(!0,r,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},gq.dimensionScale=function(e,t){const n={name:"dimension",component:{trackBy:"id",type:"band",data:{extract:{field:t&&t.source||"",props:{label:e=>e.qText||""}}},label:e=>e.datum.label.value}};return gq(Lx(!0,n,e||{}),t)},vq.xAxis=function(e,t){return vq(Lx(!0,{key:"x-axis",scale:"x"},e||{}),t)},vq.yAxis=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis",scale:"y",dock:rq.getYAxisDock(n,r)};return vq(Lx(!0,i,e||{}),t)},bq.xAxisTitle=function(e,t){return bq(Lx(!0,{key:"x-axis-title"},e||{}),t)},bq.yAxisTitle=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis-title",dock:rq.getYAxisDock(n,r)||"left"};return bq(Lx(!0,i,e||{}),t)};var xq={getBublesAlign:function(e,t,n){let r=e&&"far"!==t||!e&&"far"===t;return!e&&n&&(r=!r),r?"start":"end"},getDock:function(e,t){const n=[];let r;return e&&n.push(`@${e}`),t&&n.push(`@${t}`),n.length&&(r=n.join(",")),r}};const wq={SPARK:{width:0,height:0},XSMALL:{width:150,height:75},SMALL:{width:300,height:150},MEDIUM:{width:400,height:220},FULL:{width:550,height:450}};function qq(){return wq}function Mq(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}qq.getLayoutModeKeys=function(){const e=[];let t;for(t in wq)e.push(t);return e};const Sq={left:"left",right:"right",up:"top",down:"bottom"};function Dq(e,t,n){switch(e){case"scale":return gq(t,n);case"measure-scale":return gq.measureScale(t,n);case"dimension-scale":return gq.dimensionScale(t,n);case"axis":return vq(t,n);case"box-marker":return function(e){return Lx(!0,{},{key:"box-marker",type:"box-marker",settings:{minor:{scale:"x"},orientation:"horizontal"},brush:{trigger:[],consume:[]}},e||{})}(t);case"point-marker":return function(e){return Lx(!0,{},{key:"point-marker",type:"point-marker",settings:{},brush:{trigger:[],consume:[]}},e||{})}(t);case"scrollbar":return function(e,t){const n=t&&t.isRtl,r=t&&t.chartID,i=t&&t.isHorizontal,o={key:"scrollbar",type:"scrollbar",scroll:"dimension",dock:i?"bottom":n?"left":"right",settings:{backgroundColor:t.theme.getStyle(r,"","backgroundColor"),invert:n&&i}};return Lx(!0,{},o,e||{})}(t,n);case"text":return bq(t,n);case"lasso":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushComponents?t.brushComponents:[],i=t&&t.brushData?t.brushData:["elemNo"],o={type:"brush-lasso",key:"lasso",displayOrder:99,settings:{brush:{components:[]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"rgba(102,102,102,1)",strokeWidth:2,opacity:1,strokeDasharray:null},startPoint:{r:10,fill:"rgba(0, 152, 69, 1)",strokeWidth:0,opacity:1}}};return r.forEach(e=>{o.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:i})}),Lx(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushArea,o=t&&t.brushScale,s=t&&t.isHorizontal,a=t&&t.dock,l=t&&t.isRtl,c={type:"brush-range",key:"range",displayOrder:99,dock:xq.getDock(r,i),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:s?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:xq.getBublesAlign(s,a,l)}}};return Lx(!0,{},c,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushComponents?t.brushComponents:[],o=t&&t.brushData?t.brushData:["elemNo"],s=t&&t.brushArea,a=t&&t.isHorizontal,l=t&&t.dock,c=t&&t.isRtl,u=t&&t.chartInstance;let h=!0;const d={type:"brush-area-dir",key:"area",displayOrder:99,dock:xq.getDock(r,s),settings:{brush:{components:[]},direction:a?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:xq.getBublesAlign(a,l,c),label:e=>h?(h=!1,u.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(h=!0,u.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return i.forEach(e=>{d.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})}),Lx(!0,{},d,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t&&t.dock||"auto";const o=t&&t.show;"auto"===i&&(i=t.chartHeight/t.chartWidth<1?r?"left":"right":"bottom");const s=t.theme.getStyle(n,"legend.title","color"),a=t.theme.getStyle(n,"legend.title","fontSize"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.title","fontFamily"),h=t.theme.getStyle(n,"legend.label","fontFamily"),d={key:"legend",type:"legend-cat",renderer:yq(),dock:i,show:o,scale:{type:"color"},settings:{title:{anchor:"middle"},layout:{direction:r?"rtl":"ltr",size:"top"===i||"bottom"===i?2:1,vertical:"top"===i||"bottom"===i?16:8},navigation:{button:{class:{"lui-fade-button":!0},content:(e,t)=>e("span",{style:{pointerEvents:"none"},class:["lui-button__icon","lui-icon",`lui-icon--triangle-${Sq[t.direction]}`].join(" ")})}}},style:{item:{label:{fontSize:c,fontFamily:h,fill:l,lineHeight:1,wordBreak:"break-word"},margin:{top:5,left:10,right:10,bottom:10},shape:{type:t.type?t.type:"square",size:3*parseInt(c,10)/4}},title:{show:t.showTitle,fontSize:a,fontFamily:u,fill:s}}};return Lx(!0,{},d,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t.dock||"auto";"auto"===i&&(i=t.chartHeight<t.chartWidth?r?"left":"right":"bottom");const o=t.theme.getStyle(n,"legend.title","color"),s=t.theme.getStyle(n,"legend.title","fontSize"),a=t.theme.getStyle(n,"legend.title","fontFamily"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.label","fontFamily");function h(e){switch(e){case"left":return 0;case"right":return 1;default:return.5}}const d={key:"seqlegend",type:"legend-seq",dock:i,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:h(r?"right":"left"),major:{invert:"left"===i||"right"===i||r},title:{show:t.showTitle,fontSize:s,fontFamily:a,fill:o},tick:{fill:l,fontSize:c,fontFamily:u}}};return Lx(!0,{},d,e)}(t,n);case"x-axis":return vq.xAxis(t,n);case"y-axis":return vq.yAxis(t,n);case"x-axis-title":return bq.xAxisTitle(t,n);case"y-axis-title":return bq.yAxisTitle(t,n);case"grid-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"grid.line.major","color");return Lx(!0,{},{displayOrder:-1,key:"grid-line",type:"grid-line",x:null,y:null,ticks:{stroke:r},minorTicks:{stroke:r}},e||{})}(t,n);case"interaction":return function(e,t){const n=t&&t.gestures||[];return Lx(!0,{},{type:"hammer",key:"hammered",gestures:n},e||{})}(t,n);case"ref-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"referenceLine.outOfBounds","color"),i=t.theme.getStyle(n,"referenceLine.outOfBounds","backgroundColor");return Lx(!0,{},{key:"ref-line",type:"ref-line",dock:"center",prioOrder:-1,lines:{x:[],y:[]},style:{oob:{width:7,fill:i,text:{fill:r},padding:{x:7,y:5}}}},e||{})}(t,n);case"event-area":return function(e){return Lx(!0,{},{type:"event-area",key:"event-area"},e||{})}(t);case"labels":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"label.value","color"),i=t.theme.getStyle(n,"label.value","fontSize"),o=t.theme.getStyle(n,"label.value","fontFamily"),s={key:"labels",type:"labels",renderer:yq(),displayOrder:1,settings:{sources:[{component:"box-marker",selector:"rect",strategy:{type:"bar",settings:{direction:"up",fontFamily:o,fontSize:parseFloat(i),align:.5,labels:[{placements:[{position:"outside",fill:r,justify:0},{position:"inside",fill:e&&e.settings.sources[0].strategy.settings.labels[0].placements[1].fill,justify:1}],label:Mq}]}}}]}};return Lx(!0,{},s,e||{})}(t,n);default:return}}function _q(e){this.options=e||{},this.settings={dockLayout:{layoutModes:qq()},components:[],scales:{}}}_q.prototype.addComponent=function(e,t,n){const r=Dq(e,t,Lx(!0,{},this.options,n||{}));return this.settings.components.push(r),r},_q.prototype.addInteraction=function(e,t){const n=Dq("interaction",e,Lx(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},_q.prototype.addScale=function(e,t,n){const r=Dq(e,t,Lx(!0,{},this.options,n||{}));this.settings.scales[r.name]=r.component},_q.prototype.getSettings=function(){return this.settings},_q.prototype.getComponent=function(e){return this.settings.components.filter(t=>t.key===e)[0]},_q.prototype.addPreset=function(e,t){!function(e,t,n){if("dimension-measure-chart"!==e)throw Error("There is no chart preset with that type");dq(t,n)}(e,this,t)},_q.validateComponentKeys=function(e){const t={};return e.map(e=>{const n=e.key;return n?t[n]?`Duplicate key for component ${e.type}`:(t[n]=!0,null):`Missing key for component ${e.type}`}).filter(e=>!!e)},_q.create=function(e){return new _q(e)},_q.createComponent=Dq;const kq={CENTER:0,BOTTOM:1};var Cq={DISCLAIMERS:[{label:"NoDataExist",alignment:kq.CENTER,default:!0},{label:"RequireNumericDimension",alignment:kq.CENTER,default:!1},{label:"OnlyNanData",alignment:kq.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:kq.CENTER,default:!1},{label:"LimitedData",alignment:kq.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:kq.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:kq.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:kq.BOTTOM,default:!1}],ALIGNMENT:kq};const Eq={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx===0,getLimitedDataAttribute(e,t){let n,r=!1;var i;return e?void 0!==t.explicitLimitedData?r=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?r=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(i=e.qStackedDataPages)&&i[0]&&i[0].qData[0]&&i[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,r=e.qDimensionInfo.length>=n?e.qStackedDataPages[0].qData[0].qSubNodes.some(e=>e.qDown>0):e.qStackedDataPages[0].qData[0].qSubNodes.length<e.qStackedDataPages[0].qArea.qHeight):r=!0===t.explicitLimitedData,r},getNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.some(e=>e.qMin<=0),getOnlyNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.every(e=>e.qMax<=0&&e.qMax>=e.qMin)||0===e.qSize.qcy,getOnlyNanDataAttribute:(e,t)=>void 0!==t.explicitOnlyNanData?t.explicitOnlyNanData:e.qMeasureInfo.every(e=>e.qMax<e.qMin||"NaN"===e.qMax),getDataRangeIncludingZeroAttribute:(e,t)=>!t.supportRangeOverZero&&function(e,t){const n=t.length;let r,i,o,s,a;for(e&&(i=!(e.autoMinMax||"min"!==e.minMax&&"minMax"!==e.minMax||null===e.min||Number.isNaN(+e.min)),o=!(e.autoMinMax||"max"!==e.minMax&&"minMax"!==e.minMax||null===e.max||Number.isNaN(+e.max))),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,r=0;r<n;r++)if(s=Math.min(s,t[r].qMin),a=Math.max(a,t[r].qMax),s<=0&&a>=0)return!0;return s=i?e.min:s,a=o?e.max:a,s<=0&&a>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},r={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,Cq.DISCLAIMERS.forEach(e=>{r[e.label]=!1}),t&&t.qHyperCube?(r.NoDataExist=this.getNoDataExistAttribute(t.qHyperCube),r.NoDataExist?r:(r.RequireNumericDimension=n.explicitRequireNumericDimension,r.RequireNumericDimension||(r.LimitedData=this.getLimitedDataAttribute(t.qHyperCube,n),r.NegativeOrZeroValues=this.getNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNegativeOrZeroValues=this.getOnlyNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNanData=this.getOnlyNanDataAttribute(t.qHyperCube,n),r.DataRangeIncludingZero=this.getDataRangeIncludingZeroAttribute(t,n)),r)):r}};function Aq(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function Tq(e,t){return e&&t&&t[e]}function Iq(e){this.environment=e,this.clear()}Aq.prototype.isValidAndSupported=function(e,t){return Tq(e.label,this.dataAttributes)&&(e.default||Tq(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},Aq.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach(r=>{n.isValidAndSupported(r,e)&&(t=!0)}),t},Aq.prototype.getMessage=function(e,t){let n="";const r=this;return t&&this.disclaimersConfig.forEach(i=>{r.isValidAndSupported(i,e)&&(n+=`${t.get(`Object.Disclaimer.${i.label}`)} `)}),n},Iq.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},Iq._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach(e=>{void 0===n[e.label]&&(n[e.label]=e.default)}),n},Iq.prototype.getComponentSettings=function(){const{translator:e}=this.environment,t=Lx(!0,{},this.vizAttributes.supportedDisclaimers),n=new Aq(Cq.DISCLAIMERS,this.dataAttributes,t);let r,i;if(n.isAnyValidDisclaimer(Cq.ALIGNMENT.CENTER))r=n.getMessage(Cq.ALIGNMENT.CENTER,e),i="center";else{if(!n.isAnyValidDisclaimer(Cq.ALIGNMENT.BOTTOM))return;r=n.getMessage(Cq.ALIGNMENT.BOTTOM,e),i="bottom"}return{key:"disclaimer",type:"disclaimer",layout:{displayOrder:1e3,dock:i},settings:{label:r,rtl:"rtl"===this.environment?.options?.direction}}},Iq.prototype.set=function(e){if(this.clear(),!e)throw new Error(Iq.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=Eq.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},Iq.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const Nq=Vy.extend({init(e,t,n,r,i){this.$element=t,this.environment=n,this.backendApi=r,this._selectionsApi=i,this._on=!1,this._disclaimer=new Iq(n),this._dataPaths=["qHyperCube"];const o=this;this.picassoElement=t[0],this.picassoElement.className+=" picasso-chart",this.chartInstance=e.chart({element:this.picassoElement,settings:{components:[_q.createComponent("event-area",{mounted(e){o.dataAreaElem=e}})]}})},updateEnvironment(e){this.environment=e},isRtl(){return"rtl"===this.environment.options?.direction},setDataPaths(e){this._dataPaths=e},getData:(e,t,n)=>function(e,t,n){let r,i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,r=Math.floor(1e4/e);i={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,r):r}}else i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};r="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([i],null,t).then(e=>{t[r]=e})}(e,t,n),hasValidData:()=>!0,paint(){if(this.hasValidData()){this._disclaimer.set(this.getDisclaimerAttributes(this.layout));const e=this._disclaimer.getComponentSettings(),t="center"===e?.layout?.dock,n=this.createChartSettings(this.layout);t?n.components=[e]:e&&n.components.push(e),_q.validateComponentKeys(n.components).forEach(e=>{console.error(e)}),this.updateChart(this.layout,n),this._painted=!0}return Promise.resolve()},resize(){if(this.layout)return this.paint()},createChartSettings(){throw new Error('Subclass must implement "createChartSettings" function')},addSnapshotChartSettings(e,t){const{freeResize:n}=this.environment.options;!n&&t.snapshotData&&(e.dockLayout.logicalSize={width:t.snapshotData.content.size.w,height:t.snapshotData.content.size.h,preserveAspectRatio:!0})},updateData(e){return this._destroyed?Promise.reject():(this.layout=Lx(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){const r=this.environment.appLayout?.qLocaleInfo??{},i=this._dataPaths.map(t=>({type:"q",key:t,config:{localeInfo:r},data:Py(e,t.replace(/\//g,"."))}));this.colorService&&i.push(...this.colorService.getData()),this.chartInstance.update({data:i,settings:t,partialData:n});this.picassoElement.setAttribute("data-state",2)},destroy(){this._destroyed=!0,this.off(),this.chartInstance.destroy()},getViewState:()=>({}),isLassoDisabled:()=>!0,setSnapshotData(e){e.snapshotData||(e.snapshotData={}),e.snapshotData.content={chartData:{},size:{w:this.$element.width(),h:this.$element.height()}}},getDisclaimerAttributes:e=>({data:e})});function Rq(e){let t=0;if(!e||!e.length)return t;for(let n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n),t&=t}return t}const Oq={generateHash:function(e){return Rq(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=Oq.generateHash(t)}};const Pq={getDefaultHashDataForHyperCube:function(e,t,n){return function(e,t){const n=[];if(!e.qMeasures)return Promise.resolve(n);return e.qMeasures.forEach(e=>{e.qLibraryId?n.push(function(e,t){return t.getMeasure(e).then(e=>e.getProperties().then(e=>e.qMeasure.qDef))}(e.qLibraryId,t)):n.push(Promise.resolve())}),Promise.all(n)}(e,n).then(e=>({drillLevel:Fq(t),dimensionExpressions:Lq(t),measureExpressions:e}))}};function Lq(e){return e.qDimensionInfo.map(e=>e.qGroupFieldDefs)}function Fq(e){const t=function(e){return Py(e,"qDimensionInfo",[])}(e);return t.map(e=>e.qGroupPos)}const jq={},zq=Lx.bind(null,!0);function Hq(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const Bq=Array.isArray,Vq=function(e){return void 0===e};function $q(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function Wq(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach((t,i)=>{i!==n.length&&(r=+t,e[r||t]=Vq(e[r||t])?Number.isNaN(+r)?{}:[]:e[t],e=e[r||t])}),e}function Uq(e,t){if(Hq(e)&&Hq(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!Uq(e[n],t[n]))return!1;return!0}if(Bq(e)&&Bq(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(!Uq(e[n],t[n]))return!1;return!0}return e===t}jq.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach(i=>{const o=function(e){return e&&(e=zq({},{val:e}).val),e}(t[i]),s=e[i],a=`${n}/${i}`;Uq(o,s)||$q(t,i)||(Vq(s)?r.push({op:"add",path:a,value:o}):Hq(o)&&Hq(s)?r=r.concat(jq.generate(s,o,a)):Bq(o)&&Bq(s)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o,s,a=-1;function l(e,t,n){if(e[n]&&Vq(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,r=e.length;n<r;n++)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(Uq(t,i))return r;if(null===t[0]||!Vq(t[0])&&Vq(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(o=i.length-1;o>=0;--o)a=l(t,i[o]&&i[o].qInfo&&i[o].qInfo.qId,o),-1===a?(r.push({op:"remove",path:`${n}/${o}`}),i.splice(o,1)):r=r.concat(jq.generate(i[o],t[a],`${n}/${o}`));for(o=0,s=t.length;o<s;++o)a=l(i,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===a?(r.push({op:"add",path:`${n}/${o}`,value:t[o]}),i.splice(o,0,t[o])):a!==o&&(r.push({op:"move",path:`${n}/${o}`,from:`${n}/${a}`}),i.splice(o,0,i.splice(a,1)[0]));return r}(s,o,a)):r.push({op:"replace",path:`${n}/${i}`,value:o}))}),Object.keys(e).forEach(i=>{Vq(t[i])&&!$q(e,i)&&r.push({op:"remove",path:`${n}/${i}`})}),r},jq.apply=function(e,t){t.forEach(t=>{const n=Wq(e,t.path);let r=t.path.split("/").splice(-1)[0];const i=r&&Number.isNaN(+r)?n[r]:n[+r]||n,o=t.from?t.from.split("/").splice(-1)[0]:null;if("add"===t.op||"replace"===t.op)if(Bq(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(Bq(i)&&Bq(t.value)){const e=t.value.slice();i.length=0,i.push.apply(i,e)}else Hq(i)&&Hq(t.value)?(s=i,Object.keys(s).forEach(e=>{Object.getOwnPropertyDescriptor(s,e).configurable&&!$q(s,e)&&delete s[e]}),zq(i,t.value)):n[r]=t.value;else if("move"===t.op){const i=Wq(e,t.from);Bq(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(Bq(n)?n.splice(+r,1):delete n[r]);var s})},jq.clone=function(e){return zq({},e)},jq.createPatch=function(e,t,n){const r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},jq.updateObject=function(e,t){Object.keys(e).length?jq.apply(e,jq.generate(e,t)):zq(e,t)};class Yq{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=jq.generate(e,t);return Lx(!0,e,t),n&&n.length?(n=n.map(e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path})),this._model.applyPatches(n,!0).then(()=>!0)):Promise.resolve(!1)}async mergeSoftPatches(){if(!this._model)return;const e=this._model.getProperties(),t=this._model.getEffectiveProperties(),n=await e,r=await t;if(n.qExtendsId)return;const i=jq.generate(n,r);jq.apply(n,i);const o=this;o._model.setProperties(n).then(()=>{o._model.clearSoftPatches()})}}var Kq={canModifyHardProperties:function(e){if(e.qHasSoftPatches||e.qExtendsId)return!1;if(e.permissions)return e.permissions.update;return-1!==e.qMeta.privileges.indexOf("update")}};var Xq={saveDerivedProperties:function(e,t,n,r){if(Kq.canModifyHardProperties(t))return e.setProperties(n);return new Yq(e).saveSoftProperties(r,n)}};var Gq={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function Jq(){this._generationInProgress=!1}function Zq(e){Gq.validate(e);const t=e.properties,n=Oq.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}Jq.prototype.isDerivedUpToDate=Zq,Jq.prototype.updateDerivedProperties=function(e){if(Gq.validate(e),this._generationInProgress)return Promise.resolve(!0);if(Zq(e)){const t=e.layout.qUndoExclude&&e.layout.qUndoExclude.hashCode===e.properties.qUndoExclude.hashCode;return Promise.resolve(!t)}const t=this,n=e.model,r=e.layout,i=Lx(!0,{},e.properties),o=Lx(!0,{},i);return this._generationInProgress=!0,Oq.updateHash(i,e.hashData),e.generateDerivedProperties(r,i).then(()=>Xq.saveDerivedProperties(n,r,i,o).then(()=>(t._generationInProgress=!1,Promise.resolve(!0))))},Jq.prototype.addDefaultHyperCubeHash=function(e,t,n,r){return Pq.getDefaultHashDataForHyperCube(e,t,n).then(e=>Lx(!0,r,e))};var Qq,eM={exports:{}};var tM=(Qq||(Qq=1,function(e){e.exports=function(){function e(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function r(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?n(Object(i),!0).forEach(function(n){e(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function i(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function o(e){var t=i(e,"string");return"symbol"==typeof t?t:t+""}var s=Object.prototype.hasOwnProperty,a=Object.prototype.toString,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===a.call(e)},h=function(e){if(!e||"[object Object]"!==a.call(e))return!1;var t,n=s.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&s.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||s.call(e,t)},d=function(e,t){l&&"__proto__"===t.name?l(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},f=function(e,t){if("__proto__"===t){if(!s.call(e,t))return;if(c)return c(e,t).value}return e[t]},p=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,p=!1;for("boolean"==typeof a&&(p=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=f(a,n),a!==(i=f(t,n))&&(p&&i&&(h(i)||(o=u(i)))?(o?(o=!1,s=r&&u(r)?r:[]):s=r&&h(r)?r:{},d(a,{name:n,newValue:e(p,s,i)})):void 0!==i&&d(a,{name:n,newValue:i}));return a};function m(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=i.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map(e=>e.instance).indexOf(e),a=i.wrappedFields[t].attrExps.map(e=>e.instance).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(r)&&r.some((e,t)=>e!==t)){const e=r.indexOf(s);-1!==e&&(s=e)}return s-=t.qArea.qLeft,s<0||s>=t.qArea.qWidth?-1:l>=0?e=>e[s].qAttrDims.qValues[l]:a>=0?e=>e[s].qAttrExps.qValues[a]:e=>e[s]}function g(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function y(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:s,row:a,sourceKey:l,target:c,targetProp:u,columnOrder:h}=e,d=r;if(i.field&&i.field!==n){const e=m(i.field,o,{cache:t},h);if(-1===e)return;d=p({qRow:s},e(a))}c[u]=g(i,d,{key:l})}function v(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const s=t.raw(),a=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:c,main:u}=r.normalizeConfig(i[e],t),h=Object.keys(c),d=!!i[e].trackBy,f=typeof i[e].trackBy,v={},b=[],x=[];for(let t=0;t<s.qDataPages.length;t++){const o=m(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let m=0;m<s.qDataPages[t].qMatrix.length;m++){const w=s.qDataPages[t].qArea.qTop+m,q=p({qRow:w},o(s.qDataPages[t].qMatrix[m])),M=g(u,q,{key:a});if(!u.filter||u.filter(q)){for(let e=0;e<h.length;e++){const r=c[h[e]];let i=r.fields||[r];r.fields&&(M[h[e]]=[]);for(let o=0;o<i.length;o++)y({cache:n,f:l,mainCell:q,p:i[o],prop:h[e],page:s.qDataPages[t],rowIdx:w,row:s.qDataPages[t].qMatrix[m],sourceKey:a,target:r.fields?M[h[e]]:M,targetProp:r.fields?o:h[e],columnOrder:s.qColumnOrder});if(r.fields){const t=M[h[e]].map(e=>e.value),n=M[h[e]].map(e=>e.label);M[h[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(M[h[e]].value)}}}d&&r.track({cfg:i[e],itemData:q,obj:M,target:b,tracker:v,trackType:f}),x.push(M)}}}const w=d?r.collect(b,{main:u,propsArr:h,props:c}):x;o=[...o,...w]}return o}function b(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function x(){return this.eachAfter(b)}function w(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function q(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this}function M(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this}function S(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function D(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function _(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function k(e){for(var t=this,n=C(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function C(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function E(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function A(){return Array.from(this)}function T(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function I(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*N(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}function R(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=L)):void 0===t&&(t=P);for(var n,r,i,o,s,a=new z(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new z(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(j)}function O(){return R(this).eachBefore(F)}function P(e){return e.children}function L(e){return Array.isArray(e)?e[1]:null}function F(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function j(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function z(e){this.data=e,this.depth=this.height=0,this.parent=null}function H(e){return null==e?null:B(e)}function B(e){if("function"!=typeof e)throw new Error;return e}z.prototype=R.prototype={constructor:z,count:x,each:w,eachAfter:M,eachBefore:q,find:S,sum:D,sort:_,path:k,ancestors:E,descendants:A,leaves:T,links:I,copy:O,[Symbol.iterator]:N};var V={depth:-1},$={},W={};function U(e){return e.id}function Y(e){return e.parentId}function K(){var e,t=U,n=Y;function r(r){var i,o,s,a,l,c,u,h,d=Array.from(r),f=t,p=n,m=new Map;if(null!=e){const t=d.map((t,n)=>X(e(t,n,r))),n=t.map(G),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(G(e)),d.push(W));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,i=d.length;s<i;++s)o=d[s],c=d[s]=new z(o),null!=(u=f(o,s,r))&&(u+="")&&(h=c.id=u,m.set(h,m.has(h)?$:c)),null!=(u=p(o,s,r))&&(u+="")&&(c.parent=u);for(s=0;s<i;++s)if(u=(c=d[s]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===$)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===W&&1===a.children.length;)a=a.children[0],--i;for(let e=d.length-1;e>=0&&(c=d[e]).data===W;--e)c.data=null}if(a.parent=V,a.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(j),a.parent=null,i>0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=H(e),r):t},r.parentId=function(e){return arguments.length?(n=H(e),r):n},r.path=function(t){return arguments.length?(e=H(t),r):e},r}function X(e){let t=(e=`${e}`).length;return J(e,t-1)&&!J(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}function G(e){let t=e.length;if(t<2)return"";for(;--t>1&&!J(e,t););return e.slice(0,t)}function J(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function Z(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=Z(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=Z(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function Q(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...Q(e[i].children,t-1,n)]);return r}function ee(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const r=Math.max(0,Math.min(100,t-e));return e=>Q(e.children,r-1,n)}return!1}function te(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}const ne=/^qDimensionInfo(?:\/(\d+))?/,re=/^\/?qMeasureInfo\/(\d+)/,ie=/\/qAttrExprInfo\/(\d+)/,oe=/\/qAttrDimInfo\/(\d+)/;function se(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}function ae(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function le(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,s=-1,a=-1,l=-1,c=-1,u=-1,h=r;const d=n.qEffectiveInterColumnSortOrder,f=ae(n);return ne.test(h)&&(i=!0,o=+ne.exec(h)[1],h=r.replace(ne,"")),re.test(h)&&("K"===n.qMode?c=+re.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+re.exec(h)[1],u=0):u=+re.exec(h)[1],h=h.replace(re,"")),h&&(oe.exec(h)?a=+oe.exec(h)[1]:ie.exec(h)&&(s=+ie.exec(h)[1])),l=i?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function ce(e,t){let n,r,i=ee(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function ue(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function he(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,m,g,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,r)),"function"==typeof h.label&&(f=e=>h.label(e,r)),h.accessor?(m=h.accessor(r),Array.isArray(m)?(g=m.map(h.valueAccessor),h.attrAccessor&&(g=g.map(h.attrAccessor)),d&&(p=g.map(d),d=null),f&&(y=g.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(m)):h.valueAccessor(m),y=p)):(p=i,y=i)),a.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,r):c,label:"function"==typeof a.label?a.label(u,r):u})}}const de=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=Z(r,e);return o&&o[0]?(t.tree=R(o[0],n.children||(e=>e[i])),t.tree):null};function fe(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=se(e),i=e.fields(),o=e.fields().filter(e=>"dimension"===e.type()).map(e=>n.indexOf(i.indexOf(e))),s=e.fields().filter(e=>"measure"===e.type()).map(e=>n.indexOf(i.indexOf(e))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let i="__root",c=!1;for(let e=0;e<o.length;e++){var l;const t=n[o[e]],s="".concat(i,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);a[s]||(a[s]=r({__id:s,__parent:i,qValues:[]},t),c=!0),i=s}if(c)for(let e=0;e<s.length;e++){const t=n[s[e]];a[i].qValues.push(t)}}const c=Object.keys(a).map(e=>a[e]);return K().id(e=>e.__id).parentId(e=>e.__parent)(c)}const pe=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:s}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],a=i.fields?i.fields:[i];for(let e=0;e<a.length;e++){const t=a[e];if(t.field!==s){const e=ce(o,le(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function me(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const o=t.raw(),s=t.key(),a="S"===o.qMode?fe(t):de(o,n,e);if(!a)return null;const l=a.height,c=[];for(let s=0;s<=l;s++){let a=null;if(s>0)if("S"===o.qMode){let e=ae(o)[s-1];a=n.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[s-1];s>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),a=n.fields[e]}const{props:l,main:u}=i.normalizeConfig(r(r({},e),{},{field:a?a.key():void 0}),t),h=Object.keys(l);c[s]={propsArr:h,props:l,main:u};const d=a?le(a,{cube:o}):{fieldDepth:0};pe({propsArr:h,props:l,cube:o,cache:n,itemDepthObject:d,f:a})}const u=a.copy().descendants(),h=a.descendants();for(let e=0;e<h.length;e++){const t=c[h[e].depth].propsArr,n=c[h[e].depth].props,r=c[h[e].depth].main,i=u[e],o=i.data,a=ue(r,o,{key:s});he({propsArr:t,props:n,item:i,itemData:o,ret:a,sourceKey:s}),h[e].data=a}return a}function ge(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<i.length;s++)if(void 0!==i[s].field){const a=t.raw(),l=t.key();if(!de(a,n,e))continue;const c="object"==typeof i[s].field?i[s].field:t.field(i[s].field),{props:u,main:h}=r.normalizeConfig(i[s],t),d=Object.keys(u),f=le(c,{cube:a}),{nodeFn:p,attrFn:m,valueFn:g}=ce({fieldDepth:0},f);pe({propsArr:d,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!i[s].trackBy,v=typeof i[s].trackBy,b={},x=[],w=p(n.tree),q=[];for(let e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(h.filter&&!h.filter(n))continue;const o=ue(h,n,{key:l});he({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[s],itemData:n,obj:o,target:x,tracker:b,trackType:v}),q.push(o)}const M=y?r.collect(x,{main:h,propsArr:d,props:u}):q;o=[...o,...M]}return o}function ye(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self;var ve=ye(function(e){
|
|
27
27
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
28
|
-
!function(t,n){e.exports=n()}(0,function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0===+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(h=t[0]).length%l,d=h.length,b=0;b<d;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}})});const be=1e-15;function xe(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const we={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"},qe=/%\)?$/,Me=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Se=/^\(oct\)/i,De=/^\(dec\)/i,_e=/^\(hex\)/i,ke=/^\(bin\)/i,Ce=/^\(rom\)/i,Ee=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Ae=/#|0/g;function Te(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function Ie(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<s.length;n++)if(s[n]<=i){r+=a[n],i-=s[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}function Ne(e,t,n){let r;return Me.test(t)?e=Te(e,Number(/\d{2}/.exec(t)[0]),t,n):Se.test(t)?e=Te(e,8,t,n):De.test(t)?e=Te(e,10,t,n):_e.test(t)?e=Te(e,16,t,n):ke.test(t)?e=Te(e,2,t,n):Ce.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=Ie(e,t)):t+r+e.toExponential(0)),e}function Re(e,t,n){const r=xe(e);return n?r:new RegExp(r||"",t)}function Oe(e,t){return t&&(t=xe(t)),e&&(e=xe(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}function Pe(e,t){if(!e||!e.qNumericalAbbreviation)return we;const n={};return e.qNumericalAbbreviation.split(t).forEach(e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])}),n}function Le(e,t,n,r){let i,o,s,a,l,c,u,h,d,f=e.pattern;r&&(e.abbreviate=!0),d=Oe(t,n),s=f.match(d),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(i=s.split(n),o=i.pop(),s=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(Re(c,"g"),t)),u=n,n=".",u&&(s=s.replace(Re(u,"g"),n)),h=s.match(/#/g),h=h?h.length:0;const p=f.split(u);let m;p[1]&&(m=p[1].match(Ae)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=m?m.length:2,e.percentage=qe.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(Re(t,null,!0),"|").concat(Re(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class Fe{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=Pe(e,this.patternSeparator),this.prepare()}clone(){const e=new Fe(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Ee.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Ee.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Ee.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||Le(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&Le(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&Le(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=Ne(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let r,i,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(r=t[a-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(h=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+be*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=ve(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+be).toFixed(t).slice(2).replace(/0+$/,"");for(a=i.length;a<n;a++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),a=0;a<t;a++)l+="#";e=ve(l,e)}e=e.replace(u.numericRegex,e=>e===s?u.groupTemp:e===o?u.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function je(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Fe(...t)}function ze(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=e=>e}=t;let o,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return s=i(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=i(t),o.has(s)?o.get(s):o.set(s,e(t))),o.set=(e,t)=>(c>=n&&(delete a[l[u]],delete l[u],c--,u++),a[e]=t,l[c]=e,c++,t),o.get=e=>a[e],o.has=e=>e in a,o.clear=()=>{a=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function He(e,t,n,r,i){const o=je(i,e,t,n,r),s=ze(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,r){return s.clear(),o.format(t,e,n,r)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const Be={DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},Ve=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$e=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],We=["January","February","March","April","May","June","July","August","September","October","November","December"],Ue=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ye=86400;function Ke(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Xe(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}function Ge(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Je(e){const t=e,n=24*Ge(t),r=60*Ge(n),i=60*Ge(r),o=1e3*Ge(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}function Ze(e,t){let n,r=Je(e),i=r.d,o=r.h,s=r.m,a=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(Ye*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:s,s:a,f:l,t:u}}function Qe(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Ke("".concat(t.year).slice(-2),2),YYY:Ke("".concat(t.year).slice(-3),3),def:e=>Ke("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:Ke("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Ke("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>Ke("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>Ke("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>Ke("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>Ke("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}class et{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:Ve,qDayNames:$e,qLongMonthNames:We,qMonthNames:Ue}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),t||(t={[Be.TIME]:r.qTimeFmt||"hh:mm:ss",[Be.DATE]:r.qDateFmt||"YYYY-MM-DD",[Be.DATE_TIME]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new et(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=Xe(e,n):(e<0&&(e=-e,t="-".concat(t)),r=Ze(e,t));const i=Qe(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const s=new RegExp(o.join("|"),"g"),a=t.replace(s,e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r});return a}}function tt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new et(...t)}const nt=864e5;function rt(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(nt*(e-Math.floor(e)))))}function it(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=tt(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=ze(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==Be.INTERVAL?rt(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=tt(i,e,t),r=ze(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function ot(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return it(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",s=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(i,"##"),o="U"),He(n,r,i,o,t)}function st(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:s,type:a,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=s||("dimension"===a?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u=e=>(null==e?void 0:e.qText)||"",h="dimension"===a?"first":"avg",d=ot(t,i),f="dimension"===a?"first":(e,t)=>d(t),p={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>a,origin:()=>l,items:()=>(e||(e=o(p)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:u,reduce:h,reduceLabel:f,formatter:()=>d,tags:()=>t.qTags};return p}function at(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const s="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),a={instance:st(p({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},i))};return a.attrDims=at("qAttrDimInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=at("qAttrExprInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=at("qMeasureInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a})}function lt(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=t;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=lt.util,a={cache:i,cube:o,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},l={key:()=>e,raw:()=>o,field:e=>te(e,a),fields:()=>i.fields.slice(),extract:e=>a.extractor(e,l,i,s),hierarchy:e=>a.hierarchy(e,l,i,s),_cache:()=>i};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(a.extractor=ge,a.hierarchy=me,a.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(a.extractor=v,a.pages=o.qDataPages,a.hierarchy=me):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},l,i,s);const c="S"===o.qMode?e=>e.qElemNumber:void 0,u="S"===o.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...at("qDimensionInfo",o,e,"",p({},a,{value:c,type:"dimension"}))),i.wrappedFields.push(...at("qMeasureInfo",o,e,"",p({},a,{value:u,type:"measure"}))),i.fields=i.wrappedFields.map(e=>e.instance);const h=e=>{e.forEach(e=>{i.allFields.push(e.instance),h(e.measures),h(e.attrDims),h(e.attrExps)})};return h(i.wrappedFields),(n.virtualFields||[]).forEach(t=>{const n=l.field(t.from),o=st(r({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},l,i,s),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));i.virtualFields.push(o)}),i.allFields.push(...i.virtualFields),l}const ct=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ut=/\/qDimensionInfo(?:\/(\d+))?/,ht=/\/qMeasureInfo\/(\d+)/,dt=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,ft=/\/qAttrExprInfo\/(\d+)/,pt=/\/?qHyperCube/,mt=/\/?qTreeData/,gt=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),yt=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function vt(e,t){let n=e,r=-1,i=-1,o="",s=e=>e;pt.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=gt):mt.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=yt);let a=!0;if(ut.test(e)&&(r=+ut.exec(e)[1]),ht.test(e)&&(i=+ht.exec(e)[1]),dt.test(e)){i=-1,r=0;const e=+dt.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),a=!1}if(ft.test(e)){const e=i;if(t){i=0;const s=Z(o,t);i+=(s.qMeasureInfo||[]).length,r>-1?(i=s.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=s.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=s.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+ft.exec(n)[1]}else r>-1?(r=-1,i=+ft.exec(n)[1]):i+=+ft.exec(n)[1]+1}return ct.forEach(e=>{let[t,r]=e;n=n.replace(t,r)}),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}function bt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],s={},a=e.isActive();let l=!1;return e.brushes().forEach(e=>{const t=vt(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach(e=>s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach(e=>s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach(e=>s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,a=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));(0===o||a>=o)&&o>-1?n.forEach(e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})}):n.forEach(e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})}),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map(e=>+e).filter(e=>!isNaN(e)),l=!!s.selectHyperCubeCells.values.length);else{const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}}),!l&&a?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]}),s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o);var c}function xt(e){lt.util=e.data("matrix").util,e.data("q",lt),e.formatter("q-number",He),e.formatter("q-time",it)}return xt.qBrushHelper=bt,xt.selections=bt,xt}()}(eM)),eM.exports),nM=n(tM);const rM={brushInterceptors:{DIM_VALUE_NULL:-2,DIM_VALUE_TOTAL:-3,brushOnlyOne:function(e,t){const n=e.brushes().filter(e=>"value"===e.type);let r=[];n.length&&n.forEach(e=>{r=r.concat(e.brush.values().map(t=>({key:e.id,value:t})))});return r.concat(t)},filterValues:function(e,t){const n=this;let r,i;const o=[];let s=0;const a=[];return t.forEach(t=>{t.value!==n.DIM_VALUE_NULL&&t.value!==n.DIM_VALUE_TOTAL&&(i=function(e,t){const n=t.key.indexOf("qHyperCube")+10,r=t.key.substr(0,n),i=t.key.substr(n+1);return e.dataset(r).field(i)}(e,t),r=i&&i.raw(),r.qLocked?(o.push(r),s++):a.push({key:t.key,value:t.value}))}),{items:a,itemsAreLocked:s>0&&s===t.length,lockedFields:o}}}};const iM={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function oM(e){if(!e||!e.chartInstance||!e.selectionsApi)throw Error("Selections-handler: Missing input");const t=e.chartInstance,n=e.selectionsApi,r=e.dataPaths||[""],i=e.selectPaths,o=e.lasso;let s=[];const a={propertiesToRestore:{}};let l=!1;const c=function(e,t,n){function r(){}return r.update=function(e,r,i){t.isActive()||t.begin(n),nM.qBrushHelper(i).forEach(e=>{t.select(e)})},r.toggleValues=function(r,i,o){const s=rM.brushInterceptors.filterValues(e,r),a=s.items;return t.isActive()||s.itemsAreLocked||!(o||a.length>0)||(t.begin(n),i.start(),i.emit("update",[],[])),a},r}(t,n,i),u={};let h=!1;function d(e){16===e.keyCode&&e.shiftKey!==h&&(h=e.shiftKey,o.toggle())}function f(e){const t=e.keyCode;27===t?n.cancel():13===t&&n.confirm()}function p(){s.forEach(e=>{e.listeners.update=function(t,n){e.sleep||c.update(t,n,e.brush)},e.brush.on("update",e.listeners.update),e.brush.on("start",e.listeners.start)})}function m(){s.forEach(e=>{e.brush.removeListener("update",e.listeners.update),e.brush.removeListener("start",e.listeners.start)})}return n.on("cleared",()=>{s.forEach(e=>{e.brush.clear(),e.dependentComponents.forEach(e=>{const n=t.component(e.id);n&&n.emit(e.clear)})})}),u.setUp=function(e){u.tearDown();const t=this.setUpBrush(e);return l&&p(),t},u.setUpBrush=function(e){const n=Lx(!0,{},iM,e),i={on:"tap",action:t=>t.ctrlKey||e.isSingleSelect?"set":"toggle",contexts:n.contexts,data:n.data,globalPropagation:"stop"},o={context:n.contexts[0],data:n.data,style:n.style},a=function(e,t){return{brush:t.brush(e.contexts[0]),listeners:{},dependentComponents:[],id:e.contexts[0]}}(n,t);return a.listeners.toggle=function(e){if(!l)return[];const i=function(){const e=[];let n=r.map(e=>t.dataset(e).fields().filter(e=>"dimension"===e.type()));n=[].concat.apply([],n);for(let t=0;t<n.length;t++)n[t].raw().qLocked&&e.push(n[t].raw());return{fields:e,areAllFieldsLocked:e.length&&e.length===n.length}}();return n.startOnEmptySelection&&0===e.length&&i.areAllFieldsLocked?[]:c.toggleValues(e,a.brush,n.startOnEmptySelection)},a.brush.intercept("toggle-values",a.listeners.toggle),a.brush.intercept("add-values",a.listeners.toggle),a.brush.intercept("remove-values",a.listeners.toggle),a.brush.intercept("set-values",a.listeners.toggle),a.listeners.start=function(){s.length>1&&s.forEach(e=>{e!==a&&e.brush.end()})},s.push(a),{trigger:i,consume:o}},u.setUpStart=function(){u.tearDown()},u.setUpDone=function(){l&&p()},u.tearDown=function(){l&&m(),s.forEach(e=>{e.brush.removeInterceptor("toggle-values",e.listeners.toggle),e.brush.removeInterceptor("add-values",e.listeners.toggle),e.brush.removeInterceptor("remove-values",e.listeners.toggle),e.brush.removeInterceptor("set-values",e.listeners.toggle)}),s=[]},u.pauseEngineCalls=function(e){s.forEach(t=>{t.id===e&&(t.sleep=!0)})},u.resumeEngineCalls=function(e,t){s.forEach(n=>{n.id===e&&(n.sleep=!1,t&&n.listeners.update([],[]))})},u.addComponent=function(e,t){s.forEach(n=>{n.id===e&&n.dependentComponents.push(t)})},u.on=function(){if(l)return;l=!0,p(),document.addEventListener("keydown",d),document.addEventListener("keyup",d);const e=()=>{s.forEach(e=>{e.brush.end()}),document.removeEventListener("keyup",f),o.active()&&o.toggle()};n.on("deactivated",e),a.unbindDeactivated=()=>{n.removeListener("deactivated",e)};const t=()=>{document.addEventListener("keyup",f)};n.on("activated",t),a.unbindActivated=()=>{n.removeListener("activated",t)}},u.isOn=()=>l,u.off=function(){l&&(l=!1,m(),document.removeEventListener("keydown",d),document.removeEventListener("keyup",d),document.removeEventListener("keyup",f),a.unbindActivated(),a.unbindDeactivated())},u.lassoState=function(){return o.active()&&!(e.isLassoDisabled&&e.isLassoDisabled())},u.allFieldsLocked=function(){return function(){let e=r.map(e=>t.dataset(e).fields().filter(e=>"dimension"===e.type()));return e=[].concat.apply([],e),e.length&&e.every(e=>e.raw().qLocked)}()},u}class sM{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var aM={create:e=>e.selectionsApi?oM(e):new sM};var lM={isOnComponentForRange:function(e,t,n){return!!e&&!!n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter(e=>-1!==t.indexOf(e.settings.key))[0]},isOnComponentForLasso:function(e,t,n){return e&&n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter(e=>e.settings.key===t.keys.componentKey)[0]},isOnComponentForNavBtn:function(e,t,n){return n.chart.componentsFromPoint(e.center).some(e=>e.settings.key===t)}};var cM={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:yg.DIRECTION_ALL,threshold:1,enable(r,i){if(e.lassoing)return t.isSelectionEnabled();const o=lM.isOnComponentForLasso(i,n,this);return t.isSelectionEnabled()&&i&&((s=n.handlers).selectionHandler.lassoState()&&!s.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var s},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(r){lM.isOnComponentForLasso(r,n,this)&&(t.switchTo("lasso",this.chart,r),e.lassoing=!0,n.handlers.selectionHandler.pauseEngineCalls(n.keys.lassoBrushKey),r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoStart",r))},lassomove(n){e.lassoing&&(n.clientX=n.pointers[0].clientX,n.clientY=n.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoMove",n))},lassoend(r){e.lassoing&&(r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoEnd",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!0),e.lassoing=!1)},lassocancel(r){e.lassoing=!1,t.doEmit(this.chart,"lasso","lassoCancel",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!1)}}}}};var uM={callMeasureRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?yg.DIRECTION_HORIZONTAL:yg.DIRECTION_VERTICAL,event:"measurerange",enable(i,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const s="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=lM.isOnComponentForRange(o,s,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!a,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(i){const o="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r];lM.isOnComponentForRange(i,o,this)&&(e.measureSelecting=!0,t.switchTo("measurerange",this.chart,i),t.doEmit(this.chart,"rangeMeasure","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.measureRangeBrushKey))},measurerangemove(n){e.measureSelecting&&t.doEmit(this.chart,"rangeMeasure","rangeMove",n)},measurerangeend(r){e.measureSelecting&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!0),t.doEmit(this.chart,"rangeMeasure","rangeEnd",r),e.measureSelecting=!1)},measurerangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!1),e.measureSelecting=!1}}}}};function hM(e,t){let n;return n="x-axis"===e?"horizontal"===t?yg.DIRECTION_VERTICAL:yg.DIRECTION_HORIZONTAL:"horizontal"===t?yg.DIRECTION_HORIZONTAL:yg.DIRECTION_VERTICAL,n}var dM={callAreaRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:hM(r,n.isHorizontal),event:"arearange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const s="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=lM.isOnComponentForRange(o,s,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!a,e.minoring}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(i){const o="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r];lM.isOnComponentForRange(i,o,this)&&(e.minoring=!0,t.switchTo("arearange",this.chart,i),t.doEmit(this.chart,"rangeMinor","areaStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.areaBrushKey))},arearangemove(r){e.minoring&&(this.chart.brush(n.keys.areaBrushKey).clear(),t.doEmit(this.chart,"rangeMinor","areaMove",r))},arearangeend(r){e.minoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!0),t.doEmit(this.chart,"rangeMinor","areaEnd",r),e.minoring=!1)},arearangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!1),e.minoring=!1}}}}};var fM={callDimensionRangeGesture:function(e,t,n,r){const i=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?yg.DIRECTION_VERTICAL:yg.DIRECTION_HORIZONTAL,event:"majorrange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const s="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=lM.isOnComponentForRange(o,s,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!a,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(i){const o="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r];lM.isOnComponentForRange(i,o,this)&&(e.majoring=!0,t.switchTo("majorrange",this.chart,i),t.doEmit(this.chart,"rangeDim","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.dimRangeBrushKey))},majorrangemove(n){e.majoring&&t.doEmit(this.chart,"rangeDim","rangeMove",n)},majorrangeend(r){e.majoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!0),t.doEmit(this.chart,"rangeDim","rangeEnd",r),e.majoring=!1)},majorrangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!1),e.majoring=!1}}}}};var pM={callDragGesture:function(e,t,n,r,i){let o={};return{type:"Pan",options:{direction:n.isHorizontal?yg.DIRECTION_VERTICAL:yg.DIRECTION_HORIZONTAL,event:"drag",enable(r,i){return e.dragging?t.isNavigationEnabled():(e.dragging=t.isNavigationEnabled()&&!!i&&!!this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter(e=>e.settings.key===n.keys.componentKey)[0],e.dragging)}},requireFailure:r?`lasso ${t.getBrushConfig()}`:"",events:{dragstart(e){o={x:e.deltaX,y:e.deltaY};let t=-(n.isHorizontal?e.deltaY:e.deltaX)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(t=-t),n.handlers.scrollHandler.getScrollApi().move(t)},dragmove(t){if(!e.dragging)return;let r=-(n.isHorizontal?t.deltaY-o.y:t.deltaX-o.x)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(r=-r),n.handlers.scrollHandler.getScrollApi().move(r),o={x:t.deltaX,y:t.deltaY}},dragend(){e.dragging&&(e.dragging=!1)},dragcancel(){e.dragging=!1}}}}};var mM={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,r){return!(!r||!e())&&lM.isOnComponentForNavBtn(r,t,this)}},events:{navBtnTap(e){this.chart.componentsFromPoint(e.center).forEach(t=>{const n=e.target,r=n?n.getAttribute("data-action"):"";if(r)return t.emit(r)})}}}}};var gM={create:function(e,t,n,r,i){const o={};t=t||"vertical";const s=r.lassoBrushKey||"select",a=r.dimRangeBrushKey||null,l=r.measureRangeBrushKey||null,c=r.areaBrushKey||null,u=r.legendBrushKey||null,h=!!e.selectionHandler&&e.selectionHandler.isOn(),d={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},f={gesture:"",type:""},p="horizontal"===t,m=p?"y-axis":"x-axis",g=p?"x-axis":"y-axis";function y(e,t,n){if(f.gesture===e)return;let r=s;const i=t||f.chart;switch(f.gesture){case"majorrange":v(i,"rangeDim","rangeClear",n),r=a;break;case"measurerange":v(i,"rangeMeasure","rangeClear",n),r=l;break;case"arearange":v(i,"rangeMinor","areaClear",n),r=c}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&i.brush(r).clear(),f.chart=t,f.type=o}function v(e,t,n,r){if(e){const i=e.component(t);i&&i.emit(n,r)}}let b=[];const x={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:v,switchTo:y,getBrushConfig:function(){return a?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},w={handlers:e,keys:r,isHorizontal:p,active:f,rangeSelStatus:i};function q(){y("none"),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}return h&&(b=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){y("none",this.chart,e),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}}}],b.unshift(mM.callNavBtnGesture(x.isNavigationEnabled,u)),b.push(cM.callLassoGesture(d,x,w)),a?l?(b.push(fM.callDimensionRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(uM.callMeasureRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(b.push(fM.callDimensionRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(dM.callAreaRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"})):(b.push(uM.callMeasureRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),b.push(dM.callAreaRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(b.push(pM.callDragGesture(d,x,w,h,n)),e.scrollHandler.getScrollApi().on("update",q)),o.gestures=b,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",q)},o}};function yM(e,t,n,r,i){let o=!1;r=r||"tooltip",n=n||["self"];const s=e.brush(r),a={};function l(){if(o){e.component(i).emit("hide")}o=!1}return a.isOpen=function(){return o},a.closeTooltip=l,a.update=function(){const a=s.brushes(),c=e.getAffectedShapes(r,"and",n,t);a.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(i).emit("show",{},n)}(c)):l()},a.toggleInterceptor=function(e){if(n.length>1){const t={},n=[];return e.forEach(e=>{t[e.key]||(t[e.key]={}),t[e.key][e.value]||(t[e.key][e.value]=!0,n.push(e))}),n}return e},a}var vM={create:(...e)=>yM(...e)},bM={formatMeasureValue:function(e,t){if(e.raw().isCustomFormatted)return e.formatter()(t.value.qText);const n=void 0!==t.value.qNum?t.value.qNum:t.value.qValue;return e.formatter()(n)}};const xM=e=>({h:t,data:n,style:r})=>{const i=function(e,t){const n=e.chartInstance.dataset(e.dataPath),r=[],i=t.length-5,o=Math.min(5,t.length);for(let i=0;i<o;i++){const o=t[i],s={rows:[]};if(e.labelData){const t=[],i=e.labelData;let a=!1;for(let e=0;e<i.length;e++){const n=o.data[i[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){a=!0;break}t.push(o.data[i[e]].value.qText)}if(a)return;s.header=e.headerResolver(t),s.rows=e.measureRows.map(t=>{const r=o.data;return e.rowResolver(n.field(r[t].source.field),r[t],r)}).filter(e=>!!e);const l=wM(e,o);l&&s.rows.unshift(l),r.push(s)}}i>0&&(r.numberInExcess=i);return r.rowCount=r[0]?r.length*r[0].rows.length:0,r}(e,n),o={h:t,style:r,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,i)};function wM(e,t){var n,r,i;const o=t.data.color,s=null===(n=e.colorService)||void 0===n||null===(r=n.getSettings)||void 0===r?void 0:r.call(n);if(!s||"color"===s.type||!o||!s.fieldType)return;const a=[];e.data.forEach(e=>{const n=t.data[e];n&&a.push(n.value)});const l=function(e){let t=-1;for(let n=0;n<e.length;n++)-3===e[n]&&(t=n);return t}(a),{translator:c}=e,u=s.label;return{color:null===(i=t.attrs)||void 0===i?void 0:i.fill,label:u,value:-1!==l?c.get("properties.dimensionLimits.others"):o.label}}const qM="dist-flow-tooltip",MM=`#${qM}`;function SM(){if(!document.querySelector(MM)){const e=document.createElement("div");e.id=qM,e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function DM({key:e="tooltip",rtl:t,fontFamily:n,filter:r,content:i}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){SM()},beforeUpdate(){SM()},destroyed(){!function(){const e=document.querySelector(MM);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(MM),content:i,filter:r,extract:e=>e.node,direction:t?"rtl":"ltr",placement:"bounds"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:n,"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const{detectTextDirection:_M}=cq;const kM={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:bM.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:r,translator:i,rtl:o}=e,s=[],a=o?"right":"left";if(t.forEach(e=>{if(e.header){const t={...r.cell,textAlign:a,fontWeight:"bold",direction:_M(e.header)};s.push(n("tr",null,n("td",{style:t,colSpan:2},e.header)))}e.rows.forEach(e=>{let t=e.value;if(e.color){const r={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},i=n("div",{style:r});t=o?[e.value,i]:[i,e.value]}const i=o?[":",e.label]:[e.label,":"],l={...r.cell,textAlign:a,direction:_M(e.label)},c={...r.cell,textAlign:o?"left":"right",direction:_M(e.value)};s.push(n("tr",null,n("td",{style:l},i),n("td",{style:c},t)))})}),t.numberInExcess){const e=i.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...r.cell,textAlign:a,direction:_M(e)};s.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return s}};function CM(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let r={},i=!1;const o={};function s(e){e.listeners.update=function(t,n){e.action.update(t,n,e)},e.listeners.end=function(){e.action.closeTooltip()},e.brush.on(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.on("end",e.listeners.end),e.brush.intercept("set-values",e.action.toggleInterceptor)}function a(){Object.keys(r).forEach(e=>{l(r[e])})}function l(e){e.brush.removeListener(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.removeListener("end",e.listeners.end),e.brush.removeInterceptor("set-values",e.action.toggleInterceptor)}function c(){Object.keys(r).forEach(e=>{r[e].action.closeTooltip()})}function u(){c();for(const e in r)r[e].brush.clear()}return o.setUp=function(t){const o=Lx(!0,{},kM,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");r[o.contexts[0]]&&i&&l(r[o.contexts[0]]);const a=function(e,t){return{brush:t.brush(e.contexts[0]),action:vM.create(t,e.componentKey,e.data,e.contexts[0],e.tooltipKey),listeners:{},chartInstance:t,dataPath:e.dataPath,renderer:e.renderer,data:e.data,headerResolver:e.headerResolver,rowResolver:e.rowResolver,colorService:e.colorService,attrDimPath:e.attrDimPath,measureRows:e.measureRows,labelData:e.labelData,filterShapes:e.filterShapes,direction:e.environment.options.direction,theme:e.environment.theme,translator:e.environment.translator,treatAsDesktop:"touch"!==e.environment.deviceType}}(o,e);r[o.contexts[0]]=a,i&&s(a);const c=DM({key:o.tooltipKey,rtl:"rtl"===a.direction,fontFamily:a.theme.getStyle(n,"tooltip","fontFamily"),filter:(u=a.filterShapes,e=>u?u(e):function(e){const t=[];return e.forEach(e=>{-1===t.indexOf(e)&&"container"!==e.type&&t.push(e)}),t}(e)),content:xM(a,o.dataPath)});var u;return o.chartBuilder.getSettings().components.push(c),{trigger:{on:a.treatAsDesktop?"over":"tap",action:"set",contexts:o.contexts,data:o.data,globalPropagation:"stop"},consume:o.contexts.map(e=>({context:e})),component:c}},o.tearDown=function(){i&&a(),r=[]},o.closeTooltip=c,o.isOn=()=>i,o.on=function(){i||(i=!0,Object.keys(r).forEach(e=>{s(r[e])}),t&&t.on("mouseleave",u))},o.off=function(){i&&(i=!1,a(),t&&t.off("mouseleave",u),c())},o}var EM={create:(e,t,n)=>CM(e,t,n)};const AM=".scrollHandler";function TM(e,t,n,r,i){if(!e||!t||!n)throw Error("Scroll-handler: Missing input");this._chartInstance=e,this._$chartElement=t,this._getSlicedDataFn=n,this._on=!1,this._itemSize=30,this.options={direction:"vertical"},this._onScrollCallback=r,this._legendKey=i}function IM(){const e=("horizontal"===this.options.direction?this._$chartElement.width():this._$chartElement.height())||0,t=Math.floor(e/this.getItemSize());this._scrollViewSizeInItem=Math.max(t,1)}function NM(e){const t=function(e){let t=0,n=0,r=0;return e.wheelDelta&&(t=e.wheelDelta/60),e.detail&&(t=-e.detail/3),r=t,void 0!==e.axis&&e.axis===e.HORIZONTAL_AXIS&&(r=0,n=-1*t),void 0!==e.wheelDeltaY&&(r=e.wheelDeltaY/60),void 0!==e.wheelDeltaX&&(n=-1*e.wheelDeltaX/60),{delta:t,deltaX:n,deltaY:r,x:e.pageX,y:e.pageY}}(e.originalEvent);if(function(e,t,n,r){if(r&&n.componentsFromPoint(t).some(e=>e.settings.key===r))return n.component(r).emit(t.delta>0?"prev":"next"),e.preventDefault(),!0;return!1}(e,t,this._chartInstance,this._legendKey)||this._disabled||!this.getScrollApi())return;if(e.preventDefault(),!t.delta)return;const n=t.delta<0?3:-3;this._scrollApi.move(n)}function RM(){if(this._disabled||this._sizeChanged)return void(this._sizeChanged=!1);const e=this;this.getViewData().then(t=>{e._on&&!e._disabled&&e._onScrollCallback&&e._onScrollCallback(t,void 0,!0)}).catch(e=>{})}TM.prototype.getScrollApi=function(){this._scrollApi||(this._scrollApi=this._chartInstance.scroll("dimension"));return this._scrollApi},TM.prototype.setDisabled=function(e){this._disabled=e},TM.prototype.getDisabled=function(){return this._disabled},TM.prototype.setItemSize=function(e){this._itemSize!==e&&(this._itemSize=e,IM.call(this))},TM.prototype.getItemSize=function(){return this._itemSize},TM.prototype.getScrollViewSizeInItem=function(){this._scrollViewSizeInItem||IM.call(this);return this._scrollViewSizeInItem},TM.prototype.on=function(){if(this._on)return;this.getScrollApi()&&(this._scrollApi.removeAllListeners(),this._scrollApi.on("update",RM.bind(this)));this._$chartElement.on(`mousewheel${AM} DOMMouseScroll${AM}`,NM.bind(this)),this._$chartElement.on(`touchstart${AM}`,e=>{e.preventDefault()}),this._on=!0},TM.prototype.isOn=function(){return this._on},TM.prototype.off=function(){if(!this._on)return;this.getScrollApi()&&this._scrollApi.removeAllListeners();this._$chartElement.off(AM),this._on=!1},TM.prototype.updateViewState=function(e){IM.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem,max:e})},TM.prototype.onResize=function(){this._sizeChanged=!0,IM.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem})},TM.prototype.isDataSizeChanged=function(e,t){return Math.min(this.getScrollViewSizeInItem(),t)!==e},TM.prototype.resetScroll=function(){this.getScrollApi()&&this._scrollApi.moveTo(0)},TM.prototype.getViewData=function(){let e=0,t=0;if(this.getScrollApi()){const n=this._scrollApi.getState();e=Math.round(n.start),t=n.viewSize}return this._getSlicedDataFn(e,t)},TM.prototype.setOptions=function(e){this.options.direction!==e.direction&&(this._scrollViewSizeInItem=void 0);this.options=e},TM.prototype.getScrollState=function(){return this.getScrollApi().getState().start},TM.prototype.setScrollState=function(e){this.getScrollApi().moveTo(e)};const OM=166/26,PM=12/11;function LM(e){return(12*Math.min(e,3)+Math.max(e-3,0)*OM)/11}function FM(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),n=e.match(/[\u3040-\u309F]/g),r=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,n=n?n.length:0,r=r?r.length:0;const i=t+n+r;return{latin:e.length-i,cjk:i}}function jM(e,t){const n={latin:0,cjk:0};void 0===t?e.forEach(e=>{const t=FM(e.qText);n.latin+=t.latin,n.cjk+=t.cjk}):e.forEach(e=>{const r=FM(e[t].qText);n.latin+=r.latin,n.cjk+=r.cjk});const r=Math.max(1,n.latin+n.cjk);return n.latinRatio=n.latin/r,n.cjkRatio=n.cjk/r,n}function zM(e,t,n){return e*(e<=24?t:n)}var HM={endsWith:function(e,t){return-1!==e.indexOf(t,e.length-t.length)},startsWith:function(e,t){return 0===e.indexOf(t)},contains:function(e,t){if(!e)throw new Error("Haystack is undefined.");if(!t)throw new Error("Needle is undefined.");return-1!==e.indexOf(t)},stringWidthOverMWidth:LM,getCharacterRatios:FM,getTotalCharacterRatios:jM,getAdjustedMaxGlyphCount:function(e,t,n){const r=jM(t,n),i=r.latinRatio*e,o=r.cjkRatio*e;return Math.ceil(LM(i)+o*PM)},estimateLatinLabelWidth:zM,estimateLabelWidth:function(e,t,n,r,i){return e*n+zM(t,r,i)}};const BM={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:255,g:255,b:255,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},VM=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,$M=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,WM=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,UM=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,YM=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,KM=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,XM=Math.floor,GM=Math.round,JM=Vy.extend({init(){let e,t,n,r,i,o,s,a,l,c,u,h,d=0,f=0,p=0,m=1;if(this._invalid=!1,arguments[0]instanceof JM)d=arguments[0]._r,f=arguments[0]._g,p=arguments[0]._b,m=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(h=arguments[0],u=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(h))d=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10);else if(u=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(h))d=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10),m=parseFloat(u[4]);else if(u=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(h))d=parseInt(u[1],16),f=parseInt(u[2],16),p=parseInt(u[3],16),m=1;else if(u=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(h))d=parseInt(u[1]+u[1],16),f=parseInt(u[2]+u[2],16),p=parseInt(u[3]+u[3],16),m=1;else if(u=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=GM(255*d),f=GM(255*f),p=GM(255*p),m=1}else if(u=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),m=parseFloat(u[7]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=GM(255*d),f=GM(255*f),p=GM(255*p)}else if(u=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),i=parseFloat(u[5]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=i-o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=GM(255*d),f=GM(255*f),p=GM(255*p),m=1}else BM[h.toLowerCase()]?(n=h.toLowerCase(),d=BM[n].r,f=BM[n].g,p=BM[n].b,m="number"==typeof BM[n].a?BM[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(m=(4278190080&arguments[0])>>>24,m/=255,d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(d=arguments[0],f=arguments[1],p=arguments[2],m=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+d+f+p+m)&&(this._invalid=!0),this._r=XM(d),this._g=XM(f),this._b=XM(p),this._a=m,this._spaces={}},isInvalid(){return this._invalid},setAlpha(e){this._a=e,this._spaces={}},getAlpha(){return this._a},toRGB:function(){return this._spaces.rgb||(this._spaces.rgb=JM.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=JM.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=JM.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=JM.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=JM.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=JM.toHSLA(this,e)),this._spaces.hsla},toHSV(){const e=this.toHSVComponents();return`hsv(${e.h},${e.s},${e.v})`},toHSVComponents:function(){return this._spaces.hsvComp||(this._spaces.hsvComp=JM.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=JM.toNumber(this)),this._spaces.num},isDark(){return this.isInvalid()||this.getLuminance()<125},getLuminance(){return void 0===this._lumi&&(this._lumi=.299*this._r+.587*this._g+.114*this._b),this._lumi},shiftLuminance(e){const t=this.toHSLA(),n=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(t),r=parseFloat(n[1]),i=parseFloat(n[3]);let o=parseFloat(n[5]);const s=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${r},${i},${o},${s})`},isEqual(e){return e instanceof JM||(e=new JM(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[XM(this._r+(e._r-this._r)*t),XM(this._g+(e._g-this._g)*t),XM(this._b+(e._b-this._b)*t),XM(this._a+(e._a-this._a)*t)].join(",")})`},createShiftedColor(e){(void 0===e||Number.isNaN(+e))&&(e=1);const t=this.getLuminance(),n=this._g<126?1:1+this._g/512,r=this.shiftLuminance(20*(t*n<220?.8+1/(t+1)*4:-(.8+t/255*1))*e);return new JM(r)}});JM.toRGB=function(e){if(e instanceof JM)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=JM.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},JM.toRGBA=function(e,t){if(e instanceof JM)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=JM.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},JM.toHex=function(e){let t,n,r;return e instanceof JM?(t=e._r.toString(16),n=e._g.toString(16),r=e._b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${[t,n,r].join("")}`):("string"==typeof e&&(e=JM.toNumber(e)),t=((16711680&e)>>16).toString(16),n=((65280&e)>>8).toString(16),r=(255&e).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${t}${n}${r}`)},JM.toHSL=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new JM(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=Math.max(s,a,l),u=Math.min(s,a,l);if(r=t?.21*s+.72*a+.07*l:(c+u)/2,c===u)n=0,o=0;else{switch(i=c-u,n=r>.5?i/(2-c-u):i/(c+u),c){case s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsl(${360*o},${100*n},${100*r})`},JM.toHSLA=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new JM(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=e._a,u=Math.max(s,a,l),h=Math.min(s,a,l);if(r=t?.21*s+.72*a+.07*l:(u+h)/2,u===h)n=0,o=0;else{switch(i=u-h,n=r>.5?i/(2-u-h):i/(u+h),u){case s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsla(${360*o},${100*n},${100*r},${c})`},JM.toHSVComponents=function(e){let t,n,r=0;"string"==typeof e&&(e=new JM(e));const i=e._r/255,o=e._g/255,s=e._b/255,a=Math.max(i,o,s),l=Math.min(i,o,s),c=a;if(a===l)t=0,r=0;else{switch(n=a-l,t=0===n?0:n/c,a){case i:r=(o-s)/n+(o<s?6:0);break;case o:r=(s-i)/n+2;break;case s:r=(i-o)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*c}},JM.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof JM)return(arguments[0]._r<<16)+(arguments[0]._g<<8)+arguments[0]._b;let e,t,n=0,r=0,i=0;return 1===arguments.length&&"string"==typeof arguments[0]&&(t=arguments[0],(e=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i.exec(t))?(n=parseInt(e[1],10),r=parseInt(e[2],10),i=parseInt(e[3],10)):(e=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t))?(n=parseInt(e[1],16),r=parseInt(e[2],16),i=parseInt(e[3],16)):(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(t))&&(n=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16))),(n<<16)+(r<<8)+i},JM.blend=function(e,t,n){const r=(16711680&(e=JM.toNumber(e)))>>16,i=(65280&e)>>8,o=255&e;return(r+(((16711680&(t=JM.toNumber(t)))>>16)-r)*n<<16)+(i+(((65280&t)>>8)-i)*n<<8)+(o+((255&t)-o)*n)},JM.getBlend=function(e,t,n){const r=e._r+(t._r-e._r)*n,i=e._g+(t._g-e._g)*n,o=e._b+(t._b-e._b)*n,s=e._a+(t._a-e._a)*n;return new JM(r,i,o,s)},JM.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(VM.test(e)||$M.test(e)||WM.test(e)||UM.test(e)||YM.test(e)||KM.test(e)||BM[e.toLowerCase()])},JM.getBestContrast=function(e,t,n){const r=e.getLuminance();return Math.abs(r-t.getLuminance())>Math.abs(r-n.getLuminance())?t:n},JM.getContrast=function(e,t){if(!e||!t)return;const n=e.getLuminance()/100,r=t.getLuminance()/100;return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},JM.isDark=function(){const e={getLuminance:JM.prototype.getLuminance,isInvalid:JM.prototype.isInvalid};return JM.prototype.init.apply(e,[].slice.call(arguments)),JM.prototype.isDark.call(e)},JM.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const ZM={TRANSPARENT_BLACK:"rgba( 0,0,0,0.2 )",TRANSPARENT_WHITE:"rgba( 255,255,255,0.7 )",LIGHT_GREY:"#ccc",DARK_GREY:"#666",BLACK:"#000",WHITE:"#fff",getInverse(e){const t=new JM(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new JM(e);return 0===t.getAlpha()?this.DARK_GREY:JM.getBestContrast(t,new JM(ZM.LIGHT_GREY),new JM(ZM.DARK_GREY))},getBestContrast:(e,t,n)=>JM.getBestContrast(new JM(e),new JM(t),new JM(n)),getContrastingTransparent(e){const t=new JM(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};function QM(e,t){return Py(e,`${t=t?`${t}.`:""}qHyperCube.qDimensionInfo.length`)>1}function eS(e,t){if(Py(e,`${t=t?`${t}.`:""}qHyperCube.qStackedDataPages.0.qData.length`))return Py(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qSubNodes.length`,0)+Py(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qDown`,0)+Py(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qUp`,0);const n=Py(e,`${t}qHyperCube.qEffectiveInterColumnSortOrder.0`);return tS(Py(e,`${t}qHyperCube.qDimensionInfo.${n}`))}function tS(e){return e.qCardinalities.qHypercubeCardinal}var nS={getHyperCube:function(e,t){return e&&(e=t?Py(e,t):e)&&e.qHyperCube?e.qHyperCube:null},hasSecondDimension:QM,hasSecondMeasure:function(e,t){return Py(e,`${t=t?`${t}.`:""}qHyperCube.qMeasureInfo.length`)>1},getStackedCubeSizeOf2Dims:eS,getStackedCubeSizeOfMax2Dims:function(e,t){return QM(e,t)?eS(e,t):function(e,t){return Py(e,(t=t?`${t}.`:"")+"qHyperCube.qSize.qcy")}(e,t)},getOuterDimensionSizeOfMax2Dims:function(e,t){return QM(e,t)?eS(e,t):1},getDimensionSize:tS};const rS=function(){this._maxJitter=1};rS.prototype.calcMaxJitter=function(e,t,n){this._maxJitter=Math.min(e*t,n-e)},rS.prototype.getJitterValue=function(e){const t=Math.abs(Rq(`${e}`)%10)/9;return this._maxJitter/2-t*this._maxJitter};var iS={toBefore:function(e){const t=e.qUndoExclude.qHyperCube;2===t.qEffectiveInterColumnSortOrder.length&&0===t.qEffectiveInterColumnSortOrder[0]&&(t.qEffectiveInterColumnSortOrder=[1,0],t.qDimensionInfo.reverse())},toAfter:function(e){const t=e.qUndoExclude.qHyperCube;2===t.qEffectiveInterColumnSortOrder.length&&1===t.qEffectiveInterColumnSortOrder[0]&&(t.qEffectiveInterColumnSortOrder=[0,1],t.qDimensionInfo.reverse())}};var oS={generateHyperCube:function(e,t,n,r){t.qUndoExclude||(t.qUndoExclude={}),t.qUndoExclude.qHyperCubeDef=Lx(!0,{},t.qHyperCubeDef),t.qUndoExclude.qHyperCubeDef.qDimensions.reverse(),pw.updateHypercubeAttributes(t,"qUndoExclude.qHyperCubeDef.",t.color.point);let i=[];const o=t.qUndoExclude.qHyperCubeDef.qDimensions.length,s=t.color.point&&!t.color.point.auto&&"byExpression"===t.color.point.mode;if(o>0&&s){i=[cw.create(cw.IDMAP.COLOR_BY_EXPRESSION,{qExpression:yx(t,"color.point.expression.qValueExpression.qExpr")})]}return t.qUndoExclude.qHyperCubeDef.qMeasures[0].qAttributeExpressions=i,aw.hasMultipleDimensions(t)?Vx.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,n).then(i=>{zw.applySorting(t,e,n,i,r);const o=i.dimensions[0],s=i.dimensions[1],a=i.measures[0],l=Lw.getFractileExpression(1,o,s,a),c=Lw.getFractileExpression(0,o,s,a);t.qUndoExclude.qHyperCubeDef.qDimensions[0].qAttributeExpressions=[{qExpression:c,id:"minBoxValue"},{qExpression:l,id:"maxBoxValue"}]}):(t.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0],Promise.resolve())}};const sS=e=>e.baseColor||e.coloring&&e.coloring.baseColor;function aS(e){const{qDimensionInfo:t,qMeasureInfo:n}=e.qUndoExclude.qHyperCube,r=t.some(sS),i=n.some(sS),o=e.color.point.useBaseColors;return"measure"===o&&!i||"dimension"===o&&!r?"off":o}function lS({layout:e,localeInfo:t,model:n,picasso:r,environment:i}){const{app:o,theme:s,translator:a}=i,l=Lx(!0,{},e.color.point);var c;return 2===e.qHyperCube.qDimensionInfo.length&&(0===(null==(c=l.byDimDef)?void 0:c.activeDimensionIndex)?c.activeDimensionIndex=1:1===(null==c?void 0:c.activeDimensionIndex)&&(c.activeDimensionIndex=0)),function(e){var t,n;return!(!e.snapshotData||null!==(t=e.snapshotData.content)&&void 0!==t&&null!==(t=t.chartData)&&void 0!==t&&t.legendDataPage||null===(n=e.qUndoExclude)||void 0===n||!n.legendData)}(e)&&(e=function(e){return(e=Lx({},e)).snapshotData=Lx({},e.snapshotData),e.snapshotData.content=Lx({},e.snapshotData.content),e.snapshotData.content.chartData=Lx({},e.snapshotData.content.chartData),e.snapshotData.content.chartData.legendDataPage=e.qUndoExclude.legendData.qDataPages,e}(e)),l.mode||(l.mode="primary"),px({app:o,model:n,picasso:r,translator:a,config:{localeInfo:t,theme:s,key:"color",definitionPath:"/qUndoExclude/qHyperCubeDef"},createConfig:()=>({layout:e,hc:e.qUndoExclude.qHyperCube,legendProps:e.legend,colorProps:{...l,useBaseColors:aS(e)}})})}const cS=ow.DATA_PATH,uS=ow.HYPERCUBE_PATH,hS=ow.HYPERCUBE_DEF_PATH;function dS(e){return Array.isArray(e)?e:e?[e]:[]}function fS(e){return Math.min(nS.getOuterDimensionSizeOfMax2Dims(e,cS),ow.MAX_STACKED_VALUES)}function pS(e,t){return{viewSize:t,max:fS(e)}}function mS(){const e=ow.MAX_STACKED_VALUES>=this.layout.qUndoExclude.qHyperCube.qSize.qcy?3:1;this.backendApi.setCacheOptions({height:e*this._scrollHandler.getScrollViewSizeInItem(),width:3})}function gS(){if(this.layout&&nS.hasSecondDimension(this.layout,cS)){this._scrollHandler.onResize();!!this.layout.snapshotData||mS.call(this)}}function yS(){const e=this.chartInstance.component("legend");e&&e.emit&&e.emit("resetindex")}function vS(e,t){return yx(e,`qHyperCube.qDimensionInfo.${t}.qIsOneAndOnlyOne`)||!1}const bS=Nq.extend("DistributionPlot",{namespace:".distributionPlot",init({lasso:e,environment:t,flags:n,picasso:r,$element:i,backendApi:o,selectionsApi:s}){this._super(r,i,t,o,s),this.flags=n,this.picasso=r,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new Jq,this._selectionHandler=aM.create({model:o.model,chartInstance:this.chartInstance,selectionsApi:s,isLassoDisabled:this.isLassoDisabled.bind(this),selectPaths:["/qUndoExclude/qHyperCubeDef"],lasso:e}),this._tooltipHandler=EM.create(this.chartInstance,i,ow.CHART_ID),this._scrollHandler=new TM(this.chartInstance,i,this.getSlicedData.bind(this),this.onScrollCallback.bind(this),"colorLegend-cat"),this._maxBubbleScale=ow.BUBBLE_SCALES_MAX,this._jitterTool=new rS,this.setDataPaths([`${cS}/${uS}`])},onScrollCallback(e,t,n){const r=this;this._updateColorMapData(e).then(()=>{r.updateChart(e,t,n)})},getSlicedData(e,t){const n=this;return this.getData(this.backendApi,this.layout[cS][uS],{top:e,height:t}).then(()=>n.layout)},updateScrollHandlerState(e){void 0!==e&&(this._disableScrolling=!!e),this._scrollHandler.setDisabled(!nS.hasSecondDimension(this.layout,cS)||this._disableScrolling)},updateConstraints(e){const t=!e.active,n=!e.passive,r=!e.select&&!e.active;this._scrollHandler[t?"on":"off"](),this._tooltipHandler[n?"on":"off"](),this._selectionHandler[r?"on":"off"]()},off(){this._scrollHandler.off(),this._tooltipHandler.off(),this._selectionHandler.off()},_getPointScale(){return function(e){return e.dataPoint&&e.dataPoint.bubbleScales}(this.layout)?this.layout.dataPoint.bubbleScales/this._maxBubbleScale:1},_calcBandwidth(e,t){const n=t.scales().dimension;this._bandwidthRatio=n?n.pxScale(e).bandwidth():1,this._bandwidthPx=e*this._bandwidthRatio},_calcPointMaxSize(e,t){const n=Math.min(ow.MAX_POINT_BASE_SIZE_PX,t*ow.POINT_BANDWIDTH_BASE_RATIO)*e;this._pointMaxSizePx=Math.max(ow.MIN_POINT_PIXELS,n)},_calcPointSize(e,t){this._pointSize=e/t},_getDimAxisSettings(e,t){const n=dS(t.trigger),r=dS(t.consume),i=this.picassoElement.getBoundingClientRect()["vertical"===e.orientation?"height":"width"],o=HM.getAdjustedMaxGlyphCount(function(e){const t=e[cS][uS].qDimensionInfo,n=nS.hasSecondDimension(e,cS)?t[0].qApprMaxGlyphCount:0;return Math.min(ow.MAX_GLYPH_COUNT,n)}(this.layout||e),e[cS][uS].qStackedDataPages[0].qData[0].qSubNodes),s=i/4;return{brush:{trigger:n,consume:r},settings:{labels:{mode:"vertical"===e.orientation?e.dimensionAxis.label:"auto",maxGlyphCount:o,maxLengthPx:s},paddingEnd:4}}},_getBoxMarkerSettings(e,t){const{theme:n}=this.environment,r=e.color.point.auto?n.getStyle(ow.CHART_ID,"box","fill"):n.getColorPickerColor(e.color.box.paletteColor),i=dS(t.trigger),o=dS(t.consume),s=this;let a="qMeasureInfo/0",l="qMeasureInfo/0";nS.hasSecondDimension(e,cS)&&e.qUndoExclude.qHyperCube.qDimensionInfo[0].qAttrExprInfo.length&&(a="qDimensionInfo/0/qAttrExprInfo/0",l="qDimensionInfo/0/qAttrExprInfo/1");const c={require:["chart"],displayOrder:1e3,settings:{chart:this,box:{fill:r,stroke:n.getStyle(ow.CHART_ID,"box","stroke"),strokeWidth:0,width:ow.POINT_BANDWIDTH_BASE_RATIO,maxWidthPx:ow.MAX_POINT_BASE_SIZE_PX,minWidthPx:ow.MIN_POINT_PIXELS+2*ow.BOX_PADDING},minor:{scale:"measure"},orientation:e.orientation},beforeRender(){const e=s.layout.presentation&&s.layout.presentation.visibleComponents&&-1!==s.layout.presentation.visibleComponents.indexOf("point"),t="horizontal"===s.layout.orientation?this.rect.height:this.rect.width;s._calcBandwidth(t,this.chart),s._calcPointMaxSize(e?s._getPointScale():1,s._bandwidthPx);let n=0;s._jitter&&(s._calcPointSize(s._pointMaxSizePx,s._bandwidthPx),n=s._pointSize*s._bandwidthPx*ow.JITTER_PARAMETER);const r=s._pointMaxSizePx+n+2*ow.BOX_PADDING,i=r/s._bandwidthPx;this.settings.settings.box.maxWidthPx=Math.min(s._bandwidthPx-2,r),this.settings.settings.box.width=i},brush:{trigger:i,consume:o},data:{extract:{field:"qDimensionInfo/0",trackBy:()=>-1,props:{start:{field:a,reduce:"min"},end:{field:l,reduce:"max"},elemNo:{field:"qDimensionInfo/0"}}}}};return nS.hasSecondDimension(e,cS)&&(c.data.extract.field="qDimensionInfo/0",c.data.extract.trackBy=function(e){return e.qElemNo},c.settings.major={scale:"dimension"}),c},_getPointMarkerSettings(e,t,n){let r=1;e.dataPoint&&!1===e.dataPoint.border&&(r=0);const i=dS(t.trigger),o=dS(t.consume);this._tooltipHandler.isOn()&&(i.push(n.point.trigger),o.push.apply(o,n.point.consume));const s=this,a=this.colorService.getColor(),l={require:["chart"],displayOrder:1100,settings:{chart:this,fill:a,stroke:e=>{const t=a(e);return ZM.getContrastingTransparent(t)},size:.3,strokeWidth:r,sizeLimits:{maxRelExtent:10,maxPx:ow.MAX_POINT_BASE_SIZE_PX,minPx:ow.MIN_POINT_PIXELS},orientation:e.orientation},beforeRender(){const e="horizontal"===s.layout.orientation?this.rect.height:this.rect.width;if(s._calcBandwidth(e,this.chart),s._calcPointMaxSize(s._getPointScale(),s._bandwidthPx),s._calcPointSize(s._pointMaxSizePx,s._bandwidthPx),s._jitter){const t=2*ow.BOX_PADDING/e;s._jitterTool.calcMaxJitter(s._pointSize*s._bandwidthRatio,ow.JITTER_PARAMETER,s._bandwidthRatio-t)}this.settings.settings.sizeLimits.maxPx=s._pointMaxSizePx,this.settings.settings.size=s._pointSize},brush:{trigger:i,consume:o},data:{extract:{field:"qDimensionInfo/0",props:{innerElemNo:{field:"qDimensionInfo/0"},elemNo:{field:"qDimensionInfo/0"},inner:{field:"qDimensionInfo/0",value:e=>e},row:{field:"qDimensionInfo/0",value:e=>e.qRow},measure:{field:"qMeasureInfo/0",reduce:"first",value:e=>e,reduceLabel:"none"},...this.colorService.getDatumProps()}}}};return nS.hasSecondDimension(e,cS)&&(l.data.extract.props.inner.field="qDimensionInfo/1",l.data.extract.props.innerElemNo.field="qDimensionInfo/1",l.data.extract.props.row.field="qDimensionInfo/1",l.data.extract.field="qDimensionInfo/1",l.data.extract.props.outer={field:"qDimensionInfo/0",value:e=>e}),this.setDataPaths([`${cS}/${uS}`]),l},_getPointSelectionLayerSettings(e){const t=Lx(!0,{},e,{key:"selection-point-marker",settings:{opacity:0}});return t.brush.consume.pop(),t.brush.consume.forEach(e=>{e.style.inactive=void 0,e.style.active.opacity=1}),t.brush.trigger=[],t},createChartSettings(e){const t=this.isRtl(),{theme:n}=this.environment,r=!!e.snapshotData,i=e.presentation&&e.presentation.visibleComponents,o=i&&-1!==e.presentation.visibleComponents.indexOf("point"),s=i&&-1!==e.presentation.visibleComponents.indexOf("box");this._jitter=o&&e.dataPoint&&"jitter"===e.dataPoint.displacement;const a=e[cS][uS],l=a.qDimensionInfo,c="horizontal"!==e.orientation?"y":"x",u="horizontal"!==e.orientation?"x":"y",h=_q.create({chartID:ow.CHART_ID,theme:n,isRtl:t,flags:this.flags});if(0===a.qStackedDataPages[0].qData.length)return h.getSettings();let d={},f={},p={},m={};if(this._selectionHandler.isOn()){const t=!o&&nS.hasSecondDimension(e,cS);this._selectionHandler.setUpStart();const n=this._selectionHandler.setUpBrush({contexts:["select-inner"],data:["innerElemNo"],isSingleSelect:vS(e,0)},!0),r=this._selectionHandler.setUpBrush({contexts:["select-outer"],data:["elemNo"],isSingleSelect:vS(e,1)},!0),i=this._selectionHandler.setUpBrush({dataPath:cS,contexts:["select-color"],data:["color"],startOnEmptySelection:!1},!0),s=this._selectionHandler.setUpBrush({contexts:["select-measure"],data:[c]},!0);this._selectionHandler.setUpDone(),d={trigger:Lx(!0,{},r.trigger,{data:[""]}),consume:[Lx(!0,{},r.consume,{data:[""]})]},f={trigger:t?r.trigger:null,consume:[n.consume,r.consume,s.consume]},p={trigger:n.trigger,consume:[n.consume,r.consume,s.consume,i.consume]},m={trigger:[Lx(!0,{},i.trigger,{data:[""]})],consume:[Lx(!0,{},i.consume,{data:[""]}),n.consume,r.consume]}}const g={point:{},box:{}};this._tooltipHandler.isOn()&&(g.point=this._tooltipHandler.setUp({chartBuilder:h,colorService:this.colorService,data:nS.hasSecondDimension(e,cS)?["innerElemNo","elemNo"]:["innerElemNo"],contexts:["pointTip"],componentKey:"point-marker",environment:this.environment,attrDimPath:`/${uS}/qDimensionInfo/${nS.hasSecondDimension(e,cS)?1:0}/qAttrDimInfo/0`,measureRows:["measure"],labelData:nS.hasSecondDimension(e,cS)?["inner","outer"]:["inner"]}));const y=function(e){const t=[],n=e.qUndoExclude&&e.qUndoExclude.qHyperCube&&e.qUndoExclude.qHyperCube.qDimensionInfo?e.qUndoExclude.qHyperCube.qDimensionInfo:void 0;if(!n)return!1;for(let e=0;e<n.length;e++)n[e].qLocked?t.push(n[e].qLocked):t.push(!1);return t}(e),v=function(e,t,n){const r={};return 1===e.length?(r.isOpenDim=!1,e[0]?r.isOpenMea=!1:r.isOpenMea=!0):e[0]&&!e[1]?(r.isOpenDim=!1,r.isOpenMea=!0):!e[0]&&e[1]?(r.isOpenDim=!0,r.isOpenMea=!1):e[0]&&e[1]?(r.isOpenDim=!1,r.isOpenMea=!1):(r.isOpenDim=!0,r.isOpenMea=!0),t&&(r.isOpenMea=!1),n&&(r.isOpenDim=!1),r}(y,vS(e,0),vS(e,1)),b={scrollHandler:this._scrollHandler,selectionHandler:this._selectionHandler},x={componentKey:o?"point-marker":"box-marker",lassoBrushKey:"select-inner",dimRangeBrushKey:"select-outer",measureRangeBrushKey:"select-measure",areaBrushKey:null,legendBrushKey:"legend"};if(this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=gM.create(b,e.orientation,t,x,v),h.addPreset("dimension-measure-chart",{isRtl:t,includeDimensionAxis:nS.hasSecondDimension(e,cS),orientation:e.orientation,selectionsEnabled:this._selectionHandler.isOn(),theme:n,measureSource:["qMeasureInfo/0"],dimensionSource:"qDimensionInfo/0",measureAxisProperties:e.measureAxis,measureTitleText:a.qMeasureInfo[0].qFallbackTitle,dimensionAxisProperties:e.dimensionAxis,dimensionAxisSettings:this._getDimAxisSettings(e,d),dimensionTitleText:l&&l[0]&&l[0].qFallbackTitle||"",gridlines:e.gridlines,hasNavigation:!r,isNavigationEnabledFn:()=>this._scrollHandler.isOn(),scrollSettings:pS(e,this._scrollHandler.getScrollViewSizeInItem()),enableLasso:!0,lasso:{brushKey:o?"select-inner":"select-outer",brushComponents:o?["point-marker"]:["box-marker"],brushData:o?["innerElemNo"]:["elemNo"]},enableDimRange:!0,dimRange:{brushKey:"select-outer",brushAxis:"horizontal"===e.orientation?"y-axis":"x-axis",brushArea:s?"box-marker":"point-marker",brushScale:"dimension"},enableMeasureRange:o,measureRange:{brushKey:"select-measure",brushAxis:"horizontal"===e.orientation?"x-axis":"y-axis",brushArea:o?"point-marker":"box-marker",brushScale:"measure",multiple:!0},brushActions:this._dependentActions.gestures,refLines:e.refLine&&e.refLine.refLines,axisTitleStyle:tw(ow.CHART_ID,n,e),axisLabelStyle:nw(ow.CHART_ID,n,e)}),s){const t=this._getBoxMarkerSettings(e,f);h.addComponent("box-marker",t)}if(o){const r=this._getPointMarkerSettings(e,p,g);if(r.data.extract.props[c]={field:"qMeasureInfo/0"},r.settings[c]={scale:"measure"},nS.hasSecondDimension(e,cS)&&(r.data.extract.props[u]={field:"qDimensionInfo/0",type:"qual"},r.settings[u]={scale:"dimension"}),this._jitter){r.settings[u]=r.settings[u]||{};const e=this._jitterTool;r.settings[u].fn=function(t){let n;return n="function"==typeof t.scale?t.scale(t.datum[u].value)+.5*t.scale.bandwidth():.5,n+e.getJitterValue(t.datum.value,ow.JITTER_PARAMETER)}}h.addComponent("point-marker",r),h.addComponent("point-marker",this._getPointSelectionLayerSettings(r));if(e.legend?!1!==e.legend.show:!e.color.point.auto&&"byDimension"===e.color.point.mode){const r={title:rw(ow.CHART_ID,n,e,this.flags),label:iw(ow.CHART_ID,n,e,this.flags)};this.addLegend(h,t,m,r)}}const w=h.getSettings();return this.addSnapshotChartSettings(w,e),w.scales={...w.scales,...this.colorService.getScales()},w.palettes=this.colorService.getPalettes(),w},addLegend(e,t,n,r){const i={eventName:"legend-c",key:"colorLegend",styleReference:"object.comboChart",styleOverrides:r,rtl:t,settings:{item:{shape:{type:"circle",size:10}}}},o=this.colorService.getLegend(i,{actions:{interact:{enabled:()=>this._scrollHandler.isOn()}}});let{components:s}=o;s=s.filter(e=>!!e),s.length>0&&(this._selectionHandler.isOn()&&(s[0].brush={consume:n.consume.map(e=>Lx(!0,e,{style:{active:null}})),trigger:n.trigger}),s[0].layout.displayOrder=200,s[0].layout.prioOrder=50),e.settings.components.push(...s),e.settings.interactions[0].gestures.unshift(...o.interactions)},resize(){this.layout&&(gS.call(this),this._super())},hasValidData(){const e=this.layout;return e[cS]&&e[cS][uS]&&e[cS][uS].qStackedDataPages.length&&e[cS][uS].qStackedDataPages[0].qData},paint(){const e=!!this.layout.snapshotData;e||this.environment.options.viewState||this.updateScrollHandlerState(!1),this._orientation||(this._orientation=this.layout.orientation),this._orientation!==this.layout.orientation&&(gS.call(this),this._orientation=this.layout.orientation);const t=this.layout;if(!this.hasValidData())return Promise.resolve();const n=this,r=this._super;return!e&&nS.hasSecondDimension(t,cS)&&this._scrollHandler.isDataSizeChanged(yx(t,`${cS}.${uS}.qStackedDataPages.0.qData.0.qSubNodes.length`),nS.getOuterDimensionSizeOfMax2Dims(t,cS))?this._scrollHandler.getViewData().finally(()=>n._updateColorMapData(t).then(()=>r.call(n))):this._updateColorMapData(t).then(()=>r.call(n))},async setSnapshotData(e){this._super(e);const t=await this.colorService.getSnapshotData();return e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t},e[cS][uS].qStackedDataPages=this.layout[cS][uS].qStackedDataPages,iS.toBefore(e),e},getViewState(){return{scroll:Math.round(this._scrollHandler.getScrollState())}},getDisclaimerAttributes(e){const t=!this.flags.isEnabled("SHOW_DISCLAIMER")||!(!1===e.showDisclaimer),n=!nS.hasSecondDimension(e,cS)&&e.qHyperCube.qSize.qcy>1e4||nS.hasSecondDimension(e,cS)&&e.qHyperCube.qSize.qcy>=ow.MAX_STACKED_VALUES,r=t&&n,i=pS(e,this._scrollHandler.getScrollViewSizeInItem());return{data:e&&e.qUndoExclude,supportedDisclaimers:{LimitedData:t&&r},options:{paddingBottom:r&&i&&i.viewSize<i.max,supportNegative:!0,explicitLimitedData:r}}},async _updateColorMapData(e){this.colorService=lS({layout:e,localeInfo:this.localeInfo,model:this.backendApi.model,picasso:this.picasso,environment:this.environment}),await this.colorService.initialize();const t=this.colorService.getSettings().field,n=this.chartInstance.brush("select-color");/qAttrDimInfo/.test(t)&&n.addKeyAlias("attrDim/qDimensionInfo/0",`${cS}/${uS}/${t}`)},_createColorLegendCube(e){const t=nS.hasSecondDimension(this.layout,cS)?1:0;return{qDimensionInfo:[this.layout[cS][uS].qDimensionInfo[t].qAttrDimInfo[0]],qMeasureInfo:[],qDataPages:e,qMode:"S",qSize:{qcx:1,qcy:e[0].qMatrix.length}}},_updateColorData(){return this._updateColorMapData(this.layout)},updateDerivedProperties(e,t){const{app:n,translator:r}=this.environment,i=this,o=i.backendApi.model;return i._derivedProperties.addDefaultHyperCubeHash(e.qHyperCubeDef,t.qHyperCube,n,function(e){return{cube:e[hS],sorting:e.sorting,color:{point:e.color.point}}}(e)).then(s=>{const a={layout:t,properties:e,model:o,hashData:s,generateDerivedProperties:(e,t)=>oS.generateHyperCube(e,t,n,r)};return i._derivedProperties.updateDerivedProperties(a)})},updateData(e){const t=this,n=!!e.snapshotData;return t._super(e).then(()=>{if(t._destroyed)return Promise.reject();if(e=t.layout,t._scrollHandler.setOptions({direction:"horizontal"===e.orientation?"vertical":"horizontal"}),n)return iS.toAfter(e),t._updateColorMapData(e);t.updateScrollHandlerState(!0);const{viewState:r}=t.environment.options;let i;return r?(t._scrollHandler.updateViewState(fS(e)),t._scrollHandler.setScrollState(r.scroll)):(t._scrollHandler.resetScroll(),yS.call(t)),t._scrollHandler.getScrollViewSizeInItem()&&!t._cacheSizeInitialized&&(mS.call(t),t._cacheSizeInitialized=!0),i=nS.hasSecondDimension(e,cS)?t.getSlicedData(t._scrollHandler.getScrollState(),t._scrollHandler.getScrollViewSizeInItem()):t.getData(t.backendApi,e[cS][uS],{height:e[cS][uS].qSize.qcy||1}),i.then(()=>t._destroyed?Promise.reject():t._updateColorData())})},isLassoDisabled(){const e=this.layout;return!!(e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1&&vS(e,0))}}),xS={enabled:!0,delay:50};function wS(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}class qS{constructor({onSend:e}){this.options={},this.ongoingRequests=[],this.queuedRequests=[],this.recentRequests=[],this.resolvedRequests=[],this._debounceTimer=null,this._latestResolvedRequestedAt=-1,this.onSend=e,this.setOptions({})}destroy(){this.clear(),this.recentRequests=[],this.resolvedRequests=[],this.onSend=null,this.onCancel=null}setOptions(e){this.options=Lx(!0,{},xS,this.options,e),this.enabled=this.options.enabled||!1,this.delay=this.options.delay||-1}clear(){let e;for(clearTimeout(this._debounceTimer);this.queuedRequests.length;)e=this.queuedRequests.pop(),e.dfd.reject();for(;this.ongoingRequests.length;)e=this.ongoingRequests.pop(),e.dfd.reject()}queue(e){const t=this.enabled?this.delay:-1,n=Date.now(),r={data:e,dfd:wS(),wrapper:wS(),requestedAt:n},i=Math.max(this._getAvgResolutionTime(),t),o=t<1,s=this.recentRequests.length<1,a=s||n-this.recentRequests.slice(-1)[0].requestedAt>i,l=n>this._latestResolvedRequestedAt+t;return o||s||a||l?MS.apply(this,[r,0]):MS.apply(this,[r,Math.min(t,1e3)]),this.recentRequests.push(r),this.recentRequests.length>10&&(this.recentRequests=this.recentRequests.slice(-10)),r.dfd.promise}updateResolutionTime(){this._latestResolvedRequestedAt=Date.now()}_getAvgResolutionTime(){let e;return this.resolvedRequests.length&&(e=0,this.resolvedRequests.forEach(t=>{e+=t.respondedAt-t.sentAt}),e/=this.resolvedRequests.length),e}}function MS(e,t){const n=this;this.queuedRequests.push(e),clearTimeout(this._debounceTimer),t>=10?this._debounceTimer=setTimeout(()=>{SS.call(n)},t):SS.call(n)}function SS(){if(this.ongoingRequests.length)return void(this.waitingForResponse=!0);let e=this.queuedRequests.pop();for(e&&DS.call(this,e);this.queuedRequests.length;)e=this.queuedRequests.shift(),e.dfd.reject()}function DS(e){this.waitingForResponse=!1,this.ongoingRequests.push(e);const t=this,n=e.wrapper;e.sentAt=Date.now(),n.promise.then(function(...n){t.ongoingRequests.splice(t.ongoingRequests.indexOf(e),1),e.respondedAt=Date.now(),t.resolvedRequests.push({sentAt:e.sentAt,respondedAt:e.respondedAt,requestedAt:e.requestedAt}),t.resolvedRequests.length>10&&(t.resolvedRequests=t.resolvedRequests.slice(-10)),e.requestedAt>t._latestResolvedRequestedAt?e.dfd.resolve(...n):e.dfd.reject(),t._latestResolvedRequestedAt=e.requestedAt},function(...n){t.ongoingRequests.splice(t.ongoingRequests.indexOf(e),1),e.respondedAt=Date.now(),e.dfd.reject(...n)}).finally(()=>{t.waitingForResponse&&SS.call(t)}),this.onSend(e.data,n)}const _S=new $y(0,0,0,0),kS=new $y(0,0,0,0);class CS{constructor(){this.pages=[]}get(e){return e.map(e=>this.getPage(e))}getPage(e){const t=[];for(let n=0;n<this.pages.length;n++){const r=this.pages[n].qArea;_S.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),kS.set(r.qLeft,r.qTop,r.qWidth,r.qHeight);const i=kS.intersection(_S,!0);if(t.push({coverage:i?i.clone():new $y(0,0,0,0),idx:n}),r.qLeft<=e.qLeft&&r.qLeft+r.qWidth>=e.qLeft+e.qWidth&&r.qTop<=e.qTop&&r.qTop+r.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n])}return t.sort((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height),t[0].coverage.height>0&&t[0].coverage.width>0?this._extract(e,this.pages[t[0].idx]):{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qData:[]}}destroy(){this.clear()}isEmpty(){return!(this.pages&&this.pages[0]&&this.pages[0].qArea.qHeight&&this.pages[0].qArea.qWidth)}clear(){this.pages=[]}store(e){this.pages=e}containsArea(e){for(let t=0;t<this.pages.length;t++){const n=this.pages[t].qArea;if(n.qLeft<=e.qLeft&&n.qLeft+n.qWidth>=e.qLeft+e.qWidth&&n.qTop<=e.qTop&&n.qTop+n.qHeight>=e.qTop+e.qHeight)return!0}return!1}contains(e){return!(!this.pages||!this.pages.length)&&0===e.filter(e=>!this.containsArea(e)).length}_extract(e,t){_S.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),kS.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=_S.intersection(kS,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qData:[]};const r=Math.max(0,e.qTop-t.qArea.qTop),i=t.qData[0],o=i.qSubNodes,s={};for(const e in i)i.hasOwnProperty(e)&&(s[e]="qSubNodes"===e?o.slice(r,r+n.height):i[e]);return s.qUp+=r,s.qDown+=t.qArea.qHeight-n.height-r,{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qData:[s]}}}const ES={mode:"S",enabled:!0,debouncing:{enabled:!0,delay:50},height:250,width:250,maxTotalArea:1e4},AS=Vy.extend("CacheCube",{init(e,t,n,r){this.model=e,this.responseProperty=t,this.options={},this.cubeHeight=0,this.cubeWidth=0,this.setOptions(r||{}),this.setPath(n),"K"===this.options.mode?this.cube=new CS:"P"===this.options.mode?this.cube=new ev:this.cube=new Yy,this.throttle=new qS({onSend:(e,t)=>{const n=this._getDirections(this.throttle.recentRequests.map(e=>({top:e.data[0].qTop,left:e.data[0].qLeft}))),r=this._getAreasToCache(e,n.vertical,n.horizontal);this.cacheData(r,e).then(e=>{this.cube?t.resolve(e):t.reject()},()=>{t.reject()})}}),this._modelBinding=()=>{this.clear()},this.model.on("changed",this._modelBinding)},destroy(){this.cube.destroy(),this.throttle.destroy(),this.model&&this.model.removeListener&&this.model.removeListener("changed",this._modelBinding),this._modelBinding=null,delete this.model,delete this.throttle,delete this.cube},setMethodName(e){this.method=e},setPath(e){this.path=e},setCubeSize(e){this.cubeHeight=e.qcy,this.cubeWidth=e.qcx},setOptions(e){e&&(this.options=Lx(!0,{},ES,this.options,e),this.cacheHeight=this.options.height,this.cacheWidth=this.options.width,this.enabled=this.options.enabled||!1,this.debouncing={enabled:this.options.debouncing.enabled||!1,delay:this.options.debouncing.delay||-1})},clear(){this.cube&&this.cube.clear(),this.throttle&&this.throttle.clear()},set(e){this.clear(),e&&e.length&&this.cube.store(e)},cacheData(e,t){const n=function(e){return this.cube?(this.cube.store(e),this.cube.get(t)):e};return"getHyperCubeStackData"===this.method&&this.options.maxStackedValues?this.model[this.method](this.path,e,this.options.maxStackedValues).then(n.bind(this)):this.model[this.method](this.path,e).then(n.bind(this))},getData(e){if(!this.model)return Promise.reject();if(!this.enabled||!this.cubeHeight||!this.cubeWidth)return"getHyperCubeStackData"===this.method&&this.options.maxStackedValues?this.model[this.method](this.path,e,this.options.maxStackedValues):this.model[this.method](this.path,e);let t,n;const r=[];for(t=0;t<e.length;++t)n=e[t],r.push({qTop:Math.max(Math.floor(n.qTop),0),qLeft:Math.max(n.qLeft,0),qHeight:Math.min(n.qHeight,this.cubeHeight-Math.floor(n.qTop)),qWidth:Math.min(n.qWidth,this.cubeWidth-n.qLeft)});return this.cube.contains(r)?(this.throttle.updateResolutionTime(),Promise.resolve(this.cube.get(r))):0===r[0].qTop&&this.cube.isEmpty()&&this.throttle.ongoingRequests.length+this.throttle.queuedRequests.length===0?(this.throttle.updateResolutionTime(),this.cacheData(r,r)):this.throttle.queue(r)},_getDirections(e){if(!e||e.length<2)return{vertical:0,horizontal:0};const t=e.slice(-2),n=t[1].top-t[0].top,r=t[1].left-t[0].left;return{vertical:n<0?-1:n>0?1:0,horizontal:r<0?-1:r>0?1:0}},_getAreasToCache(e,t,n){let r,i,o,s,a,l,c,u,h;const d=[];let f=this.cacheHeight;for(void 0===t&&(t=0),void 0===n&&(n=0),this.cacheHeight*this.cacheWidth*e.length>this.options.maxTotalArea&&(f=Math.floor(this.options.maxTotalArea/(e.length*this.cacheWidth))),r=0;r<e.length;++r)i=0!==t?Math.floor(.5*Math.max(0,f-e[r].qHeight)):0,o=0!==n?Math.floor(.5*Math.max(0,this.cacheWidth-e[r].qWidth)):0,s=i*t-i,a=o*n-o,l=0!==t?Math.max(0,Math.min(Math.max(e[r].qHeight,f),this.cubeHeight)):e[r].qHeight,c=0!==n?Math.max(0,Math.min(Math.max(e[r].qWidth,this.cacheWidth),this.cubeWidth)):e[r].qWidth,u=Math.max(0,Math.min(e[r].qTop+s,this.cubeHeight-l)),h=Math.max(0,Math.min(e[r].qLeft+a,this.cubeWidth-c)),d.push({qTop:u,qHeight:l,qLeft:h,qWidth:c});return d}}),TS=ow.DATA_PATH,IS=ow.HYPERCUBE_DEF_PATH;class NS{constructor(e){this.model=e,this.path=`/${TS}/${IS}`,this.cacheCube=new AS(e,"qDataPages",this.path,{mode:"K"}),this.cacheCube.setMethodName("getHyperCubeStackData"),this.cacheCube.setOptions({maxStackedValues:ow.MAX_STACKED_VALUES})}setPath(e){this.path=e}setCacheOptions(e){this.cacheCube.setOptions(e)}updateCache(e){let t,n;"qHyperCube"===this.dataPath?t=e&&e.qHyperCube:(n=this.dataPath.slice(0,this.dataPath.indexOf("qHyperCube")-1),t=e&&e[n]&&e[n].qHyperCube),e.qSelectionInfo.qInSelections||this.cacheCube.setCubeSize({qcx:t.qSize.qcx,qcy:nS.getStackedCubeSizeOfMax2Dims(e,n)}),this.backendStackThrottle.clear()}getData(e,t){const n=this.cacheCube;return t?this.model.getHyperCubeData(t,e):this.cacheCube.getData(e).then(e=>(e[0]&&e[0].qData[0]&&e[0].qData[0].qSubNodes.some(e=>e.qDown>0)&&n.clear(),e))}}return function(t){return function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(l).forEach(t=>{e.add(l[t])})}}(t.translator),{qae:Ox(t),ext:Jw(t),component(){const n=e.useElement(),r=function(){const t=e.useApp(),n=e.useAppLayout(),r=e.useDeviceType(),i=e.useOptions(),o=e.useTheme(),s=e.useTranslator();return e.useMemo(()=>({app:t,appLayout:n,deviceType:r,options:i,theme:o,translator:s}),[t,n,i.direction,i.freeResize,s.language(),o.name(),r])}(),i=r.options.renderer,o=e.useMemo(()=>xg(i),[i]),s=e.useSelections(),l=e.useStaleLayout(),c=e.useModel(),u=e.useConstraints(),h=function(){const t=e.useConstraints(),[n,r]=e.useState(!1),[i,o]=e.useState(!1),s=!!e.useLayout().qSelectionInfo.qInSelections,[a]=e.useState(()=>({toggle(){o(e=>!e)}}));return e.useEffect(()=>{t&&r(!t.select&&!t.active)},[t]),e.useAction(()=>({key:"lasso",label:"Lasso",icon:wg,hidden:!n||!s,active:i,action(){o(e=>!e)}}),[s,i,n]),a.enabled=()=>n,a.active=()=>i,a}(),d=e.useRenderState(),[f,p]=e.useState();e.useEffect(()=>{const e=a(n),i=function(e,t){return t.snapshotData?new nv(t,"qUndoExclude.qHyperCube","qStackedDataPages"):new NS(e)}(c,l),u=s,d=new bS({environment:r,lasso:h,flags:t.flags,picasso:o,$element:e,backendApi:i,selectionsApi:u});return p(d),()=>{d.destroy()}},[]);const[,m]=e.usePromise(async()=>{if(!f)return;f.updateEnvironment(r),f.updateConstraints(u);if(!!!l.snapshotData){const e=await c.getEffectiveProperties();if(await f.updateDerivedProperties(e,l))return void d.pending();d.restore()}await f.updateData(l),await f.paint()},[l,f,r]);if(m)throw m;var g;!function(t){const n=e.useRect(),r=e.useOptions(),i=e.useConstraints(),[,o]=e.usePromise(async()=>{t&&(t.updateConstraints(i),t.options=r,await t.resize())},[n.width,n.height]);if(o)throw o}(f),g=f,e.onTakeSnapshot(e=>{if(g)return g.setSnapshotData(e)}),e.useImperativeHandle(()=>({getViewState(){if(g)return g.getViewState()}}),[g])}}}});
|
|
28
|
+
!function(t,n){e.exports=n()}(0,function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,d):"";if(n=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0===+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(h=t[0]).length%l,d=h.length,b=0;b<d;b++)m+=h.charAt(b),!((b-y+1)%l)&&b<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}})});const be=1e-15;function xe(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const we={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"},qe=/%\)?$/,Me=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Se=/^\(oct\)/i,De=/^\(dec\)/i,_e=/^\(hex\)/i,ke=/^\(bin\)/i,Ce=/^\(rom\)/i,Ee=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Ae=/#|0/g;function Te(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function Ie(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<s.length;n++)if(s[n]<=i){r+=a[n],i-=s[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}function Ne(e,t,n){let r;return Me.test(t)?e=Te(e,Number(/\d{2}/.exec(t)[0]),t,n):Se.test(t)?e=Te(e,8,t,n):De.test(t)?e=Te(e,10,t,n):_e.test(t)?e=Te(e,16,t,n):ke.test(t)?e=Te(e,2,t,n):Ce.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=Ie(e,t)):t+r+e.toExponential(0)),e}function Re(e,t,n){const r=xe(e);return n?r:new RegExp(r||"",t)}function Oe(e,t){return t&&(t=xe(t)),e&&(e=xe(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}function Pe(e,t){if(!e||!e.qNumericalAbbreviation)return we;const n={};return e.qNumericalAbbreviation.split(t).forEach(e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])}),n}function Le(e,t,n,r){let i,o,s,a,l,c,u,h,d,f=e.pattern;r&&(e.abbreviate=!0),d=Oe(t,n),s=f.match(d),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(i=s.split(n),o=i.pop(),s=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(Re(c,"g"),t)),u=n,n=".",u&&(s=s.replace(Re(u,"g"),n)),h=s.match(/#/g),h=h?h.length:0;const p=f.split(u);let m;p[1]&&(m=p[1].match(Ae)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=m?m.length:2,e.percentage=qe.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(Re(t,null,!0),"|").concat(Re(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class Fe{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=Pe(e,this.patternSeparator),this.prepare()}clone(){const e=new Fe(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Ee.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Ee.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Ee.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||Le(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&Le(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&Le(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,s,a,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=Ne(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let r,i,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(r=t[a-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(h=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+be*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=ve(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+be).toFixed(t).slice(2).replace(/0+$/,"");for(a=i.length;a<n;a++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),a=0;a<t;a++)l+="#";e=ve(l,e)}e=e.replace(u.numericRegex,e=>e===s?u.groupTemp:e===o?u.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function je(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Fe(...t)}function ze(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=e=>e}=t;let o,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return s=i(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=i(t),o.has(s)?o.get(s):o.set(s,e(t))),o.set=(e,t)=>(c>=n&&(delete a[l[u]],delete l[u],c--,u++),a[e]=t,l[c]=e,c++,t),o.get=e=>a[e],o.has=e=>e in a,o.clear=()=>{a=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function He(e,t,n,r,i){const o=je(i,e,t,n,r),s=ze(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,r){return s.clear(),o.format(t,e,n,r)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const Be={DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},Ve=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$e=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],We=["January","February","March","April","May","June","July","August","September","October","November","December"],Ue=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ye=86400;function Ke(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Xe(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}function Ge(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Je(e){const t=e,n=24*Ge(t),r=60*Ge(n),i=60*Ge(r),o=1e3*Ge(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}function Ze(e,t){let n,r=Je(e),i=r.d,o=r.h,s=r.m,a=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(Ye*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:s,s:a,f:l,t:u}}function Qe(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Ke("".concat(t.year).slice(-2),2),YYY:Ke("".concat(t.year).slice(-3),3),def:e=>Ke("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:Ke("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Ke("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>Ke("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>Ke("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>Ke("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>Ke("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}class et{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:Ve,qDayNames:$e,qLongMonthNames:We,qMonthNames:Ue}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),t||(t={[Be.TIME]:r.qTimeFmt||"hh:mm:ss",[Be.DATE]:r.qDateFmt||"YYYY-MM-DD",[Be.DATE_TIME]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new et(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=Xe(e,n):(e<0&&(e=-e,t="-".concat(t)),r=Ze(e,t));const i=Qe(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const s=new RegExp(o.join("|"),"g"),a=t.replace(s,e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r});return a}}function tt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new et(...t)}const nt=864e5;function rt(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(nt*(e-Math.floor(e)))))}function it(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=tt(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=ze(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==Be.INTERVAL?rt(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=tt(i,e,t),r=ze(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function ot(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return it(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",s=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(i,"##"),o="U"),He(n,r,i,o,t)}function st(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:s,type:a,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=s||("dimension"===a?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u=e=>(null==e?void 0:e.qText)||"",h="dimension"===a?"first":"avg",d=ot(t,i),f="dimension"===a?"first":(e,t)=>d(t),p={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>a,origin:()=>l,items:()=>(e||(e=o(p)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:u,reduce:h,reduceLabel:f,formatter:()=>d,tags:()=>t.qTags};return p}function at(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const s="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),a={instance:st(p({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},i))};return a.attrDims=at("qAttrDimInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=at("qAttrExprInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=at("qMeasureInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a})}function lt(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=t;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=lt.util,a={cache:i,cube:o,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},l={key:()=>e,raw:()=>o,field:e=>te(e,a),fields:()=>i.fields.slice(),extract:e=>a.extractor(e,l,i,s),hierarchy:e=>a.hierarchy(e,l,i,s),_cache:()=>i};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(a.extractor=ge,a.hierarchy=me,a.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(a.extractor=v,a.pages=o.qDataPages,a.hierarchy=me):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},l,i,s);const c="S"===o.qMode?e=>e.qElemNumber:void 0,u="S"===o.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...at("qDimensionInfo",o,e,"",p({},a,{value:c,type:"dimension"}))),i.wrappedFields.push(...at("qMeasureInfo",o,e,"",p({},a,{value:u,type:"measure"}))),i.fields=i.wrappedFields.map(e=>e.instance);const h=e=>{e.forEach(e=>{i.allFields.push(e.instance),h(e.measures),h(e.attrDims),h(e.attrExps)})};return h(i.wrappedFields),(n.virtualFields||[]).forEach(t=>{const n=l.field(t.from),o=st(r({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},l,i,s),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));i.virtualFields.push(o)}),i.allFields.push(...i.virtualFields),l}const ct=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ut=/\/qDimensionInfo(?:\/(\d+))?/,ht=/\/qMeasureInfo\/(\d+)/,dt=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,ft=/\/qAttrExprInfo\/(\d+)/,pt=/\/?qHyperCube/,mt=/\/?qTreeData/,gt=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),yt=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function vt(e,t){let n=e,r=-1,i=-1,o="",s=e=>e;pt.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=gt):mt.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=yt);let a=!0;if(ut.test(e)&&(r=+ut.exec(e)[1]),ht.test(e)&&(i=+ht.exec(e)[1]),dt.test(e)){i=-1,r=0;const e=+dt.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),a=!1}if(ft.test(e)){const e=i;if(t){i=0;const s=Z(o,t);i+=(s.qMeasureInfo||[]).length,r>-1?(i=s.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=s.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=s.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+ft.exec(n)[1]}else r>-1?(r=-1,i=+ft.exec(n)[1]):i+=+ft.exec(n)[1]+1}return ct.forEach(e=>{let[t,r]=e;n=n.replace(t,r)}),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}function bt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],s={},a=e.isActive();let l=!1;return e.brushes().forEach(e=>{const t=vt(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach(e=>s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach(e=>s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach(e=>s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,a=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));(0===o||a>=o)&&o>-1?n.forEach(e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})}):n.forEach(e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})}),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map(e=>+e).filter(e=>!isNaN(e)),l=!!s.selectHyperCubeCells.values.length);else{const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}}),!l&&a?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]}),s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o);var c}function xt(e){lt.util=e.data("matrix").util,e.data("q",lt),e.formatter("q-number",He),e.formatter("q-time",it)}return xt.qBrushHelper=bt,xt.selections=bt,xt}()}(eM)),eM.exports),nM=n(tM);const rM={brushInterceptors:{DIM_VALUE_NULL:-2,DIM_VALUE_TOTAL:-3,brushOnlyOne:function(e,t){const n=e.brushes().filter(e=>"value"===e.type);let r=[];n.length&&n.forEach(e=>{r=r.concat(e.brush.values().map(t=>({key:e.id,value:t})))});return r.concat(t)},filterValues:function(e,t){const n=this;let r,i;const o=[];let s=0;const a=[];return t.forEach(t=>{t.value!==n.DIM_VALUE_NULL&&t.value!==n.DIM_VALUE_TOTAL&&(i=function(e,t){const n=t.key.indexOf("qHyperCube")+10,r=t.key.substr(0,n),i=t.key.substr(n+1);return e.dataset(r).field(i)}(e,t),r=i&&i.raw(),r.qLocked?(o.push(r),s++):a.push({key:t.key,value:t.value}))}),{items:a,itemsAreLocked:s>0&&s===t.length,lockedFields:o}}}};const iM={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function oM(e){if(!e||!e.chartInstance||!e.selectionsApi)throw Error("Selections-handler: Missing input");const t=e.chartInstance,n=e.selectionsApi,r=e.dataPaths||[""],i=e.selectPaths,o=e.lasso;let s=[];const a={propertiesToRestore:{}};let l=!1;const c=function(e,t,n){function r(){}return r.update=function(e,r,i){t.isActive()||t.begin(n),nM.qBrushHelper(i).forEach(e=>{t.select(e)})},r.toggleValues=function(r,i,o){const s=rM.brushInterceptors.filterValues(e,r),a=s.items;return t.isActive()||s.itemsAreLocked||!(o||a.length>0)||(t.begin(n),i.start(),i.emit("update",[],[])),a},r}(t,n,i),u={};let h=!1;function d(e){16===e.keyCode&&e.shiftKey!==h&&(h=e.shiftKey,o.toggle())}function f(e){const t=e.keyCode;27===t?n.cancel():13===t&&n.confirm()}function p(){s.forEach(e=>{e.listeners.update=function(t,n){e.sleep||c.update(t,n,e.brush)},e.brush.on("update",e.listeners.update),e.brush.on("start",e.listeners.start)})}function m(){s.forEach(e=>{e.brush.removeListener("update",e.listeners.update),e.brush.removeListener("start",e.listeners.start)})}return n.on("cleared",()=>{s.forEach(e=>{e.brush.clear(),e.dependentComponents.forEach(e=>{const n=t.component(e.id);n&&n.emit(e.clear)})})}),u.setUp=function(e){u.tearDown();const t=this.setUpBrush(e);return l&&p(),t},u.setUpBrush=function(e){const n=Lx(!0,{},iM,e),i={on:"tap",action:t=>t.ctrlKey||e.isSingleSelect?"set":"toggle",contexts:n.contexts,data:n.data,globalPropagation:"stop"},o={context:n.contexts[0],data:n.data,style:n.style},a=function(e,t){return{brush:t.brush(e.contexts[0]),listeners:{},dependentComponents:[],id:e.contexts[0]}}(n,t);return a.listeners.toggle=function(e){if(!l)return[];const i=function(){const e=[];let n=r.map(e=>t.dataset(e).fields().filter(e=>"dimension"===e.type()));n=[].concat.apply([],n);for(let t=0;t<n.length;t++)n[t].raw().qLocked&&e.push(n[t].raw());return{fields:e,areAllFieldsLocked:e.length&&e.length===n.length}}();return n.startOnEmptySelection&&0===e.length&&i.areAllFieldsLocked?[]:c.toggleValues(e,a.brush,n.startOnEmptySelection)},a.brush.intercept("toggle-values",a.listeners.toggle),a.brush.intercept("add-values",a.listeners.toggle),a.brush.intercept("remove-values",a.listeners.toggle),a.brush.intercept("set-values",a.listeners.toggle),a.listeners.start=function(){s.length>1&&s.forEach(e=>{e!==a&&e.brush.end()})},s.push(a),{trigger:i,consume:o}},u.setUpStart=function(){u.tearDown()},u.setUpDone=function(){l&&p()},u.tearDown=function(){l&&m(),s.forEach(e=>{e.brush.removeInterceptor("toggle-values",e.listeners.toggle),e.brush.removeInterceptor("add-values",e.listeners.toggle),e.brush.removeInterceptor("remove-values",e.listeners.toggle),e.brush.removeInterceptor("set-values",e.listeners.toggle)}),s=[]},u.pauseEngineCalls=function(e){s.forEach(t=>{t.id===e&&(t.sleep=!0)})},u.resumeEngineCalls=function(e,t){s.forEach(n=>{n.id===e&&(n.sleep=!1,t&&n.listeners.update([],[]))})},u.addComponent=function(e,t){s.forEach(n=>{n.id===e&&n.dependentComponents.push(t)})},u.on=function(){if(l)return;l=!0,p(),document.addEventListener("keydown",d),document.addEventListener("keyup",d);const e=()=>{s.forEach(e=>{e.brush.end()}),document.removeEventListener("keyup",f),o.active()&&o.toggle()};n.on("deactivated",e),a.unbindDeactivated=()=>{n.removeListener("deactivated",e)};const t=()=>{document.addEventListener("keyup",f)};n.on("activated",t),a.unbindActivated=()=>{n.removeListener("activated",t)}},u.isOn=()=>l,u.off=function(){l&&(l=!1,m(),document.removeEventListener("keydown",d),document.removeEventListener("keyup",d),document.removeEventListener("keyup",f),a.unbindActivated(),a.unbindDeactivated())},u.lassoState=function(){return o.active()&&!(e.isLassoDisabled&&e.isLassoDisabled())},u.allFieldsLocked=function(){return function(){let e=r.map(e=>t.dataset(e).fields().filter(e=>"dimension"===e.type()));return e=[].concat.apply([],e),e.length&&e.every(e=>e.raw().qLocked)}()},u}class sM{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var aM={create:e=>e.selectionsApi?oM(e):new sM};var lM={isOnComponentForRange:function(e,t,n){return!!e&&!!n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter(e=>-1!==t.indexOf(e.settings.key))[0]},isOnComponentForLasso:function(e,t,n){return e&&n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter(e=>e.settings.key===t.keys.componentKey)[0]},isOnComponentForNavBtn:function(e,t,n){return n.chart.componentsFromPoint(e.center).some(e=>e.settings.key===t)}};var cM={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:yg.DIRECTION_ALL,threshold:1,enable(r,i){if(e.lassoing)return t.isSelectionEnabled();const o=lM.isOnComponentForLasso(i,n,this);return t.isSelectionEnabled()&&i&&((s=n.handlers).selectionHandler.lassoState()&&!s.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var s},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(r){lM.isOnComponentForLasso(r,n,this)&&(t.switchTo("lasso",this.chart,r),e.lassoing=!0,n.handlers.selectionHandler.pauseEngineCalls(n.keys.lassoBrushKey),r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoStart",r))},lassomove(n){e.lassoing&&(n.clientX=n.pointers[0].clientX,n.clientY=n.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoMove",n))},lassoend(r){e.lassoing&&(r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoEnd",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!0),e.lassoing=!1)},lassocancel(r){e.lassoing=!1,t.doEmit(this.chart,"lasso","lassoCancel",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!1)}}}}};var uM={callMeasureRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?yg.DIRECTION_HORIZONTAL:yg.DIRECTION_VERTICAL,event:"measurerange",enable(i,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const s="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=lM.isOnComponentForRange(o,s,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!a,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(i){const o="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r];lM.isOnComponentForRange(i,o,this)&&(e.measureSelecting=!0,t.switchTo("measurerange",this.chart,i),t.doEmit(this.chart,"rangeMeasure","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.measureRangeBrushKey))},measurerangemove(n){e.measureSelecting&&t.doEmit(this.chart,"rangeMeasure","rangeMove",n)},measurerangeend(r){e.measureSelecting&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!0),t.doEmit(this.chart,"rangeMeasure","rangeEnd",r),e.measureSelecting=!1)},measurerangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!1),e.measureSelecting=!1}}}}};function hM(e,t){let n;return n="x-axis"===e?"horizontal"===t?yg.DIRECTION_VERTICAL:yg.DIRECTION_HORIZONTAL:"horizontal"===t?yg.DIRECTION_HORIZONTAL:yg.DIRECTION_VERTICAL,n}var dM={callAreaRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:hM(r,n.isHorizontal),event:"arearange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const s="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=lM.isOnComponentForRange(o,s,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!a,e.minoring}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(i){const o="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r];lM.isOnComponentForRange(i,o,this)&&(e.minoring=!0,t.switchTo("arearange",this.chart,i),t.doEmit(this.chart,"rangeMinor","areaStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.areaBrushKey))},arearangemove(r){e.minoring&&(this.chart.brush(n.keys.areaBrushKey).clear(),t.doEmit(this.chart,"rangeMinor","areaMove",r))},arearangeend(r){e.minoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!0),t.doEmit(this.chart,"rangeMinor","areaEnd",r),e.minoring=!1)},arearangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!1),e.minoring=!1}}}}};var fM={callDimensionRangeGesture:function(e,t,n,r){const i=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?yg.DIRECTION_VERTICAL:yg.DIRECTION_HORIZONTAL,event:"majorrange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const s="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=lM.isOnComponentForRange(o,s,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!a,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(i){const o="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r];lM.isOnComponentForRange(i,o,this)&&(e.majoring=!0,t.switchTo("majorrange",this.chart,i),t.doEmit(this.chart,"rangeDim","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.dimRangeBrushKey))},majorrangemove(n){e.majoring&&t.doEmit(this.chart,"rangeDim","rangeMove",n)},majorrangeend(r){e.majoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!0),t.doEmit(this.chart,"rangeDim","rangeEnd",r),e.majoring=!1)},majorrangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!1),e.majoring=!1}}}}};var pM={callDragGesture:function(e,t,n,r,i){let o={};return{type:"Pan",options:{direction:n.isHorizontal?yg.DIRECTION_VERTICAL:yg.DIRECTION_HORIZONTAL,event:"drag",enable(r,i){return e.dragging?t.isNavigationEnabled():(e.dragging=t.isNavigationEnabled()&&!!i&&!!this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter(e=>e.settings.key===n.keys.componentKey)[0],e.dragging)}},requireFailure:r?`lasso ${t.getBrushConfig()}`:"",events:{dragstart(e){o={x:e.deltaX,y:e.deltaY};let t=-(n.isHorizontal?e.deltaY:e.deltaX)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(t=-t),n.handlers.scrollHandler.getScrollApi().move(t)},dragmove(t){if(!e.dragging)return;let r=-(n.isHorizontal?t.deltaY-o.y:t.deltaX-o.x)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(r=-r),n.handlers.scrollHandler.getScrollApi().move(r),o={x:t.deltaX,y:t.deltaY}},dragend(){e.dragging&&(e.dragging=!1)},dragcancel(){e.dragging=!1}}}}};var mM={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,r){return!(!r||!e())&&lM.isOnComponentForNavBtn(r,t,this)}},events:{navBtnTap(e){this.chart.componentsFromPoint(e.center).forEach(t=>{const n=e.target,r=n?n.getAttribute("data-action"):"";if(r)return t.emit(r)})}}}}};var gM={create:function(e,t,n,r,i){const o={};t=t||"vertical";const s=r.lassoBrushKey||"select",a=r.dimRangeBrushKey||null,l=r.measureRangeBrushKey||null,c=r.areaBrushKey||null,u=r.legendBrushKey||null,h=!!e.selectionHandler&&e.selectionHandler.isOn(),d={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},f={gesture:"",type:""},p="horizontal"===t,m=p?"y-axis":"x-axis",g=p?"x-axis":"y-axis";function y(e,t,n){if(f.gesture===e)return;let r=s;const i=t||f.chart;switch(f.gesture){case"majorrange":v(i,"rangeDim","rangeClear",n),r=a;break;case"measurerange":v(i,"rangeMeasure","rangeClear",n),r=l;break;case"arearange":v(i,"rangeMinor","areaClear",n),r=c}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&i.brush(r).clear(),f.chart=t,f.type=o}function v(e,t,n,r){if(e){const i=e.component(t);i&&i.emit(n,r)}}let b=[];const x={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:v,switchTo:y,getBrushConfig:function(){return a?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},w={handlers:e,keys:r,isHorizontal:p,active:f,rangeSelStatus:i};function q(){y("none"),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}return h&&(b=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){y("none",this.chart,e),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}}}],b.unshift(mM.callNavBtnGesture(x.isNavigationEnabled,u)),b.push(cM.callLassoGesture(d,x,w)),a?l?(b.push(fM.callDimensionRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(uM.callMeasureRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(b.push(fM.callDimensionRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),b.push(dM.callAreaRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"})):(b.push(uM.callMeasureRangeGesture(d,x,w,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),b.push(dM.callAreaRangeGesture(d,x,w,m)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(b.push(pM.callDragGesture(d,x,w,h,n)),e.scrollHandler.getScrollApi().on("update",q)),o.gestures=b,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",q)},o}};function yM(e,t,n,r,i){let o=!1;r=r||"tooltip",n=n||["self"];const s=e.brush(r),a={};function l(){if(o){e.component(i).emit("hide")}o=!1}return a.isOpen=function(){return o},a.closeTooltip=l,a.update=function(){const a=s.brushes(),c=e.getAffectedShapes(r,"and",n,t);a.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(i).emit("show",{},n)}(c)):l()},a.toggleInterceptor=function(e){if(n.length>1){const t={},n=[];return e.forEach(e=>{t[e.key]||(t[e.key]={}),t[e.key][e.value]||(t[e.key][e.value]=!0,n.push(e))}),n}return e},a}var vM={create:(...e)=>yM(...e)},bM={formatMeasureValue:function(e,t){if(e.raw().isCustomFormatted)return e.formatter()(t.value.qText);const n=void 0!==t.value.qNum?t.value.qNum:t.value.qValue;return e.formatter()(n)}};const xM=e=>({h:t,data:n,style:r})=>{const i=function(e,t){const n=e.chartInstance.dataset(e.dataPath),r=[],i=t.length-5,o=Math.min(5,t.length);for(let i=0;i<o;i++){const o=t[i],s={rows:[]};if(e.labelData){const t=[],i=e.labelData;let a=!1;for(let e=0;e<i.length;e++){const n=o.data[i[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){a=!0;break}t.push(o.data[i[e]].value.qText)}if(a)return;s.header=e.headerResolver(t),s.rows=e.measureRows.map(t=>{const r=o.data;return e.rowResolver(n.field(r[t].source.field),r[t],r)}).filter(e=>!!e);const l=wM(e,o);l&&s.rows.unshift(l),r.push(s)}}i>0&&(r.numberInExcess=i);return r.rowCount=r[0]?r.length*r[0].rows.length:0,r}(e,n),o={h:t,style:r,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,i)};function wM(e,t){const n=t.data.color,r=e.colorService?.getSettings?.();if(!r||"color"===r.type||!n||!r.fieldType)return;const i=[];e.data.forEach(e=>{const n=t.data[e];n&&i.push(n.value)});const o=function(e){let t=-1;for(let n=0;n<e.length;n++)-3===e[n]&&(t=n);return t}(i),{translator:s}=e,a=r.label,l=t.attrs?.fill;return{color:l,label:a,value:-1!==o?s.get("properties.dimensionLimits.others"):n.label}}const qM="dist-flow-tooltip",MM=`#${qM}`;function SM(){if(!document.querySelector(MM)){const e=document.createElement("div");e.id=qM,e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function DM({key:e="tooltip",rtl:t,fontFamily:n,filter:r,content:i}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){SM()},beforeUpdate(){SM()},destroyed(){!function(){const e=document.querySelector(MM);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(MM),content:i,filter:r,extract:e=>e.node,direction:t?"rtl":"ltr",placement:"bounds"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:n,"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const{detectTextDirection:_M}=cq;const kM={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:bM.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:r,translator:i,rtl:o}=e,s=[],a=o?"right":"left";if(t.forEach(e=>{if(e.header){const t={...r.cell,textAlign:a,fontWeight:"bold",direction:_M(e.header)};s.push(n("tr",null,n("td",{style:t,colSpan:2},e.header)))}e.rows.forEach(e=>{let t=e.value;if(e.color){const r={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},i=n("div",{style:r});t=o?[e.value,i]:[i,e.value]}const i=o?[":",e.label]:[e.label,":"],l={...r.cell,textAlign:a,direction:_M(e.label)},c={...r.cell,textAlign:o?"left":"right",direction:_M(e.value)};s.push(n("tr",null,n("td",{style:l},i),n("td",{style:c},t)))})}),t.numberInExcess){const e=i.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...r.cell,textAlign:a,direction:_M(e)};s.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return s}};function CM(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let r={},i=!1;const o={};function s(e){e.listeners.update=function(t,n){e.action.update(t,n,e)},e.listeners.end=function(){e.action.closeTooltip()},e.brush.on(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.on("end",e.listeners.end),e.brush.intercept("set-values",e.action.toggleInterceptor)}function a(){Object.keys(r).forEach(e=>{l(r[e])})}function l(e){e.brush.removeListener(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.removeListener("end",e.listeners.end),e.brush.removeInterceptor("set-values",e.action.toggleInterceptor)}function c(){Object.keys(r).forEach(e=>{r[e].action.closeTooltip()})}function u(){c();for(const e in r)r[e].brush.clear()}return o.setUp=function(t){const o=Lx(!0,{},kM,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");r[o.contexts[0]]&&i&&l(r[o.contexts[0]]);const a=function(e,t){return{brush:t.brush(e.contexts[0]),action:vM.create(t,e.componentKey,e.data,e.contexts[0],e.tooltipKey),listeners:{},chartInstance:t,dataPath:e.dataPath,renderer:e.renderer,data:e.data,headerResolver:e.headerResolver,rowResolver:e.rowResolver,colorService:e.colorService,attrDimPath:e.attrDimPath,measureRows:e.measureRows,labelData:e.labelData,filterShapes:e.filterShapes,direction:e.environment.options.direction,theme:e.environment.theme,translator:e.environment.translator,treatAsDesktop:"touch"!==e.environment.deviceType}}(o,e);r[o.contexts[0]]=a,i&&s(a);const c=DM({key:o.tooltipKey,rtl:"rtl"===a.direction,fontFamily:a.theme.getStyle(n,"tooltip","fontFamily"),filter:(u=a.filterShapes,e=>u?u(e):function(e){const t=[];return e.forEach(e=>{-1===t.indexOf(e)&&"container"!==e.type&&t.push(e)}),t}(e)),content:xM(a,o.dataPath)});var u;return o.chartBuilder.getSettings().components.push(c),{trigger:{on:a.treatAsDesktop?"over":"tap",action:"set",contexts:o.contexts,data:o.data,globalPropagation:"stop"},consume:o.contexts.map(e=>({context:e})),component:c}},o.tearDown=function(){i&&a(),r=[]},o.closeTooltip=c,o.isOn=()=>i,o.on=function(){i||(i=!0,Object.keys(r).forEach(e=>{s(r[e])}),t&&t.on("mouseleave",u))},o.off=function(){i&&(i=!1,a(),t&&t.off("mouseleave",u),c())},o}var EM={create:(e,t,n)=>CM(e,t,n)};const AM=".scrollHandler";function TM(e,t,n,r,i){if(!e||!t||!n)throw Error("Scroll-handler: Missing input");this._chartInstance=e,this._$chartElement=t,this._getSlicedDataFn=n,this._on=!1,this._itemSize=30,this.options={direction:"vertical"},this._onScrollCallback=r,this._legendKey=i}function IM(){const e=("horizontal"===this.options.direction?this._$chartElement.width():this._$chartElement.height())||0,t=Math.floor(e/this.getItemSize());this._scrollViewSizeInItem=Math.max(t,1)}function NM(e){const t=function(e){let t=0,n=0,r=0;return e.wheelDelta&&(t=e.wheelDelta/60),e.detail&&(t=-e.detail/3),r=t,void 0!==e.axis&&e.axis===e.HORIZONTAL_AXIS&&(r=0,n=-1*t),void 0!==e.wheelDeltaY&&(r=e.wheelDeltaY/60),void 0!==e.wheelDeltaX&&(n=-1*e.wheelDeltaX/60),{delta:t,deltaX:n,deltaY:r,x:e.pageX,y:e.pageY}}(e.originalEvent);if(function(e,t,n,r){if(r&&n.componentsFromPoint(t).some(e=>e.settings.key===r))return n.component(r).emit(t.delta>0?"prev":"next"),e.preventDefault(),!0;return!1}(e,t,this._chartInstance,this._legendKey)||this._disabled||!this.getScrollApi())return;if(e.preventDefault(),!t.delta)return;const n=t.delta<0?3:-3;this._scrollApi.move(n)}function RM(){if(this._disabled||this._sizeChanged)return void(this._sizeChanged=!1);const e=this;this.getViewData().then(t=>{e._on&&!e._disabled&&e._onScrollCallback&&e._onScrollCallback(t,void 0,!0)}).catch(e=>{})}TM.prototype.getScrollApi=function(){this._scrollApi||(this._scrollApi=this._chartInstance.scroll("dimension"));return this._scrollApi},TM.prototype.setDisabled=function(e){this._disabled=e},TM.prototype.getDisabled=function(){return this._disabled},TM.prototype.setItemSize=function(e){this._itemSize!==e&&(this._itemSize=e,IM.call(this))},TM.prototype.getItemSize=function(){return this._itemSize},TM.prototype.getScrollViewSizeInItem=function(){this._scrollViewSizeInItem||IM.call(this);return this._scrollViewSizeInItem},TM.prototype.on=function(){if(this._on)return;this.getScrollApi()&&(this._scrollApi.removeAllListeners(),this._scrollApi.on("update",RM.bind(this)));this._$chartElement.on(`mousewheel${AM} DOMMouseScroll${AM}`,NM.bind(this)),this._$chartElement.on(`touchstart${AM}`,e=>{e.preventDefault()}),this._on=!0},TM.prototype.isOn=function(){return this._on},TM.prototype.off=function(){if(!this._on)return;this.getScrollApi()&&this._scrollApi.removeAllListeners();this._$chartElement.off(AM),this._on=!1},TM.prototype.updateViewState=function(e){IM.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem,max:e})},TM.prototype.onResize=function(){this._sizeChanged=!0,IM.call(this),this.getScrollApi()&&this._scrollApi.update({viewSize:this._scrollViewSizeInItem})},TM.prototype.isDataSizeChanged=function(e,t){return Math.min(this.getScrollViewSizeInItem(),t)!==e},TM.prototype.resetScroll=function(){this.getScrollApi()&&this._scrollApi.moveTo(0)},TM.prototype.getViewData=function(){let e=0,t=0;if(this.getScrollApi()){const n=this._scrollApi.getState();e=Math.round(n.start),t=n.viewSize}return this._getSlicedDataFn(e,t)},TM.prototype.setOptions=function(e){this.options.direction!==e.direction&&(this._scrollViewSizeInItem=void 0);this.options=e},TM.prototype.getScrollState=function(){return this.getScrollApi().getState().start},TM.prototype.setScrollState=function(e){this.getScrollApi().moveTo(e)};const OM=166/26,PM=12/11;function LM(e){return(12*Math.min(e,3)+Math.max(e-3,0)*OM)/11}function FM(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),n=e.match(/[\u3040-\u309F]/g),r=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,n=n?n.length:0,r=r?r.length:0;const i=t+n+r;return{latin:e.length-i,cjk:i}}function jM(e,t){const n={latin:0,cjk:0};void 0===t?e.forEach(e=>{const t=FM(e.qText);n.latin+=t.latin,n.cjk+=t.cjk}):e.forEach(e=>{const r=FM(e[t].qText);n.latin+=r.latin,n.cjk+=r.cjk});const r=Math.max(1,n.latin+n.cjk);return n.latinRatio=n.latin/r,n.cjkRatio=n.cjk/r,n}function zM(e,t,n){return e*(e<=24?t:n)}var HM={endsWith:function(e,t){return-1!==e.indexOf(t,e.length-t.length)},startsWith:function(e,t){return 0===e.indexOf(t)},contains:function(e,t){if(!e)throw new Error("Haystack is undefined.");if(!t)throw new Error("Needle is undefined.");return-1!==e.indexOf(t)},stringWidthOverMWidth:LM,getCharacterRatios:FM,getTotalCharacterRatios:jM,getAdjustedMaxGlyphCount:function(e,t,n){const r=jM(t,n),i=r.latinRatio*e,o=r.cjkRatio*e;return Math.ceil(LM(i)+o*PM)},estimateLatinLabelWidth:zM,estimateLabelWidth:function(e,t,n,r,i){return e*n+zM(t,r,i)}};const BM={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:255,g:255,b:255,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},VM=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,$M=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,WM=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,UM=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,YM=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,KM=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,XM=Math.floor,GM=Math.round,JM=Vy.extend({init(){let e,t,n,r,i,o,s,a,l,c,u,h,d=0,f=0,p=0,m=1;if(this._invalid=!1,arguments[0]instanceof JM)d=arguments[0]._r,f=arguments[0]._g,p=arguments[0]._b,m=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(h=arguments[0],u=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(h))d=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10);else if(u=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(h))d=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10),m=parseFloat(u[4]);else if(u=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(h))d=parseInt(u[1],16),f=parseInt(u[2],16),p=parseInt(u[3],16),m=1;else if(u=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(h))d=parseInt(u[1]+u[1],16),f=parseInt(u[2]+u[2],16),p=parseInt(u[3]+u[3],16),m=1;else if(u=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=GM(255*d),f=GM(255*f),p=GM(255*p),m=1}else if(u=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),m=parseFloat(u[7]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-.5*o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=GM(255*d),f=GM(255*f),p=GM(255*p)}else if(u=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(h)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),i=parseFloat(u[5]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=i-o,d=l[0]+c,f=l[1]+c,p=l[2]+c,d=GM(255*d),f=GM(255*f),p=GM(255*p),m=1}else BM[h.toLowerCase()]?(n=h.toLowerCase(),d=BM[n].r,f=BM[n].g,p=BM[n].b,m="number"==typeof BM[n].a?BM[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(m=(4278190080&arguments[0])>>>24,m/=255,d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(d=arguments[0],f=arguments[1],p=arguments[2],m=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+d+f+p+m)&&(this._invalid=!0),this._r=XM(d),this._g=XM(f),this._b=XM(p),this._a=m,this._spaces={}},isInvalid(){return this._invalid},setAlpha(e){this._a=e,this._spaces={}},getAlpha(){return this._a},toRGB:function(){return this._spaces.rgb||(this._spaces.rgb=JM.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=JM.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=JM.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=JM.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=JM.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=JM.toHSLA(this,e)),this._spaces.hsla},toHSV(){const e=this.toHSVComponents();return`hsv(${e.h},${e.s},${e.v})`},toHSVComponents:function(){return this._spaces.hsvComp||(this._spaces.hsvComp=JM.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=JM.toNumber(this)),this._spaces.num},isDark(){return this.isInvalid()||this.getLuminance()<125},getLuminance(){return void 0===this._lumi&&(this._lumi=.299*this._r+.587*this._g+.114*this._b),this._lumi},shiftLuminance(e){const t=this.toHSLA(),n=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(t),r=parseFloat(n[1]),i=parseFloat(n[3]);let o=parseFloat(n[5]);const s=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${r},${i},${o},${s})`},isEqual(e){return e instanceof JM||(e=new JM(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[XM(this._r+(e._r-this._r)*t),XM(this._g+(e._g-this._g)*t),XM(this._b+(e._b-this._b)*t),XM(this._a+(e._a-this._a)*t)].join(",")})`},createShiftedColor(e){(void 0===e||Number.isNaN(+e))&&(e=1);const t=this.getLuminance(),n=this._g<126?1:1+this._g/512,r=this.shiftLuminance(20*(t*n<220?.8+1/(t+1)*4:-(.8+t/255*1))*e);return new JM(r)}});JM.toRGB=function(e){if(e instanceof JM)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=JM.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},JM.toRGBA=function(e,t){if(e instanceof JM)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=JM.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},JM.toHex=function(e){let t,n,r;return e instanceof JM?(t=e._r.toString(16),n=e._g.toString(16),r=e._b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${[t,n,r].join("")}`):("string"==typeof e&&(e=JM.toNumber(e)),t=((16711680&e)>>16).toString(16),n=((65280&e)>>8).toString(16),r=(255&e).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${t}${n}${r}`)},JM.toHSL=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new JM(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=Math.max(s,a,l),u=Math.min(s,a,l);if(r=t?.21*s+.72*a+.07*l:(c+u)/2,c===u)n=0,o=0;else{switch(i=c-u,n=r>.5?i/(2-c-u):i/(c+u),c){case s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsl(${360*o},${100*n},${100*r})`},JM.toHSLA=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new JM(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=e._a,u=Math.max(s,a,l),h=Math.min(s,a,l);if(r=t?.21*s+.72*a+.07*l:(u+h)/2,u===h)n=0,o=0;else{switch(i=u-h,n=r>.5?i/(2-u-h):i/(u+h),u){case s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsla(${360*o},${100*n},${100*r},${c})`},JM.toHSVComponents=function(e){let t,n,r=0;"string"==typeof e&&(e=new JM(e));const i=e._r/255,o=e._g/255,s=e._b/255,a=Math.max(i,o,s),l=Math.min(i,o,s),c=a;if(a===l)t=0,r=0;else{switch(n=a-l,t=0===n?0:n/c,a){case i:r=(o-s)/n+(o<s?6:0);break;case o:r=(s-i)/n+2;break;case s:r=(i-o)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*c}},JM.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof JM)return(arguments[0]._r<<16)+(arguments[0]._g<<8)+arguments[0]._b;let e,t,n=0,r=0,i=0;return 1===arguments.length&&"string"==typeof arguments[0]&&(t=arguments[0],(e=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i.exec(t))?(n=parseInt(e[1],10),r=parseInt(e[2],10),i=parseInt(e[3],10)):(e=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t))?(n=parseInt(e[1],16),r=parseInt(e[2],16),i=parseInt(e[3],16)):(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(t))&&(n=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16))),(n<<16)+(r<<8)+i},JM.blend=function(e,t,n){const r=(16711680&(e=JM.toNumber(e)))>>16,i=(65280&e)>>8,o=255&e;return(r+(((16711680&(t=JM.toNumber(t)))>>16)-r)*n<<16)+(i+(((65280&t)>>8)-i)*n<<8)+(o+((255&t)-o)*n)},JM.getBlend=function(e,t,n){const r=e._r+(t._r-e._r)*n,i=e._g+(t._g-e._g)*n,o=e._b+(t._b-e._b)*n,s=e._a+(t._a-e._a)*n;return new JM(r,i,o,s)},JM.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(VM.test(e)||$M.test(e)||WM.test(e)||UM.test(e)||YM.test(e)||KM.test(e)||BM[e.toLowerCase()])},JM.getBestContrast=function(e,t,n){const r=e.getLuminance();return Math.abs(r-t.getLuminance())>Math.abs(r-n.getLuminance())?t:n},JM.getContrast=function(e,t){if(!e||!t)return;const n=e.getLuminance()/100,r=t.getLuminance()/100;return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},JM.isDark=function(){const e={getLuminance:JM.prototype.getLuminance,isInvalid:JM.prototype.isInvalid};return JM.prototype.init.apply(e,[].slice.call(arguments)),JM.prototype.isDark.call(e)},JM.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const ZM={TRANSPARENT_BLACK:"rgba( 0,0,0,0.2 )",TRANSPARENT_WHITE:"rgba( 255,255,255,0.7 )",LIGHT_GREY:"#ccc",DARK_GREY:"#666",BLACK:"#000",WHITE:"#fff",getInverse(e){const t=new JM(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new JM(e);return 0===t.getAlpha()?this.DARK_GREY:JM.getBestContrast(t,new JM(ZM.LIGHT_GREY),new JM(ZM.DARK_GREY))},getBestContrast:(e,t,n)=>JM.getBestContrast(new JM(e),new JM(t),new JM(n)),getContrastingTransparent(e){const t=new JM(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};function QM(e,t){return Py(e,`${t=t?`${t}.`:""}qHyperCube.qDimensionInfo.length`)>1}function eS(e,t){if(Py(e,`${t=t?`${t}.`:""}qHyperCube.qStackedDataPages.0.qData.length`))return Py(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qSubNodes.length`,0)+Py(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qDown`,0)+Py(e,`${t}qHyperCube.qStackedDataPages.0.qData.0.qUp`,0);const n=Py(e,`${t}qHyperCube.qEffectiveInterColumnSortOrder.0`);return tS(Py(e,`${t}qHyperCube.qDimensionInfo.${n}`))}function tS(e){return e.qCardinalities.qHypercubeCardinal}var nS={getHyperCube:function(e,t){return e&&(e=t?Py(e,t):e)&&e.qHyperCube?e.qHyperCube:null},hasSecondDimension:QM,hasSecondMeasure:function(e,t){return Py(e,`${t=t?`${t}.`:""}qHyperCube.qMeasureInfo.length`)>1},getStackedCubeSizeOf2Dims:eS,getStackedCubeSizeOfMax2Dims:function(e,t){return QM(e,t)?eS(e,t):function(e,t){return Py(e,(t=t?`${t}.`:"")+"qHyperCube.qSize.qcy")}(e,t)},getOuterDimensionSizeOfMax2Dims:function(e,t){return QM(e,t)?eS(e,t):1},getDimensionSize:tS};const rS=function(){this._maxJitter=1};rS.prototype.calcMaxJitter=function(e,t,n){this._maxJitter=Math.min(e*t,n-e)},rS.prototype.getJitterValue=function(e){const t=Math.abs(Rq(`${e}`)%10)/9;return this._maxJitter/2-t*this._maxJitter};var iS={toBefore:function(e){const t=e.qUndoExclude.qHyperCube;2===t.qEffectiveInterColumnSortOrder.length&&0===t.qEffectiveInterColumnSortOrder[0]&&(t.qEffectiveInterColumnSortOrder=[1,0],t.qDimensionInfo.reverse())},toAfter:function(e){const t=e.qUndoExclude.qHyperCube;2===t.qEffectiveInterColumnSortOrder.length&&1===t.qEffectiveInterColumnSortOrder[0]&&(t.qEffectiveInterColumnSortOrder=[0,1],t.qDimensionInfo.reverse())}};var oS={generateHyperCube:function(e,t,n,r){t.qUndoExclude||(t.qUndoExclude={}),t.qUndoExclude.qHyperCubeDef=Lx(!0,{},t.qHyperCubeDef),t.qUndoExclude.qHyperCubeDef.qDimensions.reverse(),pw.updateHypercubeAttributes(t,"qUndoExclude.qHyperCubeDef.",t.color.point);let i=[];const o=t.qUndoExclude.qHyperCubeDef.qDimensions.length,s=t.color.point&&!t.color.point.auto&&"byExpression"===t.color.point.mode;if(o>0&&s){i=[cw.create(cw.IDMAP.COLOR_BY_EXPRESSION,{qExpression:yx(t,"color.point.expression.qValueExpression.qExpr")})]}return t.qUndoExclude.qHyperCubeDef.qMeasures[0].qAttributeExpressions=i,aw.hasMultipleDimensions(t)?Vx.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,n).then(i=>{zw.applySorting(t,e,n,i,r);const o=i.dimensions[0],s=i.dimensions[1],a=i.measures[0],l=Lw.getFractileExpression(1,o,s,a),c=Lw.getFractileExpression(0,o,s,a);t.qUndoExclude.qHyperCubeDef.qDimensions[0].qAttributeExpressions=[{qExpression:c,id:"minBoxValue"},{qExpression:l,id:"maxBoxValue"}]}):(t.qUndoExclude.qHyperCubeDef.qInterColumnSortOrder=[1,0],Promise.resolve())}};const sS=e=>e.baseColor||e.coloring&&e.coloring.baseColor;function aS(e){const{qDimensionInfo:t,qMeasureInfo:n}=e.qUndoExclude.qHyperCube,r=t.some(sS),i=n.some(sS),o=e.color.point.useBaseColors;return"measure"===o&&!i||"dimension"===o&&!r?"off":o}function lS({layout:e,localeInfo:t,model:n,picasso:r,environment:i}){const{app:o,theme:s,translator:a}=i,l=Lx(!0,{},e.color.point);var c;return 2===e.qHyperCube.qDimensionInfo.length&&(c=l.byDimDef,0===c?.activeDimensionIndex?c.activeDimensionIndex=1:1===c?.activeDimensionIndex&&(c.activeDimensionIndex=0)),function(e){return!!e.snapshotData&&!e.snapshotData.content?.chartData?.legendDataPage&&!!e.qUndoExclude?.legendData}(e)&&(e=function(e){return(e=Lx({},e)).snapshotData=Lx({},e.snapshotData),e.snapshotData.content=Lx({},e.snapshotData.content),e.snapshotData.content.chartData=Lx({},e.snapshotData.content.chartData),e.snapshotData.content.chartData.legendDataPage=e.qUndoExclude.legendData.qDataPages,e}(e)),l.mode||(l.mode="primary"),px({app:o,model:n,picasso:r,translator:a,config:{localeInfo:t,theme:s,key:"color",definitionPath:"/qUndoExclude/qHyperCubeDef"},createConfig:()=>({layout:e,hc:e.qUndoExclude.qHyperCube,legendProps:e.legend,colorProps:{...l,useBaseColors:aS(e)}})})}const cS=ow.DATA_PATH,uS=ow.HYPERCUBE_PATH,hS=ow.HYPERCUBE_DEF_PATH;function dS(e){return Array.isArray(e)?e:e?[e]:[]}function fS(e){return Math.min(nS.getOuterDimensionSizeOfMax2Dims(e,cS),ow.MAX_STACKED_VALUES)}function pS(e,t){return{viewSize:t,max:fS(e)}}function mS(){const e=ow.MAX_STACKED_VALUES>=this.layout.qUndoExclude.qHyperCube.qSize.qcy?3:1;this.backendApi.setCacheOptions({height:e*this._scrollHandler.getScrollViewSizeInItem(),width:3})}function gS(){if(this.layout&&nS.hasSecondDimension(this.layout,cS)){this._scrollHandler.onResize();!!this.layout.snapshotData||mS.call(this)}}function yS(){const e=this.chartInstance.component("legend");e&&e.emit&&e.emit("resetindex")}function vS(e,t){return yx(e,`qHyperCube.qDimensionInfo.${t}.qIsOneAndOnlyOne`)||!1}const bS=Nq.extend("DistributionPlot",{namespace:".distributionPlot",init({lasso:e,environment:t,flags:n,picasso:r,$element:i,backendApi:o,selectionsApi:s}){this._super(r,i,t,o,s),this.flags=n,this.picasso=r,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new Jq,this._selectionHandler=aM.create({model:o.model,chartInstance:this.chartInstance,selectionsApi:s,isLassoDisabled:this.isLassoDisabled.bind(this),selectPaths:["/qUndoExclude/qHyperCubeDef"],lasso:e}),this._tooltipHandler=EM.create(this.chartInstance,i,ow.CHART_ID),this._scrollHandler=new TM(this.chartInstance,i,this.getSlicedData.bind(this),this.onScrollCallback.bind(this),"colorLegend-cat"),this._maxBubbleScale=ow.BUBBLE_SCALES_MAX,this._jitterTool=new rS,this.setDataPaths([`${cS}/${uS}`])},onScrollCallback(e,t,n){const r=this;this._updateColorMapData(e).then(()=>{r.updateChart(e,t,n)})},getSlicedData(e,t){const n=this;return this.getData(this.backendApi,this.layout[cS][uS],{top:e,height:t}).then(()=>n.layout)},updateScrollHandlerState(e){void 0!==e&&(this._disableScrolling=!!e),this._scrollHandler.setDisabled(!nS.hasSecondDimension(this.layout,cS)||this._disableScrolling)},updateConstraints(e){const t=!e.active,n=!e.passive,r=!e.select&&!e.active;this._scrollHandler[t?"on":"off"](),this._tooltipHandler[n?"on":"off"](),this._selectionHandler[r?"on":"off"]()},off(){this._scrollHandler.off(),this._tooltipHandler.off(),this._selectionHandler.off()},_getPointScale(){return function(e){return e.dataPoint&&e.dataPoint.bubbleScales}(this.layout)?this.layout.dataPoint.bubbleScales/this._maxBubbleScale:1},_calcBandwidth(e,t){const n=t.scales().dimension;this._bandwidthRatio=n?n.pxScale(e).bandwidth():1,this._bandwidthPx=e*this._bandwidthRatio},_calcPointMaxSize(e,t){const n=Math.min(ow.MAX_POINT_BASE_SIZE_PX,t*ow.POINT_BANDWIDTH_BASE_RATIO)*e;this._pointMaxSizePx=Math.max(ow.MIN_POINT_PIXELS,n)},_calcPointSize(e,t){this._pointSize=e/t},_getDimAxisSettings(e,t){const n=dS(t.trigger),r=dS(t.consume),i=this.picassoElement.getBoundingClientRect()["vertical"===e.orientation?"height":"width"],o=HM.getAdjustedMaxGlyphCount(function(e){const t=e[cS][uS].qDimensionInfo,n=nS.hasSecondDimension(e,cS)?t[0].qApprMaxGlyphCount:0;return Math.min(ow.MAX_GLYPH_COUNT,n)}(this.layout||e),e[cS][uS].qStackedDataPages[0].qData[0].qSubNodes),s=i/4;return{brush:{trigger:n,consume:r},settings:{labels:{mode:"vertical"===e.orientation?e.dimensionAxis.label:"auto",maxGlyphCount:o,maxLengthPx:s},paddingEnd:4}}},_getBoxMarkerSettings(e,t){const{theme:n}=this.environment,r=e.color.point.auto?n.getStyle(ow.CHART_ID,"box","fill"):n.getColorPickerColor(e.color.box.paletteColor),i=dS(t.trigger),o=dS(t.consume),s=this;let a="qMeasureInfo/0",l="qMeasureInfo/0";nS.hasSecondDimension(e,cS)&&e.qUndoExclude.qHyperCube.qDimensionInfo[0].qAttrExprInfo.length&&(a="qDimensionInfo/0/qAttrExprInfo/0",l="qDimensionInfo/0/qAttrExprInfo/1");const c={require:["chart"],displayOrder:1e3,settings:{chart:this,box:{fill:r,stroke:n.getStyle(ow.CHART_ID,"box","stroke"),strokeWidth:0,width:ow.POINT_BANDWIDTH_BASE_RATIO,maxWidthPx:ow.MAX_POINT_BASE_SIZE_PX,minWidthPx:ow.MIN_POINT_PIXELS+2*ow.BOX_PADDING},minor:{scale:"measure"},orientation:e.orientation},beforeRender(){const e=s.layout.presentation&&s.layout.presentation.visibleComponents&&-1!==s.layout.presentation.visibleComponents.indexOf("point"),t="horizontal"===s.layout.orientation?this.rect.height:this.rect.width;s._calcBandwidth(t,this.chart),s._calcPointMaxSize(e?s._getPointScale():1,s._bandwidthPx);let n=0;s._jitter&&(s._calcPointSize(s._pointMaxSizePx,s._bandwidthPx),n=s._pointSize*s._bandwidthPx*ow.JITTER_PARAMETER);const r=s._pointMaxSizePx+n+2*ow.BOX_PADDING,i=r/s._bandwidthPx;this.settings.settings.box.maxWidthPx=Math.min(s._bandwidthPx-2,r),this.settings.settings.box.width=i},brush:{trigger:i,consume:o},data:{extract:{field:"qDimensionInfo/0",trackBy:()=>-1,props:{start:{field:a,reduce:"min"},end:{field:l,reduce:"max"},elemNo:{field:"qDimensionInfo/0"}}}}};return nS.hasSecondDimension(e,cS)&&(c.data.extract.field="qDimensionInfo/0",c.data.extract.trackBy=function(e){return e.qElemNo},c.settings.major={scale:"dimension"}),c},_getPointMarkerSettings(e,t,n){let r=1;e.dataPoint&&!1===e.dataPoint.border&&(r=0);const i=dS(t.trigger),o=dS(t.consume);this._tooltipHandler.isOn()&&(i.push(n.point.trigger),o.push.apply(o,n.point.consume));const s=this,a=this.colorService.getColor(),l={require:["chart"],displayOrder:1100,settings:{chart:this,fill:a,stroke:e=>{const t=a(e);return ZM.getContrastingTransparent(t)},size:.3,strokeWidth:r,sizeLimits:{maxRelExtent:10,maxPx:ow.MAX_POINT_BASE_SIZE_PX,minPx:ow.MIN_POINT_PIXELS},orientation:e.orientation},beforeRender(){const e="horizontal"===s.layout.orientation?this.rect.height:this.rect.width;if(s._calcBandwidth(e,this.chart),s._calcPointMaxSize(s._getPointScale(),s._bandwidthPx),s._calcPointSize(s._pointMaxSizePx,s._bandwidthPx),s._jitter){const t=2*ow.BOX_PADDING/e;s._jitterTool.calcMaxJitter(s._pointSize*s._bandwidthRatio,ow.JITTER_PARAMETER,s._bandwidthRatio-t)}this.settings.settings.sizeLimits.maxPx=s._pointMaxSizePx,this.settings.settings.size=s._pointSize},brush:{trigger:i,consume:o},data:{extract:{field:"qDimensionInfo/0",props:{innerElemNo:{field:"qDimensionInfo/0"},elemNo:{field:"qDimensionInfo/0"},inner:{field:"qDimensionInfo/0",value:e=>e},row:{field:"qDimensionInfo/0",value:e=>e.qRow},measure:{field:"qMeasureInfo/0",reduce:"first",value:e=>e,reduceLabel:"none"},...this.colorService.getDatumProps()}}}};return nS.hasSecondDimension(e,cS)&&(l.data.extract.props.inner.field="qDimensionInfo/1",l.data.extract.props.innerElemNo.field="qDimensionInfo/1",l.data.extract.props.row.field="qDimensionInfo/1",l.data.extract.field="qDimensionInfo/1",l.data.extract.props.outer={field:"qDimensionInfo/0",value:e=>e}),this.setDataPaths([`${cS}/${uS}`]),l},_getPointSelectionLayerSettings(e){const t=Lx(!0,{},e,{key:"selection-point-marker",settings:{opacity:0}});return t.brush.consume.pop(),t.brush.consume.forEach(e=>{e.style.inactive=void 0,e.style.active.opacity=1}),t.brush.trigger=[],t},createChartSettings(e){const t=this.isRtl(),{theme:n}=this.environment,r=!!e.snapshotData,i=e.presentation&&e.presentation.visibleComponents,o=i&&-1!==e.presentation.visibleComponents.indexOf("point"),s=i&&-1!==e.presentation.visibleComponents.indexOf("box");this._jitter=o&&e.dataPoint&&"jitter"===e.dataPoint.displacement;const a=e[cS][uS],l=a.qDimensionInfo,c="horizontal"!==e.orientation?"y":"x",u="horizontal"!==e.orientation?"x":"y",h=_q.create({chartID:ow.CHART_ID,theme:n,isRtl:t,flags:this.flags});if(0===a.qStackedDataPages[0].qData.length)return h.getSettings();let d={},f={},p={},m={};if(this._selectionHandler.isOn()){const t=!o&&nS.hasSecondDimension(e,cS);this._selectionHandler.setUpStart();const n=this._selectionHandler.setUpBrush({contexts:["select-inner"],data:["innerElemNo"],isSingleSelect:vS(e,0)},!0),r=this._selectionHandler.setUpBrush({contexts:["select-outer"],data:["elemNo"],isSingleSelect:vS(e,1)},!0),i=this._selectionHandler.setUpBrush({dataPath:cS,contexts:["select-color"],data:["color"],startOnEmptySelection:!1},!0),s=this._selectionHandler.setUpBrush({contexts:["select-measure"],data:[c]},!0);this._selectionHandler.setUpDone(),d={trigger:Lx(!0,{},r.trigger,{data:[""]}),consume:[Lx(!0,{},r.consume,{data:[""]})]},f={trigger:t?r.trigger:null,consume:[n.consume,r.consume,s.consume]},p={trigger:n.trigger,consume:[n.consume,r.consume,s.consume,i.consume]},m={trigger:[Lx(!0,{},i.trigger,{data:[""]})],consume:[Lx(!0,{},i.consume,{data:[""]}),n.consume,r.consume]}}const g={point:{},box:{}};this._tooltipHandler.isOn()&&(g.point=this._tooltipHandler.setUp({chartBuilder:h,colorService:this.colorService,data:nS.hasSecondDimension(e,cS)?["innerElemNo","elemNo"]:["innerElemNo"],contexts:["pointTip"],componentKey:"point-marker",environment:this.environment,attrDimPath:`/${uS}/qDimensionInfo/${nS.hasSecondDimension(e,cS)?1:0}/qAttrDimInfo/0`,measureRows:["measure"],labelData:nS.hasSecondDimension(e,cS)?["inner","outer"]:["inner"]}));const y=function(e){const t=[],n=e.qUndoExclude&&e.qUndoExclude.qHyperCube&&e.qUndoExclude.qHyperCube.qDimensionInfo?e.qUndoExclude.qHyperCube.qDimensionInfo:void 0;if(!n)return!1;for(let e=0;e<n.length;e++)n[e].qLocked?t.push(n[e].qLocked):t.push(!1);return t}(e),v=function(e,t,n){const r={};return 1===e.length?(r.isOpenDim=!1,e[0]?r.isOpenMea=!1:r.isOpenMea=!0):e[0]&&!e[1]?(r.isOpenDim=!1,r.isOpenMea=!0):!e[0]&&e[1]?(r.isOpenDim=!0,r.isOpenMea=!1):e[0]&&e[1]?(r.isOpenDim=!1,r.isOpenMea=!1):(r.isOpenDim=!0,r.isOpenMea=!0),t&&(r.isOpenMea=!1),n&&(r.isOpenDim=!1),r}(y,vS(e,0),vS(e,1)),b={scrollHandler:this._scrollHandler,selectionHandler:this._selectionHandler},x={componentKey:o?"point-marker":"box-marker",lassoBrushKey:"select-inner",dimRangeBrushKey:"select-outer",measureRangeBrushKey:"select-measure",areaBrushKey:null,legendBrushKey:"legend"};if(this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=gM.create(b,e.orientation,t,x,v),h.addPreset("dimension-measure-chart",{isRtl:t,includeDimensionAxis:nS.hasSecondDimension(e,cS),orientation:e.orientation,selectionsEnabled:this._selectionHandler.isOn(),theme:n,measureSource:["qMeasureInfo/0"],dimensionSource:"qDimensionInfo/0",measureAxisProperties:e.measureAxis,measureTitleText:a.qMeasureInfo[0].qFallbackTitle,dimensionAxisProperties:e.dimensionAxis,dimensionAxisSettings:this._getDimAxisSettings(e,d),dimensionTitleText:l&&l[0]&&l[0].qFallbackTitle||"",gridlines:e.gridlines,hasNavigation:!r,isNavigationEnabledFn:()=>this._scrollHandler.isOn(),scrollSettings:pS(e,this._scrollHandler.getScrollViewSizeInItem()),enableLasso:!0,lasso:{brushKey:o?"select-inner":"select-outer",brushComponents:o?["point-marker"]:["box-marker"],brushData:o?["innerElemNo"]:["elemNo"]},enableDimRange:!0,dimRange:{brushKey:"select-outer",brushAxis:"horizontal"===e.orientation?"y-axis":"x-axis",brushArea:s?"box-marker":"point-marker",brushScale:"dimension"},enableMeasureRange:o,measureRange:{brushKey:"select-measure",brushAxis:"horizontal"===e.orientation?"x-axis":"y-axis",brushArea:o?"point-marker":"box-marker",brushScale:"measure",multiple:!0},brushActions:this._dependentActions.gestures,refLines:e.refLine&&e.refLine.refLines,axisTitleStyle:tw(ow.CHART_ID,n,e),axisLabelStyle:nw(ow.CHART_ID,n,e)}),s){const t=this._getBoxMarkerSettings(e,f);h.addComponent("box-marker",t)}if(o){const r=this._getPointMarkerSettings(e,p,g);if(r.data.extract.props[c]={field:"qMeasureInfo/0"},r.settings[c]={scale:"measure"},nS.hasSecondDimension(e,cS)&&(r.data.extract.props[u]={field:"qDimensionInfo/0",type:"qual"},r.settings[u]={scale:"dimension"}),this._jitter){r.settings[u]=r.settings[u]||{};const e=this._jitterTool;r.settings[u].fn=function(t){let n;return n="function"==typeof t.scale?t.scale(t.datum[u].value)+.5*t.scale.bandwidth():.5,n+e.getJitterValue(t.datum.value,ow.JITTER_PARAMETER)}}h.addComponent("point-marker",r),h.addComponent("point-marker",this._getPointSelectionLayerSettings(r));if(e.legend?!1!==e.legend.show:!e.color.point.auto&&"byDimension"===e.color.point.mode){const r={title:rw(ow.CHART_ID,n,e,this.flags),label:iw(ow.CHART_ID,n,e,this.flags)};this.addLegend(h,t,m,r)}}const w=h.getSettings();return this.addSnapshotChartSettings(w,e),w.scales={...w.scales,...this.colorService.getScales()},w.palettes=this.colorService.getPalettes(),w},addLegend(e,t,n,r){const i={eventName:"legend-c",key:"colorLegend",styleReference:"object.comboChart",styleOverrides:r,rtl:t,settings:{item:{shape:{type:"circle",size:10}}}},o=this.colorService.getLegend(i,{actions:{interact:{enabled:()=>this._scrollHandler.isOn()}}});let{components:s}=o;s=s.filter(e=>!!e),s.length>0&&(this._selectionHandler.isOn()&&(s[0].brush={consume:n.consume.map(e=>Lx(!0,e,{style:{active:null}})),trigger:n.trigger}),s[0].layout.displayOrder=200,s[0].layout.prioOrder=50),e.settings.components.push(...s),e.settings.interactions[0].gestures.unshift(...o.interactions)},resize(){this.layout&&(gS.call(this),this._super())},hasValidData(){const e=this.layout;return e[cS]&&e[cS][uS]&&e[cS][uS].qStackedDataPages.length&&e[cS][uS].qStackedDataPages[0].qData},paint(){const e=!!this.layout.snapshotData;e||this.environment.options.viewState||this.updateScrollHandlerState(!1),this._orientation||(this._orientation=this.layout.orientation),this._orientation!==this.layout.orientation&&(gS.call(this),this._orientation=this.layout.orientation);const t=this.layout;if(!this.hasValidData())return Promise.resolve();const n=this,r=this._super;return!e&&nS.hasSecondDimension(t,cS)&&this._scrollHandler.isDataSizeChanged(yx(t,`${cS}.${uS}.qStackedDataPages.0.qData.0.qSubNodes.length`),nS.getOuterDimensionSizeOfMax2Dims(t,cS))?this._scrollHandler.getViewData().finally(()=>n._updateColorMapData(t).then(()=>r.call(n))):this._updateColorMapData(t).then(()=>r.call(n))},async setSnapshotData(e){this._super(e);const t=await this.colorService.getSnapshotData();return e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t},e[cS][uS].qStackedDataPages=this.layout[cS][uS].qStackedDataPages,iS.toBefore(e),e},getViewState(){return{scroll:Math.round(this._scrollHandler.getScrollState())}},getDisclaimerAttributes(e){const t=!this.flags.isEnabled("SHOW_DISCLAIMER")||!(!1===e.showDisclaimer),n=!nS.hasSecondDimension(e,cS)&&e.qHyperCube.qSize.qcy>1e4||nS.hasSecondDimension(e,cS)&&e.qHyperCube.qSize.qcy>=ow.MAX_STACKED_VALUES,r=t&&n,i=pS(e,this._scrollHandler.getScrollViewSizeInItem());return{data:e&&e.qUndoExclude,supportedDisclaimers:{LimitedData:t&&r},options:{paddingBottom:r&&i&&i.viewSize<i.max,supportNegative:!0,explicitLimitedData:r}}},async _updateColorMapData(e){this.colorService=lS({layout:e,localeInfo:this.localeInfo,model:this.backendApi.model,picasso:this.picasso,environment:this.environment}),await this.colorService.initialize();const t=this.colorService.getSettings().field,n=this.chartInstance.brush("select-color");/qAttrDimInfo/.test(t)&&n.addKeyAlias("attrDim/qDimensionInfo/0",`${cS}/${uS}/${t}`)},_createColorLegendCube(e){const t=nS.hasSecondDimension(this.layout,cS)?1:0;return{qDimensionInfo:[this.layout[cS][uS].qDimensionInfo[t].qAttrDimInfo[0]],qMeasureInfo:[],qDataPages:e,qMode:"S",qSize:{qcx:1,qcy:e[0].qMatrix.length}}},_updateColorData(){return this._updateColorMapData(this.layout)},updateDerivedProperties(e,t){const{app:n,translator:r}=this.environment,i=this,o=i.backendApi.model;return i._derivedProperties.addDefaultHyperCubeHash(e.qHyperCubeDef,t.qHyperCube,n,function(e){return{cube:e[hS],sorting:e.sorting,color:{point:e.color.point}}}(e)).then(s=>{const a={layout:t,properties:e,model:o,hashData:s,generateDerivedProperties:(e,t)=>oS.generateHyperCube(e,t,n,r)};return i._derivedProperties.updateDerivedProperties(a)})},updateData(e){const t=this,n=!!e.snapshotData;return t._super(e).then(()=>{if(t._destroyed)return Promise.reject();if(e=t.layout,t._scrollHandler.setOptions({direction:"horizontal"===e.orientation?"vertical":"horizontal"}),n)return iS.toAfter(e),t._updateColorMapData(e);t.updateScrollHandlerState(!0);const{viewState:r}=t.environment.options;let i;return r?(t._scrollHandler.updateViewState(fS(e)),t._scrollHandler.setScrollState(r.scroll)):(t._scrollHandler.resetScroll(),yS.call(t)),t._scrollHandler.getScrollViewSizeInItem()&&!t._cacheSizeInitialized&&(mS.call(t),t._cacheSizeInitialized=!0),i=nS.hasSecondDimension(e,cS)?t.getSlicedData(t._scrollHandler.getScrollState(),t._scrollHandler.getScrollViewSizeInItem()):t.getData(t.backendApi,e[cS][uS],{height:e[cS][uS].qSize.qcy||1}),i.then(()=>t._destroyed?Promise.reject():t._updateColorData())})},isLassoDisabled(){const e=this.layout;return!!(e.qHyperCube.qDimensionInfo&&e.qHyperCube.qDimensionInfo.length>1&&vS(e,0))}}),xS={enabled:!0,delay:50};function wS(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}class qS{constructor({onSend:e}){this.options={},this.ongoingRequests=[],this.queuedRequests=[],this.recentRequests=[],this.resolvedRequests=[],this._debounceTimer=null,this._latestResolvedRequestedAt=-1,this.onSend=e,this.setOptions({})}destroy(){this.clear(),this.recentRequests=[],this.resolvedRequests=[],this.onSend=null,this.onCancel=null}setOptions(e){this.options=Lx(!0,{},xS,this.options,e),this.enabled=this.options.enabled||!1,this.delay=this.options.delay||-1}clear(){let e;for(clearTimeout(this._debounceTimer);this.queuedRequests.length;)e=this.queuedRequests.pop(),e.dfd.reject();for(;this.ongoingRequests.length;)e=this.ongoingRequests.pop(),e.dfd.reject()}queue(e){const t=this.enabled?this.delay:-1,n=Date.now(),r={data:e,dfd:wS(),wrapper:wS(),requestedAt:n},i=Math.max(this._getAvgResolutionTime(),t),o=t<1,s=this.recentRequests.length<1,a=s||n-this.recentRequests.slice(-1)[0].requestedAt>i,l=n>this._latestResolvedRequestedAt+t;return o||s||a||l?MS.apply(this,[r,0]):MS.apply(this,[r,Math.min(t,1e3)]),this.recentRequests.push(r),this.recentRequests.length>10&&(this.recentRequests=this.recentRequests.slice(-10)),r.dfd.promise}updateResolutionTime(){this._latestResolvedRequestedAt=Date.now()}_getAvgResolutionTime(){let e;return this.resolvedRequests.length&&(e=0,this.resolvedRequests.forEach(t=>{e+=t.respondedAt-t.sentAt}),e/=this.resolvedRequests.length),e}}function MS(e,t){const n=this;this.queuedRequests.push(e),clearTimeout(this._debounceTimer),t>=10?this._debounceTimer=setTimeout(()=>{SS.call(n)},t):SS.call(n)}function SS(){if(this.ongoingRequests.length)return void(this.waitingForResponse=!0);let e=this.queuedRequests.pop();for(e&&DS.call(this,e);this.queuedRequests.length;)e=this.queuedRequests.shift(),e.dfd.reject()}function DS(e){this.waitingForResponse=!1,this.ongoingRequests.push(e);const t=this,n=e.wrapper;e.sentAt=Date.now(),n.promise.then(function(...n){t.ongoingRequests.splice(t.ongoingRequests.indexOf(e),1),e.respondedAt=Date.now(),t.resolvedRequests.push({sentAt:e.sentAt,respondedAt:e.respondedAt,requestedAt:e.requestedAt}),t.resolvedRequests.length>10&&(t.resolvedRequests=t.resolvedRequests.slice(-10)),e.requestedAt>t._latestResolvedRequestedAt?e.dfd.resolve(...n):e.dfd.reject(),t._latestResolvedRequestedAt=e.requestedAt},function(...n){t.ongoingRequests.splice(t.ongoingRequests.indexOf(e),1),e.respondedAt=Date.now(),e.dfd.reject(...n)}).finally(()=>{t.waitingForResponse&&SS.call(t)}),this.onSend(e.data,n)}const _S=new $y(0,0,0,0),kS=new $y(0,0,0,0);class CS{constructor(){this.pages=[]}get(e){return e.map(e=>this.getPage(e))}getPage(e){const t=[];for(let n=0;n<this.pages.length;n++){const r=this.pages[n].qArea;_S.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),kS.set(r.qLeft,r.qTop,r.qWidth,r.qHeight);const i=kS.intersection(_S,!0);if(t.push({coverage:i?i.clone():new $y(0,0,0,0),idx:n}),r.qLeft<=e.qLeft&&r.qLeft+r.qWidth>=e.qLeft+e.qWidth&&r.qTop<=e.qTop&&r.qTop+r.qHeight>=e.qTop+e.qHeight)return this._extract(e,this.pages[n])}return t.sort((e,t)=>t.coverage.width*t.coverage.height-e.coverage.width*e.coverage.height),t[0].coverage.height>0&&t[0].coverage.width>0?this._extract(e,this.pages[t[0].idx]):{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qData:[]}}destroy(){this.clear()}isEmpty(){return!(this.pages&&this.pages[0]&&this.pages[0].qArea.qHeight&&this.pages[0].qArea.qWidth)}clear(){this.pages=[]}store(e){this.pages=e}containsArea(e){for(let t=0;t<this.pages.length;t++){const n=this.pages[t].qArea;if(n.qLeft<=e.qLeft&&n.qLeft+n.qWidth>=e.qLeft+e.qWidth&&n.qTop<=e.qTop&&n.qTop+n.qHeight>=e.qTop+e.qHeight)return!0}return!1}contains(e){return!(!this.pages||!this.pages.length)&&0===e.filter(e=>!this.containsArea(e)).length}_extract(e,t){_S.set(e.qLeft,e.qTop,e.qWidth,e.qHeight),kS.set(t.qArea.qLeft,t.qArea.qTop,t.qArea.qWidth,t.qArea.qHeight);const n=_S.intersection(kS,!0);if(!n)return{qArea:{qTop:e.qTop,qLeft:e.qLeft,qWidth:0,qHeight:0},qData:[]};const r=Math.max(0,e.qTop-t.qArea.qTop),i=t.qData[0],o=i.qSubNodes,s={};for(const e in i)i.hasOwnProperty(e)&&(s[e]="qSubNodes"===e?o.slice(r,r+n.height):i[e]);return s.qUp+=r,s.qDown+=t.qArea.qHeight-n.height-r,{qArea:{qTop:n.y,qLeft:n.x,qWidth:n.width,qHeight:n.height},qData:[s]}}}const ES={mode:"S",enabled:!0,debouncing:{enabled:!0,delay:50},height:250,width:250,maxTotalArea:1e4},AS=Vy.extend("CacheCube",{init(e,t,n,r){this.model=e,this.responseProperty=t,this.options={},this.cubeHeight=0,this.cubeWidth=0,this.setOptions(r||{}),this.setPath(n),"K"===this.options.mode?this.cube=new CS:"P"===this.options.mode?this.cube=new ev:this.cube=new Yy,this.throttle=new qS({onSend:(e,t)=>{const n=this._getDirections(this.throttle.recentRequests.map(e=>({top:e.data[0].qTop,left:e.data[0].qLeft}))),r=this._getAreasToCache(e,n.vertical,n.horizontal);this.cacheData(r,e).then(e=>{this.cube?t.resolve(e):t.reject()},()=>{t.reject()})}}),this._modelBinding=()=>{this.clear()},this.model.on("changed",this._modelBinding)},destroy(){this.cube.destroy(),this.throttle.destroy(),this.model&&this.model.removeListener&&this.model.removeListener("changed",this._modelBinding),this._modelBinding=null,delete this.model,delete this.throttle,delete this.cube},setMethodName(e){this.method=e},setPath(e){this.path=e},setCubeSize(e){this.cubeHeight=e.qcy,this.cubeWidth=e.qcx},setOptions(e){e&&(this.options=Lx(!0,{},ES,this.options,e),this.cacheHeight=this.options.height,this.cacheWidth=this.options.width,this.enabled=this.options.enabled||!1,this.debouncing={enabled:this.options.debouncing.enabled||!1,delay:this.options.debouncing.delay||-1})},clear(){this.cube&&this.cube.clear(),this.throttle&&this.throttle.clear()},set(e){this.clear(),e&&e.length&&this.cube.store(e)},cacheData(e,t){const n=function(e){return this.cube?(this.cube.store(e),this.cube.get(t)):e};return"getHyperCubeStackData"===this.method&&this.options.maxStackedValues?this.model[this.method](this.path,e,this.options.maxStackedValues).then(n.bind(this)):this.model[this.method](this.path,e).then(n.bind(this))},getData(e){if(!this.model)return Promise.reject();if(!this.enabled||!this.cubeHeight||!this.cubeWidth)return"getHyperCubeStackData"===this.method&&this.options.maxStackedValues?this.model[this.method](this.path,e,this.options.maxStackedValues):this.model[this.method](this.path,e);let t,n;const r=[];for(t=0;t<e.length;++t)n=e[t],r.push({qTop:Math.max(Math.floor(n.qTop),0),qLeft:Math.max(n.qLeft,0),qHeight:Math.min(n.qHeight,this.cubeHeight-Math.floor(n.qTop)),qWidth:Math.min(n.qWidth,this.cubeWidth-n.qLeft)});return this.cube.contains(r)?(this.throttle.updateResolutionTime(),Promise.resolve(this.cube.get(r))):0===r[0].qTop&&this.cube.isEmpty()&&this.throttle.ongoingRequests.length+this.throttle.queuedRequests.length===0?(this.throttle.updateResolutionTime(),this.cacheData(r,r)):this.throttle.queue(r)},_getDirections(e){if(!e||e.length<2)return{vertical:0,horizontal:0};const t=e.slice(-2),n=t[1].top-t[0].top,r=t[1].left-t[0].left;return{vertical:n<0?-1:n>0?1:0,horizontal:r<0?-1:r>0?1:0}},_getAreasToCache(e,t,n){let r,i,o,s,a,l,c,u,h;const d=[];let f=this.cacheHeight;for(void 0===t&&(t=0),void 0===n&&(n=0),this.cacheHeight*this.cacheWidth*e.length>this.options.maxTotalArea&&(f=Math.floor(this.options.maxTotalArea/(e.length*this.cacheWidth))),r=0;r<e.length;++r)i=0!==t?Math.floor(.5*Math.max(0,f-e[r].qHeight)):0,o=0!==n?Math.floor(.5*Math.max(0,this.cacheWidth-e[r].qWidth)):0,s=i*t-i,a=o*n-o,l=0!==t?Math.max(0,Math.min(Math.max(e[r].qHeight,f),this.cubeHeight)):e[r].qHeight,c=0!==n?Math.max(0,Math.min(Math.max(e[r].qWidth,this.cacheWidth),this.cubeWidth)):e[r].qWidth,u=Math.max(0,Math.min(e[r].qTop+s,this.cubeHeight-l)),h=Math.max(0,Math.min(e[r].qLeft+a,this.cubeWidth-c)),d.push({qTop:u,qHeight:l,qLeft:h,qWidth:c});return d}}),TS=ow.DATA_PATH,IS=ow.HYPERCUBE_DEF_PATH;class NS{constructor(e){this.model=e,this.path=`/${TS}/${IS}`,this.cacheCube=new AS(e,"qDataPages",this.path,{mode:"K"}),this.cacheCube.setMethodName("getHyperCubeStackData"),this.cacheCube.setOptions({maxStackedValues:ow.MAX_STACKED_VALUES})}setPath(e){this.path=e}setCacheOptions(e){this.cacheCube.setOptions(e)}updateCache(e){let t,n;"qHyperCube"===this.dataPath?t=e&&e.qHyperCube:(n=this.dataPath.slice(0,this.dataPath.indexOf("qHyperCube")-1),t=e&&e[n]&&e[n].qHyperCube),e.qSelectionInfo.qInSelections||this.cacheCube.setCubeSize({qcx:t.qSize.qcx,qcy:nS.getStackedCubeSizeOfMax2Dims(e,n)}),this.backendStackThrottle.clear()}getData(e,t){const n=this.cacheCube;return t?this.model.getHyperCubeData(t,e):this.cacheCube.getData(e).then(e=>(e[0]&&e[0].qData[0]&&e[0].qData[0].qSubNodes.some(e=>e.qDown>0)&&n.clear(),e))}}return function(t){return function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(l).forEach(t=>{e.add(l[t])})}}(t.translator),{qae:Ox(t),ext:Jw(t),component(){const n=e.useElement(),r=function(){const t=e.useApp(),n=e.useAppLayout(),r=e.useDeviceType(),i=e.useOptions(),o=e.useTheme(),s=e.useTranslator();return e.useMemo(()=>({app:t,appLayout:n,deviceType:r,options:i,theme:o,translator:s}),[t,n,i.direction,i.freeResize,s.language(),o.name(),r])}(),i=r.options.renderer,o=e.useMemo(()=>xg(i),[i]),s=e.useSelections(),l=e.useStaleLayout(),c=e.useModel(),u=e.useConstraints(),h=function(){const t=e.useConstraints(),[n,r]=e.useState(!1),[i,o]=e.useState(!1),s=!!e.useLayout().qSelectionInfo.qInSelections,[a]=e.useState(()=>({toggle(){o(e=>!e)}}));return e.useEffect(()=>{t&&r(!t.select&&!t.active)},[t]),e.useAction(()=>({key:"lasso",label:"Lasso",icon:wg,hidden:!n||!s,active:i,action(){o(e=>!e)}}),[s,i,n]),a.enabled=()=>n,a.active=()=>i,a}(),d=e.useRenderState(),[f,p]=e.useState();e.useEffect(()=>{const e=a(n),i=function(e,t){return t.snapshotData?new nv(t,"qUndoExclude.qHyperCube","qStackedDataPages"):new NS(e)}(c,l),u=s,d=new bS({environment:r,lasso:h,flags:t.flags,picasso:o,$element:e,backendApi:i,selectionsApi:u});return p(d),()=>{d.destroy()}},[]);const[,m]=e.usePromise(async()=>{if(!f)return;f.updateEnvironment(r),f.updateConstraints(u);if(!!!l.snapshotData){const e=await c.getEffectiveProperties();if(await f.updateDerivedProperties(e,l))return void d.pending();d.restore()}await f.updateData(l),await f.paint()},[l,f,r]);if(m)throw m;var g;!function(t){const n=e.useRect(),r=e.useOptions(),i=e.useConstraints(),[,o]=e.usePromise(async()=>{t&&(t.updateConstraints(i),t.options=r,await t.resize())},[n.width,n.height]);if(o)throw o}(f),g=f,e.onTakeSnapshot(e=>{if(g)return g.setSnapshotData(e)}),e.useImperativeHandle(()=>({getViewState(){if(g)return g.getViewState()}}),[g])}}}});
|
|
29
29
|
//# sourceMappingURL=sn-distplot.js.map
|