@nebula.js/sn-pie-chart 1.20.9 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-specifications/plugins.json +1 -1
- package/api-specifications/properties.json +1 -1
- package/core/esm/index.js +4 -4
- package/dist/sn-pie-chart.js +4 -4
- package/dist/sn-pie-chart.systemjs.js +2 -2
- package/package.json +1 -1
- package/sn-pie-chart-ext/dist/sn-pie-chart.js +4 -4
- package/sn-pie-chart-ext/sn-pie-chart.qext +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/sn-pie-chart v1.
|
|
2
|
+
* @nebula.js/sn-pie-chart v1.21.0
|
|
3
3
|
* Copyright (c) 2022 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* http://hammerjs.github.io/
|
|
10
10
|
*
|
|
11
11
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
12
|
-
* Licensed under the MIT license */!function(e){!function(t,n,r,i){var o,a=["","webkit","Moz","MS","ms","o"],s=n.createElement("div"),l=Math.round,u=Math.abs,c=Date.now;function d(e,t,n){return setTimeout(y(e,n),t)}function f(e,t,n){return!!Array.isArray(e)&&(p(e,n[t],n),!0)}function p(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 h(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=h((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=h((function(e,t){return m(e,t,!0)}),"merge","Use `assign`.");function v(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&o(r,n)}function y(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){p(E(t),(function(t){e.addEventListener(t,n,!1)}))}function k(e,t,n){p(E(t),(function(t){e.removeEventListener(t,n,!1)}))}function C(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function S(e,t){return e.indexOf(t)>-1}function E(e){return e.trim().split(/\s+/g)}function M(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 T(e){return Array.prototype.slice.call(e,0)}function D(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var a=t?e[o][t]:e[o];M(i,a)<0&&r.push(e[o]),i[o]=a,o++}return n&&(r=t?r.sort((function(e,n){return e[t]>n[t]})):r.sort()),r}function _(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),s=0;s<a.length;){if((r=(n=a[s])?n+o:t)in e)return r;s++}return i}var N=1;function q(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var R="ontouchstart"in t,P=_(t,"PointerEvent")!==i,A=R&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),I="touch",O="mouse",L=24,z=["x","y"],F=["clientX","clientY"];function j(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,a=1&t&&r-o==0,s=12&t&&r-o==0;n.isFirst=!!a,n.isFinal=!!s,a&&(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 a=n.firstInput,s=n.firstMultiple,l=s?s.center:a.center,d=t.center=V(r);t.timeStamp=c(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=Y(l,d),t.distance=$(l,d),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=U(t.deltaX,t.deltaY);var f=W(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=f.x,t.overallVelocityY=f.y,t.overallVelocity=u(f.x)>u(f.y)?f.x:f.y,t.scale=s?function(e,t){return $(t[0],t[1],F)/$(e[0],e[1],F)}(s.pointers,r):1,t.rotation=s?function(e,t){return Y(t[1],t[0],F)+Y(e[1],e[0],F)}(s.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,a,s=e.lastInterval||t,l=t.timeStamp-s.timeStamp;if(8!=t.eventType&&(l>25||s.velocity===i)){var c=t.deltaX-s.deltaX,d=t.deltaY-s.deltaY,f=W(l,c,d);r=f.x,o=f.y,n=u(f.x)>u(f.y)?f.x:f.y,a=U(c,d),e.lastInterval=t}else n=s.velocity,r=s.velocityX,o=s.velocityY,a=s.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=a}(n,t);var p=e.element;C(t.srcEvent.target,p)&&(p=t.srcEvent.target);t.target=p}(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:c(),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 W(e,t,n){return{x:t/e||0,y:n/e||0}}function U(e,t){return e===t?1:u(e)>=u(t)?e<0?2:4:t<0?8:16}function $(e,t,n){n||(n=z);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=z);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}j.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(q(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&k(this.element,this.evEl,this.domHandler),this.evTarget&&k(this.target,this.evTarget,this.domHandler),this.evWin&&k(q(this.element),this.evWin,this.domHandler)}};var X={mousedown:1,mousemove:2,mouseup:4},K="mousedown",G="mousemove mouseup";function J(){this.evEl=K,this.evWin=G,this.pressed=!1,j.apply(this,arguments)}v(J,j,{handler:function(e){var t=X[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:O,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Q={2:I,3:"pen",4:O,5:"kinect"},ee="pointerdown",te="pointermove pointerup pointercancel";function ne(){this.evEl=ee,this.evWin=te,j.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),v(ne,j,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=Z[r],o=Q[e.pointerType]||e.pointerType,a=o==I,s=M(t,e.pointerId,"pointerId");1&i&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):12&i&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var re={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ie="touchstart",oe="touchstart touchmove touchend touchcancel";function ae(){this.evTarget=ie,this.evWin=oe,this.started=!1,j.apply(this,arguments)}function se(e,t){var n=T(e.touches),r=T(e.changedTouches);return 12&t&&(n=D(n.concat(r),"identifier",!0)),[n,r]}v(ae,j,{handler:function(e){var t=re[e.type];if(1===t&&(this.started=!0),this.started){var n=se.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:I,srcEvent:e})}}});var le={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ue="touchstart touchmove touchend touchcancel";function ce(){this.evTarget=ue,this.targetIds={},j.apply(this,arguments)}function de(e,t){var n=T(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=T(e.changedTouches),s=[],l=this.target;if(o=n.filter((function(e){return C(e.target,l)})),1===t)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<a.length;)r[a[i].identifier]&&s.push(a[i]),12&t&&delete r[a[i].identifier],i++;return s.length?[D(o.concat(s),"identifier",!0),s]:void 0}v(ce,j,{handler:function(e){var t=le[e.type],n=de.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}});function fe(){j.apply(this,arguments);var e=y(this.handler,this);this.touch=new ce(this.manager,e),this.mouse=new J(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function pe(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,he.call(this,t)):12&e&&he.call(this,t)}function he(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 me(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),a=Math.abs(n-i.y);if(o<=25&&a<=25)return!0}return!1}v(fe,j,{handler:function(e,t,n){var r=n.pointerType==I,i=n.pointerType==O;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)pe.call(this,t,n);else if(i&&me.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ge=_(s.style,"touchAction"),ve=ge!==i,ye="compute",be="auto",xe="manipulation",we="none",ke="pan-x",Ce="pan-y",Se=function(){if(!ve)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 Ee(e,t){this.manager=e,this.set(t)}Ee.prototype={set:function(e){e==ye&&(e=this.compute()),ve&&this.manager.element.style&&Se[e]&&(this.manager.element.style[ge]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return p(this.manager.recognizers,(function(t){b(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(S(e,we))return we;var t=S(e,ke),n=S(e,Ce);if(t&&n)return we;if(t||n)return t?ke:Ce;if(S(e,xe))return xe;return be}(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,we)&&!Se.none,o=S(r,Ce)&&!Se["pan-y"],a=S(r,ke)&&!Se["pan-x"];if(i){var s=1===e.pointers.length,l=e.distance<2,u=e.deltaTime<250;if(s&&l&&u)return}if(!a||!o)return i||o&&6&n||a&&n&L?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Me=32;function Te(e){this.options=o({},this.defaults,e||{}),this.id=N++,this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function De(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function _e(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Ne(e,t){var n=t.manager;return n?n.get(e):e}function qe(){Te.apply(this,arguments)}function Re(){qe.apply(this,arguments),this.pX=null,this.pY=null}function Pe(){qe.apply(this,arguments)}function Ae(){Te.apply(this,arguments),this._timer=null,this._input=null}function Ie(){qe.apply(this,arguments)}function Oe(){qe.apply(this,arguments)}function Le(){Te.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ze(e,t){return(t=t||{}).recognizers=x(t.recognizers,ze.defaults.preset),new Fe(e,t)}Te.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(f(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Ne(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return f(e,"dropRecognizeWith",this)||(e=Ne(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(f(e,"requireFailure",this))return this;var t=this.requireFail;return-1===M(t,e=Ne(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(f(e,"dropRequireFailure",this))return this;e=Ne(e,this);var t=M(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+De(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+De(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Me},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=Me);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},v(qe,Te,{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:Me}}),v(Re,qe,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(Ce),e&L&&t.push(ke),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,a=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===a?1:a<0?8:16,n=a!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return qe.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=_e(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),v(Pe,qe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[we]},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)}}),v(Ae,Te,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[be]},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=d((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return Me},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=c(),this.manager.emit(this.options.event,this._input)))}}),v(Ie,qe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[we]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),v(Oe,qe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Re.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&&u(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=_e(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),v(Le,Te,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[xe]},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,a=!this.pCenter||$(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=d((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return Me},failTimeout:function(){return this._timer=d((function(){this.state=Me}),this.options.interval,this),Me},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ze.VERSION="2.0.7",ze.defaults={domEvents:!1,touchAction:ye,enable:!0,inputTarget:null,inputClass:null,preset:[[Ie,{enable:!1}],[Pe,{enable:!1},["rotate"]],[Oe,{direction:6}],[Re,{direction:6},["swipe"]],[Le],[Le,{event:"doubletap",taps:2},["tap"]],[Ae]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Fe(e,t){var n;this.options=o({},ze.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||(P?ne:A?ce:R?fe:J))(n,H),this.touchAction=new Ee(this,this.options.touchAction),je(this,!0),p(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 je(e,t){var n,r=e.element;r.style&&(p(e.options.cssProps,(function(i,o){n=_(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}Fe.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 Te)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(f(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(f(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=M(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 p(E(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==i){var n=this.handlers;return p(E(e),(function(e){t?n[e]&&n[e].splice(M(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&&je(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(ze,{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:Me,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:Fe,Input:j,TouchAction:Ee,TouchInput:ce,MouseInput:J,PointerEventInput:ne,TouchMouseInput:fe,SingleTouchInput:ae,Recognizer:Te,AttrRecognizer:qe,Tap:Le,Pan:Re,Swipe:Oe,Pinch:Pe,Rotate:Ie,Press:Ae,on:w,off:k,each:p,merge:g,extend:m,assign:o,inherit:v,bindFn:y,prefixed:_}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=ze,e.exports?e.exports=ze:t.Hammer=ze}(window,document)}(i);var o=i.exports,a={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},s=/([astvzqmhlc])([^astvzqmhlc]*)/gi,l=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;var u=function(e){var t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(s,(function(e,n,r){var i=n.toLowerCase(),o=function(e){var t=e.match(l);return t?t.map(Number):[]}(r),s=n;if("m"===i&&o.length>2&&(t.push([s].concat(o.splice(0,2))),i="l",s="m"===s?"l":"L"),o.length<a[i])return"";for(t.push([s].concat(o.splice(0,a[i])));o.length>=a[i]&&o.length&&a[i];)t.push([s].concat(o.splice(0,a[i])));return""})),t};function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e){return function(e){if(Array.isArray(e))return f(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)return;if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(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 f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var p=u;function h(e,t){var n=e.x*Math.cos(t)-e.y*Math.sin(t),r=e.y*Math.cos(t)+e.x*Math.sin(t);e.x=n,e.y=r}function m(e,t,n){e.x+=t,e.y+=n}function g(e,t){e.x*=t,e.y*=t}var v=u,y=function(e){if(void 0!==e&&e.CanvasRenderingContext2D&&(!e.Path2D||!function(e){var t=e.document.createElement("canvas").getContext("2d"),n=new e.Path2D("M0 0 L1 1");return t.strokeStyle="red",t.lineWidth=1,t.stroke(n),255===t.getImageData(0,0,1,1).data[0]}(e))){var t=function(){function e(t){var n;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.segments=[],t&&t instanceof e)?(n=this.segments).push.apply(n,d(t.segments)):t&&(this.segments=p(t))}var t,n,r;return t=e,(n=[{key:"addPath",value:function(t){var n;t&&t instanceof e&&(n=this.segments).push.apply(n,d(t.segments))}},{key:"moveTo",value:function(e,t){this.segments.push(["M",e,t])}},{key:"lineTo",value:function(e,t){this.segments.push(["L",e,t])}},{key:"arc",value:function(e,t,n,r,i,o){this.segments.push(["AC",e,t,n,r,i,!!o])}},{key:"arcTo",value:function(e,t,n,r,i){this.segments.push(["AT",e,t,n,r,i])}},{key:"ellipse",value:function(e,t,n,r,i,o,a,s){this.segments.push(["E",e,t,n,r,i,o,a,!!s])}},{key:"closePath",value:function(){this.segments.push(["Z"])}},{key:"bezierCurveTo",value:function(e,t,n,r,i,o){this.segments.push(["C",e,t,n,r,i,o])}},{key:"quadraticCurveTo",value:function(e,t,n,r){this.segments.push(["Q",e,t,n,r])}},{key:"rect",value:function(e,t,n,r){this.segments.push(["R",e,t,n,r])}}])&&c(t.prototype,n),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),n=e.CanvasRenderingContext2D.prototype.fill,r=e.CanvasRenderingContext2D.prototype.stroke;e.CanvasRenderingContext2D.prototype.fill=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i="nonzero";if(0===t.length||1===t.length&&"string"==typeof t[0])n.apply(this,t);else{2===arguments.length&&(i=t[1]);var a=t[0];o(this,a.segments),n.call(this,i)}},e.CanvasRenderingContext2D.prototype.stroke=function(e){e?(o(this,e.segments),r.call(this)):r.call(this)};var i=e.CanvasRenderingContext2D.prototype.isPointInPath;e.CanvasRenderingContext2D.prototype.isPointInPath=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if("Path2D"===t[0].constructor.name){var r=t[1],a=t[2],s=t[3]||"nonzero",l=t[0];return o(this,l.segments),i.apply(this,[r,a,s])}return i.apply(this,t)},e.Path2D=t}function o(e,t){var n,r,i,o,a,s,l,u,c,d,f,p,v,y,b,x,w,k,C,S,E,M,T,D,_,N,q={x:0,y:0},R={x:0,y:0};e.beginPath();for(var P=0;P<t.length;++P){var A=t[P];switch("S"!==(S=A[0])&&"s"!==S&&"C"!==S&&"c"!==S&&(M=null,T=null),"T"!==S&&"t"!==S&&"Q"!==S&&"q"!==S&&(D=null,_=null),S){case"m":case"M":"m"===S?(f+=A[1],v+=A[2]):(f=A[1],v=A[2]),"M"!==S&&q||(q={x:f,y:v}),e.moveTo(f,v);break;case"l":f+=A[1],v+=A[2],e.lineTo(f,v);break;case"L":f=A[1],v=A[2],e.lineTo(f,v);break;case"H":f=A[1],e.lineTo(f,v);break;case"h":f+=A[1],e.lineTo(f,v);break;case"V":v=A[1],e.lineTo(f,v);break;case"v":v+=A[1],e.lineTo(f,v);break;case"a":case"A":"a"===S?(f+=A[6],v+=A[7]):(f=A[6],v=A[7]),x=A[1],w=A[2],l=A[3]*Math.PI/180,i=!!A[4],o=!!A[5],a={x:f,y:v},h(s={x:(R.x-a.x)/2,y:(R.y-a.y)/2},-l),(u=s.x*s.x/(x*x)+s.y*s.y/(w*w))>1&&(x*=u=Math.sqrt(u),w*=u),c=x*x*w*w,d=x*x*s.y*s.y+w*w*s.x*s.x,g(E={x:x*s.y/w,y:-w*s.x/x},o!==i?Math.sqrt((c-d)/d)||0:-Math.sqrt((c-d)/d)||0),r=Math.atan2((s.y-E.y)/w,(s.x-E.x)/x),n=Math.atan2(-(s.y+E.y)/w,-(s.x+E.x)/x),h(E,l),m(E,(a.x+R.x)/2,(a.y+R.y)/2),e.save(),e.translate(E.x,E.y),e.rotate(l),e.scale(x,w),e.arc(0,0,1,r,n,!o),e.restore();break;case"C":M=A[3],T=A[4],f=A[5],v=A[6],e.bezierCurveTo(A[1],A[2],M,T,f,v);break;case"c":e.bezierCurveTo(A[1]+f,A[2]+v,A[3]+f,A[4]+v,A[5]+f,A[6]+v),M=A[3]+f,T=A[4]+v,f+=A[5],v+=A[6];break;case"S":null!==M&&null!==T||(M=f,T=v),e.bezierCurveTo(2*f-M,2*v-T,A[1],A[2],A[3],A[4]),M=A[1],T=A[2],f=A[3],v=A[4];break;case"s":null!==M&&null!==T||(M=f,T=v),e.bezierCurveTo(2*f-M,2*v-T,A[1]+f,A[2]+v,A[3]+f,A[4]+v),M=A[1]+f,T=A[2]+v,f+=A[3],v+=A[4];break;case"Q":D=A[1],_=A[2],f=A[3],v=A[4],e.quadraticCurveTo(D,_,f,v);break;case"q":D=A[1]+f,_=A[2]+v,f+=A[3],v+=A[4],e.quadraticCurveTo(D,_,f,v);break;case"T":null!==D&&null!==_||(D=f,_=v),D=2*f-D,_=2*v-_,f=A[1],v=A[2],e.quadraticCurveTo(D,_,f,v);break;case"t":null!==D&&null!==_||(D=f,_=v),D=2*f-D,_=2*v-_,f+=A[1],v+=A[2],e.quadraticCurveTo(D,_,f,v);break;case"z":case"Z":f=q.x,v=q.y,q=void 0,e.closePath();break;case"AC":f=A[1],v=A[2],b=A[3],r=A[4],n=A[5],N=A[6],e.arc(f,v,b,r,n,N);break;case"AT":p=A[1],y=A[2],f=A[3],v=A[4],b=A[5],e.arcTo(p,y,f,v,b);break;case"E":f=A[1],v=A[2],x=A[3],w=A[4],l=A[5],r=A[6],n=A[7],N=A[8],e.save(),e.translate(f,v),e.rotate(l),e.scale(x,w),e.arc(0,0,1,r,n,N),e.restore();break;case"R":f=A[1],v=A[2],k=A[3],C=A[4],q={x:f,y:v},e.rect(f,v,k,C)}R.x=f,R.y=v}}};"undefined"!=typeof window&&y(window);var b={path2dPolyfill:y,parsePath:v},x=Object.prototype.hasOwnProperty,w=Object.prototype.toString,k=Object.defineProperty,C=Object.getOwnPropertyDescriptor,S=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===w.call(e)},E=function(e){if(!e||"[object Object]"!==w.call(e))return!1;var t,n=x.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&x.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||x.call(e,t)},M=function(e,t){k&&"__proto__"===t.name?k(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},T=function(e,t){if("__proto__"===t){if(!x.call(e,t))return;if(C)return C(e,t).value}return e[t]},D=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=T(s,n),s!==(i=T(t,n))&&(c&&i&&(E(i)||(o=S(i)))?(o?(o=!1,a=r&&S(r)?r:[]):a=r&&E(r)?r:{},M(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&M(s,{name:n,newValue:i}));return s},_="1.9.7";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 q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function I(e,t,n){return t&&A(e.prototype,t),n&&A(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&F(e,t)}function z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function F(e,t){return(F=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function j(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function H(e,t,n){return(H=j()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&F(i,n.prototype),i}).apply(null,arguments)}function B(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return B(e)}function W(e){var t=j();return function(){var n,r=z(e);if(t){var i=z(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return V(this,n)}}function U(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=z(e)););return e}function $(){return($="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=U(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}}).apply(this,arguments)}function Y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||K(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function X(e){return function(e){if(Array.isArray(e))return G(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||K(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 K(e,t){if(e){if("string"==typeof e)return G(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)?G(e,t):void 0}}function G(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 J(e){return!!e.changedTouches}function Z(e){return"number"==typeof e&&!isNaN(e)}function Q(e){return"number"!=typeof e||isNaN(e)}function ee(e){for(var t=e.length,n=NaN,r=NaN,i=NaN,o=NaN,a=0;a<t;a++)n=isNaN(n)?e[a].x:Math.min(n,e[a].x),r=isNaN(r)?e[a].x:Math.max(r,e[a].x),i=isNaN(i)?e[a].y:Math.min(i,e[a].y),o=isNaN(o)?e[a].y:Math.max(o,e[a].y);return[n,i,r,o]}function te(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function ne(e){return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}]}function re(e){var t=Y(ee(e),4),n=t[0],r=t[1];return{x:n,y:r,width:t[2]-n,height:t[3]-r}}function ie(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function oe(e){var t=e||{},n=t.x,r=t.y,i=t.width,o=t.height,a=t.x1,s=t.x2,l=t.y1,u=t.y2,c=t.cx,d=t.cy,f=t.r,p=t.vertices;return Z(c)&&Z(d)&&Z(f)?"circle":Z(a)&&Z(s)&&Z(l)&&Z(u)?"line":Z(n)&&Z(r)&&Z(i)&&Z(o)?"rect":Z(n)&&Z(r)?"point":Array.isArray(p)?p.every((function(e){return Array.isArray(e)}))?"geopolygon":"polygon":null}function ae(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}function se(e,t){var n=t.types,r=t.logger,i={},o=[];Array.isArray(e)?o.push.apply(o,X(e)):(r.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach((function(e,t){var o=n(e.type);if(o){var a=e.key;void 0===e.key&&(r.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),a=t);var s=o({key:a,data:e.data,config:e.config});i[a]=s}}));return function(e){return e?i[e]:i[Object.keys(i)[0]]}}var le=Math.PI,ue=2*le,ce=1e-6,de=ue-ce;function fe(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function pe(){return new fe}function he(e){return function(){return e}}fe.prototype=pe.prototype={constructor:fe,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,s=n-e,l=r-t,u=o-e,c=a-t,d=u*u+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>ce)if(Math.abs(c*s-l*u)>ce&&i){var f=n-o,p=r-a,h=s*s+l*l,m=f*f+p*p,g=Math.sqrt(h),v=Math.sqrt(d),y=i*Math.tan((le-Math.acos((h+d-m)/(2*g*v)))/2),b=y/v,x=y/g;Math.abs(b-1)>ce&&(this._+="L"+(e+b*u)+","+(t+b*c)),this._+="A"+i+","+i+",0,0,"+ +(c*f>u*p)+","+(this._x1=e+x*s)+","+(this._y1=t+x*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,r,i,o){e=+e,t=+t,o=!!o;var a=(n=+n)*Math.cos(r),s=n*Math.sin(r),l=e+a,u=t+s,c=1^o,d=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+u:(Math.abs(this._x1-l)>ce||Math.abs(this._y1-u)>ce)&&(this._+="L"+l+","+u),n&&(d<0&&(d=d%ue+ue),d>de?this._+="A"+n+","+n+",0,1,"+c+","+(e-a)+","+(t-s)+"A"+n+","+n+",0,1,"+c+","+(this._x1=l)+","+(this._y1=u):d>ce&&(this._+="A"+n+","+n+",0,"+ +(d>=le)+","+c+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var me=Math.abs,ge=Math.atan2,ve=Math.cos,ye=Math.max,be=Math.min,xe=Math.sin,we=Math.sqrt,ke=1e-12,Ce=Math.PI,Se=Ce/2,Ee=2*Ce;function Me(e){return e>1?0:e<-1?Ce:Math.acos(e)}function Te(e){return e>=1?Se:e<=-1?-Se:Math.asin(e)}function De(e){return e.innerRadius}function _e(e){return e.outerRadius}function Ne(e){return e.startAngle}function qe(e){return e.endAngle}function Re(e){return e&&e.padAngle}function Pe(e,t,n,r,i,o,a,s){var l=n-e,u=r-t,c=a-i,d=s-o,f=d*l-c*u;if(!(f*f<ke))return[e+(f=(c*(t-o)-d*(e-i))/f)*l,t+f*u]}function Ae(e,t,n,r,i,o,a){var s=e-n,l=t-r,u=(a?o:-o)/we(s*s+l*l),c=u*l,d=-u*s,f=e+c,p=t+d,h=n+c,m=r+d,g=(f+h)/2,v=(p+m)/2,y=h-f,b=m-p,x=y*y+b*b,w=i-o,k=f*m-h*p,C=(b<0?-1:1)*we(ye(0,w*w*x-k*k)),S=(k*b-y*C)/x,E=(-k*y-b*C)/x,M=(k*b+y*C)/x,T=(-k*y+b*C)/x,D=S-g,_=E-v,N=M-g,q=T-v;return D*D+_*_>N*N+q*q&&(S=M,E=T),{cx:S,cy:E,x01:-c,y01:-d,x11:S*(i/w-1),y11:E*(i/w-1)}}function Ie(){var e=De,t=_e,n=he(0),r=null,i=Ne,o=qe,a=Re,s=null;function l(){var l,u,c=+e.apply(this,arguments),d=+t.apply(this,arguments),f=i.apply(this,arguments)-Se,p=o.apply(this,arguments)-Se,h=me(p-f),m=p>f;if(s||(s=l=pe()),d<c&&(u=d,d=c,c=u),d>ke)if(h>Ee-ke)s.moveTo(d*ve(f),d*xe(f)),s.arc(0,0,d,f,p,!m),c>ke&&(s.moveTo(c*ve(p),c*xe(p)),s.arc(0,0,c,p,f,m));else{var g,v,y=f,b=p,x=f,w=p,k=h,C=h,S=a.apply(this,arguments)/2,E=S>ke&&(r?+r.apply(this,arguments):we(c*c+d*d)),M=be(me(d-c)/2,+n.apply(this,arguments)),T=M,D=M;if(E>ke){var _=Te(E/c*xe(S)),N=Te(E/d*xe(S));(k-=2*_)>ke?(x+=_*=m?1:-1,w-=_):(k=0,x=w=(f+p)/2),(C-=2*N)>ke?(y+=N*=m?1:-1,b-=N):(C=0,y=b=(f+p)/2)}var q=d*ve(y),R=d*xe(y),P=c*ve(w),A=c*xe(w);if(M>ke){var I,O=d*ve(b),L=d*xe(b),z=c*ve(x),F=c*xe(x);if(h<Ce&&(I=Pe(q,R,z,F,O,L,P,A))){var j=q-I[0],H=R-I[1],B=O-I[0],V=L-I[1],W=1/xe(Me((j*B+H*V)/(we(j*j+H*H)*we(B*B+V*V)))/2),U=we(I[0]*I[0]+I[1]*I[1]);T=be(M,(c-U)/(W-1)),D=be(M,(d-U)/(W+1))}}C>ke?D>ke?(g=Ae(z,F,q,R,d,D,m),v=Ae(O,L,P,A,d,D,m),s.moveTo(g.cx+g.x01,g.cy+g.y01),D<M?s.arc(g.cx,g.cy,D,ge(g.y01,g.x01),ge(v.y01,v.x01),!m):(s.arc(g.cx,g.cy,D,ge(g.y01,g.x01),ge(g.y11,g.x11),!m),s.arc(0,0,d,ge(g.cy+g.y11,g.cx+g.x11),ge(v.cy+v.y11,v.cx+v.x11),!m),s.arc(v.cx,v.cy,D,ge(v.y11,v.x11),ge(v.y01,v.x01),!m))):(s.moveTo(q,R),s.arc(0,0,d,y,b,!m)):s.moveTo(q,R),c>ke&&k>ke?T>ke?(g=Ae(P,A,O,L,c,-T,m),v=Ae(q,R,z,F,c,-T,m),s.lineTo(g.cx+g.x01,g.cy+g.y01),T<M?s.arc(g.cx,g.cy,T,ge(g.y01,g.x01),ge(v.y01,v.x01),!m):(s.arc(g.cx,g.cy,T,ge(g.y01,g.x01),ge(g.y11,g.x11),!m),s.arc(0,0,c,ge(g.cy+g.y11,g.cx+g.x11),ge(v.cy+v.y11,v.cx+v.x11),m),s.arc(v.cx,v.cy,T,ge(v.y11,v.x11),ge(v.y01,v.x01),!m))):s.arc(0,0,c,w,x,m):s.lineTo(P,A)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Ce/2;return[ve(r)*n,xe(r)*n]},l.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:he(+t),l):e},l.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:he(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:he(+e),l):n},l.padRadius=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:he(+e),l):r},l.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:he(+e),l):i},l.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:he(+e),l):o},l.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:he(+e),l):a},l.context=function(e){return arguments.length?(s=null==e?null:e,l):s},l}function Oe(e){this._context=e}function Le(e){return new Oe(e)}function ze(e){return e[0]}function Fe(e){return e[1]}function je(){var e=ze,t=null,n=he(0),r=Fe,i=he(!0),o=null,a=Le,s=null;function l(l){var u,c,d,f,p,h=l.length,m=!1,g=new Array(h),v=new Array(h);for(null==o&&(s=a(p=pe())),u=0;u<=h;++u){if(!(u<h&&i(f=l[u],u,l))===m)if(m=!m)c=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=u-1;d>=c;--d)s.point(g[d],v[d]);s.lineEnd(),s.areaEnd()}m&&(g[u]=+e(f,u,l),v[u]=+n(f,u,l),s.point(t?+t(f,u,l):g[u],r?+r(f,u,l):v[u]))}if(p)return s=null,p+""||null}function u(){return function(){var e=ze,t=Fe,n=he(!0),r=null,i=Le,o=null;function a(a){var s,l,u,c=a.length,d=!1;for(null==r&&(o=i(u=pe())),s=0;s<=c;++s)!(s<c&&n(l=a[s],s,a))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(l,s,a),+t(l,s,a));if(u)return o=null,u+""||null}return a.x=function(t){return arguments.length?(e="function"==typeof t?t:he(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:he(+e),a):t},a.defined=function(e){return arguments.length?(n="function"==typeof e?e:he(!!e),a):n},a.curve=function(e){return arguments.length?(i=e,null!=r&&(o=i(r)),a):i},a.context=function(e){return arguments.length?(null==e?r=o=null:o=i(r=e),a):r},a}().defined(i).curve(a).context(o)}return l.x=function(n){return arguments.length?(e="function"==typeof n?n:he(+n),t=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:he(+t),l):e},l.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:he(+e),l):t},l.y=function(e){return arguments.length?(n="function"==typeof e?e:he(+e),r=null,l):n},l.y0=function(e){return arguments.length?(n="function"==typeof e?e:he(+e),l):n},l.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:he(+e),l):r},l.lineX0=l.lineY0=function(){return u().x(e).y(n)},l.lineY1=function(){return u().x(e).y(r)},l.lineX1=function(){return u().x(t).y(n)},l.defined=function(e){return arguments.length?(i="function"==typeof e?e:he(!!e),l):i},l.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),l):a},l.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),l):o},l}function He(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function Be(e){return e}Oe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var Ve=Array.prototype.slice;function We(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Ue(e){this._context=e}function $e(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Ye(e,t){this._context=e,this._k=(1-t)/6}Ue.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:We(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:We(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},Ye.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:$e(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:$e(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Xe=function e(t){function n(e){return new Ye(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Ke(e,t){this._context=e,this._alpha=t}Ke.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>ke){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>ke){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*u+e._x1*e._l23_2a-t*e._l12_2a)/c,a=(a*u+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Ge=function e(t){function n(e){return t?new Ke(e,t):new Ye(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Je(e){return e<0?-1:1}function Ze(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(Je(o)+Je(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Qe(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function et(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function tt(e){this._context=e}function nt(e){this._context=new rt(e)}function rt(e){this._context=e}function it(e){this._context=e}function ot(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/o[t-1],o[t]-=n,a[t]-=n*a[t-1];for(i[r-1]=a[r-1]/o[r-1],t=r-2;t>=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function at(e,t){this._context=e,this._t=t}function st(e,t){if((i=e.length)>1)for(var n,r,i,o=1,a=e[t[0]],s=a.length;o<i;++o)for(r=a,a=e[t[o]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function lt(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function ut(e,t){return e[t]}function ct(e){for(var t,n=-1,r=0,i=e.length,o=-1/0;++n<i;)(t=+e[n][1])>o&&(o=t,r=n);return r}function dt(e){for(var t,n=0,r=-1,i=e.length;++r<i;)(t=+e[r][1])&&(n+=t);return n}function ft(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",r=arguments.length>2?arguments[2]:void 0,i={},o=e||{get:function(){},has:function(){return!1},default:function(){}};function a(e,t){if(!e||"string"!=typeof e)throw new TypeError("Invalid argument: key must be a non-empty string");return!(e in i)&&(i[e]=t,!0)}function s(e){return i[e]||o.get(e)}function l(e){return!!i[e]||o.has(e)}function u(e){var t=i[e];return delete i[e],t}function c(){return Object.keys(i)}function d(){return Object.keys(i).map((function(e){return i[e]}))}function f(e){return void 0!==e&&(t=e),t}function p(e,i){if(void 0!==i)return a(e,i);var o=s(e);return r&&void 0===o&&r.warn("".concat(e," does not exist in ").concat(n," registry")),o||s(t)}return t=o.default(),p.add=a,p.get=s,p.has=l,p.remove=u,p.getKeys=c,p.getValues=d,p.default=f,p.register=a,p}function pt(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function ht(e){return(e=pt(Math.abs(e)))?e[1]:NaN}tt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:et(this,this._t0,Qe(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,et(this,Qe(this,n=Ze(this,e,t)),n);break;default:et(this,this._t0,n=Ze(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(nt.prototype=Object.create(tt.prototype)).point=function(e,t){tt.prototype.point.call(this,t,e)},rt.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}},it.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=ot(e),i=ot(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[a],t[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},at.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var mt,gt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function vt(e){if(!(t=gt.exec(e)))throw new Error("invalid format: "+e);var t;return new yt({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function yt(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function bt(e,t){var n=pt(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}vt.prototype=yt.prototype,yt.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var xt={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return bt(100*e,t)},r:bt,s:function(e,t){var n=pt(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(mt=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+pt(e,Math.max(0,t+o-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function wt(e){return e}var kt,Ct,St,Et=Array.prototype.map,Mt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Tt(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?wt:(t=Et.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?wt:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(Et.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",u=void 0===e.minus?"-":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=vt(e)).fill,n=e.align,d=e.sign,f=e.symbol,p=e.zero,h=e.width,m=e.comma,g=e.precision,v=e.trim,y=e.type;"n"===y?(m=!0,y="g"):xt[y]||(void 0===g&&(g=12),v=!0,y="g"),(p||"0"===t&&"="===n)&&(p=!0,t="0",n="=");var b="$"===f?i:"#"===f&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",x="$"===f?o:/[%p]/.test(y)?l:"",w=xt[y],k=/[defgprs%]/.test(y);function C(e){var i,o,l,f=b,C=x;if("c"===y)C=w(e)+C,e="";else{var S=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:w(Math.abs(e),g),v&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),S&&0==+e&&"+"!==d&&(S=!1),f=(S?"("===d?d:u:"-"===d||"("===d?"":d)+f,C=("s"===y?Mt[8+mt/3]:"")+C+(S&&"("===d?")":""),k)for(i=-1,o=e.length;++i<o;)if(48>(l=e.charCodeAt(i))||l>57){C=(46===l?a+e.slice(i+1):e.slice(i))+C,e=e.slice(0,i);break}}m&&!p&&(e=r(e,1/0));var E=f.length+e.length+C.length,M=E<h?new Array(h-E+1).join(t):"";switch(m&&p&&(e=r(M+e,M.length?h-C.length:1/0),M=""),n){case"<":e=f+e+C+M;break;case"=":e=f+M+e+C;break;case"^":e=M.slice(0,E=M.length>>1)+f+e+C+M.slice(E);break;default:e=M+f+e+C}return s(e)}return g=void 0===g?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),C.toString=function(){return e+""},C}return{format:d,formatPrefix:function(e,t){var n=d(((e=vt(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(ht(t)/3))),i=Math.pow(10,-r),o=Mt[8+r/3];return function(e){return n(i*e)+o}}}}!function(e){kt=Tt(e),Ct=kt.format,St=kt.formatPrefix}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});var Dt=new Date,_t=new Date;function Nt(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<r);return s},i.filter=function(n){return Nt((function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return Dt.setTime(+t),_t.setTime(+r),e(Dt),e(_t),Math.floor(n(Dt,_t))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var qt=864e5,Rt=6048e5,Pt=Nt((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/qt}),(function(e){return e.getDate()-1})),At=Pt;function It(e){return Nt((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/Rt}))}Pt.range;var Ot=It(0),Lt=It(1),zt=It(2),Ft=It(3),jt=It(4),Ht=It(5),Bt=It(6);Ot.range,Lt.range,zt.range,Ft.range,jt.range,Ht.range,Bt.range;var Vt=Nt((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));Vt.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Nt((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null};var Wt=Vt;Vt.range;var Ut=Nt((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/qt}),(function(e){return e.getUTCDate()-1})),$t=Ut;function Yt(e){return Nt((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/Rt}))}Ut.range;var Xt=Yt(0),Kt=Yt(1),Gt=Yt(2),Jt=Yt(3),Zt=Yt(4),Qt=Yt(5),en=Yt(6);Xt.range,Kt.range,Gt.range,Jt.range,Zt.range,Qt.range,en.range;var tn=Nt((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));tn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Nt((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null};var nn=tn;function rn(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function on(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function an(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function sn(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,u=hn(i),c=mn(i),d=hn(o),f=mn(o),p=hn(a),h=mn(a),m=hn(s),g=mn(s),v=hn(l),y=mn(l),b={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:On,e:On,f:Hn,g:Zn,G:er,H:Ln,I:zn,j:Fn,L:jn,m:Bn,M:Vn,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Cr,s:Sr,S:Wn,u:Un,U:$n,V:Xn,w:Kn,W:Gn,x:null,X:null,y:Jn,Y:Qn,Z:tr,"%":kr},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:nr,e:nr,f:sr,g:yr,G:xr,H:rr,I:ir,j:or,L:ar,m:lr,M:ur,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Cr,s:Sr,S:cr,u:dr,U:fr,V:hr,w:mr,W:gr,x:null,X:null,y:vr,Y:br,Z:wr,"%":kr},w={a:function(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=h[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=v.exec(t.slice(n));return r?(e.m=y[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return S(e,t,n,r)},d:Mn,e:Mn,f:Rn,g:kn,G:wn,H:Dn,I:Dn,j:Tn,L:qn,m:En,M:_n,p:function(e,t,n){var r=u.exec(t.slice(n));return r?(e.p=c[r[0].toLowerCase()],n+r[0].length):-1},q:Sn,Q:An,s:In,S:Nn,u:vn,U:yn,V:bn,w:gn,W:xn,x:function(e,t,r){return S(e,n,t,r)},X:function(e,t,n){return S(e,r,t,n)},y:kn,Y:wn,Z:Cn,"%":Pn};function k(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,u=e.length;for(n instanceof Date||(n=new Date(+n));++s<u;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=ln[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function C(e,t){return function(n){var r,i,o=an(1900,void 0,1);if(S(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(t&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=on(an(o.y,0,1))).getUTCDay(),r=i>4||0===i?Kt.ceil(r):Kt(r),r=$t.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=rn(an(o.y,0,1))).getDay(),r=i>4||0===i?Lt.ceil(r):Lt(r),r=At.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?on(an(o.y,0,1)).getUTCDay():rn(an(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,on(o)):rn(o)}}function S(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a<s;){if(r>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=w[i in ln?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=k(n,b),b.X=k(r,b),b.c=k(t,b),x.x=k(n,x),x.X=k(r,x),x.c=k(t,x),{format:function(e){var t=k(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=C(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=k(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+="",!0);return t.toString=function(){return e},t}}}tn.range;var ln={"-":"",_:" ",0:"0"},un=/^\s*\d+/,cn=/^%/,dn=/[\\^$*+?|[\]().{}]/g;function fn(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function pn(e){return e.replace(dn,"\\$&")}function hn(e){return new RegExp("^(?:"+e.map(pn).join("|")+")","i")}function mn(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function gn(e,t,n){var r=un.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function vn(e,t,n){var r=un.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function yn(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function bn(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function xn(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function wn(e,t,n){var r=un.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function kn(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Cn(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Sn(e,t,n){var r=un.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function En(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Mn(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Tn(e,t,n){var r=un.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Dn(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function _n(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Nn(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function qn(e,t,n){var r=un.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Rn(e,t,n){var r=un.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Pn(e,t,n){var r=cn.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function An(e,t,n){var r=un.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function In(e,t,n){var r=un.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function On(e,t){return fn(e.getDate(),t,2)}function Ln(e,t){return fn(e.getHours(),t,2)}function zn(e,t){return fn(e.getHours()%12||12,t,2)}function Fn(e,t){return fn(1+At.count(Wt(e),e),t,3)}function jn(e,t){return fn(e.getMilliseconds(),t,3)}function Hn(e,t){return jn(e,t)+"000"}function Bn(e,t){return fn(e.getMonth()+1,t,2)}function Vn(e,t){return fn(e.getMinutes(),t,2)}function Wn(e,t){return fn(e.getSeconds(),t,2)}function Un(e){var t=e.getDay();return 0===t?7:t}function $n(e,t){return fn(Ot.count(Wt(e)-1,e),t,2)}function Yn(e){var t=e.getDay();return t>=4||0===t?jt(e):jt.ceil(e)}function Xn(e,t){return e=Yn(e),fn(jt.count(Wt(e),e)+(4===Wt(e).getDay()),t,2)}function Kn(e){return e.getDay()}function Gn(e,t){return fn(Lt.count(Wt(e)-1,e),t,2)}function Jn(e,t){return fn(e.getFullYear()%100,t,2)}function Zn(e,t){return fn((e=Yn(e)).getFullYear()%100,t,2)}function Qn(e,t){return fn(e.getFullYear()%1e4,t,4)}function er(e,t){var n=e.getDay();return fn((e=n>=4||0===n?jt(e):jt.ceil(e)).getFullYear()%1e4,t,4)}function tr(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+fn(t/60|0,"0",2)+fn(t%60,"0",2)}function nr(e,t){return fn(e.getUTCDate(),t,2)}function rr(e,t){return fn(e.getUTCHours(),t,2)}function ir(e,t){return fn(e.getUTCHours()%12||12,t,2)}function or(e,t){return fn(1+$t.count(nn(e),e),t,3)}function ar(e,t){return fn(e.getUTCMilliseconds(),t,3)}function sr(e,t){return ar(e,t)+"000"}function lr(e,t){return fn(e.getUTCMonth()+1,t,2)}function ur(e,t){return fn(e.getUTCMinutes(),t,2)}function cr(e,t){return fn(e.getUTCSeconds(),t,2)}function dr(e){var t=e.getUTCDay();return 0===t?7:t}function fr(e,t){return fn(Xt.count(nn(e)-1,e),t,2)}function pr(e){var t=e.getUTCDay();return t>=4||0===t?Zt(e):Zt.ceil(e)}function hr(e,t){return e=pr(e),fn(Zt.count(nn(e),e)+(4===nn(e).getUTCDay()),t,2)}function mr(e){return e.getUTCDay()}function gr(e,t){return fn(Kt.count(nn(e)-1,e),t,2)}function vr(e,t){return fn(e.getUTCFullYear()%100,t,2)}function yr(e,t){return fn((e=pr(e)).getUTCFullYear()%100,t,2)}function br(e,t){return fn(e.getUTCFullYear()%1e4,t,4)}function xr(e,t){var n=e.getUTCDay();return fn((e=n>=4||0===n?Zt(e):Zt.ceil(e)).getUTCFullYear()%1e4,t,4)}function wr(){return"+0000"}function kr(){return"%"}function Cr(e){return+e}function Sr(e){return Math.floor(+e/1e3)}var Er=ft();Er("d3-number",(function(e,t,n){var r,i;function o(e){return i(e)}function a(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return r=Tt(t),i=r.format(e),this},a(),o.format=function(e,i,o,s){return(o||s)&&(t=o,n=s,a()),r.format(e)(i)},o.pattern=function(t){return t&&(e=t,i=r.format(t)),e},o})),Er("d3-time",(function(e){var t=sn({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),n=t.format(e);function r(e){return n(e)}return r.format=function(e,n){return t.format(e)(n)},r.locale=function(){return t=sn.apply(void 0,arguments),n=t.format(e),this},r.parse=function(e,n){return t.parse(e)(n)},r.parsePattern=function(e){return t.parse(e)},r}));var Mr={id:function(e){return"".concat(e.source,"/").concat(e.key||e.title)},key:function(e){return String(e.key||e.title)},tags:function(e){return e.tags},min:function(e){return e.min},max:function(e){return e.max},type:function(e){return e.type},title:function(e){return String(e.title)},values:function(e){return e.values},value:function(e){return e},label:function(e){return e},formatter:function(e){return function(e){if("function"==typeof e.formatter)return e.formatter();var t=e.formatter||{};return Er(t.type||"d3-number")(t.format||"")}(e)}};function Tr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.id,r=void 0===n?Mr.id:n,i=t.key,o=void 0===i?Mr.key:i,a=t.min,s=void 0===a?Mr.min:a,l=t.max,u=void 0===l?Mr.max:l,c=t.type,d=void 0===c?Mr.type:c,f=t.tags,p=void 0===f?Mr.tags:f,h=t.title,m=void 0===h?Mr.title:h,g=t.values,v=void 0===g?Mr.values:g,y=t.value,b=void 0===y?Mr.value:y,x=t.label,w=void 0===x?Mr.label:x,k=t.formatter,C=void 0===k?Mr.formatter:k,S={id:function(){return r(e)},key:function(){return o(e)},raw:function(){return e},tags:function(){return p(e)},type:function(){return d(e)},min:function(){return s(e)},max:function(){return u(e)},title:function(){return m(e)},items:function(){return v(e)},formatter:function(){return C(e)},value:b,label:w};return S}var Dr={diverging:function(e,t){if((s=e.length)>0)for(var n,r,i,o,a,s,l=0,u=e[t[0]].length;l<u;++l)for(o=a=0,n=0;n<s;++n)(i=(r=e[t[n]][l])[1]-r[0])>=0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):r[0]=o},none:st,silhouette:function(e,t){if((n=e.length)>0){for(var n,r=0,i=e[t[0]],o=i.length;r<o;++r){for(var a=0,s=0;a<n;++a)s+=e[a][r][1]||0;i[r][1]+=i[r][0]=-s/2}st(e,t)}},expand:function(e,t){if((r=e.length)>0){for(var n,r,i,o=0,a=e[0].length;o<a;++o){for(i=n=0;n<r;++n)i+=e[n][o][1]||0;if(i)for(n=0;n<r;++n)e[n][o][1]/=i}st(e,t)}},wiggle:function(e,t){if((i=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,i,o=0,a=1;a<r;++a){for(var s=0,l=0,u=0;s<i;++s){for(var c=e[t[s]],d=c[a][1]||0,f=(d-(c[a-1][1]||0))/2,p=0;p<s;++p){var h=e[t[p]];f+=(h[a][1]||0)-(h[a-1][1]||0)}l+=d,u+=f*d}n[a-1][1]+=n[a-1][0]=o,l&&(o-=u/l)}n[a-1][1]+=n[a-1][0]=o,st(e,t)}}},_r={ascending:function(e){var t=e.map(dt);return lt(e).sort((function(e,n){return t[e]-t[n]}))},insideout:function(e){var t,n,r=e.length,i=e.map(dt),o=function(e){var t=e.map(ct);return lt(e).sort((function(e,n){return t[e]-t[n]}))}(e),a=0,s=0,l=[],u=[];for(t=0;t<r;++t)n=o[t],a<s?(a+=i[n],l.push(n)):(s+=i[n],u.push(n));return u.reverse().concat(l)},none:lt,reverse:function(e){return lt(e).reverse()}};function Nr(e,t,n){for(var r={},i=t.stackKey,o=t.value,a=t.startProp||"start",s=t.endProp||"end",l=t.offset||"none",u=t.order||"none",c=t.valueRef||"",d=0,f={},p=0;p<e.items.length;p++){var h=e.items[p],m=c?h[c]:null;if(m&&m.source){var g="".concat(m.source.key||"","/").concat(m.source.field);f[g]||(f[g]=m.source)}var v=i(h);r[v]=r[v]||{items:[]},r[v].items.push(h),d=Math.max(d,r[v].items.length)}for(var y=Array.apply(null,{length:d}).map(Number.call,Number),b=Object.keys(r).map((function(e){return r[e].items})),x=function(){var e=he([]),t=lt,n=st,r=ut;function i(i){var o,a,s=e.apply(this,arguments),l=i.length,u=s.length,c=new Array(u);for(o=0;o<u;++o){for(var d,f=s[o],p=c[o]=new Array(l),h=0;h<l;++h)p[h]=d=[0,+r(i[h],f,h,i)],d.data=i[h];p.key=f}for(o=0,a=t(c);o<u;++o)c[a[o]].index=o;return n(c,a),c}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:he(Ve.call(t)),i):e},i.value=function(e){return arguments.length?(r="function"==typeof e?e:he(+e),i):r},i.order=function(e){return arguments.length?(t=null==e?lt:"function"==typeof e?e:he(Ve.call(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?st:e,i):n},i}().keys(y).value((function(e,t){return e[t]?o(e[t]):0})).order(_r[u]).offset(Dr[l])(b),w=[],k=0;k<x.length;k++)for(var C=x[k],S=0;S<C.length;S++){var E=C[S],M=C[S].data[C.key];M&&(M[a]={value:E[0]},M[s]={value:E[1]},w.push(E[0],E[1]))}var T=Object.keys(f).map((function(e){var t=n(f[e].key);return t?t.field(f[e].field):null})).filter((function(e){return!!e})),D=Tr({title:T.map((function(e){return e.title()})).join(", "),min:Math.min.apply(Math,w),max:Math.max.apply(Math,w),type:"measure",formatter:T[0]?T[0].formatter:void 0});e.fields.push(D)}function qr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={},i=n.logger;if(Array.isArray(e))r.items=e.map((function(e){return{value:e,label:String(e)}}));else if(e){if("collection"in e)r=q({},t.collection(e.collection));else{var o=t.dataset?t.dataset(e.source):null,a=e.value||function(e){return e},s=e.label||function(e){return e};if(e.groupBy||e.mapTo)i.warn('Deprecated "data" configuration',e),r.items=[];else if(e.hierarchy)r.root=o.hierarchy?o.hierarchy(e.hierarchy):null,r.fields=o.fields();else if(e.items)r.items=e.items.map((function(e){return{value:a(e),label:String(s(e))}}));else if(e.extract){var l=Array.isArray(e.extract)?e.extract:[e.extract];r.items=[];var u=[];l.forEach((function(e){var n=e.source?t.dataset(e.source):o;n&&(r.items=[].concat(X(r.items),X(n.extract(e))),void 0!==e.field&&u.push(n.field(e.field)))})),u.length&&(r.fields=u),e.amend&&Array.isArray(e.amend)&&(r.items=[].concat(X(r.items),X(e.amend)))}else if(void 0!==e.field&&o){var c=o.field(e.field);c&&(r.fields||(r.fields=[]),r.fields.push(c),"value"in e||(a=c.value||function(e){return e},s=c.label||function(e){return e},r.value=a),r.items=c.items().map((function(t){return{value:a(t),label:String(s(t)),source:{field:e.field}}})))}else e.fields&&e.fields.forEach((function(e){var n,i="object"===R(e)&&e.source?t.dataset(e.source):o;i&&((n="object"===R(e)&&void 0!==e.field?i.field(e.field):i.field(e))&&(r.fields||(r.fields=[]),r.fields.push(n)))}));r.items&&e.map&&(r.items=r.items.map(e.map))}e&&e.stack&&Nr(r,e.stack,t.dataset)}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&r.items&&(r.items=r.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&r.items&&(r.items=r.items.sort(e.sort)),r}function Rr(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:qr,i={};(e||[]).forEach((function(e){if(!e.key)throw new Error('Data collection is missing "key" property');if("object"===R(e.data)&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");i[e.key]=function(){return r(e.data,t,n)}}));var o=function(e){var t,n;if("string"==typeof e?t=e:"object"===R(e)&&(t=e.key,n=e),!(t in i))throw new Error("Unknown data collection: ".concat(t));"function"==typeof i[t]&&(i[t]=i[t]());var r=i[t];if(n&&n.fields&&n.fields.filter){var o=r.fields.filter(n.fields.filter);r.fields.length!==o.length&&(r=D(r,{fields:o}))}return r};return o}function Pr(e,t,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:qr;if(e.data){var o=i(e.data,t,n);if(o&&o.fields&&o.fields[0])return o.fields[0].formatter()}if(r=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(r)){var a=n.formatter.get(r)(e.format||"");return a}throw new Error("Formatter of type '".concat(r,"' was not found"))}function Ar(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Pr,i={};return{get:function(o){var a;return"string"==typeof o&&e[o]?a=o:"object"===R(o)&&"formatter"in o&&e[o.formatter]?a=o.formatter:"object"===R(o)&&"type"in o&&e[o.type]&&(a=o.type),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o||{},t,n)},all:function(){return Object.keys(e).forEach(this.get),i}}}function Ir(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var Or=function(e){return 1===e.length&&(e=function(e){return function(t,n){return Ir(e(t),n)}}(e)),{left:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)<0?r=o+1:i=o}return r},right:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)>0?i=o:r=o+1}return r}}}(Ir).right;function Lr(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r<i;)o[r]=e+r*n;return o}var zr=Math.sqrt(50),Fr=Math.sqrt(10),jr=Math.sqrt(2);function Hr(e,t,n){var r=(t-e)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=zr?10:o>=Fr?5:o>=jr?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=zr?10:o>=Fr?5:o>=jr?2:1)}function Br(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var Vr="$";function Wr(){}function Ur(e,t){var n=new Wr;if(e instanceof Wr)e.each((function(e,t){n.set(t,e)}));else if(Array.isArray(e)){var r,i=-1,o=e.length;if(null==t)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(t(r=e[i],i,e),r)}else if(e)for(var a in e)n.set(a,e[a]);return n}function $r(){}Wr.prototype=Ur.prototype={constructor:Wr,has:function(e){return Vr+e in this},get:function(e){return this[Vr+e]},set:function(e,t){return this[Vr+e]=t,this},remove:function(e){var t=Vr+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===Vr&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===Vr&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===Vr&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===Vr&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===Vr&&++e;return e},empty:function(){for(var e in this)if(e[0]===Vr)return!1;return!0},each:function(e){for(var t in this)t[0]===Vr&&e(this[t],t.slice(1),this)}};var Yr=Ur.prototype;$r.prototype={constructor:$r,has:Yr.has,add:function(e){return this[Vr+(e+="")]=e,this},remove:Yr.remove,clear:Yr.clear,values:Yr.keys,size:Yr.size,empty:Yr.empty,each:Yr.each};var Xr=Array.prototype,Kr=Xr.map,Gr=Xr.slice,Jr={name:"implicit"};function Zr(){var e=Ur(),t=[],n=[],r=Jr;function i(i){var o=i+"",a=e.get(o);if(!a){if(r!==Jr)return r;e.set(o,a=t.push(i))}return n[(a-1)%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=Ur();for(var r,o,a=-1,s=n.length;++a<s;)e.has(o=(r=n[a])+"")||e.set(o,t.push(r));return i},i.range=function(e){return arguments.length?(n=Gr.call(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return Zr(t,n).unknown(r)},Br.apply(i,arguments),i}function Qr(){var e,t,n=Zr().unknown(void 0),r=n.domain,i=n.range,o=[0,1],a=!1,s=0,l=0,u=.5;function c(){var n=r().length,c=o[1]<o[0],d=o[c-0],f=o[1-c];e=(f-d)/Math.max(1,n-s+2*l),a&&(e=Math.floor(e)),d+=(f-d-e*(n-s))*u,t=e*(1-s),a&&(d=Math.round(d),t=Math.round(t));var p=Lr(n).map((function(t){return d+e*t}));return i(c?p.reverse():p)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),c()):r()},n.range=function(e){return arguments.length?(o=[+e[0],+e[1]],c()):o.slice()},n.rangeRound=function(e){return o=[+e[0],+e[1]],a=!0,c()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(a=!!e,c()):a},n.padding=function(e){return arguments.length?(s=Math.min(1,l=+e),c()):s},n.paddingInner=function(e){return arguments.length?(s=Math.min(1,e),c()):s},n.paddingOuter=function(e){return arguments.length?(l=+e,c()):l},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),c()):u},n.copy=function(){return Qr(r(),o).round(a).paddingInner(s).paddingOuter(l).align(u)},Br.apply(c(),arguments)}function ei(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ti(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ni(){}var ri=.7,ii=1/ri,oi="\\s*([+-]?\\d+)\\s*",ai="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",si="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",li=/^#([0-9a-f]{3,8})$/,ui=new RegExp("^rgb\\("+[oi,oi,oi]+"\\)$"),ci=new RegExp("^rgb\\("+[si,si,si]+"\\)$"),di=new RegExp("^rgba\\("+[oi,oi,oi,ai]+"\\)$"),fi=new RegExp("^rgba\\("+[si,si,si,ai]+"\\)$"),pi=new RegExp("^hsl\\("+[ai,si,si]+"\\)$"),hi=new RegExp("^hsla\\("+[ai,si,si,ai]+"\\)$"),mi={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 gi(){return this.rgb().formatHex()}function vi(){return this.rgb().formatRgb()}function yi(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=li.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?bi(t):3===n?new Ci(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?xi(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?xi(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=ui.exec(e))?new Ci(t[1],t[2],t[3],1):(t=ci.exec(e))?new Ci(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=di.exec(e))?xi(t[1],t[2],t[3],t[4]):(t=fi.exec(e))?xi(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=pi.exec(e))?Ti(t[1],t[2]/100,t[3]/100,1):(t=hi.exec(e))?Ti(t[1],t[2]/100,t[3]/100,t[4]):mi.hasOwnProperty(e)?bi(mi[e]):"transparent"===e?new Ci(NaN,NaN,NaN,0):null}function bi(e){return new Ci(e>>16&255,e>>8&255,255&e,1)}function xi(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ci(e,t,n,r)}function wi(e){return e instanceof ni||(e=yi(e)),e?new Ci((e=e.rgb()).r,e.g,e.b,e.opacity):new Ci}function ki(e,t,n,r){return 1===arguments.length?wi(e):new Ci(e,t,n,null==r?1:r)}function Ci(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Si(){return"#"+Mi(this.r)+Mi(this.g)+Mi(this.b)}function Ei(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function Mi(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Ti(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new _i(e,t,n,r)}function Di(e){if(e instanceof _i)return new _i(e.h,e.s,e.l,e.opacity);if(e instanceof ni||(e=yi(e)),!e)return new _i;if(e instanceof _i)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new _i(a,s,l,e.opacity)}function _i(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Ni(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function qi(e){return function(){return e}}function Ri(e){return 1==(e=+e)?Pi: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):qi(isNaN(t)?n:t)}}function Pi(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):qi(isNaN(e)?t:e)}ei(ni,yi,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:gi,formatHex:gi,formatHsl:function(){return Di(this).formatHsl()},formatRgb:vi,toString:vi}),ei(Ci,ki,ti(ni,{brighter:function(e){return e=null==e?ii:Math.pow(ii,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?ri:Math.pow(ri,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Si,formatHex:Si,formatRgb:Ei,toString:Ei})),ei(_i,(function(e,t,n,r){return 1===arguments.length?Di(e):new _i(e,t,n,null==r?1:r)}),ti(ni,{brighter:function(e){return e=null==e?ii:Math.pow(ii,e),new _i(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?ri:Math.pow(ri,e),new _i(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ci(Ni(e>=240?e-240:e+120,i,r),Ni(e,i,r),Ni(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var Ai=function e(t){var n=Ri(t);function r(e,t){var r=n((e=ki(e)).r,(t=ki(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Pi(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function Ii(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function Oi(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=Vi(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}function Li(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function zi(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Fi(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=Vi(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var ji=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Hi=new RegExp(ji.source,"g");function Bi(e,t){var n,r,i,o=ji.lastIndex=Hi.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=ji.exec(e))&&(r=Hi.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:zi(n,r)})),o=Hi.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function Vi(e,t){var n,r=typeof t;return null==t||"boolean"===r?qi(t):("number"===r?zi:"string"===r?(n=yi(t))?(t=n,Ai):Bi:t instanceof yi?Ai:t instanceof Date?Li:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Ii:Array.isArray(t)?Oi:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Fi:zi)(e,t)}function Wi(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Ui(e){return+e}var $i=[0,1];function Yi(e){return e}function Xi(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function Ki(e){var t,n=e[0],r=e[e.length-1];return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function Gi(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=Xi(i,r),o=n(a,o)):(r=Xi(r,i),o=n(o,a)),function(e){return o(r(e))}}function Ji(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Xi(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=Or(e,t,1,r)-1;return o[n](i[n](t))}}function Zi(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Qi(e,t){return function(){var e,t,n,r,i,o,a=$i,s=$i,l=Vi,u=Yi;function c(){return r=Math.min(a.length,s.length)>2?Ji:Gi,i=o=null,d}function d(t){return isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(u(t)))}return d.invert=function(n){return u(t((o||(o=r(s,a.map(e),zi)))(n)))},d.domain=function(e){return arguments.length?(a=Kr.call(e,Ui),u===Yi||(u=Ki(a)),c()):a.slice()},d.range=function(e){return arguments.length?(s=Gr.call(e),c()):s.slice()},d.rangeRound=function(e){return s=Gr.call(e),l=Wi,c()},d.clamp=function(e){return arguments.length?(u=e?Ki(a):Yi,d):u!==Yi},d.interpolate=function(e){return arguments.length?(l=e,c()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,c()}}()(e,t)}function eo(e,t,n,r){var i,o=function(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=zr?i*=10:o>=Fr?i*=5:o>=jr&&(i*=2),t<e?-i:i}(e,t,n);switch((r=vt(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ht(t)/3)))-ht(Math.abs(e)))}(o,a))||(r.precision=i),St(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ht(t)-ht(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-ht(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return Ct(r)}function to(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){var r,i,o,a,s=-1;if(n=+n,(e=+e)==(t=+t)&&n>0)return[e];if((r=t<e)&&(i=e,e=t,t=i),0===(a=Hr(e,t,n))||!isFinite(a))return[];if(a>0)for(e=Math.ceil(e/a),t=Math.floor(t/a),o=new Array(i=Math.ceil(t-e+1));++s<i;)o[s]=(e+s)*a;else for(e=Math.floor(e*a),t=Math.ceil(t*a),o=new Array(i=Math.ceil(e-t+1));++s<i;)o[s]=(e-s)/a;return r&&o.reverse(),o}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return eo(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i=t(),o=0,a=i.length-1,s=i[o],l=i[a];return l<s&&(r=s,s=l,l=r,r=o,o=a,a=r),(r=Hr(s,l,n))>0?r=Hr(s=Math.floor(s/r)*r,l=Math.ceil(l/r)*r,n):r<0&&(r=Hr(s=Math.ceil(s*r)/r,l=Math.floor(l*r)/r,n)),r>0?(i[o]=Math.floor(s/r)*r,i[a]=Math.ceil(l/r)*r,t(i)):r<0&&(i[o]=Math.ceil(s*r)/r,i[a]=Math.floor(l*r)/r,t(i)),e},e}function no(){var e=Qi(Yi,Yi);return e.copy=function(){return Zi(e,no())},Br.apply(e,arguments),to(e)}function ro(){var e,t=[.5],n=[0,1],r=1;function i(i){return i<=i?n[Or(t,i,0,r)]:e}return i.domain=function(e){return arguments.length?(t=Gr.call(e),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(e){return arguments.length?(n=Gr.call(e),r=Math.min(t.length,n.length-1),i):n.slice()},i.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return ro().domain(t).range(n).unknown(e)},Br.apply(i,arguments)}function io(e){return void 0===e?function(e){return e}:function(t){return e(t)}}function oo(e){return Math.max(0,Math.min(1,e))}function ao(e){return"object"===R(e)}function so(e,t,n){for(var r=Math.abs(t-n)/(e+1),i=[],o=1;o<=e;o++){var a=o*r;i.push(t<n?t+a:t-a)}return i}function lo(e,t,n){if(1===e.length)return e;for(var r=e.concat([]),i=0;i<e.length;i++){var o=e[i],a=e[i+1];0===i&&o!==n.start()?(r.push.apply(r,X(so(t,o,a))),o-=a-o,a=e[i],r.push.apply(r,X(so(t,o,a)))):i===e.length-1&&a!==n.end()?(a=o+(o-e[i-1]),r.push.apply(r,X(so(t,o,a)))):r.push.apply(r,X(so(t,o,a)))}return r.filter((function(e){return e>=n.min()&&e<=n.max()}))}function uo(e){var t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,a=void 0===o?100:o,s=e.formatter,l=void 0===s?void 0:s,u=Q(a)||Q(t)?2:Math.max(t/a,2),c=Math.min(1e3,Math.round(u)),d=n.ticks(c);d.length<=1&&(d=n.ticks(c+1));var f=i>0?lo(d,i,n):d;f.sort((function(e,t){return e-t}));var p=f.map(io(l));return f.map((function(e,t){var r=n(e);return{position:r,start:r,end:r,label:p[t],value:e,isMinor:-1===d.indexOf(e)}}))}function co(e){var t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,a=void 0===o?100:o,s=e.formatter,l=void 0===s?void 0:s,u=Q(a)||Q(t)?2:Math.max(t/a,2),c=Math.min(1e3,Math.round(u)),d=c>10?10:c;n.nice(d);var f=n.ticks(c),p=i>0?lo(f,i,n):f;p.sort((function(e,t){return e-t}));var h=p.map(io(l));return p.map((function(e,t){var r=n(e);return{position:r,start:r,end:r,label:h[t],value:e,isMinor:-1===f.indexOf(e)}}))}function fo(e){var t,n=e.settings,r=e.scale,i=e.distance,o=e.formatter,a=void 0===o?function(e){return e}:o,s=n.minorTicks&&!Q(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values))t=function(e){var t=e.values,n=e.scale,r=e.formatter,i=void 0===r?function(e){return e}:r;return t.sort((function(e,t){return(ao(e)?e.value:e)-(ao(t)?t.value:t)})).filter((function(e,t,r){var i=ao(e)?e.value:e;return i<=n.max()&&i>=n.min()&&r.indexOf(e)===t})).map((function(e){var t=ao(e),r=t?e.value:e,o=n(r);return{position:o,value:r,label:t&&void 0!==e.label?e.label:i(r),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?oo(n(e.start)):o,end:t&&!isNaN(e.end)?oo(n(e.end)):o}}))}({values:n.ticks.values.filter((function(e){return"object"===R(e)?!Q(e.value):!Q(e)})),scale:r.copy(),formatter:a});else if(Q(n.ticks.count)){t=(n.ticks.tight?co:uo)({distance:i,minorCount:s,unitDivider:n.ticks.distance,scale:r,formatter:a}),n.ticks.forceBounds&&function(e,t,n){var r=e.map((function(e){return e.position})),i=t.range();-1===r.indexOf(i[0])?e.splice(0,0,{position:i[0],start:i[0],end:i[0],label:n(t.start()),isMinor:!1,value:t.start()}):e[0]&&e[0].isMinor&&(e[0].isMinor=!1);var o=e[e.length-1];-1===r.indexOf(i[1])?e.push({position:i[1],start:i[1],end:i[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,r,a)}else{t=function(e){var t=e.count,n=e.minorCount,r=e.scale,i=e.formatter;return r.ticks((t-1)*n+t).map((function(e,t){var o=r(e);return{position:o,start:o,end:o,label:i(e),isMinor:t%(n+1)!=0,value:e}}))}({count:Math.min(1e3,n.ticks.count),minorCount:s,scale:r.copy(),formatter:a})}return t}function po(e){var t=e.scale,n=t.domain(),r=t.data().items,i=t.labels?t.labels():n,o=t.bandwidth();return n.map((function(e,n){var a=t(e);return{position:a+o/2,label:"".concat(i[n]),data:r?r[n]:void 0,start:a,end:a+o}}))}function ho(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={};return Object.keys(t).forEach((function(i){var o=R(e[i]);r[i]="function"===o?e[i](n):"undefined"===o?t[i]:e[i]})),r}var mo={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},go={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},vo={count:NaN};function yo(e,t){var n=+e.min,r=+e.max,i=0,o=1;if(t&&t[0]){var a=t.map((function(e){return e.min()})).filter((function(e){return!isNaN(e)})),s=t.map((function(e){return e.max()})).filter((function(e){return!isNaN(e)}));if(i=a.length?Math.min.apply(Math,X(a)):Number.NaN,o=s.length?Math.max.apply(Math,X(s)):Number.NaN,isNaN(i)||isNaN(o))i=-1,o=1;else if(i===o&&0===i)i=-1,o=1;else if(i===o&&i)i-=Math.abs(.1*i),o+=Math.abs(.1*o);else if(!isNaN(e.expand)){var l=o-i;i-=l*e.expand,o+=l*e.expand}if(Array.isArray(e.include)){var u=e.include.filter((function(e){return!isNaN(e)}));i=Math.min.apply(Math,X(u).concat([i])),o=Math.max.apply(Math,X(u).concat([o]))}}return{mini:isNaN(n)?i:n,maxi:isNaN(r)?o:r}}function bo(e,t){e.instance||(e.instance=t.copy(),e.instance.domain([t.start(),t.end()]),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}function xo(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=no(),o={instance:null,invert:!1},a={data:n,resources:r},s=ho(t,mo,a);function l(e){return Q(e)?NaN:i(e)}s.ticks=ho(t.ticks,go,a),s.minorTicks=ho(t.minorTicks,vo,a),l.data=function(){return n},l.invert=function(e){return i.invert(e)},l.rangeRound=function(e){return i.rangeRound(e),l},l.clamp=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return i.clamp(e),l},l.cachedTicks=function(){return e},l.clearTicksCache=function(){return e=void 0,this},l.ticks=function(t){return null!==t&&"object"===R(t)?(t.settings=t.settings||{},t.settings=D(!0,{},s,t.settings),t.scale=l,e=fo(t)):e=i.ticks(t)},l.nice=function(e){return i.nice(e),l},l.tickFormat=function(e,t){return i.tickFormat(e,t)},l.interpolate=function(e){return i.interpolate(e),l},l.domain=function(e){return arguments.length?(i.domain(e),o.instance&&o.instance.domain([l.start(),l.end()]),l):i.domain()},l.range=function(e){return arguments.length?(i.range(e),l):i.range()},l.start=function(){return l.domain()[0]},l.end=function(){return l.domain()[this.domain().length-1]},l.min=function(){return Math.min(this.start(),this.end())},l.max=function(){return Math.max(this.start(),this.end())},l.classify=function(e){for(var t=(l.start()-l.end())/e,n=[l.end()],r=[],i=t/2,o=0;o<e;o++){var a=n[n.length-1]||0,s=a+t,u=l(a+i);n.push.apply(n,[s,s]),r.push.apply(r,[u,u])}return n.pop(),l.domain(n),l.range(r),l},l.copy=function(){var e=xo(t,n,r);return e.domain(l.domain()),e.range(l.range()),e.clamp(i.clamp()),e},l.norm=function(e){return bo(o,l),o.instance(e)},l.normInvert=function(e){return bo(o,l),o.instance.invert(e)};var u=yo(s,n?n.fields:[]),c=u.mini,d=u.maxi;return l.domain([c,d]),l.range(s.invert?[1,0]:[0,1]),o.invert=s.invert,l}var wo={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function ko(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={data:t,resources:n},i=ho(e,wo,r),o=t.items||[],a={},s=[],l=[];function u(e,n){e.data=function(){return t},e.datum=function(e){return o[a[e]]},e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=function(){return l},e.ticks=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,po(t,n.trackBy)}}var c=Qr();u(c,e),c.pxScale=function(t){var n=i.maxPxStep;if(isNaN(n))return c;var r=c.domain().length,o=Math.max(1,r-c.paddingInner()+2*c.paddingOuter());if(o*n>=t)return c;var a=c.copy();a.type=c.type,u(a,e);var s=o*n/t,l=(1-s)*c.align();return a.range(i.invert?[s+l,l]:[l,s+l]),a};for(var d="function"==typeof e.value?e.value:function(e){return e.datum.value},f="function"==typeof e.label?e.label:function(e){return e.datum.label},p=0;p<o.length;p++){var h=D({datum:o[p]},r),m=d(h,p);-1===s.indexOf(m)&&(s.push(m),l.push(f(h,p)),a[m]=p)}return c.domain(s),c.range(i.invert?i.range.slice().reverse():i.range),c.padding(isNaN(i.padding)?0:i.padding),isNaN(i.paddingInner)||c.paddingInner(i.paddingInner),isNaN(i.paddingOuter)||c.paddingOuter(i.paddingOuter),c.align(isNaN(i.align)?.5:i.align),c}var Co={depth:0};function So(e,t,n){return e.ancestors().map((function(e){return t(D({datum:e.data},n))})).reverse().slice(1).toString()}function Eo(e,t,n){var r=t.ticks.depth,i=t.value,o=t.label,a=[],s=[],l={},u=[],c=0;if(!e)return{values:a,labels:s,items:l,ticks:u};e.eachAfter((function(e){if(e.depth>0){var t=So(e,i,n),d=e.leaves()||[e],f=i(D({datum:e.data},n)),p=o(D({datum:e.data},n)),h=Array.isArray(e.children),m={key:t,count:d.length,value:f,label:p,leftEdge:So(d[0],i,n),rightEdge:So(d[Math.max(d.length-1,0)],i,n),node:e};h?(a.push("SPACER_".concat(c,"_SPACER")),c++):(a.push(t),s.push(p)),(r<=0&&!h||e.depth===r)&&u.push(m),l[t]=m}}));var d=e.height-1;return d>0&&a.splice(-d),{values:a,labels:s,items:l,ticks:u}}var Mo=function(e){return e.min()},To=function(e){return e.max()};function Do(e,t){var n=e&&!isNaN(e.min),r=e&&!isNaN(e.max),i=n?+e.min:0,o=r?+e.max:1;if(t&&t.length){if(!n){var a=t.map(Mo).filter(Z);i=a.length?Math.min.apply(Math,X(a)):i}if(!r){var s=t.map(To).filter(Z);o=s.length?Math.max.apply(Math,X(s)):o}}return[i,o]}var _o={domain:[],range:[],invert:!1,min:NaN,max:NaN};function No(e,t,n){var r=e.length;if(2===r)return[t,n];var i=[],o=(n-t)/(r-1);i.push(t);for(var a=1;a<r-1;a++)i.push(t+o*a);return i.push(n),i}function qo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=xo(e,t,n).clamp(!0).interpolate(Ai),i=ho(e,_o,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length,s=r;D(!0,s,r);var l=Do(i,t?t.fields:[]),u=Y(l,2),c=u[0],d=u[1],f=o?i.domain.length:-1,p=n.theme?n.theme.palette("sequential",f>0?f:2):[],h=a?i.range:p;return s.range(i.invert?h.slice().reverse():h.slice()),s.domain(o?i.domain:No(s.range(),c,d)),s}var Ro={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function Po(e,t,n){var r=e.length;if(2===r)return[t+(n-t)/2];for(var i=[],o=(n-t)/r,a=1;a<r;a++)i.push(t+o*a);return i}function Ao(e,t,n,r){n=e[0],r=e&&e.length>=2?e[e.length-1]:r;var i=qo().domain([n,r]).range(t);return[n].concat(X(function(e){for(var t=[],n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}(e)),[r]).map((function(e){return i(e)}))}function Io(e,t,n){var r=2===e.length?10:Math.max(1,e.length),i=no().domain([t,n]).nice(r).ticks(r);if(!e||!e.length)return i;for(var o=Math.max(0,e.length-1);i.length>o;)i[0]-t<=n-i[i.length-1]?i.shift():i.pop();return i}var Oo={domain:[],range:[]};function Lo(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Zr(),i={data:t,resources:n},o=ho(e,Oo,i),a="function"==typeof e.value?e.value:function(e){return e.datum.value},s="function"==typeof e.label?e.label:function(e){return e.datum.label},l=t.items||[],u={},c=[],d=[],f=0;f<l.length;f++){var p=D({datum:l[f]},i),h=a(p,f);-1===c.indexOf(h)&&(c.push(h),d.push(s(p,f)),u[h]=f)}return r.data=function(){return t},r.labels=function(){return d},r.label=function(e){return d[c.indexOf(e)]},r.datum=function(e){return l[u[e]]},r.range(o.range),Array.isArray(o.domain)&&o.domain.length?r.domain(o.domain):r.domain(c),r}var zo={domain:[],range:[],unknown:void 0},Fo={domain:[],range:[],override:!1};var jo=ft();function Ho(e,t,n){var r=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),r={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach((function(e){r.extract.push({field:e})})));var i,o=qr(r,t,n),a=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?-1!==e.fields.map((function(e){return"dimension"===e.type()?"band":"linear"})).indexOf("linear")?"linear":"band":"linear"}(o);return"color"===a&&(a=o.fields&&o.fields[0]&&"dimension"===o.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(a)&&((i=(i=n.scale.get(a))(e,o,{theme:n.theme,logger:n.logger})).type=a),i}function Bo(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ho,i={};return{get:function(o){var a;return"string"==typeof o&&e[o]?a=o:"object"===R(o)&&"scale"in o&&e[o.scale]&&(a=o.scale),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o,t,n)},all:function(){return Object.keys(e).forEach(this.get),i}}}jo("linear",xo),jo("band",ko),jo("h-band",(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={data:n,resources:r},o=ho(t,wo,i);o.ticks=ho(t.ticks,Co,i),o.value="function"==typeof t.value?t.value:function(e){return e.datum.value},o.label="function"==typeof t.label?t.label:function(e){return e.datum.value};var a=ko(o),s=Eo(n.root,o,i),l=s.values,u=s.labels,c=s.items,d=s.ticks,f=function(e){var t=String(e),n=c[t];return a(n?o.invert?n.rightEdge:n.leftEdge:t)};D(!0,f,a),f.bandwidth=function(e){var t=c[String(e)],n=a.bandwidth();if(t&&!t.isLeaf){var r=f(t.leftEdge),i=f(t.rightEdge);return Math.abs(r-i)+n}return n},f.step=function(e){var t=c[String(e)],n=t?t.count:1,r=a.step();return r*=n},f.data=function(){return n},f.datum=function(e){var t=c[String(e)];return t?t.node.data:null},f.copy=function(){return e(t,n,r)},f.labels=function(){return u},f.ticks=function(){return d.map((function(e){var t=f(e.key),n=f.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}}))};var p=a.pxScale;return f.pxScale=function(e){return a=p(e),f},f.domain(l),f})),jo("sequential-color",qo),jo("threshold-color",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=ro(),i=ho(e,Ro,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length;function s(e){return Q(e)?NaN:r(e)}Object.keys(r).forEach((function(e){return s[e]=r[e]}));var l=t.fields,u=Do(i,l),c=Y(u,2),d=c[0],f=c[1],p=o?i.domain.length:-1,h=n.theme?n.theme.palette("sequential",p>0?p:2):[],m=a?i.range:h,g=[];return g=o?i.domain:i.nice?Io(m,d,f):[d+(f-d)/2],m.length>g.length+1?g=Po(m,d,f):m.length<g.length+1&&(m=Ao(g,m,d,f)),s.data=function(){return t},s.range(i.invert?m.slice().reverse():m),s.domain(g),s})),jo("categorical-color",(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Lo(t,n,r),o=r.theme,a=ho(t,zo,{data:n,resources:r});if(a.explicit=ho(t.explicit,Fo,{data:n,resources:r}),e=Array.isArray(a.range)&&0!==a.range.length?a.range.slice():o?o.palette("categorical",i.domain().length).slice():[],a.unknown)i.unknown(a.unknown);else if(o&&o.palette("unknown")){var s=o.palette("unknown");i.unknown(s[0])}if(Array.isArray(a.explicit.domain)&&a.explicit.domain.length){for(var l=i.domain().slice(),u=a.explicit.domain,c=Array.isArray(a.explicit.range)?a.explicit.range:[],d=Math.floor(l.length/e.length),f=1;f<d+1;f*=2)e=e.concat(e);if(a.explicit.override)for(var p=0;p<u.length;p++){var h=l.indexOf(u[p]);h>-1&&(e[h]=c[p])}else{var m=u.map((function(e,t){return[l.indexOf(e),e,c[t]]})).sort((function(e,t){return e[0]-t[0]}));m.forEach((function(t){var n=l.indexOf(t[1]);-1!==n&&e.splice(n,0,t[2])}))}e.length=l.length}return i.range(e),i}));var Vo={};function Wo(){Wo.init.call(this)}Vo.isObject=function(e){return"object"==typeof e&&null!==e},Vo.isNumber=function(e){return"number"==typeof e},Vo.isUndefined=function(e){return void 0===e},Vo.isFunction=function(e){return"function"==typeof e};var Uo=Wo;Wo.EventEmitter=Wo,Wo.prototype._events=void 0,Wo.prototype._maxListeners=void 0,Wo.defaultMaxListeners=10,Wo.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},Wo.prototype.setMaxListeners=function(e){if(!Vo.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},Wo.prototype.emit=function(e){var t,n,r,i,o,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],Vo.isUndefined(n))return!1;if(Vo.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(Vo.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(a=n.slice()).length,o=0;o<r;o++)a[o].apply(this,i)}return!0},Wo.prototype.addListener=function(e,t){var n;if(!Vo.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,Vo.isFunction(t.listener)?t.listener:t),this._events[e]?Vo.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,Vo.isObject(this._events[e])&&!this._events[e].warned)&&((n=Vo.isUndefined(this._maxListeners)?Wo.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,Vo.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),Vo.isFunction(console.trace)&&console.trace()));return this},Wo.prototype.on=Wo.prototype.addListener,Wo.prototype.once=function(e,t){if(!Vo.isFunction(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},Wo.prototype.removeListener=function(e,t){var n,r,i,o;if(!Vo.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||Vo.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(Vo.isObject(n)){for(o=i;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},Wo.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],Vo.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},Wo.prototype.listeners=function(e){return this._events&&this._events[e]?Vo.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},Wo.listenerCount=function(e,t){return e._events&&e._events[t]?Vo.isFunction(e._events[t])?1:e._events[t].length:0};var $o=function(e){return Object.keys(Uo.prototype).forEach((function(t){e[t]=Uo.prototype[t]})),Uo.init(e),e};function Yo(){var e=0,t=0,n=0,r=0;n=n||e;var i={move:function(e){this.moveTo(n+e)},moveTo:function(o){var a=Math.max(e,Math.min(t-r,o));n!==a&&(n=a,i.emit("update"))},update:function(o){var a=!1,s=o.min;e=void 0===s?e:s;var l=o.max;t=void 0===l?t:l,void 0!==o.viewSize&&o.viewSize!==r&&(r=o.viewSize,a=!0);var u=Math.max(e,Math.min(t-r,n));n!==u&&(n=u,a=!0),a&&i.emit("update")},getState:function(){return{min:e,max:t,start:n,viewSize:r}}};return $o(i),i}function Xo(e,t){var n=e.min||0,r=e.max||0,i=e.viewSize||0,o=t||Yo();return o.update({min:n,max:r,viewSize:i}),o}function Ko(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Xo(e[r],t?t[r]:null));return n}function Go(e,t){return t[e]||(t[e]=Yo()),t[e]}function Jo(e,t){return e<=t}function Zo(e,t){return e<t}function Qo(e,t,n){for(var r=0;r<e.length&&t>e[r];)++r;return e[r]===t&&n&&++r,r}function ea(e,t,n,r){for(var i=e.length,o=1;o<i;o+=2)if(n(e[o-1],t)&&r(t,e[o]))return!0;return!1}function ta(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=[];function i(){}return i.configure=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.includeMax,i=void 0===r||r,o=n.includeMin,a=void 0===o||o;e=i?Jo:Zo,t=a?Jo:Zo},i.add=function(e){var t,n=e.min,i=e.max,o=Qo(r,n),a=Qo(r,i,!0),s=[o,a-o];o%2==0&&s.push(n),a%2==0&&s.push(i);var l=r.join(",");return(t=r).splice.apply(t,s),l!==r.join(",")},i.remove=function(e){var t,n=e.min,i=e.max,o=Qo(r,n),a=Qo(r,i,!0),s=[o,a-o];o%2==1&&s.push(n),a%2==1&&s.push(i);var l=r.join(",");return(t=r).splice.apply(t,s),l!==r.join(",")},i.set=function(e){var t=r.join(",");return r=[],Array.isArray(e)?e.forEach(i.add):i.add(e),t!==r.join(",")},i.clear=function(){var e=r.length>0;return r=[],e},i.containsValue=function(n){return ea(r,n,t,e)},i.containsRange=function(e){var t=e.min,n=e.max,i=Qo(r,t,!0),o=Qo(r,n);return i===o&&o%2==1},i.toggle=function(e){return i.containsRange(e)?i.remove(e):i.add(e)},i.ranges=function(){for(var e=[],t=1;t<r.length;t+=2)e.push({min:r[t-1],max:r[t]});return e},i.configure(n),i}function na(){var e=[];function t(){}return t.add=function(t){return-1===e.indexOf(t)&&(e.push(t),!0)},t.remove=function(t){var n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=function(t){return-1!==e.indexOf(t)},t.values=function(){return e.slice()},t.clear=function(){return e=[]},t.toString=function(){return e.join(";")},t}var ra={key:void 0,includeMin:!0,includeMax:!0};function ia(e){for(var t,n,r=e.items,i=e.collection,o=e.vc,a={},s=[],l=0,u=r.length;l<u;l++){i[t=r[l].key]||(i[t]=o()),n=r[l].values||[r[l].value];for(var c=0;c<n.length;c++)i[t].add(n[c])&&(a[t]=a[t]||[],a[t].push(n[c]))}for(var d=Object.keys(a),f=0,p=d.length;f<p;f++)t=d[f],s.push({id:t,values:a[t]});return s}function oa(e){for(var t,n,r=e.items,i=e.collection,o={},a=[],s=0,l=r.length;s<l;s++)if(i[t=r[s].key]){n=r[s].values||[r[s].value];for(var u=0;u<n.length;u++)i[t].remove(n[u])&&(o[t]=o[t]||[],o[t].push(n[u]))}for(var c=Object.keys(o),d=0,f=c.length;d<f;d++)t=c[d],a.push({id:t,values:o[t]});return a}function aa(e){for(var t,n,r={},i=0,o=e.length;i<o;i++){t=e[i].key,n=e[i].values||[e[i].value],r[t]||(r[t]=[]);for(var a=0;a<n.length;a++){-1===r[t].indexOf(n[a])&&r[t].push(n[a])}}return r}function sa(e){var t=e.key,n=e.collection,r=e.obj,i=e.fn,o=e.value;n[t]||(n[t]=i()),r[t]=r[t]||[],r[t].push(o),n[t].add(o)}function la(e){for(var t,n,r,i=e.items,o=e.values,a=e.vc,s={},l={},u=[],c=[],d=aa(i),f=Object.keys(d),p=0,h=f.length;p<h;p++)for(var m=0,g=(r=d[t=f[p]]).length;m<g;m++)n=r[m],o[t]&&o[t].contains(n)?o[t]&&o[t].contains(n)&&(l[t]=l[t]||[],l[t].push(n),o[t].remove(n)):sa({key:t,value:n,collection:o,obj:s,fn:a});for(var v=Object.keys(s),y=0,b=v.length;y<b;y++)t=v[y],u.push({id:t,values:s[t]});for(var x=Object.keys(l),w=0,k=x.length;w<k;w++)t=x[w],c.push({id:t,values:l[t]});return[u,c]}function ua(e,t){for(var n,r,i=[],o=Object.keys(e),a=function(e){return-1===t[n].indexOf(e)},s=0,l=o.length;s<l;s++)n=o[s],t[n]?(r=e[n].filter(a)).length&&i.push({id:n,values:r}):i.push({id:n,values:e[n]});return i}function ca(e){for(var t,n,r=e.items,i=e.vCollection,o=e.vc,a={},s=aa(r),l={},u=Object.keys(i),c=0,d=u.length;c<d;c++)l[n=u[c]]=i[n].values().slice(),delete i[n];for(var f=function(e){i[n]&&i[n].contains(e)||sa({key:n,value:e,collection:i,obj:a,fn:o})},p=Object.keys(s),h=0,m=p.length;h<m;h++)s[n=p[h]].forEach(f);return t=ua(l,a),[ua(a,l),t]}function da(e,t,n){var r=function(e,t){if(!Object.keys(t).length)return e;for(var n=e.length,r=Array(n),i=0;i<n;i++)r[i]=e[i].key in t?D({},e[i],{key:t[e[i].key]}):e[i];return r}(t,n);return e&&e.length?e.reduce((function(e,t){return t(e)}),r):r}function fa(e){return e.replace(/(-[a-z])/g,(function(e){return e.toUpperCase().replace("-","")}))}function pa(e){return e.replace(/([A-Z])/g,(function(e){return"-".concat(e.toLowerCase())}))}function ha(e,t,n){var r=n.ranges,i=n.interceptors,o=n.rc,a=n.aliases,s=n.rangeConfig,l=da(i["".concat(t,"Ranges")],e,a),u=!1;return l.forEach((function(e){var n=e.key;if(r[n]||(r[n]=o(s.sources[n]||s.default)),"set"===t)u=r[n][t](e.ranges||e.range)||u;else for(var i=e.ranges||[e.range],a=0;a<i.length;a++)u=r[n][t](i[a])||u})),u}function ma(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vc,n=void 0===t?na:t,r=e.rc,i=void 0===r?ta:r,o=!1,a={},s={},l={},u={sources:{},default:D({},ra)},c={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},d=function(){var e={values:{},ranges:{}};return Object.keys(s).forEach((function(t){e.values[t]=s[t].values()})),Object.keys(a).forEach((function(t){e.ranges[t]=a[t].ranges()})),e},f={ls:[],clear:function(){this.ls.forEach((function(e){return e.clear()}))},start:function(){this.ls.forEach((function(e){return e.start()}))},end:function(){this.ls.forEach((function(e){return e.end()}))},update:function(){var e=d();this.ls.forEach((function(t){return t._state(e)}))},updateValues:function(){var e=d();this.ls.forEach((function(t){return t._state({values:e.values})}))},updateRanges:function(){var e=d();this.ls.forEach((function(t){return t._state({ranges:e.ranges})}))}},p={configure:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(u={sources:{},default:D({},ra)},e.ranges.forEach((function(e){var t={};Object.keys(ra).filter((function(e){return"key"!==e})).forEach((function(n){t[n]=void 0!==e[n]?e[n]:ra[n]})),void 0!==e.key?u.sources[e.key]=t:u.default=t})),Object.keys(a).forEach((function(e){return a[e].configure(u.sources[e]||u.default)})),p.emit("update",[],[]))},link:function(e){if(p===e)throw new Error("Can't link to self");f.ls.push(e),e._state(d())},_state:function(e){if(!e)return d();if(e.values){var t=[];Object.keys(e.values).forEach((function(n){s[n]&&e.values[n].join(";")===s[n].toString()||t.push({key:n,values:e.values[n]})})),Object.keys(s).forEach((function(n){e.values[n]||t.push({key:n,values:[]})})),t.length&&p.setValues(t)}if(e.ranges){var n=[];Object.keys(e.ranges).forEach((function(t){a[t]&&e.ranges[t].join(";")===a[t].toString()||n.push({key:t,ranges:e.ranges[t]})})),Object.keys(a).forEach((function(t){e.ranges[t]||n.push({key:t,ranges:[]})})),n.length&&p.setRanges(n)}},start:function(){if(!o){o=!0;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];p.emit.apply(p,["start"].concat(t)),f.start()}},end:function(){if(o){o=!1,a={},s={};for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];p.emit.apply(p,["end"].concat(t)),f.end()}},isActive:function(){return o},clear:function(){var e=p.brushes().filter((function(e){return"value"===e.type&&e.brush.values().length})).map((function(e){return{id:e.id,values:e.brush.values()}})),t=Object.keys(a).length>0||e.length;a={},s={},t&&(p.emit("update",[],e),f.clear())},brushes:function(){var e=[];return e=(e=e.concat(Object.keys(a).map((function(e){return{type:"range",id:e,brush:a[e]}})))).concat(Object.keys(s).map((function(e){return{type:"value",id:e,brush:s[e]}})))},addValue:function(e,t){p.addValues([{key:e,value:t}])},addValues:function(e){var t=da(c.addValues,e,l),r=ia({vc:n,collection:s,items:t});p.emit("add-values",t),r.length&&(o||(o=!0,p.emit("start")),p.emit("update",r,[]),f.updateValues())},setValues:function(e){var t=da(c.setValues,e,l),r=ca({items:t,vCollection:s,vc:n});p.emit("set-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,p.emit("start")),p.emit("update",r[0],r[1]),f.updateValues())},removeValue:function(e,t){p.removeValues([{key:e,value:t}])},removeValues:function(e){var t=da(c.removeValues,e,l),n=oa({collection:s,items:t});p.emit("remove-values",t),n.length&&(p.emit("update",[],n),f.updateValues())},addAndRemoveValues:function(e,t){var r=da(c.addValues,e,l),i=da(c.removeValues,t,l),a=ia({vc:n,collection:s,items:r}),u=oa({collection:s,items:i});p.emit("add-values",r),p.emit("remove-values",i),(a.length||u.length)&&(o||(o=!0,p.emit("start")),p.emit("update",a,u),f.updateValues())},toggleValue:function(e,t){p.toggleValues([{key:e,value:t}])},toggleValues:function(e){var t=da(c.toggleValues,e,l),r=la({items:t,values:s,vc:n});p.emit("toggle-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,p.emit("start")),p.emit("update",r[0],r[1]),f.updateValues())},containsValue:function(e,t){var n=l[e]||e;return!!s[n]&&s[n].contains(t)},addRange:function(e,t){p.addRanges([{key:e,range:t}])},addRanges:function(e){ha(e,"add",{ranges:a,rc:i,interceptors:c,aliases:l,rangeConfig:u})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),f.updateRanges())},removeRange:function(e,t){p.removeRanges([{key:e,range:t}])},removeRanges:function(e){ha(e,"remove",{ranges:a,rc:i,interceptors:c,aliases:l,rangeConfig:u})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),f.updateRanges())},setRange:function(e,t){p.setRanges([{key:e,range:t}])},setRanges:function(e){ha(e,"set",{ranges:a,rc:i,interceptors:c,aliases:l,rangeConfig:u})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),f.updateRanges())},toggleRange:function(e,t){p.toggleRanges([{key:e,range:t}])},toggleRanges:function(e){ha(e,"toggle",{ranges:a,rc:i,interceptors:c,aliases:l,rangeConfig:u})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),f.updateRanges())},containsRangeValue:function(e,t){var n=l[e]||e;return!!a[n]&&a[n].containsValue(t)},containsRange:function(e,t){var n=l[e]||e;return!!a[n]&&a[n].containsRange(t)},containsMappedData:function(e,t,n){for(var r,i,o,u,c=[],d=Object.keys(e),f=0,p=d.length;f<p;f++){if("value"===(r=d[f]))i=e,c[f]={key:"",i:f,bool:!1};else{if("source"===r)continue;i=e[r],c[f]={key:r,i:f,bool:!1}}void 0!==(o=i.source&&i.source.field)&&(void 0!==i.source.key&&(o="".concat(i.source.key,"/").concat(o)),o in l&&(o=l[o]),u=i.value,a[o]?c[f].bool=Array.isArray(u)?a[o].containsRange({min:u[0],max:u[1]}):a[o].containsValue(u):s[o]&&s[o].contains(u)&&(c[f].bool=!0))}return t?(c=c.filter((function(e){return-1!==t.indexOf(e.key)})),"and"===n?!!c.length&&!c.some((function(e){return!1===e.bool})):"xor"===n?!!c.length&&c.some((function(e){return e.bool}))&&c.some((function(e){return!1===e.bool})):c.some((function(e){return e.bool}))):c.some((function(e){return e.bool}))},intercept:function(e,t){var n=fa(e);c[n]&&c[n].push(t)},removeInterceptor:function(e,t){var n=fa(e);if(c[n]){var r=c[n].indexOf(t);-1!==r&&c[n].splice(r,1)}},removeAllInterceptors:function(e){var t=[];if(e){var n=fa(e);c[n]&&c[n].length&&t.push({name:e,handlers:c[n]})}else Object.keys(c).forEach((function(e){c[e].length&&t.push({name:pa(e),handlers:c[e]})}));t.forEach((function(e){e.handlers.slice().forEach((function(t){return p.removeInterceptor(e.name,t)}))}))},addKeyAlias:function(e,t){l[e]=t},removeKeyAlias:function(e){delete l[e]}};return $o(p),p}function ga(e){return e*e*e}function va(e){return--e*e*e+1}function ya(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}function ba(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}ft();var xa={shouldBeRemoved:!1,isInit:!1};function wa(e,t,n){var r,i=e.old,o=e.current,a=t.renderer,s=[],l={nodes:[],ips:[]},u={nodes:[],ips:[]},c={nodes:[],ips:[]},d=[],f=null,p=n.trackBy||ba,h={start:function(){var e={};if(i.forEach((function(t,n){var r=p(t,n);e[r]=t})),o.forEach((function(t,n){var r=p(t,n);e[r]?(c.ips.push(Fi(e[r],t)),c.nodes.push(t),s.push(e[r]),e[r]=!1):(l.nodes.push(t),l.ips.push(Fi(D({},t,{r:.001,opacity:0}),t)))})),Object.keys(e).forEach((function(t){e[t]&&(u.nodes.push(e[t]),u.ips.push(Fi(e[t],D({},e[t],{r:1e-4,opacity:0}))))})),d.push({name:"exiting",easing:ga,duration:200,tweens:u.ips,nodes:[].concat(s)}),d.push({name:"updating",easing:ya,duration:400,tweens:c.ips,nodes:[]}),d.push({name:"entering",easing:va,duration:200,tweens:l.ips,nodes:X(c.nodes)}),n.isMainComponent){var t,m=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,g=m?s.filter(m).length:s.length;!1===xa.isInit?(xa.shouldBeRemoved=0===g,xa.isInit=!0):xa.shouldBeRemoved=xa.shouldBeRemoved&&0===g}d.length&&(f=a.getScene(o),d[0].started=Date.now(),"undefined"!=typeof window&&(r=window.requestAnimationFrame(h.tick)))},tick:function(){var e=d[0];e||h.stop(),e.started||(e.started=Date.now());var t=(Date.now()-e.started)/e.duration,n=[],i=e.tweens.map((function(n){return n(e.easing(Math.min(1,t)))}));n.push.apply(n,X(i)),n.push.apply(n,X(e.nodes)),a.render(n),t>=1&&(d.shift(),d.length?"updating"===d[0].name&&xa.shouldBeRemoved&&d.shift():(!0===xa.isInit&&(xa.isInit=!1),h.stop())),r&&(r=window.requestAnimationFrame(h.tick))},stop:function(){r&&(window.cancelAnimationFrame(r),r=!1)},inProgress:function(){return!!r},get targetScene(){return f}};return h}var ka={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},Ca=/^\$/;function Sa(e){var t=R(e);return"object"!==t&&"function"!==t&&"undefined"!==t}function Ea(e,t,n){var r=e[t];r&&r.scale&&r.scale.pxScale?r.scale=r.scale.pxScale(n):r&&r.pxScale&&(e[t]=r.pxScale(n))}function Ma(e,t){return e.pxScale?e.pxScale(t):e}var Ta={normalizeSettings:function(e,t,n){var r=D({},e),i=D({},t);return Object.keys(r).forEach((function(e){i[e]={};var o=r[e],a=R(o);if("function"==typeof o)i[e].fn=o;else if(Sa(o)){var s=t[e];"string"==typeof s&&Ca.test(s)&&(s=ka[s]);var l=R(s);i[e]="undefined"===l||l===a?o:s}else o&&"object"===R(o)&&("function"==typeof o.fn&&(i[e].fn=o.fn),void 0!==o.scale&&(i[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(i[e].ref=o.ref))})),Object.keys(t).forEach((function(e){if(!(e in r)){var n=t[e];"string"===R(n)&&Ca.test(n)?i[e]=ka[n]:i[e]=n}})),i},resolveForItem:function(e,t,n){for(var r={},i=Object.keys(t),o=i.length,a=e.datum,s=e.datum,l=0;l<o;l++){var u=i[l],c=t[u],d="object"===R(s)&&void 0!==c,f=d&&"string"==typeof c.ref,p=d&&u in s,h=f?s[c.ref]:p?s[u]:a;Sa(c)?r[u]=c:d&&c.fn?(c.scale&&(e.scale=c.scale),r[u]=c.fn.call(null,e,n)):d&&c.scale&&h?(r[u]=c.scale(h.value),c.scale.bandwidth&&(r[u]+=c.scale.bandwidth()/2)):f&&h?r[u]=h.value:c.fn?r[u]=c.fn.call(null,e,n):r[u]=c}return r},updateScaleSize:Ea};function Da(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ta,n={};function r(r){var i=r.data,o=r.settings,a=r.defaults,s=void 0===a?{}:a,l=r.scaled,u=n.norm=t.normalizeSettings(o,s,e.chart),c={scale:e.chart.scale,formatter:e.chart.formatter};l&&Object.keys(l).forEach((function(e){u[e]&&t.updateScaleSize(u,e,l[e])}));var d=[];if(!i||!Array.isArray(i.items)){var f={data:i,resources:c},p=t.resolveForItem(f,n.norm,-1);return{settings:n.norm,item:p}}for(var h,m=0,g=i.items.length;m<g;m++){h={datum:i.items[m],data:i,resources:c};var v=t.resolveForItem(h,n.norm,m);v.data=i.items[m],d.push(v)}return{settings:n.norm,items:d}}return{resolve:r}}function _a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce((function(e,t){return Array.isArray(t.children)?(e.push.apply(e,X(_a(t.children))),e):(e.push(t),e)}),[])}function Na(e,t){var n=t.context,r=t.data,i=t.style,o=t.filter,a=t.mode,s=e.chart.brush(n),l=r,u=i.active||{},c=i.inactive||{},d=[];Object.keys(u).forEach((function(e){d.push(e)})),Object.keys(c).forEach((function(e){-1===d.indexOf(e)&&d.push(e)}));var f=[],p=!1,h=function(){var t=_a(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=function(){for(var e,t=h(),n=t.length,r=!1,i="function"==typeof l?l({brush:s}):l,o=function(n){if(!(e=t[n].data))return"continue";t[n].__style||(t[n].__style={},d.forEach((function(e){t[n].__style[e]=t[n][e]})));var r=s.containsMappedData(e,i,a),o=f.indexOf(t[n]),l=!1;r&&-1===o?(f.push(t[n]),l=!0):r||-1===o||(f.splice(o,1),l=!0),t[n].needToUpdate=l||p,t[n].isActive=r},m=0;m<n;m++)o(m);for(var g=function(n){if(!(e=t[n].data))return"continue";if(t[n].needToUpdate){var i=D({},t[n],t[n].__style),o=t[n].isActive;d.forEach((function(e){t[n][e]=o&&e in u?"function"==typeof u[e]?u[e].call(null,i,f):u[e]:!o&&e in c?"function"==typeof c[e]?c[e].call(null,i,f):c[e]:t[n].__style[e]})),r=!0}delete t[n].needToUpdate},v=0;v<n;v++)g(v);return p=!1,r},g=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1},n=t.suppressRender,r=h(),i=r.length,o=function(e){if(!r[e].data)return"continue";r[e].__style=r[e].__style||{},d.forEach((function(t){r[e].__style[t]=r[e][t],t in c&&(r[e][t]="function"==typeof c[t]?c[t].call(null,r[e]):c[t])}))},a=0;a<i;a++)o(a);p=!0,f.length=0,n||e.renderer.render(e.nodes)},v=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1},n=t.suppressRender,r=h(),i=r.length,o=function(e){r[e].__style&&(Object.keys(r[e].__style).forEach((function(t){r[e][t]=r[e].__style[t]})),r[e].__style=void 0)},a=0;a<i;a++)o(a);f.length=0,n||e.renderer.render(e.nodes)},y=function(){if(m()){var t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return s.on("start",g),s.on("end",v),s.on("update",y),{isActive:function(){return s.isActive()},update:function(){f.length=0,p=!0,m()},cleanUp:function(){s.removeListener("start",g),s.removeListener("end",v),s.removeListener("update",y)}}}function qa(e){for(var t=e.nodes,n=e.action,r=e.chart,i=e.trigger,o=[],a=0;a<t.length;a++){var s=t[a].data;null!==s&&o.push(s)}!function(e){var t=e.dataPoints,n=e.action,r=e.chart,i=e.trigger;if(i){var o=i.data||[""],a={items:[],actionFn:"toggleRanges"},s={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(a.actionFn="".concat(n,"Ranges"),s.actionFn="".concat(n,"Values"));for(var l=function(e){var n=t[e];if(!n)return"continue";o.forEach((function(e){var t=n&&!e?n:n[e];if(t){var r={key:t.source.field};void 0!==t.source.key&&(r.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(r.range={min:t.value[0],max:t.value[1]},a.items.push(r)):(r.value=t.value,s.items.push(r))}}))},u=0;u<t.length;u++)l(u);i.contexts.forEach((function(e){a.items.length?r.brush(e)[a.actionFn](a.items):r.brush(e)[s.actionFn](s.items)}))}}({dataPoints:o,action:n,chart:r,trigger:i})}function Ra(e){var t=e.collisions,n=e.t,r=e.config,i=e.action,o=[],a=!1;return t.length>0&&(o=t,a=!0,"stop"===n.propagation&&(o=[t[t.length-1]])),qa({nodes:o.map((function(e){return e.node})),action:i,chart:r.chart,data:r.data,trigger:n}),a}function Pa(e,t,n){var r=n.element().getBoundingClientRect(),i=J(e)?function(e,t){return 1!==e.changedTouches.length?null:{x:e.changedTouches[0].clientX-t.left,y:e.changedTouches[0].clientY-t.top}}(e,r):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,r);return null===i||i.x<0||i.y<0||i.x>r.width||i.y>r.height?[]:(t.touchRadius>0&&J(e)?i={cx:i.x,cy:i.y,r:t.touchRadius}:t.mouseRadius>0&&!J(e)&&(i={cx:i.x,cy:i.y,r:t.mouseRadius}),n.itemsAt(i))}function Aa(e,t,n){return e?"function"==typeof e?e(t):e:n}function Ia(e){var t=e.e,n=e.t,r=e.config;return Ra({collisions:Pa(t,n,r.renderer),t:n,config:r,action:Aa(n.action,t,"toggle")})}function Oa(e){var t=e.e,n=e.t,r=e.config;return Ra({collisions:Pa(t,n,r.renderer),t:n,config:r,action:Aa(n.action,t,"set")})}var La={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",baseline:"dominant-baseline",dominantBaseline:"dominant-baseline",anchor:"text-anchor",textAnchor:"text-anchor",maxWidth:"maxWidth",transform:"transform",strokeDasharray:"stroke-dasharray",id:"id"};function za(e,t){Object.keys(La).forEach((function(n){var r=t[n];void 0!==r&&(e[La[n]]=r)}))}function Fa(e){for(var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="",r=0;r<e.length;r++){var i=e[r];n+=0===r?"M".concat(i.x," ").concat(i.y):"L".concat(i.x," ").concat(i.y),n+=" "}return t&&(n+="Z"),n}function ja(e,t,n,r){var i=n/2,o=e-r/2,a=t-r/2,s=e-i,l=t-i;return[{x:o,y:a},{x:o,y:l},{x:o+r,y:l},{x:o+r,y:a},{x:s+n,y:a},{x:s+n,y:a+r},{x:o+r,y:a+r},{x:o+r,y:l+n},{x:o,y:l+n},{x:o,y:a+r},{x:s,y:a+r},{x:s,y:a}]}function Ha(e){return-e/180*Math.PI}function Ba(e){return function(e){var t=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(t-e))*Math.sqrt(2),r=n*Math.cos(e),i=n*Math.sin(e);return{x1:r<0?1:0,y1:i<0?1:0,x2:r>=0?r:r+1,y2:i>=0?i:i+1}}(Ha(e))}function Va(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Wa(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ua(e,t){return{x:e.x*t,y:e.y*t}}function $a(e,t){return e.x-t.x}function Ya(e,t){return e.y-t.y}function Xa(e,t){return Math.pow($a(e,t),2)+Math.pow(Ya(e,t),2)}function Ka(e,t){return Math.sqrt(Xa(e,t))}function Ga(e,t){return e.x*t.x+e.y*t.y}function Ja(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0},r=Math.cos(t),i=Math.sin(t),o=Wa(e,n),a={x:r*o.x-i*o.y,y:i*o.x+r*o.y};return Va(a,n)}var Za={up:0,down:180,left:90,right:-90};function Qa(e){var t=e.x,n=e.y,r=e.size,i=r/2;return{type:"rect",x:t-i,y:n-i,width:r,height:r}}var es=ft();function ts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach((function(n){void 0!==La[n]&&"transform"!==n&&(e[n]=t[n])}))}es.add("circle",(function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}})),es.add("diamond",(function(e){var t=e.size,n=e.x-t/2,r=e.y-t/2;return{type:"path",fill:"black",d:Fa([{x:n,y:r+t/2},{x:n+t/2,y:r},{x:n+t,y:r+t/2},{x:n+t/2,y:r+t},{x:n,y:r+t/2}])}})),es.add("saltire",(function(e){var t=Ha(45),n=e.size/2,r=isNaN(e.width)?n/2:e.width,i=Math.min(r,n),o=e.size,a=Math.sin(Math.asin(-t))*(i/2);o+=2*(n/Math.sin(-t)-n),o-=2*a;var s={x:e.x,y:e.y};return{type:"path",fill:"black",d:Fa(ja(e.x,e.y,o,i).map((function(e){return Ja(e,t,s)})))}})),es.add("square",(function(e){var t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}})),es.add("triangle",(function(e){var t=e.size,n={x:e.x,y:e.y},r=Za[e.direction]||0,i=t/2,o=e.x-i,a=e.y-i,s=[{x:o,y:a+t},{x:o+i,y:a},{x:o+t,y:a+t},{x:o,y:a+t}],l=Ha(r);return{type:"path",fill:"black",d:Fa(s=s.map((function(e){return Ja(e,l,n)})))}})),es.add("line",(function(e){var t="vertical"===e.direction,n=e.size/2,r=e.x,i=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:r-(t?0:n),y1:i-(t?n:0),x2:r+(t?0:n),y2:i+(t?n:0),collider:Qa(e)}})),es.add("star",(function(e){for(var t=e.size,n=[],r=t/2,i=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,a=isNaN(e.startAngle)?90:e.startAngle,s=360/i,l=1;l<=i;l++){var u=s*l+a,c=Ha(u),d=Ha(u+s/2),f=Math.sin(c),p=Math.cos(c),h=Math.sin(d),m=Math.cos(d);n.push({x:e.x+p*r,y:e.y+f*r}),n.push({x:e.x+m*o,y:e.y+h*o})}return{type:"path",fill:"black",d:Fa(n)}})),es.add("n-polygon",(function(e){for(var t=[],n=e.size/2,r=Math.max(isNaN(e.sides)?6:e.sides,3),i=360/r,o=isNaN(e.startAngle)?0:e.startAngle,a=1;a<=r;a++){var s=Ha(i*a+o),l=Math.sin(s),u=Math.cos(s);t.push({x:e.x+u*n,y:e.y+l*n})}return{type:"path",fill:"black",d:Fa(t)}})),es.add("cross",(function(e){var t=e.x,n=e.y,r=e.size/2,i=isNaN(e.width)?r/2:e.width,o=Math.min(i,r);return{type:"path",fill:"black",d:Fa(ja(t,n,e.size,o))}})),es.add("bar",(function(e){var t={x:e.x,y:e.y},n="vertical"===e.direction,r=e.size/2,i=r/2/2,o=[{x:t.x-r,y:t.y+i},{x:t.x-r,y:t.y-i},{x:t.x+r,y:t.y-i},{x:t.x+r,y:t.y+i}];if(n){var a=Ha(90);o=o.map((function(e){return Ja(e,a,t)}))}var s=re(o);return s.type="rect",s.fill="black",s})),es.add("rect",(function(e){var t=e.x,n=e.y,r=e.size,i=void 0===e.width?r:e.width,o=void 0===e.height?r:e.height;return{type:"rect",fill:"black",x:t-i/2,y:n-o/2,width:i,height:o}}));var ns=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:es;return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.get(t.type);if(n){var r=n(t);return ts(r,t),void 0!==t.data&&(r.data=t.data),r}return n}};function rs(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.dock,r=void 0===n?"center":n,i=e.displayOrder,o=void 0===i?0:i,a=e.prioOrder,s=void 0===a?0:a,l=e.preferredSize,u=void 0===l?0:l,c=e.minimumLayoutMode,d=e.show,f=void 0===d||d;r=r||"center";var p={computePreferredSize:function(e){var n=e.inner,r=e.outer,i=e.children;return"function"==typeof u?u({inner:n,outer:r,children:i,dock:this.dock()},t):u},dock:function(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},displayOrder:function(e){return void 0!==e?(o=e,this):"function"==typeof o?o(t):o},prioOrder:function(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s},minimumLayoutMode:function(e){return void 0!==e?(c=e,this):"function"==typeof c?c(t):c},show:function(e){return void 0!==e?(f=e,this):"function"==typeof f?f(t):f}};return p}function is(e,t,n){var r=t.require,i=void 0===r?[]:r,o=t.mediator||{},a=n.settings,s=n.formatter,l=n.scale,u=n.data,c=n.renderer,d=n.chart,f=n.dockConfig,p=n.mediator,h=n.instance,m=n.rect,g=n.style,v=n.registries,y=n.resolver,b=n.update,x=n._DO_NOT_USE_getInfo,w=n.symbol,k=n.isVisible;e.emit=function(){},k&&(e.isVisible=k),Object.defineProperty(e,"settings",{get:a}),Object.defineProperty(e,"data",{get:u}),Object.defineProperty(e,"formatter",{get:s}),Object.defineProperty(e,"scale",{get:l}),Object.defineProperty(e,"mediator",{get:p}),Object.defineProperty(e,"style",{get:g}),Object.defineProperty(e,"registries",{get:v}),m&&Object.defineProperty(e,"rect",{get:m}),x&&(e._DO_NOT_USE_getInfo=x),Object.keys(t).forEach((function(n){var r;r=n,["on","preferredSize","created","beforeMount","mounted","resize","beforeUpdate","updated","beforeRender","render","beforeUnmount","beforeDestroy","destroyed","defaultSettings","data","settings","formatter","scale","chart","dockConfig","mediator","style","resolver","registries","_DO_NOT_USE_getInfo","symbol","isVisible"].some((function(e){return e===r}))||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])})),i.forEach((function(t){"renderer"===t?Object.defineProperty(e,"renderer",{get:c}):"chart"===t?Object.defineProperty(e,"chart",{get:d}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:f}):"instance"===t?Object.defineProperty(e,"instance",{get:h}):"update"===t&&b?Object.defineProperty(e,"update",{get:b}):"resolver"===t?Object.defineProperty(e,"resolver",{get:y}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:w})})),Object.keys(o).forEach((function(t){e.mediator.on(t,o[t].bind(e))}))}function os(e,t,n){var r=function(t){return e[t]?(n.warn("Deprecation Warning the ".concat(t," property should be moved into layout: {} property")),e[t]):e.layout?e.layout[t]:void 0},i={};return i.displayOrder=r("displayOrder"),i.dock=r("dock"),i.prioOrder=r("prioOrder"),i.minimumLayoutMode=r("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==i.displayOrder?i.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==i.prioOrder?i.prioOrder:e.layout.prioOrder,e.layout.dock=i.dock||e.layout.dock,e.layout.minimumLayoutMode=i.minimumLayoutMode||e.layout.minimumLayoutMode,i.show=e.show,i.preferredSize=t,i}function as(e,t,n){Object.keys(n.on||{}).forEach((function(r){e.eventListeners=e.eventListeners||[];var i=n.on[r].bind(e);e.eventListeners.push({event:r,listener:i}),t.on(r,i)})),e.emit=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.emit.apply(t,[e].concat(r))}}function ss(e,t){e.eventListeners&&(e.eventListeners.forEach((function(e){var n=e.event,r=e.listener;t.removeListener(n,r)})),e.eventListeners.length=0),e.emit=function(){}}function ls(e,t,n){return Va(function(e,t){var n=Ga(e,t)/Ga(t,t)||1;return{x:t.x*n,y:t.y*n}}(Wa(n,e),Wa(t,e)),e)}function us(e,t,n){return Ka(e,n)+Ka(t,n)-Ka(e,t)<1e-12}function cs(e,t){return e.x>=t.x&&e.x+e.width<=t.x+t.width&&e.y>=t.y&&e.y+e.height<=t.y+t.height}function ds(e){return e.x1===e.x2&&e.y1===e.y2}function fs(e){return e.width<=0||e.height<=0}function ps(e){return e.r<=0}function hs(e){return e.edges.length<=2}function ms(e,t){for(var n=0,r=t.edges.length;n<r;n++)if(!0===ks(e,ie(t.edges[n])))return!0;return!1}function gs(e,t){for(var n=t.numPolygons,r=t.polygons,i=0;i<n;i++){if(!0===qs(e,r[i]))return!0}return!1}function vs(e,t){return!ps(e)&&Xa({x:e.cx,y:e.cy},t)<=Math.pow(e.r,2)}function ys(e,t){if(fs(t)||ps(e))return!1;var n=t.width/2,r=t.height/2,i=t.x+n,o=t.y+r,a=e.r,s=e.cx,l=e.cy,u=Math.abs(s-i),c=Math.abs(l-o);return!(u>n+a||c>r+a)&&(u<=n||c<=r||Math.pow(u-n,2)+Math.pow(c-r,2)<=Math.pow(a,2))}function bs(e,t){if(ps(e)||ds(t))return!1;var n=Y(te(t),2),r=n[0],i=n[1];if(vs(e,r)||vs(e,i))return!0;var o={x:e.cx,y:e.cy},a=ls(r,i,o);return Xa(a,o)<=Math.pow(e.r,2)&&us(r,i,a)}function xs(e,t){if(hs(t)||ps(e))return!1;if(ws(t,{x:e.cx,y:e.cy}))return!0;for(var n=t.edges.length,r=0;r<n;r++){if(bs(e,ie(t.edges[r])))return!0}return!1}function ws(e,t){if(hs(e)||!Ms(e.boundingRect(),t))return!1;var n,r,i,o,a,s=t.x,l=t.y,u=e.vertices;for(n=!1,o=-1,i=(r=u.length)-1;++o<r;i=o){if(u[o].x===s&&u[o].y===l)return!0;if(u[o].y===u[i].y&&u[o].y===l&&(s-u[o].x)*(s-u[i].x)<=0)return!0;if(u[o].y<l&&l<=u[i].y||u[i].y<l&&l<=u[o].y){if(s===(a=(u[i].x-u[o].x)*(l-u[o].y)/(u[i].y-u[o].y)+u[o].x))return!0;s<a&&(n=!n)}}return n}function ks(e,t){if(hs(e))return!1;for(var n=0,r=e.edges.length;n<r;n++){if(Ds(t,ie(e.edges[n])))return!0}var i=Y(te(t),2),o=i[0],a=i[1];return ws(e,o)||ws(e,a)}function Cs(e,t){if(hs(e))return!1;for(var n=0,r=e.edges.length;n<r;n++){if(Ts(t,ie(e.edges[n])))return!0}var i=Y(ne(t),4),o=i[0],a=i[1],s=i[2],l=i[3];return ws(e,o)||ws(e,a)||ws(e,s)||ws(e,l)}function Ss(e,t){return!fs(e)&&!fs(t)&&(e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height)}function Es(e,t){return!fs(e)&&!fs(t)&&[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}].every((function(t){return Ms(e,t)}))}function Ms(e,t){return!fs(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function Ts(e,t){if(ds(t)||fs(e))return!1;var n=Y(te(t),2),r=n[0],i=n[1];if(Ms(e,r)||Ms(e,i))return!0;for(var o=ne(e),a=o.length,s=0;s<a;s++){if(Ds(ie([o[s],o[3!==s?s+1:0]]),t))return!0}return!1}function Ds(e,t){var n,r,i=Y(te(e),2),o=i[0],a=i[1],s=Y(te(t),2),l=s[0],u=s[1],c=$a(a,o),d=Ya(a,o),f=$a(u,l),p=Ya(u,l),h=$a(o,l),m=Ya(o,l),g=p*c-f*d,v=f*m-p*h,y=c*m-d*h;if(0===c&&0===d)return!1;if(0===f&&0===p)return!1;if(0===g){if(0===v&&0===y){if(0===c){if(0===d)return o.x===a.x&&o.y===a.y;n=Ya(l,o)/d,r=Ya(u,o)/d}else n=(l.x-o.x)/c,r=(u.x-o.x)/c;return!(n<0&&r<0||n>1&&r>1)}return!1}var b=v/g;return g=y/g,b>=0&&b<=1&&g>=0&&g<=1}function _s(e,t){if(ds(e))return!1;var n=Y(te(e),2);return us(n[0],n[1],t)}function Ns(e,t){var n=e.boundingRect(),r=t.boundingRect();return!!Ss(n,r)&&(Es(n,r)?ms(e,t):ms(t,e))}function qs(e,t){var n=e.boundingRect(),r=t.boundingRect();return!!Ss(n,r)&&(Es(r,n)?function(e,t){for(var n=e.numPolygons,r=e.polygons,i=0;i<n;i++)if(!0===Ns(t,r[i]))return!0;return!1}(e,t):function(e,t){for(var n=0,r=t.edges.length;n<r;n++)if(!0===As(e,ie(t.edges[n])))return!0;return!1}(e,t))}function Rs(e,t){if(ps(e))return!1;if(Ps(t,{x:e.cx,y:e.cy}))return!0;for(var n=t.numPolygons,r=t.polygons,i=0;i<n;i++)for(var o=r[i],a=o.edges.length,s=0;s<a;s++){if(bs(e,ie(o.edges[s])))return!0}return!1}function Ps(e,t){if(!Ms(e.boundingRect(),t))return!1;var n,r,i,o,a,s,l=t.x,u=t.y,c=e.numPolygons,d=!1;for(r=0;r<c;r++)for(a=-1,o=(i=(n=e.vertices[r]).length)-1;++a<i;o=a){if(n[a].x===l&&n[a].y===u)return!0;if(n[a].y===n[o].y&&n[a].y===u&&(l-n[a].x)*(l-n[o].x)<=0)return!0;if(n[a].y<u&&u<=n[o].y||n[o].y<u&&u<=n[a].y){if(l===(s=(n[o].x-n[a].x)*(u-n[a].y)/(n[o].y-n[a].y)+n[a].x))return!0;l<s&&(d=!d)}}return d}function As(e,t){var n=Y(te(t),2),r=n[0],i=n[1];if(Ps(e,r)||Ps(e,i))return!0;for(var o=e.numPolygons,a=e.polygons,s=0;s<o;s++)for(var l=a[s],u=0,c=l.edges.length;u<c;u++){if(Ds(t,ie(l.edges[u])))return!0}return!1}function Is(e,t){var n=Y(ne(t),4),r=n[0],i=n[1],o=n[2],a=n[3];if(Ps(e,r)||Ps(e,i)||Ps(e,o)||Ps(e,a))return!0;for(var s=e.numPolygons,l=e.polygons,u=0;u<s;u++)for(var c=l[u],d=0,f=c.edges.length;d<f;d++){if(Ts(t,ie(c.edges[d])))return!0}return!1}var Os=/^\$/,Ls="@extend";function zs(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function Fs(e,t,n){if("string"==typeof e){var r=t[e];return-1!==n.indexOf(e)&&zs(e),Os.test(r)?(n.push(e),Fs(r,t,n)):r}var i=e,o=D(!0,{},t,e),a={};if(e[Ls]){var s=e[Ls];-1!==n.indexOf(s)&&zs(s);var l=n.slice();l.push(s),i=D(!0,{},Fs(o[s],t,l),e)}return Object.keys(i).forEach((function(e){var t=n.slice();if(e!==Ls&&!Os.test(e)){a[e]=i[e];var r=a[e];Os.test(r)&&r in o?(-1!==n.indexOf(r)&&zs(r),t.push(r),"object"===R(r=o[r])||Os.test(r)&&r in o?a[e]=Fs(r,o,t):a[e]=r):"object"===R(r)&&(a[e]=Fs(r,o,t))}})),a}function js(e,t){return Fs(e,t,[])}function Hs(e){e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height)}function Bs(e,t){var n={x:0,y:0,width:0,height:0},r={x:0,y:0,width:0,height:0};return n.width=e.width||0,n.height=e.height||0,void 0!==t.size&&(n.width=isNaN(t.size.width)?n.width:t.size.width,n.height=isNaN(t.size.height)?n.height:t.size.height),void 0!==t.logicalSize?(r.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,r.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,r.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),r.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(r.width=n.width,r.height=n.height,r.preserveAspectRatio=!1),Hs(r),Hs(n),{logicalContainerRect:r,containerRect:n}}function Vs(e){var t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return D(!0,t,e),t.center.minWidthRatio=Math.min(Math.max(t.center.minWidthRatio,0),1),t.center.minHeightRatio=Math.min(Math.max(t.center.minHeightRatio,0),1),t.center.minWidth=Math.max(t.center.minWidth,0),t.center.minHeight=Math.max(t.center.minHeight,0),t}function Ws(e,t,n,r,i){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:r,margin:isNaN(i)?0:i}}function Us(e,t,n){if(void 0===e.cachedSize){var r,i=e.config.dock(),o=e.comp.preferredSize({inner:t,outer:n,dock:i});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},r="top"===i||"bottom"===i?o.height:"right"===i||"left"===i?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(r),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function $s(e,t){switch(t.config.dock()){case"top":e.y+=t.cachedSize,e.height-=t.cachedSize;break;case"bottom":e.height-=t.cachedSize;break;case"left":e.x+=t.cachedSize,e.width-=t.cachedSize;break;case"right":e.width-=t.cachedSize}}function Ys(e,t){var n=t.edgeBleed;n&&(e.left=Math.max(e.left,n.left||0),e.right=Math.max(e.right,n.right||0),e.top=Math.max(e.top,n.top||0),e.bottom=Math.max(e.bottom,n.bottom||0))}function Xs(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);var r=e.width-(t.x+t.width);r<n.right&&(t.width-=n.right-r),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);var i=e.height-(t.y+t.height);i<n.bottom&&(t.height-=n.bottom-i)}function Ks(e,t,n,r,i){var o=D({},t),a=D({},n);return $s(o,r),Ys(a,r),Xs(e,o,a),!!function(e,t,n){var r=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),i=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=r&&t.height>=i}(e,o,i)&&($s(t,r),Ys(n,r),!0)}function Gs(e){var t=e.layoutRect,n=e.visible,r=e.hidden,i=e.settings,o=Ws(t.x,t.y,t.width,t.height),a={left:0,right:0,top:0,bottom:0},s=n.slice();s.sort((function(e,t){return e.config.prioOrder()-t.config.prioOrder()}));for(var l=0;l<s.length;++l){var u=s[l];Us(u,o,t),Ks(t,o,a,u,i)||(r.push(s.splice(l,1)[0]),--l)}!function(e,t){if(0!==t.length)for(var n=0;n<e.length;++n){var r=e[n];r.referencedDocks.length&&r.referencedDocks.every((function(e){return t.some((function(t){return t.key===e}))}))&&t.push(e.splice(n,1)[0])}}(n,r);var c=n.filter((function(e){return-1!==s.indexOf(e)}));return n.length=0,n.push.apply(n,X(c)),Xs(t,o,a),o}function Js(e){return{x:e.margin.left+e.x*e.scaleRatio.x,y:e.margin.top+e.y*e.scaleRatio.y,width:e.width*e.scaleRatio.x,height:e.height*e.scaleRatio.y}}function Zs(e){var t;return re((t=[]).concat.apply(t,X(e.map(ne))))}function Qs(e){var t=e.visible,n=e.layoutRect,r=e.reducedRect,i=e.containerRect,o=e.translation,a=Ws(r.x,r.y,r.width,r.height),s=Ws(r.x,r.y,r.width,r.height),l={},u=t.slice(),c=u.slice().sort((function(e,t){return e.config.displayOrder()-t.config.displayOrder()}));return t.sort((function(e,t){if(e.referencedDocks.length>0&&t.referencedDocks.length>0)return 0;if(t.referencedDocks.length>0)return-1;if(e.referencedDocks.length>0)return 1;var n=e.config.displayOrder()-t.config.displayOrder();return 0===n?u.indexOf(e)-u.indexOf(t):n})).forEach((function(e){var t={},u={};switch(e.config.dock()){case"top":t.height=u.height=e.cachedSize,t.width=n.width,u.width=a.width,t.x=n.x,u.x=a.x,t.y=u.y=a.y-e.cachedSize,a.y-=e.cachedSize,a.height+=e.cachedSize;break;case"bottom":t.x=n.x,u.x=a.x,t.y=u.y=a.y+a.height,t.width=n.width,u.width=a.width,t.height=u.height=e.cachedSize,a.height+=e.cachedSize;break;case"left":t.x=u.x=s.x-e.cachedSize,t.y=n.y,u.y=s.y,t.width=u.width=e.cachedSize,t.height=n.height,u.height=s.height,s.x-=e.cachedSize,s.width+=e.cachedSize;break;case"right":t.x=u.x=s.x+s.width,t.y=n.y,u.y=s.y,t.width=u.width=e.cachedSize,t.height=n.height,u.height=s.height,s.width+=e.cachedSize;break;case"center":t.x=u.x=r.x,t.y=u.y=r.y,t.width=u.width=r.width,t.height=u.height=r.height;break;default:if(e.referencedDocks.length>0){var c=e.referencedDocks.map((function(e){return l[e]})).filter((function(e){return!!e}));c.length>0&&(t=Zs(c.map((function(e){return e.outerRect}))),u=Zs(c.map((function(e){return e.r}))))}}e.key&&(l[e.key]={r:u,outerRect:t}),function(e,t,n,r){var i={x:r.width/n.width,y:r.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){var a=i.x<i.y,s=Math.min(i.x,i.y);i.x=s,i.y=s;var l=a?"height":"width",u=(r[l]-n[l]*i.x)*n.align;o.left=a?0:u,o.top=a?u:0}e.scaleRatio=i,e.margin=o,t.scaleRatio=i,t.margin=o,n.scaleRatio=i,n.margin=o}(u,t,n,i),u.edgeBleed=e.edgeBleed,u.computed=Js(u),t.edgeBleed=e.edgeBleed,t.computed=Js(t),u.x+=o.x,u.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(u,t),e.cachedSize=void 0,e.edgeBleed=void 0})),c}function el(e,t,n){var r=e.layoutModes||{},i=t.minimumLayoutMode(),o=t.show();return o&&"object"===R(i)?o=r[i.width]&&r[i.height]&&n.width>=r[i.width].width&&n.height>=r[i.height].height:o&&void 0!==i&&(o=r[i]&&n.width>=r[i].width&&n.height>=r[i].height),o}function tl(e){if(!e.resize||"function"!=typeof e.resize)throw new Error("Component is missing resize function");if(!e.dockConfig&&!e.preferredSize)throw new Error("Component is missing preferredSize function")}function nl(e,t,n){for(var r=[],i=[],o=0;o<e.length;++o){var a=e[o];tl(a);var s=a.dockConfig,l=a.key,u=s.dock(),c=/@/.test(u)?u.split(",").map((function(e){return e.replace(/^\s*@/,"")})):[];el(t,s,n)?r.push({comp:a,key:l,config:s,referencedDocks:c}):i.push({comp:a,key:l,config:s,referencedDocks:c})}return[r,i]}var rl=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.hasKey&&r.key===t)return e[n]}return null},il=function e(t){return null==t?void 0:t.map((function(t){var n=t.instance.dockConfig();return{preferredSize:function(r){return n.computePreferredSize(q(q({},r),{},{children:e(t.children)}))}}}))},ol=function(e,t){return{visible:[],hidden:t,ordered:[]}},al=function(e){return function(t,n){var r,i=n.map((function(e,t){var n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:function(t){return n.computePreferredSize(q(q({},t),{},{children:il(e.children)}))}}})),o=function(e){return n[e.index]},a=null!==(r=e(t,i))&&void 0!==r?r:{},s=a.visible,l=void 0===s?i:s,u=a.hidden,c=void 0===u?[]:u,d=a.ordered,f=void 0===d?l:d;return{visible:l.map(o),hidden:c.map(o),ordered:f.map(o)}}},sl=function(e){var t,n=(t=Vs(e),{layout:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||isNaN(e.x)||isNaN(e.y)||isNaN(e.width)||isNaN(e.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};var r=Bs(e,t),i=r.logicalContainerRect,o=r.containerRect,a=Y(nl(n,t,i),2),s=a[0],l=a[1],u=Qs({visible:s,layoutRect:i,reducedRect:Gs({layoutRect:i,visible:s,hidden:l,settings:t}),containerRect:o,translation:{x:e.x,y:e.y}});return l.forEach((function(e){e.comp.visible=!1;var t=Ws();e.comp.resize(t,t)})),{visible:s.map((function(e){return e.comp})),hidden:l.map((function(e){return e.comp})),ordered:u.map((function(e){return e.comp}))}},settings:function(e){t=Vs(e)}});return al((function(e,t){return n.layout(e,t)}))},ll=function(e){return"function"==typeof e?al(e):sl(e)};function ul(e){var t=e.createComponent,n={},r=[],i=[],o=function e(n){var i=t(n);return i&&(r.push(i),n.components&&(i.children=n.components.map((function(t){return e(t)})).filter((function(e){return!!e})))),i},a=function e(t,n){for(var i=function(i){var o=t[i],a=n.find((function(e){return o.hasKey&&o.key===e.key}));a?o.children&&a.components&&e(o.children,a.components):(t.splice(i,1),function(e){var t=r.indexOf(e);-1!==t&&r.splice(t,1)}(o),o.children&&e(o.children,[]),o.instance.destroy())},o=t.length-1;o>=0;o--)i(o)},s=function e(t){var n=t.compList,r=t.data,i=t.excludeFromUpdate,a=t.formatters,s=t.scales;return t.settingsList.map((function(t){var l=rl(n,t.key);return i.indexOf(t.key)>-1?(delete l.updateWith,l):l?(t.rendererSettings&&"function"==typeof l.instance.renderer().settings&&l.instance.renderer().settings(t.rendererSettings),t.rendererSettings&&"function"==typeof t.rendererSettings.transform&&t.rendererSettings.transform()?(l.applyTransform=!0,l):(l.updateWith={formatters:a,scales:s,data:r,settings:t},t.components&&(l.children=e({compList:l.children||[],data:r,excludeFromUpdate:i,formatters:a,scales:s,settingsList:t.components})),l)):o(t)})).filter((function(e){return!!e}))},l=function e(t){var n=t.components,r=t.hidden,i=t.layoutFn,o=t.ordered,a=t.rect,s=t.visible,l=i(a,n),u=l.visible,c=l.hidden,d=l.ordered;s.push.apply(s,X(u)),r.push.apply(r,X(c)),o.push.apply(o,X(d)),u.forEach((function(t){if(t.children){var n,i,a=ll(null!==(n=null===(i=t.settings)||void 0===i?void 0:i.strategy)&&void 0!==n?n:{});e({components:t.children,hidden:r,layoutFn:a,ordered:o,rect:t.instance.getRect(),visible:s})}})),c.forEach((function(t){t.children&&e({components:t.children,hidden:r,layoutFn:ol,ordered:o,rect:null,visible:s})}))};return n.destroy=function(){r.forEach((function(e){return e.instance.destroy()})),r=[],i=[]},n.findComponentByKey=function(e){return rl(r,e)},n.forEach=function(e){r.forEach(e)},n.layout=function(e){var t=e.layoutSettings,n=e.rect,r=[],o=[],a=[],s=ll(t);return l({components:i,hidden:o,layoutFn:s,ordered:a,rect:n,visible:r}),{visible:r,hidden:o,ordered:a}},n.set=function(e){var t=e.components;i=t.map((function(e){return o(e)})).filter((function(e){return!!e}))},n.update=function(e){var t=e.components,n=e.data,r=e.excludeFromUpdate,o=e.formatters,l=e.scales;a(i,t),i=s({compList:i,data:n,excludeFromUpdate:r,formatters:o,scales:l,settingsList:t})},n}function cl(e,t,n){var r=t.left-n.left,i=t.top-n.top,o=oe(e),a=D(!0,{},e);switch(o){case"circle":a.cx+=r,a.cy+=i;break;case"polygon":for(var s=0,l=a.vertices.length;s<l;s++){var u=a.vertices[s];u.x+=r,u.y+=i}break;case"geopolygon":for(var c=0;c<a.vertices.length;c++)for(var d=a.vertices[c],f=0,p=d.length;f<p;f++){var h=d[f];h.x+=r,h.y+=i}break;case"line":a.x1+=r,a.y1+=i,a.x2+=r,a.y2+=i;break;case"point":case"rect":a.x+=r,a.y+=i}return a}function dl(e,t){var n=[],r=0;t.forEach((function(e){n.push(r),r++;var t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(r+=t.length)})),t.forEach((function(t,r){return function(e,t,n){var r=t.instance.renderer().element();if(!isNaN(n)&&r&&e&&e.children){var i=e.children[Math.max(0,n)];if(r!==i){var o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==i?(e.insertBefore(r,i),o&&o.forEach((function(t){e.insertBefore(t,r)}))):(o&&o.forEach((function(t){e.appendChild(t,r)})),e.appendChild(r))}}}(e,t,n[r])}))}function fl(e,t){var n=e.element,r=e.data,i=void 0===r?[]:r,o=e.settings,a=void 0===o?{}:o,s=e.on,l=void 0===s?{}:s,u=t.registries,c=t.logger,d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e,r=function(e){e.forEach((function(e){var n=Array.isArray(e.colors[0])?e.colors:[e.colors];t[e.key]={colors:n,sizes:n.map((function(e){return e?e.length:0}))}}))},i=function(e,n){var r=t[e];if(!r)return[];for(var i=r.sizes,o=0;o<i.length;o++)if(n<=i[o])return r.colors[o];return r.colors[i.length-1]},o={palette:function(e,t){return i(e,t)},setPalettes:r,style:function(e){return js(e,n)},setStyle:function(t){n=D({},e,t)}};return r(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),o}(t.style,t.palettes),f=[],p=D({},e),h=function(){var e={};return $o(e),e}(),m=[],g=null,v=null,y=null,b=[],x=function(){},w=function(){},k={},C=!1,S=ul({createComponent:function(e){return u.component.has(e.type)?{instance:function(e){var t,n,r,i,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=e.defaultSettings,l=void 0===s?{}:s,u=e._DO_NOT_USE_getInfo,c=void 0===u?function(){return{}}:u,d=a.chart,f=a.container,p=a.mediator,h=a.registries,m=a.theme,g=a.renderer,v=$o({}),y=a.settings||{},b=D(!0,{},l,y),x=[],w=Da({chart:d}),k=!1,C={nodes:[],chart:d,config:b.brush||{},renderer:null},S={tap:[],over:[]},E=[],M={},T=D({},y);function _(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){for(var i,o,a,s=void 0!==e[t],l=void 0!==y[t],u=arguments.length,c=new Array(u),d=0;d<u;d++)c[d]=arguments[d];return s&&("function"==typeof e[t]?i=(o=e[t]).call.apply(o,[M].concat(c)):r&&(i=e[t])),l&&("function"==typeof y[t]?i=(a=y[t]).call.apply(a,[T].concat(c)):r&&(i=y[t])),s||l||(i=n.call.apply(n,[M].concat(c))),i}}var N=_("preferredSize",(function(){return 0}),!0),P=_("resize",(function(e){return e.inner})),A=_("created"),I=_("beforeMount"),O=_("mounted"),L=_("beforeUnmount"),z=_("beforeUpdate"),F=_("updated"),j=_("beforeRender"),H=_("beforeDestroy"),B=_("destroyed"),V=e.render,W=function(){b.brush&&(b.brush.consume||[]).forEach((function(e){e.context&&e.style&&E.push(Na(C,e))}))},U=function(){b.brush&&(b.brush.trigger||[]).forEach((function(e){"over"===e.on?S.over.push(e):S.tap.push(e)}))};Object.defineProperty(C,"data",{get:function(){return x}});var $=b.renderer||e.renderer,Y=$?g||h.renderer($)():g||h.renderer()();"function"==typeof Y.settings&&Y.settings(b.rendererSettings),C.renderer=Y;var K={resources:d.logger?{logger:d.logger()}:{}},G=rs(os(b,N,d.logger()),K),J=function(e){e.key=b.key,e.element=Y.element()},Z=function(){};Z.dockConfig=function(){return G},Z.set=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(y=e.settings,b=D(!0,{},l,e.settings),G=rs(os(b,N,d.logger()),K),C.config=b.brush||{}),b.scale&&(t=d.scale(b.scale)),b.data){var r=b.rendererSettings,i="function"==typeof(null==r?void 0:r.progressive)&&r.progressive(),a=qr(b.data,{dataset:d.dataset,collection:d.dataCollection},{logger:d.logger()},d.dataCollection);if(i){if(i.isFirst)(x=a).items&&(x.items=X(a.items));else if(x.items){var s;(s=x.items).push.apply(s,X(a.items||[]))}}else x=a}else x=t?t.data():[];"string"==typeof b.formatter||"object"===R(b.formatter)?n=d.formatter(b.formatter):t&&t.data().fields&&(n=t.data().fields[0].formatter()),o=m.style(b.style||{})},Z.resize=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=P({inner:e,outer:t});i=n?Y.size(n):Y.size(e),T.rect=D(!0,{computedPhysical:i.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),i=D(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},i)},Z.getRect=function(){return T.rect};var Q,ee,te,ne=function(){var e=Y.renderArgs?Y.renderArgs.slice(0):[],t=b.rendererSettings,n=x,r="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return x.items&&r&&(n=q(q({},x),{},{items:x.items.slice(r.start,r.end)})),e.push({data:n}),e};function re(e){var t=b.rendererSettings,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();if(n){if(n.isFirst)C.nodes=X(e||[]);else if(C.nodes){var r;(r=C.nodes).push.apply(r,X(e||[]))}}else C.nodes=e}Z.beforeMount=I,Z.beforeRender=function(){j({size:i})},Z.render=function(){var e=V.call.apply(V,[M].concat(X(ne())));re(e),Y.render(e),Q=e,ee=T.rect.computed},Z.hide=function(){Z.unmount(),Y.size({x:0,y:0,width:0,height:0}),Y.clear()},Z.beforeUpdate=function(){z({settings:b,data:x})},Z.update=function(){te&&te.stop();var e=b,t=e.rendererSettings,n=e.brush,r=e.animations;if("function"==typeof(null==t?void 0:t.transform)&&t.transform())return Y.render(),void(Q=null);var i=V.call.apply(V,[M].concat(X(ne())));re(i),E.forEach((function(e){return e.cleanUp()})),E.length=0,S.tap=[],S.over=[],n&&(W(),U()),E.forEach((function(e){e.isActive()&&e.update()})),Q&&r&&("function"==typeof r.enabled?r.enabled():r.enabled)?(r.compensateForLayoutChanges&&r.compensateForLayoutChanges({currentNodes:Q,currentRect:T.rect.computed,previousRect:ee}),(te=wa({old:Q,current:i},{renderer:Y},r)).start()):Y.render(i),Q=i,ee=T.rect.computed,Y.setKey&&"string"==typeof y.key&&Y.setKey(y.key)},Z.updated=F,Z.destroy=function(){Z.unmount(),H(r),Y.destroy(),B(),r=null};var ie=function(e){C.nodes=e,E.forEach((function(e){e.isActive()&&e.update()})),Y.render(e)};return is(M,e,{settings:function(){return b},data:function(){return x},scale:function(){return t},formatter:function(){return n},renderer:function(){return Y},chart:function(){return d},dockConfig:function(){return G},mediator:function(){return p},instance:function(){return T},rect:function(){return T.rect},style:function(){return o},update:function(){return ie},registries:function(){return h},resolver:function(){return w},symbol:function(){return ns(h.symbol)}}),is(T,y,{settings:function(){return b},data:function(){return x},scale:function(){return t},formatter:function(){return n},renderer:function(){return Y},chart:function(){return d},dockConfig:function(){return G},mediator:function(){return p},style:function(){return o},_DO_NOT_USE_getInfo:c.bind(M),isVisible:function(){return k}}),Z.getBrushedShapes=function(e,t,n){var r=[];if(b.brush&&b.brush.consume){var i=d.brush(e),o=Y.findShapes("*");b.brush.consume.filter((function(t){return t.context===e})).forEach((function(e){for(var a=0;a<o.length;a++){var s=o[a];s.data&&i.containsMappedData(s.data,n||e.data,t)&&(J(s),r.push(s),o.splice(a,1),a--)}}))}return r},Z.findShapes=function(e){for(var t,n=(null!==(t=te)&&void 0!==t&&t.inProgress()?te.targetScene:Y).findShapes(e),r=0,i=n.length;r<i;r++)J(n[r]);return n},Z.shapesAt=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Y.itemsAt(e);t=n&&"stop"===n.propagation&&r.length>0?[r.pop().node]:r.map((function(e){return e.node}));for(var i=0,o=t.length;i<o;i++)J(t[i]);return t},Z.brushFromShapes=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[],qa({nodes:e,action:t.action||"toggle",trigger:t,chart:d,data:C.data})},Z.mount=function(){r=Y.element&&Y.element()?r:Y.appendTo(f),Y.setKey&&"string"==typeof y.key&&Y.setKey(y.key),b.brush&&(W(),U()),as(T,v,y),as(M,v,e),k=!0},Z.mounted=function(){return O(r)},Z.unmount=function(){[T,M].forEach((function(e){ss(e,v)})),S.tap=[],S.over=[],E.forEach((function(e){e.cleanUp()})),E.length=0,L(),k=!1},Z.onBrushTap=function(e){S.tap.forEach((function(t){Ia({e:e,t:t,config:C})&&"stop"===t.globalPropagation&&d.toggleBrushing(!0)}))},Z.onBrushOver=function(e){S.over.forEach((function(t){Oa({e:e,t:t,config:C})&&"stop"===t.globalPropagation&&d.toggleBrushing(!0)}))},Z.def=M,Z.ctx=T,Z.renderer=function(){return Y},Z.set({settings:y}),A(),Z}(u.component(e.type),{settings:e,chart:p,mediator:h,registries:u,theme:d,container:n}),settings:D(!0,{},e),key:e.key,hasKey:void 0!==e.key}:(c.warn("Unknown component: ".concat(e.type)),!1)}});function E(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};return function(){for(var r,i,o="function"==typeof e[t],a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];o?r=(i=e[t]).call.apply(i,[p].concat(s)):r=n.call.apply(n,[p].concat(s));return r}}var M=function(){var e;a.dockLayout?(c.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=a.dockLayout):e=a.strategy;var t=function(e){if("function"==typeof e.getBoundingClientRect){var t=e.getBoundingClientRect();return{x:0,y:0,width:t.width,height:t.height}}return{x:0,y:0,width:0,height:0}}(n);return S.layout({layoutSettings:e,rect:t})},T=E("created"),_=E("beforeMount"),N=E("mounted"),P=E("beforeUpdate"),A=E("updated"),I=E("beforeRender"),O=E("beforeDestroy"),L=E("destroyed"),z=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.partialData,i=t.formatters,o=void 0===i?{}:i,a=t.scales,s=void 0===a?{}:a,l=t.scroll,f=void 0===l?{}:l;x=se(e,{logger:c,types:u.data}),r||Object.keys(k).forEach((function(e){return k[e].clear()})),t.palettes&&d.setPalettes(t.palettes),t.style&&d.setStyle(t.style),w=Rr(t.collections,{dataset:x},{logger:c});var p={theme:d,logger:c};g=Bo(s,{dataset:x,collection:w},q(q({},p),{},{scale:u.scale})),v=Ar(o,{dataset:x,collection:w},q(q({},p),{},{formatter:u.formatter})),y=Ko(f,y)};function F(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={},r=e.filter((function(e){return!!e.key})).map((function(e){return e.key}));b.forEach((function(e){e.key&&-1!==r.indexOf(e.key)?t[e.key]=e:e.destroy()})),b=e.map((function(e){var r=e.key&&t[e.key]?t[e.key]:u.interaction(e.type)(p,h,n);return r.set(e),r}))}var j=function(e){var t=n.getBoundingClientRect(),r="clientX"in e?e.clientX:e.x,i="clientY"in e?e.clientY:e.y,o={x:r-t.left,y:i-t.top},a=[];return m.forEach((function(e){var t=e.instance.getRect();Ms(t.computedPhysical?t.computedPhysical:{x:t.margin.left+t.x*t.scaleRatio.x,y:t.margin.top+t.y*t.scaleRatio.y,width:t.width*t.scaleRatio.x,height:t.height*t.scaleRatio.y},o)&&a.push(e)})),a},H=function(){if(!f.length&&n){Object.keys(l).forEach((function(e){var t=l[e].bind(p);n.addEventListener(e,t),f.push({key:e,listener:t})}));var e={},t=function(t){t.touches?(e.x=t.touches[0].clientX,e.y=t.touches[0].clientY,e.multiTouch=t.touches.length>1):(e.x=t.clientX,e.y=t.clientY,e.multiTouch=!1),e.time=Date.now(),e.comps=j(e)},r=function(t){var n=e.comps||j(t);if(!n.every((function(e){return e.instance.def.disableTriggers}))&&("touchend"===t.type&&t.preventDefault(),function(e,t){var n=J(e),r=n?e.changedTouches[0]:e,i=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(r.clientX-t.x),a=isNaN(t.y)?0:Math.abs(r.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&a<=12&&i<=300}(t,e)))for(var r=n.length-1;r>=0;r--){if(n[r].instance.onBrushTap(t),C){C=!1;break}}},i=[];i.push({key:"mousedown",listener:t}),i.push({key:"mouseup",listener:r}),function(e){return"ontouchstart"in e&&"ontouchend"in e||navigator.maxTouchPoints>1}(n)&&(i.push({key:"touchstart",listener:t}),i.push({key:"touchend",listener:r})),i.push({key:"mousemove",listener:function(e){for(var t=j(e),n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),C){C=!1;break}}}}),i.forEach((function(e){n.addEventListener(e.key,e.listener),f.push(e)}))}},B=function(){f.forEach((function(e){var t=e.key,r=e.listener;return n.removeEventListener(t,r)})),f.length=0};return p.layoutComponents=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.excludeFromUpdate,n=void 0===t?[]:t;e.data&&(i=e.data),e.settings&&(a=e.settings,F(e.settings.interactions)),P(),z(i,a);var r=a,o=r.formatters,s=r.scales,l=r.components,u=void 0===l?[]:l;S.update({components:u,data:i,excludeFromUpdate:n,formatters:o,scales:s}),S.forEach((function(e){e.updateWith&&e.instance.set(e.updateWith)})),S.forEach((function(e){e.updateWith&&e.instance.beforeUpdate()})),M()},p.update=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.partialData,o=t.excludeFromUpdate,s=void 0===o?[]:o;t.data&&(i=t.data),t.settings&&(a=t.settings,F(t.settings.interactions)),P(),z(i,a,{partialData:r});var l=a,u=l.formatters,c=l.scales,d=l.components,f=void 0===d?[]:d;S.update({components:f,data:i,excludeFromUpdate:s,formatters:u,scales:c}),S.forEach((function(e){e.updateWith&&e.instance.set(e.updateWith)})),S.forEach((function(e){e.updateWith&&e.instance.beforeUpdate()}));var p,h=[],g=[];if(r)S.forEach((function(e){(e.updateWith||e.applyTransform)&&e.visible&&h.push(e)})),p=h;else{var v=M(),y=v.visible,b=v.hidden,x=v.ordered;m=y,p=y,e=x,y.forEach((function(e){e.updateWith&&e.visible?h.push(e):g.push(e)})),b.forEach((function(e){e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1}))}g.forEach((function(e){return e.instance.beforeMount()})),g.forEach((function(e){return e.instance.mount()})),p.forEach((function(e){return e.instance.beforeRender()})),p.forEach((function(e){(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()})),r||dl(n,e),g.forEach((function(e){return e.instance.mounted()})),h.forEach((function(e){return e.instance.updated()})),m.forEach((function(e){delete e.updateWith,e.visible=!0,e.applyTransform=!1})),A()},p.destroy=function(){O(),S.destroy(),B(),F(),delete p.update,delete p.destroy,L()},p.getAffectedShapes=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=[];return m.filter((function(e){return null==r||e.key===r})).forEach((function(r){i.push.apply(i,X(r.instance.getBrushedShapes(e,t,n)))})),i},p.findShapes=function(e){var t=[];return m.forEach((function(n){t.push.apply(t,X(n.instance.findShapes(e)))})),t},p.componentsFromPoint=function(e){return j(e).map((function(e){return e.instance.ctx}))},p.shapesAt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[],i=n.getBoundingClientRect(),o=m;if(Array.isArray(t.components)&&t.components.length>0){var a=t.components.map((function(e){return e.key}));o=m.filter((function(e){return-1!==a.indexOf(e.key)})).map((function(e){return{instance:e.instance,opts:t.components[a.indexOf(e.key)]}}))}for(var s=o.length-1;s>=0;s--){var l=o[s],u=l.instance.renderer().element().getBoundingClientRect(),c=cl(e,i,u),d=l.instance.shapesAt(c,l.opts),f=d.length>0&&"stop"===t.propagation;if(r.push.apply(r,X(d)),r.length>0&&f)return r}return r},p.brushFromShapes=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]},n=function(n){var r=t.components[n].key;m.filter((function(e){return r===e.key})).forEach((function(r){var i=e.filter((function(e){return e.key===r.key}));r.instance.brushFromShapes(i,t.components[n])}))},r=0;r<t.components.length;r++)n(r)},p.scroll=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Go(e,y)},p.dataset=function(e){return x(e)},p.dataCollection=function(e){return w(e)},p.scales=function(){return g.all()},p.formatters=function(){return v.all()},p.brush=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return k[e]||(k[e]=ma()),k[e]},p.scale=function(e){return g.get(e)},p.formatter=function(e){return v.get(e)},p.toggleBrushing=function(e){C=void 0!==e?e:!C},p.component=function(e){var t=S.findComponentByKey(e);return null==t?void 0:t.instance.ctx},p.logger=function(){return c},p.theme=function(){return d},Object.defineProperty(p,"interactions",{get:function(){return{instances:b,on:function(){H(),b.forEach((function(e){return e.on()}))},off:function(){B(),b.forEach((function(e){return e.off()}))}}}}),T(),n&&(_(),n.innerHTML="",function(){var e=a.components,t=void 0===e?[]:e;I(),z(i,a),S.set({components:t});var r=M(),o=r.visible,s=r.hidden,l=r.ordered;m=o,s.forEach((function(e){e.instance.hide(),e.visible=!1})),o.forEach((function(e){return e.instance.beforeMount()})),o.forEach((function(e){return e.instance.mount()})),o.forEach((function(e){return e.instance.beforeRender()})),o.forEach((function(e){return e.instance.render()})),o.forEach((function(e){return e.instance.mounted()})),o.forEach((function(e){e.visible=!0})),dl(n,l)}(),H(),F(a.interactions),N(n),p.element=n),p}var pl=function(e){var t=ft(e);return t.prio=function(e){return e?t.default(e[0]):[t.default()]},t.types=function(){return t.getKeys()},t},hl=ft();function ml(e,t){var n=t.cache;if("number"==typeof e)return n.fields[e];for(var r=0;r<n.fields.length;r++)if(n.fields[r].key()===e)return n.fields[r];for(var i=0;i<n.fields.length;i++)if(n.fields[i].title()===e)return n.fields[i];return null}var gl=function(e){return e.filter((function(e){return"number"==typeof e&&!isNaN(e)}))},vl=function(e){return e.reduce((function(e,t){return e+t}),0)},yl={first:function(e){return e[0]},last:function(e){return e[e.length-1]},min:function(e){var t=gl(e);return t.length?Math.min.apply(null,t):NaN},max:function(e){var t=gl(e);return t.length?Math.max.apply(null,t):NaN},sum:function(e){var t=gl(e);return t.length?t.reduce((function(e,t){return e+t}),0):NaN},avg:function(e){var t=gl(e),n=t.length;return n?vl(t)/n:NaN}};function bl(e,t,n,r){var i={},o=r.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach((function(a){var s=n[a],l=i[a]={};-1!==["number","string","boolean"].indexOf(R(s))?(l.type="primitive",l.value=s):"function"==typeof s?(l.type="function",l.value=s,l.label=s,l.field=o):"object"===R(s)&&(s.fields?l.fields=s.fields.map((function(n){return bl(e,t,{main:n},r).main})):void 0!==s.field?(l.type="field",l.field=t.field(s.field),l.value=l.field.value,l.label=l.field.label):o&&(l.value=o.value,l.label=o.label,l.field=o),"function"==typeof s.filter&&(l.filter=s.filter),void 0!==s.value&&(l.value=s.value),void 0!==s.label&&(l.label=s.label),"function"==typeof s.reduce?l.reduce=s.reduce:s.reduce?l.reduce=yl[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?yl[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=yl[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?yl[l.field.reduceLabel]:l.field.reduceLabel))})),i}function xl(e,t){var n=bl(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{}).main;return{props:bl(e,t,e.props||{},n),main:n}}function wl(e,t,n,r){for(var i,o=Array(e.length),a=Array(e.length),s=0;s<e.length;s++)i=r?e[s][r]:e[s],o[s]=i.value,a[s]=i.label;var l=t.reduce,u=t.reduceLabel,c=l?l(o):o,d={value:c,label:u?u(a,c):n?n(c):String(c)};return r&&e[0][r].source?(d.source=e[0][r].source,d):!r&&e[0].source?(d.source=e[0].source,d):d}function kl(e,t){var n=t.main,r=t.propsArr,i=t.props,o=[],a=n.field.formatter(),s={};return r.forEach((function(e){s[e]=i[e].field?i[e].field.formatter():function(e){return e}})),o.push.apply(o,X(e.map((function(e){var t=wl(e.items,n,a);return r.forEach((function(n){t[n]=wl(e.items,i[n],s[n],n)})),t})))),o}function Cl(e){var t=e.cfg,n=e.itemData,r=e.obj,i=e.target,o=e.tracker,a="function"===e.trackType?t.trackBy(n):n[t.trackBy],s=o[a];s||(s=o[a]={items:[],id:a},i.push(s)),s.items.push(r)}function Sl(e,t,n){var r=n.key,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 El(e,t){var n=Array.isArray(e)?e:[e],r=[];return n.forEach((function(e){void 0!==e.field&&function(){var n=t.field(e.field),i=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));for(var o=xl(e,t),a=o.props,s=o.main,l=Object.keys(a),u=!!e.trackBy,c=R(e.trackBy),d={},f=[],p=n.items(),h=[],m=function(t){var n=p[t];if(s.filter&&!s.filter(n))return"continue";var r=Sl(s,n,{key:i});l.forEach((function(e){var o=a[e],s=o.field?o.field.items()[t]:n;r[e]=Sl(o,s,{key:i})})),u&&Cl({cfg:e,itemData:n,obj:r,target:f,tracker:d,trackType:c}),h.push(r)},g=0;g<p.length;g++)m(g);u?r.push.apply(r,X(kl(f,{main:s,propsArr:l,props:a}))):r.push.apply(r,h)}()})),r}var Ml=function(e){return e.filter((function(e){return"number"==typeof e&&!isNaN(e)}))};var Tl=function(e){var t=e.key,n=e.data,r=e.cache,i=e.config;if(n){var o=n;"string"==typeof o&&(o=function(e){var t=e.data,n=e.config,r=t.split("\n"),i=r[0],o=r[1],a=",";if(n&&n.parse&&n.parse.delimiter)a=n.parse.delimiter;else if(i)for(var s=[/,/,/\t/,/;/],l=0;l<s.length;l++){var u=s[l];if(i&&o){if(u.test(i)&&u.test(o)&&i.split(u).length===o.split(u).length){a=u;break}}else u.test(i)&&(a=u)}return r.map((function(e){return e.split(a)}))}({data:n,config:i})),Array.isArray(o)&&function(e){var t,n=e.source,r=e.data,i=e.cache,o=e.config,a=r,s=o&&o.parse;Array.isArray(r[0])?s&&!1===s.headers?t=r[0].map((function(e,t){return t})):(t=r[0],a=r.slice(1)):t=Object.keys(r[0]);var l,u=!!s&&"function"==typeof s.row&&s.row,c=t;c=s&&"function"==typeof s.fields?s.fields(c.slice()):t.map((function(e){return{key:e,title:e}})),Array.isArray(r[0])?l=c.map((function(){return[]})):(l={},c.forEach((function(e){l[e.key]=[]})));for(var d=0;d<a.length;d++){var f=u?u(a[d],d,c):a[d];if(f)if(Array.isArray(f))for(var p=0;p<c.length;p++)l[p].push(f[p]);else for(var h=0;h<c.length;h++)l[c[h].key].push(f[c[h].key])}for(var m=Array.isArray(l)?function(e){return l[e]}:function(e){return l[c[e].key]},g=0;g<c.length;g++){var v=m(g),y=Ml(v),b=y.length>0,x=b?"measure":"dimension",w=b?Math.min.apply(Math,X(y)):NaN,k=b?Math.max.apply(Math,X(y)):NaN;i.fields.push(Tr(D({source:n,key:g,title:c[g].title,values:v,min:w,max:k,type:x},c[g]),{value:c[g].value,label:c[g].label}))}}({data:o,cache:r,source:t,config:i})}};function Dl(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=e.data,r=e.config,i={fields:[]},o={key:function(){return t},raw:function(){return n},field:function(e){return ml(e,{cache:i,matrix:n})},fields:function(){return i.fields.slice()},extract:function(e){return El(e,o)},hierarchy:function(){return null}};return Tl({key:t,data:n,config:r,cache:i}),o}Dl.util={normalizeConfig:xl,collect:kl,track:Cl};var _l=ft();_l.default("matrix"),_l("matrix",Dl),_l("default",Dl);var Nl=ft();function ql(e,t,n){return Math.max(e,Math.min(t,n))}function Rl(e){var t,n=e.item,r=e.value,i=e.boxCenter,o=e.rendWidth,a=e.rendHeight,s="x",l="y",u=o,c=a,d=r<.5?90:-90;return e.flipXY&&(s="y",l="x",u=a,c=o,d=r<.5?180:0),(0,e.symbol)(D({},n.oob,(O(t={},s,i*u),O(t,l,Math.max(n.oob.size/2,Math.min(r*c,c-n.oob.size/2))),O(t,"startAngle",d),t)))}function Pl(e){var t,n=e.item,r=e.boxWidth,i=e.boxPadding,o=e.rendWidth,a=e.rendHeight,s="x",l="y",u="width",c="height",d=o,f=a;e.flipXY&&(s="y",l="x",u="height",c="width",d=a,f=o);var p=function(e){var t=e.start,n=e.end,r=e.minPx,i=void 0===r?.1:r,o=e.maxPx,a=void 0===o?1:o,s=Math.max(t,n),l=Math.min(t,n),u=ql(-.1,1.2,s),c=ql(-.1,1.2,l),d=u*a-c*a,f=Math.max(i,d),p=(f-d)/2;return{actualDiff:f,startModifier:p,actualLow:c*a-p}}({start:n.start,end:n.end,minPx:n.box.minHeightPx,maxPx:f}),h=p.actualDiff,m=p.actualLow;return D({},n.box,(O(t={type:"rect"},s,(i+n.major)*d),O(t,l,m),O(t,c,h),O(t,u,r*d),O(t,"data",n.data||{}),O(t,"collider",{type:null}),t))}function Al(e){var t,n=e.item,r=e.from,i=e.to,o=e.boxCenter,a=e.rendWidth,s=e.rendHeight,l="x1",u="y1",c="x2",d="y2",f=a,p=s;return e.flipXY&&(l="y1",u="x1",c="y2",d="x2",f=s,p=a),D({},n.line,(O(t={type:"line"},d,Math.floor(r*p)),O(t,l,o*f),O(t,u,Math.floor(i*p)),O(t,c,o*f),O(t,"data",n.data||{}),O(t,"collider",{type:null}),t))}function Il(e){var t,n=e.item,r=e.key,i=e.position,o=e.width,a=e.boxCenter,s=e.rendWidth,l=e.rendHeight,u="x1",c="y1",d="x2",f="y2",p=s,h=l;e.flipXY&&(u="y1",c="x1",d="y2",f="x2",p=l,h=s);var m=o/2;return D({type:"line"},n[r],(O(t={},c,Math.floor(i*h)),O(t,u,(a-m)*p),O(t,f,Math.floor(i*h)),O(t,d,(a+m)*p),O(t,"r",m*p),O(t,"cx",a*p),O(t,"cy",i*h),O(t,"width",o*p),O(t,"data",n.data||{}),O(t,"collider",{type:null}),t))}function Ol(e,t,n){var r=t.box,i=r.width,o=r.maxWidthPx,a=r.minWidthPx,s=e>=0?1:-1,l=Math.min(s*e*i,isNaN(o)?n:o/n);return(l=isNaN(a)?l:Math.max(a/n,l))*s}Nl("native",(function(e,t,n){var r,i,o={chart:e,mediator:t,element:n},a=[],s=!0;function l(){"function"==typeof r.enable&&(r.enable=r.enable.bind(o)()),r.enable&&Object.keys(r.events).forEach((function(e){var t=r.events[e].bind(o);n.addEventListener(e,t),a.push({key:e,listener:t})}))}function u(){a.forEach((function(e){var t=e.key,r=e.listener;n.removeEventListener(t,r)})),a=[]}return{get key(){return i},set:function(e){!function(e){i=e.key,(r=e).events=r.events||[],void 0===r.enable&&(r.enable=!0)}(e),u(),s&&l()},off:function(){s=!1,u()},on:function(){s=!0,0===a.length&&l()},destroy:function(){u(),o=null,r=null}}}));var Ll={oob:{show:!0,type:"n-polygon",fill:"#999",stroke:"#000",strokeWidth:0,size:10,sides:3,startAngle:-90},box:{show:!0,fill:"#fff",stroke:"#000",strokeWidth:1,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1},line:{show:!0,stroke:"#000",strokeWidth:1},median:{show:!0,stroke:"#000",strokeWidth:1},whisker:{show:!0,stroke:"#000",strokeWidth:1,fill:"",type:"line",width:1}},zl=Object.keys(Ll),Fl={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created:function(){this.state={}},render:function(e){var t=this,n=e.data,r=this.rect,i=r.width,o=r.height,a="horizontal"===this.settings.settings.orientation,s=this.style,l=this.resolver,u=this.symbol,c=zl.filter((function(e){return!t.settings.settings[e]||!1!==t.settings.settings[e].show})),d={};c.forEach((function(e){return d[e]=Ll[e]}));var f=function(e){var t,n=e.keys,r=e.data,i=e.defaultSettings,o=e.style,a=e.settings,s=e.width,l=e.height,u=e.resolver,c=D(!0,{},i||{},o||{}),d={major:"horizontal"===a.orientation?l:s,minor:"horizontal"===a.orientation?s:l},f=a.major;t="object"===R(f)&&"object"===R(f.ref)&&void 0!==f.ref.start&&void 0!==f.ref.end?u.resolve({data:r,defaults:{start:0,end:1},scaled:d,settings:D(!0,{},{binStart:{scale:a.major.scale,ref:a.major.ref.start},binEnd:{scale:a.major.scale,ref:a.major.ref.end}})}):"object"===R(f)&&void 0!==f.binStart&&void 0!==f.binEnd?u.resolve({data:r,defaults:{start:0,end:1},scaled:d,settings:D(!0,{},{binStart:{scale:a.major.scale,ref:"binStart"},binEnd:{scale:a.major.scale,ref:"binEnd"}},a.major)}):u.resolve({data:r,scaled:d,defaults:{major:.5},settings:{major:a.major}});var p=a.minor||{},h={};["start","end","min","max","med"].forEach((function(e){(p[e]||r.items&&r.items.length&&r.items[0][e])&&(h[e]={scale:p.scale,ref:e})}));for(var m,g={major:t,minor:u.resolve({data:r,defaults:{start:0,end:1},scaled:d,settings:D(!0,{},h,p)})},v=0,y=n.length;v<y;v++)a[m]&&!1===a[m].show||(g[m=n[v]]=u.resolve({data:r,defaults:c[m],settings:a[m],scaled:d}));return g}({keys:c,data:n,defaultSettings:d,style:s,settings:this.settings.settings,width:i,height:o,resolver:l}),p=f.settings;return function(e){var t=e.width,n=e.height,r=e.flipXY,i=e.resolved,o=e.keys,a=e.symbol,s=[],l=i.major.items;if(!l.length)return s;var u,c,d,f,p,h,m,g,v,y=t,b=n,x=r?n:t,w=i.major.settings,k=["start","end","min","max","med"].filter((function(e){return void 0!==i.minor.settings[e]})),C=k.length,S=o.filter((function(e){return"oob"!==e})),E=o?o.length:0,M=S?S.length:0,T={box:function(){d.box&&Z(d.start)&&Z(d.end)&&u.push(Pl({item:d,boxWidth:f,boxPadding:p,rendWidth:y,rendHeight:b,flipXY:r}))},line:function(){Z(d.min)&&Z(d.start)&&u.push(Al({item:d,from:d.min,to:d.start,boxCenter:h,rendWidth:y,rendHeight:b,flipXY:r})),Z(d.max)&&Z(d.end)&&u.push(Al({item:d,from:d.max,to:d.end,boxCenter:h,rendWidth:y,rendHeight:b,flipXY:r}))},median:function(){d.median&&Z(d.med)&&u.push(Il({item:d,key:"median",position:d.med,width:f,boxCenter:h,rendWidth:y,rendHeight:b,flipXY:r}))},whisker:function(){if(d.whisker){var e=f*d.whisker.width;Z(d.min)&&u.push(Il({item:d,key:"whisker",position:d.min,width:e,boxCenter:h,rendWidth:y,rendHeight:b,flipXY:r})),Z(d.max)&&u.push(Il({item:d,key:"whisker",position:d.max,width:e,boxCenter:h,rendWidth:y,rendHeight:b,flipXY:r}))}}};function _(){for(var e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE,r=0;r<C;r++)Z(e=d[k[r]])&&(t<e&&(t=e),n>e&&(n=e));m=t<0&&t!==-Number.MAX_VALUE,g=n>1&&n!==Number.MAX_VALUE,v=m||g}for(var N=0,q=l.length;N<q;N++){u=[],c=null;var R=l[N],P=R.data,A=null,I=null;void 0!==w.binStart?(A=R.binStart,I=R.binEnd,c=w.binStart.scale):A=(c=w.major.scale)?R.major:0;var O=0;c?c.bandwidth?A-=(O=c.bandwidth())/2:O=I-A:O=1,d=D({},{major:A,majorEnd:I},i.minor.items[N]);for(var L=0;L<E;L++)d[o[L]]=i[o[L]].items[N];if(f=Ol(O,d,x),h=(p=(O-f)/2)+d.major+f/2,_(),v)d.oob&&(m?u.push(Rl({item:d,value:0,boxCenter:h,rendWidth:y,rendHeight:b,flipXY:r,symbol:a})):g&&u.push(Rl({item:d,value:1,boxCenter:h,rendWidth:y,rendHeight:b,flipXY:r,symbol:a})));else for(var z=0;z<M;z++)d[S[z]]&&!1===d[S[z]].show||T[S[z]]();var F={type:"container",data:P,collider:{type:"bounds"},children:u};s.push(F)}return s}({items:f.items,settings:p,width:i,height:o,flipXY:a,resolved:f,keys:c,symbol:u})}};var jl={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},Hl=/px$/,Bl={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},Vl={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function Wl(e,t){return e&&"function"==typeof e.bandwidth?{isBandwidth:!0,value:Math.max(1,e.bandwidth()*t)}:{isBandwidth:!1,value:Math.max(1,t)}}function Ul(e,t,n,r){var i=t.width,o=t.height;return e.filter((function(e){return!1!==e.show&&!isNaN(e.x+e.y)})).map((function(e){var t=e,a=Hl.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);Q(a)&&(t=jl,a=n.min+t.size*(n.max-n.min));var s=Y(function(e){var t=Bl.shape,n={};return"object"===R(e.shape)&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),2),l=s[0],u=q(q({},s[1]),{},{type:l,label:e.label,x:e.x*i,y:e.y*o,fill:t.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,a)),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray,opacity:t.opacity});t===e.errorShape&&(u.width=t.width);var c=r(u);return c.data=e.data,c}))}var $l={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:function(e){return e.data.value}},style:{item:"$shape"}},render:function(e){var t=e.data,n=this.resolver.resolve({data:t,defaults:D({},Bl,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),r=this.rect,i=r.width,o=r.height,a=D({},Vl,this.settings.settings.sizeLimits),s=n.items,l=function(e,t,n,r,i){var o=Wl(e?e.scale:void 0,n),a=Wl(t?t.scale:void 0,r),s=Math.min(o.value*i[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],a.value*i[a.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*i[o.isBandwidth?"minRelDiscrete":"minRelExtent"],a.value*i[a.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(s)),maxGlobal:i.maxPx,minGlobal:i.minPx}}(n.settings.x,n.settings.y,i,o,a);return Ul(s,this.rect,l,this.settings.shapeFn||this.symbol)}};Math.PI;var Yl={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function Xl(e,t,n,r){var i=t.x,o=t.y,a=t.width,s=t.height,l=Ie(),u={x:i+a/2,y:o+s/2},c=Math.min(a,s)/2,d=Math.min(a,s)/2,f=d/100;return e.map((function(e,t){var i=n[t];i.type="path";var o=d*i.outerRadius,a=c*i.innerRadius,s=f*i.cornerRadius;l.innerRadius(a),l.outerRadius(o),l.cornerRadius(s),i.arcDatum=e;var p=l.centroid(e),h=i.offset?function(e,t,n,r){var i=Y(e,2),o=i[0],a=i[1],s=Math.sqrt(o*o+a*a),l=n-r;return{x:(o/=s)*t*l,y:(a/=s)*t*l}}(p,i.offset,o,a):{x:0,y:0};return i.transform="translate(".concat(h.x,", ").concat(h.y,") translate(").concat(u.x,", ").concat(u.y,")"),i.desc={share:e.value/r,slice:{start:e.startAngle,end:e.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:u.x+h.x,y:u.y+h.y}}},i}))}function Kl(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}var Gl={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render:function(e){for(var t=e.data,n=[],r=[],i=this.settings.settings,o=this.resolver.resolve({data:t,defaults:D({},Yl,this.style.slice),settings:i.slice}).items,a=0,s=0,l=o.length;s<l;s++){var u=Kl(i,o[s]);u>0&&o[s].outerRadius>=o[s].innerRadius&&(n.push(u),r.push(o[s]),a+=u)}var c=function(){var e=Be,t=He,n=null,r=he(0),i=he(Ee),o=he(0);function a(a){var s,l,u,c,d,f=a.length,p=0,h=new Array(f),m=new Array(f),g=+r.apply(this,arguments),v=Math.min(Ee,Math.max(-Ee,i.apply(this,arguments)-g)),y=Math.min(Math.abs(v)/f,o.apply(this,arguments)),b=y*(v<0?-1:1);for(s=0;s<f;++s)(d=m[h[s]=s]=+e(a[s],s,a))>0&&(p+=d);for(null!=t?h.sort((function(e,n){return t(m[e],m[n])})):null!=n&&h.sort((function(e,t){return n(a[e],a[t])})),s=0,u=p?(v-f*b)/p:0;s<f;++s,g=c)l=h[s],c=g+((d=m[l])>0?d*u:0)+b,m[l]={data:a[l],index:s,value:d,startAngle:g,endAngle:c,padAngle:y};return m}return a.value=function(t){return arguments.length?(e="function"==typeof t?t:he(+t),a):e},a.sortValues=function(e){return arguments.length?(t=e,n=null,a):t},a.sort=function(e){return arguments.length?(n=e,t=null,a):n},a.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:he(+e),a):r},a.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:he(+e),a):i},a.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:he(+e),a):o},a}().sortValues(null);return c.startAngle(i.startAngle),c.endAngle(i.endAngle),c.padAngle(i.padAngle),Xl(c(n),D({},this.rect,{x:0,y:0}),r,a)}};var Jl=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){var n=e[t.type],r=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach((function(e){var n=Math.round(t[e.key]),i=t[e.key]-n;t[e.key]=n,r&&"append"===e.type&&(i>0?t[e.key]+=.5:t[e.key]-=.5)}))}}return void 0===e&&((e={}).line={append:["x1","x2","y1","y2"],round:[],condition:function(e){return e.x1===e.x2||e.y1===e.y2},conditionAppend:function(e){return e.strokeWidth%2!=0}},e.rect={append:["x","y"],round:["width","height"],condition:function(){return!0},conditionAppend:function(e){return e.strokeWidth%2!=0}}),Object.keys(e).forEach((function(t){var n=e[t];n.items=[],n.append.forEach((function(e){n.items.push({key:e,type:"append"})})),n.round.forEach((function(e){n.items.push({key:e,type:"round"})}))})),t.multiple=function(e){return e.forEach((function(e){return t(e)}))},t}(),Zl=function(){function e(){P(this,e),this.reset(),this.push.apply(this,arguments)}return I(e,[{key:"transposeCoordinate",value:function(e,t,n){if("number"==typeof t&&isFinite(t)){var r=e.substring(0,1);if("x"===r||"cx"===e)return t*this.width;if("width"===e)return t*this.width;if("r"===e)return t*(n?this.height:this.width);if("y"===r||"cy"===e)return t*this.height;if("height"===e)return t*this.height}return t}},{key:"push",value:function(){var e;return(e=this.storage).push.apply(e,arguments),this}},{key:"processItem",value:function(t){var n={},r=void 0!==t.flipXY?t.flipXY:this.flipXY,i=void 0!==t.crisp?t.crisp:this.crisp;if(t.fn&&"function"==typeof t.fn){var o=r?this.height:this.width,a=r?this.width:this.height;t=t.fn({width:o,height:a,flipXY:r});for(var s=Object.keys(t),l=0,u=s.length;l<u;l++){var c=s[l];n[e.evaluateKey(c,r)]=t[c]}}else for(var d=Object.keys(t),f=0,p=d.length;f<p;f++){var h=d[f],m=e.evaluateKey(h,r),g=this.transposeCoordinate(m,t[h],r);n[m]=g}return i&&Jl(n),n}},{key:"output",value:function(){for(var e=[],t=0,n=this.storage.length;t<n;t++){var r=this.processItem(this.storage[t]);e.push(r)}return e}},{key:"reset",value:function(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}],[{key:"evaluateKey",value:function(e,t){if(t){var n=e.substring(0,1),r=e.substring(1);if("x"===n)return"y".concat(r);if("y"===n)return"x".concat(r);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}}]),e}();function Ql(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Zl,t)}function eu(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}var tu={created:function(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender:function(){this.blueprint=Ql(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render:function(){var e=this;if(this.x=this.settings.x?this.chart.scale(this.settings.x):null,this.y=this.settings.y?this.chart.scale(this.settings.y):null,Ea(this,"x",this.rect.width),Ea(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=D({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=D({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=eu(this.x,this.rect.width),this.lines.y=eu(this.y,this.rect.height),this.lines.y=this.lines.y.map((function(e){return D(e,{flipXY:!0})}));var t=function(t){var n=t.dir,r=t.isMinor,i=e.lines[n].filter((function(e){return!!e.isMinor===r})),o=r?e.settings.minorTicks:e.settings.ticks;e.resolver.resolve({settings:o,data:{items:i,dir:n}}).items.forEach((function(t){var r,i,o=t.data;t.show&&e.blueprint.push({type:"line",x1:o.position,y1:0,x2:o.position,y2:1,stroke:t.stroke||"black",strokeWidth:void 0!==t.strokeWidth?t.strokeWidth:1,strokeDasharray:void 0!==t.strokeDasharray?t.strokeDasharray:void 0,flipXY:o.flipXY||!1,value:null!==(r=o.value)&&void 0!==r?r:null===(i=o.data)||void 0===i?void 0:i.value,dir:n})}))};return t({dir:"x",isMinor:!1}),t({dir:"x",isMinor:!0}),t({dir:"y",isMinor:!1}),t({dir:"y",isMinor:!0}),this.blueprint.output()}};function nu(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===r||"right"===r){var i="right"===r;return"\n M ".concat(e," ").concat(t-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?0:1,", ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}var o="bottom"===r;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(o?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(o?t+n:t-n," Z\n ")}function ru(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===r||"right"===r){var i="right"===r;return"\n M ".concat(e+=i?1.5*n:-1.5*n," ").concat(t-n,"\n L ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}var o="bottom"===r;return t+=o?1.5*n:-1.5*n,"\n M ".concat(e-n," ").concat(t,"\n L ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(o?t+n:t-n," Z\n ")}function iu(e){if(void 0===e)return 0;if("number"==typeof e&&isFinite(e))return e;if("string"==typeof e)switch(e){case"center":case"middle":return.5;case"bottom":case"right":return 1;case"top":case"left":default:return 0}return 0}function ou(e){var t={value:e.value};return e.label&&(t.label=e.label.text),t}function au(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function su(e,t){var n=e.min();if(n===e.max()){var r=function(e){var t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return r?2:-1;if(t>n)return r?-1:2}return e(t)}var lu={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:0},style:{oob:{show:!0,width:10,fill:"#1A1A1A",stroke:"transparent",strokeWidth:0,opacity:1,text:{fontFamily:"Arial",stroke:"transparent",fill:"#fff",strokeWidth:0,opacity:1},triangle:{fill:"#4D4D4D",stroke:"transparent",strokeWidth:0,opacity:1},padding:{x:28,y:5}},line:{stroke:"#000"},label:{strokeWidth:0}}},preferredSize:function(){return 30},beforeRender:function(){this.blueprint=Ql(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render:function(){var e=this,t=this.settings;if(this.lines={x:[],y:[]},this.lines.x=t.lines&&t.lines.x||[],this.lines.y=t.lines&&t.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];var n={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(au).map((function(t){if("function"==typeof t.value&&(t.value=t.value()),t.scale){var n=e.chart.scale(t.scale),r=su(n,t.value);return D(t,{scale:n,position:r})}return D(t,{position:t.value})})),this.lines.y=this.lines.y.filter(au).map((function(t){if("function"==typeof t.value&&(t.value=t.value()),t.scale){var n=e.chart.scale(t.scale),r=su(n,t.value);return D(t,{scale:n,position:r,flipXY:!0})}return D(t,{position:t.value,flipXY:!0})})),this.lines.x=this.lines.x.filter((function(e){return!(e.position<0||e.position>1)||(n["x".concat(e.position>1?1:0)].push(ou(e)),!1)})),this.lines.y=this.lines.y.filter((function(e){return!(e.position<0||e.position>1)||(n["y".concat(e.position>1?1:0)].push(ou(e)),!1)}));var r=[];return[].concat(X(this.lines.x),X(this.lines.y)).forEach((function(n){(!0===n.show||void 0===n.show)&&function(e){var t,n=e.chart,r=e.blueprint,i=e.renderer,o=e.p,a=e.settings,s=e.items,l=!0,u=!1,c=!1,d=!1,f=D(!0,{},a.style.line,o.line||{});if(t=r.processItem({type:"line",x1:o.position,y1:0,x2:o.position,y2:1,stroke:f.stroke||"black",strokeWidth:f.strokeWidth||1,strokeDasharray:f.strokeDasharray,flipXY:o.flipXY||!1,value:o.valueInfo?o.valueInfo.id:o.value}),o.label){var p,h=D(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},a.style.label||{},{fill:f.stroke},o.label),m={width:0,height:0},g="";if("string"==typeof o.formatter)p=n.formatter(o.formatter);else if("object"===R(o.formatter))p=n.formatter(o.formatter);else if(void 0!==o.scale&&o.scale.data){var v=o.scale.data()&&o.scale.data().fields;p=v&&v[0]?v[0].formatter():null}!1!==o.label.showValue&&(p?g=" (".concat(p(o.value),")"):o.scale&&(g=" (".concat(o.value,")"))),g&&(m=i.measureText({text:g,fontFamily:h.fontFamily,fontSize:h.fontSize}));var y=i.measureText({text:h.text||"",fontFamily:h.fontFamily,fontSize:h.fontSize}),b={width:y.width+m.width,height:Math.max(y.height,m.height)},x=h.padding,w=iu(o.flipXY?h.vAlign:h.align),k=iu(o.flipXY?h.align:h.vAlign),C=Math.min(1+b.width+2*x,h.maxWidth*r.width,h.maxWidthPx),S=b.height+2*x,E=o.flipXY?S:C,M=o.flipXY?C:S;if((u=r.processItem({fn:function(e){var t=e.width,n=e.height,i=o.position*t-(o.flipXY?S:C)*(1-w);return{type:"rect",x:i=o.flipXY?i:Math.max(i,0),y:Math.max(Math.abs(k*n-M*k),0),width:o.flipXY?E:Math.min(E,r.width-i),height:M,stroke:h.background.stroke,strokeWidth:h.background.strokeWidth,fill:h.background.fill,opacity:h.background.opacity}},flipXY:o.flipXY||!1})).x<-1||u.x+u.width>r.width+1||u.y<-1||u.y+u.height>r.height+1)u=void 0;else{c={type:"text",text:h.text||"",fill:h.fill,opacity:h.opacity,fontFamily:h.fontFamily,fontSize:h.fontSize,x:u.x+x,y:u.y+u.height/2+b.height/3,maxWidth:u.width-2*x-m.width,anchor:"start"},g&&(d={type:"text",text:g||"",fill:h.fill,opacity:h.opacity,fontFamily:h.fontFamily,fontSize:h.fontSize,x:c.x+3+(u.width-(m.width+2*x)),y:c.y});for(var T=0,_=s.length;T<_;T++){var N=s[T];"rect"===N.type?Ss(u,N)&&(l=!1):"line"===N.type&&o.flipXY===N.flipXY&&Ts(u,N)&&(l=!1)}}}s.push(t),l&&u&&c&&(s.push(u,c),d&&s.push(d))}({chart:e.chart,blueprint:e.blueprint,renderer:e.renderer,p:n,settings:t,items:r})})),t.style.oob.show&&function(e){for(var t=e.blueprint,n=e.oob,r=e.settings,i=e.items,o=Object.keys(n),a=r.style.oob||{},s=function(e,r){var s=o[e],l=n[s];if(l.length>0){var u=s.charAt(1),c="y"===s.charAt(0),d=a.padding.x+a.width,f=a.padding.y+a.width,p="bottom";p=c?"1"===u?"bottom":"top":"1"===u?"right":"left";var h=t.processItem({fn:function(e){var t=e.width,n=e.height,r=u*t+("1"===u?-d:d),i=c?f:n-f;return"arc"===a.type?{type:"path",d:nu(c?i:r,c?r:i,a.width,p),x:r,y:i,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0}:{type:"circle",cx:r,cy:i,r:a.width,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0,opacity:a.opacity,data:l}},flipXY:c}),m=h.cx||h.x,g=h.cy||h.y,v={type:"text",text:l.length||"",x:m-.4*a.width,y:g+.4*a.width,fontFamily:a.text.fontFamily,fontSize:"".concat(1.3*a.width,"px"),stroke:a.text.stroke,fill:a.text.fill,strokeWidth:a.text.strokeWidth||0,opacity:a.text.opacity},y={type:"path",d:ru(m,g,a.width,p),x:m,y:g,stroke:a.triangle.stroke,fill:a.triangle.fill,strokeWidth:a.triangle.strokeWidth||0,opacity:a.triangle.opacity};i.push(h,v,y)}},l=0,u=o.length;l<u;l++)s(l)}({blueprint:this.blueprint,oob:n,settings:t,items:r}),r}};function uu(e){var t={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===e.align||"bottom"===e.align?(t.x1=e.innerRect.x-e.outerRect.x,t.x2=t.x1+e.innerRect.width,t.y1=t.y2="top"===e.align?e.innerRect.height-e.padding:e.padding):(t.x1=t.x2="left"===e.align?e.innerRect.width-e.padding:e.padding,t.y1=e.innerRect.y-e.outerRect.y,t.y2=t.y1+e.innerRect.height),function(e,t){D(e,t.style)}(t,e),t}function cu(e){return"string"==typeof e||"number"==typeof e?e:"-"}function du(e,t,n){n.layered||!n.stepSize?function(e,t){t.collider={type:"polygon",vertices:[{x:t.boundingRect.x,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y+t.boundingRect.height},{x:t.boundingRect.x,y:t.boundingRect.y+t.boundingRect.height}]}}(0,t):n.tilted?function(e,t,n){var r=n.angle*(Math.PI/180),i=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,a="end"===t.anchor&&r<0,s="start"===t.anchor&&r>=0,l=t.boundingRect.y+(s||a?t.boundingRect.height:0),u=[{x:t.x-i,y:l},{x:t.x+i,y:l}].map((function(e){return Ja(e,r,{x:t.x,y:t.y})})),c={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},d={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},f=r>=0?[c,d]:[d,c];u.push.apply(u,f),t.collider={type:"polygon",vertices:u}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){var r=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:r,y:0,width:r<0?n.stepSize+r:n.stepSize,height:n.innerRect.height}}else{var i=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:i,width:n.innerRect.width,height:i<0?n.stepSize+i:n.stepSize}}var o=t.collider;o.x=Math.max(o.x,0),o.y=Math.max(o.y,0);var a=o.x+o.width-(n.outerRect.x+n.outerRect.width);o.width=a>0?o.width-a:o.width;var s=o.y+o.height-(n.outerRect.y+n.outerRect.height);o.height=s>0?o.height-s:o.height}(e,t,n)}function fu(e,t){var n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1),r=0;if(e.tilted)r=e.stepSize*n;else{var i=t?e.textRect.height:e.textRect.width;r=Math.max(0,e.stepSize-i)*n}return r}function pu(e,t){var n,r,i={type:"text",text:cu(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(r=e.data)||void 0===r?void 0:r.value};return"top"===t.align||"bottom"===t.align?(i.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+fu(t,!1),i.y="top"===t.align?t.innerRect.height:0,i.anchor=t.stepSize?"start":"middle",i.x+=isNaN(t.style.offset)?0:+t.style.offset):(i.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+fu(t,!0),i.x="left"===t.align?t.innerRect.width:0,i.anchor="left"===t.align?"end":"start",i.baseline=t.stepSize?"text-before-edge":"central",i.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach((function(n){e[n]=t.style[n]}))}(i,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){var n=t.outerRect.width,r=Math.min(t.maxWidth/2,t.textRect.width/2),i=e.x-r,o=e.x+r;i<0?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):o>n&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{var a=t.outerRect.height,s=t.maxHeight/2,l=e.y-s,u=e.y+s;l<0?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):u>a&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(i,t),function(e,t){"top"===t.align?e.y-=t.padding:"bottom"===t.align?e.y+=t.padding+t.maxHeight:"left"===t.align?e.x-=t.padding:"right"===t.align&&(e.x+=t.padding)}(i,t),function(e,t){if(t.tilted){var n=-t.angle,r=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(r)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(r)/2):e.x-=t.maxHeight*Math.sin(r)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";var i=Math.cos(r)*t.maxWidth;if("bottom"===t.align==t.angle<0){var o=t.outerRect.width-t.paddingEnd;e.x+i>o&&(e.maxWidth=(o-e.x-10)/Math.cos(r))}else{var a=t.paddingEnd;e.x-i<a&&(e.maxWidth=(e.x-a-10)/Math.cos(r))}}}(i,t),function(e,t){e.boundingRect=t.textBounds(e)}(i,t),du(e,i,t),i}function hu(e,t){var n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:e.value};return"top"===t.align||"bottom"===t.align?(n.x1=n.x2=e.position*t.innerRect.width+(t.innerRect.x-t.outerRect.x),n.y1="top"===t.align?t.innerRect.height:0,n.y2="top"===t.align?n.y1-t.tickSize:n.y1+t.tickSize):(n.y1=n.y2=e.position*t.innerRect.height+(t.innerRect.y-t.outerRect.y),n.x1="left"===t.align?t.innerRect.width:0,n.x2="left"===t.align?n.x1-t.tickSize:n.x1+t.tickSize),function(e,t){D(e,t.style)}(n,t),function(e,t){"top"===t.align?(e.y1-=t.padding,e.y2-=t.padding):"bottom"===t.align?(e.y1+=t.padding,e.y2+=t.padding):"left"===t.align?(e.x1-=t.padding,e.x2-=t.padding):"right"===t.align&&(e.x1+=t.padding,e.x2+=t.padding)}(n,t),function(e,t){var n=e.strokeWidth/2;e.x1===t.innerRect.width?(e.x1-=n,e.x2-=n):0===e.x1?(e.x1+=n,e.x2+=n):e.y1===t.innerRect.height?(e.y1-=n,e.y2-=n):0===e.y1&&(e.y1+=n,e.y2+=n)}(n,t),n}function mu(e){return!e.isMinor&&e.position>=0&&e.position<=1}function gu(e){var t=e.rect,n=e.state,r=e.majorTicks,i=e.measure;return e.horizontal?function(e){for(var t=e.majorTicks,n=e.measureText,r=e.rect,i="layered"===e.state.labels.activeMode?2:1,o=r.width,a=t.map((function(e){return e.label})).map((function(e){return"".concat(e.slice(0,1)).concat(e.length>1?"…":"")})).map(n).map((function(e){return e.width})),s=0;s<t.length;++s){var l=t[s];if(i*o*Math.abs(l.start-l.end)<a[s])return!0}return!1}({majorTicks:r,measureText:i,rect:t,state:n}):function(e){var t=e.majorTicks,n=e.measureText,r=e.rect.height,i=n("M").height;return!(t.length<2)&&r*Math.abs(t[0].position-t[1].position)<i}({majorTicks:r,measureText:i,rect:t,state:n})}function vu(e){var t=e.value,n=e.maxValue,r=e.minValue,i=e.range,o=e.modifier;return isNaN(i)||isNaN(o)||(t=i*o),t>n&&(t=n),t<r&&(t=r),t}function yu(e){var t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,a=e.settings,s=e.state,l=0,u={left:0,top:0,right:0,bottom:0},c=a.labels,d=c.maxLengthPx,f=c.minLengthPx;if(a.labels.show){var p,h,m=a.align,g="top"===m||"bottom"===m,v=g?n.inner.width:n.inner.height,y=o.ticks({settings:a,distance:v,formatter:r}).filter(mu),b=function(e){var t=i({text:e,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return t.width=vu({value:t.width,maxValue:d,minValue:f}),t};if(t&&g&&"auto"===a.labels.mode&&(!function(e){var t=e.majorTicks,n=e.measure,r=e.rect,i=e.state,o=e.settings,a=o.labels.maxGlyphCount,s="layered"===i.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,u=n("…").width,c=r.width,d=0;if(isNaN(a))for(var f=0;f<t.length;f++){var p=t[f],h=p.label;if(n(h).width*(h.length>1?l:1)+u>(d=s*c*Math.abs(p.start-p.end)))return!0}else if(d=s*c*t.reduce((function(e,t){return Math.min(Math.abs(t.start-t.end),e)}),1/0),n("M").width*l*a+u>d)return!0;return!1}({majorTicks:y,measure:b,rect:n.inner,state:s,settings:a})?s.labels.activeMode="horizontal":s.labels.activeMode="tilted"),!a.labels.filterOverlapping&&"tilted"!==s.labels.activeMode&&gu({rect:n.inner,state:s,majorTicks:y,measure:b,horizontal:g}))return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0};if("tilted"===s.labels.activeMode){var x=Math.abs(a.labels.tiltAngle)*(Math.PI/180);p=function(e){return vu({value:e.width,maxValue:d,minValue:f})*Math.sin(x)+e.height*Math.cos(x)}}else p=g?function(e){return e.height}:function(e){return vu({value:e.width,maxValue:d,minValue:f})};if(g&&"tilted"!==s.labels.activeMode)h=["M"];else if(isNaN(a.labels.maxGlyphCount))h=y.map((function(e){return e.label}));else{for(var w="",k=0;k<a.labels.maxGlyphCount;k++)w+="M";h=[w]}var C=h.map(b),S=C.map(p),E=Math.max.apply(Math,X(S).concat([0]));if(l+=E,l+=a.labels.margin,"layered"===s.labels.activeMode&&(l*=2),"tilted"===s.labels.activeMode){var M="bottom"===a.align==a.labels.tiltAngle>=0,T=Math.abs(a.labels.tiltAngle)*(Math.PI/180),D=(E-b("M").height*Math.cos(T))/Math.sin(T),_=Math.min(a.labels.maxEdgeBleed,Math.max.apply(Math,X(C.map((function(e){return Math.min(D,e.width)*Math.cos(T)+e.height})).map((function(e,t){var r=y[t]?y[t].position:0;return M?e-r*n.inner.width:e-(1-r)*n.inner.width}))).concat([0])))+a.paddingEnd;if(u[M?"left":"right"]=_,!a.labels.filterOverlapping&&function(e){var t=e.majorTicks,n=e.measureText,r=e.rect,i=e.bleedSize,o=e.angle;if(t.length<2)return!1;if(0===o)return!0;var a=Math.abs(o),s=1/(Math.min(r.outer.width-i,r.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(a*(Math.PI/180))/s}({majorTicks:y,measureText:b,rect:n,bleedSize:_,angle:a.labels.tiltAngle}))return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}return{size:l,edgeBleed:u}}var bu=function(e,t,n){return e.width*Math.abs(t.position-n.position)};function xu(e){var t=e.layered,n=e.major,r=e.innerRect,i=e.outerRect,o=e.tick,a=e.index,s=t?2:1,l=n[a-s],u=n[a+s],c=l?bu(r,o,l)/2-2:1/0,d=u?bu(r,o,u)/2-2:1/0;return n.length<2?r.width:l?u?2*Math.min(c,d):function(e){var t=e.innerRect,n=e.outerRect,r=e.tick,i=e.prevWidth,o=t.x-n.x,a=n.width-t.width-o,s=t.width-t.width*r.position+a,l=2*Math.min(i,s),u=1===r.position?t.width/2-2:0;return Math.max(i,l,u)}({innerRect:r,outerRect:i,tick:o,prevWidth:c}):function(e){var t=e.innerRect,n=e.outerRect,r=e.tick,i=e.nextWidth,o=t.x-n.x,a=t.width*r.position+o,s=2*Math.min(i,a),l=0===r.position?t.width/2-2:0;return Math.max(i,s,l)}({innerRect:r,outerRect:i,tick:o,nextWidth:d})}function wu(e){var t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0}function ku(e){var t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=wu(e)+e.labels.margin}function Cu(e,t){return e.map((function(e){return hu(e,t)}))}function Su(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function Eu(e){var t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.scale,o=e.tilted,a=e.layered,s=e.tick,l=t.height,u=Su(i,s),c={width:0,height:l};if("left"===n.align||"right"===n.align)c.width=r.width-ku(n)-n.paddingEnd;else if(a)c.width=u*r.width*2;else if(o){var d=Math.abs(n.labels.tiltAngle)*(Math.PI/180);c.width=(r.height-ku(n)-n.paddingEnd-l*Math.cos(d))/Math.sin(d)}else c.width=u*r.width;return c.width=vu({value:c.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),c}function Mu(e){var t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.outerRect,o=e.tilted,a=e.layered,s=e.tick,l=e.index,u=e.major,c=t.height,d={width:0,height:c};if("left"===n.align||"right"===n.align)d.width=r.width-ku(n)-n.paddingEnd;else if(o){var f=Math.abs(n.labels.tiltAngle)*(Math.PI/180);d.width=(r.height-ku(n)-n.paddingEnd-c*Math.cos(f))/Math.sin(f)}else d.width=xu({layered:a,major:u,innerRect:r,outerRect:i,tick:s,index:l});return d.width=vu({value:d.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),d}function Tu(e){var t;function n(){return t=Mu,n}function r(){return t=Eu,r}function i(e){var n,r=e.settings,i=e.scale,o=e.innerRect,a=e.outerRect,s=e.measureText,l=e.ticks,u=e.state,c=e.textBounds,d=[],f=function(e){return e.filter((function(e){return!e.isMinor}))}(l),p=function(e){return e.filter((function(e){return e.isMinor}))}(l),h={innerRect:o,align:r.align,outerRect:a},m="tilted"===u.labels.activeMode,g="layered"===u.labels.activeMode;if(r.line.show&&(h.style=r.line,h.padding=r.paddingStart,d.push(uu(h))),r.ticks.show&&(h.style=r.ticks,h.tickSize=r.ticks.tickSize,h.padding=wu(r),n=Cu(f,h)),r.labels.show){var v=ku(r);h.style=r.labels,h.padding=v,h.tilted=m,h.layered=g,h.angle=r.labels.tiltAngle,h.paddingEnd=r.paddingEnd,h.textBounds=c;var y=function(e,n){h.textRect=function(e){var t=e.style;return(0,e.measureText)({text:e.tick.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:s,style:h.style});var u=t({textMetrics:h.textRect,settings:r,innerRect:o,outerRect:a,scale:i,tilted:m,layered:g,tick:e,major:f,index:n});h.maxWidth=u.width,h.maxHeight=u.height,h.stepSize=function(e){var t=e.innerRect,n=e.scale,r=e.settings,i=e.tick;return("top"===r.align||"bottom"===r.align?t.width:t.height)*Su(n,i)}({innerRect:o,scale:i,ticks:l,settings:r,tick:e})},b=[];b=!g||"top"!==r.align&&"bottom"!==r.align?function(e,t,n){return e.map((function(e,r){n(e,r);var i=pu(e,t);return i.data=e.data,i}))}(f,h,y):function(e,t,n,r){var i=t.padding,o=ku(n);return e.map((function(e,a){r(e,a);var s=o+t.maxHeight+n.labels.margin;t.layer=a%2,t.padding=a%2==0?i:s;var l=pu(e,t);return l.data=e.data,l}))}(f,h,r,y),r.labels.filterOverlapping&&function(e,t,n){var r=function(t,n){return Ss(ae(1,e[t].boundingRect),ae(1,e[n].boundingRect))};if(n&&n.tilted){var i=Math.abs(n.angle);r=function(t,n){var r=1/Math.abs(e[t].x-e[n].x),o=Math.sin(i*(Math.PI/180))/r;return e[t].boundingRect.height>o}}for(var o=0;o<=e.length-1;o++)for(var a=o+1;a<=Math.min(o+5,o+(e.length-1));a++)e[o]&&e[a]&&r(o,a)&&(a===e.length-1?(e.splice(o,1),t&&t.splice(o,1)):(e.splice(a,1),t&&t.splice(a,1)),a--,o--)}(b,n,h),d.push.apply(d,X(b))}return r.minorTicks&&r.minorTicks.show&&p.length>0&&(h.style=r.minorTicks,h.tickSize=r.minorTicks.tickSize,h.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(r),d.push.apply(d,X(Cu(p,h)))),n&&d.push.apply(d,X(n)),d}return n.build=i,r.build=i,e?r():n()}var Du={labels:{show:!0,tiltAngle:40,tiltThreshold:.7,maxEdgeBleed:1/0,margin:4,maxLengthPx:150,minLengthPx:0,mode:"auto",maxGlyphCount:NaN,align:.5,offset:0,filterOverlapping:!1},ticks:{show:!1,margin:0,tickSize:4},line:{show:!1},paddingStart:0,paddingEnd:10,align:"auto"},_u={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};var Nu={require:["chart","renderer","dockConfig"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{},style:{labels:"$label",ticks:"$guide-line",minorTicks:"$guide-line--minor",line:"$guide-line"}},created:function(){this.state={isDiscrete:!!this.scale.bandwidth,isHorizontal:!1,labels:{activeMode:"horizontal"},ticks:[],innerRect:{width:0,height:0,x:0,y:0},outerRect:{width:0,height:0,x:0,y:0},defaultDock:void 0,concreteNodeBuilder:void 0,settings:void 0},this.state.isDiscrete?this.state.defaultDock="bottom":this.state.defaultDock="left",this.setState(this.settings)},setState:function(){var e,t,n,r;this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(e){var t=e.state,n=e.style,r=e.settings,i=D(!0,{},t.isDiscrete?Du:_u,n),o=D(!0,{},i,r.settings),a=r.layout.dock||t.defaultDock;o.dock=a,o.align=function(e,t){var n=["top","bottom"],r=["left","right"];return-1!==n.indexOf(e)&&-1===r.indexOf(t)||-1!==r.indexOf(e)&&-1===n.indexOf(t)?e:t}(r.settings.align,a),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));var s=o.paddingStart,l=o.paddingEnd;return o.paddingStart="function"==typeof s?s.call(null):s,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=Tu(this.state.isDiscrete),this.dockConfig.dock(this.state.settings.dock),this.state.isHorizontal="top"===this.state.settings.align||"bottom"===this.state.settings.align,this.state.labels.activeMode=(e=this.state,t=this.state.settings,n=this.state.isDiscrete,r=t.labels.mode,n&&e.isHorizontal?"auto"===r?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?r:"horizontal":"horizontal")},preferredSize:function(e){var t=this.formatter,n=this.state,r=this.scale,i=this.state.isHorizontal?e.inner.width:e.inner.height;return this.state.pxScale=Ma(r,i),function(e){var t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,a=e.settings,s=0,l=yu({isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:e.state}),u=l.size,c=l.edgeBleed;if(s+=u,l.isToLarge)return{size:s};if(a.ticks.show&&(s+=a.ticks.margin,s+=a.ticks.tickSize),a.minorTicks&&a.minorTicks.show){var d=a.minorTicks.margin+a.minorTicks.tickSize;d>s&&(s=d)}if(a.line.show){var f=a.line.strokeWidth/2;s+=f,c[function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return e}}(a.align)]=Math.ceil(f)}return s+=a.paddingStart,{size:s+=a.paddingEnd,edgeBleed:c}}({isDiscrete:this.state.isDiscrete,rect:{inner:e.inner,outer:e.outer},formatter:t,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n})},beforeUpdate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.settings;this.setState(t)},resize:function(e){var t=e.inner,n=e.outer,r=D({},t,function(e){var t=e.align,n=e.inner;return"left"===t?{x:n.width+n.x}:"right"===t||"bottom"===t?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:t})),i=n||r;return D(this.state.innerRect,r),D(this.state.outerRect,i),n},beforeRender:function(){var e=this.scale,t=this.formatter,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=Ma(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter((function(e){return e.position>=0&&e.position<=1}))},render:function(){var e=this.state,t=[];return t.push.apply(t,X(this.state.concreteNodeBuilder.build({settings:this.state.settings,scale:this.state.pxScale,innerRect:this.state.innerRect,outerRect:this.state.outerRect,measureText:this.renderer.measureText,textBounds:this.renderer.textBounds,ticks:this.state.ticks,state:e}))),Jl.multiple(t),t}};var qu={render:function(){return[]}};function Ru(e,t,n){var r="";if("function"==typeof e)r=e();else if("string"==typeof e)r=e;else if(n){r=(n.data().fields||[]).map((function(e){return e.title()})).join(t)}return r}function Pu(e,t){var n="middle";return"left"===e?"top"===t?n="end":"bottom"===t&&(n="start"):"right"===e?"top"===t?n="start":"bottom"===t&&(n="end"):"left"===t?n="start":"right"===t&&(n="end"),n}var Au={require:["renderer","chart"],defaultSettings:{layout:{dock:"bottom",displayOrder:0,prioOrder:0},settings:{paddingStart:5,paddingEnd:5,paddingLeft:0,paddingRight:0,anchor:"center",join:", ",maxLengthPx:NaN},style:{text:"$title"}},created:function(){this.definitionSettings=this.settings.settings;var e=this.settings.text,t=this.definitionSettings.join;this.title=Ru(e,t,this.scale)},preferredSize:function(){return this.renderer.measureText({text:this.title,fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily}).height+this.definitionSettings.paddingStart+this.definitionSettings.paddingEnd},render:function(){var e=this.title,t=this.definitionSettings,n=this.rect,r=[];return r.push(function(e){var t=e.title,n=e.definitionSettings,r=e.dock,i=e.rect,o=e.measureText,a=e.style,s={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:Pu(r,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};D(s,a.text);var l=o(s);if("top"===r||"bottom"===r){var u=i.width/2;"left"===n.anchor?u=n.paddingLeft||0:"right"===n.anchor&&(u=i.width-(n.paddingRight||0)),s.x=u,s.y="top"===r?i.height-n.paddingStart:n.paddingStart+l.height,s.dy="top"===r?-l.height/6:-l.height/3,s.maxWidth=.8*i.width}else{var c=i.height/2;"top"===n.anchor?c=n.paddingStart:"bottom"===n.anchor&&(c=i.height-n.paddingStart),s.y=c,s.x="left"===r?i.width-n.paddingStart:n.paddingStart,s.dx="left"===r?-l.height/3:l.height/3;var d="left"===r?270:90;s.transform="rotate(".concat(d,", ").concat(s.x+s.dx,", ").concat(s.y+s.dy,")"),s.maxWidth=.8*i.height}return isNaN(n.maxLengthPx)||(s.maxWidth=Math.min(s.maxWidth,n.maxLengthPx)),s}({title:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),r},beforeUpdate:function(e){e.settings&&(D(this.settings,e.settings),this.definitionSettings=e.settings.settings);var t=this.settings.text,n=this.definitionSettings.join;this.title=Ru(t,n,this.scale)}};function Iu(e,t){var n,r=e.settings.layout.dock,i=e.settings.settings.invert,o="top"===r||"bottom"===r,a=o?"width":"height",s=e.rect[a],l=e.chart.scroll(e.settings.scroll),u=t[o?"x":"y"];i&&(u=s-u);var c=l.getState();n={startOffset:u,startScroll:c.start,swipe:!1};var d=u/s*(c.max-c.min)+c.min;d<c.start?n.startScroll=d:d>c.start+c.viewSize&&(n.startScroll=d-c.viewSize);return{update:function(e){var t=e[o?"x":"y"];if(i&&(t=s-t),!n.swipe){if(Math.abs(n.startOffset-t)<=1)return;n.swipe=!0}var r=l.getState(),a=(t-n.startOffset)/s*(r.max-r.min),u=n.startScroll+a;l.moveTo(u)},end:function(e){var t=e[o?"x":"y"];i&&(t=s-t);var r=l.getState();if(n.swipe){var a=(t-n.startOffset)/s*(r.max-r.min),u=n.startScroll+a;l.moveTo(u)}else{var c=t/s*(r.max-r.min)+r.min-r.viewSize/2;l.moveTo(c)}}}}function Ou(e,t){var n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}var Lu={require:["chart","renderer"],on:{panStart:function(e){var t=Ou(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=Iu(this,n),this.currentMove.update(t)},panMove:function(e){if(this.currentMove){var t=Ou(e,this.renderer);this.currentMove.update(t)}},panEnd:function(e){if(this.currentMove){var t=Ou(e,this.renderer);this.currentMove.end(t),this.currentMove=null}},panCancel:function(){this.currentMove=null},tap:function(e){var t=Ou(e,this.renderer);Iu(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){var t=this.chart.scroll(this.settings.scroll).getState();return t.viewSize>=t.max-t.min?Math.max(e.width,e.height):this.settings.settings.width},render:function(e){var t,n=this.settings.layout.dock,r=this.settings.settings.invert,i="top"===n||"bottom"===n,o=i?"width":"height",a=this.rect[o],s=this.chart.scroll(this.settings.scroll).getState(),l=a*(s.start-s.min)/(s.max-s.min),u=a*s.viewSize/(s.max-s.min);return r&&(l=a-l-u),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("div",{class:"scroller",style:(t={position:"absolute"},O(t,i?"left":"top","".concat(l,"px")),O(t,i?"top":"left","25%"),O(t,i?"height":"width","50%"),O(t,o,"".concat(Math.max(1,u),"px")),O(t,"background",this.settings.settings.thumbColor),t)})))},renderer:"dom"};function zu(e){var t=e.h,n=e.isVertical,r=e.value,i=e.pos,o=e.align,a=e.borderHit,s=e.state,l=e.idx,u="end"!==o,c=u?{left:"0",top:"0"}:{right:"0",bottom:"0"},d=0,f="100%",p="100%";return s.targetRect&&"start"===s.settings.bubbles.align?(f="".concat(s.targetRect.x+s.targetRect.width,"px"),p="".concat(s.targetRect.y+s.targetRect.height,"px")):s.targetRect&&"end"===s.settings.bubbles.align&&(d=n?s.targetRect.x:s.targetRect.y,f="".concat(s.rect.width-d,"px"),p="".concat(s.rect.height-d,"px")),u||(i-=a),t("div",{onmouseover:function(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout:function(e){e.srcElement.children[0].style.backgroundColor=s.style.line.stroke,e.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":r,"data-key":[s.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?d:i,"px"),top:"".concat(n?i:d,"px"),height:n?"".concat(a,"px"):p,width:n?f:"".concat(a,"px"),pointerEvents:"auto"}},[t("div",{style:D({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},c)})])}function Fu(e){var t,n,r=e.h,i=e.isVertical,o=e.label,a=e.otherValue,s=e.rangeIdx,l=e.idx,u=e.pos,c=e.align,d=e.state,f=e.value,p="end"!==c,h="outside"===d.settings.bubbles.placement,m="none";i?(n=p?"left":"right",h&&(m=p?"translate(-100%, 0px)":"translate(100%, 0px)")):(n=p?"top":"bottom",h&&(m=p?"translate(0px, -100%)":"translate(0px, 100%)"));var g=d.edit&&d.edit.rangeIdx===s&&d.edit.bubbleIdx===l,v={position:"relative",borderRadius:"".concat(d.style.bubble.borderRadius,"px"),border:"".concat(d.style.bubble.strokeWidth,"px solid ").concat(d.style.bubble.stroke),backgroundColor:d.style.bubble.fill,color:d.style.bubble.color,fontFamily:d.style.bubble.fontFamily,fontSize:d.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:i?"translate(0,-50%)":"translate(-50%,0)",cursor:i?"ns-resize":"ew-resize"},y=d.style.bubble.stroke,b=g?r("input",{type:"text",value:f,style:q(q({},v),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup:function(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();var t=parseFloat(e.target.value);isNaN(t)?(y="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(d.style.bubble.strokeWidth,"px solid ").concat(y)):d.onEditConfirmed(s,t,a)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),d.onEditCanceled())}}):r("div",{"data-key":[d.key,"bubble",s,l].join("-"),"data-other-value":a,"data-idx":s,"data-bidx":l,style:v},[o]);return r("div",{style:(t={position:"absolute"},O(t,n,"0"),O(t,i?"top":"left","".concat(u,"px")),O(t,"transform",m),t)},[b])}function ju(e){var t=e.h,n=e.isVertical,r=e.top,i=e.height,o=e.color,a=e.on,s=e.opacity;return t("div",D({style:{backgroundColor:o,opacity:s,position:"absolute",left:n?0:"".concat(r,"px"),top:n?"".concat(r,"px"):0,height:n?"".concat(i,"px"):"100%",width:n?"100%":"".concat(i,"px"),pointerEvents:"auto"}},a),[])}function Hu(e){var t=e.borderHit,n=e.els,r=e.isVertical,i=e.state,o=e.vStart,a=e.vEnd,s=e.idx,l=0;i.targetRect&&(l=r?i.targetRect.y:i.targetRect.x);var u=!!i.scale,c=u?i.scale.norm(o)*i.size:o,d=u?i.scale.norm(a)*i.size:a,f=Math.abs(c-d),p=Math.min(c,d)+l,h=p+f;if(i.targetRect){var m=i.targetFillRect||i.targetRect,g=r?m.height:m.width,v=u?i.scale.norm(o)*g:o,y=u?i.scale.norm(a)*g:a,b=Math.abs(v-y),x=Math.min(v,y),w={h:i.h,isVertical:r,top:x,height:b,color:i.style.target.fill,opacity:i.style.target.opacity};i.style.target.opacity<.8&&(w.on={onmouseover:function(e){e.srcElement.style.opacity=i.style.target.opacity+.1},onmouseout:function(e){e.srcElement.style.opacity=i.style.target.opacity}}),n.push(i.h("div",{style:{position:"absolute",left:"".concat(m.x,"px"),top:"".concat(m.y,"px"),height:"".concat(m.height,"px"),width:"".concat(m.width,"px")}},[ju(w)]))}var k=c<d?o:a,C=c<d?a:o,S=Y(u?i.scale.domain():[Math.min(o,a),Math.max(o,a)],2),E=S[0],M=S[1],T=k+1e-5>=E&&k-1e-5<=M,D=C-1e-5<=M&&C+1e-5>=E;T&&n.push(zu({h:i.h,isVertical:r,borderHit:t,value:k,pos:p,align:"start",state:i,idx:s})),D&&n.push(zu({h:i.h,isVertical:r,borderHit:t,value:C,pos:h,align:"end",state:i,idx:s}));var _=i.settings.bubbles;if(_&&_.show){var N={fontSize:_.fontSize,fontFamily:_.fontFamily,color:_.fill},q=[o,a];T&&n.push(Fu({h:i.h,isVertical:r,align:_.align,style:N,rangeIdx:s,idx:0,otherValue:C,value:k,label:"".concat(i.format(k,q)),pos:p,state:i})),D&&n.push(Fu({h:i.h,isVertical:r,align:_.align,style:N,rangeIdx:s,idx:1,otherValue:k,value:C,label:"".concat(i.format(C,q)),pos:h,state:i}))}}function Bu(e){var t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start,r=e.current-e.start;return r=r<0?Math.max(r,n):Math.min(r,t)}function Vu(e){var t=[],n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach((function(r,i){e.active&&i===e.active.idx||Hu({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(r.min,r.max),vEnd:Math.max(r.min,r.max),idx:i})})),e.active){var r=e.start,i=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)r=Math.min(e.active.start,e.active.end),i=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)r=Math.min(e.start,e.current),i=Math.max(e.start,e.current);else{var o=Bu(e);r=e.active.start+o,i=e.active.end+o}Hu({borderHit:5,els:t,isVertical:n,state:e,vStart:r,vEnd:i,idx:e.active.idx})}return t}function Wu(e){return{min:e.scale.min(),max:e.scale.max()}}function Uu(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function $u(e,t,n){var r,i,o=e.ranges,a=-1;for(r=0;r<o.length;r++){if(o[r].min<=t&&t<=o[r].max){a=r,n.min=r?o[r-1].max:n.min,n.max=r+1<o.length?o[r+1].min:n.max;break}if(t<o[r].min){n.max=o[r].min,n.min=r?o[r-1].max:n.min;break}}-1===a&&o.length&&r>=o.length&&(n.min=o[o.length-1].max),-1!==a&&(i={idx:a,start:o[a].min,end:o[a].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=i}function Yu(e){e.renderer.render(Vu(e))}function Xu(e,t){if(!t||!t.isActive())return[];var n=e.scale.data(),r=(n&&n.fields||[]).map((function(e){return e.id()})),i=t.brushes().filter((function(e){return"range"===e.type&&-1!==r.indexOf(e.id)}))[0];return i?i.brush.ranges():[]}function Ku(e,t){for(var n,r=1/0,i=t.domain(),o=t.bandwidth()/2,a=0;a<i.length;++a){var s=Math.abs(e-o-t(i[a]));s<r&&(r=s,n=i[a])}return n}function Gu(e,t){return Math.min.apply(Math,X(e))<=Math.max.apply(Math,X(t))&&Math.max.apply(Math,X(e))>=Math.min.apply(Math,X(t))}function Ju(e){return re(e.reduce((function(e,t){return e.push.apply(e,X(ne(t.bounds))),e}),[]))}var Zu={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{rangeStart:function(e){this.start(e)},rangeMove:function(e){this.move(e)},rangeEnd:function(e){this.end(e)},rangeClear:function(e){this.clear(e)},bubbleStart:function(e){this.bubbleStart(e)}},created:function(){this.state={key:this.settings.key||"brush-range"}},beforeRender:function(e){this.state.rect=e.size.computedInner},renderRanges:function(){this.state.started||(this.state.ranges=Xu(this.state,this.state.brushInstance),this.state.active=null,Yu(this.state))},render:function(e){var t=this,n=this.settings.settings;this.state.direction="vertical"===n.direction?0:1;var r=this.renderer.element().getBoundingClientRect(),i=this.state.rect[0===this.state.direction?"height":"width"],o=Ma(this.chart.scale(n.scale),i),a=function(e){var t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,r=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map((function(t){return e.chart.component(t)})).filter((function(e){return!!e&&!!e.rect})),i=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(i.length>0){var a=Ju(i);if(t.size=a[0===e.state.direction?"height":"width"],t.scale=Ma(e.chart.scale(n.scale),t.size),t.targetRect=a,o.length>0){var s=Ju(o);t.targetFillRect=s}}else if(r&&r.length>0){var l=r.slice(1).reduce((function(e,t){return{x0:Math.min(e.x0,t.rect.computedInner.x),y0:Math.min(e.y0,t.rect.computedInner.y),x1:Math.max(e.x1,t.rect.computedInner.x+t.rect.computedInner.width),y1:Math.max(e.y1,t.rect.computedInner.y+t.rect.computedInner.height)}}),{x0:r[0].rect.computedInner.x,y0:r[0].rect.computedInner.y,x1:r[0].rect.computedInner.x+r[0].rect.computedInner.width,y1:r[0].rect.computedInner.y+r[0].rect.computedInner.height});t.targetRect={x:l.x0-e.state.rect.x,y:l.y0-e.state.rect.y,width:l.x1-l.x0,height:l.y1-l.y0}}return t}(this);if(o=a.scale?a.scale:o,this.state.targetRect=a.targetRect,this.state.targetFillRect=a.targetFillRect,this.state.size=null===a.size?i:a.size,this.state.settings=n,this.state.style=this.style,this.state.offset=r,this.state.brush="object"===R(n.brush)?n.brush.context:n.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!n.multiple,this.state.h=e,this.state.onEditConfirmed=function(e,n,r){t.state.edit=null,function(e,t,n,r){var i=e.ranges.map((function(e){return{min:e.min,max:e.max}})),o=e.scale.min(),a=e.scale.max();i[t]={min:Math.max(o,Math.min(n,r)),max:Math.min(a,Math.max(n,r))},e.ranges[t]=q({},i[t]);var s=e.scale.data();s&&s.fields&&s.fields.forEach((function(t){e.fauxBrushInstance||e.brushInstance.setRange(t.id(),i)}))}(t.state,e,n,r),t.emit("bubbleEnd"),Yu(t.state)},this.state.onEditCanceled=function(){t.state.edit=null,Yu(t.state)},this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX"},this.state.format="function"==typeof n.bubbles.label&&function(e,r){return n.bubbles.label.call(void 0,{datum:e,data:r,scale:o,resources:{scale:t.chart.scale,formatter:t.chart.formatter}})},{}.hasOwnProperty.call(o,"norm")){this.state.editable=!0,this.state.observeBrush="object"===R(n.brush)&&n.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=o;var s=this.state.scale.data();!this.state.format&&s&&s.fields&&s.fields[0]&&(this.state.format=s.fields[0].formatter())}else this.state.editable=!1,this.state.scale=xo(),this.state.scale.data=o.data,this.state.format||(this.state.format=function(e,t){return Gu(o.range(),t)?function(e,t){var n=t.ticks(),r=t.domain().indexOf(Ku(e,t));return-1!==r?n[r].label:"-"}(e,o):"-"}),this.state.fauxBrushInstance=ma(),this.state.findValues=function(e){return function(e,t){var n=t.domain(),r=t.range(),i=[];return e.forEach((function(e){if(Gu(r,[e.min,e.max])){var o=n.indexOf(Ku(e.min,t)),a=n.indexOf(Ku(e.max,t));i.push.apply(i,n.slice(Math.min(o,a),Math.max(o,a)+1))}})),i}(e,o)};return this.state.ranges=Xu(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[Vu(this.state)]:[]},mounted:function(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy:function(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start:function(e){!function(e){var t=e.state,n=e.e,r=e.renderer,i=e.ranges,o=e.targetSize;if(!t.started){t.edit=null;var a=n.center.x-n.deltaX,s=n.center.y-n.deltaY,l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);var u={started:!0};t.offset=D({},r.element().getBoundingClientRect());var c=a-t.offset.left,d=s-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=i(t,t.fauxBrushInstance||t.brushInstance);var f=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],p=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];u.current=t.scale.normInvert(p/t.size),u.start=t.scale.normInvert(f/t.size);var h,m,g=t.ranges,v=Wu(t),y=-1;if(l&&l.hasAttribute("data-idx"))y=parseInt(l.getAttribute("data-idx"),10),v.min=y>0?g[y-1].max:v.min,v.max=y+1<g.length?g[y+1].min:v.max;else{for(h=0;h<g.length;h++){if(g[h].min<=u.start&&u.start<=g[h].max){y=h,v.min=h?g[h-1].max:v.min,v.max=h+1<g.length?g[h+1].min:v.max;break}if(u.start<g[h].min){v.max=g[h].min,v.min=h?g[h-1].max:v.min;break}}-1===y&&g.length&&h>=g.length&&(v.min=g[g.length-1].max)}if(-1!==y||t.multi||(u.ranges=[],v.min=t.scale.min(),v.max=t.scale.max()),-1!==y)if(m={idx:y,start:g[y].min,end:g[y].max,limitLow:v.min,limitHigh:v.max,mode:"move"},l&&l.hasAttribute("data-other-value"))u.start=parseFloat(l.getAttribute("data-other-value")),m.mode="modify";else{var b=t.scale.norm(m.start)*t.size,x=t.scale.norm(m.end)*t.size;Math.abs(f-b)<=o?(u.start=m.end,m.mode="modify"):Math.abs(f-x)<=o&&(u.start=m.start,m.mode="modify")}else m={idx:-1,start:u.start,end:u.current,limitLow:v.min,limitHigh:v.max,mode:"current"};u.active=m,"modify"!==m.mode&&t.targetRect&&!Ms(t.targetRect,{x:c,y:d})||Object.keys(u).forEach((function(e){return t[e]=u[e]}))}}({e:e,state:this.state,renderer:this.renderer,ranges:Xu,targetSize:5})},end:function(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);var n=Wu(e);$u(e,e.current,n)}(this.state,Xu),Yu(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move:function(e){this.state.started&&(!function(e,t){var n=(t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset])/e.size,r=e.scale.normInvert(n);e.current=Math.max(Math.min(r,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){var t=e.ranges.map((function(e){return{min:e.min,max:e.max}}));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{var n=Bu(e);t[e.active.idx].min+=n,t[e.active.idx].max+=n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});var r=e.scale.data();r&&r.fields&&r.fields.forEach((function(n){if(e.fauxBrushInstance){var r=Xu(e,e.fauxBrushInstance),i=e.findValues(r),o=e.findValues(t),a=o.filter((function(e){return-1===i.indexOf(e)})),s=i.filter((function(e){return-1===o.indexOf(e)})),l=a.map((function(e){return{key:n.id(),value:e}})),u=s.map((function(e){return{key:n.id(),value:e}}));e.brushInstance.addAndRemoveValues(l,u),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)}))}(this.state),Yu(this.state))},clear:function(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart:function(e){if(this.state.editable){var t=e.srcEvent||e,n=t.target,r={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(!isNaN(r.rangeIdx)&&JSON.stringify(r)!==JSON.stringify(this.state.edit)){this.state.edit=r,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();var i=n.parentNode;Yu(this.state);var o=i.querySelector("input");o.focus(),o.select()}}}};function Qu(e){e.renderer.render(Vu(e))}function ec(e){return e.rc.ranges()}var tc={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{areaStart:function(e){this.start(e)},areaMove:function(e){this.move(e)},areaEnd:function(e){this.end(e)},areaClear:function(e){this.clear(e)}},created:function(){this.state={key:this.settings.key||"brush-area-dir"}},render:function(e){var t=this;this.state.rect=this.rect;var n=this.settings.settings,r="vertical"===n.direction?0:1,i=this.state.rect[0===r?"height":"width"],o=this.renderer.element().getBoundingClientRect(),a=(n.target?n.target.components||[n.target.component]:[]).map((function(e){return t.chart.component(e)})).filter((function(e){return!!e&&!!e.rect})),s=a[0]?a.slice(1).reduce((function(e,t){return{x0:Math.min(e.x0,t.rect.x),y0:Math.min(e.y0,t.rect.y),x1:Math.max(e.x1,t.rect.x+t.rect.width),y1:Math.max(e.y1,t.rect.y+t.rect.height)}}),{x0:a[0].rect.x,y0:a[0].rect.y,x1:a[0].rect.x+a[0].rect.width,y1:a[0].rect.y+a[0].rect.height}):null;return this.state.targetRect=s?{x:s.x0-this.rect.x,y:s.y0-this.rect.y,width:s.x1-s.x0,height:s.y1-s.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=r,this.state.settings=n,this.state.offset=o,this.state.rc=ta(),this.state.renderer=this.renderer,this.state.multi=!!n.multiple,this.state.h=e,this.state.size=i,this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX",area:0===this.state.direction?"height":"width"},this.state.format=function(e,t){return function(e,t,n){var r=Math.min.apply(Math,X(n)),i=Math.max.apply(Math,X(n)),o={x:e.direction?r+e.rect.x:e.rect.x,y:e.direction?e.rect.y:r+e.rect.y,width:e.direction?i-r:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:i-r},a=e.chart.shapesAt(o,e.settings.brush);if(0===a.length)return"-";var s=a.reduce((function(n,i){var o=n.bounds,a=i.bounds;return t===r?o[e.cssCoord.coord]<=a[e.cssCoord.coord]?n:i:o[e.cssCoord.coord]+o[e.cssCoord.area]>=a[e.cssCoord.coord]+a[e.cssCoord.area]?n:i})),l=e.settings.brush.components.reduce((function(e,t){return e.key===s.key?e:t}));return"function"==typeof e.settings.bubbles.label?e.settings.bubbles.label(s.data):Array.isArray(l.data)&&l.data.length?s.data[l.data[0]].label:s.data&&s.data.label?s.data.label:"-"}(this,e,t)},[]},start:function(e){!function(e){var t=e.state,n=e.e,r=e.renderer,i=e.ranges,o=e.targetSize;if(!t.started){var a=n.center.x-n.deltaX,s=n.center.y-n.deltaY,l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);var u={started:!0};t.offset=r.element().getBoundingClientRect(),t.ranges=i(t);var c=a-t.offset.left,d=s-t.offset.top,f=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],p=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset],h=p,m=f;u.start=f,u.current=p;var g,v,y=t.ranges,b=Uu(t),x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),b.min=x>0?y[x-1].max:b.min,b.max=x+1<y.length?y[x+1].min:b.max;else{for(g=0;g<y.length;g++){if(y[g].min<=m&&m<=y[g].max){x=g,b.min=g?y[g-1].max:b.min,b.max=g+1<y.length?y[g+1].min:b.max;break}if(m<y[g].min){b.max=y[g].min,b.min=g?y[g-1].max:b.min;break}}-1===x&&y.length&&g>=y.length&&(b.min=y[y.length-1].max)}if(-1!==x||t.multi||(u.ranges=[],b.min=0,b.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(v={idx:x,start:y[x].min,end:y[x].max,limitLow:b.min,limitHigh:b.max,mode:"move"},l&&l.hasAttribute("data-other-value"))u.start=parseFloat(l.getAttribute("data-other-value")),v.mode="modify";else{var w=v.start,k=v.end;Math.abs(f-w)<=o?(u.start=v.end,v.mode="modify"):Math.abs(f-k)<=o&&(u.start=v.start,v.mode="modify")}else v={idx:-1,start:m,end:h,limitLow:b.min,limitHigh:b.max,mode:"current"};u.active=v,"modify"!==v.mode&&t.targetRect&&!Ms(t.targetRect,{x:c,y:d})||Object.keys(u).forEach((function(e){return t[e]=u[e]}))}}({e:e,state:this.state,renderer:this.renderer,ranges:ec,targetSize:5})},end:function(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);var n=Uu(e);$u(e,e.current,n)}(this.state,ec),Qu(this.state))},move:function(e){this.state.started&&(!function(e,t){var n=t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];e.current=Math.max(Math.min(n,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){var t=e.ranges.map((function(e){return{min:e.min,max:e.max}}));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{var n=Bu(e);t[e.active.idx].min=e.active.start+n,t[e.active.idx].max=e.active.end+n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});e.rc.set(t);var r=[];t.forEach((function(t){r.push.apply(r,X(function(e,t){var n={x:e.direction?t.min+e.rect.x:e.rect.x,y:e.direction?e.rect.y:t.min+e.rect.y,width:e.direction?t.max-t.min:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:t.max-t.min};return e.chart.shapesAt(n,e.settings.brush)}(e,t)))})),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,r)}(this.state),Qu(this.state))},clear:function(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function nc(e){var t="vertical"===e.direction,n=e.rect[t?"height":"width"],r=e.rect[t?"width":"height"];return function(e){var t=e.brush;if(!t||!t.isActive())return[];var n=e.scale.data(),r=(n&&n.fields||[]).map((function(e){return e.id()})),i=t.brushes().filter((function(e){return"range"===e.type&&-1!==r.indexOf(e.id)}))[0];return i?i.brush.ranges():[]}(e).map((function(i){var o=e.scale(i.min)*n,a=e.scale(i.max)*n,s=Math.min(o,a),l=Math.abs(o-a);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:s,width:t?r:l,y:t?s:0,height:t?l:r}}))}function rc(e,t,n,r){function i(){!function(e){e.renderer.render(nc(e))}(e)}function o(){!function(e){e.renderer.render(nc(e))}(e)}function a(){!function(e){e.renderer.render(nc(e))}(e)}e.brush=t,t&&(t.on("start",i),t.on("update",o),t.on("end",a),e.start=i,e.update=o,e.end=a,e.brush=t,e.scale=n,e.renderer=r)}function ic(e){e.brush&&(e.brush.removeListener("start",e.start),e.brush.removeListener("update",e.update),e.brush.removeListener("end",e.end)),e.start=void 0,e.update=void 0,e.end=void 0,e.brush=void 0,e.scale=void 0,e.renderer=void 0}var oc={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:function(){return 50},created:function(){this.state={}},render:function(){var e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",r="horizontal"===n?this.rect.width:this.rect.height,i=Ma(this.chart.scale(e.scale),r);return ic(this.state),rc(this.state,t,i,this.renderer),this.state.rect=this.rect,this.state.fill=e.fill||"#ccc",this.state.opacity=void 0!==e.opacity?e.opacity:1,this.state.direction=n,nc(this.state)},beforeDestroy:function(){ic(this.state)}};function ac(e,t){var n=t.center.x,r=t.center.y;return{x:n-e.left,y:r-e.top}}function sc(e,t,n){return Xa(e,t.points[0])<Math.pow(n.settings.snapIndicator.threshold,2)}function lc(e,t){null==e.path.d?e.path.d="M".concat(t.x," ").concat(t.y," "):e.path.d+="L".concat(t.x," ").concat(t.y," "),e.points.push(t)}function uc(e){var t=e.state,n=e.start,r=void 0===n?null:n,i=e.end,o=void 0===i?null:i;null!==r&&(t.snapIndicator.x1=r.x,t.snapIndicator.y1=r.y),null!==o&&(t.snapIndicator.x2=o.x,t.snapIndicator.y2=o.y)}function cc(e,t){e.snapIndicator.visible=t}var dc={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart:function(e){this.start(e)},lassoEnd:function(e){this.end(e)},lassoMove:function(e){this.move(e)},lassoCancel:function(){this.cancel()}},created:function(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start:function(e){var t;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(e,t){var n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=this.settings.settings.brush.components.map((function(e){return{key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"}}));var n=ac(this.state.rendererBounds,e);lc(this.state,n),uc({state:this.state,start:n}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,n)},move:function(e){if(this.state.active){var t=ac(this.state.rendererBounds,e);sc(t,this.state,this.settings)?cc(this.state,!0):cc(this.state,!1),lc(this.state,t),uc({state:this.state,end:t}),function(e,t){var n=[e.startPoint,e.path,e.snapIndicator].filter((function(e){return e.visible}));t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){var n=e.points[e.points.length-2],r=e.points[e.points.length-1];e.lineBrushShape.x1=n.x+e.componentDelta.x,e.lineBrushShape.y1=n.y+e.componentDelta.y,e.lineBrushShape.x2=r.x+e.componentDelta.x,e.lineBrushShape.y2=r.y+e.componentDelta.y;var i=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(i,{components:e.brushConfig})}}(this.state,this.chart)}},end:function(e){this.state.active&&(cc(this.state,!1),sc(ac(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){var n=e.componentDelta.x,r=e.componentDelta.y,i=e.points.map((function(e){return{x:e.x+n,y:e.y+r}})),o=t.shapesAt({vertices:i},{components:e.brushConfig});t.brushFromShapes(o,{components:e.brushConfig})}}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},cancel:function(){this.state.active&&(!function(e,t){e.brushConfig.forEach((function(e){e.contexts.forEach((function(e){t.brush(e).end()}))}))}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},render:function(){}};function fc(e,t,n,r,i){for(var o,a=0,s=t.length-1;a<s;){var l=Math.floor((a+s)/2);(o=i(t[l]))[n]+o[r]<e[n]?a=l+1:s=l}return a}function pc(e){var t=e.orientation,n=e.targetNodes,r=e.labels,i=e.container,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fc,a=[],s="v"===t?"x":"y",l="v"===t?"width":"height",u=function(e){return e.textBounds},c=function(e){return e.node.localBounds};return function(e,t){var d=r[t],f=d.textBounds,p=d.node;if(f[s]<i[s]||f[s]+f[l]>i[s]+i[l])return!1;for(var h=o(f,a,s,l,u);h<a.length;h++)if(Ss(f,a[h].textBounds))return!1;for(var m=o(f,n,s,l,c),g=f[s]+f[l],v=m;v<n.length;v++){var y=n[v].node;if(g<y.localBounds[s])break;if(Ss(f,y.localBounds)&&p!==y)return!1}return a.push(r[t]),!0}}function hc(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function mc(e){var t=R(e);return("string"===t||"number"===t)&&""!==e}function gc(e){return q({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds)}function vc(e,t,n){return n?e.width>=t.height:e.width>=t.width}function yc(e,t,n){return n?e.height>=t.width:e.height>=t.height}function bc(e,t,n,r,i){var o,a;return"v"===e?(o=r||i||vc(t,n,!0),a=yc(t,n,!r)):(o=vc(t,n),a=i||yc(t,n,!1)),o&&a}function xc(e,t,n,r){return e+.5*t+(r-.5)*(t-n)-.5*n}function wc(e,t,n){var r={type:"text",text:t,maxWidth:n.rotate?e.height:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:n.rotate?"end":"start",baseline:"central",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(!n.overflow&&!function(e,t,n){return vc(e,t,n.rotate)&&yc(e,t,n.rotate)}(e,i,n))return!1;var o=.5*i.height;return n.rotate?(r.x=xc(e.x,e.width,i.height,n.align)+o,r.y=xc(e.y,e.height,i.width,n.justify),r.transform="rotate(-90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,")")):(r.x=xc(e.x,e.width,i.width,n.align),r.y=xc(e.y,e.height,i.height,n.justify)+o),r}function kc(e){var t=e.bar,n=e.view,r=e.direction,i=e.position,o=e.padding,a=void 0===o?4:o,s={};if(D(s,t),i&&"inside"!==i)if("up"===r||"down"===r){var l=Math.max(0,Math.min(t.y,n.height)),u=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===i&&"up"===r||"opposite"===i&&"down"===r?(s.y=0,s.height=l):("outside"===i&&"down"===r||"opposite"===i&&"up"===r)&&(s.y=u,s.height=n.height-u)}else{var c=Math.max(0,Math.min(t.x,n.width)),d=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===i&&"left"===r||"opposite"===i&&"right"===r?(s.x=0,s.width=c):("outside"===i&&"right"===r||"opposite"===i&&"left"===r)&&(s.x=d,s.width=n.width-d)}else;return function(e,t){var n=Math.max(0,Math.min(e.y,t.height)),r=Math.max(0,Math.min(e.y+e.height,t.height)),i=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=i,e.width=o-i,e.y=n,e.height=r-n}(s,n),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.top,r=void 0===n?4:n,i=t.bottom,o=void 0===i?4:i,a=t.left,s=void 0===a?4:a,l=t.right,u=void 0===l?4:l;e.x+=s,e.width-=s+u,e.y+=r,e.height-=r+o}(s,a),s}function Cc(e){var t,n,r,i,o,a=e.direction,s=e.fitsHorizontally,l=e.measured,u=e.node,c=e.orientation,d=e.placementSettings,f=e.rect,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kc,h=[],m="h"===c?"width":"height";for(o=0;o<d.length;o++)if(r=d[o],i=p({bar:u.localBounds,view:f,direction:a,position:r.position,padding:r.padding}),h.push(i),t=!o||i[m]>t[m]?i:t,bc(c,i,l,s,r.overflow)){n=i;break}return n||(n=t,o=h.indexOf(n)),{bounds:n,placement:r=d[o]}}function Sc(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=i.top,a=void 0===o?4:o,s=i.bottom,l=void 0===s?4:s,u=i.left,c=void 0===u?4:u,d=i.right,f=void 0===d?4:d,p=e.x+e.dx,h=e.y+e.dy,m=n?Math.min(t.width,r.height):Math.min(t.height,r.width),g=n?Math.min(t.height,r.height):Math.min(t.width,r.width),v=.5*t.height,y=1e-9,b=n?p-v:p,x=n?h:h-v,w={x:b-c-y,y:x-a-y,width:g+(c+f)-y,height:m+(a+l)-y};return w}function Ec(e){for(var t,n,r,i,o,a,s,l,u,c,d,f,p,h=e.chart,m=e.targetNodes,g=e.rect,v=e.fitsHorizontally,y=e.collectiveOrientation,b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Cc,x=arguments.length>2&&void 0!==arguments[2]?arguments[2]:wc,w=arguments.length>3&&void 0!==arguments[3]?arguments[3]:pc,k=[],C={container:g,targetNodes:m,labels:[],orientation:y},S=0,E=m.length;S<E;S++){a=null,f=hc(r=(n=m[S]).node,h),p="left"===(u=n.direction)||"right"===u?"h":"v";for(var M=0;M<n.texts.length;M++)if(mc(i=n.texts[M])){var T=b({direction:u,fitsHorizontally:v,lblStngs:c=n.labelSettings[M],measured:l=n.measurements[M],node:r,orientation:p,placements:c.placements,placementSettings:n.placementSettings[M],rect:g});if(a=T.bounds,d=T.placement,a&&d){o=d.justify;var D="function"==typeof c.linkData?c.linkData(f,S):void 0,_="function"==typeof d.overflow?d.overflow(f,S):d.overflow;"up"===u&&(o=1-o),"opposite"===d.position&&(o=1-o),"left"===u&&(o=1-o);var N=!("h"===y||v);if(t=x(a,i,{justify:"h"===p?d.align:o,align:"h"===p?o:d.align,fontSize:c.fontSize,fontFamily:c.fontFamily,textMetrics:l,rotate:N,overflow:!!_})){var P=Sc(t,l,N,a,d.padding);s="function"==typeof d.fill?d.fill(q(q({},f),{},{textBounds:P}),S):d.fill,t.fill=s,void 0!==D&&(t.data=D),"object"===R(d.background)&&(t.backgroundColor="function"==typeof d.background.fill?d.background.fill(q(q({},f),{},{textBounds:P}),S):d.background.fill,void 0!==t.backgroundColor&&(t.backgroundBounds=Sc(t,l,N,a,d.background.padding))),k.push(t),C.labels.push({node:r,textBounds:P})}}}}var A=k.filter(w(C)),I=A.filter((function(e){return void 0!==e.backgroundBounds})).map(gc);return[].concat(X(I),X(A))}function Mc(e){for(var t,n,r,i,o,a,s,l=e.nodes,u=e.rect,c=e.chart,d=e.labelSettings,f=e.placementSettings,p=e.settings,h=e.renderer,m={},g=[],v=!0,y=!1,b=0;b<l.length;b++)if(Ss(i=(n=l[b]).localBounds,u)){var x=hc(n,c);t={node:n,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(var w=0;w<d.length;w++)mc(r="function"==typeof(a=d[w]).label?a.label(x,b):void 0)&&(s="function"==typeof p.direction?p.direction(x,b):p.direction||"up",y=y||"left"===s||"right"===s,m.fontFamily=a.fontFamily,m.fontSize="".concat(a.fontSize,"px"),m.text=r,o=h.measureText(m),t.measurements.push(o),t.texts.push(r),t.labelSettings.push(a),t.placementSettings.push(f[w]),t.direction=s,v=v&&o.width<=i.width-8);g.push(t)}return{targetNodes:g,fitsHorizontally:v,hasHorizontalDirection:y}}function Tc(e){var t=e.orientation,n=void 0===t?"auto":t,r=e.defaultOrientation,i=void 0===r?"h":r;switch(n.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return i}}function Dc(e){var t=2*Math.PI;return(e%t+t)%t}function _c(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function Nc(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function qc(e,t,n){var r=t.x,i=t.y;if(r*r+i*i>e*e)return null;var o=Math.sin(n),a=Math.cos(n),s=r*a-i*o,l=e*e-s*s;if(l<0)return null;var u=Math.sqrt(l);return{x:s*a+o*u,y:-s*o+a*u}}function Rc(e){var t,n,r=e.radius,i=e.size,o=e.angle,a=i.width,s=i.height,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(!(t=qc(r,l,o)))return null;t.y*=-1,n={x:-a,y:0};break;case 1:if(!(t=qc(r,l,Math.PI-o)))return null;n={x:-a,y:-s};break;case 2:if(!(t=qc(r,l,o-Math.PI)))return null;t.x*=-1,n={x:0,y:-s};break;case 3:if(!(t=qc(r,l,2*Math.PI-o)))return null;t.x*=-1,t.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:t.x+n.x,y:t.y+n.y,width:a,height:s}}function Pc(e){var t=e.slice,n=e.measured,r=e.padding,i=t.start,o=t.end,a=t.innerRadius,s=t.outerRadius,l=s-a-2*r,u=o-i;if(u<Math.PI){var c=(n.height/2+r)/Math.tan(u/2);c>a&&(l=s-c-2*r)}if(l<0||l<n.minReqWidth)return null;var d=Dc((i+o)/2),f=s-r,p={x:Math.sin(d)*f,y:-Math.cos(d)*f,width:l,height:n.height};return d<Math.PI?(p.angle=d-Math.PI/2,p.anchor="end"):(p.angle=d+Math.PI/2,p.anchor="start"),p}function Ac(e){var t=e.context,n=e.node,r=e.bounds,i=n.desc.slice,o=Dc((i.start+i.end)/2);switch(Math.floor(o/(Math.PI/2))){case 0:t.q1maxY=r.y-2,void 0===t.q2minY&&(t.q2minY=r.y+r.height+2);break;case 1:t.q2minY=r.y+r.height+2;break;case 2:t.q3minY=r.y+r.height+2;break;case 3:t.q4maxY=r.y-2,void 0===t.q3minY&&(t.q3minY=r.y+r.height+2)}}function Ic(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Oc(e,t,n){var r={type:"text",text:t,maxWidth:e.width,x:e.x,y:e.y+("top"===e.baseline?e.height/2:0),fill:n.fill,anchor:e.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(e.angle)){var i=e.angle*(360/(2*Math.PI));r.transform="rotate(".concat(i,", ").concat(r.x,", ").concat(r.y,")")}return r}function Lc(e){var t,n,r=e.slice,i=e.direction,o=e.position,a=e.padding,s=e.measured,l=e.view,u=e.context,c=e.store,d=r.start,f=r.end,p=r.innerRadius,h=r.offset;switch(o){case"into":t="rotate"===i?Pc({slice:r,measured:s,padding:a}):function(e){var t=e.slice,n=e.padding,r=e.measured,i=t.start,o=t.end,a=t.innerRadius,s=t.outerRadius,l=Dc((i+o)/2),u=Rc({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return u?(u.baseline="top",Ts(u,{x1:0,y1:0,x2:Math.sin(i)*s,y2:-Math.cos(i)*s})||Ts(u,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||ys({cx:0,cy:0,r:a},u)?null:(_c(u,n),u)):null}({slice:r,measured:s,padding:a});break;case"inside":n={start:d,end:f,innerRadius:0,outerRadius:p},t="rotate"===i?Pc({slice:n,measured:s,padding:a}):function(e){var t=e.slice,n=e.padding,r=e.measured,i=e.store,o=t.start,a=t.end,s=t.outerRadius,l=Dc((o+a)/2),u=Rc({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return u?(u.baseline="top",_c(u,n),i.insideLabelBounds.some((function(e){return Ss(e,u)}))?null:(i.insideLabelBounds.push({x:u.x-4,y:u.y,width:u.width+8,height:u.height}),u)):null}({slice:n,measured:s,padding:a,store:c});break;case"outside":t="rotate"===i?function(e){var t=e.slice,n=e.measured,r=e.padding,i=e.view,o=t.start,a=t.end,s=t.outerRadius,l=t.offset,u=s+r,c=a-o;if(c<Math.PI&&(n.height/2+r)/Math.tan(c/2)>u)return null;var d=Dc((o+a)/2),f=Math.sin(d)*u,p=-Math.cos(d)*u,h=n.width+1,m=d%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){var g=p<0?i.y:i.y+i.height,v=Math.abs(g-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*r-s;v<h&&(h=v)}if(Math.sin(m)>.001){var y=f<0?i.x:i.x+i.width,b=Math.abs(y-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*r-s;b<h&&(h=b)}if(h<=0||h<n.minReqWidth)return null;var x={x:f,y:p,width:h,height:n.height};return d<Math.PI?(x.angle=d-Math.PI/2,x.anchor="start"):(x.angle=d+Math.PI/2,x.anchor="end"),x}({slice:r,measured:s,padding:a,view:l}):function(e){var t=e.slice,n=e.measured,r=e.padding,i=e.view,o=e.context,a=t.start,s=t.end,l=t.outerRadius,u=t.offset,c=Dc((a+s)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.q4maxY<0;default:return!0}}(o,Math.floor(c/(Math.PI/2)),i))return null;var d=l+r+n.height/2,f=Math.sin(c)*d,p=-Math.cos(c)*d,h=n.width+1;if(c<Math.PI){var m=Math.abs(i.x+i.width-(f+u.x));m<h&&(h=m)}else{var g=Math.abs(i.x-(f+u.x));g<h&&(h=g)}if(h<n.minReqWidth)return null;var v={x:f,y:p,width:h,height:n.height};return c<Math.PI?v.anchor="start":v.anchor="end",v}({slice:r,measured:s,padding:a,view:l,context:u});break;default:throw new Error("not implemented")}return t&&(t.x+=h.x,t.y+=h.y,"outside"===o&&"rotate"!==i&&function(e,t,n){var r=n.start,i=n.end,o=n.offset,a=n.outerRadius,s=Dc((r+i)/2);switch(Math.floor(s/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){var l=Math.min(e.y,t.q1maxY-e.height),u=e.y-l;if(e.y=l,u>1){var c=a+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(s)*c,y2:o.y-Math.cos(s)*c,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){var d=Math.max(e.y,t.q2minY),f=d-e.y;if(e.y=d,f>1){var p=a+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(s)*p,y2:o.y-Math.cos(s)*p,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){var h=Math.max(e.y,t.q3minY),m=h-e.y;if(e.y=h,m>1){var g=a+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(s)*g,y2:o.y-Math.cos(s)*g,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){var v=Math.min(e.y,t.q4maxY-e.height),y=e.y-v;if(e.y=v,y>1){var b=a+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(s)*b,y2:o.y-Math.cos(s)*b,strokeWidth:1}}}}}(t,u,r)),t}function zc(e){for(var t=e.context,n=e.direction,r=e.measured,i=e.node,o=e.placementSettings,a=e.rect,s=e.store,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Lc,u=0;u<o.length;u++){var c=o[u],d=l({context:t,slice:i.desc.slice,view:a,direction:n,position:c.position,measured:r,padding:c.padding,store:s});if(d)return{bounds:d,placement:c}}return{bounds:null,placement:null}}function Fc(e){for(var t=[],n=[],r=[],i=[],o=0;o<e.length;++o){var a=e[o].desc.slice,s=Dc((a.start+a.end)/2);switch(Math.floor(s/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:r.push(e[o]);break;case 3:i.push(e[o])}}var l=function(e,t){return Dc((e.desc.slice.start+e.desc.slice.end)/2)-Dc((t.desc.slice.start+t.desc.slice.end)/2)},u=function(e,t){return l(t,e)};return t.sort(u),n.sort(l),r.sort(u),i.sort(l),t.concat(n,i,r)}function jc(e,t,n){var r=t.fontFamily,i="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:r,fontSize:i});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:r,fontSize:i}).width),o}var Hc=/\n+|\r+|\r\n/,Bc=/\s/,Vc=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function Wc(e){return"string"==typeof e?-1!==e.search(Hc):-1!==String(e).search(Hc)}function Uc(e){return-1!==e.search(Bc)}function $c(e){return-1!==e.search(Vc)}function Yc(e,t,n,r,i){return r.some((function(r){return r(e,t,n)}))?1:i.some((function(r){return r(e,t,n)}))?0:2}function Xc(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}function Kc(e,t,n){return Math.max(t,Math.min(n,e))}function Gc(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.string,n=e.separator,r=void 0===n?"":n,i=e.reverse,o=void 0!==i&&i,a=e.measureText,s=void 0===a?function(e){return{width:e.length,height:1}}:a,l=e.mandatoryBreakIdentifiers,u=void 0===l?[Wc]:l,c=e.noBreakAllowedIdentifiers,d=void 0===c?[]:c,f=e.suppressIdentifier,p=void 0===f?[Uc,Wc,function(e){return""===e}]:f,h=e.hyphenationIdentifiers,m=void 0===h?[$c]:h,g=String(t).split(r);Xc(g);var v=g.length,y=o?function(e){return e>=0}:function(e){return e<v},b=o?v:-1;function x(e){var t=Kc(e,0,v-1),n=g[t],r=s(n),i=Yc(n,t,g,u,d);return{index:t,value:n,breakOpportunity:i,suppress:p.some((function(e){return e(n,t,g)})),hyphenation:m.some((function(e){return e(n,t,g)})),width:r.width,height:r.height,done:!1}}function w(e){return isNaN(e)?o?b--:b++:b=Kc(e,0,v-1),y(b)?x(b):{done:!0}}return{next:w,peek:x,length:v}}var Jc="…",Zc=/^\s*\d+(\.\d+)?px\s*$/i;function Qc(e){return"string"===R(e)&&Zc.test(e)}function ed(e){var t=e["font-size"]||e.fontSize;return Qc(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function td(e){var t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;var r=ed(e);return Math.max(1,Math.min(Math.floor(t/r),n))}function nd(e,t){return{lines:[],line:"",width:0,maxLines:td(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function rd(e){e.lines.push(e.line),e.line="",e.width=0}function id(e,t){e.line+=t.value,e.width+=t.width}function od(e,t,n){if(t.width>e.maxWidth)return t;for(var r=t.index,i=1;i<5;i++){var o=n.peek(t.index-1);if(!t.hyphenation||!o.hyphenation||0===t.index)return t;if(e.width+e.hyphens.metrics.width<=e.maxWidth)return e.line+=e.hyphens.char,t;if(1===e.line.length)return t;t=n.next(r-i),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function ad(e,t,n){for(var r=Gc({string:t.value,measureText:n});e.lines.length<e.maxLines;){var i=r.next();if(i.done)break;e.width+i.width>e.maxWidth&&2===i.breakOpportunity&&e.line.length>0?(i=e.hyphens.enabled?od(e,i,r):i,rd(e),id(e,i)):id(e,i)}}function sd(e,t){for(var n=Gc({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[function(e,t){return 0===t}]}),r=nd(e,t),i=!0;r.lines.length<r.maxLines;){var o=n.next();if(o.done){rd(r),i=!1;break}1===o.breakOpportunity?rd(r):r.width+o.width>r.maxWidth&&2===o.breakOpportunity?o.suppress?r.width+=o.width:(o=r.hyphens.enabled?od(r,o,n):o,rd(r),id(r,o)):id(r,o)}return{lines:r.lines,reduced:i}}function ld(e,t){for(var n=Gc({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),r=nd(e,t),i=!0;r.lines.length<r.maxLines;){var o=n.next();if(o.done){rd(r),i=!1;break}1===o.breakOpportunity?rd(r):r.width+o.width>r.maxWidth&&2===o.breakOpportunity?o.suppress?rd(r):o.width>r.maxWidth?ad(r,o,t):(rd(r),id(r,o)):id(r,o)}return{lines:r.lines,reduced:i}}function ud(e){return{"break-all":sd,"break-word":ld}[e.wordBreak]}function cd(e){return function(t){var n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){var r=ud(n);if(!r)return;var i=e(n);if(i.width>n.maxWidth||Wc(n.text)){var o=(ed(n)-i.height)/2,a=r(n,function(e,t){return function(n){return t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}}(n,e));t.node=function(e,t,n,r){var i={type:"container",children:[]};void 0!==t.id&&(i.id=t.id);var o=0;return e.lines.forEach((function(a,s){var l=D({},t);l.text=a,l._lineBreak=!0,o+=n,e.reduced&&s===e.lines.length-1?l.text+=Jc:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=r,o+=n,i.children.push(l)})),i}(a,n,o,i.height)}}}}function dd(e,t){var n=e.text,r=e["font-size"],i=e["font-family"],o=e.maxWidth;if(n="string"==typeof n?n:"".concat(n),void 0===o)return n;var a=t({text:n,fontSize:r,fontFamily:i}).width;if(a<=o)return n;for(var s=0,l=n.length-1;s<=l;){var u=Math.floor((s+l)/2);(a=t({text:n.substr(0,u)+Jc,fontSize:r,fontFamily:i}).width)<=o?s=u+1:l=u-1}return n.substr(0,l)+Jc}function fd(e){var t=e.baseline||e["dominant-baseline"],n=0,r=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){case"hanging":n=.75*r;break;case"text-before-edge":n=.85*r;break;case"middle":n=.25*r;break;case"central":n=.35*r;break;case"mathemetical":n=r/2;break;case"text-after-edge":case"ideographic":n=.2*-r;break;default:n=0}return n}var pd,hd={},md={},gd={fontSize:void 0,fontFamily:void 0};function vd(e,t,n){var r=e+t+n;return"number"!=typeof md[r]&&(pd=pd||document.createElement("canvas").getContext("2d"),function(e,t){gd.fontSize===e&&gd.fontFamily===t||(pd.font=e+" "+t,gd.fontSize=e,gd.fontFamily=t)}(t,n),md[r]=pd.measureText(e).width),md[r]}function yd(e){return"number"!=typeof hd[e]&&(hd[e]=function(e){if(Qc(e)){var t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),hd[e]}function bd(e){var t=e.text,n=e.fontSize;return{width:vd(t,n,e.fontFamily),height:yd(n)}}function xd(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bd,n=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,i=t({text:e.text,fontFamily:r,fontSize:n}),o=Math.min(e.maxWidth||i.width,i.width),a=e.x||0,s=e.y||0,l=e.dx||0,u=(e.dy||0)+fd(e),c={x:0,y:s+u-.75*i.height,width:o,height:i.height},d=e["text-anchor"]||e.anchor;return c.x="middle"===d?a+l-o/2:"end"===d?a+l-o:a+l,c}function wd(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bd,n=ud(e),r=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:i,fontSize:r});if(n&&(o.width>e.maxWidth||Wc(e.text))){for(var a=n(e,(function(e){return t({text:e,fontFamily:i,fontSize:r})})),s=D({},e),l=0,u="",c=0,d=a.lines.length;c<d;c++){var f=a.lines[c];f+=c===d-1&&a.reduced?Jc:"";var p=t({text:f,fontSize:r,fontFamily:i}).width;p>=l&&(l=p,u=f)}s.text=u;var h=xd(s,t);return h.height=ed(e)*a.lines.length,h}return xd(e,t)}var kd=.9;function Cd(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Sd(e,t,n){var r={type:"text",text:t,maxWidth:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(e.width<n.fontSize)return!1;var o=Math.max(0,e.width-i.width);return r.x=e.x+n.align*o,r.y=e.y+i.height/1.2,r}function Ed(e){return{type:"circle",bounds:{cx:e.cx,cy:e.cy,r:e.r}}}function Md(e){return e.desc&&e.desc.slice?function(e){var t=e.start,n=e.end,r=e.innerRadius,i=e.outerRadius,o=e.offset;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};var a=0!==r?r:i;return Ed({cx:o.x,cy:o.y,r:a})}(e.desc.slice):"circle"===e.type?Ed(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var Td={bar:function(e){var t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,a=e.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ec,l=D({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);var u=t.labels.map((function(e){return D({},l,t,e)})),c=t.labels.map((function(e){return e.placements.map((function(n){return D({},l,t,e,n)}))})),d=Mc({nodes:r,chart:n,renderer:o,settings:t,rect:i,labelSettings:u,placementSettings:c}),f=d.fitsHorizontally,p=d.hasHorizontalDirection,h=d.targetNodes,m=Tc({orientation:t.orientation,defaultOrientation:p?"h":"v"}),g="h"===m?"y":"x",v="h"===m?"height":"width";return h.sort((function(e,t){return e.node.localBounds[g]+e.node.localBounds[v]-(t.node.localBounds[g]+t.node.localBounds[v])})),s({chart:n,targetNodes:h,stngs:t,rect:i,fitsHorizontally:f,collectiveOrientation:m})},slice:function(e){var t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,a=e.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zc,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Oc,u=D({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);u.fontSize=parseInt(u.fontSize,10);for(var c=t.labels.map((function(e){return D({},u,t,e)})),d=t.labels.map((function(e){return e.placements.map((function(n){return D({},u,t,e,n)}))})),f=[],p={insideLabelBounds:[]},h={},m=0,g=(r=Fc(r)).length;m<g;m++)for(var v=r[m],y=Ic(v,n),b=0;b<c.length;b++){var x=c[b],w="function"==typeof x.label?x.label(y,m):"";if(w){var k="function"==typeof x.direction?x.direction(y,m):x.direction||"horizontal",C="function"==typeof x.linkData?x.linkData(y,m):void 0,S=jc(w,x,o),E=s({context:h,direction:k,lblStngs:x,measured:S,node:v,placementSettings:d[b],rect:i,store:p}),M=E.bounds,T=E.placement;if(M&&T){if("outside"===T.position&&"rotate"!==k){Ac({context:h,node:v,bounds:M});var _=Nc(M);if(!cs(_,i))continue}var N="function"==typeof T.fill?T.fill(y,m):T.fill,q=l(M,w,{fill:N,fontSize:x.fontSize,fontFamily:x.fontFamily,textMetrics:S});q&&(void 0!==C&&(q.data=C),f.push(q),M.line&&(M.line.stroke=N,f.push(M.line)))}}}return f},rows:function(e){var t=e.settings,n=e.chart,r=e.nodes,i=e.renderer,o=e.style,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Sd,s=D({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);for(var l=D({},s,t),u=t.labels.map((function(e){return D({},l,e)})),c={},d=[],f=0,p=r.length;f<p;f++){var h=r[f],m=Cd(h,n),g=Md(h),v=g.type,y=g.bounds;if(y){var b=0,x=[],w=[],k="circle"===v?2*y.r*kd:y.height;b+=l.padding;var C=void 0;for(C=0;C<u.length;C++){var S=u[C],E="function"==typeof S.label?S.label(m,f):"";c.fontFamily=S.fontFamily,c.fontSize="".concat(S.fontSize,"px"),c.text=E;var M=i.measureText(c);if((b+=M.height+S.padding)>k)break;w.push(E),x.push(M)}var T=C,_=Math.max(0,k-b),N=void 0;for(N="circle"===v?y.cy-y.r*kd:y.y,N+=l.justify*_+l.padding,C=0;C<T;C++){var q=u[C],R=void 0;if("circle"===v){var P=Math.max(Math.abs(N-y.cy),Math.abs(N+x[C].height-y.cy)),A=Math.sqrt(y.r*y.r-P*P);R={x:y.cx-A+l.padding,y:N,width:2*A-2*l.padding,height:x[C].height}}else R={x:y.x+l.padding,y:N,width:y.width-2*l.padding,height:x[C].height};N+=x[C].height+l.padding;var I="function"==typeof q.fill?q.fill(m,f):q.fill,O="function"==typeof q.linkData?q.linkData(m,f):void 0,L=a(R,w[C],{fill:I,align:q.align,fontSize:q.fontSize,fontFamily:q.fontFamily,textMetrics:x[C]});if(L){if(L.text&&L.text!==Jc){var z=dd(L,i.measureText);if(Jc===z)continue;L.ellipsed=z}void 0!==O&&(L.data=O),d.push(L)}}}}return d}};var Dd={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render:function(){var e=this,t=this.settings.settings,n=[];return(t.sources||[]).forEach((function(t){t.strategy&&Td[t.strategy.type]&&t.component&&n.push.apply(n,X(function(e,t){var n=e.chart,r=e.source,i=e.rect,o=e.renderer,a=e.style;if(!n.component(r.component))return[];var s=n.findShapes(r.selector).filter((function(e){return e.key===r.component}));return t({chart:n,settings:r.strategy.settings,nodes:s,rect:{x:0,y:0,width:i.width,height:i.height},renderer:o,style:a})}({chart:e.chart,rect:e.rect,renderer:e.renderer,source:t,style:e.style},Td[t.strategy.type])))})),n}};var _d={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,justify:.5,align:.5,label:{fontSize:"12px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:136,lineHeight:1.2},shape:{type:"square",size:12}},title:{show:!0,text:void 0,anchor:"start",fontSize:"16px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:156,lineHeight:1.25},navigation:{button:{class:void 0,content:void 0,tabIndex:void 0},disabled:!1}};function Nd(e){var t=e.x,n=void 0===t?0:t,r=e.y,i=e.item,o=e.globalMetrics,a=e.createSymbol,s=e.direction,l=void 0===s?"ltr":s,u=i.label.displayObject,c=i.label.bounds,d=i.symbol.meta,f="rtl"===l,p={x:f?n+o.maxLabelBounds.width:n+o.maxSymbolSize+o.spacing,y:r,width:o.maxLabelBounds.width,height:Math.max(o.maxSymbolSize,o.maxLabelBounds.height)},h=function(e,t,n){var r=Math.max(0,e.width-t),i=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*r,y:e.y+t/2+n.justify*i}}({x:f?n+o.maxLabelBounds.width+o.spacing:n,y:r,width:o.maxSymbolSize,height:p.height},d.size,{align:void 0===d.align?.5:d.align,justify:void 0===d.justify?.5:d.justify}),m=a(D({},d,h));return delete m.collider,u.anchor=f?"end":"start",function(e,t,n){var r=n.textMetrics;if(e.height<r.height)return!1;var i=Math.max(0,e.width-r.width);t.baseline="text-before-edge";var o=Math.max(0,e.height-r.height);t.x=e.x+n.align*i,t.y=e.y+n.justify*o+.175*parseInt(t.fontSize,10)}(p,u,{textMetrics:c,fontSize:parseInt(u.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:i.label.displayObject.data,children:[m,u],collider:{type:"rect",x:n,y:r,width:o.maxItemBounds.width,height:o.maxItemBounds.height}},metrics:p}}function qd(e,t){var n=e.items.length,r=Math.ceil(n/t),i="horizontal"===e.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*r+(r-1)*e.layout.margin[o]}function Rd(e,t){var n,r,i,o,a=t.onScroll,s=void 0===a?function(){}:a,l=null,u=0,c={itemize:function(t){n=function(e,t){for(var n,r,i=e.resolved,o=e.dock,a=[],s=i.items.items,l=i.symbols.items,u=i.labels.items,c=0,d=0,f=0,p=0;p<s.length;p++)if(!1!==s[p].show){var h=void 0!==u[p].text?u[p].text:u[p].data.label||"";n=D({},u[p],{type:"text",fontSize:"".concat(parseInt(u[p].fontSize,10),"px"),text:h,title:h}),r={symbol:{meta:l[p]},label:{displayObject:n,bounds:t.textBounds(n)}},a.push(r),c=Math.max(l[p].size,c),d=Math.max(r.label.bounds.width,d),f=Math.max(r.label.bounds.height,f)}return{items:a,globalMetrics:{spacing:8,maxSymbolSize:c,maxItemBounds:{height:Math.max(c,f),width:c+8+d},maxLabelBounds:{width:d,height:f}},layout:{margin:{vertical:void 0!==i.layout.item.vertical?i.layout.item.vertical:4,horizontal:void 0!==i.layout.item.horizontal?i.layout.item.horizontal:4},mode:i.layout.item.mode,size:i.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:i.layout.item.direction,scrollOffset:i.layout.item.scrollOffset}}}(t,e.renderer),l=isNaN(n.layout.scrollOffset)?l:n.layout.scrollOffset},getItemsToRender:function(t){i=t.viewRect,u=c.getContentOverflow(i);var a=c.extent();l=Math.max(0,Math.min(l,u)),o=D({},i);var s="horizontal"===c.orientation()?"x":"y";return o[s]-=l,o["x"===s?"width":"height"]=a,function(e,t,n){for(var r=e.viewRect,i=n.itemized,o=n.create,a=void 0===o?Nd:o,s=n.parallels,l=n.createSymbol,u=i.layout.direction,c=i.globalMetrics,d=i.items,f="horizontal"===i.layout.orientation,p=0,h=[],m=c.maxItemBounds.height,g=c.maxItemBounds.width,v=i.layout.margin.vertical+m,y=i.layout.margin.horizontal+g,b=t.x,x=t.y,w=r.x-t.x,k=0;k<d.length;k++){var C=a({y:x,x:"rtl"===u?r.x+w+r.width-g-(b-t.x):b,item:d[k],globalMetrics:c,direction:u,createSymbol:l});if((f&&b>=r.x-g||!f&&x>=r.y-m)&&h.push(C.item),++p>=s?(p=0,f?(b+=y,x=t.y):(x+=v,b=t.x)):f?x+=v:b+=y,!f&&x>r.y+r.height)break;if(f&&b>r.x+r.width)break}return h}(t,o,{itemized:n,parallels:r,createSymbol:e.symbol})},parallelize:function(e,t){return r=function(e,t,n){var r=n.items.length,i="horizontal"===n.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical",a=n.globalMetrics.maxItemBounds[i]*r+(r-1)*n.layout.margin[o],s=Math.ceil(a/e);if(null!=t){var l="horizontal"===n.layout.orientation?"height":"width",u="width"===l?"horizontal":"vertical",c=n.layout.margin[u]||4,d=Math.floor((t+c)/(c+n.globalMetrics.maxItemBounds[l]));s=Math.min(s,d)}var f=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(s,f))}(e,t,n)},hasContentOverflow:function(){var e="horizontal"===n.layout.orientation?"width":"height";return qd(n,r)>i[e]},getContentOverflow:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,qd(n,r)-e[t])},getNextSize:function(){var e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:function(){var e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},hasNext:function(){return"horizontal"===c.orientation()?i.x+i.width<o.x+o.width:i.y+i.height<o.y+o.height},hasPrev:function(){return"horizontal"===c.orientation()?o.x<i.x:o.y<i.y},next:function(){c.scroll(-c.getNextSize())},prev:function(){c.scroll(c.getPrevSize())},scroll:function(e){var t=Math.max(0,Math.min(u,l-e));t!==l&&(l=t,s())},offset:function(){return l},orientation:function(){return n.layout.orientation},direction:function(){return n.layout.direction},extent:function(){return qd(n,r)},spread:function(){return function(e,t){var n=t,r="horizontal"===e.layout.orientation?"height":"width",i="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*n+(n-1)*e.layout.margin[i]}(n,r)}};return c}function Pd(e){return Object.keys(e).filter((function(t){return e[t]})).join(" ")}var Ad={up:"▲",right:"▶",down:"▼",left:"◀"};function Id(e,t){var n=t.size,r=t.isActive,i=t.direction,o=t.nav,a={},s="",l=t.attrs;o&&o.button&&("function"==typeof o.button.class?a=o.button.class({direction:i}):o.button.class&&(a=o.button.class),"function"==typeof o.button.content&&(s=o.button.content(e,{direction:i})),void 0!==o.button.tabIndex&&(l.tabindex=o.button.tabIndex));var u={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(a).length||(u.border="0",u.background="none"),(!r||o&&o.disabled)&&(l.disabled="disabled"),e("button",D({class:Pd(a),style:u},l),[s||e("span",{style:{pointerEvents:"none"}},[Ad[i]])])}function Od(e){var t,n={itemize:function(e){t=function(e){var t=e.dock;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:e.navigation}}(e)},render:function(r){return function(e,t,n,r){var i=t.rect,o=t.itemRenderer;if(e&&e.renderArgs){e.size(i);var a=e.renderArgs[0],s="vertical"===n.layout.orientation,l="rtl"===o.direction(),u=o.hasNext(),c=o.hasPrev();if(c||u){var d=s?["right","left"]:["down","up"];l&&s&&d.reverse();var f=[a("div",{style:{position:"relative",display:"flex","flex-direction":s?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!s?"rtl":"ltr"},[Id(a,{size:32,isActive:u,direction:d[0],attrs:{"data-action":"next","data-component-key":r.settings.key},nav:n.navigation}),Id(a,{size:32,isActive:c,direction:d[1],attrs:{"data-action":"prev","data-component-key":r.settings.key},nav:n.navigation})])];e.render(f)}else e.render([])}}(n.renderer,r,t,e)},extent:function(){return 32},spread:function(){return 64}};return n}function Ld(e){var t,n={itemize:function(n){t=function(e,t){var n=e.resolved;if(!1===n.title.item.show)return null;var r=D({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(r.anchor&&"start"!==r.anchor?"end"===r.anchor&&(r.anchor="start"):r.anchor="end"),void 0===n.title.settings.text){var i=t.scale.data().fields;r.text=i&&i[0]?i[0].title():""}return{displayObject:r,bounds:t.renderer.textBounds(r)}}(n,e)},render:function(e){!function(e,t,n){var r=e.rect;if(t){var i=[];if(t.size(r),n){var o={start:0,end:r.width,middle:r.width/2};i.push(D({},n.displayObject,{x:o[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(i)}}(e,n.renderer,t)},spread:function(){return t?t.bounds.height:0},extent:function(){return t?t.bounds.width:0}};return n}function zd(e,t,n,r){var i,o,a,s=r.itemRenderer,l=r.navigationRenderer,u=r.titleRenderer,c=r.isPreliminary,d=void 0!==c&&c,f=0,p={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(i={x:p.x,y:p.y,width:p.width,height:u.spread()},"horizontal"===n){i={x:p.x,y:p.y,width:u.extent(),height:u.spread()};var h=p.width-i.width-(i.width?t.spacing:0),m=p.height;s.parallelize(h,d?void 0:m);var g=s.extent()>h?l.extent():0,v=s.spread(),y=g?l.spread():0;a={x:(o={x:i.x+i.width+(i.width?t.spacing:0),y:p.y+Math.max(0,(y-v)/2),width:p.width-g-i.width-(g?t.spacing:0)-(i.width?t.spacing:0),height:m}).x+o.width+(g?t.spacing:0),y:p.y,width:g,height:p.height},i.y=o.y,"rtl"===s.direction()&&(a.x=p.x,o.x=a.x+a.width+(a.width?t.spacing:0),i.x=o.x+o.width+(i.width?t.spacing:0)),f=Math.max(i.height,y,s.spread())}else{var b=p.height-i.height-(i.height?t.spacing:0),x=p.width;s.parallelize(b,d?void 0:x);var w=s.extent()>b?l.extent():0;a={x:p.x,y:p.y+p.height-w,width:p.width,height:w},o={x:p.x,y:i.y+i.height+(i.height?t.spacing:0),width:p.width,height:p.height-i.height-(i.height?t.spacing:0)-a.height-(a.height?t.spacing:0)},f=Math.max(u.extent(),w?l.spread():0,s.spread())}return o=D({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),a.x+=e.x,a.y+=e.y,i.x+=e.x,i.y+=e.y,{title:D({},e,i),content:D({},e,o),navigation:D({},e,a),orientation:n,preferredSize:f}}function Fd(e){e.state.resolved=function(e){var t=e.scale.domain(),n={items:[]},r=e.settings.layout.dock;if("threshold-color"===e.scale.type){var i=e.scale.data().fields[0],o=function(e){return String(e)};e.settings.formatter?o=e.chart.formatter(e.settings.formatter):i&&(o=i.formatter());for(var a=0;a<t.length-1;a++){var s={value:t[a],label:"".concat(o(t[a])," - < ").concat(o(t[a+1]))};i&&(s.source={field:i.id()}),n.items.push(s)}"vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")&&n.items.reverse()}else{var l=e.scale.labels?e.scale.labels():null;n.items=t.map((function(t,n){var r=e.scale.datum?D({},e.scale.datum(t)):{value:t};return r.value=t,e.scale.label?r.label=e.scale.label(t):l&&(r.label=l[n]),r}))}var u=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:D(!0,{},_d.title,e.style.title),settings:e.settings.settings.title}),c=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:_d.layout,settings:e.settings.settings.layout}),d=e.resolver.resolve({data:n,defaults:D(!0,{},_d.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),f=D(!0,{},(e.settings.settings.item||{}).shape);void 0===f.fill&&e.settings.scale&&(f.fill={scale:e.settings.scale});var p=e.resolver.resolve({data:n,defaults:D(!0,{},_d.item.shape,e.style.item.shape),settings:f}),h=e.resolver.resolve({data:n,defaults:D(!0,{},{show:_d.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function m(e,n){var r=e.data.value,i=t[n+1];e.data.value=[r,i]}return"threshold-color"===e.scale.type&&("vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")?(h.items.reverse().forEach(m),h.items.reverse()):h.items.forEach(m)),{title:u,labels:d,symbols:p,items:h,layout:c}}(e),e.titleRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.itemRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.navigationRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center",navigation:e.settings.settings.navigation}),e.state.display={spacing:8}}function jd(e){var t=e.rect,n=e.settings,r=e.state,i=e.itemRenderer,o=e.navigationRenderer,a=e.titleRenderer,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",u=zd(t,r.display,l,{itemRenderer:i,navigationRenderer:o,titleRenderer:a});e.renderer.size(u.content);var c=i.getItemsToRender({viewRect:D({},u.content,{x:0,y:0})});return o.render({rect:u.navigation,itemRenderer:i}),a.render({rect:u.title}),e.state.views={layout:u},c}var Hd={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted:function(e){e&&e.parentNode&&(this.navigationRenderer.renderer.appendTo(e.parentNode),this.titleRenderer.renderer.appendTo(e.parentNode),e.parentNode.insertBefore(this.navigationRenderer.renderer.element(),e),e.parentNode.insertBefore(this.titleRenderer.renderer.element(),e)),this.navigationRenderer.render({rect:this.state.views.layout.navigation,itemRenderer:this.itemRenderer}),this.titleRenderer.render({rect:this.state.views.layout.title})},beforeUnmount:function(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart:function(){this.state.interaction.started||this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove:function(e){if(this.state.interaction.started){var t="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*e.deltaX:e.deltaY;this.itemRenderer.scroll(t-this.state.interaction.delta),this.state.interaction.delta=t}},panend:function(){this.state.interaction.started=!1},scroll:function(e){this.itemRenderer.scroll(-e)},next:function(){this.itemRenderer.next()},prev:function(){this.itemRenderer.prev()}},created:function(){var e=this;this.state={interaction:{}},this.onScroll=function(){var t=jd(e);e.update(t)},this.itemRenderer=Rd(this,{onScroll:this.onScroll}),this.navigationRenderer=Od(this),this.titleRenderer=Ld(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),Fd(this)},preferredSize:function(e){return function(e,t){var n=0,r=e.settings.layout.dock||"center",i="top"===r||"bottom"===r?"horizontal":"vertical",o=e.state.display,a=zd(t.inner,o,i,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=a.preferredSize,n+o.spacing}(this,e)},beforeUpdate:function(){Fd(this)},render:function(){return jd(this)},beforeDestroy:function(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements:function(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo:function(){return{offset:this.itemRenderer.offset()}}};function Bd(e,t){var n=0,r=e.state.isVertical?"justify":"align",i=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",a=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[a](),n*=Math.min(1,Math.max(e.stgns[r],0)),t[i]+=n}function Vd(e,t,n){var r=n[e];return"object"===R(r)?-1!==r.valid.indexOf(t)?t:r.default:n.default}function Wd(e){return Vd(e.layout.dock,e.settings.title.anchor,{left:{valid:["top"],default:"top"},right:{valid:["top"],default:"top"},top:{valid:["left","right"],default:"left"},bottom:{valid:["left","right"],default:"left"},default:"top"})}function Ud(e,t){var n={x:0,y:0,width:0,height:0},r=e.stgns.padding;return n.x=r.left,n.y=r.top,n.width=t.width-r.left-r.right,n.height=t.height-r.top-r.bottom,n}function $d(e){var t,n="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,r=e.stgns.title,i=e.chart.scale(e.stgns.fill),o=e.chart.scale(e.stgns.major),a=function(e,t){var n=t.domain(),r=n,i=e.stgns.tick.label;return!i&&e.formatter?i=e.formatter:!i&&t.data().fields&&(i=t.data().fields[0].formatter()),"function"==typeof i&&(r=n.map(i).map(String)),n.map((function(n,i){var o=r[i];return{value:n,label:o,pos:t.norm(parseFloat(n,10)),textMetrics:e.renderer.measureText({text:o,fontSize:e.stgns.tick.fontSize,fontFamily:e.stgns.tick.fontFamily})}}))}(e,o),s=Vd((t=e.settings).layout.dock,t.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"});if(void 0===r.text){var l=o.data().fields;r.text=l&&l[0]?l[0].title():""}var u=e.renderer.measureText({text:r.text,fontSize:r.fontSize,fontFamily:r.fontFamily}),c=e.renderer.textBounds({text:r.text,fontSize:r.fontSize,fontFamily:r.fontFamily,maxLines:r.maxLines,maxWidth:r.maxLengthPx,wordBreak:r.wordBreak,hyphens:r.hyphens,lineHeight:r.lineHeight}),d={isVertical:n,nodes:[],title:{anchor:Wd(e.settings),textMetrics:u,textBounds:c,requiredWidth:function(){if(!r.show)return 0;var e=c.width,t=r.maxLengthPx;return n||(e+=r.padding,t+=r.padding),Math.min(e,t,d.rect.width)},requiredHeight:function(){if(!r.show)return 0;var e=c.height;return n&&(e+=r.padding),Math.min(e,d.rect.height)}},ticks:{values:a,anchor:s,length:Math.min(Math.max.apply(Math,X(a.map((function(e){return e.textMetrics.width})))),e.stgns.tick.maxLengthPx),requiredHeight:function(){return"top"===s?Math.max.apply(Math,X(d.ticks.values.map((function(e){return e.textMetrics.height}))))+e.stgns.tick.padding:0},height:Math.max.apply(Math,X(a.map((function(e){return e.textMetrics.height}))))},legend:{fillScale:i,majorScale:o,length:function(){var t=n?"height":"width",r=n?"requiredHeight":"requiredWidth",i=Math.min(d.rect[t],d.rect[t]*e.stgns.length)-d.title[r]();return Math.max(0,Math.min(i,e.stgns.maxLengthPx))}}};return d}var Yd={require:["chart","settings","renderer"],defaultSettings:{layout:{displayOrder:0,dock:"right"},settings:{size:15,length:.5,maxLengthPx:250,align:.5,justify:0,padding:{left:5,right:5,top:5,bottom:5},tick:{label:null,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,anchor:null,padding:5},title:{show:!0,text:void 0,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,padding:5,maxLines:2,wordBreak:"none",lineHeight:1.2,hyphens:"auto",anchor:null}}},preferredSize:function(e){var t=this.state;t.rect=Ud(this,e.inner);var n=this.stgns.size,r=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=r;var i=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){if(t.ticks.values.reduce((function(e,t){return e+t.textMetrics.height}),0)>this.state.legend.length())return i;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return i;n+=Math.max.apply(Math,X(t.ticks.values.map((function(e){return e.textMetrics.height}))))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===t.title.anchor||"right"===t.title.anchor?Math.max(t.title.textBounds.height+r,n):Math.max(n,t.title.requiredWidth()+r)),this.state.preferredSize=n,n},created:function(){this.stgns=this.settings.settings,this.state=$d(this)},beforeUpdate:function(e){this.stgns=e.settings.settings,this.state=$d(this)},beforeRender:function(e){if(this.state.nodes=[],this.state.rect=Ud(this,e.size),this.stgns.title.show){var t=function(e){var t=e.state,n=e.stgns,r="left"===t.ticks.anchor,i="top"===t.ticks.anchor,o=t.rect.x,a=t.rect.y,s="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0,s="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=r?t.rect.width:0,a+=t.title.textMetrics.height,s=r?"end":"start");var l={tag:"legend-title",type:"text",x:o,y:Math.min(a,t.rect.y+t.rect.height),text:n.title.text,fill:n.title.fill,fontSize:n.title.fontSize,fontFamily:n.title.fontFamily,maxWidth:n.title.maxLengthPx,maxLines:n.title.maxLines,wordBreak:n.title.wordBreak,hyphens:n.title.hyphens,lineHeight:n.title.lineHeight,anchor:s,title:n.title.text};return Bd(e,l),l}(this);this.state.nodes.push(t)}var n,r,i,o=function(e,t){var n=e.state,r=e.stgns,i=n.rect,o=i.x,a=i.y,s=n.isVertical?r.size:n.legend.length(),l=n.isVertical?n.legend.length():r.size;"left"===n.ticks.anchor?o+=n.rect.width-r.size:"top"===n.ticks.anchor&&(a+=n.rect.height-r.size),"top"===n.title.anchor?a+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());var u={type:"rect",x:o,y:a,width:s,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return Bd(e,u),u}(this,(r=(n=this).state.legend.fillScale,i=n.state.legend.majorScale,r.domain().map((function(e){return{type:"stop",color:r(e),offset:Math.min(1,Math.max(0,i.norm(e)))}})).sort((function(e,t){return e.offset-t.offset})))),a={id:"legend-seq-target",type:"container",children:[o,function(e,t){var n=e.state,r=e.stgns,i="start",o={type:"rect",x:t.x,y:t.y,width:n.isVertical?0:t.width,height:n.isVertical?t.height:0,fill:"transparent"},a=n.ticks.values.map((function(a){var s=0,l=0,u=0,c="alphabetical";return n.isVertical?(l=t.y+t.height*a.pos,c=0===a.pos?"text-before-edge":"text-after-edge"):s=t.x+t.width*a.pos,"right"===n.ticks.anchor?(s=t.x+r.size+r.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(s=t.x-r.tick.padding,i="end"):"top"===n.ticks.anchor?(l=t.y-r.tick.padding,u-=.25*a.textMetrics.height,i=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+r.tick.padding,u=.8*a.textMetrics.height,i=0===a.pos?"start":"end",o.y=t.y+t.height),{type:"text",x:s,y:l,dx:0,dy:u,text:a.label,fontSize:r.tick.fontSize,fontFamily:r.tick.fontFamily,fill:r.tick.fill,maxWidth:n.isVertical?r.tick.maxLengthPx:Math.min(r.tick.maxLengthPx,n.legend.length()/2),anchor:i,textBoundsFn:e.renderer.textBounds,title:a.label,baseline:c}}));return{type:"container",id:"legend-seq-ticks",children:[].concat(X(a),[o])}}(this,o)]};this.state.nodes.push(a)},render:function(){return this.state.nodes}};var Xd={step:function(e){return new at(e,.5)},stepAfter:function(e){return new at(e,1)},stepBefore:function(e){return new at(e,0)},linear:Le,basis:function(e){return new Ue(e)},cardinal:Xe.tension(0),catmullRom:Ge,monotonex:function(e){return new tt(e)},monotoney:function(e){return new nt(e)},natural:function(e){return new it(e)}},Kd={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},connect:!1,orientation:"horizontal",layers:{curve:"linear",show:!0,sort:void 0,line:{stroke:"#ccc",strokeWidth:1,strokeLinejoin:"miter",strokeDasharray:void 0,opacity:1,show:!0,showMinor0:!0},area:{fill:"#ccc",opacity:.8,show:!0}}};function Gd(e,t){var n=t.generator,r=t.item,i=t.data,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=n(e),s={type:"path",d:a,opacity:r.opacity,stroke:r.stroke,strokeWidth:r.strokeWidth,strokeLinejoin:r.strokeLinejoin,fill:o||r.fill,data:i};return r.strokeDasharray&&(s.strokeDasharray=r.strokeDasharray),s}function Jd(e){var t=function(e){for(var t=e.data,n=e.stngs,r=e.rect,i=e.resolver,o=e.style,a=e.domain,s=r.width,l=r.height,u=i.resolve({data:t,defaults:Kd.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:s,minor:"vertical"===n.orientation?s:l}}),c=!n.connect&&a.length>2&&("function"==typeof n.coordinates.layerId||"object"===R(n.coordinates.layerId)),d={},f=0,p=0;p<u.items.length;p++){var h=u.items[p],m=h.layerId;if(c){var g=d[m]?d[m].items[d[m].items.length-1]:null,v=g?a.indexOf(g.data.major?g.data.major.value:g.data.value):null;g&&a.indexOf(h.data.major?h.data.major.value:h.data.value)-1!==v&&d[m].items.push({dummy:!0})}d[m]=d[m]||{order:f++,id:m,items:[],dataItems:[],consumableData:{}},d[m].dataItems.push(h.data),d[m].items.push(h)}var y=Object.keys(d).map((function(e){return d[e].consumableData=q({points:d[e].dataItems},d[e].dataItems[0]),d[e]})),b={items:y.map((function(e){return e.consumableData}))},x=n.layers||{};return{coordinates:u,metaLayers:y,layers:i.resolve({data:b,defaults:{curve:Kd.layers.curve,show:Kd.layers.show},settings:{curve:x.curve,show:x.show}}),lines:i.resolve({data:b,defaults:D({},Kd.layers.line,o.line),settings:x.line}),areas:i.resolve({data:b,defaults:D({},Kd.layers.area,o.area),settings:x.area})}}(e),n=t.metaLayers,r=t.coordinates,i=t.layers,o=t.lines,a=t.areas,s=[];return n.forEach((function(t,n){var l=i.items[n];if(!1!==l.show){l.datum=l.data,l.data=[],l.id=t.id;for(var u,c,d=[],f=[],p=0;p<t.items.length;p++){if(c=(u=t.items[p]).data,!u.dummy){if(isNaN(u.major))continue;e.missingMinor0&&(u.minor0=r.settings.minor.scale?r.settings.minor.scale(c.minor0?c.minor0.value:0):0),isNaN(u.minor)||d.push(u.minor),l.data.push(u.data)}f.push(u)}var h=d.sort((function(e,t){return e-t}))[Math.floor((d.length-1)/2)];s.push({layerObj:l,lineObj:o.items[n],areaObj:a.items[n],median:h,points:f,consumableData:t.consumableData})}})),s}var Zd={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created:function(){},render:function(e){var t=e.data,n=this.rect,r=n.width,i=n.height;this.stngs=this.settings.settings||{};var o=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,a=Jd({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:o,domain:this.stngs.coordinates&&this.stngs.coordinates.major&&this.stngs.coordinates.major.scale?this.chart.scale(this.stngs.coordinates.major.scale).domain():[]});if(this.stngs.layers&&this.stngs.layers.sort){var s=a.map((function(e){return{id:e.layerObj.id,data:e.layerObj.data}})).sort(this.stngs.layers.sort).map((function(e){return e.id}));a.sort((function(e,t){return s.indexOf(e.layerObj.id)-s.indexOf(t.layerObj.id)}))}else a.sort((function(e,t){return e.median-t.median}));return function(e,t){var n=t.width,r=t.height,i=t.missingMinor0,o=t.stngs,a=[],s=o.layers||{};return e.forEach((function(e){var t,l,u=e.lineObj,c=e.layerObj,d=e.areaObj,f=e.points,p=je(),h=o.coordinates?o.coordinates.defined:null,m={size:r,p:"y"},g={size:n,p:"x"};if("vertical"===o.orientation){var v=D(!0,{},g);g=D(!0,{},m),m=D(!0,{},v)}p[g.p]((function(e){return e.major*g.size}))["".concat(m.p,"1")]((function(e){return e.minor*m.size}))["".concat(m.p,"0")]((function(e){return e.minor0*m.size})).curve(Xd["monotone"===c.curve?"monotone".concat(g.p):c.curve]),h?p.defined((function(e){return!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined})):p.defined((function(e){return!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)}));var y=o.connect?f.filter(p.defined()):f;t=p["line".concat(m.p.toUpperCase(),"1")](),l=p["line".concat(m.p.toUpperCase(),"0")](),s.area&&!1!==d.show&&a.push(Gd(y,{data:e.consumableData,item:d,generator:p})),u&&!1!==u.show&&(a.push(Gd(y,{data:e.consumableData,item:u,generator:t},"none")),!i&&s.area&&!1!==d.show&&!1!==u.showMinor0&&a.push(Gd(y,{data:e.consumableData,item:u,generator:l},"none")))})),a}(a,{width:r,height:i,missingMinor0:o,stngs:this.stngs})}};function Qd(e,t){var n,r,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"===R(t.center)?(n=t.center.x,r=t.center.y):(n=t.clientX,r=t.clientY);var o=n-e.state.boundingRect.left,a=r-e.state.boundingRect.top;return{x:i?Math.max(0,Math.min(o,e.rect.width)):o,y:i?Math.max(0,Math.min(a,e.rect.height)):a}}function ef(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function tf(e,t){var n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-r}}var nf={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart:function(e){this.start(e)},areaMove:function(e){this.move(e)},areaEnd:function(e){this.end(e)},areaCancel:function(){this.cancel()}},created:function(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:function(){return 0},render:function(){},start:function(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();var t=Qd(this,e,!1);Ms({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=this.settings.settings.brush.components.map((function(e){return{key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"}})),this.state.start=Qd(this,e),this.state.active=!0)},move:function(e){var t;this.state.active&&(this.state.end=Qd(this,e),function(e){if(e.state.active){var t=ef(e,e.state.start),n=ef(e,e.state.end),r=e.chart.shapesAt(tf(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(r,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([D({type:"rect"},tf(t.state.start,t.state.end),t.style.area)]))},end:function(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel:function(){this.state.active&&(!function(e,t){e.brushConfig.forEach((function(e){Array.isArray(e.contexts)&&e.contexts.forEach((function(e){t.brush(e).end()}))}))}(this.state,this.chart),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function rf(e,t,n){var r=n.renderer,i=n.style,o=n.props,a=n.h,s=function(e,t){return{tooltip:"function"==typeof e.tooltipClass?e.tooltipClass({dock:t.dock}):e.tooltipClass,content:"function"==typeof e.contentClass?e.contentClass({dock:t.dock}):e.contentClass,arrow:"function"==typeof e.arrowClass?e.arrowClass({dock:t.dock}):e.arrowClass}}(o,t),l=function(e,t,n,r){return r.content({h:e,style:n,data:t})}(a,e,i,o),u=a("div",{dir:o.direction,class:Pd(D({"pic-tooltip":!0},s.tooltip)),style:D({position:"relative",display:"inline-block"},t.computedTooltipStyle)},a("div",{style:i.content,class:Pd(D({"pic-tooltip-content":!0},s.content))},l),a("div",{class:Pd(D({"pic-tooltip-arrow":!0},s.arrow)),style:D({},i.arrow,i["arrow-".concat(t.dock)],t.computedArrowStyle)}));return r.render(u),r.element().children[0]}function of(e){var t=e.defaultDuration,n=e.defaultDelay,r=null,i=null,o=!1,a=function(){var e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};return e.set=function(e){t[e].forEach((function(t){return t(e)}))},e.on=function(e,n){Array.isArray(e)?e.forEach((function(e){return t[e].push(n)})):t[e].push(n)},e.destroy=function(){Object.keys(t).forEach((function(e){t[e].length=0}))},e}(),s=function(){},l=function(){r=null,i=null,o=!1,a.set("fulfilled")};return s.invoke=function(e){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;r&&(clearTimeout(r),a.set("debounced")),a.set("pending"),r=setTimeout((function(){e(),o=!0,r=null,a.set("active")}),u),s>0&&(i&&clearTimeout(i),i=setTimeout(l,s+Math.max(u,0)))},s.clear=function(){o?a.set("cancelled"):r&&(clearTimeout(r),a.set("rejected")),i&&clearTimeout(i),r=null,i=null,o=!1},s.on=function(e,t){a.on(e,t)},s.destroy=function(){s.clear(),a.destroy()},s}function af(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-e,"px)"),right:"translate(".concat(e,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-e,"px)"),bottom:"translate(-50%, ".concat(e,"px)")}}function sf(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-e-n,y:-t/2},right:{x:n,y:-t/2},top:{x:-e/2,y:-t-n},bottom:{x:-e/2,y:n}}}function lf(e){return{left:{left:"100%",top:"calc(50% - ".concat(e,"px)"),borderWidth:"".concat(e,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% - ".concat(e,"px)"),borderWidth:"".concat(e,"px")},top:{left:"calc(50% - ".concat(e,"px)"),top:"100%",borderWidth:"".concat(e,"px")},bottom:{left:"calc(50% - ".concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(e,"px")}}}function uf(e,t,n,r,i,o){var a=t+o.x,s=n+o.y,l=i;return!(a<0||s<0)&&!(a+r>e.width||s+l>e.height)}function cf(e){var t=e.area,n=e.vx,r=e.vy,i=e.width,o=e.height,a=e.offset,s=n+a.x,l=r+a.y,u=i,c=o,d=s<0?-s:0,f=l<0?-l:0;return{x:d+=s+u>t.width?-(s+u-t.width):0,y:f+=l+c>t.height?-(l+c-t.height):0}}function df(e){var t=e.options,n=e.pointer,r=e.width,i=e.height,o=e.dockOrder,a=e.x,s=e.y,l=n.targetBounds,u=af(t.offset),c=u[t.dock];if(c)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c},computedArrowStyle:lf(t.offset)[t.dock],dock:t.dock};for(var d={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},f=sf(r,i,t.offset),p=[],h="target"===t.area?a:l.left+a,m="target"===t.area?s:l.top+s,g=0;g<o.length;g+=1){var v=o[g],y=cf({area:d,vx:h,vy:m,width:r,height:i,offset:f[v]}),b={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u[v]},x=lf(t.offset)[v];0!==y.x&&(b.width="".concat(r-20-Math.abs(y.x),"px"),"top"!==v&&"bottom"!==v||(b.left="".concat(a+y.x,"px"),x.left="calc(50% ".concat(y.x>0?"-":"+"," ").concat(Math.abs(y.x),"px)")));var w={computedTooltipStyle:b,computedArrowStyle:x,dock:v,rect:{width:r,height:i}};if(0===y.x&&0===y.y)return w;w.offset=y,p.push(w)}return p.sort((function(e,t){return Math.abs(e.offset.x)-Math.abs(t.offset.x)})),p[0]}function ff(e,t,n){var r=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!r)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};var i=r.rect;return D({scaleRatio:i.scaleRatio},i.computedInner)}var pf,hf={bounds:function(e){var t=e.resources,n=e.nodes,r=e.pointer,i=e.width,o=e.height,a=e.options,s=r.targetBounds,l=t.getNodeBoundsRelativeToTarget(n[0]),u=l.x,c=l.y,d=l.width,f=l.height,p={left:{x:u,y:c+f/2},right:{x:u+d,y:c+f/2},top:{x:u+d/2,y:c},bottom:{x:u+d/2,y:c+f}},h=af(a.offset),m=h[a.dock];if(m)return{computedTooltipStyle:{left:"".concat(p[a.dock].x,"px"),top:"".concat(p[a.dock].y,"px"),transform:m},computedArrowStyle:lf(a.offset)[a.dock],dock:a.dock};for(var g={width:"target"===a.area?s.width:window.innerWidth,height:"target"===a.area?s.height:window.innerHeight},v=sf(i,o,a.offset),y=["top","left","right","bottom"],b=0;b<y.length;b+=1){var x=y[b];if(uf(g,"target"===a.area?p[x].x:s.left+p[x].x,"target"===a.area?p[x].y:s.top+p[x].y,i,o,v[x]))return{computedTooltipStyle:{left:"".concat(p[x].x,"px"),top:"".concat(p[x].y,"px"),transform:h[x]},computedArrowStyle:lf(a.offset)[x],dock:x}}return{computedTooltipStyle:{left:"".concat(p.top.x,"px"),top:"".concat(p.top.y,"px"),transform:h.top},computedArrowStyle:lf(a.offset).top,dock:"top"}},pointer:function(e){var t=e.options,n=e.pointer,r=e.width,i=e.height;return df({x:n.x,y:n.y,pointer:n,width:r,height:i,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){var t=e.options,n=e.pointer,r=e.width,i=e.height,o=e.nodes,a=e.resources,s=o[0],l=n.dx,u=n.dy,c=a.getComponentBoundsFromNode(s),d=l+c.x+c.width/2,f=u+c.y+c.height/2,p=s.desc.slice,h=p.start,m=p.end,g=p.outerRadius,v=(h+m)/2-Math.PI/2,y=2*Math.PI,b=(v%y+y)%y,x=["top","left","right","bottom"];return"auto"===t.dock&&(x=b<=Math.PI/4||b>=7*Math.PI/4?["right","top","bottom","left"]:b<=3*Math.PI/4?["bottom","left","right","top"]:b<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),df({x:d+g*c.scaleRatio.x*Math.cos(b),y:f+g*c.scaleRatio.y*Math.sin(b),pointer:n,width:r,height:i,options:t,dockOrder:x})}};function mf(e,t){var n=e.width,r=e.height,i=t.chart,o=t.state,a=t.props,s={resources:{formatter:i.formatter,scale:i.scale,component:i.component,getComponentBoundsFromNode:function(e){return ff(e,o.pointer,i)},getNodeBoundsRelativeToTarget:function(e){return function(e,t,n){var r=ff(e,t,n),i=e.bounds;return{x:r.x+t.dx+i.x,y:r.y+t.dy+i.y,width:i.width,height:i.height}}(e,o.pointer,i)}},nodes:o.activeNodes,pointer:o.pointer,width:n,height:r},l=R(a.placement);if("object"===l&&"function"==typeof a.placement.fn)return a.placement.fn(s);var u={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(u=D(u,a.placement(s))),"object"===l&&hf[a.placement.type]?u=D(u,a.placement):"string"===l&&hf[a.placement]&&(u=D(u,{type:a.placement})),s.options=u;var c=hf[u.type](s),d=s.resources.getComponentBoundsFromNode(s.nodes[0]),f=d.x,p=d.y,h=d.width,m=d.height;return h+=f+=s.pointer.dx,m+=p+=s.pointer.dy,c.computedTooltipStyle.left="".concat(Math.min(Math.max(0,f,parseFloat(c.computedTooltipStyle.left)),h),"px"),c.computedTooltipStyle.top="".concat(Math.min(Math.max(0,p,parseFloat(c.computedTooltipStyle.top)),m),"px"),c}function gf(){pf=null}function vf(e,t){var n=t.chart,r=t.state,i=0,o=0;e.center?(i+=e.center.x,o+=e.center.y):(i+=e.clientX,o+=e.clientY);var a=n.element.getBoundingClientRect(),s=r.targetElement.getBoundingClientRect(),l=i,u=o,c=a.left-s.left,d=a.top-s.top,f=i-a.left,p=o-a.top;return{x:i-=s.left,y:o-=s.top,dx:c,dy:d,cx:f,cy:p,clientX:l,clientY:u,targetBounds:s,chartBounds:a}}var yf={require:["chart","renderer"],defaultSettings:{settings:{duration:8e3,delay:500,filter:function(e){return e.filter((function(e){return e.data&&void 0!==e.data.value}))},extract:function(e){return e.node.data.value},content:function(e){var t=e.h;return e.data.map((function(e){return t("div",{},e)}))},isEqual:function(e,t){return e.length&&e.length===t.length&&e.every((function(e,n){return t[n]&&JSON.stringify(e.data)===JSON.stringify(t[n].data)}))},placement:{type:"pointer",dock:"auto",offset:8,area:"viewport"},tooltipClass:{},contentClass:{},arrowClass:{},direction:"ltr",appendTo:void 0,beforeShow:void 0,afterShow:void 0,beforeHide:void 0,onHide:void 0,afterHide:void 0},style:{tooltip:{},content:{backgroundColor:"$gray-25",color:"$font-color--inverted",fontFamily:"$font-family",fontSize:"$font-size",lineHeight:"$line-height",borderRadius:"4px",padding:"8px",opacity:.9},arrow:{position:"absolute",width:"0px",height:"0px",borderStyle:"solid",color:"$gray-25",opacity:.9},"arrow-bottom":{borderTopColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-top":{borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-right":{borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent"},"arrow-left":{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent"}}},renderer:"dom",on:{hide:function(){this.hide()},show:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent:function(e){this.prevent(e)}},hide:function(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show:function(e){var t,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.nodes,o=r.duration,a=r.delay;!this.state.prevent&&this.state.targetElement&&(this.state.pointer=vf(e,this),t=Array.isArray(i)?this.props.filter(i):this.props.filter(this.chart.shapesAt({x:this.state.pointer.cx,y:this.state.pointer.cy})),this.props.isEqual(this.state.activeNodes,t)||(this.dispatcher.clear(),this.state.activeNodes=t,this.state.activeNodes.length&&this.dispatcher.invoke((function(){return n.invokeRenderer(n.state.activeNodes)}),o,a)))},prevent:function(e){this.state.prevent=!!e},init:function(e){var t=this;this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=of({defaultDuration:this.props.duration,defaultDelay:this.props.delay});var n=this.dispatcher.clear;this.dispatcher.on("pending",(function(){!function(e){pf&&pf!==e&&pf()}(n),pf=n,"function"==typeof t.props.beforeShow&&t.props.beforeShow.call(void 0,{resources:{formatter:t.chart.formatter,scale:t.chart.scale}})})),this.dispatcher.on(["cancelled","fulfilled"],(function(){var e={resources:{formatter:t.chart.formatter,scale:t.chart.scale}};"function"==typeof t.props.beforeHide&&t.props.beforeHide.call(void 0,D({element:t.state.tooltipElm},e)),"function"==typeof t.props.onHide?t.props.onHide.call(void 0,D({element:t.state.tooltipElm},e)):t.renderer.clear([]),"function"==typeof t.props.afterHide&&t.props.afterHide.call(void 0,e),pf===n&&(pf=null),t.state.tooltipElm=void 0})),this.dispatcher.on("active",(function(){"function"==typeof t.props.afterShow&&t.props.afterShow.call(void 0,{element:t.state.tooltipElm,resources:{formatter:t.chart.formatter,scale:t.chart.scale}})}))},created:function(){this.init(this.settings)},beforeUpdate:function(e){var t=e.settings;this.dispatcher&&(this.dispatcher.destroy(),gf()),this.init(t)},render:function(e){return this.h=e,[]},beforeDestroy:function(){this.dispatcher.destroy(),gf()},appendTo:function(){if(this.props.appendTo){this.state.targetElement="function"==typeof this.props.appendTo?this.props.appendTo({resources:{formatter:this.chart.formatter,scale:this.chart.scale}}):this.props.appendTo;var e=this.state.targetElement.getBoundingClientRect(),t=e.width,n=e.height;this.renderer.destroy(),this.renderer.size({width:t,height:n}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted:function(){this.appendTo()},updated:function(){this.appendTo()},invokeRenderer:function(e){var t=function(e,t){var n=t.chart,r=t.scale,i=t.props,o=t.h,a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:r,h:o},s=[];return e.forEach((function(e){if("function"==typeof i.extract){var t=D({node:e},a);s.push(i.extract(t))}})),s}(e,this),n=mf(rf(t,{style:{left:"0px",top:"0px",visibility:"hidden"}},this).getBoundingClientRect(),this);this.state.tooltipElm=rf(t,n,this)}};var bf={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update:function(){this.draw()}},draw:function(){var e=this,t=this.chart.findShapes(this.props.selector).filter((function(t){return t.key===e.props.target})).filter((function(e){return e.collider})).map((function(e){return e.collider}));t.forEach((function(t){t.fill=e.props.fill,t.stroke=e.props.stroke,t.opacity=e.props.opacity,t.collider={type:null}})),this.renderer.render(t)},created:function(){this.props=this.settings.settings},resize:function(e){var t=e.outer,n=e.inner;return this.props.useOuterRect?t:n},render:function(){},mounted:function(){this.draw()},updated:function(){this.props=this.settings.settings,this.draw()}},xf=2*Math.PI;function wf(e,t,n,r){return Math.abs(e.x+n.x-(t.x+t.x))+Math.abs(e.y+n.y-(t.y+t.y))+Math.abs(t.x+r.x-(n.x+n.x))+Math.abs(t.y+r.y-(n.y+n.y))}function kf(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function Cf(e,t,n,r,i){var o=1-e;return Math.pow(o,3)*t+3*Math.pow(o,2)*e*n+3*o*Math.pow(e,2)*r+Math.pow(e,3)*i}function Sf(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||wf(e,t,n,r)<=10)return i[i.length-1]!==e&&i.push(e),i.push(r),i;var a=.5,s=kf(e,t),l=kf(t,n),u=kf(n,r),c={x:Cf(a,e.x,t.x,n.x,r.x),y:Cf(a,e.y,t.y,n.y,r.y)},d=kf(s,l),f=kf(l,u);return Sf(e,s,d,c,i,o-1),Sf(c,f,u,r,i,o-1),i}function Ef(e,t,n){var r=function(e,t,n){return{cp1:{x:e.x+2/3*(t.x-e.x),y:e.y+2/3*(t.y-e.y)},cp2:{x:n.x+2/3*(t.x-n.x),y:n.y+2/3*(t.y-n.y)}}}(e,t,n);return Sf(e,r.cp1,r.cp2,n)}function Mf(e,t,n){var r,i,o,a,s=[],l=!!e[4],u=!!e[5],c=e[3],d=e[6],f=e[7],p=e[1],h=e[2];if("a"===e[0]&&(d+=t,f+=n),t===f&&n===f)return s;if(!p||!h)return s.push({x:d,y:f}),s;var m=function(e,t,n,r,i,o,a,s,l){var u,c,d,f,p,h,m=Ha(n%360),g=Math.cos(m),v=Math.sin(m),y=(s-o)/2,b=(l-a)/2,x=g*y+v*b,w=g*b-v*y;e=Math.abs(e),t=Math.abs(t),(h=Math.pow(x,2)/Math.pow(e,2)+Math.pow(w,2)/Math.pow(t,2))>1&&(e*=h=Math.sqrt(h),t*=h);var k=e*t,C=e*w,S=t*x,E=Math.pow(C,2)+Math.pow(S,2),M=Math.pow(k,2)-E,T=Math.sqrt(Math.max(M/E,0));r===i&&(T=-T);var D=T*(C/t),_=T*(-S/e);f=g*D-v*_+(s+o)/2,p=v*D+g*_+(l+a)/2;var N=(x-D)/e,q=(w-_)/t,R=(-x-D)/e,P=(-w-_)/t;return u=Math.atan2(q,N),u+=u<0?xf:0,c=Math.atan2(P,R),d=(c+=c<0?xf:0)-u,!i&&u<c?d-=xf:i&&c<u&&(d+=xf),{startAngle:u,sweepAngle:d%=xf,cx:f,cy:p,rx:e,ry:t}}(p,h,c,l,u,d,f,t,n);r=m.cx,i=m.cy,p=m.rx,h=m.ry,o=m.sweepAngle,a=m.startAngle;for(var g=Math.abs(o*Math.sqrt((Math.pow(p,2)+Math.pow(h,2))/2)),v=Math.ceil(g/10),y=o/v,b=1;b<=v;b++){var x=(a+y*b)%xf,w=Math.cos(x),k=Math.sin(x);s.push({x:r+w*p+-k*w,y:i+k*h+w*k})}return s}function Tf(e){for(var t=b.parsePath(e),n=[],r=[],i=0,o=0,a=null,s=null,l=null,u=null,c=0;c<t.length;++c){var d=t[c],f=d[0];switch("S"!==f&&"s"!==f&&"C"!==f&&"c"!==f&&(a=null,s=null),"T"!==f&&"t"!==f&&"Q"!==f&&"q"!==f&&(l=null,u=null),f){case"m":r.length&&n.push(r.splice(0));case"l":i+=d[1],o+=d[2],r.push({x:i,y:o});break;case"M":r.length&&n.push(r.splice(0));case"L":i=d[1],o=d[2],r.push({x:i,y:o});break;case"H":i=d[1],r.push({x:i,y:o});break;case"h":i+=d[1],r.push({x:i,y:o});break;case"V":o=d[1],r.push({x:i,y:o});break;case"v":o+=d[1],r.push({x:i,y:o});break;case"a":r.push.apply(r,X(Mf(d,i,o))),i+=d[6],o+=d[7];break;case"A":r.push.apply(r,X(Mf(d,i,o))),i=d[6],o=d[7];break;case"c":r.push.apply(r,X(Sf({x:i,y:o},{x:d[1]+i,y:d[2]+o},{x:d[3]+i,y:d[4]+o},{x:d[5]+i,y:d[6]+o}))),a=d[3]+i,s=d[4]+o,i+=d[5],o+=d[6];break;case"C":r.push.apply(r,X(Sf({x:i,y:o},{x:d[1],y:d[2]},{x:d[3],y:d[4]},{x:d[5],y:d[6]}))),a=d[3],s=d[4],i=d[5],o=d[6];break;case"s":null!==a&&null!==a||(a=i,s=o),r.push.apply(r,X(Sf({x:i,y:o},{x:2*i-a,y:2*o-s},{x:d[1]+i,y:d[2]+o},{x:d[3]+i,y:d[4]+o}))),a=d[1]+i,s=d[2]+o,i+=d[3],o+=d[4];break;case"S":null!==a&&null!==a||(a=i,s=o),r.push.apply(r,X(Sf({x:i,y:o},{x:2*i-a,y:2*o-s},{x:d[1],y:d[2]},{x:d[3],y:d[4]}))),a=d[1],s=d[2],i=d[3],o=d[4];break;case"Q":r.push.apply(r,X(Ef({x:i,y:o},{x:d[1],y:d[2]},{x:d[3],y:d[4]}))),l=d[1],u=d[2],i=d[3],o=d[4];break;case"q":r.push.apply(r,X(Ef({x:i,y:o},{x:d[1]+i,y:d[2]+o},{x:d[3]+i,y:d[4]+o}))),l=d[1]+i,u=d[2]+o,i+=d[3],o+=d[4];break;case"T":null!==l&&null!==l||(l=i,u=o),l=2*i-l,u=2*o-u,r.push.apply(r,X(Ef({x:i,y:o},{x:l,y:u},{x:d[1],y:d[2]}))),i=d[1],o=d[2];break;case"t":null!==l&&null!==l||(l=i,u=o),l=2*i-l,u=2*o-u,r.push.apply(r,X(Ef({x:i,y:o},{x:l,y:u},{x:d[1]+i,y:d[2]+o}))),i+=d[1],o+=d[2];break;case"z":case"Z":r.length&&r.push({x:r[0].x,y:r[0].y})}}return function(e){for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];Math.abs(n.x-r.x)<1e-12&&Math.abs(n.y-r.y)<1e-12&&(e.splice(t,1),t--)}}(r),n.push(r.splice(0)),n}var Df={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update:function(){this.draw()}},draw:function(){var e=this,t=this.chart.findShapes("path").filter((function(t){return t.key===e.props.target})),n=[];t.forEach((function(t){Tf(t.attrs.d).forEach((function(t){t.forEach((function(t){n.push({type:"circle",cx:t.x,cy:t.y,r:e.props.radius,fill:e.props.fill,stroke:e.props.stroke,opacity:e.props.opacity,collider:{type:null}})}))}))})),this.renderer.render(n)},created:function(){this.props=this.settings.settings},resize:function(e){var t=e.outer,n=e.inner;return this.props.useOuterRect?t:n},render:function(){},mounted:function(){this.draw()},updated:function(){this.props=this.settings.settings,this.draw()}};var _f=[function(e){e.component("box",Fl),e.component("box-marker",Fl)},function(e){e.component("point",$l),e.component("point-marker",$l)},function(e){e.component("pie",Gl)},function(e){e.component("grid-line",tu)},function(e){e.component("ref-line",lu)},function(e){e.component("axis",Nu)},function(e){e.component("container",qu)},function(e){e.component("text",Au)},function(e){e.component("scrollbar",Lu)},function(e){e.component("brush-range",Zu),e.component("brush-area-dir",tc)},function(e){e.component("range",oc)},function(e){e.component("brush-lasso",dc)},function(e){e.component("labels",Dd)},function(e){e.component("legend-cat",Hd)},function(e){e.component("legend-seq",Yd)},function(e){e.component("line",Zd)},function(e){e.component("brush-area",nf)},function(e){e.component("tooltip",yf)},function(e){e.component("debug-collider",bf)},function(e){e.component("debug-path-to-points",Df)}],Nf=function(){function e(t){P(this,e),this._parent=null,this._children=[],this._ancestors=null,this.type=t,this.data=null}return I(e,[{key:"detach",value:function(){return this._parent&&this._parent.removeChild(this),this}},{key:"parent",get:function(){return this._parent}},{key:"isBranch",get:function(){return this._children&&this._children.length}},{key:"children",get:function(){return this._children}},{key:"ancestors",get:function(){var e;this._ancestors||(this._ancestors=[],this.parent&&(e=this._ancestors).push.apply(e,[this.parent].concat(X(this.parent.ancestors))));return this._ancestors}},{key:"descendants",get:function(){var e,t,n=[],r=this.children.length;for(e=0;e<r;e++)t=this.children[e],n.push(t),t.children.length&&(n=[].concat(X(n),X(t.descendants)));return n}},{key:"equals",value:function(e){var t=this.children,n=e.children;if(t.length!==n.length)return!1;for(var r=0;r<t.length;r++)if(!t[r].equals(n[r]))return!1;return!0}},{key:"toJSON",value:function(){return{type:this.type,children:this.children.map((function(e){return e.toJSON()}))}}}]),e}(),qf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i,a=t.width,s=void 0===a?0:a,l=t.height,u=void 0===l?0:l,c=t.minWidth,d=void 0===c?0:c,f=t.minHeight,p=void 0===f?0:f;P(this,e),this.set({x:r,y:o,width:s,height:u,minWidth:d,minHeight:p})}return I(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,u=e.minWidth,c=void 0===u?0:u,d=e.minHeight,f=void 0===d?0:d;this.type="rect",a>=0?(this.x=n,this.width=Math.max(a,c)):(this.x=n+Math.min(a,-c),this.width=-Math.min(a,-c)),l>=0?(this.y=i,this.height=Math.max(l,f)):(this.y=i+Math.min(l,-f),this.height=-Math.min(l,-f))}},{key:"containsPoint",value:function(e){return Ms(this,e)}},{key:"intersectsLine",value:function(e){return Ts(this,ie(e))}},{key:"intersectsRect",value:function(e){return Ss(this,re(e))}},{key:"intersectsCircle",value:function(e){return ys(e,this)}},{key:"intersectsPolygon",value:function(e){return Cs(e,this)}},{key:"intersectsGeoPolygon",value:function(e){return Is(e,this)}},{key:"points",value:function(){return[{x:this.x,y:this.y},{x:this.x+this.width,y:this.y},{x:this.x+this.width,y:this.y+this.height},{x:this.x,y:this.y+this.height}]}}]),e}();var Rf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.cx,r=void 0===n?0:n,i=t.cy,o=void 0===i?0:i,a=t.r,s=void 0===a?0:a,l=t.minRadius,u=void 0===l?0:l;P(this,e),this.set({cx:r,cy:o,r:s,minRadius:u})}return I(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cx,n=void 0===t?0:t,r=e.cy,i=void 0===r?0:r,o=e.r,a=void 0===o?0:o,s=e.minRadius,l=void 0===s?0:s;this.type="circle",this.cx=n,this.cy=i,this.r=Math.max(a,l),this.vector={x:this.cx,y:this.cy}}},{key:"containsPoint",value:function(e){return vs(this,e)}},{key:"intersectsLine",value:function(e){return bs(this,ie(e))}},{key:"intersectsRect",value:function(e){return ys(this,re(e))}},{key:"intersectsCircle",value:function(e){return function(e,t){if(ps(e)||ps(t))return!1;var n=e.cx-t.cx,r=e.cy-t.cy;return Math.pow(n,2)+Math.pow(r,2)<=Math.pow(e.r+t.r,2)}(this,e)}},{key:"intersectsPolygon",value:function(e){return xs(this,e)}},{key:"intersectsGeoPolygon",value:function(e){return Rs(this,e)}},{key:"points",value:function(){return[{x:this.cx,y:this.cy}]}}]),e}();var Pf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.x1,r=void 0===n?0:n,i=t.y1,o=void 0===i?0:i,a=t.x2,s=void 0===a?0:a,l=t.y2,u=void 0===l?0:l,c=t.tolerance,d=void 0===c?0:c;P(this,e),this.set({x1:r,y1:o,x2:s,y2:u,tolerance:d})}return I(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x1,n=void 0===t?0:t,r=e.y1,i=void 0===r?0:r,o=e.x2,a=void 0===o?0:o,s=e.y2,l=void 0===s?0:s,u=e.tolerance,c=void 0===u?0:u;this.type="line",this.x1=n,this.y1=i,this.x2=a,this.y2=l,this.tolerance=Math.max(0,Math.round(c)),this.vectors=this.points(),this.zeroSize=n===a&&i===l}},{key:"containsPoint",value:function(e){return this.tolerance>0?bs({cx:e.x,cy:e.y,r:this.tolerance},this):_s(this,e)}},{key:"intersectsLine",value:function(e){return Ds(this,ie(e))}},{key:"intersectsRect",value:function(e){return Ts(re(e),this)}},{key:"intersectsCircle",value:function(e){return bs(e,this)}},{key:"intersectsPolygon",value:function(e){return ks(e,this)}},{key:"intersectsGeoPolygon",value:function(e){return As(e,this)}},{key:"points",value:function(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}]),e}();function Af(e){var t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function If(e){for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}var Of=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.vertices,r=void 0===n?[]:n;P(this,e),this.set({vertices:r})}return I(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vertices,n=void 0===t?[]:t;if(this.type="polygon",this.vertices=n.slice(),this.edges=[],If(this.vertices),!(this.vertices.length<=2)){Af(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(var r=0;r<this.vertices.length;r++)r<this.vertices.length-1&&this.edges.push([this.vertices[r],this.vertices[r+1]]),this.xMin=isNaN(this.xMin)?this.vertices[r].x:Math.min(this.xMin,this.vertices[r].x),this.xMax=isNaN(this.xMax)?this.vertices[r].x:Math.max(this.xMax,this.vertices[r].x),this.yMin=isNaN(this.yMin)?this.vertices[r].y:Math.min(this.yMin,this.vertices[r].y),this.yMax=isNaN(this.yMax)?this.vertices[r].y:Math.max(this.yMax,this.vertices[r].y);this._bounds=null,this._boundingRect=null}}},{key:"containsPoint",value:function(e){return ws(this,e)}},{key:"intersectsCircle",value:function(e){return xs(e,this)}},{key:"intersectsLine",value:function(e){return ks(this,ie(e))}},{key:"intersectsRect",value:function(e){return Cs(this,re(e))}},{key:"intersectsPolygon",value:function(e){return Ns(this,e)}},{key:"intersectsGeoPolygon",value:function(e){return qs(e,this)}},{key:"points",value:function(){return this.vertices}},{key:"bounds",value:function(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}},{key:"boundingRect",value:function(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}]),e}();function Lf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Of,t)}function zf(e){var t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function Ff(e){for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}var jf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.vertices,r=void 0===n?[[]]:n;P(this,e),this.set({vertices:r})}return I(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vertices,n=void 0===t?[]:t;this.type="geopolygon",this.vertices=n.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(var r=0;r<this.numPolygons;r++)Ff(this.vertices[r]),this.vertices[r].length>2&&zf(this.vertices[r]),this.polygons[r]=Lf({vertices:this.vertices[r]}),this.xMin=isNaN(this.xMin)?this.polygons[r].xMin:Math.min(this.xMin,this.polygons[r].xMin),this.xMax=isNaN(this.xMax)?this.polygons[r].xMax:Math.max(this.xMax,this.polygons[r].xMax),this.yMin=isNaN(this.yMin)?this.polygons[r].yMin:Math.min(this.yMin,this.polygons[r].yMin),this.yMax=isNaN(this.yMax)?this.polygons[r].yMax:Math.max(this.yMax,this.polygons[r].yMax);this._bounds=null,this._boundingRect=null}},{key:"containsPoint",value:function(e){return Ps(this,e)}},{key:"intersectsCircle",value:function(e){return Rs(e,this)}},{key:"intersectsLine",value:function(e){return As(this,ie(e))}},{key:"intersectsRect",value:function(e){return Is(this,re(e))}},{key:"intersectsPolygon",value:function(e){return qs(this,e)}},{key:"intersectsGeoPolygon",value:function(e){return n=e,r=(t=this).boundingRect(),i=n.boundingRect(),!!Ss(r,i)&&(Es(i,r)?gs(n,t):gs(t,n));var t,n,r,i}},{key:"points",value:function(){return this.vertices}},{key:"bounds",value:function(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}},{key:"boundingRect",value:function(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}]),e}();function Hf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(jf,t)}function Bf(e,t){return e.x!==t.x||e.y!==t.y}var Vf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.points,r=void 0===n?[]:n;P(this,e),this.set({points:r})}return I(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.points,n=void 0===t?[]:t;if(this.type="polyline",this.segments=[],this._points=n.slice(),this._points.length>1)for(var r=0,i=this._points.length-1;r<i;r++)Bf(this._points[r],this._points[r+1])&&this.segments.push({x1:this._points[r].x,y1:this._points[r].y,x2:this._points[r+1].x,y2:this._points[r+1].y})}},{key:"containsPoint",value:function(e){return this.segments.some((function(t){return _s(t,e)}))}},{key:"intersectsCircle",value:function(e){return this.segments.some((function(t){return bs(e,t)}))}},{key:"intersectsLine",value:function(e){var t=ie(e);return this.segments.some((function(e){return Ds(e,t)}))}},{key:"intersectsRect",value:function(e){var t=re(e);return this.segments.some((function(e){return Ts(t,e)}))}},{key:"intersectsPolygon",value:function(e){return this.segments.some((function(t){return ks(e,t)}))}},{key:"intersectsGeoPolygon",value:function(e){return this.segments.some((function(t){return As(e,t)}))}},{key:"points",value:function(){return this._points}}]),e}();var Wf=ft();function Uf(e,t){return Wf.get(e)(t)}Wf.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(qf,t)})),Wf.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Rf,t)})),Wf.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Pf,t)})),Wf.add("polygon",Lf),Wf.add("geopolygon",Hf),Wf.add("polyline",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Vf,t)}));var $f=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];P(this,e),this.set(t)}return I(e,[{key:"set",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],t.forEach((function(t){var n=Uf(t.type,t);n&&e.geometries.push(n)}))}},{key:"containsPoint",value:function(e){return this.geometries.some((function(t){return t.containsPoint(e)}))}},{key:"intersectsLine",value:function(e){return this.geometries.some((function(t){return t.intersectsLine(e)}))}},{key:"intersectsRect",value:function(e){return this.geometries.some((function(t){return t.intersectsRect(e)}))}},{key:"intersectsCircle",value:function(e){return this.geometries.some((function(t){return t.intersectsCircle(e)}))}},{key:"intersectsPolygon",value:function(e){return this.geometries.some((function(t){return t.intersectsPolygon(e)}))}},{key:"intersectsGeoPolygon",value:function(e){return this.geometries.some((function(t){return t.intersectsGeoPolygon(e)}))}}]),e}();var Yf=function(){function e(){P(this,e),this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}return I(e,[{key:"clone",value:function(){return(new e).multiply(this)}},{key:"set",value:function(e){return this._elements=e,this}},{key:"save",value:function(){return this._stack.push(this.elements),this}},{key:"restore",value:function(){return this._stack.length&&(this._elements=this._stack.pop()),this}},{key:"add",value:function(e){var t,n;for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]+=e;return this}},{key:"translate",value:function(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}},{key:"rotate",value:function(e){var t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}},{key:"multiply",value:function(t){var n,r,i,o;if(t instanceof e&&(t=t._elements),Array.isArray(t)){for(i=[[0,0,0],[0,0,0],[0,0,0]],n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)for(o=0;o<3;o++)i[n][r]+=this._elements[n][o]*t[o][r];this._elements=i}else for(n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)this._elements[n][r]*=t;return this}},{key:"scale",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}},{key:"transform",value:function(e,t,n,r,i,o){return this.multiply([[e,n,i],[t,r,o],[0,0,1]]),this}},{key:"determinant",value:function(){var e=this._elements[0][0],t=this._elements[0][1],n=this._elements[0][2],r=this._elements[1][0],i=this._elements[1][1],o=this._elements[1][2],a=this._elements[2][0],s=this._elements[2][1],l=this._elements[2][2];return e*i*l+t*o*a+n*r*s-n*i*a-t*r*l-e*o*s}},{key:"invert",value:function(){var e=this.determinant(),t=this._elements[0][0],n=this._elements[0][1],r=this._elements[0][2],i=this._elements[1][0],o=this._elements[1][1],a=this._elements[1][2],s=this._elements[2][0],l=this._elements[2][1],u=this._elements[2][2];return this._elements=[[o*u-a*l,r*l-n*u,n*a-r*o],[a*s-i*u,t*u-r*s,r*i-t*a],[i*l-o*s,s*n-t*l,t*o-n*i]],this.multiply(1/e),this}},{key:"transpose",value:function(){var e=Object.create(this._elements);return this._elements=[[e[0][0],e[1][0],e[2][0]],[e[0][1],e[1][1],e[2][1]],[e[0][2],e[1][2],e[2][2]]],this}},{key:"identity",value:function(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}},{key:"toString",value:function(){return"".concat(this._elements.map((function(e){return e.join("\t")})).join("\n"))}},{key:"isIdentity",value:function(){var e=this._elements;return 1===e[0][0]&&0===e[0][1]&&0===e[0][2]&&0===e[1][0]&&1===e[1][1]&&0===e[1][2]&&0===e[2][0]&&0===e[2][1]&&1===e[2][2]}},{key:"transformPoint",value:function(e){var t,n,r=[e.x,e.y,1],i=this._elements,o=[0,0,0];for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)o[t]+=r[n]*i[t][n];return{x:o[0],y:o[1]}}},{key:"transformPoints",value:function(e){var t,n,r,i,o,a=this._elements,s=[];for(i=0;i<e.length;i++){for(t=[e[i].x,e[i].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)o[n]+=t[r]*a[n][r];s.push({x:o[0],y:o[1]})}return s}},{key:"elements",get:function(){var e=this._elements;return[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]],[e[2][0],e[2][1],e[2][2]]]}}]),e}(),Xf=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function Kf(e,t){var n=t.args[0]*(Math.PI/180);if(t.args.length>2){var r=t.args[1],i=t.args[2];e.translate(r,i),e.rotate(n),e.translate(-r,-i)}else 1===t.args.length&&e.rotate(n)}function Gf(e,t){var n=t.args[0],r=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,r)}function Jf(e,t){var n=t.args[0],r=isNaN(t.args[1])?0:t.args[1];e.translate(n,r)}function Zf(e,t){t.args.length>=6&&e.transform.apply(e,X(t.args))}function Qf(e,t){for(var n,r=function(e){for(var t,n=[];null!==(t=Xf.exec(e));){var r=t[2].trim(),i=-1===r.indexOf(",")?r.split(" "):r.split(",");n.push({cmd:t[1],args:i.filter((function(e){return e.trim().length>0})).map((function(e){return Number(e)}))})}return n}(e),i=0,o=r.length;i<o;i++)"rotate"===(n=r[i]).cmd?Kf(t,n):"scale"===n.cmd?Gf(t,n):"matrix"===n.cmd?Zf(t,n):"translate"===n.cmd&&Jf(t,n)}var ep={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},tp={type:function(e,t){return t.filter((function(t){var n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()}))},attr:function(e,t,n,r){return r.filter((function(r){var i=r.attrs[e];if(!t)return void 0!==i;if(void 0===i)return!1;switch(t){case"=":return n===String(i);case"!=":return n!==String(i);default:return!1}}))},universal:function(e){return e},tag:function(e,t){return t.filter((function(t){var n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))}))}};var np={find:function(e,t){var n,r,i=[],o=[];if(t.isBranch){var a;n=function(e){var t,n,r,i,o=[];return e.split(/\s*,\s*/).forEach((function(e){e=e.trim(),t=[];for(var a=function(o){(r=e.match(ep[o]))&&(i=!0,e=e.slice(r[0].length),n={type:o,value:r[0]},"attr"===o&&(r=r[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),n.attribute=r[1],n.operator=r[2],n.attributeValue=r[3]),t.push(n))};e&&(i=!1,(r=e.match(/^\s*([>+~]|\s)\s*/))&&(i=!0,t.push({type:" ",value:r[0]}),e=e.slice(r[0].length)),Object.keys(ep).forEach(a),t&&t.length&&o.indexOf(t)<0&&o.push(t),i););})),o}(e),r=t.descendants;for(var s=function(e,t){a=n[e];var i=[],s=r.slice(),l=!1;a.reverse().forEach((function(e){if(" "===e.type)return i.push(s),s=r.slice(),void(l=!1);s=function(e,t){if(!t||!t.length||!e||"function"!=typeof tp[e.type])return[];switch(e.type){case"type":return tp[e.type](e.value,t);case"attr":return tp[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return tp[e.type](t);case"tag":return tp[e.type](e.value,t);default:return[]}}(e,s),l=!0})),l&&i.push(s);var u=i[0].filter((function(e){for(var t,n=e.parent,r=1;r<i.length;r++){for(t=i[r].indexOf(n);n&&t<0;)n=n.parent,t=i[r].indexOf(n);if(t<0)return!1}return!0}));o.push(u)},l=0,u=n.length;l<u;l++)s(l);for(var c=0,d=o.length;c<d;c++)for(var f=0,p=o[c].length;f<p;f++)i.indexOf(o[c][f])<0&&i.push(o[c][f])}return i||[]}};function rp(e,t,n){var r=e.type,i=e.points();n&&(i=i.every((function(e){return Array.isArray(e)}))?i.map((function(e){return n.transformPoints(e)})):n.transformPoints(i)),function(e,t){for(var n=0,r=e.length;n<r;n++)e[n].x/=t,e[n].y/=t}(i,t);var o=null;if("rect"===r||"bounds"===r)(o=re(i)).type=r;else if("circle"===r)(o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(i,e.r)).type=r;else if("line"===r)(o=ie(i)).type=r;else if("polygon"===r||"polyline"===r){o={type:"path",d:Fa(i,"polygon"===r)}}else if("geopolygon"===r){for(var a="",s=0;s<i.length;s++)a+=Fa(i[s],!0);o={type:"path",d:a}}return o}var ip=function(){function e(t){var n=this;P(this,e),this._bounds=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=t.boundingRect?t.boundingRect(e):{x:0,y:0,width:0,height:0},r=n.x,i=n.y,o=n.width,a=n.height;return{x:r,y:i,width:o,height:a}},this._attrs=t.attrs,this._type=t.type,this._data=t.data,this._dpi=t.stage?t.stage.dpi:1,this._collider=function(){return function(e,t){if(e.collider){var n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map((function(e){return rp(e,t,n)}))}:rp(e.collider,t,n)}return null}(t,n._dpi)},this._desc=t.desc,this._tag=t.tag,this._children=function(){return t.children.map((function(t){return new e(t)}))},this._parent=function(){return t.parent?new e(t.parent):null},this._cache={elementBoundingRect:null},this._getElementBoundingRect=function(){return!n._cache.elementBoundingRect&&n.element&&(n._cache.elementBoundingRect=n.element.getBoundingClientRect()),n._cache.elementBoundingRect||{left:0,top:0}}}return I(e,[{key:"children",get:function(){return this._children()}},{key:"parent",get:function(){return this._parent()}},{key:"type",get:function(){return this._type}},{key:"data",get:function(){return this._data}},{key:"attrs",get:function(){return this._attrs}},{key:"element",get:function(){return this._element},set:function(e){this._cache.elementBoundingRect=null,this._element=e}},{key:"key",get:function(){return this._key},set:function(e){this._key=e}},{key:"bounds",get:function(){var e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}},{key:"localBounds",get:function(){return this._bounds(!1)}},{key:"boundsRelativeTo",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=R(e),r=t?this.bounds:this.localBounds,i=this._getElementBoundingRect(),o=i.left,a=i.top;if("object"===n&&null!==e&&"function"==typeof e.getBoundingClientRect){var s=e.getBoundingClientRect(),l=s.left,u=void 0===l?0:l,c=s.top,d=void 0===c?0:c;o-=u,a-=d}return r.x+=o,r.y+=a,r}},{key:"collider",get:function(){return this._collider()}},{key:"desc",get:function(){return this._desc}},{key:"tag",get:function(){return this._tag}}]),e}();function op(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(ip,t)}var ap=function(){function e(t){P(this,e),this._node=op(t),this._parent=null,this._input=null}return I(e,[{key:"node",get:function(){return this._node}},{key:"parent",get:function(){return this._parent},set:function(e){this._parent=e}},{key:"input",get:function(){return this._input},set:function(e){this._input=e}}]),e}();function sp(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(ap,t)}function lp(e,t){var n=e.parent;if(n&&"stage"!==n.type){t.parent=sp(n);var r=n.parent;r&&"stage"!==r.type&&lp(r,t.parent)}}function up(e,t,n){if(null===e.colliderType)return null;var r=function(e,t){var n={};if(e.modelViewMatrix)if(Array.isArray(t))n=e.inverseModelViewMatrix.transformPoints(t);else if(isNaN(t.r))Array.isArray(t.vertices)?n.vertices=e.inverseModelViewMatrix.transformPoints(t.vertices):n=e.inverseModelViewMatrix.transformPoint(t);else{var r={x:t.cx,y:t.cy},i=e.inverseModelViewMatrix.transformPoint(r);n.cx=i.x,n.cy=i.y,n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every((function(e){return Array.isArray(e)}))?Hf(n):Lf(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(var r=e.descendants.length-1;r>=0;r--){var i=e.descendants[r];if(null!==i.collider&&i.collider[t](n)){var o=sp(i);return lp(i,o),o}}return null}(e,t,r):function(e,t,n){if(e.collider[t](n)){var r=sp(e);return lp(e,r),r}return null}(e,t,r)}function cp(e,t,n,r){for(var i=e.length,o=0;o<i;o++){var a=e[o],s=up(a,t,r);s&&n.push(s),!a.children||s||a.collider||cp(a.children,t,n,r)}}function dp(e,t,n){for(var r=e.length,i=0;i<r;i++){var o=e[i];if(null!==up(o,t,n))return!0;if(o.children&&!o.collider)return dp(o.children,t,n)}return!1}function fp(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=oe(e),r={};switch(n){case"circle":return r.cx=e.cx*t,r.cy=e.cy*t,r.r=e.r,["intersectsCircle",r];case"rect":return["intersectsRect",r=ne(e).map((function(e){return Ua(e,t)}))];case"line":return["intersectsLine",r=te(e).map((function(e){return Ua(e,t)}))];case"point":return["containsPoint",r=Ua(e,t)];case"polygon":return r.vertices=e.vertices.map((function(e){return Ua(e,t)})),["intersectsPolygon",r];case"geopolygon":return r.vertices=e.vertices.map((function(e){return e.map((function(e){return Ua(e,t)}))})),["intersectsGeoPolygon",r];default:return[]}}function pp(e,t){var n=Y(fp(t,e.dpi),2),r=n[0],i=n[1],o=[];return r&&(cp([e],r,o,i),function(e,t){for(var n=0,r=t.length;n<r;n++)t[n].input=e}(t,o)),o}function hp(e,t){var n=Y(fp(t,e.dpi),2);return dp([e],n[0],n[1])}var mp=function(e){L(n,e);var t=W(n);function n(e){var r;return P(this,n),(r=t.call(this,e))._stage=null,r._collider={type:null,definition:null,fn:null},r._attrs={},r._node=null,r}return I(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;var t=e.data,n=e.desc,r=e.tag,i=e.strokeReference,o=e.fillReference;za(this.attrs,e),void 0!==t&&(this.data=t),"object"===R(n)&&(this.desc=D(!0,{},n)),"string"==typeof r&&(this.tag=r),"string"==typeof i&&(this.strokeReference=i),"string"==typeof o&&(this.fillReference=o)}},{key:"findShapes",value:function(e){return np.find(e,this).map((function(e){return op(e)}))}},{key:"getItemsFrom",value:function(e){return pp(this,e)}},{key:"containsPoint",value:function(e){return hp(this,e)}},{key:"intersectsLine",value:function(e){return hp(this,e)}},{key:"intersectsRect",value:function(e){return hp(this,e)}},{key:"intersectsCircle",value:function(e){return hp(this,e)}},{key:"intersectsPolygon",value:function(e){return hp(this,e)}},{key:"intersectsGeoPolygon",value:function(e){return hp(this,e)}},{key:"resolveLocalTransform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Yf;void 0!==this.attrs.transform&&Qf(this.attrs.transform,e),this.modelViewMatrix=e.clone()}},{key:"resolveGlobalTransform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Yf,t=this.ancestors;if(t.length>0)for(var n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}},{key:"attr",value:function(e){return this.attrs[e]}},{key:"equals",value:function(e){var t=this.attrs,r=Object.keys(t),i=e.attrs,o=Object.keys(i);if(r.length!==o.length)return!1;for(var a=0;a<r.length;a++){var s=r[a];if(!Object.hasOwnProperty.call(i,s))return!1;if(t[s]!==i[s])return!1}return $(z(n.prototype),"equals",this).call(this,e)}},{key:"toJSON",value:function(){var e=$(z(n.prototype),"toJSON",this).call(this);return e.attrs=this.attrs,e}},{key:"attrs",get:function(){return this._attrs}},{key:"stage",get:function(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}},{key:"modelViewMatrix",get:function(){return this._mvm},set:function(e){this._mvm=e,this._imvm=null}},{key:"inverseModelViewMatrix",get:function(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}},{key:"node",get:function(){return this._node},set:function(e){this._node=e}},{key:"collider",get:function(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H($f,t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=Uf("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=Uf(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn},set:function(e){var t=Array.isArray(e)?"collection":e&&e.type;return"string"!=typeof t?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===t&&null!==this._collider.fn?(this._collider.fn.set(e),void(this._collider.definition=e)):(this._collider.type=t,void(this._collider.definition=e))}},{key:"colliderType",get:function(){return this._collider.type}}]),n}(Nf),gp=function(e){L(n,e);var t=W(n);function n(){return P(this,n),t.apply(this,arguments)}return I(n,[{key:"addChild",value:function(e){if(!(e&&e instanceof Nf))throw new TypeError("Expecting a Node as argument, but got ".concat(e));if(e===this)throw new Error("Can not add itself as child!");if(e._children&&e._children.length&&this.ancestors.indexOf(e)>=0)throw new Error("Can not add an ancestor as child!");return e._parent&&e._parent!==this&&e._parent.removeChild(e),this._children.push(e),e._parent=this,e._ancestors=null,this}},{key:"addChildren",value:function(e){var t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}},{key:"removeChild",value:function(e){var t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}},{key:"removeChildren",value:function(e){var t,n;if(!this._children)return this;if(e)for(n=e.length,t=0;t<n;t++)this.removeChild(e[t]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}]),n}(Nf),vp=gp.prototype,yp=function(e){L(n,e);var t=W(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};P(this,n);var i=r.type,o=void 0===i?"container":i;return(e=t.call(this,o)).set(r),e}return I(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$(z(n.prototype),"set",this).call(this,e);var t=e.collider,r=D({type:null},t);this.collider=r,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}},{key:"appendChildRect",value:function(e,t){if(void 0!==e.bounds){var n=this.__boundingRect[t]||{},r=Y(e.bounds(t),3),i=r[0],o=r[2],a=i.x,s=i.y,l=o.x,u=o.y,c=isNaN(n.width)?l:Math.max(l,n.width+n.x),d=isNaN(n.height)?u:Math.max(u,n.height+n.y);n.x=isNaN(n.x)?a:Math.min(a,n.x),n.y=isNaN(n.y)?s:Math.min(s,n.y),n.width=c-n.x,n.height=d-n.y,this.__boundingRect[t]=n}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];for(var t=this.children.length,n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=D({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}},{key:"addChild",value:function(e){var t=vp.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);var n=D({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=n}return t}},{key:"addChildren",value:function(e){var t=vp.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(var r=0;r<n;r++)this.appendChildRect(e[r],!0);var i=D({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=i}return t}},{key:"removeChild",value:function(e){e._stage=null;var t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;if(vp.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};var i=D(this.boundingRect(!0),{type:"bounds"});this.collider=i}return this}},{key:"removeChildren",value:function(e){if(vp.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};var t=D(this.boundingRect(!0),{type:"bounds"});this.collider=t}return this}}]),n}(mp);function bp(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(yp,t)}var xp=function(e){L(n,e);var t=W(n);function n(e){var r;return P(this,n),(r=t.call(this,"stage"))._stage=B(r),r._dpiRatio=e||1,r}return I(n,[{key:"dpi",get:function(){return this._dpiRatio}}]),n}(yp);var wp=gp.prototype,kp=["x1","x2","y1","y2","id","offset","style"],Cp=function(e){L(n,e);var t=W(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};P(this,n);var i=r.type,o=void 0===i?"container":i;return(e=t.call(this,o)).set(r),e._boundingRect={},e}return I(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$(z(n.prototype),"set",this).call(this,e);for(var t=this.attrs,r="",i=0,o=kp.length;i!==o;i++)void 0!==e[r=kp[i]]&&(t[r]=e[r])}},{key:"addChild",value:function(e){return wp.addChild.call(this,e)}},{key:"addChildren",value:function(e){return wp.addChildren.call(this,e)}},{key:"removeChild",value:function(e){e._stage=null;var t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return wp.removeChild.call(this,e),this}},{key:"removeChildren",value:function(e){return wp.removeChildren.call(this,e),this}}]),n}(mp);function Sp(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Cp,t)}var Ep=gp.prototype,Mp=["patternUnits","x","y","width","height","id"],Tp=function(e){L(n,e);var t=W(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};P(this,n);var i=r.type,o=void 0===i?"container":i;return(e=t.call(this,o)).set(r),e._boundingRect={},e}return I(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$(z(n.prototype),"set",this).call(this,e);for(var t=this.attrs,r="",i=0,o=Mp.length;i!==o;i++)void 0!==e[r=Mp[i]]&&(t[r]=e[r])}},{key:"addChild",value:function(e){return Ep.addChild.call(this,e)}},{key:"addChildren",value:function(e){return Ep.addChildren.call(this,e)}},{key:"removeChild",value:function(e){e._stage=null;var t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return Ep.removeChild.call(this,e),this}},{key:"removeChildren",value:function(e){return Ep.removeChildren.call(this,e),this}}]),n}(mp);var Dp=function(e){L(n,e);var t=W(n);function n(){var e,r;return P(this,n),(e=r=t.call(this,"rect")).set.apply(e,arguments),r}return I(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,r=void 0===t?0:t,i=e.y,o=void 0===i?0:i,a=e.width,s=void 0===a?0:a,l=e.height,u=void 0===l?0:l,c=e.rx,d=void 0===c?0:c,f=e.ry,p=void 0===f?0:f,h=e.collider,m=D({type:"rect",x:r,y:o,width:s,height:u},h);$(z(n.prototype),"set",this).call(this,e),s>=0?(this.attrs.x=r,this.attrs.width=s):(this.attrs.x=r+s,this.attrs.width=-s),u>=0?(this.attrs.y=o,this.attrs.height=u):(this.attrs.y=o+u,this.attrs.height=-u),d>0&&(this.attrs.rx=d),p>0&&(this.attrs.ry=p),this.collider=m,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];var t=ne(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,r=ee(n),i=Y(r,4),o=i[0],a=i[1],s=i[2],l=i[3];return this.__boundingRect[e]={x:o,y:a,width:s-o,height:l-a},this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}]),n}(mp);var _p=function(e){L(n,e);var t=W(n);function n(){var e,r;return P(this,n),(e=r=t.call(this,"circle")).set.apply(e,arguments),r}return I(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cx,r=void 0===t?0:t,i=e.cy,o=void 0===i?0:i,a=e.r,s=void 0===a?0:a,l=e.collider,u=D({type:"circle",cx:r,cy:o,r:s},l);$(z(n.prototype),"set",this).call(this,e),this.attrs.cx=r,this.attrs.cy=o,this.attrs.r=s,this.collider=u,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];var t=this.bounds(e);return this.__boundingRect[e]={x:t[0].x,y:t[0].y,width:t[2].x-t[0].x,height:t[2].y-t[0].y},this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.attrs,n=t.cx,r=t.cy,i=t.r,o=t.r,a=n-i,s=r-o,l=2*i,u=2*o,c=[{x:a,y:s},{x:a+l,y:s},{x:a+l,y:s+u},{x:a,y:s+u}];if(e&&this.modelViewMatrix){var d=ee(c=this.modelViewMatrix.transformPoints(c)),f=Y(d,4),p=f[0],h=f[1],m=f[2],g=f[3];l=m-p,u=g-h,this.__bounds[e]=[{x:p,y:h},{x:p+l,y:h},{x:p+l,y:h+u},{x:p,y:h+u}]}else this.__bounds[e]=c;return this.__bounds[e]}}]),n}(mp);var Np=function(e){L(n,e);var t=W(n);function n(){var e,r;return P(this,n),(e=r=t.call(this,"line")).set.apply(e,arguments),r}return I(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x1,r=void 0===t?0:t,i=e.y1,o=void 0===i?0:i,a=e.x2,s=void 0===a?0:a,l=e.y2,u=void 0===l?0:l,c=e.collider;$(z(n.prototype),"set",this).call(this,e),this.attrs.x1=r,this.attrs.y1=o,this.attrs.x2=s,this.attrs.y2=u;var d={type:"line",x1:r,y1:o,x2:s,y2:u};this.collider=D(d,c),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];var t=te(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));var n=ee(t),r=Y(n,4),i=r[0],o=r[1],a=r[2],s=r[3],l=i!==a||o!==s;return this.__boundingRect[e]={x:i,y:o,width:l?Math.max(1,a-i):0,height:l?Math.max(1,s-o):0},this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}]),n}(mp);var qp=Math.PI/2;function Rp(e,t){var n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function Pp(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}function Ap(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=[],i=[];if("h"===n.forceOrientation){var o=e[0].x<e[1].x?-1:1,a=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+o,y:e[0].y}),e.push({x:e[e.length-1].x+a,y:e[e.length-1].y})}else if("v"===n.forceOrientation){var s=e[0].y<e[1].y?-1:1,l=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+s}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+l})}for(var u=e.length-1,c=1;c<u;c++){var d=e[c-1],f=e[c],p=e[c+1],h=Rp(f,d),m=Rp(f,p),g=(h+m)/2,v=g+Math.PI,y=Math.max(g,v),b=Math.min(g,v),x=h>m;if(1===c){var w=Rp(d,f);r.push(Pp(d,w-qp,t)),i.unshift(Pp(d,w+qp,t))}var k=x?y:b,C=x?b:y;if(r.push(Pp(f,k,t)),i.unshift(Pp(f,C,t)),c===u-1){var S=Rp(p,f);r.push(Pp(p,S+qp,t)),i.unshift(Pp(p,S-qp,t))}}return{type:"polygon",vertices:[].concat(r,i)}}function Ip(e){for(var t,n=[],r=e.length,i=0;i<r;i++){t=e[i];for(var o=0;o<t.length;o++)n.push(t[o])}return n}function Op(e){if(e.length<2)return!1;var t=e[0],n=e[e.length-1];return Math.abs(t.x-n.x)<1e-12&&Math.abs(t.y-n.y)<1e-12}var Lp=function(e){L(n,e);var t=W(n);function n(){var e,r;return P(this,n),(e=r=t.call(this,"path")).set.apply(e,arguments),r}return I(n,[{key:"set",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if($(z(n.prototype),"set",this).call(this,t),this.segments=[],this.points=[],t.arcDatum){var r=Ie();r.innerRadius(t.desc.slice.innerRadius),r.outerRadius(t.desc.slice.outerRadius),r.cornerRadius(t.desc.slice.cornerRadius);var i=r(t.arcDatum);this.attrs.d=i}else t.d&&(this.attrs.d=t.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(t.collider)||"object"===R(t.collider)&&void 0!==t.collider.type)this.collider=t.collider;else if(t.arcDatum||t.d){if(this.segments=Tf(this.attrs.d),this.segments.length>1&&this.segments.every((function(e){return Op(e)})))return void(this.collider=D({type:"geopolygon",vertices:this.segments},t.collider));this.segments.forEach((function(n){if(n.length<=1);else if(Op(n))e.collider=D({type:"polygon",vertices:n},t.collider);else if("object"===R(t.collider)&&t.collider.visual){var r=e.attrs["stroke-width"]/2;e.collider=Ap(n,r,t.collider)}else e.collider=D({type:"polyline",points:n},t.collider)}))}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];this.points.length||(this.segments=this.segments.length?this.segments:Tf(this.attrs.d),this.points=Ip(this.segments));var t=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points,n=ee(t),r=Y(n,4),i=r[0],o=r[1],a=r[2],s=r[3];return this.__boundingRect[e]={x:i||0,y:o||0,width:a-i||0,height:s-o||0},this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}]),n}(mp);function zp(e){var t=e.data,n=e._boundingRect,r=e._textBoundsFn;return null!=t&&(n||r)}var Fp=function(e){L(n,e);var t=W(n);function n(){var e,r;return P(this,n),(e=r=t.call(this,"text")).set.apply(e,arguments),r}return I(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,r=void 0===t?0:t,i=e.y,o=void 0===i?0:i,a=e.dx,s=void 0===a?0:a,l=e.dy,u=void 0===l?0:l,c=e.textBoundsFn,d=e.text,f=e.title,p=e.collider,h=e.boundingRect,m=e.ellipsed;$(z(n.prototype),"set",this).call(this,e),this.attrs.x=r,this.attrs.y=o,this.attrs.dx=s,this.attrs.dy=u,this.attrs.text=d,void 0!==f&&(this.attrs.title=String(f)),"object"===R(h)?this._textBoundsFn=function(){return h}:"function"==typeof c&&(this._textBoundsFn=c),"string"==typeof m&&(this.ellipsed=m),this.collider=D({type:zp(this)?"bounds":null},p),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};var t=ne(this._textBoundsFn(this.attrs)),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,r=ee(n),i=Y(r,4),o=i[0],a=i[1],s=i[2],l=i[3];return this.__boundingRect[e]={x:o,y:a,width:s-o,height:l-a},this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}]),n}(mp);var jp=ft();function Hp(e,t){return jp.get(e)(t)}jp.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Dp,t)})),jp.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(_p,t)})),jp.add("text",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Fp,t)})),jp.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Np,t)})),jp.add("path",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Lp,t)})),jp.add("stage",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(xp,t)})),jp.add("container",bp),jp.add("defs",bp),jp.add("linearGradient",Sp),jp.add("radialGradient",Sp),jp.add("stop",Sp),jp.add("pattern",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Tp,t)}));var Bp=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[{}];function n(){return t[t.length-1]}return n.save=function(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n(),o={},a="",s=0;s<e.length;s++)void 0!==i[a=e[s]]&&(o[a]=i[a]);return D(o,r),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function Vp(e,t){if(Array.isArray(t))for(var n=0,r=t.length;n<r;n++)t[n](e)}function Wp(e,t,n){e.node=n[t],e.index=t}function Up(e,t,n,r){for(var i={siblings:e,node:null,index:0},o=0,a=e.length;o<a;o++)if(Wp(i,o,e),Vp(i,r.create),!("function"==typeof i.node.disabled?i.node.disabled():i.node.disabled)){i.node=Bp.save(i.node);var s=Hp(i.node.type,i.node);s&&(i.node.transform&&(n.save(),Qf(i.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),t.addChild(s),i.node.children&&Up(i.node.children,s,n,r),i.node.transform&&n.restore()),Bp.restore()}}function $p(e){var t=e.items,n=e.stage,r=e.dpi,i=e.on,o=void 0===i?{}:i;return n||(n=Hp("stage",r)),Up(t,n,new Yf,o),n}function Yp(e,t,n){var r=n.orientation,i=n.degree,o=n.stops,a=void 0===o?[]:o,s=null;if("radial"===r){var l=t.boundingRect();s=e.createRadialGradient(l.x+l.width/2,l.y+l.height/2,1e-5,l.x+l.width/2,l.y+l.height/2,Math.max(l.width,l.height)/2)}else{var u=Ba(i);["x1","x2","y1","y2"].forEach((function(e){e in n&&(u[e]=n[e])}));var c=t.boundingRect();s=e.createLinearGradient(c.x+u.x1*c.width,c.y+u.y1*c.height,c.x+u.x2*c.width,c.y+u.y2*c.height)}for(var d=0,f=a.length;d<f;d++){var p=a[d];s.addColorStop(p.offset,p.color)}return s}function Xp(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach((function(e){switch(e.type){case"rect":n.rect(e.x,e.y,e.width,e.height)}})),n.fill(),n.restore(),n.createPattern(t,"repeat")}function Kp(e){var t=e.createElement("canvas"),n=t.getContext("2d"),r={};return{create:function(e){var i=e.key;return i?(r[i]=r[i]||Xp(e,t,n),r[i]):Xp(e,t,n)},clear:function(){r={}}}}function Gp(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=e.y,r=e.width,i=e.height,o=e.scaleRatio,a=e.margin,s=e.edgeBleed,l={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0},edgeBleed:{left:0,right:0,top:0,bottom:0,bool:!1}};return l.x=isNaN(t)?l.x:t,l.y=isNaN(n)?l.y:n,l.width=isNaN(r)?l.width:r,l.height=isNaN(i)?l.height:i,void 0!==o&&(l.scaleRatio.x=isNaN(o.x)?l.scaleRatio.x:o.x,l.scaleRatio.y=isNaN(o.y)?l.scaleRatio.y:o.y),void 0!==a&&(l.margin.left=isNaN(a.left)?0:a.left,l.margin.top=isNaN(a.top)?0:a.top),"object"===R(s)&&["left","right","top","bottom"].forEach((function(e){!isNaN(s[e])&&s[e]>0&&(l.edgeBleed[e]=s[e],l.edgeBleed.bool=!0)})),l.computedPhysical={x:Math.round(l.margin.left+(l.x-l.edgeBleed.left)*l.scaleRatio.x),y:Math.round(l.margin.top+(l.y-l.edgeBleed.top)*l.scaleRatio.y),width:Math.round((l.width+l.edgeBleed.left+l.edgeBleed.right)*l.scaleRatio.x),height:Math.round((l.height+l.edgeBleed.top+l.edgeBleed.bottom)*l.scaleRatio.y)},l}function Jp(){var e={element:function(){},root:function(){},settings:function(){},appendTo:function(){},getScene:function(){return[]},render:function(){return!1},itemsAt:function(){return[]},findShapes:function(){return[]},clear:function(){},destory:function(){},size:function(){},measureText:bd,textBounds:wd,setKey:function(t){e.element().setAttribute("data-key",t)}};return e}function Zp(e){return function(t){var n=t.node;"text"===n.type&&function(e){return null!=e}(n.data)&&!n.textBoundsFn&&(n.textBoundsFn=e.textBounds)}}var Qp=200,eh=200,th=function(){function e(t){P(this,e),this.targetCanvas=t,this.bufferCanvas=t.cloneNode()}return I(e,[{key:"updateSize",value:function(e){var t,n=e.rect,r=e.dpiRatio,i=e.canvasBufferSize;t=i?"function"==typeof i?i(n):i:{width:n.computedPhysical.width+2*Qp,height:n.computedPhysical.height+2*eh},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*r),this.bufferCanvas.height=Math.round(t.height*r)}},{key:"apply",value:function(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}},{key:"clear",value:function(){this.bufferCanvas.width=this.bufferCanvas.width}},{key:"getContext",value:function(){return this.bufferCanvas.getContext("2d")}}]),e}(),nh=ft();function rh(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function ih(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function oh(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function ah(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=Object.keys(r),o=0,a=n.length;o<a;o++){var s=n[o],l=s[0],u=s[1],c=s[2];if(l in t.attrs&&!(u in r)&&e[u]!==t.attrs[l]){var d=c?c(t.attrs[l]):t.attrs[l];"function"==typeof e[u]?e[u](d):e[u]=d}}for(var f=0,p=i.length;f<p;f++){var h=i[f];e[h]=r[h]}}function sh(e,t,n,r){for(var i=0,o=e.length;i<o;i++){var a=e[i],s={};t.save(),a.attrs&&(a.attrs.fill||a.attrs.stroke)&&(a.attrs.fill&&"object"===R(a.attrs.fill)&&"gradient"===a.attrs.fill.type?s.fillStyle=Yp(t,a,a.attrs.fill):a.attrs.fill&&"object"===R(a.attrs.fill)&&"pattern"===a.attrs.fill.type&&(s.fillStyle=r.patterns.create(a.attrs.fill)),a.attrs.stroke&&"object"===R(a.attrs.stroke)&&"gradient"===a.attrs.stroke.type?s.strokeStyle=Yp(t,a,a.attrs.stroke):a.attrs.stroke&&"object"===R(a.attrs.stroke)&&"pattern"===a.attrs.stroke.type&&(s.strokeStyle=r.patterns.create(a.attrs.stroke))),ah(t,a,n,s),a.modelViewMatrix&&oh(a.modelViewMatrix.elements,t),nh.has(a.type)&&nh.get(a.type)(a.attrs,{g:t,doFill:"fill"in a.attrs&&"none"!==a.attrs.fill,doStroke:"stroke"in a.attrs&&0!==a.attrs["stroke-width"],ellipsed:a.ellipsed}),a.children&&sh(a.children,t,n,r),t.restore()}}function lh(e){var t=e.el,n=e.dpiRatio,r=e.transform;if("object"===R(r)){var i=[r.horizontalScaling,r.horizontalSkewing,r.verticalSkewing,r.verticalScaling,r.horizontalMoving*n,r.verticalMoving*n],o=t.getContext("2d");o.setTransform.apply(o,i)}}function uh(){var e,t,n,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$p,o={transform:void 0,canvasBufferSize:void 0,progressive:void 0},a=!1,s=Gp(),l=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",rh]],u=Jp();return u.element=function(){return e},u.root=function(){return e},u.settings=function(e){return e&&Object.keys(o).forEach((function(t){void 0!==e[t]&&(o[t]=e[t])})),o},u.appendTo=function(n){return e||((e=n.ownerDocument.createElement("canvas")).style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof o.transform||t||(t=new th(e)),n.appendChild(e),e},u.getScene=function(n){var r=ih(t&&t.getContext()||e.getContext("2d")),o=s.scaleRatio.x,a=s.scaleRatio.y,l={type:"container",children:n,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*r*o,", ").concat(s.edgeBleed.top*r*a,")"):""};return 1===r&&1===o&&1===a||(l.transform+="scale(".concat(r*o,", ").concat(r*a,")")),i({items:[l],dpi:r,on:{create:[cd(u.measureText),Zp(u)]}})},u.render=function(i){if(!e)return!1;r||(r=Kp(e.ownerDocument));var c=t&&t.getContext()||e.getContext("2d"),d=ih(c),f=t&&o.transform();if(f)return e.width=e.width,lh({el:e,dpiRatio:d,transform:f}),t.apply(),!0;a&&(e.style.left="".concat(s.computedPhysical.x,"px"),e.style.top="".concat(s.computedPhysical.y,"px"),e.style.width="".concat(s.computedPhysical.width,"px"),e.style.height="".concat(s.computedPhysical.height,"px"),e.width=Math.round(s.computedPhysical.width*d),e.height=Math.round(s.computedPhysical.height*d),t&&t.updateSize({rect:s,dpiRatio:d,canvasBufferSize:o.canvasBufferSize}));var p=u.getScene(i),h=!n||!p.equals(n);r.clear();var m,g=a||h,v="function"==typeof o.progressive&&o.progressive();(g&&(v&&!v.isFirst||u.clear(),sh(p.children,c,l,{patterns:r})),t&&(e.width=e.width,t.apply()),a=!1,v&&!v.isFirst)&&(m=p.children).unshift.apply(m,X(n.children));return n=p,g},u.itemsAt=function(e){return n?n.getItemsFrom(e):[]},u.findShapes=function(e){return n?n.findShapes(e):[]},u.clear=function(){return e&&(e.width=e.width),t&&t.clear(),n=null,u},u.size=function(e){if(e){var t=Gp(e);JSON.stringify(s)!==JSON.stringify(t)&&(a=!0,s=t)}return s},u.destroy=function(){e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),n=null},u}function ch(e,t){nh.add(e,t)}function dh(e,t){return Math.max(0,Math.min(e,t))}var fh=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),ph=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),hh=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function mh(e){return fh.test(e)}function gh(e){return ph.test(e)||hh.test(e)}function vh(e){var t,n,r=e?e.length:0;for(t=0;t<r;t++){if(mh(n=e[t]))return"ltr";if(gh(n))return"rtl"}return"ltr"}var yh={start:"end",end:"start",center:"center",middle:"middle"};function bh(e,t){return"rtl"===t?yh[e]:e}function xh(e,t){var n,r,i,o=[],a=[],s=[],l=[],u=function(e){return e.id},c=function(e,t){var n;return n="object"===R(e)?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(c)),t=t.map(c),r=e.map(u),i=t.map(u);for(var d=0,f=t.length;d<f;d++){-1===r.indexOf(t[d].id)?o.push(t[d]):s.push(t[d])}for(var p=0,h=e.length;p<h;p++){-1===i.indexOf(e[p].id)?a.push(e[p]):l.push(e[p])}for(var m=0,g=o.length;m<g;m++)o[m].content.children&&(o[m].diff=xh([],o[m].content.children),o[m].children=o[m].diff.updatedNew.concat(o[m].diff.added),o[m].children.isTree=!0);for(var v=0,y=s.length;v<y;v++)s[v].diff=xh(l[v].children||[],s[v].content.children||[]),s[v].object=l[v].object,s[v].children=s[v].diff.items;return n=s.concat(o),o.isTree=!0,a.isTree=!0,s.isTree=!0,l.isTree=!0,n.isTree=!0,{added:o,updatedNew:s,updatedOld:l,removed:a,items:n}}function wh(e,t,n){for(var r=0,i=e.length;r<i;r++)e[r].object=n(e[r].content.type,t)}function kh(e,t){for(var n=0,r=e.length;n<r;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function Ch(e,t,n,r){for(var i,o=0,a=e.length;o<a;o++)null!==(i=e[o]).object&&void 0!==i.object&&(n(i.object,i.content),i.diff&&(wh(i.diff.added,i.object,t),kh(i.diff.removed,r),Ch(i.diff.items,t,n,r)))}function Sh(e,t,n,r,i,o){var a=xh(e,t);return wh(a.added,n,r),kh(a.removed,o),Ch(a.items,r,i,o),a.items}ch("rect",(function(e,t){var n=t.g,r=t.doFill,i=t.doStroke;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,r,i,o,a){o=dh(r/2,o>0?o:a),a=dh(i/2,a>0?a:o),e.moveTo(t,n+a),e.lineTo(t,n+i-a),e.quadraticCurveTo(t,n+i,t+o,n+i),e.lineTo(t+r-o,n+i),e.quadraticCurveTo(t+r,n+i,t+r,n+i-a),e.lineTo(t+r,n+a),e.quadraticCurveTo(t+r,n,t+r-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+a)}(n,e.x,e.y,e.width,e.height,e.rx,e.ry):n.rect(e.x,e.y,e.width,e.height),r&&n.fill(),i&&n.stroke()})),ch("circle",(function(e,t){var n=t.g,r=t.doFill,i=t.doStroke;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),r&&n.fill(),i&&n.stroke()})),ch("line",(function(e,t){var n=t.g,r=t.doStroke;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),r&&n.stroke()})),ch("path",(function(e,t){var n=t.g,r=t.doStroke,i=t.doFill,o=new Path2D(e.d);i&&n.fill(o),r&&n.stroke(o)})),ch("text",(function(e,t){var n=t.g,r=t.ellipsed,i=t.doStroke,o=r||dd(e,bd);e["font-weight"]?n.font="".concat(e["font-weight"]," ").concat(e["font-size"]," ").concat(e["font-family"]):n.font="".concat(e["font-size"]," ").concat(e["font-family"]);var a=vh(e.text);n.canvas.dir!==a&&(n.canvas.dir=a);var s=bh("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);var l=fd(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),i&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)}));var Eh="http://www.w3.org/2000/svg",Mh=function(e,t){if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));var n=t.ownerDocument.createElementNS(Eh,"container"===e?"g":e);return t.appendChild(n),n},Th=function(e){e.parentNode&&e.parentNode.removeChild(e)},Dh=function(e,t){if(function(e){switch(e.type){case"circle":return!isNaN(e.attrs.cx)&&!isNaN(e.attrs.cy)&&!isNaN(e.attrs.r);case"line":return!(isNaN(e.attrs.x1)||isNaN(e.attrs.y1)||isNaN(e.attrs.x2)||isNaN(e.attrs.y2));case"rect":return!(isNaN(e.attrs.x)||isNaN(e.attrs.y)||isNaN(e.attrs.width)||isNaN(e.attrs.height));case"text":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}}(t)){for(var n in t.attrs)if("stroke"===n&&t.strokeReference)e.setAttribute("stroke",t.strokeReference);else if("fill"===n&&t.fillReference)e.setAttribute("fill",t.fillReference);else if("text"===n){e.setAttribute("style","white-space: pre"),e.textContent=t.ellipsed||dd(t.attrs,bd);var r=vh(t.attrs.text);"rtl"===r&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",bh(e.getAttribute("text-anchor"),r)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){var i=e.ownerDocument.createElementNS(Eh,"title");i.textContent=t.attrs.title,e.appendChild(i)}else e.setAttribute(n,t.attrs[n]);else{var o=+e.getAttribute(n)||0,a=0;a="dominant-baseline"===n?fd(t.attrs):t.attrs[n],e.setAttribute("dy",a+o)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"===R(t.data)&&null!==t.data)for(var s in t.data)"string"!=typeof t.data[s]&&"number"!=typeof t.data[s]&&"boolean"!=typeof t.data[s]||e.setAttribute("data-".concat(s),t.data[s])}},_h=function(){function e(t,n,r,i){P(this,e),this.create=t,this.nodeCreator=n,this.nodeMaintainer=r,this.nodeDestroyer=i}return I(e,[{key:"render",value:function(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}]),e}();function Nh(){return new _h(Sh,Mh,Dh,Th)}function qh(e){var t,n,r=0;if(0===(e=JSON.stringify(e)).length)return r;for(t=0,n=e.length;t<n;t++)r=(r<<5)-r+e.charCodeAt(t),r&=r;return r}function Rh(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qh,n={},r=Date.now(),i={getOrCreateGradient:function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=t(i[o]),l="picasso-gradient-".concat(r,"-").concat(s);if(!n[s]){var u=i[o],c=u.orientation,d=u.degree,f=u.stops,p=void 0===f?[]:f,h={};void 0===d&&(d=90),"radial"===c?h.type="radialGradient":(h=Ba(d),["x1","x2","y1","y2"].forEach((function(e){e in i[o]&&(h[e]=i[o][e])})),h.type="linearGradient"),h.id=l,h.children=p.map((function(e){var t=e.offset,n=e.color,r=e.opacity;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==r?r:1)}})),e.push(h),n[s]=l}return"url('".concat(a,"#").concat(l,"')")},onCreate:function(e){var t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);var n=e.node;n.fill&&"object"===R(n.fill)&&"gradient"===n.fill.type&&(n.fillReference=i.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"===R(n.stroke)&&"gradient"===n.stroke.type&&(n.strokeReference=i.getOrCreateGradient(n,"stroke",t))},clear:function(){n={}}};return i}function Ph(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qh,n={},r=Date.now(),i={onCreate:function(i){var o={};i.node&&"object"===R(i.node.fill)&&"pattern"===i.node.fill.type&&i.node.fill.shapes&&(o.fill=i.node.fill),i.node&&"object"===R(i.node.stroke)&&"pattern"===i.node.stroke.type&&i.node.stroke.shapes&&(o.stroke=i.node.stroke),Object.keys(o).forEach((function(a){var s="",l=o[a],u=t(l),c="picasso-pattern-".concat(r,"-").concat(u);if("undefined"!=typeof window&&(s=window.location.href.split("#")[0]),!n[u]){var d={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:c,children:[],fill:l.fill};l.shapes.forEach((function(e){d.children.push(e)})),e.push(d),n[u]=!0}i.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(c,"')")}))},clear:function(){n={}}};return i}function Ah(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Nh,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Eh,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:$p,a=r(),s=!1,l=Gp(),u={transform:void 0},c=Jp(),d={type:"defs",children:[]},f=Ph(d.children),p=Rh(d.children);return c.element=function(){return e},c.root=function(){return t},c.settings=function(e){return e&&Object.keys(u).forEach((function(t){void 0!==e[t]&&(u[t]=e[t])})),u},c.appendTo=function(n){return e||((e=n.ownerDocument.createElementNS(i,"svg")).style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none",e.setAttribute("xmlns",i),(t=n.ownerDocument.createElementNS(i,"g")).style.pointerEvents="auto",e.appendChild(t)),n.appendChild(e),e},c.getScene=function(e){var t=l.scaleRatio.x,n=l.scaleRatio.y,r={type:"container",children:Array.isArray(e)?[].concat(X(e),[d]):e,transform:l.edgeBleed.bool?"translate(".concat(l.edgeBleed.left*t,", ").concat(l.edgeBleed.top*n,")"):""};return 1===t&&1===n||(r.transform+="scale(".concat(t,", ").concat(n,")")),o({items:[r],on:{create:[function(e){e.node.fillReference=void 0,e.node.strokeReference=void 0},p.onCreate,f.onCreate,cd(c.measureText),Zp(c)]}})},c.render=function(r){if(!e)return!1;var i="function"==typeof u.transform&&u.transform();if(i){var o=i.a,h=i.b,m=i.c,g=i.d,v=i.e,y=i.f;return t.style.transform="matrix(".concat(o,", ").concat(h,", ").concat(m,", ").concat(g,", ").concat(v,", ").concat(y,")"),!0}t.style.transform="",s&&(e.style.left="".concat(l.computedPhysical.x,"px"),e.style.top="".concat(l.computedPhysical.y,"px"),e.setAttribute("width",l.computedPhysical.width),e.setAttribute("height",l.computedPhysical.height)),p.clear(),f.clear(),d.children.length=0;var b=c.getScene(r),x=!n||!b.equals(n),w=s||x;return w&&(c.clear(),a.render(b.children,t)),s=!1,n=b,w},c.itemsAt=function(e){return n?n.getItemsFrom(e):[]},c.findShapes=function(e){return n?n.findShapes(e):[]},c.clear=function(){if(!t)return c;n=null;var r=t.cloneNode(!1);return e.replaceChild(r,t),t=r,c},c.destroy=function(){e&&e.parentNode&&e.parentNode.removeChild(e),e=null,t=null},c.size=function(e){if(e){var t=Gp(e);JSON.stringify(l)!==JSON.stringify(t)&&(s=!0,l=t)}return l},c}var Ih,Oh,Lh,zh,Fh,jh={},Hh=[],Bh=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Vh(e,t){for(var n in t)e[n]=t[n];return e}function Wh(e){var t=e.parentNode;t&&t.removeChild(e)}function Uh(e,t,n){var r,i,o,a={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Ih.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return $h(e,a,r,i,null)}function $h(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++Lh:i};return null==i&&null!=Oh.vnode&&Oh.vnode(o),o}function Yh(e){return e.children}function Xh(e,t){this.props=e,this.context=t}function Kh(e,t){if(null==t)return e.__?Kh(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Kh(e):null}function Gh(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Gh(e)}}function Jh(e){(!e.__d&&(e.__d=!0)&&zh.push(e)&&!Zh.__r++||Fh!==Oh.debounceRendering)&&((Fh=Oh.debounceRendering)||setTimeout)(Zh)}function Zh(){for(var e;Zh.__r=zh.length;)e=zh.sort((function(e,t){return e.__v.__b-t.__v.__b})),zh=[],e.some((function(e){var t,n,r,i,o,a;e.__d&&(o=(i=(t=e).__v).__e,(a=t.__P)&&(n=[],(r=Vh({},i)).__v=i.__v+1,am(a,i,r,t.__n,void 0!==a.ownerSVGElement,null!=i.__h?[o]:null,n,null==o?Kh(i):o,i.__h),sm(n,i),i.__e!=o&&Gh(i)))}))}function Qh(e,t,n,r,i,o,a,s,l,u){var c,d,f,p,h,m,g,v=r&&r.__k||Hh,y=v.length;for(n.__k=[],c=0;c<t.length;c++)if(null!=(p=n.__k[c]=null==(p=t[c])||"boolean"==typeof p?null:"string"==typeof p||"number"==typeof p||"bigint"==typeof p?$h(null,p,null,null,p):Array.isArray(p)?$h(Yh,{children:p},null,null,null):p.__b>0?$h(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)){if(p.__=n,p.__b=n.__b+1,null===(f=v[c])||f&&p.key==f.key&&p.type===f.type)v[c]=void 0;else for(d=0;d<y;d++){if((f=v[d])&&p.key==f.key&&p.type===f.type){v[d]=void 0;break}f=null}am(e,p,f=f||jh,i,o,a,s,l,u),h=p.__e,(d=p.ref)&&f.ref!=d&&(g||(g=[]),f.ref&&g.push(f.ref,null,p),g.push(d,p.__c||h,p)),null!=h?(null==m&&(m=h),"function"==typeof p.type&&p.__k===f.__k?p.__d=l=em(p,l,e):l=tm(e,p,f,v,h,l),"function"==typeof n.type&&(n.__d=l)):l&&f.__e==l&&l.parentNode!=e&&(l=Kh(f))}for(n.__e=m,c=y;c--;)null!=v[c]&&um(v[c],v[c]);if(g)for(c=0;c<g.length;c++)lm(g[c],g[++c],g[++c])}function em(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?em(r,t,n):tm(n,r,r,i,r.__e,t));return t}function tm(e,t,n,r,i,o){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<r.length;l+=2)if(s==i)break e;e.insertBefore(i,o),a=o}return void 0!==a?a:i.nextSibling}function nm(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||Bh.test(t)?n:n+"px"}function rm(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||nm(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||nm(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?om:im,o):e.removeEventListener(t,o?om:im,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&-1==t.indexOf("-")?e.removeAttribute(t):e.setAttribute(t,n))}}function im(e){this.l[e.type+!1](Oh.event?Oh.event(e):e)}function om(e){this.l[e.type+!0](Oh.event?Oh.event(e):e)}function am(e,t,n,r,i,o,a,s,l){var u,c,d,f,p,h,m,g,v,y,b,x,w,k,C,S=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,s=t.__e=n.__e,t.__h=null,o=[s]),(u=Oh.__b)&&u(t);try{e:if("function"==typeof S){if(g=t.props,v=(u=S.contextType)&&r[u.__c],y=u?v?v.props.value:u.__:r,n.__c?m=(c=t.__c=n.__c).__=c.__E:("prototype"in S&&S.prototype.render?t.__c=c=new S(g,y):(t.__c=c=new Xh(g,y),c.constructor=S,c.render=cm),v&&v.sub(c),c.props=g,c.state||(c.state={}),c.context=y,c.__n=r,d=c.__d=!0,c.__h=[],c._sb=[]),null==c.__s&&(c.__s=c.state),null!=S.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Vh({},c.__s)),Vh(c.__s,S.getDerivedStateFromProps(g,c.__s))),f=c.props,p=c.state,d)null==S.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(null==S.getDerivedStateFromProps&&g!==f&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(g,y),!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(g,c.__s,y)||t.__v===n.__v){for(c.props=g,c.state=c.__s,t.__v!==n.__v&&(c.__d=!1),c.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<c._sb.length;b++)c.__h.push(c._sb[b]);c._sb=[],c.__h.length&&a.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(g,c.__s,y),null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(f,p,h)}))}if(c.context=y,c.props=g,c.__v=t,c.__P=e,x=Oh.__r,w=0,"prototype"in S&&S.prototype.render){for(c.state=c.__s,c.__d=!1,x&&x(t),u=c.render(c.props,c.state,c.context),k=0;k<c._sb.length;k++)c.__h.push(c._sb[k]);c._sb=[]}else do{c.__d=!1,x&&x(t),u=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++w<25);c.state=c.__s,null!=c.getChildContext&&(r=Vh(Vh({},r),c.getChildContext())),d||null==c.getSnapshotBeforeUpdate||(h=c.getSnapshotBeforeUpdate(f,p)),C=null!=u&&u.type===Yh&&null==u.key?u.props.children:u,Qh(e,Array.isArray(C)?C:[C],t,n,r,i,o,a,s,l),c.base=t.__e,t.__h=null,c.__h.length&&a.push(c),m&&(c.__E=c.__=null),c.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,i,o,a,s){var l,u,c,d=n.props,f=t.props,p=t.type,h=0;if("svg"===p&&(i=!0),null!=o)for(;h<o.length;h++)if((l=o[h])&&"setAttribute"in l==!!p&&(p?l.localName===p:3===l.nodeType)){e=l,o[h]=null;break}if(null==e){if(null===p)return document.createTextNode(f);e=i?document.createElementNS("http://www.w3.org/2000/svg",p):document.createElement(p,f.is&&f),o=null,s=!1}if(null===p)d===f||s&&e.data===f||(e.data=f);else{if(o=o&&Ih.call(e.childNodes),u=(d=n.props||jh).dangerouslySetInnerHTML,c=f.dangerouslySetInnerHTML,!s){if(null!=o)for(d={},h=0;h<e.attributes.length;h++)d[e.attributes[h].name]=e.attributes[h].value;(c||u)&&(c&&(u&&c.__html==u.__html||c.__html===e.innerHTML)||(e.innerHTML=c&&c.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||rm(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||rm(e,o,t[o],n[o],r)}(e,f,d,i,s),c)t.__k=[];else if(h=t.props.children,Qh(e,Array.isArray(h)?h:[h],t,n,r,i&&"foreignObject"!==p,o,a,o?o[0]:n.__k&&Kh(n,0),s),null!=o)for(h=o.length;h--;)null!=o[h]&&Wh(o[h]);s||("value"in f&&void 0!==(h=f.value)&&(h!==e.value||"progress"===p&&!h||"option"===p&&h!==d.value)&&rm(e,"value",h,d.value,!1),"checked"in f&&void 0!==(h=f.checked)&&h!==e.checked&&rm(e,"checked",h,d.checked,!1))}return e}(n.__e,t,n,r,i,o,a,l);(u=Oh.diffed)&&u(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=s,t.__h=!!l,o[o.indexOf(s)]=null),Oh.__e(e,t,n)}}function sm(e,t){Oh.__c&&Oh.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Oh.__e(e,t.__v)}}))}function lm(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Oh.__e(e,n)}}function um(e,t,n){var r,i;if(Oh.unmount&&Oh.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||lm(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Oh.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&um(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||Wh(e.__e),e.__=e.__e=e.__d=void 0}function cm(e,t,n){return this.constructor(e,n)}function dm(e,t,n){var r,i,o;Oh.__&&Oh.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],am(t,e=(!r&&n||t).__k=Uh(Yh,null,[e]),i||jh,jh,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?Ih.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),sm(o,e)}function fm(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.createElement,i=void 0===r?document.createElement.bind(document):r,o=Gp(),a={transform:void 0},s=Jp();return s.element=function(){return e},s.root=function(){return e},s.settings=function(e){return e&&Object.keys(a).forEach((function(t){void 0!==e[t]&&(a[t]=e[t])})),a},s.appendTo=function(t){return e||((e=i("div")).style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),t.appendChild(e),e},s.render=function(n){if(!e)return!1;var r,i="function"==typeof a.transform&&a.transform();if(i){var s=i.a,l=i.b,u=i.c,c=i.d,d=i.e,f=i.f;return e.style.transform="matrix(".concat(s,", ").concat(l,", ").concat(u,", ").concat(c,", ").concat(d,", ").concat(f,")"),!0}return e.style.transform="",e.style.left="".concat(o.computedPhysical.x,"px"),e.style.top="".concat(o.computedPhysical.y,"px"),e.style.width="".concat(o.computedPhysical.width,"px"),e.style.height="".concat(o.computedPhysical.height,"px"),r=Array.isArray(n)?Uh("div",null,n):n,t=dm(r,e,t),!0},s.renderArgs=[Uh],s.clear=function(){if(e){for(var n=e.firstChild;n;)e.removeChild(n),n=e.firstChild;t=null}return s},s.destroy=function(){e&&e.parentElement&&e.parentElement.removeChild(e),e=null,t=null},s.size=function(e){return e&&(o=Gp(e)),o},s}Ih=Hh.slice,Oh={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},Lh=0,Xh.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Vh({},this.state),"function"==typeof e&&(e=e(Vh({},n),this.props)),e&&Vh(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Jh(this))},Xh.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Jh(this))},Xh.prototype.render=Yh,zh=[],Zh.__r=0;var pm=[function(e){e.renderer("svg",Ah)},function(e){e.renderer("canvas",uh)},function(e){e.renderer("dom",fm)}],hm={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},mm=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.level,r=void 0===n?hm.OFF:n,i=t.pipe,o=void 0===i?console:i,a=r,s=(O(e={},hm.OFF,(function(){})),O(e,hm.ERROR,(function(){return o.error.apply(o,arguments)})),O(e,hm.WARN,(function(){return o.warn.apply(o,arguments)})),O(e,hm.INFO,(function(){return o.info.apply(o,arguments)})),O(e,hm.DEBUG,(function(){return o.log.apply(o,arguments)})),e),l=function(e){if(e&&!(a<e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];(s[e]||s[hm.DEBUG]).apply(void 0,n)}};return{log:l,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.apply(void 0,[hm.ERROR].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.apply(void 0,[hm.WARN].concat(t))},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.apply(void 0,[hm.INFO].concat(t))},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.apply(void 0,[hm.DEBUG].concat(t))},level:function(e){return"number"==typeof e&&(a=e),a},LOG_LEVEL:hm}};function gm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;e(n,t)}var vm=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=mm(t.logger),i={component:ft(n.component,"component",r),data:ft(n.data,"data",r),formatter:ft(n.formatter,"formatter",r),interaction:ft(n.interaction,"interaction",r),renderer:pl(n.renderer),scale:ft(n.scale,"scale",r),symbol:ft(n.symbol,"symbol",r),logger:r};function o(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={palettes:t.palettes.concat(n.palettes||[]),style:D({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer};return e(r,i)}return t.renderer&&t.renderer.prio&&i.renderer.default(t.renderer.prio[0]),o.use=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return gm(e,t,i)},o.chart=function(e){return fl(e,{registries:i,logger:r,style:t.style,palettes:t.palettes})},o.config=function(){return t},Object.keys(i).forEach((function(e){o[e]=i[e]})),o.version=_,o}({renderer:{prio:["svg","canvas"]},logger:{level:0},style:{"$font-family":"'Source Sans Pro', Arial, sans-serif","$font-size":"12px","$line-height":"16px","$font-size--l":"16px","$font-weight":"normal","$gray-100":"#ffffff","$gray-98":"#f9f9f9","$gray-95":"#f2f2f2","$gray-90":"#e6e6e6","$gray-35":"#595959","$gray-30":"#4d4d4d","$gray-25":"#404040","$gray-20":"#333333","$border-95":"rgba(255, 255, 255, 0.05)","$border-90":"rgba(255, 255, 255, 0.1)","$border-80":"rgba(255, 255, 255, 0.2)","$border-20":"rgba(0, 0, 0, 0.2)","$border-10":"rgba(0, 0, 0, 0.1)","$border-5":"rgba(0, 0, 0, 0.05)","$primary-blue":"#3F8AB3","$primary-green":"#6CB33F","$primary-red":"#DC423F","$primary-orange":"#EF960F","$spacing--s":4,$spacing:8,"$spacing--l":12,"$font-color":"$gray-35","$font-color--inverted":"$gray-90","$guide-color":"$gray-90","$guide-color--inverted":"$gray-35",$border:"$border-80","$border--inverted":"$border-10",$shape:{fill:"$primary-blue",strokeWidth:1,stroke:"$border"},"$shape-outline":{stroke:"$primary-blue",strokeWidth:2},"$shape-guide":{stroke:"$guide-color",strokeWidth:1},"$shape-guide--inverted":{"@extend":"$shape-guide",stroke:"$guide-color--inverted"},$label:{fontSize:"$font-size",fontFamily:"$font-family",fill:"$font-color"},"$label--inverted":{$extend:"$label",fill:"$font-color--inverted"},"$label-overlay":{fontSize:"$font-size--l",fontFamily:"$font-family",fill:"$gray-100",color:"$font-color",stroke:"$guide-color--inverted",strokeWidth:1,borderRadius:4},$title:{"@extend":"$label",fontSize:"$font-size--l",fontWeight:"$font-weight",stroke:"$guide-color--inverted",strokeWidth:0},"$guide-line":{strokeWidth:1,stroke:"$guide-color"},"$guide-line--minor":{strokeWidth:1,stroke:"$gray-95"},"$padding--s":{left:"$spacing--s",right:"$spacing--s",top:"$spacing--s",bottom:"$spacing--s"},$padding:{left:"$spacing",right:"$spacing",top:"$spacing",bottom:"$spacing"},"$selection-area-target":{fill:"$primary-green",strokeWidth:0,opacity:.2}},palettes:[{key:"categorical",colors:[["#a54343","#d76c6c","#ec983d","#ecc43d","#f9ec86","#cbe989","#70ba6e","#578b60","#79d69f","#26a0a7","#138185","#65d3da"]]},{key:"diverging",colors:[["#3d52a1","#3a89c9","#77b7e5","#b4ddf7","#e6f5fe","#ffe3aa","#f9bd7e","#ed875e","#d24d3e","#ae1c3e"]]},{key:"sequential",colors:[["rgb(180,221,212)","rgb(34, 83, 90)"]]}]},{component:hl,data:_l,formatter:Er,interaction:Nl,renderer:pl(),scale:jo,symbol:es});function ym(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 bm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ym(Object(n),!0).forEach((function(t){Sm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ym(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xm(e){return(xm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function km(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Cm(e,t,n){return t&&km(e.prototype,t),n&&km(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Em(e,t){return(Em=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Mm(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function Tm(e,t,n){return(Tm=Mm()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&Em(i,n.prototype),i}).apply(null,arguments)}function Dm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||Nm(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _m(e){return function(e){if(Array.isArray(e))return qm(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Nm(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 Nm(e,t){if(e){if("string"==typeof e)return qm(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)?qm(e,t):void 0}}function qm(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}_f.forEach(vm.use),pm.forEach(vm.use),[].forEach(vm.use);var Rm=Object.prototype.hasOwnProperty,Pm=Object.prototype.toString,Am=Object.defineProperty,Im=Object.getOwnPropertyDescriptor,Om=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Pm.call(e)},Lm=function(e){if(!e||"[object Object]"!==Pm.call(e))return!1;var t,n=Rm.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Rm.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Rm.call(e,t)},zm=function(e,t){Am&&"__proto__"===t.name?Am(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Fm=function(e,t){if("__proto__"===t){if(!Rm.call(e,t))return;if(Im)return Im(e,t).value}return e[t]},jm=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=Fm(s,n),s!==(i=Fm(t,n))&&(c&&i&&(Lm(i)||(o=Om(i)))?(o?(o=!1,a=r&&Om(r)?r:[]):a=r&&Lm(r)?r:{},zm(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&zm(s,{name:n,newValue:i}));return s};function Hm(e,t,n){if(!e)return-1;var r=n.cache,i=e.origin?e.origin():null;i&&(e=i);var o=r.fields.indexOf(e),a=-1,s=-1;if(-1===o)for(var l=0;l<r.wrappedFields.length;l++)if(s=r.wrappedFields[l].attrDims.map((function(e){return e.instance})).indexOf(e),a=r.wrappedFields[l].attrExps.map((function(e){return e.instance})).indexOf(e),-1!==s||-1!==a){o=l;break}return(o-=t.qArea.qLeft)<0||o>=t.qArea.qWidth?-1:s>=0?function(e){return e[o].qAttrDims.qValues[s]}:a>=0?function(e){return e[o].qAttrExps.qValues[a]}:function(e){return e[o]}}function Bm(e,t,n){var r=n.key,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 Vm(e){var t=e.cache,n=e.f,r=e.mainCell,i=e.p;e.prop;var o=e.page,a=e.rowIdx,s=e.row,l=e.sourceKey,u=e.target,c=e.targetProp,d=r;if(i.field&&i.field!==n){var f=Hm(i.field,o,{cache:t});if(-1===f)return;d=jm({qRow:a},f(s))}u[c]=Bm(i,d,{key:l})}function Wm(e,t,n,r){for(var i=Array.isArray(e)?e:[e],o=[],a=0;a<i.length;a++)if(void 0!==i[a].field){for(var s=t.raw(),l=t.key(),u="object"===xm(i[a].field)?i[a].field:t.field(i[a].field),c=r.normalizeConfig(i[a],t),d=c.props,f=c.main,p=Object.keys(d),h=!!i[a].trackBy,m=xm(i[a].trackBy),g={},v=[],y=[],b=0;b<s.qDataPages.length;b++){var x=Hm(u,s.qDataPages[b],{cache:n});if(-1!==x)for(var w=0;w<s.qDataPages[b].qMatrix.length;w++){var k=s.qDataPages[b].qArea.qTop+w,C=jm({qRow:k},x(s.qDataPages[b].qMatrix[w])),S=Bm(f,C,{key:l});if(!(f.filter&&!f.filter(C))){for(var E=0;E<p.length;E++){var M=d[p[E]],T=M.fields||[M];M.fields&&(S[p[E]]=[]);for(var D=0;D<T.length;D++)Vm({cache:n,f:u,mainCell:C,p:T[D],prop:p[E],props:d,page:s.qDataPages[b],rowIdx:k,row:s.qDataPages[b].qMatrix[w],sourceKey:l,target:M.fields?S[p[E]]:S,targetProp:M.fields?D:p[E]});if(M.fields){var _=S[p[E]].map((function(e){return e.value})),N=S[p[E]].map((function(e){return e.label}));S[p[E]]={value:"function"==typeof M.value?M.value(_):void 0!==M.value?M.value:_,label:"function"==typeof M.label?M.label(N):void 0!==M.label?String(M.label):String(S[p[E]].value)}}}h&&r.track({cfg:i[a],itemData:C,obj:S,target:v,tracker:g,trackType:m}),y.push(S)}}}var q=h?r.collect(v,{main:f,propsArr:p,props:d}):y;o=[].concat(_m(o),_m(q))}return o}function Um(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 $m(e,t){var n,r,i,o,a,s=new Gm(e),l=+e.value&&(s.value=e.value),u=[s];for(null==t&&(t=Ym);n=u.pop();)if(l&&(n.value=+n.data.value),(i=t(n.data))&&(a=i.length))for(n.children=new Array(a),o=a-1;o>=0;--o)u.push(r=n.children[o]=new Gm(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Km)}function Ym(e){return e.children}function Xm(e){e.data=e.data.data}function Km(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Gm(e){this.data=e,this.depth=this.height=0,this.parent=null}function Jm(e){if("function"!=typeof e)throw new Error;return e}Gm.prototype=$m.prototype={constructor:Gm,count:function(){return this.eachAfter(Um)},each:function(e){var t,n,r,i,o=this,a=[o];do{for(t=a.reverse(),a=[];o=t.pop();)if(e(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length);return this},eachAfter:function(e){for(var t,n,r,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n]);for(;i=a.pop();)e(i);return this},eachBefore:function(e){for(var t,n,r=this,i=[r];r=i.pop();)if(e(r),t=r.children)for(n=t.length-1;n>=0;--n)i.push(t[n]);return this},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;e=n.pop(),t=r.pop();for(;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(){var e=[];return this.each((function(t){e.push(t)})),e},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return $m(this).eachBefore(Xm)}};var Zm={depth:-1},Qm={};function eg(e){return e.id}function tg(e){return e.parentId}function ng(e,t){"/"===e.charAt(0)&&(e=e.substring(1));for(var n,r=e.split("/"),i=t,o=0;o<r.length;o++){if("*"===r[o]&&Array.isArray(i)){var a=[];n=r.slice(o+1).join("/");for(var s=0;s<i.length;s++){var l=ng(n,i[s]);Array.isArray(l)?a.push.apply(a,_m(l)):a.push(l)}return a}if(!r[o]&&Array.isArray(i)){var u=new Array(i.length);n=r.slice(o+1).join("/");for(var c=0;c<i.length;c++)u[c]=ng(n,i[c]);return u}r[o]in i&&(i=i[r[o]])}return i}function rg(e,t,n){var r=[];if(!e||!e.length)return r;if(t<=0){var i=n>=0?[e[n]]:e;r.push.apply(r,_m(i))}else for(var o=0;o<e.length;o++)e[o].children&&e[o].children.length&&r.push.apply(r,_m(rg(e[o].children,t-1,n)));return r}function ig(e,t,n){if(e===t)return function(e){return e};if(e>t){var r=Math.max(0,Math.min(100,e-t));return function(e){for(var t=e,n=0;n<r;++n)t=t.parent;return t}}if(t>e){var i=Math.max(0,Math.min(100,t-e));return function(e){return rg(e.children,i-1,n)}}return!1}function og(e,t){var n=t.cache;if("number"==typeof e)return n.fields[e];var r=n.allFields;if("function"==typeof e){for(var i=0;i<r.length;i++)if(e(r[i]))return r[i];return!1}if("string"==typeof e){for(var o=0;o<r.length;o++)if(r[o].key()===e||r[o].title()===e)return r[o]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}var ag=/^qDimensionInfo(?:\/(\d+))?/,sg=/^\/?qMeasureInfo\/(\d+)/,lg=/\/qAttrExprInfo\/(\d+)/,ug=/\/qAttrDimInfo\/(\d+)/;function cg(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((function(e,t){return t}))).filter((function(t){return t<e.qDimensionInfo.length}))}function dg(e,t){var n=t.cube;if(!e)return-1;var r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,u=-1,c=r,d=n.qEffectiveInterColumnSortOrder,f=cg(n);return ag.test(c)&&(i=!0,o=+ag.exec(c)[1],c=r.replace(ag,"")),sg.test(c)&&("K"===n.qMode?l=+sg.exec(c)[1]:d&&-1!==d.indexOf(-1)?(l=+sg.exec(c)[1],u=0):u=+sg.exec(c)[1],c=c.replace(sg,"")),c&&(ug.exec(c)?s=+ug.exec(c)[1]:lg.exec(c)&&(a=+lg.exec(c)[1])),{fieldDepth:(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))+1,pseudoMeasureIndex:l,measureIdx:u,attrDimIdx:s,attrIdx:a}}function fg(e,t){var n,r,i=ig(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?function(e){return e.data.qValues[t.measureIdx]}:function(e){return e.data},t.attrDimIdx>=0?r=function(e){var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=function(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 pg(e,t,n){var r=n.key,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 hg(e){for(var t=e.propsArr,n=e.props,r=e.item,i=e.itemData,o=e.ret,a=e.sourceKey,s=0;s<t.length;s++){var l=n[t[s]],u=l.fields||[l],c=void 0,d=void 0;l.fields&&(c=[],d=[]);for(var f=function(e){var n=u[e],f=void 0,p=void 0,h=void 0,m=void 0,g=void 0,v=void 0;if("primitive"===n.type?(h=n.value,v=String(n.value)):("function"==typeof n.value&&(f=function(e){return n.value(e,r)}),"function"==typeof n.label&&(p=function(e){return n.label(e,r)}),n.accessor?(m=n.accessor(r),Array.isArray(m)?(g=m.map(n.valueAccessor),n.attrAccessor&&(g=g.map(n.attrAccessor)),f&&(h=g.map(f),f=null),p&&(v=g.map(p),p=null),h=n.reduce?n.reduce(h):h,v=n.reduceLabel?n.reduceLabel(v,h):String(h)):v=h=n.attrAccessor?n.attrAccessor(n.valueAccessor(m)):n.valueAccessor(m)):(h=i,v=i)),l.fields){var y=f?f(h):h;c.push(y),d.push(p&&null!=v?p(v):null!=v?v:String(y))}else{var b=f?f(h):h;o[t[s]]={value:b,label:p?p(v):null!=v?v:String(b)},n.field&&(o[t[s]].source={field:n.field.key(),key:a})}},p=0;p<u.length;p++)f(p);c&&(o[t[s]]={value:"function"==typeof l.value?l.value(c,r):c,label:"function"==typeof l.label?l.label(d,r):d})}}var mg=function(e,t,n){var r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=ng(r,e);return o&&o[0]?(t.tree=$m(o[0],n.children||function(e){return e[i]}),t.tree):null};function gg(e){for(var t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){var t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((function(e,t){return t}))}(e),r=e.fields(),i=e.fields().filter((function(e){return"dimension"===e.type()})).map((function(e){return n.indexOf(r.indexOf(e))})),o=e.fields().filter((function(e){return"measure"===e.type()})).map((function(e){return n.indexOf(r.indexOf(e))})),a={__root:{__id:"__root",qValues:[]}},s=0;s<t.length;s++){for(var l=t[s],u="__root",c=!1,d=0;d<i.length;d++){var f,p=l[i[d]],h="".concat(u,"__").concat(null!==(f=p.qElemNumber)&&void 0!==f?f:p.qElemNo);a[h]||(a[h]=bm({__id:h,__parent:u,qValues:[]},p),c=!0),u=h}if(c)for(var m=0;m<o.length;m++){var g=l[o[m]];a[u].qValues.push(g)}}var v=Object.keys(a).map((function(e){return a[e]}));return function(){var e=eg,t=tg;function n(n){var r,i,o,a,s,l,u,c=n.length,d=new Array(c),f={};for(i=0;i<c;++i)r=n[i],s=d[i]=new Gm(r),null!=(l=e(r,i,n))&&(l+="")&&(f[u="$"+(s.id=l)]=u in f?Qm:s);for(i=0;i<c;++i)if(s=d[i],null!=(l=t(n[i],i,n))&&(l+="")){if(!(a=f["$"+l]))throw new Error("missing: "+l);if(a===Qm)throw new Error("ambiguous: "+l);a.children?a.children.push(s):a.children=[s],s.parent=a}else{if(o)throw new Error("multiple roots");o=s}if(!o)throw new Error("no root");if(o.parent=Zm,o.eachBefore((function(e){e.depth=e.parent.depth+1,--c})).eachBefore(Km),o.parent=null,c>0)throw new Error("cycle");return o}return n.id=function(t){return arguments.length?(e=Jm(t),n):e},n.parentId=function(e){return arguments.length?(t=Jm(e),n):t},n}().id((function(e){return e.__id})).parentId((function(e){return e.__parent}))(v)}var vg=function(e){for(var t=e.propsArr,n=e.props,r=e.cube,i=e.cache,o=e.itemDepthObject,a=e.f,s=0;s<t.length;s++)for(var l=n[t[s]],u=l.fields?l.fields:[l],c=0;c<u.length;c++){var d=u[c];if(d.field!==a){var f=fg(o,dg(d.field,{cube:r,cache:i}));d.accessor=f.nodeFn,d.valueAccessor=f.valueFn,d.attrAccessor=f.attrFn}}};function yg(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=t.raw(),o=t.key(),a="S"===i.qMode?gg(t):mg(i,n,e);if(!a)return null;for(var s=a.height,l=[],u=0;u<=s;u++){var c=null;if(u>0)if("S"===i.qMode){var d=cg(i),f=d[u-1];c=n.fields[f]}else{var p=i.qEffectiveInterColumnSortOrder[u-1];u>i.qEffectiveInterColumnSortOrder.length&&(p=i.qDimensionInfo.length),c=n.fields[p]}var h=r.normalizeConfig(bm(bm({},e),{},{field:c?c.key():void 0}),t),m=h.props,g=h.main,v=Object.keys(m);l[u]={propsArr:v,props:m,main:g};var y=c?dg(c,{cube:i,cache:n}):{fieldDepth:0};vg({propsArr:v,props:m,cube:i,cache:n,itemDepthObject:y,f:c})}for(var b=a.copy(),x=b.descendants(),w=a.descendants(),k=0;k<w.length;k++){var C=l[w[k].depth].propsArr,S=l[w[k].depth].props,E=l[w[k].depth].main,M=x[k],T=M.data,D=pg(E,T,{key:o});hg({propsArr:C,props:S,item:M,itemData:T,ret:D,sourceKey:o,isTree:!0}),w[k].data=D}return a}function bg(e,t,n,r){for(var i=Array.isArray(e)?e:[e],o=[],a=0;a<i.length;a++)if(void 0!==i[a].field){var s=t.raw(),l=t.key();if(!mg(s,n,e))continue;var u="object"===xm(i[a].field)?i[a].field:t.field(i[a].field),c=r.normalizeConfig(i[a],t),d=c.props,f=c.main,p=Object.keys(d),h=dg(u,{cube:s,cache:n}),m=fg({fieldDepth:0},h),g=m.nodeFn,v=m.attrFn,y=m.valueFn;vg({propsArr:p,props:d,cube:s,cache:n,itemDepthObject:h,f:u});for(var b=!!i[a].trackBy,x=xm(i[a].trackBy),w={},k=[],C=g(n.tree),S=[],E=0;E<C.length;E++){var M=C[E],T=v?v(y(M)):y(M);if(!(f.filter&&!f.filter(T))){var D=pg(f,T,{key:l});hg({propsArr:p,props:d,item:M,itemData:T,ret:D,sourceKey:l}),b&&r.track({cfg:i[a],itemData:T,obj:D,target:k,tracker:w,trackType:x}),S.push(D)}}var _=b?r.collect(k,{main:f,propsArr:p,props:d}):S;o=[].concat(_m(o),_m(_))}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var xg=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){
|
|
12
|
+
* Licensed under the MIT license */!function(e){!function(t,n,r,i){var o,a=["","webkit","Moz","MS","ms","o"],s=n.createElement("div"),l=Math.round,u=Math.abs,c=Date.now;function d(e,t,n){return setTimeout(y(e,n),t)}function f(e,t,n){return!!Array.isArray(e)&&(p(e,n[t],n),!0)}function p(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 h(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=h((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=h((function(e,t){return m(e,t,!0)}),"merge","Use `assign`.");function v(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&o(r,n)}function y(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){p(E(t),(function(t){e.addEventListener(t,n,!1)}))}function k(e,t,n){p(E(t),(function(t){e.removeEventListener(t,n,!1)}))}function C(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function S(e,t){return e.indexOf(t)>-1}function E(e){return e.trim().split(/\s+/g)}function M(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 T(e){return Array.prototype.slice.call(e,0)}function D(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var a=t?e[o][t]:e[o];M(i,a)<0&&r.push(e[o]),i[o]=a,o++}return n&&(r=t?r.sort((function(e,n){return e[t]>n[t]})):r.sort()),r}function _(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),s=0;s<a.length;){if((r=(n=a[s])?n+o:t)in e)return r;s++}return i}var N=1;function q(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var R="ontouchstart"in t,P=_(t,"PointerEvent")!==i,A=R&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),I="touch",O="mouse",L=24,z=["x","y"],F=["clientX","clientY"];function j(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,a=1&t&&r-o==0,s=12&t&&r-o==0;n.isFirst=!!a,n.isFinal=!!s,a&&(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 a=n.firstInput,s=n.firstMultiple,l=s?s.center:a.center,d=t.center=V(r);t.timeStamp=c(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=Y(l,d),t.distance=$(l,d),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=U(t.deltaX,t.deltaY);var f=W(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=f.x,t.overallVelocityY=f.y,t.overallVelocity=u(f.x)>u(f.y)?f.x:f.y,t.scale=s?function(e,t){return $(t[0],t[1],F)/$(e[0],e[1],F)}(s.pointers,r):1,t.rotation=s?function(e,t){return Y(t[1],t[0],F)+Y(e[1],e[0],F)}(s.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,a,s=e.lastInterval||t,l=t.timeStamp-s.timeStamp;if(8!=t.eventType&&(l>25||s.velocity===i)){var c=t.deltaX-s.deltaX,d=t.deltaY-s.deltaY,f=W(l,c,d);r=f.x,o=f.y,n=u(f.x)>u(f.y)?f.x:f.y,a=U(c,d),e.lastInterval=t}else n=s.velocity,r=s.velocityX,o=s.velocityY,a=s.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=a}(n,t);var p=e.element;C(t.srcEvent.target,p)&&(p=t.srcEvent.target);t.target=p}(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:c(),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 W(e,t,n){return{x:t/e||0,y:n/e||0}}function U(e,t){return e===t?1:u(e)>=u(t)?e<0?2:4:t<0?8:16}function $(e,t,n){n||(n=z);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=z);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}j.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(q(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&k(this.element,this.evEl,this.domHandler),this.evTarget&&k(this.target,this.evTarget,this.domHandler),this.evWin&&k(q(this.element),this.evWin,this.domHandler)}};var X={mousedown:1,mousemove:2,mouseup:4},K="mousedown",G="mousemove mouseup";function J(){this.evEl=K,this.evWin=G,this.pressed=!1,j.apply(this,arguments)}v(J,j,{handler:function(e){var t=X[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:O,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Q={2:I,3:"pen",4:O,5:"kinect"},ee="pointerdown",te="pointermove pointerup pointercancel";function ne(){this.evEl=ee,this.evWin=te,j.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),v(ne,j,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=Z[r],o=Q[e.pointerType]||e.pointerType,a=o==I,s=M(t,e.pointerId,"pointerId");1&i&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):12&i&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var re={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ie="touchstart",oe="touchstart touchmove touchend touchcancel";function ae(){this.evTarget=ie,this.evWin=oe,this.started=!1,j.apply(this,arguments)}function se(e,t){var n=T(e.touches),r=T(e.changedTouches);return 12&t&&(n=D(n.concat(r),"identifier",!0)),[n,r]}v(ae,j,{handler:function(e){var t=re[e.type];if(1===t&&(this.started=!0),this.started){var n=se.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:I,srcEvent:e})}}});var le={touchstart:1,touchmove:2,touchend:4,touchcancel:8},ue="touchstart touchmove touchend touchcancel";function ce(){this.evTarget=ue,this.targetIds={},j.apply(this,arguments)}function de(e,t){var n=T(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=T(e.changedTouches),s=[],l=this.target;if(o=n.filter((function(e){return C(e.target,l)})),1===t)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<a.length;)r[a[i].identifier]&&s.push(a[i]),12&t&&delete r[a[i].identifier],i++;return s.length?[D(o.concat(s),"identifier",!0),s]:void 0}v(ce,j,{handler:function(e){var t=le[e.type],n=de.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:I,srcEvent:e})}});function fe(){j.apply(this,arguments);var e=y(this.handler,this);this.touch=new ce(this.manager,e),this.mouse=new J(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function pe(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,he.call(this,t)):12&e&&he.call(this,t)}function he(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 me(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),a=Math.abs(n-i.y);if(o<=25&&a<=25)return!0}return!1}v(fe,j,{handler:function(e,t,n){var r=n.pointerType==I,i=n.pointerType==O;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)pe.call(this,t,n);else if(i&&me.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ge=_(s.style,"touchAction"),ve=ge!==i,ye="compute",be="auto",xe="manipulation",we="none",ke="pan-x",Ce="pan-y",Se=function(){if(!ve)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 Ee(e,t){this.manager=e,this.set(t)}Ee.prototype={set:function(e){e==ye&&(e=this.compute()),ve&&this.manager.element.style&&Se[e]&&(this.manager.element.style[ge]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return p(this.manager.recognizers,(function(t){b(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(S(e,we))return we;var t=S(e,ke),n=S(e,Ce);if(t&&n)return we;if(t||n)return t?ke:Ce;if(S(e,xe))return xe;return be}(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,we)&&!Se.none,o=S(r,Ce)&&!Se["pan-y"],a=S(r,ke)&&!Se["pan-x"];if(i){var s=1===e.pointers.length,l=e.distance<2,u=e.deltaTime<250;if(s&&l&&u)return}if(!a||!o)return i||o&&6&n||a&&n&L?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Me=32;function Te(e){this.options=o({},this.defaults,e||{}),this.id=N++,this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function De(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function _e(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Ne(e,t){var n=t.manager;return n?n.get(e):e}function qe(){Te.apply(this,arguments)}function Re(){qe.apply(this,arguments),this.pX=null,this.pY=null}function Pe(){qe.apply(this,arguments)}function Ae(){Te.apply(this,arguments),this._timer=null,this._input=null}function Ie(){qe.apply(this,arguments)}function Oe(){qe.apply(this,arguments)}function Le(){Te.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ze(e,t){return(t=t||{}).recognizers=x(t.recognizers,ze.defaults.preset),new Fe(e,t)}Te.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(f(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Ne(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return f(e,"dropRecognizeWith",this)||(e=Ne(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(f(e,"requireFailure",this))return this;var t=this.requireFail;return-1===M(t,e=Ne(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(f(e,"dropRequireFailure",this))return this;e=Ne(e,this);var t=M(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+De(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+De(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Me},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=Me);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},v(qe,Te,{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:Me}}),v(Re,qe,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(Ce),e&L&&t.push(ke),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,a=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===a?1:a<0?8:16,n=a!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return qe.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=_e(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),v(Pe,qe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[we]},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)}}),v(Ae,Te,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[be]},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=d((function(){this.state=8,this.tryEmit()}),t.time,this);else if(4&e.eventType)return 8;return Me},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=c(),this.manager.emit(this.options.event,this._input)))}}),v(Ie,qe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[we]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),v(Oe,qe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return Re.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&&u(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=_e(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),v(Le,Te,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[xe]},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,a=!this.pCenter||$(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=d((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return Me},failTimeout:function(){return this._timer=d((function(){this.state=Me}),this.options.interval,this),Me},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ze.VERSION="2.0.7",ze.defaults={domEvents:!1,touchAction:ye,enable:!0,inputTarget:null,inputClass:null,preset:[[Ie,{enable:!1}],[Pe,{enable:!1},["rotate"]],[Oe,{direction:6}],[Re,{direction:6},["swipe"]],[Le],[Le,{event:"doubletap",taps:2},["tap"]],[Ae]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Fe(e,t){var n;this.options=o({},ze.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||(P?ne:A?ce:R?fe:J))(n,H),this.touchAction=new Ee(this,this.options.touchAction),je(this,!0),p(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 je(e,t){var n,r=e.element;r.style&&(p(e.options.cssProps,(function(i,o){n=_(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}Fe.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 Te)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(f(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(f(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=M(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 p(E(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==i){var n=this.handlers;return p(E(e),(function(e){t?n[e]&&n[e].splice(M(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&&je(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(ze,{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:Me,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:Fe,Input:j,TouchAction:Ee,TouchInput:ce,MouseInput:J,PointerEventInput:ne,TouchMouseInput:fe,SingleTouchInput:ae,Recognizer:Te,AttrRecognizer:qe,Tap:Le,Pan:Re,Swipe:Oe,Pinch:Pe,Rotate:Ie,Press:Ae,on:w,off:k,each:p,merge:g,extend:m,assign:o,inherit:v,bindFn:y,prefixed:_}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=ze,e.exports?e.exports=ze:t.Hammer=ze}(window,document)}(i);var o=i.exports,a={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},s=/([astvzqmhlc])([^astvzqmhlc]*)/gi,l=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;var u=function(e){var t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(s,(function(e,n,r){var i=n.toLowerCase(),o=function(e){var t=e.match(l);return t?t.map(Number):[]}(r),s=n;if("m"===i&&o.length>2&&(t.push([s].concat(o.splice(0,2))),i="l",s="m"===s?"l":"L"),o.length<a[i])return"";for(t.push([s].concat(o.splice(0,a[i])));o.length>=a[i]&&o.length&&a[i];)t.push([s].concat(o.splice(0,a[i])));return""})),t};function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e){return function(e){if(Array.isArray(e))return f(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)return;if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(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 f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var p=u;function h(e,t){var n=e.x*Math.cos(t)-e.y*Math.sin(t),r=e.y*Math.cos(t)+e.x*Math.sin(t);e.x=n,e.y=r}function m(e,t,n){e.x+=t,e.y+=n}function g(e,t){e.x*=t,e.y*=t}var v=u,y=function(e){if(void 0!==e&&e.CanvasRenderingContext2D&&(!e.Path2D||!function(e){var t=e.document.createElement("canvas").getContext("2d"),n=new e.Path2D("M0 0 L1 1");return t.strokeStyle="red",t.lineWidth=1,t.stroke(n),255===t.getImageData(0,0,1,1).data[0]}(e))){var t=function(){function e(t){var n;(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.segments=[],t&&t instanceof e)?(n=this.segments).push.apply(n,d(t.segments)):t&&(this.segments=p(t))}var t,n,r;return t=e,(n=[{key:"addPath",value:function(t){var n;t&&t instanceof e&&(n=this.segments).push.apply(n,d(t.segments))}},{key:"moveTo",value:function(e,t){this.segments.push(["M",e,t])}},{key:"lineTo",value:function(e,t){this.segments.push(["L",e,t])}},{key:"arc",value:function(e,t,n,r,i,o){this.segments.push(["AC",e,t,n,r,i,!!o])}},{key:"arcTo",value:function(e,t,n,r,i){this.segments.push(["AT",e,t,n,r,i])}},{key:"ellipse",value:function(e,t,n,r,i,o,a,s){this.segments.push(["E",e,t,n,r,i,o,a,!!s])}},{key:"closePath",value:function(){this.segments.push(["Z"])}},{key:"bezierCurveTo",value:function(e,t,n,r,i,o){this.segments.push(["C",e,t,n,r,i,o])}},{key:"quadraticCurveTo",value:function(e,t,n,r){this.segments.push(["Q",e,t,n,r])}},{key:"rect",value:function(e,t,n,r){this.segments.push(["R",e,t,n,r])}}])&&c(t.prototype,n),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),n=e.CanvasRenderingContext2D.prototype.fill,r=e.CanvasRenderingContext2D.prototype.stroke;e.CanvasRenderingContext2D.prototype.fill=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var i="nonzero";if(0===t.length||1===t.length&&"string"==typeof t[0])n.apply(this,t);else{2===arguments.length&&(i=t[1]);var a=t[0];o(this,a.segments),n.call(this,i)}},e.CanvasRenderingContext2D.prototype.stroke=function(e){e?(o(this,e.segments),r.call(this)):r.call(this)};var i=e.CanvasRenderingContext2D.prototype.isPointInPath;e.CanvasRenderingContext2D.prototype.isPointInPath=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if("Path2D"===t[0].constructor.name){var r=t[1],a=t[2],s=t[3]||"nonzero",l=t[0];return o(this,l.segments),i.apply(this,[r,a,s])}return i.apply(this,t)},e.Path2D=t}function o(e,t){var n,r,i,o,a,s,l,u,c,d,f,p,v,y,b,x,w,k,C,S,E,M,T,D,_,N,q={x:0,y:0},R={x:0,y:0};e.beginPath();for(var P=0;P<t.length;++P){var A=t[P];switch("S"!==(S=A[0])&&"s"!==S&&"C"!==S&&"c"!==S&&(M=null,T=null),"T"!==S&&"t"!==S&&"Q"!==S&&"q"!==S&&(D=null,_=null),S){case"m":case"M":"m"===S?(f+=A[1],v+=A[2]):(f=A[1],v=A[2]),"M"!==S&&q||(q={x:f,y:v}),e.moveTo(f,v);break;case"l":f+=A[1],v+=A[2],e.lineTo(f,v);break;case"L":f=A[1],v=A[2],e.lineTo(f,v);break;case"H":f=A[1],e.lineTo(f,v);break;case"h":f+=A[1],e.lineTo(f,v);break;case"V":v=A[1],e.lineTo(f,v);break;case"v":v+=A[1],e.lineTo(f,v);break;case"a":case"A":"a"===S?(f+=A[6],v+=A[7]):(f=A[6],v=A[7]),x=A[1],w=A[2],l=A[3]*Math.PI/180,i=!!A[4],o=!!A[5],a={x:f,y:v},h(s={x:(R.x-a.x)/2,y:(R.y-a.y)/2},-l),(u=s.x*s.x/(x*x)+s.y*s.y/(w*w))>1&&(x*=u=Math.sqrt(u),w*=u),c=x*x*w*w,d=x*x*s.y*s.y+w*w*s.x*s.x,g(E={x:x*s.y/w,y:-w*s.x/x},o!==i?Math.sqrt((c-d)/d)||0:-Math.sqrt((c-d)/d)||0),r=Math.atan2((s.y-E.y)/w,(s.x-E.x)/x),n=Math.atan2(-(s.y+E.y)/w,-(s.x+E.x)/x),h(E,l),m(E,(a.x+R.x)/2,(a.y+R.y)/2),e.save(),e.translate(E.x,E.y),e.rotate(l),e.scale(x,w),e.arc(0,0,1,r,n,!o),e.restore();break;case"C":M=A[3],T=A[4],f=A[5],v=A[6],e.bezierCurveTo(A[1],A[2],M,T,f,v);break;case"c":e.bezierCurveTo(A[1]+f,A[2]+v,A[3]+f,A[4]+v,A[5]+f,A[6]+v),M=A[3]+f,T=A[4]+v,f+=A[5],v+=A[6];break;case"S":null!==M&&null!==T||(M=f,T=v),e.bezierCurveTo(2*f-M,2*v-T,A[1],A[2],A[3],A[4]),M=A[1],T=A[2],f=A[3],v=A[4];break;case"s":null!==M&&null!==T||(M=f,T=v),e.bezierCurveTo(2*f-M,2*v-T,A[1]+f,A[2]+v,A[3]+f,A[4]+v),M=A[1]+f,T=A[2]+v,f+=A[3],v+=A[4];break;case"Q":D=A[1],_=A[2],f=A[3],v=A[4],e.quadraticCurveTo(D,_,f,v);break;case"q":D=A[1]+f,_=A[2]+v,f+=A[3],v+=A[4],e.quadraticCurveTo(D,_,f,v);break;case"T":null!==D&&null!==_||(D=f,_=v),D=2*f-D,_=2*v-_,f=A[1],v=A[2],e.quadraticCurveTo(D,_,f,v);break;case"t":null!==D&&null!==_||(D=f,_=v),D=2*f-D,_=2*v-_,f+=A[1],v+=A[2],e.quadraticCurveTo(D,_,f,v);break;case"z":case"Z":f=q.x,v=q.y,q=void 0,e.closePath();break;case"AC":f=A[1],v=A[2],b=A[3],r=A[4],n=A[5],N=A[6],e.arc(f,v,b,r,n,N);break;case"AT":p=A[1],y=A[2],f=A[3],v=A[4],b=A[5],e.arcTo(p,y,f,v,b);break;case"E":f=A[1],v=A[2],x=A[3],w=A[4],l=A[5],r=A[6],n=A[7],N=A[8],e.save(),e.translate(f,v),e.rotate(l),e.scale(x,w),e.arc(0,0,1,r,n,N),e.restore();break;case"R":f=A[1],v=A[2],k=A[3],C=A[4],q={x:f,y:v},e.rect(f,v,k,C)}R.x=f,R.y=v}}};"undefined"!=typeof window&&y(window);var b={path2dPolyfill:y,parsePath:v},x=Object.prototype.hasOwnProperty,w=Object.prototype.toString,k=Object.defineProperty,C=Object.getOwnPropertyDescriptor,S=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===w.call(e)},E=function(e){if(!e||"[object Object]"!==w.call(e))return!1;var t,n=x.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&x.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||x.call(e,t)},M=function(e,t){k&&"__proto__"===t.name?k(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},T=function(e,t){if("__proto__"===t){if(!x.call(e,t))return;if(C)return C(e,t).value}return e[t]},D=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=T(s,n),s!==(i=T(t,n))&&(c&&i&&(E(i)||(o=S(i)))?(o?(o=!1,a=r&&S(r)?r:[]):a=r&&E(r)?r:{},M(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&M(s,{name:n,newValue:i}));return s},_="1.9.9";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 q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function P(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function I(e,t,n){return t&&A(e.prototype,t),n&&A(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&F(e,t)}function z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function F(e,t){return(F=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function j(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function H(e,t,n){return(H=j()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&F(i,n.prototype),i}).apply(null,arguments)}function B(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return B(e)}function W(e){var t=j();return function(){var n,r=z(e);if(t){var i=z(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return V(this,n)}}function U(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=z(e)););return e}function $(){return($="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=U(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}}).apply(this,arguments)}function Y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||K(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function X(e){return function(e){if(Array.isArray(e))return G(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||K(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 K(e,t){if(e){if("string"==typeof e)return G(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)?G(e,t):void 0}}function G(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 J(e){return!!e.changedTouches}function Z(e){return"number"==typeof e&&!isNaN(e)}function Q(e){return"number"!=typeof e||isNaN(e)}function ee(e){for(var t=e.length,n=NaN,r=NaN,i=NaN,o=NaN,a=0;a<t;a++)n=isNaN(n)?e[a].x:Math.min(n,e[a].x),r=isNaN(r)?e[a].x:Math.max(r,e[a].x),i=isNaN(i)?e[a].y:Math.min(i,e[a].y),o=isNaN(o)?e[a].y:Math.max(o,e[a].y);return[n,i,r,o]}function te(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function ne(e){return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}]}function re(e){var t=Y(ee(e),4),n=t[0],r=t[1];return{x:n,y:r,width:t[2]-n,height:t[3]-r}}function ie(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function oe(e){var t=e||{},n=t.x,r=t.y,i=t.width,o=t.height,a=t.x1,s=t.x2,l=t.y1,u=t.y2,c=t.cx,d=t.cy,f=t.r,p=t.vertices;return Z(c)&&Z(d)&&Z(f)?"circle":Z(a)&&Z(s)&&Z(l)&&Z(u)?"line":Z(n)&&Z(r)&&Z(i)&&Z(o)?"rect":Z(n)&&Z(r)?"point":Array.isArray(p)?p.every((function(e){return Array.isArray(e)}))?"geopolygon":"polygon":null}function ae(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}function se(e,t){var n=t.types,r=t.logger,i={},o=[];Array.isArray(e)?o.push.apply(o,X(e)):(r.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach((function(e,t){var o=n(e.type);if(o){var a=e.key;void 0===e.key&&(r.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),a=t);var s=o({key:a,data:e.data,config:e.config});i[a]=s}}));return function(e){return e?i[e]:i[Object.keys(i)[0]]}}var le=Math.PI,ue=2*le,ce=1e-6,de=ue-ce;function fe(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function pe(){return new fe}function he(e){return function(){return e}}fe.prototype=pe.prototype={constructor:fe,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,s=n-e,l=r-t,u=o-e,c=a-t,d=u*u+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>ce)if(Math.abs(c*s-l*u)>ce&&i){var f=n-o,p=r-a,h=s*s+l*l,m=f*f+p*p,g=Math.sqrt(h),v=Math.sqrt(d),y=i*Math.tan((le-Math.acos((h+d-m)/(2*g*v)))/2),b=y/v,x=y/g;Math.abs(b-1)>ce&&(this._+="L"+(e+b*u)+","+(t+b*c)),this._+="A"+i+","+i+",0,0,"+ +(c*f>u*p)+","+(this._x1=e+x*s)+","+(this._y1=t+x*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,r,i,o){e=+e,t=+t,o=!!o;var a=(n=+n)*Math.cos(r),s=n*Math.sin(r),l=e+a,u=t+s,c=1^o,d=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+u:(Math.abs(this._x1-l)>ce||Math.abs(this._y1-u)>ce)&&(this._+="L"+l+","+u),n&&(d<0&&(d=d%ue+ue),d>de?this._+="A"+n+","+n+",0,1,"+c+","+(e-a)+","+(t-s)+"A"+n+","+n+",0,1,"+c+","+(this._x1=l)+","+(this._y1=u):d>ce&&(this._+="A"+n+","+n+",0,"+ +(d>=le)+","+c+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var me=Math.abs,ge=Math.atan2,ve=Math.cos,ye=Math.max,be=Math.min,xe=Math.sin,we=Math.sqrt,ke=1e-12,Ce=Math.PI,Se=Ce/2,Ee=2*Ce;function Me(e){return e>1?0:e<-1?Ce:Math.acos(e)}function Te(e){return e>=1?Se:e<=-1?-Se:Math.asin(e)}function De(e){return e.innerRadius}function _e(e){return e.outerRadius}function Ne(e){return e.startAngle}function qe(e){return e.endAngle}function Re(e){return e&&e.padAngle}function Pe(e,t,n,r,i,o,a,s){var l=n-e,u=r-t,c=a-i,d=s-o,f=d*l-c*u;if(!(f*f<ke))return[e+(f=(c*(t-o)-d*(e-i))/f)*l,t+f*u]}function Ae(e,t,n,r,i,o,a){var s=e-n,l=t-r,u=(a?o:-o)/we(s*s+l*l),c=u*l,d=-u*s,f=e+c,p=t+d,h=n+c,m=r+d,g=(f+h)/2,v=(p+m)/2,y=h-f,b=m-p,x=y*y+b*b,w=i-o,k=f*m-h*p,C=(b<0?-1:1)*we(ye(0,w*w*x-k*k)),S=(k*b-y*C)/x,E=(-k*y-b*C)/x,M=(k*b+y*C)/x,T=(-k*y+b*C)/x,D=S-g,_=E-v,N=M-g,q=T-v;return D*D+_*_>N*N+q*q&&(S=M,E=T),{cx:S,cy:E,x01:-c,y01:-d,x11:S*(i/w-1),y11:E*(i/w-1)}}function Ie(){var e=De,t=_e,n=he(0),r=null,i=Ne,o=qe,a=Re,s=null;function l(){var l,u,c=+e.apply(this,arguments),d=+t.apply(this,arguments),f=i.apply(this,arguments)-Se,p=o.apply(this,arguments)-Se,h=me(p-f),m=p>f;if(s||(s=l=pe()),d<c&&(u=d,d=c,c=u),d>ke)if(h>Ee-ke)s.moveTo(d*ve(f),d*xe(f)),s.arc(0,0,d,f,p,!m),c>ke&&(s.moveTo(c*ve(p),c*xe(p)),s.arc(0,0,c,p,f,m));else{var g,v,y=f,b=p,x=f,w=p,k=h,C=h,S=a.apply(this,arguments)/2,E=S>ke&&(r?+r.apply(this,arguments):we(c*c+d*d)),M=be(me(d-c)/2,+n.apply(this,arguments)),T=M,D=M;if(E>ke){var _=Te(E/c*xe(S)),N=Te(E/d*xe(S));(k-=2*_)>ke?(x+=_*=m?1:-1,w-=_):(k=0,x=w=(f+p)/2),(C-=2*N)>ke?(y+=N*=m?1:-1,b-=N):(C=0,y=b=(f+p)/2)}var q=d*ve(y),R=d*xe(y),P=c*ve(w),A=c*xe(w);if(M>ke){var I,O=d*ve(b),L=d*xe(b),z=c*ve(x),F=c*xe(x);if(h<Ce&&(I=Pe(q,R,z,F,O,L,P,A))){var j=q-I[0],H=R-I[1],B=O-I[0],V=L-I[1],W=1/xe(Me((j*B+H*V)/(we(j*j+H*H)*we(B*B+V*V)))/2),U=we(I[0]*I[0]+I[1]*I[1]);T=be(M,(c-U)/(W-1)),D=be(M,(d-U)/(W+1))}}C>ke?D>ke?(g=Ae(z,F,q,R,d,D,m),v=Ae(O,L,P,A,d,D,m),s.moveTo(g.cx+g.x01,g.cy+g.y01),D<M?s.arc(g.cx,g.cy,D,ge(g.y01,g.x01),ge(v.y01,v.x01),!m):(s.arc(g.cx,g.cy,D,ge(g.y01,g.x01),ge(g.y11,g.x11),!m),s.arc(0,0,d,ge(g.cy+g.y11,g.cx+g.x11),ge(v.cy+v.y11,v.cx+v.x11),!m),s.arc(v.cx,v.cy,D,ge(v.y11,v.x11),ge(v.y01,v.x01),!m))):(s.moveTo(q,R),s.arc(0,0,d,y,b,!m)):s.moveTo(q,R),c>ke&&k>ke?T>ke?(g=Ae(P,A,O,L,c,-T,m),v=Ae(q,R,z,F,c,-T,m),s.lineTo(g.cx+g.x01,g.cy+g.y01),T<M?s.arc(g.cx,g.cy,T,ge(g.y01,g.x01),ge(v.y01,v.x01),!m):(s.arc(g.cx,g.cy,T,ge(g.y01,g.x01),ge(g.y11,g.x11),!m),s.arc(0,0,c,ge(g.cy+g.y11,g.cx+g.x11),ge(v.cy+v.y11,v.cx+v.x11),m),s.arc(v.cx,v.cy,T,ge(v.y11,v.x11),ge(v.y01,v.x01),!m))):s.arc(0,0,c,w,x,m):s.lineTo(P,A)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Ce/2;return[ve(r)*n,xe(r)*n]},l.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:he(+t),l):e},l.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:he(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:he(+e),l):n},l.padRadius=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:he(+e),l):r},l.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:he(+e),l):i},l.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:he(+e),l):o},l.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:he(+e),l):a},l.context=function(e){return arguments.length?(s=null==e?null:e,l):s},l}function Oe(e){this._context=e}function Le(e){return new Oe(e)}function ze(e){return e[0]}function Fe(e){return e[1]}function je(){var e=ze,t=null,n=he(0),r=Fe,i=he(!0),o=null,a=Le,s=null;function l(l){var u,c,d,f,p,h=l.length,m=!1,g=new Array(h),v=new Array(h);for(null==o&&(s=a(p=pe())),u=0;u<=h;++u){if(!(u<h&&i(f=l[u],u,l))===m)if(m=!m)c=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=u-1;d>=c;--d)s.point(g[d],v[d]);s.lineEnd(),s.areaEnd()}m&&(g[u]=+e(f,u,l),v[u]=+n(f,u,l),s.point(t?+t(f,u,l):g[u],r?+r(f,u,l):v[u]))}if(p)return s=null,p+""||null}function u(){return function(){var e=ze,t=Fe,n=he(!0),r=null,i=Le,o=null;function a(a){var s,l,u,c=a.length,d=!1;for(null==r&&(o=i(u=pe())),s=0;s<=c;++s)!(s<c&&n(l=a[s],s,a))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(l,s,a),+t(l,s,a));if(u)return o=null,u+""||null}return a.x=function(t){return arguments.length?(e="function"==typeof t?t:he(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:he(+e),a):t},a.defined=function(e){return arguments.length?(n="function"==typeof e?e:he(!!e),a):n},a.curve=function(e){return arguments.length?(i=e,null!=r&&(o=i(r)),a):i},a.context=function(e){return arguments.length?(null==e?r=o=null:o=i(r=e),a):r},a}().defined(i).curve(a).context(o)}return l.x=function(n){return arguments.length?(e="function"==typeof n?n:he(+n),t=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:he(+t),l):e},l.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:he(+e),l):t},l.y=function(e){return arguments.length?(n="function"==typeof e?e:he(+e),r=null,l):n},l.y0=function(e){return arguments.length?(n="function"==typeof e?e:he(+e),l):n},l.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:he(+e),l):r},l.lineX0=l.lineY0=function(){return u().x(e).y(n)},l.lineY1=function(){return u().x(e).y(r)},l.lineX1=function(){return u().x(t).y(n)},l.defined=function(e){return arguments.length?(i="function"==typeof e?e:he(!!e),l):i},l.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),l):a},l.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),l):o},l}function He(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function Be(e){return e}Oe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var Ve=Array.prototype.slice;function We(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Ue(e){this._context=e}function $e(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Ye(e,t){this._context=e,this._k=(1-t)/6}Ue.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:We(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:We(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},Ye.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:$e(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:$e(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Xe=function e(t){function n(e){return new Ye(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Ke(e,t){this._context=e,this._alpha=t}Ke.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>ke){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>ke){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*u+e._x1*e._l23_2a-t*e._l12_2a)/c,a=(a*u+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Ge=function e(t){function n(e){return t?new Ke(e,t):new Ye(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Je(e){return e<0?-1:1}function Ze(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(Je(o)+Je(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Qe(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function et(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function tt(e){this._context=e}function nt(e){this._context=new rt(e)}function rt(e){this._context=e}function it(e){this._context=e}function ot(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/o[t-1],o[t]-=n,a[t]-=n*a[t-1];for(i[r-1]=a[r-1]/o[r-1],t=r-2;t>=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function at(e,t){this._context=e,this._t=t}function st(e,t){if((i=e.length)>1)for(var n,r,i,o=1,a=e[t[0]],s=a.length;o<i;++o)for(r=a,a=e[t[o]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function lt(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function ut(e,t){return e[t]}function ct(e){for(var t,n=-1,r=0,i=e.length,o=-1/0;++n<i;)(t=+e[n][1])>o&&(o=t,r=n);return r}function dt(e){for(var t,n=0,r=-1,i=e.length;++r<i;)(t=+e[r][1])&&(n+=t);return n}function ft(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",r=arguments.length>2?arguments[2]:void 0,i={},o=e||{get:function(){},has:function(){return!1},default:function(){}};function a(e,t){if(!e||"string"!=typeof e)throw new TypeError("Invalid argument: key must be a non-empty string");return!(e in i)&&(i[e]=t,!0)}function s(e){return i[e]||o.get(e)}function l(e){return!!i[e]||o.has(e)}function u(e){var t=i[e];return delete i[e],t}function c(){return Object.keys(i)}function d(){return Object.keys(i).map((function(e){return i[e]}))}function f(e){return void 0!==e&&(t=e),t}function p(e,i){if(void 0!==i)return a(e,i);var o=s(e);return r&&void 0===o&&r.warn("".concat(e," does not exist in ").concat(n," registry")),o||s(t)}return t=o.default(),p.add=a,p.get=s,p.has=l,p.remove=u,p.getKeys=c,p.getValues=d,p.default=f,p.register=a,p}function pt(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function ht(e){return(e=pt(Math.abs(e)))?e[1]:NaN}tt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:et(this,this._t0,Qe(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,et(this,Qe(this,n=Ze(this,e,t)),n);break;default:et(this,this._t0,n=Ze(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(nt.prototype=Object.create(tt.prototype)).point=function(e,t){tt.prototype.point.call(this,t,e)},rt.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}},it.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=ot(e),i=ot(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[a],t[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},at.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var mt,gt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function vt(e){if(!(t=gt.exec(e)))throw new Error("invalid format: "+e);var t;return new yt({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function yt(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function bt(e,t){var n=pt(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}vt.prototype=yt.prototype,yt.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var xt={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return bt(100*e,t)},r:bt,s:function(e,t){var n=pt(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(mt=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+pt(e,Math.max(0,t+o-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function wt(e){return e}var kt,Ct,St,Et=Array.prototype.map,Mt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Tt(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?wt:(t=Et.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?wt:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(Et.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",u=void 0===e.minus?"-":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=vt(e)).fill,n=e.align,d=e.sign,f=e.symbol,p=e.zero,h=e.width,m=e.comma,g=e.precision,v=e.trim,y=e.type;"n"===y?(m=!0,y="g"):xt[y]||(void 0===g&&(g=12),v=!0,y="g"),(p||"0"===t&&"="===n)&&(p=!0,t="0",n="=");var b="$"===f?i:"#"===f&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",x="$"===f?o:/[%p]/.test(y)?l:"",w=xt[y],k=/[defgprs%]/.test(y);function C(e){var i,o,l,f=b,C=x;if("c"===y)C=w(e)+C,e="";else{var S=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:w(Math.abs(e),g),v&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),S&&0==+e&&"+"!==d&&(S=!1),f=(S?"("===d?d:u:"-"===d||"("===d?"":d)+f,C=("s"===y?Mt[8+mt/3]:"")+C+(S&&"("===d?")":""),k)for(i=-1,o=e.length;++i<o;)if(48>(l=e.charCodeAt(i))||l>57){C=(46===l?a+e.slice(i+1):e.slice(i))+C,e=e.slice(0,i);break}}m&&!p&&(e=r(e,1/0));var E=f.length+e.length+C.length,M=E<h?new Array(h-E+1).join(t):"";switch(m&&p&&(e=r(M+e,M.length?h-C.length:1/0),M=""),n){case"<":e=f+e+C+M;break;case"=":e=f+M+e+C;break;case"^":e=M.slice(0,E=M.length>>1)+f+e+C+M.slice(E);break;default:e=M+f+e+C}return s(e)}return g=void 0===g?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),C.toString=function(){return e+""},C}return{format:d,formatPrefix:function(e,t){var n=d(((e=vt(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(ht(t)/3))),i=Math.pow(10,-r),o=Mt[8+r/3];return function(e){return n(i*e)+o}}}}!function(e){kt=Tt(e),Ct=kt.format,St=kt.formatPrefix}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});var Dt=new Date,_t=new Date;function Nt(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<r);return s},i.filter=function(n){return Nt((function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return Dt.setTime(+t),_t.setTime(+r),e(Dt),e(_t),Math.floor(n(Dt,_t))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var qt=864e5,Rt=6048e5,Pt=Nt((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/qt}),(function(e){return e.getDate()-1})),At=Pt;function It(e){return Nt((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/Rt}))}Pt.range;var Ot=It(0),Lt=It(1),zt=It(2),Ft=It(3),jt=It(4),Ht=It(5),Bt=It(6);Ot.range,Lt.range,zt.range,Ft.range,jt.range,Ht.range,Bt.range;var Vt=Nt((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));Vt.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Nt((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null};var Wt=Vt;Vt.range;var Ut=Nt((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/qt}),(function(e){return e.getUTCDate()-1})),$t=Ut;function Yt(e){return Nt((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/Rt}))}Ut.range;var Xt=Yt(0),Kt=Yt(1),Gt=Yt(2),Jt=Yt(3),Zt=Yt(4),Qt=Yt(5),en=Yt(6);Xt.range,Kt.range,Gt.range,Jt.range,Zt.range,Qt.range,en.range;var tn=Nt((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));tn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?Nt((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null};var nn=tn;function rn(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function on(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function an(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function sn(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,u=hn(i),c=mn(i),d=hn(o),f=mn(o),p=hn(a),h=mn(a),m=hn(s),g=mn(s),v=hn(l),y=mn(l),b={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:On,e:On,f:Hn,g:Zn,G:er,H:Ln,I:zn,j:Fn,L:jn,m:Bn,M:Vn,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:Cr,s:Sr,S:Wn,u:Un,U:$n,V:Xn,w:Kn,W:Gn,x:null,X:null,y:Jn,Y:Qn,Z:tr,"%":kr},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:nr,e:nr,f:sr,g:yr,G:xr,H:rr,I:ir,j:or,L:ar,m:lr,M:ur,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:Cr,s:Sr,S:cr,u:dr,U:fr,V:hr,w:mr,W:gr,x:null,X:null,y:vr,Y:br,Z:wr,"%":kr},w={a:function(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=h[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=v.exec(t.slice(n));return r?(e.m=y[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return S(e,t,n,r)},d:Mn,e:Mn,f:Rn,g:kn,G:wn,H:Dn,I:Dn,j:Tn,L:qn,m:En,M:_n,p:function(e,t,n){var r=u.exec(t.slice(n));return r?(e.p=c[r[0].toLowerCase()],n+r[0].length):-1},q:Sn,Q:An,s:In,S:Nn,u:vn,U:yn,V:bn,w:gn,W:xn,x:function(e,t,r){return S(e,n,t,r)},X:function(e,t,n){return S(e,r,t,n)},y:kn,Y:wn,Z:Cn,"%":Pn};function k(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,u=e.length;for(n instanceof Date||(n=new Date(+n));++s<u;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=ln[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function C(e,t){return function(n){var r,i,o=an(1900,void 0,1);if(S(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(t&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=on(an(o.y,0,1))).getUTCDay(),r=i>4||0===i?Kt.ceil(r):Kt(r),r=$t.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=rn(an(o.y,0,1))).getDay(),r=i>4||0===i?Lt.ceil(r):Lt(r),r=At.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?on(an(o.y,0,1)).getUTCDay():rn(an(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,on(o)):rn(o)}}function S(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a<s;){if(r>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=w[i in ln?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=k(n,b),b.X=k(r,b),b.c=k(t,b),x.x=k(n,x),x.X=k(r,x),x.c=k(t,x),{format:function(e){var t=k(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=C(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=k(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+="",!0);return t.toString=function(){return e},t}}}tn.range;var ln={"-":"",_:" ",0:"0"},un=/^\s*\d+/,cn=/^%/,dn=/[\\^$*+?|[\]().{}]/g;function fn(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function pn(e){return e.replace(dn,"\\$&")}function hn(e){return new RegExp("^(?:"+e.map(pn).join("|")+")","i")}function mn(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function gn(e,t,n){var r=un.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function vn(e,t,n){var r=un.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function yn(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function bn(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function xn(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function wn(e,t,n){var r=un.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function kn(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Cn(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Sn(e,t,n){var r=un.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function En(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Mn(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Tn(e,t,n){var r=un.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Dn(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function _n(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Nn(e,t,n){var r=un.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function qn(e,t,n){var r=un.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Rn(e,t,n){var r=un.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Pn(e,t,n){var r=cn.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function An(e,t,n){var r=un.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function In(e,t,n){var r=un.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function On(e,t){return fn(e.getDate(),t,2)}function Ln(e,t){return fn(e.getHours(),t,2)}function zn(e,t){return fn(e.getHours()%12||12,t,2)}function Fn(e,t){return fn(1+At.count(Wt(e),e),t,3)}function jn(e,t){return fn(e.getMilliseconds(),t,3)}function Hn(e,t){return jn(e,t)+"000"}function Bn(e,t){return fn(e.getMonth()+1,t,2)}function Vn(e,t){return fn(e.getMinutes(),t,2)}function Wn(e,t){return fn(e.getSeconds(),t,2)}function Un(e){var t=e.getDay();return 0===t?7:t}function $n(e,t){return fn(Ot.count(Wt(e)-1,e),t,2)}function Yn(e){var t=e.getDay();return t>=4||0===t?jt(e):jt.ceil(e)}function Xn(e,t){return e=Yn(e),fn(jt.count(Wt(e),e)+(4===Wt(e).getDay()),t,2)}function Kn(e){return e.getDay()}function Gn(e,t){return fn(Lt.count(Wt(e)-1,e),t,2)}function Jn(e,t){return fn(e.getFullYear()%100,t,2)}function Zn(e,t){return fn((e=Yn(e)).getFullYear()%100,t,2)}function Qn(e,t){return fn(e.getFullYear()%1e4,t,4)}function er(e,t){var n=e.getDay();return fn((e=n>=4||0===n?jt(e):jt.ceil(e)).getFullYear()%1e4,t,4)}function tr(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+fn(t/60|0,"0",2)+fn(t%60,"0",2)}function nr(e,t){return fn(e.getUTCDate(),t,2)}function rr(e,t){return fn(e.getUTCHours(),t,2)}function ir(e,t){return fn(e.getUTCHours()%12||12,t,2)}function or(e,t){return fn(1+$t.count(nn(e),e),t,3)}function ar(e,t){return fn(e.getUTCMilliseconds(),t,3)}function sr(e,t){return ar(e,t)+"000"}function lr(e,t){return fn(e.getUTCMonth()+1,t,2)}function ur(e,t){return fn(e.getUTCMinutes(),t,2)}function cr(e,t){return fn(e.getUTCSeconds(),t,2)}function dr(e){var t=e.getUTCDay();return 0===t?7:t}function fr(e,t){return fn(Xt.count(nn(e)-1,e),t,2)}function pr(e){var t=e.getUTCDay();return t>=4||0===t?Zt(e):Zt.ceil(e)}function hr(e,t){return e=pr(e),fn(Zt.count(nn(e),e)+(4===nn(e).getUTCDay()),t,2)}function mr(e){return e.getUTCDay()}function gr(e,t){return fn(Kt.count(nn(e)-1,e),t,2)}function vr(e,t){return fn(e.getUTCFullYear()%100,t,2)}function yr(e,t){return fn((e=pr(e)).getUTCFullYear()%100,t,2)}function br(e,t){return fn(e.getUTCFullYear()%1e4,t,4)}function xr(e,t){var n=e.getUTCDay();return fn((e=n>=4||0===n?Zt(e):Zt.ceil(e)).getUTCFullYear()%1e4,t,4)}function wr(){return"+0000"}function kr(){return"%"}function Cr(e){return+e}function Sr(e){return Math.floor(+e/1e3)}var Er=ft();Er("d3-number",(function(e,t,n){var r,i;function o(e){return i(e)}function a(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return r=Tt(t),i=r.format(e),this},a(),o.format=function(e,i,o,s){return(o||s)&&(t=o,n=s,a()),r.format(e)(i)},o.pattern=function(t){return t&&(e=t,i=r.format(t)),e},o})),Er("d3-time",(function(e){var t=sn({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),n=t.format(e);function r(e){return n(e)}return r.format=function(e,n){return t.format(e)(n)},r.locale=function(){return t=sn.apply(void 0,arguments),n=t.format(e),this},r.parse=function(e,n){return t.parse(e)(n)},r.parsePattern=function(e){return t.parse(e)},r}));var Mr={id:function(e){return"".concat(e.source,"/").concat(e.key||e.title)},key:function(e){return String(e.key||e.title)},tags:function(e){return e.tags},min:function(e){return e.min},max:function(e){return e.max},type:function(e){return e.type},title:function(e){return String(e.title)},values:function(e){return e.values},value:function(e){return e},label:function(e){return e},formatter:function(e){return function(e){if("function"==typeof e.formatter)return e.formatter();var t=e.formatter||{};return Er(t.type||"d3-number")(t.format||"")}(e)}};function Tr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.id,r=void 0===n?Mr.id:n,i=t.key,o=void 0===i?Mr.key:i,a=t.min,s=void 0===a?Mr.min:a,l=t.max,u=void 0===l?Mr.max:l,c=t.type,d=void 0===c?Mr.type:c,f=t.tags,p=void 0===f?Mr.tags:f,h=t.title,m=void 0===h?Mr.title:h,g=t.values,v=void 0===g?Mr.values:g,y=t.value,b=void 0===y?Mr.value:y,x=t.label,w=void 0===x?Mr.label:x,k=t.formatter,C=void 0===k?Mr.formatter:k,S={id:function(){return r(e)},key:function(){return o(e)},raw:function(){return e},tags:function(){return p(e)},type:function(){return d(e)},min:function(){return s(e)},max:function(){return u(e)},title:function(){return m(e)},items:function(){return v(e)},formatter:function(){return C(e)},value:b,label:w};return S}var Dr={diverging:function(e,t){if((s=e.length)>0)for(var n,r,i,o,a,s,l=0,u=e[t[0]].length;l<u;++l)for(o=a=0,n=0;n<s;++n)(i=(r=e[t[n]][l])[1]-r[0])>=0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):r[0]=o},none:st,silhouette:function(e,t){if((n=e.length)>0){for(var n,r=0,i=e[t[0]],o=i.length;r<o;++r){for(var a=0,s=0;a<n;++a)s+=e[a][r][1]||0;i[r][1]+=i[r][0]=-s/2}st(e,t)}},expand:function(e,t){if((r=e.length)>0){for(var n,r,i,o=0,a=e[0].length;o<a;++o){for(i=n=0;n<r;++n)i+=e[n][o][1]||0;if(i)for(n=0;n<r;++n)e[n][o][1]/=i}st(e,t)}},wiggle:function(e,t){if((i=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,i,o=0,a=1;a<r;++a){for(var s=0,l=0,u=0;s<i;++s){for(var c=e[t[s]],d=c[a][1]||0,f=(d-(c[a-1][1]||0))/2,p=0;p<s;++p){var h=e[t[p]];f+=(h[a][1]||0)-(h[a-1][1]||0)}l+=d,u+=f*d}n[a-1][1]+=n[a-1][0]=o,l&&(o-=u/l)}n[a-1][1]+=n[a-1][0]=o,st(e,t)}}},_r={ascending:function(e){var t=e.map(dt);return lt(e).sort((function(e,n){return t[e]-t[n]}))},insideout:function(e){var t,n,r=e.length,i=e.map(dt),o=function(e){var t=e.map(ct);return lt(e).sort((function(e,n){return t[e]-t[n]}))}(e),a=0,s=0,l=[],u=[];for(t=0;t<r;++t)n=o[t],a<s?(a+=i[n],l.push(n)):(s+=i[n],u.push(n));return u.reverse().concat(l)},none:lt,reverse:function(e){return lt(e).reverse()}};function Nr(e,t,n){for(var r={},i=t.stackKey,o=t.value,a=t.startProp||"start",s=t.endProp||"end",l=t.offset||"none",u=t.order||"none",c=t.valueRef||"",d=0,f={},p=0;p<e.items.length;p++){var h=e.items[p],m=c?h[c]:null;if(m&&m.source){var g="".concat(m.source.key||"","/").concat(m.source.field);f[g]||(f[g]=m.source)}var v=i(h);r[v]=r[v]||{items:[]},r[v].items.push(h),d=Math.max(d,r[v].items.length)}for(var y=Array.apply(null,{length:d}).map(Number.call,Number),b=Object.keys(r).map((function(e){return r[e].items})),x=function(){var e=he([]),t=lt,n=st,r=ut;function i(i){var o,a,s=e.apply(this,arguments),l=i.length,u=s.length,c=new Array(u);for(o=0;o<u;++o){for(var d,f=s[o],p=c[o]=new Array(l),h=0;h<l;++h)p[h]=d=[0,+r(i[h],f,h,i)],d.data=i[h];p.key=f}for(o=0,a=t(c);o<u;++o)c[a[o]].index=o;return n(c,a),c}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:he(Ve.call(t)),i):e},i.value=function(e){return arguments.length?(r="function"==typeof e?e:he(+e),i):r},i.order=function(e){return arguments.length?(t=null==e?lt:"function"==typeof e?e:he(Ve.call(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?st:e,i):n},i}().keys(y).value((function(e,t){return e[t]?o(e[t]):0})).order(_r[u]).offset(Dr[l])(b),w=[],k=0;k<x.length;k++)for(var C=x[k],S=0;S<C.length;S++){var E=C[S],M=C[S].data[C.key];M&&(M[a]={value:E[0]},M[s]={value:E[1]},w.push(E[0],E[1]))}var T=Object.keys(f).map((function(e){var t=n(f[e].key);return t?t.field(f[e].field):null})).filter((function(e){return!!e})),D=Tr({title:T.map((function(e){return e.title()})).join(", "),min:Math.min.apply(Math,w),max:Math.max.apply(Math,w),type:"measure",formatter:T[0]?T[0].formatter:void 0});e.fields.push(D)}function qr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={},i=n.logger;if(Array.isArray(e))r.items=e.map((function(e){return{value:e,label:String(e)}}));else if(e){if("collection"in e)r=q({},t.collection(e.collection));else{var o=t.dataset?t.dataset(e.source):null,a=e.value||function(e){return e},s=e.label||function(e){return e};if(e.groupBy||e.mapTo)i.warn('Deprecated "data" configuration',e),r.items=[];else if(e.hierarchy)r.root=o.hierarchy?o.hierarchy(e.hierarchy):null,r.fields=o.fields();else if(e.items)r.items=e.items.map((function(e){return{value:a(e),label:String(s(e))}}));else if(e.extract){var l=Array.isArray(e.extract)?e.extract:[e.extract];r.items=[];var u=[];l.forEach((function(e){var n=e.source?t.dataset(e.source):o;n&&(r.items=[].concat(X(r.items),X(n.extract(e))),void 0!==e.field&&u.push(n.field(e.field)))})),u.length&&(r.fields=u),e.amend&&Array.isArray(e.amend)&&(r.items=[].concat(X(r.items),X(e.amend)))}else if(void 0!==e.field&&o){var c=o.field(e.field);c&&(r.fields||(r.fields=[]),r.fields.push(c),"value"in e||(a=c.value||function(e){return e},s=c.label||function(e){return e},r.value=a),r.items=c.items().map((function(t){return{value:a(t),label:String(s(t)),source:{field:e.field}}})))}else e.fields&&e.fields.forEach((function(e){var n,i="object"===R(e)&&e.source?t.dataset(e.source):o;i&&((n="object"===R(e)&&void 0!==e.field?i.field(e.field):i.field(e))&&(r.fields||(r.fields=[]),r.fields.push(n)))}));r.items&&e.map&&(r.items=r.items.map(e.map))}e&&e.stack&&Nr(r,e.stack,t.dataset)}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&r.items&&(r.items=r.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&r.items&&(r.items=r.items.sort(e.sort)),r}function Rr(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:qr,i={};(e||[]).forEach((function(e){if(!e.key)throw new Error('Data collection is missing "key" property');if("object"===R(e.data)&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");i[e.key]=function(){return r(e.data,t,n)}}));var o=function(e){var t,n;if("string"==typeof e?t=e:"object"===R(e)&&(t=e.key,n=e),!(t in i))throw new Error("Unknown data collection: ".concat(t));"function"==typeof i[t]&&(i[t]=i[t]());var r=i[t];if(n&&n.fields&&n.fields.filter){var o=r.fields.filter(n.fields.filter);r.fields.length!==o.length&&(r=D(r,{fields:o}))}return r};return o}function Pr(e,t,n){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:qr;if(e.data){var o=i(e.data,t,n);if(o&&o.fields&&o.fields[0])return o.fields[0].formatter()}if(r=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(r)){var a=n.formatter.get(r)(e.format||"");return a}throw new Error("Formatter of type '".concat(r,"' was not found"))}function Ar(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Pr,i={};return{get:function(o){var a;return"string"==typeof o&&e[o]?a=o:"object"===R(o)&&"formatter"in o&&e[o.formatter]?a=o.formatter:"object"===R(o)&&"type"in o&&e[o.type]&&(a=o.type),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o||{},t,n)},all:function(){return Object.keys(e).forEach(this.get),i}}}function Ir(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var Or=function(e){return 1===e.length&&(e=function(e){return function(t,n){return Ir(e(t),n)}}(e)),{left:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)<0?r=o+1:i=o}return r},right:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)>0?i=o:r=o+1}return r}}}(Ir).right;function Lr(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r<i;)o[r]=e+r*n;return o}var zr=Math.sqrt(50),Fr=Math.sqrt(10),jr=Math.sqrt(2);function Hr(e,t,n){var r=(t-e)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=zr?10:o>=Fr?5:o>=jr?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=zr?10:o>=Fr?5:o>=jr?2:1)}function Br(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var Vr="$";function Wr(){}function Ur(e,t){var n=new Wr;if(e instanceof Wr)e.each((function(e,t){n.set(t,e)}));else if(Array.isArray(e)){var r,i=-1,o=e.length;if(null==t)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(t(r=e[i],i,e),r)}else if(e)for(var a in e)n.set(a,e[a]);return n}function $r(){}Wr.prototype=Ur.prototype={constructor:Wr,has:function(e){return Vr+e in this},get:function(e){return this[Vr+e]},set:function(e,t){return this[Vr+e]=t,this},remove:function(e){var t=Vr+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===Vr&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===Vr&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===Vr&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===Vr&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===Vr&&++e;return e},empty:function(){for(var e in this)if(e[0]===Vr)return!1;return!0},each:function(e){for(var t in this)t[0]===Vr&&e(this[t],t.slice(1),this)}};var Yr=Ur.prototype;$r.prototype={constructor:$r,has:Yr.has,add:function(e){return this[Vr+(e+="")]=e,this},remove:Yr.remove,clear:Yr.clear,values:Yr.keys,size:Yr.size,empty:Yr.empty,each:Yr.each};var Xr=Array.prototype,Kr=Xr.map,Gr=Xr.slice,Jr={name:"implicit"};function Zr(){var e=Ur(),t=[],n=[],r=Jr;function i(i){var o=i+"",a=e.get(o);if(!a){if(r!==Jr)return r;e.set(o,a=t.push(i))}return n[(a-1)%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=Ur();for(var r,o,a=-1,s=n.length;++a<s;)e.has(o=(r=n[a])+"")||e.set(o,t.push(r));return i},i.range=function(e){return arguments.length?(n=Gr.call(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return Zr(t,n).unknown(r)},Br.apply(i,arguments),i}function Qr(){var e,t,n=Zr().unknown(void 0),r=n.domain,i=n.range,o=[0,1],a=!1,s=0,l=0,u=.5;function c(){var n=r().length,c=o[1]<o[0],d=o[c-0],f=o[1-c];e=(f-d)/Math.max(1,n-s+2*l),a&&(e=Math.floor(e)),d+=(f-d-e*(n-s))*u,t=e*(1-s),a&&(d=Math.round(d),t=Math.round(t));var p=Lr(n).map((function(t){return d+e*t}));return i(c?p.reverse():p)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),c()):r()},n.range=function(e){return arguments.length?(o=[+e[0],+e[1]],c()):o.slice()},n.rangeRound=function(e){return o=[+e[0],+e[1]],a=!0,c()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(a=!!e,c()):a},n.padding=function(e){return arguments.length?(s=Math.min(1,l=+e),c()):s},n.paddingInner=function(e){return arguments.length?(s=Math.min(1,e),c()):s},n.paddingOuter=function(e){return arguments.length?(l=+e,c()):l},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),c()):u},n.copy=function(){return Qr(r(),o).round(a).paddingInner(s).paddingOuter(l).align(u)},Br.apply(c(),arguments)}function ei(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ti(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ni(){}var ri=.7,ii=1/ri,oi="\\s*([+-]?\\d+)\\s*",ai="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",si="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",li=/^#([0-9a-f]{3,8})$/,ui=new RegExp("^rgb\\("+[oi,oi,oi]+"\\)$"),ci=new RegExp("^rgb\\("+[si,si,si]+"\\)$"),di=new RegExp("^rgba\\("+[oi,oi,oi,ai]+"\\)$"),fi=new RegExp("^rgba\\("+[si,si,si,ai]+"\\)$"),pi=new RegExp("^hsl\\("+[ai,si,si]+"\\)$"),hi=new RegExp("^hsla\\("+[ai,si,si,ai]+"\\)$"),mi={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 gi(){return this.rgb().formatHex()}function vi(){return this.rgb().formatRgb()}function yi(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=li.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?bi(t):3===n?new Ci(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?xi(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?xi(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=ui.exec(e))?new Ci(t[1],t[2],t[3],1):(t=ci.exec(e))?new Ci(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=di.exec(e))?xi(t[1],t[2],t[3],t[4]):(t=fi.exec(e))?xi(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=pi.exec(e))?Ti(t[1],t[2]/100,t[3]/100,1):(t=hi.exec(e))?Ti(t[1],t[2]/100,t[3]/100,t[4]):mi.hasOwnProperty(e)?bi(mi[e]):"transparent"===e?new Ci(NaN,NaN,NaN,0):null}function bi(e){return new Ci(e>>16&255,e>>8&255,255&e,1)}function xi(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ci(e,t,n,r)}function wi(e){return e instanceof ni||(e=yi(e)),e?new Ci((e=e.rgb()).r,e.g,e.b,e.opacity):new Ci}function ki(e,t,n,r){return 1===arguments.length?wi(e):new Ci(e,t,n,null==r?1:r)}function Ci(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Si(){return"#"+Mi(this.r)+Mi(this.g)+Mi(this.b)}function Ei(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function Mi(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Ti(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new _i(e,t,n,r)}function Di(e){if(e instanceof _i)return new _i(e.h,e.s,e.l,e.opacity);if(e instanceof ni||(e=yi(e)),!e)return new _i;if(e instanceof _i)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new _i(a,s,l,e.opacity)}function _i(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Ni(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function qi(e){return function(){return e}}function Ri(e){return 1==(e=+e)?Pi: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):qi(isNaN(t)?n:t)}}function Pi(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):qi(isNaN(e)?t:e)}ei(ni,yi,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:gi,formatHex:gi,formatHsl:function(){return Di(this).formatHsl()},formatRgb:vi,toString:vi}),ei(Ci,ki,ti(ni,{brighter:function(e){return e=null==e?ii:Math.pow(ii,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?ri:Math.pow(ri,e),new Ci(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Si,formatHex:Si,formatRgb:Ei,toString:Ei})),ei(_i,(function(e,t,n,r){return 1===arguments.length?Di(e):new _i(e,t,n,null==r?1:r)}),ti(ni,{brighter:function(e){return e=null==e?ii:Math.pow(ii,e),new _i(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?ri:Math.pow(ri,e),new _i(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ci(Ni(e>=240?e-240:e+120,i,r),Ni(e,i,r),Ni(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var Ai=function e(t){var n=Ri(t);function r(e,t){var r=n((e=ki(e)).r,(t=ki(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Pi(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function Ii(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function Oi(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=Vi(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}function Li(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function zi(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Fi(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=Vi(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var ji=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Hi=new RegExp(ji.source,"g");function Bi(e,t){var n,r,i,o=ji.lastIndex=Hi.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=ji.exec(e))&&(r=Hi.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:zi(n,r)})),o=Hi.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function Vi(e,t){var n,r=typeof t;return null==t||"boolean"===r?qi(t):("number"===r?zi:"string"===r?(n=yi(t))?(t=n,Ai):Bi:t instanceof yi?Ai:t instanceof Date?Li:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Ii:Array.isArray(t)?Oi:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Fi:zi)(e,t)}function Wi(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Ui(e){return+e}var $i=[0,1];function Yi(e){return e}function Xi(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function Ki(e){var t,n=e[0],r=e[e.length-1];return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function Gi(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=Xi(i,r),o=n(a,o)):(r=Xi(r,i),o=n(o,a)),function(e){return o(r(e))}}function Ji(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Xi(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=Or(e,t,1,r)-1;return o[n](i[n](t))}}function Zi(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Qi(e,t){return function(){var e,t,n,r,i,o,a=$i,s=$i,l=Vi,u=Yi;function c(){return r=Math.min(a.length,s.length)>2?Ji:Gi,i=o=null,d}function d(t){return isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(u(t)))}return d.invert=function(n){return u(t((o||(o=r(s,a.map(e),zi)))(n)))},d.domain=function(e){return arguments.length?(a=Kr.call(e,Ui),u===Yi||(u=Ki(a)),c()):a.slice()},d.range=function(e){return arguments.length?(s=Gr.call(e),c()):s.slice()},d.rangeRound=function(e){return s=Gr.call(e),l=Wi,c()},d.clamp=function(e){return arguments.length?(u=e?Ki(a):Yi,d):u!==Yi},d.interpolate=function(e){return arguments.length?(l=e,c()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,c()}}()(e,t)}function eo(e,t,n,r){var i,o=function(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=zr?i*=10:o>=Fr?i*=5:o>=jr&&(i*=2),t<e?-i:i}(e,t,n);switch((r=vt(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ht(t)/3)))-ht(Math.abs(e)))}(o,a))||(r.precision=i),St(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ht(t)-ht(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-ht(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return Ct(r)}function to(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){var r,i,o,a,s=-1;if(n=+n,(e=+e)==(t=+t)&&n>0)return[e];if((r=t<e)&&(i=e,e=t,t=i),0===(a=Hr(e,t,n))||!isFinite(a))return[];if(a>0)for(e=Math.ceil(e/a),t=Math.floor(t/a),o=new Array(i=Math.ceil(t-e+1));++s<i;)o[s]=(e+s)*a;else for(e=Math.floor(e*a),t=Math.ceil(t*a),o=new Array(i=Math.ceil(e-t+1));++s<i;)o[s]=(e-s)/a;return r&&o.reverse(),o}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return eo(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i=t(),o=0,a=i.length-1,s=i[o],l=i[a];return l<s&&(r=s,s=l,l=r,r=o,o=a,a=r),(r=Hr(s,l,n))>0?r=Hr(s=Math.floor(s/r)*r,l=Math.ceil(l/r)*r,n):r<0&&(r=Hr(s=Math.ceil(s*r)/r,l=Math.floor(l*r)/r,n)),r>0?(i[o]=Math.floor(s/r)*r,i[a]=Math.ceil(l/r)*r,t(i)):r<0&&(i[o]=Math.ceil(s*r)/r,i[a]=Math.floor(l*r)/r,t(i)),e},e}function no(){var e=Qi(Yi,Yi);return e.copy=function(){return Zi(e,no())},Br.apply(e,arguments),to(e)}function ro(){var e,t=[.5],n=[0,1],r=1;function i(i){return i<=i?n[Or(t,i,0,r)]:e}return i.domain=function(e){return arguments.length?(t=Gr.call(e),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(e){return arguments.length?(n=Gr.call(e),r=Math.min(t.length,n.length-1),i):n.slice()},i.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return ro().domain(t).range(n).unknown(e)},Br.apply(i,arguments)}function io(e){return void 0===e?function(e){return e}:function(t){return e(t)}}function oo(e){return Math.max(0,Math.min(1,e))}function ao(e){return"object"===R(e)}function so(e,t,n){for(var r=Math.abs(t-n)/(e+1),i=[],o=1;o<=e;o++){var a=o*r;i.push(t<n?t+a:t-a)}return i}function lo(e,t,n){if(1===e.length)return e;for(var r=e.concat([]),i=0;i<e.length;i++){var o=e[i],a=e[i+1];0===i&&o!==n.start()?(r.push.apply(r,X(so(t,o,a))),o-=a-o,a=e[i],r.push.apply(r,X(so(t,o,a)))):i===e.length-1&&a!==n.end()?(a=o+(o-e[i-1]),r.push.apply(r,X(so(t,o,a)))):r.push.apply(r,X(so(t,o,a)))}return r.filter((function(e){return e>=n.min()&&e<=n.max()}))}function uo(e){var t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,a=void 0===o?100:o,s=e.formatter,l=void 0===s?void 0:s,u=Q(a)||Q(t)?2:Math.max(t/a,2),c=Math.min(1e3,Math.round(u)),d=n.ticks(c);d.length<=1&&(d=n.ticks(c+1));var f=i>0?lo(d,i,n):d;f.sort((function(e,t){return e-t}));var p=f.map(io(l));return f.map((function(e,t){var r=n(e);return{position:r,start:r,end:r,label:p[t],value:e,isMinor:-1===d.indexOf(e)}}))}function co(e){var t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,a=void 0===o?100:o,s=e.formatter,l=void 0===s?void 0:s,u=Q(a)||Q(t)?2:Math.max(t/a,2),c=Math.min(1e3,Math.round(u)),d=c>10?10:c;n.nice(d);var f=n.ticks(c),p=i>0?lo(f,i,n):f;p.sort((function(e,t){return e-t}));var h=p.map(io(l));return p.map((function(e,t){var r=n(e);return{position:r,start:r,end:r,label:h[t],value:e,isMinor:-1===f.indexOf(e)}}))}function fo(e){var t,n=e.settings,r=e.scale,i=e.distance,o=e.formatter,a=void 0===o?function(e){return e}:o,s=n.minorTicks&&!Q(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values))t=function(e){var t=e.values,n=e.scale,r=e.formatter,i=void 0===r?function(e){return e}:r;return t.sort((function(e,t){return(ao(e)?e.value:e)-(ao(t)?t.value:t)})).filter((function(e,t,r){var i=ao(e)?e.value:e;return i<=n.max()&&i>=n.min()&&r.indexOf(e)===t})).map((function(e){var t=ao(e),r=t?e.value:e,o=n(r);return{position:o,value:r,label:t&&void 0!==e.label?e.label:i(r),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?oo(n(e.start)):o,end:t&&!isNaN(e.end)?oo(n(e.end)):o}}))}({values:n.ticks.values.filter((function(e){return"object"===R(e)?!Q(e.value):!Q(e)})),scale:r.copy(),formatter:a});else if(Q(n.ticks.count)){t=(n.ticks.tight?co:uo)({distance:i,minorCount:s,unitDivider:n.ticks.distance,scale:r,formatter:a}),n.ticks.forceBounds&&function(e,t,n){var r=e.map((function(e){return e.position})),i=t.range();-1===r.indexOf(i[0])?e.splice(0,0,{position:i[0],start:i[0],end:i[0],label:n(t.start()),isMinor:!1,value:t.start()}):e[0]&&e[0].isMinor&&(e[0].isMinor=!1);var o=e[e.length-1];-1===r.indexOf(i[1])?e.push({position:i[1],start:i[1],end:i[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,r,a)}else{t=function(e){var t=e.count,n=e.minorCount,r=e.scale,i=e.formatter;return r.ticks((t-1)*n+t).map((function(e,t){var o=r(e);return{position:o,start:o,end:o,label:i(e),isMinor:t%(n+1)!=0,value:e}}))}({count:Math.min(1e3,n.ticks.count),minorCount:s,scale:r.copy(),formatter:a})}return t}function po(e){var t=e.scale,n=t.domain(),r=t.data().items,i=t.labels?t.labels():n,o=t.bandwidth();return n.map((function(e,n){var a=t(e);return{position:a+o/2,label:"".concat(i[n]),data:r?r[n]:void 0,start:a,end:a+o}}))}function ho(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={};return Object.keys(t).forEach((function(i){var o=R(e[i]);r[i]="function"===o?e[i](n):"undefined"===o?t[i]:e[i]})),r}var mo={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},go={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},vo={count:NaN};function yo(e,t){var n=+e.min,r=+e.max,i=0,o=1;if(t&&t[0]){var a=t.map((function(e){return e.min()})).filter((function(e){return!isNaN(e)})),s=t.map((function(e){return e.max()})).filter((function(e){return!isNaN(e)}));if(i=a.length?Math.min.apply(Math,X(a)):Number.NaN,o=s.length?Math.max.apply(Math,X(s)):Number.NaN,isNaN(i)||isNaN(o))i=-1,o=1;else if(i===o&&0===i)i=-1,o=1;else if(i===o&&i)i-=Math.abs(.1*i),o+=Math.abs(.1*o);else if(!isNaN(e.expand)){var l=o-i;i-=l*e.expand,o+=l*e.expand}if(Array.isArray(e.include)){var u=e.include.filter((function(e){return!isNaN(e)}));i=Math.min.apply(Math,X(u).concat([i])),o=Math.max.apply(Math,X(u).concat([o]))}}return{mini:isNaN(n)?i:n,maxi:isNaN(r)?o:r}}function bo(e,t){e.instance||(e.instance=t.copy(),e.instance.domain([t.start(),t.end()]),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}function xo(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=no(),o={instance:null,invert:!1},a={data:n,resources:r},s=ho(t,mo,a);function l(e){return Q(e)?NaN:i(e)}s.ticks=ho(t.ticks,go,a),s.minorTicks=ho(t.minorTicks,vo,a),l.data=function(){return n},l.invert=function(e){return i.invert(e)},l.rangeRound=function(e){return i.rangeRound(e),l},l.clamp=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return i.clamp(e),l},l.cachedTicks=function(){return e},l.clearTicksCache=function(){return e=void 0,this},l.ticks=function(t){return null!==t&&"object"===R(t)?(t.settings=t.settings||{},t.settings=D(!0,{},s,t.settings),t.scale=l,e=fo(t)):e=i.ticks(t)},l.nice=function(e){return i.nice(e),l},l.tickFormat=function(e,t){return i.tickFormat(e,t)},l.interpolate=function(e){return i.interpolate(e),l},l.domain=function(e){return arguments.length?(i.domain(e),o.instance&&o.instance.domain([l.start(),l.end()]),l):i.domain()},l.range=function(e){return arguments.length?(i.range(e),l):i.range()},l.start=function(){return l.domain()[0]},l.end=function(){return l.domain()[this.domain().length-1]},l.min=function(){return Math.min(this.start(),this.end())},l.max=function(){return Math.max(this.start(),this.end())},l.classify=function(e){for(var t=(l.start()-l.end())/e,n=[l.end()],r=[],i=t/2,o=0;o<e;o++){var a=n[n.length-1]||0,s=a+t,u=l(a+i);n.push.apply(n,[s,s]),r.push.apply(r,[u,u])}return n.pop(),l.domain(n),l.range(r),l},l.copy=function(){var e=xo(t,n,r);return e.domain(l.domain()),e.range(l.range()),e.clamp(i.clamp()),e},l.norm=function(e){return bo(o,l),o.instance(e)},l.normInvert=function(e){return bo(o,l),o.instance.invert(e)};var u=yo(s,n?n.fields:[]),c=u.mini,d=u.maxi;return l.domain([c,d]),l.range(s.invert?[1,0]:[0,1]),o.invert=s.invert,l}var wo={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function ko(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={data:t,resources:n},i=ho(e,wo,r),o=t.items||[],a={},s=[],l=[];function u(e,n){e.data=function(){return t},e.datum=function(e){return o[a[e]]},e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=function(){return l},e.ticks=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,po(t,n.trackBy)}}var c=Qr();u(c,e),c.pxScale=function(t){var n=i.maxPxStep;if(isNaN(n))return c;var r=c.domain().length,o=Math.max(1,r-c.paddingInner()+2*c.paddingOuter());if(o*n>=t)return c;var a=c.copy();a.type=c.type,u(a,e);var s=o*n/t,l=(1-s)*c.align();return a.range(i.invert?[s+l,l]:[l,s+l]),a};for(var d="function"==typeof e.value?e.value:function(e){return e.datum.value},f="function"==typeof e.label?e.label:function(e){return e.datum.label},p=0;p<o.length;p++){var h=D({datum:o[p]},r),m=d(h,p);-1===s.indexOf(m)&&(s.push(m),l.push(f(h,p)),a[m]=p)}return c.domain(s),c.range(i.invert?i.range.slice().reverse():i.range),c.padding(isNaN(i.padding)?0:i.padding),isNaN(i.paddingInner)||c.paddingInner(i.paddingInner),isNaN(i.paddingOuter)||c.paddingOuter(i.paddingOuter),c.align(isNaN(i.align)?.5:i.align),c}var Co={depth:0};function So(e,t,n){return e.ancestors().map((function(e){return t(D({datum:e.data},n))})).reverse().slice(1).toString()}function Eo(e,t,n){var r=t.ticks.depth,i=t.value,o=t.label,a=[],s=[],l={},u=[],c=0;if(!e)return{values:a,labels:s,items:l,ticks:u};e.eachAfter((function(e){if(e.depth>0){var t=So(e,i,n),d=e.leaves()||[e],f=i(D({datum:e.data},n)),p=o(D({datum:e.data},n)),h=Array.isArray(e.children),m={key:t,count:d.length,value:f,label:p,leftEdge:So(d[0],i,n),rightEdge:So(d[Math.max(d.length-1,0)],i,n),node:e};h?(a.push("SPACER_".concat(c,"_SPACER")),c++):(a.push(t),s.push(p)),(r<=0&&!h||e.depth===r)&&u.push(m),l[t]=m}}));var d=e.height-1;return d>0&&a.splice(-d),{values:a,labels:s,items:l,ticks:u}}var Mo=function(e){return e.min()},To=function(e){return e.max()};function Do(e,t){var n=e&&!isNaN(e.min),r=e&&!isNaN(e.max),i=n?+e.min:0,o=r?+e.max:1;if(t&&t.length){if(!n){var a=t.map(Mo).filter(Z);i=a.length?Math.min.apply(Math,X(a)):i}if(!r){var s=t.map(To).filter(Z);o=s.length?Math.max.apply(Math,X(s)):o}}return[i,o]}var _o={domain:[],range:[],invert:!1,min:NaN,max:NaN};function No(e,t,n){var r=e.length;if(2===r)return[t,n];var i=[],o=(n-t)/(r-1);i.push(t);for(var a=1;a<r-1;a++)i.push(t+o*a);return i.push(n),i}function qo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=xo(e,t,n).clamp(!0).interpolate(Ai),i=ho(e,_o,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length,s=r;D(!0,s,r);var l=Do(i,t?t.fields:[]),u=Y(l,2),c=u[0],d=u[1],f=o?i.domain.length:-1,p=n.theme?n.theme.palette("sequential",f>0?f:2):[],h=a?i.range:p;return s.range(i.invert?h.slice().reverse():h.slice()),s.domain(o?i.domain:No(s.range(),c,d)),s}var Ro={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function Po(e,t,n){var r=e.length;if(2===r)return[t+(n-t)/2];for(var i=[],o=(n-t)/r,a=1;a<r;a++)i.push(t+o*a);return i}function Ao(e,t,n,r){n=e[0],r=e&&e.length>=2?e[e.length-1]:r;var i=qo().domain([n,r]).range(t);return[n].concat(X(function(e){for(var t=[],n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}(e)),[r]).map((function(e){return i(e)}))}function Io(e,t,n){var r=2===e.length?10:Math.max(1,e.length),i=no().domain([t,n]).nice(r).ticks(r);if(!e||!e.length)return i;for(var o=Math.max(0,e.length-1);i.length>o;)i[0]-t<=n-i[i.length-1]?i.shift():i.pop();return i}var Oo={domain:[],range:[]};function Lo(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Zr(),i={data:t,resources:n},o=ho(e,Oo,i),a="function"==typeof e.value?e.value:function(e){return e.datum.value},s="function"==typeof e.label?e.label:function(e){return e.datum.label},l=t.items||[],u={},c=[],d=[],f=0;f<l.length;f++){var p=D({datum:l[f]},i),h=a(p,f);-1===c.indexOf(h)&&(c.push(h),d.push(s(p,f)),u[h]=f)}return r.data=function(){return t},r.labels=function(){return d},r.label=function(e){return d[c.indexOf(e)]},r.datum=function(e){return l[u[e]]},r.range(o.range),Array.isArray(o.domain)&&o.domain.length?r.domain(o.domain):r.domain(c),r}var zo={domain:[],range:[],unknown:void 0},Fo={domain:[],range:[],override:!1};var jo=ft();function Ho(e,t,n){var r=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),r={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach((function(e){r.extract.push({field:e})})));var i,o=qr(r,t,n),a=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?-1!==e.fields.map((function(e){return"dimension"===e.type()?"band":"linear"})).indexOf("linear")?"linear":"band":"linear"}(o);return"color"===a&&(a=o.fields&&o.fields[0]&&"dimension"===o.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(a)&&((i=(i=n.scale.get(a))(e,o,{theme:n.theme,logger:n.logger})).type=a),i}function Bo(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ho,i={};return{get:function(o){var a;return"string"==typeof o&&e[o]?a=o:"object"===R(o)&&"scale"in o&&e[o.scale]&&(a=o.scale),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o,t,n)},all:function(){return Object.keys(e).forEach(this.get),i}}}jo("linear",xo),jo("band",ko),jo("h-band",(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i={data:n,resources:r},o=ho(t,wo,i);o.ticks=ho(t.ticks,Co,i),o.value="function"==typeof t.value?t.value:function(e){return e.datum.value},o.label="function"==typeof t.label?t.label:function(e){return e.datum.value};var a=ko(o),s=Eo(n.root,o,i),l=s.values,u=s.labels,c=s.items,d=s.ticks,f=function(e){var t=String(e),n=c[t];return a(n?o.invert?n.rightEdge:n.leftEdge:t)};D(!0,f,a),f.bandwidth=function(e){var t=c[String(e)],n=a.bandwidth();if(t&&!t.isLeaf){var r=f(t.leftEdge),i=f(t.rightEdge);return Math.abs(r-i)+n}return n},f.step=function(e){var t=c[String(e)],n=t?t.count:1,r=a.step();return r*=n},f.data=function(){return n},f.datum=function(e){var t=c[String(e)];return t?t.node.data:null},f.copy=function(){return e(t,n,r)},f.labels=function(){return u},f.ticks=function(){return d.map((function(e){var t=f(e.key),n=f.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}}))};var p=a.pxScale;return f.pxScale=function(e){return a=p(e),f},f.domain(l),f})),jo("sequential-color",qo),jo("threshold-color",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=ro(),i=ho(e,Ro,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length;function s(e){return Q(e)?NaN:r(e)}Object.keys(r).forEach((function(e){return s[e]=r[e]}));var l=t.fields,u=Do(i,l),c=Y(u,2),d=c[0],f=c[1],p=o?i.domain.length:-1,h=n.theme?n.theme.palette("sequential",p>0?p:2):[],m=a?i.range:h,g=[];return g=o?i.domain:i.nice?Io(m,d,f):[d+(f-d)/2],m.length>g.length+1?g=Po(m,d,f):m.length<g.length+1&&(m=Ao(g,m,d,f)),s.data=function(){return t},s.range(i.invert?m.slice().reverse():m),s.domain(g),s})),jo("categorical-color",(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Lo(t,n,r),o=r.theme,a=ho(t,zo,{data:n,resources:r});if(a.explicit=ho(t.explicit,Fo,{data:n,resources:r}),e=Array.isArray(a.range)&&0!==a.range.length?a.range.slice():o?o.palette("categorical",i.domain().length).slice():[],a.unknown)i.unknown(a.unknown);else if(o&&o.palette("unknown")){var s=o.palette("unknown");i.unknown(s[0])}if(Array.isArray(a.explicit.domain)&&a.explicit.domain.length){for(var l=i.domain().slice(),u=a.explicit.domain,c=Array.isArray(a.explicit.range)?a.explicit.range:[],d=Math.floor(l.length/e.length),f=1;f<d+1;f*=2)e=e.concat(e);if(a.explicit.override)for(var p=0;p<u.length;p++){var h=l.indexOf(u[p]);h>-1&&(e[h]=c[p])}else{var m=u.map((function(e,t){return[l.indexOf(e),e,c[t]]})).sort((function(e,t){return e[0]-t[0]}));m.forEach((function(t){var n=l.indexOf(t[1]);-1!==n&&e.splice(n,0,t[2])}))}e.length=l.length}return i.range(e),i}));var Vo={};function Wo(){Wo.init.call(this)}Vo.isObject=function(e){return"object"==typeof e&&null!==e},Vo.isNumber=function(e){return"number"==typeof e},Vo.isUndefined=function(e){return void 0===e},Vo.isFunction=function(e){return"function"==typeof e};var Uo=Wo;Wo.EventEmitter=Wo,Wo.prototype._events=void 0,Wo.prototype._maxListeners=void 0,Wo.defaultMaxListeners=10,Wo.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},Wo.prototype.setMaxListeners=function(e){if(!Vo.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},Wo.prototype.emit=function(e){var t,n,r,i,o,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],Vo.isUndefined(n))return!1;if(Vo.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(Vo.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(a=n.slice()).length,o=0;o<r;o++)a[o].apply(this,i)}return!0},Wo.prototype.addListener=function(e,t){var n;if(!Vo.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,Vo.isFunction(t.listener)?t.listener:t),this._events[e]?Vo.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,Vo.isObject(this._events[e])&&!this._events[e].warned)&&((n=Vo.isUndefined(this._maxListeners)?Wo.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,Vo.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),Vo.isFunction(console.trace)&&console.trace()));return this},Wo.prototype.on=Wo.prototype.addListener,Wo.prototype.once=function(e,t){if(!Vo.isFunction(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},Wo.prototype.removeListener=function(e,t){var n,r,i,o;if(!Vo.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||Vo.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(Vo.isObject(n)){for(o=i;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},Wo.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],Vo.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},Wo.prototype.listeners=function(e){return this._events&&this._events[e]?Vo.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},Wo.listenerCount=function(e,t){return e._events&&e._events[t]?Vo.isFunction(e._events[t])?1:e._events[t].length:0};var $o=function(e){return Object.keys(Uo.prototype).forEach((function(t){e[t]=Uo.prototype[t]})),Uo.init(e),e};function Yo(){var e=0,t=0,n=0,r=0;n=n||e;var i={move:function(e){this.moveTo(n+e)},moveTo:function(o){var a=Math.max(e,Math.min(t-r,o));n!==a&&(n=a,i.emit("update"))},update:function(o){var a=!1,s=o.min;e=void 0===s?e:s;var l=o.max;t=void 0===l?t:l,void 0!==o.viewSize&&o.viewSize!==r&&(r=o.viewSize,a=!0);var u=Math.max(e,Math.min(t-r,n));n!==u&&(n=u,a=!0),a&&i.emit("update")},getState:function(){return{min:e,max:t,start:n,viewSize:r}}};return $o(i),i}function Xo(e,t){var n=e.min||0,r=e.max||0,i=e.viewSize||0,o=t||Yo();return o.update({min:n,max:r,viewSize:i}),o}function Ko(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Xo(e[r],t?t[r]:null));return n}function Go(e,t){return t[e]||(t[e]=Yo()),t[e]}function Jo(e,t){return e<=t}function Zo(e,t){return e<t}function Qo(e,t,n){for(var r=0;r<e.length&&t>e[r];)++r;return e[r]===t&&n&&++r,r}function ea(e,t,n,r){for(var i=e.length,o=1;o<i;o+=2)if(n(e[o-1],t)&&r(t,e[o]))return!0;return!1}function ta(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=[];function i(){}return i.configure=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.includeMax,i=void 0===r||r,o=n.includeMin,a=void 0===o||o;e=i?Jo:Zo,t=a?Jo:Zo},i.add=function(e){var t,n=e.min,i=e.max,o=Qo(r,n),a=Qo(r,i,!0),s=[o,a-o];o%2==0&&s.push(n),a%2==0&&s.push(i);var l=r.join(",");return(t=r).splice.apply(t,s),l!==r.join(",")},i.remove=function(e){var t,n=e.min,i=e.max,o=Qo(r,n),a=Qo(r,i,!0),s=[o,a-o];o%2==1&&s.push(n),a%2==1&&s.push(i);var l=r.join(",");return(t=r).splice.apply(t,s),l!==r.join(",")},i.set=function(e){var t=r.join(",");return r=[],Array.isArray(e)?e.forEach(i.add):i.add(e),t!==r.join(",")},i.clear=function(){var e=r.length>0;return r=[],e},i.containsValue=function(n){return ea(r,n,t,e)},i.containsRange=function(e){var t=e.min,n=e.max,i=Qo(r,t,!0),o=Qo(r,n);return i===o&&o%2==1},i.toggle=function(e){return i.containsRange(e)?i.remove(e):i.add(e)},i.ranges=function(){for(var e=[],t=1;t<r.length;t+=2)e.push({min:r[t-1],max:r[t]});return e},i.configure(n),i}function na(){var e=[];function t(){}return t.add=function(t){return-1===e.indexOf(t)&&(e.push(t),!0)},t.remove=function(t){var n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=function(t){return-1!==e.indexOf(t)},t.values=function(){return e.slice()},t.clear=function(){return e=[]},t.toString=function(){return e.join(";")},t}var ra={key:void 0,includeMin:!0,includeMax:!0};function ia(e){for(var t,n,r=e.items,i=e.collection,o=e.vc,a={},s=[],l=0,u=r.length;l<u;l++){i[t=r[l].key]||(i[t]=o()),n=r[l].values||[r[l].value];for(var c=0;c<n.length;c++)i[t].add(n[c])&&(a[t]=a[t]||[],a[t].push(n[c]))}for(var d=Object.keys(a),f=0,p=d.length;f<p;f++)t=d[f],s.push({id:t,values:a[t]});return s}function oa(e){for(var t,n,r=e.items,i=e.collection,o={},a=[],s=0,l=r.length;s<l;s++)if(i[t=r[s].key]){n=r[s].values||[r[s].value];for(var u=0;u<n.length;u++)i[t].remove(n[u])&&(o[t]=o[t]||[],o[t].push(n[u]))}for(var c=Object.keys(o),d=0,f=c.length;d<f;d++)t=c[d],a.push({id:t,values:o[t]});return a}function aa(e){for(var t,n,r={},i=0,o=e.length;i<o;i++){t=e[i].key,n=e[i].values||[e[i].value],r[t]||(r[t]=[]);for(var a=0;a<n.length;a++){-1===r[t].indexOf(n[a])&&r[t].push(n[a])}}return r}function sa(e){var t=e.key,n=e.collection,r=e.obj,i=e.fn,o=e.value;n[t]||(n[t]=i()),r[t]=r[t]||[],r[t].push(o),n[t].add(o)}function la(e){for(var t,n,r,i=e.items,o=e.values,a=e.vc,s={},l={},u=[],c=[],d=aa(i),f=Object.keys(d),p=0,h=f.length;p<h;p++)for(var m=0,g=(r=d[t=f[p]]).length;m<g;m++)n=r[m],o[t]&&o[t].contains(n)?o[t]&&o[t].contains(n)&&(l[t]=l[t]||[],l[t].push(n),o[t].remove(n)):sa({key:t,value:n,collection:o,obj:s,fn:a});for(var v=Object.keys(s),y=0,b=v.length;y<b;y++)t=v[y],u.push({id:t,values:s[t]});for(var x=Object.keys(l),w=0,k=x.length;w<k;w++)t=x[w],c.push({id:t,values:l[t]});return[u,c]}function ua(e,t){for(var n,r,i=[],o=Object.keys(e),a=function(e){return-1===t[n].indexOf(e)},s=0,l=o.length;s<l;s++)n=o[s],t[n]?(r=e[n].filter(a)).length&&i.push({id:n,values:r}):i.push({id:n,values:e[n]});return i}function ca(e){for(var t,n,r=e.items,i=e.vCollection,o=e.vc,a={},s=aa(r),l={},u=Object.keys(i),c=0,d=u.length;c<d;c++)l[n=u[c]]=i[n].values().slice(),delete i[n];for(var f=function(e){i[n]&&i[n].contains(e)||sa({key:n,value:e,collection:i,obj:a,fn:o})},p=Object.keys(s),h=0,m=p.length;h<m;h++)s[n=p[h]].forEach(f);return t=ua(l,a),[ua(a,l),t]}function da(e,t,n){var r=function(e,t){if(!Object.keys(t).length)return e;for(var n=e.length,r=Array(n),i=0;i<n;i++)r[i]=e[i].key in t?D({},e[i],{key:t[e[i].key]}):e[i];return r}(t,n);return e&&e.length?e.reduce((function(e,t){return t(e)}),r):r}function fa(e){return e.replace(/(-[a-z])/g,(function(e){return e.toUpperCase().replace("-","")}))}function pa(e){return e.replace(/([A-Z])/g,(function(e){return"-".concat(e.toLowerCase())}))}function ha(e,t,n){var r=n.ranges,i=n.interceptors,o=n.rc,a=n.aliases,s=n.rangeConfig,l=da(i["".concat(t,"Ranges")],e,a),u=!1;return l.forEach((function(e){var n=e.key;if(r[n]||(r[n]=o(s.sources[n]||s.default)),"set"===t)u=r[n][t](e.ranges||e.range)||u;else for(var i=e.ranges||[e.range],a=0;a<i.length;a++)u=r[n][t](i[a])||u})),u}function ma(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vc,n=void 0===t?na:t,r=e.rc,i=void 0===r?ta:r,o=!1,a={},s={},l={},u={sources:{},default:D({},ra)},c={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},d=function(){var e={values:{},ranges:{}};return Object.keys(s).forEach((function(t){e.values[t]=s[t].values()})),Object.keys(a).forEach((function(t){e.ranges[t]=a[t].ranges()})),e},f={ls:[],clear:function(){this.ls.forEach((function(e){return e.clear()}))},start:function(){this.ls.forEach((function(e){return e.start()}))},end:function(){this.ls.forEach((function(e){return e.end()}))},update:function(){var e=d();this.ls.forEach((function(t){return t._state(e)}))},updateValues:function(){var e=d();this.ls.forEach((function(t){return t._state({values:e.values})}))},updateRanges:function(){var e=d();this.ls.forEach((function(t){return t._state({ranges:e.ranges})}))}},p={configure:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(u={sources:{},default:D({},ra)},e.ranges.forEach((function(e){var t={};Object.keys(ra).filter((function(e){return"key"!==e})).forEach((function(n){t[n]=void 0!==e[n]?e[n]:ra[n]})),void 0!==e.key?u.sources[e.key]=t:u.default=t})),Object.keys(a).forEach((function(e){return a[e].configure(u.sources[e]||u.default)})),p.emit("update",[],[]))},link:function(e){if(p===e)throw new Error("Can't link to self");f.ls.push(e),e._state(d())},_state:function(e){if(!e)return d();if(e.values){var t=[];Object.keys(e.values).forEach((function(n){s[n]&&e.values[n].join(";")===s[n].toString()||t.push({key:n,values:e.values[n]})})),Object.keys(s).forEach((function(n){e.values[n]||t.push({key:n,values:[]})})),t.length&&p.setValues(t)}if(e.ranges){var n=[];Object.keys(e.ranges).forEach((function(t){a[t]&&e.ranges[t].join(";")===a[t].toString()||n.push({key:t,ranges:e.ranges[t]})})),Object.keys(a).forEach((function(t){e.ranges[t]||n.push({key:t,ranges:[]})})),n.length&&p.setRanges(n)}},start:function(){if(!o){o=!0;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];p.emit.apply(p,["start"].concat(t)),f.start()}},end:function(){if(o){o=!1,a={},s={};for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];p.emit.apply(p,["end"].concat(t)),f.end()}},isActive:function(){return o},clear:function(){var e=p.brushes().filter((function(e){return"value"===e.type&&e.brush.values().length})).map((function(e){return{id:e.id,values:e.brush.values()}})),t=Object.keys(a).length>0||e.length;a={},s={},t&&(p.emit("update",[],e),f.clear())},brushes:function(){var e=[];return e=(e=e.concat(Object.keys(a).map((function(e){return{type:"range",id:e,brush:a[e]}})))).concat(Object.keys(s).map((function(e){return{type:"value",id:e,brush:s[e]}})))},addValue:function(e,t){p.addValues([{key:e,value:t}])},addValues:function(e){var t=da(c.addValues,e,l),r=ia({vc:n,collection:s,items:t});p.emit("add-values",t),r.length&&(o||(o=!0,p.emit("start")),p.emit("update",r,[]),f.updateValues())},setValues:function(e){var t=da(c.setValues,e,l),r=ca({items:t,vCollection:s,vc:n});p.emit("set-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,p.emit("start")),p.emit("update",r[0],r[1]),f.updateValues())},removeValue:function(e,t){p.removeValues([{key:e,value:t}])},removeValues:function(e){var t=da(c.removeValues,e,l),n=oa({collection:s,items:t});p.emit("remove-values",t),n.length&&(p.emit("update",[],n),f.updateValues())},addAndRemoveValues:function(e,t){var r=da(c.addValues,e,l),i=da(c.removeValues,t,l),a=ia({vc:n,collection:s,items:r}),u=oa({collection:s,items:i});p.emit("add-values",r),p.emit("remove-values",i),(a.length||u.length)&&(o||(o=!0,p.emit("start")),p.emit("update",a,u),f.updateValues())},toggleValue:function(e,t){p.toggleValues([{key:e,value:t}])},toggleValues:function(e){var t=da(c.toggleValues,e,l),r=la({items:t,values:s,vc:n});p.emit("toggle-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,p.emit("start")),p.emit("update",r[0],r[1]),f.updateValues())},containsValue:function(e,t){var n=l[e]||e;return!!s[n]&&s[n].contains(t)},addRange:function(e,t){p.addRanges([{key:e,range:t}])},addRanges:function(e){ha(e,"add",{ranges:a,rc:i,interceptors:c,aliases:l,rangeConfig:u})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),f.updateRanges())},removeRange:function(e,t){p.removeRanges([{key:e,range:t}])},removeRanges:function(e){ha(e,"remove",{ranges:a,rc:i,interceptors:c,aliases:l,rangeConfig:u})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),f.updateRanges())},setRange:function(e,t){p.setRanges([{key:e,range:t}])},setRanges:function(e){ha(e,"set",{ranges:a,rc:i,interceptors:c,aliases:l,rangeConfig:u})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),f.updateRanges())},toggleRange:function(e,t){p.toggleRanges([{key:e,range:t}])},toggleRanges:function(e){ha(e,"toggle",{ranges:a,rc:i,interceptors:c,aliases:l,rangeConfig:u})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),f.updateRanges())},containsRangeValue:function(e,t){var n=l[e]||e;return!!a[n]&&a[n].containsValue(t)},containsRange:function(e,t){var n=l[e]||e;return!!a[n]&&a[n].containsRange(t)},containsMappedData:function(e,t,n){for(var r,i,o,u,c=[],d=Object.keys(e),f=0,p=d.length;f<p;f++){if("value"===(r=d[f]))i=e,c[f]={key:"",i:f,bool:!1};else{if("source"===r)continue;i=e[r],c[f]={key:r,i:f,bool:!1}}void 0!==(o=i.source&&i.source.field)&&(void 0!==i.source.key&&(o="".concat(i.source.key,"/").concat(o)),o in l&&(o=l[o]),u=i.value,a[o]?c[f].bool=Array.isArray(u)?a[o].containsRange({min:u[0],max:u[1]}):a[o].containsValue(u):s[o]&&s[o].contains(u)&&(c[f].bool=!0))}return t?(c=c.filter((function(e){return-1!==t.indexOf(e.key)})),"and"===n?!!c.length&&!c.some((function(e){return!1===e.bool})):"xor"===n?!!c.length&&c.some((function(e){return e.bool}))&&c.some((function(e){return!1===e.bool})):c.some((function(e){return e.bool}))):c.some((function(e){return e.bool}))},intercept:function(e,t){var n=fa(e);c[n]&&c[n].push(t)},removeInterceptor:function(e,t){var n=fa(e);if(c[n]){var r=c[n].indexOf(t);-1!==r&&c[n].splice(r,1)}},removeAllInterceptors:function(e){var t=[];if(e){var n=fa(e);c[n]&&c[n].length&&t.push({name:e,handlers:c[n]})}else Object.keys(c).forEach((function(e){c[e].length&&t.push({name:pa(e),handlers:c[e]})}));t.forEach((function(e){e.handlers.slice().forEach((function(t){return p.removeInterceptor(e.name,t)}))}))},addKeyAlias:function(e,t){l[e]=t},removeKeyAlias:function(e){delete l[e]}};return $o(p),p}function ga(e){return e*e*e}function va(e){return--e*e*e+1}function ya(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}function ba(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}ft();var xa={shouldBeRemoved:!1,isInit:!1};function wa(e,t,n){var r,i=e.old,o=e.current,a=t.renderer,s=[],l={nodes:[],ips:[]},u={nodes:[],ips:[]},c={nodes:[],ips:[]},d=[],f=null,p=n.trackBy||ba,h={start:function(){var e={};if(i.forEach((function(t,n){var r=p(t,n);e[r]=t})),o.forEach((function(t,n){var r=p(t,n);e[r]?(c.ips.push(Fi(e[r],t)),c.nodes.push(t),s.push(e[r]),e[r]=!1):(l.nodes.push(t),l.ips.push(Fi(D({},t,{r:.001,opacity:0}),t)))})),Object.keys(e).forEach((function(t){e[t]&&(u.nodes.push(e[t]),u.ips.push(Fi(e[t],D({},e[t],{r:1e-4,opacity:0}))))})),d.push({name:"exiting",easing:ga,duration:200,tweens:u.ips,nodes:[].concat(s)}),d.push({name:"updating",easing:ya,duration:400,tweens:c.ips,nodes:[]}),d.push({name:"entering",easing:va,duration:200,tweens:l.ips,nodes:X(c.nodes)}),n.isMainComponent){var t,m=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,g=m?s.filter(m).length:s.length;!1===xa.isInit?(xa.shouldBeRemoved=0===g,xa.isInit=!0):xa.shouldBeRemoved=xa.shouldBeRemoved&&0===g}d.length&&(f=a.getScene(o),d[0].started=Date.now(),"undefined"!=typeof window&&(r=window.requestAnimationFrame(h.tick)))},tick:function(){var e=d[0];e||h.stop(),e.started||(e.started=Date.now());var t=(Date.now()-e.started)/e.duration,n=[],i=e.tweens.map((function(n){return n(e.easing(Math.min(1,t)))}));n.push.apply(n,X(i)),n.push.apply(n,X(e.nodes)),a.render(n),t>=1&&(d.shift(),d.length?"updating"===d[0].name&&xa.shouldBeRemoved&&d.shift():(!0===xa.isInit&&(xa.isInit=!1),h.stop())),r&&(r=window.requestAnimationFrame(h.tick))},stop:function(){r&&(window.cancelAnimationFrame(r),r=!1)},inProgress:function(){return!!r},get targetScene(){return f}};return h}var ka={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},Ca=/^\$/;function Sa(e){var t=R(e);return"object"!==t&&"function"!==t&&"undefined"!==t}function Ea(e,t,n){var r=e[t];r&&r.scale&&r.scale.pxScale?r.scale=r.scale.pxScale(n):r&&r.pxScale&&(e[t]=r.pxScale(n))}function Ma(e,t){return e.pxScale?e.pxScale(t):e}var Ta={normalizeSettings:function(e,t,n){var r=D({},e),i=D({},t);return Object.keys(r).forEach((function(e){i[e]={};var o=r[e],a=R(o);if("function"==typeof o)i[e].fn=o;else if(Sa(o)){var s=t[e];"string"==typeof s&&Ca.test(s)&&(s=ka[s]);var l=R(s);i[e]="undefined"===l||l===a?o:s}else o&&"object"===R(o)&&("function"==typeof o.fn&&(i[e].fn=o.fn),void 0!==o.scale&&(i[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(i[e].ref=o.ref))})),Object.keys(t).forEach((function(e){if(!(e in r)){var n=t[e];"string"===R(n)&&Ca.test(n)?i[e]=ka[n]:i[e]=n}})),i},resolveForItem:function(e,t,n){for(var r={},i=Object.keys(t),o=i.length,a=e.datum,s=e.datum,l=0;l<o;l++){var u=i[l],c=t[u],d="object"===R(s)&&void 0!==c,f=d&&"string"==typeof c.ref,p=d&&u in s,h=f?s[c.ref]:p?s[u]:a;Sa(c)?r[u]=c:d&&c.fn?(c.scale&&(e.scale=c.scale),r[u]=c.fn.call(null,e,n)):d&&c.scale&&h?(r[u]=c.scale(h.value),c.scale.bandwidth&&(r[u]+=c.scale.bandwidth()/2)):f&&h?r[u]=h.value:c.fn?r[u]=c.fn.call(null,e,n):r[u]=c}return r},updateScaleSize:Ea};function Da(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ta,n={};function r(r){var i=r.data,o=r.settings,a=r.defaults,s=void 0===a?{}:a,l=r.scaled,u=n.norm=t.normalizeSettings(o,s,e.chart),c={scale:e.chart.scale,formatter:e.chart.formatter};l&&Object.keys(l).forEach((function(e){u[e]&&t.updateScaleSize(u,e,l[e])}));var d=[];if(!i||!Array.isArray(i.items)){var f={data:i,resources:c},p=t.resolveForItem(f,n.norm,-1);return{settings:n.norm,item:p}}for(var h,m=0,g=i.items.length;m<g;m++){h={datum:i.items[m],data:i,resources:c};var v=t.resolveForItem(h,n.norm,m);v.data=i.items[m],d.push(v)}return{settings:n.norm,items:d}}return{resolve:r}}function _a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce((function(e,t){return Array.isArray(t.children)?(e.push.apply(e,X(_a(t.children))),e):(e.push(t),e)}),[])}function Na(e,t){var n=t.context,r=t.data,i=t.style,o=t.filter,a=t.mode,s=e.chart.brush(n),l=r,u=i.active||{},c=i.inactive||{},d=[];Object.keys(u).forEach((function(e){d.push(e)})),Object.keys(c).forEach((function(e){-1===d.indexOf(e)&&d.push(e)}));var f=[],p=!1,h=function(){var t=_a(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=function(){for(var e,t=h(),n=t.length,r=!1,i="function"==typeof l?l({brush:s}):l,o=function(n){if(!(e=t[n].data))return"continue";t[n].__style||(t[n].__style={},d.forEach((function(e){t[n].__style[e]=t[n][e]})));var r=s.containsMappedData(e,i,a),o=f.indexOf(t[n]),l=!1;r&&-1===o?(f.push(t[n]),l=!0):r||-1===o||(f.splice(o,1),l=!0),t[n].needToUpdate=l||p,t[n].isActive=r},m=0;m<n;m++)o(m);for(var g=function(n){if(!(e=t[n].data))return"continue";if(t[n].needToUpdate){var i=D({},t[n],t[n].__style),o=t[n].isActive;d.forEach((function(e){t[n][e]=o&&e in u?"function"==typeof u[e]?u[e].call(null,i,f):u[e]:!o&&e in c?"function"==typeof c[e]?c[e].call(null,i,f):c[e]:t[n].__style[e]})),r=!0}delete t[n].needToUpdate},v=0;v<n;v++)g(v);return p=!1,r},g=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1},n=t.suppressRender,r=h(),i=r.length,o=function(e){if(!r[e].data)return"continue";r[e].__style=r[e].__style||{},d.forEach((function(t){r[e].__style[t]=r[e][t],t in c&&(r[e][t]="function"==typeof c[t]?c[t].call(null,r[e]):c[t])}))},a=0;a<i;a++)o(a);p=!0,f.length=0,n||e.renderer.render(e.nodes)},v=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1},n=t.suppressRender,r=h(),i=r.length,o=function(e){r[e].__style&&(Object.keys(r[e].__style).forEach((function(t){r[e][t]=r[e].__style[t]})),r[e].__style=void 0)},a=0;a<i;a++)o(a);f.length=0,n||e.renderer.render(e.nodes)},y=function(){if(m()){var t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return s.on("start",g),s.on("end",v),s.on("update",y),{isActive:function(){return s.isActive()},update:function(){f.length=0,p=!0,m()},cleanUp:function(){s.removeListener("start",g),s.removeListener("end",v),s.removeListener("update",y)}}}function qa(e){for(var t=e.nodes,n=e.action,r=e.chart,i=e.trigger,o=[],a=0;a<t.length;a++){var s=t[a].data;null!==s&&o.push(s)}!function(e){var t=e.dataPoints,n=e.action,r=e.chart,i=e.trigger;if(i){var o=i.data||[""],a={items:[],actionFn:"toggleRanges"},s={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(a.actionFn="".concat(n,"Ranges"),s.actionFn="".concat(n,"Values"));for(var l=function(e){var n=t[e];if(!n)return"continue";o.forEach((function(e){var t=n&&!e?n:n[e];if(t){var r={key:t.source.field};void 0!==t.source.key&&(r.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(r.range={min:t.value[0],max:t.value[1]},a.items.push(r)):(r.value=t.value,s.items.push(r))}}))},u=0;u<t.length;u++)l(u);i.contexts.forEach((function(e){a.items.length?r.brush(e)[a.actionFn](a.items):r.brush(e)[s.actionFn](s.items)}))}}({dataPoints:o,action:n,chart:r,trigger:i})}function Ra(e){var t=e.collisions,n=e.t,r=e.config,i=e.action,o=[],a=!1;return t.length>0&&(o=t,a=!0,"stop"===n.propagation&&(o=[t[t.length-1]])),qa({nodes:o.map((function(e){return e.node})),action:i,chart:r.chart,data:r.data,trigger:n}),a}function Pa(e,t,n){var r=n.element().getBoundingClientRect(),i=J(e)?function(e,t){return 1!==e.changedTouches.length?null:{x:e.changedTouches[0].clientX-t.left,y:e.changedTouches[0].clientY-t.top}}(e,r):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,r);return null===i||i.x<0||i.y<0||i.x>r.width||i.y>r.height?[]:(t.touchRadius>0&&J(e)?i={cx:i.x,cy:i.y,r:t.touchRadius}:t.mouseRadius>0&&!J(e)&&(i={cx:i.x,cy:i.y,r:t.mouseRadius}),n.itemsAt(i))}function Aa(e,t,n){return e?"function"==typeof e?e(t):e:n}function Ia(e){var t=e.e,n=e.t,r=e.config;return Ra({collisions:Pa(t,n,r.renderer),t:n,config:r,action:Aa(n.action,t,"toggle")})}function Oa(e){var t=e.e,n=e.t,r=e.config;return Ra({collisions:Pa(t,n,r.renderer),t:n,config:r,action:Aa(n.action,t,"set")})}var La={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",baseline:"dominant-baseline",dominantBaseline:"dominant-baseline",anchor:"text-anchor",textAnchor:"text-anchor",maxWidth:"maxWidth",transform:"transform",strokeDasharray:"stroke-dasharray",id:"id"};function za(e,t){Object.keys(La).forEach((function(n){var r=t[n];void 0!==r&&(e[La[n]]=r)}))}function Fa(e){for(var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="",r=0;r<e.length;r++){var i=e[r];n+=0===r?"M".concat(i.x," ").concat(i.y):"L".concat(i.x," ").concat(i.y),n+=" "}return t&&(n+="Z"),n}function ja(e,t,n,r){var i=n/2,o=e-r/2,a=t-r/2,s=e-i,l=t-i;return[{x:o,y:a},{x:o,y:l},{x:o+r,y:l},{x:o+r,y:a},{x:s+n,y:a},{x:s+n,y:a+r},{x:o+r,y:a+r},{x:o+r,y:l+n},{x:o,y:l+n},{x:o,y:a+r},{x:s,y:a+r},{x:s,y:a}]}function Ha(e){return-e/180*Math.PI}function Ba(e){return function(e){var t=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(t-e))*Math.sqrt(2),r=n*Math.cos(e),i=n*Math.sin(e);return{x1:r<0?1:0,y1:i<0?1:0,x2:r>=0?r:r+1,y2:i>=0?i:i+1}}(Ha(e))}function Va(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Wa(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ua(e,t){return{x:e.x*t,y:e.y*t}}function $a(e,t){return e.x-t.x}function Ya(e,t){return e.y-t.y}function Xa(e,t){return Math.pow($a(e,t),2)+Math.pow(Ya(e,t),2)}function Ka(e,t){return Math.sqrt(Xa(e,t))}function Ga(e,t){return e.x*t.x+e.y*t.y}function Ja(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0},r=Math.cos(t),i=Math.sin(t),o=Wa(e,n),a={x:r*o.x-i*o.y,y:i*o.x+r*o.y};return Va(a,n)}var Za={up:0,down:180,left:90,right:-90};function Qa(e){var t=e.x,n=e.y,r=e.size,i=r/2;return{type:"rect",x:t-i,y:n-i,width:r,height:r}}var es=ft();function ts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach((function(n){void 0!==La[n]&&"transform"!==n&&(e[n]=t[n])}))}es.add("circle",(function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}})),es.add("diamond",(function(e){var t=e.size,n=e.x-t/2,r=e.y-t/2;return{type:"path",fill:"black",d:Fa([{x:n,y:r+t/2},{x:n+t/2,y:r},{x:n+t,y:r+t/2},{x:n+t/2,y:r+t},{x:n,y:r+t/2}])}})),es.add("saltire",(function(e){var t=Ha(45),n=e.size/2,r=isNaN(e.width)?n/2:e.width,i=Math.min(r,n),o=e.size,a=Math.sin(Math.asin(-t))*(i/2);o+=2*(n/Math.sin(-t)-n),o-=2*a;var s={x:e.x,y:e.y};return{type:"path",fill:"black",d:Fa(ja(e.x,e.y,o,i).map((function(e){return Ja(e,t,s)})))}})),es.add("square",(function(e){var t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}})),es.add("triangle",(function(e){var t=e.size,n={x:e.x,y:e.y},r=Za[e.direction]||0,i=t/2,o=e.x-i,a=e.y-i,s=[{x:o,y:a+t},{x:o+i,y:a},{x:o+t,y:a+t},{x:o,y:a+t}],l=Ha(r);return{type:"path",fill:"black",d:Fa(s=s.map((function(e){return Ja(e,l,n)})))}})),es.add("line",(function(e){var t="vertical"===e.direction,n=e.size/2,r=e.x,i=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:r-(t?0:n),y1:i-(t?n:0),x2:r+(t?0:n),y2:i+(t?n:0),collider:Qa(e)}})),es.add("star",(function(e){for(var t=e.size,n=[],r=t/2,i=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,a=isNaN(e.startAngle)?90:e.startAngle,s=360/i,l=1;l<=i;l++){var u=s*l+a,c=Ha(u),d=Ha(u+s/2),f=Math.sin(c),p=Math.cos(c),h=Math.sin(d),m=Math.cos(d);n.push({x:e.x+p*r,y:e.y+f*r}),n.push({x:e.x+m*o,y:e.y+h*o})}return{type:"path",fill:"black",d:Fa(n)}})),es.add("n-polygon",(function(e){for(var t=[],n=e.size/2,r=Math.max(isNaN(e.sides)?6:e.sides,3),i=360/r,o=isNaN(e.startAngle)?0:e.startAngle,a=1;a<=r;a++){var s=Ha(i*a+o),l=Math.sin(s),u=Math.cos(s);t.push({x:e.x+u*n,y:e.y+l*n})}return{type:"path",fill:"black",d:Fa(t)}})),es.add("cross",(function(e){var t=e.x,n=e.y,r=e.size/2,i=isNaN(e.width)?r/2:e.width,o=Math.min(i,r);return{type:"path",fill:"black",d:Fa(ja(t,n,e.size,o))}})),es.add("bar",(function(e){var t={x:e.x,y:e.y},n="vertical"===e.direction,r=e.size/2,i=r/2/2,o=[{x:t.x-r,y:t.y+i},{x:t.x-r,y:t.y-i},{x:t.x+r,y:t.y-i},{x:t.x+r,y:t.y+i}];if(n){var a=Ha(90);o=o.map((function(e){return Ja(e,a,t)}))}var s=re(o);return s.type="rect",s.fill="black",s})),es.add("rect",(function(e){var t=e.x,n=e.y,r=e.size,i=void 0===e.width?r:e.width,o=void 0===e.height?r:e.height;return{type:"rect",fill:"black",x:t-i/2,y:n-o/2,width:i,height:o}}));var ns=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:es;return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.get(t.type);if(n){var r=n(t);return ts(r,t),void 0!==t.data&&(r.data=t.data),r}return n}};function rs(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.dock,r=void 0===n?"center":n,i=e.displayOrder,o=void 0===i?0:i,a=e.prioOrder,s=void 0===a?0:a,l=e.preferredSize,u=void 0===l?0:l,c=e.minimumLayoutMode,d=e.show,f=void 0===d||d;r=r||"center";var p={computePreferredSize:function(e){var n=e.inner,r=e.outer,i=e.children;return"function"==typeof u?u({inner:n,outer:r,children:i,dock:this.dock()},t):u},dock:function(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},displayOrder:function(e){return void 0!==e?(o=e,this):"function"==typeof o?o(t):o},prioOrder:function(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s},minimumLayoutMode:function(e){return void 0!==e?(c=e,this):"function"==typeof c?c(t):c},show:function(e){return void 0!==e?(f=e,this):"function"==typeof f?f(t):f}};return p}function is(e,t,n){var r=t.require,i=void 0===r?[]:r,o=t.mediator||{},a=n.settings,s=n.formatter,l=n.scale,u=n.data,c=n.renderer,d=n.chart,f=n.dockConfig,p=n.mediator,h=n.instance,m=n.rect,g=n.style,v=n.registries,y=n.resolver,b=n.update,x=n._DO_NOT_USE_getInfo,w=n.symbol,k=n.isVisible;e.emit=function(){},k&&(e.isVisible=k),Object.defineProperty(e,"settings",{get:a}),Object.defineProperty(e,"data",{get:u}),Object.defineProperty(e,"formatter",{get:s}),Object.defineProperty(e,"scale",{get:l}),Object.defineProperty(e,"mediator",{get:p}),Object.defineProperty(e,"style",{get:g}),Object.defineProperty(e,"registries",{get:v}),m&&Object.defineProperty(e,"rect",{get:m}),x&&(e._DO_NOT_USE_getInfo=x),Object.keys(t).forEach((function(n){var r;r=n,["on","preferredSize","created","beforeMount","mounted","resize","beforeUpdate","updated","beforeRender","render","beforeUnmount","beforeDestroy","destroyed","defaultSettings","data","settings","formatter","scale","chart","dockConfig","mediator","style","resolver","registries","_DO_NOT_USE_getInfo","symbol","isVisible"].some((function(e){return e===r}))||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])})),i.forEach((function(t){"renderer"===t?Object.defineProperty(e,"renderer",{get:c}):"chart"===t?Object.defineProperty(e,"chart",{get:d}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:f}):"instance"===t?Object.defineProperty(e,"instance",{get:h}):"update"===t&&b?Object.defineProperty(e,"update",{get:b}):"resolver"===t?Object.defineProperty(e,"resolver",{get:y}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:w})})),Object.keys(o).forEach((function(t){e.mediator.on(t,o[t].bind(e))}))}function os(e,t,n){var r=function(t){return e[t]?(n.warn("Deprecation Warning the ".concat(t," property should be moved into layout: {} property")),e[t]):e.layout?e.layout[t]:void 0},i={};return i.displayOrder=r("displayOrder"),i.dock=r("dock"),i.prioOrder=r("prioOrder"),i.minimumLayoutMode=r("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==i.displayOrder?i.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==i.prioOrder?i.prioOrder:e.layout.prioOrder,e.layout.dock=i.dock||e.layout.dock,e.layout.minimumLayoutMode=i.minimumLayoutMode||e.layout.minimumLayoutMode,i.show=e.show,i.preferredSize=t,i}function as(e,t,n){Object.keys(n.on||{}).forEach((function(r){e.eventListeners=e.eventListeners||[];var i=n.on[r].bind(e);e.eventListeners.push({event:r,listener:i}),t.on(r,i)})),e.emit=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.emit.apply(t,[e].concat(r))}}function ss(e,t){e.eventListeners&&(e.eventListeners.forEach((function(e){var n=e.event,r=e.listener;t.removeListener(n,r)})),e.eventListeners.length=0),e.emit=function(){}}function ls(e,t,n){return Va(function(e,t){var n=Ga(e,t)/Ga(t,t)||1;return{x:t.x*n,y:t.y*n}}(Wa(n,e),Wa(t,e)),e)}function us(e,t,n){return Ka(e,n)+Ka(t,n)-Ka(e,t)<1e-12}function cs(e,t){return e.x>=t.x&&e.x+e.width<=t.x+t.width&&e.y>=t.y&&e.y+e.height<=t.y+t.height}function ds(e){return e.x1===e.x2&&e.y1===e.y2}function fs(e){return e.width<=0||e.height<=0}function ps(e){return e.r<=0}function hs(e){return e.edges.length<=2}function ms(e,t){for(var n=0,r=t.edges.length;n<r;n++)if(!0===ks(e,ie(t.edges[n])))return!0;return!1}function gs(e,t){for(var n=t.numPolygons,r=t.polygons,i=0;i<n;i++){if(!0===qs(e,r[i]))return!0}return!1}function vs(e,t){return!ps(e)&&Xa({x:e.cx,y:e.cy},t)<=Math.pow(e.r,2)}function ys(e,t){if(fs(t)||ps(e))return!1;var n=t.width/2,r=t.height/2,i=t.x+n,o=t.y+r,a=e.r,s=e.cx,l=e.cy,u=Math.abs(s-i),c=Math.abs(l-o);return!(u>n+a||c>r+a)&&(u<=n||c<=r||Math.pow(u-n,2)+Math.pow(c-r,2)<=Math.pow(a,2))}function bs(e,t){if(ps(e)||ds(t))return!1;var n=Y(te(t),2),r=n[0],i=n[1];if(vs(e,r)||vs(e,i))return!0;var o={x:e.cx,y:e.cy},a=ls(r,i,o);return Xa(a,o)<=Math.pow(e.r,2)&&us(r,i,a)}function xs(e,t){if(hs(t)||ps(e))return!1;if(ws(t,{x:e.cx,y:e.cy}))return!0;for(var n=t.edges.length,r=0;r<n;r++){if(bs(e,ie(t.edges[r])))return!0}return!1}function ws(e,t){if(hs(e)||!Ms(e.boundingRect(),t))return!1;var n,r,i,o,a,s=t.x,l=t.y,u=e.vertices;for(n=!1,o=-1,i=(r=u.length)-1;++o<r;i=o){if(u[o].x===s&&u[o].y===l)return!0;if(u[o].y===u[i].y&&u[o].y===l&&(s-u[o].x)*(s-u[i].x)<=0)return!0;if(u[o].y<l&&l<=u[i].y||u[i].y<l&&l<=u[o].y){if(s===(a=(u[i].x-u[o].x)*(l-u[o].y)/(u[i].y-u[o].y)+u[o].x))return!0;s<a&&(n=!n)}}return n}function ks(e,t){if(hs(e))return!1;for(var n=0,r=e.edges.length;n<r;n++){if(Ds(t,ie(e.edges[n])))return!0}var i=Y(te(t),2),o=i[0],a=i[1];return ws(e,o)||ws(e,a)}function Cs(e,t){if(hs(e))return!1;for(var n=0,r=e.edges.length;n<r;n++){if(Ts(t,ie(e.edges[n])))return!0}var i=Y(ne(t),4),o=i[0],a=i[1],s=i[2],l=i[3];return ws(e,o)||ws(e,a)||ws(e,s)||ws(e,l)}function Ss(e,t){return!fs(e)&&!fs(t)&&(e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height)}function Es(e,t){return!fs(e)&&!fs(t)&&[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}].every((function(t){return Ms(e,t)}))}function Ms(e,t){return!fs(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function Ts(e,t){if(ds(t)||fs(e))return!1;var n=Y(te(t),2),r=n[0],i=n[1];if(Ms(e,r)||Ms(e,i))return!0;for(var o=ne(e),a=o.length,s=0;s<a;s++){if(Ds(ie([o[s],o[3!==s?s+1:0]]),t))return!0}return!1}function Ds(e,t){var n,r,i=Y(te(e),2),o=i[0],a=i[1],s=Y(te(t),2),l=s[0],u=s[1],c=$a(a,o),d=Ya(a,o),f=$a(u,l),p=Ya(u,l),h=$a(o,l),m=Ya(o,l),g=p*c-f*d,v=f*m-p*h,y=c*m-d*h;if(0===c&&0===d)return!1;if(0===f&&0===p)return!1;if(0===g){if(0===v&&0===y){if(0===c){if(0===d)return o.x===a.x&&o.y===a.y;n=Ya(l,o)/d,r=Ya(u,o)/d}else n=(l.x-o.x)/c,r=(u.x-o.x)/c;return!(n<0&&r<0||n>1&&r>1)}return!1}var b=v/g;return g=y/g,b>=0&&b<=1&&g>=0&&g<=1}function _s(e,t){if(ds(e))return!1;var n=Y(te(e),2);return us(n[0],n[1],t)}function Ns(e,t){var n=e.boundingRect(),r=t.boundingRect();return!!Ss(n,r)&&(Es(n,r)?ms(e,t):ms(t,e))}function qs(e,t){var n=e.boundingRect(),r=t.boundingRect();return!!Ss(n,r)&&(Es(r,n)?function(e,t){for(var n=e.numPolygons,r=e.polygons,i=0;i<n;i++)if(!0===Ns(t,r[i]))return!0;return!1}(e,t):function(e,t){for(var n=0,r=t.edges.length;n<r;n++)if(!0===As(e,ie(t.edges[n])))return!0;return!1}(e,t))}function Rs(e,t){if(ps(e))return!1;if(Ps(t,{x:e.cx,y:e.cy}))return!0;for(var n=t.numPolygons,r=t.polygons,i=0;i<n;i++)for(var o=r[i],a=o.edges.length,s=0;s<a;s++){if(bs(e,ie(o.edges[s])))return!0}return!1}function Ps(e,t){if(!Ms(e.boundingRect(),t))return!1;var n,r,i,o,a,s,l=t.x,u=t.y,c=e.numPolygons,d=!1;for(r=0;r<c;r++)for(a=-1,o=(i=(n=e.vertices[r]).length)-1;++a<i;o=a){if(n[a].x===l&&n[a].y===u)return!0;if(n[a].y===n[o].y&&n[a].y===u&&(l-n[a].x)*(l-n[o].x)<=0)return!0;if(n[a].y<u&&u<=n[o].y||n[o].y<u&&u<=n[a].y){if(l===(s=(n[o].x-n[a].x)*(u-n[a].y)/(n[o].y-n[a].y)+n[a].x))return!0;l<s&&(d=!d)}}return d}function As(e,t){var n=Y(te(t),2),r=n[0],i=n[1];if(Ps(e,r)||Ps(e,i))return!0;for(var o=e.numPolygons,a=e.polygons,s=0;s<o;s++)for(var l=a[s],u=0,c=l.edges.length;u<c;u++){if(Ds(t,ie(l.edges[u])))return!0}return!1}function Is(e,t){var n=Y(ne(t),4),r=n[0],i=n[1],o=n[2],a=n[3];if(Ps(e,r)||Ps(e,i)||Ps(e,o)||Ps(e,a))return!0;for(var s=e.numPolygons,l=e.polygons,u=0;u<s;u++)for(var c=l[u],d=0,f=c.edges.length;d<f;d++){if(Ts(t,ie(c.edges[d])))return!0}return!1}var Os=/^\$/,Ls="@extend";function zs(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function Fs(e,t,n){if("string"==typeof e){var r=t[e];return-1!==n.indexOf(e)&&zs(e),Os.test(r)?(n.push(e),Fs(r,t,n)):r}var i=e,o=D(!0,{},t,e),a={};if(e[Ls]){var s=e[Ls];-1!==n.indexOf(s)&&zs(s);var l=n.slice();l.push(s),i=D(!0,{},Fs(o[s],t,l),e)}return Object.keys(i).forEach((function(e){var t=n.slice();if(e!==Ls&&!Os.test(e)){a[e]=i[e];var r=a[e];Os.test(r)&&r in o?(-1!==n.indexOf(r)&&zs(r),t.push(r),"object"===R(r=o[r])||Os.test(r)&&r in o?a[e]=Fs(r,o,t):a[e]=r):"object"===R(r)&&(a[e]=Fs(r,o,t))}})),a}function js(e,t){return Fs(e,t,[])}function Hs(e){e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height)}function Bs(e,t){var n={x:0,y:0,width:0,height:0},r={x:0,y:0,width:0,height:0};return n.width=e.width||0,n.height=e.height||0,void 0!==t.size&&(n.width=isNaN(t.size.width)?n.width:t.size.width,n.height=isNaN(t.size.height)?n.height:t.size.height),void 0!==t.logicalSize?(r.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,r.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,r.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),r.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(r.width=n.width,r.height=n.height,r.preserveAspectRatio=!1),Hs(r),Hs(n),{logicalContainerRect:r,containerRect:n}}function Vs(e){var t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return D(!0,t,e),t.center.minWidthRatio=Math.min(Math.max(t.center.minWidthRatio,0),1),t.center.minHeightRatio=Math.min(Math.max(t.center.minHeightRatio,0),1),t.center.minWidth=Math.max(t.center.minWidth,0),t.center.minHeight=Math.max(t.center.minHeight,0),t}function Ws(e,t,n,r,i){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:r,margin:isNaN(i)?0:i}}function Us(e,t,n){if(void 0===e.cachedSize){var r,i=e.config.dock(),o=e.comp.preferredSize({inner:t,outer:n,dock:i});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},r="top"===i||"bottom"===i?o.height:"right"===i||"left"===i?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(r),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function $s(e,t){switch(t.config.dock()){case"top":e.y+=t.cachedSize,e.height-=t.cachedSize;break;case"bottom":e.height-=t.cachedSize;break;case"left":e.x+=t.cachedSize,e.width-=t.cachedSize;break;case"right":e.width-=t.cachedSize}}function Ys(e,t){var n=t.edgeBleed;n&&(e.left=Math.max(e.left,n.left||0),e.right=Math.max(e.right,n.right||0),e.top=Math.max(e.top,n.top||0),e.bottom=Math.max(e.bottom,n.bottom||0))}function Xs(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);var r=e.width-(t.x+t.width);r<n.right&&(t.width-=n.right-r),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);var i=e.height-(t.y+t.height);i<n.bottom&&(t.height-=n.bottom-i)}function Ks(e,t,n,r,i){var o=D({},t),a=D({},n);return $s(o,r),Ys(a,r),Xs(e,o,a),!!function(e,t,n){var r=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),i=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=r&&t.height>=i}(e,o,i)&&($s(t,r),Ys(n,r),!0)}function Gs(e){var t=e.layoutRect,n=e.visible,r=e.hidden,i=e.settings,o=Ws(t.x,t.y,t.width,t.height),a={left:0,right:0,top:0,bottom:0},s=n.slice();s.sort((function(e,t){return e.config.prioOrder()-t.config.prioOrder()}));for(var l=0;l<s.length;++l){var u=s[l];Us(u,o,t),Ks(t,o,a,u,i)||(r.push(s.splice(l,1)[0]),--l)}!function(e,t){if(0!==t.length)for(var n=0;n<e.length;++n){var r=e[n];r.referencedDocks.length&&r.referencedDocks.every((function(e){return t.some((function(t){return t.key===e}))}))&&t.push(e.splice(n,1)[0])}}(n,r);var c=n.filter((function(e){return-1!==s.indexOf(e)}));return n.length=0,n.push.apply(n,X(c)),Xs(t,o,a),o}function Js(e){return{x:e.margin.left+e.x*e.scaleRatio.x,y:e.margin.top+e.y*e.scaleRatio.y,width:e.width*e.scaleRatio.x,height:e.height*e.scaleRatio.y}}function Zs(e){var t;return re((t=[]).concat.apply(t,X(e.map(ne))))}function Qs(e){var t=e.visible,n=e.layoutRect,r=e.reducedRect,i=e.containerRect,o=e.translation,a=Ws(r.x,r.y,r.width,r.height),s=Ws(r.x,r.y,r.width,r.height),l={},u=t.slice(),c=u.slice().sort((function(e,t){return e.config.displayOrder()-t.config.displayOrder()}));return t.sort((function(e,t){if(e.referencedDocks.length>0&&t.referencedDocks.length>0)return 0;if(t.referencedDocks.length>0)return-1;if(e.referencedDocks.length>0)return 1;var n=e.config.displayOrder()-t.config.displayOrder();return 0===n?u.indexOf(e)-u.indexOf(t):n})).forEach((function(e){var t={},u={};switch(e.config.dock()){case"top":t.height=u.height=e.cachedSize,t.width=n.width,u.width=a.width,t.x=n.x,u.x=a.x,t.y=u.y=a.y-e.cachedSize,a.y-=e.cachedSize,a.height+=e.cachedSize;break;case"bottom":t.x=n.x,u.x=a.x,t.y=u.y=a.y+a.height,t.width=n.width,u.width=a.width,t.height=u.height=e.cachedSize,a.height+=e.cachedSize;break;case"left":t.x=u.x=s.x-e.cachedSize,t.y=n.y,u.y=s.y,t.width=u.width=e.cachedSize,t.height=n.height,u.height=s.height,s.x-=e.cachedSize,s.width+=e.cachedSize;break;case"right":t.x=u.x=s.x+s.width,t.y=n.y,u.y=s.y,t.width=u.width=e.cachedSize,t.height=n.height,u.height=s.height,s.width+=e.cachedSize;break;case"center":t.x=u.x=r.x,t.y=u.y=r.y,t.width=u.width=r.width,t.height=u.height=r.height;break;default:if(e.referencedDocks.length>0){var c=e.referencedDocks.map((function(e){return l[e]})).filter((function(e){return!!e}));c.length>0&&(t=Zs(c.map((function(e){return e.outerRect}))),u=Zs(c.map((function(e){return e.r}))))}}e.key&&(l[e.key]={r:u,outerRect:t}),function(e,t,n,r){var i={x:r.width/n.width,y:r.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){var a=i.x<i.y,s=Math.min(i.x,i.y);i.x=s,i.y=s;var l=a?"height":"width",u=(r[l]-n[l]*i.x)*n.align;o.left=a?0:u,o.top=a?u:0}e.scaleRatio=i,e.margin=o,t.scaleRatio=i,t.margin=o,n.scaleRatio=i,n.margin=o}(u,t,n,i),u.edgeBleed=e.edgeBleed,u.computed=Js(u),t.edgeBleed=e.edgeBleed,t.computed=Js(t),u.x+=o.x,u.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(u,t),e.cachedSize=void 0,e.edgeBleed=void 0})),c}function el(e,t,n){var r=e.layoutModes||{},i=t.minimumLayoutMode(),o=t.show();return o&&"object"===R(i)?o=r[i.width]&&r[i.height]&&n.width>=r[i.width].width&&n.height>=r[i.height].height:o&&void 0!==i&&(o=r[i]&&n.width>=r[i].width&&n.height>=r[i].height),o}function tl(e){if(!e.resize||"function"!=typeof e.resize)throw new Error("Component is missing resize function");if(!e.dockConfig&&!e.preferredSize)throw new Error("Component is missing preferredSize function")}function nl(e,t,n){for(var r=[],i=[],o=0;o<e.length;++o){var a=e[o];tl(a);var s=a.dockConfig,l=a.key,u=s.dock(),c=/@/.test(u)?u.split(",").map((function(e){return e.replace(/^\s*@/,"")})):[];el(t,s,n)?r.push({comp:a,key:l,config:s,referencedDocks:c}):i.push({comp:a,key:l,config:s,referencedDocks:c})}return[r,i]}var rl=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.hasKey&&r.key===t)return e[n]}return null},il=function e(t){return null==t?void 0:t.map((function(t){var n=t.instance.dockConfig();return{preferredSize:function(r){return n.computePreferredSize(q(q({},r),{},{children:e(t.children)}))}}}))},ol=function(e,t){return{visible:[],hidden:t,ordered:[]}},al=function(e){return function(t,n){var r,i=n.map((function(e,t){var n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:function(t){return n.computePreferredSize(q(q({},t),{},{children:il(e.children)}))}}})),o=function(e){return n[e.index]},a=null!==(r=e(t,i))&&void 0!==r?r:{},s=a.visible,l=void 0===s?i:s,u=a.hidden,c=void 0===u?[]:u,d=a.ordered,f=void 0===d?l:d;return{visible:l.map(o),hidden:c.map(o),ordered:f.map(o)}}},sl=function(e){var t,n=(t=Vs(e),{layout:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||isNaN(e.x)||isNaN(e.y)||isNaN(e.width)||isNaN(e.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};var r=Bs(e,t),i=r.logicalContainerRect,o=r.containerRect,a=Y(nl(n,t,i),2),s=a[0],l=a[1],u=Qs({visible:s,layoutRect:i,reducedRect:Gs({layoutRect:i,visible:s,hidden:l,settings:t}),containerRect:o,translation:{x:e.x,y:e.y}});return l.forEach((function(e){e.comp.visible=!1;var t=Ws();e.comp.resize(t,t)})),{visible:s.map((function(e){return e.comp})),hidden:l.map((function(e){return e.comp})),ordered:u.map((function(e){return e.comp}))}},settings:function(e){t=Vs(e)}});return al((function(e,t){return n.layout(e,t)}))},ll=function(e){return"function"==typeof e?al(e):sl(e)};function ul(e){var t=e.createComponent,n={},r=[],i=[],o=function e(n){var i=t(n);return i&&(r.push(i),n.components&&(i.children=n.components.map((function(t){return e(t)})).filter((function(e){return!!e})))),i},a=function e(t,n){for(var i=function(i){var o=t[i],a=n.find((function(e){return o.hasKey&&o.key===e.key}));a?o.children&&a.components&&e(o.children,a.components):(t.splice(i,1),function(e){var t=r.indexOf(e);-1!==t&&r.splice(t,1)}(o),o.children&&e(o.children,[]),o.instance.destroy())},o=t.length-1;o>=0;o--)i(o)},s=function e(t){var n=t.compList,r=t.data,i=t.excludeFromUpdate,a=t.formatters,s=t.scales;return t.settingsList.map((function(t){var l=rl(n,t.key);return i.indexOf(t.key)>-1?(delete l.updateWith,l):l?(t.rendererSettings&&"function"==typeof l.instance.renderer().settings&&l.instance.renderer().settings(t.rendererSettings),t.rendererSettings&&"function"==typeof t.rendererSettings.transform&&t.rendererSettings.transform()?(l.applyTransform=!0,l):(l.updateWith={formatters:a,scales:s,data:r,settings:t},t.components&&(l.children=e({compList:l.children||[],data:r,excludeFromUpdate:i,formatters:a,scales:s,settingsList:t.components})),l)):o(t)})).filter((function(e){return!!e}))},l=function e(t){var n=t.components,r=t.hidden,i=t.layoutFn,o=t.ordered,a=t.rect,s=t.visible,l=i(a,n),u=l.visible,c=l.hidden,d=l.ordered;s.push.apply(s,X(u)),r.push.apply(r,X(c)),o.push.apply(o,X(d)),u.forEach((function(t){if(t.children){var n,i,a=ll(null!==(n=null===(i=t.settings)||void 0===i?void 0:i.strategy)&&void 0!==n?n:{});e({components:t.children,hidden:r,layoutFn:a,ordered:o,rect:t.instance.getRect(),visible:s})}})),c.forEach((function(t){t.children&&e({components:t.children,hidden:r,layoutFn:ol,ordered:o,rect:null,visible:s})}))};return n.destroy=function(){r.forEach((function(e){return e.instance.destroy()})),r=[],i=[]},n.findComponentByKey=function(e){return rl(r,e)},n.forEach=function(e){r.forEach(e)},n.layout=function(e){var t=e.layoutSettings,n=e.rect,r=[],o=[],a=[],s=ll(t);return l({components:i,hidden:o,layoutFn:s,ordered:a,rect:n,visible:r}),{visible:r,hidden:o,ordered:a}},n.set=function(e){var t=e.components;i=t.map((function(e){return o(e)})).filter((function(e){return!!e}))},n.update=function(e){var t=e.components,n=e.data,r=e.excludeFromUpdate,o=e.formatters,l=e.scales;a(i,t),i=s({compList:i,data:n,excludeFromUpdate:r,formatters:o,scales:l,settingsList:t})},n}function cl(e,t,n){var r=t.left-n.left,i=t.top-n.top,o=oe(e),a=D(!0,{},e);switch(o){case"circle":a.cx+=r,a.cy+=i;break;case"polygon":for(var s=0,l=a.vertices.length;s<l;s++){var u=a.vertices[s];u.x+=r,u.y+=i}break;case"geopolygon":for(var c=0;c<a.vertices.length;c++)for(var d=a.vertices[c],f=0,p=d.length;f<p;f++){var h=d[f];h.x+=r,h.y+=i}break;case"line":a.x1+=r,a.y1+=i,a.x2+=r,a.y2+=i;break;case"point":case"rect":a.x+=r,a.y+=i}return a}function dl(e,t){var n=[],r=0;t.forEach((function(e){n.push(r),r++;var t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(r+=t.length)})),t.forEach((function(t,r){return function(e,t,n){var r=t.instance.renderer().element();if(!isNaN(n)&&r&&e&&e.children){var i=e.children[Math.max(0,n)];if(r!==i){var o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==i?(e.insertBefore(r,i),o&&o.forEach((function(t){e.insertBefore(t,r)}))):(o&&o.forEach((function(t){e.appendChild(t,r)})),e.appendChild(r))}}}(e,t,n[r])}))}function fl(e,t){var n=e.element,r=e.data,i=void 0===r?[]:r,o=e.settings,a=void 0===o?{}:o,s=e.on,l=void 0===s?{}:s,u=t.registries,c=t.logger,d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e,r=function(e){e.forEach((function(e){var n=Array.isArray(e.colors[0])?e.colors:[e.colors];t[e.key]={colors:n,sizes:n.map((function(e){return e?e.length:0}))}}))},i=function(e,n){var r=t[e];if(!r)return[];for(var i=r.sizes,o=0;o<i.length;o++)if(n<=i[o])return r.colors[o];return r.colors[i.length-1]},o={palette:function(e,t){return i(e,t)},setPalettes:r,style:function(e){return js(e,n)},setStyle:function(t){n=D({},e,t)}};return r(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),o}(t.style,t.palettes),f=[],p=D({},e),h=function(){var e={};return $o(e),e}(),m=[],g=null,v=null,y=null,b=[],x=function(){},w=function(){},k={},C=!1,S=ul({createComponent:function(e){return u.component.has(e.type)?{instance:function(e){var t,n,r,i,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=e.defaultSettings,l=void 0===s?{}:s,u=e._DO_NOT_USE_getInfo,c=void 0===u?function(){return{}}:u,d=a.chart,f=a.container,p=a.mediator,h=a.registries,m=a.theme,g=a.renderer,v=$o({}),y=a.settings||{},b=D(!0,{},l,y),x=[],w=Da({chart:d}),k=!1,C={nodes:[],chart:d,config:b.brush||{},renderer:null},S={tap:[],over:[]},E=[],M={},T=D({},y);function _(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){for(var i,o,a,s=void 0!==e[t],l=void 0!==y[t],u=arguments.length,c=new Array(u),d=0;d<u;d++)c[d]=arguments[d];return s&&("function"==typeof e[t]?i=(o=e[t]).call.apply(o,[M].concat(c)):r&&(i=e[t])),l&&("function"==typeof y[t]?i=(a=y[t]).call.apply(a,[T].concat(c)):r&&(i=y[t])),s||l||(i=n.call.apply(n,[M].concat(c))),i}}var N=_("preferredSize",(function(){return 0}),!0),P=_("resize",(function(e){return e.inner})),A=_("created"),I=_("beforeMount"),O=_("mounted"),L=_("beforeUnmount"),z=_("beforeUpdate"),F=_("updated"),j=_("beforeRender"),H=_("beforeDestroy"),B=_("destroyed"),V=e.render,W=function(){b.brush&&(b.brush.consume||[]).forEach((function(e){e.context&&e.style&&E.push(Na(C,e))}))},U=function(){b.brush&&(b.brush.trigger||[]).forEach((function(e){"over"===e.on?S.over.push(e):S.tap.push(e)}))};Object.defineProperty(C,"data",{get:function(){return x}});var $=b.renderer||e.renderer,Y=$?g||h.renderer($)():g||h.renderer()();"function"==typeof Y.settings&&Y.settings(b.rendererSettings),C.renderer=Y;var K={resources:d.logger?{logger:d.logger()}:{}},G=rs(os(b,N,d.logger()),K),J=function(e){e.key=b.key,e.element=Y.element()},Z=function(){};Z.dockConfig=function(){return G},Z.set=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(y=e.settings,b=D(!0,{},l,e.settings),G=rs(os(b,N,d.logger()),K),C.config=b.brush||{}),b.scale&&(t=d.scale(b.scale)),b.data){var r=b.rendererSettings,i="function"==typeof(null==r?void 0:r.progressive)&&r.progressive(),a=qr(b.data,{dataset:d.dataset,collection:d.dataCollection},{logger:d.logger()},d.dataCollection);i?i.isFirst?(x=a).items&&(x.items=X(a.items)):x.items&&(x.items=[].concat(X(x.items),X(a.items||[]))):x=a}else x=t?t.data():[];"string"==typeof b.formatter||"object"===R(b.formatter)?n=d.formatter(b.formatter):t&&t.data().fields&&(n=t.data().fields[0].formatter()),o=m.style(b.style||{})},Z.resize=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=P({inner:e,outer:t});i=n?Y.size(n):Y.size(e),T.rect=D(!0,{computedPhysical:i.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),i=D(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},i)},Z.getRect=function(){return T.rect};var Q,ee,te,ne=function(){var e=Y.renderArgs?Y.renderArgs.slice(0):[],t=b.rendererSettings,n=x,r="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return x.items&&r&&(n=q(q({},x),{},{items:x.items.slice(r.start,r.end)})),e.push({data:n}),e};function re(e){var t=b.rendererSettings,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?C.nodes=X(e||[]):C.nodes&&(C.nodes=[].concat(X(C.nodes),X(e||[]))):C.nodes=e}Z.beforeMount=I,Z.beforeRender=function(){j({size:i})},Z.render=function(){var e=V.call.apply(V,[M].concat(X(ne())));re(e),Y.render(e),Q=e,ee=T.rect.computed},Z.hide=function(){Z.unmount(),Y.size({x:0,y:0,width:0,height:0}),Y.clear()},Z.beforeUpdate=function(){z({settings:b,data:x})},Z.update=function(){te&&te.stop();var e=b,t=e.rendererSettings,n=e.brush,r=e.animations;if("function"==typeof(null==t?void 0:t.transform)&&t.transform())return Y.render(),void(Q=null);var i=V.call.apply(V,[M].concat(X(ne())));re(i),E.forEach((function(e){return e.cleanUp()})),E.length=0,S.tap=[],S.over=[],n&&(W(),U()),E.forEach((function(e){e.isActive()&&e.update()})),Q&&r&&("function"==typeof r.enabled?r.enabled():r.enabled)?(r.compensateForLayoutChanges&&r.compensateForLayoutChanges({currentNodes:Q,currentRect:T.rect.computed,previousRect:ee}),(te=wa({old:Q,current:i},{renderer:Y},r)).start()):Y.render(i),Q=i,ee=T.rect.computed,Y.setKey&&"string"==typeof y.key&&Y.setKey(y.key)},Z.updated=F,Z.destroy=function(){Z.unmount(),H(r),Y.destroy(),B(),r=null};var ie=function(e){C.nodes=e,E.forEach((function(e){e.isActive()&&e.update()})),Y.render(e)};return is(M,e,{settings:function(){return b},data:function(){return x},scale:function(){return t},formatter:function(){return n},renderer:function(){return Y},chart:function(){return d},dockConfig:function(){return G},mediator:function(){return p},instance:function(){return T},rect:function(){return T.rect},style:function(){return o},update:function(){return ie},registries:function(){return h},resolver:function(){return w},symbol:function(){return ns(h.symbol)}}),is(T,y,{settings:function(){return b},data:function(){return x},scale:function(){return t},formatter:function(){return n},renderer:function(){return Y},chart:function(){return d},dockConfig:function(){return G},mediator:function(){return p},style:function(){return o},_DO_NOT_USE_getInfo:c.bind(M),isVisible:function(){return k}}),Z.getBrushedShapes=function(e,t,n){var r=[];if(b.brush&&b.brush.consume){var i=d.brush(e),o=Y.findShapes("*");b.brush.consume.filter((function(t){return t.context===e})).forEach((function(e){for(var a=0;a<o.length;a++){var s=o[a];s.data&&i.containsMappedData(s.data,n||e.data,t)&&(J(s),r.push(s),o.splice(a,1),a--)}}))}return r},Z.findShapes=function(e){for(var t,n=(null!==(t=te)&&void 0!==t&&t.inProgress()?te.targetScene:Y).findShapes(e),r=0,i=n.length;r<i;r++)J(n[r]);return n},Z.shapesAt=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Y.itemsAt(e);t=n&&"stop"===n.propagation&&r.length>0?[r.pop().node]:r.map((function(e){return e.node}));for(var i=0,o=t.length;i<o;i++)J(t[i]);return t},Z.brushFromShapes=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[],qa({nodes:e,action:t.action||"toggle",trigger:t,chart:d,data:C.data})},Z.mount=function(){r=Y.element&&Y.element()?r:Y.appendTo(f),Y.setKey&&"string"==typeof y.key&&Y.setKey(y.key),b.brush&&(W(),U()),as(T,v,y),as(M,v,e),k=!0},Z.mounted=function(){return O(r)},Z.unmount=function(){[T,M].forEach((function(e){ss(e,v)})),S.tap=[],S.over=[],E.forEach((function(e){e.cleanUp()})),E.length=0,L(),k=!1},Z.onBrushTap=function(e){S.tap.forEach((function(t){Ia({e:e,t:t,config:C})&&"stop"===t.globalPropagation&&d.toggleBrushing(!0)}))},Z.onBrushOver=function(e){S.over.forEach((function(t){Oa({e:e,t:t,config:C})&&"stop"===t.globalPropagation&&d.toggleBrushing(!0)}))},Z.def=M,Z.ctx=T,Z.renderer=function(){return Y},Z.set({settings:y}),A(),Z}(u.component(e.type),{settings:e,chart:p,mediator:h,registries:u,theme:d,container:n}),settings:D(!0,{},e),key:e.key,hasKey:void 0!==e.key}:(c.warn("Unknown component: ".concat(e.type)),!1)}});function E(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};return function(){for(var r,i,o="function"==typeof e[t],a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];o?r=(i=e[t]).call.apply(i,[p].concat(s)):r=n.call.apply(n,[p].concat(s));return r}}var M=function(){var e;a.dockLayout?(c.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=a.dockLayout):e=a.strategy;var t=function(e){if("function"==typeof e.getBoundingClientRect){var t=e.getBoundingClientRect();return{x:0,y:0,width:t.width,height:t.height}}return{x:0,y:0,width:0,height:0}}(n);return S.layout({layoutSettings:e,rect:t})},T=E("created"),_=E("beforeMount"),N=E("mounted"),P=E("beforeUpdate"),A=E("updated"),I=E("beforeRender"),O=E("beforeDestroy"),L=E("destroyed"),z=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.partialData,i=t.formatters,o=void 0===i?{}:i,a=t.scales,s=void 0===a?{}:a,l=t.scroll,f=void 0===l?{}:l;x=se(e,{logger:c,types:u.data}),r||Object.keys(k).forEach((function(e){return k[e].clear()})),t.palettes&&d.setPalettes(t.palettes),t.style&&d.setStyle(t.style),w=Rr(t.collections,{dataset:x},{logger:c});var p={theme:d,logger:c};g=Bo(s,{dataset:x,collection:w},q(q({},p),{},{scale:u.scale})),v=Ar(o,{dataset:x,collection:w},q(q({},p),{},{formatter:u.formatter})),y=Ko(f,y)};function F(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={},r=e.filter((function(e){return!!e.key})).map((function(e){return e.key}));b.forEach((function(e){e.key&&-1!==r.indexOf(e.key)?t[e.key]=e:e.destroy()})),b=e.map((function(e){var r=e.key&&t[e.key]?t[e.key]:u.interaction(e.type)(p,h,n);return r.set(e),r}))}var j=function(e){var t=n.getBoundingClientRect(),r="clientX"in e?e.clientX:e.x,i="clientY"in e?e.clientY:e.y,o={x:r-t.left,y:i-t.top},a=[];return m.forEach((function(e){var t=e.instance.getRect();Ms(t.computedPhysical?t.computedPhysical:{x:t.margin.left+t.x*t.scaleRatio.x,y:t.margin.top+t.y*t.scaleRatio.y,width:t.width*t.scaleRatio.x,height:t.height*t.scaleRatio.y},o)&&a.push(e)})),a},H=function(){if(!f.length&&n){Object.keys(l).forEach((function(e){var t=l[e].bind(p);n.addEventListener(e,t),f.push({key:e,listener:t})}));var e={},t=function(t){t.touches?(e.x=t.touches[0].clientX,e.y=t.touches[0].clientY,e.multiTouch=t.touches.length>1):(e.x=t.clientX,e.y=t.clientY,e.multiTouch=!1),e.time=Date.now(),e.comps=j(e)},r=function(t){var n=e.comps||j(t);if(!n.every((function(e){return e.instance.def.disableTriggers}))&&("touchend"===t.type&&t.preventDefault(),function(e,t){var n=J(e),r=n?e.changedTouches[0]:e,i=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(r.clientX-t.x),a=isNaN(t.y)?0:Math.abs(r.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&a<=12&&i<=300}(t,e)))for(var r=n.length-1;r>=0;r--){if(n[r].instance.onBrushTap(t),C){C=!1;break}}},i=[];i.push({key:"mousedown",listener:t}),i.push({key:"mouseup",listener:r}),function(e){return"ontouchstart"in e&&"ontouchend"in e||navigator.maxTouchPoints>1}(n)&&(i.push({key:"touchstart",listener:t}),i.push({key:"touchend",listener:r})),i.push({key:"mousemove",listener:function(e){for(var t=j(e),n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),C){C=!1;break}}}}),i.forEach((function(e){n.addEventListener(e.key,e.listener),f.push(e)}))}},B=function(){f.forEach((function(e){var t=e.key,r=e.listener;return n.removeEventListener(t,r)})),f.length=0};return p.layoutComponents=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.excludeFromUpdate,n=void 0===t?[]:t;e.data&&(i=e.data),e.settings&&(a=e.settings,F(e.settings.interactions)),P(),z(i,a);var r=a,o=r.formatters,s=r.scales,l=r.components,u=void 0===l?[]:l;S.update({components:u,data:i,excludeFromUpdate:n,formatters:o,scales:s}),S.forEach((function(e){e.updateWith&&e.instance.set(e.updateWith)})),S.forEach((function(e){e.updateWith&&e.instance.beforeUpdate()})),M()},p.update=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.partialData,o=t.excludeFromUpdate,s=void 0===o?[]:o;t.data&&(i=t.data),t.settings&&(a=t.settings,F(t.settings.interactions)),P(),z(i,a,{partialData:r});var l=a,u=l.formatters,c=l.scales,d=l.components,f=void 0===d?[]:d;S.update({components:f,data:i,excludeFromUpdate:s,formatters:u,scales:c}),S.forEach((function(e){e.updateWith&&e.instance.set(e.updateWith)})),S.forEach((function(e){e.updateWith&&e.instance.beforeUpdate()}));var p,h=[],g=[];if(r)S.forEach((function(e){(e.updateWith||e.applyTransform)&&e.visible&&h.push(e)})),p=h;else{var v=M(),y=v.visible,b=v.hidden,x=v.ordered;m=y,p=y,e=x,y.forEach((function(e){e.updateWith&&e.visible?h.push(e):g.push(e)})),b.forEach((function(e){e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1}))}g.forEach((function(e){return e.instance.beforeMount()})),g.forEach((function(e){return e.instance.mount()})),p.forEach((function(e){return e.instance.beforeRender()})),p.forEach((function(e){(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()})),r||dl(n,e),g.forEach((function(e){return e.instance.mounted()})),h.forEach((function(e){return e.instance.updated()})),m.forEach((function(e){delete e.updateWith,e.visible=!0,e.applyTransform=!1})),A()},p.destroy=function(){O(),S.destroy(),B(),F(),delete p.update,delete p.destroy,L()},p.getAffectedShapes=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=[];return m.filter((function(e){return null==r||e.key===r})).forEach((function(r){var o=r.instance.getBrushedShapes(e,t,n);i=[].concat(X(i),X(o))})),i},p.findShapes=function(e){var t=[];return m.forEach((function(n){var r=n.instance.findShapes(e);t=[].concat(X(t),X(r))})),t},p.componentsFromPoint=function(e){return j(e).map((function(e){return e.instance.ctx}))},p.shapesAt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[],i=n.getBoundingClientRect(),o=m;if(Array.isArray(t.components)&&t.components.length>0){var a=t.components.map((function(e){return e.key}));o=m.filter((function(e){return-1!==a.indexOf(e.key)})).map((function(e){return{instance:e.instance,opts:t.components[a.indexOf(e.key)]}}))}for(var s=o.length-1;s>=0;s--){var l=o[s],u=l.instance.renderer().element().getBoundingClientRect(),c=cl(e,i,u),d=l.instance.shapesAt(c,l.opts),f=d.length>0&&"stop"===t.propagation;if((r=[].concat(X(r),X(d))).length>0&&f)return r}return r},p.brushFromShapes=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]},n=function(n){var r=t.components[n].key;m.filter((function(e){return r===e.key})).forEach((function(r){var i=e.filter((function(e){return e.key===r.key}));r.instance.brushFromShapes(i,t.components[n])}))},r=0;r<t.components.length;r++)n(r)},p.scroll=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Go(e,y)},p.dataset=function(e){return x(e)},p.dataCollection=function(e){return w(e)},p.scales=function(){return g.all()},p.formatters=function(){return v.all()},p.brush=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return k[e]||(k[e]=ma()),k[e]},p.scale=function(e){return g.get(e)},p.formatter=function(e){return v.get(e)},p.toggleBrushing=function(e){C=void 0!==e?e:!C},p.component=function(e){var t=S.findComponentByKey(e);return null==t?void 0:t.instance.ctx},p.logger=function(){return c},p.theme=function(){return d},Object.defineProperty(p,"interactions",{get:function(){return{instances:b,on:function(){H(),b.forEach((function(e){return e.on()}))},off:function(){B(),b.forEach((function(e){return e.off()}))}}}}),T(),n&&(_(),n.innerHTML="",function(){var e=a.components,t=void 0===e?[]:e;I(),z(i,a),S.set({components:t});var r=M(),o=r.visible,s=r.hidden,l=r.ordered;m=o,s.forEach((function(e){e.instance.hide(),e.visible=!1})),o.forEach((function(e){return e.instance.beforeMount()})),o.forEach((function(e){return e.instance.mount()})),o.forEach((function(e){return e.instance.beforeRender()})),o.forEach((function(e){return e.instance.render()})),o.forEach((function(e){return e.instance.mounted()})),o.forEach((function(e){e.visible=!0})),dl(n,l)}(),H(),F(a.interactions),N(n),p.element=n),p}var pl=function(e){var t=ft(e);return t.prio=function(e){return e?t.default(e[0]):[t.default()]},t.types=function(){return t.getKeys()},t},hl=ft();function ml(e,t){var n=t.cache;if("number"==typeof e)return n.fields[e];for(var r=0;r<n.fields.length;r++)if(n.fields[r].key()===e)return n.fields[r];for(var i=0;i<n.fields.length;i++)if(n.fields[i].title()===e)return n.fields[i];return null}var gl=function(e){return e.filter((function(e){return"number"==typeof e&&!isNaN(e)}))},vl=function(e){return e.reduce((function(e,t){return e+t}),0)},yl={first:function(e){return e[0]},last:function(e){return e[e.length-1]},min:function(e){var t=gl(e);return t.length?Math.min.apply(null,t):NaN},max:function(e){var t=gl(e);return t.length?Math.max.apply(null,t):NaN},sum:function(e){var t=gl(e);return t.length?t.reduce((function(e,t){return e+t}),0):NaN},avg:function(e){var t=gl(e),n=t.length;return n?vl(t)/n:NaN}};function bl(e,t,n,r){var i={},o=r.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach((function(a){var s=n[a],l=i[a]={};-1!==["number","string","boolean"].indexOf(R(s))?(l.type="primitive",l.value=s):"function"==typeof s?(l.type="function",l.value=s,l.label=s,l.field=o):"object"===R(s)&&(s.fields?l.fields=s.fields.map((function(n){return bl(e,t,{main:n},r).main})):void 0!==s.field?(l.type="field",l.field=t.field(s.field),l.value=l.field.value,l.label=l.field.label):o&&(l.value=o.value,l.label=o.label,l.field=o),"function"==typeof s.filter&&(l.filter=s.filter),void 0!==s.value&&(l.value=s.value),void 0!==s.label&&(l.label=s.label),"function"==typeof s.reduce?l.reduce=s.reduce:s.reduce?l.reduce=yl[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?yl[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=yl[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?yl[l.field.reduceLabel]:l.field.reduceLabel))})),i}function xl(e,t){var n=bl(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{}).main;return{props:bl(e,t,e.props||{},n),main:n}}function wl(e,t,n,r){for(var i,o=Array(e.length),a=Array(e.length),s=0;s<e.length;s++)i=r?e[s][r]:e[s],o[s]=i.value,a[s]=i.label;var l=t.reduce,u=t.reduceLabel,c=l?l(o):o,d={value:c,label:u?u(a,c):n?n(c):String(c)};return r&&e[0][r].source?(d.source=e[0][r].source,d):!r&&e[0].source?(d.source=e[0].source,d):d}function kl(e,t){var n=t.main,r=t.propsArr,i=t.props,o=[],a=n.field.formatter(),s={};return r.forEach((function(e){s[e]=i[e].field?i[e].field.formatter():function(e){return e}})),o.push.apply(o,X(e.map((function(e){var t=wl(e.items,n,a);return r.forEach((function(n){t[n]=wl(e.items,i[n],s[n],n)})),t})))),o}function Cl(e){var t=e.cfg,n=e.itemData,r=e.obj,i=e.target,o=e.tracker,a="function"===e.trackType?t.trackBy(n):n[t.trackBy],s=o[a];s||(s=o[a]={items:[],id:a},i.push(s)),s.items.push(r)}function Sl(e,t,n){var r=n.key,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 El(e,t){var n=Array.isArray(e)?e:[e],r=[];return n.forEach((function(e){void 0!==e.field&&function(){var n=t.field(e.field),i=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));for(var o=xl(e,t),a=o.props,s=o.main,l=Object.keys(a),u=!!e.trackBy,c=R(e.trackBy),d={},f=[],p=n.items(),h=[],m=function(t){var n=p[t];if(s.filter&&!s.filter(n))return"continue";var r=Sl(s,n,{key:i});l.forEach((function(e){var o=a[e],s=o.field?o.field.items()[t]:n;r[e]=Sl(o,s,{key:i})})),u&&Cl({cfg:e,itemData:n,obj:r,target:f,tracker:d,trackType:c}),h.push(r)},g=0;g<p.length;g++)m(g);r=[].concat(X(r),u?X(kl(f,{main:s,propsArr:l,props:a})):h)}()})),r}var Ml=function(e){return e.filter((function(e){return"number"==typeof e&&!isNaN(e)}))};var Tl=function(e){var t=e.key,n=e.data,r=e.cache,i=e.config;if(n){var o=n;"string"==typeof o&&(o=function(e){var t=e.data,n=e.config,r=t.split("\n"),i=r[0],o=r[1],a=",";if(n&&n.parse&&n.parse.delimiter)a=n.parse.delimiter;else if(i)for(var s=[/,/,/\t/,/;/],l=0;l<s.length;l++){var u=s[l];if(i&&o){if(u.test(i)&&u.test(o)&&i.split(u).length===o.split(u).length){a=u;break}}else u.test(i)&&(a=u)}return r.map((function(e){return e.split(a)}))}({data:n,config:i})),Array.isArray(o)&&function(e){var t,n=e.source,r=e.data,i=e.cache,o=e.config,a=r,s=o&&o.parse;Array.isArray(r[0])?s&&!1===s.headers?t=r[0].map((function(e,t){return t})):(t=r[0],a=r.slice(1)):t=Object.keys(r[0]);var l,u=!!s&&"function"==typeof s.row&&s.row,c=t;c=s&&"function"==typeof s.fields?s.fields(c.slice()):t.map((function(e){return{key:e,title:e}})),Array.isArray(r[0])?l=c.map((function(){return[]})):(l={},c.forEach((function(e){l[e.key]=[]})));for(var d=0;d<a.length;d++){var f=u?u(a[d],d,c):a[d];if(f)if(Array.isArray(f))for(var p=0;p<c.length;p++)l[p].push(f[p]);else for(var h=0;h<c.length;h++)l[c[h].key].push(f[c[h].key])}for(var m=Array.isArray(l)?function(e){return l[e]}:function(e){return l[c[e].key]},g=0;g<c.length;g++){var v=m(g),y=Ml(v),b=y.length>0,x=b?"measure":"dimension",w=b?Math.min.apply(Math,X(y)):NaN,k=b?Math.max.apply(Math,X(y)):NaN;i.fields.push(Tr(D({source:n,key:g,title:c[g].title,values:v,min:w,max:k,type:x},c[g]),{value:c[g].value,label:c[g].label}))}}({data:o,cache:r,source:t,config:i})}};function Dl(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=e.data,r=e.config,i={fields:[]},o={key:function(){return t},raw:function(){return n},field:function(e){return ml(e,{cache:i,matrix:n})},fields:function(){return i.fields.slice()},extract:function(e){return El(e,o)},hierarchy:function(){return null}};return Tl({key:t,data:n,config:r,cache:i}),o}Dl.util={normalizeConfig:xl,collect:kl,track:Cl};var _l=ft();_l.default("matrix"),_l("matrix",Dl),_l("default",Dl);var Nl=ft();function ql(e,t,n){return Math.max(e,Math.min(t,n))}function Rl(e){var t,n=e.item,r=e.value,i=e.boxCenter,o=e.rendWidth,a=e.rendHeight,s="x",l="y",u=o,c=a,d=r<.5?90:-90;return e.flipXY&&(s="y",l="x",u=a,c=o,d=r<.5?180:0),(0,e.symbol)(D({},n.oob,(O(t={},s,i*u),O(t,l,Math.max(n.oob.size/2,Math.min(r*c,c-n.oob.size/2))),O(t,"startAngle",d),t)))}function Pl(e){var t,n=e.item,r=e.boxWidth,i=e.boxPadding,o=e.rendWidth,a=e.rendHeight,s="x",l="y",u="width",c="height",d=o,f=a;e.flipXY&&(s="y",l="x",u="height",c="width",d=a,f=o);var p=function(e){var t=e.start,n=e.end,r=e.minPx,i=void 0===r?.1:r,o=e.maxPx,a=void 0===o?1:o,s=Math.max(t,n),l=Math.min(t,n),u=ql(-.1,1.2,s),c=ql(-.1,1.2,l),d=u*a-c*a,f=Math.max(i,d),p=(f-d)/2;return{actualDiff:f,startModifier:p,actualLow:c*a-p}}({start:n.start,end:n.end,minPx:n.box.minHeightPx,maxPx:f}),h=p.actualDiff,m=p.actualLow;return D({},n.box,(O(t={type:"rect"},s,(i+n.major)*d),O(t,l,m),O(t,c,h),O(t,u,r*d),O(t,"data",n.data||{}),O(t,"collider",{type:null}),t))}function Al(e){var t,n=e.item,r=e.from,i=e.to,o=e.boxCenter,a=e.rendWidth,s=e.rendHeight,l="x1",u="y1",c="x2",d="y2",f=a,p=s;return e.flipXY&&(l="y1",u="x1",c="y2",d="x2",f=s,p=a),D({},n.line,(O(t={type:"line"},d,Math.floor(r*p)),O(t,l,o*f),O(t,u,Math.floor(i*p)),O(t,c,o*f),O(t,"data",n.data||{}),O(t,"collider",{type:null}),t))}function Il(e){var t,n=e.item,r=e.key,i=e.position,o=e.width,a=e.boxCenter,s=e.rendWidth,l=e.rendHeight,u="x1",c="y1",d="x2",f="y2",p=s,h=l;e.flipXY&&(u="y1",c="x1",d="y2",f="x2",p=l,h=s);var m=o/2;return D({type:"line"},n[r],(O(t={},c,Math.floor(i*h)),O(t,u,(a-m)*p),O(t,f,Math.floor(i*h)),O(t,d,(a+m)*p),O(t,"r",m*p),O(t,"cx",a*p),O(t,"cy",i*h),O(t,"width",o*p),O(t,"data",n.data||{}),O(t,"collider",{type:null}),t))}function Ol(e,t,n){var r=t.box,i=r.width,o=r.maxWidthPx,a=r.minWidthPx,s=e>=0?1:-1,l=Math.min(s*e*i,isNaN(o)?n:o/n);return(l=isNaN(a)?l:Math.max(a/n,l))*s}Nl("native",(function(e,t,n){var r,i,o={chart:e,mediator:t,element:n},a=[],s=!0;function l(){"function"==typeof r.enable&&(r.enable=r.enable.bind(o)()),r.enable&&Object.keys(r.events).forEach((function(e){var t=r.events[e].bind(o);n.addEventListener(e,t),a.push({key:e,listener:t})}))}function u(){a.forEach((function(e){var t=e.key,r=e.listener;n.removeEventListener(t,r)})),a=[]}return{get key(){return i},set:function(e){!function(e){i=e.key,(r=e).events=r.events||[],void 0===r.enable&&(r.enable=!0)}(e),u(),s&&l()},off:function(){s=!1,u()},on:function(){s=!0,0===a.length&&l()},destroy:function(){u(),o=null,r=null}}}));var Ll={oob:{show:!0,type:"n-polygon",fill:"#999",stroke:"#000",strokeWidth:0,size:10,sides:3,startAngle:-90},box:{show:!0,fill:"#fff",stroke:"#000",strokeWidth:1,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1},line:{show:!0,stroke:"#000",strokeWidth:1},median:{show:!0,stroke:"#000",strokeWidth:1},whisker:{show:!0,stroke:"#000",strokeWidth:1,fill:"",type:"line",width:1}},zl=Object.keys(Ll),Fl={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created:function(){this.state={}},render:function(e){var t=this,n=e.data,r=this.rect,i=r.width,o=r.height,a="horizontal"===this.settings.settings.orientation,s=this.style,l=this.resolver,u=this.symbol,c=zl.filter((function(e){return!t.settings.settings[e]||!1!==t.settings.settings[e].show})),d={};c.forEach((function(e){return d[e]=Ll[e]}));var f=function(e){var t,n=e.keys,r=e.data,i=e.defaultSettings,o=e.style,a=e.settings,s=e.width,l=e.height,u=e.resolver,c=D(!0,{},i||{},o||{}),d={major:"horizontal"===a.orientation?l:s,minor:"horizontal"===a.orientation?s:l},f=a.major;t="object"===R(f)&&"object"===R(f.ref)&&void 0!==f.ref.start&&void 0!==f.ref.end?u.resolve({data:r,defaults:{start:0,end:1},scaled:d,settings:D(!0,{},{binStart:{scale:a.major.scale,ref:a.major.ref.start},binEnd:{scale:a.major.scale,ref:a.major.ref.end}})}):"object"===R(f)&&void 0!==f.binStart&&void 0!==f.binEnd?u.resolve({data:r,defaults:{start:0,end:1},scaled:d,settings:D(!0,{},{binStart:{scale:a.major.scale,ref:"binStart"},binEnd:{scale:a.major.scale,ref:"binEnd"}},a.major)}):u.resolve({data:r,scaled:d,defaults:{major:.5},settings:{major:a.major}});var p=a.minor||{},h={};["start","end","min","max","med"].forEach((function(e){(p[e]||r.items&&r.items.length&&r.items[0][e])&&(h[e]={scale:p.scale,ref:e})}));for(var m,g={major:t,minor:u.resolve({data:r,defaults:{start:0,end:1},scaled:d,settings:D(!0,{},h,p)})},v=0,y=n.length;v<y;v++)a[m]&&!1===a[m].show||(g[m=n[v]]=u.resolve({data:r,defaults:c[m],settings:a[m],scaled:d}));return g}({keys:c,data:n,defaultSettings:d,style:s,settings:this.settings.settings,width:i,height:o,resolver:l}),p=f.settings;return function(e){var t=e.width,n=e.height,r=e.flipXY,i=e.resolved,o=e.keys,a=e.symbol,s=[],l=i.major.items;if(!l.length)return s;var u,c,d,f,p,h,m,g,v,y=t,b=n,x=r?n:t,w=i.major.settings,k=["start","end","min","max","med"].filter((function(e){return void 0!==i.minor.settings[e]})),C=k.length,S=o.filter((function(e){return"oob"!==e})),E=o?o.length:0,M=S?S.length:0,T={box:function(){d.box&&Z(d.start)&&Z(d.end)&&u.push(Pl({item:d,boxWidth:f,boxPadding:p,rendWidth:y,rendHeight:b,flipXY:r}))},line:function(){Z(d.min)&&Z(d.start)&&u.push(Al({item:d,from:d.min,to:d.start,boxCenter:h,rendWidth:y,rendHeight:b,flipXY:r})),Z(d.max)&&Z(d.end)&&u.push(Al({item:d,from:d.max,to:d.end,boxCenter:h,rendWidth:y,rendHeight:b,flipXY:r}))},median:function(){d.median&&Z(d.med)&&u.push(Il({item:d,key:"median",position:d.med,width:f,boxCenter:h,rendWidth:y,rendHeight:b,flipXY:r}))},whisker:function(){if(d.whisker){var e=f*d.whisker.width;Z(d.min)&&u.push(Il({item:d,key:"whisker",position:d.min,width:e,boxCenter:h,rendWidth:y,rendHeight:b,flipXY:r})),Z(d.max)&&u.push(Il({item:d,key:"whisker",position:d.max,width:e,boxCenter:h,rendWidth:y,rendHeight:b,flipXY:r}))}}};function _(){for(var e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE,r=0;r<C;r++)Z(e=d[k[r]])&&(t<e&&(t=e),n>e&&(n=e));m=t<0&&t!==-Number.MAX_VALUE,g=n>1&&n!==Number.MAX_VALUE,v=m||g}for(var N=0,q=l.length;N<q;N++){u=[],c=null;var R=l[N],P=R.data,A=null,I=null;void 0!==w.binStart?(A=R.binStart,I=R.binEnd,c=w.binStart.scale):A=(c=w.major.scale)?R.major:0;var O=0;c?c.bandwidth?A-=(O=c.bandwidth())/2:O=I-A:O=1,d=D({},{major:A,majorEnd:I},i.minor.items[N]);for(var L=0;L<E;L++)d[o[L]]=i[o[L]].items[N];if(f=Ol(O,d,x),h=(p=(O-f)/2)+d.major+f/2,_(),v)d.oob&&(m?u.push(Rl({item:d,value:0,boxCenter:h,rendWidth:y,rendHeight:b,flipXY:r,symbol:a})):g&&u.push(Rl({item:d,value:1,boxCenter:h,rendWidth:y,rendHeight:b,flipXY:r,symbol:a})));else for(var z=0;z<M;z++)d[S[z]]&&!1===d[S[z]].show||T[S[z]]();var F={type:"container",data:P,collider:{type:"bounds"},children:u};s.push(F)}return s}({items:f.items,settings:p,width:i,height:o,flipXY:a,resolved:f,keys:c,symbol:u})}};var jl={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},Hl=/px$/,Bl={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},Vl={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function Wl(e,t){return e&&"function"==typeof e.bandwidth?{isBandwidth:!0,value:Math.max(1,e.bandwidth()*t)}:{isBandwidth:!1,value:Math.max(1,t)}}function Ul(e,t,n,r){var i=t.width,o=t.height;return e.filter((function(e){return!1!==e.show&&!isNaN(e.x+e.y)})).map((function(e){var t=e,a=Hl.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);Q(a)&&(t=jl,a=n.min+t.size*(n.max-n.min));var s=Y(function(e){var t=Bl.shape,n={};return"object"===R(e.shape)&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),2),l=s[0],u=q(q({},s[1]),{},{type:l,label:e.label,x:e.x*i,y:e.y*o,fill:t.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,a)),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray,opacity:t.opacity});t===e.errorShape&&(u.width=t.width);var c=r(u);return c.data=e.data,c}))}var $l={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:function(e){return e.data.value}},style:{item:"$shape"}},render:function(e){var t=e.data,n=this.resolver.resolve({data:t,defaults:D({},Bl,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),r=this.rect,i=r.width,o=r.height,a=D({},Vl,this.settings.settings.sizeLimits),s=n.items,l=function(e,t,n,r,i){var o=Wl(e?e.scale:void 0,n),a=Wl(t?t.scale:void 0,r),s=Math.min(o.value*i[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],a.value*i[a.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*i[o.isBandwidth?"minRelDiscrete":"minRelExtent"],a.value*i[a.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(s)),maxGlobal:i.maxPx,minGlobal:i.minPx}}(n.settings.x,n.settings.y,i,o,a);return Ul(s,this.rect,l,this.settings.shapeFn||this.symbol)}};Math.PI;var Yl={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function Xl(e,t,n,r){var i=t.x,o=t.y,a=t.width,s=t.height,l=Ie(),u={x:i+a/2,y:o+s/2},c=Math.min(a,s)/2,d=Math.min(a,s)/2,f=d/100;return e.map((function(e,t){var i=n[t];i.type="path";var o=d*i.outerRadius,a=c*i.innerRadius,s=f*i.cornerRadius;l.innerRadius(a),l.outerRadius(o),l.cornerRadius(s),i.arcDatum=e;var p=l.centroid(e),h=i.offset?function(e,t,n,r){var i=Y(e,2),o=i[0],a=i[1],s=Math.sqrt(o*o+a*a),l=n-r;return{x:(o/=s)*t*l,y:(a/=s)*t*l}}(p,i.offset,o,a):{x:0,y:0};return i.transform="translate(".concat(h.x,", ").concat(h.y,") translate(").concat(u.x,", ").concat(u.y,")"),i.desc={share:e.value/r,slice:{start:e.startAngle,end:e.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:u.x+h.x,y:u.y+h.y}}},i}))}function Kl(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}var Gl={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render:function(e){for(var t=e.data,n=[],r=[],i=this.settings.settings,o=this.resolver.resolve({data:t,defaults:D({},Yl,this.style.slice),settings:i.slice}).items,a=0,s=0,l=o.length;s<l;s++){var u=Kl(i,o[s]);u>0&&o[s].outerRadius>=o[s].innerRadius&&(n.push(u),r.push(o[s]),a+=u)}var c=function(){var e=Be,t=He,n=null,r=he(0),i=he(Ee),o=he(0);function a(a){var s,l,u,c,d,f=a.length,p=0,h=new Array(f),m=new Array(f),g=+r.apply(this,arguments),v=Math.min(Ee,Math.max(-Ee,i.apply(this,arguments)-g)),y=Math.min(Math.abs(v)/f,o.apply(this,arguments)),b=y*(v<0?-1:1);for(s=0;s<f;++s)(d=m[h[s]=s]=+e(a[s],s,a))>0&&(p+=d);for(null!=t?h.sort((function(e,n){return t(m[e],m[n])})):null!=n&&h.sort((function(e,t){return n(a[e],a[t])})),s=0,u=p?(v-f*b)/p:0;s<f;++s,g=c)l=h[s],c=g+((d=m[l])>0?d*u:0)+b,m[l]={data:a[l],index:s,value:d,startAngle:g,endAngle:c,padAngle:y};return m}return a.value=function(t){return arguments.length?(e="function"==typeof t?t:he(+t),a):e},a.sortValues=function(e){return arguments.length?(t=e,n=null,a):t},a.sort=function(e){return arguments.length?(n=e,t=null,a):n},a.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:he(+e),a):r},a.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:he(+e),a):i},a.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:he(+e),a):o},a}().sortValues(null);return c.startAngle(i.startAngle),c.endAngle(i.endAngle),c.padAngle(i.padAngle),Xl(c(n),D({},this.rect,{x:0,y:0}),r,a)}};var Jl=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){var n=e[t.type],r=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach((function(e){var n=Math.round(t[e.key]),i=t[e.key]-n;t[e.key]=n,r&&"append"===e.type&&(i>0?t[e.key]+=.5:t[e.key]-=.5)}))}}return void 0===e&&((e={}).line={append:["x1","x2","y1","y2"],round:[],condition:function(e){return e.x1===e.x2||e.y1===e.y2},conditionAppend:function(e){return e.strokeWidth%2!=0}},e.rect={append:["x","y"],round:["width","height"],condition:function(){return!0},conditionAppend:function(e){return e.strokeWidth%2!=0}}),Object.keys(e).forEach((function(t){var n=e[t];n.items=[],n.append.forEach((function(e){n.items.push({key:e,type:"append"})})),n.round.forEach((function(e){n.items.push({key:e,type:"round"})}))})),t.multiple=function(e){return e.forEach((function(e){return t(e)}))},t}(),Zl=function(){function e(){P(this,e),this.reset(),this.push.apply(this,arguments)}return I(e,[{key:"transposeCoordinate",value:function(e,t,n){if("number"==typeof t&&isFinite(t)){var r=e.substring(0,1);if("x"===r||"cx"===e)return t*this.width;if("width"===e)return t*this.width;if("r"===e)return t*(n?this.height:this.width);if("y"===r||"cy"===e)return t*this.height;if("height"===e)return t*this.height}return t}},{key:"push",value:function(){var e;return(e=this.storage).push.apply(e,arguments),this}},{key:"processItem",value:function(t){var n={},r=void 0!==t.flipXY?t.flipXY:this.flipXY,i=void 0!==t.crisp?t.crisp:this.crisp;if(t.fn&&"function"==typeof t.fn){var o=r?this.height:this.width,a=r?this.width:this.height;t=t.fn({width:o,height:a,flipXY:r});for(var s=Object.keys(t),l=0,u=s.length;l<u;l++){var c=s[l];n[e.evaluateKey(c,r)]=t[c]}}else for(var d=Object.keys(t),f=0,p=d.length;f<p;f++){var h=d[f],m=e.evaluateKey(h,r),g=this.transposeCoordinate(m,t[h],r);n[m]=g}return i&&Jl(n),n}},{key:"output",value:function(){for(var e=[],t=0,n=this.storage.length;t<n;t++){var r=this.processItem(this.storage[t]);e.push(r)}return e}},{key:"reset",value:function(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}],[{key:"evaluateKey",value:function(e,t){if(t){var n=e.substring(0,1),r=e.substring(1);if("x"===n)return"y".concat(r);if("y"===n)return"x".concat(r);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}}]),e}();function Ql(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Zl,t)}function eu(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}var tu={created:function(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender:function(){this.blueprint=Ql(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render:function(){var e=this;if(this.x=this.settings.x?this.chart.scale(this.settings.x):null,this.y=this.settings.y?this.chart.scale(this.settings.y):null,Ea(this,"x",this.rect.width),Ea(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=D({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=D({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=eu(this.x,this.rect.width),this.lines.y=eu(this.y,this.rect.height),this.lines.y=this.lines.y.map((function(e){return D(e,{flipXY:!0})}));var t=function(t){var n=t.dir,r=t.isMinor,i=e.lines[n].filter((function(e){return!!e.isMinor===r})),o=r?e.settings.minorTicks:e.settings.ticks;e.resolver.resolve({settings:o,data:{items:i,dir:n}}).items.forEach((function(t){var r,i,o=t.data;t.show&&e.blueprint.push({type:"line",x1:o.position,y1:0,x2:o.position,y2:1,stroke:t.stroke||"black",strokeWidth:void 0!==t.strokeWidth?t.strokeWidth:1,strokeDasharray:void 0!==t.strokeDasharray?t.strokeDasharray:void 0,flipXY:o.flipXY||!1,value:null!==(r=o.value)&&void 0!==r?r:null===(i=o.data)||void 0===i?void 0:i.value,dir:n})}))};return t({dir:"x",isMinor:!1}),t({dir:"x",isMinor:!0}),t({dir:"y",isMinor:!1}),t({dir:"y",isMinor:!0}),this.blueprint.output()}};function nu(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===r||"right"===r){var i="right"===r;return"\n M ".concat(e," ").concat(t-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?0:1,", ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}var o="bottom"===r;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(o?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(o?t+n:t-n," Z\n ")}function ru(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===r||"right"===r){var i="right"===r;return"\n M ".concat(e+=i?1.5*n:-1.5*n," ").concat(t-n,"\n L ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}var o="bottom"===r;return t+=o?1.5*n:-1.5*n,"\n M ".concat(e-n," ").concat(t,"\n L ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(o?t+n:t-n," Z\n ")}function iu(e){if(void 0===e)return 0;if("number"==typeof e&&isFinite(e))return e;if("string"==typeof e)switch(e){case"center":case"middle":return.5;case"bottom":case"right":return 1;case"top":case"left":default:return 0}return 0}function ou(e){var t={value:e.value};return e.label&&(t.label=e.label.text),t}function au(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function su(e,t){var n=e.min();if(n===e.max()){var r=function(e){var t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return r?2:-1;if(t>n)return r?-1:2}return e(t)}var lu={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:0},style:{oob:{show:!0,width:10,fill:"#1A1A1A",stroke:"transparent",strokeWidth:0,opacity:1,text:{fontFamily:"Arial",stroke:"transparent",fill:"#fff",strokeWidth:0,opacity:1},triangle:{fill:"#4D4D4D",stroke:"transparent",strokeWidth:0,opacity:1},padding:{x:28,y:5}},line:{stroke:"#000"},label:{strokeWidth:0}}},preferredSize:function(){return 30},beforeRender:function(){this.blueprint=Ql(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render:function(){var e=this,t=this.settings;if(this.lines={x:[],y:[]},this.lines.x=t.lines&&t.lines.x||[],this.lines.y=t.lines&&t.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];var n={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(au).map((function(t){if("function"==typeof t.value&&(t.value=t.value()),t.scale){var n=e.chart.scale(t.scale),r=su(n,t.value);return D(t,{scale:n,position:r})}return D(t,{position:t.value})})),this.lines.y=this.lines.y.filter(au).map((function(t){if("function"==typeof t.value&&(t.value=t.value()),t.scale){var n=e.chart.scale(t.scale),r=su(n,t.value);return D(t,{scale:n,position:r,flipXY:!0})}return D(t,{position:t.value,flipXY:!0})})),this.lines.x=this.lines.x.filter((function(e){return!(e.position<0||e.position>1)||(n["x".concat(e.position>1?1:0)].push(ou(e)),!1)})),this.lines.y=this.lines.y.filter((function(e){return!(e.position<0||e.position>1)||(n["y".concat(e.position>1?1:0)].push(ou(e)),!1)}));var r=[];return[].concat(X(this.lines.x),X(this.lines.y)).forEach((function(n){(!0===n.show||void 0===n.show)&&function(e){var t,n=e.chart,r=e.blueprint,i=e.renderer,o=e.p,a=e.settings,s=e.items,l=!0,u=!1,c=!1,d=!1,f=D(!0,{},a.style.line,o.line||{});if(t=r.processItem({type:"line",x1:o.position,y1:0,x2:o.position,y2:1,stroke:f.stroke||"black",strokeWidth:f.strokeWidth||1,strokeDasharray:f.strokeDasharray,flipXY:o.flipXY||!1,value:o.valueInfo?o.valueInfo.id:o.value}),o.label){var p,h=D(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},a.style.label||{},{fill:f.stroke},o.label),m={width:0,height:0},g="";if("string"==typeof o.formatter)p=n.formatter(o.formatter);else if("object"===R(o.formatter))p=n.formatter(o.formatter);else if(void 0!==o.scale&&o.scale.data){var v=o.scale.data()&&o.scale.data().fields;p=v&&v[0]?v[0].formatter():null}!1!==o.label.showValue&&(p?g=" (".concat(p(o.value),")"):o.scale&&(g=" (".concat(o.value,")"))),g&&(m=i.measureText({text:g,fontFamily:h.fontFamily,fontSize:h.fontSize}));var y=i.measureText({text:h.text||"",fontFamily:h.fontFamily,fontSize:h.fontSize}),b={width:y.width+m.width,height:Math.max(y.height,m.height)},x=h.padding,w=iu(o.flipXY?h.vAlign:h.align),k=iu(o.flipXY?h.align:h.vAlign),C=Math.min(1+b.width+2*x,h.maxWidth*r.width,h.maxWidthPx),S=b.height+2*x,E=o.flipXY?S:C,M=o.flipXY?C:S;if((u=r.processItem({fn:function(e){var t=e.width,n=e.height,i=o.position*t-(o.flipXY?S:C)*(1-w);return{type:"rect",x:i=o.flipXY?i:Math.max(i,0),y:Math.max(Math.abs(k*n-M*k),0),width:o.flipXY?E:Math.min(E,r.width-i),height:M,stroke:h.background.stroke,strokeWidth:h.background.strokeWidth,fill:h.background.fill,opacity:h.background.opacity}},flipXY:o.flipXY||!1})).x<-1||u.x+u.width>r.width+1||u.y<-1||u.y+u.height>r.height+1)u=void 0;else{c={type:"text",text:h.text||"",fill:h.fill,opacity:h.opacity,fontFamily:h.fontFamily,fontSize:h.fontSize,x:u.x+x,y:u.y+u.height/2+b.height/3,maxWidth:u.width-2*x-m.width,anchor:"start"},g&&(d={type:"text",text:g||"",fill:h.fill,opacity:h.opacity,fontFamily:h.fontFamily,fontSize:h.fontSize,x:c.x+3+(u.width-(m.width+2*x)),y:c.y});for(var T=0,_=s.length;T<_;T++){var N=s[T];"rect"===N.type?Ss(u,N)&&(l=!1):"line"===N.type&&o.flipXY===N.flipXY&&Ts(u,N)&&(l=!1)}}}s.push(t),l&&u&&c&&(s.push(u,c),d&&s.push(d))}({chart:e.chart,blueprint:e.blueprint,renderer:e.renderer,p:n,settings:t,items:r})})),t.style.oob.show&&function(e){for(var t=e.blueprint,n=e.oob,r=e.settings,i=e.items,o=Object.keys(n),a=r.style.oob||{},s=function(e,r){var s=o[e],l=n[s];if(l.length>0){var u=s.charAt(1),c="y"===s.charAt(0),d=a.padding.x+a.width,f=a.padding.y+a.width,p="bottom";p=c?"1"===u?"bottom":"top":"1"===u?"right":"left";var h=t.processItem({fn:function(e){var t=e.width,n=e.height,r=u*t+("1"===u?-d:d),i=c?f:n-f;return"arc"===a.type?{type:"path",d:nu(c?i:r,c?r:i,a.width,p),x:r,y:i,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0}:{type:"circle",cx:r,cy:i,r:a.width,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0,opacity:a.opacity,data:l}},flipXY:c}),m=h.cx||h.x,g=h.cy||h.y,v={type:"text",text:l.length||"",x:m-.4*a.width,y:g+.4*a.width,fontFamily:a.text.fontFamily,fontSize:"".concat(1.3*a.width,"px"),stroke:a.text.stroke,fill:a.text.fill,strokeWidth:a.text.strokeWidth||0,opacity:a.text.opacity},y={type:"path",d:ru(m,g,a.width,p),x:m,y:g,stroke:a.triangle.stroke,fill:a.triangle.fill,strokeWidth:a.triangle.strokeWidth||0,opacity:a.triangle.opacity};i.push(h,v,y)}},l=0,u=o.length;l<u;l++)s(l)}({blueprint:this.blueprint,oob:n,settings:t,items:r}),r}};function uu(e){var t={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===e.align||"bottom"===e.align?(t.x1=e.innerRect.x-e.outerRect.x,t.x2=t.x1+e.innerRect.width,t.y1=t.y2="top"===e.align?e.innerRect.height-e.padding:e.padding):(t.x1=t.x2="left"===e.align?e.innerRect.width-e.padding:e.padding,t.y1=e.innerRect.y-e.outerRect.y,t.y2=t.y1+e.innerRect.height),function(e,t){D(e,t.style)}(t,e),t}function cu(e){return"string"==typeof e||"number"==typeof e?e:"-"}function du(e,t,n){n.layered||!n.stepSize?function(e,t){t.collider={type:"polygon",vertices:[{x:t.boundingRect.x,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y+t.boundingRect.height},{x:t.boundingRect.x,y:t.boundingRect.y+t.boundingRect.height}]}}(0,t):n.tilted?function(e,t,n){var r=n.angle*(Math.PI/180),i=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,a="end"===t.anchor&&r<0,s="start"===t.anchor&&r>=0,l=t.boundingRect.y+(s||a?t.boundingRect.height:0),u=[{x:t.x-i,y:l},{x:t.x+i,y:l}].map((function(e){return Ja(e,r,{x:t.x,y:t.y})})),c={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},d={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},f=r>=0?[c,d]:[d,c];u.push.apply(u,f),t.collider={type:"polygon",vertices:u}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){var r=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:r,y:0,width:r<0?n.stepSize+r:n.stepSize,height:n.innerRect.height}}else{var i=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:i,width:n.innerRect.width,height:i<0?n.stepSize+i:n.stepSize}}var o=t.collider;o.x=Math.max(o.x,0),o.y=Math.max(o.y,0);var a=o.x+o.width-(n.outerRect.x+n.outerRect.width);o.width=a>0?o.width-a:o.width;var s=o.y+o.height-(n.outerRect.y+n.outerRect.height);o.height=s>0?o.height-s:o.height}(e,t,n)}function fu(e,t){var n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1),r=0;if(e.tilted)r=e.stepSize*n;else{var i=t?e.textRect.height:e.textRect.width;r=Math.max(0,e.stepSize-i)*n}return r}function pu(e,t){var n,r,i={type:"text",text:cu(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(r=e.data)||void 0===r?void 0:r.value};return"top"===t.align||"bottom"===t.align?(i.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+fu(t,!1),i.y="top"===t.align?t.innerRect.height:0,i.anchor=t.stepSize?"start":"middle",i.x+=isNaN(t.style.offset)?0:+t.style.offset):(i.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+fu(t,!0),i.x="left"===t.align?t.innerRect.width:0,i.anchor="left"===t.align?"end":"start",i.baseline=t.stepSize?"text-before-edge":"central",i.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach((function(n){e[n]=t.style[n]}))}(i,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){var n=t.outerRect.width,r=Math.min(t.maxWidth/2,t.textRect.width/2),i=e.x-r,o=e.x+r;i<0?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):o>n&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{var a=t.outerRect.height,s=t.maxHeight/2,l=e.y-s,u=e.y+s;l<0?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):u>a&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(i,t),function(e,t){"top"===t.align?e.y-=t.padding:"bottom"===t.align?e.y+=t.padding+t.maxHeight:"left"===t.align?e.x-=t.padding:"right"===t.align&&(e.x+=t.padding)}(i,t),function(e,t){if(t.tilted){var n=-t.angle,r=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(r)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(r)/2):e.x-=t.maxHeight*Math.sin(r)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";var i=Math.cos(r)*t.maxWidth;if("bottom"===t.align==t.angle<0){var o=t.outerRect.width-t.paddingEnd;e.x+i>o&&(e.maxWidth=(o-e.x-10)/Math.cos(r))}else{var a=t.paddingEnd;e.x-i<a&&(e.maxWidth=(e.x-a-10)/Math.cos(r))}}}(i,t),function(e,t){e.boundingRect=t.textBounds(e)}(i,t),du(e,i,t),i}function hu(e,t){var n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:e.value};return"top"===t.align||"bottom"===t.align?(n.x1=n.x2=e.position*t.innerRect.width+(t.innerRect.x-t.outerRect.x),n.y1="top"===t.align?t.innerRect.height:0,n.y2="top"===t.align?n.y1-t.tickSize:n.y1+t.tickSize):(n.y1=n.y2=e.position*t.innerRect.height+(t.innerRect.y-t.outerRect.y),n.x1="left"===t.align?t.innerRect.width:0,n.x2="left"===t.align?n.x1-t.tickSize:n.x1+t.tickSize),function(e,t){D(e,t.style)}(n,t),function(e,t){"top"===t.align?(e.y1-=t.padding,e.y2-=t.padding):"bottom"===t.align?(e.y1+=t.padding,e.y2+=t.padding):"left"===t.align?(e.x1-=t.padding,e.x2-=t.padding):"right"===t.align&&(e.x1+=t.padding,e.x2+=t.padding)}(n,t),function(e,t){var n=e.strokeWidth/2;e.x1===t.innerRect.width?(e.x1-=n,e.x2-=n):0===e.x1?(e.x1+=n,e.x2+=n):e.y1===t.innerRect.height?(e.y1-=n,e.y2-=n):0===e.y1&&(e.y1+=n,e.y2+=n)}(n,t),n}function mu(e){return!e.isMinor&&e.position>=0&&e.position<=1}function gu(e){var t=e.rect,n=e.state,r=e.majorTicks,i=e.measure;return e.horizontal?function(e){for(var t=e.majorTicks,n=e.measureText,r=e.rect,i="layered"===e.state.labels.activeMode?2:1,o=r.width,a=t.map((function(e){return e.label})).map((function(e){return"".concat(e.slice(0,1)).concat(e.length>1?"…":"")})).map(n).map((function(e){return e.width})),s=0;s<t.length;++s){var l=t[s];if(i*o*Math.abs(l.start-l.end)<a[s])return!0}return!1}({majorTicks:r,measureText:i,rect:t,state:n}):function(e){var t=e.majorTicks,n=e.measureText,r=e.rect.height,i=n("M").height;return!(t.length<2)&&r*Math.abs(t[0].position-t[1].position)<i}({majorTicks:r,measureText:i,rect:t,state:n})}function vu(e){var t=e.value,n=e.maxValue,r=e.minValue,i=e.range,o=e.modifier;return isNaN(i)||isNaN(o)||(t=i*o),t>n&&(t=n),t<r&&(t=r),t}function yu(e){var t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,a=e.settings,s=e.state,l=0,u={left:0,top:0,right:0,bottom:0},c=a.labels,d=c.maxLengthPx,f=c.minLengthPx;if(a.labels.show){var p,h,m=a.align,g="top"===m||"bottom"===m,v=g?n.inner.width:n.inner.height,y=o.ticks({settings:a,distance:v,formatter:r}).filter(mu),b=function(e){var t=i({text:e,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return t.width=vu({value:t.width,maxValue:d,minValue:f}),t};if(t&&g&&"auto"===a.labels.mode&&(!function(e){var t=e.majorTicks,n=e.measure,r=e.rect,i=e.state,o=e.settings,a=o.labels.maxGlyphCount,s="layered"===i.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,u=n("…").width,c=r.width,d=0;if(isNaN(a))for(var f=0;f<t.length;f++){var p=t[f],h=p.label;if(n(h).width*(h.length>1?l:1)+u>(d=s*c*Math.abs(p.start-p.end)))return!0}else if(d=s*c*t.reduce((function(e,t){return Math.min(Math.abs(t.start-t.end),e)}),1/0),n("M").width*l*a+u>d)return!0;return!1}({majorTicks:y,measure:b,rect:n.inner,state:s,settings:a})?s.labels.activeMode="horizontal":s.labels.activeMode="tilted"),!a.labels.filterOverlapping&&"tilted"!==s.labels.activeMode&&gu({rect:n.inner,state:s,majorTicks:y,measure:b,horizontal:g}))return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0};if("tilted"===s.labels.activeMode){var x=Math.abs(a.labels.tiltAngle)*(Math.PI/180);p=function(e){return vu({value:e.width,maxValue:d,minValue:f})*Math.sin(x)+e.height*Math.cos(x)}}else p=g?function(e){return e.height}:function(e){return vu({value:e.width,maxValue:d,minValue:f})};if(g&&"tilted"!==s.labels.activeMode)h=["M"];else if(isNaN(a.labels.maxGlyphCount))h=y.map((function(e){return e.label}));else{for(var w="",k=0;k<a.labels.maxGlyphCount;k++)w+="M";h=[w]}var C=h.map(b),S=C.map(p),E=Math.max.apply(Math,X(S).concat([0]));if(l+=E,l+=a.labels.margin,"layered"===s.labels.activeMode&&(l*=2),"tilted"===s.labels.activeMode){var M="bottom"===a.align==a.labels.tiltAngle>=0,T=Math.abs(a.labels.tiltAngle)*(Math.PI/180),D=(E-b("M").height*Math.cos(T))/Math.sin(T),_=Math.min(a.labels.maxEdgeBleed,Math.max.apply(Math,X(C.map((function(e){return Math.min(D,e.width)*Math.cos(T)+e.height})).map((function(e,t){var r=y[t]?y[t].position:0;return M?e-r*n.inner.width:e-(1-r)*n.inner.width}))).concat([0])))+a.paddingEnd;if(u[M?"left":"right"]=_,!a.labels.filterOverlapping&&function(e){var t=e.majorTicks,n=e.measureText,r=e.rect,i=e.bleedSize,o=e.angle;if(t.length<2)return!1;if(0===o)return!0;var a=Math.abs(o),s=1/(Math.min(r.outer.width-i,r.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(a*(Math.PI/180))/s}({majorTicks:y,measureText:b,rect:n,bleedSize:_,angle:a.labels.tiltAngle}))return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}return{size:l,edgeBleed:u}}var bu=function(e,t,n){return e.width*Math.abs(t.position-n.position)};function xu(e){var t=e.layered,n=e.major,r=e.innerRect,i=e.outerRect,o=e.tick,a=e.index,s=t?2:1,l=n[a-s],u=n[a+s],c=l?bu(r,o,l)/2-2:1/0,d=u?bu(r,o,u)/2-2:1/0;return n.length<2?r.width:l?u?2*Math.min(c,d):function(e){var t=e.innerRect,n=e.outerRect,r=e.tick,i=e.prevWidth,o=t.x-n.x,a=n.width-t.width-o,s=t.width-t.width*r.position+a,l=2*Math.min(i,s),u=1===r.position?t.width/2-2:0;return Math.max(i,l,u)}({innerRect:r,outerRect:i,tick:o,prevWidth:c}):function(e){var t=e.innerRect,n=e.outerRect,r=e.tick,i=e.nextWidth,o=t.x-n.x,a=t.width*r.position+o,s=2*Math.min(i,a),l=0===r.position?t.width/2-2:0;return Math.max(i,s,l)}({innerRect:r,outerRect:i,tick:o,nextWidth:d})}function wu(e){var t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0}function ku(e){var t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=wu(e)+e.labels.margin}function Cu(e,t){return e.map((function(e){return hu(e,t)}))}function Su(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function Eu(e){var t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.scale,o=e.tilted,a=e.layered,s=e.tick,l=t.height,u=Su(i,s),c={width:0,height:l};if("left"===n.align||"right"===n.align)c.width=r.width-ku(n)-n.paddingEnd;else if(a)c.width=u*r.width*2;else if(o){var d=Math.abs(n.labels.tiltAngle)*(Math.PI/180);c.width=(r.height-ku(n)-n.paddingEnd-l*Math.cos(d))/Math.sin(d)}else c.width=u*r.width;return c.width=vu({value:c.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),c}function Mu(e){var t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.outerRect,o=e.tilted,a=e.layered,s=e.tick,l=e.index,u=e.major,c=t.height,d={width:0,height:c};if("left"===n.align||"right"===n.align)d.width=r.width-ku(n)-n.paddingEnd;else if(o){var f=Math.abs(n.labels.tiltAngle)*(Math.PI/180);d.width=(r.height-ku(n)-n.paddingEnd-c*Math.cos(f))/Math.sin(f)}else d.width=xu({layered:a,major:u,innerRect:r,outerRect:i,tick:s,index:l});return d.width=vu({value:d.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),d}function Tu(e){var t;function n(){return t=Mu,n}function r(){return t=Eu,r}function i(e){var n,r=e.settings,i=e.scale,o=e.innerRect,a=e.outerRect,s=e.measureText,l=e.ticks,u=e.state,c=e.textBounds,d=[],f=function(e){return e.filter((function(e){return!e.isMinor}))}(l),p=function(e){return e.filter((function(e){return e.isMinor}))}(l),h={innerRect:o,align:r.align,outerRect:a},m="tilted"===u.labels.activeMode,g="layered"===u.labels.activeMode;if(r.line.show&&(h.style=r.line,h.padding=r.paddingStart,d.push(uu(h))),r.ticks.show&&(h.style=r.ticks,h.tickSize=r.ticks.tickSize,h.padding=wu(r),n=Cu(f,h)),r.labels.show){var v=ku(r);h.style=r.labels,h.padding=v,h.tilted=m,h.layered=g,h.angle=r.labels.tiltAngle,h.paddingEnd=r.paddingEnd,h.textBounds=c;var y=function(e,n){h.textRect=function(e){var t=e.style;return(0,e.measureText)({text:e.tick.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:s,style:h.style});var u=t({textMetrics:h.textRect,settings:r,innerRect:o,outerRect:a,scale:i,tilted:m,layered:g,tick:e,major:f,index:n});h.maxWidth=u.width,h.maxHeight=u.height,h.stepSize=function(e){var t=e.innerRect,n=e.scale,r=e.settings,i=e.tick;return("top"===r.align||"bottom"===r.align?t.width:t.height)*Su(n,i)}({innerRect:o,scale:i,ticks:l,settings:r,tick:e})},b=[];b=!g||"top"!==r.align&&"bottom"!==r.align?function(e,t,n){return e.map((function(e,r){n(e,r);var i=pu(e,t);return i.data=e.data,i}))}(f,h,y):function(e,t,n,r){var i=t.padding,o=ku(n);return e.map((function(e,a){r(e,a);var s=o+t.maxHeight+n.labels.margin;t.layer=a%2,t.padding=a%2==0?i:s;var l=pu(e,t);return l.data=e.data,l}))}(f,h,r,y),r.labels.filterOverlapping&&function(e,t,n){var r=function(t,n){return Ss(ae(1,e[t].boundingRect),ae(1,e[n].boundingRect))};if(n&&n.tilted){var i=Math.abs(n.angle);r=function(t,n){var r=1/Math.abs(e[t].x-e[n].x),o=Math.sin(i*(Math.PI/180))/r;return e[t].boundingRect.height>o}}for(var o=0;o<=e.length-1;o++)for(var a=o+1;a<=Math.min(o+5,o+(e.length-1));a++)e[o]&&e[a]&&r(o,a)&&(a===e.length-1?(e.splice(o,1),t&&t.splice(o,1)):(e.splice(a,1),t&&t.splice(a,1)),a--,o--)}(b,n,h),d.push.apply(d,X(b))}return r.minorTicks&&r.minorTicks.show&&p.length>0&&(h.style=r.minorTicks,h.tickSize=r.minorTicks.tickSize,h.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(r),d.push.apply(d,X(Cu(p,h)))),n&&d.push.apply(d,X(n)),d}return n.build=i,r.build=i,e?r():n()}var Du={labels:{show:!0,tiltAngle:40,tiltThreshold:.7,maxEdgeBleed:1/0,margin:4,maxLengthPx:150,minLengthPx:0,mode:"auto",maxGlyphCount:NaN,align:.5,offset:0,filterOverlapping:!1},ticks:{show:!1,margin:0,tickSize:4},line:{show:!1},paddingStart:0,paddingEnd:10,align:"auto"},_u={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};var Nu={require:["chart","renderer","dockConfig"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{},style:{labels:"$label",ticks:"$guide-line",minorTicks:"$guide-line--minor",line:"$guide-line"}},created:function(){this.state={isDiscrete:!!this.scale.bandwidth,isHorizontal:!1,labels:{activeMode:"horizontal"},ticks:[],innerRect:{width:0,height:0,x:0,y:0},outerRect:{width:0,height:0,x:0,y:0},defaultDock:void 0,concreteNodeBuilder:void 0,settings:void 0},this.state.isDiscrete?this.state.defaultDock="bottom":this.state.defaultDock="left",this.setState(this.settings)},setState:function(){var e,t,n,r;this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(e){var t=e.state,n=e.style,r=e.settings,i=D(!0,{},t.isDiscrete?Du:_u,n),o=D(!0,{},i,r.settings),a=r.layout.dock||t.defaultDock;o.dock=a,o.align=function(e,t){var n=["top","bottom"],r=["left","right"];return-1!==n.indexOf(e)&&-1===r.indexOf(t)||-1!==r.indexOf(e)&&-1===n.indexOf(t)?e:t}(r.settings.align,a),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));var s=o.paddingStart,l=o.paddingEnd;return o.paddingStart="function"==typeof s?s.call(null):s,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=Tu(this.state.isDiscrete),this.dockConfig.dock(this.state.settings.dock),this.state.isHorizontal="top"===this.state.settings.align||"bottom"===this.state.settings.align,this.state.labels.activeMode=(e=this.state,t=this.state.settings,n=this.state.isDiscrete,r=t.labels.mode,n&&e.isHorizontal?"auto"===r?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?r:"horizontal":"horizontal")},preferredSize:function(e){var t=this.formatter,n=this.state,r=this.scale,i=this.state.isHorizontal?e.inner.width:e.inner.height;return this.state.pxScale=Ma(r,i),function(e){var t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,a=e.settings,s=0,l=yu({isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:e.state}),u=l.size,c=l.edgeBleed;if(s+=u,l.isToLarge)return{size:s};if(a.ticks.show&&(s+=a.ticks.margin,s+=a.ticks.tickSize),a.minorTicks&&a.minorTicks.show){var d=a.minorTicks.margin+a.minorTicks.tickSize;d>s&&(s=d)}if(a.line.show){var f=a.line.strokeWidth/2;s+=f,c[function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return e}}(a.align)]=Math.ceil(f)}return s+=a.paddingStart,{size:s+=a.paddingEnd,edgeBleed:c}}({isDiscrete:this.state.isDiscrete,rect:{inner:e.inner,outer:e.outer},formatter:t,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n})},beforeUpdate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.settings;this.setState(t)},resize:function(e){var t=e.inner,n=e.outer,r=D({},t,function(e){var t=e.align,n=e.inner;return"left"===t?{x:n.width+n.x}:"right"===t||"bottom"===t?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:t})),i=n||r;return D(this.state.innerRect,r),D(this.state.outerRect,i),n},beforeRender:function(){var e=this.scale,t=this.formatter,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=Ma(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter((function(e){return e.position>=0&&e.position<=1}))},render:function(){var e=this.state,t=[];return t.push.apply(t,X(this.state.concreteNodeBuilder.build({settings:this.state.settings,scale:this.state.pxScale,innerRect:this.state.innerRect,outerRect:this.state.outerRect,measureText:this.renderer.measureText,textBounds:this.renderer.textBounds,ticks:this.state.ticks,state:e}))),Jl.multiple(t),t}};var qu={render:function(){return[]}};function Ru(e,t,n){var r="";if("function"==typeof e)r=e();else if("string"==typeof e)r=e;else if(n){r=(n.data().fields||[]).map((function(e){return e.title()})).join(t)}return r}function Pu(e,t){var n="middle";return"left"===e?"top"===t?n="end":"bottom"===t&&(n="start"):"right"===e?"top"===t?n="start":"bottom"===t&&(n="end"):"left"===t?n="start":"right"===t&&(n="end"),n}var Au={require:["renderer","chart"],defaultSettings:{layout:{dock:"bottom",displayOrder:0,prioOrder:0},settings:{paddingStart:5,paddingEnd:5,paddingLeft:0,paddingRight:0,anchor:"center",join:", ",maxLengthPx:NaN},style:{text:"$title"}},created:function(){this.definitionSettings=this.settings.settings;var e=this.settings.text,t=this.definitionSettings.join;this.title=Ru(e,t,this.scale)},preferredSize:function(){return this.renderer.measureText({text:this.title,fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily}).height+this.definitionSettings.paddingStart+this.definitionSettings.paddingEnd},render:function(){var e=this.title,t=this.definitionSettings,n=this.rect,r=[];return r.push(function(e){var t=e.title,n=e.definitionSettings,r=e.dock,i=e.rect,o=e.measureText,a=e.style,s={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:Pu(r,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};D(s,a.text);var l=o(s);if("top"===r||"bottom"===r){var u=i.width/2;"left"===n.anchor?u=n.paddingLeft||0:"right"===n.anchor&&(u=i.width-(n.paddingRight||0)),s.x=u,s.y="top"===r?i.height-n.paddingStart:n.paddingStart+l.height,s.dy="top"===r?-l.height/6:-l.height/3,s.maxWidth=.8*i.width}else{var c=i.height/2;"top"===n.anchor?c=n.paddingStart:"bottom"===n.anchor&&(c=i.height-n.paddingStart),s.y=c,s.x="left"===r?i.width-n.paddingStart:n.paddingStart,s.dx="left"===r?-l.height/3:l.height/3;var d="left"===r?270:90;s.transform="rotate(".concat(d,", ").concat(s.x+s.dx,", ").concat(s.y+s.dy,")"),s.maxWidth=.8*i.height}return isNaN(n.maxLengthPx)||(s.maxWidth=Math.min(s.maxWidth,n.maxLengthPx)),s}({title:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),r},beforeUpdate:function(e){e.settings&&(D(this.settings,e.settings),this.definitionSettings=e.settings.settings);var t=this.settings.text,n=this.definitionSettings.join;this.title=Ru(t,n,this.scale)}};function Iu(e,t){var n,r=e.settings.layout.dock,i=e.settings.settings.invert,o="top"===r||"bottom"===r,a=o?"width":"height",s=e.rect[a],l=e.chart.scroll(e.settings.scroll),u=t[o?"x":"y"];i&&(u=s-u);var c=l.getState();n={startOffset:u,startScroll:c.start,swipe:!1};var d=u/s*(c.max-c.min)+c.min;d<c.start?n.startScroll=d:d>c.start+c.viewSize&&(n.startScroll=d-c.viewSize);return{update:function(e){var t=e[o?"x":"y"];if(i&&(t=s-t),!n.swipe){if(Math.abs(n.startOffset-t)<=1)return;n.swipe=!0}var r=l.getState(),a=(t-n.startOffset)/s*(r.max-r.min),u=n.startScroll+a;l.moveTo(u)},end:function(e){var t=e[o?"x":"y"];i&&(t=s-t);var r=l.getState();if(n.swipe){var a=(t-n.startOffset)/s*(r.max-r.min),u=n.startScroll+a;l.moveTo(u)}else{var c=t/s*(r.max-r.min)+r.min-r.viewSize/2;l.moveTo(c)}}}}function Ou(e,t){var n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}var Lu={require:["chart","renderer"],on:{panStart:function(e){var t=Ou(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=Iu(this,n),this.currentMove.update(t)},panMove:function(e){if(this.currentMove){var t=Ou(e,this.renderer);this.currentMove.update(t)}},panEnd:function(e){if(this.currentMove){var t=Ou(e,this.renderer);this.currentMove.end(t),this.currentMove=null}},panCancel:function(){this.currentMove=null},tap:function(e){var t=Ou(e,this.renderer);Iu(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){var t=this.chart.scroll(this.settings.scroll).getState();return t.viewSize>=t.max-t.min?Math.max(e.width,e.height):this.settings.settings.width},render:function(e){var t,n=this.settings.layout.dock,r=this.settings.settings.invert,i="top"===n||"bottom"===n,o=i?"width":"height",a=this.rect[o],s=this.chart.scroll(this.settings.scroll).getState(),l=a*(s.start-s.min)/(s.max-s.min),u=a*s.viewSize/(s.max-s.min);return r&&(l=a-l-u),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("div",{class:"scroller",style:(t={position:"absolute"},O(t,i?"left":"top","".concat(l,"px")),O(t,i?"top":"left","25%"),O(t,i?"height":"width","50%"),O(t,o,"".concat(Math.max(1,u),"px")),O(t,"background",this.settings.settings.thumbColor),t)})))},renderer:"dom"};function zu(e){var t=e.h,n=e.isVertical,r=e.value,i=e.pos,o=e.align,a=e.borderHit,s=e.state,l=e.idx,u="end"!==o,c=u?{left:"0",top:"0"}:{right:"0",bottom:"0"},d=0,f="100%",p="100%";return s.targetRect&&"start"===s.settings.bubbles.align?(f="".concat(s.targetRect.x+s.targetRect.width,"px"),p="".concat(s.targetRect.y+s.targetRect.height,"px")):s.targetRect&&"end"===s.settings.bubbles.align&&(d=n?s.targetRect.x:s.targetRect.y,f="".concat(s.rect.width-d,"px"),p="".concat(s.rect.height-d,"px")),u||(i-=a),t("div",{onmouseover:function(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout:function(e){e.srcElement.children[0].style.backgroundColor=s.style.line.stroke,e.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":r,"data-key":[s.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?d:i,"px"),top:"".concat(n?i:d,"px"),height:n?"".concat(a,"px"):p,width:n?f:"".concat(a,"px"),pointerEvents:"auto"}},[t("div",{style:D({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},c)})])}function Fu(e){var t,n,r=e.h,i=e.isVertical,o=e.label,a=e.otherValue,s=e.rangeIdx,l=e.idx,u=e.pos,c=e.align,d=e.state,f=e.value,p="end"!==c,h="outside"===d.settings.bubbles.placement,m="none";i?(n=p?"left":"right",h&&(m=p?"translate(-100%, 0px)":"translate(100%, 0px)")):(n=p?"top":"bottom",h&&(m=p?"translate(0px, -100%)":"translate(0px, 100%)"));var g=d.edit&&d.edit.rangeIdx===s&&d.edit.bubbleIdx===l,v={position:"relative",borderRadius:"".concat(d.style.bubble.borderRadius,"px"),border:"".concat(d.style.bubble.strokeWidth,"px solid ").concat(d.style.bubble.stroke),backgroundColor:d.style.bubble.fill,color:d.style.bubble.color,fontFamily:d.style.bubble.fontFamily,fontSize:d.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:i?"translate(0,-50%)":"translate(-50%,0)",cursor:i?"ns-resize":"ew-resize"},y=d.style.bubble.stroke,b=g?r("input",{type:"text",value:f,style:q(q({},v),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup:function(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();var t=parseFloat(e.target.value);isNaN(t)?(y="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(d.style.bubble.strokeWidth,"px solid ").concat(y)):d.onEditConfirmed(s,t,a)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),d.onEditCanceled())}}):r("div",{"data-key":[d.key,"bubble",s,l].join("-"),"data-other-value":a,"data-idx":s,"data-bidx":l,style:v},[o]);return r("div",{style:(t={position:"absolute"},O(t,n,"0"),O(t,i?"top":"left","".concat(u,"px")),O(t,"transform",m),t)},[b])}function ju(e){var t=e.h,n=e.isVertical,r=e.top,i=e.height,o=e.color,a=e.on,s=e.opacity;return t("div",D({style:{backgroundColor:o,opacity:s,position:"absolute",left:n?0:"".concat(r,"px"),top:n?"".concat(r,"px"):0,height:n?"".concat(i,"px"):"100%",width:n?"100%":"".concat(i,"px"),pointerEvents:"auto"}},a),[])}function Hu(e){var t=e.borderHit,n=e.els,r=e.isVertical,i=e.state,o=e.vStart,a=e.vEnd,s=e.idx,l=0;i.targetRect&&(l=r?i.targetRect.y:i.targetRect.x);var u=!!i.scale,c=u?i.scale.norm(o)*i.size:o,d=u?i.scale.norm(a)*i.size:a,f=Math.abs(c-d),p=Math.min(c,d)+l,h=p+f;if(i.targetRect){var m=i.targetFillRect||i.targetRect,g=r?m.height:m.width,v=u?i.scale.norm(o)*g:o,y=u?i.scale.norm(a)*g:a,b=Math.abs(v-y),x=Math.min(v,y),w={h:i.h,isVertical:r,top:x,height:b,color:i.style.target.fill,opacity:i.style.target.opacity};i.style.target.opacity<.8&&(w.on={onmouseover:function(e){e.srcElement.style.opacity=i.style.target.opacity+.1},onmouseout:function(e){e.srcElement.style.opacity=i.style.target.opacity}}),n.push(i.h("div",{style:{position:"absolute",left:"".concat(m.x,"px"),top:"".concat(m.y,"px"),height:"".concat(m.height,"px"),width:"".concat(m.width,"px")}},[ju(w)]))}var k=c<d?o:a,C=c<d?a:o,S=Y(u?i.scale.domain():[Math.min(o,a),Math.max(o,a)],2),E=S[0],M=S[1],T=k+1e-5>=E&&k-1e-5<=M,D=C-1e-5<=M&&C+1e-5>=E;T&&n.push(zu({h:i.h,isVertical:r,borderHit:t,value:k,pos:p,align:"start",state:i,idx:s})),D&&n.push(zu({h:i.h,isVertical:r,borderHit:t,value:C,pos:h,align:"end",state:i,idx:s}));var _=i.settings.bubbles;if(_&&_.show){var N={fontSize:_.fontSize,fontFamily:_.fontFamily,color:_.fill},q=[o,a];T&&n.push(Fu({h:i.h,isVertical:r,align:_.align,style:N,rangeIdx:s,idx:0,otherValue:C,value:k,label:"".concat(i.format(k,q)),pos:p,state:i})),D&&n.push(Fu({h:i.h,isVertical:r,align:_.align,style:N,rangeIdx:s,idx:1,otherValue:k,value:C,label:"".concat(i.format(C,q)),pos:h,state:i}))}}function Bu(e){var t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start,r=e.current-e.start;return r=r<0?Math.max(r,n):Math.min(r,t)}function Vu(e){var t=[],n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach((function(r,i){e.active&&i===e.active.idx||Hu({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(r.min,r.max),vEnd:Math.max(r.min,r.max),idx:i})})),e.active){var r=e.start,i=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)r=Math.min(e.active.start,e.active.end),i=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)r=Math.min(e.start,e.current),i=Math.max(e.start,e.current);else{var o=Bu(e);r=e.active.start+o,i=e.active.end+o}Hu({borderHit:5,els:t,isVertical:n,state:e,vStart:r,vEnd:i,idx:e.active.idx})}return t}function Wu(e){return{min:e.scale.min(),max:e.scale.max()}}function Uu(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function $u(e,t,n){var r,i,o=e.ranges,a=-1;for(r=0;r<o.length;r++){if(o[r].min<=t&&t<=o[r].max){a=r,n.min=r?o[r-1].max:n.min,n.max=r+1<o.length?o[r+1].min:n.max;break}if(t<o[r].min){n.max=o[r].min,n.min=r?o[r-1].max:n.min;break}}-1===a&&o.length&&r>=o.length&&(n.min=o[o.length-1].max),-1!==a&&(i={idx:a,start:o[a].min,end:o[a].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=i}function Yu(e){e.renderer.render(Vu(e))}function Xu(e,t){if(!t||!t.isActive())return[];var n=e.scale.data(),r=(n&&n.fields||[]).map((function(e){return e.id()})),i=t.brushes().filter((function(e){return"range"===e.type&&-1!==r.indexOf(e.id)}))[0];return i?i.brush.ranges():[]}function Ku(e,t){for(var n,r=1/0,i=t.domain(),o=t.bandwidth()/2,a=0;a<i.length;++a){var s=Math.abs(e-o-t(i[a]));s<r&&(r=s,n=i[a])}return n}function Gu(e,t){return Math.min.apply(Math,X(e))<=Math.max.apply(Math,X(t))&&Math.max.apply(Math,X(e))>=Math.min.apply(Math,X(t))}function Ju(e){return re(e.reduce((function(e,t){return e.push.apply(e,X(ne(t.bounds))),e}),[]))}var Zu={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{rangeStart:function(e){this.start(e)},rangeMove:function(e){this.move(e)},rangeEnd:function(e){this.end(e)},rangeClear:function(e){this.clear(e)},bubbleStart:function(e){this.bubbleStart(e)}},created:function(){this.state={key:this.settings.key||"brush-range"}},beforeRender:function(e){this.state.rect=e.size.computedInner},renderRanges:function(){this.state.started||(this.state.ranges=Xu(this.state,this.state.brushInstance),this.state.active=null,Yu(this.state))},render:function(e){var t=this,n=this.settings.settings;this.state.direction="vertical"===n.direction?0:1;var r=this.renderer.element().getBoundingClientRect(),i=this.state.rect[0===this.state.direction?"height":"width"],o=Ma(this.chart.scale(n.scale),i),a=function(e){var t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,r=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map((function(t){return e.chart.component(t)})).filter((function(e){return!!e&&!!e.rect})),i=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(i.length>0){var a=Ju(i);if(t.size=a[0===e.state.direction?"height":"width"],t.scale=Ma(e.chart.scale(n.scale),t.size),t.targetRect=a,o.length>0){var s=Ju(o);t.targetFillRect=s}}else if(r&&r.length>0){var l=r.slice(1).reduce((function(e,t){return{x0:Math.min(e.x0,t.rect.computedInner.x),y0:Math.min(e.y0,t.rect.computedInner.y),x1:Math.max(e.x1,t.rect.computedInner.x+t.rect.computedInner.width),y1:Math.max(e.y1,t.rect.computedInner.y+t.rect.computedInner.height)}}),{x0:r[0].rect.computedInner.x,y0:r[0].rect.computedInner.y,x1:r[0].rect.computedInner.x+r[0].rect.computedInner.width,y1:r[0].rect.computedInner.y+r[0].rect.computedInner.height});t.targetRect={x:l.x0-e.state.rect.x,y:l.y0-e.state.rect.y,width:l.x1-l.x0,height:l.y1-l.y0}}return t}(this);if(o=a.scale?a.scale:o,this.state.targetRect=a.targetRect,this.state.targetFillRect=a.targetFillRect,this.state.size=null===a.size?i:a.size,this.state.settings=n,this.state.style=this.style,this.state.offset=r,this.state.brush="object"===R(n.brush)?n.brush.context:n.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!n.multiple,this.state.h=e,this.state.onEditConfirmed=function(e,n,r){t.state.edit=null,function(e,t,n,r){var i=e.ranges.map((function(e){return{min:e.min,max:e.max}})),o=e.scale.min(),a=e.scale.max();i[t]={min:Math.max(o,Math.min(n,r)),max:Math.min(a,Math.max(n,r))},e.ranges[t]=q({},i[t]);var s=e.scale.data();s&&s.fields&&s.fields.forEach((function(t){e.fauxBrushInstance||e.brushInstance.setRange(t.id(),i)}))}(t.state,e,n,r),t.emit("bubbleEnd"),Yu(t.state)},this.state.onEditCanceled=function(){t.state.edit=null,Yu(t.state)},this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX"},this.state.format="function"==typeof n.bubbles.label&&function(e,r){return n.bubbles.label.call(void 0,{datum:e,data:r,scale:o,resources:{scale:t.chart.scale,formatter:t.chart.formatter}})},{}.hasOwnProperty.call(o,"norm")){this.state.editable=!0,this.state.observeBrush="object"===R(n.brush)&&n.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=o;var s=this.state.scale.data();!this.state.format&&s&&s.fields&&s.fields[0]&&(this.state.format=s.fields[0].formatter())}else this.state.editable=!1,this.state.scale=xo(),this.state.scale.data=o.data,this.state.format||(this.state.format=function(e,t){return Gu(o.range(),t)?function(e,t){var n=t.ticks(),r=t.domain().indexOf(Ku(e,t));return-1!==r?n[r].label:"-"}(e,o):"-"}),this.state.fauxBrushInstance=ma(),this.state.findValues=function(e){return function(e,t){var n=t.domain(),r=t.range(),i=[];return e.forEach((function(e){if(Gu(r,[e.min,e.max])){var o=n.indexOf(Ku(e.min,t)),a=n.indexOf(Ku(e.max,t));i.push.apply(i,n.slice(Math.min(o,a),Math.max(o,a)+1))}})),i}(e,o)};return this.state.ranges=Xu(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[Vu(this.state)]:[]},mounted:function(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy:function(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start:function(e){!function(e){var t=e.state,n=e.e,r=e.renderer,i=e.ranges,o=e.targetSize;if(!t.started){t.edit=null;var a=n.center.x-n.deltaX,s=n.center.y-n.deltaY,l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);var u={started:!0};t.offset=D({},r.element().getBoundingClientRect());var c=a-t.offset.left,d=s-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=i(t,t.fauxBrushInstance||t.brushInstance);var f=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],p=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];u.current=t.scale.normInvert(p/t.size),u.start=t.scale.normInvert(f/t.size);var h,m,g=t.ranges,v=Wu(t),y=-1;if(l&&l.hasAttribute("data-idx"))y=parseInt(l.getAttribute("data-idx"),10),v.min=y>0?g[y-1].max:v.min,v.max=y+1<g.length?g[y+1].min:v.max;else{for(h=0;h<g.length;h++){if(g[h].min<=u.start&&u.start<=g[h].max){y=h,v.min=h?g[h-1].max:v.min,v.max=h+1<g.length?g[h+1].min:v.max;break}if(u.start<g[h].min){v.max=g[h].min,v.min=h?g[h-1].max:v.min;break}}-1===y&&g.length&&h>=g.length&&(v.min=g[g.length-1].max)}if(-1!==y||t.multi||(u.ranges=[],v.min=t.scale.min(),v.max=t.scale.max()),-1!==y)if(m={idx:y,start:g[y].min,end:g[y].max,limitLow:v.min,limitHigh:v.max,mode:"move"},l&&l.hasAttribute("data-other-value"))u.start=parseFloat(l.getAttribute("data-other-value")),m.mode="modify";else{var b=t.scale.norm(m.start)*t.size,x=t.scale.norm(m.end)*t.size;Math.abs(f-b)<=o?(u.start=m.end,m.mode="modify"):Math.abs(f-x)<=o&&(u.start=m.start,m.mode="modify")}else m={idx:-1,start:u.start,end:u.current,limitLow:v.min,limitHigh:v.max,mode:"current"};u.active=m,"modify"!==m.mode&&t.targetRect&&!Ms(t.targetRect,{x:c,y:d})||Object.keys(u).forEach((function(e){return t[e]=u[e]}))}}({e:e,state:this.state,renderer:this.renderer,ranges:Xu,targetSize:5})},end:function(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);var n=Wu(e);$u(e,e.current,n)}(this.state,Xu),Yu(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move:function(e){this.state.started&&(!function(e,t){var n=(t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset])/e.size,r=e.scale.normInvert(n);e.current=Math.max(Math.min(r,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){var t=e.ranges.map((function(e){return{min:e.min,max:e.max}}));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{var n=Bu(e);t[e.active.idx].min+=n,t[e.active.idx].max+=n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});var r=e.scale.data();r&&r.fields&&r.fields.forEach((function(n){if(e.fauxBrushInstance){var r=Xu(e,e.fauxBrushInstance),i=e.findValues(r),o=e.findValues(t),a=o.filter((function(e){return-1===i.indexOf(e)})),s=i.filter((function(e){return-1===o.indexOf(e)})),l=a.map((function(e){return{key:n.id(),value:e}})),u=s.map((function(e){return{key:n.id(),value:e}}));e.brushInstance.addAndRemoveValues(l,u),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)}))}(this.state),Yu(this.state))},clear:function(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart:function(e){if(this.state.editable){var t=e.srcEvent||e,n=t.target,r={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(!isNaN(r.rangeIdx)&&JSON.stringify(r)!==JSON.stringify(this.state.edit)){this.state.edit=r,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();var i=n.parentNode;Yu(this.state);var o=i.querySelector("input");o.focus(),o.select()}}}};function Qu(e){e.renderer.render(Vu(e))}function ec(e){return e.rc.ranges()}var tc={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{areaStart:function(e){this.start(e)},areaMove:function(e){this.move(e)},areaEnd:function(e){this.end(e)},areaClear:function(e){this.clear(e)}},created:function(){this.state={key:this.settings.key||"brush-area-dir"}},render:function(e){var t=this;this.state.rect=this.rect;var n=this.settings.settings,r="vertical"===n.direction?0:1,i=this.state.rect[0===r?"height":"width"],o=this.renderer.element().getBoundingClientRect(),a=(n.target?n.target.components||[n.target.component]:[]).map((function(e){return t.chart.component(e)})).filter((function(e){return!!e&&!!e.rect})),s=a[0]?a.slice(1).reduce((function(e,t){return{x0:Math.min(e.x0,t.rect.x),y0:Math.min(e.y0,t.rect.y),x1:Math.max(e.x1,t.rect.x+t.rect.width),y1:Math.max(e.y1,t.rect.y+t.rect.height)}}),{x0:a[0].rect.x,y0:a[0].rect.y,x1:a[0].rect.x+a[0].rect.width,y1:a[0].rect.y+a[0].rect.height}):null;return this.state.targetRect=s?{x:s.x0-this.rect.x,y:s.y0-this.rect.y,width:s.x1-s.x0,height:s.y1-s.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=r,this.state.settings=n,this.state.offset=o,this.state.rc=ta(),this.state.renderer=this.renderer,this.state.multi=!!n.multiple,this.state.h=e,this.state.size=i,this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX",area:0===this.state.direction?"height":"width"},this.state.format=function(e,t){return function(e,t,n){var r=Math.min.apply(Math,X(n)),i=Math.max.apply(Math,X(n)),o={x:e.direction?r+e.rect.x:e.rect.x,y:e.direction?e.rect.y:r+e.rect.y,width:e.direction?i-r:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:i-r},a=e.chart.shapesAt(o,e.settings.brush);if(0===a.length)return"-";var s=a.reduce((function(n,i){var o=n.bounds,a=i.bounds;return t===r?o[e.cssCoord.coord]<=a[e.cssCoord.coord]?n:i:o[e.cssCoord.coord]+o[e.cssCoord.area]>=a[e.cssCoord.coord]+a[e.cssCoord.area]?n:i})),l=e.settings.brush.components.reduce((function(e,t){return e.key===s.key?e:t}));return"function"==typeof e.settings.bubbles.label?e.settings.bubbles.label(s.data):Array.isArray(l.data)&&l.data.length?s.data[l.data[0]].label:s.data&&s.data.label?s.data.label:"-"}(this,e,t)},[]},start:function(e){!function(e){var t=e.state,n=e.e,r=e.renderer,i=e.ranges,o=e.targetSize;if(!t.started){var a=n.center.x-n.deltaX,s=n.center.y-n.deltaY,l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);var u={started:!0};t.offset=r.element().getBoundingClientRect(),t.ranges=i(t);var c=a-t.offset.left,d=s-t.offset.top,f=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],p=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset],h=p,m=f;u.start=f,u.current=p;var g,v,y=t.ranges,b=Uu(t),x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),b.min=x>0?y[x-1].max:b.min,b.max=x+1<y.length?y[x+1].min:b.max;else{for(g=0;g<y.length;g++){if(y[g].min<=m&&m<=y[g].max){x=g,b.min=g?y[g-1].max:b.min,b.max=g+1<y.length?y[g+1].min:b.max;break}if(m<y[g].min){b.max=y[g].min,b.min=g?y[g-1].max:b.min;break}}-1===x&&y.length&&g>=y.length&&(b.min=y[y.length-1].max)}if(-1!==x||t.multi||(u.ranges=[],b.min=0,b.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(v={idx:x,start:y[x].min,end:y[x].max,limitLow:b.min,limitHigh:b.max,mode:"move"},l&&l.hasAttribute("data-other-value"))u.start=parseFloat(l.getAttribute("data-other-value")),v.mode="modify";else{var w=v.start,k=v.end;Math.abs(f-w)<=o?(u.start=v.end,v.mode="modify"):Math.abs(f-k)<=o&&(u.start=v.start,v.mode="modify")}else v={idx:-1,start:m,end:h,limitLow:b.min,limitHigh:b.max,mode:"current"};u.active=v,"modify"!==v.mode&&t.targetRect&&!Ms(t.targetRect,{x:c,y:d})||Object.keys(u).forEach((function(e){return t[e]=u[e]}))}}({e:e,state:this.state,renderer:this.renderer,ranges:ec,targetSize:5})},end:function(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);var n=Uu(e);$u(e,e.current,n)}(this.state,ec),Qu(this.state))},move:function(e){this.state.started&&(!function(e,t){var n=t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];e.current=Math.max(Math.min(n,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){var t=e.ranges.map((function(e){return{min:e.min,max:e.max}}));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{var n=Bu(e);t[e.active.idx].min=e.active.start+n,t[e.active.idx].max=e.active.end+n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});e.rc.set(t);var r=[];t.forEach((function(t){r=[].concat(X(r),X(function(e,t){var n={x:e.direction?t.min+e.rect.x:e.rect.x,y:e.direction?e.rect.y:t.min+e.rect.y,width:e.direction?t.max-t.min:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:t.max-t.min};return e.chart.shapesAt(n,e.settings.brush)}(e,t)))})),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,r)}(this.state),Qu(this.state))},clear:function(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function nc(e){var t="vertical"===e.direction,n=e.rect[t?"height":"width"],r=e.rect[t?"width":"height"];return function(e){var t=e.brush;if(!t||!t.isActive())return[];var n=e.scale.data(),r=(n&&n.fields||[]).map((function(e){return e.id()})),i=t.brushes().filter((function(e){return"range"===e.type&&-1!==r.indexOf(e.id)}))[0];return i?i.brush.ranges():[]}(e).map((function(i){var o=e.scale(i.min)*n,a=e.scale(i.max)*n,s=Math.min(o,a),l=Math.abs(o-a);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:s,width:t?r:l,y:t?s:0,height:t?l:r}}))}function rc(e,t,n,r){function i(){!function(e){e.renderer.render(nc(e))}(e)}function o(){!function(e){e.renderer.render(nc(e))}(e)}function a(){!function(e){e.renderer.render(nc(e))}(e)}e.brush=t,t&&(t.on("start",i),t.on("update",o),t.on("end",a),e.start=i,e.update=o,e.end=a,e.brush=t,e.scale=n,e.renderer=r)}function ic(e){e.brush&&(e.brush.removeListener("start",e.start),e.brush.removeListener("update",e.update),e.brush.removeListener("end",e.end)),e.start=void 0,e.update=void 0,e.end=void 0,e.brush=void 0,e.scale=void 0,e.renderer=void 0}var oc={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:function(){return 50},created:function(){this.state={}},render:function(){var e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",r="horizontal"===n?this.rect.width:this.rect.height,i=Ma(this.chart.scale(e.scale),r);return ic(this.state),rc(this.state,t,i,this.renderer),this.state.rect=this.rect,this.state.fill=e.fill||"#ccc",this.state.opacity=void 0!==e.opacity?e.opacity:1,this.state.direction=n,nc(this.state)},beforeDestroy:function(){ic(this.state)}};function ac(e,t){var n=t.center.x,r=t.center.y;return{x:n-e.left,y:r-e.top}}function sc(e,t,n){return Xa(e,t.points[0])<Math.pow(n.settings.snapIndicator.threshold,2)}function lc(e,t){null==e.path.d?e.path.d="M".concat(t.x," ").concat(t.y," "):e.path.d+="L".concat(t.x," ").concat(t.y," "),e.points.push(t)}function uc(e){var t=e.state,n=e.start,r=void 0===n?null:n,i=e.end,o=void 0===i?null:i;null!==r&&(t.snapIndicator.x1=r.x,t.snapIndicator.y1=r.y),null!==o&&(t.snapIndicator.x2=o.x,t.snapIndicator.y2=o.y)}function cc(e,t){e.snapIndicator.visible=t}var dc={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart:function(e){this.start(e)},lassoEnd:function(e){this.end(e)},lassoMove:function(e){this.move(e)},lassoCancel:function(){this.cancel()}},created:function(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start:function(e){var t;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(e,t){var n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=this.settings.settings.brush.components.map((function(e){return{key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"}}));var n=ac(this.state.rendererBounds,e);lc(this.state,n),uc({state:this.state,start:n}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,n)},move:function(e){if(this.state.active){var t=ac(this.state.rendererBounds,e);sc(t,this.state,this.settings)?cc(this.state,!0):cc(this.state,!1),lc(this.state,t),uc({state:this.state,end:t}),function(e,t){var n=[e.startPoint,e.path,e.snapIndicator].filter((function(e){return e.visible}));t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){var n=e.points[e.points.length-2],r=e.points[e.points.length-1];e.lineBrushShape.x1=n.x+e.componentDelta.x,e.lineBrushShape.y1=n.y+e.componentDelta.y,e.lineBrushShape.x2=r.x+e.componentDelta.x,e.lineBrushShape.y2=r.y+e.componentDelta.y;var i=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(i,{components:e.brushConfig})}}(this.state,this.chart)}},end:function(e){this.state.active&&(cc(this.state,!1),sc(ac(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){var n=e.componentDelta.x,r=e.componentDelta.y,i=e.points.map((function(e){return{x:e.x+n,y:e.y+r}})),o=t.shapesAt({vertices:i},{components:e.brushConfig});t.brushFromShapes(o,{components:e.brushConfig})}}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},cancel:function(){this.state.active&&(!function(e,t){e.brushConfig.forEach((function(e){e.contexts.forEach((function(e){t.brush(e).end()}))}))}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},render:function(){}};function fc(e,t,n,r,i){for(var o,a=0,s=t.length-1;a<s;){var l=Math.floor((a+s)/2);(o=i(t[l]))[n]+o[r]<e[n]?a=l+1:s=l}return a}function pc(e){var t=e.orientation,n=e.targetNodes,r=e.labels,i=e.container,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fc,a=[],s="v"===t?"x":"y",l="v"===t?"width":"height",u=function(e){return e.textBounds},c=function(e){return e.node.localBounds};return function(e,t){var d=r[t],f=d.textBounds,p=d.node;if(f[s]<i[s]||f[s]+f[l]>i[s]+i[l])return!1;for(var h=o(f,a,s,l,u);h<a.length;h++)if(Ss(f,a[h].textBounds))return!1;for(var m=o(f,n,s,l,c),g=f[s]+f[l],v=m;v<n.length;v++){var y=n[v].node;if(g<y.localBounds[s])break;if(Ss(f,y.localBounds)&&p!==y)return!1}return a.push(r[t]),!0}}function hc(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function mc(e){var t=R(e);return("string"===t||"number"===t)&&""!==e}function gc(e){return q({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds)}function vc(e,t,n){return n?e.width>=t.height:e.width>=t.width}function yc(e,t,n){return n?e.height>=t.width:e.height>=t.height}function bc(e,t,n,r,i){var o,a;return"v"===e?(o=r||i||vc(t,n,!0),a=yc(t,n,!r)):(o=vc(t,n),a=i||yc(t,n,!1)),o&&a}function xc(e,t,n,r){return e+.5*t+(r-.5)*(t-n)-.5*n}function wc(e,t,n){var r={type:"text",text:t,maxWidth:n.rotate?e.height:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:n.rotate?"end":"start",baseline:"central",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(!n.overflow&&!function(e,t,n){return vc(e,t,n.rotate)&&yc(e,t,n.rotate)}(e,i,n))return!1;var o=.5*i.height;return n.rotate?(r.x=xc(e.x,e.width,i.height,n.align)+o,r.y=xc(e.y,e.height,i.width,n.justify),r.transform="rotate(-90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,")")):(r.x=xc(e.x,e.width,i.width,n.align),r.y=xc(e.y,e.height,i.height,n.justify)+o),r}function kc(e){var t=e.bar,n=e.view,r=e.direction,i=e.position,o=e.padding,a=void 0===o?4:o,s={};if(D(s,t),i&&"inside"!==i)if("up"===r||"down"===r){var l=Math.max(0,Math.min(t.y,n.height)),u=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===i&&"up"===r||"opposite"===i&&"down"===r?(s.y=0,s.height=l):("outside"===i&&"down"===r||"opposite"===i&&"up"===r)&&(s.y=u,s.height=n.height-u)}else{var c=Math.max(0,Math.min(t.x,n.width)),d=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===i&&"left"===r||"opposite"===i&&"right"===r?(s.x=0,s.width=c):("outside"===i&&"right"===r||"opposite"===i&&"left"===r)&&(s.x=d,s.width=n.width-d)}else;return function(e,t){var n=Math.max(0,Math.min(e.y,t.height)),r=Math.max(0,Math.min(e.y+e.height,t.height)),i=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=i,e.width=o-i,e.y=n,e.height=r-n}(s,n),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.top,r=void 0===n?4:n,i=t.bottom,o=void 0===i?4:i,a=t.left,s=void 0===a?4:a,l=t.right,u=void 0===l?4:l;e.x+=s,e.width-=s+u,e.y+=r,e.height-=r+o}(s,a),s}function Cc(e){var t,n,r,i,o,a=e.direction,s=e.fitsHorizontally,l=e.measured,u=e.node,c=e.orientation,d=e.placementSettings,f=e.rect,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kc,h=[],m="h"===c?"width":"height";for(o=0;o<d.length;o++)if(r=d[o],i=p({bar:u.localBounds,view:f,direction:a,position:r.position,padding:r.padding}),h.push(i),t=!o||i[m]>t[m]?i:t,bc(c,i,l,s,r.overflow)){n=i;break}return n||(n=t,o=h.indexOf(n)),{bounds:n,placement:r=d[o]}}function Sc(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=i.top,a=void 0===o?4:o,s=i.bottom,l=void 0===s?4:s,u=i.left,c=void 0===u?4:u,d=i.right,f=void 0===d?4:d,p=e.x+e.dx,h=e.y+e.dy,m=n?Math.min(t.width,r.height):Math.min(t.height,r.width),g=n?Math.min(t.height,r.height):Math.min(t.width,r.width),v=.5*t.height,y=1e-9,b=n?p-v:p,x=n?h:h-v,w={x:b-c-y,y:x-a-y,width:g+(c+f)-y,height:m+(a+l)-y};return w}function Ec(e){for(var t,n,r,i,o,a,s,l,u,c,d,f,p,h=e.chart,m=e.targetNodes,g=e.rect,v=e.fitsHorizontally,y=e.collectiveOrientation,b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Cc,x=arguments.length>2&&void 0!==arguments[2]?arguments[2]:wc,w=arguments.length>3&&void 0!==arguments[3]?arguments[3]:pc,k=[],C={container:g,targetNodes:m,labels:[],orientation:y},S=0,E=m.length;S<E;S++){a=null,f=hc(r=(n=m[S]).node,h),p="left"===(u=n.direction)||"right"===u?"h":"v";for(var M=0;M<n.texts.length;M++)if(mc(i=n.texts[M])){var T=b({direction:u,fitsHorizontally:v,lblStngs:c=n.labelSettings[M],measured:l=n.measurements[M],node:r,orientation:p,placements:c.placements,placementSettings:n.placementSettings[M],rect:g});if(a=T.bounds,d=T.placement,a&&d){o=d.justify;var D="function"==typeof c.linkData?c.linkData(f,S):void 0,_="function"==typeof d.overflow?d.overflow(f,S):d.overflow;"up"===u&&(o=1-o),"opposite"===d.position&&(o=1-o),"left"===u&&(o=1-o);var N=!("h"===y||v);if(t=x(a,i,{justify:"h"===p?d.align:o,align:"h"===p?o:d.align,fontSize:c.fontSize,fontFamily:c.fontFamily,textMetrics:l,rotate:N,overflow:!!_})){var P=Sc(t,l,N,a,d.padding);s="function"==typeof d.fill?d.fill(q(q({},f),{},{textBounds:P}),S):d.fill,t.fill=s,void 0!==D&&(t.data=D),"object"===R(d.background)&&(t.backgroundColor="function"==typeof d.background.fill?d.background.fill(q(q({},f),{},{textBounds:P}),S):d.background.fill,void 0!==t.backgroundColor&&(t.backgroundBounds=Sc(t,l,N,a,d.background.padding))),k.push(t),C.labels.push({node:r,textBounds:P})}}}}var A=k.filter(w(C)),I=A.filter((function(e){return void 0!==e.backgroundBounds})).map(gc);return[].concat(X(I),X(A))}function Mc(e){for(var t,n,r,i,o,a,s,l=e.nodes,u=e.rect,c=e.chart,d=e.labelSettings,f=e.placementSettings,p=e.settings,h=e.renderer,m={},g=[],v=!0,y=!1,b=0;b<l.length;b++)if(Ss(i=(n=l[b]).localBounds,u)){var x=hc(n,c);t={node:n,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(var w=0;w<d.length;w++)mc(r="function"==typeof(a=d[w]).label?a.label(x,b):void 0)&&(s="function"==typeof p.direction?p.direction(x,b):p.direction||"up",y=y||"left"===s||"right"===s,m.fontFamily=a.fontFamily,m.fontSize="".concat(a.fontSize,"px"),m.text=r,o=h.measureText(m),t.measurements.push(o),t.texts.push(r),t.labelSettings.push(a),t.placementSettings.push(f[w]),t.direction=s,v=v&&o.width<=i.width-8);g.push(t)}return{targetNodes:g,fitsHorizontally:v,hasHorizontalDirection:y}}function Tc(e){var t=e.orientation,n=void 0===t?"auto":t,r=e.defaultOrientation,i=void 0===r?"h":r;switch(n.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return i}}function Dc(e){var t=2*Math.PI;return(e%t+t)%t}function _c(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function Nc(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function qc(e,t,n){var r=t.x,i=t.y;if(r*r+i*i>e*e)return null;var o=Math.sin(n),a=Math.cos(n),s=r*a-i*o,l=e*e-s*s;if(l<0)return null;var u=Math.sqrt(l);return{x:s*a+o*u,y:-s*o+a*u}}function Rc(e){var t,n,r=e.radius,i=e.size,o=e.angle,a=i.width,s=i.height,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(!(t=qc(r,l,o)))return null;t.y*=-1,n={x:-a,y:0};break;case 1:if(!(t=qc(r,l,Math.PI-o)))return null;n={x:-a,y:-s};break;case 2:if(!(t=qc(r,l,o-Math.PI)))return null;t.x*=-1,n={x:0,y:-s};break;case 3:if(!(t=qc(r,l,2*Math.PI-o)))return null;t.x*=-1,t.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:t.x+n.x,y:t.y+n.y,width:a,height:s}}function Pc(e){var t=e.slice,n=e.measured,r=e.padding,i=t.start,o=t.end,a=t.innerRadius,s=t.outerRadius,l=s-a-2*r,u=o-i;if(u<Math.PI){var c=(n.height/2+r)/Math.tan(u/2);c>a&&(l=s-c-2*r)}if(l<0||l<n.minReqWidth)return null;var d=Dc((i+o)/2),f=s-r,p={x:Math.sin(d)*f,y:-Math.cos(d)*f,width:l,height:n.height};return d<Math.PI?(p.angle=d-Math.PI/2,p.anchor="end"):(p.angle=d+Math.PI/2,p.anchor="start"),p}function Ac(e){var t=e.context,n=e.node,r=e.bounds,i=n.desc.slice,o=Dc((i.start+i.end)/2);switch(Math.floor(o/(Math.PI/2))){case 0:t.q1maxY=r.y-2,void 0===t.q2minY&&(t.q2minY=r.y+r.height+2);break;case 1:t.q2minY=r.y+r.height+2;break;case 2:t.q3minY=r.y+r.height+2;break;case 3:t.q4maxY=r.y-2,void 0===t.q3minY&&(t.q3minY=r.y+r.height+2)}}function Ic(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Oc(e,t,n){var r={type:"text",text:t,maxWidth:e.width,x:e.x,y:e.y+("top"===e.baseline?e.height/2:0),fill:n.fill,anchor:e.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(e.angle)){var i=e.angle*(360/(2*Math.PI));r.transform="rotate(".concat(i,", ").concat(r.x,", ").concat(r.y,")")}return r}function Lc(e){var t,n,r=e.slice,i=e.direction,o=e.position,a=e.padding,s=e.measured,l=e.view,u=e.context,c=e.store,d=r.start,f=r.end,p=r.innerRadius,h=r.offset;switch(o){case"into":t="rotate"===i?Pc({slice:r,measured:s,padding:a}):function(e){var t=e.slice,n=e.padding,r=e.measured,i=t.start,o=t.end,a=t.innerRadius,s=t.outerRadius,l=Dc((i+o)/2),u=Rc({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return u?(u.baseline="top",Ts(u,{x1:0,y1:0,x2:Math.sin(i)*s,y2:-Math.cos(i)*s})||Ts(u,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||ys({cx:0,cy:0,r:a},u)?null:(_c(u,n),u)):null}({slice:r,measured:s,padding:a});break;case"inside":n={start:d,end:f,innerRadius:0,outerRadius:p},t="rotate"===i?Pc({slice:n,measured:s,padding:a}):function(e){var t=e.slice,n=e.padding,r=e.measured,i=e.store,o=t.start,a=t.end,s=t.outerRadius,l=Dc((o+a)/2),u=Rc({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return u?(u.baseline="top",_c(u,n),i.insideLabelBounds.some((function(e){return Ss(e,u)}))?null:(i.insideLabelBounds.push({x:u.x-4,y:u.y,width:u.width+8,height:u.height}),u)):null}({slice:n,measured:s,padding:a,store:c});break;case"outside":t="rotate"===i?function(e){var t=e.slice,n=e.measured,r=e.padding,i=e.view,o=t.start,a=t.end,s=t.outerRadius,l=t.offset,u=s+r,c=a-o;if(c<Math.PI&&(n.height/2+r)/Math.tan(c/2)>u)return null;var d=Dc((o+a)/2),f=Math.sin(d)*u,p=-Math.cos(d)*u,h=n.width+1,m=d%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){var g=p<0?i.y:i.y+i.height,v=Math.abs(g-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*r-s;v<h&&(h=v)}if(Math.sin(m)>.001){var y=f<0?i.x:i.x+i.width,b=Math.abs(y-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*r-s;b<h&&(h=b)}if(h<=0||h<n.minReqWidth)return null;var x={x:f,y:p,width:h,height:n.height};return d<Math.PI?(x.angle=d-Math.PI/2,x.anchor="start"):(x.angle=d+Math.PI/2,x.anchor="end"),x}({slice:r,measured:s,padding:a,view:l}):function(e){var t=e.slice,n=e.measured,r=e.padding,i=e.view,o=e.context,a=t.start,s=t.end,l=t.outerRadius,u=t.offset,c=Dc((a+s)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.q4maxY<0;default:return!0}}(o,Math.floor(c/(Math.PI/2)),i))return null;var d=l+r+n.height/2,f=Math.sin(c)*d,p=-Math.cos(c)*d,h=n.width+1;if(c<Math.PI){var m=Math.abs(i.x+i.width-(f+u.x));m<h&&(h=m)}else{var g=Math.abs(i.x-(f+u.x));g<h&&(h=g)}if(h<n.minReqWidth)return null;var v={x:f,y:p,width:h,height:n.height};return c<Math.PI?v.anchor="start":v.anchor="end",v}({slice:r,measured:s,padding:a,view:l,context:u});break;default:throw new Error("not implemented")}return t&&(t.x+=h.x,t.y+=h.y,"outside"===o&&"rotate"!==i&&function(e,t,n){var r=n.start,i=n.end,o=n.offset,a=n.outerRadius,s=Dc((r+i)/2);switch(Math.floor(s/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){var l=Math.min(e.y,t.q1maxY-e.height),u=e.y-l;if(e.y=l,u>1){var c=a+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(s)*c,y2:o.y-Math.cos(s)*c,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){var d=Math.max(e.y,t.q2minY),f=d-e.y;if(e.y=d,f>1){var p=a+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(s)*p,y2:o.y-Math.cos(s)*p,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){var h=Math.max(e.y,t.q3minY),m=h-e.y;if(e.y=h,m>1){var g=a+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(s)*g,y2:o.y-Math.cos(s)*g,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){var v=Math.min(e.y,t.q4maxY-e.height),y=e.y-v;if(e.y=v,y>1){var b=a+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(s)*b,y2:o.y-Math.cos(s)*b,strokeWidth:1}}}}}(t,u,r)),t}function zc(e){for(var t=e.context,n=e.direction,r=e.measured,i=e.node,o=e.placementSettings,a=e.rect,s=e.store,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Lc,u=0;u<o.length;u++){var c=o[u],d=l({context:t,slice:i.desc.slice,view:a,direction:n,position:c.position,measured:r,padding:c.padding,store:s});if(d)return{bounds:d,placement:c}}return{bounds:null,placement:null}}function Fc(e){for(var t=[],n=[],r=[],i=[],o=0;o<e.length;++o){var a=e[o].desc.slice,s=Dc((a.start+a.end)/2);switch(Math.floor(s/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:r.push(e[o]);break;case 3:i.push(e[o])}}var l=function(e,t){return Dc((e.desc.slice.start+e.desc.slice.end)/2)-Dc((t.desc.slice.start+t.desc.slice.end)/2)},u=function(e,t){return l(t,e)};return t.sort(u),n.sort(l),r.sort(u),i.sort(l),t.concat(n,i,r)}function jc(e,t,n){var r=t.fontFamily,i="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:r,fontSize:i});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:r,fontSize:i}).width),o}var Hc=/\n+|\r+|\r\n/,Bc=/\s/,Vc=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function Wc(e){return"string"==typeof e?-1!==e.search(Hc):-1!==String(e).search(Hc)}function Uc(e){return-1!==e.search(Bc)}function $c(e){return-1!==e.search(Vc)}function Yc(e,t,n,r,i){return r.some((function(r){return r(e,t,n)}))?1:i.some((function(r){return r(e,t,n)}))?0:2}function Xc(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}function Kc(e,t,n){return Math.max(t,Math.min(n,e))}function Gc(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.string,n=e.separator,r=void 0===n?"":n,i=e.reverse,o=void 0!==i&&i,a=e.measureText,s=void 0===a?function(e){return{width:e.length,height:1}}:a,l=e.mandatoryBreakIdentifiers,u=void 0===l?[Wc]:l,c=e.noBreakAllowedIdentifiers,d=void 0===c?[]:c,f=e.suppressIdentifier,p=void 0===f?[Uc,Wc,function(e){return""===e}]:f,h=e.hyphenationIdentifiers,m=void 0===h?[$c]:h,g=String(t).split(r);Xc(g);var v=g.length,y=o?function(e){return e>=0}:function(e){return e<v},b=o?v:-1;function x(e){var t=Kc(e,0,v-1),n=g[t],r=s(n),i=Yc(n,t,g,u,d);return{index:t,value:n,breakOpportunity:i,suppress:p.some((function(e){return e(n,t,g)})),hyphenation:m.some((function(e){return e(n,t,g)})),width:r.width,height:r.height,done:!1}}function w(e){return isNaN(e)?o?b--:b++:b=Kc(e,0,v-1),y(b)?x(b):{done:!0}}return{next:w,peek:x,length:v}}var Jc="…",Zc=/^\s*\d+(\.\d+)?px\s*$/i;function Qc(e){return"string"===R(e)&&Zc.test(e)}function ed(e){var t=e["font-size"]||e.fontSize;return Qc(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function td(e){var t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;var r=ed(e);return Math.max(1,Math.min(Math.floor(t/r),n))}function nd(e,t){return{lines:[],line:"",width:0,maxLines:td(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function rd(e){e.lines.push(e.line),e.line="",e.width=0}function id(e,t){e.line+=t.value,e.width+=t.width}function od(e,t,n){if(t.width>e.maxWidth)return t;for(var r=t.index,i=1;i<5;i++){var o=n.peek(t.index-1);if(!t.hyphenation||!o.hyphenation||0===t.index)return t;if(e.width+e.hyphens.metrics.width<=e.maxWidth)return e.line+=e.hyphens.char,t;if(1===e.line.length)return t;t=n.next(r-i),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function ad(e,t,n){for(var r=Gc({string:t.value,measureText:n});e.lines.length<e.maxLines;){var i=r.next();if(i.done)break;e.width+i.width>e.maxWidth&&2===i.breakOpportunity&&e.line.length>0?(i=e.hyphens.enabled?od(e,i,r):i,rd(e),id(e,i)):id(e,i)}}function sd(e,t){for(var n=Gc({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[function(e,t){return 0===t}]}),r=nd(e,t),i=!0;r.lines.length<r.maxLines;){var o=n.next();if(o.done){rd(r),i=!1;break}1===o.breakOpportunity?rd(r):r.width+o.width>r.maxWidth&&2===o.breakOpportunity?o.suppress?r.width+=o.width:(o=r.hyphens.enabled?od(r,o,n):o,rd(r),id(r,o)):id(r,o)}return{lines:r.lines,reduced:i}}function ld(e,t){for(var n=Gc({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),r=nd(e,t),i=!0;r.lines.length<r.maxLines;){var o=n.next();if(o.done){rd(r),i=!1;break}1===o.breakOpportunity?rd(r):r.width+o.width>r.maxWidth&&2===o.breakOpportunity?o.suppress?rd(r):o.width>r.maxWidth?ad(r,o,t):(rd(r),id(r,o)):id(r,o)}return{lines:r.lines,reduced:i}}function ud(e){return{"break-all":sd,"break-word":ld}[e.wordBreak]}function cd(e){return function(t){var n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){var r=ud(n);if(!r)return;var i=e(n);if(i.width>n.maxWidth||Wc(n.text)){var o=(ed(n)-i.height)/2,a=r(n,function(e,t){return function(n){return t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}}(n,e));t.node=function(e,t,n,r){var i={type:"container",children:[]};void 0!==t.id&&(i.id=t.id);var o=0;return e.lines.forEach((function(a,s){var l=D({},t);l.text=a,l._lineBreak=!0,o+=n,e.reduced&&s===e.lines.length-1?l.text+=Jc:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=r,o+=n,i.children.push(l)})),i}(a,n,o,i.height)}}}}function dd(e,t){var n=e.text,r=e["font-size"],i=e["font-family"],o=e.maxWidth;if(n="string"==typeof n?n:"".concat(n),void 0===o)return n;var a=t({text:n,fontSize:r,fontFamily:i}).width;if(a<=o)return n;for(var s=0,l=n.length-1;s<=l;){var u=Math.floor((s+l)/2);(a=t({text:n.substr(0,u)+Jc,fontSize:r,fontFamily:i}).width)<=o?s=u+1:l=u-1}return n.substr(0,l)+Jc}function fd(e){var t=e.baseline||e["dominant-baseline"],n=0,r=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){case"hanging":n=.75*r;break;case"text-before-edge":n=.85*r;break;case"middle":n=.25*r;break;case"central":n=.35*r;break;case"mathemetical":n=r/2;break;case"text-after-edge":case"ideographic":n=.2*-r;break;default:n=0}return n}var pd,hd={},md={},gd={fontSize:void 0,fontFamily:void 0};function vd(e,t,n){var r=e+t+n;return"number"!=typeof md[r]&&(pd=pd||document.createElement("canvas").getContext("2d"),function(e,t){gd.fontSize===e&&gd.fontFamily===t||(pd.font=e+" "+t,gd.fontSize=e,gd.fontFamily=t)}(t,n),md[r]=pd.measureText(e).width),md[r]}function yd(e){return"number"!=typeof hd[e]&&(hd[e]=function(e){if(Qc(e)){var t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),hd[e]}function bd(e){var t=e.text,n=e.fontSize;return{width:vd(t,n,e.fontFamily),height:yd(n)}}function xd(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bd,n=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,i=t({text:e.text,fontFamily:r,fontSize:n}),o=Math.min(e.maxWidth||i.width,i.width),a=e.x||0,s=e.y||0,l=e.dx||0,u=(e.dy||0)+fd(e),c={x:0,y:s+u-.75*i.height,width:o,height:i.height},d=e["text-anchor"]||e.anchor;return c.x="middle"===d?a+l-o/2:"end"===d?a+l-o:a+l,c}function wd(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bd,n=ud(e),r=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:i,fontSize:r});if(n&&(o.width>e.maxWidth||Wc(e.text))){for(var a=n(e,(function(e){return t({text:e,fontFamily:i,fontSize:r})})),s=D({},e),l=0,u="",c=0,d=a.lines.length;c<d;c++){var f=a.lines[c];f+=c===d-1&&a.reduced?Jc:"";var p=t({text:f,fontSize:r,fontFamily:i}).width;p>=l&&(l=p,u=f)}s.text=u;var h=xd(s,t);return h.height=ed(e)*a.lines.length,h}return xd(e,t)}var kd=.9;function Cd(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Sd(e,t,n){var r={type:"text",text:t,maxWidth:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(e.width<n.fontSize)return!1;var o=Math.max(0,e.width-i.width);return r.x=e.x+n.align*o,r.y=e.y+i.height/1.2,r}function Ed(e){return{type:"circle",bounds:{cx:e.cx,cy:e.cy,r:e.r}}}function Md(e){return e.desc&&e.desc.slice?function(e){var t=e.start,n=e.end,r=e.innerRadius,i=e.outerRadius,o=e.offset;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};var a=0!==r?r:i;return Ed({cx:o.x,cy:o.y,r:a})}(e.desc.slice):"circle"===e.type?Ed(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var Td={bar:function(e){var t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,a=e.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ec,l=D({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);var u=t.labels.map((function(e){return D({},l,t,e)})),c=t.labels.map((function(e){return e.placements.map((function(n){return D({},l,t,e,n)}))})),d=Mc({nodes:r,chart:n,renderer:o,settings:t,rect:i,labelSettings:u,placementSettings:c}),f=d.fitsHorizontally,p=d.hasHorizontalDirection,h=d.targetNodes,m=Tc({orientation:t.orientation,defaultOrientation:p?"h":"v"}),g="h"===m?"y":"x",v="h"===m?"height":"width";return h.sort((function(e,t){return e.node.localBounds[g]+e.node.localBounds[v]-(t.node.localBounds[g]+t.node.localBounds[v])})),s({chart:n,targetNodes:h,stngs:t,rect:i,fitsHorizontally:f,collectiveOrientation:m})},slice:function(e){var t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,a=e.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zc,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Oc,u=D({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);u.fontSize=parseInt(u.fontSize,10);for(var c=t.labels.map((function(e){return D({},u,t,e)})),d=t.labels.map((function(e){return e.placements.map((function(n){return D({},u,t,e,n)}))})),f=[],p={insideLabelBounds:[]},h={},m=0,g=(r=Fc(r)).length;m<g;m++)for(var v=r[m],y=Ic(v,n),b=0;b<c.length;b++){var x=c[b],w="function"==typeof x.label?x.label(y,m):"";if(w){var k="function"==typeof x.direction?x.direction(y,m):x.direction||"horizontal",C="function"==typeof x.linkData?x.linkData(y,m):void 0,S=jc(w,x,o),E=s({context:h,direction:k,lblStngs:x,measured:S,node:v,placementSettings:d[b],rect:i,store:p}),M=E.bounds,T=E.placement;if(M&&T){if("outside"===T.position&&"rotate"!==k){Ac({context:h,node:v,bounds:M});var _=Nc(M);if(!cs(_,i))continue}var N="function"==typeof T.fill?T.fill(y,m):T.fill,q=l(M,w,{fill:N,fontSize:x.fontSize,fontFamily:x.fontFamily,textMetrics:S});q&&(void 0!==C&&(q.data=C),f.push(q),M.line&&(M.line.stroke=N,f.push(M.line)))}}}return f},rows:function(e){var t=e.settings,n=e.chart,r=e.nodes,i=e.renderer,o=e.style,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Sd,s=D({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);for(var l=D({},s,t),u=t.labels.map((function(e){return D({},l,e)})),c={},d=[],f=0,p=r.length;f<p;f++){var h=r[f],m=Cd(h,n),g=Md(h),v=g.type,y=g.bounds;if(y){var b=0,x=[],w=[],k="circle"===v?2*y.r*kd:y.height;b+=l.padding;var C=void 0;for(C=0;C<u.length;C++){var S=u[C],E="function"==typeof S.label?S.label(m,f):"";c.fontFamily=S.fontFamily,c.fontSize="".concat(S.fontSize,"px"),c.text=E;var M=i.measureText(c);if((b+=M.height+S.padding)>k)break;w.push(E),x.push(M)}var T=C,_=Math.max(0,k-b),N=void 0;for(N="circle"===v?y.cy-y.r*kd:y.y,N+=l.justify*_+l.padding,C=0;C<T;C++){var q=u[C],R=void 0;if("circle"===v){var P=Math.max(Math.abs(N-y.cy),Math.abs(N+x[C].height-y.cy)),A=Math.sqrt(y.r*y.r-P*P);R={x:y.cx-A+l.padding,y:N,width:2*A-2*l.padding,height:x[C].height}}else R={x:y.x+l.padding,y:N,width:y.width-2*l.padding,height:x[C].height};N+=x[C].height+l.padding;var I="function"==typeof q.fill?q.fill(m,f):q.fill,O="function"==typeof q.linkData?q.linkData(m,f):void 0,L=a(R,w[C],{fill:I,align:q.align,fontSize:q.fontSize,fontFamily:q.fontFamily,textMetrics:x[C]});if(L){if(L.text&&L.text!==Jc){var z=dd(L,i.measureText);if(Jc===z)continue;L.ellipsed=z}void 0!==O&&(L.data=O),d.push(L)}}}}return d}};var Dd={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render:function(){var e=this,t=this.settings.settings,n=[];return(t.sources||[]).forEach((function(t){t.strategy&&Td[t.strategy.type]&&t.component&&n.push.apply(n,X(function(e,t){var n=e.chart,r=e.source,i=e.rect,o=e.renderer,a=e.style;if(!n.component(r.component))return[];var s=n.findShapes(r.selector).filter((function(e){return e.key===r.component}));return t({chart:n,settings:r.strategy.settings,nodes:s,rect:{x:0,y:0,width:i.width,height:i.height},renderer:o,style:a})}({chart:e.chart,rect:e.rect,renderer:e.renderer,source:t,style:e.style},Td[t.strategy.type])))})),n}};var _d={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,justify:.5,align:.5,label:{fontSize:"12px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:136,lineHeight:1.2},shape:{type:"square",size:12}},title:{show:!0,text:void 0,anchor:"start",fontSize:"16px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:156,lineHeight:1.25},navigation:{button:{class:void 0,content:void 0,tabIndex:void 0},disabled:!1}};function Nd(e){var t=e.x,n=void 0===t?0:t,r=e.y,i=e.item,o=e.globalMetrics,a=e.createSymbol,s=e.direction,l=void 0===s?"ltr":s,u=i.label.displayObject,c=i.label.bounds,d=i.symbol.meta,f="rtl"===l,p={x:f?n+o.maxLabelBounds.width:n+o.maxSymbolSize+o.spacing,y:r,width:o.maxLabelBounds.width,height:Math.max(o.maxSymbolSize,o.maxLabelBounds.height)},h=function(e,t,n){var r=Math.max(0,e.width-t),i=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*r,y:e.y+t/2+n.justify*i}}({x:f?n+o.maxLabelBounds.width+o.spacing:n,y:r,width:o.maxSymbolSize,height:p.height},d.size,{align:void 0===d.align?.5:d.align,justify:void 0===d.justify?.5:d.justify}),m=a(D({},d,h));return delete m.collider,u.anchor=f?"end":"start",function(e,t,n){var r=n.textMetrics;if(e.height<r.height)return!1;var i=Math.max(0,e.width-r.width);t.baseline="text-before-edge";var o=Math.max(0,e.height-r.height);t.x=e.x+n.align*i,t.y=e.y+n.justify*o+.175*parseInt(t.fontSize,10)}(p,u,{textMetrics:c,fontSize:parseInt(u.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:i.label.displayObject.data,children:[m,u],collider:{type:"rect",x:n,y:r,width:o.maxItemBounds.width,height:o.maxItemBounds.height}},metrics:p}}function qd(e,t){var n=e.items.length,r=Math.ceil(n/t),i="horizontal"===e.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*r+(r-1)*e.layout.margin[o]}function Rd(e,t){var n,r,i,o,a=t.onScroll,s=void 0===a?function(){}:a,l=null,u=0,c={itemize:function(t){n=function(e,t){for(var n,r,i=e.resolved,o=e.dock,a=[],s=i.items.items,l=i.symbols.items,u=i.labels.items,c=0,d=0,f=0,p=0;p<s.length;p++)if(!1!==s[p].show){var h=void 0!==u[p].text?u[p].text:u[p].data.label||"";n=D({},u[p],{type:"text",fontSize:"".concat(parseInt(u[p].fontSize,10),"px"),text:h,title:h}),r={symbol:{meta:l[p]},label:{displayObject:n,bounds:t.textBounds(n)}},a.push(r),c=Math.max(l[p].size,c),d=Math.max(r.label.bounds.width,d),f=Math.max(r.label.bounds.height,f)}return{items:a,globalMetrics:{spacing:8,maxSymbolSize:c,maxItemBounds:{height:Math.max(c,f),width:c+8+d},maxLabelBounds:{width:d,height:f}},layout:{margin:{vertical:void 0!==i.layout.item.vertical?i.layout.item.vertical:4,horizontal:void 0!==i.layout.item.horizontal?i.layout.item.horizontal:4},mode:i.layout.item.mode,size:i.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:i.layout.item.direction,scrollOffset:i.layout.item.scrollOffset}}}(t,e.renderer),l=isNaN(n.layout.scrollOffset)?l:n.layout.scrollOffset},getItemsToRender:function(t){i=t.viewRect,u=c.getContentOverflow(i);var a=c.extent();l=Math.max(0,Math.min(l,u)),o=D({},i);var s="horizontal"===c.orientation()?"x":"y";return o[s]-=l,o["x"===s?"width":"height"]=a,function(e,t,n){for(var r=e.viewRect,i=n.itemized,o=n.create,a=void 0===o?Nd:o,s=n.parallels,l=n.createSymbol,u=i.layout.direction,c=i.globalMetrics,d=i.items,f="horizontal"===i.layout.orientation,p=0,h=[],m=c.maxItemBounds.height,g=c.maxItemBounds.width,v=i.layout.margin.vertical+m,y=i.layout.margin.horizontal+g,b=t.x,x=t.y,w=r.x-t.x,k=0;k<d.length;k++){var C=a({y:x,x:"rtl"===u?r.x+w+r.width-g-(b-t.x):b,item:d[k],globalMetrics:c,direction:u,createSymbol:l});if((f&&b>=r.x-g||!f&&x>=r.y-m)&&h.push(C.item),++p>=s?(p=0,f?(b+=y,x=t.y):(x+=v,b=t.x)):f?x+=v:b+=y,!f&&x>r.y+r.height)break;if(f&&b>r.x+r.width)break}return h}(t,o,{itemized:n,parallels:r,createSymbol:e.symbol})},parallelize:function(e,t){return r=function(e,t,n){var r=n.items.length,i="horizontal"===n.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical",a=n.globalMetrics.maxItemBounds[i]*r+(r-1)*n.layout.margin[o],s=Math.ceil(a/e);if(null!=t){var l="horizontal"===n.layout.orientation?"height":"width",u="width"===l?"horizontal":"vertical",c=n.layout.margin[u]||4,d=Math.floor((t+c)/(c+n.globalMetrics.maxItemBounds[l]));s=Math.min(s,d)}var f=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(s,f))}(e,t,n)},hasContentOverflow:function(){var e="horizontal"===n.layout.orientation?"width":"height";return qd(n,r)>i[e]},getContentOverflow:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,qd(n,r)-e[t])},getNextSize:function(){var e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:function(){var e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},hasNext:function(){return"horizontal"===c.orientation()?i.x+i.width<o.x+o.width:i.y+i.height<o.y+o.height},hasPrev:function(){return"horizontal"===c.orientation()?o.x<i.x:o.y<i.y},next:function(){c.scroll(-c.getNextSize())},prev:function(){c.scroll(c.getPrevSize())},scroll:function(e){var t=Math.max(0,Math.min(u,l-e));t!==l&&(l=t,s())},offset:function(){return l},orientation:function(){return n.layout.orientation},direction:function(){return n.layout.direction},extent:function(){return qd(n,r)},spread:function(){return function(e,t){var n=t,r="horizontal"===e.layout.orientation?"height":"width",i="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*n+(n-1)*e.layout.margin[i]}(n,r)}};return c}function Pd(e){return Object.keys(e).filter((function(t){return e[t]})).join(" ")}var Ad={up:"▲",right:"▶",down:"▼",left:"◀"};function Id(e,t){var n=t.size,r=t.isActive,i=t.direction,o=t.nav,a={},s="",l=t.attrs;o&&o.button&&("function"==typeof o.button.class?a=o.button.class({direction:i}):o.button.class&&(a=o.button.class),"function"==typeof o.button.content&&(s=o.button.content(e,{direction:i})),void 0!==o.button.tabIndex&&(l.tabindex=o.button.tabIndex));var u={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(a).length||(u.border="0",u.background="none"),(!r||o&&o.disabled)&&(l.disabled="disabled"),e("button",D({class:Pd(a),style:u},l),[s||e("span",{style:{pointerEvents:"none"}},[Ad[i]])])}function Od(e){var t,n={itemize:function(e){t=function(e){var t=e.dock;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:e.navigation}}(e)},render:function(r){return function(e,t,n,r){var i=t.rect,o=t.itemRenderer;if(e&&e.renderArgs){e.size(i);var a=e.renderArgs[0],s="vertical"===n.layout.orientation,l="rtl"===o.direction(),u=o.hasNext(),c=o.hasPrev();if(c||u){var d=s?["right","left"]:["down","up"];l&&s&&d.reverse();var f=[a("div",{style:{position:"relative",display:"flex","flex-direction":s?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!s?"rtl":"ltr"},[Id(a,{size:32,isActive:u,direction:d[0],attrs:{"data-action":"next","data-component-key":r.settings.key},nav:n.navigation}),Id(a,{size:32,isActive:c,direction:d[1],attrs:{"data-action":"prev","data-component-key":r.settings.key},nav:n.navigation})])];e.render(f)}else e.render([])}}(n.renderer,r,t,e)},extent:function(){return 32},spread:function(){return 64}};return n}function Ld(e){var t,n={itemize:function(n){t=function(e,t){var n=e.resolved;if(!1===n.title.item.show)return null;var r=D({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(r.anchor&&"start"!==r.anchor?"end"===r.anchor&&(r.anchor="start"):r.anchor="end"),void 0===n.title.settings.text){var i=t.scale.data().fields;r.text=i&&i[0]?i[0].title():""}return{displayObject:r,bounds:t.renderer.textBounds(r)}}(n,e)},render:function(e){!function(e,t,n){var r=e.rect;if(t){var i=[];if(t.size(r),n){var o={start:0,end:r.width,middle:r.width/2};i.push(D({},n.displayObject,{x:o[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(i)}}(e,n.renderer,t)},spread:function(){return t?t.bounds.height:0},extent:function(){return t?t.bounds.width:0}};return n}function zd(e,t,n,r){var i,o,a,s=r.itemRenderer,l=r.navigationRenderer,u=r.titleRenderer,c=r.isPreliminary,d=void 0!==c&&c,f=0,p={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(i={x:p.x,y:p.y,width:p.width,height:u.spread()},"horizontal"===n){i={x:p.x,y:p.y,width:u.extent(),height:u.spread()};var h=p.width-i.width-(i.width?t.spacing:0),m=p.height;s.parallelize(h,d?void 0:m);var g=s.extent()>h?l.extent():0,v=s.spread(),y=g?l.spread():0;a={x:(o={x:i.x+i.width+(i.width?t.spacing:0),y:p.y+Math.max(0,(y-v)/2),width:p.width-g-i.width-(g?t.spacing:0)-(i.width?t.spacing:0),height:m}).x+o.width+(g?t.spacing:0),y:p.y,width:g,height:p.height},i.y=o.y,"rtl"===s.direction()&&(a.x=p.x,o.x=a.x+a.width+(a.width?t.spacing:0),i.x=o.x+o.width+(i.width?t.spacing:0)),f=Math.max(i.height,y,s.spread())}else{var b=p.height-i.height-(i.height?t.spacing:0),x=p.width;s.parallelize(b,d?void 0:x);var w=s.extent()>b?l.extent():0;a={x:p.x,y:p.y+p.height-w,width:p.width,height:w},o={x:p.x,y:i.y+i.height+(i.height?t.spacing:0),width:p.width,height:p.height-i.height-(i.height?t.spacing:0)-a.height-(a.height?t.spacing:0)},f=Math.max(u.extent(),w?l.spread():0,s.spread())}return o=D({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),a.x+=e.x,a.y+=e.y,i.x+=e.x,i.y+=e.y,{title:D({},e,i),content:D({},e,o),navigation:D({},e,a),orientation:n,preferredSize:f}}function Fd(e){e.state.resolved=function(e){var t=e.scale.domain(),n={items:[]},r=e.settings.layout.dock;if("threshold-color"===e.scale.type){var i=e.scale.data().fields[0],o=function(e){return String(e)};e.settings.formatter?o=e.chart.formatter(e.settings.formatter):i&&(o=i.formatter());for(var a=0;a<t.length-1;a++){var s={value:t[a],label:"".concat(o(t[a])," - < ").concat(o(t[a+1]))};i&&(s.source={field:i.id()}),n.items.push(s)}"vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")&&n.items.reverse()}else{var l=e.scale.labels?e.scale.labels():null;n.items=t.map((function(t,n){var r=e.scale.datum?D({},e.scale.datum(t)):{value:t};return r.value=t,e.scale.label?r.label=e.scale.label(t):l&&(r.label=l[n]),r}))}var u=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:D(!0,{},_d.title,e.style.title),settings:e.settings.settings.title}),c=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:_d.layout,settings:e.settings.settings.layout}),d=e.resolver.resolve({data:n,defaults:D(!0,{},_d.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),f=D(!0,{},(e.settings.settings.item||{}).shape);void 0===f.fill&&e.settings.scale&&(f.fill={scale:e.settings.scale});var p=e.resolver.resolve({data:n,defaults:D(!0,{},_d.item.shape,e.style.item.shape),settings:f}),h=e.resolver.resolve({data:n,defaults:D(!0,{},{show:_d.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function m(e,n){var r=e.data.value,i=t[n+1];e.data.value=[r,i]}return"threshold-color"===e.scale.type&&("vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")?(h.items.reverse().forEach(m),h.items.reverse()):h.items.forEach(m)),{title:u,labels:d,symbols:p,items:h,layout:c}}(e),e.titleRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.itemRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.navigationRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center",navigation:e.settings.settings.navigation}),e.state.display={spacing:8}}function jd(e){var t=e.rect,n=e.settings,r=e.state,i=e.itemRenderer,o=e.navigationRenderer,a=e.titleRenderer,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",u=zd(t,r.display,l,{itemRenderer:i,navigationRenderer:o,titleRenderer:a});e.renderer.size(u.content);var c=i.getItemsToRender({viewRect:D({},u.content,{x:0,y:0})});return o.render({rect:u.navigation,itemRenderer:i}),a.render({rect:u.title}),e.state.views={layout:u},c}var Hd={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted:function(e){e&&e.parentNode&&(this.navigationRenderer.renderer.appendTo(e.parentNode),this.titleRenderer.renderer.appendTo(e.parentNode),e.parentNode.insertBefore(this.navigationRenderer.renderer.element(),e),e.parentNode.insertBefore(this.titleRenderer.renderer.element(),e)),this.navigationRenderer.render({rect:this.state.views.layout.navigation,itemRenderer:this.itemRenderer}),this.titleRenderer.render({rect:this.state.views.layout.title})},beforeUnmount:function(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart:function(){this.state.interaction.started||this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove:function(e){if(this.state.interaction.started){var t="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*e.deltaX:e.deltaY;this.itemRenderer.scroll(t-this.state.interaction.delta),this.state.interaction.delta=t}},panend:function(){this.state.interaction.started=!1},scroll:function(e){this.itemRenderer.scroll(-e)},next:function(){this.itemRenderer.next()},prev:function(){this.itemRenderer.prev()}},created:function(){var e=this;this.state={interaction:{}},this.onScroll=function(){var t=jd(e);e.update(t)},this.itemRenderer=Rd(this,{onScroll:this.onScroll}),this.navigationRenderer=Od(this),this.titleRenderer=Ld(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),Fd(this)},preferredSize:function(e){return function(e,t){var n=0,r=e.settings.layout.dock||"center",i="top"===r||"bottom"===r?"horizontal":"vertical",o=e.state.display,a=zd(t.inner,o,i,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=a.preferredSize,n+o.spacing}(this,e)},beforeUpdate:function(){Fd(this)},render:function(){return jd(this)},beforeDestroy:function(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements:function(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo:function(){return{offset:this.itemRenderer.offset()}}};function Bd(e,t){var n=0,r=e.state.isVertical?"justify":"align",i=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",a=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[a](),n*=Math.min(1,Math.max(e.stgns[r],0)),t[i]+=n}function Vd(e,t,n){var r=n[e];return"object"===R(r)?-1!==r.valid.indexOf(t)?t:r.default:n.default}function Wd(e){return Vd(e.layout.dock,e.settings.title.anchor,{left:{valid:["top"],default:"top"},right:{valid:["top"],default:"top"},top:{valid:["left","right"],default:"left"},bottom:{valid:["left","right"],default:"left"},default:"top"})}function Ud(e,t){var n={x:0,y:0,width:0,height:0},r=e.stgns.padding;return n.x=r.left,n.y=r.top,n.width=t.width-r.left-r.right,n.height=t.height-r.top-r.bottom,n}function $d(e){var t,n="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,r=e.stgns.title,i=e.chart.scale(e.stgns.fill),o=e.chart.scale(e.stgns.major),a=function(e,t){var n=t.domain(),r=n,i=e.stgns.tick.label;return!i&&e.formatter?i=e.formatter:!i&&t.data().fields&&(i=t.data().fields[0].formatter()),"function"==typeof i&&(r=n.map(i).map(String)),n.map((function(n,i){var o=r[i];return{value:n,label:o,pos:t.norm(parseFloat(n,10)),textMetrics:e.renderer.measureText({text:o,fontSize:e.stgns.tick.fontSize,fontFamily:e.stgns.tick.fontFamily})}}))}(e,o),s=Vd((t=e.settings).layout.dock,t.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"});if(void 0===r.text){var l=o.data().fields;r.text=l&&l[0]?l[0].title():""}var u=e.renderer.measureText({text:r.text,fontSize:r.fontSize,fontFamily:r.fontFamily}),c=e.renderer.textBounds({text:r.text,fontSize:r.fontSize,fontFamily:r.fontFamily,maxLines:r.maxLines,maxWidth:r.maxLengthPx,wordBreak:r.wordBreak,hyphens:r.hyphens,lineHeight:r.lineHeight}),d={isVertical:n,nodes:[],title:{anchor:Wd(e.settings),textMetrics:u,textBounds:c,requiredWidth:function(){if(!r.show)return 0;var e=c.width,t=r.maxLengthPx;return n||(e+=r.padding,t+=r.padding),Math.min(e,t,d.rect.width)},requiredHeight:function(){if(!r.show)return 0;var e=c.height;return n&&(e+=r.padding),Math.min(e,d.rect.height)}},ticks:{values:a,anchor:s,length:Math.min(Math.max.apply(Math,X(a.map((function(e){return e.textMetrics.width})))),e.stgns.tick.maxLengthPx),requiredHeight:function(){return"top"===s?Math.max.apply(Math,X(d.ticks.values.map((function(e){return e.textMetrics.height}))))+e.stgns.tick.padding:0},height:Math.max.apply(Math,X(a.map((function(e){return e.textMetrics.height}))))},legend:{fillScale:i,majorScale:o,length:function(){var t=n?"height":"width",r=n?"requiredHeight":"requiredWidth",i=Math.min(d.rect[t],d.rect[t]*e.stgns.length)-d.title[r]();return Math.max(0,Math.min(i,e.stgns.maxLengthPx))}}};return d}var Yd={require:["chart","settings","renderer"],defaultSettings:{layout:{displayOrder:0,dock:"right"},settings:{size:15,length:.5,maxLengthPx:250,align:.5,justify:0,padding:{left:5,right:5,top:5,bottom:5},tick:{label:null,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,anchor:null,padding:5},title:{show:!0,text:void 0,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,padding:5,maxLines:2,wordBreak:"none",lineHeight:1.2,hyphens:"auto",anchor:null}}},preferredSize:function(e){var t=this.state;t.rect=Ud(this,e.inner);var n=this.stgns.size,r=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=r;var i=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){if(t.ticks.values.reduce((function(e,t){return e+t.textMetrics.height}),0)>this.state.legend.length())return i;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return i;n+=Math.max.apply(Math,X(t.ticks.values.map((function(e){return e.textMetrics.height}))))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===t.title.anchor||"right"===t.title.anchor?Math.max(t.title.textBounds.height+r,n):Math.max(n,t.title.requiredWidth()+r)),this.state.preferredSize=n,n},created:function(){this.stgns=this.settings.settings,this.state=$d(this)},beforeUpdate:function(e){this.stgns=e.settings.settings,this.state=$d(this)},beforeRender:function(e){if(this.state.nodes=[],this.state.rect=Ud(this,e.size),this.stgns.title.show){var t=function(e){var t=e.state,n=e.stgns,r="left"===t.ticks.anchor,i="top"===t.ticks.anchor,o=t.rect.x,a=t.rect.y,s="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0,s="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=r?t.rect.width:0,a+=t.title.textMetrics.height,s=r?"end":"start");var l={tag:"legend-title",type:"text",x:o,y:Math.min(a,t.rect.y+t.rect.height),text:n.title.text,fill:n.title.fill,fontSize:n.title.fontSize,fontFamily:n.title.fontFamily,maxWidth:n.title.maxLengthPx,maxLines:n.title.maxLines,wordBreak:n.title.wordBreak,hyphens:n.title.hyphens,lineHeight:n.title.lineHeight,anchor:s,title:n.title.text};return Bd(e,l),l}(this);this.state.nodes.push(t)}var n,r,i,o=function(e,t){var n=e.state,r=e.stgns,i=n.rect,o=i.x,a=i.y,s=n.isVertical?r.size:n.legend.length(),l=n.isVertical?n.legend.length():r.size;"left"===n.ticks.anchor?o+=n.rect.width-r.size:"top"===n.ticks.anchor&&(a+=n.rect.height-r.size),"top"===n.title.anchor?a+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());var u={type:"rect",x:o,y:a,width:s,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return Bd(e,u),u}(this,(r=(n=this).state.legend.fillScale,i=n.state.legend.majorScale,r.domain().map((function(e){return{type:"stop",color:r(e),offset:Math.min(1,Math.max(0,i.norm(e)))}})).sort((function(e,t){return e.offset-t.offset})))),a={id:"legend-seq-target",type:"container",children:[o,function(e,t){var n=e.state,r=e.stgns,i="start",o={type:"rect",x:t.x,y:t.y,width:n.isVertical?0:t.width,height:n.isVertical?t.height:0,fill:"transparent"},a=n.ticks.values.map((function(a){var s=0,l=0,u=0,c="alphabetical";return n.isVertical?(l=t.y+t.height*a.pos,c=0===a.pos?"text-before-edge":"text-after-edge"):s=t.x+t.width*a.pos,"right"===n.ticks.anchor?(s=t.x+r.size+r.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(s=t.x-r.tick.padding,i="end"):"top"===n.ticks.anchor?(l=t.y-r.tick.padding,u-=.25*a.textMetrics.height,i=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+r.tick.padding,u=.8*a.textMetrics.height,i=0===a.pos?"start":"end",o.y=t.y+t.height),{type:"text",x:s,y:l,dx:0,dy:u,text:a.label,fontSize:r.tick.fontSize,fontFamily:r.tick.fontFamily,fill:r.tick.fill,maxWidth:n.isVertical?r.tick.maxLengthPx:Math.min(r.tick.maxLengthPx,n.legend.length()/2),anchor:i,textBoundsFn:e.renderer.textBounds,title:a.label,baseline:c}}));return{type:"container",id:"legend-seq-ticks",children:[].concat(X(a),[o])}}(this,o)]};this.state.nodes.push(a)},render:function(){return this.state.nodes}};var Xd={step:function(e){return new at(e,.5)},stepAfter:function(e){return new at(e,1)},stepBefore:function(e){return new at(e,0)},linear:Le,basis:function(e){return new Ue(e)},cardinal:Xe.tension(0),catmullRom:Ge,monotonex:function(e){return new tt(e)},monotoney:function(e){return new nt(e)},natural:function(e){return new it(e)}},Kd={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},connect:!1,orientation:"horizontal",layers:{curve:"linear",show:!0,sort:void 0,line:{stroke:"#ccc",strokeWidth:1,strokeLinejoin:"miter",strokeDasharray:void 0,opacity:1,show:!0,showMinor0:!0},area:{fill:"#ccc",opacity:.8,show:!0}}};function Gd(e,t){var n=t.generator,r=t.item,i=t.data,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=n(e),s={type:"path",d:a,opacity:r.opacity,stroke:r.stroke,strokeWidth:r.strokeWidth,strokeLinejoin:r.strokeLinejoin,fill:o||r.fill,data:i};return r.strokeDasharray&&(s.strokeDasharray=r.strokeDasharray),s}function Jd(e){var t=function(e){for(var t=e.data,n=e.stngs,r=e.rect,i=e.resolver,o=e.style,a=e.domain,s=r.width,l=r.height,u=i.resolve({data:t,defaults:Kd.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:s,minor:"vertical"===n.orientation?s:l}}),c=!n.connect&&a.length>2&&("function"==typeof n.coordinates.layerId||"object"===R(n.coordinates.layerId)),d={},f=0,p=0;p<u.items.length;p++){var h=u.items[p],m=h.layerId;if(c){var g=d[m]?d[m].items[d[m].items.length-1]:null,v=g?a.indexOf(g.data.major?g.data.major.value:g.data.value):null;g&&a.indexOf(h.data.major?h.data.major.value:h.data.value)-1!==v&&d[m].items.push({dummy:!0})}d[m]=d[m]||{order:f++,id:m,items:[],dataItems:[],consumableData:{}},d[m].dataItems.push(h.data),d[m].items.push(h)}var y=Object.keys(d).map((function(e){return d[e].consumableData=q({points:d[e].dataItems},d[e].dataItems[0]),d[e]})),b={items:y.map((function(e){return e.consumableData}))},x=n.layers||{};return{coordinates:u,metaLayers:y,layers:i.resolve({data:b,defaults:{curve:Kd.layers.curve,show:Kd.layers.show},settings:{curve:x.curve,show:x.show}}),lines:i.resolve({data:b,defaults:D({},Kd.layers.line,o.line),settings:x.line}),areas:i.resolve({data:b,defaults:D({},Kd.layers.area,o.area),settings:x.area})}}(e),n=t.metaLayers,r=t.coordinates,i=t.layers,o=t.lines,a=t.areas,s=[];return n.forEach((function(t,n){var l=i.items[n];if(!1!==l.show){l.datum=l.data,l.data=[],l.id=t.id;for(var u,c,d=[],f=[],p=0;p<t.items.length;p++){if(c=(u=t.items[p]).data,!u.dummy){if(isNaN(u.major))continue;e.missingMinor0&&(u.minor0=r.settings.minor.scale?r.settings.minor.scale(c.minor0?c.minor0.value:0):0),isNaN(u.minor)||d.push(u.minor),l.data.push(u.data)}f.push(u)}var h=d.sort((function(e,t){return e-t}))[Math.floor((d.length-1)/2)];s.push({layerObj:l,lineObj:o.items[n],areaObj:a.items[n],median:h,points:f,consumableData:t.consumableData})}})),s}var Zd={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created:function(){},render:function(e){var t=e.data,n=this.rect,r=n.width,i=n.height;this.stngs=this.settings.settings||{};var o=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,a=Jd({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:o,domain:this.stngs.coordinates&&this.stngs.coordinates.major&&this.stngs.coordinates.major.scale?this.chart.scale(this.stngs.coordinates.major.scale).domain():[]});if(this.stngs.layers&&this.stngs.layers.sort){var s=a.map((function(e){return{id:e.layerObj.id,data:e.layerObj.data}})).sort(this.stngs.layers.sort).map((function(e){return e.id}));a.sort((function(e,t){return s.indexOf(e.layerObj.id)-s.indexOf(t.layerObj.id)}))}else a.sort((function(e,t){return e.median-t.median}));return function(e,t){var n=t.width,r=t.height,i=t.missingMinor0,o=t.stngs,a=[],s=o.layers||{};return e.forEach((function(e){var t,l,u=e.lineObj,c=e.layerObj,d=e.areaObj,f=e.points,p=je(),h=o.coordinates?o.coordinates.defined:null,m={size:r,p:"y"},g={size:n,p:"x"};if("vertical"===o.orientation){var v=D(!0,{},g);g=D(!0,{},m),m=D(!0,{},v)}p[g.p]((function(e){return e.major*g.size}))["".concat(m.p,"1")]((function(e){return e.minor*m.size}))["".concat(m.p,"0")]((function(e){return e.minor0*m.size})).curve(Xd["monotone"===c.curve?"monotone".concat(g.p):c.curve]),h?p.defined((function(e){return!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined})):p.defined((function(e){return!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)}));var y=o.connect?f.filter(p.defined()):f;t=p["line".concat(m.p.toUpperCase(),"1")](),l=p["line".concat(m.p.toUpperCase(),"0")](),s.area&&!1!==d.show&&a.push(Gd(y,{data:e.consumableData,item:d,generator:p})),u&&!1!==u.show&&(a.push(Gd(y,{data:e.consumableData,item:u,generator:t},"none")),!i&&s.area&&!1!==d.show&&!1!==u.showMinor0&&a.push(Gd(y,{data:e.consumableData,item:u,generator:l},"none")))})),a}(a,{width:r,height:i,missingMinor0:o,stngs:this.stngs})}};function Qd(e,t){var n,r,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"===R(t.center)?(n=t.center.x,r=t.center.y):(n=t.clientX,r=t.clientY);var o=n-e.state.boundingRect.left,a=r-e.state.boundingRect.top;return{x:i?Math.max(0,Math.min(o,e.rect.width)):o,y:i?Math.max(0,Math.min(a,e.rect.height)):a}}function ef(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function tf(e,t){var n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-r}}var nf={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart:function(e){this.start(e)},areaMove:function(e){this.move(e)},areaEnd:function(e){this.end(e)},areaCancel:function(){this.cancel()}},created:function(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:function(){return 0},render:function(){},start:function(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();var t=Qd(this,e,!1);Ms({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=this.settings.settings.brush.components.map((function(e){return{key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"}})),this.state.start=Qd(this,e),this.state.active=!0)},move:function(e){var t;this.state.active&&(this.state.end=Qd(this,e),function(e){if(e.state.active){var t=ef(e,e.state.start),n=ef(e,e.state.end),r=e.chart.shapesAt(tf(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(r,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([D({type:"rect"},tf(t.state.start,t.state.end),t.style.area)]))},end:function(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel:function(){this.state.active&&(!function(e,t){e.brushConfig.forEach((function(e){Array.isArray(e.contexts)&&e.contexts.forEach((function(e){t.brush(e).end()}))}))}(this.state,this.chart),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function rf(e,t,n){var r=n.renderer,i=n.style,o=n.props,a=n.h,s=function(e,t){return{tooltip:"function"==typeof e.tooltipClass?e.tooltipClass({dock:t.dock}):e.tooltipClass,content:"function"==typeof e.contentClass?e.contentClass({dock:t.dock}):e.contentClass,arrow:"function"==typeof e.arrowClass?e.arrowClass({dock:t.dock}):e.arrowClass}}(o,t),l=function(e,t,n,r){return r.content({h:e,style:n,data:t})}(a,e,i,o),u=a("div",{dir:o.direction,class:Pd(D({"pic-tooltip":!0},s.tooltip)),style:D({position:"relative",display:"inline-block"},t.computedTooltipStyle)},a("div",{style:i.content,class:Pd(D({"pic-tooltip-content":!0},s.content))},l),a("div",{class:Pd(D({"pic-tooltip-arrow":!0},s.arrow)),style:D({},i.arrow,i["arrow-".concat(t.dock)],t.computedArrowStyle)}));return r.render(u),r.element().children[0]}function of(e){var t=e.defaultDuration,n=e.defaultDelay,r=null,i=null,o=!1,a=function(){var e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};return e.set=function(e){t[e].forEach((function(t){return t(e)}))},e.on=function(e,n){Array.isArray(e)?e.forEach((function(e){return t[e].push(n)})):t[e].push(n)},e.destroy=function(){Object.keys(t).forEach((function(e){t[e].length=0}))},e}(),s=function(){},l=function(){r=null,i=null,o=!1,a.set("fulfilled")};return s.invoke=function(e){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;r&&(clearTimeout(r),a.set("debounced")),a.set("pending"),r=setTimeout((function(){e(),o=!0,r=null,a.set("active")}),u),s>0&&(i&&clearTimeout(i),i=setTimeout(l,s+Math.max(u,0)))},s.clear=function(){o?a.set("cancelled"):r&&(clearTimeout(r),a.set("rejected")),i&&clearTimeout(i),r=null,i=null,o=!1},s.on=function(e,t){a.on(e,t)},s.destroy=function(){s.clear(),a.destroy()},s}function af(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-e,"px)"),right:"translate(".concat(e,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-e,"px)"),bottom:"translate(-50%, ".concat(e,"px)")}}function sf(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-e-n,y:-t/2},right:{x:n,y:-t/2},top:{x:-e/2,y:-t-n},bottom:{x:-e/2,y:n}}}function lf(e){return{left:{left:"100%",top:"calc(50% - ".concat(e,"px)"),borderWidth:"".concat(e,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% - ".concat(e,"px)"),borderWidth:"".concat(e,"px")},top:{left:"calc(50% - ".concat(e,"px)"),top:"100%",borderWidth:"".concat(e,"px")},bottom:{left:"calc(50% - ".concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(e,"px")}}}function uf(e,t,n,r,i,o){var a=t+o.x,s=n+o.y,l=i;return!(a<0||s<0)&&!(a+r>e.width||s+l>e.height)}function cf(e){var t=e.area,n=e.vx,r=e.vy,i=e.width,o=e.height,a=e.offset,s=n+a.x,l=r+a.y,u=i,c=o,d=s<0?-s:0,f=l<0?-l:0;return{x:d+=s+u>t.width?-(s+u-t.width):0,y:f+=l+c>t.height?-(l+c-t.height):0}}function df(e){var t=e.options,n=e.pointer,r=e.width,i=e.height,o=e.dockOrder,a=e.x,s=e.y,l=n.targetBounds,u=af(t.offset),c=u[t.dock];if(c)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c},computedArrowStyle:lf(t.offset)[t.dock],dock:t.dock};for(var d={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},f=sf(r,i,t.offset),p=[],h="target"===t.area?a:l.left+a,m="target"===t.area?s:l.top+s,g=0;g<o.length;g+=1){var v=o[g],y=cf({area:d,vx:h,vy:m,width:r,height:i,offset:f[v]}),b={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u[v]},x=lf(t.offset)[v];0!==y.x&&(b.width="".concat(r-20-Math.abs(y.x),"px"),"top"!==v&&"bottom"!==v||(b.left="".concat(a+y.x,"px"),x.left="calc(50% ".concat(y.x>0?"-":"+"," ").concat(Math.abs(y.x),"px)")));var w={computedTooltipStyle:b,computedArrowStyle:x,dock:v,rect:{width:r,height:i}};if(0===y.x&&0===y.y)return w;w.offset=y,p.push(w)}return p.sort((function(e,t){return Math.abs(e.offset.x)-Math.abs(t.offset.x)})),p[0]}function ff(e,t,n){var r=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!r)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};var i=r.rect;return D({scaleRatio:i.scaleRatio},i.computedInner)}var pf,hf={bounds:function(e){var t=e.resources,n=e.nodes,r=e.pointer,i=e.width,o=e.height,a=e.options,s=r.targetBounds,l=t.getNodeBoundsRelativeToTarget(n[0]),u=l.x,c=l.y,d=l.width,f=l.height,p={left:{x:u,y:c+f/2},right:{x:u+d,y:c+f/2},top:{x:u+d/2,y:c},bottom:{x:u+d/2,y:c+f}},h=af(a.offset),m=h[a.dock];if(m)return{computedTooltipStyle:{left:"".concat(p[a.dock].x,"px"),top:"".concat(p[a.dock].y,"px"),transform:m},computedArrowStyle:lf(a.offset)[a.dock],dock:a.dock};for(var g={width:"target"===a.area?s.width:window.innerWidth,height:"target"===a.area?s.height:window.innerHeight},v=sf(i,o,a.offset),y=["top","left","right","bottom"],b=0;b<y.length;b+=1){var x=y[b];if(uf(g,"target"===a.area?p[x].x:s.left+p[x].x,"target"===a.area?p[x].y:s.top+p[x].y,i,o,v[x]))return{computedTooltipStyle:{left:"".concat(p[x].x,"px"),top:"".concat(p[x].y,"px"),transform:h[x]},computedArrowStyle:lf(a.offset)[x],dock:x}}return{computedTooltipStyle:{left:"".concat(p.top.x,"px"),top:"".concat(p.top.y,"px"),transform:h.top},computedArrowStyle:lf(a.offset).top,dock:"top"}},pointer:function(e){var t=e.options,n=e.pointer,r=e.width,i=e.height;return df({x:n.x,y:n.y,pointer:n,width:r,height:i,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){var t=e.options,n=e.pointer,r=e.width,i=e.height,o=e.nodes,a=e.resources,s=o[0],l=n.dx,u=n.dy,c=a.getComponentBoundsFromNode(s),d=l+c.x+c.width/2,f=u+c.y+c.height/2,p=s.desc.slice,h=p.start,m=p.end,g=p.outerRadius,v=(h+m)/2-Math.PI/2,y=2*Math.PI,b=(v%y+y)%y,x=["top","left","right","bottom"];return"auto"===t.dock&&(x=b<=Math.PI/4||b>=7*Math.PI/4?["right","top","bottom","left"]:b<=3*Math.PI/4?["bottom","left","right","top"]:b<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),df({x:d+g*c.scaleRatio.x*Math.cos(b),y:f+g*c.scaleRatio.y*Math.sin(b),pointer:n,width:r,height:i,options:t,dockOrder:x})}};function mf(e,t){var n=e.width,r=e.height,i=t.chart,o=t.state,a=t.props,s={resources:{formatter:i.formatter,scale:i.scale,component:i.component,getComponentBoundsFromNode:function(e){return ff(e,o.pointer,i)},getNodeBoundsRelativeToTarget:function(e){return function(e,t,n){var r=ff(e,t,n),i=e.bounds;return{x:r.x+t.dx+i.x,y:r.y+t.dy+i.y,width:i.width,height:i.height}}(e,o.pointer,i)}},nodes:o.activeNodes,pointer:o.pointer,width:n,height:r},l=R(a.placement);if("object"===l&&"function"==typeof a.placement.fn)return a.placement.fn(s);var u={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(u=D(u,a.placement(s))),"object"===l&&hf[a.placement.type]?u=D(u,a.placement):"string"===l&&hf[a.placement]&&(u=D(u,{type:a.placement})),s.options=u;var c=hf[u.type](s),d=s.resources.getComponentBoundsFromNode(s.nodes[0]),f=d.x,p=d.y,h=d.width,m=d.height;return h+=f+=s.pointer.dx,m+=p+=s.pointer.dy,c.computedTooltipStyle.left="".concat(Math.min(Math.max(0,f,parseFloat(c.computedTooltipStyle.left)),h),"px"),c.computedTooltipStyle.top="".concat(Math.min(Math.max(0,p,parseFloat(c.computedTooltipStyle.top)),m),"px"),c}function gf(){pf=null}function vf(e,t){var n=t.chart,r=t.state,i=0,o=0;e.center?(i+=e.center.x,o+=e.center.y):(i+=e.clientX,o+=e.clientY);var a=n.element.getBoundingClientRect(),s=r.targetElement.getBoundingClientRect(),l=i,u=o,c=a.left-s.left,d=a.top-s.top,f=i-a.left,p=o-a.top;return{x:i-=s.left,y:o-=s.top,dx:c,dy:d,cx:f,cy:p,clientX:l,clientY:u,targetBounds:s,chartBounds:a}}var yf={require:["chart","renderer"],defaultSettings:{settings:{duration:8e3,delay:500,filter:function(e){return e.filter((function(e){return e.data&&void 0!==e.data.value}))},extract:function(e){return e.node.data.value},content:function(e){var t=e.h;return e.data.map((function(e){return t("div",{},e)}))},isEqual:function(e,t){return e.length&&e.length===t.length&&e.every((function(e,n){return t[n]&&JSON.stringify(e.data)===JSON.stringify(t[n].data)}))},placement:{type:"pointer",dock:"auto",offset:8,area:"viewport"},tooltipClass:{},contentClass:{},arrowClass:{},direction:"ltr",appendTo:void 0,beforeShow:void 0,afterShow:void 0,beforeHide:void 0,onHide:void 0,afterHide:void 0},style:{tooltip:{},content:{backgroundColor:"$gray-25",color:"$font-color--inverted",fontFamily:"$font-family",fontSize:"$font-size",lineHeight:"$line-height",borderRadius:"4px",padding:"8px",opacity:.9},arrow:{position:"absolute",width:"0px",height:"0px",borderStyle:"solid",color:"$gray-25",opacity:.9},"arrow-bottom":{borderTopColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-top":{borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-right":{borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent"},"arrow-left":{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent"}}},renderer:"dom",on:{hide:function(){this.hide()},show:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent:function(e){this.prevent(e)}},hide:function(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show:function(e){var t,n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.nodes,o=r.duration,a=r.delay;!this.state.prevent&&this.state.targetElement&&(this.state.pointer=vf(e,this),t=Array.isArray(i)?this.props.filter(i):this.props.filter(this.chart.shapesAt({x:this.state.pointer.cx,y:this.state.pointer.cy})),this.props.isEqual(this.state.activeNodes,t)||(this.dispatcher.clear(),this.state.activeNodes=t,this.state.activeNodes.length&&this.dispatcher.invoke((function(){return n.invokeRenderer(n.state.activeNodes)}),o,a)))},prevent:function(e){this.state.prevent=!!e},init:function(e){var t=this;this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=of({defaultDuration:this.props.duration,defaultDelay:this.props.delay});var n=this.dispatcher.clear;this.dispatcher.on("pending",(function(){!function(e){pf&&pf!==e&&pf()}(n),pf=n,"function"==typeof t.props.beforeShow&&t.props.beforeShow.call(void 0,{resources:{formatter:t.chart.formatter,scale:t.chart.scale}})})),this.dispatcher.on(["cancelled","fulfilled"],(function(){var e={resources:{formatter:t.chart.formatter,scale:t.chart.scale}};"function"==typeof t.props.beforeHide&&t.props.beforeHide.call(void 0,D({element:t.state.tooltipElm},e)),"function"==typeof t.props.onHide?t.props.onHide.call(void 0,D({element:t.state.tooltipElm},e)):t.renderer.clear([]),"function"==typeof t.props.afterHide&&t.props.afterHide.call(void 0,e),pf===n&&(pf=null),t.state.tooltipElm=void 0})),this.dispatcher.on("active",(function(){"function"==typeof t.props.afterShow&&t.props.afterShow.call(void 0,{element:t.state.tooltipElm,resources:{formatter:t.chart.formatter,scale:t.chart.scale}})}))},created:function(){this.init(this.settings)},beforeUpdate:function(e){var t=e.settings;this.dispatcher&&(this.dispatcher.destroy(),gf()),this.init(t)},render:function(e){return this.h=e,[]},beforeDestroy:function(){this.dispatcher.destroy(),gf()},appendTo:function(){if(this.props.appendTo){this.state.targetElement="function"==typeof this.props.appendTo?this.props.appendTo({resources:{formatter:this.chart.formatter,scale:this.chart.scale}}):this.props.appendTo;var e=this.state.targetElement.getBoundingClientRect(),t=e.width,n=e.height;this.renderer.destroy(),this.renderer.size({width:t,height:n}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted:function(){this.appendTo()},updated:function(){this.appendTo()},invokeRenderer:function(e){var t=function(e,t){var n=t.chart,r=t.scale,i=t.props,o=t.h,a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:r,h:o},s=[];return e.forEach((function(e){if("function"==typeof i.extract){var t=D({node:e},a);s.push(i.extract(t))}})),s}(e,this),n=mf(rf(t,{style:{left:"0px",top:"0px",visibility:"hidden"}},this).getBoundingClientRect(),this);this.state.tooltipElm=rf(t,n,this)}};var bf={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update:function(){this.draw()}},draw:function(){var e=this,t=this.chart.findShapes(this.props.selector).filter((function(t){return t.key===e.props.target})).filter((function(e){return e.collider})).map((function(e){return e.collider}));t.forEach((function(t){t.fill=e.props.fill,t.stroke=e.props.stroke,t.opacity=e.props.opacity,t.collider={type:null}})),this.renderer.render(t)},created:function(){this.props=this.settings.settings},resize:function(e){var t=e.outer,n=e.inner;return this.props.useOuterRect?t:n},render:function(){},mounted:function(){this.draw()},updated:function(){this.props=this.settings.settings,this.draw()}},xf=2*Math.PI;function wf(e,t,n,r){return Math.abs(e.x+n.x-(t.x+t.x))+Math.abs(e.y+n.y-(t.y+t.y))+Math.abs(t.x+r.x-(n.x+n.x))+Math.abs(t.y+r.y-(n.y+n.y))}function kf(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function Cf(e,t,n,r,i){var o=1-e;return Math.pow(o,3)*t+3*Math.pow(o,2)*e*n+3*o*Math.pow(e,2)*r+Math.pow(e,3)*i}function Sf(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||wf(e,t,n,r)<=10)return i[i.length-1]!==e&&i.push(e),i.push(r),i;var a=.5,s=kf(e,t),l=kf(t,n),u=kf(n,r),c={x:Cf(a,e.x,t.x,n.x,r.x),y:Cf(a,e.y,t.y,n.y,r.y)},d=kf(s,l),f=kf(l,u);return Sf(e,s,d,c,i,o-1),Sf(c,f,u,r,i,o-1),i}function Ef(e,t,n){var r=function(e,t,n){return{cp1:{x:e.x+2/3*(t.x-e.x),y:e.y+2/3*(t.y-e.y)},cp2:{x:n.x+2/3*(t.x-n.x),y:n.y+2/3*(t.y-n.y)}}}(e,t,n);return Sf(e,r.cp1,r.cp2,n)}function Mf(e,t,n){var r,i,o,a,s=[],l=!!e[4],u=!!e[5],c=e[3],d=e[6],f=e[7],p=e[1],h=e[2];if("a"===e[0]&&(d+=t,f+=n),t===f&&n===f)return s;if(!p||!h)return s.push({x:d,y:f}),s;var m=function(e,t,n,r,i,o,a,s,l){var u,c,d,f,p,h,m=Ha(n%360),g=Math.cos(m),v=Math.sin(m),y=(s-o)/2,b=(l-a)/2,x=g*y+v*b,w=g*b-v*y;e=Math.abs(e),t=Math.abs(t),(h=Math.pow(x,2)/Math.pow(e,2)+Math.pow(w,2)/Math.pow(t,2))>1&&(e*=h=Math.sqrt(h),t*=h);var k=e*t,C=e*w,S=t*x,E=Math.pow(C,2)+Math.pow(S,2),M=Math.pow(k,2)-E,T=Math.sqrt(Math.max(M/E,0));r===i&&(T=-T);var D=T*(C/t),_=T*(-S/e);f=g*D-v*_+(s+o)/2,p=v*D+g*_+(l+a)/2;var N=(x-D)/e,q=(w-_)/t,R=(-x-D)/e,P=(-w-_)/t;return u=Math.atan2(q,N),u+=u<0?xf:0,c=Math.atan2(P,R),d=(c+=c<0?xf:0)-u,!i&&u<c?d-=xf:i&&c<u&&(d+=xf),{startAngle:u,sweepAngle:d%=xf,cx:f,cy:p,rx:e,ry:t}}(p,h,c,l,u,d,f,t,n);r=m.cx,i=m.cy,p=m.rx,h=m.ry,o=m.sweepAngle,a=m.startAngle;for(var g=Math.abs(o*Math.sqrt((Math.pow(p,2)+Math.pow(h,2))/2)),v=Math.ceil(g/10),y=o/v,b=1;b<=v;b++){var x=(a+y*b)%xf,w=Math.cos(x),k=Math.sin(x);s.push({x:r+w*p+-k*w,y:i+k*h+w*k})}return s}function Tf(e){for(var t=b.parsePath(e),n=[],r=[],i=0,o=0,a=null,s=null,l=null,u=null,c=0;c<t.length;++c){var d=t[c],f=d[0];switch("S"!==f&&"s"!==f&&"C"!==f&&"c"!==f&&(a=null,s=null),"T"!==f&&"t"!==f&&"Q"!==f&&"q"!==f&&(l=null,u=null),f){case"m":r.length&&n.push(r.splice(0));case"l":i+=d[1],o+=d[2],r.push({x:i,y:o});break;case"M":r.length&&n.push(r.splice(0));case"L":i=d[1],o=d[2],r.push({x:i,y:o});break;case"H":i=d[1],r.push({x:i,y:o});break;case"h":i+=d[1],r.push({x:i,y:o});break;case"V":o=d[1],r.push({x:i,y:o});break;case"v":o+=d[1],r.push({x:i,y:o});break;case"a":r.push.apply(r,X(Mf(d,i,o))),i+=d[6],o+=d[7];break;case"A":r.push.apply(r,X(Mf(d,i,o))),i=d[6],o=d[7];break;case"c":r.push.apply(r,X(Sf({x:i,y:o},{x:d[1]+i,y:d[2]+o},{x:d[3]+i,y:d[4]+o},{x:d[5]+i,y:d[6]+o}))),a=d[3]+i,s=d[4]+o,i+=d[5],o+=d[6];break;case"C":r.push.apply(r,X(Sf({x:i,y:o},{x:d[1],y:d[2]},{x:d[3],y:d[4]},{x:d[5],y:d[6]}))),a=d[3],s=d[4],i=d[5],o=d[6];break;case"s":null!==a&&null!==a||(a=i,s=o),r.push.apply(r,X(Sf({x:i,y:o},{x:2*i-a,y:2*o-s},{x:d[1]+i,y:d[2]+o},{x:d[3]+i,y:d[4]+o}))),a=d[1]+i,s=d[2]+o,i+=d[3],o+=d[4];break;case"S":null!==a&&null!==a||(a=i,s=o),r.push.apply(r,X(Sf({x:i,y:o},{x:2*i-a,y:2*o-s},{x:d[1],y:d[2]},{x:d[3],y:d[4]}))),a=d[1],s=d[2],i=d[3],o=d[4];break;case"Q":r.push.apply(r,X(Ef({x:i,y:o},{x:d[1],y:d[2]},{x:d[3],y:d[4]}))),l=d[1],u=d[2],i=d[3],o=d[4];break;case"q":r.push.apply(r,X(Ef({x:i,y:o},{x:d[1]+i,y:d[2]+o},{x:d[3]+i,y:d[4]+o}))),l=d[1]+i,u=d[2]+o,i+=d[3],o+=d[4];break;case"T":null!==l&&null!==l||(l=i,u=o),l=2*i-l,u=2*o-u,r.push.apply(r,X(Ef({x:i,y:o},{x:l,y:u},{x:d[1],y:d[2]}))),i=d[1],o=d[2];break;case"t":null!==l&&null!==l||(l=i,u=o),l=2*i-l,u=2*o-u,r.push.apply(r,X(Ef({x:i,y:o},{x:l,y:u},{x:d[1]+i,y:d[2]+o}))),i+=d[1],o+=d[2];break;case"z":case"Z":r.length&&r.push({x:r[0].x,y:r[0].y})}}return function(e){for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];Math.abs(n.x-r.x)<1e-12&&Math.abs(n.y-r.y)<1e-12&&(e.splice(t,1),t--)}}(r),n.push(r.splice(0)),n}var Df={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update:function(){this.draw()}},draw:function(){var e=this,t=this.chart.findShapes("path").filter((function(t){return t.key===e.props.target})),n=[];t.forEach((function(t){Tf(t.attrs.d).forEach((function(t){t.forEach((function(t){n.push({type:"circle",cx:t.x,cy:t.y,r:e.props.radius,fill:e.props.fill,stroke:e.props.stroke,opacity:e.props.opacity,collider:{type:null}})}))}))})),this.renderer.render(n)},created:function(){this.props=this.settings.settings},resize:function(e){var t=e.outer,n=e.inner;return this.props.useOuterRect?t:n},render:function(){},mounted:function(){this.draw()},updated:function(){this.props=this.settings.settings,this.draw()}};var _f=[function(e){e.component("box",Fl),e.component("box-marker",Fl)},function(e){e.component("point",$l),e.component("point-marker",$l)},function(e){e.component("pie",Gl)},function(e){e.component("grid-line",tu)},function(e){e.component("ref-line",lu)},function(e){e.component("axis",Nu)},function(e){e.component("container",qu)},function(e){e.component("text",Au)},function(e){e.component("scrollbar",Lu)},function(e){e.component("brush-range",Zu),e.component("brush-area-dir",tc)},function(e){e.component("range",oc)},function(e){e.component("brush-lasso",dc)},function(e){e.component("labels",Dd)},function(e){e.component("legend-cat",Hd)},function(e){e.component("legend-seq",Yd)},function(e){e.component("line",Zd)},function(e){e.component("brush-area",nf)},function(e){e.component("tooltip",yf)},function(e){e.component("debug-collider",bf)},function(e){e.component("debug-path-to-points",Df)}],Nf=function(){function e(t){P(this,e),this._parent=null,this._children=[],this._ancestors=null,this.type=t,this.data=null}return I(e,[{key:"detach",value:function(){return this._parent&&this._parent.removeChild(this),this}},{key:"parent",get:function(){return this._parent}},{key:"isBranch",get:function(){return this._children&&this._children.length}},{key:"children",get:function(){return this._children}},{key:"ancestors",get:function(){var e;this._ancestors||(this._ancestors=[],this.parent&&(e=this._ancestors).push.apply(e,[this.parent].concat(X(this.parent.ancestors))));return this._ancestors}},{key:"descendants",get:function(){var e,t,n=[],r=this.children.length;for(e=0;e<r;e++)t=this.children[e],n.push(t),t.children.length&&(n=[].concat(X(n),X(t.descendants)));return n}},{key:"equals",value:function(e){var t=this.children,n=e.children;if(t.length!==n.length)return!1;for(var r=0;r<t.length;r++)if(!t[r].equals(n[r]))return!1;return!0}},{key:"toJSON",value:function(){return{type:this.type,children:this.children.map((function(e){return e.toJSON()}))}}}]),e}(),qf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i,a=t.width,s=void 0===a?0:a,l=t.height,u=void 0===l?0:l,c=t.minWidth,d=void 0===c?0:c,f=t.minHeight,p=void 0===f?0:f;P(this,e),this.set({x:r,y:o,width:s,height:u,minWidth:d,minHeight:p})}return I(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,u=e.minWidth,c=void 0===u?0:u,d=e.minHeight,f=void 0===d?0:d;this.type="rect",a>=0?(this.x=n,this.width=Math.max(a,c)):(this.x=n+Math.min(a,-c),this.width=-Math.min(a,-c)),l>=0?(this.y=i,this.height=Math.max(l,f)):(this.y=i+Math.min(l,-f),this.height=-Math.min(l,-f))}},{key:"containsPoint",value:function(e){return Ms(this,e)}},{key:"intersectsLine",value:function(e){return Ts(this,ie(e))}},{key:"intersectsRect",value:function(e){return Ss(this,re(e))}},{key:"intersectsCircle",value:function(e){return ys(e,this)}},{key:"intersectsPolygon",value:function(e){return Cs(e,this)}},{key:"intersectsGeoPolygon",value:function(e){return Is(e,this)}},{key:"points",value:function(){return[{x:this.x,y:this.y},{x:this.x+this.width,y:this.y},{x:this.x+this.width,y:this.y+this.height},{x:this.x,y:this.y+this.height}]}}]),e}();var Rf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.cx,r=void 0===n?0:n,i=t.cy,o=void 0===i?0:i,a=t.r,s=void 0===a?0:a,l=t.minRadius,u=void 0===l?0:l;P(this,e),this.set({cx:r,cy:o,r:s,minRadius:u})}return I(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cx,n=void 0===t?0:t,r=e.cy,i=void 0===r?0:r,o=e.r,a=void 0===o?0:o,s=e.minRadius,l=void 0===s?0:s;this.type="circle",this.cx=n,this.cy=i,this.r=Math.max(a,l),this.vector={x:this.cx,y:this.cy}}},{key:"containsPoint",value:function(e){return vs(this,e)}},{key:"intersectsLine",value:function(e){return bs(this,ie(e))}},{key:"intersectsRect",value:function(e){return ys(this,re(e))}},{key:"intersectsCircle",value:function(e){return function(e,t){if(ps(e)||ps(t))return!1;var n=e.cx-t.cx,r=e.cy-t.cy;return Math.pow(n,2)+Math.pow(r,2)<=Math.pow(e.r+t.r,2)}(this,e)}},{key:"intersectsPolygon",value:function(e){return xs(this,e)}},{key:"intersectsGeoPolygon",value:function(e){return Rs(this,e)}},{key:"points",value:function(){return[{x:this.cx,y:this.cy}]}}]),e}();var Pf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.x1,r=void 0===n?0:n,i=t.y1,o=void 0===i?0:i,a=t.x2,s=void 0===a?0:a,l=t.y2,u=void 0===l?0:l,c=t.tolerance,d=void 0===c?0:c;P(this,e),this.set({x1:r,y1:o,x2:s,y2:u,tolerance:d})}return I(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x1,n=void 0===t?0:t,r=e.y1,i=void 0===r?0:r,o=e.x2,a=void 0===o?0:o,s=e.y2,l=void 0===s?0:s,u=e.tolerance,c=void 0===u?0:u;this.type="line",this.x1=n,this.y1=i,this.x2=a,this.y2=l,this.tolerance=Math.max(0,Math.round(c)),this.vectors=this.points(),this.zeroSize=n===a&&i===l}},{key:"containsPoint",value:function(e){return this.tolerance>0?bs({cx:e.x,cy:e.y,r:this.tolerance},this):_s(this,e)}},{key:"intersectsLine",value:function(e){return Ds(this,ie(e))}},{key:"intersectsRect",value:function(e){return Ts(re(e),this)}},{key:"intersectsCircle",value:function(e){return bs(e,this)}},{key:"intersectsPolygon",value:function(e){return ks(e,this)}},{key:"intersectsGeoPolygon",value:function(e){return As(e,this)}},{key:"points",value:function(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}]),e}();function Af(e){var t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function If(e){for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}var Of=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.vertices,r=void 0===n?[]:n;P(this,e),this.set({vertices:r})}return I(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vertices,n=void 0===t?[]:t;if(this.type="polygon",this.vertices=n.slice(),this.edges=[],If(this.vertices),!(this.vertices.length<=2)){Af(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(var r=0;r<this.vertices.length;r++)r<this.vertices.length-1&&this.edges.push([this.vertices[r],this.vertices[r+1]]),this.xMin=isNaN(this.xMin)?this.vertices[r].x:Math.min(this.xMin,this.vertices[r].x),this.xMax=isNaN(this.xMax)?this.vertices[r].x:Math.max(this.xMax,this.vertices[r].x),this.yMin=isNaN(this.yMin)?this.vertices[r].y:Math.min(this.yMin,this.vertices[r].y),this.yMax=isNaN(this.yMax)?this.vertices[r].y:Math.max(this.yMax,this.vertices[r].y);this._bounds=null,this._boundingRect=null}}},{key:"containsPoint",value:function(e){return ws(this,e)}},{key:"intersectsCircle",value:function(e){return xs(e,this)}},{key:"intersectsLine",value:function(e){return ks(this,ie(e))}},{key:"intersectsRect",value:function(e){return Cs(this,re(e))}},{key:"intersectsPolygon",value:function(e){return Ns(this,e)}},{key:"intersectsGeoPolygon",value:function(e){return qs(e,this)}},{key:"points",value:function(){return this.vertices}},{key:"bounds",value:function(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}},{key:"boundingRect",value:function(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}]),e}();function Lf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Of,t)}function zf(e){var t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function Ff(e){for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}var jf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.vertices,r=void 0===n?[[]]:n;P(this,e),this.set({vertices:r})}return I(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vertices,n=void 0===t?[]:t;this.type="geopolygon",this.vertices=n.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(var r=0;r<this.numPolygons;r++)Ff(this.vertices[r]),this.vertices[r].length>2&&zf(this.vertices[r]),this.polygons[r]=Lf({vertices:this.vertices[r]}),this.xMin=isNaN(this.xMin)?this.polygons[r].xMin:Math.min(this.xMin,this.polygons[r].xMin),this.xMax=isNaN(this.xMax)?this.polygons[r].xMax:Math.max(this.xMax,this.polygons[r].xMax),this.yMin=isNaN(this.yMin)?this.polygons[r].yMin:Math.min(this.yMin,this.polygons[r].yMin),this.yMax=isNaN(this.yMax)?this.polygons[r].yMax:Math.max(this.yMax,this.polygons[r].yMax);this._bounds=null,this._boundingRect=null}},{key:"containsPoint",value:function(e){return Ps(this,e)}},{key:"intersectsCircle",value:function(e){return Rs(e,this)}},{key:"intersectsLine",value:function(e){return As(this,ie(e))}},{key:"intersectsRect",value:function(e){return Is(this,re(e))}},{key:"intersectsPolygon",value:function(e){return qs(this,e)}},{key:"intersectsGeoPolygon",value:function(e){return n=e,r=(t=this).boundingRect(),i=n.boundingRect(),!!Ss(r,i)&&(Es(i,r)?gs(n,t):gs(t,n));var t,n,r,i}},{key:"points",value:function(){return this.vertices}},{key:"bounds",value:function(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}},{key:"boundingRect",value:function(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}]),e}();function Hf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(jf,t)}function Bf(e,t){return e.x!==t.x||e.y!==t.y}var Vf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.points,r=void 0===n?[]:n;P(this,e),this.set({points:r})}return I(e,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.points,n=void 0===t?[]:t;if(this.type="polyline",this.segments=[],this._points=n.slice(),this._points.length>1)for(var r=0,i=this._points.length-1;r<i;r++)Bf(this._points[r],this._points[r+1])&&this.segments.push({x1:this._points[r].x,y1:this._points[r].y,x2:this._points[r+1].x,y2:this._points[r+1].y})}},{key:"containsPoint",value:function(e){return this.segments.some((function(t){return _s(t,e)}))}},{key:"intersectsCircle",value:function(e){return this.segments.some((function(t){return bs(e,t)}))}},{key:"intersectsLine",value:function(e){var t=ie(e);return this.segments.some((function(e){return Ds(e,t)}))}},{key:"intersectsRect",value:function(e){var t=re(e);return this.segments.some((function(e){return Ts(t,e)}))}},{key:"intersectsPolygon",value:function(e){return this.segments.some((function(t){return ks(e,t)}))}},{key:"intersectsGeoPolygon",value:function(e){return this.segments.some((function(t){return As(e,t)}))}},{key:"points",value:function(){return this._points}}]),e}();var Wf=ft();function Uf(e,t){return Wf.get(e)(t)}Wf.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(qf,t)})),Wf.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Rf,t)})),Wf.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Pf,t)})),Wf.add("polygon",Lf),Wf.add("geopolygon",Hf),Wf.add("polyline",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Vf,t)}));var $f=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];P(this,e),this.set(t)}return I(e,[{key:"set",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],t.forEach((function(t){var n=Uf(t.type,t);n&&e.geometries.push(n)}))}},{key:"containsPoint",value:function(e){return this.geometries.some((function(t){return t.containsPoint(e)}))}},{key:"intersectsLine",value:function(e){return this.geometries.some((function(t){return t.intersectsLine(e)}))}},{key:"intersectsRect",value:function(e){return this.geometries.some((function(t){return t.intersectsRect(e)}))}},{key:"intersectsCircle",value:function(e){return this.geometries.some((function(t){return t.intersectsCircle(e)}))}},{key:"intersectsPolygon",value:function(e){return this.geometries.some((function(t){return t.intersectsPolygon(e)}))}},{key:"intersectsGeoPolygon",value:function(e){return this.geometries.some((function(t){return t.intersectsGeoPolygon(e)}))}}]),e}();var Yf=function(){function e(){P(this,e),this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}return I(e,[{key:"clone",value:function(){return(new e).multiply(this)}},{key:"set",value:function(e){return this._elements=e,this}},{key:"save",value:function(){return this._stack.push(this.elements),this}},{key:"restore",value:function(){return this._stack.length&&(this._elements=this._stack.pop()),this}},{key:"add",value:function(e){var t,n;for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]+=e;return this}},{key:"translate",value:function(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}},{key:"rotate",value:function(e){var t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}},{key:"multiply",value:function(t){var n,r,i,o;if(t instanceof e&&(t=t._elements),Array.isArray(t)){for(i=[[0,0,0],[0,0,0],[0,0,0]],n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)for(o=0;o<3;o++)i[n][r]+=this._elements[n][o]*t[o][r];this._elements=i}else for(n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)this._elements[n][r]*=t;return this}},{key:"scale",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}},{key:"transform",value:function(e,t,n,r,i,o){return this.multiply([[e,n,i],[t,r,o],[0,0,1]]),this}},{key:"determinant",value:function(){var e=this._elements[0][0],t=this._elements[0][1],n=this._elements[0][2],r=this._elements[1][0],i=this._elements[1][1],o=this._elements[1][2],a=this._elements[2][0],s=this._elements[2][1],l=this._elements[2][2];return e*i*l+t*o*a+n*r*s-n*i*a-t*r*l-e*o*s}},{key:"invert",value:function(){var e=this.determinant(),t=this._elements[0][0],n=this._elements[0][1],r=this._elements[0][2],i=this._elements[1][0],o=this._elements[1][1],a=this._elements[1][2],s=this._elements[2][0],l=this._elements[2][1],u=this._elements[2][2];return this._elements=[[o*u-a*l,r*l-n*u,n*a-r*o],[a*s-i*u,t*u-r*s,r*i-t*a],[i*l-o*s,s*n-t*l,t*o-n*i]],this.multiply(1/e),this}},{key:"transpose",value:function(){var e=Object.create(this._elements);return this._elements=[[e[0][0],e[1][0],e[2][0]],[e[0][1],e[1][1],e[2][1]],[e[0][2],e[1][2],e[2][2]]],this}},{key:"identity",value:function(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}},{key:"toString",value:function(){return"".concat(this._elements.map((function(e){return e.join("\t")})).join("\n"))}},{key:"isIdentity",value:function(){var e=this._elements;return 1===e[0][0]&&0===e[0][1]&&0===e[0][2]&&0===e[1][0]&&1===e[1][1]&&0===e[1][2]&&0===e[2][0]&&0===e[2][1]&&1===e[2][2]}},{key:"transformPoint",value:function(e){var t,n,r=[e.x,e.y,1],i=this._elements,o=[0,0,0];for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)o[t]+=r[n]*i[t][n];return{x:o[0],y:o[1]}}},{key:"transformPoints",value:function(e){var t,n,r,i,o,a=this._elements,s=[];for(i=0;i<e.length;i++){for(t=[e[i].x,e[i].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)o[n]+=t[r]*a[n][r];s.push({x:o[0],y:o[1]})}return s}},{key:"elements",get:function(){var e=this._elements;return[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]],[e[2][0],e[2][1],e[2][2]]]}}]),e}(),Xf=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function Kf(e,t){var n=t.args[0]*(Math.PI/180);if(t.args.length>2){var r=t.args[1],i=t.args[2];e.translate(r,i),e.rotate(n),e.translate(-r,-i)}else 1===t.args.length&&e.rotate(n)}function Gf(e,t){var n=t.args[0],r=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,r)}function Jf(e,t){var n=t.args[0],r=isNaN(t.args[1])?0:t.args[1];e.translate(n,r)}function Zf(e,t){t.args.length>=6&&e.transform.apply(e,X(t.args))}function Qf(e,t){for(var n,r=function(e){for(var t,n=[];null!==(t=Xf.exec(e));){var r=t[2].trim(),i=-1===r.indexOf(",")?r.split(" "):r.split(",");n.push({cmd:t[1],args:i.filter((function(e){return e.trim().length>0})).map((function(e){return Number(e)}))})}return n}(e),i=0,o=r.length;i<o;i++)"rotate"===(n=r[i]).cmd?Kf(t,n):"scale"===n.cmd?Gf(t,n):"matrix"===n.cmd?Zf(t,n):"translate"===n.cmd&&Jf(t,n)}var ep={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},tp={type:function(e,t){return t.filter((function(t){var n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()}))},attr:function(e,t,n,r){return r.filter((function(r){var i=r.attrs[e];if(!t)return void 0!==i;if(void 0===i)return!1;switch(t){case"=":return n===String(i);case"!=":return n!==String(i);default:return!1}}))},universal:function(e){return e},tag:function(e,t){return t.filter((function(t){var n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))}))}};var np={find:function(e,t){var n,r,i=[],o=[];if(t.isBranch){var a;n=function(e){var t,n,r,i,o=[];return e.split(/\s*,\s*/).forEach((function(e){e=e.trim(),t=[];for(var a=function(o){(r=e.match(ep[o]))&&(i=!0,e=e.slice(r[0].length),n={type:o,value:r[0]},"attr"===o&&(r=r[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),n.attribute=r[1],n.operator=r[2],n.attributeValue=r[3]),t.push(n))};e&&(i=!1,(r=e.match(/^\s*([>+~]|\s)\s*/))&&(i=!0,t.push({type:" ",value:r[0]}),e=e.slice(r[0].length)),Object.keys(ep).forEach(a),t&&t.length&&o.indexOf(t)<0&&o.push(t),i););})),o}(e),r=t.descendants;for(var s=function(e,t){a=n[e];var i=[],s=r.slice(),l=!1;a.reverse().forEach((function(e){if(" "===e.type)return i.push(s),s=r.slice(),void(l=!1);s=function(e,t){if(!t||!t.length||!e||"function"!=typeof tp[e.type])return[];switch(e.type){case"type":return tp[e.type](e.value,t);case"attr":return tp[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return tp[e.type](t);case"tag":return tp[e.type](e.value,t);default:return[]}}(e,s),l=!0})),l&&i.push(s);var u=i[0].filter((function(e){for(var t,n=e.parent,r=1;r<i.length;r++){for(t=i[r].indexOf(n);n&&t<0;)n=n.parent,t=i[r].indexOf(n);if(t<0)return!1}return!0}));o.push(u)},l=0,u=n.length;l<u;l++)s(l);for(var c=0,d=o.length;c<d;c++)for(var f=0,p=o[c].length;f<p;f++)i.indexOf(o[c][f])<0&&i.push(o[c][f])}return i||[]}};function rp(e,t,n){var r=e.type,i=e.points();n&&(i=i.every((function(e){return Array.isArray(e)}))?i.map((function(e){return n.transformPoints(e)})):n.transformPoints(i)),function(e,t){for(var n=0,r=e.length;n<r;n++)e[n].x/=t,e[n].y/=t}(i,t);var o=null;if("rect"===r||"bounds"===r)(o=re(i)).type=r;else if("circle"===r)(o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(i,e.r)).type=r;else if("line"===r)(o=ie(i)).type=r;else if("polygon"===r||"polyline"===r){o={type:"path",d:Fa(i,"polygon"===r)}}else if("geopolygon"===r){for(var a="",s=0;s<i.length;s++)a+=Fa(i[s],!0);o={type:"path",d:a}}return o}var ip=function(){function e(t){var n=this;P(this,e),this._bounds=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=t.boundingRect?t.boundingRect(e):{x:0,y:0,width:0,height:0},r=n.x,i=n.y,o=n.width,a=n.height;return{x:r,y:i,width:o,height:a}},this._attrs=t.attrs,this._type=t.type,this._data=t.data,this._dpi=t.stage?t.stage.dpi:1,this._collider=function(){return function(e,t){if(e.collider){var n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map((function(e){return rp(e,t,n)}))}:rp(e.collider,t,n)}return null}(t,n._dpi)},this._desc=t.desc,this._tag=t.tag,this._children=function(){return t.children.map((function(t){return new e(t)}))},this._parent=function(){return t.parent?new e(t.parent):null},this._cache={elementBoundingRect:null},this._getElementBoundingRect=function(){return!n._cache.elementBoundingRect&&n.element&&(n._cache.elementBoundingRect=n.element.getBoundingClientRect()),n._cache.elementBoundingRect||{left:0,top:0}}}return I(e,[{key:"children",get:function(){return this._children()}},{key:"parent",get:function(){return this._parent()}},{key:"type",get:function(){return this._type}},{key:"data",get:function(){return this._data}},{key:"attrs",get:function(){return this._attrs}},{key:"element",get:function(){return this._element},set:function(e){this._cache.elementBoundingRect=null,this._element=e}},{key:"key",get:function(){return this._key},set:function(e){this._key=e}},{key:"bounds",get:function(){var e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}},{key:"localBounds",get:function(){return this._bounds(!1)}},{key:"boundsRelativeTo",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=R(e),r=t?this.bounds:this.localBounds,i=this._getElementBoundingRect(),o=i.left,a=i.top;if("object"===n&&null!==e&&"function"==typeof e.getBoundingClientRect){var s=e.getBoundingClientRect(),l=s.left,u=void 0===l?0:l,c=s.top,d=void 0===c?0:c;o-=u,a-=d}return r.x+=o,r.y+=a,r}},{key:"collider",get:function(){return this._collider()}},{key:"desc",get:function(){return this._desc}},{key:"tag",get:function(){return this._tag}}]),e}();function op(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(ip,t)}var ap=function(){function e(t){P(this,e),this._node=op(t),this._parent=null,this._input=null}return I(e,[{key:"node",get:function(){return this._node}},{key:"parent",get:function(){return this._parent},set:function(e){this._parent=e}},{key:"input",get:function(){return this._input},set:function(e){this._input=e}}]),e}();function sp(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(ap,t)}function lp(e,t){var n=e.parent;if(n&&"stage"!==n.type){t.parent=sp(n);var r=n.parent;r&&"stage"!==r.type&&lp(r,t.parent)}}function up(e,t,n){if(null===e.colliderType)return null;var r=function(e,t){var n={};if(e.modelViewMatrix)if(Array.isArray(t))n=e.inverseModelViewMatrix.transformPoints(t);else if(isNaN(t.r))Array.isArray(t.vertices)?n.vertices=e.inverseModelViewMatrix.transformPoints(t.vertices):n=e.inverseModelViewMatrix.transformPoint(t);else{var r={x:t.cx,y:t.cy},i=e.inverseModelViewMatrix.transformPoint(r);n.cx=i.x,n.cy=i.y,n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every((function(e){return Array.isArray(e)}))?Hf(n):Lf(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(var r=e.descendants.length-1;r>=0;r--){var i=e.descendants[r];if(null!==i.collider&&i.collider[t](n)){var o=sp(i);return lp(i,o),o}}return null}(e,t,r):function(e,t,n){if(e.collider[t](n)){var r=sp(e);return lp(e,r),r}return null}(e,t,r)}function cp(e,t,n,r){for(var i=e.length,o=0;o<i;o++){var a=e[o],s=up(a,t,r);s&&n.push(s),!a.children||s||a.collider||cp(a.children,t,n,r)}}function dp(e,t,n){for(var r=e.length,i=0;i<r;i++){var o=e[i];if(null!==up(o,t,n))return!0;if(o.children&&!o.collider)return dp(o.children,t,n)}return!1}function fp(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=oe(e),r={};switch(n){case"circle":return r.cx=e.cx*t,r.cy=e.cy*t,r.r=e.r,["intersectsCircle",r];case"rect":return["intersectsRect",r=ne(e).map((function(e){return Ua(e,t)}))];case"line":return["intersectsLine",r=te(e).map((function(e){return Ua(e,t)}))];case"point":return["containsPoint",r=Ua(e,t)];case"polygon":return r.vertices=e.vertices.map((function(e){return Ua(e,t)})),["intersectsPolygon",r];case"geopolygon":return r.vertices=e.vertices.map((function(e){return e.map((function(e){return Ua(e,t)}))})),["intersectsGeoPolygon",r];default:return[]}}function pp(e,t){var n=Y(fp(t,e.dpi),2),r=n[0],i=n[1],o=[];return r&&(cp([e],r,o,i),function(e,t){for(var n=0,r=t.length;n<r;n++)t[n].input=e}(t,o)),o}function hp(e,t){var n=Y(fp(t,e.dpi),2);return dp([e],n[0],n[1])}var mp=function(e){L(n,e);var t=W(n);function n(e){var r;return P(this,n),(r=t.call(this,e))._stage=null,r._collider={type:null,definition:null,fn:null},r._attrs={},r._node=null,r}return I(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;var t=e.data,n=e.desc,r=e.tag,i=e.strokeReference,o=e.fillReference;za(this.attrs,e),void 0!==t&&(this.data=t),"object"===R(n)&&(this.desc=D(!0,{},n)),"string"==typeof r&&(this.tag=r),"string"==typeof i&&(this.strokeReference=i),"string"==typeof o&&(this.fillReference=o)}},{key:"findShapes",value:function(e){return np.find(e,this).map((function(e){return op(e)}))}},{key:"getItemsFrom",value:function(e){return pp(this,e)}},{key:"containsPoint",value:function(e){return hp(this,e)}},{key:"intersectsLine",value:function(e){return hp(this,e)}},{key:"intersectsRect",value:function(e){return hp(this,e)}},{key:"intersectsCircle",value:function(e){return hp(this,e)}},{key:"intersectsPolygon",value:function(e){return hp(this,e)}},{key:"intersectsGeoPolygon",value:function(e){return hp(this,e)}},{key:"resolveLocalTransform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Yf;void 0!==this.attrs.transform&&Qf(this.attrs.transform,e),this.modelViewMatrix=e.clone()}},{key:"resolveGlobalTransform",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Yf,t=this.ancestors;if(t.length>0)for(var n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}},{key:"attr",value:function(e){return this.attrs[e]}},{key:"equals",value:function(e){var t=this.attrs,r=Object.keys(t),i=e.attrs,o=Object.keys(i);if(r.length!==o.length)return!1;for(var a=0;a<r.length;a++){var s=r[a];if(!Object.hasOwnProperty.call(i,s))return!1;if(t[s]!==i[s])return!1}return $(z(n.prototype),"equals",this).call(this,e)}},{key:"toJSON",value:function(){var e=$(z(n.prototype),"toJSON",this).call(this);return e.attrs=this.attrs,e}},{key:"attrs",get:function(){return this._attrs}},{key:"stage",get:function(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}},{key:"modelViewMatrix",get:function(){return this._mvm},set:function(e){this._mvm=e,this._imvm=null}},{key:"inverseModelViewMatrix",get:function(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}},{key:"node",get:function(){return this._node},set:function(e){this._node=e}},{key:"collider",get:function(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H($f,t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=Uf("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=Uf(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn},set:function(e){var t=Array.isArray(e)?"collection":e&&e.type;return"string"!=typeof t?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===t&&null!==this._collider.fn?(this._collider.fn.set(e),void(this._collider.definition=e)):(this._collider.type=t,void(this._collider.definition=e))}},{key:"colliderType",get:function(){return this._collider.type}}]),n}(Nf),gp=function(e){L(n,e);var t=W(n);function n(){return P(this,n),t.apply(this,arguments)}return I(n,[{key:"addChild",value:function(e){if(!(e&&e instanceof Nf))throw new TypeError("Expecting a Node as argument, but got ".concat(e));if(e===this)throw new Error("Can not add itself as child!");if(e._children&&e._children.length&&this.ancestors.indexOf(e)>=0)throw new Error("Can not add an ancestor as child!");return e._parent&&e._parent!==this&&e._parent.removeChild(e),this._children.push(e),e._parent=this,e._ancestors=null,this}},{key:"addChildren",value:function(e){var t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}},{key:"removeChild",value:function(e){var t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}},{key:"removeChildren",value:function(e){var t,n;if(!this._children)return this;if(e)for(n=e.length,t=0;t<n;t++)this.removeChild(e[t]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}]),n}(Nf),vp=gp.prototype,yp=function(e){L(n,e);var t=W(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};P(this,n);var i=r.type,o=void 0===i?"container":i;return(e=t.call(this,o)).set(r),e}return I(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$(z(n.prototype),"set",this).call(this,e);var t=e.collider,r=D({type:null},t);this.collider=r,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}},{key:"appendChildRect",value:function(e,t){if(void 0!==e.bounds){var n=this.__boundingRect[t]||{},r=Y(e.bounds(t),3),i=r[0],o=r[2],a=i.x,s=i.y,l=o.x,u=o.y,c=isNaN(n.width)?l:Math.max(l,n.width+n.x),d=isNaN(n.height)?u:Math.max(u,n.height+n.y);n.x=isNaN(n.x)?a:Math.min(a,n.x),n.y=isNaN(n.y)?s:Math.min(s,n.y),n.width=c-n.x,n.height=d-n.y,this.__boundingRect[t]=n}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];for(var t=this.children.length,n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=D({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}},{key:"addChild",value:function(e){var t=vp.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);var n=D({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=n}return t}},{key:"addChildren",value:function(e){var t=vp.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(var r=0;r<n;r++)this.appendChildRect(e[r],!0);var i=D({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=i}return t}},{key:"removeChild",value:function(e){e._stage=null;var t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;if(vp.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};var i=D(this.boundingRect(!0),{type:"bounds"});this.collider=i}return this}},{key:"removeChildren",value:function(e){if(vp.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};var t=D(this.boundingRect(!0),{type:"bounds"});this.collider=t}return this}}]),n}(mp);function bp(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(yp,t)}var xp=function(e){L(n,e);var t=W(n);function n(e){var r;return P(this,n),(r=t.call(this,"stage"))._stage=B(r),r._dpiRatio=e||1,r}return I(n,[{key:"dpi",get:function(){return this._dpiRatio}}]),n}(yp);var wp=gp.prototype,kp=["x1","x2","y1","y2","id","offset","style"],Cp=function(e){L(n,e);var t=W(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};P(this,n);var i=r.type,o=void 0===i?"container":i;return(e=t.call(this,o)).set(r),e._boundingRect={},e}return I(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$(z(n.prototype),"set",this).call(this,e);for(var t=this.attrs,r="",i=0,o=kp.length;i!==o;i++)void 0!==e[r=kp[i]]&&(t[r]=e[r])}},{key:"addChild",value:function(e){return wp.addChild.call(this,e)}},{key:"addChildren",value:function(e){return wp.addChildren.call(this,e)}},{key:"removeChild",value:function(e){e._stage=null;var t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return wp.removeChild.call(this,e),this}},{key:"removeChildren",value:function(e){return wp.removeChildren.call(this,e),this}}]),n}(mp);function Sp(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Cp,t)}var Ep=gp.prototype,Mp=["patternUnits","x","y","width","height","id"],Tp=function(e){L(n,e);var t=W(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};P(this,n);var i=r.type,o=void 0===i?"container":i;return(e=t.call(this,o)).set(r),e._boundingRect={},e}return I(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$(z(n.prototype),"set",this).call(this,e);for(var t=this.attrs,r="",i=0,o=Mp.length;i!==o;i++)void 0!==e[r=Mp[i]]&&(t[r]=e[r])}},{key:"addChild",value:function(e){return Ep.addChild.call(this,e)}},{key:"addChildren",value:function(e){return Ep.addChildren.call(this,e)}},{key:"removeChild",value:function(e){e._stage=null;var t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return Ep.removeChild.call(this,e),this}},{key:"removeChildren",value:function(e){return Ep.removeChildren.call(this,e),this}}]),n}(mp);var Dp=function(e){L(n,e);var t=W(n);function n(){var e,r;return P(this,n),(e=r=t.call(this,"rect")).set.apply(e,arguments),r}return I(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,r=void 0===t?0:t,i=e.y,o=void 0===i?0:i,a=e.width,s=void 0===a?0:a,l=e.height,u=void 0===l?0:l,c=e.rx,d=void 0===c?0:c,f=e.ry,p=void 0===f?0:f,h=e.collider,m=D({type:"rect",x:r,y:o,width:s,height:u},h);$(z(n.prototype),"set",this).call(this,e),s>=0?(this.attrs.x=r,this.attrs.width=s):(this.attrs.x=r+s,this.attrs.width=-s),u>=0?(this.attrs.y=o,this.attrs.height=u):(this.attrs.y=o+u,this.attrs.height=-u),d>0&&(this.attrs.rx=d),p>0&&(this.attrs.ry=p),this.collider=m,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];var t=ne(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,r=ee(n),i=Y(r,4),o=i[0],a=i[1],s=i[2],l=i[3];return this.__boundingRect[e]={x:o,y:a,width:s-o,height:l-a},this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}]),n}(mp);var _p=function(e){L(n,e);var t=W(n);function n(){var e,r;return P(this,n),(e=r=t.call(this,"circle")).set.apply(e,arguments),r}return I(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cx,r=void 0===t?0:t,i=e.cy,o=void 0===i?0:i,a=e.r,s=void 0===a?0:a,l=e.collider,u=D({type:"circle",cx:r,cy:o,r:s},l);$(z(n.prototype),"set",this).call(this,e),this.attrs.cx=r,this.attrs.cy=o,this.attrs.r=s,this.collider=u,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];var t=this.bounds(e);return this.__boundingRect[e]={x:t[0].x,y:t[0].y,width:t[2].x-t[0].x,height:t[2].y-t[0].y},this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.attrs,n=t.cx,r=t.cy,i=t.r,o=t.r,a=n-i,s=r-o,l=2*i,u=2*o,c=[{x:a,y:s},{x:a+l,y:s},{x:a+l,y:s+u},{x:a,y:s+u}];if(e&&this.modelViewMatrix){var d=ee(c=this.modelViewMatrix.transformPoints(c)),f=Y(d,4),p=f[0],h=f[1],m=f[2],g=f[3];l=m-p,u=g-h,this.__bounds[e]=[{x:p,y:h},{x:p+l,y:h},{x:p+l,y:h+u},{x:p,y:h+u}]}else this.__bounds[e]=c;return this.__bounds[e]}}]),n}(mp);var Np=function(e){L(n,e);var t=W(n);function n(){var e,r;return P(this,n),(e=r=t.call(this,"line")).set.apply(e,arguments),r}return I(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x1,r=void 0===t?0:t,i=e.y1,o=void 0===i?0:i,a=e.x2,s=void 0===a?0:a,l=e.y2,u=void 0===l?0:l,c=e.collider;$(z(n.prototype),"set",this).call(this,e),this.attrs.x1=r,this.attrs.y1=o,this.attrs.x2=s,this.attrs.y2=u;var d={type:"line",x1:r,y1:o,x2:s,y2:u};this.collider=D(d,c),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];var t=te(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));var n=ee(t),r=Y(n,4),i=r[0],o=r[1],a=r[2],s=r[3],l=i!==a||o!==s;return this.__boundingRect[e]={x:i,y:o,width:l?Math.max(1,a-i):0,height:l?Math.max(1,s-o):0},this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}]),n}(mp);var qp=Math.PI/2;function Rp(e,t){var n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function Pp(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}function Ap(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=[],i=[];if("h"===n.forceOrientation){var o=e[0].x<e[1].x?-1:1,a=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+o,y:e[0].y}),e.push({x:e[e.length-1].x+a,y:e[e.length-1].y})}else if("v"===n.forceOrientation){var s=e[0].y<e[1].y?-1:1,l=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+s}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+l})}for(var u=e.length-1,c=1;c<u;c++){var d=e[c-1],f=e[c],p=e[c+1],h=Rp(f,d),m=Rp(f,p),g=(h+m)/2,v=g+Math.PI,y=Math.max(g,v),b=Math.min(g,v),x=h>m;if(1===c){var w=Rp(d,f);r.push(Pp(d,w-qp,t)),i.unshift(Pp(d,w+qp,t))}var k=x?y:b,C=x?b:y;if(r.push(Pp(f,k,t)),i.unshift(Pp(f,C,t)),c===u-1){var S=Rp(p,f);r.push(Pp(p,S+qp,t)),i.unshift(Pp(p,S-qp,t))}}return{type:"polygon",vertices:[].concat(r,i)}}function Ip(e){for(var t,n=[],r=e.length,i=0;i<r;i++){t=e[i];for(var o=0;o<t.length;o++)n.push(t[o])}return n}function Op(e){if(e.length<2)return!1;var t=e[0],n=e[e.length-1];return Math.abs(t.x-n.x)<1e-12&&Math.abs(t.y-n.y)<1e-12}var Lp=function(e){L(n,e);var t=W(n);function n(){var e,r;return P(this,n),(e=r=t.call(this,"path")).set.apply(e,arguments),r}return I(n,[{key:"set",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if($(z(n.prototype),"set",this).call(this,t),this.segments=[],this.points=[],t.arcDatum){var r=Ie();r.innerRadius(t.desc.slice.innerRadius),r.outerRadius(t.desc.slice.outerRadius),r.cornerRadius(t.desc.slice.cornerRadius);var i=r(t.arcDatum);this.attrs.d=i}else t.d&&(this.attrs.d=t.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(t.collider)||"object"===R(t.collider)&&void 0!==t.collider.type)this.collider=t.collider;else if(t.arcDatum||t.d){if(this.segments=Tf(this.attrs.d),this.segments.length>1&&this.segments.every((function(e){return Op(e)})))return void(this.collider=D({type:"geopolygon",vertices:this.segments},t.collider));this.segments.forEach((function(n){if(n.length<=1);else if(Op(n))e.collider=D({type:"polygon",vertices:n},t.collider);else if("object"===R(t.collider)&&t.collider.visual){var r=e.attrs["stroke-width"]/2;e.collider=Ap(n,r,t.collider)}else e.collider=D({type:"polyline",points:n},t.collider)}))}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];this.points.length||(this.segments=this.segments.length?this.segments:Tf(this.attrs.d),this.points=Ip(this.segments));var t=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points,n=ee(t),r=Y(n,4),i=r[0],o=r[1],a=r[2],s=r[3];return this.__boundingRect[e]={x:i||0,y:o||0,width:a-i||0,height:s-o||0},this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}]),n}(mp);function zp(e){var t=e.data,n=e._boundingRect,r=e._textBoundsFn;return null!=t&&(n||r)}var Fp=function(e){L(n,e);var t=W(n);function n(){var e,r;return P(this,n),(e=r=t.call(this,"text")).set.apply(e,arguments),r}return I(n,[{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,r=void 0===t?0:t,i=e.y,o=void 0===i?0:i,a=e.dx,s=void 0===a?0:a,l=e.dy,u=void 0===l?0:l,c=e.textBoundsFn,d=e.text,f=e.title,p=e.collider,h=e.boundingRect,m=e.ellipsed;$(z(n.prototype),"set",this).call(this,e),this.attrs.x=r,this.attrs.y=o,this.attrs.dx=s,this.attrs.dy=u,this.attrs.text=d,void 0!==f&&(this.attrs.title=String(f)),"object"===R(h)?this._textBoundsFn=function(){return h}:"function"==typeof c&&(this._textBoundsFn=c),"string"==typeof m&&(this.ellipsed=m),this.collider=D({type:zp(this)?"bounds":null},p),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}},{key:"boundingRect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};var t=ne(this._textBoundsFn(this.attrs)),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,r=ee(n),i=Y(r,4),o=i[0],a=i[1],s=i[2],l=i[3];return this.__boundingRect[e]={x:o,y:a,width:s-o,height:l-a},this.__boundingRect[e]}},{key:"bounds",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];var t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}]),n}(mp);var jp=ft();function Hp(e,t){return jp.get(e)(t)}jp.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Dp,t)})),jp.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(_p,t)})),jp.add("text",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Fp,t)})),jp.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Np,t)})),jp.add("path",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Lp,t)})),jp.add("stage",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(xp,t)})),jp.add("container",bp),jp.add("defs",bp),jp.add("linearGradient",Sp),jp.add("radialGradient",Sp),jp.add("stop",Sp),jp.add("pattern",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return H(Tp,t)}));var Bp=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[{}];function n(){return t[t.length-1]}return n.save=function(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n(),o={},a="",s=0;s<e.length;s++)void 0!==i[a=e[s]]&&(o[a]=i[a]);return D(o,r),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function Vp(e,t){if(Array.isArray(t))for(var n=0,r=t.length;n<r;n++)t[n](e)}function Wp(e,t,n){e.node=n[t],e.index=t}function Up(e,t,n,r){for(var i={siblings:e,node:null,index:0},o=0,a=e.length;o<a;o++)if(Wp(i,o,e),Vp(i,r.create),!("function"==typeof i.node.disabled?i.node.disabled():i.node.disabled)){i.node=Bp.save(i.node);var s=Hp(i.node.type,i.node);s&&(i.node.transform&&(n.save(),Qf(i.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),t.addChild(s),i.node.children&&Up(i.node.children,s,n,r),i.node.transform&&n.restore()),Bp.restore()}}function $p(e){var t=e.items,n=e.stage,r=e.dpi,i=e.on,o=void 0===i?{}:i;return n||(n=Hp("stage",r)),Up(t,n,new Yf,o),n}function Yp(e,t,n){var r=n.orientation,i=n.degree,o=n.stops,a=void 0===o?[]:o,s=null;if("radial"===r){var l=t.boundingRect();s=e.createRadialGradient(l.x+l.width/2,l.y+l.height/2,1e-5,l.x+l.width/2,l.y+l.height/2,Math.max(l.width,l.height)/2)}else{var u=Ba(i);["x1","x2","y1","y2"].forEach((function(e){e in n&&(u[e]=n[e])}));var c=t.boundingRect();s=e.createLinearGradient(c.x+u.x1*c.width,c.y+u.y1*c.height,c.x+u.x2*c.width,c.y+u.y2*c.height)}for(var d=0,f=a.length;d<f;d++){var p=a[d];s.addColorStop(p.offset,p.color)}return s}function Xp(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach((function(e){switch(e.type){case"rect":n.rect(e.x,e.y,e.width,e.height)}})),n.fill(),n.restore(),n.createPattern(t,"repeat")}function Kp(e){var t=e.createElement("canvas"),n=t.getContext("2d"),r={};return{create:function(e){var i=e.key;return i?(r[i]=r[i]||Xp(e,t,n),r[i]):Xp(e,t,n)},clear:function(){r={}}}}function Gp(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=e.y,r=e.width,i=e.height,o=e.scaleRatio,a=e.margin,s=e.edgeBleed,l={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0},edgeBleed:{left:0,right:0,top:0,bottom:0,bool:!1}};return l.x=isNaN(t)?l.x:t,l.y=isNaN(n)?l.y:n,l.width=isNaN(r)?l.width:r,l.height=isNaN(i)?l.height:i,void 0!==o&&(l.scaleRatio.x=isNaN(o.x)?l.scaleRatio.x:o.x,l.scaleRatio.y=isNaN(o.y)?l.scaleRatio.y:o.y),void 0!==a&&(l.margin.left=isNaN(a.left)?0:a.left,l.margin.top=isNaN(a.top)?0:a.top),"object"===R(s)&&["left","right","top","bottom"].forEach((function(e){!isNaN(s[e])&&s[e]>0&&(l.edgeBleed[e]=s[e],l.edgeBleed.bool=!0)})),l.computedPhysical={x:Math.round(l.margin.left+(l.x-l.edgeBleed.left)*l.scaleRatio.x),y:Math.round(l.margin.top+(l.y-l.edgeBleed.top)*l.scaleRatio.y),width:Math.round((l.width+l.edgeBleed.left+l.edgeBleed.right)*l.scaleRatio.x),height:Math.round((l.height+l.edgeBleed.top+l.edgeBleed.bottom)*l.scaleRatio.y)},l}function Jp(){var e={element:function(){},root:function(){},settings:function(){},appendTo:function(){},getScene:function(){return[]},render:function(){return!1},itemsAt:function(){return[]},findShapes:function(){return[]},clear:function(){},destory:function(){},size:function(){},measureText:bd,textBounds:wd,setKey:function(t){e.element().setAttribute("data-key",t)}};return e}function Zp(e){return function(t){var n=t.node;"text"===n.type&&function(e){return null!=e}(n.data)&&!n.textBoundsFn&&(n.textBoundsFn=e.textBounds)}}var Qp=200,eh=200,th=function(){function e(t){P(this,e),this.targetCanvas=t,this.bufferCanvas=t.cloneNode()}return I(e,[{key:"updateSize",value:function(e){var t,n=e.rect,r=e.dpiRatio,i=e.canvasBufferSize;t=i?"function"==typeof i?i(n):i:{width:n.computedPhysical.width+2*Qp,height:n.computedPhysical.height+2*eh},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*r),this.bufferCanvas.height=Math.round(t.height*r)}},{key:"apply",value:function(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}},{key:"clear",value:function(){this.bufferCanvas.width=this.bufferCanvas.width}},{key:"getContext",value:function(){return this.bufferCanvas.getContext("2d")}}]),e}(),nh=ft();function rh(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function ih(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function oh(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function ah(e,t,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=Object.keys(r),o=0,a=n.length;o<a;o++){var s=n[o],l=s[0],u=s[1],c=s[2];if(l in t.attrs&&!(u in r)&&e[u]!==t.attrs[l]){var d=c?c(t.attrs[l]):t.attrs[l];"function"==typeof e[u]?e[u](d):e[u]=d}}for(var f=0,p=i.length;f<p;f++){var h=i[f];e[h]=r[h]}}function sh(e,t,n,r){for(var i=0,o=e.length;i<o;i++){var a=e[i],s={};t.save(),a.attrs&&(a.attrs.fill||a.attrs.stroke)&&(a.attrs.fill&&"object"===R(a.attrs.fill)&&"gradient"===a.attrs.fill.type?s.fillStyle=Yp(t,a,a.attrs.fill):a.attrs.fill&&"object"===R(a.attrs.fill)&&"pattern"===a.attrs.fill.type&&(s.fillStyle=r.patterns.create(a.attrs.fill)),a.attrs.stroke&&"object"===R(a.attrs.stroke)&&"gradient"===a.attrs.stroke.type?s.strokeStyle=Yp(t,a,a.attrs.stroke):a.attrs.stroke&&"object"===R(a.attrs.stroke)&&"pattern"===a.attrs.stroke.type&&(s.strokeStyle=r.patterns.create(a.attrs.stroke))),ah(t,a,n,s),a.modelViewMatrix&&oh(a.modelViewMatrix.elements,t),nh.has(a.type)&&nh.get(a.type)(a.attrs,{g:t,doFill:"fill"in a.attrs&&"none"!==a.attrs.fill,doStroke:"stroke"in a.attrs&&0!==a.attrs["stroke-width"],ellipsed:a.ellipsed}),a.children&&sh(a.children,t,n,r),t.restore()}}function lh(e){var t=e.el,n=e.dpiRatio,r=e.transform;if("object"===R(r)){var i=[r.horizontalScaling,r.horizontalSkewing,r.verticalSkewing,r.verticalScaling,r.horizontalMoving*n,r.verticalMoving*n],o=t.getContext("2d");o.setTransform.apply(o,i)}}function uh(){var e,t,n,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$p,o={transform:void 0,canvasBufferSize:void 0,progressive:void 0},a=!1,s=Gp(),l=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",rh]],u=Jp();return u.element=function(){return e},u.root=function(){return e},u.settings=function(e){return e&&Object.keys(o).forEach((function(t){void 0!==e[t]&&(o[t]=e[t])})),o},u.appendTo=function(n){return e||((e=n.ownerDocument.createElement("canvas")).style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof o.transform||t||(t=new th(e)),n.appendChild(e),e},u.getScene=function(n){var r=ih(t&&t.getContext()||e.getContext("2d")),o=s.scaleRatio.x,a=s.scaleRatio.y,l={type:"container",children:n,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*r*o,", ").concat(s.edgeBleed.top*r*a,")"):""};return 1===r&&1===o&&1===a||(l.transform+="scale(".concat(r*o,", ").concat(r*a,")")),i({items:[l],dpi:r,on:{create:[cd(u.measureText),Zp(u)]}})},u.render=function(i){if(!e)return!1;r||(r=Kp(e.ownerDocument));var c=t&&t.getContext()||e.getContext("2d"),d=ih(c),f=t&&o.transform();if(f)return e.width=e.width,lh({el:e,dpiRatio:d,transform:f}),t.apply(),!0;a&&(e.style.left="".concat(s.computedPhysical.x,"px"),e.style.top="".concat(s.computedPhysical.y,"px"),e.style.width="".concat(s.computedPhysical.width,"px"),e.style.height="".concat(s.computedPhysical.height,"px"),e.width=Math.round(s.computedPhysical.width*d),e.height=Math.round(s.computedPhysical.height*d),t&&t.updateSize({rect:s,dpiRatio:d,canvasBufferSize:o.canvasBufferSize}));var p=u.getScene(i),h=!n||!p.equals(n);r.clear();var m,g=a||h,v="function"==typeof o.progressive&&o.progressive();(g&&(v&&!v.isFirst||u.clear(),sh(p.children,c,l,{patterns:r})),t&&(e.width=e.width,t.apply()),a=!1,v&&!v.isFirst)&&(m=p.children).unshift.apply(m,X(n.children));return n=p,g},u.itemsAt=function(e){return n?n.getItemsFrom(e):[]},u.findShapes=function(e){return n?n.findShapes(e):[]},u.clear=function(){return e&&(e.width=e.width),t&&t.clear(),n=null,u},u.size=function(e){if(e){var t=Gp(e);JSON.stringify(s)!==JSON.stringify(t)&&(a=!0,s=t)}return s},u.destroy=function(){e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),n=null},u}function ch(e,t){nh.add(e,t)}function dh(e,t){return Math.max(0,Math.min(e,t))}var fh=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),ph=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),hh=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function mh(e){return fh.test(e)}function gh(e){return ph.test(e)||hh.test(e)}function vh(e){var t,n,r=e?e.length:0;for(t=0;t<r;t++){if(mh(n=e[t]))return"ltr";if(gh(n))return"rtl"}return"ltr"}var yh={start:"end",end:"start",center:"center",middle:"middle"};function bh(e,t){return"rtl"===t?yh[e]:e}function xh(e,t){var n,r,i,o=[],a=[],s=[],l=[],u=function(e){return e.id},c=function(e,t){var n;return n="object"===R(e)?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(c)),t=t.map(c),r=e.map(u),i=t.map(u);for(var d=0,f=t.length;d<f;d++){-1===r.indexOf(t[d].id)?o.push(t[d]):s.push(t[d])}for(var p=0,h=e.length;p<h;p++){-1===i.indexOf(e[p].id)?a.push(e[p]):l.push(e[p])}for(var m=0,g=o.length;m<g;m++)o[m].content.children&&(o[m].diff=xh([],o[m].content.children),o[m].children=o[m].diff.updatedNew.concat(o[m].diff.added),o[m].children.isTree=!0);for(var v=0,y=s.length;v<y;v++)s[v].diff=xh(l[v].children||[],s[v].content.children||[]),s[v].object=l[v].object,s[v].children=s[v].diff.items;return n=s.concat(o),o.isTree=!0,a.isTree=!0,s.isTree=!0,l.isTree=!0,n.isTree=!0,{added:o,updatedNew:s,updatedOld:l,removed:a,items:n}}function wh(e,t,n){for(var r=0,i=e.length;r<i;r++)e[r].object=n(e[r].content.type,t)}function kh(e,t){for(var n=0,r=e.length;n<r;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function Ch(e,t,n,r){for(var i,o=0,a=e.length;o<a;o++)null!==(i=e[o]).object&&void 0!==i.object&&(n(i.object,i.content),i.diff&&(wh(i.diff.added,i.object,t),kh(i.diff.removed,r),Ch(i.diff.items,t,n,r)))}function Sh(e,t,n,r,i,o){var a=xh(e,t);return wh(a.added,n,r),kh(a.removed,o),Ch(a.items,r,i,o),a.items}ch("rect",(function(e,t){var n=t.g,r=t.doFill,i=t.doStroke;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,r,i,o,a){o=dh(r/2,o>0?o:a),a=dh(i/2,a>0?a:o),e.moveTo(t,n+a),e.lineTo(t,n+i-a),e.quadraticCurveTo(t,n+i,t+o,n+i),e.lineTo(t+r-o,n+i),e.quadraticCurveTo(t+r,n+i,t+r,n+i-a),e.lineTo(t+r,n+a),e.quadraticCurveTo(t+r,n,t+r-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+a)}(n,e.x,e.y,e.width,e.height,e.rx,e.ry):n.rect(e.x,e.y,e.width,e.height),r&&n.fill(),i&&n.stroke()})),ch("circle",(function(e,t){var n=t.g,r=t.doFill,i=t.doStroke;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),r&&n.fill(),i&&n.stroke()})),ch("line",(function(e,t){var n=t.g,r=t.doStroke;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),r&&n.stroke()})),ch("path",(function(e,t){var n=t.g,r=t.doStroke,i=t.doFill,o=new Path2D(e.d);i&&n.fill(o),r&&n.stroke(o)})),ch("text",(function(e,t){var n=t.g,r=t.ellipsed,i=t.doStroke,o=r||dd(e,bd);e["font-weight"]?n.font="".concat(e["font-weight"]," ").concat(e["font-size"]," ").concat(e["font-family"]):n.font="".concat(e["font-size"]," ").concat(e["font-family"]);var a=vh(e.text);n.canvas.dir!==a&&(n.canvas.dir=a);var s=bh("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);var l=fd(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),i&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)}));var Eh="http://www.w3.org/2000/svg",Mh=function(e,t){if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));var n=t.ownerDocument.createElementNS(Eh,"container"===e?"g":e);return t.appendChild(n),n},Th=function(e){e.parentNode&&e.parentNode.removeChild(e)},Dh=function(e,t){if(function(e){switch(e.type){case"circle":return!isNaN(e.attrs.cx)&&!isNaN(e.attrs.cy)&&!isNaN(e.attrs.r);case"line":return!(isNaN(e.attrs.x1)||isNaN(e.attrs.y1)||isNaN(e.attrs.x2)||isNaN(e.attrs.y2));case"rect":return!(isNaN(e.attrs.x)||isNaN(e.attrs.y)||isNaN(e.attrs.width)||isNaN(e.attrs.height));case"text":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}}(t)){for(var n in t.attrs)if("stroke"===n&&t.strokeReference)e.setAttribute("stroke",t.strokeReference);else if("fill"===n&&t.fillReference)e.setAttribute("fill",t.fillReference);else if("text"===n){e.setAttribute("style","white-space: pre"),e.textContent=t.ellipsed||dd(t.attrs,bd);var r=vh(t.attrs.text);"rtl"===r&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",bh(e.getAttribute("text-anchor"),r)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){var i=e.ownerDocument.createElementNS(Eh,"title");i.textContent=t.attrs.title,e.appendChild(i)}else e.setAttribute(n,t.attrs[n]);else{var o=+e.getAttribute(n)||0,a=0;a="dominant-baseline"===n?fd(t.attrs):t.attrs[n],e.setAttribute("dy",a+o)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"===R(t.data)&&null!==t.data)for(var s in t.data)"string"!=typeof t.data[s]&&"number"!=typeof t.data[s]&&"boolean"!=typeof t.data[s]||e.setAttribute("data-".concat(s),t.data[s])}},_h=function(){function e(t,n,r,i){P(this,e),this.create=t,this.nodeCreator=n,this.nodeMaintainer=r,this.nodeDestroyer=i}return I(e,[{key:"render",value:function(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}]),e}();function Nh(){return new _h(Sh,Mh,Dh,Th)}function qh(e){var t,n,r=0;if(0===(e=JSON.stringify(e)).length)return r;for(t=0,n=e.length;t<n;t++)r=(r<<5)-r+e.charCodeAt(t),r&=r;return r}function Rh(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qh,n={},r=Date.now(),i={getOrCreateGradient:function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=t(i[o]),l="picasso-gradient-".concat(r,"-").concat(s);if(!n[s]){var u=i[o],c=u.orientation,d=u.degree,f=u.stops,p=void 0===f?[]:f,h={};void 0===d&&(d=90),"radial"===c?h.type="radialGradient":(h=Ba(d),["x1","x2","y1","y2"].forEach((function(e){e in i[o]&&(h[e]=i[o][e])})),h.type="linearGradient"),h.id=l,h.children=p.map((function(e){var t=e.offset,n=e.color,r=e.opacity;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==r?r:1)}})),e.push(h),n[s]=l}return"url('".concat(a,"#").concat(l,"')")},onCreate:function(e){var t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);var n=e.node;n.fill&&"object"===R(n.fill)&&"gradient"===n.fill.type&&(n.fillReference=i.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"===R(n.stroke)&&"gradient"===n.stroke.type&&(n.strokeReference=i.getOrCreateGradient(n,"stroke",t))},clear:function(){n={}}};return i}function Ph(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qh,n={},r=Date.now(),i={onCreate:function(i){var o={};i.node&&"object"===R(i.node.fill)&&"pattern"===i.node.fill.type&&i.node.fill.shapes&&(o.fill=i.node.fill),i.node&&"object"===R(i.node.stroke)&&"pattern"===i.node.stroke.type&&i.node.stroke.shapes&&(o.stroke=i.node.stroke),Object.keys(o).forEach((function(a){var s="",l=o[a],u=t(l),c="picasso-pattern-".concat(r,"-").concat(u);if("undefined"!=typeof window&&(s=window.location.href.split("#")[0]),!n[u]){var d={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:c,children:[],fill:l.fill};l.shapes.forEach((function(e){d.children.push(e)})),e.push(d),n[u]=!0}i.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(c,"')")}))},clear:function(){n={}}};return i}function Ah(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Nh,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Eh,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:$p,a=r(),s=!1,l=Gp(),u={transform:void 0},c=Jp(),d={type:"defs",children:[]},f=Ph(d.children),p=Rh(d.children);return c.element=function(){return e},c.root=function(){return t},c.settings=function(e){return e&&Object.keys(u).forEach((function(t){void 0!==e[t]&&(u[t]=e[t])})),u},c.appendTo=function(n){return e||((e=n.ownerDocument.createElementNS(i,"svg")).style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none",e.setAttribute("xmlns",i),(t=n.ownerDocument.createElementNS(i,"g")).style.pointerEvents="auto",e.appendChild(t)),n.appendChild(e),e},c.getScene=function(e){var t=l.scaleRatio.x,n=l.scaleRatio.y,r={type:"container",children:Array.isArray(e)?[].concat(X(e),[d]):e,transform:l.edgeBleed.bool?"translate(".concat(l.edgeBleed.left*t,", ").concat(l.edgeBleed.top*n,")"):""};return 1===t&&1===n||(r.transform+="scale(".concat(t,", ").concat(n,")")),o({items:[r],on:{create:[function(e){e.node.fillReference=void 0,e.node.strokeReference=void 0},p.onCreate,f.onCreate,cd(c.measureText),Zp(c)]}})},c.render=function(r){if(!e)return!1;var i="function"==typeof u.transform&&u.transform();if(i){var o=i.a,h=i.b,m=i.c,g=i.d,v=i.e,y=i.f;return t.style.transform="matrix(".concat(o,", ").concat(h,", ").concat(m,", ").concat(g,", ").concat(v,", ").concat(y,")"),!0}t.style.transform="",s&&(e.style.left="".concat(l.computedPhysical.x,"px"),e.style.top="".concat(l.computedPhysical.y,"px"),e.setAttribute("width",l.computedPhysical.width),e.setAttribute("height",l.computedPhysical.height)),p.clear(),f.clear(),d.children.length=0;var b=c.getScene(r),x=!n||!b.equals(n),w=s||x;return w&&(c.clear(),a.render(b.children,t)),s=!1,n=b,w},c.itemsAt=function(e){return n?n.getItemsFrom(e):[]},c.findShapes=function(e){return n?n.findShapes(e):[]},c.clear=function(){if(!t)return c;n=null;var r=t.cloneNode(!1);return e.replaceChild(r,t),t=r,c},c.destroy=function(){e&&e.parentNode&&e.parentNode.removeChild(e),e=null,t=null},c.size=function(e){if(e){var t=Gp(e);JSON.stringify(l)!==JSON.stringify(t)&&(s=!0,l=t)}return l},c}var Ih,Oh,Lh,zh,Fh,jh={},Hh=[],Bh=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Vh(e,t){for(var n in t)e[n]=t[n];return e}function Wh(e){var t=e.parentNode;t&&t.removeChild(e)}function Uh(e,t,n){var r,i,o,a={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Ih.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return $h(e,a,r,i,null)}function $h(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++Lh:i};return null==i&&null!=Oh.vnode&&Oh.vnode(o),o}function Yh(e){return e.children}function Xh(e,t){this.props=e,this.context=t}function Kh(e,t){if(null==t)return e.__?Kh(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Kh(e):null}function Gh(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Gh(e)}}function Jh(e){(!e.__d&&(e.__d=!0)&&zh.push(e)&&!Zh.__r++||Fh!==Oh.debounceRendering)&&((Fh=Oh.debounceRendering)||setTimeout)(Zh)}function Zh(){for(var e;Zh.__r=zh.length;)e=zh.sort((function(e,t){return e.__v.__b-t.__v.__b})),zh=[],e.some((function(e){var t,n,r,i,o,a;e.__d&&(o=(i=(t=e).__v).__e,(a=t.__P)&&(n=[],(r=Vh({},i)).__v=i.__v+1,am(a,i,r,t.__n,void 0!==a.ownerSVGElement,null!=i.__h?[o]:null,n,null==o?Kh(i):o,i.__h),sm(n,i),i.__e!=o&&Gh(i)))}))}function Qh(e,t,n,r,i,o,a,s,l,u){var c,d,f,p,h,m,g,v=r&&r.__k||Hh,y=v.length;for(n.__k=[],c=0;c<t.length;c++)if(null!=(p=n.__k[c]=null==(p=t[c])||"boolean"==typeof p?null:"string"==typeof p||"number"==typeof p||"bigint"==typeof p?$h(null,p,null,null,p):Array.isArray(p)?$h(Yh,{children:p},null,null,null):p.__b>0?$h(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)){if(p.__=n,p.__b=n.__b+1,null===(f=v[c])||f&&p.key==f.key&&p.type===f.type)v[c]=void 0;else for(d=0;d<y;d++){if((f=v[d])&&p.key==f.key&&p.type===f.type){v[d]=void 0;break}f=null}am(e,p,f=f||jh,i,o,a,s,l,u),h=p.__e,(d=p.ref)&&f.ref!=d&&(g||(g=[]),f.ref&&g.push(f.ref,null,p),g.push(d,p.__c||h,p)),null!=h?(null==m&&(m=h),"function"==typeof p.type&&p.__k===f.__k?p.__d=l=em(p,l,e):l=tm(e,p,f,v,h,l),"function"==typeof n.type&&(n.__d=l)):l&&f.__e==l&&l.parentNode!=e&&(l=Kh(f))}for(n.__e=m,c=y;c--;)null!=v[c]&&um(v[c],v[c]);if(g)for(c=0;c<g.length;c++)lm(g[c],g[++c],g[++c])}function em(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?em(r,t,n):tm(n,r,r,i,r.__e,t));return t}function tm(e,t,n,r,i,o){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<r.length;l+=2)if(s==i)break e;e.insertBefore(i,o),a=o}return void 0!==a?a:i.nextSibling}function nm(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||Bh.test(t)?n:n+"px"}function rm(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||nm(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||nm(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?om:im,o):e.removeEventListener(t,o?om:im,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&-1==t.indexOf("-")?e.removeAttribute(t):e.setAttribute(t,n))}}function im(e){this.l[e.type+!1](Oh.event?Oh.event(e):e)}function om(e){this.l[e.type+!0](Oh.event?Oh.event(e):e)}function am(e,t,n,r,i,o,a,s,l){var u,c,d,f,p,h,m,g,v,y,b,x,w,k,C,S=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,s=t.__e=n.__e,t.__h=null,o=[s]),(u=Oh.__b)&&u(t);try{e:if("function"==typeof S){if(g=t.props,v=(u=S.contextType)&&r[u.__c],y=u?v?v.props.value:u.__:r,n.__c?m=(c=t.__c=n.__c).__=c.__E:("prototype"in S&&S.prototype.render?t.__c=c=new S(g,y):(t.__c=c=new Xh(g,y),c.constructor=S,c.render=cm),v&&v.sub(c),c.props=g,c.state||(c.state={}),c.context=y,c.__n=r,d=c.__d=!0,c.__h=[],c._sb=[]),null==c.__s&&(c.__s=c.state),null!=S.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=Vh({},c.__s)),Vh(c.__s,S.getDerivedStateFromProps(g,c.__s))),f=c.props,p=c.state,d)null==S.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(null==S.getDerivedStateFromProps&&g!==f&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(g,y),!c.__e&&null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(g,c.__s,y)||t.__v===n.__v){for(c.props=g,c.state=c.__s,t.__v!==n.__v&&(c.__d=!1),c.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<c._sb.length;b++)c.__h.push(c._sb[b]);c._sb=[],c.__h.length&&a.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(g,c.__s,y),null!=c.componentDidUpdate&&c.__h.push((function(){c.componentDidUpdate(f,p,h)}))}if(c.context=y,c.props=g,c.__v=t,c.__P=e,x=Oh.__r,w=0,"prototype"in S&&S.prototype.render){for(c.state=c.__s,c.__d=!1,x&&x(t),u=c.render(c.props,c.state,c.context),k=0;k<c._sb.length;k++)c.__h.push(c._sb[k]);c._sb=[]}else do{c.__d=!1,x&&x(t),u=c.render(c.props,c.state,c.context),c.state=c.__s}while(c.__d&&++w<25);c.state=c.__s,null!=c.getChildContext&&(r=Vh(Vh({},r),c.getChildContext())),d||null==c.getSnapshotBeforeUpdate||(h=c.getSnapshotBeforeUpdate(f,p)),C=null!=u&&u.type===Yh&&null==u.key?u.props.children:u,Qh(e,Array.isArray(C)?C:[C],t,n,r,i,o,a,s,l),c.base=t.__e,t.__h=null,c.__h.length&&a.push(c),m&&(c.__E=c.__=null),c.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,i,o,a,s){var l,u,c,d=n.props,f=t.props,p=t.type,h=0;if("svg"===p&&(i=!0),null!=o)for(;h<o.length;h++)if((l=o[h])&&"setAttribute"in l==!!p&&(p?l.localName===p:3===l.nodeType)){e=l,o[h]=null;break}if(null==e){if(null===p)return document.createTextNode(f);e=i?document.createElementNS("http://www.w3.org/2000/svg",p):document.createElement(p,f.is&&f),o=null,s=!1}if(null===p)d===f||s&&e.data===f||(e.data=f);else{if(o=o&&Ih.call(e.childNodes),u=(d=n.props||jh).dangerouslySetInnerHTML,c=f.dangerouslySetInnerHTML,!s){if(null!=o)for(d={},h=0;h<e.attributes.length;h++)d[e.attributes[h].name]=e.attributes[h].value;(c||u)&&(c&&(u&&c.__html==u.__html||c.__html===e.innerHTML)||(e.innerHTML=c&&c.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||rm(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||rm(e,o,t[o],n[o],r)}(e,f,d,i,s),c)t.__k=[];else if(h=t.props.children,Qh(e,Array.isArray(h)?h:[h],t,n,r,i&&"foreignObject"!==p,o,a,o?o[0]:n.__k&&Kh(n,0),s),null!=o)for(h=o.length;h--;)null!=o[h]&&Wh(o[h]);s||("value"in f&&void 0!==(h=f.value)&&(h!==e.value||"progress"===p&&!h||"option"===p&&h!==d.value)&&rm(e,"value",h,d.value,!1),"checked"in f&&void 0!==(h=f.checked)&&h!==e.checked&&rm(e,"checked",h,d.checked,!1))}return e}(n.__e,t,n,r,i,o,a,l);(u=Oh.diffed)&&u(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=s,t.__h=!!l,o[o.indexOf(s)]=null),Oh.__e(e,t,n)}}function sm(e,t){Oh.__c&&Oh.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Oh.__e(e,t.__v)}}))}function lm(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Oh.__e(e,n)}}function um(e,t,n){var r,i;if(Oh.unmount&&Oh.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||lm(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Oh.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&um(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||Wh(e.__e),e.__=e.__e=e.__d=void 0}function cm(e,t,n){return this.constructor(e,n)}function dm(e,t,n){var r,i,o;Oh.__&&Oh.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],am(t,e=(!r&&n||t).__k=Uh(Yh,null,[e]),i||jh,jh,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?Ih.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),sm(o,e)}function fm(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.createElement,i=void 0===r?document.createElement.bind(document):r,o=Gp(),a={transform:void 0},s=Jp();return s.element=function(){return e},s.root=function(){return e},s.settings=function(e){return e&&Object.keys(a).forEach((function(t){void 0!==e[t]&&(a[t]=e[t])})),a},s.appendTo=function(t){return e||((e=i("div")).style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),t.appendChild(e),e},s.render=function(n){if(!e)return!1;var r,i="function"==typeof a.transform&&a.transform();if(i){var s=i.a,l=i.b,u=i.c,c=i.d,d=i.e,f=i.f;return e.style.transform="matrix(".concat(s,", ").concat(l,", ").concat(u,", ").concat(c,", ").concat(d,", ").concat(f,")"),!0}return e.style.transform="",e.style.left="".concat(o.computedPhysical.x,"px"),e.style.top="".concat(o.computedPhysical.y,"px"),e.style.width="".concat(o.computedPhysical.width,"px"),e.style.height="".concat(o.computedPhysical.height,"px"),r=Array.isArray(n)?Uh("div",null,n):n,t=dm(r,e,t),!0},s.renderArgs=[Uh],s.clear=function(){if(e){for(var n=e.firstChild;n;)e.removeChild(n),n=e.firstChild;t=null}return s},s.destroy=function(){e&&e.parentElement&&e.parentElement.removeChild(e),e=null,t=null},s.size=function(e){return e&&(o=Gp(e)),o},s}Ih=Hh.slice,Oh={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},Lh=0,Xh.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Vh({},this.state),"function"==typeof e&&(e=e(Vh({},n),this.props)),e&&Vh(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Jh(this))},Xh.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Jh(this))},Xh.prototype.render=Yh,zh=[],Zh.__r=0;var pm=[function(e){e.renderer("svg",Ah)},function(e){e.renderer("canvas",uh)},function(e){e.renderer("dom",fm)}],hm={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},mm=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.level,r=void 0===n?hm.OFF:n,i=t.pipe,o=void 0===i?console:i,a=r,s=(O(e={},hm.OFF,(function(){})),O(e,hm.ERROR,(function(){return o.error.apply(o,arguments)})),O(e,hm.WARN,(function(){return o.warn.apply(o,arguments)})),O(e,hm.INFO,(function(){return o.info.apply(o,arguments)})),O(e,hm.DEBUG,(function(){return o.log.apply(o,arguments)})),e),l=function(e){if(e&&!(a<e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];(s[e]||s[hm.DEBUG]).apply(void 0,n)}};return{log:l,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.apply(void 0,[hm.ERROR].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.apply(void 0,[hm.WARN].concat(t))},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.apply(void 0,[hm.INFO].concat(t))},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return l.apply(void 0,[hm.DEBUG].concat(t))},level:function(e){return"number"==typeof e&&(a=e),a},LOG_LEVEL:hm}};function gm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;e(n,t)}var vm=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=mm(t.logger),i={component:ft(n.component,"component",r),data:ft(n.data,"data",r),formatter:ft(n.formatter,"formatter",r),interaction:ft(n.interaction,"interaction",r),renderer:pl(n.renderer),scale:ft(n.scale,"scale",r),symbol:ft(n.symbol,"symbol",r),logger:r};function o(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={palettes:t.palettes.concat(n.palettes||[]),style:D({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer};return e(r,i)}return t.renderer&&t.renderer.prio&&i.renderer.default(t.renderer.prio[0]),o.use=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return gm(e,t,i)},o.chart=function(e){return fl(e,{registries:i,logger:r,style:t.style,palettes:t.palettes})},o.config=function(){return t},Object.keys(i).forEach((function(e){o[e]=i[e]})),o.version=_,o}({renderer:{prio:["svg","canvas"]},logger:{level:0},style:{"$font-family":"'Source Sans Pro', Arial, sans-serif","$font-size":"12px","$line-height":"16px","$font-size--l":"16px","$font-weight":"normal","$gray-100":"#ffffff","$gray-98":"#f9f9f9","$gray-95":"#f2f2f2","$gray-90":"#e6e6e6","$gray-35":"#595959","$gray-30":"#4d4d4d","$gray-25":"#404040","$gray-20":"#333333","$border-95":"rgba(255, 255, 255, 0.05)","$border-90":"rgba(255, 255, 255, 0.1)","$border-80":"rgba(255, 255, 255, 0.2)","$border-20":"rgba(0, 0, 0, 0.2)","$border-10":"rgba(0, 0, 0, 0.1)","$border-5":"rgba(0, 0, 0, 0.05)","$primary-blue":"#3F8AB3","$primary-green":"#6CB33F","$primary-red":"#DC423F","$primary-orange":"#EF960F","$spacing--s":4,$spacing:8,"$spacing--l":12,"$font-color":"$gray-35","$font-color--inverted":"$gray-90","$guide-color":"$gray-90","$guide-color--inverted":"$gray-35",$border:"$border-80","$border--inverted":"$border-10",$shape:{fill:"$primary-blue",strokeWidth:1,stroke:"$border"},"$shape-outline":{stroke:"$primary-blue",strokeWidth:2},"$shape-guide":{stroke:"$guide-color",strokeWidth:1},"$shape-guide--inverted":{"@extend":"$shape-guide",stroke:"$guide-color--inverted"},$label:{fontSize:"$font-size",fontFamily:"$font-family",fill:"$font-color"},"$label--inverted":{$extend:"$label",fill:"$font-color--inverted"},"$label-overlay":{fontSize:"$font-size--l",fontFamily:"$font-family",fill:"$gray-100",color:"$font-color",stroke:"$guide-color--inverted",strokeWidth:1,borderRadius:4},$title:{"@extend":"$label",fontSize:"$font-size--l",fontWeight:"$font-weight",stroke:"$guide-color--inverted",strokeWidth:0},"$guide-line":{strokeWidth:1,stroke:"$guide-color"},"$guide-line--minor":{strokeWidth:1,stroke:"$gray-95"},"$padding--s":{left:"$spacing--s",right:"$spacing--s",top:"$spacing--s",bottom:"$spacing--s"},$padding:{left:"$spacing",right:"$spacing",top:"$spacing",bottom:"$spacing"},"$selection-area-target":{fill:"$primary-green",strokeWidth:0,opacity:.2}},palettes:[{key:"categorical",colors:[["#a54343","#d76c6c","#ec983d","#ecc43d","#f9ec86","#cbe989","#70ba6e","#578b60","#79d69f","#26a0a7","#138185","#65d3da"]]},{key:"diverging",colors:[["#3d52a1","#3a89c9","#77b7e5","#b4ddf7","#e6f5fe","#ffe3aa","#f9bd7e","#ed875e","#d24d3e","#ae1c3e"]]},{key:"sequential",colors:[["rgb(180,221,212)","rgb(34, 83, 90)"]]}]},{component:hl,data:_l,formatter:Er,interaction:Nl,renderer:pl(),scale:jo,symbol:es});function ym(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 bm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ym(Object(n),!0).forEach((function(t){Sm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ym(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xm(e){return(xm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function km(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Cm(e,t,n){return t&&km(e.prototype,t),n&&km(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Em(e,t){return(Em=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Mm(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function Tm(e,t,n){return(Tm=Mm()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&Em(i,n.prototype),i}).apply(null,arguments)}function Dm(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||Nm(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _m(e){return function(e){if(Array.isArray(e))return qm(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Nm(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 Nm(e,t){if(e){if("string"==typeof e)return qm(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)?qm(e,t):void 0}}function qm(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}_f.forEach(vm.use),pm.forEach(vm.use),[].forEach(vm.use);var Rm=Object.prototype.hasOwnProperty,Pm=Object.prototype.toString,Am=Object.defineProperty,Im=Object.getOwnPropertyDescriptor,Om=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Pm.call(e)},Lm=function(e){if(!e||"[object Object]"!==Pm.call(e))return!1;var t,n=Rm.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Rm.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Rm.call(e,t)},zm=function(e,t){Am&&"__proto__"===t.name?Am(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Fm=function(e,t){if("__proto__"===t){if(!Rm.call(e,t))return;if(Im)return Im(e,t).value}return e[t]},jm=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=Fm(s,n),s!==(i=Fm(t,n))&&(c&&i&&(Lm(i)||(o=Om(i)))?(o?(o=!1,a=r&&Om(r)?r:[]):a=r&&Lm(r)?r:{},zm(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&zm(s,{name:n,newValue:i}));return s};function Hm(e,t,n){if(!e)return-1;var r=n.cache,i=e.origin?e.origin():null;i&&(e=i);var o=r.fields.indexOf(e),a=-1,s=-1;if(-1===o)for(var l=0;l<r.wrappedFields.length;l++)if(s=r.wrappedFields[l].attrDims.map((function(e){return e.instance})).indexOf(e),a=r.wrappedFields[l].attrExps.map((function(e){return e.instance})).indexOf(e),-1!==s||-1!==a){o=l;break}return(o-=t.qArea.qLeft)<0||o>=t.qArea.qWidth?-1:s>=0?function(e){return e[o].qAttrDims.qValues[s]}:a>=0?function(e){return e[o].qAttrExps.qValues[a]}:function(e){return e[o]}}function Bm(e,t,n){var r=n.key,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 Vm(e){var t=e.cache,n=e.f,r=e.mainCell,i=e.p;e.prop;var o=e.page,a=e.rowIdx,s=e.row,l=e.sourceKey,u=e.target,c=e.targetProp,d=r;if(i.field&&i.field!==n){var f=Hm(i.field,o,{cache:t});if(-1===f)return;d=jm({qRow:a},f(s))}u[c]=Bm(i,d,{key:l})}function Wm(e,t,n,r){for(var i=Array.isArray(e)?e:[e],o=[],a=0;a<i.length;a++)if(void 0!==i[a].field){for(var s=t.raw(),l=t.key(),u="object"===xm(i[a].field)?i[a].field:t.field(i[a].field),c=r.normalizeConfig(i[a],t),d=c.props,f=c.main,p=Object.keys(d),h=!!i[a].trackBy,m=xm(i[a].trackBy),g={},v=[],y=[],b=0;b<s.qDataPages.length;b++){var x=Hm(u,s.qDataPages[b],{cache:n});if(-1!==x)for(var w=0;w<s.qDataPages[b].qMatrix.length;w++){var k=s.qDataPages[b].qArea.qTop+w,C=jm({qRow:k},x(s.qDataPages[b].qMatrix[w])),S=Bm(f,C,{key:l});if(!(f.filter&&!f.filter(C))){for(var E=0;E<p.length;E++){var M=d[p[E]],T=M.fields||[M];M.fields&&(S[p[E]]=[]);for(var D=0;D<T.length;D++)Vm({cache:n,f:u,mainCell:C,p:T[D],prop:p[E],props:d,page:s.qDataPages[b],rowIdx:k,row:s.qDataPages[b].qMatrix[w],sourceKey:l,target:M.fields?S[p[E]]:S,targetProp:M.fields?D:p[E]});if(M.fields){var _=S[p[E]].map((function(e){return e.value})),N=S[p[E]].map((function(e){return e.label}));S[p[E]]={value:"function"==typeof M.value?M.value(_):void 0!==M.value?M.value:_,label:"function"==typeof M.label?M.label(N):void 0!==M.label?String(M.label):String(S[p[E]].value)}}}h&&r.track({cfg:i[a],itemData:C,obj:S,target:v,tracker:g,trackType:m}),y.push(S)}}}var q=h?r.collect(v,{main:f,propsArr:p,props:d}):y;o=[].concat(_m(o),_m(q))}return o}function Um(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 $m(e,t){var n,r,i,o,a,s=new Gm(e),l=+e.value&&(s.value=e.value),u=[s];for(null==t&&(t=Ym);n=u.pop();)if(l&&(n.value=+n.data.value),(i=t(n.data))&&(a=i.length))for(n.children=new Array(a),o=a-1;o>=0;--o)u.push(r=n.children[o]=new Gm(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Km)}function Ym(e){return e.children}function Xm(e){e.data=e.data.data}function Km(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Gm(e){this.data=e,this.depth=this.height=0,this.parent=null}function Jm(e){if("function"!=typeof e)throw new Error;return e}Gm.prototype=$m.prototype={constructor:Gm,count:function(){return this.eachAfter(Um)},each:function(e){var t,n,r,i,o=this,a=[o];do{for(t=a.reverse(),a=[];o=t.pop();)if(e(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length);return this},eachAfter:function(e){for(var t,n,r,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n]);for(;i=a.pop();)e(i);return this},eachBefore:function(e){for(var t,n,r=this,i=[r];r=i.pop();)if(e(r),t=r.children)for(n=t.length-1;n>=0;--n)i.push(t[n]);return this},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;e=n.pop(),t=r.pop();for(;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(){var e=[];return this.each((function(t){e.push(t)})),e},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return $m(this).eachBefore(Xm)}};var Zm={depth:-1},Qm={};function eg(e){return e.id}function tg(e){return e.parentId}function ng(e,t){"/"===e.charAt(0)&&(e=e.substring(1));for(var n,r=e.split("/"),i=t,o=0;o<r.length;o++){if("*"===r[o]&&Array.isArray(i)){var a=[];n=r.slice(o+1).join("/");for(var s=0;s<i.length;s++){var l=ng(n,i[s]);Array.isArray(l)?a.push.apply(a,_m(l)):a.push(l)}return a}if(!r[o]&&Array.isArray(i)){var u=new Array(i.length);n=r.slice(o+1).join("/");for(var c=0;c<i.length;c++)u[c]=ng(n,i[c]);return u}r[o]in i&&(i=i[r[o]])}return i}function rg(e,t,n){var r=[];if(!e||!e.length)return r;if(t<=0){var i=n>=0?[e[n]]:e;r=[].concat(_m(r),_m(i))}else for(var o=0;o<e.length;o++)e[o].children&&e[o].children.length&&(r=[].concat(_m(r),_m(rg(e[o].children,t-1,n))));return r}function ig(e,t,n){if(e===t)return function(e){return e};if(e>t){var r=Math.max(0,Math.min(100,e-t));return function(e){for(var t=e,n=0;n<r;++n)t=t.parent;return t}}if(t>e){var i=Math.max(0,Math.min(100,t-e));return function(e){return rg(e.children,i-1,n)}}return!1}function og(e,t){var n=t.cache;if("number"==typeof e)return n.fields[e];var r=n.allFields;if("function"==typeof e){for(var i=0;i<r.length;i++)if(e(r[i]))return r[i];return!1}if("string"==typeof e){for(var o=0;o<r.length;o++)if(r[o].key()===e||r[o].title()===e)return r[o]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}var ag=/^qDimensionInfo(?:\/(\d+))?/,sg=/^\/?qMeasureInfo\/(\d+)/,lg=/\/qAttrExprInfo\/(\d+)/,ug=/\/qAttrDimInfo\/(\d+)/;function cg(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((function(e,t){return t}))).filter((function(t){return t<e.qDimensionInfo.length}))}function dg(e,t){var n=t.cube;if(!e)return-1;var r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,u=-1,c=r,d=n.qEffectiveInterColumnSortOrder,f=cg(n);return ag.test(c)&&(i=!0,o=+ag.exec(c)[1],c=r.replace(ag,"")),sg.test(c)&&("K"===n.qMode?l=+sg.exec(c)[1]:d&&-1!==d.indexOf(-1)?(l=+sg.exec(c)[1],u=0):u=+sg.exec(c)[1],c=c.replace(sg,"")),c&&(ug.exec(c)?s=+ug.exec(c)[1]:lg.exec(c)&&(a=+lg.exec(c)[1])),{fieldDepth:(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))+1,pseudoMeasureIndex:l,measureIdx:u,attrDimIdx:s,attrIdx:a}}function fg(e,t){var n,r,i=ig(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?function(e){return e.data.qValues[t.measureIdx]}:function(e){return e.data},t.attrDimIdx>=0?r=function(e){var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=function(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 pg(e,t,n){var r=n.key,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 hg(e){for(var t=e.propsArr,n=e.props,r=e.item,i=e.itemData,o=e.ret,a=e.sourceKey,s=0;s<t.length;s++){var l=n[t[s]],u=l.fields||[l],c=void 0,d=void 0;l.fields&&(c=[],d=[]);for(var f=function(e){var n=u[e],f=void 0,p=void 0,h=void 0,m=void 0,g=void 0,v=void 0;if("primitive"===n.type?(h=n.value,v=String(n.value)):("function"==typeof n.value&&(f=function(e){return n.value(e,r)}),"function"==typeof n.label&&(p=function(e){return n.label(e,r)}),n.accessor?(m=n.accessor(r),Array.isArray(m)?(g=m.map(n.valueAccessor),n.attrAccessor&&(g=g.map(n.attrAccessor)),f&&(h=g.map(f),f=null),p&&(v=g.map(p),p=null),h=n.reduce?n.reduce(h):h,v=n.reduceLabel?n.reduceLabel(v,h):String(h)):v=h=n.attrAccessor?n.attrAccessor(n.valueAccessor(m)):n.valueAccessor(m)):(h=i,v=i)),l.fields){var y=f?f(h):h;c.push(y),d.push(p&&null!=v?p(v):null!=v?v:String(y))}else{var b=f?f(h):h;o[t[s]]={value:b,label:p?p(v):null!=v?v:String(b)},n.field&&(o[t[s]].source={field:n.field.key(),key:a})}},p=0;p<u.length;p++)f(p);c&&(o[t[s]]={value:"function"==typeof l.value?l.value(c,r):c,label:"function"==typeof l.label?l.label(d,r):d})}}var mg=function(e,t,n){var r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=ng(r,e);return o&&o[0]?(t.tree=$m(o[0],n.children||function(e){return e[i]}),t.tree):null};function gg(e){for(var t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){var t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((function(e,t){return t}))}(e),r=e.fields(),i=e.fields().filter((function(e){return"dimension"===e.type()})).map((function(e){return n.indexOf(r.indexOf(e))})),o=e.fields().filter((function(e){return"measure"===e.type()})).map((function(e){return n.indexOf(r.indexOf(e))})),a={__root:{__id:"__root",qValues:[]}},s=0;s<t.length;s++){for(var l=t[s],u="__root",c=!1,d=0;d<i.length;d++){var f,p=l[i[d]],h="".concat(u,"__").concat(null!==(f=p.qElemNumber)&&void 0!==f?f:p.qElemNo);a[h]||(a[h]=bm({__id:h,__parent:u,qValues:[]},p),c=!0),u=h}if(c)for(var m=0;m<o.length;m++){var g=l[o[m]];a[u].qValues.push(g)}}var v=Object.keys(a).map((function(e){return a[e]}));return function(){var e=eg,t=tg;function n(n){var r,i,o,a,s,l,u,c=n.length,d=new Array(c),f={};for(i=0;i<c;++i)r=n[i],s=d[i]=new Gm(r),null!=(l=e(r,i,n))&&(l+="")&&(f[u="$"+(s.id=l)]=u in f?Qm:s);for(i=0;i<c;++i)if(s=d[i],null!=(l=t(n[i],i,n))&&(l+="")){if(!(a=f["$"+l]))throw new Error("missing: "+l);if(a===Qm)throw new Error("ambiguous: "+l);a.children?a.children.push(s):a.children=[s],s.parent=a}else{if(o)throw new Error("multiple roots");o=s}if(!o)throw new Error("no root");if(o.parent=Zm,o.eachBefore((function(e){e.depth=e.parent.depth+1,--c})).eachBefore(Km),o.parent=null,c>0)throw new Error("cycle");return o}return n.id=function(t){return arguments.length?(e=Jm(t),n):e},n.parentId=function(e){return arguments.length?(t=Jm(e),n):t},n}().id((function(e){return e.__id})).parentId((function(e){return e.__parent}))(v)}var vg=function(e){for(var t=e.propsArr,n=e.props,r=e.cube,i=e.cache,o=e.itemDepthObject,a=e.f,s=0;s<t.length;s++)for(var l=n[t[s]],u=l.fields?l.fields:[l],c=0;c<u.length;c++){var d=u[c];if(d.field!==a){var f=fg(o,dg(d.field,{cube:r,cache:i}));d.accessor=f.nodeFn,d.valueAccessor=f.valueFn,d.attrAccessor=f.attrFn}}};function yg(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=t.raw(),o=t.key(),a="S"===i.qMode?gg(t):mg(i,n,e);if(!a)return null;for(var s=a.height,l=[],u=0;u<=s;u++){var c=null;if(u>0)if("S"===i.qMode){var d=cg(i),f=d[u-1];c=n.fields[f]}else{var p=i.qEffectiveInterColumnSortOrder[u-1];u>i.qEffectiveInterColumnSortOrder.length&&(p=i.qDimensionInfo.length),c=n.fields[p]}var h=r.normalizeConfig(bm(bm({},e),{},{field:c?c.key():void 0}),t),m=h.props,g=h.main,v=Object.keys(m);l[u]={propsArr:v,props:m,main:g};var y=c?dg(c,{cube:i,cache:n}):{fieldDepth:0};vg({propsArr:v,props:m,cube:i,cache:n,itemDepthObject:y,f:c})}for(var b=a.copy(),x=b.descendants(),w=a.descendants(),k=0;k<w.length;k++){var C=l[w[k].depth].propsArr,S=l[w[k].depth].props,E=l[w[k].depth].main,M=x[k],T=M.data,D=pg(E,T,{key:o});hg({propsArr:C,props:S,item:M,itemData:T,ret:D,sourceKey:o,isTree:!0}),w[k].data=D}return a}function bg(e,t,n,r){for(var i=Array.isArray(e)?e:[e],o=[],a=0;a<i.length;a++)if(void 0!==i[a].field){var s=t.raw(),l=t.key();if(!mg(s,n,e))continue;var u="object"===xm(i[a].field)?i[a].field:t.field(i[a].field),c=r.normalizeConfig(i[a],t),d=c.props,f=c.main,p=Object.keys(d),h=dg(u,{cube:s,cache:n}),m=fg({fieldDepth:0},h),g=m.nodeFn,v=m.attrFn,y=m.valueFn;vg({propsArr:p,props:d,cube:s,cache:n,itemDepthObject:h,f:u});for(var b=!!i[a].trackBy,x=xm(i[a].trackBy),w={},k=[],C=g(n.tree),S=[],E=0;E<C.length;E++){var M=C[E],T=v?v(y(M)):y(M);if(!(f.filter&&!f.filter(T))){var D=pg(f,T,{key:l});hg({propsArr:p,props:d,item:M,itemData:T,ret:D,sourceKey:l}),b&&r.track({cfg:i[a],itemData:T,obj:D,target:k,tracker:w,trackType:x}),S.push(D)}}var _=b?r.collect(k,{main:f,propsArr:p,props:d}):S;o=[].concat(_m(o),_m(_))}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var xg=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){
|
|
13
13
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
14
14
|
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,d,f=e.length,p=e.search(/[0-9\-\+#]/),h=p>0?e.substring(0,p):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),v=f-g,y=e.substring(v,v+1),b=v+("."===y||","===y?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(p,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(m="",v=(d=t[0]).length%l,f=d.length,b=0;b<f;b++)m+=d.charAt(b),!((b-v+1)%l)&&b<f-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),h+(n?"-":"")+r+x}}));function wg(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}var kg={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},Cg=/%$/,Sg=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Eg=/^\(oct\)/i,Mg=/^\(dec\)/i,Tg=/^\(hex\)/i,Dg=/^\(bin\)/i,_g=/^\(rom\)/i,Ng=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,qg=/#|0/g;function Rg(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 Pg(e,t,n){var r;return Sg.test(t)?e=Rg(e,Number(/\d{2}/.exec(t)[0]),t,n):Eg.test(t)?e=Rg(e,8,t,n):Mg.test(t)?e=Rg(e,10,t,n):Tg.test(t)?e=Rg(e,16,t,n):Dg.test(t)?e=Rg(e,2,t,n):_g.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=function(e,t){for(var n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t)):t+r+e.toExponential(0)),e}function Ag(e,t,n){var r=wg(e);return n?r:new RegExp(r||"",t)}function Ig(e,t,n,r){var i,o,a,s,l,u,c,d,f,p,h,m=e.pattern;r&&(e.abbreviate=!0),p=t,(h=n)&&(h=wg(h)),p&&(p=wg(p)),f=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(h,"[#0]+)?")),s=(a=(a=m.match(f))?a[0]:"")?m.substr(0,m.indexOf(a)):m,l=a?m.substring(m.indexOf(a)+a.length):"",a||(a=m?"#":"##########"),t&&t===n&&(o=(i=a.split(n)).pop(),a=i.join("")+n+o,t=""),u=t,t=/,/.test(n)?"¤":",",u&&(a=a.replace(Ag(u,"g"),t)),c=n,n=".",c&&(a=a.replace(Ag(c,"g"),n)),d=(d=a.match(/#/g))?d.length:0;var g,v=m.split(c);v[1]&&(g=v[1].match(qg)),e.prefix=s||"",e.postfix=l||"",e.pattern=m,e.maxPrecision=g?g.length:2,e.percentage=Cg.test(m),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(Ag(t,null,!0),"|").concat(Ag(n,null,!0)),"g"),e.groupTemp=u,e.decTemp=c,e.t=t,e.d=n,e.temp=d}var Og=function(){function e(t,n,r,i,o){wm(this,e),this.localeInfo=t,this.pattern=n,this.thousandDelimiter=r||",",this.decimalDelimiter=i||".",this.type=o||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return kg;var n={};return e.qNumericalAbbreviation.split(t).forEach((function(e){var t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(t,this.patternSeparator),this.prepare()}return Cm(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}},{key:"prepare",value:function(e,t,n){var r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),e){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],Ng.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Ng.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Ng.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;var i="U"===this.type;r.positive.isFunctional||Ig(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&Ig(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&Ig(r.zero,t,n,i)}else this._prepared={pattern:!1}}},{key:"formatValue",value:function(e){var t,n,r,i,o,a,s,l,u,c=this._prepared,d="",f="",p=e;if(isNaN(e))return"".concat(p);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return(c=c.zero).pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=Pg(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){var h,m,g=Object.keys(this.abbreviations).map((function(e){return parseInt(e,10)})).sort((function(e,t){return e-t})),v=g[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);v<=n&&s<g.length;)v=g[++s];s>0&&(h=g[s-1]),h&&n>0&&h>0?m=h:(n<0&&h<0||!h)&&(v<0&&v-n<=c.maxPrecision?m=v:h<=n&&!(v>0&&-n<=c.maxPrecision)&&(m=h)),m&&(d=this.abbreviations[m],e/=Math.pow(10,m))}if(r=Math.abs(e),t=c.temp,u=(l=c.numericPattern).split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,u||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{var y=Number(e.toFixed(Math.min(20,u?u.length:0)).split(".")[0]),b=l.split(o)[0];if(e=xg(b+=o,y)||"0",u){var x=Math.max(0,Math.min(14,u.length)),w=u.replace(/#+$/,"").length,k=("I"===this.type?0:r%1).toFixed(x).slice(2).replace(/0+$/,"");for(s=k.length;s<w;s++)k+="0";k&&(e+=o+k)}else 0===y&&(i=0)}else if(r>=Math.pow(10,t)||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),f=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=xg(l,e)}e=e.replace(c.numericRegex,(function(e){return e===a?c.groupTemp:e===o?c.decTemp:""})),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+f+d+c.postfix}}],[{key:"getStaticFormatter",value:function(){return{prepare:function(){},formatValue:function(e){return"".concat(e)}}}}]),e}();function Lg(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.size,o=void 0===i?5e3:i,a=r.multipleArguments,s=void 0!==a&&a,l=r.toKey,u=void 0===l?function(e){return e}:l,c=Object.create(null),d=Object.create(null),f=0,p=0;return(t=s?function(){return n=u.apply(void 0,arguments),t.has(n)?t.get(n):t.set(n,e.apply(void 0,arguments))}:function(r){return n=u(r),t.has(n)?t.get(n):t.set(n,e(r))}).set=function(e,t){return f>=o&&(delete c[d[p]],delete d[p],f--,p++),c[e]=t,d[f]=e,f++,t},t.get=function(e){return c[e]},t.has=function(e){return e in c},t.clear=function(){c=Object.create(null),d=Object.create(null),f=0,p=0},t.size=function(){return f},t}function zg(e,t,n,r,i){var o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Tm(Og,t)}(i,e,t,n,r),a=Lg(o.formatValue.bind(o),{toKey:function(e){return isNaN(e)?e:+e}});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}var Fg="D",jg="T",Hg="TS",Bg="IV",Vg=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Wg=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ug=["January","February","March","April","May","June","July","August","September","October","November","December"],$g=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Yg(e,t){for(var n=e.length;n<t;n++)e="0".concat(e);return e}function Xg(e){var t=e.toString().split(".");return t[1]?t=Number("0.".concat(t[1])):0}function Kg(e,t){var n,r=function(e){var t=e,n=24*Xg(t),r=60*Xg(n),i=60*Xg(r),o=1e3*Xg(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,u=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(u=n?n.getDay()-1:0)<0&&(u=6);var c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:i,h:o,m:a,s:s,f:l,t:c}}var Gg=function(){function e(t,n,r){wm(this,e);var i,o=t||{};(o.qCalendarStrings||(o.qCalendarStrings={qLongDayNames:Vg,qDayNames:Wg,qLongMonthNames:Ug,qMonthNames:$g}),this.localeInfo=o,this.locale_days=o.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=o.qCalendarStrings.qDayNames.slice(),this.locale_months=o.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=o.qCalendarStrings.qMonthNames.slice(),n)||(n=(Sm(i={},jg,o.qTimeFmt||"hh:mm:ss"),Sm(i,Fg,o.qDateFmt||"YYYY-MM-DD"),Sm(i,Hg,o.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"),i)[r]);this.pattern=n}return Cm(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");var n,r=/t+/gi.test(t);e instanceof Date?n=function(e,t){var n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&((n%=12)||(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,r):(e<0&&(e=-e,t="-".concat(t)),n=Kg(e,t));var i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Yg("".concat(t.year).slice(-2),2),YYY:Yg("".concat(t.year).slice(-3),3),def:function(e){return Yg("".concat(t.year),e.length)}},"M+":{M:t.month+1,MM:Yg("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Yg("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:function(e){return Yg("".concat(t.date),e.length)}},"h+|H+":{h:t.h,def:function(e){return Yg("".concat(t.h),e.length)}},"m+":{m:t.m,def:function(e){return Yg("".concat(t.m),e.length)}},"s+|S+":{s:t.s,def:function(e){return Yg("".concat(t.s),e.length)}},"f+|F+":{def:function(e){var n="".concat(t.f),r=e.length-n.length;if(r>0)for(var i=0;i<r;i++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def:function(e){var n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n.slice(0,e.length)}}}}(this,n),o=[];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);var s=new RegExp(o.join("|"),"g");return t.replace(s,(function(e){var t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n)).test(e))break;if(!t)return"";for(var o in i[n])if(o===e||o.toLowerCase()===e){void 0===(r=i[n][o])&&(r=i[n][o.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}))}}]),e}();function Jg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Tm(Gg,t)}function Zg(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}function Qg(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=Jg(n,e,t),i=Lg(r.format.bind(r),{toKey:function(e){return"object"===xm(e)&&"function"==typeof e.getTime?e.getTime():e}});function o(e){return t!==Bg?Zg(e):e}function a(e){return e=o(e),i(e)}return a.format=function(e,t){return i.clear(),t=o(t),r.format(t,e)},a.locale=function(n){return r=Jg(n,e,t),i=Lg(r.format.bind(r),{toKey:function(e){return"object"===xm(e)?e.getTime():e}}),this},a.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},a}function ev(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return Qg(e.qNumFormat.qFmt,e.qNumFormat.qType,t);var n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),zg(n,r,i,o,t)}function tv(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.meta,r=t.id,i=t.key,o=t.localeInfo,a=t.fieldExtractor,s=t.value,l=t.type,u=t.sourceField,c=s||("dimension"===l?function(e){return e.qElemNo}:function(e){return e.qValue}),d=function(e){return e.qText||""},f="dimension"===l?"first":"avg",p=ev(n,o),h="dimension"===l?"first":function(e,t){return p(t)},m={id:function(){return r},key:function(){return i},raw:function(){return n},title:function(){return n.qFallbackTitle||n.label},type:function(){return l},origin:function(){return u},items:function(){return e||(e=a(m)),e},min:function(){return n.qMin},max:function(){return n.qMax},value:c,label:d,reduce:f,reduceLabel:h,formatter:function(){return p},tags:function(){return n.qTags}};return m}function nv(e,t,n,r,i){return(t[e]||[]).map((function(t,o){var a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:tv(jm({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=nv("qAttrDimInfo",t,n,a,jm({},i,{value:function(e){return e.qElemNo},type:"dimension"})),s.attrExps=nv("qAttrExprInfo",t,n,a,jm({},i,{value:function(e){return e.qNum},type:"measure"})),s.measures=nv("qMeasureInfo",t,n,a,jm({},i,{value:function(e){return e.qValue},type:"measure"})),s}))}function rv(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.key,o=r.data,a=r.config,s=void 0===a?{}:a,l={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},u=o;if(!u)throw new Error('Missing "data" input');if(!u.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');var c=rv.util,d={cache:l,cube:u,localeInfo:s.localeInfo,fieldExtractor:null,pages:null,hierarchy:function(){return null},virtualFields:s.virtualFields},f={key:function(){return i},raw:function(){return u},field:function(e){return og(e,d)},fields:function(){return l.fields.slice()},extract:function(e){return d.extractor(e,f,l,c)},hierarchy:function(e){return d.hierarchy(e,f,l,c)},_cache:function(){return l}};"K"===u.qMode||"T"===u.qMode||!u.qMode&&u.qNodesOnDim?(d.extractor=bg,d.hierarchy=yg,d.pages="K"===u.qMode?u.qStackedDataPages:u.qTreeDataPages):"S"===u.qMode?(d.extractor=Wm,d.pages=u.qDataPages,d.hierarchy=yg):d.extractor=function(){return[]},d.fieldExtractor=function(e){return d.extractor({field:e},f,l,c)};var p="S"===u.qMode?function(e){return e.qElemNumber}:void 0,h="S"===u.qMode?function(e){return e.qNum}:void 0;(e=l.wrappedFields).push.apply(e,_m(nv("qDimensionInfo",u,i,"",jm({},d,{value:p,type:"dimension"})))),(t=l.wrappedFields).push.apply(t,_m(nv("qMeasureInfo",u,i,"",jm({},d,{value:h,type:"measure"})))),l.fields=l.wrappedFields.map((function(e){return e.instance}));var m=function e(t){t.forEach((function(t){l.allFields.push(t.instance),e(t.measures),e(t.attrDims),e(t.attrExps)}))};return m(l.wrappedFields),(s.virtualFields||[]).forEach((function(e){var t=f.field(e.from),n=tv(bm({meta:t.raw(),id:"".concat(i,"/").concat(e.key),sourceField:t,fieldExtractor:function(e){return d.extractor({field:e},f,l,c)},key:e.key,type:t.type(),localeInfo:d.localeInfo,value:t.value},e.override||{}));l.virtualFields.push(n)})),(n=l.allFields).push.apply(n,_m(l.virtualFields)),f}var iv=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ov=/\/qDimensionInfo(?:\/(\d+))?/,av=/\/qMeasureInfo\/(\d+)/,sv=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,lv=/\/qAttrExprInfo\/(\d+)/,uv=/\/?qHyperCube/,cv=/\/?qTreeData/,dv=function(e){return"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14))},fv=function(e){return"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13))};function pv(e,t){var n=e,r=-1,i=-1,o="",a=function(e){return e};uv.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=dv):cv.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=fv);var s=!0;if(ov.test(e)&&(r=+ov.exec(e)[1]),av.test(e)&&(i=+av.exec(e)[1]),sv.test(e)){i=-1,r=0;var l=+sv.exec(n)[2];isNaN(l)||(r=l,n=n.replace(/\/\d+$/,"")),s=!1}if(lv.test(e)){var u=i;if(t){i=0;var c=ng(o,t);i+=(c.qMeasureInfo||[]).length,r>-1?(i=c.qDimensionInfo.slice(0,r).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),r=-1):(i=c.qDimensionInfo.reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),i=c.qMeasureInfo.slice(0,u).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i)),i+=+lv.exec(n)[1]}else r>-1?(r=-1,i=+lv.exec(n)[1]):i+=+lv.exec(n)[1]+1}return iv.forEach((function(e){var t=Dm(e,2),r=t[0],i=t[1];n=n.replace(r,i)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}function hv(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=n.byCells,o=n.primarySource,a=[],s={},l=e.isActive(),u=!1;if(e.brushes().forEach((function(e){var t=pv(e.id,r);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){var n=e.brush.ranges();n.length&&(u=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((function(e){return 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){var l=e.brush.ranges();l.length&&(u=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),l.forEach((function(e){return 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){var c=e.brush.ranges();c.length&&(u=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),c.forEach((function(e){return 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(i)if(r&&r.qHyperCube&&("P"===r.qHyperCube.qMode||"T"===r.qHyperCube.qMode||"K"===r.qHyperCube.qMode)){var d=r.qHyperCube,f=d.qNoOfLeftDims,p=d.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===o||!o){var h=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));(0===f||p>=f)&&f>-1?h.forEach((function(e){s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:p-f})})):h.forEach((function(e){s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),u=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==o&&(o||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)})),u=!!s.selectHyperCubeCells.values.length);else{var m=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));u=!!m.length,a.push({params:[t.path,t.dimensionIdx,m,!1],method:"selectHyperCubeValues"})}}})),!u&&l)return[{method:"resetMadeSelections",params:[]}];s.rangeSelectHyperCubeValues&&a.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(t=n.orMode)||void 0===t||t]});return s.selectHyperCubeContinuousRange&&a.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&a.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&a.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&a.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),a}function mv(e){rv.util=e.data("matrix").util,e.data("q",rv),e.formatter("q-number",zg),e.formatter("q-time",Qg)}mv.qBrushHelper=hv,mv.selections=hv;var gv={click:"Tap",Click:"Tap",tap:"Tap",pan:"Pan",swipe:"Swipe",rotate:"Rotate",press:"Press",pinch:"Pinch"};function vv(e){return gv[e]||e}function yv(e){return function(t,n,r){var i,o,a,s,l=[],u=!0;function c(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&(i.gestures.forEach((function(t){t.options=t.options||{},void 0===t.options.enable&&(t.options.enable=!0),"function"==typeof t.options.enable&&(t.options.enable=t.options.enable.bind(o));var n=vv(t.type);e&&e[n]&&(t.options.event=t.options.event||t.type.toLowerCase(),(a=a||new e.Manager(r)).add(new e[n](t.options)),Object.keys(t.events).forEach((function(e){t.events[e]=t.events[e].bind(o),a.on(e,t.events[e])})),l.push(t))})),i.gestures.forEach((function(t){var n=vv(t.type);e&&e[n]&&(t.recognizeWith&&a.get(t.options.event).recognizeWith(t.recognizeWith.split(" ").filter((function(e){return""!==e}))),t.requireFailure&&a.get(t.options.event).requireFailure(t.requireFailure.split(" ").filter((function(e){return""!==e}))))})))}function d(){l.forEach((function(e){Object.keys(e.events).forEach((function(t){a.off(t,e.events[t])})),a.remove(e.options.event)})),l=[]}return{get key(){return s},set:function(e){!function(e){s=e.key,o={chart:t,mediator:n,settings:i=e},i.gestures=i.gestures||[],void 0===i.enable&&(i.enable=!0)}(e),d(),u&&c()},off:function(){u=!1,d()},on:function(){u=!0,0===l.length&&c()},destroy:function(){d(),a&&a.destroy(),a=null,o=null,i=null}}}}function bv(){return(bv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var xv=Object.prototype.hasOwnProperty,wv=Object.prototype.toString,kv=Object.defineProperty,Cv=Object.getOwnPropertyDescriptor,Sv=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===wv.call(e)},Ev=function(e){if(!e||"[object Object]"!==wv.call(e))return!1;var t,n=xv.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&xv.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||xv.call(e,t)},Mv=function(e,t){kv&&"__proto__"===t.name?kv(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Tv=function(e,t){if("__proto__"===t){if(!xv.call(e,t))return;if(Cv)return Cv(e,t).value}return e[t]},Dv=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=Tv(s,n),s!==(i=Tv(t,n))&&(c&&i&&(Ev(i)||(o=Sv(i)))?(o?(o=!1,a=r&&Sv(r)?r:[]):a=r&&Ev(r)?r:{},Mv(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&Mv(s,{name:n,newValue:i}));return s};const _v="center",Nv="bottom";var qv={NoDataExist:{label:"NoDataExist",alignment:_v,default:!0},OnlyNanData:{label:"OnlyNanData",alignment:_v,default:!0},OnlyNegativeOrZeroValues:{label:"OnlyNegativeOrZeroValues",alignment:_v,default:!1},LimitedData:{label:"LimitedData",alignment:Nv,default:!1},OnlyNanColor:{label:"OnlyNanColor",alignment:Nv,default:!1},NegativeOrZeroValues:{label:"NegativeOrZeroValues",alignment:Nv,default:!1},DataRangeIncludingZero:{label:"DataRangeIncludingZero",alignment:Nv,default:!1}};const Rv=[["FULL",{width:550,height:450}],["MEDIUM",{width:400,height:220}],["SMALL",{width:300,height:150}],["XSMALL",{width:150,height:75}],["SPARK",{width:0,height:0}]],Pv={};Rv.forEach((([e,{width:t,height:n}])=>{Pv[e]={width:t,height:n}}));const Av={getLayoutModes:()=>Pv,getLayoutMode(e,t){let n;for(n=0;n<Rv.length;++n)if(e>=Rv[n][1].width&&t>=Rv[n][1].height)return Rv[n][0];return"SPARK"}};function Iv(e,t){return{layoutModes:Av.getLayoutModes(),center:void 0!==t.minCenterRatio?{minWidthRatio:t.minCenterRatio,minHeightRatio:t.minCenterRatio}:void 0,logicalSize:t.logicalSize?{align:.5,preserveAspectRatio:!0,...t.logicalSize}:void 0}}const Ov=(e,t,n)=>{const r=t.split(".");let i,o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(void 0===o[r[i]])return n;o=o[r[i]]}return o};function Lv(e,t){const n=e.component(t);return n&&n._DO_NOT_USE_getInfo&&n._DO_NOT_USE_getInfo().offset}const zv=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Fv=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),jv=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),Hv={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),isLtrChar:e=>zv.test(e),isRtlChar:e=>Fv.test(e)||jv.test(e),detectTextDirection(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],Hv.isLtrChar(r))return"ltr";if(Hv.isRtlChar(r))return"rtl"}return"ltr"}},Bv={getColorSymbol:(e,t)=>e.h("div",{style:{display:"inline-block",width:"10px",height:"10px","background-color":t.color.fill,margin:"0 8px"}}),getNodeFillColor:e=>e.attrs&&void 0!==e.attrs.fill?e.attrs.fill:e.children&&e.children[0]&&e.children[0].attrs&&void 0!==e.children[0].attrs.fill?e.children[0].attrs.fill:void 0,getColor(e,t,n){const r=t.data,i=e.resources.formatter,o=e.resources.dataset,a={};if(n.coloring.label&&(a.label=""+n.coloring.label),"color"!==n.coloring.type&&r.fillTooltip){const e=i("fill"),t="measure"===n.coloring.fieldType;if(a.value=t&&e?e(r.fillTooltip.value):r.fillTooltip.label?r.fillTooltip.label:r.fillTooltip.value,!n.coloring.label){const e=o(r.fillTooltip.source.key).field(r.fillTooltip.source.field).title();a.label=""+e}}return a.fill=void 0===r._fillColor?Bv.getNodeFillColor(t):r._fillColor,a},getMeasure:(e,t)=>({label:""+e(t.source.key).field(t.source.field).title(),value:""===t.label||"NaN"===t.label?"-":t.label,field:t.source.field}),hideColorRow:(e,t)=>void 0===e.color.value||e.measures.some((e=>e.field===t.coloring.field)),getTitleRow(e,t){const n=Hv.detectTextDirection(e.title);return[{content:e.title,style:{"font-weight":"bold","text-align":t?"right":"left",direction:n},colspan:2},{}]},getDescriptionRow(e,t){const n=Hv.detectTextDirection(e.value);return[{content:e.value,style:{"text-align":t?"right":"left",direction:n},colspan:2},{}]},getNMoreRow(e,t,n){const r=t?t.get("Object.ChartTooltip.NMore",e):`+${e} more`;return[{content:r,style:{"font-weight":"bold","text-align":n?"right":"left",direction:Hv.detectTextDirection(r)},colspan:2},{}]},getSeparatorRow:()=>[{content:"",style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:2},{}],getColorRow(e,t,n){const r=Hv.detectTextDirection(t.color.label),i=n?[":",t.color.label]:[t.color.label,":"],o=Hv.detectTextDirection(t.color.value);return[{content:i,style:{"text-align":n?"right":"left",direction:r}},{content:n?[t.color.value,Bv.getColorSymbol(e,t)]:[Bv.getColorSymbol(e,t),t.color.value],style:{"text-align":n?"left":"right",direction:o,"vertical-align":"middle"}}]},getMeasureRow(e,t,n,r,i=!1){const o=Hv.detectTextDirection(e.label),a=r?[":",e.label]:[e.label,":"],s=Hv.detectTextDirection(e.value);let l;return l=i?r?[e.value,Bv.getColorSymbol(t,n)]:[Bv.getColorSymbol(t,n),e.value]:[e.value],[{content:a,style:{"text-align":r?"right":"left",direction:o}},{content:l,style:{"text-align":r?"left":"right",direction:s,"vertical-align":"middle"}}]}};function Vv(e){const t=parseInt(e,10);if(!isNaN(t))return t}const Wv=e=>t=>e.getContrastingColorTo(t.node.attrs.fill);function Uv(e,t){const n=e.themeService.getStyles();return{padding:10,placements:e.simplifiedPlacements.map((n=>function(e,t,n){const r=n.themeService.getStyles();return{position:e.position,justify:e.justify,fill:e.onBackground?r.label.value.color:Wv(t),overflow:e.overflow,padding:e.padding}}(n,t,e))),fontSize:Vv(n.label.value.fontSize),fontFamily:n.label.value.fontFamily,label:e.label}}function $v(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 Xv(){}var Kv=.7,Gv=1/Kv,Jv="\\s*([+-]?\\d+)\\s*",Zv="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qv="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ey=/^#([0-9a-f]{3,8})$/,ty=new RegExp("^rgb\\("+[Jv,Jv,Jv]+"\\)$"),ny=new RegExp("^rgb\\("+[Qv,Qv,Qv]+"\\)$"),ry=new RegExp("^rgba\\("+[Jv,Jv,Jv,Zv]+"\\)$"),iy=new RegExp("^rgba\\("+[Qv,Qv,Qv,Zv]+"\\)$"),oy=new RegExp("^hsl\\("+[Zv,Qv,Qv]+"\\)$"),ay=new RegExp("^hsla\\("+[Zv,Qv,Qv,Zv]+"\\)$"),sy={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 ly(){return this.rgb().formatHex()}function uy(){return this.rgb().formatRgb()}function cy(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ey.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?dy(t):3===n?new hy(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?fy(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?fy(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=ty.exec(e))?new hy(t[1],t[2],t[3],1):(t=ny.exec(e))?new hy(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ry.exec(e))?fy(t[1],t[2],t[3],t[4]):(t=iy.exec(e))?fy(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=oy.exec(e))?yy(t[1],t[2]/100,t[3]/100,1):(t=ay.exec(e))?yy(t[1],t[2]/100,t[3]/100,t[4]):sy.hasOwnProperty(e)?dy(sy[e]):"transparent"===e?new hy(NaN,NaN,NaN,0):null}function dy(e){return new hy(e>>16&255,e>>8&255,255&e,1)}function fy(e,t,n,r){return r<=0&&(e=t=n=NaN),new hy(e,t,n,r)}function py(e){return e instanceof Xv||(e=cy(e)),e?new hy((e=e.rgb()).r,e.g,e.b,e.opacity):new hy}function hy(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function my(){return"#"+vy(this.r)+vy(this.g)+vy(this.b)}function gy(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function vy(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function yy(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new xy(e,t,n,r)}function by(e){if(e instanceof xy)return new xy(e.h,e.s,e.l,e.opacity);if(e instanceof Xv||(e=cy(e)),!e)return new xy;if(e instanceof xy)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new xy(a,s,l,e.opacity)}function xy(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function wy(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}$v(Xv,cy,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:ly,formatHex:ly,formatHsl:function(){return by(this).formatHsl()},formatRgb:uy,toString:uy}),$v(hy,(function(e,t,n,r){return 1===arguments.length?py(e):new hy(e,t,n,null==r?1:r)}),Yv(Xv,{brighter:function(e){return e=null==e?Gv:Math.pow(Gv,e),new hy(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?Kv:Math.pow(Kv,e),new hy(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:my,formatHex:my,formatRgb:gy,toString:gy})),$v(xy,(function(e,t,n,r){return 1===arguments.length?by(e):new xy(e,t,n,null==r?1:r)}),Yv(Xv,{brighter:function(e){return e=null==e?Gv:Math.pow(Gv,e),new xy(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?Kv:Math.pow(Kv,e),new xy(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new hy(wy(e>=240?e-240:e+120,i,r),wy(e,i,r),wy(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var ky=Math.PI/180,Cy=180/Math.PI,Sy=.96422,Ey=.82521,My=4/29,Ty=6/29,Dy=3*Ty*Ty;function _y(e){if(e instanceof Ny)return new Ny(e.l,e.a,e.b,e.opacity);if(e instanceof Ly)return zy(e);e instanceof hy||(e=py(e));var t,n,r=Ay(e.r),i=Ay(e.g),o=Ay(e.b),a=qy((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=qy((.4360747*r+.3850649*i+.1430804*o)/Sy),n=qy((.0139322*r+.0971045*i+.7141733*o)/Ey)),new Ny(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Ny(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function qy(e){return e>.008856451679035631?Math.pow(e,1/3):e/Dy+My}function Ry(e){return e>Ty?e*e*e:Dy*(e-My)}function Py(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Ay(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Iy(e){if(e instanceof Ly)return new Ly(e.h,e.c,e.l,e.opacity);if(e instanceof Ny||(e=_y(e)),0===e.a&&0===e.b)return new Ly(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Cy;return new Ly(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Oy(e,t,n,r){return 1===arguments.length?Iy(e):new Ly(e,t,n,null==r?1:r)}function Ly(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function zy(e){if(isNaN(e.h))return new Ny(e.l,0,0,e.opacity);var t=e.h*ky;return new Ny(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}$v(Ny,(function(e,t,n,r){return 1===arguments.length?_y(e):new Ny(e,t,n,null==r?1:r)}),Yv(Xv,{brighter:function(e){return new Ny(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new Ny(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new hy(Py(3.1338561*(t=Sy*Ry(t))-1.6168667*(e=1*Ry(e))-.4906146*(n=Ey*Ry(n))),Py(-.9787684*t+1.9161415*e+.033454*n),Py(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),$v(Ly,Oy,Yv(Xv,{brighter:function(e){return new Ly(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new Ly(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return zy(this).rgb()}}));var Fy=-.14861,jy=1.78277,Hy=-.29227,By=-.90649,Vy=1.97294,Wy=Vy*By,Uy=Vy*jy,$y=jy*Hy-By*Fy;function Yy(e){if(e instanceof Xy)return new Xy(e.h,e.s,e.l,e.opacity);e instanceof hy||(e=py(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=($y*r+Wy*t-Uy*n)/-5.9615122912,o=r-i,a=(Vy*(n-i)-Hy*o)/By,s=Math.sqrt(a*a+o*o)/(Vy*i*(1-i)),l=s?Math.atan2(a,o)*Cy-120:NaN;return new Xy(l<0?l+360:l,s,i,e.opacity)}function Xy(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Ky(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}$v(Xy,(function(e,t,n,r){return 1===arguments.length?Yy(e):new Xy(e,t,n,null==r?1:r)}),Yv(Xv,{brighter:function(e){return e=null==e?Gv:Math.pow(Gv,e),new Xy(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?Kv:Math.pow(Kv,e),new Xy(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=isNaN(this.h)?0:(this.h+120)*ky,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new hy(255*(t+n*(Fy*r+jy*i)),255*(t+n*(Hy*r+By*i)),255*(t+n*(Vy*r)),this.opacity)}})),function(e){1===e.length&&(e=function(e){return function(t,n){return Ky(e(t),n)}}(e))}(Ky);var Gy="$";function Jy(){}function Zy(e,t){var n=new Jy;if(e instanceof Jy)e.each((function(e,t){n.set(t,e)}));else if(Array.isArray(e)){var r,i=-1,o=e.length;if(null==t)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(t(r=e[i],i,e),r)}else if(e)for(var a in e)n.set(a,e[a]);return n}function Qy(){}Jy.prototype=Zy.prototype={constructor:Jy,has:function(e){return Gy+e in this},get:function(e){return this[Gy+e]},set:function(e,t){return this[Gy+e]=t,this},remove:function(e){var t=Gy+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===Gy&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===Gy&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===Gy&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===Gy&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===Gy&&++e;return e},empty:function(){for(var e in this)if(e[0]===Gy)return!1;return!0},each:function(e){for(var t in this)t[0]===Gy&&e(this[t],t.slice(1),this)}};var eb=Zy.prototype;function tb(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function nb(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function rb(){}Qy.prototype={constructor:Qy,has:eb.has,add:function(e){return this[Gy+(e+="")]=e,this},remove:eb.remove,clear:eb.clear,values:eb.keys,size:eb.size,empty:eb.empty,each:eb.each};var ib=.7,ob=1/ib,ab="\\s*([+-]?\\d+)\\s*",sb="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",lb="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ub=/^#([0-9a-f]{3})$/,cb=/^#([0-9a-f]{6})$/,db=new RegExp("^rgb\\("+[ab,ab,ab]+"\\)$"),fb=new RegExp("^rgb\\("+[lb,lb,lb]+"\\)$"),pb=new RegExp("^rgba\\("+[ab,ab,ab,sb]+"\\)$"),hb=new RegExp("^rgba\\("+[lb,lb,lb,sb]+"\\)$"),mb=new RegExp("^hsl\\("+[sb,lb,lb]+"\\)$"),gb=new RegExp("^hsla\\("+[sb,lb,lb,sb]+"\\)$"),vb={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 yb(e){var t;return e=(e+"").trim().toLowerCase(),(t=ub.exec(e))?new Cb((t=parseInt(t[1],16))>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):(t=cb.exec(e))?bb(parseInt(t[1],16)):(t=db.exec(e))?new Cb(t[1],t[2],t[3],1):(t=fb.exec(e))?new Cb(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=pb.exec(e))?xb(t[1],t[2],t[3],t[4]):(t=hb.exec(e))?xb(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=mb.exec(e))?Eb(t[1],t[2]/100,t[3]/100,1):(t=gb.exec(e))?Eb(t[1],t[2]/100,t[3]/100,t[4]):vb.hasOwnProperty(e)?bb(vb[e]):"transparent"===e?new Cb(NaN,NaN,NaN,0):null}function bb(e){return new Cb(e>>16&255,e>>8&255,255&e,1)}function xb(e,t,n,r){return r<=0&&(e=t=n=NaN),new Cb(e,t,n,r)}function wb(e){return e instanceof rb||(e=yb(e)),e?new Cb((e=e.rgb()).r,e.g,e.b,e.opacity):new Cb}function kb(e,t,n,r){return 1===arguments.length?wb(e):new Cb(e,t,n,null==r?1:r)}function Cb(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Sb(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Eb(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Tb(e,t,n,r)}function Mb(e){if(e instanceof Tb)return new Tb(e.h,e.s,e.l,e.opacity);if(e instanceof rb||(e=yb(e)),!e)return new Tb;if(e instanceof Tb)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Tb(a,s,l,e.opacity)}function Tb(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}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)}tb(rb,yb,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),tb(Cb,kb,nb(rb,{brighter:function(e){return e=null==e?ob:Math.pow(ob,e),new Cb(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?ib:Math.pow(ib,e),new Cb(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+Sb(this.r)+Sb(this.g)+Sb(this.b)},toString:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}})),tb(Tb,(function(e,t,n,r){return 1===arguments.length?Mb(e):new Tb(e,t,n,null==r?1:r)}),nb(rb,{brighter:function(e){return e=null==e?ob:Math.pow(ob,e),new Tb(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?ib:Math.pow(ib,e),new Tb(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Cb(Db(e>=240?e-240:e+120,i,r),Db(e,i,r),Db(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var _b=Math.PI/180,Nb=180/Math.PI,qb=.96422,Rb=.82521,Pb=4/29,Ab=6/29,Ib=3*Ab*Ab;function Ob(e){if(e instanceof Lb)return new Lb(e.l,e.a,e.b,e.opacity);if(e instanceof Vb){if(isNaN(e.h))return new Lb(e.l,0,0,e.opacity);var t=e.h*_b;return new Lb(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}e instanceof Cb||(e=wb(e));var n,r,i=Hb(e.r),o=Hb(e.g),a=Hb(e.b),s=zb((.2225045*i+.7168786*o+.0606169*a)/1);return i===o&&o===a?n=r=s:(n=zb((.4360747*i+.3850649*o+.1430804*a)/qb),r=zb((.0139322*i+.0971045*o+.7141733*a)/Rb)),new Lb(116*s-16,500*(n-s),200*(s-r),e.opacity)}function Lb(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function zb(e){return e>.008856451679035631?Math.pow(e,1/3):e/Ib+Pb}function Fb(e){return e>Ab?e*e*e:Ib*(e-Pb)}function jb(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Hb(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Bb(e){if(e instanceof Vb)return new Vb(e.h,e.c,e.l,e.opacity);if(e instanceof Lb||(e=Ob(e)),0===e.a&&0===e.b)return new Vb(NaN,0,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Nb;return new Vb(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Vb(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}tb(Lb,(function(e,t,n,r){return 1===arguments.length?Ob(e):new Lb(e,t,n,null==r?1:r)}),nb(rb,{brighter:function(e){return new Lb(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new Lb(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new Cb(jb(3.1338561*(t=qb*Fb(t))-1.6168667*(e=1*Fb(e))-.4906146*(n=Rb*Fb(n))),jb(-.9787684*t+1.9161415*e+.033454*n),jb(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),tb(Vb,(function(e,t,n,r){return 1===arguments.length?Bb(e):new Vb(e,t,n,null==r?1:r)}),nb(rb,{brighter:function(e){return new Vb(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new Vb(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return Ob(this).rgb()}}));var Wb=-.14861,Ub=1.78277,$b=-.29227,Yb=-.90649,Xb=1.97294,Kb=Xb*Yb,Gb=Xb*Ub,Jb=Ub*$b-Yb*Wb;function Zb(e){if(e instanceof ex)return new ex(e.h,e.s,e.l,e.opacity);e instanceof Cb||(e=wb(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(Jb*r+Kb*t-Gb*n)/(Jb+Kb-Gb),o=r-i,a=(Xb*(n-i)-$b*o)/Yb,s=Math.sqrt(a*a+o*o)/(Xb*i*(1-i)),l=s?Math.atan2(a,o)*Nb-120:NaN;return new ex(l<0?l+360:l,s,i,e.opacity)}function Qb(e,t,n,r){return 1===arguments.length?Zb(e):new ex(e,t,n,null==r?1:r)}function ex(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function tx(e){return function(){return e}}function nx(e,t){return function(n){return e+n*t}}function rx(e){return 1==(e=+e)?ix: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):tx(isNaN(t)?n:t)}}function ix(e,t){var n=t-e;return n?nx(e,n):tx(isNaN(e)?t:e)}function ox(e){return function t(n){function r(t,r){var i=e((t=Qb(t)).h,(r=Qb(r)).h),o=ix(t.s,r.s),a=ix(t.l,r.l),s=ix(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=o(e),t.l=a(Math.pow(e,n)),t.opacity=s(e),t+""}}return n=+n,r.gamma=t,r}(1)}function ax(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}tb(ex,Qb,nb(rb,{brighter:function(e){return e=null==e?ob:Math.pow(ob,e),new ex(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?ib:Math.pow(ib,e),new ex(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=isNaN(this.h)?0:(this.h+120)*_b,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Cb(255*(t+n*(Wb*r+Ub*i)),255*(t+n*($b*r+Yb*i)),255*(t+n*(Xb*r)),this.opacity)}})),function e(t){var n=rx(t);function r(e,t){var r=n((e=kb(e)).r,(t=kb(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=ix(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1),ox((function(e,t){var n=t-e;return n?nx(e,n>180||n<-180?n-360*Math.round(n/360):n):tx(isNaN(e)?t:e)})),ox(ix);var sx,lx=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ux(e){return new cx(e)}function cx(e){if(!(t=lx.exec(e)))throw new Error("invalid format: "+e);var t;this.fill=t[1]||" ",this.align=t[2]||">",this.sign=t[3]||"-",this.symbol=t[4]||"",this.zero=!!t[5],this.width=t[6]&&+t[6],this.comma=!!t[7],this.precision=t[8]&&+t[8].slice(1),this.trim=!!t[9],this.type=t[10]||""}function dx(e,t){var n=ax(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}ux.prototype=cx.prototype,cx.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var fx={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.round(e).toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return dx(100*e,t)},r:dx,s:function(e,t){var n=ax(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(sx=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ax(e,Math.max(0,t+o-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function px(e){return e}var hx,mx=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function gx(e){var t,n,r=e.grouping&&e.thousands?(t=e.grouping,n=e.thousands,function(e,r){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}):px,i=e.currency,o=e.decimal,a=e.numerals?function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(e.numerals):px,s=e.percent||"%";function l(e){var t=(e=ux(e)).fill,n=e.align,l=e.sign,u=e.symbol,c=e.zero,d=e.width,f=e.comma,p=e.precision,h=e.trim,m=e.type;"n"===m?(f=!0,m="g"):fx[m]||(null==p&&(p=12),h=!0,m="g"),(c||"0"===t&&"="===n)&&(c=!0,t="0",n="=");var g="$"===u?i[0]:"#"===u&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",v="$"===u?i[1]:/[%p]/.test(m)?s:"",y=fx[m],b=/[defgprs%]/.test(m);function x(e){var i,s,u,x=g,w=v;if("c"===m)w=y(e)+w,e="";else{var k=(e=+e)<0;if(e=y(Math.abs(e),p),h&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(i>0){if(!+e[r])break e;i=0}}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),k&&0==+e&&(k=!1),x=(k?"("===l?l:"-":"-"===l||"("===l?"":l)+x,w=("s"===m?mx[8+sx/3]:"")+w+(k&&"("===l?")":""),b)for(i=-1,s=e.length;++i<s;)if(48>(u=e.charCodeAt(i))||u>57){w=(46===u?o+e.slice(i+1):e.slice(i))+w,e=e.slice(0,i);break}}f&&!c&&(e=r(e,1/0));var C=x.length+e.length+w.length,S=C<d?new Array(d-C+1).join(t):"";switch(f&&c&&(e=r(S+e,S.length?d-w.length:1/0),S=""),n){case"<":e=x+e+w+S;break;case"=":e=x+S+e+w;break;case"^":e=S.slice(0,C=S.length>>1)+x+e+w+S.slice(C);break;default:e=S+x+e+w}return a(e)}return p=null==p?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,p)):Math.max(0,Math.min(20,p)),x.toString=function(){return e+""},x}return{format:l,formatPrefix:function(e,t){var n=l(((e=ux(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(function(e){return(e=ax(Math.abs(e)))?e[1]:NaN}(t)/3))),i=Math.pow(10,-r),o=mx[8+r/3];return function(e){return n(i*e)+o}}}}!function(e){(hx=gx(e)).format,hx.formatPrefix}({decimal:".",thousands:",",grouping:[3],currency:["$",""]});var vx=new Date,yx=new Date;function bx(e,t,n,r){function i(t){return e(t=new Date(+t)),t}return i.floor=i,i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<r);return s},i.filter=function(n){return bx((function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}))},n&&(i.count=function(t,r){return vx.setTime(+t),yx.setTime(+r),e(vx),e(yx),Math.floor(n(vx,yx))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e==0}:function(t){return i.count(0,t)%e==0}):i:null}),i}var xx=bx((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));xx.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?bx((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,n){t.setTime(+t+n*e)}),(function(t,n){return(n-t)/e})):xx:null},xx.range;var wx=1e3,kx=6e4,Cx=36e5,Sx=864e5,Ex=6048e5;bx((function(e){e.setTime(Math.floor(e/wx)*wx)}),(function(e,t){e.setTime(+e+t*wx)}),(function(e,t){return(t-e)/wx}),(function(e){return e.getUTCSeconds()})).range,bx((function(e){e.setTime(Math.floor(e/kx)*kx)}),(function(e,t){e.setTime(+e+t*kx)}),(function(e,t){return(t-e)/kx}),(function(e){return e.getMinutes()})).range,bx((function(e){var t=e.getTimezoneOffset()*kx%Cx;t<0&&(t+=Cx),e.setTime(Math.floor((+e-t)/Cx)*Cx+t)}),(function(e,t){e.setTime(+e+t*Cx)}),(function(e,t){return(t-e)/Cx}),(function(e){return e.getHours()})).range;var Mx=bx((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*kx)/Sx}),(function(e){return e.getDate()-1}));function Tx(e){return bx((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*kx)/Ex}))}Mx.range;var Dx=Tx(0),_x=Tx(1),Nx=Tx(2),qx=Tx(3),Rx=Tx(4),Px=Tx(5),Ax=Tx(6);Dx.range,_x.range,Nx.range,qx.range,Rx.range,Px.range,Ax.range,bx((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()})).range;var Ix=bx((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));Ix.every=function(e){return isFinite(e=Math.floor(e))&&e>0?bx((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n*e)})):null},Ix.range,bx((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+t*kx)}),(function(e,t){return(t-e)/kx}),(function(e){return e.getUTCMinutes()})).range,bx((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+t*Cx)}),(function(e,t){return(t-e)/Cx}),(function(e){return e.getUTCHours()})).range;var Ox=bx((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/Sx}),(function(e){return e.getUTCDate()-1}));function Lx(e){return bx((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/Ex}))}Ox.range;var zx=Lx(0),Fx=Lx(1),jx=Lx(2),Hx=Lx(3),Bx=Lx(4),Vx=Lx(5),Wx=Lx(6);zx.range,Fx.range,jx.range,Hx.range,Bx.range,Vx.range,Wx.range,bx((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})).range;var Ux=bx((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));function $x(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Yx(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Xx(e){return{y:e,m:0,d:1,H:0,M:0,S:0,L:0}}Ux.every=function(e){return isFinite(e=Math.floor(e))&&e>0?bx((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null},Ux.range;var Kx,Gx,Jx,Zx={"-":"",_:" ",0:"0"},Qx=/^\s*\d+/,ew=/^%/,tw=/[\\^$*+?|[\]().{}]/g;function nw(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function rw(e){return e.replace(tw,"\\$&")}function iw(e){return new RegExp("^(?:"+e.map(rw).join("|")+")","i")}function ow(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function aw(e,t,n){var r=Qx.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function sw(e,t,n){var r=Qx.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function lw(e,t,n){var r=Qx.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function uw(e,t,n){var r=Qx.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function cw(e,t,n){var r=Qx.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function dw(e,t,n){var r=Qx.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function fw(e,t,n){var r=Qx.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function pw(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function hw(e,t,n){var r=Qx.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function mw(e,t,n){var r=Qx.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function gw(e,t,n){var r=Qx.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function vw(e,t,n){var r=Qx.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function yw(e,t,n){var r=Qx.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function bw(e,t,n){var r=Qx.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function xw(e,t,n){var r=Qx.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function ww(e,t,n){var r=Qx.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function kw(e,t,n){var r=ew.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Cw(e,t,n){var r=Qx.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Sw(e,t,n){var r=Qx.exec(t.slice(n));return r?(e.Q=1e3*+r[0],n+r[0].length):-1}function Ew(e,t){return nw(e.getDate(),t,2)}function Mw(e,t){return nw(e.getHours(),t,2)}function Tw(e,t){return nw(e.getHours()%12||12,t,2)}function Dw(e,t){return nw(1+Mx.count(Ix(e),e),t,3)}function _w(e,t){return nw(e.getMilliseconds(),t,3)}function Nw(e,t){return _w(e,t)+"000"}function qw(e,t){return nw(e.getMonth()+1,t,2)}function Rw(e,t){return nw(e.getMinutes(),t,2)}function Pw(e,t){return nw(e.getSeconds(),t,2)}function Aw(e){var t=e.getDay();return 0===t?7:t}function Iw(e,t){return nw(Dx.count(Ix(e),e),t,2)}function Ow(e,t){var n=e.getDay();return e=n>=4||0===n?Rx(e):Rx.ceil(e),nw(Rx.count(Ix(e),e)+(4===Ix(e).getDay()),t,2)}function Lw(e){return e.getDay()}function zw(e,t){return nw(_x.count(Ix(e),e),t,2)}function Fw(e,t){return nw(e.getFullYear()%100,t,2)}function jw(e,t){return nw(e.getFullYear()%1e4,t,4)}function Hw(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+nw(t/60|0,"0",2)+nw(t%60,"0",2)}function Bw(e,t){return nw(e.getUTCDate(),t,2)}function Vw(e,t){return nw(e.getUTCHours(),t,2)}function Ww(e,t){return nw(e.getUTCHours()%12||12,t,2)}function Uw(e,t){return nw(1+Ox.count(Ux(e),e),t,3)}function $w(e,t){return nw(e.getUTCMilliseconds(),t,3)}function Yw(e,t){return $w(e,t)+"000"}function Xw(e,t){return nw(e.getUTCMonth()+1,t,2)}function Kw(e,t){return nw(e.getUTCMinutes(),t,2)}function Gw(e,t){return nw(e.getUTCSeconds(),t,2)}function Jw(e){var t=e.getUTCDay();return 0===t?7:t}function Zw(e,t){return nw(zx.count(Ux(e),e),t,2)}function Qw(e,t){var n=e.getUTCDay();return e=n>=4||0===n?Bx(e):Bx.ceil(e),nw(Bx.count(Ux(e),e)+(4===Ux(e).getUTCDay()),t,2)}function ek(e){return e.getUTCDay()}function tk(e,t){return nw(Fx.count(Ux(e),e),t,2)}function nk(e,t){return nw(e.getUTCFullYear()%100,t,2)}function rk(e,t){return nw(e.getUTCFullYear()%1e4,t,4)}function ik(){return"+0000"}function ok(){return"%"}function ak(e){return+e}function sk(e){return Math.floor(+e/1e3)}!function(e){(Kx=function(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,u=iw(i),c=ow(i),d=iw(o),f=ow(o),p=iw(a),h=ow(a),m=iw(s),g=ow(s),v=iw(l),y=ow(l),b={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:Ew,e:Ew,f:Nw,H:Mw,I:Tw,j:Dw,L:_w,m:qw,M:Rw,p:function(e){return i[+(e.getHours()>=12)]},Q:ak,s:sk,S:Pw,u:Aw,U:Iw,V:Ow,w:Lw,W:zw,x:null,X:null,y:Fw,Y:jw,Z:Hw,"%":ok},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:Bw,e:Bw,f:Yw,H:Vw,I:Ww,j:Uw,L:$w,m:Xw,M:Kw,p:function(e){return i[+(e.getUTCHours()>=12)]},Q:ak,s:sk,S:Gw,u:Jw,U:Zw,V:Qw,w:ek,W:tk,x:null,X:null,y:nk,Y:rk,Z:ik,"%":ok},w={a:function(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=h[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=v.exec(t.slice(n));return r?(e.m=y[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return S(e,t,n,r)},d:mw,e:mw,f:ww,H:vw,I:vw,j:gw,L:xw,m:hw,M:yw,p:function(e,t,n){var r=u.exec(t.slice(n));return r?(e.p=c[r[0].toLowerCase()],n+r[0].length):-1},Q:Cw,s:Sw,S:bw,u:sw,U:lw,V:uw,w:aw,W:cw,x:function(e,t,r){return S(e,n,t,r)},X:function(e,t,n){return S(e,r,t,n)},y:fw,Y:dw,Z:pw,"%":kw};function k(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,u=e.length;for(n instanceof Date||(n=new Date(+n));++s<u;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=Zx[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function C(e,t){return function(n){var r,i,o=Xx(1900);if(S(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("p"in o&&(o.H=o.H%12+12*o.p),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Yx(Xx(o.y))).getUTCDay(),r=i>4||0===i?Fx.ceil(r):Fx(r),r=Ox.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=t(Xx(o.y))).getDay(),r=i>4||0===i?_x.ceil(r):_x(r),r=Mx.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Yx(Xx(o.y)).getUTCDay():t(Xx(o.y)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Yx(o)):t(o)}}function S(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a<s;){if(r>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=w[i in Zx?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=k(n,b),b.X=k(r,b),b.c=k(t,b),x.x=k(n,x),x.X=k(r,x),x.c=k(t,x),{format:function(e){var t=k(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=C(e+="",$x);return t.toString=function(){return e},t},utcFormat:function(e){var t=k(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e,Yx);return t.toString=function(){return e},t}}}(e)).format,Kx.parse,Gx=Kx.utcFormat,Jx=Kx.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var lk="%Y-%m-%dT%H:%M:%S.%LZ";Date.prototype.toISOString||Gx(lk),+new Date("2000-01-01T00:00:00.000Z")||Jx(lk);const uk=Dv.bind(null,!0),ck={},{isArray:dk}=Array;function fk(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function pk(e){return void 0===e}function hk(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function mk(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach(((t,i)=>{if(i===n.length)return;r=+t;const o=isNaN(r)?{}:[];e[r||t]=pk(e[r||t])?o:e[t],e=e[r||t]})),e}function gk(e,t){let n=!0;if(fk(e)&&fk(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((r=>{gk(e[r],t[r])||(n=!1)})),n);if(dk(e)&&dk(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n+=1)if(!gk(e[n],t[n]))return!1;return!0}return e===t}ck.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach((i=>{const o=function(e){return e?uk({},{val:e}).val:e}(t[i]),a=e[i],s=`${n}/${i}`;gk(o,a)||hk(t,i)||(pk(a)?r.push({op:"add",path:s,value:o}):fk(o)&&fk(a)?r=r.concat(ck.generate(a,o,s)):dk(o)&&dk(a)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o=-1;function a(e,t,n){if(e[n]&&pk(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,r=e.length;n<r;n+=1)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(gk(t,i))return r;if(!pk(t[0])&&pk(t[0].qInfo)||0===t.length)return r.push({op:"replace",path:n,value:t}),r;for(let e=i.length-1;e>=0;e-=1)o=a(t,i[e].qInfo&&i[e].qInfo.qId,e),-1===o?(r.push({op:"remove",path:`${n}/${e}`}),i.splice(e,1)):r=r.concat(ck.generate(i[e],t[o],`${n}/${e}`));for(let e=0,s=t.length;e<s;e+=1)o=a(i,t[e].qInfo&&t[e].qInfo.qId),-1===o?(r.push({op:"add",path:`${n}/${e}`,value:t[e]}),i.splice(e,0,t[e])):o!==e&&(r.push({op:"move",path:`${n}/${e}`,from:`${n}/${o}`}),i.splice(e,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:`${n}/${i}`,value:o}))})),Object.keys(e).forEach((i=>{pk(t[i])&&!hk(e,i)&&r.push({op:"remove",path:`${n}/${i}`})})),r},ck.apply=function(e,t){t.forEach((t=>{let n=mk(e,t.path),r=t.path.split("/").splice(-1)[0],i=r&&isNaN(+r)?n[r]:n[+r]||n;const o=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(n=null,i=e),"add"===t.op||"replace"===t.op)if(dk(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(dk(i)&&dk(t.value)){const e=t.value.slice();i.length=0,i.push(...e)}else if(fk(i)&&fk(t.value))a=i,Object.keys(a).forEach((e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!hk(a,e)&&delete a[e]})),uk(i,t.value);else{if(!n)throw new Error("Patchee is not an object we can patch");n[r]=t.value}else if("move"===t.op){const i=mk(e,t.from);dk(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(dk(n)?n.splice(+r,1):delete n[r]);var a}))},ck.clone=function(e){return uk({},e)},ck.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},ck.updateObject=function(e,t){Object.keys(e).length?ck.apply(e,ck.generate(e,t)):uk(e,t)};const vk=[[2,4,6],[2,4],[3]],yk=[,[,,[[1,2]],[[1,2,3],[1,3]],[[1,2,4],[1,4]],[[1,2,4],[1,5]],[[1,2,4,6],[2,4,6],[1,3,6],[1,6]],[[1,2,4,6],[2,4,6],[1,3,6],[1,7]],[[1,2,4,8],[2,4,8],[1,8]],[[1,2,4,8],[2,4,8],[1,3,9],[1,9]],[[1,2,4,6,10],[1,2,4,10],[1,3,10],[3,10],[1,10]]],[,,,[[2,3]],[[2,3,4],[2,4]],[[2,3,4],[2,4],[2,5]],[[2,4,6],[2,6]],[[2,4,6],[2,6],[2,7]],[[2,4,8],[2,8]],[[2,4,8],[2,8],[2,9]],[[2,4,6,10],[2,4,10],[5,10],[3,10]]],[,,,,[[3,4]],[[3,4,5],[3,5]],[[3,4,5,6],[3,6]],[[3,4,5,6],[3,5,7],[3,7]],[[3,4,5,6,8],[3,5,7],[4,8],[3,8]],[[3,4,5,6,8],[3,4,6,9],[3,4,6,8],[3,6,9],[4,8],[3,9]],[[4,6,10],[5,10],[3,10]]],[,,,,,[[4,5]],[[4,5,6],[4,6]],[[4,5,6,7],[4,5,6],[4,6]],[[4,5,6,7,8],[4,5,6,7],[4,6,8],[4,8]],[[4,5,6,7,8],[4,6,9],[4,6,8],[4,8]],[[4,6,10],[5,7,9],[5,10],[4,10]]],[,,,,,,[[5,6]],[[5,6,7],[5,7]],[[5,6,7,8],[5,6,7],[6,8]],[[5,6,7,8,9],[5,6,7,8],[5,7,9],[5,9]],[[6,8,10],[5,10]]],[,,,,,,,[[6,7]],[[6,7,8],[6,8]],[[6,7,8,9],[6,7,8],[6,9]],[[6,7,8,9,10],[6,8,10],[6,10]]],[,,,,,,,,[[7,8]],[[7,8,9],[7,9]],[[7,8,9,10],[8,10],[7,10],[7,9]]],[,,,,,,,,,[[8,9]],[[8,9,10],[8,10]]],[,,,,,,,,,,[[9,10]]]];function bk(e,t,n){const r=e?e.length:0;let i,o=void 0===t?Number.MAX_VALUE:e[0]/t;for(i=1;i<r;i++)o=Math.min(o,e[i]/e[i-1]);void 0!==n&&(o=Math.min(o,n/e[r-1])),e.splice(0,0,o)}function xk(e,t,n){let r;const i=e?e.length:0;for(r=0;r<i;r++)bk(e[r],t,n)}!function(){let e,t;for(xk(vk,1,10),e=0;e<yk.length;e++)if(yk[e])for(t=0;t<yk[e].length;t++)Array.isArray(yk[e][t])&&xk(yk[e][t])}();var wk={exports:{}},kk=Object.getOwnPropertySymbols,Ck=Object.prototype.hasOwnProperty,Sk=Object.prototype.propertyIsEnumerable;
|
|
15
15
|
/*
|
|
@@ -82,6 +82,6 @@ var kD=wk.exports,CD=Mk,SD=xD.exports;function ED(e,t,n,r,i,o,a,s){if(!e){if(e=v
|
|
|
82
82
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
83
83
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
84
84
|
* SOFTWARE.
|
|
85
|
-
*/var aB=iB&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),oB))}};function sB(e){return e&&"[object Function]"==={}.toString.call(e)}function lB(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function uB(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function cB(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=lB(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?e:cB(uB(e))}function dB(e){return e&&e.referenceNode?e.referenceNode:e}var fB=iB&&!(!window.MSInputMethodContext||!document.documentMode),pB=iB&&/MSIE 10/.test(navigator.userAgent);function hB(e){return 11===e?fB:10===e?pB:fB||pB}function mB(e){if(!e)return document.documentElement;for(var t=hB(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===lB(n,"position")?mB(n):n:e?e.ownerDocument.documentElement:document.documentElement}function gB(e){return null!==e.parentNode?gB(e.parentNode):e}function vB(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,i=n?t:e,o=document.createRange();o.setStart(r,0),o.setEnd(i,0);var a,s,l=o.commonAncestorContainer;if(e!==l&&t!==l||r.contains(i))return"BODY"===(s=(a=l).nodeName)||"HTML"!==s&&mB(a.firstElementChild)!==a?mB(l):l;var u=gB(e);return u.host?vB(u.host,t):vB(e,gB(t).host)}function yB(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var i=e.ownerDocument.documentElement,o=e.ownerDocument.scrollingElement||i;return o[n]}return e[n]}function bB(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=yB(t,"top"),i=yB(t,"left"),o=n?-1:1;return e.top+=r*o,e.bottom+=r*o,e.left+=i*o,e.right+=i*o,e}function xB(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+r+"Width"],10)}function wB(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],hB(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function kB(e){var t=e.body,n=e.documentElement,r=hB(10)&&getComputedStyle(n);return{height:wB("Height",t,n,r),width:wB("Width",t,n,r)}}var CB=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},SB=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),EB=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},MB=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function TB(e){return MB({},e,{right:e.left+e.width,bottom:e.top+e.height})}function DB(e){var t={};try{if(hB(10)){t=e.getBoundingClientRect();var n=yB(e,"top"),r=yB(e,"left");t.top+=n,t.left+=r,t.bottom+=n,t.right+=r}else t=e.getBoundingClientRect()}catch(e){}var i={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},o="HTML"===e.nodeName?kB(e.ownerDocument):{},a=o.width||e.clientWidth||i.width,s=o.height||e.clientHeight||i.height,l=e.offsetWidth-a,u=e.offsetHeight-s;if(l||u){var c=lB(e);l-=xB(c,"x"),u-=xB(c,"y"),i.width-=l,i.height-=u}return TB(i)}function _B(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=hB(10),i="HTML"===t.nodeName,o=DB(e),a=DB(t),s=cB(e),l=lB(t),u=parseFloat(l.borderTopWidth,10),c=parseFloat(l.borderLeftWidth,10);n&&i&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var d=TB({top:o.top-a.top-u,left:o.left-a.left-c,width:o.width,height:o.height});if(d.marginTop=0,d.marginLeft=0,!r&&i){var f=parseFloat(l.marginTop,10),p=parseFloat(l.marginLeft,10);d.top-=u-f,d.bottom-=u-f,d.left-=c-p,d.right-=c-p,d.marginTop=f,d.marginLeft=p}return(r&&!n?t.contains(s):t===s&&"BODY"!==s.nodeName)&&(d=bB(d,t)),d}function NB(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=_B(e,n),i=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:yB(n),s=t?0:yB(n,"left"),l={top:a-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:i,height:o};return TB(l)}function qB(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===lB(e,"position"))return!0;var n=uB(e);return!!n&&qB(n)}function RB(e){if(!e||!e.parentElement||hB())return document.documentElement;for(var t=e.parentElement;t&&"none"===lB(t,"transform");)t=t.parentElement;return t||document.documentElement}function PB(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},a=i?RB(e):vB(e,dB(t));if("viewport"===r)o=NB(a,i);else{var s=void 0;"scrollParent"===r?"BODY"===(s=cB(uB(t))).nodeName&&(s=e.ownerDocument.documentElement):s="window"===r?e.ownerDocument.documentElement:r;var l=_B(s,a,i);if("HTML"!==s.nodeName||qB(a))o=l;else{var u=kB(e.ownerDocument),c=u.height,d=u.width;o.top+=l.top-l.marginTop,o.bottom=c+l.top,o.left+=l.left-l.marginLeft,o.right=d+l.left}}var f="number"==typeof(n=n||0);return o.left+=f?n:n.left||0,o.top+=f?n:n.top||0,o.right-=f?n:n.right||0,o.bottom-=f?n:n.bottom||0,o}function AB(e){return e.width*e.height}function IB(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=PB(n,r,o,i),s={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},l=Object.keys(s).map((function(e){return MB({key:e},s[e],{area:AB(s[e])})})).sort((function(e,t){return t.area-e.area})),u=l.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),c=u.length>0?u[0].key:l[0].key,d=e.split("-")[1];return c+(d?"-"+d:"")}function OB(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=r?RB(t):vB(t,dB(n));return _B(n,i,r)}function LB(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function zB(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function FB(e,t,n){n=n.split("-")[0];var r=LB(e),i={width:r.width,height:r.height},o=-1!==["right","left"].indexOf(n),a=o?"top":"left",s=o?"left":"top",l=o?"height":"width",u=o?"width":"height";return i[a]=t[a]+t[l]/2-r[l]/2,i[s]=n===s?t[s]-r[u]:t[zB(s)],i}function jB(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function HB(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex((function(e){return e[t]===n}));var r=jB(e,(function(e){return e[t]===n}));return e.indexOf(r)}(e,"name",n))).forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&sB(n)&&(t.offsets.popper=TB(t.offsets.popper),t.offsets.reference=TB(t.offsets.reference),t=n(t,e))})),t}function BB(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=OB(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=IB(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=FB(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=HB(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function VB(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function WB(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r<t.length;r++){var i=t[r],o=i?""+i+n:e;if(void 0!==document.body.style[o])return o}return null}function UB(){return this.state.isDestroyed=!0,VB(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[WB("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function $B(e){var t=e.ownerDocument;return t?t.defaultView:window}function YB(e,t,n,r){var i="BODY"===e.nodeName,o=i?e.ownerDocument.defaultView:e;o.addEventListener(t,n,{passive:!0}),i||YB(cB(o.parentNode),t,n,r),r.push(o)}function XB(e,t,n,r){n.updateBound=r,$B(e).addEventListener("resize",n.updateBound,{passive:!0});var i=cB(e);return YB(i,"scroll",n.updateBound,n.scrollParents),n.scrollElement=i,n.eventsEnabled=!0,n}function KB(){this.state.eventsEnabled||(this.state=XB(this.reference,this.options,this.state,this.scheduleUpdate))}function GB(){var e,t;this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=(e=this.reference,t=this.state,$B(e).removeEventListener("resize",t.updateBound),t.scrollParents.forEach((function(e){e.removeEventListener("scroll",t.updateBound)})),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t))}function JB(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function ZB(e,t){Object.keys(t).forEach((function(n){var r="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&JB(t[n])&&(r="px"),e.style[n]=t[n]+r}))}var QB=iB&&/Firefox/i.test(navigator.userAgent);function eV(e,t,n){var r=jB(e,(function(e){return e.name===t})),i=!!r&&e.some((function(e){return e.name===n&&e.enabled&&e.order<r.order}));if(!i){var o="`"+t+"`",a="`"+n+"`";console.warn(a+" modifier is required by "+o+" modifier in order to work, be sure to include it before "+o+"!")}return i}var tV=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],nV=tV.slice(3);function rV(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=nV.indexOf(e),r=nV.slice(n+1).concat(nV.slice(0,n));return t?r.reverse():r}var iV="flip",oV="clockwise",aV="counterclockwise";function sV(e,t,n,r){var i=[0,0],o=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map((function(e){return e.trim()})),s=a.indexOf(jB(a,(function(e){return-1!==e.search(/,|\s/)})));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,u=-1!==s?[a.slice(0,s).concat([a[s].split(l)[0]]),[a[s].split(l)[1]].concat(a.slice(s+1))]:[a];return(u=u.map((function(e,r){var i=(1===r?!o:o)?"height":"width",a=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+i[1],a=i[2];if(!o)return e;if(0===a.indexOf("%")){var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=r}return TB(s)[t]/100*o}if("vh"===a||"vw"===a)return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o;return o}(e,i,t,n)}))}))).forEach((function(e,t){e.forEach((function(n,r){JB(n)&&(i[t]+=n*("-"===e[r-1]?-1:1))}))})),i}var lV={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var i=e.offsets,o=i.reference,a=i.popper,s=-1!==["bottom","top"].indexOf(n),l=s?"left":"top",u=s?"width":"height",c={start:EB({},l,o[l]),end:EB({},l,o[l]+o[u]-a[u])};e.offsets.popper=MB({},a,c[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,i=e.offsets,o=i.popper,a=i.reference,s=r.split("-")[0],l=void 0;return l=JB(+n)?[+n,0]:sV(n,o,a,s),"left"===s?(o.top+=l[0],o.left-=l[1]):"right"===s?(o.top+=l[0],o.left+=l[1]):"top"===s?(o.left+=l[0],o.top-=l[1]):"bottom"===s&&(o.left+=l[0],o.top+=l[1]),e.popper=o,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||mB(e.instance.popper);e.instance.reference===n&&(n=mB(n));var r=WB("transform"),i=e.instance.popper.style,o=i.top,a=i.left,s=i[r];i.top="",i.left="",i[r]="";var l=PB(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);i.top=o,i.left=a,i[r]=s,t.boundaries=l;var u=t.priority,c=e.offsets.popper,d={primary:function(e){var n=c[e];return c[e]<l[e]&&!t.escapeWithReference&&(n=Math.max(c[e],l[e])),EB({},e,n)},secondary:function(e){var n="right"===e?"left":"top",r=c[n];return c[e]>l[e]&&!t.escapeWithReference&&(r=Math.min(c[n],l[e]-("right"===e?c.width:c.height))),EB({},n,r)}};return u.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";c=MB({},c,d[t](e))})),e.offsets.popper=c,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,i=e.placement.split("-")[0],o=Math.floor,a=-1!==["top","bottom"].indexOf(i),s=a?"right":"bottom",l=a?"left":"top",u=a?"width":"height";return n[s]<o(r[l])&&(e.offsets.popper[l]=o(r[l])-n[u]),n[l]>o(r[s])&&(e.offsets.popper[l]=o(r[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!eV(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"==typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var i=e.placement.split("-")[0],o=e.offsets,a=o.popper,s=o.reference,l=-1!==["left","right"].indexOf(i),u=l?"height":"width",c=l?"Top":"Left",d=c.toLowerCase(),f=l?"left":"top",p=l?"bottom":"right",h=LB(r)[u];s[p]-h<a[d]&&(e.offsets.popper[d]-=a[d]-(s[p]-h)),s[d]+h>a[p]&&(e.offsets.popper[d]+=s[d]+h-a[p]),e.offsets.popper=TB(e.offsets.popper);var m=s[d]+s[u]/2-h/2,g=lB(e.instance.popper),v=parseFloat(g["margin"+c],10),y=parseFloat(g["border"+c+"Width"],10),b=m-e.offsets.popper[d]-v-y;return b=Math.max(Math.min(a[u]-h,b),0),e.arrowElement=r,e.offsets.arrow=(EB(n={},d,Math.round(b)),EB(n,f,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(VB(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=PB(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],i=zB(r),o=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case iV:a=[r,i];break;case oV:a=rV(r);break;case aV:a=rV(r,!0);break;default:a=t.behavior}return a.forEach((function(s,l){if(r!==s||a.length===l+1)return e;r=e.placement.split("-")[0],i=zB(r);var u=e.offsets.popper,c=e.offsets.reference,d=Math.floor,f="left"===r&&d(u.right)>d(c.left)||"right"===r&&d(u.left)<d(c.right)||"top"===r&&d(u.bottom)>d(c.top)||"bottom"===r&&d(u.top)<d(c.bottom),p=d(u.left)<d(n.left),h=d(u.right)>d(n.right),m=d(u.top)<d(n.top),g=d(u.bottom)>d(n.bottom),v="left"===r&&p||"right"===r&&h||"top"===r&&m||"bottom"===r&&g,y=-1!==["top","bottom"].indexOf(r),b=!!t.flipVariations&&(y&&"start"===o&&p||y&&"end"===o&&h||!y&&"start"===o&&m||!y&&"end"===o&&g),x=!!t.flipVariationsByContent&&(y&&"start"===o&&h||y&&"end"===o&&p||!y&&"start"===o&&g||!y&&"end"===o&&m),w=b||x;(f||v||w)&&(e.flipped=!0,(f||v)&&(r=a[l+1]),w&&(o=function(e){return"end"===e?"start":"start"===e?"end":e}(o)),e.placement=r+(o?"-"+o:""),e.offsets.popper=MB({},e.offsets.popper,FB(e.instance.popper,e.offsets.reference,e.placement)),e=HB(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,i=r.popper,o=r.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return i[a?"left":"top"]=o[n]-(s?i[a?"width":"height"]:0),e.placement=zB(t),e.offsets.popper=TB(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!eV(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=jB(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottom<n.top||t.left>n.right||t.top>n.bottom||t.right<n.left){if(!0===e.hide)return e;e.hide=!0,e.attributes["x-out-of-boundaries"]=""}else{if(!1===e.hide)return e;e.hide=!1,e.attributes["x-out-of-boundaries"]=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var n=t.x,r=t.y,i=e.offsets.popper,o=jB(e.instance.modifiers,(function(e){return"applyStyle"===e.name})).gpuAcceleration;void 0!==o&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a=void 0!==o?o:t.gpuAcceleration,s=mB(e.instance.popper),l=DB(s),u={position:i.position},c=function(e,t){var n=e.offsets,r=n.popper,i=n.reference,o=Math.round,a=Math.floor,s=function(e){return e},l=o(i.width),u=o(r.width),c=-1!==["left","right"].indexOf(e.placement),d=-1!==e.placement.indexOf("-"),f=t?c||d||l%2==u%2?o:a:s,p=t?o:s;return{left:f(l%2==1&&u%2==1&&!d&&t?r.left-1:r.left),top:p(r.top),bottom:p(r.bottom),right:f(r.right)}}(e,window.devicePixelRatio<2||!QB),d="bottom"===n?"top":"bottom",f="right"===r?"left":"right",p=WB("transform"),h=void 0,m=void 0;if(m="bottom"===d?"HTML"===s.nodeName?-s.clientHeight+c.bottom:-l.height+c.bottom:c.top,h="right"===f?"HTML"===s.nodeName?-s.clientWidth+c.right:-l.width+c.right:c.left,a&&p)u[p]="translate3d("+h+"px, "+m+"px, 0)",u[d]=0,u[f]=0,u.willChange="transform";else{var g="bottom"===d?-1:1,v="right"===f?-1:1;u[d]=m*g,u[f]=h*v,u.willChange=d+", "+f}var y={"x-placement":e.placement};return e.attributes=MB({},y,e.attributes),e.styles=MB({},u,e.styles),e.arrowStyles=MB({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(e){var t,n;return ZB(e.instance.popper,e.styles),t=e.instance.popper,n=e.attributes,Object.keys(n).forEach((function(e){!1!==n[e]?t.setAttribute(e,n[e]):t.removeAttribute(e)})),e.arrowElement&&Object.keys(e.arrowStyles).length&&ZB(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,n,r,i){var o=OB(i,t,e,n.positionFixed),a=IB(n.placement,o,t,e,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return t.setAttribute("x-placement",a),ZB(t,{position:n.positionFixed?"fixed":"absolute"}),n},gpuAcceleration:void 0}}},uV=function(){function e(t,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};CB(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=aB(this.update.bind(this)),this.options=MB({},e.Defaults,i),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(MB({},e.Defaults.modifiers,i.modifiers)).forEach((function(t){r.options.modifiers[t]=MB({},e.Defaults.modifiers[t]||{},i.modifiers?i.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return MB({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&sB(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return SB(e,[{key:"update",value:function(){return BB.call(this)}},{key:"destroy",value:function(){return UB.call(this)}},{key:"enableEventListeners",value:function(){return KB.call(this)}},{key:"disableEventListeners",value:function(){return GB.call(this)}}]),e}();function cV(e){return"function"==typeof e?e():e}uV.Utils=("undefined"!=typeof window?window:global).PopperUtils,uV.placements=tV,uV.Defaults=lV;var dV="undefined"!=typeof window?vC.useLayoutEffect:vC.useEffect,fV={},pV=vC.forwardRef((function(e,t){var n=e.anchorEl,r=e.children,i=e.container,o=e.disablePortal,a=void 0!==o&&o,s=e.keepMounted,l=void 0!==s&&s,u=e.modifiers,c=e.open,d=e.placement,f=void 0===d?"bottom":d,p=e.popperOptions,h=void 0===p?fV:p,m=e.popperRef,g=e.transition,v=void 0!==g&&g,y=VC(e,["anchorEl","children","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition"]),b=vC.useRef(null),x=LL(b,t),w=vC.useRef(null),k=LL(w,m),C=vC.useRef(k);dV((function(){C.current=k}),[k]),vC.useImperativeHandle(m,(function(){return w.current}),[]);var S=vC.useState(!0),E=S[0],M=S[1],T=function(e){if("rtl"!==("undefined"!=typeof window&&document.body.getAttribute("dir")||"ltr"))return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(f),D=vC.useState(T),_=D[0],N=D[1],q=vC.useCallback((function(){if(b.current&&n&&c){w.current&&(w.current.destroy(),C.current(null));var e=function(e){N(e.placement)};cV(n);var t=new uV(cV(n),b.current,HC({placement:T},h,{modifiers:HC({},a?{}:{preventOverflow:{boundariesElement:"window"}},{},u,{},h.modifiers),onCreate:jF(e,h.onCreate),onUpdate:jF(e,h.onUpdate)}));C.current(t)}}),[n,a,u,c,T,h]),R=vC.useCallback((function(e){OL(x,e),q()}),[x,q]),P=function(){w.current&&(w.current.destroy(),C.current(null))};if(vC.useEffect((function(){q()}),[q]),vC.useEffect((function(){return function(){P()}}),[]),vC.useEffect((function(){c||v||P()}),[c,v]),!l&&!c&&(!v||E))return null;var A={placement:_};return v&&(A.TransitionProps={in:c,onEnter:function(){M(!1)},onExited:function(){M(!0),P()}}),vC.createElement(FF,{disablePortal:a,container:i},vC.createElement("div",HC({ref:R,role:"tooltip"},y,{style:HC({position:"fixed",top:0,left:0},y.style)}),"function"==typeof r?r(A):r))})),hV=Zz(vC.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),mV=Zz(vC.createElement("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"})),gV=vC.createElement(hV,null);var vV=fD((function(e){return{root:{position:"relative",display:"flex","&$checked $layer":{transform:"scale(1)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.shortest})}},layer:{left:0,position:"absolute",transform:"scale(0)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeIn,duration:e.transitions.duration.shortest})},checked:{}}}),{name:"PrivateRadioButtonIcon"})((function(e){var t=e.checked,n=e.classes;return vC.createElement("div",{className:YT(n.root,t&&n.checked)},gV,vC.createElement(mV,{className:n.layer}))})),yV=vC.createContext(),bV=vC.createElement(vV,{checked:!0}),xV=vC.createElement(vV,null),wV=vC.forwardRef((function(e,t){var n=e.checked,r=e.classes,i=e.color,o=void 0===i?"secondary":i,a=e.name,s=e.onChange,l=VC(e,["checked","classes","color","name","onChange"]),u=vC.useContext(yV),c=n,d=jF(s,u&&u.onChange),f=a;return u&&(void 0===c&&(c=u.value===e.value),void 0===f&&(f=u.name)),vC.createElement(bF,HC({color:o,type:"radio",icon:xV,checkedIcon:bV,classes:{root:YT(r.root,r["color".concat(pD(o))]),checked:r.checked,disabled:r.disabled},name:f,checked:c,onChange:d,ref:t},l))}));function kV(e,t){return"object"===UC(t)&&null!==t?e===t:String(e)===String(t)}fD((function(e){return{root:{color:e.palette.text.secondary},checked:{},disabled:{},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:LC(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:LC(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}}}}),{name:"MuiRadio"})(wV),vC.forwardRef((function(e,t){var n=e.actions,r=e.children,i=e.name,o=e.value,a=e.onChange,s=VC(e,["actions","children","name","value","onChange"]),l=vC.useRef(null),u=vC.useRef(null!=o).current,c=vC.useState((function(){return u?null:e.defaultValue})),d=c[0],f=c[1];vC.useImperativeHandle(n,(function(){return{focus:function(){var e=l.current.querySelector("input:not(:disabled):checked");e||(e=l.current.querySelector("input:not(:disabled)")),e&&e.focus()}}}),[]);var p={name:i,onChange:function(e){u||f(e.target.value),a&&a(e,e.target.value)},value:u?o:d},h=LL(t,l);return vC.createElement(jj,HC({role:"radiogroup",ref:h},s),vC.createElement(yV.Provider,{value:p},r))})),vC.Component;var CV=vC.forwardRef((function(e,t){var n=e.autoFocus,r=e.autoWidth,i=e.children,o=e.classes,a=e.className,s=e.defaultValue,l=e.disabled,u=e.displayEmpty,c=e.labelId,d=e.IconComponent,f=e.inputRef,p=e.MenuProps,h=void 0===p?{}:p,m=e.multiple,g=e.name,v=e.onBlur,y=e.onChange,b=e.onClose,x=e.onFocus,w=e.onOpen,k=e.open,C=e.readOnly,S=e.renderValue;e.required;var E=e.SelectDisplayProps,M=void 0===E?{}:E,T=e.tabIndex;e.type;var D=e.value,_=e.variant,N=void 0===_?"standard":_,q=VC(e,["autoFocus","autoWidth","children","classes","className","defaultValue","disabled","displayEmpty","labelId","IconComponent","inputRef","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","required","SelectDisplayProps","tabIndex","type","value","variant"]),R=vC.useRef(null!=D).current,P=vC.useState(s),A=P[0],I=P[1],O=R?D:A,L=vC.useRef(null),z=vC.useState(null),F=z[0],j=z[1],H=vC.useRef(null!=k).current,B=vC.useState(),V=B[0],W=B[1],U=vC.useState(!1),$=U[0],Y=U[1],X=LL(t,f);vC.useImperativeHandle(X,(function(){return{focus:function(){F.focus()},node:L.current,value:O}}),[F,O]),vC.useEffect((function(){n&&F&&F.focus()}),[n,F]);var K,G,J=function(e,t){e?w&&w(t):(F.focus(),b&&b(t)),H||(W(r?null:F.clientWidth),Y(e))},Z=function(e){return function(t){var n;if(m||J(!1,t),m){n=Array.isArray(O)?TM(O):[];var r=O.indexOf(e.props.value);-1===r?n.push(e.props.value):n.splice(r,1)}else n=e.props.value;R||I(n),y&&(t.persist(),Object.defineProperty(t,"target",{writable:!0,value:{value:n,name:g}}),y(t,e))}},Q=null!==F&&(H?k:$);delete q["aria-invalid"];var ee=[],te=!1;(_j({value:O})||u)&&(S?K=S(O):te=!0);var ne=vC.Children.map(i,(function(e){if(!vC.isValidElement(e))return null;var t;if(m){if(!Array.isArray(O))throw new Error("Material-UI: the `value` prop must be an array when using the `Select` component with `multiple`.");(t=O.some((function(t){return kV(t,e.props.value)})))&&te&&ee.push(e.props.children)}else(t=kV(O,e.props.value))&&te&&(G=e.props.children);return vC.cloneElement(e,{"aria-selected":t?"true":void 0,onClick:Z(e),role:"option",selected:t,value:void 0,"data-value":e.props.value})}));te&&(K=m?ee.join(", "):G);var re,ie=V;!r&&H&&F&&(ie=F.clientWidth),re=void 0!==T?T:l?null:0;var oe=M.id||(g?"mui-component-select-".concat(g):void 0);return vC.createElement(vC.Fragment,null,vC.createElement("div",HC({className:YT(o.root,o.select,o.selectMenu,o[N],a,l&&o.disabled),ref:j,tabIndex:re,role:"button","aria-expanded":Q?"true":void 0,"aria-labelledby":"".concat(c||""," ").concat(oe||""),"aria-haspopup":"listbox",onKeyDown:function(e){if(!C){-1!==[" ","ArrowUp","ArrowDown","Enter"].indexOf(e.key)&&(e.preventDefault(),J(!0,e))}},onClick:l||C?null:function(e){J(!0,e)},onBlur:function(e){!Q&&v&&(e.persist(),Object.defineProperty(e,"target",{writable:!0,value:{value:O,name:g}}),v(e))},onFocus:x},M,{id:oe}),function(e){return null==e||"string"==typeof e&&!e.trim()}(K)?vC.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}}):K),vC.createElement("input",HC({value:Array.isArray(O)?O.join(","):O,name:g,ref:L,type:"hidden",autoFocus:n},q)),vC.createElement(d,{className:YT(o.icon,o["icon".concat(pD(N))],Q&&o.iconOpen)}),vC.createElement(UH,HC({id:"menu-".concat(g||""),anchorEl:F,open:Q,onClose:function(e){J(!1,e)}},h,{MenuListProps:HC({"aria-labelledby":c,role:"listbox",disableListWrap:!0},h.MenuListProps),PaperProps:HC({},h.PaperProps,{style:HC({minWidth:ie},null!=h.PaperProps?h.PaperProps.style:null)})}),ne))})),SV=JH,EV=vC.createElement(cH,null),MV=vC.createElement(Aj,null),TV=vC.forwardRef((function e(t,n){var r=t.autoWidth,i=void 0!==r&&r,o=t.children,a=t.classes,s=t.displayEmpty,l=void 0!==s&&s,u=t.IconComponent,c=void 0===u?GH:u,d=t.id,f=t.input,p=t.inputProps,h=t.labelId,m=t.MenuProps,g=t.multiple,v=void 0!==g&&g,y=t.native,b=void 0!==y&&y,x=t.onClose,w=t.onOpen,k=t.open,C=t.renderValue,S=t.SelectDisplayProps,E=t.variant,M=void 0===E?"standard":E,T=t.labelWidth,D=void 0===T?0:T,_=VC(t,["autoWidth","children","classes","displayEmpty","IconComponent","id","input","inputProps","labelId","MenuProps","multiple","native","onClose","onOpen","open","renderValue","SelectDisplayProps","variant","labelWidth"]),N=b?KH:CV,q=Cj({props:t,muiFormControl:mF(),states:["variant"]}).variant||M,R=f||{standard:EV,outlined:vC.createElement(rB,{labelWidth:D}),filled:MV}[q];return vC.cloneElement(R,HC({inputComponent:N,select:!0,inputProps:HC({children:o,IconComponent:c,variant:q,type:void 0,multiple:v},b?{}:{autoWidth:i,displayEmpty:l,labelId:h,MenuProps:m,onClose:x,onOpen:w,open:k,renderValue:C,SelectDisplayProps:HC({id:d},S)},{},p,{classes:p?ST({baseClasses:a,newClasses:p.classes,Component:e}):a},f?f.props.inputProps:{}),ref:n},_))}));TV.muiName="Select";var DV=fD(SV,{name:"MuiSelect"})(TV);var _V=fD((function(e){return{thumb:{"&$open":{"& $offset":{transform:"scale(1) translateY(-10px)"}}},open:{},offset:HC({zIndex:1},e.typography.body2,{fontSize:e.typography.pxToRem(12),lineHeight:1.2,transition:e.transitions.create(["transform"],{duration:e.transitions.duration.shortest}),top:-34,left:"calc(-50% + -4px)",transformOrigin:"bottom center",transform:"scale(0)",position:"absolute"}),circle:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:"50% 50% 50% 0",backgroundColor:"currentColor",transform:"rotate(-45deg)"},label:{color:e.palette.primary.contrastText,transform:"rotate(45deg)"}}}),{name:"PrivateValueLabel"})((function(e){var t=e.children,n=e.classes,r=e.className,i=e.open,o=e.value,a=e.valueLabelDisplay;return"off"===a?t:vC.cloneElement(t,{className:YT(t.props.className,(i||"on"===a)&&n.open,n.thumb)},vC.createElement("span",{className:YT(n.offset,r)},vC.createElement("span",{className:n.circle},vC.createElement("span",{className:n.label},o))))}));function NV(e,t){return e-t}function qV(e,t,n){return e<t?t:e>n?n:e}function RV(e,t){return e.reduce((function(e,n,r){var i=Math.abs(t-n);return null===e||i<e.distance||i===e.distance?{distance:i,index:r}:e}),null).index}function PV(e,t){if(void 0!==t.current&&e.changedTouches){for(var n=0;n<e.changedTouches.length;n+=1){var r=e.changedTouches[n];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function AV(e,t,n){return 100*(e-t)/(n-t)}function IV(e,t){var n=Math.round(e/t)*t;return Number(n.toFixed(function(e){if(Math.abs(e)<1){var t=e.toExponential().split("e-"),n=t[0].split(".")[1];return(n?n.length:0)+parseInt(t[1],10)}var r=e.toString().split(".")[1];return r?r.length:0}(t)))}function OV(e){var t=e.values,n=e.source,r=e.newValue,i=e.index;if(t[i]===r)return n;var o=TM(t);return o[i]=r,o}function LV(e){var t=e.sliderRef,n=e.activeIndex,r=e.setActive;t.current.contains(document.activeElement)&&Number(document.activeElement.getAttribute("data-index"))===n||t.current.querySelector('[data-index="'.concat(n,'"]')).focus(),r&&r(n)}var zV={horizontal:{offset:function(e){return{left:"".concat(e,"%")}},leap:function(e){return{width:"".concat(e,"%")}}},"horizontal-reverse":{offset:function(e){return{right:"".concat(e,"%")}},leap:function(e){return{width:"".concat(e,"%")}}},vertical:{offset:function(e){return{bottom:"".concat(e,"%")}},leap:function(e){return{height:"".concat(e,"%")}}}},FV=[],jV=function(e){return e},HV=vC.forwardRef((function(e,t){var n=e["aria-label"],r=e["aria-labelledby"],i=e["aria-valuetext"],o=e.classes,a=e.className,s=e.color,l=void 0===s?"primary":s,u=e.component,c=void 0===u?"span":u,d=e.defaultValue,f=e.disabled,p=void 0!==f&&f,h=e.getAriaLabel,m=e.getAriaValueText,g=e.marks,v=void 0===g?FV:g,y=e.max,b=void 0===y?100:y,x=e.min,w=void 0===x?0:x,k=e.name,C=e.onChange,S=e.onChangeCommitted,E=e.onMouseDown,M=e.orientation,T=void 0===M?"horizontal":M,D=e.step,_=void 0===D?1:D,N=e.ThumbComponent,q=void 0===N?"span":N,R=e.track,P=void 0===R?"normal":R,A=e.value,I=e.ValueLabelComponent,O=void 0===I?_V:I,L=e.valueLabelDisplay,z=void 0===L?"off":L,F=e.valueLabelFormat,j=void 0===F?jV:F,H=VC(e,["aria-label","aria-labelledby","aria-valuetext","classes","className","color","component","defaultValue","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","onMouseDown","orientation","step","ThumbComponent","track","value","ValueLabelComponent","valueLabelDisplay","valueLabelFormat"]),B=dD(),V=vC.useRef(null!=A).current,W=vC.useRef(),U=vC.useState(-1),$=U[0],Y=U[1],X=vC.useState(-1),K=X[0],G=X[1],J=vC.useState(d),Z=J[0],Q=J[1],ee=V?A:Z,te=Array.isArray(ee),ne=vC.useRef(),re=te?TM(ee).sort(NV):[ee];re=re.map((function(e){return qV(e,w,b)}));var ie=!0===v&&null!==_?TM(Array(Math.floor((b-w)/_)+1)).map((function(e,t){return{value:w+_*t}})):v;ne.current={source:ee};var oe=iz(),ae=oe.isFocusVisible,se=oe.onBlurVisible,le=oe.ref,ue=vC.useState(-1),ce=ue[0],de=ue[1],fe=vC.useRef(),pe=LL(le,fe),he=LL(t,pe),me=$L((function(e){var t=Number(e.currentTarget.getAttribute("data-index"));ae(e)&&de(t),G(t)})),ge=$L((function(){-1!==ce&&(de(-1),se()),G(-1)})),ve=$L((function(e){var t=Number(e.currentTarget.getAttribute("data-index"));G(t)})),ye=$L((function(){G(-1)})),be=$L((function(e){var t,n=Number(e.currentTarget.getAttribute("data-index")),r=re[n],i=(b-w)/10,o=ie.map((function(e){return e.value})),a=o.indexOf(r);switch(e.key){case"Home":t=w;break;case"End":t=b;break;case"PageUp":_&&(t=r+i);break;case"PageDown":_&&(t=r-i);break;case"ArrowRight":case"ArrowUp":t=_?r+_:o[a+1]||o[o.length-1];break;case"ArrowLeft":case"ArrowDown":t=_?r-_:o[a-1]||o[0];break;default:return}if(e.preventDefault(),_&&(t=IV(t,_)),t=qV(t,w,b),te){var s=t;t=OV({values:re,source:ee,newValue:t,index:n}).sort(NV),LV({sliderRef:fe,activeIndex:t.indexOf(s)})}V||Q(t),de(n),C&&C(e,t),S&&S(e,t)})),xe=vC.useRef(),we=T;"rtl"===B.direction&&"vertical"!==T&&(we+="-reverse");var ke=vC.useCallback((function(e){var t,n,r=e.finger,i=e.move,o=void 0!==i&&i,a=e.values,s=e.source,l=fe.current.getBoundingClientRect(),u=l.width,c=l.height,d=l.bottom,f=l.left;if(t=0===we.indexOf("vertical")?(d-r.y)/c:(r.x-f)/u,-1!==we.indexOf("-reverse")&&(t=1-t),n=function(e,t,n){return(n-t)*e+t}(t,w,b),_)n=IV(n,_);else{var p=ie.map((function(e){return e.value}));n=p[RV(p,n)]}n=qV(n,w,b);var h=0;if(te){var m=n;h=(n=OV({values:a,source:s,newValue:n,index:h=o?xe.current:RV(a,n)}).sort(NV)).indexOf(m),xe.current=h}return{newValue:n,activeIndex:h}}),[b,w,we,te,_,ie]),Ce=$L((function(e){var t=PV(e,W);if(t){var n=ke({finger:t,move:!0,values:re,source:ee}),r=n.newValue,i=n.activeIndex;LV({sliderRef:fe,activeIndex:i,setActive:Y}),V||Q(r),C&&C(e,r)}})),Se=$L((function(e){var t=PV(e,W);if(t){var n=ke({finger:t,values:re,source:ee}).newValue;Y(-1),"touchend"===e.type&&G(-1),S&&S(e,n),W.current=void 0,document.body.removeEventListener("mousemove",Ce),document.body.removeEventListener("mouseup",Se),document.body.removeEventListener("mouseenter",Ee),document.body.removeEventListener("touchmove",Ce),document.body.removeEventListener("touchend",Se)}})),Ee=$L((function(e){0===e.buttons&&Se(e)})),Me=$L((function(e){e.preventDefault();var t=e.changedTouches[0];null!=t&&(W.current=t.identifier);var n=PV(e,W),r=ke({finger:n,values:re,source:ee}),i=r.newValue,o=r.activeIndex;LV({sliderRef:fe,activeIndex:o,setActive:Y}),V||Q(i),C&&C(e,i),document.body.addEventListener("touchmove",Ce),document.body.addEventListener("touchend",Se)}));vC.useEffect((function(){var e=fe.current;return e.addEventListener("touchstart",Me),function(){e.removeEventListener("touchstart",Me),document.body.removeEventListener("mousemove",Ce),document.body.removeEventListener("mouseup",Se),document.body.removeEventListener("mouseenter",Ee),document.body.removeEventListener("touchmove",Ce),document.body.removeEventListener("touchend",Se)}}),[Ee,Se,Ce,Me]);var Te=$L((function(e){E&&E(e),e.preventDefault();var t=PV(e,W),n=ke({finger:t,values:re,source:ee}),r=n.newValue,i=n.activeIndex;LV({sliderRef:fe,activeIndex:i,setActive:Y}),V||Q(r),C&&C(e,r),document.body.addEventListener("mousemove",Ce),document.body.addEventListener("mouseenter",Ee),document.body.addEventListener("mouseup",Se)})),De=AV(te?re[0]:w,w,b),_e=AV(re[re.length-1],w,b)-De,Ne=HC({},zV[we].offset(De),{},zV[we].leap(_e));return vC.createElement(c,HC({ref:he,className:YT(o.root,o["color".concat(pD(l))],a,p&&o.disabled,ie.length>0&&ie.some((function(e){return e.label}))&&o.marked,!1===P&&o.trackFalse,{vertical:o.vertical}[T],{inverted:o.trackInverted}[P]),onMouseDown:Te},H),vC.createElement("span",{className:o.rail}),vC.createElement("span",{className:o.track,style:Ne}),vC.createElement("input",{value:re.join(","),name:k,type:"hidden"}),ie.map((function(e){var t,n=AV(e.value,w,b),r=zV[we].offset(n);if(!1===P)t=-1!==re.indexOf(e.value);else{var i=te?e.value>=re[0]&&e.value<=re[re.length-1]:e.value<=re[0];t=i&&"normal"===P||!i&&"inverted"===P}return vC.createElement(vC.Fragment,{key:e.value},vC.createElement("span",{style:r,className:YT(o.mark,t&&o.markActive)}),vC.createElement("span",{"aria-hidden":!0,style:r,className:YT(o.markLabel,t&&o.markLabelActive)},e.label))})),re.map((function(e,t){var a=AV(e,w,b),s=zV[we].offset(a);return vC.createElement(O,{key:t,valueLabelFormat:j,valueLabelDisplay:z,className:o.valueLabel,value:"function"==typeof j?j(e,t):j,index:t,open:K===t||$===t||"on"===z,disabled:p},vC.createElement(q,{className:YT(o.thumb,o["thumbColor".concat(pD(l))],$===t&&o.active,p&&o.disabled,ce===t&&o.focusVisible),tabIndex:p?null:0,role:"slider",style:s,"data-index":t,"aria-label":h?h(t):n,"aria-labelledby":r,"aria-orientation":T,"aria-valuemax":b,"aria-valuemin":w,"aria-valuenow":e,"aria-valuetext":m?m(e,t):i,onKeyDown:be,onFocus:me,onBlur:ge,onMouseOver:ve,onMouseLeave:ye}))})))}));fD((function(e){return{root:{height:2,width:"100%",boxSizing:"content-box",padding:"11px 0",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",color:e.palette.primary.main,WebkitTapHighlightColor:"transparent","&$disabled":{pointerEvents:"none",cursor:"default",color:e.palette.grey[400]},"&$vertical":{width:2,height:"100%",padding:"0 11px"},"@media (pointer: coarse)":{padding:"20px 0","&$vertical":{padding:"0 20px"}}},colorPrimary:{},colorSecondary:{color:e.palette.secondary.main},marked:{marginBottom:20,"&$vertical":{marginBottom:"auto",marginRight:20}},vertical:{},disabled:{},rail:{display:"block",position:"absolute",width:"100%",height:2,borderRadius:1,backgroundColor:"currentColor",opacity:.38,"$vertical &":{height:"100%",width:2}},track:{display:"block",position:"absolute",height:2,borderRadius:1,backgroundColor:"currentColor","$vertical &":{width:2}},trackFalse:{"& $track":{display:"none"}},trackInverted:{"& $track":{backgroundColor:"light"===e.palette.type?FC(e.palette.primary.main,.62):zC(e.palette.primary.main,.5)},"& $rail":{opacity:1}},thumb:{position:"absolute",width:12,height:12,marginLeft:-6,marginTop:-5,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:e.transitions.create(["box-shadow"],{duration:e.transitions.duration.shortest}),"&::after":{position:"absolute",content:'""',left:-18,top:-18,right:-18,bottom:-18},"&$focusVisible,&:hover":{boxShadow:"0px 0px 0px 8px ".concat(LC(e.palette.primary.main,.16)),"@media (hover: none)":{boxShadow:"none"}},"&$active":{boxShadow:"0px 0px 0px 14px ".concat(LC(e.palette.primary.main,.16))},"&$disabled":{width:8,height:8,marginLeft:-4,marginTop:-3,"&:hover":{boxShadow:"none"}},"$vertical &":{marginLeft:-5,marginBottom:-6},"$vertical &$disabled":{marginLeft:-3,marginBottom:-4}},thumbColorPrimary:{},thumbColorSecondary:{"&$focusVisible,&:hover":{boxShadow:"0px 0px 0px 8px ".concat(LC(e.palette.secondary.main,.16))},"&$active":{boxShadow:"0px 0px 0px 14px ".concat(LC(e.palette.secondary.main,.16))}},active:{},focusVisible:{},valueLabel:{},mark:{position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor"},markActive:{backgroundColor:e.palette.background.paper,opacity:.8},markLabel:HC({},e.typography.body2,{color:e.palette.text.secondary,position:"absolute",top:22,transform:"translateX(-50%)",whiteSpace:"nowrap","$vertical &":{top:"auto",left:22,transform:"translateY(50%)"}}),markLabelActive:{color:e.palette.text.primary}}}),{name:"MuiSlider"})(HV);var BV=vC.forwardRef((function(e,t){var n=e.action,r=e.classes,i=e.className,o=e.message,a=e.role,s=void 0===a?"alert":a,l=VC(e,["action","classes","className","message","role"]);return vC.createElement(mD,HC({component:Kz,variant:"body2",variantMapping:{body1:"div",body2:"div"},role:s,square:!0,elevation:6,className:YT(r.root,i),ref:t},l),vC.createElement("div",{className:r.message},o),n?vC.createElement("div",{className:r.action},n):null)})),VV=fD((function(e){var t="light"===e.palette.type?.8:.98,n=OC(e.palette.background.default,t);return{root:jC({color:e.palette.getContrastText(n),backgroundColor:n,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:e.shape.borderRadius,flexGrow:1},e.breakpoints.up("sm"),{flexGrow:"initial",minWidth:288}),message:{padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}}}),{name:"MuiSnackbarContent"})(BV),WV=vC.forwardRef((function(e,t){var n=e.action,r=e.anchorOrigin,i=(r=void 0===r?{vertical:"bottom",horizontal:"center"}:r).vertical,o=r.horizontal,a=e.autoHideDuration,s=e.children,l=e.classes,u=e.className,c=e.ClickAwayListenerProps,d=e.ContentProps,f=e.disableWindowBlurListener,p=void 0!==f&&f,h=e.message,m=e.onClose,g=e.onEnter,v=e.onEntered,y=e.onEntering,b=e.onExit,x=e.onExited,w=e.onExiting,k=e.onMouseEnter,C=e.onMouseLeave,S=e.open,E=e.resumeHideDuration,M=e.TransitionComponent,T=void 0===M?tH:M,D=e.transitionDuration,_=void 0===D?{enter:RS.enteringScreen,exit:RS.leavingScreen}:D,N=e.TransitionProps,q=VC(e,["action","anchorOrigin","autoHideDuration","children","classes","className","ClickAwayListenerProps","ContentProps","disableWindowBlurListener","message","onClose","onEnter","onEntered","onEntering","onExit","onExited","onExiting","onMouseEnter","onMouseLeave","open","resumeHideDuration","TransitionComponent","transitionDuration","TransitionProps"]),R=vC.useRef(),P=vC.useState(!0),A=P[0],I=P[1],O=vC.useCallback((function(e){var t=null!=e?e:a;m&&null!=t&&(clearTimeout(R.current),R.current=setTimeout((function(){m&&null!=(null!=e?e:a)&&m(null,"timeout")}),t))}),[a,m]);vC.useEffect((function(){return S&&O(),function(){clearTimeout(R.current)}}),[S,O]);var L=function(){clearTimeout(R.current)},z=vC.useCallback((function(){if(null!=a){if(null!=E)return void O(E);O(.5*a)}}),[a,E,O]);return vC.useEffect((function(){if(!p&&S)return window.addEventListener("focus",z),window.addEventListener("blur",L),function(){window.removeEventListener("focus",z),window.removeEventListener("blur",L)}}),[p,z,S]),!S&&A?null:vC.createElement(AF,HC({onClickAway:function(e){m&&m(e,"clickaway")}},c),vC.createElement("div",HC({className:YT(l.root,l["anchorOrigin".concat(pD(i)).concat(pD(o))],u),onMouseEnter:function(e){k&&k(e),L()},onMouseLeave:function(e){C&&C(e),z()},ref:t},q),vC.createElement(T,HC({appear:!0,in:S,onEnter:jF((function(){I(!1)}),g),onEntered:v,onEntering:y,onExit:b,onExited:jF((function(){I(!0)}),x),onExiting:w,timeout:_,direction:"top"===i?"down":"up"},N),s||vC.createElement(VV,HC({message:h,action:n},d)))))}));fD((function(e){var t={top:8},n={bottom:8},r={justifyContent:"flex-end"},i={justifyContent:"flex-start"},o={top:24},a={bottom:24},s={right:24},l={left:24},u={left:"50%",right:"auto",transform:"translateX(-50%)"};return{root:{zIndex:e.zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center"},anchorOriginTopCenter:HC({},t,jC({},e.breakpoints.up("sm"),HC({},o,{},u))),anchorOriginBottomCenter:HC({},n,jC({},e.breakpoints.up("sm"),HC({},a,{},u))),anchorOriginTopRight:HC({},t,{},r,jC({},e.breakpoints.up("sm"),HC({left:"auto"},o,{},s))),anchorOriginBottomRight:HC({},n,{},r,jC({},e.breakpoints.up("sm"),HC({left:"auto"},a,{},s))),anchorOriginTopLeft:HC({},t,{},i,jC({},e.breakpoints.up("sm"),HC({right:"auto"},o,{},l))),anchorOriginBottomLeft:HC({},n,{},i,jC({},e.breakpoints.up("sm"),HC({right:"auto"},a,{},l)))}}),{flip:!1,name:"MuiSnackbar"})(WV);var UV=vC.forwardRef((function(e,t){var n=e.active,r=void 0!==n&&n,i=e.alternativeLabel,o=e.children,a=e.classes,s=e.className,l=e.completed,u=void 0!==l&&l,c=e.connector,d=e.disabled,f=void 0!==d&&d,p=e.index,h=e.last,m=e.orientation,g=VC(e,["active","alternativeLabel","children","classes","className","completed","connector","disabled","index","last","orientation"]);return vC.createElement("div",HC({className:YT(a.root,a[m],s,i&&a.alternativeLabel,u&&a.completed),ref:t},g),c&&i&&0!==p&&vC.cloneElement(c,{orientation:m,alternativeLabel:i,index:p,active:r,completed:u,disabled:f}),vC.Children.map(o,(function(e){return vC.isValidElement(e)?vC.cloneElement(e,HC({active:r,alternativeLabel:i,completed:u,disabled:f,last:h,icon:p+1,orientation:m},e.props)):null})))}));fD({root:{},horizontal:{paddingLeft:8,paddingRight:8},vertical:{},alternativeLabel:{flex:1,position:"relative"},completed:{}},{name:"MuiStep"})(UV);var $V=Zz(vC.createElement("path",{d:"M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24zm-2 17l-5-5 1.4-1.4 3.6 3.6 7.6-7.6L19 8l-9 9z"})),YV=Zz(vC.createElement("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})),XV=vC.createElement("circle",{cx:"12",cy:"12",r:"12"}),KV=vC.forwardRef((function(e,t){var n=e.completed,r=void 0!==n&&n,i=e.icon,o=e.active,a=void 0!==o&&o,s=e.error,l=void 0!==s&&s,u=e.classes;return"number"==typeof i||"string"==typeof i?l?vC.createElement(YV,{className:YT(u.root,u.error),ref:t}):r?vC.createElement($V,{className:YT(u.root,u.completed),ref:t}):vC.createElement(Jz,{className:YT(u.root,a&&u.active),ref:t},XV,vC.createElement("text",{className:u.text,x:"12",y:"16",textAnchor:"middle"},i)):i})),GV=fD((function(e){return{root:{display:"block",color:e.palette.text.disabled,"&$active":{color:e.palette.primary.main},"&$completed":{color:e.palette.primary.main},"&$error":{color:e.palette.error.main}},text:{fill:e.palette.primary.contrastText,fontSize:e.typography.caption.fontSize,fontFamily:e.typography.fontFamily},active:{},completed:{},error:{}}}),{name:"MuiStepIcon"})(KV),JV=vC.forwardRef((function(e,t){var n=e.active,r=void 0!==n&&n,i=e.alternativeLabel,o=void 0!==i&&i,a=e.children,s=e.classes,l=e.className,u=e.completed,c=void 0!==u&&u,d=e.disabled,f=void 0!==d&&d,p=e.error,h=void 0!==p&&p,m=e.icon;e.last;var g=e.optional,v=e.orientation,y=void 0===v?"horizontal":v,b=e.StepIconComponent,x=e.StepIconProps,w=VC(e,["active","alternativeLabel","children","classes","className","completed","disabled","error","icon","last","optional","orientation","StepIconComponent","StepIconProps"]),k=b;return m&&!k&&(k=GV),vC.createElement("span",HC({className:YT(s.root,s[y],l,f&&s.disabled,o&&s.alternativeLabel,h&&s.error),ref:t},w),m||k?vC.createElement("span",{className:YT(s.iconContainer,o&&s.alternativeLabel)},vC.createElement(k,HC({completed:c,active:r,error:h,icon:m},x))):null,vC.createElement("span",{className:s.labelContainer},vC.createElement(Kz,{variant:"body2",component:"span",className:YT(s.label,o&&s.alternativeLabel,c&&s.completed,r&&s.active,h&&s.error),display:"block"},a),g))}));JV.muiName="StepLabel";var ZV=fD((function(e){return{root:{display:"flex",alignItems:"center","&$alternativeLabel":{flexDirection:"column"},"&$disabled":{cursor:"default"}},horizontal:{},vertical:{},label:{color:e.palette.text.secondary,"&$active":{color:e.palette.text.primary,fontWeight:500},"&$completed":{color:e.palette.text.primary,fontWeight:500},"&$alternativeLabel":{textAlign:"center",marginTop:16},"&$error":{color:e.palette.error.main}},active:{},completed:{},error:{},disabled:{},iconContainer:{flexShrink:0,display:"flex",paddingRight:8,"&$alternativeLabel":{paddingRight:0}},alternativeLabel:{},labelContainer:{width:"100%"}}}),{name:"MuiStepLabel"})(JV),QV=vC.forwardRef((function(e,t){var n=e.active,r=e.alternativeLabel,i=e.children,o=e.classes,a=e.className,s=e.completed,l=e.disabled,u=e.icon;e.last;var c=e.optional,d=e.orientation,f=VC(e,["active","alternativeLabel","children","classes","className","completed","disabled","icon","last","optional","orientation"]),p={active:n,alternativeLabel:r,completed:s,disabled:l,icon:u,optional:c,orientation:d},h=Ij(i,["StepLabel"])?vC.cloneElement(i,p):vC.createElement(ZV,p,i);return vC.createElement(dz,HC({disabled:l,TouchRippleProps:{className:o.touchRipple},className:YT(o.root,o[d],a),ref:t},f),h)}));fD({root:{width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},horizontal:{},vertical:{justifyContent:"flex-start",padding:"8px",margin:"-8px"},touchRipple:{color:"rgba(0, 0, 0, 0.3)"}},{name:"MuiStepButton"})(QV);var eW=vC.forwardRef((function(e,t){var n=e.active,r=e.alternativeLabel,i=void 0!==r&&r,o=e.classes,a=e.className,s=e.completed,l=e.disabled;e.index;var u=e.orientation,c=void 0===u?"horizontal":u,d=VC(e,["active","alternativeLabel","classes","className","completed","disabled","index","orientation"]);return vC.createElement("div",HC({className:YT(o.root,o[c],a,i&&o.alternativeLabel,n&&o.active,s&&o.completed,l&&o.disabled),ref:t},d),vC.createElement("span",{className:YT(o.line,"vertical"===c?o.lineVertical:o.lineHorizontal)}))})),tW=fD((function(e){return{root:{flex:"1 1 auto"},horizontal:{},vertical:{marginLeft:12,padding:"0 0 8px"},alternativeLabel:{position:"absolute",top:12,left:"calc(-50% + 20px)",right:"calc(50% + 20px)"},active:{},completed:{},disabled:{},line:{display:"block",borderColor:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[600]},lineHorizontal:{borderTopStyle:"solid",borderTopWidth:1},lineVertical:{borderLeftStyle:"solid",borderLeftWidth:1,minHeight:24}}}),{name:"MuiStepConnector"})(eW),nW=vC.forwardRef((function(e,t){var n=e.active;e.alternativeLabel;var r=e.children,i=e.classes,o=e.className;e.completed;var a=e.last;e.optional,e.orientation;var s=e.TransitionComponent,l=void 0===s?OF:s,u=e.transitionDuration,c=void 0===u?"auto":u,d=e.TransitionProps,f=VC(e,["active","alternativeLabel","children","classes","className","completed","last","optional","orientation","TransitionComponent","transitionDuration","TransitionProps"]),p=c;return"auto"!==c||l.muiSupportAuto||(p=void 0),vC.createElement("div",HC({className:YT(i.root,o,a&&i.last),ref:t},f),vC.createElement(l,HC({in:n,className:i.transition,timeout:p,unmountOnExit:!0},d),r))}));fD((function(e){return{root:{marginTop:8,marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:"1px solid ".concat("light"===e.palette.type?e.palette.grey[400]:e.palette.grey[600])},last:{borderLeft:"none"},transition:{}}}),{name:"MuiStepContent"})(nW);var rW=vC.createElement(tW,null),iW=vC.forwardRef((function(e,t){var n=e.activeStep,r=void 0===n?0:n,i=e.alternativeLabel,o=void 0!==i&&i,a=e.children,s=e.classes,l=e.className,u=e.connector,c=void 0===u?rW:u,d=e.nonLinear,f=void 0!==d&&d,p=e.orientation,h=void 0===p?"horizontal":p,m=VC(e,["activeStep","alternativeLabel","children","classes","className","connector","nonLinear","orientation"]),g=vC.isValidElement(c)?vC.cloneElement(c,{orientation:h}):null,v=vC.Children.toArray(a),y=v.map((function(e,t){var n={alternativeLabel:o,connector:c,last:t+1===v.length,orientation:h},i={index:t,active:!1,completed:!1,disabled:!1};return r===t?i.active=!0:!f&&r>t?i.completed=!0:!f&&r<t&&(i.disabled=!0),[!o&&g&&0!==t&&vC.cloneElement(g,HC({key:t},i)),vC.cloneElement(e,HC({},n,{},i,{},e.props))]}));return vC.createElement(mD,HC({square:!0,elevation:0,className:YT(s.root,s[h],l,o&&s.alternativeLabel),ref:t},m),y)}));fD({root:{display:"flex",padding:24},horizontal:{flexDirection:"row",alignItems:"center"},vertical:{flexDirection:"column"},alternativeLabel:{alignItems:"flex-start"}},{name:"MuiStepper"})(iW);var oW=vC.forwardRef((function(e,t){var n=e.anchor,r=e.classes,i=e.className,o=e.width,a=VC(e,["anchor","classes","className","width"]);return vC.createElement("div",HC({className:YT(r.root,r["anchor".concat(pD(n))],i),ref:t,style:jC({},fj(n)?"width":"height",o)},a))})),aW=fD((function(e){return{root:{position:"fixed",top:0,left:0,bottom:0,zIndex:e.zIndex.drawer-1},anchorLeft:{right:"auto"},anchorRight:{left:"auto",right:0},anchorTop:{bottom:"auto",right:0},anchorBottom:{top:"auto",bottom:0,right:0}}}),{name:"PrivateSwipeArea"})(oW),sW=null;function lW(e,t){return"right"===e?document.body.offsetWidth-t[0].pageX:t[0].pageX}function uW(e,t){return"bottom"===e?window.innerHeight-t[0].clientY:t[0].clientY}function cW(e,t){return e?t.clientWidth:t.clientHeight}function dW(e,t,n,r){return Math.min(Math.max(n?t-e:r+t-e,0),r)}var fW="undefined"!=typeof navigator&&/iPad|iPhone|iPod/.test(navigator.userAgent),pW={enter:RS.enteringScreen,exit:RS.leavingScreen},hW="undefined"!=typeof window?vC.useLayoutEffect:vC.useEffect;vC.forwardRef((function(e,t){var n=e.anchor,r=void 0===n?"left":n,i=e.disableBackdropTransition,o=void 0!==i&&i,a=e.disableDiscovery,s=void 0!==a&&a,l=e.disableSwipeToOpen,u=void 0===l?fW:l,c=e.hideBackdrop,d=e.hysteresis,f=void 0===d?.52:d,p=e.minFlingVelocity,h=void 0===p?450:p,m=e.ModalProps,g=(m=void 0===m?{}:m).BackdropProps,v=VC(m,["BackdropProps"]),y=e.onClose,b=e.onOpen,x=e.open,w=e.PaperProps,k=void 0===w?{}:w,C=e.SwipeAreaProps,S=e.swipeAreaWidth,E=void 0===S?20:S,M=e.transitionDuration,T=void 0===M?pW:M,D=e.variant,_=void 0===D?"temporary":D,N=VC(e,["anchor","disableBackdropTransition","disableDiscovery","disableSwipeToOpen","hideBackdrop","hysteresis","minFlingVelocity","ModalProps","onClose","onOpen","open","PaperProps","SwipeAreaProps","swipeAreaWidth","transitionDuration","variant"]),q=dD(),R=vC.useState(!1),P=R[0],A=R[1],I=vC.useRef({isSwiping:null}),O=vC.useRef(),L=vC.useRef(),z=vC.useRef(),F=vC.useRef(!1),j=vC.useRef();hW((function(){j.current=null}),[x]);var H=vC.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.mode,i=void 0===n?null:n,a=t.changeTransition,s=void 0===a||a,l=pj(q,r),u=-1!==["right","bottom"].indexOf(l)?1:-1,d=fj(r),f=d?"translate(".concat(u*e,"px, 0)"):"translate(0, ".concat(u*e,"px)"),p=z.current.style;p.webkitTransform=f,p.transform=f;var h="";if(i&&(h=q.transitions.create("all",IL({timeout:T},{mode:i}))),s&&(p.webkitTransition=h,p.transition=h),!o&&!c){var m=L.current.style;m.opacity=1-e/cW(d,z.current),s&&(m.webkitTransition=h,m.transition=h)}}),[r,o,c,q,T]),B=$L((function(e){if(F.current)if(sW=null,F.current=!1,A(!1),I.current.isSwiping){I.current.isSwiping=null;var t,n=pj(q,r),i=fj(r);t=i?lW(n,e.changedTouches):uW(n,e.changedTouches);var o=i?I.current.startX:I.current.startY,a=cW(i,z.current),s=dW(t,o,x,a),l=s/a;Math.abs(I.current.velocity)>h&&(j.current=1e3*Math.abs((a-s)/I.current.velocity)),x?I.current.velocity>h||l>f?y():H(0,{mode:"exit"}):I.current.velocity<-h||1-l>f?b():H(cW(i,z.current),{mode:"enter"})}else I.current.isSwiping=null})),V=$L((function(e){if(z.current&&F.current&&(null==sW||sW===I.current)){var t=pj(q,r),n=fj(r),i=lW(t,e.touches),o=uW(t,e.touches);if(x&&z.current.contains(e.target)&&null==sW){var a=function(e){var t=e.domTreeShapes,n=e.start,r=e.current,i=e.anchor,o={x:"scrollLeft",y:"scrollTop"},a={x:"scrollWidth",y:"scrollHeight"},s={x:"clientWidth",y:"clientHeight"};return t.some((function(e){var t=r>=n;"top"!==i&&"left"!==i||(t=!t);var l="left"===i||"right"===i?"x":"y",u=e[o[l]],c=u>0,d=u+e[s[l]]<e[a[l]];return t&&d||!t&&c?e:null}))}({domTreeShapes:function(e,t){for(var n=[];e&&e!==t;){var r=window.getComputedStyle(e);"absolute"===r.getPropertyValue("position")||"hidden"===r.getPropertyValue("overflow-x")?n=[]:(e.clientWidth>0&&e.scrollWidth>e.clientWidth||e.clientHeight>0&&e.scrollHeight>e.clientHeight)&&n.push(e),e=e.parentElement}return n}(e.target,z.current),start:n?I.current.startX:I.current.startY,current:n?i:o,anchor:r});if(a)return void(sW=a);sW=I.current}if(null==I.current.isSwiping){var l=Math.abs(i-I.current.startX),u=Math.abs(o-I.current.startY);l>u&&e.cancelable&&e.preventDefault();var c=n?l>u&&l>3:u>l&&u>3;if(!0===c||(n?u>3:l>3)){if(I.current.isSwiping=c,!c)return void B(e);I.current.startX=i,I.current.startY=o,s||x||(n?I.current.startX-=E:I.current.startY-=E)}}if(I.current.isSwiping){var d=cW(n,z.current),f=n?I.current.startX:I.current.startY;x&&!I.current.paperHit&&(f=Math.min(f,d));var p=dW(n?i:o,f,x,d);if(x)if(I.current.paperHit)0===p&&(I.current.startX=i,I.current.startY=o);else{if(!(n?i<d:o<d))return;I.current.paperHit=!0,I.current.startX=i,I.current.startY=o}null===I.current.lastTranslate&&(I.current.lastTranslate=p,I.current.lastTime=performance.now()+1);var h=(p-I.current.lastTranslate)/(performance.now()-I.current.lastTime)*1e3;I.current.velocity=.4*I.current.velocity+.6*h,I.current.lastTranslate=p,I.current.lastTime=performance.now(),e.cancelable&&e.preventDefault(),H(p)}}})),W=$L((function(e){if(!e.defaultPrevented&&!e.muiHandled&&(!x||L.current.contains(e.target)||z.current.contains(e.target))){var t=pj(q,r),n=fj(r),i=lW(t,e.touches),o=uW(t,e.touches);if(!x){if(u||e.target!==O.current)return;if(n){if(i>E)return}else if(o>E)return}e.muiHandled=!0,sW=null,I.current.startX=i,I.current.startY=o,A(!0),!x&&z.current&&H(cW(n,z.current)+(s?20:-E),{changeTransition:!1}),I.current.velocity=0,I.current.lastTime=null,I.current.lastTranslate=null,I.current.paperHit=!1,F.current=!0}}));vC.useEffect((function(){if("temporary"===_)return document.body.addEventListener("touchstart",W),document.body.addEventListener("touchmove",V,{passive:!1}),document.body.addEventListener("touchend",B),function(){document.body.removeEventListener("touchstart",W),document.body.removeEventListener("touchmove",V,{passive:!1}),document.body.removeEventListener("touchend",B)}}),[_,W,V,B]),vC.useEffect((function(){return function(){sW===I.current&&(sW=null)}}),[]),vC.useEffect((function(){x||A(!1)}),[x]);var U=vC.useCallback((function(e){L.current=lL.findDOMNode(e)}),[]),$=vC.useCallback((function(e){z.current=lL.findDOMNode(e)}),[]);return vC.createElement(vC.Fragment,null,vC.createElement(gj,HC({open:!("temporary"!==_||!P)||x,variant:_,ModalProps:HC({BackdropProps:HC({},g,{ref:U})},v),PaperProps:HC({},k,{style:HC({pointerEvents:"temporary"!==_||x?"":"none"},k.style),ref:$}),anchor:r,transitionDuration:j.current||T,onClose:y,ref:t},N)),!u&&"temporary"===_&&vC.createElement(XL,null,vC.createElement(aW,HC({anchor:r,ref:O,width:E},C))))}));var mW=vC.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.color,o=void 0===i?"secondary":i,a=e.edge,s=void 0!==a&&a,l=e.size,u=void 0===l?"medium":l,c=VC(e,["classes","className","color","edge","size"]),d=vC.createElement("span",{className:n.thumb});return vC.createElement("span",{className:YT(n.root,r,{start:n.edgeStart,end:n.edgeEnd}[s],{small:n["size".concat(pD(u))]}[u])},vC.createElement(bF,HC({type:"checkbox",icon:d,checkedIcon:d,classes:{root:YT(n.switchBase,n["color".concat(pD(o))]),input:n.input,checked:n.checked,disabled:n.disabled},ref:t},c)),vC.createElement("span",{className:n.track}))}));fD((function(e){return{root:{display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle"},edgeStart:{marginLeft:-8},edgeEnd:{marginRight:-8},switchBase:{position:"absolute",top:0,left:0,zIndex:1,color:"light"===e.palette.type?e.palette.grey[50]:e.palette.grey[400],transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),"&$checked":{transform:"translateX(50%)"},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{opacity:.5},"&$disabled + $track":{opacity:"light"===e.palette.type?.12:.1}},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:LC(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{backgroundColor:e.palette.primary.main},"&$disabled + $track":{backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:LC(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{backgroundColor:e.palette.secondary.main},"&$disabled + $track":{backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white}},sizeSmall:{width:40,height:24,padding:7,"& $thumb":{width:16,height:16},"& $switchBase":{padding:4}},checked:{},disabled:{},input:{left:"-100%",width:"300%"},thumb:{boxShadow:e.shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"},track:{height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white,opacity:"light"===e.palette.type?.38:.3}}}),{name:"MuiSwitch"})(mW);var gW=vC.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.disabled,o=void 0!==i&&i,a=e.disableFocusRipple,s=void 0!==a&&a,l=e.fullWidth,u=e.icon,c=e.indicator,d=e.label,f=e.onChange,p=e.onClick,h=e.selected,m=e.textColor,g=void 0===m?"inherit":m,v=e.value,y=e.wrapped,b=void 0!==y&&y,x=VC(e,["classes","className","disabled","disableFocusRipple","fullWidth","icon","indicator","label","onChange","onClick","selected","textColor","value","wrapped"]);return vC.createElement(dz,HC({focusRipple:!s,className:YT(n.root,n["textColor".concat(pD(g))],r,o&&n.disabled,h&&n.selected,d&&u&&n.labelIcon,l&&n.fullWidth,b&&n.wrapped),ref:t,role:"tab","aria-selected":h,disabled:o,onClick:function(e){f&&f(e,v),p&&p(e)}},x),vC.createElement("span",{className:n.wrapper},u,d),c)}));fD((function(e){var t;return{root:HC({},e.typography.button,(t={maxWidth:264,minWidth:72,position:"relative",boxSizing:"border-box",minHeight:48,flexShrink:0,padding:"6px 12px"},jC(t,e.breakpoints.up("sm"),{padding:"6px 24px"}),jC(t,"overflow","hidden"),jC(t,"whiteSpace","normal"),jC(t,"textAlign","center"),jC(t,e.breakpoints.up("sm"),{fontSize:e.typography.pxToRem(13),minWidth:160}),t)),labelIcon:{minHeight:72,paddingTop:9,"& $wrapper > *:first-child":{marginBottom:6}},textColorInherit:{color:"inherit",opacity:.7,"&$selected":{opacity:1},"&$disabled":{opacity:.5}},textColorPrimary:{color:e.palette.text.secondary,"&$selected":{color:e.palette.primary.main},"&$disabled":{color:e.palette.text.disabled}},textColorSecondary:{color:e.palette.text.secondary,"&$selected":{color:e.palette.secondary.main},"&$disabled":{color:e.palette.text.disabled}},selected:{},disabled:{},fullWidth:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},wrapped:{fontSize:e.typography.pxToRem(12),lineHeight:1.5},wrapper:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",flexDirection:"column"}}}),{name:"MuiTab"})(gW);var vW=vC.createContext(),yW=vC.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.component,o=void 0===i?"table":i,a=e.padding,s=void 0===a?"default":a,l=e.size,u=void 0===l?"medium":l,c=e.stickyHeader,d=void 0!==c&&c,f=VC(e,["classes","className","component","padding","size","stickyHeader"]),p=vC.useMemo((function(){return{padding:s,size:u,stickyHeader:d}}),[s,u,d]);return vC.createElement(vW.Provider,{value:p},vC.createElement(o,HC({ref:t,className:YT(n.root,r,d&&n.stickyHeader)},f)))}));fD((function(e){return{root:{display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":HC({},e.typography.body2,{padding:e.spacing(2),color:e.palette.text.secondary,textAlign:"left",captionSide:"bottom"})},stickyHeader:{borderCollapse:"separate"}}}),{name:"MuiTable"})(yW);var bW=vC.createContext(),xW={variant:"body"},wW=vC.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.component,o=void 0===i?"tbody":i,a=VC(e,["classes","className","component"]);return vC.createElement(bW.Provider,{value:xW},vC.createElement(o,HC({className:YT(n.root,r),ref:t},a)))}));fD({root:{display:"table-row-group"}},{name:"MuiTableBody"})(wW);var kW=vC.forwardRef((function(e,t){var n,r=e.align,i=void 0===r?"inherit":r,o=e.classes,a=e.className,s=e.component,l=e.padding,u=e.scope,c=e.size,d=e.sortDirection,f=e.variant,p=VC(e,["align","classes","className","component","padding","scope","size","sortDirection","variant"]),h=vC.useContext(vW),m=vC.useContext(bW);n=s||(m&&"head"===m.variant?"th":"td");var g=u;!g&&m&&"head"===m.variant&&(g="col");var v=l||(h&&h.padding?h.padding:"default"),y=c||(h&&h.size?h.size:"medium"),b=f||m&&m.variant,x=null;return d&&(x="asc"===d?"ascending":"descending"),vC.createElement(n,HC({ref:t,className:YT(o.root,o[b],a,"inherit"!==i&&o["align".concat(pD(i))],"default"!==v&&o["padding".concat(pD(v))],"medium"!==y&&o["size".concat(pD(y))],{head:h&&h.stickyHeader&&o.stickyHeader}[b]),"aria-sort":x,scope:g},p))})),CW=fD((function(e){return{root:HC({},e.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:"1px solid\n ".concat("light"===e.palette.type?FC(LC(e.palette.divider,1),.88):zC(LC(e.palette.divider,1),.68)),textAlign:"left",padding:16}),head:{color:e.palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium},body:{color:e.palette.text.primary},footer:{color:e.palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)},sizeSmall:{padding:"6px 24px 6px 16px","&:last-child":{paddingRight:16},"&$paddingCheckbox":{width:24,padding:"0px 12px 0 16px","&:last-child":{paddingLeft:12,paddingRight:16},"& > *":{padding:0}}},paddingCheckbox:{width:48,padding:"0 0 0 4px","&:last-child":{paddingLeft:0,paddingRight:4}},paddingNone:{padding:0,"&:last-child":{padding:0}},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right",flexDirection:"row-reverse"},alignJustify:{textAlign:"justify"},stickyHeader:{position:"sticky",top:0,left:0,zIndex:2,backgroundColor:e.palette.background.default}}}),{name:"MuiTableCell"})(kW),SW={variant:"footer"},EW=vC.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.component,o=void 0===i?"tfoot":i,a=VC(e,["classes","className","component"]);return vC.createElement(bW.Provider,{value:SW},vC.createElement(o,HC({className:YT(n.root,r),ref:t},a)))}));fD({root:{display:"table-footer-group"}},{name:"MuiTableFooter"})(EW);var MW={variant:"head"},TW=vC.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.component,o=void 0===i?"thead":i,a=VC(e,["classes","className","component"]);return vC.createElement(bW.Provider,{value:MW},vC.createElement(o,HC({className:YT(n.root,r),ref:t},a)))}));fD({root:{display:"table-header-group"}},{name:"MuiTableHead"})(TW);var DW=vC.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.component,o=void 0===i?"div":i,a=e.disableGutters,s=void 0!==a&&a,l=e.variant,u=void 0===l?"regular":l,c=VC(e,["classes","className","component","disableGutters","variant"]);return vC.createElement(o,HC({className:YT(n.root,n[u],r,!s&&n.gutters),ref:t},c))})),_W=fD((function(e){return{root:{position:"relative",display:"flex",alignItems:"center"},gutters:jC({paddingLeft:e.spacing(2),paddingRight:e.spacing(2)},e.breakpoints.up("sm"),{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}),regular:e.mixins.toolbar,dense:{minHeight:48}}}),{name:"MuiToolbar"})(DW),NW=Zz(vC.createElement("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})),qW=Zz(vC.createElement("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"})),RW=vC.createElement(qW,null),PW=vC.createElement(NW,null),AW=vC.createElement(NW,null),IW=vC.createElement(qW,null),OW=vC.forwardRef((function(e,t){var n=e.backIconButtonProps,r=e.count,i=e.nextIconButtonProps,o=e.onChangePage,a=e.page,s=e.rowsPerPage,l=VC(e,["backIconButtonProps","count","nextIconButtonProps","onChangePage","page","rowsPerPage"]),u=dD();return vC.createElement("div",HC({ref:t},l),vC.createElement(vF,HC({onClick:function(e){o(e,a-1)},disabled:0===a,color:"inherit"},n),"rtl"===u.direction?RW:PW),vC.createElement(vF,HC({onClick:function(e){o(e,a+1)},disabled:a>=Math.ceil(r/s)-1,color:"inherit"},i),"rtl"===u.direction?AW:IW))})),LW=function(e){var t=e.from,n=e.to,r=e.count;return"".concat(t,"-").concat(-1===n?r:n," of ").concat(r)},zW=[10,25,50,100],FW=vC.forwardRef((function(e,t){var n,r=e.ActionsComponent,i=void 0===r?OW:r,o=e.backIconButtonProps,a=e.classes,s=e.className,l=e.colSpan,u=e.component,c=void 0===u?CW:u,d=e.count,f=e.labelDisplayedRows,p=void 0===f?LW:f,h=e.labelRowsPerPage,m=void 0===h?"Rows per page:":h,g=e.nextIconButtonProps,v=e.onChangePage,y=e.onChangeRowsPerPage,b=e.page,x=e.rowsPerPage,w=e.rowsPerPageOptions,k=void 0===w?zW:w,C=e.SelectProps,S=void 0===C?{}:C,E=VC(e,["ActionsComponent","backIconButtonProps","classes","className","colSpan","component","count","labelDisplayedRows","labelRowsPerPage","nextIconButtonProps","onChangePage","onChangeRowsPerPage","page","rowsPerPage","rowsPerPageOptions","SelectProps"]);c!==CW&&"td"!==c||(n=l||1e3);var M=S.native?"option":YH;return vC.createElement(c,HC({className:YT(a.root,s),colSpan:n,ref:t},E),vC.createElement(_W,{className:a.toolbar},vC.createElement("div",{className:a.spacer}),k.length>1&&vC.createElement(Kz,{color:"inherit",variant:"body2",className:a.caption},m),k.length>1&&vC.createElement(DV,HC({classes:{select:a.select,icon:a.selectIcon},input:vC.createElement(Rj,{className:YT(a.input,a.selectRoot)}),value:x,onChange:y},S),k.map((function(e){return vC.createElement(M,{className:a.menuItem,key:e,value:e.value?e.value:e},e.label?e.label:e)}))),vC.createElement(Kz,{color:"inherit",variant:"body2",className:a.caption},p({from:0===d?0:b*x+1,to:Math.min(d,(b+1)*x),count:d,page:b})),vC.createElement(i,{className:a.actions,backIconButtonProps:o,count:d,nextIconButtonProps:g,onChangePage:v,page:b,rowsPerPage:x})))}));fD((function(e){return{root:{color:e.palette.text.primary,fontSize:e.typography.pxToRem(14),"&:last-child":{padding:0}},toolbar:{minHeight:52,paddingRight:2},spacer:{flex:"1 1 100%"},caption:{flexShrink:0},selectRoot:{marginRight:32,marginLeft:8},select:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"},selectIcon:{top:1},input:{color:"inherit",fontSize:"inherit",flexShrink:0},menuItem:{},actions:{flexShrink:0,marginLeft:20}}}),{name:"MuiTablePagination"})(FW);var jW=vC.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.component,o=void 0===i?"tr":i,a=e.hover,s=void 0!==a&&a,l=e.selected,u=void 0!==l&&l,c=VC(e,["classes","className","component","hover","selected"]),d=vC.useContext(bW);return vC.createElement(o,HC({ref:t,className:YT(n.root,r,d&&{head:n.head,footer:n.footer}[d.variant],s&&n.hover,u&&n.selected)},c))}));fD((function(e){return{root:{color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,"&$selected":{backgroundColor:"light"===e.palette.type?"rgba(0, 0, 0, 0.04)":"rgba(255, 255, 255, 0.08)"},"&$hover:hover":{backgroundColor:"light"===e.palette.type?"rgba(0, 0, 0, 0.07)":"rgba(255, 255, 255, 0.14)"}},selected:{},hover:{},head:{},footer:{}}}),{name:"MuiTableRow"})(jW);var HW=Zz(vC.createElement("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"})),BW=vC.forwardRef((function(e,t){var n=e.active,r=void 0!==n&&n,i=e.children,o=e.classes,a=e.className,s=e.direction,l=void 0===s?"desc":s,u=e.hideSortIcon,c=void 0!==u&&u,d=e.IconComponent,f=void 0===d?HW:d,p=VC(e,["active","children","classes","className","direction","hideSortIcon","IconComponent"]);return vC.createElement(dz,HC({className:YT(o.root,a,r&&o.active),component:"span",disableRipple:!0,ref:t},p),i,c&&!r?null:vC.createElement(f,{className:YT(o.icon,o["iconDirection".concat(pD(l))])}))}));fD((function(e){return{root:{cursor:"pointer",display:"inline-flex",justifyContent:"flex-start",flexDirection:"inherit",alignItems:"center","&:focus":{color:e.palette.text.secondary},"&:hover":{color:e.palette.text.secondary,"& $icon":{opacity:1}},"&$active":{color:e.palette.text.primary,"&& $icon":{opacity:1,color:e.palette.text.secondary}}},active:{},icon:{marginRight:4,marginLeft:4,opacity:0,transition:e.transitions.create(["opacity","transform"],{duration:e.transitions.duration.shorter}),userSelect:"none"},iconDirectionDesc:{transform:"rotate(0deg)"},iconDirectionAsc:{transform:"rotate(180deg)"}}}),{name:"MuiTableSortLabel"})(BW);var VW,WW=!("undefined"==typeof window||!window.document||!window.document.createElement);function UW(){if(VW)return VW;if(!WW||!window.document.body)return"indeterminate";var e=window.document.createElement("div");return e.appendChild(document.createTextNode("ABCD")),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),VW="reverse",e.scrollLeft>0?VW="default":(e.scrollLeft=1,0===e.scrollLeft&&(VW="negative")),document.body.removeChild(e),VW}function $W(e,t){var n=e.scrollLeft;if("rtl"!==t)return n;var r=UW();if("indeterminate"===r)return Number.NaN;switch(r){case"negative":return e.scrollWidth-e.clientWidth+n;case"reverse":return e.scrollWidth-e.clientWidth-n}return n}function YW(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}var XW={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function KW(e){var t=e.onChange,n=VC(e,["onChange"]),r=vC.useRef(),i=vC.useRef(null),o=function(){r.current=i.current.offsetHeight-i.current.clientHeight};return vC.useEffect((function(){var e=sj((function(){var e=r.current;o(),e!==r.current&&t(r.current)}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}),[t]),vC.useEffect((function(){o(),t(r.current)}),[t]),vC.createElement("div",HC({style:XW,ref:i},n))}var GW=vC.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.color,o=e.orientation,a=VC(e,["classes","className","color","orientation"]);return vC.createElement("span",HC({className:YT(n.root,n["color".concat(pD(i))],r,{vertical:n.vertical}[o]),ref:t},a))})),JW=fD((function(e){return{root:{position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},colorPrimary:{backgroundColor:e.palette.primary.main},colorSecondary:{backgroundColor:e.palette.secondary.main},vertical:{height:"100%",width:2,right:0}}}),{name:"PrivateTabIndicator"})(GW),ZW=vC.createElement(NW,{fontSize:"small"}),QW=vC.createElement(qW,{fontSize:"small"}),eU=vC.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.direction,o=e.orientation,a=e.visible,s=VC(e,["classes","className","direction","orientation","visible"]),l=YT(n.root,r,{vertical:n.vertical}[o]);return a?vC.createElement(dz,HC({component:"div",className:l,ref:t,role:null,tabIndex:null},s),"left"===i?ZW:QW):vC.createElement("div",{className:l})})),tU=fD({root:{width:40,flexShrink:0},vertical:{width:"100%",height:40,"& svg":{transform:"rotate(90deg)"}}},{name:"PrivateTabScrollButton"})(eU),nU=vC.forwardRef((function(e,t){var n=e.action,r=e.centered,i=void 0!==r&&r,o=e.children,a=e.classes,s=e.className,l=e.component,u=void 0===l?"div":l,c=e.indicatorColor,d=void 0===c?"secondary":c,f=e.onChange,p=e.orientation,h=void 0===p?"horizontal":p,m=e.ScrollButtonComponent,g=void 0===m?tU:m,v=e.scrollButtons,y=void 0===v?"auto":v,b=e.TabIndicatorProps,x=void 0===b?{}:b,w=e.textColor,k=void 0===w?"inherit":w,C=e.value,S=e.variant,E=void 0===S?"standard":S,M=VC(e,["action","centered","children","classes","className","component","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","TabIndicatorProps","textColor","value","variant"]),T=dD(),D="scrollable"===E,_="rtl"===T.direction,N="vertical"===h,q=N?"scrollTop":"scrollLeft",R=N?"top":"left",P=N?"bottom":"right",A=N?"clientHeight":"clientWidth",I=N?"height":"width",O=vC.useState(!1),L=O[0],z=O[1],F=vC.useState({}),j=F[0],H=F[1],B=vC.useState({start:!1,end:!1}),V=B[0],W=B[1],U=vC.useState({overflow:"hidden",marginBottom:null}),$=U[0],Y=U[1],X=new Map,K=vC.useRef(null),G=vC.useRef(null),J=function(){var e,t,n=K.current;if(n){var r=n.getBoundingClientRect();e={clientWidth:n.clientWidth,scrollLeft:n.scrollLeft,scrollTop:n.scrollTop,scrollLeftNormalized:$W(n,T.direction),scrollWidth:n.scrollWidth,top:r.top,bottom:r.bottom,left:r.left,right:r.right}}if(n&&!1!==C){var i=G.current.children;if(i.length>0){var o=i[X.get(C)];t=o?o.getBoundingClientRect():null}}return{tabsMeta:e,tabMeta:t}},Z=$L((function(){var e,t=J(),n=t.tabsMeta,r=t.tabMeta,i=0;if(r&&n)if(N)i=r.top-n.top+n.scrollTop;else{var o=_?n.scrollLeftNormalized+n.clientWidth-n.scrollWidth:n.scrollLeft;i=r.left-n.left+o}var a=(jC(e={},R,i),jC(e,I,r?r[I]:0),e);if(isNaN(j[R])||isNaN(j[I]))H(a);else{var s=Math.abs(j[R]-a[R]),l=Math.abs(j[I]-a[I]);(s>=1||l>=1)&&H(a)}})),Q=function(e){!function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},o=r.ease,a=void 0===o?YW:o,s=r.duration,l=void 0===s?300:s,u=null,c=t[e],d=!1,f=function(){d=!0},p=function r(o){if(d)i(new Error("Animation cancelled"));else{null===u&&(u=o);var s=Math.min(1,(o-u)/l);t[e]=a(s)*(n-c)+c,s>=1?requestAnimationFrame((function(){i(null)})):requestAnimationFrame(r)}};c===n?i(new Error("Element already at target position")):requestAnimationFrame(p)}(q,K.current,e)},ee=function(e){var t=K.current[q];N?t+=e:(t+=e*(_?-1:1),t*=_&&"reverse"===UW()?-1:1),Q(t)},te=function(){ee(-K.current[A])},ne=function(){ee(K.current[A])},re=vC.useCallback((function(e){Y({overflow:null,marginBottom:-e})}),[]),ie=$L((function(){var e=J(),t=e.tabsMeta,n=e.tabMeta;if(n&&t)if(n[R]<t[R]){var r=t[q]+(n[R]-t[R]);Q(r)}else if(n[P]>t[P]){var i=t[q]+(n[P]-t[P]);Q(i)}})),oe=$L((function(){if(D&&"off"!==y){var e,t,n=K.current,r=n.scrollTop,i=n.scrollHeight,o=n.clientHeight,a=n.scrollWidth,s=n.clientWidth;if(N)e=r>1,t=r<i-o-1;else{var l=$W(K.current,T.direction);e=_?l<a-s-1:l>1,t=_?l>1:l<a-s-1}e===V.start&&t===V.end||W({start:e,end:t})}}));vC.useEffect((function(){var e=sj((function(){Z(),oe()})),t=BF(K.current);return t.addEventListener("resize",e),function(){e.clear(),t.removeEventListener("resize",e)}}),[Z,oe]);var ae=vC.useCallback(sj((function(){oe()})));vC.useEffect((function(){return function(){ae.clear()}}),[ae]),vC.useEffect((function(){z(!0)}),[]),vC.useEffect((function(){Z(),oe()})),vC.useEffect((function(){ie()}),[ie,j]),vC.useImperativeHandle(n,(function(){return{updateIndicator:Z,updateScrollButtons:oe}}),[Z,oe]);var se=vC.createElement(JW,HC({className:a.indicator,orientation:h,color:d},x,{style:HC({},j,{},x.style)})),le=0,ue=vC.Children.map(o,(function(e){if(!vC.isValidElement(e))return null;var t=void 0===e.props.value?le:e.props.value;X.set(t,le);var n=t===C;return le+=1,vC.cloneElement(e,{fullWidth:"fullWidth"===E,indicator:n&&!L&&se,selected:n,onChange:f,textColor:k,value:t})})),ce=function(){var e={};e.scrollbarSizeListener=D?vC.createElement(KW,{className:a.scrollable,onChange:re}):null;var t=V.start||V.end,n=D&&("auto"===y&&t||"desktop"===y||"on"===y);return e.scrollButtonStart=n?vC.createElement(g,{orientation:h,direction:_?"right":"left",onClick:te,visible:V.start,className:YT(a.scrollButtons,"on"!==y&&a.scrollButtonsDesktop)}):null,e.scrollButtonEnd=n?vC.createElement(g,{orientation:h,direction:_?"left":"right",onClick:ne,visible:V.end,className:YT(a.scrollButtons,"on"!==y&&a.scrollButtonsDesktop)}):null,e}();return vC.createElement(u,HC({className:YT(a.root,s,N&&a.vertical),ref:t},M),ce.scrollButtonStart,ce.scrollbarSizeListener,vC.createElement("div",{className:YT(a.scroller,D?a.scrollable:a.fixed),style:$,ref:K,onScroll:ae},vC.createElement("div",{className:YT(a.flexContainer,N&&a.flexContainerVertical,i&&!D&&a.centered),ref:G,role:"tablist"},ue),L&&se),ce.scrollButtonEnd)}));fD((function(e){return{root:{overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},vertical:{flexDirection:"column"},flexContainer:{display:"flex"},flexContainerVertical:{flexDirection:"column"},centered:{justifyContent:"center"},scroller:{position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},fixed:{overflowX:"hidden",width:"100%"},scrollable:{overflowX:"scroll",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},scrollButtons:{},scrollButtonsDesktop:jC({},e.breakpoints.down("xs"),{display:"none"}),indicator:{}}}),{name:"MuiTabs"})(nU);var rU={standard:cH,filled:Aj,outlined:rB},iU=vC.forwardRef((function(e,t){var n=e.autoComplete,r=e.autoFocus,i=e.children,o=e.classes,a=e.className,s=e.color,l=void 0===s?"primary":s,u=e.defaultValue,c=e.error,d=e.FormHelperTextProps,f=e.fullWidth,p=e.helperText,h=e.hiddenLabel,m=e.id,g=e.InputLabelProps,v=e.inputProps,y=e.InputProps,b=e.inputRef,x=e.label,w=e.multiline,k=e.name,C=e.onBlur,S=e.onChange,E=e.onFocus,M=e.placeholder,T=e.required,D=void 0!==T&&T,_=e.rows,N=e.rowsMax,q=e.select,R=void 0!==q&&q,P=e.SelectProps,A=e.type,I=e.value,O=e.variant,L=void 0===O?"standard":O,z=VC(e,["autoComplete","autoFocus","children","classes","className","color","defaultValue","error","FormHelperTextProps","fullWidth","helperText","hiddenLabel","id","InputLabelProps","inputProps","InputProps","inputRef","label","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","rowsMax","select","SelectProps","type","value","variant"]),F=vC.useState(0),j=F[0],H=F[1],B=vC.useRef(null);vC.useEffect((function(){if("outlined"===L){var e=lL.findDOMNode(B.current);H(null!=e?e.offsetWidth:0)}}),[L,D,x]);var V={};"outlined"===L&&(g&&void 0!==g.shrink&&(V.notched=g.shrink),V.labelWidth=j),R&&(P&&P.native||(V.id=void 0),V["aria-describedby"]=void 0);var W=p&&m?"".concat(m,"-helper-text"):void 0,U=x&&m?"".concat(m,"-label"):void 0,$=rU[L],Y=vC.createElement($,HC({"aria-describedby":W,autoComplete:n,autoFocus:r,defaultValue:u,fullWidth:f,multiline:w,name:k,rows:_,rowsMax:N,type:A,value:I,id:m,inputRef:b,onBlur:C,onChange:S,onFocus:E,placeholder:M,inputProps:v},V,y));return vC.createElement(Lj,HC({className:YT(o.root,a),error:c,fullWidth:f,hiddenLabel:h,ref:t,required:D,color:l,variant:L},z),x&&vC.createElement(pH,HC({htmlFor:m,ref:B,id:U},g),x),R?vC.createElement(DV,HC({"aria-describedby":W,id:m,labelId:U,value:I,input:Y},P),i):Y,p&&vC.createElement(Bj,HC({id:W},d),p))}));function oU(e){return Math.round(1e5*e)/1e5}fD({root:{}},{name:"MuiTextField"})(iU);var aU=vC.forwardRef((function(e,t){var n=e.children,r=e.classes,i=e.disableFocusListener,o=void 0!==i&&i,a=e.disableHoverListener,s=void 0!==a&&a,l=e.disableTouchListener,u=void 0!==l&&l,c=e.enterDelay,d=void 0===c?0:c,f=e.enterTouchDelay,p=void 0===f?700:f,h=e.id,m=e.interactive,g=void 0!==m&&m,v=e.leaveDelay,y=void 0===v?0:v,b=e.leaveTouchDelay,x=void 0===b?1500:b,w=e.onClose,k=e.onOpen,C=e.open,S=e.placement,E=void 0===S?"bottom":S,M=e.PopperProps,T=e.title,D=e.TransitionComponent,_=void 0===D?tH:D,N=e.TransitionProps,q=VC(e,["children","classes","disableFocusListener","disableHoverListener","disableTouchListener","enterDelay","enterTouchDelay","id","interactive","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperProps","title","TransitionComponent","TransitionProps"]),R=dD(),P=vC.useState(!1),A=P[0],I=P[1],O=vC.useState(0)[1],L=vC.useState(),z=L[0],F=L[1],j=vC.useRef(!1),H=vC.useRef(null!=C).current,B=vC.useRef(),V=vC.useRef(),W=vC.useRef(),U=vC.useRef(),$=vC.useRef();vC.useEffect((function(){B.current||(B.current="mui-tooltip-".concat(Math.round(1e5*Math.random()))),C&&O((function(e){return!e}))}),[C]),vC.useEffect((function(){return function(){clearTimeout(V.current),clearTimeout(W.current),clearTimeout(U.current),clearTimeout($.current)}}),[]);var Y=function(e){H||A||I(!0),k&&k(e)},X=function(e){var t=n.props;"mouseover"===e.type&&t.onMouseOver&&t.onMouseOver(e),j.current&&"touchstart"!==e.type||(z&&z.removeAttribute("title"),clearTimeout(W.current),clearTimeout(U.current),d?(e.persist(),W.current=setTimeout((function(){Y(e)}),d)):Y(e))},K=iz(),G=K.isFocusVisible,J=K.onBlurVisible,Z=K.ref,Q=vC.useState(!1),ee=Q[0],te=Q[1],ne=function(e){H||I(!1),w&&w(e),clearTimeout(V.current),V.current=setTimeout((function(){j.current=!1}),R.transitions.duration.shortest)},re=function(e){var t=n.props;"blur"===e.type&&(t.onBlur&&t.onBlur(e),ee&&(te(!1),J())),"mouseleave"===e.type&&t.onMouseLeave&&t.onMouseLeave(e),clearTimeout(W.current),clearTimeout(U.current),e.persist(),U.current=setTimeout((function(){ne(e)}),y)},ie=LL(F,t),oe=LL(Z,ie),ae=vC.useCallback((function(e){OL(oe,lL.findDOMNode(e))}),[oe]),se=LL(n.ref,ae),le=H?C:A;""===T&&(le=!1);var ue=!le&&!s,ce=HC({"aria-describedby":le?h||B.current:null,title:ue&&"string"==typeof T?T:null},q,{},n.props,{className:YT(q.className,n.props.className)});u||(ce.onTouchStart=function(e){j.current=!0;var t=n.props;t.onTouchStart&&t.onTouchStart(e),clearTimeout(U.current),clearTimeout(V.current),clearTimeout($.current),e.persist(),$.current=setTimeout((function(){X(e)}),p)},ce.onTouchEnd=function(e){n.props.onTouchEnd&&n.props.onTouchEnd(e),clearTimeout($.current),clearTimeout(U.current),e.persist(),U.current=setTimeout((function(){ne(e)}),x)}),s||(ce.onMouseOver=X,ce.onMouseLeave=re),o||(ce.onFocus=function(e){z||F(e.currentTarget),G(e)&&(te(!0),X(e));var t=n.props;t.onFocus&&t.onFocus(e)},ce.onBlur=re);var de=g?{onMouseOver:ce.onMouseOver,onMouseLeave:ce.onMouseLeave,onFocus:ce.onFocus,onBlur:ce.onBlur}:{};return vC.createElement(vC.Fragment,null,vC.cloneElement(n,HC({ref:se},ce)),vC.createElement(pV,HC({className:YT(r.popper,g&&r.popperInteractive),placement:E,anchorEl:z,open:!!z&&le,id:ce["aria-describedby"],transition:!0},de,M),(function(e){var t=e.placement,n=e.TransitionProps;return vC.createElement(_,HC({timeout:R.transitions.duration.shorter},n,N),vC.createElement("div",{className:YT(r.tooltip,r["tooltipPlacement".concat(pD(t.split("-")[0]))],j.current&&r.touch)},T))})))}));fD((function(e){return{popper:{zIndex:e.zIndex.tooltip,pointerEvents:"none",flip:!1},popperInteractive:{pointerEvents:"auto"},tooltip:{backgroundColor:LC(e.palette.grey[700],.9),borderRadius:e.shape.borderRadius,color:e.palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(10),lineHeight:"".concat(oU(1.4),"em"),maxWidth:300,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},touch:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:"".concat(oU(16/14),"em"),fontWeight:e.typography.fontWeightRegular},tooltipPlacementLeft:jC({transformOrigin:"right center",margin:"0 24px "},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementRight:jC({transformOrigin:"left center",margin:"0 24px"},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementTop:jC({transformOrigin:"center bottom",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"}),tooltipPlacementBottom:jC({transformOrigin:"center top",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"})}}),{name:"MuiTooltip"})(aU);var sU={entering:{transform:"none"},entered:{transform:"none"}},lU={enter:RS.enteringScreen,exit:RS.leavingScreen};function uU(e){return"large"===e?"20px":"small"===e?"12px":"16px"}function cU({d:e,size:t,style:n={},viewBox:r="0 0 16 16"}){const i={fontSize:uU(t),display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-.125em",textRendering:"optimizeLegibility",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...n};return vC.createElement("i",{style:i},vC.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:r,fill:"currentColor"},vC.createElement("path",{d:e})))}vC.forwardRef((function(e,t){var n=e.children,r=e.in,i=e.onEnter,o=e.onExit,a=e.style,s=e.timeout,l=void 0===s?lU:s,u=VC(e,["children","in","onEnter","onExit","style","timeout"]),c=dD(),d=LL(n.ref,t);return vC.createElement(gL,HC({appear:!0,in:r,onEnter:function(e,t){AL(e);var n=IL({style:a,timeout:l},{mode:"enter"});e.style.webkitTransition=c.transitions.create("transform",n),e.style.transition=c.transitions.create("transform",n),i&&i(e,t)},onExit:function(e){var t=IL({style:a,timeout:l},{mode:"exit"});e.style.webkitTransition=c.transitions.create("transform",t),e.style.transition=c.transitions.create("transform",t),o&&o(e)},timeout:l},u),(function(e,t){return vC.cloneElement(n,HC({style:HC({transform:"scale(0)",visibility:"exited"!==e||r?void 0:"hidden"},sU[e],{},a,{},n.props.style),ref:d},t))}))}));const dU={d:"M15.9993744,3 L15.9993744,5 L4.99937445,5 L4.99937445,3 L15.9993744,3 Z M8.99937445,7 L15.9993744,7 L15.9993744,9 L8.99937445,9 L8.99937445,7 Z M11.9993744,11 L15.9993744,11 L15.9993744,13 L11.9993744,13 L11.9993744,11 Z M2.2,11 L7,11 L7,9.00369263 C7,8.89323568 7.08954305,8.80369263 7.2,8.80369263 C7.2549016,8.80369263 7.30738916,8.82626165 7.34515712,8.86610844 L10.1852182,11.8624926 C10.2583124,11.93961 10.258346,12.0604218 10.1852948,12.13758 L7.34523376,15.1373102 C7.2692928,15.2175206 7.14270711,15.2209817 7.06249671,15.1450407 C7.02260076,15.1072683 7,15.0547472 7,14.9998069 L7,12.9043747 C4.79351111,12.9043747 2.8018683,12.9266213 1.02507156,12.9711145 L1.02507252,12.9711526 C0.472939773,12.9849787 0.014139487,12.5485949 0.000313396522,11.9964622 C0.000104473692,11.988119 -1.32268838e-12,11.9797736 -1.3231638e-12,11.9714278 L-1.83320026e-12,3 L2,3 L2,10.8 C2,10.9104569 2.08954305,11 2.2,11 Z"},fU={d:"M13,7 L8,7 L13,7 L13,4.98151367 C13,2.23029964 10.7614237,0 8,0 C5.23857625,0 3,2.23029964 3,4.98151367 L3,7 L3.75,7 L3,7 L4.5,7 L4.5,5.33193359 C4.5,3.21561511 5.54860291,1.5 8,1.5 C10.4513971,1.5 11.5,3.21561511 11.5,5.33193359 L11.5,7 L12.25,7 L3,7 C2.44771525,7 2,7.44771525 2,8 L2,15 C2,15.5522847 2.44771525,16 3,16 L13,16 C13.5522847,16 14,15.5522847 14,15 L14,8 C14,7.44771525 13.5522847,7 13,7 L3,7 L13,7 Z"},pU="M6,10 L13,3 L15,5 L8,12 L6,14 L1,9 L3,7 L6,10 Z",hU={d:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z"},mU={d:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};function gU(e,t,n){(function({model:e,properties:t}){return e.modifiers?e.modifiers.apply({model:e,properties:t}):Promise.resolve()})({model:e,properties:n}).then((()=>{e.colorSupport&&e.colorSupport.colorByUpdater(n,"qHyperCubeDef.",e.layout);let r=ck.generate(t,n);r&&r.length&&(r=r.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),e.applyPatches(r,!0))}))}function vU(e,t,n,r,i,o){e.getEffectiveProperties().then((a=>{const s=a.qHyperCubeDef[r].findIndex((e=>e.qDef.cId===t)),l=a.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r].findIndex((e=>e.qDef.cId===n)),u=Dv(!0,{},a),c=u.qHyperCubeDef[r][s],d=u.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r][l];d.qAttributeDimensions=c.qAttributeDimensions,c.qAttributeDimensions=[],o||(d.qAttributeExpressions=c.qAttributeExpressions,c.qAttributeExpressions=[]),u.qHyperCubeDef[r][s]=d,u.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r][l]=c,i&&i({oldItem:c,newItem:d,oldProperties:a,newProperties:u,model:e}),gU(e,a,u)}))}const yU=(e,t)=>{const n=[],r=[];return t.forEach((t=>{t.qCalcCondition.qCond.qv&&r.push(e.evaluate(t.qCalcCondition.qCond.qv).then((e=>{"0"===e&&n.push(t.qDef.cId)})))})),Promise.all(r).then((()=>n))};function bU({dir:e,dock:t,altList:n,model:r,translator:i,app:o,onChange:a}){return 0===n.length?null:{dir:e,dock:t,getAlternatives:()=>yU(o,n).then((e=>Promise.all(n.filter((t=>!e.includes(t.qDef.cId))).map((e=>function(e,t,n){if(e.qLibraryId)return t.getDimension(e.qLibraryId).then((e=>e.getLayout())).catch((()=>null)).then((e=>e?"H"!==e.qDim.qGrouping&&e.qDim.qLabelExpression?e.qDim.qLabelExpression:e.qDim.title:n.get("Object.ErrorMessage.MissingDimension")));const r=e.qDef.qLabelExpression;if(r)return t.evaluate(r);const i=e.qDef.qFieldLabels[0]||e.qDef.qFieldDefs[0];return Promise.resolve(i)}(e,o,i).then((t=>({id:e.qDef.cId,selected:!1,title:t})))))))),changeTo(e,t){vU(r,e,t,"qDimensions",a)}}}function xU(e,t,n,r="/qHyperCubeDef"){return{breadcrumbs:e.qGroupFallbackTitles.slice(0,e.qGroupPos),drilldown:"H"===e.qGrouping,index:t,locked:!!e.qLocked,text:"H"===e.qGrouping?e.qGroupFallbackTitles[e.qGroupPos]:e.qFallbackTitle,popoverText:(i=e,"H"===i.qGrouping?i.title||"":i.qFallbackTitle||""),drillUp(e){n.drillUp(r,t,e)},id:e.cId};var i}function wU({altList:e,app:t,dir:n,dock:r,model:i,onChange:o,skipAttributeExpressions:a,translator:s}){return 0===e.length?null:{dir:n,dock:r,getAlternatives:()=>yU(t,e).then((n=>Promise.all(e.filter((e=>!n.includes(e.qDef.cId))).map((e=>function(e,t,n){if(e.qLibraryId)return t.getMeasure(e.qLibraryId).then((e=>e.getLayout())).catch((()=>null)).then((e=>e?e.qMeasure.qLabelExpression?e.qMeasure.qLabelExpression:e.qMeasure.qLabel||e.qMeasure.qDef:n.get("Object.ErrorMessage.MissingMeasure")));const r=e.qDef.qLabelExpression;if(r)return t.evaluate(r);const i=e.qDef.qLabel||e.qDef.qDef;return Promise.resolve(i)}(e,t,s).then((t=>({id:e.qDef.cId,selected:!1,title:t})))))))),changeTo(e,t){vU(i,e,t,"qMeasures",o,a)}}}function kU(e,t){return{breadcrumbs:[],drilldown:!1,index:t,locked:!1,text:e.qFallbackTitle,popoverText:e.qFallbackTitle,id:e.cId}}const CU={bottom:{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},top:{anchorOrigin:{vertical:"top",horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"}},left:{anchorOrigin:{vertical:"center",horizontal:"left"},transformOrigin:{vertical:"center",horizontal:"right"}},right:{anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"}}},SU=({children:e,...t})=>vC.createElement(iF,bv({size:"small",disableRipple:!0,disableTouchRipple:!0},t),e);function EU(){function e({title:e,selected:t,onClick:n}){const r=Hv.detectTextDirection(e);return vC.createElement(kH,{role:"menuitem",button:!0,onClick:n,style:{textAlign:"start"}},vC.createElement(EH,{style:{minWidth:32}},vC.createElement(cU,{d:t?pU:""})),vC.createElement(DH,{primaryTypographyProps:{dir:r}},e))}function t({alignTo:t,changeTo:n,current:r,dir:i,dock:o,list:a,onClose:s,show:l,instruction:u}){const c=a.map((t=>vC.createElement(e,{key:t.id,title:t.title,onClick:()=>n(t.id)})));return vC.createElement(IH,bv({anchorEl:t,open:l,onClose:s},CU[o],{PaperProps:{style:{minWidth:"250px",maxHeight:"300px"}}}),vC.createElement(bH,{dense:!0,dir:i,"aria-label":u,component:"nav"},vC.createElement(e,{title:r,selected:!0,onClick:s}),c))}e.propTypes={title:yC.exports.string.isRequired,selected:yC.exports.bool,onClick:yC.exports.func.isRequired},e.defaultProps={selected:!1},t.propTypes={alignTo:yC.exports.any,changeTo:yC.exports.func.isRequired,current:yC.exports.string.isRequired,dir:yC.exports.string.isRequired,dock:yC.exports.string.isRequired,list:yC.exports.array,onClose:yC.exports.func.isRequired,show:yC.exports.bool.isRequired,instruction:yC.exports.string.isRequired},t.defaultProps={list:[],alignTo:null};class n extends vC.Component{constructor(e){super(e),this.state={open:!1,inSelection:e.selections&&e.selections.isActive(),hasValidAlternatives:!1},this.openPopover=this.openPopover.bind(this),this.closePopover=this.closePopover.bind(this),this.changeTo=this.changeTo.bind(this),this.alignToRef=vC.createRef()}componentDidMount(){const{selections:e}=this.props;e&&(this.onSelectionsActivated=()=>this.setState({inSelection:!0}),this.onSelectionsDeactivated=()=>this.setState({inSelection:!1}),e.addListener("activated",this.onSelectionsActivated),e.addListener("deactivated",this.onSelectionsDeactivated),e.addListener("canceled",this.onSelectionsDeactivated))}componentDidUpdate(e,t){const{popover:n,supportConditional:r}=this.props;n&&r&&n.getAlternatives().then((e=>{t.hasValidAlternatives!==(0!==e.length)&&this.setState({hasValidAlternatives:0!==e.length})}))}componentWillUnmount(){const{selections:e}=this.props;e&&(e.removeListener("activated",this.onSelectionsActivated),e.removeListener("deactivated",this.onSelectionsDeactivated),e.removeListener("canceled",this.onSelectionsDeactivated))}changeTo(e){this.props.popover.changeTo(this.props.titleData.id,e),this.closePopover()}openPopover(){this.state.closeTime&&Date.now()-this.state.closeTime<20||this.props.popover.getAlternatives().then((e=>{this.setState({open:!0,alternatives:e})}))}closePopover(){this.setState({open:!1,closeTime:Date.now()})}render(){const{titleData:e,popover:n,translator:r,disabled:i,isDimension:o,padding:a,minWidth:s,hasAlternative:l,supportConditional:u}=this.props,c={flex:"1 1 auto",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:"normal",lineHeight:"normal",...this.props.style},d=e.breadcrumbs.length,f=i||this.state.inSelection,p=e.breadcrumbs.map(((t,n)=>vC.createElement(SU,{style:{display:"flex",alignItems:"center",color:f&&"rgba(89, 89, 89, 0.8)",pointerEvents:f?"none":"auto",paddingTop:0,paddingBottom:0,height:"100%"},key:n,onClick:()=>f?void 0:e.drillUp(d-n),title:t},vC.createElement("span",{style:c},t),vC.createElement(cU,bv({},mU,{size:"small",style:{margin:"0 8px"}}))))),h=u?this.state.hasValidAlternatives:l,m=n&&!this.state.open?this.openPopover:this.closePopover,g=!n||i||this.state.inSelection,v={display:"flex",alignItems:"center",width:"100%",color:g&&"rgba(89, 89, 89, 0.8)",height:"100%",border:!o&&g&&"none",paddingTop:0,paddingBottom:0};this.state.open&&(v.background="rgba(0,0,0,0.08)");a&&(v.padding=a),s&&(v.minWidth=s);const y=Hv.detectTextDirection(e.text),b=vC.createElement(SU,{"aria-label":r.get("Accessibility.Alternative.Instructions",[e.text]),style:v,onClick:g?void 0:m,title:e.text,tabIndex:g?-1:0,onFocus:g?void 0:e=>{e.currentTarget.style.boxShadow="0px 0px 0px 2px #177FE6 inset",e.currentTarget.style.borderRadius="2px"},onBlur:g?void 0:e=>{e.currentTarget.style.boxShadow="none",e.currentTarget.style.borderRadius="0px"},onMouseDown:e=>{e.preventDefault()}},e.locked&&vC.createElement(cU,bv({},fU,{size:"small",title:r.get("Tooltip.selections.locked")})),vC.createElement("span",{style:c,dir:y},e.text),n&&h&&vC.createElement(cU,bv({},hU,{size:"small",style:{margin:"0 8px"}})));return vC.createElement(vC.Fragment,null,e.drilldown&&vC.createElement(cU,bv({},dU,{size:"small",title:r.get("Tooltip.dimensions.drilldown"),style:{margin:"0 4px 0 0"}})),p,vC.createElement("div",{ref:this.alignToRef,style:{overflow:"hidden",pointerEvents:h?"auto":"none",height:"100%"}},b),n&&h&&vC.createElement(t,{dock:n.dock,dir:n.dir,current:e.popoverText,alignTo:this.alignToRef.current,show:this.state.open,list:this.state.alternatives,onClose:this.closePopover,changeTo:this.changeTo,instruction:r.get("Accessibility.Popover.Instructions")}))}}function r(e){return{top:"bottom",bottom:"top",left:"right",right:"left"}[e]}function i(e){return!e.isDimension&&Ov(e,"hyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures.length")>0}return n.propTypes={disabled:yC.exports.bool.isRequired,padding:yC.exports.string,minWidth:yC.exports.string,titleData:yC.exports.shape({breadcrumbs:yC.exports.arrayOf(yC.exports.string).isRequired,drilldown:yC.exports.bool.isRequired,index:yC.exports.number.isRequired,locked:yC.exports.bool.isRequired,text:yC.exports.string.isRequired,popoverText:yC.exports.string.isRequired,drillUp:yC.exports.func,id:yC.exports.string.isRequired}).isRequired,popover:yC.exports.shape({dir:yC.exports.string.isRequired,dock:yC.exports.string.isRequired,changeTo:yC.exports.func.isRequired,getAlternatives:yC.exports.func.isRequired}),translator:yC.exports.shape({get:yC.exports.func.isRequired}).isRequired,selections:yC.exports.shape({isActive:yC.exports.func,addListener:yC.exports.func,removeListener:yC.exports.func}),style:yC.exports.shape({fontSize:yC.exports.string,color:yC.exports.string,fontFamily:yC.exports.string}).isRequired,isDimension:yC.exports.bool.isRequired,hasAlternative:yC.exports.bool.isRequired,supportConditional:yC.exports.bool.isRequired},n.defaultProps={popover:null,selections:null,padding:"",minWidth:""},{renderer:"react",disableTriggers:!0,preferredSize:function(){return this.settings.settings.isDimension||i(this.settings.settings)?28:20},render(){const{settings:{app:e,disabled:t,explicitItemInfos:o,hyperCube:a,hyperCubeDef:s,isDimension:l,minWidth:u,model:c,onChangeToAlternative:d,padding:f,rtl:p,selections:h,skipAttributeExpressions:m,translator:g,supportConditional:v=!1},layout:{dock:y}}=this.settings,b="top"!==y&&"bottom"!==y||!p?"ltr":"rtl",x=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",height:"100%"};return"left"===e?(n.width=t.height+"px",n.height=t.width+"px",n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left"):"right"===e&&(n.width=t.height+"px",n.height=t.width+"px",n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left"),n}(y,this.rect),w=s&&s.qLayoutExclude&&s.qLayoutExclude.qHyperCubeDef,k=w&&w[l?"qDimensions":"qMeasures"]||[],C=o||a[l?"qDimensionInfo":"qMeasureInfo"],S=l?bU:wU,E=l?xU:kU,M=c&&c.colorSupport&&c.modifiers&&S({altList:k,app:e,dir:p?"rtl":"ltr",dock:r(y),model:c,onChange:d,skipAttributeExpressions:m,translator:g}),T=(D=this.settings.settings).isDimension&&Ov(D,"hyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.length")>0||i(this.settings.settings);var D;const _=C.map(((e,r)=>{const i="number"==typeof e.explicitColumn?e.explicitColumn:r,o=E(e,i,c),a=r===C.length-1;return vC.createElement(vC.Fragment,{key:e.cId},vC.createElement(n,{popover:M,titleData:o,model:c,translator:g,selections:h,disabled:t(),style:this.style,isDimension:l,padding:f,minWidth:u,hasAlternative:T,supportConditional:v}),!a&&vC.createElement("span",{style:{lineHeight:"normal",...this.style}},", "))}));return vC.createElement("div",{style:x,dir:b},_)}}}const MU=OS({palette:{text:{primary:"rgba(89, 89, 89, 0.8)",secondary:"rgba(0, 0, 0, 0.55)",disabled:"rgba(0, 0, 0, 0.3)"},action:{disabled:"rgba(0, 0, 0, 0.3)"}},typography:{fontFamily:'"Source Sans Pro", "Arial", "sans-serif"',button:{textTransform:"initial",fontWeight:400}},shape:{borderRadius:2},shadows:["none","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)"],props:{MuiButtonBase:{disableRipple:!0}}});const TU=FS({productionPrefix:"q1ec1",disableGlobal:!0,seed:""});function DU(){function e({x:e,y:t,width:n,height:r,scaleRatio:i,margin:o}={}){const a={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0}};return a.x=Number.isNaN(e)?a.x:e,a.y=Number.isNaN(t)?a.y:t,a.width=Number.isNaN(n)?a.width:n,a.height=Number.isNaN(r)?a.height:r,void 0!==i&&(a.scaleRatio.x=Number.isNaN(i.x)?a.scaleRatio.x:i.x,a.scaleRatio.y=Number.isNaN(i.y)?a.scaleRatio.y:i.y),void 0!==o&&(a.margin.left=Number.isNaN(o.left)?0:o.left,a.margin.top=Number.isNaN(o.top)?0:o.top),a}return function(t={}){const{createElement:n=document.createElement.bind(document)}=t;let r,i=e();const o={element:()=>r,root:()=>r,appendTo:e=>(r||(r=n("div"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none"),e.appendChild(r),r),render(e){if(!r)return!1;const t=i.scaleRatio.x,n=i.scaleRatio.y;return r.style.left=Math.round(i.margin.left+i.x*t)+"px",r.style.top=Math.round(i.margin.top+i.y*n)+"px",r.style.width=Math.round(i.width)+"px",r.style.height=Math.round(i.height)+"px",r.style.transform=`scale(${t}, ${n})`,r.style.transformOrigin="top left",lL.render(function(e,t){return vC.createElement(AT,{generateClassName:t},vC.createElement(lD,{theme:MU},e))}(e,TU),r),!0},itemsAt:()=>[],findShapes:()=>[],clear:()=>(r&&lL.unmountComponentAtNode(r),o),destroy(){r&&r.parentElement&&(lL.unmountComponentAtNode(r),r.parentElement.removeChild(r)),r=null},size:t=>(t&&(i=e(t)),i)};return o}}function _U(){return function(e){e.renderer("react",DU()),e.component("data-title",EU()),e.component("disclaimer",function(){class e extends vC.Component{render(){const{label:e,spanStyle:t}=this.props;return vC.createElement(vC.Fragment,null,vC.createElement("span",{ref:this.alignToRef,style:t,title:e},e))}}return e.propTypes={label:yC.exports.string.isRequired,spanStyle:yC.exports.shape().isRequired},{renderer:"react",disableTriggers:!0,preferredSize:function(){return 22},render(){const{settings:{label:t,rtl:n},layout:{dock:r},style:i={}}=this.settings,o="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",a=function(e,t,n){const r={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px",fontFamily:e.fontFamily||'"Source Sans Pro", "Arial", "sans-serif"'};switch(t){case"left":r.width=n.height+"px",r.transform=`rotate(-90deg) translate(-${n.height}px, 0)`,r.transformOrigin="top left";break;case"right":r.width=n.height+"px",r.transform=`rotate(90deg) translate(0, -${n.width}px)`,r.transformOrigin="top left";break;case"center":r.width=n.width+"px",r.height=n.height+"px",r.color="#595959",r.fontStyle="normal",r.fontSize="1.2em",r.textAlign="center";break;default:case"top":case"bottom":r.justifyContent="flex-start",r.alignItems="flex-start"}return r}(i,r,this.rect),s="center"===r?t:"* "+t,l="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return vC.createElement("div",{style:a,dir:o},vC.createElement(vC.Fragment,null,vC.createElement(e,{label:s,spanStyle:l})))}}}())}}function NU(e){return Oy(e).l<70}function qU(e,t){const n=Oy(e).l/100,r=Oy(t).l/100;return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)}function RU(e,t){return{x:t.x+e.r*Math.sin(e.a),y:t.y-e.r*Math.cos(e.a)}}var PU={require:["chart","settings"],defaultSettings:{settings:{},style:{}},render(){return function({chart:e,settings:t}){const n=e.component(t.component);if(!n)return[];const r=e.findShapes(t.selector).filter((e=>e.key===t.component));if(r.length<2)return[];if(n.settings.settings.slice.cornerRadius>0||n.settings.settings.slice.strokeWidth>0)return[];const i=[];let o=r[r.length-1];for(let e=0;e<r.length;e+=1){const t=r[e],n=o.attrs.fill,a=t.attrs.fill;if(qU(a,n)<=1.2){const{start:e,offset:n}=t.desc.slice;let{innerRadius:r,outerRadius:s}=t.desc.slice;if(r=Math.max(r,o.desc.slice.innerRadius),s=Math.min(s,o.desc.slice.outerRadius),s>r){const t=RU({r:s,a:e},n),o=RU({r:r,a:e},n);i.push({type:"line",x1:t.x,y1:t.y,x2:o.x,y2:o.y,strokeWidth:1,opacity:.4,stroke:NU(a)?"#ccc":"#333"})}}o=t}return i}({chart:this.chart,rect:this.rect,style:this.style,settings:this.settings.settings})}};function AU(e,t=!0){let n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?`M${r.x} ${r.y}`:`L${r.x} ${r.y}`,n+=" "}return t&&(n+="Z"),n}function IU(e){const{size:t,angle:n}=e,r={x:e.x,y:e.y},i=t/2,o=e.x-i,a=e.y-i;let s=[{x:o,y:a+t},{x:o+i,y:a},{x:o+t,y:a+t},{x:o,y:a+t}];return s=s.map((e=>function(e,t,n={x:0,y:0}){const r=Math.cos(t),i=Math.sin(t),o=(s=n,{x:(a=e).x-s.x,y:a.y-s.y});var a,s;return function(e,t){return{x:e.x+t.x,y:e.y+t.y}}({x:r*o.x-i*o.y,y:i*o.x+r*o.y},n)}(e,n,r))),{type:"path",fill:e.fill,d:AU(s)}}var OU={require:["chart"],defaultSettings:{settings:{},style:{}},render(){return function({chart:e,settings:t}){if(!e.component(t.component))return[];const n=e.findShapes(t.selector).filter((e=>e.key===t.component));if(n.length<2)return[];const r=[];for(let e=0;e<n.length;e+=1){const a=n[e];if(a.data.radius.value<0){const{start:e,end:n,offset:s}=a.desc.slice,l=(e+n)/2,u=(i={r:t.offset,a:l},{x:(o=s).x+i.r*Math.sin(i.a),y:o.y-i.r*Math.cos(i.a)}),c=IU({size:t.size,fill:t.fill,angle:l+Math.PI,...u});c.data={...a.data,_share:a.desc.share,_fillColor:a.attrs.fill},r.push(c)}}var i,o;return r}({chart:this.chart,rect:this.rect,style:this.style,settings:this.settings.settings})}};function LU(){const e=vm();return e.use(mv),e.use(function(e){if("function"!=typeof e.interaction)return function(t){t.interaction("hammer",yv(e))};e.interaction("hammer",yv(Hammer))}(o)),e.use(_U()),e.component("pie-dividers",PU),e.component("negative-indicators",OU),e}function zU(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 FU(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zU(Object(n),!0).forEach((function(t){WU(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zU(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jU(){jU=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof d?t:d,o=Object.create(i.prototype),a=new C(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=x(a,n);if(s){if(s===c)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===c)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(e,n,a),o}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var c={};function d(){}function f(){}function p(){}var h={};s(h,i,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(S([])));g&&g!==t&&n.call(g,i)&&(h=g);var v=p.prototype=d.prototype=Object.create(h);function y(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;this._invoke=function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}}function x(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=u(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function S(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return f.prototype=p,s(v,"constructor",p),s(p,"constructor",f),f.displayName=s(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,s(e,a,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},y(b.prototype),s(b.prototype,o,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new b(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},y(v),s(v,a,"Generator"),s(v,i,(function(){return this})),s(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=S,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,c):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function HU(e){return(HU="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function BU(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function VU(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){BU(o,r,i,a,s,"next",e)}function s(e){BU(o,r,i,a,s,"throw",e)}a(void 0)}))}}function WU(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UU(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $U(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(e,t)||XU(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function YU(e){return function(e){if(Array.isArray(e))return KU(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||XU(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 XU(e,t){if(e){if("string"==typeof e)return KU(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)?KU(e,t):void 0}}function KU(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var GU=Object.prototype.hasOwnProperty,JU=Object.prototype.toString,ZU=Object.defineProperty,QU=Object.getOwnPropertyDescriptor,e$=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===JU.call(e)},t$=function(e){if(!e||"[object Object]"!==JU.call(e))return!1;var t,n=GU.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&GU.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||GU.call(e,t)},n$=function(e,t){ZU&&"__proto__"===t.name?ZU(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},r$=function(e,t){if("__proto__"===t){if(!GU.call(e,t))return;if(QU)return QU(e,t).value}return e[t]},i$=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=r$(s,n),s!==(i=r$(t,n))&&(c&&i&&(t$(i)||(o=e$(i)))?(o?(o=!1,a=r&&e$(r)?r:[]):a=r&&t$(r)?r:{},n$(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&n$(s,{name:n,newValue:i}));return s};function o$(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 a$(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 s$(e,t,n,r,i){var o,a=i.byRow,s=i.byElemNo;if(r&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(o=e.hc.qDataPages[0])||void 0===o?void 0:o.qArea.qHeight)||0)))return s(r,r.raw().qCardinal);if(r){var l=t.pic.extract({field:r.key(),trackBy:r.value}).length;return a(r,l)}return{}}function l$(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 u$(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 c$(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function d$(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function f$(){}var p$=1/.7,h$="\\s*([+-]?\\d+)\\s*",m$="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",g$="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",v$=/^#([0-9a-f]{3,8})$/,y$=new RegExp("^rgb\\("+[h$,h$,h$]+"\\)$"),b$=new RegExp("^rgb\\("+[g$,g$,g$]+"\\)$"),x$=new RegExp("^rgba\\("+[h$,h$,h$,m$]+"\\)$"),w$=new RegExp("^rgba\\("+[g$,g$,g$,m$]+"\\)$"),k$=new RegExp("^hsl\\("+[m$,g$,g$]+"\\)$"),C$=new RegExp("^hsla\\("+[m$,g$,g$,m$]+"\\)$"),S$={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 E$(){return this.rgb().formatHex()}function M$(){return this.rgb().formatRgb()}function T$(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=v$.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?D$(t):3===n?new R$(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?_$(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?_$(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=y$.exec(e))?new R$(t[1],t[2],t[3],1):(t=b$.exec(e))?new R$(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=x$.exec(e))?_$(t[1],t[2],t[3],t[4]):(t=w$.exec(e))?_$(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=k$.exec(e))?O$(t[1],t[2]/100,t[3]/100,1):(t=C$.exec(e))?O$(t[1],t[2]/100,t[3]/100,t[4]):S$.hasOwnProperty(e)?D$(S$[e]):"transparent"===e?new R$(NaN,NaN,NaN,0):null}function D$(e){return new R$(e>>16&255,e>>8&255,255&e,1)}function _$(e,t,n,r){return r<=0&&(e=t=n=NaN),new R$(e,t,n,r)}function N$(e){return e instanceof f$||(e=T$(e)),e?new R$((e=e.rgb()).r,e.g,e.b,e.opacity):new R$}function q$(e,t,n,r){return 1===arguments.length?N$(e):new R$(e,t,n,null==r?1:r)}function R$(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function P$(){return"#"+I$(this.r)+I$(this.g)+I$(this.b)}function A$(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function I$(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function O$(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new z$(e,t,n,r)}function L$(e){if(e instanceof z$)return new z$(e.h,e.s,e.l,e.opacity);if(e instanceof f$||(e=T$(e)),!e)return new z$;if(e instanceof z$)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new z$(a,s,l,e.opacity)}function z$(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function F$(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}c$(f$,T$,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:E$,formatHex:E$,formatHsl:function(){return L$(this).formatHsl()},formatRgb:M$,toString:M$}),c$(R$,q$,d$(f$,{brighter:function(e){return e=null==e?p$:Math.pow(p$,e),new R$(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new R$(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:P$,formatHex:P$,formatRgb:A$,toString:A$})),c$(z$,(function(e,t,n,r){return 1===arguments.length?L$(e):new z$(e,t,n,null==r?1:r)}),d$(f$,{brighter:function(e){return e=null==e?p$:Math.pow(p$,e),new z$(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new z$(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new R$(F$(e>=240?e-240:e+120,i,r),F$(e,i,r),F$(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var j$=Math.PI/180,H$=180/Math.PI,B$=4/29,V$=6/29,W$=3*V$*V$;function U$(e){if(e instanceof $$)return new $$(e.l,e.a,e.b,e.opacity);if(e instanceof Z$)return Q$(e);e instanceof R$||(e=N$(e));var t,n,r=G$(e.r),i=G$(e.g),o=G$(e.b),a=Y$((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Y$((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Y$((.0139322*r+.0971045*i+.7141733*o)/.82521)),new $$(116*a-16,500*(t-a),200*(a-n),e.opacity)}function $$(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Y$(e){return e>.008856451679035631?Math.pow(e,1/3):e/W$+B$}function X$(e){return e>V$?e*e*e:W$*(e-B$)}function K$(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function G$(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function J$(e){if(e instanceof Z$)return new Z$(e.h,e.c,e.l,e.opacity);if(e instanceof $$||(e=U$(e)),0===e.a&&0===e.b)return new Z$(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*H$;return new Z$(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Z$(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Q$(e){if(isNaN(e.h))return new $$(e.l,0,0,e.opacity);var t=e.h*j$;return new $$(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function eY(e){return function(){return e}}function tY(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):eY(isNaN(e)?t:e)}c$($$,(function(e,t,n,r){return 1===arguments.length?U$(e):new $$(e,t,n,null==r?1:r)}),d$(f$,{brighter:function(e){return new $$(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new $$(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new R$(K$(3.1338561*(t=.96422*X$(t))-1.6168667*(e=1*X$(e))-.4906146*(n=.82521*X$(n))),K$(-.9787684*t+1.9161415*e+.033454*n),K$(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),c$(Z$,(function(e,t,n,r){return 1===arguments.length?J$(e):new Z$(e,t,n,null==r?1:r)}),d$(f$,{brighter:function(e){return new Z$(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new Z$(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return Q$(this).rgb()}}));var nY=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=q$(e)).r,(t=q$(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=tY(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1),rY=/^class(-pyramid)?/,iY=function(e,t,n,r){var i=void 0!==n.min?n.min:r.min(),o=void 0!==n.max?n.max:r.max(),a=i,s=o,l=t.limits,u={},c="percent"===t.limitType?l.map((function(e){return i+(o-i)*e})):l,d=t.colors.map((function(t){return e.resolveUIColor(t)}));if(i=Math.min.apply(Math,[i].concat(YU(c))),o=Math.max.apply(Math,[o].concat(YU(c))),u.min=i,u.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))u.type="categorical",Object.assign(u,function(e){var t=e.min,n=e.max,r=e.limits,i=e.range,o=[],a=[];if(r.length)if(r[r.length-1]<t)a.push(t,n),o.push(i[i.length-1],i[i.length-1],i[i.length-1]);else if(r[0]>n)a.push(t,n),o.push(i[0],i[0],i[0]);else{if(r[0]>t)a.push(t),o.push(i[0]);else{a.push(t);for(var s=0;s<r.length;s++)if(t<r[s]){o.push(i[s]);break}}for(var l=0;l<r.length;l++)t<r[l]&&r[l]<n&&(a.push(r[l]),o.push(i[l]));if(r[r.length-1]<n)a.push(n),o.push(i[r.length]),o.push(i[r.length]);else{a.push(n);for(var u=0;u<r.length;u++)if(r[u]>n){o.push(i[u]),o.push(i[u]);break}}}else o.push(i[0]);return{min:t,max:n,range:o,domain:a}}({min:"percent"===t.limitType?i:a,max:"percent"===t.limitType?o:s,range:d,limits:"percent"===t.limitType?c:l}));else if(t.breakTypes){var f=t.breakTypes;u.type="continuous",u.domain=[i],u.range=[d[0]];for(var p=0;p<c.length;p+=1)if(f[p]){var h=d[p],m=d[p+1],g=nY(h,m)(.5);u.range.push(g),u.domain.push(c[p]),p<c.length-1&&f[p+1]&&(u.range.push(d[p+1]),u.domain.push((c[p]+c[p+1])/2))}else u.range.push(d[p]),u.range.push(d[p+1]),u.domain.push(c[p]),u.domain.push(c[p]+Math.min(1e-6,(o-i)/1e6));u.range.push(d[d.length-1]),u.domain.push(o)}else u.domain=c,u.range=d;return u};function oY(e,t,n,r,i){var o,a,s,l=0,u=[],c=(e-t)/(r+1);if(0===c)return 1;for(o=0;o<n.length;o+=1)a=.99*(n[o]-t),s=n[o]>e?Math.floor(e/c):n[o]<t?0:Math.floor(a/c),Number.isNaN(s)||(u[s]?u[s]+=1:u[s]=1);for(o=0;o<u.length;o+=1)u[o]&&(l+=1);return l<=r||l>=i?Math.max(l,r):oY(e,t,n,r+1,i)}var aY=function(e,t,n,r){var i,o,a=t.theme,s=t.hc,l=r.f,u={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},c=[],d=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(d=!("S"===(i=n.pic.raw()).qMode&&(i.qDataPages[0]&&i.qSize.qcy>i.qDataPages[0].qArea.qHeight||!i.qDataPages.length&&i.qSize.qcy>0)||"K"===i.qMode&&i.qStackedDataPages[0]&&i.qSize.qcy>i.qStackedDataPages[0].qArea.qHeight||"T"===i.qMode&&i.qSize.qcy>i.qTreeDataPages[0].qGroupSize))&&(c=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:s.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,YU(e))<0}}}}).filter((function(e){return e.value>=0&&!e.exclude.value})).map((function(e){return e.num.value})).filter((function(e){return"number"==typeof e})))}if(!1===n.input.autoMinMax){if(u.min=n.input.measureMin,u.max=n.input.measureMax,u.max<u.min)return{invalid:!0}}else if(l&&!d)u.min=l.min(),u.max=l.max();else if(l){if(!c.length)return{invalid:!0};u.min=Math.min.apply(Math,YU(c)),u.max=Math.max.apply(Math,YU(c))}if(n.input.measureScheme&&(u.palettes={quant:n.input.measureScheme}),a){var f=a.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];u.type=f&&rY.test(f.type)?"categorical":"continuous","categorical"===u.type&&(o=f.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,YU(f.colors.map((function(e){return e?e.length:0})))):f.colors.length)}if("categorical"===u.type){for(var p=d?oY(u.max,u.min,c,1,o):o,h=(u.max-u.min)/p,m=[],g=0;g<p+1;g+=1)m.push(u.min+h*g);u.domain=m,u.range=function(e){for(var t=e.resources.theme.palette("quant",p),n=Math.max(1,Math.floor(t.length/p)),r=[],i=0;i<p;i+=1)r.push(t[i*n]);return[r[0]].concat(r,[r[r.length-1]])}}return u};function sY(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 lY(e){var t,n=e.cm,r=e.defaults,i=e.index,o=e.input,a=e.pic;if(!o||!o.on)return null;var s=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===s?function(e,t,n){var r=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(r=e.resolveUIColor(t.paletteColor)),FU(FU({},n),{},{mode:"constant",type:"constant",primary:r})}(n,o,r):"byExpression"===s?function(e,t,n){var r="qMeasureInfo/".concat(e,"/"),i=t.field((function(e){return e.id().startsWith(r)&&"colorByMeasureExpression"===e.raw().id})),o=i;return FU(FU({},n),{},o?{mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(i,a,r):null}function uY(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function cY(e,t){for(var n=(null==t?void 0:t.domain)||[],r=(null==t?void 0:t.range)||[],i=[],o=0;o<e.length;++o){var a=e[o];if("constant"===(null==a?void 0:a.mode)){var s=n.indexOf(o);-1===s?(n.push(o),r.push(a.primary)):r[s]=a.primary,e[o]=null}else if(a){i.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),r.splice(l,1))}}return{domain:n,range:r,exclude:i}}function dY(e,t,n,r){var i,o=function(e,t,n,r){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var r=t.theme,i=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?sY:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),u=aY(0,{theme:r,hc:i},n,{f:l});if(u.invalid)return u;("expression"===s.type||s.activeMeasureIndex<0)&&(u.label=s.label,l&&"color.altLabel"===l.raw().labelExpRef&&(u.label=n.input.altLabel)),!u.label&&l&&(u.label=l.title());var c=s.activeMeasureIndex>=0?l:null;if(!c&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(c=n.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===s.type)if(c){var d=c.raw().coloring;d&&d.gradient&&i$(u,iY(e,d.gradient,u,c))}else u.auxiliary=s;return u}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.getCDef,o=void 0===i?l$:i,a=r.getCByField,s=void 0===a?u$:a,l=r.getPersistence,u=void 0===l?s$:l,c=o(t,n),d=s(n,c),f=d?d.raw():{},p=n&&n.pic?n.pic.raw():{};if(f.qError||f.qSize&&0===f.qSize.qcy&&!p.qHasOtherValues)return{invalid:!0};var h={mode:"field",fieldType:"dimension",type:"categorical",field:d?d.key():void 0,isFieldLocked:f.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(h.label=c.label,"color.altLabel"===f.labelExpRef&&(h.label=n.input.altLabel)),!h.label&&d&&(h.label=d.title()),n.input.dimensionScheme&&(h.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===c.type&&(h.auxiliary=c),i$(h,u(t,n,c,d,{byRow:a$,byElemNo:o$})),h}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!s||!s.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:r.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=aY(0,{hc:i,theme:o},n,{f:s});return l.invalid||(l.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,r);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&i.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],u=[];"measure"===n.input.useBaseColors&&i.qMeasureInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?u.push(r.primary):u.push(i)}}));var c=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,d=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&d&&(c={categorical:d.key}),{mode:"measure",type:"categorical",palettes:c,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:u}:void 0}}if("dimension"===s){var f=[],p=[];return i.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){f.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?p.push(r.primary):p.push(i)}})),{mode:"dimension",type:"categorical",field:f.length?f[0]:void 0,explicit:f.length?{domain:f,range:p}:void 0}}var h=r.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(h=e.resolveUIColor(n.input.paletteColor));else{var m=n.input.singleColor;"number"!=typeof m||Number.isNaN(m)||(h=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][m])}return{mode:"constant",type:"constant",primary:h}}(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 lY({cm:e,input:n,defaults:r,index:i,pic:t.pic})})),function(e,t){var n,r,i,o=t.translator;if(uY(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=cY(e.measureOverrides,e.explicit),uY(e)),null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=cY(e.measureOverrides),a}return null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}function fY(e){var t=FU({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(i$(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=i$(!0,{},n.input,o,{auto:!1});var a=t.theme?t.theme.getDataColorPalettes():[];a[0]&&(n.input.dimensionScheme=a[0].key);var s=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(s=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[s]&&t.hc.qDimensionInfo[s].coloring&&t.hc.qDimensionInfo[s].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(i=n.input.measureOverrides)&&void 0!==i&&i.every((function(e){return!e||!e.on}))&&(n.input=i$(!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||{},o=i.key;if("measure"===e.fieldType)return r.getMeasure(o,t).catch((function(){}));if("dimension"===e.fieldType){var a="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?r.getAttributeDimension(a,t).catch((function(){})):Promise.resolve(),o?r.getDimensionColorMap(o,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 iY(i,r.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var a={nil:e.nil,others:e.others},s=r[0],l=r[1]?r[1].colorMap:null;if(s){var u=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:s,qInterColumnSortOrder:[0,1],qMode:"S"}});a.legendDataset=u}return l?function(e,t,n,r){var i=r.external,o=r.field,a=FU({},e);i$(a,o$(o,o.raw().qCardinal));var s=i.theme?i.theme.getDataColorPalettes()[0]:null;return t.nul&&(a.nil=n.resolveUIColor(t.nul)),t.oth&&(a.others=n.resolveUIColor(t.oth)),t.usePal?(a.palettes={categorical:t.pal},s&&!t.pal&&(a.palettes.categorical=s.key,i$(a,o$(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),i$(a,o$(o))),t.colors&&t.colors.length&&(a.explicit=function(e,t,n){for(var r={},i=0;i<e.length;i+=1)r[e[i].value]=e[i].baseColor;var o=[];return{domain:function(e){var i=e.data,a=[];o=[];for(var s=0;s<i.items.length;s++){var l=i.items[s],u=(l.text||l).label;r[u]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(t.resolveUIColor(r[u])))}return a.push(-3,-2),o.push(n.others),o.push(n.nil),a},range:function(){return o}}}(t.colors,n,a)),a}(a,l,i,{external:t,field:n.pic.field(e.field)}):a}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!n.uiPalette)return e.color;var t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},r=t.theme;r&&(e=FU(FU({},e),r.getDataColorSpecials())),n.settings=i$(e,dY(this,n,t,e))}return n.settings}};return i}var pY=function(e,t){var n=e.fieldType,r={};if(t)if("measure"===n){var i=t.coloring;i&&(r.measureGradient=i.gradient)}else if("dimension"===n){var o=t[0],a=t[1];o&&(r.legendDataPage=o),a&&(r.dimValsData=a.colorMap)}return r},hY=function(e){throw e.isHandled=!0,e},mY=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()},gY=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()},vY=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(hY):Promise.reject()};function yY(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}function bY(e){return function(t){return"object"===HU(t.datum[e])?t.datum[e].value:void 0}}function xY(e){return"object"===HU(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function wY(e){return-3===e.datum.value}var kY=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"},CY=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 SY(e,t){var n=e.styleReference,r=e.chart,i=e.rtl,o=t.legendProps,a=t.coloring,s=t.theme,l=t.hc;return{layout:{minimumLayoutMode:"MEDIUM",dock:kY(o,r,i)},show:"function"==typeof o.show?function(){return CY(o,l,a)}:CY(o,l,a),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==o.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:a.label||"",fill:s?s.getStyle(n,"legend.title","color"):void 0,fontSize:s?s.getStyle(n,"legend.title","fontSize"):"16px",fontFamily:s?s.getStyle(n,"legend.title","fontFamily"):"'Source Sans Pro', 'Arial', 'sans-serif'"}}}}function EY(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var r=SY(e,t);if(!r.show)return!1;var i,o=e.key,a=e.styleReference,s=e.viewState,l=e.rtl,u=e.settings,c=e.style,d=t.scaleKey,f=t.theme,p=t.scales,h=r.layout.dock,m="left"===h||"right"===h?{maxLines:3,wordBreak:"break-word"}:{},g={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 v="".concat(d,"Legend");return i$(!0,r,{type:"legend-cat",key:"".concat(o,"-cat"),scale:v in p?v:d,settings:{layout:{scrollOffset:function(){return s?s.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(r.layout.dock)?2:1,direction:l?"rtl":"ltr",horizontal:20},item:{show:i,label:FU({fill:f?f.getStyle(a,"legend.label","color"):void 0,fontSize:f?f.getStyle(a,"legend.label","fontSize"):void 0,fontFamily:f?f.getStyle(a,"legend.label","fontFamily"):"'Source Sans Pro', 'Arial', 'sans-serif'"},m)},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:g[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:u,style:c})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n=e.key,r=e.styleReference,i=e.rtl,o=e.settings,a=e.style,s=t.scaleKey,l=t.theme,u=SY(e,t);return!!u.show&&i$(!0,u,{type:"legend-seq",key:"".concat(n,"-seq"),settings:{fill:s,major:"".concat(s,"Range"),length:1,tick:{fill:l?l.getStyle(r,"legend.label","color"):void 0,fontSize:l?l.getStyle(r,"legend.label","fontSize"):void 0,fontFamily:l?l.getStyle(r,"legend.label","fontFamily"):"'Source Sans Pro', 'Arial', 'sans-serif'"},title:{anchor:!i||"top"!==u.layout.dock&&"bottom"!==u.layout.dock?void 0:"right",padding:parseFloat(u.settings.title.fontSize)||16}}},{settings:o,style:a})}(e,t)}function MY(e,t,n){var r=[],i=[],o=EY(e,t,n&&n.navigationDisabled);return r.push(o),o&&"legend-cat"===o.type&&(i.push(function(e){var t=e.key,n=e.requireFailure,r=e.recognizeWith,i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var r;if(!n)return!0;if(null!=i&&null!==(r=i.interact)&&void 0!==r&&r.enabled&&!i.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),i.push(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.eventName,r=t.key,i=t.requireFailure,o=t.recognizeWith,a=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(r),type:"Pan",requireFailure:i,recognizeWith:o,options:{event:n,pointers:1,threshold:10,enable:function(e,t){var i;return this.started===n||!t||!(null!=a&&null!==(i=a.interact)&&void 0!==i&&i.enabled&&!a.interact.enabled())&&this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}).some((function(e){return e.key==="".concat(r,"-cat")}))}},events:(e={},WU(e,"".concat(n,"start"),(function(e){e.preventDefault(),this.started!==n&&(this.started=n,this.chart.component("".concat(r,"-cat")).emit("panstart",e))})),WU(e,"".concat(n,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panmove",e)})),WU(e,"".concat(n,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panend",e),this.started=!1})),e)}}(e,n))),{interactions:i,components:r}}var TY=function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")};function DY(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=fY(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(e,t){var n=t.layout,r=t.app;return mY(e,{layout:n,app:r})})).getMeasure((function(e,t){var n=t.layout,r=t.app;return gY(e,{layout:n,app:r})})).getAttributeDimension((function(e,t){var n=t.layout,r=t.model,i=t.app;return vY(e,{layout:n,model:r,app:i})}));return n.getSnapshotData=pY,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=FU({},i),r={},!n.key)throw new Error("Missing key");t.set(FU(FU({},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=FU(FU({},r.settings),r.auxiliarySettings),r.scales=void 0,r.color=void 0,r.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(i())},getSnapshotData:function(e){var n=i();return t.getAuxiliaryData(n,e).then((function(e){return t.getSnapshotData(n,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=i();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=i().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(i(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,r=e.theme,i=[];if(n&&n.palettes&&r){var o=n.palettes.categorical||t.dimensionScheme,a=r.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||r.getDataColorPalettes()[0];o&&a&&i.push({key:"categorical",colors:a.colors});var s=n.palettes.metric||t.measureScheme,l=r.getDataColorScales().filter((function(e){return e.key===s}))[0];if(l){var u=l.colors[0]?l.colors:[[]].concat(YU(l.colors.slice(1)));u=Array.isArray(u[0])?u.map((function(e){return e.slice().reverse()})):u.slice().reverse(),i.push({key:"quant",colors:u})}}return i}({coloring:i(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return r.scales=r.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,r=e.rtl,i=e.key,o=e.source,a=e.picasso,s={},l=i;if(n){var u={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(YU((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(YU((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var c,d=yY({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var f=0,p={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return p[t]=f++,e[0]}}),c={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return p[e.qElemNumber]}}}}}}var h={data:d,range:n.range,domain:n.domain,explicit:u,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};s[l]=h,c&&(s["".concat(l,"Legend")]=FU(FU({},h),{},{data:c})),t&&t.qHasOtherValues&&c&&((c||h.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var m={data:{field:n.field},min:n.min,max:n.max};s[l]=i$({},m,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=i$({},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:u,type:"categorical-color"};s[l]=g}else if("measure"===n.mode){var v={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t,r;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(r=t.exclude)&&void 0!==r&&r.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=v}}return s}({hc:n.hc,coloring:i(),key:n.key,source:n.source,picasso:e.picasso}),r.scales},color:function(){return r.color=r.color||function(e){var t=e.coloring,n=e.scales,r=e.key,i=bY(r),o=bY("".concat(r,"IsAnOther")),a=function(e,t){var r=e.fieldType,a=e.invalid,s=e.mode,l=e.nil,u=e.others,c=e.primary,d=e.type;return a?function(e){return wY(e)||o(e)?u:l}:n[t]?function(e){return wY(e)?u:xY(e)||-2===i(e)&&"dimension"===r||"NaN"===i(e)?l:o(e)?u:e.resources.scale(t)(i(e))||u}:"constant"===s?function(e){return wY(e)||o(e)?u:xY(e)?l:c}:"color"===d?function(e){return wY(e)||o(e)?u:xY(e)?l:i(e)||u}:null},s=a(t,r);if(t.measureOverrides){var l=bY("".concat(r,"MeasureIdx")),u=t.measureOverrides.map((function(e){return e&&a(e)}));return function(e){var t=l(e);return u[t]?u[t](e):s(e)}}return s}({coloring:i(),scales:this.scales(),key:n.key}),r.color},datumProps:function(e){return function(e){var t,n,r=e.hc,i=e.coloring,o=e.scales,a=e.key,s=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=a,c=i.nil;"field"===i.mode&&i.field?t=i.field:o[a]&&"field"===i.mode&&(t=o[a].data.field||i.field),t?(n={field:t,reduce:"first"},"color"===i.type&&(n.value=function(e){return"NaN"!==e.qNum?TY(e.qNum):e.qText&&T$(e.qText)?e.qText:c})):"dimension"===i.mode?n=void 0!==i.field?i.field:r.qDimensionInfo.length-1:"measure"===i.mode&&(n=l);var d=WU({},u,n);return r.qDimensionInfo.length>1&&(d["".concat(u,"IsAnOther")]={fields:r.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),s&&(d["".concat(u,"MeasureIdx")]=l),d}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:i().measureOverrides},e)},data:function(){var e=i(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,r=e.key,o=e.viewState,a=e.chart,s=e.rtl,l=e.styleReference,u=void 0===l?"object.legend":l,c=e.settings,d=void 0===c?{}:c,f=e.style,p=void 0===f?{}:f,h=arguments.length>1?arguments[1]:void 0;return MY({eventName:t,key:r,rtl:s,viewState:o,chart:a,styleReference:u,settings:d,style:p},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},h)}};return o}var _Y=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function NY(e){var t=e.qHyperCube,n=t.qDimensionInfo,r=t.qMeasureInfo,i=n.some(_Y),o=r.some(_Y),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!i?"off":a}function qY(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=FU(FU(FU({},e),t),{},{colorProps:FU(FU({},e.colorProps),t.colorProps||{})});return n}var RY=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function PY(e){var t,n=e.qHyperCube.qDimensionInfo.some(RY),r=e.qHyperCube.qMeasureInfo.some(RY),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 AY=function(){};function IY(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}function OY(e,t,n){if(void 0!==e&&void 0!==t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0===o[s]&&(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}}function LY(){var e={};return{get:function(t){return e[t]},set:function(t,n){return e[t]=n,n},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}function zY(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return function(){for(var r=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var s=function(){return e.apply(r,o)};clearTimeout(t),t=setTimeout(s,n)}}function FY(e){var t=e.originalArray,n=e.newArray,r=e.matchKey;return Array.isArray(t)&&t.length?(n.forEach((function(e){var n=-1;t.some((function(t,i){return t[r]&&t[r]===e[r]&&(n=i),n})),n>-1?t[n]=e:t.push(e)})),t):n}function jY(e){return(jY="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function HY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BY(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function VY(e,t,n){return t&&BY(e.prototype,t),n&&BY(e,n),e}function WY(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UY(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 $Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?UY(Object(n),!0).forEach((function(t){WY(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UY(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function YY(e,t){return(YY=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function XY(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function KY(e,t,n){return(KY=XY()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&YY(i,n.prototype),i}).apply(null,arguments)}function GY(e){return function(e){if(Array.isArray(e))return ZY(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||JY(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 JY(e,t){if(e){if("string"==typeof e)return ZY(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)?ZY(e,t):void 0}}function ZY(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var QY=Object.prototype.hasOwnProperty,eX=Object.prototype.toString,tX=Object.defineProperty,nX=Object.getOwnPropertyDescriptor,rX=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===eX.call(e)},iX=function(e){if(!e||"[object Object]"!==eX.call(e))return!1;var t,n=QY.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&QY.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||QY.call(e,t)},oX=function(e,t){tX&&"__proto__"===t.name?tX(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},aX=function(e,t){if("__proto__"===t){if(!QY.call(e,t))return;if(nX)return nX(e,t).value}return e[t]},sX=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=aX(s,n),s!==(i=aX(t,n))&&(c&&i&&(iX(i)||(o=rX(i)))?(o?(o=!1,a=r&&rX(r)?r:[]):a=r&&iX(r)?r:{},oX(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&oX(s,{name:n,newValue:i}));return s};function lX(e,t,n){if(!e)return-1;var r=n.cache,i=e.origin?e.origin():null;i&&(e=i);var o=r.fields.indexOf(e),a=-1,s=-1;if(-1===o)for(var l=0;l<r.wrappedFields.length;l++)if(s=r.wrappedFields[l].attrDims.map((function(e){return e.instance})).indexOf(e),a=r.wrappedFields[l].attrExps.map((function(e){return e.instance})).indexOf(e),-1!==s||-1!==a){o=l;break}return(o-=t.qArea.qLeft)<0||o>=t.qArea.qWidth?-1:s>=0?function(e){return e[o].qAttrDims.qValues[s]}:a>=0?function(e){return e[o].qAttrExps.qValues[a]}:function(e){return e[o]}}function uX(e,t,n){var r=n.key,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 cX(e){var t=e.cache,n=e.f,r=e.mainCell,i=e.p;e.prop;var o=e.page,a=e.rowIdx,s=e.row,l=e.sourceKey,u=e.target,c=e.targetProp,d=r;if(i.field&&i.field!==n){var f=lX(i.field,o,{cache:t});if(-1===f)return;d=sX({qRow:a},f(s))}u[c]=uX(i,d,{key:l})}function dX(e,t,n,r){for(var i=Array.isArray(e)?e:[e],o=[],a=0;a<i.length;a++)if(void 0!==i[a].field){for(var s=t.raw(),l=t.key(),u="object"===jY(i[a].field)?i[a].field:t.field(i[a].field),c=r.normalizeConfig(i[a],t),d=c.props,f=c.main,p=Object.keys(d),h=!!i[a].trackBy,m=jY(i[a].trackBy),g={},v=[],y=[],b=0;b<s.qDataPages.length;b++){var x=lX(u,s.qDataPages[b],{cache:n});if(-1!==x)for(var w=0;w<s.qDataPages[b].qMatrix.length;w++){var k=s.qDataPages[b].qArea.qTop+w,C=sX({qRow:k},x(s.qDataPages[b].qMatrix[w])),S=uX(f,C,{key:l});if(!f.filter||f.filter(C)){for(var E=0;E<p.length;E++){var M=d[p[E]],T=M.fields||[M];M.fields&&(S[p[E]]=[]);for(var D=0;D<T.length;D++)cX({cache:n,f:u,mainCell:C,p:T[D],prop:p[E],props:d,page:s.qDataPages[b],rowIdx:k,row:s.qDataPages[b].qMatrix[w],sourceKey:l,target:M.fields?S[p[E]]:S,targetProp:M.fields?D:p[E]});if(M.fields){var _=S[p[E]].map((function(e){return e.value})),N=S[p[E]].map((function(e){return e.label}));S[p[E]]={value:"function"==typeof M.value?M.value(_):void 0!==M.value?M.value:_,label:"function"==typeof M.label?M.label(N):void 0!==M.label?String(M.label):String(S[p[E]].value)}}}h&&r.track({cfg:i[a],itemData:C,obj:S,target:v,tracker:g,trackType:m}),y.push(S)}}}h?o.push.apply(o,GY(r.collect(v,{main:f,propsArr:p,props:d}))):o.push.apply(o,y)}return o}function fX(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 pX(e,t){var n,r,i,o,a,s=new vX(e),l=+e.value&&(s.value=e.value),u=[s];for(null==t&&(t=hX);n=u.pop();)if(l&&(n.value=+n.data.value),(i=t(n.data))&&(a=i.length))for(n.children=new Array(a),o=a-1;o>=0;--o)u.push(r=n.children[o]=new vX(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(gX)}function hX(e){return e.children}function mX(e){e.data=e.data.data}function gX(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function vX(e){this.data=e,this.depth=this.height=0,this.parent=null}function yX(e){if("function"!=typeof e)throw new Error;return e}vX.prototype=pX.prototype={constructor:vX,count:function(){return this.eachAfter(fX)},each:function(e){var t,n,r,i,o=this,a=[o];do{for(t=a.reverse(),a=[];o=t.pop();)if(e(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length);return this},eachAfter:function(e){for(var t,n,r,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n]);for(;i=a.pop();)e(i);return this},eachBefore:function(e){for(var t,n,r=this,i=[r];r=i.pop();)if(e(r),t=r.children)for(n=t.length-1;n>=0;--n)i.push(t[n]);return this},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(){var e=[];return this.each((function(t){e.push(t)})),e},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return pX(this).eachBefore(mX)}};var bX={depth:-1},xX={};function wX(e){return e.id}function kX(e){return e.parentId}function CX(e,t){"/"===e.charAt(0)&&(e=e.substring(1));for(var n,r=e.split("/"),i=t,o=0;o<r.length;o++){if("*"===r[o]&&Array.isArray(i)){var a=[];n=r.slice(o+1).join("/");for(var s=0;s<i.length;s++){var l=CX(n,i[s]);Array.isArray(l)?a.push.apply(a,GY(l)):a.push(l)}return a}if(!r[o]&&Array.isArray(i)){var u=new Array(i.length);n=r.slice(o+1).join("/");for(var c=0;c<i.length;c++)u[c]=CX(n,i[c]);return u}r[o]in i&&(i=i[r[o]])}return i}function SX(e,t,n){var r=[];if(!e||!e.length)return r;if(t<=0){var i=n>=0?[e[n]]:e;r.push.apply(r,GY(i))}else for(var o=0;o<e.length;o++)e[o].children&&e[o].children.length&&r.push.apply(r,GY(SX(e[o].children,t-1,n)));return r}function EX(e,t,n){if(e===t)return function(e){return e};if(e>t){var r=Math.max(0,Math.min(100,e-t)),i=GY(Array(r)).map(String.prototype.valueOf,"parent").join(".");return Function("node","return node.".concat(i,";"))}if(t>e){var o=Math.max(0,Math.min(100,t-e));return function(e){return SX(e.children,o-1,n)}}return!1}function MX(e,t){var n=t.cache;if("number"==typeof e)return n.fields[e];var r=n.allFields;if("function"==typeof e){for(var i=0;i<r.length;i++)if(e(r[i]))return r[i];return!1}if("string"==typeof e){for(var o=0;o<r.length;o++)if(r[o].key()===e||r[o].title()===e)return r[o]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}var TX=/^qDimensionInfo(?:\/(\d+))?/,DX=/^\/?qMeasureInfo\/(\d+)/,_X=/\/qAttrExprInfo\/(\d+)/,NX=/\/qAttrDimInfo\/(\d+)/;function qX(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((function(e,t){return t}))).filter((function(t){return t<e.qDimensionInfo.length}))}function RX(e,t){var n=t.cube;if(!e)return-1;var r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,u=-1,c=r,d=n.qEffectiveInterColumnSortOrder,f=qX(n);return TX.test(c)&&(i=!0,o=+TX.exec(c)[1],c=r.replace(TX,"")),DX.test(c)&&("K"===n.qMode?l=+DX.exec(c)[1]:d&&-1!==d.indexOf(-1)?(l=+DX.exec(c)[1],u=0):u=+DX.exec(c)[1],c=c.replace(DX,"")),c&&(NX.exec(c)?s=+NX.exec(c)[1]:_X.exec(c)&&(a=+_X.exec(c)[1])),{fieldDepth:(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))+1,pseudoMeasureIndex:l,measureIdx:u,attrDimIdx:s,attrIdx:a}}function PX(e,t){var n,r,i=EX(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?function(e){return e.data.qValues[t.measureIdx]}:function(e){return e.data},t.attrDimIdx>=0?r=function(e){var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=function(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 AX(e,t,n){var r=n.key,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 IX(e){for(var t=e.propsArr,n=e.props,r=e.item,i=e.itemData,o=e.ret,a=e.sourceKey,s=0;s<t.length;s++){var l=n[t[s]],u=l.fields||[l],c=void 0,d=void 0;l.fields&&(c=[],d=[]);for(var f=function(e){var n=u[e],f=void 0,p=void 0,h=void 0,m=void 0,g=void 0,v=void 0;if("primitive"===n.type?(h=n.value,v=String(n.value)):("function"==typeof n.value&&(f=function(e){return n.value(e,r)}),"function"==typeof n.label&&(p=function(e){return n.label(e,r)}),n.accessor?(m=n.accessor(r),Array.isArray(m)?(g=m.map(n.valueAccessor),n.attrAccessor&&(g=g.map(n.attrAccessor)),f&&(h=g.map(f),f=null),p&&(v=g.map(p),p=null),h=n.reduce?n.reduce(h):h,v=n.reduceLabel?n.reduceLabel(v,h):String(h)):v=h=n.attrAccessor?n.attrAccessor(n.valueAccessor(m)):n.valueAccessor(m)):(h=i,v=i)),l.fields){var y=f?f(h):h;c.push(y),d.push(p&&null!=v?p(v):null!=v?v:String(y))}else{var b=f?f(h):h;o[t[s]]={value:b,label:p?p(v):null!=v?v:String(b)},n.field&&(o[t[s]].source={field:n.field.key(),key:a})}},p=0;p<u.length;p++)f(p);c&&(o[t[s]]={value:"function"==typeof l.value?l.value(c,r):c,label:"function"==typeof l.label?l.label(d,r):d})}}var OX=function(e,t,n){var r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=CX(r,e);return o&&o[0]?(t.tree=pX(o[0],n.children||function(e){return e[i]}),t.tree):null};function LX(e){for(var t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){var t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((function(e,t){return t}))}(e),r=e.fields(),i=e.fields().filter((function(e){return"dimension"===e.type()})).map((function(e){return n.indexOf(r.indexOf(e))})),o=e.fields().filter((function(e){return"measure"===e.type()})).map((function(e){return n.indexOf(r.indexOf(e))})),a={__root:{__id:"__root",qValues:[]}},s=0;s<t.length;s++){for(var l=t[s],u="__root",c=!1,d=0;d<i.length;d++){var f=l[i[d]],p="".concat(u,"__").concat(f.qText);a[p]||(a[p]=$Y({__id:p,__parent:u,qValues:[]},f),c=!0),u=p}if(c)for(var h=0;h<o.length;h++){var m=l[o[h]];a[u].qValues.push(m)}}var g=Object.keys(a).map((function(e){return a[e]}));return function(){var e=wX,t=kX;function n(n){var r,i,o,a,s,l,u,c=n.length,d=new Array(c),f={};for(i=0;i<c;++i)r=n[i],s=d[i]=new vX(r),null!=(l=e(r,i,n))&&(l+="")&&(f[u="$"+(s.id=l)]=u in f?xX:s);for(i=0;i<c;++i)if(s=d[i],null!=(l=t(n[i],i,n))&&(l+="")){if(!(a=f["$"+l]))throw new Error("missing: "+l);if(a===xX)throw new Error("ambiguous: "+l);a.children?a.children.push(s):a.children=[s],s.parent=a}else{if(o)throw new Error("multiple roots");o=s}if(!o)throw new Error("no root");if(o.parent=bX,o.eachBefore((function(e){e.depth=e.parent.depth+1,--c})).eachBefore(gX),o.parent=null,c>0)throw new Error("cycle");return o}return n.id=function(t){return arguments.length?(e=yX(t),n):e},n.parentId=function(e){return arguments.length?(t=yX(e),n):t},n}().id((function(e){return e.__id})).parentId((function(e){return e.__parent}))(g)}var zX=function(e){for(var t=e.propsArr,n=e.props,r=e.cube,i=e.cache,o=e.itemDepthObject,a=e.f,s=0;s<t.length;s++)for(var l=n[t[s]],u=l.fields?l.fields:[l],c=0;c<u.length;c++){var d=u[c];if(d.field!==a){var f=PX(o,RX(d.field,{cube:r,cache:i}));d.accessor=f.nodeFn,d.valueAccessor=f.valueFn,d.attrAccessor=f.attrFn}}};function FX(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=t.raw(),o=t.key(),a="S"===i.qMode?LX(t):OX(i,n,e);if(!a)return null;for(var s=a.height,l=[],u=0;u<=s;u++){var c=null;if(u>0)if("S"===i.qMode){var d=qX(i),f=d[u-1];c=n.fields[f]}else{var p=i.qEffectiveInterColumnSortOrder[u-1];u>i.qEffectiveInterColumnSortOrder.length&&(p=i.qDimensionInfo.length),c=n.fields[p]}var h=r.normalizeConfig($Y($Y({},e),{},{field:c?c.key():void 0}),t),m=h.props,g=h.main,v=Object.keys(m);l[u]={propsArr:v,props:m,main:g};var y=c?RX(c,{cube:i,cache:n}):{fieldDepth:0};zX({propsArr:v,props:m,cube:i,cache:n,itemDepthObject:y,f:c})}for(var b=a.copy(),x=b.descendants(),w=a.descendants(),k=0;k<w.length;k++){var C=l[w[k].depth].propsArr,S=l[w[k].depth].props,E=l[w[k].depth].main,M=x[k],T=M.data,D=AX(E,T,{key:o});IX({propsArr:C,props:S,item:M,itemData:T,ret:D,sourceKey:o,isTree:!0}),w[k].data=D}return a}function jX(e,t,n,r){for(var i=Array.isArray(e)?e:[e],o=[],a=0;a<i.length;a++)if(void 0!==i[a].field){var s=t.raw(),l=t.key();if(!OX(s,n,e))continue;var u="object"===jY(i[a].field)?i[a].field:t.field(i[a].field),c=r.normalizeConfig(i[a],t),d=c.props,f=c.main,p=Object.keys(d),h=RX(u,{cube:s,cache:n}),m=PX({fieldDepth:0},h),g=m.nodeFn,v=m.attrFn,y=m.valueFn;zX({propsArr:p,props:d,cube:s,cache:n,itemDepthObject:h,f:u});for(var b=!!i[a].trackBy,x=jY(i[a].trackBy),w={},k=[],C=g(n.tree),S=[],E=0;E<C.length;E++){var M=C[E],T=v?v(y(M)):y(M);if(!f.filter||f.filter(T)){var D=AX(f,T,{key:l});IX({propsArr:p,props:d,item:M,itemData:T,ret:D,sourceKey:l}),b&&r.track({cfg:i[a],itemData:T,obj:D,target:k,tracker:w,trackType:x}),S.push(D)}}b?o.push.apply(o,GY(r.collect(k,{main:f,propsArr:p,props:d}))):o.push.apply(o,S)}return o}var HX,BX=(function(e){
|
|
85
|
+
*/var aB=iB&&window.Promise?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then((function(){t=!1,e()})))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout((function(){t=!1,e()}),oB))}};function sB(e){return e&&"[object Function]"==={}.toString.call(e)}function lB(e,t){if(1!==e.nodeType)return[];var n=e.ownerDocument.defaultView.getComputedStyle(e,null);return t?n[t]:n}function uB(e){return"HTML"===e.nodeName?e:e.parentNode||e.host}function cB(e){if(!e)return document.body;switch(e.nodeName){case"HTML":case"BODY":return e.ownerDocument.body;case"#document":return e.body}var t=lB(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/(auto|scroll|overlay)/.test(n+i+r)?e:cB(uB(e))}function dB(e){return e&&e.referenceNode?e.referenceNode:e}var fB=iB&&!(!window.MSInputMethodContext||!document.documentMode),pB=iB&&/MSIE 10/.test(navigator.userAgent);function hB(e){return 11===e?fB:10===e?pB:fB||pB}function mB(e){if(!e)return document.documentElement;for(var t=hB(10)?document.body:null,n=e.offsetParent||null;n===t&&e.nextElementSibling;)n=(e=e.nextElementSibling).offsetParent;var r=n&&n.nodeName;return r&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===lB(n,"position")?mB(n):n:e?e.ownerDocument.documentElement:document.documentElement}function gB(e){return null!==e.parentNode?gB(e.parentNode):e}function vB(e,t){if(!(e&&e.nodeType&&t&&t.nodeType))return document.documentElement;var n=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?e:t,i=n?t:e,o=document.createRange();o.setStart(r,0),o.setEnd(i,0);var a,s,l=o.commonAncestorContainer;if(e!==l&&t!==l||r.contains(i))return"BODY"===(s=(a=l).nodeName)||"HTML"!==s&&mB(a.firstElementChild)!==a?mB(l):l;var u=gB(e);return u.host?vB(u.host,t):vB(e,gB(t).host)}function yB(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===t?"scrollTop":"scrollLeft",r=e.nodeName;if("BODY"===r||"HTML"===r){var i=e.ownerDocument.documentElement,o=e.ownerDocument.scrollingElement||i;return o[n]}return e[n]}function bB(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=yB(t,"top"),i=yB(t,"left"),o=n?-1:1;return e.top+=r*o,e.bottom+=r*o,e.left+=i*o,e.right+=i*o,e}function xB(e,t){var n="x"===t?"Left":"Top",r="Left"===n?"Right":"Bottom";return parseFloat(e["border"+n+"Width"],10)+parseFloat(e["border"+r+"Width"],10)}function wB(e,t,n,r){return Math.max(t["offset"+e],t["scroll"+e],n["client"+e],n["offset"+e],n["scroll"+e],hB(10)?parseInt(n["offset"+e])+parseInt(r["margin"+("Height"===e?"Top":"Left")])+parseInt(r["margin"+("Height"===e?"Bottom":"Right")]):0)}function kB(e){var t=e.body,n=e.documentElement,r=hB(10)&&getComputedStyle(n);return{height:wB("Height",t,n,r),width:wB("Width",t,n,r)}}var CB=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},SB=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),EB=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},MB=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function TB(e){return MB({},e,{right:e.left+e.width,bottom:e.top+e.height})}function DB(e){var t={};try{if(hB(10)){t=e.getBoundingClientRect();var n=yB(e,"top"),r=yB(e,"left");t.top+=n,t.left+=r,t.bottom+=n,t.right+=r}else t=e.getBoundingClientRect()}catch(e){}var i={left:t.left,top:t.top,width:t.right-t.left,height:t.bottom-t.top},o="HTML"===e.nodeName?kB(e.ownerDocument):{},a=o.width||e.clientWidth||i.width,s=o.height||e.clientHeight||i.height,l=e.offsetWidth-a,u=e.offsetHeight-s;if(l||u){var c=lB(e);l-=xB(c,"x"),u-=xB(c,"y"),i.width-=l,i.height-=u}return TB(i)}function _B(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=hB(10),i="HTML"===t.nodeName,o=DB(e),a=DB(t),s=cB(e),l=lB(t),u=parseFloat(l.borderTopWidth,10),c=parseFloat(l.borderLeftWidth,10);n&&i&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var d=TB({top:o.top-a.top-u,left:o.left-a.left-c,width:o.width,height:o.height});if(d.marginTop=0,d.marginLeft=0,!r&&i){var f=parseFloat(l.marginTop,10),p=parseFloat(l.marginLeft,10);d.top-=u-f,d.bottom-=u-f,d.left-=c-p,d.right-=c-p,d.marginTop=f,d.marginLeft=p}return(r&&!n?t.contains(s):t===s&&"BODY"!==s.nodeName)&&(d=bB(d,t)),d}function NB(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.ownerDocument.documentElement,r=_B(e,n),i=Math.max(n.clientWidth,window.innerWidth||0),o=Math.max(n.clientHeight,window.innerHeight||0),a=t?0:yB(n),s=t?0:yB(n,"left"),l={top:a-r.top+r.marginTop,left:s-r.left+r.marginLeft,width:i,height:o};return TB(l)}function qB(e){var t=e.nodeName;if("BODY"===t||"HTML"===t)return!1;if("fixed"===lB(e,"position"))return!0;var n=uB(e);return!!n&&qB(n)}function RB(e){if(!e||!e.parentElement||hB())return document.documentElement;for(var t=e.parentElement;t&&"none"===lB(t,"transform");)t=t.parentElement;return t||document.documentElement}function PB(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={top:0,left:0},a=i?RB(e):vB(e,dB(t));if("viewport"===r)o=NB(a,i);else{var s=void 0;"scrollParent"===r?"BODY"===(s=cB(uB(t))).nodeName&&(s=e.ownerDocument.documentElement):s="window"===r?e.ownerDocument.documentElement:r;var l=_B(s,a,i);if("HTML"!==s.nodeName||qB(a))o=l;else{var u=kB(e.ownerDocument),c=u.height,d=u.width;o.top+=l.top-l.marginTop,o.bottom=c+l.top,o.left+=l.left-l.marginLeft,o.right=d+l.left}}var f="number"==typeof(n=n||0);return o.left+=f?n:n.left||0,o.top+=f?n:n.top||0,o.right-=f?n:n.right||0,o.bottom-=f?n:n.bottom||0,o}function AB(e){return e.width*e.height}function IB(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf("auto"))return e;var a=PB(n,r,o,i),s={top:{width:a.width,height:t.top-a.top},right:{width:a.right-t.right,height:a.height},bottom:{width:a.width,height:a.bottom-t.bottom},left:{width:t.left-a.left,height:a.height}},l=Object.keys(s).map((function(e){return MB({key:e},s[e],{area:AB(s[e])})})).sort((function(e,t){return t.area-e.area})),u=l.filter((function(e){var t=e.width,r=e.height;return t>=n.clientWidth&&r>=n.clientHeight})),c=u.length>0?u[0].key:l[0].key,d=e.split("-")[1];return c+(d?"-"+d:"")}function OB(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=r?RB(t):vB(t,dB(n));return _B(n,i,r)}function LB(e){var t=e.ownerDocument.defaultView.getComputedStyle(e),n=parseFloat(t.marginTop||0)+parseFloat(t.marginBottom||0),r=parseFloat(t.marginLeft||0)+parseFloat(t.marginRight||0);return{width:e.offsetWidth+r,height:e.offsetHeight+n}}function zB(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function FB(e,t,n){n=n.split("-")[0];var r=LB(e),i={width:r.width,height:r.height},o=-1!==["right","left"].indexOf(n),a=o?"top":"left",s=o?"left":"top",l=o?"height":"width",u=o?"width":"height";return i[a]=t[a]+t[l]/2-r[l]/2,i[s]=n===s?t[s]-r[u]:t[zB(s)],i}function jB(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function HB(e,t,n){return(void 0===n?e:e.slice(0,function(e,t,n){if(Array.prototype.findIndex)return e.findIndex((function(e){return e[t]===n}));var r=jB(e,(function(e){return e[t]===n}));return e.indexOf(r)}(e,"name",n))).forEach((function(e){e.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=e.function||e.fn;e.enabled&&sB(n)&&(t.offsets.popper=TB(t.offsets.popper),t.offsets.reference=TB(t.offsets.reference),t=n(t,e))})),t}function BB(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=OB(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=IB(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=FB(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",e=HB(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function VB(e,t){return e.some((function(e){var n=e.name;return e.enabled&&n===t}))}function WB(e){for(var t=[!1,"ms","Webkit","Moz","O"],n=e.charAt(0).toUpperCase()+e.slice(1),r=0;r<t.length;r++){var i=t[r],o=i?""+i+n:e;if(void 0!==document.body.style[o])return o}return null}function UB(){return this.state.isDestroyed=!0,VB(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[WB("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function $B(e){var t=e.ownerDocument;return t?t.defaultView:window}function YB(e,t,n,r){var i="BODY"===e.nodeName,o=i?e.ownerDocument.defaultView:e;o.addEventListener(t,n,{passive:!0}),i||YB(cB(o.parentNode),t,n,r),r.push(o)}function XB(e,t,n,r){n.updateBound=r,$B(e).addEventListener("resize",n.updateBound,{passive:!0});var i=cB(e);return YB(i,"scroll",n.updateBound,n.scrollParents),n.scrollElement=i,n.eventsEnabled=!0,n}function KB(){this.state.eventsEnabled||(this.state=XB(this.reference,this.options,this.state,this.scheduleUpdate))}function GB(){var e,t;this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=(e=this.reference,t=this.state,$B(e).removeEventListener("resize",t.updateBound),t.scrollParents.forEach((function(e){e.removeEventListener("scroll",t.updateBound)})),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t))}function JB(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function ZB(e,t){Object.keys(t).forEach((function(n){var r="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&JB(t[n])&&(r="px"),e.style[n]=t[n]+r}))}var QB=iB&&/Firefox/i.test(navigator.userAgent);function eV(e,t,n){var r=jB(e,(function(e){return e.name===t})),i=!!r&&e.some((function(e){return e.name===n&&e.enabled&&e.order<r.order}));if(!i){var o="`"+t+"`",a="`"+n+"`";console.warn(a+" modifier is required by "+o+" modifier in order to work, be sure to include it before "+o+"!")}return i}var tV=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],nV=tV.slice(3);function rV(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=nV.indexOf(e),r=nV.slice(n+1).concat(nV.slice(0,n));return t?r.reverse():r}var iV="flip",oV="clockwise",aV="counterclockwise";function sV(e,t,n,r){var i=[0,0],o=-1!==["right","left"].indexOf(r),a=e.split(/(\+|\-)/).map((function(e){return e.trim()})),s=a.indexOf(jB(a,(function(e){return-1!==e.search(/,|\s/)})));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,u=-1!==s?[a.slice(0,s).concat([a[s].split(l)[0]]),[a[s].split(l)[1]].concat(a.slice(s+1))]:[a];return(u=u.map((function(e,r){var i=(1===r?!o:o)?"height":"width",a=!1;return e.reduce((function(e,t){return""===e[e.length-1]&&-1!==["+","-"].indexOf(t)?(e[e.length-1]=t,a=!0,e):a?(e[e.length-1]+=t,a=!1,e):e.concat(t)}),[]).map((function(e){return function(e,t,n,r){var i=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+i[1],a=i[2];if(!o)return e;if(0===a.indexOf("%")){var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=r}return TB(s)[t]/100*o}if("vh"===a||"vw"===a)return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o;return o}(e,i,t,n)}))}))).forEach((function(e,t){e.forEach((function(n,r){JB(n)&&(i[t]+=n*("-"===e[r-1]?-1:1))}))})),i}var lV={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var i=e.offsets,o=i.reference,a=i.popper,s=-1!==["bottom","top"].indexOf(n),l=s?"left":"top",u=s?"width":"height",c={start:EB({},l,o[l]),end:EB({},l,o[l]+o[u]-a[u])};e.offsets.popper=MB({},a,c[r])}return e}},offset:{order:200,enabled:!0,fn:function(e,t){var n=t.offset,r=e.placement,i=e.offsets,o=i.popper,a=i.reference,s=r.split("-")[0],l=void 0;return l=JB(+n)?[+n,0]:sV(n,o,a,s),"left"===s?(o.top+=l[0],o.left-=l[1]):"right"===s?(o.top+=l[0],o.left+=l[1]):"top"===s?(o.left+=l[0],o.top-=l[1]):"bottom"===s&&(o.left+=l[0],o.top+=l[1]),e.popper=o,e},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var n=t.boundariesElement||mB(e.instance.popper);e.instance.reference===n&&(n=mB(n));var r=WB("transform"),i=e.instance.popper.style,o=i.top,a=i.left,s=i[r];i.top="",i.left="",i[r]="";var l=PB(e.instance.popper,e.instance.reference,t.padding,n,e.positionFixed);i.top=o,i.left=a,i[r]=s,t.boundaries=l;var u=t.priority,c=e.offsets.popper,d={primary:function(e){var n=c[e];return c[e]<l[e]&&!t.escapeWithReference&&(n=Math.max(c[e],l[e])),EB({},e,n)},secondary:function(e){var n="right"===e?"left":"top",r=c[n];return c[e]>l[e]&&!t.escapeWithReference&&(r=Math.min(c[n],l[e]-("right"===e?c.width:c.height))),EB({},n,r)}};return u.forEach((function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";c=MB({},c,d[t](e))})),e.offsets.popper=c,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,n=t.popper,r=t.reference,i=e.placement.split("-")[0],o=Math.floor,a=-1!==["top","bottom"].indexOf(i),s=a?"right":"bottom",l=a?"left":"top",u=a?"width":"height";return n[s]<o(r[l])&&(e.offsets.popper[l]=o(r[l])-n[u]),n[l]>o(r[s])&&(e.offsets.popper[l]=o(r[s])),e}},arrow:{order:500,enabled:!0,fn:function(e,t){var n;if(!eV(e.instance.modifiers,"arrow","keepTogether"))return e;var r=t.element;if("string"==typeof r){if(!(r=e.instance.popper.querySelector(r)))return e}else if(!e.instance.popper.contains(r))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var i=e.placement.split("-")[0],o=e.offsets,a=o.popper,s=o.reference,l=-1!==["left","right"].indexOf(i),u=l?"height":"width",c=l?"Top":"Left",d=c.toLowerCase(),f=l?"left":"top",p=l?"bottom":"right",h=LB(r)[u];s[p]-h<a[d]&&(e.offsets.popper[d]-=a[d]-(s[p]-h)),s[d]+h>a[p]&&(e.offsets.popper[d]+=s[d]+h-a[p]),e.offsets.popper=TB(e.offsets.popper);var m=s[d]+s[u]/2-h/2,g=lB(e.instance.popper),v=parseFloat(g["margin"+c],10),y=parseFloat(g["border"+c+"Width"],10),b=m-e.offsets.popper[d]-v-y;return b=Math.max(Math.min(a[u]-h,b),0),e.arrowElement=r,e.offsets.arrow=(EB(n={},d,Math.round(b)),EB(n,f,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(e,t){if(VB(e.instance.modifiers,"inner"))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var n=PB(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),r=e.placement.split("-")[0],i=zB(r),o=e.placement.split("-")[1]||"",a=[];switch(t.behavior){case iV:a=[r,i];break;case oV:a=rV(r);break;case aV:a=rV(r,!0);break;default:a=t.behavior}return a.forEach((function(s,l){if(r!==s||a.length===l+1)return e;r=e.placement.split("-")[0],i=zB(r);var u=e.offsets.popper,c=e.offsets.reference,d=Math.floor,f="left"===r&&d(u.right)>d(c.left)||"right"===r&&d(u.left)<d(c.right)||"top"===r&&d(u.bottom)>d(c.top)||"bottom"===r&&d(u.top)<d(c.bottom),p=d(u.left)<d(n.left),h=d(u.right)>d(n.right),m=d(u.top)<d(n.top),g=d(u.bottom)>d(n.bottom),v="left"===r&&p||"right"===r&&h||"top"===r&&m||"bottom"===r&&g,y=-1!==["top","bottom"].indexOf(r),b=!!t.flipVariations&&(y&&"start"===o&&p||y&&"end"===o&&h||!y&&"start"===o&&m||!y&&"end"===o&&g),x=!!t.flipVariationsByContent&&(y&&"start"===o&&h||y&&"end"===o&&p||!y&&"start"===o&&g||!y&&"end"===o&&m),w=b||x;(f||v||w)&&(e.flipped=!0,(f||v)&&(r=a[l+1]),w&&(o=function(e){return"end"===e?"start":"start"===e?"end":e}(o)),e.placement=r+(o?"-"+o:""),e.offsets.popper=MB({},e.offsets.popper,FB(e.instance.popper,e.offsets.reference,e.placement)),e=HB(e.instance.modifiers,e,"flip"))})),e},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,n=t.split("-")[0],r=e.offsets,i=r.popper,o=r.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return i[a?"left":"top"]=o[n]-(s?i[a?"width":"height"]:0),e.placement=zB(t),e.offsets.popper=TB(i),e}},hide:{order:800,enabled:!0,fn:function(e){if(!eV(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=jB(e.instance.modifiers,(function(e){return"preventOverflow"===e.name})).boundaries;if(t.bottom<n.top||t.left>n.right||t.top>n.bottom||t.right<n.left){if(!0===e.hide)return e;e.hide=!0,e.attributes["x-out-of-boundaries"]=""}else{if(!1===e.hide)return e;e.hide=!1,e.attributes["x-out-of-boundaries"]=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var n=t.x,r=t.y,i=e.offsets.popper,o=jB(e.instance.modifiers,(function(e){return"applyStyle"===e.name})).gpuAcceleration;void 0!==o&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a=void 0!==o?o:t.gpuAcceleration,s=mB(e.instance.popper),l=DB(s),u={position:i.position},c=function(e,t){var n=e.offsets,r=n.popper,i=n.reference,o=Math.round,a=Math.floor,s=function(e){return e},l=o(i.width),u=o(r.width),c=-1!==["left","right"].indexOf(e.placement),d=-1!==e.placement.indexOf("-"),f=t?c||d||l%2==u%2?o:a:s,p=t?o:s;return{left:f(l%2==1&&u%2==1&&!d&&t?r.left-1:r.left),top:p(r.top),bottom:p(r.bottom),right:f(r.right)}}(e,window.devicePixelRatio<2||!QB),d="bottom"===n?"top":"bottom",f="right"===r?"left":"right",p=WB("transform"),h=void 0,m=void 0;if(m="bottom"===d?"HTML"===s.nodeName?-s.clientHeight+c.bottom:-l.height+c.bottom:c.top,h="right"===f?"HTML"===s.nodeName?-s.clientWidth+c.right:-l.width+c.right:c.left,a&&p)u[p]="translate3d("+h+"px, "+m+"px, 0)",u[d]=0,u[f]=0,u.willChange="transform";else{var g="bottom"===d?-1:1,v="right"===f?-1:1;u[d]=m*g,u[f]=h*v,u.willChange=d+", "+f}var y={"x-placement":e.placement};return e.attributes=MB({},y,e.attributes),e.styles=MB({},u,e.styles),e.arrowStyles=MB({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(e){var t,n;return ZB(e.instance.popper,e.styles),t=e.instance.popper,n=e.attributes,Object.keys(n).forEach((function(e){!1!==n[e]?t.setAttribute(e,n[e]):t.removeAttribute(e)})),e.arrowElement&&Object.keys(e.arrowStyles).length&&ZB(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,n,r,i){var o=OB(i,t,e,n.positionFixed),a=IB(n.placement,o,t,e,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return t.setAttribute("x-placement",a),ZB(t,{position:n.positionFixed?"fixed":"absolute"}),n},gpuAcceleration:void 0}}},uV=function(){function e(t,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};CB(this,e),this.scheduleUpdate=function(){return requestAnimationFrame(r.update)},this.update=aB(this.update.bind(this)),this.options=MB({},e.Defaults,i),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=t&&t.jquery?t[0]:t,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(MB({},e.Defaults.modifiers,i.modifiers)).forEach((function(t){r.options.modifiers[t]=MB({},e.Defaults.modifiers[t]||{},i.modifiers?i.modifiers[t]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(e){return MB({name:e},r.options.modifiers[e])})).sort((function(e,t){return e.order-t.order})),this.modifiers.forEach((function(e){e.enabled&&sB(e.onLoad)&&e.onLoad(r.reference,r.popper,r.options,e,r.state)})),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return SB(e,[{key:"update",value:function(){return BB.call(this)}},{key:"destroy",value:function(){return UB.call(this)}},{key:"enableEventListeners",value:function(){return KB.call(this)}},{key:"disableEventListeners",value:function(){return GB.call(this)}}]),e}();function cV(e){return"function"==typeof e?e():e}uV.Utils=("undefined"!=typeof window?window:global).PopperUtils,uV.placements=tV,uV.Defaults=lV;var dV="undefined"!=typeof window?vC.useLayoutEffect:vC.useEffect,fV={},pV=vC.forwardRef((function(e,t){var n=e.anchorEl,r=e.children,i=e.container,o=e.disablePortal,a=void 0!==o&&o,s=e.keepMounted,l=void 0!==s&&s,u=e.modifiers,c=e.open,d=e.placement,f=void 0===d?"bottom":d,p=e.popperOptions,h=void 0===p?fV:p,m=e.popperRef,g=e.transition,v=void 0!==g&&g,y=VC(e,["anchorEl","children","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition"]),b=vC.useRef(null),x=LL(b,t),w=vC.useRef(null),k=LL(w,m),C=vC.useRef(k);dV((function(){C.current=k}),[k]),vC.useImperativeHandle(m,(function(){return w.current}),[]);var S=vC.useState(!0),E=S[0],M=S[1],T=function(e){if("rtl"!==("undefined"!=typeof window&&document.body.getAttribute("dir")||"ltr"))return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(f),D=vC.useState(T),_=D[0],N=D[1],q=vC.useCallback((function(){if(b.current&&n&&c){w.current&&(w.current.destroy(),C.current(null));var e=function(e){N(e.placement)};cV(n);var t=new uV(cV(n),b.current,HC({placement:T},h,{modifiers:HC({},a?{}:{preventOverflow:{boundariesElement:"window"}},{},u,{},h.modifiers),onCreate:jF(e,h.onCreate),onUpdate:jF(e,h.onUpdate)}));C.current(t)}}),[n,a,u,c,T,h]),R=vC.useCallback((function(e){OL(x,e),q()}),[x,q]),P=function(){w.current&&(w.current.destroy(),C.current(null))};if(vC.useEffect((function(){q()}),[q]),vC.useEffect((function(){return function(){P()}}),[]),vC.useEffect((function(){c||v||P()}),[c,v]),!l&&!c&&(!v||E))return null;var A={placement:_};return v&&(A.TransitionProps={in:c,onEnter:function(){M(!1)},onExited:function(){M(!0),P()}}),vC.createElement(FF,{disablePortal:a,container:i},vC.createElement("div",HC({ref:R,role:"tooltip"},y,{style:HC({position:"fixed",top:0,left:0},y.style)}),"function"==typeof r?r(A):r))})),hV=Zz(vC.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),mV=Zz(vC.createElement("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"})),gV=vC.createElement(hV,null);var vV=fD((function(e){return{root:{position:"relative",display:"flex","&$checked $layer":{transform:"scale(1)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.shortest})}},layer:{left:0,position:"absolute",transform:"scale(0)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeIn,duration:e.transitions.duration.shortest})},checked:{}}}),{name:"PrivateRadioButtonIcon"})((function(e){var t=e.checked,n=e.classes;return vC.createElement("div",{className:YT(n.root,t&&n.checked)},gV,vC.createElement(mV,{className:n.layer}))})),yV=vC.createContext(),bV=vC.createElement(vV,{checked:!0}),xV=vC.createElement(vV,null),wV=vC.forwardRef((function(e,t){var n=e.checked,r=e.classes,i=e.color,o=void 0===i?"secondary":i,a=e.name,s=e.onChange,l=VC(e,["checked","classes","color","name","onChange"]),u=vC.useContext(yV),c=n,d=jF(s,u&&u.onChange),f=a;return u&&(void 0===c&&(c=u.value===e.value),void 0===f&&(f=u.name)),vC.createElement(bF,HC({color:o,type:"radio",icon:xV,checkedIcon:bV,classes:{root:YT(r.root,r["color".concat(pD(o))]),checked:r.checked,disabled:r.disabled},name:f,checked:c,onChange:d,ref:t},l))}));function kV(e,t){return"object"===UC(t)&&null!==t?e===t:String(e)===String(t)}fD((function(e){return{root:{color:e.palette.text.secondary},checked:{},disabled:{},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:LC(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:LC(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.action.disabled}}}}),{name:"MuiRadio"})(wV),vC.forwardRef((function(e,t){var n=e.actions,r=e.children,i=e.name,o=e.value,a=e.onChange,s=VC(e,["actions","children","name","value","onChange"]),l=vC.useRef(null),u=vC.useRef(null!=o).current,c=vC.useState((function(){return u?null:e.defaultValue})),d=c[0],f=c[1];vC.useImperativeHandle(n,(function(){return{focus:function(){var e=l.current.querySelector("input:not(:disabled):checked");e||(e=l.current.querySelector("input:not(:disabled)")),e&&e.focus()}}}),[]);var p={name:i,onChange:function(e){u||f(e.target.value),a&&a(e,e.target.value)},value:u?o:d},h=LL(t,l);return vC.createElement(jj,HC({role:"radiogroup",ref:h},s),vC.createElement(yV.Provider,{value:p},r))})),vC.Component;var CV=vC.forwardRef((function(e,t){var n=e.autoFocus,r=e.autoWidth,i=e.children,o=e.classes,a=e.className,s=e.defaultValue,l=e.disabled,u=e.displayEmpty,c=e.labelId,d=e.IconComponent,f=e.inputRef,p=e.MenuProps,h=void 0===p?{}:p,m=e.multiple,g=e.name,v=e.onBlur,y=e.onChange,b=e.onClose,x=e.onFocus,w=e.onOpen,k=e.open,C=e.readOnly,S=e.renderValue;e.required;var E=e.SelectDisplayProps,M=void 0===E?{}:E,T=e.tabIndex;e.type;var D=e.value,_=e.variant,N=void 0===_?"standard":_,q=VC(e,["autoFocus","autoWidth","children","classes","className","defaultValue","disabled","displayEmpty","labelId","IconComponent","inputRef","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","required","SelectDisplayProps","tabIndex","type","value","variant"]),R=vC.useRef(null!=D).current,P=vC.useState(s),A=P[0],I=P[1],O=R?D:A,L=vC.useRef(null),z=vC.useState(null),F=z[0],j=z[1],H=vC.useRef(null!=k).current,B=vC.useState(),V=B[0],W=B[1],U=vC.useState(!1),$=U[0],Y=U[1],X=LL(t,f);vC.useImperativeHandle(X,(function(){return{focus:function(){F.focus()},node:L.current,value:O}}),[F,O]),vC.useEffect((function(){n&&F&&F.focus()}),[n,F]);var K,G,J=function(e,t){e?w&&w(t):(F.focus(),b&&b(t)),H||(W(r?null:F.clientWidth),Y(e))},Z=function(e){return function(t){var n;if(m||J(!1,t),m){n=Array.isArray(O)?TM(O):[];var r=O.indexOf(e.props.value);-1===r?n.push(e.props.value):n.splice(r,1)}else n=e.props.value;R||I(n),y&&(t.persist(),Object.defineProperty(t,"target",{writable:!0,value:{value:n,name:g}}),y(t,e))}},Q=null!==F&&(H?k:$);delete q["aria-invalid"];var ee=[],te=!1;(_j({value:O})||u)&&(S?K=S(O):te=!0);var ne=vC.Children.map(i,(function(e){if(!vC.isValidElement(e))return null;var t;if(m){if(!Array.isArray(O))throw new Error("Material-UI: the `value` prop must be an array when using the `Select` component with `multiple`.");(t=O.some((function(t){return kV(t,e.props.value)})))&&te&&ee.push(e.props.children)}else(t=kV(O,e.props.value))&&te&&(G=e.props.children);return vC.cloneElement(e,{"aria-selected":t?"true":void 0,onClick:Z(e),role:"option",selected:t,value:void 0,"data-value":e.props.value})}));te&&(K=m?ee.join(", "):G);var re,ie=V;!r&&H&&F&&(ie=F.clientWidth),re=void 0!==T?T:l?null:0;var oe=M.id||(g?"mui-component-select-".concat(g):void 0);return vC.createElement(vC.Fragment,null,vC.createElement("div",HC({className:YT(o.root,o.select,o.selectMenu,o[N],a,l&&o.disabled),ref:j,tabIndex:re,role:"button","aria-expanded":Q?"true":void 0,"aria-labelledby":"".concat(c||""," ").concat(oe||""),"aria-haspopup":"listbox",onKeyDown:function(e){if(!C){-1!==[" ","ArrowUp","ArrowDown","Enter"].indexOf(e.key)&&(e.preventDefault(),J(!0,e))}},onClick:l||C?null:function(e){J(!0,e)},onBlur:function(e){!Q&&v&&(e.persist(),Object.defineProperty(e,"target",{writable:!0,value:{value:O,name:g}}),v(e))},onFocus:x},M,{id:oe}),function(e){return null==e||"string"==typeof e&&!e.trim()}(K)?vC.createElement("span",{dangerouslySetInnerHTML:{__html:"​"}}):K),vC.createElement("input",HC({value:Array.isArray(O)?O.join(","):O,name:g,ref:L,type:"hidden",autoFocus:n},q)),vC.createElement(d,{className:YT(o.icon,o["icon".concat(pD(N))],Q&&o.iconOpen)}),vC.createElement(UH,HC({id:"menu-".concat(g||""),anchorEl:F,open:Q,onClose:function(e){J(!1,e)}},h,{MenuListProps:HC({"aria-labelledby":c,role:"listbox",disableListWrap:!0},h.MenuListProps),PaperProps:HC({},h.PaperProps,{style:HC({minWidth:ie},null!=h.PaperProps?h.PaperProps.style:null)})}),ne))})),SV=JH,EV=vC.createElement(cH,null),MV=vC.createElement(Aj,null),TV=vC.forwardRef((function e(t,n){var r=t.autoWidth,i=void 0!==r&&r,o=t.children,a=t.classes,s=t.displayEmpty,l=void 0!==s&&s,u=t.IconComponent,c=void 0===u?GH:u,d=t.id,f=t.input,p=t.inputProps,h=t.labelId,m=t.MenuProps,g=t.multiple,v=void 0!==g&&g,y=t.native,b=void 0!==y&&y,x=t.onClose,w=t.onOpen,k=t.open,C=t.renderValue,S=t.SelectDisplayProps,E=t.variant,M=void 0===E?"standard":E,T=t.labelWidth,D=void 0===T?0:T,_=VC(t,["autoWidth","children","classes","displayEmpty","IconComponent","id","input","inputProps","labelId","MenuProps","multiple","native","onClose","onOpen","open","renderValue","SelectDisplayProps","variant","labelWidth"]),N=b?KH:CV,q=Cj({props:t,muiFormControl:mF(),states:["variant"]}).variant||M,R=f||{standard:EV,outlined:vC.createElement(rB,{labelWidth:D}),filled:MV}[q];return vC.cloneElement(R,HC({inputComponent:N,select:!0,inputProps:HC({children:o,IconComponent:c,variant:q,type:void 0,multiple:v},b?{}:{autoWidth:i,displayEmpty:l,labelId:h,MenuProps:m,onClose:x,onOpen:w,open:k,renderValue:C,SelectDisplayProps:HC({id:d},S)},{},p,{classes:p?ST({baseClasses:a,newClasses:p.classes,Component:e}):a},f?f.props.inputProps:{}),ref:n},_))}));TV.muiName="Select";var DV=fD(SV,{name:"MuiSelect"})(TV);var _V=fD((function(e){return{thumb:{"&$open":{"& $offset":{transform:"scale(1) translateY(-10px)"}}},open:{},offset:HC({zIndex:1},e.typography.body2,{fontSize:e.typography.pxToRem(12),lineHeight:1.2,transition:e.transitions.create(["transform"],{duration:e.transitions.duration.shortest}),top:-34,left:"calc(-50% + -4px)",transformOrigin:"bottom center",transform:"scale(0)",position:"absolute"}),circle:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:"50% 50% 50% 0",backgroundColor:"currentColor",transform:"rotate(-45deg)"},label:{color:e.palette.primary.contrastText,transform:"rotate(45deg)"}}}),{name:"PrivateValueLabel"})((function(e){var t=e.children,n=e.classes,r=e.className,i=e.open,o=e.value,a=e.valueLabelDisplay;return"off"===a?t:vC.cloneElement(t,{className:YT(t.props.className,(i||"on"===a)&&n.open,n.thumb)},vC.createElement("span",{className:YT(n.offset,r)},vC.createElement("span",{className:n.circle},vC.createElement("span",{className:n.label},o))))}));function NV(e,t){return e-t}function qV(e,t,n){return e<t?t:e>n?n:e}function RV(e,t){return e.reduce((function(e,n,r){var i=Math.abs(t-n);return null===e||i<e.distance||i===e.distance?{distance:i,index:r}:e}),null).index}function PV(e,t){if(void 0!==t.current&&e.changedTouches){for(var n=0;n<e.changedTouches.length;n+=1){var r=e.changedTouches[n];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function AV(e,t,n){return 100*(e-t)/(n-t)}function IV(e,t){var n=Math.round(e/t)*t;return Number(n.toFixed(function(e){if(Math.abs(e)<1){var t=e.toExponential().split("e-"),n=t[0].split(".")[1];return(n?n.length:0)+parseInt(t[1],10)}var r=e.toString().split(".")[1];return r?r.length:0}(t)))}function OV(e){var t=e.values,n=e.source,r=e.newValue,i=e.index;if(t[i]===r)return n;var o=TM(t);return o[i]=r,o}function LV(e){var t=e.sliderRef,n=e.activeIndex,r=e.setActive;t.current.contains(document.activeElement)&&Number(document.activeElement.getAttribute("data-index"))===n||t.current.querySelector('[data-index="'.concat(n,'"]')).focus(),r&&r(n)}var zV={horizontal:{offset:function(e){return{left:"".concat(e,"%")}},leap:function(e){return{width:"".concat(e,"%")}}},"horizontal-reverse":{offset:function(e){return{right:"".concat(e,"%")}},leap:function(e){return{width:"".concat(e,"%")}}},vertical:{offset:function(e){return{bottom:"".concat(e,"%")}},leap:function(e){return{height:"".concat(e,"%")}}}},FV=[],jV=function(e){return e},HV=vC.forwardRef((function(e,t){var n=e["aria-label"],r=e["aria-labelledby"],i=e["aria-valuetext"],o=e.classes,a=e.className,s=e.color,l=void 0===s?"primary":s,u=e.component,c=void 0===u?"span":u,d=e.defaultValue,f=e.disabled,p=void 0!==f&&f,h=e.getAriaLabel,m=e.getAriaValueText,g=e.marks,v=void 0===g?FV:g,y=e.max,b=void 0===y?100:y,x=e.min,w=void 0===x?0:x,k=e.name,C=e.onChange,S=e.onChangeCommitted,E=e.onMouseDown,M=e.orientation,T=void 0===M?"horizontal":M,D=e.step,_=void 0===D?1:D,N=e.ThumbComponent,q=void 0===N?"span":N,R=e.track,P=void 0===R?"normal":R,A=e.value,I=e.ValueLabelComponent,O=void 0===I?_V:I,L=e.valueLabelDisplay,z=void 0===L?"off":L,F=e.valueLabelFormat,j=void 0===F?jV:F,H=VC(e,["aria-label","aria-labelledby","aria-valuetext","classes","className","color","component","defaultValue","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","onMouseDown","orientation","step","ThumbComponent","track","value","ValueLabelComponent","valueLabelDisplay","valueLabelFormat"]),B=dD(),V=vC.useRef(null!=A).current,W=vC.useRef(),U=vC.useState(-1),$=U[0],Y=U[1],X=vC.useState(-1),K=X[0],G=X[1],J=vC.useState(d),Z=J[0],Q=J[1],ee=V?A:Z,te=Array.isArray(ee),ne=vC.useRef(),re=te?TM(ee).sort(NV):[ee];re=re.map((function(e){return qV(e,w,b)}));var ie=!0===v&&null!==_?TM(Array(Math.floor((b-w)/_)+1)).map((function(e,t){return{value:w+_*t}})):v;ne.current={source:ee};var oe=iz(),ae=oe.isFocusVisible,se=oe.onBlurVisible,le=oe.ref,ue=vC.useState(-1),ce=ue[0],de=ue[1],fe=vC.useRef(),pe=LL(le,fe),he=LL(t,pe),me=$L((function(e){var t=Number(e.currentTarget.getAttribute("data-index"));ae(e)&&de(t),G(t)})),ge=$L((function(){-1!==ce&&(de(-1),se()),G(-1)})),ve=$L((function(e){var t=Number(e.currentTarget.getAttribute("data-index"));G(t)})),ye=$L((function(){G(-1)})),be=$L((function(e){var t,n=Number(e.currentTarget.getAttribute("data-index")),r=re[n],i=(b-w)/10,o=ie.map((function(e){return e.value})),a=o.indexOf(r);switch(e.key){case"Home":t=w;break;case"End":t=b;break;case"PageUp":_&&(t=r+i);break;case"PageDown":_&&(t=r-i);break;case"ArrowRight":case"ArrowUp":t=_?r+_:o[a+1]||o[o.length-1];break;case"ArrowLeft":case"ArrowDown":t=_?r-_:o[a-1]||o[0];break;default:return}if(e.preventDefault(),_&&(t=IV(t,_)),t=qV(t,w,b),te){var s=t;t=OV({values:re,source:ee,newValue:t,index:n}).sort(NV),LV({sliderRef:fe,activeIndex:t.indexOf(s)})}V||Q(t),de(n),C&&C(e,t),S&&S(e,t)})),xe=vC.useRef(),we=T;"rtl"===B.direction&&"vertical"!==T&&(we+="-reverse");var ke=vC.useCallback((function(e){var t,n,r=e.finger,i=e.move,o=void 0!==i&&i,a=e.values,s=e.source,l=fe.current.getBoundingClientRect(),u=l.width,c=l.height,d=l.bottom,f=l.left;if(t=0===we.indexOf("vertical")?(d-r.y)/c:(r.x-f)/u,-1!==we.indexOf("-reverse")&&(t=1-t),n=function(e,t,n){return(n-t)*e+t}(t,w,b),_)n=IV(n,_);else{var p=ie.map((function(e){return e.value}));n=p[RV(p,n)]}n=qV(n,w,b);var h=0;if(te){var m=n;h=(n=OV({values:a,source:s,newValue:n,index:h=o?xe.current:RV(a,n)}).sort(NV)).indexOf(m),xe.current=h}return{newValue:n,activeIndex:h}}),[b,w,we,te,_,ie]),Ce=$L((function(e){var t=PV(e,W);if(t){var n=ke({finger:t,move:!0,values:re,source:ee}),r=n.newValue,i=n.activeIndex;LV({sliderRef:fe,activeIndex:i,setActive:Y}),V||Q(r),C&&C(e,r)}})),Se=$L((function(e){var t=PV(e,W);if(t){var n=ke({finger:t,values:re,source:ee}).newValue;Y(-1),"touchend"===e.type&&G(-1),S&&S(e,n),W.current=void 0,document.body.removeEventListener("mousemove",Ce),document.body.removeEventListener("mouseup",Se),document.body.removeEventListener("mouseenter",Ee),document.body.removeEventListener("touchmove",Ce),document.body.removeEventListener("touchend",Se)}})),Ee=$L((function(e){0===e.buttons&&Se(e)})),Me=$L((function(e){e.preventDefault();var t=e.changedTouches[0];null!=t&&(W.current=t.identifier);var n=PV(e,W),r=ke({finger:n,values:re,source:ee}),i=r.newValue,o=r.activeIndex;LV({sliderRef:fe,activeIndex:o,setActive:Y}),V||Q(i),C&&C(e,i),document.body.addEventListener("touchmove",Ce),document.body.addEventListener("touchend",Se)}));vC.useEffect((function(){var e=fe.current;return e.addEventListener("touchstart",Me),function(){e.removeEventListener("touchstart",Me),document.body.removeEventListener("mousemove",Ce),document.body.removeEventListener("mouseup",Se),document.body.removeEventListener("mouseenter",Ee),document.body.removeEventListener("touchmove",Ce),document.body.removeEventListener("touchend",Se)}}),[Ee,Se,Ce,Me]);var Te=$L((function(e){E&&E(e),e.preventDefault();var t=PV(e,W),n=ke({finger:t,values:re,source:ee}),r=n.newValue,i=n.activeIndex;LV({sliderRef:fe,activeIndex:i,setActive:Y}),V||Q(r),C&&C(e,r),document.body.addEventListener("mousemove",Ce),document.body.addEventListener("mouseenter",Ee),document.body.addEventListener("mouseup",Se)})),De=AV(te?re[0]:w,w,b),_e=AV(re[re.length-1],w,b)-De,Ne=HC({},zV[we].offset(De),{},zV[we].leap(_e));return vC.createElement(c,HC({ref:he,className:YT(o.root,o["color".concat(pD(l))],a,p&&o.disabled,ie.length>0&&ie.some((function(e){return e.label}))&&o.marked,!1===P&&o.trackFalse,{vertical:o.vertical}[T],{inverted:o.trackInverted}[P]),onMouseDown:Te},H),vC.createElement("span",{className:o.rail}),vC.createElement("span",{className:o.track,style:Ne}),vC.createElement("input",{value:re.join(","),name:k,type:"hidden"}),ie.map((function(e){var t,n=AV(e.value,w,b),r=zV[we].offset(n);if(!1===P)t=-1!==re.indexOf(e.value);else{var i=te?e.value>=re[0]&&e.value<=re[re.length-1]:e.value<=re[0];t=i&&"normal"===P||!i&&"inverted"===P}return vC.createElement(vC.Fragment,{key:e.value},vC.createElement("span",{style:r,className:YT(o.mark,t&&o.markActive)}),vC.createElement("span",{"aria-hidden":!0,style:r,className:YT(o.markLabel,t&&o.markLabelActive)},e.label))})),re.map((function(e,t){var a=AV(e,w,b),s=zV[we].offset(a);return vC.createElement(O,{key:t,valueLabelFormat:j,valueLabelDisplay:z,className:o.valueLabel,value:"function"==typeof j?j(e,t):j,index:t,open:K===t||$===t||"on"===z,disabled:p},vC.createElement(q,{className:YT(o.thumb,o["thumbColor".concat(pD(l))],$===t&&o.active,p&&o.disabled,ce===t&&o.focusVisible),tabIndex:p?null:0,role:"slider",style:s,"data-index":t,"aria-label":h?h(t):n,"aria-labelledby":r,"aria-orientation":T,"aria-valuemax":b,"aria-valuemin":w,"aria-valuenow":e,"aria-valuetext":m?m(e,t):i,onKeyDown:be,onFocus:me,onBlur:ge,onMouseOver:ve,onMouseLeave:ye}))})))}));fD((function(e){return{root:{height:2,width:"100%",boxSizing:"content-box",padding:"11px 0",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",color:e.palette.primary.main,WebkitTapHighlightColor:"transparent","&$disabled":{pointerEvents:"none",cursor:"default",color:e.palette.grey[400]},"&$vertical":{width:2,height:"100%",padding:"0 11px"},"@media (pointer: coarse)":{padding:"20px 0","&$vertical":{padding:"0 20px"}}},colorPrimary:{},colorSecondary:{color:e.palette.secondary.main},marked:{marginBottom:20,"&$vertical":{marginBottom:"auto",marginRight:20}},vertical:{},disabled:{},rail:{display:"block",position:"absolute",width:"100%",height:2,borderRadius:1,backgroundColor:"currentColor",opacity:.38,"$vertical &":{height:"100%",width:2}},track:{display:"block",position:"absolute",height:2,borderRadius:1,backgroundColor:"currentColor","$vertical &":{width:2}},trackFalse:{"& $track":{display:"none"}},trackInverted:{"& $track":{backgroundColor:"light"===e.palette.type?FC(e.palette.primary.main,.62):zC(e.palette.primary.main,.5)},"& $rail":{opacity:1}},thumb:{position:"absolute",width:12,height:12,marginLeft:-6,marginTop:-5,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:e.transitions.create(["box-shadow"],{duration:e.transitions.duration.shortest}),"&::after":{position:"absolute",content:'""',left:-18,top:-18,right:-18,bottom:-18},"&$focusVisible,&:hover":{boxShadow:"0px 0px 0px 8px ".concat(LC(e.palette.primary.main,.16)),"@media (hover: none)":{boxShadow:"none"}},"&$active":{boxShadow:"0px 0px 0px 14px ".concat(LC(e.palette.primary.main,.16))},"&$disabled":{width:8,height:8,marginLeft:-4,marginTop:-3,"&:hover":{boxShadow:"none"}},"$vertical &":{marginLeft:-5,marginBottom:-6},"$vertical &$disabled":{marginLeft:-3,marginBottom:-4}},thumbColorPrimary:{},thumbColorSecondary:{"&$focusVisible,&:hover":{boxShadow:"0px 0px 0px 8px ".concat(LC(e.palette.secondary.main,.16))},"&$active":{boxShadow:"0px 0px 0px 14px ".concat(LC(e.palette.secondary.main,.16))}},active:{},focusVisible:{},valueLabel:{},mark:{position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor"},markActive:{backgroundColor:e.palette.background.paper,opacity:.8},markLabel:HC({},e.typography.body2,{color:e.palette.text.secondary,position:"absolute",top:22,transform:"translateX(-50%)",whiteSpace:"nowrap","$vertical &":{top:"auto",left:22,transform:"translateY(50%)"}}),markLabelActive:{color:e.palette.text.primary}}}),{name:"MuiSlider"})(HV);var BV=vC.forwardRef((function(e,t){var n=e.action,r=e.classes,i=e.className,o=e.message,a=e.role,s=void 0===a?"alert":a,l=VC(e,["action","classes","className","message","role"]);return vC.createElement(mD,HC({component:Kz,variant:"body2",variantMapping:{body1:"div",body2:"div"},role:s,square:!0,elevation:6,className:YT(r.root,i),ref:t},l),vC.createElement("div",{className:r.message},o),n?vC.createElement("div",{className:r.action},n):null)})),VV=fD((function(e){var t="light"===e.palette.type?.8:.98,n=OC(e.palette.background.default,t);return{root:jC({color:e.palette.getContrastText(n),backgroundColor:n,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:e.shape.borderRadius,flexGrow:1},e.breakpoints.up("sm"),{flexGrow:"initial",minWidth:288}),message:{padding:"8px 0"},action:{display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}}}),{name:"MuiSnackbarContent"})(BV),WV=vC.forwardRef((function(e,t){var n=e.action,r=e.anchorOrigin,i=(r=void 0===r?{vertical:"bottom",horizontal:"center"}:r).vertical,o=r.horizontal,a=e.autoHideDuration,s=e.children,l=e.classes,u=e.className,c=e.ClickAwayListenerProps,d=e.ContentProps,f=e.disableWindowBlurListener,p=void 0!==f&&f,h=e.message,m=e.onClose,g=e.onEnter,v=e.onEntered,y=e.onEntering,b=e.onExit,x=e.onExited,w=e.onExiting,k=e.onMouseEnter,C=e.onMouseLeave,S=e.open,E=e.resumeHideDuration,M=e.TransitionComponent,T=void 0===M?tH:M,D=e.transitionDuration,_=void 0===D?{enter:RS.enteringScreen,exit:RS.leavingScreen}:D,N=e.TransitionProps,q=VC(e,["action","anchorOrigin","autoHideDuration","children","classes","className","ClickAwayListenerProps","ContentProps","disableWindowBlurListener","message","onClose","onEnter","onEntered","onEntering","onExit","onExited","onExiting","onMouseEnter","onMouseLeave","open","resumeHideDuration","TransitionComponent","transitionDuration","TransitionProps"]),R=vC.useRef(),P=vC.useState(!0),A=P[0],I=P[1],O=vC.useCallback((function(e){var t=null!=e?e:a;m&&null!=t&&(clearTimeout(R.current),R.current=setTimeout((function(){m&&null!=(null!=e?e:a)&&m(null,"timeout")}),t))}),[a,m]);vC.useEffect((function(){return S&&O(),function(){clearTimeout(R.current)}}),[S,O]);var L=function(){clearTimeout(R.current)},z=vC.useCallback((function(){if(null!=a){if(null!=E)return void O(E);O(.5*a)}}),[a,E,O]);return vC.useEffect((function(){if(!p&&S)return window.addEventListener("focus",z),window.addEventListener("blur",L),function(){window.removeEventListener("focus",z),window.removeEventListener("blur",L)}}),[p,z,S]),!S&&A?null:vC.createElement(AF,HC({onClickAway:function(e){m&&m(e,"clickaway")}},c),vC.createElement("div",HC({className:YT(l.root,l["anchorOrigin".concat(pD(i)).concat(pD(o))],u),onMouseEnter:function(e){k&&k(e),L()},onMouseLeave:function(e){C&&C(e),z()},ref:t},q),vC.createElement(T,HC({appear:!0,in:S,onEnter:jF((function(){I(!1)}),g),onEntered:v,onEntering:y,onExit:b,onExited:jF((function(){I(!0)}),x),onExiting:w,timeout:_,direction:"top"===i?"down":"up"},N),s||vC.createElement(VV,HC({message:h,action:n},d)))))}));fD((function(e){var t={top:8},n={bottom:8},r={justifyContent:"flex-end"},i={justifyContent:"flex-start"},o={top:24},a={bottom:24},s={right:24},l={left:24},u={left:"50%",right:"auto",transform:"translateX(-50%)"};return{root:{zIndex:e.zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center"},anchorOriginTopCenter:HC({},t,jC({},e.breakpoints.up("sm"),HC({},o,{},u))),anchorOriginBottomCenter:HC({},n,jC({},e.breakpoints.up("sm"),HC({},a,{},u))),anchorOriginTopRight:HC({},t,{},r,jC({},e.breakpoints.up("sm"),HC({left:"auto"},o,{},s))),anchorOriginBottomRight:HC({},n,{},r,jC({},e.breakpoints.up("sm"),HC({left:"auto"},a,{},s))),anchorOriginTopLeft:HC({},t,{},i,jC({},e.breakpoints.up("sm"),HC({right:"auto"},o,{},l))),anchorOriginBottomLeft:HC({},n,{},i,jC({},e.breakpoints.up("sm"),HC({right:"auto"},a,{},l)))}}),{flip:!1,name:"MuiSnackbar"})(WV);var UV=vC.forwardRef((function(e,t){var n=e.active,r=void 0!==n&&n,i=e.alternativeLabel,o=e.children,a=e.classes,s=e.className,l=e.completed,u=void 0!==l&&l,c=e.connector,d=e.disabled,f=void 0!==d&&d,p=e.index,h=e.last,m=e.orientation,g=VC(e,["active","alternativeLabel","children","classes","className","completed","connector","disabled","index","last","orientation"]);return vC.createElement("div",HC({className:YT(a.root,a[m],s,i&&a.alternativeLabel,u&&a.completed),ref:t},g),c&&i&&0!==p&&vC.cloneElement(c,{orientation:m,alternativeLabel:i,index:p,active:r,completed:u,disabled:f}),vC.Children.map(o,(function(e){return vC.isValidElement(e)?vC.cloneElement(e,HC({active:r,alternativeLabel:i,completed:u,disabled:f,last:h,icon:p+1,orientation:m},e.props)):null})))}));fD({root:{},horizontal:{paddingLeft:8,paddingRight:8},vertical:{},alternativeLabel:{flex:1,position:"relative"},completed:{}},{name:"MuiStep"})(UV);var $V=Zz(vC.createElement("path",{d:"M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24zm-2 17l-5-5 1.4-1.4 3.6 3.6 7.6-7.6L19 8l-9 9z"})),YV=Zz(vC.createElement("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})),XV=vC.createElement("circle",{cx:"12",cy:"12",r:"12"}),KV=vC.forwardRef((function(e,t){var n=e.completed,r=void 0!==n&&n,i=e.icon,o=e.active,a=void 0!==o&&o,s=e.error,l=void 0!==s&&s,u=e.classes;return"number"==typeof i||"string"==typeof i?l?vC.createElement(YV,{className:YT(u.root,u.error),ref:t}):r?vC.createElement($V,{className:YT(u.root,u.completed),ref:t}):vC.createElement(Jz,{className:YT(u.root,a&&u.active),ref:t},XV,vC.createElement("text",{className:u.text,x:"12",y:"16",textAnchor:"middle"},i)):i})),GV=fD((function(e){return{root:{display:"block",color:e.palette.text.disabled,"&$active":{color:e.palette.primary.main},"&$completed":{color:e.palette.primary.main},"&$error":{color:e.palette.error.main}},text:{fill:e.palette.primary.contrastText,fontSize:e.typography.caption.fontSize,fontFamily:e.typography.fontFamily},active:{},completed:{},error:{}}}),{name:"MuiStepIcon"})(KV),JV=vC.forwardRef((function(e,t){var n=e.active,r=void 0!==n&&n,i=e.alternativeLabel,o=void 0!==i&&i,a=e.children,s=e.classes,l=e.className,u=e.completed,c=void 0!==u&&u,d=e.disabled,f=void 0!==d&&d,p=e.error,h=void 0!==p&&p,m=e.icon;e.last;var g=e.optional,v=e.orientation,y=void 0===v?"horizontal":v,b=e.StepIconComponent,x=e.StepIconProps,w=VC(e,["active","alternativeLabel","children","classes","className","completed","disabled","error","icon","last","optional","orientation","StepIconComponent","StepIconProps"]),k=b;return m&&!k&&(k=GV),vC.createElement("span",HC({className:YT(s.root,s[y],l,f&&s.disabled,o&&s.alternativeLabel,h&&s.error),ref:t},w),m||k?vC.createElement("span",{className:YT(s.iconContainer,o&&s.alternativeLabel)},vC.createElement(k,HC({completed:c,active:r,error:h,icon:m},x))):null,vC.createElement("span",{className:s.labelContainer},vC.createElement(Kz,{variant:"body2",component:"span",className:YT(s.label,o&&s.alternativeLabel,c&&s.completed,r&&s.active,h&&s.error),display:"block"},a),g))}));JV.muiName="StepLabel";var ZV=fD((function(e){return{root:{display:"flex",alignItems:"center","&$alternativeLabel":{flexDirection:"column"},"&$disabled":{cursor:"default"}},horizontal:{},vertical:{},label:{color:e.palette.text.secondary,"&$active":{color:e.palette.text.primary,fontWeight:500},"&$completed":{color:e.palette.text.primary,fontWeight:500},"&$alternativeLabel":{textAlign:"center",marginTop:16},"&$error":{color:e.palette.error.main}},active:{},completed:{},error:{},disabled:{},iconContainer:{flexShrink:0,display:"flex",paddingRight:8,"&$alternativeLabel":{paddingRight:0}},alternativeLabel:{},labelContainer:{width:"100%"}}}),{name:"MuiStepLabel"})(JV),QV=vC.forwardRef((function(e,t){var n=e.active,r=e.alternativeLabel,i=e.children,o=e.classes,a=e.className,s=e.completed,l=e.disabled,u=e.icon;e.last;var c=e.optional,d=e.orientation,f=VC(e,["active","alternativeLabel","children","classes","className","completed","disabled","icon","last","optional","orientation"]),p={active:n,alternativeLabel:r,completed:s,disabled:l,icon:u,optional:c,orientation:d},h=Ij(i,["StepLabel"])?vC.cloneElement(i,p):vC.createElement(ZV,p,i);return vC.createElement(dz,HC({disabled:l,TouchRippleProps:{className:o.touchRipple},className:YT(o.root,o[d],a),ref:t},f),h)}));fD({root:{width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},horizontal:{},vertical:{justifyContent:"flex-start",padding:"8px",margin:"-8px"},touchRipple:{color:"rgba(0, 0, 0, 0.3)"}},{name:"MuiStepButton"})(QV);var eW=vC.forwardRef((function(e,t){var n=e.active,r=e.alternativeLabel,i=void 0!==r&&r,o=e.classes,a=e.className,s=e.completed,l=e.disabled;e.index;var u=e.orientation,c=void 0===u?"horizontal":u,d=VC(e,["active","alternativeLabel","classes","className","completed","disabled","index","orientation"]);return vC.createElement("div",HC({className:YT(o.root,o[c],a,i&&o.alternativeLabel,n&&o.active,s&&o.completed,l&&o.disabled),ref:t},d),vC.createElement("span",{className:YT(o.line,"vertical"===c?o.lineVertical:o.lineHorizontal)}))})),tW=fD((function(e){return{root:{flex:"1 1 auto"},horizontal:{},vertical:{marginLeft:12,padding:"0 0 8px"},alternativeLabel:{position:"absolute",top:12,left:"calc(-50% + 20px)",right:"calc(50% + 20px)"},active:{},completed:{},disabled:{},line:{display:"block",borderColor:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[600]},lineHorizontal:{borderTopStyle:"solid",borderTopWidth:1},lineVertical:{borderLeftStyle:"solid",borderLeftWidth:1,minHeight:24}}}),{name:"MuiStepConnector"})(eW),nW=vC.forwardRef((function(e,t){var n=e.active;e.alternativeLabel;var r=e.children,i=e.classes,o=e.className;e.completed;var a=e.last;e.optional,e.orientation;var s=e.TransitionComponent,l=void 0===s?OF:s,u=e.transitionDuration,c=void 0===u?"auto":u,d=e.TransitionProps,f=VC(e,["active","alternativeLabel","children","classes","className","completed","last","optional","orientation","TransitionComponent","transitionDuration","TransitionProps"]),p=c;return"auto"!==c||l.muiSupportAuto||(p=void 0),vC.createElement("div",HC({className:YT(i.root,o,a&&i.last),ref:t},f),vC.createElement(l,HC({in:n,className:i.transition,timeout:p,unmountOnExit:!0},d),r))}));fD((function(e){return{root:{marginTop:8,marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:"1px solid ".concat("light"===e.palette.type?e.palette.grey[400]:e.palette.grey[600])},last:{borderLeft:"none"},transition:{}}}),{name:"MuiStepContent"})(nW);var rW=vC.createElement(tW,null),iW=vC.forwardRef((function(e,t){var n=e.activeStep,r=void 0===n?0:n,i=e.alternativeLabel,o=void 0!==i&&i,a=e.children,s=e.classes,l=e.className,u=e.connector,c=void 0===u?rW:u,d=e.nonLinear,f=void 0!==d&&d,p=e.orientation,h=void 0===p?"horizontal":p,m=VC(e,["activeStep","alternativeLabel","children","classes","className","connector","nonLinear","orientation"]),g=vC.isValidElement(c)?vC.cloneElement(c,{orientation:h}):null,v=vC.Children.toArray(a),y=v.map((function(e,t){var n={alternativeLabel:o,connector:c,last:t+1===v.length,orientation:h},i={index:t,active:!1,completed:!1,disabled:!1};return r===t?i.active=!0:!f&&r>t?i.completed=!0:!f&&r<t&&(i.disabled=!0),[!o&&g&&0!==t&&vC.cloneElement(g,HC({key:t},i)),vC.cloneElement(e,HC({},n,{},i,{},e.props))]}));return vC.createElement(mD,HC({square:!0,elevation:0,className:YT(s.root,s[h],l,o&&s.alternativeLabel),ref:t},m),y)}));fD({root:{display:"flex",padding:24},horizontal:{flexDirection:"row",alignItems:"center"},vertical:{flexDirection:"column"},alternativeLabel:{alignItems:"flex-start"}},{name:"MuiStepper"})(iW);var oW=vC.forwardRef((function(e,t){var n=e.anchor,r=e.classes,i=e.className,o=e.width,a=VC(e,["anchor","classes","className","width"]);return vC.createElement("div",HC({className:YT(r.root,r["anchor".concat(pD(n))],i),ref:t,style:jC({},fj(n)?"width":"height",o)},a))})),aW=fD((function(e){return{root:{position:"fixed",top:0,left:0,bottom:0,zIndex:e.zIndex.drawer-1},anchorLeft:{right:"auto"},anchorRight:{left:"auto",right:0},anchorTop:{bottom:"auto",right:0},anchorBottom:{top:"auto",bottom:0,right:0}}}),{name:"PrivateSwipeArea"})(oW),sW=null;function lW(e,t){return"right"===e?document.body.offsetWidth-t[0].pageX:t[0].pageX}function uW(e,t){return"bottom"===e?window.innerHeight-t[0].clientY:t[0].clientY}function cW(e,t){return e?t.clientWidth:t.clientHeight}function dW(e,t,n,r){return Math.min(Math.max(n?t-e:r+t-e,0),r)}var fW="undefined"!=typeof navigator&&/iPad|iPhone|iPod/.test(navigator.userAgent),pW={enter:RS.enteringScreen,exit:RS.leavingScreen},hW="undefined"!=typeof window?vC.useLayoutEffect:vC.useEffect;vC.forwardRef((function(e,t){var n=e.anchor,r=void 0===n?"left":n,i=e.disableBackdropTransition,o=void 0!==i&&i,a=e.disableDiscovery,s=void 0!==a&&a,l=e.disableSwipeToOpen,u=void 0===l?fW:l,c=e.hideBackdrop,d=e.hysteresis,f=void 0===d?.52:d,p=e.minFlingVelocity,h=void 0===p?450:p,m=e.ModalProps,g=(m=void 0===m?{}:m).BackdropProps,v=VC(m,["BackdropProps"]),y=e.onClose,b=e.onOpen,x=e.open,w=e.PaperProps,k=void 0===w?{}:w,C=e.SwipeAreaProps,S=e.swipeAreaWidth,E=void 0===S?20:S,M=e.transitionDuration,T=void 0===M?pW:M,D=e.variant,_=void 0===D?"temporary":D,N=VC(e,["anchor","disableBackdropTransition","disableDiscovery","disableSwipeToOpen","hideBackdrop","hysteresis","minFlingVelocity","ModalProps","onClose","onOpen","open","PaperProps","SwipeAreaProps","swipeAreaWidth","transitionDuration","variant"]),q=dD(),R=vC.useState(!1),P=R[0],A=R[1],I=vC.useRef({isSwiping:null}),O=vC.useRef(),L=vC.useRef(),z=vC.useRef(),F=vC.useRef(!1),j=vC.useRef();hW((function(){j.current=null}),[x]);var H=vC.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.mode,i=void 0===n?null:n,a=t.changeTransition,s=void 0===a||a,l=pj(q,r),u=-1!==["right","bottom"].indexOf(l)?1:-1,d=fj(r),f=d?"translate(".concat(u*e,"px, 0)"):"translate(0, ".concat(u*e,"px)"),p=z.current.style;p.webkitTransform=f,p.transform=f;var h="";if(i&&(h=q.transitions.create("all",IL({timeout:T},{mode:i}))),s&&(p.webkitTransition=h,p.transition=h),!o&&!c){var m=L.current.style;m.opacity=1-e/cW(d,z.current),s&&(m.webkitTransition=h,m.transition=h)}}),[r,o,c,q,T]),B=$L((function(e){if(F.current)if(sW=null,F.current=!1,A(!1),I.current.isSwiping){I.current.isSwiping=null;var t,n=pj(q,r),i=fj(r);t=i?lW(n,e.changedTouches):uW(n,e.changedTouches);var o=i?I.current.startX:I.current.startY,a=cW(i,z.current),s=dW(t,o,x,a),l=s/a;Math.abs(I.current.velocity)>h&&(j.current=1e3*Math.abs((a-s)/I.current.velocity)),x?I.current.velocity>h||l>f?y():H(0,{mode:"exit"}):I.current.velocity<-h||1-l>f?b():H(cW(i,z.current),{mode:"enter"})}else I.current.isSwiping=null})),V=$L((function(e){if(z.current&&F.current&&(null==sW||sW===I.current)){var t=pj(q,r),n=fj(r),i=lW(t,e.touches),o=uW(t,e.touches);if(x&&z.current.contains(e.target)&&null==sW){var a=function(e){var t=e.domTreeShapes,n=e.start,r=e.current,i=e.anchor,o={x:"scrollLeft",y:"scrollTop"},a={x:"scrollWidth",y:"scrollHeight"},s={x:"clientWidth",y:"clientHeight"};return t.some((function(e){var t=r>=n;"top"!==i&&"left"!==i||(t=!t);var l="left"===i||"right"===i?"x":"y",u=e[o[l]],c=u>0,d=u+e[s[l]]<e[a[l]];return t&&d||!t&&c?e:null}))}({domTreeShapes:function(e,t){for(var n=[];e&&e!==t;){var r=window.getComputedStyle(e);"absolute"===r.getPropertyValue("position")||"hidden"===r.getPropertyValue("overflow-x")?n=[]:(e.clientWidth>0&&e.scrollWidth>e.clientWidth||e.clientHeight>0&&e.scrollHeight>e.clientHeight)&&n.push(e),e=e.parentElement}return n}(e.target,z.current),start:n?I.current.startX:I.current.startY,current:n?i:o,anchor:r});if(a)return void(sW=a);sW=I.current}if(null==I.current.isSwiping){var l=Math.abs(i-I.current.startX),u=Math.abs(o-I.current.startY);l>u&&e.cancelable&&e.preventDefault();var c=n?l>u&&l>3:u>l&&u>3;if(!0===c||(n?u>3:l>3)){if(I.current.isSwiping=c,!c)return void B(e);I.current.startX=i,I.current.startY=o,s||x||(n?I.current.startX-=E:I.current.startY-=E)}}if(I.current.isSwiping){var d=cW(n,z.current),f=n?I.current.startX:I.current.startY;x&&!I.current.paperHit&&(f=Math.min(f,d));var p=dW(n?i:o,f,x,d);if(x)if(I.current.paperHit)0===p&&(I.current.startX=i,I.current.startY=o);else{if(!(n?i<d:o<d))return;I.current.paperHit=!0,I.current.startX=i,I.current.startY=o}null===I.current.lastTranslate&&(I.current.lastTranslate=p,I.current.lastTime=performance.now()+1);var h=(p-I.current.lastTranslate)/(performance.now()-I.current.lastTime)*1e3;I.current.velocity=.4*I.current.velocity+.6*h,I.current.lastTranslate=p,I.current.lastTime=performance.now(),e.cancelable&&e.preventDefault(),H(p)}}})),W=$L((function(e){if(!e.defaultPrevented&&!e.muiHandled&&(!x||L.current.contains(e.target)||z.current.contains(e.target))){var t=pj(q,r),n=fj(r),i=lW(t,e.touches),o=uW(t,e.touches);if(!x){if(u||e.target!==O.current)return;if(n){if(i>E)return}else if(o>E)return}e.muiHandled=!0,sW=null,I.current.startX=i,I.current.startY=o,A(!0),!x&&z.current&&H(cW(n,z.current)+(s?20:-E),{changeTransition:!1}),I.current.velocity=0,I.current.lastTime=null,I.current.lastTranslate=null,I.current.paperHit=!1,F.current=!0}}));vC.useEffect((function(){if("temporary"===_)return document.body.addEventListener("touchstart",W),document.body.addEventListener("touchmove",V,{passive:!1}),document.body.addEventListener("touchend",B),function(){document.body.removeEventListener("touchstart",W),document.body.removeEventListener("touchmove",V,{passive:!1}),document.body.removeEventListener("touchend",B)}}),[_,W,V,B]),vC.useEffect((function(){return function(){sW===I.current&&(sW=null)}}),[]),vC.useEffect((function(){x||A(!1)}),[x]);var U=vC.useCallback((function(e){L.current=lL.findDOMNode(e)}),[]),$=vC.useCallback((function(e){z.current=lL.findDOMNode(e)}),[]);return vC.createElement(vC.Fragment,null,vC.createElement(gj,HC({open:!("temporary"!==_||!P)||x,variant:_,ModalProps:HC({BackdropProps:HC({},g,{ref:U})},v),PaperProps:HC({},k,{style:HC({pointerEvents:"temporary"!==_||x?"":"none"},k.style),ref:$}),anchor:r,transitionDuration:j.current||T,onClose:y,ref:t},N)),!u&&"temporary"===_&&vC.createElement(XL,null,vC.createElement(aW,HC({anchor:r,ref:O,width:E},C))))}));var mW=vC.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.color,o=void 0===i?"secondary":i,a=e.edge,s=void 0!==a&&a,l=e.size,u=void 0===l?"medium":l,c=VC(e,["classes","className","color","edge","size"]),d=vC.createElement("span",{className:n.thumb});return vC.createElement("span",{className:YT(n.root,r,{start:n.edgeStart,end:n.edgeEnd}[s],{small:n["size".concat(pD(u))]}[u])},vC.createElement(bF,HC({type:"checkbox",icon:d,checkedIcon:d,classes:{root:YT(n.switchBase,n["color".concat(pD(o))]),input:n.input,checked:n.checked,disabled:n.disabled},ref:t},c)),vC.createElement("span",{className:n.track}))}));fD((function(e){return{root:{display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle"},edgeStart:{marginLeft:-8},edgeEnd:{marginRight:-8},switchBase:{position:"absolute",top:0,left:0,zIndex:1,color:"light"===e.palette.type?e.palette.grey[50]:e.palette.grey[400],transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),"&$checked":{transform:"translateX(50%)"},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{opacity:.5},"&$disabled + $track":{opacity:"light"===e.palette.type?.12:.1}},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:LC(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{backgroundColor:e.palette.primary.main},"&$disabled + $track":{backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:LC(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:"light"===e.palette.type?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{backgroundColor:e.palette.secondary.main},"&$disabled + $track":{backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white}},sizeSmall:{width:40,height:24,padding:7,"& $thumb":{width:16,height:16},"& $switchBase":{padding:4}},checked:{},disabled:{},input:{left:"-100%",width:"300%"},thumb:{boxShadow:e.shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"},track:{height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:"light"===e.palette.type?e.palette.common.black:e.palette.common.white,opacity:"light"===e.palette.type?.38:.3}}}),{name:"MuiSwitch"})(mW);var gW=vC.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.disabled,o=void 0!==i&&i,a=e.disableFocusRipple,s=void 0!==a&&a,l=e.fullWidth,u=e.icon,c=e.indicator,d=e.label,f=e.onChange,p=e.onClick,h=e.selected,m=e.textColor,g=void 0===m?"inherit":m,v=e.value,y=e.wrapped,b=void 0!==y&&y,x=VC(e,["classes","className","disabled","disableFocusRipple","fullWidth","icon","indicator","label","onChange","onClick","selected","textColor","value","wrapped"]);return vC.createElement(dz,HC({focusRipple:!s,className:YT(n.root,n["textColor".concat(pD(g))],r,o&&n.disabled,h&&n.selected,d&&u&&n.labelIcon,l&&n.fullWidth,b&&n.wrapped),ref:t,role:"tab","aria-selected":h,disabled:o,onClick:function(e){f&&f(e,v),p&&p(e)}},x),vC.createElement("span",{className:n.wrapper},u,d),c)}));fD((function(e){var t;return{root:HC({},e.typography.button,(t={maxWidth:264,minWidth:72,position:"relative",boxSizing:"border-box",minHeight:48,flexShrink:0,padding:"6px 12px"},jC(t,e.breakpoints.up("sm"),{padding:"6px 24px"}),jC(t,"overflow","hidden"),jC(t,"whiteSpace","normal"),jC(t,"textAlign","center"),jC(t,e.breakpoints.up("sm"),{fontSize:e.typography.pxToRem(13),minWidth:160}),t)),labelIcon:{minHeight:72,paddingTop:9,"& $wrapper > *:first-child":{marginBottom:6}},textColorInherit:{color:"inherit",opacity:.7,"&$selected":{opacity:1},"&$disabled":{opacity:.5}},textColorPrimary:{color:e.palette.text.secondary,"&$selected":{color:e.palette.primary.main},"&$disabled":{color:e.palette.text.disabled}},textColorSecondary:{color:e.palette.text.secondary,"&$selected":{color:e.palette.secondary.main},"&$disabled":{color:e.palette.text.disabled}},selected:{},disabled:{},fullWidth:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},wrapped:{fontSize:e.typography.pxToRem(12),lineHeight:1.5},wrapper:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",flexDirection:"column"}}}),{name:"MuiTab"})(gW);var vW=vC.createContext(),yW=vC.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.component,o=void 0===i?"table":i,a=e.padding,s=void 0===a?"default":a,l=e.size,u=void 0===l?"medium":l,c=e.stickyHeader,d=void 0!==c&&c,f=VC(e,["classes","className","component","padding","size","stickyHeader"]),p=vC.useMemo((function(){return{padding:s,size:u,stickyHeader:d}}),[s,u,d]);return vC.createElement(vW.Provider,{value:p},vC.createElement(o,HC({ref:t,className:YT(n.root,r,d&&n.stickyHeader)},f)))}));fD((function(e){return{root:{display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":HC({},e.typography.body2,{padding:e.spacing(2),color:e.palette.text.secondary,textAlign:"left",captionSide:"bottom"})},stickyHeader:{borderCollapse:"separate"}}}),{name:"MuiTable"})(yW);var bW=vC.createContext(),xW={variant:"body"},wW=vC.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.component,o=void 0===i?"tbody":i,a=VC(e,["classes","className","component"]);return vC.createElement(bW.Provider,{value:xW},vC.createElement(o,HC({className:YT(n.root,r),ref:t},a)))}));fD({root:{display:"table-row-group"}},{name:"MuiTableBody"})(wW);var kW=vC.forwardRef((function(e,t){var n,r=e.align,i=void 0===r?"inherit":r,o=e.classes,a=e.className,s=e.component,l=e.padding,u=e.scope,c=e.size,d=e.sortDirection,f=e.variant,p=VC(e,["align","classes","className","component","padding","scope","size","sortDirection","variant"]),h=vC.useContext(vW),m=vC.useContext(bW);n=s||(m&&"head"===m.variant?"th":"td");var g=u;!g&&m&&"head"===m.variant&&(g="col");var v=l||(h&&h.padding?h.padding:"default"),y=c||(h&&h.size?h.size:"medium"),b=f||m&&m.variant,x=null;return d&&(x="asc"===d?"ascending":"descending"),vC.createElement(n,HC({ref:t,className:YT(o.root,o[b],a,"inherit"!==i&&o["align".concat(pD(i))],"default"!==v&&o["padding".concat(pD(v))],"medium"!==y&&o["size".concat(pD(y))],{head:h&&h.stickyHeader&&o.stickyHeader}[b]),"aria-sort":x,scope:g},p))})),CW=fD((function(e){return{root:HC({},e.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:"1px solid\n ".concat("light"===e.palette.type?FC(LC(e.palette.divider,1),.88):zC(LC(e.palette.divider,1),.68)),textAlign:"left",padding:16}),head:{color:e.palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium},body:{color:e.palette.text.primary},footer:{color:e.palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)},sizeSmall:{padding:"6px 24px 6px 16px","&:last-child":{paddingRight:16},"&$paddingCheckbox":{width:24,padding:"0px 12px 0 16px","&:last-child":{paddingLeft:12,paddingRight:16},"& > *":{padding:0}}},paddingCheckbox:{width:48,padding:"0 0 0 4px","&:last-child":{paddingLeft:0,paddingRight:4}},paddingNone:{padding:0,"&:last-child":{padding:0}},alignLeft:{textAlign:"left"},alignCenter:{textAlign:"center"},alignRight:{textAlign:"right",flexDirection:"row-reverse"},alignJustify:{textAlign:"justify"},stickyHeader:{position:"sticky",top:0,left:0,zIndex:2,backgroundColor:e.palette.background.default}}}),{name:"MuiTableCell"})(kW),SW={variant:"footer"},EW=vC.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.component,o=void 0===i?"tfoot":i,a=VC(e,["classes","className","component"]);return vC.createElement(bW.Provider,{value:SW},vC.createElement(o,HC({className:YT(n.root,r),ref:t},a)))}));fD({root:{display:"table-footer-group"}},{name:"MuiTableFooter"})(EW);var MW={variant:"head"},TW=vC.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.component,o=void 0===i?"thead":i,a=VC(e,["classes","className","component"]);return vC.createElement(bW.Provider,{value:MW},vC.createElement(o,HC({className:YT(n.root,r),ref:t},a)))}));fD({root:{display:"table-header-group"}},{name:"MuiTableHead"})(TW);var DW=vC.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.component,o=void 0===i?"div":i,a=e.disableGutters,s=void 0!==a&&a,l=e.variant,u=void 0===l?"regular":l,c=VC(e,["classes","className","component","disableGutters","variant"]);return vC.createElement(o,HC({className:YT(n.root,n[u],r,!s&&n.gutters),ref:t},c))})),_W=fD((function(e){return{root:{position:"relative",display:"flex",alignItems:"center"},gutters:jC({paddingLeft:e.spacing(2),paddingRight:e.spacing(2)},e.breakpoints.up("sm"),{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}),regular:e.mixins.toolbar,dense:{minHeight:48}}}),{name:"MuiToolbar"})(DW),NW=Zz(vC.createElement("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})),qW=Zz(vC.createElement("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"})),RW=vC.createElement(qW,null),PW=vC.createElement(NW,null),AW=vC.createElement(NW,null),IW=vC.createElement(qW,null),OW=vC.forwardRef((function(e,t){var n=e.backIconButtonProps,r=e.count,i=e.nextIconButtonProps,o=e.onChangePage,a=e.page,s=e.rowsPerPage,l=VC(e,["backIconButtonProps","count","nextIconButtonProps","onChangePage","page","rowsPerPage"]),u=dD();return vC.createElement("div",HC({ref:t},l),vC.createElement(vF,HC({onClick:function(e){o(e,a-1)},disabled:0===a,color:"inherit"},n),"rtl"===u.direction?RW:PW),vC.createElement(vF,HC({onClick:function(e){o(e,a+1)},disabled:a>=Math.ceil(r/s)-1,color:"inherit"},i),"rtl"===u.direction?AW:IW))})),LW=function(e){var t=e.from,n=e.to,r=e.count;return"".concat(t,"-").concat(-1===n?r:n," of ").concat(r)},zW=[10,25,50,100],FW=vC.forwardRef((function(e,t){var n,r=e.ActionsComponent,i=void 0===r?OW:r,o=e.backIconButtonProps,a=e.classes,s=e.className,l=e.colSpan,u=e.component,c=void 0===u?CW:u,d=e.count,f=e.labelDisplayedRows,p=void 0===f?LW:f,h=e.labelRowsPerPage,m=void 0===h?"Rows per page:":h,g=e.nextIconButtonProps,v=e.onChangePage,y=e.onChangeRowsPerPage,b=e.page,x=e.rowsPerPage,w=e.rowsPerPageOptions,k=void 0===w?zW:w,C=e.SelectProps,S=void 0===C?{}:C,E=VC(e,["ActionsComponent","backIconButtonProps","classes","className","colSpan","component","count","labelDisplayedRows","labelRowsPerPage","nextIconButtonProps","onChangePage","onChangeRowsPerPage","page","rowsPerPage","rowsPerPageOptions","SelectProps"]);c!==CW&&"td"!==c||(n=l||1e3);var M=S.native?"option":YH;return vC.createElement(c,HC({className:YT(a.root,s),colSpan:n,ref:t},E),vC.createElement(_W,{className:a.toolbar},vC.createElement("div",{className:a.spacer}),k.length>1&&vC.createElement(Kz,{color:"inherit",variant:"body2",className:a.caption},m),k.length>1&&vC.createElement(DV,HC({classes:{select:a.select,icon:a.selectIcon},input:vC.createElement(Rj,{className:YT(a.input,a.selectRoot)}),value:x,onChange:y},S),k.map((function(e){return vC.createElement(M,{className:a.menuItem,key:e,value:e.value?e.value:e},e.label?e.label:e)}))),vC.createElement(Kz,{color:"inherit",variant:"body2",className:a.caption},p({from:0===d?0:b*x+1,to:Math.min(d,(b+1)*x),count:d,page:b})),vC.createElement(i,{className:a.actions,backIconButtonProps:o,count:d,nextIconButtonProps:g,onChangePage:v,page:b,rowsPerPage:x})))}));fD((function(e){return{root:{color:e.palette.text.primary,fontSize:e.typography.pxToRem(14),"&:last-child":{padding:0}},toolbar:{minHeight:52,paddingRight:2},spacer:{flex:"1 1 100%"},caption:{flexShrink:0},selectRoot:{marginRight:32,marginLeft:8},select:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"},selectIcon:{top:1},input:{color:"inherit",fontSize:"inherit",flexShrink:0},menuItem:{},actions:{flexShrink:0,marginLeft:20}}}),{name:"MuiTablePagination"})(FW);var jW=vC.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.component,o=void 0===i?"tr":i,a=e.hover,s=void 0!==a&&a,l=e.selected,u=void 0!==l&&l,c=VC(e,["classes","className","component","hover","selected"]),d=vC.useContext(bW);return vC.createElement(o,HC({ref:t,className:YT(n.root,r,d&&{head:n.head,footer:n.footer}[d.variant],s&&n.hover,u&&n.selected)},c))}));fD((function(e){return{root:{color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,"&$selected":{backgroundColor:"light"===e.palette.type?"rgba(0, 0, 0, 0.04)":"rgba(255, 255, 255, 0.08)"},"&$hover:hover":{backgroundColor:"light"===e.palette.type?"rgba(0, 0, 0, 0.07)":"rgba(255, 255, 255, 0.14)"}},selected:{},hover:{},head:{},footer:{}}}),{name:"MuiTableRow"})(jW);var HW=Zz(vC.createElement("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"})),BW=vC.forwardRef((function(e,t){var n=e.active,r=void 0!==n&&n,i=e.children,o=e.classes,a=e.className,s=e.direction,l=void 0===s?"desc":s,u=e.hideSortIcon,c=void 0!==u&&u,d=e.IconComponent,f=void 0===d?HW:d,p=VC(e,["active","children","classes","className","direction","hideSortIcon","IconComponent"]);return vC.createElement(dz,HC({className:YT(o.root,a,r&&o.active),component:"span",disableRipple:!0,ref:t},p),i,c&&!r?null:vC.createElement(f,{className:YT(o.icon,o["iconDirection".concat(pD(l))])}))}));fD((function(e){return{root:{cursor:"pointer",display:"inline-flex",justifyContent:"flex-start",flexDirection:"inherit",alignItems:"center","&:focus":{color:e.palette.text.secondary},"&:hover":{color:e.palette.text.secondary,"& $icon":{opacity:1}},"&$active":{color:e.palette.text.primary,"&& $icon":{opacity:1,color:e.palette.text.secondary}}},active:{},icon:{marginRight:4,marginLeft:4,opacity:0,transition:e.transitions.create(["opacity","transform"],{duration:e.transitions.duration.shorter}),userSelect:"none"},iconDirectionDesc:{transform:"rotate(0deg)"},iconDirectionAsc:{transform:"rotate(180deg)"}}}),{name:"MuiTableSortLabel"})(BW);var VW,WW=!("undefined"==typeof window||!window.document||!window.document.createElement);function UW(){if(VW)return VW;if(!WW||!window.document.body)return"indeterminate";var e=window.document.createElement("div");return e.appendChild(document.createTextNode("ABCD")),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),VW="reverse",e.scrollLeft>0?VW="default":(e.scrollLeft=1,0===e.scrollLeft&&(VW="negative")),document.body.removeChild(e),VW}function $W(e,t){var n=e.scrollLeft;if("rtl"!==t)return n;var r=UW();if("indeterminate"===r)return Number.NaN;switch(r){case"negative":return e.scrollWidth-e.clientWidth+n;case"reverse":return e.scrollWidth-e.clientWidth-n}return n}function YW(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}var XW={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function KW(e){var t=e.onChange,n=VC(e,["onChange"]),r=vC.useRef(),i=vC.useRef(null),o=function(){r.current=i.current.offsetHeight-i.current.clientHeight};return vC.useEffect((function(){var e=sj((function(){var e=r.current;o(),e!==r.current&&t(r.current)}));return window.addEventListener("resize",e),function(){e.clear(),window.removeEventListener("resize",e)}}),[t]),vC.useEffect((function(){o(),t(r.current)}),[t]),vC.createElement("div",HC({style:XW,ref:i},n))}var GW=vC.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.color,o=e.orientation,a=VC(e,["classes","className","color","orientation"]);return vC.createElement("span",HC({className:YT(n.root,n["color".concat(pD(i))],r,{vertical:n.vertical}[o]),ref:t},a))})),JW=fD((function(e){return{root:{position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},colorPrimary:{backgroundColor:e.palette.primary.main},colorSecondary:{backgroundColor:e.palette.secondary.main},vertical:{height:"100%",width:2,right:0}}}),{name:"PrivateTabIndicator"})(GW),ZW=vC.createElement(NW,{fontSize:"small"}),QW=vC.createElement(qW,{fontSize:"small"}),eU=vC.forwardRef((function(e,t){var n=e.classes,r=e.className,i=e.direction,o=e.orientation,a=e.visible,s=VC(e,["classes","className","direction","orientation","visible"]),l=YT(n.root,r,{vertical:n.vertical}[o]);return a?vC.createElement(dz,HC({component:"div",className:l,ref:t,role:null,tabIndex:null},s),"left"===i?ZW:QW):vC.createElement("div",{className:l})})),tU=fD({root:{width:40,flexShrink:0},vertical:{width:"100%",height:40,"& svg":{transform:"rotate(90deg)"}}},{name:"PrivateTabScrollButton"})(eU),nU=vC.forwardRef((function(e,t){var n=e.action,r=e.centered,i=void 0!==r&&r,o=e.children,a=e.classes,s=e.className,l=e.component,u=void 0===l?"div":l,c=e.indicatorColor,d=void 0===c?"secondary":c,f=e.onChange,p=e.orientation,h=void 0===p?"horizontal":p,m=e.ScrollButtonComponent,g=void 0===m?tU:m,v=e.scrollButtons,y=void 0===v?"auto":v,b=e.TabIndicatorProps,x=void 0===b?{}:b,w=e.textColor,k=void 0===w?"inherit":w,C=e.value,S=e.variant,E=void 0===S?"standard":S,M=VC(e,["action","centered","children","classes","className","component","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","TabIndicatorProps","textColor","value","variant"]),T=dD(),D="scrollable"===E,_="rtl"===T.direction,N="vertical"===h,q=N?"scrollTop":"scrollLeft",R=N?"top":"left",P=N?"bottom":"right",A=N?"clientHeight":"clientWidth",I=N?"height":"width",O=vC.useState(!1),L=O[0],z=O[1],F=vC.useState({}),j=F[0],H=F[1],B=vC.useState({start:!1,end:!1}),V=B[0],W=B[1],U=vC.useState({overflow:"hidden",marginBottom:null}),$=U[0],Y=U[1],X=new Map,K=vC.useRef(null),G=vC.useRef(null),J=function(){var e,t,n=K.current;if(n){var r=n.getBoundingClientRect();e={clientWidth:n.clientWidth,scrollLeft:n.scrollLeft,scrollTop:n.scrollTop,scrollLeftNormalized:$W(n,T.direction),scrollWidth:n.scrollWidth,top:r.top,bottom:r.bottom,left:r.left,right:r.right}}if(n&&!1!==C){var i=G.current.children;if(i.length>0){var o=i[X.get(C)];t=o?o.getBoundingClientRect():null}}return{tabsMeta:e,tabMeta:t}},Z=$L((function(){var e,t=J(),n=t.tabsMeta,r=t.tabMeta,i=0;if(r&&n)if(N)i=r.top-n.top+n.scrollTop;else{var o=_?n.scrollLeftNormalized+n.clientWidth-n.scrollWidth:n.scrollLeft;i=r.left-n.left+o}var a=(jC(e={},R,i),jC(e,I,r?r[I]:0),e);if(isNaN(j[R])||isNaN(j[I]))H(a);else{var s=Math.abs(j[R]-a[R]),l=Math.abs(j[I]-a[I]);(s>=1||l>=1)&&H(a)}})),Q=function(e){!function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){},o=r.ease,a=void 0===o?YW:o,s=r.duration,l=void 0===s?300:s,u=null,c=t[e],d=!1,f=function(){d=!0},p=function r(o){if(d)i(new Error("Animation cancelled"));else{null===u&&(u=o);var s=Math.min(1,(o-u)/l);t[e]=a(s)*(n-c)+c,s>=1?requestAnimationFrame((function(){i(null)})):requestAnimationFrame(r)}};c===n?i(new Error("Element already at target position")):requestAnimationFrame(p)}(q,K.current,e)},ee=function(e){var t=K.current[q];N?t+=e:(t+=e*(_?-1:1),t*=_&&"reverse"===UW()?-1:1),Q(t)},te=function(){ee(-K.current[A])},ne=function(){ee(K.current[A])},re=vC.useCallback((function(e){Y({overflow:null,marginBottom:-e})}),[]),ie=$L((function(){var e=J(),t=e.tabsMeta,n=e.tabMeta;if(n&&t)if(n[R]<t[R]){var r=t[q]+(n[R]-t[R]);Q(r)}else if(n[P]>t[P]){var i=t[q]+(n[P]-t[P]);Q(i)}})),oe=$L((function(){if(D&&"off"!==y){var e,t,n=K.current,r=n.scrollTop,i=n.scrollHeight,o=n.clientHeight,a=n.scrollWidth,s=n.clientWidth;if(N)e=r>1,t=r<i-o-1;else{var l=$W(K.current,T.direction);e=_?l<a-s-1:l>1,t=_?l>1:l<a-s-1}e===V.start&&t===V.end||W({start:e,end:t})}}));vC.useEffect((function(){var e=sj((function(){Z(),oe()})),t=BF(K.current);return t.addEventListener("resize",e),function(){e.clear(),t.removeEventListener("resize",e)}}),[Z,oe]);var ae=vC.useCallback(sj((function(){oe()})));vC.useEffect((function(){return function(){ae.clear()}}),[ae]),vC.useEffect((function(){z(!0)}),[]),vC.useEffect((function(){Z(),oe()})),vC.useEffect((function(){ie()}),[ie,j]),vC.useImperativeHandle(n,(function(){return{updateIndicator:Z,updateScrollButtons:oe}}),[Z,oe]);var se=vC.createElement(JW,HC({className:a.indicator,orientation:h,color:d},x,{style:HC({},j,{},x.style)})),le=0,ue=vC.Children.map(o,(function(e){if(!vC.isValidElement(e))return null;var t=void 0===e.props.value?le:e.props.value;X.set(t,le);var n=t===C;return le+=1,vC.cloneElement(e,{fullWidth:"fullWidth"===E,indicator:n&&!L&&se,selected:n,onChange:f,textColor:k,value:t})})),ce=function(){var e={};e.scrollbarSizeListener=D?vC.createElement(KW,{className:a.scrollable,onChange:re}):null;var t=V.start||V.end,n=D&&("auto"===y&&t||"desktop"===y||"on"===y);return e.scrollButtonStart=n?vC.createElement(g,{orientation:h,direction:_?"right":"left",onClick:te,visible:V.start,className:YT(a.scrollButtons,"on"!==y&&a.scrollButtonsDesktop)}):null,e.scrollButtonEnd=n?vC.createElement(g,{orientation:h,direction:_?"left":"right",onClick:ne,visible:V.end,className:YT(a.scrollButtons,"on"!==y&&a.scrollButtonsDesktop)}):null,e}();return vC.createElement(u,HC({className:YT(a.root,s,N&&a.vertical),ref:t},M),ce.scrollButtonStart,ce.scrollbarSizeListener,vC.createElement("div",{className:YT(a.scroller,D?a.scrollable:a.fixed),style:$,ref:K,onScroll:ae},vC.createElement("div",{className:YT(a.flexContainer,N&&a.flexContainerVertical,i&&!D&&a.centered),ref:G,role:"tablist"},ue),L&&se),ce.scrollButtonEnd)}));fD((function(e){return{root:{overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},vertical:{flexDirection:"column"},flexContainer:{display:"flex"},flexContainerVertical:{flexDirection:"column"},centered:{justifyContent:"center"},scroller:{position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},fixed:{overflowX:"hidden",width:"100%"},scrollable:{overflowX:"scroll",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},scrollButtons:{},scrollButtonsDesktop:jC({},e.breakpoints.down("xs"),{display:"none"}),indicator:{}}}),{name:"MuiTabs"})(nU);var rU={standard:cH,filled:Aj,outlined:rB},iU=vC.forwardRef((function(e,t){var n=e.autoComplete,r=e.autoFocus,i=e.children,o=e.classes,a=e.className,s=e.color,l=void 0===s?"primary":s,u=e.defaultValue,c=e.error,d=e.FormHelperTextProps,f=e.fullWidth,p=e.helperText,h=e.hiddenLabel,m=e.id,g=e.InputLabelProps,v=e.inputProps,y=e.InputProps,b=e.inputRef,x=e.label,w=e.multiline,k=e.name,C=e.onBlur,S=e.onChange,E=e.onFocus,M=e.placeholder,T=e.required,D=void 0!==T&&T,_=e.rows,N=e.rowsMax,q=e.select,R=void 0!==q&&q,P=e.SelectProps,A=e.type,I=e.value,O=e.variant,L=void 0===O?"standard":O,z=VC(e,["autoComplete","autoFocus","children","classes","className","color","defaultValue","error","FormHelperTextProps","fullWidth","helperText","hiddenLabel","id","InputLabelProps","inputProps","InputProps","inputRef","label","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","rowsMax","select","SelectProps","type","value","variant"]),F=vC.useState(0),j=F[0],H=F[1],B=vC.useRef(null);vC.useEffect((function(){if("outlined"===L){var e=lL.findDOMNode(B.current);H(null!=e?e.offsetWidth:0)}}),[L,D,x]);var V={};"outlined"===L&&(g&&void 0!==g.shrink&&(V.notched=g.shrink),V.labelWidth=j),R&&(P&&P.native||(V.id=void 0),V["aria-describedby"]=void 0);var W=p&&m?"".concat(m,"-helper-text"):void 0,U=x&&m?"".concat(m,"-label"):void 0,$=rU[L],Y=vC.createElement($,HC({"aria-describedby":W,autoComplete:n,autoFocus:r,defaultValue:u,fullWidth:f,multiline:w,name:k,rows:_,rowsMax:N,type:A,value:I,id:m,inputRef:b,onBlur:C,onChange:S,onFocus:E,placeholder:M,inputProps:v},V,y));return vC.createElement(Lj,HC({className:YT(o.root,a),error:c,fullWidth:f,hiddenLabel:h,ref:t,required:D,color:l,variant:L},z),x&&vC.createElement(pH,HC({htmlFor:m,ref:B,id:U},g),x),R?vC.createElement(DV,HC({"aria-describedby":W,id:m,labelId:U,value:I,input:Y},P),i):Y,p&&vC.createElement(Bj,HC({id:W},d),p))}));function oU(e){return Math.round(1e5*e)/1e5}fD({root:{}},{name:"MuiTextField"})(iU);var aU=vC.forwardRef((function(e,t){var n=e.children,r=e.classes,i=e.disableFocusListener,o=void 0!==i&&i,a=e.disableHoverListener,s=void 0!==a&&a,l=e.disableTouchListener,u=void 0!==l&&l,c=e.enterDelay,d=void 0===c?0:c,f=e.enterTouchDelay,p=void 0===f?700:f,h=e.id,m=e.interactive,g=void 0!==m&&m,v=e.leaveDelay,y=void 0===v?0:v,b=e.leaveTouchDelay,x=void 0===b?1500:b,w=e.onClose,k=e.onOpen,C=e.open,S=e.placement,E=void 0===S?"bottom":S,M=e.PopperProps,T=e.title,D=e.TransitionComponent,_=void 0===D?tH:D,N=e.TransitionProps,q=VC(e,["children","classes","disableFocusListener","disableHoverListener","disableTouchListener","enterDelay","enterTouchDelay","id","interactive","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperProps","title","TransitionComponent","TransitionProps"]),R=dD(),P=vC.useState(!1),A=P[0],I=P[1],O=vC.useState(0)[1],L=vC.useState(),z=L[0],F=L[1],j=vC.useRef(!1),H=vC.useRef(null!=C).current,B=vC.useRef(),V=vC.useRef(),W=vC.useRef(),U=vC.useRef(),$=vC.useRef();vC.useEffect((function(){B.current||(B.current="mui-tooltip-".concat(Math.round(1e5*Math.random()))),C&&O((function(e){return!e}))}),[C]),vC.useEffect((function(){return function(){clearTimeout(V.current),clearTimeout(W.current),clearTimeout(U.current),clearTimeout($.current)}}),[]);var Y=function(e){H||A||I(!0),k&&k(e)},X=function(e){var t=n.props;"mouseover"===e.type&&t.onMouseOver&&t.onMouseOver(e),j.current&&"touchstart"!==e.type||(z&&z.removeAttribute("title"),clearTimeout(W.current),clearTimeout(U.current),d?(e.persist(),W.current=setTimeout((function(){Y(e)}),d)):Y(e))},K=iz(),G=K.isFocusVisible,J=K.onBlurVisible,Z=K.ref,Q=vC.useState(!1),ee=Q[0],te=Q[1],ne=function(e){H||I(!1),w&&w(e),clearTimeout(V.current),V.current=setTimeout((function(){j.current=!1}),R.transitions.duration.shortest)},re=function(e){var t=n.props;"blur"===e.type&&(t.onBlur&&t.onBlur(e),ee&&(te(!1),J())),"mouseleave"===e.type&&t.onMouseLeave&&t.onMouseLeave(e),clearTimeout(W.current),clearTimeout(U.current),e.persist(),U.current=setTimeout((function(){ne(e)}),y)},ie=LL(F,t),oe=LL(Z,ie),ae=vC.useCallback((function(e){OL(oe,lL.findDOMNode(e))}),[oe]),se=LL(n.ref,ae),le=H?C:A;""===T&&(le=!1);var ue=!le&&!s,ce=HC({"aria-describedby":le?h||B.current:null,title:ue&&"string"==typeof T?T:null},q,{},n.props,{className:YT(q.className,n.props.className)});u||(ce.onTouchStart=function(e){j.current=!0;var t=n.props;t.onTouchStart&&t.onTouchStart(e),clearTimeout(U.current),clearTimeout(V.current),clearTimeout($.current),e.persist(),$.current=setTimeout((function(){X(e)}),p)},ce.onTouchEnd=function(e){n.props.onTouchEnd&&n.props.onTouchEnd(e),clearTimeout($.current),clearTimeout(U.current),e.persist(),U.current=setTimeout((function(){ne(e)}),x)}),s||(ce.onMouseOver=X,ce.onMouseLeave=re),o||(ce.onFocus=function(e){z||F(e.currentTarget),G(e)&&(te(!0),X(e));var t=n.props;t.onFocus&&t.onFocus(e)},ce.onBlur=re);var de=g?{onMouseOver:ce.onMouseOver,onMouseLeave:ce.onMouseLeave,onFocus:ce.onFocus,onBlur:ce.onBlur}:{};return vC.createElement(vC.Fragment,null,vC.cloneElement(n,HC({ref:se},ce)),vC.createElement(pV,HC({className:YT(r.popper,g&&r.popperInteractive),placement:E,anchorEl:z,open:!!z&&le,id:ce["aria-describedby"],transition:!0},de,M),(function(e){var t=e.placement,n=e.TransitionProps;return vC.createElement(_,HC({timeout:R.transitions.duration.shorter},n,N),vC.createElement("div",{className:YT(r.tooltip,r["tooltipPlacement".concat(pD(t.split("-")[0]))],j.current&&r.touch)},T))})))}));fD((function(e){return{popper:{zIndex:e.zIndex.tooltip,pointerEvents:"none",flip:!1},popperInteractive:{pointerEvents:"auto"},tooltip:{backgroundColor:LC(e.palette.grey[700],.9),borderRadius:e.shape.borderRadius,color:e.palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(10),lineHeight:"".concat(oU(1.4),"em"),maxWidth:300,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},touch:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:"".concat(oU(16/14),"em"),fontWeight:e.typography.fontWeightRegular},tooltipPlacementLeft:jC({transformOrigin:"right center",margin:"0 24px "},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementRight:jC({transformOrigin:"left center",margin:"0 24px"},e.breakpoints.up("sm"),{margin:"0 14px"}),tooltipPlacementTop:jC({transformOrigin:"center bottom",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"}),tooltipPlacementBottom:jC({transformOrigin:"center top",margin:"24px 0"},e.breakpoints.up("sm"),{margin:"14px 0"})}}),{name:"MuiTooltip"})(aU);var sU={entering:{transform:"none"},entered:{transform:"none"}},lU={enter:RS.enteringScreen,exit:RS.leavingScreen};function uU(e){return"large"===e?"20px":"small"===e?"12px":"16px"}function cU({d:e,size:t,style:n={},viewBox:r="0 0 16 16"}){const i={fontSize:uU(t),display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-.125em",textRendering:"optimizeLegibility",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",...n};return vC.createElement("i",{style:i},vC.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:r,fill:"currentColor"},vC.createElement("path",{d:e})))}vC.forwardRef((function(e,t){var n=e.children,r=e.in,i=e.onEnter,o=e.onExit,a=e.style,s=e.timeout,l=void 0===s?lU:s,u=VC(e,["children","in","onEnter","onExit","style","timeout"]),c=dD(),d=LL(n.ref,t);return vC.createElement(gL,HC({appear:!0,in:r,onEnter:function(e,t){AL(e);var n=IL({style:a,timeout:l},{mode:"enter"});e.style.webkitTransition=c.transitions.create("transform",n),e.style.transition=c.transitions.create("transform",n),i&&i(e,t)},onExit:function(e){var t=IL({style:a,timeout:l},{mode:"exit"});e.style.webkitTransition=c.transitions.create("transform",t),e.style.transition=c.transitions.create("transform",t),o&&o(e)},timeout:l},u),(function(e,t){return vC.cloneElement(n,HC({style:HC({transform:"scale(0)",visibility:"exited"!==e||r?void 0:"hidden"},sU[e],{},a,{},n.props.style),ref:d},t))}))}));const dU={d:"M15.9993744,3 L15.9993744,5 L4.99937445,5 L4.99937445,3 L15.9993744,3 Z M8.99937445,7 L15.9993744,7 L15.9993744,9 L8.99937445,9 L8.99937445,7 Z M11.9993744,11 L15.9993744,11 L15.9993744,13 L11.9993744,13 L11.9993744,11 Z M2.2,11 L7,11 L7,9.00369263 C7,8.89323568 7.08954305,8.80369263 7.2,8.80369263 C7.2549016,8.80369263 7.30738916,8.82626165 7.34515712,8.86610844 L10.1852182,11.8624926 C10.2583124,11.93961 10.258346,12.0604218 10.1852948,12.13758 L7.34523376,15.1373102 C7.2692928,15.2175206 7.14270711,15.2209817 7.06249671,15.1450407 C7.02260076,15.1072683 7,15.0547472 7,14.9998069 L7,12.9043747 C4.79351111,12.9043747 2.8018683,12.9266213 1.02507156,12.9711145 L1.02507252,12.9711526 C0.472939773,12.9849787 0.014139487,12.5485949 0.000313396522,11.9964622 C0.000104473692,11.988119 -1.32268838e-12,11.9797736 -1.3231638e-12,11.9714278 L-1.83320026e-12,3 L2,3 L2,10.8 C2,10.9104569 2.08954305,11 2.2,11 Z"},fU={d:"M13,7 L8,7 L13,7 L13,4.98151367 C13,2.23029964 10.7614237,0 8,0 C5.23857625,0 3,2.23029964 3,4.98151367 L3,7 L3.75,7 L3,7 L4.5,7 L4.5,5.33193359 C4.5,3.21561511 5.54860291,1.5 8,1.5 C10.4513971,1.5 11.5,3.21561511 11.5,5.33193359 L11.5,7 L12.25,7 L3,7 C2.44771525,7 2,7.44771525 2,8 L2,15 C2,15.5522847 2.44771525,16 3,16 L13,16 C13.5522847,16 14,15.5522847 14,15 L14,8 C14,7.44771525 13.5522847,7 13,7 L3,7 L13,7 Z"},pU="M6,10 L13,3 L15,5 L8,12 L6,14 L1,9 L3,7 L6,10 Z",hU={d:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z"},mU={d:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};function gU(e,t,n){(function({model:e,properties:t}){return e.modifiers?e.modifiers.apply({model:e,properties:t}):Promise.resolve()})({model:e,properties:n}).then((()=>{e.colorSupport&&e.colorSupport.colorByUpdater(n,"qHyperCubeDef.",e.layout);let r=ck.generate(t,n);r&&r.length&&(r=r.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),e.applyPatches(r,!0))}))}function vU(e,t,n,r,i,o){e.getEffectiveProperties().then((a=>{const s=a.qHyperCubeDef[r].findIndex((e=>e.qDef.cId===t)),l=a.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r].findIndex((e=>e.qDef.cId===n)),u=Dv(!0,{},a),c=u.qHyperCubeDef[r][s],d=u.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r][l];d.qAttributeDimensions=c.qAttributeDimensions,c.qAttributeDimensions=[],o||(d.qAttributeExpressions=c.qAttributeExpressions,c.qAttributeExpressions=[]),u.qHyperCubeDef[r][s]=d,u.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r][l]=c,i&&i({oldItem:c,newItem:d,oldProperties:a,newProperties:u,model:e}),gU(e,a,u)}))}const yU=(e,t)=>{const n=[],r=[];return t.forEach((t=>{t.qCalcCondition.qCond.qv&&r.push(e.evaluate(t.qCalcCondition.qCond.qv).then((e=>{"0"===e&&n.push(t.qDef.cId)})))})),Promise.all(r).then((()=>n))};function bU({dir:e,dock:t,altList:n,model:r,translator:i,app:o,onChange:a}){return 0===n.length?null:{dir:e,dock:t,getAlternatives:()=>yU(o,n).then((e=>Promise.all(n.filter((t=>!e.includes(t.qDef.cId))).map((e=>function(e,t,n){if(e.qLibraryId)return t.getDimension(e.qLibraryId).then((e=>e.getLayout())).catch((()=>null)).then((e=>e?"H"!==e.qDim.qGrouping&&e.qDim.qLabelExpression?e.qDim.qLabelExpression:e.qDim.title:n.get("Object.ErrorMessage.MissingDimension")));const r=e.qDef.qLabelExpression;if(r)return t.evaluate(r);const i=e.qDef.qFieldLabels[0]||e.qDef.qFieldDefs[0];return Promise.resolve(i)}(e,o,i).then((t=>({id:e.qDef.cId,selected:!1,title:t})))))))),changeTo(e,t){vU(r,e,t,"qDimensions",a)}}}function xU(e,t,n,r="/qHyperCubeDef"){return{breadcrumbs:e.qGroupFallbackTitles.slice(0,e.qGroupPos),drilldown:"H"===e.qGrouping,index:t,locked:!!e.qLocked,text:"H"===e.qGrouping?e.qGroupFallbackTitles[e.qGroupPos]:e.qFallbackTitle,popoverText:(i=e,"H"===i.qGrouping?i.title||"":i.qFallbackTitle||""),drillUp(e){n.drillUp(r,t,e)},id:e.cId};var i}function wU({altList:e,app:t,dir:n,dock:r,model:i,onChange:o,skipAttributeExpressions:a,translator:s}){return 0===e.length?null:{dir:n,dock:r,getAlternatives:()=>yU(t,e).then((n=>Promise.all(e.filter((e=>!n.includes(e.qDef.cId))).map((e=>function(e,t,n){if(e.qLibraryId)return t.getMeasure(e.qLibraryId).then((e=>e.getLayout())).catch((()=>null)).then((e=>e?e.qMeasure.qLabelExpression?e.qMeasure.qLabelExpression:e.qMeasure.qLabel||e.qMeasure.qDef:n.get("Object.ErrorMessage.MissingMeasure")));const r=e.qDef.qLabelExpression;if(r)return t.evaluate(r);const i=e.qDef.qLabel||e.qDef.qDef;return Promise.resolve(i)}(e,t,s).then((t=>({id:e.qDef.cId,selected:!1,title:t})))))))),changeTo(e,t){vU(i,e,t,"qMeasures",o,a)}}}function kU(e,t){return{breadcrumbs:[],drilldown:!1,index:t,locked:!1,text:e.qFallbackTitle,popoverText:e.qFallbackTitle,id:e.cId}}const CU={bottom:{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},top:{anchorOrigin:{vertical:"top",horizontal:"center"},transformOrigin:{vertical:"bottom",horizontal:"center"}},left:{anchorOrigin:{vertical:"center",horizontal:"left"},transformOrigin:{vertical:"center",horizontal:"right"}},right:{anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"}}},SU=({children:e,...t})=>vC.createElement(iF,bv({size:"small",disableRipple:!0,disableTouchRipple:!0},t),e);function EU(e){function t({title:e,selected:t,onClick:n}){const r=Hv.detectTextDirection(e);return vC.createElement(kH,{role:"menuitem",button:!0,onClick:n,style:{textAlign:"start"}},vC.createElement(EH,{style:{minWidth:32}},vC.createElement(cU,{d:t?pU:""})),vC.createElement(DH,{primaryTypographyProps:{dir:r}},e))}function n({alignTo:e,changeTo:n,current:r,dir:i,dock:o,list:a,onClose:s,show:l,instruction:u}){const c=a.map((e=>vC.createElement(t,{key:e.id,title:e.title,onClick:()=>n(e.id)})));return vC.createElement(IH,bv({anchorEl:e,open:l,onClose:s},CU[o],{PaperProps:{style:{minWidth:"250px",maxHeight:"300px"}}}),vC.createElement(bH,{dense:!0,dir:i,"aria-label":u,component:"nav"},vC.createElement(t,{title:r,selected:!0,onClick:s}),c))}t.propTypes={title:yC.exports.string.isRequired,selected:yC.exports.bool,onClick:yC.exports.func.isRequired},t.defaultProps={selected:!1},n.propTypes={alignTo:yC.exports.any,changeTo:yC.exports.func.isRequired,current:yC.exports.string.isRequired,dir:yC.exports.string.isRequired,dock:yC.exports.string.isRequired,list:yC.exports.array,onClose:yC.exports.func.isRequired,show:yC.exports.bool.isRequired,instruction:yC.exports.string.isRequired},n.defaultProps={list:[],alignTo:null};class r extends vC.Component{constructor(e){super(e),this.state={open:!1,inSelection:e.selections&&e.selections.isActive(),hasValidAlternatives:!1},this.openPopover=this.openPopover.bind(this),this.closePopover=this.closePopover.bind(this),this.changeTo=this.changeTo.bind(this),this.alignToRef=vC.createRef()}componentDidMount(){const{selections:e}=this.props;e&&(this.onSelectionsActivated=()=>this.setState({inSelection:!0}),this.onSelectionsDeactivated=()=>this.setState({inSelection:!1}),e.addListener("activated",this.onSelectionsActivated),e.addListener("deactivated",this.onSelectionsDeactivated),e.addListener("canceled",this.onSelectionsDeactivated))}componentDidUpdate(e,t){const{popover:n,supportConditional:r}=this.props;n&&r&&n.getAlternatives().then((e=>{t.hasValidAlternatives!==(0!==e.length)&&this.setState({hasValidAlternatives:0!==e.length})}))}componentWillUnmount(){const{selections:e}=this.props;e&&(e.removeListener("activated",this.onSelectionsActivated),e.removeListener("deactivated",this.onSelectionsDeactivated),e.removeListener("canceled",this.onSelectionsDeactivated))}changeTo(e){this.props.popover.changeTo(this.props.titleData.id,e),this.closePopover()}openPopover(){this.state.closeTime&&Date.now()-this.state.closeTime<20||this.props.popover.getAlternatives().then((e=>{this.setState({open:!0,alternatives:e})}))}closePopover(){this.setState({open:!1,closeTime:Date.now()})}render(){const{titleData:e,popover:t,translator:r,disabled:i,isDimension:o,padding:a,minWidth:s,hasAlternative:l,supportConditional:u}=this.props,c={flex:"1 1 auto",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:"normal",lineHeight:"normal",...this.props.style},d=e.breadcrumbs.length,f=i||this.state.inSelection,p=e.breadcrumbs.map(((t,n)=>vC.createElement(SU,{style:{display:"flex",alignItems:"center",color:f&&"rgba(89, 89, 89, 0.8)",pointerEvents:f?"none":"auto",paddingTop:0,paddingBottom:0,height:"100%"},key:n,onClick:()=>f?void 0:e.drillUp(d-n),title:t},vC.createElement("span",{style:c},t),vC.createElement(cU,bv({},mU,{size:"small",style:{margin:"0 8px"}}))))),h=u?this.state.hasValidAlternatives:l,m=t&&!this.state.open?this.openPopover:this.closePopover,g=!t||i||this.state.inSelection,v={display:"flex",alignItems:"center",width:"100%",color:g&&"rgba(89, 89, 89, 0.8)",height:"100%",border:!o&&g&&"none",paddingTop:0,paddingBottom:0};this.state.open&&(v.background="rgba(0,0,0,0.08)");a&&(v.padding=a),s&&(v.minWidth=s);const y=Hv.detectTextDirection(e.text),b=vC.createElement(SU,{"aria-label":r.get("Accessibility.Alternative.Instructions",[e.text]),style:v,onClick:g?void 0:m,title:e.text,tabIndex:g?-1:0,onFocus:g?void 0:e=>{e.currentTarget.style.boxShadow="0px 0px 0px 2px #177FE6 inset",e.currentTarget.style.borderRadius="2px"},onBlur:g?void 0:e=>{e.currentTarget.style.boxShadow="none",e.currentTarget.style.borderRadius="0px"},onMouseDown:e=>{e.preventDefault()}},e.locked&&vC.createElement(cU,bv({},fU,{size:"small",title:r.get("Tooltip.selections.locked")})),vC.createElement("span",{style:c,dir:y},e.text),t&&h&&vC.createElement(cU,bv({},hU,{size:"small",style:{margin:"0 8px"}})));return vC.createElement(vC.Fragment,null,e.drilldown&&vC.createElement(cU,bv({},dU,{size:"small",title:r.get("Tooltip.dimensions.drilldown"),style:{margin:"0 4px 0 0"}})),p,vC.createElement("div",{ref:this.alignToRef,style:{overflow:"hidden",pointerEvents:h?"auto":"none",height:"100%"}},b),t&&h&&vC.createElement(n,{dock:t.dock,dir:t.dir,current:e.popoverText,alignTo:this.alignToRef.current,show:this.state.open,list:this.state.alternatives,onClose:this.closePopover,changeTo:this.changeTo,instruction:r.get("Accessibility.Popover.Instructions")}))}}function i(e){return{top:"bottom",bottom:"top",left:"right",right:"left"}[e]}function o(e){return!e.isDimension&&Ov(e,"hyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures.length")>0}return r.propTypes={disabled:yC.exports.bool.isRequired,padding:yC.exports.string,minWidth:yC.exports.string,titleData:yC.exports.shape({breadcrumbs:yC.exports.arrayOf(yC.exports.string).isRequired,drilldown:yC.exports.bool.isRequired,index:yC.exports.number.isRequired,locked:yC.exports.bool.isRequired,text:yC.exports.string.isRequired,popoverText:yC.exports.string.isRequired,drillUp:yC.exports.func,id:yC.exports.string.isRequired}).isRequired,popover:yC.exports.shape({dir:yC.exports.string.isRequired,dock:yC.exports.string.isRequired,changeTo:yC.exports.func.isRequired,getAlternatives:yC.exports.func.isRequired}),translator:yC.exports.shape({get:yC.exports.func.isRequired}).isRequired,selections:yC.exports.shape({isActive:yC.exports.func,addListener:yC.exports.func,removeListener:yC.exports.func}),style:yC.exports.shape({fontSize:yC.exports.string,color:yC.exports.string,fontFamily:yC.exports.string}).isRequired,isDimension:yC.exports.bool.isRequired,hasAlternative:yC.exports.bool.isRequired,supportConditional:yC.exports.bool.isRequired},r.defaultProps={popover:null,selections:null,padding:"",minWidth:""},{renderer:"react",disableTriggers:!0,preferredSize:function(){const{height:t}=e.measureText({text:"M",fontSize:this.style.fontSize,fontFamily:this.style.fontFamily});return this.settings.settings.isDimension||o(this.settings.settings)?Math.max(28,t):Math.max(20,t)},render(){const{settings:{app:e,disabled:t,explicitItemInfos:n,hyperCube:a,hyperCubeDef:s,isDimension:l,minWidth:u,model:c,onChangeToAlternative:d,padding:f,rtl:p,selections:h,skipAttributeExpressions:m,translator:g,supportConditional:v=!1},layout:{dock:y}}=this.settings,b="top"!==y&&"bottom"!==y||!p?"ltr":"rtl",x=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",height:"100%"};return"left"===e?(n.width=t.height+"px",n.height=t.width+"px",n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left"):"right"===e&&(n.width=t.height+"px",n.height=t.width+"px",n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left"),n}(y,this.rect),w=s&&s.qLayoutExclude&&s.qLayoutExclude.qHyperCubeDef,k=w&&w[l?"qDimensions":"qMeasures"]||[],C=n||a[l?"qDimensionInfo":"qMeasureInfo"],S=l?bU:wU,E=l?xU:kU,M=c&&c.colorSupport&&c.modifiers&&S({altList:k,app:e,dir:p?"rtl":"ltr",dock:i(y),model:c,onChange:d,skipAttributeExpressions:m,translator:g}),T=(D=this.settings.settings).isDimension&&Ov(D,"hyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.length")>0||o(this.settings.settings);var D;const _=C.map(((e,n)=>{const i="number"==typeof e.explicitColumn?e.explicitColumn:n,o=E(e,i,c),a=n===C.length-1;return vC.createElement(vC.Fragment,{key:e.cId},vC.createElement(r,{popover:M,titleData:o,model:c,translator:g,selections:h,disabled:t(),style:this.style,isDimension:l,padding:f,minWidth:u,hasAlternative:T,supportConditional:v}),!a&&vC.createElement("span",{style:{lineHeight:"normal",...this.style}},", "))}));return vC.createElement("div",{style:x,dir:b},_)}}}const MU=OS({palette:{text:{primary:"rgba(89, 89, 89, 0.8)",secondary:"rgba(0, 0, 0, 0.55)",disabled:"rgba(0, 0, 0, 0.3)"},action:{disabled:"rgba(0, 0, 0, 0.3)"}},typography:{fontFamily:'"Source Sans Pro", "Arial", "sans-serif"',button:{textTransform:"initial",fontWeight:400}},shape:{borderRadius:2},shadows:["none","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)"],props:{MuiButtonBase:{disableRipple:!0}}});const TU=FS({productionPrefix:"q22af",disableGlobal:!0,seed:""});function DU(){function e({x:e,y:t,width:n,height:r,scaleRatio:i,margin:o}={}){const a={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0}};return a.x=Number.isNaN(e)?a.x:e,a.y=Number.isNaN(t)?a.y:t,a.width=Number.isNaN(n)?a.width:n,a.height=Number.isNaN(r)?a.height:r,void 0!==i&&(a.scaleRatio.x=Number.isNaN(i.x)?a.scaleRatio.x:i.x,a.scaleRatio.y=Number.isNaN(i.y)?a.scaleRatio.y:i.y),void 0!==o&&(a.margin.left=Number.isNaN(o.left)?0:o.left,a.margin.top=Number.isNaN(o.top)?0:o.top),a}return function(t={}){const{createElement:n=document.createElement.bind(document)}=t;let r,i=e();const o={element:()=>r,root:()=>r,appendTo:e=>(r||(r=n("div"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none"),e.appendChild(r),r),render(e){if(!r)return!1;const t=i.scaleRatio.x,n=i.scaleRatio.y;return r.style.left=Math.round(i.margin.left+i.x*t)+"px",r.style.top=Math.round(i.margin.top+i.y*n)+"px",r.style.width=Math.round(i.width)+"px",r.style.height=Math.round(i.height)+"px",r.style.transform=`scale(${t}, ${n})`,r.style.transformOrigin="top left",lL.render(function(e,t){return vC.createElement(AT,{generateClassName:t},vC.createElement(lD,{theme:MU},e))}(e,TU),r),!0},itemsAt:()=>[],findShapes:()=>[],clear:()=>(r&&lL.unmountComponentAtNode(r),o),destroy(){r&&r.parentElement&&(lL.unmountComponentAtNode(r),r.parentElement.removeChild(r)),r=null},size:t=>(t&&(i=e(t)),i)};return o}}function _U(){return function(e){e.renderer("react",DU()),e.component("data-title",EU(e.renderer("svg")())),e.component("disclaimer",function(){class e extends vC.Component{render(){const{label:e,spanStyle:t}=this.props;return vC.createElement(vC.Fragment,null,vC.createElement("span",{ref:this.alignToRef,style:t,title:e},e))}}return e.propTypes={label:yC.exports.string.isRequired,spanStyle:yC.exports.shape().isRequired},{renderer:"react",disableTriggers:!0,preferredSize:function(){return 22},render(){const{settings:{label:t,rtl:n},layout:{dock:r},style:i={}}=this.settings,o="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",a=function(e,t,n){const r={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px",fontFamily:e.fontFamily||'"Source Sans Pro", "Arial", "sans-serif"'};switch(t){case"left":r.width=n.height+"px",r.transform=`rotate(-90deg) translate(-${n.height}px, 0)`,r.transformOrigin="top left";break;case"right":r.width=n.height+"px",r.transform=`rotate(90deg) translate(0, -${n.width}px)`,r.transformOrigin="top left";break;case"center":r.width=n.width+"px",r.height=n.height+"px",r.color="#595959",r.fontStyle="normal",r.fontSize="1.2em",r.textAlign="center";break;default:case"top":case"bottom":r.justifyContent="flex-start",r.alignItems="flex-start"}return r}(i,r,this.rect),s="center"===r?t:"* "+t,l="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return vC.createElement("div",{style:a,dir:o},vC.createElement(vC.Fragment,null,vC.createElement(e,{label:s,spanStyle:l})))}}}())}}function NU(e){return Oy(e).l<70}function qU(e,t){const n=Oy(e).l/100,r=Oy(t).l/100;return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)}function RU(e,t){return{x:t.x+e.r*Math.sin(e.a),y:t.y-e.r*Math.cos(e.a)}}var PU={require:["chart","settings"],defaultSettings:{settings:{},style:{}},render(){return function({chart:e,settings:t}){const n=e.component(t.component);if(!n)return[];const r=e.findShapes(t.selector).filter((e=>e.key===t.component));if(r.length<2)return[];if(n.settings.settings.slice.cornerRadius>0||n.settings.settings.slice.strokeWidth>0)return[];const i=[];let o=r[r.length-1];for(let e=0;e<r.length;e+=1){const t=r[e],n=o.attrs.fill,a=t.attrs.fill;if(qU(a,n)<=1.2){const{start:e,offset:n}=t.desc.slice;let{innerRadius:r,outerRadius:s}=t.desc.slice;if(r=Math.max(r,o.desc.slice.innerRadius),s=Math.min(s,o.desc.slice.outerRadius),s>r){const t=RU({r:s,a:e},n),o=RU({r:r,a:e},n);i.push({type:"line",x1:t.x,y1:t.y,x2:o.x,y2:o.y,strokeWidth:1,opacity:.4,stroke:NU(a)?"#ccc":"#333"})}}o=t}return i}({chart:this.chart,rect:this.rect,style:this.style,settings:this.settings.settings})}};function AU(e,t=!0){let n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?`M${r.x} ${r.y}`:`L${r.x} ${r.y}`,n+=" "}return t&&(n+="Z"),n}function IU(e){const{size:t,angle:n}=e,r={x:e.x,y:e.y},i=t/2,o=e.x-i,a=e.y-i;let s=[{x:o,y:a+t},{x:o+i,y:a},{x:o+t,y:a+t},{x:o,y:a+t}];return s=s.map((e=>function(e,t,n={x:0,y:0}){const r=Math.cos(t),i=Math.sin(t),o=(s=n,{x:(a=e).x-s.x,y:a.y-s.y});var a,s;return function(e,t){return{x:e.x+t.x,y:e.y+t.y}}({x:r*o.x-i*o.y,y:i*o.x+r*o.y},n)}(e,n,r))),{type:"path",fill:e.fill,d:AU(s)}}var OU={require:["chart"],defaultSettings:{settings:{},style:{}},render(){return function({chart:e,settings:t}){if(!e.component(t.component))return[];const n=e.findShapes(t.selector).filter((e=>e.key===t.component));if(n.length<2)return[];const r=[];for(let e=0;e<n.length;e+=1){const a=n[e];if(a.data.radius.value<0){const{start:e,end:n,offset:s}=a.desc.slice,l=(e+n)/2,u=(i={r:t.offset,a:l},{x:(o=s).x+i.r*Math.sin(i.a),y:o.y-i.r*Math.cos(i.a)}),c=IU({size:t.size,fill:t.fill,angle:l+Math.PI,...u});c.data={...a.data,_share:a.desc.share,_fillColor:a.attrs.fill},r.push(c)}}var i,o;return r}({chart:this.chart,rect:this.rect,style:this.style,settings:this.settings.settings})}};function LU(){const e=vm();return e.use(mv),e.use(function(e){if("function"!=typeof e.interaction)return function(t){t.interaction("hammer",yv(e))};e.interaction("hammer",yv(Hammer))}(o)),e.use(_U()),e.component("pie-dividers",PU),e.component("negative-indicators",OU),e}function zU(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 FU(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zU(Object(n),!0).forEach((function(t){WU(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zU(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jU(){jU=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof d?t:d,o=Object.create(i.prototype),a=new C(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=x(a,n);if(s){if(s===c)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===c)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(e,n,a),o}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var c={};function d(){}function f(){}function p(){}var h={};s(h,i,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(S([])));g&&g!==t&&n.call(g,i)&&(h=g);var v=p.prototype=d.prototype=Object.create(h);function y(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(i,o,a,s){var l=u(e[i],e,o);if("throw"!==l.type){var c=l.arg,d=c.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;this._invoke=function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}}function x(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=u(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,c):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function S(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return f.prototype=p,s(v,"constructor",p),s(p,"constructor",f),f.displayName=s(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,s(e,a,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},y(b.prototype),s(b.prototype,o,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new b(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},y(v),s(v,a,"Generator"),s(v,i,(function(){return this})),s(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=S,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,c):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),c},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}function HU(e){return(HU="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function BU(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function VU(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){BU(o,r,i,a,s,"next",e)}function s(e){BU(o,r,i,a,s,"throw",e)}a(void 0)}))}}function WU(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UU(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $U(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(e,t)||XU(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function YU(e){return function(e){if(Array.isArray(e))return KU(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||XU(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 XU(e,t){if(e){if("string"==typeof e)return KU(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)?KU(e,t):void 0}}function KU(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var GU=Object.prototype.hasOwnProperty,JU=Object.prototype.toString,ZU=Object.defineProperty,QU=Object.getOwnPropertyDescriptor,e$=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===JU.call(e)},t$=function(e){if(!e||"[object Object]"!==JU.call(e))return!1;var t,n=GU.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&GU.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||GU.call(e,t)},n$=function(e,t){ZU&&"__proto__"===t.name?ZU(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},r$=function(e,t){if("__proto__"===t){if(!GU.call(e,t))return;if(QU)return QU(e,t).value}return e[t]},i$=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=r$(s,n),s!==(i=r$(t,n))&&(c&&i&&(t$(i)||(o=e$(i)))?(o?(o=!1,a=r&&e$(r)?r:[]):a=r&&t$(r)?r:{},n$(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&n$(s,{name:n,newValue:i}));return s};function o$(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 a$(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 s$(e,t,n,r,i){var o,a=i.byRow,s=i.byElemNo;if(r&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(o=e.hc.qDataPages[0])||void 0===o?void 0:o.qArea.qHeight)||0)))return s(r,r.raw().qCardinal);if(r){var l=t.pic.extract({field:r.key(),trackBy:r.value}).length;return a(r,l)}return{}}function l$(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 u$(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 c$(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function d$(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function f$(){}var p$=1/.7,h$="\\s*([+-]?\\d+)\\s*",m$="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",g$="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",v$=/^#([0-9a-f]{3,8})$/,y$=new RegExp("^rgb\\("+[h$,h$,h$]+"\\)$"),b$=new RegExp("^rgb\\("+[g$,g$,g$]+"\\)$"),x$=new RegExp("^rgba\\("+[h$,h$,h$,m$]+"\\)$"),w$=new RegExp("^rgba\\("+[g$,g$,g$,m$]+"\\)$"),k$=new RegExp("^hsl\\("+[m$,g$,g$]+"\\)$"),C$=new RegExp("^hsla\\("+[m$,g$,g$,m$]+"\\)$"),S$={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 E$(){return this.rgb().formatHex()}function M$(){return this.rgb().formatRgb()}function T$(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=v$.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?D$(t):3===n?new R$(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?_$(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?_$(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=y$.exec(e))?new R$(t[1],t[2],t[3],1):(t=b$.exec(e))?new R$(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=x$.exec(e))?_$(t[1],t[2],t[3],t[4]):(t=w$.exec(e))?_$(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=k$.exec(e))?O$(t[1],t[2]/100,t[3]/100,1):(t=C$.exec(e))?O$(t[1],t[2]/100,t[3]/100,t[4]):S$.hasOwnProperty(e)?D$(S$[e]):"transparent"===e?new R$(NaN,NaN,NaN,0):null}function D$(e){return new R$(e>>16&255,e>>8&255,255&e,1)}function _$(e,t,n,r){return r<=0&&(e=t=n=NaN),new R$(e,t,n,r)}function N$(e){return e instanceof f$||(e=T$(e)),e?new R$((e=e.rgb()).r,e.g,e.b,e.opacity):new R$}function q$(e,t,n,r){return 1===arguments.length?N$(e):new R$(e,t,n,null==r?1:r)}function R$(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function P$(){return"#"+I$(this.r)+I$(this.g)+I$(this.b)}function A$(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function I$(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function O$(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new z$(e,t,n,r)}function L$(e){if(e instanceof z$)return new z$(e.h,e.s,e.l,e.opacity);if(e instanceof f$||(e=T$(e)),!e)return new z$;if(e instanceof z$)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new z$(a,s,l,e.opacity)}function z$(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function F$(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}c$(f$,T$,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:E$,formatHex:E$,formatHsl:function(){return L$(this).formatHsl()},formatRgb:M$,toString:M$}),c$(R$,q$,d$(f$,{brighter:function(e){return e=null==e?p$:Math.pow(p$,e),new R$(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new R$(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:P$,formatHex:P$,formatRgb:A$,toString:A$})),c$(z$,(function(e,t,n,r){return 1===arguments.length?L$(e):new z$(e,t,n,null==r?1:r)}),d$(f$,{brighter:function(e){return e=null==e?p$:Math.pow(p$,e),new z$(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?.7:Math.pow(.7,e),new z$(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new R$(F$(e>=240?e-240:e+120,i,r),F$(e,i,r),F$(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var j$=Math.PI/180,H$=180/Math.PI,B$=4/29,V$=6/29,W$=3*V$*V$;function U$(e){if(e instanceof $$)return new $$(e.l,e.a,e.b,e.opacity);if(e instanceof Z$)return Q$(e);e instanceof R$||(e=N$(e));var t,n,r=G$(e.r),i=G$(e.g),o=G$(e.b),a=Y$((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Y$((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Y$((.0139322*r+.0971045*i+.7141733*o)/.82521)),new $$(116*a-16,500*(t-a),200*(a-n),e.opacity)}function $$(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Y$(e){return e>.008856451679035631?Math.pow(e,1/3):e/W$+B$}function X$(e){return e>V$?e*e*e:W$*(e-B$)}function K$(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function G$(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function J$(e){if(e instanceof Z$)return new Z$(e.h,e.c,e.l,e.opacity);if(e instanceof $$||(e=U$(e)),0===e.a&&0===e.b)return new Z$(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*H$;return new Z$(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function Z$(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Q$(e){if(isNaN(e.h))return new $$(e.l,0,0,e.opacity);var t=e.h*j$;return new $$(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function eY(e){return function(){return e}}function tY(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):eY(isNaN(e)?t:e)}c$($$,(function(e,t,n,r){return 1===arguments.length?U$(e):new $$(e,t,n,null==r?1:r)}),d$(f$,{brighter:function(e){return new $$(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new $$(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new R$(K$(3.1338561*(t=.96422*X$(t))-1.6168667*(e=1*X$(e))-.4906146*(n=.82521*X$(n))),K$(-.9787684*t+1.9161415*e+.033454*n),K$(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),c$(Z$,(function(e,t,n,r){return 1===arguments.length?J$(e):new Z$(e,t,n,null==r?1:r)}),d$(f$,{brighter:function(e){return new Z$(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new Z$(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return Q$(this).rgb()}}));var nY=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=q$(e)).r,(t=q$(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=tY(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1),rY=/^class(-pyramid)?/,iY=function(e,t,n,r){var i=void 0!==n.min?n.min:r.min(),o=void 0!==n.max?n.max:r.max(),a=i,s=o,l=t.limits,u={},c="percent"===t.limitType?l.map((function(e){return i+(o-i)*e})):l,d=t.colors.map((function(t){return e.resolveUIColor(t)}));if(i=Math.min.apply(Math,[i].concat(YU(c))),o=Math.max.apply(Math,[o].concat(YU(c))),u.min=i,u.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))u.type="categorical",Object.assign(u,function(e){var t=e.min,n=e.max,r=e.limits,i=e.range,o=[],a=[];if(r.length)if(r[r.length-1]<t)a.push(t,n),o.push(i[i.length-1],i[i.length-1],i[i.length-1]);else if(r[0]>n)a.push(t,n),o.push(i[0],i[0],i[0]);else{if(r[0]>t)a.push(t),o.push(i[0]);else{a.push(t);for(var s=0;s<r.length;s++)if(t<r[s]){o.push(i[s]);break}}for(var l=0;l<r.length;l++)t<r[l]&&r[l]<n&&(a.push(r[l]),o.push(i[l]));if(r[r.length-1]<n)a.push(n),o.push(i[r.length]),o.push(i[r.length]);else{a.push(n);for(var u=0;u<r.length;u++)if(r[u]>n){o.push(i[u]),o.push(i[u]);break}}}else o.push(i[0]);return{min:t,max:n,range:o,domain:a}}({min:"percent"===t.limitType?i:a,max:"percent"===t.limitType?o:s,range:d,limits:"percent"===t.limitType?c:l}));else if(t.breakTypes){var f=t.breakTypes;u.type="continuous",u.domain=[i],u.range=[d[0]];for(var p=0;p<c.length;p+=1)if(f[p]){var h=d[p],m=d[p+1],g=nY(h,m)(.5);u.range.push(g),u.domain.push(c[p]),p<c.length-1&&f[p+1]&&(u.range.push(d[p+1]),u.domain.push((c[p]+c[p+1])/2))}else u.range.push(d[p]),u.range.push(d[p+1]),u.domain.push(c[p]),u.domain.push(c[p]+Math.min(1e-6,(o-i)/1e6));u.range.push(d[d.length-1]),u.domain.push(o)}else u.domain=c,u.range=d;return u};function oY(e,t,n,r,i){var o,a,s,l=0,u=[],c=(e-t)/(r+1);if(0===c)return 1;for(o=0;o<n.length;o+=1)a=.99*(n[o]-t),s=n[o]>e?Math.floor(e/c):n[o]<t?0:Math.floor(a/c),Number.isNaN(s)||(u[s]?u[s]+=1:u[s]=1);for(o=0;o<u.length;o+=1)u[o]&&(l+=1);return l<=r||l>=i?Math.max(l,r):oY(e,t,n,r+1,i)}var aY=function(e,t,n,r){var i,o,a=t.theme,s=t.hc,l=r.f,u={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},c=[],d=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(d=!("S"===(i=n.pic.raw()).qMode&&(i.qDataPages[0]&&i.qSize.qcy>i.qDataPages[0].qArea.qHeight||!i.qDataPages.length&&i.qSize.qcy>0)||"K"===i.qMode&&i.qStackedDataPages[0]&&i.qSize.qcy>i.qStackedDataPages[0].qArea.qHeight||"T"===i.qMode&&i.qSize.qcy>i.qTreeDataPages[0].qGroupSize))&&(c=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:s.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,YU(e))<0}}}}).filter((function(e){return e.value>=0&&!e.exclude.value})).map((function(e){return e.num.value})).filter((function(e){return"number"==typeof e})))}if(!1===n.input.autoMinMax){if(u.min=n.input.measureMin,u.max=n.input.measureMax,u.max<u.min)return{invalid:!0}}else if(l&&!d)u.min=l.min(),u.max=l.max();else if(l){if(!c.length)return{invalid:!0};u.min=Math.min.apply(Math,YU(c)),u.max=Math.max.apply(Math,YU(c))}if(n.input.measureScheme&&(u.palettes={quant:n.input.measureScheme}),a){var f=a.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];u.type=f&&rY.test(f.type)?"categorical":"continuous","categorical"===u.type&&(o=f.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,YU(f.colors.map((function(e){return e?e.length:0})))):f.colors.length)}if("categorical"===u.type){for(var p=d?oY(u.max,u.min,c,1,o):o,h=(u.max-u.min)/p,m=[],g=0;g<p+1;g+=1)m.push(u.min+h*g);u.domain=m,u.range=function(e){for(var t=e.resources.theme.palette("quant",p),n=Math.max(1,Math.floor(t.length/p)),r=[],i=0;i<p;i+=1)r.push(t[i*n]);return[r[0]].concat(r,[r[r.length-1]])}}return u};function sY(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 lY(e){var t,n=e.cm,r=e.defaults,i=e.index,o=e.input,a=e.pic;if(!o||!o.on)return null;var s=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===s?function(e,t,n){var r=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(r=e.resolveUIColor(t.paletteColor)),FU(FU({},n),{},{mode:"constant",type:"constant",primary:r})}(n,o,r):"byExpression"===s?function(e,t,n){var r="qMeasureInfo/".concat(e,"/"),i=t.field((function(e){return e.id().startsWith(r)&&"colorByMeasureExpression"===e.raw().id})),o=i;return FU(FU({},n),{},o?{mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(i,a,r):null}function uY(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function cY(e,t){for(var n=(null==t?void 0:t.domain)||[],r=(null==t?void 0:t.range)||[],i=[],o=0;o<e.length;++o){var a=e[o];if("constant"===(null==a?void 0:a.mode)){var s=n.indexOf(o);-1===s?(n.push(o),r.push(a.primary)):r[s]=a.primary,e[o]=null}else if(a){i.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),r.splice(l,1))}}return{domain:n,range:r,exclude:i}}function dY(e,t,n,r){var i,o=function(e,t,n,r){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var r=t.theme,i=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?sY:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),u=aY(0,{theme:r,hc:i},n,{f:l});if(u.invalid)return u;("expression"===s.type||s.activeMeasureIndex<0)&&(u.label=s.label,l&&"color.altLabel"===l.raw().labelExpRef&&(u.label=n.input.altLabel)),!u.label&&l&&(u.label=l.title());var c=s.activeMeasureIndex>=0?l:null;if(!c&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(c=n.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===s.type)if(c){var d=c.raw().coloring;d&&d.gradient&&i$(u,iY(e,d.gradient,u,c))}else u.auxiliary=s;return u}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.getCDef,o=void 0===i?l$:i,a=r.getCByField,s=void 0===a?u$:a,l=r.getPersistence,u=void 0===l?s$:l,c=o(t,n),d=s(n,c),f=d?d.raw():{},p=n&&n.pic?n.pic.raw():{};if(f.qError||f.qSize&&0===f.qSize.qcy&&!p.qHasOtherValues)return{invalid:!0};var h={mode:"field",fieldType:"dimension",type:"categorical",field:d?d.key():void 0,isFieldLocked:f.qLocked};return("expression"===c.type||c.activeDimensionIndex<0)&&(h.label=c.label,"color.altLabel"===f.labelExpRef&&(h.label=n.input.altLabel)),!h.label&&d&&(h.label=d.title()),n.input.dimensionScheme&&(h.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===c.type&&(h.auxiliary=c),i$(h,u(t,n,c,d,{byRow:a$,byElemNo:o$})),h}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!s||!s.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:r.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=aY(0,{hc:i,theme:o},n,{f:s});return l.invalid||(l.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,r);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&i.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],u=[];"measure"===n.input.useBaseColors&&i.qMeasureInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?u.push(r.primary):u.push(i)}}));var c=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,d=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&d&&(c={categorical:d.key}),{mode:"measure",type:"categorical",palettes:c,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:u}:void 0}}if("dimension"===s){var f=[],p=[];return i.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){f.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?p.push(r.primary):p.push(i)}})),{mode:"dimension",type:"categorical",field:f.length?f[0]:void 0,explicit:f.length?{domain:f,range:p}:void 0}}var h=r.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(h=e.resolveUIColor(n.input.paletteColor));else{var m=n.input.singleColor;"number"!=typeof m||Number.isNaN(m)||(h=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][m])}return{mode:"constant",type:"constant",primary:h}}(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 lY({cm:e,input:n,defaults:r,index:i,pic:t.pic})})),function(e,t){var n,r,i,o=t.translator;if(uY(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=cY(e.measureOverrides,e.explicit),uY(e)),null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=cY(e.measureOverrides),a}return null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}function fY(e){var t=FU({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(i$(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=i$(!0,{},n.input,o,{auto:!1});var a=t.theme?t.theme.getDataColorPalettes():[];a[0]&&(n.input.dimensionScheme=a[0].key);var s=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(s=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[s]&&t.hc.qDimensionInfo[s].coloring&&t.hc.qDimensionInfo[s].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(i=n.input.measureOverrides)&&void 0!==i&&i.every((function(e){return!e||!e.on}))&&(n.input=i$(!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||{},o=i.key;if("measure"===e.fieldType)return r.getMeasure(o,t).catch((function(){}));if("dimension"===e.fieldType){var a="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?r.getAttributeDimension(a,t).catch((function(){})):Promise.resolve(),o?r.getDimensionColorMap(o,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 iY(i,r.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var a={nil:e.nil,others:e.others},s=r[0],l=r[1]?r[1].colorMap:null;if(s){var u=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:s,qInterColumnSortOrder:[0,1],qMode:"S"}});a.legendDataset=u}return l?function(e,t,n,r){var i=r.external,o=r.field,a=FU({},e);i$(a,o$(o,o.raw().qCardinal));var s=i.theme?i.theme.getDataColorPalettes()[0]:null;return t.nul&&(a.nil=n.resolveUIColor(t.nul)),t.oth&&(a.others=n.resolveUIColor(t.oth)),t.usePal?(a.palettes={categorical:t.pal},s&&!t.pal&&(a.palettes.categorical=s.key,i$(a,o$(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),i$(a,o$(o))),t.colors&&t.colors.length&&(a.explicit=function(e,t,n){for(var r={},i=0;i<e.length;i+=1)r[e[i].value]=e[i].baseColor;var o=[];return{domain:function(e){var i=e.data,a=[];o=[];for(var s=0;s<i.items.length;s++){var l=i.items[s],u=(l.text||l).label;r[u]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(t.resolveUIColor(r[u])))}return a.push(-3,-2),o.push(n.others),o.push(n.nil),a},range:function(){return o}}}(t.colors,n,a)),a}(a,l,i,{external:t,field:n.pic.field(e.field)}):a}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!n.uiPalette)return e.color;var t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},r=t.theme;r&&(e=FU(FU({},e),r.getDataColorSpecials())),n.settings=i$(e,dY(this,n,t,e))}return n.settings}};return i}var pY=function(e,t){var n=e.fieldType,r={};if(t)if("measure"===n){var i=t.coloring;i&&(r.measureGradient=i.gradient)}else if("dimension"===n){var o=t[0],a=t[1];o&&(r.legendDataPage=o),a&&(r.dimValsData=a.colorMap)}return r},hY=function(e){throw e.isHandled=!0,e},mY=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()},gY=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()},vY=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(hY):Promise.reject()};function yY(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}function bY(e){return function(t){return"object"===HU(t.datum[e])?t.datum[e].value:void 0}}function xY(e){return"object"===HU(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function wY(e){return-3===e.datum.value}var kY=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"},CY=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 SY(e,t){var n=e.styleReference,r=e.chart,i=e.rtl,o=t.legendProps,a=t.coloring,s=t.theme,l=t.hc;return{layout:{minimumLayoutMode:"MEDIUM",dock:kY(o,r,i)},show:"function"==typeof o.show?function(){return CY(o,l,a)}:CY(o,l,a),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==o.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:a.label||"",fill:s?s.getStyle(n,"legend.title","color"):void 0,fontSize:s?s.getStyle(n,"legend.title","fontSize"):"16px",fontFamily:s?s.getStyle(n,"legend.title","fontFamily"):"'Source Sans Pro', 'Arial', 'sans-serif'"}}}}function EY(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var r=SY(e,t);if(!r.show)return!1;var i,o=e.key,a=e.styleReference,s=e.viewState,l=e.rtl,u=e.settings,c=e.style,d=t.scaleKey,f=t.theme,p=t.scales,h=r.layout.dock,m="left"===h||"right"===h?{maxLines:3,wordBreak:"break-word"}:{},g={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 v="".concat(d,"Legend");return i$(!0,r,{type:"legend-cat",key:"".concat(o,"-cat"),scale:v in p?v:d,settings:{layout:{scrollOffset:function(){return s?s.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(r.layout.dock)?2:1,direction:l?"rtl":"ltr",horizontal:20},item:{show:i,label:FU({fill:f?f.getStyle(a,"legend.label","color"):void 0,fontSize:f?f.getStyle(a,"legend.label","fontSize"):void 0,fontFamily:f?f.getStyle(a,"legend.label","fontFamily"):"'Source Sans Pro', 'Arial', 'sans-serif'"},m)},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:g[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:u,style:c})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n=e.key,r=e.styleReference,i=e.rtl,o=e.settings,a=e.style,s=t.scaleKey,l=t.theme,u=SY(e,t);return!!u.show&&i$(!0,u,{type:"legend-seq",key:"".concat(n,"-seq"),settings:{fill:s,major:"".concat(s,"Range"),length:1,tick:{fill:l?l.getStyle(r,"legend.label","color"):void 0,fontSize:l?l.getStyle(r,"legend.label","fontSize"):void 0,fontFamily:l?l.getStyle(r,"legend.label","fontFamily"):"'Source Sans Pro', 'Arial', 'sans-serif'"},title:{anchor:!i||"top"!==u.layout.dock&&"bottom"!==u.layout.dock?void 0:"right",padding:parseFloat(u.settings.title.fontSize)||16}}},{settings:o,style:a})}(e,t)}function MY(e,t,n){var r=[],i=[],o=EY(e,t,n&&n.navigationDisabled);return r.push(o),o&&"legend-cat"===o.type&&(i.push(function(e){var t=e.key,n=e.requireFailure,r=e.recognizeWith,i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var r;if(!n)return!0;if(null!=i&&null!==(r=i.interact)&&void 0!==r&&r.enabled&&!i.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),i.push(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.eventName,r=t.key,i=t.requireFailure,o=t.recognizeWith,a=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(r),type:"Pan",requireFailure:i,recognizeWith:o,options:{event:n,pointers:1,threshold:10,enable:function(e,t){var i;return this.started===n||!t||!(null!=a&&null!==(i=a.interact)&&void 0!==i&&i.enabled&&!a.interact.enabled())&&this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}).some((function(e){return e.key==="".concat(r,"-cat")}))}},events:(e={},WU(e,"".concat(n,"start"),(function(e){e.preventDefault(),this.started!==n&&(this.started=n,this.chart.component("".concat(r,"-cat")).emit("panstart",e))})),WU(e,"".concat(n,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panmove",e)})),WU(e,"".concat(n,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(r,"-cat")).emit("panend",e),this.started=!1})),e)}}(e,n))),{interactions:i,components:r}}var TY=function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")};function DY(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=fY(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(e,t){var n=t.layout,r=t.app;return mY(e,{layout:n,app:r})})).getMeasure((function(e,t){var n=t.layout,r=t.app;return gY(e,{layout:n,app:r})})).getAttributeDimension((function(e,t){var n=t.layout,r=t.model,i=t.app;return vY(e,{layout:n,model:r,app:i})}));return n.getSnapshotData=pY,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=FU({},i),r={},!n.key)throw new Error("Missing key");t.set(FU(FU({},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=FU(FU({},r.settings),r.auxiliarySettings),r.scales=void 0,r.color=void 0,r.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(i())},getSnapshotData:function(e){var n=i();return t.getAuxiliaryData(n,e).then((function(e){return t.getSnapshotData(n,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=i();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=i().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(i(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,r=e.theme,i=[];if(n&&n.palettes&&r){var o=n.palettes.categorical||t.dimensionScheme,a=r.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||r.getDataColorPalettes()[0];o&&a&&i.push({key:"categorical",colors:a.colors});var s=n.palettes.metric||t.measureScheme,l=r.getDataColorScales().filter((function(e){return e.key===s}))[0];if(l){var u=l.colors[0]?l.colors:[[]].concat(YU(l.colors.slice(1)));u=Array.isArray(u[0])?u.map((function(e){return e.slice().reverse()})):u.slice().reverse(),i.push({key:"quant",colors:u})}}return i}({coloring:i(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return r.scales=r.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,r=e.rtl,i=e.key,o=e.source,a=e.picasso,s={},l=i;if(n){var u={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(YU((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(YU((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var c,d=yY({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var f=0,p={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return p[t]=f++,e[0]}}),c={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return p[e.qElemNumber]}}}}}}var h={data:d,range:n.range,domain:n.domain,explicit:u,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};s[l]=h,c&&(s["".concat(l,"Legend")]=FU(FU({},h),{},{data:c})),t&&t.qHasOtherValues&&c&&((c||h.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var m={data:{field:n.field},min:n.min,max:n.max};s[l]=i$({},m,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=i$({},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:u,type:"categorical-color"};s[l]=g}else if("measure"===n.mode){var v={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t,r;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(r=t.exclude)&&void 0!==r&&r.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:u,type:"categorical-color"};s[l]=v}}return s}({hc:n.hc,coloring:i(),key:n.key,source:n.source,picasso:e.picasso}),r.scales},color:function(){return r.color=r.color||function(e){var t=e.coloring,n=e.scales,r=e.key,i=bY(r),o=bY("".concat(r,"IsAnOther")),a=function(e,t){var r=e.fieldType,a=e.invalid,s=e.mode,l=e.nil,u=e.others,c=e.primary,d=e.type;return a?function(e){return wY(e)||o(e)?u:l}:n[t]?function(e){return wY(e)?u:xY(e)||-2===i(e)&&"dimension"===r||"NaN"===i(e)?l:o(e)?u:e.resources.scale(t)(i(e))||u}:"constant"===s?function(e){return wY(e)||o(e)?u:xY(e)?l:c}:"color"===d?function(e){return wY(e)||o(e)?u:xY(e)?l:i(e)||u}:null},s=a(t,r);if(t.measureOverrides){var l=bY("".concat(r,"MeasureIdx")),u=t.measureOverrides.map((function(e){return e&&a(e)}));return function(e){var t=l(e);return u[t]?u[t](e):s(e)}}return s}({coloring:i(),scales:this.scales(),key:n.key}),r.color},datumProps:function(e){return function(e){var t,n,r=e.hc,i=e.coloring,o=e.scales,a=e.key,s=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=a,c=i.nil;"field"===i.mode&&i.field?t=i.field:o[a]&&"field"===i.mode&&(t=o[a].data.field||i.field),t?(n={field:t,reduce:"first"},"color"===i.type&&(n.value=function(e){return"NaN"!==e.qNum?TY(e.qNum):e.qText&&T$(e.qText)?e.qText:c})):"dimension"===i.mode?n=void 0!==i.field?i.field:r.qDimensionInfo.length-1:"measure"===i.mode&&(n=l);var d=WU({},u,n);return r.qDimensionInfo.length>1&&(d["".concat(u,"IsAnOther")]={fields:r.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),s&&(d["".concat(u,"MeasureIdx")]=l),d}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:i().measureOverrides},e)},data:function(){var e=i(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,r=e.key,o=e.viewState,a=e.chart,s=e.rtl,l=e.styleReference,u=void 0===l?"object.legend":l,c=e.settings,d=void 0===c?{}:c,f=e.style,p=void 0===f?{}:f,h=arguments.length>1?arguments[1]:void 0;return MY({eventName:t,key:r,rtl:s,viewState:o,chart:a,styleReference:u,settings:d,style:p},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},h)}};return o}var _Y=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function NY(e){var t=e.qHyperCube,n=t.qDimensionInfo,r=t.qMeasureInfo,i=n.some(_Y),o=r.some(_Y),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!i?"off":a}function qY(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=FU(FU(FU({},e),t),{},{colorProps:FU(FU({},e.colorProps),t.colorProps||{})});return n}var RY=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function PY(e){var t,n=e.qHyperCube.qDimensionInfo.some(RY),r=e.qHyperCube.qMeasureInfo.some(RY),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 AY=function(){};function IY(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}function OY(e,t,n){if(void 0!==e&&void 0!==t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0===o[s]&&(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}}function LY(){var e={};return{get:function(t){return e[t]},set:function(t,n){return e[t]=n,n},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}function zY(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return function(){for(var r=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var s=function(){return e.apply(r,o)};clearTimeout(t),t=setTimeout(s,n)}}function FY(e){var t=e.originalArray,n=e.newArray,r=e.matchKey;return Array.isArray(t)&&t.length?(n.forEach((function(e){var n=-1;t.some((function(t,i){return t[r]&&t[r]===e[r]&&(n=i),n})),n>-1?t[n]=e:t.push(e)})),t):n}function jY(e){return(jY="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function HY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BY(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function VY(e,t,n){return t&&BY(e.prototype,t),n&&BY(e,n),e}function WY(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UY(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 $Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?UY(Object(n),!0).forEach((function(t){WY(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UY(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function YY(e,t){return(YY=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function XY(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function KY(e,t,n){return(KY=XY()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&YY(i,n.prototype),i}).apply(null,arguments)}function GY(e){return function(e){if(Array.isArray(e))return ZY(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||JY(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 JY(e,t){if(e){if("string"==typeof e)return ZY(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)?ZY(e,t):void 0}}function ZY(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var QY=Object.prototype.hasOwnProperty,eX=Object.prototype.toString,tX=Object.defineProperty,nX=Object.getOwnPropertyDescriptor,rX=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===eX.call(e)},iX=function(e){if(!e||"[object Object]"!==eX.call(e))return!1;var t,n=QY.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&QY.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||QY.call(e,t)},oX=function(e,t){tX&&"__proto__"===t.name?tX(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},aX=function(e,t){if("__proto__"===t){if(!QY.call(e,t))return;if(nX)return nX(e,t).value}return e[t]},sX=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=aX(s,n),s!==(i=aX(t,n))&&(c&&i&&(iX(i)||(o=rX(i)))?(o?(o=!1,a=r&&rX(r)?r:[]):a=r&&iX(r)?r:{},oX(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&oX(s,{name:n,newValue:i}));return s};function lX(e,t,n){if(!e)return-1;var r=n.cache,i=e.origin?e.origin():null;i&&(e=i);var o=r.fields.indexOf(e),a=-1,s=-1;if(-1===o)for(var l=0;l<r.wrappedFields.length;l++)if(s=r.wrappedFields[l].attrDims.map((function(e){return e.instance})).indexOf(e),a=r.wrappedFields[l].attrExps.map((function(e){return e.instance})).indexOf(e),-1!==s||-1!==a){o=l;break}return(o-=t.qArea.qLeft)<0||o>=t.qArea.qWidth?-1:s>=0?function(e){return e[o].qAttrDims.qValues[s]}:a>=0?function(e){return e[o].qAttrExps.qValues[a]}:function(e){return e[o]}}function uX(e,t,n){var r=n.key,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 cX(e){var t=e.cache,n=e.f,r=e.mainCell,i=e.p;e.prop;var o=e.page,a=e.rowIdx,s=e.row,l=e.sourceKey,u=e.target,c=e.targetProp,d=r;if(i.field&&i.field!==n){var f=lX(i.field,o,{cache:t});if(-1===f)return;d=sX({qRow:a},f(s))}u[c]=uX(i,d,{key:l})}function dX(e,t,n,r){for(var i=Array.isArray(e)?e:[e],o=[],a=0;a<i.length;a++)if(void 0!==i[a].field){for(var s=t.raw(),l=t.key(),u="object"===jY(i[a].field)?i[a].field:t.field(i[a].field),c=r.normalizeConfig(i[a],t),d=c.props,f=c.main,p=Object.keys(d),h=!!i[a].trackBy,m=jY(i[a].trackBy),g={},v=[],y=[],b=0;b<s.qDataPages.length;b++){var x=lX(u,s.qDataPages[b],{cache:n});if(-1!==x)for(var w=0;w<s.qDataPages[b].qMatrix.length;w++){var k=s.qDataPages[b].qArea.qTop+w,C=sX({qRow:k},x(s.qDataPages[b].qMatrix[w])),S=uX(f,C,{key:l});if(!f.filter||f.filter(C)){for(var E=0;E<p.length;E++){var M=d[p[E]],T=M.fields||[M];M.fields&&(S[p[E]]=[]);for(var D=0;D<T.length;D++)cX({cache:n,f:u,mainCell:C,p:T[D],prop:p[E],props:d,page:s.qDataPages[b],rowIdx:k,row:s.qDataPages[b].qMatrix[w],sourceKey:l,target:M.fields?S[p[E]]:S,targetProp:M.fields?D:p[E]});if(M.fields){var _=S[p[E]].map((function(e){return e.value})),N=S[p[E]].map((function(e){return e.label}));S[p[E]]={value:"function"==typeof M.value?M.value(_):void 0!==M.value?M.value:_,label:"function"==typeof M.label?M.label(N):void 0!==M.label?String(M.label):String(S[p[E]].value)}}}h&&r.track({cfg:i[a],itemData:C,obj:S,target:v,tracker:g,trackType:m}),y.push(S)}}}h?o.push.apply(o,GY(r.collect(v,{main:f,propsArr:p,props:d}))):o.push.apply(o,y)}return o}function fX(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 pX(e,t){var n,r,i,o,a,s=new vX(e),l=+e.value&&(s.value=e.value),u=[s];for(null==t&&(t=hX);n=u.pop();)if(l&&(n.value=+n.data.value),(i=t(n.data))&&(a=i.length))for(n.children=new Array(a),o=a-1;o>=0;--o)u.push(r=n.children[o]=new vX(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(gX)}function hX(e){return e.children}function mX(e){e.data=e.data.data}function gX(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function vX(e){this.data=e,this.depth=this.height=0,this.parent=null}function yX(e){if("function"!=typeof e)throw new Error;return e}vX.prototype=pX.prototype={constructor:vX,count:function(){return this.eachAfter(fX)},each:function(e){var t,n,r,i,o=this,a=[o];do{for(t=a.reverse(),a=[];o=t.pop();)if(e(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length);return this},eachAfter:function(e){for(var t,n,r,i=this,o=[i],a=[];i=o.pop();)if(a.push(i),t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n]);for(;i=a.pop();)e(i);return this},eachBefore:function(e){for(var t,n,r=this,i=[r];r=i.pop();)if(e(r),t=r.children)for(n=t.length-1;n>=0;--n)i.push(t[n]);return this},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(){var e=[];return this.each((function(t){e.push(t)})),e},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return pX(this).eachBefore(mX)}};var bX={depth:-1},xX={};function wX(e){return e.id}function kX(e){return e.parentId}function CX(e,t){"/"===e.charAt(0)&&(e=e.substring(1));for(var n,r=e.split("/"),i=t,o=0;o<r.length;o++){if("*"===r[o]&&Array.isArray(i)){var a=[];n=r.slice(o+1).join("/");for(var s=0;s<i.length;s++){var l=CX(n,i[s]);Array.isArray(l)?a.push.apply(a,GY(l)):a.push(l)}return a}if(!r[o]&&Array.isArray(i)){var u=new Array(i.length);n=r.slice(o+1).join("/");for(var c=0;c<i.length;c++)u[c]=CX(n,i[c]);return u}r[o]in i&&(i=i[r[o]])}return i}function SX(e,t,n){var r=[];if(!e||!e.length)return r;if(t<=0){var i=n>=0?[e[n]]:e;r.push.apply(r,GY(i))}else for(var o=0;o<e.length;o++)e[o].children&&e[o].children.length&&r.push.apply(r,GY(SX(e[o].children,t-1,n)));return r}function EX(e,t,n){if(e===t)return function(e){return e};if(e>t){var r=Math.max(0,Math.min(100,e-t)),i=GY(Array(r)).map(String.prototype.valueOf,"parent").join(".");return Function("node","return node.".concat(i,";"))}if(t>e){var o=Math.max(0,Math.min(100,t-e));return function(e){return SX(e.children,o-1,n)}}return!1}function MX(e,t){var n=t.cache;if("number"==typeof e)return n.fields[e];var r=n.allFields;if("function"==typeof e){for(var i=0;i<r.length;i++)if(e(r[i]))return r[i];return!1}if("string"==typeof e){for(var o=0;o<r.length;o++)if(r[o].key()===e||r[o].title()===e)return r[o]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}var TX=/^qDimensionInfo(?:\/(\d+))?/,DX=/^\/?qMeasureInfo\/(\d+)/,_X=/\/qAttrExprInfo\/(\d+)/,NX=/\/qAttrDimInfo\/(\d+)/;function qX(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((function(e,t){return t}))).filter((function(t){return t<e.qDimensionInfo.length}))}function RX(e,t){var n=t.cube;if(!e)return-1;var r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,u=-1,c=r,d=n.qEffectiveInterColumnSortOrder,f=qX(n);return TX.test(c)&&(i=!0,o=+TX.exec(c)[1],c=r.replace(TX,"")),DX.test(c)&&("K"===n.qMode?l=+DX.exec(c)[1]:d&&-1!==d.indexOf(-1)?(l=+DX.exec(c)[1],u=0):u=+DX.exec(c)[1],c=c.replace(DX,"")),c&&(NX.exec(c)?s=+NX.exec(c)[1]:_X.exec(c)&&(a=+_X.exec(c)[1])),{fieldDepth:(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))+1,pseudoMeasureIndex:l,measureIdx:u,attrDimIdx:s,attrIdx:a}}function PX(e,t){var n,r,i=EX(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?function(e){return e.data.qValues[t.measureIdx]}:function(e){return e.data},t.attrDimIdx>=0?r=function(e){var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=function(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 AX(e,t,n){var r=n.key,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 IX(e){for(var t=e.propsArr,n=e.props,r=e.item,i=e.itemData,o=e.ret,a=e.sourceKey,s=0;s<t.length;s++){var l=n[t[s]],u=l.fields||[l],c=void 0,d=void 0;l.fields&&(c=[],d=[]);for(var f=function(e){var n=u[e],f=void 0,p=void 0,h=void 0,m=void 0,g=void 0,v=void 0;if("primitive"===n.type?(h=n.value,v=String(n.value)):("function"==typeof n.value&&(f=function(e){return n.value(e,r)}),"function"==typeof n.label&&(p=function(e){return n.label(e,r)}),n.accessor?(m=n.accessor(r),Array.isArray(m)?(g=m.map(n.valueAccessor),n.attrAccessor&&(g=g.map(n.attrAccessor)),f&&(h=g.map(f),f=null),p&&(v=g.map(p),p=null),h=n.reduce?n.reduce(h):h,v=n.reduceLabel?n.reduceLabel(v,h):String(h)):v=h=n.attrAccessor?n.attrAccessor(n.valueAccessor(m)):n.valueAccessor(m)):(h=i,v=i)),l.fields){var y=f?f(h):h;c.push(y),d.push(p&&null!=v?p(v):null!=v?v:String(y))}else{var b=f?f(h):h;o[t[s]]={value:b,label:p?p(v):null!=v?v:String(b)},n.field&&(o[t[s]].source={field:n.field.key(),key:a})}},p=0;p<u.length;p++)f(p);c&&(o[t[s]]={value:"function"==typeof l.value?l.value(c,r):c,label:"function"==typeof l.label?l.label(d,r):d})}}var OX=function(e,t,n){var r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=CX(r,e);return o&&o[0]?(t.tree=pX(o[0],n.children||function(e){return e[i]}),t.tree):null};function LX(e){for(var t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){var t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((function(e,t){return t}))}(e),r=e.fields(),i=e.fields().filter((function(e){return"dimension"===e.type()})).map((function(e){return n.indexOf(r.indexOf(e))})),o=e.fields().filter((function(e){return"measure"===e.type()})).map((function(e){return n.indexOf(r.indexOf(e))})),a={__root:{__id:"__root",qValues:[]}},s=0;s<t.length;s++){for(var l=t[s],u="__root",c=!1,d=0;d<i.length;d++){var f=l[i[d]],p="".concat(u,"__").concat(f.qText);a[p]||(a[p]=$Y({__id:p,__parent:u,qValues:[]},f),c=!0),u=p}if(c)for(var h=0;h<o.length;h++){var m=l[o[h]];a[u].qValues.push(m)}}var g=Object.keys(a).map((function(e){return a[e]}));return function(){var e=wX,t=kX;function n(n){var r,i,o,a,s,l,u,c=n.length,d=new Array(c),f={};for(i=0;i<c;++i)r=n[i],s=d[i]=new vX(r),null!=(l=e(r,i,n))&&(l+="")&&(f[u="$"+(s.id=l)]=u in f?xX:s);for(i=0;i<c;++i)if(s=d[i],null!=(l=t(n[i],i,n))&&(l+="")){if(!(a=f["$"+l]))throw new Error("missing: "+l);if(a===xX)throw new Error("ambiguous: "+l);a.children?a.children.push(s):a.children=[s],s.parent=a}else{if(o)throw new Error("multiple roots");o=s}if(!o)throw new Error("no root");if(o.parent=bX,o.eachBefore((function(e){e.depth=e.parent.depth+1,--c})).eachBefore(gX),o.parent=null,c>0)throw new Error("cycle");return o}return n.id=function(t){return arguments.length?(e=yX(t),n):e},n.parentId=function(e){return arguments.length?(t=yX(e),n):t},n}().id((function(e){return e.__id})).parentId((function(e){return e.__parent}))(g)}var zX=function(e){for(var t=e.propsArr,n=e.props,r=e.cube,i=e.cache,o=e.itemDepthObject,a=e.f,s=0;s<t.length;s++)for(var l=n[t[s]],u=l.fields?l.fields:[l],c=0;c<u.length;c++){var d=u[c];if(d.field!==a){var f=PX(o,RX(d.field,{cube:r,cache:i}));d.accessor=f.nodeFn,d.valueAccessor=f.valueFn,d.attrAccessor=f.attrFn}}};function FX(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=t.raw(),o=t.key(),a="S"===i.qMode?LX(t):OX(i,n,e);if(!a)return null;for(var s=a.height,l=[],u=0;u<=s;u++){var c=null;if(u>0)if("S"===i.qMode){var d=qX(i),f=d[u-1];c=n.fields[f]}else{var p=i.qEffectiveInterColumnSortOrder[u-1];u>i.qEffectiveInterColumnSortOrder.length&&(p=i.qDimensionInfo.length),c=n.fields[p]}var h=r.normalizeConfig($Y($Y({},e),{},{field:c?c.key():void 0}),t),m=h.props,g=h.main,v=Object.keys(m);l[u]={propsArr:v,props:m,main:g};var y=c?RX(c,{cube:i,cache:n}):{fieldDepth:0};zX({propsArr:v,props:m,cube:i,cache:n,itemDepthObject:y,f:c})}for(var b=a.copy(),x=b.descendants(),w=a.descendants(),k=0;k<w.length;k++){var C=l[w[k].depth].propsArr,S=l[w[k].depth].props,E=l[w[k].depth].main,M=x[k],T=M.data,D=AX(E,T,{key:o});IX({propsArr:C,props:S,item:M,itemData:T,ret:D,sourceKey:o,isTree:!0}),w[k].data=D}return a}function jX(e,t,n,r){for(var i=Array.isArray(e)?e:[e],o=[],a=0;a<i.length;a++)if(void 0!==i[a].field){var s=t.raw(),l=t.key();if(!OX(s,n,e))continue;var u="object"===jY(i[a].field)?i[a].field:t.field(i[a].field),c=r.normalizeConfig(i[a],t),d=c.props,f=c.main,p=Object.keys(d),h=RX(u,{cube:s,cache:n}),m=PX({fieldDepth:0},h),g=m.nodeFn,v=m.attrFn,y=m.valueFn;zX({propsArr:p,props:d,cube:s,cache:n,itemDepthObject:h,f:u});for(var b=!!i[a].trackBy,x=jY(i[a].trackBy),w={},k=[],C=g(n.tree),S=[],E=0;E<C.length;E++){var M=C[E],T=v?v(y(M)):y(M);if(!f.filter||f.filter(T)){var D=AX(f,T,{key:l});IX({propsArr:p,props:d,item:M,itemData:T,ret:D,sourceKey:l}),b&&r.track({cfg:i[a],itemData:T,obj:D,target:k,tracker:w,trackType:x}),S.push(D)}}b?o.push.apply(o,GY(r.collect(k,{main:f,propsArr:p,props:d}))):o.push.apply(o,S)}return o}var HX,BX=(function(e){
|
|
86
86
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
87
|
-
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,d,f=e.length,p=e.search(/[0-9\-\+#]/),h=p>0?e.substring(0,p):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),v=f-g,y=e.substring(v,v+1),b=v+("."===y||","===y?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(p,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(m="",v=(d=t[0]).length%l,f=d.length,b=0;b<f;b++)m+=d.charAt(b),!((b-v+1)%l)&&b<f-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),h+(n?"-":"")+r+x}}(HX={exports:{}}),HX.exports);function VX(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}var WX={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"},UX=/%$/,$X=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,YX=/^\(oct\)/i,XX=/^\(dec\)/i,KX=/^\(hex\)/i,GX=/^\(bin\)/i,JX=/^\(rom\)/i,ZX=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,QX=/#|0/g;function eK(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 tK(e,t,n){var r=VX(e);return n?r:new RegExp(r||"",t)}function nK(e,t,n){var r,i,o,a,s,l,u,c,d,f,p,h=e.pattern;h.indexOf("A")>=0&&(h=h.replace("A",""),e.abbreviate=!0),f=t,(p=n)&&(p=VX(p)),f&&(f=VX(f)),d=new RegExp("(?:[#0]+".concat(f,")?[#0]+(?:").concat(p,"[#0]+)?")),a=(o=(o=h.match(d))?o[0]:"")?h.substr(0,h.indexOf(o)):h,s=o?h.substring(h.indexOf(o)+o.length):"",o||(o=h?"#":"##########"),t&&t===n&&(i=(r=o.split(n)).pop(),o=r.join("")+n+i,t=""),l=t,t=/,/.test(n)?"¤":",",l&&(o=o.replace(tK(l,"g"),t)),u=n,n=".",u&&(o=o.replace(tK(u,"g"),n)),c=(c=o.match(/#/g))?c.length:0;var m,g=h.split(u);g[1]&&(m=g[1].match(QX)),e.prefix=a||"",e.postfix=s||"",e.pattern=h,e.maxPrecision=m?m.length:2,e.percentage=UX.test(h),e.numericPattern=o||"",e.numericRegex=new RegExp("".concat(tK(t,null,!0),"|").concat(tK(n,null,!0)),"g"),e.groupTemp=l,e.decTemp=u,e.t=t,e.d=n,e.temp=c}var rK=function(){function e(t,n,r,i,o){HY(this,e),this.localeInfo=t,this.pattern=n,this.thousandDelimiter=r||",",this.decimalDelimiter=i||".",this.type=o||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return WX;var n={};return e.qNumericalAbbreviation.split(t).forEach((function(e){var t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(t,this.patternSeparator),this.prepare()}return VY(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}},{key:"prepare",value:function(e,t,n){var r;void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),e?(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],ZX.test(e[0])&&(r.positive.isFunctional=!0),e[1]?ZX.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?ZX.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1,r.positive.isFunctional||nK(r.positive,t,n),r.negative&&!r.negative.isFunctional&&nK(r.negative,t,n),r.zero&&!r.zero.isFunctional&&nK(r.zero,t,n)):this._prepared={pattern:!1}}},{key:"formatValue",value:function(e){var t,n,r,i,o,a,s,l,u,c=this._prepared,d="",f="",p=e;if(isNaN(e))return"".concat(p);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return(c=c.zero).pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=function(e,t,n){var r;return $X.test(t)?e=eK(e,Number(/\d{2}/.exec(t)[0]),t,n):YX.test(t)?e=eK(e,8,t,n):XX.test(t)?e=eK(e,10,t,n):KX.test(t)?e=eK(e,16,t,n):GX.test(t)?e=eK(e,2,t,n):JX.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){for(var n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){var h,m,g=Object.keys(this.abbreviations).map((function(e){return parseInt(e,10)})).sort((function(e,t){return e-t})),v=g[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);v<=n&&s<g.length;)v=g[++s];s>0&&(h=g[s-1]),h&&n>0&&h>0?m=h:(n<0&&h<0||!h)&&(v<0&&v-n<=c.maxPrecision?m=v:h<=n&&!(v>0&&-n<=c.maxPrecision)&&(m=h)),m&&(d=this.abbreviations[m],e/=Math.pow(10,m))}if(r=Math.abs(e),t=c.temp,u=(l=c.numericPattern).split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,u||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{var y=Number(e.toFixed(Math.min(20,u?u.length:0)).split(".")[0]),b=l.split(o)[0];if(e=BX(b+=o,y)||"0",u){var x=Math.max(0,Math.min(14,u.length)),w=u.replace(/#+$/,"").length,k=("I"===this.type?0:r%1).toFixed(x).slice(2).replace(/0+$/,"");for(s=k.length;s<w;s++)k+="0";k&&(e+=o+k)}else 0===y&&(i=0)}else if(r>=Math.pow(10,t)||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),f=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=BX(l,e)}e=e.replace(c.numericRegex,(function(e){return e===a?c.groupTemp:e===o?c.decTemp:""})),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+f+d+c.postfix}}],[{key:"getStaticFormatter",value:function(){return{prepare:function(){},formatValue:function(e){return"".concat(e)}}}}]),e}();function iK(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.size,o=void 0===i?5e3:i,a=r.multipleArguments,s=void 0!==a&&a,l=r.toKey,u=void 0===l?function(e){return e}:l,c=Object.create(null),d=Object.create(null),f=0,p=0;return(t=s?function(){return n=u.apply(void 0,arguments),t.has(n)?t.get(n):t.set(n,e.apply(void 0,arguments))}:function(r){return n=u(r),t.has(n)?t.get(n):t.set(n,e(r))}).set=function(e,t){return f>=o&&(delete c[d[p]],delete d[p],f--,p++),c[e]=t,d[f]=e,f++,t},t.get=function(e){return c[e]},t.has=function(e){return e in c},t.clear=function(){c=Object.create(null),d=Object.create(null),f=0,p=0},t.size=function(){return f},t}function oK(e,t,n,r,i){var o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return KY(rK,t)}(i,e,t,n,r),a=iK(o.formatValue.bind(o),{toKey:function(e){return isNaN(e)?e:+e}});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}var aK=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],sK=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],lK=["January","February","March","April","May","June","July","August","September","October","November","December"],uK=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function cK(e,t){for(var n=e.length;n<t;n++)e="0".concat(e);return e}function dK(e){var t=e.toString().split(".");return t[1]?t=Number("0.".concat(t[1])):0}var fK=function(){function e(t,n,r){HY(this,e);var i,o=t||{};o.qCalendarStrings||(o.qCalendarStrings={qLongDayNames:aK,qDayNames:sK,qLongMonthNames:lK,qMonthNames:uK}),this.localeInfo=o,this.locale_days=o.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=o.qCalendarStrings.qDayNames.slice(),this.locale_months=o.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=o.qCalendarStrings.qMonthNames.slice(),n||(n=(WY(i={},"T",o.qTimeFmt||"hh:mm:ss"),WY(i,"D",o.qDateFmt||"YYYY-MM-DD"),WY(i,"TS",o.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"),i)[r]),this.pattern=n}return VY(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");var n,r,i,o,a,s=/t+/gi.test(t);e instanceof Date?(i=s,o=(r=e).getUTCHours(),i&&((o%=12)||(o=12)),(a=r.getUTCDay()-1)<0&&(a=6),n={year:r.getUTCFullYear(),month:r.getUTCMonth(),day:a,date:r.getUTCDate(),h:o,m:r.getUTCMinutes(),s:r.getUTCSeconds(),f:r.getUTCMilliseconds(),t:r.getUTCHours()>=12?"pm":"am"}):(e<0&&(e=-e,t="-".concat(t)),n=function(e,t){var n,r=function(e){var t=e,n=24*dK(t),r=60*dK(n),i=60*dK(r),o=1e3*dK(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,u=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(u=n?n.getDay()-1:0)<0&&(u=6);var c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:i,h:o,m:a,s:s,f:l,t:c}}(e,t));var l=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:cK("".concat(t.year).slice(-2),2),YYY:cK("".concat(t.year).slice(-3),3),def:function(e){return cK("".concat(t.year),e.length)}},"M+":{M:t.month+1,MM:cK("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:cK("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:function(e){return cK("".concat(t.date),e.length)}},"h+|H+":{h:t.h,def:function(e){return cK("".concat(t.h),e.length)}},"m+":{m:t.m,def:function(e){return cK("".concat(t.m),e.length)}},"s+|S+":{s:t.s,def:function(e){return cK("".concat(t.s),e.length)}},"f+|F+":{def:function(e){var n="".concat(t.f),r=e.length-n.length;if(r>0)for(var i=0;i<r;i++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def:function(e){var n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n.slice(0,e.length)}}}}(this,n),u=[];for(var c in l)Object.prototype.hasOwnProperty.call(l,c)&&u.push(c);var d=new RegExp(u.join("|"),"g");return t.replace(d,(function(e){var t,n,r;for(n in l)if(Object.prototype.hasOwnProperty.call(l,n)&&(t=new RegExp(n)).test(e))break;if(!t)return"";for(var i in l[n])if(i===e||i.toLowerCase()===e){void 0===(r=l[n][i])&&(r=l[n][i.toLowerCase()]);break}return void 0===r&&(r=l[n].def),"function"==typeof r&&(r=r(e)),r}))}}]),e}();function pK(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return KY(fK,t)}function hK(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}function mK(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=pK(n,e,t),i=iK(r.format.bind(r),{toKey:function(e){return"object"===jY(e)&&"function"==typeof e.getTime?e.getTime():e}});function o(e){return"IV"!==t?hK(e):e}function a(e){return e=o(e),i(e)}return a.format=function(e,t){return i.clear(),t=o(t),r.format(t,e)},a.locale=function(n){return r=pK(n,e,t),i=iK(r.format.bind(r),{toKey:function(e){return"object"===jY(e)?e.getTime():e}}),this},a.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},a}function gK(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return mK(e.qNumFormat.qFmt,e.qNumFormat.qType,t);var n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##A"),o="U"),oK(n,r,i,o,t)}function vK(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.meta,r=t.id,i=t.key,o=t.localeInfo,a=t.fieldExtractor,s=t.value,l=t.type,u=t.sourceField,c=s||("dimension"===l?function(e){return e.qElemNo}:function(e){return e.qValue}),d=function(e){return e.qText||""},f="dimension"===l?"first":"avg",p=gK(n,o),h="dimension"===l?"first":function(e,t){return p(t)},m={id:function(){return r},key:function(){return i},raw:function(){return n},title:function(){return n.qFallbackTitle||n.label},type:function(){return l},origin:function(){return u},items:function(){return e||(e=a(m)),e},min:function(){return n.qMin},max:function(){return n.qMax},value:c,label:d,reduce:f,reduceLabel:h,formatter:function(){return p},tags:function(){return n.qTags}};return m}function yK(e,t,n,r,i){return(t[e]||[]).map((function(t,o){var a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:vK(sX({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=yK("qAttrDimInfo",t,n,a,sX({},i,{value:function(e){return e.qElemNo},type:"dimension"})),s.attrExps=yK("qAttrExprInfo",t,n,a,sX({},i,{value:function(e){return e.qNum},type:"measure"})),s.measures=yK("qMeasureInfo",t,n,a,sX({},i,{value:function(e){return e.qValue},type:"measure"})),s}))}function bK(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.key,o=r.data,a=r.config,s=void 0===a?{}:a,l={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},u=o;if(!u)throw new Error('Missing "data" input');if(!u.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');var c=bK.util,d={cache:l,cube:u,localeInfo:s.localeInfo,fieldExtractor:null,pages:null,hierarchy:function(){return null},virtualFields:s.virtualFields},f={key:function(){return i},raw:function(){return u},field:function(e){return MX(e,d)},fields:function(){return l.fields.slice()},extract:function(e){return d.extractor(e,f,l,c)},hierarchy:function(e){return d.hierarchy(e,f,l,c)},_cache:function(){return l}};"K"===u.qMode||"T"===u.qMode||!u.qMode&&u.qNodesOnDim?(d.extractor=jX,d.hierarchy=FX,d.pages="K"===u.qMode?u.qStackedDataPages:u.qTreeDataPages):"S"===u.qMode?(d.extractor=dX,d.pages=u.qDataPages,d.hierarchy=FX):d.extractor=function(){return[]},d.fieldExtractor=function(e){return d.extractor({field:e},f,l,c)};var p="S"===u.qMode?function(e){return e.qElemNumber}:void 0,h="S"===u.qMode?function(e){return e.qNum}:void 0;(e=l.wrappedFields).push.apply(e,GY(yK("qDimensionInfo",u,i,"",sX({},d,{value:p,type:"dimension"})))),(t=l.wrappedFields).push.apply(t,GY(yK("qMeasureInfo",u,i,"",sX({},d,{value:h,type:"measure"})))),l.fields=l.wrappedFields.map((function(e){return e.instance}));var m=function e(t){t.forEach((function(t){l.allFields.push(t.instance),e(t.measures),e(t.attrDims),e(t.attrExps)}))};return m(l.wrappedFields),(s.virtualFields||[]).forEach((function(e){var t=f.field(e.from),n=vK($Y({meta:t.raw(),id:"".concat(i,"/").concat(e.key),sourceField:t,fieldExtractor:function(e){return d.extractor({field:e},f,l,c)},key:e.key,type:t.type(),localeInfo:d.localeInfo,value:t.value},e.override||{}));l.virtualFields.push(n)})),(n=l.allFields).push.apply(n,GY(l.virtualFields)),f}var xK=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],wK=/\/qDimensionInfo(?:\/(\d+))?/,kK=/\/qMeasureInfo\/(\d+)/,CK=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,SK=/\/qAttrExprInfo\/(\d+)/,EK=/\/?qHyperCube/,MK=/\/?qTreeData/,TK=function(e){return"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14))},DK=function(e){return"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13))};function _K(e,t){var n=e,r=-1,i=-1,o="",a=function(e){return e};EK.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=TK):MK.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=DK);var s=!0;if(wK.test(e)&&(r=+wK.exec(e)[1]),kK.test(e)&&(i=+kK.exec(e)[1]),CK.test(e)){i=-1,r=0;var l=+CK.exec(n)[2];isNaN(l)||(r=l,n=n.replace(/\/\d+$/,"")),s=!1}if(SK.test(e)){var u=i;if(t){i=0;var c=CX(o,t);i+=(c.qMeasureInfo||[]).length,r>-1?(i=c.qDimensionInfo.slice(0,r).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),r=-1):(i=c.qDimensionInfo.reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),i=c.qMeasureInfo.slice(0,u).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i)),i+=+SK.exec(n)[1]}else r>-1?(r=-1,i=+SK.exec(n)[1]):i+=+SK.exec(n)[1]+1}return xK.forEach((function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(e,t)||JY(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,2),r=t[0],i=t[1];n=n.replace(r,i)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}function NK(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=n.byCells,o=n.primarySource,a=[],s={},l=e.isActive(),u=!1;return e.brushes().forEach((function(e){var t=_K(e.id,r);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){var n=e.brush.ranges();n.length&&(u=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((function(e){return 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){var l=e.brush.ranges();l.length&&(u=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),l.forEach((function(e){return 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){var c=e.brush.ranges();c.length&&(u=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),c.forEach((function(e){return 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(i)if(r&&r.qHyperCube&&("P"===r.qHyperCube.qMode||"T"===r.qHyperCube.qMode||"K"===r.qHyperCube.qMode)){var d=r.qHyperCube,f=d.qNoOfLeftDims,p=d.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===o||!o){var h=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));(0===f||p>=f)&&f>-1?h.forEach((function(e){s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:p-f})})):h.forEach((function(e){s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),u=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==o&&(o||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)})),u=!!s.selectHyperCubeCells.values.length);else{var m=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));u=!!m.length,a.push({params:[t.path,t.dimensionIdx,m,!1],method:"selectHyperCubeValues"})}}})),!u&&l?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&a.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(t=n.orMode)||void 0===t||t]}),s.selectHyperCubeContinuousRange&&a.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&a.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&a.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&a.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),a)}function qK(e){bK.util=e.data("matrix").util,e.data("q",bK),e.formatter("q-number",oK),e.formatter("q-time",mK)}function RK(e){var t=IY(e.layout||{},e.path.split("/").join("."));if(!t)return!1;var n=t.qIsOneAndOnlyOne;return void 0!==n&&n}function PK(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(null==e||!e.length)return!1;var t=e.filter((function(e){return"object"===HU(e.data)&&Array.isArray(e.data.fields)})).every((function(e){return e.data.fields.every((function(e){var t=e.raw();return!(!t.qLocked&&t.qCardinal)}))}));return t}function AK(e){var t=e.brush,n=e.colorField,r=e.legendAlias,i=e.useLegendCube,o=void 0!==i&&i;!n||/qAttrDimInfo/.test(n)?(t.removeKeyAlias("attrDim/qDimensionInfo/0"),r&&t.removeKeyAlias(r),t.addKeyAlias("attrDim/qDimensionInfo/0","qHyperCube/".concat(n))):o&&t.addKeyAlias(r,"qHyperCube/".concat(n))}qK.qBrushHelper=NK,qK.selections=NK;var IK="Shift";function OK(e){var t=e.brush,n=e.getConfig;return{interceptor:function(e){var r=t.brushes(),i=n(),o=i.allowSimultaneous,a=i.layout,s=void 0===a?{}:a;r.forEach((function(n){var r,i,a;("range"===n.type||null!==(r=e[0])&&void 0!==r&&r.key&&(null===(i=e[0])||void 0===i?void 0:i.key)!==n.id&&0!==o.indexOf(null===(a=e[0])||void 0===a?void 0:a.key))&&t.clear([])}));var l=e.filter((function(e){return-2!==e.value}));return l.length>1?function(e){var t=e.layout,n=void 0===t?{}:t,r=e.values,i=void 0===r?[]:r;if(null==i||!i.length)return[];var o=Array.from(new Set(i.map((function(e){return e.key})))),a=[];return o.forEach((function(e){var t=RK({layout:n,path:e}),r=i.filter((function(t){return t.key===e})),o=t?[r.pop()]:r;a.push.apply(a,YU(o))})),a.filter(Boolean)}({layout:s,values:l}):l},rangeInterceptor:function(e){var r=t.brushes(),i=n().allowSimultaneous;return r.filter((function(e){return"value"===e.type})).length?(t.clear([]),e):(r.forEach((function(n){var r=n.id===e[0].key||i.includes(n.id)&&i.includes(e[0].key);"range"!==n.type||r||t.clear([])})),e)}}}var LK=function e(t,n){return n[t]?e(t+1,n):t},zK=function(e,t){var n=t.reduce((function(e,t){return e[t]=!0,e}),{});return e.reduce((function(e,t,r){var i=LK(r,n);return n[i]=!0,e[r]=i,e}),{})};function FK(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.layout,n=e.filtered,r=void 0===n?{}:n,i=(null==t?void 0:t.qHyperCube)||{},o=i.qDimensionInfo,a=void 0===o?[]:o,s=i.qMeasureInfo,l=void 0===s?[]:s;return{dimensions:zK(a,r.dimensions||[]),measures:zK(l,r.measures||[])}}function jK(e){var t=e.selection,n=e.fieldMap,r=t.method,i=t.params;if("selectHyperCubeValues"===r){var o=n.dimensions[i[1]];void 0!==o&&(i[1]=o)}return"rangeSelectHyperCubeValues"===r&&i[1].forEach((function(e){var t=n.measures[e.qMeasureIx];void 0!==t&&(e.qMeasureIx=t)})),"selectHyperCubeContinuousRange"===r&&i[1].forEach((function(e){var t=n.dimensions[e.qDimIx];void 0!==t&&(e.qDimIx=t)})),t}var HK=[],BK=0,VK=function(e){var t=HK.filter((function(e){var t;return null===(t=e.selections)||void 0===t?void 0:t.isActive()}));t.length&&("Enter"===e.key?t.forEach((function(e){return e.selections.confirm()})):"Escape"!==e.key&&"Esc"!==e.key||t.forEach((function(e){return e.selections.cancel()})))},WK=function(){document.addEventListener("keyup",VK)},UK=function(){document.removeEventListener("keyup",VK)},$K=function(e,t){Object.keys(t).forEach((function(n){e.on(n,t[n])}))},YK=function(e,t){Object.keys(t).forEach((function(n){e.removeListener(n,t[n])}))};function XK(e,t,n){if(t&&void 0!==n&&"selectHyperCubeContinuousRange"===e.method){var r=e.params;if(r&&r[1]&&r[1][0]){var i=r[1][0],o=i.qDimIx,a=i.qRange;"undefined"!==o&&a&&!1===a.qMaxInclEq&&a.qMax>=n&&(a.qMaxInclEq=!0)}}}function KK(e){var t=e.chart,n=e.document,r=e.selectionInfo,i=e.eventName,o=e.componentName,a=e.brushName,s=void 0===a?"selection":a,l=e.emit,u=void 0===l?"rangeClear":l,c=r.event===i,d=n.querySelector("[data-key='".concat(o,"-edge-0']"));if(c||!d)return!1;var f=t.component(o);return!!f&&(f.emit(u),"string"==typeof s&&t.brush(s).clear(),f)}function GK(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"discreteRange":i,a=e.componentName,s=void 0===a?"discrete-range-brush":a,l=e.cleared;return KK({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,emit:"areaClear",brushName:e.brushName})}function JK(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"continuousRange":i,a=e.componentName,s=void 0===a?"continuous-range-brush":a,l=e.cleared;return KK({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,brushName:e.brushName})}function ZK(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.componentName,o=void 0===i?"minor-range-brush":i,a=e.eventName,s=void 0===a?"minorRange":a,l=e.cleared,u=void 0!==l&&l,c=e.brushName,d=KK({selectionInfo:t,chart:n,document:r,eventName:u?void 0:s,componentName:o,brushName:void 0!==c&&c});if(d){var f=d.settings.settings,p=f.scale,h=f.brush,m=n.scale(p).data().fields.map((function(e){return e.id()})),g=n.brush(h),v=g.brushes().filter((function(e){return"range"===e.type&&m.some((function(t){return t===e.id}))}));g&&v.length&&v.forEach((function(e){g.removeRanges(e.brush.ranges().map((function(t){return{key:e.id,range:t}})))}))}}function QK(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"xAxis":o,s=e.cleared;KK({selectionInfo:t,chart:n,document:r,eventName:void 0!==s&&s?void 0:a,componentName:"".concat(a,"-range-brush"),emit:"areaClear",brushName:!1})&&i.clear()}function eG(e){var t=e.chart,n=e.selectionInfo,r=e.selections,i=e.events,o=void 0===i?["tap"]:i,a=e.brushNames,s=void 0===a?[]:a;if(n&&o.includes(n.event)){var l=n.currentComponent;n.previousComponent!==l&&(r.clear(),s.forEach((function(e){return t.brush(e).end()})))}}function tG(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"legendRange":o,s=e.componentName,l=void 0===s?"legend-range-brush":s,u=e.cleared,c=void 0!==u&&u,d=e.brushName;KK({selectionInfo:t,chart:n,document:r,eventName:c?void 0:a,componentName:l,brushName:void 0!==d&&d})&&i.clear()}var nG=["chart","document","selections","selectionInfo"],rG=function(e){e.chart,e.document,e.selections,e.selectionInfo;var t=UU(e,nG);t.clearDiscrete(),t.clearContinuous(),t.clearMinor(),t.clearRange(),t.clearTap(),t.clearLegend()};function iG(e){var t,n=e.lasso;null!=n&&null!==(t=n.active)&&void 0!==t&&t.call(n)&&(null==n||n.action(!1))}function oG(e){var t,n=e.chart,r=e.selectionInfo,i=e.selectionActions,o=e.actions,a=void 0===o?{}:o,s=e.selections,l=e.selectionEvents;if(!1===i||!1===l)return function(){};var u=(a||{}).lasso,c=void 0!==u&&u,d=i.reset,f=void 0===d?iG:d,p=i.clear,h=!1!==p&&function(e){var t=e.clear,n=void 0===t?rG:t,r=e.selections,i=e.selectionInfo,o=e.chart;return function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).cleared,t={selections:r,selectionInfo:i,chart:o,document:document,cleared:e};return n(FU({clearDiscrete:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return GK(FU(FU({},t),e))},clearContinuous:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return JK(FU(FU({},t),e))},clearMinor:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ZK(FU(FU({},t),e))},clearRange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return QK(FU(FU({},t),e))},clearTap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return eG(FU(FU({},t),e))},clearLegend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return tG(FU(FU({},t),e))}},t))}}({clear:p,selections:s,selectionInfo:r,chart:n}),m=function(e){var t=e.chart,n=e.lasso,r=e.reset,i=e.clear,o=!1,a={deactivated:function(e){r({e:e,lasso:n})},canceled:function(e){r({e:e,lasso:n}),i({e:e,chart:t,document:document})},cleared:function(e){o||(o=!0,i({e:e,chart:t,document:document,cleared:!0}),o=!1)}};return!1===r&&delete a.deactivated,!1===i&&delete a.cleared,!1===r&&!1===i&&delete a.canceled,a}({chart:n,clear:h,reset:f,lasso:c}),g={};Object.entries(m).forEach((function(e){var t=$U(e,2),n=t[0],r=t[1];g[n]=function(e,t){return t?function(n){return t({event:n,defaultFunc:e})}:e}(r,l[n])}));var v=function(e){var t=e.selectionEvents,n=e.selections,r=e.selectionInfo,i=e.clear,o=e.chart,a=e.document,s=t.start,l={selections:n,selectionInfo:r,chart:o,document:a},u=function(e){return Object.assign(r,e||{})},c=function(e){var t=e.event,n=e.components;return function(){return function(e){var t=e.selectionInfo,n=e.clear,r=e.event,i=e.components,o=void 0===i?[]:i;(0,e.setSelectionInfo)(FU(FU({},void 0===t?{}:t),{},{event:r,components:o.map((function(e){return e.key})).filter(Boolean)})),n()}({event:t,components:n,clear:i,chart:o,selectionInfo:r,setSelectionInfo:u})}};return"function"==typeof s?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];s(FU(FU({defaultFunc:c({event:e,components:t}),setSelectionInfo:u,clear:i},l),{},{event:e,components:t}))}:function(e){c({event:e,components:arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]})()}}({selectionEvents:l,selections:s,selectionInfo:r,clear:h,chart:n,document:document});return null==a||null===(t=a.select)||void 0===t||t.on("start",v),Object.entries(g).forEach((function(e){var t=$U(e,2),n=t[0],r=t[1];null==s||s.on(n,r)})),function(){var e;null==a||null===(e=a.select)||void 0===e||e.removeListener("start",v),Object.entries(g).forEach((function(e){var t=$U(e,2),n=t[0],r=t[1];null==s||s.removeListener(n,r)}))}}var aG=[{key:"qHyperCube/qDimensionInfo/0:numeric",includeMax:!1}];function sG(e){var t=e.chart,n=e.actions,r=e.selections,i=e.picassoQ,o=e.config,a=o.allowSimultaneous,s=void 0!==a&&a,l=o.majorScale,u=void 0===l?void 0:l,c=o.selectionActions,d=(c=void 0===c?{}:c).clear,f=c.reset,p=o.selectionEvents,h=void 0===p?{deactivated:void 0,canceled:void 0,cleared:void 0,start:void 0}:p,m=o.brushEvents,g=void 0===m?{}:m,v=o.brushName,y=void 0===v?"selection":v,b=o.brushMaxListeners,x=void 0===b?20:b,w=o.brushRanges,k=void 0!==w&&w,C=o.interceptors,S=void 0===C?{}:C,E=o.selectionsFn,M=void 0===E?i.selections:E,T=t.brush(y);if("number"==typeof x&&T.setMaxListeners(x),k){var D=!0===k?aG:k;T.configure({ranges:D})}var _={canSelect:!0,getIsSelectionLocked:!1,isInnerDimensionLocked:!1,lockedDimensions:[],singleSelectIndex:0,selectionInfo:{colorField:void 0,components:[],event:void 0,currentComponent:void 0,previousComponent:void 0}},N=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.selections,r=t.brush,i=t.majorScale,o=t.actions,a=t.selectionsFn,s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).path,l=void 0===s?"/qHyperCubeDef":s;if(!n)return{layout:function(){},filteredFields:function(){},allowSimultaneous:function(){},release:function(){}};var u=++BK,c=null,d={dimensions:[],measures:[]},f=[],p={};n.on=n.on.bind(n),n.isActive=n.isActive.bind(n),n.addListener=n.addListener.bind(n),n.removeListener=n.removeListener.bind(n);var h=OK({brush:r,getConfig:function(){return{layout:c,allowSimultaneous:f}}}),m=h.rangeInterceptor,g=h.interceptor;r.intercept("set-ranges",m),r.intercept("toggle-ranges",m),r.intercept("toggle-values",g),r.intercept("set-values",g),r.intercept("add-values",g),r.on("start",(function(){return n.begin(l)}));var v={activate:function(){},deactivated:function(){return r.end()},cleared:function(){return r.clear()},canceled:function(){return r.end()}};$K(n,v);var y=null==i||null===(e=i.max)||void 0===e?void 0:e.call(i);return null!=o&&o.select?(o.select.on("start",(function(){var e;r.start(),"function"==typeof o.select.getBrushOptions&&(p=(e=o.select).getBrushOptions.apply(e,arguments))})),o.select.on("end",(function(){var e=a(r,p,c),t=FK({layout:c,filtered:d});e.forEach((function(e){var r=jK({selection:e,fieldMap:t});XK(r,o.select.brushSelectionIncludeMax,y),n.select(r)}))}))):r.on("update",(function(){var e=a(r,p,c),t=FK({layout:c,filtered:d});e.forEach((function(e){n.select(jK({selection:e,fieldMap:t}))}))})),0===HK.length&&WK(),HK.push({key:u,selections:n}),{layout:function(e){c=e},filteredFields:function(e){d=e},allowSimultaneous:function(e){f=e},release:function(){c=null;var e=HK.indexOf(HK.filter((function(e){return e.key===u}))[0]);-1!==e&&HK.splice(e,1),HK.length||UK(),YK(n,v)}}}({brush:T,majorScale:u,actions:n,selections:r,picassoQ:i,selectionsFn:M});!function(e){var t=e.brush,n=e.interceptors,r=void 0===n?{}:n;Object.entries(r).forEach((function(e){var n=$U(e,2),r=n[0],i=n[1];(Array.isArray(i)?i:[i]).forEach((function(e){t.intercept(r,e)}))}))}({brush:T,interceptors:S});var q=function(e){var t=e.chart,n=e.selectionActions,r=e.brush,i=e.actions,o=e.selectionInfo,a=e.selections,s=e.selectionEvents,l=function(e){var t=e.brush,n=e.chart,r=e.selectionInfo,i=e.brushEvents,o=void 0===i?{}:i,a=Object.entries(o).map((function(e){var i=$U(e,2),o=i[0],a=i[1],s=function(){return a({chart:n,selectionInfo:r})};return t.on(o,s),[o,s]}));return function(){a.forEach((function(e){var n=$U(e,2),r=n[0],i=n[1];t.removeListener(r,i)}))}}({brush:r,chart:t,selectionInfo:o,brushEvents:e.brushEvents}),u=oG({chart:t,selectionInfo:o,selectionActions:n,actions:i,selections:a,selectionEvents:s}),c=function(e){var t=e.actions;if(null==t||!t.lasso)return function(){};var n=!1,r=function(e){n||e.key!==IK||(t.lasso.action(!0),n=!0)},i=function(e){e.key===IK&&(t.lasso.action(!1),n=!1)};return document.addEventListener("keydown",r),document.addEventListener("keyup",i),function(){document.removeEventListener("keydown",r),document.removeEventListener("keyup",i)}}({actions:i});return function(){l(),u(),c()}}({chart:t,brush:T,actions:n,selections:r,selectionInfo:_.selectionInfo,selectionActions:{clear:d,reset:f},selectionEvents:h,brushEvents:g});if(s){var R=!0===s?YU(Array(15)).map((function(e,t){return"qHyperCube/qMeasureInfo/".concat(t)})):s;N.allowSimultaneous(R)}return{unbindEvents:q,state:_,picassoSelections:N,brush:T}}var lG=["colorField","useLegendCube"];function uG(e){var t=e.chart,n=e.selections,r=e.actions,i=void 0!==r&&r,o=e.config,a=void 0===o?{}:o,s=sG({chart:t,actions:i,selections:n,picassoQ:qK,config:a}),l=s.unbindEvents,u=s.state,c=s.picassoSelections,d=s.brush,f=a.custom,p=void 0===f?{}:f,h=a.legendAlias,m=void 0===h?void 0:h,g=a.setBrushAliases,v=void 0===g?AK:g;return{getIsDimensionLocked:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return u.lockedDimensions[e]},getIsSelectionLocked:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return null!==(e=null==n||null===(t=n.isLocked)||void 0===t?void 0:t.call(n))&&void 0!==e?e:PK(r)},getIsSingleSelect:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.singleSelectIndex;return u.singleSelectDimensions[e]},getCanSelect:function(){return u.canSelect},getSelectionInfo:function(){return u.selectionInfo},setLayout:function(e){var t=function(e){var t,n,r,i=e.selections,o=e.picassoSelections,a=e.layout,s={lockedDimensions:[],singleSelectDimensions:[]};null!=i&&null!==(t=i.isModal)&&void 0!==t&&t.call(i)&&i.confirm(),o.layout(a);var l=(null!==(n=null==a?void 0:a.qHyperCube)&&void 0!==n?n:{}).qDimensionInfo,u=void 0===l?[]:l;return s.lockedDimensions=u.map((function(e){return!!e.qLocked})),s.singleSelectDimensions=u.map((function(e,t){return RK({layout:a,path:"qHyperCube/qDimensionInfo/".concat(t)})})),s.singleSelectIndex=function(e){var t,n=((null==e?void 0:e.qHyperCube)||{}).qDimensionInfo,r=void 0===n?[]:n;return null!==(t=r.map((function(e,t){var n;return!(e.qLocked||(null===(n=e.qCardinalities)||void 0===n?void 0:n.qHypercubeCardinal)<=1)&&t})).filter((function(e){return"number"==typeof e}))[0])&&void 0!==t?t:Math.max(r.length-1,0)}(a),s.canSelect=0===u.length||u.some((function(e){return!e.qLocked})),s.dimensionLocked=!(null===(r=u[0])||void 0===r||!r.qLocked),s}({selections:n,picassoSelections:c,layout:e});Object.assign(u,t)},setFilteredFields:function(e){c.filteredFields(e)},setBrushAliases:function(e){var t=e.colorField,n=e.useLegendCube,r=void 0!==n&&n,i=UU(e,lG),o=FU({useLegendCube:r,colorField:t,brush:d,legendAlias:m},i);v(FU(FU({},o),{},{defaultFunc:function(){return AK(o)}}))},destroy:function(){l(),c.release()},custom:FU({},p)}}var cG="'Source Sans Pro', 'Arial', 'sans-serif'",dG="#595959",fG="#737373",pG="#cccccc",hG="#e6e6e6";function mG(e){var t={};return[].concat(YU(e),YU([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",dG],["object","axis.label.name","fontFamily",cG],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",pG],["object","axis.line.minor","color",hG],["object","axis.title","color"],["object","axis.title","fontFamily",cG],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",hG],["object","grid.line.major","color",pG],["object","grid.line.minor","color",hG],["object","label.value","color",dG],["object","label.value","fontFamily",cG],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",dG],[!1,"label.value","lightColor",hG],["object","outOfRange","color","#999"],["object","referenceLine.label.name","color","#333333"],["object","referenceLine.label.name","fontFamily",cG],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",hG],["object","referenceLine.outOfBounds","fontFamily",cG],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",fG,function(e){return"transparent"===e?fG:e}]])).reduce((function(e,n){var r="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[r]||(t[r]=!0,e.push(n)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var gG=function(e){return e};function vG(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,a={},s=r.reduce((function(e,t){var n=$U(t,2),r=n[0],i=n[1];return e[r]=i,e}),{});return o.forEach((function(e){var r=$U(e,5),i=r[0],o=r[1],l=r[2],u=r[3],c=r[4],d=void 0===c?function(e){return e}:c,f=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,a=void 0===o?void 0:o;if(!t||!1===n)return a;var s=t.getStyle(n,r,i);return void 0===s?a:s}({theme:t,base:"object"===i&&n?"".concat("object",".").concat(n):i,path:o,attribute:l,defaultValue:u}),p=(s["".concat(o,".").concat(l)]||gG)(d(f));OY(a,[o,l].filter(Boolean).join("."),p)})),i.forEach((function(e){var t=$U(e,2),n=t[0],r=t[1];OY(a,n,r)})),a}var yG={NOOP:function(){},FALSE:function(){return!1},ARRAY:function(){return[]},OBJECT:function(){return{}}},bG="chart-modules-tooltip",xG="#".concat(bG);function wG(){if(!document.querySelector(xG)){var e=document.createElement("div");e.id=bG,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 kG(e){return{show:!0,key:e.key,type:"tooltip",layout:{displayOrder:3},beforeMount:function(){wG()},beforeUpdate:function(){wG()},destroyed:function(){var e;null!=(e=document.querySelector(xG))&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)},settings:{appendTo:function(){return document.querySelector(xG)},direction:e.rtl?"rtl":"ltr",duration:e.duration},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:"'Source Sans Pro', 'Arial', 'sans-serif'","empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}var CG="position",SG={bar:"rect",diamond:"path",point:"circle",square:"rect",triangle:"path","n-polygon":"path",slice:"path"},EG=function(e){return e.data.value},MG=function(e){var t,n=e.data;return null==n||null===(t=n.major)||void 0===t?void 0:t.value};function TG(e){var t=e.chart,n=e.expando,r=e.nodes,i=e.collectConfig,o=e.collectibles,a=e.meta,s=i.from,l={chart:t,expando:n,nodes:r,collectConfig:i,collectibles:o,meta:a};switch("function"==typeof s?"custom":s){case"single":return function(e){var t=$U(e.nodes,1)[0];return["container"===t.type&&t.children[0]||t]}(l);case"position":return function(e){var t=e.collectibles,n=e.meta;return e.chart.shapesAt(n.position.absolute,{components:t.map((function(e){return{key:e.key}}))})}(l);case"dimension":return function(e){var t=e.chart,n=e.collectConfig,r=e.collectibles,i=$U(e.nodes,1)[0],o=n.filter,a="function"==typeof o?o:function(){return!0},s=n.by,l=void 0===s?EG:s;return r.reduce((function(e,n){var r=n.major,o=void 0===r?MG:r,a=SG[n.type]||n.type;return e.push.apply(e,YU(t.findShapes(a).filter((function(e){return e.key===n.key&&e.data&&o({data:e.data})===l({data:i.data})})))),e}),[]).filter(a)}(l);case"radius":return function(e){var t=e.chart,n=e.collectConfig,r=e.collectibles,i=e.meta,o=$U(e.nodes,1)[0].localBounds,a=n.distance,s=n.filter,l="function"==typeof s?s:function(){return!0},u=r.map((function(e){return e.key}));return t.shapesAt({cx:i.position.absolute.x,cy:i.position.absolute.y,r:a||Math.max(o.width,o.height)},{components:u.map((function(e){return{key:e}}))}).filter(l)}(l);case"custom":return function(e){var t=e.chart,n=e.expando,r=e.nodes,i=e.meta;return e.collectConfig.from({chart:t,expando:n,nodes:r,meta:i})}(l);default:return[]}}var DG=Number.MAX_VALUE;function _G(e){var t=e.nodes.reduce((function(e,t){var n=t.bounds;return e.xMin=Math.min(e.xMin,n.x,n.x+n.width),e.yMin=Math.min(e.yMin,n.y,n.y+n.height),e.xMax=Math.max(e.xMax,n.x,n.x+n.width),e.yMax=Math.max(e.yMax,n.y,n.y+n.height),e}),{xMin:DG,xMax:-DG,yMin:DG,yMax:-DG}),n=t.xMin,r=t.xMax,i=t.yMin;return{x:n,y:i,width:r-n,height:t.yMax-i}}function NG(e){var t=e.chart,n=e.config,r=e.expando,i=e.placementConfig,o=e.hovered,a=e.collected,s=e.meta,l=function(e){for(var t=e.chart,n=e.config,r=e.expando,i=e.placementConfig,o=e.hovered,a=e.collected,s=e.meta,l=$U(o,1)[0],u=Array.isArray(i)?i:[i],c={bounds:l.bounds,key:l.key},d=_G({nodes:a}),f=0;f<u.length;f++){var p=u[f];if("function"==typeof p){var h=p({chart:t,expando:r,hovered:o,collected:YU(a),meta:s,collectedBounds:d,combineBounds:_G});if(h)return h}if("trigger"===p)return c;if("collectible"===p){var m=n.main.placements.collectible;return{bounds:"function"==typeof m?m({collected:YU(a)}):d,key:a[0].key}}}return c}({chart:t,config:n,expando:r,placementConfig:i,hovered:o,collected:a,meta:s}),u=l.bounds,c=l.key,d=$U(a,1)[0].desc;return[{bounds:u,nodes:a,data:a.map((function(e){return e.data})),key:c,meta:s,desc:d}]}function qG(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.nodes;if(!o.length)return[];var a=$U(o,1)[0].key,s=n.main.collectibles;if(!s.length)return[];var l=n.main.triggers.find((function(e){return-1!==e.keys.indexOf(a)}))||{},u=l.collect,c=l.placement;if(!u||!u.from||!c)return[];var d={triggerer:a,position:i.get(CG)},f=(TG({chart:t,expando:r,nodes:o,collectConfig:u,collectibles:s,meta:d})||[]).map((function(e){return e.children.length?e.children[0]:e}));return f.length?NG({chart:t,config:n,expando:r,placementConfig:c,hovered:o,collected:f,meta:d}):[]}var RG=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),PG=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),AG=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),IG=function(e){return RG.test(e)},OG=function(e){return PG.test(e)||AG.test(e)};function LG(e){for(var t=e?e.length:0,n=0;n<t;n++){var r=e[n];if(IG(r))return"ltr";if(OG(r))return"rtl"}return"ltr"}function zG(e){var t=e.visibility;return{type:"divider",content:[{content:"",style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:2}],visibility:FU(FU({},{count:!1}),t)}}function FG(e){var t=e.config,n=e.h,r=e.context,i=e.nodes,o=e.property,a=e.filter,s=e.visibility,l=t.rtl,u={type:"color",label:void 0,value:void 0,content:[],filter:a,visibility:FU(FU({},{count:!0}),s)},c=t.getColorSettings();if("color"===c.type||!c.fieldType)return u;var d=$U(i,1)[0];if(u.value=function(e){var t=e.config,n=e.context,r=e.property,i=e.node,o=i.data[r];if(o){if(-3===i.data.value)return i.data.label;var a=n.resources.dataset(o.source.key).field(o.source.field).formatter(),s=o.value,l=o.label,u=t.getColorSettings();if(a&&"measure"===u.fieldType)return Number.isNaN(+s)?"-":a(o.value);var c=l||s;return void 0===c||Number.isNaN(c)||"NaN"===c?"-":c}}({config:t,context:r,property:o,node:d}),void 0===u.value)return u;u.label=function(e){var t=e.context,n=e.property,r=e.node,i=e.config.getColorSettings();if(i.label)return i.label;var o=r.data[n];if(o&&"color"!==i.type){var a=t.resources.dataset,s=o.source,l=s.key,u=s.field;return a(l).field(u).title()}}({config:t,context:r,property:o,node:d});var f=n("div",{style:{display:"inline-block",width:10,height:10,"background-color":function(e){var t=e.node.attrs;return(null==t?void 0:t.fill)||"#ddd"}({node:d}),margin:"0 8px"}});return u.content.push({content:l?[":",u.label]:[u.label,":"],style:{"text-align":l?"right":"left",direction:LG(u.label)}},{content:l?[u.value,f]:[f,u.value],style:{"text-align":l?"left":"right","vertical-align":"middle",direction:LG(u.value)}}),u}function jG(e){var t=e.config,n=e.h,r=e.context;return{section:function(e){return function(e){return{type:"section",content:e.content}}({content:e.content})},text:function(e){var n=e.value,r=e.style,i=e.visibility;return function(e){var t=e.config,n=e.value,r=e.style,i=(r=void 0===r?{}:r).bold,o=void 0!==i&&i,a=r.italic,s=e.visibility;return{type:"text",content:[{content:n,style:{"font-weight":o?"bold":"normal","font-style":void 0!==a&&a?"italic":"normal","text-align":t.rtl?"right":"left",direction:LG(n)},colspan:2}],visibility:FU(FU({},{count:!0}),s)}}({config:t,value:n,style:r,visibility:i})},measure:function(e){var r=e.label,i=e.value,o=e.color,a=e.style,s=e.survive,l=e.visibility;return function(e){var t,n,r,i,o=e.h,a=e.label,s=e.value,l=e.color,u=e.style,c=e.survive,d=e.visibility,f=e.config.rtl,p=o("div",{style:{display:"inline-block",width:10,height:10,"background-color":l,margin:"0 8px"}});return{type:"measure",label:a,value:s,content:[{content:f?[":",a]:[a,":"],style:{"text-align":f?"right":"left","font-weight":null!=u&&null!==(t=u.label)&&void 0!==t&&t.bold?"bold":"normal","font-style":null!=u&&null!==(n=u.label)&&void 0!==n&&n.italic?"italic":"normal",direction:LG(a)}},{content:l?f?[s,p]:[p,s]:s,style:{"text-align":f?"left":"right","vertical-align":"middle","font-weight":null!=u&&null!==(r=u.value)&&void 0!==r&&r.bold?"bold":"normal","font-style":null!=u&&null!==(i=u.value)&&void 0!==i&&i.italic?"italic":"normal",direction:LG(s)}}],survive:FU(FU({},{color:!1,duplicate:!1}),c),visibility:FU(FU({},{count:!0}),d)}}({config:t,h:n,label:r,value:i,color:o,style:a,survive:s,visibility:l})},divider:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.visibility;return zG({visibility:t})},row:function(e){return function(e){var t=e.visibility;return{type:"row",content:[{content:e.content,style:e.style,colspan:e.colspan}],visibility:FU(FU({},{count:!0}),t)}}({content:e.content,style:e.style,colspan:e.colspan,visibility:e.visibility})},raw:function(e){return function(e){var t=e.visibility;return{type:"raw",content:e.value,visibility:FU(FU({},{count:!0}),t)}}({value:e.value,visibility:e.visibility})},color:function(e){var i=e.nodes,o=e.property,a=e.filter,s=void 0===a||a,l=e.visibility;return FG({config:t,h:n,context:r,nodes:i,property:o,filter:s,visibility:l})}}}function HG(e){var t=e.chart,n=e.translator,r=e.config,i=e.expando,o=e.h,a=e.data,s=e.style,l=$U(a,1)[0],u=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.h,o=e.context,a=e.groups,s=o.node.meta,l=o.resources,u=l.dataset,c=l.formatter,d=jG({config:n,h:i,context:o}),f=function(e){var t=e.dataset;return{dataset:{title:function(e,n){return t(e).field(n).title()}}}}({dataset:u}),p=a.map((function(e){var t=d.section({content:YU((n.main.section({expando:r,h:i,nodes:e,dataset:u,formatter:c,meta:s,create:d,util:f})||[]).filter((function(e){var t;return null===(t=e.content)||void 0===t?void 0:t.length}))).filter(Boolean)});return t.content=function(e){var t=e.config,n=e.content,r=n.find((function(e){return"color"===e.type&&e.filter})),i=r?n.filter((function(e){return"measure"!==e.type||e.survive.color||e.label!==r.label||e.value!==r.value})):n;return t.main.showDuplicateMeasures?i:i.reduce((function(e,t){var n=t.type,r=t.survive;if("measure"!==n||r.duplicate)return e.filtered.push(t),e;var i="".concat(t.label,"-").concat(t.value);return e.memory[i]||(e.memory[i]=!0,e.filtered.push(t)),e}),{memory:{},filtered:[]}).filtered}({config:n,content:t.content}),t}));return n.main.sections({chart:t,expando:r,h:i,nodes:o.node.nodes,dataset:u,formatter:c,meta:s,create:d,util:f,sections:p}),p.filter(Boolean)}({chart:t,config:r,expando:i,h:o,context:l,groups:function(e){var t=e.config,n=e.nodes.reduce((function(e,n){var r=t.main.getGroupByValue({data:n.data});return e[r]||(e[r]={sorting:Object.keys(e).length,items:[]}),e[r].items.push(n),e}),{});return Object.keys(n).map((function(e){return n[e]})).sort((function(e,t){return e.sorting-t.sorting})).map((function(e){return e.items}))}({config:r,nodes:l.node.nodes})}),c=function(e){var t=e.translator,n=e.config,r=e.context,i=e.templates,o=n.main.layout,a=o.rows,s=o.grouping,l=o.single,u=function(e){var t=e.limit,n=e.grouping,r=e.single,i={count:0,overflow:0,index:{started:void 0,group:void 0}};return{process:function(e){var o=e.visibility,a=e.index;if(r&&0!==a)return n?(i.index.started!==a&&i.index.group!==a&&(i.overflow++,i.index.group=a),!1):(i.overflow++,!1);if(i.count>=t){if(!n)return i.overflow++,!1;if(i.index.started!==a)return i.index.group!==a&&(i.overflow++,i.index.group=a),!1}return o.count&&i.count++,n&&(i.index.started=a),!0},overflow:function(){return i.overflow}}}({limit:a,grouping:s,single:"function"==typeof l?l({meta:r.node.meta,sections:i}):l}),c=i.reduce((function(e,t,n){var r=t.type,o=t.content;"section"===r&&(void 0===o?[]:o).forEach((function(t){u.process({visibility:t.visibility,index:n})&&e.push(t.content)}));var a=n===i.length-1;return"divider"!==r||a||u.process({visibility:t.visibility,index:n})&&e.push(t.content),e}),[]).filter((function(e){return e.length})),d=u.overflow();return d&&c.push(function(e){var t=e.translator,n=e.config,r=e.count,i=t?t.get("Object.ChartTooltip.NMore",r):"+".concat(r," more"),o=LG(i);return[{content:i,style:{"font-weight":"bold","text-align":n.rtl?"right":"left",direction:o},colspan:2}]}({translator:t,config:n,count:d})),c}({translator:n,config:r,h:o,context:l,templates:u});return c.length?function(e){var t=e.h,n=e.style;return e.rows.map((function(e){return t("tr",{},e.map((function(e){var r={style:FU(FU({},n.cell||{}),e.style||{}),class:e.class};return e.colspan&&(r.colspan=e.colspan),t("td",r,e.content)})))}))}({h:o,style:s,rows:c}):function(e){var t=e.h;return t("tr",{},t("td",{style:{fontStyle:"italic",opacity:.75}},"Empty"))}({h:o})}function BG(e){var t=e.chart,n=e.translator,r=e.config,i=e.expando,o=e.internal;if(!r.main.key)return!1;var a=LY(),s=kG({key:r.main.key,rtl:r.rtl,duration:r.duration}),l=r.main.events.tooltip,u=l.afterShow,c=l.afterHide,d=function(){var e=a.get("collected");return{expando:i,nodes:e.nodes,meta:e.meta}};return i$(!0,s,{settings:{filter:function(e){return qG({chart:t,config:r,expando:i,internal:o,nodes:e})},extract:function(e){return a.set("collected",e.node),e},content:function(e){var o=e.h,a=e.data,s=e.style;return HG({chart:t,translator:n,config:r,expando:i,h:o,data:a,style:s})},placement:function(e){var t=e.nodes;return r.main.placement({meta:t[0].meta})},afterShow:function(){return u(d())},afterHide:function(){return c(d())}},style:{arrow:{color:r.style.background},content:r.style}})}function VG(e){var t=e.config,n=t.legend.keys;if(!n.tooltip||!n.component)return!1;if("categorical"!==t.getColorSettings().type)return!1;var r=kG({key:n.tooltip,rtl:t.rtl,duration:t.duration});return i$(!0,r,{settings:{filter:function(e){return e.filter((function(e){return e.data&&e.key===n.component}))},extract:function(e){return e},content:function(e){var t=e.h,n=e.data;return[t("tr",{},[t("td",{style:FU(FU({},e.style.cell||{}),{"font-weight":"bold","text-align":"left"}),colspan:2},n[0].node.data.label)])]},placement:"pointer"},style:{arrow:{color:t.style.background},content:t.style}})}function WG(e){var t=e.config.main.triggers.reduce((function(e,t){return t.keys.forEach((function(n){var r=t.distance||0;e.distance[n]=r,e.distances.includes(r)||e.distances.push(r),e.key[n]=!0,e.keys[r]||(e.keys[r]=[]),e.keys[r].push(n)})),e}),{distance:{},distances:[],key:{},keys:{}});return function(e){return e.components.filter((function(e){return t.key[e.key]})).reduce((function(e,n){e.any=!0,e.components.push(n.key);var r=t.distance[n.key];return 0===r?e.position.push(n.key):(e.distances.includes(r)||(e.distances.push(r),e.distanceKeys[r]=[]),e.distanceKeys[r].push(n.key)),e}),{any:!1,components:[],position:[],distances:[],distanceKeys:{}})}}function UG(e){var t=e.chart,n=e.event,r=e.component,i={absolute:{x:0,y:0},relative:{x:0,y:0}},o=t.element.getBoundingClientRect(),a=o.left,s=o.top;i.absolute.x=(void 0===n.clientX?Math.floor(n.srcEvent.clientX):n.clientX)-a,i.absolute.y=(void 0===n.clientY?Math.floor(n.srcEvent.clientY):n.clientY)-s;var l=t.component(r);if(l){var u=l.rect.computedInner;i.relative.x=i.absolute.x-u.x,i.relative.y=i.absolute.y-u.y}return i}function $G(e){var t=e.chart,n=e.hits,r=e.position,i=[];if(n.position.length&&i.push.apply(i,YU(t.shapesAt(r.absolute,{components:n.position.map((function(e){return{key:e}}))}))),!i.length&&n.distances.length){var o=[];n.distances.forEach((function(e){o.push.apply(o,YU(t.shapesAt({cx:r.absolute.x,cy:r.absolute.y,r:e},{components:n.distanceKeys[e].map((function(e){return{key:e}}))})))})),o.length&&i.push(function(e){var t=e.nodes,n=e.origin,r=t.find((function(e){return"path"===e.type}));if(r)return r;var i=function(e){var t=Math.abs(n.x-(e.localBounds.x+e.localBounds.width/2)),r=Math.abs(n.y-(e.localBounds.y+e.localBounds.height/2));return Math.sqrt(t*t+r*r)};return t.slice(1).reduce((function(e,t){var n=i(t);return n<e.distance&&(e.distance=n,e.node=t),e}),{node:t[0],distance:i(t[0])}).node}({nodes:o,origin:r.relative}))}return i}function YG(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.facade,a=n.delay.tap,s=WG({config:n}),l=n.main.triggers.reduce((function(e,t){return e.push.apply(e,YU(t.keys)),e}),[]);return{key:"event:".concat("tooltipTap"),type:"Tap",options:{event:"tooltipTap",enable:function(e,r){return!r||!!n.enable({event:r})&&t.componentsFromPoint({x:r.center.x,y:r.center.y}).filter((function(e){return-1!==l.indexOf(e.key)})).length>0}},recognizeWith:"tap",events:WU({},"tooltipTap",(function(e){if(e.preventDefault(),"mouse"!==e.pointerType&&!n.main.suppress({event:e})){var l=t.component(n.main.key);if(l&&l.show){var u=t.componentsFromPoint({x:e.center.x,y:e.center.y}),c=s({components:u});if(c.any){var d=$U(c.components,1)[0],f=UG({chart:t,event:e,component:d});i.set(CG,f);var p=$G({chart:t,hits:c,position:f});if(p.length){var h=p[0].key;n.main.events.tooltip.beforeShow({expando:r,event:e,collectNodes:function(){return o.collectNodes({nodes:p})},meta:{triggerer:h,position:f}}).then((function(){l.emit("show",e,{nodes:p,delay:a})})).catch((function(){}))}else l.emit("hide")}else l.emit("hide")}}}))}}function XG(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.facade,a=WG({config:n}),s=function(e){var t=e.config,n=e.expando,r=e.internal,i=e.facade,o=t.main.events.tooltip.beforeShow,a=t.delay.hover,s={ongoing:{},latest:void 0};return function(e){var t=e.event,l=e.tooltip,u=e.nodes,c=function(e){var t=e.nodes;return JSON.stringify(t.map((function(e){return{key:e.key,bounds:e.bounds,value:e.data.value}})))}({nodes:u});if(!s.ongoing[c]){s.ongoing[c]=!0,s.latest=c;var d=u[0].key;o({expando:n,event:t,collectNodes:function(){return i.collectNodes({nodes:u})},meta:{triggerer:d,position:r.get(CG)}}).then((function(){c===s.latest&&l.emit("show",t,{nodes:u,delay:a})})).catch((function(){l.emit("show")})).finally((function(){delete s.ongoing[c],c===s.latest&&(s.latest=void 0)}))}}}({config:n,expando:r,internal:i,facade:o}),l=[n.main.key,n.legend.keys.tooltip].filter(Boolean),u=function(){l.forEach((function(e){var n=t.component(e);null!=n&&n.show&&n.emit("hide")}))};return{type:"native",events:{mousemove:function(e){if(n.enable({event:e})&&!n.main.suppress({event:e})){var r=t.componentsFromPoint({x:e.clientX,y:e.clientY}),o=t.component(n.main.key);if(o&&o.show){var l=a({components:r});if(l.any){var u=$U(l.components,1)[0],c=UG({chart:t,event:e,component:u});i.set(CG,c);var d=$G({chart:t,hits:l,position:c});if(!d.length)return void o.emit("hide");s({event:e,tooltip:o,nodes:d})}else o.emit("hide")}var f=n.legend;if(f.keys.tooltip&&f.keys.component){var p=t.component(f.keys.tooltip);p&&p.show&&(r.some((function(e){return e.key===f.keys.component}))?p.emit("show",e):p.emit("hide"))}}},mouseup:function(e){2===e.button&&u()},mouseleave:function(){n.main.events.interaction.mouseleave({expando:r}),u()},wheel:function(){u()}}}}function KG(e){var t=e.chart,n=e.translator,r=function(e){var t=e.config;return i$(!0,{},{rtl:!1,enable:yG.FALSE,getColorSettings:yG.OBJECT,style:{fontSize:void 0,fontFamily:void 0,color:void 0,background:void 0},delay:{hover:500,tap:0},duration:8e3,main:{key:void 0,suppress:yG.FALSE,getGroupByValue:yG.NOOP,collectibles:[],triggers:[],placement:function(){return{type:"bounds"}},placements:{collectible:"combine"},showDuplicateMeasures:!1,layout:{rows:7,grouping:!1,single:!1},section:yG.ARRAY,sections:yG.NOOP,events:{tooltip:{beforeShow:function(){return Promise.resolve()},afterShow:yG.NOOP,afterHide:yG.NOOP},interaction:{mouseleave:yG.NOOP}}},legend:{keys:{tooltip:void 0,component:void 0}}},void 0===t?{}:t)}({config:e.config}),i=LY(),o=LY(),a={components:void 0,interactions:void 0};return{getComponents:function(){return a.components||(a.components=function(e){var t=e.config;return[BG({chart:e.chart,translator:e.translator,config:t,expando:e.expando,internal:e.internal}),VG({config:t})].filter(Boolean)}({chart:t,translator:n,config:r,expando:i,internal:o})),a.components},getInteractions:function(){return a.interactions||(a.interactions=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal;return{collectNodes:function(e){var o=e.nodes,a=$U(qG({chart:t,config:n,expando:r,internal:i,nodes:o}),1)[0];return(a=void 0===a?{nodes:[]}:a).nodes}}}({chart:t,config:n,expando:r,internal:i});return{gestures:[YG({chart:t,config:n,expando:r,internal:i,facade:o})],native:XG({chart:t,config:n,expando:r,internal:i,facade:o})}}({chart:t,config:r,expando:i,internal:o})),a.interactions},expando:i}}var GG={};function JG(){JG.init.call(this)}GG.isObject=function(e){return"object"==typeof e&&null!==e},GG.isNumber=function(e){return"number"==typeof e},GG.isUndefined=function(e){return void 0===e},GG.isFunction=function(e){return"function"==typeof e};var ZG=JG;JG.EventEmitter=JG,JG.prototype._events=void 0,JG.prototype._maxListeners=void 0,JG.defaultMaxListeners=10,JG.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},JG.prototype.setMaxListeners=function(e){if(!GG.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},JG.prototype.emit=function(e){var t,n,r,i,o,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],GG.isUndefined(n))return!1;if(GG.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(GG.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(a=n.slice()).length,o=0;o<r;o++)a[o].apply(this,i)}return!0},JG.prototype.addListener=function(e,t){var n;if(!GG.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,GG.isFunction(t.listener)?t.listener:t),this._events[e]?GG.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,GG.isObject(this._events[e])&&!this._events[e].warned)&&((n=GG.isUndefined(this._maxListeners)?JG.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,GG.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),GG.isFunction(console.trace)&&console.trace()));return this},JG.prototype.on=JG.prototype.addListener,JG.prototype.once=function(e,t){if(!GG.isFunction(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},JG.prototype.removeListener=function(e,t){var n,r,i,o;if(!GG.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||GG.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(GG.isObject(n)){for(o=i;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},JG.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],GG.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},JG.prototype.listeners=function(e){return this._events&&this._events[e]?GG.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},JG.listenerCount=function(e,t){return e._events&&e._events[t]?GG.isFunction(e._events[t])?1:e._events[t].length:0};function QG(){const e={};var t;return t=e,Object.keys(ZG.prototype).forEach((e=>{t[e]=ZG.prototype[e]})),ZG.init(t),e.lasso={active:()=>!1},e.select={on:e.on,removeListener:e.removeListener},e}function eJ({picasso:t}){var n;const r=e.useOptions(),i=e.useElement(),o=e.useSelections(),[a,s]=e.useState(),l=QG(),u=e.useLayout(),c=e.useTranslator(),d=!(null===(n=u.qSelectionInfo)||void 0===n||!n.qInSelections),[f,p]=e.useState(!1);return l.lasso=function({layout:e,isInSelections:t,isLassoActionActive:n,setIsLassoActionActive:r,translator:i}){var o,a,s;return{active:n,label:i.get(n?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),hidden:!t||!(null===(o=e.qHyperCube)||void 0===o||null===(a=o.qDimensionInfo)||void 0===a||null===(s=a[0])||void 0===s||!s.qIsOneAndOnlyOne),action(e){r("boolean"==typeof e?e:!n)},icon:{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"}}]}}}({layout:u,isInSelections:d,isLassoActionActive:f,setIsLassoActionActive:p,translator:c}),e.useAction((()=>(a&&(a.interactions.lasso.active=()=>f),{...l.lasso})),[a,f,d,c.language()]),e.useEffect((()=>{i.style.overflow="hidden";const e=t({renderer:{prio:[r.renderer||"canvas"]}}),n=e.chart({element:i,data:[],settings:{}}),a=uG({chart:n,actions:l,selections:o,config:{selectionActions:!1}});a.setLayout(u),a.setBrushAliases({colorField:"qDimensionInfo/0/qAttrDimInfo/0"});const c=function(e){var t=FU({},e),n={},r={},i=!1,o={get:function(e){return t[e]},set:function(e,o){var a=t[e];!i&&n[e]?t[e]=n[e](o,a):t[e]=o,!i&&r[e]&&r[e](t[e],a)},preventSet:function(e,t){i=!0,o.set(e,t),i=!1},intercept:function(e,t){n[e]=t},onChanged:function(e,t){r[e]=t}};return o}({legendScrollOffset:0,rotation:0});c.intercept("rotation",(e=>(c.get("rotation")+e)%(2*Math.PI))),c.onChanged("rotation",(()=>{n.update({partialData:!0})}));const d=LY();return l.on("selections-start",(()=>{n.brush("selection").start()})),s({picasso:e,chart:n,selectionService:a,viewState:c,viewCache:d,interactions:l}),()=>{a.destroy(),n.destroy(),l.removeAllListeners(),delete l.select,c.intercept("rotation",void 0),c.onChanged("rotation",void 0)}}),[]),a}const tJ={CUSTOM:{EXPRESSION:"customTooltipExpression",TITLE:"customTooltipTitle",DESCRIPTION:"customTooltipDescription",QUARANTINE:"customTooltip",IMAGES:"customTooltipImages"},CHART:{CONTAINER_ID:"tooltipContainerId",STATE:"customTooltipSessionState",CHART_OBJECT_ID:"customTooltipSessionObjectId",CHART_PARENT_TYPE:"TooltipChartParent",CHART_CHILD_TYPE:"TooltipChart",STYLE:{small:"140px",medium:"200px",large:"340px"}}};function nJ(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const rJ={getImageSize(e,t){let n;function r(){n&&(clearTimeout(n),n=null)}function i(e){const t=e;t.onload=null,t.onerror=null,r()}const o={small:50,medium:200,large:340,original:340};return new Promise((a=>{const s=new Image;s.referrerPolicy="no-referrer",s.onload=()=>{let e;const{height:n,width:l}=s,u=o[t]*(n>l?1:n/l),c=o[t]*(l>n?1:l/n);!n||!l||0===n&&0===l?(e={height:20,width:20,imageError:!0},i(s)):"original"===t?(e={height:Math.min(u,n),width:Math.min(c,l)},r()):(e={height:u,width:c},r()),a(e)},s.onerror=()=>{i(s),a({height:20,width:20,imageError:!0})},s.src=e,n=setTimeout((()=>{i(s),a({height:20,width:20,imageError:!0})}),3e3)}))}};async function iJ(e,t,n){let r=e.ref.qStaticContentUrl.qUrl;const i=function(e){var t,n,r,i,o;let a,s,l,u,c,d;if(e&&(null!==(t=e.session)&&void 0!==t&&t.options||null!==(n=e.enigmaModel)&&void 0!==n&&null!==(r=n.session)&&void 0!==r&&r.sessionConfig||null!==(i=e.session)&&void 0!==i&&null!==(o=i.config)&&void 0!==o&&o.url)){var f;if(a=e.session.options||(null===(f=e.enigmaModel)||void 0===f?void 0:f.session.sessionConfig),!a){var p;a=null===(p=e.session)||void 0===p?void 0:p.config;const t=new URL(a.url);a.host=t.hostname,a.port=t.port,a.isSecure="wss:"===t.protocol}return d=void 0!==a.secure?a.secure:a.isSecure,s=d?"https://":"http://",l=a.host||"localhost",u=a.port?":"+a.port:"",c=a.prefix?a.prefix:"/","/"!==c[c.length-1]&&(c+="/"),s+l+u+c}return""}(n);i&&(!function(e,t){const n=e.replace(t,"").replace(/^\.\.\//i,"/");n[0]}(r,i),r=r.replace(/"/g,'\\"'),r=r.replace(/'/g,"\\'"),r=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(r,i));const{height:o,width:a,imageError:s}=await rJ.getImageSize(r,t);return{src:r,size:t,height:o,width:a,imageError:s}}async function oJ(e,t,n,r){var i,o,a,s,l,u;const{app:c,flags:d}=t,f=null===(i=e.layout)||void 0===i||null===(o=i.tooltip)||void 0===o?void 0:o.imageComponents;if(!f)return[];const[p]=f,h=p.size||"small",m=p.type||"media";let g=-1;for(let e=0;e<n.length;e++)if(n[e].cId===p.cId){g=e;break}const v=(null===(a=r.data)||void 0===a||null===(s=a.customTooltipAttrExps)||void 0===s?void 0:s.value)||[];let y;if(-1!==g&&v[g]&&(y=v[g]),"media"===m&&null!==(l=p.ref)&&void 0!==l&&null!==(u=l.qStaticContentUrl)&&void 0!==u&&u.qUrl)return iJ(p,h,c);if("url"===m)return async function(e,t,n,r,i){let o,a=n.ref;if(i&&i.label&&(a=i.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&null!=e&&e.getImage&&nJ(a))try{const t="data:image/png;base64, "+await e.getImage(a),{height:n,width:i,imageError:s}=await rJ.getImageSize(t,r);o={src:t,size:r,height:n,width:i,imageError:s}}catch(e){}else{const{height:e,width:t,imageError:n}=await rJ.getImageSize(a,r);o={src:a,size:r,height:e,width:t,imageError:n}}return o}(c,d,p,h,y);if(d.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===m&&y&&y.label){return async function(e,t,n,r){let i;const o=r.label,a=`qmem://${t.qFallbackTitle}/${o}`;if(nJ(a))try{const t=await e.getImage(a);if(t){const e="data:image/png;base64, "+t,{height:r,width:o,imageError:a}=await rJ.getImageSize(e,n);i={src:e,size:n,height:r,width:o,imageError:a}}}catch(e){}return i}(c,n[g],h,y)}return[]}const aJ={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){const i=t,o=[];for(let t=0;t<i.length;t++)o.push(oJ(e,r,n,i[t]));const a=await Promise.all(o);for(let e=0;e<i.length;e++)i[e].data.customTooltipImages=[a[e]];return i},checkIfPromisesExist({customTooltipModel:e}){var t,n;const r=null===(t=e.layout)||void 0===t||null===(n=t.tooltip)||void 0===n?void 0:n.imageComponents;return!!r&&r.length>0}},sJ={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){let i=t;return i=await aJ.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}),i},checkIfPromisesExist:({customTooltipModel:e})=>aJ.checkIfPromisesExist({customTooltipModel:e})};const lJ=(e,t)=>{var n,r,i;const o=null==e||null===(n=e.qHyperCubeDef)||void 0===n?void 0:n.qDimensions,a=null==e||null===(r=e.qHyperCubeDef)||void 0===r?void 0:r.qMeasures,s=null==e||null===(i=e.qHyperCubeDef)||void 0===i?void 0:i.qInterColumnSortOrder,l=t;return{qInfo:{qType:tJ.CHART.CHART_PARENT_TYPE,qId:tJ.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:o,qMeasures:a,qInterColumnSortOrder:s,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:l}},uJ=e=>{var t,n,r;const i=null===(t=e.tooltip)||void 0===t||null===(n=t.chart)||void 0===n||null===(r=n.object)||void 0===r?void 0:r.refId;return{qInfo:{qType:tJ.CHART.CHART_CHILD_TYPE},qExtendsId:i}};const cJ={createContainer:({ctx:e,layout:t})=>{var n,r;if(!((null===(n=t.qHyperCube)||void 0===n||null===(r=n.qDimensionInfo)||void 0===r?void 0:r.length)<=0))return function(e,t){var n,r,i,o;const a=null!==(n=null===(r=t.tooltip)||void 0===r||null===(i=r.chart)||void 0===i||null===(o=i.style)||void 0===o?void 0:o.size)&&void 0!==n?n:"medium",s=tJ.CHART.STYLE[a];return[{content:[e.h("div",{style:{display:"flex",width:s,height:s,backgroundColor:"#FFFFFF",borderRadius:"5px",padding:"2px",color:"#595959"},colspan:2,id:tJ.CHART.CONTAINER_ID})],colspan:2,style:{"text-align":e.rtl?"right":"left","max-width":s,width:"100%"}},{}]}(e,t)},show:async({app:e,properties:t,selectedNodes:n,dimIndex:r,customTooltipModel:i,rtl:o})=>{var a,s,l;const u=i,c=null==t||null===(a=t.tooltip)||void 0===a||null===(s=a.chart)||void 0===s||null===(l=s.object)||void 0===l?void 0:l.refId;if(null!=u&&u.embed&&e.removeSessionAlternateState&&e.addSessionAlternateState&&c&&!(t.qHyperCubeDef.qDimensions.length<=0)){await cJ.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:n}){const r=n,i=tJ.CHART.STATE,o=t.qStateName;r.miniChartToken.alternateState||(r.miniChartToken.alternateState=i,await e.addSessionAlternateState(i,o),r.miniChartToken.alternateState=i)}({app:e,properties:t,customTooltipModel:i});const a=await async function({app:e,properties:t,customTooltipModel:n}){var r;const i=n;null!==(r=i.miniChartToken.sessionObj)&&void 0!==r&&r.id&&await e.destroySessionObject(i.miniChartToken.sessionObj.id);const o=tJ.CHART.STATE,a=lJ(t,o),s=await e.createSessionObject(a),l=uJ(t);if(s.id!==tJ.CHART.CHART_OBJECT_ID)return void e.destroySessionObject(s.id);i.miniChartToken.sessionObj=s;const u=await s.createChild(l);if(i.miniChartToken.sessionObj&&i.miniChartToken.sessionObj.id===s.id)return i.miniChartToken.model=u,u;e.destroySessionObject(s.id)}({app:e,properties:t,customTooltipModel:i});if(u.miniChartToken.alternateState&&u.miniChartToken.sessionObj&&a){var d,f,p,h;const e=n.length>0&&void 0!==(null===(d=n[0].data)||void 0===d?void 0:d.value)?[null===(f=n[0].data)||void 0===f?void 0:f.value]:[],a=void 0!==r?r:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===r&&n.length>0){var m,g;const e=null!==(m=n[0].data.selectionOuterDimension)&&void 0!==m?m:n[0].data.selectionDimension;if(null!=e&&null!==(g=e.source)&&void 0!==g&&g.field){var v;const t=null==e||null===(v=e.source)||void 0===v?void 0:v.field.split("/"),n=t[t.length-1],r=void 0!==e.value?[e.value]:[];r.length>0&&void 0!==n&&u.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(n),r,!1)}}e.length>0&&u.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",a,e,!1);const s=document.getElementById(tJ.CHART.CONTAINER_ID),l={direction:o?"rtl":"ltr",isReadonly:!0,isPopover:!0,navigation:!1,selections:!1};u.miniChartToken.vis=await i.embed.render({element:s,model:u.miniChartToken.model,options:l,id:null===(p=u.miniChartToken.model)||void 0===p?void 0:p.id,type:null===(h=u.miniChartToken.model)||void 0===h?void 0:h.genericType})}}catch(t){await cJ.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;null!=n&&n.embed&&(cJ.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(tJ.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,r=tJ.CHART.STATE;await e.removeSessionAlternateState(r),n.miniChartToken.alternateState=void 0}({app:e,customTooltipModel:t}))},destroyVisualization:({customTooltipModel:e})=>{var t,n;const r=e;"function"==typeof(null===(t=r.miniChartToken)||void 0===t||null===(n=t.vis)||void 0===n?void 0:n.destroy)&&(r.miniChartToken.vis.destroy(),r.miniChartToken.vis=void 0)}};function dJ(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function fJ(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:r}=tJ.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[n]=!0,i[r]=!0,i}function pJ(e){const t=fJ();return e.filter((e=>t[e.id]))}const hJ={getNodes(e,t){const n=function(e,t){let n=0,r=0;e.center?(n+=e.center.x,r+=e.center.y):(n+=e.clientX,r+=e.clientY);const i=t.element.getBoundingClientRect();return{cx:n-i.left,cy:r-i.top}}(e,t);return t.shapesAt({x:n.cx,y:n.cy})},getDataNodes(e,t){let n,r=[];const i={container:{bar:!0,"bullet-axis":!0},circle:{"point-component":!0}};return t.forEach((t=>{var o,a,s,l;const u=null!==(o=null===(a=t.data)||void 0===a?void 0:a.selectionDimension)&&void 0!==o?o:t.data;if(!u||null!==(s=t.data)&&void 0!==s&&s.customTooltipAttrExps||i[t.type]){if(null!==(l=t.data)&&void 0!==l&&l.customTooltipAttrExps&&!t.data.customTooltipImages){const e=t;e.data.customTooltipImages=[],r.push(e)}}else{n||(n=[],Object.keys(i).forEach((t=>{n=n.concat(e.findShapes(t).filter((e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&i[t][e.key])))})));const t=n.filter((e=>{var t,n;const r=null!==(t=null!==(n=e.data.stack)&&void 0!==n?n:e.data.selectionOuterDimension)&&void 0!==t?t:e.data.selectionDimension;return r&&r.value===u.value&&r.label===u.label}));t.length>0&&(r=r.concat(t[0]))}})),r},displayTooltip(e,t,{nodes:n,opts:r={},customTooltipModel:i,extractedNodes:o=[],hide:a}){if(i&&!a){const{layout:a,chart:s}=i,{attrExps:l}=hJ.getAttrExprData(a);o.length||n.length?sJ.handlePromises({customTooltipModel:i,nodes:hJ.getDataNodes(s,o.length>0?o:n),attrExps:l,opts:r}).then((()=>{t.emit("show",e,n.length?{nodes:n}:void 0)})):t.emit("show",e,n.length?{nodes:n}:void 0)}else{var s;null!=i&&null!==(s=i.miniChartToken)&&void 0!==s&&s.alternateState&&cJ.hide({app:r.app,customTooltipModel:i}),t.emit("hide")}},checkIfPromisesExist:({customTooltipModel:e})=>sJ.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){var n;const r=t,i=null!==(n=e.qHyperCubeDef)&&void 0!==n&&n.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return r[i]||(r[i]=[]),r[i]},getAttrExprData(e){var t;let n=[],r="";const i=(null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[];if(i.length>0){var o,a,s;const t=i.length-1;n=(null===(o=e.qHyperCube)||void 0===o||null===(a=o.qDimensionInfo)||void 0===a||null===(s=a[t])||void 0===s?void 0:s.qAttrExprInfo)||[],r=`qDimensionInfo/${t}/qAttrExprInfo`}return{attrExps:n,fieldPath:r}},quarantineCustomTooltipAttrs(e,t={}){var n,r;if(!(null===(n=e.qLayoutExclude)||void 0===n||null===(r=n.quarantine)||void 0===r?void 0:r[tJ.CUSTOM.QUARANTINE])){!function(e,t){const n=t;let r=n.qLayoutExclude;r||(n.qLayoutExclude={quarantine:{}},r=n.qLayoutExclude),r.quarantine||(r.quarantine={}),r.quarantine[tJ.CUSTOM.QUARANTINE]=[],e.forEach((e=>{r.quarantine[tJ.CUSTOM.QUARANTINE].push(e)})),n.qLayoutExclude=r}(pJ(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){var t,n;const r=e;(null===(t=e.qLayoutExclude)||void 0===t||null===(n=t.quarantine)||void 0===n?void 0:n[tJ.CUSTOM.QUARANTINE])&&delete r.qLayoutExclude.quarantine[tJ.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=dJ(e);if(!n)return;const r=void 0!==t?t:n.length-1;if(!n[r])return;const i=this.getAttrExps(e,n[r]);if(0===pJ(i).length){var o,a;const t=(null===(o=e.qLayoutExclude)||void 0===o||null===(a=o.quarantine)||void 0===a?void 0:a.customTooltip)||[],n=[...i,...t],s=e;s.qHyperCubeDef?s.qHyperCubeDef.qDimensions[r].qAttributeExpressions=n:s.qHyperCube.qDimensionInfo[r].qAttrExprInfo=n}},moveCustomTooltipAttrs(e,t={},n){let r=[];const i=dJ(e)||[];[...i,t].forEach((e=>{const t=pJ(e.qAttributeExpressions||[]);t.length>0&&(r=t)}));const o=fJ(),a=i.map((e=>{const t=e,n=e.qAttributeExpressions||[];return t.qAttributeExpressions=n.filter((e=>!o[e.id])),t})),s=void 0!==n?n:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(r));const l=e;e.qHyperCubeDef?l.qHyperCubeDef.qDimensions=a:l.qHyperCube.qDimensionInfo=a},addCallbackCustomTooltip(e){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e):(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},moveCallbackCustomTooltip(e,t){1===e.qHyperCubeDef.qDimensions.length&&(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e)),e.qHyperCubeDef.qDimensions.length>1&&this.moveCustomTooltipAttrs(e,t)},removeCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>0?this.moveCustomTooltipAttrs(e,t):this.quarantineCustomTooltipAttrs(e,t)},replaceCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e,t):(this.quarantineCustomTooltipAttrs(e,t),this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},shouldIgnoreDefaultRows(e){var t;return(null===(t=e.tooltip)||void 0===t?void 0:t.hideBasic)||0},DEBOUNCE_THRESHOLD:50,getFooterRow:(e,t)=>[{content:e,style:{"font-style":"italic","font-size":"12px","line-height":"16px",color:"rgba(255, 255, 255, 0.6)","text-align":t?"right":"left",direction:Hv.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=Hv.detectTextDirection(e.src),r=[],i={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){r.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const n=e.imageError?`${e.src}?${Math.random()}`:e.src;r.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:n,referrerpolicy:"no-referrer"})),i.style["text-align"]="center",i.style["white-space"]="nowrap"}else i.style["background-size"]="contain",i.style["background-repeat"]="no-repeat",i.style["background-position"]="center",i.style["background-image"]=`url('${e.src}')`;return[{content:[t.h("div",i,r),""],style:{"text-align":t.rtl?"right":"left",direction:n,"max-width":e.width},colspan:2},{}]}};function mJ(e,t,n,r){var i,o,a;const s=(null===(i=t.qHyperCube)||void 0===i||null===(o=i[n])||void 0===o||null===(a=o[r])||void 0===a?void 0:a.qAttrExprInfo)||[],l=[],u=e.qSubNodes&&e.qSubNodes[r]?e.qSubNodes[r].qAttrExps:e.qAttrExps;return u?(s.forEach(((e,t)=>{const i=u.qValues&&u.qValues[t]?u.qValues[t]:void 0,o=void 0===i?"NaN":function(e,t){let n;switch(e.id){case tJ.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case tJ.CUSTOM.TITLE:case tJ.CUSTOM.DESCRIPTION:case tJ.CUSTOM.IMAGES:n=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:n="NaN"}return n}(e,i);l.push({source:{key:"qHyperCube",field:`${n}/${r}/qAttrExprInfo/${t}`},label:o,value:"value"})})),l):l}const gJ={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,r="qDimensionInfo";return{field:`${r}/${n}`,value:t=>mJ(t,e,r,n)}}};const vJ={getCustomAttrExps(e,t,n){var r,i;const o={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},a=(null===(r=t.data)||void 0===r||null===(i=r.customTooltipAttrExps)||void 0===i?void 0:i.value)||[];if(Number.isNaN(a))return o;return function(e,t,n,r){const i={[tJ.CUSTOM.TITLE]:!0,[tJ.CUSTOM.DESCRIPTION]:!0},{attrExps:o,fieldPath:a}=hJ.getAttrExprData(e);return 0===t.length||0===o.length||""===a||o.forEach(((e,o)=>{const s=t[o];if(e.id===tJ.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,i="NaN"===s.value||e.isCustomFormatted?s.value:n("qHyperCube").field(`${a}/${o}`).formatter()(s.value);r.customTooltipAttrExpsArr.push({label:t,value:i})}else if(i[e.id]&&s){const t="-"!==s.value&&"NaN"!==s.value?s.value:s.label;t&&"undefined"!==t&&r.customTooltipInfoAttrExpsArr.push({...e.id===tJ.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}})),r}(n,a.map((t=>Bv.getMeasure(e,t))),e,o)}};function yJ({nodes:e,layout:t,dataset:n}){return function(e,t,n){const r=[];return e.forEach((e=>{r.push(vJ.getCustomAttrExps(n,e,t))})),r}(e,t,n).reduce(((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)})),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}function bJ(e){const t=tJ.CUSTOM.EXPRESSION,{qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}=e.qDef;return e.qLibraryId?{qLibraryId:e.qLibraryId,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}:{qExpression:e.qDef.qDef,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}}function xJ(e){var t;const n=null===(t=e.qHyperCubeDef)||void 0===t?void 0:t.qDimensions;return n[n.length-1].qAttributeExpressions||[]}var wJ={attrExpr:{migrateProperties(e){var t,n,r,i;const o=Dv(!0,{},e),a=(null===(t=o.tooltip)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.qHyperCubeDef)||void 0===r?void 0:r.qMeasures)||[];let s=xJ(o);return s=function(e,t){return t.concat(e.map((e=>bJ(e))))}(a,s),function(e,t){var n;const r=null===(n=t.qHyperCubeDef)||void 0===n?void 0:n.qDimensions;r[r.length-1].qAttributeExpressions=e}(s,o),null===(i=o.tooltip)||void 0===i||delete i.data,o},getPatches(e){var t,n,r,i;const o=(null===(t=e.tooltip)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.qHyperCubeDef)||void 0===r?void 0:r.qMeasures)||[],a=(null===(i=e.qHyperCubeDef)||void 0===i?void 0:i.qDimensions.length)-1;return function(e,t,n){let r=e.length;const i=[];return t.forEach((e=>{const t=bJ(e),o=JSON.stringify(t);i.push({qPath:`/qHyperCubeDef/qDimensions/${n}/qAttributeExpressions/${r}`,qOp:"add",qValue:o}),r++})),i.push({qPath:"/tooltip/data",qOp:"remove"}),i}(xJ(e),o,a)},checkForBackwardCompatibility:(e,t)=>(e.qMeasureInfo||[]).length>0&&t.length>0,updateProperties(e,t){return new Promise((n=>{var r,i,o,a,s;const l=(null===(r=t.qHyperCube)||void 0===r?void 0:r.qDimensionInfo)||[],u=(null===(i=t.tooltip)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.qHyperCube)||{},c=null===(a=t.qMeta)||void 0===a||null===(s=a.privileges)||void 0===s?void 0:s.includes("update");e&&e.getEffectiveProperties&&this.checkForBackwardCompatibility(u,l)&&e.getEffectiveProperties().then((t=>{if(c){const r=this.migrateProperties(t);e.setProperties(r).then((()=>{e.app.clearUndoBuffer(),n(!0)}))}else{const r=this.getPatches(t);e.applyPatches(r,!0).then((()=>{e.app.clearUndoBuffer(),n(!0)}))}})),n(!1)}))}}};const{CUSTOM:kJ}=tJ;function CJ({flags:e,layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l,options:u}){var c,d,f;const p=function({layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:hJ,miniChartToken:{},embed:s}}({layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l}),h="rtl"===u.direction,m=!(!t.tooltip||t.tooltip.auto),g=m&&IY(t,"tooltip.hideBasic",!1),v=!!(m&&null!==(c=t.tooltip)&&void 0!==c&&null!==(d=c.chart)&&void 0!==d&&null!==(f=d.object)&&void 0!==f&&f.refId&&l&&"function"==typeof(null==r?void 0:r.getEffectiveProperties));return{isEnabled:()=>m,hideBasic:()=>g,getAttributes:({dataset:e,nodes:n})=>{var r,i;const o=yJ({dataset:e,nodes:n,layout:t});return{title:null===(r=o.customTooltipInfoAttrExpsArr.find((e=>e.id===kJ.TITLE)))||void 0===r?void 0:r.title,description:null===(i=o.customTooltipInfoAttrExpsArr.find((e=>e.id===kJ.DESCRIPTION)))||void 0===i?void 0:i.value,measures:o.customTooltipAttrExpsArr}},hasImages:()=>hJ.checkIfPromisesExist({customTooltipModel:p}),createImageRow:({value:e,h:t})=>hJ.getImageRow(e,{h:t,rtl:h}),addImages:({nodes:r})=>{const i=hJ.getDataNodes(o,r),a=hJ.getAttrExprData(t);return sJ.handlePromises({customTooltipModel:p,nodes:i,attrExps:a,opts:{flags:e,app:n}})},chart:{isEnabled:()=>v,hasLimitation:()=>{var e;return!(null==n||null===(e=n.isInModalSelection)||void 0===e||!e.call(n))},createContainer:({h:e})=>cJ.createContainer({layout:t,ctx:{h:e,rtl:h}}),createLimitationRow:()=>hJ.getFooterRow(a.get("properties.tooltip.notselectedmessage"),h),show:({nodes:e,properties:t})=>cJ.show({app:n,properties:t,selectedNodes:e,customTooltipModel:p,rtl:h}),hasAlternateState:()=>{var e;return!(null===(e=p.miniChartToken)||void 0===e||!e.alternateState)},hide:()=>cJ.hide({app:n,customTooltipModel:p}),destroy:()=>cJ.destroyVisualization({customTooltipModel:p})}}}function SJ(e){return{layout:e,keys:{SCALE:{FILL:"fill"},COMPONENT:{DIMENSION_TITLE:"dimension-title",SLICES:"slices",PIE_LABELS:"pie-labels"}}}}function EJ({flags:t,picasso:n,instance:r}){const i=e.useModel(),o=e.useApp(),a=e.useTranslator(),s=e.useElement(),[l,u]=e.useState(),c=e.useStaleLayout(),d=e.usePlugins(),f=e.useConstraints(),p=e.useOptions(),h=e.useTheme(),{qLocaleInfo:m}=e.useAppLayout(),g=e.useEmbed();return e.useEffect((()=>{if(!r)return;s.style.overflow="hidden";const e=function(e){var t,n,r,i,o=e.picasso,a=e.model,s=e.app,l=e.translator,u=e.layoutService,c=void 0===u?void 0:u,d=e.createConfig,f=void 0===d?AY:d,p=e.config,h=void 0===p?{}:p,m=e.custom,g=void 0===m?{}:m,v=h.localeInfo,y=h.key,b=h.theme,x=void 0===b?void 0:b,w=h.auto,k=void 0===w?void 0:w,C=h.definitionPath,S=null==c||null===(t=c.getLayout)||void 0===t?void 0:t.call(c),E={theme:x,key:y,localeInfo:v,layout:S,hc:null==c||null===(n=c.getHyperCube)||void 0===n?void 0:n.call(c),legendProps:null==c||null===(r=c.getLayoutValue)||void 0===r?void 0:r.call(c,"legend"),colorProps:FU(FU({},null==c||null===(i=c.getLayoutValue)||void 0===i?void 0:i.call(c,"color")),{},{useBaseColors:S?NY(S):void 0})},M=DY({picasso:o,model:a,app:s,translator:l,auto:k});!1!==k&&M.auto((function(e){return k?k({layout:e,defaultAuto:PY}):PY(e)}));var T=!1;return{getColor:function(){return M.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return M.resolveUIColor({index:t,color:n})},getData:function(){return M.data()},getDatumProps:function(e){return M.datumProps(e)},getSnapshotData:function(){return M.getSnapshotData(C)},getSettingsForMeasure:function(e){return M.settingsForMeasure(e)},getSettings:function(){return M.settings()},getLegend:function(e,t){return M.legend(e,t)},getScales:function(){return M.scales()},getPalettes:function(){return M.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return M.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return T},custom:FU({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?f:e)({getUseBaseColors:NY}),n=qY(E,t);return M.config(n),M.getAuxiliarySettings(C).then((function(){T=!0}))}}}({picasso:r.picasso,model:i,app:o,translator:a,config:{auto:!1,key:"fill"}}),l=function(e){var t=e.picassoInstance,n=e.plugins,r=e.pluginArgs,i=void 0===r?{}:r,o={initialized:!1,definitions:[]};return{initialize:function(){return VU(jU().mark((function e(){var r,a,s,l;return jU().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o.initialized){e.next=2;break}return e.abrupt("return");case 2:return a=Promise.all(n.filter((function(e){return"custom-component"===e.info.type})).map(function(){var e=VU(jU().mark((function e(n){var r;return jU().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.info.componentName){e.next=2;break}throw new Error("plugin-service: Custom component is missing componentName");case 2:return e.next=4,n.fn(FU({},i));case 4:if("object"===HU(r=e.sent)){e.next=7;break}throw new Error("plugin-service: Custom component needs to be an object");case 7:t.component(n.info.componentName,r);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())),s=Promise.all(n.filter((function(e){return"component-definition"===e.info.type})).map((function(e){return e.fn(FU({},i))}))),e.next=6,Promise.all([a,s]);case 6:l=e.sent,o.initialized=!0,(r=o.definitions).push.apply(r,YU(l[1]));case 9:case"end":return e.stop()}}),e)})))()},extendComponents:function(e){return o.initialized?(o.definitions.filter(Boolean).forEach((function(t){var n=$U(e.filter((function(e){return e.key&&e.key===t.key})),1)[0];if(n){var r=i$(!0,{},n.brush);i$(!0,n,t),t.brush&&(n.brush=function(e,t){return"object"===HU(e)&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=FY({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=FY({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(r,t.brush))}else e.push(t)})),e):e}}}({picassoInstance:r.picasso,plugins:d,pluginArgs:SJ(c)}),v=CJ({flags:t,layout:c,app:o,model:i,picasso:n,chart:r.chart,translator:a,localeInfo:m,embed:g,options:p}),y=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,a=void 0===o?[]:o,s=r.transform,l=void 0===s?[]:s,u=r.extend,c=void 0===u?[]:u,d={theme:t,matrix:mG(a),styles:void 0};return d.styles=vG({theme:t,id:i,transform:l,extend:c,matrix:d.matrix}),{getStyles:function(){return d.styles},getTheme:function(){return d.theme},setTheme:function(e){d.theme=e,d.styles=vG({theme:e,id:i,transform:l,extend:c,matrix:d.matrix})}}}({theme:h,config:{id:"pieChart",resolve:[["object","label.name","color","#595959"],["object","label.name","fontFamily"],["object","label.name","fontSize","12px"]]}}),b=function({chart:e,translator:t,layout:n,constraints:r,options:i,themeService:o,colorService:a,custom:s}){const l=n.qHyperCube.qMeasureInfo.length>1,u="rtl"===i.direction,{fontFamily:c}=o.getStyles();return KG({chart:e,translator:t,config:{rtl:u,enable:()=>!r.passive,getColorSettings:()=>a.getSettings(),style:{fontFamily:c},main:{key:"tooltip",getGroupByValue:({data:e})=>e.value,collectibles:[{key:"slices",type:"slice",major:({data:e})=>e.value}],triggers:[{keys:["slices"],collect:{from:"single"},placement:"collectible"},{keys:["pie-labels","negative-indicators"],collect:{from:"dimension",by:({data:e})=>e.value},placement:"trigger"}],placement:({meta:e})=>({type:"slices"===e.triggerer?"slice":"bounds"}),section:({h:e,nodes:n,dataset:r,formatter:i,create:o,util:a})=>{const[u]=n,{title:c,description:d,measures:f}=s.isEnabled()?s.getAttributes({dataset:r,nodes:n}):{},p=[];c&&p.push(o.text({value:c,style:{bold:!0}})),d&&p.push(o.text({value:d}));const h=s.hideBasic();if(h&&!f.length&&(c||d)||p.push(o.text({value:u.data.label,style:{bold:!0}})),!h){p.push(o.color({nodes:n,property:"fill"}));const{num:e}=u.data;if(p.push(o.measure({label:a.dataset.title(e.source.key,e.source.field),value:e.label})),l){const{radius:e}=u.data;p.push(o.measure({label:a.dataset.title(e.source.key,e.source.field),value:e.label}))}p.push(o.measure({label:t?t.get("properties.dataPoints.labelmode.share"):"Share",value:i("share")(u.desc.share)}))}f&&p.push(...f.map((e=>o.measure({label:e.label,value:e.value,survive:{color:!0,duplicate:!0}})))),s.chart.isEnabled()&&(s.chart.hasLimitation()?(s.chart.destroy(),p.push(o.raw({value:s.chart.createLimitationRow()}))):p.push(o.raw({value:s.chart.createContainer({h:e})})));const{customTooltipImages:m}=u.data;return s.isEnabled()&&m&&p.push(...m.map((t=>o.raw({value:s.createImageRow({value:t,h:e})})))),p},layout:{grouping:!0},events:{tooltip:{beforeShow:({collectNodes:e})=>s.isEnabled()&&s.hasImages()?s.addImages({nodes:e()}):Promise.resolve(),afterShow:({expando:e,nodes:t})=>{s.chart.isEnabled()&&!s.chart.hasLimitation()&&s.chart.show({nodes:t,properties:e.get("properties")})}},interaction:{mouseleave:()=>{s.chart.isEnabled()&&s.chart.hasAlternateState()&&s.chart.hide()}}}},legend:{keys:{tooltip:"legend-color-cat",component:"legend-cat"}}}})}({app:o,chart:r.chart,translator:a,layout:c,constraints:f,options:p,themeService:y,colorService:e,custom:v});u({colorService:e,pluginService:l,themeService:y,tooltipService:b})}),[i,o,r,c,a.language(),f,p.direction,h.name()]),l}function MJ({scaleKey:e,legend:t,onEdited:n}){const{layout:r}=t,{dock:i}=r||{};return{type:"brush-range",key:"legendRangeBrush",layout:{dock:"@legend-seq"},on:n?{bubbleEnd(){n()}}:{},settings:{brush:"selection",scale:e+"Range",direction:"left"===i||"right"===i?"vertical":"horizontal",bubbles:{align:"left"===i||"top"===i?"end":"start",placement:"outside"},target:{selector:'[id="legend-seq-target"]',fillSelector:'[id="legend-seq-ticks"]',fill:"rgba(82,204,82,0.2)"}}}}const TJ=.8,DJ=.55,_J={CORNER_RADIUS:0,INNER_RADIUS:DJ,STROKE:{COLOR:"#FFFFFF",WIDTH:{NONE:0,SMALL:2,MEDIUM:4,LARGE:6}}},NJ=({layout:e},t,n)=>t.encodings.slice.outerRadius?{scale:"radius",fn:t=>{var r,i;let o=TJ,a=0;const s=null!==(r=null==n||null===(i=n.style)||void 0===i?void 0:i.innerRadius)&&void 0!==r?r:DJ;e.donut.showAsDonut&&(o=TJ-s,a=s);return t.scale(Math.max(0,t.datum.radius.value))*o+a}}:TJ,qJ=({layout:e},t,n)=>{var r,i;if(!e.donut.showAsDonut)return 0;const o=null!==(r=null==n||null===(i=n.style)||void 0===i?void 0:i.innerRadius)&&void 0!==r?r:DJ;return t.encodings.slice.outerRadius?{scale:"radius",fn:e=>{const t=TJ-o,n=o;return e.scale(Math.min(0,e.datum.radius.value))*t+n}}:o},RJ=({layout:e},t)=>{var n,r,i,o,a,s;const l=t.colorService.getDatumProps(),u=l[Object.keys(l)[0]],c=u&&u.field?u.field:void 0,d="qDimensionInfo/0"===c,f=c?t.ds.field(c).raw():null,p=f&&(f.label||f.title||f.qFallbackTitle)||"",h=t.encodings.slice.outerRadius,{formatter:m}=t.chart,g=Ov(e,"qHyperCube.qDimensionInfo",[]).length;function v(e,n){const r=t.ds.field(e).raw();return{field:e,label:!r.isCustomFormatted&&(r.qIsAutoFormat||"U"===r.qNumFormat.qType)?e=>m(n)(e.qNum):e=>e.qText}}const y=(e.components||[]).filter((e=>"slices"===e.key))[0];return{type:"pie",key:"slices",data:{extract:{field:"qDimensionInfo/0",props:{...l,num:v(t.encodings.slice.arc,"arc"),fillTooltip:c?{field:c,label:p,value:e=>d?e.qText||"-":void 0!==e.qNum&&"NaN"!==e.qNum?e.qText?e.qText:e.qNum:e.qText||"-"}:void 0,customTooltipAttrExps:0!==g?gJ.getNode(e,{dimensionCount:g}):void 0,radius:h?v(h,"outerRadius"):void 0}}},brush:{consume:[{context:"selection",data:["","fill"],style:{inactive:{opacity:.3},active:{stroke:"rgba(52, 52, 52, 0.7)",strokeWidth:2}}},{context:"highlight",data:[""],style:{inactive:{fill:"#BFDAD9"},active:{fill:"#68B2AF"}}}]},settings:{startAngle:()=>t.viewState.get("rotation"),endAngle:()=>t.viewState.get("rotation")+2*Math.PI,slice:{arc:{ref:"num"},innerRadius:qJ({layout:e},t,y),fill:t.colorService.getColor(),strokeWidth:null!=y&&null!==(n=y.style)&&void 0!==n&&n.strokeWidth?_J.STROKE.WIDTH[y.style.strokeWidth.toUpperCase()]:_J.STROKE.WIDTH.NONE,stroke:null!==(r=null==y||null===(i=y.style)||void 0===i||null===(o=i.strokeColor)||void 0===o?void 0:o.color)&&void 0!==r?r:_J.STROKE.COLOR,outerRadius:NJ({layout:e},t,y),cornerRadius:null!==(a=null==y||null===(s=y.style)||void 0===s?void 0:s.cornerRadius)&&void 0!==a?a:0}},animations:{enabled:t.animations.enabled,isMainComponent:!0}}};function PJ({layout:e},t){var n,r;const i=(e.components||[]).filter((e=>"slices"===e.key))[0],o=null!==(n=null==i||null===(r=i.style)||void 0===r?void 0:r.innerRadius)&&void 0!==n?n:DJ,a=t.encodings.slice.outerRadius,s=t.themeService.getStyles();return!(!e.donut.showAsDonut||!a)&&{type:"pie",key:"zeroLine",data:{items:[1]},settings:{slice:{arc:1,fill:"transparent",innerRadius:0,strokeWidth:1,stroke:s.label.name.color,outerRadius:{scale:"radius",fn:e=>{const t=TJ-o,n=o;return e.scale(0)*t+n}}}},animations:{enabled:t.animations.enabled}}}function AJ(e){return{type:"pie-dividers",key:"pie-dividers",layout:{displayOrder:2},settings:{component:"slices",selector:"path"},brush:{consume:[{context:"selection",style:{inactive:{opacity:.2}}}]},animations:{enabled:e.animations.enabled,trackBy:()=>Math.random()}}}function IJ({layout:e},t){if(e.donut.showAsDonut||!t.encodings.slice.outerRadius)return!1;return{type:"negative-indicators",key:"negative-indicators",layout:{displayOrder:2},settings:{component:"slices",selector:"path",offset:5,size:4,fill:t.themeService.getStyles().label.name.color},brush:{consume:[{context:"selection",style:{inactive:{opacity:.2}}}]},animations:{enabled:t.animations.enabled}}}function OJ(e){const t=e.node.desc&&e.node.desc.share;return t?e.formatter("share")(t):""}function LJ(e){return e.node.data.num.label}function zJ(e){return e.node.data.radius.label}function FJ(e,t,n){if(e.dataPoint.auto)return n?LJ:OJ;if("share"===e.dataPoint.labelMode)return OJ;if("value"===e.dataPoint.labelMode){return t.encodings.slice.outerRadius&&"radius"===e.dataPoint.labelValueMode?zJ:LJ}return null}function jJ({data:e}){return e?e.label:""}function HJ(e){const t=parseInt(e,10);if(!isNaN(t))return t}function BJ(e){const t=((e&&e.components?e.components:void 0)||[]).filter((e=>"slices"===e.key))[0];return!t||t.style.innerRadius>.3}function VJ({node:e,data:t}){return Dv({_share:e.desc.share,_fillColor:e.attrs.fill},t)}function WJ(e,t,n){const r=t.themeService.getStyles(),i=[{padding:10,direction:t.encodings.slice.outerRadius?"rotate":"horizontal",placements:[{position:"outside",fill:r.label.name.color,padding:t.encodings.slice.outerRadius?4:2}],fontSize:HJ(r.label.name.fontSize),fontFamily:r.label.name.fontFamily,label:jJ,linkData:({node:e,data:t})=>Dv({_share:e.desc.share,_fillColor:e.attrs.fill,_showTooltip:!0},t)}];if(FJ(e,t,!1)){const r=function(e,t,n){return{label:FJ(e,t,!1),simplifiedPlacements:[{position:e.donut.showAsDonut&&BJ(e)?"inside":"into",onBackground:e.donut.showAsDonut&&BJ(e),padding:4}],theme:n.theme,themeId:"object.pieChart"}}(e,t,n),o=Uv(Dv(t,r),n.theme);o.linkData=VJ,i.push(o)}return{key:"pie-labels",type:"labels",layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:"slices",selector:"path",strategy:{type:"slice",settings:{labels:i}}}]},brush:{consume:[{context:"selection",data:["","fill"],style:{inactive:{opacity:.3}}}]},animations:{enabled:t.animations.enabled,trackBy:()=>Math.random()}}}function UJ({layout:e,context:t},n){return!1!==e.dataPoint.show&&(1===n.dataRowCount?function(e,t,n){const r=FJ(e,t,!0),i=(e=>t=>e.getContrastingColorTo(t.node.attrs.fill))(n.theme),o=t.themeService.getStyles();return{key:"pie-labels",type:"labels",layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:"slices",selector:"path",strategy:{type:"rows",settings:{align:.5,justify:.5,padding:10,labels:[{fill:e.donut.showAsDonut?o.label.name.color:i,fontSize:HJ(o.label.name.fontSize),fontFamily:o.label.name.fontFamily,label:jJ,linkData:({data:e})=>e},{fill:e.donut.showAsDonut?o.label.value.color:i,fontSize:HJ(o.label.value.fontSize),fontFamily:o.label.value.fontFamily,label:r,linkData:({data:e})=>e}]}}}]},animations:{enabled:t.animations.enabled,trackBy:()=>Math.random()}}}(e,n,t):WJ(e,n,t))}const $J=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"legendRange",enable(t,n){if(this.started||!n)return!0;if(e.constraints.select||e.constraints.active)return!1;const r=(this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((e=>"legend-seq"===e.type))||function(e){const{target:t}=e.srcEvent;return!(!t||!(t.hasAttribute("data-other-value")&&t.hasAttribute("data-idx")||"INPUT"===t.nodeName))}(n))&&!e.isLocked([this.chart.component("slices")]);return r||this.chart.component("legendRangeBrush").emit("rangeClear"),r}},events:{legendRangestart(t){t.preventDefault(),e.interactions.emit("selections-start"),this.chart.component("legendRangeBrush").emit("rangeStart",t),this.started=!0},legendRangemove(e){e.preventDefault(),this.chart.component("legendRangeBrush").emit("rangeMove",e)},legendRangeend(t){t.preventDefault(),this.chart.component("legendRangeBrush").emit("rangeEnd",t),e.onSelect(),this.started=!1}}});function YJ(e,t){const n=t.element.getBoundingClientRect();let r,i;return e.center?(({x:r}=e.center),({y:i}=e.center)):(r=e.clientX,i=e.clientY),{x:r-n.left,y:i-n.top}}function XJ(e,t){const n=t.component("slices");if(!n)return!1;const{x:r,y:i}=YJ(e,t),o=n.rect.x+n.rect.margin.left+n.rect.width/2,a=n.rect.y+n.rect.margin.top+n.rect.height/2,s=Math.min(n.rect.width,n.rect.height)/2*TJ;return(o-r)**2+(a-i)**2<=s**2}const KJ=(e,t,{requireFailure:n,recognizeWith:r}={})=>({type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"tap",interval:10,pointers:1,enable(t,n){return!n||!e.constraints.select&&!e.constraints.active&&(this.components=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter((e=>"slices"===e.key||"legend-cat"===e.key||"pie-labels"===e.key)),this.components.length)}},events:{tap(n){n.preventDefault();const{target:r}=n.srcEvent;if(r&&("INPUT"===r.nodeName||r.hasAttribute("data-other-value")))return void this.chart.component("legendRangeBrush").emit("bubbleStart",n);if(r&&r.hasAttribute("data-action")&&r.hasAttribute("data-component-key"))return void this.chart.component(r.getAttribute("data-component-key")).emit(r.getAttribute("data-action"));if(r&&r.children&&r.children[0]&&"legend-cat"===r.children[0].getAttribute("data-component-key"))return;if(e.isLocked(this.components))return;e.interactions.emit("selections-start");let i=YJ(n,this.chart);this.components.some((e=>"legend-cat"===e.key))&&(i={cx:i.x,cy:i.y,r:5});const o=this.chart.shapesAt(i,{components:[{key:"slices",propagation:"stop"},{key:"legend-cat",propagation:"stop"},{key:"pie-labels",propagation:"stop"}],propagation:"stop"});o.length&&(this.chart.brushFromShapes(o,{components:[{key:o[0].key,action:n.srcEvent.ctrlKey||t?"set":"toggle",contexts:["selection"]}]}),e.onSelect())}}}),GJ=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"lasso",enable(t,n){if(this.isStarted||!n)return!0;if(e.constraints.active||e.constraints.select||!e.interactions.lasso.active())return!1;const r=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y});return!e.isLocked(r)&&r.some((e=>"slices"===e.key))}},events:{lassostart(t){t.preventDefault(),e.constraints.select||e.constraints.active||this.isStarted||(e.interactions.emit("selections-start"),this.chart.component("lasso").emit("lassoStart",t),this.isStarted=!0)},lassomove(e){e.preventDefault(),this.chart.component("lasso").emit("lassoMove",e)},lassoend(t){t.preventDefault(),this.isStarted=!1,this.chart.component("lasso").emit("lassoEnd",t),e.onSelect()}}}),JJ=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Tap",requireFailure:t,recognizeWith:n,options:{event:"areatap",pointers:2,enable(t,n){if(this.started||!n)return!0;if(e.constraints.active||e.constraints.select)return!1;const r=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y});return r.some((e=>"slices"===e.key))&&!e.isLocked(r)}},events:{areatap(t){const n=this.chart.component("area");n&&!this.started&&(e.interactions.emit("selections-start"),n.emit("areaStart",t.pointers[0]),n.emit("areaMove",t.pointers[1]),this.started=!0,setTimeout((()=>{n.emit("areaEnd"),e.onSelect(),this.started=!1}),100)),t.preventDefault()}}});function ZJ(e){return{type:"native",key:"theusual",events:{wheel(t){let n=!1;if(!e.constraints.active&&XJ(t,this.chart)){const r=Math.sign(-t.deltaY);e.viewState.set("rotation",r*(Math.PI/12)),n=!0}else if(!e.constraints.select&&!e.constraints.active){const e=this.chart.componentsFromPoint(t).filter((e=>"legend-cat"===e.key))[0];e&&(n=!0,function(e,t){const n=(Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY)>=0?"next":"prev";t.emit(n)}(t,e))}n&&t.preventDefault()}}}}const QJ=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"rotate",pointers:1,threshold:10,enable(t,n){return!(!this.started&&n)||!e.constraints.active&&!e.interactions.lasso.active()&&XJ(n,this.chart)}},events:{rotatestart(e){e.preventDefault();const t=this.chart.component("slices").rect,n=this.chart.element.getBoundingClientRect();this.pieCenter={x:n.left+t.x+t.width/2,y:n.top+t.y+t.height/2},this.prevAngle=Math.atan2(e.center.y-this.pieCenter.y,e.center.x-this.pieCenter.x),this.started=!0},rotatemove(t){t.preventDefault();const n=Math.atan2(t.center.y-this.pieCenter.y,t.center.x-this.pieCenter.x);e.viewState.set("rotation",n-this.prevAngle),this.prevAngle=n},rotateend(e){e.preventDefault(),this.started=!1},rotatecancel(e){e.preventDefault(),this.started=!1}}}),eZ=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"legendPan",pointers:1,threshold:10,enable(t,n){return!(!this.isStarted&&n)||!e.constraints.active&&this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((e=>"legend-cat"===e.type))}},events:{legendPanstart(e){if(e.preventDefault(),!this.isStarted){this.components=this.chart.componentsFromPoint({x:e.center.x,y:e.center.y}),this.components.forEach((t=>{t.emit("panstart",e)})),this.isStarted=!0;const t=this.chart.component("tooltip");t&&t.show&&t.emit("hide")}},legendPanmove(e){this.components.forEach((t=>{t.emit("panmove",e)})),e.preventDefault()},legendPanend(e){e.preventDefault(),this.components.forEach((t=>{t.emit("panend",e)})),this.isStarted=!1}}}),tZ=(e,t,n)=>({key:"hammered",type:"hammer",enable:!0,gestures:t?[QJ(e,{}),KJ(e,t,{}),...n]:[$J(e,{}),JJ(e,{}),QJ(e,{}),GJ(e,{}),eZ(e,{}),KJ(e,t,{}),...n]});function nZ(e,t,n){const r=e.getIsSingleSelect(0),{constraints:i}=n;if(i.active&&i.passive)return[];const o=t.tooltipService.getInteractions();return[tZ(t,r,o.gestures),ZJ(t),o.native]}function rZ({settings:e},t){const n={share:{type:"d3-number",format:".1%"},arc:{data:{field:t.encodings.slice.arc}},fill:e.scales.fill&&e.scales.fill.data&&e.scales.fill.data.field?{data:{field:e.scales.fill.data.field}}:{}};return t.encodings.slice.outerRadius&&(n.outerRadius={data:{field:t.encodings.slice.outerRadius}}),n}function iZ({layout:e},t,n){if(!e.dimensionTitle)return!1;const r=t.properties,i=t.themeService.getStyles();return{key:"dimension-title",type:"data-title",layout:{minimumLayoutMode:"SMALL",dock:"top"},settings:{hyperCube:e.qHyperCube,hyperCubeDef:r&&r.qHyperCubeDef,isDimension:!0,disabled:()=>n.constraints.active||!n.model,model:t.model,app:t.app,translator:t.translator,rtl:n.rtl,selections:t.selections},style:{fontFamily:i.axis.title.fontFamily,fontSize:i.axis.title.fontSize,color:i.axis.title.color}}}function oZ({layout:e},t,n){const r=function(e,t){const n={field:"qDimensionInfo/0",props:{num:{field:t.encodings.slice.arc}}};t.encodings.slice.outerRadius&&(n.props.radius={field:t.encodings.slice.outerRadius});let r=t.ds.extract(n);if(0===r.length)return"NoDataExist";const i=Ov(e,"qHyperCube.qSize.qcy");if(Ov(e,"qHyperCube.qDataPages.0.qArea.qHeight")<i)return"LimitedData";if(r=t.encodings.slice.outerRadius?r.filter((e=>"NaN"!==e.num.value&&"NaN"!==e.radius.value)):r.filter((e=>"NaN"!==e.num.value)),0===r.length)return"OnlyNanData";const o=r;return r=t.encodings.slice.outerRadius&&!e.donut.showAsDonut?r.filter((e=>e.num.value>0&&e.radius.value>0)):r.filter((e=>e.num.value>0)),0===r.length?"OnlyNegativeOrZeroValues":o.length!==r.length&&"NegativeOrZeroValues"}(e,t),{fontFamily:i}=t.themeService.getStyles();return function(e,t,n,r={}){if(!e)return!1;const{translator:i}=t,{rtl:o}=n;return{key:"disclaimer",type:"disclaimer",layout:{dock:qv[e].alignment},settings:{label:i.get("Object.Disclaimer."+e),rtl:o},style:r}}(r,t,n,{fontFamily:i})}function aZ({layout:e,context:t,selectionService:n},r={}){const i=function({layout:e}={},t={}){const n={};return Dv(n,t.colorService.getScales()),t.encodings.slice.outerRadius&&Dv(n,function({layout:e},t){const n={radius:{type:"linear",include:[0],data:{extract:{field:t.encodings.slice.outerRadius}}}};return e.donut.showAsDonut||(n.radius.min=0),n}({layout:e},t)),n}({layout:e},r),o={scales:i};let a=[];const s=oZ({layout:e},r,t);if(s&&"center"===s.layout.dock)return{components:[s]};const l=t.constraints.select||t.constraints.active,u=r.colorService.getLegend({eventName:"legend",key:"legend",viewState:r.viewState,chart:r.chart,styleReference:"object.pieChart",rtl:t.rtl},{navigationDisabled:l});return i.fillRange&&u.components[0]&&("right"===u.components[0].layout.dock||"left"===u.components[0].layout.dock||t.rtl)&&(i.fillRange.invert=!0),a=[RJ({layout:e,settings:o},r),PJ({layout:e},r),AJ(r),IJ({layout:e},r),iZ({layout:e},r,t),...u.components,MJ({settings:o,scaleKey:"fill",legend:u.components[0]||{},onEdited:r.onSelect}),{key:"lasso",type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:[{key:"slices",contexts:["selection"]}]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}},{key:"area",type:"brush-area",settings:{brush:{components:[{key:"slices",contexts:["selection"],action:"add"}]}},style:{area:{fill:"transparent",strokeWidth:2,stroke:"black",strokeDasharray:"5 5",opacity:.7}}},UJ({layout:{components:e.components,dataPoint:Dv({},e.dataPoint,{show:!(e.effectPath&&e.snapshotData&&!1===e.dataPoint.show)}),donut:e.donut},context:t},r),...r.tooltipService.getComponents(),(!1!==e.showDisclaimer||!r.flags.isEnabled("SHOW_DISCLAIMER"))&&s],a=a.filter((e=>!1!==e)),{interactions:nZ(n,r,t),scales:i,components:r.pluginService.extendComponents(a),palettes:r.colorService.getPalettes(),formatters:rZ({settings:o},r),strategy:Iv(0,r)}}function sZ({instance:t,services:n}){const r=e.useElement(),i=e.useStaleLayout();e.onTakeSnapshot((e=>{if(!(i.snapshotData&&i.snapshotData.content&&i.snapshotData.content.chartData)&&(function(e,t){const n=t.getBoundingClientRect();e.snapshotData=e.snapshotData||{},e.snapshotData.content=e.snapshotData.content||{},e.snapshotData.content.size=e.snapshotData.content.size||{w:n.width,h:n.height}}(e,r),t&&n))return function({layout:e,chart:t,viewState:n,colorService:r}){return e.snapshotData.content=e.snapshotData.content||{},e.snapshotData.content.chartData={legendScrollOffset:Lv(t,"legend-cat"),rotation:n.get("rotation")},r.getSnapshotData().then((t=>{e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t}})).catch((()=>{}))}({layout:e,chart:t.chart,colorService:n.colorService,viewState:t.viewState})})),e.useImperativeHandle((()=>({getViewState:()=>({rotation:t.viewState.get("rotation"),legendScrollOffset:Lv(t.chart,"legend-cat")})})),[t])}var lZ={exports:{}};!function(e,t){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/conversion/",n(n.s=2)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=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)},u=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},c=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,a,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(null!=(t=arguments[f]))for(n in t)r=c(d,n),d!==(i=c(t,n))&&(h&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&l(r)?r:{},u(d,{name:n,newValue:e(h,a,i)})):void 0!==i&&u(d,{name:n,newValue:i}));return d}},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/qlik-modifiers/",n(n.s=1)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=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)},u=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},c=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,a,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(null!=(t=arguments[f]))for(n in t)r=c(d,n),d!==(i=c(t,n))&&(h&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&l(r)?r:{},u(d,{name:n,newValue:e(h,a,i)})):void 0!==i&&u(d,{name:n,newValue:i}));return d}},function(e,t,n){n.r(t);var r=n(0),i=n.n(r),o=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},a=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="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function u(e){return s+e+l}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function f(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function p(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e).trim();return"="===t.substring(0,1)?t.substring(1).trim():t}function h(){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 v(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=MinString(").concat(t,"))' and Only({1}").concat(t,")<='$(=MaxString(").concat(t,"))'\"}")}function y(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var u=v(c(r[0],i),h(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(r&&2===r.length){var d=c(r[0],i),f=c(r[1],i),p=h(0),m=h(1),g=v(d,p),y=v(f,m);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function b(e){return"".concat(e,"(")}function x(e){var t=e.properties,n=e.layout;return a(t,"qHyperCubeDef.qDimensions",a(n,"qHyperCube.qDimensionInfo",[])).length}var w={isFullRange:d,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=u(p(t));if(!n.showExcludedValues)return a;var s=y({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=h(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var d=h(0),f=h(1);return"If(Count(".concat(d,") * Count(").concat(f,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:f,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return f(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return m(e,t)+n+g(r)},getFunctionPrefix:b,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return b(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:y,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===x({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=h(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:p,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:c,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=x({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:h,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")}};function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var C=i.a.bind(null,!0),S={},E=Array.isArray;function M(e){return null!=e&&!Array.isArray(e)&&"object"===k(e)}function T(e){return void 0===e}function D(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function _(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach((function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=T(e[n||t])?o:e[t],e=e[n||t]}})),e}function N(e,t){var n=!0;if(M(e)&&M(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){N(e[r],t[r])||(n=!1)})),n);if(E(e)&&E(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!N(e[r],t[r]))return!1;return!0}return e===t}S.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?C({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);N(o,a)||D(t,i)||(T(a)?r.push({op:"add",path:s,value:o}):M(o)&&M(a)?r=r.concat(S.generate(a,o,s)):E(o)&&E(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&T(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(N(t,i))return r;if(!T(t[0])&&T(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(S.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){T(t[i])&&!D(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},S.apply=function(e,t){t.forEach((function(t){var n,r=_(e,t.path),i=t.path.split("/").splice(-1)[0],o=i&&Number.isNaN(+i)?r[i]:r[+i]||r,a=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(r=null,o=e),"add"===t.op||"replace"===t.op)if(E(r))"-"===i&&(i=r.length),r.splice(+i,"add"===t.op?0:1,t.value);else if(E(o)&&E(t.value)){var s,l=t.value.slice();o.length=0,(s=o).push.apply(s,function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(l))}else if(M(o)&&M(t.value))n=o,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!D(n,e)&&delete n[e]})),C(o,t.value);else{if(!r)throw new Error("Patchee is not an object we can patch");r[i]=t.value}else if("move"===t.op){var u=_(e,t.from);E(r)?r.splice(+i,0,u.splice(+a,1)[0]):(r[i]=u[a],delete u[a])}else"remove"===t.op&&(E(r)?r.splice(+i,1):delete r[i])}))},S.clone=function(e){return C({},e)},S.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},S.updateObject=function(e,t){Object.keys(e).length?S.apply(e,S.generate(e,t)):C(e,t)};var q=S,R=function(e,t,n){if(!e)return Promise.resolve();var r=q.generate(t,n);return i()(!0,t,n),r&&r.length?(r=r.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(r,!0)):Promise.resolve()},P="accumulation";function A(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===P)return n[r]}function I(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===P)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var O={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""},L={translationKey:"properties.modifier.accumulation",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.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,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=w.getNumStepComp(n,l),f=w.getAboveComp(n,l,c,d),p=w.getRangeComp("RangeSum",f);if(w.needDimension({modifier:n,properties:r,layout:i})){var h=w.getDimComp(u,1),m=w.getDimComp(u,0),g=w.getAggrComp(p,h,m);p=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return p},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,O)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(I(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(I(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(I(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(I(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=A(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=A(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(I(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(P))return!1;var o=A(t,e);return o&&!o.disabled}}}},z="movingAverage";function F(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===z)return n[r]}function j(e,t){var n=function(e,t){var n=a(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 H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},B={translationKey:"properties.modifier.movingAverage",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,o=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var u=s;void 0===u&&(u=w.getNumDimensions({properties:i,layout:o}));var c=a(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,f=w.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:d}),p=w.getNumStepComp(r,u),h=w.getAboveComp(r,u,f,p);if(r.nullSuppression)t=w.getRangeComp("RangeAvg",h);else{var m=w.getRangeComp("RangeSum",h),g=function(e,t){var n=w.getRowNoComp(e,t);if(!w.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,u);t="".concat(m," / ").concat(g)}var v=t;if(w.needDimension({modifier:r,properties:i,layout:o})){var y=w.getDimComp(c,1),b=w.getDimComp(c,0),x=w.getAggrComp(v,y,b);v=r.showExcludedValues?w.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return v},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(j(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.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(j(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(j(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(j(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=F(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=F(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(j(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(j(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return w.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=F(t,e);return o&&!o.disabled}}}},V="difference";function W(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===V)return n[r]}function U(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===V)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var $={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""},Y={translationKey:"properties.modifier.difference",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=w.getAboveComp(n,l,c),f="".concat(c," - ").concat(d);if(w.needDimension({modifier:n,properties:r,layout:i})){var p=w.getDimComp(u,1),h=w.getDimComp(u,0),m=w.getAggrComp(f,p,h);f=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return f},initModifier:function(e){Object.keys($).forEach((function(t){void 0===e[t]&&(e[t]=$[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(U(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(U(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(U(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(V))return!1;var o=W(t,e);return o&&!o.disabled}}}},X={CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},K={ONE_DIMENSION:0,ALL_DIMENSIOANS:1,DISREGARD_ALL_DIMENSIONS:2},G="normalization";function J(e,t){var n=a(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=a(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}function Q(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}function ee(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:K.ONE_DIMENSION,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:K.ALL_DIMENSIOANS,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:K.DISREGARD_ALL_DIMENSIONS,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t,n){if(e<2){var r=Q(t,0);t.splice(r,1)}return t}(i,o),function(e,t,n){if(0===e){var r=Q(t,1);t.splice(r,1)}return t}(J(e,r).selectionScope,o)}function te(e,t,n){var r=[{value:X.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:X.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:X.DISREGARD_SELECTION,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return function(e,t,n){if(1===e){var r=Q(t,0);t.splice(r,1)}return t}(J(e,n).dimensionalScope,r)}var ne={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:K.DISREGARD_ALL_DIMENSIONS,selectionScope:X.DISREGARD_SELECTION};function re(e){return 2===e?"{1}":""}function ie(e,t,n){return 1===e?"{$<".concat(w.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function oe(e,t){return 0===e&&t>1||2===e?"Total":""}function ae(e,t,n){return 0===e&&t>1?"<".concat(w.getDimDefWithWrapper(n),">"):""}var se={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=n.selectionScope,f=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=re(t),l=ie(t,n,r),u=""===s&&""===l?"":s||l,c=oe(i,o),d=ae(i,o,a),f=function(e){for(var t=[],n=0;n<e;n++)t[n]=w.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(d," Aggr(").concat(u," ").concat(e,", ").concat(f,"))")}(c,d,n.field,n.value,f,l,n.primaryDimension)},initModifier:function(e){Object.keys(ne).forEach((function(t){void 0===e[t]&&(e[t]=ne[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]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(Z(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:X.DISREGARD_SELECTION,options:function(n){return te(n,t,e)}},field:{refFn:function(t){return"".concat(Z(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return J(t,e).selectionScope===X.SELECT_FIELD_VALUE}},value:{refFn:function(t){return"".concat(Z(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return J(t,e).selectionScope===X.SELECT_FIELD_VALUE}},dimensionalScope:{refFn:function(t){return"".concat(Z(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:K.DISREGARD_ALL_DIMENSIONS,supportTooltip:!0,options:function(n,r){return ee(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return(J(t,e).dimensionalScope||0)===K.ONE_DIMENSION&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return w.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}}},getDisregardSelectionComp:re,getFieldSelectionComp:ie,getTotalComp:oe,getSelectedDimComp:ae},le={getExpression:function(e){return a(e,"qDef.base.qDef")||a(e,"qDef.qDef")},getExpressionRef:function(e){return a(e,"qDef.base.qDef")?"qDef.base.qDef":"qDef.qDef"},getLibraryIdRef:function(e){return a(e,"qDef.base.qLibraryId")?"qDef.base.qLibraryId":"qLibraryId"},getLibraryId:function(e){return a(e,"qDef.base.qLibraryId")||a(e,"qLibraryId")},getLabelRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}},ue={initBase:function(e,t){(t||ue.isValid(e))&&(o(e,"qDef.base.qDef",a(e,"qDef.qDef")),o(e,"qDef.base.qLibraryId",a(e,"qLibraryId")),o(e,"qDef.base.qLabel",a(e,"qDef.qLabel")),o(e,"qDef.base.qLabelExpression",a(e,"qDef.qLabelExpression")))},restoreBase:function(e){ue.isValid(e)&&(o(e,"qDef.qDef",a(e,"qDef.base.qDef")),o(e,"qLibraryId",a(e,"qDef.base.qLibraryId")),o(e,"qDef.qLabel",a(e,"qDef.base.qLabel")),o(e,"qDef.qLabelExpression",a(e,"qDef.base.qLabelExpression")),a(e,"qDef.qAggrFunc")&&a(e,"qDef.base.qAggrFunc")&&o(e,"qDef.qAggrFunc",a(e,"qDef.base.qAggrFunc")),delete e.qDef.base)},isValid:function(e){var t=a(e,"qDef.base.qDef"),n=a(e,"qDef.base.qLibraryId");return void 0!==t||void 0!==n}},ce=ue;function de(e){return(de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var fe={accumulation:L,movingAverage:B,difference:Y,normalization:se},pe=(t.default={modifiers:fe,apply:he,applyModifiers:me,cleanUpMeasure:ge,destroy:function(e){e&&pe[e.id]&&pe[e.id].masterItemSubscriber&&(pe[e.id].masterItemSubscriber&&pe[e.id].masterItemSubscriber.unsubscribe(),delete pe[e.id])},hasActiveModifiers:ve,getActiveModifier:ye,initBase:ce.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return fe[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return fe[e]&&fe[e].isApplicable({properties:n,layout:r})}))},measureBase:le,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=we(e);De({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Pe({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:be},{});function he(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,r=e.isSnapshot,o=void 0!==r&&r,s=e.masterItem;pe[t.id]=pe[t.id]||{isFirstTime:!0};var l=pe[t.id].isFirstTime;if(pe[t.id].isFirstTime=!1,n&&"object"===de(n))return me({model:t,properties:n});var u=t?t.layout:void 0,c=a(u,"qSelectionInfo.qInSelections");if(o||c)return Promise.resolve(!1);var d=a(u,"qHyperCube.qMeasureInfo"),f=pe[t.id].lastReloadTime;if(pe[t.id].lastReloadTime=a(t,"app.layout.qLastReloadTime"),ve({measures:d,layout:u})){var p=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return a(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 Te({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:d,layout:u,model:t,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 De({modifiers:we(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:d,layout:u,masterItem:s,isFirstTime:l})?t.getEffectiveProperties().then((function(e){var n=i()(!0,{},e);Ce(n);var r=Ae(n);return _e({model:t}).then((function(i){return Ne({libraryIds:r,model:t}).then((function(r){return p&&function(e){var t=e.properties;xe(t).forEach((function(e){return function(e){var t=e.measure;if(Te({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===de(e)&&!e.disabled){if(n++,"object"!==de(fe[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=fe[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Ee(t)&&w.simplifyExpression(t.qDef.base.qDef)!==w.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:n}),me({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:r,dimensionAndFieldList:i})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===de(e.base)}))}(d)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,n=e.properties,r=Ae(n);return Ie({model:t,libraryIds:r}).then((function(){var e=i()(!0,{},n);return xe(n).forEach((function(e){return ge(e)})),Re({oldProperties:e,newProperties:n,model:t})}))}({model:t,properties:e})})):Promise.resolve(!1)}function me(e){var t=e.model,n=e.oldProperties,r=e.properties,o=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===n&&(n=l?i()(!0,{},r):r),Ce(r);var f=Ae(r);return Ie({model:t,libraryIds:f,masterItem:u}).then((function(){return function(e){var t=e.measures,n=e.properties,r=e.model,o=e.libraryItemsProps,s=e.dimensionAndFieldList;if(t||(t=xe(n)),!t.length)return Promise.resolve();if(!ve({measures:t,properties:n}))return t.forEach((function(e){return ge(e)})),Promise.resolve();var l=o?void 0:Ae(n);return _e({model:r,dimensionAndFieldList:s}).then((function(e){return Ne({libraryIds:l,model:r,libraryItemsProps:o}).then((function(r){t.forEach((function(t){De({modifiers:t.qDef.modifiers,properties:n})?(function(e){var t=e.measure,n=e.properties,r=e.libraryItemsProps,o=e.dimensionAndFieldList,s=0;ce.isValid(t)||ce.initBase(t,!0);var l=t.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach((function(e){if("object"===de(e)&&!e.disabled){if(s++,"object"!==de(fe[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");fe[e.type].initModifier(e);var l=t.qLibraryId||c&&c.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=fe[n.type].generateExpression({expression:s,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=l,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||a.qMeasure.qLabel)&&(t.qDef.qLabel=a.qMeasure.qLabel),(t.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=a.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(t.qDef.qNumFormat=a.qMeasure.qNumFormat,t.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=a.qMeasure.coloring,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:r,dimensionAndFieldList:o}):function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList;"function"==typeof fe[n.type].updateModifier&&fe[n.type].updateModifier(n,r.qHyperCubeDef);var a=le.getExpression(t),s=fe[n.type].generateExpression({expression:a,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=s,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||a,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:o}),function(e){var t=a(e,"qDef.qAggrFunc");"Expr"!==t||be(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&be(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(t)}}))}({measure:t,properties:n,libraryItemsProps:r,dimensionAndFieldList:e}),Se(t)):ge(t)}))}))}))}({measures:o,properties:r,model:t,libraryItemsProps:c,dimensionAndFieldList:d}).then((function(){return l?Re({oldProperties:n,newProperties:r,model:t}):Promise.resolve(!1)}))}))}function ge(e){!function(e){var t=we(e);return Array.isArray(t)&&t.some((function(e){return"object"===de(e)&&!e.disabled&&!fe[e.type]}))}(e)?ce.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Se(e)}function ve(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return De({modifiers:we(e),properties:n,layout:r})}))}function ye(e){var t=we(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(fe[r.type]&&!r.disabled)return r}}function be(e){var t=ye(e);return!t||fe[t.type].enableTotalsFunction(e)}function xe(e){return a(e,"qHyperCubeDef.qMeasures",[]).concat(a(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function we(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function ke(e){return a(e,"outputExpression.qValueExpression.qExpr")||a(e,"outputExpression")}function Ce(e){xe(e).forEach((function(e){return function(e){var t=ye(e);t&&(void 0!==t.outputExpression&&ke(t)!==e.qDef.qDef?delete e.qDef.base:!ce.isValid(e)&&t.base&&(e.qDef.base=i()(!0,{},t.base)))}(e)}))}function Se(e){var t=we(e);Array.isArray(t)&&t.forEach((function(t){"object"===de(t)&&(t.disabled||!fe[t.type]&&ke(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function Ee(e){return e.base||e.qDef&&e.qDef.base}function Me(e){var t=Ee(e);return e.qLibraryId||t&&t.qLibraryId}function Te(e){var t=e.measure,n=e.properties,r=e.layout;return!Me(t)&&De({modifiers:we(t),properties:n,layout:r})}function De(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==de(e)||e.disabled||!fe[e.type])&&(void 0===i[e.type]&&(i[e.type]=fe[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function _e(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then((function(e){i.dimensionList=e}));r.push(o);var a=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(a),Promise.all(r).then((function(){return i}))}function Ne(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),Promise.all(s).then((function(){return a}))}function qe(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Re(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(a(t,"qHyperCubeDef.qMeasures"),qe)!==JSON.stringify(a(n,"qHyperCubeDef.qMeasures"),qe)||JSON.stringify(a(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),qe)!==JSON.stringify(a(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),qe);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&a(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 Pe(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===de(e)&&!e.disabled&&fe[e.type]&&fe[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function Ae(e){var t=xe(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=we(t);if(De({modifiers:r,properties:e})){var o=Me(t);o&&n.push(o),i=i||Pe({modifiers:r,properties:e})}})),a(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function Ie(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(pe[t.id].masterItemSubscriber=pe[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},o={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=a(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=a(e,n)})),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function c(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,a=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),o={},t.forEach((function(e){o[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:a}),Object.keys(r).forEach((function(e){i[e]||o[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&s.push(c(e,"getMeasure"))})),Object.keys(o).forEach((function(e){o[e]&&!r[e]&&s.push(c(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return he({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),pe[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}}])},function(e,t,n){function r(e){var t=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)}(e%62),n=Math.floor(e/62);return n>0?r(n)+t:t}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})(e)}n.r(t);var o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return r(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}var d={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:c},f=n(1),p=n.n(f),h={addDimensions:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},addMeasures:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&d.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},copyProperties:function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},updateLayoutExclude: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},storeMeasuresModifiers:function(e){e.forEach((function(e){p.a.cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))}};function m(e,t,n){var r,i,a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((i=(i=(r=JSON.stringify(a)).match(/:\{/g))?i.length:0)>2)return;a=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var s=o.getValue(e,"qLayoutExclude.quarantine");s[n]||(s[n]={}),s[n][t]=a}var g=n(0),v=n.n(g);function y(e,t){var n=v()(!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 b(e,t){return v()(!0,{},t,e)}function x(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var w=Math.pow(2,53)-1;function k(e){return function(e){if(Array.isArray(e))return C(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))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 S(e){return function(e){if(Array.isArray(e))return E(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}(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 E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var M={importCommonProperties: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},copyPropertyIfExist:function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},copyPropertyOrSetDefault:function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},getDefaultDimension:function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},getDefaultMeasure:function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},addDimensions:function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=y(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var u=y(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},addMeasures:function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=b(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var u=b(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},getMaxMinDimensionMeasure:function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=x(a.max,i.dimensions.length,w),l=x(a.min,i.dimensions.length,0);return{maxDimensions:x(o.max,s,w),minDimensions:x(o.min,l,0),maxMeasures:s,minMeasures:l}},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(d.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,d.indexRemoved(n.qInterColumnSortOrder,o))},createNewProperties: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=v()(!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=v()(!0,{},n,i)).components&&(i.components=[]),i},shouldInitLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},initLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},updateDimensionsOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var i=o.getValue(t,r||"").qHyperCubeDef,a=k(i.qDimensions);i.qDimensions=[],a.forEach((function(e){i.qDimensions.push(e),n.dimensions.added(e,t)}))}},updateMeasuresOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var i=o.getValue(t,r||"").qHyperCubeDef,a=S(i.qMeasures);i.qMeasures=[],a.forEach((function(e){i.qMeasures.push(e),n.measures.added(e,t)}))}},restoreMeasuresModifiers:function(e){var t=e.measures,n=e.modifierTypes;t&&n&&p.a.isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))}};function T(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)}var D={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),h.addDimensions({exportFormat:i,qHyperCubeDef:l}),h.addMeasures({exportFormat:i,qHyperCubeDef:l}),h.setInterColumnSortOrder({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,h.copyProperties({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),h.updateLayoutExclude({exportFormat:i,properties:a}),r||h.storeMeasuresModifiers(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(m(i.properties,"filters","storedFilters"),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(m(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(m(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,u=e.hypercubePath,c=e.extension,d=e.supportedFilters,f=void 0===d||d,p=e.isHCModifierSupported,h=void 0===p||p,m={qChildren:[]},g=M.createNewProperties({exportFormat:t,initialProperties:r,hypercubePath:u}),v=o.getValue(r,u||"").qHyperCubeDef,y=o.getValue(g,u||"").qHyperCubeDef,b=M.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,w=b.minDimensions,k=b.maxMeasures,C=b.minMeasures,S=l.defaultDimension,E=void 0===S?M.getDefaultDimension():S,D=l.defaultMeasure,_=void 0===D?M.getDefaultMeasure():D;y.qDimensions.length=0,y.qMeasures.length=0,M.shouldInitLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:k,minMeasures:C})&&M.initLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:k,minMeasures:C,newHyperCubeDef:y}),M.addDimensions({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:y,defaultDimension:E}),M.addMeasures({exportFormat:t,maxMeasures:k,minMeasures:C,newHyperCubeDef:y,defaultMeasure:_}),M.updateDimensionsOnAdded({newProperties:g,dataDefinition:a,hypercubePath:u}),M.updateMeasuresOnAdded({newProperties:g,dataDefinition:a,hypercubePath:u}),M.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:y}),M.copyPropertyIfExist("qMaxStackedCells",v,y),M.copyPropertyIfExist("qNoOfLeftDims",v,y),M.copyPropertyOrSetDefault("qInitialDataFetch",v,y,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),M.copyPropertyOrSetDefault("qMode",v,y,"S"),M.copyPropertyOrSetDefault("qReductionMode",v,y,"N"),M.copyPropertyOrSetDefault("qSortbyYValue",v,y),M.copyPropertyOrSetDefault("qIndentMode",v,y),M.copyPropertyOrSetDefault("qShowTotalsAbove",v,y),M.importCommonProperties(g,t,r),m.qProperty=g;var N=o.getValue(c||{},"support.modifiers");return M.restoreMeasuresModifiers({measures:y.qMeasures,modifierTypes:N}),f&&T(m.qProperty,"storedFilters"),"S"===y.qMode&&h&&T(m.qProperty,"dynamicScript"),m}},_={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function N(e,t,n,r){t=t||[];var i=c(e,r,n),o=c(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function q(e,t){return e.length!==t}var R={create:function(e,t){if(!e||!_[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(N(a,t,r,i),q(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},P={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}},A={colorModeOptions:{primary:function(){return!0},dimension:function(e){return P.getNumDimensions(e)>0&&P.getNumMeasures(e)<=1},multiColor:function(e){return P.getNumMeasures(e)>1},measure:function(e){return P.getNumDimensions(e)>0},expression:function(e){return P.getNumMeasures(e)>=1}}},I={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return P.getNumMeasures(e)>=1}}},O={scatterplot:I,"sn-scatter-plot":I,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return P.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return P.getNumDimensions(e)>1},multiColor:function(e){return P.getNumMeasures(e)>1},measure:function(e){return P.getNumDimensions(e)<=1},expression:function(e){return P.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return P.getNumDimensions(e)>=1},multiColor:function(e){return P.getNumMeasures(e)>1},measure:function(e){return P.getNumDimensions(e)>=1},expression:function(e){return P.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 P.getNumDimensions(e)>=1}}}};function L(e,t,n){if(Array.isArray(e[t])){var r=d.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function z(e,t){var n=R.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){L(e,"qAttributeDimensions",n),L(e,"qAttributeExpressions",n)})),t.forEach((function(e){L(e,"qAttributeDimensions",n),L(e,"qAttributeExpressions",n)}))}function F(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function j(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;z(r,i);var l=r[r.length-1];if(l){var u=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),f=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var p=R.create(R.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:p,label:s,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:f});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;i||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),o&&(t.qNumFormat=o,t.isCustomFormatted=a)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:p,measures:a,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:f})}n?(p.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(p)):l.qAttributeExpressions.push(p)}}}function H(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":(i=function(e,t){return t?e.qLibraryId:p.a.measureBase.getLibraryId(e)}(n,t))?(s.type="measure",s.name=i,s.id=i,(o=function(e,t){return p.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r))&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}var B={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function V(e,t,n,r){var i=n?"expression":t.type,o=e.color,a=o.mode,s=P.getItemLabel(t);switch(F(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||P.wrapFieldName(t.name),key:P.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:n||s,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&B.useMasterNumberFormat(o.formatting)}r||(o.auto=!1,o.mode=a)}function W(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=R.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return V(e,H("dimension",!!a,a||r)),!!a}function U(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&F(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=H("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,V(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&W(e,t))return;j({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}function $(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&F(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=H("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,V(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=R.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return V(e,H("measure",!!s,s||r[0])),!!s}(e,t))return;j({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}var Y={changeProperty: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)},getCanColorBy:function(e,t){var n={primary:!0};if(e){var r=(O[t]||A).colorModeOptions||A.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},shouldUpdateColorBy: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))},updateColorBy:function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"color.auto"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),a=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);r?z(i,s):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions;return!t&&"byDimension"===n&&r.length>0}({auto:r,colorMode:n,dimensions:i})?U(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:r,colorMode:n,dimensions:i,measures:a,properties:e})?$(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),z(r,a)}(e,t)},deleteTotalMode:function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},shouldAddColorByExpression:function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},addColorByExpression: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)},switchToAutoColor:function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},shouldSwitchToColorPersistent:function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n}},X={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=D.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=R.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return R.moveByIdFromGroup(a,[],"qAttributeDimensions",u),R.moveByIdFromGroup(a,[],"qAttributeExpressions",u),R.moveByIdFromGroup(s,[],"qAttributeExpressions",c),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=D.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty,f=o.getValue(d,"visualization"),p=o.getValue(d,"qHyperCubeDef.qDimensions",[]),h=o.getValue(d,"color.mode",""),m=o.getValue(d,"color.auto",""),g=Y.getCanColorBy(d,f),v=Y.shouldUpdateColorBy({canColorBy:g,autoColor:m,colorMode:h,dimensions:p});return g[h]?Y.shouldAddColorByExpression({shouldUpdateColorBy:v,properties:d})&&Y.addColorByExpression(d):Y.switchToAutoColor(d),v&&Y.updateColorBy(d,"qHyperCubeDef."),Y.shouldSwitchToColorPersistent(d)&&Y.changeProperty(d,"color.persistent",!0),Y.deleteTotalMode(p),c}},K=["bar","marker","line"],G={handleAutoMinMax:function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?T(n,"unsupportedAutoMinMax")||v()(n.measureAxis,t.measureAxis):T(n,"supportedAutoMinMax")||v()(n.measureAxis,t.measureAxis)},handleMeasuresAxis:function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.exportFormat,n=e.initialProperties;return!(!t.properties.measureAxes||n.measureAxes||!n.measureAxis||void 0===n.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}}),K.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(a);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&v()(s,n.properties.measureAxes[t[0].axis])):v()(s,n.properties.measureAxes[0])}},setInterColumnSortOrder: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}}}},J={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=X.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(m(s,"measureAxis.min","supportedAutoMinMax"),m(s,"measureAxis.max","supportedAutoMinMax")):(m(s,"measureAxis.min","unsupportedAutoMinMax"),m(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=X.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty;return G.handleAutoMinMax({initialProperties:n,properties:d}),G.handleMeasuresAxis({exportFormat:t,initialProperties:n,properties:d,measureType:a}),G.setInterColumnSortOrder(d.qHyperCubeDef),c}};function Z(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Q(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var u=Z(n,r,l);o.setValue(t,u,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}function ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=Z(n,r,s),u=o.getValue(t,l);void 0!==u&&(o.setValue(i,a,u),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}var te={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalColoring",arrayName:"measures",itemPath:"qDef.conditionalColoring"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",itemPath:"qDef.conditionalColoring",arrayName:"measures",quarantineName:"conditionalColoring"})}},ne={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},quarantineAlternative:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})},unquarantineAlternative:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})}};t.default={hypercube:D,colorChart:X,axisChart:J,quarantineProperty:m,unquarantineProperty:T,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:ne}}])}(lZ);var uZ=r(lZ.exports);const cZ={setValue(e,t,n){if(!t)return;const r=t.split(".");let i=e;const o=r[r.length-1];let a;for(a=0;a<r.length-1;++a)null==i[r[a]]&&(i[r[a]]=Number.isNaN(+r[a+1])?{}:[]),i=i[r[a]];void 0!==n?i[o]=n:delete i[o]},getValue(e,t,n){const r=t.split(".");let i,o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(null==o[r[i]])return n;o=o[r[i]]}return o}},dZ={getDimensions:e=>cZ.getValue(e,"qHyperCubeDef.qDimensions",[]),getNumDimensions:e=>cZ.getValue(e,"qHyperCubeDef.qDimensions.length",0),getMeasures:e=>cZ.getValue(e,"qHyperCubeDef.qMeasures",[]),getNumMeasures:e=>cZ.getValue(e,"qHyperCubeDef.qMeasures.length",0),getDimensionLayouts(e,t){const n=cZ.getValue(e,t?t+".qHyperCube":"qHyperCube",null);return n?n.qDimensionInfo:[]},getDimensionLayout(e,t,n){return this.getDimensionLayouts(t,n).filter((t=>e===t.cId))[0]},getMeasureLayouts(e,t){const n=cZ.getValue(e,t?t+".qHyperCube":"qHyperCube",null);return n?n.qMeasureInfo:[]},getMeasureLayout(e,t,n){return this.getMeasureLayouts(t,n).filter((t=>e===t.cId))[0]}};const fZ={colorModeOptions:{primary:()=>!0,dimension:()=>!0,multiColor:()=>!1,measure:()=>!0,expression:e=>dZ.getNumMeasures(e)>=1},showLegend:e=>{const t=cZ.getValue(e,"color.auto"),n=cZ.getValue(e,"color.expressionIsColor"),r=cZ.getValue(e,"color.mode");return!(!t&&"primary"===r||!t&&"byExpression"===r&&(n||void 0===n))},persistentColorsShow:e=>!cZ.getValue(e,"color.auto")&&"byDimension"===cZ.getValue(e,"color.mode"),useDimValColShow:e=>(void 0===cZ.getValue(e,"color.useDimColVal")&&cZ.setValue(e,"color.useDimColVal",!1),!cZ.getValue(e,"color.auto")&&"byDimension"===cZ.getValue(e,"color.mode")&&"libraryItem"===cZ.getValue(e,"color.byDimDef.type"))},pZ=function(e){const{colorModeOptions:t,persistentColorsShow:n,useDimValColShow:r,showLegend:i}=fZ;this.color={colorMode:{options(n){const r=[];return"explore"===e&&r.push({value:"auto",translation:"Common.Auto"}),t.primary(n)&&r.push({value:"primary",translation:"properties.colorMode.primary"}),t.multiColor(n)&&r.push({value:"byMultiple",translation:"properties.colorMode.multicolored"}),t.dimension(n)&&r.push({value:"byDimension",translation:"properties.colorMode.byDimension"}),t.measure(n)&&r.push({value:"byMeasure",translation:"properties.colorMode.byMeasure"}),t.expression(n)&&"explore"!==e&&r.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),r}},persistentColors:{show:e=>r(e)?n(e)&&!cZ.getValue(e,"color.useDimColVal"):n(e)},useDimColVal:{show:r}},this.legend={show:i,showTitle:{show(e){const t=cZ.getValue(e,"color.auto");return cZ.getValue(e,"legend.show")&&i(e)&&(t||!function(e){return"byExpression"===cZ.getValue(e,"color.mode")&&!0===cZ.getValue(e,"color.expressionIsColor")}(e))}},dock:{show:e=>cZ.getValue(e,"legend.show")&&i(e)}}};function hZ(e){return new pZ(e)}const mZ={classification:{section:"styling",tags:["simple"],exclusive:!0},component:"items",show:!0,chartType:"piechart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.PieChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,items:{strokeSection:{translation:"properties.Outline",component:"items",items:{strokeItem:{component:"items",ref:"components",key:"slices",items:{strokeWrapper:{component:"inline-wrapper",items:{strokeWidth:{translation:"LayerStyleEditor.style.strokeWidth",ref:"style.strokeWidth",width:9,show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"Common.None"},{value:"small",translation:"Common.Small"},{value:"medium",translation:"Common.Medium"},{value:"large",translation:"Common.Large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#FFFFFF"},schemaIgnore:!0,width:3,component:"color-picker"}}}}}}},cornerRadius:{component:"items",translation:"LayerStyleEditor.style.cornerRadius",items:{cornerRadiusItem:{component:"items",ref:"components",key:"slices",items:{cornerRadiusSlider:{ref:"style.cornerRadius",translation:"LayerStyleEditor.style.cornerRadius",component:"slider",min:0,max:40,step:.05,width:12,defaultValue:0,schemaIgnore:!0}}}}},innerRadius:{translation:"LayerStyleEditor.style.innerRadius",component:"items",show:e=>e.donut.showAsDonut,items:{innerRadiusItem:{component:"items",ref:"components",key:"slices",items:{innerRadiusSlider:{ref:"style.innerRadius",translation:"LayerStyleEditor.style.innerRadius",component:"slider",min:.05,max:.75,step:.01,width:12,defaultValue:.55,schemaIgnore:!0}}}}}}},gZ={component:"style-editor",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",resetBtnTranslation:"LayerStyleEditor.component.resetAll",key:"slices",ref:"components",defaultValues:{key:"slices",style:{strokeColor:{index:-1,color:"#FFFFFF"},strokeWidth:"none",cornerRadius:0,innerRadius:.55}},items:{slices:{components:"items",type:"items",uses:"styling.slice",items:{strokeWidth:{show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"LayerStyleEditor.style.strokeWidth.none"},{value:"small",translation:"LayerStyleEditor.style.strokeWidth.small"},{value:"medium",translation:"LayerStyleEditor.style.strokeWidth.medium"},{value:"large",translation:"LayerStyleEditor.style.strokeWidth.large"}],defaultValue:"none"},strokeColor:{show:e=>"none"!==e.style.strokeWidth},cornerRadius:{component:"slider",min:0,max:40,step:.05,defaultValue:0,show:!0},innerRadius:{component:"slider",min:.05,max:.75,step:.01,defaultValue:.55,show:(e,t,n)=>n.layout.donut.showAsDonut}}}}},vZ={component:"styling-panel",chartTitle:"Object.PieChart",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,items:{strokeSection:{translation:"properties.Outline",component:"panel-section",items:{strokeItem:{component:"items",ref:"components",key:"slices",items:{strokeWrapper:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:9,show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"Common.None"},{value:"small",translation:"Common.Small"},{value:"medium",translation:"Common.Medium"},{value:"large",translation:"Common.Large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#FFFFFF"},schemaIgnore:!0,width:3,component:"color-picker"}}}}}}},cornerRadius:{translation:"LayerStyleEditor.style.cornerRadius",component:"panel-section",items:{cornerRadiusItem:{component:"items",ref:"components",key:"slices",items:{cornerRadiusSlider:{ref:"style.cornerRadius",component:"slider",min:0,max:40,step:.05,width:12,defaultValue:0,schemaIgnore:!0}}}}},innerRadius:{translation:"LayerStyleEditor.style.innerRadius",component:"panel-section",show:e=>e.donut.showAsDonut,items:{innerRadiusItem:{component:"items",ref:"components",key:"slices",items:{innerRadiusSlider:{ref:"style.innerRadius",component:"slider",min:.05,max:.75,step:.01,width:12,defaultValue:.55,schemaIgnore:!0}}}}}}},yZ=hZ("hard");const bZ=e=>{var t;null!==(t=e.color)&&void 0!==t&&t.auto||(OY(e,"color.mode","byDimension"),OY(e,"color.byDimDef.activeDimensionIndex",0),OY(e,"color.persistent",!1))},xZ=e=>{var t;const n=[{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}];switch(null===(t=e.color)||void 0===t?void 0:t.mode){case"byMultiple":n.push({value:"byMultiple",translation:"properties.colorMode.multicolored"});break;case"byMeasure":n.push({value:"byMeasure",translation:"properties.colorMode.byMeasure"});break;case"byExpression":n.push({value:"byExpression",translation:"properties.colorMode.byExpression"})}return n},wZ=e=>{const{flags:t,translator:n}=e||{},r={items:{simpleItems:{items:{autoColor:{label:e=>{var t;return null!==(t=e.color)&&void 0!==t&&t.auto?n.get("Simple.Color.Auto",n.get("properties.colorMode.byDimension")):n.get("Common.Custom")},change:bZ},colorMode:{options:xZ}}}}},i={items:{labels:{items:{header:{show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length},pointLabels:{component:"checkbox",ref:"dataPoint.auto",type:"boolean",defaultValue:!0,translation:"Simple.Label.Value",show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length,change(e){e.dataPoint.auto||OY(e,"dataPoint.labelMode","none")}},dimensionTitle:{component:"checkbox",ref:"dimensionTitle",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length,convertFunctions:{get:(e,t,n,r)=>!r.dimensionTitle,set(e,t,n,r,i){i.dimensionTitle=!e}}}}}}};return{uses:"settings",items:{simpleStyling:null!=t&&t.isEnabled("PIECHART_SIMPLE_STYLING")?mZ:void 0,simpleLabels:i,general:{items:{showDisclaimer:null!=t&&t.isEnabled("SHOW_DISCLAIMER")?{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}:void 0}},presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:{sliceStyling:null!=t&&t.isEnabled("SENSECLIENT_PS_17478_STYLINGPANEL_PIECHART")?vZ:gZ,showAsDonut:{ref:"donut.showAsDonut",type:"boolean",component:"item-selection-list",defaultValue:!1,horizontal:!0,items:[{icon:"pie_chart_pie",component:"icon-item",labelPlacement:"bottom",translation:"properties.pie",value:!1},{icon:"pie_chart_donut",component:"icon-item",labelPlacement:"bottom",translation:"properties.donut",value:!0}]},labels:{type:"items",snapshot:{tid:"property-labels"},items:{dimensionTitle:{ref:"dimensionTitle",type:"boolean",component:"switch",translation:"properties.dataPoints.dimensionlabels",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},valuesAuto:{ref:"dataPoint.auto",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},labelMode:{ref:"dataPoint.labelMode",type:"string",component:"dropdown",options:[{value:"none",translation:"Common.None"},{value:"share",translation:"properties.dataPoints.labelmode.share"},{value:"value",translation:"properties.dataPoints.labelmode.value"}],defaultValue:"share",show:e=>!e.dataPoint.auto},labelValueMode:{ref:"dataPoint.labelValueMode",type:"string",component:"dropdown",translation:"properties.dataPoints.labelvaluemode",options:[{value:"arc",translation:"Visualizations.Descriptions.Angle"},{value:"radius",translation:"Visualizations.Descriptions.Radius"}],defaultValue:"arc",show:e=>!e.dataPoint.auto&&function(e){return e.qHyperCubeDef&&e.qHyperCubeDef.qMeasures.length>1||e.qHyperCube&&e.qHyperCube.qMeasureInfo.length>1}(e)&&"value"===e.dataPoint.labelMode}}}}},colorsAndLegend:{uses:"colorsAndLegend",items:{colors:{items:{colorMode:{options:yZ.color.colorMode.options},persistentColors:{show:yZ.color.persistentColors.show}}},simpleColors:r,legend:{show:yZ.legend.show,items:{show:{defaultValue:!1,snapshot:{tid:"property-legend"}},showTitle:{show:yZ.legend.showTitle.show},dock:{show:yZ.legend.dock.show}}}}},tooltip:{uses:"tooltip"}}}},kZ={uses:"data",items:{dimensions:{uses:"dimensions"},measures:{uses:"measures",items:{numberFormatting:{items:{percentOfPieMessage:{component:"text",translation:"properties.numberFormatting.pieMessage",show:(e,t,{properties:n}={})=>n&&(n.dataPoint.auto||"share"!==n.dataPoint.labelMode)}}}}}}},CZ={uses:"sorting",items:{interColumnSorting:{reset:e=>{const{qDimensions:t,qMeasures:n,qInterColumnSortOrder:r}=e.qHyperCubeDef;if(1===t.length&&n.length>=1){const t=r.length,n=[...Array(t).keys()];[n[0],n[1]]=[n[1],n[0]],e.qHyperCubeDef.qInterColumnSortOrder=n}}}}},SZ={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{suppressZero:null,calcCond:{uses:"calcCond"}}}}};function EZ(e){return{type:"items",component:"accordion",items:{data:kZ,sorting:CZ,addons:SZ,settings:wZ(e)}}}const MZ=hZ("explore"),TZ=EZ();var DZ={type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sort"},presentation:{uses:"presentation",items:{showAsDonut:TZ.items.settings.items.presentation.items.showAsDonut,labelMode:{type:"items",items:{labelMode:{type:"string",component:"radio-list",translation:"properties.dataPoints.labelmode",diffs:["dataPoint.auto:false","dataPoint.labelMode"],options:TZ.items.settings.items.presentation.items.labels.items.labelMode.options,setPropertyValue(e,t){e.dataPoint.auto=!1,e.dataPoint.labelMode=t},getValue:e=>e.dataPoint.auto?"":e.dataPoint.labelMode}}}}},color:{uses:"color",items:{mode:{options:MZ.color.colorMode.options},dimension:{items:{persistentColors:{show:e=>!(e.color&&"byDimension"===e.color.mode&&e.color.useDimColVal&&MZ.color.useDimColVal.show(e))}}}}}}};const _Z="slices";function NZ(e,t){const n=e&&e.desc&&void 0!==e.desc.share?e.desc.share:void 0;return t("share")(n)}function qZ(e){return e.data.num.label}function RZ(e){return e.data.radius.label}function PZ(e,t,n,r){return function(e,t){if(e.dataPoint.auto)return 1===e.qHyperCube.qSize.qcy?qZ:NZ;if("share"===e.dataPoint.labelMode)return NZ;if("value"===e.dataPoint.labelMode)return t.encodings.slice.outerRadius&&"radius"===e.dataPoint.labelValueMode?RZ:qZ;return qZ}(n,r)(e,t)}function AZ(e){let t;return t=e.data.label?function(e,t){let n=e;return n.length>t&&(n=n.substr(0,t-3)+"..."),n}(e.data.label,20):"",t}class IZ{constructor({element:e,properties:t,effectHelper:n,Flag:r}){this.element=e,this.Flag=r,n.initFade(this.element);const i=e.find(".effectLayer");i.length>0&&i.remove(),e.append('<div class="effectLayer"></div>'),this.effectLayer=e.find(".effectLayer"),this._effectProperties=t,this.selectedIndex=t.selectedIndex,this.hasPropertiesPanel=!1,this.effectApplied=!0,n.fadeIn(this.element)}updateOrigSettings(e){return{dataPoint:e.dataPoint,legend:e.legend,dimensionTitle:e.dimensionTitle}}updateFlags(e,t){const n=this.chart.getAffectedShapes("highlight"),r=this.effectLayer[0].getBoundingClientRect(),i=n.map((n=>{const{start:i,end:o,outerRadius:a,offset:s}=n.desc.slice,{scaleRatio:l}=this.chart.component(n.key).rect,u=n.element.getBoundingClientRect(),c=(i+o)/2,d=u.left-r.left+l.x*(s.x+a*Math.sin(c)),f=u.top-r.top+l.y*(s.y-a*Math.cos(c)),p=Math.cos(c)>0?"top":"bottom",h=Math.sin(c)>0?"right":"left";return{title:AZ(n),label:PZ(n,this.chart.formatter,e,t),orientation:`${p}${h}`,position:{x:d,y:f}}}));this.Flag.show(this.effectLayer,i)}init(e,t,n,r){return t.getProperties().then((e=>{if(!e.originalModelSettings){const t=Dv(!0,{},e);e.originalModelSettings=this.updateOrigSettings(t)}e.effectProperties=r,e.effectPath=n,e.dataPoint.show=!1,e.legend.show=!1,e.dimensionTitle=!1,t.setProperties(e)}))}remove(e,t,n){return e.options=Dv(e.options,{effect:null}),n?t.getProperties().then((e=>Dv(e,{effectPath:null,effectProperties:null,dataPoint:Dv(!0,{},e.originalModelSettings.dataPoint),legend:Dv(!0,{},e.originalModelSettings.legend),dimensionTitle:e.originalModelSettings.dimensionTitle}))):Promise.resolve()}}class OZ extends IZ{init(e,t,n,r){return e.options=Dv(!0,e.options,{effect:this}),t.layout.effectProperties&&t.layout.effectPath===n&&t.layout.effectProperties.max===r.max?Promise.resolve():super.init(e,t,n,r)}update(e,t,n){this.chart=t,this.updateHighlight(e),this.updateFlags(e,n)}updateHighlight(e){const t=this.chart.component(_Z).data.items,n=e.effectProperties.min,r=e.effectProperties.max,i=[];let o=[1/0,-1],a=[-1/0,-1];t.forEach(((e,t)=>{const i=e.num.value;n&&i<o[0]&&(o=[i,t]),r&&i>a[0]&&(a=[i,t])})),-1!==o[1]&&i.push(t[o[1]].value),-1!==a[1]&&i.push(t[a[1]].value),i.length&&this.chart.brush("highlight").setValues(i.map((e=>({key:"qHyperCube/qDimensionInfo/0",value:e}))))}}class LZ extends IZ{constructor(e){super(e),this.hasPropertiesPanel=!0,this.propsTemplate=e.highlightValuePropsTemplate,this.effectHelper=e.effectHelper}onClick(e){if(!this.chart)return;const t=this.chart.shapesAt(function(e,t){const n=t.element.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}(e,this.chart),{propagation:"stop"});if(1!==t.length)return;const n=t[0],r=this.chart.component(_Z).data.items.map((e=>e.value)).indexOf(n.data.value);-1!==r&&(this.selectedIndex=r,this.effectHelper.updateSelectedPointIndex(this))}update(e,t,n){this.chart=t,this.updateHighlight(e),this.updateDataPoints(e,n),this.updateFlags(e,n)}updateHighlight(e){const t=this.chart.component(_Z).data.items[e.effectProperties.selectedIndex];this.chart.brush("highlight").setValues([{key:"qHyperCube/qDimensionInfo/0",value:t.value}])}updateDataPoints(e,t){this.dataPoints=this.chart.findShapes("path").filter((e=>e.key===_Z)).map(((n,r)=>{const i=PZ(n,this.chart.formatter,e,t);return{text:`${AZ(n)} (${i})`,value:r}}))}init(e,t,n,r){return e.options=Dv(!0,e.options,{effect:this}),t.layout.effectProperties&&t.layout.effectPath===n&&t.layout.effectProperties.selectedIndex===r.selectedIndex?Promise.resolve():super.init(e,t,n,r)}}const zZ="/effects/highlight-value",FZ="/effects/maxmin";var jZ={isCompatible:({effectPath:e})=>e===FZ||e===zZ,create:e=>e.effectPath===FZ?new OZ(e):e.effectPath===zZ?new LZ(e):null};function HZ(e){const t={},{components:n,tooltip:r}=e,i=n?n.filter((e=>"slices"===e.key))[0]:void 0;if(i&&i.style&&Object.keys(i.style).forEach((e=>{t["chart_style_"+e]=i.style[e]})),r){var o,a;t.chart_tooltip_custom=!r.auto;const e=null===(o=r.chart)||void 0===o||null===(a=o.object)||void 0===a?void 0:a.refId;!r.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}function BZ(e){if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures;1===t.length&&1===n.length&&(n[0].qSortBy.qSortByNumeric=-1,e.qHyperCubeDef.qInterColumnSortOrder.splice(0,e.qHyperCubeDef.qInterColumnSortOrder.length,1,0))}function VZ(e){e.qOtherTotalSpec.qOtherMode="OTHER_COUNTED",e.qOtherTotalSpec.qOtherCounted={qv:"10"}}function WZ({translator:e}){return{dimensions:{min:1,max:1,description:()=>e.get("Visualizations.Descriptions.Slice"),add(e,t){VZ(e),BZ(t),hJ.addCallbackCustomTooltip(t)},move(e,t){VZ(e),BZ(t),hJ.moveCallbackCustomTooltip(t,e)},remove(e,t){hJ.removeCallbackCustomTooltip(t,e)},replace(e,t,n,r){VZ(e),BZ(r),hJ.replaceCallbackCustomTooltip(r,t)}},measures:{min:1,max:2,description:(t,n)=>e.get(0===n?"Visualizations.Descriptions.Angle":"Visualizations.Descriptions.Radius"),add(e,t){BZ(t)},remove(e,t){!function(e){if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qMeasures,{mode:n}=e.color;"byExpression"===n&&0===t.length&&(e.color.mode="primary")}(t)}}}}const UZ=e=>e.qMax<=0,$Z=e=>!(!(e&&e.qHyperCube.qSize.qcy>0)||e.qHyperCube.qMeasureInfo.every(UZ));function YZ(e){return{definition:EZ(e),softDefinition:DZ,support:{snapshot:$Z,export:$Z,exportData:!0,sharing:$Z,viewData:!0,effects:!0},effects:jZ,extendMetrics:HZ,importProperties:(t,n,r,i)=>{const o={layout:{templateId:n.templateId}};r.mapProperties(o);const a={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},s=uZ.colorChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:WZ(e),defaultPropertyValues:a,hypercubePath:i});return s.qProperty.dataPoint&&!1===s.qProperty.dataPoint.show&&delete s.qProperty.dataPoint.show,s},exportProperties:(e,t,n)=>uZ.colorChart.exportProperties({propertyTree:e,hypercubePath:t,viewDataMode:n})}}function XZ(e){return{properties:{version:"1.20.9",color:{auto:!0,autoMinMax:!0,byDimDef:void 0,byMeasureDef:void 0,colorExpression:void 0,dimensionScheme:"12",expressionIsColor:!0,expressionLabel:"",formatting:{numFormatFromTemplate:!0,isCustomFormatted:void 0},measureMin:void 0,measureMax:void 0,measureScheme:"sg",mode:"primary",paletteColor:{index:6},persistent:!1,reverseScheme:!1,singleColor:void 0,useBaseColors:"off",useDimColVal:!0,useMeasureGradient:!0},components:[{key:"slices",style:{strokeWidth:"none",strokeColor:{index:-1,color:_J.STROKE.COLOR},cornerRadius:_J.CORNER_RADIUS,innerRadius:_J.INNER_RADIUS}}],dataPoint:{auto:!0,labelMode:"share",labelValueMode:"arc"},dimensionTitle:!0,donut:{showAsDonut:!1},footnote:"",legend:{dock:"auto",show:!0,showTitle:!0},qHyperCubeDef:{qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:10,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1,qMode:"S"},showDetails:!1,showDisclaimer:!0,showTitles:!0,subtitle:"",title:"",tooltip:{auto:!0,hideBasic:!1,data:{qHyperCubeDef:void 0},chart:void 0,imageComponents:void 0}},data:{targets:[WZ(e)]},importProperties:({exportFormat:t,initialProperties:n,hypercubePath:r})=>{const i=uZ.colorChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:WZ(e),hypercubePath:r});return i.qProperty.dataPoint&&!1===i.qProperty.dataPoint.show&&delete i.qProperty.dataPoint.show,i},exportProperties:({propertyTree:e,hypercubePath:t,viewDataMode:n})=>uZ.colorChart.exportProperties({propertyTree:e,hypercubePath:t,viewDataMode:n})}}return n=>{const{flags:r}=n;!function(e){if(e&&e.get&&e.add){const n="Object.Disclaimer.LimitedData";if(e.get(n)!==n)return;Object.keys(t).forEach((n=>{e.add(t[n])}))}}(n.translator);const i=LU();return{qae:XZ(n),ext:YZ(n),component(){const t=eJ({picasso:i}),n=EJ({flags:r,picasso:i,instance:t});!function({instance:t,services:n,picasso:r,flags:i}){const o=e.useOptions(),a=e.useModel(),s=e.useApp(),l=e.useTranslator(),u=e.useTheme(),c=e.useStaleLayout(),d=e.useSelections(),f=e.useConstraints(),{qLocaleInfo:p}=e.useAppLayout(),[h]=e.usePromise((()=>n?(wJ.attrExpr.updateProperties(a,c),Promise.all([n.colorService.initialize({createConfig:({getUseBaseColors:e})=>({theme:u,legendProps:c.legend,layout:c,localeInfo:p,hc:c.qHyperCube,colorProps:{...c.color,useBaseColors:e(c)}})}),a&&!c.snapshotData?a.getEffectiveProperties():Promise.resolve({}),n.pluginService.initialize()])):Promise.resolve()),[n]);e.useEffect((()=>{null!=t&&t.selectionService&&t.selectionService.setLayout(c)}),[c]),e.useEffect((()=>{if(!t||!h)return;const{chart:e,viewState:m,interactions:g,viewCache:v}=t,{colorService:y,pluginService:b,themeService:x,tooltipService:w}=n,k=o.viewState||{};c.snapshotData||(m.preventSet("legendScrollOffset",k.legendScrollOffset||0),m.preventSet("rotation",k.rotation||0)),function(e,t){e&&e.snapshotData&&e.snapshotData.content&&e.snapshotData.content.chartData&&(t.preventSet("legendScrollOffset",e.snapshotData.content.chartData.legendScrollOffset),t.preventSet("rotation",e.snapshotData.content.chartData.rotation))}(c,m),w.expando.set("properties",h[1]);const C=r.data("q")({key:"qHyperCube",data:c.qHyperCube,config:{localeInfo:p}}),S=[{type:"q",key:"qHyperCube",data:c.qHyperCube,config:{localeInfo:p}},...y.getData()],E={slice:{arc:"qMeasureInfo/0"}};c.qHyperCube.qMeasureInfo.length>1&&(E.slice.outerRadius="qMeasureInfo/1");const M=function(e,t){return t.slice.outerRadius?e.extract({field:"qDimensionInfo/0",props:{num:{field:t.slice.arc},radius:{field:t.slice.outerRadius}}}).filter((e=>e.num.value>0&&"NaN"!==e.radius.value)).length:e.extract({field:"qDimensionInfo/0",props:{num:{field:t.slice.arc}}}).filter((e=>e.num.value>0)).length}(r.data("q")({data:c.qHyperCube,config:{localeInfo:p}}),E),T=d?()=>{const t=e.brush("selection");mv.selections(t,{},c).forEach((e=>{d.select(e)}))}:()=>{},D=c.snapshotData&&!o.freeResize?{width:(c.snapshotData.content.size||c.snapshotData.object.size).w,height:(c.snapshotData.content.size||c.snapshotData.object.size).h}:void 0,_=e=>t.selectionService.getIsSelectionLocked(e),N=()=>aZ({layout:c,context:{rtl:"rtl"===o.direction,theme:u,translator:l,constraints:f,model:a},selectionService:t.selectionService},{picasso:r,ds:C,model:a,app:s,chart:e,onSelect:T,isLocked:_,interactions:g,constraints:f,translator:l,viewState:m,dataRowCount:M,encodings:E,colorService:y,pluginService:b,themeService:x,tooltipService:w,debouncer:zY,properties:h[1],logicalSize:D,flags:i,animations:{enabled:()=>function({viewState:e,options:t,constraints:n,viewCache:r,chart:i}){return!0===t.chartAnimations&&!n.active&&r.get("chartWidth")===i.element.clientWidth&&r.get("chartHeight")===i.element.clientHeight&&r.get("hasZeroLine")===!!i.component("zeroLine")&&0===e.get("rotation")}({viewState:m,options:o,constraints:f,viewCache:v,chart:e})}});t.generateSettings=N;const q=N();e.update({data:S,settings:q}),v.set("chartWidth",e.element.clientWidth),v.set("chartHeight",e.element.clientHeight),v.set("hasZeroLine",q.components.filter((e=>"zeroLine"===e.key)).length>0),o.effect&&c.effectProperties?o.effect.update(c,e,{encodings:E}):c.effectPath||e.brush("highlight").end()}),[t,h,o.direction,o.effectProperties,f,u.name(),l.language()])}({instance:t,services:n,picasso:i,flags:r}),function({instance:t}){const n=e.useStaleLayout(),r=e.useOptions(),i=e.useRect();e.useEffect((()=>{if(!t||!t.generateSettings)return;const{viewCache:e,chart:i,generateSettings:o}=t;i.update({settings:o()}),e.set("chartWidth",i.element.clientWidth),e.set("chartHeight",i.element.clientHeight),r.effect&&r.effect.update(n,i)}),[i.width,i.height])}({instance:t}),sZ({instance:t,services:n})}}}}));
|
|
87
|
+
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,d,f=e.length,p=e.search(/[0-9\-\+#]/),h=p>0?e.substring(0,p):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),v=f-g,y=e.substring(v,v+1),b=v+("."===y||","===y?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(p,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(m="",v=(d=t[0]).length%l,f=d.length,b=0;b<f;b++)m+=d.charAt(b),!((b-v+1)%l)&&b<f-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),h+(n?"-":"")+r+x}}(HX={exports:{}}),HX.exports);function VX(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}var WX={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"},UX=/%$/,$X=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,YX=/^\(oct\)/i,XX=/^\(dec\)/i,KX=/^\(hex\)/i,GX=/^\(bin\)/i,JX=/^\(rom\)/i,ZX=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,QX=/#|0/g;function eK(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 tK(e,t,n){var r=VX(e);return n?r:new RegExp(r||"",t)}function nK(e,t,n){var r,i,o,a,s,l,u,c,d,f,p,h=e.pattern;h.indexOf("A")>=0&&(h=h.replace("A",""),e.abbreviate=!0),f=t,(p=n)&&(p=VX(p)),f&&(f=VX(f)),d=new RegExp("(?:[#0]+".concat(f,")?[#0]+(?:").concat(p,"[#0]+)?")),a=(o=(o=h.match(d))?o[0]:"")?h.substr(0,h.indexOf(o)):h,s=o?h.substring(h.indexOf(o)+o.length):"",o||(o=h?"#":"##########"),t&&t===n&&(i=(r=o.split(n)).pop(),o=r.join("")+n+i,t=""),l=t,t=/,/.test(n)?"¤":",",l&&(o=o.replace(tK(l,"g"),t)),u=n,n=".",u&&(o=o.replace(tK(u,"g"),n)),c=(c=o.match(/#/g))?c.length:0;var m,g=h.split(u);g[1]&&(m=g[1].match(QX)),e.prefix=a||"",e.postfix=s||"",e.pattern=h,e.maxPrecision=m?m.length:2,e.percentage=UX.test(h),e.numericPattern=o||"",e.numericRegex=new RegExp("".concat(tK(t,null,!0),"|").concat(tK(n,null,!0)),"g"),e.groupTemp=l,e.decTemp=u,e.t=t,e.d=n,e.temp=c}var rK=function(){function e(t,n,r,i,o){HY(this,e),this.localeInfo=t,this.pattern=n,this.thousandDelimiter=r||",",this.decimalDelimiter=i||".",this.type=o||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return WX;var n={};return e.qNumericalAbbreviation.split(t).forEach((function(e){var t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(t,this.patternSeparator),this.prepare()}return VY(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}},{key:"prepare",value:function(e,t,n){var r;void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),e?(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],ZX.test(e[0])&&(r.positive.isFunctional=!0),e[1]?ZX.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?ZX.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1,r.positive.isFunctional||nK(r.positive,t,n),r.negative&&!r.negative.isFunctional&&nK(r.negative,t,n),r.zero&&!r.zero.isFunctional&&nK(r.zero,t,n)):this._prepared={pattern:!1}}},{key:"formatValue",value:function(e){var t,n,r,i,o,a,s,l,u,c=this._prepared,d="",f="",p=e;if(isNaN(e))return"".concat(p);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return(c=c.zero).pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=function(e,t,n){var r;return $X.test(t)?e=eK(e,Number(/\d{2}/.exec(t)[0]),t,n):YX.test(t)?e=eK(e,8,t,n):XX.test(t)?e=eK(e,10,t,n):KX.test(t)?e=eK(e,16,t,n):GX.test(t)?e=eK(e,2,t,n):JX.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){for(var n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){var h,m,g=Object.keys(this.abbreviations).map((function(e){return parseInt(e,10)})).sort((function(e,t){return e-t})),v=g[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);v<=n&&s<g.length;)v=g[++s];s>0&&(h=g[s-1]),h&&n>0&&h>0?m=h:(n<0&&h<0||!h)&&(v<0&&v-n<=c.maxPrecision?m=v:h<=n&&!(v>0&&-n<=c.maxPrecision)&&(m=h)),m&&(d=this.abbreviations[m],e/=Math.pow(10,m))}if(r=Math.abs(e),t=c.temp,u=(l=c.numericPattern).split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,u||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{var y=Number(e.toFixed(Math.min(20,u?u.length:0)).split(".")[0]),b=l.split(o)[0];if(e=BX(b+=o,y)||"0",u){var x=Math.max(0,Math.min(14,u.length)),w=u.replace(/#+$/,"").length,k=("I"===this.type?0:r%1).toFixed(x).slice(2).replace(/0+$/,"");for(s=k.length;s<w;s++)k+="0";k&&(e+=o+k)}else 0===y&&(i=0)}else if(r>=Math.pow(10,t)||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),f=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=BX(l,e)}e=e.replace(c.numericRegex,(function(e){return e===a?c.groupTemp:e===o?c.decTemp:""})),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+f+d+c.postfix}}],[{key:"getStaticFormatter",value:function(){return{prepare:function(){},formatValue:function(e){return"".concat(e)}}}}]),e}();function iK(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.size,o=void 0===i?5e3:i,a=r.multipleArguments,s=void 0!==a&&a,l=r.toKey,u=void 0===l?function(e){return e}:l,c=Object.create(null),d=Object.create(null),f=0,p=0;return(t=s?function(){return n=u.apply(void 0,arguments),t.has(n)?t.get(n):t.set(n,e.apply(void 0,arguments))}:function(r){return n=u(r),t.has(n)?t.get(n):t.set(n,e(r))}).set=function(e,t){return f>=o&&(delete c[d[p]],delete d[p],f--,p++),c[e]=t,d[f]=e,f++,t},t.get=function(e){return c[e]},t.has=function(e){return e in c},t.clear=function(){c=Object.create(null),d=Object.create(null),f=0,p=0},t.size=function(){return f},t}function oK(e,t,n,r,i){var o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return KY(rK,t)}(i,e,t,n,r),a=iK(o.formatValue.bind(o),{toKey:function(e){return isNaN(e)?e:+e}});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}var aK=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],sK=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],lK=["January","February","March","April","May","June","July","August","September","October","November","December"],uK=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function cK(e,t){for(var n=e.length;n<t;n++)e="0".concat(e);return e}function dK(e){var t=e.toString().split(".");return t[1]?t=Number("0.".concat(t[1])):0}var fK=function(){function e(t,n,r){HY(this,e);var i,o=t||{};o.qCalendarStrings||(o.qCalendarStrings={qLongDayNames:aK,qDayNames:sK,qLongMonthNames:lK,qMonthNames:uK}),this.localeInfo=o,this.locale_days=o.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=o.qCalendarStrings.qDayNames.slice(),this.locale_months=o.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=o.qCalendarStrings.qMonthNames.slice(),n||(n=(WY(i={},"T",o.qTimeFmt||"hh:mm:ss"),WY(i,"D",o.qDateFmt||"YYYY-MM-DD"),WY(i,"TS",o.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"),i)[r]),this.pattern=n}return VY(e,[{key:"clone",value:function(){var t=new e(this.localeInfo,this.pattern);return t.subtype=this.subtype,t}},{key:"format",value:function(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");var n,r,i,o,a,s=/t+/gi.test(t);e instanceof Date?(i=s,o=(r=e).getUTCHours(),i&&((o%=12)||(o=12)),(a=r.getUTCDay()-1)<0&&(a=6),n={year:r.getUTCFullYear(),month:r.getUTCMonth(),day:a,date:r.getUTCDate(),h:o,m:r.getUTCMinutes(),s:r.getUTCSeconds(),f:r.getUTCMilliseconds(),t:r.getUTCHours()>=12?"pm":"am"}):(e<0&&(e=-e,t="-".concat(t)),n=function(e,t){var n,r=function(e){var t=e,n=24*dK(t),r=60*dK(n),i=60*dK(r),o=1e3*dK(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,u=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(u=n?n.getDay()-1:0)<0&&(u=6);var c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:i,h:o,m:a,s:s,f:l,t:c}}(e,t));var l=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:cK("".concat(t.year).slice(-2),2),YYY:cK("".concat(t.year).slice(-3),3),def:function(e){return cK("".concat(t.year),e.length)}},"M+":{M:t.month+1,MM:cK("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:cK("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:function(e){return cK("".concat(t.date),e.length)}},"h+|H+":{h:t.h,def:function(e){return cK("".concat(t.h),e.length)}},"m+":{m:t.m,def:function(e){return cK("".concat(t.m),e.length)}},"s+|S+":{s:t.s,def:function(e){return cK("".concat(t.s),e.length)}},"f+|F+":{def:function(e){var n="".concat(t.f),r=e.length-n.length;if(r>0)for(var i=0;i<r;i++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def:function(e){var n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n.slice(0,e.length)}}}}(this,n),u=[];for(var c in l)Object.prototype.hasOwnProperty.call(l,c)&&u.push(c);var d=new RegExp(u.join("|"),"g");return t.replace(d,(function(e){var t,n,r;for(n in l)if(Object.prototype.hasOwnProperty.call(l,n)&&(t=new RegExp(n)).test(e))break;if(!t)return"";for(var i in l[n])if(i===e||i.toLowerCase()===e){void 0===(r=l[n][i])&&(r=l[n][i.toLowerCase()]);break}return void 0===r&&(r=l[n].def),"function"==typeof r&&(r=r(e)),r}))}}]),e}();function pK(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return KY(fK,t)}function hK(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}function mK(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=pK(n,e,t),i=iK(r.format.bind(r),{toKey:function(e){return"object"===jY(e)&&"function"==typeof e.getTime?e.getTime():e}});function o(e){return"IV"!==t?hK(e):e}function a(e){return e=o(e),i(e)}return a.format=function(e,t){return i.clear(),t=o(t),r.format(t,e)},a.locale=function(n){return r=pK(n,e,t),i=iK(r.format.bind(r),{toKey:function(e){return"object"===jY(e)?e.getTime():e}}),this},a.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},a}function gK(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return mK(e.qNumFormat.qFmt,e.qNumFormat.qType,t);var n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##A"),o="U"),oK(n,r,i,o,t)}function vK(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.meta,r=t.id,i=t.key,o=t.localeInfo,a=t.fieldExtractor,s=t.value,l=t.type,u=t.sourceField,c=s||("dimension"===l?function(e){return e.qElemNo}:function(e){return e.qValue}),d=function(e){return e.qText||""},f="dimension"===l?"first":"avg",p=gK(n,o),h="dimension"===l?"first":function(e,t){return p(t)},m={id:function(){return r},key:function(){return i},raw:function(){return n},title:function(){return n.qFallbackTitle||n.label},type:function(){return l},origin:function(){return u},items:function(){return e||(e=a(m)),e},min:function(){return n.qMin},max:function(){return n.qMax},value:c,label:d,reduce:f,reduceLabel:h,formatter:function(){return p},tags:function(){return n.qTags}};return m}function yK(e,t,n,r,i){return(t[e]||[]).map((function(t,o){var a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:vK(sX({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=yK("qAttrDimInfo",t,n,a,sX({},i,{value:function(e){return e.qElemNo},type:"dimension"})),s.attrExps=yK("qAttrExprInfo",t,n,a,sX({},i,{value:function(e){return e.qNum},type:"measure"})),s.measures=yK("qMeasureInfo",t,n,a,sX({},i,{value:function(e){return e.qValue},type:"measure"})),s}))}function bK(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.key,o=r.data,a=r.config,s=void 0===a?{}:a,l={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},u=o;if(!u)throw new Error('Missing "data" input');if(!u.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');var c=bK.util,d={cache:l,cube:u,localeInfo:s.localeInfo,fieldExtractor:null,pages:null,hierarchy:function(){return null},virtualFields:s.virtualFields},f={key:function(){return i},raw:function(){return u},field:function(e){return MX(e,d)},fields:function(){return l.fields.slice()},extract:function(e){return d.extractor(e,f,l,c)},hierarchy:function(e){return d.hierarchy(e,f,l,c)},_cache:function(){return l}};"K"===u.qMode||"T"===u.qMode||!u.qMode&&u.qNodesOnDim?(d.extractor=jX,d.hierarchy=FX,d.pages="K"===u.qMode?u.qStackedDataPages:u.qTreeDataPages):"S"===u.qMode?(d.extractor=dX,d.pages=u.qDataPages,d.hierarchy=FX):d.extractor=function(){return[]},d.fieldExtractor=function(e){return d.extractor({field:e},f,l,c)};var p="S"===u.qMode?function(e){return e.qElemNumber}:void 0,h="S"===u.qMode?function(e){return e.qNum}:void 0;(e=l.wrappedFields).push.apply(e,GY(yK("qDimensionInfo",u,i,"",sX({},d,{value:p,type:"dimension"})))),(t=l.wrappedFields).push.apply(t,GY(yK("qMeasureInfo",u,i,"",sX({},d,{value:h,type:"measure"})))),l.fields=l.wrappedFields.map((function(e){return e.instance}));var m=function e(t){t.forEach((function(t){l.allFields.push(t.instance),e(t.measures),e(t.attrDims),e(t.attrExps)}))};return m(l.wrappedFields),(s.virtualFields||[]).forEach((function(e){var t=f.field(e.from),n=vK($Y({meta:t.raw(),id:"".concat(i,"/").concat(e.key),sourceField:t,fieldExtractor:function(e){return d.extractor({field:e},f,l,c)},key:e.key,type:t.type(),localeInfo:d.localeInfo,value:t.value},e.override||{}));l.virtualFields.push(n)})),(n=l.allFields).push.apply(n,GY(l.virtualFields)),f}var xK=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],wK=/\/qDimensionInfo(?:\/(\d+))?/,kK=/\/qMeasureInfo\/(\d+)/,CK=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,SK=/\/qAttrExprInfo\/(\d+)/,EK=/\/?qHyperCube/,MK=/\/?qTreeData/,TK=function(e){return"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14))},DK=function(e){return"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13))};function _K(e,t){var n=e,r=-1,i=-1,o="",a=function(e){return e};EK.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=TK):MK.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=DK);var s=!0;if(wK.test(e)&&(r=+wK.exec(e)[1]),kK.test(e)&&(i=+kK.exec(e)[1]),CK.test(e)){i=-1,r=0;var l=+CK.exec(n)[2];isNaN(l)||(r=l,n=n.replace(/\/\d+$/,"")),s=!1}if(SK.test(e)){var u=i;if(t){i=0;var c=CX(o,t);i+=(c.qMeasureInfo||[]).length,r>-1?(i=c.qDimensionInfo.slice(0,r).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),r=-1):(i=c.qDimensionInfo.reduce((function(e,t){return e+t.qAttrExprInfo.length}),i),i=c.qMeasureInfo.slice(0,u).reduce((function(e,t){return e+t.qAttrExprInfo.length}),i)),i+=+SK.exec(n)[1]}else r>-1?(r=-1,i=+SK.exec(n)[1]):i+=+SK.exec(n)[1]+1}return xK.forEach((function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(e,t)||JY(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,2),r=t[0],i=t[1];n=n.replace(r,i)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}function NK(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=n.byCells,o=n.primarySource,a=[],s={},l=e.isActive(),u=!1;return e.brushes().forEach((function(e){var t=_K(e.id,r);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){var n=e.brush.ranges();n.length&&(u=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((function(e){return 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){var l=e.brush.ranges();l.length&&(u=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),l.forEach((function(e){return 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){var c=e.brush.ranges();c.length&&(u=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),c.forEach((function(e){return 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(i)if(r&&r.qHyperCube&&("P"===r.qHyperCube.qMode||"T"===r.qHyperCube.qMode||"K"===r.qHyperCube.qMode)){var d=r.qHyperCube,f=d.qNoOfLeftDims,p=d.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===o||!o){var h=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));(0===f||p>=f)&&f>-1?h.forEach((function(e){s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:p-f})})):h.forEach((function(e){s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),u=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==o&&(o||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)})),u=!!s.selectHyperCubeCells.values.length);else{var m=e.brush.values().map((function(e){return+e})).filter((function(e){return!isNaN(e)}));u=!!m.length,a.push({params:[t.path,t.dimensionIdx,m,!1],method:"selectHyperCubeValues"})}}})),!u&&l?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&a.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(t=n.orMode)||void 0===t||t]}),s.selectHyperCubeContinuousRange&&a.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&a.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&a.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&a.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),a)}function qK(e){bK.util=e.data("matrix").util,e.data("q",bK),e.formatter("q-number",oK),e.formatter("q-time",mK)}function RK(e){var t=IY(e.layout||{},e.path.split("/").join("."));if(!t)return!1;var n=t.qIsOneAndOnlyOne;return void 0!==n&&n}function PK(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(null==e||!e.length)return!1;var t=e.filter((function(e){return"object"===HU(e.data)&&Array.isArray(e.data.fields)})).every((function(e){return e.data.fields.every((function(e){var t=e.raw();return!(!t.qLocked&&t.qCardinal)}))}));return t}function AK(e){var t=e.brush,n=e.colorField,r=e.legendAlias,i=e.useLegendCube,o=void 0!==i&&i;!n||/qAttrDimInfo/.test(n)?(t.removeKeyAlias("attrDim/qDimensionInfo/0"),r&&t.removeKeyAlias(r),t.addKeyAlias("attrDim/qDimensionInfo/0","qHyperCube/".concat(n))):o&&t.addKeyAlias(r,"qHyperCube/".concat(n))}qK.qBrushHelper=NK,qK.selections=NK;var IK="Shift";function OK(e){var t=e.brush,n=e.getConfig;return{interceptor:function(e){var r=t.brushes(),i=n(),o=i.allowSimultaneous,a=i.layout,s=void 0===a?{}:a;r.forEach((function(n){var r,i,a;("range"===n.type||null!==(r=e[0])&&void 0!==r&&r.key&&(null===(i=e[0])||void 0===i?void 0:i.key)!==n.id&&0!==o.indexOf(null===(a=e[0])||void 0===a?void 0:a.key))&&t.clear([])}));var l=e.filter((function(e){return-2!==e.value}));return l.length>1?function(e){var t=e.layout,n=void 0===t?{}:t,r=e.values,i=void 0===r?[]:r;if(null==i||!i.length)return[];var o=Array.from(new Set(i.map((function(e){return e.key})))),a=[];return o.forEach((function(e){var t=RK({layout:n,path:e}),r=i.filter((function(t){return t.key===e})),o=t?[r.pop()]:r;a.push.apply(a,YU(o))})),a.filter(Boolean)}({layout:s,values:l}):l},rangeInterceptor:function(e){var r=t.brushes(),i=n().allowSimultaneous;return r.filter((function(e){return"value"===e.type})).length?(t.clear([]),e):(r.forEach((function(n){var r=n.id===e[0].key||i.includes(n.id)&&i.includes(e[0].key);"range"!==n.type||r||t.clear([])})),e)}}}var LK=function e(t,n){return n[t]?e(t+1,n):t},zK=function(e,t){var n=t.reduce((function(e,t){return e[t]=!0,e}),{});return e.reduce((function(e,t,r){var i=LK(r,n);return n[i]=!0,e[r]=i,e}),{})};function FK(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.layout,n=e.filtered,r=void 0===n?{}:n,i=(null==t?void 0:t.qHyperCube)||{},o=i.qDimensionInfo,a=void 0===o?[]:o,s=i.qMeasureInfo,l=void 0===s?[]:s;return{dimensions:zK(a,r.dimensions||[]),measures:zK(l,r.measures||[])}}function jK(e){var t=e.selection,n=e.fieldMap,r=t.method,i=t.params;if("selectHyperCubeValues"===r){var o=n.dimensions[i[1]];void 0!==o&&(i[1]=o)}return"rangeSelectHyperCubeValues"===r&&i[1].forEach((function(e){var t=n.measures[e.qMeasureIx];void 0!==t&&(e.qMeasureIx=t)})),"selectHyperCubeContinuousRange"===r&&i[1].forEach((function(e){var t=n.dimensions[e.qDimIx];void 0!==t&&(e.qDimIx=t)})),t}var HK=[],BK=0,VK=function(e){var t=HK.filter((function(e){var t;return null===(t=e.selections)||void 0===t?void 0:t.isActive()}));t.length&&("Enter"===e.key?t.forEach((function(e){return e.selections.confirm()})):"Escape"!==e.key&&"Esc"!==e.key||t.forEach((function(e){return e.selections.cancel()})))},WK=function(){document.addEventListener("keyup",VK)},UK=function(){document.removeEventListener("keyup",VK)},$K=function(e,t){Object.keys(t).forEach((function(n){e.on(n,t[n])}))},YK=function(e,t){Object.keys(t).forEach((function(n){e.removeListener(n,t[n])}))};function XK(e,t,n){if(t&&void 0!==n&&"selectHyperCubeContinuousRange"===e.method){var r=e.params;if(r&&r[1]&&r[1][0]){var i=r[1][0],o=i.qDimIx,a=i.qRange;"undefined"!==o&&a&&!1===a.qMaxInclEq&&a.qMax>=n&&(a.qMaxInclEq=!0)}}}function KK(e){var t=e.chart,n=e.document,r=e.selectionInfo,i=e.eventName,o=e.componentName,a=e.brushName,s=void 0===a?"selection":a,l=e.emit,u=void 0===l?"rangeClear":l,c=r.event===i,d=n.querySelector("[data-key='".concat(o,"-edge-0']"));if(c||!d)return!1;var f=t.component(o);return!!f&&(f.emit(u),"string"==typeof s&&t.brush(s).clear(),f)}function GK(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"discreteRange":i,a=e.componentName,s=void 0===a?"discrete-range-brush":a,l=e.cleared;return KK({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,emit:"areaClear",brushName:e.brushName})}function JK(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"continuousRange":i,a=e.componentName,s=void 0===a?"continuous-range-brush":a,l=e.cleared;return KK({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,brushName:e.brushName})}function ZK(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.componentName,o=void 0===i?"minor-range-brush":i,a=e.eventName,s=void 0===a?"minorRange":a,l=e.cleared,u=void 0!==l&&l,c=e.brushName,d=KK({selectionInfo:t,chart:n,document:r,eventName:u?void 0:s,componentName:o,brushName:void 0!==c&&c});if(d){var f=d.settings.settings,p=f.scale,h=f.brush,m=n.scale(p).data().fields.map((function(e){return e.id()})),g=n.brush(h),v=g.brushes().filter((function(e){return"range"===e.type&&m.some((function(t){return t===e.id}))}));g&&v.length&&v.forEach((function(e){g.removeRanges(e.brush.ranges().map((function(t){return{key:e.id,range:t}})))}))}}function QK(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"xAxis":o,s=e.cleared;KK({selectionInfo:t,chart:n,document:r,eventName:void 0!==s&&s?void 0:a,componentName:"".concat(a,"-range-brush"),emit:"areaClear",brushName:!1})&&i.clear()}function eG(e){var t=e.chart,n=e.selectionInfo,r=e.selections,i=e.events,o=void 0===i?["tap"]:i,a=e.brushNames,s=void 0===a?[]:a;if(n&&o.includes(n.event)){var l=n.currentComponent;n.previousComponent!==l&&(r.clear(),s.forEach((function(e){return t.brush(e).end()})))}}function tG(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"legendRange":o,s=e.componentName,l=void 0===s?"legend-range-brush":s,u=e.cleared,c=void 0!==u&&u,d=e.brushName;KK({selectionInfo:t,chart:n,document:r,eventName:c?void 0:a,componentName:l,brushName:void 0!==d&&d})&&i.clear()}var nG=["chart","document","selections","selectionInfo"],rG=function(e){e.chart,e.document,e.selections,e.selectionInfo;var t=UU(e,nG);t.clearDiscrete(),t.clearContinuous(),t.clearMinor(),t.clearRange(),t.clearTap(),t.clearLegend()};function iG(e){var t,n=e.lasso;null!=n&&null!==(t=n.active)&&void 0!==t&&t.call(n)&&(null==n||n.action(!1))}function oG(e){var t,n=e.chart,r=e.selectionInfo,i=e.selectionActions,o=e.actions,a=void 0===o?{}:o,s=e.selections,l=e.selectionEvents;if(!1===i||!1===l)return function(){};var u=(a||{}).lasso,c=void 0!==u&&u,d=i.reset,f=void 0===d?iG:d,p=i.clear,h=!1!==p&&function(e){var t=e.clear,n=void 0===t?rG:t,r=e.selections,i=e.selectionInfo,o=e.chart;return function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).cleared,t={selections:r,selectionInfo:i,chart:o,document:document,cleared:e};return n(FU({clearDiscrete:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return GK(FU(FU({},t),e))},clearContinuous:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return JK(FU(FU({},t),e))},clearMinor:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ZK(FU(FU({},t),e))},clearRange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return QK(FU(FU({},t),e))},clearTap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return eG(FU(FU({},t),e))},clearLegend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return tG(FU(FU({},t),e))}},t))}}({clear:p,selections:s,selectionInfo:r,chart:n}),m=function(e){var t=e.chart,n=e.lasso,r=e.reset,i=e.clear,o=!1,a={deactivated:function(e){r({e:e,lasso:n})},canceled:function(e){r({e:e,lasso:n}),i({e:e,chart:t,document:document})},cleared:function(e){o||(o=!0,i({e:e,chart:t,document:document,cleared:!0}),o=!1)}};return!1===r&&delete a.deactivated,!1===i&&delete a.cleared,!1===r&&!1===i&&delete a.canceled,a}({chart:n,clear:h,reset:f,lasso:c}),g={};Object.entries(m).forEach((function(e){var t=$U(e,2),n=t[0],r=t[1];g[n]=function(e,t){return t?function(n){return t({event:n,defaultFunc:e})}:e}(r,l[n])}));var v=function(e){var t=e.selectionEvents,n=e.selections,r=e.selectionInfo,i=e.clear,o=e.chart,a=e.document,s=t.start,l={selections:n,selectionInfo:r,chart:o,document:a},u=function(e){return Object.assign(r,e||{})},c=function(e){var t=e.event,n=e.components;return function(){return function(e){var t=e.selectionInfo,n=e.clear,r=e.event,i=e.components,o=void 0===i?[]:i;(0,e.setSelectionInfo)(FU(FU({},void 0===t?{}:t),{},{event:r,components:o.map((function(e){return e.key})).filter(Boolean)})),n()}({event:t,components:n,clear:i,chart:o,selectionInfo:r,setSelectionInfo:u})}};return"function"==typeof s?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];s(FU(FU({defaultFunc:c({event:e,components:t}),setSelectionInfo:u,clear:i},l),{},{event:e,components:t}))}:function(e){c({event:e,components:arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]})()}}({selectionEvents:l,selections:s,selectionInfo:r,clear:h,chart:n,document:document});return null==a||null===(t=a.select)||void 0===t||t.on("start",v),Object.entries(g).forEach((function(e){var t=$U(e,2),n=t[0],r=t[1];null==s||s.on(n,r)})),function(){var e;null==a||null===(e=a.select)||void 0===e||e.removeListener("start",v),Object.entries(g).forEach((function(e){var t=$U(e,2),n=t[0],r=t[1];null==s||s.removeListener(n,r)}))}}var aG=[{key:"qHyperCube/qDimensionInfo/0:numeric",includeMax:!1}];function sG(e){var t=e.chart,n=e.actions,r=e.selections,i=e.picassoQ,o=e.config,a=o.allowSimultaneous,s=void 0!==a&&a,l=o.majorScale,u=void 0===l?void 0:l,c=o.selectionActions,d=(c=void 0===c?{}:c).clear,f=c.reset,p=o.selectionEvents,h=void 0===p?{deactivated:void 0,canceled:void 0,cleared:void 0,start:void 0}:p,m=o.brushEvents,g=void 0===m?{}:m,v=o.brushName,y=void 0===v?"selection":v,b=o.brushMaxListeners,x=void 0===b?20:b,w=o.brushRanges,k=void 0!==w&&w,C=o.interceptors,S=void 0===C?{}:C,E=o.selectionsFn,M=void 0===E?i.selections:E,T=t.brush(y);if("number"==typeof x&&T.setMaxListeners(x),k){var D=!0===k?aG:k;T.configure({ranges:D})}var _={canSelect:!0,getIsSelectionLocked:!1,isInnerDimensionLocked:!1,lockedDimensions:[],singleSelectIndex:0,selectionInfo:{colorField:void 0,components:[],event:void 0,currentComponent:void 0,previousComponent:void 0}},N=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.selections,r=t.brush,i=t.majorScale,o=t.actions,a=t.selectionsFn,s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).path,l=void 0===s?"/qHyperCubeDef":s;if(!n)return{layout:function(){},filteredFields:function(){},allowSimultaneous:function(){},release:function(){}};var u=++BK,c=null,d={dimensions:[],measures:[]},f=[],p={};n.on=n.on.bind(n),n.isActive=n.isActive.bind(n),n.addListener=n.addListener.bind(n),n.removeListener=n.removeListener.bind(n);var h=OK({brush:r,getConfig:function(){return{layout:c,allowSimultaneous:f}}}),m=h.rangeInterceptor,g=h.interceptor;r.intercept("set-ranges",m),r.intercept("toggle-ranges",m),r.intercept("toggle-values",g),r.intercept("set-values",g),r.intercept("add-values",g),r.on("start",(function(){return n.begin(l)}));var v={activate:function(){},deactivated:function(){return r.end()},cleared:function(){return r.clear()},canceled:function(){return r.end()}};$K(n,v);var y=null==i||null===(e=i.max)||void 0===e?void 0:e.call(i);return null!=o&&o.select?(o.select.on("start",(function(){var e;r.start(),"function"==typeof o.select.getBrushOptions&&(p=(e=o.select).getBrushOptions.apply(e,arguments))})),o.select.on("end",(function(){var e=a(r,p,c),t=FK({layout:c,filtered:d});e.forEach((function(e){var r=jK({selection:e,fieldMap:t});XK(r,o.select.brushSelectionIncludeMax,y),n.select(r)}))}))):r.on("update",(function(){var e=a(r,p,c),t=FK({layout:c,filtered:d});e.forEach((function(e){n.select(jK({selection:e,fieldMap:t}))}))})),0===HK.length&&WK(),HK.push({key:u,selections:n}),{layout:function(e){c=e},filteredFields:function(e){d=e},allowSimultaneous:function(e){f=e},release:function(){c=null;var e=HK.indexOf(HK.filter((function(e){return e.key===u}))[0]);-1!==e&&HK.splice(e,1),HK.length||UK(),YK(n,v)}}}({brush:T,majorScale:u,actions:n,selections:r,picassoQ:i,selectionsFn:M});!function(e){var t=e.brush,n=e.interceptors,r=void 0===n?{}:n;Object.entries(r).forEach((function(e){var n=$U(e,2),r=n[0],i=n[1];(Array.isArray(i)?i:[i]).forEach((function(e){t.intercept(r,e)}))}))}({brush:T,interceptors:S});var q=function(e){var t=e.chart,n=e.selectionActions,r=e.brush,i=e.actions,o=e.selectionInfo,a=e.selections,s=e.selectionEvents,l=function(e){var t=e.brush,n=e.chart,r=e.selectionInfo,i=e.brushEvents,o=void 0===i?{}:i,a=Object.entries(o).map((function(e){var i=$U(e,2),o=i[0],a=i[1],s=function(){return a({chart:n,selectionInfo:r})};return t.on(o,s),[o,s]}));return function(){a.forEach((function(e){var n=$U(e,2),r=n[0],i=n[1];t.removeListener(r,i)}))}}({brush:r,chart:t,selectionInfo:o,brushEvents:e.brushEvents}),u=oG({chart:t,selectionInfo:o,selectionActions:n,actions:i,selections:a,selectionEvents:s}),c=function(e){var t=e.actions;if(null==t||!t.lasso)return function(){};var n=!1,r=function(e){n||e.key!==IK||(t.lasso.action(!0),n=!0)},i=function(e){e.key===IK&&(t.lasso.action(!1),n=!1)};return document.addEventListener("keydown",r),document.addEventListener("keyup",i),function(){document.removeEventListener("keydown",r),document.removeEventListener("keyup",i)}}({actions:i});return function(){l(),u(),c()}}({chart:t,brush:T,actions:n,selections:r,selectionInfo:_.selectionInfo,selectionActions:{clear:d,reset:f},selectionEvents:h,brushEvents:g});if(s){var R=!0===s?YU(Array(15)).map((function(e,t){return"qHyperCube/qMeasureInfo/".concat(t)})):s;N.allowSimultaneous(R)}return{unbindEvents:q,state:_,picassoSelections:N,brush:T}}var lG=["colorField","useLegendCube"];function uG(e){var t=e.chart,n=e.selections,r=e.actions,i=void 0!==r&&r,o=e.config,a=void 0===o?{}:o,s=sG({chart:t,actions:i,selections:n,picassoQ:qK,config:a}),l=s.unbindEvents,u=s.state,c=s.picassoSelections,d=s.brush,f=a.custom,p=void 0===f?{}:f,h=a.legendAlias,m=void 0===h?void 0:h,g=a.setBrushAliases,v=void 0===g?AK:g;return{getIsDimensionLocked:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return u.lockedDimensions[e]},getIsSelectionLocked:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return null!==(e=null==n||null===(t=n.isLocked)||void 0===t?void 0:t.call(n))&&void 0!==e?e:PK(r)},getIsSingleSelect:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.singleSelectIndex;return u.singleSelectDimensions[e]},getCanSelect:function(){return u.canSelect},getSelectionInfo:function(){return u.selectionInfo},setLayout:function(e){var t=function(e){var t,n,r,i=e.selections,o=e.picassoSelections,a=e.layout,s={lockedDimensions:[],singleSelectDimensions:[]};null!=i&&null!==(t=i.isModal)&&void 0!==t&&t.call(i)&&i.confirm(),o.layout(a);var l=(null!==(n=null==a?void 0:a.qHyperCube)&&void 0!==n?n:{}).qDimensionInfo,u=void 0===l?[]:l;return s.lockedDimensions=u.map((function(e){return!!e.qLocked})),s.singleSelectDimensions=u.map((function(e,t){return RK({layout:a,path:"qHyperCube/qDimensionInfo/".concat(t)})})),s.singleSelectIndex=function(e){var t,n=((null==e?void 0:e.qHyperCube)||{}).qDimensionInfo,r=void 0===n?[]:n;return null!==(t=r.map((function(e,t){var n;return!(e.qLocked||(null===(n=e.qCardinalities)||void 0===n?void 0:n.qHypercubeCardinal)<=1)&&t})).filter((function(e){return"number"==typeof e}))[0])&&void 0!==t?t:Math.max(r.length-1,0)}(a),s.canSelect=0===u.length||u.some((function(e){return!e.qLocked})),s.dimensionLocked=!(null===(r=u[0])||void 0===r||!r.qLocked),s}({selections:n,picassoSelections:c,layout:e});Object.assign(u,t)},setFilteredFields:function(e){c.filteredFields(e)},setBrushAliases:function(e){var t=e.colorField,n=e.useLegendCube,r=void 0!==n&&n,i=UU(e,lG),o=FU({useLegendCube:r,colorField:t,brush:d,legendAlias:m},i);v(FU(FU({},o),{},{defaultFunc:function(){return AK(o)}}))},destroy:function(){l(),c.release()},custom:FU({},p)}}var cG="'Source Sans Pro', 'Arial', 'sans-serif'",dG="#595959",fG="#737373",pG="#cccccc",hG="#e6e6e6";function mG(e){var t={};return[].concat(YU(e),YU([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",dG],["object","axis.label.name","fontFamily",cG],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",pG],["object","axis.line.minor","color",hG],["object","axis.title","color"],["object","axis.title","fontFamily",cG],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",hG],["object","grid.line.major","color",pG],["object","grid.line.minor","color",hG],["object","label.value","color",dG],["object","label.value","fontFamily",cG],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",dG],[!1,"label.value","lightColor",hG],["object","outOfRange","color","#999"],["object","referenceLine.label.name","color","#333333"],["object","referenceLine.label.name","fontFamily",cG],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",hG],["object","referenceLine.outOfBounds","fontFamily",cG],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",fG,function(e){return"transparent"===e?fG:e}]])).reduce((function(e,n){var r="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[r]||(t[r]=!0,e.push(n)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var gG=function(e){return e};function vG(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,a={},s=r.reduce((function(e,t){var n=$U(t,2),r=n[0],i=n[1];return e[r]=i,e}),{});return o.forEach((function(e){var r=$U(e,5),i=r[0],o=r[1],l=r[2],u=r[3],c=r[4],d=void 0===c?function(e){return e}:c,f=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,a=void 0===o?void 0:o;if(!t||!1===n)return a;var s=t.getStyle(n,r,i);return void 0===s?a:s}({theme:t,base:"object"===i&&n?"".concat("object",".").concat(n):i,path:o,attribute:l,defaultValue:u}),p=(s["".concat(o,".").concat(l)]||gG)(d(f));OY(a,[o,l].filter(Boolean).join("."),p)})),i.forEach((function(e){var t=$U(e,2),n=t[0],r=t[1];OY(a,n,r)})),a}var yG={NOOP:function(){},FALSE:function(){return!1},ARRAY:function(){return[]},OBJECT:function(){return{}}},bG="chart-modules-tooltip",xG="#".concat(bG);function wG(){if(!document.querySelector(xG)){var e=document.createElement("div");e.id=bG,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 kG(e){return{show:!0,key:e.key,type:"tooltip",layout:{displayOrder:3},beforeMount:function(){wG()},beforeUpdate:function(){wG()},destroyed:function(){var e;null!=(e=document.querySelector(xG))&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)},settings:{appendTo:function(){return document.querySelector(xG)},direction:e.rtl?"rtl":"ltr",duration:e.duration},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:"'Source Sans Pro', 'Arial', 'sans-serif'","empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}var CG="position",SG={bar:"rect",diamond:"path",point:"circle",square:"rect",triangle:"path","n-polygon":"path",slice:"path"},EG=function(e){return e.data.value},MG=function(e){var t,n=e.data;return null==n||null===(t=n.major)||void 0===t?void 0:t.value};function TG(e){var t=e.chart,n=e.expando,r=e.nodes,i=e.collectConfig,o=e.collectibles,a=e.meta,s=i.from,l={chart:t,expando:n,nodes:r,collectConfig:i,collectibles:o,meta:a};switch("function"==typeof s?"custom":s){case"single":return function(e){var t=$U(e.nodes,1)[0];return["container"===t.type&&t.children[0]||t]}(l);case"position":return function(e){var t=e.collectibles,n=e.meta;return e.chart.shapesAt(n.position.absolute,{components:t.map((function(e){return{key:e.key}}))})}(l);case"dimension":return function(e){var t=e.chart,n=e.collectConfig,r=e.collectibles,i=$U(e.nodes,1)[0],o=n.filter,a="function"==typeof o?o:function(){return!0},s=n.by,l=void 0===s?EG:s;return r.reduce((function(e,n){var r=n.major,o=void 0===r?MG:r,a=SG[n.type]||n.type;return e.push.apply(e,YU(t.findShapes(a).filter((function(e){return e.key===n.key&&e.data&&o({data:e.data})===l({data:i.data})})))),e}),[]).filter(a)}(l);case"radius":return function(e){var t=e.chart,n=e.collectConfig,r=e.collectibles,i=e.meta,o=$U(e.nodes,1)[0].localBounds,a=n.distance,s=n.filter,l="function"==typeof s?s:function(){return!0},u=r.map((function(e){return e.key}));return t.shapesAt({cx:i.position.absolute.x,cy:i.position.absolute.y,r:a||Math.max(o.width,o.height)},{components:u.map((function(e){return{key:e}}))}).filter(l)}(l);case"custom":return function(e){var t=e.chart,n=e.expando,r=e.nodes,i=e.meta;return e.collectConfig.from({chart:t,expando:n,nodes:r,meta:i})}(l);default:return[]}}var DG=Number.MAX_VALUE;function _G(e){var t=e.nodes.reduce((function(e,t){var n=t.bounds;return e.xMin=Math.min(e.xMin,n.x,n.x+n.width),e.yMin=Math.min(e.yMin,n.y,n.y+n.height),e.xMax=Math.max(e.xMax,n.x,n.x+n.width),e.yMax=Math.max(e.yMax,n.y,n.y+n.height),e}),{xMin:DG,xMax:-DG,yMin:DG,yMax:-DG}),n=t.xMin,r=t.xMax,i=t.yMin;return{x:n,y:i,width:r-n,height:t.yMax-i}}function NG(e){var t=e.chart,n=e.config,r=e.expando,i=e.placementConfig,o=e.hovered,a=e.collected,s=e.meta,l=function(e){for(var t=e.chart,n=e.config,r=e.expando,i=e.placementConfig,o=e.hovered,a=e.collected,s=e.meta,l=$U(o,1)[0],u=Array.isArray(i)?i:[i],c={bounds:l.bounds,key:l.key},d=_G({nodes:a}),f=0;f<u.length;f++){var p=u[f];if("function"==typeof p){var h=p({chart:t,expando:r,hovered:o,collected:YU(a),meta:s,collectedBounds:d,combineBounds:_G});if(h)return h}if("trigger"===p)return c;if("collectible"===p){var m=n.main.placements.collectible;return{bounds:"function"==typeof m?m({collected:YU(a)}):d,key:a[0].key}}}return c}({chart:t,config:n,expando:r,placementConfig:i,hovered:o,collected:a,meta:s}),u=l.bounds,c=l.key,d=$U(a,1)[0].desc;return[{bounds:u,nodes:a,data:a.map((function(e){return e.data})),key:c,meta:s,desc:d}]}function qG(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.nodes;if(!o.length)return[];var a=$U(o,1)[0].key,s=n.main.collectibles;if(!s.length)return[];var l=n.main.triggers.find((function(e){return-1!==e.keys.indexOf(a)}))||{},u=l.collect,c=l.placement;if(!u||!u.from||!c)return[];var d={triggerer:a,position:i.get(CG)},f=(TG({chart:t,expando:r,nodes:o,collectConfig:u,collectibles:s,meta:d})||[]).map((function(e){return e.children.length?e.children[0]:e}));return f.length?NG({chart:t,config:n,expando:r,placementConfig:c,hovered:o,collected:f,meta:d}):[]}var RG=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),PG=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),AG=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),IG=function(e){return RG.test(e)},OG=function(e){return PG.test(e)||AG.test(e)};function LG(e){for(var t=e?e.length:0,n=0;n<t;n++){var r=e[n];if(IG(r))return"ltr";if(OG(r))return"rtl"}return"ltr"}function zG(e){var t=e.visibility;return{type:"divider",content:[{content:"",style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:2}],visibility:FU(FU({},{count:!1}),t)}}function FG(e){var t=e.config,n=e.h,r=e.context,i=e.nodes,o=e.property,a=e.filter,s=e.visibility,l=t.rtl,u={type:"color",label:void 0,value:void 0,content:[],filter:a,visibility:FU(FU({},{count:!0}),s)},c=t.getColorSettings();if("color"===c.type||!c.fieldType)return u;var d=$U(i,1)[0];if(u.value=function(e){var t=e.config,n=e.context,r=e.property,i=e.node,o=i.data[r];if(o){if(-3===i.data.value)return i.data.label;var a=n.resources.dataset(o.source.key).field(o.source.field).formatter(),s=o.value,l=o.label,u=t.getColorSettings();if(a&&"measure"===u.fieldType)return Number.isNaN(+s)?"-":a(o.value);var c=l||s;return void 0===c||Number.isNaN(c)||"NaN"===c?"-":c}}({config:t,context:r,property:o,node:d}),void 0===u.value)return u;u.label=function(e){var t=e.context,n=e.property,r=e.node,i=e.config.getColorSettings();if(i.label)return i.label;var o=r.data[n];if(o&&"color"!==i.type){var a=t.resources.dataset,s=o.source,l=s.key,u=s.field;return a(l).field(u).title()}}({config:t,context:r,property:o,node:d});var f=n("div",{style:{display:"inline-block",width:10,height:10,"background-color":function(e){var t=e.node.attrs;return(null==t?void 0:t.fill)||"#ddd"}({node:d}),margin:"0 8px"}});return u.content.push({content:l?[":",u.label]:[u.label,":"],style:{"text-align":l?"right":"left",direction:LG(u.label)}},{content:l?[u.value,f]:[f,u.value],style:{"text-align":l?"left":"right","vertical-align":"middle",direction:LG(u.value)}}),u}function jG(e){var t=e.config,n=e.h,r=e.context;return{section:function(e){return function(e){return{type:"section",content:e.content}}({content:e.content})},text:function(e){var n=e.value,r=e.style,i=e.visibility;return function(e){var t=e.config,n=e.value,r=e.style,i=(r=void 0===r?{}:r).bold,o=void 0!==i&&i,a=r.italic,s=e.visibility;return{type:"text",content:[{content:n,style:{"font-weight":o?"bold":"normal","font-style":void 0!==a&&a?"italic":"normal","text-align":t.rtl?"right":"left",direction:LG(n)},colspan:2}],visibility:FU(FU({},{count:!0}),s)}}({config:t,value:n,style:r,visibility:i})},measure:function(e){var r=e.label,i=e.value,o=e.color,a=e.style,s=e.survive,l=e.visibility;return function(e){var t,n,r,i,o=e.h,a=e.label,s=e.value,l=e.color,u=e.style,c=e.survive,d=e.visibility,f=e.config.rtl,p=o("div",{style:{display:"inline-block",width:10,height:10,"background-color":l,margin:"0 8px"}});return{type:"measure",label:a,value:s,content:[{content:f?[":",a]:[a,":"],style:{"text-align":f?"right":"left","font-weight":null!=u&&null!==(t=u.label)&&void 0!==t&&t.bold?"bold":"normal","font-style":null!=u&&null!==(n=u.label)&&void 0!==n&&n.italic?"italic":"normal",direction:LG(a)}},{content:l?f?[s,p]:[p,s]:s,style:{"text-align":f?"left":"right","vertical-align":"middle","font-weight":null!=u&&null!==(r=u.value)&&void 0!==r&&r.bold?"bold":"normal","font-style":null!=u&&null!==(i=u.value)&&void 0!==i&&i.italic?"italic":"normal",direction:LG(s)}}],survive:FU(FU({},{color:!1,duplicate:!1}),c),visibility:FU(FU({},{count:!0}),d)}}({config:t,h:n,label:r,value:i,color:o,style:a,survive:s,visibility:l})},divider:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.visibility;return zG({visibility:t})},row:function(e){return function(e){var t=e.visibility;return{type:"row",content:[{content:e.content,style:e.style,colspan:e.colspan}],visibility:FU(FU({},{count:!0}),t)}}({content:e.content,style:e.style,colspan:e.colspan,visibility:e.visibility})},raw:function(e){return function(e){var t=e.visibility;return{type:"raw",content:e.value,visibility:FU(FU({},{count:!0}),t)}}({value:e.value,visibility:e.visibility})},color:function(e){var i=e.nodes,o=e.property,a=e.filter,s=void 0===a||a,l=e.visibility;return FG({config:t,h:n,context:r,nodes:i,property:o,filter:s,visibility:l})}}}function HG(e){var t=e.chart,n=e.translator,r=e.config,i=e.expando,o=e.h,a=e.data,s=e.style,l=$U(a,1)[0],u=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.h,o=e.context,a=e.groups,s=o.node.meta,l=o.resources,u=l.dataset,c=l.formatter,d=jG({config:n,h:i,context:o}),f=function(e){var t=e.dataset;return{dataset:{title:function(e,n){return t(e).field(n).title()}}}}({dataset:u}),p=a.map((function(e){var t=d.section({content:YU((n.main.section({expando:r,h:i,nodes:e,dataset:u,formatter:c,meta:s,create:d,util:f})||[]).filter((function(e){var t;return null===(t=e.content)||void 0===t?void 0:t.length}))).filter(Boolean)});return t.content=function(e){var t=e.config,n=e.content,r=n.find((function(e){return"color"===e.type&&e.filter})),i=r?n.filter((function(e){return"measure"!==e.type||e.survive.color||e.label!==r.label||e.value!==r.value})):n;return t.main.showDuplicateMeasures?i:i.reduce((function(e,t){var n=t.type,r=t.survive;if("measure"!==n||r.duplicate)return e.filtered.push(t),e;var i="".concat(t.label,"-").concat(t.value);return e.memory[i]||(e.memory[i]=!0,e.filtered.push(t)),e}),{memory:{},filtered:[]}).filtered}({config:n,content:t.content}),t}));return n.main.sections({chart:t,expando:r,h:i,nodes:o.node.nodes,dataset:u,formatter:c,meta:s,create:d,util:f,sections:p}),p.filter(Boolean)}({chart:t,config:r,expando:i,h:o,context:l,groups:function(e){var t=e.config,n=e.nodes.reduce((function(e,n){var r=t.main.getGroupByValue({data:n.data});return e[r]||(e[r]={sorting:Object.keys(e).length,items:[]}),e[r].items.push(n),e}),{});return Object.keys(n).map((function(e){return n[e]})).sort((function(e,t){return e.sorting-t.sorting})).map((function(e){return e.items}))}({config:r,nodes:l.node.nodes})}),c=function(e){var t=e.translator,n=e.config,r=e.context,i=e.templates,o=n.main.layout,a=o.rows,s=o.grouping,l=o.single,u=function(e){var t=e.limit,n=e.grouping,r=e.single,i={count:0,overflow:0,index:{started:void 0,group:void 0}};return{process:function(e){var o=e.visibility,a=e.index;if(r&&0!==a)return n?(i.index.started!==a&&i.index.group!==a&&(i.overflow++,i.index.group=a),!1):(i.overflow++,!1);if(i.count>=t){if(!n)return i.overflow++,!1;if(i.index.started!==a)return i.index.group!==a&&(i.overflow++,i.index.group=a),!1}return o.count&&i.count++,n&&(i.index.started=a),!0},overflow:function(){return i.overflow}}}({limit:a,grouping:s,single:"function"==typeof l?l({meta:r.node.meta,sections:i}):l}),c=i.reduce((function(e,t,n){var r=t.type,o=t.content;"section"===r&&(void 0===o?[]:o).forEach((function(t){u.process({visibility:t.visibility,index:n})&&e.push(t.content)}));var a=n===i.length-1;return"divider"!==r||a||u.process({visibility:t.visibility,index:n})&&e.push(t.content),e}),[]).filter((function(e){return e.length})),d=u.overflow();return d&&c.push(function(e){var t=e.translator,n=e.config,r=e.count,i=t?t.get("Object.ChartTooltip.NMore",r):"+".concat(r," more"),o=LG(i);return[{content:i,style:{"font-weight":"bold","text-align":n.rtl?"right":"left",direction:o},colspan:2}]}({translator:t,config:n,count:d})),c}({translator:n,config:r,h:o,context:l,templates:u});return c.length?function(e){var t=e.h,n=e.style;return e.rows.map((function(e){return t("tr",{},e.map((function(e){var r={style:FU(FU({},n.cell||{}),e.style||{}),class:e.class};return e.colspan&&(r.colspan=e.colspan),t("td",r,e.content)})))}))}({h:o,style:s,rows:c}):function(e){var t=e.h;return t("tr",{},t("td",{style:{fontStyle:"italic",opacity:.75}},"Empty"))}({h:o})}function BG(e){var t=e.chart,n=e.translator,r=e.config,i=e.expando,o=e.internal;if(!r.main.key)return!1;var a=LY(),s=kG({key:r.main.key,rtl:r.rtl,duration:r.duration}),l=r.main.events.tooltip,u=l.afterShow,c=l.afterHide,d=function(){var e=a.get("collected");return{expando:i,nodes:e.nodes,meta:e.meta}};return i$(!0,s,{settings:{filter:function(e){return qG({chart:t,config:r,expando:i,internal:o,nodes:e})},extract:function(e){return a.set("collected",e.node),e},content:function(e){var o=e.h,a=e.data,s=e.style;return HG({chart:t,translator:n,config:r,expando:i,h:o,data:a,style:s})},placement:function(e){var t=e.nodes;return r.main.placement({meta:t[0].meta})},afterShow:function(){return u(d())},afterHide:function(){return c(d())}},style:{arrow:{color:r.style.background},content:r.style}})}function VG(e){var t=e.config,n=t.legend.keys;if(!n.tooltip||!n.component)return!1;if("categorical"!==t.getColorSettings().type)return!1;var r=kG({key:n.tooltip,rtl:t.rtl,duration:t.duration});return i$(!0,r,{settings:{filter:function(e){return e.filter((function(e){return e.data&&e.key===n.component}))},extract:function(e){return e},content:function(e){var t=e.h,n=e.data;return[t("tr",{},[t("td",{style:FU(FU({},e.style.cell||{}),{"font-weight":"bold","text-align":"left"}),colspan:2},n[0].node.data.label)])]},placement:"pointer"},style:{arrow:{color:t.style.background},content:t.style}})}function WG(e){var t=e.config.main.triggers.reduce((function(e,t){return t.keys.forEach((function(n){var r=t.distance||0;e.distance[n]=r,e.distances.includes(r)||e.distances.push(r),e.key[n]=!0,e.keys[r]||(e.keys[r]=[]),e.keys[r].push(n)})),e}),{distance:{},distances:[],key:{},keys:{}});return function(e){return e.components.filter((function(e){return t.key[e.key]})).reduce((function(e,n){e.any=!0,e.components.push(n.key);var r=t.distance[n.key];return 0===r?e.position.push(n.key):(e.distances.includes(r)||(e.distances.push(r),e.distanceKeys[r]=[]),e.distanceKeys[r].push(n.key)),e}),{any:!1,components:[],position:[],distances:[],distanceKeys:{}})}}function UG(e){var t=e.chart,n=e.event,r=e.component,i={absolute:{x:0,y:0},relative:{x:0,y:0}},o=t.element.getBoundingClientRect(),a=o.left,s=o.top;i.absolute.x=(void 0===n.clientX?Math.floor(n.srcEvent.clientX):n.clientX)-a,i.absolute.y=(void 0===n.clientY?Math.floor(n.srcEvent.clientY):n.clientY)-s;var l=t.component(r);if(l){var u=l.rect.computedInner;i.relative.x=i.absolute.x-u.x,i.relative.y=i.absolute.y-u.y}return i}function $G(e){var t=e.chart,n=e.hits,r=e.position,i=[];if(n.position.length&&i.push.apply(i,YU(t.shapesAt(r.absolute,{components:n.position.map((function(e){return{key:e}}))}))),!i.length&&n.distances.length){var o=[];n.distances.forEach((function(e){o.push.apply(o,YU(t.shapesAt({cx:r.absolute.x,cy:r.absolute.y,r:e},{components:n.distanceKeys[e].map((function(e){return{key:e}}))})))})),o.length&&i.push(function(e){var t=e.nodes,n=e.origin,r=t.find((function(e){return"path"===e.type}));if(r)return r;var i=function(e){var t=Math.abs(n.x-(e.localBounds.x+e.localBounds.width/2)),r=Math.abs(n.y-(e.localBounds.y+e.localBounds.height/2));return Math.sqrt(t*t+r*r)};return t.slice(1).reduce((function(e,t){var n=i(t);return n<e.distance&&(e.distance=n,e.node=t),e}),{node:t[0],distance:i(t[0])}).node}({nodes:o,origin:r.relative}))}return i}function YG(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.facade,a=n.delay.tap,s=WG({config:n}),l=n.main.triggers.reduce((function(e,t){return e.push.apply(e,YU(t.keys)),e}),[]);return{key:"event:".concat("tooltipTap"),type:"Tap",options:{event:"tooltipTap",enable:function(e,r){return!r||!!n.enable({event:r})&&t.componentsFromPoint({x:r.center.x,y:r.center.y}).filter((function(e){return-1!==l.indexOf(e.key)})).length>0}},recognizeWith:"tap",events:WU({},"tooltipTap",(function(e){if(e.preventDefault(),"mouse"!==e.pointerType&&!n.main.suppress({event:e})){var l=t.component(n.main.key);if(l&&l.show){var u=t.componentsFromPoint({x:e.center.x,y:e.center.y}),c=s({components:u});if(c.any){var d=$U(c.components,1)[0],f=UG({chart:t,event:e,component:d});i.set(CG,f);var p=$G({chart:t,hits:c,position:f});if(p.length){var h=p[0].key;n.main.events.tooltip.beforeShow({expando:r,event:e,collectNodes:function(){return o.collectNodes({nodes:p})},meta:{triggerer:h,position:f}}).then((function(){l.emit("show",e,{nodes:p,delay:a})})).catch((function(){}))}else l.emit("hide")}else l.emit("hide")}}}))}}function XG(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.facade,a=WG({config:n}),s=function(e){var t=e.config,n=e.expando,r=e.internal,i=e.facade,o=t.main.events.tooltip.beforeShow,a=t.delay.hover,s={ongoing:{},latest:void 0};return function(e){var t=e.event,l=e.tooltip,u=e.nodes,c=function(e){var t=e.nodes;return JSON.stringify(t.map((function(e){return{key:e.key,bounds:e.bounds,value:e.data.value}})))}({nodes:u});if(!s.ongoing[c]){s.ongoing[c]=!0,s.latest=c;var d=u[0].key;o({expando:n,event:t,collectNodes:function(){return i.collectNodes({nodes:u})},meta:{triggerer:d,position:r.get(CG)}}).then((function(){c===s.latest&&l.emit("show",t,{nodes:u,delay:a})})).catch((function(){l.emit("show")})).finally((function(){delete s.ongoing[c],c===s.latest&&(s.latest=void 0)}))}}}({config:n,expando:r,internal:i,facade:o}),l=[n.main.key,n.legend.keys.tooltip].filter(Boolean),u=function(){l.forEach((function(e){var n=t.component(e);null!=n&&n.show&&n.emit("hide")}))};return{type:"native",events:{mousemove:function(e){if(n.enable({event:e})&&!n.main.suppress({event:e})){var r=t.componentsFromPoint({x:e.clientX,y:e.clientY}),o=t.component(n.main.key);if(o&&o.show){var l=a({components:r});if(l.any){var u=$U(l.components,1)[0],c=UG({chart:t,event:e,component:u});i.set(CG,c);var d=$G({chart:t,hits:l,position:c});if(!d.length)return void o.emit("hide");s({event:e,tooltip:o,nodes:d})}else o.emit("hide")}var f=n.legend;if(f.keys.tooltip&&f.keys.component){var p=t.component(f.keys.tooltip);p&&p.show&&(r.some((function(e){return e.key===f.keys.component}))?p.emit("show",e):p.emit("hide"))}}},mouseup:function(e){2===e.button&&u()},mouseleave:function(){n.main.events.interaction.mouseleave({expando:r}),u()},wheel:function(){u()}}}}function KG(e){var t=e.chart,n=e.translator,r=function(e){var t=e.config;return i$(!0,{},{rtl:!1,enable:yG.FALSE,getColorSettings:yG.OBJECT,style:{fontSize:void 0,fontFamily:void 0,color:void 0,background:void 0},delay:{hover:500,tap:0},duration:8e3,main:{key:void 0,suppress:yG.FALSE,getGroupByValue:yG.NOOP,collectibles:[],triggers:[],placement:function(){return{type:"bounds"}},placements:{collectible:"combine"},showDuplicateMeasures:!1,layout:{rows:7,grouping:!1,single:!1},section:yG.ARRAY,sections:yG.NOOP,events:{tooltip:{beforeShow:function(){return Promise.resolve()},afterShow:yG.NOOP,afterHide:yG.NOOP},interaction:{mouseleave:yG.NOOP}}},legend:{keys:{tooltip:void 0,component:void 0}}},void 0===t?{}:t)}({config:e.config}),i=LY(),o=LY(),a={components:void 0,interactions:void 0};return{getComponents:function(){return a.components||(a.components=function(e){var t=e.config;return[BG({chart:e.chart,translator:e.translator,config:t,expando:e.expando,internal:e.internal}),VG({config:t})].filter(Boolean)}({chart:t,translator:n,config:r,expando:i,internal:o})),a.components},getInteractions:function(){return a.interactions||(a.interactions=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal;return{collectNodes:function(e){var o=e.nodes,a=$U(qG({chart:t,config:n,expando:r,internal:i,nodes:o}),1)[0];return(a=void 0===a?{nodes:[]}:a).nodes}}}({chart:t,config:n,expando:r,internal:i});return{gestures:[YG({chart:t,config:n,expando:r,internal:i,facade:o})],native:XG({chart:t,config:n,expando:r,internal:i,facade:o})}}({chart:t,config:r,expando:i,internal:o})),a.interactions},expando:i}}var GG={};function JG(){JG.init.call(this)}GG.isObject=function(e){return"object"==typeof e&&null!==e},GG.isNumber=function(e){return"number"==typeof e},GG.isUndefined=function(e){return void 0===e},GG.isFunction=function(e){return"function"==typeof e};var ZG=JG;JG.EventEmitter=JG,JG.prototype._events=void 0,JG.prototype._maxListeners=void 0,JG.defaultMaxListeners=10,JG.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},JG.prototype.setMaxListeners=function(e){if(!GG.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},JG.prototype.emit=function(e){var t,n,r,i,o,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],GG.isUndefined(n))return!1;if(GG.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(GG.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(a=n.slice()).length,o=0;o<r;o++)a[o].apply(this,i)}return!0},JG.prototype.addListener=function(e,t){var n;if(!GG.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,GG.isFunction(t.listener)?t.listener:t),this._events[e]?GG.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,GG.isObject(this._events[e])&&!this._events[e].warned)&&((n=GG.isUndefined(this._maxListeners)?JG.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,GG.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),GG.isFunction(console.trace)&&console.trace()));return this},JG.prototype.on=JG.prototype.addListener,JG.prototype.once=function(e,t){if(!GG.isFunction(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},JG.prototype.removeListener=function(e,t){var n,r,i,o;if(!GG.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||GG.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(GG.isObject(n)){for(o=i;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},JG.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],GG.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},JG.prototype.listeners=function(e){return this._events&&this._events[e]?GG.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},JG.listenerCount=function(e,t){return e._events&&e._events[t]?GG.isFunction(e._events[t])?1:e._events[t].length:0};function QG(){const e={};var t;return t=e,Object.keys(ZG.prototype).forEach((e=>{t[e]=ZG.prototype[e]})),ZG.init(t),e.lasso={active:()=>!1},e.select={on:e.on,removeListener:e.removeListener},e}function eJ({picasso:t}){var n;const r=e.useOptions(),i=e.useElement(),o=e.useSelections(),[a,s]=e.useState(),l=QG(),u=e.useLayout(),c=e.useTranslator(),d=!(null===(n=u.qSelectionInfo)||void 0===n||!n.qInSelections),[f,p]=e.useState(!1);return l.lasso=function({layout:e,isInSelections:t,isLassoActionActive:n,setIsLassoActionActive:r,translator:i}){var o,a,s;return{active:n,label:i.get(n?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),hidden:!t||!(null===(o=e.qHyperCube)||void 0===o||null===(a=o.qDimensionInfo)||void 0===a||null===(s=a[0])||void 0===s||!s.qIsOneAndOnlyOne),action(e){r("boolean"==typeof e?e:!n)},icon:{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"}}]}}}({layout:u,isInSelections:d,isLassoActionActive:f,setIsLassoActionActive:p,translator:c}),e.useAction((()=>(a&&(a.interactions.lasso.active=()=>f),{...l.lasso})),[a,f,d,c.language()]),e.useEffect((()=>{i.style.overflow="hidden";const e=t({renderer:{prio:[r.renderer||"canvas"]}}),n=e.chart({element:i,data:[],settings:{}}),a=uG({chart:n,actions:l,selections:o,config:{selectionActions:!1}});a.setLayout(u),a.setBrushAliases({colorField:"qDimensionInfo/0/qAttrDimInfo/0"});const c=function(e){var t=FU({},e),n={},r={},i=!1,o={get:function(e){return t[e]},set:function(e,o){var a=t[e];!i&&n[e]?t[e]=n[e](o,a):t[e]=o,!i&&r[e]&&r[e](t[e],a)},preventSet:function(e,t){i=!0,o.set(e,t),i=!1},intercept:function(e,t){n[e]=t},onChanged:function(e,t){r[e]=t}};return o}({legendScrollOffset:0,rotation:0});c.intercept("rotation",(e=>(c.get("rotation")+e)%(2*Math.PI))),c.onChanged("rotation",(()=>{n.update({partialData:!0})}));const d=LY();return l.on("selections-start",(()=>{n.brush("selection").start()})),s({picasso:e,chart:n,selectionService:a,viewState:c,viewCache:d,interactions:l}),()=>{a.destroy(),n.destroy(),l.removeAllListeners(),delete l.select,c.intercept("rotation",void 0),c.onChanged("rotation",void 0)}}),[]),a}const tJ={CUSTOM:{EXPRESSION:"customTooltipExpression",TITLE:"customTooltipTitle",DESCRIPTION:"customTooltipDescription",QUARANTINE:"customTooltip",IMAGES:"customTooltipImages"},CHART:{CONTAINER_ID:"tooltipContainerId",STATE:"customTooltipSessionState",CHART_OBJECT_ID:"customTooltipSessionObjectId",CHART_PARENT_TYPE:"TooltipChartParent",CHART_CHILD_TYPE:"TooltipChart",STYLE:{small:"140px",medium:"200px",large:"340px"}}};function nJ(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const rJ={getImageSize(e,t){let n;function r(){n&&(clearTimeout(n),n=null)}function i(e){const t=e;t.onload=null,t.onerror=null,r()}const o={small:50,medium:200,large:340,original:340};return new Promise((a=>{const s=new Image;s.referrerPolicy="no-referrer",s.onload=()=>{let e;const{height:n,width:l}=s,u=o[t]*(n>l?1:n/l),c=o[t]*(l>n?1:l/n);!n||!l||0===n&&0===l?(e={height:20,width:20,imageError:!0},i(s)):"original"===t?(e={height:Math.min(u,n),width:Math.min(c,l)},r()):(e={height:u,width:c},r()),a(e)},s.onerror=()=>{i(s),a({height:20,width:20,imageError:!0})},s.src=e,n=setTimeout((()=>{i(s),a({height:20,width:20,imageError:!0})}),3e3)}))}};async function iJ(e,t,n){let r=e.ref.qStaticContentUrl.qUrl;const i=function(e){var t,n,r,i,o;let a,s,l,u,c,d;if(e&&(null!==(t=e.session)&&void 0!==t&&t.options||null!==(n=e.enigmaModel)&&void 0!==n&&null!==(r=n.session)&&void 0!==r&&r.sessionConfig||null!==(i=e.session)&&void 0!==i&&null!==(o=i.config)&&void 0!==o&&o.url)){var f;if(a=e.session.options||(null===(f=e.enigmaModel)||void 0===f?void 0:f.session.sessionConfig),!a){var p;a=null===(p=e.session)||void 0===p?void 0:p.config;const t=new URL(a.url);a.host=t.hostname,a.port=t.port,a.isSecure="wss:"===t.protocol}return d=void 0!==a.secure?a.secure:a.isSecure,s=d?"https://":"http://",l=a.host||"localhost",u=a.port?":"+a.port:"",c=a.prefix?a.prefix:"/","/"!==c[c.length-1]&&(c+="/"),s+l+u+c}return""}(n);i&&(!function(e,t){const n=e.replace(t,"").replace(/^\.\.\//i,"/");n[0]}(r,i),r=r.replace(/"/g,'\\"'),r=r.replace(/'/g,"\\'"),r=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(r,i));const{height:o,width:a,imageError:s}=await rJ.getImageSize(r,t);return{src:r,size:t,height:o,width:a,imageError:s}}async function oJ(e,t,n,r){var i,o,a,s,l,u;const{app:c,flags:d}=t,f=null===(i=e.layout)||void 0===i||null===(o=i.tooltip)||void 0===o?void 0:o.imageComponents;if(!f)return[];const[p]=f,h=p.size||"small",m=p.type||"media";let g=-1;for(let e=0;e<n.length;e++)if(n[e].cId===p.cId){g=e;break}const v=(null===(a=r.data)||void 0===a||null===(s=a.customTooltipAttrExps)||void 0===s?void 0:s.value)||[];let y;if(-1!==g&&v[g]&&(y=v[g]),"media"===m&&null!==(l=p.ref)&&void 0!==l&&null!==(u=l.qStaticContentUrl)&&void 0!==u&&u.qUrl)return iJ(p,h,c);if("url"===m)return async function(e,t,n,r,i){let o,a=n.ref;if(i&&i.label&&(a=i.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&null!=e&&e.getImage&&nJ(a))try{const t="data:image/png;base64, "+await e.getImage(a),{height:n,width:i,imageError:s}=await rJ.getImageSize(t,r);o={src:t,size:r,height:n,width:i,imageError:s}}catch(e){}else{const{height:e,width:t,imageError:n}=await rJ.getImageSize(a,r);o={src:a,size:r,height:e,width:t,imageError:n}}return o}(c,d,p,h,y);if(d.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===m&&y&&y.label){return async function(e,t,n,r){let i;const o=r.label,a=`qmem://${t.qFallbackTitle}/${o}`;if(nJ(a))try{const t=await e.getImage(a);if(t){const e="data:image/png;base64, "+t,{height:r,width:o,imageError:a}=await rJ.getImageSize(e,n);i={src:e,size:n,height:r,width:o,imageError:a}}}catch(e){}return i}(c,n[g],h,y)}return[]}const aJ={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){const i=t,o=[];for(let t=0;t<i.length;t++)o.push(oJ(e,r,n,i[t]));const a=await Promise.all(o);for(let e=0;e<i.length;e++)i[e].data.customTooltipImages=[a[e]];return i},checkIfPromisesExist({customTooltipModel:e}){var t,n;const r=null===(t=e.layout)||void 0===t||null===(n=t.tooltip)||void 0===n?void 0:n.imageComponents;return!!r&&r.length>0}},sJ={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){let i=t;return i=await aJ.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}),i},checkIfPromisesExist:({customTooltipModel:e})=>aJ.checkIfPromisesExist({customTooltipModel:e})};const lJ=(e,t)=>{var n,r,i;const o=null==e||null===(n=e.qHyperCubeDef)||void 0===n?void 0:n.qDimensions,a=null==e||null===(r=e.qHyperCubeDef)||void 0===r?void 0:r.qMeasures,s=null==e||null===(i=e.qHyperCubeDef)||void 0===i?void 0:i.qInterColumnSortOrder,l=t;return{qInfo:{qType:tJ.CHART.CHART_PARENT_TYPE,qId:tJ.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:o,qMeasures:a,qInterColumnSortOrder:s,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:l}},uJ=e=>{var t,n,r;const i=null===(t=e.tooltip)||void 0===t||null===(n=t.chart)||void 0===n||null===(r=n.object)||void 0===r?void 0:r.refId;return{qInfo:{qType:tJ.CHART.CHART_CHILD_TYPE},qExtendsId:i}};const cJ={createContainer:({ctx:e,layout:t})=>{var n,r;if(!((null===(n=t.qHyperCube)||void 0===n||null===(r=n.qDimensionInfo)||void 0===r?void 0:r.length)<=0))return function(e,t){var n,r,i,o;const a=null!==(n=null===(r=t.tooltip)||void 0===r||null===(i=r.chart)||void 0===i||null===(o=i.style)||void 0===o?void 0:o.size)&&void 0!==n?n:"medium",s=tJ.CHART.STYLE[a];return[{content:[e.h("div",{style:{display:"flex",width:s,height:s,backgroundColor:"#FFFFFF",borderRadius:"5px",padding:"2px",color:"#595959"},colspan:2,id:tJ.CHART.CONTAINER_ID})],colspan:2,style:{"text-align":e.rtl?"right":"left","max-width":s,width:"100%"}},{}]}(e,t)},show:async({app:e,properties:t,selectedNodes:n,dimIndex:r,customTooltipModel:i,rtl:o})=>{var a,s,l;const u=i,c=null==t||null===(a=t.tooltip)||void 0===a||null===(s=a.chart)||void 0===s||null===(l=s.object)||void 0===l?void 0:l.refId;if(null!=u&&u.embed&&e.removeSessionAlternateState&&e.addSessionAlternateState&&c&&!(t.qHyperCubeDef.qDimensions.length<=0)){await cJ.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:n}){const r=n,i=tJ.CHART.STATE,o=t.qStateName;r.miniChartToken.alternateState||(r.miniChartToken.alternateState=i,await e.addSessionAlternateState(i,o),r.miniChartToken.alternateState=i)}({app:e,properties:t,customTooltipModel:i});const a=await async function({app:e,properties:t,customTooltipModel:n}){var r;const i=n;null!==(r=i.miniChartToken.sessionObj)&&void 0!==r&&r.id&&await e.destroySessionObject(i.miniChartToken.sessionObj.id);const o=tJ.CHART.STATE,a=lJ(t,o),s=await e.createSessionObject(a),l=uJ(t);if(s.id!==tJ.CHART.CHART_OBJECT_ID)return void e.destroySessionObject(s.id);i.miniChartToken.sessionObj=s;const u=await s.createChild(l);if(i.miniChartToken.sessionObj&&i.miniChartToken.sessionObj.id===s.id)return i.miniChartToken.model=u,u;e.destroySessionObject(s.id)}({app:e,properties:t,customTooltipModel:i});if(u.miniChartToken.alternateState&&u.miniChartToken.sessionObj&&a){var d,f,p,h;const e=n.length>0&&void 0!==(null===(d=n[0].data)||void 0===d?void 0:d.value)?[null===(f=n[0].data)||void 0===f?void 0:f.value]:[],a=void 0!==r?r:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===r&&n.length>0){var m,g;const e=null!==(m=n[0].data.selectionOuterDimension)&&void 0!==m?m:n[0].data.selectionDimension;if(null!=e&&null!==(g=e.source)&&void 0!==g&&g.field){var v;const t=null==e||null===(v=e.source)||void 0===v?void 0:v.field.split("/"),n=t[t.length-1],r=void 0!==e.value?[e.value]:[];r.length>0&&void 0!==n&&u.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(n),r,!1)}}e.length>0&&u.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",a,e,!1);const s=document.getElementById(tJ.CHART.CONTAINER_ID),l={direction:o?"rtl":"ltr",isReadonly:!0,isPopover:!0,navigation:!1,selections:!1};u.miniChartToken.vis=await i.embed.render({element:s,model:u.miniChartToken.model,options:l,id:null===(p=u.miniChartToken.model)||void 0===p?void 0:p.id,type:null===(h=u.miniChartToken.model)||void 0===h?void 0:h.genericType})}}catch(t){await cJ.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;null!=n&&n.embed&&(cJ.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(tJ.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,r=tJ.CHART.STATE;await e.removeSessionAlternateState(r),n.miniChartToken.alternateState=void 0}({app:e,customTooltipModel:t}))},destroyVisualization:({customTooltipModel:e})=>{var t,n;const r=e;"function"==typeof(null===(t=r.miniChartToken)||void 0===t||null===(n=t.vis)||void 0===n?void 0:n.destroy)&&(r.miniChartToken.vis.destroy(),r.miniChartToken.vis=void 0)}};function dJ(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function fJ(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:r}=tJ.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[n]=!0,i[r]=!0,i}function pJ(e){const t=fJ();return e.filter((e=>t[e.id]))}const hJ={getNodes(e,t){const n=function(e,t){let n=0,r=0;e.center?(n+=e.center.x,r+=e.center.y):(n+=e.clientX,r+=e.clientY);const i=t.element.getBoundingClientRect();return{cx:n-i.left,cy:r-i.top}}(e,t);return t.shapesAt({x:n.cx,y:n.cy})},getDataNodes(e,t){let n,r=[];const i={container:{bar:!0,"bullet-axis":!0},circle:{"point-component":!0}};return t.forEach((t=>{var o,a,s,l;const u=null!==(o=null===(a=t.data)||void 0===a?void 0:a.selectionDimension)&&void 0!==o?o:t.data;if(!u||null!==(s=t.data)&&void 0!==s&&s.customTooltipAttrExps||i[t.type]){if(null!==(l=t.data)&&void 0!==l&&l.customTooltipAttrExps&&!t.data.customTooltipImages){const e=t;e.data.customTooltipImages=[],r.push(e)}}else{n||(n=[],Object.keys(i).forEach((t=>{n=n.concat(e.findShapes(t).filter((e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&i[t][e.key])))})));const t=n.filter((e=>{var t,n;const r=null!==(t=null!==(n=e.data.stack)&&void 0!==n?n:e.data.selectionOuterDimension)&&void 0!==t?t:e.data.selectionDimension;return r&&r.value===u.value&&r.label===u.label}));t.length>0&&(r=r.concat(t[0]))}})),r},displayTooltip(e,t,{nodes:n,opts:r={},customTooltipModel:i,extractedNodes:o=[],hide:a}){if(i&&!a){const{layout:a,chart:s}=i,{attrExps:l}=hJ.getAttrExprData(a);o.length||n.length?sJ.handlePromises({customTooltipModel:i,nodes:hJ.getDataNodes(s,o.length>0?o:n),attrExps:l,opts:r}).then((()=>{t.emit("show",e,n.length?{nodes:n}:void 0)})):t.emit("show",e,n.length?{nodes:n}:void 0)}else{var s;null!=i&&null!==(s=i.miniChartToken)&&void 0!==s&&s.alternateState&&cJ.hide({app:r.app,customTooltipModel:i}),t.emit("hide")}},checkIfPromisesExist:({customTooltipModel:e})=>sJ.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){var n;const r=t,i=null!==(n=e.qHyperCubeDef)&&void 0!==n&&n.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return r[i]||(r[i]=[]),r[i]},getAttrExprData(e){var t;let n=[],r="";const i=(null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[];if(i.length>0){var o,a,s;const t=i.length-1;n=(null===(o=e.qHyperCube)||void 0===o||null===(a=o.qDimensionInfo)||void 0===a||null===(s=a[t])||void 0===s?void 0:s.qAttrExprInfo)||[],r=`qDimensionInfo/${t}/qAttrExprInfo`}return{attrExps:n,fieldPath:r}},quarantineCustomTooltipAttrs(e,t={}){var n,r;if(!(null===(n=e.qLayoutExclude)||void 0===n||null===(r=n.quarantine)||void 0===r?void 0:r[tJ.CUSTOM.QUARANTINE])){!function(e,t){const n=t;let r=n.qLayoutExclude;r||(n.qLayoutExclude={quarantine:{}},r=n.qLayoutExclude),r.quarantine||(r.quarantine={}),r.quarantine[tJ.CUSTOM.QUARANTINE]=[],e.forEach((e=>{r.quarantine[tJ.CUSTOM.QUARANTINE].push(e)})),n.qLayoutExclude=r}(pJ(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){var t,n;const r=e;(null===(t=e.qLayoutExclude)||void 0===t||null===(n=t.quarantine)||void 0===n?void 0:n[tJ.CUSTOM.QUARANTINE])&&delete r.qLayoutExclude.quarantine[tJ.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=dJ(e);if(!n)return;const r=void 0!==t?t:n.length-1;if(!n[r])return;const i=this.getAttrExps(e,n[r]);if(0===pJ(i).length){var o,a;const t=(null===(o=e.qLayoutExclude)||void 0===o||null===(a=o.quarantine)||void 0===a?void 0:a.customTooltip)||[],n=[...i,...t],s=e;s.qHyperCubeDef?s.qHyperCubeDef.qDimensions[r].qAttributeExpressions=n:s.qHyperCube.qDimensionInfo[r].qAttrExprInfo=n}},moveCustomTooltipAttrs(e,t={},n){let r=[];const i=dJ(e)||[];[...i,t].forEach((e=>{const t=pJ(e.qAttributeExpressions||[]);t.length>0&&(r=t)}));const o=fJ(),a=i.map((e=>{const t=e,n=e.qAttributeExpressions||[];return t.qAttributeExpressions=n.filter((e=>!o[e.id])),t})),s=void 0!==n?n:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(r));const l=e;e.qHyperCubeDef?l.qHyperCubeDef.qDimensions=a:l.qHyperCube.qDimensionInfo=a},addCallbackCustomTooltip(e){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e):(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},moveCallbackCustomTooltip(e,t){1===e.qHyperCubeDef.qDimensions.length&&(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e)),e.qHyperCubeDef.qDimensions.length>1&&this.moveCustomTooltipAttrs(e,t)},removeCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>0?this.moveCustomTooltipAttrs(e,t):this.quarantineCustomTooltipAttrs(e,t)},replaceCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e,t):(this.quarantineCustomTooltipAttrs(e,t),this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},shouldIgnoreDefaultRows(e){var t;return(null===(t=e.tooltip)||void 0===t?void 0:t.hideBasic)||0},DEBOUNCE_THRESHOLD:50,getFooterRow:(e,t)=>[{content:e,style:{"font-style":"italic","font-size":"12px","line-height":"16px",color:"rgba(255, 255, 255, 0.6)","text-align":t?"right":"left",direction:Hv.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=Hv.detectTextDirection(e.src),r=[],i={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){r.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const n=e.imageError?`${e.src}?${Math.random()}`:e.src;r.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:n,referrerpolicy:"no-referrer"})),i.style["text-align"]="center",i.style["white-space"]="nowrap"}else i.style["background-size"]="contain",i.style["background-repeat"]="no-repeat",i.style["background-position"]="center",i.style["background-image"]=`url('${e.src}')`;return[{content:[t.h("div",i,r),""],style:{"text-align":t.rtl?"right":"left",direction:n,"max-width":e.width},colspan:2},{}]}};function mJ(e,t,n,r){var i,o,a;const s=(null===(i=t.qHyperCube)||void 0===i||null===(o=i[n])||void 0===o||null===(a=o[r])||void 0===a?void 0:a.qAttrExprInfo)||[],l=[],u=e.qSubNodes&&e.qSubNodes[r]?e.qSubNodes[r].qAttrExps:e.qAttrExps;return u?(s.forEach(((e,t)=>{const i=u.qValues&&u.qValues[t]?u.qValues[t]:void 0,o=void 0===i?"NaN":function(e,t){let n;switch(e.id){case tJ.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case tJ.CUSTOM.TITLE:case tJ.CUSTOM.DESCRIPTION:case tJ.CUSTOM.IMAGES:n=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:n="NaN"}return n}(e,i);l.push({source:{key:"qHyperCube",field:`${n}/${r}/qAttrExprInfo/${t}`},label:o,value:"value"})})),l):l}const gJ={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,r="qDimensionInfo";return{field:`${r}/${n}`,value:t=>mJ(t,e,r,n)}}};const vJ={getCustomAttrExps(e,t,n){var r,i;const o={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},a=(null===(r=t.data)||void 0===r||null===(i=r.customTooltipAttrExps)||void 0===i?void 0:i.value)||[];if(Number.isNaN(a))return o;return function(e,t,n,r){const i={[tJ.CUSTOM.TITLE]:!0,[tJ.CUSTOM.DESCRIPTION]:!0},{attrExps:o,fieldPath:a}=hJ.getAttrExprData(e);return 0===t.length||0===o.length||""===a||o.forEach(((e,o)=>{const s=t[o];if(e.id===tJ.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,i="NaN"===s.value||e.isCustomFormatted?s.value:n("qHyperCube").field(`${a}/${o}`).formatter()(s.value);r.customTooltipAttrExpsArr.push({label:t,value:i})}else if(i[e.id]&&s){const t="-"!==s.value&&"NaN"!==s.value?s.value:s.label;t&&"undefined"!==t&&r.customTooltipInfoAttrExpsArr.push({...e.id===tJ.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}})),r}(n,a.map((t=>Bv.getMeasure(e,t))),e,o)}};function yJ({nodes:e,layout:t,dataset:n}){return function(e,t,n){const r=[];return e.forEach((e=>{r.push(vJ.getCustomAttrExps(n,e,t))})),r}(e,t,n).reduce(((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)})),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}function bJ(e){const t=tJ.CUSTOM.EXPRESSION,{qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}=e.qDef;return e.qLibraryId?{qLibraryId:e.qLibraryId,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}:{qExpression:e.qDef.qDef,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}}function xJ(e){var t;const n=null===(t=e.qHyperCubeDef)||void 0===t?void 0:t.qDimensions;return n[n.length-1].qAttributeExpressions||[]}var wJ={attrExpr:{migrateProperties(e){var t,n,r,i;const o=Dv(!0,{},e),a=(null===(t=o.tooltip)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.qHyperCubeDef)||void 0===r?void 0:r.qMeasures)||[];let s=xJ(o);return s=function(e,t){return t.concat(e.map((e=>bJ(e))))}(a,s),function(e,t){var n;const r=null===(n=t.qHyperCubeDef)||void 0===n?void 0:n.qDimensions;r[r.length-1].qAttributeExpressions=e}(s,o),null===(i=o.tooltip)||void 0===i||delete i.data,o},getPatches(e){var t,n,r,i;const o=(null===(t=e.tooltip)||void 0===t||null===(n=t.data)||void 0===n||null===(r=n.qHyperCubeDef)||void 0===r?void 0:r.qMeasures)||[],a=(null===(i=e.qHyperCubeDef)||void 0===i?void 0:i.qDimensions.length)-1;return function(e,t,n){let r=e.length;const i=[];return t.forEach((e=>{const t=bJ(e),o=JSON.stringify(t);i.push({qPath:`/qHyperCubeDef/qDimensions/${n}/qAttributeExpressions/${r}`,qOp:"add",qValue:o}),r++})),i.push({qPath:"/tooltip/data",qOp:"remove"}),i}(xJ(e),o,a)},checkForBackwardCompatibility:(e,t)=>(e.qMeasureInfo||[]).length>0&&t.length>0,updateProperties(e,t){return new Promise((n=>{var r,i,o,a,s;const l=(null===(r=t.qHyperCube)||void 0===r?void 0:r.qDimensionInfo)||[],u=(null===(i=t.tooltip)||void 0===i||null===(o=i.data)||void 0===o?void 0:o.qHyperCube)||{},c=null===(a=t.qMeta)||void 0===a||null===(s=a.privileges)||void 0===s?void 0:s.includes("update");e&&e.getEffectiveProperties&&this.checkForBackwardCompatibility(u,l)&&e.getEffectiveProperties().then((t=>{if(c){const r=this.migrateProperties(t);e.setProperties(r).then((()=>{e.app.clearUndoBuffer(),n(!0)}))}else{const r=this.getPatches(t);e.applyPatches(r,!0).then((()=>{e.app.clearUndoBuffer(),n(!0)}))}})),n(!1)}))}}};const{CUSTOM:kJ}=tJ;function CJ({flags:e,layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l,options:u}){var c,d,f;const p=function({layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:hJ,miniChartToken:{},embed:s}}({layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l}),h="rtl"===u.direction,m=!(!t.tooltip||t.tooltip.auto),g=m&&IY(t,"tooltip.hideBasic",!1),v=!!(m&&null!==(c=t.tooltip)&&void 0!==c&&null!==(d=c.chart)&&void 0!==d&&null!==(f=d.object)&&void 0!==f&&f.refId&&l&&"function"==typeof(null==r?void 0:r.getEffectiveProperties));return{isEnabled:()=>m,hideBasic:()=>g,getAttributes:({dataset:e,nodes:n})=>{var r,i;const o=yJ({dataset:e,nodes:n,layout:t});return{title:null===(r=o.customTooltipInfoAttrExpsArr.find((e=>e.id===kJ.TITLE)))||void 0===r?void 0:r.title,description:null===(i=o.customTooltipInfoAttrExpsArr.find((e=>e.id===kJ.DESCRIPTION)))||void 0===i?void 0:i.value,measures:o.customTooltipAttrExpsArr}},hasImages:()=>hJ.checkIfPromisesExist({customTooltipModel:p}),createImageRow:({value:e,h:t})=>hJ.getImageRow(e,{h:t,rtl:h}),addImages:({nodes:r})=>{const i=hJ.getDataNodes(o,r),a=hJ.getAttrExprData(t);return sJ.handlePromises({customTooltipModel:p,nodes:i,attrExps:a,opts:{flags:e,app:n}})},chart:{isEnabled:()=>v,hasLimitation:()=>{var e;return!(null==n||null===(e=n.isInModalSelection)||void 0===e||!e.call(n))},createContainer:({h:e})=>cJ.createContainer({layout:t,ctx:{h:e,rtl:h}}),createLimitationRow:()=>hJ.getFooterRow(a.get("properties.tooltip.notselectedmessage"),h),show:({nodes:e,properties:t})=>cJ.show({app:n,properties:t,selectedNodes:e,customTooltipModel:p,rtl:h}),hasAlternateState:()=>{var e;return!(null===(e=p.miniChartToken)||void 0===e||!e.alternateState)},hide:()=>cJ.hide({app:n,customTooltipModel:p}),destroy:()=>cJ.destroyVisualization({customTooltipModel:p})}}}function SJ(e){return{layout:e,keys:{SCALE:{FILL:"fill"},COMPONENT:{DIMENSION_TITLE:"dimension-title",SLICES:"slices",PIE_LABELS:"pie-labels"}}}}function EJ({flags:t,picasso:n,instance:r}){const i=e.useModel(),o=e.useApp(),a=e.useTranslator(),s=e.useElement(),[l,u]=e.useState(),c=e.useStaleLayout(),d=e.usePlugins(),f=e.useConstraints(),p=e.useOptions(),h=e.useTheme(),{qLocaleInfo:m}=e.useAppLayout(),g=e.useEmbed();return e.useEffect((()=>{if(!r)return;s.style.overflow="hidden";const e=function(e){var t,n,r,i,o=e.picasso,a=e.model,s=e.app,l=e.translator,u=e.layoutService,c=void 0===u?void 0:u,d=e.createConfig,f=void 0===d?AY:d,p=e.config,h=void 0===p?{}:p,m=e.custom,g=void 0===m?{}:m,v=h.localeInfo,y=h.key,b=h.theme,x=void 0===b?void 0:b,w=h.auto,k=void 0===w?void 0:w,C=h.definitionPath,S=null==c||null===(t=c.getLayout)||void 0===t?void 0:t.call(c),E={theme:x,key:y,localeInfo:v,layout:S,hc:null==c||null===(n=c.getHyperCube)||void 0===n?void 0:n.call(c),legendProps:null==c||null===(r=c.getLayoutValue)||void 0===r?void 0:r.call(c,"legend"),colorProps:FU(FU({},null==c||null===(i=c.getLayoutValue)||void 0===i?void 0:i.call(c,"color")),{},{useBaseColors:S?NY(S):void 0})},M=DY({picasso:o,model:a,app:s,translator:l,auto:k});!1!==k&&M.auto((function(e){return k?k({layout:e,defaultAuto:PY}):PY(e)}));var T=!1;return{getColor:function(){return M.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return M.resolveUIColor({index:t,color:n})},getData:function(){return M.data()},getDatumProps:function(e){return M.datumProps(e)},getSnapshotData:function(){return M.getSnapshotData(C)},getSettingsForMeasure:function(e){return M.settingsForMeasure(e)},getSettings:function(){return M.settings()},getLegend:function(e,t){return M.legend(e,t)},getScales:function(){return M.scales()},getPalettes:function(){return M.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return M.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return T},custom:FU({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?f:e)({getUseBaseColors:NY}),n=qY(E,t);return M.config(n),M.getAuxiliarySettings(C).then((function(){T=!0}))}}}({picasso:r.picasso,model:i,app:o,translator:a,config:{auto:!1,key:"fill"}}),l=function(e){var t=e.picassoInstance,n=e.plugins,r=e.pluginArgs,i=void 0===r?{}:r,o={initialized:!1,definitions:[]};return{initialize:function(){return VU(jU().mark((function e(){var r,a,s,l;return jU().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o.initialized){e.next=2;break}return e.abrupt("return");case 2:return a=Promise.all(n.filter((function(e){return"custom-component"===e.info.type})).map(function(){var e=VU(jU().mark((function e(n){var r;return jU().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.info.componentName){e.next=2;break}throw new Error("plugin-service: Custom component is missing componentName");case 2:return e.next=4,n.fn(FU({},i));case 4:if("object"===HU(r=e.sent)){e.next=7;break}throw new Error("plugin-service: Custom component needs to be an object");case 7:t.component(n.info.componentName,r);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())),s=Promise.all(n.filter((function(e){return"component-definition"===e.info.type})).map((function(e){return e.fn(FU({},i))}))),e.next=6,Promise.all([a,s]);case 6:l=e.sent,o.initialized=!0,(r=o.definitions).push.apply(r,YU(l[1]));case 9:case"end":return e.stop()}}),e)})))()},extendComponents:function(e){return o.initialized?(o.definitions.filter(Boolean).forEach((function(t){var n=$U(e.filter((function(e){return e.key&&e.key===t.key})),1)[0];if(n){var r=i$(!0,{},n.brush);i$(!0,n,t),t.brush&&(n.brush=function(e,t){return"object"===HU(e)&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=FY({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=FY({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(r,t.brush))}else e.push(t)})),e):e}}}({picassoInstance:r.picasso,plugins:d,pluginArgs:SJ(c)}),v=CJ({flags:t,layout:c,app:o,model:i,picasso:n,chart:r.chart,translator:a,localeInfo:m,embed:g,options:p}),y=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,a=void 0===o?[]:o,s=r.transform,l=void 0===s?[]:s,u=r.extend,c=void 0===u?[]:u,d={theme:t,matrix:mG(a),styles:void 0};return d.styles=vG({theme:t,id:i,transform:l,extend:c,matrix:d.matrix}),{getStyles:function(){return d.styles},getTheme:function(){return d.theme},setTheme:function(e){d.theme=e,d.styles=vG({theme:e,id:i,transform:l,extend:c,matrix:d.matrix})}}}({theme:h,config:{id:"pieChart",resolve:[["object","label.name","color","#595959"],["object","label.name","fontFamily"],["object","label.name","fontSize","12px"]]}}),b=function({chart:e,translator:t,layout:n,constraints:r,options:i,themeService:o,colorService:a,custom:s}){const l=n.qHyperCube.qMeasureInfo.length>1,u="rtl"===i.direction,{fontFamily:c}=o.getStyles();return KG({chart:e,translator:t,config:{rtl:u,enable:()=>!r.passive,getColorSettings:()=>a.getSettings(),style:{fontFamily:c},main:{key:"tooltip",getGroupByValue:({data:e})=>e.value,collectibles:[{key:"slices",type:"slice",major:({data:e})=>e.value}],triggers:[{keys:["slices"],collect:{from:"single"},placement:"collectible"},{keys:["pie-labels","negative-indicators"],collect:{from:"dimension",by:({data:e})=>e.value},placement:"trigger"}],placement:({meta:e})=>({type:"slices"===e.triggerer?"slice":"bounds"}),section:({h:e,nodes:n,dataset:r,formatter:i,create:o,util:a})=>{const[u]=n,{title:c,description:d,measures:f}=s.isEnabled()?s.getAttributes({dataset:r,nodes:n}):{},p=[];c&&p.push(o.text({value:c,style:{bold:!0}})),d&&p.push(o.text({value:d}));const h=s.hideBasic();if(h&&!f.length&&(c||d)||p.push(o.text({value:u.data.label,style:{bold:!0}})),!h){p.push(o.color({nodes:n,property:"fill"}));const{num:e}=u.data;if(p.push(o.measure({label:a.dataset.title(e.source.key,e.source.field),value:e.label})),l){const{radius:e}=u.data;p.push(o.measure({label:a.dataset.title(e.source.key,e.source.field),value:e.label}))}p.push(o.measure({label:t?t.get("properties.dataPoints.labelmode.share"):"Share",value:i("share")(u.desc.share)}))}f&&p.push(...f.map((e=>o.measure({label:e.label,value:e.value,survive:{color:!0,duplicate:!0}})))),s.chart.isEnabled()&&(s.chart.hasLimitation()?(s.chart.destroy(),p.push(o.raw({value:s.chart.createLimitationRow()}))):p.push(o.raw({value:s.chart.createContainer({h:e})})));const{customTooltipImages:m}=u.data;return s.isEnabled()&&m&&p.push(...m.map((t=>o.raw({value:s.createImageRow({value:t,h:e})})))),p},layout:{grouping:!0},events:{tooltip:{beforeShow:({collectNodes:e})=>s.isEnabled()&&s.hasImages()?s.addImages({nodes:e()}):Promise.resolve(),afterShow:({expando:e,nodes:t})=>{s.chart.isEnabled()&&!s.chart.hasLimitation()&&s.chart.show({nodes:t,properties:e.get("properties")})}},interaction:{mouseleave:()=>{s.chart.isEnabled()&&s.chart.hasAlternateState()&&s.chart.hide()}}}},legend:{keys:{tooltip:"legend-color-cat",component:"legend-cat"}}}})}({app:o,chart:r.chart,translator:a,layout:c,constraints:f,options:p,themeService:y,colorService:e,custom:v});u({colorService:e,pluginService:l,themeService:y,tooltipService:b})}),[i,o,r,c,a.language(),f,p.direction,h.name()]),l}function MJ({scaleKey:e,legend:t,onEdited:n}){const{layout:r}=t,{dock:i}=r||{};return{type:"brush-range",key:"legendRangeBrush",layout:{dock:"@legend-seq"},on:n?{bubbleEnd(){n()}}:{},settings:{brush:"selection",scale:e+"Range",direction:"left"===i||"right"===i?"vertical":"horizontal",bubbles:{align:"left"===i||"top"===i?"end":"start",placement:"outside"},target:{selector:'[id="legend-seq-target"]',fillSelector:'[id="legend-seq-ticks"]',fill:"rgba(82,204,82,0.2)"}}}}const TJ=.8,DJ=.55,_J={CORNER_RADIUS:0,INNER_RADIUS:DJ,STROKE:{COLOR:"#FFFFFF",WIDTH:{NONE:0,SMALL:2,MEDIUM:4,LARGE:6}}},NJ=({layout:e},t,n)=>t.encodings.slice.outerRadius?{scale:"radius",fn:t=>{var r,i;let o=TJ,a=0;const s=null!==(r=null==n||null===(i=n.style)||void 0===i?void 0:i.innerRadius)&&void 0!==r?r:DJ;e.donut.showAsDonut&&(o=TJ-s,a=s);return t.scale(Math.max(0,t.datum.radius.value))*o+a}}:TJ,qJ=({layout:e},t,n)=>{var r,i;if(!e.donut.showAsDonut)return 0;const o=null!==(r=null==n||null===(i=n.style)||void 0===i?void 0:i.innerRadius)&&void 0!==r?r:DJ;return t.encodings.slice.outerRadius?{scale:"radius",fn:e=>{const t=TJ-o,n=o;return e.scale(Math.min(0,e.datum.radius.value))*t+n}}:o},RJ=({layout:e},t)=>{var n,r,i,o,a,s;const l=t.colorService.getDatumProps(),u=l[Object.keys(l)[0]],c=u&&u.field?u.field:void 0,d="qDimensionInfo/0"===c,f=c?t.ds.field(c).raw():null,p=f&&(f.label||f.title||f.qFallbackTitle)||"",h=t.encodings.slice.outerRadius,{formatter:m}=t.chart,g=Ov(e,"qHyperCube.qDimensionInfo",[]).length;function v(e,n){const r=t.ds.field(e).raw();return{field:e,label:!r.isCustomFormatted&&(r.qIsAutoFormat||"U"===r.qNumFormat.qType)?e=>m(n)(e.qNum):e=>e.qText}}const y=(e.components||[]).filter((e=>"slices"===e.key))[0];return{type:"pie",key:"slices",data:{extract:{field:"qDimensionInfo/0",props:{...l,num:v(t.encodings.slice.arc,"arc"),fillTooltip:c?{field:c,label:p,value:e=>d?e.qText||"-":void 0!==e.qNum&&"NaN"!==e.qNum?e.qText?e.qText:e.qNum:e.qText||"-"}:void 0,customTooltipAttrExps:0!==g?gJ.getNode(e,{dimensionCount:g}):void 0,radius:h?v(h,"outerRadius"):void 0}}},brush:{consume:[{context:"selection",data:["","fill"],style:{inactive:{opacity:.3},active:{stroke:"rgba(52, 52, 52, 0.7)",strokeWidth:2}}},{context:"highlight",data:[""],style:{inactive:{fill:"#BFDAD9"},active:{fill:"#68B2AF"}}}]},settings:{startAngle:()=>t.viewState.get("rotation"),endAngle:()=>t.viewState.get("rotation")+2*Math.PI,slice:{arc:{ref:"num"},innerRadius:qJ({layout:e},t,y),fill:t.colorService.getColor(),strokeWidth:null!=y&&null!==(n=y.style)&&void 0!==n&&n.strokeWidth?_J.STROKE.WIDTH[y.style.strokeWidth.toUpperCase()]:_J.STROKE.WIDTH.NONE,stroke:null!==(r=null==y||null===(i=y.style)||void 0===i||null===(o=i.strokeColor)||void 0===o?void 0:o.color)&&void 0!==r?r:_J.STROKE.COLOR,outerRadius:NJ({layout:e},t,y),cornerRadius:null!==(a=null==y||null===(s=y.style)||void 0===s?void 0:s.cornerRadius)&&void 0!==a?a:0}},animations:{enabled:t.animations.enabled,isMainComponent:!0}}};function PJ({layout:e},t){var n,r;const i=(e.components||[]).filter((e=>"slices"===e.key))[0],o=null!==(n=null==i||null===(r=i.style)||void 0===r?void 0:r.innerRadius)&&void 0!==n?n:DJ,a=t.encodings.slice.outerRadius,s=t.themeService.getStyles();return!(!e.donut.showAsDonut||!a)&&{type:"pie",key:"zeroLine",data:{items:[1]},settings:{slice:{arc:1,fill:"transparent",innerRadius:0,strokeWidth:1,stroke:s.label.name.color,outerRadius:{scale:"radius",fn:e=>{const t=TJ-o,n=o;return e.scale(0)*t+n}}}},animations:{enabled:t.animations.enabled}}}function AJ(e){return{type:"pie-dividers",key:"pie-dividers",layout:{displayOrder:2},settings:{component:"slices",selector:"path"},brush:{consume:[{context:"selection",style:{inactive:{opacity:.2}}}]},animations:{enabled:e.animations.enabled,trackBy:()=>Math.random()}}}function IJ({layout:e},t){if(e.donut.showAsDonut||!t.encodings.slice.outerRadius)return!1;return{type:"negative-indicators",key:"negative-indicators",layout:{displayOrder:2},settings:{component:"slices",selector:"path",offset:5,size:4,fill:t.themeService.getStyles().label.name.color},brush:{consume:[{context:"selection",style:{inactive:{opacity:.2}}}]},animations:{enabled:t.animations.enabled}}}function OJ(e){const t=e.node.desc&&e.node.desc.share;return t?e.formatter("share")(t):""}function LJ(e){return e.node.data.num.label}function zJ(e){return e.node.data.radius.label}function FJ(e,t,n){if(e.dataPoint.auto)return n?LJ:OJ;if("share"===e.dataPoint.labelMode)return OJ;if("value"===e.dataPoint.labelMode){return t.encodings.slice.outerRadius&&"radius"===e.dataPoint.labelValueMode?zJ:LJ}return null}function jJ({data:e}){return e?e.label:""}function HJ(e){const t=parseInt(e,10);if(!isNaN(t))return t}function BJ(e){const t=((e&&e.components?e.components:void 0)||[]).filter((e=>"slices"===e.key))[0];return!t||t.style.innerRadius>.3}function VJ({node:e,data:t}){return Dv({_share:e.desc.share,_fillColor:e.attrs.fill},t)}function WJ(e,t,n){const r=t.themeService.getStyles(),i=[{padding:10,direction:t.encodings.slice.outerRadius?"rotate":"horizontal",placements:[{position:"outside",fill:r.label.name.color,padding:t.encodings.slice.outerRadius?4:2}],fontSize:HJ(r.label.name.fontSize),fontFamily:r.label.name.fontFamily,label:jJ,linkData:({node:e,data:t})=>Dv({_share:e.desc.share,_fillColor:e.attrs.fill,_showTooltip:!0},t)}];if(FJ(e,t,!1)){const r=function(e,t,n){return{label:FJ(e,t,!1),simplifiedPlacements:[{position:e.donut.showAsDonut&&BJ(e)?"inside":"into",onBackground:e.donut.showAsDonut&&BJ(e),padding:4}],theme:n.theme,themeId:"object.pieChart"}}(e,t,n),o=Uv(Dv(t,r),n.theme);o.linkData=VJ,i.push(o)}return{key:"pie-labels",type:"labels",layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:"slices",selector:"path",strategy:{type:"slice",settings:{labels:i}}}]},brush:{consume:[{context:"selection",data:["","fill"],style:{inactive:{opacity:.3}}}]},animations:{enabled:t.animations.enabled,trackBy:()=>Math.random()}}}function UJ({layout:e,context:t},n){return!1!==e.dataPoint.show&&(1===n.dataRowCount?function(e,t,n){const r=FJ(e,t,!0),i=(e=>t=>e.getContrastingColorTo(t.node.attrs.fill))(n.theme),o=t.themeService.getStyles();return{key:"pie-labels",type:"labels",layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:"slices",selector:"path",strategy:{type:"rows",settings:{align:.5,justify:.5,padding:10,labels:[{fill:e.donut.showAsDonut?o.label.name.color:i,fontSize:HJ(o.label.name.fontSize),fontFamily:o.label.name.fontFamily,label:jJ,linkData:({data:e})=>e},{fill:e.donut.showAsDonut?o.label.value.color:i,fontSize:HJ(o.label.value.fontSize),fontFamily:o.label.value.fontFamily,label:r,linkData:({data:e})=>e}]}}}]},animations:{enabled:t.animations.enabled,trackBy:()=>Math.random()}}}(e,n,t):WJ(e,n,t))}const $J=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"legendRange",enable(t,n){if(this.started||!n)return!0;if(e.constraints.select||e.constraints.active)return!1;const r=(this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((e=>"legend-seq"===e.type))||function(e){const{target:t}=e.srcEvent;return!(!t||!(t.hasAttribute("data-other-value")&&t.hasAttribute("data-idx")||"INPUT"===t.nodeName))}(n))&&!e.isLocked([this.chart.component("slices")]);return r||this.chart.component("legendRangeBrush").emit("rangeClear"),r}},events:{legendRangestart(t){t.preventDefault(),e.interactions.emit("selections-start"),this.chart.component("legendRangeBrush").emit("rangeStart",t),this.started=!0},legendRangemove(e){e.preventDefault(),this.chart.component("legendRangeBrush").emit("rangeMove",e)},legendRangeend(t){t.preventDefault(),this.chart.component("legendRangeBrush").emit("rangeEnd",t),e.onSelect(),this.started=!1}}});function YJ(e,t){const n=t.element.getBoundingClientRect();let r,i;return e.center?(({x:r}=e.center),({y:i}=e.center)):(r=e.clientX,i=e.clientY),{x:r-n.left,y:i-n.top}}function XJ(e,t){const n=t.component("slices");if(!n)return!1;const{x:r,y:i}=YJ(e,t),o=n.rect.x+n.rect.margin.left+n.rect.width/2,a=n.rect.y+n.rect.margin.top+n.rect.height/2,s=Math.min(n.rect.width,n.rect.height)/2*TJ;return(o-r)**2+(a-i)**2<=s**2}const KJ=(e,t,{requireFailure:n,recognizeWith:r}={})=>({type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"tap",interval:10,pointers:1,enable(t,n){return!n||!e.constraints.select&&!e.constraints.active&&(this.components=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter((e=>"slices"===e.key||"legend-cat"===e.key||"pie-labels"===e.key)),this.components.length)}},events:{tap(n){n.preventDefault();const{target:r}=n.srcEvent;if(r&&("INPUT"===r.nodeName||r.hasAttribute("data-other-value")))return void this.chart.component("legendRangeBrush").emit("bubbleStart",n);if(r&&r.hasAttribute("data-action")&&r.hasAttribute("data-component-key"))return void this.chart.component(r.getAttribute("data-component-key")).emit(r.getAttribute("data-action"));if(r&&r.children&&r.children[0]&&"legend-cat"===r.children[0].getAttribute("data-component-key"))return;if(e.isLocked(this.components))return;e.interactions.emit("selections-start");let i=YJ(n,this.chart);this.components.some((e=>"legend-cat"===e.key))&&(i={cx:i.x,cy:i.y,r:5});const o=this.chart.shapesAt(i,{components:[{key:"slices",propagation:"stop"},{key:"legend-cat",propagation:"stop"},{key:"pie-labels",propagation:"stop"}],propagation:"stop"});o.length&&(this.chart.brushFromShapes(o,{components:[{key:o[0].key,action:n.srcEvent.ctrlKey||t?"set":"toggle",contexts:["selection"]}]}),e.onSelect())}}}),GJ=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"lasso",enable(t,n){if(this.isStarted||!n)return!0;if(e.constraints.active||e.constraints.select||!e.interactions.lasso.active())return!1;const r=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y});return!e.isLocked(r)&&r.some((e=>"slices"===e.key))}},events:{lassostart(t){t.preventDefault(),e.constraints.select||e.constraints.active||this.isStarted||(e.interactions.emit("selections-start"),this.chart.component("lasso").emit("lassoStart",t),this.isStarted=!0)},lassomove(e){e.preventDefault(),this.chart.component("lasso").emit("lassoMove",e)},lassoend(t){t.preventDefault(),this.isStarted=!1,this.chart.component("lasso").emit("lassoEnd",t),e.onSelect()}}}),JJ=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Tap",requireFailure:t,recognizeWith:n,options:{event:"areatap",pointers:2,enable(t,n){if(this.started||!n)return!0;if(e.constraints.active||e.constraints.select)return!1;const r=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y});return r.some((e=>"slices"===e.key))&&!e.isLocked(r)}},events:{areatap(t){const n=this.chart.component("area");n&&!this.started&&(e.interactions.emit("selections-start"),n.emit("areaStart",t.pointers[0]),n.emit("areaMove",t.pointers[1]),this.started=!0,setTimeout((()=>{n.emit("areaEnd"),e.onSelect(),this.started=!1}),100)),t.preventDefault()}}});function ZJ(e){return{type:"native",key:"theusual",events:{wheel(t){let n=!1;if(!e.constraints.active&&XJ(t,this.chart)){const r=Math.sign(-t.deltaY);e.viewState.set("rotation",r*(Math.PI/12)),n=!0}else if(!e.constraints.select&&!e.constraints.active){const e=this.chart.componentsFromPoint(t).filter((e=>"legend-cat"===e.key))[0];e&&(n=!0,function(e,t){const n=(Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY)>=0?"next":"prev";t.emit(n)}(t,e))}n&&t.preventDefault()}}}}const QJ=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"rotate",pointers:1,threshold:10,enable(t,n){return!(!this.started&&n)||!e.constraints.active&&!e.interactions.lasso.active()&&XJ(n,this.chart)}},events:{rotatestart(e){e.preventDefault();const t=this.chart.component("slices").rect,n=this.chart.element.getBoundingClientRect();this.pieCenter={x:n.left+t.x+t.width/2,y:n.top+t.y+t.height/2},this.prevAngle=Math.atan2(e.center.y-this.pieCenter.y,e.center.x-this.pieCenter.x),this.started=!0},rotatemove(t){t.preventDefault();const n=Math.atan2(t.center.y-this.pieCenter.y,t.center.x-this.pieCenter.x);e.viewState.set("rotation",n-this.prevAngle),this.prevAngle=n},rotateend(e){e.preventDefault(),this.started=!1},rotatecancel(e){e.preventDefault(),this.started=!1}}}),eZ=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"legendPan",pointers:1,threshold:10,enable(t,n){return!(!this.isStarted&&n)||!e.constraints.active&&this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((e=>"legend-cat"===e.type))}},events:{legendPanstart(e){if(e.preventDefault(),!this.isStarted){this.components=this.chart.componentsFromPoint({x:e.center.x,y:e.center.y}),this.components.forEach((t=>{t.emit("panstart",e)})),this.isStarted=!0;const t=this.chart.component("tooltip");t&&t.show&&t.emit("hide")}},legendPanmove(e){this.components.forEach((t=>{t.emit("panmove",e)})),e.preventDefault()},legendPanend(e){e.preventDefault(),this.components.forEach((t=>{t.emit("panend",e)})),this.isStarted=!1}}}),tZ=(e,t,n)=>({key:"hammered",type:"hammer",enable:!0,gestures:t?[QJ(e,{}),KJ(e,t,{}),...n]:[$J(e,{}),JJ(e,{}),QJ(e,{}),GJ(e,{}),eZ(e,{}),KJ(e,t,{}),...n]});function nZ(e,t,n){const r=e.getIsSingleSelect(0),{constraints:i}=n;if(i.active&&i.passive)return[];const o=t.tooltipService.getInteractions();return[tZ(t,r,o.gestures),ZJ(t),o.native]}function rZ({settings:e},t){const n={share:{type:"d3-number",format:".1%"},arc:{data:{field:t.encodings.slice.arc}},fill:e.scales.fill&&e.scales.fill.data&&e.scales.fill.data.field?{data:{field:e.scales.fill.data.field}}:{}};return t.encodings.slice.outerRadius&&(n.outerRadius={data:{field:t.encodings.slice.outerRadius}}),n}function iZ({layout:e},t,n){if(!e.dimensionTitle)return!1;const r=t.properties,i=t.themeService.getStyles();return{key:"dimension-title",type:"data-title",layout:{minimumLayoutMode:"SMALL",dock:"top"},settings:{hyperCube:e.qHyperCube,hyperCubeDef:r&&r.qHyperCubeDef,isDimension:!0,disabled:()=>n.constraints.active||!n.model,model:t.model,app:t.app,translator:t.translator,rtl:n.rtl,selections:t.selections},style:{fontFamily:i.axis.title.fontFamily,fontSize:i.axis.title.fontSize,color:i.axis.title.color}}}function oZ({layout:e},t,n){const r=function(e,t){const n={field:"qDimensionInfo/0",props:{num:{field:t.encodings.slice.arc}}};t.encodings.slice.outerRadius&&(n.props.radius={field:t.encodings.slice.outerRadius});let r=t.ds.extract(n);if(0===r.length)return"NoDataExist";const i=Ov(e,"qHyperCube.qSize.qcy");if(Ov(e,"qHyperCube.qDataPages.0.qArea.qHeight")<i)return"LimitedData";if(r=t.encodings.slice.outerRadius?r.filter((e=>"NaN"!==e.num.value&&"NaN"!==e.radius.value)):r.filter((e=>"NaN"!==e.num.value)),0===r.length)return"OnlyNanData";const o=r;return r=t.encodings.slice.outerRadius&&!e.donut.showAsDonut?r.filter((e=>e.num.value>0&&e.radius.value>0)):r.filter((e=>e.num.value>0)),0===r.length?"OnlyNegativeOrZeroValues":o.length!==r.length&&"NegativeOrZeroValues"}(e,t),{fontFamily:i}=t.themeService.getStyles();return function(e,t,n,r={}){if(!e)return!1;const{translator:i}=t,{rtl:o}=n;return{key:"disclaimer",type:"disclaimer",layout:{dock:qv[e].alignment},settings:{label:i.get("Object.Disclaimer."+e),rtl:o},style:r}}(r,t,n,{fontFamily:i})}function aZ({layout:e,context:t,selectionService:n},r={}){const i=function({layout:e}={},t={}){const n={};return Dv(n,t.colorService.getScales()),t.encodings.slice.outerRadius&&Dv(n,function({layout:e},t){const n={radius:{type:"linear",include:[0],data:{extract:{field:t.encodings.slice.outerRadius}}}};return e.donut.showAsDonut||(n.radius.min=0),n}({layout:e},t)),n}({layout:e},r),o={scales:i};let a=[];const s=oZ({layout:e},r,t);if(s&&"center"===s.layout.dock)return{components:[s]};const l=t.constraints.select||t.constraints.active,u=r.colorService.getLegend({eventName:"legend",key:"legend",viewState:r.viewState,chart:r.chart,styleReference:"object.pieChart",rtl:t.rtl},{navigationDisabled:l});return i.fillRange&&u.components[0]&&("right"===u.components[0].layout.dock||"left"===u.components[0].layout.dock||t.rtl)&&(i.fillRange.invert=!0),a=[RJ({layout:e,settings:o},r),PJ({layout:e},r),AJ(r),IJ({layout:e},r),iZ({layout:e},r,t),...u.components,MJ({settings:o,scaleKey:"fill",legend:u.components[0]||{},onEdited:r.onSelect}),{key:"lasso",type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:[{key:"slices",contexts:["selection"]}]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}},{key:"area",type:"brush-area",settings:{brush:{components:[{key:"slices",contexts:["selection"],action:"add"}]}},style:{area:{fill:"transparent",strokeWidth:2,stroke:"black",strokeDasharray:"5 5",opacity:.7}}},UJ({layout:{components:e.components,dataPoint:Dv({},e.dataPoint,{show:!(e.effectPath&&e.snapshotData&&!1===e.dataPoint.show)}),donut:e.donut},context:t},r),...r.tooltipService.getComponents(),(!1!==e.showDisclaimer||!r.flags.isEnabled("SHOW_DISCLAIMER"))&&s],a=a.filter((e=>!1!==e)),{interactions:nZ(n,r,t),scales:i,components:r.pluginService.extendComponents(a),palettes:r.colorService.getPalettes(),formatters:rZ({settings:o},r),strategy:Iv(0,r)}}function sZ({instance:t,services:n}){const r=e.useElement(),i=e.useStaleLayout();e.onTakeSnapshot((e=>{if(!(i.snapshotData&&i.snapshotData.content&&i.snapshotData.content.chartData)&&(function(e,t){const n=t.getBoundingClientRect();e.snapshotData=e.snapshotData||{},e.snapshotData.content=e.snapshotData.content||{},e.snapshotData.content.size=e.snapshotData.content.size||{w:n.width,h:n.height}}(e,r),t&&n))return function({layout:e,chart:t,viewState:n,colorService:r}){return e.snapshotData.content=e.snapshotData.content||{},e.snapshotData.content.chartData={legendScrollOffset:Lv(t,"legend-cat"),rotation:n.get("rotation")},r.getSnapshotData().then((t=>{e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t}})).catch((()=>{}))}({layout:e,chart:t.chart,colorService:n.colorService,viewState:t.viewState})})),e.useImperativeHandle((()=>({getViewState:()=>({rotation:t.viewState.get("rotation"),legendScrollOffset:Lv(t.chart,"legend-cat")})})),[t])}var lZ={exports:{}};!function(e,t){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/conversion/",n(n.s=2)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=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)},u=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},c=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,a,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(null!=(t=arguments[f]))for(n in t)r=c(d,n),d!==(i=c(t,n))&&(h&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&l(r)?r:{},u(d,{name:n,newValue:e(h,a,i)})):void 0!==i&&u(d,{name:n,newValue:i}));return d}},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/qlik-modifiers/",n(n.s=1)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=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)},u=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},c=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(a)return a(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,a,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(null!=(t=arguments[f]))for(n in t)r=c(d,n),d!==(i=c(t,n))&&(h&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&l(r)?r:{},u(d,{name:n,newValue:e(h,a,i)})):void 0!==i&&u(d,{name:n,newValue:i}));return d}},function(e,t,n){n.r(t);var r=n(0),i=n.n(r),o=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},a=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="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function u(e){return s+e+l}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function f(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function p(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e).trim();return"="===t.substring(0,1)?t.substring(1).trim():t}function h(){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 v(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=MinString(").concat(t,"))' and Only({1}").concat(t,")<='$(=MaxString(").concat(t,"))'\"}")}function y(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var u=v(c(r[0],i),h(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(r&&2===r.length){var d=c(r[0],i),f=c(r[1],i),p=h(0),m=h(1),g=v(d,p),y=v(f,m);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function b(e){return"".concat(e,"(")}function x(e){var t=e.properties,n=e.layout;return a(t,"qHyperCubeDef.qDimensions",a(n,"qHyperCube.qDimensionInfo",[])).length}var w={isFullRange:d,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=u(p(t));if(!n.showExcludedValues)return a;var s=y({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=h(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var d=h(0),f=h(1);return"If(Count(".concat(d,") * Count(").concat(f,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:f,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return f(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return m(e,t)+n+g(r)},getFunctionPrefix:b,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return b(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:y,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===x({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=h(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:p,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:c,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=x({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:h,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")}};function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var C=i.a.bind(null,!0),S={},E=Array.isArray;function M(e){return null!=e&&!Array.isArray(e)&&"object"===k(e)}function T(e){return void 0===e}function D(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function _(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach((function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=T(e[n||t])?o:e[t],e=e[n||t]}})),e}function N(e,t){var n=!0;if(M(e)&&M(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){N(e[r],t[r])||(n=!1)})),n);if(E(e)&&E(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!N(e[r],t[r]))return!1;return!0}return e===t}S.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?C({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);N(o,a)||D(t,i)||(T(a)?r.push({op:"add",path:s,value:o}):M(o)&&M(a)?r=r.concat(S.generate(a,o,s)):E(o)&&E(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&T(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(N(t,i))return r;if(!T(t[0])&&T(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(S.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){T(t[i])&&!D(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},S.apply=function(e,t){t.forEach((function(t){var n,r=_(e,t.path),i=t.path.split("/").splice(-1)[0],o=i&&Number.isNaN(+i)?r[i]:r[+i]||r,a=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(r=null,o=e),"add"===t.op||"replace"===t.op)if(E(r))"-"===i&&(i=r.length),r.splice(+i,"add"===t.op?0:1,t.value);else if(E(o)&&E(t.value)){var s,l=t.value.slice();o.length=0,(s=o).push.apply(s,function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(l))}else if(M(o)&&M(t.value))n=o,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!D(n,e)&&delete n[e]})),C(o,t.value);else{if(!r)throw new Error("Patchee is not an object we can patch");r[i]=t.value}else if("move"===t.op){var u=_(e,t.from);E(r)?r.splice(+i,0,u.splice(+a,1)[0]):(r[i]=u[a],delete u[a])}else"remove"===t.op&&(E(r)?r.splice(+i,1):delete r[i])}))},S.clone=function(e){return C({},e)},S.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},S.updateObject=function(e,t){Object.keys(e).length?S.apply(e,S.generate(e,t)):C(e,t)};var q=S,R=function(e,t,n){if(!e)return Promise.resolve();var r=q.generate(t,n);return i()(!0,t,n),r&&r.length?(r=r.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(r,!0)):Promise.resolve()},P="accumulation";function A(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===P)return n[r]}function I(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===P)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var O={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""},L={translationKey:"properties.modifier.accumulation",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.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,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=w.getNumStepComp(n,l),f=w.getAboveComp(n,l,c,d),p=w.getRangeComp("RangeSum",f);if(w.needDimension({modifier:n,properties:r,layout:i})){var h=w.getDimComp(u,1),m=w.getDimComp(u,0),g=w.getAggrComp(p,h,m);p=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return p},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,O)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(I(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(I(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(I(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(I(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=A(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=A(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(I(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(P))return!1;var o=A(t,e);return o&&!o.disabled}}}},z="movingAverage";function F(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===z)return n[r]}function j(e,t){var n=function(e,t){var n=a(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 H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},B={translationKey:"properties.modifier.movingAverage",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,o=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var u=s;void 0===u&&(u=w.getNumDimensions({properties:i,layout:o}));var c=a(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,f=w.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:d}),p=w.getNumStepComp(r,u),h=w.getAboveComp(r,u,f,p);if(r.nullSuppression)t=w.getRangeComp("RangeAvg",h);else{var m=w.getRangeComp("RangeSum",h),g=function(e,t){var n=w.getRowNoComp(e,t);if(!w.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,u);t="".concat(m," / ").concat(g)}var v=t;if(w.needDimension({modifier:r,properties:i,layout:o})){var y=w.getDimComp(c,1),b=w.getDimComp(c,0),x=w.getAggrComp(v,y,b);v=r.showExcludedValues?w.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return v},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(j(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.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(j(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(j(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(j(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=F(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=F(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(j(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(j(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return w.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=F(t,e);return o&&!o.disabled}}}},V="difference";function W(e,t){var n=a(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===V)return n[r]}function U(e,t){var n=function(e,t){var n=a(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===V)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var $={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""},Y={translationKey:"properties.modifier.difference",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=w.getAboveComp(n,l,c),f="".concat(c," - ").concat(d);if(w.needDimension({modifier:n,properties:r,layout:i})){var p=w.getDimComp(u,1),h=w.getDimComp(u,0),m=w.getAggrComp(f,p,h);f=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return f},initModifier:function(e){Object.keys($).forEach((function(t){void 0===e[t]&&(e[t]=$[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(U(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(U(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(U(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(V))return!1;var o=W(t,e);return o&&!o.disabled}}}},X={CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},K={ONE_DIMENSION:0,ALL_DIMENSIOANS:1,DISREGARD_ALL_DIMENSIONS:2},G="normalization";function J(e,t){var n=a(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=a(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}function Q(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}function ee(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:K.ONE_DIMENSION,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:K.ALL_DIMENSIOANS,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:K.DISREGARD_ALL_DIMENSIONS,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t,n){if(e<2){var r=Q(t,0);t.splice(r,1)}return t}(i,o),function(e,t,n){if(0===e){var r=Q(t,1);t.splice(r,1)}return t}(J(e,r).selectionScope,o)}function te(e,t,n){var r=[{value:X.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:X.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:X.DISREGARD_SELECTION,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return function(e,t,n){if(1===e){var r=Q(t,0);t.splice(r,1)}return t}(J(e,n).dimensionalScope,r)}var ne={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:K.DISREGARD_ALL_DIMENSIONS,selectionScope:X.DISREGARD_SELECTION};function re(e){return 2===e?"{1}":""}function ie(e,t,n){return 1===e?"{$<".concat(w.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function oe(e,t){return 0===e&&t>1||2===e?"Total":""}function ae(e,t,n){return 0===e&&t>1?"<".concat(w.getDimDefWithWrapper(n),">"):""}var se={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var u=a(r,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),d=n.selectionScope,f=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=re(t),l=ie(t,n,r),u=""===s&&""===l?"":s||l,c=oe(i,o),d=ae(i,o,a),f=function(e){for(var t=[],n=0;n<e;n++)t[n]=w.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(d," Aggr(").concat(u," ").concat(e,", ").concat(f,"))")}(c,d,n.field,n.value,f,l,n.primaryDimension)},initModifier:function(e){Object.keys(ne).forEach((function(t){void 0===e[t]&&(e[t]=ne[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]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(Z(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:X.DISREGARD_SELECTION,options:function(n){return te(n,t,e)}},field:{refFn:function(t){return"".concat(Z(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return J(t,e).selectionScope===X.SELECT_FIELD_VALUE}},value:{refFn:function(t){return"".concat(Z(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return J(t,e).selectionScope===X.SELECT_FIELD_VALUE}},dimensionalScope:{refFn:function(t){return"".concat(Z(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:K.DISREGARD_ALL_DIMENSIONS,supportTooltip:!0,options:function(n,r){return ee(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return(J(t,e).dimensionalScope||0)===K.ONE_DIMENSION&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return w.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}}},getDisregardSelectionComp:re,getFieldSelectionComp:ie,getTotalComp:oe,getSelectedDimComp:ae},le={getExpression:function(e){return a(e,"qDef.base.qDef")||a(e,"qDef.qDef")},getExpressionRef:function(e){return a(e,"qDef.base.qDef")?"qDef.base.qDef":"qDef.qDef"},getLibraryIdRef:function(e){return a(e,"qDef.base.qLibraryId")?"qDef.base.qLibraryId":"qLibraryId"},getLibraryId:function(e){return a(e,"qDef.base.qLibraryId")||a(e,"qLibraryId")},getLabelRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return a(e,"qDef.base")?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}},ue={initBase:function(e,t){(t||ue.isValid(e))&&(o(e,"qDef.base.qDef",a(e,"qDef.qDef")),o(e,"qDef.base.qLibraryId",a(e,"qLibraryId")),o(e,"qDef.base.qLabel",a(e,"qDef.qLabel")),o(e,"qDef.base.qLabelExpression",a(e,"qDef.qLabelExpression")))},restoreBase:function(e){ue.isValid(e)&&(o(e,"qDef.qDef",a(e,"qDef.base.qDef")),o(e,"qLibraryId",a(e,"qDef.base.qLibraryId")),o(e,"qDef.qLabel",a(e,"qDef.base.qLabel")),o(e,"qDef.qLabelExpression",a(e,"qDef.base.qLabelExpression")),a(e,"qDef.qAggrFunc")&&a(e,"qDef.base.qAggrFunc")&&o(e,"qDef.qAggrFunc",a(e,"qDef.base.qAggrFunc")),delete e.qDef.base)},isValid:function(e){var t=a(e,"qDef.base.qDef"),n=a(e,"qDef.base.qLibraryId");return void 0!==t||void 0!==n}},ce=ue;function de(e){return(de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var fe={accumulation:L,movingAverage:B,difference:Y,normalization:se},pe=(t.default={modifiers:fe,apply:he,applyModifiers:me,cleanUpMeasure:ge,destroy:function(e){e&&pe[e.id]&&pe[e.id].masterItemSubscriber&&(pe[e.id].masterItemSubscriber&&pe[e.id].masterItemSubscriber.unsubscribe(),delete pe[e.id])},hasActiveModifiers:ve,getActiveModifier:ye,initBase:ce.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return fe[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return fe[e]&&fe[e].isApplicable({properties:n,layout:r})}))},measureBase:le,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=we(e);De({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Pe({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:be},{});function he(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,r=e.isSnapshot,o=void 0!==r&&r,s=e.masterItem;pe[t.id]=pe[t.id]||{isFirstTime:!0};var l=pe[t.id].isFirstTime;if(pe[t.id].isFirstTime=!1,n&&"object"===de(n))return me({model:t,properties:n});var u=t?t.layout:void 0,c=a(u,"qSelectionInfo.qInSelections");if(o||c)return Promise.resolve(!1);var d=a(u,"qHyperCube.qMeasureInfo"),f=pe[t.id].lastReloadTime;if(pe[t.id].lastReloadTime=a(t,"app.layout.qLastReloadTime"),ve({measures:d,layout:u})){var p=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return a(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 Te({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:d,layout:u,model:t,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 De({modifiers:we(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:d,layout:u,masterItem:s,isFirstTime:l})?t.getEffectiveProperties().then((function(e){var n=i()(!0,{},e);Ce(n);var r=Ae(n);return _e({model:t}).then((function(i){return Ne({libraryIds:r,model:t}).then((function(r){return p&&function(e){var t=e.properties;xe(t).forEach((function(e){return function(e){var t=e.measure;if(Te({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===de(e)&&!e.disabled){if(n++,"object"!==de(fe[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=fe[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Ee(t)&&w.simplifyExpression(t.qDef.base.qDef)!==w.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:n}),me({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:r,dimensionAndFieldList:i})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===de(e.base)}))}(d)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,n=e.properties,r=Ae(n);return Ie({model:t,libraryIds:r}).then((function(){var e=i()(!0,{},n);return xe(n).forEach((function(e){return ge(e)})),Re({oldProperties:e,newProperties:n,model:t})}))}({model:t,properties:e})})):Promise.resolve(!1)}function me(e){var t=e.model,n=e.oldProperties,r=e.properties,o=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===n&&(n=l?i()(!0,{},r):r),Ce(r);var f=Ae(r);return Ie({model:t,libraryIds:f,masterItem:u}).then((function(){return function(e){var t=e.measures,n=e.properties,r=e.model,o=e.libraryItemsProps,s=e.dimensionAndFieldList;if(t||(t=xe(n)),!t.length)return Promise.resolve();if(!ve({measures:t,properties:n}))return t.forEach((function(e){return ge(e)})),Promise.resolve();var l=o?void 0:Ae(n);return _e({model:r,dimensionAndFieldList:s}).then((function(e){return Ne({libraryIds:l,model:r,libraryItemsProps:o}).then((function(r){t.forEach((function(t){De({modifiers:t.qDef.modifiers,properties:n})?(function(e){var t=e.measure,n=e.properties,r=e.libraryItemsProps,o=e.dimensionAndFieldList,s=0;ce.isValid(t)||ce.initBase(t,!0);var l=t.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach((function(e){if("object"===de(e)&&!e.disabled){if(s++,"object"!==de(fe[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");fe[e.type].initModifier(e);var l=t.qLibraryId||c&&c.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=fe[n.type].generateExpression({expression:s,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=l,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||a.qMeasure.qLabel)&&(t.qDef.qLabel=a.qMeasure.qLabel),(t.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=a.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(t.qDef.qNumFormat=a.qMeasure.qNumFormat,t.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=a.qMeasure.coloring,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:r,dimensionAndFieldList:o}):function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList;"function"==typeof fe[n.type].updateModifier&&fe[n.type].updateModifier(n,r.qHyperCubeDef);var a=le.getExpression(t),s=fe[n.type].generateExpression({expression:a,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=s,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||a,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:o}),function(e){var t=a(e,"qDef.qAggrFunc");"Expr"!==t||be(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&be(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(t)}}))}({measure:t,properties:n,libraryItemsProps:r,dimensionAndFieldList:e}),Se(t)):ge(t)}))}))}))}({measures:o,properties:r,model:t,libraryItemsProps:c,dimensionAndFieldList:d}).then((function(){return l?Re({oldProperties:n,newProperties:r,model:t}):Promise.resolve(!1)}))}))}function ge(e){!function(e){var t=we(e);return Array.isArray(t)&&t.some((function(e){return"object"===de(e)&&!e.disabled&&!fe[e.type]}))}(e)?ce.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Se(e)}function ve(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return De({modifiers:we(e),properties:n,layout:r})}))}function ye(e){var t=we(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(fe[r.type]&&!r.disabled)return r}}function be(e){var t=ye(e);return!t||fe[t.type].enableTotalsFunction(e)}function xe(e){return a(e,"qHyperCubeDef.qMeasures",[]).concat(a(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function we(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function ke(e){return a(e,"outputExpression.qValueExpression.qExpr")||a(e,"outputExpression")}function Ce(e){xe(e).forEach((function(e){return function(e){var t=ye(e);t&&(void 0!==t.outputExpression&&ke(t)!==e.qDef.qDef?delete e.qDef.base:!ce.isValid(e)&&t.base&&(e.qDef.base=i()(!0,{},t.base)))}(e)}))}function Se(e){var t=we(e);Array.isArray(t)&&t.forEach((function(t){"object"===de(t)&&(t.disabled||!fe[t.type]&&ke(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function Ee(e){return e.base||e.qDef&&e.qDef.base}function Me(e){var t=Ee(e);return e.qLibraryId||t&&t.qLibraryId}function Te(e){var t=e.measure,n=e.properties,r=e.layout;return!Me(t)&&De({modifiers:we(t),properties:n,layout:r})}function De(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==de(e)||e.disabled||!fe[e.type])&&(void 0===i[e.type]&&(i[e.type]=fe[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function _e(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then((function(e){i.dimensionList=e}));r.push(o);var a=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(a),Promise.all(r).then((function(){return i}))}function Ne(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),Promise.all(s).then((function(){return a}))}function qe(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Re(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(a(t,"qHyperCubeDef.qMeasures"),qe)!==JSON.stringify(a(n,"qHyperCubeDef.qMeasures"),qe)||JSON.stringify(a(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),qe)!==JSON.stringify(a(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),qe);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&a(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 Pe(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===de(e)&&!e.disabled&&fe[e.type]&&fe[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function Ae(e){var t=xe(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=we(t);if(De({modifiers:r,properties:e})){var o=Me(t);o&&n.push(o),i=i||Pe({modifiers:r,properties:e})}})),a(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function Ie(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(pe[t.id].masterItemSubscriber=pe[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},o={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=a(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=a(e,n)})),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function c(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,a=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),o={},t.forEach((function(e){o[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:a}),Object.keys(r).forEach((function(e){i[e]||o[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&s.push(c(e,"getMeasure"))})),Object.keys(o).forEach((function(e){o[e]&&!r[e]&&s.push(c(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return he({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),pe[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}}])},function(e,t,n){function r(e){var t=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)}(e%62),n=Math.floor(e/62);return n>0?r(n)+t:t}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})(e)}n.r(t);var o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return r(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}var d={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:c},f=n(1),p=n.n(f),h={addDimensions:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},addMeasures:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&d.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},copyProperties:function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},updateLayoutExclude: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},storeMeasuresModifiers:function(e){e.forEach((function(e){p.a.cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))}};function m(e,t,n){var r,i,a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((i=(i=(r=JSON.stringify(a)).match(/:\{/g))?i.length:0)>2)return;a=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var s=o.getValue(e,"qLayoutExclude.quarantine");s[n]||(s[n]={}),s[n][t]=a}var g=n(0),v=n.n(g);function y(e,t){var n=v()(!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 b(e,t){return v()(!0,{},t,e)}function x(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var w=Math.pow(2,53)-1;function k(e){return function(e){if(Array.isArray(e))return C(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))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 S(e){return function(e){if(Array.isArray(e))return E(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}(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 E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var M={importCommonProperties: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},copyPropertyIfExist:function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},copyPropertyOrSetDefault:function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},getDefaultDimension:function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},getDefaultMeasure:function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},addDimensions:function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=y(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var u=y(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},addMeasures:function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=b(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var u=b(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},getMaxMinDimensionMeasure:function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=x(a.max,i.dimensions.length,w),l=x(a.min,i.dimensions.length,0);return{maxDimensions:x(o.max,s,w),minDimensions:x(o.min,l,0),maxMeasures:s,minMeasures:l}},setInterColumnSortOrder:function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(d.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,d.indexRemoved(n.qInterColumnSortOrder,o))},createNewProperties: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=v()(!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=v()(!0,{},n,i)).components&&(i.components=[]),i},shouldInitLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},initLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},updateDimensionsOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var i=o.getValue(t,r||"").qHyperCubeDef,a=k(i.qDimensions);i.qDimensions=[],a.forEach((function(e){i.qDimensions.push(e),n.dimensions.added(e,t)}))}},updateMeasuresOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var i=o.getValue(t,r||"").qHyperCubeDef,a=S(i.qMeasures);i.qMeasures=[],a.forEach((function(e){i.qMeasures.push(e),n.measures.added(e,t)}))}},restoreMeasuresModifiers:function(e){var t=e.measures,n=e.modifierTypes;t&&n&&p.a.isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))}};function T(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)}var D={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),h.addDimensions({exportFormat:i,qHyperCubeDef:l}),h.addMeasures({exportFormat:i,qHyperCubeDef:l}),h.setInterColumnSortOrder({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,h.copyProperties({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),h.updateLayoutExclude({exportFormat:i,properties:a}),r||h.storeMeasuresModifiers(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(m(i.properties,"filters","storedFilters"),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(m(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(m(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,u=e.hypercubePath,c=e.extension,d=e.supportedFilters,f=void 0===d||d,p=e.isHCModifierSupported,h=void 0===p||p,m={qChildren:[]},g=M.createNewProperties({exportFormat:t,initialProperties:r,hypercubePath:u}),v=o.getValue(r,u||"").qHyperCubeDef,y=o.getValue(g,u||"").qHyperCubeDef,b=M.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,w=b.minDimensions,k=b.maxMeasures,C=b.minMeasures,S=l.defaultDimension,E=void 0===S?M.getDefaultDimension():S,D=l.defaultMeasure,_=void 0===D?M.getDefaultMeasure():D;y.qDimensions.length=0,y.qMeasures.length=0,M.shouldInitLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:k,minMeasures:C})&&M.initLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:k,minMeasures:C,newHyperCubeDef:y}),M.addDimensions({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:y,defaultDimension:E}),M.addMeasures({exportFormat:t,maxMeasures:k,minMeasures:C,newHyperCubeDef:y,defaultMeasure:_}),M.updateDimensionsOnAdded({newProperties:g,dataDefinition:a,hypercubePath:u}),M.updateMeasuresOnAdded({newProperties:g,dataDefinition:a,hypercubePath:u}),M.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:y}),M.copyPropertyIfExist("qMaxStackedCells",v,y),M.copyPropertyIfExist("qNoOfLeftDims",v,y),M.copyPropertyOrSetDefault("qInitialDataFetch",v,y,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),M.copyPropertyOrSetDefault("qMode",v,y,"S"),M.copyPropertyOrSetDefault("qReductionMode",v,y,"N"),M.copyPropertyOrSetDefault("qSortbyYValue",v,y),M.copyPropertyOrSetDefault("qIndentMode",v,y),M.copyPropertyOrSetDefault("qShowTotalsAbove",v,y),M.importCommonProperties(g,t,r),m.qProperty=g;var N=o.getValue(c||{},"support.modifiers");return M.restoreMeasuresModifiers({measures:y.qMeasures,modifierTypes:N}),f&&T(m.qProperty,"storedFilters"),"S"===y.qMode&&h&&T(m.qProperty,"dynamicScript"),m}},_={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function N(e,t,n,r){t=t||[];var i=c(e,r,n),o=c(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function q(e,t){return e.length!==t}var R={create:function(e,t){if(!e||!_[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(N(a,t,r,i),q(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},P={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}},A={colorModeOptions:{primary:function(){return!0},dimension:function(e){return P.getNumDimensions(e)>0&&P.getNumMeasures(e)<=1},multiColor:function(e){return P.getNumMeasures(e)>1},measure:function(e){return P.getNumDimensions(e)>0},expression:function(e){return P.getNumMeasures(e)>=1}}},I={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return P.getNumMeasures(e)>=1}}},O={scatterplot:I,"sn-scatter-plot":I,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return P.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return P.getNumDimensions(e)>1},multiColor:function(e){return P.getNumMeasures(e)>1},measure:function(e){return P.getNumDimensions(e)<=1},expression:function(e){return P.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return P.getNumDimensions(e)>=1},multiColor:function(e){return P.getNumMeasures(e)>1},measure:function(e){return P.getNumDimensions(e)>=1},expression:function(e){return P.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 P.getNumDimensions(e)>=1}}}};function L(e,t,n){if(Array.isArray(e[t])){var r=d.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function z(e,t){var n=R.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){L(e,"qAttributeDimensions",n),L(e,"qAttributeExpressions",n)})),t.forEach((function(e){L(e,"qAttributeDimensions",n),L(e,"qAttributeExpressions",n)}))}function F(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function j(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;z(r,i);var l=r[r.length-1];if(l){var u=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),f=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var p=R.create(R.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:p,label:s,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:f});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;i||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),o&&(t.qNumFormat=o,t.isCustomFormatted=a)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:p,measures:a,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:f})}n?(p.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(p)):l.qAttributeExpressions.push(p)}}}function H(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":(i=function(e,t){return t?e.qLibraryId:p.a.measureBase.getLibraryId(e)}(n,t))?(s.type="measure",s.name=i,s.id=i,(o=function(e,t){return p.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r))&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}var B={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function V(e,t,n,r){var i=n?"expression":t.type,o=e.color,a=o.mode,s=P.getItemLabel(t);switch(F(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||P.wrapFieldName(t.name),key:P.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:n||s,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&B.useMasterNumberFormat(o.formatting)}r||(o.auto=!1,o.mode=a)}function W(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=R.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return V(e,H("dimension",!!a,a||r)),!!a}function U(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&F(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=H("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,V(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&W(e,t))return;j({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}function $(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&F(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=H("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,V(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=R.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return V(e,H("measure",!!s,s||r[0])),!!s}(e,t))return;j({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}var Y={changeProperty: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)},getCanColorBy:function(e,t){var n={primary:!0};if(e){var r=(O[t]||A).colorModeOptions||A.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},shouldUpdateColorBy: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))},updateColorBy:function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"color.auto"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),a=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);r?z(i,s):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions;return!t&&"byDimension"===n&&r.length>0}({auto:r,colorMode:n,dimensions:i})?U(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:r,colorMode:n,dimensions:i,measures:a,properties:e})?$(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),z(r,a)}(e,t)},deleteTotalMode:function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},shouldAddColorByExpression:function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},addColorByExpression: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)},switchToAutoColor:function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},shouldSwitchToColorPersistent:function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n}},X={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=D.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=R.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return R.moveByIdFromGroup(a,[],"qAttributeDimensions",u),R.moveByIdFromGroup(a,[],"qAttributeExpressions",u),R.moveByIdFromGroup(s,[],"qAttributeExpressions",c),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=D.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty,f=o.getValue(d,"visualization"),p=o.getValue(d,"qHyperCubeDef.qDimensions",[]),h=o.getValue(d,"color.mode",""),m=o.getValue(d,"color.auto",""),g=Y.getCanColorBy(d,f),v=Y.shouldUpdateColorBy({canColorBy:g,autoColor:m,colorMode:h,dimensions:p});return g[h]?Y.shouldAddColorByExpression({shouldUpdateColorBy:v,properties:d})&&Y.addColorByExpression(d):Y.switchToAutoColor(d),v&&Y.updateColorBy(d,"qHyperCubeDef."),Y.shouldSwitchToColorPersistent(d)&&Y.changeProperty(d,"color.persistent",!0),Y.deleteTotalMode(p),c}},K=["bar","marker","line"],G={handleAutoMinMax:function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?T(n,"unsupportedAutoMinMax")||v()(n.measureAxis,t.measureAxis):T(n,"supportedAutoMinMax")||v()(n.measureAxis,t.measureAxis)},handleMeasuresAxis:function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.exportFormat,n=e.initialProperties;return!(!t.properties.measureAxes||n.measureAxes||!n.measureAxis||void 0===n.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}}),K.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(a);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&v()(s,n.properties.measureAxes[t[0].axis])):v()(s,n.properties.measureAxes[0])}},setInterColumnSortOrder: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}}}},J={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=X.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(m(s,"measureAxis.min","supportedAutoMinMax"),m(s,"measureAxis.max","supportedAutoMinMax")):(m(s,"measureAxis.min","unsupportedAutoMinMax"),m(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=X.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty;return G.handleAutoMinMax({initialProperties:n,properties:d}),G.handleMeasuresAxis({exportFormat:t,initialProperties:n,properties:d,measureType:a}),G.setInterColumnSortOrder(d.qHyperCubeDef),c}};function Z(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Q(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var u=Z(n,r,l);o.setValue(t,u,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}function ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=Z(n,r,s),u=o.getValue(t,l);void 0!==u&&(o.setValue(i,a,u),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}var te={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalColoring",arrayName:"measures",itemPath:"qDef.conditionalColoring"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",itemPath:"qDef.conditionalColoring",arrayName:"measures",quarantineName:"conditionalColoring"})}},ne={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},quarantineAlternative:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})},unquarantineAlternative:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})}};t.default={hypercube:D,colorChart:X,axisChart:J,quarantineProperty:m,unquarantineProperty:T,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:ne}}])}(lZ);var uZ=r(lZ.exports);const cZ={setValue(e,t,n){if(!t)return;const r=t.split(".");let i=e;const o=r[r.length-1];let a;for(a=0;a<r.length-1;++a)null==i[r[a]]&&(i[r[a]]=Number.isNaN(+r[a+1])?{}:[]),i=i[r[a]];void 0!==n?i[o]=n:delete i[o]},getValue(e,t,n){const r=t.split(".");let i,o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(null==o[r[i]])return n;o=o[r[i]]}return o}},dZ={getDimensions:e=>cZ.getValue(e,"qHyperCubeDef.qDimensions",[]),getNumDimensions:e=>cZ.getValue(e,"qHyperCubeDef.qDimensions.length",0),getMeasures:e=>cZ.getValue(e,"qHyperCubeDef.qMeasures",[]),getNumMeasures:e=>cZ.getValue(e,"qHyperCubeDef.qMeasures.length",0),getDimensionLayouts(e,t){const n=cZ.getValue(e,t?t+".qHyperCube":"qHyperCube",null);return n?n.qDimensionInfo:[]},getDimensionLayout(e,t,n){return this.getDimensionLayouts(t,n).filter((t=>e===t.cId))[0]},getMeasureLayouts(e,t){const n=cZ.getValue(e,t?t+".qHyperCube":"qHyperCube",null);return n?n.qMeasureInfo:[]},getMeasureLayout(e,t,n){return this.getMeasureLayouts(t,n).filter((t=>e===t.cId))[0]}};const fZ={colorModeOptions:{primary:()=>!0,dimension:()=>!0,multiColor:()=>!1,measure:()=>!0,expression:e=>dZ.getNumMeasures(e)>=1},showLegend:e=>{const t=cZ.getValue(e,"color.auto"),n=cZ.getValue(e,"color.expressionIsColor"),r=cZ.getValue(e,"color.mode");return!(!t&&"primary"===r||!t&&"byExpression"===r&&(n||void 0===n))},persistentColorsShow:e=>!cZ.getValue(e,"color.auto")&&"byDimension"===cZ.getValue(e,"color.mode"),useDimValColShow:e=>(void 0===cZ.getValue(e,"color.useDimColVal")&&cZ.setValue(e,"color.useDimColVal",!1),!cZ.getValue(e,"color.auto")&&"byDimension"===cZ.getValue(e,"color.mode")&&"libraryItem"===cZ.getValue(e,"color.byDimDef.type"))},pZ=function(e){const{colorModeOptions:t,persistentColorsShow:n,useDimValColShow:r,showLegend:i}=fZ;this.color={colorMode:{options(n){const r=[];return"explore"===e&&r.push({value:"auto",translation:"Common.Auto"}),t.primary(n)&&r.push({value:"primary",translation:"properties.colorMode.primary"}),t.multiColor(n)&&r.push({value:"byMultiple",translation:"properties.colorMode.multicolored"}),t.dimension(n)&&r.push({value:"byDimension",translation:"properties.colorMode.byDimension"}),t.measure(n)&&r.push({value:"byMeasure",translation:"properties.colorMode.byMeasure"}),t.expression(n)&&"explore"!==e&&r.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),r}},persistentColors:{show:e=>r(e)?n(e)&&!cZ.getValue(e,"color.useDimColVal"):n(e)},useDimColVal:{show:r}},this.legend={show:i,showTitle:{show(e){const t=cZ.getValue(e,"color.auto");return cZ.getValue(e,"legend.show")&&i(e)&&(t||!function(e){return"byExpression"===cZ.getValue(e,"color.mode")&&!0===cZ.getValue(e,"color.expressionIsColor")}(e))}},dock:{show:e=>cZ.getValue(e,"legend.show")&&i(e)}}};function hZ(e){return new pZ(e)}const mZ={classification:{section:"styling",tags:["simple"],exclusive:!0},component:"items",show:!0,chartType:"piechart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.PieChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,items:{strokeSection:{translation:"properties.Outline",component:"items",items:{strokeItem:{component:"items",ref:"components",key:"slices",items:{strokeWrapper:{component:"inline-wrapper",items:{strokeWidth:{translation:"LayerStyleEditor.style.strokeWidth",ref:"style.strokeWidth",width:9,show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"Common.None"},{value:"small",translation:"Common.Small"},{value:"medium",translation:"Common.Medium"},{value:"large",translation:"Common.Large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#FFFFFF"},schemaIgnore:!0,width:3,component:"color-picker"}}}}}}},cornerRadius:{component:"items",translation:"LayerStyleEditor.style.cornerRadius",items:{cornerRadiusItem:{component:"items",ref:"components",key:"slices",items:{cornerRadiusSlider:{ref:"style.cornerRadius",translation:"LayerStyleEditor.style.cornerRadius",component:"slider",min:0,max:40,step:.05,width:12,defaultValue:0,schemaIgnore:!0}}}}},innerRadius:{translation:"LayerStyleEditor.style.innerRadius",component:"items",show:e=>e.donut.showAsDonut,items:{innerRadiusItem:{component:"items",ref:"components",key:"slices",items:{innerRadiusSlider:{ref:"style.innerRadius",translation:"LayerStyleEditor.style.innerRadius",component:"slider",min:.05,max:.75,step:.01,width:12,defaultValue:.55,schemaIgnore:!0}}}}}}},gZ={component:"style-editor",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",resetBtnTranslation:"LayerStyleEditor.component.resetAll",key:"slices",ref:"components",defaultValues:{key:"slices",style:{strokeColor:{index:-1,color:"#FFFFFF"},strokeWidth:"none",cornerRadius:0,innerRadius:.55}},items:{slices:{components:"items",type:"items",uses:"styling.slice",items:{strokeWidth:{show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"LayerStyleEditor.style.strokeWidth.none"},{value:"small",translation:"LayerStyleEditor.style.strokeWidth.small"},{value:"medium",translation:"LayerStyleEditor.style.strokeWidth.medium"},{value:"large",translation:"LayerStyleEditor.style.strokeWidth.large"}],defaultValue:"none"},strokeColor:{show:e=>"none"!==e.style.strokeWidth},cornerRadius:{component:"slider",min:0,max:40,step:.05,defaultValue:0,show:!0},innerRadius:{component:"slider",min:.05,max:.75,step:.01,defaultValue:.55,show:(e,t,n)=>n.layout.donut.showAsDonut}}}}},vZ={component:"styling-panel",chartTitle:"Object.PieChart",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,items:{strokeSection:{translation:"properties.Outline",component:"panel-section",items:{strokeItem:{component:"items",ref:"components",key:"slices",items:{strokeWrapper:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:9,show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"Common.None"},{value:"small",translation:"Common.Small"},{value:"medium",translation:"Common.Medium"},{value:"large",translation:"Common.Large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#FFFFFF"},schemaIgnore:!0,width:3,component:"color-picker"}}}}}}},cornerRadius:{translation:"LayerStyleEditor.style.cornerRadius",component:"panel-section",items:{cornerRadiusItem:{component:"items",ref:"components",key:"slices",items:{cornerRadiusSlider:{ref:"style.cornerRadius",component:"slider",min:0,max:40,step:.05,width:12,defaultValue:0,schemaIgnore:!0}}}}},innerRadius:{translation:"LayerStyleEditor.style.innerRadius",component:"panel-section",show:e=>e.donut.showAsDonut,items:{innerRadiusItem:{component:"items",ref:"components",key:"slices",items:{innerRadiusSlider:{ref:"style.innerRadius",component:"slider",min:.05,max:.75,step:.01,width:12,defaultValue:.55,schemaIgnore:!0}}}}}}},yZ=hZ("hard");const bZ=e=>{var t;null!==(t=e.color)&&void 0!==t&&t.auto||(OY(e,"color.mode","byDimension"),OY(e,"color.byDimDef.activeDimensionIndex",0),OY(e,"color.persistent",!1))},xZ=e=>{var t;const n=[{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}];switch(null===(t=e.color)||void 0===t?void 0:t.mode){case"byMultiple":n.push({value:"byMultiple",translation:"properties.colorMode.multicolored"});break;case"byMeasure":n.push({value:"byMeasure",translation:"properties.colorMode.byMeasure"});break;case"byExpression":n.push({value:"byExpression",translation:"properties.colorMode.byExpression"})}return n},wZ=e=>{const{flags:t,translator:n}=e||{},r={items:{simpleItems:{items:{autoColor:{label:e=>{var t;return null!==(t=e.color)&&void 0!==t&&t.auto?n.get("Simple.Color.Auto",n.get("properties.colorMode.byDimension")):n.get("Common.Custom")},change:bZ},colorMode:{options:xZ}}}}},i={items:{labels:{items:{header:{show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length},pointLabels:{component:"checkbox",ref:"dataPoint.auto",type:"boolean",defaultValue:!0,translation:"Simple.Label.Value",show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length,change(e){e.dataPoint.auto||OY(e,"dataPoint.labelMode","none")}},dimensionTitle:{component:"checkbox",ref:"dimensionTitle",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length,convertFunctions:{get:(e,t,n,r)=>!r.dimensionTitle,set(e,t,n,r,i){i.dimensionTitle=!e}}}}}}};return{uses:"settings",items:{simpleStyling:null!=t&&t.isEnabled("PIECHART_SIMPLE_STYLING")?mZ:void 0,simpleLabels:i,general:{items:{showDisclaimer:null!=t&&t.isEnabled("SHOW_DISCLAIMER")?{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}:void 0}},presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:{sliceStyling:null!=t&&t.isEnabled("SENSECLIENT_PS_17478_STYLINGPANEL_PIECHART")?vZ:gZ,showAsDonut:{ref:"donut.showAsDonut",type:"boolean",component:"item-selection-list",defaultValue:!1,horizontal:!0,items:[{icon:"pie_chart_pie",component:"icon-item",labelPlacement:"bottom",translation:"properties.pie",value:!1},{icon:"pie_chart_donut",component:"icon-item",labelPlacement:"bottom",translation:"properties.donut",value:!0}]},labels:{type:"items",snapshot:{tid:"property-labels"},items:{dimensionTitle:{ref:"dimensionTitle",type:"boolean",component:"switch",translation:"properties.dataPoints.dimensionlabels",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},valuesAuto:{ref:"dataPoint.auto",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},labelMode:{ref:"dataPoint.labelMode",type:"string",component:"dropdown",options:[{value:"none",translation:"Common.None"},{value:"share",translation:"properties.dataPoints.labelmode.share"},{value:"value",translation:"properties.dataPoints.labelmode.value"}],defaultValue:"share",show:e=>!e.dataPoint.auto},labelValueMode:{ref:"dataPoint.labelValueMode",type:"string",component:"dropdown",translation:"properties.dataPoints.labelvaluemode",options:[{value:"arc",translation:"Visualizations.Descriptions.Angle"},{value:"radius",translation:"Visualizations.Descriptions.Radius"}],defaultValue:"arc",show:e=>!e.dataPoint.auto&&function(e){return e.qHyperCubeDef&&e.qHyperCubeDef.qMeasures.length>1||e.qHyperCube&&e.qHyperCube.qMeasureInfo.length>1}(e)&&"value"===e.dataPoint.labelMode}}}}},colorsAndLegend:{uses:"colorsAndLegend",items:{colors:{items:{colorMode:{options:yZ.color.colorMode.options},persistentColors:{show:yZ.color.persistentColors.show}}},simpleColors:r,legend:{show:yZ.legend.show,items:{show:{defaultValue:!1,snapshot:{tid:"property-legend"}},showTitle:{show:yZ.legend.showTitle.show},dock:{show:yZ.legend.dock.show}}}}},tooltip:{uses:"tooltip"}}}},kZ={uses:"data",items:{dimensions:{uses:"dimensions"},measures:{uses:"measures",items:{numberFormatting:{items:{percentOfPieMessage:{component:"text",translation:"properties.numberFormatting.pieMessage",show:(e,t,{properties:n}={})=>n&&(n.dataPoint.auto||"share"!==n.dataPoint.labelMode)}}}}}}},CZ={uses:"sorting",items:{interColumnSorting:{reset:e=>{const{qDimensions:t,qMeasures:n,qInterColumnSortOrder:r}=e.qHyperCubeDef;if(1===t.length&&n.length>=1){const t=r.length,n=[...Array(t).keys()];[n[0],n[1]]=[n[1],n[0]],e.qHyperCubeDef.qInterColumnSortOrder=n}}}}},SZ={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{suppressZero:null,calcCond:{uses:"calcCond"}}}}};function EZ(e){return{type:"items",component:"accordion",items:{data:kZ,sorting:CZ,addons:SZ,settings:wZ(e)}}}const MZ=hZ("explore"),TZ=EZ();var DZ={type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sort"},presentation:{uses:"presentation",items:{showAsDonut:TZ.items.settings.items.presentation.items.showAsDonut,labelMode:{type:"items",items:{labelMode:{type:"string",component:"radio-list",translation:"properties.dataPoints.labelmode",diffs:["dataPoint.auto:false","dataPoint.labelMode"],options:TZ.items.settings.items.presentation.items.labels.items.labelMode.options,setPropertyValue(e,t){e.dataPoint.auto=!1,e.dataPoint.labelMode=t},getValue:e=>e.dataPoint.auto?"":e.dataPoint.labelMode}}}}},color:{uses:"color",items:{mode:{options:MZ.color.colorMode.options},dimension:{items:{persistentColors:{show:e=>!(e.color&&"byDimension"===e.color.mode&&e.color.useDimColVal&&MZ.color.useDimColVal.show(e))}}}}}}};const _Z="slices";function NZ(e,t){const n=e&&e.desc&&void 0!==e.desc.share?e.desc.share:void 0;return t("share")(n)}function qZ(e){return e.data.num.label}function RZ(e){return e.data.radius.label}function PZ(e,t,n,r){return function(e,t){if(e.dataPoint.auto)return 1===e.qHyperCube.qSize.qcy?qZ:NZ;if("share"===e.dataPoint.labelMode)return NZ;if("value"===e.dataPoint.labelMode)return t.encodings.slice.outerRadius&&"radius"===e.dataPoint.labelValueMode?RZ:qZ;return qZ}(n,r)(e,t)}function AZ(e){let t;return t=e.data.label?function(e,t){let n=e;return n.length>t&&(n=n.substr(0,t-3)+"..."),n}(e.data.label,20):"",t}class IZ{constructor({element:e,properties:t,effectHelper:n,Flag:r}){this.element=e,this.Flag=r,n.initFade(this.element);const i=e.find(".effectLayer");i.length>0&&i.remove(),e.append('<div class="effectLayer"></div>'),this.effectLayer=e.find(".effectLayer"),this._effectProperties=t,this.selectedIndex=t.selectedIndex,this.hasPropertiesPanel=!1,this.effectApplied=!0,n.fadeIn(this.element)}updateOrigSettings(e){return{dataPoint:e.dataPoint,legend:e.legend,dimensionTitle:e.dimensionTitle}}updateFlags(e,t){const n=this.chart.getAffectedShapes("highlight"),r=this.effectLayer[0].getBoundingClientRect(),i=n.map((n=>{const{start:i,end:o,outerRadius:a,offset:s}=n.desc.slice,{scaleRatio:l}=this.chart.component(n.key).rect,u=n.element.getBoundingClientRect(),c=(i+o)/2,d=u.left-r.left+l.x*(s.x+a*Math.sin(c)),f=u.top-r.top+l.y*(s.y-a*Math.cos(c)),p=Math.cos(c)>0?"top":"bottom",h=Math.sin(c)>0?"right":"left";return{title:AZ(n),label:PZ(n,this.chart.formatter,e,t),orientation:`${p}${h}`,position:{x:d,y:f}}}));this.Flag.show(this.effectLayer,i)}init(e,t,n,r){return t.getProperties().then((e=>{if(!e.originalModelSettings){const t=Dv(!0,{},e);e.originalModelSettings=this.updateOrigSettings(t)}e.effectProperties=r,e.effectPath=n,e.dataPoint.show=!1,e.legend.show=!1,e.dimensionTitle=!1,t.setProperties(e)}))}remove(e,t,n){return e.options=Dv(e.options,{effect:null}),n?t.getProperties().then((e=>Dv(e,{effectPath:null,effectProperties:null,dataPoint:Dv(!0,{},e.originalModelSettings.dataPoint),legend:Dv(!0,{},e.originalModelSettings.legend),dimensionTitle:e.originalModelSettings.dimensionTitle}))):Promise.resolve()}}class OZ extends IZ{init(e,t,n,r){return e.options=Dv(!0,e.options,{effect:this}),t.layout.effectProperties&&t.layout.effectPath===n&&t.layout.effectProperties.max===r.max?Promise.resolve():super.init(e,t,n,r)}update(e,t,n){this.chart=t,this.updateHighlight(e),this.updateFlags(e,n)}updateHighlight(e){const t=this.chart.component(_Z).data.items,n=e.effectProperties.min,r=e.effectProperties.max,i=[];let o=[1/0,-1],a=[-1/0,-1];t.forEach(((e,t)=>{const i=e.num.value;n&&i<o[0]&&(o=[i,t]),r&&i>a[0]&&(a=[i,t])})),-1!==o[1]&&i.push(t[o[1]].value),-1!==a[1]&&i.push(t[a[1]].value),i.length&&this.chart.brush("highlight").setValues(i.map((e=>({key:"qHyperCube/qDimensionInfo/0",value:e}))))}}class LZ extends IZ{constructor(e){super(e),this.hasPropertiesPanel=!0,this.propsTemplate=e.highlightValuePropsTemplate,this.effectHelper=e.effectHelper}onClick(e){if(!this.chart)return;const t=this.chart.shapesAt(function(e,t){const n=t.element.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}(e,this.chart),{propagation:"stop"});if(1!==t.length)return;const n=t[0],r=this.chart.component(_Z).data.items.map((e=>e.value)).indexOf(n.data.value);-1!==r&&(this.selectedIndex=r,this.effectHelper.updateSelectedPointIndex(this))}update(e,t,n){this.chart=t,this.updateHighlight(e),this.updateDataPoints(e,n),this.updateFlags(e,n)}updateHighlight(e){const t=this.chart.component(_Z).data.items[e.effectProperties.selectedIndex];this.chart.brush("highlight").setValues([{key:"qHyperCube/qDimensionInfo/0",value:t.value}])}updateDataPoints(e,t){this.dataPoints=this.chart.findShapes("path").filter((e=>e.key===_Z)).map(((n,r)=>{const i=PZ(n,this.chart.formatter,e,t);return{text:`${AZ(n)} (${i})`,value:r}}))}init(e,t,n,r){return e.options=Dv(!0,e.options,{effect:this}),t.layout.effectProperties&&t.layout.effectPath===n&&t.layout.effectProperties.selectedIndex===r.selectedIndex?Promise.resolve():super.init(e,t,n,r)}}const zZ="/effects/highlight-value",FZ="/effects/maxmin";var jZ={isCompatible:({effectPath:e})=>e===FZ||e===zZ,create:e=>e.effectPath===FZ?new OZ(e):e.effectPath===zZ?new LZ(e):null};function HZ(e){const t={},{components:n,tooltip:r}=e,i=n?n.filter((e=>"slices"===e.key))[0]:void 0;if(i&&i.style&&Object.keys(i.style).forEach((e=>{t["chart_style_"+e]=i.style[e]})),r){var o,a;t.chart_tooltip_custom=!r.auto;const e=null===(o=r.chart)||void 0===o||null===(a=o.object)||void 0===a?void 0:a.refId;!r.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}function BZ(e){if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures;1===t.length&&1===n.length&&(n[0].qSortBy.qSortByNumeric=-1,e.qHyperCubeDef.qInterColumnSortOrder.splice(0,e.qHyperCubeDef.qInterColumnSortOrder.length,1,0))}function VZ(e){e.qOtherTotalSpec.qOtherMode="OTHER_COUNTED",e.qOtherTotalSpec.qOtherCounted={qv:"10"}}function WZ({translator:e}){return{dimensions:{min:1,max:1,description:()=>e.get("Visualizations.Descriptions.Slice"),add(e,t){VZ(e),BZ(t),hJ.addCallbackCustomTooltip(t)},move(e,t){VZ(e),BZ(t),hJ.moveCallbackCustomTooltip(t,e)},remove(e,t){hJ.removeCallbackCustomTooltip(t,e)},replace(e,t,n,r){VZ(e),BZ(r),hJ.replaceCallbackCustomTooltip(r,t)}},measures:{min:1,max:2,description:(t,n)=>e.get(0===n?"Visualizations.Descriptions.Angle":"Visualizations.Descriptions.Radius"),add(e,t){BZ(t)},remove(e,t){!function(e){if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qMeasures,{mode:n}=e.color;"byExpression"===n&&0===t.length&&(e.color.mode="primary")}(t)}}}}const UZ=e=>e.qMax<=0,$Z=e=>!(!(e&&e.qHyperCube.qSize.qcy>0)||e.qHyperCube.qMeasureInfo.every(UZ));function YZ(e){return{definition:EZ(e),softDefinition:DZ,support:{snapshot:$Z,export:$Z,exportData:!0,sharing:$Z,viewData:!0,effects:!0},effects:jZ,extendMetrics:HZ,importProperties:(t,n,r,i)=>{const o={layout:{templateId:n.templateId}};r.mapProperties(o);const a={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},s=uZ.colorChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:WZ(e),defaultPropertyValues:a,hypercubePath:i});return s.qProperty.dataPoint&&!1===s.qProperty.dataPoint.show&&delete s.qProperty.dataPoint.show,s},exportProperties:(e,t,n)=>uZ.colorChart.exportProperties({propertyTree:e,hypercubePath:t,viewDataMode:n})}}function XZ(e){return{properties:{version:"1.21.0",color:{auto:!0,autoMinMax:!0,byDimDef:void 0,byMeasureDef:void 0,colorExpression:void 0,dimensionScheme:"12",expressionIsColor:!0,expressionLabel:"",formatting:{numFormatFromTemplate:!0,isCustomFormatted:void 0},measureMin:void 0,measureMax:void 0,measureScheme:"sg",mode:"primary",paletteColor:{index:6},persistent:!1,reverseScheme:!1,singleColor:void 0,useBaseColors:"off",useDimColVal:!0,useMeasureGradient:!0},components:[{key:"slices",style:{strokeWidth:"none",strokeColor:{index:-1,color:_J.STROKE.COLOR},cornerRadius:_J.CORNER_RADIUS,innerRadius:_J.INNER_RADIUS}}],dataPoint:{auto:!0,labelMode:"share",labelValueMode:"arc"},dimensionTitle:!0,donut:{showAsDonut:!1},footnote:"",legend:{dock:"auto",show:!0,showTitle:!0},qHyperCubeDef:{qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:10,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1,qMode:"S"},showDetails:!1,showDisclaimer:!0,showTitles:!0,subtitle:"",title:"",tooltip:{auto:!0,hideBasic:!1,data:{qHyperCubeDef:void 0},chart:void 0,imageComponents:void 0}},data:{targets:[WZ(e)]},importProperties:({exportFormat:t,initialProperties:n,hypercubePath:r})=>{const i=uZ.colorChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:WZ(e),hypercubePath:r});return i.qProperty.dataPoint&&!1===i.qProperty.dataPoint.show&&delete i.qProperty.dataPoint.show,i},exportProperties:({propertyTree:e,hypercubePath:t,viewDataMode:n})=>uZ.colorChart.exportProperties({propertyTree:e,hypercubePath:t,viewDataMode:n})}}return n=>{const{flags:r}=n;!function(e){if(e&&e.get&&e.add){const n="Object.Disclaimer.LimitedData";if(e.get(n)!==n)return;Object.keys(t).forEach((n=>{e.add(t[n])}))}}(n.translator);const i=LU();return{qae:XZ(n),ext:YZ(n),component(){const t=eJ({picasso:i}),n=EJ({flags:r,picasso:i,instance:t});!function({instance:t,services:n,picasso:r,flags:i}){const o=e.useOptions(),a=e.useModel(),s=e.useApp(),l=e.useTranslator(),u=e.useTheme(),c=e.useStaleLayout(),d=e.useSelections(),f=e.useConstraints(),{qLocaleInfo:p}=e.useAppLayout(),[h]=e.usePromise((()=>n?(wJ.attrExpr.updateProperties(a,c),Promise.all([n.colorService.initialize({createConfig:({getUseBaseColors:e})=>({theme:u,legendProps:c.legend,layout:c,localeInfo:p,hc:c.qHyperCube,colorProps:{...c.color,useBaseColors:e(c)}})}),a&&!c.snapshotData?a.getEffectiveProperties():Promise.resolve({}),n.pluginService.initialize()])):Promise.resolve()),[n]);e.useEffect((()=>{null!=t&&t.selectionService&&t.selectionService.setLayout(c)}),[c]),e.useEffect((()=>{if(!t||!h)return;const{chart:e,viewState:m,interactions:g,viewCache:v}=t,{colorService:y,pluginService:b,themeService:x,tooltipService:w}=n,k=o.viewState||{};c.snapshotData||(m.preventSet("legendScrollOffset",k.legendScrollOffset||0),m.preventSet("rotation",k.rotation||0)),function(e,t){e&&e.snapshotData&&e.snapshotData.content&&e.snapshotData.content.chartData&&(t.preventSet("legendScrollOffset",e.snapshotData.content.chartData.legendScrollOffset),t.preventSet("rotation",e.snapshotData.content.chartData.rotation))}(c,m),w.expando.set("properties",h[1]);const C=r.data("q")({key:"qHyperCube",data:c.qHyperCube,config:{localeInfo:p}}),S=[{type:"q",key:"qHyperCube",data:c.qHyperCube,config:{localeInfo:p}},...y.getData()],E={slice:{arc:"qMeasureInfo/0"}};c.qHyperCube.qMeasureInfo.length>1&&(E.slice.outerRadius="qMeasureInfo/1");const M=function(e,t){return t.slice.outerRadius?e.extract({field:"qDimensionInfo/0",props:{num:{field:t.slice.arc},radius:{field:t.slice.outerRadius}}}).filter((e=>e.num.value>0&&"NaN"!==e.radius.value)).length:e.extract({field:"qDimensionInfo/0",props:{num:{field:t.slice.arc}}}).filter((e=>e.num.value>0)).length}(r.data("q")({data:c.qHyperCube,config:{localeInfo:p}}),E),T=d?()=>{const t=e.brush("selection");mv.selections(t,{},c).forEach((e=>{d.select(e)}))}:()=>{},D=c.snapshotData&&!o.freeResize?{width:(c.snapshotData.content.size||c.snapshotData.object.size).w,height:(c.snapshotData.content.size||c.snapshotData.object.size).h}:void 0,_=e=>t.selectionService.getIsSelectionLocked(e),N=()=>aZ({layout:c,context:{rtl:"rtl"===o.direction,theme:u,translator:l,constraints:f,model:a},selectionService:t.selectionService},{picasso:r,ds:C,model:a,app:s,chart:e,onSelect:T,isLocked:_,interactions:g,constraints:f,translator:l,viewState:m,dataRowCount:M,encodings:E,colorService:y,pluginService:b,themeService:x,tooltipService:w,debouncer:zY,properties:h[1],logicalSize:D,flags:i,animations:{enabled:()=>function({viewState:e,options:t,constraints:n,viewCache:r,chart:i}){return!1!==t.chartAnimations&&!n.active&&r.get("chartWidth")===i.element.clientWidth&&r.get("chartHeight")===i.element.clientHeight&&r.get("hasZeroLine")===!!i.component("zeroLine")&&0===e.get("rotation")}({viewState:m,options:o,constraints:f,viewCache:v,chart:e})}});t.generateSettings=N;const q=N();e.update({data:S,settings:q}),v.set("chartWidth",e.element.clientWidth),v.set("chartHeight",e.element.clientHeight),v.set("hasZeroLine",q.components.filter((e=>"zeroLine"===e.key)).length>0),o.effect&&c.effectProperties?o.effect.update(c,e,{encodings:E}):c.effectPath||e.brush("highlight").end()}),[t,h,o.direction,o.effectProperties,f,u.name(),l.language()])}({instance:t,services:n,picasso:i,flags:r}),function({instance:t}){const n=e.useStaleLayout(),r=e.useOptions(),i=e.useRect();e.useEffect((()=>{if(!t||!t.generateSettings)return;const{viewCache:e,chart:i,generateSettings:o}=t;i.update({settings:o()}),e.set("chartWidth",i.element.clientWidth),e.set("chartHeight",i.element.clientHeight),r.effect&&r.effect.update(n,i)}),[i.width,i.height])}({instance:t}),sZ({instance:t,services:n})}}}}));
|