@nebula.js/sn-pivot-table 7.0.9 → 7.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/sn-pivot-table v7.0.
|
|
2
|
+
* @nebula.js/sn-pivot-table v7.0.10
|
|
3
3
|
* Copyright (c) 2026 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -99,6 +99,6 @@ function kr(e,t){let n;return n=t?fr(e).withConfig({displayName:t.label,shouldFo
|
|
|
99
99
|
* LICENSE file in the root directory of this source tree.
|
|
100
100
|
*/var pw,fw,mw={},gw={};function yw(){if(pw)return gw;pw=1;var e=ja;Object.defineProperty(gw,"__esModule",{value:!0}),gw.default=void 0;var t=(0,e(cy()).default)();return gw.default=t,gw}var vw,bw,xw={},ww={};function Sw(){if(bw)return xw;bw=1;var e=ja;Object.defineProperty(xw,"__esModule",{value:!0}),xw.default=function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.breakpoints,a=void 0===o?["sm","md","lg"]:o,s=i.disableAlign,l=void 0!==s&&s,c=i.factor,u=void 0===c?2:c,d=i.variants,h=void 0===d?["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","caption","button","overline"]:d,p=(0,t.default)({},e);p.typography=(0,t.default)({},p.typography);var f=p.typography,m=(0,r.convertLength)(f.htmlFontSize),g=a.map((function(e){return p.breakpoints.values[e]}));return h.forEach((function(e){var i=f[e],o=parseFloat(m(i.fontSize,"rem"));if(!(o<=1)){var a=o,s=1+(a-1)/u,c=i.lineHeight;if(!(0,r.isUnitless)(c)&&!l)throw new Error((0,n.formatMuiErrorMessage)(6));(0,r.isUnitless)(c)||(c=parseFloat(m(c,"rem"))/parseFloat(o));var d=null;l||(d=function(e){return(0,r.alignProperty)({size:e,grid:(0,r.fontGrid)({pixels:4,lineHeight:c,htmlFontSize:f.htmlFontSize})})}),f[e]=(0,t.default)({},i,(0,r.responsiveProperty)({cssProperty:"fontSize",min:s,max:a,unit:"rem",breakpoints:g,transform:d}))}})),p};var t=e(As()),n=bf,r=function(){if(vw)return ww;vw=1;var e=ja;Object.defineProperty(ww,"__esModule",{value:!0}),ww.isUnitless=function(e){return String(parseFloat(e)).length===String(e).length},ww.getUnit=n,ww.toUnitless=r,ww.convertLength=function(e){return function(t,i){var o=n(t);if(o===i)return t;var a=r(t);if("px"!==o)if("em"===o)a=r(t)*r(e);else if("rem"===o)return a=r(t)*r(e),t;var s=a;if("px"!==i)if("em"===i)s=a/r(e);else{if("rem"!==i)return t;s=a/r(e)}return parseFloat(s.toFixed(5))+i}},ww.alignProperty=function(e){var t=e.size,n=e.grid,r=t-t%n,i=r+n;return t-r<i-t?r:i},ww.fontGrid=function(e){var t=e.lineHeight;return e.pixels/(t*e.htmlFontSize)},ww.responsiveProperty=function(e){var n=e.cssProperty,r=e.min,i=e.max,o=e.unit,a=void 0===o?"rem":o,s=e.breakpoints,l=void 0===s?[600,960,1280]:s,c=e.transform,u=void 0===c?null:c,d=(0,t.default)({},n,"".concat(r).concat(a)),h=(i-r)/l[l.length-1];return l.forEach((function(e){var i=r+h*e;null!==u&&(i=u(i)),d["@media (min-width:".concat(e,"px)")]=(0,t.default)({},n,"".concat(Math.round(1e4*i)/1e4).concat(a))})),d};var t=e(zf());function n(e){return String(e).match(/[\d.\-+]*\s*(.*)/)[1]||""}function r(e){return parseFloat(e)}return ww}();return xw}var Cw,Mw={};var kw,Ew={};var _w,Rw={};var Iw,Dw={};!function(e){var n=ja,r=_p;Object.defineProperty(e,"__esModule",{value:!0});var i={createTheme:!0,createMuiTheme:!0,unstable_createMuiStrictModeTheme:!0,createStyles:!0,makeStyles:!0,responsiveFontSizes:!0,styled:!0,useTheme:!0,withStyles:!0,withTheme:!0,createGenerateClassName:!0,jssPreset:!0,ServerStyleSheets:!0,StylesProvider:!0,MuiThemeProvider:!0,ThemeProvider:!0};Object.defineProperty(e,"createTheme",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"createMuiTheme",{enumerable:!0,get:function(){return a.createMuiTheme}}),Object.defineProperty(e,"unstable_createMuiStrictModeTheme",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"createStyles",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"makeStyles",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"responsiveFontSizes",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"styled",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"useTheme",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(e,"withStyles",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"withTheme",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(e,"createGenerateClassName",{enumerable:!0,get:function(){return g.createGenerateClassName}}),Object.defineProperty(e,"jssPreset",{enumerable:!0,get:function(){return g.jssPreset}}),Object.defineProperty(e,"ServerStyleSheets",{enumerable:!0,get:function(){return g.ServerStyleSheets}}),Object.defineProperty(e,"StylesProvider",{enumerable:!0,get:function(){return g.StylesProvider}}),Object.defineProperty(e,"MuiThemeProvider",{enumerable:!0,get:function(){return g.ThemeProvider}}),Object.defineProperty(e,"ThemeProvider",{enumerable:!0,get:function(){return g.ThemeProvider}});var o=Rp;Object.keys(o).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(i,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}}))}));var a=r(cy()),s=n(function(){if(uy)return dy;uy=1;var e=ja;Object.defineProperty(dy,"__esModule",{value:!0}),dy.default=function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return n.default.apply(void 0,[(0,t.deepmerge)({unstable_strictMode:!0},e)].concat(i))};var t=bf,n=e(cy());return dy}()),l=n(function(){if(cw)return hy;cw=1,Object.defineProperty(hy,"__esModule",{value:!0}),hy.default=function(t){return(0,e.createStyles)(t)};var e=hw;return hy}()),c=n(function(){if(fw)return mw;fw=1;var e=ja;Object.defineProperty(mw,"__esModule",{value:!0}),mw.default=void 0;var t=e(As()),n=hw,r=e(yw()),i=function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,n.makeStyles)(e,(0,t.default)({defaultTheme:r.default},i))};return mw.default=i,mw}()),u=n(Sw()),d=n(function(){if(Cw)return Mw;Cw=1;var e=ja;Object.defineProperty(Mw,"__esModule",{value:!0}),Mw.default=void 0;var t=e(As()),n=hw,r=e(yw()),i=function(e){var i=(0,n.styled)(e);return function(e,n){return i(e,(0,t.default)({defaultTheme:r.default},n))}};return Mw.default=i,Mw}()),h=oy();Object.keys(h).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(i,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return h[t]}}))}));var p=n(function(){if(kw)return Ew;kw=1;var e=ja;Object.defineProperty(Ew,"__esModule",{value:!0}),Ew.default=function(){return(0,n.useTheme)()||r.default};var n=hw;e(t);var r=e(yw());return Ew}()),f=n(function(){if(_w)return Rw;_w=1;var e=ja;Object.defineProperty(Rw,"__esModule",{value:!0}),Rw.default=void 0;var t=e(As()),n=hw,r=e(yw()),i=function(e,i){return(0,n.withStyles)(e,(0,t.default)({defaultTheme:r.default},i))};return Rw.default=i,Rw}()),m=n(function(){if(Iw)return Dw;Iw=1;var e=ja;Object.defineProperty(Dw,"__esModule",{value:!0}),Dw.default=void 0;var t=hw,n=e(yw()),r=(0,t.withThemeCreator)({defaultTheme:n.default});return Dw.default=r,Dw}()),g=hw}(Cp),Cp.alpha(Xh.GREYSCALE_0,.05),Cp.alpha(Xh.GREEN_PALE,.5),Cp.alpha(Xh.BLUE_PALE,.5),Cp.alpha(Xh.GREEN_PALE,.5),Cp.alpha(Xh.BLUE_PALE,.5),Cp.alpha(Xh.GREEN_PALE,.5),Cp.alpha(Xh.BLUE_PALE,.5),Cp.alpha(Xh.GREEN_PALE,.5),Cp.alpha(Xh.BLUE_PALE,.5),Cp.alpha(Xh.GREEN_PALE,.5),Cp.alpha(Xh.BLUE_PALE,.5);const Aw=(e="light",t=!1)=>wp(e,t);function Pw(e,t){return e.unstable_is?e.unstable_is(t):t===e}function Ow(e){return"init"in e}function Tw(e){return!!e.write}function Lw(e){return"v"in e||"e"in e}function qw(e){if("e"in e)throw e.e;if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v}const Nw=new WeakMap;function jw(e){var t;return Fw(e)&&!!(null==(t=Nw.get(e))?void 0:t[0])}function zw(e,t){let n=Nw.get(e);if(!n){n=[!0,new Set],Nw.set(e,n);const t=()=>{n[0]=!1};e.then(t,t)}n[1].add(t)}function Fw(e){return"function"==typeof(null==e?void 0:e.then)}function Ww(e,t,n){if(!n.p.has(e)){n.p.add(e);const r=()=>n.p.delete(e);t.then(r,r)}}function $w(e,t,n){var r;const i=new Set;for(const t of(null==(r=n.get(e))?void 0:r.t)||[])n.has(t)&&i.add(t);for(const e of t.p)i.add(e);return i}const Bw=()=>{const e={},t=new WeakMap,n=n=>{var r,i;null==(r=t.get(e))||r.forEach((e=>e(n))),null==(i=t.get(n))||i.forEach((e=>e()))};return n.add=(n,r)=>{const i=n||e,o=(t.has(i)?t:t.set(i,new Set)).get(i);return o.add(r),()=>{null==o||o.delete(r),o.size||t.delete(i)}},n};function Hw(e){return e.c||(e.c=Bw()),e.m||(e.m=Bw()),e.u||(e.u=Bw()),e.f||(e.f=(()=>{const e=new Set,t=()=>e.forEach((e=>e()));return t.add=t=>(e.add(t),()=>e.delete(t)),t})()),e}const Vw=(e,t,...n)=>t.read(...n),Gw=(e,t,...n)=>t.write(...n),Uw=(e,t)=>{var n;return null==(n=t.unstable_onInit)?void 0:n.call(t,e)},Yw=(e,t,n)=>{var r;return null==(r=t.onMount)?void 0:r.call(t,n)},Kw=(e,t)=>{const n=cS(e),r=n[0],i=n[9];if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!t)throw new Error("Atom is undefined or null");let o=r.get(t);return o||(o={d:new Map,p:new Set,n:0},r.set(t,o),null==i||i(e,t)),o},Xw=e=>{const t=cS(e),n=t[1],r=t[3],i=t[4],o=t[5],a=t[6],s=t[13],l=[],c=e=>{try{e()}catch(e){l.push(e)}};do{a.f&&c(a.f);const t=new Set,l=t.add.bind(t);r.forEach((e=>{var t;return null==(t=n.get(e))?void 0:t.l.forEach(l)})),r.clear(),o.forEach(l),o.clear(),i.forEach(l),i.clear(),t.forEach(c),r.size&&s(e)}while(r.size||o.size||i.size);if(l.length)throw new AggregateError(l)},Jw=e=>{const t=cS(e),n=t[1],r=t[2],i=t[3],o=t[11],a=t[14],s=t[17],l=[],c=new WeakSet,u=new WeakSet,d=Array.from(i);for(;d.length;){const t=d[d.length-1],i=o(e,t);if(u.has(t))d.pop();else if(c.has(t)){if(r.get(t)===i.n)l.push([t,i]);else if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&r.has(t))throw new Error("[Bug] invalidated atom exists");u.add(t),d.pop()}else{c.add(t);for(const e of $w(t,i,n))c.has(e)||d.push(e)}}for(let t=l.length-1;t>=0;--t){const[n,o]=l[t];let c=!1;for(const e of o.d.keys())if(e!==n&&i.has(e)){c=!0;break}c&&(a(e,n),s(e,n)),r.delete(n)}},Zw=(e,t)=>{var n;const r=cS(e),i=r[1],o=r[2],a=r[3],s=r[6],l=r[7],c=r[11],u=r[12],d=r[13],h=r[14],p=r[16],f=r[17],m=c(e,t);if(Lw(m)){if(i.has(t)&&o.get(t)!==m.n)return m;if(Array.from(m.d).every((([t,n])=>h(e,t).n===n)))return m}m.d.clear();let g,y,v=!0;function b(){i.has(t)&&(f(e,t),d(e),u(e))}const x={get signal(){return g||(g=new AbortController),g.signal},get setSelf(){return"production"===(import.meta.env?import.meta.env.MODE:void 0)||Tw(t)||console.warn("setSelf function cannot be used with read-only atom"),!y&&Tw(t)&&(y=(...n)=>{if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&v&&console.warn("setSelf function cannot be called in sync"),!v)try{return p(e,t,...n)}finally{d(e),u(e)}}),y}},w=m.n;try{const n=l(e,t,(function(n){var r;if(Pw(t,n)){const t=c(e,n);if(!Lw(t)){if(!Ow(n))throw new Error("no atom init");iS(e,n,n.init)}return qw(t)}const o=h(e,n);try{return qw(o)}finally{m.d.set(n,o.n),jw(m.v)&&Ww(t,m.v,o),null==(r=i.get(n))||r.t.add(t),v||b()}}),x);return iS(e,t,n),Fw(n)&&(zw(n,(()=>null==g?void 0:g.abort())),n.then(b,b)),m}catch(e){return delete m.v,m.e=e,++m.n,m}finally{v=!1,w!==m.n&&o.get(t)===w&&(o.set(t,m.n),a.add(t),null==(n=s.c)||n.call(s,t))}},Qw=(e,t)=>{const n=cS(e),r=n[1],i=n[2],o=n[11],a=[t];for(;a.length;){const t=a.pop(),n=o(e,t);for(const s of $w(t,n,r)){const t=o(e,s);i.set(s,t.n),a.push(s)}}},eS=(e,t,...n)=>{const r=cS(e),i=r[3],o=r[6],a=r[8],s=r[11],l=r[12],c=r[13],u=r[14],d=r[15],h=r[17];let p=!0;const f=t=>qw(u(e,t)),m=(n,...r)=>{var a;const u=s(e,n);try{if(Pw(t,n)){if(!Ow(n))throw new Error("atom not writable");const t=u.n,s=r[0];return iS(e,n,s),h(e,n),void(t!==u.n&&(i.add(n),null==(a=o.c)||a.call(o,n),d(e,n)))}return eS(e,n,...r)}finally{p||(c(e),l(e))}};try{return a(e,t,f,m,...n)}finally{p=!1}},tS=(e,t)=>{var n;const r=cS(e),i=r[1],o=r[3],a=r[6],s=r[11],l=r[15],c=r[18],u=r[19],d=s(e,t),h=i.get(t);if(h&&!jw(d.v)){for(const[r,i]of d.d)if(!h.d.has(r)){const u=s(e,r);c(e,r).t.add(t),h.d.add(r),i!==u.n&&(o.add(r),null==(n=a.c)||n.call(a,r),l(e,r))}for(const n of h.d||[])if(!d.d.has(n)){h.d.delete(n);const r=u(e,n);null==r||r.t.delete(t)}}},nS=(e,t)=>{var n;const r=cS(e),i=r[1],o=r[4],a=r[6],s=r[10],l=r[11],c=r[12],u=r[13],d=r[14],h=r[16],p=l(e,t);let f=i.get(t);if(!f){d(e,t);for(const n of p.d.keys()){nS(e,n).t.add(t)}if(f={l:new Set,d:new Set(p.d.keys()),t:new Set},i.set(t,f),null==(n=a.m)||n.call(a,t),Tw(t)){const n=()=>{let n=!0;const r=(...r)=>{try{return h(e,t,...r)}finally{n||(u(e),c(e))}};try{const i=s(e,t,r);i&&(f.u=()=>{n=!0;try{i()}finally{n=!1}})}finally{n=!1}};o.add(n)}}return f},rS=(e,t)=>{var n;const r=cS(e),i=r[1],o=r[5],a=r[6],s=r[11],l=r[19],c=s(e,t);let u=i.get(t);if(!u||u.l.size||Array.from(u.t).some((e=>{var n;return null==(n=i.get(e))?void 0:n.d.has(t)})))return u;u.u&&o.add(u.u),u=void 0,i.delete(t),null==(n=a.u)||n.call(a,t);for(const n of c.d.keys()){const r=l(e,n);null==r||r.t.delete(t)}},iS=(e,t,n)=>{const r=cS(e)[11],i=r(e,t),o="v"in i,a=i.v;if(Fw(n))for(const o of i.d.keys())Ww(t,n,r(e,o));i.v=n,delete i.e,o&&Object.is(a,i.v)||(++i.n,Fw(a)&&function(e){const t=Nw.get(e);(null==t?void 0:t[0])&&(t[0]=!1,t[1].forEach((e=>e())))}(a))},oS=(e,t)=>qw((0,cS(e)[14])(e,t)),aS=(e,t,...n)=>{const r=cS(e),i=r[12],o=r[13],a=r[16];try{return a(e,t,...n)}finally{o(e),i(e)}},sS=(e,t,n)=>{const r=cS(e),i=r[12],o=r[18],a=r[19],s=o(e,t).l;return s.add(n),i(e),()=>{s.delete(n),a(e,t),i(e)}},lS=new WeakMap;function cS(e){const t=lS.get(e);if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!t)throw new Error("Store must be created by buildStore to read its building blocks");return t}let uS,dS=0;function hS(e,t){const n="atom"+ ++dS,r={toString(){return"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&this.debugLabel?n+":"+this.debugLabel:n}};return"function"==typeof e?r.read=e:(r.init=e,r.read=pS,r.write=fS),t&&(r.write=t),r}function pS(e){return e(this)}function fS(e,t,n){return t(this,"function"==typeof n?n(e(this)):n)}function mS(){return function(...e){const t={get:e=>(0,cS(t)[21])(t,e),set:(e,...n)=>(0,cS(t)[22])(t,e,...n),sub:(e,n)=>(0,cS(t)[23])(t,e,n)},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},Vw,Gw,Uw,Yw,Kw,Xw,Jw,Zw,Qw,eS,tS,nS,rS,iS,oS,aS,sS].map(((t,n)=>e[n]||t));return lS.set(t,Object.freeze(n)),t}()}const gS=s(void 0);function yS(e){return d(gS)||(uS||(uS=mS(),"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=uS),globalThis.__JOTAI_DEFAULT_STORE__!==uS&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),uS)}function vS({children:e,store:t}){const r=a(void 0);return t||r.current||(r.current=mS()),n(gS.Provider,{value:t||r.current},e)}const bS=e=>"function"==typeof(null==e?void 0:e.then),xS=e=>{e.status||(e.status="pending",e.then((t=>{e.status="fulfilled",e.value=t}),(t=>{e.status="rejected",e.reason=t})))},wS=t.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(xS(e),e)}),SS=new WeakMap,CS=(e,t)=>{let n=SS.get(e);return n||(n=new Promise(((r,i)=>{let o=e;const a=e=>t=>{o===e&&r(t)},s=e=>t=>{o===e&&i(t)},l=()=>{try{const e=t();bS(e)?(SS.set(e,n),o=e,e.then(a(e),s(e)),zw(e,l)):r(e)}catch(e){i(e)}};e.then(a(e),s(e)),zw(e,l)})),SS.set(e,n)),n};function MS(e,n){const{delay:r,unstable_promiseStatus:i=!t.use}={},o=yS(),[[a,s,d],h]=l((t=>{const n=o.get(e);return Object.is(t[0],n)&&t[1]===o&&t[2]===e?t:[n,o,e]}),void 0,(()=>[o.get(e),o,e]));let p=a;if(s===o&&d===e||(h(),p=o.get(e)),c((()=>{const t=o.sub(e,(()=>{if(i)try{const t=o.get(e);bS(t)&&xS(CS(t,(()=>o.get(e))))}catch(e){}"number"!=typeof r?h():setTimeout(h,r)}));return h(),t}),[o,e,r,i]),u(p),bS(p)){const t=CS(p,(()=>o.get(e)));return i&&xS(t),wS(t)}return p}function kS(e,t){const n=yS();return h(((...t)=>{if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!("write"in e))throw new Error("not writable atom");return n.set(e,...t)}),[n,e])}function ES(e,t){return[MS(e),kS(e)]}function _S(e,t){let n=null;const r=new Map,i=new Set,o=i=>{let s;if(void 0===t)s=r.get(i);else for(const[e,n]of r)if(t(e,i)){s=n;break}if(void 0!==s){if(!(null==n?void 0:n(s[1],i)))return s[0];o.remove(i)}const l=e(i);return r.set(i,[l,Date.now()]),a("CREATE",i,l),l},a=(e,t,n)=>{for(const r of i)r({type:e,param:t,atom:n})};return o.unstable_listen=e=>(i.add(e),()=>{i.delete(e)}),o.getParams=()=>r.keys(),o.remove=e=>{if(void 0===t){if(!r.has(e))return;const[t]=r.get(e);r.delete(e),a("REMOVE",e,t)}else for(const[n,[i]]of r)if(t(n,e)){r.delete(n),a("REMOVE",n,i);break}},o.setShouldRemove=e=>{if(n=e,n)for(const[e,[t,i]]of r)n(i,e)&&(r.delete(e),a("REMOVE",e,t))},o}Symbol("production"!==(import.meta.env?import.meta.env.MODE:void 0)?"RESET":"");!function(e=()=>{try{return window.localStorage}catch(e){return void("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&"undefined"!=typeof window&&console.warn(e))}},t){var n;let r,i;const o={getItem:(n,o)=>{var a,s;const l=e=>{if(r!==(e=e||"")){try{i=JSON.parse(e,null==t?void 0:t.reviver)}catch(e){return o}r=e}return i},c=null!=(s=null==(a=e())?void 0:a.getItem(n))?s:null;return(e=>"function"==typeof(null==e?void 0:e.then))(c)?c.then(l):l(c)},setItem:(t,n)=>{var r;return null==(r=e())?void 0:r.setItem(t,JSON.stringify(n,void 0))},removeItem:t=>{var n;return null==(n=e())?void 0:n.removeItem(t)}};let a;try{a=null==(n=e())?void 0:n.subscribe}catch(e){}var s;!a&&"undefined"!=typeof window&&"function"==typeof window.addEventListener&&window.Storage&&(a=(t,n)=>{if(!(e()instanceof window.Storage))return()=>{};const r=r=>{r.storageArea===e()&&r.key===t&&n(r.newValue)};return window.addEventListener("storage",r),()=>{window.removeEventListener("storage",r)}}),a&&(o.subscribe=(s=a,(e,t,n)=>s(e,(e=>{let r;try{r=JSON.parse(e||"")}catch(e){r=n}t(r)}))))}();const RS=(e,t,n)=>(t.has(n)?t:t.set(n,e())).get(n),IS=new WeakMap,DS=()=>{};const AS=new WeakMap;const PS=e=>{let t=AS.get(e);return t||(t=new WeakSet,AS.set(e,t)),t};function OS(){return Boolean("undefined"!=typeof process&&process.env?.NODE_ENV&&!1)}function TS(e){const t=hS((()=>[])),n=hS((function(e){const[r,i,o]=e(t);o.has(n)&&(r.forEach(e),++i.n)}));return n.effect=e,n.unstable_onInit=e=>{const r=new Set;let i,o=0,a=!1,s=!1,l=!1;function c(){if(o)return;r.clear();let t=!0;const u=i=>{if(l)return e.get(i);if(i===n){const t=f(e,i);if(!Lw(t)){if(!Ow(i))throw new Error("no atom init");w(e,i,i.init)}return qw(t)}const o=y(e,i);try{return qw(o)}finally{C.d.set(i,o.n),d.get(i)?.t.add(n),t?r.add(i):d.has(i)&&(x(e,n),g(e),m(e))}};u.peek=e.get;const S=(r,...i)=>{const a=f(e,r);try{if(++o,r===n){if(!Ow(r))throw new Error("atom not writable");const t=a.n,n=i[0];return w(e,r,n),x(e,r),void(t!==a.n&&(h.add(r),p.c?.(r),v(e,r)))}return b(e,r,...i)}finally{t||(g(e),m(e)),--o}};S.recurse=(t,...r)=>{if(l){if(OS())throw new Error("set.recurse is not allowed in cleanup")}else try{return a=!0,x(e,n),S(t,...r)}finally{g(e),a=!1,s&&(s=!1,c())}};try{i?.();const e=n.effect(u,S);if("function"!=typeof e)return;i=()=>{if(!o)try{return t=!0,l=!0,e()}finally{t=!1,l=!1,i=void 0}}}finally{t=!1,r.forEach((t=>{C.d.set(t,f(e,t).n)})),x(e,n),g(e)}}const u=cS(e),d=u[1],h=u[3],p=Hw(u[6]),f=u[11],m=u[12],g=u[13],y=u[14],v=u[15],b=u[16],x=u[17],w=u[20],S=function(e,t){let n=LS.get(e);n||(n=new Set,LS.set(e,n),t.f.add((function(){for(const e of n)n.delete(e),e()})));return n}(e,p),C=f(e,n);C.v=void 0,Object.assign(e.get(t),[r,C,d]),p.c.add(n,(function(){h.delete(n)})),p.m.add(n,(function(){S.add(c),i&&S.delete(i)})),p.u.add(n,(function(){S.delete(c),i&&S.add(i)})),p.c.add(n,(function(){a?s=!0:S.add(c)}))},OS()&&(Object.defineProperty(t,"debugLabel",{get:()=>n.debugLabel?`${n.debugLabel}:ref`:void 0,configurable:!0,enumerable:!0}),t.debugPrivate=!0),n}const LS=new WeakMap;const qS=async(e,t,n)=>{const r=e.get(n);void 0!==r&&("dimension"===r.type?await t.moveDimensionToAlternative(r.def.qDef.cId):await t.moveMeasureToAlternative(r.def.qDef.cId))},NS=async(e,t,n)=>{const r=e.get(n);void 0!==r&&("dimension"===r.type?await t.moveDimensionFromAlternative(r.def.qDef.cId):await t.moveMeasureFromAlternative(r.def.qDef.cId))},jS=async e=>{const{type:t,handler:n,model:r,fieldInfo:i}=e;if(void 0!==n&&void 0!==r){switch(t){case"apply":for(const t of e.localChecked)await NS(i,n,t);for(const t of e.localUnchecked)await qS(i,n,t);break;case"checked":await NS(i,n,e.cId);break;case"unchecked":await qS(i,n,e.cId)}await r.applyPatches([{qOp:"replace",qValue:JSON.stringify(n.properties.qHyperCubeDef),qPath:"/qHyperCubeDef"}],!0)}},zS=hS(),FS=hS(),WS=hS(),$S=hS((e=>e(WS)?.translate??(e=>e))),BS=hS(""),HS=hS((e=>{const t=e(BS).toLowerCase().trim();return({title:e})=>e.toLowerCase().trim().includes(t)})),VS=e=>7005!==e.qError?.qErrorCode,GS=new WeakMap,US={qInfo:{qType:"AlternativeLayout"},qHyperCubeDef:{qMode:"S",qDimensions:[],qMeasures:[],qInitialDataFetch:[{qTop:0,qLeft:0,qHeight:0,qWidth:0}],excludedNoOfLeftDims:-1,qCalcCond:{qv:"0"}}},YS=function(e,t=DS){return((e,t,n)=>{const r=RS((()=>new WeakMap),IS,t);return RS(e,r,n)})((()=>{const n=new WeakMap,r=new WeakMap,i=hS(0);"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&(i.debugPrivate=!0);const o=hS(((a,{setSelf:s})=>{a(i);const l=a(o),c=a(e);if(!(e=>"function"==typeof(null==e?void 0:e.then))(c))return{v:c};if(c!==(null==l?void 0:l.p)&&c.then((e=>{r.set(c,e),s()}),(e=>{n.set(c,e),s()})),n.has(c))throw n.get(c);return r.has(c)?{p:c,v:r.get(c)}:l&&"v"in l?{p:c,f:t(l.v),v:l.v}:{p:c,f:t()}}),((e,t)=>{t(i,(e=>e+1))}));return o.init=void 0,"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&(o.debugPrivate=!0),hS((e=>{const t=e(o);return"f"in t?t.f:t.v}),((t,n,...r)=>n(e,...r)))}),e,t)}(hS((async e=>{const t=e(zS);if(t){if(GS.has(t))return GS.get(t);try{const e=await t.app.createSessionObject(US);return GS.set(t,e),e}catch(e){return void console.error("Error creating alternative layout model:",e)}}}))),KS=hS(),XS=TS(((e,t)=>{const n=e(zS),r=e(YS);if(!n||!r)return;const i=async()=>{const e=await n.getLayout();if(e.qSelectionInfo?.qInSelections)return;const i=await n.getEffectiveProperties();await r.applyPatches([{qOp:"replace",qPath:"/qHyperCubeDef/qDimensions",qValue:JSON.stringify(i.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions)},{qOp:"replace",qPath:"/qHyperCubeDef/qMeasures",qValue:JSON.stringify(i.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures)}]);const o=await r.getLayout();t(KS,{layout:structuredClone(e),properties:structuredClone(i),altLayout:structuredClone(o)})};return i(),n.Invalidated?.bind(i),()=>{n.Invalidated?.unbind(i)}})),JS=hS((e=>(e(XS),e(KS)?.layout))),ZS=hS((e=>e(KS)?.altLayout)),QS=hS((e=>e(KS)?.properties)),eC=hS((e=>{const t=e(KS)?.layout;return t?.qHyperCube.qDimensionInfo.filter(VS)??[]})),tC=hS((e=>{const t=e(KS)?.layout;return t?.qHyperCube.qMeasureInfo.filter(VS)??[]})),nC=hS((e=>{const t=e(JS),n=e(eC),r=e(tC),i=e(QS),o=new Map;return t&&i?(n.forEach(((e,t)=>{o.set(e.cId,{id:e.cId,type:"dimension",def:i.qHyperCubeDef.qDimensions[t]})})),r.forEach(((e,t)=>{o.set(e.cId,{id:e.cId,type:"measure",def:i.qHyperCubeDef.qMeasures[t]})})),i.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.forEach((e=>{o.set(e.qDef.cId,{id:e.qDef.cId,type:"dimension",def:e})})),i.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures.forEach((e=>{o.set(e.qDef.cId,{id:e.qDef.cId,type:"measure",def:e})})),o):o})),rC=hS((e=>{const t=[...e(eC),...e(tC)].map((e=>e.cId));return new Set(t)})),iC=hS(new Set),oC=hS(new Set),aC=hS((e=>{const t=e(iC),n=e(oC);return e(rC).difference(n).union(t)})),sC=TS(((e,t)=>{e(rC),t(iC,new Set),t(oC,new Set)})),lC=hS((e=>e(aC)),((e,t,n)=>{const r=e(aC).has(n);if(r){const r=new Set(e(oC));r.add(n),t(oC,r)}else{const r=new Set(e(iC));r.add(n),t(iC,r)}jS({type:r?"unchecked":"checked",cId:n,handler:e(FS),model:e(zS),fieldInfo:e(nC)})})),cC=({props:e,children:t})=>(function(e){const t=yS(),n=PS(t);for(const[r,...i]of e)n.has(r)||(n.add(r),t.set(r,...i))}([[zS,e.args.model],[WS,e.args.apis],[FS,e.args.handler]]),ES(sC),t);function uC(e){return"init"in e}function dC(e){return!!e.write}function hC(e){return"v"in e||"e"in e}function pC(e){if("e"in e)throw e.e;if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v}const fC=new WeakMap;function mC(e){var t;return yC(e)&&!!(null==(t=fC.get(e))?void 0:t[0])}function gC(e,t){let n=fC.get(e);if(!n){n=[!0,new Set],fC.set(e,n);const t=()=>{n[0]=!1};e.then(t,t)}n[1].add(t)}function yC(e){return"function"==typeof(null==e?void 0:e.then)}function vC(e,t,n){if(!n.p.has(e)){n.p.add(e);const r=()=>n.p.delete(e);t.then(r,r)}}function bC(e,t,n){var r;const i=new Set;for(const t of(null==(r=n.get(e))?void 0:r.t)||[])n.has(t)&&i.add(t);for(const e of t.p)i.add(e);return i}const xC=(e,t,...n)=>t.read(...n),wC=(e,t,...n)=>t.write(...n),SC=(e,t)=>{var n;return null==(n=t.unstable_onInit)?void 0:n.call(t,e)},CC=(e,t,n)=>{var r;return null==(r=t.onMount)?void 0:r.call(t,n)},MC=(e,t)=>{const n=jC(e),r=n[0],i=n[9];if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!t)throw new Error("Atom is undefined or null");let o=r.get(t);return o||(o={d:new Map,p:new Set,n:0},r.set(t,o),null==i||i(e,t)),o},kC=e=>{const t=jC(e),n=t[1],r=t[3],i=t[4],o=t[5],a=t[6],s=t[13],l=[],c=e=>{try{e()}catch(e){l.push(e)}};do{a.f&&c(a.f);const t=new Set,l=t.add.bind(t);r.forEach((e=>{var t;return null==(t=n.get(e))?void 0:t.l.forEach(l)})),r.clear(),o.forEach(l),o.clear(),i.forEach(l),i.clear(),t.forEach(c),r.size&&s(e)}while(r.size||o.size||i.size);if(l.length)throw new AggregateError(l)},EC=e=>{const t=jC(e),n=t[1],r=t[2],i=t[3],o=t[11],a=t[14],s=t[17],l=[],c=new WeakSet,u=new WeakSet,d=Array.from(i);for(;d.length;){const t=d[d.length-1],i=o(e,t);if(u.has(t))d.pop();else if(c.has(t)){if(r.get(t)===i.n)l.push([t,i]);else if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&r.has(t))throw new Error("[Bug] invalidated atom exists");u.add(t),d.pop()}else{c.add(t);for(const e of bC(t,i,n))c.has(e)||d.push(e)}}for(let t=l.length-1;t>=0;--t){const[n,o]=l[t];let c=!1;for(const e of o.d.keys())if(e!==n&&i.has(e)){c=!0;break}c&&(a(e,n),s(e,n)),r.delete(n)}},_C=(e,t)=>{var n,r;const i=jC(e),o=i[1],a=i[2],s=i[3],l=i[6],c=i[7],u=i[11],d=i[12],h=i[13],p=i[14],f=i[16],m=i[17],g=u(e,t);if(hC(g)){if(o.has(t)&&a.get(t)!==g.n)return g;if(Array.from(g.d).every((([t,n])=>p(e,t).n===n)))return g}g.d.clear();let y,v,b=!0;function x(){o.has(t)&&(m(e,t),h(e),d(e))}const w={get signal(){return y||(y=new AbortController),y.signal},get setSelf(){return"production"===(import.meta.env?import.meta.env.MODE:void 0)||dC(t)||console.warn("setSelf function cannot be used with read-only atom"),!v&&dC(t)&&(v=(...n)=>{if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&b&&console.warn("setSelf function cannot be called in sync"),!b)try{return f(e,t,...n)}finally{h(e),d(e)}}),v}},S=g.n;try{const r=c(e,t,(function(n){var r;if(n===t){const t=u(e,n);if(!hC(t)){if(!uC(n))throw new Error("no atom init");OC(e,n,n.init)}return pC(t)}const i=p(e,n);try{return pC(i)}finally{g.d.set(n,i.n),mC(g.v)&&vC(t,g.v,i),null==(r=o.get(n))||r.t.add(t),b||x()}}),w);return OC(e,t,r),yC(r)&&(gC(r,(()=>null==y?void 0:y.abort())),r.then(x,x)),null==(n=l.r)||n.call(l,t),g}catch(e){return delete g.v,g.e=e,++g.n,g}finally{b=!1,S!==g.n&&a.get(t)===S&&(a.set(t,g.n),s.add(t),null==(r=l.c)||r.call(l,t))}},RC=(e,t)=>{const n=jC(e),r=n[1],i=n[2],o=n[11],a=[t];for(;a.length;){const t=a.pop(),n=o(e,t);for(const s of bC(t,n,r)){const t=o(e,s);i.set(s,t.n),a.push(s)}}},IC=(e,t,...n)=>{const r=jC(e),i=r[3],o=r[6],a=r[8],s=r[11],l=r[12],c=r[13],u=r[14],d=r[15],h=r[17];let p=!0;const f=t=>pC(u(e,t)),m=(n,...r)=>{var a;const u=s(e,n);try{if(n===t){if(!uC(n))throw new Error("atom not writable");const t=u.n,s=r[0];return OC(e,n,s),h(e,n),void(t!==u.n&&(i.add(n),null==(a=o.c)||a.call(o,n),d(e,n)))}return IC(e,n,...r)}finally{p||(c(e),l(e))}};try{return a(e,t,f,m,...n)}finally{p=!1}},DC=(e,t)=>{var n;const r=jC(e),i=r[1],o=r[3],a=r[6],s=r[11],l=r[15],c=r[18],u=r[19],d=s(e,t),h=i.get(t);if(h&&!mC(d.v)){for(const[r,i]of d.d)if(!h.d.has(r)){const u=s(e,r);c(e,r).t.add(t),h.d.add(r),i!==u.n&&(o.add(r),null==(n=a.c)||n.call(a,r),l(e,r))}for(const n of h.d||[])if(!d.d.has(n)){h.d.delete(n);const r=u(e,n);null==r||r.t.delete(t)}}},AC=(e,t)=>{var n;const r=jC(e),i=r[1],o=r[4],a=r[6],s=r[10],l=r[11],c=r[12],u=r[13],d=r[14],h=r[16],p=l(e,t);let f=i.get(t);if(!f){d(e,t);for(const n of p.d.keys()){AC(e,n).t.add(t)}if(f={l:new Set,d:new Set(p.d.keys()),t:new Set},i.set(t,f),null==(n=a.m)||n.call(a,t),dC(t)){const n=()=>{let n=!0;const r=(...r)=>{try{return h(e,t,...r)}finally{n||(u(e),c(e))}};try{const i=s(e,t,r);i&&(f.u=()=>{n=!0;try{i()}finally{n=!1}})}finally{n=!1}};o.add(n)}}return f},PC=(e,t)=>{var n;const r=jC(e),i=r[1],o=r[5],a=r[6],s=r[11],l=r[19],c=s(e,t);let u=i.get(t);if(!u||u.l.size||Array.from(u.t).some((e=>{var n;return null==(n=i.get(e))?void 0:n.d.has(t)})))return u;u.u&&o.add(u.u),u=void 0,i.delete(t),null==(n=a.u)||n.call(a,t);for(const n of c.d.keys()){const r=l(e,n);null==r||r.t.delete(t)}},OC=(e,t,n)=>{const r=jC(e)[11],i=r(e,t),o="v"in i,a=i.v;if(yC(n))for(const o of i.d.keys())vC(t,n,r(e,o));i.v=n,delete i.e,o&&Object.is(a,i.v)||(++i.n,yC(a)&&function(e){const t=fC.get(e);(null==t?void 0:t[0])&&(t[0]=!1,t[1].forEach((e=>e())))}(a))},TC=(e,t)=>pC((0,jC(e)[14])(e,t)),LC=(e,t,...n)=>{const r=jC(e),i=r[12],o=r[13],a=r[16];try{return a(e,t,...n)}finally{o(e),i(e)}},qC=(e,t,n)=>{const r=jC(e),i=r[12],o=r[18],a=r[19],s=o(e,t).l;return s.add(n),i(e),()=>{s.delete(n),a(e,t),i(e)}},NC=new WeakMap,jC=e=>{const t=NC.get(e);if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!t)throw new Error("Store must be created by buildStore to read its building blocks");return t};let zC,FC=0;function WC(e,t){const n="atom"+ ++FC,r={toString(){return"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&this.debugLabel?n+":"+this.debugLabel:n}};return"function"==typeof e?r.read=e:(r.init=e,r.read=$C,r.write=BC),r}function $C(e){return e(this)}function BC(e,t,n){return t(this,"function"==typeof n?n(e(this)):n)}function HC(){return function(...e){const t={get:e=>(0,jC(t)[21])(t,e),set:(e,...n)=>(0,jC(t)[22])(t,e,...n),sub:(e,n)=>(0,jC(t)[23])(t,e,n)},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},xC,wC,SC,CC,MC,kC,EC,_C,RC,IC,DC,AC,PC,OC,TC,LC,qC,void 0].map(((t,n)=>e[n]||t));return NC.set(t,Object.freeze(n)),t}()}const VC=s(void 0);function GC(e){return d(VC)||(zC||(zC=HC(),"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=zC),globalThis.__JOTAI_DEFAULT_STORE__!==zC&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),zC)}function UC({children:e,store:t}){const r=a(void 0);return t||r.current||(r.current=HC()),n(VC.Provider,{value:t||r.current},e)}const YC=e=>"function"==typeof(null==e?void 0:e.then),KC=e=>{e.status||(e.status="pending",e.then((t=>{e.status="fulfilled",e.value=t}),(t=>{e.status="rejected",e.reason=t})))},XC=t.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(KC(e),e)}),JC=new WeakMap,ZC=(e,t)=>{let n=JC.get(e);return n||(n=new Promise(((r,i)=>{let o=e;const a=e=>t=>{o===e&&r(t)},s=e=>t=>{o===e&&i(t)},l=()=>{try{const e=t();YC(e)?(JC.set(e,n),o=e,e.then(a(e),s(e)),gC(e,l)):r(e)}catch(e){i(e)}};e.then(a(e),s(e)),gC(e,l)})),JC.set(e,n)),n};function QC(e,n){const{delay:r,unstable_promiseStatus:i=!t.use}={},o=GC(),[[a,s,d],h]=l((t=>{const n=o.get(e);return Object.is(t[0],n)&&t[1]===o&&t[2]===e?t:[n,o,e]}),void 0,(()=>[o.get(e),o,e]));let p=a;if(s===o&&d===e||(h(),p=o.get(e)),c((()=>{const t=o.sub(e,(()=>{if(i)try{const t=o.get(e);YC(t)&&KC(ZC(t,(()=>o.get(e))))}catch(e){}"number"!=typeof r?h():setTimeout(h,r)}));return h(),t}),[o,e,r,i]),u(p),YC(p)){const t=ZC(p,(()=>o.get(e)));return i&&KC(t),XC(t)}return p}Symbol("production"!==(import.meta.env?import.meta.env.MODE:void 0)?"RESET":"");!function(e=()=>{try{return window.localStorage}catch(e){return void("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&"undefined"!=typeof window&&console.warn(e))}},t){var n;let r,i;const o={getItem:(n,o)=>{var a,s;const l=e=>{if(r!==(e=e||"")){try{i=JSON.parse(e,null==t?void 0:t.reviver)}catch(e){return o}r=e}return i},c=null!=(s=null==(a=e())?void 0:a.getItem(n))?s:null;return(e=>"function"==typeof(null==e?void 0:e.then))(c)?c.then(l):l(c)},setItem:(t,n)=>{var r;return null==(r=e())?void 0:r.setItem(t,JSON.stringify(n,void 0))},removeItem:t=>{var n;return null==(n=e())?void 0:n.removeItem(t)}};let a;try{a=null==(n=e())?void 0:n.subscribe}catch(e){}var s;!a&&"undefined"!=typeof window&&"function"==typeof window.addEventListener&&window.Storage&&(a=(t,n)=>{if(!(e()instanceof window.Storage))return()=>{};const r=r=>{r.storageArea===e()&&r.key===t&&n(r.newValue)};return window.addEventListener("storage",r),()=>{window.removeEventListener("storage",r)}}),a&&(o.subscribe=(s=a,(e,t,n)=>s(e,(e=>{let r;try{r=JSON.parse(e||"")}catch(e){r=n}t(r)}))))}();const eM=new WeakMap;const tM=e=>{let t=eM.get(e);return t||(t=new WeakSet,eM.set(e,t)),t},nM=({itemIndex:e,sectionIndex:t})=>void 0!==e?`${t}-${e}`:`${t}`,rM=WC(),iM=WC((e=>e(rM)?.numberOfSections??0)),oM=WC((e=>e(rM)?.numberOfItemsInSection??(()=>0))),aM=WC((e=>e(rM)?.keyExtractor??nM)),sM=WC((e=>e(rM)?.emptyTexts??(()=>({title:"No items",message:"There are no items to display."})))),lM=WC((e=>e(rM)?.onDragOver)),cM=WC((e=>{const t=e(rM)?.children;return Array.isArray(t)?t[1]:t})),uM=WC((e=>{const t=e(rM)?.children;if(Array.isArray(t))return t[0]})),dM=WC((e=>e(rM)?.onClick)),hM=({props:e,children:t})=>(function(e){const t=GC(),n=tM(t);for(const[r,...i]of e)n.has(r)||(n.add(r),t.set(r,...i))}([[rM,e]]),t);var pM=Symbol.for("preact-signals");function fM(){if(bM>1)bM--;else{for(var e,t=!1;void 0!==vM;){var n=vM;for(vM=void 0,xM++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&kM(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(xM=0,bM--,t)throw e}}function mM(e){if(bM>0)return e();bM++;try{return e()}finally{fM()}}var gM=void 0;function yM(e){var t=gM;gM=void 0;try{return e()}finally{gM=t}}var vM=void 0,bM=0,xM=0,wM=0;function SM(e){if(void 0!==gM){var t=e.n;if(void 0===t||t.t!==gM)return t={i:0,S:e,p:gM.s,n:void 0,t:gM,e:void 0,x:void 0,r:t},void 0!==gM.s&&(gM.s.n=t),gM.s=t,e.n=t,32&gM.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=gM.s,t.n=void 0,gM.s.n=t,gM.s=t),t}}function CM(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function MM(e,t){return new CM(e,t)}function kM(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function EM(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function _M(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function RM(e,t){CM.call(this,void 0),this.x=e,this.s=void 0,this.g=wM-1,this.f=4,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function IM(e,t){return new RM(e,t)}function DM(e){var t=e.u;if(e.u=void 0,"function"==typeof t){bM++;var n=gM;gM=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,AM(e),t}finally{gM=n,fM()}}}function AM(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,DM(e)}function PM(e){if(gM!==this)throw new Error("Out-of-order effect");_M(this),gM=e,this.f&=-2,8&this.f&&AM(this),fM()}function OM(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=null==t?void 0:t.name}function TM(e,t){var n=new OM(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}CM.prototype.brand=pM,CM.prototype.h=function(){return!0},CM.prototype.S=function(e){var t=this,n=this.t;n!==e&&void 0===e.e&&(e.x=n,this.t=e,void 0!==n?n.e=e:yM((function(){var e;null==(e=t.W)||e.call(t)})))},CM.prototype.U=function(e){var t=this;if(void 0!==this.t){var n=e.e,r=e.x;void 0!==n&&(n.x=r,e.e=void 0),void 0!==r&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,void 0===r&&yM((function(){var e;null==(e=t.Z)||e.call(t)})))}},CM.prototype.subscribe=function(e){var t=this;return TM((function(){var n=t.value,r=gM;gM=void 0;try{e(n)}finally{gM=r}}),{name:"sub"})},CM.prototype.valueOf=function(){return this.value},CM.prototype.toString=function(){return this.value+""},CM.prototype.toJSON=function(){return this.value},CM.prototype.peek=function(){var e=gM;gM=void 0;try{return this.value}finally{gM=e}},Object.defineProperty(CM.prototype,"value",{get:function(){var e=SM(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(xM>100)throw new Error("Cycle detected");this.v=e,this.i++,wM++,bM++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{fM()}}}}),RM.prototype=new CM,RM.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===wM)return!0;if(this.g=wM,this.f|=1,this.i>0&&!kM(this))return this.f&=-2,!0;var e=gM;try{EM(this),gM=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return gM=e,_M(this),this.f&=-2,!0},RM.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}CM.prototype.S.call(this,e)},RM.prototype.U=function(e){if(void 0!==this.t&&(CM.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},RM.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(RM.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=SM(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),OM.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.u=t)}finally{e()}},OM.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,DM(this),EM(this),bM++;var e=gM;return gM=this,PM.bind(this,e)},OM.prototype.N=function(){2&this.f||(this.f|=2,this.o=vM,vM=this)},OM.prototype.d=function(){this.f|=8,1&this.f||AM(this)},OM.prototype.dispose=function(){this.d()};var LM,qM,NM,jM,zM,FM,WM,$M,BM,HM,VM,GM,UM,YM,KM,XM,JM,ZM,QM,ek,tk=Object.create,nk=Object.defineProperty,rk=Object.defineProperties,ik=Object.getOwnPropertyDescriptor,ok=Object.getOwnPropertyDescriptors,ak=Object.getOwnPropertySymbols,sk=Object.prototype.hasOwnProperty,lk=Object.prototype.propertyIsEnumerable,ck=e=>{throw TypeError(e)},uk=(e,t,n)=>t in e?nk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dk=(e,t)=>nk(e,"name",{value:t,configurable:!0}),hk=["class","method","getter","setter","accessor","field","value","get","set"],pk=e=>void 0!==e&&"function"!=typeof e?ck("Function expected"):e,fk=(e,t,n,r,i)=>({kind:hk[e],name:t,metadata:r,addInitializer:e=>n._?ck("Already initialized"):i.push(pk(e||null))}),mk=(e,t)=>{return uk(t,(n="metadata",(r=Symbol[n])?r:Symbol.for("Symbol."+n)),e[3]);var n,r},gk=(e,t,n,r)=>{for(var i=0,o=e[t>>1],a=o&&o.length;i<a;i++)1&t?o[i].call(n):r=o[i].call(n,r);return r},yk=(e,t,n,r,i,o)=>{var a,s,l,c,u,d=7&t,h=!!(8&t),p=!!(16&t),f=d>3?e.length+1:d?h?1:2:0,m=hk[d+5],g=d>3&&(e[f-1]=[]),y=e[f]||(e[f]=[]),v=d&&(!p&&!h&&(i=i.prototype),d<5&&(d>3||!p)&&ik(d<4?i:{get[n](){return xk(this,o)},set[n](e){return Sk(this,o,e)}},n));d?p&&d<4&&dk(o,(d>2?"set ":d>1?"get ":"")+n):dk(i,n);for(var b=r.length-1;b>=0;b--)c=fk(d,n,l={},e[3],y),d&&(c.static=h,c.private=p,u=c.access={has:p?e=>bk(i,e):e=>n in e},3^d&&(u.get=p?e=>(1^d?xk:Ck)(e,i,4^d?o:v.get):e=>e[n]),d>2&&(u.set=p?(e,t)=>Sk(e,i,t,4^d?o:v.set):(e,t)=>e[n]=t)),s=(0,r[b])(d?d<4?p?o:v[m]:d>4?void 0:{get:v.get,set:v.set}:i,c),l._=1,4^d||void 0===s?pk(s)&&(d>4?g.unshift(s):d?p?o=s:v[m]=s:i=s):"object"!=typeof s||null===s?ck("Object expected"):(pk(a=s.get)&&(v.get=a),pk(a=s.set)&&(v.set=a),pk(a=s.init)&&g.unshift(a));return d||mk(e,i),v&&nk(i,n,v),p?4^d?o:v:i},vk=(e,t,n)=>t.has(e)||ck("Cannot "+n),bk=(e,t)=>Object(t)!==t?ck('Cannot use the "in" operator on this value'):e.has(t),xk=(e,t,n)=>(vk(e,t,"read from private field"),n?n.call(e):t.get(e)),wk=(e,t,n)=>t.has(e)?ck("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Sk=(e,t,n,r)=>(vk(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ck=(e,t,n)=>(vk(e,t,"access private method"),n);function Mk(e,t){if(t){let n;return IM((()=>{const r=e();return r&&n&&t(n,r)?n:(n=r,r)}))}return IM(e)}function kk(e,t){if(Object.is(e,t))return!0;if(null===e||null===t)return!1;if("function"==typeof e&&"function"==typeof t)return e===t;if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;const n=e.some(((e,n)=>!kk(e,t[n])));return!n}if("object"==typeof e&&"object"==typeof t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const i=n.some((n=>!kk(e[n],t[n])));return!i}return!1}function Ek({get:e},t){return{init:e=>MM(e),get(){return e.call(this).value},set(t){const n=e.call(this);n.peek()!==t&&(n.value=t)}}}function _k(e,t){const n=new WeakMap;return function(){let t=n.get(this);return t||(t=Mk(e.bind(this)),n.set(this,t)),t.value}}function Rk(e=!0){return function(t,n){n.addInitializer((function(){const t="field"===n.kind||n.static?this:Object.getPrototypeOf(this),r=Object.getOwnPropertyDescriptor(t,n.name);r&&Object.defineProperty(t,n.name,((e,t)=>rk(e,ok(t)))(((e,t)=>{for(var n in t||(t={}))sk.call(t,n)&&uk(e,n,t[n]);if(ak)for(var n of ak(t))lk.call(t,n)&&uk(e,n,t[n]);return e})({},r),{enumerable:e}))}))}}function Ik(...e){const t=e.map((e=>TM(e)));return()=>t.forEach((e=>e()))}FM=[Ek],zM=[Ek],jM=[Ek],NM=[Rk()],qM=[Rk()],LM=[Rk()];var Dk,Ak=class{constructor(e,t=Object.is){this.defaultValue=e,this.equals=t,gk(WM,5,this),wk(this,GM),wk(this,$M,gk(WM,8,this)),gk(WM,11,this),wk(this,UM,gk(WM,12,this)),gk(WM,15,this),wk(this,JM,gk(WM,16,this)),gk(WM,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return xk(this,GM,QM)}get initial(){return xk(this,GM,HM)}get previous(){return xk(this,GM,KM)}set current(e){const t=yM((()=>xk(this,GM,QM)));e&&t&&this.equals(t,e)||mM((()=>{xk(this,GM,HM)||Sk(this,GM,e,VM),Sk(this,GM,t,XM),Sk(this,GM,e,ek)}))}reset(e=this.defaultValue){mM((()=>{Sk(this,GM,void 0,XM),Sk(this,GM,e,VM),Sk(this,GM,e,ek)}))}};function Pk(e){return yM((()=>{const t={};for(const n in e)t[n]=e[n];return t}))}WM=[,,,tk(null)],$M=new WeakMap,GM=new WeakSet,UM=new WeakMap,JM=new WeakMap,BM=yk(WM,20,"#initial",FM,GM,$M),HM=BM.get,VM=BM.set,YM=yk(WM,20,"#previous",zM,GM,UM),KM=YM.get,XM=YM.set,ZM=yk(WM,20,"#current",jM,GM,JM),QM=ZM.get,ek=ZM.set,yk(WM,2,"current",NM,Ak),yk(WM,2,"initial",qM,Ak),yk(WM,2,"previous",LM,Ak),mk(WM,Ak);Dk=new WeakMap;var Ok,Tk,Lk,qk,Nk,jk=Object.create,zk=Object.defineProperty,Fk=Object.getOwnPropertyDescriptor,Wk=Object.getOwnPropertySymbols,$k=Object.prototype.hasOwnProperty,Bk=Object.prototype.propertyIsEnumerable,Hk=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Vk=e=>{throw TypeError(e)},Gk=Math.pow,Uk=(e,t,n)=>t in e?zk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Yk=["class","method","getter","setter","accessor","field","value","get","set"],Kk=e=>void 0!==e&&"function"!=typeof e?Vk("Function expected"):e,Xk=(e,t,n,r,i)=>({kind:Yk[e],name:t,metadata:r,addInitializer:e=>n._?Vk("Already initialized"):i.push(Kk(e||null))}),Jk=(e,t,n,r,i,o)=>{for(var a,s,l,c,u=7&t,d=Yk[u+5],h=e[2]||(e[2]=[]),p=(i=i.prototype,Fk(i,n)),f=r.length-1;f>=0;f--)(l=Xk(u,n,s={},e[3],h)).static=false,l.private=false,c=l.access={has:e=>n in e},c.get=e=>e[n],a=(0,r[f])(p[d],l),s._=1,Kk(a)&&(p[d]=a);return p&&zk(i,n,p),i},Zk=(e,t,n)=>t.has(e)||Vk("Cannot "+n),Qk=class e{constructor(e,t){this.x=e,this.y=t}static delta(t,n){return new e(t.x-n.x,t.y-n.y)}static distance(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}static equals(e,t){return e.x===t.x&&e.y===t.y}static from({x:t,y:n}){return new e(t,n)}},eE=class e{constructor(e,t,n,r){this.left=e,this.top=t,this.width=n,this.height=r,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(t,n){const{top:r,left:i,width:o,height:a,scale:s}=this,l=new e(i+t,r+n,o,a);return l.scale=((e,t)=>{for(var n in t||(t={}))$k.call(t,n)&&Uk(e,n,t[n]);if(Wk)for(var n of Wk(t))Bk.call(t,n)&&Uk(e,n,t[n]);return e})({},s),l}get boundingRectangle(){const{width:e,height:t,left:n,top:r,right:i,bottom:o}=this;return{width:e,height:t,left:n,top:r,right:i,bottom:o}}get center(){const{left:e,top:t,right:n,bottom:r}=this;return new Qk((e+n)/2,(t+r)/2)}get area(){const{width:e,height:t}=this;return e*t}equals(t){if(!(t instanceof e))return!1;const{left:n,top:r,width:i,height:o}=this;return n===t.left&&r===t.top&&i===t.width&&o===t.height}containsPoint(e){const{top:t,left:n,bottom:r,right:i}=this;return t<=e.y&&e.y<=r&&n<=e.x&&e.x<=i}intersectionArea(t){return t instanceof e?function(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),a=i-r,s=o-n;if(r<i&&n<o){return a*s}return 0}(this,t):0}intersectionRatio(e){const{area:t}=this,n=this.intersectionArea(e);return n/(e.area+t-n)}get bottom(){const{top:e,height:t}=this;return e+t}get right(){const{left:e,width:t}=this;return e+t}get aspectRatio(){const{width:e,height:t}=this;return e/t}get corners(){return[{x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.left,y:this.bottom},{x:this.right,y:this.bottom}]}static from({top:t,left:n,width:r,height:i}){return new e(n,t,r,i)}static delta(e,t,n={x:"center",y:"center"}){const r=(e,t)=>{const r=n[t],i="x"===t?e.left:e.top,o="x"===t?e.width:e.height;return"start"==r?i:"end"==r?i+o:i+o/2};return Qk.delta({x:r(e,"x"),y:r(e,"y")},{x:r(t,"x"),y:r(t,"y")})}static intersectionRatio(t,n){return e.from(t).intersectionRatio(e.from(n))}};var tE,nE=class extends(Lk=Ak,Tk=[_k],Ok=[_k],Lk){constructor(e){super(Qk.from(e),((e,t)=>Qk.equals(e,t))),((e,t,n)=>{for(var r=0,i=e[t>>1],o=i&&i.length;r<o;r++)i[r].call(n)})(Nk,5,this),((e,t,n)=>{t.has(e)?Vk("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n)})(this,qk,0),this.velocity={x:0,y:0}}get delta(){return Qk.delta(this.current,this.initial)}get direction(){const{current:e,previous:t}=this;if(!t)return null;const n={x:e.x-t.x,y:e.y-t.y};return n.x||n.y?Math.abs(n.x)>Math.abs(n.y)?n.x>0?"right":"left":n.y>0?"down":"up":null}get current(){return super.current}set current(e){const{current:t}=this,n=Qk.from(e),r={x:n.x-t.x,y:n.y-t.y},i=Date.now(),o=i-(Zk(a=this,s=qk,"read from private field"),s.get(a));var a,s;const l=e=>Math.round(e/o*100);mM((()=>{((e,t,n)=>{Zk(e,t,"write to private field"),t.set(e,n)})(this,qk,i),this.velocity={x:l(r.x),y:l(r.y)},super.current=n}))}reset(e=this.defaultValue){super.reset(Qk.from(e)),this.velocity={x:0,y:0}}};function rE({x:e,y:t},n){const r=Math.abs(e),i=Math.abs(t);return"number"==typeof n?Math.sqrt(Gk(r,2)+Gk(i,2))>n:"x"in n&&"y"in n?r>n.x&&i>n.y:"x"in n?r>n.x:"y"in n&&i>n.y}Nk=(e=>{var t;return[,,,jk(null!=(t=null==e?void 0:e[Hk("metadata")])?t:null)]})(Lk),qk=new WeakMap,Jk(Nk,2,"delta",Tk,nE),Jk(Nk,2,"direction",Ok,nE),tE=Nk,Uk(nE,Hk("metadata"),tE[3]);var iE,oE,aE,sE,lE=(e=>(e.Horizontal="x",e.Vertical="y",e))(lE||{}),cE=Object.values(lE),uE=Object.create,dE=Object.defineProperty,hE=Object.defineProperties,pE=Object.getOwnPropertyDescriptor,fE=Object.getOwnPropertyDescriptors,mE=Object.getOwnPropertySymbols,gE=Object.prototype.hasOwnProperty,yE=Object.prototype.propertyIsEnumerable,vE=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),bE=e=>{throw TypeError(e)},xE=(e,t,n)=>t in e?dE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wE=(e,t)=>{for(var n in t||(t={}))gE.call(t,n)&&xE(e,n,t[n]);if(mE)for(var n of mE(t))yE.call(t,n)&&xE(e,n,t[n]);return e},SE=(e,t)=>hE(e,fE(t)),CE=(e,t)=>dE(e,"name",{value:t,configurable:!0}),ME=(e,t)=>{var n={};for(var r in e)gE.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&mE)for(var r of mE(e))t.indexOf(r)<0&&yE.call(e,r)&&(n[r]=e[r]);return n},kE=e=>{var t;return[,,,uE(null!=(t=null==e?void 0:e[vE("metadata")])?t:null)]},EE=["class","method","getter","setter","accessor","field","value","get","set"],_E=e=>void 0!==e&&"function"!=typeof e?bE("Function expected"):e,RE=(e,t,n,r,i)=>({kind:EE[e],name:t,metadata:r,addInitializer:e=>n._?bE("Already initialized"):i.push(_E(e||null))}),IE=(e,t)=>xE(t,vE("metadata"),e[3]),DE=(e,t,n,r)=>{for(var i=0,o=e[t>>1],a=o&&o.length;i<a;i++)1&t?o[i].call(n):r=o[i].call(n,r);return r},AE=(e,t,n,r,i,o)=>{var a,s,l,c,u,d=7&t,h=!!(8&t),p=!!(16&t),f=d>3?e.length+1:d?h?1:2:0,m=EE[d+5],g=d>3&&(e[f-1]=[]),y=e[f]||(e[f]=[]),v=d&&(!p&&!h&&(i=i.prototype),d<5&&(d>3||!p)&&pE(d<4?i:{get[n](){return TE(this,o)},set[n](e){return qE(this,o,e)}},n));d?p&&d<4&&CE(o,(d>2?"set ":d>1?"get ":"")+n):CE(i,n);for(var b=r.length-1;b>=0;b--)c=RE(d,n,l={},e[3],y),d&&(c.static=h,c.private=p,u=c.access={has:p?e=>OE(i,e):e=>n in e},3^d&&(u.get=p?e=>(1^d?TE:NE)(e,i,4^d?o:v.get):e=>e[n]),d>2&&(u.set=p?(e,t)=>qE(e,i,t,4^d?o:v.set):(e,t)=>e[n]=t)),s=(0,r[b])(d?d<4?p?o:v[m]:d>4?void 0:{get:v.get,set:v.set}:i,c),l._=1,4^d||void 0===s?_E(s)&&(d>4?g.unshift(s):d?p?o=s:v[m]=s:i=s):"object"!=typeof s||null===s?bE("Object expected"):(_E(a=s.get)&&(v.get=a),_E(a=s.set)&&(v.set=a),_E(a=s.init)&&g.unshift(a));return d||IE(e,i),v&&dE(i,n,v),p?4^d?o:v:i},PE=(e,t,n)=>t.has(e)||bE("Cannot "+n),OE=(e,t)=>Object(t)!==t?bE('Cannot use the "in" operator on this value'):e.has(t),TE=(e,t,n)=>(PE(e,t,"read from private field"),n?n.call(e):t.get(e)),LE=(e,t,n)=>t.has(e)?bE("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),qE=(e,t,n,r)=>(PE(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),NE=(e,t,n)=>(PE(e,t,"access private method"),n);function jE(e,t){return{plugin:e,options:t}}function zE(e){return t=>jE(e,t)}function FE(e){return"function"==typeof e?{plugin:e,options:void 0}:e}iE=[Ek];var WE=class{constructor(e,t){this.manager=e,this.options=t,LE(this,aE,DE(oE,8,this,!1)),DE(oE,11,this),LE(this,sE,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return yM((()=>this.disabled))}configure(e){this.options=e}registerEffect(e){const t=TM(e.bind(this));return TE(this,sE).add(t),t}destroy(){TE(this,sE).forEach((e=>e()))}static configure(e){return jE(this,e)}};oE=kE(null),aE=new WeakMap,sE=new WeakMap,AE(oE,4,"disabled",iE,WE,aE),IE(oE,WE);var $E,BE=class extends WE{},HE=class{constructor(e){this.manager=e,this.instances=new Map,LE(this,$E,[])}get values(){return Array.from(this.instances.values())}set values(e){const t=e.map(FE).reduceRight(((e,t)=>e.some((({plugin:e})=>e===t.plugin))?e:[t,...e]),[]),n=t.map((({plugin:e})=>e));for(const e of TE(this,$E))if(!n.includes(e)){if(e.prototype instanceof BE)continue;this.unregister(e)}for(const{plugin:e,options:n}of t)this.register(e,n);qE(this,$E,n)}get(e){return this.instances.get(e)}register(e,t){const n=this.instances.get(e);if(n)return n.options!==t&&(n.options=t),n;const r=new e(this.manager,t);return this.instances.set(e,r),r}unregister(e){const t=this.instances.get(e);t&&(t.destroy(),this.instances.delete(e))}destroy(){for(const e of this.instances.values())e.destroy();this.instances.clear()}};function VE(e,t){return e.priority===t.priority?e.type===t.type?t.value-e.value:t.type-e.type:t.priority-e.priority}$E=new WeakMap;var GE,UE,YE=[],KE=class extends WE{constructor(e){super(e),LE(this,GE),LE(this,UE),this.computeCollisions=this.computeCollisions.bind(this),qE(this,UE,MM(YE)),this.destroy=Ik((()=>{const e=this.computeCollisions(),t=yM((()=>this.manager.dragOperation.position.current));if(e!==YE){const e=TE(this,GE);if(qE(this,GE,t),e&&t.x==e.x&&t.y==e.y)return}else qE(this,GE,void 0);TE(this,UE).value=e}),(()=>{const{dragOperation:e}=this.manager;e.status.initialized&&this.forceUpdate()}))}forceUpdate(e=!0){yM((()=>{e?TE(this,UE).value=this.computeCollisions():qE(this,GE,void 0)}))}computeCollisions(e,t){const{registry:n,dragOperation:r}=this.manager,{source:i,shape:o,status:a}=r;if(!a.initialized||!o)return YE;const s=[],l=[];for(const o of null!=e?e:n.droppables){if(o.disabled)continue;if(i&&!o.accepts(i))continue;const e=null!=t?t:o.collisionDetector;if(!e)continue;l.push(o),o.shape;const n=yM((()=>e({droppable:o,dragOperation:r})));n&&(null!=o.collisionPriority&&(n.priority=o.collisionPriority),s.push(n))}return 0===l.length?YE:(s.sort(VE),s)}get collisions(){return TE(this,UE).value}};GE=new WeakMap,UE=new WeakMap;var XE=class{constructor(){this.registry=new Map}addEventListener(e,t){const{registry:n}=this,r=new Set(n.get(e));return r.add(t),n.set(e,r),()=>this.removeEventListener(e,t)}removeEventListener(e,t){const{registry:n}=this,r=new Set(n.get(e));r.delete(t),n.set(e,r)}dispatch(e,...t){const{registry:n}=this,r=n.get(e);if(r)for(const e of r)e(...t)}},JE=class extends XE{constructor(e){super(),this.manager=e}dispatch(e,t){const n=[t,this.manager];super.dispatch(e,...n)}};function ZE(e,t=!0){let n=!1;return SE(wE({},e),{cancelable:t,get defaultPrevented(){return n},preventDefault(){t&&(n=!0)}})}var QE,e_,t_,n_,r_,i_,o_,a_,s_,l_=class extends BE{constructor(e){super(e);let t=[];this.destroy=Ik((()=>{const{dragOperation:n,collisionObserver:r}=e;n.status.initializing&&(t=[],r.enable())}),(()=>{const{collisionObserver:n,monitor:r}=e,{collisions:i}=n;if(n.isDisabled())return;const o=ZE({collisions:i});if(r.dispatch("collision",o),o.defaultPrevented)return;if(((e,t)=>e.map((({id:e})=>e)).join("")===t.map((({id:e})=>e)).join(""))(i,t))return;t=i;const[a]=i;yM((()=>{var t;(null==a?void 0:a.id)!==(null==(t=e.dragOperation.target)?void 0:t.id)&&(n.disable(),e.actions.setDropTarget(null==a?void 0:a.id).then((()=>{n.enable()})))}))}))}},c_=(e=>(e[e.Lowest=0]="Lowest",e[e.Low=1]="Low",e[e.Normal=2]="Normal",e[e.High=3]="High",e[e.Highest=4]="Highest",e))(c_||{}),u_=(e=>(e[e.Collision=0]="Collision",e[e.ShapeIntersection=1]="ShapeIntersection",e[e.PointerIntersection=2]="PointerIntersection",e))(u_||{});o_=[Ek],i_=[_k],r_=[_k],n_=[_k],t_=[_k],e_=[_k],QE=[_k];var d_=class{constructor(){DE(a_,5,this),LE(this,s_,DE(a_,8,this,"idle")),DE(a_,11,this)}get current(){return this.value}get idle(){return"idle"===this.value}get initializing(){return"initializing"===this.value}get initialized(){const{value:e}=this;return"idle"!==e&&"initialization-pending"!==e}get dragging(){return"dragging"===this.value}get dropped(){return"dropped"===this.value}set(e){this.value=e}};a_=kE(null),s_=new WeakMap,AE(a_,4,"value",o_,d_,s_),AE(a_,2,"current",i_,d_),AE(a_,2,"idle",r_,d_),AE(a_,2,"initializing",n_,d_),AE(a_,2,"initialized",t_,d_),AE(a_,2,"dragging",e_,d_),AE(a_,2,"dropped",QE,d_),IE(a_,d_);var h_,p_,f_,m_,g_,y_,v_,b_,x_,w_=class{constructor(e){this.manager=e}setDragSource(e){const{dragOperation:t}=this.manager;t.sourceIdentifier="string"==typeof e||"number"==typeof e?e:e.id}setDropTarget(e){return yM((()=>{const{dragOperation:t}=this.manager,n=null!=e?e:null;if(t.targetIdentifier===n)return Promise.resolve(!1);t.targetIdentifier=n;const r=ZE({operation:t.snapshot()});return t.status.dragging&&this.manager.monitor.dispatch("dragover",r),this.manager.renderer.rendering.then((()=>r.defaultPrevented))}))}start(e){return yM((()=>{const{dragOperation:t}=this.manager;null!=e.source&&this.setDragSource(e.source);if(!t.source)throw new Error("Cannot start a drag operation without a drag source");if(!t.status.idle)throw new Error("Cannot start a drag operation while another is active");const n=new AbortController,{event:r,coordinates:i}=e;mM((()=>{t.status.set("initialization-pending"),t.shape=null,t.canceled=!1,t.activatorEvent=null!=r?r:null,t.position.reset(i)}));const o=ZE({operation:t.snapshot()});return this.manager.monitor.dispatch("beforedragstart",o),o.defaultPrevented?(t.reset(),n.abort(),n):(t.status.set("initializing"),t.controller=n,this.manager.renderer.rendering.then((()=>{if(n.signal.aborted)return;const{status:e}=t;"initializing"===e.current&&(t.status.set("dragging"),this.manager.monitor.dispatch("dragstart",{nativeEvent:r,operation:t.snapshot(),cancelable:!1}))})),n)}))}move(e){return yM((()=>{var t,n;const{dragOperation:r}=this.manager,{status:i,controller:o}=r;if(!i.dragging||!o||o.signal.aborted)return;const a=ZE({nativeEvent:e.event,operation:r.snapshot(),by:e.by,to:e.to},null==(t=e.cancelable)||t);(null==(n=e.propagate)||n)&&this.manager.monitor.dispatch("dragmove",a),queueMicrotask((()=>{var t,n,i,o,s;if(a.defaultPrevented)return;const l=null!=(s=e.to)?s:{x:r.position.current.x+(null!=(n=null==(t=e.by)?void 0:t.x)?n:0),y:r.position.current.y+(null!=(o=null==(i=e.by)?void 0:i.y)?o:0)};r.position.current=l}))}))}stop(e={}){return yM((()=>{var t,n;const{dragOperation:r}=this.manager,{controller:i}=r;if(!i||i.signal.aborted)return;let o;i.abort();const a=()=>{this.manager.renderer.rendering.then((()=>{r.status.set("dropped");const e=yM((()=>{var e;return"dropping"===(null==(e=r.source)?void 0:e.status)})),t=()=>{r.controller===i&&(r.controller=void 0),r.reset()};if(e){const{source:e}=r,n=TM((()=>{"idle"===(null==e?void 0:e.status)&&(n(),t())}))}else this.manager.renderer.rendering.then(t)}))};r.canceled=null!=(t=e.canceled)&&t,this.manager.monitor.dispatch("dragend",{nativeEvent:e.event,operation:r.snapshot(),canceled:null!=(n=e.canceled)&&n,suspend:()=>{const e={resume:()=>{},abort:()=>{}};return o=new Promise(((t,n)=>{e.resume=t,e.abort=n})),e}}),o?o.then(a).catch((()=>r.reset())):a()}))}};m_=[Ek],f_=[Ek],p_=[Ek],h_=[Ek];var S_=class{constructor(e,t){LE(this,y_,DE(g_,8,this)),DE(g_,11,this),LE(this,v_,DE(g_,12,this)),DE(g_,15,this),LE(this,b_,DE(g_,16,this)),DE(g_,19,this),LE(this,x_,DE(g_,20,this)),DE(g_,23,this);const{effects:n,id:r,data:i={},disabled:o=!1,register:a=!0}=e;let s=r;this.manager=t,this.id=r,this.data=i,this.disabled=o,this.effects=()=>{var e;return[()=>{const{id:e,manager:t}=this;if(e!==s)return null==t||t.registry.register(this),()=>null==t?void 0:t.registry.unregister(this)},...null!=(e=null==n?void 0:n())?e:[]]},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this),this.destroy=this.destroy.bind(this),t&&a&&queueMicrotask(this.register)}register(){var e;return null==(e=this.manager)?void 0:e.registry.register(this)}unregister(){var e;null==(e=this.manager)||e.registry.unregister(this)}destroy(){var e;null==(e=this.manager)||e.registry.unregister(this)}};g_=kE(null),y_=new WeakMap,v_=new WeakMap,b_=new WeakMap,x_=new WeakMap,AE(g_,4,"manager",m_,S_,y_),AE(g_,4,"id",f_,S_,v_),AE(g_,4,"data",p_,S_,b_),AE(g_,4,"disabled",h_,S_,x_),IE(g_,S_);var C_,M_,k_,E_,__,R_,I_,D_,A_,P_,O_,T_,L_,q_,N_,j_,z_,F_,W_,$_,B_,H_,V_,G_,U_=class{constructor(){this.map=MM(new Map),this.cleanupFunctions=new WeakMap,this.register=(e,t)=>{const n=this.map.peek(),r=n.get(e),i=()=>this.unregister(e,t);if(r===t)return i;if(r){const e=this.cleanupFunctions.get(r);null==e||e(),this.cleanupFunctions.delete(r)}const o=new Map(n);o.set(e,t),this.map.value=o;const a=Ik(...t.effects());return this.cleanupFunctions.set(t,a),i},this.unregister=(e,t)=>{const n=this.map.peek();if(n.get(e)!==t)return;const r=this.cleanupFunctions.get(t);null==r||r(),this.cleanupFunctions.delete(t);const i=new Map(n);i.delete(e),this.map.value=i}}[Symbol.iterator](){return this.map.peek().values()}get value(){return this.map.value.values()}has(e){return this.map.value.has(e)}get(e){return this.map.value.get(e)}destroy(){for(const e of this){const t=this.cleanupFunctions.get(e);null==t||t(),e.destroy()}this.map.value=new Map}},Y_=class extends(I_=S_,R_=[Ek],__=[Ek],E_=[Ek],k_=[_k],M_=[_k],C_=[_k],I_){constructor(e,t){var n=e,{modifiers:r,type:i,sensors:o}=n,a=ME(n,["modifiers","type","sensors"]);super(a,t),DE(D_,5,this),LE(this,A_,DE(D_,8,this)),DE(D_,11,this),LE(this,P_,DE(D_,12,this)),DE(D_,15,this),LE(this,O_,DE(D_,16,this,this.isDragSource?"dragging":"idle")),DE(D_,19,this),this.type=i,this.sensors=o,this.modifiers=r,this.alignment=a.alignment}get isDropping(){return"dropping"===this.status&&this.isDragSource}get isDragging(){return"dragging"===this.status&&this.isDragSource}get isDragSource(){var e,t;return(null==(t=null==(e=this.manager)?void 0:e.dragOperation.source)?void 0:t.id)===this.id}};D_=kE(I_),A_=new WeakMap,P_=new WeakMap,O_=new WeakMap,AE(D_,4,"type",R_,Y_,A_),AE(D_,4,"modifiers",__,Y_,P_),AE(D_,4,"status",E_,Y_,O_),AE(D_,2,"isDropping",k_,Y_),AE(D_,2,"isDragging",M_,Y_),AE(D_,2,"isDragSource",C_,Y_),IE(D_,Y_);var K_=class extends(F_=S_,z_=[Ek],j_=[Ek],N_=[Ek],q_=[Ek],L_=[Ek],T_=[_k],F_){constructor(e,t){var n=e,{accept:r,collisionDetector:i,collisionPriority:o,type:a}=n;super(ME(n,["accept","collisionDetector","collisionPriority","type"]),t),DE(W_,5,this),LE(this,$_,DE(W_,8,this)),DE(W_,11,this),LE(this,B_,DE(W_,12,this)),DE(W_,15,this),LE(this,H_,DE(W_,16,this)),DE(W_,19,this),LE(this,V_,DE(W_,20,this)),DE(W_,23,this),LE(this,G_,DE(W_,24,this)),DE(W_,27,this),this.accept=r,this.collisionDetector=i,this.collisionPriority=o,this.type=a}accepts(e){const{accept:t}=this;return!t||("function"==typeof t?t(e):!!e.type&&(Array.isArray(t)?t.includes(e.type):e.type===t))}get isDropTarget(){var e,t;return(null==(t=null==(e=this.manager)?void 0:e.dragOperation.target)?void 0:t.id)===this.id}};W_=kE(F_),$_=new WeakMap,B_=new WeakMap,H_=new WeakMap,V_=new WeakMap,G_=new WeakMap,AE(W_,4,"accept",z_,K_,$_),AE(W_,4,"type",j_,K_,B_),AE(W_,4,"collisionDetector",N_,K_,H_),AE(W_,4,"collisionPriority",q_,K_,V_),AE(W_,4,"shape",L_,K_,G_),AE(W_,2,"isDropTarget",T_,K_),IE(W_,K_);var X_,J_=class extends WE{constructor(e,t){super(e,t),this.manager=e,this.options=t}},Z_=class extends AbortController{constructor(e,t){super(),this.constraints=e,this.onActivate=t,this.activated=!1;for(const t of null!=e?e:[])t.controller=this}onEvent(e){var t;if(!this.activated)if(null==(t=this.constraints)?void 0:t.length)for(const t of this.constraints)t.onEvent(e);else this.activate(e)}activate(e){this.activated||(this.activated=!0,this.onActivate(e))}abort(e){this.activated=!1,super.abort(e)}},Q_=class{constructor(e){this.options=e,LE(this,X_)}set controller(e){qE(this,X_,e),e.signal.addEventListener("abort",(()=>this.abort()))}activate(e){var t;null==(t=TE(this,X_))||t.activate(e)}};X_=new WeakMap;var eR,tR,nR,rR,iR,oR,aR,sR,lR,cR,uR,dR,hR,pR,fR,mR,gR,yR,vR,bR=class extends WE{constructor(e,t){super(e,t),this.manager=e,this.options=t}apply(e){return e.transform}},xR=class{constructor(e){this.draggables=new U_,this.droppables=new U_,this.plugins=new HE(e),this.sensors=new HE(e),this.modifiers=new HE(e)}register(e,t){if(e instanceof Y_)return this.draggables.register(e.id,e);if(e instanceof K_)return this.droppables.register(e.id,e);if(e.prototype instanceof bR)return this.modifiers.register(e,t);if(e.prototype instanceof J_)return this.sensors.register(e,t);if(e.prototype instanceof WE)return this.plugins.register(e,t);throw new Error("Invalid instance type")}unregister(e){if(e instanceof S_)return e instanceof Y_?this.draggables.unregister(e.id,e):e instanceof K_?this.droppables.unregister(e.id,e):()=>{};if(e.prototype instanceof bR)return this.modifiers.unregister(e);if(e.prototype instanceof J_)return this.sensors.unregister(e);if(e.prototype instanceof WE)return this.plugins.unregister(e);throw new Error("Invalid instance type")}destroy(){this.draggables.destroy(),this.droppables.destroy(),this.plugins.destroy(),this.sensors.destroy(),this.modifiers.destroy()}};lR=[_k],sR=[Ek],aR=[Ek],oR=[Ek],iR=[Ek],rR=[Ek],nR=[_k],tR=[_k],eR=[_k];var wR=class{constructor(e){DE(hR,5,this),LE(this,cR),LE(this,uR),LE(this,dR,new Ak(void 0,((e,t)=>e&&t?e.equals(t):e===t))),this.status=new d_,LE(this,pR,DE(hR,8,this,!1)),DE(hR,11,this),LE(this,fR,DE(hR,12,this,null)),DE(hR,15,this),LE(this,mR,DE(hR,16,this,null)),DE(hR,19,this),LE(this,gR,DE(hR,20,this,null)),DE(hR,23,this),LE(this,yR,DE(hR,24,this,[])),DE(hR,27,this),this.position=new nE({x:0,y:0}),LE(this,vR,{x:0,y:0}),qE(this,cR,e)}get shape(){const{current:e,initial:t,previous:n}=TE(this,dR);return e&&t?{current:e,initial:t,previous:n}:null}set shape(e){e?TE(this,dR).current=e:TE(this,dR).reset()}get source(){var e;const t=this.sourceIdentifier;if(null==t)return null;const n=TE(this,cR).registry.draggables.get(t);return n&&qE(this,uR,n),null!=(e=null!=n?n:TE(this,uR))?e:null}get target(){var e;const t=this.targetIdentifier;return null!=t&&null!=(e=TE(this,cR).registry.droppables.get(t))?e:null}get transform(){const{x:e,y:t}=this.position.delta;let n={x:e,y:t};for(const e of this.modifiers)n=e.apply(SE(wE({},this.snapshot()),{transform:n}));return qE(this,vR,n),n}snapshot(){return yM((()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:TE(this,vR),shape:this.shape?Pk(this.shape):null,position:Pk(this.position),status:Pk(this.status),canceled:this.canceled})))}reset(){mM((()=>{this.status.set("idle"),this.sourceIdentifier=null,this.targetIdentifier=null,TE(this,dR).reset(),this.position.reset({x:0,y:0}),qE(this,vR,{x:0,y:0}),this.modifiers=[]}))}};hR=kE(null),cR=new WeakMap,uR=new WeakMap,dR=new WeakMap,pR=new WeakMap,fR=new WeakMap,mR=new WeakMap,gR=new WeakMap,yR=new WeakMap,vR=new WeakMap,AE(hR,2,"shape",lR,wR),AE(hR,4,"canceled",sR,wR,pR),AE(hR,4,"activatorEvent",aR,wR,fR),AE(hR,4,"sourceIdentifier",oR,wR,mR),AE(hR,4,"targetIdentifier",iR,wR,gR),AE(hR,4,"modifiers",rR,wR,yR),AE(hR,2,"source",nR,wR),AE(hR,2,"target",tR,wR),AE(hR,2,"transform",eR,wR),IE(hR,wR);var SR={get rendering(){return Promise.resolve()}},CR=class{constructor(e){this.destroy=()=>{this.dragOperation.status.idle||this.actions.stop({canceled:!0}),this.dragOperation.modifiers.forEach((e=>e.destroy())),this.registry.destroy(),this.collisionObserver.destroy()};const{plugins:t=[],sensors:n=[],modifiers:r=[],renderer:i=SR}=null!=e?e:{},o=new JE(this),a=new xR(this);this.registry=a,this.monitor=o,this.renderer=i,this.actions=new w_(this),this.dragOperation=new wR(this),this.collisionObserver=new KE(this),this.plugins=[l_,...t],this.modifiers=r,this.sensors=n;const{destroy:s}=this,l=Ik((()=>{var e,t,n;const r=yM((()=>this.dragOperation.modifiers)),i=this.modifiers;r!==i&&r.forEach((e=>e.destroy())),this.dragOperation.modifiers=null!=(n=null==(t=null==(e=this.dragOperation.source)?void 0:e.modifiers)?void 0:t.map((e=>{const{plugin:t,options:n}=FE(e);return new t(this,n)})))?n:i}));this.destroy=()=>{l(),s()}}get plugins(){return this.registry.plugins.values}set plugins(e){this.registry.plugins.values=e}get modifiers(){return this.registry.modifiers.values}set modifiers(e){this.registry.modifiers.values=e}get sensors(){return this.registry.sensors.values}set sensors(e){this.registry.sensors.values=e}},MR=e=>{throw TypeError(e)},kR=(e,t,n)=>t.has(e)||MR("Cannot "+n),ER=(e,t,n)=>(kR(e,t,"read from private field"),t.get(e)),_R=(e,t,n)=>t.has(e)?MR("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),RR=(e,t,n,r)=>(kR(e,t,"write to private field"),t.set(e,n),n),IR=(e,t,n)=>(kR(e,t,"access private method"),n);function DR(e){return!!e&&(e instanceof KeyframeEffect||"getKeyframes"in e&&"function"==typeof e.getKeyframes)}function AR(e,t){const n=e.getAnimations();if(n.length>0)for(const e of n){if("running"!==e.playState)continue;const{effect:n}=e,r=(DR(n)?n.getKeyframes():[]).filter(t);if(r.length>0)return[r[r.length-1],e]}return null}function PR(e){const{width:t,height:n,top:r,left:i,bottom:o,right:a}=e.getBoundingClientRect();return{width:t,height:n,top:r,left:i,bottom:o,right:a}}function OR(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function TR(e){return"nodeType"in e}function LR(e){var t,n,r;return e?OR(e)?e:TR(e)?"defaultView"in e?null!=(t=e.defaultView)?t:window:null!=(r=null==(n=e.ownerDocument)?void 0:n.defaultView)?r:window:window:window}function qR(e){const{Document:t}=LR(e);return e instanceof t||"nodeType"in e&&e.nodeType===Node.DOCUMENT_NODE}function NR(e){return!(!e||OR(e))&&(e instanceof LR(e).HTMLElement||"namespaceURI"in e&&"string"==typeof e.namespaceURI&&e.namespaceURI.endsWith("html"))}function jR(e){return e instanceof LR(e).SVGElement||"namespaceURI"in e&&"string"==typeof e.namespaceURI&&e.namespaceURI.endsWith("svg")}function zR(e){return e?OR(e)?e.document:TR(e)?qR(e)?e:NR(e)||jR(e)?e.ownerDocument:document:document:document}function FR(e,t){if(function(e){return"DETAILS"===e.tagName}(e)&&!1===e.open)return!1;const{overflow:n,overflowX:r,overflowY:i}=getComputedStyle(e);return"visible"===n&&"visible"===r&&"visible"===i}function WR(e,t=e.getBoundingClientRect(),n=0){var r;let i=t;const{ownerDocument:o}=e,a=null!=(r=o.defaultView)?r:window;let s=e.parentElement;for(;s&&s!==o.documentElement;){if(!FR(s)){const e=s.getBoundingClientRect(),t=n*(e.bottom-e.top),r=n*(e.right-e.left),o=n*(e.bottom-e.top),a=n*(e.right-e.left);i={top:Math.max(i.top,e.top-t),right:Math.min(i.right,e.right+r),bottom:Math.min(i.bottom,e.bottom+o),left:Math.max(i.left,e.left-a),width:0,height:0},i.width=i.right-i.left,i.height=i.bottom-i.top}s=s.parentElement}const l=a.innerWidth,c=a.innerHeight,u=n*c,d=n*l;return i={top:Math.max(i.top,0-u),right:Math.min(i.right,l+d),bottom:Math.min(i.bottom,c+u),left:Math.max(i.left,0-d),width:0,height:0},i.width=i.right-i.left,i.height=i.bottom-i.top,i.width<0&&(i.width=0),i.height<0&&(i.height=0),i}function $R(e){return{x:e.clientX,y:e.clientY}}var BR="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function HR(e=document,t=new Set){if(t.has(e))return[];t.add(e);const n=[e];for(const r of Array.from(e.querySelectorAll("iframe, frame")))try{const e=r.contentDocument;e&&!t.has(e)&&n.push(...HR(e,t))}catch(e){}try{const r=e.defaultView;if(r&&r!==window.top){const i=r.parent;i&&i.document&&i.document!==e&&n.push(...HR(i.document,t))}}catch(e){}return n}function VR(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function GR(e){return"value"in e}function UR(e){return"CANVAS"===e.tagName}function YR(e,{x:t,y:n}){const r=e.elementFromPoint(t,n);if(function(e){return"IFRAME"===(null==e?void 0:e.tagName)}(r)){const{contentDocument:e}=r;if(e){const{left:i,top:o}=r.getBoundingClientRect();return YR(e,{x:t-i,y:n-o})}}return r}var KR=new WeakMap;var XR=class{constructor(){this.entries=new Set,this.clear=()=>{for(const e of this.entries){const[t,{type:n,listener:r,options:i}]=e;t.removeEventListener(n,r,i)}this.entries.clear()}}bind(e,t){const n=Array.isArray(e)?e:[e],r=Array.isArray(t)?t:[t],i=[];for(const e of n)for(const t of r){const{type:n,listener:r,options:o}=t,a=[e,t];e.addEventListener(n,r,o),this.entries.add(a),i.push(a)}return function(){for(const[e,{type:t,listener:n,options:r}]of i)e.removeEventListener(t,n,r)}}};function JR(e){const t=null==e?void 0:e.ownerDocument.defaultView;if(t&&t.self!==t.parent)return t.frameElement}function ZR(e,t){const n=()=>performance.now();let r,i;return function(...o){const a=this;i?(null==r||r(),r=function(e,t){const n=setTimeout(e,t);return()=>clearTimeout(n)}((()=>{e.apply(a,o),i=n()}),t-(n()-i))):(e.apply(a,o),i=n())}}var QR,eI=BR?ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},tI=class extends eI{constructor(e){super((t=>{ER(this,QR)?e(t,this):RR(this,QR,!0)})),_R(this,QR,!1)}};QR=new WeakMap;var nI,rI,iI,oI,aI,sI,lI,cI,uI,dI,hI,pI=Array.from({length:100},((e,t)=>t/100)),fI=class{constructor(e,t,n={debug:!1,skipInitial:!1}){this.element=e,this.callback=t,_R(this,uI),this.disconnect=()=>{var e,t,n;RR(this,lI,!0),null==(e=ER(this,iI))||e.disconnect(),null==(t=ER(this,oI))||t.disconnect(),ER(this,aI).disconnect(),null==(n=ER(this,sI))||n.remove()},_R(this,nI,!0),_R(this,rI),_R(this,iI),_R(this,oI),_R(this,aI),_R(this,sI),_R(this,lI,!1),_R(this,cI,ZR((()=>{var e,t,n;const{element:r}=this;if(null==(e=ER(this,oI))||e.disconnect(),ER(this,lI)||!ER(this,nI)||!r.isConnected)return;const i=null!=(t=r.ownerDocument)?t:document,{innerHeight:o,innerWidth:a}=null!=(n=i.defaultView)?n:window,s=r.getBoundingClientRect(),l=WR(r,s),{top:c,left:u,bottom:d,right:h}=l,p=-Math.floor(c),f=-Math.floor(u),m=`${p}px ${-Math.floor(a-h)}px ${-Math.floor(o-d)}px ${f}px`;this.boundingClientRect=s,RR(this,oI,new IntersectionObserver((e=>{const[t]=e,{intersectionRect:n}=t;1!==(1!==t.intersectionRatio?t.intersectionRatio:eE.intersectionRatio(n,WR(r)))&&ER(this,cI).call(this)}),{threshold:pI,rootMargin:m,root:i})),ER(this,oI).observe(r),IR(this,uI,dI).call(this)}),75)),this.boundingClientRect=e.getBoundingClientRect(),RR(this,nI,function(e,t=e.getBoundingClientRect()){const{width:n,height:r}=WR(e,t);return n>0&&r>0}(e,this.boundingClientRect));let r=!0;this.callback=e=>{r&&(r=!1,n.skipInitial)||t(e)};const i=e.ownerDocument;(null==n?void 0:n.debug)&&(RR(this,sI,document.createElement("div")),ER(this,sI).style.background="rgba(0,0,0,0.15)",ER(this,sI).style.position="fixed",ER(this,sI).style.pointerEvents="none",i.body.appendChild(ER(this,sI))),RR(this,aI,new IntersectionObserver((t=>{var n,r;const i=t[t.length-1],{boundingClientRect:o,isIntersecting:a}=i,{width:s,height:l}=o,c=ER(this,nI);RR(this,nI,a),(s||l)&&(c&&!a?(null==(n=ER(this,oI))||n.disconnect(),this.callback(null),null==(r=ER(this,iI))||r.disconnect(),RR(this,iI,void 0),ER(this,sI)&&(ER(this,sI).style.visibility="hidden")):ER(this,cI).call(this),a&&!ER(this,iI)&&(RR(this,iI,new tI(ER(this,cI))),ER(this,iI).observe(e)))}),{threshold:pI,root:i})),ER(this,nI)&&!n.skipInitial&&this.callback(this.boundingClientRect),ER(this,aI).observe(e)}};nI=new WeakMap,rI=new WeakMap,iI=new WeakMap,oI=new WeakMap,aI=new WeakMap,sI=new WeakMap,lI=new WeakMap,cI=new WeakMap,uI=new WeakSet,dI=function(){ER(this,lI)||(IR(this,uI,hI).call(this),function(e,t){return e===t||!(!e||!t)&&e.top==t.top&&e.left==t.left&&e.right==t.right&&e.bottom==t.bottom}(this.boundingClientRect,ER(this,rI))||(this.callback(this.boundingClientRect),RR(this,rI,this.boundingClientRect)))},hI=function(){if(ER(this,sI)){const{top:e,left:t,width:n,height:r}=WR(this.element);ER(this,sI).style.overflow="hidden",ER(this,sI).style.visibility="visible",ER(this,sI).style.top=`${Math.floor(e)}px`,ER(this,sI).style.left=`${Math.floor(t)}px`,ER(this,sI).style.width=`${Math.floor(n)}px`,ER(this,sI).style.height=`${Math.floor(r)}px`}};var mI,gI,yI,vI,bI=new WeakMap,xI=new WeakMap;function wI(e,t){let n=bI.get(e);if(!n){const t=new fI(e,(t=>{const n=bI.get(e);n&&n.callbacks.forEach((e=>e(t)))}),{skipInitial:!0});n={disconnect:t.disconnect,callbacks:new Set}}return n.callbacks.add(t),bI.set(e,n),()=>{n.callbacks.delete(t),0===n.callbacks.size&&(bI.delete(e),n.disconnect())}}var SI=class{constructor(e,t,n){this.callback=t,_R(this,mI),_R(this,gI,!1),_R(this,yI),_R(this,vI,ZR((e=>{if(!ER(this,gI)&&e.target&&"contains"in e.target&&"function"==typeof e.target.contains)for(const t of ER(this,yI))if(e.target.contains(t)){this.callback(ER(this,mI).boundingClientRect);break}}),75));const r=function(e){const t=new Set;let n=JR(e);for(;n;)t.add(n),n=JR(n);return t}(e),i=function(e,t){const n=new Set;for(const r of e){const e=wI(r,t);n.add(e)}return()=>n.forEach((e=>e()))}(r,t),o=function(e,t){var n;const r=e.ownerDocument;if(!xI.has(r)){const e=new AbortController,t=new Set;document.addEventListener("scroll",(e=>t.forEach((t=>t(e)))),{capture:!0,passive:!0,signal:e.signal}),xI.set(r,{disconnect:()=>e.abort(),listeners:t})}const{listeners:i,disconnect:o}=null!=(n=xI.get(r))?n:{};return i&&o?(i.add(t),()=>{i.delete(t),0===i.size&&(o(),xI.delete(r))}):()=>{}}(e,ER(this,vI));RR(this,yI,r),RR(this,mI,new fI(e,t,n)),this.disconnect=()=>{ER(this,gI)||(RR(this,gI,!0),i(),o(),ER(this,mI).disconnect())}}};function CI(e){return"showPopover"in e&&"hidePopover"in e&&"function"==typeof e.showPopover&&"function"==typeof e.hidePopover}function MI(e){try{CI(e)&&e.isConnected&&e.hasAttribute("popover")&&!e.matches(":popover-open")&&e.showPopover()}catch(e){}}function kI(e){return!(!BR||!e)&&e===zR(e).scrollingElement}function EI(e){const t=LR(e),n=kI(e)?function(e){const{documentElement:t}=zR(e),n=t.clientWidth,r=t.clientHeight;return{top:0,left:0,right:n,bottom:r,width:n,height:r}}(e):PR(e),r=kI(e)?{height:t.innerHeight,width:t.innerWidth}:{height:e.clientHeight,width:e.clientWidth},i={current:{x:e.scrollLeft,y:e.scrollTop},max:{x:e.scrollWidth-r.width,y:e.scrollHeight-r.height}};return{rect:n,position:i,isTop:i.current.y<=0,isLeft:i.current.x<=0,isBottom:i.current.y>=i.max.y,isRight:i.current.x>=i.max.x}}function _I(e,t){const{isTop:n,isBottom:r,isLeft:i,isRight:o,position:a}=EI(e),{x:s,y:l}=null!=t?t:{x:0,y:0},c=!n&&a.current.y+l>0,u=!r&&a.current.y+l<a.max.y,d=!i&&a.current.x+s>0,h=!o&&a.current.x+s<a.max.x;return{top:c,bottom:u,left:d,right:h,x:d||h,y:c||u}}mI=new WeakMap,gI=new WeakMap,yI=new WeakMap,vI=new WeakMap;var RI=class{constructor(e){this.scheduler=e,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{const{tasks:e,resolvers:t}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(const t of e)t();for(const e of t)e()}}schedule(e){return this.tasks.add(e),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise((e=>this.resolvers.add(e)))}},II=new RI((e=>{"function"==typeof requestAnimationFrame?requestAnimationFrame(e):e()})),DI=new RI((e=>setTimeout(e,50))),AI=new Map,PI=AI.clear.bind(AI);function OI(e,t=!1){if(!t)return TI(e);let n=AI.get(e);return n||(n=TI(e),AI.set(e,n),DI.schedule(PI),n)}function TI(e){return LR(e).getComputedStyle(e)}var LI={excludeElement:!0};function qI(e,t=LI){const{limit:n,excludeElement:r}=t,i=new Set;return e?function t(o){if(null!=n&&i.size>=n)return i;if(!o)return i;if(qR(o)&&null!=o.scrollingElement&&!i.has(o.scrollingElement))return i.add(o.scrollingElement),i;if(!NR(o))return jR(o)?t(o.parentElement):i;if(i.has(o))return i;const a=OI(o,!0);if(r&&o===e||function(e,t=OI(e,!0)){const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some((e=>{const r=t[e];return"string"==typeof r&&n.test(r)}))}(o,a)&&i.add(o),function(e,t=OI(e,!0)){return"fixed"===t.position||"sticky"===t.position}(o,a)){const{scrollingElement:e}=o.ownerDocument;return e&&i.add(e),i}return t(o.parentNode)}(e):i}function NI(e,t=window.frameElement){const n={x:0,y:0,scaleX:1,scaleY:1};if(!e)return n;let r=JR(e);for(;r;){if(r===t)return n;const e=PR(r),{x:i,y:o}=jI(r,e);n.x=n.x+e.left,n.y=n.y+e.top,n.scaleX=n.scaleX*i,n.scaleY=n.scaleY*o,r=JR(r)}return n}function jI(e,t=PR(e)){const n=Math.round(t.width),r=Math.round(t.height);if(NR(e))return{x:n/e.offsetWidth,y:r/e.offsetHeight};const i=OI(e,!0);return{x:(parseFloat(i.width)||n)/n,y:(parseFloat(i.height)||r)/r}}function zI(e){if("none"===e)return null;const[t,n,r="0"]=e.split(" "),i={x:parseFloat(t),y:parseFloat(n),z:parseInt(r,10)};return isNaN(i.x)&&isNaN(i.y)?null:{x:isNaN(i.x)?0:i.x,y:isNaN(i.y)?0:i.y,z:isNaN(i.z)?0:i.z}}function FI(e){var t,n,r,i,o,a,s,l,c;const{scale:u,transform:d,translate:h}=e,p=function(e){if("none"===e)return null;const t=e.split(" "),n=parseFloat(t[0]),r=parseFloat(t[1]);return isNaN(n)&&isNaN(r)?null:{x:isNaN(n)?r:n,y:isNaN(r)?n:r}}(u),f=zI(h),m=function(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(d);if(!m&&!p&&!f)return null;const g=null!=(t=null==p?void 0:p.x)?t:1,y=null!=(n=null==p?void 0:p.y)?n:1,v=null!=(r=null==f?void 0:f.x)?r:0,b=null!=(i=null==f?void 0:f.y)?i:0,x=null!=(o=null==m?void 0:m.x)?o:0,w=null!=(a=null==m?void 0:m.y)?a:0,S=null!=(s=null==m?void 0:m.scaleX)?s:1,C=null!=(l=null==m?void 0:m.scaleY)?l:1;return{x:v+x,y:b+w,z:null!=(c=null==f?void 0:f.z)?c:0,scaleX:g*S,scaleY:y*C}}var WI=(e=>(e[e.Idle=0]="Idle",e[e.Forward=1]="Forward",e[e.Reverse=-1]="Reverse",e))(WI||{}),$I={x:.2,y:.2},BI={x:10,y:10};function HI(e,t,n,r=25,i=$I,o=BI){const{x:a,y:s}=t,{rect:l,isTop:c,isBottom:u,isLeft:d,isRight:h}=EI(e),p=NI(e),f=FI(OI(e,!0)),m=null!==f&&(null==f?void 0:f.scaleX)<0,g=null!==f&&(null==f?void 0:f.scaleY)<0,y=new eE(l.left*p.scaleX+p.x,l.top*p.scaleY+p.y,l.width*p.scaleX,l.height*p.scaleY),v={x:0,y:0},b={x:0,y:0},x=y.height*i.y,w=y.width*i.x;return(!c||g&&!u)&&s<=y.top+x&&1!==(null==n?void 0:n.y)&&a>=y.left-o.x&&a<=y.right+o.x?(v.y=g?1:-1,b.y=r*Math.abs((y.top+x-s)/x)):(!u||g&&!c)&&s>=y.bottom-x&&-1!==(null==n?void 0:n.y)&&a>=y.left-o.x&&a<=y.right+o.x&&(v.y=g?-1:1,b.y=r*Math.abs((y.bottom-x-s)/x)),(!h||m&&!d)&&a>=y.right-w&&-1!==(null==n?void 0:n.x)&&s>=y.top-o.y&&s<=y.bottom+o.y?(v.x=m?-1:1,b.x=r*Math.abs((y.right-w-a)/w)):(!d||m&&!h)&&a<=y.left+w&&1!==(null==n?void 0:n.x)&&s>=y.top-o.y&&s<=y.bottom+o.y&&(v.x=m?1:-1,b.x=r*Math.abs((y.left+w-a)/w)),{direction:v,speed:b}}function VI(e,t=!1){if("scrollIntoViewIfNeeded"in(n=e)&&"function"==typeof n.scrollIntoViewIfNeeded)return void e.scrollIntoViewIfNeeded(t);var n;if(!NR(e))return e.scrollIntoView();var r=function(e){const[t]=qI(e,{limit:1});return null!=t?t:null}(e);if(!NR(r))return;const i=OI(r,!0),o=parseInt(i.getPropertyValue("border-top-width")),a=parseInt(i.getPropertyValue("border-left-width")),s=e.offsetTop-r.offsetTop<r.scrollTop,l=e.offsetTop-r.offsetTop+e.clientHeight-o>r.scrollTop+r.clientHeight,c=e.offsetLeft-r.offsetLeft<r.scrollLeft,u=e.offsetLeft-r.offsetLeft+e.clientWidth-a>r.scrollLeft+r.clientWidth,d=s&&!l;(s||l)&&t&&(r.scrollTop=e.offsetTop-r.offsetTop-r.clientHeight/2-o+e.clientHeight/2),(c||u)&&t&&(r.scrollLeft=e.offsetLeft-r.offsetLeft-r.clientWidth/2-a+e.clientWidth/2),(s||l||c||u)&&!t&&e.scrollIntoView(d)}function GI({element:e,keyframes:t,options:n}){return e.animate(t,n).finished}function UI(e,t=OI(e).translate,n=!0){if(n){const t=AR(e,(e=>"translate"in e));if(t){const{translate:e=""}=t[0];if("string"==typeof e){const t=zI(e);if(t)return t}}}if(t){const e=zI(t);if(e)return e}return{x:0,y:0,z:0}}var YI=new RI((e=>setTimeout(e,0))),KI=new Map,XI=KI.clear.bind(KI);function JI(e,t){const n=function(e){const t=e.ownerDocument;let n=KI.get(t);if(n)return n;n=t.getAnimations(),KI.set(t,n),YI.schedule(XI);const r=n.filter((t=>DR(t.effect)&&t.effect.target===e));return KI.set(e,r),n}(e).filter((e=>{var n,r;if(DR(e.effect)){const{target:i}=e.effect;if(null==(r=i&&(null==(n=t.isValidTarget)?void 0:n.call(t,i)))||r)return e.effect.getKeyframes().some((e=>{for(const n of t.properties)if(e[n])return!0}))}})).map((e=>{const{effect:t,currentTime:n}=e,r=null==t?void 0:t.getComputedTiming().duration;if(!e.pending&&"finished"!==e.playState)return"number"==typeof r&&"number"==typeof n&&n<r?(e.currentTime=r,()=>{e.currentTime=n}):void 0}));if(n.length>0)return()=>n.forEach((e=>null==e?void 0:e()))}var ZI=class extends eE{constructor(e,t={}){var n,r,i,o;const{frameTransform:a=NI(e),ignoreTransforms:s,getBoundingClientRect:l=PR}=t,c=JI(e,{properties:["transform","translate","scale","width","height"],isValidTarget:t=>(t!==e||VR())&&t.contains(e)}),u=l(e);let d,{top:h,left:p,width:f,height:m}=u;const g=OI(e),y=FI(g),v={x:null!=(n=null==y?void 0:y.scaleX)?n:1,y:null!=(r=null==y?void 0:y.scaleY)?r:1},b=function(e,t){var n;const r=e.getAnimations();let i=null;if(!r.length)return null;for(const e of r){if("running"!==e.playState)continue;const r=DR(e.effect)?e.effect.getKeyframes():[],o=r[r.length-1];if(!o)continue;const{transform:a,translate:s,scale:l}=o;if(a||s||l){const e=FI({transform:"string"==typeof a&&a?a:t.transform,translate:"string"==typeof s&&s?s:t.translate,scale:"string"==typeof l&&l?l:t.scale});e&&(i=i?{x:i.x+e.x,y:i.y+e.y,z:null!=(n=i.z)?n:e.z,scaleX:i.scaleX*e.scaleX,scaleY:i.scaleY*e.scaleY}:e)}}return i}(e,g);null==c||c(),y&&(d=function(e,t,n){const{scaleX:r,scaleY:i,x:o,y:a}=t,s=e.left-o-(1-r)*parseFloat(n),l=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),c=r?e.width/r:e.width,u=i?e.height/i:e.height;return{width:c,height:u,top:l,right:s+c,bottom:l+u,left:s}}(u,y,g.transformOrigin),(s||b)&&(h=d.top,p=d.left,f=d.width,m=d.height));const x={width:null!=(i=null==d?void 0:d.width)?i:f,height:null!=(o=null==d?void 0:d.height)?o:m};if(b&&!s&&d){const e=function(e,t,n){const{scaleX:r,scaleY:i,x:o,y:a}=t,s=e.left+o+(1-r)*parseFloat(n),l=e.top+a+(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),c=r?e.width*r:e.width,u=i?e.height*i:e.height;return{width:c,height:u,top:l,right:s+c,bottom:l+u,left:s}}(d,b,g.transformOrigin);h=e.top,p=e.left,f=e.width,m=e.height,v.x=b.scaleX,v.y=b.scaleY}a&&(s||(p*=a.scaleX,f*=a.scaleX,h*=a.scaleY,m*=a.scaleY),p+=a.x,h+=a.y),super(p,h,f,m),this.scale=v,this.intrinsicWidth=x.width,this.intrinsicHeight=x.height}};function QI(e){return"style"in e&&"object"==typeof e.style&&null!==e.style&&"setProperty"in e.style&&"removeProperty"in e.style&&"function"==typeof e.style.setProperty&&"function"==typeof e.style.removeProperty}var eD=class{constructor(e){this.element=e,this.initial=new Map}set(e,t=""){const{element:n}=this;if(QI(n))for(const[r,i]of Object.entries(e)){const e=`${t}${r}`;this.initial.has(e)||this.initial.set(e,n.style.getPropertyValue(e)),n.style.setProperty(e,"string"==typeof i?i:`${i}px`)}}remove(e,t=""){const{element:n}=this;if(QI(n))for(const r of e){const e=`${t}${r}`;n.style.removeProperty(e)}}reset(){const{element:e}=this;if(QI(e)){for(const[t,n]of this.initial)e.style.setProperty(t,n);""===e.getAttribute("style")&&e.removeAttribute("style")}}};function tD(e){return!!e&&(e instanceof LR(e).Element||TR(e)&&e.nodeType===Node.ELEMENT_NODE)}function nD(e){if(!e)return!1;const{KeyboardEvent:t}=LR(e.target);return e instanceof t}var rD={};function iD(e){const t=null==rD[e]?0:rD[e]+1;return rD[e]=t,`${e}-${t}`}var oD=e=>{var t;return null!=(t=(({dragOperation:e,droppable:t})=>{const n=e.position.current;if(!n)return null;const{id:r}=t;if(!t.shape)return null;if(t.shape.containsPoint(n))return{id:r,value:1/Qk.distance(t.shape.center,n),type:u_.PointerIntersection,priority:c_.High};return null})(e))?t:(({dragOperation:e,droppable:t})=>{const{shape:n}=e;if(!t.shape||!(null==n?void 0:n.current))return null;const r=n.current.intersectionArea(t.shape);if(r){const{position:i}=e,o=Qk.distance(t.shape.center,i.current),a=r/(n.current.area+t.shape.area-r)/o;return{id:t.id,value:a,type:u_.ShapeIntersection,priority:c_.Normal}}return null})(e)},aD=e=>{const{dragOperation:t,droppable:n}=e,{shape:r,position:i}=t;if(!n.shape)return null;const o=r?eE.from(r.current.boundingRectangle).corners:void 0,a=eE.from(n.shape.boundingRectangle).corners.reduce(((e,t,n)=>{var r;return e+Qk.distance(Qk.from(t),null!=(r=null==o?void 0:o[n])?r:i.current)}),0),s=a/4;return{id:n.id,value:1/s,type:u_.Collision,priority:c_.Normal}},sD=Object.create,lD=Object.defineProperty,cD=Object.defineProperties,uD=Object.getOwnPropertyDescriptor,dD=Object.getOwnPropertyDescriptors,hD=Object.getOwnPropertySymbols,pD=Object.prototype.hasOwnProperty,fD=Object.prototype.propertyIsEnumerable,mD=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),gD=e=>{throw TypeError(e)},yD=(e,t,n)=>t in e?lD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vD=(e,t)=>{for(var n in t||(t={}))pD.call(t,n)&&yD(e,n,t[n]);if(hD)for(var n of hD(t))fD.call(t,n)&&yD(e,n,t[n]);return e},bD=(e,t)=>cD(e,dD(t)),xD=(e,t)=>lD(e,"name",{value:t,configurable:!0}),wD=(e,t)=>{var n={};for(var r in e)pD.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&hD)for(var r of hD(e))t.indexOf(r)<0&&fD.call(e,r)&&(n[r]=e[r]);return n},SD=e=>{var t;return[,,,sD(null!=(t=null==e?void 0:e[mD("metadata")])?t:null)]},CD=["class","method","getter","setter","accessor","field","value","get","set"],MD=e=>void 0!==e&&"function"!=typeof e?gD("Function expected"):e,kD=(e,t,n,r,i)=>({kind:CD[e],name:t,metadata:r,addInitializer:e=>n._?gD("Already initialized"):i.push(MD(e||null))}),ED=(e,t)=>yD(t,mD("metadata"),e[3]),_D=(e,t,n,r)=>{for(var i=0,o=e[t>>1],a=o&&o.length;i<a;i++)1&t?o[i].call(n):r=o[i].call(n,r);return r},RD=(e,t,n,r,i,o)=>{var a,s,l,c,u,d=7&t,h=!!(8&t),p=!!(16&t),f=d>3?e.length+1:d?h?1:2:0,m=CD[d+5],g=d>3&&(e[f-1]=[]),y=e[f]||(e[f]=[]),v=d&&(!p&&!h&&(i=i.prototype),d<5&&(d>3||!p)&&uD(d<4?i:{get[n](){return AD(this,o)},set[n](e){return OD(this,o,e)}},n));d?p&&d<4&&xD(o,(d>2?"set ":d>1?"get ":"")+n):xD(i,n);for(var b=r.length-1;b>=0;b--)c=kD(d,n,l={},e[3],y),d&&(c.static=h,c.private=p,u=c.access={has:p?e=>DD(i,e):e=>n in e},3^d&&(u.get=p?e=>(1^d?AD:TD)(e,i,4^d?o:v.get):e=>e[n]),d>2&&(u.set=p?(e,t)=>OD(e,i,t,4^d?o:v.set):(e,t)=>e[n]=t)),s=(0,r[b])(d?d<4?p?o:v[m]:d>4?void 0:{get:v.get,set:v.set}:i,c),l._=1,4^d||void 0===s?MD(s)&&(d>4?g.unshift(s):d?p?o=s:v[m]=s:i=s):"object"!=typeof s||null===s?gD("Object expected"):(MD(a=s.get)&&(v.get=a),MD(a=s.set)&&(v.set=a),MD(a=s.init)&&g.unshift(a));return d||ED(e,i),v&&lD(i,n,v),p?4^d?o:v:i},ID=(e,t,n)=>t.has(e)||gD("Cannot "+n),DD=(e,t)=>Object(t)!==t?gD('Cannot use the "in" operator on this value'):e.has(t),AD=(e,t,n)=>(ID(e,t,"read from private field"),n?n.call(e):t.get(e)),PD=(e,t,n)=>t.has(e)?gD("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),OD=(e,t,n,r)=>(ID(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),TD=(e,t,n)=>(ID(e,t,"access private method"),n),LD="button",qD="draggable",ND="dnd-kit-description",jD="dnd-kit-announcement",zD={draggable:"To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item in a given direction. Press space again to drop the item in its new position, or press escape to cancel."},FD={dragstart({operation:{source:e}}){if(e)return`Picked up draggable item ${e.id}.`},dragover({operation:{source:e,target:t}}){if(e&&e.id!==(null==t?void 0:t.id))return t?`Draggable item ${e.id} was moved over droppable target ${t.id}.`:`Draggable item ${e.id} is no longer over a droppable target.`},dragend({operation:{source:e,target:t},canceled:n}){if(e)return n?`Dragging was cancelled. Draggable item ${e.id} was dropped.`:t?`Draggable item ${e.id} was dropped over droppable target ${t.id}`:`Draggable item ${e.id} was dropped.`}};function WD(e){const t=e.tagName.toLowerCase();return["input","select","textarea","a","button"].includes(t)}var $D=["dragover","dragmove"];var BD="data-dnd-",HD=`${BD}dropping`,VD="--dnd-",GD=`${BD}dragging`,UD=`${BD}placeholder`,YD=[GD,UD,"popover","aria-pressed","aria-grabbing"],KD=["view-transition-name"],XD=`\n :root [${GD}] {\n position: fixed !important;\n pointer-events: none !important;\n touch-action: none;\n z-index: calc(infinity);\n will-change: translate;\n top: var(${VD}top, 0px) !important;\n left: var(${VD}left, 0px) !important;\n right: unset !important;\n bottom: unset !important;\n width: var(${VD}width, auto);\n max-width: var(${VD}width, auto);\n height: var(${VD}height, auto);\n max-height: var(${VD}height, auto);\n transition: var(${VD}transition) !important;\n }\n\n :root [${UD}] {\n transition: none;\n }\n\n :root [${UD}='hidden'] {\n visibility: hidden;\n }\n\n [${GD}] * {\n pointer-events: none !important;\n }\n\n [${GD}]:not([${HD}]) {\n translate: var(${VD}translate) !important;\n }\n\n [${GD}][style*='${VD}scale'] {\n scale: var(${VD}scale) !important;\n transform-origin: var(${VD}transform-origin) !important;\n }\n\n @layer {\n :where([${GD}][popover]) {\n overflow: visible;\n background: unset;\n border: unset;\n margin: unset;\n padding: unset;\n color: inherit;\n\n &:is(input, button) {\n border: revert;\n background: revert;\n }\n }\n }\n [${GD}]::backdrop, [${BD}overlay]:not([${GD}]) {\n display: none;\n visibility: hidden;\n }\n`.replace(/\n+/g," ").replace(/\s+/g," ").trim();function JD(e,t="hidden"){return yM((()=>{const{element:n,manager:r}=e;if(!n||!r)return;const i=function(e,t){const n=new Map;for(const r of t)if(r.element&&(e===r.element||e.contains(r.element))){const e=`${BD}${iD("dom-id")}`;r.element.setAttribute(e,""),n.set(r,e)}return n}(n,r.registry.droppables),o=[],a=function(e){const t="input, textarea, select, canvas, [contenteditable]",n=e.cloneNode(!0),r=Array.from(e.querySelectorAll(t));return Array.from(n.querySelectorAll(t)).forEach(((e,t)=>{const n=r[t];if(GR(e)&&GR(n)&&("file"!==e.type&&(e.value=n.value),"radio"===e.type&&e.name&&(e.name=`Cloned__${e.name}`)),UR(e)&&UR(n)&&n.width>0&&n.height>0){const t=e.getContext("2d");null==t||t.drawImage(n,0,0)}})),n}(n),{remove:s}=a;return function(e,t,n){for(const[r,i]of e){if(!r.element)continue;const e=`[${i}]`,o=t.matches(e)?t:t.querySelector(e);if(r.element.removeAttribute(i),!o)continue;const a=r.element;r.proxy=o,o.removeAttribute(i),KR.set(a,o),n.push((()=>{KR.delete(a),r.proxy=void 0}))}}(i,a,o),function(e,t="hidden"){e.setAttribute("inert","true"),e.setAttribute("tab-index","-1"),e.setAttribute("aria-hidden","true"),e.setAttribute(UD,t)}(a,t),a.remove=()=>{o.forEach((e=>e())),s.call(a)},a}))}function ZD(e,t){return e===t||JR(e)===JR(t)}function QD(e){const{target:t}=e;"newState"in e&&"closed"===e.newState&&tD(t)&&t.hasAttribute("popover")&&requestAnimationFrame((()=>MI(t)))}function eA(e){return"TR"===e.tagName}var tA,nA,rA,iA,oA,aA,sA,lA=new Map,cA=class extends(nA=WE,tA=[Ek],nA){constructor(e,t){super(e,t),PD(this,oA),PD(this,iA,_D(rA,8,this)),_D(rA,11,this),this.state={initial:{},current:{}},this.registerEffect(TD(this,oA,sA)),this.registerEffect(TD(this,oA,aA))}destroy(){super.destroy();for(const[e,t]of lA.entries())t.instances.has(this)&&(t.instances.delete(this),0===t.instances.size&&(t.cleanup(),lA.delete(e)))}};rA=SD(nA),iA=new WeakMap,oA=new WeakSet,aA=function(){var e,t,n;const{state:r,manager:i,options:o}=this,{dragOperation:a}=i,{position:s,source:l,status:c}=a;if(c.idle)return r.current={},void(r.initial={});if(!l)return;const{element:u,feedback:d}=l;if(!u||"none"===d||!c.initialized||c.initializing)return;const{initial:h}=r,p=null!=(e=this.overlay)?e:u,f=NI(p),m=NI(u),g=!ZD(u,p),y=new ZI(u,{frameTransform:g?m:null,ignoreTransforms:!g}),v=m.scaleX/f.scaleX,b=m.scaleY/f.scaleY;let x,w,{width:S,height:C,top:M,left:k}=y;g&&(S/=v,C/=b);const E=new eD(p),{transition:_,translate:R,boxSizing:I,paddingBlockStart:D,paddingBlockEnd:A,paddingInlineStart:P,paddingInlineEnd:O,borderInlineStartWidth:T,borderInlineEndWidth:L,borderBlockStartWidth:q,borderBlockEndWidth:N}=OI(u),j="clone"===d,z="content-box"===I,F=z?parseInt(P)+parseInt(O)+parseInt(T)+parseInt(L):0,W=z?parseInt(D)+parseInt(A)+parseInt(q)+parseInt(N):0,$="move"===d||this.overlay?null:JD(l,j?"clone":"hidden"),B=yM((()=>nD(i.dragOperation.activatorEvent)));if("none"!==R){const e=zI(R);e&&!h.translate&&(h.translate=e)}if(!h.transformOrigin){const e=yM((()=>s.current));h.transformOrigin={x:(e.x-k*f.scaleX-f.x)/(S*f.scaleX),y:(e.y-M*f.scaleY-f.y)/(C*f.scaleY)}}const{transformOrigin:H}=h,V=M*f.scaleY+f.y,G=k*f.scaleX+f.x;if(!h.coordinates&&(h.coordinates={x:G,y:V},1!==v||1!==b)){const{scaleX:e,scaleY:t}=m,{x:n,y:r}=H;h.coordinates.x+=(S*e-S)*n,h.coordinates.y+=(C*t-C)*r}h.dimensions||(h.dimensions={width:S,height:C}),h.frameTransform||(h.frameTransform=f);const U=h.coordinates.x-G,Y=h.coordinates.y-V,K=(h.dimensions.width*h.frameTransform.scaleX-S*f.scaleX)*H.x,X=(h.dimensions.height*h.frameTransform.scaleY-C*f.scaleY)*H.y,J=U/f.scaleX+K,Z=Y/f.scaleY+X,Q={left:k+J,top:M+Z};p.setAttribute(GD,"true");const ee=yM((()=>a.transform)),te=null!=(t=h.translate)?t:{x:0,y:0},ne=`${ee.x*f.scaleX+te.x}px ${ee.y*f.scaleY+te.y}px 0`,re=_?`${_}, translate 0ms linear`:"";if(E.set({width:S-F,height:C-W,top:Q.top,left:Q.left,translate:ne,transition:re,scale:g?`${v} ${b}`:"","transform-origin":`${100*H.x}% ${100*H.y}%`},VD),$&&(u.insertAdjacentElement("afterend",$),null==o?void 0:o.rootElement)){("function"==typeof o.rootElement?o.rootElement(l):o.rootElement).appendChild(u)}CI(p)&&(p.hasAttribute("popover")||p.setAttribute("popover","manual"),MI(p),p.addEventListener("beforetoggle",QD));const ie=new ResizeObserver((()=>{if(!$)return;const e=new ZI($,{frameTransform:f,ignoreTransforms:!0}),t=null!=H?H:{x:1,y:1},n=(S-e.width)*t.x+J,r=(C-e.height)*t.y+Z;if(E.set({width:e.width-F,height:e.height-W,top:M+r,left:k+n},VD),null==x||x.takeRecords(),eA(u)&&eA($)){const e=Array.from(u.cells),t=Array.from($.cells);for(const[n,r]of e.entries()){const e=t[n];r.style.width=`${e.offsetWidth}px`}}a.shape=new ZI(p)})),oe=new ZI(p);yM((()=>a.shape=oe));const ae=LR(p),se=e=>{this.manager.actions.stop({event:e})};B&&ae.addEventListener("resize",se),"idle"===yM((()=>l.status))&&requestAnimationFrame((()=>l.status="dragging")),$&&(ie.observe($),x=new MutationObserver((e=>{let t=!1;for(const n of e){if(n.target!==u){t=!0;continue}if("attributes"!==n.type)continue;const e=n.attributeName;if(e.startsWith("aria-")||YD.includes(e))continue;const r=u.getAttribute(e);if("style"===e){if(QI(u)&&QI($)){const e=u.style;for(const t of Array.from($.style))""===e.getPropertyValue(t)&&$.style.removeProperty(t);for(const t of Array.from(e)){if(KD.includes(t)||t.startsWith(VD))continue;const n=e.getPropertyValue(t);$.style.setProperty(t,n)}}}else null!==r?$.setAttribute(e,r):$.removeAttribute(e)}t&&j&&($.innerHTML=u.innerHTML)})),x.observe(u,{attributes:!0,subtree:!0,childList:!0}),w=new MutationObserver((e=>{for(const t of e)if(0!==t.addedNodes.length)for(const e of Array.from(t.addedNodes)){if(e.contains(u)&&u.nextElementSibling!==$)return u.insertAdjacentElement("afterend",$),void MI(p);if(e.contains($)&&$.previousElementSibling!==u)return $.insertAdjacentElement("beforebegin",u),void MI(p)}})),w.observe(u.ownerDocument.body,{childList:!0,subtree:!0}));const le=null==(n=i.dragOperation.source)?void 0:n.id,ce=()=>{var e;if(!B||null==le)return;const t=i.registry.draggables.get(le),n=null!=(e=null==t?void 0:t.handle)?e:null==t?void 0:t.element;NR(n)&&n.focus()},ue=()=>{null==x||x.disconnect(),null==w||w.disconnect(),ie.disconnect(),ae.removeEventListener("resize",se),CI(p)&&(p.removeEventListener("beforetoggle",QD),p.removeAttribute("popover")),p.removeAttribute(GD),E.reset(),l.status="idle";const e=null!=r.current.translate;$&&(e||$.parentElement!==p.parentElement)&&p.isConnected&&$.replaceWith(p),null==$||$.remove()},de=Ik((()=>{var e;const{transform:t,status:n}=a;if((t.x||t.y||r.current.translate)&&n.dragging){const n=null!=(e=h.translate)?e:{x:0,y:0},i={x:t.x/f.scaleX+n.x,y:t.y/f.scaleY+n.y},o=r.current.translate,s=yM((()=>a.modifiers)),l=yM((()=>{var e;return null==(e=a.shape)?void 0:e.current})),c=B?"250ms cubic-bezier(0.25, 1, 0.5, 1)":"0ms linear";if(E.set({transition:`${_}, translate ${c}`,translate:`${i.x}px ${i.y}px 0`},VD),null==x||x.takeRecords(),l&&l!==oe&&o&&!s.length){const e=Qk.delta(i,o);a.shape=eE.from(l.boundingRectangle).translate(e.x*f.scaleX,e.y*f.scaleY)}else a.shape=new ZI(p);r.current.translate=i}}),(function(){if(a.status.dropped){this.dispose(),l.status="dropping";let e=r.current.translate;const t=null!=e;if(e||u===p||(e={x:0,y:0}),!e)return void ue();const n=()=>{var n,r;{MI(p);const[,i]=null!=(n=AR(p,(e=>"translate"in e)))?n:[];null==i||i.pause();const o=null!=$?$:u,a={frameTransform:ZD(p,o)?null:void 0},s=new ZI(p,a),c=null!=(r=zI(OI(p).translate))?r:e,d=new ZI(o,a),h=eE.delta(s,d,l.alignment),f={x:c.x-h.x,y:c.y-h.y},m=Math.round(s.intrinsicHeight)!==Math.round(d.intrinsicHeight)?{minHeight:[`${s.intrinsicHeight}px`,`${d.intrinsicHeight}px`],maxHeight:[`${s.intrinsicHeight}px`,`${d.intrinsicHeight}px`]}:{},g=Math.round(s.intrinsicWidth)!==Math.round(d.intrinsicWidth)?{minWidth:[`${s.intrinsicWidth}px`,`${d.intrinsicWidth}px`],maxWidth:[`${s.intrinsicWidth}px`,`${d.intrinsicWidth}px`]}:{};E.set({transition:_},VD),p.setAttribute(HD,""),null==x||x.takeRecords(),GI({element:p,keyframes:bD(vD(vD({},m),g),{translate:[`${c.x}px ${c.y}px 0`,`${f.x}px ${f.y}px 0`]}),options:{duration:t||p!==u?250:0,easing:"ease"}}).then((()=>{p.removeAttribute(HD),null==i||i.finish(),ue(),requestAnimationFrame(ce)}))}};i.renderer.rendering.then(n)}}));return()=>{ue(),de()}},sA=function(){var e,t,n;const{status:r,source:i,target:o}=this.manager.dragOperation,{nonce:a}=null!=(e=this.options)?e:{};if(r.initializing){const e=zR(null!=(t=null==i?void 0:i.element)?t:null),r=zR(null!=(n=null==o?void 0:o.element)?n:null),s=new Set([e,r]);for(const e of s){let t=lA.get(e);if(!t){const n=document.createElement("style");n.textContent=XD,a&&n.setAttribute("nonce",a),e.head.prepend(n);const r=new MutationObserver((t=>{for(const r of t)if("childList"===r.type){const t=Array.from(r.removedNodes);t.length>0&&t.includes(n)&&e.head.prepend(n)}}));r.observe(e.head,{childList:!0}),t={cleanup:()=>{r.disconnect(),n.remove()},instances:new Set},lA.set(e,t)}t.instances.add(this)}}},RD(rA,4,"overlay",tA,cA,iA),ED(rA,cA),cA.configure=zE(cA);var uA,dA,hA,pA,fA,mA,gA,yA=cA,vA=!0;hA=[Ek],pA=WI.Forward,uA=[Ek],dA=WI.Reverse;var bA=class{constructor(){PD(this,mA,_D(fA,8,this,vA)),_D(fA,11,this),PD(this,gA,_D(fA,12,this,vA)),_D(fA,15,this)}isLocked(e){return e!==WI.Idle&&(null==e?this[WI.Forward]===vA&&this[WI.Reverse]===vA:this[e]===vA)}unlock(e){e!==WI.Idle&&(this[e]=false)}};fA=SD(null),mA=new WeakMap,gA=new WeakMap,RD(fA,4,pA,hA,bA,mA),RD(fA,4,dA,uA,bA,gA),ED(fA,bA);var xA,wA,SA,CA,MA,kA,EA=[WI.Forward,WI.Reverse],_A=class{constructor(){this.x=new bA,this.y=new bA}isLocked(){return this.x.isLocked()&&this.y.isLocked()}},RA=class extends WE{constructor(e){super(e);const t=MM(new _A);let n=null;this.signal=t,TM((()=>{const{status:r}=e.dragOperation;if(!r.initialized)return n=null,void(t.value=new _A);const{delta:i}=e.dragOperation.position;if(n){const e={x:IA(i.x,n.x),y:IA(i.y,n.y)},r=t.peek();mM((()=>{for(const t of cE)for(const n of EA)e[t]===n&&r[t].unlock(n);t.value=r}))}n=i}))}get current(){return this.signal.peek()}};function IA(e,t){return Math.sign(e-t)}var DA=class extends(wA=BE,xA=[Ek],wA){constructor(e){super(e),PD(this,CA,_D(SA,8,this,!1)),_D(SA,11,this),PD(this,MA),PD(this,kA,(()=>{if(!AD(this,MA))return;const{element:e,by:t}=AD(this,MA);t.y&&(e.scrollTop+=t.y),t.x&&(e.scrollLeft+=t.x)})),this.scroll=e=>{var t;if(this.disabled)return!1;const n=this.getScrollableElements();if(!n)return OD(this,MA,void 0),!1;const{position:r}=this.manager.dragOperation,i=null==r?void 0:r.current;if(i){const{by:r}=null!=e?e:{},o=r?{x:AA(r.x),y:AA(r.y)}:void 0,a=o?void 0:this.scrollIntentTracker.current;if(null==a?void 0:a.isLocked())return!1;for(const e of n){const n=_I(e,r);if(n.x||n.y){const{speed:n,direction:s}=HI(e,i,o);if(a)for(const e of cE)a[e].isLocked(s[e])&&(n[e]=0,s[e]=0);if(s.x||s.y){const{x:i,y:o}=null!=r?r:s,a=i*n.x,l=o*n.y;if(a||l){const n=null==(t=AD(this,MA))?void 0:t.by;if(this.autoScrolling&&n){if(n.x&&!a||n.y&&!l)continue}return OD(this,MA,{element:e,by:{x:a,y:l}}),II.schedule(AD(this,kA)),!0}}}}}return OD(this,MA,void 0),!1};let t=null,n=null;const r=Mk((()=>{const{position:n,source:r}=e.dragOperation;if(!n)return null;const i=YR(zR(null==r?void 0:r.element),n.current);return i&&(t=i),null!=i?i:t})),i=Mk((()=>{const t=r.value,{documentElement:i}=zR(t);if(!t||t===i){const{target:t}=e.dragOperation,r=null==t?void 0:t.element;if(r){const e=qI(r,{excludeElement:!1});return n=e,e}}if(t){const e=qI(t,{excludeElement:!1});return this.autoScrolling&&n&&e.size<(null==n?void 0:n.size)?n:(n=e,e)}return n=null,null}),kk);this.getScrollableElements=()=>i.value,this.scrollIntentTracker=new RA(e),this.destroy=e.monitor.addEventListener("dragmove",(t=>{!this.disabled&&!t.defaultPrevented&&nD(e.dragOperation.activatorEvent)&&t.by&&this.scroll({by:t.by})&&t.preventDefault()}))}};function AA(e){return e>0?WI.Forward:e<0?WI.Reverse:WI.Idle}SA=SD(wA),CA=new WeakMap,MA=new WeakMap,kA=new WeakMap,RD(SA,4,"autoScrolling",xA,DA,CA),ED(SA,DA);var PA,OA=new class{constructor(e){this.scheduler=e,this.pending=!1,this.tasks=new Set,this.resolvers=new Set,this.flush=()=>{const{tasks:e,resolvers:t}=this;this.pending=!1,this.tasks=new Set,this.resolvers=new Set;for(const t of e)t();for(const e of t)e()}}schedule(e){return this.tasks.add(e),this.pending||(this.pending=!0,this.scheduler(this.flush)),new Promise((e=>this.resolvers.add(e)))}}((e=>{"function"==typeof requestAnimationFrame?requestAnimationFrame(e):e()})),TA=class extends WE{constructor(e,t){super(e);const n=e.registry.plugins.get(DA);if(!n)throw new Error("AutoScroller plugin depends on Scroller plugin");this.destroy=TM((()=>{if(this.disabled)return;const{position:t,status:r}=e.dragOperation;if(r.dragging){if(n.scroll()){n.autoScrolling=!0;const e=setInterval((()=>OA.schedule(n.scroll)),10);return()=>{clearInterval(e)}}n.autoScrolling=!1}}))}},LA={capture:!0,passive:!0},qA=class extends BE{constructor(e){super(e),PD(this,PA),this.handleScroll=()=>{null==AD(this,PA)&&OD(this,PA,setTimeout((()=>{this.manager.collisionObserver.forceUpdate(!1),OD(this,PA,void 0)}),50))};const{dragOperation:t}=this.manager;this.destroy=TM((()=>{var e,n,r;if(t.status.dragging){const i=null!=(r=null==(n=null==(e=t.source)?void 0:e.element)?void 0:n.ownerDocument)?r:document;return i.addEventListener("scroll",this.handleScroll,LA),()=>{i.removeEventListener("scroll",this.handleScroll,LA)}}}))}};PA=new WeakMap;function NA(){var e;null==(e=document.getSelection())||e.removeAllRanges()}var jA,zA=Object.freeze({offset:10,keyboardCodes:{start:["Space","Enter"],cancel:["Escape"],end:["Space","Enter","Tab"],up:["ArrowUp"],down:["ArrowDown"],left:["ArrowLeft"],right:["ArrowRight"]},preventActivation(e,t){var n;const r=null!=(n=t.handle)?n:t.element;return e.target===r}}),FA=class extends J_{constructor(e,t){super(e),this.manager=e,this.options=t,PD(this,jA,[]),this.listeners=new XR,this.handleSourceKeyDown=(e,t,n)=>{if(this.disabled||e.defaultPrevented)return;if(!tD(e.target))return;if(t.disabled)return;const{keyboardCodes:r=zA.keyboardCodes,preventActivation:i=zA.preventActivation}=null!=n?n:{};r.start.includes(e.code)&&this.manager.dragOperation.status.idle&&((null==i?void 0:i(e,t))||this.handleStart(e,t,n))}}bind(e,t=this.options){const n=TM((()=>{var n;const r=null!=(n=e.handle)?n:e.element,i=n=>{nD(n)&&this.handleSourceKeyDown(n,e,t)};if(r)return r.addEventListener("keydown",i),()=>{r.removeEventListener("keydown",i)}}));return n}handleStart(e,t,n){const{element:r}=t;if(!r)throw new Error("Source draggable does not have an associated element");e.preventDefault(),e.stopImmediatePropagation(),VI(r);const{center:i}=new ZI(r);if(this.manager.actions.start({event:e,coordinates:{x:i.x,y:i.y},source:t}).signal.aborted)return this.cleanup();this.sideEffects();const o=zR(r),a=[this.listeners.bind(o,[{type:"keydown",listener:e=>this.handleKeyDown(e,t,n),options:{capture:!0}}])];AD(this,jA).push(...a)}handleKeyDown(e,t,n){const{keyboardCodes:r=zA.keyboardCodes}=null!=n?n:{};if(BA(e,[...r.end,...r.cancel])){e.preventDefault();const t=BA(e,r.cancel);this.handleEnd(e,t)}else BA(e,r.up)?this.handleMove("up",e):BA(e,r.down)&&this.handleMove("down",e),BA(e,r.left)?this.handleMove("left",e):BA(e,r.right)&&this.handleMove("right",e)}handleEnd(e,t){this.manager.actions.stop({event:e,canceled:t}),this.cleanup()}handleMove(e,t){var n,r;const{shape:i}=this.manager.dragOperation,o=t.shiftKey?5:1;let a={x:0,y:0},s=null!=(r=null==(n=this.options)?void 0:n.offset)?r:zA.offset;if("number"==typeof s&&(s={x:s,y:s}),i){switch(e){case"up":a={x:0,y:-s.y*o};break;case"down":a={x:0,y:s.y*o};break;case"left":a={x:-s.x*o,y:0};break;case"right":a={x:s.x*o,y:0}}(a.x||a.y)&&(t.preventDefault(),this.manager.actions.move({event:t,by:a}))}}sideEffects(){const e=this.manager.registry.plugins.get(TA);!1===(null==e?void 0:e.disabled)&&(e.disable(),AD(this,jA).push((()=>{e.enable()})))}cleanup(){AD(this,jA).forEach((e=>e())),OD(this,jA,[])}destroy(){this.cleanup(),this.listeners.clear()}};jA=new WeakMap,FA.configure=zE(FA),FA.defaults=zA;var WA,$A=FA;function BA(e,t){return t.includes(e.code)}var HA,VA;WA=new WeakMap;HA=new WeakMap,VA=new WeakMap;var GA=class{};GA.Delay=class extends Q_{constructor(){super(...arguments),PD(this,HA),PD(this,VA)}onEvent(e){switch(e.type){case"pointerdown":OD(this,VA,$R(e)),OD(this,HA,setTimeout((()=>this.activate(e)),this.options.value));break;case"pointermove":if(!AD(this,VA))return;const{x:t,y:n}=$R(e);rE({x:t-AD(this,VA).x,y:n-AD(this,VA).y},this.options.tolerance)&&this.abort();break;case"pointerup":this.abort()}}abort(){AD(this,HA)&&(clearTimeout(AD(this,HA)),OD(this,VA,void 0),OD(this,HA,void 0))}},GA.Distance=class extends Q_{constructor(){super(...arguments),PD(this,WA)}onEvent(e){switch(e.type){case"pointerdown":OD(this,WA,$R(e));break;case"pointermove":if(!AD(this,WA))return;const{x:t,y:n}=$R(e),r={x:t-AD(this,WA).x,y:n-AD(this,WA).y},{tolerance:i}=this.options;if(i&&rE(r,i))return void this.abort();rE(r,this.options.value)&&this.activate(e);break;case"pointerup":this.abort()}}abort(){OD(this,WA,void 0)}};var UA,YA=Object.freeze({activationConstraints(e,t){var n;const{pointerType:r,target:i}=e;if("mouse"!==r||!tD(i)||t.handle!==i&&!(null==(n=t.handle)?void 0:n.contains(i)))return"touch"===r?[new GA.Delay({value:250,tolerance:5})]:function(e){if(!tD(e))return!1;const{tagName:t}=e;return"INPUT"===t||"TEXTAREA"===t||(n=e).hasAttribute("contenteditable")&&"false"!==n.getAttribute("contenteditable");var n}(i)&&!e.defaultPrevented?[new GA.Delay({value:200,tolerance:0})]:[new GA.Delay({value:200,tolerance:10}),new GA.Distance({value:5})]},preventActivation(e,t){var n;const{target:r}=e;return r!==t.element&&(r!==t.handle&&(!!tD(r)&&(!(null==(n=t.handle)?void 0:n.contains(r))&&Boolean(r.closest('\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n a[href],\n [contenteditable]:not([contenteditable="false"])\n ')))))}}),KA=class extends J_{constructor(e,t){super(e),this.manager=e,this.options=t,PD(this,UA,new Set),this.listeners=new XR,this.latest={event:void 0,coordinates:void 0},this.handleMove=()=>{const{event:e,coordinates:t}=this.latest;e&&t&&this.manager.actions.move({event:e,to:t})},this.handleCancel=this.handleCancel.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}activationConstraints(e,t){var n;const{activationConstraints:r=YA.activationConstraints}=null!=(n=this.options)?n:{};return"function"==typeof r?r(e,t):r}bind(e,t=this.options){const n=TM((()=>{var n;const r=new AbortController,{signal:i}=r,o=n=>{(function(e){if(!e)return!1;const{PointerEvent:t}=LR(e.target);return e instanceof t})(n)&&this.handlePointerDown(n,e,t)};let a=[null!=(n=e.handle)?n:e.element];(null==t?void 0:t.activatorElements)&&(a=Array.isArray(t.activatorElements)?t.activatorElements:t.activatorElements(e));for(const e of a)e&&(eP(e.ownerDocument.defaultView),e.addEventListener("pointerdown",o,{signal:i}));return()=>r.abort()}));return n}handlePointerDown(e,t,n){if(this.disabled||!e.isPrimary||0!==e.button||!tD(e.target)||t.disabled||function(e){return"sensor"in e}(e)||!this.manager.dragOperation.status.idle)return;const{preventActivation:r=YA.preventActivation}=null!=n?n:{};if(null==r?void 0:r(e,t))return;const{target:i}=e,o=NR(i)&&i.draggable&&"true"===i.getAttribute("draggable"),a=NI(t.element),{x:s,y:l}=$R(e);this.initialCoordinates={x:s*a.scaleX+a.x,y:l*a.scaleY+a.y};const c=this.activationConstraints(e,t);e.sensor=this;const u=new Z_(c,(e=>this.handleStart(t,e)));u.signal.onabort=()=>this.handleCancel(e),u.onEvent(e),this.controller=u;const d=HR(),h=this.listeners.bind(d,[{type:"pointermove",listener:e=>this.handlePointerMove(e,t)},{type:"pointerup",listener:this.handlePointerUp,options:{capture:!0}},{type:"dragstart",listener:o?this.handleCancel:JA,options:{capture:!0}}]);AD(this,UA).add((()=>{h(),this.initialCoordinates=void 0}))}handlePointerMove(e,t){var n,r;if(!1!==(null==(n=this.controller)?void 0:n.activated)){if(this.manager.dragOperation.status.dragging){const n=$R(e),r=NI(t.element);n.x=n.x*r.scaleX+r.x,n.y=n.y*r.scaleY+r.y,e.preventDefault(),e.stopPropagation(),this.latest.event=e,this.latest.coordinates=n,II.schedule(this.handleMove)}}else null==(r=this.controller)||r.onEvent(e)}handlePointerUp(e){const{status:t}=this.manager.dragOperation;if(!t.idle){e.preventDefault(),e.stopPropagation();const n=!t.initialized;this.manager.actions.stop({event:e,canceled:n})}this.cleanup()}handleKeyDown(e){"Escape"===e.key&&(e.preventDefault(),this.handleCancel(e))}handleStart(e,t){const{manager:n,initialCoordinates:r}=this;if(!r||!n.dragOperation.status.idle)return;if(t.defaultPrevented)return;if(n.actions.start({coordinates:r,event:t,source:e}).signal.aborted)return this.cleanup();t.preventDefault();const i=zR(t.target);i.body.setPointerCapture(t.pointerId);const o=tD(t.target)?[t.target,i.body]:i.body,a=this.listeners.bind(o,[{type:"touchmove",listener:JA,options:{passive:!1}},{type:"click",listener:JA},{type:"contextmenu",listener:JA},{type:"keydown",listener:this.handleKeyDown}]);AD(this,UA).add(a)}handleCancel(e){const{dragOperation:t}=this.manager;t.status.initialized&&this.manager.actions.stop({event:e,canceled:!0}),this.cleanup()}cleanup(){this.latest={event:void 0,coordinates:void 0},AD(this,UA).forEach((e=>e())),AD(this,UA).clear()}destroy(){this.cleanup(),this.listeners.clear()}};UA=new WeakMap,KA.configure=zE(KA),KA.defaults=YA;var XA=KA;function JA(e){e.preventDefault()}function ZA(){}var QA=new WeakSet;function eP(e){e&&!QA.has(e)&&(e.addEventListener("touchmove",ZA,{capture:!1,passive:!1}),QA.add(e))}var tP,nP,rP,iP,oP,aP,sP,lP,cP,uP,dP,hP,pP,fP,mP,gP,yP,vP,bP={modifiers:[],plugins:[class extends WE{constructor(e,t){super(e);const{id:n,idPrefix:{description:r=ND,announcement:i=jD}={},announcements:o=FD,screenReaderInstructions:a=zD,debounce:s=500}=null!=t?t:{},l=n?`${r}-${n}`:iD(r),c=n?`${i}-${n}`:iD(i);let u,d,h,p;const f=(e=p)=>{h&&e&&(null==h?void 0:h.nodeValue)!==e&&(h.nodeValue=e)},m=()=>II.schedule(f),g=function(e,t){let n;const r=()=>{clearTimeout(n),n=setTimeout(e,t)};return r.cancel=()=>clearTimeout(n),r}(m,s),y=Object.entries(o).map((([e,t])=>this.manager.monitor.addEventListener(e,((n,r)=>{const i=h;if(!i)return;const o=null==t?void 0:t(n,r);o&&i.nodeValue!==o&&(p=o,$D.includes(e)?g():(m(),g.cancel()))})))),v=()=>{let e=[];(null==u?void 0:u.isConnected)||(u=function(e,t){const n=document.createElement("div");return n.id=e,n.style.setProperty("display","none"),n.textContent=t,n}(l,a.draggable),e.push(u)),(null==d?void 0:d.isConnected)||(d=function(e){const t=document.createElement("div");return t.id=e,t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),t.style.setProperty("position","fixed"),t.style.setProperty("width","1px"),t.style.setProperty("height","1px"),t.style.setProperty("margin","-1px"),t.style.setProperty("border","0"),t.style.setProperty("padding","0"),t.style.setProperty("overflow","hidden"),t.style.setProperty("clip","rect(0 0 0 0)"),t.style.setProperty("clip-path","inset(100%)"),t.style.setProperty("white-space","nowrap"),t}(c),h=document.createTextNode(""),d.appendChild(h),e.push(d)),e.length>0&&document.body.append(...e)},b=new Set;function x(){for(const e of b)e()}this.registerEffect((()=>{var e;b.clear();for(const t of this.manager.registry.draggables.value){const n=null!=(e=t.handle)?e:t.element;if(n){u&&d||b.add(v),WD(n)&&!VR()||n.hasAttribute("tabindex")||b.add((()=>n.setAttribute("tabindex","0"))),n.hasAttribute("role")||"button"===n.tagName.toLowerCase()||b.add((()=>n.setAttribute("role",LD))),n.hasAttribute("aria-roledescription")||b.add((()=>n.setAttribute("aria-roledescription",qD))),n.hasAttribute("aria-describedby")||b.add((()=>n.setAttribute("aria-describedby",l)));for(const e of["aria-pressed","aria-grabbed"]){const r=String(t.isDragging);n.getAttribute(e)!==r&&b.add((()=>n.setAttribute(e,r)))}const e=String(t.disabled);n.getAttribute("aria-disabled")!==e&&b.add((()=>n.setAttribute("aria-disabled",e)))}}b.size>0&&II.schedule(x)})),this.destroy=()=>{super.destroy(),null==u||u.remove(),null==d||d.remove(),y.forEach((e=>e()))}}},TA,class extends WE{constructor(e,t){super(e,t),this.manager=e;const n=Mk((()=>{var e;return zR(null==(e=this.manager.dragOperation.source)?void 0:e.element)}));this.destroy=TM((()=>{var e;const{dragOperation:t}=this.manager,{cursor:r="grabbing",nonce:i}=null!=(e=this.options)?e:{};if(t.status.initialized){const e=n.value,t=e.createElement("style");return i&&t.setAttribute("nonce",i),t.textContent=`* { cursor: ${r} !important; }`,e.head.appendChild(t),()=>t.remove()}}))}},yA,class extends WE{constructor(e,t){super(e,t),this.manager=e,this.destroy=TM((()=>{var e;const{dragOperation:t}=this.manager,{nonce:n}=null!=(e=this.options)?e:{};if(t.status.initialized){const e=document.createElement("style");return n&&e.setAttribute("nonce",n),e.textContent="* { user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(e),NA(),document.addEventListener("selectionchange",NA,{capture:!0}),()=>{document.removeEventListener("selectionchange",NA,{capture:!0}),e.remove()}}}))}}],sensors:[XA,$A]},xP=class extends CR{constructor(e={}){const{plugins:t=bP.plugins,sensors:n=bP.sensors,modifiers:r=[]}=e;super(bD(vD({},e),{plugins:[qA,DA,...t],sensors:n,modifiers:r}))}},wP=class extends(iP=Y_,rP=[Ek],nP=[Ek],tP=[Ek],iP){constructor(e,t){var n=e,{element:r,effects:i=()=>[],handle:o,feedback:a="default"}=n,s=wD(n,["element","effects","handle","feedback"]);super(vD({effects:()=>[...i(),()=>{var e,t;const{manager:n}=this;if(!n)return;const r=(null!=(t=null==(e=this.sensors)?void 0:e.map(FE))?t:[...n.sensors]).map((e=>{const t=e instanceof J_?e:n.registry.register(e.plugin),r=e instanceof J_?void 0:e.options;return t.bind(this,r)}));return function(){r.forEach((e=>e()))}}]},s),t),PD(this,aP,_D(oP,8,this)),_D(oP,11,this),PD(this,sP,_D(oP,12,this)),_D(oP,15,this),PD(this,lP,_D(oP,16,this)),_D(oP,19,this),this.element=r,this.handle=o,this.feedback=a}};oP=SD(iP),aP=new WeakMap,sP=new WeakMap,lP=new WeakMap,RD(oP,4,"handle",rP,wP,aP),RD(oP,4,"element",nP,wP,sP),RD(oP,4,"feedback",tP,wP,lP),ED(oP,wP);var SP=class extends(dP=K_,uP=[Ek],cP=[Ek],dP){constructor(e,t){var n=e,{element:r,effects:i=()=>[]}=n,o=wD(n,["element","effects"]);const{collisionDetector:a=oD}=o,s=e=>{const{manager:t,element:n}=this;if(!n||null===e)return void(this.shape=void 0);if(!t)return;const r=new ZI(n),i=yM((()=>this.shape));return r&&(null==i?void 0:i.equals(r))?i:(this.shape=r,r)},l=MM(!1);super(bD(vD({},o),{collisionDetector:a,effects:()=>[...i(),()=>{const{element:e,manager:t}=this;if(!t)return;const{dragOperation:n}=t,{source:r}=n;l.value=Boolean(r&&n.status.initialized&&e&&!this.disabled&&this.accepts(r))},()=>{const{element:e}=this;if(l.value&&e){const t=new SI(e,s);return()=>{t.disconnect(),this.shape=void 0}}},()=>{var e;if(null==(e=this.manager)?void 0:e.dragOperation.status.initialized)return()=>{this.shape=void 0}}]}),t),PD(this,yP),PD(this,pP,_D(hP,8,this)),_D(hP,11,this),PD(this,vP,_D(hP,12,this)),_D(hP,15,this),this.element=r,this.refreshShape=()=>s()}set element(e){OD(this,yP,e,gP)}get element(){var e;return null!=(e=this.proxy)?e:AD(this,yP,mP)}};function CP(e){var t;if(null!=e)return function(e){return null!=e&&"object"==typeof e&&"current"in e}(e)?null!=(t=e.current)?t:void 0:e}hP=SD(dP),pP=new WeakMap,yP=new WeakSet,vP=new WeakMap,fP=RD(hP,20,"#element",uP,yP,pP),mP=fP.get,gP=fP.set,RD(hP,4,"proxy",cP,SP,vP),ED(hP,SP);var MP="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?p:c;function kP(e,t){const n=a(new Map),r=function(){const e=m(0)[1];return h((()=>{e((e=>e+1))}),[e])}();return MP((()=>{if(e)return TM((()=>{var i;let o=!1,a=!1;for(const r of n.current){const[s]=r,l=yM((()=>r[1])),c=e[s];l!==c&&(o=!0,n.current.set(s,c),a=null!=(i=null==t?void 0:t(s,l,c))&&i)}o&&(a?M(r):r())}));n.current.clear()}),[e]),f((()=>e?new Proxy(e,{get(e,t){const r=e[t];return n.current.set(t,r),r}}):e),[e])}function EP(e,t){e()}function _P(e){const t=a(e);return MP((()=>{t.current=e}),[e]),t}function RP(e,t,n=c,r=Object.is){const i=a(e);n((()=>{const n=i.current;r(e,n)||(i.current=e,t(e,n))}),[t,e])}function IP(e,t){const n=a(CP(e));MP((()=>{const r=CP(e);r!==n.current&&(n.current=r,t(r))}))}var DP=Object.defineProperty,AP=Object.defineProperties,PP=Object.getOwnPropertyDescriptors,OP=Object.getOwnPropertySymbols,TP=Object.prototype.hasOwnProperty,LP=Object.prototype.propertyIsEnumerable,qP=(e,t,n)=>t in e?DP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,NP=s(new xP),jP=g(v((({children:e},t)=>{const[n,r]=m(0),i=a(null),o=a(null),s=f((()=>({renderer:{get rendering(){var e;return null!=(e=i.current)?e:Promise.resolve()}},trackRendering(e){i.current||(i.current=new Promise((e=>{o.current=e}))),b((()=>{e(),r((e=>e+1))}))}})),[]);return MP((()=>{var e;null==(e=o.current)||e.call(o),i.current=null}),[e,n]),x(t,(()=>s)),null}))),zP=[void 0,kk];function FP(e){var t=e,{children:n,onCollision:r,onBeforeDragStart:i,onDragStart:o,onDragMove:s,onDragOver:l,onDragEnd:u}=t,d=((e,t)=>{var n={};for(var r in e)TP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&OP)for(var r of OP(e))t.indexOf(r)<0&&LP.call(e,r)&&(n[r]=e[r]);return n})(t,["children","onCollision","onBeforeDragStart","onDragStart","onDragMove","onDragOver","onDragEnd"]);const h=a(null),{plugins:p,modifiers:f,sensors:m}=d,g=_P(i),v=_P(o),b=_P(l),x=_P(s),w=_P(u),S=_P(r),C=function(e){const t=a(null);t.current||(t.current=e());return y((()=>()=>{var e;return null==(e=t.current)?void 0:e.destroy()}),[]),t.current}((()=>{var e;return null!=(e=d.manager)?e:new xP(d)}));return c((()=>{if(!h.current)throw new Error("Renderer not found");const{renderer:e,trackRendering:t}=h.current,{monitor:n}=C;C.renderer=e;const r=[n.addEventListener("beforedragstart",(e=>{const n=g.current;n&&t((()=>n(e,C)))})),n.addEventListener("dragstart",(e=>{var t;return null==(t=v.current)?void 0:t.call(v,e,C)})),n.addEventListener("dragover",(e=>{const n=b.current;n&&t((()=>n(e,C)))})),n.addEventListener("dragmove",(e=>{const n=x.current;n&&t((()=>n(e,C)))})),n.addEventListener("dragend",(e=>{const n=w.current;n&&t((()=>n(e,C)))})),n.addEventListener("collision",(e=>{var t;return null==(t=S.current)?void 0:t.call(S,e,C)}))];return()=>r.forEach((e=>e()))}),[C]),RP(p,(()=>C&&(C.plugins=null!=p?p:bP.plugins)),...zP),RP(m,(()=>C&&(C.sensors=null!=m?m:bP.sensors)),...zP),RP(f,(()=>C&&(C.modifiers=null!=f?f:bP.modifiers)),...zP),Ji.jsxs(NP.Provider,{value:C,children:[Ji.jsx(jP,{ref:h,children:n}),n]})}function WP(e){var t;const n=null!=(t=d(NP))?t:void 0,[r]=m((()=>e(n)));return r.manager!==n&&(r.manager=n),MP(r.register,[n,r]),r}var $P,BP,HP,VP,GP,UP=Object.create,YP=Object.defineProperty,KP=Object.getOwnPropertyDescriptor,XP=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),JP=e=>{throw TypeError(e)},ZP=["class","method","getter","setter","accessor","field","value","get","set"],QP=e=>void 0!==e&&"function"!=typeof e?JP("Function expected"):e,eO=(e,t,n,r,i)=>({kind:ZP[e],name:t,metadata:r,addInitializer:e=>n._?JP("Already initialized"):i.push(QP(e||null))}),tO=(e,t,n,r,i,o)=>{for(var a,s,l,c,u=7&t,d=ZP[u+5],h=e[2]||(e[2]=[]),p=(i=i.prototype,KP(i,n)),f=r.length-1;f>=0;f--)(l=eO(u,n,s={},e[3],h)).static=false,l.private=false,c=l.access={has:e=>n in e},c.get=e=>e[n],a=(0,r[f])(p[d],l),s._=1,QP(a)&&(p[d]=a);return p&&YP(i,n,p),i},nO=(e,t,n)=>t.has(e)||JP("Cannot "+n),rO=class e{constructor(e,t){this.x=e,this.y=t}static delta(t,n){return new e(t.x-n.x,t.y-n.y)}static distance(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}static equals(e,t){return e.x===t.x&&e.y===t.y}static from({x:t,y:n}){return new e(t,n)}},iO=class extends(HP=Ak,BP=[_k],$P=[_k],HP){constructor(e){super(rO.from(e),((e,t)=>rO.equals(e,t))),((e,t,n)=>{for(var r=0,i=e[t>>1],o=i&&i.length;r<o;r++)i[r].call(n)})(GP,5,this),((e,t,n)=>{t.has(e)?JP("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n)})(this,VP,0),this.velocity={x:0,y:0}}get delta(){return rO.delta(this.current,this.initial)}get direction(){const{current:e,previous:t}=this;if(!t)return null;const n={x:e.x-t.x,y:e.y-t.y};return n.x||n.y?Math.abs(n.x)>Math.abs(n.y)?n.x>0?"right":"left":n.y>0?"down":"up":null}get current(){return super.current}set current(e){const{current:t}=this,n=rO.from(e),r={x:n.x-t.x,y:n.y-t.y},i=Date.now(),o=i-(nO(a=this,s=VP,"read from private field"),s.get(a));var a,s;const l=e=>Math.round(e/o*100);mM((()=>{((e,t,n)=>{nO(e,t,"write to private field"),t.set(e,n)})(this,VP,i),this.velocity={x:l(r.x),y:l(r.y)},super.current=n}))}reset(e=this.defaultValue){super.reset(rO.from(e)),this.velocity={x:0,y:0}}};GP=(e=>{var t;return[,,,UP(null!=(t=null==e?void 0:e[XP("metadata")])?t:null)]})(HP),VP=new WeakMap,tO(GP,2,"delta",BP,iO),tO(GP,2,"direction",$P,iO),((e,t)=>{((e,t,n)=>{t in e?YP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(t,XP("metadata"),e[3])})(GP,iO);var oO=(e=>(e.Horizontal="x",e.Vertical="y",e))(oO||{});Object.values(oO);var aO=e=>{var t;return null!=(t=(({dragOperation:e,droppable:t})=>{const n=e.position.current;if(!n)return null;const{id:r}=t;if(!t.shape)return null;if(t.shape.containsPoint(n))return{id:r,value:1/rO.distance(t.shape.center,n),type:u_.PointerIntersection,priority:c_.High};return null})(e))?t:(({dragOperation:e,droppable:t})=>{const{shape:n}=e;if(!t.shape||!(null==n?void 0:n.current))return null;const r=n.current.intersectionArea(t.shape);if(r){const{position:i}=e,o=rO.distance(t.shape.center,i.current),a=r/(n.current.area+t.shape.area-r)/o;return{id:t.id,value:a,type:u_.ShapeIntersection,priority:c_.Normal}}return null})(e)};function sO(e){const{collisionDetector:t,data:n,disabled:r,element:i,id:o,accept:a,type:s}=e,l=WP((t=>new SP(((e,t)=>AP(e,PP(t)))(((e,t)=>{for(var n in t||(t={}))TP.call(t,n)&&qP(e,n,t[n]);if(OP)for(var n of OP(t))LP.call(t,n)&&qP(e,n,t[n]);return e})({},e),{register:!1,element:CP(i)}),t))),c=kP(l);return RP(o,(()=>l.id=o)),IP(i,(e=>l.element=e)),RP(a,(()=>l.accept=a),void 0,kk),RP(t,(()=>l.collisionDetector=null!=t?t:aO)),RP(n,(()=>n&&(l.data=n))),RP(r,(()=>l.disabled=!0===r)),RP(s,(()=>l.type=s)),{droppable:c,get isDropTarget(){return c.isDropTarget},ref:h((e=>{var t,n;(e||!(null==(t=l.element)?void 0:t.isConnected)||(null==(n=l.manager)?void 0:n.dragOperation.status.idle))&&(l.element=null!=e?e:void 0)}),[l])}}const lO=e=>Array.from({length:e},((e,t)=>t)),cO=({title:e,message:t})=>Ji.jsxs(Yc,{sx:{padding:2,display:"flex",flexDirection:"column",alignItems:"center"},children:[Ji.jsx(uc,{sx:{textAlign:"center",width:"fit-content",maxWidth:"100%",overflowWrap:"break-word",textOverflow:"ellipsis",fontWeight:"bold",fontSize:14},children:e}),Ji.jsx(uc,{sx:{textAlign:"center",width:"fit-content",maxWidth:"100%",overflowWrap:"break-word",textOverflow:"ellipsis",fontSize:12},children:t})]}),uO=({id:e,sectionIndex:t})=>{const n=QC(uM);return void 0===n?null:Ji.jsx(n,{id:e,sectionIndex:t})};var dO=Object.create,hO=Object.defineProperty,pO=Object.defineProperties,fO=Object.getOwnPropertyDescriptor,mO=Object.getOwnPropertyDescriptors,gO=Object.getOwnPropertySymbols,yO=Object.prototype.hasOwnProperty,vO=Object.prototype.propertyIsEnumerable,bO=e=>{throw TypeError(e)},xO=(e,t,n)=>t in e?hO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wO=["class","method","getter","setter","accessor","field","value","get","set"],SO=e=>void 0!==e&&"function"!=typeof e?bO("Function expected"):e,CO=(e,t,n,r,i)=>({kind:wO[e],name:t,metadata:r,addInitializer:e=>n._?bO("Already initialized"):i.push(SO(e||null))}),MO=(e,t,n,r)=>{for(var i=0,o=e[t>>1],a=o&&o.length;i<a;i++)1&t?o[i].call(n):r=o[i].call(n,r);return r},kO=(e,t,n,r,i,o)=>{for(var a,s,l,c,u,d=7&t,h=e.length+1,p=wO[d+5],f=e[h-1]=[],m=e[h]||(e[h]=[]),g=(i=i.prototype,fO({get[n](){return _O(this,o)},set[n](e){return IO(this,o,e)}},n)),y=r.length-1;y>=0;y--)(c=CO(d,n,l={},e[3],m)).static=false,c.private=false,u=c.access={has:e=>n in e},u.get=e=>e[n],u.set=(e,t)=>e[n]=t,s=(0,r[y])({get:g.get,set:g.set},c),l._=1,void 0===s?SO(s)&&(g[p]=s):"object"!=typeof s||null===s?bO("Object expected"):(SO(a=s.get)&&(g.get=a),SO(a=s.set)&&(g.set=a),SO(a=s.init)&&f.unshift(a));return g&&hO(i,n,g),i},EO=(e,t,n)=>t.has(e)||bO("Cannot "+n),_O=(e,t,n)=>(EO(e,t,"read from private field"),t.get(e)),RO=(e,t,n)=>t.has(e)?bO("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),IO=(e,t,n,r)=>(EO(e,t,"write to private field"),t.set(e,n),n);function DO(e){return e instanceof oT||e instanceof iT}var AO=Object.defineProperty,PO=Object.defineProperties,OO=Object.getOwnPropertyDescriptors,TO=Object.getOwnPropertySymbols,LO=Object.prototype.hasOwnProperty,qO=Object.prototype.propertyIsEnumerable,NO=(e,t,n)=>t in e?AO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jO=(e,t)=>{for(var n in t||(t={}))LO.call(t,n)&&NO(e,n,t[n]);if(TO)for(var n of TO(t))qO.call(t,n)&&NO(e,n,t[n]);return e},zO=(e,t)=>PO(e,OO(t));function FO(e,t,n){if(t===n)return e;const r=e.slice();return r.splice(n,0,r.splice(t,1)[0]),r}function WO(e,t){return function(e,t,n){var r,i;const{source:o,target:a,canceled:s}=t.operation;if(!o||!a||s)return"preventDefault"in t&&t.preventDefault(),e;const l=(e,t)=>e===t||"object"==typeof e&&"id"in e&&e.id===t;if(Array.isArray(e)){const t=e.findIndex((e=>l(e,o.id))),r=e.findIndex((e=>l(e,a.id)));if(-1===t||-1===r)return e;if(!s&&"index"in o&&"number"==typeof o.index){const r=o.index;if(r!==t)return n(e,t,r)}return n(e,t,r)}const c=Object.entries(e);let u,d,h=-1,p=-1;for(const[e,t]of c)if(-1===h&&(h=t.findIndex((e=>l(e,o.id))),-1!==h&&(u=e)),-1===p&&(p=t.findIndex((e=>l(e,a.id))),-1!==p&&(d=e)),-1!==h&&-1!==p)break;if(!o.manager)return e;const{dragOperation:f}=o.manager,m=null!=(i=null==(r=f.shape)?void 0:r.current.center)?i:f.position.current;if(null==d&&a.id in e){const t=a.shape&&m.y>a.shape.center.y?e[a.id].length:0;d=a.id,p=t}if(null==u||null==d||u===d&&h===p)return"preventDefault"in t&&t.preventDefault(),e;if(u===d)return zO(jO({},e),{[u]:n(e[u],h,p)});const g=a.shape&&Math.round(m.y)>Math.round(a.shape.center.y)?1:0,y=e[u][h];return zO(jO({},e),{[u]:[...e[u].slice(0,h),...e[u].slice(h+1)],[d]:[...e[d].slice(0,p+g),y,...e[d].slice(p+g)]})}(e,t,FO)}var $O="__default__";function BO(e,t,n,r){const i=r<t?"afterend":"beforebegin";n.insertAdjacentElement(i,e)}function HO(e,t){return e.index-t.index}function VO(e){return Array.from(e).sort(HO)}var GO,UO,YO,KO,XO,JO,ZO,QO,eT=[class extends WE{constructor(e){super(e);const t=TM((()=>{const{dragOperation:t}=e;if(nD(t.activatorEvent)&&DO(t.source)&&t.status.initialized){const t=e.registry.plugins.get(DA);if(t)return t.disable(),()=>t.enable()}})),n=e.monitor.addEventListener("dragmove",((e,t)=>{queueMicrotask((()=>{if(this.disabled||e.defaultPrevented||!e.nativeEvent)return;const{dragOperation:n}=t;if(!nD(e.nativeEvent))return;if(!DO(n.source))return;if(!n.shape)return;const{actions:r,collisionObserver:i,registry:o}=t,{by:a}=e;if(!a)return;const s=function(e){const{x:t,y:n}=e;if(t>0)return"right";if(t<0)return"left";if(n>0)return"down";if(n<0)return"up"}(a),{source:l,target:c}=n,{center:u}=n.shape.current,d=[],h=[];mM((()=>{for(const e of o.droppables){const{id:t}=e;if(!e.accepts(l)||t===(null==c?void 0:c.id)&&DO(e)||!e.element)continue;let n=e.shape;const r=new ZI(e.element,{getBoundingClientRect:e=>WR(e,void 0,.2)});r.height&&r.width&&(("down"==s&&u.y+10<r.center.y||"up"==s&&u.y-10>r.center.y||"left"==s&&u.x-10>r.center.x||"right"==s&&u.x+10<r.center.x)&&(d.push(e),e.shape=r,h.push((()=>e.shape=n))))}})),e.preventDefault(),i.disable();const p=i.computeCollisions(d,aD);mM((()=>h.forEach((e=>e()))));const[f]=p;if(!f)return;const{id:m}=f,{index:g,group:y}=l.sortable;r.setDropTarget(m).then((()=>{const{source:e,target:t,shape:o}=n;if(!e||!DO(e)||!o)return;const{index:a,group:s,target:l}=e.sortable,c=g!==a||y!==s,u=c?l:null==t?void 0:t.element;if(!u)return;VI(u);const d=new ZI(u);if(!d)return;const h=eE.delta(d,eE.from(o.current.boundingRectangle),e.alignment);r.move({by:h}),c?r.setDropTarget(e.id).then((()=>i.enable())):i.enable()}))}))}));this.destroy=()=>{n(),t()}}},class extends WE{constructor(e){super(e);const t=()=>{const t=new Map;for(const n of e.registry.droppables)if(n instanceof oT){const{sortable:e}=n,{group:r}=e;let i=t.get(r);i||(i=new Set,t.set(r,i)),i.add(e)}for(const[e,n]of t)t.set(e,new Set(VO(n)));return t},n=[e.monitor.addEventListener("dragover",((e,n)=>{if(this.disabled)return;const{dragOperation:r}=n,{source:i,target:o}=r;if(!DO(i)||!DO(o))return;if(i.sortable===o.sortable)return;const a=t(),s=i.sortable.group===o.sortable.group,l=a.get(i.sortable.group),c=s?l:a.get(o.sortable.group);l&&c&&queueMicrotask((()=>{e.defaultPrevented||n.renderer.rendering.then((()=>{var r,u,d;const h=t();for(const[e,t]of a.entries()){const n=Array.from(t).entries();for(const[t,i]of n)if(i.index!==t||i.group!==e||!(null==(r=h.get(e))?void 0:r.has(i)))return}const p=i.sortable.element,f=o.sortable.element;if(!f||!p)return;if(!s&&o.id===i.sortable.group)return;const m=VO(l),g=s?m:VO(c),y=null!=(u=i.sortable.group)?u:$O,v=null!=(d=o.sortable.group)?d:$O,b={[y]:m,[v]:g},x=WO(b,e);if(b===x)return;const w=x[v].indexOf(i.sortable),S=x[v].indexOf(o.sortable);n.collisionObserver.disable(),BO(p,w,f,S),mM((()=>{for(const[e,t]of x[y].entries())t.index=e;if(!s)for(const[e,t]of x[v].entries())t.group=o.sortable.group,t.index=e})),n.actions.setDropTarget(i.id).then((()=>n.collisionObserver.enable()))}))}))})),e.monitor.addEventListener("dragend",((e,n)=>{if(!e.canceled)return;const{dragOperation:r}=n,{source:i}=r;DO(i)&&(i.sortable.initialIndex===i.sortable.index&&i.sortable.initialGroup===i.sortable.group||queueMicrotask((()=>{const e=t(),r=e.get(i.sortable.initialGroup);r&&n.renderer.rendering.then((()=>{for(const[t,n]of e.entries()){const e=Array.from(n).entries();for(const[n,r]of e)if(r.index!==n||r.group!==t)return}const t=VO(r),n=i.sortable.element,o=t[i.sortable.initialIndex],a=null==o?void 0:o.element;o&&a&&n&&(BO(n,o.index,a,i.index),mM((()=>{for(const[t,n]of e.entries()){const e=Array.from(n).values();for(const t of e)t.index=t.initialIndex,t.group=t.initialGroup}})))}))})))}))];this.destroy=()=>{for(const e of n)e()}}}],tT={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1},nT=new class{constructor(){wk(this,Dk,new WeakMap)}get(e,t){var n;return e?null==(n=xk(this,Dk).get(e))?void 0:n.get(t):void 0}set(e,t,n){var r;if(e)return xk(this,Dk).has(e)||xk(this,Dk).set(e,new Map),null==(r=xk(this,Dk).get(e))?void 0:r.set(t,n)}clear(e){var t;return e?null==(t=xk(this,Dk).get(e))?void 0:t.clear():void 0}};UO=[Ek],GO=[Ek];var rT=class{constructor(e,t){RO(this,KO,MO(YO,8,this)),MO(YO,11,this),RO(this,XO),RO(this,JO),RO(this,ZO,MO(YO,12,this)),MO(YO,15,this),RO(this,QO),this.register=()=>(mM((()=>{var e,t;null==(e=this.manager)||e.registry.register(this.droppable),null==(t=this.manager)||t.registry.register(this.draggable)})),()=>this.unregister()),this.unregister=()=>{mM((()=>{var e,t;null==(e=this.manager)||e.registry.unregister(this.droppable),null==(t=this.manager)||t.registry.unregister(this.draggable)}))},this.destroy=()=>{mM((()=>{this.droppable.destroy(),this.draggable.destroy()}))};var n=e,{effects:r=()=>[],group:i,index:o,sensors:a,type:s,transition:l=tT,plugins:c=eT}=n,u=((e,t)=>{var n={};for(var r in e)yO.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&gO)for(var r of gO(e))t.indexOf(r)<0&&vO.call(e,r)&&(n[r]=e[r]);return n})(n,["effects","group","index","sensors","type","transition","plugins"]);this.droppable=new oT(u,t,this),this.draggable=new iT(((e,t)=>pO(e,mO(t)))(((e,t)=>{for(var n in t||(t={}))yO.call(t,n)&&xO(e,n,t[n]);if(gO)for(var n of gO(t))vO.call(t,n)&&xO(e,n,t[n]);return e})({},u),{effects:()=>[()=>{var e,t,n;const r=null==(e=this.manager)?void 0:e.dragOperation.status;(null==r?void 0:r.initializing)&&this.id===(null==(n=null==(t=this.manager)?void 0:t.dragOperation.source)?void 0:n.id)&&nT.clear(this.manager),(null==r?void 0:r.dragging)&&nT.set(this.manager,this.id,yM((()=>({initialIndex:this.index,initialGroup:this.group}))))},()=>{const{index:e,group:t,manager:n}=this,r=_O(this,JO),i=_O(this,XO);e===r&&t===i||(IO(this,JO,e),IO(this,XO,t),this.animate())},()=>{const{target:e}=this,{feedback:t,isDragSource:n}=this.draggable;"move"==t&&n&&(this.droppable.disabled=!e)},()=>{const{manager:e}=this;for(const t of c)null==e||e.registry.register(t)},...r()],type:s,sensors:a}),t,this),IO(this,QO,u.element),this.manager=t,this.index=o,IO(this,JO,o),this.group=i,IO(this,XO,i),this.type=s,this.transition=l}get initialIndex(){var e,t;return null!=(t=null==(e=nT.get(this.manager,this.id))?void 0:e.initialIndex)?t:this.index}get initialGroup(){var e,t;return null!=(t=null==(e=nT.get(this.manager,this.id))?void 0:e.initialGroup)?t:this.group}animate(){yM((()=>{const{manager:e,transition:t}=this,{shape:n}=this.droppable;if(!e)return;const{idle:r}=e.dragOperation.status;n&&t&&(!r||t.idle)&&e.renderer.rendering.then((()=>{const{element:r}=this;if(!r)return;const i=this.refreshShape();if(!i)return;const o=n.boundingRectangle.left-i.boundingRectangle.left,a=n.boundingRectangle.top-i.boundingRectangle.top,{translate:s}=OI(r),l=UI(r,s,!1),c=UI(r,s);(o||a)&&GI({element:r,keyframes:{translate:[`${l.x+o}px ${l.y+a}px ${l.z}`,`${c.x}px ${c.y}px ${c.z}`]},options:t}).then((()=>{e.dragOperation.status.dragging||(this.droppable.shape=void 0)}))}))}))}get manager(){return this.draggable.manager}set manager(e){mM((()=>{this.draggable.manager=e,this.droppable.manager=e}))}set element(e){mM((()=>{const t=_O(this,QO),n=this.droppable.element,r=this.draggable.element;n&&n!==t||(this.droppable.element=e),r&&r!==t||(this.draggable.element=e),IO(this,QO,e)}))}get element(){var e,t;const n=_O(this,QO);if(n)return null!=(t=null!=(e=KR.get(n))?e:n)?t:this.droppable.element}set target(e){this.droppable.element=e}get target(){return this.droppable.element}set source(e){this.draggable.element=e}get source(){return this.draggable.element}get disabled(){return this.draggable.disabled&&this.droppable.disabled}set feedback(e){this.draggable.feedback=e}set disabled(e){mM((()=>{this.droppable.disabled=e,this.draggable.disabled=e}))}set data(e){mM((()=>{this.droppable.data=e,this.draggable.data=e}))}set handle(e){this.draggable.handle=e}set id(e){mM((()=>{this.droppable.id=e,this.draggable.id=e}))}get id(){return this.droppable.id}set sensors(e){this.draggable.sensors=e}set modifiers(e){this.draggable.modifiers=e}set collisionPriority(e){this.droppable.collisionPriority=e}set collisionDetector(e){this.droppable.collisionDetector=null!=e?e:oD}set alignment(e){this.draggable.alignment=e}get alignment(){return this.draggable.alignment}set type(e){mM((()=>{this.droppable.type=e,this.draggable.type=e}))}get type(){return this.draggable.type}set accept(e){this.droppable.accept=e}get accept(){return this.droppable.accept}get isDropTarget(){return this.droppable.isDropTarget}get isDragSource(){return this.draggable.isDragSource}get isDragging(){return this.draggable.isDragging}get isDropping(){return this.draggable.isDropping}get status(){return this.draggable.status}refreshShape(){return this.droppable.refreshShape()}accepts(e){return this.droppable.accepts(e)}};YO=[,,,dO(null)],KO=new WeakMap,XO=new WeakMap,JO=new WeakMap,ZO=new WeakMap,QO=new WeakMap,kO(YO,4,"index",UO,rT,KO),kO(YO,4,"group",GO,rT,ZO),((e,t)=>{return xO(t,(n="metadata",(r=Symbol[n])?r:Symbol.for("Symbol."+n)),e[3]);var n,r})(YO,rT);var iT=class extends wP{constructor(e,t,n){super(e,t),this.sortable=n}get index(){return this.sortable.index}},oT=class extends SP{constructor(e,t,n){super(e,t),this.sortable=n}},aT=Object.defineProperty,sT=Object.defineProperties,lT=Object.getOwnPropertyDescriptors,cT=Object.getOwnPropertySymbols,uT=Object.prototype.hasOwnProperty,dT=Object.prototype.propertyIsEnumerable,hT=(e,t,n)=>t in e?aT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pT=(e,t)=>{for(var n in t||(t={}))uT.call(t,n)&&hT(e,n,t[n]);if(cT)for(var n of cT(t))dT.call(t,n)&&hT(e,n,t[n]);return e};function fT(e){const{accept:t,collisionDetector:n,collisionPriority:r,id:i,data:o,element:a,handle:s,index:l,group:c,disabled:u,feedback:d,modifiers:p,sensors:f,target:m,type:g}=e,y=pT(pT({},tT),e.transition),v=WP((t=>new rT(((e,t)=>sT(e,lT(t)))(pT({},e),{transition:y,register:!1,handle:CP(s),element:CP(a),target:CP(m),feedback:d}),t))),b=kP(v,mT);return RP(i,(()=>v.id=i)),MP((()=>{mM((()=>{v.group=c,v.index=l}))}),[v,c,l]),RP(g,(()=>v.type=g)),RP(t,(()=>v.accept=t),void 0,kk),RP(o,(()=>o&&(v.data=o))),RP(l,(()=>{var e;(null==(e=v.manager)?void 0:e.dragOperation.status.idle)&&(null==y?void 0:y.idle)&&v.refreshShape()}),EP),IP(s,(e=>v.handle=e)),IP(a,(e=>v.element=e)),IP(m,(e=>v.target=e)),RP(u,(()=>v.disabled=!0===u)),RP(f,(()=>v.sensors=f)),RP(n,(()=>v.collisionDetector=n)),RP(r,(()=>v.collisionPriority=r)),RP(d,(()=>v.feedback=null!=d?d:"default")),RP(y,(()=>v.transition=y),void 0,kk),RP(p,(()=>v.modifiers=p),void 0,kk),RP(e.alignment,(()=>v.alignment=e.alignment)),{sortable:b,get isDragging(){return b.isDragging},get isDropping(){return b.isDropping},get isDragSource(){return b.isDragSource},get isDropTarget(){return b.isDropTarget},handleRef:h((e=>{v.handle=null!=e?e:void 0}),[v]),ref:h((e=>{var t,n;(e||!(null==(t=v.element)?void 0:t.isConnected)||(null==(n=v.manager)?void 0:n.dragOperation.status.idle))&&(v.element=null!=e?e:void 0)}),[v]),sourceRef:h((e=>{var t,n;(e||!(null==(t=v.source)?void 0:t.isConnected)||(null==(n=v.manager)?void 0:n.dragOperation.status.idle))&&(v.source=null!=e?e:void 0)}),[v]),targetRef:h((e=>{var t,n;(e||!(null==(t=v.target)?void 0:t.isConnected)||(null==(n=v.manager)?void 0:n.dragOperation.status.idle))&&(v.target=null!=e?e:void 0)}),[v])}}function mT(e,t,n){return!("isDragSource"!==e||n||!t)}const gT=({id:e,itemIndex:t,sectionIndex:n})=>Ji.jsx("div",{children:`${n}:${t} - ${e}`}),yT=({id:e,itemIndex:t,sectionIndex:n})=>{const r=QC(dM),i=QC(cM),o=QC(aM)({sectionIndex:n}),{ref:a,isDragging:s}=fT({id:e,index:t,type:"item",accept:"item",group:o}),l=void 0!==r?()=>{r({id:e,itemIndex:t,sectionIndex:n})}:void 0,c=i??gT;return Ji.jsx(Ad,{"data-testid":"section-item",onClick:l,ref:a,"data-dragging":s,sx:{padding:0},children:Ji.jsx(c,{id:e,itemIndex:t,sectionIndex:n})})},vT=({sectionIndex:e})=>{const t=QC(aM),n=QC(oM),r=QC(sM),i=t({sectionIndex:e}),o=r(e),{ref:a}=sO({id:i,type:"column",accept:"item",collisionPriority:c_.Low});return Ji.jsx(Yc,{className:"exploration-list",ref:a,style:{overflow:"auto"},children:Ji.jsxs(bd,{children:[Ji.jsx($u,{}),Ji.jsx(uO,{id:i,sectionIndex:e}),Ji.jsx($u,{}),o?Ji.jsx(cO,{title:o.title,message:o.message}):null,lO(n(e)).map((n=>{const r=t({sectionIndex:e,itemIndex:n});return Ji.jsx(yT,{id:r,itemIndex:n,sectionIndex:e},r)}))]})})},bT=()=>{const e=QC(iM),t=QC(aM),n=QC(lM);return Ji.jsx(FP,{onDragOver:e=>{n?.(e)},children:Ji.jsx(Yc,{style:{display:"flex",flexDirection:"column"},children:lO(e).map((e=>Ji.jsx(vT,{sectionIndex:e},t({sectionIndex:e}))))})})},xT=e=>Ji.jsx(UC,{children:Ji.jsx(hM,{props:e,children:Ji.jsx(bT,{})})}),wT="12px",ST="nebula-table-utils-head-menu-button",CT="sn-copy-cell",MT="PSEUDO-DIM";let kT=function(e){return e.Enter="Enter",e.Space=" ",e.Esc="Escape",e.Tab="Tab",e.Shift="Shift",e.Left="ArrowLeft",e.Right="ArrowRight",e.Up="ArrowUp",e.Down="ArrowDown",e.C="c",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.F2="F2",e}({});const ET="nebula-table-utils-column-adjuster";let _T=function(e){return e[e.PixelsMin=30]="PixelsMin",e[e.PixelsMax=7680]="PixelsMax",e[e.PixelsDefault=200]="PixelsDefault",e[e.PercentageMin=1]="PercentageMin",e[e.PercentageMax=100]="PercentageMax",e[e.PercentageDefault=20]="PercentageDefault",e[e.PercentageMaxInIndentMode=75]="PercentageMaxInIndentMode",e[e.AutoMinPivot=80]="AutoMinPivot",e[e.AutoMinTable=120]="AutoMinTable",e}({}),RT=function(e){return e.Auto="auto",e.FitToContent="fitToContent",e.Pixels="pixels",e.Percentage="percentage",e}({});const IT={darker:.15,brighter:.3,opacity:.03},DT={darker:.3,brighter:.5,opacity:.05};let AT=function(e){return e.Cyclic="C",e}({});const PT={noItems:{row:"ChartExploration.PivotTable.RowSectionEmpty.Title",column:"ChartExploration.PivotTable.ColumnSectionEmpty.Title",measure:"ChartExploration.PivotTable.MeasureSectionEmpty.Title"},noSearchFound:{row:"ChartExploration.PivotTable.NoRowsFound.Title",column:"ChartExploration.PivotTable.NoColumnsFound.Title",measure:"ChartExploration.PivotTable.NoMeasuresFound.Title"}},OT="ChartExploration.PivotTable.DimensionSectionEmpty.Message",TT="ChartExploration.PivotTable.MeasureSectionEmpty.Message",LT="#177fe6",qT=(e,t)=>{const n=new Map;for(const t of e)n.set(t.id,t);return t.reduce(((e,t)=>{const r=-1===t?MT:t,i=n.get(r);return i&&e.push(i),e}),[])},NT=(e,t=new Set)=>hS((n=>{const r=n(e),i=n(lC);if(!r||0===r.length)return"disabled";const o=r.filter((e=>!t.has(e.id)));if(0===o.length)return"disabled";const a=o.filter((e=>i.has(e.id))).length;return 0===a?"none":a===o.length?"all":"some"})),jT=(e,t=new Set)=>hS(null,((n,r,i)=>{const o=n(e);o&&0!==o.length&&(e=>{const{items:t,shouldCheckAll:n,get:r,set:i,excludedIds:o}=e,a=t.filter((e=>!o?.has(e.id)));if(0===a.length)return;const s=r(lC),l=new Set,c=new Set;if(a.forEach((e=>{const t=s.has(e.id);t&&!n&&c.add(e.id),!t&&n&&l.add(e.id)})),0!==l.size||0!==c.size){if(l.size>0){const e=new Set(r(iC));l.forEach((t=>e.add(t))),i(iC,e)}if(c.size>0){const e=new Set(r(oC));c.forEach((t=>e.add(t))),i(oC,e)}jS({type:"apply",localChecked:l,localUnchecked:c,handler:r(FS),model:r(zS),fieldInfo:r(nC)})}})({items:o,shouldCheckAll:i,get:n,set:r,excludedIds:t})})),zT=hS((e=>{const t=e(ZS);return t?.qHyperCube.qDimensionInfo.filter(VS).map((({cId:e,qFallbackTitle:t})=>({id:e,title:t})))})),FT=hS((e=>e(JS)?.qHyperCube.excludedNoOfLeftDims??-1)),WT=hS((e=>{const t=e(JS),n=e($S),r=t?.qHyperCube.qEffectiveInterColumnSortOrder.map((e=>{if(-1===e)return{id:MT,title:n("Common.Values")};const{cId:r,qFallbackTitle:i}=t.qHyperCube.qDimensionInfo[e];return{id:r,title:i}}));return r})),$T=hS((e=>{const t=e(JS),n=e($S),r=e(WT),i=e(zT),o=e(FT),a=e(HS),s=e(FS),l=t?.qHyperCube.rankedList?.columns??s?.getRankedList("columns"),c=t?.qHyperCube.rankedList?.rows??s?.getRankedList("rows");if(void 0===t||void 0===r||void 0===i||void 0===l||void 0===c)return[];const u=-1===t.qHyperCube.qNoOfLeftDims,d=-1===o,h=u?r:r.slice(0,t.qHyperCube.qNoOfLeftDims),p=u?[]:r.slice(t.qHyperCube.qNoOfLeftDims),f=d?i:i.slice(0,o),m=d?[]:i.slice(o),g=[...h,...f].filter(a),y=[...p,...m].filter(a);return[{id:"rows",title:n("Common.Rows"),items:qT(g,c)},{id:"columns",title:n("Common.Columns"),items:qT(y,l)}]})),BT=_S((e=>hS((t=>t($T).at(e))))),HT=_S((({sectionIndex:e,itemIndex:t})=>hS((n=>n(BT(e))?.items.at(t)?.title))),((e,t)=>e.sectionIndex===t.sectionIndex&&e.itemIndex===t.itemIndex)),VT=_S((e=>hS((t=>t(BT(e))?.title)))),GT=hS((e=>({sectionIndex:t,itemIndex:n})=>{const r=e(BT(t)),i=0===t?"rows":"columns";return void 0===r?i:void 0!==n?r.items.at(n)?.id??i:r.id})),UT=hS((e=>t=>{const n=e(BT(t));return n?.items.length??0})),YT=_S((e=>NT(hS((t=>t(BT(e))?.items)),new Set([MT])))),KT=_S((e=>jT(hS((t=>t(BT(e))?.items)),new Set([MT])))),XT=hS((e=>{const t=e(ZS);return t?.qHyperCube.qMeasureInfo.filter(VS).map((({cId:e,qFallbackTitle:t})=>({id:e,title:t})))})),JT=hS((e=>{const t=e(JS),n=e(XT),r=e(HS),i=e(FS),o=t?.qHyperCube.rankedList?.measures??i?.getRankedList("measures");if(void 0===t||void 0===n||void 0===o)return[];const a=t.qHyperCube.qMeasureInfo.filter(VS).map((({cId:e,qFallbackTitle:t})=>({id:e,title:t})));a.push(...n);const s=a.filter(r);return qT(s,o)})),ZT=_S((e=>hS((t=>t(JT)[e].title)))),QT=hS((e=>({itemIndex:t})=>{const n=e(JT);return void 0!==t?n[t].id:"measures"})),eL=hS((e=>()=>e(JT).length)),tL=NT(JT),nL=jT(JT),rL=(e,t,n,r)=>{if("measure"===t)return e(r?PT.noSearchFound.measure:PT.noItems.measure);const i=r?PT.noSearchFound:PT.noItems;return e(n?i.row:i.column)},iL=(e,t,n)=>n?"":e("measure"===t?TT:OT),oL=_S((e=>hS((t=>{const n=t($S);return r=>{const i="measure"===e?t(eL)():t(UT)(r??0),o=0===r,a=t(BS).length>0;if(!(i>0))return{title:rL(n,e,o,a),message:iL(n,e,a)}}})))),aL=oL("measure"),sL=oL("dimensions"),lL=({children:e})=>Ji.jsx("span",{style:{width:"fit-content",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontWeight:"bold",paddingLeft:4},children:e}),cL=({children:e,sectionIndex:t})=>{const n=MS(void 0!==t?YT(t):tL),r=kS(void 0!==t?KT(t):nL);return Ji.jsxs(Yc,{style:{display:"flex",alignItems:"center",width:"100%",padding:"2px 8px 2px 8px",boxSizing:"border-box"},children:[Ji.jsx(xu,{disabled:"disabled"===n,checked:"all"===n,indeterminate:"some"===n,onChange:e=>{r(e.target.checked)},size:"small",style:{flexShrink:0,padding:9}}),Ji.jsx(lL,{children:e})]})},uL=({sectionIndex:e})=>{const t=MS(VT(e));return Ji.jsx(cL,{sectionIndex:e,children:t})},dL=v(((e,t)=>Ji.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 16 16",height:"16px",role:"img",ref:t,...e,children:[Ji.jsx("g",{clipPath:"url(#dimension_svg__clip0_482_3308)",children:Ji.jsx("path",{d:"M.5 4.774v6.452a2 2 0 0 0 1.154 1.813l5.5 2.566a2 2 0 0 0 1.692 0l5.5-2.566a2 2 0 0 0 1.154-1.813V4.774a2 2 0 0 0-1.154-1.813L8.846.395a2 2 0 0 0-1.692 0l-5.5 2.566A2 2 0 0 0 .5 4.774m1 0v-.032l6 2.428v7.493l-5.423-2.53a1 1 0 0 1-.577-.907zm.545-.89.032-.016 5.5-2.567a1 1 0 0 1 .846 0l5.5 2.567.032.015L8 6.293zm12.455.858v6.484a1 1 0 0 1-.577.906L8.5 14.663V7.17z"})}),Ji.jsx("defs",{children:Ji.jsx("clipPath",{id:"dimension_svg__clip0_482_3308",children:Ji.jsx("path",{d:"M0 0h16v16H0z"})})})]}))),hL=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M5.5 1a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zm0 4a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zM5 9.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm.5 3.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zM9 1.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zM9.5 5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zM9 9.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm.5 3.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5z"})}))),pL=ll("div")({position:"absolute",width:"1px",height:"1px",padding:0,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}),fL=ll(hL)((()=>({padding:"6px 6px",flexShrink:0,cursor:"grab","&:focus-visible":{boxShadow:`0 0 0 2px ${LT} inset`}}))),mL=e=>"svg"===e.tagName?"exploration-draggable-icon":e.className,gL=(e,t)=>{const n=e.closest(".exploration-list"),r=n?.nextElementSibling||n?.parentElement?.nextElementSibling;return r?r.getElementsByClassName(t)[0]:e.closest(".exploration-panel")?.getElementsByClassName(t)[0]},yL=e=>{(e instanceof HTMLElement||e instanceof SVGElement)&&e.focus()},vL=e=>{const t=e.key===kT.Down?(e=>{const{currentTarget:t}=e,n=mL(t),r=t.closest("li"),i=r?.nextElementSibling?.getElementsByClassName(n)[0];return i||gL(t,n)})(e):(e=>{const{currentTarget:t}=e,n=mL(t),r=t.closest("li"),i=r?.previousElementSibling?.getElementsByClassName(n)[0];return i||((e,t)=>{const n=e.closest(".exploration-list"),r=n?.previousElementSibling||n?.parentElement?.parentElement?.previousElementSibling;if(!r){const n=e.closest(".exploration-panel")?.getElementsByClassName(t).length||0;return n>0?e.closest(".exploration-panel")?.getElementsByClassName(t)[n-1]:null}const i=r.getElementsByTagName("li").length;return r.getElementsByClassName(t)[i-1]})(t,n)})(e);t&&yL(t)},bL=(e,t)=>{const{key:n}=e;switch(e.preventDefault(),n){case kT.Tab:((e,t)=>{const{currentTarget:n}=e;if(n!==t.items.explorationItemFocusRef.current){if(n===t.items.draggableIconRef.current){const e=n.closest("ul")?.getElementsByClassName("exploration-item-focus");if((e?.length||0)-1>t.itemIndex){const n=e&&e[t.itemIndex+1];return void(n&&yL(n))}const r=gL(n,"exploration-item-focus");r&&yL(r)}}else{const e=n.closest("li")?.getElementsByClassName("exploration-draggable-icon")[0];e&&yL(e)}})(e,t);break;case kT.Down:case kT.Up:e.stopPropagation(),vL(e);break;case kT.Enter:case kT.Space:e.stopPropagation(),((e,t)=>{const{currentTarget:n}=e;if(n!==t.items.draggableIconRef.current)if(n!==t.items.explorationItemRef.current)n===t.items.explorationItemFocusRef.current&&t.toggleCheckedById(t.id);else{const e=n.getElementsByClassName("exploration-draggable-icon")[0];yL(e)}else{const e=n.closest("li")?.getElementsByClassName("exploration-item")[0];e&&yL(e)}})(e,t)}},xL=({children:e})=>Ji.jsx("span",{style:{width:"fit-content",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,paddingLeft:4},children:e}),wL=({icon:e,title:n,...r})=>{const[i,o]=ES(lC),a=MS($S),s=t.useRef(null),l=t.useRef(null),c=t.useRef(null),u={id:r.id,itemIndex:r.itemIndex,toggleCheckedById:o,items:{explorationItemRef:s,explorationItemFocusRef:l,draggableIconRef:c}};return Ji.jsxs(Yc,{ref:s,className:"exploration-item",onClick:e=>{e.stopPropagation(),o(r.id)},onKeyDown:e=>{bL(e,u)},tabIndex:-1,style:{display:"flex",alignItems:"center",width:"100%",cursor:"pointer",padding:"2px 8px 2px 24px",boxSizing:"border-box"},title:n,sx:{"&:hover":{backgroundColor:"action.hover"},"&:focus-visible":{boxShadow:`0 0 0 2px ${LT} inset`}},children:[Ji.jsxs(Yc,{ref:l,className:"exploration-item-focus",component:"div",tabIndex:0,onKeyDown:e=>{bL(e,u)},sx:{display:"flex",minWidth:0,alignItems:"center",justifyContent:"space-between",flexGrow:1,marginRight:"4px","&:focus-visible":{boxShadow:`0 0 0 2px ${LT} inset`}},children:[Ji.jsx(xu,{checked:i.has(r.id),"aria-label":a("ChartExploration.ListItem.Label",n),size:"small",tabIndex:-1,style:{padding:9,flexShrink:0,visibility:r.id===MT?"hidden":"visible"}}),Ji.jsx(e,{height:"12px",style:{flexShrink:0}}),Ji.jsx(xL,{children:n})]}),Ji.jsx(fL,{ref:c,className:"exploration-draggable-icon",tabIndex:0,height:"16px",onKeyDown:e=>{bL(e,u)}})]})},SL=e=>{const t=MS(HT(e))??"";return Ji.jsx(wL,{title:t,icon:dL,...e})},CL=()=>{const e=MS(GT),t=MS(UT),n=MS(sL);return Ji.jsxs(xT,{numberOfSections:2,numberOfItemsInSection:t,keyExtractor:e,emptyTexts:n,children:[uL,SL]})},ML=()=>{const e=MS($S);return Ji.jsx(cL,{children:e("Common.Values")})},kL=v(((e,t)=>Ji.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 16 16",height:"16px",role:"img",ref:t,...e,children:[Ji.jsx("path",{d:"M1.5 0a.5.5 0 0 0-.5.5v14a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-6a.5.5 0 0 0-.5-.5H8V.5a.5.5 0 0 0-.5-.5zM2 4V1h5v7.293l-5 5V9h2V8H2V5h2V4zm.707 10 5-5H15v5h-3v-2h-1v2H8v-2H7v2z"}),Ji.jsx("path",{d:"M1.5 0a.5.5 0 0 0-.5.5v14a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-6a.5.5 0 0 0-.5-.5H8V.5a.5.5 0 0 0-.5-.5zM2 4V1h5v7.293l-5 5V9h2V8H2V5h2V4zm.707 10 5-5H15v5h-3v-2h-1v2H8v-2H7v2z"})]}))),EL=e=>{const{itemIndex:t}=e,n=MS(ZT(t));return Ji.jsx(wL,{title:n,icon:kL,...e})},_L=()=>{const e=MS(QT),t=MS(eL),n=MS(aL);return Ji.jsx(Yc,{style:{height:"100%",display:"flex",flexDirection:"column-reverse"},children:Ji.jsxs(xT,{numberOfSections:1,numberOfItemsInSection:t,keyExtractor:e,emptyTexts:n,children:[ML,EL]})})},RL=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M8.588 11.415a6 6 0 1 1 2.828-2.829l4.101 4a1.5 1.5 0 0 1 .014 2.134l-.707.707a1.5 1.5 0 0 1-2.108.014zM11 6A5 5 0 1 0 1 6a5 5 0 0 0 10 0m-1.52 4.888 3.934 3.837a.5.5 0 0 0 .703-.005l.707-.707a.5.5 0 0 0-.005-.711l-3.926-3.829a6 6 0 0 1-1.413 1.415"})}))),IL=()=>{const[e,t]=ES(BS),n=MS($S),r=MS(eL),i=MS(UT),o=h((e=>{t(e.target.value)}),[t]),a=i(0),s=i(1),l=r(),c=0===e.length||0===a&&0===s&&0===l?n("Common.Search.NoResultsAvailable"):n("ChartExploration.Pivot.Search.ResultsFound",a.toString(),s.toString(),l.toString());return Ji.jsxs(Yc,{style:{position:"sticky",top:0,zIndex:10,width:"calc(100% - 16px)",backgroundColor:"var(--sprout-common-background-color-weak)",paddingTop:2,paddingRight:8,paddingLeft:8,paddingBottom:8},children:[Ji.jsx(pL,{"data-testid":"screenOnly-search-results","aria-live":"polite","aria-atomic":"true",children:c}),Ji.jsx(Ah,{size:"small",fullWidth:!0,"data-testid":"chart-exploration-search-input","aria-label":n("Common.Search.AccessibilityLabel"),type:"search",defaultValue:e,placeholder:n("Common.Search"),onChange:o,startAdornment:Ji.jsx(sd,{position:"start",children:Ji.jsx(RL,{})}),inputProps:{style:{fontSize:"14px",paddingTop:6,paddingBottom:6}}})]})},DL=e=>{const t=((e="light",t=!1)=>ks(wp(e,t)))();return Ji.jsx(ul,{theme:t,children:Ji.jsx(vS,{children:Ji.jsx(cC,{props:e,children:Ji.jsxs(Yc,{className:"exploration-panel",style:{display:"flex",flexDirection:"column"},children:[Ji.jsx(IL,{}),Ji.jsx(CL,{}),Ji.jsx(_L,{})]})})})})},AL=e=>{if(e.flags.isEnabled("CLIENT_IM_5973_PIVOT_TABLE_EXPLORATION"))return{component:DL,classification:{tags:["exploration"],exclusive:!0}}},PL=[];for(let e=0;e<256;++e)PL.push((e+256).toString(16).slice(1));let OL;const TL=new Uint8Array(16);var LL={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function qL(e,t,n){const r=(e=e||{}).random??e.rng?.()??function(){if(!OL){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");OL=crypto.getRandomValues.bind(crypto)}return OL(TL)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return(PL[e[t+0]]+PL[e[t+1]]+PL[e[t+2]]+PL[e[t+3]]+"-"+PL[e[t+4]]+PL[e[t+5]]+"-"+PL[e[t+6]]+PL[e[t+7]]+"-"+PL[e[t+8]]+PL[e[t+9]]+"-"+PL[e[t+10]]+PL[e[t+11]]+PL[e[t+12]]+PL[e[t+13]]+PL[e[t+14]]+PL[e[t+15]]).toLowerCase()}(r)}const NL=()=>crypto?.randomUUID?.()??function(e){return LL.randomUUID&&!e?LL.randomUUID():qL(e)}(),jL=1e3,zL=1e3,FL=e=>{const t=e.qDimensions,n=((e,t)=>{const n={};let r=[],i=!1;const o=-1!==e.indexOf(-1);e.forEach((e=>{n[e]?i=!0:n[e]=!0})),t&&(i=o?i||t.length+1!==Object.keys(n).length:i||t.length!==Object.keys(n).length),Object.keys(n).forEach((e=>{"-1"!==e&&r.push(parseInt(e,10))})),r=r.sort(((e,t)=>e-t));for(let e=0;e<r.length;++e)i=i||r[e]!==e;return i})(e.qInterColumnSortOrder,t);n&&(e.qInterColumnSortOrder=((e,t)=>{const n=[];if(t)for(let e=0;e<t.length;e++)n.push(e);return e.qMeasures.length>=2&&n.push(-1),n})(e,t))},WL=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},$L=e=>{if(!e)return;FL(e);const t=e.qDimensions,{qInterColumnSortOrder:n}=e,r=n?.filter((e=>-1!==e))||[];t&&((e,t,n=[])=>{for(let r=0;r<e.length;r++)if(-1!==e[r]&&e[r]!==r){const i=e[r],o=e.indexOf(r),a=e[o];WL(e,r,o),WL(t,r,o),WL(n,n.indexOf(i),n.indexOf(a))}})(r,t,n)},BL=(e,t,n)=>{t&&(t.splice(n||0,1),t.push(e),t.splice((n||-1)+1,0,-1))},HL=k;class VL extends HL{constructor(e){super(e),this.path=e.path}async addDimension(e,t,n,r){const i=this.getDimensions(),o=void 0!==r?.asColumn&&r.asColumn;return e.qDef&&!e.qDef.cId&&(e.qDef.cId=NL()),t?this.addAlternativeDimension(e,o,n):i.length<this.maxDimensions()?Promise.resolve(this.autoSortDimension(e)).then((()=>($L(this.hcProperties),((e,t,n,r,i)=>{if(!e)return;let{qNoOfLeftDims:o}=e;const{qInterColumnSortOrder:a}=e,s=t.length,l=a?.indexOf(-1);if(r||!o||-1!==o&&!Number.isNaN(+o))if(!r&&o&&o>=0){if(l&&l>=o?BL(s,a,l):(-1!==l&&--o,i&&i<=o&&-1!==l?BL(s,a,l):a?.push(s)),"number"==typeof i&&i<o){const e=Math.max(i-1,0);t.splice(e,0,n)}else t.splice(o,0,n);e.qNoOfLeftDims&&e.qNoOfLeftDims++}else{0===s&&(e.qNoOfLeftDims=0);const r="number"==typeof i?i+(o||0):void 0;l&&r&&l>=r?BL(s,a,l):a?.push(s),"number"==typeof i&&r?l&&r>l&&l>-1?t.splice(r-1,0,n):t.splice(r,0,n):t.push(n)}else e.qNoOfLeftDims=1,a?.unshift(s),t.splice(0,0,n)})(this.hcProperties,i,e,o,n),e))):void 0}async addDimensions(e,t,n){const r=[];for await(const i of e){const e=await this.addDimension(i,t,void 0,n);e&&r.push(e)}return r}addAlternativeDimension(e,t,n){const r=this.getAlternativeDimensions();let i=n;return void 0===i&&(i=t||void 0===this.hcProperties?.excludedNoOfLeftDims?r.length:this.hcProperties?.excludedNoOfLeftDims),void 0!==i&&r.splice(i,0,e),this.hcProperties&&void 0===this.hcProperties.excludedNoOfLeftDims?this.hcProperties.excludedNoOfLeftDims=t?r.length-1:r.length:this.hcProperties&&this.hcProperties.excludedNoOfLeftDims&&!t&&this.hcProperties.excludedNoOfLeftDims++,e}async addFieldDimension(e,t,n,r){const i=this.createFieldDimension(e,t,n);return this.addDimension(i,!1,void 0,r)}async addFieldDimensions(e,t){const n=e.map((e=>this.createFieldDimension(e.field,e.label,e.defaults)));return this.addDimensions(n,void 0,t)}async addLibraryDimensions(e,t={}){const n=e.map((e=>this.createLibraryDimension(e.id,e.defaults)));return this.addDimensions(n,void 0,t)}reinsertDimension(e,t,n,r){const i=this.getDimensions(),o=this.getAlternativeDimensions();return e.qDef&&!e.qDef.cId&&(e.qDef.cId=NL()),i.length<this.maxDimensions()?this.addDimension(e,t,n,r):i.length<jL?(n=o.length,o.splice(n,0,e),Promise.resolve(e)):Promise.resolve()}async removeDimensions(e,t,n){return Promise.all([...e].reverse().map((e=>this.removeDimension(e,t,n))))}removeDimension(e,t,n){if(t){const t=this.getAlternativeDimensions().splice(e,1);return!n?.asColumn&&this.hcProperties?.excludedNoOfLeftDims&&this.hcProperties.excludedNoOfLeftDims--,t}const r=this.getDimensions(),i=this.properties?.qHyperCubeDef.qNoOfLeftDims,o=this.hcProperties?.qInterColumnSortOrder.indexOf(e);this.properties?.qHyperCubeDef.qNoOfLeftDims&&o&&i&&o+1<=i&&this.properties.qHyperCubeDef.qNoOfLeftDims--;const a=this.properties?.qHyperCubeDef.columnWidths?this.properties.qHyperCubeDef.columnWidths[1]:void 0;Array.isArray(a)&&a.length>e&&a.splice(e,1);const s=r.splice(e,1)[0];return((e,t)=>{if(!e)return-1;const n=e.indexOf(t);if(-1===n)return-1;for(let n=0;n<e.length;++n)e[n]>t&&e[n]--;e.splice(n,1)})(this.hcProperties?.qInterColumnSortOrder,e),$L(this.hcProperties),s}async addMeasures(e,t=!1){const n=[];for await(const r of e){const e=await this.addMeasure(r,t,void 0,{keepNumberFormat:!0});e&&n.push(e)}return n}addAlternativeMeasures(e,t){const n=this.getAlternativeMeasures(),r=void 0===t?n.length:t;return n.splice(r,0,e)}async addMeasure(e,t,n,r){const i=this.getMeasures();if(e.qDef&&!e.qDef.cId&&(e.qDef.cId=NL()),t)return this.addAlternativeMeasures(e,n);if(r?.keepNumberFormat||delete e.qDef?.qNumFormat,i.length<this.maxMeasures()){const t=1===i.length;return i.push(e),this.autoSortMeasure(e).then((()=>(t&&this.hcProperties?.qInterColumnSortOrder.push(-1),e)))}return i.length<zL?(this.getAlternativeMeasures().push(e),Promise.resolve(e)):Promise.resolve()}reinsertMeasure(e,t,n){const r=this.getMeasures(),i=this.getAlternativeMeasures(),o=this.hcProperties?.qInterColumnSortOrder;if(e.qDef&&!e.qDef.cId&&(e.qDef.cId=NL()),n=void 0!==n?n:r.length,r.length<this.maxMeasures()){if(r.splice(n,0,e),this.hcProperties&&o&&2===r.length){-1===o.indexOf(-1)&&o.push(-1)}}else r.length<zL&&(n=i.length,i.splice(n,0,e));return Promise.resolve(e)}removeMeasure(e,t){if(t&&e)return this.getAlternativeMeasures().splice(e,1);const n=this.getMeasures();let r,i,o;if(e&&e<n.length){r=2===n.length,i=this.getMeasures().splice(e,1)[0];const t=this.hcProperties?.qInterColumnSortOrder;r&&t&&(o=t.indexOf(-1),t.splice(o,1),this.hcProperties?.qNoOfLeftDims&&o+1<=this.hcProperties?.qNoOfLeftDims&&this.hcProperties.qNoOfLeftDims--)}else e&&(i=this.getAlternativeMeasures().splice(e-n.length,1)[0]);return i}async removeMeasures(e,t){return await Promise.all([...e].reverse().map((e=>this.removeMeasure(e,t)))),e}getSorting(){throw new Error("don't call this")}changeSorting(){throw new Error("don't call this")}setSorting(){throw new Error("don't call this")}}var GL={exports:{}};self,GL.exports=(()=>{var e={909:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],h=1,p=arguments.length,f=!1;for("boolean"==typeof d&&(f=d,d=arguments[1]||{},h=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});h<p;++h)if(null!=(t=arguments[h]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(f&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(d,{name:n,newValue:e(f,u,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}},8:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],h=1,p=arguments.length,f=!1;for("boolean"==typeof d&&(f=d,d=arguments[1]||{},h=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});h<p;++h)if(null!=(t=arguments[h]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(f&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(d,{name:n,newValue:e(f,u,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Ae});var e=r(229),t=r.n(e);const n=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},o=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function c(e){return s+e+l}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var 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 h(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),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function f(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function v(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function b(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,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 c=v(u(r[0],i),f(0));return"".concat(a,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var d=u(r[0],i),h=u(r[1],i),p=f(0),m=f(1),g=v(d,p),y=v(h,m);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function w(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const S={isFullRange:d,getNumDimensions:w,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=c(p(t));if(!n.showExcludedValues)return a;var s=b({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var u=f(0);return"If(Count(".concat(u,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var d=f(0),h=f(1);return"If(Count(".concat(d,") * Count(").concat(h,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:h,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return h(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return m(e,t)+n+g(r)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===w({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=f(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:u,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=w({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:f,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=n.qHyperCubeDef.qMeasures.find((function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null}));i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=a.OPTIONS.find((function(t){return t.value===e.decomposition}));return t?a.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find((function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[n]&&r.includes(a.EXPRESSIONS[n].toLowerCase())&&(t=n),n})),t}};function 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 M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}var k=t().bind(null,!0),E={},_=Array.isArray;function R(e){return null!=e&&!Array.isArray(e)&&"object"===M(e)}function I(e){return void 0===e}function D(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function A(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]=I(e[n||t])?o:e[t],e=e[n||t]}})),e}function P(e,t){var n=!0;if(R(e)&&R(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){P(e[r],t[r])||(n=!1)})),n);if(_(e)&&_(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!P(e[r],t[r]))return!1;return!0}return e===t}E.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?k({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);P(o,a)||D(t,i)||(I(a)?r.push({op:"add",path:s,value:o}):R(o)&&R(a)?r=r.concat(E.generate(a,o,s)):_(o)&&_(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&I(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(P(t,i))return r;if(!I(t[0])&&I(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(E.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,c=t.length;l<c;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){I(t[i])&&!D(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},E.apply=function(e,t){t.forEach((function(t){var n,r,i=A(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(_(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(_(a)&&_(t.value)){var l,c=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return C(e)}(r=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return 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}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(R(a)&&R(t.value))n=a,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!D(n,e)&&delete n[e]})),k(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var u=A(e,t.from);_(i)?i.splice(+o,0,u.splice(+s,1)[0]):(i[o]=u[s],delete u[s])}else"remove"===t.op&&(_(i)?i.splice(+o,1):delete i[o])}))},E.clone=function(e){return k({},e)},E.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},E.updateObject=function(e,t){Object.keys(e).length?E.apply(e,E.generate(e,t)):k(e,t)};const O=E,T=function(e,n,r){if(!e)return Promise.resolve();var i=O.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(i,!0)):Promise.resolve()};var L="accumulation";function q(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===L)return n[r]}function N(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===L)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var j={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const z={translationKey:"properties.modifier.accumulation",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=S.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=S.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=S.getNumStepComp(n,l),h=S.getAboveComp(n,l,u,d),p=S.getRangeComp("RangeSum",h);if(S.needDimension({modifier:n,properties:r,layout:i})){var f=S.getDimComp(c,1),m=S.getDimComp(c,0),g=S.getAggrComp(p,f,m);p=n.showExcludedValues?S.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,valueComp:g}):g}return p},extractInputExpression:S.extractInputExpression,initModifier:function(e){S.initModifier(e,j)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(N(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(N(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(N(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(N(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=q(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=q(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(N(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(L))return!1;var o=q(t,e);return o&&!o.disabled}};return n}};var F="movingAverage";function W(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===F)return n[r]}function $(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===F)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var B={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const H={translationKey:"properties.modifier.movingAverage",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=s;void 0===c&&(c=S.getNumDimensions({properties:i,layout:a}));var u=o(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,h=S.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:d}),p=S.getNumStepComp(r,c),f=S.getAboveComp(r,c,h,p);if(r.nullSuppression)t=S.getRangeComp("RangeAvg",f);else{var m=S.getRangeComp("RangeSum",f),g=function(e,t){var n=S.getRowNoComp(e,t);if(!S.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,c);t="".concat(m," / ").concat(g)}var y=t;if(S.needDimension({modifier:r,properties:i,layout:a})){var v=S.getDimComp(u,1),b=S.getDimComp(u,0),x=S.getAggrComp(y,v,b);y=r.showExcludedValues?S.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:S.extractInputExpression,initModifier:function(e){S.initModifier(e,B)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat($(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat($(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat($(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat($(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=W(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=W(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat($(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat($(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(F))return!1;var o=W(t,e);return o&&!o.disabled}};return n}};var V="timeSeriesDecomposition";function G(e,t){var n=o(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=o(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 Y={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const K={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?S.generateTSDExpression(n,t,r):t},extractInputExpression:S.extractInputExpression,initModifier:function(e,t){S.initModifier(e,Y),""===e.decomposition&&t&&(e.decomposition=S.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(U(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:a.OPTIONS},steps:{refFn:function(t){return"".concat(U(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=G(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map((function(e){return e.qDef.modifiers.map((function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e})),e}))}},show:function(t){var n=G(t,e);return n&&!n.fullRange}}},show:function(e,t){return S.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=G(t,e);return o&&!o.disabled}};return n}};var X="difference";function J(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===X)return n[r]}function Z(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===X)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:S.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=S.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=S.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=S.getAboveComp(n,l,u),h="".concat(u," - ").concat(d);if(S.needDimension({modifier:n,properties:r,layout:i})){var p=S.getDimComp(c,1),f=S.getDimComp(c,0),m=S.getAggrComp(h,p,f);h=n.showExcludedValues?S.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return h},initModifier:function(e){Object.keys(Q).forEach((function(t){void 0===e[t]&&(e[t]=Q[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(Z(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(X))return!1;var o=J(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,n){return 1===e?"{$<".concat(S.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ce(e,t,n){return 0===e&&t>1?"<".concat(S.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:S.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=S.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=S.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=n.selectionScope,h=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=ae(t),l=se(t,n,r),c=""===s&&""===l?"":s||l,u=le(i,o),d=ce(i,o,a),h=function(e){for(var t=[],n=0;n<e;n++)t[n]=S.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(d," Aggr(").concat(c," ").concat(e,", ").concat(h,"))")}(u,d,n.field,n.value,h,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach((function(t){void 0===e[t]&&(e[t]=oe[t])}))},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var r=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(re(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(re(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,r){return function(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ce};var de="qDef.base",he="qDef.qDef",pe="qDef.base.qDef",fe="qLibraryId",me="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,pe);return void 0!==t?t:o(e,he)},getExpressionRef:function(e){return void 0!==o(e,pe)?pe:he},getLibraryIdRef:function(e){return o(e,me)?me:fe},getLibraryId:function(e){return o(e,me)||o(e,fe)},getLabelRef:function(e){return o(e,de)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,de)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",we="qDef.qLabel",Se="qDef.qLabelExpression",Ce="qDef.base.qLabel",Me="qDef.base.qLabelExpression",ke="qDef.qAggrFunc",Ee="qDef.base.qAggrFunc",_e={initBase:function(e,t){(t||_e.isValid(e))&&(n(e,ve,o(e,ye)),n(e,xe,o(e,be)),n(e,Ce,o(e,we)),n(e,Me,o(e,Se)))},restoreBase:function(e){_e.isValid(e)&&(n(e,ye,o(e,ve)),n(e,be,o(e,xe)),n(e,we,o(e,Ce)),n(e,Se,o(e,Me)),o(e,ke)&&o(e,Ee)&&n(e,ke,o(e,Ee)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),n=o(e,xe);return void 0!==t||void 0!==n}};const Re=_e;function Ie(e){return Ie="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},Ie(e)}var De={accumulation:z,movingAverage:H,difference:ee,normalization:ue,timeSeriesDecomposition:K};const Ae={modifiers:De,apply:Oe,applyModifiers:Te,cleanUpMeasure:Le,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:qe,getActiveModifier:Ne,initBase:Re.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return De[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return De[e]&&De[e].isApplicable({properties:n,layout:r})}))},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=Fe(e);Ue({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ze({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:je};var Pe={};function Oe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,a=void 0!==i&&i,s=e.masterItem,l=!1;Pe[n.id]=Pe[n.id]||{isFirstTime:!0};var c=Pe[n.id].isFirstTime;if(Pe[n.id].isFirstTime=!1,r&&"object"===Ie(r))return Te({model:n,properties:r});var u=n?n.layout:void 0,d=o(u,"qSelectionInfo.qInSelections");if(a||d)return Promise.resolve(l);var h=o(u,"qHyperCube.qMeasureInfo"),p=Pe[n.id].lastReloadTime;if(Pe[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),qe({measures:h,layout:u})){var f=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ge({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:h,layout:u,model:n,lastReloadTime:p});return f||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 Ue({modifiers:Fe(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:h,layout:u,masterItem:s,isFirstTime:c})?n.getEffectiveProperties().then((function(e){var r=t()(!0,{},e);$e(r);var i=Qe(r);return Ye({model:n}).then((function(t){return Ke({libraryIds:i,model:n}).then((function(i){return f&&function(e){var t=e.properties;ze(t).forEach((function(e){return function(e){var t=e.measure;if(Ge({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===Ie(e)&&!e.disabled){if(n++,"object"!==Ie(De[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=De[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&He(t)&&S.simplifyExpression(t.qDef.base.qDef)!==S.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:r}),Te({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:i,dimensionAndFieldList:t})}))}))})):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===Ie(e.base)}))}(h)?n.getEffectiveProperties().then((function(e){return function(e){var n=e.model,r=e.properties,i=Qe(r);return et({model:n,libraryIds:i}).then((function(){var e=t()(!0,{},r);return ze(r).forEach((function(e){return Le(e)})),Je({oldProperties:e,newProperties:r,model:n})}))}({model:n,properties:e})})):Promise.resolve(l)}function Te(e){var n=e.model,r=e.oldProperties,i=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,c=e.masterItem,u=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),$e(i);var h=Qe(i);return et({model:n,libraryIds:h,masterItem:c}).then((function(){return function(e){var n=e.measures,r=e.properties,i=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=ze(r)),!n.length)return Promise.resolve();if(!qe({measures:n,properties:r}))return n.forEach((function(e){return Le(e)})),Promise.resolve();var l=a?void 0:Qe(r);return Ye({model:i,dimensionAndFieldList:s}).then((function(e){return Ke({libraryIds:l,model:i,libraryItemsProps:a}).then((function(i){n.forEach((function(n){Ue({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;Re.isValid(n)||Re.initBase(n,!0);var l=n.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach((function(e){if("object"===Ie(e)&&!e.disabled){if(s++,"object"!==Ie(De[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)");De[e.type].initModifier(e,n);var l=n.qLibraryId||u&&u.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:De[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||a.qMeasure.qLabel)&&(n.qDef.qLabel=a.qMeasure.qLabel),(n.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=a.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(n.qDef.qNumFormat=a.qMeasure.qNumFormat,n.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=a.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:a}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof De[r.type].updateModifier&&De[r.type].updateModifier(r,i.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:De[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=s,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:a}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||je(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&je(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}}))}({measure:n,properties:r,libraryItemsProps:i,dimensionAndFieldList:e}),Be(n)):Le(n)}))}))}))}({measures:a,properties:i,model:n,libraryItemsProps:u,dimensionAndFieldList:d}).then((function(){return l?Je({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)}))}))}function Le(e){!function(e){var t=Fe(e);return Array.isArray(t)&&t.some((function(e){return"object"===Ie(e)&&!e.disabled&&!De[e.type]}))}(e)?Re.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Be(e)}function qe(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ue({modifiers:Fe(e),properties:n,layout:r})}))}function Ne(e){var t=Fe(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(De[r.type]&&!r.disabled)return r}}function je(e){var t=Ne(e);return!t||De[t.type].enableTotalsFunction(e)}function ze(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function Fe(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function We(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function $e(e){ze(e).forEach((function(e){return function(e){var n=Ne(e);n&&(void 0!==n.outputExpression&&We(n)!==e.qDef.qDef?delete e.qDef.base:!Re.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)}))}function Be(e){var t=Fe(e);Array.isArray(t)&&t.forEach((function(t){"object"===Ie(t)&&(t.disabled||!De[t.type]&&We(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function He(e){return e.base||e.qDef&&e.qDef.base}function Ve(e){var t=He(e);return e.qLibraryId||t&&t.qLibraryId}function Ge(e){var t=e.measure,n=e.properties,r=e.layout;return!Ve(t)&&Ue({modifiers:Fe(t),properties:n,layout:r})}function Ue(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==Ie(e)||e.disabled||!De[e.type])&&(void 0===i[e.type]&&(i[e.type]=De[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function Ye(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 Ke(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 Xe(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Xe)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):T(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Ze(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===Ie(e)&&!e.disabled&&De[e.type]&&De[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function Qe(e){var t=ze(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=Fe(t);if(Ue({modifiers:r,properties:e})){var o=Ve(t);o&&n.push(o),i=i||Ze({modifiers:r,properties:e})}})),o(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Pe[t.id].masterItemSubscriber=Pe[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=o(e,n)})),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function u(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),a={},t.forEach((function(e){a[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach((function(e){i[e]||a[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&s.push(u(e,"getMeasure"))})),Object.keys(a).forEach((function(e){a[e]&&!r[e]&&s.push(u(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return Oe({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),Pe[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}n.d(r,{default:()=>$e});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}const 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:u};var h=n(8),p=n.n(h);const f=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))},m=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&d.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},v=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},b=function(e){e.forEach((function(e){p().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))};function x(e,t,n){var r,i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2&&!a)return;s=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var l=o.getValue(e,"qLayoutExclude.quarantine");l[n]||(l[n]={}),l[n][t]=s}var w=n(909),S=n.n(w);function C(e,t){var n=S()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function M(e,t){return S()(!0,{},t,e)}function k(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var E=Math.pow(2,53)-1;function _(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 R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const I=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},D=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},A=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},P=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}}},O=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},T=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=C(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 c=C(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},L=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=M(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var c=M(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},q=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=k(a.max,i.dimensions.length,E),l=k(a.min,i.dimensions.length,0);return{maxDimensions:k(o.max,s,E),minDimensions:k(o.min,l,0),maxMeasures:s,minMeasures:l}},N=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))},j=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=S()(!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=S()(!0,{},n,i)).components&&(i.components=[]),i},z=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},F=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=[]))},W=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return _(e)}(t=a.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return _(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,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qDimensions=[],s.forEach((function(e){a.qDimensions.push(e),r.dimensions.added(e,n)}))}},$=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return R(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return R(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)?R(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qMeasures=[],s.forEach((function(e){a.qMeasures.push(e),r.measures.added(e,n)}))}},B=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&p().isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))};function H(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}const V={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=[]),f({exportFormat:i,qHyperCubeDef:l}),m({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),v({exportFormat:i,properties:a}),r||b(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(x(i.properties,"filters","storedFilters",!0),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(x(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(x(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,c=e.hypercubePath,u=e.extension,d=e.supportedFilters,h=void 0===d||d,p=e.isHCModifierSupported,f=void 0===p||p,m={qChildren:[]},g=j({exportFormat:t,initialProperties:r,hypercubePath:c}),y=o.getValue(r,c||"").qHyperCubeDef,v=o.getValue(g,c||"").qHyperCubeDef,b=q({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,w=b.minDimensions,S=b.maxMeasures,C=b.minMeasures,M=l.defaultDimension,k=void 0===M?P():M,E=l.defaultMeasure,_=void 0===E?O():E;v.qDimensions.length=0,v.qMeasures.length=0,z({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:S,minMeasures:C})&&F({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:S,minMeasures:C,newHyperCubeDef:v}),T({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:v,defaultDimension:k}),L({exportFormat:t,maxMeasures:S,minMeasures:C,newHyperCubeDef:v,defaultMeasure:_}),W({newProperties:g,dataDefinition:a,hypercubePath:c}),$({newProperties:g,dataDefinition:a,hypercubePath:c}),N({exportFormat:t,newHyperCubeDef:v}),D("qMaxStackedCells",y,v),D("qNoOfLeftDims",y,v),A("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),A("qMode",y,v,"S"),A("qReductionMode",y,v,"N"),A("qSortbyYValue",y,v),A("qIndentMode",y,v),A("qShowTotalsAbove",y,v),I(g,t,r),m.qProperty=g;var R=o.getValue(u||{},"support.modifiers");return B({measures:v.qMeasures,modifierTypes:R}),h&&H(m.qProperty,"storedFilters"),"S"===v.qMode&&f&&H(m.qProperty,"dynamicScript"),m}};var G={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function U(e,t,n,r){t=t||[];var i=u(e,r,n),o=u(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function Y(e,t){return e.length!==t}const K={create:function(e,t){if(!e||!G[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(U(a,t,r,i),Y(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"}},X={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},J={colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>0&&X.getNumMeasures(e)<=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>0},expression:function(e){return X.getNumMeasures(e)>=1}}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}};var Q={scatterplot:Z,"sn-scatter-plot":Z,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)<=1},expression:function(e){return X.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>=1},expression:function(e){return X.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 X.getNumDimensions(e)>=1}}}};function ee(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 te(e,t){var n=K.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})),t.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}))}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;te(r,i);var l=r[r.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),h=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var p=K.create(K.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,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:c,isDimension:n,qNumFormat:u,isCustomFormatted:h});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:p,measures:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:h})}n?(p.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(p)):l.qAttributeExpressions.push(p)}}}function ie(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":i=function(e,t){return t?e.qLibraryId:p().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return p().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,n,r){var i=t.type,o=e.color,a=o.mode,s=X.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||X.wrapFieldName(t.name),key:X.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:s,key:t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}o.auto=!1,o.mode=a}function se(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,ae(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=K.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return ae(e,ie("dimension",!!a,a||r)),!!a}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ce=function(e,t){var n={primary:!0};if(e){var r=(Q[t]||J).colorModeOptions||J.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ue=function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},de=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),a=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(a,l):!(n={auto:i,colorMode:r,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:i,colorMode:r,dimensions:a,measures:s,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,ae(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=K.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return ae(e,ie("measure",!!s,s||r[0])),!!s}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,a)}(e,t)},he=function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},pe=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},fe=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},me=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=V.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=K.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return K.moveByIdFromGroup(a,[],"qAttributeDimensions",c),K.moveByIdFromGroup(a,[],"qAttributeExpressions",c),K.moveByIdFromGroup(s,[],"qAttributeExpressions",u),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,c=e.isHCModifierSupported,u=V.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty,h=o.getValue(d,"visualization"),p=o.getValue(d,"qHyperCubeDef.qDimensions",[]),f=o.getValue(d,"color.mode",""),m=o.getValue(d,"color.auto",""),g=ce(d,h),y=ue({canColorBy:g,autoColor:m,colorMode:f,dimensions:p});return g[f]?pe({shouldUpdateColorBy:y,properties:d})&&fe(d):me(d),y&&de(d,"qHyperCubeDef."),ge(d)&&le(d,"color.persistent",!0),he(p),u}};var ve=["bar","marker","line"];const be=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?H(n,"unsupportedAutoMinMax")||S()(n.measureAxis,t.measureAxis):H(n,"supportedAutoMinMax")||S()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),ve.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(a);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&S()(s,n.properties.measureAxes[t[0].axis])):S()(s,n.properties.measureAxes[0])}},we=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},Se={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(x(s,"measureAxis.min","supportedAutoMinMax"),x(s,"measureAxis.max","supportedAutoMinMax")):(x(s,"measureAxis.min","unsupportedAutoMinMax"),x(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty;return be({initialProperties:n,properties:d}),xe({exportFormat:t,initialProperties:n,properties:d,measureType:a}),we(d.qHyperCubeDef),d.qHyperCubeDef.qColumnOrder=[],d.qHyperCubeDef.columnOrder=[],u}};function Ce(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Me(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var c=Ce(n,r,l);o.setValue(t,c,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}function ke(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=Ce(n,r,s),c=o.getValue(t,l);void 0!==c&&(o.setValue(i,a,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}var Ee="qHyperCubeDef.qMeasures",_e="conditionalColoring",Re="measures",Ie="qDef.conditionalColoring";const De={quarantine:function(e){Me({properties:e,arrayPath:Ee,quarantineName:_e,arrayName:Re,itemPath:Ie})},unquarantine:function(e){ke({properties:e,arrayPath:Ee,itemPath:Ie,arrayName:Re,quarantineName:_e})}};var Ae="qHyperCubeDef.qMeasures",Pe="measures",Oe="qHyperCubeDef.qDimensions",Te="dimensions",Le="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",qe="alternativeMeasures",Ne="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",je="alternativeDimensions",ze="qCalcCondition",Fe="conditionalShowHide";const We={quarantine:function(e){Me({properties:e,arrayPath:Ae,quarantineName:Fe,arrayName:Pe,itemPath:ze}),Me({properties:e,arrayPath:Oe,quarantineName:Fe,arrayName:Te,itemPath:ze})},unquarantine:function(e){ke({properties:e,arrayPath:Ae,quarantineName:Fe,arrayName:Pe,itemPath:ze}),ke({properties:e,arrayPath:Oe,quarantineName:Fe,arrayName:Te,itemPath:ze})},quarantineAlternative:function(e){Me({properties:e,arrayPath:Le,quarantineName:Fe,arrayName:qe,itemPath:ze}),Me({properties:e,arrayPath:Ne,quarantineName:Fe,arrayName:je,itemPath:ze})},unquarantineAlternative:function(e){ke({properties:e,arrayPath:Le,quarantineName:Fe,arrayName:qe,itemPath:ze}),ke({properties:e,arrayPath:Ne,quarantineName:Fe,arrayName:je,itemPath:ze})}},$e={hypercube:V,colorChart:ye,axisChart:Se,quarantineProperty:x,unquarantineProperty:H,quarantineArrayProp:Me,unquarantineArrayProp:ke,conditionalColoring:De,conditionalShow:We}})(),r.default})();var UL=yr(GL.exports);const YL="qHyperCubeDef.qMeasures",KL="measures",XL="qHyperCubeDef.qDimensions",JL="dimensions",ZL="qDef.representation",QL="tableRepresentation",eq="qDef.conditionalColoring",tq="conditionalColoring",nq="qMiniChartDef",rq="miniChartDef";function iq(e){return null!==e&&"object"==typeof e&&"r"in e&&"number"==typeof e.r&&"g"in e&&"number"==typeof e.g&&"b"in e&&"number"==typeof e.b&&("number"==typeof e.a||void 0===e.a)}function oq(e){if("object"==typeof e&&iq(e))return(e.r<<16)+(e.g<<8)+e.b;let t=0,n=0,r=0;if("string"==typeof e){let i;(i=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(e))?(t=parseInt(i[1],10),n=parseInt(i[2],10),r=parseInt(i[3],10)):(i=/^#([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})$/i.exec(e))?(t=parseInt(i[1],16),n=parseInt(i[2],16),r=parseInt(i[3],16)):(i=/^#([A-Fa-f0-9])([A-Fa-f0-9])([A-Fa-f0-9])$/i.exec(e))&&(t=parseInt(i[1]+i[1],16),n=parseInt(i[2]+i[2],16),r=parseInt(i[3]+i[3],16))}return(t<<16)+(n<<8)+r}const aq={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:0,g:0,b:0,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}};function sq(...e){const t={type:"qcm-color",r:0,g:0,b:0,a:1,invalid:!1,spaces:{}};let n=0,r=0,i=0,o=1;if(null!==(a=e[0])&&"object"==typeof a&&"type"in a&&"qcm-color"===a.type)({r:n,g:r,b:i,a:o}=e[0]),t.invalid=e[0].invalid,t.spaces={...e[0].spaces};else if(iq(e[0]))({r:n,g:r,b:i}=e[0]),"a"in e[0]&&({a:o}=e[0]);else if(e.length<3)if("string"==typeof e[0]){const a=e[0];let s;if(s=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(a))n=parseInt(s[1],10),r=parseInt(s[2],10),i=parseInt(s[3],10);else if(s=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(a))n=parseInt(s[1],10),r=parseInt(s[2],10),i=parseInt(s[3],10),o=parseFloat(s[4]);else if(s=/^ARGB\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(a))o=parseInt(s[1],10)/255,n=parseInt(s[2],10),r=parseInt(s[3],10),i=parseInt(s[4],10);else if(s=/^#([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})$/i.exec(a))n=parseInt(s[1],16),r=parseInt(s[2],16),i=parseInt(s[3],16),o=1;else if(s=/^#([A-Fa-f0-9])([A-Fa-f0-9])([A-Fa-f0-9])$/i.exec(a))n=parseInt(s[1]+s[1],16),r=parseInt(s[2]+s[2],16),i=parseInt(s[3]+s[3],16),o=1;else if(s=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(a)){let e=parseFloat(s[1]),t=parseFloat(s[3]),a=parseFloat(s[5]);e%=360,t/=100,a/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,a=a<0?0:a>1?1:a;const l=a<=.5?2*a*t:(2-2*a)*t;let c=e/60;const u=l*(1-Math.abs(c%2-1));let d=[];switch(c=Math.floor(c),c){case 0:d=[l,u,0];break;case 1:d=[u,l,0];break;case 2:d=[0,l,u];break;case 3:d=[0,u,l];break;case 4:d=[u,0,l];break;case 5:d=[l,0,u];break;default:d=[0,0,0]}const h=a-.5*l;n=d[0]+h,r=d[1]+h,i=d[2]+h,n=Math.round(255*n),r=Math.round(255*r),i=Math.round(255*i),o=1}else if(s=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(a)){let e=parseFloat(s[1]),t=parseFloat(s[3]),a=parseFloat(s[5]);o=parseFloat(s[7]),e%=360,t/=100,a/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,a=a<0?0:a>1?1:a;const l=a<=.5?2*a*t:(2-2*a)*t;let c=e/60;const u=l*(1-Math.abs(c%2-1));let d=[];switch(c=Math.floor(c),c){case 0:d=[l,u,0];break;case 1:d=[u,l,0];break;case 2:d=[0,l,u];break;case 3:d=[0,u,l];break;case 4:d=[u,0,l];break;case 5:d=[l,0,u];break;default:d=[0,0,0]}const h=a-.5*l;n=d[0]+h,r=d[1]+h,i=d[2]+h,n=Math.round(255*n),r=Math.round(255*r),i=Math.round(255*i)}else if(s=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(a)){let e=parseFloat(s[1]),t=parseFloat(s[3]),a=parseFloat(s[5]);e%=360,t/=100,a/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,a=a<0?0:a>1?1:a;const l=a*t;let c=e/60;const u=l*(1-Math.abs(c%2-1));let d=[];switch(c=Math.floor(c),c){case 0:d=[l,u,0];break;case 1:d=[u,l,0];break;case 2:d=[0,l,u];break;case 3:d=[0,u,l];break;case 4:d=[u,0,l];break;case 5:d=[l,0,u];break;default:d=[0,0,0]}const h=a-l;n=d[0]+h,r=d[1]+h,i=d[2]+h,n=Math.round(255*n),r=Math.round(255*r),i=Math.round(255*i),o=1}else{const e=a.toLowerCase();if(function(e){return e in aq}(e)){const t=aq[e];({r:n,g:r,b:i}=t),o="a"in t?t.a:1}else t.invalid=!0}}else"number"==typeof e[0]&&e[0]>=0&&"argb"===e[1]?(o=(4278190080&e[0])>>>24,o/=255,n=(16711680&e[0])>>16,r=(65280&e[0])>>8,i=255&e[0]):"number"==typeof e[0]&&e[0]>=0?(n=(16711680&e[0])>>16,r=(65280&e[0])>>8,i=255&e[0]):t.invalid=!0;else 3===e.length||4===e.length?(n=e[0],r=e[1],i=e[2],o=4===e.length?e[3]:1):t.invalid=!0;var a;return Number.isNaN(+n+r+i+o)&&(t.invalid=!0),t.r=Math.floor(n),t.g=Math.floor(r),t.b=Math.floor(i),t.a=o,t}function lq(e){let t,n,r;if(iq(e))return t=e.r.toString(16),n=e.g.toString(16),r=e.b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${[t,n,r].join("")}`;const i="string"==typeof e?oq(e):e;return t=((16711680&i)>>16).toString(16),n=((65280&i)>>8).toString(16),r=(255&i).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${t}${n}${r}`}function cq(e){let t,n,r=0;const i="string"==typeof e?sq(e):e,o=i.r/255,a=i.g/255,s=i.b/255,{a:l}=i,c=Math.max(o,a,s),u=Math.min(o,a,s),d=(c+u)/2;if(c===u)t=0,r=0;else{switch(n=c-u,t=d>.5?n/(2-c-u):n/(c+u),c){case o:r=(a-s)/n+(a<s?6:0);break;case a:r=(s-o)/n+2;break;case s:r=(o-a)/n+4}r/=6}return{h:360*r,s:100*t,l:100*d,a:l}}function uq(e){let t,n,r=0;const i="string"==typeof e?sq(e):e,o=i.r/255,a=i.g/255,s=i.b/255,l=Math.max(o,a,s),c=Math.min(o,a,s),u=l;if(l===c)t=0,r=0;else{switch(n=l-c,t=0===n?0:n/u,l){case o:r=(a-s)/n+(a<s?6:0);break;case a:r=(s-o)/n+2;break;case s:r=(o-a)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*u}}function dq(e){if(iq(e))return`rgb(${e.r}, ${e.g}, ${e.b})`;const t="string"==typeof e?oq(e):e;return`rgb(${(16711680&t)>>16}, ${(65280&t)>>8}, ${255&t})`}function hq(e,t){return iq(e)?`rgba(${e.r}, ${e.g}, ${e.b}, ${e.a})`:hq(sq(e))}function pq(e){return iq(e)?1===e.a?dq(e):hq(e):pq(sq(e))}const fq=e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};function mq(e){return.2126*fq(e.r)+.7152*fq(e.g)+.0722*fq(e.b)}function gq(...e){const t=sq(...e),n={type:t.type,r:t.r,g:t.g,b:t.b,a:t.a,invalid:t.invalid,spaces:t.spaces},r=()=>(n.spaces.hslaObject||(n.spaces.hslaObject=cq(n)),n.spaces.hslaObject),i=e=>{const t=r(),{h:n,s:i,l:o,a:a}=t;return`hsla(${n}, ${i}, ${Math.max(0,Math.min(o+e,100))}, ${a})`};return{get type(){return n.type},isInvalid:()=>n.invalid,get r(){return n.r},get g(){return n.g},get b(){return n.b},get a(){return n.a},getR:()=>n.r,getG:()=>n.g,getB:()=>n.b,getAlpha:()=>n.a,setAlpha:e=>{n.a=e,n.spaces={}},isEqualTo:e=>{let t;if("string"==typeof e)t=sq(e);else{if(e.type!==n.type)return!1;t=e}return t.r===n.r&&t.g===n.g&&t.b===n.b&&t.a===n.a},isDark:()=>function(...e){const t=sq(...e);return t.invalid||mq(t)<.4}(n),getRGB:()=>(n.spaces.rgb||(n.spaces.rgb=dq(n)),n.spaces.rgb),getRGBA:()=>(n.spaces.rgba||(n.spaces.rgba=hq(n)),n.spaces.rgba),getString:()=>(n.spaces.string||(n.spaces.string=pq(n)),n.spaces.string),getHex:()=>(n.spaces.hex||(n.spaces.hex=lq(n)),n.spaces.hex),getHSL:()=>(n.spaces.hsl||(n.spaces.hsl=function(e){let t,n,r=0;const i="string"==typeof e?sq(e):e,o=i.r/255,a=i.g/255,s=i.b/255,l=Math.max(o,a,s),c=Math.min(o,a,s),u=(l+c)/2;if(l===c)t=0,r=0;else{switch(n=l-c,t=u>.5?n/(2-l-c):n/(l+c),l){case o:r=(a-s)/n+(a<s?6:0);break;case a:r=(s-o)/n+2;break;case s:r=(o-a)/n+4}r/=6}return`hsl(${360*r}, ${100*t}, ${100*u})`}(n)),n.spaces.hsl),getHSLA:()=>(n.spaces.hsla||(n.spaces.hsla=function(e){const{h:t,s:n,l:r,a:i}=cq(e);return`hsla(${t}, ${n}, ${r}, ${i})`}(n)),n.spaces.hsla),getHSLAObject:r,getShiftedHSLA:i,getHSV:()=>(n.spaces.hsv||(n.spaces.hsv=function(e){const{h:t,s:n,v:r}=uq(e);return`hsv(${t}, ${n}, ${r})`}(n)),n.spaces.hsv),getHSVObject:()=>(n.spaces.hsvObject||(n.spaces.hsvObject=uq(n)),n.spaces.hsvObject),blend:(e,t)=>`rgba(${Math.floor(n.r+(e.r-n.r)*t)}, ${Math.floor(n.g+(e.g-n.g)*t)}, ${Math.floor(n.b+(e.b-n.b)*t)}, ${Math.floor(n.a+(e.getAlpha()-n.a)*t)})`,getBrightenedColor:(e=1)=>gq(i(18*e)),getDarkenedColor:(e=1)=>gq(i(18*-e))}}function yq(e,t){if(!e||!t)return;const n=mq(e),r=mq(t);return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)}function vq(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var bq,xq="top",wq="top-right",Sq="right",Cq="bottom-right",Mq="bottom",kq="bottom-left",Eq="left",_q="top-left";vq(vq(vq(vq(vq(vq(vq(vq(vq(vq(bq={},"equal-equal",[xq,Mq]),"equal-higher",[Mq,Cq]),"equal-lower",[xq,wq]),"equal-void",[xq,Mq]),"higher-equal",[Eq,kq,xq,wq]),"higher-higher-acute",[Mq,kq,Eq,wq]),"higher-higher-obtuse",[Mq,xq]),"higher-lower-negative",[xq,wq,Sq]),"higher-lower-positive",[Mq,kq,Eq]),"higher-void",[xq]),vq(vq(vq(vq(vq(vq(vq(vq(vq(vq(bq,"lower-equal",[xq]),"lower-higher-negative",[xq,_q]),"lower-higher-positive",[Cq]),"lower-lower-acute",[xq,_q,Eq,wq,Sq]),"lower-lower-obtuse",[xq,Mq]),"lower-void",[xq]),"void-equal",[xq]),"void-higher",[xq,Mq]),"void-lower",[xq,Mq,Eq]),"void-void",[xq]),vq(bq,"unclassified",[xq,Mq,Sq,Eq,wq,Cq,kq,_q]);var Rq,Iq,Dq=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],Aq=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];function Pq(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?Aq:Dq}var Oq=function(){if(Iq)return Rq;Iq=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return Rq=function e(){var t,n,r,l,c,u,d=arguments[0],h=1,p=arguments.length,f=!1;for("boolean"==typeof d&&(f=d,d=arguments[1]||{},h=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});h<p;++h)if(null!=(t=arguments[h]))for(n in t)r=s(d,n),d!==(l=s(t,n))&&(f&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},a(d,{name:n,newValue:e(f,u,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d},Rq}();function Tq(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Lq(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function qq(){}!function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}(Oq);var Nq=1/.7,jq="\\s*([+-]?\\d+)\\s*",zq="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Fq="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Wq=/^#([0-9a-f]{3,8})$/,$q=new RegExp(`^rgb\\(${jq},${jq},${jq}\\)$`),Bq=new RegExp(`^rgb\\(${Fq},${Fq},${Fq}\\)$`),Hq=new RegExp(`^rgba\\(${jq},${jq},${jq},${zq}\\)$`),Vq=new RegExp(`^rgba\\(${Fq},${Fq},${Fq},${zq}\\)$`),Gq=new RegExp(`^hsl\\(${zq},${Fq},${Fq}\\)$`),Uq=new RegExp(`^hsla\\(${zq},${Fq},${Fq},${zq}\\)$`),Yq={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 Kq(){return this.rgb().formatHex()}function Xq(){return this.rgb().formatRgb()}function Jq(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Wq.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Zq(t):3===n?new nN(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Qq(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Qq(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=$q.exec(e))?new nN(t[1],t[2],t[3],1):(t=Bq.exec(e))?new nN(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Hq.exec(e))?Qq(t[1],t[2],t[3],t[4]):(t=Vq.exec(e))?Qq(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Gq.exec(e))?lN(t[1],t[2]/100,t[3]/100,1):(t=Uq.exec(e))?lN(t[1],t[2]/100,t[3]/100,t[4]):Yq.hasOwnProperty(e)?Zq(Yq[e]):"transparent"===e?new nN(NaN,NaN,NaN,0):null}function Zq(e){return new nN(e>>16&255,e>>8&255,255&e,1)}function Qq(e,t,n,r){return r<=0&&(e=t=n=NaN),new nN(e,t,n,r)}function eN(e){return e instanceof qq||(e=Jq(e)),e?new nN((e=e.rgb()).r,e.g,e.b,e.opacity):new nN}function tN(e,t,n,r){return 1===arguments.length?eN(e):new nN(e,t,n,null==r?1:r)}function nN(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function rN(){return`#${sN(this.r)}${sN(this.g)}${sN(this.b)}`}function iN(){const e=oN(this.opacity);return`${1===e?"rgb(":"rgba("}${aN(this.r)}, ${aN(this.g)}, ${aN(this.b)}${1===e?")":`, ${e})`}`}function oN(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function aN(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function sN(e){return((e=aN(e))<16?"0":"")+e.toString(16)}function lN(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new uN(e,t,n,r)}function cN(e){if(e instanceof uN)return new uN(e.h,e.s,e.l,e.opacity);if(e instanceof qq||(e=Jq(e)),!e)return new uN;if(e instanceof uN)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 uN(a,s,l,e.opacity)}function uN(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function dN(e){return(e=(e||0)%360)<0?e+360:e}function hN(e){return Math.max(0,Math.min(1,e||0))}function pN(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Tq(qq,Jq,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Kq,formatHex:Kq,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return cN(this).formatHsl()},formatRgb:Xq,toString:Xq}),Tq(nN,tN,Lq(qq,{brighter(e){return e=null==e?Nq:Math.pow(Nq,e),new nN(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new nN(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new nN(aN(this.r),aN(this.g),aN(this.b),oN(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rN,formatHex:rN,formatHex8:function(){return`#${sN(this.r)}${sN(this.g)}${sN(this.b)}${sN(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:iN,toString:iN})),Tq(uN,(function(e,t,n,r){return 1===arguments.length?cN(e):new uN(e,t,n,null==r?1:r)}),Lq(qq,{brighter(e){return e=null==e?Nq:Math.pow(Nq,e),new uN(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new uN(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new nN(pN(e>=240?e-240:e+120,i,r),pN(e,i,r),pN(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new uN(dN(this.h),hN(this.s),hN(this.l),oN(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=oN(this.opacity);return`${1===e?"hsl(":"hsla("}${dN(this.h)}, ${100*hN(this.s)}%, ${100*hN(this.l)}%${1===e?")":`, ${e})`}`}}));const fN=Math.PI/180,mN=180/Math.PI,gN=4/29,yN=6/29,vN=3*yN*yN;function bN(e){if(e instanceof xN)return new xN(e.l,e.a,e.b,e.opacity);if(e instanceof kN)return EN(e);e instanceof nN||(e=eN(e));var t,n,r=MN(e.r),i=MN(e.g),o=MN(e.b),a=wN((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=wN((.4360747*r+.3850649*i+.1430804*o)/.96422),n=wN((.0139322*r+.0971045*i+.7141733*o)/.82521)),new xN(116*a-16,500*(t-a),200*(a-n),e.opacity)}function xN(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function wN(e){return e>.008856451679035631?Math.pow(e,1/3):e/vN+gN}function SN(e){return e>yN?e*e*e:vN*(e-gN)}function CN(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function MN(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function kN(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function EN(e){if(isNaN(e.h))return new xN(e.l,0,0,e.opacity);var t=e.h*fN;return new xN(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Tq(xN,(function(e,t,n,r){return 1===arguments.length?bN(e):new xN(e,t,n,null==r?1:r)}),Lq(qq,{brighter(e){return new xN(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new xN(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new nN(CN(3.1338561*(t=.96422*SN(t))-1.6168667*(e=1*SN(e))-.4906146*(n=.82521*SN(n))),CN(-.9787684*t+1.9161415*e+.033454*n),CN(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Tq(kN,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof kN)return new kN(e.h,e.c,e.l,e.opacity);if(e instanceof xN||(e=bN(e)),0===e.a&&0===e.b)return new kN(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*mN;return new kN(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new kN(e,t,n,null==r?1:r)}),Lq(qq,{brighter(e){return new kN(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new kN(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return EN(this).rgb()}}));var _N=e=>()=>e;function RN(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):_N(isNaN(e)?t:e)}!function e(t){var n=function(e){return 1==(e=+e)?RN: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):_N(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=tN(e)).r,(t=tN(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=RN(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);var IN="center",DN="bottom";[{key:"NoDataExist",alignment:IN,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:IN,condition:function(e){var t=e.layoutService;return!!t&&t.getHyperCubeValue("qMeasureInfo").every((function(e){return"NaN"===e.qMin&&"NaN"===e.qMax}))}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:IN,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:IN},{key:"DataRangeIncludingZero",alignment:DN},{key:"LimitedData",alignment:DN},{key:"NegativeOrZeroValues",alignment:DN}].reduce((function(e,t){return e[t.key]=t,e}),{});var AN,PN=["__proto__","constructor"];function ON(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!PN.some((function(e){return r.includes(e)}))){for(var o=e,a=0;a<r.length-1;++a){var s=r[a];void 0===o[s]&&(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}}}function TN(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e},n=function(){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={}}}}();return function(r){var i=t(r);return n.has(i)?n.get(i):n.set(i,e(r))}}function LN(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];clearTimeout(t),t=setTimeout((function(){return e.apply(r,o)}),n)}}function qN(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 NN(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=zN)):void 0===t&&(t=jN);for(var n,r,i,o,a,s=new $N(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new $N(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(WN)}function jN(e){return e.children}function zN(e){return Array.isArray(e)?e[1]:null}function FN(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function WN(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function $N(e){this.data=e,this.depth=this.height=0,this.parent=null}function BN(e){const{translator:t}=e;return{targets:[{path:"/qHyperCubeDef",dimensions:{min:1,max:1e3,description(e,n,r){const i="rows"===r?.type?"Visualizations.Descriptions.Row":"Visualizations.Descriptions.Column";return t.get(i)}},measures:{min:1,max:1e3,description:()=>t.get("Visualizations.Descriptions.Values")},filters:{description:()=>t.get("SimpleProperties.Filters.Filter")}}]}}$N.prototype=NN.prototype={constructor:$N,count:function(){return this.eachAfter(qN)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return NN(this).eachBefore(FN)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},AN=function(e){
|
|
101
101
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
102
|
-
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,d,h=e.length,p=e.search(/[0-9\-\+#]/),f=p>0?e.substring(0,p):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=h-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,h):"";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"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(d=t[0]).length%l,h=d.length,b=0;b<h;b++)m+=d.charAt(b),!((b-y+1)%l)&&b<h-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),f+(n?"-":"")+r+x}},AN({exports:{}});const HN="qHyperCubeDef.qDimensions",VN="dimensions",GN="qOtherTotalSpec.qTotalMode",UN="totalMode",YN={quarantine(e){UL.quarantineArrayProp({properties:e,arrayPath:HN,quarantineName:UN,arrayName:VN,itemPath:GN})},unquarantine(e){UL.unquarantineArrayProp({properties:e,arrayPath:HN,quarantineName:UN,arrayName:VN,itemPath:GN})}};function KN(e){const t=BN(e);return(e,n,r,i)=>{const o=UL.hypercube.importProperties({exportFormat:e,initialProperties:n,dataDefinition:t.targets[0],hypercubePath:i}),a=o.qProperty.qHyperCubeDef.qDimensions.length,s=o.qProperty.qHyperCubeDef.qMeasures.length;let l,c=o.qProperty.qHyperCubeDef.qInterColumnSortOrder,u=!0;a+s===c.length&&ON(o,"qProperty.qLayoutExclude.quarantine.interColSortOrder",c.concat());const d=o.qProperty.qLayoutExclude.quarantine?.pivotInterColSortOrder;d?(c=d,l=[...d],ON(o,"qProperty.qHyperCubeDef.qInterColumnSortOrder",c),o.qProperty.qLayoutExclude.quarantine&&delete o.qProperty.qLayoutExclude.quarantine.pivotInterColSortOrder):c.length=0;const h=+(c.indexOf(-1)>-1),p=a+h;if(p>c.length)for(let e=c.length;e<p;e++)c.indexOf(e)<0&&c.push(e-h);for(let e=c.length-1;e>=0;e--)c[e]>=a&&c.splice(e,1);s>1&&c.indexOf(-1)<0?c.push(-1):s<2&&c.indexOf(-1)>-1&&c.splice(c.indexOf(-1),1);const f=o.qProperty.qHyperCubeDef.qNoOfLeftDims??-1;if(a>0&&-1===f&&ON(o,"qProperty.qHyperCubeDef.qNoOfLeftDims",a),l?.length===c.length){for(let e=0;e<l.length;e++)if(l[e]!==c[e]){u=!1;break}u&&(UL.unquarantineProperty(o.qProperty,"noOfLeftDims"),UL.unquarantineProperty(o.qProperty,"excludedNoOfLeftDims "))}return UL.conditionalShow.unquarantine(o.qProperty),YN.unquarantine(o.qProperty),(e=>{UL.unquarantineArrayProp({properties:e,arrayPath:XL,itemPath:ZL,arrayName:JL,quarantineName:QL}),UL.unquarantineArrayProp({properties:e,arrayPath:YL,itemPath:ZL,arrayName:KL,quarantineName:QL}),UL.unquarantineArrayProp({properties:e,arrayPath:YL,itemPath:eq,arrayName:KL,quarantineName:tq}),UL.unquarantineArrayProp({properties:e,arrayPath:YL,itemPath:nq,arrayName:KL,quarantineName:rq})})(o.qProperty),UL.unquarantineProperty(o.qProperty,"pivotTableIndentMode"),o}}function XN(e,t){const n=e.qProperty.qHyperCubeDef.qInterColumnSortOrder,r=n.slice(),i=n.indexOf(-1);i>-1&&n.splice(i,1);const o=UL.hypercube.exportProperties({propertyTree:e,hyperCubePath:t}),a=o.properties.qHyperCubeDef,s=a.qDimensions.length,l=a.qMeasures.length;let c=a.qInterColumnSortOrder;ON(o,"properties.qLayoutExclude.quarantine.pivotInterColSortOrder",r),UL.quarantineProperty(o.properties,"qHyperCubeDef.qNoOfLeftDims","noOfLeftDims"),delete o.properties.qHyperCubeDef.qNoOfLeftDims;const u=o.properties.qLayoutExclude.quarantine?.interColSortOrder;u&&(c=u,ON(o,"properties.qHyperCubeDef.qInterColumnSortOrder",c),ON(o,"data.0.interColumnSortOrder",c),o.properties.qLayoutExclude.quarantine&&delete o.properties.qLayoutExclude.quarantine.interColSortOrder);for(let e=c.length;e<s+l;e++)c.length<=e&&c.push(e);return UL.quarantineProperty(o.properties,"qHyperCubeDef.qIndentMode","pivotTableIndentMode"),UL.quarantineProperty(o.properties,"qHyperCubeDef.excludedNoOfLeftDims ","excludedNoOfLeftDims "),UL.conditionalShow.quarantine(o.properties),YN.quarantine(o.properties),(e=>{UL.quarantineArrayProp({properties:e,arrayPath:XL,itemPath:ZL,arrayName:JL,quarantineName:QL}),UL.quarantineArrayProp({properties:e,arrayPath:YL,itemPath:ZL,arrayName:KL,quarantineName:QL}),UL.quarantineArrayProp({properties:e,arrayPath:YL,itemPath:eq,arrayName:KL,quarantineName:tq}),UL.quarantineArrayProp({properties:e,arrayPath:YL,itemPath:nq,arrayName:KL,quarantineName:rq})})(o.properties),o}const JN={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}}}};let ZN=function(e){return e.Text="text",e.Link="link",e.Image="image",e.ImagesInIndentMode="imagesInIndentMode",e.Indicator="indicator",e.MiniChart="miniChart",e.EditableText="editableText",e.EditableSelector="editableSelector",e}({}),QN=function(e){return e.Attribute="attribute",e.Dimension="dimension",e}({});const ej=e=>{switch(e?.type){case"url":return ZN.Link;case"image":return ZN.Image;case"indicator":return ZN.Indicator;case"miniChart":return ZN.MiniChart;default:return ZN.Text}},tj=({isImagesEnabled:e})=>({uses:"dimensionRepresentationItems.representationType",options(t,n,r){const{qIndentMode:i}=r.properties.qHyperCubeDef,o=[{value:"text",translation:"Object.Table.Representation.Text"},{value:"url",translation:"Object.Table.Representation.Link"}];return(!i&&e||i)&&o.push({value:"image",translation:"Object.Table.Representation.Image"}),o}}),nj=e=>{if(e)return{representationImage:{uses:"dimensionRepresentationItems.representationImage",show:e=>ej(e.qDef.representation)===ZN.Image,items:{imageSize:{options:[{value:"alwaysFit",translation:"properties.backgroundImage.sizeAlwaysFit"},{value:"fitWidth",translation:"properties.backgroundImage.sizeFitWidth"},{value:"fitHeight",translation:"properties.backgroundImage.sizeFitHeight"},{value:"fill",translation:"properties.backgroundImage.sizeStretch"},{value:"originalSize",translation:"properties.backgroundImage.originalSize"}]},imageBoxWidth:{ref:"qDef.representation.imageBox.width",translation:"properties.pivot.representation.image.imageBox.width",type:"number",expression:"optional",defaultValue:24,show:(e,t,n)=>{if(!n.properties.qHyperCubeDef)return!1;const{qInterColumnSortOrder:r,qNoOfLeftDims:i,qDimensions:o,qIndentMode:a}=n.properties.qHyperCubeDef;let s=!1;r?.indexOf(-1);const l=o?.indexOf(e)??1/0;return(r?.slice(0,i)??[]).indexOf(l)>-1&&(s=!0),s&&a}}}}}},rj=e=>{const{anything:t}=e,n=!t.sense?.isUnsupportedFeature?.("tableImages");return{representationType:tj({isImagesEnabled:n}),representationUrlPosition:{uses:"dimensionRepresentationItems.representationUrlPosition",show:e=>ej(e.qDef.representation)===ZN.Link},representationUrlLabel:{uses:"dimensionRepresentationItems.representationUrlLabel",show:e=>ej(e.qDef.representation)===ZN.Link&&e.qDef.representation?.urlPosition===QN.Dimension},representationLinkUrl:{uses:"dimensionRepresentationItems.representationLinkUrl",show:e=>ej(e.qDef.representation)===ZN.Link&&e.qDef.representation?.urlPosition===QN.Attribute},...nj(n)}},ij=(e,t)=>{const{anything:n}=e,r=n.sense?.isUnsupportedFeature,i=!r?.("tableImages")&&t[ZN.Image],o=!r?.("qMiniChartDef")&&t[ZN.MiniChart],a=!r?.("tableIndicators")&&t[ZN.Indicator],s=i&&t[ZN.ImagesInIndentMode];return{representationType:{uses:"measureRepresentationItems.representationType",options:(e,t,n)=>(e=>{const{qIndentMode:t}=e.properties.qHyperCubeDef??{},n=[{value:"text",translation:"Object.Table.Representation.Text"}];return(!t&&i||t&&s)&&n.push({value:"image",translation:"Object.Table.Representation.Image"}),a&&n.push({value:"indicator",translation:"Object.Table.Representation.Indicator"}),o&&n.push({value:"miniChart",translation:"Common.MiniChart"}),n})(n)},representationImage:i?{uses:"measureRepresentationItems.representationImage",show:e=>ej(e.qDef.representation)===ZN.Image,items:{imageSize:{options:[{value:"alwaysFit",translation:"properties.backgroundImage.sizeAlwaysFit"},{value:"fitWidth",translation:"properties.backgroundImage.sizeFitWidth"},{value:"fitHeight",translation:"properties.backgroundImage.sizeFitHeight"},{value:"fill",translation:"properties.backgroundImage.sizeStretch"},{value:"originalSize",translation:"properties.backgroundImage.originalSize"}]}}}:void 0,representationIndicator:a?{uses:"measureRepresentationItems.representationIndicator"}:void 0,representationMiniChart:o?{uses:"measureRepresentationItems.representationMiniChart"}:void 0}};let oj=function(e){return e.Dimension="dimensions",e.Measures="measures",e.Pivot="pivot",e}({}),aj=function(e){return e.CellForegroundColor="cellForegroundColor",e.CellBackgroundColor="cellBackgroundColor",e.ImageUrl="imageUrl",e.ImageLabel="imageLabel",e.Link="url",e.LinkLabel="urlLabel",e}({}),sj=function(e){return e.TopGrid="topGrid",e.LeftGrid="leftGrid",e.DataGrid="dataGrid",e}({}),lj=function(e){return e.Forward="forward",e.Backward="backward",e.None="none",e}({});const cj="image",uj=(e,t,n)=>{if(!n.properties.qHyperCubeDef.qIndentMode)return!0;const r=n.properties.qHyperCubeDef.qInterColumnSortOrder?.indexOf(-1)??-1;let i=n.properties.qHyperCubeDef.qNoOfLeftDims??-1;r>-1&&r<i&&(i-=1);const o=n.properties.qHyperCubeDef.qDimensions.indexOf(e);return 0===o||o>=i},dj=()=>({type:{type:"string",component:"dropdown",ref:"qDef.columnWidth.type",translation:"Object.Table.Column.Width",options:[{value:RT.Auto,translation:"Common.Auto"},{value:RT.FitToContent,translation:"Object.Table.Column.FitToContent"},{value:RT.Pixels,translation:"Object.Table.Column.Pixels"},{value:RT.Percentage,translation:"Object.Table.Column.Percentage"}],defaultValue:RT.Auto},sizePixels:{ref:"qDef.columnWidth.pixels",translation:"Object.Table.Column.Pixels",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:_T.PixelsDefault,show:e=>e.qDef.columnWidth?.type===RT.Pixels},sizePercentage:{ref:"qDef.columnWidth.percentage",translation:"Object.Table.Column.Percentage",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:_T.PercentageDefault,show:e=>e.qDef.columnWidth?.type===RT.Percentage}}),hj=({key:e,translation:t,env:n})=>{const r=!n.anything.sense?.isUnsupportedFeature?.("tableImages");return{[`${e}Auto`]:{ref:`qDef.${e}.auto`,type:"boolean",component:"switch",translation:t,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],defaultValue:!0,show:t=>!r||"labelTextAlign"===e||t.qDef.representation?.type!==cj},[e]:{ref:`qDef.${e}.align`,type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"align_left",labelPlacement:"bottom",value:"left",translation:"properties.dock.left"},{component:"icon-item",icon:"align_center",labelPlacement:"bottom",value:"center",translation:"Common.Center"},{component:"icon-item",icon:"align_right",labelPlacement:"bottom",value:"right",translation:"properties.dock.right"}],defaultValue:"left",show:t=>void 0!==t.qDef[e]&&!t.qDef[e].auto&&(!r||"labelTextAlign"===e||t.qDef.representation?.type!==cj)}}},pj="TOTAL_OFF",fj={component:"attribute-expression-reference",defaultValue:[],ref:"qAttributeExpressions",items:[{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.BackgroundExpression",defaultValue:"",id:aj.CellBackgroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.ForegroundExpression",defaultValue:"",id:aj.CellForegroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:aj.LinkLabel,tid:"URLLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:aj.Link,tid:"URLByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:aj.ImageLabel,tid:"ImageLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:aj.ImageUrl,tid:"ImageUrlByExpression",show:!1}]},mj="TOTAL_OFF",gj={component:"attribute-expression-reference",defaultValue:[],ref:"qAttributeExpressions",items:[{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.BackgroundExpression",defaultValue:"",id:aj.CellBackgroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.ForegroundExpression",defaultValue:"",id:aj.CellForegroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:aj.LinkLabel,tid:"URLLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:aj.Link,tid:"URLByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:aj.ImageLabel,tid:"ImageLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:aj.ImageUrl,tid:"ImageUrlByExpression",show:!1}]},yj=e=>{const{translator:t,anything:n,flags:r}=e,i=(e=>{const{translator:t,anything:n}=e;return{type:"items",component:"data-assets-panel-pivot",translation:"Common.Data",items:{dimensions:{type:"array",component:"expandable-items",ref:"qHyperCubeDef.qDimensions",items:{field:{type:"items",translation:"Common.Field",items:{libraryId:{type:"string",component:"library-item",libraryItemType:"dimension",ref:"qLibraryId",translation:"Common.Dimension",show:e=>!!e.qLibraryId},inlineDimension:{component:"inline-dimension",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},nullSuppression:{type:"boolean",ref:"qNullSuppression",defaultValue:!1,translation:"properties.dimensions.showNull",inverted:!0},totalMode:{type:"string",component:"switch",translation:"properties.showTotals",ref:"qOtherTotalSpec.qTotalMode",defaultValue:pj,trueOption:{value:"TOTAL_EXPR",translation:"properties.on"},falseOption:{value:pj,translation:"properties.off"},show:!n.sense?.isUnsupportedFeature?.("totals")&&uj},totalsLabel:{type:"string",component:"expression",expressionType:"StringExpr",ref:"qTotalLabel",translation:"properties.totals.label",defaultValue:()=>t.get("Object.Table.Totals"),show:(e,t,r)=>!n.sense?.isUnsupportedFeature?.("totals")&&e.qOtherTotalSpec?.qTotalMode!==pj&&uj(e,0,r)},dimensionLimits:{uses:"dimensions.items.dimensionLimits"},showOthers:{uses:"dimensions.items.others"},globalGrouping:{type:"boolean",translation:"properties.dimensionLimits.globalGrouping",ref:"qOtherTotalSpec.qGlobalOtherGrouping",defaultValue:!1,show:e=>"OTHER_OFF"!==e.qOtherTotalSpec?.qOtherMode}}},presentation:{type:"items",translation:"properties.presentation",items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},cellColoring:fj,...hj({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...hj({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...rj(e),...dj()}}}},measures:{type:"array",component:"expandable-items",ref:"qHyperCubeDef.qMeasures",items:{field:{type:"items",translation:"Common.Field",items:{libraryId:{type:"string",component:"library-item",libraryItemType:"measure",ref:"qLibraryId",translation:"Common.Measure",show:e=>!!e.qLibraryId},inlineMeasure:{component:"inline-measure",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},numberFormatting:{uses:"measures.items.numberFormatting"}}},presentation:{type:"items",translation:"properties.presentation",items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},cellColoring:fj,...hj({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...hj({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...ij(e,{[ZN.Image]:!0,[ZN.Indicator]:!0}),...dj()}}}}}}})(e);return r.isEnabled("CLIENT_IM5974_PIVOT_DATA_PROPERTIES")?i:{type:"items",component:"pivot-data",translation:"properties.data",addTranslation:"Property.AddData",items:{dimensions:{type:"array",component:"dimensions",translation:"Common.Dimensions",alternativeTranslation:"properties.alternative.dimensions",ref:"qHyperCubeDef.qDimensions",disabledRef:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",min:1,allowAdd:!0,allowRemove:!0,allowMove:!0,addTranslation:"properties.dimensions.add",grouped:!0,items:{libraryId:{type:"string",component:"library-item",libraryItemType:"dimension",ref:"qLibraryId",translation:"Common.Dimension",show:e=>!!e.qLibraryId},inlineDimension:{component:"inline-dimension",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},nullSuppression:{type:"boolean",ref:"qNullSuppression",defaultValue:!1,translation:"properties.dimensions.showNull",inverted:!0},totalMode:{type:"string",component:"switch",translation:"properties.showTotals",ref:"qOtherTotalSpec.qTotalMode",defaultValue:mj,trueOption:{value:"TOTAL_EXPR",translation:"properties.on"},falseOption:{value:mj,translation:"properties.off"},show:!n.sense?.isUnsupportedFeature?.("totals")&&uj},totalsLabel:{type:"string",component:"expression",expressionType:"StringExpr",ref:"qTotalLabel",translation:"properties.totals.label",defaultValue:()=>t.get("Object.Table.Totals"),show:(e,t,r)=>!n.sense?.isUnsupportedFeature?.("totals")&&e.qOtherTotalSpec?.qTotalMode!==mj&&uj(e,0,r)},dimensionLimits:{uses:"dimensions.items.dimensionLimits"},showOthers:{uses:"dimensions.items.others"},globalGrouping:{type:"boolean",translation:"properties.dimensionLimits.globalGrouping",ref:"qOtherTotalSpec.qGlobalOtherGrouping",defaultValue:!1,show:e=>"OTHER_OFF"!==e.qOtherTotalSpec?.qOtherMode},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},cellColoring:gj,...hj({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...hj({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...rj(e),...dj()}},measures:{type:"array",component:"measures",translation:"Common.Measures",ref:"qHyperCubeDef.qMeasures",disabledRef:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",min:1,allowAdd:!0,allowRemove:!0,allowMove:!0,addTranslation:"properties.measures.add",grouped:!0,items:{libraryId:{type:"string",component:"library-item",libraryItemType:"measure",ref:"qLibraryId",translation:"Common.Measure",show:e=>!!e.qLibraryId},inlineMeasure:{component:"inline-measure",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},numberFormatting:{uses:"measures.items.numberFormatting"},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},cellColoring:gj,...hj({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...hj({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...ij(e,{[ZN.Image]:!0,[ZN.ImagesInIndentMode]:!0,[ZN.Indicator]:!0}),...dj()}},filters:{type:"items",translation:"SimpleProperties.Filters.Filters",ref:"filters",allowAdd:!0,allowRemove:!0,allowMove:!1,addTranslation:"properties.filters.add",grouped:!0,items:{filter:{type:"object",component:"filter-item",ref:"filter"}}}}}},vj=Aw().palette,bj={TEXT:vj.text.primary,DISABLED:vj.text.disabled,HOVER:vj.action.hover,WHITE:Sp.GREYSCALE_100,BORDER_MEDIUM:Sp.GREYSCALE_85,DARK_MODE_TEXT:Sp.GREYSCALE_95,DARK_MODE_BORDER:Sp.GREYSCALE_95,DARK_MODE_DISABLED:Sp.GREYSCALE_70,TRANSPARENT:"transparent",SELECTED:vj.primary.main,LINK:vj.info.main,ERROR:vj.error.main},xj=(e,t=bj.TEXT,n=bj.WHITE)=>{const r=gq(e),i=gq(t),o=gq(n);return r.isInvalid()?t:function(e,t,n){const r=yq(e,t),i=yq(e,n);if(void 0!==r&&void 0!==i)return r>i?t:n}(r,o,i).getRGB()},wj=e=>{const t=e.getStyle("","","dataColors.selected")||bj.SELECTED,n=function(e,t){const n=gq("#FFFFFF"),r=gq(e),i=gq(t);if(r.isInvalid()||i.isInvalid()||r.getAlpha()<1||i.getAlpha()<1)return t;const o=yq(n,r),a=yq(i,r),s=o>a||o>4.5;return!s&&a>3?i.getHex():s?"#FFFFFF":"#000000"}(t,bj.TEXT);return{background:t,color:n}},Sj=(e,t)=>{const n=gq(e);return 0===n.a?(n.setAlpha(t.opacity),n.getString()):n.isDark()?n.getBrightenedColor(t.brighter).getString():n.getDarkenedColor(t.darker).getString()},Cj=e=>{const t=gq(e);return t.isInvalid()?null:1===t.a?t.getRGB():t.getRGBA()},Mj=e=>{e.stopPropagation(),e.preventDefault()},kj=(e,t,n,r)=>({ref:e,translation:t,dualOutput:!0,type:"object",component:"color-picker",width:"auto",disableNone:r??!1,defaultValue(e,t,i){const o=r?.(e,t,i)??!1,a=i.theme.current(),s=n(a,o);return{color:"transparent"===s?"none":s}}}),Ej=(e,t=!1)=>{return{value:e,label:t?(n=e,n.charAt(0).toUpperCase()+n.slice(1)):e,groupHeader:!1,disabled:!1,styles:t?{fontFamily:e}:void 0};var n},_j=({ref:e,themeAccessor:t,translator:n,flags:r})=>({component:"dropdown",ref:e,options:(e,i,o)=>{const a=o.theme.current();return((e,t,n,r)=>{const i=t.fontFamily??"Source Sans Pro, sans-serif",o=t.fontFamilies??[],a=Array.from(new Set([e,i,...o])),s=[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0},...a.sort().map((e=>Ej(e,!0)))],l=[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0},...Pq(r).filter((e=>!a.includes(e))).map((e=>Ej(e,!0)))];return[...s,...l.length>1?l:[]]})(t(a),a,n,r)},defaultValue:(e,n,r)=>t(r.theme.current())}),Rj=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Ij=({ref:e,themeAccessor:t,translator:n})=>({component:"dropdown",ref:e,options:(e,r,i)=>{const o=i.theme.current();return((e,t,n)=>{const r=t.fontSize,i=t.fontSizes??[],o=Array.from(new Set([e,r,...i])),a=[{value:"ThemeHeader",label:n.get("properties.themeFontSizes"),metaText:n.get("properties.theme"),groupHeader:!0},...o.sort(((e,t)=>parseInt(e,10)-parseInt(t,10))).map((e=>Ej(e,!1)))],s=[{value:"DefaultHeader",label:n.get("properties.allFontSizes"),metaText:n.get("properties.default"),groupHeader:!0},...Rj.filter((e=>!o.includes(e))).map((e=>Ej(e,!1)))];return[...a,...s.length>1?s:[]]})(t(o),o,n)},defaultValue:(e,n,r)=>t(r.theme.current())}),Dj=({section:e,defaultFontStyle:t,translator:n,flags:r,getThemeValue:i,translation:o,disableNoneCallback:a})=>({component:"panel-section",translation:o??`properties.pivot.${e}`,items:{content:{component:"items",ref:"components",key:"theme",items:{fontFamily:_j({ref:`${e}.fontFamily`,themeAccessor:t=>i(t,e,"fontFamily")??t.fontFamily,translator:n,flags:r}),fontWrapperItem:{component:"inline-wrapper",items:{fontStyle:{component:"font-style-buttons",width:!1,ref:`${e}.fontStyle`,defaultValue:t??[]},fontSize:Ij({ref:`${e}.fontSize`,themeAccessor:t=>i(t,e,"fontSize")??t.fontSize,translator:n}),fontColor:kj(`${e}.fontColor`,void 0,(t=>i(t,e,"color")??t.color))}},background:kj(`${e}.background`,"properties.background",((t,n)=>{const r=n?bj.WHITE:bj.TRANSPARENT;return i(t,e,"backgroundColor")??r}),a)}}}}),Aj=({section:e,defaultFontStyle:t,fallbackBackground:n,getThemeValue:r})=>({component:"panel-section",translation:`properties.pivot.${e}`,items:{content:{component:"items",ref:"components",key:"theme",items:{fontWrapperItem:{component:"inline-wrapper",items:{fontStyle:{component:"font-style-buttons",fullWidth:!0,ref:`${e}.fontStyle`,defaultValue:t??[]},fontColor:kj(`${e}.fontColor`,void 0,(t=>r(t,e,"color")??t.color))}},background:kj(`${e}.background`,"properties.background",(t=>r(t,e,"backgroundColor")??n??"transparent"))}}}}),Pj=(e,t)=>({component:"dropdown",ref:e,translation:t,options:[...Array(10).keys()].map((e=>({value:e+1,translation:e+1}))),defaultValue:1}),Oj="12px",Tj="Source Sans Pro, sans-serif",Lj="600",qj=15e3,Nj=4/3;let jj=function(e){return e.Transparent="transparent",e.FontSecondary="#737373",e.DividerDark="#595959",e.DividerLight="#D9D9D9",e.NullValueBackground="#F2F2F2",e}({}),zj=function(e){return e.Solid="solid",e.None="none",e}({});const Fj={display:"flex",justifyContent:"center",alignItems:"center"},Wj={borderStyle:"solid"},$j={boxSizing:"border-box",padding:"4px 8px",userSelect:"none",WebkitUserSelect:"none"},Bj={lineHeight:Nj,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},Hj=e=>({whiteSpace:"unset",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",wordBreak:e>1?"break-word":"break-all"}),Vj=(e,t)=>e>0?`${e}px ${zj.Solid} ${t}`:zj.None,Gj=(e,t,n,r,i)=>{const o=Number(!t||i?.right),a=Number(!e||i?.bottom);return{borderRight:"rtl"!==r?Vj(o,n):zj.None,borderBottom:Vj(a,n),borderLeft:"rtl"===r?Vj(o,n):zj.None,borderTop:zj.None}},Uj=(e,t,n,r,i,o,a)=>{const s=Gj(t,r,i,o,a);return e.isLeftDimension||(e.isLastDimension&&!t&&(s.borderBottom=Vj(2,i)),n||(s.borderLeft="rtl"!==o?Vj(1,i):"none",s.borderRight="rtl"===o?Vj(1,i):"none")),s},Yj=({bottomDivider:e,rightDivider:t,borderColor:n})=>{const r={};return e&&(r.borderBottom=Vj(1,n)),t&&(r.borderRight=Vj(1,n)),r},Kj=(e,t,n)=>{switch(t){case"header":return e.object?.pivotTableV2?.dimension?.label?.name?.[n];case"dimensionValues":return e.object?.pivotTableV2?.dimension?.label?.value?.[n];case"measureLabels":return e.object?.pivotTableV2?.measure?.label?.name?.[n];case"measureValues":return e.object?.pivotTableV2?.measure?.label?.value?.[n];case"totalValues":return e.object?.pivotTableV2?.total?.label?.value?.[n];case"nullValues":return e.object?.pivotTableV2?.null?.label?.value?.[n];default:return}},Xj=(e,t)=>({type:"items",items:[{component:"styling-panel",chartTitle:"Object.PivotTable",subtitle:"LayerStyleEditor.component.styling",translation:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:!0,items:{headerSection:Dj({section:"header",defaultFontStyle:["bold"],translator:e,flags:t,getThemeValue:Kj}),dimensionValueSection:Dj({section:"dimensionValues",translator:e,flags:t,getThemeValue:Kj}),measureValueSection:Dj({section:"measureValues",translator:e,flags:t,getThemeValue:Kj}),measureLabelSection:Aj({section:"measureLabels",getThemeValue:Kj}),totalValuesSection:Aj({section:"totalValues",defaultFontStyle:["bold"],getThemeValue:Kj}),nullValuesSection:Aj({section:"nullValues",fallbackBackground:jj.NullValueBackground,getThemeValue:Kj}),gridSection:{translation:"properties.pivot.grid",component:"panel-section",items:{gridItems:{component:"items",ref:"components",key:"theme",items:{lineClamp:Pj("grid.lineClamp","ThemeStyleEditor.style.rowHeight"),columnLineClamp:Pj("grid.columnLineClamp","ThemeStyleEditor.style.columnHeight"),border:kj("grid.border","properties.border",(e=>e.object?.pivotTableV2?.grid?.borderColor??jj.DividerLight)),divider:kj("grid.divider","properties.pivot.divider",(e=>e.object?.pivotTableV2?.grid?.divider?.borderColor??jj.DividerDark)),background:kj("grid.background","properties.background",(e=>e.object?.pivotTableV2?.grid?.backgroundColor??jj.Transparent))}}}}}}]}),Jj=e=>{if(e.isEnabled("CLIENT_IM_5973_PIVOT_TABLE_EXPLORATION"))return{chartExploration:{type:"items",translation:"properties.chartExploration",items:{chartExplorationToggler:{type:"items",component:"chart-exploration-toggler",translation:"properties.enableChartExploration",ref:"enableChartExploration"},visibilityToggler:{show:e=>e.enableChartExploration,component:"buttongroup",translation:"properties.ChartExploration.VisibilityOption",ref:"chartExploration.menuVisibility",options:[{value:"auto",translation:"Common.Auto"},{value:"minimized",translation:"properties.ChartExploration.Minimized"}]}},show:e=>!e.insideContainer}}},Zj=(e,t)=>({uses:"settings",items:{presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:[Xj(e,t),{type:"items",items:{nullValueText:{ref:"nullValueRepresentation.text",type:"string",translation:"properties.pivot.nullValueText",defaultValue:"-"},alwaysFullyExpanded:{ref:"qHyperCubeDef.qAlwaysFullyExpanded",type:"boolean",translation:"properties.pivot.fullyExpanded",defaultValue:!1},indentMode:{ref:"qHyperCubeDef.qIndentMode",type:"boolean",translation:"properties.pivot.indentMode",defaultValue:!1,change(e){e.qHyperCubeDef.qShowTotalsAbove=!0}},type:{type:"string",component:"dropdown",ref:"qHyperCubeDef.indentModeColumnWidth.type",translation:"Object.Table.Column.Width",options:[{value:RT.Auto,translation:"Common.Auto"},{value:RT.Pixels,translation:"Object.Table.Column.Pixels"},{value:RT.Percentage,translation:"Object.Table.Column.Percentage"}],defaultValue:RT.Auto,show:e=>!!e.qHyperCubeDef.qIndentMode},sizePixels:{ref:"qHyperCubeDef.indentModeColumnWidth.pixels",translation:"Object.Table.Column.Pixels",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:_T.PixelsDefault,show:e=>{const t=e.qHyperCubeDef;return t.qIndentMode&&t.indentModeColumnWidth?.type===RT.Pixels}},sizePercentage:{ref:"qHyperCubeDef.indentModeColumnWidth.percentage",translation:"Object.Table.Column.Percentage",component:"expression",expressionType:"ValueExpression",expression:"optional",defaultValue:_T.PercentageDefault,show:e=>{const t=e.qHyperCubeDef;return t.qIndentMode&&t.indentModeColumnWidth?.type===RT.Percentage}},showTotalsAbove:{ref:"qHyperCubeDef.qShowTotalsAbove",type:"boolean",translation:"properties.pivot.showTotalsAbove",defaultValue:!0,show(e){const{qIndentMode:t}=e.qHyperCubeDef;return!t&&!!e.qHyperCubeDef.qDimensions.some((e=>"TOTAL_EXPR"===e.qOtherTotalSpec?.qTotalMode))}},resetProperties:{type:"object",component:"button",translation:"properties.pivot.resetExpansionButton",disabled:e=>!!e.qHyperCubeDef.qAlwaysFullyExpanded,action(e,t,n,r){e.qHyperCubeDef.qExpansionState=[],r.$emit("saveProperties",e)}}}}]},...Jj(t)}}),Qj="auto",ez={type:"items",translation:"properties.sorting",items:{sortbyY:{type:"items",items:{sortbyYToggle:{ref:"qHyperCubeDef.qSortbyYValue",type:"boolean",component:"switch",translation:"properties.sorting.sortByY.label",convertFunctions:{get:e=>!!e("integer"),set:(e,t)=>{t("integer",e?-1:0)}},options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}]},sortbyYOrder:{ref:"qHyperCubeDef.qSortbyYValue",type:"string",component:"dropdown",defaultValue:0,options:[{value:1,translation:"properties.sorting.ascending"},{value:-1,translation:"properties.sorting.descending"}],show:e=>!!e.qHyperCubeDef.qSortbyYValue}}},defaultSorting:{uses:"sorting",items:{dimensions:{showPriority:!1,allowMove:!1},measures:{included:!1}}},searchSorting:{ref:"search.sorting",type:"string",component:"dropdown",defaultValue:Qj,translation:"Object.Table.SortingInSearch",options:[{value:Qj,translation:"Common.Auto"},{value:"inherit",translation:"Object.Table.SortingInSearch.InheritFromDimension"}]}}};function tz(e){const{translator:t,flags:n}=e;return{type:"items",component:"accordion",items:{data:yj(e),sorting:ez,addons:JN,settings:Zj(t,n)}}}function nz(e){return{support:{cssScaling:!0,snapshot:!0,export:!0,exploration:e.flags.isEnabled("CLIENT_IM_5973_PIVOT_TABLE_EXPLORATION"),sharing:!1,exportData:!0,viewData:!0},usePropertyHandler:"pivot-data",definition:tz(e),importProperties:KN(e),exportProperties:XN,exploration:AL(e),data:{dimensions:{min:1,max:1e3},measures:{min:1,max:1e3}},dataHandler:e.flags.isEnabled("VNA-147_NEBULA_PIVOT_DATA_HANDLERS")?e=>new VL(e):void 0}}const rz=()=>{let e;const t=new Promise((t=>{e=t}));return{promise:t,resolve:e}};function iz(e,t){return E((()=>e),t)}const oz={},az=e=>{const t=E((()=>({current:oz})),[]);return t.current=t.current===oz?e:t.current,t},sz=e=>!!e&&0===gq(e).a,lz="#grid",cz=(e,t)=>{const n=t?.closest(e);return n&&window.getComputedStyle(n).backgroundColor},uz=(e,t,n,r,i)=>{const o=cz(".qv-object .qv-inner-object",n),a=cz(".qv-panel-sheet",n),s=cz(lz,n)??a,l=(e=>{const t=e.components?.find((e=>"general"===e.key)),n=t?.bgColor?.colorExpression,r=t?.bgColor?.color?.color,i=t?.bgColor?.useColorExpression;if(i&&n)return Cj(n);if("none"===r)return"transparent";if(void 0===r)return;const o=gq(r);return o.setAlpha(t?.bgColor?.color?.alpha??o.a),o.getRGBA()})(e),c=r?.(t),u=i?.(t),d=l||c||o||u,h=sz(d),p=!sz(f=h?s:d)&&xj(f,bj.TEXT,bj.DARK_MODE_TEXT)===dq(bj.DARK_MODE_TEXT);var f;const m=((e,t,n,r=bj.WHITE)=>e&&!sz(e)?e:sz(t)?n&&!sz(n)?n:r:t)(l,d,s);return{color:d,headerColor:m,isDark:p}},dz=(e,t,n,r)=>{const i=A(),o=((e,t={attributeFilter:["style"],childList:!1,subtree:!1})=>{const[n,r]=I([]);return D((()=>{let n;return e&&(n=new MutationObserver((e=>{r(e)})),n.observe(e,t)),()=>{n?.disconnect()}}),[e,t]),n})(t.closest(lz),{attributeFilter:["style"],childList:!1,subtree:!1,attributeOldValue:!0}).filter((({oldValue:e})=>e?.includes("background"))).map((({oldValue:e})=>e)).join(",");return E((()=>({...i,background:uz(e,i,t,n,r)})),[i.name(),t,n,r,e,o])};function hz(e,t){const n=E((()=>({isLoading:!0})),t),[r,i]=R((async()=>{try{return await e()}finally{n.isLoading=!1}}),t);return[r,n.isLoading,i]}const pz=3;function fz(e,t,n){let r=0,i=e.length;if(e.length<=1)return null;if(n(e)<=t)return null;for(;r<=i;){const o=Math.floor((r+i)/2),a=e.slice(0,o),s=e.slice(0,o-1),l=n(a),c=n(s);if(l>t&&c<=t)return e.slice(o-1)||null;if(l===t)return e.slice(o)||null;l<t?r=o+1:i=o}return null}function mz({fontSize:e="12px",fontFamily:t="Source Sans Pro, Arial, sans-serif",fontStyle:n="normal",fontWeight:r="normal"},i){const{maxNbrLinesOfText:o=pz}={},{estimateWidth:a,measureText:s,estimateLineCount:l}=f((()=>{const i=document.createElement("canvas").getContext("2d");i.font=`${n} ${r} ${e} ${t}`;const a=TN(i.measureText.bind(i)),s=e=>+a(e).width.toFixed(2),l=TN((({text:e,maxWidth:t,isNumeric:n=!1})=>{if(n)return 1;let r=0,i=e;do{r+=1,i=fz(i,t,s)}while(null!==i&&r<o);return r}),(({text:e,maxWidth:t,isNumeric:n})=>`${e}-${t}-${n?"true":"false"}`));return{measureText:e=>a(e).width,estimateWidth:e=>a("N").width*e,estimateLineCount:l}}),[n,r,e,t,o]);return{estimateWidth:a,measureText:s,estimateLineCount:l}}var gz,yz=C;gz=yz.createRoot,yz.hydrateRoot;const vz="Source Sans Pro, sans-serif";function bz(e,t){const[n,r]=m(t),i=n.some(((e,n)=>e!==t[n]));i&&(r(t),e())}var xz={NebulaTableUtils_ColumnAdjuster_ColumnNameLabel:{id:"NebulaTableUtils.ColumnAdjuster.ColumnNameLabel",locale:{"de-DE":"Breite von {0}","en-US":"Width of {0}","es-ES":"Ancho de {0}","fr-FR":"Largeur de {0}","it-IT":"Larghezza di {0}","ja-JP":"{0} の幅","ko-KR":"{0}의 너비","nl-NL":"Breedte van {0}","pl-PL":"Szerokość kolumny {0}","pt-BR":"Comprimento de {0}","ru-RU":'Ширина столбца "{0}"',"sv-SE":"Bredd på {0}","tr-TR":"{0} genişliği","zh-CN":"{0} 的宽度","zh-TW":"{0} 的寬度"}},NebulaTableUtils_MenuGroupLabel_Sorting:{id:"NebulaTableUtils.MenuGroupLabel.Sorting",locale:{"de-DE":"Sortierung","en-US":"Sorting","es-ES":"Ordenación","fr-FR":"Tri","it-IT":"Ordinamento","ja-JP":"ソート","ko-KR":"정렬","nl-NL":"Sorteren","pl-PL":"Sortowanie","pt-BR":"Classificação","ru-RU":"Сортировка","sv-SE":"Sortering","tr-TR":"Sıralama","zh-CN":"排序","zh-TW":"排序"}},NebulaTableUtils_MenuItemLabel_AdjustColumnSize:{id:"NebulaTableUtils.MenuItemLabel.AdjustColumnSize",locale:{"de-DE":"Spaltengröße anpassen","en-US":"Adjust column size","es-ES":"Ajustar el tamaño de columna","fr-FR":"Ajuster la taille de colonne","it-IT":"Regola dimensioni colonna","ja-JP":"列サイズを調整","ko-KR":"열 크기 조정","nl-NL":"Kolomgrootte aanpassen","pl-PL":"Dostosuj rozmiar kolumny","pt-BR":"Ajustar tamanho da coluna","ru-RU":"Настроить размер столбца","sv-SE":"Justera kolumnens storlek","tr-TR":"Sütun boyutunu ayarla","zh-CN":"调节列大小","zh-TW":"調整欄大小"}},NebulaTableUtils_MenuItemLabel_ClearSelections:{id:"NebulaTableUtils.MenuItemLabel.ClearSelections",locale:{"de-DE":"Auswahlen löschen","en-US":"Clear selections","es-ES":"Borrar selecciones","fr-FR":"Effacer les sélections","it-IT":"Cancella selezioni","ja-JP":"選択をクリア","ko-KR":"선택 지우기","nl-NL":"Geselecteerde waarden wissen","pl-PL":"Wyczyść wybory","pt-BR":"Limpar seleções","ru-RU":"Очистить выбранные","sv-SE":"Radera urval","tr-TR":"Seçimleri temizle","zh-CN":"清除选择项","zh-TW":"清除選項"}},NebulaTableUtils_MenuItemLabel_Collapse:{id:"NebulaTableUtils.MenuItemLabel.Collapse",locale:{"de-DE":"Reduzieren","en-US":"Collapse","es-ES":"Contraer","fr-FR":"Réduire","it-IT":"Comprimi","ja-JP":"折りたたむ","ko-KR":"축소","nl-NL":"Samenvouwen","pl-PL":"Zwiń","pt-BR":"Recolher","ru-RU":"Свернуть","sv-SE":"Dölj","tr-TR":"Daralt","zh-CN":"折叠","zh-TW":"收合"}},NebulaTableUtils_MenuItemLabel_ColumnOptions:{id:"NebulaTableUtils.MenuItemLabel.ColumnOptions",locale:{"de-DE":"Spaltenoptionen","en-US":"Column options","es-ES":"Opciones de columna","fr-FR":"Options de colonne","it-IT":"Opzioni colonna","ja-JP":"列オプション","ko-KR":"열 옵션","nl-NL":"Kolomopties","pl-PL":"Opcje kolumny","pt-BR":"Opções da coluna","ru-RU":"Параметры столбца","sv-SE":"Alternativ för kolumn","tr-TR":"Sütun seçenekleri","zh-CN":"列选项","zh-TW":"欄選項"}},NebulaTableUtils_MenuItemLabel_Expand:{id:"NebulaTableUtils.MenuItemLabel.Expand",locale:{"de-DE":"Erweitern","en-US":"Expand","es-ES":"Expandir","fr-FR":"Développer","it-IT":"Espandi","ja-JP":"展開","ko-KR":"확장","nl-NL":"Uitvouwen","pl-PL":"Rozwiń","pt-BR":"Expandir","ru-RU":"Развернуть","sv-SE":"Utöka","tr-TR":"Genişlet","zh-CN":"展开","zh-TW":"展開"}},NebulaTableUtils_MenuItemLabel_Search:{id:"NebulaTableUtils.MenuItemLabel.Search",locale:{"de-DE":"Suchen","en-US":"Search","es-ES":"Buscar","fr-FR":"Rechercher","it-IT":"Cerca","ja-JP":"検索","ko-KR":"검색","nl-NL":"Zoeken","pl-PL":"Wyszukaj","pt-BR":"Pesquisar","ru-RU":"Поиск","sv-SE":"Sök","tr-TR":"Ara","zh-CN":"搜索","zh-TW":"搜尋"}},NebulaTableUtils_MenuItemLabel_SelectAll:{id:"NebulaTableUtils.MenuItemLabel.SelectAll",locale:{"de-DE":"Alle auswählen","en-US":"Select all","es-ES":"Seleccionar todo","fr-FR":"Sélectionner tout","it-IT":"Seleziona tutti","ja-JP":"すべて選択","ko-KR":"모두 선택","nl-NL":"Alles selecteren","pl-PL":"Wybierz wszystko","pt-BR":"Selecionar tudo","ru-RU":"Выбрать все","sv-SE":"Välj alla","tr-TR":"Tümünü seç","zh-CN":"全选","zh-TW":"全選"}},NebulaTableUtils_MenuItemLabel_SelectAlternative:{id:"NebulaTableUtils.MenuItemLabel.SelectAlternative",locale:{"de-DE":"Alternative Werte auswählen","en-US":"Select alternative","es-ES":"Seleccionar alternativos","fr-FR":"Sélectionner des valeurs alternatives","it-IT":"Seleziona alternativi","ja-JP":"代替項目を選択","ko-KR":"대체 가능 값 선택","nl-NL":"Alternatief selecteren","pl-PL":"Wybierz alternatywę","pt-BR":"Selecionar alternativa","ru-RU":"Выбрать альтернативные","sv-SE":"Välj alternativ","tr-TR":"Alternatifi seç","zh-CN":"选择替代项","zh-TW":"選取替代選項"}},NebulaTableUtils_MenuItemLabel_SelectExcluded:{id:"NebulaTableUtils.MenuItemLabel.SelectExcluded",locale:{"de-DE":"Ausgeschlossene Werte auswählen","en-US":"Select excluded","es-ES":"Seleccionar excluidos","fr-FR":"Sélectionner les valeurs exclues","it-IT":"Seleziona esclusi","ja-JP":"除外項目を選択","ko-KR":"제외 항목 선택","nl-NL":"Uitgesloten waarden selecteren","pl-PL":"Wybierz wykluczone","pt-BR":"Selecionar excluídos","ru-RU":"Выбрать исключенные","sv-SE":"Välj uteslutna","tr-TR":"Hariç tutulanı seç","zh-CN":"选择排除项","zh-TW":"選取排除值"}},NebulaTableUtils_MenuItemLabel_SelectPossible:{id:"NebulaTableUtils.MenuItemLabel.SelectPossible",locale:{"de-DE":"Wählbare Werte auswählen","en-US":"Select possible","es-ES":"Seleccionar posibles","fr-FR":"Sélectionner les valeurs possibles","it-IT":"Seleziona possibili","ja-JP":"絞込項目を選択","ko-KR":"사용 가능 항목 선택","nl-NL":"Mogelijke waarden selecteren","pl-PL":"Wybierz możliwe","pt-BR":"Selecionar possíveis","ru-RU":"Выбрать возможные","sv-SE":"Välj möjliga","tr-TR":"Olası olanı seç","zh-CN":"选择可能值","zh-TW":"選取可能值"}},NebulaTableUtils_MenuItemLabel_Selections:{id:"NebulaTableUtils.MenuItemLabel.Selections",locale:{"de-DE":"Auswahlen","en-US":"Selections","es-ES":"Selecciones","fr-FR":"Sélections","it-IT":"Selezioni","ja-JP":"選択","ko-KR":"선택 내용","nl-NL":"Selecties","pl-PL":"Wybory","pt-BR":"Seleções","ru-RU":"Выборки","sv-SE":"Urval","tr-TR":"Seçimler","zh-CN":"选择项","zh-TW":"選項"}},NebulaTableUtils_MenuItemLabel_SortAscending:{id:"NebulaTableUtils.MenuItemLabel.SortAscending",locale:{"de-DE":"In aufsteigender Reihenfolge sortieren","en-US":"Sort ascending","es-ES":"Orden ascendente","fr-FR":"Trier par ordre croissant","it-IT":"Ordinamento crescente","ja-JP":"昇順でソート","ko-KR":"오름차순으로 정렬","nl-NL":"Oplopend sorteren","pl-PL":"Sortuj rosnąco","pt-BR":"Classificar em ordem crescente","ru-RU":"Сортировка по возрастанию","sv-SE":"Sortera stigande","tr-TR":"Artan sıralama","zh-CN":"升序排序","zh-TW":"以遞增方式排序"}},NebulaTableUtils_MenuItemLabel_SortDescending:{id:"NebulaTableUtils.MenuItemLabel.SortDescending",locale:{"de-DE":"In absteigender Reihenfolge sortieren","en-US":"Sort descending","es-ES":"Orden descendente","fr-FR":"Trier par ordre décroissant","it-IT":"Ordinamento decrescente","ja-JP":"降順でソート","ko-KR":"내림차순으로 정렬","nl-NL":"Aflopend sorteren","pl-PL":"Sortuj malejąco","pt-BR":"Classificar em ordem decrescente","ru-RU":"Сортировка по убыванию","sv-SE":"Sortera fallande","tr-TR":"Azalan sıralama","zh-CN":"降序排序","zh-TW":"以遞減方式排序"}},NebulaTableUtils_Pagination_DisplayedRowsLabel:{id:"NebulaTableUtils.Pagination.DisplayedRowsLabel",locale:{"de-DE":"{0} von {1}","en-US":"{0} of {1}","es-ES":"{0} de {1}","fr-FR":"{0} sur {1}","it-IT":"{0} di {1}","ja-JP":"{0} / {1}","ko-KR":"{0}/{1}","nl-NL":"{0} van {1}","pl-PL":"{0} z {1}","pt-BR":"{0} de {1}","ru-RU":"{0} из {1}","sv-SE":"{0} av {1}","tr-TR":"{0} / {1}","zh-CN":"{0} / {1}","zh-TW":"{0} / {1}"}},NebulaTableUtils_Pagination_FirstPage:{id:"NebulaTableUtils.Pagination.FirstPage",locale:{"de-DE":"Zur ersten Seite","en-US":"Go to the first page","es-ES":"Ir a la primera página","fr-FR":"Accéder à la première page","it-IT":"Vai alla prima pagina","ja-JP":"最初のページに移動","ko-KR":"첫 페이지로 이동","nl-NL":"Ga naar de eerste pagina","pl-PL":"Przejdź do pierwszej strony","pt-BR":"Ir para a primeira página","ru-RU":"Перейти к первой странице","sv-SE":"Gå till första sidan","tr-TR":"İlk sayfaya git","zh-CN":"转到第一页","zh-TW":"移至第一頁"}},NebulaTableUtils_Pagination_LastPage:{id:"NebulaTableUtils.Pagination.LastPage",locale:{"de-DE":"Zur letzten Seite","en-US":"Go to the last page","es-ES":"Ir a la última página","fr-FR":"Accéder à la dernière page","it-IT":"Vai all'ultima pagina","ja-JP":"最後のページに移動","ko-KR":"마지막 페이지로 이동","nl-NL":"Ga naar de laatste pagina","pl-PL":"Przejdź do ostatniej strony","pt-BR":"Ir para a última página","ru-RU":"Перейти к последней странице","sv-SE":"Gå till sista sidan","tr-TR":"Son sayfaya git","zh-CN":"转到最后一页","zh-TW":"移至最後一頁"}},NebulaTableUtils_Pagination_NextPage:{id:"NebulaTableUtils.Pagination.NextPage",locale:{"de-DE":"Zur nächsten Seite","en-US":"Go to the next page","es-ES":"Ir a la página siguiente","fr-FR":"Accéder à la page suivante","it-IT":"Vai alla pagina successiva","ja-JP":"次のページに移動","ko-KR":"다음 페이지로 이동","nl-NL":"Ga naar de volgende pagina","pl-PL":"Przejdź do następnej strony","pt-BR":"Ir para a próxima página","ru-RU":"Перейти к следующей странице","sv-SE":"Gå till nästa sida","tr-TR":"Sonraki sayfaya git","zh-CN":"转到下一页","zh-TW":"移至下一頁"}},NebulaTableUtils_Pagination_PreviousPage:{id:"NebulaTableUtils.Pagination.PreviousPage",locale:{"de-DE":"Zur vorherigen Seite","en-US":"Go to the previous page","es-ES":"Ir a la página anterior","fr-FR":"Accéder à la page précédente","it-IT":"Vai alla pagina precedente","ja-JP":"前のページに移動","ko-KR":"이전 페이지로 이동","nl-NL":"Ga naar de vorige pagina","pl-PL":"Przejdź do poprzedniej strony","pt-BR":"Ir para a página anterior","ru-RU":"Перейти к предыдущей странице","sv-SE":"Gå till föregående sida","tr-TR":"Önceki sayfaya git","zh-CN":"转到前一页","zh-TW":"移至上一頁"}},NebulaTableUtils_Pagination_RowsPerPage:{id:"NebulaTableUtils.Pagination.RowsPerPage",locale:{"de-DE":"Zeilen pro Seite","en-US":"Rows per page","es-ES":"Filas por página","fr-FR":"Lignes par page","it-IT":"Righe per pagina","ja-JP":"ページあたりの行数","ko-KR":"페이지별 행 수","nl-NL":"Rijen per pagina","pl-PL":"Wierszy na stronę","pt-BR":"Linhas por página","ru-RU":"Строк на странице","sv-SE":"Rader per sida","tr-TR":"Sayfa başına satır sayısı","zh-CN":"每页行数","zh-TW":"每頁列數"}},NebulaTableUtils_Pagination_SelectPage:{id:"NebulaTableUtils.Pagination.SelectPage",locale:{"de-DE":"Seite auswählen","en-US":"Select page","es-ES":"Seleccionar página","fr-FR":"Sélectionner une page","it-IT":"Seleziona pagina","ja-JP":"ページを選択","ko-KR":"페이지 선택","nl-NL":"Pagina selecteren","pl-PL":"Wybierz stronę","pt-BR":"Selecionar página","ru-RU":"Выберите страницу","sv-SE":"Välj sida","tr-TR":"Sayfa seç","zh-CN":"选择页面","zh-TW":"選取頁面"}}};const wz=({translator:e})=>(f((()=>{!function(e){if(e&&e.get&&e.add){const t="NebulaTableUtils.MenuGroupLabel.Sorting";if(e.get(t)!==t)return;Object.keys(xz).forEach((t=>{e.add(xz[t])}))}}(e)}),[e]),e),Sz={width:"100%",height:"100%",color:"transparent",background:"transparent",borderColor:"transparent"},Cz={border:0,boxShadow:"none",borderRadius:0,outline:0,width:0,height:0,background:"transparent",cursor:"pointer",visibility:"hidden"},Mz=ll("input",{shouldForwardProp:e=>"isLastColumn"!==e&&"hoverColor"!==e})((({isLastColumn:e,hoverColor:t,dir:n})=>({position:"absolute",display:"flex",height:"100%",top:0,marginLeft:"-4px",marginRight:"rtl"===n?"-4px":void 0,touchAction:"none",cursor:"col-resize",pointerEvents:"auto",width:(e?4:9)+"px",justifyContent:e?"flex-end":"center",outline:"none",appearance:"none",WebkitAppearance:"none",backgroundColor:"transparent","&::-webkit-slider-runnable-track":{...Sz},"&::-moz-range-track":{...Sz},"&::-ms-track":{...Sz},"&::-webkit-slider-thumb":{appearance:"none",WebkitAppearance:"none",...Cz},"&::-moz-range-thumb":{...Cz},"&::-ms-thumb":{...Cz},"&:hover:not(:focus, :active)":{"&::after":{backgroundColor:t||"#D9D9D9","@media (hover: none)":{backgroundColor:"none"}}},"&:focus-visible, &:active":{"&::after":{backgroundColor:"#177fe6",borderLeft:"1px solid #fff",borderRight:e?void 0:"1px solid #fff"}},"&::after":{content:'""',height:"100%",width:"3px",position:"absolute"}}))),kz=({columnWidth:e,keyValue:t,isLastColumn:n,isPivot:r,hoverColor:i,updateWidthCallback:o,confirmWidthCallback:s,handleBlur:l,setIsAdjustingWidth:c,isLeftColumn:u,accessibilityRelatedArgs:d,direction:h="ltr"})=>{const p=wz({translator:d.translator}),f=a({initWidth:e,columnWidth:e,initX:0}),m=n?0:1,g=r&&!u,y=()=>g?f.current.columnWidth-m:"100%",v={left:"rtl"!==h?y():void 0,right:"rtl"===h?y():void 0},b=t=>{f.current={initWidth:e,columnWidth:e,initX:t??f.current.initX}};bz((()=>{g&&b()}),[e]);const x=e=>{const t=Math.max(e,_T.PixelsMin);f.current.columnWidth=t,o(t)},w=()=>{if(f.current.columnWidth!==f.current.initWidth){const e={type:RT.Pixels,pixels:f.current.columnWidth};s(e)}else c?.(!1)},S=e=>{const t="rtl"===h?f.current.initWidth+f.current.initX-e.clientX:f.current.initWidth+e.clientX-f.current.initX;x(t)},C=e=>{Mj(e),document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",C),w()},M=e=>{const t="rtl"===h?f.current.initWidth+-f.current.initX-e.touches[0].clientX:f.current.initWidth+e.touches[0].clientX-f.current.initX;x(t)},k=e=>{Mj(e),document.removeEventListener("touchmove",M),document.removeEventListener("touchend",k),w()},E=!r&&l?e=>{if(e.key===kT.Left||e.key===kT.Right){Mj(e);const t=5,n=e.key===kT.Left?t:-t,r="rtl"===h?n:-n;c?.(!0),x(f.current.columnWidth+r)}else e.key===kT.Space||e.key===kT.Enter?(Mj(e),l(e),c?.(!1),w()):e.key===kT.Esc&&(Mj(e),l(e),c?.(!1),x(f.current.initWidth))}:void 0,_=p.get("NebulaTableUtils.ColumnAdjuster.ColumnNameLabel",[String(d.columnLabel)]);return Ji.jsx(Mz,{style:v,hoverColor:i,isLastColumn:n,className:ET,"data-testid":ET,onMouseDown:e=>{Mj(e),document.addEventListener("mousemove",S),document.addEventListener("mouseup",C),c?.(!0),b(e.clientX)},onDoubleClick:()=>{s({type:RT.FitToContent})},onTouchStart:e=>{1===e.touches.length&&(Mj(e),document.addEventListener("touchmove",M),document.addEventListener("touchend",k),c?.(!0),b(e.touches[0].clientX))},onKeyDown:E,onBlur:l,onFocus:()=>{b()},type:"range",tabIndex:-1,"aria-label":_,"aria-valuemin":_T.PixelsMin,"aria-valuemax":_T.PixelsMax,"aria-valuenow":Number(e.toFixed(1)),dir:h},t)},Ez=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M15 4H1V2h14zm0 10H1v-2h14zm0-5H1V7h14z"})}))),_z=ll(Yc,{shouldForwardProp:e=>"rightAligned"!==e&&"shouldShowMenuIcon"!==e&&"isAccessibleHeader"!==e})((({rightAligned:e,shouldShowMenuIcon:t,isAccessibleHeader:n})=>({...e?{marginRight:"auto"}:{marginLeft:"auto"},height:n?24:void 0,display:t?"flex":"none",fontWeight:"bold",width:n?"100%":void 0,alignItems:"center",justifyContent:"center"}))),Rz=ll(Ez,{shouldForwardProp:e=>"isInteractionsActive"!==e})((({isInteractionsActive:e})=>({minWidth:"unset",position:"relative",cursor:e?"pointer":"default"}))),Iz=ll(ch)((({theme:e})=>({".MuiList-root":{padding:e.spacing(.5,0)}}))),Dz=ll($u)((({theme:e})=>({"&.MuiDivider-root":{margin:e.spacing(.5)}}))),Az=ll(fh)((({theme:e})=>({fontSize:"12px",height:24,fontWeight:"bold",padding:`${e.spacing(.25,2)} !important`,marginBottom:e.spacing(.5)}))),Pz=ll(fh,{shouldForwardProp:e=>"isSubMenu"!==e&&"isActive"!==e})((({theme:e,isSubMenu:t,isActive:n})=>({width:`calc(220px - ${e.spacing(1)} - ${t?10:0}px)`,maxHeight:32,borderRadius:`${e.spacing(.5)} !important`,margin:`${e.spacing(.25,.5)} !important`,padding:`${e.spacing(1,1.5)} !important`,display:"flex !important",justifyContent:"space-between !important","&&:focus":{boxShadow:"rgb(23, 127, 230) 0px 0px 0px 2px"},position:"relative !important",overflow:"hidden",boxSizing:"border-box !important",background:n?"rgba(0, 0, 0, 0.05)":"transparent"}))),Oz=ll("div",{shouldForwardProp:e=>!["direction","isPagination"].includes(e)})((({theme:e,direction:t,isPagination:n})=>({position:"absolute",width:e.spacing(.5),height:16,left:0,right:n||"rtl"!==t?void 0:0,top:"50%",transform:"TranslateY(-50%)",borderRadius:"0 2px 2px 0",background:"#01873d"}))),Tz=ll("div")((()=>({display:"flex",justifyContent:"space-between",alignItems:"center",maxWidth:"100%"}))),Lz=ll(uc)((()=>({fontFamily:'"Source Sans Pro", HelveticaNeue, "Helvetica Neue", Helvetica, Arial, sans-serif',fontSize:"14px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"}))),qz=ll(qd,{shouldForwardProp:e=>!["direction","isPagination"].includes(e)})((({theme:e,direction:t,isPagination:n})=>({width:16,minWidth:"unset !important",marginRight:n||"rtl"!==t?e.spacing(1.5):0,marginLeft:n||"rtl"!==t?void 0:e.spacing(1.5),lineHeight:0}))),Nz=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M8.5 8 4 3.5 5.5 2l6 6-6 6L4 12.5z"})}))),jz=e=>{const t=e.nextElementSibling;return t?"HR"===t.tagName?jz(t):t:e.parentElement?.children?.[0]},zz=e=>{const t=e.previousElementSibling;if(!t){const t=e.parentElement?.children?.length;return e.parentElement?.children?.[t-1]}return"HR"===t.tagName?zz(t):t},Fz=e=>{const{key:t,currentTarget:n}=e,r=document.activeElement??n;if(t===kT.Down||t===kT.Up){const n=e=>t===kT.Down?jz(e):zz(e);e.preventDefault(),e.stopPropagation();let i=n(r);for(;i;){if("true"!==i.ariaDisabled){i.focus();break}i=n(i)}}},Wz=(e,t)=>e.map((e=>e.map((e=>({...e.groupHeading?{groupHeading:e.groupHeading}:{},items:e.items.map((({onClick:e,...n})=>({...n,...e?{onClick:async n=>{Object.entries(t).forEach((([,e])=>{e(!1)})),await e(n)}}:{}})))})))));let $z={};const Bz=({autoFocus:e,id:n,onClick:r,itemTitle:i,icon:o,enabled:a,subMenus:s,isSubMenu:l,isActive:c,direction:u,isPagination:d})=>{const[p,f]=m(!1),g=t.useRef(null),y=h((e=>{e.stopPropagation(),f(!1)}),[f]);return Ji.jsxs(Ji.Fragment,{children:[Ji.jsxs(Pz,{ref:s?g:null,"data-testid":`menu-item-${n}`,className:"nebula-table-utils-head-menu-item",onClick:async e=>{"keyup"!==e.type&&(r&&(await r(e),$z={}),s?.length&&(f(!0),$z[i]=f,e.stopPropagation()))},disabled:!a,autoFocus:e,isSubMenu:!!l,isActive:!!c,onKeyDown:Fz,children:[c?Ji.jsx(Oz,{direction:u,isPagination:d}):null,Ji.jsxs(Tz,{children:[Ji.jsx(qz,{direction:u,isPagination:d,children:Ji.jsx(o,{})}),Ji.jsx(Lz,{variant:"body2",children:i})]}),s?.length?Ji.jsx(Nz,{}):null]},n),s?.length?Ji.jsx(Uz,{isSubMenu:!0,open:p,anchorEl:g.current,onClose:y,menuGroups:Wz(s,$z),transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"top"},direction:u,isPagination:d}):null]})},Hz=({menuGroup:e,isSubMenu:t,direction:n,isPagination:r})=>e.map((e=>[[e.groupHeading&&Ji.jsx(Az,{disabled:!0,style:{opacity:1},children:e.groupHeading},e.groupHeading),e.items.map((e=>Ji.jsx(Bz,{...e,isSubMenu:t,direction:n,isPagination:r},e.id)))].filter(Boolean)])),Vz=({itemGroups:e,isSubMenu:t,direction:n,isPagination:r})=>e.map(((i,o)=>[Hz({menuGroup:i,isSubMenu:t,direction:n,isPagination:r}),o<e.length-1?Ji.jsx(Dz,{"data-testid":"group-divider",variant:"middle"}):void 0])),Gz={appear:0,enter:0,exit:0},Uz=({anchorEl:e,open:t,onClose:n,menuGroups:r,transformOrigin:i,anchorOrigin:o,isSubMenu:a,direction:s,isPagination:l})=>r.length?Ji.jsx(Iz,{className:"nebula-table-utils-head-menu",open:t,anchorEl:e,onClose:n,transitionDuration:Gz,MenuListProps:{id:"nebula-table-utils-head-menu-list-id"},...o?{anchorOrigin:o}:{},...i?{transformOrigin:i}:{},dir:s,children:Vz({itemGroups:r,isSubMenu:a,direction:s,isPagination:l})}):null,Yz=(e,t)=>e.some((e=>t[e]>0)),Kz={canSelectAll:!1,canClearSelections:!1,canSelectPossible:!1,canSelectAlternative:!1,canSelectExcluded:!1},Xz=({open:e,qStateName:t="$",headerData:n,app:r})=>{const[i,o]=m(null),[a,s]=m(Kz);return bz((()=>{e||(s(Kz),o(null))}),[e]),c((()=>{if(!r?.createSessionObject||!n.isDim||!e)return()=>{};let i,a=!1;const l=()=>{i&&r.destroySessionObject(i)};return(async()=>{try{const e=((e,t)=>({qInfo:{qType:"tableListbox"},qListObjectDef:Boolean(t.qLibraryId)?{qLibraryId:t.qLibraryId,qStateName:e}:{qDef:{qFieldDefs:[t.fieldId]},qStateName:e}}))(t,n),c=await r.createSessionObject(e),u=await c.getLayout(),{qStateCounts:d}=u.qListObject?.qDimensionInfo??{};i=u.qInfo?.qId,a?l():(o(c),d&&s((e=>({canSelectAll:Yz(["qOption","qAlternative","qExcluded","qDeselected"],e),canClearSelections:Yz(["qSelected"],e),canSelectPossible:Yz(["qOption"],e),canSelectAlternative:Yz(["qAlternative"],e),canSelectExcluded:Yz(["qAlternative","qExcluded"],e)}))(d)))}catch(e){console.error(e)}})(),()=>{a=!0,l()}}),[e,r,n,t]),{fieldInstance:i,selectionActionsEnabledStatus:a}},Jz=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M3.5 1.793 6.207 4.5l-.707.707-1.5-1.5V14H3V3.707l-1.5 1.5L.793 4.5zM8 4h5v1H8zm0 3h6v1H8zm0 3h7v1H8z"})}))),Zz=v(((e,t)=>Ji.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 16 16",height:"16px",role:"img",ref:t,...e,children:[Ji.jsx("g",{clipPath:"url(#clear_selections_svg__clip0_482_2951)",children:Ji.jsx("path",{d:"M1 14.5a.5.5 0 0 0 .5.5H3v1H1.5A1.5 1.5 0 0 1 0 14.5V13h1zm9 1.5H6v-1h4zm5.354-8.646L12.707 10l2.646 2.646-.707.707L12 10.708l-2.646 2.646-.708-.707L11.293 10 8.646 7.354l.708-.708L12 9.293l2.646-2.647zM1 10H0V6h1zm2-9H1.5a.5.5 0 0 0-.5.5V3H0V1.5A1.5 1.5 0 0 1 1.5 0H3zm11.5-1A1.5 1.5 0 0 1 16 1.5V3h-1V1.5a.5.5 0 0 0-.5-.5H13V0zM10 1H6V0h4z"})}),Ji.jsx("defs",{children:Ji.jsx("clipPath",{id:"clear_selections_svg__clip0_482_2951",children:Ji.jsx("path",{d:"M0 0h16v16H0z"})})})]}))),Qz=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M3.914 8h8.207L10.5 6.379l.707-.708L14.036 8.5l-2.829 2.828-.707-.707L12.12 9H3.914l1.621 1.621-.707.707L2 8.5l2.828-2.828.707.707zM15 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zm0 13V2h-2v3h-1V2H4v3H3V2H1v12h2v-2h1v2h8v-2h1v2z"})}))),eF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M3 2h1v10.293l1.5-1.5.707.707L3.5 14.207.793 11.5l.707-.707 1.5 1.5zm12 2H8v1h7zM8 7h6v1H8zm5 3H8v1h5z"})}))),tF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M8 15c-3.848 0-7-3.152-7-7s3.152-7 7-7 7 3.152 7 7-3.152 7-7 7m0 1c4.4 0 8-3.6 8-8s-3.6-8-8-8-8 3.6-8 8 3.6 8 8 8m4-7.5H4v-1h8z"})}))),nF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M8 15c-3.848 0-7-3.152-7-7s3.152-7 7-7 7 3.152 7 7-3.152 7-7 7m0 1c4.4 0 8-3.6 8-8s-3.6-8-8-8-8 3.6-8 8 3.6 8 8 8m4-7.5H4v-1h8zM8.5 4v8h-1V4z"})}))),rF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M1 8a7 7 0 1 1 10 6.326V11h-1v5h5v-1h-3.124A8 8 0 1 0 8 16v-1a7 7 0 0 1-7-7"})}))),iF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M9.057 11.164a6 6 0 1 1 2.112-2.116 1 1 0 0 1 .052.044l4.176 4.08a1 1 0 0 1 .009 1.422l-.707.707a1 1 0 0 1-1.406.008l-4.185-4.087a1 1 0 0 1-.05-.058ZM10.5 6a4.5 4.5 0 1 0-9 0 4.5 4.5 0 0 0 9 0"})}))),oF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M3 4v1H1v10h10v-2h1v2a1 1 0 0 1-.883.993L11 16H1a1 1 0 0 1-.993-.883L0 15V5a1 1 0 0 1 .883-.993L1 4zm12-4a1 1 0 0 1 .993.883L16 1v10a1 1 0 0 1-.883.993L15 12H5a1 1 0 0 1-.993-.883L4 11V1a1 1 0 0 1 .883-.993L5 0zm0 1H5v10h10zm-2.36 2.653.72.694L9.143 8.72 6.64 6.125l.72-.694L9.143 7.28z"})}))),aF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M6 15.5a.5.5 0 0 1 .5-.5h3a.5.5 0 1 1 0 1h-3a.5.5 0 0 1-.5-.5m-5-2v1a.5.5 0 0 0 .5.5h1a.5.5 0 1 1 0 1H1a1 1 0 0 1-1-1v-1.5a.5.5 0 1 1 1 0m14 0a.5.5 0 1 1 1 0V15a1 1 0 0 1-1 1h-1.5a.5.5 0 1 1 0-1h1a.5.5 0 0 0 .5-.5zm-14-7v3a.5.5 0 0 1-1 0v-3a.5.5 0 0 1 1 0m15 0v3a.5.5 0 1 1-1 0v-3a.5.5 0 1 1 1 0m-16-4V1a1 1 0 0 1 1-1h1.5a.5.5 0 0 1 0 1h-1a.5.5 0 0 0-.5.5v1a.5.5 0 0 1-1 0m6-2a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3A.5.5 0 0 1 6 .5m9 2v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 1 1 0-1H15a1 1 0 0 1 1 1v1.5a.5.5 0 1 1-1 0M4 4v8l8-8zm0-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1"})}))),sF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M6 15.5a.5.5 0 0 1 .5-.5h3a.5.5 0 1 1 0 1h-3a.5.5 0 0 1-.5-.5m-5-2v1a.5.5 0 0 0 .5.5h1a.5.5 0 1 1 0 1H1a1 1 0 0 1-1-1v-1.5a.5.5 0 1 1 1 0m14 0a.5.5 0 1 1 1 0V15a1 1 0 0 1-1 1h-1.5a.5.5 0 1 1 0-1h1a.5.5 0 0 0 .5-.5zm-14-7v3a.5.5 0 0 1-1 0v-3a.5.5 0 0 1 1 0m15 0v3a.5.5 0 1 1-1 0v-3a.5.5 0 1 1 1 0m-16-4V1a1 1 0 0 1 1-1h1.5a.5.5 0 0 1 0 1h-1a.5.5 0 0 0-.5.5v1a.5.5 0 0 1-1 0m6-2a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3A.5.5 0 0 1 6 .5m9 2v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 1 1 0-1H15a1 1 0 0 1 1 1v1.5a.5.5 0 1 1-1 0M4 3h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1"})}))),lF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M6 15.5a.5.5 0 0 1 .5-.5h3a.5.5 0 1 1 0 1h-3a.5.5 0 0 1-.5-.5m-5-2v1a.5.5 0 0 0 .5.5h1a.5.5 0 1 1 0 1H1a1 1 0 0 1-1-1v-1.5a.5.5 0 1 1 1 0m14 0a.5.5 0 1 1 1 0V15a1 1 0 0 1-1 1h-1.5a.5.5 0 1 1 0-1h1a.5.5 0 0 0 .5-.5zm-14-7v3a.5.5 0 0 1-1 0v-3a.5.5 0 0 1 1 0m15 0v3a.5.5 0 1 1-1 0v-3a.5.5 0 1 1 1 0m-16-4V1a1 1 0 0 1 1-1h1.5a.5.5 0 0 1 0 1h-1a.5.5 0 0 0-.5.5v1a.5.5 0 0 1-1 0m6-2a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3A.5.5 0 0 1 6 .5m9 2v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 1 1 0-1H15a1 1 0 0 1 1 1v1.5a.5.5 0 1 1-1 0M4 4v8h8V4zm0-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1"})}))),cF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M1 1.5a.5.5 0 0 1 .5-.5H3V0H1.5A1.5 1.5 0 0 0 0 1.5V3h1zM14.5 1a.5.5 0 0 1 .5.5V3h1V1.5A1.5 1.5 0 0 0 14.5 0H13v1zM1 14.5a.5.5 0 0 0 .5.5H3v1H1.5A1.5 1.5 0 0 1 0 14.5V13h1zm14 0a.5.5 0 0 1-.5.5H13v1h1.5a1.5 1.5 0 0 0 1.5-1.5V13h-1zM6 0h4v1H6zM0 6h1v4H0zm15 0h1v4h-1zm-9 9h4v1H6z"})})));let uF=function(e){return e.Sorting="sorting",e.Searching="searching",e.Selections="selections",e.AdjusterHeaderSize="adjustHeaderSize",e}({});const dF="/qListObjectDef",hF=({headerData:e,translator:t,menuAvailabilityFlags:n,setOpen:r,sortFromMenu:i,interactions:o,embedListbox:a,fieldInstance:s,selectionActionsEnabledStatus:l,anchorRef:c,focusColumnAdjuster:u,setActiveFieldCallback:d,expandOrCollapseArgs:h})=>{const p=[];if(n[uF.Sorting]){const{isActivelySorted:n,sortDirection:o}=e,{ascendingEnabled:a,descendingEnabled:s}=(({isActivelySorted:e,sortDirection:t,isPivot:n,isSortedByFirstMeasure:r})=>{let i=!n&&!e||"D"===t,o=!n&&!e||"A"===t;return r&&(i=!1,o=!1),{ascendingEnabled:i,descendingEnabled:o}})(e);p.push([{groupHeading:t.get("NebulaTableUtils.MenuGroupLabel.Sorting"),items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SortAscending"),onClick:async e=>{e.stopPropagation(),await(i?.(e,"A")),r(!1)},icon:Jz,enabled:a,isActive:!!n&&"A"===o,autoFocus:a},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SortDescending"),onClick:async e=>{e.stopPropagation(),await(i?.(e,"D")),r(!1)},icon:eF,enabled:s,isActive:!!n&&"D"===o,autoFocus:!a&&s}]}])}if(e.isCyclic&&d){const t=[];t.push([{items:[{id:1,itemTitle:e.groupDimensionLabels[e.groupDimensionPos],enabled:!0,icon:rF,subMenus:[[{items:e.groupDimensionLabels.map(((t,n)=>({id:n+1,itemTitle:t,onClick:async e=>{e.stopPropagation(),r(!1),d(n)},enabled:!0,icon:dL,isActive:e.groupDimensionPos===n})))}]]}]}]),t.length>0&&p.push(...t)}if(e.isDim&&o?.select){const i=[];n[uF.Searching]&&i.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Search"),onClick:e=>{e.stopPropagation(),r(!1),a()},icon:iF,enabled:!0}]}]),!e.isLocked&&n[uF.Selections]&&i.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Selections"),icon:cF,enabled:!!s,subMenus:[[{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectAll"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectAll(dF))},icon:oF,enabled:l.canSelectAll},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectPossible"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectPossible(dF))},icon:lF,enabled:l.canSelectPossible},{id:3,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectAlternative"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectAlternative(dF))},icon:aF,enabled:l.canSelectAlternative},{id:4,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectExcluded"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectExcluded(dF))},icon:sF,enabled:l.canSelectExcluded}]}],[{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.ClearSelections"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.clearSelections(dF))},icon:Zz,enabled:l.canClearSelections}]}]]}]}]),h&&!h.alwaysFullyExpanded&&p.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Expand"),onClick:async e=>{e.stopPropagation(),e.preventDefault(),r(!1),await h.expandCallback()},icon:nF,enabled:!0},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Collapse"),onClick:async e=>{e.stopPropagation(),e.preventDefault(),r(!1),await h.collapseCallback()},icon:tF,enabled:!0}]}]),i.length>0&&p.push(...i)}return n[uF.AdjusterHeaderSize]&&p.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.AdjustColumnSize"),onClick:e=>{e.stopPropagation(),e.preventDefault(),r(!1),u?.(c)},icon:Qz,enabled:!0}]}]),p},pF=({open:e,setOpen:t,anchorRef:n,headerData:r,translator:i,interactions:o,menuAvailabilityFlags:s,shouldShowMenuIcon:l=!0,sortRelatedArgs:c,searchRelatedArgs:u,selectionRelatedArgs:d,adjustHeaderSizeRelatedArgs:p,expandOrCollapseArgs:f,model:m,direction:g="ltr",isPagination:y,isAccessibleHeader:v,iconSize:b=wT})=>{const x=a(null),w=wz({translator:i}),{qLibraryId:S,fieldId:C,headTextAlign:M}=r,k=d?.app,{fieldInstance:E,selectionActionsEnabledStatus:_}=Xz({open:e,headerData:r,app:k,qStateName:d?.qStateName}),R=(({model:e,headerData:t})=>{if(e&&"setActiveField"in e&&void 0!==t.dimensionInfoIndex){const n=t.dimensionInfoIndex;return async t=>{try{await e.setActiveField("/qHyperCubeDef",n,t)}catch(e){console.error(e)}}}return null})({model:m,headerData:r}),I=(({qLibraryId:e,fieldId:t,searchRelatedArgs:n,selectionRelatedArgs:r,direction:i,onPopoverClose:o})=>h((()=>{const a=e?{qLibraryId:e,type:"dimension"}:t;if(n?.embed){const{embed:e,listboxRef:t}=n;e.__DO_NOT_USE__.popover(t.current,a,{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"rtl"===i?"right":"left"},sortCriteria:n.sortCriteria,stateName:r?.qStateName,direction:i,onPopoverClose:o})}}),[e,t,n,r?.qStateName,i,o]))({qLibraryId:S,fieldId:C,searchRelatedArgs:u,selectionRelatedArgs:d,direction:g}),D=h((e=>{e.stopPropagation(),t(!1)}),[t]),A=h((e=>{e.stopPropagation(),t((e=>!e))}),[t]);return o.active?Ji.jsxs(_z,{rightAligned:"right"===M,shouldShowMenuIcon:l,className:"nebula-table-utils-head-menu-wrapper",onClick:!1===v?A:void 0,ref:x,isAccessibleHeader:v,children:[l?Ji.jsx(Rz,{height:b,className:ST,"data-testid":ST,isInteractionsActive:o.active??!1,children:Ji.jsx(Ez,{})}):null,Ji.jsx(Uz,{open:e,anchorEl:!1===v?x.current:n.current,onClose:D,menuGroups:hF({headerData:r,translator:w,menuAvailabilityFlags:s,setOpen:t,...c,embedListbox:I,interactions:o,fieldInstance:E,selectionActionsEnabledStatus:_,anchorRef:n,focusColumnAdjuster:p?.focusColumnAdjuster,setActiveFieldCallback:R,expandOrCollapseArgs:f}),direction:g,isPagination:y})]}):null},fF=e=>e.isDark?{background:e.color,borderColor:bj.DARK_MODE_BORDER,color:bj.DARK_MODE_TEXT,disabledColor:bj.DARK_MODE_DISABLED,iconColor:bj.DARK_MODE_TEXT}:{background:e.color,borderColor:bj.BORDER_MEDIUM,color:bj.TEXT,disabledColor:bj.DISABLED},mF=ll(Yc,{shouldForwardProp:e=>"footerStyle"!==e})((({footerStyle:e,theme:t})=>({height:40,display:"flex",justifyContent:"flex-end",alignItems:"center",padding:t.spacing(0,1,0,1),color:e.color,background:e.background,borderTop:`1px solid ${e.borderColor}`}))),gF=ll(Yh,{shouldForwardProp:e=>"footerStyle"!==e})((({footerStyle:e,theme:t})=>({background:"inherit",marginRight:t.spacing(1),color:e.color,"& .MuiNativeSelect-icon, .MuiNativeSelect-select":{color:e.iconColor}}))),yF=ll(iu,{shouldForwardProp:e=>"disabledCondition"!==e&&"footerStyle"!==e})((({disabledCondition:e,footerStyle:t,theme:n})=>({color:e?t.disabledColor:t.color,cursor:e?"default":"pointer",marginLeft:n.spacing(1)}))),vF=ll(uc)((({theme:e})=>({color:"inherit",margin:e.spacing(0,1,0,1)}))),bF=({children:e,footerContainer:t,interactions:n,theme:r,paginationNeeded:i=!0})=>{const o=f((()=>fF(r.background)),[r]);if(!n.active)return null;const a=i?Ji.jsx(mF,{footerStyle:o,children:e}):null;return t?C.createPortal(e,t):a},xF=s({}),wF=()=>d(xF),SF=({children:e,direction:t,pageInfo:n,handleChangeRowsPerPage:r,footerContainer:i,isSelectionMode:o,handleChangePage:a,totalRowCount:s,totalColumnCount:l,totalPages:c,keyboard:u,translator:d,theme:h,interactions:p,rect:m,layout:g,visibilityThreshold:y})=>{const v=(e=>!e.enabled||e.active)(u)?0:-1,b=f((()=>fF(h.background)),[h]),x=i?i.getBoundingClientRect().width:m.width,w=wz({translator:d}),S=f((()=>({direction:t,pageInfo:n,handleChangeRowsPerPage:r,footerContainer:i,isSelectionMode:o,handleChangePage:a,totalRowCount:s,totalColumnCount:l,totalPages:c,keyboard:u,translator:w,theme:h,interactions:p,rect:m,layout:g,footerStyle:b,tabIndex:v,width:x,visibilityThreshold:y})),[t,n,r,i,o,a,s,l,c,u,w,h,p,m,g,b,v,x,y]);return Ji.jsx(xF.Provider,{value:S,children:e})};let CF=function(e){return e.FirstPage="FirstPage",e.LastPage="LastPage",e.NextPage="NextPage",e.PreviousPage="PreviousPage",e}({}),MF=function(e){return e[e.DisplayedRowsLabel=250]="DisplayedRowsLabel",e[e.FirstPage=350]="FirstPage",e[e.LastPage=350]="LastPage",e[e.RowsPerPage=550]="RowsPerPage",e[e.SelectPage=700]="SelectPage",e}({});const kF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"m7 8 4.5 4.5L10 14 4 8l6-6 1.5 1.5z"})}))),EF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"m12 2 1.5 1.5L9 8l4.5 4.5L12 14 6 8zM4 2v12H2V2z"})}))),_F=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"m3.5 2 6 6-6 6L2 12.5 6.5 8 2 3.5zM14 2v12h-2V2z"})}))),RF={FirstPage:EF,PreviousPage:kF,NextPage:Nz,LastPage:_F,FirstPageRTL:_F,PreviousPageRTL:Nz,NextPageRTL:kF,LastPageRTL:EF},IF=({disabledCondition:e,pageNumber:t,type:n})=>{const{direction:r,footerStyle:i,handleChangePage:o,translator:a,interactions:s,tabIndex:l}=wF(),c=n.concat("rtl"===r?"RTL":""),u=RF[c];return{styledProps:{footerStyle:i,disabledCondition:e,size:"small","data-testid":"pagination-action-icon-button","aria-disabled":e,"aria-label":a.get(`NebulaTableUtils.Pagination.${n}`),title:s.passive?a.get(`NebulaTableUtils.Pagination.${n}`):void 0,tabIndex:l,onClick:e?void 0:()=>{o(t)}},IconComponent:u}},DF=()=>{const{pageInfo:e,width:t,interactions:n,visibilityThreshold:r}=wF(),i=0===e.page,{IconComponent:o,styledProps:a}=IF({type:CF.FirstPage,disabledCondition:i,pageNumber:0});return t<=(r?.firstPage||MF.FirstPage)?null:Ji.jsx(yF,{...a,disabled:!n.active,children:Ji.jsx(o,{height:wT})})},AF=(e,t,n=!1)=>{n&&e.key===kT.Tab&&!e.shiftKey&&(Mj(e),((e,t,n)=>{const r=e.closest(".qv-object-wrapper")?.querySelector(".sel-toolbar-confirm")?.parentElement??document.querySelector("#qv-selection-toolbar-popover .sel-toolbar-confirm")?.parentElement;r?r.focus():t.focusSelection?.(n)})(e.target,t,!1))},PF=()=>{const{pageInfo:e,keyboard:t,totalPages:n,isSelectionMode:r,width:i,interactions:o,visibilityThreshold:a}=wF(),s=e.page>=n-1,{IconComponent:l,styledProps:c}=IF({type:CF.LastPage,disabledCondition:s,pageNumber:n-1}),u=t.enabled?e=>{AF(e,t,r)}:void 0;return i<=(a?.lastPage||MF.LastPage)?null:Ji.jsx(yF,{...c,onKeyDown:u,disabled:!o.active,children:Ji.jsx(l,{height:wT})})},OF=()=>{const{pageInfo:e,keyboard:t,totalPages:n,isSelectionMode:r,width:i,interactions:o}=wF(),a=e.page>=n-1,{IconComponent:s,styledProps:l}=IF({type:CF.NextPage,disabledCondition:a,pageNumber:e.page+1}),c=!(i>MF.FirstPage&&i>MF.LastPage)&&t.enabled?e=>{AF(e,t,r)}:void 0;return Ji.jsx(yF,{...l,onKeyDown:c,disabled:!o.active,children:Ji.jsx(s,{height:wT})})},TF=()=>{const{pageInfo:e,interactions:t}=wF(),n=0===e.page,{IconComponent:r,styledProps:i}=IF({type:CF.PreviousPage,disabledCondition:n,pageNumber:e.page-1});return Ji.jsx(yF,{...i,disabled:!t.active,children:Ji.jsx(r,{height:wT})})},LF=()=>{const{translator:e,width:t,pageInfo:n,totalRowCount:r,visibilityThreshold:i}=wF(),{page:o,rowsPerPage:a}=n;if(t<=(i?.displayedRowsLabel||MF.DisplayedRowsLabel))return null;const s=e.get("NebulaTableUtils.Pagination.DisplayedRowsLabel",[`${o*a+1} - ${Math.min((o+1)*a,r)}`,r.toString()]);return Ji.jsx(vF,{variant:"caption",dir:"ltr",children:s})},qF=({name:e,value:t,options:n,handleChange:r})=>{const{layout:i,footerStyle:o,translator:a,tabIndex:s,interactions:l}=wF(),c=i.qInfo.qId,u=a.get(`NebulaTableUtils.Pagination.${e}`),d=`${e}-dropdown`,h=`${d}-label-${c}`,p={tabIndex:s,id:`${d}-${c}`,"data-testid":d,"aria-labelledby":h};return Ji.jsxs(Ji.Fragment,{children:[Ji.jsxs(vF,{variant:"caption",id:h,children:[u,":"]}),Ji.jsx(gF,{footerStyle:o,size:"small",native:!0,value:t,onChange:r,inputProps:p,disabled:!l.active,children:n})]})},NF=()=>{const{pageInfo:e,isSelectionMode:t,totalColumnCount:n,width:r,handleChangeRowsPerPage:i,visibilityThreshold:o}=wF();if(!(!!e.rowsPerPageOptions?.length&&!t&&r>(o?.rowsPerPage||MF.RowsPerPage)&&n<=100)||void 0===e.rowsPerPageOptions)return null;const a=Ji.jsx(Ji.Fragment,{children:e.rowsPerPageOptions.map((e=>Ji.jsx("option",{value:e,children:e},e)))});return Ji.jsx(qF,{name:"RowsPerPage",value:e.rowsPerPage,options:a,handleChange:e=>{i?.(+e.target.value)}})},jF=1e3,zF="…",FF=({totalPages:e,page:t})=>{const n=Math.min(e,jF),r=n<e&&t>500,i=r?Math.min(500+t,e):n,o=r?Math.max(0,i-jF):0,a=Array.from(Array(n).keys()).map((e=>{const t=e+o;return Ji.jsx("option",{value:t,children:t+1},t)}));return o>0&&a.unshift(Ji.jsx("option",{value:zF,disabled:!0,children:zF},"startMoreOptions")),i<e-1&&a.push(Ji.jsx("option",{value:zF,disabled:!0,children:zF},"endMoreOptions")),Ji.jsx(Ji.Fragment,{children:a})},WF=()=>{const{pageInfo:e,width:t,totalPages:n,handleChangePage:r,visibilityThreshold:i}=wF(),{page:o}=e;if(t<=(i?.selectPage||MF.SelectPage))return null;const a=Ji.jsx(FF,{totalPages:n,page:o});return Ji.jsx(qF,{name:"SelectPage",value:o,options:a,handleChange:e=>{r(+e.target.value)}})};var $F=g((e=>Ji.jsxs(SF,{...e,children:[Ji.jsx(NF,{}),Ji.jsx(WF,{}),Ji.jsx(LF,{}),Ji.jsx(DF,{}),Ji.jsx(TF,{}),Ji.jsx(OF,{}),Ji.jsx(PF,{})]})));const BF=e=>Ji.jsx(bF,{...e,children:Ji.jsx($F,{...e})}),HF=s({}),VF=()=>d(HF),GF=({rect:e,pageInfo:t,qPivotDataPages:n,updatePageInfo:r,direction:i,children:o})=>{const a=f((()=>({rect:e,pageInfo:t,qPivotDataPages:n,updatePageInfo:r,direction:i})),[e,t,n,r,i]);return Ji.jsx(HF.Provider,{value:a,children:o})},UF=s({}),YF=()=>d(UF),KF=({app:e,model:t,theme:n,embed:r,keyboard:i,translator:o,interactions:a,env:s,children:l})=>{const c=f((()=>({model:t,app:e,interactions:a,embed:r,theme:n,keyboard:i,env:s,translator:o})),[e,a,t,r,n,i,s,o]);return Ji.jsx(UF.Provider,{value:c,children:l})},XF=s({}),JF=()=>d(XF),ZF=({children:e,...t})=>Ji.jsx(XF.Provider,{value:t,children:e}),QF=()=>{const{text:e,fontFamily:t,fontSize:n,justifyContent:r,alignItems:i,height:o}=(()=>{const{theme:e,translator:t}=YF(),{layoutService:n}=JF(),r=e.getStyle("","","fontFamily")??Tj;return n.hasData?n.hasLimitedData?{text:t.get("SNPivotTable.LimitedData"),fontSize:"13px",fontFamily:r,alignItems:"center",height:"22px"}:{}:{text:t.get("SNPivotTable.NoData"),fontSize:"16px",fontFamily:r,justifyContent:"center",alignItems:"center",height:"100%"}})();return void 0===e?null:Ji.jsx("div",{style:{display:"flex",justifyContent:r,alignItems:i,width:"100%",height:o},children:Ji.jsx("span",{style:{...Bj,fontFamily:t,fontSize:n,fontStyle:"italic",color:"#7b7a78"},children:e})})},eW="/qHyperCubeDef",tW=-1,nW="PSEUDO-DIM",rW=e=>e===tW?nW:(({cId:e})=>e??NL())(e),iW=({layoutService:e,visibleLeftDimensionInfos:t,cell:n,colIdx:r})=>{n&&(n.canBeResized=!0,n.colIdx=n.colIdx||r,n.dimensionInfoIndex===tW?n.columnWidthLocation=oj.Measures:n.isLeftDimension?n.columnWidthLocation=oj.Dimension:t.at(-1)===tW?n.columnWidthLocation=oj.Measures:e.hasPseudoDimOnLeft&&(n.columnWidthLocation=oj.Pivot))},oW=(e,t,n,r)=>{const i=rW(n),o=e.getDimensionInfoIndex(n),a=e.isLeftDimension(o);return n===tW?{id:i,colIdx:-1,label:"",sortDirection:"A",fieldId:"",isLocked:!1,isDim:!1,isCyclic:!1,groupDimensionPos:0,groupDimensionLabels:[],headTextAlign:"left",dimensionInfoIndex:o,canBeResized:!1,isLeftDimension:a,isLastDimension:r,columnWidthLocation:oj.Measures,isPivot:!0,qEffectiveDimensionName:void 0}:{id:i,colIdx:0,label:n.qFallbackTitle,qReverseSort:n.qReverseSort,sortDirection:n.qSortIndicator&&"N"!==n.qSortIndicator?n.qSortIndicator:"A",qLibraryId:n.qLibraryId,fieldId:n.qGroupFieldDefs[n.qGroupPos],isLocked:n.qLocked??!1,columnWidth:n.columnWidth,qApprMaxGlyphCount:n.qApprMaxGlyphCount,isDim:!0,isCyclic:n.qGrouping===AT.Cyclic,groupDimensionPos:n.qGroupPos,groupDimensionLabels:n.qGroupFallbackTitles,headTextAlign:"left",dimensionInfoIndex:o,canBeResized:!1,isLeftDimension:a,isLastDimension:r,columnWidthLocation:oj.Dimension,isPivot:!0,isSortedByFirstMeasure:t.isSortedByFirstMeasure,qEffectiveDimensionName:n.qEffectiveDimensionName}},aW=({layoutService:e,effectivePropertiesService:t,lastRow:n,lastCol:r})=>{let i=r;var o;n.length>0&&(i=(o=r).at(-1)===tW?o.slice(0,-1):o);const a=i.length+(n.length?1:0),s=Math.max(1,n.length),l=((e,t)=>Array(e).fill(null).map((()=>Array.from({length:t},(()=>null)))))(a,s);return n.forEach(((n,r,i)=>{const o=r===i.length-1;l[a-1][r]=oW(e,t,n,o)})),i.forEach(((n,r,i)=>{const o=r===i.length-1;l[r][s-1]=oW(e,t,n,o)})),l},sW=(e,t,n,r)=>{const i=((e,t,n,r)=>{let i;return i=0===n.length||n.includes(tW)?aW({layoutService:e,effectivePropertiesService:t,lastRow:r,lastCol:n}):(e=>e[0].map(((t,n)=>e.map((e=>e[n])))))(aW({layoutService:e,effectivePropertiesService:t,lastRow:n,lastCol:r})),e.isIndentModeEnabled&&i[i.length-1].length>1&&(i[i.length-1]=[i.at(-1),...new Array(i[0]?i[0].length-1:0).fill(null)]),i.length&&i.at(-1)?.forEach(((t,n)=>{Array.isArray(t)?t.forEach(((t,n)=>{iW({layoutService:e,visibleLeftDimensionInfos:r,cell:t,colIdx:n})})):iW({layoutService:e,visibleLeftDimensionInfos:r,cell:t,colIdx:n})})),i})(e,t,n,r);return{data:i,size:{x:i[0]?.length??0,y:i.length}}};var lW={fromSearchString:function(e){if(!e)return[];"?"===e[0]&&(e=e.substr(1));const t=[];return e.split("&").forEach((e=>{if(!e)return;const n=e.indexOf("=");let r,i="",o=!1;-1===n?r=e:(r=e.slice(0,n),i=e.slice(n+1),o=!0),t.push(function(e,t,n){return{key:uW(e),value:uW(t),useEqualSign:n}}(r,i,o))})),t}},cW=lW;function uW(e){try{return decodeURIComponent(e)}catch{return e}}function dW(e){if(!(this instanceof dW))throw new Error("Url needs to be called with the new keyword");if(!e)throw new Error("Url needs a string to operate on");const t=function(e){const t={authorityAndPath:"",search:"",hash:""};let n=e.indexOf("#");-1!==n&&(t.hash=e.substr(n),e=e.substr(0,n));n=e.indexOf("?"),-1!==n&&(t.search=e.substr(n),e=e.substr(0,n));return t.authorityAndPath=e,t}(e);Object.defineProperties(this,{authorityAndPath:{value:t.authorityAndPath},search:{value:t.search},hash:{value:t.hash},searchParams:{get:()=>cW.fromSearchString(t.search)}})}function hW(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";")}dW.encodeAuthorityAndPath=function(e){return encodeURI(e).replace(/%5B/gi,"[").replace(/%5D/gi,"]").replace(/%25/gi,"%")},dW.encodeSearchParams=function(e){let t,n="";for(let r=0;r<e.length;r++)t=e[r],n+=0===r?"?":"&",n+=hW(t.key),t.value?n+=`=${hW(t.value)}`:n+=t.useEqualSign?"=":"";return n};var pW=dW;var fW,mW=class{_hasNext(){return null!=this._input&&(0!==this._input.length&&this._index<this._input.length)}constructor(e){this._input=e,this._pushback=null,this._temp=null,this._index=0,this._mark=0}pushback(e){this._pushback=e}index(){return this._index}hasNext(){return null!=this._pushback||this._hasNext()}next(){if(null!=this._pushback){const e=this._pushback;return this._pushback=null,e}return this._hasNext()?this._input.charAt(this._index++):null}nextHex(){const e=this.next();return null==e?null:e.match(/[0-9A-Fa-f]/)?e:null}peek(e){return e?!(!this._pushback||this._pushback!==e)||!!this._hasNext()&&this._input.charAt(this._index)===e:this._pushback?this._pushback:this._hasNext()?this._input.charAt(this._index):null}mark(){this._temp=this._pushback,this._mark=this._index}reset(){this._pushback=this._temp,this._index=this._mark}remainder(){let e=this._input.substr(this._index);return null!=this._pushback&&(e=this._pushback+e),e}},gW=class{decode(e){let t="";const n=new mW(e);let r;for(;n.hasNext();)r=this.decodeCharacter(n),t+=null!=r?r:n.next();return t}decodeCharacter(e){return e.next()}},yW=e=>e>=0&&e<=1114111,vW=e=>e.match(/[\s]/),bW=class extends gW{decodeCharacter(e){e.mark();const t=e.next();let n,r,i;if(null==t||"\\"!==t)return e.reset(),null;const o=e.next();if(null==o)return e.reset(),null;switch(o){case"\r":e.peek("\n")&&e.next();case"\n":case"\f":case"\0":return this.decodeCharacter(e)}if("NaN"===parseInt(o,16))return o;for(n=o,r=0;r<5&&(i=e.next(),null!=i&&!vW(i));r++){if("NaN"===parseInt(i,16)){e.pushback(i);break}n+=i}const a=parseInt(n,16);return yW(a)?String.fromCharCode(a):"�"}},xW=class e{constructor(e,t){this._key=e,this._value=t}getKey(){return this._key}getValue(){return this._value}equals(t){return t instanceof e&&(this._key===t._key&&this._value===t._value)}static newInstanceIfNeeded(){let t,n,r=arguments[0];return"string"==typeof arguments[1]?(t=arguments[1],n=r.length):(n=arguments[1],t=arguments[2]),t&&r?(r.length>n&&(r=r.substr(0,n)),new e(r,t)):null}},wW=class e{setValue(e){this._nextMap=null,this._value=e}getNextNode(e){return this._nextMap?this._nextMap[e]:null}put(t,n,r){let i,o;if(t.length===n)return o=this._value,this.setValue(r),o;const a=t.charAt(n);return this._nextMap?(i=this._nextMap[a],i||(i=new e,this._nextMap[a]=i)):(this._nextMap={},i=new e,this._nextMap[a]=i),i.put(t,n+1,r)}get(e,t){if(e.length<=t)return this._value;const n=this.getNextNode(e.charAt(t));return n?n.get(e,t+1):null}getLongestMatch(e,t){if(e.length<=t)return xW.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return xW.newInstanceIfNeeded(e,t,this._value);const r=n.getLongestMatch(e,t+1);return r||xW.newInstanceIfNeeded(e,t,this._value)}},SW=class{constructor(){this.clear()}getLongestMatch(e){return this.root&&e?this.root.getLongestMatch(e,0):null}getMaxKeyLength(){return this.maxKeyLen}clear(){this.root=null,this.maxKeyLen=0,this.size=0}put(e,t){this.root||(this.root=new wW);const n=this.root.put(e,0,t);return n||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}},CW=(()=>{const e=[],t=[],n=new SW;let r,i,o;for(r in e["""]="34",e["&"]="38",e["<"]="60",e[">"]="62",e[" "]="160",e["¡"]="161",e["¢"]="162",e["£"]="163",e["¤"]="164",e["¥"]="165",e["¦"]="166",e["§"]="167",e["¨"]="168",e["©"]="169",e["ª"]="170",e["«"]="171",e["¬"]="172",e["­"]="173",e["®"]="174",e["¯"]="175",e["°"]="176",e["±"]="177",e["²"]="178",e["³"]="179",e["´"]="180",e["µ"]="181",e["¶"]="182",e["·"]="183",e["¸"]="184",e["¹"]="185",e["º"]="186",e["»"]="187",e["¼"]="188",e["½"]="189",e["¾"]="190",e["¿"]="191",e["À"]="192",e["Á"]="193",e["Â"]="194",e["Ã"]="195",e["Ä"]="196",e["Å"]="197",e["Æ"]="198",e["Ç"]="199",e["È"]="200",e["É"]="201",e["Ê"]="202",e["Ë"]="203",e["Ì"]="204",e["Í"]="205",e["Î"]="206",e["Ï"]="207",e["Ð"]="208",e["Ñ"]="209",e["Ò"]="210",e["Ó"]="211",e["Ô"]="212",e["Õ"]="213",e["Ö"]="214",e["×"]="215",e["Ø"]="216",e["Ù"]="217",e["Ú"]="218",e["Û"]="219",e["Ü"]="220",e["Ý"]="221",e["Þ"]="222",e["ß"]="223",e["à"]="224",e["á"]="225",e["â"]="226",e["ã"]="227",e["ä"]="228",e["å"]="229",e["æ"]="230",e["ç"]="231",e["è"]="232",e["é"]="233",e["ê"]="234",e["ë"]="235",e["ì"]="236",e["í"]="237",e["î"]="238",e["ï"]="239",e["ð"]="240",e["ñ"]="241",e["ò"]="242",e["ó"]="243",e["ô"]="244",e["õ"]="245",e["ö"]="246",e["÷"]="247",e["ø"]="248",e["ù"]="249",e["ú"]="250",e["û"]="251",e["ü"]="252",e["ý"]="253",e["þ"]="254",e["ÿ"]="255",e["&OElig"]="338",e["&oelig"]="339",e["&Scaron"]="352",e["&scaron"]="353",e["&Yuml"]="376",e["&fnof"]="402",e["&circ"]="710",e["&tilde"]="732",e["&Alpha"]="913",e["&Beta"]="914",e["&Gamma"]="915",e["&Delta"]="916",e["&Epsilon"]="917",e["&Zeta"]="918",e["&Eta"]="919",e["&Theta"]="920",e["&Iota"]="921",e["&Kappa"]="922",e["&Lambda"]="923",e["&Mu"]="924",e["&Nu"]="925",e["&Xi"]="926",e["&Omicron"]="927",e["&Pi"]="928",e["&Rho"]="929",e["&Sigma"]="931",e["&Tau"]="932",e["&Upsilon"]="933",e["&Phi"]="934",e["&Chi"]="935",e["&Psi"]="936",e["&Omega"]="937",e["&alpha"]="945",e["&beta"]="946",e["&gamma"]="947",e["&delta"]="948",e["&epsilon"]="949",e["&zeta"]="950",e["&eta"]="951",e["&theta"]="952",e["&iota"]="953",e["&kappa"]="954",e["&lambda"]="955",e["&mu"]="956",e["&nu"]="957",e["&xi"]="958",e["&omicron"]="959",e["&pi"]="960",e["&rho"]="961",e["&sigmaf"]="962",e["&sigma"]="963",e["&tau"]="964",e["&upsilon"]="965",e["&phi"]="966",e["&chi"]="967",e["&psi"]="968",e["&omega"]="969",e["&thetasym"]="977",e["&upsih"]="978",e["&piv"]="982",e["&ensp"]="8194",e["&emsp"]="8195",e["&thinsp"]="8201",e["&zwnj"]="8204",e["&zwj"]="8205",e["&lrm"]="8206",e["&rlm"]="8207",e["&ndash"]="8211",e["&mdash"]="8212",e["&lsquo"]="8216",e["&rsquo"]="8217",e["&sbquo"]="8218",e["&ldquo"]="8220",e["&rdquo"]="8221",e["&bdquo"]="8222",e["&dagger"]="8224",e["&Dagger"]="8225",e["&bull"]="8226",e["&hellip"]="8230",e["&permil"]="8240",e["&prime"]="8242",e["&Prime"]="8243",e["&lsaquo"]="8249",e["&rsaquo"]="8250",e["&oline"]="8254",e["&frasl"]="8260",e["&euro"]="8364",e["&image"]="8365",e["&weierp"]="8472",e["&real"]="8476",e["&trade"]="8482",e["&alefsym"]="8501",e["&larr"]="8592",e["&uarr"]="8593",e["&rarr"]="8594",e["&darr"]="8595",e["&harr"]="8596",e["&crarr"]="8629",e["&lArr"]="8656",e["&uArr"]="8657",e["&rArr"]="8658",e["&dArr"]="8659",e["&hArr"]="8660",e["&forall"]="8704",e["&part"]="8706",e["&exist"]="8707",e["&empty"]="8709",e["&nabla"]="8711",e["&isin"]="8712",e["¬in"]="8713",e["&ni"]="8715",e["&prod"]="8719",e["&sum"]="8721",e["&minus"]="8722",e["&lowast"]="8727",e["&radic"]="8730",e["&prop"]="8733",e["&infin"]="8734",e["&ang"]="8736",e["&and"]="8743",e["&or"]="8744",e["&cap"]="8745",e["&cup"]="8746",e["&int"]="8747",e["&there4"]="8756",e["&sim"]="8764",e["&cong"]="8773",e["&asymp"]="8776",e["&ne"]="8800",e["&equiv"]="8801",e["&le"]="8804",e["&ge"]="8805",e["&sub"]="8834",e["&sup"]="8835",e["&nsub"]="8836",e["&sube"]="8838",e["&supe"]="8839",e["&oplus"]="8853",e["&otimes"]="8855",e["&perp"]="8869",e["&sdot"]="8901",e["&lceil"]="8968",e["&rceil"]="8969",e["&lfloor"]="8970",e["&rfloor"]="8971",e["&lang"]="9001",e["&rang"]="9002",e["&loz"]="9674",e["&spades"]="9824",e["&clubs"]="9827",e["&hearts"]="9829",e["&diams"]="9830",e)"function"!=typeof e[r]&&e.hasOwnProperty(r)&&(t[e[r]]=r);for(i in t)"function"!=typeof t[i]&&t.hasOwnProperty(i)&&(o=t[i].toLowerCase().substr(1),n.put(o,String.fromCharCode(i)));return n})(),MW=class extends gW{decodeCharacter(e){let t;e.mark();const n=e.next();if(null==n||"&"!==n)return e.reset(),null;const r=e.next();if(null==r)return e.reset(),null;if("#"===r){if(t=this._getNumericEntity(e),null!=t)return t}else if(r.match(/[A-Za-z]/)&&(e.pushback(r),t=this._getNamedEntity(e),null!=t))return t;return e.reset(),null}_getNamedEntity(e){let t,n,r,i="";for(t=Math.min(e.remainder().length,CW.getMaxKeyLength()),r=0;r<t;r++)i+=e.next().toLowerCase();const o=CW.getLongestMatch(i);if(null==o)return null;for(e.reset(),e.next(),t=o.getKey().length,n=0;n<t;n++)e.next();return e.peek(";")&&e.next(),o.getValue()}_getNumericEntity(e){const t=e.peek();return null==t?null:"x"===t||"X"===t?(e.next(),this._parseHex(e)):this._parseNumber(e)}_parseHex(e){let t,n="";for(;e.hasNext();){if(t=e.peek(),Number.isNaN(+parseInt(t,16))){if(";"===t){e.next();break}break}n+=t,e.next()}const r=parseInt(n,16);return!Number.isNaN(+r)&&yW(r)?String.fromCharCode(r):null}_parseNumber(e){let t,n="";for(;e.hasNext();){if(t=e.peek(),Number.isNaN(+parseInt(t,10))){if(";"===t){e.next();break}break}n+=t,e.next()}const r=parseInt(n,10);return!Number.isNaN(+r)&&yW(r)?String.fromCharCode(r):null}},kW=class extends gW{decodeCharacter(e){e.mark();const t=e.next();let n,r,i,o;if(null==t)return e.reset(),null;if("%"!==t)return e.reset(),null;for(n="",r=0;r<2;r++)i=e.nextHex(),null!=i&&(n+=i);return 2===n.length&&(o=parseInt(n,16),yW(o))?String.fromCharCode(o):(e.reset(),null)}},EW=/^data:(?<!\s)\s*(image\/[\w+-.]+)(?<!\s)\s*(;.*?){0,1}(?<!\s)\s*,(.*)/i,_W=5e6,RW=5e5,IW=(e,t)=>{const{maxByteSizeSvg:n=RW,maxByteSizeImage:r=_W}=t??{},{mimeType:i,encoding:o,data:a}=(e=>{const[,t,n,r]=EW.exec(e.trim())??[];return{encoding:n,data:r,mimeType:t?.toLocaleLowerCase()}})(e);if(!a)return!0;const s=((e,t,n)=>{const r={type:e};if(t?.includes(";base64"))try{return new Blob([atob(n)],r).size}catch{return new Blob([n],r).size}return"image/svg+xml"===e?new Blob([n],r).size:0})(i,o,a);return"image/svg+xml"===i?s<=n:s<=r};"undefined"!=typeof document&&(fW=document.createElement("div"));var DW=Array.prototype.indexOf,AW=[",",".","_"," "],PW=[",",".","-","_"," "],OW={width:["%"],height:["%"]},TW={default:["-"," ","%"],color:["#"," ","(",")"],image:["(",")",":","/","?","&","-",".",'"',"="," "]},LW={background:["(",")",":","%","/","?","&","-"," ",".",'"',"=","#"],"background-image":TW.image,"background-color":TW.color,"border-color":TW.color,"border-image":TW.image,color:TW.color,icon:TW.image,"list-style-image":TW.image,"outline-color":TW.color},qW={attr_name:["^on[a-z]{1,}","style","href","src"],attr_val:["javascript:","data:"],css_key:["behavior","-moz-behavior","-ms-behavior"],css_val:["expression"]};function NW(e,t,n){let r;if(t){if(DW)return DW.call(t,e,n);for(r=t.length,n=n?n<0?Math.max(0,r+n):n:0;n<r;n++)if(n in t&&t[n]===e)return n}return-1}function jW(e){if(null==e)return"";let t="";const n=document.createTextNode(e);return fW.appendChild(n),t=fW.innerHTML,fW.removeChild(n),t}function zW(e,t,n){let r,i,o,a,s,l,c,u,d;for(e=WW(e).toLowerCase(),t=WW(t),o=0;o<qW.attr_name.length;o++)if(e.match(qW.attr_name[o]))throw new Error(`Unsafe attribute name used: ${e}`);for(o=0;o<qW.attr_val.length;o++)if(t.toLowerCase().match(qW.attr_val[o]))throw new Error(`Unsafe attribute value used: ${t}`);if(r=OW[e],r||(r=PW),i="",!n){for(a=0;a<e.length;a++){if(s=e.charAt(a),!s.match(/[a-zA-Z\-0-9]/))throw new Error("Invalid attribute name specified");i+=s}i+='="'}for(l=0;l<t.length;l++)c=t.charAt(l),u=t.charCodeAt(l),!c.match(/[a-zA-Z0-9]/)&&NW(c,r)<0?(d=u.toString(16),i+=`&#x${d};`):i+=c;return n||(i+='"'),i}function FW(e,t,n){let r,i,o,a,s,l,c,u,d,h;if(e=WW(e).toLowerCase(),t=WW(t),NW(e,qW.css_key)>=0)throw new Error(`Unsafe property name used: ${e}`);for(r=0;r<qW.css_val.length;r++)if(t.toLowerCase().indexOf(qW.css_val[r])>=0)throw new Error(`Unsafe property value used: ${t}`);if(i=LW[e],i||(i=TW.default),o="",!n){for(a=0;a<e.length;a++){if(s=e.charAt(a),!s.match(/[a-zA-Z-]/))throw new Error("Invalid Property Name specified");o+=s}o+=": "}for(l=0;l<t.length;l++)c=t.charAt(l),u=t.charCodeAt(l),!c.match(/[a-zA-Z0-9]/)&&NW(c,i)<0?(d=u.toString(16),h="000000".substr(d.length),o+=`\\${h}${d}`):o+=c;return o}function WW(e,t){let n,r,i,o,a=!1;if(null===e)return null;n=e,r=e,i=0;const s=[new MW,new kW,new bW];for(;!a;){r=n;for(let e=0;e<s.length;e++)o=s[e].decode(n),o!==n&&(i++,n=o);r!==n||(a=!0)}if(t&&i>1)throw new Error("Attack Detected - Multiple/Double Encodings used in input");return n}var $W=[];for(let e=0;e<255;e++)$W[e]=e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122?null:e.toString(16);var BW={html:e=>jW(e.unsafe),css(e){let t,n=[];const r=[],i={};let o="";for(t in e.map?n=e.map:n[e.name]=e.unsafe,n)"function"!=typeof n[t]&&n.hasOwnProperty(t)&&(r[t]=FW(t,n[t],!0),o+=FW(t,n[t],!0),i[t]=r[t]);return e.map?i:o},attr(e){let t=[];const n=[],r={};let i="";e.map?t=e.map:t[e.name]=e.unsafe;for(const e in t)"function"!=typeof t[e]&&t.hasOwnProperty(e)&&(n[e]=zW(e,t[e],!0),i+=zW(e,t[e],!0),r[e]=n[e]);return e.map?r:i}};function HW(e,t){throw new Error(t)}var VW={canonicalize:WW,encode:function(){const e={context:"html",unsafe:null,name:null,map:null,setter:null,strict:!0};return 1===arguments.length&&"object"==typeof arguments[0]?function(){let e,t,n;const r=arguments[0]||{};let i=1;const o=arguments.length;for(;i<o;i++)if(null!=(e=arguments[i]))for(t in e)if(e.hasOwnProperty(t)){if(n=e[t],r===n)continue;void 0!==n&&(r[t]=n)}}(e,arguments[0]):(e.context=arguments[0],2===arguments.length?"html"===e.context?e.unsafe=arguments[1]:"attr"!==e.context&&"css"!==e.context||(e.map=arguments[1]):(e.name=arguments[2],e.unsafe=arguments[1])),"html"===e.context?BW.html(e):"css"===e.context?(null!=e.map&&"object"!=typeof e.map&&HW(this,"Invalid parameter type"),BW.css(e)):"attr"===e.context?(null!=e.map&&"object"!=typeof e.map&&HW(this,"Invalid parameter type"),BW.attr(e)):void HW(this,"Invalid parameter type")},encodeForAttr:zW,encodeForAttr2:function(e){return zW("nonsens",e,!0)},encodeForCSS:FW,encodeForHref:function(e){WW(e),0!==e.search("[a-zA-Z0-9]+:")&&(e=`http://${e}`);const t=new pW(e),n=pW.encodeAuthorityAndPath(t.authorityAndPath),r=t.searchParams;e=n+pW.encodeSearchParams(r)+t.hash;const i=decodeURI(e).toLowerCase();if(-1!==i.indexOf("javascript:"))throw new Error("Attack Detected - Javascript in input");if(-1!==i.indexOf("data:"))throw new Error("Attack Detected - data in input");return e},encodeForJS:function(e,t){let n,r,i,o,a,s;for(t||(t=AW),s="",n=0;n<e.length;n++)i=e.charAt(n),o=e.charCodeAt(n),NW(i,t)>=0||null==$W[o]?s+=i:(r=o.toString(16),o<256?(a="00".substr(r.length),s+=`\\x${a}${r.toUpperCase()}`):(a="0000".substr(r.length),s+=`\\u${a}${r.toUpperCase()}`));return s},encodeForHTML:jW,encodeForURL:function(e,t){let n="";return t&&(t.match(/^[A-Za-z\-0-9]{1,}$/)?n+=WW(t).toLowerCase():HW(this,"Illegal Attribute Name Specified"),n+='="'),n+=encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A"),n+=t?'"':"",n},isSafeDataURL:IW,validateURI:function(e){if(""===e||function(e){if("canParse"in URL)return URL.canParse(e);try{return new URL(e),!0}catch{return!1}}(e))return!1;const t=e.replace(/%2E/gi,".");if(t.match(/[#&=: ]/))return!1;const n=function(e){let t=e,n="";for(;t.length>0;)if(t.startsWith("../")||t.startsWith("./"))t=t.replace(/^\.\.?\//,"");else if(t.startsWith("/./"))t=t.replace(/^\/\.\//,"/");else if("/."===t)t="/";else if(t.startsWith("/../")){t=t.replace(/^\/\.\.\//,"/");const e=n.lastIndexOf("/");-1!==e&&(n=n.slice(0,e))}else if("/.."===t){t="/";const e=n.lastIndexOf("/");-1!==e&&(n=n.slice(0,e))}else if("."===t||".."===t)t="";else{const e=t.match(/^\/?[^/]*/),r=e?e[0]:"";t=t.slice(r.length),n+=r}return n}(t);return""!==n&&"/"!==n&&n}};const GW=(e,t)=>t.qAttrExps?.qValues?.[e],UW=(e,t)=>{switch(e){case"topLeft":default:return{horizontal:"rtl"===t?"flex-end":"flex-start",vertical:"flex-start"};case"centerLeft":return{horizontal:"center",vertical:"flex-start"};case"bottomLeft":return{horizontal:"rtl"===t?"flex-start":"flex-end",vertical:"flex-start"};case"topCenter":return{horizontal:"rtl"===t?"flex-end":"flex-start",vertical:"center"};case"centerCenter":return{horizontal:"center",vertical:"center"};case"bottomCenter":return{horizontal:"rtl"===t?"flex-start":"flex-end",vertical:"center"};case"topRight":return{horizontal:"rtl"===t?"flex-end":"flex-start",vertical:"flex-end"};case"centerRight":return{horizontal:"center",vertical:"flex-end"};case"bottomRight":return{horizontal:"rtl"===t?"flex-start":"flex-end",vertical:"flex-end"}}},YW=({text:e,url:t,imageSize:n,imagePosition:r,labelStructure:i,imageBox:o,direction:a})=>r&&t&&!t.toLowerCase().includes("javascript:")&&VW.isSafeDataURL(t)?{type:ZN.Image,url:t,text:e,imageSize:n,resolvedImagePosition:UW(r,a),labelStructure:i,imageBox:o}:{type:ZN.Text,url:void 0,text:e,labelStructure:i},KW=(e,t,n,r)=>{if(!e.qMiniChart||!t?.miniChart||!n)return{type:ZN.Text,text:r};const{minY:i,maxY:o}=((e,t,n)=>{const r="global"===t.yAxis?.scale,i="zeroCenter"===t.yAxis?.position,o=r?n.qYMin:e.qMiniChart.qMin,a=r?n.qYMax:e.qMiniChart.qMax;if(i){const e=Math.max(Math.abs(o),Math.abs(a));return{minY:-e,maxY:e}}return(e=>"zeroBaseline"===e.yAxis?.position||"bars"===e.type&&"auto"===e.yAxis?.position)(t)?{minY:Math.min(0,o),maxY:Math.max(0,a)}:{minY:o,maxY:a}})(e,t.miniChart,n),a={type:t.miniChart.type,qMatrix:e.qMiniChart.qMatrix,minY:i,maxY:o,showDots:!!t.miniChart.showDots,colors:t.miniChart.colors,colorMin:e.qMiniChart.qMin,colorMax:e.qMiniChart.qMax};return{type:ZN.MiniChart,text:r,miniChart:a}},XW=(e,t,n)=>{const r=Array.isArray(t.qAttrExps)?t.qAttrExps[0]:t.qAttrExps,i=r?.qValues?.[e];if(i){const e=Number.isNaN(+i.qNum)?void 0:`${i.qNum}`;return i.qText||e}return n?.urlPosition===QN.Attribute?void 0:n?.urlLabel},JW=({labelStructure:e,text:t,url:n})=>{try{if(!n)throw Error("Invalid url");return{type:ZN.Link,url:VW.encodeForHref(n),text:t,labelStructure:e}}catch{return{type:ZN.Text,url:void 0,text:t,labelStructure:e}}},ZW=({cell:e,representationProperties:t,attrExprInfoIndex:n,env:r,conditionalColoring:i,miniChartOnMeasure:o,labelStructure:a,getText:s=e=>e.qText,direction:l,enabledFeatures:c})=>{const u=ej(t),d=s(e);return u===ZN.Image&&c[ZN.Image]&&!r.anything.sense?.isUnsupportedFeature?.("tableImages")?((e,t,n,r,i,o)=>{const{imageSize:a,imagePosition:s,imageSetting:l,imageLabel:c,imageBox:u}=t??{};if("url"===l){const t=GW(n.imageUrl??-1,e)?.qText;return o&&(o.maskedValue=t??""),YW({text:r,url:t,imageSize:a,imagePosition:s,labelStructure:o,imageBox:u,direction:i})}if("label"===l){const t=o?o.originalValue:r;if(-1===n.imageLabel)return YW({text:c||t||"",url:t,imageSize:a,imagePosition:s,labelStructure:o,imageBox:u,direction:i});const l=GW(n.imageLabel??-1,e)?.qText??r;return YW({text:l,url:t,imageSize:a,imagePosition:s,labelStructure:o,imageBox:u,direction:i})}return{type:ZN.Text,url:void 0,labelStructure:o,text:r}})(e,t,n,d,l,a):u===ZN.Link?((e,t,n,r,i)=>{const{urlPosition:o}=t??{};if(o===QN.Attribute){const o=XW(n.url??-1,e,t);return JW({labelStructure:r,text:i||o||"",url:o})}if(o===QN.Dimension){const o=XW(n.urlLabel??-1,e,t)||i;return r&&(r.maskedValue=o),JW({text:o,labelStructure:r,url:r?.originalValue??i})}return{type:ZN.Text,url:void 0,text:i,labelStructure:r}})(e,t,n,a,d):u===ZN.Indicator&&c[ZN.Indicator]&&!r.anything.sense?.isUnsupportedFeature?.("tableIndicators")?((e,t,n)=>{const{indicator:r}=e??{};return{type:ZN.Indicator,url:void 0,text:n,indicator:{applySegmentColors:r?.applySegmentColors,position:r?.position,showTextValues:r?.showTextValues},indicatorConditionalColoring:t}})(t,i,d):u===ZN.MiniChart&&c[ZN.MiniChart]&&!r.anything.sense?.isUnsupportedFeature?.("qMiniChartDef")?KW(e,t,o,d):{type:ZN.Text,url:void 0,text:d,labelStructure:a}},QW=(e,t)=>{const n=t.qAttrExps,r=n?.qValues?.[e?.cellForegroundColor??-1]?.qText,i=n?.qValues?.[e?.cellBackgroundColor??-1]?.qText,o=i?Cj(i):null,a=r?Cj(r):null,s=((e,t)=>e||!t?null:xj(t))(a,o);return{color:s??a,background:o}},e$=(e,t)=>t.qSubNodes.reduce(((e,t)=>0===t.qSubNodes.length?e+1:e$(e,t)),e),t$=(e,t,n,r,i,o)=>{const a=i?o.rowsPerPage-n:qj-r;let s=e.qUp+e.qDown;if(i&&0===n){const n=(t+e.qUp)%o.rowsPerPage;s=e.qDown+n}return Math.min(a,e$(s,e))},n$=({node:e,parent:t,root:n,x:r,y:i,pageY:o,layoutService:a,dimensionInfo:s,attrExprInfoIndex:l,isLeftColumn:c=!0,isIndentModeEnabled:u=!1,indentLevel:d,labelStructure:h,env:p,pageInfo:f,direction:m="ltr"})=>{const g=(!u||!c)&&"P"===e.qType,y=((e,t)=>{if(e!==tW){if(t){const t=ej(e.representation);return t===ZN.Link||t===ZN.Image?e.representation:{type:ZN.Text}}return e.representation}})(s,u),v=(({node:e,isLeftColumn:t,isIndentModeEnabled:n,labelStructure:r,representationType:i,parentOrRootOriginalValue:o})=>{let a=e.qText;if(t&&n&&r){const{originalValue:t,delimeter:n,suffix:s}=r;a=i===ZN.Link?"P"===e.qType?o:t:`${t} ${!s||!t&&s?"":n} ${s}`.trim()}return a})({node:e,isLeftColumn:c,isIndentModeEnabled:u,labelStructure:h,representationType:ej(y),parentOrRootOriginalValue:(t||n)?.representation?.labelStructure?.originalValue??""}),b=ZW({cell:{...e,qText:v},representationProperties:y,attrExprInfoIndex:l,env:p,labelStructure:h,direction:m,enabledFeatures:{[ZN.Image]:!0,[ZN.Indicator]:!0}}),x={id:NL(),ref:e,x:r,y:i,pageX:r,pageY:o,mainAxisPageCoord:c?o:r,isLeftColumn:c,parent:t,root:n,children:[],isLeafNode:0===e.qSubNodes.length,leafCount:t$(e,i,o,r,c,f),distanceToNextCell:0,isLockedByDimension:!("object"!=typeof s||!s.qLocked),isTotal:"T"===e.qType||!!t?.isTotal,isEmpty:"E"===e.qType||-4===e.qElemNo,isNull:"U"===e.qType,isPseudoDimension:g,expressionColor:QW(l,e),selectionCellType:c?"L":"T",dimensionInfoIndex:a.getDimensionInfoIndex(s),canBeResized:0===e.qSubNodes.length&&!c,visibleMeasureInfoIndex:g?e.qElemNo:t?.visibleMeasureInfoIndex,representation:b,...void 0!==d&&{indentLevel:d}};return t&&(t.children[x.mainAxisPageCoord-t.mainAxisPageCoord]=x),x},r$=(e,t,n,r,i,o,a,s,l)=>{const{isIndentModeEnabled:c}=i;if(!t.length)return e;let u=0;return function t(d,h,p,f=0,m=-1){e[f]||(e[f]={}),c&&m++;const g=i.leftDimensionInfoIndexes.indexOf(tW);p.forEach(((p,y)=>{const v={originalValue:p.qText??"",maskedValue:"",delimeter:"-",suffix:""};u+=0===y?0:1;const b=n.qTop-r.page*r.rowsPerPage,x=Math.max(0,b+u-p.qUp),w=n.qTop+u-p.qUp;if(c){if(i.hasPseudoDimOnLeft&&m<=g)if(v.originalValue=p.qText??"",v.maskedValue=p.qText??"","N"===p.qType||"U"===p.qType||"T"===p.qType)"U"===p.qType&&(v.originalValue=i.getNullValueText()),m<g&&(v.suffix=i.visibleMeasureInfo[0].qFallbackTitle);else if("P"===p.qType){v.originalValue=(h||d)?.representation.labelStructure?.originalValue??"",v.maskedValue=(h||d)?.representation.labelStructure?.originalValue??"",v.suffix=p.qText??"";const e=p.qSubNodes;p={...(h||d)?.ref,...p.qText?{qText:p.qText}:{},qSubNodes:e},m=(h||d)?.indentLevel??0}"U"===p.qType&&(v.originalValue=i.getNullValueText())}let S=f;c&&(S=g>=1&&m>=g?m+1:m,0===m&&0===g&&0===p.qSubNodes.length&&(S=0));const C=e.at(f)?.[x],M=c&&void 0===C?.ref.qText||!C?n$({node:p,parent:h,root:d,x:S,y:w,pageY:x,layoutService:i,dimensionInfo:o[S],attrExprInfoIndex:a[S],isLeftColumn:!0,...c&&{isIndentModeEnabled:c,indentLevel:m},env:s,pageInfo:r,labelStructure:v,direction:l}):e[f][x];if(e[f][x]=M,p.qSubNodes.length){const e=c?0:f+1;t(d||M,M,p.qSubNodes,e,m)}}))}(null,null,t,0,-1),e},i$=(e,t)=>{e.slice(0,-1).forEach((e=>{Object.values(e).forEach(((e,n,r)=>{const i=r.at(n+1);e.distanceToNextCell=i?i.mainAxisPageCoord-(e.mainAxisPageCoord+e.leafCount):t-(e.mainAxisPageCoord+e.leafCount)}))}))},o$=(e,t)=>{const n=e[0],r=n?Object.values(n):[],i=t?.isIndentModeEnabled&&t.hasPseudoDimOnLeft?t.visibleMeasureInfo.length-1:0,o=n?.[i],a=r.at(-1);return o?.isTotal?o.isLeafNode?o.mainAxisPageCoord:o.mainAxisPageCoord+o.leafCount-1:a?.isTotal?a.mainAxisPageCoord-1:-1},a$=({prevData:e,nextDataPage:t,pageInfo:n,layoutService:r,visibleLeftDimensionInfo:i,attrExprInfoIndexes:o,env:a,direction:s})=>{const{qLeft:l,qArea:c}=t;if(!l.length)return e;const u=r$(e.grid,l,c,n,r,i,o,a,s);i$(u,n.rowsOnCurrentPage);const d=o$(u,r);return{...e,grid:u,columnCount:u.length,totalDividerIndex:d}},s$=({qArea:e,prevData:t,pivotValuePoints:n,pageInfo:r})=>{const i=[...t];return n.forEach(((t,n)=>{t.forEach(((t,o)=>{const a=e.qTop-r.page*r.rowsPerPage+n,s=e.qLeft+o;Array.isArray(i[a])||(i[a]=[]);const l="U"===t.qType;i[a][s]=i[a][s]??{id:NL(),ref:t,isNull:l}}))})),i},l$=({prevData:e,dataPage:t,pageInfo:n})=>{const{qData:r,qArea:i}=t;return r?.length?s$({qArea:i,prevData:e,pivotValuePoints:r,pageInfo:n}):e},c$=(e,t,n,r,i,o,a,s,l,c)=>{const{isIndentModeEnabled:u}=r;if(!t.length)return e;let d=0;!function t(a,h,p,f=0){e[f]||(e[f]={}),p.forEach(((p,m)=>{d+=0===m?0:1;const g=n.qLeft+d-p.qUp,y=e[f][g]??n$({node:p,parent:h,root:a,x:g,y:f,pageY:f,layoutService:r,dimensionInfo:i[f],attrExprInfoIndex:o[f],isLeftColumn:!1,...u&&{isIndentModeEnabled:u},env:s,pageInfo:l,direction:c});e[f][g]=y,p.qSubNodes.length&&t(a||y,y,p.qSubNodes,f+1)}))}(null,null,t);for(let t=0;t<a-e.length;t++)e.push({});return e},u$=({prevData:e,nextDataPage:t,layoutService:n,visibleTopDimensionInfo:r,attrExprInfoIndexes:i,headerRows:o,env:a,pageInfo:s,direction:l})=>{const{qTop:c,qArea:u}=t;if(!c.length)return e;const d=c$(e.grid,c,u,n,r,i,o,a,s,l);i$(d,n.size.x);const h=o$(d);return{...e,grid:d,rowCount:d.length,totalDividerIndex:h}},d$=e=>-1===e?{}:e.qAttrExprInfo.reduce(((e,{id:t},n)=>(e[t]=n,e)),{}),h$=(e,t)=>{const{env:n}=YF(),{direction:r}=VF(),{layoutService:i,effectivePropertiesService:o}=JF(),{qPivotDataPages:a,pageInfo:s}=VF(),[l,c]=m(null),u=((e,t,n)=>f((()=>({left:e.map(d$),top:t.map(d$),measures:n.map(d$)})),[n,e,t]))(e,t,i.visibleMeasureInfo),d=f((()=>sW(i,o,t,e)),[i,o,t,e]),p=h((()=>a.slice(1).reduce(((e,t)=>l$({prevData:e,dataPage:t,pageInfo:s})),((e,t)=>{const{qData:n,qArea:r}=e;return s$({qArea:r,prevData:[],pivotValuePoints:n,pageInfo:t})})(a[0],s))),[a,s]),g=h((()=>a.slice(1).reduce(((e,o)=>u$({prevData:e,nextDataPage:o,layoutService:i,visibleTopDimensionInfo:t,attrExprInfoIndexes:u.top,headerRows:d.size.y,env:n,pageInfo:s,direction:r})),((e,t,n,r,i,o,a,s)=>{const{qArea:l,qTop:c}=e,u=c$([],c,l,t,n,r,i,o,a,s);i$(u,t.size.x);const d=o$(u);return{grid:u,rowCount:u.length,layoutSize:t.size,totalDividerIndex:d}})(a[0],i,t,u.top,d.size.y,n,s,r))),[a,i,t,u.top,d.size.y,n,s,r]),y=h((()=>a.slice(1).reduce(((t,o)=>a$({prevData:t,nextDataPage:o,pageInfo:s,layoutService:i,visibleLeftDimensionInfo:e,attrExprInfoIndexes:u.left,env:n,direction:r})),((e,t,n,r,i,o,a)=>{const{qArea:s,qLeft:l}=e,c=r$([],l,s,n,t,r,i,o,a);i$(c,n.rowsOnCurrentPage);const u=o$(c,t);return{grid:c,columnCount:c.length,layoutSize:t.size,totalDividerIndex:u}})(a[0],i,s,e,u.left,n,r))),[a,i,s,e,u,n,r]),[v,b]=m((()=>p())),[x,w]=m((()=>g())),[S,C]=m((()=>y()));bz((()=>{b(p())}),[p]),bz((()=>{w(g())}),[g]),bz((()=>{C(y())}),[y]),bz((()=>{l&&l.forEach((o=>{b((e=>l$({prevData:e,dataPage:o,pageInfo:s}))),w((e=>u$({prevData:e,nextDataPage:o,layoutService:i,visibleTopDimensionInfo:t,attrExprInfoIndexes:u.top,headerRows:d.size.y,env:n,pageInfo:s,direction:r}))),C((t=>a$({prevData:t,nextDataPage:o,pageInfo:s,layoutService:i,visibleLeftDimensionInfo:e,attrExprInfoIndexes:u.left,env:n,direction:r})))}))}),[l]);const M=h((e=>{c(e)}),[]);return{headersData:d,measureData:v,topDimensionData:x,leftDimensionData:S,attrExprInfoIndexes:u,nextPageHandler:M}},p$=Math.sqrt(1e4),f$=e=>({maxNumberOfVisibleRows:Math.ceil(e.height/24),maxNumberOfVisibleColumns:Math.ceil(e.width/_T.PixelsMin)}),m$=e=>{if(null===e)return[];if(e.qWidth*e.qHeight<1e4)return[e];const t=[],n=Math.ceil(e.qWidth/p$),r=Math.ceil(e.qHeight/p$);for(let i=0;i<n;i++)for(let n=0;n<r;n++)t.push({qLeft:e.qLeft+i*p$,qTop:e.qTop+n*p$,qWidth:Math.min(p$,e.qWidth-i*p$),qHeight:Math.min(p$,e.qHeight-n*p$)});return t};function g$({nextPageHandler:e}){const{model:t}=YF(),{pageInfo:n}=VF(),{layoutService:r}=JF(),i=(e=>{const t=a(e);return t.current=e,t})(n.page),o=t,s=h((async(e,t)=>{await(o?.collapseLeft(eW,e,t,!1))}),[o]),l=h((async(e,t)=>{await(o?.collapseTop(eW,e,t,!1))}),[o]),c=h((async(e,t)=>{await(o?.expandLeft(eW,e,t,!1))}),[o]),u=h((async(e,t)=>{await(o?.expandTop(eW,e,t,!1))}),[o]),d=h((async t=>{if(o?.getHyperCubePivotData&&0!==t.length)try{const r=await o.getHyperCubePivotData(eW,t.reduce(((e,t)=>[...e,...m$(t)]),[]));i.current===n.page&&e(r)}catch(e){console.error(e)}}),[o,e,n,i]),p=h(((e,{dimensionInfoIndex:n,isLeftColumn:i,x:o=0,columnWidthLocation:a})=>{const{qMeasureInfo:s,qDimensionInfo:l,topHeadersColumnWidth:c}=r.layout.qHyperCube;let u=[];switch(a){case oj.Dimension:u=[{qPath:`${eW}/qDimensions/${n}/qDef/columnWidth`,oldValue:l[n].columnWidth}];break;case oj.Measures:if(i)u=s.map(((e,t)=>({qPath:`${eW}/qMeasures/${t}/qDef/columnWidth`,oldValue:e.columnWidth})));else{const e=r.getMeasureInfoIndexFromCellIndex(o);u=[{qPath:`${eW}/qMeasures/${e}/qDef/columnWidth`,oldValue:s[e].columnWidth}]}break;case oj.Pivot:u=[{qPath:`${eW}/topHeadersColumnWidth`,oldValue:c}]}const d=u.map((t=>{const{qPath:n,oldValue:r}=t;return{qPath:n,qOp:r?"Replace":"Add",qValue:JSON.stringify({...r,...e})}}));t?.applyPatches(d,!0)}),[t,r]),m=h((async e=>{await(o?.applyPatches([{qPath:`${eW}/indentModeColumnWidth`,qOp:r.layout.qHyperCube.indentModeColumnWidth?"Replace":"Add",qValue:JSON.stringify({...r.indentModeColumnWidth,...e})}],!0))}),[o,r]);return f((()=>({collapseLeft:s,collapseTop:l,expandLeft:c,expandTop:u,applyColumnWidth:p,applyIndentModeColumnWidth:m,fetchPages:d})),[s,l,c,u,p,m,d])}const y$=(e,t,n)=>(r,i)=>{if("P"===r)return tW;const o=t[n+i];return e[o]},v$=e=>{const t=[],n=(e,r=0)=>{e.slice(0,1).forEach((e=>{t[r]=e.qType,e.qSubNodes.length&&n(e.qSubNodes,r+1)}))};return n(e),t},b$=s({}),x$=()=>d(b$),w$=({children:e})=>{const{visibleLeftDimensionInfo:t,visibleTopDimensionInfo:n}=(()=>{const{layoutService:{layout:{qHyperCube:{qNoOfLeftDims:e,qEffectiveInterColumnSortOrder:t,qDimensionInfo:n}}}}=JF(),{qPivotDataPages:r}=VF();return f((()=>{const i=v$(r[0]?.qLeft??[]),o=v$(r[0]?.qTop??[]);return{visibleLeftDimensionInfo:i.map(y$(n,t,0)),visibleTopDimensionInfo:o.map(y$(n,t,e))}}),[n,t,e,r])})(),{headersData:r,measureData:i,topDimensionData:o,leftDimensionData:a,attrExprInfoIndexes:s,nextPageHandler:l}=h$(t,n),c=g$({nextPageHandler:l}),u=f((()=>({gridSectionsData:{headersData:r,topDimensionData:o,leftDimensionData:a,measureData:i},visibleDimensionsInfo:{visibleLeftDimensionInfo:t,visibleTopDimensionInfo:n},attrExprInfoIndexes:s,dataModel:c})),[t,n,r,i,o,a,s,c]);return Ji.jsx(b$.Provider,{value:u,children:e})},S$=20,C$=18,M$=.75,k$=e=>-1!==e&&e?.representation?.type===ZN.Image,E$=({isLeftColumn:e,layoutService:t,representation:n})=>Boolean(e)&&t.isIndentModeEnabled&&n.type===ZN.Image,_$=e=>void 0===e?Lj:e,R$=(e,t)=>void 0===e||Number.isNaN(+e)?t:+e,I$=e=>R$(e,_T.PixelsDefault),D$=(e,t)=>R$(e,_T.PercentageDefault)*t/100,A$=(e,t,n)=>{switch(t?.type){case RT.Pixels:return I$(t.pixels);case RT.Percentage:return D$(t.percentage,e);case RT.FitToContent:case RT.Auto:default:return n}},P$=({headers:e,layoutService:t,effectivePropertiesService:n,estimateWidthForDimensionValue:r,shouldConsiderCombinatedLength:i,measureTextForHeader:o,longestMeasureValuePossible:a})=>e.reduce(((e,s,l)=>{const{layout:{qHyperCube:{qNoOfLeftDims:c,qDimensionInfo:u}}}=t,{id:d,colIdx:h,qApprMaxGlyphCount:p,isLeftDimension:f}=s,m=u.find((e=>e.cId===d)),g={width:24,...m?.representation?.imageBox};if(!f)return e+0;if(d===nW)return e+0;const y=E$({isLeftColumn:f,layoutService:t,representation:m?.representation||{type:ZN.Text}})?g.width+8+4:r(p),v=!n.qAlwaysFullyExpanded&&h<c-1?21:0;let b=0;if(i&&o&&a){b=o("- ")+a}return Math.max(e,24*l+C$+v+y+b)}),0),O$=(e,t,n)=>e.reduce(((e,r)=>{const i=(n?0:1)*C$;return Math.max(e,i+t(r.qFallbackTitle))}),0),T$=(e,t,n,r)=>{const i=100*e/t,o=r*M$*(i/100),a=i/100*+n;return Math.min(a,o)},L$=(e,t,n,r)=>r*(+n/100)*(100*e/t/100),q$=(e,t)=>e.some((e=>e>=t*M$)),N$=({layoutService:e,effectivePropertiesService:t,headersData:n,columnWidths:r,tableWidth:i,widthOverride:o,measureTextForHeader:a,estimateWidthForDimensionValue:s,measureTextWidthForMeasuresCombinedWithDimensions:l,translator:c})=>{let u=[];const d=i*M$,h=n.data[n.data.length-1][0];if(!Array.isArray(h))return{leftGridWidth:0,leftGridColumnWidths:[],leftGridFullWidth:0};const p=Math.min(d,r.at(-1)),f=Math.min(d,P$({headers:h,layoutService:e,effectivePropertiesService:t,estimateWidthForDimensionValue:s})),m=Math.min(d,O$(e.visibleMeasureInfo,a));let g=0;const y=h.findIndex((e=>e.id===nW)),v=(({layoutService:e,measureTextForHeader:t,translator:n,headersData:r})=>{const{type:i}=e.indentModeColumnWidth;return i===RT.Auto&&r.size.y<=1?t(n.get("SNPivotTable.IndentMode.Rows"))+8+C$+16:24})({layoutService:e,measureTextForHeader:a,translator:c,headersData:n});if(e.hasPseudoDimOnLeft)if(0===y){const e=Math.max(p,f,m);u=[Math.max(v,e-p),p]}else{const n=Math.min(d,O$(e.visibleMeasureInfo,l,!0));g=Math.min(d,P$({headers:h.slice(0,y),layoutService:e,effectivePropertiesService:t,estimateWidthForDimensionValue:s,shouldConsiderCombinatedLength:!0,measureTextForHeader:a,longestMeasureValuePossible:n}));const r=Math.max(p,f,g);u=[Math.max(v,r-p),p]}else u=[Math.max(v,f-p),p];const b=Math.min(d,u.reduce(((e,t)=>e+t),0)),{indentModeColumnWidth:x}=e;o&&o<=d&&(x.type=RT.Pixels,x.pixels=o);return[RT.Pixels,RT.Percentage].includes(x.type)||q$(u,i)?((e,t,n,r)=>{let i=e[0],o=e[1],a=[];const s=e.reduce(((e,t)=>e+t),0),{type:l,pixels:c,percentage:u}=t,d=q$(e,n);l===RT.Auto&&d&&(i>o?i-=o:o-=i),l===RT.Pixels&&c&&(i=T$(e[0],s,c,n),o=T$(e[1],s,c,n)),l===RT.Percentage&&u&&(i=L$(e[0],s,u,n),o=L$(e[1],s,u,n));let h=0;o<=r&&(h=i-5,h>0&&(i-=h,o+=h)),h=o-r,h>0&&(i+=h,o-=h),a=[i,o];const p=a.reduce(((e,t)=>e+t),0);return{leftGridColumnWidths:a,leftGridWidth:p,leftGridFullWidth:p}})(u,x,i,p):{leftGridWidth:b,leftGridColumnWidths:u,leftGridFullWidth:b}};function j$({tableWidth:e}){const t=e*M$,{styleService:n,layoutService:r,effectivePropertiesService:i}=JF(),{translator:o}=YF(),{gridSectionsData:{headersData:a}}=x$(),{measureText:s}=mz(n.header),{estimateWidth:l,measureText:c}=mz({...n.dimensionValues,fontWeight:_$(n.dimensionValues.fontWeight)}),{measureText:u}=mz({...n.dimensionValues,...n.measureLabels}),d=h(((n,d)=>{const{layout:{qHyperCube:{qNoOfLeftDims:h,topHeadersColumnWidth:p}},visibleMeasureInfo:f,isIndentModeEnabled:m,hasPseudoDimOnLeft:g}=r,y=(t=0)=>f.reduce(((n,{qFallbackTitle:r,columnWidth:i})=>{const o=u(r)+C$,a=Math.max(o,t);return Math.max(n,m?a:A$(e,i,a))}),0),v=e=>a.data.reduce(((t,n)=>{const r=n.at(e);if(!r||Array.isArray(r))return t;if(r.id===nW)return t;const i=(e=>{const{label:t,isLocked:n}=e,r=n?S$:0;return C$+s(t)+S$+r})(r);return Math.max(i,t)}),0);let b=0,x=a.data.at(-1);m&&a.size.x>1&&x&&x[0]&&(x=x[0]);const w=x.map(((o,s)=>{let c=C$;if(m&&1!==a.size.x||!n||void 0===d||d!==o.colIdx){let t;o.columnWidthLocation===oj.Pivot?t=m?void 0:p:o.columnWidthLocation===oj.Dimension&&({columnWidth:t}=o);let n=0;if(o.isLeftDimension)if(o.id===nW)n=y();else{const e=v(s),t=((e,t)=>{const{qApprMaxGlyphCount:n,isLeftDimension:o,dimensionInfoIndex:a}=e,s=r.getDimensionInfo(a);if(k$(s))return _T.PixelsDefault;const c=!i.qAlwaysFullyExpanded&&o&&t<h-1?21:0;return C$+l(n)+c})(o,s);n=Math.max(e,t),m&&!g&&s+1===h&&o.columnWidthLocation===oj.Dimension&&a.size.x>1&&(n=e)}else n=v(s),o.columnWidthLocation===oj.Measures&&(n=y(n));m&&1===a.size.x&&(t=r.indentModeColumnWidth),c=m&&!g&&a.size.x>1?n:A$(e,t,n)}else c=m?Math.min(t,n):n;return b+=c,c}));return m&&a.size.x>1?N$({layoutService:r,effectivePropertiesService:i,headersData:a,columnWidths:w,tableWidth:e,widthOverride:n,measureTextForHeader:s,estimateWidthForDimensionValue:l,measureTextWidthForMeasuresCombinedWithDimensions:c,translator:o}):{leftGridWidth:Math.min(t,b),leftGridColumnWidths:w,leftGridFullWidth:b}}),[e,a,r,t,s,u,l,c,o,i]),[p,f]=m(d);bz((()=>{f(d())}),[d]);const g=h(((e,t)=>{f(d(e,t))}),[d]);return{...p,overrideLeftGridWidth:g}}function z$({tableWidth:e,verticalScrollbarWidth:t,leftGridWidth:n}){const{styleService:r,layoutService:i}=JF(),{visibleDimensionsInfo:{visibleTopDimensionInfo:o}}=x$(),{layout:{qHyperCube:{qNoOfLeftDims:a,qEffectiveInterColumnSortOrder:s}},size:l,visibleMeasureInfo:c}=i,{estimateWidth:u,measureText:d}=mz(r.measureValues),{estimateWidth:p}=mz({...r.dimensionValues,fontWeight:_$(r.dimensionValues.fontWeight)}),m=e-n-1,g=o.at(-1),y=g===tW,v=s.length-a>o.length?21:0,b=f((()=>{const e=y?c:[g],t=l.x/e.length,n=[],r=[];let i=m;const o=(e,r)=>{n[e]=Math.min(_T.PixelsMax,Math.max(_T.PixelsMin,r)),i-=n[e]*t};if(e.forEach(((e,t)=>{if(e?.columnWidth){const{columnWidth:{type:n,pixels:i,percentage:a},qApprMaxGlyphCount:s,qFallbackTitle:l}=e;switch(n){case RT.Pixels:o(t,I$(i));break;case RT.Percentage:o(t,D$(a,m));break;case RT.FitToContent:o(t,((e,t,n)=>n?_T.PixelsDefault:C$+(y?Math.max(u(e),d(t)):Math.max(Math.max(...c.map((e=>u(e.qApprMaxGlyphCount)))),p(e)+v)))(s,l,k$(e)));break;case RT.Auto:default:r.push(t)}}else r.push(t)})),r.length){const e=r.length*t,o=i/e;r.forEach((e=>{n[e]=Math.max(_T.AutoMinPivot,o)}))}return n}),[y,c,g,l.x,m,u,d,p,v]),x=f((()=>{if(y){const e=c.reduce(((e,t,n)=>e+b[n]),0);return e/c.length}return b[0]}),[y,b,c]),w=parseFloat((t/i.size.x).toFixed(12)),S=h((e=>(y&&void 0!==e?b[i.getMeasureInfoIndexFromCellIndex(e,!0)]:x)-w),[y,b,i,x,w]),C=l.x*x;return{rightGridFullWidth:C,rightGridWidth:Math.min(C,m),getRightGridColumnWidth:S}}const F$=`scrollable-container--${sj.TopGrid}`,W$=`scrollable-container--${sj.LeftGrid}`,$$=`scrollable-container--${sj.DataGrid}`,B$=e=>e&&e instanceof HTMLDivElement?{width:e.offsetWidth-e.clientWidth,height:e.offsetHeight-e.clientHeight}:{width:0,height:0},H$=(e,t)=>e>t?lj.Forward:e<t?lj.Backward:lj.None,V$=({gridRefs:{topGridRef:e,leftGridRef:t,dataGridRef:n},getWrapperElements:r,updateViewService:i,trackScrollDirection:o,interactions:a})=>{const{direction:s}=VF();c((()=>{const{headerGridWrapperElement:l,topGridWrapperElement:c,leftGridWrapperElement:u,dataGridWrapperElement:d}=r(),h=e=>{const t=e.target;l.scrollLeft=t.scrollLeft,o(e),i?.(e)},p=e=>{const t=e.target;l.scrollTop=t.scrollTop,o(e),i?.(e)},f=r=>{const a=r.target,l=((e,t)=>{const{scrollWidth:n,clientWidth:r,scrollLeft:i}=e,o=n-r;if("rtl"===t){if(i>o)return o;if(i<0)return Math.abs(i)}return i})(a,s);n.current?.scrollTo({scrollLeft:l,scrollTop:a.scrollTop}),c.scrollLeft=l,e.current?.forEach((e=>{e?.scrollTo(l)})),u.scrollTop=d.scrollTop,t.current?.forEach((e=>{e?.scrollTo(a.scrollTop)})),o(r),i?.(r)};return u.addEventListener("scroll",h),c.addEventListener("scroll",p),d.addEventListener("scroll",f),a.scroll||setTimeout((()=>{u.removeEventListener("scroll",h),c.removeEventListener("scroll",p),d.removeEventListener("scroll",f)}),0),()=>{u.removeEventListener("scroll",h),c.removeEventListener("scroll",p),d.removeEventListener("scroll",f)}}),[o,i,a,e,t,n,r,s])},G$=()=>{const{interactions:e}=YF(),t=a(null),n=a(null),r=a(null),i=a(null),o=a([]),s=a([]),l=a(null),{scrollbarsDimensions:{verticalScrollbarWidth:u,horizontalScrollbarHeight:d},resetHorizontalScrollbarHeight:f}=(({topGridWrapperRef:e,leftGridWrapperRef:t,dataGridWrapperRef:n})=>{const[r,i]=m(0),[o,a]=m(0);return p((()=>{(e.current||n.current)&&i(Math.max(B$(e.current).width,B$(n.current).width))})),p((()=>{(t.current||n.current)&&a(Math.max(B$(t.current).height,B$(n.current).height))})),{scrollbarsDimensions:{verticalScrollbarWidth:r,horizontalScrollbarHeight:o},resetHorizontalScrollbarHeight:()=>{a(0)}}})({topGridWrapperRef:n,leftGridWrapperRef:r,dataGridWrapperRef:i});(({gridSectionsWrapperRefs:{headerGridWrapperRef:e,topGridWrapperRef:t,leftGridWrapperRef:n,dataGridWrapperRef:r},gridRefs:{topGridRef:i,leftGridRef:o,dataGridRef:a}})=>{const{pageInfo:s}=VF(),{downloadService:l,viewService:c,layoutService:u}=JF(),d=h((()=>{const i={left:0,top:0};e.current?.scrollTo(i),t.current?.scrollTo(i),n.current?.scrollTo(i),r.current?.scrollTo(i)}),[e,t,n,r]);p((()=>{d()}),[s.page,d]),p((()=>{u.triggerdByExpandOrCollapse||d()}),[u,d]),p((()=>{if(u.triggerdByExpandOrCollapse){const e=r.current?.scrollLeft??0,t=r.current?.scrollTop??0;o.current?.forEach((e=>{e?.scrollTo(t)})),i.current?.forEach((t=>{t?.scrollTo(e)})),a.current?.scrollTo({scrollTop:t,scrollLeft:e})}}),[u,r,a,o,i]),p((()=>{(l.isDownloadedAsPDForImage||u.isSnapshot)&&r.current&&n.current&&t.current&&(r.current.scrollTop=c.scrollTop,r.current.scrollLeft=c.scrollLeft,n.current.scrollLeft=c.leftGridScrollLeft,t.current.scrollTop=c.topGridScrollTop)}),[c,l,u,r,n,t])})({gridSectionsWrapperRefs:{headerGridWrapperRef:t,topGridWrapperRef:n,leftGridWrapperRef:r,dataGridWrapperRef:i},gridRefs:{topGridRef:o,leftGridRef:s,dataGridRef:l}});const{trackScrollDirection:g,scrollDirectionRefs:{verticalScrollDirection:y,horizontalScrollDirection:v}}=(()=>{const e=a(lj.None),t=a(lj.None),n=a({prevScrollTop:0,prevScrollLeft:0}),r=h((r=>{if(r instanceof WheelEvent&&(e.current=H$(r.deltaY,0),t.current=H$(r.deltaX,0)),r instanceof Event&&!(r instanceof WheelEvent)){const i=r.target;e.current=H$(i.scrollTop,n.current.prevScrollTop),n.current.prevScrollTop=i.scrollTop,t.current=H$(i.scrollLeft,n.current.prevScrollLeft),n.current.prevScrollLeft=i.scrollLeft}}),[e,t,n]);return{trackScrollDirection:r,scrollDirectionRefs:{verticalScrollDirection:e,horizontalScrollDirection:t}}})(),b=(()=>{const{viewService:e}=JF();return h((t=>{const n=t.target,r=t.currentTarget,i=n.dataset.key;i===W$&&(e.leftGridScrollLeft=r.scrollLeft),i===$$&&(e.scrollLeft=r.scrollLeft),i===F$&&(e.topGridScrollTop=r.scrollTop),i!==W$&&i!==$$||(e.scrollTop=r.scrollTop)}),[e])})(),x={gridRefs:{topGridRef:o,leftGridRef:s,dataGridRef:l},getWrapperElements:h((()=>({headerGridWrapperElement:t.current,topGridWrapperElement:n.current,leftGridWrapperElement:r.current,dataGridWrapperElement:i.current})),[t,n,r,i]),updateViewService:b,trackScrollDirection:g,interactions:e};return(({gridRefs:{topGridRef:e,leftGridRef:t,dataGridRef:n},getWrapperElements:r,updateViewService:i,trackScrollDirection:o,interactions:a})=>{c((()=>{const{headerGridWrapperElement:i,topGridWrapperElement:s,leftGridWrapperElement:l,dataGridWrapperElement:c}=r(),u=e=>{i.scrollLeft+=e.deltaX,i.scrollTop+=e.deltaY,l.scrollLeft=i.scrollLeft,s.scrollTop=i.scrollTop,o(e)},d=e=>{l.scrollTop+=e.deltaY,t.current?.forEach((e=>{e?.scrollTo(l.scrollTop)})),i.scrollLeft+=e.deltaX,l.scrollLeft=i.scrollLeft,c.scrollTop=l.scrollTop,n.current?.scrollTo({scrollTop:l.scrollTop}),o(e)},h=t=>{s.scrollLeft+=t.deltaX,e.current?.forEach((e=>{e?.scrollTo(s.scrollLeft)})),i.scrollTop+=t.deltaY,s.scrollTop=i.scrollTop,c.scrollLeft=s.scrollLeft,n.current?.scrollTo({scrollLeft:s.scrollLeft}),o(t)},p=r=>{c.scrollLeft+=r.deltaX,c.scrollTop+=r.deltaY,n.current?.scrollTo({scrollLeft:c.scrollLeft,scrollTop:c.scrollTop}),s.scrollLeft=c.scrollLeft,e.current?.forEach((e=>{e?.scrollTo(c.scrollLeft)})),l.scrollTop=c.scrollTop,t.current?.forEach((e=>{e?.scrollTo(c.scrollTop)})),o(r)};return i.addEventListener("wheel",u),l.addEventListener("wheel",d),s.addEventListener("wheel",h),c.addEventListener("wheel",p),a.scroll||setTimeout((()=>{i.removeEventListener("wheel",u),l.removeEventListener("wheel",d),s.removeEventListener("wheel",h),c.removeEventListener("wheel",p)}),0),()=>{i.removeEventListener("wheel",u),l.removeEventListener("wheel",d),s.removeEventListener("wheel",h),c.removeEventListener("wheel",p)}}),[o,i,a,e,t,n,r])})(x),V$(x),{gridSectionsWrapperRefs:{headerGridWrapperRef:t,topGridWrapperRef:n,leftGridWrapperRef:r,dataGridWrapperRef:i},gridRefs:{topGridRef:o,leftGridRef:s,dataGridRef:l},scrollDirectionRefs:{verticalScrollDirection:y,horizontalScrollDirection:v},scrollbarsDimensions:{verticalScrollbarWidth:u,horizontalScrollbarHeight:d,resetHorizontalScrollbarHeight:f}}},U$=()=>{const{layoutService:e}=JF(),{rect:t,pageInfo:n}=VF();return f((()=>{let{height:r}=t;return e.hasLimitedData&&(r-=22),n.shouldShowPagination&&(r-=41),{...t,height:r}}),[t,e,n.shouldShowPagination])},Y$=({children:e,style:t})=>Ji.jsx("div",{"data-testid":"fullSize",style:t,children:e}),K$=({children:e,style:t})=>{const{direction:n}=VF();return Ji.jsx("div",{"data-section-id":"GRID",style:{direction:n,display:"grid",...t},children:e})},X$=e=>e&&`scrollable-container--${e}`,J$=({children:e,style:t,origin:n},r)=>{const{interactions:i}=YF(),o=i.scroll?t:{overflow:"hidden"};return Ji.jsx("div",{"data-testid":"scrollable","data-key":X$(n),style:o,ref:r,children:e})};var Z$=t.forwardRef(J$);const Q$=({children:e,style:t})=>{const{direction:n}=VF();return Ji.jsx("div",{"data-testid":"sticky",style:{position:"sticky",top:0,["rtl"===n?"right":"left"]:0,...t},children:e})};function eB(){return eB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eB.apply(null,arguments)}function tB(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nB(e,t){return nB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},nB(e,t)}function rB(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,nB(e,t)}var iB=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function oB(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(r=e[n],i=t[n],!(r===i||iB(r)&&iB(i)))return!1;var r,i;return!0}function aB(e,t){var n;void 0===t&&(t=oB);var r,i=[],o=!1;return function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return o&&n===this&&t(a,i)||(r=e.apply(this,a),o=!0,n=this,i=a),r}}function sB(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}var lB="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function cB(e){cancelAnimationFrame(e.id)}function uB(e,t){var n=lB();var r={id:requestAnimationFrame((function i(){lB()-n>=t?e.call(null):r.id=requestAnimationFrame(i)}))};return r}var dB=-1;function hB(e){if(void 0===e&&(e=!1),-1===dB||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),dB=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return dB}var pB=null;function fB(e){if(void 0===e&&(e=!1),null===pB||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;return i.width="100px",i.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?pB="positive-descending":(t.scrollLeft=1,pB=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),pB}return pB}var mB=function(e){var t=e.columnIndex;return e.data,e.rowIndex+":"+t};function gB(e){var t,r=e.getColumnOffset,i=e.getColumnStartIndexForOffset,o=e.getColumnStopIndexForStartIndex,a=e.getColumnWidth,s=e.getEstimatedTotalHeight,l=e.getEstimatedTotalWidth,c=e.getOffsetForColumnAndAlignment,u=e.getOffsetForRowAndAlignment,d=e.getRowHeight,h=e.getRowOffset,p=e.getRowStartIndexForOffset,f=e.getRowStopIndexForStartIndex,m=e.initInstanceProps,g=e.shouldResetStyleCacheOnItemSizeChange,y=e.validateProps;return t=function(e){function t(t){var n;return(n=e.call(this,t)||this)._instanceProps=m(n.props,tB(n)),n._resetIsScrollingTimeoutId=null,n._outerRef=void 0,n.state={instance:tB(n),isScrolling:!1,horizontalScrollDirection:"forward",scrollLeft:"number"==typeof n.props.initialScrollLeft?n.props.initialScrollLeft:0,scrollTop:"number"==typeof n.props.initialScrollTop?n.props.initialScrollTop:0,scrollUpdateWasRequested:!1,verticalScrollDirection:"forward"},n._callOnItemsRendered=void 0,n._callOnItemsRendered=aB((function(e,t,r,i,o,a,s,l){return n.props.onItemsRendered({overscanColumnStartIndex:e,overscanColumnStopIndex:t,overscanRowStartIndex:r,overscanRowStopIndex:i,visibleColumnStartIndex:o,visibleColumnStopIndex:a,visibleRowStartIndex:s,visibleRowStopIndex:l})})),n._callOnScroll=void 0,n._callOnScroll=aB((function(e,t,r,i,o){return n.props.onScroll({horizontalScrollDirection:r,scrollLeft:e,scrollTop:t,verticalScrollDirection:i,scrollUpdateWasRequested:o})})),n._getItemStyle=void 0,n._getItemStyle=function(e,t){var i,o=n.props,s=o.columnWidth,l=o.direction,c=o.rowHeight,u=n._getItemStyleCache(g&&s,g&&l,g&&c),p=e+":"+t;if(u.hasOwnProperty(p))i=u[p];else{var f=r(n.props,t,n._instanceProps),m="rtl"===l;u[p]=i={position:"absolute",left:m?void 0:f,right:m?f:void 0,top:h(n.props,e,n._instanceProps),height:d(n.props,e,n._instanceProps),width:a(n.props,t,n._instanceProps)}}return i},n._getItemStyleCache=void 0,n._getItemStyleCache=aB((function(e,t,n){return{}})),n._onScroll=function(e){var t=e.currentTarget,r=t.clientHeight,i=t.clientWidth,o=t.scrollLeft,a=t.scrollTop,s=t.scrollHeight,l=t.scrollWidth;n.setState((function(e){if(e.scrollLeft===o&&e.scrollTop===a)return null;var t=n.props.direction,c=o;if("rtl"===t)switch(fB()){case"negative":c=-o;break;case"positive-descending":c=l-i-o}c=Math.max(0,Math.min(c,l-i));var u=Math.max(0,Math.min(a,s-r));return{isScrolling:!0,horizontalScrollDirection:e.scrollLeft<o?"forward":"backward",scrollLeft:c,scrollTop:u,verticalScrollDirection:e.scrollTop<a?"forward":"backward",scrollUpdateWasRequested:!1}}),n._resetIsScrollingDebounced)},n._outerRefSetter=function(e){var t=n.props.outerRef;n._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},n._resetIsScrollingDebounced=function(){null!==n._resetIsScrollingTimeoutId&&cB(n._resetIsScrollingTimeoutId),n._resetIsScrollingTimeoutId=uB(n._resetIsScrolling,150)},n._resetIsScrolling=function(){n._resetIsScrollingTimeoutId=null,n.setState({isScrolling:!1},(function(){n._getItemStyleCache(-1)}))},n}rB(t,e),t.getDerivedStateFromProps=function(e,t){return yB(e,t),y(e),null};var v=t.prototype;return v.scrollTo=function(e){var t=e.scrollLeft,n=e.scrollTop;void 0!==t&&(t=Math.max(0,t)),void 0!==n&&(n=Math.max(0,n)),this.setState((function(e){return void 0===t&&(t=e.scrollLeft),void 0===n&&(n=e.scrollTop),e.scrollLeft===t&&e.scrollTop===n?null:{horizontalScrollDirection:e.scrollLeft<t?"forward":"backward",scrollLeft:t,scrollTop:n,scrollUpdateWasRequested:!0,verticalScrollDirection:e.scrollTop<n?"forward":"backward"}}),this._resetIsScrollingDebounced)},v.scrollToItem=function(e){var t=e.align,n=void 0===t?"auto":t,r=e.columnIndex,i=e.rowIndex,o=this.props,a=o.columnCount,d=o.height,h=o.rowCount,p=o.width,f=this.state,m=f.scrollLeft,g=f.scrollTop,y=hB();void 0!==r&&(r=Math.max(0,Math.min(r,a-1))),void 0!==i&&(i=Math.max(0,Math.min(i,h-1)));var v=s(this.props,this._instanceProps),b=l(this.props,this._instanceProps)>p?y:0,x=v>d?y:0;this.scrollTo({scrollLeft:void 0!==r?c(this.props,r,n,m,this._instanceProps,x):m,scrollTop:void 0!==i?u(this.props,i,n,g,this._instanceProps,b):g})},v.componentDidMount=function(){var e=this.props,t=e.initialScrollLeft,n=e.initialScrollTop;if(null!=this._outerRef){var r=this._outerRef;"number"==typeof t&&(r.scrollLeft=t),"number"==typeof n&&(r.scrollTop=n)}this._callPropsCallbacks()},v.componentDidUpdate=function(){var e=this.props.direction,t=this.state,n=t.scrollLeft,r=t.scrollTop;if(t.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("rtl"===e)switch(fB()){case"negative":i.scrollLeft=-n;break;case"positive-ascending":i.scrollLeft=n;break;default:var o=i.clientWidth,a=i.scrollWidth;i.scrollLeft=a-o-n}else i.scrollLeft=Math.max(0,n);i.scrollTop=Math.max(0,r)}this._callPropsCallbacks()},v.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&cB(this._resetIsScrollingTimeoutId)},v.render=function(){var e=this.props,t=e.children,r=e.className,i=e.columnCount,o=e.direction,a=e.height,c=e.innerRef,u=e.innerElementType,d=e.innerTagName,h=e.itemData,p=e.itemKey,f=void 0===p?mB:p,m=e.outerElementType,g=e.outerTagName,y=e.rowCount,v=e.style,b=e.useIsScrolling,x=e.width,w=this.state.isScrolling,S=this._getHorizontalRangeToRender(),C=S[0],M=S[1],k=this._getVerticalRangeToRender(),E=k[0],_=k[1],R=[];if(i>0&&y)for(var I=E;I<=_;I++)for(var D=C;D<=M;D++)R.push(n(t,{columnIndex:D,data:h,isScrolling:b?w:void 0,key:f({columnIndex:D,data:h,rowIndex:I}),rowIndex:I,style:this._getItemStyle(I,D)}));var A=s(this.props,this._instanceProps),P=l(this.props,this._instanceProps);return n(m||g||"div",{className:r,onScroll:this._onScroll,ref:this._outerRefSetter,style:eB({position:"relative",height:a,width:x,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},v)},n(u||d||"div",{children:R,ref:c,style:{height:A,pointerEvents:w?"none":void 0,width:P}}))},v._callPropsCallbacks=function(){var e=this.props,t=e.columnCount,n=e.onItemsRendered,r=e.onScroll,i=e.rowCount;if("function"==typeof n&&t>0&&i>0){var o=this._getHorizontalRangeToRender(),a=o[0],s=o[1],l=o[2],c=o[3],u=this._getVerticalRangeToRender(),d=u[0],h=u[1],p=u[2],f=u[3];this._callOnItemsRendered(a,s,d,h,l,c,p,f)}if("function"==typeof r){var m=this.state,g=m.horizontalScrollDirection,y=m.scrollLeft,v=m.scrollTop,b=m.scrollUpdateWasRequested,x=m.verticalScrollDirection;this._callOnScroll(y,v,g,x,b)}},v._getHorizontalRangeToRender=function(){var e=this.props,t=e.columnCount,n=e.overscanColumnCount,r=e.overscanColumnsCount,a=e.overscanCount,s=e.rowCount,l=this.state,c=l.horizontalScrollDirection,u=l.isScrolling,d=l.scrollLeft,h=n||r||a||1;if(0===t||0===s)return[0,0,0,0];var p=i(this.props,d,this._instanceProps),f=o(this.props,p,d,this._instanceProps),m=u&&"backward"!==c?1:Math.max(1,h),g=u&&"forward"!==c?1:Math.max(1,h);return[Math.max(0,p-m),Math.max(0,Math.min(t-1,f+g)),p,f]},v._getVerticalRangeToRender=function(){var e=this.props,t=e.columnCount,n=e.overscanCount,r=e.overscanRowCount,i=e.overscanRowsCount,o=e.rowCount,a=this.state,s=a.isScrolling,l=a.verticalScrollDirection,c=a.scrollTop,u=r||i||n||1;if(0===t||0===o)return[0,0,0,0];var d=p(this.props,c,this._instanceProps),h=f(this.props,d,c,this._instanceProps),m=s&&"backward"!==l?1:Math.max(1,u),g=s&&"forward"!==l?1:Math.max(1,u);return[Math.max(0,d-m),Math.max(0,Math.min(o-1,h+g)),d,h]},t}(w),t.defaultProps={direction:"ltr",itemData:void 0,useIsScrolling:!1},t}var yB=function(e,t){e.children,e.direction,e.height,e.innerTagName,e.outerTagName,e.overscanColumnsCount,e.overscanCount,e.overscanRowsCount,e.width,t.instance},vB=function(e,t){var n=e.rowCount,r=t.rowMetadataMap,i=t.estimatedRowHeight,o=t.lastMeasuredRowIndex,a=0;if(o>=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},bB=function(e,t){var n=e.columnCount,r=t.columnMetadataMap,i=t.estimatedColumnWidth,o=t.lastMeasuredColumnIndex,a=0;if(o>=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},xB=function(e,t,n,r){var i,o,a;if("column"===e?(i=r.columnMetadataMap,o=t.columnWidth,a=r.lastMeasuredColumnIndex):(i=r.rowMetadataMap,o=t.rowHeight,a=r.lastMeasuredRowIndex),n>a){var s=0;if(a>=0){var l=i[a];s=l.offset+l.size}for(var c=a+1;c<=n;c++){var u=o(c);i[c]={offset:s,size:u},s+=u}"column"===e?r.lastMeasuredColumnIndex=n:r.lastMeasuredRowIndex=n}return i[n]},wB=function(e,t,n,r){var i,o;return"column"===e?(i=n.columnMetadataMap,o=n.lastMeasuredColumnIndex):(i=n.rowMetadataMap,o=n.lastMeasuredRowIndex),(o>0?i[o].offset:0)>=r?SB(e,t,n,o,0,r):CB(e,t,n,Math.max(0,o),r)},SB=function(e,t,n,r,i,o){for(;i<=r;){var a=i+Math.floor((r-i)/2),s=xB(e,t,a,n).offset;if(s===o)return a;s<o?i=a+1:s>o&&(r=a-1)}return i>0?i-1:0},CB=function(e,t,n,r,i){for(var o="column"===e?t.columnCount:t.rowCount,a=1;r<o&&xB(e,t,r,n).offset<i;)r+=a,a*=2;return SB(e,t,n,Math.min(r,o-1),Math.floor(r/2),i)},MB=function(e,t,n,r,i,o,a){var s="column"===e?t.width:t.height,l=xB(e,t,n,o),c="column"===e?bB(t,o):vB(t,o),u=Math.max(0,Math.min(c-s,l.offset)),d=Math.max(0,l.offset-s+a+l.size);switch("smart"===r&&(r=i>=d-s&&i<=u+s?"auto":"center"),r){case"start":return u;case"end":return d;case"center":return Math.round(d+(u-d)/2);default:return i>=d&&i<=u?i:d>u||i<d?d:u}},kB=gB({getColumnOffset:function(e,t,n){return xB("column",e,t,n).offset},getColumnStartIndexForOffset:function(e,t,n){return wB("column",e,n,t)},getColumnStopIndexForStartIndex:function(e,t,n,r){for(var i=e.columnCount,o=e.width,a=xB("column",e,t,r),s=n+o,l=a.offset+a.size,c=t;c<i-1&&l<s;)c++,l+=xB("column",e,c,r).size;return c},getColumnWidth:function(e,t,n){return n.columnMetadataMap[t].size},getEstimatedTotalHeight:vB,getEstimatedTotalWidth:bB,getOffsetForColumnAndAlignment:function(e,t,n,r,i,o){return MB("column",e,t,n,r,i,o)},getOffsetForRowAndAlignment:function(e,t,n,r,i,o){return MB("row",e,t,n,r,i,o)},getRowOffset:function(e,t,n){return xB("row",e,t,n).offset},getRowHeight:function(e,t,n){return n.rowMetadataMap[t].size},getRowStartIndexForOffset:function(e,t,n){return wB("row",e,n,t)},getRowStopIndexForStartIndex:function(e,t,n,r){for(var i=e.rowCount,o=e.height,a=xB("row",e,t,r),s=n+o,l=a.offset+a.size,c=t;c<i-1&&l<s;)c++,l+=xB("row",e,c,r).size;return c},initInstanceProps:function(e,t){var n=e,r={columnMetadataMap:{},estimatedColumnWidth:n.estimatedColumnWidth||50,estimatedRowHeight:n.estimatedRowHeight||50,lastMeasuredColumnIndex:-1,lastMeasuredRowIndex:-1,rowMetadataMap:{}};return t.resetAfterColumnIndex=function(e,n){void 0===n&&(n=!0),t.resetAfterIndices({columnIndex:e,shouldForceUpdate:n})},t.resetAfterRowIndex=function(e,n){void 0===n&&(n=!0),t.resetAfterIndices({rowIndex:e,shouldForceUpdate:n})},t.resetAfterIndices=function(e){var n=e.columnIndex,i=e.rowIndex,o=e.shouldForceUpdate,a=void 0===o||o;"number"==typeof n&&(r.lastMeasuredColumnIndex=Math.min(r.lastMeasuredColumnIndex,n-1)),"number"==typeof i&&(r.lastMeasuredRowIndex=Math.min(r.lastMeasuredRowIndex,i-1)),t._getItemStyleCache(-1),a&&t.forceUpdate()},r},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.columnWidth,e.rowHeight}}),EB=function(e,t){return e};function _B(e){var t,r=e.getItemOffset,i=e.getEstimatedTotalSize,o=e.getItemSize,a=e.getOffsetForIndexAndAlignment,s=e.getStartIndexForOffset,l=e.getStopIndexForStartIndex,c=e.initInstanceProps,u=e.shouldResetStyleCacheOnItemSizeChange,d=e.validateProps;return t=function(e){function t(t){var n;return(n=e.call(this,t)||this)._instanceProps=c(n.props,tB(n)),n._outerRef=void 0,n._resetIsScrollingTimeoutId=null,n.state={instance:tB(n),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof n.props.initialScrollOffset?n.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},n._callOnItemsRendered=void 0,n._callOnItemsRendered=aB((function(e,t,r,i){return n.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:r,visibleStopIndex:i})})),n._callOnScroll=void 0,n._callOnScroll=aB((function(e,t,r){return n.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:r})})),n._getItemStyle=void 0,n._getItemStyle=function(e){var t,i=n.props,a=i.direction,s=i.itemSize,l=i.layout,c=n._getItemStyleCache(u&&s,u&&l,u&&a);if(c.hasOwnProperty(e))t=c[e];else{var d=r(n.props,e,n._instanceProps),h=o(n.props,e,n._instanceProps),p="horizontal"===a||"horizontal"===l,f="rtl"===a,m=p?d:0;c[e]=t={position:"absolute",left:f?void 0:m,right:f?m:void 0,top:p?0:d,height:p?"100%":h,width:p?h:"100%"}}return t},n._getItemStyleCache=void 0,n._getItemStyleCache=aB((function(e,t,n){return{}})),n._onScrollHorizontal=function(e){var t=e.currentTarget,r=t.clientWidth,i=t.scrollLeft,o=t.scrollWidth;n.setState((function(e){if(e.scrollOffset===i)return null;var t=n.props.direction,a=i;if("rtl"===t)switch(fB()){case"negative":a=-i;break;case"positive-descending":a=o-r-i}return a=Math.max(0,Math.min(a,o-r)),{isScrolling:!0,scrollDirection:e.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!1}}),n._resetIsScrollingDebounced)},n._onScrollVertical=function(e){var t=e.currentTarget,r=t.clientHeight,i=t.scrollHeight,o=t.scrollTop;n.setState((function(e){if(e.scrollOffset===o)return null;var t=Math.max(0,Math.min(o,i-r));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}}),n._resetIsScrollingDebounced)},n._outerRefSetter=function(e){var t=n.props.outerRef;n._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},n._resetIsScrollingDebounced=function(){null!==n._resetIsScrollingTimeoutId&&cB(n._resetIsScrollingTimeoutId),n._resetIsScrollingTimeoutId=uB(n._resetIsScrolling,150)},n._resetIsScrolling=function(){n._resetIsScrollingTimeoutId=null,n.setState({isScrolling:!1},(function(){n._getItemStyleCache(-1,null)}))},n}rB(t,e),t.getDerivedStateFromProps=function(e,t){return RB(e,t),d(e),null};var h=t.prototype;return h.scrollTo=function(e){e=Math.max(0,e),this.setState((function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}}),this._resetIsScrollingDebounced)},h.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,i=n.layout,o=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var s=0;if(this._outerRef){var l=this._outerRef;s="vertical"===i?l.scrollWidth>l.clientWidth?hB():0:l.scrollHeight>l.clientHeight?hB():0}this.scrollTo(a(this.props,e,t,o,this._instanceProps,s))},h.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var i=this._outerRef;"horizontal"===t||"horizontal"===r?i.scrollLeft=n:i.scrollTop=n}this._callPropsCallbacks()},h.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,i=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("horizontal"===t||"horizontal"===n)if("rtl"===t)switch(fB()){case"negative":o.scrollLeft=-i;break;case"positive-ascending":o.scrollLeft=i;break;default:var a=o.clientWidth,s=o.scrollWidth;o.scrollLeft=s-a-i}else o.scrollLeft=i;else o.scrollTop=i}this._callPropsCallbacks()},h.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&cB(this._resetIsScrollingTimeoutId)},h.render=function(){var e=this.props,t=e.children,r=e.className,o=e.direction,a=e.height,s=e.innerRef,l=e.innerElementType,c=e.innerTagName,u=e.itemCount,d=e.itemData,h=e.itemKey,p=void 0===h?EB:h,f=e.layout,m=e.outerElementType,g=e.outerTagName,y=e.style,v=e.useIsScrolling,b=e.width,x=this.state.isScrolling,w="horizontal"===o||"horizontal"===f,S=w?this._onScrollHorizontal:this._onScrollVertical,C=this._getRangeToRender(),M=C[0],k=C[1],E=[];if(u>0)for(var _=M;_<=k;_++)E.push(n(t,{data:d,key:p(_,d),index:_,isScrolling:v?x:void 0,style:this._getItemStyle(_)}));var R=i(this.props,this._instanceProps);return n(m||g||"div",{className:r,onScroll:S,ref:this._outerRefSetter,style:eB({position:"relative",height:a,width:b,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},y)},n(l||c||"div",{children:E,ref:s,style:{height:w?"100%":R,pointerEvents:x?"none":void 0,width:w?R:"100%"}}))},h._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],i=e[3];this._callOnItemsRendered(t,n,r,i)}if("function"==typeof this.props.onScroll){var o=this.state,a=o.scrollDirection,s=o.scrollOffset,l=o.scrollUpdateWasRequested;this._callOnScroll(a,s,l)}},h._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,i=r.isScrolling,o=r.scrollDirection,a=r.scrollOffset;if(0===t)return[0,0,0,0];var c=s(this.props,a,this._instanceProps),u=l(this.props,c,a,this._instanceProps),d=i&&"backward"!==o?1:Math.max(1,n),h=i&&"forward"!==o?1:Math.max(1,n);return[Math.max(0,c-d),Math.max(0,Math.min(t-1,u+h)),c,u]},t}(w),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var RB=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},IB=function(e,t,n){var r=e.itemSize,i=n.itemMetadataMap,o=n.lastMeasuredIndex;if(t>o){var a=0;if(o>=0){var s=i[o];a=s.offset+s.size}for(var l=o+1;l<=t;l++){var c=r(l);i[l]={offset:a,size:c},a+=c}n.lastMeasuredIndex=t}return i[t]},DB=function(e,t,n,r,i){for(;r<=n;){var o=r+Math.floor((n-r)/2),a=IB(e,o,t).offset;if(a===i)return o;a<i?r=o+1:a>i&&(n=o-1)}return r>0?r-1:0},AB=function(e,t,n,r){for(var i=e.itemCount,o=1;n<i&&IB(e,n,t).offset<r;)n+=o,o*=2;return DB(e,t,Math.min(n,i-1),Math.floor(n/2),r)},PB=function(e,t){var n=e.itemCount,r=t.itemMetadataMap,i=t.estimatedItemSize,o=t.lastMeasuredIndex,a=0;if(o>=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},OB=_B({getItemOffset:function(e,t,n){return IB(e,t,n).offset},getItemSize:function(e,t,n){return n.itemMetadataMap[t].size},getEstimatedTotalSize:PB,getOffsetForIndexAndAlignment:function(e,t,n,r,i,o){var a=e.direction,s=e.height,l=e.layout,c=e.width,u="horizontal"===a||"horizontal"===l?c:s,d=IB(e,t,i),h=PB(e,i),p=Math.max(0,Math.min(h-u,d.offset)),f=Math.max(0,d.offset-u+d.size+o);switch("smart"===n&&(n=r>=f-u&&r<=p+u?"auto":"center"),n){case"start":return p;case"end":return f;case"center":return Math.round(f+(p-f)/2);default:return r>=f&&r<=p?r:r<f?f:p}},getStartIndexForOffset:function(e,t,n){return function(e,t,n){var r=t.itemMetadataMap,i=t.lastMeasuredIndex;return(i>0?r[i].offset:0)>=n?DB(e,t,i,0,n):AB(e,t,Math.max(0,i),n)}(e,n,t)},getStopIndexForStartIndex:function(e,t,n,r){for(var i=e.direction,o=e.height,a=e.itemCount,s=e.layout,l=e.width,c="horizontal"===i||"horizontal"===s?l:o,u=IB(e,t,r),d=n+c,h=u.offset+u.size,p=t;p<a-1&&h<d;)p++,h+=IB(e,p,r).size;return p},initInstanceProps:function(e,t){var n={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,r){void 0===r&&(r=!0),n.lastMeasuredIndex=Math.min(n.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),r&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.itemSize}});function TB(e,t){for(var n in e)if(!(n in t))return!0;for(var r in t)if(e[r]!==t[r])return!0;return!1}var LB=["style"],qB=["style"];function NB(e,t){var n=e.style,r=sB(e,LB),i=t.style,o=sB(t,qB);return!TB(n,i)&&!TB(r,o)}const jB=10,zB=(e,t)=>e.current===lj.Backward?t:0,FB=(e,t,n,r)=>{for(let i=n;i<n+r;i++){const n=e.at(i);if(void 0===n||void 0===n.at(t))return!0}return!1},WB=(e,t)=>e.qLeft+e.qWidth===t.qLeft&&e.qTop===t.qTop&&e.qHeight===t.qHeight,$B=({pageInfo:e,measureData:t,pageTop:n,qHeight:r,startLeft:i,endLeft:o})=>{const a=[],s=e.page*e.rowsPerPage;for(let e=i;e<o;e++)if(FB(t,e,n,r)){const t=a[a.length-1],i={qLeft:e,qTop:n+s,qWidth:1,qHeight:r};void 0!==t&&WB(t,i)?t.qWidth+=i.qWidth:a.push(i)}return a},BB=({pageInfo:e,measureData:t,scrollDirection:n,viewService:r,minBufferStartLeft:i,minBufferEndLeft:o,columnEndIndex:a})=>{const{gridRowStartIndex:s,gridHeight:l}=r,c=n.current===lj.Backward?Math.max(0,i-25):o,u=Math.min(c+25,a);return $B({pageInfo:e,measureData:t,startLeft:c,endLeft:u,pageTop:s,qHeight:l})},HB=({pageInfo:e,measureData:t,scrollDirection:n,layoutService:r,viewService:i})=>{const{startLeft:o,endLeft:a,pageTop:s,qHeight:l}=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:a}=t,s=e.size.x,l=zB(n,jB),c=Math.max(r-l,0);return{startLeft:c,endLeft:c+Math.min(o+jB,s-c),pageTop:i,qHeight:a}})(r,i,n),c=$B({pageInfo:e,measureData:t,startLeft:o,endLeft:a,pageTop:s,qHeight:l});return c.length>0?[...c,...BB({pageInfo:e,measureData:t,scrollDirection:n,viewService:i,minBufferStartLeft:o,minBufferEndLeft:a,columnEndIndex:r.size.x})]:c},VB=(e,t,n,r)=>{const i=e[n];if(void 0===i)return!0;for(let e=t;e<t+r;e++){if(void 0===i[e])return!0}return!1},GB=(e,t)=>e.qTop+e.qHeight===t.qTop&&e.qLeft===t.qLeft&&e.qWidth===t.qWidth,UB=({startTop:e,endTop:t,qLeft:n,qWidth:r,measureData:i,pageInfo:o})=>{const a=[],s=o.page*o.rowsPerPage;for(let o=e;o<t;o++)if(VB(i,n,o,r)){const e=a.at(-1),t={qLeft:n,qTop:o+s,qWidth:r,qHeight:1};void 0!==e&&GB(e,t)?e.qHeight+=t.qHeight:a.push(t)}return a},YB=({pageInfo:e,measureData:t,scrollDirection:n,viewService:r})=>{const{startTop:i,endTop:o,qLeft:a,qWidth:s}=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:a}=t,s=zB(n,jB),l=Math.max(i-s,0);return{startTop:l,endTop:l+Math.min(a+jB,e.rowsOnCurrentPage-l),qLeft:r,qWidth:o}})(e,r,n),l=UB({startTop:i,endTop:o,qLeft:a,qWidth:s,measureData:t,pageInfo:e});if(l.length>0){const r=n.current===lj.Backward?Math.max(0,i-25):o,c=Math.min(r+25,e.rowsOnCurrentPage),u=UB({startTop:r,endTop:c,qLeft:a,qWidth:s,measureData:t,pageInfo:e});return[...l,...u]}return l},KB=async(e,t,n,r,i,o,a,s)=>{const{gridColumnStartIndex:l,gridRowStartIndex:c,gridWidth:u,gridHeight:d}=i;let h=[],p=[];o.current!==lj.None&&(h=YB({pageInfo:r,measureData:n,scrollDirection:o,viewService:i})),a.current!==lj.None&&(p=HB({pageInfo:r,measureData:n,scrollDirection:a,layoutService:t,viewService:i})),o.current===lj.None&&a.current===lj.None&&(h=UB({measureData:n,pageInfo:r,qLeft:l,qWidth:u,startTop:c,endTop:c+d}));const f=e.fetchPages([...h,...p]);s.isDownloadedAsPDForImage&&s.waitForPromise(f)},XB=function(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,o=0;return function(){t=this;for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];n=s;var c=Date.now()-o,u=function(){o=Date.now(),r=0,e.apply(t,n)};r||(c>=i?u():r=setTimeout(u,i-c))}}(KB,100),JB=LN(KB,75),ZB=(e,t,n=!1)=>void 0!==e&&(e.isLeafNode||n&&e.isLeftColumn?e.mainAxisPageCoord===t:e.mainAxisPageCoord+e.leafCount-1===t),QB=({style:e,index:t,isLastRow:n,isLastColumn:r,showLastBorder:i,isLeftColumn:o,showTotalCellDivider:a})=>{const{direction:s}=VF(),{styleService:{grid:{border:l,divider:c}}}=JF();return Ji.jsx("div",{style:{...e,...$j,...Gj(n,r,l,s,i),...Yj({bottomDivider:a&&o,rightDivider:a&&!o,borderColor:c})},"data-testid":"empty-cell","data-index":t})},eH=({children:e,verticalAlign:t,width:n,right:r,isLeftColumn:i})=>{const{layoutService:{isIndentModeEnabled:o}}=JF(),a=i&&o;return Ji.jsx("div",{"data-key":"sticky-cell-container",style:{display:"flex",flexDirection:"row",width:n,maxWidth:"100%",maxHeight:"100%",position:"sticky",left:4,top:0,bottom:0,right:r,...!a&&{alignItems:t,alignSelf:t,overflow:"hidden"}},children:e})},tH=e=>{const{type:t,imageSize:n}=e;return t!==ZN.Image||"fill"!==n&&"fitWidth"!==n?"fit-content":"100%"},nH=e=>"number"==typeof e&&!Number.isNaN(+e),rH=e=>"string"==typeof e&&e.length>0||"number"==typeof e?+e:NaN,iH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 16 16",height:"16px",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M7.5 8.5H2v-1h5.5V2h1v5.5H14v1H8.5V14h-1z"})}))),oH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M8 0c4.4 0 8 3.6 8 8s-3.6 8-8 8-8-3.6-8-8 3.6-8 8-8"})}))),aH=v(((e,t)=>Ji.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:[Ji.jsx("path",{d:"M3 9v6.5a.5.5 0 1 1-1 0V.5a.5.5 0 0 1 1 0V1q2.441.639 3.667.639c1.225 0 1.774-.995 3.87-1.196q1.972-.19 3.297.47A.3.3 0 0 1 14 1.18v7.344a.3.3 0 0 1-.417.277q-1.338-.565-3.045-.416c-1.98.172-2.083 1.107-3.871 1.253Q4.879 9.785 3 9"}),Ji.jsx("use",{fillRule:"evenodd"})]}))),sH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M13.9 7.4c-1 1.3-.6 1.5-1.5 4.1-.5 1.8-1.2 2.9-1.7 3.6q-.45.6-.9.9H4.2c-1 0-1.6-.5-1.9-1-.2-.3-.3-.6-.3-1V4.2c0-.4.3-.7.7-.7s.7.3.7.7v3.6l.9-.1V1.6c0-.4.3-.7.7-.7s.7.3.7.7v5.1l1.1-.2V.7C6.7.3 7 0 7.4 0s.7.3.7.7v5.9l1.1.1V1.6c0-.4.3-.7.7-.7s.7.3.7.7v7.7s.1 0 .1-.2l.6-1.4c1.1-2.1 3.1-1.1 2.6-.3"})}))),lH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M5 13h6v1.5c0 .3-.2.5-.5.5H10v.5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5V15h-.5c-.3 0-.5-.2-.5-.5zm0-1c0-2-3-3-3-7 0-3 3-5 6-5s6 2 6 5c0 4-3 4-3 7H5m-.5-7c.3 0 .5-.2.5-.5s.2-.7.5-1 .6-.5 1-.5c.3 0 .5-.2.5-.5S6.8 2 6.5 2c-.6 0-1.2.3-1.7.8S4 3.9 4 4.5c0 .3.2.5.5.5"})}))),cH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M8 0c4.4 0 8 3.6 8 8s-3.6 8-8 8-8-3.6-8-8 3.6-8 8-8m4.5 9c.25 0 .5-.3.5-.6v-.8c0-.3-.25-.6-.5-.6h-9c-.25 0-.5.3-.5.6v.7c0 .4.25.7.5.7z"})}))),uH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M2 7h12v2H2z"})}))),dH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M9 7h7a7.004 7.004 0 0 0-7-7zm1-5.917A6.005 6.005 0 0 1 14.917 6H10zM14 9H7V2a7.002 7.002 0 0 0 0 14 7 7 0 0 0 7-7m-8 1h6.917A6.002 6.002 0 0 1 1 9a6 6 0 0 1 5-5.917z"})}))),hH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M9 9h3.5c.25 0 .5-.3.5-.6v-.8c0-.3-.25-.6-.5-.6H9V3.5c0-.25-.3-.5-.6-.5h-.7c-.4 0-.7.25-.7.5V7H3.5c-.25 0-.5.3-.5.6v.7c0 .4.25.7.5.7H7v3.5c0 .25.3.5.6.5h.8c.3 0 .6-.25.6-.5zM8 0c4.4 0 8 3.6 8 8s-3.6 8-8 8-8-3.6-8-8 3.6-8 8-8"})}))),pH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"m8.418 1.007.042.08 1.788 4.217 4.571.388a.5.5 0 0 1 .348.811l-.063.065-3.472 3.008 1.043 4.47a.5.5 0 0 1-.664.581l-.081-.04L8 12.217l-3.93 2.372a.5.5 0 0 1-.757-.453l.012-.089 1.043-4.47L.896 6.568a.5.5 0 0 1 .196-.86l.089-.016 4.571-.388L7.54 1.086a.5.5 0 0 1 .878-.08Z"})}))),fH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M13 14H3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1"})}))),mH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"m6 10 7-7 2 2-7 7-2 2-5-5 2-2z"})}))),gH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M2.4 4h11.2a.2.2 0 0 1 .16.32l-5.6 7.467a.2.2 0 0 1-.32 0L2.24 4.32A.2.2 0 0 1 2.4 4"})}))),yH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M11 2.4v11.2a.2.2 0 0 1-.32.16l-7.467-5.6a.2.2 0 0 1 0-.32l7.467-5.6a.2.2 0 0 1 .32.16"})}))),vH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M4 13.6V2.4a.2.2 0 0 1 .32-.16l7.467 5.6a.2.2 0 0 1 0 .32l-7.467 5.6A.2.2 0 0 1 4 13.6"})}))),bH={m:mH,"ï":pH,R:v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M13.6 11H2.4a.2.2 0 0 1-.16-.32l5.6-7.467a.2.2 0 0 1 .32 0l5.6 7.467a.2.2 0 0 1-.16.32"})}))),S:gH,T:yH,U:vH,P:hH,Q:cH,"è":v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M14.98 15H1.04c-1.002 0-1.303-.7-.802-1.5l6.82-11.9c.5-.8 1.303-.8 1.804 0l6.92 11.9c.501.8.1 1.5-.803 1.5M8.5 5h-1c-.3 0-.5.2-.5.5V9c0 .3.2.5.5.5h1c.3 0 .5-.2.5-.5V5.5c0-.3-.2-.5-.5-.5m-1 6c-.3 0-.5.2-.5.5v1c0 .3.2.5.5.5h1c.3 0 .5-.2.5-.5v-1c0-.3-.2-.5-.5-.5z"})}))),"¢":sH,"©":aH,"23F4":lH,2013:fH,"&":dH,add:iH,"minus-2":uH,dot:oH},xH=({size:e,iconKey:t,color:n,pvStyle:r})=>{const i=t&&bH[t];return i&&Ji.jsx("div",{"data-testid":"representation-indicator-icon",style:{color:n,height:e,...r},children:Ji.jsx(i,{style:{height:e}})})},wH=(e,t)=>e.max===e.min?.5:(t-e.min)/(e.max-e.min),SH=(e,t,n)=>{const r=e.paletteColors?e.paletteColors[t]:e.localPaletteColors[t];return n.getColorPickerColor(r)},CH=(e,t,n)=>{const r={previousColor:(i=e.localPaletteColors)[(o=t)-(o>0?1:0)],nextColor:i[o+(o<i.length-1?1:0)]};var i,o;const a=((e,t)=>{const n=e.limits&&e.limits.concat().sort(((e,t)=>e.value-t.value));return{lowerLimit:n&&t>0?n[t-1]:{value:0,gradient:!1},upperLimit:n&&n[t]?n[t]:{value:1,gradient:!1}}})(e,t),s=((e,t,n,r,i)=>{const{upperLimit:o,lowerLimit:a}=e,{previousColor:s,nextColor:l}=t,c=r===o.value?1:(r-a.value)/(o.value-a.value);return a.gradient&&o.gradient?r-a.value<o.value-r?{color:s.color,t:.5-c}:{color:l.color,t:c-.5}:a.gradient?{color:s.color,t:1-(.5+c/2)}:o.gradient?{color:l.color,t:c/2}:{color:i.localPaletteColors[n].color,t:r}})(a,r,t,n,e);return s&&gq(e.localPaletteColors[t].color).blend(gq(s.color),s.t)},MH=(e,t,n)=>{const r=((e,t)=>{const{limits:n}=e;return n&&(e.limits=n.sort(((e,t)=>e.value-t.value)),e.limits=n.map((e=>({...e,value:wH(t,e.value)})))),e})({...e},t),i=r.paletteColors||r.localPaletteColors;return i&&(r.localPaletteColors=i.concat().map(((e,t)=>({color:SH(r,t,n)})))),r},kH=(e,t,n,r)=>{const i=MH(e,n,r),{localPaletteColors:o}=i;if(t<=0)return o[0].color;if(t>=1)return o[o.length-1].color;const a=((e,t)=>{let n="",r=0;const{limits:i,localPaletteColors:o}=e;for(let a=0;a<o.length;a++){const o=i&&i[a]?i[a].value:1;if(t>=r&&t<o){n=CH(e,a,t);break}r=o}return n})(i,t);return a},EH=(e,t)=>{const n=(e=>e.map((e=>e.value??e)).sort(((e,t)=>e-t)))(e),r=n.some((e=>!nH(e)));return 0===n.length||r?(e=>{const t=0===e?0:.5*e;return{min:e-t,max:e+t}})(t):1===n.length?((e,t)=>{const n=e[0]-t;if(0===n||!nH(n)){const e=0===t?.5:Math.abs(.5*t);return{min:t-e,max:t+e}}return n>0?{min:t-.5*Math.abs(t),max:e[0]+2*n}:{min:e[0]+2*n,max:t+.5*Math.abs(t)}})(n,t):((e,t)=>{let n=e[e.length-1]-e[0];return n=n>0?n:1,{min:Math.min(t,e[0])-n/2,max:Math.max(t,e[e.length-1])+n/2}})(n,t)},_H=(e,t)=>{const{limits:n}=e.segments;if(!n)return;const r=((e,t)=>{const{min:n,max:r}=EH(e,t),i=Math.abs(t);return{min:n??t-i,max:r??t+i}})(n,t),i=((e,t,n)=>{const{limits:r,paletteColors:i,localPaletteColors:o}=e.segments;if(!r||!nH(t))return 0;let a=n&&nH(n)?Math.min(n,t):0;const s=r.sort(((e,t)=>e.value-t.value)),l=i||o;for(let e=0;e<l.length;e++){if(e===l.length-1||t<s[e].value&&t>=a)return e;a=s[e].value}return 0})(e,t,r.min);return{limitRange:r,limitPaletteColorIndex:i}},RH=e=>"flex-start"===e?"flex-end":"flex-start",IH=(e,t,n,r)=>{const i=e.indicatorConditionalColoring;if(!i)return;const o=_H(i,t),a=((e,t,n,r)=>{const{segments:i}=e;if(!i||!n)return;const{limits:o}=i;if(!o?.length||!((e,t)=>!(!e||0===e.length||!(e[t]?.gradient??e[t-1]?.gradient)))(o,n.limitPaletteColorIndex))return SH(i,n.limitPaletteColorIndex,r);const a=wH(n.limitRange,t);return kH(i,a,n.limitRange,r)})(i,t,o,r),s=i.segments.paletteColors[o?.limitPaletteColorIndex||0].icon,{indicator:l}=e;let c=l?.position||"right";return"rtl"===n&&(c="right"===c?"left":"right"),{color:a,iconKey:s,position:c}},DH=({representation:e,cellValue:t,textStyle:n})=>{const{styleService:r}=JF(),{theme:i}=YF(),{direction:o}=VF(),{text:a,indicator:s}=e,{showTextValues:l,applySegmentColors:c}=s??{},u=IH(e,t,o,i),{fontSize:d,fontFamily:h,fontStyle:p,fontWeight:f,textDecoration:m}=r.measureValues,g={fontSize:d,fontFamily:h,fontStyle:p,fontWeight:f,textDecoration:m},y=parseInt(d||Oj,10),{iconKey:v,color:b,position:x}=u||{},w={display:"flex",paddingTop:2};return l?Ji.jsxs("div",{"data-key":"representation-indicator",style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"4px",overflow:n?.overflow,color:c?b:n?.color},children:["left"===x&&xH({size:y,iconKey:v,color:b,pvStyle:w}),Ji.jsx("span",{style:{paddingTop:4,overflow:n?.overflow,textOverflow:n?.textOverflow,whiteSpace:"nowrap",direction:t<0?"ltr":void 0,...g},children:a}),"right"===x&&xH({size:y,iconKey:v,color:b,pvStyle:w})]}):(w.paddingTop=5,xH({size:y,iconKey:v,color:b,pvStyle:w}))},AH=e=>!!e.target?.getAttribute("class")?.includes(ET),PH=(e,t)=>{switch(t.type){case"clearSelections":return{engineSelectedCells:null,activeSelection:null,selectedField:null};case"mouseup":return{...e,activeSelection:null,engineSelectedCells:t.payload.engineSelectedCells};case"mousedown":return{...e,activeSelection:t.payload.activeSelection,selectedField:t.payload.selectedField};case"mouseover":{if(!e.activeSelection)return e;const{index:n}=t.payload,r=Math.min(n,e.activeSelection.startIndex),i=Math.max(n,e.activeSelection.endIndex);if(r===e.activeSelection.startIndex&&i===e.activeSelection.endIndex)return e;const o={...e.activeSelection,startIndex:r,endIndex:i};return o.clientSelectedCells=(e=>{const{getCellFromIndex:t,startIndex:n,endIndex:r,clientSelectedCells:i}=e,o=new Map(i);for(let e=n;e<=r;e++){const n=t(e);"N"===n?.ref.qType&&o.set(n.ref.qElemNo,n)}return o})(o),{...e,activeSelection:o}}default:return e}},OH=e=>null!==e.target?.closest("[data-prevent-selection]"),TH=e=>"A"===e.target?.tagName,LH=({startIndex:e,getCellFromIndex:t,cell:n})=>({type:"mousedown",payload:{activeSelection:{startIndex:e,endIndex:e,getCellFromIndex:t,clientSelectedCells:(new Map).set(n.ref.qElemNo,n)},selectedField:{selectionCellType:n.selectionCellType,index:"L"===n.selectionCellType?n.x:n.y}}});const qH=s({createMouseDownHandler:()=>()=>{},createMouseOverHandler:()=>()=>{},createPointerUpHandler:()=>()=>{},isSelected:()=>!1,isActive:!1,isLocked:()=>!1}),NH=()=>d(qH),jH=({children:e,selections:t})=>{const n=function(e){const{updatePageInfo:t}=VF(),n=e.isActive(),[r,i]=l(PH,{engineSelectedCells:null,selectedField:null,activeSelection:null});c((()=>{const n=()=>{i({type:"clearSelections"})},r=()=>{n(),t({page:0})};return e.on("deactivated",n),e.on("canceled",n),e.on("confirmed",r),e.on("cleared",n),()=>{e.removeListener("deactivated",n),e.removeListener("canceled",n),e.removeListener("confirmed",r),e.removeListener("cleared",n)}}),[e,t]);const o=h((async()=>{if(!r.activeSelection)return;var t,n;1===r.activeSelection.clientSelectedCells.size&&(t=r.engineSelectedCells,(n=r.activeSelection).clientSelectedCells.forEach(((e,r)=>{t?.has(r)&&(n.clientSelectedCells.delete(r),t.delete(r))})));const o=new Map([...r.engineSelectedCells??new Map,...r.activeSelection.clientSelectedCells]);try{i({type:"mouseup",payload:{engineSelectedCells:o}}),await e.select({method:"selectPivotCells",params:[eW,Array.from(o,(([,e])=>({qType:e.selectionCellType,qRow:e.y,qCol:e.x})))]})}catch(e){console.error(e),i({type:"mouseup",payload:{engineSelectedCells:r.engineSelectedCells}})}}),[r,e]);c((()=>{if(r.activeSelection)return document.addEventListener("mouseup",o),()=>{document.removeEventListener("mouseup",o)}}),[o,r.activeSelection]);const a=h(((e,t)=>n=>{const r=t(e);AH(n)||OH(n)||TH(n)||!(e=>1===e.buttons)(n)||!r||i(LH({startIndex:e,getCellFromIndex:t,cell:r}))}),[]),s=h((t=>async()=>{r.activeSelection&&(e.isActive()||await e.begin([eW]),i({type:"mouseover",payload:{index:t}}))}),[r.activeSelection,e]),u=h(((e,t)=>n=>{if("touch"!==n.pointerType)return;const r=t(e);AH(n)||OH(n)||TH(n)||!r||(i(LH({startIndex:e,getCellFromIndex:t,cell:r})),o())}),[o]),d=h((e=>!(!r.engineSelectedCells?.size&&!r.activeSelection?.clientSelectedCells.size||!r.selectedField||e.selectionCellType===r.selectedField.selectionCellType&&("L"===e.selectionCellType?r.selectedField.index===e.x:r.selectedField.index===e.y))),[r.activeSelection?.clientSelectedCells.size,r.engineSelectedCells?.size,r.selectedField]),p=h((e=>!d(e)&&(r.engineSelectedCells?.has(e.ref.qElemNo)||!!r.activeSelection?.clientSelectedCells.has(e.ref.qElemNo))),[d,r.activeSelection?.clientSelectedCells,r.engineSelectedCells]);return f((()=>({isSelected:p,isActive:n,isLocked:d,createMouseDownHandler:a,createMouseOverHandler:s,createPointerUpHandler:u})),[p,n,d,a,s,u])}(t);return Ji.jsx(qH.Provider,{value:n,children:e})},zH=e=>"fill"===e.representation.imageSize,FH=(e,t)=>{let n=e.isLeftColumn?"flex-start":"center";return e.isLeftColumn&&zH(e)&&t&&(n="center"),e.representation.type!==ZN.Image||zH(e)?n:e.representation.resolvedImagePosition?.vertical};var WH=function(e){return e.Background="background",e.Color="color",e.FontWeight="fontWeight",e.FontStyle="fontStyle",e.TextDecoration="textDecoration",e}(WH||{});const $H={brighter:.5,darker:.3,opacity:.03},BH=(e,{cell:t,styleService:n})=>{if(e===WH.Background||e===WH.Color){const n=t.expressionColor[e];if(n)return n}return t.isNull?n.nullValues[e]:t.isPseudoDimension?n.measureLabels[e]:t.isTotal?n.totalValues[e]:n.dimensionValues[e]},HH=({styleService:e,isCellSelected:t,cell:n,isCellLocked:r})=>{if(t)return e.selectedColors.background;const i=BH(WH.Background,{cell:n,styleService:e});return!r||!i||n.isPseudoDimension||n.isEmpty||n.isNull||n.isTotal?BH(WH.Background,{cell:n,styleService:e}):`repeating-linear-gradient(\n -45deg,\n ${Sj(o=i,$H)} 0px 2px,\n ${o} 0px 4px\n ) border-box`;var o},VH=({cell:e,styleService:t,isCellSelected:n})=>n?t.selectedColors.color:BH(WH.Color,{cell:e,styleService:t}),GH=({cell:e,styleService:t})=>{const{qCanCollapse:n,qCanExpand:r}=e.ref,i=BH(WH.FontWeight,{cell:e,styleService:t});return void 0===i&&(r||n)?Lj:i},UH=({cell:e,styleService:t})=>BH(WH.FontStyle,{cell:e,styleService:t}),YH=({cell:e,styleService:t})=>BH(WH.TextDecoration,{cell:e,styleService:t}),KH=e=>e?"pointer":"default",XH=({expandOrCollapse:e,cell:t})=>n=>{e?.(t.y,t.x),n.stopPropagation()},JH=(e,t)=>{if(!e.isLeftColumn||e.representation.type===ZN.Image)return{padding:4};return{padding:4,marginTop:t.dimensionValueTextHeight/2-6.5-4}},ZH=({cell:e,isLeftColumn:t,isCellSelected:n})=>{const{styleService:r,layoutService:i}=JF(),{interactions:o}=YF(),{isActive:a}=NH(),{dataModel:s}=x$();if(!e.ref.qCanExpand&&!e.ref.qCanCollapse)return null;const l=!o.active||a||!s,c=VH({cell:e,styleService:r,isCellSelected:n}),u=a?.4:1,d=e.ref.qCanExpand?nF:tF;let h;h=e.ref.qCanExpand?t?s.expandLeft:s.expandTop:t?s.collapseLeft:s.collapseTop;const p=E$({isLeftColumn:t,layoutService:i,representation:e.representation});return Ji.jsx(d,{opacity:u,color:c,"data-prevent-selection":!l||void 0,"data-testid":e.ref.qCanExpand?"expand-icon":"collapse-icon",height:13,style:{flexShrink:0,cursor:l?"default":"pointer",position:"sticky",top:0,...JH(e,r),...p&&{alignSelf:FH(e)}},onClick:l?void 0:XH({cell:e,expandOrCollapse:h})})},QH=e=>{switch(e){case"fitHeight":case"fill":case"alwaysFit":return"100%";case"originalSize":return"fit-content";default:return"auto"}},eV=(e,t,n)=>{if("alwaysFit"===e&&t&&!n)return"fit-content";switch(e){case"fitHeight":return"auto";case"originalSize":return"fit-content";case"alwaysFit":return n?"unset":"100%";default:return"100%"}},tV=(e,t)=>{if("alwaysFit"===e)switch(t?.vertical){case"flex-start":return"center top";case"flex-end":return"center bottom";default:return"center center"}},nV=({representation:e,canExpandOrCollapse:t,leafCount:n,isLeftColumn:r,styleService:i,layoutService:o,isMeasureCell:a})=>{const{isIndentModeEnabled:s}=o,l=E$({isLeftColumn:r,layoutService:o,representation:e}),c=t?21:0,u=e.imageBox?.width??24;let d=`calc(100% - ${c}px)`,h=i.headerCellHeight;r&&l&&(d=u),(a||r)&&(h=i.contentCellHeight);let p=h;switch(r&&void 0!==n&&!s&&(p=h*Math.max(n,1)),e.imageSize){case"originalSize":return{maxWidth:d,maxHeight:p,...l?{width:d}:{}};case"fitWidth":return{width:d,maxHeight:p};case"fitHeight":return{height:p,maxWidth:d,...l?{width:d}:{}};case"fill":return{height:p,width:d};default:return{width:d,height:h}}},rV=e=>{if("alwaysFit"===e)return"contain"},iV=({suffix:e,delimeter:t})=>` ${e?t:""} ${e}`.trim(),oV=({imageSize:e,resolvedImagePosition:t,isImagesInIndentModeEnabled:n,isMeasureCell:r})=>({width:eV(e,n,r),height:QH(e),objectFit:rV(e),objectPosition:tV(e,t),...n&&"alwaysFit"===e?{"max-width":"100%"}:{}}),aV=({representation:e,textStyle:t,isMeasureCell:n})=>{const{imageRef:r,onLoad:i}=(()=>{const{downloadService:e}=JF(),t=a(null),{promise:n,resolve:r}=f((()=>rz()),[]);return c((()=>(e.isDownloadedAsPDForImage&&(e.waitForPromise(n),t.current?.complete&&r()),()=>{r()})),[t,e,n,r]),{onLoad:h((()=>{r()}),[r]),imageRef:t}})(),{layoutService:{isIndentModeEnabled:o}}=JF(),{url:s,text:l,imageSize:u,resolvedImagePosition:d}=e,{overflow:p,...m}=t;return Ji.jsx("img",{src:s,alt:l,style:{...oV({imageSize:u,resolvedImagePosition:d,isImagesInIndentModeEnabled:o,isMeasureCell:n}),...m},onLoad:i,ref:r})},sV=({representation:e,textStyle:t,canExpandOrCollapse:n,leafCount:r,isLeftColumn:i=!1,imageContainerHorizontalAlignment:o,isMeasureCell:a})=>{const{styleService:s,layoutService:l}=JF(),{resolvedImagePosition:c}=e;return Ji.jsx("div",{"data-key":"image-container--image",style:{display:"flex",flexDirection:"column",justifyContent:c?.vertical,alignItems:o,overflow:"hidden",boxSizing:"border-box",border:"4px solid transparent",...nV({representation:e,canExpandOrCollapse:n,leafCount:r,styleService:s,layoutService:l,isLeftColumn:i,isMeasureCell:a})},children:Ji.jsx(aV,{representation:e,textStyle:t,isMeasureCell:!0})})},lV=(e,t,n)=>{if(e?.auto)return t;switch(e?.align){case"center":return"center";case"left":return"rtl"===n?"flex-end":"flex-start";case"right":return"rtl"===n?"flex-start":"flex-end";default:return t}},cV=(e,t)=>{let{textAlign:n}=t.getDimensionInfo(e.dimensionInfoIndex)??{};return e.isPseudoDimension&&void 0!==e.visibleMeasureInfoIndex&&({labelTextAlign:n}=t.visibleMeasureInfo.at(e.visibleMeasureInfoIndex)??{}),n?.auto||void 0===n?"left":n.align},uV={display:"flex",flexDirection:"row",alignItems:"center"},dV={alignItems:"center",display:"flex",flexDirection:"row",backgroundClip:"padding-box"},hV=(e,t,n,r)=>t?{...dV,...e.nullValues}:n?{...uV,color:e.totalValues.color,background:r??e.totalValues.background}:{...uV,color:e.measureValues.color,background:r??e.measureValues.background},pV=(e,t,n,r,i)=>{const{fontFamily:o,fontSize:a}=e.measureValues,s={...Bj,...!n&&Hj(e.grid.lineClamp),...t&&{color:t},fontFamily:o,fontSize:a};if(i){const{fontWeight:t,fontStyle:n,textDecoration:r}=e.nullValues;return{...s,fontWeight:t,fontStyle:n,textDecoration:r}}if(r){const{fontWeight:t,fontStyle:n,textDecoration:r}=e.totalValues;return{...s,fontWeight:t,fontStyle:n,textDecoration:r}}const{fontWeight:l,fontStyle:c,textDecoration:u}=e.measureValues;return{...s,fontWeight:void 0===l?Lj:l,fontStyle:c,textDecoration:u}},fV=({cell:e,representation:t,color:n,isTotalValueCell:r,cellHorizontalAlignment:i})=>{const{layoutService:o,styleService:a}=JF(),{isIndentModeEnabled:s}=o,l=e.isNull?o.getNullValueText():t.text,c=t.type===ZN.Image,u=t.type===ZN.Indicator,d=nH(rH(l)),h=pV(a,n,d,r,e.isNull);if(!s&&c&&!e.isNull||s&&c&&!e.isNull)return Ji.jsx(sV,{isMeasureCell:!0,textStyle:h,representation:t,imageContainerHorizontalAlignment:i});const p=rH(e.isNull?t.text:e.ref.qNum);return u&&nH(p)?Ji.jsx(DH,{representation:t,cellValue:p,textStyle:h}):Ji.jsx("span",{style:{padding:4,direction:d?"ltr":void 0,...h},children:l})},mV=(e,t)=>e?.[t]?.visibleMeasureInfoIndex??0,gV="flex-start",yV=(e,t)=>e.isNull?gV:t.type===ZN.Image&&"fill"!==t.imageSize?t.resolvedImagePosition?.vertical:gV,vV=({columnIndex:e,rowIndex:t,style:n,data:r})=>{const{env:i}=YF(),{pageInfo:o,direction:a}=VF(),{styleService:s,layoutService:l}=JF(),{attrExprInfoIndexes:c,gridSectionsData:{measureData:u,leftDimensionData:d,topDimensionData:p},visibleDimensionsInfo:{visibleLeftDimensionInfo:f,visibleTopDimensionInfo:m}}=x$(),g=(()=>{const{layoutService:{isIndentModeEnabled:e}}=JF(),{gridSectionsData:{leftDimensionData:t,topDimensionData:n},visibleDimensionsInfo:{visibleLeftDimensionInfo:r,visibleTopDimensionInfo:i}}=x$(),o=r.length,a=i.length;return h(((r,i)=>!(!n.grid.at(a-1)?.[r]?.isTotal&&!t.grid.at(e?0:o-1)?.[i]?.isTotal)),[n,t,o,a,e])})(),y=(()=>{const{gridSectionsData:{topDimensionData:e},visibleDimensionsInfo:{visibleTopDimensionInfo:t}}=x$(),n=t.length;return h((t=>{const r=e.grid.at(n-1)?.[t];return ZB(r,e.totalDividerIndex)}),[e,n])})(),v=(()=>{const{layoutService:{isIndentModeEnabled:e}}=JF(),{gridSectionsData:{leftDimensionData:t},visibleDimensionsInfo:{visibleLeftDimensionInfo:n}}=x$(),r=n.length;return h((n=>{const i=e?0:r-1,o=t.grid.at(i)?.[n];return ZB(o,t.totalDividerIndex,e)}),[t,e,r])})(),{showLastBorder:b}=r,x=p.grid.at(m.length-1),w=d.grid.at(f.length-1),{background:S}=s.measureValues,C=u[t]?.[e],M=t===o.rowsOnCurrentPage-1,k=e===l.size.x-1;if(!C)return Ji.jsx(QB,{style:{...n,background:S},isLastRow:M,isLastColumn:k,showLastBorder:b,index:t,isLeftColumn:!1,showTotalCellDivider:!1});const E=l.hasPseudoDimOnLeft?mV(w,t):mV(x,e),_=l.visibleMeasureInfo[E],R=ZW({cell:C.ref,representationProperties:_.representation,attrExprInfoIndex:c.measures[E],env:i,direction:a,conditionalColoring:_.conditionalColoring,enabledFeatures:{[ZN.Image]:!0,[ZN.Indicator]:!0}}),I=!C.isNull&&g(e,t),D=C.isNull?l.getNullValueText():R.text,A=!C.isNull||!Number.isNaN(+D),P=QW(c.measures[E],C.ref),O=((e,t,n,r,i)=>{const{textAlign:o}=t,a=r?"flex-end":"center";return e.isNull||n.type!==ZN.Image?lV(o,a,i):n.resolvedImagePosition?.horizontal??"center"})(C,_,R,A,a),T={...hV(s,C.isNull,I,P.background),...Gj(M,k,s.grid.border,a,b),...Yj({bottomDivider:v(t),rightDivider:y(e),borderColor:s.grid.divider}),...$j,padding:"0px 4px",display:"flex",justifyContent:O};return Ji.jsx("div",{className:CT,title:D,style:{...T,...n},"data-testid":"measure-value","data-row-index":t,"data-col-index":e,children:Ji.jsx(eH,{width:tH(R),verticalAlign:yV(C,R),children:Ji.jsx(fV,{cell:C,representation:R,isTotalValueCell:I,color:P.color,cellHorizontalAlignment:O})})})};var bV=t.memo(vV,NB);const xV=(e,t)=>t.list[e]?.id??e.toString(),wV=({columnIndex:e,rowIndex:t,data:n})=>n.grid[t]?.[e]?.id??`${t}-${e}`,SV=e=>({...Wj,overflow:"hidden",boxSizing:"content-box",borderWidth:"rtl"===e?"1px 1px 0px 0px":"1px 0px 0px 1px"}),CV=({dataGridRef:e,height:t,rowHightCallback:n,width:r,showLastBorder:i,getRightGridColumnWidth:o,verticalScrollDirection:a,horizontalScrollDirection:s})=>{const{pageInfo:l,direction:c}=VF(),{layoutService:u,styleService:{grid:{divider:d},contentCellHeight:f}}=JF(),{dataModel:m,gridSectionsData:{measureData:g}}=x$(),y={...SV(c),borderColor:d,willChange:"auto",userSelect:"none",WebkitUserSelect:"none"},v=(({verticalScrollDirection:e,horizontalScrollDirection:t})=>{const{pageInfo:n}=VF(),{downloadService:r,viewService:i,layoutService:o}=JF(),{dataModel:a,gridSectionsData:{leftDimensionData:s,topDimensionData:l,measureData:c}}=x$(),u=s.columnCount,d=l.rowCount;return h((async({overscanColumnStartIndex:s,overscanColumnStopIndex:l,overscanRowStartIndex:h,overscanRowStopIndex:p})=>{i.gridColumnStartIndex=s,i.gridRowStartIndex=h,i.gridWidth=l-s+1,i.gridHeight=p-h+1;const f=i.gridWidth+u+(t.current===lj.None?0:jB),m=i.gridHeight+d+(e.current===lj.None?0:jB);let g=XB;m*f>1500&&(g=JB),g(a,o,c,n,i,e,t,r)}),[i,o,a,c,e,t,n,u,d,r])})({verticalScrollDirection:a,horizontalScrollDirection:s});return bz((()=>{e.current&&e.current.resetAfterColumnIndex(0,!1)}),[e,m,g]),p((()=>{e.current&&e.current.resetAfterIndices({columnIndex:0,rowIndex:0,shouldForceUpdate:!0})}),[r,t,e,f,c]),0===u.size.x?null:Ji.jsx(kB,{"data-section-id":"DATA_GRID",ref:e,style:y,columnCount:u.size.x,columnWidth:o,height:t,rowCount:l.rowsOnCurrentPage,rowHeight:n,width:r,itemData:{showLastBorder:i,grid:g},onItemsRendered:v,estimatedRowHeight:n(),estimatedColumnWidth:o(),itemKey:wV,direction:c,children:bV})};var MV=g(CV);const kV=v(((e,t)=>Ji.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:[Ji.jsx("path",{d:"M13 7H8zV4.982C13 2.23 10.761 0 8 0S3 2.23 3 4.982V7h.75H3h1.5V5.332C4.5 3.216 5.549 1.5 8 1.5s3.5 1.716 3.5 3.832V7h.75H3a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1H3z"}),Ji.jsx("use",{fillRule:"evenodd"})]}))),EV=e=>{const[t,n]=m(!1);return bz((()=>{n(!1)}),e),{isAdjustingWidth:t,setIsAdjustingWidth:n}},_V=()=>{const[e,t]=m(!1),{dataModel:n}=x$(),{interactions:r}=YF(),{isAdjustingWidth:i,setIsAdjustingWidth:o}=EV([n]);return{open:e,setOpen:t,handleOpenMenu:e=>{!r.active||AH(e)||i||t(!0)},setIsAdjustingWidth:o}};function RV(e,t){const n=t.expressionColor?.background??e.dimensionValues.background,r=t.isLeftColumn?e.header.background:n,i=r===jj.Transparent?bj.WHITE:r,o=gq(e.grid.border),a=gq(i);return a.isInvalid()||o.isInvalid()||1===o.a?e.grid.border:function(e,t,n){return gq(e.r+(t.r-e.r)*n,e.g+(t.g-e.g)*n,e.b+(t.b-e.b)*n,e.a+(t.a-e.a)*n)}(a,o,o.a).getRGB()}const IV=({cellInfo:e,columnWidth:t,isLastColumn:n,overrideLeftGridWidth:r,setIsAdjustingWidth:i,shouldApplyIndentModeColumnWidth:o,tableWidth:a})=>{const{direction:s}=VF(),{interactions:l,translator:c}=YF(),{isActive:u}=NH(),{dataModel:d}=x$(),{styleService:h}=JF(),[,p]=m({});if(!(e.canBeResized&&!!l.active&&!u))return null;const f=RV(h,e);return Ji.jsx(kz,{isPivot:!0,columnWidth:t,isLastColumn:n,keyValue:`adjuster-${e.dimensionInfoIndex}`,hoverColor:f,updateWidthCallback:t=>{p({}),r&&void 0!==e.colIdx&&r(t,e.colIdx)},confirmWidthCallback:t=>{o?d.applyIndentModeColumnWidth({...t,pixels:Math.min((a??0)*M$,t.pixels??0)}):d.applyColumnWidth(t,e)},setIsAdjustingWidth:i,isLeftColumn:e.isLeftColumn,accessibilityRelatedArgs:{translator:c,columnLabel:e.label??""},direction:s})},DV=ll(Yc,{shouldForwardProp:e=>!["interactions","hoverBackground","background","shouldShowMenuIcon","isDimension"].includes(e)})((({interactions:e,background:t,hoverBackground:n,shouldShowMenuIcon:r,isDimension:i})=>({pointerEvents:i?"all":"none",position:"relative",display:"grid",gridTemplateColumns:r?"1fr 12px":"1fr",gap:8,alignItems:"center",cursor:e.active?"pointer":"default",background:t,"&&:hover":{background:e.active&&i?n:t}}))),AV=ll("div",{shouldForwardProp:e=>!["direction"].includes(e)})((({direction:e})=>({position:"absolute",left:"rtl"!==e?0:void 0,bottom:0}))),PV=ll("div",{shouldForwardProp:e=>"justifyContent"!==e})((({justifyContent:e})=>({...Fj,justifyContent:e??Fj.justifyContent,flexDirection:"row",overflow:"hidden",position:"relative",gap:8}))),OV=ll("div")((()=>({...Fj}))),TV=ll("div",{shouldForwardProp:e=>!["fontSize","fontFamily","fontWeight","fontStyle","textDecoration","justifyContent"].includes(e)})((({fontSize:e,fontFamily:t,fontWeight:n,fontStyle:r,textDecoration:i,justifyContent:o})=>({display:"flex",justifyContent:o,alignSelf:"center",flexGrow:1,maxWidth:"100%",fontWeight:n,fontSize:e,fontFamily:t,fontStyle:r,textDecoration:i}))),LV=ll(ch)((({theme:e})=>({".MuiList-root":{padding:e.spacing(.5,0)}}))),qV=ll(fh,{shouldForwardProp:e=>!["isActive"].includes(e)})((({theme:e,isActive:t})=>({width:220,maxHeight:32,borderRadius:e.spacing(.5),margin:e.spacing(.25,.5),padding:e.spacing(1,1.5),display:"flex",justifyContent:"space-between",position:"relative",overflow:"hidden ",boxSizing:"border-box",background:t?"rgba(0, 0, 0, 0.05)":"transparent","&:hover":{".indent-mode-dropdown-more":{opacity:1}}}))),NV=ll("span")({textOverflow:"ellipsis",overflow:"hidden"}),jV=ll("div",{shouldForwardProp:e=>"visible"!==e})((({visible:e})=>({opacity:e?1:0,width:S$,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"}))),zV=ll("span",{shouldForwardProp:e=>!["padding","alignSelf"].includes(e)})((({padding:e,alignSelf:t})=>({padding:e,alignSelf:t,position:"sticky",top:0})));let FV=function(e){return e.Expand="Expand",e.Collapse="Collapse",e}({});const WV=(e,t)=>({qExcludeList:t===FV.Expand,qPos:{qDimName:e,qElemNo:[]}}),$V=`${eW}/qExpansionState`,BV=({model:e,qExpansionState:t,qEffectiveDimensionName:n,action:r})=>async()=>{const i=(({qEffectiveDimensionName:e,oldExpansionState:t,action:n})=>{const r=t?.findIndex((t=>t.qPos?.qDimName===e));return{expansionData:WV(e,n),index:r}})({qEffectiveDimensionName:n,oldExpansionState:t,action:r});await(async({model:e,newExpansionState:t,errorMsg:n})=>{const{index:r,expansionData:i}=t;try{let t,n=$V,o="Add";void 0===r?t=JSON.stringify([i]):-1===r?(n=`${$V}/-`,t=JSON.stringify(i)):(n=`${$V}/${r}`,o="Replace",t=JSON.stringify(i)),await e.applyPatches([{qPath:n,qOp:o,qValue:t}],!0)}catch(e){console.error(n,e)}})({model:e,newExpansionState:i,errorMsg:`Failed to ${r} dimension`})},HV=({model:e,effectivePropertiesService:t,cell:n})=>{if(void 0===n.qEffectiveDimensionName)return;const r={model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n.qEffectiveDimensionName};return{expandCallback:BV({...r,action:FV.Expand}),collapseCallback:BV({...r,action:FV.Collapse}),alwaysFullyExpanded:t.qAlwaysFullyExpanded}},VV={[uF.Sorting]:!0,[uF.Selections]:!0,[uF.Searching]:!0},GV=({cell:e,style:t,isFirstColumn:n,isLastColumn:r,isLastRow:i,changeSortOrder:o,iconsVisibilityStatus:s,columnWidth:l,overrideLeftGridWidth:c,shouldApplyIndentModeColumnWidth:u,tableWidth:d})=>{const h=a(null),{styleService:p,layoutService:f,effectivePropertiesService:m}=JF(),{app:g,interactions:y,embed:v,translator:b,model:x}=YF(),{fontSize:w,fontFamily:S,fontStyle:C,fontWeight:M,textDecoration:k,color:E,background:_,hoverBackground:R,activeBackground:I}=p.header,D=a(null),{shouldShowLockIcon:A,shouldShowMenuIcon:P}=s,{open:O,setOpen:T,handleOpenMenu:L,setIsAdjustingWidth:q}=_V(),{direction:N}=VF(),j={sortFromMenu:async(t,n)=>{t.stopPropagation(),await o(e,n)}},z={embed:v,listboxRef:h,sortCriteria:f.searchSortFromDimension&&e.isDim?m.getSortCriteriaForDimension(e.dimensionInfoIndex):void 0},F={app:g,qStateName:f.layout.qStateName},{labelTextAlign:W}=f.getDimensionInfo(e.dimensionInfoIndex)??{},$=lV(W,"flex-start",N);return Ji.jsxs(DV,{className:CT,title:e.label,interactions:y,background:O?I:_,hoverBackground:R,shouldShowMenuIcon:P,isDimension:e.isDim,style:{...t,...$j,...Uj(e,i,n,r,p.grid.border,N),color:E},"data-testid":"title-cell",onClick:L,children:[Ji.jsxs(PV,{children:[A?Ji.jsx(OV,{children:Ji.jsx(kV,{height:12})}):null,Ji.jsx(TV,{fontFamily:S,fontSize:w,fontStyle:C,fontWeight:M,textDecoration:k,justifyContent:$,children:Ji.jsx("span",{style:Bj,children:e.label})})]}),e.isDim?Ji.jsxs(Ji.Fragment,{children:[Ji.jsx(pF,{headerData:e,translator:b,anchorRef:D,open:O,setOpen:T,interactions:y,menuAvailabilityFlags:VV,sortRelatedArgs:j,searchRelatedArgs:z,selectionRelatedArgs:F,expandOrCollapseArgs:HV({model:x,effectivePropertiesService:m,cell:e}),shouldShowMenuIcon:P,model:x&&"setActiveField"in x?x:void 0,direction:N,isAccessibleHeader:!0}),Ji.jsx(AV,{ref:h,direction:N}),Ji.jsx(AV,{ref:D,direction:N})]}):null,Ji.jsx(IV,{cellInfo:{...e,isLeftColumn:!0},columnWidth:l,isLastColumn:r,overrideLeftGridWidth:c,setIsAdjustingWidth:q,shouldApplyIndentModeColumnWidth:u,tableWidth:d})]})},UV=({rowSpan:e,columnSpan:t})=>{const{styleService:n}=JF(),{direction:r}=VF();return e>0&&t>0?Ji.jsx("div",{style:{...Wj,gridRowStart:1,gridRowEnd:`span ${e}`,gridColumnStart:1,gridColumnEnd:`span ${t}`,borderWidth:"rtl"===r?"0px 0px 0px 1px":"0px 1px 0px 0px",borderColor:n.grid.border,background:n.grid.background},"data-testid":"empty-header-cell"}):null},YV=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"m8 9 4.5-4.5L14 6l-4.5 4.5L8 12 2 6l1.5-1.5z"})}))),KV=v(((e,t)=>Ji.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:[Ji.jsx("path",{d:"m8 7-4.5 4.5L2 10l6-6 6 6-1.5 1.5z"}),Ji.jsx("use",{fillRule:"evenodd"})]}))),XV=({tableWidth:e,leftGridWidth:t,overrideLeftGridWidth:n})=>{const{direction:r}=VF(),{styleService:i}=JF(),{interactions:o,translator:a}=YF(),{isActive:s}=NH(),{dataModel:l}=x$(),{setIsAdjustingWidth:c}=EV([l]);if(!(!!o.active&&!s))return null;const u=RV(i,{isLeftColumn:!0});return Ji.jsx(kz,{isPivot:!0,isLastColumn:!0,isLeftColumn:!0,keyValue:"adjuster-indent-row",hoverColor:u,columnWidth:t,updateWidthCallback:t=>{n(Math.min(t,e*M$))},confirmWidthCallback:r=>{if(r.type===RT.FitToContent)return void l.applyIndentModeColumnWidth({type:RT.Auto});const i=Math.min(r.pixels??t,e*M$);n(i),l.applyIndentModeColumnWidth({type:RT.Pixels,pixels:i})},setIsAdjustingWidth:c,accessibilityRelatedArgs:{translator:a,columnLabel:a.get("SNPivotTable.IndentMode.Rows")},direction:r})},JV=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M3 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0m6 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m5 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2"})}))),ZV=({cell:e,changeSortOrder:t})=>{const n=a(null),r=a(null),{app:i,interactions:o,embed:s,translator:l,model:c}=YF(),{layoutService:u,effectivePropertiesService:d}=JF(),{open:h,setOpen:p,handleOpenMenu:f}=_V();return Ji.jsxs(qV,{onClick:f,isActive:h,children:[Ji.jsx(NV,{children:e.label}),Ji.jsxs(jV,{className:"indent-mode-dropdown-more",visible:h,children:[Ji.jsx(JV,{}),e.isDim?Ji.jsxs(Ji.Fragment,{children:[Ji.jsx(pF,{headerData:e,translator:l,anchorRef:n,open:h,setOpen:p,interactions:o,menuAvailabilityFlags:VV,sortRelatedArgs:{sortFromMenu:async(n,r)=>{n.stopPropagation(),await t(e,r)}},searchRelatedArgs:{embed:s,listboxRef:r},selectionRelatedArgs:{app:i,qStateName:u.layout.qStateName},expandOrCollapseArgs:HV({model:c,effectivePropertiesService:d,cell:e}),shouldShowMenuIcon:!1,model:c&&"setActiveField"in c?c:void 0}),Ji.jsx(AV,{ref:r}),Ji.jsx(AV,{ref:n})]}):null]})]})},QV=({idx:e,menu:t,menuItems:n,isOnlyOneRow:r})=>{const i=n.at(-1)?.id===nW,o=e+1<n.length&&n[e+1]?.id===nW;return!(r&&i&&o)&&(t?.id!==nW&&e<n.length-1)},eG=({menuItems:e,changeSortOrder:t,overrideLeftGridWidth:n,leftGridWidth:r,tableWidth:i})=>{const{styleService:o}=JF(),{interactions:s,translator:l}=YF(),{dataModel:c,gridSectionsData:{headersData:u}}=x$(),[d,h]=m(!1),p=a(null),{headerCellHeight:f}=o,{color:g,background:y,hoverBackground:v,activeBackground:b,fontFamily:x,fontSize:w,fontStyle:S,fontWeight:C,textDecoration:M}=o.header,{isAdjustingWidth:k}=EV([c]),E=e=>{e.stopPropagation()},_={height:f,gridColumn:`1 / span ${u.size.x}`,gridRow:u.size.y,zIndex:u.size.x-0};return Ji.jsxs(DV,{isDimension:!0,background:d?b:y,interactions:s,hoverBackground:v,style:{..._,...$j,color:g},onClick:e=>{!s.active||AH(e)||k||h(!d)},"data-testid":"indentModeHeaderCellWrapper",children:[Ji.jsxs(PV,{justifyContent:"flex-start",children:[Ji.jsx(TV,{fontFamily:x,fontSize:w,fontStyle:S,fontWeight:C,textDecoration:M,justifyContent:"flex-start",children:Ji.jsx("span",{style:Bj,children:l.get("SNPivotTable.IndentMode.Rows")})}),d?Ji.jsx(KV,{}):Ji.jsx(YV,{}),Ji.jsx(AV,{ref:p})]}),Ji.jsx(LV,{open:d,anchorEl:p.current,disableEnforceFocus:!0,children:e.map(((n,r)=>[n&&n.id!==nW&&Ji.jsx("li",{role:"presentation",onClick:E,onKeyDown:E,children:Ji.jsx(ZV,{cell:n,changeSortOrder:t})}),QV({idx:r,menu:n,menuItems:e,isOnlyOneRow:1===u.size.y})&&Ji.jsx(Dz,{"data-testid":"group-divider",variant:"middle"})]))}),Ji.jsx(XV,{tableWidth:i,leftGridWidth:r,overrideLeftGridWidth:n})]})},tG=({layoutService:e,headersData:t,topRowIndex:n})=>e.isIndentModeEnabled&&t.size.x>1&&n+1===t.size.y,nG={display:"grid",width:"fit-content"},rG=({tableWidth:e,leftGridWidth:t,columnWidths:n,rowHight:r,changeSortOrder:i,getHeaderCellsIconsVisibilityStatus:o,height:a,overrideLeftGridWidth:s})=>{const{layoutService:l}=JF(),{gridSectionsData:{headersData:c}}=x$();return Ji.jsxs("div",{"data-testid":"HEADER_GRID",style:{...nG,gridTemplateColumns:n.map((e=>`${e}px`)).join(" "),gridTemplateRows:c.data.map((()=>`${r}px`)).join(" "),height:a},children:[c.size.y>1&&Ji.jsx(UV,{columnSpan:c.size.x-1,rowSpan:c.size.y-1}),c.data.map(((a,u)=>{let d=[];if(tG({layoutService:l,headersData:c,topRowIndex:u})){const n=a.at(0);return Array.isArray(n)&&d.push(Ji.jsx(eG,{menuItems:n,changeSortOrder:i,overrideLeftGridWidth:s,leftGridWidth:t,tableWidth:e},n.at(0)?.id)),d}return d=a.reduce(((t,a,d)=>{if(a&&!Array.isArray(a)){const h=o(d,a.isLocked,a.label),p=l.isIndentModeEnabled&&1===c.size.x;t.push(Ji.jsx(GV,{style:{width:n[d],height:r,gridColumn:l.isIndentModeEnabled&&c.size.x>1?2:d+1,gridRow:u+1,zIndex:c.size.x-d},isLastRow:u===c.size.y-1,isFirstColumn:0===d,isLastColumn:d===c.size.x-1,changeSortOrder:i,cell:a,iconsVisibilityStatus:h,columnWidth:n[d],overrideLeftGridWidth:s,shouldApplyIndentModeColumnWidth:p,tableWidth:e},a.id))}return t}),[]),d}))]})};var iG=g(rG);const oG=(e,t,n,r)=>{const{layoutService:i}=JF();p((()=>{e.current?.forEach((e=>e?.resetAfterIndex(0,!0)))}),[e,t,n,r,i])},aG=(e,t)=>{bz((()=>{e.current?.forEach((e=>e?.resetAfterIndex(0,!1)))}),[e,t])},sG=(e,t)=>{const{isLast:n,list:r,listValues:i}=t;return n?r[e]:i[e]},lG=(e,t,n,r,i)=>{if(i)return;const o=e.representation,a=E$({isLeftColumn:n,layoutService:t,representation:o}),s=n?"flex-start":"center",l=e.representation.resolvedImagePosition?.horizontal;if(e.representation.type===ZN.Image)return a&&l&&"center"!==l&&"rtl"===r?RH(l):l??s;if(e.isPseudoDimension&&void 0!==e.visibleMeasureInfoIndex){const{labelTextAlign:n}=t.visibleMeasureInfo[e.visibleMeasureInfoIndex]??{};return lV(n,s,r)}const{textAlign:c}=t.getDimensionInfo(e.dimensionInfoIndex)??{};return lV(c,s,r)},cG=()=>{},uG=({children:e,reactWindowStyle:t,cell:n,data:r,showTotalCellDivider:i,isLastRow:o,isLastColumn:a,isLeftColumn:s,isCellSelected:l,isAdjustingWidth:c,index:u})=>{const{styleService:d,layoutService:h}=JF(),{interactions:p}=YF(),{direction:f}=VF(),{isLocked:m,createMouseDownHandler:g,createMouseOverHandler:y,createPointerUpHandler:v}=NH(),{showLastBorder:b}=r,x=m(n)||n.isLockedByDimension,w=!(x||!p.active||!p.select||n.isEmpty||n.isNull||n.isPseudoDimension||n.isTotal||c),S=w?g(u,(e=>sG(e,r))):void 0,C=w?y(u):void 0,M=w?v(u,(e=>sG(e,r))):void 0,k=E$({isLeftColumn:s,layoutService:h,representation:n.representation});return Ji.jsx("div",{className:CT,title:p.passive?n.representation.text:void 0,style:{...t,...Gj(o,a,d.grid.border,f,b),...Yj({bottomDivider:i&&s,rightDivider:i&&!s,borderColor:d.grid.divider}),...$j,padding:"rtl"===f?"0px 0px 0px 4px":"0px 4px",cursor:KH(w),background:HH({styleService:d,isCellSelected:l,cell:n,isCellLocked:x}),zIndex:s?void 0:h.size.x-n.x,justifyContent:lG(n,h,s,f,k),display:"flex",...h.isIndentModeEnabled&&s&&{["rtl"===f?"paddingRight":"paddingLeft"]:Math.max(4,24*(n.indentLevel??0))},textAlign:cV(n,h)},"aria-hidden":"true",onMouseDown:S,onMouseOver:C,onPointerUp:M,onKeyUp:cG,role:"button",tabIndex:-1,"data-testid":"dimension-cell","data-x":n.x,"data-page-x":n.pageX,"data-y":n.y,"data-page-y":n.pageY,"data-cell-type":n.ref.qType,"data-dimension-info-index":n.dimensionInfoIndex,children:e})},dG=e=>{e.stopPropagation()},hG=({href:e,text:t,interactions:n,color:r})=>({href:e,title:t,rel:"noreferrer",target:"_blank",underline:"hover",onClick:dG,color:bj.LINK,style:{pointerEvents:n.active?"auto":"none",color:r??void 0,opacity:n.active&&n.passive||r?void 0:.4}}),pG=({href:e,text:t,interactions:n,color:r})=>Ji.jsx(fd,{...hG({href:e,text:t,interactions:n,color:r}),children:t});function fG(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mG(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 gG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mG(Object(n),!0).forEach((function(t){fG(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mG(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var yG=Object.prototype.hasOwnProperty,vG=Object.prototype.toString,bG=Object.defineProperty,xG=Object.getOwnPropertyDescriptor,wG=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===vG.call(e)},SG=function(e){if(!e||"[object Object]"!==vG.call(e))return!1;var t,n=yG.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&yG.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||yG.call(e,t)},CG=function(e,t){bG&&"__proto__"===t.name?bG(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},MG=function(e,t){if("__proto__"===t){if(!yG.call(e,t))return;if(xG)return xG(e,t).value}return e[t]},kG=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=MG(s,n),s!==(i=MG(t,n))&&(u&&i&&(SG(i)||(o=wG(i)))?(o?(o=!1,a=r&&wG(r)?r:[]):a=r&&SG(r)?r:{},CG(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&CG(s,{name:n,newValue:i}));return s};function EG(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=i.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),s=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(r)&&r.some(((e,t)=>e!==t))){const e=r.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:l>=0?e=>e[a].qAttrDims.qValues[l]:s>=0?e=>e[a].qAttrExps.qValues[s]:e=>e[a]}function _G(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function RG(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:a,row:s,sourceKey:l,target:c,targetProp:u,columnOrder:d}=e,h=r;if(i.field&&i.field!==n){const e=EG(i.field,o,{cache:t},d);if(-1===e)return;h=kG({qRow:a},e(s))}c[u]=_G(i,h,{key:l})}function IG(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const a=t.raw(),s=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:c,main:u}=r.normalizeConfig(i[e],t),d=Object.keys(c),h=!!i[e].trackBy,p=typeof i[e].trackBy,f={},m=[],g=[];for(let t=0;t<a.qDataPages.length;t++){const o=EG(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let y=0;y<a.qDataPages[t].qMatrix.length;y++){const v=a.qDataPages[t].qArea.qTop+y,b=kG({qRow:v},o(a.qDataPages[t].qMatrix[y])),x=_G(u,b,{key:s});if(!(u.filter&&!u.filter(b))){for(let e=0;e<d.length;e++){const r=c[d[e]];let i=r.fields||[r];r.fields&&(x[d[e]]=[]);for(let o=0;o<i.length;o++)RG({cache:n,f:l,mainCell:b,p:i[o],prop:d[e],page:a.qDataPages[t],rowIdx:v,row:a.qDataPages[t].qMatrix[y],sourceKey:s,target:r.fields?x[d[e]]:x,targetProp:r.fields?o:d[e],columnOrder:a.qColumnOrder});if(r.fields){const t=x[d[e]].map((e=>e.value)),n=x[d[e]].map((e=>e.label));x[d[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[d[e]].value)}}}h&&r.track({cfg:i[e],itemData:b,obj:x,target:m,tracker:f,trackType:p}),g.push(x)}}}const y=h?r.collect(m,{main:u,propsArr:d,props:c}):g;o=[...o,...y]}return o}function DG(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 AG(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=OG)):void 0===t&&(t=PG);for(var n,r,i,o,a,s=new qG(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new qG(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(LG)}function PG(e){return e.children}function OG(e){return Array.isArray(e)?e[1]:null}function TG(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function LG(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function qG(e){this.data=e,this.depth=this.height=0,this.parent=null}function NG(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}qG.prototype=AG.prototype={constructor:qG,count:function(){return this.eachAfter(DG)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;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(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return AG(this).eachBefore(TG)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}};var jG={depth:-1},zG={},FG={};function WG(e){return e.id}function $G(e){return e.parentId}function BG(){var e,t=WG,n=$G;function r(r){var i,o,a,s,l,c,u,d,h=Array.from(r),p=t,f=n,m=new Map;if(null!=e){const t=h.map(((t,n)=>function(e){e=`${e}`;let t=e.length;VG(e,t-1)&&!VG(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,r)))),n=t.map(HG),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(HG(e)),h.push(FG));p=(e,n)=>t[n],f=(e,t)=>n[t]}for(a=0,i=h.length;a<i;++a)o=h[a],c=h[a]=new qG(o),null!=(u=p(o,a,r))&&(u+="")&&(d=c.id=u,m.set(d,m.has(d)?zG:c)),null!=(u=f(o,a,r))&&(u+="")&&(c.parent=u);for(a=0;a<i;++a)if(u=(c=h[a]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===zG)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(s)throw new Error("multiple roots");s=c}if(!s)throw new Error("no root");if(null!=e){for(;s.data===FG&&1===s.children.length;)s=s.children[0],--i;for(let e=h.length-1;e>=0&&(c=h[e]).data===FG;--e)c.data=null}if(s.parent=jG,s.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(LG),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=NG(e),r):t},r.parentId=function(e){return arguments.length?(n=NG(e),r):n},r.path=function(t){return arguments.length?(e=NG(t),r):e},r}function HG(e){let t=e.length;if(t<2)return"";for(;--t>1&&!VG(e,t););return e.slice(0,t)}function VG(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function GG(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=GG(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=GG(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function UG(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...UG(e[i].children,t-1,n)]);return r}function YG(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const r=Math.max(0,Math.min(100,t-e));return e=>UG(e.children,r-1,n)}return!1}const KG=/^qDimensionInfo(?:\/(\d+))?/,XG=/^\/?qMeasureInfo\/(\d+)/,JG=/\/qAttrExprInfo\/(\d+)/,ZG=/\/qAttrDimInfo\/(\d+)/;function QG(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function eU(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,d=r;const h=n.qEffectiveInterColumnSortOrder,p=QG(n);return KG.test(d)&&(i=!0,o=+KG.exec(d)[1],d=r.replace(KG,"")),XG.test(d)&&("K"===n.qMode?c=+XG.exec(d)[1]:h&&-1!==h.indexOf(-1)?(c=+XG.exec(d)[1],u=0):u=+XG.exec(d)[1],d=d.replace(XG,"")),d&&(ZG.exec(d)?s=+ZG.exec(d)[1]:JG.exec(d)&&(a=+JG.exec(d)[1])),l=i?"S"===n.qMode?p[o]:h?h.indexOf(o):o:h&&-1!==h.indexOf(-1)?h.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:s,attrIdx:a}}function tU(e,t){let n,r,i=YG(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function nU(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function rU(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let c,u;s.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const d=l[n];let h,p,f,m,g,y;if("primitive"===d.type?(f=d.value,y=String(d.value)):("function"==typeof d.value&&(h=e=>d.value(e,r)),"function"==typeof d.label&&(p=e=>d.label(e,r)),d.accessor?(m=d.accessor(r),Array.isArray(m)?(g=m.map(d.valueAccessor),d.attrAccessor&&(g=g.map(d.attrAccessor)),h&&(f=g.map(h),h=null),p&&(y=g.map(p),p=null),f=d.reduce?d.reduce(f):f,y=d.reduceLabel?d.reduceLabel(y,f):String(f)):(f=d.attrAccessor?d.attrAccessor(d.valueAccessor(m)):d.valueAccessor(m),y=f)):(f=i,y=i)),s.fields){const e=h?h(f):f;c.push(e),u.push(p&&null!=y?p(y):null!=y?y:String(e))}else{const n=h?h(f):f;o[t[e]]={value:n,label:p?p(y):null!=y?y:String(n)},d.field&&(o[t[e]].source={field:d.field.key(),key:a})}}c&&(o[t[e]]={value:"function"==typeof s.value?s.value(c,r):c,label:"function"==typeof s.label?s.label(u,r):u})}}const iU=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=GG(r,e);return o&&o[0]?(t.tree=AG(o[0],n.children||(e=>e[i])),t.tree):null};const oU=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],s=i.fields?i.fields:[i];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==a){const e=tU(o,eU(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function aU(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const i=t.raw(),o=t.key(),a="S"===i.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}(e),r=e.fields(),i=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),o=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let r="__root",l=!1;for(let e=0;e<i.length;e++){var s;const t=n[i[e]],o="".concat(r,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=gG({__id:o,__parent:r,qValues:[]},t),l=!0),r=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[r].qValues.push(t)}}const l=Object.keys(a).map((e=>a[e])),c=BG().id((e=>e.__id)).parentId((e=>e.__parent))(l);return c}(t):iU(i,n,e);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===i.qMode){let e=QG(i)[o-1];a=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),a=n.fields[e]}const{props:s,main:c}=r.normalizeConfig(gG(gG({},e),{},{field:a?a.key():void 0}),t),u=Object.keys(s);l[o]={propsArr:u,props:s,main:c};const d=a?eU(a,{cube:i}):{fieldDepth:0};oU({propsArr:u,props:s,cube:i,cache:n,itemDepthObject:d,f:a})}const c=a.copy().descendants(),u=a.descendants();for(let e=0;e<u.length;e++){const t=l[u[e].depth].propsArr,n=l[u[e].depth].props,r=l[u[e].depth].main,i=c[e],a=i.data,s=nU(r,a,{key:o});rU({propsArr:t,props:n,item:i,itemData:a,ret:s,sourceKey:o}),u[e].data=s}return a}function sU(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<i.length;a++)if(void 0!==i[a].field){const s=t.raw(),l=t.key();if(!iU(s,n,e))continue;const c="object"==typeof i[a].field?i[a].field:t.field(i[a].field),{props:u,main:d}=r.normalizeConfig(i[a],t),h=Object.keys(u),p=eU(c,{cube:s}),{nodeFn:f,attrFn:m,valueFn:g}=tU({fieldDepth:0},p);oU({propsArr:h,props:u,cube:s,cache:n,itemDepthObject:p,f:c});const y=!!i[a].trackBy,v=typeof i[a].trackBy,b={},x=[],w=f(n.tree),S=[];for(let e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(d.filter&&!d.filter(n))continue;const o=nU(d,n,{key:l});rU({propsArr:h,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[a],itemData:n,obj:o,target:x,tracker:b,trackType:v}),S.push(o)}const C=y?r.collect(x,{main:d,propsArr:h,props:u}):S;o=[...o,...C]}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var lU=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){
|
|
102
|
+
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,d,h=e.length,p=e.search(/[0-9\-\+#]/),f=p>0?e.substring(0,p):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=h-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,h):"";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"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(d=t[0]).length%l,h=d.length,b=0;b<h;b++)m+=d.charAt(b),!((b-y+1)%l)&&b<h-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),f+(n?"-":"")+r+x}},AN({exports:{}});const HN="qHyperCubeDef.qDimensions",VN="dimensions",GN="qOtherTotalSpec.qTotalMode",UN="totalMode",YN={quarantine(e){UL.quarantineArrayProp({properties:e,arrayPath:HN,quarantineName:UN,arrayName:VN,itemPath:GN})},unquarantine(e){UL.unquarantineArrayProp({properties:e,arrayPath:HN,quarantineName:UN,arrayName:VN,itemPath:GN})}};function KN(e){const t=BN(e);return(e,n,r,i)=>{const o=UL.hypercube.importProperties({exportFormat:e,initialProperties:n,dataDefinition:t.targets[0],hypercubePath:i}),a=o.qProperty.qHyperCubeDef.qDimensions.length,s=o.qProperty.qHyperCubeDef.qMeasures.length;let l,c=o.qProperty.qHyperCubeDef.qInterColumnSortOrder,u=!0;a+s===c.length&&ON(o,"qProperty.qLayoutExclude.quarantine.interColSortOrder",c.concat());const d=o.qProperty.qLayoutExclude.quarantine?.pivotInterColSortOrder;d?(c=d,l=[...d],ON(o,"qProperty.qHyperCubeDef.qInterColumnSortOrder",c),o.qProperty.qLayoutExclude.quarantine&&delete o.qProperty.qLayoutExclude.quarantine.pivotInterColSortOrder):c.length=0;const h=+(c.indexOf(-1)>-1),p=a+h;if(p>c.length)for(let e=c.length;e<p;e++)c.indexOf(e)<0&&c.push(e-h);for(let e=c.length-1;e>=0;e--)c[e]>=a&&c.splice(e,1);s>1&&c.indexOf(-1)<0?c.push(-1):s<2&&c.indexOf(-1)>-1&&c.splice(c.indexOf(-1),1);const f=o.qProperty.qHyperCubeDef.qNoOfLeftDims??-1;if(a>0&&-1===f&&ON(o,"qProperty.qHyperCubeDef.qNoOfLeftDims",a),l?.length===c.length){for(let e=0;e<l.length;e++)if(l[e]!==c[e]){u=!1;break}u&&(UL.unquarantineProperty(o.qProperty,"noOfLeftDims"),UL.unquarantineProperty(o.qProperty,"excludedNoOfLeftDims "))}return UL.conditionalShow.unquarantine(o.qProperty),YN.unquarantine(o.qProperty),(e=>{UL.unquarantineArrayProp({properties:e,arrayPath:XL,itemPath:ZL,arrayName:JL,quarantineName:QL}),UL.unquarantineArrayProp({properties:e,arrayPath:YL,itemPath:ZL,arrayName:KL,quarantineName:QL}),UL.unquarantineArrayProp({properties:e,arrayPath:YL,itemPath:eq,arrayName:KL,quarantineName:tq}),UL.unquarantineArrayProp({properties:e,arrayPath:YL,itemPath:nq,arrayName:KL,quarantineName:rq})})(o.qProperty),UL.unquarantineProperty(o.qProperty,"pivotTableIndentMode"),o}}function XN(e,t){const n=e.qProperty.qHyperCubeDef.qInterColumnSortOrder,r=n.slice(),i=n.indexOf(-1);i>-1&&n.splice(i,1);const o=UL.hypercube.exportProperties({propertyTree:e,hyperCubePath:t}),a=o.properties.qHyperCubeDef,s=a.qDimensions.length,l=a.qMeasures.length;let c=a.qInterColumnSortOrder;ON(o,"properties.qLayoutExclude.quarantine.pivotInterColSortOrder",r),UL.quarantineProperty(o.properties,"qHyperCubeDef.qNoOfLeftDims","noOfLeftDims"),delete o.properties.qHyperCubeDef.qNoOfLeftDims;const u=o.properties.qLayoutExclude.quarantine?.interColSortOrder;u&&(c=u,ON(o,"properties.qHyperCubeDef.qInterColumnSortOrder",c),ON(o,"data.0.interColumnSortOrder",c),o.properties.qLayoutExclude.quarantine&&delete o.properties.qLayoutExclude.quarantine.interColSortOrder);for(let e=c.length;e<s+l;e++)c.length<=e&&c.push(e);return UL.quarantineProperty(o.properties,"qHyperCubeDef.qIndentMode","pivotTableIndentMode"),UL.quarantineProperty(o.properties,"qHyperCubeDef.excludedNoOfLeftDims ","excludedNoOfLeftDims "),UL.conditionalShow.quarantine(o.properties),YN.quarantine(o.properties),(e=>{UL.quarantineArrayProp({properties:e,arrayPath:XL,itemPath:ZL,arrayName:JL,quarantineName:QL}),UL.quarantineArrayProp({properties:e,arrayPath:YL,itemPath:ZL,arrayName:KL,quarantineName:QL}),UL.quarantineArrayProp({properties:e,arrayPath:YL,itemPath:eq,arrayName:KL,quarantineName:tq}),UL.quarantineArrayProp({properties:e,arrayPath:YL,itemPath:nq,arrayName:KL,quarantineName:rq})})(o.properties),o}const JN=e=>({dimensions:{min:1,max:1e3,description(t,n,r){const i="rows"===r?.type?"Visualizations.Descriptions.Row":"Visualizations.Descriptions.Column";return e.translator.get(i)}},measures:{min:1,max:1e3,description:()=>e.translator.get("Visualizations.Descriptions.Values")}}),ZN={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}}}};let QN=function(e){return e.Text="text",e.Link="link",e.Image="image",e.ImagesInIndentMode="imagesInIndentMode",e.Indicator="indicator",e.MiniChart="miniChart",e.EditableText="editableText",e.EditableSelector="editableSelector",e}({}),ej=function(e){return e.Attribute="attribute",e.Dimension="dimension",e}({});const tj=e=>{switch(e?.type){case"url":return QN.Link;case"image":return QN.Image;case"indicator":return QN.Indicator;case"miniChart":return QN.MiniChart;default:return QN.Text}},nj=({isImagesEnabled:e})=>({uses:"dimensionRepresentationItems.representationType",options(t,n,r){const{qIndentMode:i}=r.properties.qHyperCubeDef,o=[{value:"text",translation:"Object.Table.Representation.Text"},{value:"url",translation:"Object.Table.Representation.Link"}];return(!i&&e||i)&&o.push({value:"image",translation:"Object.Table.Representation.Image"}),o}}),rj=e=>{if(e)return{representationImage:{uses:"dimensionRepresentationItems.representationImage",show:e=>tj(e.qDef.representation)===QN.Image,items:{imageSize:{options:[{value:"alwaysFit",translation:"properties.backgroundImage.sizeAlwaysFit"},{value:"fitWidth",translation:"properties.backgroundImage.sizeFitWidth"},{value:"fitHeight",translation:"properties.backgroundImage.sizeFitHeight"},{value:"fill",translation:"properties.backgroundImage.sizeStretch"},{value:"originalSize",translation:"properties.backgroundImage.originalSize"}]},imageBoxWidth:{ref:"qDef.representation.imageBox.width",translation:"properties.pivot.representation.image.imageBox.width",type:"number",expression:"optional",defaultValue:24,show:(e,t,n)=>{if(!n.properties.qHyperCubeDef)return!1;const{qInterColumnSortOrder:r,qNoOfLeftDims:i,qDimensions:o,qIndentMode:a}=n.properties.qHyperCubeDef;let s=!1;r?.indexOf(-1);const l=o?.indexOf(e)??1/0;return(r?.slice(0,i)??[]).indexOf(l)>-1&&(s=!0),s&&a}}}}}},ij=e=>{const{anything:t}=e,n=!t.sense?.isUnsupportedFeature?.("tableImages");return{representationType:nj({isImagesEnabled:n}),representationUrlPosition:{uses:"dimensionRepresentationItems.representationUrlPosition",show:e=>tj(e.qDef.representation)===QN.Link},representationUrlLabel:{uses:"dimensionRepresentationItems.representationUrlLabel",show:e=>tj(e.qDef.representation)===QN.Link&&e.qDef.representation?.urlPosition===ej.Dimension},representationLinkUrl:{uses:"dimensionRepresentationItems.representationLinkUrl",show:e=>tj(e.qDef.representation)===QN.Link&&e.qDef.representation?.urlPosition===ej.Attribute},...rj(n)}},oj=(e,t)=>{const{anything:n}=e,r=n.sense?.isUnsupportedFeature,i=!r?.("tableImages")&&t[QN.Image],o=!r?.("qMiniChartDef")&&t[QN.MiniChart],a=!r?.("tableIndicators")&&t[QN.Indicator],s=i&&t[QN.ImagesInIndentMode];return{representationType:{uses:"measureRepresentationItems.representationType",options:(e,t,n)=>(e=>{const{qIndentMode:t}=e.properties.qHyperCubeDef??{},n=[{value:"text",translation:"Object.Table.Representation.Text"}];return(!t&&i||t&&s)&&n.push({value:"image",translation:"Object.Table.Representation.Image"}),a&&n.push({value:"indicator",translation:"Object.Table.Representation.Indicator"}),o&&n.push({value:"miniChart",translation:"Common.MiniChart"}),n})(n)},representationImage:i?{uses:"measureRepresentationItems.representationImage",show:e=>tj(e.qDef.representation)===QN.Image,items:{imageSize:{options:[{value:"alwaysFit",translation:"properties.backgroundImage.sizeAlwaysFit"},{value:"fitWidth",translation:"properties.backgroundImage.sizeFitWidth"},{value:"fitHeight",translation:"properties.backgroundImage.sizeFitHeight"},{value:"fill",translation:"properties.backgroundImage.sizeStretch"},{value:"originalSize",translation:"properties.backgroundImage.originalSize"}]}}}:void 0,representationIndicator:a?{uses:"measureRepresentationItems.representationIndicator"}:void 0,representationMiniChart:o?{uses:"measureRepresentationItems.representationMiniChart"}:void 0}};let aj=function(e){return e.Dimension="dimensions",e.Measures="measures",e.Pivot="pivot",e}({}),sj=function(e){return e.CellForegroundColor="cellForegroundColor",e.CellBackgroundColor="cellBackgroundColor",e.ImageUrl="imageUrl",e.ImageLabel="imageLabel",e.Link="url",e.LinkLabel="urlLabel",e}({}),lj=function(e){return e.TopGrid="topGrid",e.LeftGrid="leftGrid",e.DataGrid="dataGrid",e}({}),cj=function(e){return e.Forward="forward",e.Backward="backward",e.None="none",e}({});const uj="image",dj=(e,t,n)=>{if(!n.properties.qHyperCubeDef.qIndentMode)return!0;const r=n.properties.qHyperCubeDef.qInterColumnSortOrder?.indexOf(-1)??-1;let i=n.properties.qHyperCubeDef.qNoOfLeftDims??-1;r>-1&&r<i&&(i-=1);const o=n.properties.qHyperCubeDef.qDimensions.indexOf(e);return 0===o||o>=i},hj=()=>({type:{type:"string",component:"dropdown",ref:"qDef.columnWidth.type",translation:"Object.Table.Column.Width",options:[{value:RT.Auto,translation:"Common.Auto"},{value:RT.FitToContent,translation:"Object.Table.Column.FitToContent"},{value:RT.Pixels,translation:"Object.Table.Column.Pixels"},{value:RT.Percentage,translation:"Object.Table.Column.Percentage"}],defaultValue:RT.Auto},sizePixels:{ref:"qDef.columnWidth.pixels",translation:"Object.Table.Column.Pixels",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:_T.PixelsDefault,show:e=>e.qDef.columnWidth?.type===RT.Pixels},sizePercentage:{ref:"qDef.columnWidth.percentage",translation:"Object.Table.Column.Percentage",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:_T.PercentageDefault,show:e=>e.qDef.columnWidth?.type===RT.Percentage}}),pj=({key:e,translation:t,env:n})=>{const r=!n.anything.sense?.isUnsupportedFeature?.("tableImages");return{[`${e}Auto`]:{ref:`qDef.${e}.auto`,type:"boolean",component:"switch",translation:t,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],defaultValue:!0,show:t=>!r||"labelTextAlign"===e||t.qDef.representation?.type!==uj},[e]:{ref:`qDef.${e}.align`,type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"align_left",labelPlacement:"bottom",value:"left",translation:"properties.dock.left"},{component:"icon-item",icon:"align_center",labelPlacement:"bottom",value:"center",translation:"Common.Center"},{component:"icon-item",icon:"align_right",labelPlacement:"bottom",value:"right",translation:"properties.dock.right"}],defaultValue:"left",show:t=>void 0!==t.qDef[e]&&!t.qDef[e].auto&&(!r||"labelTextAlign"===e||t.qDef.representation?.type!==uj)}}},fj="TOTAL_OFF",mj={component:"attribute-expression-reference",defaultValue:[],ref:"qAttributeExpressions",items:[{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.BackgroundExpression",defaultValue:"",id:sj.CellBackgroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.ForegroundExpression",defaultValue:"",id:sj.CellForegroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:sj.LinkLabel,tid:"URLLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:sj.Link,tid:"URLByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:sj.ImageLabel,tid:"ImageLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:sj.ImageUrl,tid:"ImageUrlByExpression",show:!1}]},gj="TOTAL_OFF",yj={component:"attribute-expression-reference",defaultValue:[],ref:"qAttributeExpressions",items:[{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.BackgroundExpression",defaultValue:"",id:sj.CellBackgroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.ForegroundExpression",defaultValue:"",id:sj.CellForegroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:sj.LinkLabel,tid:"URLLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:sj.Link,tid:"URLByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:sj.ImageLabel,tid:"ImageLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:sj.ImageUrl,tid:"ImageUrlByExpression",show:!1}]},vj=e=>{const{translator:t,anything:n,flags:r}=e,i=(e=>{const{translator:t,anything:n}=e;return{type:"items",component:"data-assets-panel-pivot",translation:"Common.Data",items:{dimensions:{type:"array",component:"expandable-items",ref:"qHyperCubeDef.qDimensions",items:{field:{type:"items",translation:"Common.Field",items:{libraryId:{type:"string",component:"library-item",libraryItemType:"dimension",ref:"qLibraryId",translation:"Common.Dimension",show:e=>!!e.qLibraryId},inlineDimension:{component:"inline-dimension",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},nullSuppression:{type:"boolean",ref:"qNullSuppression",defaultValue:!1,translation:"properties.dimensions.showNull",inverted:!0},totalMode:{type:"string",component:"switch",translation:"properties.showTotals",ref:"qOtherTotalSpec.qTotalMode",defaultValue:fj,trueOption:{value:"TOTAL_EXPR",translation:"properties.on"},falseOption:{value:fj,translation:"properties.off"},show:!n.sense?.isUnsupportedFeature?.("totals")&&dj},totalsLabel:{type:"string",component:"expression",expressionType:"StringExpr",ref:"qTotalLabel",translation:"properties.totals.label",defaultValue:()=>t.get("Object.Table.Totals"),show:(e,t,r)=>!n.sense?.isUnsupportedFeature?.("totals")&&e.qOtherTotalSpec?.qTotalMode!==fj&&dj(e,0,r)},dimensionLimits:{uses:"dimensions.items.dimensionLimits"},showOthers:{uses:"dimensions.items.others"},globalGrouping:{type:"boolean",translation:"properties.dimensionLimits.globalGrouping",ref:"qOtherTotalSpec.qGlobalOtherGrouping",defaultValue:!1,show:e=>"OTHER_OFF"!==e.qOtherTotalSpec?.qOtherMode}}},presentation:{type:"items",translation:"properties.presentation",items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},cellColoring:mj,...pj({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...pj({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...ij(e),...hj()}}}},measures:{type:"array",component:"expandable-items",ref:"qHyperCubeDef.qMeasures",items:{field:{type:"items",translation:"Common.Field",items:{libraryId:{type:"string",component:"library-item",libraryItemType:"measure",ref:"qLibraryId",translation:"Common.Measure",show:e=>!!e.qLibraryId},inlineMeasure:{component:"inline-measure",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},numberFormatting:{uses:"measures.items.numberFormatting"}}},presentation:{type:"items",translation:"properties.presentation",items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},cellColoring:mj,...pj({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...pj({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...oj(e,{[QN.Image]:!0,[QN.Indicator]:!0}),...hj()}}}}}}})(e);return r.isEnabled("CLIENT_IM5974_PIVOT_DATA_PROPERTIES")?i:{type:"items",component:"pivot-data",translation:"properties.data",addTranslation:"Property.AddData",items:{dimensions:{type:"array",component:"dimensions",translation:"Common.Dimensions",alternativeTranslation:"properties.alternative.dimensions",ref:"qHyperCubeDef.qDimensions",disabledRef:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",min:1,allowAdd:!0,allowRemove:!0,allowMove:!0,addTranslation:"properties.dimensions.add",grouped:!0,items:{libraryId:{type:"string",component:"library-item",libraryItemType:"dimension",ref:"qLibraryId",translation:"Common.Dimension",show:e=>!!e.qLibraryId},inlineDimension:{component:"inline-dimension",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},nullSuppression:{type:"boolean",ref:"qNullSuppression",defaultValue:!1,translation:"properties.dimensions.showNull",inverted:!0},totalMode:{type:"string",component:"switch",translation:"properties.showTotals",ref:"qOtherTotalSpec.qTotalMode",defaultValue:gj,trueOption:{value:"TOTAL_EXPR",translation:"properties.on"},falseOption:{value:gj,translation:"properties.off"},show:!n.sense?.isUnsupportedFeature?.("totals")&&dj},totalsLabel:{type:"string",component:"expression",expressionType:"StringExpr",ref:"qTotalLabel",translation:"properties.totals.label",defaultValue:()=>t.get("Object.Table.Totals"),show:(e,t,r)=>!n.sense?.isUnsupportedFeature?.("totals")&&e.qOtherTotalSpec?.qTotalMode!==gj&&dj(e,0,r)},dimensionLimits:{uses:"dimensions.items.dimensionLimits"},showOthers:{uses:"dimensions.items.others"},globalGrouping:{type:"boolean",translation:"properties.dimensionLimits.globalGrouping",ref:"qOtherTotalSpec.qGlobalOtherGrouping",defaultValue:!1,show:e=>"OTHER_OFF"!==e.qOtherTotalSpec?.qOtherMode},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},cellColoring:yj,...pj({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...pj({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...ij(e),...hj()}},measures:{type:"array",component:"measures",translation:"Common.Measures",ref:"qHyperCubeDef.qMeasures",disabledRef:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",min:1,allowAdd:!0,allowRemove:!0,allowMove:!0,addTranslation:"properties.measures.add",grouped:!0,items:{libraryId:{type:"string",component:"library-item",libraryItemType:"measure",ref:"qLibraryId",translation:"Common.Measure",show:e=>!!e.qLibraryId},inlineMeasure:{component:"inline-measure",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},numberFormatting:{uses:"measures.items.numberFormatting"},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},cellColoring:yj,...pj({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...pj({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...oj(e,{[QN.Image]:!0,[QN.ImagesInIndentMode]:!0,[QN.Indicator]:!0}),...hj()}},filters:{type:"items",translation:"SimpleProperties.Filters.Filters",ref:"filters",allowAdd:!0,allowRemove:!0,allowMove:!1,addTranslation:"properties.filters.add",grouped:!0,items:{filter:{type:"object",component:"filter-item",ref:"filter"}}}}}},bj=Aw().palette,xj={TEXT:bj.text.primary,DISABLED:bj.text.disabled,HOVER:bj.action.hover,WHITE:Sp.GREYSCALE_100,BORDER_MEDIUM:Sp.GREYSCALE_85,DARK_MODE_TEXT:Sp.GREYSCALE_95,DARK_MODE_BORDER:Sp.GREYSCALE_95,DARK_MODE_DISABLED:Sp.GREYSCALE_70,TRANSPARENT:"transparent",SELECTED:bj.primary.main,LINK:bj.info.main,ERROR:bj.error.main},wj=(e,t=xj.TEXT,n=xj.WHITE)=>{const r=gq(e),i=gq(t),o=gq(n);return r.isInvalid()?t:function(e,t,n){const r=yq(e,t),i=yq(e,n);if(void 0!==r&&void 0!==i)return r>i?t:n}(r,o,i).getRGB()},Sj=e=>{const t=e.getStyle("","","dataColors.selected")||xj.SELECTED,n=function(e,t){const n=gq("#FFFFFF"),r=gq(e),i=gq(t);if(r.isInvalid()||i.isInvalid()||r.getAlpha()<1||i.getAlpha()<1)return t;const o=yq(n,r),a=yq(i,r),s=o>a||o>4.5;return!s&&a>3?i.getHex():s?"#FFFFFF":"#000000"}(t,xj.TEXT);return{background:t,color:n}},Cj=(e,t)=>{const n=gq(e);return 0===n.a?(n.setAlpha(t.opacity),n.getString()):n.isDark()?n.getBrightenedColor(t.brighter).getString():n.getDarkenedColor(t.darker).getString()},Mj=e=>{const t=gq(e);return t.isInvalid()?null:1===t.a?t.getRGB():t.getRGBA()},kj=e=>{e.stopPropagation(),e.preventDefault()},Ej=(e,t,n,r)=>({ref:e,translation:t,dualOutput:!0,type:"object",component:"color-picker",width:"auto",disableNone:r??!1,defaultValue(e,t,i){const o=r?.(e,t,i)??!1,a=i.theme.current(),s=n(a,o);return{color:"transparent"===s?"none":s}}}),_j=(e,t=!1)=>{return{value:e,label:t?(n=e,n.charAt(0).toUpperCase()+n.slice(1)):e,groupHeader:!1,disabled:!1,styles:t?{fontFamily:e}:void 0};var n},Rj=({ref:e,themeAccessor:t,translator:n,flags:r})=>({component:"dropdown",ref:e,options:(e,i,o)=>{const a=o.theme.current();return((e,t,n,r)=>{const i=t.fontFamily??"Source Sans Pro, sans-serif",o=t.fontFamilies??[],a=Array.from(new Set([e,i,...o])),s=[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0},...a.sort().map((e=>_j(e,!0)))],l=[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0},...Pq(r).filter((e=>!a.includes(e))).map((e=>_j(e,!0)))];return[...s,...l.length>1?l:[]]})(t(a),a,n,r)},defaultValue:(e,n,r)=>t(r.theme.current())}),Ij=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Dj=({ref:e,themeAccessor:t,translator:n})=>({component:"dropdown",ref:e,options:(e,r,i)=>{const o=i.theme.current();return((e,t,n)=>{const r=t.fontSize,i=t.fontSizes??[],o=Array.from(new Set([e,r,...i])),a=[{value:"ThemeHeader",label:n.get("properties.themeFontSizes"),metaText:n.get("properties.theme"),groupHeader:!0},...o.sort(((e,t)=>parseInt(e,10)-parseInt(t,10))).map((e=>_j(e,!1)))],s=[{value:"DefaultHeader",label:n.get("properties.allFontSizes"),metaText:n.get("properties.default"),groupHeader:!0},...Ij.filter((e=>!o.includes(e))).map((e=>_j(e,!1)))];return[...a,...s.length>1?s:[]]})(t(o),o,n)},defaultValue:(e,n,r)=>t(r.theme.current())}),Aj=({section:e,defaultFontStyle:t,translator:n,flags:r,getThemeValue:i,translation:o,disableNoneCallback:a})=>({component:"panel-section",translation:o??`properties.pivot.${e}`,items:{content:{component:"items",ref:"components",key:"theme",items:{fontFamily:Rj({ref:`${e}.fontFamily`,themeAccessor:t=>i(t,e,"fontFamily")??t.fontFamily,translator:n,flags:r}),fontWrapperItem:{component:"inline-wrapper",items:{fontStyle:{component:"font-style-buttons",width:!1,ref:`${e}.fontStyle`,defaultValue:t??[]},fontSize:Dj({ref:`${e}.fontSize`,themeAccessor:t=>i(t,e,"fontSize")??t.fontSize,translator:n}),fontColor:Ej(`${e}.fontColor`,void 0,(t=>i(t,e,"color")??t.color))}},background:Ej(`${e}.background`,"properties.background",((t,n)=>{const r=n?xj.WHITE:xj.TRANSPARENT;return i(t,e,"backgroundColor")??r}),a)}}}}),Pj=({section:e,defaultFontStyle:t,fallbackBackground:n,getThemeValue:r})=>({component:"panel-section",translation:`properties.pivot.${e}`,items:{content:{component:"items",ref:"components",key:"theme",items:{fontWrapperItem:{component:"inline-wrapper",items:{fontStyle:{component:"font-style-buttons",fullWidth:!0,ref:`${e}.fontStyle`,defaultValue:t??[]},fontColor:Ej(`${e}.fontColor`,void 0,(t=>r(t,e,"color")??t.color))}},background:Ej(`${e}.background`,"properties.background",(t=>r(t,e,"backgroundColor")??n??"transparent"))}}}}),Oj=(e,t)=>({component:"dropdown",ref:e,translation:t,options:[...Array(10).keys()].map((e=>({value:e+1,translation:e+1}))),defaultValue:1}),Tj="12px",Lj="Source Sans Pro, sans-serif",qj="600",Nj=15e3,jj=4/3;let zj=function(e){return e.Transparent="transparent",e.FontSecondary="#737373",e.DividerDark="#595959",e.DividerLight="#D9D9D9",e.NullValueBackground="#F2F2F2",e}({}),Fj=function(e){return e.Solid="solid",e.None="none",e}({});const Wj={display:"flex",justifyContent:"center",alignItems:"center"},$j={borderStyle:"solid"},Bj={boxSizing:"border-box",padding:"4px 8px",userSelect:"none",WebkitUserSelect:"none"},Hj={lineHeight:jj,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},Vj=e=>({whiteSpace:"unset",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",wordBreak:e>1?"break-word":"break-all"}),Gj=(e,t)=>e>0?`${e}px ${Fj.Solid} ${t}`:Fj.None,Uj=(e,t,n,r,i)=>{const o=Number(!t||i?.right),a=Number(!e||i?.bottom);return{borderRight:"rtl"!==r?Gj(o,n):Fj.None,borderBottom:Gj(a,n),borderLeft:"rtl"===r?Gj(o,n):Fj.None,borderTop:Fj.None}},Yj=(e,t,n,r,i,o,a)=>{const s=Uj(t,r,i,o,a);return e.isLeftDimension||(e.isLastDimension&&!t&&(s.borderBottom=Gj(2,i)),n||(s.borderLeft="rtl"!==o?Gj(1,i):"none",s.borderRight="rtl"===o?Gj(1,i):"none")),s},Kj=({bottomDivider:e,rightDivider:t,borderColor:n})=>{const r={};return e&&(r.borderBottom=Gj(1,n)),t&&(r.borderRight=Gj(1,n)),r},Xj=(e,t,n)=>{switch(t){case"header":return e.object?.pivotTableV2?.dimension?.label?.name?.[n];case"dimensionValues":return e.object?.pivotTableV2?.dimension?.label?.value?.[n];case"measureLabels":return e.object?.pivotTableV2?.measure?.label?.name?.[n];case"measureValues":return e.object?.pivotTableV2?.measure?.label?.value?.[n];case"totalValues":return e.object?.pivotTableV2?.total?.label?.value?.[n];case"nullValues":return e.object?.pivotTableV2?.null?.label?.value?.[n];default:return}},Jj=(e,t)=>({type:"items",items:[{component:"styling-panel",chartTitle:"Object.PivotTable",subtitle:"LayerStyleEditor.component.styling",translation:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:!0,items:{headerSection:Aj({section:"header",defaultFontStyle:["bold"],translator:e,flags:t,getThemeValue:Xj}),dimensionValueSection:Aj({section:"dimensionValues",translator:e,flags:t,getThemeValue:Xj}),measureValueSection:Aj({section:"measureValues",translator:e,flags:t,getThemeValue:Xj}),measureLabelSection:Pj({section:"measureLabels",getThemeValue:Xj}),totalValuesSection:Pj({section:"totalValues",defaultFontStyle:["bold"],getThemeValue:Xj}),nullValuesSection:Pj({section:"nullValues",fallbackBackground:zj.NullValueBackground,getThemeValue:Xj}),gridSection:{translation:"properties.pivot.grid",component:"panel-section",items:{gridItems:{component:"items",ref:"components",key:"theme",items:{lineClamp:Oj("grid.lineClamp","ThemeStyleEditor.style.rowHeight"),columnLineClamp:Oj("grid.columnLineClamp","ThemeStyleEditor.style.columnHeight"),border:Ej("grid.border","properties.border",(e=>e.object?.pivotTableV2?.grid?.borderColor??zj.DividerLight)),divider:Ej("grid.divider","properties.pivot.divider",(e=>e.object?.pivotTableV2?.grid?.divider?.borderColor??zj.DividerDark)),background:Ej("grid.background","properties.background",(e=>e.object?.pivotTableV2?.grid?.backgroundColor??zj.Transparent))}}}}}}]}),Zj=e=>{if(e.isEnabled("CLIENT_IM_5973_PIVOT_TABLE_EXPLORATION"))return{chartExploration:{type:"items",translation:"properties.chartExploration",items:{chartExplorationToggler:{type:"items",component:"chart-exploration-toggler",translation:"properties.enableChartExploration",ref:"enableChartExploration"},visibilityToggler:{show:e=>e.enableChartExploration,component:"buttongroup",translation:"properties.ChartExploration.VisibilityOption",ref:"chartExploration.menuVisibility",options:[{value:"auto",translation:"Common.Auto"},{value:"minimized",translation:"properties.ChartExploration.Minimized"}]}},show:e=>!e.insideContainer}}},Qj=(e,t)=>({uses:"settings",items:{presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:[Jj(e,t),{type:"items",items:{nullValueText:{ref:"nullValueRepresentation.text",type:"string",translation:"properties.pivot.nullValueText",defaultValue:"-"},alwaysFullyExpanded:{ref:"qHyperCubeDef.qAlwaysFullyExpanded",type:"boolean",translation:"properties.pivot.fullyExpanded",defaultValue:!1},indentMode:{ref:"qHyperCubeDef.qIndentMode",type:"boolean",translation:"properties.pivot.indentMode",defaultValue:!1,change(e){e.qHyperCubeDef.qShowTotalsAbove=!0}},type:{type:"string",component:"dropdown",ref:"qHyperCubeDef.indentModeColumnWidth.type",translation:"Object.Table.Column.Width",options:[{value:RT.Auto,translation:"Common.Auto"},{value:RT.Pixels,translation:"Object.Table.Column.Pixels"},{value:RT.Percentage,translation:"Object.Table.Column.Percentage"}],defaultValue:RT.Auto,show:e=>!!e.qHyperCubeDef.qIndentMode},sizePixels:{ref:"qHyperCubeDef.indentModeColumnWidth.pixels",translation:"Object.Table.Column.Pixels",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:_T.PixelsDefault,show:e=>{const t=e.qHyperCubeDef;return t.qIndentMode&&t.indentModeColumnWidth?.type===RT.Pixels}},sizePercentage:{ref:"qHyperCubeDef.indentModeColumnWidth.percentage",translation:"Object.Table.Column.Percentage",component:"expression",expressionType:"ValueExpression",expression:"optional",defaultValue:_T.PercentageDefault,show:e=>{const t=e.qHyperCubeDef;return t.qIndentMode&&t.indentModeColumnWidth?.type===RT.Percentage}},showTotalsAbove:{ref:"qHyperCubeDef.qShowTotalsAbove",type:"boolean",translation:"properties.pivot.showTotalsAbove",defaultValue:!0,show(e){const{qIndentMode:t}=e.qHyperCubeDef;return!t&&!!e.qHyperCubeDef.qDimensions.some((e=>"TOTAL_EXPR"===e.qOtherTotalSpec?.qTotalMode))}},resetProperties:{type:"object",component:"button",translation:"properties.pivot.resetExpansionButton",disabled:e=>!!e.qHyperCubeDef.qAlwaysFullyExpanded,action(e,t,n,r){e.qHyperCubeDef.qExpansionState=[],r.$emit("saveProperties",e)}}}}]},...Zj(t)}}),ez="auto",tz={type:"items",translation:"properties.sorting",items:{sortbyY:{type:"items",items:{sortbyYToggle:{ref:"qHyperCubeDef.qSortbyYValue",type:"boolean",component:"switch",translation:"properties.sorting.sortByY.label",convertFunctions:{get:e=>!!e("integer"),set:(e,t)=>{t("integer",e?-1:0)}},options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}]},sortbyYOrder:{ref:"qHyperCubeDef.qSortbyYValue",type:"string",component:"dropdown",defaultValue:0,options:[{value:1,translation:"properties.sorting.ascending"},{value:-1,translation:"properties.sorting.descending"}],show:e=>!!e.qHyperCubeDef.qSortbyYValue}}},defaultSorting:{uses:"sorting",items:{dimensions:{showPriority:!1,allowMove:!1},measures:{included:!1}}},searchSorting:{ref:"search.sorting",type:"string",component:"dropdown",defaultValue:ez,translation:"Object.Table.SortingInSearch",options:[{value:ez,translation:"Common.Auto"},{value:"inherit",translation:"Object.Table.SortingInSearch.InheritFromDimension"}]}}};function nz(e){const{translator:t,flags:n}=e;return{type:"items",component:"accordion",items:{data:vj(e),sorting:tz,addons:ZN,settings:Qj(t,n)}}}function rz(e){return{support:{cssScaling:!0,snapshot:!0,export:!0,exploration:e.flags.isEnabled("CLIENT_IM_5973_PIVOT_TABLE_EXPLORATION"),sharing:!1,exportData:!0,viewData:!0},usePropertyHandler:"pivot-data",definition:nz(e),importProperties:KN(e),exportProperties:XN,exploration:AL(e),data:JN(e),dataHandler:e.flags.isEnabled("VNA-147_NEBULA_PIVOT_DATA_HANDLERS")?e=>new VL(e):void 0}}const iz=()=>{let e;const t=new Promise((t=>{e=t}));return{promise:t,resolve:e}};function oz(e,t){return E((()=>e),t)}const az={},sz=e=>{const t=E((()=>({current:az})),[]);return t.current=t.current===az?e:t.current,t},lz=e=>!!e&&0===gq(e).a,cz="#grid",uz=(e,t)=>{const n=t?.closest(e);return n&&window.getComputedStyle(n).backgroundColor},dz=(e,t,n,r,i)=>{const o=uz(".qv-object .qv-inner-object",n),a=uz(".qv-panel-sheet",n),s=uz(cz,n)??a,l=(e=>{const t=e.components?.find((e=>"general"===e.key)),n=t?.bgColor?.colorExpression,r=t?.bgColor?.color?.color,i=t?.bgColor?.useColorExpression;if(i&&n)return Mj(n);if("none"===r)return"transparent";if(void 0===r)return;const o=gq(r);return o.setAlpha(t?.bgColor?.color?.alpha??o.a),o.getRGBA()})(e),c=r?.(t),u=i?.(t),d=l||c||o||u,h=lz(d),p=!lz(f=h?s:d)&&wj(f,xj.TEXT,xj.DARK_MODE_TEXT)===dq(xj.DARK_MODE_TEXT);var f;const m=((e,t,n,r=xj.WHITE)=>e&&!lz(e)?e:lz(t)?n&&!lz(n)?n:r:t)(l,d,s);return{color:d,headerColor:m,isDark:p}},hz=(e,t,n,r)=>{const i=A(),o=((e,t={attributeFilter:["style"],childList:!1,subtree:!1})=>{const[n,r]=I([]);return D((()=>{let n;return e&&(n=new MutationObserver((e=>{r(e)})),n.observe(e,t)),()=>{n?.disconnect()}}),[e,t]),n})(t.closest(cz),{attributeFilter:["style"],childList:!1,subtree:!1,attributeOldValue:!0}).filter((({oldValue:e})=>e?.includes("background"))).map((({oldValue:e})=>e)).join(",");return E((()=>({...i,background:dz(e,i,t,n,r)})),[i.name(),t,n,r,e,o])};function pz(e,t){const n=E((()=>({isLoading:!0})),t),[r,i]=R((async()=>{try{return await e()}finally{n.isLoading=!1}}),t);return[r,n.isLoading,i]}const fz=3;function mz(e,t,n){let r=0,i=e.length;if(e.length<=1)return null;if(n(e)<=t)return null;for(;r<=i;){const o=Math.floor((r+i)/2),a=e.slice(0,o),s=e.slice(0,o-1),l=n(a),c=n(s);if(l>t&&c<=t)return e.slice(o-1)||null;if(l===t)return e.slice(o)||null;l<t?r=o+1:i=o}return null}function gz({fontSize:e="12px",fontFamily:t="Source Sans Pro, Arial, sans-serif",fontStyle:n="normal",fontWeight:r="normal"},i){const{maxNbrLinesOfText:o=fz}={},{estimateWidth:a,measureText:s,estimateLineCount:l}=f((()=>{const i=document.createElement("canvas").getContext("2d");i.font=`${n} ${r} ${e} ${t}`;const a=TN(i.measureText.bind(i)),s=e=>+a(e).width.toFixed(2),l=TN((({text:e,maxWidth:t,isNumeric:n=!1})=>{if(n)return 1;let r=0,i=e;do{r+=1,i=mz(i,t,s)}while(null!==i&&r<o);return r}),(({text:e,maxWidth:t,isNumeric:n})=>`${e}-${t}-${n?"true":"false"}`));return{measureText:e=>a(e).width,estimateWidth:e=>a("N").width*e,estimateLineCount:l}}),[n,r,e,t,o]);return{estimateWidth:a,measureText:s,estimateLineCount:l}}var yz,vz=C;yz=vz.createRoot,vz.hydrateRoot;const bz="Source Sans Pro, sans-serif";function xz(e,t){const[n,r]=m(t),i=n.some(((e,n)=>e!==t[n]));i&&(r(t),e())}var wz={NebulaTableUtils_ColumnAdjuster_ColumnNameLabel:{id:"NebulaTableUtils.ColumnAdjuster.ColumnNameLabel",locale:{"de-DE":"Breite von {0}","en-US":"Width of {0}","es-ES":"Ancho de {0}","fr-FR":"Largeur de {0}","it-IT":"Larghezza di {0}","ja-JP":"{0} の幅","ko-KR":"{0}의 너비","nl-NL":"Breedte van {0}","pl-PL":"Szerokość kolumny {0}","pt-BR":"Comprimento de {0}","ru-RU":'Ширина столбца "{0}"',"sv-SE":"Bredd på {0}","tr-TR":"{0} genişliği","zh-CN":"{0} 的宽度","zh-TW":"{0} 的寬度"}},NebulaTableUtils_MenuGroupLabel_Sorting:{id:"NebulaTableUtils.MenuGroupLabel.Sorting",locale:{"de-DE":"Sortierung","en-US":"Sorting","es-ES":"Ordenación","fr-FR":"Tri","it-IT":"Ordinamento","ja-JP":"ソート","ko-KR":"정렬","nl-NL":"Sorteren","pl-PL":"Sortowanie","pt-BR":"Classificação","ru-RU":"Сортировка","sv-SE":"Sortering","tr-TR":"Sıralama","zh-CN":"排序","zh-TW":"排序"}},NebulaTableUtils_MenuItemLabel_AdjustColumnSize:{id:"NebulaTableUtils.MenuItemLabel.AdjustColumnSize",locale:{"de-DE":"Spaltengröße anpassen","en-US":"Adjust column size","es-ES":"Ajustar el tamaño de columna","fr-FR":"Ajuster la taille de colonne","it-IT":"Regola dimensioni colonna","ja-JP":"列サイズを調整","ko-KR":"열 크기 조정","nl-NL":"Kolomgrootte aanpassen","pl-PL":"Dostosuj rozmiar kolumny","pt-BR":"Ajustar tamanho da coluna","ru-RU":"Настроить размер столбца","sv-SE":"Justera kolumnens storlek","tr-TR":"Sütun boyutunu ayarla","zh-CN":"调节列大小","zh-TW":"調整欄大小"}},NebulaTableUtils_MenuItemLabel_ClearSelections:{id:"NebulaTableUtils.MenuItemLabel.ClearSelections",locale:{"de-DE":"Auswahlen löschen","en-US":"Clear selections","es-ES":"Borrar selecciones","fr-FR":"Effacer les sélections","it-IT":"Cancella selezioni","ja-JP":"選択をクリア","ko-KR":"선택 지우기","nl-NL":"Geselecteerde waarden wissen","pl-PL":"Wyczyść wybory","pt-BR":"Limpar seleções","ru-RU":"Очистить выбранные","sv-SE":"Radera urval","tr-TR":"Seçimleri temizle","zh-CN":"清除选择项","zh-TW":"清除選項"}},NebulaTableUtils_MenuItemLabel_Collapse:{id:"NebulaTableUtils.MenuItemLabel.Collapse",locale:{"de-DE":"Reduzieren","en-US":"Collapse","es-ES":"Contraer","fr-FR":"Réduire","it-IT":"Comprimi","ja-JP":"折りたたむ","ko-KR":"축소","nl-NL":"Samenvouwen","pl-PL":"Zwiń","pt-BR":"Recolher","ru-RU":"Свернуть","sv-SE":"Dölj","tr-TR":"Daralt","zh-CN":"折叠","zh-TW":"收合"}},NebulaTableUtils_MenuItemLabel_ColumnOptions:{id:"NebulaTableUtils.MenuItemLabel.ColumnOptions",locale:{"de-DE":"Spaltenoptionen","en-US":"Column options","es-ES":"Opciones de columna","fr-FR":"Options de colonne","it-IT":"Opzioni colonna","ja-JP":"列オプション","ko-KR":"열 옵션","nl-NL":"Kolomopties","pl-PL":"Opcje kolumny","pt-BR":"Opções da coluna","ru-RU":"Параметры столбца","sv-SE":"Alternativ för kolumn","tr-TR":"Sütun seçenekleri","zh-CN":"列选项","zh-TW":"欄選項"}},NebulaTableUtils_MenuItemLabel_Expand:{id:"NebulaTableUtils.MenuItemLabel.Expand",locale:{"de-DE":"Erweitern","en-US":"Expand","es-ES":"Expandir","fr-FR":"Développer","it-IT":"Espandi","ja-JP":"展開","ko-KR":"확장","nl-NL":"Uitvouwen","pl-PL":"Rozwiń","pt-BR":"Expandir","ru-RU":"Развернуть","sv-SE":"Utöka","tr-TR":"Genişlet","zh-CN":"展开","zh-TW":"展開"}},NebulaTableUtils_MenuItemLabel_Search:{id:"NebulaTableUtils.MenuItemLabel.Search",locale:{"de-DE":"Suchen","en-US":"Search","es-ES":"Buscar","fr-FR":"Rechercher","it-IT":"Cerca","ja-JP":"検索","ko-KR":"검색","nl-NL":"Zoeken","pl-PL":"Wyszukaj","pt-BR":"Pesquisar","ru-RU":"Поиск","sv-SE":"Sök","tr-TR":"Ara","zh-CN":"搜索","zh-TW":"搜尋"}},NebulaTableUtils_MenuItemLabel_SelectAll:{id:"NebulaTableUtils.MenuItemLabel.SelectAll",locale:{"de-DE":"Alle auswählen","en-US":"Select all","es-ES":"Seleccionar todo","fr-FR":"Sélectionner tout","it-IT":"Seleziona tutti","ja-JP":"すべて選択","ko-KR":"모두 선택","nl-NL":"Alles selecteren","pl-PL":"Wybierz wszystko","pt-BR":"Selecionar tudo","ru-RU":"Выбрать все","sv-SE":"Välj alla","tr-TR":"Tümünü seç","zh-CN":"全选","zh-TW":"全選"}},NebulaTableUtils_MenuItemLabel_SelectAlternative:{id:"NebulaTableUtils.MenuItemLabel.SelectAlternative",locale:{"de-DE":"Alternative Werte auswählen","en-US":"Select alternative","es-ES":"Seleccionar alternativos","fr-FR":"Sélectionner des valeurs alternatives","it-IT":"Seleziona alternativi","ja-JP":"代替項目を選択","ko-KR":"대체 가능 값 선택","nl-NL":"Alternatief selecteren","pl-PL":"Wybierz alternatywę","pt-BR":"Selecionar alternativa","ru-RU":"Выбрать альтернативные","sv-SE":"Välj alternativ","tr-TR":"Alternatifi seç","zh-CN":"选择替代项","zh-TW":"選取替代選項"}},NebulaTableUtils_MenuItemLabel_SelectExcluded:{id:"NebulaTableUtils.MenuItemLabel.SelectExcluded",locale:{"de-DE":"Ausgeschlossene Werte auswählen","en-US":"Select excluded","es-ES":"Seleccionar excluidos","fr-FR":"Sélectionner les valeurs exclues","it-IT":"Seleziona esclusi","ja-JP":"除外項目を選択","ko-KR":"제외 항목 선택","nl-NL":"Uitgesloten waarden selecteren","pl-PL":"Wybierz wykluczone","pt-BR":"Selecionar excluídos","ru-RU":"Выбрать исключенные","sv-SE":"Välj uteslutna","tr-TR":"Hariç tutulanı seç","zh-CN":"选择排除项","zh-TW":"選取排除值"}},NebulaTableUtils_MenuItemLabel_SelectPossible:{id:"NebulaTableUtils.MenuItemLabel.SelectPossible",locale:{"de-DE":"Wählbare Werte auswählen","en-US":"Select possible","es-ES":"Seleccionar posibles","fr-FR":"Sélectionner les valeurs possibles","it-IT":"Seleziona possibili","ja-JP":"絞込項目を選択","ko-KR":"사용 가능 항목 선택","nl-NL":"Mogelijke waarden selecteren","pl-PL":"Wybierz możliwe","pt-BR":"Selecionar possíveis","ru-RU":"Выбрать возможные","sv-SE":"Välj möjliga","tr-TR":"Olası olanı seç","zh-CN":"选择可能值","zh-TW":"選取可能值"}},NebulaTableUtils_MenuItemLabel_Selections:{id:"NebulaTableUtils.MenuItemLabel.Selections",locale:{"de-DE":"Auswahlen","en-US":"Selections","es-ES":"Selecciones","fr-FR":"Sélections","it-IT":"Selezioni","ja-JP":"選択","ko-KR":"선택 내용","nl-NL":"Selecties","pl-PL":"Wybory","pt-BR":"Seleções","ru-RU":"Выборки","sv-SE":"Urval","tr-TR":"Seçimler","zh-CN":"选择项","zh-TW":"選項"}},NebulaTableUtils_MenuItemLabel_SortAscending:{id:"NebulaTableUtils.MenuItemLabel.SortAscending",locale:{"de-DE":"In aufsteigender Reihenfolge sortieren","en-US":"Sort ascending","es-ES":"Orden ascendente","fr-FR":"Trier par ordre croissant","it-IT":"Ordinamento crescente","ja-JP":"昇順でソート","ko-KR":"오름차순으로 정렬","nl-NL":"Oplopend sorteren","pl-PL":"Sortuj rosnąco","pt-BR":"Classificar em ordem crescente","ru-RU":"Сортировка по возрастанию","sv-SE":"Sortera stigande","tr-TR":"Artan sıralama","zh-CN":"升序排序","zh-TW":"以遞增方式排序"}},NebulaTableUtils_MenuItemLabel_SortDescending:{id:"NebulaTableUtils.MenuItemLabel.SortDescending",locale:{"de-DE":"In absteigender Reihenfolge sortieren","en-US":"Sort descending","es-ES":"Orden descendente","fr-FR":"Trier par ordre décroissant","it-IT":"Ordinamento decrescente","ja-JP":"降順でソート","ko-KR":"내림차순으로 정렬","nl-NL":"Aflopend sorteren","pl-PL":"Sortuj malejąco","pt-BR":"Classificar em ordem decrescente","ru-RU":"Сортировка по убыванию","sv-SE":"Sortera fallande","tr-TR":"Azalan sıralama","zh-CN":"降序排序","zh-TW":"以遞減方式排序"}},NebulaTableUtils_Pagination_DisplayedRowsLabel:{id:"NebulaTableUtils.Pagination.DisplayedRowsLabel",locale:{"de-DE":"{0} von {1}","en-US":"{0} of {1}","es-ES":"{0} de {1}","fr-FR":"{0} sur {1}","it-IT":"{0} di {1}","ja-JP":"{0} / {1}","ko-KR":"{0}/{1}","nl-NL":"{0} van {1}","pl-PL":"{0} z {1}","pt-BR":"{0} de {1}","ru-RU":"{0} из {1}","sv-SE":"{0} av {1}","tr-TR":"{0} / {1}","zh-CN":"{0} / {1}","zh-TW":"{0} / {1}"}},NebulaTableUtils_Pagination_FirstPage:{id:"NebulaTableUtils.Pagination.FirstPage",locale:{"de-DE":"Zur ersten Seite","en-US":"Go to the first page","es-ES":"Ir a la primera página","fr-FR":"Accéder à la première page","it-IT":"Vai alla prima pagina","ja-JP":"最初のページに移動","ko-KR":"첫 페이지로 이동","nl-NL":"Ga naar de eerste pagina","pl-PL":"Przejdź do pierwszej strony","pt-BR":"Ir para a primeira página","ru-RU":"Перейти к первой странице","sv-SE":"Gå till första sidan","tr-TR":"İlk sayfaya git","zh-CN":"转到第一页","zh-TW":"移至第一頁"}},NebulaTableUtils_Pagination_LastPage:{id:"NebulaTableUtils.Pagination.LastPage",locale:{"de-DE":"Zur letzten Seite","en-US":"Go to the last page","es-ES":"Ir a la última página","fr-FR":"Accéder à la dernière page","it-IT":"Vai all'ultima pagina","ja-JP":"最後のページに移動","ko-KR":"마지막 페이지로 이동","nl-NL":"Ga naar de laatste pagina","pl-PL":"Przejdź do ostatniej strony","pt-BR":"Ir para a última página","ru-RU":"Перейти к последней странице","sv-SE":"Gå till sista sidan","tr-TR":"Son sayfaya git","zh-CN":"转到最后一页","zh-TW":"移至最後一頁"}},NebulaTableUtils_Pagination_NextPage:{id:"NebulaTableUtils.Pagination.NextPage",locale:{"de-DE":"Zur nächsten Seite","en-US":"Go to the next page","es-ES":"Ir a la página siguiente","fr-FR":"Accéder à la page suivante","it-IT":"Vai alla pagina successiva","ja-JP":"次のページに移動","ko-KR":"다음 페이지로 이동","nl-NL":"Ga naar de volgende pagina","pl-PL":"Przejdź do następnej strony","pt-BR":"Ir para a próxima página","ru-RU":"Перейти к следующей странице","sv-SE":"Gå till nästa sida","tr-TR":"Sonraki sayfaya git","zh-CN":"转到下一页","zh-TW":"移至下一頁"}},NebulaTableUtils_Pagination_PreviousPage:{id:"NebulaTableUtils.Pagination.PreviousPage",locale:{"de-DE":"Zur vorherigen Seite","en-US":"Go to the previous page","es-ES":"Ir a la página anterior","fr-FR":"Accéder à la page précédente","it-IT":"Vai alla pagina precedente","ja-JP":"前のページに移動","ko-KR":"이전 페이지로 이동","nl-NL":"Ga naar de vorige pagina","pl-PL":"Przejdź do poprzedniej strony","pt-BR":"Ir para a página anterior","ru-RU":"Перейти к предыдущей странице","sv-SE":"Gå till föregående sida","tr-TR":"Önceki sayfaya git","zh-CN":"转到前一页","zh-TW":"移至上一頁"}},NebulaTableUtils_Pagination_RowsPerPage:{id:"NebulaTableUtils.Pagination.RowsPerPage",locale:{"de-DE":"Zeilen pro Seite","en-US":"Rows per page","es-ES":"Filas por página","fr-FR":"Lignes par page","it-IT":"Righe per pagina","ja-JP":"ページあたりの行数","ko-KR":"페이지별 행 수","nl-NL":"Rijen per pagina","pl-PL":"Wierszy na stronę","pt-BR":"Linhas por página","ru-RU":"Строк на странице","sv-SE":"Rader per sida","tr-TR":"Sayfa başına satır sayısı","zh-CN":"每页行数","zh-TW":"每頁列數"}},NebulaTableUtils_Pagination_SelectPage:{id:"NebulaTableUtils.Pagination.SelectPage",locale:{"de-DE":"Seite auswählen","en-US":"Select page","es-ES":"Seleccionar página","fr-FR":"Sélectionner une page","it-IT":"Seleziona pagina","ja-JP":"ページを選択","ko-KR":"페이지 선택","nl-NL":"Pagina selecteren","pl-PL":"Wybierz stronę","pt-BR":"Selecionar página","ru-RU":"Выберите страницу","sv-SE":"Välj sida","tr-TR":"Sayfa seç","zh-CN":"选择页面","zh-TW":"選取頁面"}}};const Sz=({translator:e})=>(f((()=>{!function(e){if(e&&e.get&&e.add){const t="NebulaTableUtils.MenuGroupLabel.Sorting";if(e.get(t)!==t)return;Object.keys(wz).forEach((t=>{e.add(wz[t])}))}}(e)}),[e]),e),Cz={width:"100%",height:"100%",color:"transparent",background:"transparent",borderColor:"transparent"},Mz={border:0,boxShadow:"none",borderRadius:0,outline:0,width:0,height:0,background:"transparent",cursor:"pointer",visibility:"hidden"},kz=ll("input",{shouldForwardProp:e=>"isLastColumn"!==e&&"hoverColor"!==e})((({isLastColumn:e,hoverColor:t,dir:n})=>({position:"absolute",display:"flex",height:"100%",top:0,marginLeft:"-4px",marginRight:"rtl"===n?"-4px":void 0,touchAction:"none",cursor:"col-resize",pointerEvents:"auto",width:(e?4:9)+"px",justifyContent:e?"flex-end":"center",outline:"none",appearance:"none",WebkitAppearance:"none",backgroundColor:"transparent","&::-webkit-slider-runnable-track":{...Cz},"&::-moz-range-track":{...Cz},"&::-ms-track":{...Cz},"&::-webkit-slider-thumb":{appearance:"none",WebkitAppearance:"none",...Mz},"&::-moz-range-thumb":{...Mz},"&::-ms-thumb":{...Mz},"&:hover:not(:focus, :active)":{"&::after":{backgroundColor:t||"#D9D9D9","@media (hover: none)":{backgroundColor:"none"}}},"&:focus-visible, &:active":{"&::after":{backgroundColor:"#177fe6",borderLeft:"1px solid #fff",borderRight:e?void 0:"1px solid #fff"}},"&::after":{content:'""',height:"100%",width:"3px",position:"absolute"}}))),Ez=({columnWidth:e,keyValue:t,isLastColumn:n,isPivot:r,hoverColor:i,updateWidthCallback:o,confirmWidthCallback:s,handleBlur:l,setIsAdjustingWidth:c,isLeftColumn:u,accessibilityRelatedArgs:d,direction:h="ltr"})=>{const p=Sz({translator:d.translator}),f=a({initWidth:e,columnWidth:e,initX:0}),m=n?0:1,g=r&&!u,y=()=>g?f.current.columnWidth-m:"100%",v={left:"rtl"!==h?y():void 0,right:"rtl"===h?y():void 0},b=t=>{f.current={initWidth:e,columnWidth:e,initX:t??f.current.initX}};xz((()=>{g&&b()}),[e]);const x=e=>{const t=Math.max(e,_T.PixelsMin);f.current.columnWidth=t,o(t)},w=()=>{if(f.current.columnWidth!==f.current.initWidth){const e={type:RT.Pixels,pixels:f.current.columnWidth};s(e)}else c?.(!1)},S=e=>{const t="rtl"===h?f.current.initWidth+f.current.initX-e.clientX:f.current.initWidth+e.clientX-f.current.initX;x(t)},C=e=>{kj(e),document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",C),w()},M=e=>{const t="rtl"===h?f.current.initWidth+-f.current.initX-e.touches[0].clientX:f.current.initWidth+e.touches[0].clientX-f.current.initX;x(t)},k=e=>{kj(e),document.removeEventListener("touchmove",M),document.removeEventListener("touchend",k),w()},E=!r&&l?e=>{if(e.key===kT.Left||e.key===kT.Right){kj(e);const t=5,n=e.key===kT.Left?t:-t,r="rtl"===h?n:-n;c?.(!0),x(f.current.columnWidth+r)}else e.key===kT.Space||e.key===kT.Enter?(kj(e),l(e),c?.(!1),w()):e.key===kT.Esc&&(kj(e),l(e),c?.(!1),x(f.current.initWidth))}:void 0,_=p.get("NebulaTableUtils.ColumnAdjuster.ColumnNameLabel",[String(d.columnLabel)]);return Ji.jsx(kz,{style:v,hoverColor:i,isLastColumn:n,className:ET,"data-testid":ET,onMouseDown:e=>{kj(e),document.addEventListener("mousemove",S),document.addEventListener("mouseup",C),c?.(!0),b(e.clientX)},onDoubleClick:()=>{s({type:RT.FitToContent})},onTouchStart:e=>{1===e.touches.length&&(kj(e),document.addEventListener("touchmove",M),document.addEventListener("touchend",k),c?.(!0),b(e.touches[0].clientX))},onKeyDown:E,onBlur:l,onFocus:()=>{b()},type:"range",tabIndex:-1,"aria-label":_,"aria-valuemin":_T.PixelsMin,"aria-valuemax":_T.PixelsMax,"aria-valuenow":Number(e.toFixed(1)),dir:h},t)},_z=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M15 4H1V2h14zm0 10H1v-2h14zm0-5H1V7h14z"})}))),Rz=ll(Yc,{shouldForwardProp:e=>"rightAligned"!==e&&"shouldShowMenuIcon"!==e&&"isAccessibleHeader"!==e})((({rightAligned:e,shouldShowMenuIcon:t,isAccessibleHeader:n})=>({...e?{marginRight:"auto"}:{marginLeft:"auto"},height:n?24:void 0,display:t?"flex":"none",fontWeight:"bold",width:n?"100%":void 0,alignItems:"center",justifyContent:"center"}))),Iz=ll(_z,{shouldForwardProp:e=>"isInteractionsActive"!==e})((({isInteractionsActive:e})=>({minWidth:"unset",position:"relative",cursor:e?"pointer":"default"}))),Dz=ll(ch)((({theme:e})=>({".MuiList-root":{padding:e.spacing(.5,0)}}))),Az=ll($u)((({theme:e})=>({"&.MuiDivider-root":{margin:e.spacing(.5)}}))),Pz=ll(fh)((({theme:e})=>({fontSize:"12px",height:24,fontWeight:"bold",padding:`${e.spacing(.25,2)} !important`,marginBottom:e.spacing(.5)}))),Oz=ll(fh,{shouldForwardProp:e=>"isSubMenu"!==e&&"isActive"!==e})((({theme:e,isSubMenu:t,isActive:n})=>({width:`calc(220px - ${e.spacing(1)} - ${t?10:0}px)`,maxHeight:32,borderRadius:`${e.spacing(.5)} !important`,margin:`${e.spacing(.25,.5)} !important`,padding:`${e.spacing(1,1.5)} !important`,display:"flex !important",justifyContent:"space-between !important","&&:focus":{boxShadow:"rgb(23, 127, 230) 0px 0px 0px 2px"},position:"relative !important",overflow:"hidden",boxSizing:"border-box !important",background:n?"rgba(0, 0, 0, 0.05)":"transparent"}))),Tz=ll("div",{shouldForwardProp:e=>!["direction","isPagination"].includes(e)})((({theme:e,direction:t,isPagination:n})=>({position:"absolute",width:e.spacing(.5),height:16,left:0,right:n||"rtl"!==t?void 0:0,top:"50%",transform:"TranslateY(-50%)",borderRadius:"0 2px 2px 0",background:"#01873d"}))),Lz=ll("div")((()=>({display:"flex",justifyContent:"space-between",alignItems:"center",maxWidth:"100%"}))),qz=ll(uc)((()=>({fontFamily:'"Source Sans Pro", HelveticaNeue, "Helvetica Neue", Helvetica, Arial, sans-serif',fontSize:"14px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"}))),Nz=ll(qd,{shouldForwardProp:e=>!["direction","isPagination"].includes(e)})((({theme:e,direction:t,isPagination:n})=>({width:16,minWidth:"unset !important",marginRight:n||"rtl"!==t?e.spacing(1.5):0,marginLeft:n||"rtl"!==t?void 0:e.spacing(1.5),lineHeight:0}))),jz=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M8.5 8 4 3.5 5.5 2l6 6-6 6L4 12.5z"})}))),zz=e=>{const t=e.nextElementSibling;return t?"HR"===t.tagName?zz(t):t:e.parentElement?.children?.[0]},Fz=e=>{const t=e.previousElementSibling;if(!t){const t=e.parentElement?.children?.length;return e.parentElement?.children?.[t-1]}return"HR"===t.tagName?Fz(t):t},Wz=e=>{const{key:t,currentTarget:n}=e,r=document.activeElement??n;if(t===kT.Down||t===kT.Up){const n=e=>t===kT.Down?zz(e):Fz(e);e.preventDefault(),e.stopPropagation();let i=n(r);for(;i;){if("true"!==i.ariaDisabled){i.focus();break}i=n(i)}}},$z=(e,t)=>e.map((e=>e.map((e=>({...e.groupHeading?{groupHeading:e.groupHeading}:{},items:e.items.map((({onClick:e,...n})=>({...n,...e?{onClick:async n=>{Object.entries(t).forEach((([,e])=>{e(!1)})),await e(n)}}:{}})))})))));let Bz={};const Hz=({autoFocus:e,id:n,onClick:r,itemTitle:i,icon:o,enabled:a,subMenus:s,isSubMenu:l,isActive:c,direction:u,isPagination:d})=>{const[p,f]=m(!1),g=t.useRef(null),y=h((e=>{e.stopPropagation(),f(!1)}),[f]);return Ji.jsxs(Ji.Fragment,{children:[Ji.jsxs(Oz,{ref:s?g:null,"data-testid":`menu-item-${n}`,className:"nebula-table-utils-head-menu-item",onClick:async e=>{"keyup"!==e.type&&(r&&(await r(e),Bz={}),s?.length&&(f(!0),Bz[i]=f,e.stopPropagation()))},disabled:!a,autoFocus:e,isSubMenu:!!l,isActive:!!c,onKeyDown:Wz,children:[c?Ji.jsx(Tz,{direction:u,isPagination:d}):null,Ji.jsxs(Lz,{children:[Ji.jsx(Nz,{direction:u,isPagination:d,children:Ji.jsx(o,{})}),Ji.jsx(qz,{variant:"body2",children:i})]}),s?.length?Ji.jsx(jz,{}):null]},n),s?.length?Ji.jsx(Yz,{isSubMenu:!0,open:p,anchorEl:g.current,onClose:y,menuGroups:$z(s,Bz),transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"top"},direction:u,isPagination:d}):null]})},Vz=({menuGroup:e,isSubMenu:t,direction:n,isPagination:r})=>e.map((e=>[[e.groupHeading&&Ji.jsx(Pz,{disabled:!0,style:{opacity:1},children:e.groupHeading},e.groupHeading),e.items.map((e=>Ji.jsx(Hz,{...e,isSubMenu:t,direction:n,isPagination:r},e.id)))].filter(Boolean)])),Gz=({itemGroups:e,isSubMenu:t,direction:n,isPagination:r})=>e.map(((i,o)=>[Vz({menuGroup:i,isSubMenu:t,direction:n,isPagination:r}),o<e.length-1?Ji.jsx(Az,{"data-testid":"group-divider",variant:"middle"}):void 0])),Uz={appear:0,enter:0,exit:0},Yz=({anchorEl:e,open:t,onClose:n,menuGroups:r,transformOrigin:i,anchorOrigin:o,isSubMenu:a,direction:s,isPagination:l})=>r.length?Ji.jsx(Dz,{className:"nebula-table-utils-head-menu",open:t,anchorEl:e,onClose:n,transitionDuration:Uz,MenuListProps:{id:"nebula-table-utils-head-menu-list-id"},...o?{anchorOrigin:o}:{},...i?{transformOrigin:i}:{},dir:s,children:Gz({itemGroups:r,isSubMenu:a,direction:s,isPagination:l})}):null,Kz=(e,t)=>e.some((e=>t[e]>0)),Xz={canSelectAll:!1,canClearSelections:!1,canSelectPossible:!1,canSelectAlternative:!1,canSelectExcluded:!1},Jz=({open:e,qStateName:t="$",headerData:n,app:r})=>{const[i,o]=m(null),[a,s]=m(Xz);return xz((()=>{e||(s(Xz),o(null))}),[e]),c((()=>{if(!r?.createSessionObject||!n.isDim||!e)return()=>{};let i,a=!1;const l=()=>{i&&r.destroySessionObject(i)};return(async()=>{try{const e=((e,t)=>({qInfo:{qType:"tableListbox"},qListObjectDef:Boolean(t.qLibraryId)?{qLibraryId:t.qLibraryId,qStateName:e}:{qDef:{qFieldDefs:[t.fieldId]},qStateName:e}}))(t,n),c=await r.createSessionObject(e),u=await c.getLayout(),{qStateCounts:d}=u.qListObject?.qDimensionInfo??{};i=u.qInfo?.qId,a?l():(o(c),d&&s((e=>({canSelectAll:Kz(["qOption","qAlternative","qExcluded","qDeselected"],e),canClearSelections:Kz(["qSelected"],e),canSelectPossible:Kz(["qOption"],e),canSelectAlternative:Kz(["qAlternative"],e),canSelectExcluded:Kz(["qAlternative","qExcluded"],e)}))(d)))}catch(e){console.error(e)}})(),()=>{a=!0,l()}}),[e,r,n,t]),{fieldInstance:i,selectionActionsEnabledStatus:a}},Zz=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M3.5 1.793 6.207 4.5l-.707.707-1.5-1.5V14H3V3.707l-1.5 1.5L.793 4.5zM8 4h5v1H8zm0 3h6v1H8zm0 3h7v1H8z"})}))),Qz=v(((e,t)=>Ji.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 16 16",height:"16px",role:"img",ref:t,...e,children:[Ji.jsx("g",{clipPath:"url(#clear_selections_svg__clip0_482_2951)",children:Ji.jsx("path",{d:"M1 14.5a.5.5 0 0 0 .5.5H3v1H1.5A1.5 1.5 0 0 1 0 14.5V13h1zm9 1.5H6v-1h4zm5.354-8.646L12.707 10l2.646 2.646-.707.707L12 10.708l-2.646 2.646-.708-.707L11.293 10 8.646 7.354l.708-.708L12 9.293l2.646-2.647zM1 10H0V6h1zm2-9H1.5a.5.5 0 0 0-.5.5V3H0V1.5A1.5 1.5 0 0 1 1.5 0H3zm11.5-1A1.5 1.5 0 0 1 16 1.5V3h-1V1.5a.5.5 0 0 0-.5-.5H13V0zM10 1H6V0h4z"})}),Ji.jsx("defs",{children:Ji.jsx("clipPath",{id:"clear_selections_svg__clip0_482_2951",children:Ji.jsx("path",{d:"M0 0h16v16H0z"})})})]}))),eF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M3.914 8h8.207L10.5 6.379l.707-.708L14.036 8.5l-2.829 2.828-.707-.707L12.12 9H3.914l1.621 1.621-.707.707L2 8.5l2.828-2.828.707.707zM15 1a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zm0 13V2h-2v3h-1V2H4v3H3V2H1v12h2v-2h1v2h8v-2h1v2z"})}))),tF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M3 2h1v10.293l1.5-1.5.707.707L3.5 14.207.793 11.5l.707-.707 1.5 1.5zm12 2H8v1h7zM8 7h6v1H8zm5 3H8v1h5z"})}))),nF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M8 15c-3.848 0-7-3.152-7-7s3.152-7 7-7 7 3.152 7 7-3.152 7-7 7m0 1c4.4 0 8-3.6 8-8s-3.6-8-8-8-8 3.6-8 8 3.6 8 8 8m4-7.5H4v-1h8z"})}))),rF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M8 15c-3.848 0-7-3.152-7-7s3.152-7 7-7 7 3.152 7 7-3.152 7-7 7m0 1c4.4 0 8-3.6 8-8s-3.6-8-8-8-8 3.6-8 8 3.6 8 8 8m4-7.5H4v-1h8zM8.5 4v8h-1V4z"})}))),iF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M1 8a7 7 0 1 1 10 6.326V11h-1v5h5v-1h-3.124A8 8 0 1 0 8 16v-1a7 7 0 0 1-7-7"})}))),oF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M9.057 11.164a6 6 0 1 1 2.112-2.116 1 1 0 0 1 .052.044l4.176 4.08a1 1 0 0 1 .009 1.422l-.707.707a1 1 0 0 1-1.406.008l-4.185-4.087a1 1 0 0 1-.05-.058ZM10.5 6a4.5 4.5 0 1 0-9 0 4.5 4.5 0 0 0 9 0"})}))),aF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M3 4v1H1v10h10v-2h1v2a1 1 0 0 1-.883.993L11 16H1a1 1 0 0 1-.993-.883L0 15V5a1 1 0 0 1 .883-.993L1 4zm12-4a1 1 0 0 1 .993.883L16 1v10a1 1 0 0 1-.883.993L15 12H5a1 1 0 0 1-.993-.883L4 11V1a1 1 0 0 1 .883-.993L5 0zm0 1H5v10h10zm-2.36 2.653.72.694L9.143 8.72 6.64 6.125l.72-.694L9.143 7.28z"})}))),sF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M6 15.5a.5.5 0 0 1 .5-.5h3a.5.5 0 1 1 0 1h-3a.5.5 0 0 1-.5-.5m-5-2v1a.5.5 0 0 0 .5.5h1a.5.5 0 1 1 0 1H1a1 1 0 0 1-1-1v-1.5a.5.5 0 1 1 1 0m14 0a.5.5 0 1 1 1 0V15a1 1 0 0 1-1 1h-1.5a.5.5 0 1 1 0-1h1a.5.5 0 0 0 .5-.5zm-14-7v3a.5.5 0 0 1-1 0v-3a.5.5 0 0 1 1 0m15 0v3a.5.5 0 1 1-1 0v-3a.5.5 0 1 1 1 0m-16-4V1a1 1 0 0 1 1-1h1.5a.5.5 0 0 1 0 1h-1a.5.5 0 0 0-.5.5v1a.5.5 0 0 1-1 0m6-2a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3A.5.5 0 0 1 6 .5m9 2v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 1 1 0-1H15a1 1 0 0 1 1 1v1.5a.5.5 0 1 1-1 0M4 4v8l8-8zm0-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1"})}))),lF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M6 15.5a.5.5 0 0 1 .5-.5h3a.5.5 0 1 1 0 1h-3a.5.5 0 0 1-.5-.5m-5-2v1a.5.5 0 0 0 .5.5h1a.5.5 0 1 1 0 1H1a1 1 0 0 1-1-1v-1.5a.5.5 0 1 1 1 0m14 0a.5.5 0 1 1 1 0V15a1 1 0 0 1-1 1h-1.5a.5.5 0 1 1 0-1h1a.5.5 0 0 0 .5-.5zm-14-7v3a.5.5 0 0 1-1 0v-3a.5.5 0 0 1 1 0m15 0v3a.5.5 0 1 1-1 0v-3a.5.5 0 1 1 1 0m-16-4V1a1 1 0 0 1 1-1h1.5a.5.5 0 0 1 0 1h-1a.5.5 0 0 0-.5.5v1a.5.5 0 0 1-1 0m6-2a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3A.5.5 0 0 1 6 .5m9 2v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 1 1 0-1H15a1 1 0 0 1 1 1v1.5a.5.5 0 1 1-1 0M4 3h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1"})}))),cF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M6 15.5a.5.5 0 0 1 .5-.5h3a.5.5 0 1 1 0 1h-3a.5.5 0 0 1-.5-.5m-5-2v1a.5.5 0 0 0 .5.5h1a.5.5 0 1 1 0 1H1a1 1 0 0 1-1-1v-1.5a.5.5 0 1 1 1 0m14 0a.5.5 0 1 1 1 0V15a1 1 0 0 1-1 1h-1.5a.5.5 0 1 1 0-1h1a.5.5 0 0 0 .5-.5zm-14-7v3a.5.5 0 0 1-1 0v-3a.5.5 0 0 1 1 0m15 0v3a.5.5 0 1 1-1 0v-3a.5.5 0 1 1 1 0m-16-4V1a1 1 0 0 1 1-1h1.5a.5.5 0 0 1 0 1h-1a.5.5 0 0 0-.5.5v1a.5.5 0 0 1-1 0m6-2a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3A.5.5 0 0 1 6 .5m9 2v-1a.5.5 0 0 0-.5-.5h-1a.5.5 0 1 1 0-1H15a1 1 0 0 1 1 1v1.5a.5.5 0 1 1-1 0M4 4v8h8V4zm0-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1"})}))),uF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M1 1.5a.5.5 0 0 1 .5-.5H3V0H1.5A1.5 1.5 0 0 0 0 1.5V3h1zM14.5 1a.5.5 0 0 1 .5.5V3h1V1.5A1.5 1.5 0 0 0 14.5 0H13v1zM1 14.5a.5.5 0 0 0 .5.5H3v1H1.5A1.5 1.5 0 0 1 0 14.5V13h1zm14 0a.5.5 0 0 1-.5.5H13v1h1.5a1.5 1.5 0 0 0 1.5-1.5V13h-1zM6 0h4v1H6zM0 6h1v4H0zm15 0h1v4h-1zm-9 9h4v1H6z"})})));let dF=function(e){return e.Sorting="sorting",e.Searching="searching",e.Selections="selections",e.AdjusterHeaderSize="adjustHeaderSize",e}({});const hF="/qListObjectDef",pF=({headerData:e,translator:t,menuAvailabilityFlags:n,setOpen:r,sortFromMenu:i,interactions:o,embedListbox:a,fieldInstance:s,selectionActionsEnabledStatus:l,anchorRef:c,focusColumnAdjuster:u,setActiveFieldCallback:d,expandOrCollapseArgs:h})=>{const p=[];if(n[dF.Sorting]){const{isActivelySorted:n,sortDirection:o}=e,{ascendingEnabled:a,descendingEnabled:s}=(({isActivelySorted:e,sortDirection:t,isPivot:n,isSortedByFirstMeasure:r})=>{let i=!n&&!e||"D"===t,o=!n&&!e||"A"===t;return r&&(i=!1,o=!1),{ascendingEnabled:i,descendingEnabled:o}})(e);p.push([{groupHeading:t.get("NebulaTableUtils.MenuGroupLabel.Sorting"),items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SortAscending"),onClick:async e=>{e.stopPropagation(),await(i?.(e,"A")),r(!1)},icon:Zz,enabled:a,isActive:!!n&&"A"===o,autoFocus:a},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SortDescending"),onClick:async e=>{e.stopPropagation(),await(i?.(e,"D")),r(!1)},icon:tF,enabled:s,isActive:!!n&&"D"===o,autoFocus:!a&&s}]}])}if(e.isCyclic&&d){const t=[];t.push([{items:[{id:1,itemTitle:e.groupDimensionLabels[e.groupDimensionPos],enabled:!0,icon:iF,subMenus:[[{items:e.groupDimensionLabels.map(((t,n)=>({id:n+1,itemTitle:t,onClick:async e=>{e.stopPropagation(),r(!1),d(n)},enabled:!0,icon:dL,isActive:e.groupDimensionPos===n})))}]]}]}]),t.length>0&&p.push(...t)}if(e.isDim&&o?.select){const i=[];n[dF.Searching]&&i.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Search"),onClick:e=>{e.stopPropagation(),r(!1),a()},icon:oF,enabled:!0}]}]),!e.isLocked&&n[dF.Selections]&&i.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Selections"),icon:uF,enabled:!!s,subMenus:[[{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectAll"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectAll(hF))},icon:aF,enabled:l.canSelectAll},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectPossible"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectPossible(hF))},icon:cF,enabled:l.canSelectPossible},{id:3,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectAlternative"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectAlternative(hF))},icon:sF,enabled:l.canSelectAlternative},{id:4,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectExcluded"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectExcluded(hF))},icon:lF,enabled:l.canSelectExcluded}]}],[{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.ClearSelections"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.clearSelections(hF))},icon:Qz,enabled:l.canClearSelections}]}]]}]}]),h&&!h.alwaysFullyExpanded&&p.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Expand"),onClick:async e=>{e.stopPropagation(),e.preventDefault(),r(!1),await h.expandCallback()},icon:rF,enabled:!0},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Collapse"),onClick:async e=>{e.stopPropagation(),e.preventDefault(),r(!1),await h.collapseCallback()},icon:nF,enabled:!0}]}]),i.length>0&&p.push(...i)}return n[dF.AdjusterHeaderSize]&&p.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.AdjustColumnSize"),onClick:e=>{e.stopPropagation(),e.preventDefault(),r(!1),u?.(c)},icon:eF,enabled:!0}]}]),p},fF=({open:e,setOpen:t,anchorRef:n,headerData:r,translator:i,interactions:o,menuAvailabilityFlags:s,shouldShowMenuIcon:l=!0,sortRelatedArgs:c,searchRelatedArgs:u,selectionRelatedArgs:d,adjustHeaderSizeRelatedArgs:p,expandOrCollapseArgs:f,model:m,direction:g="ltr",isPagination:y,isAccessibleHeader:v,iconSize:b=wT})=>{const x=a(null),w=Sz({translator:i}),{qLibraryId:S,fieldId:C,headTextAlign:M}=r,k=d?.app,{fieldInstance:E,selectionActionsEnabledStatus:_}=Jz({open:e,headerData:r,app:k,qStateName:d?.qStateName}),R=(({model:e,headerData:t})=>{if(e&&"setActiveField"in e&&void 0!==t.dimensionInfoIndex){const n=t.dimensionInfoIndex;return async t=>{try{await e.setActiveField("/qHyperCubeDef",n,t)}catch(e){console.error(e)}}}return null})({model:m,headerData:r}),I=(({qLibraryId:e,fieldId:t,searchRelatedArgs:n,selectionRelatedArgs:r,direction:i,onPopoverClose:o})=>h((()=>{const a=e?{qLibraryId:e,type:"dimension"}:t;if(n?.embed){const{embed:e,listboxRef:t}=n;e.__DO_NOT_USE__.popover(t.current,a,{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"rtl"===i?"right":"left"},sortCriteria:n.sortCriteria,stateName:r?.qStateName,direction:i,onPopoverClose:o})}}),[e,t,n,r?.qStateName,i,o]))({qLibraryId:S,fieldId:C,searchRelatedArgs:u,selectionRelatedArgs:d,direction:g}),D=h((e=>{e.stopPropagation(),t(!1)}),[t]),A=h((e=>{e.stopPropagation(),t((e=>!e))}),[t]);return o.active?Ji.jsxs(Rz,{rightAligned:"right"===M,shouldShowMenuIcon:l,className:"nebula-table-utils-head-menu-wrapper",onClick:!1===v?A:void 0,ref:x,isAccessibleHeader:v,children:[l?Ji.jsx(Iz,{height:b,className:ST,"data-testid":ST,isInteractionsActive:o.active??!1,children:Ji.jsx(_z,{})}):null,Ji.jsx(Yz,{open:e,anchorEl:!1===v?x.current:n.current,onClose:D,menuGroups:pF({headerData:r,translator:w,menuAvailabilityFlags:s,setOpen:t,...c,embedListbox:I,interactions:o,fieldInstance:E,selectionActionsEnabledStatus:_,anchorRef:n,focusColumnAdjuster:p?.focusColumnAdjuster,setActiveFieldCallback:R,expandOrCollapseArgs:f}),direction:g,isPagination:y})]}):null},mF=e=>e.isDark?{background:e.color,borderColor:xj.DARK_MODE_BORDER,color:xj.DARK_MODE_TEXT,disabledColor:xj.DARK_MODE_DISABLED,iconColor:xj.DARK_MODE_TEXT}:{background:e.color,borderColor:xj.BORDER_MEDIUM,color:xj.TEXT,disabledColor:xj.DISABLED},gF=ll(Yc,{shouldForwardProp:e=>"footerStyle"!==e})((({footerStyle:e,theme:t})=>({height:40,display:"flex",justifyContent:"flex-end",alignItems:"center",padding:t.spacing(0,1,0,1),color:e.color,background:e.background,borderTop:`1px solid ${e.borderColor}`}))),yF=ll(Yh,{shouldForwardProp:e=>"footerStyle"!==e})((({footerStyle:e,theme:t})=>({background:"inherit",marginRight:t.spacing(1),color:e.color,"& .MuiNativeSelect-icon, .MuiNativeSelect-select":{color:e.iconColor}}))),vF=ll(iu,{shouldForwardProp:e=>"disabledCondition"!==e&&"footerStyle"!==e})((({disabledCondition:e,footerStyle:t,theme:n})=>({color:e?t.disabledColor:t.color,cursor:e?"default":"pointer",marginLeft:n.spacing(1)}))),bF=ll(uc)((({theme:e})=>({color:"inherit",margin:e.spacing(0,1,0,1)}))),xF=({children:e,footerContainer:t,interactions:n,theme:r,paginationNeeded:i=!0})=>{const o=f((()=>mF(r.background)),[r]);if(!n.active)return null;const a=i?Ji.jsx(gF,{footerStyle:o,children:e}):null;return t?C.createPortal(e,t):a},wF=s({}),SF=()=>d(wF),CF=({children:e,direction:t,pageInfo:n,handleChangeRowsPerPage:r,footerContainer:i,isSelectionMode:o,handleChangePage:a,totalRowCount:s,totalColumnCount:l,totalPages:c,keyboard:u,translator:d,theme:h,interactions:p,rect:m,layout:g,visibilityThreshold:y})=>{const v=(e=>!e.enabled||e.active)(u)?0:-1,b=f((()=>mF(h.background)),[h]),x=i?i.getBoundingClientRect().width:m.width,w=Sz({translator:d}),S=f((()=>({direction:t,pageInfo:n,handleChangeRowsPerPage:r,footerContainer:i,isSelectionMode:o,handleChangePage:a,totalRowCount:s,totalColumnCount:l,totalPages:c,keyboard:u,translator:w,theme:h,interactions:p,rect:m,layout:g,footerStyle:b,tabIndex:v,width:x,visibilityThreshold:y})),[t,n,r,i,o,a,s,l,c,u,w,h,p,m,g,b,v,x,y]);return Ji.jsx(wF.Provider,{value:S,children:e})};let MF=function(e){return e.FirstPage="FirstPage",e.LastPage="LastPage",e.NextPage="NextPage",e.PreviousPage="PreviousPage",e}({}),kF=function(e){return e[e.DisplayedRowsLabel=250]="DisplayedRowsLabel",e[e.FirstPage=350]="FirstPage",e[e.LastPage=350]="LastPage",e[e.RowsPerPage=550]="RowsPerPage",e[e.SelectPage=700]="SelectPage",e}({});const EF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"m7 8 4.5 4.5L10 14 4 8l6-6 1.5 1.5z"})}))),_F=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"m12 2 1.5 1.5L9 8l4.5 4.5L12 14 6 8zM4 2v12H2V2z"})}))),RF=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"m3.5 2 6 6-6 6L2 12.5 6.5 8 2 3.5zM14 2v12h-2V2z"})}))),IF={FirstPage:_F,PreviousPage:EF,NextPage:jz,LastPage:RF,FirstPageRTL:RF,PreviousPageRTL:jz,NextPageRTL:EF,LastPageRTL:_F},DF=({disabledCondition:e,pageNumber:t,type:n})=>{const{direction:r,footerStyle:i,handleChangePage:o,translator:a,interactions:s,tabIndex:l}=SF(),c=n.concat("rtl"===r?"RTL":""),u=IF[c];return{styledProps:{footerStyle:i,disabledCondition:e,size:"small","data-testid":"pagination-action-icon-button","aria-disabled":e,"aria-label":a.get(`NebulaTableUtils.Pagination.${n}`),title:s.passive?a.get(`NebulaTableUtils.Pagination.${n}`):void 0,tabIndex:l,onClick:e?void 0:()=>{o(t)}},IconComponent:u}},AF=()=>{const{pageInfo:e,width:t,interactions:n,visibilityThreshold:r}=SF(),i=0===e.page,{IconComponent:o,styledProps:a}=DF({type:MF.FirstPage,disabledCondition:i,pageNumber:0});return t<=(r?.firstPage||kF.FirstPage)?null:Ji.jsx(vF,{...a,disabled:!n.active,children:Ji.jsx(o,{height:wT})})},PF=(e,t,n=!1)=>{n&&e.key===kT.Tab&&!e.shiftKey&&(kj(e),((e,t,n)=>{const r=e.closest(".qv-object-wrapper")?.querySelector(".sel-toolbar-confirm")?.parentElement??document.querySelector("#qv-selection-toolbar-popover .sel-toolbar-confirm")?.parentElement;r?r.focus():t.focusSelection?.(n)})(e.target,t,!1))},OF=()=>{const{pageInfo:e,keyboard:t,totalPages:n,isSelectionMode:r,width:i,interactions:o,visibilityThreshold:a}=SF(),s=e.page>=n-1,{IconComponent:l,styledProps:c}=DF({type:MF.LastPage,disabledCondition:s,pageNumber:n-1}),u=t.enabled?e=>{PF(e,t,r)}:void 0;return i<=(a?.lastPage||kF.LastPage)?null:Ji.jsx(vF,{...c,onKeyDown:u,disabled:!o.active,children:Ji.jsx(l,{height:wT})})},TF=()=>{const{pageInfo:e,keyboard:t,totalPages:n,isSelectionMode:r,width:i,interactions:o}=SF(),a=e.page>=n-1,{IconComponent:s,styledProps:l}=DF({type:MF.NextPage,disabledCondition:a,pageNumber:e.page+1}),c=!(i>kF.FirstPage&&i>kF.LastPage)&&t.enabled?e=>{PF(e,t,r)}:void 0;return Ji.jsx(vF,{...l,onKeyDown:c,disabled:!o.active,children:Ji.jsx(s,{height:wT})})},LF=()=>{const{pageInfo:e,interactions:t}=SF(),n=0===e.page,{IconComponent:r,styledProps:i}=DF({type:MF.PreviousPage,disabledCondition:n,pageNumber:e.page-1});return Ji.jsx(vF,{...i,disabled:!t.active,children:Ji.jsx(r,{height:wT})})},qF=()=>{const{translator:e,width:t,pageInfo:n,totalRowCount:r,visibilityThreshold:i}=SF(),{page:o,rowsPerPage:a}=n;if(t<=(i?.displayedRowsLabel||kF.DisplayedRowsLabel))return null;const s=e.get("NebulaTableUtils.Pagination.DisplayedRowsLabel",[`${o*a+1} - ${Math.min((o+1)*a,r)}`,r.toString()]);return Ji.jsx(bF,{variant:"caption",dir:"ltr",children:s})},NF=({name:e,value:t,options:n,handleChange:r})=>{const{layout:i,footerStyle:o,translator:a,tabIndex:s,interactions:l}=SF(),c=i.qInfo.qId,u=a.get(`NebulaTableUtils.Pagination.${e}`),d=`${e}-dropdown`,h=`${d}-label-${c}`,p={tabIndex:s,id:`${d}-${c}`,"data-testid":d,"aria-labelledby":h};return Ji.jsxs(Ji.Fragment,{children:[Ji.jsxs(bF,{variant:"caption",id:h,children:[u,":"]}),Ji.jsx(yF,{footerStyle:o,size:"small",native:!0,value:t,onChange:r,inputProps:p,disabled:!l.active,children:n})]})},jF=()=>{const{pageInfo:e,isSelectionMode:t,totalColumnCount:n,width:r,handleChangeRowsPerPage:i,visibilityThreshold:o}=SF();if(!(!!e.rowsPerPageOptions?.length&&!t&&r>(o?.rowsPerPage||kF.RowsPerPage)&&n<=100)||void 0===e.rowsPerPageOptions)return null;const a=Ji.jsx(Ji.Fragment,{children:e.rowsPerPageOptions.map((e=>Ji.jsx("option",{value:e,children:e},e)))});return Ji.jsx(NF,{name:"RowsPerPage",value:e.rowsPerPage,options:a,handleChange:e=>{i?.(+e.target.value)}})},zF=1e3,FF="…",WF=({totalPages:e,page:t})=>{const n=Math.min(e,zF),r=n<e&&t>500,i=r?Math.min(500+t,e):n,o=r?Math.max(0,i-zF):0,a=Array.from(Array(n).keys()).map((e=>{const t=e+o;return Ji.jsx("option",{value:t,children:t+1},t)}));return o>0&&a.unshift(Ji.jsx("option",{value:FF,disabled:!0,children:FF},"startMoreOptions")),i<e-1&&a.push(Ji.jsx("option",{value:FF,disabled:!0,children:FF},"endMoreOptions")),Ji.jsx(Ji.Fragment,{children:a})},$F=()=>{const{pageInfo:e,width:t,totalPages:n,handleChangePage:r,visibilityThreshold:i}=SF(),{page:o}=e;if(t<=(i?.selectPage||kF.SelectPage))return null;const a=Ji.jsx(WF,{totalPages:n,page:o});return Ji.jsx(NF,{name:"SelectPage",value:o,options:a,handleChange:e=>{r(+e.target.value)}})};var BF=g((e=>Ji.jsxs(CF,{...e,children:[Ji.jsx(jF,{}),Ji.jsx($F,{}),Ji.jsx(qF,{}),Ji.jsx(AF,{}),Ji.jsx(LF,{}),Ji.jsx(TF,{}),Ji.jsx(OF,{})]})));const HF=e=>Ji.jsx(xF,{...e,children:Ji.jsx(BF,{...e})}),VF=s({}),GF=()=>d(VF),UF=({rect:e,pageInfo:t,qPivotDataPages:n,updatePageInfo:r,direction:i,children:o})=>{const a=f((()=>({rect:e,pageInfo:t,qPivotDataPages:n,updatePageInfo:r,direction:i})),[e,t,n,r,i]);return Ji.jsx(VF.Provider,{value:a,children:o})},YF=s({}),KF=()=>d(YF),XF=({app:e,model:t,theme:n,embed:r,keyboard:i,translator:o,interactions:a,env:s,children:l})=>{const c=f((()=>({model:t,app:e,interactions:a,embed:r,theme:n,keyboard:i,env:s,translator:o})),[e,a,t,r,n,i,s,o]);return Ji.jsx(YF.Provider,{value:c,children:l})},JF=s({}),ZF=()=>d(JF),QF=({children:e,...t})=>Ji.jsx(JF.Provider,{value:t,children:e}),eW=()=>{const{text:e,fontFamily:t,fontSize:n,justifyContent:r,alignItems:i,height:o}=(()=>{const{theme:e,translator:t}=KF(),{layoutService:n}=ZF(),r=e.getStyle("","","fontFamily")??Lj;return n.hasData?n.hasLimitedData?{text:t.get("SNPivotTable.LimitedData"),fontSize:"13px",fontFamily:r,alignItems:"center",height:"22px"}:{}:{text:t.get("SNPivotTable.NoData"),fontSize:"16px",fontFamily:r,justifyContent:"center",alignItems:"center",height:"100%"}})();return void 0===e?null:Ji.jsx("div",{style:{display:"flex",justifyContent:r,alignItems:i,width:"100%",height:o},children:Ji.jsx("span",{style:{...Hj,fontFamily:t,fontSize:n,fontStyle:"italic",color:"#7b7a78"},children:e})})},tW="/qHyperCubeDef",nW=-1,rW="PSEUDO-DIM",iW=e=>e===nW?rW:(({cId:e})=>e??NL())(e),oW=({layoutService:e,visibleLeftDimensionInfos:t,cell:n,colIdx:r})=>{n&&(n.canBeResized=!0,n.colIdx=n.colIdx||r,n.dimensionInfoIndex===nW?n.columnWidthLocation=aj.Measures:n.isLeftDimension?n.columnWidthLocation=aj.Dimension:t.at(-1)===nW?n.columnWidthLocation=aj.Measures:e.hasPseudoDimOnLeft&&(n.columnWidthLocation=aj.Pivot))},aW=(e,t,n,r)=>{const i=iW(n),o=e.getDimensionInfoIndex(n),a=e.isLeftDimension(o);return n===nW?{id:i,colIdx:-1,label:"",sortDirection:"A",fieldId:"",isLocked:!1,isDim:!1,isCyclic:!1,groupDimensionPos:0,groupDimensionLabels:[],headTextAlign:"left",dimensionInfoIndex:o,canBeResized:!1,isLeftDimension:a,isLastDimension:r,columnWidthLocation:aj.Measures,isPivot:!0,qEffectiveDimensionName:void 0}:{id:i,colIdx:0,label:n.qFallbackTitle,qReverseSort:n.qReverseSort,sortDirection:n.qSortIndicator&&"N"!==n.qSortIndicator?n.qSortIndicator:"A",qLibraryId:n.qLibraryId,fieldId:n.qGroupFieldDefs[n.qGroupPos],isLocked:n.qLocked??!1,columnWidth:n.columnWidth,qApprMaxGlyphCount:n.qApprMaxGlyphCount,isDim:!0,isCyclic:n.qGrouping===AT.Cyclic,groupDimensionPos:n.qGroupPos,groupDimensionLabels:n.qGroupFallbackTitles,headTextAlign:"left",dimensionInfoIndex:o,canBeResized:!1,isLeftDimension:a,isLastDimension:r,columnWidthLocation:aj.Dimension,isPivot:!0,isSortedByFirstMeasure:t.isSortedByFirstMeasure,qEffectiveDimensionName:n.qEffectiveDimensionName}},sW=({layoutService:e,effectivePropertiesService:t,lastRow:n,lastCol:r})=>{let i=r;var o;n.length>0&&(i=(o=r).at(-1)===nW?o.slice(0,-1):o);const a=i.length+(n.length?1:0),s=Math.max(1,n.length),l=((e,t)=>Array(e).fill(null).map((()=>Array.from({length:t},(()=>null)))))(a,s);return n.forEach(((n,r,i)=>{const o=r===i.length-1;l[a-1][r]=aW(e,t,n,o)})),i.forEach(((n,r,i)=>{const o=r===i.length-1;l[r][s-1]=aW(e,t,n,o)})),l},lW=(e,t,n,r)=>{const i=((e,t,n,r)=>{let i;return i=0===n.length||n.includes(nW)?sW({layoutService:e,effectivePropertiesService:t,lastRow:r,lastCol:n}):(e=>e[0].map(((t,n)=>e.map((e=>e[n])))))(sW({layoutService:e,effectivePropertiesService:t,lastRow:n,lastCol:r})),e.isIndentModeEnabled&&i[i.length-1].length>1&&(i[i.length-1]=[i.at(-1),...new Array(i[0]?i[0].length-1:0).fill(null)]),i.length&&i.at(-1)?.forEach(((t,n)=>{Array.isArray(t)?t.forEach(((t,n)=>{oW({layoutService:e,visibleLeftDimensionInfos:r,cell:t,colIdx:n})})):oW({layoutService:e,visibleLeftDimensionInfos:r,cell:t,colIdx:n})})),i})(e,t,n,r);return{data:i,size:{x:i[0]?.length??0,y:i.length}}};var cW={fromSearchString:function(e){if(!e)return[];"?"===e[0]&&(e=e.substr(1));const t=[];return e.split("&").forEach((e=>{if(!e)return;const n=e.indexOf("=");let r,i="",o=!1;-1===n?r=e:(r=e.slice(0,n),i=e.slice(n+1),o=!0),t.push(function(e,t,n){return{key:dW(e),value:dW(t),useEqualSign:n}}(r,i,o))})),t}},uW=cW;function dW(e){try{return decodeURIComponent(e)}catch{return e}}function hW(e){if(!(this instanceof hW))throw new Error("Url needs to be called with the new keyword");if(!e)throw new Error("Url needs a string to operate on");const t=function(e){const t={authorityAndPath:"",search:"",hash:""};let n=e.indexOf("#");-1!==n&&(t.hash=e.substr(n),e=e.substr(0,n));n=e.indexOf("?"),-1!==n&&(t.search=e.substr(n),e=e.substr(0,n));return t.authorityAndPath=e,t}(e);Object.defineProperties(this,{authorityAndPath:{value:t.authorityAndPath},search:{value:t.search},hash:{value:t.hash},searchParams:{get:()=>uW.fromSearchString(t.search)}})}function pW(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";")}hW.encodeAuthorityAndPath=function(e){return encodeURI(e).replace(/%5B/gi,"[").replace(/%5D/gi,"]").replace(/%25/gi,"%")},hW.encodeSearchParams=function(e){let t,n="";for(let r=0;r<e.length;r++)t=e[r],n+=0===r?"?":"&",n+=pW(t.key),t.value?n+=`=${pW(t.value)}`:n+=t.useEqualSign?"=":"";return n};var fW=hW;var mW,gW=class{_hasNext(){return null!=this._input&&(0!==this._input.length&&this._index<this._input.length)}constructor(e){this._input=e,this._pushback=null,this._temp=null,this._index=0,this._mark=0}pushback(e){this._pushback=e}index(){return this._index}hasNext(){return null!=this._pushback||this._hasNext()}next(){if(null!=this._pushback){const e=this._pushback;return this._pushback=null,e}return this._hasNext()?this._input.charAt(this._index++):null}nextHex(){const e=this.next();return null==e?null:e.match(/[0-9A-Fa-f]/)?e:null}peek(e){return e?!(!this._pushback||this._pushback!==e)||!!this._hasNext()&&this._input.charAt(this._index)===e:this._pushback?this._pushback:this._hasNext()?this._input.charAt(this._index):null}mark(){this._temp=this._pushback,this._mark=this._index}reset(){this._pushback=this._temp,this._index=this._mark}remainder(){let e=this._input.substr(this._index);return null!=this._pushback&&(e=this._pushback+e),e}},yW=class{decode(e){let t="";const n=new gW(e);let r;for(;n.hasNext();)r=this.decodeCharacter(n),t+=null!=r?r:n.next();return t}decodeCharacter(e){return e.next()}},vW=e=>e>=0&&e<=1114111,bW=e=>e.match(/[\s]/),xW=class extends yW{decodeCharacter(e){e.mark();const t=e.next();let n,r,i;if(null==t||"\\"!==t)return e.reset(),null;const o=e.next();if(null==o)return e.reset(),null;switch(o){case"\r":e.peek("\n")&&e.next();case"\n":case"\f":case"\0":return this.decodeCharacter(e)}if("NaN"===parseInt(o,16))return o;for(n=o,r=0;r<5&&(i=e.next(),null!=i&&!bW(i));r++){if("NaN"===parseInt(i,16)){e.pushback(i);break}n+=i}const a=parseInt(n,16);return vW(a)?String.fromCharCode(a):"�"}},wW=class e{constructor(e,t){this._key=e,this._value=t}getKey(){return this._key}getValue(){return this._value}equals(t){return t instanceof e&&(this._key===t._key&&this._value===t._value)}static newInstanceIfNeeded(){let t,n,r=arguments[0];return"string"==typeof arguments[1]?(t=arguments[1],n=r.length):(n=arguments[1],t=arguments[2]),t&&r?(r.length>n&&(r=r.substr(0,n)),new e(r,t)):null}},SW=class e{setValue(e){this._nextMap=null,this._value=e}getNextNode(e){return this._nextMap?this._nextMap[e]:null}put(t,n,r){let i,o;if(t.length===n)return o=this._value,this.setValue(r),o;const a=t.charAt(n);return this._nextMap?(i=this._nextMap[a],i||(i=new e,this._nextMap[a]=i)):(this._nextMap={},i=new e,this._nextMap[a]=i),i.put(t,n+1,r)}get(e,t){if(e.length<=t)return this._value;const n=this.getNextNode(e.charAt(t));return n?n.get(e,t+1):null}getLongestMatch(e,t){if(e.length<=t)return wW.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return wW.newInstanceIfNeeded(e,t,this._value);const r=n.getLongestMatch(e,t+1);return r||wW.newInstanceIfNeeded(e,t,this._value)}},CW=class{constructor(){this.clear()}getLongestMatch(e){return this.root&&e?this.root.getLongestMatch(e,0):null}getMaxKeyLength(){return this.maxKeyLen}clear(){this.root=null,this.maxKeyLen=0,this.size=0}put(e,t){this.root||(this.root=new SW);const n=this.root.put(e,0,t);return n||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}},MW=(()=>{const e=[],t=[],n=new CW;let r,i,o;for(r in e["""]="34",e["&"]="38",e["<"]="60",e[">"]="62",e[" "]="160",e["¡"]="161",e["¢"]="162",e["£"]="163",e["¤"]="164",e["¥"]="165",e["¦"]="166",e["§"]="167",e["¨"]="168",e["©"]="169",e["ª"]="170",e["«"]="171",e["¬"]="172",e["­"]="173",e["®"]="174",e["¯"]="175",e["°"]="176",e["±"]="177",e["²"]="178",e["³"]="179",e["´"]="180",e["µ"]="181",e["¶"]="182",e["·"]="183",e["¸"]="184",e["¹"]="185",e["º"]="186",e["»"]="187",e["¼"]="188",e["½"]="189",e["¾"]="190",e["¿"]="191",e["À"]="192",e["Á"]="193",e["Â"]="194",e["Ã"]="195",e["Ä"]="196",e["Å"]="197",e["Æ"]="198",e["Ç"]="199",e["È"]="200",e["É"]="201",e["Ê"]="202",e["Ë"]="203",e["Ì"]="204",e["Í"]="205",e["Î"]="206",e["Ï"]="207",e["Ð"]="208",e["Ñ"]="209",e["Ò"]="210",e["Ó"]="211",e["Ô"]="212",e["Õ"]="213",e["Ö"]="214",e["×"]="215",e["Ø"]="216",e["Ù"]="217",e["Ú"]="218",e["Û"]="219",e["Ü"]="220",e["Ý"]="221",e["Þ"]="222",e["ß"]="223",e["à"]="224",e["á"]="225",e["â"]="226",e["ã"]="227",e["ä"]="228",e["å"]="229",e["æ"]="230",e["ç"]="231",e["è"]="232",e["é"]="233",e["ê"]="234",e["ë"]="235",e["ì"]="236",e["í"]="237",e["î"]="238",e["ï"]="239",e["ð"]="240",e["ñ"]="241",e["ò"]="242",e["ó"]="243",e["ô"]="244",e["õ"]="245",e["ö"]="246",e["÷"]="247",e["ø"]="248",e["ù"]="249",e["ú"]="250",e["û"]="251",e["ü"]="252",e["ý"]="253",e["þ"]="254",e["ÿ"]="255",e["&OElig"]="338",e["&oelig"]="339",e["&Scaron"]="352",e["&scaron"]="353",e["&Yuml"]="376",e["&fnof"]="402",e["&circ"]="710",e["&tilde"]="732",e["&Alpha"]="913",e["&Beta"]="914",e["&Gamma"]="915",e["&Delta"]="916",e["&Epsilon"]="917",e["&Zeta"]="918",e["&Eta"]="919",e["&Theta"]="920",e["&Iota"]="921",e["&Kappa"]="922",e["&Lambda"]="923",e["&Mu"]="924",e["&Nu"]="925",e["&Xi"]="926",e["&Omicron"]="927",e["&Pi"]="928",e["&Rho"]="929",e["&Sigma"]="931",e["&Tau"]="932",e["&Upsilon"]="933",e["&Phi"]="934",e["&Chi"]="935",e["&Psi"]="936",e["&Omega"]="937",e["&alpha"]="945",e["&beta"]="946",e["&gamma"]="947",e["&delta"]="948",e["&epsilon"]="949",e["&zeta"]="950",e["&eta"]="951",e["&theta"]="952",e["&iota"]="953",e["&kappa"]="954",e["&lambda"]="955",e["&mu"]="956",e["&nu"]="957",e["&xi"]="958",e["&omicron"]="959",e["&pi"]="960",e["&rho"]="961",e["&sigmaf"]="962",e["&sigma"]="963",e["&tau"]="964",e["&upsilon"]="965",e["&phi"]="966",e["&chi"]="967",e["&psi"]="968",e["&omega"]="969",e["&thetasym"]="977",e["&upsih"]="978",e["&piv"]="982",e["&ensp"]="8194",e["&emsp"]="8195",e["&thinsp"]="8201",e["&zwnj"]="8204",e["&zwj"]="8205",e["&lrm"]="8206",e["&rlm"]="8207",e["&ndash"]="8211",e["&mdash"]="8212",e["&lsquo"]="8216",e["&rsquo"]="8217",e["&sbquo"]="8218",e["&ldquo"]="8220",e["&rdquo"]="8221",e["&bdquo"]="8222",e["&dagger"]="8224",e["&Dagger"]="8225",e["&bull"]="8226",e["&hellip"]="8230",e["&permil"]="8240",e["&prime"]="8242",e["&Prime"]="8243",e["&lsaquo"]="8249",e["&rsaquo"]="8250",e["&oline"]="8254",e["&frasl"]="8260",e["&euro"]="8364",e["&image"]="8365",e["&weierp"]="8472",e["&real"]="8476",e["&trade"]="8482",e["&alefsym"]="8501",e["&larr"]="8592",e["&uarr"]="8593",e["&rarr"]="8594",e["&darr"]="8595",e["&harr"]="8596",e["&crarr"]="8629",e["&lArr"]="8656",e["&uArr"]="8657",e["&rArr"]="8658",e["&dArr"]="8659",e["&hArr"]="8660",e["&forall"]="8704",e["&part"]="8706",e["&exist"]="8707",e["&empty"]="8709",e["&nabla"]="8711",e["&isin"]="8712",e["¬in"]="8713",e["&ni"]="8715",e["&prod"]="8719",e["&sum"]="8721",e["&minus"]="8722",e["&lowast"]="8727",e["&radic"]="8730",e["&prop"]="8733",e["&infin"]="8734",e["&ang"]="8736",e["&and"]="8743",e["&or"]="8744",e["&cap"]="8745",e["&cup"]="8746",e["&int"]="8747",e["&there4"]="8756",e["&sim"]="8764",e["&cong"]="8773",e["&asymp"]="8776",e["&ne"]="8800",e["&equiv"]="8801",e["&le"]="8804",e["&ge"]="8805",e["&sub"]="8834",e["&sup"]="8835",e["&nsub"]="8836",e["&sube"]="8838",e["&supe"]="8839",e["&oplus"]="8853",e["&otimes"]="8855",e["&perp"]="8869",e["&sdot"]="8901",e["&lceil"]="8968",e["&rceil"]="8969",e["&lfloor"]="8970",e["&rfloor"]="8971",e["&lang"]="9001",e["&rang"]="9002",e["&loz"]="9674",e["&spades"]="9824",e["&clubs"]="9827",e["&hearts"]="9829",e["&diams"]="9830",e)"function"!=typeof e[r]&&e.hasOwnProperty(r)&&(t[e[r]]=r);for(i in t)"function"!=typeof t[i]&&t.hasOwnProperty(i)&&(o=t[i].toLowerCase().substr(1),n.put(o,String.fromCharCode(i)));return n})(),kW=class extends yW{decodeCharacter(e){let t;e.mark();const n=e.next();if(null==n||"&"!==n)return e.reset(),null;const r=e.next();if(null==r)return e.reset(),null;if("#"===r){if(t=this._getNumericEntity(e),null!=t)return t}else if(r.match(/[A-Za-z]/)&&(e.pushback(r),t=this._getNamedEntity(e),null!=t))return t;return e.reset(),null}_getNamedEntity(e){let t,n,r,i="";for(t=Math.min(e.remainder().length,MW.getMaxKeyLength()),r=0;r<t;r++)i+=e.next().toLowerCase();const o=MW.getLongestMatch(i);if(null==o)return null;for(e.reset(),e.next(),t=o.getKey().length,n=0;n<t;n++)e.next();return e.peek(";")&&e.next(),o.getValue()}_getNumericEntity(e){const t=e.peek();return null==t?null:"x"===t||"X"===t?(e.next(),this._parseHex(e)):this._parseNumber(e)}_parseHex(e){let t,n="";for(;e.hasNext();){if(t=e.peek(),Number.isNaN(+parseInt(t,16))){if(";"===t){e.next();break}break}n+=t,e.next()}const r=parseInt(n,16);return!Number.isNaN(+r)&&vW(r)?String.fromCharCode(r):null}_parseNumber(e){let t,n="";for(;e.hasNext();){if(t=e.peek(),Number.isNaN(+parseInt(t,10))){if(";"===t){e.next();break}break}n+=t,e.next()}const r=parseInt(n,10);return!Number.isNaN(+r)&&vW(r)?String.fromCharCode(r):null}},EW=class extends yW{decodeCharacter(e){e.mark();const t=e.next();let n,r,i,o;if(null==t)return e.reset(),null;if("%"!==t)return e.reset(),null;for(n="",r=0;r<2;r++)i=e.nextHex(),null!=i&&(n+=i);return 2===n.length&&(o=parseInt(n,16),vW(o))?String.fromCharCode(o):(e.reset(),null)}},_W=/^data:(?<!\s)\s*(image\/[\w+-.]+)(?<!\s)\s*(;.*?){0,1}(?<!\s)\s*,(.*)/i,RW=5e6,IW=5e5,DW=(e,t)=>{const{maxByteSizeSvg:n=IW,maxByteSizeImage:r=RW}=t??{},{mimeType:i,encoding:o,data:a}=(e=>{const[,t,n,r]=_W.exec(e.trim())??[];return{encoding:n,data:r,mimeType:t?.toLocaleLowerCase()}})(e);if(!a)return!0;const s=((e,t,n)=>{const r={type:e};if(t?.includes(";base64"))try{return new Blob([atob(n)],r).size}catch{return new Blob([n],r).size}return"image/svg+xml"===e?new Blob([n],r).size:0})(i,o,a);return"image/svg+xml"===i?s<=n:s<=r};"undefined"!=typeof document&&(mW=document.createElement("div"));var AW=Array.prototype.indexOf,PW=[",",".","_"," "],OW=[",",".","-","_"," "],TW={width:["%"],height:["%"]},LW={default:["-"," ","%"],color:["#"," ","(",")"],image:["(",")",":","/","?","&","-",".",'"',"="," "]},qW={background:["(",")",":","%","/","?","&","-"," ",".",'"',"=","#"],"background-image":LW.image,"background-color":LW.color,"border-color":LW.color,"border-image":LW.image,color:LW.color,icon:LW.image,"list-style-image":LW.image,"outline-color":LW.color},NW={attr_name:["^on[a-z]{1,}","style","href","src"],attr_val:["javascript:","data:"],css_key:["behavior","-moz-behavior","-ms-behavior"],css_val:["expression"]};function jW(e,t,n){let r;if(t){if(AW)return AW.call(t,e,n);for(r=t.length,n=n?n<0?Math.max(0,r+n):n:0;n<r;n++)if(n in t&&t[n]===e)return n}return-1}function zW(e){if(null==e)return"";let t="";const n=document.createTextNode(e);return mW.appendChild(n),t=mW.innerHTML,mW.removeChild(n),t}function FW(e,t,n){let r,i,o,a,s,l,c,u,d;for(e=$W(e).toLowerCase(),t=$W(t),o=0;o<NW.attr_name.length;o++)if(e.match(NW.attr_name[o]))throw new Error(`Unsafe attribute name used: ${e}`);for(o=0;o<NW.attr_val.length;o++)if(t.toLowerCase().match(NW.attr_val[o]))throw new Error(`Unsafe attribute value used: ${t}`);if(r=TW[e],r||(r=OW),i="",!n){for(a=0;a<e.length;a++){if(s=e.charAt(a),!s.match(/[a-zA-Z\-0-9]/))throw new Error("Invalid attribute name specified");i+=s}i+='="'}for(l=0;l<t.length;l++)c=t.charAt(l),u=t.charCodeAt(l),!c.match(/[a-zA-Z0-9]/)&&jW(c,r)<0?(d=u.toString(16),i+=`&#x${d};`):i+=c;return n||(i+='"'),i}function WW(e,t,n){let r,i,o,a,s,l,c,u,d,h;if(e=$W(e).toLowerCase(),t=$W(t),jW(e,NW.css_key)>=0)throw new Error(`Unsafe property name used: ${e}`);for(r=0;r<NW.css_val.length;r++)if(t.toLowerCase().indexOf(NW.css_val[r])>=0)throw new Error(`Unsafe property value used: ${t}`);if(i=qW[e],i||(i=LW.default),o="",!n){for(a=0;a<e.length;a++){if(s=e.charAt(a),!s.match(/[a-zA-Z-]/))throw new Error("Invalid Property Name specified");o+=s}o+=": "}for(l=0;l<t.length;l++)c=t.charAt(l),u=t.charCodeAt(l),!c.match(/[a-zA-Z0-9]/)&&jW(c,i)<0?(d=u.toString(16),h="000000".substr(d.length),o+=`\\${h}${d}`):o+=c;return o}function $W(e,t){let n,r,i,o,a=!1;if(null===e)return null;n=e,r=e,i=0;const s=[new kW,new EW,new xW];for(;!a;){r=n;for(let e=0;e<s.length;e++)o=s[e].decode(n),o!==n&&(i++,n=o);r!==n||(a=!0)}if(t&&i>1)throw new Error("Attack Detected - Multiple/Double Encodings used in input");return n}var BW=[];for(let e=0;e<255;e++)BW[e]=e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122?null:e.toString(16);var HW={html:e=>zW(e.unsafe),css(e){let t,n=[];const r=[],i={};let o="";for(t in e.map?n=e.map:n[e.name]=e.unsafe,n)"function"!=typeof n[t]&&n.hasOwnProperty(t)&&(r[t]=WW(t,n[t],!0),o+=WW(t,n[t],!0),i[t]=r[t]);return e.map?i:o},attr(e){let t=[];const n=[],r={};let i="";e.map?t=e.map:t[e.name]=e.unsafe;for(const e in t)"function"!=typeof t[e]&&t.hasOwnProperty(e)&&(n[e]=FW(e,t[e],!0),i+=FW(e,t[e],!0),r[e]=n[e]);return e.map?r:i}};function VW(e,t){throw new Error(t)}var GW={canonicalize:$W,encode:function(){const e={context:"html",unsafe:null,name:null,map:null,setter:null,strict:!0};return 1===arguments.length&&"object"==typeof arguments[0]?function(){let e,t,n;const r=arguments[0]||{};let i=1;const o=arguments.length;for(;i<o;i++)if(null!=(e=arguments[i]))for(t in e)if(e.hasOwnProperty(t)){if(n=e[t],r===n)continue;void 0!==n&&(r[t]=n)}}(e,arguments[0]):(e.context=arguments[0],2===arguments.length?"html"===e.context?e.unsafe=arguments[1]:"attr"!==e.context&&"css"!==e.context||(e.map=arguments[1]):(e.name=arguments[2],e.unsafe=arguments[1])),"html"===e.context?HW.html(e):"css"===e.context?(null!=e.map&&"object"!=typeof e.map&&VW(this,"Invalid parameter type"),HW.css(e)):"attr"===e.context?(null!=e.map&&"object"!=typeof e.map&&VW(this,"Invalid parameter type"),HW.attr(e)):void VW(this,"Invalid parameter type")},encodeForAttr:FW,encodeForAttr2:function(e){return FW("nonsens",e,!0)},encodeForCSS:WW,encodeForHref:function(e){$W(e),0!==e.search("[a-zA-Z0-9]+:")&&(e=`http://${e}`);const t=new fW(e),n=fW.encodeAuthorityAndPath(t.authorityAndPath),r=t.searchParams;e=n+fW.encodeSearchParams(r)+t.hash;const i=decodeURI(e).toLowerCase();if(-1!==i.indexOf("javascript:"))throw new Error("Attack Detected - Javascript in input");if(-1!==i.indexOf("data:"))throw new Error("Attack Detected - data in input");return e},encodeForJS:function(e,t){let n,r,i,o,a,s;for(t||(t=PW),s="",n=0;n<e.length;n++)i=e.charAt(n),o=e.charCodeAt(n),jW(i,t)>=0||null==BW[o]?s+=i:(r=o.toString(16),o<256?(a="00".substr(r.length),s+=`\\x${a}${r.toUpperCase()}`):(a="0000".substr(r.length),s+=`\\u${a}${r.toUpperCase()}`));return s},encodeForHTML:zW,encodeForURL:function(e,t){let n="";return t&&(t.match(/^[A-Za-z\-0-9]{1,}$/)?n+=$W(t).toLowerCase():VW(this,"Illegal Attribute Name Specified"),n+='="'),n+=encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A"),n+=t?'"':"",n},isSafeDataURL:DW,validateURI:function(e){if(""===e||function(e){if("canParse"in URL)return URL.canParse(e);try{return new URL(e),!0}catch{return!1}}(e))return!1;const t=e.replace(/%2E/gi,".");if(t.match(/[#&=: ]/))return!1;const n=function(e){let t=e,n="";for(;t.length>0;)if(t.startsWith("../")||t.startsWith("./"))t=t.replace(/^\.\.?\//,"");else if(t.startsWith("/./"))t=t.replace(/^\/\.\//,"/");else if("/."===t)t="/";else if(t.startsWith("/../")){t=t.replace(/^\/\.\.\//,"/");const e=n.lastIndexOf("/");-1!==e&&(n=n.slice(0,e))}else if("/.."===t){t="/";const e=n.lastIndexOf("/");-1!==e&&(n=n.slice(0,e))}else if("."===t||".."===t)t="";else{const e=t.match(/^\/?[^/]*/),r=e?e[0]:"";t=t.slice(r.length),n+=r}return n}(t);return""!==n&&"/"!==n&&n}};const UW=(e,t)=>t.qAttrExps?.qValues?.[e],YW=(e,t)=>{switch(e){case"topLeft":default:return{horizontal:"rtl"===t?"flex-end":"flex-start",vertical:"flex-start"};case"centerLeft":return{horizontal:"center",vertical:"flex-start"};case"bottomLeft":return{horizontal:"rtl"===t?"flex-start":"flex-end",vertical:"flex-start"};case"topCenter":return{horizontal:"rtl"===t?"flex-end":"flex-start",vertical:"center"};case"centerCenter":return{horizontal:"center",vertical:"center"};case"bottomCenter":return{horizontal:"rtl"===t?"flex-start":"flex-end",vertical:"center"};case"topRight":return{horizontal:"rtl"===t?"flex-end":"flex-start",vertical:"flex-end"};case"centerRight":return{horizontal:"center",vertical:"flex-end"};case"bottomRight":return{horizontal:"rtl"===t?"flex-start":"flex-end",vertical:"flex-end"}}},KW=({text:e,url:t,imageSize:n,imagePosition:r,labelStructure:i,imageBox:o,direction:a})=>r&&t&&!t.toLowerCase().includes("javascript:")&&GW.isSafeDataURL(t)?{type:QN.Image,url:t,text:e,imageSize:n,resolvedImagePosition:YW(r,a),labelStructure:i,imageBox:o}:{type:QN.Text,url:void 0,text:e,labelStructure:i},XW=(e,t,n,r)=>{if(!e.qMiniChart||!t?.miniChart||!n)return{type:QN.Text,text:r};const{minY:i,maxY:o}=((e,t,n)=>{const r="global"===t.yAxis?.scale,i="zeroCenter"===t.yAxis?.position,o=r?n.qYMin:e.qMiniChart.qMin,a=r?n.qYMax:e.qMiniChart.qMax;if(i){const e=Math.max(Math.abs(o),Math.abs(a));return{minY:-e,maxY:e}}return(e=>"zeroBaseline"===e.yAxis?.position||"bars"===e.type&&"auto"===e.yAxis?.position)(t)?{minY:Math.min(0,o),maxY:Math.max(0,a)}:{minY:o,maxY:a}})(e,t.miniChart,n),a={type:t.miniChart.type,qMatrix:e.qMiniChart.qMatrix,minY:i,maxY:o,showDots:!!t.miniChart.showDots,colors:t.miniChart.colors,colorMin:e.qMiniChart.qMin,colorMax:e.qMiniChart.qMax};return{type:QN.MiniChart,text:r,miniChart:a}},JW=(e,t,n)=>{const r=Array.isArray(t.qAttrExps)?t.qAttrExps[0]:t.qAttrExps,i=r?.qValues?.[e];if(i){const e=Number.isNaN(+i.qNum)?void 0:`${i.qNum}`;return i.qText||e}return n?.urlPosition===ej.Attribute?void 0:n?.urlLabel},ZW=({labelStructure:e,text:t,url:n})=>{try{if(!n)throw Error("Invalid url");return{type:QN.Link,url:GW.encodeForHref(n),text:t,labelStructure:e}}catch{return{type:QN.Text,url:void 0,text:t,labelStructure:e}}},QW=({cell:e,representationProperties:t,attrExprInfoIndex:n,env:r,conditionalColoring:i,miniChartOnMeasure:o,labelStructure:a,getText:s=e=>e.qText,direction:l,enabledFeatures:c})=>{const u=tj(t),d=s(e);return u===QN.Image&&c[QN.Image]&&!r.anything.sense?.isUnsupportedFeature?.("tableImages")?((e,t,n,r,i,o)=>{const{imageSize:a,imagePosition:s,imageSetting:l,imageLabel:c,imageBox:u}=t??{};if("url"===l){const t=UW(n.imageUrl??-1,e)?.qText;return o&&(o.maskedValue=t??""),KW({text:r,url:t,imageSize:a,imagePosition:s,labelStructure:o,imageBox:u,direction:i})}if("label"===l){const t=o?o.originalValue:r;if(-1===n.imageLabel)return KW({text:c||t||"",url:t,imageSize:a,imagePosition:s,labelStructure:o,imageBox:u,direction:i});const l=UW(n.imageLabel??-1,e)?.qText??r;return KW({text:l,url:t,imageSize:a,imagePosition:s,labelStructure:o,imageBox:u,direction:i})}return{type:QN.Text,url:void 0,labelStructure:o,text:r}})(e,t,n,d,l,a):u===QN.Link?((e,t,n,r,i)=>{const{urlPosition:o}=t??{};if(o===ej.Attribute){const o=JW(n.url??-1,e,t);return ZW({labelStructure:r,text:i||o||"",url:o})}if(o===ej.Dimension){const o=JW(n.urlLabel??-1,e,t)||i;return r&&(r.maskedValue=o),ZW({text:o,labelStructure:r,url:r?.originalValue??i})}return{type:QN.Text,url:void 0,text:i,labelStructure:r}})(e,t,n,a,d):u===QN.Indicator&&c[QN.Indicator]&&!r.anything.sense?.isUnsupportedFeature?.("tableIndicators")?((e,t,n)=>{const{indicator:r}=e??{};return{type:QN.Indicator,url:void 0,text:n,indicator:{applySegmentColors:r?.applySegmentColors,position:r?.position,showTextValues:r?.showTextValues},indicatorConditionalColoring:t}})(t,i,d):u===QN.MiniChart&&c[QN.MiniChart]&&!r.anything.sense?.isUnsupportedFeature?.("qMiniChartDef")?XW(e,t,o,d):{type:QN.Text,url:void 0,text:d,labelStructure:a}},e$=(e,t)=>{const n=t.qAttrExps,r=n?.qValues?.[e?.cellForegroundColor??-1]?.qText,i=n?.qValues?.[e?.cellBackgroundColor??-1]?.qText,o=i?Mj(i):null,a=r?Mj(r):null,s=((e,t)=>e||!t?null:wj(t))(a,o);return{color:s??a,background:o}},t$=(e,t)=>t.qSubNodes.reduce(((e,t)=>0===t.qSubNodes.length?e+1:t$(e,t)),e),n$=(e,t,n,r,i,o)=>{const a=i?o.rowsPerPage-n:Nj-r;let s=e.qUp+e.qDown;if(i&&0===n){const n=(t+e.qUp)%o.rowsPerPage;s=e.qDown+n}return Math.min(a,t$(s,e))},r$=({node:e,parent:t,root:n,x:r,y:i,pageY:o,layoutService:a,dimensionInfo:s,attrExprInfoIndex:l,isLeftColumn:c=!0,isIndentModeEnabled:u=!1,indentLevel:d,labelStructure:h,env:p,pageInfo:f,direction:m="ltr"})=>{const g=(!u||!c)&&"P"===e.qType,y=((e,t)=>{if(e!==nW){if(t){const t=tj(e.representation);return t===QN.Link||t===QN.Image?e.representation:{type:QN.Text}}return e.representation}})(s,u),v=(({node:e,isLeftColumn:t,isIndentModeEnabled:n,labelStructure:r,representationType:i,parentOrRootOriginalValue:o})=>{let a=e.qText;if(t&&n&&r){const{originalValue:t,delimeter:n,suffix:s}=r;a=i===QN.Link?"P"===e.qType?o:t:`${t} ${!s||!t&&s?"":n} ${s}`.trim()}return a})({node:e,isLeftColumn:c,isIndentModeEnabled:u,labelStructure:h,representationType:tj(y),parentOrRootOriginalValue:(t||n)?.representation?.labelStructure?.originalValue??""}),b=QW({cell:{...e,qText:v},representationProperties:y,attrExprInfoIndex:l,env:p,labelStructure:h,direction:m,enabledFeatures:{[QN.Image]:!0,[QN.Indicator]:!0}}),x={id:NL(),ref:e,x:r,y:i,pageX:r,pageY:o,mainAxisPageCoord:c?o:r,isLeftColumn:c,parent:t,root:n,children:[],isLeafNode:0===e.qSubNodes.length,leafCount:n$(e,i,o,r,c,f),distanceToNextCell:0,isLockedByDimension:!("object"!=typeof s||!s.qLocked),isTotal:"T"===e.qType||!!t?.isTotal,isEmpty:"E"===e.qType||-4===e.qElemNo,isNull:"U"===e.qType,isPseudoDimension:g,expressionColor:e$(l,e),selectionCellType:c?"L":"T",dimensionInfoIndex:a.getDimensionInfoIndex(s),canBeResized:0===e.qSubNodes.length&&!c,visibleMeasureInfoIndex:g?e.qElemNo:t?.visibleMeasureInfoIndex,representation:b,...void 0!==d&&{indentLevel:d}};return t&&(t.children[x.mainAxisPageCoord-t.mainAxisPageCoord]=x),x},i$=(e,t,n,r,i,o,a,s,l)=>{const{isIndentModeEnabled:c}=i;if(!t.length)return e;let u=0;return function t(d,h,p,f=0,m=-1){e[f]||(e[f]={}),c&&m++;const g=i.leftDimensionInfoIndexes.indexOf(nW);p.forEach(((p,y)=>{const v={originalValue:p.qText??"",maskedValue:"",delimeter:"-",suffix:""};u+=0===y?0:1;const b=n.qTop-r.page*r.rowsPerPage,x=Math.max(0,b+u-p.qUp),w=n.qTop+u-p.qUp;if(c){if(i.hasPseudoDimOnLeft&&m<=g)if(v.originalValue=p.qText??"",v.maskedValue=p.qText??"","N"===p.qType||"U"===p.qType||"T"===p.qType)"U"===p.qType&&(v.originalValue=i.getNullValueText()),m<g&&(v.suffix=i.visibleMeasureInfo[0].qFallbackTitle);else if("P"===p.qType){v.originalValue=(h||d)?.representation.labelStructure?.originalValue??"",v.maskedValue=(h||d)?.representation.labelStructure?.originalValue??"",v.suffix=p.qText??"";const e=p.qSubNodes;p={...(h||d)?.ref,...p.qText?{qText:p.qText}:{},qSubNodes:e},m=(h||d)?.indentLevel??0}"U"===p.qType&&(v.originalValue=i.getNullValueText())}let S=f;c&&(S=g>=1&&m>=g?m+1:m,0===m&&0===g&&0===p.qSubNodes.length&&(S=0));const C=e.at(f)?.[x],M=c&&void 0===C?.ref.qText||!C?r$({node:p,parent:h,root:d,x:S,y:w,pageY:x,layoutService:i,dimensionInfo:o[S],attrExprInfoIndex:a[S],isLeftColumn:!0,...c&&{isIndentModeEnabled:c,indentLevel:m},env:s,pageInfo:r,labelStructure:v,direction:l}):e[f][x];if(e[f][x]=M,p.qSubNodes.length){const e=c?0:f+1;t(d||M,M,p.qSubNodes,e,m)}}))}(null,null,t,0,-1),e},o$=(e,t)=>{e.slice(0,-1).forEach((e=>{Object.values(e).forEach(((e,n,r)=>{const i=r.at(n+1);e.distanceToNextCell=i?i.mainAxisPageCoord-(e.mainAxisPageCoord+e.leafCount):t-(e.mainAxisPageCoord+e.leafCount)}))}))},a$=(e,t)=>{const n=e[0],r=n?Object.values(n):[],i=t?.isIndentModeEnabled&&t.hasPseudoDimOnLeft?t.visibleMeasureInfo.length-1:0,o=n?.[i],a=r.at(-1);return o?.isTotal?o.isLeafNode?o.mainAxisPageCoord:o.mainAxisPageCoord+o.leafCount-1:a?.isTotal?a.mainAxisPageCoord-1:-1},s$=({prevData:e,nextDataPage:t,pageInfo:n,layoutService:r,visibleLeftDimensionInfo:i,attrExprInfoIndexes:o,env:a,direction:s})=>{const{qLeft:l,qArea:c}=t;if(!l.length)return e;const u=i$(e.grid,l,c,n,r,i,o,a,s);o$(u,n.rowsOnCurrentPage);const d=a$(u,r);return{...e,grid:u,columnCount:u.length,totalDividerIndex:d}},l$=({qArea:e,prevData:t,pivotValuePoints:n,pageInfo:r})=>{const i=[...t];return n.forEach(((t,n)=>{t.forEach(((t,o)=>{const a=e.qTop-r.page*r.rowsPerPage+n,s=e.qLeft+o;Array.isArray(i[a])||(i[a]=[]);const l="U"===t.qType;i[a][s]=i[a][s]??{id:NL(),ref:t,isNull:l}}))})),i},c$=({prevData:e,dataPage:t,pageInfo:n})=>{const{qData:r,qArea:i}=t;return r?.length?l$({qArea:i,prevData:e,pivotValuePoints:r,pageInfo:n}):e},u$=(e,t,n,r,i,o,a,s,l,c)=>{const{isIndentModeEnabled:u}=r;if(!t.length)return e;let d=0;!function t(a,h,p,f=0){e[f]||(e[f]={}),p.forEach(((p,m)=>{d+=0===m?0:1;const g=n.qLeft+d-p.qUp,y=e[f][g]??r$({node:p,parent:h,root:a,x:g,y:f,pageY:f,layoutService:r,dimensionInfo:i[f],attrExprInfoIndex:o[f],isLeftColumn:!1,...u&&{isIndentModeEnabled:u},env:s,pageInfo:l,direction:c});e[f][g]=y,p.qSubNodes.length&&t(a||y,y,p.qSubNodes,f+1)}))}(null,null,t);for(let t=0;t<a-e.length;t++)e.push({});return e},d$=({prevData:e,nextDataPage:t,layoutService:n,visibleTopDimensionInfo:r,attrExprInfoIndexes:i,headerRows:o,env:a,pageInfo:s,direction:l})=>{const{qTop:c,qArea:u}=t;if(!c.length)return e;const d=u$(e.grid,c,u,n,r,i,o,a,s,l);o$(d,n.size.x);const h=a$(d);return{...e,grid:d,rowCount:d.length,totalDividerIndex:h}},h$=e=>-1===e?{}:e.qAttrExprInfo.reduce(((e,{id:t},n)=>(e[t]=n,e)),{}),p$=(e,t)=>{const{env:n}=KF(),{direction:r}=GF(),{layoutService:i,effectivePropertiesService:o}=ZF(),{qPivotDataPages:a,pageInfo:s}=GF(),[l,c]=m(null),u=((e,t,n)=>f((()=>({left:e.map(h$),top:t.map(h$),measures:n.map(h$)})),[n,e,t]))(e,t,i.visibleMeasureInfo),d=f((()=>lW(i,o,t,e)),[i,o,t,e]),p=h((()=>a.slice(1).reduce(((e,t)=>c$({prevData:e,dataPage:t,pageInfo:s})),((e,t)=>{const{qData:n,qArea:r}=e;return l$({qArea:r,prevData:[],pivotValuePoints:n,pageInfo:t})})(a[0],s))),[a,s]),g=h((()=>a.slice(1).reduce(((e,o)=>d$({prevData:e,nextDataPage:o,layoutService:i,visibleTopDimensionInfo:t,attrExprInfoIndexes:u.top,headerRows:d.size.y,env:n,pageInfo:s,direction:r})),((e,t,n,r,i,o,a,s)=>{const{qArea:l,qTop:c}=e,u=u$([],c,l,t,n,r,i,o,a,s);o$(u,t.size.x);const d=a$(u);return{grid:u,rowCount:u.length,layoutSize:t.size,totalDividerIndex:d}})(a[0],i,t,u.top,d.size.y,n,s,r))),[a,i,t,u.top,d.size.y,n,s,r]),y=h((()=>a.slice(1).reduce(((t,o)=>s$({prevData:t,nextDataPage:o,pageInfo:s,layoutService:i,visibleLeftDimensionInfo:e,attrExprInfoIndexes:u.left,env:n,direction:r})),((e,t,n,r,i,o,a)=>{const{qArea:s,qLeft:l}=e,c=i$([],l,s,n,t,r,i,o,a);o$(c,n.rowsOnCurrentPage);const u=a$(c,t);return{grid:c,columnCount:c.length,layoutSize:t.size,totalDividerIndex:u}})(a[0],i,s,e,u.left,n,r))),[a,i,s,e,u,n,r]),[v,b]=m((()=>p())),[x,w]=m((()=>g())),[S,C]=m((()=>y()));xz((()=>{b(p())}),[p]),xz((()=>{w(g())}),[g]),xz((()=>{C(y())}),[y]),xz((()=>{l&&l.forEach((o=>{b((e=>c$({prevData:e,dataPage:o,pageInfo:s}))),w((e=>d$({prevData:e,nextDataPage:o,layoutService:i,visibleTopDimensionInfo:t,attrExprInfoIndexes:u.top,headerRows:d.size.y,env:n,pageInfo:s,direction:r}))),C((t=>s$({prevData:t,nextDataPage:o,pageInfo:s,layoutService:i,visibleLeftDimensionInfo:e,attrExprInfoIndexes:u.left,env:n,direction:r})))}))}),[l]);const M=h((e=>{c(e)}),[]);return{headersData:d,measureData:v,topDimensionData:x,leftDimensionData:S,attrExprInfoIndexes:u,nextPageHandler:M}},f$=Math.sqrt(1e4),m$=e=>({maxNumberOfVisibleRows:Math.ceil(e.height/24),maxNumberOfVisibleColumns:Math.ceil(e.width/_T.PixelsMin)}),g$=e=>{if(null===e)return[];if(e.qWidth*e.qHeight<1e4)return[e];const t=[],n=Math.ceil(e.qWidth/f$),r=Math.ceil(e.qHeight/f$);for(let i=0;i<n;i++)for(let n=0;n<r;n++)t.push({qLeft:e.qLeft+i*f$,qTop:e.qTop+n*f$,qWidth:Math.min(f$,e.qWidth-i*f$),qHeight:Math.min(f$,e.qHeight-n*f$)});return t};function y$({nextPageHandler:e}){const{model:t}=KF(),{pageInfo:n}=GF(),{layoutService:r}=ZF(),i=(e=>{const t=a(e);return t.current=e,t})(n.page),o=t,s=h((async(e,t)=>{await(o?.collapseLeft(tW,e,t,!1))}),[o]),l=h((async(e,t)=>{await(o?.collapseTop(tW,e,t,!1))}),[o]),c=h((async(e,t)=>{await(o?.expandLeft(tW,e,t,!1))}),[o]),u=h((async(e,t)=>{await(o?.expandTop(tW,e,t,!1))}),[o]),d=h((async t=>{if(o?.getHyperCubePivotData&&0!==t.length)try{const r=await o.getHyperCubePivotData(tW,t.reduce(((e,t)=>[...e,...g$(t)]),[]));i.current===n.page&&e(r)}catch(e){console.error(e)}}),[o,e,n,i]),p=h(((e,{dimensionInfoIndex:n,isLeftColumn:i,x:o=0,columnWidthLocation:a})=>{const{qMeasureInfo:s,qDimensionInfo:l,topHeadersColumnWidth:c}=r.layout.qHyperCube;let u=[];switch(a){case aj.Dimension:u=[{qPath:`${tW}/qDimensions/${n}/qDef/columnWidth`,oldValue:l[n].columnWidth}];break;case aj.Measures:if(i)u=s.map(((e,t)=>({qPath:`${tW}/qMeasures/${t}/qDef/columnWidth`,oldValue:e.columnWidth})));else{const e=r.getMeasureInfoIndexFromCellIndex(o);u=[{qPath:`${tW}/qMeasures/${e}/qDef/columnWidth`,oldValue:s[e].columnWidth}]}break;case aj.Pivot:u=[{qPath:`${tW}/topHeadersColumnWidth`,oldValue:c}]}const d=u.map((t=>{const{qPath:n,oldValue:r}=t;return{qPath:n,qOp:r?"Replace":"Add",qValue:JSON.stringify({...r,...e})}}));t?.applyPatches(d,!0)}),[t,r]),m=h((async e=>{await(o?.applyPatches([{qPath:`${tW}/indentModeColumnWidth`,qOp:r.layout.qHyperCube.indentModeColumnWidth?"Replace":"Add",qValue:JSON.stringify({...r.indentModeColumnWidth,...e})}],!0))}),[o,r]);return f((()=>({collapseLeft:s,collapseTop:l,expandLeft:c,expandTop:u,applyColumnWidth:p,applyIndentModeColumnWidth:m,fetchPages:d})),[s,l,c,u,p,m,d])}const v$=(e,t,n)=>(r,i)=>{if("P"===r)return nW;const o=t[n+i];return e[o]},b$=e=>{const t=[],n=(e,r=0)=>{e.slice(0,1).forEach((e=>{t[r]=e.qType,e.qSubNodes.length&&n(e.qSubNodes,r+1)}))};return n(e),t},x$=s({}),w$=()=>d(x$),S$=({children:e})=>{const{visibleLeftDimensionInfo:t,visibleTopDimensionInfo:n}=(()=>{const{layoutService:{layout:{qHyperCube:{qNoOfLeftDims:e,qEffectiveInterColumnSortOrder:t,qDimensionInfo:n}}}}=ZF(),{qPivotDataPages:r}=GF();return f((()=>{const i=b$(r[0]?.qLeft??[]),o=b$(r[0]?.qTop??[]);return{visibleLeftDimensionInfo:i.map(v$(n,t,0)),visibleTopDimensionInfo:o.map(v$(n,t,e))}}),[n,t,e,r])})(),{headersData:r,measureData:i,topDimensionData:o,leftDimensionData:a,attrExprInfoIndexes:s,nextPageHandler:l}=p$(t,n),c=y$({nextPageHandler:l}),u=f((()=>({gridSectionsData:{headersData:r,topDimensionData:o,leftDimensionData:a,measureData:i},visibleDimensionsInfo:{visibleLeftDimensionInfo:t,visibleTopDimensionInfo:n},attrExprInfoIndexes:s,dataModel:c})),[t,n,r,i,o,a,s,c]);return Ji.jsx(x$.Provider,{value:u,children:e})},C$=20,M$=18,k$=.75,E$=e=>-1!==e&&e?.representation?.type===QN.Image,_$=({isLeftColumn:e,layoutService:t,representation:n})=>Boolean(e)&&t.isIndentModeEnabled&&n.type===QN.Image,R$=e=>void 0===e?qj:e,I$=(e,t)=>void 0===e||Number.isNaN(+e)?t:+e,D$=e=>I$(e,_T.PixelsDefault),A$=(e,t)=>I$(e,_T.PercentageDefault)*t/100,P$=(e,t,n)=>{switch(t?.type){case RT.Pixels:return D$(t.pixels);case RT.Percentage:return A$(t.percentage,e);case RT.FitToContent:case RT.Auto:default:return n}},O$=({headers:e,layoutService:t,effectivePropertiesService:n,estimateWidthForDimensionValue:r,shouldConsiderCombinatedLength:i,measureTextForHeader:o,longestMeasureValuePossible:a})=>e.reduce(((e,s,l)=>{const{layout:{qHyperCube:{qNoOfLeftDims:c,qDimensionInfo:u}}}=t,{id:d,colIdx:h,qApprMaxGlyphCount:p,isLeftDimension:f}=s,m=u.find((e=>e.cId===d)),g={width:24,...m?.representation?.imageBox};if(!f)return e+0;if(d===rW)return e+0;const y=_$({isLeftColumn:f,layoutService:t,representation:m?.representation||{type:QN.Text}})?g.width+8+4:r(p),v=!n.qAlwaysFullyExpanded&&h<c-1?21:0;let b=0;if(i&&o&&a){b=o("- ")+a}return Math.max(e,24*l+M$+v+y+b)}),0),T$=(e,t,n)=>e.reduce(((e,r)=>{const i=(n?0:1)*M$;return Math.max(e,i+t(r.qFallbackTitle))}),0),L$=(e,t,n,r)=>{const i=100*e/t,o=r*k$*(i/100),a=i/100*+n;return Math.min(a,o)},q$=(e,t,n,r)=>r*(+n/100)*(100*e/t/100),N$=(e,t)=>e.some((e=>e>=t*k$)),j$=({layoutService:e,effectivePropertiesService:t,headersData:n,columnWidths:r,tableWidth:i,widthOverride:o,measureTextForHeader:a,estimateWidthForDimensionValue:s,measureTextWidthForMeasuresCombinedWithDimensions:l,translator:c})=>{let u=[];const d=i*k$,h=n.data[n.data.length-1][0];if(!Array.isArray(h))return{leftGridWidth:0,leftGridColumnWidths:[],leftGridFullWidth:0};const p=Math.min(d,r.at(-1)),f=Math.min(d,O$({headers:h,layoutService:e,effectivePropertiesService:t,estimateWidthForDimensionValue:s})),m=Math.min(d,T$(e.visibleMeasureInfo,a));let g=0;const y=h.findIndex((e=>e.id===rW)),v=(({layoutService:e,measureTextForHeader:t,translator:n,headersData:r})=>{const{type:i}=e.indentModeColumnWidth;return i===RT.Auto&&r.size.y<=1?t(n.get("SNPivotTable.IndentMode.Rows"))+8+M$+16:24})({layoutService:e,measureTextForHeader:a,translator:c,headersData:n});if(e.hasPseudoDimOnLeft)if(0===y){const e=Math.max(p,f,m);u=[Math.max(v,e-p),p]}else{const n=Math.min(d,T$(e.visibleMeasureInfo,l,!0));g=Math.min(d,O$({headers:h.slice(0,y),layoutService:e,effectivePropertiesService:t,estimateWidthForDimensionValue:s,shouldConsiderCombinatedLength:!0,measureTextForHeader:a,longestMeasureValuePossible:n}));const r=Math.max(p,f,g);u=[Math.max(v,r-p),p]}else u=[Math.max(v,f-p),p];const b=Math.min(d,u.reduce(((e,t)=>e+t),0)),{indentModeColumnWidth:x}=e;o&&o<=d&&(x.type=RT.Pixels,x.pixels=o);return[RT.Pixels,RT.Percentage].includes(x.type)||N$(u,i)?((e,t,n,r)=>{let i=e[0],o=e[1],a=[];const s=e.reduce(((e,t)=>e+t),0),{type:l,pixels:c,percentage:u}=t,d=N$(e,n);l===RT.Auto&&d&&(i>o?i-=o:o-=i),l===RT.Pixels&&c&&(i=L$(e[0],s,c,n),o=L$(e[1],s,c,n)),l===RT.Percentage&&u&&(i=q$(e[0],s,u,n),o=q$(e[1],s,u,n));let h=0;o<=r&&(h=i-5,h>0&&(i-=h,o+=h)),h=o-r,h>0&&(i+=h,o-=h),a=[i,o];const p=a.reduce(((e,t)=>e+t),0);return{leftGridColumnWidths:a,leftGridWidth:p,leftGridFullWidth:p}})(u,x,i,p):{leftGridWidth:b,leftGridColumnWidths:u,leftGridFullWidth:b}};function z$({tableWidth:e}){const t=e*k$,{styleService:n,layoutService:r,effectivePropertiesService:i}=ZF(),{translator:o}=KF(),{gridSectionsData:{headersData:a}}=w$(),{measureText:s}=gz(n.header),{estimateWidth:l,measureText:c}=gz({...n.dimensionValues,fontWeight:R$(n.dimensionValues.fontWeight)}),{measureText:u}=gz({...n.dimensionValues,...n.measureLabels}),d=h(((n,d)=>{const{layout:{qHyperCube:{qNoOfLeftDims:h,topHeadersColumnWidth:p}},visibleMeasureInfo:f,isIndentModeEnabled:m,hasPseudoDimOnLeft:g}=r,y=(t=0)=>f.reduce(((n,{qFallbackTitle:r,columnWidth:i})=>{const o=u(r)+M$,a=Math.max(o,t);return Math.max(n,m?a:P$(e,i,a))}),0),v=e=>a.data.reduce(((t,n)=>{const r=n.at(e);if(!r||Array.isArray(r))return t;if(r.id===rW)return t;const i=(e=>{const{label:t,isLocked:n}=e,r=n?C$:0;return M$+s(t)+C$+r})(r);return Math.max(i,t)}),0);let b=0,x=a.data.at(-1);m&&a.size.x>1&&x&&x[0]&&(x=x[0]);const w=x.map(((o,s)=>{let c=M$;if(m&&1!==a.size.x||!n||void 0===d||d!==o.colIdx){let t;o.columnWidthLocation===aj.Pivot?t=m?void 0:p:o.columnWidthLocation===aj.Dimension&&({columnWidth:t}=o);let n=0;if(o.isLeftDimension)if(o.id===rW)n=y();else{const e=v(s),t=((e,t)=>{const{qApprMaxGlyphCount:n,isLeftDimension:o,dimensionInfoIndex:a}=e,s=r.getDimensionInfo(a);if(E$(s))return _T.PixelsDefault;const c=!i.qAlwaysFullyExpanded&&o&&t<h-1?21:0;return M$+l(n)+c})(o,s);n=Math.max(e,t),m&&!g&&s+1===h&&o.columnWidthLocation===aj.Dimension&&a.size.x>1&&(n=e)}else n=v(s),o.columnWidthLocation===aj.Measures&&(n=y(n));m&&1===a.size.x&&(t=r.indentModeColumnWidth),c=m&&!g&&a.size.x>1?n:P$(e,t,n)}else c=m?Math.min(t,n):n;return b+=c,c}));return m&&a.size.x>1?j$({layoutService:r,effectivePropertiesService:i,headersData:a,columnWidths:w,tableWidth:e,widthOverride:n,measureTextForHeader:s,estimateWidthForDimensionValue:l,measureTextWidthForMeasuresCombinedWithDimensions:c,translator:o}):{leftGridWidth:Math.min(t,b),leftGridColumnWidths:w,leftGridFullWidth:b}}),[e,a,r,t,s,u,l,c,o,i]),[p,f]=m(d);xz((()=>{f(d())}),[d]);const g=h(((e,t)=>{f(d(e,t))}),[d]);return{...p,overrideLeftGridWidth:g}}function F$({tableWidth:e,verticalScrollbarWidth:t,leftGridWidth:n}){const{styleService:r,layoutService:i}=ZF(),{visibleDimensionsInfo:{visibleTopDimensionInfo:o}}=w$(),{layout:{qHyperCube:{qNoOfLeftDims:a,qEffectiveInterColumnSortOrder:s}},size:l,visibleMeasureInfo:c}=i,{estimateWidth:u,measureText:d}=gz(r.measureValues),{estimateWidth:p}=gz({...r.dimensionValues,fontWeight:R$(r.dimensionValues.fontWeight)}),m=e-n-1,g=o.at(-1),y=g===nW,v=s.length-a>o.length?21:0,b=f((()=>{const e=y?c:[g],t=l.x/e.length,n=[],r=[];let i=m;const o=(e,r)=>{n[e]=Math.min(_T.PixelsMax,Math.max(_T.PixelsMin,r)),i-=n[e]*t};if(e.forEach(((e,t)=>{if(e?.columnWidth){const{columnWidth:{type:n,pixels:i,percentage:a},qApprMaxGlyphCount:s,qFallbackTitle:l}=e;switch(n){case RT.Pixels:o(t,D$(i));break;case RT.Percentage:o(t,A$(a,m));break;case RT.FitToContent:o(t,((e,t,n)=>n?_T.PixelsDefault:M$+(y?Math.max(u(e),d(t)):Math.max(Math.max(...c.map((e=>u(e.qApprMaxGlyphCount)))),p(e)+v)))(s,l,E$(e)));break;case RT.Auto:default:r.push(t)}}else r.push(t)})),r.length){const e=r.length*t,o=i/e;r.forEach((e=>{n[e]=Math.max(_T.AutoMinPivot,o)}))}return n}),[y,c,g,l.x,m,u,d,p,v]),x=f((()=>{if(y){const e=c.reduce(((e,t,n)=>e+b[n]),0);return e/c.length}return b[0]}),[y,b,c]),w=parseFloat((t/i.size.x).toFixed(12)),S=h((e=>(y&&void 0!==e?b[i.getMeasureInfoIndexFromCellIndex(e,!0)]:x)-w),[y,b,i,x,w]),C=l.x*x;return{rightGridFullWidth:C,rightGridWidth:Math.min(C,m),getRightGridColumnWidth:S}}const W$=`scrollable-container--${lj.TopGrid}`,$$=`scrollable-container--${lj.LeftGrid}`,B$=`scrollable-container--${lj.DataGrid}`,H$=e=>e&&e instanceof HTMLDivElement?{width:e.offsetWidth-e.clientWidth,height:e.offsetHeight-e.clientHeight}:{width:0,height:0},V$=(e,t)=>e>t?cj.Forward:e<t?cj.Backward:cj.None,G$=({gridRefs:{topGridRef:e,leftGridRef:t,dataGridRef:n},getWrapperElements:r,updateViewService:i,trackScrollDirection:o,interactions:a})=>{const{direction:s}=GF();c((()=>{const{headerGridWrapperElement:l,topGridWrapperElement:c,leftGridWrapperElement:u,dataGridWrapperElement:d}=r(),h=e=>{const t=e.target;l.scrollLeft=t.scrollLeft,o(e),i?.(e)},p=e=>{const t=e.target;l.scrollTop=t.scrollTop,o(e),i?.(e)},f=r=>{const a=r.target,l=((e,t)=>{const{scrollWidth:n,clientWidth:r,scrollLeft:i}=e,o=n-r;if("rtl"===t){if(i>o)return o;if(i<0)return Math.abs(i)}return i})(a,s);n.current?.scrollTo({scrollLeft:l,scrollTop:a.scrollTop}),c.scrollLeft=l,e.current?.forEach((e=>{e?.scrollTo(l)})),u.scrollTop=d.scrollTop,t.current?.forEach((e=>{e?.scrollTo(a.scrollTop)})),o(r),i?.(r)};return u.addEventListener("scroll",h),c.addEventListener("scroll",p),d.addEventListener("scroll",f),a.scroll||setTimeout((()=>{u.removeEventListener("scroll",h),c.removeEventListener("scroll",p),d.removeEventListener("scroll",f)}),0),()=>{u.removeEventListener("scroll",h),c.removeEventListener("scroll",p),d.removeEventListener("scroll",f)}}),[o,i,a,e,t,n,r,s])},U$=()=>{const{interactions:e}=KF(),t=a(null),n=a(null),r=a(null),i=a(null),o=a([]),s=a([]),l=a(null),{scrollbarsDimensions:{verticalScrollbarWidth:u,horizontalScrollbarHeight:d},resetHorizontalScrollbarHeight:f}=(({topGridWrapperRef:e,leftGridWrapperRef:t,dataGridWrapperRef:n})=>{const[r,i]=m(0),[o,a]=m(0);return p((()=>{(e.current||n.current)&&i(Math.max(H$(e.current).width,H$(n.current).width))})),p((()=>{(t.current||n.current)&&a(Math.max(H$(t.current).height,H$(n.current).height))})),{scrollbarsDimensions:{verticalScrollbarWidth:r,horizontalScrollbarHeight:o},resetHorizontalScrollbarHeight:()=>{a(0)}}})({topGridWrapperRef:n,leftGridWrapperRef:r,dataGridWrapperRef:i});(({gridSectionsWrapperRefs:{headerGridWrapperRef:e,topGridWrapperRef:t,leftGridWrapperRef:n,dataGridWrapperRef:r},gridRefs:{topGridRef:i,leftGridRef:o,dataGridRef:a}})=>{const{pageInfo:s}=GF(),{downloadService:l,viewService:c,layoutService:u}=ZF(),d=h((()=>{const i={left:0,top:0};e.current?.scrollTo(i),t.current?.scrollTo(i),n.current?.scrollTo(i),r.current?.scrollTo(i)}),[e,t,n,r]);p((()=>{d()}),[s.page,d]),p((()=>{u.triggerdByExpandOrCollapse||d()}),[u,d]),p((()=>{if(u.triggerdByExpandOrCollapse){const e=r.current?.scrollLeft??0,t=r.current?.scrollTop??0;o.current?.forEach((e=>{e?.scrollTo(t)})),i.current?.forEach((t=>{t?.scrollTo(e)})),a.current?.scrollTo({scrollTop:t,scrollLeft:e})}}),[u,r,a,o,i]),p((()=>{(l.isDownloadedAsPDForImage||u.isSnapshot)&&r.current&&n.current&&t.current&&(r.current.scrollTop=c.scrollTop,r.current.scrollLeft=c.scrollLeft,n.current.scrollLeft=c.leftGridScrollLeft,t.current.scrollTop=c.topGridScrollTop)}),[c,l,u,r,n,t])})({gridSectionsWrapperRefs:{headerGridWrapperRef:t,topGridWrapperRef:n,leftGridWrapperRef:r,dataGridWrapperRef:i},gridRefs:{topGridRef:o,leftGridRef:s,dataGridRef:l}});const{trackScrollDirection:g,scrollDirectionRefs:{verticalScrollDirection:y,horizontalScrollDirection:v}}=(()=>{const e=a(cj.None),t=a(cj.None),n=a({prevScrollTop:0,prevScrollLeft:0}),r=h((r=>{if(r instanceof WheelEvent&&(e.current=V$(r.deltaY,0),t.current=V$(r.deltaX,0)),r instanceof Event&&!(r instanceof WheelEvent)){const i=r.target;e.current=V$(i.scrollTop,n.current.prevScrollTop),n.current.prevScrollTop=i.scrollTop,t.current=V$(i.scrollLeft,n.current.prevScrollLeft),n.current.prevScrollLeft=i.scrollLeft}}),[e,t,n]);return{trackScrollDirection:r,scrollDirectionRefs:{verticalScrollDirection:e,horizontalScrollDirection:t}}})(),b=(()=>{const{viewService:e}=ZF();return h((t=>{const n=t.target,r=t.currentTarget,i=n.dataset.key;i===$$&&(e.leftGridScrollLeft=r.scrollLeft),i===B$&&(e.scrollLeft=r.scrollLeft),i===W$&&(e.topGridScrollTop=r.scrollTop),i!==$$&&i!==B$||(e.scrollTop=r.scrollTop)}),[e])})(),x={gridRefs:{topGridRef:o,leftGridRef:s,dataGridRef:l},getWrapperElements:h((()=>({headerGridWrapperElement:t.current,topGridWrapperElement:n.current,leftGridWrapperElement:r.current,dataGridWrapperElement:i.current})),[t,n,r,i]),updateViewService:b,trackScrollDirection:g,interactions:e};return(({gridRefs:{topGridRef:e,leftGridRef:t,dataGridRef:n},getWrapperElements:r,updateViewService:i,trackScrollDirection:o,interactions:a})=>{c((()=>{const{headerGridWrapperElement:i,topGridWrapperElement:s,leftGridWrapperElement:l,dataGridWrapperElement:c}=r(),u=e=>{i.scrollLeft+=e.deltaX,i.scrollTop+=e.deltaY,l.scrollLeft=i.scrollLeft,s.scrollTop=i.scrollTop,o(e)},d=e=>{l.scrollTop+=e.deltaY,t.current?.forEach((e=>{e?.scrollTo(l.scrollTop)})),i.scrollLeft+=e.deltaX,l.scrollLeft=i.scrollLeft,c.scrollTop=l.scrollTop,n.current?.scrollTo({scrollTop:l.scrollTop}),o(e)},h=t=>{s.scrollLeft+=t.deltaX,e.current?.forEach((e=>{e?.scrollTo(s.scrollLeft)})),i.scrollTop+=t.deltaY,s.scrollTop=i.scrollTop,c.scrollLeft=s.scrollLeft,n.current?.scrollTo({scrollLeft:s.scrollLeft}),o(t)},p=r=>{c.scrollLeft+=r.deltaX,c.scrollTop+=r.deltaY,n.current?.scrollTo({scrollLeft:c.scrollLeft,scrollTop:c.scrollTop}),s.scrollLeft=c.scrollLeft,e.current?.forEach((e=>{e?.scrollTo(c.scrollLeft)})),l.scrollTop=c.scrollTop,t.current?.forEach((e=>{e?.scrollTo(c.scrollTop)})),o(r)};return i.addEventListener("wheel",u),l.addEventListener("wheel",d),s.addEventListener("wheel",h),c.addEventListener("wheel",p),a.scroll||setTimeout((()=>{i.removeEventListener("wheel",u),l.removeEventListener("wheel",d),s.removeEventListener("wheel",h),c.removeEventListener("wheel",p)}),0),()=>{i.removeEventListener("wheel",u),l.removeEventListener("wheel",d),s.removeEventListener("wheel",h),c.removeEventListener("wheel",p)}}),[o,i,a,e,t,n,r])})(x),G$(x),{gridSectionsWrapperRefs:{headerGridWrapperRef:t,topGridWrapperRef:n,leftGridWrapperRef:r,dataGridWrapperRef:i},gridRefs:{topGridRef:o,leftGridRef:s,dataGridRef:l},scrollDirectionRefs:{verticalScrollDirection:y,horizontalScrollDirection:v},scrollbarsDimensions:{verticalScrollbarWidth:u,horizontalScrollbarHeight:d,resetHorizontalScrollbarHeight:f}}},Y$=()=>{const{layoutService:e}=ZF(),{rect:t,pageInfo:n}=GF();return f((()=>{let{height:r}=t;return e.hasLimitedData&&(r-=22),n.shouldShowPagination&&(r-=41),{...t,height:r}}),[t,e,n.shouldShowPagination])},K$=({children:e,style:t})=>Ji.jsx("div",{"data-testid":"fullSize",style:t,children:e}),X$=({children:e,style:t})=>{const{direction:n}=GF();return Ji.jsx("div",{"data-section-id":"GRID",style:{direction:n,display:"grid",...t},children:e})},J$=e=>e&&`scrollable-container--${e}`,Z$=({children:e,style:t,origin:n},r)=>{const{interactions:i}=KF(),o=i.scroll?t:{overflow:"hidden"};return Ji.jsx("div",{"data-testid":"scrollable","data-key":J$(n),style:o,ref:r,children:e})};var Q$=t.forwardRef(Z$);const eB=({children:e,style:t})=>{const{direction:n}=GF();return Ji.jsx("div",{"data-testid":"sticky",style:{position:"sticky",top:0,["rtl"===n?"right":"left"]:0,...t},children:e})};function tB(){return tB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tB.apply(null,arguments)}function nB(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rB(e,t){return rB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rB(e,t)}function iB(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,rB(e,t)}var oB=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function aB(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(r=e[n],i=t[n],!(r===i||oB(r)&&oB(i)))return!1;var r,i;return!0}function sB(e,t){var n;void 0===t&&(t=aB);var r,i=[],o=!1;return function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return o&&n===this&&t(a,i)||(r=e.apply(this,a),o=!0,n=this,i=a),r}}function lB(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}var cB="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function uB(e){cancelAnimationFrame(e.id)}function dB(e,t){var n=cB();var r={id:requestAnimationFrame((function i(){cB()-n>=t?e.call(null):r.id=requestAnimationFrame(i)}))};return r}var hB=-1;function pB(e){if(void 0===e&&(e=!1),-1===hB||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),hB=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return hB}var fB=null;function mB(e){if(void 0===e&&(e=!1),null===fB||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;return i.width="100px",i.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?fB="positive-descending":(t.scrollLeft=1,fB=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),fB}return fB}var gB=function(e){var t=e.columnIndex;return e.data,e.rowIndex+":"+t};function yB(e){var t,r=e.getColumnOffset,i=e.getColumnStartIndexForOffset,o=e.getColumnStopIndexForStartIndex,a=e.getColumnWidth,s=e.getEstimatedTotalHeight,l=e.getEstimatedTotalWidth,c=e.getOffsetForColumnAndAlignment,u=e.getOffsetForRowAndAlignment,d=e.getRowHeight,h=e.getRowOffset,p=e.getRowStartIndexForOffset,f=e.getRowStopIndexForStartIndex,m=e.initInstanceProps,g=e.shouldResetStyleCacheOnItemSizeChange,y=e.validateProps;return t=function(e){function t(t){var n;return(n=e.call(this,t)||this)._instanceProps=m(n.props,nB(n)),n._resetIsScrollingTimeoutId=null,n._outerRef=void 0,n.state={instance:nB(n),isScrolling:!1,horizontalScrollDirection:"forward",scrollLeft:"number"==typeof n.props.initialScrollLeft?n.props.initialScrollLeft:0,scrollTop:"number"==typeof n.props.initialScrollTop?n.props.initialScrollTop:0,scrollUpdateWasRequested:!1,verticalScrollDirection:"forward"},n._callOnItemsRendered=void 0,n._callOnItemsRendered=sB((function(e,t,r,i,o,a,s,l){return n.props.onItemsRendered({overscanColumnStartIndex:e,overscanColumnStopIndex:t,overscanRowStartIndex:r,overscanRowStopIndex:i,visibleColumnStartIndex:o,visibleColumnStopIndex:a,visibleRowStartIndex:s,visibleRowStopIndex:l})})),n._callOnScroll=void 0,n._callOnScroll=sB((function(e,t,r,i,o){return n.props.onScroll({horizontalScrollDirection:r,scrollLeft:e,scrollTop:t,verticalScrollDirection:i,scrollUpdateWasRequested:o})})),n._getItemStyle=void 0,n._getItemStyle=function(e,t){var i,o=n.props,s=o.columnWidth,l=o.direction,c=o.rowHeight,u=n._getItemStyleCache(g&&s,g&&l,g&&c),p=e+":"+t;if(u.hasOwnProperty(p))i=u[p];else{var f=r(n.props,t,n._instanceProps),m="rtl"===l;u[p]=i={position:"absolute",left:m?void 0:f,right:m?f:void 0,top:h(n.props,e,n._instanceProps),height:d(n.props,e,n._instanceProps),width:a(n.props,t,n._instanceProps)}}return i},n._getItemStyleCache=void 0,n._getItemStyleCache=sB((function(e,t,n){return{}})),n._onScroll=function(e){var t=e.currentTarget,r=t.clientHeight,i=t.clientWidth,o=t.scrollLeft,a=t.scrollTop,s=t.scrollHeight,l=t.scrollWidth;n.setState((function(e){if(e.scrollLeft===o&&e.scrollTop===a)return null;var t=n.props.direction,c=o;if("rtl"===t)switch(mB()){case"negative":c=-o;break;case"positive-descending":c=l-i-o}c=Math.max(0,Math.min(c,l-i));var u=Math.max(0,Math.min(a,s-r));return{isScrolling:!0,horizontalScrollDirection:e.scrollLeft<o?"forward":"backward",scrollLeft:c,scrollTop:u,verticalScrollDirection:e.scrollTop<a?"forward":"backward",scrollUpdateWasRequested:!1}}),n._resetIsScrollingDebounced)},n._outerRefSetter=function(e){var t=n.props.outerRef;n._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},n._resetIsScrollingDebounced=function(){null!==n._resetIsScrollingTimeoutId&&uB(n._resetIsScrollingTimeoutId),n._resetIsScrollingTimeoutId=dB(n._resetIsScrolling,150)},n._resetIsScrolling=function(){n._resetIsScrollingTimeoutId=null,n.setState({isScrolling:!1},(function(){n._getItemStyleCache(-1)}))},n}iB(t,e),t.getDerivedStateFromProps=function(e,t){return vB(e,t),y(e),null};var v=t.prototype;return v.scrollTo=function(e){var t=e.scrollLeft,n=e.scrollTop;void 0!==t&&(t=Math.max(0,t)),void 0!==n&&(n=Math.max(0,n)),this.setState((function(e){return void 0===t&&(t=e.scrollLeft),void 0===n&&(n=e.scrollTop),e.scrollLeft===t&&e.scrollTop===n?null:{horizontalScrollDirection:e.scrollLeft<t?"forward":"backward",scrollLeft:t,scrollTop:n,scrollUpdateWasRequested:!0,verticalScrollDirection:e.scrollTop<n?"forward":"backward"}}),this._resetIsScrollingDebounced)},v.scrollToItem=function(e){var t=e.align,n=void 0===t?"auto":t,r=e.columnIndex,i=e.rowIndex,o=this.props,a=o.columnCount,d=o.height,h=o.rowCount,p=o.width,f=this.state,m=f.scrollLeft,g=f.scrollTop,y=pB();void 0!==r&&(r=Math.max(0,Math.min(r,a-1))),void 0!==i&&(i=Math.max(0,Math.min(i,h-1)));var v=s(this.props,this._instanceProps),b=l(this.props,this._instanceProps)>p?y:0,x=v>d?y:0;this.scrollTo({scrollLeft:void 0!==r?c(this.props,r,n,m,this._instanceProps,x):m,scrollTop:void 0!==i?u(this.props,i,n,g,this._instanceProps,b):g})},v.componentDidMount=function(){var e=this.props,t=e.initialScrollLeft,n=e.initialScrollTop;if(null!=this._outerRef){var r=this._outerRef;"number"==typeof t&&(r.scrollLeft=t),"number"==typeof n&&(r.scrollTop=n)}this._callPropsCallbacks()},v.componentDidUpdate=function(){var e=this.props.direction,t=this.state,n=t.scrollLeft,r=t.scrollTop;if(t.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("rtl"===e)switch(mB()){case"negative":i.scrollLeft=-n;break;case"positive-ascending":i.scrollLeft=n;break;default:var o=i.clientWidth,a=i.scrollWidth;i.scrollLeft=a-o-n}else i.scrollLeft=Math.max(0,n);i.scrollTop=Math.max(0,r)}this._callPropsCallbacks()},v.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&uB(this._resetIsScrollingTimeoutId)},v.render=function(){var e=this.props,t=e.children,r=e.className,i=e.columnCount,o=e.direction,a=e.height,c=e.innerRef,u=e.innerElementType,d=e.innerTagName,h=e.itemData,p=e.itemKey,f=void 0===p?gB:p,m=e.outerElementType,g=e.outerTagName,y=e.rowCount,v=e.style,b=e.useIsScrolling,x=e.width,w=this.state.isScrolling,S=this._getHorizontalRangeToRender(),C=S[0],M=S[1],k=this._getVerticalRangeToRender(),E=k[0],_=k[1],R=[];if(i>0&&y)for(var I=E;I<=_;I++)for(var D=C;D<=M;D++)R.push(n(t,{columnIndex:D,data:h,isScrolling:b?w:void 0,key:f({columnIndex:D,data:h,rowIndex:I}),rowIndex:I,style:this._getItemStyle(I,D)}));var A=s(this.props,this._instanceProps),P=l(this.props,this._instanceProps);return n(m||g||"div",{className:r,onScroll:this._onScroll,ref:this._outerRefSetter,style:tB({position:"relative",height:a,width:x,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},v)},n(u||d||"div",{children:R,ref:c,style:{height:A,pointerEvents:w?"none":void 0,width:P}}))},v._callPropsCallbacks=function(){var e=this.props,t=e.columnCount,n=e.onItemsRendered,r=e.onScroll,i=e.rowCount;if("function"==typeof n&&t>0&&i>0){var o=this._getHorizontalRangeToRender(),a=o[0],s=o[1],l=o[2],c=o[3],u=this._getVerticalRangeToRender(),d=u[0],h=u[1],p=u[2],f=u[3];this._callOnItemsRendered(a,s,d,h,l,c,p,f)}if("function"==typeof r){var m=this.state,g=m.horizontalScrollDirection,y=m.scrollLeft,v=m.scrollTop,b=m.scrollUpdateWasRequested,x=m.verticalScrollDirection;this._callOnScroll(y,v,g,x,b)}},v._getHorizontalRangeToRender=function(){var e=this.props,t=e.columnCount,n=e.overscanColumnCount,r=e.overscanColumnsCount,a=e.overscanCount,s=e.rowCount,l=this.state,c=l.horizontalScrollDirection,u=l.isScrolling,d=l.scrollLeft,h=n||r||a||1;if(0===t||0===s)return[0,0,0,0];var p=i(this.props,d,this._instanceProps),f=o(this.props,p,d,this._instanceProps),m=u&&"backward"!==c?1:Math.max(1,h),g=u&&"forward"!==c?1:Math.max(1,h);return[Math.max(0,p-m),Math.max(0,Math.min(t-1,f+g)),p,f]},v._getVerticalRangeToRender=function(){var e=this.props,t=e.columnCount,n=e.overscanCount,r=e.overscanRowCount,i=e.overscanRowsCount,o=e.rowCount,a=this.state,s=a.isScrolling,l=a.verticalScrollDirection,c=a.scrollTop,u=r||i||n||1;if(0===t||0===o)return[0,0,0,0];var d=p(this.props,c,this._instanceProps),h=f(this.props,d,c,this._instanceProps),m=s&&"backward"!==l?1:Math.max(1,u),g=s&&"forward"!==l?1:Math.max(1,u);return[Math.max(0,d-m),Math.max(0,Math.min(o-1,h+g)),d,h]},t}(w),t.defaultProps={direction:"ltr",itemData:void 0,useIsScrolling:!1},t}var vB=function(e,t){e.children,e.direction,e.height,e.innerTagName,e.outerTagName,e.overscanColumnsCount,e.overscanCount,e.overscanRowsCount,e.width,t.instance},bB=function(e,t){var n=e.rowCount,r=t.rowMetadataMap,i=t.estimatedRowHeight,o=t.lastMeasuredRowIndex,a=0;if(o>=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},xB=function(e,t){var n=e.columnCount,r=t.columnMetadataMap,i=t.estimatedColumnWidth,o=t.lastMeasuredColumnIndex,a=0;if(o>=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},wB=function(e,t,n,r){var i,o,a;if("column"===e?(i=r.columnMetadataMap,o=t.columnWidth,a=r.lastMeasuredColumnIndex):(i=r.rowMetadataMap,o=t.rowHeight,a=r.lastMeasuredRowIndex),n>a){var s=0;if(a>=0){var l=i[a];s=l.offset+l.size}for(var c=a+1;c<=n;c++){var u=o(c);i[c]={offset:s,size:u},s+=u}"column"===e?r.lastMeasuredColumnIndex=n:r.lastMeasuredRowIndex=n}return i[n]},SB=function(e,t,n,r){var i,o;return"column"===e?(i=n.columnMetadataMap,o=n.lastMeasuredColumnIndex):(i=n.rowMetadataMap,o=n.lastMeasuredRowIndex),(o>0?i[o].offset:0)>=r?CB(e,t,n,o,0,r):MB(e,t,n,Math.max(0,o),r)},CB=function(e,t,n,r,i,o){for(;i<=r;){var a=i+Math.floor((r-i)/2),s=wB(e,t,a,n).offset;if(s===o)return a;s<o?i=a+1:s>o&&(r=a-1)}return i>0?i-1:0},MB=function(e,t,n,r,i){for(var o="column"===e?t.columnCount:t.rowCount,a=1;r<o&&wB(e,t,r,n).offset<i;)r+=a,a*=2;return CB(e,t,n,Math.min(r,o-1),Math.floor(r/2),i)},kB=function(e,t,n,r,i,o,a){var s="column"===e?t.width:t.height,l=wB(e,t,n,o),c="column"===e?xB(t,o):bB(t,o),u=Math.max(0,Math.min(c-s,l.offset)),d=Math.max(0,l.offset-s+a+l.size);switch("smart"===r&&(r=i>=d-s&&i<=u+s?"auto":"center"),r){case"start":return u;case"end":return d;case"center":return Math.round(d+(u-d)/2);default:return i>=d&&i<=u?i:d>u||i<d?d:u}},EB=yB({getColumnOffset:function(e,t,n){return wB("column",e,t,n).offset},getColumnStartIndexForOffset:function(e,t,n){return SB("column",e,n,t)},getColumnStopIndexForStartIndex:function(e,t,n,r){for(var i=e.columnCount,o=e.width,a=wB("column",e,t,r),s=n+o,l=a.offset+a.size,c=t;c<i-1&&l<s;)c++,l+=wB("column",e,c,r).size;return c},getColumnWidth:function(e,t,n){return n.columnMetadataMap[t].size},getEstimatedTotalHeight:bB,getEstimatedTotalWidth:xB,getOffsetForColumnAndAlignment:function(e,t,n,r,i,o){return kB("column",e,t,n,r,i,o)},getOffsetForRowAndAlignment:function(e,t,n,r,i,o){return kB("row",e,t,n,r,i,o)},getRowOffset:function(e,t,n){return wB("row",e,t,n).offset},getRowHeight:function(e,t,n){return n.rowMetadataMap[t].size},getRowStartIndexForOffset:function(e,t,n){return SB("row",e,n,t)},getRowStopIndexForStartIndex:function(e,t,n,r){for(var i=e.rowCount,o=e.height,a=wB("row",e,t,r),s=n+o,l=a.offset+a.size,c=t;c<i-1&&l<s;)c++,l+=wB("row",e,c,r).size;return c},initInstanceProps:function(e,t){var n=e,r={columnMetadataMap:{},estimatedColumnWidth:n.estimatedColumnWidth||50,estimatedRowHeight:n.estimatedRowHeight||50,lastMeasuredColumnIndex:-1,lastMeasuredRowIndex:-1,rowMetadataMap:{}};return t.resetAfterColumnIndex=function(e,n){void 0===n&&(n=!0),t.resetAfterIndices({columnIndex:e,shouldForceUpdate:n})},t.resetAfterRowIndex=function(e,n){void 0===n&&(n=!0),t.resetAfterIndices({rowIndex:e,shouldForceUpdate:n})},t.resetAfterIndices=function(e){var n=e.columnIndex,i=e.rowIndex,o=e.shouldForceUpdate,a=void 0===o||o;"number"==typeof n&&(r.lastMeasuredColumnIndex=Math.min(r.lastMeasuredColumnIndex,n-1)),"number"==typeof i&&(r.lastMeasuredRowIndex=Math.min(r.lastMeasuredRowIndex,i-1)),t._getItemStyleCache(-1),a&&t.forceUpdate()},r},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.columnWidth,e.rowHeight}}),_B=function(e,t){return e};function RB(e){var t,r=e.getItemOffset,i=e.getEstimatedTotalSize,o=e.getItemSize,a=e.getOffsetForIndexAndAlignment,s=e.getStartIndexForOffset,l=e.getStopIndexForStartIndex,c=e.initInstanceProps,u=e.shouldResetStyleCacheOnItemSizeChange,d=e.validateProps;return t=function(e){function t(t){var n;return(n=e.call(this,t)||this)._instanceProps=c(n.props,nB(n)),n._outerRef=void 0,n._resetIsScrollingTimeoutId=null,n.state={instance:nB(n),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof n.props.initialScrollOffset?n.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},n._callOnItemsRendered=void 0,n._callOnItemsRendered=sB((function(e,t,r,i){return n.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:r,visibleStopIndex:i})})),n._callOnScroll=void 0,n._callOnScroll=sB((function(e,t,r){return n.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:r})})),n._getItemStyle=void 0,n._getItemStyle=function(e){var t,i=n.props,a=i.direction,s=i.itemSize,l=i.layout,c=n._getItemStyleCache(u&&s,u&&l,u&&a);if(c.hasOwnProperty(e))t=c[e];else{var d=r(n.props,e,n._instanceProps),h=o(n.props,e,n._instanceProps),p="horizontal"===a||"horizontal"===l,f="rtl"===a,m=p?d:0;c[e]=t={position:"absolute",left:f?void 0:m,right:f?m:void 0,top:p?0:d,height:p?"100%":h,width:p?h:"100%"}}return t},n._getItemStyleCache=void 0,n._getItemStyleCache=sB((function(e,t,n){return{}})),n._onScrollHorizontal=function(e){var t=e.currentTarget,r=t.clientWidth,i=t.scrollLeft,o=t.scrollWidth;n.setState((function(e){if(e.scrollOffset===i)return null;var t=n.props.direction,a=i;if("rtl"===t)switch(mB()){case"negative":a=-i;break;case"positive-descending":a=o-r-i}return a=Math.max(0,Math.min(a,o-r)),{isScrolling:!0,scrollDirection:e.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!1}}),n._resetIsScrollingDebounced)},n._onScrollVertical=function(e){var t=e.currentTarget,r=t.clientHeight,i=t.scrollHeight,o=t.scrollTop;n.setState((function(e){if(e.scrollOffset===o)return null;var t=Math.max(0,Math.min(o,i-r));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}}),n._resetIsScrollingDebounced)},n._outerRefSetter=function(e){var t=n.props.outerRef;n._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},n._resetIsScrollingDebounced=function(){null!==n._resetIsScrollingTimeoutId&&uB(n._resetIsScrollingTimeoutId),n._resetIsScrollingTimeoutId=dB(n._resetIsScrolling,150)},n._resetIsScrolling=function(){n._resetIsScrollingTimeoutId=null,n.setState({isScrolling:!1},(function(){n._getItemStyleCache(-1,null)}))},n}iB(t,e),t.getDerivedStateFromProps=function(e,t){return IB(e,t),d(e),null};var h=t.prototype;return h.scrollTo=function(e){e=Math.max(0,e),this.setState((function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}}),this._resetIsScrollingDebounced)},h.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,i=n.layout,o=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var s=0;if(this._outerRef){var l=this._outerRef;s="vertical"===i?l.scrollWidth>l.clientWidth?pB():0:l.scrollHeight>l.clientHeight?pB():0}this.scrollTo(a(this.props,e,t,o,this._instanceProps,s))},h.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var i=this._outerRef;"horizontal"===t||"horizontal"===r?i.scrollLeft=n:i.scrollTop=n}this._callPropsCallbacks()},h.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,i=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("horizontal"===t||"horizontal"===n)if("rtl"===t)switch(mB()){case"negative":o.scrollLeft=-i;break;case"positive-ascending":o.scrollLeft=i;break;default:var a=o.clientWidth,s=o.scrollWidth;o.scrollLeft=s-a-i}else o.scrollLeft=i;else o.scrollTop=i}this._callPropsCallbacks()},h.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&uB(this._resetIsScrollingTimeoutId)},h.render=function(){var e=this.props,t=e.children,r=e.className,o=e.direction,a=e.height,s=e.innerRef,l=e.innerElementType,c=e.innerTagName,u=e.itemCount,d=e.itemData,h=e.itemKey,p=void 0===h?_B:h,f=e.layout,m=e.outerElementType,g=e.outerTagName,y=e.style,v=e.useIsScrolling,b=e.width,x=this.state.isScrolling,w="horizontal"===o||"horizontal"===f,S=w?this._onScrollHorizontal:this._onScrollVertical,C=this._getRangeToRender(),M=C[0],k=C[1],E=[];if(u>0)for(var _=M;_<=k;_++)E.push(n(t,{data:d,key:p(_,d),index:_,isScrolling:v?x:void 0,style:this._getItemStyle(_)}));var R=i(this.props,this._instanceProps);return n(m||g||"div",{className:r,onScroll:S,ref:this._outerRefSetter,style:tB({position:"relative",height:a,width:b,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},y)},n(l||c||"div",{children:E,ref:s,style:{height:w?"100%":R,pointerEvents:x?"none":void 0,width:w?R:"100%"}}))},h._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],i=e[3];this._callOnItemsRendered(t,n,r,i)}if("function"==typeof this.props.onScroll){var o=this.state,a=o.scrollDirection,s=o.scrollOffset,l=o.scrollUpdateWasRequested;this._callOnScroll(a,s,l)}},h._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,i=r.isScrolling,o=r.scrollDirection,a=r.scrollOffset;if(0===t)return[0,0,0,0];var c=s(this.props,a,this._instanceProps),u=l(this.props,c,a,this._instanceProps),d=i&&"backward"!==o?1:Math.max(1,n),h=i&&"forward"!==o?1:Math.max(1,n);return[Math.max(0,c-d),Math.max(0,Math.min(t-1,u+h)),c,u]},t}(w),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var IB=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},DB=function(e,t,n){var r=e.itemSize,i=n.itemMetadataMap,o=n.lastMeasuredIndex;if(t>o){var a=0;if(o>=0){var s=i[o];a=s.offset+s.size}for(var l=o+1;l<=t;l++){var c=r(l);i[l]={offset:a,size:c},a+=c}n.lastMeasuredIndex=t}return i[t]},AB=function(e,t,n,r,i){for(;r<=n;){var o=r+Math.floor((n-r)/2),a=DB(e,o,t).offset;if(a===i)return o;a<i?r=o+1:a>i&&(n=o-1)}return r>0?r-1:0},PB=function(e,t,n,r){for(var i=e.itemCount,o=1;n<i&&DB(e,n,t).offset<r;)n+=o,o*=2;return AB(e,t,Math.min(n,i-1),Math.floor(n/2),r)},OB=function(e,t){var n=e.itemCount,r=t.itemMetadataMap,i=t.estimatedItemSize,o=t.lastMeasuredIndex,a=0;if(o>=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},TB=RB({getItemOffset:function(e,t,n){return DB(e,t,n).offset},getItemSize:function(e,t,n){return n.itemMetadataMap[t].size},getEstimatedTotalSize:OB,getOffsetForIndexAndAlignment:function(e,t,n,r,i,o){var a=e.direction,s=e.height,l=e.layout,c=e.width,u="horizontal"===a||"horizontal"===l?c:s,d=DB(e,t,i),h=OB(e,i),p=Math.max(0,Math.min(h-u,d.offset)),f=Math.max(0,d.offset-u+d.size+o);switch("smart"===n&&(n=r>=f-u&&r<=p+u?"auto":"center"),n){case"start":return p;case"end":return f;case"center":return Math.round(f+(p-f)/2);default:return r>=f&&r<=p?r:r<f?f:p}},getStartIndexForOffset:function(e,t,n){return function(e,t,n){var r=t.itemMetadataMap,i=t.lastMeasuredIndex;return(i>0?r[i].offset:0)>=n?AB(e,t,i,0,n):PB(e,t,Math.max(0,i),n)}(e,n,t)},getStopIndexForStartIndex:function(e,t,n,r){for(var i=e.direction,o=e.height,a=e.itemCount,s=e.layout,l=e.width,c="horizontal"===i||"horizontal"===s?l:o,u=DB(e,t,r),d=n+c,h=u.offset+u.size,p=t;p<a-1&&h<d;)p++,h+=DB(e,p,r).size;return p},initInstanceProps:function(e,t){var n={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,r){void 0===r&&(r=!0),n.lastMeasuredIndex=Math.min(n.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),r&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.itemSize}});function LB(e,t){for(var n in e)if(!(n in t))return!0;for(var r in t)if(e[r]!==t[r])return!0;return!1}var qB=["style"],NB=["style"];function jB(e,t){var n=e.style,r=lB(e,qB),i=t.style,o=lB(t,NB);return!LB(n,i)&&!LB(r,o)}const zB=10,FB=(e,t)=>e.current===cj.Backward?t:0,WB=(e,t,n,r)=>{for(let i=n;i<n+r;i++){const n=e.at(i);if(void 0===n||void 0===n.at(t))return!0}return!1},$B=(e,t)=>e.qLeft+e.qWidth===t.qLeft&&e.qTop===t.qTop&&e.qHeight===t.qHeight,BB=({pageInfo:e,measureData:t,pageTop:n,qHeight:r,startLeft:i,endLeft:o})=>{const a=[],s=e.page*e.rowsPerPage;for(let e=i;e<o;e++)if(WB(t,e,n,r)){const t=a[a.length-1],i={qLeft:e,qTop:n+s,qWidth:1,qHeight:r};void 0!==t&&$B(t,i)?t.qWidth+=i.qWidth:a.push(i)}return a},HB=({pageInfo:e,measureData:t,scrollDirection:n,viewService:r,minBufferStartLeft:i,minBufferEndLeft:o,columnEndIndex:a})=>{const{gridRowStartIndex:s,gridHeight:l}=r,c=n.current===cj.Backward?Math.max(0,i-25):o,u=Math.min(c+25,a);return BB({pageInfo:e,measureData:t,startLeft:c,endLeft:u,pageTop:s,qHeight:l})},VB=({pageInfo:e,measureData:t,scrollDirection:n,layoutService:r,viewService:i})=>{const{startLeft:o,endLeft:a,pageTop:s,qHeight:l}=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:a}=t,s=e.size.x,l=FB(n,zB),c=Math.max(r-l,0);return{startLeft:c,endLeft:c+Math.min(o+zB,s-c),pageTop:i,qHeight:a}})(r,i,n),c=BB({pageInfo:e,measureData:t,startLeft:o,endLeft:a,pageTop:s,qHeight:l});return c.length>0?[...c,...HB({pageInfo:e,measureData:t,scrollDirection:n,viewService:i,minBufferStartLeft:o,minBufferEndLeft:a,columnEndIndex:r.size.x})]:c},GB=(e,t,n,r)=>{const i=e[n];if(void 0===i)return!0;for(let e=t;e<t+r;e++){if(void 0===i[e])return!0}return!1},UB=(e,t)=>e.qTop+e.qHeight===t.qTop&&e.qLeft===t.qLeft&&e.qWidth===t.qWidth,YB=({startTop:e,endTop:t,qLeft:n,qWidth:r,measureData:i,pageInfo:o})=>{const a=[],s=o.page*o.rowsPerPage;for(let o=e;o<t;o++)if(GB(i,n,o,r)){const e=a.at(-1),t={qLeft:n,qTop:o+s,qWidth:r,qHeight:1};void 0!==e&&UB(e,t)?e.qHeight+=t.qHeight:a.push(t)}return a},KB=({pageInfo:e,measureData:t,scrollDirection:n,viewService:r})=>{const{startTop:i,endTop:o,qLeft:a,qWidth:s}=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:a}=t,s=FB(n,zB),l=Math.max(i-s,0);return{startTop:l,endTop:l+Math.min(a+zB,e.rowsOnCurrentPage-l),qLeft:r,qWidth:o}})(e,r,n),l=YB({startTop:i,endTop:o,qLeft:a,qWidth:s,measureData:t,pageInfo:e});if(l.length>0){const r=n.current===cj.Backward?Math.max(0,i-25):o,c=Math.min(r+25,e.rowsOnCurrentPage),u=YB({startTop:r,endTop:c,qLeft:a,qWidth:s,measureData:t,pageInfo:e});return[...l,...u]}return l},XB=async(e,t,n,r,i,o,a,s)=>{const{gridColumnStartIndex:l,gridRowStartIndex:c,gridWidth:u,gridHeight:d}=i;let h=[],p=[];o.current!==cj.None&&(h=KB({pageInfo:r,measureData:n,scrollDirection:o,viewService:i})),a.current!==cj.None&&(p=VB({pageInfo:r,measureData:n,scrollDirection:a,layoutService:t,viewService:i})),o.current===cj.None&&a.current===cj.None&&(h=YB({measureData:n,pageInfo:r,qLeft:l,qWidth:u,startTop:c,endTop:c+d}));const f=e.fetchPages([...h,...p]);s.isDownloadedAsPDForImage&&s.waitForPromise(f)},JB=function(e){var t,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,o=0;return function(){t=this;for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];n=s;var c=Date.now()-o,u=function(){o=Date.now(),r=0,e.apply(t,n)};r||(c>=i?u():r=setTimeout(u,i-c))}}(XB,100),ZB=LN(XB,75),QB=(e,t,n=!1)=>void 0!==e&&(e.isLeafNode||n&&e.isLeftColumn?e.mainAxisPageCoord===t:e.mainAxisPageCoord+e.leafCount-1===t),eH=({style:e,index:t,isLastRow:n,isLastColumn:r,showLastBorder:i,isLeftColumn:o,showTotalCellDivider:a})=>{const{direction:s}=GF(),{styleService:{grid:{border:l,divider:c}}}=ZF();return Ji.jsx("div",{style:{...e,...Bj,...Uj(n,r,l,s,i),...Kj({bottomDivider:a&&o,rightDivider:a&&!o,borderColor:c})},"data-testid":"empty-cell","data-index":t})},tH=({children:e,verticalAlign:t,width:n,right:r,isLeftColumn:i})=>{const{layoutService:{isIndentModeEnabled:o}}=ZF(),a=i&&o;return Ji.jsx("div",{"data-key":"sticky-cell-container",style:{display:"flex",flexDirection:"row",width:n,maxWidth:"100%",maxHeight:"100%",position:"sticky",left:4,top:0,bottom:0,right:r,...!a&&{alignItems:t,alignSelf:t,overflow:"hidden"}},children:e})},nH=e=>{const{type:t,imageSize:n}=e;return t!==QN.Image||"fill"!==n&&"fitWidth"!==n?"fit-content":"100%"},rH=e=>"number"==typeof e&&!Number.isNaN(+e),iH=e=>"string"==typeof e&&e.length>0||"number"==typeof e?+e:NaN,oH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",viewBox:"0 0 16 16",height:"16px",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M7.5 8.5H2v-1h5.5V2h1v5.5H14v1H8.5V14h-1z"})}))),aH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M8 0c4.4 0 8 3.6 8 8s-3.6 8-8 8-8-3.6-8-8 3.6-8 8-8"})}))),sH=v(((e,t)=>Ji.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:[Ji.jsx("path",{d:"M3 9v6.5a.5.5 0 1 1-1 0V.5a.5.5 0 0 1 1 0V1q2.441.639 3.667.639c1.225 0 1.774-.995 3.87-1.196q1.972-.19 3.297.47A.3.3 0 0 1 14 1.18v7.344a.3.3 0 0 1-.417.277q-1.338-.565-3.045-.416c-1.98.172-2.083 1.107-3.871 1.253Q4.879 9.785 3 9"}),Ji.jsx("use",{fillRule:"evenodd"})]}))),lH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M13.9 7.4c-1 1.3-.6 1.5-1.5 4.1-.5 1.8-1.2 2.9-1.7 3.6q-.45.6-.9.9H4.2c-1 0-1.6-.5-1.9-1-.2-.3-.3-.6-.3-1V4.2c0-.4.3-.7.7-.7s.7.3.7.7v3.6l.9-.1V1.6c0-.4.3-.7.7-.7s.7.3.7.7v5.1l1.1-.2V.7C6.7.3 7 0 7.4 0s.7.3.7.7v5.9l1.1.1V1.6c0-.4.3-.7.7-.7s.7.3.7.7v7.7s.1 0 .1-.2l.6-1.4c1.1-2.1 3.1-1.1 2.6-.3"})}))),cH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M5 13h6v1.5c0 .3-.2.5-.5.5H10v.5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5V15h-.5c-.3 0-.5-.2-.5-.5zm0-1c0-2-3-3-3-7 0-3 3-5 6-5s6 2 6 5c0 4-3 4-3 7H5m-.5-7c.3 0 .5-.2.5-.5s.2-.7.5-1 .6-.5 1-.5c.3 0 .5-.2.5-.5S6.8 2 6.5 2c-.6 0-1.2.3-1.7.8S4 3.9 4 4.5c0 .3.2.5.5.5"})}))),uH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M8 0c4.4 0 8 3.6 8 8s-3.6 8-8 8-8-3.6-8-8 3.6-8 8-8m4.5 9c.25 0 .5-.3.5-.6v-.8c0-.3-.25-.6-.5-.6h-9c-.25 0-.5.3-.5.6v.7c0 .4.25.7.5.7z"})}))),dH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M2 7h12v2H2z"})}))),hH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M9 7h7a7.004 7.004 0 0 0-7-7zm1-5.917A6.005 6.005 0 0 1 14.917 6H10zM14 9H7V2a7.002 7.002 0 0 0 0 14 7 7 0 0 0 7-7m-8 1h6.917A6.002 6.002 0 0 1 1 9a6 6 0 0 1 5-5.917z"})}))),pH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M9 9h3.5c.25 0 .5-.3.5-.6v-.8c0-.3-.25-.6-.5-.6H9V3.5c0-.25-.3-.5-.6-.5h-.7c-.4 0-.7.25-.7.5V7H3.5c-.25 0-.5.3-.5.6v.7c0 .4.25.7.5.7H7v3.5c0 .25.3.5.6.5h.8c.3 0 .6-.25.6-.5zM8 0c4.4 0 8 3.6 8 8s-3.6 8-8 8-8-3.6-8-8 3.6-8 8-8"})}))),fH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"m8.418 1.007.042.08 1.788 4.217 4.571.388a.5.5 0 0 1 .348.811l-.063.065-3.472 3.008 1.043 4.47a.5.5 0 0 1-.664.581l-.081-.04L8 12.217l-3.93 2.372a.5.5 0 0 1-.757-.453l.012-.089 1.043-4.47L.896 6.568a.5.5 0 0 1 .196-.86l.089-.016 4.571-.388L7.54 1.086a.5.5 0 0 1 .878-.08Z"})}))),mH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M13 14H3a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1"})}))),gH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"m6 10 7-7 2 2-7 7-2 2-5-5 2-2z"})}))),yH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M2.4 4h11.2a.2.2 0 0 1 .16.32l-5.6 7.467a.2.2 0 0 1-.32 0L2.24 4.32A.2.2 0 0 1 2.4 4"})}))),vH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M11 2.4v11.2a.2.2 0 0 1-.32.16l-7.467-5.6a.2.2 0 0 1 0-.32l7.467-5.6a.2.2 0 0 1 .32.16"})}))),bH=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M4 13.6V2.4a.2.2 0 0 1 .32-.16l7.467 5.6a.2.2 0 0 1 0 .32l-7.467 5.6A.2.2 0 0 1 4 13.6"})}))),xH={m:gH,"ï":fH,R:v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M13.6 11H2.4a.2.2 0 0 1-.16-.32l5.6-7.467a.2.2 0 0 1 .32 0l5.6 7.467a.2.2 0 0 1-.16.32"})}))),S:yH,T:vH,U:bH,P:pH,Q:uH,"è":v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M14.98 15H1.04c-1.002 0-1.303-.7-.802-1.5l6.82-11.9c.5-.8 1.303-.8 1.804 0l6.92 11.9c.501.8.1 1.5-.803 1.5M8.5 5h-1c-.3 0-.5.2-.5.5V9c0 .3.2.5.5.5h1c.3 0 .5-.2.5-.5V5.5c0-.3-.2-.5-.5-.5m-1 6c-.3 0-.5.2-.5.5v1c0 .3.2.5.5.5h1c.3 0 .5-.2.5-.5v-1c0-.3-.2-.5-.5-.5z"})}))),"¢":lH,"©":sH,"23F4":cH,2013:mH,"&":hH,add:oH,"minus-2":dH,dot:aH},wH=({size:e,iconKey:t,color:n,pvStyle:r})=>{const i=t&&xH[t];return i&&Ji.jsx("div",{"data-testid":"representation-indicator-icon",style:{color:n,height:e,...r},children:Ji.jsx(i,{style:{height:e}})})},SH=(e,t)=>e.max===e.min?.5:(t-e.min)/(e.max-e.min),CH=(e,t,n)=>{const r=e.paletteColors?e.paletteColors[t]:e.localPaletteColors[t];return n.getColorPickerColor(r)},MH=(e,t,n)=>{const r={previousColor:(i=e.localPaletteColors)[(o=t)-(o>0?1:0)],nextColor:i[o+(o<i.length-1?1:0)]};var i,o;const a=((e,t)=>{const n=e.limits&&e.limits.concat().sort(((e,t)=>e.value-t.value));return{lowerLimit:n&&t>0?n[t-1]:{value:0,gradient:!1},upperLimit:n&&n[t]?n[t]:{value:1,gradient:!1}}})(e,t),s=((e,t,n,r,i)=>{const{upperLimit:o,lowerLimit:a}=e,{previousColor:s,nextColor:l}=t,c=r===o.value?1:(r-a.value)/(o.value-a.value);return a.gradient&&o.gradient?r-a.value<o.value-r?{color:s.color,t:.5-c}:{color:l.color,t:c-.5}:a.gradient?{color:s.color,t:1-(.5+c/2)}:o.gradient?{color:l.color,t:c/2}:{color:i.localPaletteColors[n].color,t:r}})(a,r,t,n,e);return s&&gq(e.localPaletteColors[t].color).blend(gq(s.color),s.t)},kH=(e,t,n)=>{const r=((e,t)=>{const{limits:n}=e;return n&&(e.limits=n.sort(((e,t)=>e.value-t.value)),e.limits=n.map((e=>({...e,value:SH(t,e.value)})))),e})({...e},t),i=r.paletteColors||r.localPaletteColors;return i&&(r.localPaletteColors=i.concat().map(((e,t)=>({color:CH(r,t,n)})))),r},EH=(e,t,n,r)=>{const i=kH(e,n,r),{localPaletteColors:o}=i;if(t<=0)return o[0].color;if(t>=1)return o[o.length-1].color;const a=((e,t)=>{let n="",r=0;const{limits:i,localPaletteColors:o}=e;for(let a=0;a<o.length;a++){const o=i&&i[a]?i[a].value:1;if(t>=r&&t<o){n=MH(e,a,t);break}r=o}return n})(i,t);return a},_H=(e,t)=>{const n=(e=>e.map((e=>e.value??e)).sort(((e,t)=>e-t)))(e),r=n.some((e=>!rH(e)));return 0===n.length||r?(e=>{const t=0===e?0:.5*e;return{min:e-t,max:e+t}})(t):1===n.length?((e,t)=>{const n=e[0]-t;if(0===n||!rH(n)){const e=0===t?.5:Math.abs(.5*t);return{min:t-e,max:t+e}}return n>0?{min:t-.5*Math.abs(t),max:e[0]+2*n}:{min:e[0]+2*n,max:t+.5*Math.abs(t)}})(n,t):((e,t)=>{let n=e[e.length-1]-e[0];return n=n>0?n:1,{min:Math.min(t,e[0])-n/2,max:Math.max(t,e[e.length-1])+n/2}})(n,t)},RH=(e,t)=>{const{limits:n}=e.segments;if(!n)return;const r=((e,t)=>{const{min:n,max:r}=_H(e,t),i=Math.abs(t);return{min:n??t-i,max:r??t+i}})(n,t),i=((e,t,n)=>{const{limits:r,paletteColors:i,localPaletteColors:o}=e.segments;if(!r||!rH(t))return 0;let a=n&&rH(n)?Math.min(n,t):0;const s=r.sort(((e,t)=>e.value-t.value)),l=i||o;for(let e=0;e<l.length;e++){if(e===l.length-1||t<s[e].value&&t>=a)return e;a=s[e].value}return 0})(e,t,r.min);return{limitRange:r,limitPaletteColorIndex:i}},IH=e=>"flex-start"===e?"flex-end":"flex-start",DH=(e,t,n,r)=>{const i=e.indicatorConditionalColoring;if(!i)return;const o=RH(i,t),a=((e,t,n,r)=>{const{segments:i}=e;if(!i||!n)return;const{limits:o}=i;if(!o?.length||!((e,t)=>!(!e||0===e.length||!(e[t]?.gradient??e[t-1]?.gradient)))(o,n.limitPaletteColorIndex))return CH(i,n.limitPaletteColorIndex,r);const a=SH(n.limitRange,t);return EH(i,a,n.limitRange,r)})(i,t,o,r),s=i.segments.paletteColors[o?.limitPaletteColorIndex||0].icon,{indicator:l}=e;let c=l?.position||"right";return"rtl"===n&&(c="right"===c?"left":"right"),{color:a,iconKey:s,position:c}},AH=({representation:e,cellValue:t,textStyle:n})=>{const{styleService:r}=ZF(),{theme:i}=KF(),{direction:o}=GF(),{text:a,indicator:s}=e,{showTextValues:l,applySegmentColors:c}=s??{},u=DH(e,t,o,i),{fontSize:d,fontFamily:h,fontStyle:p,fontWeight:f,textDecoration:m}=r.measureValues,g={fontSize:d,fontFamily:h,fontStyle:p,fontWeight:f,textDecoration:m},y=parseInt(d||Tj,10),{iconKey:v,color:b,position:x}=u||{},w={display:"flex",paddingTop:2};return l?Ji.jsxs("div",{"data-key":"representation-indicator",style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"4px",overflow:n?.overflow,color:c?b:n?.color},children:["left"===x&&wH({size:y,iconKey:v,color:b,pvStyle:w}),Ji.jsx("span",{style:{paddingTop:4,overflow:n?.overflow,textOverflow:n?.textOverflow,whiteSpace:"nowrap",direction:t<0?"ltr":void 0,...g},children:a}),"right"===x&&wH({size:y,iconKey:v,color:b,pvStyle:w})]}):(w.paddingTop=5,wH({size:y,iconKey:v,color:b,pvStyle:w}))},PH=e=>!!e.target?.getAttribute("class")?.includes(ET),OH=(e,t)=>{switch(t.type){case"clearSelections":return{engineSelectedCells:null,activeSelection:null,selectedField:null};case"mouseup":return{...e,activeSelection:null,engineSelectedCells:t.payload.engineSelectedCells};case"mousedown":return{...e,activeSelection:t.payload.activeSelection,selectedField:t.payload.selectedField};case"mouseover":{if(!e.activeSelection)return e;const{index:n}=t.payload,r=Math.min(n,e.activeSelection.startIndex),i=Math.max(n,e.activeSelection.endIndex);if(r===e.activeSelection.startIndex&&i===e.activeSelection.endIndex)return e;const o={...e.activeSelection,startIndex:r,endIndex:i};return o.clientSelectedCells=(e=>{const{getCellFromIndex:t,startIndex:n,endIndex:r,clientSelectedCells:i}=e,o=new Map(i);for(let e=n;e<=r;e++){const n=t(e);"N"===n?.ref.qType&&o.set(n.ref.qElemNo,n)}return o})(o),{...e,activeSelection:o}}default:return e}},TH=e=>null!==e.target?.closest("[data-prevent-selection]"),LH=e=>"A"===e.target?.tagName,qH=({startIndex:e,getCellFromIndex:t,cell:n})=>({type:"mousedown",payload:{activeSelection:{startIndex:e,endIndex:e,getCellFromIndex:t,clientSelectedCells:(new Map).set(n.ref.qElemNo,n)},selectedField:{selectionCellType:n.selectionCellType,index:"L"===n.selectionCellType?n.x:n.y}}});const NH=s({createMouseDownHandler:()=>()=>{},createMouseOverHandler:()=>()=>{},createPointerUpHandler:()=>()=>{},isSelected:()=>!1,isActive:!1,isLocked:()=>!1}),jH=()=>d(NH),zH=({children:e,selections:t})=>{const n=function(e){const{updatePageInfo:t}=GF(),n=e.isActive(),[r,i]=l(OH,{engineSelectedCells:null,selectedField:null,activeSelection:null});c((()=>{const n=()=>{i({type:"clearSelections"})},r=()=>{n(),t({page:0})};return e.on("deactivated",n),e.on("canceled",n),e.on("confirmed",r),e.on("cleared",n),()=>{e.removeListener("deactivated",n),e.removeListener("canceled",n),e.removeListener("confirmed",r),e.removeListener("cleared",n)}}),[e,t]);const o=h((async()=>{if(!r.activeSelection)return;var t,n;1===r.activeSelection.clientSelectedCells.size&&(t=r.engineSelectedCells,(n=r.activeSelection).clientSelectedCells.forEach(((e,r)=>{t?.has(r)&&(n.clientSelectedCells.delete(r),t.delete(r))})));const o=new Map([...r.engineSelectedCells??new Map,...r.activeSelection.clientSelectedCells]);try{i({type:"mouseup",payload:{engineSelectedCells:o}}),await e.select({method:"selectPivotCells",params:[tW,Array.from(o,(([,e])=>({qType:e.selectionCellType,qRow:e.y,qCol:e.x})))]})}catch(e){console.error(e),i({type:"mouseup",payload:{engineSelectedCells:r.engineSelectedCells}})}}),[r,e]);c((()=>{if(r.activeSelection)return document.addEventListener("mouseup",o),()=>{document.removeEventListener("mouseup",o)}}),[o,r.activeSelection]);const a=h(((e,t)=>n=>{const r=t(e);PH(n)||TH(n)||LH(n)||!(e=>1===e.buttons)(n)||!r||i(qH({startIndex:e,getCellFromIndex:t,cell:r}))}),[]),s=h((t=>async()=>{r.activeSelection&&(e.isActive()||await e.begin([tW]),i({type:"mouseover",payload:{index:t}}))}),[r.activeSelection,e]),u=h(((e,t)=>n=>{if("touch"!==n.pointerType)return;const r=t(e);PH(n)||TH(n)||LH(n)||!r||(i(qH({startIndex:e,getCellFromIndex:t,cell:r})),o())}),[o]),d=h((e=>!(!r.engineSelectedCells?.size&&!r.activeSelection?.clientSelectedCells.size||!r.selectedField||e.selectionCellType===r.selectedField.selectionCellType&&("L"===e.selectionCellType?r.selectedField.index===e.x:r.selectedField.index===e.y))),[r.activeSelection?.clientSelectedCells.size,r.engineSelectedCells?.size,r.selectedField]),p=h((e=>!d(e)&&(r.engineSelectedCells?.has(e.ref.qElemNo)||!!r.activeSelection?.clientSelectedCells.has(e.ref.qElemNo))),[d,r.activeSelection?.clientSelectedCells,r.engineSelectedCells]);return f((()=>({isSelected:p,isActive:n,isLocked:d,createMouseDownHandler:a,createMouseOverHandler:s,createPointerUpHandler:u})),[p,n,d,a,s,u])}(t);return Ji.jsx(NH.Provider,{value:n,children:e})},FH=e=>"fill"===e.representation.imageSize,WH=(e,t)=>{let n=e.isLeftColumn?"flex-start":"center";return e.isLeftColumn&&FH(e)&&t&&(n="center"),e.representation.type!==QN.Image||FH(e)?n:e.representation.resolvedImagePosition?.vertical};var $H=function(e){return e.Background="background",e.Color="color",e.FontWeight="fontWeight",e.FontStyle="fontStyle",e.TextDecoration="textDecoration",e}($H||{});const BH={brighter:.5,darker:.3,opacity:.03},HH=(e,{cell:t,styleService:n})=>{if(e===$H.Background||e===$H.Color){const n=t.expressionColor[e];if(n)return n}return t.isNull?n.nullValues[e]:t.isPseudoDimension?n.measureLabels[e]:t.isTotal?n.totalValues[e]:n.dimensionValues[e]},VH=({styleService:e,isCellSelected:t,cell:n,isCellLocked:r})=>{if(t)return e.selectedColors.background;const i=HH($H.Background,{cell:n,styleService:e});return!r||!i||n.isPseudoDimension||n.isEmpty||n.isNull||n.isTotal?HH($H.Background,{cell:n,styleService:e}):`repeating-linear-gradient(\n -45deg,\n ${Cj(o=i,BH)} 0px 2px,\n ${o} 0px 4px\n ) border-box`;var o},GH=({cell:e,styleService:t,isCellSelected:n})=>n?t.selectedColors.color:HH($H.Color,{cell:e,styleService:t}),UH=({cell:e,styleService:t})=>{const{qCanCollapse:n,qCanExpand:r}=e.ref,i=HH($H.FontWeight,{cell:e,styleService:t});return void 0===i&&(r||n)?qj:i},YH=({cell:e,styleService:t})=>HH($H.FontStyle,{cell:e,styleService:t}),KH=({cell:e,styleService:t})=>HH($H.TextDecoration,{cell:e,styleService:t}),XH=e=>e?"pointer":"default",JH=({expandOrCollapse:e,cell:t})=>n=>{e?.(t.y,t.x),n.stopPropagation()},ZH=(e,t)=>{if(!e.isLeftColumn||e.representation.type===QN.Image)return{padding:4};return{padding:4,marginTop:t.dimensionValueTextHeight/2-6.5-4}},QH=({cell:e,isLeftColumn:t,isCellSelected:n})=>{const{styleService:r,layoutService:i}=ZF(),{interactions:o}=KF(),{isActive:a}=jH(),{dataModel:s}=w$();if(!e.ref.qCanExpand&&!e.ref.qCanCollapse)return null;const l=!o.active||a||!s,c=GH({cell:e,styleService:r,isCellSelected:n}),u=a?.4:1,d=e.ref.qCanExpand?rF:nF;let h;h=e.ref.qCanExpand?t?s.expandLeft:s.expandTop:t?s.collapseLeft:s.collapseTop;const p=_$({isLeftColumn:t,layoutService:i,representation:e.representation});return Ji.jsx(d,{opacity:u,color:c,"data-prevent-selection":!l||void 0,"data-testid":e.ref.qCanExpand?"expand-icon":"collapse-icon",height:13,style:{flexShrink:0,cursor:l?"default":"pointer",position:"sticky",top:0,...ZH(e,r),...p&&{alignSelf:WH(e)}},onClick:l?void 0:JH({cell:e,expandOrCollapse:h})})},eV=e=>{switch(e){case"fitHeight":case"fill":case"alwaysFit":return"100%";case"originalSize":return"fit-content";default:return"auto"}},tV=(e,t,n)=>{if("alwaysFit"===e&&t&&!n)return"fit-content";switch(e){case"fitHeight":return"auto";case"originalSize":return"fit-content";case"alwaysFit":return n?"unset":"100%";default:return"100%"}},nV=(e,t)=>{if("alwaysFit"===e)switch(t?.vertical){case"flex-start":return"center top";case"flex-end":return"center bottom";default:return"center center"}},rV=({representation:e,canExpandOrCollapse:t,leafCount:n,isLeftColumn:r,styleService:i,layoutService:o,isMeasureCell:a})=>{const{isIndentModeEnabled:s}=o,l=_$({isLeftColumn:r,layoutService:o,representation:e}),c=t?21:0,u=e.imageBox?.width??24;let d=`calc(100% - ${c}px)`,h=i.headerCellHeight;r&&l&&(d=u),(a||r)&&(h=i.contentCellHeight);let p=h;switch(r&&void 0!==n&&!s&&(p=h*Math.max(n,1)),e.imageSize){case"originalSize":return{maxWidth:d,maxHeight:p,...l?{width:d}:{}};case"fitWidth":return{width:d,maxHeight:p};case"fitHeight":return{height:p,maxWidth:d,...l?{width:d}:{}};case"fill":return{height:p,width:d};default:return{width:d,height:h}}},iV=e=>{if("alwaysFit"===e)return"contain"},oV=({suffix:e,delimeter:t})=>` ${e?t:""} ${e}`.trim(),aV=({imageSize:e,resolvedImagePosition:t,isImagesInIndentModeEnabled:n,isMeasureCell:r})=>({width:tV(e,n,r),height:eV(e),objectFit:iV(e),objectPosition:nV(e,t),...n&&"alwaysFit"===e?{"max-width":"100%"}:{}}),sV=({representation:e,textStyle:t,isMeasureCell:n})=>{const{imageRef:r,onLoad:i}=(()=>{const{downloadService:e}=ZF(),t=a(null),{promise:n,resolve:r}=f((()=>iz()),[]);return c((()=>(e.isDownloadedAsPDForImage&&(e.waitForPromise(n),t.current?.complete&&r()),()=>{r()})),[t,e,n,r]),{onLoad:h((()=>{r()}),[r]),imageRef:t}})(),{layoutService:{isIndentModeEnabled:o}}=ZF(),{url:s,text:l,imageSize:u,resolvedImagePosition:d}=e,{overflow:p,...m}=t;return Ji.jsx("img",{src:s,alt:l,style:{...aV({imageSize:u,resolvedImagePosition:d,isImagesInIndentModeEnabled:o,isMeasureCell:n}),...m},onLoad:i,ref:r})},lV=({representation:e,textStyle:t,canExpandOrCollapse:n,leafCount:r,isLeftColumn:i=!1,imageContainerHorizontalAlignment:o,isMeasureCell:a})=>{const{styleService:s,layoutService:l}=ZF(),{resolvedImagePosition:c}=e;return Ji.jsx("div",{"data-key":"image-container--image",style:{display:"flex",flexDirection:"column",justifyContent:c?.vertical,alignItems:o,overflow:"hidden",boxSizing:"border-box",border:"4px solid transparent",...rV({representation:e,canExpandOrCollapse:n,leafCount:r,styleService:s,layoutService:l,isLeftColumn:i,isMeasureCell:a})},children:Ji.jsx(sV,{representation:e,textStyle:t,isMeasureCell:!0})})},cV=(e,t,n)=>{if(e?.auto)return t;switch(e?.align){case"center":return"center";case"left":return"rtl"===n?"flex-end":"flex-start";case"right":return"rtl"===n?"flex-start":"flex-end";default:return t}},uV=(e,t)=>{let{textAlign:n}=t.getDimensionInfo(e.dimensionInfoIndex)??{};return e.isPseudoDimension&&void 0!==e.visibleMeasureInfoIndex&&({labelTextAlign:n}=t.visibleMeasureInfo.at(e.visibleMeasureInfoIndex)??{}),n?.auto||void 0===n?"left":n.align},dV={display:"flex",flexDirection:"row",alignItems:"center"},hV={alignItems:"center",display:"flex",flexDirection:"row",backgroundClip:"padding-box"},pV=(e,t,n,r)=>t?{...hV,...e.nullValues}:n?{...dV,color:e.totalValues.color,background:r??e.totalValues.background}:{...dV,color:e.measureValues.color,background:r??e.measureValues.background},fV=(e,t,n,r,i)=>{const{fontFamily:o,fontSize:a}=e.measureValues,s={...Hj,...!n&&Vj(e.grid.lineClamp),...t&&{color:t},fontFamily:o,fontSize:a};if(i){const{fontWeight:t,fontStyle:n,textDecoration:r}=e.nullValues;return{...s,fontWeight:t,fontStyle:n,textDecoration:r}}if(r){const{fontWeight:t,fontStyle:n,textDecoration:r}=e.totalValues;return{...s,fontWeight:t,fontStyle:n,textDecoration:r}}const{fontWeight:l,fontStyle:c,textDecoration:u}=e.measureValues;return{...s,fontWeight:void 0===l?qj:l,fontStyle:c,textDecoration:u}},mV=({cell:e,representation:t,color:n,isTotalValueCell:r,cellHorizontalAlignment:i})=>{const{layoutService:o,styleService:a}=ZF(),{isIndentModeEnabled:s}=o,l=e.isNull?o.getNullValueText():t.text,c=t.type===QN.Image,u=t.type===QN.Indicator,d=rH(iH(l)),h=fV(a,n,d,r,e.isNull);if(!s&&c&&!e.isNull||s&&c&&!e.isNull)return Ji.jsx(lV,{isMeasureCell:!0,textStyle:h,representation:t,imageContainerHorizontalAlignment:i});const p=iH(e.isNull?t.text:e.ref.qNum);return u&&rH(p)?Ji.jsx(AH,{representation:t,cellValue:p,textStyle:h}):Ji.jsx("span",{style:{padding:4,direction:d?"ltr":void 0,...h},children:l})},gV=(e,t)=>e?.[t]?.visibleMeasureInfoIndex??0,yV="flex-start",vV=(e,t)=>e.isNull?yV:t.type===QN.Image&&"fill"!==t.imageSize?t.resolvedImagePosition?.vertical:yV,bV=({columnIndex:e,rowIndex:t,style:n,data:r})=>{const{env:i}=KF(),{pageInfo:o,direction:a}=GF(),{styleService:s,layoutService:l}=ZF(),{attrExprInfoIndexes:c,gridSectionsData:{measureData:u,leftDimensionData:d,topDimensionData:p},visibleDimensionsInfo:{visibleLeftDimensionInfo:f,visibleTopDimensionInfo:m}}=w$(),g=(()=>{const{layoutService:{isIndentModeEnabled:e}}=ZF(),{gridSectionsData:{leftDimensionData:t,topDimensionData:n},visibleDimensionsInfo:{visibleLeftDimensionInfo:r,visibleTopDimensionInfo:i}}=w$(),o=r.length,a=i.length;return h(((r,i)=>!(!n.grid.at(a-1)?.[r]?.isTotal&&!t.grid.at(e?0:o-1)?.[i]?.isTotal)),[n,t,o,a,e])})(),y=(()=>{const{gridSectionsData:{topDimensionData:e},visibleDimensionsInfo:{visibleTopDimensionInfo:t}}=w$(),n=t.length;return h((t=>{const r=e.grid.at(n-1)?.[t];return QB(r,e.totalDividerIndex)}),[e,n])})(),v=(()=>{const{layoutService:{isIndentModeEnabled:e}}=ZF(),{gridSectionsData:{leftDimensionData:t},visibleDimensionsInfo:{visibleLeftDimensionInfo:n}}=w$(),r=n.length;return h((n=>{const i=e?0:r-1,o=t.grid.at(i)?.[n];return QB(o,t.totalDividerIndex,e)}),[t,e,r])})(),{showLastBorder:b}=r,x=p.grid.at(m.length-1),w=d.grid.at(f.length-1),{background:S}=s.measureValues,C=u[t]?.[e],M=t===o.rowsOnCurrentPage-1,k=e===l.size.x-1;if(!C)return Ji.jsx(eH,{style:{...n,background:S},isLastRow:M,isLastColumn:k,showLastBorder:b,index:t,isLeftColumn:!1,showTotalCellDivider:!1});const E=l.hasPseudoDimOnLeft?gV(w,t):gV(x,e),_=l.visibleMeasureInfo[E],R=QW({cell:C.ref,representationProperties:_.representation,attrExprInfoIndex:c.measures[E],env:i,direction:a,conditionalColoring:_.conditionalColoring,enabledFeatures:{[QN.Image]:!0,[QN.Indicator]:!0}}),I=!C.isNull&&g(e,t),D=C.isNull?l.getNullValueText():R.text,A=!C.isNull||!Number.isNaN(+D),P=e$(c.measures[E],C.ref),O=((e,t,n,r,i)=>{const{textAlign:o}=t,a=r?"flex-end":"center";return e.isNull||n.type!==QN.Image?cV(o,a,i):n.resolvedImagePosition?.horizontal??"center"})(C,_,R,A,a),T={...pV(s,C.isNull,I,P.background),...Uj(M,k,s.grid.border,a,b),...Kj({bottomDivider:v(t),rightDivider:y(e),borderColor:s.grid.divider}),...Bj,padding:"0px 4px",display:"flex",justifyContent:O};return Ji.jsx("div",{className:CT,title:D,style:{...T,...n},"data-testid":"measure-value","data-row-index":t,"data-col-index":e,children:Ji.jsx(tH,{width:nH(R),verticalAlign:vV(C,R),children:Ji.jsx(mV,{cell:C,representation:R,isTotalValueCell:I,color:P.color,cellHorizontalAlignment:O})})})};var xV=t.memo(bV,jB);const wV=(e,t)=>t.list[e]?.id??e.toString(),SV=({columnIndex:e,rowIndex:t,data:n})=>n.grid[t]?.[e]?.id??`${t}-${e}`,CV=e=>({...$j,overflow:"hidden",boxSizing:"content-box",borderWidth:"rtl"===e?"1px 1px 0px 0px":"1px 0px 0px 1px"}),MV=({dataGridRef:e,height:t,rowHightCallback:n,width:r,showLastBorder:i,getRightGridColumnWidth:o,verticalScrollDirection:a,horizontalScrollDirection:s})=>{const{pageInfo:l,direction:c}=GF(),{layoutService:u,styleService:{grid:{divider:d},contentCellHeight:f}}=ZF(),{dataModel:m,gridSectionsData:{measureData:g}}=w$(),y={...CV(c),borderColor:d,willChange:"auto",userSelect:"none",WebkitUserSelect:"none"},v=(({verticalScrollDirection:e,horizontalScrollDirection:t})=>{const{pageInfo:n}=GF(),{downloadService:r,viewService:i,layoutService:o}=ZF(),{dataModel:a,gridSectionsData:{leftDimensionData:s,topDimensionData:l,measureData:c}}=w$(),u=s.columnCount,d=l.rowCount;return h((async({overscanColumnStartIndex:s,overscanColumnStopIndex:l,overscanRowStartIndex:h,overscanRowStopIndex:p})=>{i.gridColumnStartIndex=s,i.gridRowStartIndex=h,i.gridWidth=l-s+1,i.gridHeight=p-h+1;const f=i.gridWidth+u+(t.current===cj.None?0:zB),m=i.gridHeight+d+(e.current===cj.None?0:zB);let g=JB;m*f>1500&&(g=ZB),g(a,o,c,n,i,e,t,r)}),[i,o,a,c,e,t,n,u,d,r])})({verticalScrollDirection:a,horizontalScrollDirection:s});return xz((()=>{e.current&&e.current.resetAfterColumnIndex(0,!1)}),[e,m,g]),p((()=>{e.current&&e.current.resetAfterIndices({columnIndex:0,rowIndex:0,shouldForceUpdate:!0})}),[r,t,e,f,c]),0===u.size.x?null:Ji.jsx(EB,{"data-section-id":"DATA_GRID",ref:e,style:y,columnCount:u.size.x,columnWidth:o,height:t,rowCount:l.rowsOnCurrentPage,rowHeight:n,width:r,itemData:{showLastBorder:i,grid:g},onItemsRendered:v,estimatedRowHeight:n(),estimatedColumnWidth:o(),itemKey:SV,direction:c,children:xV})};var kV=g(MV);const EV=v(((e,t)=>Ji.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:[Ji.jsx("path",{d:"M13 7H8zV4.982C13 2.23 10.761 0 8 0S3 2.23 3 4.982V7h.75H3h1.5V5.332C4.5 3.216 5.549 1.5 8 1.5s3.5 1.716 3.5 3.832V7h.75H3a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1H3z"}),Ji.jsx("use",{fillRule:"evenodd"})]}))),_V=e=>{const[t,n]=m(!1);return xz((()=>{n(!1)}),e),{isAdjustingWidth:t,setIsAdjustingWidth:n}},RV=()=>{const[e,t]=m(!1),{dataModel:n}=w$(),{interactions:r}=KF(),{isAdjustingWidth:i,setIsAdjustingWidth:o}=_V([n]);return{open:e,setOpen:t,handleOpenMenu:e=>{!r.active||PH(e)||i||t(!0)},setIsAdjustingWidth:o}};function IV(e,t){const n=t.expressionColor?.background??e.dimensionValues.background,r=t.isLeftColumn?e.header.background:n,i=r===zj.Transparent?xj.WHITE:r,o=gq(e.grid.border),a=gq(i);return a.isInvalid()||o.isInvalid()||1===o.a?e.grid.border:function(e,t,n){return gq(e.r+(t.r-e.r)*n,e.g+(t.g-e.g)*n,e.b+(t.b-e.b)*n,e.a+(t.a-e.a)*n)}(a,o,o.a).getRGB()}const DV=({cellInfo:e,columnWidth:t,isLastColumn:n,overrideLeftGridWidth:r,setIsAdjustingWidth:i,shouldApplyIndentModeColumnWidth:o,tableWidth:a})=>{const{direction:s}=GF(),{interactions:l,translator:c}=KF(),{isActive:u}=jH(),{dataModel:d}=w$(),{styleService:h}=ZF(),[,p]=m({});if(!(e.canBeResized&&!!l.active&&!u))return null;const f=IV(h,e);return Ji.jsx(Ez,{isPivot:!0,columnWidth:t,isLastColumn:n,keyValue:`adjuster-${e.dimensionInfoIndex}`,hoverColor:f,updateWidthCallback:t=>{p({}),r&&void 0!==e.colIdx&&r(t,e.colIdx)},confirmWidthCallback:t=>{o?d.applyIndentModeColumnWidth({...t,pixels:Math.min((a??0)*k$,t.pixels??0)}):d.applyColumnWidth(t,e)},setIsAdjustingWidth:i,isLeftColumn:e.isLeftColumn,accessibilityRelatedArgs:{translator:c,columnLabel:e.label??""},direction:s})},AV=ll(Yc,{shouldForwardProp:e=>!["interactions","hoverBackground","background","shouldShowMenuIcon","isDimension"].includes(e)})((({interactions:e,background:t,hoverBackground:n,shouldShowMenuIcon:r,isDimension:i})=>({pointerEvents:i?"all":"none",position:"relative",display:"grid",gridTemplateColumns:r?"1fr 12px":"1fr",gap:8,alignItems:"center",cursor:e.active?"pointer":"default",background:t,"&&:hover":{background:e.active&&i?n:t}}))),PV=ll("div",{shouldForwardProp:e=>!["direction"].includes(e)})((({direction:e})=>({position:"absolute",left:"rtl"!==e?0:void 0,bottom:0}))),OV=ll("div",{shouldForwardProp:e=>"justifyContent"!==e})((({justifyContent:e})=>({...Wj,justifyContent:e??Wj.justifyContent,flexDirection:"row",overflow:"hidden",position:"relative",gap:8}))),TV=ll("div")((()=>({...Wj}))),LV=ll("div",{shouldForwardProp:e=>!["fontSize","fontFamily","fontWeight","fontStyle","textDecoration","justifyContent"].includes(e)})((({fontSize:e,fontFamily:t,fontWeight:n,fontStyle:r,textDecoration:i,justifyContent:o})=>({display:"flex",justifyContent:o,alignSelf:"center",flexGrow:1,maxWidth:"100%",fontWeight:n,fontSize:e,fontFamily:t,fontStyle:r,textDecoration:i}))),qV=ll(ch)((({theme:e})=>({".MuiList-root":{padding:e.spacing(.5,0)}}))),NV=ll(fh,{shouldForwardProp:e=>!["isActive"].includes(e)})((({theme:e,isActive:t})=>({width:220,maxHeight:32,borderRadius:e.spacing(.5),margin:e.spacing(.25,.5),padding:e.spacing(1,1.5),display:"flex",justifyContent:"space-between",position:"relative",overflow:"hidden ",boxSizing:"border-box",background:t?"rgba(0, 0, 0, 0.05)":"transparent","&:hover":{".indent-mode-dropdown-more":{opacity:1}}}))),jV=ll("span")({textOverflow:"ellipsis",overflow:"hidden"}),zV=ll("div",{shouldForwardProp:e=>"visible"!==e})((({visible:e})=>({opacity:e?1:0,width:C$,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"}))),FV=ll("span",{shouldForwardProp:e=>!["padding","alignSelf"].includes(e)})((({padding:e,alignSelf:t})=>({padding:e,alignSelf:t,position:"sticky",top:0})));let WV=function(e){return e.Expand="Expand",e.Collapse="Collapse",e}({});const $V=(e,t)=>({qExcludeList:t===WV.Expand,qPos:{qDimName:e,qElemNo:[]}}),BV=`${tW}/qExpansionState`,HV=({model:e,qExpansionState:t,qEffectiveDimensionName:n,action:r})=>async()=>{const i=(({qEffectiveDimensionName:e,oldExpansionState:t,action:n})=>{const r=t?.findIndex((t=>t.qPos?.qDimName===e));return{expansionData:$V(e,n),index:r}})({qEffectiveDimensionName:n,oldExpansionState:t,action:r});await(async({model:e,newExpansionState:t,errorMsg:n})=>{const{index:r,expansionData:i}=t;try{let t,n=BV,o="Add";void 0===r?t=JSON.stringify([i]):-1===r?(n=`${BV}/-`,t=JSON.stringify(i)):(n=`${BV}/${r}`,o="Replace",t=JSON.stringify(i)),await e.applyPatches([{qPath:n,qOp:o,qValue:t}],!0)}catch(e){console.error(n,e)}})({model:e,newExpansionState:i,errorMsg:`Failed to ${r} dimension`})},VV=({model:e,effectivePropertiesService:t,cell:n})=>{if(void 0===n.qEffectiveDimensionName)return;const r={model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n.qEffectiveDimensionName};return{expandCallback:HV({...r,action:WV.Expand}),collapseCallback:HV({...r,action:WV.Collapse}),alwaysFullyExpanded:t.qAlwaysFullyExpanded}},GV={[dF.Sorting]:!0,[dF.Selections]:!0,[dF.Searching]:!0},UV=({cell:e,style:t,isFirstColumn:n,isLastColumn:r,isLastRow:i,changeSortOrder:o,iconsVisibilityStatus:s,columnWidth:l,overrideLeftGridWidth:c,shouldApplyIndentModeColumnWidth:u,tableWidth:d})=>{const h=a(null),{styleService:p,layoutService:f,effectivePropertiesService:m}=ZF(),{app:g,interactions:y,embed:v,translator:b,model:x}=KF(),{fontSize:w,fontFamily:S,fontStyle:C,fontWeight:M,textDecoration:k,color:E,background:_,hoverBackground:R,activeBackground:I}=p.header,D=a(null),{shouldShowLockIcon:A,shouldShowMenuIcon:P}=s,{open:O,setOpen:T,handleOpenMenu:L,setIsAdjustingWidth:q}=RV(),{direction:N}=GF(),j={sortFromMenu:async(t,n)=>{t.stopPropagation(),await o(e,n)}},z={embed:v,listboxRef:h,sortCriteria:f.searchSortFromDimension&&e.isDim?m.getSortCriteriaForDimension(e.dimensionInfoIndex):void 0},F={app:g,qStateName:f.layout.qStateName},{labelTextAlign:W}=f.getDimensionInfo(e.dimensionInfoIndex)??{},$=cV(W,"flex-start",N);return Ji.jsxs(AV,{className:CT,title:e.label,interactions:y,background:O?I:_,hoverBackground:R,shouldShowMenuIcon:P,isDimension:e.isDim,style:{...t,...Bj,...Yj(e,i,n,r,p.grid.border,N),color:E},"data-testid":"title-cell",onClick:L,children:[Ji.jsxs(OV,{children:[A?Ji.jsx(TV,{children:Ji.jsx(EV,{height:12})}):null,Ji.jsx(LV,{fontFamily:S,fontSize:w,fontStyle:C,fontWeight:M,textDecoration:k,justifyContent:$,children:Ji.jsx("span",{style:Hj,children:e.label})})]}),e.isDim?Ji.jsxs(Ji.Fragment,{children:[Ji.jsx(fF,{headerData:e,translator:b,anchorRef:D,open:O,setOpen:T,interactions:y,menuAvailabilityFlags:GV,sortRelatedArgs:j,searchRelatedArgs:z,selectionRelatedArgs:F,expandOrCollapseArgs:VV({model:x,effectivePropertiesService:m,cell:e}),shouldShowMenuIcon:P,model:x&&"setActiveField"in x?x:void 0,direction:N,isAccessibleHeader:!0}),Ji.jsx(PV,{ref:h,direction:N}),Ji.jsx(PV,{ref:D,direction:N})]}):null,Ji.jsx(DV,{cellInfo:{...e,isLeftColumn:!0},columnWidth:l,isLastColumn:r,overrideLeftGridWidth:c,setIsAdjustingWidth:q,shouldApplyIndentModeColumnWidth:u,tableWidth:d})]})},YV=({rowSpan:e,columnSpan:t})=>{const{styleService:n}=ZF(),{direction:r}=GF();return e>0&&t>0?Ji.jsx("div",{style:{...$j,gridRowStart:1,gridRowEnd:`span ${e}`,gridColumnStart:1,gridColumnEnd:`span ${t}`,borderWidth:"rtl"===r?"0px 0px 0px 1px":"0px 1px 0px 0px",borderColor:n.grid.border,background:n.grid.background},"data-testid":"empty-header-cell"}):null},KV=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"m8 9 4.5-4.5L14 6l-4.5 4.5L8 12 2 6l1.5-1.5z"})}))),XV=v(((e,t)=>Ji.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:[Ji.jsx("path",{d:"m8 7-4.5 4.5L2 10l6-6 6 6-1.5 1.5z"}),Ji.jsx("use",{fillRule:"evenodd"})]}))),JV=({tableWidth:e,leftGridWidth:t,overrideLeftGridWidth:n})=>{const{direction:r}=GF(),{styleService:i}=ZF(),{interactions:o,translator:a}=KF(),{isActive:s}=jH(),{dataModel:l}=w$(),{setIsAdjustingWidth:c}=_V([l]);if(!(!!o.active&&!s))return null;const u=IV(i,{isLeftColumn:!0});return Ji.jsx(Ez,{isPivot:!0,isLastColumn:!0,isLeftColumn:!0,keyValue:"adjuster-indent-row",hoverColor:u,columnWidth:t,updateWidthCallback:t=>{n(Math.min(t,e*k$))},confirmWidthCallback:r=>{if(r.type===RT.FitToContent)return void l.applyIndentModeColumnWidth({type:RT.Auto});const i=Math.min(r.pixels??t,e*k$);n(i),l.applyIndentModeColumnWidth({type:RT.Pixels,pixels:i})},setIsAdjustingWidth:c,accessibilityRelatedArgs:{translator:a,columnLabel:a.get("SNPivotTable.IndentMode.Rows")},direction:r})},ZV=v(((e,t)=>Ji.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",height:"16px",fill:"currentColor","aria-hidden":"true",role:"img",ref:t,...e,children:Ji.jsx("path",{d:"M3 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0m6 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m5 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2"})}))),QV=({cell:e,changeSortOrder:t})=>{const n=a(null),r=a(null),{app:i,interactions:o,embed:s,translator:l,model:c}=KF(),{layoutService:u,effectivePropertiesService:d}=ZF(),{open:h,setOpen:p,handleOpenMenu:f}=RV();return Ji.jsxs(NV,{onClick:f,isActive:h,children:[Ji.jsx(jV,{children:e.label}),Ji.jsxs(zV,{className:"indent-mode-dropdown-more",visible:h,children:[Ji.jsx(ZV,{}),e.isDim?Ji.jsxs(Ji.Fragment,{children:[Ji.jsx(fF,{headerData:e,translator:l,anchorRef:n,open:h,setOpen:p,interactions:o,menuAvailabilityFlags:GV,sortRelatedArgs:{sortFromMenu:async(n,r)=>{n.stopPropagation(),await t(e,r)}},searchRelatedArgs:{embed:s,listboxRef:r},selectionRelatedArgs:{app:i,qStateName:u.layout.qStateName},expandOrCollapseArgs:VV({model:c,effectivePropertiesService:d,cell:e}),shouldShowMenuIcon:!1,model:c&&"setActiveField"in c?c:void 0}),Ji.jsx(PV,{ref:r}),Ji.jsx(PV,{ref:n})]}):null]})]})},eG=({idx:e,menu:t,menuItems:n,isOnlyOneRow:r})=>{const i=n.at(-1)?.id===rW,o=e+1<n.length&&n[e+1]?.id===rW;return!(r&&i&&o)&&(t?.id!==rW&&e<n.length-1)},tG=({menuItems:e,changeSortOrder:t,overrideLeftGridWidth:n,leftGridWidth:r,tableWidth:i})=>{const{styleService:o}=ZF(),{interactions:s,translator:l}=KF(),{dataModel:c,gridSectionsData:{headersData:u}}=w$(),[d,h]=m(!1),p=a(null),{headerCellHeight:f}=o,{color:g,background:y,hoverBackground:v,activeBackground:b,fontFamily:x,fontSize:w,fontStyle:S,fontWeight:C,textDecoration:M}=o.header,{isAdjustingWidth:k}=_V([c]),E=e=>{e.stopPropagation()},_={height:f,gridColumn:`1 / span ${u.size.x}`,gridRow:u.size.y,zIndex:u.size.x-0};return Ji.jsxs(AV,{isDimension:!0,background:d?b:y,interactions:s,hoverBackground:v,style:{..._,...Bj,color:g},onClick:e=>{!s.active||PH(e)||k||h(!d)},"data-testid":"indentModeHeaderCellWrapper",children:[Ji.jsxs(OV,{justifyContent:"flex-start",children:[Ji.jsx(LV,{fontFamily:x,fontSize:w,fontStyle:S,fontWeight:C,textDecoration:M,justifyContent:"flex-start",children:Ji.jsx("span",{style:Hj,children:l.get("SNPivotTable.IndentMode.Rows")})}),d?Ji.jsx(XV,{}):Ji.jsx(KV,{}),Ji.jsx(PV,{ref:p})]}),Ji.jsx(qV,{open:d,anchorEl:p.current,disableEnforceFocus:!0,children:e.map(((n,r)=>[n&&n.id!==rW&&Ji.jsx("li",{role:"presentation",onClick:E,onKeyDown:E,children:Ji.jsx(QV,{cell:n,changeSortOrder:t})}),eG({idx:r,menu:n,menuItems:e,isOnlyOneRow:1===u.size.y})&&Ji.jsx(Az,{"data-testid":"group-divider",variant:"middle"})]))}),Ji.jsx(JV,{tableWidth:i,leftGridWidth:r,overrideLeftGridWidth:n})]})},nG=({layoutService:e,headersData:t,topRowIndex:n})=>e.isIndentModeEnabled&&t.size.x>1&&n+1===t.size.y,rG={display:"grid",width:"fit-content"},iG=({tableWidth:e,leftGridWidth:t,columnWidths:n,rowHight:r,changeSortOrder:i,getHeaderCellsIconsVisibilityStatus:o,height:a,overrideLeftGridWidth:s})=>{const{layoutService:l}=ZF(),{gridSectionsData:{headersData:c}}=w$();return Ji.jsxs("div",{"data-testid":"HEADER_GRID",style:{...rG,gridTemplateColumns:n.map((e=>`${e}px`)).join(" "),gridTemplateRows:c.data.map((()=>`${r}px`)).join(" "),height:a},children:[c.size.y>1&&Ji.jsx(YV,{columnSpan:c.size.x-1,rowSpan:c.size.y-1}),c.data.map(((a,u)=>{let d=[];if(nG({layoutService:l,headersData:c,topRowIndex:u})){const n=a.at(0);return Array.isArray(n)&&d.push(Ji.jsx(tG,{menuItems:n,changeSortOrder:i,overrideLeftGridWidth:s,leftGridWidth:t,tableWidth:e},n.at(0)?.id)),d}return d=a.reduce(((t,a,d)=>{if(a&&!Array.isArray(a)){const h=o(d,a.isLocked,a.label),p=l.isIndentModeEnabled&&1===c.size.x;t.push(Ji.jsx(UV,{style:{width:n[d],height:r,gridColumn:l.isIndentModeEnabled&&c.size.x>1?2:d+1,gridRow:u+1,zIndex:c.size.x-d},isLastRow:u===c.size.y-1,isFirstColumn:0===d,isLastColumn:d===c.size.x-1,changeSortOrder:i,cell:a,iconsVisibilityStatus:h,columnWidth:n[d],overrideLeftGridWidth:s,shouldApplyIndentModeColumnWidth:p,tableWidth:e},a.id))}return t}),[]),d}))]})};var oG=g(iG);const aG=(e,t,n,r)=>{const{layoutService:i}=ZF();p((()=>{e.current?.forEach((e=>e?.resetAfterIndex(0,!0)))}),[e,t,n,r,i])},sG=(e,t)=>{xz((()=>{e.current?.forEach((e=>e?.resetAfterIndex(0,!1)))}),[e,t])},lG=(e,t)=>{const{isLast:n,list:r,listValues:i}=t;return n?r[e]:i[e]},cG=(e,t,n,r,i)=>{if(i)return;const o=e.representation,a=_$({isLeftColumn:n,layoutService:t,representation:o}),s=n?"flex-start":"center",l=e.representation.resolvedImagePosition?.horizontal;if(e.representation.type===QN.Image)return a&&l&&"center"!==l&&"rtl"===r?IH(l):l??s;if(e.isPseudoDimension&&void 0!==e.visibleMeasureInfoIndex){const{labelTextAlign:n}=t.visibleMeasureInfo[e.visibleMeasureInfoIndex]??{};return cV(n,s,r)}const{textAlign:c}=t.getDimensionInfo(e.dimensionInfoIndex)??{};return cV(c,s,r)},uG=()=>{},dG=({children:e,reactWindowStyle:t,cell:n,data:r,showTotalCellDivider:i,isLastRow:o,isLastColumn:a,isLeftColumn:s,isCellSelected:l,isAdjustingWidth:c,index:u})=>{const{styleService:d,layoutService:h}=ZF(),{interactions:p}=KF(),{direction:f}=GF(),{isLocked:m,createMouseDownHandler:g,createMouseOverHandler:y,createPointerUpHandler:v}=jH(),{showLastBorder:b}=r,x=m(n)||n.isLockedByDimension,w=!(x||!p.active||!p.select||n.isEmpty||n.isNull||n.isPseudoDimension||n.isTotal||c),S=w?g(u,(e=>lG(e,r))):void 0,C=w?y(u):void 0,M=w?v(u,(e=>lG(e,r))):void 0,k=_$({isLeftColumn:s,layoutService:h,representation:n.representation});return Ji.jsx("div",{className:CT,title:p.passive?n.representation.text:void 0,style:{...t,...Uj(o,a,d.grid.border,f,b),...Kj({bottomDivider:i&&s,rightDivider:i&&!s,borderColor:d.grid.divider}),...Bj,padding:"rtl"===f?"0px 0px 0px 4px":"0px 4px",cursor:XH(w),background:VH({styleService:d,isCellSelected:l,cell:n,isCellLocked:x}),zIndex:s?void 0:h.size.x-n.x,justifyContent:cG(n,h,s,f,k),display:"flex",...h.isIndentModeEnabled&&s&&{["rtl"===f?"paddingRight":"paddingLeft"]:Math.max(4,24*(n.indentLevel??0))},textAlign:uV(n,h)},"aria-hidden":"true",onMouseDown:S,onMouseOver:C,onPointerUp:M,onKeyUp:uG,role:"button",tabIndex:-1,"data-testid":"dimension-cell","data-x":n.x,"data-page-x":n.pageX,"data-y":n.y,"data-page-y":n.pageY,"data-cell-type":n.ref.qType,"data-dimension-info-index":n.dimensionInfoIndex,children:e})},hG=e=>{e.stopPropagation()},pG=({href:e,text:t,interactions:n,color:r})=>({href:e,title:t,rel:"noreferrer",target:"_blank",underline:"hover",onClick:hG,color:xj.LINK,style:{pointerEvents:n.active?"auto":"none",color:r??void 0,opacity:n.active&&n.passive||r?void 0:.4}}),fG=({href:e,text:t,interactions:n,color:r})=>Ji.jsx(fd,{...pG({href:e,text:t,interactions:n,color:r}),children:t});function mG(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gG(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 yG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gG(Object(n),!0).forEach((function(t){mG(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gG(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var vG=Object.prototype.hasOwnProperty,bG=Object.prototype.toString,xG=Object.defineProperty,wG=Object.getOwnPropertyDescriptor,SG=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===bG.call(e)},CG=function(e){if(!e||"[object Object]"!==bG.call(e))return!1;var t,n=vG.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&vG.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||vG.call(e,t)},MG=function(e,t){xG&&"__proto__"===t.name?xG(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},kG=function(e,t){if("__proto__"===t){if(!vG.call(e,t))return;if(wG)return wG(e,t).value}return e[t]},EG=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=kG(s,n),s!==(i=kG(t,n))&&(u&&i&&(CG(i)||(o=SG(i)))?(o?(o=!1,a=r&&SG(r)?r:[]):a=r&&CG(r)?r:{},MG(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&MG(s,{name:n,newValue:i}));return s};function _G(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=i.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),s=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(r)&&r.some(((e,t)=>e!==t))){const e=r.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:l>=0?e=>e[a].qAttrDims.qValues[l]:s>=0?e=>e[a].qAttrExps.qValues[s]:e=>e[a]}function RG(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function IG(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:a,row:s,sourceKey:l,target:c,targetProp:u,columnOrder:d}=e,h=r;if(i.field&&i.field!==n){const e=_G(i.field,o,{cache:t},d);if(-1===e)return;h=EG({qRow:a},e(s))}c[u]=RG(i,h,{key:l})}function DG(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const a=t.raw(),s=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:c,main:u}=r.normalizeConfig(i[e],t),d=Object.keys(c),h=!!i[e].trackBy,p=typeof i[e].trackBy,f={},m=[],g=[];for(let t=0;t<a.qDataPages.length;t++){const o=_G(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let y=0;y<a.qDataPages[t].qMatrix.length;y++){const v=a.qDataPages[t].qArea.qTop+y,b=EG({qRow:v},o(a.qDataPages[t].qMatrix[y])),x=RG(u,b,{key:s});if(!(u.filter&&!u.filter(b))){for(let e=0;e<d.length;e++){const r=c[d[e]];let i=r.fields||[r];r.fields&&(x[d[e]]=[]);for(let o=0;o<i.length;o++)IG({cache:n,f:l,mainCell:b,p:i[o],prop:d[e],page:a.qDataPages[t],rowIdx:v,row:a.qDataPages[t].qMatrix[y],sourceKey:s,target:r.fields?x[d[e]]:x,targetProp:r.fields?o:d[e],columnOrder:a.qColumnOrder});if(r.fields){const t=x[d[e]].map((e=>e.value)),n=x[d[e]].map((e=>e.label));x[d[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[d[e]].value)}}}h&&r.track({cfg:i[e],itemData:b,obj:x,target:m,tracker:f,trackType:p}),g.push(x)}}}const y=h?r.collect(m,{main:u,propsArr:d,props:c}):g;o=[...o,...y]}return o}function AG(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 PG(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=TG)):void 0===t&&(t=OG);for(var n,r,i,o,a,s=new NG(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new NG(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(qG)}function OG(e){return e.children}function TG(e){return Array.isArray(e)?e[1]:null}function LG(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function qG(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function NG(e){this.data=e,this.depth=this.height=0,this.parent=null}function jG(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}NG.prototype=PG.prototype={constructor:NG,count:function(){return this.eachAfter(AG)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;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(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return PG(this).eachBefore(LG)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}};var zG={depth:-1},FG={},WG={};function $G(e){return e.id}function BG(e){return e.parentId}function HG(){var e,t=$G,n=BG;function r(r){var i,o,a,s,l,c,u,d,h=Array.from(r),p=t,f=n,m=new Map;if(null!=e){const t=h.map(((t,n)=>function(e){e=`${e}`;let t=e.length;GG(e,t-1)&&!GG(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,r)))),n=t.map(VG),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(VG(e)),h.push(WG));p=(e,n)=>t[n],f=(e,t)=>n[t]}for(a=0,i=h.length;a<i;++a)o=h[a],c=h[a]=new NG(o),null!=(u=p(o,a,r))&&(u+="")&&(d=c.id=u,m.set(d,m.has(d)?FG:c)),null!=(u=f(o,a,r))&&(u+="")&&(c.parent=u);for(a=0;a<i;++a)if(u=(c=h[a]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===FG)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(s)throw new Error("multiple roots");s=c}if(!s)throw new Error("no root");if(null!=e){for(;s.data===WG&&1===s.children.length;)s=s.children[0],--i;for(let e=h.length-1;e>=0&&(c=h[e]).data===WG;--e)c.data=null}if(s.parent=zG,s.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(qG),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=jG(e),r):t},r.parentId=function(e){return arguments.length?(n=jG(e),r):n},r.path=function(t){return arguments.length?(e=jG(t),r):e},r}function VG(e){let t=e.length;if(t<2)return"";for(;--t>1&&!GG(e,t););return e.slice(0,t)}function GG(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function UG(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=UG(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=UG(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function YG(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...YG(e[i].children,t-1,n)]);return r}function KG(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const r=Math.max(0,Math.min(100,t-e));return e=>YG(e.children,r-1,n)}return!1}const XG=/^qDimensionInfo(?:\/(\d+))?/,JG=/^\/?qMeasureInfo\/(\d+)/,ZG=/\/qAttrExprInfo\/(\d+)/,QG=/\/qAttrDimInfo\/(\d+)/;function eU(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function tU(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,d=r;const h=n.qEffectiveInterColumnSortOrder,p=eU(n);return XG.test(d)&&(i=!0,o=+XG.exec(d)[1],d=r.replace(XG,"")),JG.test(d)&&("K"===n.qMode?c=+JG.exec(d)[1]:h&&-1!==h.indexOf(-1)?(c=+JG.exec(d)[1],u=0):u=+JG.exec(d)[1],d=d.replace(JG,"")),d&&(QG.exec(d)?s=+QG.exec(d)[1]:ZG.exec(d)&&(a=+ZG.exec(d)[1])),l=i?"S"===n.qMode?p[o]:h?h.indexOf(o):o:h&&-1!==h.indexOf(-1)?h.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:s,attrIdx:a}}function nU(e,t){let n,r,i=KG(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function rU(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function iU(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let c,u;s.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const d=l[n];let h,p,f,m,g,y;if("primitive"===d.type?(f=d.value,y=String(d.value)):("function"==typeof d.value&&(h=e=>d.value(e,r)),"function"==typeof d.label&&(p=e=>d.label(e,r)),d.accessor?(m=d.accessor(r),Array.isArray(m)?(g=m.map(d.valueAccessor),d.attrAccessor&&(g=g.map(d.attrAccessor)),h&&(f=g.map(h),h=null),p&&(y=g.map(p),p=null),f=d.reduce?d.reduce(f):f,y=d.reduceLabel?d.reduceLabel(y,f):String(f)):(f=d.attrAccessor?d.attrAccessor(d.valueAccessor(m)):d.valueAccessor(m),y=f)):(f=i,y=i)),s.fields){const e=h?h(f):f;c.push(e),u.push(p&&null!=y?p(y):null!=y?y:String(e))}else{const n=h?h(f):f;o[t[e]]={value:n,label:p?p(y):null!=y?y:String(n)},d.field&&(o[t[e]].source={field:d.field.key(),key:a})}}c&&(o[t[e]]={value:"function"==typeof s.value?s.value(c,r):c,label:"function"==typeof s.label?s.label(u,r):u})}}const oU=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=UG(r,e);return o&&o[0]?(t.tree=PG(o[0],n.children||(e=>e[i])),t.tree):null};const aU=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],s=i.fields?i.fields:[i];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==a){const e=nU(o,tU(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function sU(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const i=t.raw(),o=t.key(),a="S"===i.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}(e),r=e.fields(),i=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),o=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(r.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let r="__root",l=!1;for(let e=0;e<i.length;e++){var s;const t=n[i[e]],o="".concat(r,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=yG({__id:o,__parent:r,qValues:[]},t),l=!0),r=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[r].qValues.push(t)}}const l=Object.keys(a).map((e=>a[e])),c=HG().id((e=>e.__id)).parentId((e=>e.__parent))(l);return c}(t):oU(i,n,e);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===i.qMode){let e=eU(i)[o-1];a=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),a=n.fields[e]}const{props:s,main:c}=r.normalizeConfig(yG(yG({},e),{},{field:a?a.key():void 0}),t),u=Object.keys(s);l[o]={propsArr:u,props:s,main:c};const d=a?tU(a,{cube:i}):{fieldDepth:0};aU({propsArr:u,props:s,cube:i,cache:n,itemDepthObject:d,f:a})}const c=a.copy().descendants(),u=a.descendants();for(let e=0;e<u.length;e++){const t=l[u[e].depth].propsArr,n=l[u[e].depth].props,r=l[u[e].depth].main,i=c[e],a=i.data,s=rU(r,a,{key:o});iU({propsArr:t,props:n,item:i,itemData:a,ret:s,sourceKey:o}),u[e].data=s}return a}function lU(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<i.length;a++)if(void 0!==i[a].field){const s=t.raw(),l=t.key();if(!oU(s,n,e))continue;const c="object"==typeof i[a].field?i[a].field:t.field(i[a].field),{props:u,main:d}=r.normalizeConfig(i[a],t),h=Object.keys(u),p=tU(c,{cube:s}),{nodeFn:f,attrFn:m,valueFn:g}=nU({fieldDepth:0},p);aU({propsArr:h,props:u,cube:s,cache:n,itemDepthObject:p,f:c});const y=!!i[a].trackBy,v=typeof i[a].trackBy,b={},x=[],w=f(n.tree),S=[];for(let e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(d.filter&&!d.filter(n))continue;const o=rU(d,n,{key:l});iU({propsArr:h,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[a],itemData:n,obj:o,target:x,tracker:b,trackType:v}),S.push(o)}const C=y?r.collect(x,{main:d,propsArr:h,props:u}):S;o=[...o,...C]}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var cU=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){
|
|
103
103
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
104
|
-
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,d,h=e.length,p=e.search(/[0-9\-\+#]/),f=p>0?e.substring(0,p):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=h-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,h):"";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"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(d=t[0]).length%l,h=d.length,b=0;b<h;b++)m+=d.charAt(b),!((b-y+1)%l)&&b<h-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),f+(n?"-":"")+r+x}}));function cU(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const uU={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"},dU=/%\)?$/,hU=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,pU=/^\(oct\)/i,fU=/^\(dec\)/i,mU=/^\(hex\)/i,gU=/^\(bin\)/i,yU=/^\(rom\)/i,vU=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,bU=/#|0/g;function xU(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 wU(e,t,n){let r;return hU.test(t)?e=xU(e,Number(/\d{2}/.exec(t)[0]),t,n):pU.test(t)?e=xU(e,8,t,n):fU.test(t)?e=xU(e,10,t,n):mU.test(t)?e=xU(e,16,t,n):gU.test(t)?e=xU(e,2,t,n):yU.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let 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();for(;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}function SU(e,t,n){const r=cU(e);return n?r:new RegExp(r||"",t)}function CU(e,t,n,r){let i,o,a,s,l,c,u,d,h,p=e.pattern;var f,m;r&&(e.abbreviate=!0),f=t,(m=n)&&(m=cU(m)),f&&(f=cU(f)),h=new RegExp("(?:[#0]+".concat(f,")?[#0]+(?:").concat(m,"[#0]+)?")),a=p.match(h),a=a?a[0]:"",s=a?p.substr(0,p.indexOf(a)):p,l=a?p.substring(p.indexOf(a)+a.length):"",a||(a=p?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(SU(c,"g"),t)),u=n,n=".",u&&(a=a.replace(SU(u,"g"),n)),d=a.match(/#/g),d=d?d.length:0;const g=p.split(u);let y;g[1]&&(y=g[1].match(bU)),e.prefix=s||"",e.postfix=l||"",e.pattern=p,e.maxPrecision=y?y.length:2,e.percentage=dU.test(p),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(SU(t,null,!0),"|").concat(SU(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class MU{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return uU;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new MU(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],vU.test(e[0])&&(r.positive.isFunctional=!0),e[1]?vU.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?vU.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||CU(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&CU(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&CU(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,c,u=this._prepared,d="",h="",p=e;if(isNaN(e))return"".concat(p);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,a=u.t,u.isFunctional)e=wU(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=lU(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),h=""):(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=lU(l,e)}e=e.replace(u.numericRegex,(e=>e===a?u.groupTemp:e===o?u.decTemp:"")),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+h+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function kU(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=e=>e}=t;let o,a,s=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return a=i(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=i(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(c>=n&&(delete s[l[u]],delete l[u],c--,u++),s[e]=t,l[c]=e,c++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function EU(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new MU(...t)}(i,e,t,n,r),a=kU(o.formatValue.bind(o),{toKey:e=>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}const _U="D",RU="T",IU="TS",DU="IV",AU=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],PU=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],OU=["January","February","March","April","May","June","July","August","September","October","November","December"],TU=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function LU(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function qU(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function NU(e,t){let n,r=function(e){const t=e,n=24*qU(t),r=60*qU(n),i=60*qU(r),o=1e3*qU(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,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:a,s:s,f:l,t:u}}class jU{constructor(e,t,n){const r=e||{};if(r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:AU,qDayNames:PU,qLongMonthNames:OU,qMonthNames:TU}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),!t){t={[RU]:r.qTimeFmt||"hh:mm:ss",[_U]:r.qDateFmt||"YYYY-MM-DD",[IU]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new jU(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),r=NU(e,t));const i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:LU("".concat(t.year).slice(-2),2),YYY:LU("".concat(t.year).slice(-3),3),def:e=>LU("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:LU("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:LU("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>LU("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>LU("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>LU("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>LU("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const a=new RegExp(o.join("|"),"g"),s=t.replace(a,(e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}));return s}}function zU(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new jU(...t)}function FU(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=zU(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=kU(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==DU?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=zU(i,e,t),r=kU(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function WU(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u="dimension"===s?"first":"avg",d=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return FU(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",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"),EU(n,r,i,o,t)}(t,i),h="dimension"===s?"first":(e,t)=>d(t),p={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(p)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:e=>(null==e?void 0:e.qText)||"",reduce:u,reduceLabel:h,formatter:()=>d,tags:()=>t.qTags};return p}function $U(e,t,n,r,i){return(t[e]||[]).map(((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:WU(kG({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=$U("qAttrDimInfo",t,n,a,kG({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=$U("qAttrExprInfo",t,n,a,kG({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=$U("qMeasureInfo",t,n,a,kG({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s}))}function BU(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},i=t;if(!i)throw new Error('Missing "data" input');if(!i.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=BU.util,a={cache:r,cube:i,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>e,raw:()=>i,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>r.fields.slice(),extract:e=>a.extractor(e,s,r,o),hierarchy:e=>a.hierarchy(e,s,r,o),_cache:()=>r};"K"===i.qMode||"T"===i.qMode||!i.qMode&&i.qNodesOnDim?(a.extractor=sU,a.hierarchy=aU,a.pages="K"===i.qMode?i.qStackedDataPages:i.qTreeDataPages):"S"===i.qMode?(a.extractor=IG,a.pages=i.qDataPages,a.hierarchy=aU):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},s,r,o);const l="S"===i.qMode?e=>e.qElemNumber:void 0,c="S"===i.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...$U("qDimensionInfo",i,e,"",kG({},a,{value:l,type:"dimension"}))),r.wrappedFields.push(...$U("qMeasureInfo",i,e,"",kG({},a,{value:c,type:"measure"}))),r.fields=r.wrappedFields.map((e=>e.instance));const u=e=>{e.forEach((e=>{r.allFields.push(e.instance),u(e.measures),u(e.attrDims),u(e.attrExps)}))};return u(r.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=s.field(t.from),i=WU(gG({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},s,r,o),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));r.virtualFields.push(i)})),r.allFields.push(...r.virtualFields),s}const HU=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],VU=/\/qDimensionInfo(?:\/(\d+))?/,GU=/\/qMeasureInfo\/(\d+)/,UU=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,YU=/\/qAttrExprInfo\/(\d+)/,KU=/\/?qHyperCube/,XU=/\/?qTreeData/,JU=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),ZU=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function QU(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;if(e.brushes().forEach((e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;KU.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=JU):XU.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=ZU);let s=!0;if(VU.test(e)&&(r=+VU.exec(e)[1]),GU.test(e)&&(i=+GU.exec(e)[1]),UU.test(e)){i=-1,r=0;const e=+UU.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(YU.test(e)){const e=i;if(t){i=0;const a=GG(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce(((e,t)=>e+t.qAttrExprInfo.length),i),r=-1):(i=a.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),i),i=a.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),i)),i+=+YU.exec(n)[1]}else r>-1?(r=-1,i=+YU.exec(n)[1]):i+=+YU.exec(n)[1]+1}return HU.forEach((e=>{let[t,r]=e;n=n.replace(t,r)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||s>=o)&&o>-1?n.forEach((e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})})):n.forEach((e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&s)return[{method:"resetMadeSelections",params:[]}];var c;a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]});return a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o}function eY(e){BU.util=e.data("matrix").util,e.data("q",BU),e.formatter("q-number",EU),e.formatter("q-time",FU)}eY.qBrushHelper=QU,eY.selections=QU;var tY=Object.prototype.hasOwnProperty,nY=Object.prototype.toString,rY=Object.defineProperty,iY=Object.getOwnPropertyDescriptor,oY=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===nY.call(e)},aY=function(e){if(!e||"[object Object]"!==nY.call(e))return!1;var t,n=tY.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&tY.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||tY.call(e,t)},sY=function(e,t){rY&&"__proto__"===t.name?rY(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},lY=function(e,t){if("__proto__"===t){if(!tY.call(e,t))return;if(iY)return iY(e,t).value}return e[t]},cY=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=lY(s,n),s!==(i=lY(t,n))&&(u&&i&&(aY(i)||(o=oY(i)))?(o?(o=!1,a=r&&oY(r)?r:[]):a=r&&aY(r)?r:{},sY(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&sY(s,{name:n,newValue:i}));return s},uY="2.10.0";function dY(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hY(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 pY(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hY(Object(n),!0).forEach((function(t){dY(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hY(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fY(e){return!!e.changedTouches}function mY(e){return"number"==typeof e&&!isNaN(e)}function gY(e){return"number"!=typeof e||isNaN(e)}function yY(e){const t=e.length;let n=NaN,r=NaN,i=NaN,o=NaN;for(let 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 vY(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function bY(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 xY(e){const[t,n,r,i]=yY(e);return{x:t,y:n,width:r-t,height:i-n}}function wY(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function SY(e){const{x:t,y:n,width:r,height:i,x1:o,x2:a,y1:s,y2:l,cx:c,cy:u,r:d,vertices:h}=e||{};return mY(c)&&mY(u)&&mY(d)?"circle":mY(o)&&mY(a)&&mY(s)&&mY(l)?"line":mY(t)&&mY(n)&&mY(r)&&mY(i)?"rect":mY(t)&&mY(n)?"point":Array.isArray(h)?h.every((e=>Array.isArray(e)))?"geopolygon":"polygon":null}function CY(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}var MY=Math.PI,kY=2*MY,EY=1e-6,_Y=kY-EY;function RY(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function IY(){return new RY}function DY(e){return function(){return e}}RY.prototype=IY.prototype={constructor:RY,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,c=o-e,u=a-t,d=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>EY)if(Math.abs(u*s-l*c)>EY&&i){var h=n-o,p=r-a,f=s*s+l*l,m=h*h+p*p,g=Math.sqrt(f),y=Math.sqrt(d),v=i*Math.tan((MY-Math.acos((f+d-m)/(2*g*y)))/2),b=v/y,x=v/g;Math.abs(b-1)>EY&&(this._+="L"+(e+b*c)+","+(t+b*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>c*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,c=t+s,u=1^o,d=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>EY||Math.abs(this._y1-c)>EY)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%kY+kY),d>_Y?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>EY&&(this._+="A"+n+","+n+",0,"+ +(d>=MY)+","+u+","+(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 AY=Math.abs,PY=Math.atan2,OY=Math.cos,TY=Math.max,LY=Math.min,qY=Math.sin,NY=Math.sqrt,jY=1e-12,zY=Math.PI,FY=zY/2,WY=2*zY;function $Y(e){return e>=1?FY:e<=-1?-FY:Math.asin(e)}function BY(e){return e.innerRadius}function HY(e){return e.outerRadius}function VY(e){return e.startAngle}function GY(e){return e.endAngle}function UY(e){return e&&e.padAngle}function YY(e,t,n,r,i,o,a){var s=e-n,l=t-r,c=(a?o:-o)/NY(s*s+l*l),u=c*l,d=-c*s,h=e+u,p=t+d,f=n+u,m=r+d,g=(h+f)/2,y=(p+m)/2,v=f-h,b=m-p,x=v*v+b*b,w=i-o,S=h*m-f*p,C=(b<0?-1:1)*NY(TY(0,w*w*x-S*S)),M=(S*b-v*C)/x,k=(-S*v-b*C)/x,E=(S*b+v*C)/x,_=(-S*v+b*C)/x,R=M-g,I=k-y,D=E-g,A=_-y;return R*R+I*I>D*D+A*A&&(M=E,k=_),{cx:M,cy:k,x01:-u,y01:-d,x11:M*(i/w-1),y11:k*(i/w-1)}}function KY(){var e=BY,t=HY,n=DY(0),r=null,i=VY,o=GY,a=UY,s=null;function l(){var l,c,u=+e.apply(this,arguments),d=+t.apply(this,arguments),h=i.apply(this,arguments)-FY,p=o.apply(this,arguments)-FY,f=AY(p-h),m=p>h;if(s||(s=l=IY()),d<u&&(c=d,d=u,u=c),d>jY)if(f>WY-jY)s.moveTo(d*OY(h),d*qY(h)),s.arc(0,0,d,h,p,!m),u>jY&&(s.moveTo(u*OY(p),u*qY(p)),s.arc(0,0,u,p,h,m));else{var g,y,v=h,b=p,x=h,w=p,S=f,C=f,M=a.apply(this,arguments)/2,k=M>jY&&(r?+r.apply(this,arguments):NY(u*u+d*d)),E=LY(AY(d-u)/2,+n.apply(this,arguments)),_=E,R=E;if(k>jY){var I=$Y(k/u*qY(M)),D=$Y(k/d*qY(M));(S-=2*I)>jY?(x+=I*=m?1:-1,w-=I):(S=0,x=w=(h+p)/2),(C-=2*D)>jY?(v+=D*=m?1:-1,b-=D):(C=0,v=b=(h+p)/2)}var A=d*OY(v),P=d*qY(v),O=u*OY(w),T=u*qY(w);if(E>jY){var L,q=d*OY(b),N=d*qY(b),j=u*OY(x),z=u*qY(x);if(f<zY&&(L=function(e,t,n,r,i,o,a,s){var l=n-e,c=r-t,u=a-i,d=s-o,h=d*l-u*c;if(!(h*h<jY))return[e+(h=(u*(t-o)-d*(e-i))/h)*l,t+h*c]}(A,P,j,z,q,N,O,T))){var F=A-L[0],W=P-L[1],$=q-L[0],B=N-L[1],H=1/qY(function(e){return e>1?0:e<-1?zY:Math.acos(e)}((F*$+W*B)/(NY(F*F+W*W)*NY($*$+B*B)))/2),V=NY(L[0]*L[0]+L[1]*L[1]);_=LY(E,(u-V)/(H-1)),R=LY(E,(d-V)/(H+1))}}C>jY?R>jY?(g=YY(j,z,A,P,d,R,m),y=YY(q,N,O,T,d,R,m),s.moveTo(g.cx+g.x01,g.cy+g.y01),R<E?s.arc(g.cx,g.cy,R,PY(g.y01,g.x01),PY(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,R,PY(g.y01,g.x01),PY(g.y11,g.x11),!m),s.arc(0,0,d,PY(g.cy+g.y11,g.cx+g.x11),PY(y.cy+y.y11,y.cx+y.x11),!m),s.arc(y.cx,y.cy,R,PY(y.y11,y.x11),PY(y.y01,y.x01),!m))):(s.moveTo(A,P),s.arc(0,0,d,v,b,!m)):s.moveTo(A,P),u>jY&&S>jY?_>jY?(g=YY(O,T,q,N,u,-_,m),y=YY(A,P,j,z,u,-_,m),s.lineTo(g.cx+g.x01,g.cy+g.y01),_<E?s.arc(g.cx,g.cy,_,PY(g.y01,g.x01),PY(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,_,PY(g.y01,g.x01),PY(g.y11,g.x11),!m),s.arc(0,0,u,PY(g.cy+g.y11,g.cx+g.x11),PY(y.cy+y.y11,y.cx+y.x11),m),s.arc(y.cx,y.cy,_,PY(y.y11,y.x11),PY(y.y01,y.x01),!m))):s.arc(0,0,u,w,x,m):s.lineTo(O,T)}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-zY/2;return[OY(r)*n,qY(r)*n]},l.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:DY(+t),l):e},l.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:DY(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:DY(+e),l):n},l.padRadius=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:DY(+e),l):r},l.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:DY(+e),l):i},l.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:DY(+e),l):o},l.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:DY(+e),l):a},l.context=function(e){return arguments.length?(s=null==e?null:e,l):s},l}function XY(e){this._context=e}function JY(e){return new XY(e)}function ZY(e){return e[0]}function QY(e){return e[1]}function eK(){var e=ZY,t=null,n=DY(0),r=QY,i=DY(!0),o=null,a=JY,s=null;function l(l){var c,u,d,h,p,f=l.length,m=!1,g=new Array(f),y=new Array(f);for(null==o&&(s=a(p=IY())),c=0;c<=f;++c){if(!(c<f&&i(h=l[c],c,l))===m)if(m=!m)u=c,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=c-1;d>=u;--d)s.point(g[d],y[d]);s.lineEnd(),s.areaEnd()}m&&(g[c]=+e(h,c,l),y[c]=+n(h,c,l),s.point(t?+t(h,c,l):g[c],r?+r(h,c,l):y[c]))}if(p)return s=null,p+""||null}function c(){return function(){var e=ZY,t=QY,n=DY(!0),r=null,i=JY,o=null;function a(a){var s,l,c,u=a.length,d=!1;for(null==r&&(o=i(c=IY())),s=0;s<=u;++s)!(s<u&&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(c)return o=null,c+""||null}return a.x=function(t){return arguments.length?(e="function"==typeof t?t:DY(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:DY(+e),a):t},a.defined=function(e){return arguments.length?(n="function"==typeof e?e:DY(!!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:DY(+n),t=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:DY(+t),l):e},l.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:DY(+e),l):t},l.y=function(e){return arguments.length?(n="function"==typeof e?e:DY(+e),r=null,l):n},l.y0=function(e){return arguments.length?(n="function"==typeof e?e:DY(+e),l):n},l.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:DY(+e),l):r},l.lineX0=l.lineY0=function(){return c().x(e).y(n)},l.lineY1=function(){return c().x(e).y(r)},l.lineX1=function(){return c().x(t).y(n)},l.defined=function(e){return arguments.length?(i="function"==typeof e?e:DY(!!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 tK(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function nK(e){return e}XY.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 rK=Array.prototype.slice;function iK(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 oK(e){this._context=e}function aK(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 sK(e,t){this._context=e,this._k=(1-t)/6}oK.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:iK(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:iK(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},sK.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:aK(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:aK(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 lK=function e(t){function n(e){return new sK(e,t)}return n.tension=function(t){return e(+t)},n}(0);function cK(e,t){this._context=e,this._alpha=t}cK.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>jY){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>jY){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}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 uK=function e(t){function n(e){return t?new cK(e,t):new sK(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function dK(e){return e<0?-1:1}function hK(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(dK(o)+dK(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function pK(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function fK(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 mK(e){this._context=e}function gK(e){this._context=new yK(e)}function yK(e){this._context=e}function vK(e){this._context=e}function bK(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 xK(e,t){this._context=e,this._t=t}function wK(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 SK(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function CK(e,t){return e[t]}function MK(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 kK(e){for(var t,n=0,r=-1,i=e.length;++r<i;)(t=+e[r][1])&&(n+=t);return n}function EK(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",r=arguments.length>2?arguments[2]:void 0;const i={},o=e||{get:()=>{},has:()=>!1,default:()=>{}};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,i){if(void 0!==i)return a(e,i);const 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(),l.add=a,l.get=s,l.has=function(e){return!!i[e]||o.has(e)},l.remove=function(e){const t=i[e];return delete i[e],t},l.getKeys=function(){return Object.keys(i)},l.getValues=function(){return Object.keys(i).map((e=>i[e]))},l.default=function(e){return void 0!==e&&(t=e),t},l.register=a,l}function _K(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 RK(e){return(e=_K(Math.abs(e)))?e[1]:NaN}mK.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:fK(this,this._t0,pK(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,fK(this,pK(this,n=hK(this,e,t)),n);break;default:fK(this,this._t0,n=hK(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(gK.prototype=Object.create(mK.prototype)).point=function(e,t){mK.prototype.point.call(this,t,e)},yK.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)}},vK.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=bK(e),i=bK(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)}},xK.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 IK,DK=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function AK(e){if(!(t=DK.exec(e)))throw new Error("invalid format: "+e);var t;return new PK({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 PK(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 OK(e,t){var n=_K(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")}AK.prototype=PK.prototype,PK.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 TK={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>OK(100*e,t),r:OK,s:function(e,t){var n=_K(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(IK=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")+_K(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function LK(e){return e}var qK,NK,jK,zK=Array.prototype.map,FK=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function WK(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?LK:(t=zK.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?LK:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(zK.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=AK(e)).fill,n=e.align,d=e.sign,h=e.symbol,p=e.zero,f=e.width,m=e.comma,g=e.precision,y=e.trim,v=e.type;"n"===v?(m=!0,v="g"):TK[v]||(void 0===g&&(g=12),y=!0,v="g"),(p||"0"===t&&"="===n)&&(p=!0,t="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===h?o:/[%p]/.test(v)?l:"",w=TK[v],S=/[defgprs%]/.test(v);function C(e){var i,o,l,h=b,C=x;if("c"===v)C=w(e)+C,e="";else{var M=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:w(Math.abs(e),g),y&&(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)),M&&0==+e&&"+"!==d&&(M=!1),h=(M?"("===d?d:c:"-"===d||"("===d?"":d)+h,C=("s"===v?FK[8+IK/3]:"")+C+(M&&"("===d?")":""),S)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 k=h.length+e.length+C.length,E=k<f?new Array(f-k+1).join(t):"";switch(m&&p&&(e=r(E+e,E.length?f-C.length:1/0),E=""),n){case"<":e=h+e+C+E;break;case"=":e=h+E+e+C;break;case"^":e=E.slice(0,k=E.length>>1)+h+e+C+E.slice(k);break;default:e=E+h+e+C}return s(e)}return g=void 0===g?6:/[gprs]/.test(v)?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=AK(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(RK(t)/3))),i=Math.pow(10,-r),o=FK[8+r/3];return function(e){return n(i*e)+o}}}}!function(e){qK=WK(e),NK=qK.format,jK=qK.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const $K=new Date,BK=new Date;function HK(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(s<n&&n<r);return a},i.filter=n=>HK((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((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=(t,r)=>($K.setTime(+t),BK.setTime(+r),e($K),e(BK),Math.floor(n($K,BK))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e==0:t=>i.count(0,t)%e==0):i:null)),i}const VK=6e4,GK=864e5,UK=6048e5,YK=HK((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*VK)/GK),(e=>e.getDate()-1));YK.range;const KK=HK((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/GK),(e=>e.getUTCDate()-1));KK.range;const XK=HK((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/GK),(e=>Math.floor(e/GK)));function JK(e){return HK((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*VK)/UK))}XK.range;const ZK=JK(0),QK=JK(1),eX=JK(2),tX=JK(3),nX=JK(4),rX=JK(5),iX=JK(6);function oX(e){return HK((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/UK))}ZK.range,QK.range,eX.range,tX.range,nX.range,rX.range,iX.range;const aX=oX(0),sX=oX(1),lX=oX(2),cX=oX(3),uX=oX(4),dX=oX(5),hX=oX(6);aX.range,sX.range,lX.range,cX.range,uX.range,dX.range,hX.range;const pX=HK((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear()));pX.every=e=>isFinite(e=Math.floor(e))&&e>0?HK((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,pX.range;const fX=HK((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));function mX(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function gX(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function yX(e){let t,n,r;function i(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<0?i=t+1:o=t}while(i<o)}return i}return 2!==e.length?(t=mX,n=(t,n)=>mX(e(t),n),r=(t,n)=>e(t)-n):(t=e===mX||e===gX?e:vX,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<=0?i=t+1:o=t}while(i<o)}return i}}}function vX(){return 0}fX.every=e=>isFinite(e=Math.floor(e))&&e>0?HK((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,fX.range;const bX=yX(mX).right;yX((function(e){return null===e?NaN:+e})).center;var xX=bX;class wX extends Map{constructor(e,t=CX){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(SX(this,e))}has(e){return super.has(SX(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const r=t(n);e.has(r)&&(n=e.get(r),e.delete(r));return n}(this,e))}}function SX({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function CX(e){return null!==e&&"object"==typeof e?e.valueOf():e}const MX=Math.sqrt(50),kX=Math.sqrt(10),EX=Math.sqrt(2);function _X(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=MX?10:o>=kX?5:o>=EX?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(e*c),l=Math.round(t*c),s/c<e&&++s,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(e/c),l=Math.round(t/c),s*c<e&&++s,l*c>t&&--l),l<s&&.5<=n&&n<2?_X(e,t,2*n):[s,l,c]}function RX(e,t,n){return _X(e=+e,t=+t,n=+n)[2]}function IX(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 DX(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 AX(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function PX(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,c=zX(i),u=FX(i),d=zX(o),h=FX(o),p=zX(a),f=FX(a),m=zX(s),g=FX(s),y=zX(l),v=FX(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:sJ,e:sJ,f:hJ,g:CJ,G:kJ,H:lJ,I:cJ,j:uJ,L:dJ,m:pJ,M:fJ,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:YJ,s:KJ,S:mJ,u:gJ,U:yJ,V:bJ,w:xJ,W:wJ,x:null,X:null,y:SJ,Y:MJ,Z:EJ,"%":UJ},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:_J,e:_J,f:PJ,g:BJ,G:VJ,H:RJ,I:IJ,j:DJ,L:AJ,m:OJ,M:TJ,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:YJ,s:KJ,S:LJ,u:qJ,U:NJ,V:zJ,w:FJ,W:WJ,x:null,X:null,y:$J,Y:HJ,Z:GJ,"%":UJ},w={a:function(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v.get(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.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return M(e,t,n,r)},d:JX,e:JX,f:rJ,g:UX,G:GX,H:QX,I:QX,j:ZX,L:nJ,m:XX,M:eJ,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:KX,Q:oJ,s:aJ,S:tJ,u:$X,U:BX,V:HX,w:WX,W:VX,x:function(e,t,r){return M(e,n,t,r)},X:function(e,t,n){return M(e,r,t,n)},y:UX,Y:GX,Z:YX,"%":iJ};function S(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=OX[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=AX(1900,void 0,1);if(M(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=DX(AX(o.y,0,1))).getUTCDay(),r=i>4||0===i?sX.ceil(r):sX(r),r=KK.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=IX(AX(o.y,0,1))).getDay(),r=i>4||0===i?QK.ceil(r):QK(r),r=YK.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?DX(AX(o.y,0,1)).getUTCDay():IX(AX(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,DX(o)):IX(o)}}function M(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 OX?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=S(n,b),b.X=S(r,b),b.c=S(t,b),x.x=S(n,x),x.X=S(r,x),x.c=S(t,x),{format:function(e){var t=S(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=S(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+="",!0);return t.toString=function(){return e},t}}}var OX={"-":"",_:" ",0:"0"},TX=/^\s*\d+/,LX=/^%/,qX=/[\\^$*+?|[\]().{}]/g;function NX(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 jX(e){return e.replace(qX,"\\$&")}function zX(e){return new RegExp("^(?:"+e.map(jX).join("|")+")","i")}function FX(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function WX(e,t,n){var r=TX.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function $X(e,t,n){var r=TX.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function BX(e,t,n){var r=TX.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function HX(e,t,n){var r=TX.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function VX(e,t,n){var r=TX.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function GX(e,t,n){var r=TX.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function UX(e,t,n){var r=TX.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function YX(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 KX(e,t,n){var r=TX.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function XX(e,t,n){var r=TX.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function JX(e,t,n){var r=TX.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function ZX(e,t,n){var r=TX.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function QX(e,t,n){var r=TX.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function eJ(e,t,n){var r=TX.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function tJ(e,t,n){var r=TX.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function nJ(e,t,n){var r=TX.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function rJ(e,t,n){var r=TX.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function iJ(e,t,n){var r=LX.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function oJ(e,t,n){var r=TX.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function aJ(e,t,n){var r=TX.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function sJ(e,t){return NX(e.getDate(),t,2)}function lJ(e,t){return NX(e.getHours(),t,2)}function cJ(e,t){return NX(e.getHours()%12||12,t,2)}function uJ(e,t){return NX(1+YK.count(pX(e),e),t,3)}function dJ(e,t){return NX(e.getMilliseconds(),t,3)}function hJ(e,t){return dJ(e,t)+"000"}function pJ(e,t){return NX(e.getMonth()+1,t,2)}function fJ(e,t){return NX(e.getMinutes(),t,2)}function mJ(e,t){return NX(e.getSeconds(),t,2)}function gJ(e){var t=e.getDay();return 0===t?7:t}function yJ(e,t){return NX(ZK.count(pX(e)-1,e),t,2)}function vJ(e){var t=e.getDay();return t>=4||0===t?nX(e):nX.ceil(e)}function bJ(e,t){return e=vJ(e),NX(nX.count(pX(e),e)+(4===pX(e).getDay()),t,2)}function xJ(e){return e.getDay()}function wJ(e,t){return NX(QK.count(pX(e)-1,e),t,2)}function SJ(e,t){return NX(e.getFullYear()%100,t,2)}function CJ(e,t){return NX((e=vJ(e)).getFullYear()%100,t,2)}function MJ(e,t){return NX(e.getFullYear()%1e4,t,4)}function kJ(e,t){var n=e.getDay();return NX((e=n>=4||0===n?nX(e):nX.ceil(e)).getFullYear()%1e4,t,4)}function EJ(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+NX(t/60|0,"0",2)+NX(t%60,"0",2)}function _J(e,t){return NX(e.getUTCDate(),t,2)}function RJ(e,t){return NX(e.getUTCHours(),t,2)}function IJ(e,t){return NX(e.getUTCHours()%12||12,t,2)}function DJ(e,t){return NX(1+KK.count(fX(e),e),t,3)}function AJ(e,t){return NX(e.getUTCMilliseconds(),t,3)}function PJ(e,t){return AJ(e,t)+"000"}function OJ(e,t){return NX(e.getUTCMonth()+1,t,2)}function TJ(e,t){return NX(e.getUTCMinutes(),t,2)}function LJ(e,t){return NX(e.getUTCSeconds(),t,2)}function qJ(e){var t=e.getUTCDay();return 0===t?7:t}function NJ(e,t){return NX(aX.count(fX(e)-1,e),t,2)}function jJ(e){var t=e.getUTCDay();return t>=4||0===t?uX(e):uX.ceil(e)}function zJ(e,t){return e=jJ(e),NX(uX.count(fX(e),e)+(4===fX(e).getUTCDay()),t,2)}function FJ(e){return e.getUTCDay()}function WJ(e,t){return NX(sX.count(fX(e)-1,e),t,2)}function $J(e,t){return NX(e.getUTCFullYear()%100,t,2)}function BJ(e,t){return NX((e=jJ(e)).getUTCFullYear()%100,t,2)}function HJ(e,t){return NX(e.getUTCFullYear()%1e4,t,4)}function VJ(e,t){var n=e.getUTCDay();return NX((e=n>=4||0===n?uX(e):uX.ceil(e)).getUTCFullYear()%1e4,t,4)}function GJ(){return"+0000"}function UJ(){return"%"}function YJ(e){return+e}function KJ(e){return Math.floor(+e/1e3)}const XJ=EK();XJ("d3-number",(function(e,t,n){let 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=WK(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})),XJ("d3-time",(function(e){let t=PX({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=PX(...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}));const JJ={id:e=>"".concat(e.source,"/").concat(e.key||e.title),key:e=>String(e.key||e.title),tags:e=>e.tags,min:e=>e.min,max:e=>e.max,type:e=>e.type,title:e=>String(e.title),values:e=>e.values,value:e=>e,label:e=>e,formatter:e=>(e=>{if("function"==typeof e.formatter)return e.formatter();const t=e.formatter||{};return XJ(t.type||"d3-number")(t.format||"")})(e)};function ZJ(e){let{id:t=JJ.id,key:n=JJ.key,min:r=JJ.min,max:i=JJ.max,type:o=JJ.type,tags:a=JJ.tags,title:s=JJ.title,values:l=JJ.values,value:c=JJ.value,label:u=JJ.label,formatter:d=JJ.formatter}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{id:()=>t(e),key:()=>n(e),raw:()=>e,tags:()=>a(e),type:()=>o(e),min:()=>r(e),max:()=>i(e),title:()=>s(e),items:()=>l(e),formatter:()=>d(e),value:c,label:u}}const QJ=e=>e.filter((e=>"number"==typeof e&&!isNaN(e))),eZ=e=>e.reduce(((e,t)=>e+t),0),tZ={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=QJ(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=QJ(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=QJ(e);return t.length?t.reduce(((e,t)=>e+t),0):NaN},avg:e=>{const t=QJ(e),n=t.length;return n?eZ(t)/n:NaN}};function nZ(e,t,n,r){const i={},o=r.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach((a=>{const s=n[a],l=i[a]={};-1!==["number","string","boolean"].indexOf(typeof s)?(l.type="primitive",l.value=s):"function"==typeof s?(l.type="function",l.value=s,l.label=s,l.field=o):"object"==typeof s&&(s.fields?l.fields=s.fields.map((n=>nZ(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=tZ[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?tZ[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=tZ[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?tZ[l.field.reduceLabel]:l.field.reduceLabel))})),i}function rZ(e,t){const{main:n}=nZ(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{});return{props:nZ(e,t,e.props||{},n),main:n}}function iZ(e,t,n,r){const i=Array(e.length),o=Array(e.length);let a;for(let t=0;t<e.length;t++)a=r?e[t][r]:e[t],i[t]=a.value,o[t]=a.label;const s=t.reduce,l=t.reduceLabel,c=s?s(i):i,u={value:c,label:l?l(o,c):n?n(c):String(c)};return r&&e[0][r].source?(u.source=e[0][r].source,u):!r&&e[0].source?(u.source=e[0].source,u):u}function oZ(e,t){let{main:n,propsArr:r,props:i}=t,o=[];const a=n.field.formatter(),s={};return r.forEach((e=>{s[e]=i[e].field?i[e].field.formatter():e=>e})),o.push(...e.map((e=>{const t=iZ(e.items,n,a);return r.forEach((n=>{t[n]=iZ(e.items,i[n],s[n],n)})),t}))),o}function aZ(e){let{cfg:t,itemData:n,obj:r,target:i,tracker:o,trackType:a}=e;const s="function"===a?t.trackBy(n):n[t.trackBy];let l=o[s];l||(l=o[s]={items:[],id:s},i.push(l)),l.items.push(r)}function sZ(e){if(e.length<1e4)return Math.max(...e);let t=-1/0;const n=e.length;for(let r=0;r<n;r++)t<e[r]&&(t=e[r]);return t}function lZ(e){if(e.length<1e4)return Math.min(...e);let t=1/0;const n=e.length;for(let r=0;r<n;r++)t>e[r]&&(t=e[r]);return t}const cZ={diverging:function(e,t){if((s=e.length)>0)for(var n,r,i,o,a,s,l=0,c=e[t[0]].length;l<c;++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:wK,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}wK(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}wK(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,c=0;s<i;++s){for(var u=e[t[s]],d=u[a][1]||0,h=(d-(u[a-1][1]||0))/2,p=0;p<s;++p){var f=e[t[p]];h+=(f[a][1]||0)-(f[a-1][1]||0)}l+=d,c+=h*d}n[a-1][1]+=n[a-1][0]=o,l&&(o-=c/l)}n[a-1][1]+=n[a-1][0]=o,wK(e,t)}}},uZ={ascending:function(e){var t=e.map(kK);return SK(e).sort((function(e,n){return t[e]-t[n]}))},insideout:function(e){var t,n,r=e.length,i=e.map(kK),o=function(e){var t=e.map(MK);return SK(e).sort((function(e,n){return t[e]-t[n]}))}(e),a=0,s=0,l=[],c=[];for(t=0;t<r;++t)n=o[t],a<s?(a+=i[n],l.push(n)):(s+=i[n],c.push(n));return c.reverse().concat(l)},none:SK,reverse:function(e){return SK(e).reverse()}};function dZ(e,t,n,r){const i=r||e.items,o={},a=t.stackKey,s=t.value,l=t.startProp||"start",c=t.endProp||"end",u=t.offset||"none",d=t.order||"none",h=t.valueRef||"";let p=0,f={};for(let e=0;e<i.length;e++){let t=i[e],n=h?t[h]:null;if(n&&n.source){let e="".concat(n.source.key||"","/").concat(n.source.field);f[e]||(f[e]=n.source)}let r=a(t);o[r]=o[r]||{items:[]},o[r].items.push(t),p=Math.max(p,o[r].items.length)}const m=Array.apply(null,{length:p}).map(Number.call,Number),g=Object.keys(o).map((e=>o[e].items)),y=function(){var e=DY([]),t=SK,n=wK,r=CK;function i(i){var o,a,s=e.apply(this,arguments),l=i.length,c=s.length,u=new Array(c);for(o=0;o<c;++o){for(var d,h=s[o],p=u[o]=new Array(l),f=0;f<l;++f)p[f]=d=[0,+r(i[f],h,f,i)],d.data=i[f];p.key=h}for(o=0,a=t(u);o<c;++o)u[a[o]].index=o;return n(u,a),u}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:DY(rK.call(t)),i):e},i.value=function(e){return arguments.length?(r="function"==typeof e?e:DY(+e),i):r},i.order=function(e){return arguments.length?(t=null==e?SK:"function"==typeof e?e:DY(rK.call(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?wK:e,i):n},i}().keys(m).value(((e,t)=>e[t]?s(e[t]):0)).order(uZ[d]).offset(cZ[u]);let v=y(g),b=[];for(let e=0;e<v.length;e++){let t=v[e];for(let e=0;e<t.length;e++){let n=t[e],r=t[e].data[t.key];r&&(r[l]={value:n[0]},r[c]={value:n[1]},b.push(n[0],n[1]))}}let x=Object.keys(f).map((e=>{let t=n(f[e].key);return t?t.field(f[e].field):null})).filter((e=>!!e));const w=ZJ({title:x.map((e=>e.title())).join(", "),min:lZ(b),max:sZ(b),type:"measure",formatter:x[0]?x[0].formatter:void 0});e.fields.push(w)}function hZ(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};const r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).logger;if(Array.isArray(e))n.items=e.map((e=>({value:e,label:String(e)})));else if(e){if("collection"in e)n=pY({},t.collection(e.collection));else{const i=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),a=e.label||(e=>e);if(e.groupBy||e.mapTo)r.warn('Deprecated "data" configuration',e),n.items=[];else if(e.hierarchy)n.root=i.hierarchy?i.hierarchy(e.hierarchy):null,n.fields=i.fields();else if(e.items)n.items=e.skipNormalize?e.items:e.items.map((e=>({value:o(e),label:String(a(e))})));else if(e.extract){const r=Array.isArray(e.extract)?e.extract:[e.extract];n.items=[];const o=[];r.forEach((e=>{const r=e.source?t.dataset(e.source):i;r&&(n.items=[...n.items,...r.extract(e)],void 0!==e.field&&o.push(r.field(e.field)))})),o.length&&(n.fields=o),e.amend&&Array.isArray(e.amend)&&(n.items=[...n.items,...e.amend])}else if(void 0!==e.field&&i){const t=i.field(e.field);t&&(n.fields||(n.fields=[]),n.fields.push(t),"value"in e||(o=t.value||(e=>e),a=t.label||(e=>e),n.value=o),n.items=t.items().map((t=>({value:o(t),label:String(a(t)),source:{field:e.field}}))))}else e.fields&&e.fields.forEach((e=>{const r="object"==typeof e&&e.source?t.dataset(e.source):i;if(!r)return;let o;o="object"==typeof e&&void 0!==e.field?r.field(e.field):r.field(e),o&&(n.fields||(n.fields=[]),n.fields.push(o))}));n.items&&e.map&&(n.items=n.items.map(e.map))}e&&e.stack&&(Array.isArray(e.stack.stackByKey)?e.stack.stackByKey.forEach((r=>{const i=n.items.filter((e=>{var t;return(null===(t=e.key)||void 0===t?void 0:t.value)&&e.key.value===r}));dZ(n,e.stack,t.dataset,i)})):dZ(n,e.stack,t.dataset,n.items))}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&n.items&&(n.items=n.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&n.items&&(n.items=n.items.sort(e.sort)),n}function pZ(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:hZ;if(e.data){const r=i(e.data,t,n);if(r&&r.fields&&r.fields[0])return r.fields[0].formatter()}if(r=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(r)){return n.formatter.get(r)(e.format||"")}throw new Error("Formatter of type '".concat(r,"' was not found"))}function fZ(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const mZ=Symbol("implicit");function gZ(){var e=new wX,t=[],n=[],r=mZ;function i(i){let o=e.get(i);if(void 0===o){if(r!==mZ)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new wX;for(const r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return gZ(t,n).unknown(r)},fZ.apply(i,arguments),i}function yZ(){var e,t,n=gZ().unknown(void 0),r=n.domain,i=n.range,o=0,a=1,s=!1,l=0,c=0,u=.5;function d(){var n=r().length,d=a<o,h=d?a:o,p=d?o:a;e=(p-h)/Math.max(1,n-l+2*c),s&&(e=Math.floor(e)),h+=(p-h-e*(n-l))*u,t=e*(1-l),s&&(h=Math.round(h),t=Math.round(t));var f=function(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}(n).map((function(t){return h+e*t}));return i(d?f.reverse():f)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),d()):r()},n.range=function(e){return arguments.length?([o,a]=e,o=+o,a=+a,d()):[o,a]},n.rangeRound=function(e){return[o,a]=e,o=+o,a=+a,s=!0,d()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(s=!!e,d()):s},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),d()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),d()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,d()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},n.copy=function(){return yZ(r(),[o,a]).round(s).paddingInner(l).paddingOuter(c).align(u)},fZ.apply(d(),arguments)}function vZ(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function bZ(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function xZ(){}var wZ=.7,SZ=1/wZ,CZ="\\s*([+-]?\\d+)\\s*",MZ="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",kZ="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",EZ=/^#([0-9a-f]{3,8})$/,_Z=new RegExp(`^rgb\\(${CZ},${CZ},${CZ}\\)$`),RZ=new RegExp(`^rgb\\(${kZ},${kZ},${kZ}\\)$`),IZ=new RegExp(`^rgba\\(${CZ},${CZ},${CZ},${MZ}\\)$`),DZ=new RegExp(`^rgba\\(${kZ},${kZ},${kZ},${MZ}\\)$`),AZ=new RegExp(`^hsl\\(${MZ},${kZ},${kZ}\\)$`),PZ=new RegExp(`^hsla\\(${MZ},${kZ},${kZ},${MZ}\\)$`),OZ={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 TZ(){return this.rgb().formatHex()}function LZ(){return this.rgb().formatRgb()}function qZ(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=EZ.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?NZ(t):3===n?new FZ(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?jZ(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?jZ(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=_Z.exec(e))?new FZ(t[1],t[2],t[3],1):(t=RZ.exec(e))?new FZ(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=IZ.exec(e))?jZ(t[1],t[2],t[3],t[4]):(t=DZ.exec(e))?jZ(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=AZ.exec(e))?GZ(t[1],t[2]/100,t[3]/100,1):(t=PZ.exec(e))?GZ(t[1],t[2]/100,t[3]/100,t[4]):OZ.hasOwnProperty(e)?NZ(OZ[e]):"transparent"===e?new FZ(NaN,NaN,NaN,0):null}function NZ(e){return new FZ(e>>16&255,e>>8&255,255&e,1)}function jZ(e,t,n,r){return r<=0&&(e=t=n=NaN),new FZ(e,t,n,r)}function zZ(e,t,n,r){return 1===arguments.length?function(e){return e instanceof xZ||(e=qZ(e)),e?new FZ((e=e.rgb()).r,e.g,e.b,e.opacity):new FZ}(e):new FZ(e,t,n,null==r?1:r)}function FZ(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function WZ(){return`#${VZ(this.r)}${VZ(this.g)}${VZ(this.b)}`}function $Z(){const e=BZ(this.opacity);return`${1===e?"rgb(":"rgba("}${HZ(this.r)}, ${HZ(this.g)}, ${HZ(this.b)}${1===e?")":`, ${e})`}`}function BZ(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function HZ(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function VZ(e){return((e=HZ(e))<16?"0":"")+e.toString(16)}function GZ(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new YZ(e,t,n,r)}function UZ(e){if(e instanceof YZ)return new YZ(e.h,e.s,e.l,e.opacity);if(e instanceof xZ||(e=qZ(e)),!e)return new YZ;if(e instanceof YZ)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 YZ(a,s,l,e.opacity)}function YZ(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function KZ(e){return(e=(e||0)%360)<0?e+360:e}function XZ(e){return Math.max(0,Math.min(1,e||0))}function JZ(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}vZ(xZ,qZ,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:TZ,formatHex:TZ,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return UZ(this).formatHsl()},formatRgb:LZ,toString:LZ}),vZ(FZ,zZ,bZ(xZ,{brighter(e){return e=null==e?SZ:Math.pow(SZ,e),new FZ(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?wZ:Math.pow(wZ,e),new FZ(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new FZ(HZ(this.r),HZ(this.g),HZ(this.b),BZ(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:WZ,formatHex:WZ,formatHex8:function(){return`#${VZ(this.r)}${VZ(this.g)}${VZ(this.b)}${VZ(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:$Z,toString:$Z})),vZ(YZ,(function(e,t,n,r){return 1===arguments.length?UZ(e):new YZ(e,t,n,null==r?1:r)}),bZ(xZ,{brighter(e){return e=null==e?SZ:Math.pow(SZ,e),new YZ(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?wZ:Math.pow(wZ,e),new YZ(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new FZ(JZ(e>=240?e-240:e+120,i,r),JZ(e,i,r),JZ(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new YZ(KZ(this.h),XZ(this.s),XZ(this.l),BZ(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=BZ(this.opacity);return`${1===e?"hsl(":"hsla("}${KZ(this.h)}, ${100*XZ(this.s)}%, ${100*XZ(this.l)}%${1===e?")":`, ${e})`}`}}));var ZZ=e=>()=>e;function QZ(e){return 1==(e=+e)?eQ: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):ZZ(isNaN(t)?n:t)}}function eQ(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):ZZ(isNaN(e)?t:e)}var tQ=function e(t){var n=QZ(t);function r(e,t){var r=n((e=zZ(e)).r,(t=zZ(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=eQ(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 nQ(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 rQ(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]=uQ(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 iQ(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function oQ(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function aQ(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]=uQ(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var sQ=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,lQ=new RegExp(sQ.source,"g");function cQ(e,t){var n,r,i,o=sQ.lastIndex=lQ.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=sQ.exec(e))&&(r=lQ.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:oQ(n,r)})),o=lQ.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 uQ(e,t){var n,r=typeof t;return null==t||"boolean"===r?ZZ(t):("number"===r?oQ:"string"===r?(n=qZ(t))?(t=n,tQ):cQ:t instanceof qZ?tQ:t instanceof Date?iQ:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?nQ:Array.isArray(t)?rQ:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?aQ:oQ)(e,t)}function dQ(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function hQ(e){return+e}var pQ=[0,1];function fQ(e){return e}function mQ(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function gQ(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=mQ(i,r),o=n(a,o)):(r=mQ(r,i),o=n(o,a)),function(e){return o(r(e))}}function yQ(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]=mQ(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=xX(e,t,1,r)-1;return o[n](i[n](t))}}function vQ(){var e,t,n,r,i,o,a=pQ,s=pQ,l=uQ,c=fQ;function u(){var e=Math.min(a.length,s.length);return c!==fQ&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),r=e>2?yQ:gQ,i=o=null,d}function d(t){return null==t||isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(c(t)))}return d.invert=function(n){return c(t((o||(o=r(s,a.map(e),oQ)))(n)))},d.domain=function(e){return arguments.length?(a=Array.from(e,hQ),u()):a.slice()},d.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},d.rangeRound=function(e){return s=Array.from(e),l=dQ,u()},d.clamp=function(e){return arguments.length?(c=!!e||fQ,u()):c!==fQ},d.interpolate=function(e){return arguments.length?(l=e,u()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}function bQ(e,t,n,r){var i,o=function(e,t,n){n=+n;const r=(t=+t)<(e=+e),i=r?RX(t,e,n):RX(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}(e,t,n);switch((r=AK(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(RK(t)/3)))-RK(Math.abs(e)))}(o,a))||(r.precision=i),jK(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,RK(t)-RK(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,-RK(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return NK(r)}function xQ(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)==(t=+t))return[e];const r=t<e,[i,o,a]=r?_X(t,e,n):_X(e,t,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let e=0;e<s;++e)l[e]=(o-e)/-a;else for(let e=0;e<s;++e)l[e]=(o-e)*a;else if(a<0)for(let e=0;e<s;++e)l[e]=(i+e)/-a;else for(let e=0;e<s;++e)l[e]=(i+e)*a;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return bQ(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),a=0,s=o.length-1,l=o[a],c=o[s],u=10;for(c<l&&(i=l,l=c,c=i,i=a,a=s,s=i);u-- >0;){if((i=RX(l,c,n))===r)return o[a]=l,o[s]=c,t(o);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}r=i}return e},e}function wQ(){var e=vQ()(fQ,fQ);return e.copy=function(){return function(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}(e,wQ())},fZ.apply(e,arguments),xQ(e)}function SQ(){var e,t=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[xX(t,i,0,r)]:e}return i.domain=function(e){return arguments.length?(t=Array.from(e),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(e){return arguments.length?(n=Array.from(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 SQ().domain(t).range(n).unknown(e)},fZ.apply(i,arguments)}function CQ(e){return void 0===e?e=>e:t=>e(t)}function MQ(e){return Math.max(0,Math.min(1,e))}function kQ(e){return"object"==typeof e}function EQ(e,t,n){const r=Math.abs(t-n)/(e+1),i=[];for(let o=1;o<=e;o++){const e=o*r;i.push(t<n?t+e:t-e)}return i}function _Q(e,t,n){if(1===e.length)return e;const r=e.concat([]);for(let i=0;i<e.length;i++){let o=e[i],a=e[i+1];0===i&&o!==n.start()?(r.push(...EQ(t,o,a)),o-=a-o,a=e[i],r.push(...EQ(t,o,a))):i===e.length-1&&a!==n.end()?(a=o+(o-e[i-1]),r.push(...EQ(t,o,a))):r.push(...EQ(t,o,a))}return r.filter((e=>e>=n.min()&&e<=n.max()))}function RQ(e){let{distance:t,scale:n,minorCount:r=0,unitDivider:i=100,formatter:o}=e;const a=gY(i)||gY(t)?2:Math.max(t/i,2),s=Math.min(1e3,Math.round(a));let l=n.ticks(s);l.length<=1&&(l=n.ticks(s+1));const c=r>0?_Q(l,r,n):l;c.sort(((e,t)=>e-t));const u=c.map(CQ(o));return c.map(((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:u[t],value:e,isMinor:-1===l.indexOf(e)}}))}function IQ(e){let{distance:t,scale:n,minorCount:r=0,unitDivider:i=100,formatter:o}=e;const a=gY(i)||gY(t)?2:Math.max(t/i,2),s=Math.min(1e3,Math.round(a)),l=s>10?10:s;n.nice(l);const c=n.ticks(s),u=r>0?_Q(c,r,n):c;u.sort(((e,t)=>e-t));const d=u.map(CQ(o));return u.map(((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:d[t],value:e,isMinor:-1===c.indexOf(e)}}))}function DQ(e){let t,{settings:n,scale:r,distance:i,formatter:o=e=>e}=e;const a=n.minorTicks&&!gY(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const e=n.ticks.values.filter((e=>"object"==typeof e?!gY(e.value):!gY(e)));t=function(e){let{values:t,scale:n,formatter:r=e=>e}=e;return t.sort(((e,t)=>(kQ(e)?e.value:e)-(kQ(t)?t.value:t))).filter(((e,t,r)=>{const i=kQ(e)?e.value:e;return i<=n.max()&&i>=n.min()&&r.indexOf(e)===t})).map((e=>{const t=kQ(e),i=t?e.value:e,o=n(i);return{position:o,value:i,label:t&&void 0!==e.label?e.label:r(i),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?MQ(n(e.start)):o,end:t&&!isNaN(e.end)?MQ(n(e.end)):o}}))}({values:e,scale:r.copy(),formatter:o})}else if(gY(n.ticks.count)){t=(n.ticks.tight?IQ:RQ)({distance:i,minorCount:a,unitDivider:n.ticks.distance,scale:r,formatter:o}),n.ticks.forceBounds&&function(e,t,n){const r=e.map((e=>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);const 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,o)}else{t=function(e){let{count:t,minorCount:n,scale:r,formatter:i}=e;return r.ticks((t-1)*n+t).map(((e,t)=>{const 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:a,scale:r.copy(),formatter:o})}return t}function AQ(){let 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]:{};const r={};return Object.keys(t).forEach((i=>{const o=typeof e[i];r[i]="function"===o?e[i](n):"undefined"===o?t[i]:e[i]})),r}const PQ={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},OQ={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},TQ={count:NaN};function LQ(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 qQ(){let 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]:{};const r=wQ(),i={instance:null,invert:!1},o={data:t,resources:n},a=AQ(e,PQ,o);let s;function l(e){return gY(e)?NaN:r(e)}a.ticks=AQ(e.ticks,OQ,o),a.minorTicks=AQ(e.minorTicks,TQ,o),l.data=()=>t,l.invert=function(e){return r.invert(e)},l.rangeRound=function(e){return r.rangeRound(e),l},l.clamp=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return r.clamp(e),l},l.cachedTicks=function(){return s},l.clearTicksCache=function(){return s=void 0,this},l.ticks=function(e){return null!==e&&"object"==typeof e?(e.settings=e.settings||{},e.settings=cY(!0,{},a,e.settings),e.scale=l,s=DQ(e),s):(s=r.ticks(e),s)},l.nice=function(e){return r.nice(e),l},l.tickFormat=function(e,t){return r.tickFormat(e,t)},l.interpolate=function(e){return r.interpolate(e),l},l.domain=function(e){return arguments.length?(r.domain(e),i.instance&&i.instance.domain([l.start(),l.end()]),l):r.domain()},l.range=function(e){return arguments.length?(r.range(e),l):r.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){let t=(l.start()-l.end())/e,n=[l.end()],r=[],i=t/2;for(let o=0;o<e;o++){let e=n[n.length-1]||0,o=e+t,a=l(e+i);n.push(o,o),r.push(a,a)}return n.pop(),l.domain(n),l.range(r),l},l.copy=function(){const i=qQ(e,t,n);return i.domain(l.domain()),i.range(l.range()),i.clamp(r.clamp()),i},l.norm=function(e){return LQ(i,l),i.instance(e)},l.normInvert=function(e){return LQ(i,l),i.instance.invert(e)};const{mini:c,maxi:u}=function(e,t){const n=+e.min,r=+e.max;let i=0,o=1;if(t&&t[0]){const n=t.map((e=>e.min())).filter((e=>!isNaN(e))),r=t.map((e=>e.max())).filter((e=>!isNaN(e)));if(i=n.length?Math.min(...n):Number.NaN,o=r.length?Math.max(...r):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)){const t=o-i;i-=t*e.expand,o+=t*e.expand}if(Array.isArray(e.include)){const t=e.include.filter((e=>!isNaN(e)));i=Math.min(...t,i),o=Math.max(...t,o)}}return{mini:isNaN(n)?i:n,maxi:isNaN(r)?o:r}}(a,t?t.fields:[]);return l.domain([c,u]),l.range(a.invert?[1,0]:[0,1]),i.invert=a.invert,l}const NQ={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function jQ(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={data:t,resources:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}},r=AQ(e,NQ,n),i=t.items||[],o={},a=[],s=[];function l(e,n){e.data=()=>t,e.datum=e=>i[o[e]],e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=()=>s,e.ticks=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,function(e){let{scale:t}=e;const n=t.domain(),r=t.data().items,i=t.labels?t.labels():n,o=t.bandwidth();return n.map(((e,n)=>{const a=t(e);return{position:a+o/2,label:"".concat(i[n]),data:r?r[n]:void 0,start:a,end:a+o}}))}(t,n.trackBy)}}const c=yZ();l(c,e),c.pxScale=function(t){const n=r.maxPxStep;if(isNaN(n))return c;const i=c.domain().length,o=Math.max(1,i-c.paddingInner()+2*c.paddingOuter());if(o*n>=t)return c;const a=c.copy();a.type=c.type,l(a,e);const s=o*n/t,u=(1-s)*c.align();return a.range(r.invert?[s+u,u]:[u,s+u]),a};const u="function"==typeof e.value?e.value:e=>e.datum.value,d="function"==typeof e.label?e.label:e=>e.datum.label;for(let e=0;e<i.length;e++){const t=cY({datum:i[e]},n),r=u(t,e);-1===a.indexOf(r)&&(a.push(r),s.push(d(t,e)),o[r]=e)}return c.domain(a),c.range(r.invert?r.range.slice().reverse():r.range),c.padding(isNaN(r.padding)?0:r.padding),isNaN(r.paddingInner)||c.paddingInner(r.paddingInner),isNaN(r.paddingOuter)||c.paddingOuter(r.paddingOuter),c.align(isNaN(r.align)?.5:r.align),c}const zQ={depth:0};function FQ(e,t,n){return e.ancestors().map((e=>t(cY({datum:e.data},n)))).reverse().slice(1).toString()}const WQ=e=>e.min(),$Q=e=>e.max();function BQ(e,t){const n=e&&!isNaN(e.min),r=e&&!isNaN(e.max);let i=n?+e.min:0,o=r?+e.max:1;if(t&&t.length){if(!n){const e=t.map(WQ).filter(mY);i=e.length?Math.min(...e):i}if(!r){const e=t.map($Q).filter(mY);o=e.length?Math.max(...e):o}}return[i,o]}const HQ={domain:[],range:[],invert:!1,min:NaN,max:NaN};function VQ(){let 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]:{};const r=qQ(e,t,n).clamp(!0).interpolate(tQ),i=AQ(e,HQ,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length,s=r;cY(!0,s,r);const[l,c]=BQ(i,t?t.fields:[]),u=o?i.domain.length:-1,d=n.theme?n.theme.palette("sequential",u>0?u:2):[],h=a?i.range:d;return s.range(i.invert?h.slice().reverse():h.slice()),s.domain(o?i.domain:function(e,t,n){const r=e.length;if(2===r)return[t,n];const i=[],o=(n-t)/(r-1);i.push(t);for(let e=1;e<r-1;e++)i.push(t+o*e);return i.push(n),i}(s.range(),l,c)),s}const GQ={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function UQ(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}const YQ={domain:[],range:[]};const KQ={domain:[],range:[],unknown:void 0},XQ={domain:[],range:[],override:!1};const JQ=EK();function ZQ(e,t,n){let r=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),r={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach((e=>{r.extract.push({field:e})})));const i=hZ(r,t,n);let o,a=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?function(e){const t=e.map((e=>"dimension"===e.type()?"band":"linear"));return-1!==t.indexOf("linear")?"linear":"band"}(e.fields):"linear"}(i);return"color"===a&&(a=i.fields&&i.fields[0]&&"dimension"===i.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(a)&&(o=n.scale.get(a),o=o(e,i,{theme:n.theme,logger:n.logger}),o.type=a),o}JQ("linear",qQ),JQ("band",jQ),JQ("h-band",(function e(){let 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]:{};const i={data:n,resources:r},o=AQ(t,NQ,i);o.ticks=AQ(t.ticks,zQ,i),o.value="function"==typeof t.value?t.value:e=>e.datum.value,o.label="function"==typeof t.label?t.label:e=>e.datum.value;let a=jQ(o);const{values:s,labels:l,items:c,ticks:u}=function(e,t,n){const r=t.ticks.depth,i=t.value,o=t.label,a=[],s=[],l={},c=[];let u=0;if(!e)return{values:a,labels:s,items:l,ticks:c};e.eachAfter((e=>{if(e.depth>0){const t=FQ(e,i,n),d=e.leaves()||[e],h=i(cY({datum:e.data},n)),p=o(cY({datum:e.data},n)),f=Array.isArray(e.children),m={key:t,count:d.length,value:h,label:p,leftEdge:FQ(d[0],i,n),rightEdge:FQ(d[Math.max(d.length-1,0)],i,n),node:e};f?(a.push("SPACER_".concat(u,"_SPACER")),u++):(a.push(t),s.push(p)),(r<=0&&!f||e.depth===r)&&c.push(m),l[t]=m}}));const d=e.height-1;return d>0&&a.splice(-d),{values:a,labels:s,items:l,ticks:c}}(n.root,o,i),d=function(e){const t=String(e),n=c[t];return a(n?o.invert?n.rightEdge:n.leftEdge:t)};cY(!0,d,a),d.bandwidth=function(e){const t=c[String(e)],n=a.bandwidth();if(t&&!t.isLeaf){const e=d(t.leftEdge),r=d(t.rightEdge);return Math.abs(e-r)+n}return n},d.step=function(e){const t=c[String(e)],n=t?t.count:1;let r=a.step();return r*=n,r},d.data=()=>n,d.datum=e=>{const t=c[String(e)];return t?t.node.data:null},d.copy=()=>e(t,n,r),d.labels=()=>l,d.ticks=()=>u.map((e=>{const t=d(e.key),n=d.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}}));const h=a.pxScale;return d.pxScale=function(e){return a=h(e),d},d.domain(s),d})),JQ("sequential-color",VQ),JQ("threshold-color",(function(){let 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]:{};const r=SQ(),i=AQ(e,GQ,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length;function s(e){return gY(e)?NaN:r(e)}Object.keys(r).forEach((e=>s[e]=r[e]));const l=t.fields,[c,u]=BQ(i,l),d=o?i.domain.length:-1,h=n.theme?n.theme.palette("sequential",d>0?d:2):[];let p=a?i.range:h,f=[];return f=o?i.domain:i.nice?function(e,t,n){const r=2===e.length?10:Math.max(1,e.length),i=wQ().domain([t,n]).nice(r).ticks(r);if(!e||!e.length)return i;const o=Math.max(0,e.length-1);for(;i.length>o;)i[0]-t<=n-i[i.length-1]?i.shift():i.pop();return i}(p,c,u):[c+(u-c)/2],p.length>f.length+1?f=function(e,t,n){const r=e.length;if(2===r)return[t+(n-t)/2];const i=[],o=(n-t)/r;for(let e=1;e<r;e++)i.push(t+o*e);return i}(p,c,u):p.length<f.length+1&&(p=function(e,t,n,r){n=e[0],r=e&&e.length>=2?e[e.length-1]:r;const i=VQ().domain([n,r]).range(t);return[n,...UQ(e),r].map((e=>i(e)))}(f,p,c,u)),s.data=()=>t,s.range(i.invert?p.slice().reverse():p),s.domain(f),s})),JQ("categorical-color",(function(){let 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]:{};const r=function(){let 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]:{};const r=gZ(),i={data:t,resources:n},o=AQ(e,YQ,i),a="function"==typeof e.value?e.value:e=>e.datum.value,s="function"==typeof e.label?e.label:e=>e.datum.label,l=t.items||[],c={},u=[],d=[];for(let e=0;e<l.length;e++){const t=cY({datum:l[e]},i),n=a(t,e);-1===u.indexOf(n)&&(u.push(n),d.push(s(t,e)),c[n]=e)}return r.data=()=>t,r.labels=()=>d,r.label=e=>d[u.indexOf(e)],r.datum=e=>l[c[e]],r.range(o.range),Array.isArray(o.domain)&&o.domain.length?r.domain(o.domain):r.domain(u),r}(e,t,n),i=n.theme,o=AQ(e,KQ,{data:t,resources:n});let a;if(o.explicit=AQ(e.explicit,XQ,{data:t,resources:n}),a=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():i?i.palette("categorical",r.domain().length).slice():[],o.unknown)r.unknown(o.unknown);else if(i&&i.palette("unknown")){let e=i.palette("unknown");r.unknown(e[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const e=r.domain().slice(),t=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],i=Math.floor(e.length/a.length);for(let e=1;e<i+1;e*=2)a=a.concat(a);if(o.explicit.override)for(let r=0;r<t.length;r++){const i=e.indexOf(t[r]);i>-1&&(a[i]=n[r])}else{const r=t.map(((t,r)=>[e.indexOf(t),t,n[r]])).sort(((e,t)=>e[0]-t[0]));r.forEach((t=>{const n=e.indexOf(t[1]);-1!==n&&a.splice(n,0,t[2])}))}a.length=e.length}return r.range(a),r}));var QQ={};function e0(){e0.init.call(this)}QQ.isObject=function(e){return"object"==typeof e&&null!==e},QQ.isNumber=function(e){return"number"==typeof e},QQ.isUndefined=function(e){return void 0===e},QQ.isFunction=function(e){return"function"==typeof e};var t0=e0;e0.EventEmitter=e0,e0.prototype._events=void 0,e0.prototype._maxListeners=void 0,e0.defaultMaxListeners=10,e0.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},e0.prototype.setMaxListeners=function(e){if(!QQ.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},e0.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],QQ.isUndefined(n))return!1;if(QQ.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(QQ.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},e0.prototype.addListener=function(e,t){var n;if(!QQ.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,QQ.isFunction(t.listener)?t.listener:t),this._events[e]?QQ.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,QQ.isObject(this._events[e])&&!this._events[e].warned)&&((n=QQ.isUndefined(this._maxListeners)?e0.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,QQ.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),QQ.isFunction(console.trace)&&console.trace()));return this},e0.prototype.on=e0.prototype.addListener,e0.prototype.once=function(e,t){if(!QQ.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},e0.prototype.removeListener=function(e,t){var n,r,i,o;if(!QQ.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||QQ.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(QQ.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},e0.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],QQ.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},e0.prototype.listeners=function(e){return this._events&&this._events[e]?QQ.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},e0.listenerCount=function(e,t){return e._events&&e._events[t]?QQ.isFunction(e._events[t])?1:e._events[t].length:0};var n0={mixin:e=>(Object.keys(t0.prototype).forEach((t=>{e[t]=t0.prototype[t]})),t0.init(e),e)};function r0(){let e=0,t=0,n=0,r=0;n=n||e;const i={move(e){this.moveTo(n+e)},moveTo(o){const a=Math.max(e,Math.min(t-r,o));n!==a&&(n=a,i.emit("update"))},update(o){let a=!1;({min:e=e,max:t=t}=o),void 0!==o.viewSize&&o.viewSize!==r&&(r=o.viewSize,a=!0);const s=Math.max(e,Math.min(t-r,n));n!==s&&(n=s,a=!0),a&&i.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:r})};return n0.mixin(i),i}function i0(e,t){const n=e.min||0,r=e.max||0,i=e.viewSize||0,o=t||r0();return o.update({min:n,max:r,viewSize:i}),o}function o0(e,t){return e<=t}function a0(e,t){return e<t}function s0(e,t,n){let r=0;for(;r<e.length&&t>e[r];)++r;return e[r]===t&&n&&++r,r}function l0(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=[];function i(){}return i.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{includeMax:r=!0,includeMin:i=!0}=n;e=r?o0:a0,t=i?o0:a0},i.add=e=>{let{min:t,max:n}=e;const i=s0(r,t),o=s0(r,n,!0),a=[i,o-i];i%2==0&&a.push(t),o%2==0&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.remove=e=>{let{min:t,max:n}=e;const i=s0(r,t),o=s0(r,n,!0),a=[i,o-i];i%2==1&&a.push(t),o%2==1&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.set=e=>{const t=r.join(",");r=[],Array.isArray(e)?e.forEach(i.add):i.add(e);return t!==r.join(",")},i.clear=()=>{const e=r.length>0;return r=[],e},i.containsValue=n=>function(e,t,n,r){const i=e.length;for(let o=1;o<i;o+=2)if(n(e[o-1],t)&&r(t,e[o]))return!0;return!1}(r,n,t,e),i.containsRange=e=>{let{min:t,max:n}=e;const i=s0(r,t,!0),o=s0(r,n);return i===o&&o%2==1},i.toggle=e=>i.containsRange(e)?i.remove(e):i.add(e),i.ranges=()=>{const e=[];for(let t=1;t<r.length;t+=2)e.push({min:r[t-1],max:r[t]});return e},i.configure(n),i}function c0(){let e=[];function t(){}return t.add=t=>-1===e.indexOf(t)&&(e.push(t),!0),t.remove=t=>{const n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=t=>-1!==e.indexOf(t),t.values=()=>e.slice(),t.clear=()=>e=[],t.toString=()=>e.join(";"),t}const u0={key:void 0,includeMin:!0,includeMax:!0};function d0(e){let{items:t,collection:n,vc:r}=e;const i={},o=[];let a,s;for(let e=0,o=t.length;e<o;e++){a=t[e].key,n[a]||(n[a]=r()),s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[a].add(s[e])&&(i[a]=i[a]||[],i[a].push(s[e]))}const l=Object.keys(i);for(let e=0,t=l.length;e<t;e++)a=l[e],o.push({id:a,values:i[a]});return o}function h0(e){let{items:t,collection:n}=e;const r={},i=[];let o,a;for(let e=0,i=t.length;e<i;e++)if(o=t[e].key,n[o]){a=t[e].values||[t[e].value];for(let e=0;e<a.length;e++)n[o].remove(a[e])&&(r[o]=r[o]||[],r[o].push(a[e]))}const s=Object.keys(r);for(let e=0,t=s.length;e<t;e++)o=s[e],i.push({id:o,values:r[o]});return i}function p0(e){const t={};let n,r;for(let i=0,o=e.length;i<o;i++){n=e[i].key,r=e[i].values||[e[i].value],t[n]||(t[n]=[]);for(let e=0;e<r.length;e++){-1===t[n].indexOf(r[e])&&t[n].push(r[e])}}return t}function f0(e){let{key:t,collection:n,obj:r,fn:i,value:o}=e;n[t]||(n[t]=i()),r[t]=r[t]||[],r[t].push(o),n[t].add(o)}function m0(e,t){const n=[],r=Object.keys(e);let i,o;const a=e=>-1===t[i].indexOf(e);for(let s=0,l=r.length;s<l;s++)i=r[s],t[i]?(o=e[i].filter(a),o.length&&n.push({id:i,values:o})):n.push({id:i,values:e[i]});return n}function g0(e,t,n){const r=function(e,t){if(!Object.keys(t).length)return e;const n=e.length,r=Array(n);for(let i=0;i<n;i++)r[i]=e[i].key in t?cY({},e[i],{key:t[e[i].key]}):e[i];return r}(t,n);return e&&e.length?e.reduce(((e,t)=>t(e)),r):r}function y0(e){return e.replace(/(-[a-z])/g,(e=>e.toUpperCase().replace("-","")))}function v0(e){return e.replace(/([A-Z])/g,(e=>"-".concat(e.toLowerCase())))}function b0(e,t,n){let{ranges:r,interceptors:i,rc:o,aliases:a,rangeConfig:s}=n;const l=g0(i["".concat(t,"Ranges")],e,a);let c=!1;return l.forEach((e=>{const n=e.key;if(r[n]||(r[n]=o(s.sources[n]||s.default)),"set"===t)c=r[n][t](e.ranges||e.range)||c;else{const i=e.ranges||[e.range];for(let e=0;e<i.length;e++)c=r[n][t](i[e])||c}})),c}function x0(){let{vc:e=c0,rc:t=l0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=!1,r={},i={},o={},a={sources:{},default:cY({},u0)};const s={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},l=()=>{const e={values:{},ranges:{}};return Object.keys(i).forEach((t=>{e.values[t]=i[t].values()})),Object.keys(r).forEach((t=>{e.ranges[t]=r[t].ranges()})),e},c={ls:[],clear(){this.ls.forEach((e=>e.clear()))},start(){this.ls.forEach((e=>e.start()))},end(){this.ls.forEach((e=>e.end()))},update(){const e=l();this.ls.forEach((t=>t._state(e)))},updateValues(){const e=l();this.ls.forEach((t=>t._state({values:e.values})))},updateRanges(){const e=l();this.ls.forEach((t=>t._state({ranges:e.ranges})))}},u={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(a={sources:{},default:cY({},u0)},e.ranges.forEach((e=>{const t={};Object.keys(u0).filter((e=>"key"!==e)).forEach((n=>{t[n]=void 0!==e[n]?e[n]:u0[n]})),void 0!==e.key?a.sources[e.key]=t:a.default=t})),Object.keys(r).forEach((e=>r[e].configure(a.sources[e]||a.default))),u.emit("update",[],[]))},link:e=>{if(u===e)throw new Error("Can't link to self");c.ls.push(e),e._state(l())},_state:e=>{if(!e)return l();if(e.values){const t=[];Object.keys(e.values).forEach((n=>{i[n]&&e.values[n].join(";")===i[n].toString()||t.push({key:n,values:e.values[n]})})),Object.keys(i).forEach((n=>{e.values[n]||t.push({key:n,values:[]})})),t.length&&u.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach((n=>{r[n]&&e.ranges[n].join(";")===r[n].toString()||t.push({key:n,ranges:e.ranges[n]})})),Object.keys(r).forEach((n=>{e.ranges[n]||t.push({key:n,ranges:[]})})),t.length&&u.setRanges(t)}},start:function(){if(!n){n=!0;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];u.emit("start",...t),c.start()}},end:function(){if(n){n=!1,r={},i={};for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];u.emit("end",...t),c.end()}},isActive:()=>n,clear:()=>{const e=u.brushes().filter((e=>"value"===e.type&&e.brush.values().length)).map((e=>({id:e.id,values:e.brush.values()}))),t=Object.keys(r).length>0||e.length;r={},i={},t&&(u.emit("update",[],e),c.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(r).map((e=>({type:"range",id:e,brush:r[e]})))),e=e.concat(Object.keys(i).map((e=>({type:"value",id:e,brush:i[e]})))),e},addValue:(e,t)=>{u.addValues([{key:e,value:t}])},addValues:t=>{const r=g0(s.addValues,t,o),a=d0({vc:e,collection:i,items:r});u.emit("add-values",r),a.length&&(n||(n=!0,u.emit("start")),u.emit("update",a,[]),c.updateValues())}};return u.setValues=t=>{const r=g0(s.setValues,t,o),a=function(e){let{items:t,vCollection:n,vc:r}=e;const i={},o=p0(t);let a,s=[],l=[];const c={},u=Object.keys(n);for(let e=0,t=u.length;e<t;e++)a=u[e],c[a]=n[a].values().slice(),delete n[a];const d=e=>{n[a]&&n[a].contains(e)||f0({key:a,value:e,collection:n,obj:i,fn:r})},h=Object.keys(o);for(let e=0,t=h.length;e<t;e++)a=h[e],o[a].forEach(d);return l=m0(c,i),s=m0(i,c),[s,l]}({items:r,vCollection:i,vc:e});u.emit("set-values",r),(a[0].length>0||a[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",a[0],a[1]),c.updateValues())},u.removeValue=(e,t)=>{u.removeValues([{key:e,value:t}])},u.removeValues=e=>{const t=g0(s.removeValues,e,o),n=h0({collection:i,items:t});u.emit("remove-values",t),n.length&&(u.emit("update",[],n),c.updateValues())},u.addAndRemoveValues=(t,r)=>{const a=g0(s.addValues,t,o),l=g0(s.removeValues,r,o),d=d0({vc:e,collection:i,items:a}),h=h0({collection:i,items:l});u.emit("add-values",a),u.emit("remove-values",l),(d.length||h.length)&&(n||(n=!0,u.emit("start")),u.emit("update",d,h),c.updateValues())},u.toggleValue=(e,t)=>{u.toggleValues([{key:e,value:t}])},u.toggleValues=t=>{const r=g0(s.toggleValues,t,o),a=function(e){let{items:t,values:n,vc:r}=e;const i={},o={},a=[],s=[],l=p0(t);let c,u,d;const h=Object.keys(l);for(let e=0,t=h.length;e<t;e++){c=h[e],d=l[c];for(let e=0,t=d.length;e<t;e++)u=d[e],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):f0({key:c,value:u,collection:n,obj:i,fn:r})}const p=Object.keys(i);for(let e=0,t=p.length;e<t;e++)c=p[e],a.push({id:c,values:i[c]});const f=Object.keys(o);for(let e=0,t=f.length;e<t;e++)c=f[e],s.push({id:c,values:o[c]});return[a,s]}({items:r,values:i,vc:e});u.emit("toggle-values",r),(a[0].length>0||a[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",a[0],a[1]),c.updateValues())},u.containsValue=(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].contains(t)},u.addRange=(e,t)=>{u.addRanges([{key:e,range:t}])},u.addRanges=e=>{b0(e,"add",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.removeRange=(e,t)=>{u.removeRanges([{key:e,range:t}])},u.removeRanges=e=>{b0(e,"remove",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.setRange=(e,t)=>{u.setRanges([{key:e,range:t}])},u.setRanges=e=>{b0(e,"set",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.toggleRange=(e,t)=>{u.toggleRanges([{key:e,range:t}])},u.toggleRanges=e=>{b0(e,"toggle",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.containsRangeValue=(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].containsValue(t)},u.containsRange=(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].containsRange(t)},u.containsMappedData=(e,t,n)=>{let a=[];const s=Object.keys(e);let l,c,u,d;for(let t=0,n=s.length;t<n;t++){if(l=s[t],"value"===l)c=e,a[t]={key:"",i:t,bool:!1};else{if("source"===l)continue;c=e[l],a[t]={key:l,i:t,bool:!1}}u=c.source&&c.source.field,void 0!==u&&(void 0!==c.source.key&&(u="".concat(c.source.key,"/").concat(u)),u in o&&(u=o[u]),d=c.value,r[u]?a[t].bool=Array.isArray(d)?r[u].containsRange({min:d[0],max:d[1]}):r[u].containsValue(d):i[u]&&i[u].contains(d)&&(a[t].bool=!0))}return t?(a=a.filter((e=>-1!==t.indexOf(e.key))),"and"===n?!!a.length&&!a.some((e=>!1===e.bool)):"xor"===n?!!a.length&&a.some((e=>e.bool))&&a.some((e=>!1===e.bool)):a.some((e=>e.bool))):a.some((e=>e.bool))},u.intercept=(e,t)=>{const n=y0(e);s[n]&&s[n].push(t)},u.removeInterceptor=(e,t)=>{const n=y0(e);if(!s[n])return;const r=s[n].indexOf(t);-1!==r&&s[n].splice(r,1)},u.removeAllInterceptors=e=>{const t=[];if(e){const n=y0(e);s[n]&&s[n].length&&t.push({name:e,handlers:s[n]})}else Object.keys(s).forEach((e=>{s[e].length&&t.push({name:v0(e),handlers:s[e]})}));t.forEach((e=>{e.handlers.slice().forEach((t=>u.removeInterceptor(e.name,t)))}))},u.addKeyAlias=(e,t)=>{o[e]=t},u.removeKeyAlias=e=>{delete o[e]},n0.mixin(u),u}function w0(e){return e*e*e}function S0(e){return--e*e*e+1}function C0(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}EK();const M0=["stroke","fill","color","backgroundColor","thumbColor"];function k0(e,t){const n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n);let a;for(a=0;a<r;++a)i[a]=E0(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(e){for(a=0;a<r;++a)o[a]=i[a](e);return o}}function E0(e,t,n){const r=typeof t;let i;return null==t||"boolean"===r?function(e){return()=>e}(t):("number"===r?oQ:"string"===r?(i=qZ(t))&&M0.includes(n)?(t=i,tQ):cQ:t instanceof qZ?tQ:t instanceof Date?iQ:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?nQ:Array.isArray(t)?k0:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?_0:oQ)(e,t)}function _0(e,t){const n={},r={};let i;for(i in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)i in e?n[i]=E0(e[i],t[i],i):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}function R0(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}const I0={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},D0=/^\$/;function A0(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function P0(e,t,n){const r=e[t];r&&r.scale&&r.scale.pxScale?r.scale=r.scale.pxScale(n):r&&r.pxScale&&(e[t]=r.pxScale(n))}function O0(e,t){return e.pxScale?e.pxScale(t):e}const T0={normalizeSettings:function(e,t,n){const r=cY({},e),i=cY({},t);return Object.keys(r).forEach((e=>{i[e]={};const o=r[e],a=typeof o;if("function"==typeof o)i[e].fn=o;else if(A0(o)){let n=t[e];"string"==typeof n&&D0.test(n)&&(n=I0[n]);const r=typeof n;i[e]="undefined"===r||r===a?o:n}else o&&"object"==typeof 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((e=>{if(e in r)return;const n=t[e];"string"===typeof n&&D0.test(n)?i[e]=I0[n]:i[e]=n})),i},resolveForItem:function(e,t,n){const r={},i=Object.keys(t),o=i.length,a=e.datum,s=e.datum;for(let l=0;l<o;l++){const o=i[l],c=t[o],u="object"==typeof s&&void 0!==c,d=u&&"string"==typeof c.ref,h=u&&o in s,p=d?s[c.ref]:h?s[o]:a;A0(c)?r[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),r[o]=c.fn.call(null,e,n)):u&&c.scale&&p?(r[o]=c.scale(p.value),c.scale.bandwidth&&(r[o]+=c.scale.bandwidth()/2)):d&&p?r[o]=p.value:c.fn?r[o]=c.fn.call(null,e,n):r[o]=c}return r},updateScaleSize:P0};function L0(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((e,t)=>Array.isArray(t.children)?(e.push(...L0(t.children)),e):(e.push(t),e)),[])}function q0(e,t){let{context:n,data:r,style:i,filter:o,mode:a}=t;const s=e.chart.brush(n),l=r,c=i.active||{},u=i.inactive||{},d=[];Object.keys(c).forEach((e=>{d.push(e)})),Object.keys(u).forEach((e=>{-1===d.indexOf(e)&&d.push(e)}));const h=[];let p=!1;const f=()=>{let t=L0(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=()=>{const e=f(),t=e.length;let n,r=!1;const i="function"==typeof l?l({brush:s}):l;for(let r=0;r<t;r++){if(n=e[r].data,!n)continue;e[r].__style||(e[r].__style={},d.forEach((t=>{e[r].__style[t]=e[r][t]})));const t=s.containsMappedData(n,i,a),o=h.indexOf(e[r]);let l=!1;t&&-1===o?(h.push(e[r]),l=!0):t||-1===o||(h.splice(o,1),l=!0),e[r].needToUpdate=l||p,e[r].isActive=t}for(let i=0;i<t;i++)if(n=e[i].data,n){if(e[i].needToUpdate){const t=cY({},e[i],e[i].__style),n=e[i].isActive;d.forEach((r=>{e[i][r]=n&&r in c?"function"==typeof c[r]?c[r].call(null,t,h):c[r]:!n&&r in u?"function"==typeof u[r]?u[r].call(null,t,h):u[r]:e[i].__style[r]})),r=!0}delete e[i].needToUpdate}return p=!1,r},g=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,r=f(),i=r.length;for(let e=0;e<i;e++)r[e].data&&(r[e].__style=r[e].__style||{},d.forEach((t=>{r[e].__style[t]=r[e][t],t in u&&(r[e][t]="function"==typeof u[t]?u[t].call(null,r[e]):u[t])})));p=!0,h.length=0,n||e.renderer.render(e.nodes)},y=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,r=f(),i=r.length;for(let e=0;e<i;e++)r[e].__style&&(Object.keys(r[e].__style).forEach((t=>{r[e][t]=r[e].__style[t]})),r[e].__style=void 0);h.length=0,n||e.renderer.render(e.nodes)},v=()=>{if(m()){const 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",y),s.on("update",v),{isActive:()=>s.isActive(),update:()=>{h.length=0,p=!0,m()},cleanUp:function(){s.removeListener("start",g),s.removeListener("end",y),s.removeListener("update",v)}}}function N0(e){let{nodes:t,action:n,chart:r,trigger:i}=e;const o=[];for(let e=0;e<t.length;e++){let n=t[e].data;null!==n&&o.push(n)}!function(e){let{dataPoints:t,action:n,chart:r,trigger:i}=e;if(!i)return;const o=i.data||[""];let 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(let e=0;e<t.length;e++){const n=t[e];n&&o.forEach((e=>{let t=n&&!e?n:n[e];if(t){let e={key:t.source.field};void 0!==t.source.key&&(e.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(e.range={min:t.value[0],max:t.value[1]},a.items.push(e)):(e.value=t.value,s.items.push(e))}}))}i.contexts.forEach((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 j0(e){let{collisions:t,t:n,config:r,action:i}=e,o=[],a=!1;t.length>0&&(o=t,a=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));const s=o.map((e=>e.node));return N0({nodes:s,action:i,chart:r.chart,data:r.data,trigger:n}),a}function z0(e,t,n){const r=n.element().getBoundingClientRect();let i=fY(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&&fY(e)?i={cx:i.x,cy:i.y,r:t.touchRadius}:t.mouseRadius>0&&!fY(e)&&(i={cx:i.x,cy:i.y,r:t.mouseRadius}),n.itemsAt(i))}function F0(e,t,n){return e?"function"==typeof e?e(t):e:n}const W0={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontStyle:"font-style",textDecoration:"text-decoration",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 $0(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?"M".concat(r.x," ").concat(r.y):"L".concat(r.x," ").concat(r.y),n+=" "}return t&&(n+="Z"),n}function B0(e,t,n,r){const 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 H0(e){return-e/180*Math.PI}function V0(e){return function(e){let 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}}(H0(e))}function G0(e,t){return{x:e.x+t.x,y:e.y+t.y}}function U0(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Y0(e,t){return{x:e.x*t,y:e.y*t}}function K0(e,t){return e.x-t.x}function X0(e,t){return e.y-t.y}function J0(e,t){return K0(e,t)**2+X0(e,t)**2}function Z0(e,t){return Math.sqrt(J0(e,t))}function Q0(e,t){return e.x*t.x+e.y*t.y}function e1(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const r=Math.cos(t),i=Math.sin(t),o=U0(e,n);return G0({x:r*o.x-i*o.y,y:i*o.x+r*o.y},n)}const t1={up:0,down:180,left:90,right:-90};function n1(e){let{x:t,y:n,size:r}=e;const i=r/2;return{type:"rect",x:t-i,y:n-i,width:r,height:r}}const r1=EK();r1.add("circle",(function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}})),r1.add("diamond",(function(e){const t=e.size,n=e.x-t/2,r=e.y-t/2;return{type:"path",fill:"black",d:$0([{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}])}})),r1.add("saltire",(function(e){const t=H0(45),n=e.size/2,r=isNaN(e.width)?n/2:e.width,i=Math.min(r,n);let o=e.size;const a=Math.sin(Math.asin(-t))*(i/2);o+=2*(n/Math.sin(-t)-n),o-=2*a;const s={x:e.x,y:e.y},l=B0(e.x,e.y,o,i).map((e=>e1(e,t,s)));return{type:"path",fill:"black",d:$0(l)}})),r1.add("square",(function(e){const t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}})),r1.add("triangle",(function(e){const t=e.size,n={x:e.x,y:e.y},r=t1[e.direction]||0,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}];const l=H0(r);return s=s.map((e=>e1(e,l,n))),{type:"path",fill:"black",d:$0(s)}})),r1.add("line",(function(e){const 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:n1(e)}})),r1.add("star",(function(e){const 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;for(let t=1;t<=i;t++){const i=s*t+a,l=H0(i),c=H0(i+s/2),u=Math.sin(l),d=Math.cos(l),h=Math.sin(c),p=Math.cos(c);n.push({x:e.x+d*r,y:e.y+u*r}),n.push({x:e.x+p*o,y:e.y+h*o})}return{type:"path",fill:"black",d:$0(n)}})),r1.add("n-polygon",(function(e){const 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;for(let a=1;a<=r;a++){const r=H0(i*a+o),s=Math.sin(r),l=Math.cos(r);t.push({x:e.x+l*n,y:e.y+s*n})}return{type:"path",fill:"black",d:$0(t)}})),r1.add("cross",(function(e){const 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:$0(B0(t,n,e.size,o))}})),r1.add("bar",(function(e){const t={x:e.x,y:e.y},n="vertical"===e.direction,r=e.size/2,i=r/2/2;let 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){const e=H0(90);o=o.map((n=>e1(n,e,t)))}const a=xY(o);return a.type="rect",a.fill="black",a})),r1.add("rect",(function(e){const{x:t,y:n,size:r}=e,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}})),r1.add("image",(function(e){const{x:t,y:n}=e,{width:r,height:i,imageSrc:o,position:a,symbol:s,imageScalingFactor:l}=e.imageSettings||{};return{type:"image",x:t,y:n,width:r,height:i,src:o,symbol:s,r:10,cx:0,cy:0,imageScalingFactor:l,imagePosition:a}}));const i1=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r1;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=e.get(t.type);if(n){const e=n(t);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach((n=>{void 0!==W0[n]&&"transform"!==n&&(e[n]=t[n])}))}(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function o1(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{dock:n="center",displayOrder:r=0,prioOrder:i=0,preferredSize:o=0,minimumLayoutMode:a,show:s=!0}=e;n=n||"center";return{computePreferredSize(e){let{inner:n,outer:r,children:i}=e;return"function"==typeof o?o({inner:n,outer:r,children:i,dock:this.dock()},t):o},dock(e){return void 0!==e?(n=e,this):"function"==typeof n?n(t):n},displayOrder(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},prioOrder(e){return void 0!==e?(i=e,this):"function"==typeof i?i(t):i},minimumLayoutMode(e){return void 0!==e?(a=e,this):"function"==typeof a?a(t):a},show(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s}}}function a1(e,t,n){const{require:r=[]}=t,i=t.mediator||{},{settings:o,formatter:a,scale:s,data:l,renderer:c,chart:u,dockConfig:d,mediator:h,instance:p,rect:f,style:m,registries:g,resolver:y,update:v,_DO_NOT_USE_getInfo:b,symbol:x,isVisible:w}=n;e.emit=()=>{},w&&(e.isVisible=w),Object.defineProperty(e,"settings",{get:o}),Object.defineProperty(e,"data",{get:l}),Object.defineProperty(e,"formatter",{get:a}),Object.defineProperty(e,"scale",{get:s}),Object.defineProperty(e,"mediator",{get:h}),Object.defineProperty(e,"style",{get:m}),Object.defineProperty(e,"registries",{get:g}),f&&Object.defineProperty(e,"rect",{get:f}),b&&(e._DO_NOT_USE_getInfo=b),Object.keys(t).forEach((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((e=>e===r))||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])})),r.forEach((t=>{"renderer"===t?Object.defineProperty(e,"renderer",{get:c}):"chart"===t?Object.defineProperty(e,"chart",{get:u}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:d}):"instance"===t?Object.defineProperty(e,"instance",{get:p}):"update"===t&&v?Object.defineProperty(e,"update",{get:v}):"resolver"===t?Object.defineProperty(e,"resolver",{get:y}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:x})})),Object.keys(i).forEach((t=>{e.mediator.on(t,i[t].bind(e))}))}function s1(e,t,n){const r=t=>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 l1(e,t,n){Object.keys(n.on||{}).forEach((r=>{e.eventListeners=e.eventListeners||[];const 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(e,...r)}}function c1(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{defaultSettings:n={},_DO_NOT_USE_getInfo:r=()=>({})}=e,{chart:i,container:o,mediator:a,registries:s,theme:l,renderer:c}=t,u=n0.mixin({});let d,h,p,f,m,g=t.settings||{},y=cY(!0,{},n,g),v=[],b=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:T0,n={};return{resolve:function(r){let{data:i,settings:o,defaults:a={},scaled:s}=r;const l=n.norm=t.normalizeSettings(o,a,e.chart),c={scale:e.chart.scale,formatter:e.chart.formatter};s&&Object.keys(s).forEach((e=>{l[e]&&t.updateScaleSize(l,e,s[e])}));const u=[];if(!i||!Array.isArray(i.items)){const e={data:i,resources:c};let r=t.resolveForItem(e,n.norm,-1);return{settings:n.norm,item:r}}{let e;for(let r=0,o=i.items.length;r<o;r++){e={datum:i.items[r],data:i,resources:c};let o=t.resolveForItem(e,n.norm,r);o.data=i.items[r],u.push(o)}}return{settings:n.norm,items:u}}}}({chart:i}),x=!1;const w={nodes:[],chart:i,config:y.brush||{},renderer:null},S={tap:[],over:[]},C=[],M={},k=cY({},g);function E(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const i=void 0!==e[t],o=void 0!==g[t];let a;for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return i&&("function"==typeof e[t]?a=e[t].call(M,...l):r&&(a=e[t])),o&&("function"==typeof g[t]?a=g[t].call(k,...l):r&&(a=g[t])),i||o||(a=n.call(M,...l)),a}}const _=E("preferredSize",(()=>0),!0),R=E("resize",(e=>{let{inner:t}=e;return t})),I=E("created"),D=E("beforeMount"),A=E("mounted"),P=E("beforeUnmount"),O=E("beforeUpdate"),T=E("updated"),L=E("beforeRender"),q=E("beforeDestroy"),N=E("destroyed"),j=e.render,z=()=>{y.brush&&(y.brush.consume||[]).forEach((e=>{e.context&&e.style&&C.push(q0(w,e))}))},F=()=>{y.brush&&(y.brush.trigger||[]).forEach((e=>{"over"===e.on?S.over.push(e):S.tap.push(e)}))};Object.defineProperty(w,"data",{get:()=>v});const W=y.renderer||e.renderer,$=W?c||s.renderer(W)():c||s.renderer()();"function"==typeof $.settings&&$.settings(y.rendererSettings),w.renderer=$;const B={resources:i.logger?{logger:i.logger()}:{}};let H=o1(s1(y,_,i.logger()),B);const V=e=>{e.key=y.key,e.element=$.element()},G=()=>{};G.dockConfig=()=>H,G.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(g=e.settings,y=cY(!0,{},n,e.settings),H=o1(s1(y,_,i.logger()),B),w.config=y.brush||{}),y.scale&&(d=i.scale(y.scale)),y.data){const{rendererSettings:e}=y,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=hZ(y.data,{dataset:i.dataset,collection:i.dataCollection},{logger:i.logger()},i.dataCollection);t?t.isFirst?(v=n,v.items&&(v.items=[...n.items])):v.items&&(v.items=[...v.items,...n.items||[]]):v=n}else v=d?d.data():[];"string"==typeof y.formatter||"object"==typeof y.formatter?h=i.formatter(y.formatter):d&&d.data().fields&&(h=d.data().fields[0].formatter()),m=l.style(y.style||{})},G.resize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=R({inner:e,outer:t});f=n?$.size(n):$.size(e),k.rect=cY(!0,{computedPhysical:f.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),f=cY(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},f)},G.getRect=()=>k.rect;const U=()=>{const e=$.renderArgs?$.renderArgs.slice(0):[],{rendererSettings:t}=y;let n=v;const r="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return v.items&&r&&(n=pY(pY({},v),{},{items:v.items.slice(r.start,r.end)})),e.push({data:n}),e};let Y,K,X;function J(e){const{rendererSettings:t}=y,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?w.nodes=[...e||[]]:w.nodes&&(w.nodes=[...w.nodes,...e||[]]):w.nodes=e}G.beforeMount=D,G.beforeRender=()=>{L({size:f})},G.render=()=>{const e=j.call(M,...U());J(e),$.render(e),Y=e,K=k.rect.computed},G.hide=()=>{G.unmount(),$.size({x:0,y:0,width:0,height:0}),$.clear()},G.beforeUpdate=()=>{O({settings:y,data:v})},G.update=()=>{X&&X.stop();const{rendererSettings:e,brush:t,animations:n}=y;if("function"==typeof(null==e?void 0:e.transform)&&e.transform())return $.render(),void(Y=null);const r=j.call(M,...U());J(r),C.forEach((e=>e.cleanUp())),C.length=0,S.tap=[],S.over=[],t&&(z(),F()),C.forEach((e=>{e.isActive()&&e.update()})),Y&&n&&("function"==typeof n.enabled?n.enabled():n.enabled)?(n.compensateForLayoutChanges&&n.compensateForLayoutChanges({currentNodes:Y,currentRect:k.rect.computed,previousRect:K}),X=function(e,t,n,r){let i,{old:o,current:a}=e,{renderer:s}=t,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},d={nodes:[],ips:[]},h=[],p=null;const f=n.trackBy||R0,m={start(){let e={};if(o.forEach(((t,n)=>{let r=f(t,n);e[r]=t})),a.forEach(((t,n)=>{let r=f(t,n);if(e[r]){if("path"===t.type&&t.points&&t.points.length>0&&"trend"!==t.data.source.key){const n=function(e,t){const n=e.points.filter((e=>!e.dummy)),r=t.points.filter((e=>!e.dummy)),i=r.map((e=>e.data.major.value)),o=n.filter((e=>i.includes(e.data.major.value))).map((e=>e.data.major.value)),a=n.filter((e=>o.includes(e.data.major.value))),s=r.filter((e=>o.includes(e.data.major.value)));return{old:a,current:s}}(e[r],t);d.ips.push(_0(cY({},e[r],{points:n.old}),cY({},t,{points:n.current}))),l.push(cY({},e[r],{commonPoints:n.old}))}else d.ips.push(_0(e[r],t)),l.push(e[r]);d.nodes.push(t),e[r]=!1}else c.nodes.push(t),c.ips.push(_0(cY({},t,{r:.001,opacity:0}),t))})),Object.keys(e).forEach((t=>{e[t]&&(u.nodes.push(e[t]),u.ips.push(_0(e[t],cY({},e[t],{r:1e-4,opacity:0}))))})),h.push({name:"exiting",easing:w0,duration:200,tweens:u.ips,nodes:[...l]}),h.push({name:"updating",easing:C0,duration:400,tweens:d.ips,nodes:[]}),h.push({name:"entering",easing:S0,duration:200,tweens:c.ips,nodes:[...d.nodes]}),n.isMainComponent){var t;const e=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,i=e?l.filter(e).length:l.length,{isInit:o,shouldBeRemoved:a}=r.getValue("animations.updatingStageMeta");!1===o?(r.setValue("animations.updatingStageMeta.shouldBeRemoved",0===i),r.setValue("animations.updatingStageMeta.isInit",!0)):r.setValue("animations.updatingStageMeta.shouldBeRemoved",a&&0===i)}h.length&&(p=s.getScene(a),h[0].started=Date.now(),"undefined"!=typeof window&&(i=window.requestAnimationFrame(m.tick)))},tick(){let e=h[0];e||m.stop(),e.started||(e.started=Date.now());let t=(Date.now()-e.started)/e.duration,o=[],a=e.tweens.map((n=>n(e.easing(Math.min(1,t)))));const{adjustTweenedNodes:l}=n;if(l&&l(a),o.push(...a),o.push(...e.nodes),s.render(o),t>=1){h.shift();const{isInit:e,shouldBeRemoved:t}=r.getValue("animations.updatingStageMeta");h.length?"updating"===h[0].name&&t&&h.shift():(!0===e&&r.setValue("animations.updatingStageMeta.isInit",!1),m.stop())}i&&(i=window.requestAnimationFrame(m.tick))},stop(){i&&(window.cancelAnimationFrame(i),i=!1)},inProgress:()=>!!i,get targetScene(){return p}};return m}({old:Y,current:r},{renderer:$},n,i.storage),X.start()):$.render(r),Y=r,K=k.rect.computed,$.setKey&&"string"==typeof g.key&&$.setKey(g.key)},G.updated=T,G.destroy=()=>{G.unmount(),q(p),$.destroy(),N(),p=null};const Z=e=>{w.nodes=e,C.forEach((e=>{e.isActive()&&e.update()})),$.render(e)};return a1(M,e,{settings:()=>y,data:()=>v,scale:()=>d,formatter:()=>h,renderer:()=>$,chart:()=>i,dockConfig:()=>H,mediator:()=>a,instance:()=>k,rect:()=>k.rect,style:()=>m,update:()=>Z,registries:()=>s,resolver:()=>b,symbol:()=>i1(s.symbol)}),a1(k,g,{settings:()=>y,data:()=>v,scale:()=>d,formatter:()=>h,renderer:()=>$,chart:()=>i,dockConfig:()=>H,mediator:()=>a,style:()=>m,_DO_NOT_USE_getInfo:r.bind(M),isVisible:()=>x}),G.getBrushedShapes=function(e,t,n){const r=[];if(y.brush&&y.brush.consume){const o=i.brush(e),a=$.findShapes("*");y.brush.consume.filter((t=>t.context===e)).forEach((e=>{for(let i=0;i<a.length;i++){const s=a[i];s.data&&o.containsMappedData(s.data,n||e.data,t)&&(V(s),r.push(s),a.splice(i,1),i--)}}))}return r},G.findShapes=e=>{var t;const n=(null!==(t=X)&&void 0!==t&&t.inProgress()?X.targetScene:$).findShapes(e);for(let e=0,t=n.length;e<t;e++)V(n[e]);return n},G.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=$.itemsAt(e);let r;r=t&&"stop"===t.propagation&&n.length>0?[n.pop().node]:n.map((e=>e.node));for(let e=0,t=r.length;e<t;e++)V(r[e]);return r},G.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[];N0({nodes:e,action:t.action||"toggle",trigger:t,chart:i,data:w.data})},G.mount=()=>{p=$.element&&$.element()?p:$.appendTo(o),$.setKey&&"string"==typeof g.key&&$.setKey(g.key),y.brush&&(z(),F()),l1(k,u,g),l1(M,u,e),x=!0},G.mounted=()=>A(p),G.unmount=()=>{[k,M].forEach((e=>{!function(e,t){e.eventListeners&&(e.eventListeners.forEach((e=>{let{event:n,listener:r}=e;t.removeListener(n,r)})),e.eventListeners.length=0),e.emit=()=>{}}(e,u)})),S.tap=[],S.over=[],C.forEach((e=>{e.cleanUp()})),C.length=0,P(),x=!1},G.onBrushTap=e=>{S.tap.forEach((t=>{(function(e){let{e:t,t:n,config:r}=e;return j0({collisions:z0(t,n,r.renderer),t:n,config:r,action:F0(n.action,t,"toggle")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&i.toggleBrushing(!0)}))},G.onBrushOver=e=>{S.over.forEach((t=>{(function(e){let{e:t,t:n,config:r}=e;return j0({collisions:z0(t,n,r.renderer),t:n,config:r,action:F0(n.action,t,"set")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&i.toggleBrushing(!0)}))},G.def=M,G.ctx=k,G.renderer=()=>$,G.set({settings:g}),I(),G}function u1(e){const t=cY(!0,{},e),n={getAll:()=>t,getValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return n;const r=t.split(".");let i=e;for(let e=0;e<r.length;++e){const t=r[e];if(void 0===i[t])return n;i=i[t]}return i}(t,e,n),setValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return;const r=t.split("."),i=r[r.length-1];let o=e;for(let e=0;e<r.length-1;++e){const t=r[e];void 0===o[t]&&(o[t]=Number.isNaN(+r[e+1])?{}:[]),o=o[t]}void 0!==n?o[i]=n:delete o[i]}(t,e,n)};return n}function d1(e,t,n){const r=G0(function(e,t){const n=Q0(e,t)/Q0(t,t)||1;return{x:t.x*n,y:t.y*n}}(U0(n,e),U0(t,e)),e);return r}function h1(e,t,n){return Z0(e,n)+Z0(t,n)-Z0(e,t)<1e-12}function p1(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 f1(e){return e.x1===e.x2&&e.y1===e.y2}function m1(e){return e.width<=0||e.height<=0}function g1(e){return e.r<=0}function y1(e){return e.edges.length<=2}function v1(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=k1(e,wY(t.edges[r])),!0===n)return!0;return!1}function b1(e,t){let n=!1;const{numPolygons:r,polygons:i}=t;for(let t=0;t<r;t++){if(n=T1(e,i[t]),!0===n)return!0}return!1}function x1(e,t){if(g1(e))return!1;return J0({x:e.cx,y:e.cy},t)<=e.r**2}function w1(e,t){if(m1(t)||g1(e))return!1;const 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,c=Math.abs(s-i),u=Math.abs(l-o);if(c>n+a||u>r+a)return!1;if(c<=n||u<=r)return!0;return(c-n)**2+(u-r)**2<=a**2}function S1(e,t){if(g1(e)||f1(t))return!1;const[n,r]=vY(t);if(x1(e,n)||x1(e,r))return!0;const i={x:e.cx,y:e.cy},o=d1(n,r,i);return J0(o,i)<=e.r**2&&h1(n,r,o)}function C1(e,t){if(y1(t)||g1(e))return!1;if(M1(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let r=0;r<n;r++){if(S1(e,wY(t.edges[r])))return!0}return!1}function M1(e,t){if(y1(e)||!I1(e.boundingRect(),t))return!1;const{x:n,y:r}=t,i=e.vertices;let o,a,s,l,c;for(o=!1,l=-1,a=i.length,s=a-1;++l<a;s=l){if(i[l].x===n&&i[l].y===r)return!0;if(i[l].y===i[s].y&&i[l].y===r&&(n-i[l].x)*(n-i[s].x)<=0)return!0;if(i[l].y<r&&r<=i[s].y||i[s].y<r&&r<=i[l].y){if(c=(i[s].x-i[l].x)*(r-i[l].y)/(i[s].y-i[l].y)+i[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function k1(e,t){if(y1(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(A1(t,wY(e.edges[n])))return!0}const[n,r]=vY(t);return M1(e,n)||M1(e,r)}function E1(e,t){if(y1(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(D1(t,wY(e.edges[n])))return!0}const[n,r,i,o]=bY(t);return M1(e,n)||M1(e,r)||M1(e,i)||M1(e,o)}function _1(e,t){return!m1(e)&&!m1(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 R1(e,t){if(m1(e)||m1(t))return!1;return[{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((t=>I1(e,t)))}function I1(e,t){return!m1(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function D1(e,t){if(f1(t)||m1(e))return!1;const[n,r]=vY(t);if(I1(e,n)||I1(e,r))return!0;const i=bY(e);let o=i.length;for(let e=0;e<o;e++){if(A1(wY([i[e],i[3!==e?e+1:0]]),t))return!0}return!1}function A1(e,t){const[n,r]=vY(e),[i,o]=vY(t),a=K0(r,n),s=X0(r,n),l=K0(o,i),c=X0(o,i),u=K0(n,i),d=X0(n,i);let h=c*a-l*s;const p=l*d-c*u,f=a*d-s*u;let m,g;if(0===a&&0===s)return!1;if(0===l&&0===c)return!1;if(0===h){if(0===p&&0===f){if(0===a){if(0===s)return n.x===r.x&&n.y===r.y;m=X0(i,n)/s,g=X0(o,n)/s}else m=(i.x-n.x)/a,g=(o.x-n.x)/a;return!(m<0&&g<0||m>1&&g>1)}return!1}const y=p/h;return h=f/h,y>=0&&y<=1&&h>=0&&h<=1}function P1(e,t){if(f1(e))return!1;const[n,r]=vY(e);return h1(n,r,t)}function O1(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!_1(n,r)&&(R1(n,r)?v1(e,t):v1(t,e))}function T1(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!_1(n,r)&&(R1(r,n)?function(e,t){let n=!1;const{numPolygons:r,polygons:i}=e;for(let e=0;e<r;e++)if(n=O1(t,i[e]),!0===n)return!0;return!1}(e,t):function(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=N1(e,wY(t.edges[r])),!0===n)return!0;return!1}(e,t))}function L1(e,t){if(g1(e))return!1;if(q1(t,{x:e.cx,y:e.cy}))return!0;const{numPolygons:n,polygons:r}=t;for(let t=0;t<n;t++){const n=r[t],i=n.edges.length;for(let t=0;t<i;t++){if(S1(e,wY(n.edges[t])))return!0}}return!1}function q1(e,t){if(!I1(e.boundingRect(),t))return!1;const{x:n,y:r}=t,i=e.numPolygons;let o,a,s,l,c,u,d=!1;for(a=0;a<i;a++)for(o=e.vertices[a],c=-1,s=o.length,l=s-1;++c<s;l=c){if(o[c].x===n&&o[c].y===r)return!0;if(o[c].y===o[l].y&&o[c].y===r&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<r&&r<=o[l].y||o[l].y<r&&r<=o[c].y){if(u=(o[l].x-o[c].x)*(r-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(d=!d)}}return d}function N1(e,t){const[n,r]=vY(t);if(q1(e,n)||q1(e,r))return!0;const{numPolygons:i,polygons:o}=e;for(let e=0;e<i;e++){const n=o[e];for(let e=0,r=n.edges.length;e<r;e++){if(A1(t,wY(n.edges[e])))return!0}}return!1}function j1(e,t){const[n,r,i,o]=bY(t);if(q1(e,n)||q1(e,r)||q1(e,i)||q1(e,o))return!0;const{numPolygons:a,polygons:s}=e;for(let e=0;e<a;e++){const n=s[e];for(let e=0,r=n.edges.length;e<r;e++){if(D1(t,wY(n.edges[e])))return!0}}return!1}const z1=/^\$/,F1="@extend";function W1(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function $1(e,t,n){if("string"==typeof e){let r=t[e];return-1!==n.indexOf(e)&&W1(e),z1.test(r)?(n.push(e),$1(r,t,n)):r}let r=e;const i=cY(!0,{},t,e),o={};if(e[F1]){const o=e[F1];-1!==n.indexOf(o)&&W1(o);let a=n.slice();a.push(o),r=cY(!0,{},$1(i[o],t,a),e)}return Object.keys(r).forEach((e=>{let t=n.slice();if(e===F1||z1.test(e))return;o[e]=r[e];let a=o[e];z1.test(a)&&a in i?(-1!==n.indexOf(a)&&W1(a),t.push(a),a=i[a],"object"==typeof a||z1.test(a)&&a in i?o[e]=$1(a,i,t):o[e]=a):"object"==typeof a&&(o[e]=$1(a,i,t))})),o}function B1(e,t){return $1(e,t,[])}function H1(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e;const r=e=>{e.forEach((e=>{const n=Array.isArray(e.colors[0])?e.colors:[e.colors];t[e.key]={colors:n,sizes:n.map((e=>e?e.length:0))}}))},i={palette:(e,n)=>((e,n)=>{const r=t[e];if(!r)return[];const i=r.sizes;for(let e=0;e<i.length;e++)if(n<=i[e])return r.colors[e];return r.colors[i.length-1]})(e,n),setPalettes:r,style:e=>B1(e,n),setStyle:t=>{n=cY({},e,t)}};return r(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),i}function V1(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 G1(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return cY(!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 U1(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 Y1(e,t,n){if(void 0===e.cachedSize){const r=e.config.dock();let i,o=e.comp.preferredSize({inner:t,outer:n,dock:r});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},i="top"===r||"bottom"===r?o.height:"right"===r||"left"===r?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(i),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function K1(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 X1(e,t){const 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 J1(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);const 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);const i=e.height-(t.y+t.height);i<n.bottom&&(t.height-=n.bottom-i)}function Z1(e,t,n,r,i){const o=cY({},t),a=cY({},n);K1(o,r),X1(a,r),J1(e,o,a);const s=function(e,t,n){const 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);return!!s&&(K1(t,r),X1(n,r),!0)}function Q1(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 e2(e){return xY([].concat(...e.map(bY)))}function t2(e){let{visible:t,layoutRect:n,reducedRect:r,containerRect:i,translation:o}=e;const a=U1(r.x,r.y,r.width,r.height),s=U1(r.x,r.y,r.width,r.height),l={},c=t.slice(),u=c.slice().sort(((e,t)=>e.config.displayOrder()-t.config.displayOrder()));return t.sort(((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;const n=e.config.displayOrder()-t.config.displayOrder();return 0===n?c.indexOf(e)-c.indexOf(t):n})).forEach((e=>{let t={},c={};switch(e.config.dock()){case"top":t.height=c.height=e.cachedSize,t.width=n.width,c.width=a.width,t.x=n.x,c.x=a.x,t.y=c.y=a.y-e.cachedSize,a.y-=e.cachedSize,a.height+=e.cachedSize;break;case"bottom":t.x=n.x,c.x=a.x,t.y=c.y=a.y+a.height,t.width=n.width,c.width=a.width,t.height=c.height=e.cachedSize,a.height+=e.cachedSize;break;case"left":t.x=c.x=s.x-e.cachedSize,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.x-=e.cachedSize,s.width+=e.cachedSize;break;case"right":t.x=c.x=s.x+s.width,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.width+=e.cachedSize;break;case"center":t.x=c.x=r.x,t.y=c.y=r.y,t.width=c.width=r.width,t.height=c.height=r.height;break;default:if(e.referencedDocks.length>0){const n=e.referencedDocks.map((e=>l[e])).filter((e=>!!e));n.length>0&&(t=e2(n.map((e=>e.outerRect))),c=e2(n.map((e=>e.r))))}}e.key&&(l[e.key]={r:c,outerRect:t}),function(e,t,n,r){const i={x:r.width/n.width,y:r.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const e=i.x<i.y,t=Math.min(i.x,i.y);i.x=t,i.y=t;const a=e?"height":"width",s=(r[a]-n[a]*i.x)*n.align;o.left=e?0:s,o.top=e?s:0}e.scaleRatio=i,e.margin=o,t.scaleRatio=i,t.margin=o,n.scaleRatio=i,n.margin=o}(c,t,n,i),c.edgeBleed=e.edgeBleed,c.computed=Q1(c),t.edgeBleed=e.edgeBleed,t.computed=Q1(t),c.x+=o.x,c.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(c,t),e.cachedSize=void 0,e.edgeBleed=void 0})),u}function n2(e,t,n){const r=e.layoutModes||{},i=t.minimumLayoutMode();let o=t.show();return o&&"object"==typeof 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 r2(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 i2(e){let t=G1(e);const n={};return n.layout=function(e){let 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:[]};const{logicalContainerRect:r,containerRect:i}=function(e,t){const 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),V1(r),V1(n),{logicalContainerRect:r,containerRect:n}}(e,t),[o,a]=function(e,t,n){const r=[],i=[];for(let o=0;o<e.length;++o){const a=e[o];r2(a);let s=a.dockConfig;const l=a.key,c=s.dock(),u=/@/.test(c)?c.split(",").map((e=>e.replace(/^\s*@/,""))):[];n2(t,s,n)?r.push({comp:a,key:l,config:s,referencedDocks:u}):i.push({comp:a,key:l,config:s,referencedDocks:u})}return[r,i]}(n,t,r),s=function(e){let{layoutRect:t,visible:n,hidden:r,settings:i}=e;const o=U1(t.x,t.y,t.width,t.height),a={left:0,right:0,top:0,bottom:0},s=n.slice();s.sort(((e,t)=>e.config.prioOrder()-t.config.prioOrder()));for(let e=0;e<s.length;++e){const n=s[e];Y1(n,o,t),Z1(t,o,a,n,i)||(r.push(s.splice(e,1)[0]),--e)}!function(e,t){if(0!==t.length)for(let n=0;n<e.length;++n){let r=e[n];if(r.referencedDocks.length){const i=r.referencedDocks.every((e=>t.some((t=>t.key===e))));i&&t.push(e.splice(n,1)[0])}}}(n,r);const l=n.filter((e=>-1!==s.indexOf(e)));return n.length=0,n.push(...l),J1(t,o,a),o}({layoutRect:r,visible:o,hidden:a,settings:t}),l=t2({visible:o,layoutRect:r,reducedRect:s,containerRect:i,translation:{x:e.x,y:e.y}});return a.forEach((e=>{e.comp.visible=!1;const t=U1();e.comp.resize(t,t)})),{visible:o.map((e=>e.comp)),hidden:a.map((e=>e.comp)),ordered:l.map((e=>e.comp))}},n.settings=function(e){t=G1(e)},n}const o2=(e,t)=>{for(let n=0;n<e.length;n++){const r=e[n];if(r.hasKey&&r.key===t)return e[n]}return null},a2=e=>null==e?void 0:e.map((e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(pY(pY({},n),{},{children:a2(e.children)}))}})),s2=(e,t)=>({visible:[],hidden:t,ordered:[]}),l2=e=>(t,n)=>{var r;const i=n.map(((e,t)=>{const n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:t=>n.computePreferredSize(pY(pY({},t),{},{children:a2(e.children)}))}})),o=e=>n[e.index],{visible:a=i,hidden:s=[],ordered:l=a}=null!==(r=e(t,i))&&void 0!==r?r:{};return{visible:a.map(o),hidden:s.map(o),ordered:l.map(o)}},c2=e=>"function"==typeof e?l2(e):(e=>{const t=i2(e);return l2(((e,n)=>t.layout(e,n)))})(e);function u2(e,t,n){const r=t.left-n.left,i=t.top-n.top,o=SY(e),a=cY(!0,{},e);switch(o){case"circle":a.cx+=r,a.cy+=i;break;case"polygon":for(let e=0,t=a.vertices.length;e<t;e++){const t=a.vertices[e];t.x+=r,t.y+=i}break;case"geopolygon":for(let e=0;e<a.vertices.length;e++){const t=a.vertices[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n.x+=r,n.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 d2(e,t){const n=[];let r=0;t.forEach((e=>{n.push(r),r++;const t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(r+=t.length)})),t.forEach(((t,r)=>((e,t,n)=>{const r=t.instance.renderer().element();if(isNaN(n)||!r||!e||!e.children)return;const i=e.children[Math.max(0,n)];if(r===i)return;const o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==i?(e.insertBefore(r,i),o&&o.forEach((t=>{e.insertBefore(t,r)}))):(o&&o.forEach((t=>{e.appendChild(t,r)})),e.appendChild(r))})(e,t,n[r])))}function h2(e,t){let{element:n,data:r=[],settings:i={},on:o={}}=e;const a=t.registries,s=t.logger,l=H1(t.style,t.palettes),c=[],u=cY({},e),d=function(){const e={};return n0.mixin(e),e}();let h=[],p=null,f=null,m=null,g=[],y=()=>{},v=()=>{};const b={};let x=!1;const w=function(e){let{createComponent:t}=e;const n={};let r=[],i=[];const o=e=>{const n=t(e);return n&&(r.push(n),e.components&&(n.children=e.components.map((e=>o(e))).filter((e=>!!e)))),n},a=e=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)},s=(e,t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n],i=t.find((e=>r.hasKey&&r.key===e.key));i?r.children&&i.components&&s(r.children,i.components):(e.splice(n,1),a(r),r.children&&s(r.children,[]),r.instance.destroy())}},l=e=>{let{compList:t,data:n,excludeFromUpdate:r,formatters:i,scales:a,settingsList:s}=e;return s.map((e=>{const s=o2(t,e.key);return r.indexOf(e.key)>-1?(delete s.updateWith,s):s?(e.rendererSettings&&"function"==typeof s.instance.renderer().settings&&s.instance.renderer().settings(e.rendererSettings),e.rendererSettings&&"function"==typeof e.rendererSettings.transform&&e.rendererSettings.transform()?(s.applyTransform=!0,s):(s.updateWith={formatters:i,scales:a,data:n,settings:e},e.components&&(s.children=l({compList:s.children||[],data:n,excludeFromUpdate:r,formatters:i,scales:a,settingsList:e.components})),s)):o(e)})).filter((e=>!!e))},c=e=>{let{components:t,hidden:n,layoutFn:r,ordered:i,rect:o,visible:a}=e;const{visible:s,hidden:l,ordered:u}=r(o,t);a.push(...s),n.push(...l),i.push(...u),s.forEach((e=>{if(e.children){var t,r;const o=c2(null!==(t=null===(r=e.settings)||void 0===r?void 0:r.strategy)&&void 0!==t?t:{});c({components:e.children,hidden:n,layoutFn:o,ordered:i,rect:e.instance.getRect(),visible:a})}})),l.forEach((e=>{e.children&&c({components:e.children,hidden:n,layoutFn:s2,ordered:i,rect:null,visible:a})}))};return n.destroy=()=>{r.forEach((e=>e.instance.destroy())),r=[],i=[]},n.findComponentByKey=e=>o2(r,e),n.forEach=e=>{r.forEach(e)},n.layout=e=>{let{layoutSettings:t,rect:n}=e;const r=[],o=[],a=[],s=c2(t);return c({components:i,hidden:o,layoutFn:s,ordered:a,rect:n,visible:r}),{visible:r,hidden:o,ordered:a}},n.set=e=>{let{components:t}=e;i=t.map((e=>o(e))).filter((e=>!!e))},n.update=e=>{let{components:t,data:n,excludeFromUpdate:r,formatters:o,scales:a}=e;s(i,t),i=l({compList:i,data:n,excludeFromUpdate:r,formatters:o,scales:a,settingsList:t})},n}({createComponent:e=>{if(!a.component.has(e.type))return s.warn("Unknown component: ".concat(e.type)),!1;return{instance:c1(a.component(e.type),{settings:e,chart:u,mediator:d,registries:a,theme:l,container:n}),settings:cY(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function S(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const r="function"==typeof e[t];let i;for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return i=r?e[t].call(u,...a):n.call(u,...a),i}}const C=()=>{let e;i.dockLayout?(s.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=i.dockLayout):e=i.strategy;const t=function(e){if("function"==typeof e.getBoundingClientRect){const{width:t,height:n}=e.getBoundingClientRect();return{x:0,y:0,width:t,height:n}}return{x:0,y:0,width:0,height:0}}(n);return w.layout({layoutSettings:e,rect:t})},M=S("created"),k=S("beforeMount"),E=S("mounted"),_=S("beforeUpdate"),R=S("updated"),I=S("beforeRender"),D=S("beforeDestroy"),A=S("destroyed"),P=function(e,t){let{partialData:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{formatters:r={},scales:i={},scroll:o={}}=t;y=function(e,t){let{types:n,logger:r}=t;const i={},o=[];return Array.isArray(e)?o.push(...e):(r.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach(((e,t)=>{let o=n(e.type);if(o){let n=e.key;void 0===e.key&&(r.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),n=t);let a=o({key:n,data:e.data,config:e.config});i[n]=a}})),e=>e?i[e]:i[Object.keys(i)[0]]}(e,{logger:s,types:a.data}),n||Object.keys(b).forEach((e=>b[e].clear())),t.palettes&&l.setPalettes(t.palettes),t.style&&l.setStyle(t.style),v=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:hZ;const i={};return(e||[]).forEach((e=>{if(!e.key)throw new Error('Data collection is missing "key" property');if("object"==typeof e.data&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");i[e.key]=()=>r(e.data,t,n)})),e=>{let t,n;if("string"==typeof e?t=e:"object"==typeof 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]());let r=i[t];if(n&&n.fields&&n.fields.filter){let e=r.fields.filter(n.fields.filter);r.fields.length!==e.length&&(r=cY(r,{fields:e}))}return r}}(t.collections,{dataset:y},{logger:s});const c={theme:l,logger:s};p=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ZQ;const i={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof 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(){return Object.keys(e).forEach(this.get),i}}}(i,{dataset:y,collection:v},pY(pY({},c),{},{scale:a.scale})),f=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:pZ;const i={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"formatter"in o&&e[o.formatter]?a=o.formatter:"object"==typeof 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(){return Object.keys(e).forEach(this.get),i}}}(r,{dataset:y,collection:v},pY(pY({},c),{},{formatter:a.formatter})),m=function(e,t){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=i0(e[r],t?t[r]:null));return n}(o,m)};function O(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},r=e.filter((e=>!!e.key)).map((e=>e.key));g.forEach((e=>{e.key&&-1!==r.indexOf(e.key)?t[e.key]=e:e.destroy()})),g=e.map((e=>{const r=e.key&&t[e.key]?t[e.key]:a.interaction(e.type)(u,d,n);return r.set(e),r}))}const T=e=>{const 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 h.forEach((e=>{const t=e.instance.getRect();I1(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},L=()=>{if(c.length||!n)return;Object.keys(o).forEach((e=>{const t=o[e].bind(u);n.addEventListener(e,t),c.push({key:e,listener:t})}));const e={},t=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=T(e)},r=t=>{const n=e.comps||T(t);if(!n.every((e=>e.instance.def.disableTriggers))&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=fY(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(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),x){x=!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:e=>{const t=T(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),x){x=!1;break}}}}),i.forEach((e=>{n.addEventListener(e.key,e.listener),c.push(e)}))},q=()=>{c.forEach((e=>{let{key:t,listener:r}=e;return n.removeEventListener(t,r)})),c.length=0},N=()=>{n.innerHTML="",(()=>{const{components:e=[]}=i;I(),P(r,i),w.set({components:e});const{visible:t,hidden:o,ordered:a}=C();h=t,o.forEach((e=>{e.instance.hide(),e.visible=!1})),t.forEach((e=>e.instance.beforeMount())),t.forEach((e=>e.instance.mount())),t.forEach((e=>e.instance.beforeRender())),t.forEach((e=>e.instance.render())),t.forEach((e=>e.instance.mounted())),t.forEach((e=>{e.visible=!0})),d2(n,a)})(),L(),O(i.interactions)};return u.layoutComponents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{excludeFromUpdate:t=[]}=e;e.data&&(r=e.data),e.settings&&(i=e.settings,O(e.settings.interactions)),_(),P(r,i);const{formatters:n,scales:o,components:a=[]}=i;w.update({components:a,data:r,excludeFromUpdate:t,formatters:n,scales:o}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()})),C()},u.update=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{partialData:t,excludeFromUpdate:o=[]}=e;let a;e.data&&(r=e.data),e.settings&&(i=e.settings,O(e.settings.interactions)),_(),P(r,i,{partialData:t});const{formatters:s,scales:l,components:c=[]}=i;w.update({components:c,data:r,excludeFromUpdate:o,formatters:s,scales:l}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()}));const u=[],d=[];let p;if(t)w.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible&&u.push(e)})),p=u;else{const{visible:e,hidden:t,ordered:n}=C();h=e,p=e,a=n,e.forEach((e=>{e.updateWith&&e.visible?u.push(e):d.push(e)})),t.forEach((e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1}))}d.forEach((e=>e.instance.beforeMount())),d.forEach((e=>e.instance.mount())),p.forEach((e=>e.instance.beforeRender())),p.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()})),t||d2(n,a),d.forEach((e=>e.instance.mounted())),u.forEach((e=>e.instance.updated())),h.forEach((e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1})),R()},u.destroy=()=>{D(),w.destroy(),q(),O(),delete u.update,delete u.destroy,A()},u.getAffectedShapes=function(e){let 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 h.filter((e=>null==r||e.key===r)).forEach((r=>{const o=r.instance.getBrushedShapes(e,t,n);i=[...i,...o]})),i},u.findShapes=e=>{let t=[];return h.forEach((n=>{const r=n.instance.findShapes(e);t=[...t,...r]})),t},u.componentsFromPoint=e=>T(e).map((e=>e.instance.ctx)),u.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[];const i=n.getBoundingClientRect();let o=h;if(Array.isArray(t.components)&&t.components.length>0){const e=t.components.map((e=>e.key));o=h.filter((t=>-1!==e.indexOf(t.key))).map((n=>({instance:n.instance,opts:t.components[e.indexOf(n.key)]})))}for(let n=o.length-1;n>=0;n--){const a=o[n],s=u2(e,i,a.instance.renderer().element().getBoundingClientRect()),l=a.instance.shapesAt(s,a.opts),c=l.length>0&&"stop"===t.propagation;if(r=[...r,...l],r.length>0&&c)return r}return r},u.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<t.components.length;n++){const r=t.components[n].key;h.filter((e=>r===e.key)).forEach((r=>{let i=e.filter((e=>e.key===r.key));r.instance.brushFromShapes(i,t.components[n])}))}},u.scroll=function(){return function(e,t){return t[e]||(t[e]=r0()),t[e]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",m)},u.dataset=e=>y(e),u.dataCollection=e=>v(e),u.scales=function(){return p.all()},u.formatters=function(){return f.all()},u.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return b[e]||(b[e]=x0()),b[e]},u.scale=function(e){return p.get(e)},u.formatter=function(e){return f.get(e)},u.toggleBrushing=function(e){x=void 0!==e?e:!x},u.component=e=>{const t=w.findComponentByKey(e);return null==t?void 0:t.instance.ctx},u.logger=()=>s,u.theme=()=>l,u.storage=u1({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(u,"interactions",{get:()=>({instances:g,on(){L(),g.forEach((e=>e.on()))},off(){q(),g.forEach((e=>e.off()))}})}),M(),n&&(k(),N(),E(n),u.element=n),u}const p2=e=>{let t=EK(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var f2=EK();function m2(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}const g2=e=>e.filter((e=>"number"==typeof e&&!isNaN(e)));const y2=e=>{let{key:t,data:n,cache:r,config:i}=e;if(!n)return;let o=n;"string"==typeof o&&(o=(e=>{let{data:t,config:n}=e;const r=t.split("\n"),i=r[0],o=r[1];let a=",";if(n&&n.parse&&n.parse.delimiter)a=n.parse.delimiter;else if(i){const e=[/,/,/\t/,/;/];for(let t=0;t<e.length;t++){const n=e[t];if(i&&o){if(n.test(i)&&n.test(o)&&i.split(n).length===o.split(n).length){a=n;break}}else n.test(i)&&(a=n)}}return r.map((e=>e.split(a)))})({data:n,config:i})),Array.isArray(o)&&function(e){let t,{source:n,data:r,cache:i,config:o}=e,a=r;const s=o&&o.parse;Array.isArray(r[0])?s&&!1===s.headers?t=r[0].map(((e,t)=>t)):(t=r[0],a=r.slice(1)):t=Object.keys(r[0]);const l=!!s&&"function"==typeof s.row&&s.row;let c,u=t;u=s&&"function"==typeof s.fields?s.fields(u.slice()):t.map((e=>({key:e,title:e}))),Array.isArray(r[0])?c=u.map((()=>[])):(c={},u.forEach((e=>{c[e.key]=[]})));for(let e=0;e<a.length;e++){const t=l?l(a[e],e,u):a[e];if(t)if(Array.isArray(t))for(let e=0;e<u.length;e++)c[e].push(t[e]);else for(let e=0;e<u.length;e++)c[u[e].key].push(t[u[e].key])}const d=Array.isArray(c)?e=>c[e]:e=>c[u[e].key];for(let e=0;e<u.length;e++){const t=d(e),r=g2(t),o=r.length>0,a=o?"measure":"dimension",s=o?Math.min(...r):NaN,l=o?Math.max(...r):NaN;i.fields.push(ZJ(cY({source:n,key:e,title:u[e].title,values:t,min:s,max:l,type:a},u[e]),{value:u[e].value,label:u[e].label}))}}({data:o,cache:r,source:t,config:i})};function v2(){let{key:e,data:t,config:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[]},i={key:()=>e,raw:()=>t,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];for(let t=0;t<n.fields.length;t++)if(n.fields[t].key()===e)return n.fields[t];for(let t=0;t<n.fields.length;t++)if(n.fields[t].title()===e)return n.fields[t];return null}(e,{cache:r}),fields:()=>r.fields.slice(),extract:e=>function(e,t){const n=Array.isArray(e)?e:[e];let r=[];return n.forEach((e=>{if(void 0!==e.field){const n=t.field(e.field),i=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));const{props:o,main:a}=rZ(e,t),s=Object.keys(o),l=!!e.trackBy,c=typeof e.trackBy,u={},d=[],h=n.items(),p=[];for(let t=0;t<h.length;t++){const n=h[t];if(a.filter&&!a.filter(n))continue;const r=m2(a,n,{key:i});s.forEach((e=>{const a=o[e];let s=a.field?a.field.items()[t]:n;r[e]=m2(a,s,{key:i})})),l&&aZ({cfg:e,itemData:n,obj:r,target:d,tracker:u,trackType:c}),p.push(r)}r=l?[...r,...oZ(d,{main:a,propsArr:s,props:o})]:[...r,...p]}})),r}(e,i),hierarchy:()=>null};return y2({key:e,data:t,config:n,cache:r}),i}v2.util={normalizeConfig:rZ,collect:oZ,track:aZ};const b2=EK();b2.default("matrix"),b2("matrix",v2),b2("default",v2);const x2=EK();function w2(e,t,n){return Math.max(e,Math.min(t,n))}function S2(e){let{item:t,value:n,boxCenter:r,rendWidth:i,rendHeight:o,flipXY:a,symbol:s}=e,l="x",c="y",u=i,d=o,h=n<.5?90:-90;return a&&(l="y",c="x",u=o,d=i,h=n<.5?180:0),s(cY({},t.oob,{[l]:r*u,[c]:Math.max(t.oob.size/2,Math.min(n*d,d-t.oob.size/2)),startAngle:h}))}function C2(e){let{item:t,boxWidth:n,boxPadding:r,rendWidth:i,rendHeight:o,flipXY:a}=e,s="x",l="y",c="width",u="height",d=i,h=o;a&&(s="y",l="x",c="height",u="width",d=o,h=i);const{actualDiff:p,actualLow:f}=function(e){let{start:t,end:n,minPx:r=.1,maxPx:i=1}=e;const o=Math.max(t,n),a=Math.min(t,n),s=w2(-.1,1.2,o),l=w2(-.1,1.2,a),c=s*i-l*i,u=Math.max(r,c),d=(u-c)/2;return{actualDiff:u,startModifier:d,actualLow:l*i-d}}({start:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:h});return cY({},t.box,{type:"rect",[s]:(r+t.major)*d,[l]:f,[u]:p,[c]:n*d,data:t.data||{},collider:{type:null}})}function M2(e){let{item:t,from:n,to:r,boxCenter:i,rendWidth:o,rendHeight:a,flipXY:s}=e,l="x1",c="y1",u="x2",d="y2",h=o,p=a;return s&&(l="y1",c="x1",u="y2",d="x2",h=a,p=o),cY({},t.line,{type:"line",[d]:Math.floor(n*p),[l]:i*h,[c]:Math.floor(r*p),[u]:i*h,data:t.data||{},collider:{type:null}})}function k2(e){let{item:t,key:n,position:r,width:i,boxCenter:o,rendWidth:a,rendHeight:s,flipXY:l}=e,c="x1",u="y1",d="x2",h="y2",p=a,f=s;l&&(c="y1",u="x1",d="y2",h="x2",p=s,f=a);const m=i/2;return cY({type:"line"},t[n],{[u]:Math.floor(r*f),[c]:(o-m)*p,[h]:Math.floor(r*f),[d]:(o+m)*p,r:m*p,cx:o*p,cy:r*f,width:i*p,data:t.data||{},collider:{type:null}})}function E2(e,t,n){const{width:r,maxWidthPx:i,minWidthPx:o}=t.box,a=e>=0?1:-1;let s=Math.min(a*e*r,isNaN(i)?n:i/n);return s=isNaN(o)?s:Math.max(o/n,s),s*a}x2("native",(function(e,t,n){let 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((e=>{const t=r.events[e].bind(o);n.addEventListener(e,t),a.push({key:e,listener:t})}))}function c(){a.forEach((e=>{let{key:t,listener:r}=e;n.removeEventListener(t,r)})),a=[]}return{get key(){return i},set(e){!function(e){i=e.key,r=e,r.events=r.events||[],void 0===r.enable&&(r.enable=!0)}(e),c(),s&&l()},off(){s=!1,c()},on(){s=!0,0===a.length&&l()},destroy(){c(),o=null,r=null}}}));const _2={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}},R2=Object.keys(_2),I2={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(e){let{data:t}=e;const{width:n,height:r}=this.rect,i="horizontal"===this.settings.settings.orientation,{style:o,resolver:a,symbol:s}=this,l=R2.filter((e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show)),c={};l.forEach((e=>c[e]=_2[e]));const u=function(e){let{keys:t,data:n,defaultSettings:r,style:i,settings:o,width:a,height:s,resolver:l}=e;const c=cY(!0,{},r||{},i||{}),u={major:"horizontal"===o.orientation?s:a,minor:"horizontal"===o.orientation?a:s},d=o.major;let h;h="object"==typeof d&&"object"==typeof d.ref&&void 0!==d.ref.start&&void 0!==d.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:cY(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof d&&void 0!==d.binStart&&void 0!==d.binEnd?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:cY(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:u,defaults:{major:.5},settings:{major:o.major}});const p=o.minor||{},f={};["start","end","min","max","med"].forEach((e=>{(p[e]||n.items&&n.items.length&&n.items[0][e])&&(f[e]={scale:p.scale,ref:e})}));let m,g={major:h,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:cY(!0,{},f,p)})};for(let e=0,r=t.length;e<r;e++)o[m]&&!1===o[m].show||(m=t[e],g[m]=l.resolve({data:n,defaults:c[m],settings:o[m],scaled:u}));return g}({keys:l,data:t,defaultSettings:c,style:o,settings:this.settings.settings,width:n,height:r,resolver:a}),{settings:d,items:h}=u,p=function(e){let{width:t,height:n,flipXY:r,resolved:i,keys:o,symbol:a}=e;const s=[],l=i.major.items;if(!l.length)return s;const c=t,u=n,d=r?n:t,h=i.major.settings,p=["start","end","min","max","med"].filter((e=>void 0!==i.minor.settings[e])),f=p.length,m=o.filter((e=>"oob"!==e));let g,y,v,b,x,w,S,C,M;const k=o?o.length:0,E=m?m.length:0,_={box:function(){v.box&&mY(v.start)&&mY(v.end)&&g.push(C2({item:v,boxWidth:b,boxPadding:x,rendWidth:c,rendHeight:u,flipXY:r}))},line:function(){mY(v.min)&&mY(v.start)&&g.push(M2({item:v,from:v.min,to:v.start,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),mY(v.max)&&mY(v.end)&&g.push(M2({item:v,from:v.max,to:v.end,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},median:function(){v.median&&mY(v.med)&&g.push(k2({item:v,key:"median",position:v.med,width:b,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},whisker:function(){if(v.whisker){const e=b*v.whisker.width;mY(v.min)&&g.push(k2({item:v,key:"whisker",position:v.min,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),mY(v.max)&&g.push(k2({item:v,key:"whisker",position:v.max,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))}}};function R(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let r=0;r<f;r++)e=v[p[r]],mY(e)&&(t<e&&(t=e),n>e&&(n=e));S=t<0&&t!==-Number.MAX_VALUE,C=n>1&&n!==Number.MAX_VALUE,M=S||C}for(let e=0,t=l.length;e<t;e++){g=[],y=null;const t=l[e],n=t.data;let p=null,f=null;void 0!==h.binStart?(p=t.binStart,f=t.binEnd,y=h.binStart.scale):(y=h.major.scale,p=y?t.major:0);let I=0;y?y.bandwidth?(I=y.bandwidth(),p-=I/2):I=f-p:I=1,v=cY({},{major:p,majorEnd:f},i.minor.items[e]);for(let t=0;t<k;t++)v[o[t]]=i[o[t]].items[e];if(b=E2(I,v,d),x=(I-b)/2,w=x+v.major+b/2,R(),M)v.oob&&(S?g.push(S2({item:v,value:0,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:a})):C&&g.push(S2({item:v,value:1,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:a})));else for(let e=0;e<E;e++)v[m[e]]&&!1===v[m[e]].show||_[m[e]]();const D={type:"container",data:n,collider:{type:"bounds"},children:g};s.push(D)}return s}({width:n,height:r,flipXY:i,resolved:u,keys:l,symbol:s});return p}};const D2={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},A2=/px$/,P2={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},O2={imageSrc:void 0,imageScalingFactor:void 0,position:"center-center",symbol:"rectangle",width:void 0,height:void 0},T2={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function L2(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 q2(e,t,n,r){let{width:i,height:o}=t;return e.filter((e=>!1!==e.show&&!isNaN(e.x+e.y))).map((e=>{let t=e,a=A2.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);gY(a)&&(t=D2,a=n.min+t.size*(n.max-n.min));const[s,l]=function(e){let t=P2.shape,n={};return"object"==typeof e.shape&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),c=pY(pY({},l),{},{type:s,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,imageSettings:t.imageSettings});t===e.errorShape&&(c.width=t.width);const u=r(c);return u.data=e.data,u}))}const N2={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:e=>e.data.value},style:{item:"$shape"}},render(e){let{data:t}=e;const n=this.resolver.resolve({data:t,defaults:cY({},P2,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),{width:r,height:i}=this.rect,o=cY({},T2,this.settings.settings.sizeLimits),a=n.items;a.length>0&&"image"===a[0].shape&&t.items.forEach(((e,t)=>{a[t].imageSettings=cY({},O2,this.settings.settings.imageSettings)}));const s=function(e,t,n,r,i){const o=L2(e?e.scale:void 0,n),a=L2(t?t.scale:void 0,r);let 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,r,i,o);return q2(a,this.rect,s,this.settings.shapeFn||this.symbol)}};const j2={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function z2(e,t,n,r){let{x:i,y:o,width:a,height:s}=t;const l=KY(),c={x:i+a/2,y:o+s/2},u=Math.min(a,s)/2,d=Math.min(a,s)/2,h=d/100;return e.map(((e,t)=>{const i=n[t];i.type="path";const o=d*i.outerRadius,a=u*i.innerRadius,s=h*i.cornerRadius;l.innerRadius(a),l.outerRadius(o),l.cornerRadius(s),i.arcDatum=e;const p=l.centroid(e),f=i.offset?function(e,t,n,r){let[i,o]=e;const a=Math.sqrt(i*i+o*o);i/=a,o/=a;const s=n-r;return{x:i*t*s,y:o*t*s}}(p,i.offset,o,a):{x:0,y:0};return i.transform="translate(".concat(f.x,", ").concat(f.y,") translate(").concat(c.x,", ").concat(c.y,")"),i.desc={share:e.value/r,slice:{start:e.startAngle,end:e.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:c.x+f.x,y:c.y+f.y}}},i}))}function F2(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const W2={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(e){let{data:t}=e;const n=[],r=[],i=this.settings.settings,{items:o}=this.resolver.resolve({data:t,defaults:cY({},j2,this.style.slice),settings:i.slice});let a=0;for(let e=0,t=o.length;e<t;e++){const t=F2(i,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),r.push(o[e]),a+=t)}const s=function(){var e=nK,t=tK,n=null,r=DY(0),i=DY(WY),o=DY(0);function a(a){var s,l,c,u,d,h=a.length,p=0,f=new Array(h),m=new Array(h),g=+r.apply(this,arguments),y=Math.min(WY,Math.max(-WY,i.apply(this,arguments)-g)),v=Math.min(Math.abs(y)/h,o.apply(this,arguments)),b=v*(y<0?-1:1);for(s=0;s<h;++s)(d=m[f[s]=s]=+e(a[s],s,a))>0&&(p+=d);for(null!=t?f.sort((function(e,n){return t(m[e],m[n])})):null!=n&&f.sort((function(e,t){return n(a[e],a[t])})),s=0,c=p?(y-h*b)/p:0;s<h;++s,g=u)l=f[s],u=g+((d=m[l])>0?d*c:0)+b,m[l]={data:a[l],index:s,value:d,startAngle:g,endAngle:u,padAngle:v};return m}return a.value=function(t){return arguments.length?(e="function"==typeof t?t:DY(+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:DY(+e),a):r},a.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:DY(+e),a):i},a.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:DY(+e),a):o},a}().sortValues(null);s.startAngle(i.startAngle),s.endAngle(i.endAngle),s.padAngle(i.padAngle);return z2(s(n),cY({},this.rect,{x:0,y:0}),r,a)}};const $2=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){const n=e[t.type],r=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach((e=>{const 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:e=>e.x1===e.x2||e.y1===e.y2,conditionAppend:e=>e.strokeWidth%2!=0},e.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:e=>e.strokeWidth%2!=0}),Object.keys(e).forEach((t=>{const n=e[t];n.items=[],n.append.forEach((e=>{n.items.push({key:e,type:"append"})})),n.round.forEach((e=>{n.items.push({key:e,type:"round"})}))})),t.multiple=e=>e.forEach((e=>t(e))),t}();class B2{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(e,t){if(t){const t=e.substring(0,1),n=e.substring(1);if("x"===t)return"y".concat(n);if("y"===t)return"x".concat(n);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}transposeCoordinate(e,t,n){if("number"==typeof t&&isFinite(t)){const 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}push(){return this.storage.push(...arguments),this}processItem(e){let t={};const n=void 0!==e.flipXY?e.flipXY:this.flipXY,r=void 0!==e.crisp?e.crisp:this.crisp;if(e.fn&&"function"==typeof e.fn){let r=n?this.height:this.width,i=n?this.width:this.height;e=e.fn({width:r,height:i,flipXY:n});const o=Object.keys(e);for(let r=0,i=o.length;r<i;r++){let i=o[r];t[B2.evaluateKey(i,n)]=e[i]}}else{const r=Object.keys(e);for(let i=0,o=r.length;i<o;i++){let o=r[i];const a=B2.evaluateKey(o,n),s=this.transposeCoordinate(a,e[o],n);t[a]=s}}return r&&$2(t),t}output(){let e=[];for(let t=0,n=this.storage.length;t<n;t++){let n=this.processItem(this.storage[t]);e.push(n)}return e}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function H2(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new B2(...t)}function V2(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const G2={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=H2(),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(){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,P0(this,"x",this.rect.width),P0(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=cY({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=cY({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=V2(this.x,this.rect.width),this.lines.y=V2(this.y,this.rect.height),this.lines.y=this.lines.y.map((e=>cY(e,{flipXY:!0})));let e=e=>{let{dir:t,isMinor:n}=e,r=this.lines[t].filter((e=>!!e.isMinor===n)),i=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:i,data:{items:r,dir:t}}).items.forEach((e=>{let n=e.data;var r,i;e.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:e.stroke||"black",strokeWidth:void 0!==e.strokeWidth?e.strokeWidth:1,strokeDasharray:void 0!==e.strokeDasharray?e.strokeDasharray:void 0,flipXY:n.flipXY||!1,value:null!==(r=n.value)&&void 0!==r?r:null===(i=n.data)||void 0===i?void 0:i.value,dir:t})}))};return e({dir:"x",isMinor:!1}),e({dir:"x",isMinor:!0}),e({dir:"y",isMinor:!1}),e({dir:"y",isMinor:!0}),this.blueprint.output()}};function U2(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===r||"right"===r){let 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 ")}let i="bottom"===r;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(i?t+n:t-n," Z\n ")}function Y2(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===r||"right"===r){let 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 ")}let i="bottom"===r;return t+=i?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(i?t+n:t-n," Z\n ")}function K2(e,t,n){return e<t||e>n}function X2(e,t){if("string"==typeof e.formatter)return t.formatter(e.formatter);if("object"==typeof e.formatter)return t.formatter(e.formatter);if(void 0!==e.scale&&e.scale.data){const t=e.scale.data()&&e.scale.data().fields;return t&&t[0]?t[0].formatter():null}return null}function J2(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;default:return 0}return 0}function Z2(e){var t,n;let{chart:r,blueprint:i,renderer:o,p:a,settings:s,items:l,slopeLine:c}=e,u=!0,d=!1,h=!1,p=!1,f=!1,m=cY(!0,{},s.style.line,a.line||{}),g=cY(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:m.stroke});if(d=c?i.processItem({type:"line",x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:!1,value:a.valueInfo?a.valueInfo.id:a.value}):i.processItem({type:"line",x1:a.position,y1:0,x2:a.position,y2:1,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:a.flipXY||!1,value:a.valueInfo?a.valueInfo.id:a.value}),a.label&&!1!==a.label.show&&(null==c||!c.slope||0===c.slope)){const e=cY(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:m.stroke},a.label);let t,n={width:0,height:0},c="";t=X2(a,r),!1!==a.label.showValue&&(t?c=" (".concat(t(a.value),")"):a.scale&&(c=" (".concat(a.value,")"))),c&&(n=o.measureText({text:c,fontFamily:e.fontFamily,fontSize:e.fontSize}));let d=o.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),g={width:d.width+n.width,height:Math.max(d.height,n.height)},y=e.padding,v=J2(a.flipXY?e.vAlign:e.align),b=J2(a.flipXY?e.align:e.vAlign),x=Math.min(1+g.width+2*y,e.maxWidth*i.width,e.maxWidthPx),w=g.height+2*y,S=a.flipXY?w:x,C=a.flipXY?x:w;if(h=i.processItem({fn:t=>{let{width:n,height:r}=t,o=a.position*n-(a.flipXY?w:x)*(1-v);o=a.flipXY?o:Math.max(o,0);return{type:"rect",x:o,y:Math.max(Math.abs(b*r-C*b),0),width:a.flipXY?S:Math.min(S,i.width-o),height:C,stroke:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.background.opacity}},flipXY:a.flipXY||!1}),h.x<-1||h.x+h.width>i.width+1||h.y<-1||h.y+h.height>i.height+1)h=void 0;else{p={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:h.x+y,y:h.y+h.height/2+g.height/3,maxWidth:h.width-2*y-n.width,anchor:"start"},c&&(f={type:"text",text:c||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:p.x+3+(h.width-(n.width+2*y)),y:p.y});for(let e=0,t=l.length;e<t;e++){let t=l[e];"rect"===t.type?_1(h,t)&&(u=!1):"line"===t.type&&a.flipXY===t.flipXY&&D1(h,t)&&(u=!1)}}}if(d&&l.push(d),c&&0!==c.slope&&(!1!==(null===(t=c.label)||void 0===t?void 0:t.show)||!1!==(null===(n=c.label)||void 0===n?void 0:n.showValue))){var y,v,b;let e,t;const n=120;let s=!1!==(null===(y=c.label)||void 0===y?void 0:y.show)?null===(v=c.label)||void 0===v?void 0:v.text:"";if(!1!==(null===(b=c.label)||void 0===b?void 0:b.showValue)){var x;const t=X2(a,r),n=t?t(c.value):c.value;e="(".concat(c.slope,"x + ").concat(n,")"),s+=null!==(x=c.label)&&void 0!==x&&x.text?" ".concat(e):e}if(s.length>1){var w,S,C;const e=o.measureText({text:s,fontFamily:g.fontFamily,fontSize:g.fontSize});e.width=e.width>n?n:e.width;const a=function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});if(t>0){if(r.max()*t+n>=i.max())return!0}else if(t<0&&r.min()*t+n>=i.max())return!0;return!1}(r,c.slope,c.value)?function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});return r((i.max()-n)/t)}(r,c.slope,c.value):void 0,u=void 0===a||c.isRtl?g.padding:3*g.padding,h=void 0!==a||c.slope>0?3*g.padding:g.padding,p=function(e,t,n,r,i,o){let a=0;if(void 0!==n){if(n<.8)return a=e.slope<0||e.isRtl?3*o.padding:2*o.padding,e.isRtl,n*i.width+a;if(1===n)return e.isRtl?n*i.width-(r.width+3*o.padding):n*i.width-(r.width+6*o.padding);if(n>.8)return e.isRtl?n*i.width-(r.width+3*o.padding):n*i.width-(r.width+6*o.padding)}else if(e.slope>0)return t.x2-(r.width+2*o.padding);return e.isRtl?t.x1-(r.width+2*o.padding):t.x1}(c,d,a,e,i,g),f=Math.min(d.y1,d.y2);null!==(w=c.label)&&void 0!==w&&w.stroke&&(t={type:"rect",x:c.isRtl?Math.max(p,u)-2:Math.max(p,u)+2,y:Math.abs(Math.max(f,h)-e.height),rx:3,ry:3,width:e.width+g.padding,height:e.height-2,stroke:m.stroke,fill:m.stroke});const y={type:"text",text:s,fill:null!==(S=null===(C=c.label)||void 0===C?void 0:C.stroke)&&void 0!==S?S:m.stroke,opacity:g.opacity,fontFamily:g.fontFamily,fontSize:g.fontSize,x:t?t.x+2:Math.max(p,u)+2,y:t?t.y+e.height-g.padding:Math.abs(Math.max(f,h)-g.padding/2),anchor:"start",title:s,maxWidth:n,width:e.width};(function(e,t,n,r,i){for(let o=0,a=e.length;o<a;o++){const a=e[o];if("text"===(null==a?void 0:a.type)&&Math.abs(a.x-t.x)<Math.max(a.width+r,t.width+r)&&Math.abs(a.y-t.y)<n.height+i)return!0}return!1})(l,y,e,u,h)||(t&&l.push(t),l.push(y))}}u&&h&&p&&(l.push(h,p),f&&l.push(f))}function Q2(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function e5(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function t5(e,t){const n=e.min();if(n===e.max()){const r=function(e){const 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)}function n5(e,t){return e&&t&&Math.abs(e.x-t.x)<1e-15&&Math.abs(e.y-t.y)<1e-15}const r5={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:()=>30,beforeRender(){this.blueprint=H2(),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(){let e=this.settings;if(this.lines={x:[],y:[]},this.lines.x=e.lines&&e.lines.x||[],this.lines.y=e.lines&&e.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const t={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(e5).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=t5(t,e.value);return cY(e,{scale:t,position:n})}return cY(e,{position:e.value})})),this.lines.y=this.lines.y.filter(e5).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=t5(t,e.value);return cY(e,{scale:t,position:n,flipXY:!0})}return cY(e,{position:e.value,flipXY:!0})})),this.lines.x=this.lines.x.filter((e=>!(e.position<0||e.position>1)||(t["x".concat(e.position>1?1:0)].push(Q2(e)),!1))),this.lines.y=this.lines.y.filter((e=>!(!e.slope||0===e.slope)||(!(e.position<0||e.position>1)||(t["y".concat(e.position>1?1:0)].push(Q2(e)),!1))));let n=[];return[...this.lines.x,...this.lines.y].forEach((r=>{if(!0===r.show||void 0===r.show){let i;if(r.slope&&0!==r.slope){const e=this.chart.scale({scale:"x"}),n=this.chart.scale({scale:"y"}),o=e.min(),a=e.max(),s=n.min(),l=n.max();i=pY(pY({},r),{},{x1:void 0,y1:void 0,x2:void 0,y2:void 0});const c=o*r.slope+r.value,u=a*r.slope+r.value,d=(s-r.value)/r.slope,h=(l-r.value)/r.slope;let p=[];K2(c,s,l)||(p[0]={x:t5(e,o),y:t5(n,c)}),K2(d,o,a)||(p[1]={x:t5(e,d),y:1}),K2(u,s,l)||(p[2]={x:t5(e,a),y:t5(n,u)}),K2(h,o,a)||(p[3]={x:t5(e,h),y:0});const f=p.filter((e=>!!e)).length;if(f>2&&function(e){n5(e[0],e[1])&&(e[1]=void 0),n5(e[1],e[2])&&(e[2]=void 0),n5(e[2],e[3])&&(e[3]=void 0),n5(e[3],e[0])&&(e[3]=void 0)}(p),p=p.filter((e=>!!e)),p.length<2)return void t["y".concat(c>l?0:1)].push(Q2(r));i.x1=p[0].x,i.y1=p[0].y,i.x2=p[1].x,i.y2=p[1].y}else i=void 0;Z2({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:r,settings:e,items:n,slopeLine:i})}})),e.style.oob.show&&function(e){let{blueprint:t,oob:n,settings:r,items:i}=e;const o=Object.keys(n);let a=r.style.oob||{};for(let e=0,r=o.length;e<r;e++){const r=o[e],s=n[r];if(s.length>0){let e=r.charAt(1),n="y"===r.charAt(0),o=a.padding.x+a.width,l=a.padding.y+a.width,c="bottom";c=n?"1"===e?"bottom":"top":"1"===e?"right":"left";let u=t.processItem({fn:t=>{let{width:r,height:i}=t,u=e*r+("1"===e?-o:o),d=n?l:i-l;return"arc"===a.type?{type:"path",d:U2(n?d:u,n?u:d,a.width,c),x:u,y:d,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0}:{type:"circle",cx:u,cy:d,r:a.width,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0,opacity:a.opacity,data:s}},flipXY:n}),d=u.cx||u.x,h=u.cy||u.y;const p=s.map((e=>e.label?"".concat(e.label," (").concat(e.value,")"):"(".concat(e.value,")"))),f=p.reduce(((e,t,n)=>0===n?t:"".concat(e,"\n\n").concat(t)),"");let m={type:"text",text:s.length||"",title:f,x:d-.4*a.width,y:h+.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},g={type:"path",d:Y2(d,h,a.width,c),x:d,y:h,stroke:a.triangle.stroke,fill:a.triangle.fill,strokeWidth:a.triangle.strokeWidth||0,opacity:a.triangle.opacity};i.push(u,m,g)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function i5(e){const 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){cY(e,t.style)}(t,e),t}function o5(e){return"string"==typeof e||"number"==typeof e?e:"-"}function a5(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){const 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),c=[{x:t.x-i,y:l},{x:t.x+i,y:l}].map((e=>e1(e,r,{x:t.x,y:t.y}))),u={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},h=r>=0?[u,d]:[d,u];c.push(...h),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const 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{const r=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:r,width:n.innerRect.width,height:r<0?n.stepSize+r:n.stepSize}}const r=t.collider;r.x=Math.max(r.x,0),r.y=Math.max(r.y,0);const i=r.x+r.width-(n.outerRect.x+n.outerRect.width);r.width=i>0?r.width-i:r.width;const o=r.y+r.height-(n.outerRect.y+n.outerRect.height);r.height=o>0?r.height-o:r.height}(e,t,n)}function s5(e,t){const n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1);let r=0;if(e.tilted)r=e.stepSize*n;else{const i=t?e.textRect.height:e.textRect.width;r=Math.max(0,e.stepSize-i)*n}return r}function l5(e,t){var n,r;const i={type:"text",text:o5(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)+s5(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)+s5(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((n=>{e[n]=t.style[n]}))}(i,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){const n=0,r=t.outerRect.width,i=Math.min(t.maxWidth/2,t.textRect.width/2),o=e.x-i,a=e.x+i;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):a>r&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{const n=0,r=t.outerRect.height,i=t.maxHeight/2,o=e.y-i,a=e.y+i;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):a>r&&(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){const 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";const i=Math.cos(r)*t.maxWidth;if("bottom"===t.align==t.angle<0){const n=t.outerRect.width-t.paddingEnd;e.x+i>n&&(e.maxWidth=(n-e.x-10)/Math.cos(r))}else{const n=t.paddingEnd;e.x-i<n&&(e.maxWidth=(e.x-n-10)/Math.cos(r))}}}(i,t),function(e,t){e.boundingRect=t.textBounds(e)}(i,t),a5(e,i,t),i}function c5(e,t){const 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){cY(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){const 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 u5(e){return!e.isMinor&&e.position>=0&&e.position<=1}function d5(e){let{rect:t,state:n,majorTicks:r,measure:i,horizontal:o}=e;return o?function(e){let{majorTicks:t,measureText:n,rect:r,state:i}=e;const o="layered"===i.labels.activeMode?2:1,a=r.width,s=t.map((e=>e.label)).map((e=>"".concat(e.slice(0,1)).concat(e.length>1?"…":""))).map(n).map((e=>e.width));for(let e=0;e<t.length;++e){const n=t[e];if(o*a*Math.abs(n.start-n.end)<s[e])return!0}return!1}({majorTicks:r,measureText:i,rect:t,state:n}):function(e){let{majorTicks:t,measureText:n,rect:r}=e;const i=r.height,o=n("M").height;return!(t.length<2)&&i*Math.abs(t[0].position-t[1].position)<o}({majorTicks:r,measureText:i,rect:t})}function h5(e){let{value:t,maxValue:n,minValue:r,range:i,modifier:o}=e;return isNaN(i)||isNaN(o)||(t=i*o),t>n&&(t=n),t<r&&(t=r),t}function p5(e){let{isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:s}=e,l=0;const c={left:0,top:0,right:0,bottom:0},{maxLengthPx:u,minLengthPx:d}=a.labels;if(a.labels.show){const e=a.align,h="top"===e||"bottom"===e,p=h?n.inner.width:n.inner.height,f=o.ticks({settings:a,distance:p,formatter:r}).filter(u5),m=e=>{const t=i({text:e,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return t.width=h5({value:t.width,maxValue:u,minValue:d}),t};if(t&&h&&"auto"===a.labels.mode&&(!function(e){let{majorTicks:t,measure:n,rect:r,state:i,settings:o}=e;const a=o.labels.maxGlyphCount,s="layered"===i.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=r.width;let d=0,h=0;if(isNaN(a))for(let e=0;e<t.length;e++){const r=t[e],i=r.label,o=n(i).width*(i.length>1?l:1);if(h=s*u*Math.abs(r.start-r.end),o+c>h)return!0}else{const e=t.reduce(((e,t)=>Math.min(Math.abs(t.start-t.end),e)),1/0);if(h=s*u*e,d=n("M").width*l*a,d+c>h)return!0}return!1}({majorTicks:f,measure:m,rect:n.inner,state:s,settings:a})?s.labels.activeMode="horizontal":s.labels.activeMode="tilted"),!a.labels.filterOverlapping&&"tilted"!==s.labels.activeMode&&d5({rect:n.inner,state:s,majorTicks:f,measure:m,horizontal:h})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let g,y;if("tilted"===s.labels.activeMode){const e=Math.abs(a.labels.tiltAngle)*(Math.PI/180);g=t=>h5({value:t.width,maxValue:u,minValue:d})*Math.sin(e)+t.height*Math.cos(e)}else g=h?e=>e.height:e=>h5({value:e.width,maxValue:u,minValue:d});if(h&&"tilted"!==s.labels.activeMode)y=["M"];else if(isNaN(a.labels.maxGlyphCount))y=f.map((e=>e.label));else{let e="";for(let t=0;t<a.labels.maxGlyphCount;t++)e+="M";y=[e]}const v=y.map(m),b=v.map(g),x=Math.max(...b,0);if(l+=x,l+=a.labels.margin,"layered"===s.labels.activeMode&&(l*=2),"tilted"===s.labels.activeMode){const e="bottom"===a.align==a.labels.tiltAngle>=0,t=Math.abs(a.labels.tiltAngle)*(Math.PI/180),r=(x-m("M").height*Math.cos(t))/Math.sin(t),i=e=>Math.min(r,e.width)*Math.cos(t)+e.height,o=(t,r)=>{const i=f[r]?f[r].position:0;return e?t-i*n.inner.width:t-(1-i)*n.inner.width},s=Math.min(a.labels.maxEdgeBleed,Math.max(...v.map(i).map(o),0))+a.paddingEnd;if(c[e?"left":"right"]=s,!a.labels.filterOverlapping&&function(e){let{majorTicks:t,measureText:n,rect:r,bleedSize:i,angle:o}=e;if(t.length<2)return!1;if(0===o)return!0;const 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:f,measureText:m,rect:n,bleedSize:s,angle:a.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const f5=(e,t,n)=>e.width*Math.abs(t.position-n.position);function m5(e){let{layered:t,major:n,innerRect:r,outerRect:i,tick:o,index:a}=e;const s=t?2:1,l=n[a-s],c=n[a+s],u=l?f5(r,o,l)/2-2:1/0,d=c?f5(r,o,c)/2-2:1/0;return n.length<2?r.width:l?c?2*Math.min(u,d):(e=>{let{innerRect:t,outerRect:n,tick:r,prevWidth:i}=e;const 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),c=1===r.position?t.width/2-2:0;return Math.max(i,l,c)})({innerRect:r,outerRect:i,tick:o,prevWidth:u}):(e=>{let{innerRect:t,outerRect:n,tick:r,nextWidth:i}=e;const 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 g5(e){const t=e.innerRect,n={cx:t.width/2,cy:t.height/2},r=Math.min(t.height,t.width)/2*e.radius,i=r+e.style.strokeWidth,o={visible:!0,type:"path",arcDatum:{startAngle:e.startAngle,endAngle:e.endAngle},transform:"translate(0, 0) translate(".concat(n.cx,", ").concat(n.cy,")"),desc:{share:1,slice:{cornerRadius:0,innerRadius:r,outerRadius:i}},ticks:[]};return function(e,t){cY(e,t.style)}(o,e),o}function y5(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function v5(e,t){const n=t.innerRect,r={cx:n.width/2,cy:n.height/2},i=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o;let c=a-e.position*l;c-=Math.PI/2;const u=y5(r.cx,r.cy,i+s,c),d=y5(r.cx,r.cy,i,c),h={type:"line",x1:u.x,y1:u.y,x2:d.x,y2:d.y,value:e.value};return function(e,t){const n=pY({},t.style);cY(e,n)}(h,t),h}function b5(e){return"string"==typeof e||"number"==typeof e?e:"-"}function x5(e,t,n){let r;return r="left"===t?n.x:"right"===t?e.outerRect.width-n.x:Math.max(n.x,e.outerRect.width-n.x),r}function w5(e,t){const n=t.innerRect,r={cx:n.width/2,cy:n.height/2},i=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o,c=.2;let u,d;u="top"===t.align||"bottom"===t.align?a-e.position*l:o+e.position*l,d=u<-.2&&u>-Math.PI+c?"left":u>.2&&u<Math.PI-c?"right":"center",u-=Math.PI/2;const h=function(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}(r.cx,r.cy,i+s+6,u);let p;p="left"===d?"end":"right"===d?"start":"middle";const f={type:"text",text:b5(e.label),align:d,x:h.x,y:h.y,maxHeight:t.maxHeight,maxWidth:x5(t,d,h),anchor:p,baseline:"middle"};return function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(f,t),function(e,t){e.boundingRect=t.textBounds(e)}(f,t),function(e,t,n){let r,i;const o=parseFloat(n.fontSize)||0;r=t.y-o/2,i=e.innerRect.height-(t.y+o/2),(r<0||i<0)&&(n.text="")}(t,h,f),f}function S5(e){let t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function C5(e){let t=0;return t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function M5(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=S5(e)+e.labels.margin,t}function k5(e,t){return e.map((e=>c5(e,t)))}function E5(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function _5(e){let{textMetrics:t,settings:n,innerRect:r,scale:i,tilted:o,layered:a,tick:s}=e;const l=t.height,c=E5(i,s),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=r.width-M5(n)-n.paddingEnd;else if(a)u.width=c*r.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(r.height-M5(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*r.width;return u.width=h5({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function R5(e){let{textMetrics:t,settings:n,innerRect:r,outerRect:i,tilted:o,layered:a,tick:s,index:l,major:c}=e;const u=t.height,d={width:0,height:u};if("left"===n.align||"right"===n.align)d.width=r.width-M5(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);d.width=(r.height-M5(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else d.width=m5({layered:a,major:c,innerRect:r,outerRect:i,tick:s,index:l});return d.width=h5({value:d.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),d}function I5(e){let t;function n(){return t=R5,n}function r(){return t=_5,r}function i(e){let{settings:n,scale:r,innerRect:i,outerRect:o,measureText:a,ticks:s,state:l,textBounds:c}=e;const u=[],d=function(e){return e.filter((e=>!e.isMinor))}(s),h=function(e){return e.filter((e=>e.isMinor))}(s),p={innerRect:i,align:n.align,outerRect:o},f="tilted"===l.labels.activeMode,m="layered"===l.labels.activeMode;let g;if(n.arc&&(p.startAngle=n.arc.startAngle,p.endAngle=n.arc.endAngle,p.radius=n.arc.radius),n.line.show&&(p.style=n.line,p.padding=n.paddingStart,n.arc?u.push(g5(p)):u.push(i5(p))),n.ticks.show&&(p.style=n.ticks,p.tickSize=n.ticks.tickSize,p.padding=S5(n),n.arc?(p.padding=C5(n),g=function(e,t){return e.map((e=>v5(e,t)))}(d,p)):g=k5(d,p)),n.labels.show){const e=M5(n);p.style=n.labels,p.padding=e,p.tilted=f,p.layered=m,p.angle=n.labels.tiltAngle,p.paddingEnd=n.paddingEnd,p.textBounds=c;const s=(e,s)=>{p.textRect=function(e){let{style:t,measureText:n,tick:r}=e;return n({text:r.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:a,style:p.style});const l=t({textMetrics:p.textRect,settings:n,innerRect:i,outerRect:o,scale:r,tilted:f,layered:m,tick:e,major:d,index:s});p.maxWidth=l.width,p.maxHeight=l.height,p.stepSize=function(e){let{innerRect:t,scale:n,settings:r,tick:i}=e;return("top"===r.align||"bottom"===r.align?t.width:t.height)*E5(n,i)}({innerRect:i,scale:r,settings:n,tick:e})};let l=[];n.arc?(p.padding=function(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=C5(e)+e.labels.margin,t}(n),l=function(e,t,n){return e.map(((e,r)=>{n(e,r);const i=w5(e,t);return i.data=e.data,i}))}(d,p,s)):l=!m||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map(((e,r)=>{n(e,r);const i=l5(e,t);return i.data=e.data,i}))}(d,p,s):function(e,t,n,r){const i=t.padding,o=M5(n);return e.map(((e,a)=>{r(e,a);const s=o+t.maxHeight+n.labels.margin;t.layer=a%2,t.padding=a%2==0?i:s;const l=l5(e,t);return l.data=e.data,l}))}(d,p,n,s),n.labels.filterOverlapping&&function(e,t,n){let r=(t,n)=>_1(CY(1,e[t].boundingRect),CY(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);r=(n,r)=>{const i=1/Math.abs(e[n].x-e[r].x),o=Math.sin(t*(Math.PI/180))/i;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let i=n+1;i<=Math.min(n+5,n+(e.length-1));i++)e[n]&&e[i]&&r(n,i)&&(i===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(i,1),t&&t.splice(i,1)),i--,n--)}(l,g,p),u.push(...l)}return n.minorTicks&&n.minorTicks.show&&h.length>0&&(p.style=n.minorTicks,p.tickSize=n.minorTicks.tickSize,p.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...k5(h,p))),g&&u.push(...g),u}return n.build=i,r.build=i,e?r():n()}const D5={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"},A5={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"};const P5={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(){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(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(e){let{state:t,style:n,settings:r}=e;const i=cY(!0,{},t.isDiscrete?D5:A5,n),o=cY(!0,{},i,r.settings),a=r.layout.dock||t.defaultDock;o.dock=a,o.align=function(e,t){const 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));const{paddingStart:s,paddingEnd:l}=o;return o.paddingStart="function"==typeof s?s.call(null):s,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=I5(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=function(e,t,n){const r=t.labels.mode;return n&&e.isHorizontal?"auto"===r?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?r:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(e){const{formatter:t,state:n,scale:r}=this,i=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=O0(r,i);const o=function(e){let{isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:s}=e,l=0;const{size:c,edgeBleed:u,isToLarge:d}=p5({isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:s});if(l+=c,d)return{size:l};if(a.ticks.show&&(l+=a.ticks.margin,l+=a.ticks.tickSize),a.minorTicks&&a.minorTicks.show){const e=a.minorTicks.margin+a.minorTicks.tickSize;e>l&&(l=e)}if(a.line.show){const e=a.line.strokeWidth/2;l+=e,u[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(e)}return l+=a.paddingStart,l+=a.paddingEnd,{size:l,edgeBleed:u}}({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});return o},beforeUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{settings:t}=e;this.setState(t)},resize(e){const{inner:t,outer:n}=e,r=cY({},t,function(e){let{align:t,inner:n}=e;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 cY(this.state.innerRect,r),cY(this.state.outerRect,i),n},beforeRender(){const{scale:e,formatter:t}=this,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=O0(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter((e=>e.position>=0&&e.position<=1))},render(){const{state:e}=this,t=[];return t.push(...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})),$2.multiple(t),t}};const O5={render:()=>[]};function T5(e,t,n){let r="";if("function"==typeof e)r=e();else if("string"==typeof e)r=e;else if(n){const e=(n.data().fields||[]).map((e=>e.title()));r=e.join(t)}return r}function L5(e,t){let 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}const q5={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(){this.definitionSettings=this.settings.settings;const e=this.settings.text,t=this.definitionSettings.join;this.title=T5(e,t,this.scale)},preferredSize(){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(){const{title:e,definitionSettings:t,rect:n}=this,r=[];return r.push(function(e){let{title:t,definitionSettings:n,dock:r,rect:i,measureText:o,style:a}=e;const s={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:L5(r,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};cY(s,a.text);const l=o(s);if("top"===r||"bottom"===r){let e=i.width/2;"left"===n.anchor?e=n.paddingLeft||0:"right"===n.anchor&&(e=i.width-(n.paddingRight||0)),s.x=e,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{let e=i.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=i.height-n.paddingStart),s.y=e,s.x="left"===r?i.width-n.paddingStart:n.paddingStart,s.dx="left"===r?-l.height/3:l.height/3;const t="left"===r?270:90;s.transform="rotate(".concat(t,", ").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(e){e.settings&&(cY(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=T5(t,n,this.scale)}};function N5(e,t){const n=e.settings.layout.dock,r=e.settings.settings.invert,i="top"===n||"bottom"===n,o=i?"width":"height",a=e.rect[o],s=e.chart.scroll(e.settings.scroll);let l;{let e=t[i?"x":"y"];r&&(e=a-e);const n=s.getState();l={startOffset:e,startScroll:n.start,swipe:!1};const o=e/a*(n.max-n.min)+n.min;o<n.start?l.startScroll=o:o>n.start+n.viewSize&&(l.startScroll=o-n.viewSize)}return{update:e=>{let t=e[i?"x":"y"];if(r&&(t=a-t),!l.swipe){if(Math.abs(l.startOffset-t)<=1)return;l.swipe=!0}const n=s.getState(),o=(t-l.startOffset)/a*(n.max-n.min),c=l.startScroll+o;s.moveTo(c)},end:e=>{let t=e[i?"x":"y"];r&&(t=a-t);const n=s.getState();if(l.swipe){const e=(t-l.startOffset)/a*(n.max-n.min),r=l.startScroll+e;s.moveTo(r)}else{const e=t/a*(n.max-n.min)+n.min-n.viewSize/2;s.moveTo(e)}}}}function j5(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const z5={require:["chart","renderer"],on:{panStart(e){const t=j5(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=N5(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=j5(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=j5(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=j5(e,this.renderer);N5(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){const t=this.chart.scroll(this.settings.scroll).getState();if(t.viewSize>=t.max-t.min){return Math.max(e.width,e.height)}return this.settings.settings.width},render:function(e){const t=this.settings.layout.dock,n=this.settings.settings.invert,r="top"===t||"bottom"===t,i=r?"width":"height",o=this.rect[i],a=this.chart.scroll(this.settings.scroll).getState();let s=o*(a.start-a.min)/(a.max-a.min);const l=o*a.viewSize/(a.max-a.min);return n&&(s=o-s-l),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("div",{class:"scroller",style:{position:"absolute",[r?"left":"top"]:"".concat(s,"px"),[r?"top":"left"]:"25%",[r?"height":"width"]:"50%",[i]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function F5(e){let{h:t,isVertical:n,value:r,pos:i,align:o,borderHit:a,state:s,idx:l}=e;const c="end"!==o,u=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let d=0,h="100%",p="100%";return s.targetRect&&"start"===s.settings.bubbles.align?(h="".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,h="".concat(s.rect.width-d,"px"),p="".concat(s.rect.height-d,"px")),c||(i-=a),t("div",{onmouseover(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(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?h:"".concat(a,"px"),pointerEvents:"auto"}},[t("div",{style:cY({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function W5(e){let{h:t,isVertical:n,label:r,otherValue:i,rangeIdx:o,idx:a,pos:s,align:l,state:c,value:u}=e;const d="end"!==l,h="outside"===c.settings.bubbles.placement;let p,f="none";n?(p=d?"left":"right",h&&(f=d?"translate(-100%, 0px)":"translate(100%, 0px)")):(p=d?"top":"bottom",h&&(f=d?"translate(0px, -100%)":"translate(0px, 100%)"));let m=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===a;const g={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let y=c.style.bubble.stroke;const v=m?t("input",{type:"text",value:u,style:pY(pY({},g),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)?(y="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(y)):c.onEditConfirmed(o,t,i)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c.onEditCanceled())}}):t("div",{"data-key":[c.key,"bubble",o,a].join("-"),"data-other-value":i,"data-idx":o,"data-bidx":a,style:g},[r]);return t("div",{style:{position:"absolute",[p]:"0",[n?"top":"left"]:"".concat(s,"px"),transform:f}},[v])}function $5(e){let{h:t,isVertical:n,top:r,height:i,color:o,on:a,opacity:s}=e;return t("div",cY({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 B5(e){let{borderHit:t,els:n,isVertical:r,state:i,vStart:o,vEnd:a,idx:s}=e,l=0;i.targetRect&&(l=r?i.targetRect.y:i.targetRect.x);const c=!!i.scale,u=c?i.scale.norm(o)*i.size:o,d=c?i.scale.norm(a)*i.size:a,h=Math.abs(u-d),p=Math.min(u,d)+l,f=p+h;if(i.targetRect){const e=i.targetFillRect||i.targetRect,t=r?e.height:e.width,s=c?i.scale.norm(o)*t:o,l=c?i.scale.norm(a)*t:a,u=Math.abs(s-l),d=Math.min(s,l),h={h:i.h,isVertical:r,top:d,height:u,color:i.style.target.fill,opacity:i.style.target.opacity};i.style.target.opacity<.8&&(h.on={onmouseover(e){e.srcElement.style.opacity=i.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=i.style.target.opacity}}),n.push(i.h("div",{style:{position:"absolute",left:"".concat(e.x,"px"),top:"".concat(e.y,"px"),height:"".concat(e.height,"px"),width:"".concat(e.width,"px")}},[$5(h)]))}const m=u<d?o:a,g=u<d?a:o,[y,v]=c?i.scale.domain():[Math.min(o,a),Math.max(o,a)],b=m+1e-5>=y&&m-1e-5<=v,x=g-1e-5<=v&&g+1e-5>=y;b&&n.push(F5({h:i.h,isVertical:r,borderHit:t,value:m,pos:p,align:"start",state:i,idx:s})),x&&n.push(F5({h:i.h,isVertical:r,borderHit:t,value:g,pos:f,align:"end",state:i,idx:s}));const w=i.settings.bubbles;if(w&&w.show){w.fontSize,w.fontFamily,w.fill;const e=[o,a];b&&n.push(W5({h:i.h,isVertical:r,align:w.align,rangeIdx:s,idx:0,otherValue:g,value:m,label:"".concat(i.format(m,e)),pos:p,state:i})),x&&n.push(W5({h:i.h,isVertical:r,align:w.align,rangeIdx:s,idx:1,otherValue:m,value:g,label:"".concat(i.format(g,e)),pos:f,state:i}))}}function H5(e){const t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start;let r=e.current-e.start;return r=r<0?Math.max(r,n):Math.min(r,t),r}function V5(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach(((r,i)=>{e.active&&i===e.active.idx||B5({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){let 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{const t=H5(e);r=e.active.start+t,i=e.active.end+t}B5({borderHit:5,els:t,isVertical:n,state:e,vStart:r,vEnd:i,idx:e.active.idx})}return t}function G5(e){return{min:e.scale.min(),max:e.scale.max()}}function U5(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function Y5(e,t,n){let 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 K5(e){e.renderer.render(V5(e))}function X5(e,t){if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map((e=>e.id())),i=t.brushes().filter((e=>"range"===e.type&&-1!==r.indexOf(e.id)))[0];return i?i.brush.ranges():[]}function J5(e,t){let n,r=1/0;const i=t.domain(),o=t.bandwidth()/2;for(let a=0;a<i.length;++a){const s=Math.abs(e-o-t(i[a]));s<r&&(r=s,n=i[a])}return n}function Z5(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function Q5(e){const t=e.reduce(((e,t)=>(e.push(...bY(t.bounds)),e)),[]);return xY(t)}const e3={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(e){this.start(e)},rangeMove(e){this.move(e)},rangeEnd(e){this.end(e)},rangeClear(e){this.clear(e)},bubbleStart(e){this.bubbleStart(e)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(e){this.state.rect=e.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=X5(this.state,this.state.brushInstance),this.state.active=null,K5(this.state))},render(e){const t=this.settings.settings;this.state.direction="vertical"===t.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),r=this.state.rect[0===this.state.direction?"height":"width"];let i=O0(this.chart.scale(t.scale),r);const o=function(e){const 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((t=>e.chart.component(t))).filter((e=>!!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){const r=Q5(i);if(t.size=r[0===e.state.direction?"height":"width"],t.scale=O0(e.chart.scale(n.scale),t.size),t.targetRect=r,o.length>0){const e=Q5(o);t.targetFillRect=e}}else if(r&&r.length>0){const n=r.slice(1).reduce(((e,t)=>({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:n.x0-e.state.rect.x,y:n.y0-e.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return t}(this);if(i=o.scale?o.scale:i,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?r:o.size,this.state.settings=t,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof t.brush?t.brush.context:t.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.onEditConfirmed=(e,t,n)=>{this.state.edit=null,function(e,t,n,r){let i=e.ranges.map((e=>({min:e.min,max:e.max})));const 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]=pY({},i[t]);const s=e.scale.data();s&&s.fields&&s.fields.forEach((t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),i)}))}(this.state,e,t,n),this.emit("bubbleEnd"),K5(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,K5(this.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 t.bubbles.label&&((e,n)=>t.bubbles.label.call(void 0,{datum:e,data:n,scale:i,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(i,"norm")){this.state.editable=!0,this.state.observeBrush="object"==typeof t.brush&&t.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=i;const e=this.state.scale.data();!this.state.format&&e&&e.fields&&e.fields[0]&&(this.state.format=e.fields[0].formatter())}else this.state.editable=!1,this.state.scale=qQ(),this.state.scale.data=i.data,this.state.format||(this.state.format=(e,t)=>Z5(i.range(),t)?function(e,t){const n=t.ticks(),r=t.domain().indexOf(J5(e,t));return-1!==r?n[r].label:"-"}(e,i):"-"),this.state.fauxBrushInstance=x0(),this.state.findValues=e=>function(e,t){const n=t.domain(),r=t.range(),i=[];return e.forEach((e=>{if(!Z5(r,[e.min,e.max]))return;const o=n.indexOf(J5(e.min,t)),a=n.indexOf(J5(e.max,t));i.push.apply(i,n.slice(Math.min(o,a),Math.max(o,a)+1))})),i}(e,i);return this.state.ranges=X5(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[V5(this.state)]:[]},mounted(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start(e){!function(e){let{state:t,e:n,renderer:r,ranges:i,targetSize:o}=e;if(t.started)return;t.edit=null;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);const c={started:!0};t.offset=cY({},r.element().getBoundingClientRect());const u=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);const h=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];c.current=t.scale.normInvert(p/t.size),c.start=t.scale.normInvert(h/t.size);let f=t.ranges;const m=G5(t);let g,y,v=-1;if(l&&l.hasAttribute("data-idx"))v=parseInt(l.getAttribute("data-idx"),10),m.min=v>0?f[v-1].max:m.min,m.max=v+1<f.length?f[v+1].min:m.max;else{for(g=0;g<f.length;g++){if(f[g].min<=c.start&&c.start<=f[g].max){v=g,m.min=g?f[g-1].max:m.min,m.max=g+1<f.length?f[g+1].min:m.max;break}if(c.start<f[g].min){m.max=f[g].min,m.min=g?f[g-1].max:m.min;break}}-1===v&&f.length&&g>=f.length&&(m.min=f[f.length-1].max)}if(-1!==v||t.multi||(c.ranges=[],m.min=t.scale.min(),m.max=t.scale.max()),-1!==v)if(y={idx:v,start:f[v].min,end:f[v].max,limitLow:m.min,limitHigh:m.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{let e=t.scale.norm(y.start)*t.size,n=t.scale.norm(y.end)*t.size;Math.abs(h-e)<=o?(c.start=y.end,y.mode="modify"):Math.abs(h-n)<=o&&(c.start=y.start,y.mode="modify")}else y={idx:-1,start:c.start,end:c.current,limitLow:m.min,limitHigh:m.max,mode:"current"};c.active=y,"modify"!==y.mode&&t.targetRect&&!I1(t.targetRect,{x:u,y:d})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:X5,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=G5(e);Y5(e,e.current,n)}(this.state,X5),K5(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(e){this.state.started&&(!function(e,t){const 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){let t=e.ranges.map((e=>({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{const n=H5(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)});const n=e.scale.data();n&&n.fields&&n.fields.forEach((n=>{if(e.fauxBrushInstance){let r=X5(e,e.fauxBrushInstance),i=e.findValues(r),o=e.findValues(t),a=o.filter((e=>-1===i.indexOf(e))),s=i.filter((e=>-1===o.indexOf(e))),l=a.map((e=>({key:n.id(),value:e}))),c=s.map((e=>({key:n.id(),value:e})));e.brushInstance.addAndRemoveValues(l,c),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)}))}(this.state),K5(this.state))},clear(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart(e){if(!this.state.editable)return;const 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))return;this.state.edit=r,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const i=n.parentNode;K5(this.state);const o=i.querySelector("input");o.focus(),o.select()}};function t3(e){e.renderer.render(V5(e))}function n3(e){return e.rc.ranges()}function r3(e,t){const 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)}const i3={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(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaClear(e){this.clear(e)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(e){this.state.rect=this.rect;const t=this.settings.settings,n="vertical"===t.direction?0:1,r=this.state.rect[0===n?"height":"width"],i=this.renderer.element().getBoundingClientRect(),o=(t.target?t.target.components||[t.target.component]:[]).map((e=>this.chart.component(e))).filter((e=>!!e&&!!e.rect)),a=o[0]?o.slice(1).reduce(((e,t)=>({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:o[0].rect.x,y0:o[0].rect.y,x1:o[0].rect.x+o[0].rect.width,y1:o[0].rect.y+o[0].rect.height}):null;return this.state.targetRect=a?{x:a.x0-this.rect.x,y:a.y0-this.rect.y,width:a.x1-a.x0,height:a.y1-a.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=n,this.state.settings=t,this.state.offset=i,this.state.rc=l0(),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.size=r,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){const r=Math.min(...n),i=Math.max(...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"-";const s=a.reduce(((n,i)=>{const 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(((e,t)=>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(e){!function(e){let{state:t,e:n,renderer:r,ranges:i,targetSize:o}=e;if(t.started)return;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);const c={started:!0};t.offset=r.element().getBoundingClientRect(),t.ranges=i(t);const u=a-t.offset.left,d=s-t.offset.top,h=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];let f=p,m=h;c.start=h,c.current=p;let g=t.ranges;const y=U5(t);let v,b,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),y.min=x>0?g[x-1].max:y.min,y.max=x+1<g.length?g[x+1].min:y.max;else{for(v=0;v<g.length;v++){if(g[v].min<=m&&m<=g[v].max){x=v,y.min=v?g[v-1].max:y.min,y.max=v+1<g.length?g[v+1].min:y.max;break}if(m<g[v].min){y.max=g[v].min,y.min=v?g[v-1].max:y.min;break}}-1===x&&g.length&&v>=g.length&&(y.min=g[g.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(b={idx:x,start:g[x].min,end:g[x].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),b.mode="modify";else{let e=b.start,t=b.end;Math.abs(h-e)<=o?(c.start=b.end,b.mode="modify"):Math.abs(h-t)<=o&&(c.start=b.start,b.mode="modify")}else b={idx:-1,start:m,end:f,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=b,"modify"!==b.mode&&t.targetRect&&!I1(t.targetRect,{x:u,y:d})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:n3,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=U5(e);Y5(e,e.current,n)}(this.state,n3),t3(this.state))},move(e){this.state.started&&(!function(e,t){const 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){const t=e.ranges.map((e=>({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{const n=H5(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);let n=[];t.forEach((t=>{n=[...n,...r3(e,t)]})),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),t3(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function o3(e){const t="vertical"===e.direction,n=e.rect[t?"height":"width"],r=e.rect[t?"width":"height"];return function(e){const t=e.brush;if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map((e=>e.id())),i=t.brushes().filter((e=>"range"===e.type&&-1!==r.indexOf(e.id)))[0];return i?i.brush.ranges():[]}(e).map((i=>{const 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 a3(e,t,n,r){function i(){!function(e){e.renderer.render(o3(e))}(e)}function o(){!function(e){e.renderer.render(o3(e))}(e)}function a(){!function(e){e.renderer.render(o3(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 s3(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}const l3={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",r="horizontal"===n?this.rect.width:this.rect.height,i=O0(this.chart.scale(e.scale),r);return s3(this.state),a3(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,o3(this.state)},beforeDestroy(){s3(this.state)}};function c3(e,t){const n=t.center.x,r=t.center.y;return{x:n-e.left,y:r-e.top}}function u3(e,t,n){return J0(e,t.points[0])<n.settings.snapIndicator.threshold**2}function d3(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 h3(e){let{state:t,start:n=null,end:r=null}=e;null!==n&&(t.snapIndicator.x1=n.x,t.snapIndicator.y1=n.y),null!==r&&(t.snapIndicator.x2=r.x,t.snapIndicator.y2=r.y)}function p3(e,t){e.snapIndicator.visible=t}const f3={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(e){this.start(e)},lassoEnd(e){this.end(e)},lassoMove(e){this.move(e)},lassoCancel(){this.cancel()}},created(){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(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){const n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=function(e){return e.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"})))}(this.settings);const n=c3(this.state.rendererBounds,e);d3(this.state,n),h3({state:this.state,start:n}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,n)},move(e){if(!this.state.active)return;const t=c3(this.state.rendererBounds,e);u3(t,this.state,this.settings)?p3(this.state,!0):p3(this.state,!1),d3(this.state,t),h3({state:this.state,end:t}),function(e,t){const n=[e.startPoint,e.path,e.snapIndicator].filter((e=>e.visible));t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){const 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;const i=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(i,{components:e.brushConfig})}}(this.state,this.chart)},end(e){if(!this.state.active)return;p3(this.state,!1);u3(c3(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){const n=e.componentDelta.x,r=e.componentDelta.y,i=e.points.map((e=>({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(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{e.contexts.forEach((e=>{t.brush(e).end()}))})),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 m3(e,t,n,r,i){let o,a=0,s=t.length-1;for(;a<s;){let l=Math.floor((a+s)/2);o=i(t[l]),o[n]+o[r]<e[n]?a=l+1:s=l}return a}function g3(e){let{orientation:t,targetNodes:n,labels:r,container:i}=e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m3;const a=[],s="v"===t?"x":"y",l="v"===t?"width":"height",c=e=>e.textBounds,u=e=>e.node.localBounds;return(e,t)=>{const{textBounds:d,node:h}=r[t];if(d[s]<i[s]||d[s]+d[l]>i[s]+i[l])return!1;for(let e=o(d,a,s,l,c);e<a.length;e++)if(_1(d,a[e].textBounds))return!1;const p=o(d,n,s,l,u),f=d[s]+d[l];for(let e=p;e<n.length;e++){const t=n[e].node;if(f<t.localBounds[s])break;if(_1(d,t.localBounds)&&h!==t)return!1}return a.push(r[t]),!0}}const y3=4;function v3(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function b3(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function x3(e){return pY(pY({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds),{},{data:"".concat(e.data," ").concat(e.text),rotation:e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal"})}function w3(e,t,n){return n?e.width>=t.height:e.width>=t.width}function S3(e,t,n){return n?e.height>=t.width:e.height>=t.height}function C3(e,t,n,r,i){let o,a;return"v"===e?(o=r||i||w3(t,n,!0),a=S3(t,n,!r)):(o=w3(t,n),a=i||S3(t,n,!1)),o&&a}function M3(e,t,n,r){return e+.5*t+(r-.5)*(t-n)-.5*n}function k3(e,t,n){const 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 w3(e,t,n.rotate)&&S3(e,t,n.rotate)}(e,i,n))return!1;const o=.5*i.height;return n.rotate?(r.x=M3(e.x,e.width,i.height,n.align)+o,r.y=M3(e.y,e.height,i.width,n.justify),"right"===n.dock?r.transform="rotate(90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,") translate(").concat(i.width,", 0)"):r.transform="rotate(-90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,")")):(r.x=M3(e.x,e.width,i.width,n.align),r.y=M3(e.y,e.height,i.height,n.justify)+o),r}function E3(e){let{bar:t,view:n,direction:r,position:i,padding:o=y3,measured:a}=e;const s={};if(cY(s,t),i&&"inside"!==i)if("up"===r||"down"===r){const e=Math.max(0,Math.min(t.y,n.height)),o=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===i&&"up"===r||"opposite"===i&&"down"===r?(s.y=0,s.height=e):("outside"===i&&"down"===r||"opposite"===i&&"up"===r)&&(s.y=o,s.height=n.height-o)}else{const e=Math.max(0,Math.min(t.x,n.width)),o=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===i&&"left"===r||"opposite"===i&&"right"===r?(s.x=0,s.width=e):("outside"===i&&"right"===r||"opposite"===i&&"left"===r)&&(s.x=o,s.width=n.width-o)}else;return function(e,t){const 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,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{top:r=y3,bottom:i=y3,left:o=y3,right:a=y3}=n,s="function"==typeof o?o(t):o,l="function"==typeof a?a(t):a,c="function"==typeof r?r(t):r,u="function"==typeof i?i(t):i;e.x+=s,e.width-=s+l,e.y+=c,e.height-=c+u}(s,a,o),s}function _3(e){let t,n,r,i,o,{direction:a,fitsHorizontally:s,measured:l,node:c,orientation:u,placementSettings:d,rect:h}=e,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:E3;const f=[],m="h"===u?"width":"height";for(o=0;o<d.length;o++)if(r=d[o],i=p({bar:c.localBounds,view:h,direction:a,position:r.position,padding:r.padding,measured:l}),f.push(i),t=!o||i[m]>t[m]?i:t,C3(u,i,l,s,r.overflow)){n=i;break}return n||(n=t,o=f.indexOf(n)),r=d[o],{bounds:n,placement:r}}function R3(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{top:o=y3,bottom:a=y3,left:s=y3,right:l=y3}=i,c="function"==typeof s?s(t):s,u="function"==typeof l?l(t):l,d="function"==typeof o?o(t):o,h="function"==typeof a?a(t):a,p=e.x+e.dx,f=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),y=.5*t.height,v=1e-9;return{x:(n?p-y:p)-c-v,y:(n?f:f-y)-d-v,width:g+(c+u)-v,height:m+(d+h)-v}}function I3(e){let{chart:t,targetNodes:n,rect:r,fitsHorizontally:i,collectiveOrientation:o}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_3,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k3,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:g3;const c=[],u={container:r,targetNodes:n,labels:[],orientation:o};let d,h,p,f,m,g,y,v,b,x,w,S,C,M;for(let e=0,l=n.length;e<l;e++){g=null,h=n[e],p=h.node,C=v3(p,t),b=h.direction,M="left"===b||"right"===b?"h":"v";for(let t=0;t<h.texts.length;t++){if(f=h.texts[t],!b3(f))continue;x=h.labelSettings[t],v=h.measurements[t],S=x.placements;const n=a({direction:b,fitsHorizontally:i,lblStngs:x,measured:v,node:p,orientation:M,placements:S,placementSettings:h.placementSettings[t],rect:r});if(g=n.bounds,w=n.placement,g&&w){var k;m=w.justify;const t="function"==typeof x.linkData?x.linkData(C,e):void 0,n="function"==typeof w.overflow?w.overflow(C,e):w.overflow;"up"===b&&(m=1-m),"opposite"===w.position&&(m=1-m),"left"===b&&(m=1-m);const r=!("h"===o||i);if(d=s(g,f,{justify:"h"===M?w.align:m,align:"h"===M?m:w.align,fontSize:x.fontSize,fontFamily:x.fontFamily,textMetrics:v,rotate:r,overflow:!!n,dock:null!==(k=x.dock)&&void 0!==k?k:"left"}),d){const n=R3(d,v,r,g,w.padding);y="function"==typeof w.fill?w.fill(pY(pY({},C),{},{textBounds:n}),e):w.fill,d.fill=y,void 0!==t&&(d.data=t),"object"==typeof w.background&&(d.backgroundColor="function"==typeof w.background.fill?w.background.fill(pY(pY({},C),{},{textBounds:n}),e):w.background.fill,void 0!==d.backgroundColor&&(d.backgroundBounds=R3(d,v,r,g,w.background.padding))),c.push(d),u.labels.push({node:p,textBounds:n})}}}}const E=c.filter(l(u));return[...E.filter((e=>void 0!==e.backgroundBounds)).map(x3),...E]}function D3(e){const t=2*Math.PI;return(e%t+t)%t}function A3(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function P3(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function O3(e,t,n){let{x:r,y:i}=t;if(r*r+i*i>e*e)return null;let o=Math.sin(n),a=Math.cos(n),s=r*a-i*o,l=e*e-s*s;if(l<0)return null;let c=Math.sqrt(l);return{x:s*a+o*c,y:-s*o+a*c}}function T3(e){let t,n,{radius:r,size:i,angle:o}=e,{width:a,height:s}=i,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=O3(r,l,o),!t)return null;t.y*=-1,n={x:-a,y:0};break;case 1:if(t=O3(r,l,Math.PI-o),!t)return null;n={x:-a,y:-s};break;case 2:if(t=O3(r,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-s};break;case 3:if(t=O3(r,l,2*Math.PI-o),!t)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 L3(e){let{slice:t,measured:n,padding:r}=e,{start:i,end:o,innerRadius:a,outerRadius:s}=t,l=s-a-2*r,c=o-i;if(c<Math.PI){let e=(n.height/2+r)/Math.tan(c/2);e>a&&(l=s-e-2*r)}if(l<0||l<n.minReqWidth)return null;const u=D3((i+o)/2);let d=s-r,h={x:Math.sin(u)*d,y:-Math.cos(u)*d,width:l,height:n.height};return u<Math.PI?(h.angle=u-Math.PI/2,h.anchor="end"):(h.angle=u+Math.PI/2,h.anchor="start"),h}function q3(e){let{context:t,node:n,bounds:r}=e;let{start:i,end:o}=n.desc.slice;const a=D3((i+o)/2);switch(Math.floor(a/(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 N3(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function j3(e,t,n){const 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)){let t=e.angle*(360/(2*Math.PI));r.transform="rotate(".concat(t,", ").concat(r.x,", ").concat(r.y,")")}return r}function z3(e){let t,n,{slice:r,direction:i,position:o,padding:a,measured:s,view:l,context:c,store:u}=e,{start:d,end:h,innerRadius:p,offset:f}=r;switch(o){case"into":t="rotate"===i?L3({slice:r,measured:s,padding:a}):function(e){let{slice:t,padding:n,measured:r}=e,{start:i,end:o,innerRadius:a,outerRadius:s}=t;const l=D3((i+o)/2);let c=T3({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",D1(c,{x1:0,y1:0,x2:Math.sin(i)*s,y2:-Math.cos(i)*s})||D1(c,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||w1({cx:0,cy:0,r:a},c)?null:(A3(c,n),c)):null}({slice:r,measured:s,padding:a});break;case"inside":n={start:d,end:h,innerRadius:0,outerRadius:p},t="rotate"===i?L3({slice:n,measured:s,padding:a}):function(e){let{slice:t,padding:n,measured:r,store:i}=e;const{start:o,end:a,outerRadius:s}=t,l=D3((o+a)/2);let c=T3({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",A3(c,n),i.insideLabelBounds.some((e=>_1(e,c)))?null:(i.insideLabelBounds.push({x:c.x-4,y:c.y,width:c.width+8,height:c.height}),c)):null}({slice:n,measured:s,padding:a,store:u});break;case"outside":t="rotate"===i?function(e){let{slice:t,measured:n,padding:r,view:i}=e,{start:o,end:a,outerRadius:s,offset:l}=t,c=s+r,u=a-o;if(u<Math.PI&&(n.height/2+r)/Math.tan(u/2)>c)return null;const d=D3((o+a)/2);let h=Math.sin(d)*c,p=-Math.cos(d)*c,f=n.width+1,m=d%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){let e=p<0?i.y:i.y+i.height,t=Math.abs(e-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*r-s;t<f&&(f=t)}if(Math.sin(m)>.001){let e=h<0?i.x:i.x+i.width,t=Math.abs(e-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*r-s;t<f&&(f=t)}if(f<=0||f<n.minReqWidth)return null;let g={x:h,y:p,width:f,height:n.height};return d<Math.PI?(g.angle=d-Math.PI/2,g.anchor="start"):(g.angle=d+Math.PI/2,g.anchor="end"),g}({slice:r,measured:s,padding:a,view:l}):function(e){let{slice:t,measured:n,padding:r,view:i,context:o}=e,{start:a,end:s,outerRadius:l,offset:c}=t;const u=D3((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(u/(Math.PI/2)),i))return null;let d=l+r+n.height/2,h=Math.sin(u)*d,p=-Math.cos(u)*d,f=n.width+1;if(u<Math.PI){let e=Math.abs(i.x+i.width-(h+c.x));e<f&&(f=e)}else{let e=Math.abs(i.x-(h+c.x));e<f&&(f=e)}if(f<n.minReqWidth)return null;let m={x:h,y:p,width:f,height:n.height};return u<Math.PI?m.anchor="start":m.anchor="end",m}({slice:r,measured:s,padding:a,view:l,context:c});break;default:throw new Error("not implemented")}return t&&(t.x+=f.x,t.y+=f.y,"outside"===o&&"rotate"!==i&&function(e,t,n){const{start:r,end:i,offset:o,outerRadius:a}=n,s=D3((r+i)/2);switch(Math.floor(s/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){let n=Math.min(e.y,t.q1maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){let n=Math.max(e.y,t.q2minY),r=n-e.y;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){let n=Math.max(e.y,t.q3minY),r=n-e.y;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){let n=Math.min(e.y,t.q4maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}}}(t,c,r)),t}function F3(e){let{context:t,direction:n,measured:r,node:i,placementSettings:o,rect:a,store:s}=e,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:z3;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,slice:i.desc.slice,view:a,direction:n,position:c.position,measured:r,padding:c.padding,store:s});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function W3(e,t,n){const 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}const $3=/\n+|\r+|\r\n/,B3=/\s/,H3=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function V3(e){return"string"==typeof e?-1!==e.search($3):-1!==String(e).search($3)}function G3(e){return-1!==e.search(B3)}function U3(e){return-1!==e.search(H3)}function Y3(e,t,n){return Math.max(t,Math.min(n,e))}function K3(){let{string:e,separator:t="",reverse:n=!1,measureText:r=e=>({width:e.length,height:1}),mandatoryBreakIdentifiers:i=[V3],noBreakAllowedIdentifiers:o=[],suppressIdentifier:a=[G3,V3,e=>""===e],hyphenationIdentifiers:s=[U3]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=String(e).split(t);!function(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}(l);const c=l.length,u=n?e=>e>=0:e=>e<c;let d=n?c:-1;function h(e){const t=Y3(e,0,c-1),n=l[t],u=r(n),d=function(e,t,n,r,i){return r.some((r=>r(e,t,n)))?1:i.some((r=>r(e,t,n)))?0:2}(n,t,l,i,o);return{index:t,value:n,breakOpportunity:d,suppress:a.some((e=>e(n,t,l))),hyphenation:s.some((e=>e(n,t,l))),width:u.width,height:u.height,done:!1}}return{next:function(e){return isNaN(e)?n?d--:d++:d=Y3(e,0,c-1),u(d)?h(d):{done:!0}},peek:h,length:c}}const X3="…",J3=/^\s*\d+(\.\d+)?px\s*$/i;function Z3(e){return"string"===typeof e&&J3.test(e)}function Q3(e){const t=e["font-size"]||e.fontSize;return Z3(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function e6(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const r=Q3(e);return Math.max(1,Math.min(Math.floor(t/r),n))}function t6(e,t){return{lines:[],line:"",width:0,maxLines:e6(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function n6(e){e.lines.push(e.line),e.line="",e.width=0}function r6(e,t){e.line+=t.value,e.width+=t.width}function i6(e,t,n){if(t.width>e.maxWidth)return t;const r=t.index;for(let i=1;i<5;i++){const 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 o6(e,t,n){const r=K3({string:t.value,measureText:n});for(;e.lines.length<e.maxLines;){let t=r.next();if(t.done)break;e.width+t.width>e.maxWidth&&2===t.breakOpportunity&&e.line.length>0?(t=e.hyphens.enabled?i6(e,t,r):t,n6(e),r6(e,t)):r6(e,t)}}function a6(e,t){const n=K3({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),r=t6(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){n6(r),i=!1;break}1===e.breakOpportunity?n6(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?r.width+=e.width:(e=r.hyphens.enabled?i6(r,e,n):e,n6(r),r6(r,e)):r6(r,e)}return{lines:r.lines,reduced:i}}function s6(e,t){const n=K3({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),r=t6(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){n6(r),i=!1;break}1===e.breakOpportunity?n6(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?n6(r):e.width>r.maxWidth?o6(r,e,t):(n6(r),r6(r,e)):r6(r,e)}return{lines:r.lines,reduced:i}}function l6(e){return{"break-all":a6,"break-word":s6}[e.wordBreak]}function c6(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const r=l6(n);if(!r)return;const i=e(n);if(i.width>n.maxWidth||V3(n.text)){const o=(Q3(n)-i.height)/2,a=r(n,function(e,t){return n=>t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}(n,e));t.node=function(e,t,n,r){const i={type:"container",children:[]};void 0!==t.id&&(i.id=t.id);let o=0;return e.lines.forEach(((a,s)=>{const l=cY({},t);l.text=a,l._lineBreak=!0,o+=n,e.reduced&&s===e.lines.length-1?l.text+=X3: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 u6(e,t){const n=e["font-family"]||e.fontFamily,r=e["font-size"]||e.fontSize,i="string"==typeof e.text?e.text:"".concat(e.text),{maxWidth:o}=e;if(void 0===o)return i;let a=t({text:i,fontSize:r,fontFamily:n}).width;if(a<=o)return i;let s=0,l=i.length-1;for(;s<=l;){let e=Math.floor((s+l)/2);a=t({text:i.substr(0,e)+X3,fontSize:r,fontFamily:n}).width,a<=o?s=e+1:l=e-1}return i.substr(0,l)+X3}function d6(e){const t=e.baseline||e["dominant-baseline"];let n=0;const 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}const h6={},p6={},f6={fontSize:void 0,fontFamily:void 0};let m6;function g6(e,t){return!e&&!t||e===t}function y6(e){let{text:t,fontWeight:n,fontSize:r,fontFamily:i}=e;const o="".concat(t," ").concat(n," ").concat(r," ").concat(i);return"number"!=typeof p6[o]&&(m6=m6||document.createElement("canvas").getContext("2d"),function(e){let{fontWeight:t,fontSize:n,fontFamily:r}=e;g6(f6.fontWeight,t)&&g6(f6.fontSize,n)&&g6(f6.fontFamily,r)||(m6.font=[t,n,r].filter((e=>!!e)).join(" "),f6.fontWeight=t,f6.fontSize=n,f6.fontFamily=r)}({fontWeight:n,fontSize:r,fontFamily:i}),p6[o]=m6.measureText(t).width),p6[o]}function v6(e){return"number"!=typeof h6[e]&&(h6[e]=function(e){if(Z3(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),h6[e]}function b6(e){let{text:t,fontWeight:n,fontSize:r,fontFamily:i}=e;return{width:y6({text:t,fontWeight:n,fontSize:r,fontFamily:i}),height:v6(r)}}function x6(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b6;const 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,c={x:0,y:s+((e.dy||0)+d6(e))-.75*i.height,width:o,height:i.height},u=e["text-anchor"]||e.anchor;return c.x="middle"===u?a+l-o/2:"end"===u?a+l-o:a+l,c}function w6(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b6;const n=l6(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||V3(e.text))){const o=n(e,(e=>t({text:e,fontFamily:i,fontSize:r}))),a=cY({},e);let s=0,l="";for(let e=0,n=o.lines.length;e<n;e++){let a=o.lines[e];a+=e===n-1&&o.reduced?X3:"";const c=t({text:a,fontSize:r,fontFamily:i}).width;c>=s&&(s=c,l=a)}a.text=l;const c=x6(a,t);return c.height=Q3(e)*o.lines.length,c}return x6(e,t)}function S6(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function C6(e,t,n){const 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;const 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 M6(e){let{cx:t,cy:n,r:r}=e;return{type:"circle",bounds:{cx:t,cy:n,r:r}}}function k6(e){return e.desc&&e.desc.slice?function(e){let{start:t,end:n,innerRadius:r,outerRadius:i,offset:o}=e;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let a=0!==r?r:i;return M6({cx:o.x,cy:o.y,r:a})}(e.desc.slice):"circle"===e.type?M6(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var E6={bar:function(e){let{settings:t,chart:n,nodes:r,rect:i,renderer:o,style:a}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I3;const l=cY({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map((e=>cY({},l,t,e))),u=t.labels.map((e=>e.placements.map((n=>cY({},l,t,e,n))))),{fitsHorizontally:d,hasHorizontalDirection:h,targetNodes:p}=function(e){let{nodes:t,rect:n,chart:r,labelSettings:i,placementSettings:o,settings:a,renderer:s}=e;const l={},c=[];let u,d,h,p,f,m,g,y=!0,v=!1;for(let e=0;e<t.length;e++){if(d=t[e],p=d.localBounds,!_1(p,n))continue;let b=v3(d,r);u={node:d,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<i.length;t++)m=i[t],h="function"==typeof m.label?m.label(b,e):void 0,b3(h)&&(g="function"==typeof a.direction?a.direction(b,e):a.direction||"up",v=v||"left"===g||"right"===g,l.fontFamily=m.fontFamily,l.fontSize="".concat(m.fontSize,"px"),l.text=h,f=s.measureText(l),u.measurements.push(f),u.texts.push(h),u.labelSettings.push(m),u.placementSettings.push(o[t]),u.direction=g,y=y&&f.width<=p.width-2*y3);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:v}}({nodes:r,chart:n,renderer:o,settings:t,rect:i,labelSettings:c,placementSettings:u}),f=function(e){let{orientation:t="auto",defaultOrientation:n="h"}=e;switch(t.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return n}}({orientation:t.orientation,defaultOrientation:h?"h":"v"}),m="h"===f?"y":"x",g="h"===f?"height":"width";return p.sort(((e,t)=>e.node.localBounds[m]+e.node.localBounds[g]-(t.node.localBounds[m]+t.node.localBounds[g]))),s({chart:n,targetNodes:p,stngs:t,rect:i,fitsHorizontally:d,collectiveOrientation:f})},slice:function(e){let{settings:t,chart:n,nodes:r,rect:i,renderer:o,style:a}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F3,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:j3;const c=cY({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);c.fontSize=parseInt(c.fontSize,10);const u=t.labels.map((e=>cY({},c,t,e))),d=t.labels.map((e=>e.placements.map((n=>cY({},c,t,e,n))))),h=[],p={insideLabelBounds:[]};r=function(e){const t=[],n=[],r=[],i=[];for(let o=0;o<e.length;++o){const{start:a,end:s}=e[o].desc.slice,l=D3((a+s)/2);switch(Math.floor(l/(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])}}const o=(e,t)=>D3((e.desc.slice.start+e.desc.slice.end)/2)-D3((t.desc.slice.start+t.desc.slice.end)/2),a=(e,t)=>o(t,e);return t.sort(a),n.sort(o),r.sort(a),i.sort(o),t.concat(n,i,r)}(r);const f={};for(let e=0,t=r.length;e<t;e++){const t=r[e],a=N3(t,n);for(let n=0;n<u.length;n++){const r=u[n],c="function"==typeof r.label?r.label(a,e):"";if(!c)continue;const m="function"==typeof r.direction?r.direction(a,e):r.direction||"horizontal",g="function"==typeof r.linkData?r.linkData(a,e):void 0,y=W3(c,r,o),v=s({context:f,direction:m,lblStngs:r,measured:y,node:t,placementSettings:d[n],rect:i,store:p}),b=v.bounds,x=v.placement;if(b&&x){if("outside"===x.position&&"rotate"!==m){q3({context:f,node:t,bounds:b});if(!p1(P3(b),i))continue}const n="function"==typeof x.fill?x.fill(a,e):x.fill,o=l(b,c,{fill:n,fontSize:r.fontSize,fontFamily:r.fontFamily,textMetrics:y});o&&(void 0!==g&&(o.data=g),h.push(o),b.line&&(b.line.stroke=n,h.push(b.line)))}}}return h},rows:function(e){let{settings:t,chart:n,nodes:r,renderer:i,style:o}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C6;const s=cY({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);const l=cY({},s,t),c=t.labels.map((e=>cY({},l,e))),u={},d=[];for(let e=0,t=r.length;e<t;e++){let t=r[e],o=S6(t,n),{type:s,bounds:h}=k6(t);if(!h)continue;let p,f=0,m=[],g=[],y="circle"===s?2*h.r*.9:h.height;for(f+=l.padding,p=0;p<c.length;p++){let t=c[p],n="function"==typeof t.label?t.label(o,e):"";u.fontFamily=t.fontFamily,u.fontSize="".concat(t.fontSize,"px"),u.text=n;let r=i.measureText(u);if(f+=r.height+t.padding,f>y)break;g.push(n),m.push(r)}const v=p,b=Math.max(0,y-f);let x;for(x="circle"===s?h.cy-.9*h.r:h.y,x+=l.justify*b+l.padding,p=0;p<v;p++){let t,n=c[p];if("circle"===s){let e=Math.max(Math.abs(x-h.cy),Math.abs(x+m[p].height-h.cy)),n=Math.sqrt(h.r*h.r-e*e);t={x:h.cx-n+l.padding,y:x,width:2*n-2*l.padding,height:m[p].height}}else t={x:h.x+l.padding,y:x,width:h.width-2*l.padding,height:m[p].height};x+=m[p].height+l.padding;let r="function"==typeof n.fill?n.fill(o,e):n.fill;const u="function"==typeof n.linkData?n.linkData(o,e):void 0;let f=a(t,g[p],{fill:r,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:m[p]});if(f){if(f.text&&f.text!==X3){const e=u6(f,i.measureText);if(X3===e)continue;f.ellipsed=e}void 0!==u&&(f.data=u),d.push(f)}}}return d}};const _6={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach((e=>{e.strategy&&E6[e.strategy.type]&&e.component&&t.push(...function(e,t){let{chart:n,source:r,rect:i,renderer:o,style:a}=e;if(!n.component(r.component))return[];const s=n.findShapes(r.selector).filter((e=>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:this.chart,rect:this.rect,renderer:this.renderer,source:e,style:this.style},E6[e.strategy.type]))})),t}};const R6={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,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}};function I6(e){let{x:t=0,y:n,item:r,globalMetrics:i,createSymbol:o,direction:a="ltr"}=e,s=r.label.displayObject,l=r.label.bounds,c=r.symbol.meta;const u="rtl"===a;let d={x:u?t+i.maxLabelBounds.width:t+i.maxSymbolSize+i.spacing,y:n,width:i.maxLabelBounds.width,height:Math.max(i.maxSymbolSize,i.maxLabelBounds.height)},h=function(e,t,n){const 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:u?t+i.maxLabelBounds.width+i.spacing:t,y:n,width:i.maxSymbolSize,height:d.height},c.size,{align:void 0===c.align?.5:c.align,justify:void 0===c.justify?.5:c.justify});const p=o(cY({},c,h));return delete p.collider,s.anchor=u?"end":"start",function(e,t,n){const r=n.textMetrics;if(e.height<r.height)return!1;const i=Math.max(0,e.width-r.width);t.baseline="text-before-edge";const 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)}(d,s,{textMetrics:l,fontSize:parseInt(s.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:r.label.displayObject.data,children:[p,s],collider:{type:"rect",x:t,y:n,width:i.maxItemBounds.width,height:i.maxItemBounds.height}},metrics:d}}function D6(e,t){const 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 A6(e,t){let n,r,i,o,{onScroll:a=()=>{}}=t,s=null,l=0;const c={itemize:t=>{n=function(e,t){let n,r,{resolved:i,dock:o}=e,a=[],s=i.items.items,l=i.symbols.items,c=i.labels.items,u=0,d=0,h=0;for(let e=0;e<s.length;e++){if(!1===s[e].show)continue;const i=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=cY({},c[e],{type:"text",fontSize:"".concat(parseInt(c[e].fontSize,10),"px"),text:i,title:i}),r={symbol:{meta:l[e]},label:{displayObject:n,bounds:t.textBounds(n)}},a.push(r),u=Math.max(l[e].size,u),d=Math.max(r.label.bounds.width,d),h=Math.max(r.label.bounds.height,h)}return{items:a,globalMetrics:{spacing:8,maxSymbolSize:u,maxItemBounds:{height:Math.max(u,h),width:u+8+d},maxLabelBounds:{width:d,height:h}},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),s=isNaN(n.layout.scrollOffset)?s:n.layout.scrollOffset},getItemsToRender:t=>{i=t.viewRect,l=c.getContentOverflow(i);const a=c.extent();s=Math.max(0,Math.min(s,l)),o=cY({},i);const u="horizontal"===c.orientation()?"x":"y";return o[u]-=s,o["x"===u?"width":"height"]=a,function(e,t,n){let{viewRect:r}=e,{itemized:i,create:o=I6,parallels:a,createSymbol:s}=n;const l=i.layout.direction,c=i.globalMetrics,u=i.items,d="horizontal"===i.layout.orientation;let h=0;const p=[],f=c.maxItemBounds.height,m=c.maxItemBounds.width,g=i.layout.margin.vertical+f,y=i.layout.margin.horizontal+m;let v=t.x,b=t.y,x=r.x-t.x;for(let e=0;e<u.length;e++){let n=o({y:b,x:"rtl"===l?r.x+x+r.width-m-(v-t.x):v,item:u[e],globalMetrics:c,direction:l,createSymbol:s});if((d&&v>=r.x-m||!d&&b>=r.y-f)&&p.push(n.item),h++,h>=a?(h=0,d?(v+=y,b=t.y):(b+=g,v=t.x)):d?b+=g:v+=y,!d&&b>r.y+r.height)break;if(d&&v>r.x+r.width)break}return p}(t,o,{itemized:n,parallels:r,createSymbol:e.symbol})},parallelize:(e,t)=>(r=function(e,t,n){const 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];let s=Math.ceil(a/e);if(null!=t){const e="horizontal"===n.layout.orientation?"height":"width",r="width"===e?"horizontal":"vertical",i=n.layout.margin[r]||4,o=Math.floor((t+i)/(i+n.globalMetrics.maxItemBounds[e]));s=Math.min(s,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(s,l))}(e,t,n),r),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return D6(n,r)>i[e]},getContentOverflow:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;const t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,D6(n,r)-e[t])},getNextSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},hasNext:()=>"horizontal"===c.orientation()?i.x+i.width<o.x+o.width:i.y+i.height<o.y+o.height,hasPrev:()=>"horizontal"===c.orientation()?o.x<i.x:o.y<i.y,next:()=>{c.scroll(-c.getNextSize())},prev:()=>{c.scroll(c.getPrevSize())},scroll:e=>{const t=Math.max(0,Math.min(l,s-e));t!==s&&(s=t,a())},offset:()=>s,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>D6(n,r),spread:()=>function(e,t){const 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 P6(e){return Object.keys(e).filter((t=>e[t])).join(" ")}const O6={up:"▲",right:"▶",down:"▼",left:"◀"};function T6(e,t){let{size:n,isActive:r,direction:i,nav:o,attrs:a}=t,s={},l="";const c=a;o&&o.button&&("function"==typeof o.button.class?s=o.button.class({direction:i}):o.button.class&&(s=o.button.class),"function"==typeof o.button.content&&(l=o.button.content(e,{direction:i})),void 0!==o.button.tabIndex&&(c.tabindex=o.button.tabIndex));const u={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(s).length||(u.border="0",u.background="none"),(!r||o&&o.disabled)&&(c.disabled="disabled"),e("button",cY({class:P6(s),style:u},c),[l||e("span",{style:{pointerEvents:"none"}},[O6[i]])])}function L6(e){let t;const n={itemize:e=>{t=function(e){let{dock:t,navigation:n}=e;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:n}}(e)},render:r=>function(e,t,n,r){let{rect:i,itemRenderer:o}=t;if(!e||!e.renderArgs)return;e.size(i);const a=e.renderArgs[0],s="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void e.render([]);const d=s?["right","left"]:["down","up"];l&&s&&d.reverse();const h=[a("div",{style:{position:"relative",display:"flex","flex-direction":s?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!s?"rtl":"ltr"},[T6(a,{size:32,isActive:c,direction:d[0],attrs:{"data-action":"next","data-component-key":r.settings.key},nav:n.navigation}),T6(a,{size:32,isActive:u,direction:d[1],attrs:{"data-action":"prev","data-component-key":r.settings.key},nav:n.navigation})])];e.render(h)}(n.renderer,r,t,e),extent:()=>32,spread:()=>64};return n}function q6(e){let t;const n={itemize:n=>{t=function(e,t){let{resolved:n}=e;if(!1===n.title.item.show)return null;const r=cY({},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){const e=t.scale.data().fields;r.text=e&&e[0]?e[0].title():""}return{displayObject:r,bounds:t.renderer.textBounds(r)}}(n,e)},render:e=>{!function(e,t,n){let{rect:r}=e;if(!t)return;const i=[];if(t.size(r),n){const e={start:0,end:r.width,middle:r.width/2};i.push(cY({},n.displayObject,{x:e[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(i)}(e,n.renderer,t)},spread:()=>t?t.bounds.height:0,extent:()=>t?t.bounds.width:0};return n}function N6(e,t,n,r){let i,o,a,{itemRenderer:s,navigationRenderer:l,titleRenderer:c,isPreliminary:u=!1}=r,d=0;const h={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(i={x:h.x,y:h.y,width:h.width,height:c.spread()},"horizontal"===n){i={x:h.x,y:h.y,width:c.extent(),height:c.spread()};const e=h.width-i.width-(i.width?t.spacing:0),n=h.height;s.parallelize(e,u?void 0:n);const r=s.extent()>e?l.extent():0,p=s.spread(),f=r?l.spread():0;o={x:i.x+i.width+(i.width?t.spacing:0),y:h.y+Math.max(0,(f-p)/2),width:h.width-r-i.width-(r?t.spacing:0)-(i.width?t.spacing:0),height:n},a={x:o.x+o.width+(r?t.spacing:0),y:h.y,width:r,height:h.height},i.y=o.y;"rtl"===s.direction()&&(a.x=h.x,o.x=a.x+a.width+(a.width?t.spacing:0),i.x=o.x+o.width+(i.width?t.spacing:0)),d=Math.max(i.height,f,s.spread())}else{const e=h.height-i.height-(i.height?t.spacing:0),n=h.width;s.parallelize(e,u?void 0:n);const r=s.extent()>e?l.extent():0;a={x:h.x,y:h.y+h.height-r,width:h.width,height:r},o={x:h.x,y:i.y+i.height+(i.height?t.spacing:0),width:h.width,height:h.height-i.height-(i.height?t.spacing:0)-a.height-(a.height?t.spacing:0)},d=Math.max(c.extent(),r?l.spread():0,s.spread())}return o=cY({},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:cY({},e,i),content:cY({},e,o),navigation:cY({},e,a),orientation:n,preferredSize:d}}function j6(e){e.state.resolved=function(e){const t=e.scale.domain();let n={items:[]};const r=e.settings.layout.dock;if("threshold-color"===e.scale.type){const i=e.scale.data().fields[0];let o=e=>String(e);e.settings.formatter?o=e.chart.formatter(e.settings.formatter):i&&(o=i.formatter());for(let e=0;e<t.length-1;e++){const r={value:t[e],label:"".concat(o(t[e])," - < ").concat(o(t[e+1]))};i&&(r.source={field:i.id()}),n.items.push(r)}"vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")&&n.items.reverse()}else{const r=e.scale.labels?e.scale.labels():null;n.items=t.map(((t,n)=>{const i=e.scale.datum?cY({},e.scale.datum(t)):{value:t};return i.value=t,e.scale.label?i.label=e.scale.label(t):r&&(i.label=r[n]),i}))}const i=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:cY(!0,{},R6.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:R6.layout,settings:e.settings.settings.layout}),a=e.resolver.resolve({data:n,defaults:cY(!0,{},R6.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),s=cY(!0,{},(e.settings.settings.item||{}).shape);void 0===s.fill&&e.settings.scale&&(s.fill={scale:e.settings.scale});const l=e.resolver.resolve({data:n,defaults:cY(!0,{},R6.item.shape,e.style.item.shape),settings:s}),c=e.resolver.resolve({data:n,defaults:cY(!0,{},{show:R6.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function u(e,n){let r=e.data.value,i=t[n+1];e.data.value=[r,i]}"threshold-color"===e.scale.type&&("vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")?(c.items.reverse().forEach(u),c.items.reverse()):c.items.forEach(u));return{title:i,labels:a,symbols:l,items:c,layout:o}}(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 z6(e){const{rect:t,settings:n,state:r,itemRenderer:i,navigationRenderer:o,titleRenderer:a}=e,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",c=N6(t,r.display,l,{itemRenderer:i,navigationRenderer:o,titleRenderer:a});e.renderer.size(c.content);let u=i.getItemsToRender({viewRect:cY({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:i}),a.render({rect:c.title}),e.state.views={layout:c},u}const F6={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(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(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart(){if(this.state.interaction.started)return;this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove(e){if(!this.state.interaction.started)return;const 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(){this.state.interaction.started=!1},scroll(e){this.itemRenderer.scroll(-e)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const e=z6(this);this.update(e)},this.itemRenderer=A6(this,{onScroll:this.onScroll}),this.navigationRenderer=L6(this),this.titleRenderer=q6(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),j6(this)},preferredSize(e){return function(e,t){let n=0;const r=e.settings.layout.dock||"center",i="top"===r||"bottom"===r?"horizontal":"vertical",o=e.state.display,a=N6(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,n}(this,e)},beforeUpdate(){j6(this)},render(){return z6(this)},beforeDestroy(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo(){return{offset:this.itemRenderer.offset()}}};function W6(e,t){let n=0;const 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 $6(e,t,n){const r=n[e];return"object"==typeof r?-1!==r.valid.indexOf(t)?t:r.default:n.default}function B6(e){return $6(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 H6(e,t){const 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 V6(e){const t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,r=e.chart.scale(e.stgns.fill),i=e.chart.scale(e.stgns.major),o=function(e,t){const n=t.domain();let r=n,i=e.stgns.tick.label;!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));const o=n.map(((n,i)=>{const 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})}}));return o}(e,i),a=function(e){return $6(e.layout.dock,e.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"})}(e.settings);if(void 0===n.text){const e=i.data().fields;n.text=e&&e[0]?e[0].title():""}const s=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),l=e.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),c={isVertical:t,nodes:[],title:{anchor:B6(e.settings),textMetrics:s,textBounds:l,requiredWidth:()=>{if(!n.show)return 0;let e=l.width,r=n.maxLengthPx;return t||(e+=n.padding,r+=n.padding),Math.min(e,r,c.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let e=l.height;return t&&(e+=n.padding),Math.min(e,c.rect.height)}},ticks:{values:o,anchor:a,length:Math.min(Math.max(...o.map((e=>e.textMetrics.width))),e.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===a?Math.max(...c.ticks.values.map((e=>e.textMetrics.height)))+e.stgns.tick.padding:0,height:Math.max(...o.map((e=>e.textMetrics.height)))},legend:{fillScale:r,majorScale:i,length:()=>{const n=t?"height":"width",r=t?"requiredHeight":"requiredWidth",i=Math.min(c.rect[n],c.rect[n]*e.stgns.length)-c.title[r]();return Math.max(0,Math.min(i,e.stgns.maxLengthPx))}}};return c}const G6={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(e){const t=this.state;t.rect=H6(this,e.inner);let n=this.stgns.size;const r=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=r;const i=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){const e=t.ticks.values.reduce(((e,t)=>e+t.textMetrics.height),0);if(e>this.state.legend.length())return i;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return i;n+=Math.max(...t.ticks.values.map((e=>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(){this.stgns=this.settings.settings,this.state=V6(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=V6(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=H6(this,e.size),this.stgns.title.show){const e=function(e){const t=e.state,n=e.stgns,r="left"===t.ticks.anchor,i="top"===t.ticks.anchor;let 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");const 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 W6(e,l),l}(this);this.state.nodes.push(e)}const t=function(e){const t=e.state.legend.fillScale,n=e.state.legend.majorScale,r=t.domain().map((e=>({type:"stop",color:t(e),offset:Math.min(1,Math.max(0,n.norm(e)))})));return r.sort(((e,t)=>e.offset-t.offset))}(this),n=function(e,t){const n=e.state,r=e.stgns,i=n.rect;let 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());const c={type:"rect",x:o,y:a,width:s,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return W6(e,c),c}(this,t),r=function(e,t){const n=e.state,r=e.stgns;let i="start";const 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((a=>{let s=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=t.y+t.height*a.pos,u=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,c-=.25*a.textMetrics.height,i=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+r.tick.padding,c=.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:c,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:u}}));return{type:"container",id:"legend-seq-ticks",children:[...a,o]}}(this,n),i={id:"legend-seq-target",type:"container",children:[n,r]};this.state.nodes.push(i)},render(){return this.state.nodes}};const U6={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},layers:{curve:"linear",show:!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 Y6(e,t){let{generatorType:n,item:r,data:i,major:o,minor:a,layerObj:s,stngs:l}=t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:e,generatorType:n,major:o,minor:a,layerObj:s,stngs:l,opacity:r.opacity,stroke:r.stroke,strokeWidth:r.strokeWidth,strokeLinejoin:r.strokeLinejoin,fill:c||r.fill,data:i};return r.strokeDasharray&&(u.strokeDasharray=r.strokeDasharray),u}function K6(e){const{metaLayers:t,coordinates:n,layers:r,lines:i,areas:o}=function(e){let{data:t,stngs:n,rect:r,resolver:i,style:o,domain:a}=e;const{width:s,height:l}=r,c=i.resolve({data:t,defaults:U6.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:s,minor:"vertical"===n.orientation?s:l}}),u=!n.connect&&a.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),d={};let h=0;for(let e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(u){const e=d[n]?d[n].items[d[n].items.length-1]:null,r=e?a.indexOf(e.data.major?e.data.major.value:e.data.value):null;e&&a.indexOf(t.data.major?t.data.major.value:t.data.value)-1!==r&&d[n].items.push({dummy:!0})}d[n]=d[n]||{order:h++,id:n,items:[],dataItems:[],consumableData:{}},d[n].dataItems.push(t.data),d[n].items.push(t)}const p=Object.keys(d).map((e=>(d[e].consumableData=pY({points:d[e].dataItems},d[e].dataItems[0]),d[e]))),f={items:p.map((e=>e.consumableData))},m=n.layers||{};return{coordinates:c,metaLayers:p,layers:i.resolve({data:f,defaults:{curve:U6.layers.curve,show:U6.layers.show},settings:{curve:m.curve,show:m.show}}),lines:i.resolve({data:f,defaults:cY({},U6.layers.line,o.line),settings:m.line}),areas:i.resolve({data:f,defaults:cY({},U6.layers.area,o.area),settings:m.area})}}(e),a=[];return t.forEach(((t,s)=>{const l=r.items[s];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=t.id;const c=[],u=[];let d,h;for(let r=0;r<t.items.length;r++){if(d=t.items[r],h=d.data,!d.dummy){if(isNaN(d.major))continue;e.missingMinor0&&(d.minor0=n.settings.minor.scale?n.settings.minor.scale(h.minor0?h.minor0.value:0):0),isNaN(d.minor)||c.push(d.minor),l.data.push(d.data)}u.push(d)}const p=c.sort(((e,t)=>e-t))[Math.floor((c.length-1)/2)];a.push({layerObj:l,lineObj:i.items[s],areaObj:o.items[s],median:p,points:u,consumableData:t.consumableData})})),a}const X6={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(e){let{data:t}=e;const{width:n,height:r}=this.rect;this.stngs=this.settings.settings||{};const i=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,o=K6({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:i,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){const e=o.map((e=>({id:e.layerObj.id,data:e.layerObj.data}))).sort(this.stngs.layers.sort).map((e=>e.id));o.sort(((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id)))}else o.sort(((e,t)=>e.median-t.median));return function(e,t){let{width:n,height:r,missingMinor0:i,stngs:o}=t;const a=[],s=o.layers||{};return e.forEach((e=>{const{lineObj:t,layerObj:l,areaObj:c,points:u}=e;let d={size:r,p:"y"},h={size:n,p:"x"};if("vertical"===o.orientation){const e=cY(!0,{},h);h=cY(!0,{},d),d=cY(!0,{},e)}s.area&&!1!==c.show&&a.push(Y6(u,{data:e.consumableData,item:c,generatorType:"area",major:h,minor:d,layerObj:l,stngs:o})),t&&!1!==t.show&&(a.push(Y6(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"1"),major:h,minor:d,layerObj:l,stngs:o},"none")),!i&&s.area&&!1!==c.show&&!1!==t.showMinor0&&a.push(Y6(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"0"),major:h,minor:d,layerObj:l,stngs:o},"none")))})),a}(o,{width:n,height:r,missingMinor0:i,stngs:this.stngs})}};function J6(e,t){let n,r,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof t.center?(n=t.center.x,r=t.center.y):(n=t.clientX,r=t.clientY);const 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 Z6(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function Q6(e,t){const 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}}const e4={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const t=J6(this,e,!1);I1({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=function(e){return e.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"})))}(this.settings),this.state.start=J6(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=J6(this,e),function(e){if(e.state.active){const t=Z6(e,e.state.start),n=Z6(e,e.state.end),r=e.chart.shapesAt(Q6(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(r,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([cY({type:"rect"},Q6(t.state.start,t.state.end),t.style.area)]))},end(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{Array.isArray(e.contexts)&&e.contexts.forEach((e=>{t.brush(e).end()}))})),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function t4(e,t,n){let{renderer:r,style:i,props:o,h:a}=n;const 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),c=a("div",{dir:o.direction,class:P6(cY({"pic-tooltip":!0},s.tooltip)),style:cY({position:"relative",display:"inline-block"},t.computedTooltipStyle)},a("div",{style:i.content,class:P6(cY({"pic-tooltip-content":!0},s.content))},l),a("div",{class:P6(cY({"pic-tooltip-arrow":!0},s.arrow)),style:cY({},i.arrow,i["arrow-".concat(t.dock)],t.computedArrowStyle)}));return r.render(c),r.element().children[0]}function n4(e){let{defaultDuration:t,defaultDelay:n}=e,r=null,i=null,o=!1;const a=function(){const e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return e.set=e=>{n=e,t[n].forEach((t=>t(e)))},e.on=(e,n)=>{Array.isArray(e)?e.forEach((e=>t[e].push(n))):t[e].push(n)},e.destroy=()=>{Object.keys(t).forEach((e=>{t[e].length=0}))},e}(),s=function(){},l=()=>{r=null,i=null,o=!1,a.set("fulfilled")};return s.invoke=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;r&&(clearTimeout(r),a.set("debounced")),a.set("pending"),r=setTimeout((()=>{e(),o=!0,r=null,a.set("active")}),c),s>0&&(i&&clearTimeout(i),i=setTimeout(l,s+Math.max(c,0)))},s.clear=()=>{o?a.set("cancelled"):r&&(clearTimeout(r),a.set("rejected")),i&&clearTimeout(i),r=null,i=null,o=!1},s.on=(e,t)=>{a.on(e,t)},s.destroy=()=>{s.clear(),a.destroy()},s}function r4(){let 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)"),inside:"translate(-50%, -50%)"}}function i4(e,t){let 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},inside:{x:-e/2,y:-t/2}}}function o4(e,t){const n=e>0?"-":"+";return e=Math.abs(e),void 0===t&&(t=e),{left:{left:"100%",top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},top:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"100%",borderWidth:"".concat(t,"px")},bottom:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(t,"px")},inside:{left:"0px",top:"0px",borderWidth:"0px"}}}function a4(e,t,n,r,i,o){const a=t+o.x,s=n+o.y,l=i;return!(a<0||s<0)&&!(a+r>e.width||s+l>e.height)}function s4(e){let{area:t,vx:n,vy:r,width:i,height:o,offset:a}=e;const s=n+a.x,l=r+a.y,c=i,u=o;let d=s<0?-s:0,h=l<0?-l:0;return d+=s+c>t.width?-(s+c-t.width):0,h+=l+u>t.height?-(l+u-t.height):0,{x:d,y:h}}function l4(e){let{options:t,pointer:n,width:r,height:i,dockOrder:o,x:a,y:s}=e;const{targetBounds:l}=n,c=r4(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u},computedArrowStyle:o4(t.offset)[t.dock],dock:t.dock};const d={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},h=i4(r,i,t.offset),p=[],f="target"===t.area?a:l.left+a,m="target"===t.area?s:l.top+s;for(let e=0;e<o.length;e+=1){const n=o[e],l=s4({area:d,vx:f,vy:m,width:r,height:i,offset:h[n]}),u={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c[n]},g=o4(t.offset)[n];0!==l.x&&(u.width="".concat(r-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(a+l.x,"px"),g.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:g,dock:n,rect:{width:r,height:i}};if(0===l.x&&0===l.y)return y;y.offset=l,p.push(y)}return p.sort(((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x))),p[0]}function c4(e,t,n){const 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}};const i=r.rect;return cY({scaleRatio:i.scaleRatio},i.computedInner)}const u4={bounds:function(e){let{resources:t,nodes:n,pointer:r,width:i,height:o,options:a}=e;const{targetBounds:s}=r,{x:l,y:c,width:u,height:d}=t.getNodeBoundsRelativeToTarget(n[0]),h={left:{x:l,y:c+d/2},right:{x:l+u,y:c+d/2},top:{x:l+u/2,y:c},bottom:{x:l+u/2,y:c+d},inside:{x:l+u/2,y:c+d/2}},p=r4(a.offset),f=p[a.dock];if(f)return{computedTooltipStyle:{left:"".concat(h[a.dock].x,"px"),top:"".concat(h[a.dock].y,"px"),transform:f},computedArrowStyle:o4(a.offset)[a.dock],dock:a.dock};const m={width:"target"===a.area?s.width:window.innerWidth,height:"target"===a.area?s.height:window.innerHeight},g=i4(i,o,a.offset),y=["top","left","right","bottom","inside"];for(let e=0;e<y.length;e+=1){const t=y[e];if(a4(m,"target"===a.area?h[t].x:s.left+h[t].x,"target"===a.area?h[t].y:s.top+h[t].y,i,o,g[t]))return{computedTooltipStyle:{left:"".concat(h[t].x,"px"),top:"".concat(h[t].y,"px"),transform:p[t]},computedArrowStyle:o4(a.offset)[t],dock:t}}const v=function(e){let{options:t,docks:n,dockOffsets:r,targetBounds:i,area:o,width:a}=e;const s="top",l="target"===t.area?n[s].x:i.left+n[s].x,c=("target"===t.area?n[s].y:(i.top,n[s].y),r[s]),u=l+c.x,d=(c.y,a);let h=n.top.x;return u<0&&u+d>o.width||(u<0?h-=u:u+d>o.width&&(h-=u+d-o.width)),h}({options:a,docks:h,dockOffsets:g,targetBounds:s,area:m,width:i});return{computedTooltipStyle:{left:"".concat(v,"px"),top:"".concat(h.top.y,"px"),transform:p.top},computedArrowStyle:o4(a.offset+v-h.top.x,a.offset).top,dock:"top"}},pointer:function(e){let{options:t,pointer:n,width:r,height:i}=e;const{x:o,y:a}=n;return l4({x:o,y:a,pointer:n,width:r,height:i,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){let{options:t,pointer:n,width:r,height:i,nodes:o,resources:a}=e;const s=o[0],{dx:l,dy:c}=n,u=a.getComponentBoundsFromNode(s),d=l+u.x+u.width/2,h=c+u.y+u.height/2,{start:p,end:f,outerRadius:m}=s.desc.slice,g=(p+f)/2-Math.PI/2,y=2*Math.PI,v=(g%y+y)%y;let b=["top","left","right","bottom"];return"auto"===t.dock&&(b=v<=Math.PI/4||v>=7*Math.PI/4?["right","top","bottom","left"]:v<=3*Math.PI/4?["bottom","left","right","top"]:v<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),l4({x:d+m*u.scaleRatio.x*Math.cos(v),y:h+m*u.scaleRatio.y*Math.sin(v),pointer:n,width:r,height:i,options:t,dockOrder:b})}};function d4(e,t){let{width:n,height:r}=e,{chart:i,state:o,props:a}=t;const s={resources:{formatter:i.formatter,scale:i.scale,component:i.component,getComponentBoundsFromNode:e=>c4(e,o.pointer,i),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const r=c4(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=typeof a.placement;if("object"===l&&"function"==typeof a.placement.fn)return a.placement.fn(s);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=cY(c,a.placement(s))),"object"===l&&u4[a.placement.type]?c=cY(c,a.placement):"string"===l&&u4[a.placement]&&(c=cY(c,{type:a.placement})),s.options=c;const u=u4[c.type](s);let{x:d,y:h,width:p,height:f}=s.resources.getComponentBoundsFromNode(s.nodes[0]);return d+=s.pointer.dx,p+=d,h+=s.pointer.dy,f+=h,u.computedTooltipStyle.left="".concat(Math.min(Math.max(0,d,parseFloat(u.computedTooltipStyle.left)),p),"px"),u.computedTooltipStyle.top="".concat(Math.min(Math.max(0,h,parseFloat(u.computedTooltipStyle.top)),f),"px"),u}let h4;function p4(){h4=null}const f4={duration:8e3,delay:500,filter:e=>e.filter((e=>e.data&&void 0!==e.data.value)),extract:e=>e.node.data.value,content:e=>{let{h:t,data:n}=e;return n.map((e=>t("div",{},e)))},isEqual:(e,t)=>e.length&&e.length===t.length&&e.every(((e,n)=>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};const m4={require:["chart","renderer"],defaultSettings:{settings:f4,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(){this.hide()},show(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent(e){this.prevent(e)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(e){let t,{nodes:n,duration:r,delay:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(e,t){let{chart:n,state:r}=t,i=0,o=0;e.center?(i+=e.center.x,o+=e.center.y):(i+=e.clientX,o+=e.clientY);const a=n.element.getBoundingClientRect(),s=r.targetElement.getBoundingClientRect(),l=i,c=o,u=a.left-s.left,d=a.top-s.top,h=i-a.left,p=o-a.top;return i-=s.left,o-=s.top,{x:i,y:o,dx:u,dy:d,cx:h,cy:p,clientX:l,clientY:c,targetBounds:s,chartBounds:a}}(e,this),t=Array.isArray(n)?this.props.filter(n):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((()=>this.invokeRenderer(this.state.activeNodes)),r,i)))},prevent(e){this.state.prevent=!!e},init(e){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=n4({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",(()=>{!function(e){h4&&h4!==e&&h4()}(t),h4=t,"function"==typeof this.props.beforeShow&&this.props.beforeShow.call(void 0,{resources:{formatter:this.chart.formatter,scale:this.chart.scale}})})),this.dispatcher.on(["cancelled","fulfilled"],(()=>{const e={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,cY({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,cY({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),h4===t&&(h4=null),this.state.tooltipElm=void 0})),this.dispatcher.on("active",(()=>{"function"==typeof this.props.afterShow&&this.props.afterShow.call(void 0,{element:this.state.tooltipElm,resources:{formatter:this.chart.formatter,scale:this.chart.scale}})}))},created(){this.init(this.settings)},beforeUpdate(e){let{settings:t}=e;this.dispatcher&&(this.dispatcher.destroy(),p4()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),p4()},appendTo(){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;const{width:e,height:t}=this.state.targetElement.getBoundingClientRect();this.renderer.destroy(),this.renderer.size({width:e,height:t}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(e){const t=function(e,t){let{chart:n,scale:r,props:i,h:o}=t;const a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:r,h:o},s=[];return e.forEach((e=>{if("function"==typeof i.extract){const t=cY({node:e},a);s.push(i.extract(t))}})),s}(e,this),n=d4(t4(t,{},this).getBoundingClientRect(),this);this.state.tooltipElm=t4(t,n,this)}};const g4={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes(this.props.selector).filter((e=>e.key===this.props.target)),t=e.filter((e=>e.collider)).map((e=>e.collider));t.forEach((e=>{e.fill=this.props.fill,e.stroke=this.props.stroke,e.opacity=this.props.opacity,e.collider={type:null}})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var y4={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},v4=/([astvzqmhlc])([^astvzqmhlc]*)/gi,b4=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function x4(e){const t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(v4,((e,n,r)=>{const i=function(e){const t=e.match(b4);return t?t.map(Number):[]}(r);let o=n.toLowerCase(),a=n;if("m"===o&&i.length>2&&(t.push([a,...i.splice(0,2)]),o="l",a="m"===a?"l":"L"),i.length<y4[o])return"";for(t.push([a,...i.splice(0,y4[o])]);i.length>=y4[o]&&i.length&&y4[o];)t.push([a,...i.splice(0,y4[o])]);return""})),t}const w4=2*Math.PI;function S4(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function C4(e,t,n,r,i){const o=1-e;return o**3*t+3*o**2*e*n+3*o*e**2*r+e**3*i}function M4(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||function(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))}(e,t,n,r)<=10)return i[i.length-1]!==e&&i.push(e),i.push(r),i;const a=S4(e,t),s=S4(t,n),l=S4(n,r),c={x:C4(.5,e.x,t.x,n.x,r.x),y:C4(.5,e.y,t.y,n.y,r.y)},u=S4(a,s),d=S4(s,l);return M4(e,a,u,c,i,o-1),M4(c,d,l,r,i,o-1),i}function k4(e,t,n){const{cp1:r,cp2:i}=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 M4(e,r,i,n)}function E4(e,t,n){const r=[],i=!!e[4],o=!!e[5],a=e[3];let s,l,c,u,d=e[6],h=e[7],p=e[1],f=e[2];if("a"===e[0]&&(d+=t,h+=n),t===h&&n===h)return r;if(!p||!f)return r.push({x:d,y:h}),r;({cx:s,cy:l,rx:p,ry:f,sweepAngle:c,startAngle:u}=function(e,t,n,r,i,o,a,s,l){let c,u,d,h,p,f;const m=H0(n%360),g=Math.cos(m),y=Math.sin(m),v=(s-o)/2,b=(l-a)/2,x=g*v+y*b,w=g*b-y*v;f=x**2/(e=Math.abs(e))**2+w**2/(t=Math.abs(t))**2,f>1&&(f=Math.sqrt(f),e*=f,t*=f);const S=e*w,C=t*x,M=S**2+C**2,k=(e*t)**2-M;let E=Math.sqrt(Math.max(k/M,0));r===i&&(E=-E);const _=E*(S/t),R=E*(-C/e);h=g*_-y*R+(s+o)/2,p=y*_+g*R+(l+a)/2;const I=(x-_)/e,D=(w-R)/t,A=(-x-_)/e,P=(-w-R)/t;return c=Math.atan2(D,I),c+=c<0?w4:0,u=Math.atan2(P,A),u+=u<0?w4:0,d=u-c,!i&&c<u?d-=w4:i&&u<c&&(d+=w4),d%=w4,{startAngle:c,sweepAngle:d,cx:h,cy:p,rx:e,ry:t}}(p,f,a,i,o,d,h,t,n));const m=Math.abs(c*Math.sqrt((p**2+f**2)/2)),g=Math.ceil(m/10),y=c/g;for(let e=1;e<=g;e++){const t=(u+y*e)%w4,n=Math.cos(t),i=Math.sin(t);r.push({x:s+n*p+-i*n,y:l+i*f+n*i})}return r}function _4(e){const t=x4(e),n=[],r=[];let i=0,o=0,a=null,s=null,l=null,c=null;for(let e=0;e<t.length;++e){const u=t[e],d=u[0];switch("S"!==d&&"s"!==d&&"C"!==d&&"c"!==d&&(a=null,s=null),"T"!==d&&"t"!==d&&"Q"!==d&&"q"!==d&&(l=null,c=null),d){case"m":r.length&&n.push(r.splice(0));case"l":i+=u[1],o+=u[2],r.push({x:i,y:o});break;case"M":r.length&&n.push(r.splice(0));case"L":i=u[1],o=u[2],r.push({x:i,y:o});break;case"H":i=u[1],r.push({x:i,y:o});break;case"h":i+=u[1],r.push({x:i,y:o});break;case"V":o=u[1],r.push({x:i,y:o});break;case"v":o+=u[1],r.push({x:i,y:o});break;case"a":r.push(...E4(u,i,o)),i+=u[6],o+=u[7];break;case"A":r.push(...E4(u,i,o)),i=u[6],o=u[7];break;case"c":r.push(...M4({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o},{x:u[5]+i,y:u[6]+o})),a=u[3]+i,s=u[4]+o,i+=u[5],o+=u[6];break;case"C":r.push(...M4({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),a=u[3],s=u[4],i=u[5],o=u[6];break;case"s":null!==a&&null!==a||(a=i,s=o),r.push(...M4({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),a=u[1]+i,s=u[2]+o,i+=u[3],o+=u[4];break;case"S":null!==a&&null!==a||(a=i,s=o),r.push(...M4({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),a=u[1],s=u[2],i=u[3],o=u[4];break;case"Q":r.push(...k4({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],i=u[3],o=u[4];break;case"q":r.push(...k4({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),l=u[1]+i,c=u[2]+o,i+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...k4({x:i,y:o},{x:l,y:c},{x:u[1],y:u[2]})),i=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...k4({x:i,y:o},{x:l,y:c},{x:u[1]+i,y:u[2]+o})),i+=u[1],o+=u[2];break;case"z":case"Z":r.length&&r.push({x:r[0].x,y:r[0].y})}}return function(e){for(let t=0;t<e.length-1;t++){const 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}const R4={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes("path").filter((e=>e.key===this.props.target)),t=[];e.forEach((e=>{_4(e.attrs.d).forEach((e=>{e.forEach((e=>{t.push({type:"circle",cx:e.x,cy:e.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})}))}))})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var I4=[function(e){e.component("box",I2),e.component("box-marker",I2)},function(e){e.component("point",N2),e.component("point-marker",N2)},function(e){e.component("pie",W2)},function(e){e.component("grid-line",G2)},function(e){e.component("ref-line",r5)},function(e){e.component("axis",P5)},function(e){e.component("container",O5)},function(e){e.component("text",q5)},function(e){e.component("scrollbar",z5)},function(e){e.component("brush-range",e3),e.component("brush-area-dir",i3)},function(e){e.component("range",l3)},function(e){e.component("brush-lasso",f3)},function(e){e.component("labels",_6)},function(e){e.component("legend-cat",F6)},function(e){e.component("legend-seq",G6)},function(e){e.component("line",X6)},function(e){e.component("brush-area",e4)},function(e){e.component("tooltip",m4)},function(e){e.component("debug-collider",g4)},function(e){e.component("debug-path-to-points",R4)}];let D4=class{constructor(e){this._parent=null,this._children=[],this._ancestors=null,this.type=e,this.data=null}detach(){return this._parent&&this._parent.removeChild(this),this}get parent(){return this._parent}get isBranch(){return this._children&&this._children.length}get children(){return this._children}get ancestors(){return this._ancestors||(this._ancestors=[],this.parent&&this._ancestors.push(this.parent,...this.parent.ancestors)),this._ancestors}get descendants(){let e=[];const t=this.children.length;let n,r;for(n=0;n<t;n++)r=this.children[n],e.push(r),r.children.length&&(e=[...e,...r.descendants]);return e}equals(e){const t=this.children,n=e.children;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(!t[e].equals(n[e]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map((e=>e.toJSON()))}}};class A4{constructor(){let{x:e=0,y:t=0,width:n=0,height:r=0,minWidth:i=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x:e,y:t,width:n,height:r,minWidth:i,minHeight:o})}set(){let{x:e=0,y:t=0,width:n=0,height:r=0,minWidth:i=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="rect",n>=0?(this.x=e,this.width=Math.max(n,i)):(this.x=e+Math.min(n,-i),this.width=-Math.min(n,-i)),r>=0?(this.y=t,this.height=Math.max(r,o)):(this.y=t+Math.min(r,-o),this.height=-Math.min(r,-o))}containsPoint(e){return I1(this,e)}intersectsLine(e){return D1(this,wY(e))}intersectsRect(e){return _1(this,xY(e))}intersectsCircle(e){return w1(e,this)}intersectsPolygon(e){return E1(e,this)}intersectsGeoPolygon(e){return j1(e,this)}points(){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}]}}class P4{constructor(){let{cx:e=0,cy:t=0,r:n=0,minRadius:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({cx:e,cy:t,r:n,minRadius:r})}set(){let{cx:e=0,cy:t=0,r:n=0,minRadius:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="circle",this.cx=e,this.cy=t,this.r=Math.max(n,r),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return x1(this,e)}intersectsLine(e){return S1(this,wY(e))}intersectsRect(e){return w1(this,xY(e))}intersectsCircle(e){return n=e,!g1(t=this)&&!g1(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return C1(this,e)}intersectsGeoPolygon(e){return L1(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class O4{constructor(){let{x1:e=0,y1:t=0,x2:n=0,y2:r=0,tolerance:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x1:e,y1:t,x2:n,y2:r,tolerance:i})}set(){let{x1:e=0,y1:t=0,x2:n=0,y2:r=0,tolerance:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="line",this.x1=e,this.y1=t,this.x2=n,this.y2=r,this.tolerance=Math.max(0,Math.round(i)),this.vectors=this.points(),this.zeroSize=e===n&&t===r}containsPoint(e){if(this.tolerance>0){return S1({cx:e.x,cy:e.y,r:this.tolerance},this)}return P1(this,e)}intersectsLine(e){return A1(this,wY(e))}intersectsRect(e){return D1(xY(e),this)}intersectsCircle(e){return S1(e,this)}intersectsPolygon(e){return k1(e,this)}intersectsGeoPolygon(e){return N1(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class T4{constructor(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polygon",this.vertices=e.slice(),this.edges=[],function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}(this.vertices),!(this.vertices.length<=2)){!function(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.vertices.length;e++)e<this.vertices.length-1&&this.edges.push([this.vertices[e],this.vertices[e+1]]),this.xMin=isNaN(this.xMin)?this.vertices[e].x:Math.min(this.xMin,this.vertices[e].x),this.xMax=isNaN(this.xMax)?this.vertices[e].x:Math.max(this.xMax,this.vertices[e].x),this.yMin=isNaN(this.yMin)?this.vertices[e].y:Math.min(this.yMin,this.vertices[e].y),this.yMax=isNaN(this.yMax)?this.vertices[e].y:Math.max(this.yMax,this.vertices[e].y);this._bounds=null,this._boundingRect=null}}containsPoint(e){return M1(this,e)}intersectsCircle(e){return C1(e,this)}intersectsLine(e){return k1(this,wY(e))}intersectsRect(e){return E1(this,xY(e))}intersectsPolygon(e){return O1(this,e)}intersectsGeoPolygon(e){return T1(e,this)}points(){return this.vertices}bounds(){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}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function L4(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new T4(...t)}function q4(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function N4(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}class j4{constructor(){let{vertices:e=[[]]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="geopolygon",this.vertices=e.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.numPolygons;e++)N4(this.vertices[e]),this.vertices[e].length>2&&q4(this.vertices[e]),this.polygons[e]=L4({vertices:this.vertices[e]}),this.xMin=isNaN(this.xMin)?this.polygons[e].xMin:Math.min(this.xMin,this.polygons[e].xMin),this.xMax=isNaN(this.xMax)?this.polygons[e].xMax:Math.max(this.xMax,this.polygons[e].xMax),this.yMin=isNaN(this.yMin)?this.polygons[e].yMin:Math.min(this.yMin,this.polygons[e].yMin),this.yMax=isNaN(this.yMax)?this.polygons[e].yMax:Math.max(this.yMax,this.polygons[e].yMax);this._bounds=null,this._boundingRect=null}containsPoint(e){return q1(this,e)}intersectsCircle(e){return L1(e,this)}intersectsLine(e){return N1(this,wY(e))}intersectsRect(e){return j1(this,xY(e))}intersectsPolygon(e){return T1(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!_1(n,r)&&(R1(r,n)?b1(t,e):b1(e,t))}(this,e)}points(){return this.vertices}bounds(){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}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function z4(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new j4(...t)}class F4{constructor(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({points:e})}set(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polyline",this.segments=[],this._points=e.slice(),this._points.length>1)for(let e=0,r=this._points.length-1;e<r;e++)t=this._points[e],n=this._points[e+1],(t.x!==n.x||t.y!==n.y)&&this.segments.push({x1:this._points[e].x,y1:this._points[e].y,x2:this._points[e+1].x,y2:this._points[e+1].y});var t,n}containsPoint(e){return this.segments.some((t=>P1(t,e)))}intersectsCircle(e){return this.segments.some((t=>S1(e,t)))}intersectsLine(e){const t=wY(e);return this.segments.some((e=>A1(e,t)))}intersectsRect(e){const t=xY(e);return this.segments.some((e=>D1(t,e)))}intersectsPolygon(e){return this.segments.some((t=>k1(e,t)))}intersectsGeoPolygon(e){return this.segments.some((t=>N1(e,t)))}points(){return this._points}}const W4=EK();function $4(e,t){return W4.get(e)(t)}W4.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new A4(...t)})),W4.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new P4(...t)})),W4.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new O4(...t)})),W4.add("polygon",L4),W4.add("geopolygon",z4),W4.add("polyline",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new F4(...t)}));class B4{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],e.forEach((e=>{const t=$4(e.type,e);t&&this.geometries.push(t)}))}containsPoint(e){return this.geometries.some((t=>t.containsPoint(e)))}intersectsLine(e){return this.geometries.some((t=>t.intersectsLine(e)))}intersectsRect(e){return this.geometries.some((t=>t.intersectsRect(e)))}intersectsCircle(e){return this.geometries.some((t=>t.intersectsCircle(e)))}intersectsPolygon(e){return this.geometries.some((t=>t.intersectsPolygon(e)))}intersectsGeoPolygon(e){return this.geometries.some((t=>t.intersectsGeoPolygon(e)))}}class H4{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new H4).multiply(this)}set(e){return this._elements=e,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(e){let 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}translate(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}rotate(e){let t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}multiply(e){let t,n,r,i;if(e instanceof H4&&(e=e._elements),Array.isArray(e)){for(r=[[0,0,0],[0,0,0],[0,0,0]],t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)for(i=0;i<3;i++)r[t][n]+=this._elements[t][i]*e[i][n];this._elements=r}else for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]*=e;return this}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}transform(e,t,n,r,i,o){return this.multiply([[e,n,i],[t,r,o],[0,0,1]]),this}determinant(){let 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],c=0;return c=e*i*l+t*o*a+n*r*s-n*i*a-t*r*l-e*o*s,c}invert(){let 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],c=this._elements[2][2];return this._elements=[[o*c-a*l,r*l-n*c,n*a-r*o],[a*s-i*c,t*c-r*s,r*i-t*a],[i*l-o*s,s*n-t*l,t*o-n*i]],this.multiply(1/e),this}transpose(){const 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}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map((e=>e.join("\t"))).join("\n"))}isIdentity(){const 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]}transformPoint(e){let 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]}}transformPoints(e){let 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}get elements(){const 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]]]}}const V4=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function G4(e,t){const n=t.args[0]*(Math.PI/180);if(t.args.length>2){const 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 U4(e,t){const n=t.args[0],r=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,r)}function Y4(e,t){const n=t.args[0],r=isNaN(t.args[1])?0:t.args[1];e.translate(n,r)}function K4(e,t){t.args.length>=6&&e.transform(...t.args)}function X4(e,t){const n=function(e){let t,n=[];for(;null!==(t=V4.exec(e));){const e=t[2].trim(),r=-1===e.indexOf(",")?e.split(" "):e.split(",");n.push({cmd:t[1],args:r.filter((e=>e.trim().length>0)).map((e=>Number(e)))})}return n}(e);let r;for(let e=0,i=n.length;e<i;e++)r=n[e],"rotate"===r.cmd?G4(t,r):"scale"===r.cmd?U4(t,r):"matrix"===r.cmd?K4(t,r):"translate"===r.cmd&&Y4(t,r)}const J4={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},Z4={type:(e,t)=>t.filter((t=>{const n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()})),attr:(e,t,n,r)=>r.filter((r=>{const 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:e=>e,tag:(e,t)=>t.filter((t=>{const n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))}))};function Q4(e,t){if(!t||!t.length||!e||"function"!=typeof Z4[e.type])return[];switch(e.type){case"type":case"tag":return Z4[e.type](e.value,t);case"attr":return Z4[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return Z4[e.type](t);default:return[]}}var e8={find:function(e,t){const n=[],r=[];let i,o;if(t.isBranch){let a;i=function(e){const t=[];let n,r,i,o;return e.split(/\s*,\s*/).forEach((e=>{e=e.trim(),n=[];const a=t=>{i=e.match(J4[t]),i&&(o=!0,e=e.slice(i[0].length),r={type:t,value:i[0]},"attr"===t&&(i=i[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),r.attribute=i[1],r.operator=i[2],r.attributeValue=i[3]),n.push(r))};for(;e&&(o=!1,i=e.match(/^\s*([>+~]|\s)\s*/),i&&(o=!0,n.push({type:" ",value:i[0]}),e=e.slice(i[0].length)),Object.keys(J4).forEach(a),n&&n.length&&t.indexOf(n)<0&&t.push(n),o););})),t}(e),o=t.descendants;for(let e=0,t=i.length;e<t;e++){a=i[e];const t=[];let n=o.slice(),s=!1;a.reverse().forEach((e=>{if(" "===e.type)return t.push(n),n=o.slice(),void(s=!1);n=Q4(e,n),s=!0})),s&&t.push(n);const l=t[0].filter((e=>{let n,r=e.parent;for(let e=1;e<t.length;e++){for(n=t[e].indexOf(r);r&&n<0;)r=r.parent,n=t[e].indexOf(r);if(n<0)return!1}return!0}));r.push(l)}for(let e=0,t=r.length;e<t;e++)for(let t=0,i=r[e].length;t<i;t++)n.indexOf(r[e][t])<0&&n.push(r[e][t])}return n||[]}};function t8(e,t,n){const r=e.type;let i=e.points();n&&(i=i.every((e=>Array.isArray(e)))?i.map((e=>n.transformPoints(e))):n.transformPoints(i)),function(e,t){for(let n=0,r=e.length;n<r;n++)e[n].x/=t,e[n].y/=t}(i,t);let o=null;if("rect"===r||"bounds"===r)o=xY(i),o.type=r;else if("circle"===r)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(i,e.r),o.type=r;else if("line"===r)o=wY(i),o.type=r;else if("polygon"===r||"polyline"===r){o={type:"path",d:$0(i,"polygon"===r)}}else if("geopolygon"===r){let e="";for(let t=0;t<i.length;t++)e+=$0(i[t],!0);o={type:"path",d:e}}return o}class n8{constructor(e){this._bounds=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{x:n,y:r,width:i,height:o}=e.boundingRect?e.boundingRect(t):{x:0,y:0,width:0,height:0};return{x:n,y:r,width:i,height:o}},this._attrs=e.attrs,this._type=e.type,this._data=e.data,this._dpi=e.stage?e.stage.dpi:1,this._collider=()=>function(e,t){if(e.collider){const n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map((e=>t8(e,t,n)))}:t8(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map((e=>new n8(e))),this._parent=()=>e.parent?new n8(e.parent):null,this._cache={elementBoundingRect:null},this._getElementBoundingRect=()=>(!this._cache.elementBoundingRect&&this.element&&(this._cache.elementBoundingRect=this.element.getBoundingClientRect()),this._cache.elementBoundingRect||{left:0,top:0})}get children(){return this._children()}get parent(){return this._parent()}get type(){return this._type}get data(){return this._data}get attrs(){return this._attrs}set element(e){this._cache.elementBoundingRect=null,this._element=e}get element(){return this._element}set key(e){this._key=e}get key(){return this._key}get bounds(){const e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}get localBounds(){return this._bounds(!1)}boundsRelativeTo(e){const t=typeof e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.bounds:this.localBounds,r=this._getElementBoundingRect();let i=r.left,o=r.top;if("object"===t&&null!==e&&"function"==typeof e.getBoundingClientRect){const{left:t=0,top:n=0}=e.getBoundingClientRect();i-=t,o-=n}return n.x+=i,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function r8(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new n8(...t)}class i8{constructor(e){this._node=r8(e),this._parent=null,this._input=null}get node(){return this._node}set parent(e){this._parent=e}get parent(){return this._parent}set input(e){this._input=e}get input(){return this._input}}function o8(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new i8(...t)}function a8(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=o8(n);const e=n.parent;e&&"stage"!==e.type&&a8(e,t.parent)}}function s8(e,t,n){if(null===e.colliderType)return null;const r=function(e,t){let 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{const r={x:t.cx,y:t.cy};({x:n.cx,y:n.cy}=e.inverseModelViewMatrix.transformPoint(r)),n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every((e=>Array.isArray(e)))?z4(n):L4(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(let r=e.descendants.length-1;r>=0;r--){const i=e.descendants[r];if(null!==i.collider&&i.collider[t](n)){const e=o8(i);return a8(i,e),e}}return null}(e,t,r):function(e,t,n){if(e.collider[t](n)){const t=o8(e);return a8(e,t),t}return null}(e,t,r)}function l8(e,t,n,r){const i=e.length;for(let o=0;o<i;o++){const i=e[o],a=s8(i,t,r);a&&n.push(a),!i.children||a||i.collider||l8(i.children,t,n,r)}}function c8(e,t,n){const r=e.length;for(let i=0;i<r;i++){const r=e[i];if(null!==s8(r,t,n))return!0;if(r.children&&!r.collider)return c8(r.children,t,n)}return!1}function u8(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(SY(e)){case"circle":return n.cx=e.cx*t,n.cy=e.cy*t,n.r=e.r,["intersectsCircle",n];case"rect":return n=bY(e).map((e=>Y0(e,t))),["intersectsRect",n];case"line":return n=vY(e).map((e=>Y0(e,t))),["intersectsLine",n];case"point":return n=Y0(e,t),["containsPoint",n];case"polygon":return n.vertices=e.vertices.map((e=>Y0(e,t))),["intersectsPolygon",n];case"geopolygon":return n.vertices=e.vertices.map((e=>e.map((e=>Y0(e,t))))),["intersectsGeoPolygon",n];default:return[]}}function d8(e,t){const[n,r]=u8(t,e.dpi),i=[];return n&&(l8([e],n,i,r),function(e,t){for(let n=0,r=t.length;n<r;n++)t[n].input=e}(t,i)),i}function h8(e,t){const[n,r]=u8(t,e.dpi);return c8([e],n,r)}class p8 extends D4{constructor(e){super(e),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;const{data:t,desc:n,tag:r,strokeReference:i,fillReference:o}=e;!function(e,t){Object.keys(W0).forEach((n=>{const r=t[n];void 0!==r&&(e[W0[n]]=r)}))}(this.attrs,e),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=cY(!0,{},n)),"string"==typeof r&&(this.tag=r),"string"==typeof i&&(this.strokeReference=i),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return e8.find(e,this).map((e=>r8(e)))}getItemsFrom(e){return d8(this,e)}containsPoint(e){return h8(this,e)}intersectsLine(e){return h8(this,e)}intersectsRect(e){return h8(this,e)}intersectsCircle(e){return h8(this,e)}intersectsPolygon(e){return h8(this,e)}intersectsGeoPolygon(e){return h8(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new H4;void 0!==this.attrs.transform&&X4(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new H4;const t=this.ancestors;if(t.length>0)for(let n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}attr(e){return this.attrs[e]}equals(e){const t=this.attrs,n=Object.keys(t),r=e.attrs,i=Object.keys(r);if(n.length!==i.length)return!1;for(let e=0;e<n.length;e++){const i=n[e];if(!Object.hasOwnProperty.call(r,i))return!1;if(t[i]!==r[i])return!1}return super.equals(e)}toJSON(){const e=super.toJSON();return e.attrs=this.attrs,e}get attrs(){return this._attrs}get stage(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}set modelViewMatrix(e){this._mvm=e,this._imvm=null}get modelViewMatrix(){return this._mvm}get inverseModelViewMatrix(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}set node(e){this._node=e}get node(){return this._node}set collider(e){const 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))}get collider(){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 new B4(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=$4("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=$4(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class f8 extends D4{addChild(e){if(!(e&&e instanceof D4))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}addChildren(e){let t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}removeChild(e){const t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}removeChildren(e){let 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}}const m8=f8.prototype;class g8 extends p8{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const{collider:t}=e,n=cY({type:null},t);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(e,t){if(void 0!==e.bounds){const n=this.__boundingRect[t]||{},[r,,i]=e.bounds(t),{x:o,y:a}=r,{x:s,y:l}=i,c=isNaN(n.width)?s:Math.max(s,n.width+n.x),u=isNaN(n.height)?l:Math.max(l,n.height+n.y);n.x=isNaN(n.x)?o:Math.min(o,n.x),n.y=isNaN(n.y)?a:Math.min(a,n.y),n.width=c-n.x,n.height=u-n.y,this.__boundingRect[t]=n}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.children.length;for(let n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=cY({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const 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]}addChild(e){const t=m8.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=cY({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=m8.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let t=0;t<n;t++)this.appendChildRect(e[t],!0);const t=cY({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;if(m8.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=cY(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(m8.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=cY(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function y8(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new g8(...t)}class v8 extends g8{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const b8=f8.prototype,x8=["x1","x2","y1","y2","id","offset","style"];class w8 extends p8{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=x8.length;r!==i;r++)n=x8[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return b8.addChild.call(this,e)}addChildren(e){return b8.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return b8.removeChild.call(this,e),this}removeChildren(e){return b8.removeChildren.call(this,e),this}}function S8(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new w8(...t)}const C8=f8.prototype,M8=["patternUnits","x","y","width","height","id"];class k8 extends p8{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=M8.length;r!==i;r++)n=M8[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return C8.addChild.call(this,e)}addChildren(e){return C8.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return C8.removeChild.call(this,e),this}removeChildren(e){return C8.removeChildren.call(this,e),this}}class E8 extends p8{constructor(){super("rect"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,width:r=0,height:i=0,rx:o=0,ry:a=0,collider:s}=e,l=cY({type:"rect",x:t,y:n,width:r,height:i},s);super.set(e),r>=0?(this.attrs.x=t,this.attrs.width=r):(this.attrs.x=t+r,this.attrs.width=-r),i>=0?(this.attrs.y=n,this.attrs.height=i):(this.attrs.y=n+i,this.attrs.height=-i),o>0&&(this.attrs.rx=o),a>0&&(this.attrs.ry=a),this.collider=l,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=bY(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,[r,i,o,a]=yY(n);return this.__boundingRect[e]={x:r,y:i,width:o-r,height:a-i},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const 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]}}class _8 extends p8{constructor(){super("circle"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{cx:t=0,cy:n=0,r:r=0,collider:i}=e,o=cY({type:"circle",cx:t,cy:n,r:r},i);super.set(e),this.attrs.cx=t,this.attrs.cy=n,this.attrs.r=r,this.collider=o,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const 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]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const{cx:t,cy:n,r:r,r:i}=this.attrs,o=t-r,a=n-i;let s=2*r,l=2*i,c=[{x:o,y:a},{x:o+s,y:a},{x:o+s,y:a+l},{x:o,y:a+l}];if(e&&this.modelViewMatrix){c=this.modelViewMatrix.transformPoints(c);const[t,n,r,i]=yY(c);s=r-t,l=i-n,this.__bounds[e]=[{x:t,y:n},{x:t+s,y:n},{x:t+s,y:n+l},{x:t,y:n+l}]}else this.__bounds[e]=c;return this.__bounds[e]}}class R8 extends p8{constructor(){super("line"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x1:t=0,y1:n=0,x2:r=0,y2:i=0,collider:o}=e;super.set(e),this.attrs.x1=t,this.attrs.y1=n,this.attrs.x2=r,this.attrs.y2=i;const a={type:"line",x1:t,y1:n,x2:r,y2:i};this.collider=cY(a,o),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];let t=vY(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const[n,r,i,o]=yY(t),a=n!==i||r!==o;return this.__boundingRect[e]={x:n,y:r,width:a?Math.max(1,i-n):0,height:a?Math.max(1,o-r):0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const 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]}}const I8=Math.PI/2;function D8(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function A8(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const P8={step:function(e){return new xK(e,.5)},stepAfter:function(e){return new xK(e,1)},stepBefore:function(e){return new xK(e,0)},linear:JY,basis:function(e){return new oK(e)},cardinal:lK.tension(0),catmullRom:uK,monotonex:function(e){return new mK(e)},monotoney:function(e){return new gK(e)},natural:function(e){return new vK(e)}};function O8(e){if(e.length<2)return!1;const 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}class T8 extends p8{constructor(){super("path"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(e),this.segments=[],this.points=[],e.arcDatum){const t=KY();t.innerRadius(e.desc.slice.innerRadius),t.outerRadius(e.desc.slice.outerRadius),t.cornerRadius(e.desc.slice.cornerRadius);const n=t(e.arcDatum);this.attrs.d=n}else if(e.points){const{major:t,minor:n,layerObj:r,points:i,stngs:o,generatorType:a}=e,s=eK(),l=o.coordinates?o.coordinates.defined:null;s[t.p]((e=>e.major*t.size))["".concat(n.p,"1")]((e=>e.minor*n.size))["".concat(n.p,"0")]((e=>e.minor0*n.size)).curve(P8["monotone"===r.curve?"monotone".concat(t.p):r.curve]),l?s.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined)):s.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)));const c=o.connect?i.filter(s.defined()):i,u=("area"===a?s:s[a]())(c);this.attrs.d=u}else e.d&&(this.attrs.d=e.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(e.collider)||"object"==typeof e.collider&&void 0!==e.collider.type)this.collider=e.collider;else if(this.attrs.d){if(this.segments=_4(this.attrs.d),this.segments.length>1&&this.segments.every((e=>O8(e))))return void(this.collider=cY({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach((t=>{if(t.length<=1);else if(O8(t))this.collider=cY({type:"polygon",vertices:t},e.collider);else if("object"==typeof e.collider&&e.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=[],i=[];if("h"===n.forceOrientation){const t=e[0].x<e[1].x?-1:1,n=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+t,y:e[0].y}),e.push({x:e[e.length-1].x+n,y:e[e.length-1].y})}else if("v"===n.forceOrientation){const t=e[0].y<e[1].y?-1:1,n=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+t}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+n})}const o=e.length-1;for(let n=1;n<o;n++){const a=e[n-1],s=e[n],l=e[n+1],c=D8(s,a),u=D8(s,l),d=(c+u)/2,h=d+Math.PI,p=Math.max(d,h),f=Math.min(d,h),m=c>u;if(1===n){const e=D8(a,s);r.push(A8(a,e-I8,t)),i.unshift(A8(a,e+I8,t))}const g=m?p:f,y=m?f:p;if(r.push(A8(s,g,t)),i.unshift(A8(s,y,t)),n===o-1){const e=D8(l,s);r.push(A8(l,e+I8,t)),i.unshift(A8(l,e-I8,t))}}return{type:"polygon",vertices:[...r,...i]}}(t,n,e.collider)}else this.collider=cY({type:"polyline",points:t},e.collider)}))}}boundingRect(){let 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:_4(this.attrs.d),this.points=function(e){const t=[];let n,r=e.length;for(let i=0;i<r;i++){n=e[i];for(let e=0;e<n.length;e++)t.push(n[e])}return t}(this.segments));const t=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points,[n,r,i,o]=yY(t);return this.__boundingRect[e]={x:n||0,y:r||0,width:i-n||0,height:o-r||0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const 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]}}function L8(e){let{data:t,_boundingRect:n,_textBoundsFn:r}=e;return null!=t&&(n||r)}let q8=class extends p8{constructor(){super("text"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,dx:r=0,dy:i=0,textBoundsFn:o,text:a,title:s,collider:l,boundingRect:c,ellipsed:u}=e;super.set(e),this.attrs.x=t,this.attrs.y=n,this.attrs.dx=r,this.attrs.dy=i,this.attrs.text=a,void 0!==s&&(this.attrs.title=String(s)),"object"==typeof c?this._textBoundsFn=()=>c:"function"==typeof o&&(this._textBoundsFn=o),"string"==typeof u&&(this.ellipsed=u),this.collider=cY({type:L8(this)?"bounds":null},l),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};e=this._textBoundsFn(this.attrs);const n=bY(e),r=t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n,[i,o,a,s]=yY(r);return this.__boundingRect[t]={x:i,y:o,width:a-i,height:s-o},this.__boundingRect[t]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const 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]}};class N8 extends p8{constructor(){super("image"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,width:r=0,height:i=0,rx:o=0,ry:a=0,src:s,collider:l,cx:c=0,cy:u=0,r:d=0,opacity:h,imageScalingFactor:p,imagePosition:f,symbol:m}=e;let g;g="circle"===e.symbol?cY({type:"circle",cx:c,cy:u,r:d},l):cY({type:"bounds",x:t,y:n,width:r,height:i},l),super.set(e),r>=0?(this.attrs.x=t,this.attrs.width=r):(this.attrs.x=t+r,this.attrs.width=-r),i>=0?(this.attrs.y=n,this.attrs.height=i):(this.attrs.y=n+i,this.attrs.height=-i),o>0&&(this.attrs.rx=o),a>0&&(this.attrs.ry=a),s&&(this.attrs.src=s),this.attrs.r=d,this.attrs.cx=c,this.attrs.cy=u,this.attrs.opacity=void 0!==h?h:1,this.attrs.imageScalingFactor=void 0!==p?p:1,this.attrs.imagePosition=f||"center-center",this.attrs.symbol=m||"rectangle",this.collider=g,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},e.collider||(this.attrs.updateCollider=this.updateCollider.bind(this))}updateCollider(e){let t;t="circle"===e.symbol?cY(this.collider,{type:"circle",cx:e.cx,cy:e.cy,r:e.r}):cY(this.collider,{type:"bounds",x:e.x,y:e.y,width:e.width,height:e.height}),this.collider=t}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=bY(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,[r,i,o,a]=yY(n);return this.__boundingRect[e]={x:r,y:i,width:o-r,height:a-i},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];if("circle"===this._node.symbol){const t=this.boundingRect(e),n=Math.min(t.width,t.height)/2,r=t.x-n,i=t.y-n;let o=2*n,a=2*n,s=[{x:r,y:i},{x:r+o,y:i},{x:r+o,y:i+a},{x:r,y:i+a}];if(e&&this.modelViewMatrix){s=this.modelViewMatrix.transformPoints(s);const[t,n,r,i]=yY(s);o=r-t,a=i-n,this.__bounds[e]=[{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+a},{x:t,y:n+a}]}else this.__bounds[e]=s;return this.__bounds[e]}const 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]}}const j8=EK();function z8(e,t){return j8.get(e)(t)}j8.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new E8(...t)})),j8.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new _8(...t)})),j8.add("text",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new q8(...t)})),j8.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new R8(...t)})),j8.add("path",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new T8(...t)})),j8.add("stage",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new v8(...t)})),j8.add("container",y8),j8.add("defs",y8),j8.add("linearGradient",S8),j8.add("radialGradient",S8),j8.add("conicGradient",S8),j8.add("stop",S8),j8.add("pattern",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new k8(...t)})),j8.add("image",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new N8(...t)}));const F8=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[{}];function n(){return t[t.length-1]}return n.save=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=n(),o={};let a="";for(let t=0;t<e.length;t++)a=e[t],void 0!==i[a]&&(o[a]=i[a]);return cY(o,r),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function W8(e,t){if(Array.isArray(t))for(let n=0,r=t.length;n<r;n++)t[n](e)}function $8(e,t,n){e.node=n[t],e.index=t}function B8(e,t,n,r){let i=!1;const o={siblings:e,node:null,index:0};for(let a=0,s=e.length;a<s;a++){if($8(o,a,e),W8(o,r.create),i="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,i)continue;o.node=F8.save(o.node);const s=z8(o.node.type,o.node);s&&(o.node.transform&&(n.save(),X4(o.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),t.addChild(s),o.node.children&&B8(o.node.children,s,n,r),o.node.transform&&n.restore()),F8.restore()}}function H8(e){let{items:t,stage:n,dpi:r,on:i={}}=e;return n||(n=z8("stage",r)),B8(t,n,new H4,i),n}function V8(e,t,n){const{orientation:r,degree:i,stops:o=[]}=n;let a=null;if("radial"===r){const n=t.boundingRect();a=e.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else if("conic"===r){const t=n.startAngle||0,r=n.x||0,i=n.y||0;a=e.createConicGradient(t,r,i)}else{const r=V0(i);["x1","x2","y1","y2"].forEach((e=>{e in n&&(r[e]=n[e])}));const o=t.boundingRect();a=e.createLinearGradient(o.x+r.x1*o.width,o.y+r.y1*o.height,o.x+r.x2*o.width,o.y+r.y2*o.height)}for(let e=0,t=o.length;e<t;e++){let t=o[e];a.addColorStop(t.offset,t.color)}return a}function G8(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach((e=>{if("rect"===e.type)n.rect(e.x,e.y,e.width,e.height)})),n.fill(),n.restore(),n.createPattern(t,"repeat")}function U8(){let{x:e,y:t,width:n,height:r,scaleRatio:i,margin:o,edgeBleed:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s={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 s.x=isNaN(e)?s.x:e,s.y=isNaN(t)?s.y:t,s.width=isNaN(n)?s.width:n,s.height=isNaN(r)?s.height:r,void 0!==i&&(s.scaleRatio.x=isNaN(i.x)?s.scaleRatio.x:i.x,s.scaleRatio.y=isNaN(i.y)?s.scaleRatio.y:i.y),void 0!==o&&(s.margin.left=isNaN(o.left)?0:o.left,s.margin.top=isNaN(o.top)?0:o.top),"object"==typeof a&&["left","right","top","bottom"].forEach((e=>{!isNaN(a[e])&&a[e]>0&&(s.edgeBleed[e]=a[e],s.edgeBleed.bool=!0)})),s.computedPhysical={x:Math.round(s.margin.left+(s.x-s.edgeBleed.left)*s.scaleRatio.x),y:Math.round(s.margin.top+(s.y-s.edgeBleed.top)*s.scaleRatio.y),width:Math.round((s.width+s.edgeBleed.left+s.edgeBleed.right)*s.scaleRatio.x),height:Math.round((s.height+s.edgeBleed.top+s.edgeBleed.bottom)*s.scaleRatio.y)},s}function Y8(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:b6,textBounds:w6,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function K8(e){return t=>{let{node:n}=t;"text"!==n.type||null==n.data||n.textBoundsFn||(n.textBoundsFn=e.textBounds)}}const X8=200,J8=200;class Z8{constructor(e){this.targetCanvas=e,this.bufferCanvas=e.cloneNode()}updateSize(e){let t,{rect:n,dpiRatio:r,canvasBufferSize:i}=e;t=i?"function"==typeof i?i(n):i:{width:n.computedPhysical.width+2*X8,height:n.computedPhysical.height+2*J8},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)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const Q8=EK();function e7(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function t7(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function n7(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function r7(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Object.keys(r);for(let i=0,o=n.length;i<o;i++){let o=n[i];const a=o[0],s=o[1],l=o[2];if(a in t.attrs&&!(s in r)&&e[s]!==t.attrs[a]){const n=l?l(t.attrs[a]):t.attrs[a];"function"==typeof e[s]?e[s](n):e[s]=n}}for(let t=0,n=i.length;t<n;t++){const n=i[t];e[n]=r[n]}}function i7(e,t,n,r){for(let i=0,o=e.length;i<o;i++){let o=e[i],a={};t.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?a.fillStyle=V8(t,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(a.fillStyle=r.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?a.strokeStyle=V8(t,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(a.strokeStyle=r.patterns.create(o.attrs.stroke))),r7(t,o,n,a),o.modelViewMatrix&&n7(o.modelViewMatrix.elements,t),Q8.has(o.type)&&Q8.get(o.type)(o.attrs,{g:t,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&i7(o.children,t,n,r),t.restore()}}function o7(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:H8;const r={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let i,o=!1,a=U8();const s=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",e7]];let l;const c=Y8();return c.element=()=>e,c.root=()=>e,c.settings=e=>(e&&Object.keys(r).forEach((t=>{void 0!==e[t]&&(r[t]=e[t])})),r),c.appendTo=n=>(e||(e=n.ownerDocument.createElement("canvas"),e.style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof r.transform||t||(t=new Z8(e)),n.appendChild(e),e),c.getScene=r=>{const i=t7(t&&t.getContext()||e.getContext("2d")),o=a.scaleRatio.x,s=a.scaleRatio.y,l={type:"container",children:r,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*i*o,", ").concat(a.edgeBleed.top*i*s,")"):""};return 1===i&&1===o&&1===s||(l.transform+="scale(".concat(i*o,", ").concat(i*s,")")),n({items:[l],dpi:i,on:{create:[c6(c.measureText),K8(c)]}})},c.render=n=>{if(!e)return!1;l||(l=function(e){const t=e.createElement("canvas"),n=t.getContext("2d");let r={};return{create(e){const i=e.key;return i?(r[i]=r[i]||G8(e,t,n),r[i]):G8(e,t,n)},clear(){r={}}}}(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),d=t7(u),h=t&&r.transform();if(h)return e.width=e.width,function(e){let{el:t,dpiRatio:n,transform:r}=e;if("object"==typeof r){const e=[r.horizontalScaling,r.horizontalSkewing,r.verticalSkewing,r.verticalScaling,r.horizontalMoving*n,r.verticalMoving*n];t.getContext("2d").setTransform(...e)}}({el:e,dpiRatio:d,transform:h}),t.apply(),!0;o&&(e.style.left="".concat(a.computedPhysical.x,"px"),e.style.top="".concat(a.computedPhysical.y,"px"),e.style.width="".concat(a.computedPhysical.width,"px"),e.style.height="".concat(a.computedPhysical.height,"px"),e.width=Math.round(a.computedPhysical.width*d),e.height=Math.round(a.computedPhysical.height*d),t&&t.updateSize({rect:a,dpiRatio:d,canvasBufferSize:r.canvasBufferSize}));const p=c.getScene(n),f=!i||!p.equals(i);l.clear();const m=o||f,g="function"==typeof r.progressive&&r.progressive();return m&&(g&&!g.isFirst||c.clear(),i7(p.children,u,s,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,g&&!g.isFirst&&p.children.unshift(...i.children),i=p,m},c.itemsAt=e=>i?i.getItemsFrom(e):[],c.findShapes=e=>i?i.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),i=null,c),c.size=e=>{if(e){const t=U8(e);JSON.stringify(a)!==JSON.stringify(t)&&(o=!0,a=t)}return a},c.destroy=()=>{e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),i=null},c}function a7(e,t){Q8.add(e,t)}function s7(e,t){return Math.max(0,Math.min(e,t))}const l7=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),c7=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),u7=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function d7(e){return l7.test(e)}function h7(e){return c7.test(e)||u7.test(e)}function p7(e){let t,n,r=e?e.length:0;for(t=0;t<r;t++){if(n=e[t],d7(n))return"ltr";if(h7(n))return"rtl"}return"ltr"}const f7={start:"end",end:"start",center:"center",middle:"middle"};function m7(e,t){return"rtl"===t?f7[e]:e}function g7(e,t){if(g7.cache[e])return void t(g7.cache[e]);const n=new Image;n.src=e,n.onload=()=>{g7.cache[e]=n,t(n)},n.onerror=e=>{console.error("Image load error",e)}}function y7(e,t){const n=[];let r;const i=[],o=[],a=[];let s,l;const c=e=>e.id,u=(e,t)=>{let n;return n="object"==typeof e?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(u)),t=t.map(u),s=e.map(c),l=t.map(c);for(let e=0,r=t.length;e<r;e++){-1===s.indexOf(t[e].id)?n.push(t[e]):o.push(t[e])}for(let t=0,n=e.length;t<n;t++){-1===l.indexOf(e[t].id)?i.push(e[t]):a.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=y7([],n[e].content.children),n[e].children=n[e].diff.updatedNew.concat(n[e].diff.added),n[e].children.isTree=!0);for(let e=0,t=o.length;e<t;e++)o[e].diff=y7(a[e].children||[],o[e].content.children||[]),o[e].object=a[e].object,o[e].children=o[e].diff.items;return r=o.concat(n),n.isTree=!0,i.isTree=!0,o.isTree=!0,a.isTree=!0,r.isTree=!0,{added:n,updatedNew:o,updatedOld:a,removed:i,items:r}}function v7(e,t,n){for(let r=0,i=e.length;r<i;r++)e[r].object=n(e[r].content.type,t)}function b7(e,t){for(let 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 x7(e,t,n,r){let i;for(let o=0,a=e.length;o<a;o++)i=e[o],null!==i.object&&void 0!==i.object&&(n(i.object,i.content),i.diff&&(v7(i.diff.added,i.object,t),b7(i.diff.removed,r),x7(i.diff.items,t,n,r)))}function w7(e,t,n,r,i,o){const a=y7(e,t);return v7(a.added,n,r),b7(a.removed,o),x7(a.items,r,i,o),a.items}g7.cache={},a7("rect",(function(e,t){let{g:n,doFill:r,doStroke:i}=t;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,r,i,o,a){o=s7(r/2,o>0?o:a),a=s7(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()})),a7("circle",(function(e,t){let{g:n,doFill:r,doStroke:i}=t;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()})),a7("line",(function(e,t){let{g:n,doStroke:r}=t;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),r&&n.stroke()})),a7("path",(function(e,t){let{g:n,doStroke:r,doFill:i}=t;const o=new Path2D(e.d);i&&n.fill(o),r&&n.stroke(o)})),a7("text",(function(e,t){let{g:n,ellipsed:r,doStroke:i}=t;const o=r||u6(e,b6);n.font=[e["font-style"],e["font-weight"],e["font-size"],e["font-family"]].filter((e=>!!e)).join(" ");const a=p7(e.text);n.canvas.dir!==a&&(n.canvas.dir=a);const s=m7("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);const l=d6(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)})),a7("image",(function(e,t){let{g:n}=t;const r=n.canvas,i=n.getTransform(),o=window.devicePixelRatio||1,a=r.clientWidth*o,s=r.clientHeight*o;r.width===a&&r.height===s||(r.width=a,r.height=s),g7(e.src,(t=>{if(n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,r.width,r.height),n.setTransform(i),n.globalAlpha=e.opacity,e.width||e.height||(e.width=t.naturalWidth*e.imageScalingFactor,e.height=t.naturalHeight*e.imageScalingFactor),function(e){const t=e.imagePosition||"center-center";let n=e.width,r=e.height;if("circle"===e.symbol){const t=Math.min(e.width,e.height)/2;n=2*t,r=2*t}switch(t){case"top-center":e.y-=r/2;break;case"center-left":e.x-=n/2;break;case"center-right":e.x+=n/2;break;case"top-left":e.x-=n/2,e.y-=r/2;break;case"top-right":e.x+=n/2,e.y-=r/2;break;case"bottom-left":e.x-=n/2,e.y+=r/2;break;case"bottom-right":e.x+=n/2,e.y+=r/2;break;case"bottom-center":e.y+=r/2}}(e),"circle"===e.symbol){const r=e.x,i=e.y;e.r=Math.min(e.width,e.height)/2;const o=r-e.width/2,a=i-e.height/2;n.save(),n.beginPath(),n.arc(r,i,e.r,0,2*Math.PI),n.clip(),n.drawImage(t,o,a,e.width,e.height),n.restore()}else e.x-=e.width/2,e.y-=e.height/2,n.drawImage(t,e.x,e.y,e.width,e.height);n.globalAlpha=1,e.updateCollider&&e.updateCollider(e)}))}));const S7="http://www.w3.org/2000/svg",C7=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(S7,"container"===e?"g":e);return t.appendChild(n),n},M7=e=>{e.parentNode&&e.parentNode.removeChild(e)};function k7(e){let{element:t,attrs:n}=e;return function(){const{width:e,height:r,imagePosition:i,imageScalingFactor:o,symbol:a}=n;let{x:s=0,y:l=0}=n,c=e>0?e:this.naturalWidth,u=r>0?r:this.naturalHeight;switch(o&&(c*=o,u*=o),i){case"top-center":l-=u/2;break;case"center-left":s-=c/2;break;case"center-right":s+=c/2;break;case"top-left":s-=c/2,l-=u/2;break;case"top-right":s+=c/2,l-=u/2;break;case"bottom-left":s-=c/2,l+=u/2;break;case"bottom-right":s+=c/2,l+=u/2;break;case"bottom-center":l+=u/2}if(t.setAttribute("width",c),t.setAttribute("height",u),t.setAttribute("x",s-c/2),t.setAttribute("y",l-u/2),t.setAttribute("preserveAspectRatio","none"),"circle"===a){const e=t.ownerSVGElement;if(!e)return;const n="clip-".concat(Math.random().toString(36).substr(2,9));if(!e.querySelector("#".concat(n))){const t=e.querySelector("defs")||e.insertBefore(document.createElementNS(S7,"defs"),e.firstChild),r=document.createElementNS(S7,"clipPath");r.setAttribute("id",n);const i=document.createElementNS(S7,"circle");i.setAttribute("cx",s),i.setAttribute("cy",l),i.setAttribute("r",Math.min(c,u)/2),r.appendChild(i),t.appendChild(r)}t.setAttribute("clip-path","url(#".concat(n,")"))}}}const E7=(e,t)=>{if((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":case"image":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}})(t)){for(const 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||u6(t.attrs,b6);const n=p7(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",m7(e.getAttribute("text-anchor"),n)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){const n=e.ownerDocument.createElementNS(S7,"title");n.textContent=t.attrs.title,e.appendChild(n)}else if("image"===t.type&&"src"===n){e.setAttributeNS("http://www.w3.org/1999/xlink","href",t.attrs.src);let n=new Image;n.src=t.attrs.src,n.onload=k7({element:e,attrs:t.attrs})}else e.setAttribute(n,t.attrs[n]);else{const r=+e.getAttribute(n)||0;let i=0;i="dominant-baseline"===n?d6(t.attrs):t.attrs[n],e.setAttribute("dy",i+r)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"==typeof t.data&&null!==t.data)for(const n in t.data)"string"!=typeof t.data[n]&&"number"!=typeof t.data[n]&&"boolean"!=typeof t.data[n]||e.setAttribute("data-".concat(n),t.data[n])}};class _7{constructor(e,t,n,r){this.create=e,this.nodeCreator=t,this.nodeMaintainer=n,this.nodeDestroyer=r}render(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function R7(){return new _7(w7,C7,E7,M7)}function I7(e){let t,n,r,i=0;if(0===(e=JSON.stringify(e)).length)return i;for(t=0,r=e.length;t<r;t++)n=e.charCodeAt(t),i=(i<<5)-i+n,i&=i;return i}function D7(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:S7,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:H8;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:R7)();let r,i,o,a=!1,s=U8();const l={transform:void 0,disableScreenReader:!1},c=Y8(),u={type:"defs",children:[]},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I7,n={},r=Date.now();const i={onCreate(i){let o={};i.node&&"object"==typeof i.node.fill&&"pattern"===i.node.fill.type&&i.node.fill.shapes&&(o.fill=i.node.fill),i.node&&"object"==typeof i.node.stroke&&"pattern"===i.node.stroke.type&&i.node.stroke.shapes&&(o.stroke=i.node.stroke),Object.keys(o).forEach((a=>{let s="";const l=o[a],c=t(l),u="picasso-pattern-".concat(r,"-").concat(c);if("undefined"!=typeof window&&(s=window.location.href.split("#")[0]),!n[c]){const t={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach((e=>{t.children.push(e)})),e.push(t),n[c]=!0}i.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(u,"')")}))},clear(){n={}}};return i}(u.children),h=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I7,n={},r=Date.now();const i={getOrCreateGradient(){let 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]){let{orientation:t,degree:r,stops:a=[]}=i[o],c={};void 0===r&&(r=90),"radial"===t?c.type="radialGradient":(c=V0(r),["x1","x2","y1","y2"].forEach((e=>{e in i[o]&&(c[e]=i[o][e])})),c.type="linearGradient"),c.id=l,c.children=a.map((e=>{let{offset:t,color:n,opacity:r}=e;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==r?r:1)}})),e.push(c),n[s]=l}return"url('".concat(a,"#").concat(l,"')")},onCreate(e){let t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);const n=e.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=i.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=i.getOrCreateGradient(n,"stroke",t))},clear(){n={}}};return i}(u.children);return c.element=()=>r,c.root=()=>i,c.settings=e=>(e&&Object.keys(l).forEach((t=>{void 0!==e[t]&&(l[t]=e[t])})),l),c.appendTo=t=>(r||(r=t.ownerDocument.createElementNS(e,"svg"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none",r.setAttribute("xmlns",e),i=t.ownerDocument.createElementNS(e,"g"),i.style.pointerEvents="auto",r.appendChild(i)),t.appendChild(r),r),c.getScene=e=>{const n=s.scaleRatio.x,r=s.scaleRatio.y,i={type:"container",children:Array.isArray(e)?[...e,u]:e,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*n,", ").concat(s.edgeBleed.top*r,")"):""};return 1===n&&1===r||(i.transform+="scale(".concat(n,", ").concat(r,")")),t({items:[i],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},h.onCreate,d.onCreate,c6(c.measureText),K8(c)]}})},c.render=e=>{if(!r)return!1;const t="function"==typeof l.transform&&l.transform();if(t){const{horizontalScaling:e,horizontalSkewing:n,verticalSkewing:r,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=t;return i.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(r,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}i.style.transform="";l.disableScreenReader&&r.setAttribute("aria-hidden",!0),a&&(r.style.left="".concat(s.computedPhysical.x,"px"),r.style.top="".concat(s.computedPhysical.y,"px"),r.setAttribute("width",s.computedPhysical.width),r.setAttribute("height",s.computedPhysical.height)),h.clear(),d.clear(),u.children.length=0;const p=c.getScene(e),f=!o||!p.equals(o),m=a||f;return m&&(c.clear(),n.render(p.children,i)),a=!1,o=p,m},c.itemsAt=e=>o?o.getItemsFrom(e):[],c.findShapes=e=>o?o.findShapes(e):[],c.clear=()=>{if(!i)return c;o=null;const e=i.cloneNode(!1);return r.replaceChild(e,i),i=e,c},c.destroy=()=>{r&&r.parentNode&&r.parentNode.removeChild(r),r=null,i=null},c.size=e=>{if(e){const t=U8(e);JSON.stringify(s)!==JSON.stringify(t)&&(a=!0,s=t)}return s},c}var A7,P7,O7,T7,L7,q7,N7,j7={},z7=[],F7=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function W7(e,t){for(var n in t)e[n]=t[n];return e}function $7(e){var t=e.parentNode;t&&t.removeChild(e)}function B7(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?A7.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 H7(e,a,r,i,null)}function H7(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?++O7:i};return null==i&&null!=P7.vnode&&P7.vnode(o),o}function V7(e){return e.children}function G7(e,t){this.props=e,this.context=t}function U7(e,t){if(null==t)return e.__?U7(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?U7(e):null}function Y7(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 Y7(e)}}function K7(e){(!e.__d&&(e.__d=!0)&&T7.push(e)&&!X7.__r++||L7!==P7.debounceRendering)&&((L7=P7.debounceRendering)||q7)(X7)}function X7(){var e,t,n,r,i,o,a,s;for(T7.sort(N7);e=T7.shift();)e.__d&&(t=T7.length,r=void 0,i=void 0,a=(o=(n=e).__v).__e,(s=n.__P)&&(r=[],(i=W7({},o)).__v=o.__v+1,o9(s,o,i,n.__n,void 0!==s.ownerSVGElement,null!=o.__h?[a]:null,r,null==a?U7(o):a,o.__h),a9(r,o),o.__e!=a&&Y7(o)),T7.length>t&&T7.sort(N7));X7.__r=0}function J7(e,t,n,r,i,o,a,s,l,c){var u,d,h,p,f,m,g,y=r&&r.__k||z7,v=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(p=n.__k[u]=null==(p=t[u])||"boolean"==typeof p||"function"==typeof p?null:"string"==typeof p||"number"==typeof p||"bigint"==typeof p?H7(null,p,null,null,p):Array.isArray(p)?H7(V7,{children:p},null,null,null):p.__b>0?H7(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)){if(p.__=n,p.__b=n.__b+1,null===(h=y[u])||h&&p.key==h.key&&p.type===h.type)y[u]=void 0;else for(d=0;d<v;d++){if((h=y[d])&&p.key==h.key&&p.type===h.type){y[d]=void 0;break}h=null}o9(e,p,h=h||j7,i,o,a,s,l,c),f=p.__e,(d=p.ref)&&h.ref!=d&&(g||(g=[]),h.ref&&g.push(h.ref,null,p),g.push(d,p.__c||f,p)),null!=f?(null==m&&(m=f),"function"==typeof p.type&&p.__k===h.__k?p.__d=l=Z7(p,l,e):l=Q7(e,p,h,y,f,l),"function"==typeof n.type&&(n.__d=l)):l&&h.__e==l&&l.parentNode!=e&&(l=U7(h))}for(n.__e=m,u=v;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=e9(r).nextSibling),c9(y[u],y[u]));if(g)for(u=0;u<g.length;u++)l9(g[u],g[++u],g[++u])}function Z7(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?Z7(r,t,n):Q7(n,r,r,i,r.__e,t));return t}function Q7(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+=1)if(s==i)break e;e.insertBefore(i,o),a=o}return void 0!==a?a:i.nextSibling}function e9(e){var t,n,r;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=e9(n)))return r;return null}function t9(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||F7.test(t)?n:n+"px"}function n9(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||t9(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||t9(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?i9:r9,o):e.removeEventListener(t,o?i9:r9,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"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&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function r9(e){return this.l[e.type+!1](P7.event?P7.event(e):e)}function i9(e){return this.l[e.type+!0](P7.event?P7.event(e):e)}function o9(e,t,n,r,i,o,a,s,l){var c,u,d,h,p,f,m,g,y,v,b,x,w,S,C,M=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]),(c=P7.__b)&&c(t);try{e:if("function"==typeof M){if(g=t.props,y=(c=M.contextType)&&r[c.__c],v=c?y?y.props.value:c.__:r,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in M&&M.prototype.render?t.__c=u=new M(g,v):(t.__c=u=new G7(g,v),u.constructor=M,u.render=u9),y&&y.sub(u),u.props=g,u.state||(u.state={}),u.context=v,u.__n=r,d=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=M.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=W7({},u.__s)),W7(u.__s,M.getDerivedStateFromProps(g,u.__s))),h=u.props,p=u.state,u.__v=t,d)null==M.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==M.getDerivedStateFromProps&&g!==h&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,v),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,v)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<u._sb.length;b++)u.__h.push(u._sb[b]);u._sb=[],u.__h.length&&a.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,v),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(h,p,f)}))}if(u.context=v,u.props=g,u.__P=e,x=P7.__r,w=0,"prototype"in M&&M.prototype.render){for(u.state=u.__s,u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),S=0;S<u._sb.length;S++)u.__h.push(u._sb[S]);u._sb=[]}else do{u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(r=W7(W7({},r),u.getChildContext())),d||null==u.getSnapshotBeforeUpdate||(f=u.getSnapshotBeforeUpdate(h,p)),C=null!=c&&c.type===V7&&null==c.key?c.props.children:c,J7(e,Array.isArray(C)?C:[C],t,n,r,i,o,a,s,l),u.base=t.__e,t.__h=null,u.__h.length&&a.push(u),m&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=s9(n.__e,t,n,r,i,o,a,l);(c=P7.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=s,t.__h=!!l,o[o.indexOf(s)]=null),P7.__e(e,t,n)}}function a9(e,t){P7.__c&&P7.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){P7.__e(e,t.__v)}}))}function s9(e,t,n,r,i,o,a,s){var l,c,u,d=n.props,h=t.props,p=t.type,f=0;if("svg"===p&&(i=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&"setAttribute"in l==!!p&&(p?l.localName===p:3===l.nodeType)){e=l,o[f]=null;break}if(null==e){if(null===p)return document.createTextNode(h);e=i?document.createElementNS("http://www.w3.org/2000/svg",p):document.createElement(p,h.is&&h),o=null,s=!1}if(null===p)d===h||s&&e.data===h||(e.data=h);else{if(o=o&&A7.call(e.childNodes),c=(d=n.props||j7).dangerouslySetInnerHTML,u=h.dangerouslySetInnerHTML,!s){if(null!=o)for(d={},f=0;f<e.attributes.length;f++)d[e.attributes[f].name]=e.attributes[f].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||n9(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]||n9(e,o,t[o],n[o],r)}(e,h,d,i,s),u)t.__k=[];else if(f=t.props.children,J7(e,Array.isArray(f)?f:[f],t,n,r,i&&"foreignObject"!==p,o,a,o?o[0]:n.__k&&U7(n,0),s),null!=o)for(f=o.length;f--;)null!=o[f]&&$7(o[f]);s||("value"in h&&void 0!==(f=h.value)&&(f!==e.value||"progress"===p&&!f||"option"===p&&f!==d.value)&&n9(e,"value",f,d.value,!1),"checked"in h&&void 0!==(f=h.checked)&&f!==e.checked&&n9(e,"checked",f,d.checked,!1))}return e}function l9(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){P7.__e(e,n)}}function c9(e,t,n){var r,i;if(P7.unmount&&P7.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||l9(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){P7.__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]&&c9(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||$7(e.__e),e.__=e.__e=e.__d=void 0}function u9(e,t,n){return this.constructor(e,n)}function d9(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createElement:t=document.createElement.bind(document)}=e;let n,r,i=U8();const o={transform:void 0,disableScreenReader:!1},a=Y8();return a.element=()=>n,a.root=()=>n,a.settings=e=>(e&&Object.keys(o).forEach((t=>{void 0!==e[t]&&(o[t]=e[t])})),o),a.appendTo=e=>(n||(n=t("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),e.appendChild(n),n),a.render=e=>{if(!n)return!1;const t="function"==typeof o.transform&&o.transform();if(t){const{horizontalScaling:e,horizontalSkewing:r,verticalSkewing:i,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=t;return n.style.transform="matrix(".concat(e,", ").concat(r,", ").concat(i,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}n.style.transform="";let a;return o.disableScreenReader&&n.setAttribute("aria-hidden",!0),n.style.left="".concat(i.computedPhysical.x,"px"),n.style.top="".concat(i.computedPhysical.y,"px"),n.style.width="".concat(i.computedPhysical.width,"px"),n.style.height="".concat(i.computedPhysical.height,"px"),a=Array.isArray(e)?B7("div",null,e):e,r=function(e,t,n){var r,i,o;P7.__&&P7.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],o9(t,e=(!r&&n||t).__k=B7(V7,null,[e]),i||j7,j7,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?A7.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),a9(o,e)}(a,n,r),!0},a.renderArgs=[B7],a.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;r=null}return a},a.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,r=null},a.size=e=>(e&&(i=U8(e)),i),a}A7=z7.slice,P7={__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}},O7=0,G7.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=W7({},this.state),"function"==typeof e&&(e=e(W7({},n),this.props)),e&&W7(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),K7(this))},G7.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),K7(this))},G7.prototype.render=V7,T7=[],q7="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,N7=function(e,t){return e.__v.__b-t.__v.__b},X7.__r=0;var h9=[function(e){e.renderer("svg",D7)},function(e){e.renderer("canvas",o7)},function(e){e.renderer("dom",d9)}];const p9={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const f9=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=function(){let{level:e=p9.OFF,pipe:t=console}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e;const r={[p9.OFF]:()=>{},[p9.ERROR]:function(){return t.error(...arguments)},[p9.WARN]:function(){return t.warn(...arguments)},[p9.INFO]:function(){return t.info(...arguments)},[p9.DEBUG]:function(){return t.log(...arguments)}},i=function(e){if(e&&!(n<e)){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];(r[e]||r[p9.DEBUG])(...i)}};return{log:i,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(p9.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(p9.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(p9.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(p9.DEBUG,...t)},level:e=>("number"==typeof e&&(n=e),n),LOG_LEVEL:p9}}(t.logger),i={component:EK(n.component,"component",r),data:EK(n.data,"data",r),formatter:EK(n.formatter,"formatter",r),interaction:EK(n.interaction,"interaction",r),renderer:p2(n.renderer),scale:EK(n.scale,"scale",r),symbol:EK(n.symbol,"symbol",r),logger:r};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e({palettes:t.palettes.concat(n.palettes||[]),style:cY({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer},i)}return t.renderer&&t.renderer.prio&&i.renderer.default(t.renderer.prio[0]),o.use=function(e){return function(e){e(arguments.length>2?arguments[2]:void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i)},o.chart=e=>h2(e,{registries:i,logger:r,style:t.style,palettes:t.palettes}),o.config=()=>t,Object.keys(i).forEach((e=>{o[e]=i[e]})),o.version=uY,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:f2,data:b2,formatter:XJ,interaction:x2,renderer:p2(),scale:JQ,symbol:r1});I4.forEach(f9.use),h9.forEach(f9.use),[].forEach(f9.use);const m9=f9();m9.use(eY),m9.renderer.prio(["canvas"]);const g9=(e,t)=>e&&"center"!==e&&"rtl"===t?RH(e):e,y9=({cell:e,representation:t,textStyle:n,imageContainerHorizontalAlignment:r})=>{const{imageBox:i}=t,{styleService:{grid:{lineClamp:o}}}=JF(),{direction:a}=VF();return Ji.jsxs("div",{style:{display:"grid",gridTemplateColumns:`${i?.width??24}px 1fr`,maxHeight:"fit-content",alignItems:"center",justifyContent:"flex-start",boxSizing:"border-box"},children:[Ji.jsx("div",{"data-key":"image-container--partial-image",style:{display:"flex",flexDirection:"column",justifyContent:FH(e),alignItems:g9(r,a),overflow:"hidden",boxSizing:"border-box",border:"4px solid transparent",width:i?.width??24,height:"100%"},children:Ji.jsx(aV,{representation:t,textStyle:n})}),Ji.jsx(zV,{padding:4/(o<=2?2:1),alignSelf:FH(e,!0),children:!!t.labelStructure&&iV(t.labelStructure)})]})},v9=({suffix:e,delimeter:t})=>` ${e?t:""} ${e}`,b9=({href:e,text:t,labelStructure:n,interactions:r,color:i})=>Ji.jsxs("span",{children:[Ji.jsx(fd,{...hG({href:e,text:t,interactions:r,color:i}),children:n?.maskedValue?n.maskedValue:n?.originalValue}),!!n&&v9(n)]}),x9=({children:e,textStyle:t,shouldEnableStickyText:n})=>Ji.jsx("span",{style:{...t,border:"4px solid transparent",boxSizing:"border-box",...n&&{alignSelf:"flex-start",position:"sticky",top:0}},children:e}),w9=({isLeftColumn:e,styleService:t,cell:n,isIndentModeEnabled:r})=>e?r?t.grid.lineClamp:Math.max(t.grid.lineClamp,n.leafCount*t.grid.lineClamp):t.grid.columnLineClamp,S9=({cell:e,isCellSelected:t,isLeftColumn:n})=>{const{direction:r}=VF(),{isActive:i}=NH(),{layoutService:o,styleService:a}=JF(),{interactions:s}=YF(),l=n&&o.isIndentModeEnabled;let c=n&&!e.isNull?(e=>{const{representation:{text:t,labelStructure:n}}=e;if(!n||!n.originalValue)return t;const{originalValue:r,maskedValue:i,suffix:o,delimeter:a}=n;return`${0!==i.length?i:r} ${o?a:""} ${o}`.trim()})(e):e.representation.text;if(e.isEmpty)return null;const u=(({cell:e,styleService:t,isCellSelected:n,isLeftColumn:r,isIndentModeEnabled:i})=>({...Bj,...Hj(w9({cell:e,isLeftColumn:r,styleService:t,isIndentModeEnabled:i})),color:VH({cell:e,styleService:t,isCellSelected:n}),fontWeight:GH({cell:e,styleService:t}),fontStyle:UH({cell:e,styleService:t}),textDecoration:YH({cell:e,styleService:t}),fontFamily:t.dimensionValues.fontFamily,fontSize:t.dimensionValues.fontSize}))({cell:e,styleService:a,isCellSelected:t,isLeftColumn:n,isIndentModeEnabled:o.isIndentModeEnabled});if(e.representation.type===ZN.Image&&!e.isTotal&&!e.isNull){const{labelStructure:t}=e.representation,i=n&&t&&t.suffix?y9:sV;return Ji.jsx(i,{cell:e,representation:e.representation,leafCount:e.leafCount,textStyle:u,isLeftColumn:n,canExpandOrCollapse:e.ref.qCanCollapse||e.ref.qCanExpand,imageContainerHorizontalAlignment:lG(e,o,n,r)})}if(e.representation.type===ZN.Link&&!i&&!e.isTotal){const t=n&&e.representation.labelStructure?b9:pG;c=Ji.jsx(t,{text:e.representation.text,labelStructure:e.representation.labelStructure,href:e.representation.url,interactions:s,color:e.expressionColor.color})}return Ji.jsx(x9,{shouldEnableStickyText:l,textStyle:{...u,...e.representation.type===ZN.Image&&e.isNull?{alignSelf:FH(e)}:{}},children:c})},C9=({index:e,style:t,data:n})=>{const{styleService:r,layoutService:i}=JF(),{isSelected:o}=NH(),{isLeftColumn:a=!1,showLastBorder:s,itemCount:l,isLast:c,totalDividerIndex:u}=n,{isAdjustingWidth:d,setIsAdjustingWidth:h}=EV([n]),p=sG(e,n),f=a?e===l-1:c,m=a?c:e===l-1,g=ZB(p,u,i.isIndentModeEnabled);if(void 0===p){const{background:n}=r.dimensionValues;return Ji.jsx(QB,{style:{...t,background:n},index:e,isLastRow:f,isLastColumn:m,showLastBorder:s,isLeftColumn:a,showTotalCellDivider:g})}const y=o(p);return Ji.jsxs(uG,{reactWindowStyle:t,isLeftColumn:a,isLastRow:f,isLastColumn:m,isCellSelected:y,showTotalCellDivider:g,cell:p,data:n,isAdjustingWidth:d,index:e,children:[Ji.jsxs(eH,{verticalAlign:FH(p),width:tH(p.representation),right:p.isLeftColumn?void 0:4,isLeftColumn:a,children:[Ji.jsx(ZH,{isLeftColumn:a,isCellSelected:y,cell:p}),Ji.jsx(S9,{isLeftColumn:a,isCellSelected:y,cell:p})]}),Ji.jsx(IV,{cellInfo:{...p,columnWidthLocation:p.isPseudoDimension?oj.Measures:oj.Dimension},columnWidth:t.width,isLastColumn:m,setIsAdjustingWidth:h})]})};var M9=t.memo(C9,NB);const k9=({list:e,listValues:t,isLastRow:n,getRightGridColumnWidth:r})=>i=>{const o=n?e[i]:t.at(i);return o&&0===i&&o.x>0?(o.leafCount+o.x+o.distanceToNextCell)*r():!n&&o?(o.leafCount+o.distanceToNextCell)*r():r(o?.x??i)},E9=(e,t,n,r)=>{const i=Object.values(e);let o,a=i.length;return r&&(a=n,o=t/a),{itemCount:a,estimatedItemSize:o,listValues:i}},_9=(e,t)=>n=>{e.current&&(e.current[t]=n)},R9={display:"flex",height:"fit-content",borderWidth:"1px 0px 0px 0px",...Wj},I9={overflow:"hidden",willChange:"auto",flexShrink:0},D9=({leftGridRef:e,width:t,height:n,columnWidths:r,showLastBorder:i})=>{const{pageInfo:o,direction:a}=VF(),{layoutService:s,styleService:{contentCellHeight:l,grid:{divider:c}}}=JF(),{qSize:u}=s.layout.qHyperCube,{gridSectionsData:{leftDimensionData:d},visibleDimensionsInfo:{visibleLeftDimensionInfo:h}}=x$();aG(e,d),oG(e,t,n,l);const p=o.rowsOnCurrentPage*l,f={...R9,borderColor:c,width:r.reduce(((e,t)=>e+t),0)};return Ji.jsx("div",{style:f,"data-section-id":"LEFT_GRID",children:d.grid.map(((t,c)=>{const f=c===d.columnCount-1,m=rW(h[c]),{itemCount:g,estimatedItemSize:y,listValues:v}=E9(t,p,o.rowsOnCurrentPage,f),b=s.isIndentModeEnabled?()=>l:((e,t,n,r,i)=>o=>{const a=r?e[o]:t.at(o);if(a&&0===o&&a.pageY>0)return(a.leafCount+a.pageY+a.distanceToNextCell)*n;if(a&&a.leafCount>0){const e=a.y===i-a.leafCount;return(a.leafCount-(e?a.ref.qUp:0)+a.distanceToNextCell)*n}return n})(t,v,l,f,u.qcy);return Ji.jsx(OB,{ref:_9(e,c),style:{...I9,flexGrow:f?1:0,direction:a},height:n,width:r[c],itemCount:g,itemSize:b,layout:"vertical",itemData:{list:t,isLeftColumn:!0,isLast:f,itemCount:g,showLastBorder:i,listValues:v,totalDividerIndex:d.totalDividerIndex},itemKey:xV,estimatedItemSize:y,children:M9},m)}))})};var A9=g(D9);const P9={overflow:"hidden",willChange:"auto"},O9=e=>({...Wj,borderWidth:"rtl"===e?"0px 1px 0px 0px":"0px 0px 0px 1px"}),T9=({topGridRef:e,rowHightCallback:t,width:n,height:r,showLastBorder:i,getRightGridColumnWidth:o})=>{const{direction:a}=VF(),{layoutService:s,styleService:{grid:{divider:l},headerCellHeight:c}}=JF(),{gridSectionsData:{headersData:u,topDimensionData:d}}=x$(),h={...O9(a),borderColor:l,height:r};aG(e,d),oG(e,n,r,c);const p=s.size.x*o();return 0===d.rowCount?Ji.jsx("div",{style:{width:n,height:r,...O9(a)}}):Ji.jsx("div",{style:h,"data-section-id":"TOP_GRID",children:d.grid.map(((r,l)=>{const c=l===d.rowCount-1,{itemCount:h,estimatedItemSize:f,listValues:m}=E9(r,p,s.size.x,c),g=(({layoutService:e,headersData:t,topRowIndex:n})=>{const r=t.data.at(n);if(void 0===r)return;const i=t.size.x-1,o=tG({layoutService:e,headersData:t,topRowIndex:n})?0:i,a=r.at(o),s=Array.isArray(a)?a.at(i):a;return s?e.getDimensionInfo(s.dimensionInfoIndex):void 0})({layoutService:s,headersData:u,topRowIndex:l}),y=g?rW(g):`empty ${l}`;return Ji.jsx(OB,{ref:_9(e,l),style:P9,height:t(),width:n,itemCount:h,itemSize:k9({list:r,listValues:m,isLastRow:c,getRightGridColumnWidth:o}),layout:"horizontal",itemData:{list:r,isLast:c,itemCount:h,showLastBorder:i,listValues:m,totalDividerIndex:d.totalDividerIndex},itemKey:xV,estimatedItemSize:f,direction:a,children:M9},y)}))})};var L9=g(T9);const q9=()=>{const{styleService:{headerCellHeight:e,contentCellHeight:t}}=JF(),n=U$(),r=(()=>{const{model:e}=YF(),t=h((async(t,n)=>{if(!e)throw new Error("No Model provided!");const{qReverseSort:r,dimensionInfoIndex:i,sortDirection:o}=t,a=[];if(n===o)return!1;a.push({qPath:`/qHyperCubeDef/qDimensions/${i}/qDef/qReverseSort`,qOp:"Replace",qValue:(!r).toString()});try{return await e.applyPatches(a,!0),!0}catch(e){return console.error("Error while applying patch: ",e),!1}}),[e]);return t})(),{gridSectionsWrapperRefs:{headerGridWrapperRef:i,topGridWrapperRef:o,leftGridWrapperRef:a,dataGridWrapperRef:s},gridRefs:{topGridRef:l,leftGridRef:u,dataGridRef:d},scrollDirectionRefs:{verticalScrollDirection:p,horizontalScrollDirection:f},scrollbarsDimensions:{verticalScrollbarWidth:m,horizontalScrollbarHeight:g,resetHorizontalScrollbarHeight:y}}=G$(),{leftGridWidth:v,leftGridFullWidth:b,leftGridColumnWidths:x,rightGridFullWidth:w,showLastRightBorder:S,getRightGridColumnWidth:C,getHeaderCellsIconsVisibilityStatus:M,overrideLeftGridWidth:k}=function({tableWidth:e,verticalScrollbarWidth:t,resetHorizontalScrollbarHeight:n}){const{layoutService:r,styleService:i}=JF(),{gridSectionsData:{headersData:o}}=x$(),{measureText:a}=mz(i.header),s=j$({tableWidth:e}),l=z$({tableWidth:e,verticalScrollbarWidth:t,leftGridWidth:s.leftGridWidth}),u=s.leftGridWidth+l.rightGridFullWidth+1<e,d=h(((e,t,n="")=>{let i=e;r.isIndentModeEnabled&&(i=1,1===o.size.x&&(i=0));const l=s.leftGridColumnWidths[i];let c=!1,u=!1,d=a(n)+C$;return t&&d+S$<=l&&(u=!0,d+=S$),d+S$<=l&&(c=!0),{shouldShowMenuIcon:c,shouldShowLockIcon:u}}),[s.leftGridColumnWidths,a,r.isIndentModeEnabled,o.size.x]);return c((()=>{const e=s.leftGridWidth===s.leftGridFullWidth,t=l.rightGridWidth===l.rightGridFullWidth;e&&t&&n()}),[n,s.leftGridWidth,s.leftGridFullWidth,l.rightGridWidth,l.rightGridFullWidth]),{...s,...l,showLastRightBorder:u,getHeaderCellsIconsVisibilityStatus:d}}({tableWidth:n.width,verticalScrollbarWidth:m,resetHorizontalScrollbarHeight:y}),{gridScaffoldDimensions:E,headerGridDims:_,topGridDims:R,leftGridDims:I,dataGridDims:D,metadata:{everyThingFitsInTableRectHeight:A,scrollbarsVisibilityStatus:P}}=(({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:n,leftGridOriginalWidth:r,rightGridOriginalWidth:i},scrollBarsDimensions:{verticalScrollbarWidth:o,horizontalScrollbarHeight:a}})=>{const s=U$(),{pageInfo:l}=VF(),{gridSectionsData:{headersData:c,topDimensionData:u}}=x$(),d=Math.min(s.height*M$,Math.max(s.height*M$-25,s.height-t-a)),h=s.width*M$,p=l.rowsOnCurrentPage*t,f=Math.max(c.size.y,u.rowCount,1),m=e*f,g=e*f,y=Math.min(h,n),v=s.width-h,b=Math.max(v,s.width-y),x=Math.min(d,m,g),{availableHeight:w,everyThingFitsInTableRectHeight:S,everyThingFitsInTableRectWidth:C}=((e,t,n)=>{const r=t+1+n+o<=s.width,i=e+1+p+a,l=i-s.height<a||i<=s.height;return{availableHeight:l?i:s.height,everyThingFitsInTableRectHeight:l,everyThingFitsInTableRectWidth:r}})(x,y,b),M=w-d,k=Math.max(M,w-x),E=Math.min(k,p),_=Math.min(k,p),R=m+1+p,{visibilityStatus:I,metadata:{hasLeftGridOverflowX:D,hasDataGridOverflowX:A}}=(e=>{const{gridScaffold:{X_AXIS:{leftSectionWidth:t,rightSectionWidth:n},Y_AXIS:{topSectionHeight:r,bottomSectionHeight:i}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:o,rightSectionFullWidth:a},Y_AXIS:{topSectionFullHeight:s,bottomSectionFullHeight:l}}}=e,c=s>r,u=o>t,d=a>n,h=l>i;return{visibilityStatus:{topGrid:{overflowX:"hidden",overflowY:c?"scroll":"hidden"},leftGrid:{overflowX:u?"scroll":"hidden",overflowY:"hidden"},dataGrid:{overflowX:d?"scroll":"hidden",overflowY:h?"scroll":"hidden"}},metadata:{hasTopGridOverflowY:c,hasLeftGridOverflowX:u,hasDataGridOverflowX:d,hasDataGridOverflowY:h}}})({gridScaffold:{X_AXIS:{leftSectionWidth:y,rightSectionWidth:b},Y_AXIS:{topSectionHeight:x,bottomSectionHeight:k}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:r,rightSectionFullWidth:i},Y_AXIS:{topSectionFullHeight:g,bottomSectionFullHeight:R-g}}});return{gridScaffoldDimensions:{width:s.width,height:s.height,gridTemplateColumns:`${y}px ${b}px`,gridTemplateRows:`${x}px ${k}px`},headerGridDims:{width:-1,height:x},topGridDims:{fullSizeWrapper:{width:i-o+(A?o:0),height:g},stickyWrapper:{width:b-1-o,height:-1},self:{width:Math.min(i,b)-(C?1:0)-o,height:g}},leftGridDims:{fullSizeWrapper:{width:y,height:R-g+(!D&&A?a:0)},stickyWrapper:{width:y,height:k-1-a},self:{width:y,height:Math.max(t,E-(S?0:a-1))}},dataGridDims:{fullSizeWrapper:{width:i-o+(A?o:0),height:R-g+(!A&&D?a:0)},stickyWrapper:{width:b-1-o,height:k-1-a},self:{width:Math.min(i,b)-(C?1:0)-o,height:Math.max(t,_-(S?0:a-1))}},metadata:{everyThingFitsInTableRectHeight:S,scrollbarsVisibilityStatus:I}}})({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:v,leftGridOriginalWidth:b,rightGridOriginalWidth:w},scrollBarsDimensions:{verticalScrollbarWidth:m,horizontalScrollbarHeight:g}}),O=h((()=>e),[e]),T=h((()=>t),[t]);return(()=>{const{downloadService:e}=JF();c((()=>{e.isDownloadedAsPDForImage&&e.notifyIsDoneRendering()}))})(),Ji.jsxs(K$,{style:E,children:[Ji.jsx("div",{style:{overflow:"hidden"},ref:i,children:Ji.jsx(iG,{tableWidth:n.width,leftGridWidth:v,columnWidths:x,getHeaderCellsIconsVisibilityStatus:M,rowHight:e,height:_.height,changeSortOrder:r,overrideLeftGridWidth:k})}),Ji.jsx(Z$,{style:P.topGrid,origin:sj.TopGrid,ref:o,children:Ji.jsx(Y$,{style:R.fullSizeWrapper,children:Ji.jsx(Q$,{style:R.stickyWrapper,children:Ji.jsx(L9,{topGridRef:l,rowHightCallback:O,...R.self,showLastBorder:{right:S,bottom:!1},getRightGridColumnWidth:C})})})}),Ji.jsx(Z$,{style:P.leftGrid,origin:sj.LeftGrid,ref:a,children:Ji.jsx(Y$,{style:I.fullSizeWrapper,children:Ji.jsx(Q$,{style:I.stickyWrapper,children:Ji.jsx(A9,{leftGridRef:u,...I.self,columnWidths:x,showLastBorder:{right:!1,bottom:A}})})})}),Ji.jsx(Z$,{style:P.dataGrid,origin:sj.DataGrid,ref:s,children:Ji.jsx(Y$,{style:D.fullSizeWrapper,children:Ji.jsx(Q$,{style:D.stickyWrapper,children:Ji.jsx(MV,{dataGridRef:d,rowHightCallback:T,...D.self,showLastBorder:{right:S,bottom:A},getRightGridColumnWidth:C,verticalScrollDirection:p,horizontalScrollDirection:f})})})})]})},N9=()=>{const{keyboard:e,theme:t,interactions:n,translator:r}=YF(),{pageInfo:i,updatePageInfo:o,rect:a}=VF(),{layoutService:s}=JF(),{layout:l,hasData:c}=s;return Ji.jsxs(Ji.Fragment,{children:[c?Ji.jsx(q9,{}):null,Ji.jsx(QF,{}),Ji.jsx(BF,{paginationNeeded:i.shouldShowPagination,handleChangePage:e=>{o({page:e})},pageInfo:i,totalRowCount:i.totalRowCount,totalColumnCount:0,totalPages:i.totalPages,keyboard:e,translator:r,theme:t,interactions:n,rect:a,layout:l})]})};const j9=(e,{selections:n,baseObjects:r,coreServices:i,nebulaObjects:o})=>{const a=function(e){const t=Aw();return t?.components?.MuiTable?.styleOverrides&&(t.components.MuiTable.styleOverrides.root={}),ks({...t,direction:e})}(r.direction);e.render(Ji.jsx(t.StrictMode,{children:Ji.jsx(ul,{theme:a,children:Ji.jsx(KF,{...o,children:Ji.jsx(GF,{...r,children:Ji.jsx(jH,{selections:n,children:Ji.jsx(ZF,{...i,children:Ji.jsx(w$,{children:Ji.jsx(N9,{})})})})})})})}))};var z9=function(e){return e.FontSize="fontSize",e.FontFamily="fontFamily",e.FontColor="fontColor",e.FontStyle="fontStyle",e.Background="background",e.LineClamp="lineClamp",e.ColumnLineClamp="columnLineClamp",e.Border="border",e.Divider="divider",e}(z9||{}),F9=function(e){return e.Dimension="object.pivotTableV2.dimension",e.Measure="object.pivotTableV2.measure",e.Total="object.pivotTableV2.total",e.Null="object.pivotTableV2.null",e.Grid="object.pivotTableV2",e}(F9||{}),W9=function(e){return e.Grid="grid",e.Divider="grid.divider",e.LabelName="label.name",e.LabelValue="label.value",e}(W9||{}),$9=function(e){return e.FontSize="fontSize",e.FontFamily="fontFamily",e.FontColor="color",e.BackgroundColor="backgroundColor",e.LineClamp="lineClamp",e.ColumnLineClamp="columnLineClamp",e.BorderColor="borderColor",e}($9||{});const B9=e=>e?`${parseInt(e,10)}px`:void 0,H9=(e,t)=>{if(t){const n=e.getColorPickerColor(t);return"none"===n?jj.Transparent:n}},V9=(e,t)=>+(parseInt(e,10)*Nj*t+8).toFixed(2),G9=(e,t)=>void 0===e?t:e.some((e=>"bold"===e))?Lj:"normal",U9=e=>e?.some((e=>"italic"===e))?"italic":"normal",Y9=e=>e?.some((e=>"underline"===e))?"underline":"none",K9=document.createElement("textarea");function X9(e){K9.value=e,document.body.appendChild(K9),K9.select(),K9.setSelectionRange(0,K9.value.length),document.execCommand("copy"),document.body.removeChild(K9)}K9.style.position="absolute",K9.style.left="-9999px",K9.setAttribute("readonly","");function J9(e){O?.(((t,n)=>{const r=n.target,i=r?.closest(`.${CT}`);i?.title&&t.addItem({translation:"contextMenu.copyCellValue",icon:"lui-icon lui-icon--copy",tid:"copy-cell-context-item",id:"copy-cell-context-item",select:async()=>{(e=>{const t=e.title;t&&(navigator.clipboard?.writeText?navigator.clipboard.writeText(t).catch((()=>{X9(t)})):X9(t))})(i)}}),e?.forEach((e=>{e(t,n,i)}))}))}const Z9=({model:e,layoutService:t,effectivePropertiesService:n,translator:r})=>iz(((i,o,a)=>{if(!e||n.qAlwaysFullyExpanded)return;const s=e,l=i.addItem({translation:"Object.PivotTable.ContextMenu.ExpandCollapse",tid:"expand-collapse-group",id:"expand-collapse-group"}),{qEffectiveDimensionName:c,label:u}=((e,t)=>{const n=((e,t)=>{const n=e?.getAttribute("data-dimension-info-index");if("string"==typeof n)return t.getDimensionInfo(+n)})(e,t);return"object"==typeof n?{qEffectiveDimensionName:n.qEffectiveDimensionName,label:n.qFallbackTitle}:{qEffectiveDimensionName:void 0,label:void 0}})(a,t);l.addItem((e=>({icon:"lui-icon lui-icon--plus",translation:"Object.PivotTable.ContextMenu.ExpandAll",tid:"expand-all",select:async()=>{try{await e.expandTop(eW,0,0,!0),await e.expandLeft(eW,0,0,!0)}catch(e){console.error("Failed to expand all",e)}}}))(s)),"string"==typeof c&&l.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:n,label:r,translator:i})=>({icon:"lui-icon lui-icon--plus",translation:i.get("SNPivotTable.ContextMenu.ExpandDimension",[r??""]),tid:"expand-dimension",id:"expand-dimension",select:BV({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n,action:FV.Expand})}))({model:s,effectivePropertiesService:n,qEffectiveDimensionName:c,label:u,translator:r})),l.addItem((e=>({icon:"lui-icon lui-icon--minus",translation:"Object.PivotTable.ContextMenu.CollapseAll",tid:"collapse-all",select:async()=>{try{await e.collapseTop(eW,0,0,!0),await e.collapseLeft(eW,0,0,!0)}catch(e){console.error("Failed to collapse all",e)}}}))(s)),"string"==typeof c&&l.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:n,label:r,translator:i})=>({icon:"lui-icon lui-icon--minus",translation:i.get("SNPivotTable.ContextMenu.CollapseDimension",[r??""]),tid:"collapse-dimension",id:"collapse-dimension",select:BV({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n,action:FV.Collapse})}))({model:s,effectivePropertiesService:n,qEffectiveDimensionName:c,label:u,translator:r}))}),[e,t,n]),Q9=(e,t)=>E((()=>(({layout:e})=>{const{qHyperCube:t,nullValueRepresentation:n,snapshotData:r}=e,{qNoOfLeftDims:i,qEffectiveInterColumnSortOrder:o,qMeasureInfo:a,qDimensionInfo:s}=t,l=!!r,c=r?.content?.rowsPerPage??15e3,u={x:Math.min(e.qHyperCube.qSize.qcx,qj),y:Math.min(e.qHyperCube.qSize.qcy,c)},d=o.slice(0,i),h=e=>d.some((t=>t===e)),p=h(tW),f=new Map(o.map((e=>[s[e]??tW,e]))),m=a.filter((e=>7005!==e.qError?.qErrorCode));return{layout:e,getNullValueText:()=>n?.text??"-",getMeasureInfoIndexFromCellIndex:(e,t=!1)=>{if(p)return 0;const n=e%m.length;return t?n:a.findIndex((e=>e===m[n]))},getDimensionInfo:e=>e===tW?void 0:s.at(e),getDimensionInfoIndex:e=>f.get(e)??-1,size:u,isSnapshot:l,hasLimitedData:!l&&u.x<e.qHyperCube.qSize.qcx,hasData:u.x>0&&u.y>0,hasLeftDimensions:0!==e.qHyperCube.qNoOfLeftDims,hasPseudoDimOnLeft:p,leftDimensionInfoIndexes:d,isLeftDimension:h,triggerdByExpandOrCollapse:!!e.qHyperCube.qLastExpandedPos,visibleMeasureInfo:m,isIndentModeEnabled:Boolean(e.qHyperCube.qIndentMode),indentModeColumnWidth:e.qHyperCube.indentModeColumnWidth??{type:RT.Auto,pixels:_T.PixelsDefault,percentage:_T.PercentageDefault},searchSortFromDimension:"inherit"===e.search?.sorting}})({layout:e})),[e,t]),eee=({model:e,layoutService:t,viewService:n,pageInfo:r,rect:i})=>{const{layout:o,isSnapshot:a,triggerdByExpandOrCollapse:s}=t,l=(e=>{const t=az(e);return t.current=e,t})(f$(i));return hz((async()=>{const{qHyperCube:t}=o,{maxNumberOfVisibleRows:i,maxNumberOfVisibleColumns:c}=l.current;if(a)return o.snapshotData?.content?.qPivotDataPages??[];if(void 0!==e&&"getHyperCubePivotData"in e&&(((e,t,n,r)=>!!e&&(t.gridColumnStartIndex+t.gridWidth>=r||t.gridRowStartIndex+t.gridHeight>=n))(s,n,i,c)||((e,t,n,r)=>{const{qHyperCube:{qPivotDataPages:i,qSize:o}}=e,{qTop:a,qWidth:s,qHeight:l}=i[0]?.qArea??{qTop:0,qWidth:0,qHeight:0};return a<t.page*t.rowsPerPage||s<Math.min(r,o.qcx)||l<Math.min(n,o.qcy)})(o,r,i,c))){const t=((e,t,n,r,i,o)=>{const a=r.page*r.rowsPerPage,s=Math.min(a+r.rowsPerPage,n.qcy),l=Math.min(qj,n.qcx);if(n.qcy<a)return null;let c=0,u=a;if(e){c=t.gridColumnStartIndex,u=a+t.gridRowStartIndex;const e=u+t.gridHeight,n=t.gridColumnStartIndex+t.gridWidth;e>s&&(u=Math.max(0,s-i)),n>l&&(c=Math.max(0,l-o))}return{qLeft:c,qTop:u,qWidth:Math.min(l-c,o),qHeight:Math.min(s-u,i)}})(s,n,o.qHyperCube.qSize,r,i,c);return t?e.getHyperCubePivotData(eW,m$(t)):[]}return t.qPivotDataPages}),[o,a,e,n,r.page,r.rowsPerPage,l,s])},tee=({rowsPerPage:e,totalRowCount:t,page:n})=>Math.min(e,t-n*e),nee=(e,t,n=15e3)=>({rowsPerPage:n,totalPages:Math.max(1,Math.ceil(e/n)),totalRowCount:e,rowsOnCurrentPage:tee({rowsPerPage:n,totalRowCount:e,page:t})}),ree=15,iee=({layoutService:e,viewService:t,rect:n,model:r,pageInfo:i})=>{const{freeResize:o}=_();return T((async e=>{const o=e;if(!o.snapshotData||!r||o.snapshotData.content)return o;if("getHyperCubePivotData"in r){const{scrollTop:e,scrollLeft:a,leftGridScrollLeft:s,topGridScrollTop:l}=t,c=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:a}=e,s=t.page*t.rowsPerPage,l=Math.max(r-ree,0),c=Math.max(s+i-ree,s,0),u=qj-l,d=s+t.rowsOnCurrentPage-c;if((e=>0===e.gridWidth&&0===e.gridHeight)(e)){const{maxNumberOfVisibleColumns:e,maxNumberOfVisibleRows:t}=f$(n);return{qLeft:l,qTop:c,qWidth:Math.min(u,e+30),qHeight:Math.min(d,t+30)}}return{qLeft:l,qTop:c,qWidth:Math.min(u,o+30),qHeight:Math.min(d,a+30)}})(t,i,n),u=m$(c),d={qLeft:0,qTop:i.page*i.rowsPerPage,qWidth:1,qHeight:1};o.snapshotData.content={qPivotDataPages:await r.getHyperCubePivotData(eW,[d,...u]),scrollTop:e,scrollLeft:a,leftGridScrollLeft:s,topGridScrollTop:l,page:i.page,rowsPerPage:i.rowsPerPage},o.snapshotData.object.size.w=n.width,o.snapshotData.object.size.h=n.height}return o})),L((()=>({getViewState:()=>((e,t)=>({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,leftGridScrollLeft:e.leftGridScrollLeft,topGridScrollTop:e.topGridScrollTop,renderPage:t.page}))(t,i)})),[t]),e.layout.snapshotData?.content&&!o?{left:n.left,top:n.top,width:e.layout.snapshotData.object.size.w,height:e.layout.snapshotData.object.size.h}:n};var oee={SNPivotTable_ContextMenu_CollapseDimension:{id:"SNPivotTable.ContextMenu.CollapseDimension",locale:{"de-DE":"{0} reduzieren","en-US":"Collapse {0}","es-ES":"Contraer {0}","fr-FR":"Réduire {0}","it-IT":"Comprimi {0}","ja-JP":"{0} を折りたたむ","ko-KR":"{0} 축소","nl-NL":"{0} samenvouwen","pl-PL":"Zwiń {0}","pt-BR":"Recolher {0}","ru-RU":"Свернуть {0}","sv-SE":"Dölj {0}","tr-TR":"{0} öğelerini daralt","zh-CN":"折叠 {0}","zh-TW":"收合 {0}"}},SNPivotTable_ContextMenu_ExpandDimension:{id:"SNPivotTable.ContextMenu.ExpandDimension",locale:{"de-DE":"{0} erweitern","en-US":"Expand {0}","es-ES":"Expandir {0}","fr-FR":"Développer {0}","it-IT":"Espandi {0}","ja-JP":"{0} を展開","ko-KR":"{0} 확장","nl-NL":"{0} uitvouwen","pl-PL":"Rozwiń {0}","pt-BR":"Expandir {0}","ru-RU":"Развернуть {0}","sv-SE":"Visa {0}","tr-TR":"{0} öğelerini genişlet","zh-CN":"展开 {0}","zh-TW":"展開 {0}"}},SNPivotTable_IndentMode_Rows:{id:"SNPivotTable.IndentMode.Rows",locale:{"de-DE":"Zeilen","en-US":"Rows","es-ES":"Filas","fr-FR":"Lignes","it-IT":"Righe","ja-JP":"行","ko-KR":"행","nl-NL":"Rijen","pl-PL":"Wiersze","pt-BR":"Linhas","ru-RU":"Строки","sv-SE":"Rader","tr-TR":"Satırlar","zh-CN":"行","zh-TW":"列"}},SNPivotTable_LimitedData:{id:"SNPivotTable.LimitedData",locale:{"de-DE":"* Derzeit wird eine begrenzte Anzahl Spalten angezeigt","en-US":"* Currently showing a limited number of columns","es-ES":"* Actualmente mostrando un número limitado de columnas","fr-FR":"*Affichage actuel d'un nombre limité de colonnes","it-IT":"* Attualmente visualizzato un numero limitato di colonne","ja-JP":"* 現在、限られた列の数を表示","ko-KR":"* 현재 제한된 수의 열만 표시","nl-NL":"* Op dit moment wordt slechts een beperkt aantal kolommen getoond","pl-PL":"* Obecnie wyświetlana jest ograniczona liczba kolumn","pt-BR":"* Atualmente mostrando um número limitado de colunas","ru-RU":"* В настоящее время отображается ограниченное количество столбцов","sv-SE":"* Visar för närvarande ett begränsat antal kolumner","tr-TR":"*Şu anda sınırlı sayıda sütun gösteriliyor","zh-CN":"* 当前显示的列数有限","zh-TW":"* 目前顯示有限欄數"}},SNPivotTable_NoData:{id:"SNPivotTable.NoData",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, weil es keine Werte enthält.","en-US":"The chart is not displayed because it contains no values.","es-ES":"El gráfico no se muestra porque no contiene valores.","fr-FR":"Le graphique n'est pas affiché, car il ne contient aucune valeur.","it-IT":"Il grafico non è visualizzato poiché non contiene alcun valore.","ja-JP":"チャートには値が含まれていないため、チャートは表示されません。","ko-KR":"차트에 값이 없으므로 차트가 표시되지 않습니다.","nl-NL":"Het diagram wordt niet weergegeven omdat deze geen waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ nie zawiera wartości.","pt-BR":"O gráfico não foi exibido porque não contém valores.","ru-RU":"Диаграмма не отображается, так как не содержит значений.","sv-SE":"Diagrammet visas inte eftersom det inte innehåller några värden.","tr-TR":"Değer içermemesi nedeniyle grafik görüntülenmiyor.","zh-CN":"图表未显示,因为它不包含任何值。","zh-TW":"系統不會顯示圖表,因為這沒有包含任何值。"}}};const aee=()=>{const e=q(),t=e.language();return E((()=>{!function(e){const t="SNPivotTable_LimitedData";e.get(t)===t&&Object.keys(oee).forEach((t=>{e.add(oee[t])}))}(e)}),[e]),{translator:e,language:t}},see=e=>{const{flags:t}=e,n=N(),r=(e=>{const t=E((()=>gz(e)),[e]);return D((()=>()=>{t.unmount()}),[t]),t})(n),i=j(),o=z(),a=F(),s=W(),l=$(),c=(()=>{const{viewState:e}=_(),t=az(new Set),n=void 0!==window.qlikprinting,{promise:r,resolve:i}=E((()=>rz()),[]),o=iz((e=>{n&&t.current.add(e)}),[t]),a=iz(LN((async()=>{await Promise.all(t.current),t.current.clear(),i()}),1e3),[i,t]);return R((async()=>{n&&await r}),[r,n]),E((()=>({viewState:e,isDownloadedAsPDForImage:n,notifyIsDoneRendering:a,waitForPromise:o})),[a,n,e,o])})(),u=((e,t)=>{const[n]=hz((async()=>{if(void 0!==e&&!t.snapshotData&&"getEffectiveProperties"in e)return{...await e.getEffectiveProperties()}}),[e,t]),r=E((()=>{const e=void 0!==n?.qHyperCubeDef.qSortbyYValue&&1===Math.abs(n.qHyperCubeDef.qSortbyYValue),t=n?.qHyperCubeDef.qDimensions.map((e=>e.qDef?.qSortCriterias))??[];return{qAlwaysFullyExpanded:n?.qHyperCubeDef.qAlwaysFullyExpanded??!1,qExpansionState:n?.qHyperCubeDef.qExpansionState,isSortedByFirstMeasure:e,getSortCriteriaForDimension:e=>t[e]}}),[n]);return r})(o,i),d=Q9(i,t),h=(e=>{const t=P();return{...t,select:!!t.active&&!!t.select&&!e,active:!!t.active&&!e,scroll:!!t.active}})(d.isSnapshot),p=B(),f=dz(i,n),{translator:m,language:g}=aee(),{pageInfo:y,updatePageInfo:v}=((e,t)=>{const{size:n,layout:{qHyperCube:{qSize:r}}}=e,i=t.isDownloadedAsPDForImage||e.isSnapshot,o=(e=>e.layout.snapshotData?.content?.rowsPerPage)(e),[a,s]=I((()=>{const a=((e,t)=>t.isDownloadedAsPDForImage?t.viewState?.renderPage??0:e.isSnapshot?e.layout.snapshotData?.content?.page??0:0)(e,t);return{page:a,shouldShowPagination:r.qcy>n.y&&!i,...nee(r.qcy,a,o)}})),l=e.layout.qHyperCube.qSize.qcy;return D((()=>{s((t=>({...t,...nee(l,t.page,o),shouldShowPagination:l>e.size.y&&!i})))}),[l,e.size.y,s,i,o]),D((()=>{const{page:e,totalPages:t}=a;if(e+1>t){const e=t-1,n=tee({...a,page:e});s({...a,page:e,rowsOnCurrentPage:n})}}),[a]),{pageInfo:a,updatePageInfo:e=>{s({...a,...e,rowsOnCurrentPage:tee({...a,...e})})}}})(d,c),b=((e,t,n)=>E((()=>((e,t)=>{if(e.isDownloadedAsPDForImage){const{viewState:t}=e;return{gridColumnStartIndex:0,gridRowStartIndex:0,gridWidth:0,gridHeight:0,scrollTop:t?.scrollTop??0,scrollLeft:t?.scrollLeft??0,leftGridScrollLeft:t?.leftGridScrollLeft??0,topGridScrollTop:t?.topGridScrollTop??0}}return{gridColumnStartIndex:0,gridRowStartIndex:0,gridWidth:0,gridHeight:0,scrollTop:t?.content?.scrollTop??0,scrollLeft:t?.content?.scrollLeft??0,leftGridScrollLeft:t?.content?.leftGridScrollLeft??0,topGridScrollTop:t?.content?.topGridScrollTop??0}})(n,t.snapshotData)),[n,e.page,t.snapshotData]))(y,i,c),x=iee({rect:H(),layoutService:d,viewService:b,model:o,pageInfo:y}),[w,S]=eee({model:o,layoutService:d,viewService:b,pageInfo:y,rect:x}),C=E((()=>((e,t)=>{const n=t.layout.components?.find((e=>"theme"===e.key)),r=n?.header,i=n?.dimensionValues,o=n?.measureValues,a=n?.measureLabels,s=n?.totalValues,l=n?.nullValues,c=n?.grid,u=(t,n,r)=>e.getStyle(t,n,r),d=+(c?.[z9.LineClamp]??u(F9.Grid,W9.Grid,$9.LineClamp)??1),h=+(c?.[z9.ColumnLineClamp]??u(F9.Grid,W9.Grid,$9.ColumnLineClamp)??1),p=H9(e,r?.[z9.Background])??u(F9.Dimension,W9.LabelName,$9.BackgroundColor)??jj.Transparent,f={header:{fontSize:B9(r?.[z9.FontSize])??u(F9.Dimension,W9.LabelName,$9.FontSize)??Oj,fontFamily:r?.[z9.FontFamily]??u(F9.Dimension,W9.LabelName,$9.FontFamily)??Tj,fontWeight:G9(r?.[z9.FontStyle],Lj),fontStyle:U9(r?.[z9.FontStyle]),textDecoration:Y9(r?.[z9.FontStyle]),color:H9(e,r?.[z9.FontColor])??u(F9.Dimension,W9.LabelName,$9.FontColor)??bj.TEXT,background:p,hoverBackground:Sj(p,IT),activeBackground:Sj(p,DT)},dimensionValues:{fontSize:B9(i?.[z9.FontSize])??u(F9.Dimension,W9.LabelValue,$9.FontSize)??Oj,fontFamily:i?.[z9.FontFamily]??u(F9.Dimension,W9.LabelValue,$9.FontFamily)??Tj,fontWeight:G9(i?.[z9.FontStyle],void 0),fontStyle:U9(i?.[z9.FontStyle]),textDecoration:Y9(i?.[z9.FontStyle]),color:H9(e,i?.[z9.FontColor])??u(F9.Dimension,W9.LabelValue,$9.FontColor)??bj.TEXT,background:H9(e,i?.[z9.Background])??u(F9.Dimension,W9.LabelValue,$9.BackgroundColor)??jj.Transparent},measureValues:{fontSize:B9(o?.[z9.FontSize])??u(F9.Measure,W9.LabelValue,$9.FontSize)??Oj,fontFamily:o?.[z9.FontFamily]??u(F9.Measure,W9.LabelValue,$9.FontFamily)??Tj,fontWeight:G9(o?.[z9.FontStyle],"normal"),fontStyle:U9(o?.[z9.FontStyle]),textDecoration:Y9(o?.[z9.FontStyle]),color:H9(e,o?.[z9.FontColor])??u(F9.Measure,W9.LabelValue,$9.FontColor)??jj.FontSecondary,background:H9(e,o?.[z9.Background])??u(F9.Measure,W9.LabelValue,$9.BackgroundColor)??jj.Transparent},measureLabels:{fontWeight:G9(a?.[z9.FontStyle],"normal"),fontStyle:U9(a?.[z9.FontStyle]),textDecoration:Y9(a?.[z9.FontStyle]),color:H9(e,a?.[z9.FontColor])??u(F9.Measure,W9.LabelName,$9.FontColor)??jj.FontSecondary,background:H9(e,a?.[z9.Background])??u(F9.Measure,W9.LabelName,$9.BackgroundColor)??jj.Transparent},totalValues:{fontWeight:G9(s?.[z9.FontStyle],Lj),fontStyle:U9(s?.[z9.FontStyle]),textDecoration:Y9(s?.[z9.FontStyle]),color:H9(e,s?.[z9.FontColor])??u(F9.Total,W9.LabelValue,$9.FontColor)??bj.TEXT,background:H9(e,s?.[z9.Background])??u(F9.Total,W9.LabelValue,$9.BackgroundColor)??jj.Transparent},nullValues:{fontWeight:G9(l?.[z9.FontStyle],"normal"),fontStyle:U9(l?.[z9.FontStyle]),textDecoration:Y9(l?.[z9.FontStyle]),color:H9(e,l?.[z9.FontColor])??u(F9.Null,W9.LabelValue,$9.FontColor)??bj.TEXT,background:H9(e,l?.[z9.Background])??u(F9.Null,W9.LabelValue,$9.BackgroundColor)??jj.NullValueBackground},grid:{columnLineClamp:h,lineClamp:d,border:H9(e,c?.[z9.Border])??u(F9.Grid,W9.Grid,$9.BorderColor)??jj.DividerLight,divider:H9(e,c?.[z9.Divider])??u(F9.Grid,W9.Divider,$9.BorderColor)??jj.DividerDark,background:H9(e,c?.[z9.Background])??u(F9.Grid,W9.Grid,$9.BackgroundColor)??jj.Transparent},selectedColors:wj(e)};return f.headerCellHeight=Math.max(V9(f.header.fontSize,h),V9(f.dimensionValues.fontSize,h),32),f.contentCellHeight=Math.max(V9(f.measureValues.fontSize,d),V9(f.dimensionValues.fontSize,d),24),f.dimensionValueTextHeight=V9(f.dimensionValues.fontSize,1),f})(f,d)),[f,d]),M=((e,t,n)=>{const[,r,i]=hz((async()=>{const t=Pq(n.flags),r=e.getStyle("","","fontFamily"),i=e.getStyle("object","label.name","fontFamily"),o=e.getStyle("object","label.value","fontFamily"),a=e.getStyle("","","fontFamilies")??[];return Promise.all([...t,...a,r,i,o,vz].filter((e=>void 0!==e)).map((async e=>{await document.fonts.load(`600 12px ${e}`),await document.fonts.load(`12px ${e}`)})))}),[t,e,n]);return i?(console.warn("Failed to load fonts:",i),!0):!r})(f,i,e),{direction:k}=_();J9([Z9({model:o,layoutService:d,effectivePropertiesService:u,translator:m})]),D((()=>{!S&&o&&!!w&&M&&j9(r,{selections:p,baseObjects:{rect:x,pageInfo:y,qPivotDataPages:w,updatePageInfo:v,direction:k},nebulaObjects:{env:e,app:a,model:o,embed:s,theme:f,keyboard:l,translator:m,interactions:h},coreServices:{styleService:C,viewService:b,layoutService:d,downloadService:c,effectivePropertiesService:u}})}),[o,a,x,h,p,b,d,c,S,w,C,r,M,m,g,y,v,u,s,l,f,e,k])},lee={version:"7.0.9",qHyperCubeDef:{qAlwaysFullyExpanded:!1,qDimensions:[],qMeasures:[],qMode:"P",qSuppressMissing:!0,qSuppressZero:!1,qShowTotalsAbove:!0,qInitialDataFetch:[{qTop:0,qLeft:0,qWidth:50,qHeight:50}],qIndentMode:!1},showTitles:!0,title:"",subtitle:"",footnote:"",nullValueRepresentation:{text:"-"},components:[]};function cee(e){return{qae:{properties:{initial:{...lee,qHyperCubeDef:{...lee.qHyperCubeDef,qIndentMode:!1}}},data:BN(e)},ext:nz(e),component(){see(e)}}}export{cee as default};
|
|
104
|
+
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,d,h=e.length,p=e.search(/[0-9\-\+#]/),f=p>0?e.substring(0,p):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=h-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,h):"";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"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(d=t[0]).length%l,h=d.length,b=0;b<h;b++)m+=d.charAt(b),!((b-y+1)%l)&&b<h-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),f+(n?"-":"")+r+x}}));function uU(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const dU={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"},hU=/%\)?$/,pU=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,fU=/^\(oct\)/i,mU=/^\(dec\)/i,gU=/^\(hex\)/i,yU=/^\(bin\)/i,vU=/^\(rom\)/i,bU=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,xU=/#|0/g;function wU(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 SU(e,t,n){let r;return pU.test(t)?e=wU(e,Number(/\d{2}/.exec(t)[0]),t,n):fU.test(t)?e=wU(e,8,t,n):mU.test(t)?e=wU(e,10,t,n):gU.test(t)?e=wU(e,16,t,n):yU.test(t)?e=wU(e,2,t,n):vU.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let 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();for(;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}function CU(e,t,n){const r=uU(e);return n?r:new RegExp(r||"",t)}function MU(e,t,n,r){let i,o,a,s,l,c,u,d,h,p=e.pattern;var f,m;r&&(e.abbreviate=!0),f=t,(m=n)&&(m=uU(m)),f&&(f=uU(f)),h=new RegExp("(?:[#0]+".concat(f,")?[#0]+(?:").concat(m,"[#0]+)?")),a=p.match(h),a=a?a[0]:"",s=a?p.substr(0,p.indexOf(a)):p,l=a?p.substring(p.indexOf(a)+a.length):"",a||(a=p?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(CU(c,"g"),t)),u=n,n=".",u&&(a=a.replace(CU(u,"g"),n)),d=a.match(/#/g),d=d?d.length:0;const g=p.split(u);let y;g[1]&&(y=g[1].match(xU)),e.prefix=s||"",e.postfix=l||"",e.pattern=p,e.maxPrecision=y?y.length:2,e.percentage=hU.test(p),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(CU(t,null,!0),"|").concat(CU(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class kU{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return dU;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new kU(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],bU.test(e[0])&&(r.positive.isFunctional=!0),e[1]?bU.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?bU.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||MU(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&MU(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&MU(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,c,u=this._prepared,d="",h="",p=e;if(isNaN(e))return"".concat(p);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,a=u.t,u.isFunctional)e=SU(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=cU(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),h=""):(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=cU(l,e)}e=e.replace(u.numericRegex,(e=>e===a?u.groupTemp:e===o?u.decTemp:"")),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+h+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function EU(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=e=>e}=t;let o,a,s=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return a=i(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=i(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(c>=n&&(delete s[l[u]],delete l[u],c--,u++),s[e]=t,l[c]=e,c++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function _U(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new kU(...t)}(i,e,t,n,r),a=EU(o.formatValue.bind(o),{toKey:e=>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}const RU="D",IU="T",DU="TS",AU="IV",PU=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],OU=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],TU=["January","February","March","April","May","June","July","August","September","October","November","December"],LU=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function qU(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function NU(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function jU(e,t){let n,r=function(e){const t=e,n=24*NU(t),r=60*NU(n),i=60*NU(r),o=1e3*NU(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,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:a,s:s,f:l,t:u}}class zU{constructor(e,t,n){const r=e||{};if(r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:PU,qDayNames:OU,qLongMonthNames:TU,qMonthNames:LU}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),!t){t={[IU]:r.qTimeFmt||"hh:mm:ss",[RU]:r.qDateFmt||"YYYY-MM-DD",[DU]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new zU(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),r=jU(e,t));const i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:qU("".concat(t.year).slice(-2),2),YYY:qU("".concat(t.year).slice(-3),3),def:e=>qU("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:qU("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:qU("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>qU("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>qU("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>qU("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>qU("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const a=new RegExp(o.join("|"),"g"),s=t.replace(a,(e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}));return s}}function FU(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new zU(...t)}function WU(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=FU(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=EU(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==AU?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=FU(i,e,t),r=EU(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function $U(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u="dimension"===s?"first":"avg",d=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return WU(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",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"),_U(n,r,i,o,t)}(t,i),h="dimension"===s?"first":(e,t)=>d(t),p={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(p)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:e=>(null==e?void 0:e.qText)||"",reduce:u,reduceLabel:h,formatter:()=>d,tags:()=>t.qTags};return p}function BU(e,t,n,r,i){return(t[e]||[]).map(((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:$U(EG({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=BU("qAttrDimInfo",t,n,a,EG({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=BU("qAttrExprInfo",t,n,a,EG({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=BU("qMeasureInfo",t,n,a,EG({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s}))}function HU(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},i=t;if(!i)throw new Error('Missing "data" input');if(!i.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=HU.util,a={cache:r,cube:i,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>e,raw:()=>i,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>r.fields.slice(),extract:e=>a.extractor(e,s,r,o),hierarchy:e=>a.hierarchy(e,s,r,o),_cache:()=>r};"K"===i.qMode||"T"===i.qMode||!i.qMode&&i.qNodesOnDim?(a.extractor=lU,a.hierarchy=sU,a.pages="K"===i.qMode?i.qStackedDataPages:i.qTreeDataPages):"S"===i.qMode?(a.extractor=DG,a.pages=i.qDataPages,a.hierarchy=sU):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},s,r,o);const l="S"===i.qMode?e=>e.qElemNumber:void 0,c="S"===i.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...BU("qDimensionInfo",i,e,"",EG({},a,{value:l,type:"dimension"}))),r.wrappedFields.push(...BU("qMeasureInfo",i,e,"",EG({},a,{value:c,type:"measure"}))),r.fields=r.wrappedFields.map((e=>e.instance));const u=e=>{e.forEach((e=>{r.allFields.push(e.instance),u(e.measures),u(e.attrDims),u(e.attrExps)}))};return u(r.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=s.field(t.from),i=$U(yG({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},s,r,o),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));r.virtualFields.push(i)})),r.allFields.push(...r.virtualFields),s}const VU=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],GU=/\/qDimensionInfo(?:\/(\d+))?/,UU=/\/qMeasureInfo\/(\d+)/,YU=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,KU=/\/qAttrExprInfo\/(\d+)/,XU=/\/?qHyperCube/,JU=/\/?qTreeData/,ZU=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),QU=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function eY(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;if(e.brushes().forEach((e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;XU.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=ZU):JU.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=QU);let s=!0;if(GU.test(e)&&(r=+GU.exec(e)[1]),UU.test(e)&&(i=+UU.exec(e)[1]),YU.test(e)){i=-1,r=0;const e=+YU.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(KU.test(e)){const e=i;if(t){i=0;const a=UG(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce(((e,t)=>e+t.qAttrExprInfo.length),i),r=-1):(i=a.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),i),i=a.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),i)),i+=+KU.exec(n)[1]}else r>-1?(r=-1,i=+KU.exec(n)[1]):i+=+KU.exec(n)[1]+1}return VU.forEach((e=>{let[t,r]=e;n=n.replace(t,r)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||s>=o)&&o>-1?n.forEach((e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})})):n.forEach((e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&s)return[{method:"resetMadeSelections",params:[]}];var c;a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]});return a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o}function tY(e){HU.util=e.data("matrix").util,e.data("q",HU),e.formatter("q-number",_U),e.formatter("q-time",WU)}tY.qBrushHelper=eY,tY.selections=eY;var nY=Object.prototype.hasOwnProperty,rY=Object.prototype.toString,iY=Object.defineProperty,oY=Object.getOwnPropertyDescriptor,aY=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===rY.call(e)},sY=function(e){if(!e||"[object Object]"!==rY.call(e))return!1;var t,n=nY.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&nY.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||nY.call(e,t)},lY=function(e,t){iY&&"__proto__"===t.name?iY(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},cY=function(e,t){if("__proto__"===t){if(!nY.call(e,t))return;if(oY)return oY(e,t).value}return e[t]},uY=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=cY(s,n),s!==(i=cY(t,n))&&(u&&i&&(sY(i)||(o=aY(i)))?(o?(o=!1,a=r&&aY(r)?r:[]):a=r&&sY(r)?r:{},lY(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&lY(s,{name:n,newValue:i}));return s},dY="2.10.0";function hY(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pY(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 fY(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pY(Object(n),!0).forEach((function(t){hY(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pY(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function mY(e){return!!e.changedTouches}function gY(e){return"number"==typeof e&&!isNaN(e)}function yY(e){return"number"!=typeof e||isNaN(e)}function vY(e){const t=e.length;let n=NaN,r=NaN,i=NaN,o=NaN;for(let 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 bY(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function xY(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 wY(e){const[t,n,r,i]=vY(e);return{x:t,y:n,width:r-t,height:i-n}}function SY(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function CY(e){const{x:t,y:n,width:r,height:i,x1:o,x2:a,y1:s,y2:l,cx:c,cy:u,r:d,vertices:h}=e||{};return gY(c)&&gY(u)&&gY(d)?"circle":gY(o)&&gY(a)&&gY(s)&&gY(l)?"line":gY(t)&&gY(n)&&gY(r)&&gY(i)?"rect":gY(t)&&gY(n)?"point":Array.isArray(h)?h.every((e=>Array.isArray(e)))?"geopolygon":"polygon":null}function MY(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}var kY=Math.PI,EY=2*kY,_Y=1e-6,RY=EY-_Y;function IY(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function DY(){return new IY}function AY(e){return function(){return e}}IY.prototype=DY.prototype={constructor:IY,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,c=o-e,u=a-t,d=c*c+u*u;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(d>_Y)if(Math.abs(u*s-l*c)>_Y&&i){var h=n-o,p=r-a,f=s*s+l*l,m=h*h+p*p,g=Math.sqrt(f),y=Math.sqrt(d),v=i*Math.tan((kY-Math.acos((f+d-m)/(2*g*y)))/2),b=v/y,x=v/g;Math.abs(b-1)>_Y&&(this._+="L"+(e+b*c)+","+(t+b*u)),this._+="A"+i+","+i+",0,0,"+ +(u*h>c*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,c=t+s,u=1^o,d=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>_Y||Math.abs(this._y1-c)>_Y)&&(this._+="L"+l+","+c),n&&(d<0&&(d=d%EY+EY),d>RY?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):d>_Y&&(this._+="A"+n+","+n+",0,"+ +(d>=kY)+","+u+","+(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 PY=Math.abs,OY=Math.atan2,TY=Math.cos,LY=Math.max,qY=Math.min,NY=Math.sin,jY=Math.sqrt,zY=1e-12,FY=Math.PI,WY=FY/2,$Y=2*FY;function BY(e){return e>=1?WY:e<=-1?-WY:Math.asin(e)}function HY(e){return e.innerRadius}function VY(e){return e.outerRadius}function GY(e){return e.startAngle}function UY(e){return e.endAngle}function YY(e){return e&&e.padAngle}function KY(e,t,n,r,i,o,a){var s=e-n,l=t-r,c=(a?o:-o)/jY(s*s+l*l),u=c*l,d=-c*s,h=e+u,p=t+d,f=n+u,m=r+d,g=(h+f)/2,y=(p+m)/2,v=f-h,b=m-p,x=v*v+b*b,w=i-o,S=h*m-f*p,C=(b<0?-1:1)*jY(LY(0,w*w*x-S*S)),M=(S*b-v*C)/x,k=(-S*v-b*C)/x,E=(S*b+v*C)/x,_=(-S*v+b*C)/x,R=M-g,I=k-y,D=E-g,A=_-y;return R*R+I*I>D*D+A*A&&(M=E,k=_),{cx:M,cy:k,x01:-u,y01:-d,x11:M*(i/w-1),y11:k*(i/w-1)}}function XY(){var e=HY,t=VY,n=AY(0),r=null,i=GY,o=UY,a=YY,s=null;function l(){var l,c,u=+e.apply(this,arguments),d=+t.apply(this,arguments),h=i.apply(this,arguments)-WY,p=o.apply(this,arguments)-WY,f=PY(p-h),m=p>h;if(s||(s=l=DY()),d<u&&(c=d,d=u,u=c),d>zY)if(f>$Y-zY)s.moveTo(d*TY(h),d*NY(h)),s.arc(0,0,d,h,p,!m),u>zY&&(s.moveTo(u*TY(p),u*NY(p)),s.arc(0,0,u,p,h,m));else{var g,y,v=h,b=p,x=h,w=p,S=f,C=f,M=a.apply(this,arguments)/2,k=M>zY&&(r?+r.apply(this,arguments):jY(u*u+d*d)),E=qY(PY(d-u)/2,+n.apply(this,arguments)),_=E,R=E;if(k>zY){var I=BY(k/u*NY(M)),D=BY(k/d*NY(M));(S-=2*I)>zY?(x+=I*=m?1:-1,w-=I):(S=0,x=w=(h+p)/2),(C-=2*D)>zY?(v+=D*=m?1:-1,b-=D):(C=0,v=b=(h+p)/2)}var A=d*TY(v),P=d*NY(v),O=u*TY(w),T=u*NY(w);if(E>zY){var L,q=d*TY(b),N=d*NY(b),j=u*TY(x),z=u*NY(x);if(f<FY&&(L=function(e,t,n,r,i,o,a,s){var l=n-e,c=r-t,u=a-i,d=s-o,h=d*l-u*c;if(!(h*h<zY))return[e+(h=(u*(t-o)-d*(e-i))/h)*l,t+h*c]}(A,P,j,z,q,N,O,T))){var F=A-L[0],W=P-L[1],$=q-L[0],B=N-L[1],H=1/NY(function(e){return e>1?0:e<-1?FY:Math.acos(e)}((F*$+W*B)/(jY(F*F+W*W)*jY($*$+B*B)))/2),V=jY(L[0]*L[0]+L[1]*L[1]);_=qY(E,(u-V)/(H-1)),R=qY(E,(d-V)/(H+1))}}C>zY?R>zY?(g=KY(j,z,A,P,d,R,m),y=KY(q,N,O,T,d,R,m),s.moveTo(g.cx+g.x01,g.cy+g.y01),R<E?s.arc(g.cx,g.cy,R,OY(g.y01,g.x01),OY(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,R,OY(g.y01,g.x01),OY(g.y11,g.x11),!m),s.arc(0,0,d,OY(g.cy+g.y11,g.cx+g.x11),OY(y.cy+y.y11,y.cx+y.x11),!m),s.arc(y.cx,y.cy,R,OY(y.y11,y.x11),OY(y.y01,y.x01),!m))):(s.moveTo(A,P),s.arc(0,0,d,v,b,!m)):s.moveTo(A,P),u>zY&&S>zY?_>zY?(g=KY(O,T,q,N,u,-_,m),y=KY(A,P,j,z,u,-_,m),s.lineTo(g.cx+g.x01,g.cy+g.y01),_<E?s.arc(g.cx,g.cy,_,OY(g.y01,g.x01),OY(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,_,OY(g.y01,g.x01),OY(g.y11,g.x11),!m),s.arc(0,0,u,OY(g.cy+g.y11,g.cx+g.x11),OY(y.cy+y.y11,y.cx+y.x11),m),s.arc(y.cx,y.cy,_,OY(y.y11,y.x11),OY(y.y01,y.x01),!m))):s.arc(0,0,u,w,x,m):s.lineTo(O,T)}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-FY/2;return[TY(r)*n,NY(r)*n]},l.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:AY(+t),l):e},l.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:AY(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:AY(+e),l):n},l.padRadius=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:AY(+e),l):r},l.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:AY(+e),l):i},l.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:AY(+e),l):o},l.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:AY(+e),l):a},l.context=function(e){return arguments.length?(s=null==e?null:e,l):s},l}function JY(e){this._context=e}function ZY(e){return new JY(e)}function QY(e){return e[0]}function eK(e){return e[1]}function tK(){var e=QY,t=null,n=AY(0),r=eK,i=AY(!0),o=null,a=ZY,s=null;function l(l){var c,u,d,h,p,f=l.length,m=!1,g=new Array(f),y=new Array(f);for(null==o&&(s=a(p=DY())),c=0;c<=f;++c){if(!(c<f&&i(h=l[c],c,l))===m)if(m=!m)u=c,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=c-1;d>=u;--d)s.point(g[d],y[d]);s.lineEnd(),s.areaEnd()}m&&(g[c]=+e(h,c,l),y[c]=+n(h,c,l),s.point(t?+t(h,c,l):g[c],r?+r(h,c,l):y[c]))}if(p)return s=null,p+""||null}function c(){return function(){var e=QY,t=eK,n=AY(!0),r=null,i=ZY,o=null;function a(a){var s,l,c,u=a.length,d=!1;for(null==r&&(o=i(c=DY())),s=0;s<=u;++s)!(s<u&&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(c)return o=null,c+""||null}return a.x=function(t){return arguments.length?(e="function"==typeof t?t:AY(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:AY(+e),a):t},a.defined=function(e){return arguments.length?(n="function"==typeof e?e:AY(!!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:AY(+n),t=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:AY(+t),l):e},l.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:AY(+e),l):t},l.y=function(e){return arguments.length?(n="function"==typeof e?e:AY(+e),r=null,l):n},l.y0=function(e){return arguments.length?(n="function"==typeof e?e:AY(+e),l):n},l.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:AY(+e),l):r},l.lineX0=l.lineY0=function(){return c().x(e).y(n)},l.lineY1=function(){return c().x(e).y(r)},l.lineX1=function(){return c().x(t).y(n)},l.defined=function(e){return arguments.length?(i="function"==typeof e?e:AY(!!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 nK(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function rK(e){return e}JY.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 iK=Array.prototype.slice;function oK(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 aK(e){this._context=e}function sK(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 lK(e,t){this._context=e,this._k=(1-t)/6}aK.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:oK(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:oK(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},lK.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:sK(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:sK(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 cK=function e(t){function n(e){return new lK(e,t)}return n.tension=function(t){return e(+t)},n}(0);function uK(e,t){this._context=e,this._alpha=t}uK.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>zY){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>zY){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}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 dK=function e(t){function n(e){return t?new uK(e,t):new lK(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function hK(e){return e<0?-1:1}function pK(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(hK(o)+hK(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function fK(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function mK(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 gK(e){this._context=e}function yK(e){this._context=new vK(e)}function vK(e){this._context=e}function bK(e){this._context=e}function xK(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 wK(e,t){this._context=e,this._t=t}function SK(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 CK(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function MK(e,t){return e[t]}function kK(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 EK(e){for(var t,n=0,r=-1,i=e.length;++r<i;)(t=+e[r][1])&&(n+=t);return n}function _K(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",r=arguments.length>2?arguments[2]:void 0;const i={},o=e||{get:()=>{},has:()=>!1,default:()=>{}};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,i){if(void 0!==i)return a(e,i);const 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(),l.add=a,l.get=s,l.has=function(e){return!!i[e]||o.has(e)},l.remove=function(e){const t=i[e];return delete i[e],t},l.getKeys=function(){return Object.keys(i)},l.getValues=function(){return Object.keys(i).map((e=>i[e]))},l.default=function(e){return void 0!==e&&(t=e),t},l.register=a,l}function RK(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 IK(e){return(e=RK(Math.abs(e)))?e[1]:NaN}gK.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:mK(this,this._t0,fK(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,mK(this,fK(this,n=pK(this,e,t)),n);break;default:mK(this,this._t0,n=pK(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(yK.prototype=Object.create(gK.prototype)).point=function(e,t){gK.prototype.point.call(this,t,e)},vK.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)}},bK.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=xK(e),i=xK(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)}},wK.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 DK,AK=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function PK(e){if(!(t=AK.exec(e)))throw new Error("invalid format: "+e);var t;return new OK({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 OK(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 TK(e,t){var n=RK(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")}PK.prototype=OK.prototype,OK.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 LK={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>TK(100*e,t),r:TK,s:function(e,t){var n=RK(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(DK=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")+RK(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function qK(e){return e}var NK,jK,zK,FK=Array.prototype.map,WK=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function $K(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?qK:(t=FK.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?qK:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(FK.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function d(e){var t=(e=PK(e)).fill,n=e.align,d=e.sign,h=e.symbol,p=e.zero,f=e.width,m=e.comma,g=e.precision,y=e.trim,v=e.type;"n"===v?(m=!0,v="g"):LK[v]||(void 0===g&&(g=12),y=!0,v="g"),(p||"0"===t&&"="===n)&&(p=!0,t="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===h?o:/[%p]/.test(v)?l:"",w=LK[v],S=/[defgprs%]/.test(v);function C(e){var i,o,l,h=b,C=x;if("c"===v)C=w(e)+C,e="";else{var M=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:w(Math.abs(e),g),y&&(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)),M&&0==+e&&"+"!==d&&(M=!1),h=(M?"("===d?d:c:"-"===d||"("===d?"":d)+h,C=("s"===v?WK[8+DK/3]:"")+C+(M&&"("===d?")":""),S)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 k=h.length+e.length+C.length,E=k<f?new Array(f-k+1).join(t):"";switch(m&&p&&(e=r(E+e,E.length?f-C.length:1/0),E=""),n){case"<":e=h+e+C+E;break;case"=":e=h+E+e+C;break;case"^":e=E.slice(0,k=E.length>>1)+h+e+C+E.slice(k);break;default:e=E+h+e+C}return s(e)}return g=void 0===g?6:/[gprs]/.test(v)?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=PK(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(IK(t)/3))),i=Math.pow(10,-r),o=WK[8+r/3];return function(e){return n(i*e)+o}}}}!function(e){NK=$K(e),jK=NK.format,zK=NK.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const BK=new Date,HK=new Date;function VK(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(s<n&&n<r);return a},i.filter=n=>VK((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((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=(t,r)=>(BK.setTime(+t),HK.setTime(+r),e(BK),e(HK),Math.floor(n(BK,HK))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e==0:t=>i.count(0,t)%e==0):i:null)),i}const GK=6e4,UK=864e5,YK=6048e5,KK=VK((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*GK)/UK),(e=>e.getDate()-1));KK.range;const XK=VK((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/UK),(e=>e.getUTCDate()-1));XK.range;const JK=VK((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/UK),(e=>Math.floor(e/UK)));function ZK(e){return VK((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*GK)/YK))}JK.range;const QK=ZK(0),eX=ZK(1),tX=ZK(2),nX=ZK(3),rX=ZK(4),iX=ZK(5),oX=ZK(6);function aX(e){return VK((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/YK))}QK.range,eX.range,tX.range,nX.range,rX.range,iX.range,oX.range;const sX=aX(0),lX=aX(1),cX=aX(2),uX=aX(3),dX=aX(4),hX=aX(5),pX=aX(6);sX.range,lX.range,cX.range,uX.range,dX.range,hX.range,pX.range;const fX=VK((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear()));fX.every=e=>isFinite(e=Math.floor(e))&&e>0?VK((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,fX.range;const mX=VK((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));function gX(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function yX(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function vX(e){let t,n,r;function i(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<0?i=t+1:o=t}while(i<o)}return i}return 2!==e.length?(t=gX,n=(t,n)=>gX(e(t),n),r=(t,n)=>e(t)-n):(t=e===gX||e===yX?e:bX,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<=0?i=t+1:o=t}while(i<o)}return i}}}function bX(){return 0}mX.every=e=>isFinite(e=Math.floor(e))&&e>0?VK((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,mX.range;const xX=vX(gX).right;vX((function(e){return null===e?NaN:+e})).center;var wX=xX;class SX extends Map{constructor(e,t=MX){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(CX(this,e))}has(e){return super.has(CX(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const r=t(n);e.has(r)&&(n=e.get(r),e.delete(r));return n}(this,e))}}function CX({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function MX(e){return null!==e&&"object"==typeof e?e.valueOf():e}const kX=Math.sqrt(50),EX=Math.sqrt(10),_X=Math.sqrt(2);function RX(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=kX?10:o>=EX?5:o>=_X?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(e*c),l=Math.round(t*c),s/c<e&&++s,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(e/c),l=Math.round(t/c),s*c<e&&++s,l*c>t&&--l),l<s&&.5<=n&&n<2?RX(e,t,2*n):[s,l,c]}function IX(e,t,n){return RX(e=+e,t=+t,n=+n)[2]}function DX(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 AX(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 PX(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function OX(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,c=FX(i),u=WX(i),d=FX(o),h=WX(o),p=FX(a),f=WX(a),m=FX(s),g=WX(s),y=FX(l),v=WX(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:lJ,e:lJ,f:pJ,g:MJ,G:EJ,H:cJ,I:uJ,j:dJ,L:hJ,m:fJ,M:mJ,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:KJ,s:XJ,S:gJ,u:yJ,U:vJ,V:xJ,w:wJ,W:SJ,x:null,X:null,y:CJ,Y:kJ,Z:_J,"%":YJ},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:RJ,e:RJ,f:OJ,g:HJ,G:GJ,H:IJ,I:DJ,j:AJ,L:PJ,m:TJ,M:LJ,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:KJ,s:XJ,S:qJ,u:NJ,U:jJ,V:FJ,w:WJ,W:$J,x:null,X:null,y:BJ,Y:VJ,Z:UJ,"%":YJ},w={a:function(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v.get(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.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return M(e,t,n,r)},d:ZX,e:ZX,f:iJ,g:YX,G:UX,H:eJ,I:eJ,j:QX,L:rJ,m:JX,M:tJ,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:XX,Q:aJ,s:sJ,S:nJ,u:BX,U:HX,V:VX,w:$X,W:GX,x:function(e,t,r){return M(e,n,t,r)},X:function(e,t,n){return M(e,r,t,n)},y:YX,Y:UX,Z:KX,"%":oJ};function S(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=TX[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=PX(1900,void 0,1);if(M(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=AX(PX(o.y,0,1))).getUTCDay(),r=i>4||0===i?lX.ceil(r):lX(r),r=XK.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=DX(PX(o.y,0,1))).getDay(),r=i>4||0===i?eX.ceil(r):eX(r),r=KK.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?AX(PX(o.y,0,1)).getUTCDay():DX(PX(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,AX(o)):DX(o)}}function M(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 TX?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=S(n,b),b.X=S(r,b),b.c=S(t,b),x.x=S(n,x),x.X=S(r,x),x.c=S(t,x),{format:function(e){var t=S(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=S(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+="",!0);return t.toString=function(){return e},t}}}var TX={"-":"",_:" ",0:"0"},LX=/^\s*\d+/,qX=/^%/,NX=/[\\^$*+?|[\]().{}]/g;function jX(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 zX(e){return e.replace(NX,"\\$&")}function FX(e){return new RegExp("^(?:"+e.map(zX).join("|")+")","i")}function WX(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function $X(e,t,n){var r=LX.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function BX(e,t,n){var r=LX.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function HX(e,t,n){var r=LX.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function VX(e,t,n){var r=LX.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function GX(e,t,n){var r=LX.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function UX(e,t,n){var r=LX.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function YX(e,t,n){var r=LX.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function KX(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 XX(e,t,n){var r=LX.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function JX(e,t,n){var r=LX.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function ZX(e,t,n){var r=LX.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function QX(e,t,n){var r=LX.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function eJ(e,t,n){var r=LX.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function tJ(e,t,n){var r=LX.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function nJ(e,t,n){var r=LX.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function rJ(e,t,n){var r=LX.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function iJ(e,t,n){var r=LX.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function oJ(e,t,n){var r=qX.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function aJ(e,t,n){var r=LX.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function sJ(e,t,n){var r=LX.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function lJ(e,t){return jX(e.getDate(),t,2)}function cJ(e,t){return jX(e.getHours(),t,2)}function uJ(e,t){return jX(e.getHours()%12||12,t,2)}function dJ(e,t){return jX(1+KK.count(fX(e),e),t,3)}function hJ(e,t){return jX(e.getMilliseconds(),t,3)}function pJ(e,t){return hJ(e,t)+"000"}function fJ(e,t){return jX(e.getMonth()+1,t,2)}function mJ(e,t){return jX(e.getMinutes(),t,2)}function gJ(e,t){return jX(e.getSeconds(),t,2)}function yJ(e){var t=e.getDay();return 0===t?7:t}function vJ(e,t){return jX(QK.count(fX(e)-1,e),t,2)}function bJ(e){var t=e.getDay();return t>=4||0===t?rX(e):rX.ceil(e)}function xJ(e,t){return e=bJ(e),jX(rX.count(fX(e),e)+(4===fX(e).getDay()),t,2)}function wJ(e){return e.getDay()}function SJ(e,t){return jX(eX.count(fX(e)-1,e),t,2)}function CJ(e,t){return jX(e.getFullYear()%100,t,2)}function MJ(e,t){return jX((e=bJ(e)).getFullYear()%100,t,2)}function kJ(e,t){return jX(e.getFullYear()%1e4,t,4)}function EJ(e,t){var n=e.getDay();return jX((e=n>=4||0===n?rX(e):rX.ceil(e)).getFullYear()%1e4,t,4)}function _J(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+jX(t/60|0,"0",2)+jX(t%60,"0",2)}function RJ(e,t){return jX(e.getUTCDate(),t,2)}function IJ(e,t){return jX(e.getUTCHours(),t,2)}function DJ(e,t){return jX(e.getUTCHours()%12||12,t,2)}function AJ(e,t){return jX(1+XK.count(mX(e),e),t,3)}function PJ(e,t){return jX(e.getUTCMilliseconds(),t,3)}function OJ(e,t){return PJ(e,t)+"000"}function TJ(e,t){return jX(e.getUTCMonth()+1,t,2)}function LJ(e,t){return jX(e.getUTCMinutes(),t,2)}function qJ(e,t){return jX(e.getUTCSeconds(),t,2)}function NJ(e){var t=e.getUTCDay();return 0===t?7:t}function jJ(e,t){return jX(sX.count(mX(e)-1,e),t,2)}function zJ(e){var t=e.getUTCDay();return t>=4||0===t?dX(e):dX.ceil(e)}function FJ(e,t){return e=zJ(e),jX(dX.count(mX(e),e)+(4===mX(e).getUTCDay()),t,2)}function WJ(e){return e.getUTCDay()}function $J(e,t){return jX(lX.count(mX(e)-1,e),t,2)}function BJ(e,t){return jX(e.getUTCFullYear()%100,t,2)}function HJ(e,t){return jX((e=zJ(e)).getUTCFullYear()%100,t,2)}function VJ(e,t){return jX(e.getUTCFullYear()%1e4,t,4)}function GJ(e,t){var n=e.getUTCDay();return jX((e=n>=4||0===n?dX(e):dX.ceil(e)).getUTCFullYear()%1e4,t,4)}function UJ(){return"+0000"}function YJ(){return"%"}function KJ(e){return+e}function XJ(e){return Math.floor(+e/1e3)}const JJ=_K();JJ("d3-number",(function(e,t,n){let 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=$K(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})),JJ("d3-time",(function(e){let t=OX({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=OX(...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}));const ZJ={id:e=>"".concat(e.source,"/").concat(e.key||e.title),key:e=>String(e.key||e.title),tags:e=>e.tags,min:e=>e.min,max:e=>e.max,type:e=>e.type,title:e=>String(e.title),values:e=>e.values,value:e=>e,label:e=>e,formatter:e=>(e=>{if("function"==typeof e.formatter)return e.formatter();const t=e.formatter||{};return JJ(t.type||"d3-number")(t.format||"")})(e)};function QJ(e){let{id:t=ZJ.id,key:n=ZJ.key,min:r=ZJ.min,max:i=ZJ.max,type:o=ZJ.type,tags:a=ZJ.tags,title:s=ZJ.title,values:l=ZJ.values,value:c=ZJ.value,label:u=ZJ.label,formatter:d=ZJ.formatter}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{id:()=>t(e),key:()=>n(e),raw:()=>e,tags:()=>a(e),type:()=>o(e),min:()=>r(e),max:()=>i(e),title:()=>s(e),items:()=>l(e),formatter:()=>d(e),value:c,label:u}}const eZ=e=>e.filter((e=>"number"==typeof e&&!isNaN(e))),tZ=e=>e.reduce(((e,t)=>e+t),0),nZ={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=eZ(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=eZ(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=eZ(e);return t.length?t.reduce(((e,t)=>e+t),0):NaN},avg:e=>{const t=eZ(e),n=t.length;return n?tZ(t)/n:NaN}};function rZ(e,t,n,r){const i={},o=r.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach((a=>{const s=n[a],l=i[a]={};-1!==["number","string","boolean"].indexOf(typeof s)?(l.type="primitive",l.value=s):"function"==typeof s?(l.type="function",l.value=s,l.label=s,l.field=o):"object"==typeof s&&(s.fields?l.fields=s.fields.map((n=>rZ(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=nZ[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?nZ[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=nZ[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?nZ[l.field.reduceLabel]:l.field.reduceLabel))})),i}function iZ(e,t){const{main:n}=rZ(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{});return{props:rZ(e,t,e.props||{},n),main:n}}function oZ(e,t,n,r){const i=Array(e.length),o=Array(e.length);let a;for(let t=0;t<e.length;t++)a=r?e[t][r]:e[t],i[t]=a.value,o[t]=a.label;const s=t.reduce,l=t.reduceLabel,c=s?s(i):i,u={value:c,label:l?l(o,c):n?n(c):String(c)};return r&&e[0][r].source?(u.source=e[0][r].source,u):!r&&e[0].source?(u.source=e[0].source,u):u}function aZ(e,t){let{main:n,propsArr:r,props:i}=t,o=[];const a=n.field.formatter(),s={};return r.forEach((e=>{s[e]=i[e].field?i[e].field.formatter():e=>e})),o.push(...e.map((e=>{const t=oZ(e.items,n,a);return r.forEach((n=>{t[n]=oZ(e.items,i[n],s[n],n)})),t}))),o}function sZ(e){let{cfg:t,itemData:n,obj:r,target:i,tracker:o,trackType:a}=e;const s="function"===a?t.trackBy(n):n[t.trackBy];let l=o[s];l||(l=o[s]={items:[],id:s},i.push(l)),l.items.push(r)}function lZ(e){if(e.length<1e4)return Math.max(...e);let t=-1/0;const n=e.length;for(let r=0;r<n;r++)t<e[r]&&(t=e[r]);return t}function cZ(e){if(e.length<1e4)return Math.min(...e);let t=1/0;const n=e.length;for(let r=0;r<n;r++)t>e[r]&&(t=e[r]);return t}const uZ={diverging:function(e,t){if((s=e.length)>0)for(var n,r,i,o,a,s,l=0,c=e[t[0]].length;l<c;++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:SK,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}SK(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}SK(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,c=0;s<i;++s){for(var u=e[t[s]],d=u[a][1]||0,h=(d-(u[a-1][1]||0))/2,p=0;p<s;++p){var f=e[t[p]];h+=(f[a][1]||0)-(f[a-1][1]||0)}l+=d,c+=h*d}n[a-1][1]+=n[a-1][0]=o,l&&(o-=c/l)}n[a-1][1]+=n[a-1][0]=o,SK(e,t)}}},dZ={ascending:function(e){var t=e.map(EK);return CK(e).sort((function(e,n){return t[e]-t[n]}))},insideout:function(e){var t,n,r=e.length,i=e.map(EK),o=function(e){var t=e.map(kK);return CK(e).sort((function(e,n){return t[e]-t[n]}))}(e),a=0,s=0,l=[],c=[];for(t=0;t<r;++t)n=o[t],a<s?(a+=i[n],l.push(n)):(s+=i[n],c.push(n));return c.reverse().concat(l)},none:CK,reverse:function(e){return CK(e).reverse()}};function hZ(e,t,n,r){const i=r||e.items,o={},a=t.stackKey,s=t.value,l=t.startProp||"start",c=t.endProp||"end",u=t.offset||"none",d=t.order||"none",h=t.valueRef||"";let p=0,f={};for(let e=0;e<i.length;e++){let t=i[e],n=h?t[h]:null;if(n&&n.source){let e="".concat(n.source.key||"","/").concat(n.source.field);f[e]||(f[e]=n.source)}let r=a(t);o[r]=o[r]||{items:[]},o[r].items.push(t),p=Math.max(p,o[r].items.length)}const m=Array.apply(null,{length:p}).map(Number.call,Number),g=Object.keys(o).map((e=>o[e].items)),y=function(){var e=AY([]),t=CK,n=SK,r=MK;function i(i){var o,a,s=e.apply(this,arguments),l=i.length,c=s.length,u=new Array(c);for(o=0;o<c;++o){for(var d,h=s[o],p=u[o]=new Array(l),f=0;f<l;++f)p[f]=d=[0,+r(i[f],h,f,i)],d.data=i[f];p.key=h}for(o=0,a=t(u);o<c;++o)u[a[o]].index=o;return n(u,a),u}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:AY(iK.call(t)),i):e},i.value=function(e){return arguments.length?(r="function"==typeof e?e:AY(+e),i):r},i.order=function(e){return arguments.length?(t=null==e?CK:"function"==typeof e?e:AY(iK.call(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?SK:e,i):n},i}().keys(m).value(((e,t)=>e[t]?s(e[t]):0)).order(dZ[d]).offset(uZ[u]);let v=y(g),b=[];for(let e=0;e<v.length;e++){let t=v[e];for(let e=0;e<t.length;e++){let n=t[e],r=t[e].data[t.key];r&&(r[l]={value:n[0]},r[c]={value:n[1]},b.push(n[0],n[1]))}}let x=Object.keys(f).map((e=>{let t=n(f[e].key);return t?t.field(f[e].field):null})).filter((e=>!!e));const w=QJ({title:x.map((e=>e.title())).join(", "),min:cZ(b),max:lZ(b),type:"measure",formatter:x[0]?x[0].formatter:void 0});e.fields.push(w)}function pZ(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};const r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).logger;if(Array.isArray(e))n.items=e.map((e=>({value:e,label:String(e)})));else if(e){if("collection"in e)n=fY({},t.collection(e.collection));else{const i=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),a=e.label||(e=>e);if(e.groupBy||e.mapTo)r.warn('Deprecated "data" configuration',e),n.items=[];else if(e.hierarchy)n.root=i.hierarchy?i.hierarchy(e.hierarchy):null,n.fields=i.fields();else if(e.items)n.items=e.skipNormalize?e.items:e.items.map((e=>({value:o(e),label:String(a(e))})));else if(e.extract){const r=Array.isArray(e.extract)?e.extract:[e.extract];n.items=[];const o=[];r.forEach((e=>{const r=e.source?t.dataset(e.source):i;r&&(n.items=[...n.items,...r.extract(e)],void 0!==e.field&&o.push(r.field(e.field)))})),o.length&&(n.fields=o),e.amend&&Array.isArray(e.amend)&&(n.items=[...n.items,...e.amend])}else if(void 0!==e.field&&i){const t=i.field(e.field);t&&(n.fields||(n.fields=[]),n.fields.push(t),"value"in e||(o=t.value||(e=>e),a=t.label||(e=>e),n.value=o),n.items=t.items().map((t=>({value:o(t),label:String(a(t)),source:{field:e.field}}))))}else e.fields&&e.fields.forEach((e=>{const r="object"==typeof e&&e.source?t.dataset(e.source):i;if(!r)return;let o;o="object"==typeof e&&void 0!==e.field?r.field(e.field):r.field(e),o&&(n.fields||(n.fields=[]),n.fields.push(o))}));n.items&&e.map&&(n.items=n.items.map(e.map))}e&&e.stack&&(Array.isArray(e.stack.stackByKey)?e.stack.stackByKey.forEach((r=>{const i=n.items.filter((e=>{var t;return(null===(t=e.key)||void 0===t?void 0:t.value)&&e.key.value===r}));hZ(n,e.stack,t.dataset,i)})):hZ(n,e.stack,t.dataset,n.items))}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&n.items&&(n.items=n.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&n.items&&(n.items=n.items.sort(e.sort)),n}function fZ(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:pZ;if(e.data){const r=i(e.data,t,n);if(r&&r.fields&&r.fields[0])return r.fields[0].formatter()}if(r=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(r)){return n.formatter.get(r)(e.format||"")}throw new Error("Formatter of type '".concat(r,"' was not found"))}function mZ(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const gZ=Symbol("implicit");function yZ(){var e=new SX,t=[],n=[],r=gZ;function i(i){let o=e.get(i);if(void 0===o){if(r!==gZ)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new SX;for(const r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return yZ(t,n).unknown(r)},mZ.apply(i,arguments),i}function vZ(){var e,t,n=yZ().unknown(void 0),r=n.domain,i=n.range,o=0,a=1,s=!1,l=0,c=0,u=.5;function d(){var n=r().length,d=a<o,h=d?a:o,p=d?o:a;e=(p-h)/Math.max(1,n-l+2*c),s&&(e=Math.floor(e)),h+=(p-h-e*(n-l))*u,t=e*(1-l),s&&(h=Math.round(h),t=Math.round(t));var f=function(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}(n).map((function(t){return h+e*t}));return i(d?f.reverse():f)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),d()):r()},n.range=function(e){return arguments.length?([o,a]=e,o=+o,a=+a,d()):[o,a]},n.rangeRound=function(e){return[o,a]=e,o=+o,a=+a,s=!0,d()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(s=!!e,d()):s},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),d()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),d()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,d()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},n.copy=function(){return vZ(r(),[o,a]).round(s).paddingInner(l).paddingOuter(c).align(u)},mZ.apply(d(),arguments)}function bZ(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function xZ(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function wZ(){}var SZ=.7,CZ=1/SZ,MZ="\\s*([+-]?\\d+)\\s*",kZ="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",EZ="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",_Z=/^#([0-9a-f]{3,8})$/,RZ=new RegExp(`^rgb\\(${MZ},${MZ},${MZ}\\)$`),IZ=new RegExp(`^rgb\\(${EZ},${EZ},${EZ}\\)$`),DZ=new RegExp(`^rgba\\(${MZ},${MZ},${MZ},${kZ}\\)$`),AZ=new RegExp(`^rgba\\(${EZ},${EZ},${EZ},${kZ}\\)$`),PZ=new RegExp(`^hsl\\(${kZ},${EZ},${EZ}\\)$`),OZ=new RegExp(`^hsla\\(${kZ},${EZ},${EZ},${kZ}\\)$`),TZ={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 LZ(){return this.rgb().formatHex()}function qZ(){return this.rgb().formatRgb()}function NZ(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=_Z.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?jZ(t):3===n?new WZ(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?zZ(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?zZ(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=RZ.exec(e))?new WZ(t[1],t[2],t[3],1):(t=IZ.exec(e))?new WZ(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=DZ.exec(e))?zZ(t[1],t[2],t[3],t[4]):(t=AZ.exec(e))?zZ(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=PZ.exec(e))?UZ(t[1],t[2]/100,t[3]/100,1):(t=OZ.exec(e))?UZ(t[1],t[2]/100,t[3]/100,t[4]):TZ.hasOwnProperty(e)?jZ(TZ[e]):"transparent"===e?new WZ(NaN,NaN,NaN,0):null}function jZ(e){return new WZ(e>>16&255,e>>8&255,255&e,1)}function zZ(e,t,n,r){return r<=0&&(e=t=n=NaN),new WZ(e,t,n,r)}function FZ(e,t,n,r){return 1===arguments.length?function(e){return e instanceof wZ||(e=NZ(e)),e?new WZ((e=e.rgb()).r,e.g,e.b,e.opacity):new WZ}(e):new WZ(e,t,n,null==r?1:r)}function WZ(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function $Z(){return`#${GZ(this.r)}${GZ(this.g)}${GZ(this.b)}`}function BZ(){const e=HZ(this.opacity);return`${1===e?"rgb(":"rgba("}${VZ(this.r)}, ${VZ(this.g)}, ${VZ(this.b)}${1===e?")":`, ${e})`}`}function HZ(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function VZ(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function GZ(e){return((e=VZ(e))<16?"0":"")+e.toString(16)}function UZ(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new KZ(e,t,n,r)}function YZ(e){if(e instanceof KZ)return new KZ(e.h,e.s,e.l,e.opacity);if(e instanceof wZ||(e=NZ(e)),!e)return new KZ;if(e instanceof KZ)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 KZ(a,s,l,e.opacity)}function KZ(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function XZ(e){return(e=(e||0)%360)<0?e+360:e}function JZ(e){return Math.max(0,Math.min(1,e||0))}function ZZ(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}bZ(wZ,NZ,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:LZ,formatHex:LZ,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return YZ(this).formatHsl()},formatRgb:qZ,toString:qZ}),bZ(WZ,FZ,xZ(wZ,{brighter(e){return e=null==e?CZ:Math.pow(CZ,e),new WZ(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?SZ:Math.pow(SZ,e),new WZ(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new WZ(VZ(this.r),VZ(this.g),VZ(this.b),HZ(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:$Z,formatHex:$Z,formatHex8:function(){return`#${GZ(this.r)}${GZ(this.g)}${GZ(this.b)}${GZ(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:BZ,toString:BZ})),bZ(KZ,(function(e,t,n,r){return 1===arguments.length?YZ(e):new KZ(e,t,n,null==r?1:r)}),xZ(wZ,{brighter(e){return e=null==e?CZ:Math.pow(CZ,e),new KZ(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?SZ:Math.pow(SZ,e),new KZ(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new WZ(ZZ(e>=240?e-240:e+120,i,r),ZZ(e,i,r),ZZ(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new KZ(XZ(this.h),JZ(this.s),JZ(this.l),HZ(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=HZ(this.opacity);return`${1===e?"hsl(":"hsla("}${XZ(this.h)}, ${100*JZ(this.s)}%, ${100*JZ(this.l)}%${1===e?")":`, ${e})`}`}}));var QZ=e=>()=>e;function eQ(e){return 1==(e=+e)?tQ: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):QZ(isNaN(t)?n:t)}}function tQ(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):QZ(isNaN(e)?t:e)}var nQ=function e(t){var n=eQ(t);function r(e,t){var r=n((e=FZ(e)).r,(t=FZ(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=tQ(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 rQ(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 iQ(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]=dQ(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 oQ(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function aQ(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function sQ(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]=dQ(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var lQ=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,cQ=new RegExp(lQ.source,"g");function uQ(e,t){var n,r,i,o=lQ.lastIndex=cQ.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=lQ.exec(e))&&(r=cQ.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:aQ(n,r)})),o=cQ.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 dQ(e,t){var n,r=typeof t;return null==t||"boolean"===r?QZ(t):("number"===r?aQ:"string"===r?(n=NZ(t))?(t=n,nQ):uQ:t instanceof NZ?nQ:t instanceof Date?oQ:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?rQ:Array.isArray(t)?iQ:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?sQ:aQ)(e,t)}function hQ(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function pQ(e){return+e}var fQ=[0,1];function mQ(e){return e}function gQ(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function yQ(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=gQ(i,r),o=n(a,o)):(r=gQ(r,i),o=n(o,a)),function(e){return o(r(e))}}function vQ(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]=gQ(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=wX(e,t,1,r)-1;return o[n](i[n](t))}}function bQ(){var e,t,n,r,i,o,a=fQ,s=fQ,l=dQ,c=mQ;function u(){var e=Math.min(a.length,s.length);return c!==mQ&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),r=e>2?vQ:yQ,i=o=null,d}function d(t){return null==t||isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(c(t)))}return d.invert=function(n){return c(t((o||(o=r(s,a.map(e),aQ)))(n)))},d.domain=function(e){return arguments.length?(a=Array.from(e,pQ),u()):a.slice()},d.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},d.rangeRound=function(e){return s=Array.from(e),l=hQ,u()},d.clamp=function(e){return arguments.length?(c=!!e||mQ,u()):c!==mQ},d.interpolate=function(e){return arguments.length?(l=e,u()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}function xQ(e,t,n,r){var i,o=function(e,t,n){n=+n;const r=(t=+t)<(e=+e),i=r?IX(t,e,n):IX(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}(e,t,n);switch((r=PK(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(IK(t)/3)))-IK(Math.abs(e)))}(o,a))||(r.precision=i),zK(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,IK(t)-IK(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,-IK(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return jK(r)}function wQ(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)==(t=+t))return[e];const r=t<e,[i,o,a]=r?RX(t,e,n):RX(e,t,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let e=0;e<s;++e)l[e]=(o-e)/-a;else for(let e=0;e<s;++e)l[e]=(o-e)*a;else if(a<0)for(let e=0;e<s;++e)l[e]=(i+e)/-a;else for(let e=0;e<s;++e)l[e]=(i+e)*a;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return xQ(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),a=0,s=o.length-1,l=o[a],c=o[s],u=10;for(c<l&&(i=l,l=c,c=i,i=a,a=s,s=i);u-- >0;){if((i=IX(l,c,n))===r)return o[a]=l,o[s]=c,t(o);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}r=i}return e},e}function SQ(){var e=bQ()(mQ,mQ);return e.copy=function(){return function(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}(e,SQ())},mZ.apply(e,arguments),wQ(e)}function CQ(){var e,t=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[wX(t,i,0,r)]:e}return i.domain=function(e){return arguments.length?(t=Array.from(e),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(e){return arguments.length?(n=Array.from(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 CQ().domain(t).range(n).unknown(e)},mZ.apply(i,arguments)}function MQ(e){return void 0===e?e=>e:t=>e(t)}function kQ(e){return Math.max(0,Math.min(1,e))}function EQ(e){return"object"==typeof e}function _Q(e,t,n){const r=Math.abs(t-n)/(e+1),i=[];for(let o=1;o<=e;o++){const e=o*r;i.push(t<n?t+e:t-e)}return i}function RQ(e,t,n){if(1===e.length)return e;const r=e.concat([]);for(let i=0;i<e.length;i++){let o=e[i],a=e[i+1];0===i&&o!==n.start()?(r.push(..._Q(t,o,a)),o-=a-o,a=e[i],r.push(..._Q(t,o,a))):i===e.length-1&&a!==n.end()?(a=o+(o-e[i-1]),r.push(..._Q(t,o,a))):r.push(..._Q(t,o,a))}return r.filter((e=>e>=n.min()&&e<=n.max()))}function IQ(e){let{distance:t,scale:n,minorCount:r=0,unitDivider:i=100,formatter:o}=e;const a=yY(i)||yY(t)?2:Math.max(t/i,2),s=Math.min(1e3,Math.round(a));let l=n.ticks(s);l.length<=1&&(l=n.ticks(s+1));const c=r>0?RQ(l,r,n):l;c.sort(((e,t)=>e-t));const u=c.map(MQ(o));return c.map(((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:u[t],value:e,isMinor:-1===l.indexOf(e)}}))}function DQ(e){let{distance:t,scale:n,minorCount:r=0,unitDivider:i=100,formatter:o}=e;const a=yY(i)||yY(t)?2:Math.max(t/i,2),s=Math.min(1e3,Math.round(a)),l=s>10?10:s;n.nice(l);const c=n.ticks(s),u=r>0?RQ(c,r,n):c;u.sort(((e,t)=>e-t));const d=u.map(MQ(o));return u.map(((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:d[t],value:e,isMinor:-1===c.indexOf(e)}}))}function AQ(e){let t,{settings:n,scale:r,distance:i,formatter:o=e=>e}=e;const a=n.minorTicks&&!yY(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const e=n.ticks.values.filter((e=>"object"==typeof e?!yY(e.value):!yY(e)));t=function(e){let{values:t,scale:n,formatter:r=e=>e}=e;return t.sort(((e,t)=>(EQ(e)?e.value:e)-(EQ(t)?t.value:t))).filter(((e,t,r)=>{const i=EQ(e)?e.value:e;return i<=n.max()&&i>=n.min()&&r.indexOf(e)===t})).map((e=>{const t=EQ(e),i=t?e.value:e,o=n(i);return{position:o,value:i,label:t&&void 0!==e.label?e.label:r(i),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?kQ(n(e.start)):o,end:t&&!isNaN(e.end)?kQ(n(e.end)):o}}))}({values:e,scale:r.copy(),formatter:o})}else if(yY(n.ticks.count)){t=(n.ticks.tight?DQ:IQ)({distance:i,minorCount:a,unitDivider:n.ticks.distance,scale:r,formatter:o}),n.ticks.forceBounds&&function(e,t,n){const r=e.map((e=>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);const 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,o)}else{t=function(e){let{count:t,minorCount:n,scale:r,formatter:i}=e;return r.ticks((t-1)*n+t).map(((e,t)=>{const 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:a,scale:r.copy(),formatter:o})}return t}function PQ(){let 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]:{};const r={};return Object.keys(t).forEach((i=>{const o=typeof e[i];r[i]="function"===o?e[i](n):"undefined"===o?t[i]:e[i]})),r}const OQ={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},TQ={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},LQ={count:NaN};function qQ(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 NQ(){let 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]:{};const r=SQ(),i={instance:null,invert:!1},o={data:t,resources:n},a=PQ(e,OQ,o);let s;function l(e){return yY(e)?NaN:r(e)}a.ticks=PQ(e.ticks,TQ,o),a.minorTicks=PQ(e.minorTicks,LQ,o),l.data=()=>t,l.invert=function(e){return r.invert(e)},l.rangeRound=function(e){return r.rangeRound(e),l},l.clamp=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return r.clamp(e),l},l.cachedTicks=function(){return s},l.clearTicksCache=function(){return s=void 0,this},l.ticks=function(e){return null!==e&&"object"==typeof e?(e.settings=e.settings||{},e.settings=uY(!0,{},a,e.settings),e.scale=l,s=AQ(e),s):(s=r.ticks(e),s)},l.nice=function(e){return r.nice(e),l},l.tickFormat=function(e,t){return r.tickFormat(e,t)},l.interpolate=function(e){return r.interpolate(e),l},l.domain=function(e){return arguments.length?(r.domain(e),i.instance&&i.instance.domain([l.start(),l.end()]),l):r.domain()},l.range=function(e){return arguments.length?(r.range(e),l):r.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){let t=(l.start()-l.end())/e,n=[l.end()],r=[],i=t/2;for(let o=0;o<e;o++){let e=n[n.length-1]||0,o=e+t,a=l(e+i);n.push(o,o),r.push(a,a)}return n.pop(),l.domain(n),l.range(r),l},l.copy=function(){const i=NQ(e,t,n);return i.domain(l.domain()),i.range(l.range()),i.clamp(r.clamp()),i},l.norm=function(e){return qQ(i,l),i.instance(e)},l.normInvert=function(e){return qQ(i,l),i.instance.invert(e)};const{mini:c,maxi:u}=function(e,t){const n=+e.min,r=+e.max;let i=0,o=1;if(t&&t[0]){const n=t.map((e=>e.min())).filter((e=>!isNaN(e))),r=t.map((e=>e.max())).filter((e=>!isNaN(e)));if(i=n.length?Math.min(...n):Number.NaN,o=r.length?Math.max(...r):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)){const t=o-i;i-=t*e.expand,o+=t*e.expand}if(Array.isArray(e.include)){const t=e.include.filter((e=>!isNaN(e)));i=Math.min(...t,i),o=Math.max(...t,o)}}return{mini:isNaN(n)?i:n,maxi:isNaN(r)?o:r}}(a,t?t.fields:[]);return l.domain([c,u]),l.range(a.invert?[1,0]:[0,1]),i.invert=a.invert,l}const jQ={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function zQ(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={data:t,resources:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}},r=PQ(e,jQ,n),i=t.items||[],o={},a=[],s=[];function l(e,n){e.data=()=>t,e.datum=e=>i[o[e]],e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=()=>s,e.ticks=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,function(e){let{scale:t}=e;const n=t.domain(),r=t.data().items,i=t.labels?t.labels():n,o=t.bandwidth();return n.map(((e,n)=>{const a=t(e);return{position:a+o/2,label:"".concat(i[n]),data:r?r[n]:void 0,start:a,end:a+o}}))}(t,n.trackBy)}}const c=vZ();l(c,e),c.pxScale=function(t){const n=r.maxPxStep;if(isNaN(n))return c;const i=c.domain().length,o=Math.max(1,i-c.paddingInner()+2*c.paddingOuter());if(o*n>=t)return c;const a=c.copy();a.type=c.type,l(a,e);const s=o*n/t,u=(1-s)*c.align();return a.range(r.invert?[s+u,u]:[u,s+u]),a};const u="function"==typeof e.value?e.value:e=>e.datum.value,d="function"==typeof e.label?e.label:e=>e.datum.label;for(let e=0;e<i.length;e++){const t=uY({datum:i[e]},n),r=u(t,e);-1===a.indexOf(r)&&(a.push(r),s.push(d(t,e)),o[r]=e)}return c.domain(a),c.range(r.invert?r.range.slice().reverse():r.range),c.padding(isNaN(r.padding)?0:r.padding),isNaN(r.paddingInner)||c.paddingInner(r.paddingInner),isNaN(r.paddingOuter)||c.paddingOuter(r.paddingOuter),c.align(isNaN(r.align)?.5:r.align),c}const FQ={depth:0};function WQ(e,t,n){return e.ancestors().map((e=>t(uY({datum:e.data},n)))).reverse().slice(1).toString()}const $Q=e=>e.min(),BQ=e=>e.max();function HQ(e,t){const n=e&&!isNaN(e.min),r=e&&!isNaN(e.max);let i=n?+e.min:0,o=r?+e.max:1;if(t&&t.length){if(!n){const e=t.map($Q).filter(gY);i=e.length?Math.min(...e):i}if(!r){const e=t.map(BQ).filter(gY);o=e.length?Math.max(...e):o}}return[i,o]}const VQ={domain:[],range:[],invert:!1,min:NaN,max:NaN};function GQ(){let 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]:{};const r=NQ(e,t,n).clamp(!0).interpolate(nQ),i=PQ(e,VQ,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length,s=r;uY(!0,s,r);const[l,c]=HQ(i,t?t.fields:[]),u=o?i.domain.length:-1,d=n.theme?n.theme.palette("sequential",u>0?u:2):[],h=a?i.range:d;return s.range(i.invert?h.slice().reverse():h.slice()),s.domain(o?i.domain:function(e,t,n){const r=e.length;if(2===r)return[t,n];const i=[],o=(n-t)/(r-1);i.push(t);for(let e=1;e<r-1;e++)i.push(t+o*e);return i.push(n),i}(s.range(),l,c)),s}const UQ={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function YQ(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}const KQ={domain:[],range:[]};const XQ={domain:[],range:[],unknown:void 0},JQ={domain:[],range:[],override:!1};const ZQ=_K();function QQ(e,t,n){let r=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),r={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach((e=>{r.extract.push({field:e})})));const i=pZ(r,t,n);let o,a=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?function(e){const t=e.map((e=>"dimension"===e.type()?"band":"linear"));return-1!==t.indexOf("linear")?"linear":"band"}(e.fields):"linear"}(i);return"color"===a&&(a=i.fields&&i.fields[0]&&"dimension"===i.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(a)&&(o=n.scale.get(a),o=o(e,i,{theme:n.theme,logger:n.logger}),o.type=a),o}ZQ("linear",NQ),ZQ("band",zQ),ZQ("h-band",(function e(){let 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]:{};const i={data:n,resources:r},o=PQ(t,jQ,i);o.ticks=PQ(t.ticks,FQ,i),o.value="function"==typeof t.value?t.value:e=>e.datum.value,o.label="function"==typeof t.label?t.label:e=>e.datum.value;let a=zQ(o);const{values:s,labels:l,items:c,ticks:u}=function(e,t,n){const r=t.ticks.depth,i=t.value,o=t.label,a=[],s=[],l={},c=[];let u=0;if(!e)return{values:a,labels:s,items:l,ticks:c};e.eachAfter((e=>{if(e.depth>0){const t=WQ(e,i,n),d=e.leaves()||[e],h=i(uY({datum:e.data},n)),p=o(uY({datum:e.data},n)),f=Array.isArray(e.children),m={key:t,count:d.length,value:h,label:p,leftEdge:WQ(d[0],i,n),rightEdge:WQ(d[Math.max(d.length-1,0)],i,n),node:e};f?(a.push("SPACER_".concat(u,"_SPACER")),u++):(a.push(t),s.push(p)),(r<=0&&!f||e.depth===r)&&c.push(m),l[t]=m}}));const d=e.height-1;return d>0&&a.splice(-d),{values:a,labels:s,items:l,ticks:c}}(n.root,o,i),d=function(e){const t=String(e),n=c[t];return a(n?o.invert?n.rightEdge:n.leftEdge:t)};uY(!0,d,a),d.bandwidth=function(e){const t=c[String(e)],n=a.bandwidth();if(t&&!t.isLeaf){const e=d(t.leftEdge),r=d(t.rightEdge);return Math.abs(e-r)+n}return n},d.step=function(e){const t=c[String(e)],n=t?t.count:1;let r=a.step();return r*=n,r},d.data=()=>n,d.datum=e=>{const t=c[String(e)];return t?t.node.data:null},d.copy=()=>e(t,n,r),d.labels=()=>l,d.ticks=()=>u.map((e=>{const t=d(e.key),n=d.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}}));const h=a.pxScale;return d.pxScale=function(e){return a=h(e),d},d.domain(s),d})),ZQ("sequential-color",GQ),ZQ("threshold-color",(function(){let 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]:{};const r=CQ(),i=PQ(e,UQ,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length;function s(e){return yY(e)?NaN:r(e)}Object.keys(r).forEach((e=>s[e]=r[e]));const l=t.fields,[c,u]=HQ(i,l),d=o?i.domain.length:-1,h=n.theme?n.theme.palette("sequential",d>0?d:2):[];let p=a?i.range:h,f=[];return f=o?i.domain:i.nice?function(e,t,n){const r=2===e.length?10:Math.max(1,e.length),i=SQ().domain([t,n]).nice(r).ticks(r);if(!e||!e.length)return i;const o=Math.max(0,e.length-1);for(;i.length>o;)i[0]-t<=n-i[i.length-1]?i.shift():i.pop();return i}(p,c,u):[c+(u-c)/2],p.length>f.length+1?f=function(e,t,n){const r=e.length;if(2===r)return[t+(n-t)/2];const i=[],o=(n-t)/r;for(let e=1;e<r;e++)i.push(t+o*e);return i}(p,c,u):p.length<f.length+1&&(p=function(e,t,n,r){n=e[0],r=e&&e.length>=2?e[e.length-1]:r;const i=GQ().domain([n,r]).range(t);return[n,...YQ(e),r].map((e=>i(e)))}(f,p,c,u)),s.data=()=>t,s.range(i.invert?p.slice().reverse():p),s.domain(f),s})),ZQ("categorical-color",(function(){let 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]:{};const r=function(){let 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]:{};const r=yZ(),i={data:t,resources:n},o=PQ(e,KQ,i),a="function"==typeof e.value?e.value:e=>e.datum.value,s="function"==typeof e.label?e.label:e=>e.datum.label,l=t.items||[],c={},u=[],d=[];for(let e=0;e<l.length;e++){const t=uY({datum:l[e]},i),n=a(t,e);-1===u.indexOf(n)&&(u.push(n),d.push(s(t,e)),c[n]=e)}return r.data=()=>t,r.labels=()=>d,r.label=e=>d[u.indexOf(e)],r.datum=e=>l[c[e]],r.range(o.range),Array.isArray(o.domain)&&o.domain.length?r.domain(o.domain):r.domain(u),r}(e,t,n),i=n.theme,o=PQ(e,XQ,{data:t,resources:n});let a;if(o.explicit=PQ(e.explicit,JQ,{data:t,resources:n}),a=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():i?i.palette("categorical",r.domain().length).slice():[],o.unknown)r.unknown(o.unknown);else if(i&&i.palette("unknown")){let e=i.palette("unknown");r.unknown(e[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const e=r.domain().slice(),t=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],i=Math.floor(e.length/a.length);for(let e=1;e<i+1;e*=2)a=a.concat(a);if(o.explicit.override)for(let r=0;r<t.length;r++){const i=e.indexOf(t[r]);i>-1&&(a[i]=n[r])}else{const r=t.map(((t,r)=>[e.indexOf(t),t,n[r]])).sort(((e,t)=>e[0]-t[0]));r.forEach((t=>{const n=e.indexOf(t[1]);-1!==n&&a.splice(n,0,t[2])}))}a.length=e.length}return r.range(a),r}));var e0={};function t0(){t0.init.call(this)}e0.isObject=function(e){return"object"==typeof e&&null!==e},e0.isNumber=function(e){return"number"==typeof e},e0.isUndefined=function(e){return void 0===e},e0.isFunction=function(e){return"function"==typeof e};var n0=t0;t0.EventEmitter=t0,t0.prototype._events=void 0,t0.prototype._maxListeners=void 0,t0.defaultMaxListeners=10,t0.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},t0.prototype.setMaxListeners=function(e){if(!e0.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},t0.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],e0.isUndefined(n))return!1;if(e0.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(e0.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},t0.prototype.addListener=function(e,t){var n;if(!e0.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,e0.isFunction(t.listener)?t.listener:t),this._events[e]?e0.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,e0.isObject(this._events[e])&&!this._events[e].warned)&&((n=e0.isUndefined(this._maxListeners)?t0.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,e0.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),e0.isFunction(console.trace)&&console.trace()));return this},t0.prototype.on=t0.prototype.addListener,t0.prototype.once=function(e,t){if(!e0.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},t0.prototype.removeListener=function(e,t){var n,r,i,o;if(!e0.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||e0.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(e0.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},t0.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],e0.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},t0.prototype.listeners=function(e){return this._events&&this._events[e]?e0.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},t0.listenerCount=function(e,t){return e._events&&e._events[t]?e0.isFunction(e._events[t])?1:e._events[t].length:0};var r0={mixin:e=>(Object.keys(n0.prototype).forEach((t=>{e[t]=n0.prototype[t]})),n0.init(e),e)};function i0(){let e=0,t=0,n=0,r=0;n=n||e;const i={move(e){this.moveTo(n+e)},moveTo(o){const a=Math.max(e,Math.min(t-r,o));n!==a&&(n=a,i.emit("update"))},update(o){let a=!1;({min:e=e,max:t=t}=o),void 0!==o.viewSize&&o.viewSize!==r&&(r=o.viewSize,a=!0);const s=Math.max(e,Math.min(t-r,n));n!==s&&(n=s,a=!0),a&&i.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:r})};return r0.mixin(i),i}function o0(e,t){const n=e.min||0,r=e.max||0,i=e.viewSize||0,o=t||i0();return o.update({min:n,max:r,viewSize:i}),o}function a0(e,t){return e<=t}function s0(e,t){return e<t}function l0(e,t,n){let r=0;for(;r<e.length&&t>e[r];)++r;return e[r]===t&&n&&++r,r}function c0(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=[];function i(){}return i.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{includeMax:r=!0,includeMin:i=!0}=n;e=r?a0:s0,t=i?a0:s0},i.add=e=>{let{min:t,max:n}=e;const i=l0(r,t),o=l0(r,n,!0),a=[i,o-i];i%2==0&&a.push(t),o%2==0&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.remove=e=>{let{min:t,max:n}=e;const i=l0(r,t),o=l0(r,n,!0),a=[i,o-i];i%2==1&&a.push(t),o%2==1&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.set=e=>{const t=r.join(",");r=[],Array.isArray(e)?e.forEach(i.add):i.add(e);return t!==r.join(",")},i.clear=()=>{const e=r.length>0;return r=[],e},i.containsValue=n=>function(e,t,n,r){const i=e.length;for(let o=1;o<i;o+=2)if(n(e[o-1],t)&&r(t,e[o]))return!0;return!1}(r,n,t,e),i.containsRange=e=>{let{min:t,max:n}=e;const i=l0(r,t,!0),o=l0(r,n);return i===o&&o%2==1},i.toggle=e=>i.containsRange(e)?i.remove(e):i.add(e),i.ranges=()=>{const e=[];for(let t=1;t<r.length;t+=2)e.push({min:r[t-1],max:r[t]});return e},i.configure(n),i}function u0(){let e=[];function t(){}return t.add=t=>-1===e.indexOf(t)&&(e.push(t),!0),t.remove=t=>{const n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=t=>-1!==e.indexOf(t),t.values=()=>e.slice(),t.clear=()=>e=[],t.toString=()=>e.join(";"),t}const d0={key:void 0,includeMin:!0,includeMax:!0};function h0(e){let{items:t,collection:n,vc:r}=e;const i={},o=[];let a,s;for(let e=0,o=t.length;e<o;e++){a=t[e].key,n[a]||(n[a]=r()),s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[a].add(s[e])&&(i[a]=i[a]||[],i[a].push(s[e]))}const l=Object.keys(i);for(let e=0,t=l.length;e<t;e++)a=l[e],o.push({id:a,values:i[a]});return o}function p0(e){let{items:t,collection:n}=e;const r={},i=[];let o,a;for(let e=0,i=t.length;e<i;e++)if(o=t[e].key,n[o]){a=t[e].values||[t[e].value];for(let e=0;e<a.length;e++)n[o].remove(a[e])&&(r[o]=r[o]||[],r[o].push(a[e]))}const s=Object.keys(r);for(let e=0,t=s.length;e<t;e++)o=s[e],i.push({id:o,values:r[o]});return i}function f0(e){const t={};let n,r;for(let i=0,o=e.length;i<o;i++){n=e[i].key,r=e[i].values||[e[i].value],t[n]||(t[n]=[]);for(let e=0;e<r.length;e++){-1===t[n].indexOf(r[e])&&t[n].push(r[e])}}return t}function m0(e){let{key:t,collection:n,obj:r,fn:i,value:o}=e;n[t]||(n[t]=i()),r[t]=r[t]||[],r[t].push(o),n[t].add(o)}function g0(e,t){const n=[],r=Object.keys(e);let i,o;const a=e=>-1===t[i].indexOf(e);for(let s=0,l=r.length;s<l;s++)i=r[s],t[i]?(o=e[i].filter(a),o.length&&n.push({id:i,values:o})):n.push({id:i,values:e[i]});return n}function y0(e,t,n){const r=function(e,t){if(!Object.keys(t).length)return e;const n=e.length,r=Array(n);for(let i=0;i<n;i++)r[i]=e[i].key in t?uY({},e[i],{key:t[e[i].key]}):e[i];return r}(t,n);return e&&e.length?e.reduce(((e,t)=>t(e)),r):r}function v0(e){return e.replace(/(-[a-z])/g,(e=>e.toUpperCase().replace("-","")))}function b0(e){return e.replace(/([A-Z])/g,(e=>"-".concat(e.toLowerCase())))}function x0(e,t,n){let{ranges:r,interceptors:i,rc:o,aliases:a,rangeConfig:s}=n;const l=y0(i["".concat(t,"Ranges")],e,a);let c=!1;return l.forEach((e=>{const n=e.key;if(r[n]||(r[n]=o(s.sources[n]||s.default)),"set"===t)c=r[n][t](e.ranges||e.range)||c;else{const i=e.ranges||[e.range];for(let e=0;e<i.length;e++)c=r[n][t](i[e])||c}})),c}function w0(){let{vc:e=u0,rc:t=c0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=!1,r={},i={},o={},a={sources:{},default:uY({},d0)};const s={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},l=()=>{const e={values:{},ranges:{}};return Object.keys(i).forEach((t=>{e.values[t]=i[t].values()})),Object.keys(r).forEach((t=>{e.ranges[t]=r[t].ranges()})),e},c={ls:[],clear(){this.ls.forEach((e=>e.clear()))},start(){this.ls.forEach((e=>e.start()))},end(){this.ls.forEach((e=>e.end()))},update(){const e=l();this.ls.forEach((t=>t._state(e)))},updateValues(){const e=l();this.ls.forEach((t=>t._state({values:e.values})))},updateRanges(){const e=l();this.ls.forEach((t=>t._state({ranges:e.ranges})))}},u={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(a={sources:{},default:uY({},d0)},e.ranges.forEach((e=>{const t={};Object.keys(d0).filter((e=>"key"!==e)).forEach((n=>{t[n]=void 0!==e[n]?e[n]:d0[n]})),void 0!==e.key?a.sources[e.key]=t:a.default=t})),Object.keys(r).forEach((e=>r[e].configure(a.sources[e]||a.default))),u.emit("update",[],[]))},link:e=>{if(u===e)throw new Error("Can't link to self");c.ls.push(e),e._state(l())},_state:e=>{if(!e)return l();if(e.values){const t=[];Object.keys(e.values).forEach((n=>{i[n]&&e.values[n].join(";")===i[n].toString()||t.push({key:n,values:e.values[n]})})),Object.keys(i).forEach((n=>{e.values[n]||t.push({key:n,values:[]})})),t.length&&u.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach((n=>{r[n]&&e.ranges[n].join(";")===r[n].toString()||t.push({key:n,ranges:e.ranges[n]})})),Object.keys(r).forEach((n=>{e.ranges[n]||t.push({key:n,ranges:[]})})),t.length&&u.setRanges(t)}},start:function(){if(!n){n=!0;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];u.emit("start",...t),c.start()}},end:function(){if(n){n=!1,r={},i={};for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];u.emit("end",...t),c.end()}},isActive:()=>n,clear:()=>{const e=u.brushes().filter((e=>"value"===e.type&&e.brush.values().length)).map((e=>({id:e.id,values:e.brush.values()}))),t=Object.keys(r).length>0||e.length;r={},i={},t&&(u.emit("update",[],e),c.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(r).map((e=>({type:"range",id:e,brush:r[e]})))),e=e.concat(Object.keys(i).map((e=>({type:"value",id:e,brush:i[e]})))),e},addValue:(e,t)=>{u.addValues([{key:e,value:t}])},addValues:t=>{const r=y0(s.addValues,t,o),a=h0({vc:e,collection:i,items:r});u.emit("add-values",r),a.length&&(n||(n=!0,u.emit("start")),u.emit("update",a,[]),c.updateValues())}};return u.setValues=t=>{const r=y0(s.setValues,t,o),a=function(e){let{items:t,vCollection:n,vc:r}=e;const i={},o=f0(t);let a,s=[],l=[];const c={},u=Object.keys(n);for(let e=0,t=u.length;e<t;e++)a=u[e],c[a]=n[a].values().slice(),delete n[a];const d=e=>{n[a]&&n[a].contains(e)||m0({key:a,value:e,collection:n,obj:i,fn:r})},h=Object.keys(o);for(let e=0,t=h.length;e<t;e++)a=h[e],o[a].forEach(d);return l=g0(c,i),s=g0(i,c),[s,l]}({items:r,vCollection:i,vc:e});u.emit("set-values",r),(a[0].length>0||a[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",a[0],a[1]),c.updateValues())},u.removeValue=(e,t)=>{u.removeValues([{key:e,value:t}])},u.removeValues=e=>{const t=y0(s.removeValues,e,o),n=p0({collection:i,items:t});u.emit("remove-values",t),n.length&&(u.emit("update",[],n),c.updateValues())},u.addAndRemoveValues=(t,r)=>{const a=y0(s.addValues,t,o),l=y0(s.removeValues,r,o),d=h0({vc:e,collection:i,items:a}),h=p0({collection:i,items:l});u.emit("add-values",a),u.emit("remove-values",l),(d.length||h.length)&&(n||(n=!0,u.emit("start")),u.emit("update",d,h),c.updateValues())},u.toggleValue=(e,t)=>{u.toggleValues([{key:e,value:t}])},u.toggleValues=t=>{const r=y0(s.toggleValues,t,o),a=function(e){let{items:t,values:n,vc:r}=e;const i={},o={},a=[],s=[],l=f0(t);let c,u,d;const h=Object.keys(l);for(let e=0,t=h.length;e<t;e++){c=h[e],d=l[c];for(let e=0,t=d.length;e<t;e++)u=d[e],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):m0({key:c,value:u,collection:n,obj:i,fn:r})}const p=Object.keys(i);for(let e=0,t=p.length;e<t;e++)c=p[e],a.push({id:c,values:i[c]});const f=Object.keys(o);for(let e=0,t=f.length;e<t;e++)c=f[e],s.push({id:c,values:o[c]});return[a,s]}({items:r,values:i,vc:e});u.emit("toggle-values",r),(a[0].length>0||a[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",a[0],a[1]),c.updateValues())},u.containsValue=(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].contains(t)},u.addRange=(e,t)=>{u.addRanges([{key:e,range:t}])},u.addRanges=e=>{x0(e,"add",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.removeRange=(e,t)=>{u.removeRanges([{key:e,range:t}])},u.removeRanges=e=>{x0(e,"remove",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.setRange=(e,t)=>{u.setRanges([{key:e,range:t}])},u.setRanges=e=>{x0(e,"set",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.toggleRange=(e,t)=>{u.toggleRanges([{key:e,range:t}])},u.toggleRanges=e=>{x0(e,"toggle",{ranges:r,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.containsRangeValue=(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].containsValue(t)},u.containsRange=(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].containsRange(t)},u.containsMappedData=(e,t,n)=>{let a=[];const s=Object.keys(e);let l,c,u,d;for(let t=0,n=s.length;t<n;t++){if(l=s[t],"value"===l)c=e,a[t]={key:"",i:t,bool:!1};else{if("source"===l)continue;c=e[l],a[t]={key:l,i:t,bool:!1}}u=c.source&&c.source.field,void 0!==u&&(void 0!==c.source.key&&(u="".concat(c.source.key,"/").concat(u)),u in o&&(u=o[u]),d=c.value,r[u]?a[t].bool=Array.isArray(d)?r[u].containsRange({min:d[0],max:d[1]}):r[u].containsValue(d):i[u]&&i[u].contains(d)&&(a[t].bool=!0))}return t?(a=a.filter((e=>-1!==t.indexOf(e.key))),"and"===n?!!a.length&&!a.some((e=>!1===e.bool)):"xor"===n?!!a.length&&a.some((e=>e.bool))&&a.some((e=>!1===e.bool)):a.some((e=>e.bool))):a.some((e=>e.bool))},u.intercept=(e,t)=>{const n=v0(e);s[n]&&s[n].push(t)},u.removeInterceptor=(e,t)=>{const n=v0(e);if(!s[n])return;const r=s[n].indexOf(t);-1!==r&&s[n].splice(r,1)},u.removeAllInterceptors=e=>{const t=[];if(e){const n=v0(e);s[n]&&s[n].length&&t.push({name:e,handlers:s[n]})}else Object.keys(s).forEach((e=>{s[e].length&&t.push({name:b0(e),handlers:s[e]})}));t.forEach((e=>{e.handlers.slice().forEach((t=>u.removeInterceptor(e.name,t)))}))},u.addKeyAlias=(e,t)=>{o[e]=t},u.removeKeyAlias=e=>{delete o[e]},r0.mixin(u),u}function S0(e){return e*e*e}function C0(e){return--e*e*e+1}function M0(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}_K();const k0=["stroke","fill","color","backgroundColor","thumbColor"];function E0(e,t){const n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n);let a;for(a=0;a<r;++a)i[a]=_0(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(e){for(a=0;a<r;++a)o[a]=i[a](e);return o}}function _0(e,t,n){const r=typeof t;let i;return null==t||"boolean"===r?function(e){return()=>e}(t):("number"===r?aQ:"string"===r?(i=NZ(t))&&k0.includes(n)?(t=i,nQ):uQ:t instanceof NZ?nQ:t instanceof Date?oQ:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?rQ:Array.isArray(t)?E0:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?R0:aQ)(e,t)}function R0(e,t){const n={},r={};let i;for(i in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)i in e?n[i]=_0(e[i],t[i],i):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}function I0(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}const D0={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},A0=/^\$/;function P0(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function O0(e,t,n){const r=e[t];r&&r.scale&&r.scale.pxScale?r.scale=r.scale.pxScale(n):r&&r.pxScale&&(e[t]=r.pxScale(n))}function T0(e,t){return e.pxScale?e.pxScale(t):e}const L0={normalizeSettings:function(e,t,n){const r=uY({},e),i=uY({},t);return Object.keys(r).forEach((e=>{i[e]={};const o=r[e],a=typeof o;if("function"==typeof o)i[e].fn=o;else if(P0(o)){let n=t[e];"string"==typeof n&&A0.test(n)&&(n=D0[n]);const r=typeof n;i[e]="undefined"===r||r===a?o:n}else o&&"object"==typeof 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((e=>{if(e in r)return;const n=t[e];"string"===typeof n&&A0.test(n)?i[e]=D0[n]:i[e]=n})),i},resolveForItem:function(e,t,n){const r={},i=Object.keys(t),o=i.length,a=e.datum,s=e.datum;for(let l=0;l<o;l++){const o=i[l],c=t[o],u="object"==typeof s&&void 0!==c,d=u&&"string"==typeof c.ref,h=u&&o in s,p=d?s[c.ref]:h?s[o]:a;P0(c)?r[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),r[o]=c.fn.call(null,e,n)):u&&c.scale&&p?(r[o]=c.scale(p.value),c.scale.bandwidth&&(r[o]+=c.scale.bandwidth()/2)):d&&p?r[o]=p.value:c.fn?r[o]=c.fn.call(null,e,n):r[o]=c}return r},updateScaleSize:O0};function q0(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((e,t)=>Array.isArray(t.children)?(e.push(...q0(t.children)),e):(e.push(t),e)),[])}function N0(e,t){let{context:n,data:r,style:i,filter:o,mode:a}=t;const s=e.chart.brush(n),l=r,c=i.active||{},u=i.inactive||{},d=[];Object.keys(c).forEach((e=>{d.push(e)})),Object.keys(u).forEach((e=>{-1===d.indexOf(e)&&d.push(e)}));const h=[];let p=!1;const f=()=>{let t=q0(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=()=>{const e=f(),t=e.length;let n,r=!1;const i="function"==typeof l?l({brush:s}):l;for(let r=0;r<t;r++){if(n=e[r].data,!n)continue;e[r].__style||(e[r].__style={},d.forEach((t=>{e[r].__style[t]=e[r][t]})));const t=s.containsMappedData(n,i,a),o=h.indexOf(e[r]);let l=!1;t&&-1===o?(h.push(e[r]),l=!0):t||-1===o||(h.splice(o,1),l=!0),e[r].needToUpdate=l||p,e[r].isActive=t}for(let i=0;i<t;i++)if(n=e[i].data,n){if(e[i].needToUpdate){const t=uY({},e[i],e[i].__style),n=e[i].isActive;d.forEach((r=>{e[i][r]=n&&r in c?"function"==typeof c[r]?c[r].call(null,t,h):c[r]:!n&&r in u?"function"==typeof u[r]?u[r].call(null,t,h):u[r]:e[i].__style[r]})),r=!0}delete e[i].needToUpdate}return p=!1,r},g=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,r=f(),i=r.length;for(let e=0;e<i;e++)r[e].data&&(r[e].__style=r[e].__style||{},d.forEach((t=>{r[e].__style[t]=r[e][t],t in u&&(r[e][t]="function"==typeof u[t]?u[t].call(null,r[e]):u[t])})));p=!0,h.length=0,n||e.renderer.render(e.nodes)},y=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,r=f(),i=r.length;for(let e=0;e<i;e++)r[e].__style&&(Object.keys(r[e].__style).forEach((t=>{r[e][t]=r[e].__style[t]})),r[e].__style=void 0);h.length=0,n||e.renderer.render(e.nodes)},v=()=>{if(m()){const 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",y),s.on("update",v),{isActive:()=>s.isActive(),update:()=>{h.length=0,p=!0,m()},cleanUp:function(){s.removeListener("start",g),s.removeListener("end",y),s.removeListener("update",v)}}}function j0(e){let{nodes:t,action:n,chart:r,trigger:i}=e;const o=[];for(let e=0;e<t.length;e++){let n=t[e].data;null!==n&&o.push(n)}!function(e){let{dataPoints:t,action:n,chart:r,trigger:i}=e;if(!i)return;const o=i.data||[""];let 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(let e=0;e<t.length;e++){const n=t[e];n&&o.forEach((e=>{let t=n&&!e?n:n[e];if(t){let e={key:t.source.field};void 0!==t.source.key&&(e.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(e.range={min:t.value[0],max:t.value[1]},a.items.push(e)):(e.value=t.value,s.items.push(e))}}))}i.contexts.forEach((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 z0(e){let{collisions:t,t:n,config:r,action:i}=e,o=[],a=!1;t.length>0&&(o=t,a=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));const s=o.map((e=>e.node));return j0({nodes:s,action:i,chart:r.chart,data:r.data,trigger:n}),a}function F0(e,t,n){const r=n.element().getBoundingClientRect();let i=mY(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&&mY(e)?i={cx:i.x,cy:i.y,r:t.touchRadius}:t.mouseRadius>0&&!mY(e)&&(i={cx:i.x,cy:i.y,r:t.mouseRadius}),n.itemsAt(i))}function W0(e,t,n){return e?"function"==typeof e?e(t):e:n}const $0={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontStyle:"font-style",textDecoration:"text-decoration",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 B0(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?"M".concat(r.x," ").concat(r.y):"L".concat(r.x," ").concat(r.y),n+=" "}return t&&(n+="Z"),n}function H0(e,t,n,r){const 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 V0(e){return-e/180*Math.PI}function G0(e){return function(e){let 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}}(V0(e))}function U0(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Y0(e,t){return{x:e.x-t.x,y:e.y-t.y}}function K0(e,t){return{x:e.x*t,y:e.y*t}}function X0(e,t){return e.x-t.x}function J0(e,t){return e.y-t.y}function Z0(e,t){return X0(e,t)**2+J0(e,t)**2}function Q0(e,t){return Math.sqrt(Z0(e,t))}function e1(e,t){return e.x*t.x+e.y*t.y}function t1(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const r=Math.cos(t),i=Math.sin(t),o=Y0(e,n);return U0({x:r*o.x-i*o.y,y:i*o.x+r*o.y},n)}const n1={up:0,down:180,left:90,right:-90};function r1(e){let{x:t,y:n,size:r}=e;const i=r/2;return{type:"rect",x:t-i,y:n-i,width:r,height:r}}const i1=_K();i1.add("circle",(function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}})),i1.add("diamond",(function(e){const t=e.size,n=e.x-t/2,r=e.y-t/2;return{type:"path",fill:"black",d:B0([{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}])}})),i1.add("saltire",(function(e){const t=V0(45),n=e.size/2,r=isNaN(e.width)?n/2:e.width,i=Math.min(r,n);let o=e.size;const a=Math.sin(Math.asin(-t))*(i/2);o+=2*(n/Math.sin(-t)-n),o-=2*a;const s={x:e.x,y:e.y},l=H0(e.x,e.y,o,i).map((e=>t1(e,t,s)));return{type:"path",fill:"black",d:B0(l)}})),i1.add("square",(function(e){const t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}})),i1.add("triangle",(function(e){const t=e.size,n={x:e.x,y:e.y},r=n1[e.direction]||0,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}];const l=V0(r);return s=s.map((e=>t1(e,l,n))),{type:"path",fill:"black",d:B0(s)}})),i1.add("line",(function(e){const 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:r1(e)}})),i1.add("star",(function(e){const 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;for(let t=1;t<=i;t++){const i=s*t+a,l=V0(i),c=V0(i+s/2),u=Math.sin(l),d=Math.cos(l),h=Math.sin(c),p=Math.cos(c);n.push({x:e.x+d*r,y:e.y+u*r}),n.push({x:e.x+p*o,y:e.y+h*o})}return{type:"path",fill:"black",d:B0(n)}})),i1.add("n-polygon",(function(e){const 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;for(let a=1;a<=r;a++){const r=V0(i*a+o),s=Math.sin(r),l=Math.cos(r);t.push({x:e.x+l*n,y:e.y+s*n})}return{type:"path",fill:"black",d:B0(t)}})),i1.add("cross",(function(e){const 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:B0(H0(t,n,e.size,o))}})),i1.add("bar",(function(e){const t={x:e.x,y:e.y},n="vertical"===e.direction,r=e.size/2,i=r/2/2;let 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){const e=V0(90);o=o.map((n=>t1(n,e,t)))}const a=wY(o);return a.type="rect",a.fill="black",a})),i1.add("rect",(function(e){const{x:t,y:n,size:r}=e,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}})),i1.add("image",(function(e){const{x:t,y:n}=e,{width:r,height:i,imageSrc:o,position:a,symbol:s,imageScalingFactor:l}=e.imageSettings||{};return{type:"image",x:t,y:n,width:r,height:i,src:o,symbol:s,r:10,cx:0,cy:0,imageScalingFactor:l,imagePosition:a}}));const o1=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i1;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=e.get(t.type);if(n){const e=n(t);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach((n=>{void 0!==$0[n]&&"transform"!==n&&(e[n]=t[n])}))}(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function a1(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{dock:n="center",displayOrder:r=0,prioOrder:i=0,preferredSize:o=0,minimumLayoutMode:a,show:s=!0}=e;n=n||"center";return{computePreferredSize(e){let{inner:n,outer:r,children:i}=e;return"function"==typeof o?o({inner:n,outer:r,children:i,dock:this.dock()},t):o},dock(e){return void 0!==e?(n=e,this):"function"==typeof n?n(t):n},displayOrder(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},prioOrder(e){return void 0!==e?(i=e,this):"function"==typeof i?i(t):i},minimumLayoutMode(e){return void 0!==e?(a=e,this):"function"==typeof a?a(t):a},show(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s}}}function s1(e,t,n){const{require:r=[]}=t,i=t.mediator||{},{settings:o,formatter:a,scale:s,data:l,renderer:c,chart:u,dockConfig:d,mediator:h,instance:p,rect:f,style:m,registries:g,resolver:y,update:v,_DO_NOT_USE_getInfo:b,symbol:x,isVisible:w}=n;e.emit=()=>{},w&&(e.isVisible=w),Object.defineProperty(e,"settings",{get:o}),Object.defineProperty(e,"data",{get:l}),Object.defineProperty(e,"formatter",{get:a}),Object.defineProperty(e,"scale",{get:s}),Object.defineProperty(e,"mediator",{get:h}),Object.defineProperty(e,"style",{get:m}),Object.defineProperty(e,"registries",{get:g}),f&&Object.defineProperty(e,"rect",{get:f}),b&&(e._DO_NOT_USE_getInfo=b),Object.keys(t).forEach((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((e=>e===r))||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])})),r.forEach((t=>{"renderer"===t?Object.defineProperty(e,"renderer",{get:c}):"chart"===t?Object.defineProperty(e,"chart",{get:u}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:d}):"instance"===t?Object.defineProperty(e,"instance",{get:p}):"update"===t&&v?Object.defineProperty(e,"update",{get:v}):"resolver"===t?Object.defineProperty(e,"resolver",{get:y}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:x})})),Object.keys(i).forEach((t=>{e.mediator.on(t,i[t].bind(e))}))}function l1(e,t,n){const r=t=>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 c1(e,t,n){Object.keys(n.on||{}).forEach((r=>{e.eventListeners=e.eventListeners||[];const 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(e,...r)}}function u1(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{defaultSettings:n={},_DO_NOT_USE_getInfo:r=()=>({})}=e,{chart:i,container:o,mediator:a,registries:s,theme:l,renderer:c}=t,u=r0.mixin({});let d,h,p,f,m,g=t.settings||{},y=uY(!0,{},n,g),v=[],b=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L0,n={};return{resolve:function(r){let{data:i,settings:o,defaults:a={},scaled:s}=r;const l=n.norm=t.normalizeSettings(o,a,e.chart),c={scale:e.chart.scale,formatter:e.chart.formatter};s&&Object.keys(s).forEach((e=>{l[e]&&t.updateScaleSize(l,e,s[e])}));const u=[];if(!i||!Array.isArray(i.items)){const e={data:i,resources:c};let r=t.resolveForItem(e,n.norm,-1);return{settings:n.norm,item:r}}{let e;for(let r=0,o=i.items.length;r<o;r++){e={datum:i.items[r],data:i,resources:c};let o=t.resolveForItem(e,n.norm,r);o.data=i.items[r],u.push(o)}}return{settings:n.norm,items:u}}}}({chart:i}),x=!1;const w={nodes:[],chart:i,config:y.brush||{},renderer:null},S={tap:[],over:[]},C=[],M={},k=uY({},g);function E(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const i=void 0!==e[t],o=void 0!==g[t];let a;for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return i&&("function"==typeof e[t]?a=e[t].call(M,...l):r&&(a=e[t])),o&&("function"==typeof g[t]?a=g[t].call(k,...l):r&&(a=g[t])),i||o||(a=n.call(M,...l)),a}}const _=E("preferredSize",(()=>0),!0),R=E("resize",(e=>{let{inner:t}=e;return t})),I=E("created"),D=E("beforeMount"),A=E("mounted"),P=E("beforeUnmount"),O=E("beforeUpdate"),T=E("updated"),L=E("beforeRender"),q=E("beforeDestroy"),N=E("destroyed"),j=e.render,z=()=>{y.brush&&(y.brush.consume||[]).forEach((e=>{e.context&&e.style&&C.push(N0(w,e))}))},F=()=>{y.brush&&(y.brush.trigger||[]).forEach((e=>{"over"===e.on?S.over.push(e):S.tap.push(e)}))};Object.defineProperty(w,"data",{get:()=>v});const W=y.renderer||e.renderer,$=W?c||s.renderer(W)():c||s.renderer()();"function"==typeof $.settings&&$.settings(y.rendererSettings),w.renderer=$;const B={resources:i.logger?{logger:i.logger()}:{}};let H=a1(l1(y,_,i.logger()),B);const V=e=>{e.key=y.key,e.element=$.element()},G=()=>{};G.dockConfig=()=>H,G.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(g=e.settings,y=uY(!0,{},n,e.settings),H=a1(l1(y,_,i.logger()),B),w.config=y.brush||{}),y.scale&&(d=i.scale(y.scale)),y.data){const{rendererSettings:e}=y,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=pZ(y.data,{dataset:i.dataset,collection:i.dataCollection},{logger:i.logger()},i.dataCollection);t?t.isFirst?(v=n,v.items&&(v.items=[...n.items])):v.items&&(v.items=[...v.items,...n.items||[]]):v=n}else v=d?d.data():[];"string"==typeof y.formatter||"object"==typeof y.formatter?h=i.formatter(y.formatter):d&&d.data().fields&&(h=d.data().fields[0].formatter()),m=l.style(y.style||{})},G.resize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=R({inner:e,outer:t});f=n?$.size(n):$.size(e),k.rect=uY(!0,{computedPhysical:f.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),f=uY(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},f)},G.getRect=()=>k.rect;const U=()=>{const e=$.renderArgs?$.renderArgs.slice(0):[],{rendererSettings:t}=y;let n=v;const r="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return v.items&&r&&(n=fY(fY({},v),{},{items:v.items.slice(r.start,r.end)})),e.push({data:n}),e};let Y,K,X;function J(e){const{rendererSettings:t}=y,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?w.nodes=[...e||[]]:w.nodes&&(w.nodes=[...w.nodes,...e||[]]):w.nodes=e}G.beforeMount=D,G.beforeRender=()=>{L({size:f})},G.render=()=>{const e=j.call(M,...U());J(e),$.render(e),Y=e,K=k.rect.computed},G.hide=()=>{G.unmount(),$.size({x:0,y:0,width:0,height:0}),$.clear()},G.beforeUpdate=()=>{O({settings:y,data:v})},G.update=()=>{X&&X.stop();const{rendererSettings:e,brush:t,animations:n}=y;if("function"==typeof(null==e?void 0:e.transform)&&e.transform())return $.render(),void(Y=null);const r=j.call(M,...U());J(r),C.forEach((e=>e.cleanUp())),C.length=0,S.tap=[],S.over=[],t&&(z(),F()),C.forEach((e=>{e.isActive()&&e.update()})),Y&&n&&("function"==typeof n.enabled?n.enabled():n.enabled)?(n.compensateForLayoutChanges&&n.compensateForLayoutChanges({currentNodes:Y,currentRect:k.rect.computed,previousRect:K}),X=function(e,t,n,r){let i,{old:o,current:a}=e,{renderer:s}=t,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},d={nodes:[],ips:[]},h=[],p=null;const f=n.trackBy||I0,m={start(){let e={};if(o.forEach(((t,n)=>{let r=f(t,n);e[r]=t})),a.forEach(((t,n)=>{let r=f(t,n);if(e[r]){if("path"===t.type&&t.points&&t.points.length>0&&"trend"!==t.data.source.key){const n=function(e,t){const n=e.points.filter((e=>!e.dummy)),r=t.points.filter((e=>!e.dummy)),i=r.map((e=>e.data.major.value)),o=n.filter((e=>i.includes(e.data.major.value))).map((e=>e.data.major.value)),a=n.filter((e=>o.includes(e.data.major.value))),s=r.filter((e=>o.includes(e.data.major.value)));return{old:a,current:s}}(e[r],t);d.ips.push(R0(uY({},e[r],{points:n.old}),uY({},t,{points:n.current}))),l.push(uY({},e[r],{commonPoints:n.old}))}else d.ips.push(R0(e[r],t)),l.push(e[r]);d.nodes.push(t),e[r]=!1}else c.nodes.push(t),c.ips.push(R0(uY({},t,{r:.001,opacity:0}),t))})),Object.keys(e).forEach((t=>{e[t]&&(u.nodes.push(e[t]),u.ips.push(R0(e[t],uY({},e[t],{r:1e-4,opacity:0}))))})),h.push({name:"exiting",easing:S0,duration:200,tweens:u.ips,nodes:[...l]}),h.push({name:"updating",easing:M0,duration:400,tweens:d.ips,nodes:[]}),h.push({name:"entering",easing:C0,duration:200,tweens:c.ips,nodes:[...d.nodes]}),n.isMainComponent){var t;const e=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,i=e?l.filter(e).length:l.length,{isInit:o,shouldBeRemoved:a}=r.getValue("animations.updatingStageMeta");!1===o?(r.setValue("animations.updatingStageMeta.shouldBeRemoved",0===i),r.setValue("animations.updatingStageMeta.isInit",!0)):r.setValue("animations.updatingStageMeta.shouldBeRemoved",a&&0===i)}h.length&&(p=s.getScene(a),h[0].started=Date.now(),"undefined"!=typeof window&&(i=window.requestAnimationFrame(m.tick)))},tick(){let e=h[0];e||m.stop(),e.started||(e.started=Date.now());let t=(Date.now()-e.started)/e.duration,o=[],a=e.tweens.map((n=>n(e.easing(Math.min(1,t)))));const{adjustTweenedNodes:l}=n;if(l&&l(a),o.push(...a),o.push(...e.nodes),s.render(o),t>=1){h.shift();const{isInit:e,shouldBeRemoved:t}=r.getValue("animations.updatingStageMeta");h.length?"updating"===h[0].name&&t&&h.shift():(!0===e&&r.setValue("animations.updatingStageMeta.isInit",!1),m.stop())}i&&(i=window.requestAnimationFrame(m.tick))},stop(){i&&(window.cancelAnimationFrame(i),i=!1)},inProgress:()=>!!i,get targetScene(){return p}};return m}({old:Y,current:r},{renderer:$},n,i.storage),X.start()):$.render(r),Y=r,K=k.rect.computed,$.setKey&&"string"==typeof g.key&&$.setKey(g.key)},G.updated=T,G.destroy=()=>{G.unmount(),q(p),$.destroy(),N(),p=null};const Z=e=>{w.nodes=e,C.forEach((e=>{e.isActive()&&e.update()})),$.render(e)};return s1(M,e,{settings:()=>y,data:()=>v,scale:()=>d,formatter:()=>h,renderer:()=>$,chart:()=>i,dockConfig:()=>H,mediator:()=>a,instance:()=>k,rect:()=>k.rect,style:()=>m,update:()=>Z,registries:()=>s,resolver:()=>b,symbol:()=>o1(s.symbol)}),s1(k,g,{settings:()=>y,data:()=>v,scale:()=>d,formatter:()=>h,renderer:()=>$,chart:()=>i,dockConfig:()=>H,mediator:()=>a,style:()=>m,_DO_NOT_USE_getInfo:r.bind(M),isVisible:()=>x}),G.getBrushedShapes=function(e,t,n){const r=[];if(y.brush&&y.brush.consume){const o=i.brush(e),a=$.findShapes("*");y.brush.consume.filter((t=>t.context===e)).forEach((e=>{for(let i=0;i<a.length;i++){const s=a[i];s.data&&o.containsMappedData(s.data,n||e.data,t)&&(V(s),r.push(s),a.splice(i,1),i--)}}))}return r},G.findShapes=e=>{var t;const n=(null!==(t=X)&&void 0!==t&&t.inProgress()?X.targetScene:$).findShapes(e);for(let e=0,t=n.length;e<t;e++)V(n[e]);return n},G.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=$.itemsAt(e);let r;r=t&&"stop"===t.propagation&&n.length>0?[n.pop().node]:n.map((e=>e.node));for(let e=0,t=r.length;e<t;e++)V(r[e]);return r},G.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[];j0({nodes:e,action:t.action||"toggle",trigger:t,chart:i,data:w.data})},G.mount=()=>{p=$.element&&$.element()?p:$.appendTo(o),$.setKey&&"string"==typeof g.key&&$.setKey(g.key),y.brush&&(z(),F()),c1(k,u,g),c1(M,u,e),x=!0},G.mounted=()=>A(p),G.unmount=()=>{[k,M].forEach((e=>{!function(e,t){e.eventListeners&&(e.eventListeners.forEach((e=>{let{event:n,listener:r}=e;t.removeListener(n,r)})),e.eventListeners.length=0),e.emit=()=>{}}(e,u)})),S.tap=[],S.over=[],C.forEach((e=>{e.cleanUp()})),C.length=0,P(),x=!1},G.onBrushTap=e=>{S.tap.forEach((t=>{(function(e){let{e:t,t:n,config:r}=e;return z0({collisions:F0(t,n,r.renderer),t:n,config:r,action:W0(n.action,t,"toggle")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&i.toggleBrushing(!0)}))},G.onBrushOver=e=>{S.over.forEach((t=>{(function(e){let{e:t,t:n,config:r}=e;return z0({collisions:F0(t,n,r.renderer),t:n,config:r,action:W0(n.action,t,"set")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&i.toggleBrushing(!0)}))},G.def=M,G.ctx=k,G.renderer=()=>$,G.set({settings:g}),I(),G}function d1(e){const t=uY(!0,{},e),n={getAll:()=>t,getValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return n;const r=t.split(".");let i=e;for(let e=0;e<r.length;++e){const t=r[e];if(void 0===i[t])return n;i=i[t]}return i}(t,e,n),setValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return;const r=t.split("."),i=r[r.length-1];let o=e;for(let e=0;e<r.length-1;++e){const t=r[e];void 0===o[t]&&(o[t]=Number.isNaN(+r[e+1])?{}:[]),o=o[t]}void 0!==n?o[i]=n:delete o[i]}(t,e,n)};return n}function h1(e,t,n){const r=U0(function(e,t){const n=e1(e,t)/e1(t,t)||1;return{x:t.x*n,y:t.y*n}}(Y0(n,e),Y0(t,e)),e);return r}function p1(e,t,n){return Q0(e,n)+Q0(t,n)-Q0(e,t)<1e-12}function f1(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 m1(e){return e.x1===e.x2&&e.y1===e.y2}function g1(e){return e.width<=0||e.height<=0}function y1(e){return e.r<=0}function v1(e){return e.edges.length<=2}function b1(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=E1(e,SY(t.edges[r])),!0===n)return!0;return!1}function x1(e,t){let n=!1;const{numPolygons:r,polygons:i}=t;for(let t=0;t<r;t++){if(n=L1(e,i[t]),!0===n)return!0}return!1}function w1(e,t){if(y1(e))return!1;return Z0({x:e.cx,y:e.cy},t)<=e.r**2}function S1(e,t){if(g1(t)||y1(e))return!1;const 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,c=Math.abs(s-i),u=Math.abs(l-o);if(c>n+a||u>r+a)return!1;if(c<=n||u<=r)return!0;return(c-n)**2+(u-r)**2<=a**2}function C1(e,t){if(y1(e)||m1(t))return!1;const[n,r]=bY(t);if(w1(e,n)||w1(e,r))return!0;const i={x:e.cx,y:e.cy},o=h1(n,r,i);return Z0(o,i)<=e.r**2&&p1(n,r,o)}function M1(e,t){if(v1(t)||y1(e))return!1;if(k1(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let r=0;r<n;r++){if(C1(e,SY(t.edges[r])))return!0}return!1}function k1(e,t){if(v1(e)||!D1(e.boundingRect(),t))return!1;const{x:n,y:r}=t,i=e.vertices;let o,a,s,l,c;for(o=!1,l=-1,a=i.length,s=a-1;++l<a;s=l){if(i[l].x===n&&i[l].y===r)return!0;if(i[l].y===i[s].y&&i[l].y===r&&(n-i[l].x)*(n-i[s].x)<=0)return!0;if(i[l].y<r&&r<=i[s].y||i[s].y<r&&r<=i[l].y){if(c=(i[s].x-i[l].x)*(r-i[l].y)/(i[s].y-i[l].y)+i[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function E1(e,t){if(v1(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(P1(t,SY(e.edges[n])))return!0}const[n,r]=bY(t);return k1(e,n)||k1(e,r)}function _1(e,t){if(v1(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(A1(t,SY(e.edges[n])))return!0}const[n,r,i,o]=xY(t);return k1(e,n)||k1(e,r)||k1(e,i)||k1(e,o)}function R1(e,t){return!g1(e)&&!g1(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 I1(e,t){if(g1(e)||g1(t))return!1;return[{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((t=>D1(e,t)))}function D1(e,t){return!g1(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function A1(e,t){if(m1(t)||g1(e))return!1;const[n,r]=bY(t);if(D1(e,n)||D1(e,r))return!0;const i=xY(e);let o=i.length;for(let e=0;e<o;e++){if(P1(SY([i[e],i[3!==e?e+1:0]]),t))return!0}return!1}function P1(e,t){const[n,r]=bY(e),[i,o]=bY(t),a=X0(r,n),s=J0(r,n),l=X0(o,i),c=J0(o,i),u=X0(n,i),d=J0(n,i);let h=c*a-l*s;const p=l*d-c*u,f=a*d-s*u;let m,g;if(0===a&&0===s)return!1;if(0===l&&0===c)return!1;if(0===h){if(0===p&&0===f){if(0===a){if(0===s)return n.x===r.x&&n.y===r.y;m=J0(i,n)/s,g=J0(o,n)/s}else m=(i.x-n.x)/a,g=(o.x-n.x)/a;return!(m<0&&g<0||m>1&&g>1)}return!1}const y=p/h;return h=f/h,y>=0&&y<=1&&h>=0&&h<=1}function O1(e,t){if(m1(e))return!1;const[n,r]=bY(e);return p1(n,r,t)}function T1(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!R1(n,r)&&(I1(n,r)?b1(e,t):b1(t,e))}function L1(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!R1(n,r)&&(I1(r,n)?function(e,t){let n=!1;const{numPolygons:r,polygons:i}=e;for(let e=0;e<r;e++)if(n=T1(t,i[e]),!0===n)return!0;return!1}(e,t):function(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=j1(e,SY(t.edges[r])),!0===n)return!0;return!1}(e,t))}function q1(e,t){if(y1(e))return!1;if(N1(t,{x:e.cx,y:e.cy}))return!0;const{numPolygons:n,polygons:r}=t;for(let t=0;t<n;t++){const n=r[t],i=n.edges.length;for(let t=0;t<i;t++){if(C1(e,SY(n.edges[t])))return!0}}return!1}function N1(e,t){if(!D1(e.boundingRect(),t))return!1;const{x:n,y:r}=t,i=e.numPolygons;let o,a,s,l,c,u,d=!1;for(a=0;a<i;a++)for(o=e.vertices[a],c=-1,s=o.length,l=s-1;++c<s;l=c){if(o[c].x===n&&o[c].y===r)return!0;if(o[c].y===o[l].y&&o[c].y===r&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<r&&r<=o[l].y||o[l].y<r&&r<=o[c].y){if(u=(o[l].x-o[c].x)*(r-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(d=!d)}}return d}function j1(e,t){const[n,r]=bY(t);if(N1(e,n)||N1(e,r))return!0;const{numPolygons:i,polygons:o}=e;for(let e=0;e<i;e++){const n=o[e];for(let e=0,r=n.edges.length;e<r;e++){if(P1(t,SY(n.edges[e])))return!0}}return!1}function z1(e,t){const[n,r,i,o]=xY(t);if(N1(e,n)||N1(e,r)||N1(e,i)||N1(e,o))return!0;const{numPolygons:a,polygons:s}=e;for(let e=0;e<a;e++){const n=s[e];for(let e=0,r=n.edges.length;e<r;e++){if(A1(t,SY(n.edges[e])))return!0}}return!1}const F1=/^\$/,W1="@extend";function $1(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function B1(e,t,n){if("string"==typeof e){let r=t[e];return-1!==n.indexOf(e)&&$1(e),F1.test(r)?(n.push(e),B1(r,t,n)):r}let r=e;const i=uY(!0,{},t,e),o={};if(e[W1]){const o=e[W1];-1!==n.indexOf(o)&&$1(o);let a=n.slice();a.push(o),r=uY(!0,{},B1(i[o],t,a),e)}return Object.keys(r).forEach((e=>{let t=n.slice();if(e===W1||F1.test(e))return;o[e]=r[e];let a=o[e];F1.test(a)&&a in i?(-1!==n.indexOf(a)&&$1(a),t.push(a),a=i[a],"object"==typeof a||F1.test(a)&&a in i?o[e]=B1(a,i,t):o[e]=a):"object"==typeof a&&(o[e]=B1(a,i,t))})),o}function H1(e,t){return B1(e,t,[])}function V1(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e;const r=e=>{e.forEach((e=>{const n=Array.isArray(e.colors[0])?e.colors:[e.colors];t[e.key]={colors:n,sizes:n.map((e=>e?e.length:0))}}))},i={palette:(e,n)=>((e,n)=>{const r=t[e];if(!r)return[];const i=r.sizes;for(let e=0;e<i.length;e++)if(n<=i[e])return r.colors[e];return r.colors[i.length-1]})(e,n),setPalettes:r,style:e=>H1(e,n),setStyle:t=>{n=uY({},e,t)}};return r(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),i}function G1(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 U1(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return uY(!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 Y1(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 K1(e,t,n){if(void 0===e.cachedSize){const r=e.config.dock();let i,o=e.comp.preferredSize({inner:t,outer:n,dock:r});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},i="top"===r||"bottom"===r?o.height:"right"===r||"left"===r?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(i),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function X1(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 J1(e,t){const 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 Z1(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);const 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);const i=e.height-(t.y+t.height);i<n.bottom&&(t.height-=n.bottom-i)}function Q1(e,t,n,r,i){const o=uY({},t),a=uY({},n);X1(o,r),J1(a,r),Z1(e,o,a);const s=function(e,t,n){const 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);return!!s&&(X1(t,r),J1(n,r),!0)}function e2(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 t2(e){return wY([].concat(...e.map(xY)))}function n2(e){let{visible:t,layoutRect:n,reducedRect:r,containerRect:i,translation:o}=e;const a=Y1(r.x,r.y,r.width,r.height),s=Y1(r.x,r.y,r.width,r.height),l={},c=t.slice(),u=c.slice().sort(((e,t)=>e.config.displayOrder()-t.config.displayOrder()));return t.sort(((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;const n=e.config.displayOrder()-t.config.displayOrder();return 0===n?c.indexOf(e)-c.indexOf(t):n})).forEach((e=>{let t={},c={};switch(e.config.dock()){case"top":t.height=c.height=e.cachedSize,t.width=n.width,c.width=a.width,t.x=n.x,c.x=a.x,t.y=c.y=a.y-e.cachedSize,a.y-=e.cachedSize,a.height+=e.cachedSize;break;case"bottom":t.x=n.x,c.x=a.x,t.y=c.y=a.y+a.height,t.width=n.width,c.width=a.width,t.height=c.height=e.cachedSize,a.height+=e.cachedSize;break;case"left":t.x=c.x=s.x-e.cachedSize,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.x-=e.cachedSize,s.width+=e.cachedSize;break;case"right":t.x=c.x=s.x+s.width,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.width+=e.cachedSize;break;case"center":t.x=c.x=r.x,t.y=c.y=r.y,t.width=c.width=r.width,t.height=c.height=r.height;break;default:if(e.referencedDocks.length>0){const n=e.referencedDocks.map((e=>l[e])).filter((e=>!!e));n.length>0&&(t=t2(n.map((e=>e.outerRect))),c=t2(n.map((e=>e.r))))}}e.key&&(l[e.key]={r:c,outerRect:t}),function(e,t,n,r){const i={x:r.width/n.width,y:r.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const e=i.x<i.y,t=Math.min(i.x,i.y);i.x=t,i.y=t;const a=e?"height":"width",s=(r[a]-n[a]*i.x)*n.align;o.left=e?0:s,o.top=e?s:0}e.scaleRatio=i,e.margin=o,t.scaleRatio=i,t.margin=o,n.scaleRatio=i,n.margin=o}(c,t,n,i),c.edgeBleed=e.edgeBleed,c.computed=e2(c),t.edgeBleed=e.edgeBleed,t.computed=e2(t),c.x+=o.x,c.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(c,t),e.cachedSize=void 0,e.edgeBleed=void 0})),u}function r2(e,t,n){const r=e.layoutModes||{},i=t.minimumLayoutMode();let o=t.show();return o&&"object"==typeof 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 i2(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 o2(e){let t=U1(e);const n={};return n.layout=function(e){let 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:[]};const{logicalContainerRect:r,containerRect:i}=function(e,t){const 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),G1(r),G1(n),{logicalContainerRect:r,containerRect:n}}(e,t),[o,a]=function(e,t,n){const r=[],i=[];for(let o=0;o<e.length;++o){const a=e[o];i2(a);let s=a.dockConfig;const l=a.key,c=s.dock(),u=/@/.test(c)?c.split(",").map((e=>e.replace(/^\s*@/,""))):[];r2(t,s,n)?r.push({comp:a,key:l,config:s,referencedDocks:u}):i.push({comp:a,key:l,config:s,referencedDocks:u})}return[r,i]}(n,t,r),s=function(e){let{layoutRect:t,visible:n,hidden:r,settings:i}=e;const o=Y1(t.x,t.y,t.width,t.height),a={left:0,right:0,top:0,bottom:0},s=n.slice();s.sort(((e,t)=>e.config.prioOrder()-t.config.prioOrder()));for(let e=0;e<s.length;++e){const n=s[e];K1(n,o,t),Q1(t,o,a,n,i)||(r.push(s.splice(e,1)[0]),--e)}!function(e,t){if(0!==t.length)for(let n=0;n<e.length;++n){let r=e[n];if(r.referencedDocks.length){const i=r.referencedDocks.every((e=>t.some((t=>t.key===e))));i&&t.push(e.splice(n,1)[0])}}}(n,r);const l=n.filter((e=>-1!==s.indexOf(e)));return n.length=0,n.push(...l),Z1(t,o,a),o}({layoutRect:r,visible:o,hidden:a,settings:t}),l=n2({visible:o,layoutRect:r,reducedRect:s,containerRect:i,translation:{x:e.x,y:e.y}});return a.forEach((e=>{e.comp.visible=!1;const t=Y1();e.comp.resize(t,t)})),{visible:o.map((e=>e.comp)),hidden:a.map((e=>e.comp)),ordered:l.map((e=>e.comp))}},n.settings=function(e){t=U1(e)},n}const a2=(e,t)=>{for(let n=0;n<e.length;n++){const r=e[n];if(r.hasKey&&r.key===t)return e[n]}return null},s2=e=>null==e?void 0:e.map((e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(fY(fY({},n),{},{children:s2(e.children)}))}})),l2=(e,t)=>({visible:[],hidden:t,ordered:[]}),c2=e=>(t,n)=>{var r;const i=n.map(((e,t)=>{const n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:t=>n.computePreferredSize(fY(fY({},t),{},{children:s2(e.children)}))}})),o=e=>n[e.index],{visible:a=i,hidden:s=[],ordered:l=a}=null!==(r=e(t,i))&&void 0!==r?r:{};return{visible:a.map(o),hidden:s.map(o),ordered:l.map(o)}},u2=e=>"function"==typeof e?c2(e):(e=>{const t=o2(e);return c2(((e,n)=>t.layout(e,n)))})(e);function d2(e,t,n){const r=t.left-n.left,i=t.top-n.top,o=CY(e),a=uY(!0,{},e);switch(o){case"circle":a.cx+=r,a.cy+=i;break;case"polygon":for(let e=0,t=a.vertices.length;e<t;e++){const t=a.vertices[e];t.x+=r,t.y+=i}break;case"geopolygon":for(let e=0;e<a.vertices.length;e++){const t=a.vertices[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n.x+=r,n.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 h2(e,t){const n=[];let r=0;t.forEach((e=>{n.push(r),r++;const t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(r+=t.length)})),t.forEach(((t,r)=>((e,t,n)=>{const r=t.instance.renderer().element();if(isNaN(n)||!r||!e||!e.children)return;const i=e.children[Math.max(0,n)];if(r===i)return;const o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==i?(e.insertBefore(r,i),o&&o.forEach((t=>{e.insertBefore(t,r)}))):(o&&o.forEach((t=>{e.appendChild(t,r)})),e.appendChild(r))})(e,t,n[r])))}function p2(e,t){let{element:n,data:r=[],settings:i={},on:o={}}=e;const a=t.registries,s=t.logger,l=V1(t.style,t.palettes),c=[],u=uY({},e),d=function(){const e={};return r0.mixin(e),e}();let h=[],p=null,f=null,m=null,g=[],y=()=>{},v=()=>{};const b={};let x=!1;const w=function(e){let{createComponent:t}=e;const n={};let r=[],i=[];const o=e=>{const n=t(e);return n&&(r.push(n),e.components&&(n.children=e.components.map((e=>o(e))).filter((e=>!!e)))),n},a=e=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)},s=(e,t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n],i=t.find((e=>r.hasKey&&r.key===e.key));i?r.children&&i.components&&s(r.children,i.components):(e.splice(n,1),a(r),r.children&&s(r.children,[]),r.instance.destroy())}},l=e=>{let{compList:t,data:n,excludeFromUpdate:r,formatters:i,scales:a,settingsList:s}=e;return s.map((e=>{const s=a2(t,e.key);return r.indexOf(e.key)>-1?(delete s.updateWith,s):s?(e.rendererSettings&&"function"==typeof s.instance.renderer().settings&&s.instance.renderer().settings(e.rendererSettings),e.rendererSettings&&"function"==typeof e.rendererSettings.transform&&e.rendererSettings.transform()?(s.applyTransform=!0,s):(s.updateWith={formatters:i,scales:a,data:n,settings:e},e.components&&(s.children=l({compList:s.children||[],data:n,excludeFromUpdate:r,formatters:i,scales:a,settingsList:e.components})),s)):o(e)})).filter((e=>!!e))},c=e=>{let{components:t,hidden:n,layoutFn:r,ordered:i,rect:o,visible:a}=e;const{visible:s,hidden:l,ordered:u}=r(o,t);a.push(...s),n.push(...l),i.push(...u),s.forEach((e=>{if(e.children){var t,r;const o=u2(null!==(t=null===(r=e.settings)||void 0===r?void 0:r.strategy)&&void 0!==t?t:{});c({components:e.children,hidden:n,layoutFn:o,ordered:i,rect:e.instance.getRect(),visible:a})}})),l.forEach((e=>{e.children&&c({components:e.children,hidden:n,layoutFn:l2,ordered:i,rect:null,visible:a})}))};return n.destroy=()=>{r.forEach((e=>e.instance.destroy())),r=[],i=[]},n.findComponentByKey=e=>a2(r,e),n.forEach=e=>{r.forEach(e)},n.layout=e=>{let{layoutSettings:t,rect:n}=e;const r=[],o=[],a=[],s=u2(t);return c({components:i,hidden:o,layoutFn:s,ordered:a,rect:n,visible:r}),{visible:r,hidden:o,ordered:a}},n.set=e=>{let{components:t}=e;i=t.map((e=>o(e))).filter((e=>!!e))},n.update=e=>{let{components:t,data:n,excludeFromUpdate:r,formatters:o,scales:a}=e;s(i,t),i=l({compList:i,data:n,excludeFromUpdate:r,formatters:o,scales:a,settingsList:t})},n}({createComponent:e=>{if(!a.component.has(e.type))return s.warn("Unknown component: ".concat(e.type)),!1;return{instance:u1(a.component(e.type),{settings:e,chart:u,mediator:d,registries:a,theme:l,container:n}),settings:uY(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function S(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const r="function"==typeof e[t];let i;for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return i=r?e[t].call(u,...a):n.call(u,...a),i}}const C=()=>{let e;i.dockLayout?(s.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=i.dockLayout):e=i.strategy;const t=function(e){if("function"==typeof e.getBoundingClientRect){const{width:t,height:n}=e.getBoundingClientRect();return{x:0,y:0,width:t,height:n}}return{x:0,y:0,width:0,height:0}}(n);return w.layout({layoutSettings:e,rect:t})},M=S("created"),k=S("beforeMount"),E=S("mounted"),_=S("beforeUpdate"),R=S("updated"),I=S("beforeRender"),D=S("beforeDestroy"),A=S("destroyed"),P=function(e,t){let{partialData:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{formatters:r={},scales:i={},scroll:o={}}=t;y=function(e,t){let{types:n,logger:r}=t;const i={},o=[];return Array.isArray(e)?o.push(...e):(r.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach(((e,t)=>{let o=n(e.type);if(o){let n=e.key;void 0===e.key&&(r.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),n=t);let a=o({key:n,data:e.data,config:e.config});i[n]=a}})),e=>e?i[e]:i[Object.keys(i)[0]]}(e,{logger:s,types:a.data}),n||Object.keys(b).forEach((e=>b[e].clear())),t.palettes&&l.setPalettes(t.palettes),t.style&&l.setStyle(t.style),v=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:pZ;const i={};return(e||[]).forEach((e=>{if(!e.key)throw new Error('Data collection is missing "key" property');if("object"==typeof e.data&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");i[e.key]=()=>r(e.data,t,n)})),e=>{let t,n;if("string"==typeof e?t=e:"object"==typeof 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]());let r=i[t];if(n&&n.fields&&n.fields.filter){let e=r.fields.filter(n.fields.filter);r.fields.length!==e.length&&(r=uY(r,{fields:e}))}return r}}(t.collections,{dataset:y},{logger:s});const c={theme:l,logger:s};p=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:QQ;const i={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof 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(){return Object.keys(e).forEach(this.get),i}}}(i,{dataset:y,collection:v},fY(fY({},c),{},{scale:a.scale})),f=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:fZ;const i={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"formatter"in o&&e[o.formatter]?a=o.formatter:"object"==typeof 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(){return Object.keys(e).forEach(this.get),i}}}(r,{dataset:y,collection:v},fY(fY({},c),{},{formatter:a.formatter})),m=function(e,t){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=o0(e[r],t?t[r]:null));return n}(o,m)};function O(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},r=e.filter((e=>!!e.key)).map((e=>e.key));g.forEach((e=>{e.key&&-1!==r.indexOf(e.key)?t[e.key]=e:e.destroy()})),g=e.map((e=>{const r=e.key&&t[e.key]?t[e.key]:a.interaction(e.type)(u,d,n);return r.set(e),r}))}const T=e=>{const 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 h.forEach((e=>{const t=e.instance.getRect();D1(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},L=()=>{if(c.length||!n)return;Object.keys(o).forEach((e=>{const t=o[e].bind(u);n.addEventListener(e,t),c.push({key:e,listener:t})}));const e={},t=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=T(e)},r=t=>{const n=e.comps||T(t);if(!n.every((e=>e.instance.def.disableTriggers))&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=mY(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(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),x){x=!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:e=>{const t=T(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),x){x=!1;break}}}}),i.forEach((e=>{n.addEventListener(e.key,e.listener),c.push(e)}))},q=()=>{c.forEach((e=>{let{key:t,listener:r}=e;return n.removeEventListener(t,r)})),c.length=0},N=()=>{n.innerHTML="",(()=>{const{components:e=[]}=i;I(),P(r,i),w.set({components:e});const{visible:t,hidden:o,ordered:a}=C();h=t,o.forEach((e=>{e.instance.hide(),e.visible=!1})),t.forEach((e=>e.instance.beforeMount())),t.forEach((e=>e.instance.mount())),t.forEach((e=>e.instance.beforeRender())),t.forEach((e=>e.instance.render())),t.forEach((e=>e.instance.mounted())),t.forEach((e=>{e.visible=!0})),h2(n,a)})(),L(),O(i.interactions)};return u.layoutComponents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{excludeFromUpdate:t=[]}=e;e.data&&(r=e.data),e.settings&&(i=e.settings,O(e.settings.interactions)),_(),P(r,i);const{formatters:n,scales:o,components:a=[]}=i;w.update({components:a,data:r,excludeFromUpdate:t,formatters:n,scales:o}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()})),C()},u.update=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{partialData:t,excludeFromUpdate:o=[]}=e;let a;e.data&&(r=e.data),e.settings&&(i=e.settings,O(e.settings.interactions)),_(),P(r,i,{partialData:t});const{formatters:s,scales:l,components:c=[]}=i;w.update({components:c,data:r,excludeFromUpdate:o,formatters:s,scales:l}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()}));const u=[],d=[];let p;if(t)w.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible&&u.push(e)})),p=u;else{const{visible:e,hidden:t,ordered:n}=C();h=e,p=e,a=n,e.forEach((e=>{e.updateWith&&e.visible?u.push(e):d.push(e)})),t.forEach((e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1}))}d.forEach((e=>e.instance.beforeMount())),d.forEach((e=>e.instance.mount())),p.forEach((e=>e.instance.beforeRender())),p.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()})),t||h2(n,a),d.forEach((e=>e.instance.mounted())),u.forEach((e=>e.instance.updated())),h.forEach((e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1})),R()},u.destroy=()=>{D(),w.destroy(),q(),O(),delete u.update,delete u.destroy,A()},u.getAffectedShapes=function(e){let 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 h.filter((e=>null==r||e.key===r)).forEach((r=>{const o=r.instance.getBrushedShapes(e,t,n);i=[...i,...o]})),i},u.findShapes=e=>{let t=[];return h.forEach((n=>{const r=n.instance.findShapes(e);t=[...t,...r]})),t},u.componentsFromPoint=e=>T(e).map((e=>e.instance.ctx)),u.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[];const i=n.getBoundingClientRect();let o=h;if(Array.isArray(t.components)&&t.components.length>0){const e=t.components.map((e=>e.key));o=h.filter((t=>-1!==e.indexOf(t.key))).map((n=>({instance:n.instance,opts:t.components[e.indexOf(n.key)]})))}for(let n=o.length-1;n>=0;n--){const a=o[n],s=d2(e,i,a.instance.renderer().element().getBoundingClientRect()),l=a.instance.shapesAt(s,a.opts),c=l.length>0&&"stop"===t.propagation;if(r=[...r,...l],r.length>0&&c)return r}return r},u.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<t.components.length;n++){const r=t.components[n].key;h.filter((e=>r===e.key)).forEach((r=>{let i=e.filter((e=>e.key===r.key));r.instance.brushFromShapes(i,t.components[n])}))}},u.scroll=function(){return function(e,t){return t[e]||(t[e]=i0()),t[e]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",m)},u.dataset=e=>y(e),u.dataCollection=e=>v(e),u.scales=function(){return p.all()},u.formatters=function(){return f.all()},u.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return b[e]||(b[e]=w0()),b[e]},u.scale=function(e){return p.get(e)},u.formatter=function(e){return f.get(e)},u.toggleBrushing=function(e){x=void 0!==e?e:!x},u.component=e=>{const t=w.findComponentByKey(e);return null==t?void 0:t.instance.ctx},u.logger=()=>s,u.theme=()=>l,u.storage=d1({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(u,"interactions",{get:()=>({instances:g,on(){L(),g.forEach((e=>e.on()))},off(){q(),g.forEach((e=>e.off()))}})}),M(),n&&(k(),N(),E(n),u.element=n),u}const f2=e=>{let t=_K(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var m2=_K();function g2(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}const y2=e=>e.filter((e=>"number"==typeof e&&!isNaN(e)));const v2=e=>{let{key:t,data:n,cache:r,config:i}=e;if(!n)return;let o=n;"string"==typeof o&&(o=(e=>{let{data:t,config:n}=e;const r=t.split("\n"),i=r[0],o=r[1];let a=",";if(n&&n.parse&&n.parse.delimiter)a=n.parse.delimiter;else if(i){const e=[/,/,/\t/,/;/];for(let t=0;t<e.length;t++){const n=e[t];if(i&&o){if(n.test(i)&&n.test(o)&&i.split(n).length===o.split(n).length){a=n;break}}else n.test(i)&&(a=n)}}return r.map((e=>e.split(a)))})({data:n,config:i})),Array.isArray(o)&&function(e){let t,{source:n,data:r,cache:i,config:o}=e,a=r;const s=o&&o.parse;Array.isArray(r[0])?s&&!1===s.headers?t=r[0].map(((e,t)=>t)):(t=r[0],a=r.slice(1)):t=Object.keys(r[0]);const l=!!s&&"function"==typeof s.row&&s.row;let c,u=t;u=s&&"function"==typeof s.fields?s.fields(u.slice()):t.map((e=>({key:e,title:e}))),Array.isArray(r[0])?c=u.map((()=>[])):(c={},u.forEach((e=>{c[e.key]=[]})));for(let e=0;e<a.length;e++){const t=l?l(a[e],e,u):a[e];if(t)if(Array.isArray(t))for(let e=0;e<u.length;e++)c[e].push(t[e]);else for(let e=0;e<u.length;e++)c[u[e].key].push(t[u[e].key])}const d=Array.isArray(c)?e=>c[e]:e=>c[u[e].key];for(let e=0;e<u.length;e++){const t=d(e),r=y2(t),o=r.length>0,a=o?"measure":"dimension",s=o?Math.min(...r):NaN,l=o?Math.max(...r):NaN;i.fields.push(QJ(uY({source:n,key:e,title:u[e].title,values:t,min:s,max:l,type:a},u[e]),{value:u[e].value,label:u[e].label}))}}({data:o,cache:r,source:t,config:i})};function b2(){let{key:e,data:t,config:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[]},i={key:()=>e,raw:()=>t,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];for(let t=0;t<n.fields.length;t++)if(n.fields[t].key()===e)return n.fields[t];for(let t=0;t<n.fields.length;t++)if(n.fields[t].title()===e)return n.fields[t];return null}(e,{cache:r}),fields:()=>r.fields.slice(),extract:e=>function(e,t){const n=Array.isArray(e)?e:[e];let r=[];return n.forEach((e=>{if(void 0!==e.field){const n=t.field(e.field),i=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));const{props:o,main:a}=iZ(e,t),s=Object.keys(o),l=!!e.trackBy,c=typeof e.trackBy,u={},d=[],h=n.items(),p=[];for(let t=0;t<h.length;t++){const n=h[t];if(a.filter&&!a.filter(n))continue;const r=g2(a,n,{key:i});s.forEach((e=>{const a=o[e];let s=a.field?a.field.items()[t]:n;r[e]=g2(a,s,{key:i})})),l&&sZ({cfg:e,itemData:n,obj:r,target:d,tracker:u,trackType:c}),p.push(r)}r=l?[...r,...aZ(d,{main:a,propsArr:s,props:o})]:[...r,...p]}})),r}(e,i),hierarchy:()=>null};return v2({key:e,data:t,config:n,cache:r}),i}b2.util={normalizeConfig:iZ,collect:aZ,track:sZ};const x2=_K();x2.default("matrix"),x2("matrix",b2),x2("default",b2);const w2=_K();function S2(e,t,n){return Math.max(e,Math.min(t,n))}function C2(e){let{item:t,value:n,boxCenter:r,rendWidth:i,rendHeight:o,flipXY:a,symbol:s}=e,l="x",c="y",u=i,d=o,h=n<.5?90:-90;return a&&(l="y",c="x",u=o,d=i,h=n<.5?180:0),s(uY({},t.oob,{[l]:r*u,[c]:Math.max(t.oob.size/2,Math.min(n*d,d-t.oob.size/2)),startAngle:h}))}function M2(e){let{item:t,boxWidth:n,boxPadding:r,rendWidth:i,rendHeight:o,flipXY:a}=e,s="x",l="y",c="width",u="height",d=i,h=o;a&&(s="y",l="x",c="height",u="width",d=o,h=i);const{actualDiff:p,actualLow:f}=function(e){let{start:t,end:n,minPx:r=.1,maxPx:i=1}=e;const o=Math.max(t,n),a=Math.min(t,n),s=S2(-.1,1.2,o),l=S2(-.1,1.2,a),c=s*i-l*i,u=Math.max(r,c),d=(u-c)/2;return{actualDiff:u,startModifier:d,actualLow:l*i-d}}({start:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:h});return uY({},t.box,{type:"rect",[s]:(r+t.major)*d,[l]:f,[u]:p,[c]:n*d,data:t.data||{},collider:{type:null}})}function k2(e){let{item:t,from:n,to:r,boxCenter:i,rendWidth:o,rendHeight:a,flipXY:s}=e,l="x1",c="y1",u="x2",d="y2",h=o,p=a;return s&&(l="y1",c="x1",u="y2",d="x2",h=a,p=o),uY({},t.line,{type:"line",[d]:Math.floor(n*p),[l]:i*h,[c]:Math.floor(r*p),[u]:i*h,data:t.data||{},collider:{type:null}})}function E2(e){let{item:t,key:n,position:r,width:i,boxCenter:o,rendWidth:a,rendHeight:s,flipXY:l}=e,c="x1",u="y1",d="x2",h="y2",p=a,f=s;l&&(c="y1",u="x1",d="y2",h="x2",p=s,f=a);const m=i/2;return uY({type:"line"},t[n],{[u]:Math.floor(r*f),[c]:(o-m)*p,[h]:Math.floor(r*f),[d]:(o+m)*p,r:m*p,cx:o*p,cy:r*f,width:i*p,data:t.data||{},collider:{type:null}})}function _2(e,t,n){const{width:r,maxWidthPx:i,minWidthPx:o}=t.box,a=e>=0?1:-1;let s=Math.min(a*e*r,isNaN(i)?n:i/n);return s=isNaN(o)?s:Math.max(o/n,s),s*a}w2("native",(function(e,t,n){let 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((e=>{const t=r.events[e].bind(o);n.addEventListener(e,t),a.push({key:e,listener:t})}))}function c(){a.forEach((e=>{let{key:t,listener:r}=e;n.removeEventListener(t,r)})),a=[]}return{get key(){return i},set(e){!function(e){i=e.key,r=e,r.events=r.events||[],void 0===r.enable&&(r.enable=!0)}(e),c(),s&&l()},off(){s=!1,c()},on(){s=!0,0===a.length&&l()},destroy(){c(),o=null,r=null}}}));const R2={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}},I2=Object.keys(R2),D2={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(e){let{data:t}=e;const{width:n,height:r}=this.rect,i="horizontal"===this.settings.settings.orientation,{style:o,resolver:a,symbol:s}=this,l=I2.filter((e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show)),c={};l.forEach((e=>c[e]=R2[e]));const u=function(e){let{keys:t,data:n,defaultSettings:r,style:i,settings:o,width:a,height:s,resolver:l}=e;const c=uY(!0,{},r||{},i||{}),u={major:"horizontal"===o.orientation?s:a,minor:"horizontal"===o.orientation?a:s},d=o.major;let h;h="object"==typeof d&&"object"==typeof d.ref&&void 0!==d.ref.start&&void 0!==d.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:uY(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof d&&void 0!==d.binStart&&void 0!==d.binEnd?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:uY(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:u,defaults:{major:.5},settings:{major:o.major}});const p=o.minor||{},f={};["start","end","min","max","med"].forEach((e=>{(p[e]||n.items&&n.items.length&&n.items[0][e])&&(f[e]={scale:p.scale,ref:e})}));let m,g={major:h,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:uY(!0,{},f,p)})};for(let e=0,r=t.length;e<r;e++)o[m]&&!1===o[m].show||(m=t[e],g[m]=l.resolve({data:n,defaults:c[m],settings:o[m],scaled:u}));return g}({keys:l,data:t,defaultSettings:c,style:o,settings:this.settings.settings,width:n,height:r,resolver:a}),{settings:d,items:h}=u,p=function(e){let{width:t,height:n,flipXY:r,resolved:i,keys:o,symbol:a}=e;const s=[],l=i.major.items;if(!l.length)return s;const c=t,u=n,d=r?n:t,h=i.major.settings,p=["start","end","min","max","med"].filter((e=>void 0!==i.minor.settings[e])),f=p.length,m=o.filter((e=>"oob"!==e));let g,y,v,b,x,w,S,C,M;const k=o?o.length:0,E=m?m.length:0,_={box:function(){v.box&&gY(v.start)&&gY(v.end)&&g.push(M2({item:v,boxWidth:b,boxPadding:x,rendWidth:c,rendHeight:u,flipXY:r}))},line:function(){gY(v.min)&&gY(v.start)&&g.push(k2({item:v,from:v.min,to:v.start,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),gY(v.max)&&gY(v.end)&&g.push(k2({item:v,from:v.max,to:v.end,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},median:function(){v.median&&gY(v.med)&&g.push(E2({item:v,key:"median",position:v.med,width:b,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},whisker:function(){if(v.whisker){const e=b*v.whisker.width;gY(v.min)&&g.push(E2({item:v,key:"whisker",position:v.min,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),gY(v.max)&&g.push(E2({item:v,key:"whisker",position:v.max,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))}}};function R(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let r=0;r<f;r++)e=v[p[r]],gY(e)&&(t<e&&(t=e),n>e&&(n=e));S=t<0&&t!==-Number.MAX_VALUE,C=n>1&&n!==Number.MAX_VALUE,M=S||C}for(let e=0,t=l.length;e<t;e++){g=[],y=null;const t=l[e],n=t.data;let p=null,f=null;void 0!==h.binStart?(p=t.binStart,f=t.binEnd,y=h.binStart.scale):(y=h.major.scale,p=y?t.major:0);let I=0;y?y.bandwidth?(I=y.bandwidth(),p-=I/2):I=f-p:I=1,v=uY({},{major:p,majorEnd:f},i.minor.items[e]);for(let t=0;t<k;t++)v[o[t]]=i[o[t]].items[e];if(b=_2(I,v,d),x=(I-b)/2,w=x+v.major+b/2,R(),M)v.oob&&(S?g.push(C2({item:v,value:0,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:a})):C&&g.push(C2({item:v,value:1,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:a})));else for(let e=0;e<E;e++)v[m[e]]&&!1===v[m[e]].show||_[m[e]]();const D={type:"container",data:n,collider:{type:"bounds"},children:g};s.push(D)}return s}({width:n,height:r,flipXY:i,resolved:u,keys:l,symbol:s});return p}};const A2={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},P2=/px$/,O2={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},T2={imageSrc:void 0,imageScalingFactor:void 0,position:"center-center",symbol:"rectangle",width:void 0,height:void 0},L2={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function q2(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 N2(e,t,n,r){let{width:i,height:o}=t;return e.filter((e=>!1!==e.show&&!isNaN(e.x+e.y))).map((e=>{let t=e,a=P2.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);yY(a)&&(t=A2,a=n.min+t.size*(n.max-n.min));const[s,l]=function(e){let t=O2.shape,n={};return"object"==typeof e.shape&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),c=fY(fY({},l),{},{type:s,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,imageSettings:t.imageSettings});t===e.errorShape&&(c.width=t.width);const u=r(c);return u.data=e.data,u}))}const j2={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:e=>e.data.value},style:{item:"$shape"}},render(e){let{data:t}=e;const n=this.resolver.resolve({data:t,defaults:uY({},O2,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),{width:r,height:i}=this.rect,o=uY({},L2,this.settings.settings.sizeLimits),a=n.items;a.length>0&&"image"===a[0].shape&&t.items.forEach(((e,t)=>{a[t].imageSettings=uY({},T2,this.settings.settings.imageSettings)}));const s=function(e,t,n,r,i){const o=q2(e?e.scale:void 0,n),a=q2(t?t.scale:void 0,r);let 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,r,i,o);return N2(a,this.rect,s,this.settings.shapeFn||this.symbol)}};const z2={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function F2(e,t,n,r){let{x:i,y:o,width:a,height:s}=t;const l=XY(),c={x:i+a/2,y:o+s/2},u=Math.min(a,s)/2,d=Math.min(a,s)/2,h=d/100;return e.map(((e,t)=>{const i=n[t];i.type="path";const o=d*i.outerRadius,a=u*i.innerRadius,s=h*i.cornerRadius;l.innerRadius(a),l.outerRadius(o),l.cornerRadius(s),i.arcDatum=e;const p=l.centroid(e),f=i.offset?function(e,t,n,r){let[i,o]=e;const a=Math.sqrt(i*i+o*o);i/=a,o/=a;const s=n-r;return{x:i*t*s,y:o*t*s}}(p,i.offset,o,a):{x:0,y:0};return i.transform="translate(".concat(f.x,", ").concat(f.y,") translate(").concat(c.x,", ").concat(c.y,")"),i.desc={share:e.value/r,slice:{start:e.startAngle,end:e.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:c.x+f.x,y:c.y+f.y}}},i}))}function W2(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const $2={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(e){let{data:t}=e;const n=[],r=[],i=this.settings.settings,{items:o}=this.resolver.resolve({data:t,defaults:uY({},z2,this.style.slice),settings:i.slice});let a=0;for(let e=0,t=o.length;e<t;e++){const t=W2(i,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),r.push(o[e]),a+=t)}const s=function(){var e=rK,t=nK,n=null,r=AY(0),i=AY($Y),o=AY(0);function a(a){var s,l,c,u,d,h=a.length,p=0,f=new Array(h),m=new Array(h),g=+r.apply(this,arguments),y=Math.min($Y,Math.max(-$Y,i.apply(this,arguments)-g)),v=Math.min(Math.abs(y)/h,o.apply(this,arguments)),b=v*(y<0?-1:1);for(s=0;s<h;++s)(d=m[f[s]=s]=+e(a[s],s,a))>0&&(p+=d);for(null!=t?f.sort((function(e,n){return t(m[e],m[n])})):null!=n&&f.sort((function(e,t){return n(a[e],a[t])})),s=0,c=p?(y-h*b)/p:0;s<h;++s,g=u)l=f[s],u=g+((d=m[l])>0?d*c:0)+b,m[l]={data:a[l],index:s,value:d,startAngle:g,endAngle:u,padAngle:v};return m}return a.value=function(t){return arguments.length?(e="function"==typeof t?t:AY(+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:AY(+e),a):r},a.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:AY(+e),a):i},a.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:AY(+e),a):o},a}().sortValues(null);s.startAngle(i.startAngle),s.endAngle(i.endAngle),s.padAngle(i.padAngle);return F2(s(n),uY({},this.rect,{x:0,y:0}),r,a)}};const B2=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){const n=e[t.type],r=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach((e=>{const 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:e=>e.x1===e.x2||e.y1===e.y2,conditionAppend:e=>e.strokeWidth%2!=0},e.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:e=>e.strokeWidth%2!=0}),Object.keys(e).forEach((t=>{const n=e[t];n.items=[],n.append.forEach((e=>{n.items.push({key:e,type:"append"})})),n.round.forEach((e=>{n.items.push({key:e,type:"round"})}))})),t.multiple=e=>e.forEach((e=>t(e))),t}();class H2{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(e,t){if(t){const t=e.substring(0,1),n=e.substring(1);if("x"===t)return"y".concat(n);if("y"===t)return"x".concat(n);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}transposeCoordinate(e,t,n){if("number"==typeof t&&isFinite(t)){const 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}push(){return this.storage.push(...arguments),this}processItem(e){let t={};const n=void 0!==e.flipXY?e.flipXY:this.flipXY,r=void 0!==e.crisp?e.crisp:this.crisp;if(e.fn&&"function"==typeof e.fn){let r=n?this.height:this.width,i=n?this.width:this.height;e=e.fn({width:r,height:i,flipXY:n});const o=Object.keys(e);for(let r=0,i=o.length;r<i;r++){let i=o[r];t[H2.evaluateKey(i,n)]=e[i]}}else{const r=Object.keys(e);for(let i=0,o=r.length;i<o;i++){let o=r[i];const a=H2.evaluateKey(o,n),s=this.transposeCoordinate(a,e[o],n);t[a]=s}}return r&&B2(t),t}output(){let e=[];for(let t=0,n=this.storage.length;t<n;t++){let n=this.processItem(this.storage[t]);e.push(n)}return e}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function V2(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new H2(...t)}function G2(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const U2={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=V2(),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(){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,O0(this,"x",this.rect.width),O0(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=uY({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=uY({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=G2(this.x,this.rect.width),this.lines.y=G2(this.y,this.rect.height),this.lines.y=this.lines.y.map((e=>uY(e,{flipXY:!0})));let e=e=>{let{dir:t,isMinor:n}=e,r=this.lines[t].filter((e=>!!e.isMinor===n)),i=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:i,data:{items:r,dir:t}}).items.forEach((e=>{let n=e.data;var r,i;e.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:e.stroke||"black",strokeWidth:void 0!==e.strokeWidth?e.strokeWidth:1,strokeDasharray:void 0!==e.strokeDasharray?e.strokeDasharray:void 0,flipXY:n.flipXY||!1,value:null!==(r=n.value)&&void 0!==r?r:null===(i=n.data)||void 0===i?void 0:i.value,dir:t})}))};return e({dir:"x",isMinor:!1}),e({dir:"x",isMinor:!0}),e({dir:"y",isMinor:!1}),e({dir:"y",isMinor:!0}),this.blueprint.output()}};function Y2(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===r||"right"===r){let 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 ")}let i="bottom"===r;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(i?t+n:t-n," Z\n ")}function K2(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===r||"right"===r){let 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 ")}let i="bottom"===r;return t+=i?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(i?t+n:t-n," Z\n ")}function X2(e,t,n){return e<t||e>n}function J2(e,t){if("string"==typeof e.formatter)return t.formatter(e.formatter);if("object"==typeof e.formatter)return t.formatter(e.formatter);if(void 0!==e.scale&&e.scale.data){const t=e.scale.data()&&e.scale.data().fields;return t&&t[0]?t[0].formatter():null}return null}function Z2(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;default:return 0}return 0}function Q2(e){var t,n;let{chart:r,blueprint:i,renderer:o,p:a,settings:s,items:l,slopeLine:c}=e,u=!0,d=!1,h=!1,p=!1,f=!1,m=uY(!0,{},s.style.line,a.line||{}),g=uY(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:m.stroke});if(d=c?i.processItem({type:"line",x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:!1,value:a.valueInfo?a.valueInfo.id:a.value}):i.processItem({type:"line",x1:a.position,y1:0,x2:a.position,y2:1,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:a.flipXY||!1,value:a.valueInfo?a.valueInfo.id:a.value}),a.label&&!1!==a.label.show&&(null==c||!c.slope||0===c.slope)){const e=uY(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:m.stroke},a.label);let t,n={width:0,height:0},c="";t=J2(a,r),!1!==a.label.showValue&&(t?c=" (".concat(t(a.value),")"):a.scale&&(c=" (".concat(a.value,")"))),c&&(n=o.measureText({text:c,fontFamily:e.fontFamily,fontSize:e.fontSize}));let d=o.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),g={width:d.width+n.width,height:Math.max(d.height,n.height)},y=e.padding,v=Z2(a.flipXY?e.vAlign:e.align),b=Z2(a.flipXY?e.align:e.vAlign),x=Math.min(1+g.width+2*y,e.maxWidth*i.width,e.maxWidthPx),w=g.height+2*y,S=a.flipXY?w:x,C=a.flipXY?x:w;if(h=i.processItem({fn:t=>{let{width:n,height:r}=t,o=a.position*n-(a.flipXY?w:x)*(1-v);o=a.flipXY?o:Math.max(o,0);return{type:"rect",x:o,y:Math.max(Math.abs(b*r-C*b),0),width:a.flipXY?S:Math.min(S,i.width-o),height:C,stroke:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.background.opacity}},flipXY:a.flipXY||!1}),h.x<-1||h.x+h.width>i.width+1||h.y<-1||h.y+h.height>i.height+1)h=void 0;else{p={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:h.x+y,y:h.y+h.height/2+g.height/3,maxWidth:h.width-2*y-n.width,anchor:"start"},c&&(f={type:"text",text:c||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:p.x+3+(h.width-(n.width+2*y)),y:p.y});for(let e=0,t=l.length;e<t;e++){let t=l[e];"rect"===t.type?R1(h,t)&&(u=!1):"line"===t.type&&a.flipXY===t.flipXY&&A1(h,t)&&(u=!1)}}}if(d&&l.push(d),c&&0!==c.slope&&(!1!==(null===(t=c.label)||void 0===t?void 0:t.show)||!1!==(null===(n=c.label)||void 0===n?void 0:n.showValue))){var y,v,b;let e,t;const n=120;let s=!1!==(null===(y=c.label)||void 0===y?void 0:y.show)?null===(v=c.label)||void 0===v?void 0:v.text:"";if(!1!==(null===(b=c.label)||void 0===b?void 0:b.showValue)){var x;const t=J2(a,r),n=t?t(c.value):c.value;e="(".concat(c.slope,"x + ").concat(n,")"),s+=null!==(x=c.label)&&void 0!==x&&x.text?" ".concat(e):e}if(s.length>1){var w,S,C;const e=o.measureText({text:s,fontFamily:g.fontFamily,fontSize:g.fontSize});e.width=e.width>n?n:e.width;const a=function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});if(t>0){if(r.max()*t+n>=i.max())return!0}else if(t<0&&r.min()*t+n>=i.max())return!0;return!1}(r,c.slope,c.value)?function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});return r((i.max()-n)/t)}(r,c.slope,c.value):void 0,u=void 0===a||c.isRtl?g.padding:3*g.padding,h=void 0!==a||c.slope>0?3*g.padding:g.padding,p=function(e,t,n,r,i,o){let a=0;if(void 0!==n){if(n<.8)return a=e.slope<0||e.isRtl?3*o.padding:2*o.padding,e.isRtl,n*i.width+a;if(1===n)return e.isRtl?n*i.width-(r.width+3*o.padding):n*i.width-(r.width+6*o.padding);if(n>.8)return e.isRtl?n*i.width-(r.width+3*o.padding):n*i.width-(r.width+6*o.padding)}else if(e.slope>0)return t.x2-(r.width+2*o.padding);return e.isRtl?t.x1-(r.width+2*o.padding):t.x1}(c,d,a,e,i,g),f=Math.min(d.y1,d.y2);null!==(w=c.label)&&void 0!==w&&w.stroke&&(t={type:"rect",x:c.isRtl?Math.max(p,u)-2:Math.max(p,u)+2,y:Math.abs(Math.max(f,h)-e.height),rx:3,ry:3,width:e.width+g.padding,height:e.height-2,stroke:m.stroke,fill:m.stroke});const y={type:"text",text:s,fill:null!==(S=null===(C=c.label)||void 0===C?void 0:C.stroke)&&void 0!==S?S:m.stroke,opacity:g.opacity,fontFamily:g.fontFamily,fontSize:g.fontSize,x:t?t.x+2:Math.max(p,u)+2,y:t?t.y+e.height-g.padding:Math.abs(Math.max(f,h)-g.padding/2),anchor:"start",title:s,maxWidth:n,width:e.width};(function(e,t,n,r,i){for(let o=0,a=e.length;o<a;o++){const a=e[o];if("text"===(null==a?void 0:a.type)&&Math.abs(a.x-t.x)<Math.max(a.width+r,t.width+r)&&Math.abs(a.y-t.y)<n.height+i)return!0}return!1})(l,y,e,u,h)||(t&&l.push(t),l.push(y))}}u&&h&&p&&(l.push(h,p),f&&l.push(f))}function e5(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function t5(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function n5(e,t){const n=e.min();if(n===e.max()){const r=function(e){const 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)}function r5(e,t){return e&&t&&Math.abs(e.x-t.x)<1e-15&&Math.abs(e.y-t.y)<1e-15}const i5={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:()=>30,beforeRender(){this.blueprint=V2(),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(){let e=this.settings;if(this.lines={x:[],y:[]},this.lines.x=e.lines&&e.lines.x||[],this.lines.y=e.lines&&e.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const t={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(t5).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=n5(t,e.value);return uY(e,{scale:t,position:n})}return uY(e,{position:e.value})})),this.lines.y=this.lines.y.filter(t5).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=n5(t,e.value);return uY(e,{scale:t,position:n,flipXY:!0})}return uY(e,{position:e.value,flipXY:!0})})),this.lines.x=this.lines.x.filter((e=>!(e.position<0||e.position>1)||(t["x".concat(e.position>1?1:0)].push(e5(e)),!1))),this.lines.y=this.lines.y.filter((e=>!(!e.slope||0===e.slope)||(!(e.position<0||e.position>1)||(t["y".concat(e.position>1?1:0)].push(e5(e)),!1))));let n=[];return[...this.lines.x,...this.lines.y].forEach((r=>{if(!0===r.show||void 0===r.show){let i;if(r.slope&&0!==r.slope){const e=this.chart.scale({scale:"x"}),n=this.chart.scale({scale:"y"}),o=e.min(),a=e.max(),s=n.min(),l=n.max();i=fY(fY({},r),{},{x1:void 0,y1:void 0,x2:void 0,y2:void 0});const c=o*r.slope+r.value,u=a*r.slope+r.value,d=(s-r.value)/r.slope,h=(l-r.value)/r.slope;let p=[];X2(c,s,l)||(p[0]={x:n5(e,o),y:n5(n,c)}),X2(d,o,a)||(p[1]={x:n5(e,d),y:1}),X2(u,s,l)||(p[2]={x:n5(e,a),y:n5(n,u)}),X2(h,o,a)||(p[3]={x:n5(e,h),y:0});const f=p.filter((e=>!!e)).length;if(f>2&&function(e){r5(e[0],e[1])&&(e[1]=void 0),r5(e[1],e[2])&&(e[2]=void 0),r5(e[2],e[3])&&(e[3]=void 0),r5(e[3],e[0])&&(e[3]=void 0)}(p),p=p.filter((e=>!!e)),p.length<2)return void t["y".concat(c>l?0:1)].push(e5(r));i.x1=p[0].x,i.y1=p[0].y,i.x2=p[1].x,i.y2=p[1].y}else i=void 0;Q2({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:r,settings:e,items:n,slopeLine:i})}})),e.style.oob.show&&function(e){let{blueprint:t,oob:n,settings:r,items:i}=e;const o=Object.keys(n);let a=r.style.oob||{};for(let e=0,r=o.length;e<r;e++){const r=o[e],s=n[r];if(s.length>0){let e=r.charAt(1),n="y"===r.charAt(0),o=a.padding.x+a.width,l=a.padding.y+a.width,c="bottom";c=n?"1"===e?"bottom":"top":"1"===e?"right":"left";let u=t.processItem({fn:t=>{let{width:r,height:i}=t,u=e*r+("1"===e?-o:o),d=n?l:i-l;return"arc"===a.type?{type:"path",d:Y2(n?d:u,n?u:d,a.width,c),x:u,y:d,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0}:{type:"circle",cx:u,cy:d,r:a.width,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0,opacity:a.opacity,data:s}},flipXY:n}),d=u.cx||u.x,h=u.cy||u.y;const p=s.map((e=>e.label?"".concat(e.label," (").concat(e.value,")"):"(".concat(e.value,")"))),f=p.reduce(((e,t,n)=>0===n?t:"".concat(e,"\n\n").concat(t)),"");let m={type:"text",text:s.length||"",title:f,x:d-.4*a.width,y:h+.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},g={type:"path",d:K2(d,h,a.width,c),x:d,y:h,stroke:a.triangle.stroke,fill:a.triangle.fill,strokeWidth:a.triangle.strokeWidth||0,opacity:a.triangle.opacity};i.push(u,m,g)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function o5(e){const 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){uY(e,t.style)}(t,e),t}function a5(e){return"string"==typeof e||"number"==typeof e?e:"-"}function s5(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){const 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),c=[{x:t.x-i,y:l},{x:t.x+i,y:l}].map((e=>t1(e,r,{x:t.x,y:t.y}))),u={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},h=r>=0?[u,d]:[d,u];c.push(...h),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const 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{const r=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:r,width:n.innerRect.width,height:r<0?n.stepSize+r:n.stepSize}}const r=t.collider;r.x=Math.max(r.x,0),r.y=Math.max(r.y,0);const i=r.x+r.width-(n.outerRect.x+n.outerRect.width);r.width=i>0?r.width-i:r.width;const o=r.y+r.height-(n.outerRect.y+n.outerRect.height);r.height=o>0?r.height-o:r.height}(e,t,n)}function l5(e,t){const n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1);let r=0;if(e.tilted)r=e.stepSize*n;else{const i=t?e.textRect.height:e.textRect.width;r=Math.max(0,e.stepSize-i)*n}return r}function c5(e,t){var n,r;const i={type:"text",text:a5(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)+l5(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)+l5(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((n=>{e[n]=t.style[n]}))}(i,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){const n=0,r=t.outerRect.width,i=Math.min(t.maxWidth/2,t.textRect.width/2),o=e.x-i,a=e.x+i;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):a>r&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{const n=0,r=t.outerRect.height,i=t.maxHeight/2,o=e.y-i,a=e.y+i;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):a>r&&(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){const 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";const i=Math.cos(r)*t.maxWidth;if("bottom"===t.align==t.angle<0){const n=t.outerRect.width-t.paddingEnd;e.x+i>n&&(e.maxWidth=(n-e.x-10)/Math.cos(r))}else{const n=t.paddingEnd;e.x-i<n&&(e.maxWidth=(e.x-n-10)/Math.cos(r))}}}(i,t),function(e,t){e.boundingRect=t.textBounds(e)}(i,t),s5(e,i,t),i}function u5(e,t){const 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){uY(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){const 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 d5(e){return!e.isMinor&&e.position>=0&&e.position<=1}function h5(e){let{rect:t,state:n,majorTicks:r,measure:i,horizontal:o}=e;return o?function(e){let{majorTicks:t,measureText:n,rect:r,state:i}=e;const o="layered"===i.labels.activeMode?2:1,a=r.width,s=t.map((e=>e.label)).map((e=>"".concat(e.slice(0,1)).concat(e.length>1?"…":""))).map(n).map((e=>e.width));for(let e=0;e<t.length;++e){const n=t[e];if(o*a*Math.abs(n.start-n.end)<s[e])return!0}return!1}({majorTicks:r,measureText:i,rect:t,state:n}):function(e){let{majorTicks:t,measureText:n,rect:r}=e;const i=r.height,o=n("M").height;return!(t.length<2)&&i*Math.abs(t[0].position-t[1].position)<o}({majorTicks:r,measureText:i,rect:t})}function p5(e){let{value:t,maxValue:n,minValue:r,range:i,modifier:o}=e;return isNaN(i)||isNaN(o)||(t=i*o),t>n&&(t=n),t<r&&(t=r),t}function f5(e){let{isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:s}=e,l=0;const c={left:0,top:0,right:0,bottom:0},{maxLengthPx:u,minLengthPx:d}=a.labels;if(a.labels.show){const e=a.align,h="top"===e||"bottom"===e,p=h?n.inner.width:n.inner.height,f=o.ticks({settings:a,distance:p,formatter:r}).filter(d5),m=e=>{const t=i({text:e,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return t.width=p5({value:t.width,maxValue:u,minValue:d}),t};if(t&&h&&"auto"===a.labels.mode&&(!function(e){let{majorTicks:t,measure:n,rect:r,state:i,settings:o}=e;const a=o.labels.maxGlyphCount,s="layered"===i.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=r.width;let d=0,h=0;if(isNaN(a))for(let e=0;e<t.length;e++){const r=t[e],i=r.label,o=n(i).width*(i.length>1?l:1);if(h=s*u*Math.abs(r.start-r.end),o+c>h)return!0}else{const e=t.reduce(((e,t)=>Math.min(Math.abs(t.start-t.end),e)),1/0);if(h=s*u*e,d=n("M").width*l*a,d+c>h)return!0}return!1}({majorTicks:f,measure:m,rect:n.inner,state:s,settings:a})?s.labels.activeMode="horizontal":s.labels.activeMode="tilted"),!a.labels.filterOverlapping&&"tilted"!==s.labels.activeMode&&h5({rect:n.inner,state:s,majorTicks:f,measure:m,horizontal:h})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let g,y;if("tilted"===s.labels.activeMode){const e=Math.abs(a.labels.tiltAngle)*(Math.PI/180);g=t=>p5({value:t.width,maxValue:u,minValue:d})*Math.sin(e)+t.height*Math.cos(e)}else g=h?e=>e.height:e=>p5({value:e.width,maxValue:u,minValue:d});if(h&&"tilted"!==s.labels.activeMode)y=["M"];else if(isNaN(a.labels.maxGlyphCount))y=f.map((e=>e.label));else{let e="";for(let t=0;t<a.labels.maxGlyphCount;t++)e+="M";y=[e]}const v=y.map(m),b=v.map(g),x=Math.max(...b,0);if(l+=x,l+=a.labels.margin,"layered"===s.labels.activeMode&&(l*=2),"tilted"===s.labels.activeMode){const e="bottom"===a.align==a.labels.tiltAngle>=0,t=Math.abs(a.labels.tiltAngle)*(Math.PI/180),r=(x-m("M").height*Math.cos(t))/Math.sin(t),i=e=>Math.min(r,e.width)*Math.cos(t)+e.height,o=(t,r)=>{const i=f[r]?f[r].position:0;return e?t-i*n.inner.width:t-(1-i)*n.inner.width},s=Math.min(a.labels.maxEdgeBleed,Math.max(...v.map(i).map(o),0))+a.paddingEnd;if(c[e?"left":"right"]=s,!a.labels.filterOverlapping&&function(e){let{majorTicks:t,measureText:n,rect:r,bleedSize:i,angle:o}=e;if(t.length<2)return!1;if(0===o)return!0;const 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:f,measureText:m,rect:n,bleedSize:s,angle:a.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const m5=(e,t,n)=>e.width*Math.abs(t.position-n.position);function g5(e){let{layered:t,major:n,innerRect:r,outerRect:i,tick:o,index:a}=e;const s=t?2:1,l=n[a-s],c=n[a+s],u=l?m5(r,o,l)/2-2:1/0,d=c?m5(r,o,c)/2-2:1/0;return n.length<2?r.width:l?c?2*Math.min(u,d):(e=>{let{innerRect:t,outerRect:n,tick:r,prevWidth:i}=e;const 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),c=1===r.position?t.width/2-2:0;return Math.max(i,l,c)})({innerRect:r,outerRect:i,tick:o,prevWidth:u}):(e=>{let{innerRect:t,outerRect:n,tick:r,nextWidth:i}=e;const 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 y5(e){const t=e.innerRect,n={cx:t.width/2,cy:t.height/2},r=Math.min(t.height,t.width)/2*e.radius,i=r+e.style.strokeWidth,o={visible:!0,type:"path",arcDatum:{startAngle:e.startAngle,endAngle:e.endAngle},transform:"translate(0, 0) translate(".concat(n.cx,", ").concat(n.cy,")"),desc:{share:1,slice:{cornerRadius:0,innerRadius:r,outerRadius:i}},ticks:[]};return function(e,t){uY(e,t.style)}(o,e),o}function v5(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function b5(e,t){const n=t.innerRect,r={cx:n.width/2,cy:n.height/2},i=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o;let c=a-e.position*l;c-=Math.PI/2;const u=v5(r.cx,r.cy,i+s,c),d=v5(r.cx,r.cy,i,c),h={type:"line",x1:u.x,y1:u.y,x2:d.x,y2:d.y,value:e.value};return function(e,t){const n=fY({},t.style);uY(e,n)}(h,t),h}function x5(e){return"string"==typeof e||"number"==typeof e?e:"-"}function w5(e,t,n){let r;return r="left"===t?n.x:"right"===t?e.outerRect.width-n.x:Math.max(n.x,e.outerRect.width-n.x),r}function S5(e,t){const n=t.innerRect,r={cx:n.width/2,cy:n.height/2},i=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o,c=.2;let u,d;u="top"===t.align||"bottom"===t.align?a-e.position*l:o+e.position*l,d=u<-.2&&u>-Math.PI+c?"left":u>.2&&u<Math.PI-c?"right":"center",u-=Math.PI/2;const h=function(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}(r.cx,r.cy,i+s+6,u);let p;p="left"===d?"end":"right"===d?"start":"middle";const f={type:"text",text:x5(e.label),align:d,x:h.x,y:h.y,maxHeight:t.maxHeight,maxWidth:w5(t,d,h),anchor:p,baseline:"middle"};return function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(f,t),function(e,t){e.boundingRect=t.textBounds(e)}(f,t),function(e,t,n){let r,i;const o=parseFloat(n.fontSize)||0;r=t.y-o/2,i=e.innerRect.height-(t.y+o/2),(r<0||i<0)&&(n.text="")}(t,h,f),f}function C5(e){let t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function M5(e){let t=0;return t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function k5(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=C5(e)+e.labels.margin,t}function E5(e,t){return e.map((e=>u5(e,t)))}function _5(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function R5(e){let{textMetrics:t,settings:n,innerRect:r,scale:i,tilted:o,layered:a,tick:s}=e;const l=t.height,c=_5(i,s),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=r.width-k5(n)-n.paddingEnd;else if(a)u.width=c*r.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(r.height-k5(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*r.width;return u.width=p5({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function I5(e){let{textMetrics:t,settings:n,innerRect:r,outerRect:i,tilted:o,layered:a,tick:s,index:l,major:c}=e;const u=t.height,d={width:0,height:u};if("left"===n.align||"right"===n.align)d.width=r.width-k5(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);d.width=(r.height-k5(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else d.width=g5({layered:a,major:c,innerRect:r,outerRect:i,tick:s,index:l});return d.width=p5({value:d.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),d}function D5(e){let t;function n(){return t=I5,n}function r(){return t=R5,r}function i(e){let{settings:n,scale:r,innerRect:i,outerRect:o,measureText:a,ticks:s,state:l,textBounds:c}=e;const u=[],d=function(e){return e.filter((e=>!e.isMinor))}(s),h=function(e){return e.filter((e=>e.isMinor))}(s),p={innerRect:i,align:n.align,outerRect:o},f="tilted"===l.labels.activeMode,m="layered"===l.labels.activeMode;let g;if(n.arc&&(p.startAngle=n.arc.startAngle,p.endAngle=n.arc.endAngle,p.radius=n.arc.radius),n.line.show&&(p.style=n.line,p.padding=n.paddingStart,n.arc?u.push(y5(p)):u.push(o5(p))),n.ticks.show&&(p.style=n.ticks,p.tickSize=n.ticks.tickSize,p.padding=C5(n),n.arc?(p.padding=M5(n),g=function(e,t){return e.map((e=>b5(e,t)))}(d,p)):g=E5(d,p)),n.labels.show){const e=k5(n);p.style=n.labels,p.padding=e,p.tilted=f,p.layered=m,p.angle=n.labels.tiltAngle,p.paddingEnd=n.paddingEnd,p.textBounds=c;const s=(e,s)=>{p.textRect=function(e){let{style:t,measureText:n,tick:r}=e;return n({text:r.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:a,style:p.style});const l=t({textMetrics:p.textRect,settings:n,innerRect:i,outerRect:o,scale:r,tilted:f,layered:m,tick:e,major:d,index:s});p.maxWidth=l.width,p.maxHeight=l.height,p.stepSize=function(e){let{innerRect:t,scale:n,settings:r,tick:i}=e;return("top"===r.align||"bottom"===r.align?t.width:t.height)*_5(n,i)}({innerRect:i,scale:r,settings:n,tick:e})};let l=[];n.arc?(p.padding=function(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=M5(e)+e.labels.margin,t}(n),l=function(e,t,n){return e.map(((e,r)=>{n(e,r);const i=S5(e,t);return i.data=e.data,i}))}(d,p,s)):l=!m||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map(((e,r)=>{n(e,r);const i=c5(e,t);return i.data=e.data,i}))}(d,p,s):function(e,t,n,r){const i=t.padding,o=k5(n);return e.map(((e,a)=>{r(e,a);const s=o+t.maxHeight+n.labels.margin;t.layer=a%2,t.padding=a%2==0?i:s;const l=c5(e,t);return l.data=e.data,l}))}(d,p,n,s),n.labels.filterOverlapping&&function(e,t,n){let r=(t,n)=>R1(MY(1,e[t].boundingRect),MY(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);r=(n,r)=>{const i=1/Math.abs(e[n].x-e[r].x),o=Math.sin(t*(Math.PI/180))/i;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let i=n+1;i<=Math.min(n+5,n+(e.length-1));i++)e[n]&&e[i]&&r(n,i)&&(i===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(i,1),t&&t.splice(i,1)),i--,n--)}(l,g,p),u.push(...l)}return n.minorTicks&&n.minorTicks.show&&h.length>0&&(p.style=n.minorTicks,p.tickSize=n.minorTicks.tickSize,p.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...E5(h,p))),g&&u.push(...g),u}return n.build=i,r.build=i,e?r():n()}const A5={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"},P5={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"};const O5={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(){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(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(e){let{state:t,style:n,settings:r}=e;const i=uY(!0,{},t.isDiscrete?A5:P5,n),o=uY(!0,{},i,r.settings),a=r.layout.dock||t.defaultDock;o.dock=a,o.align=function(e,t){const 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));const{paddingStart:s,paddingEnd:l}=o;return o.paddingStart="function"==typeof s?s.call(null):s,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=D5(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=function(e,t,n){const r=t.labels.mode;return n&&e.isHorizontal?"auto"===r?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?r:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(e){const{formatter:t,state:n,scale:r}=this,i=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=T0(r,i);const o=function(e){let{isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:s}=e,l=0;const{size:c,edgeBleed:u,isToLarge:d}=f5({isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:s});if(l+=c,d)return{size:l};if(a.ticks.show&&(l+=a.ticks.margin,l+=a.ticks.tickSize),a.minorTicks&&a.minorTicks.show){const e=a.minorTicks.margin+a.minorTicks.tickSize;e>l&&(l=e)}if(a.line.show){const e=a.line.strokeWidth/2;l+=e,u[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(e)}return l+=a.paddingStart,l+=a.paddingEnd,{size:l,edgeBleed:u}}({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});return o},beforeUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{settings:t}=e;this.setState(t)},resize(e){const{inner:t,outer:n}=e,r=uY({},t,function(e){let{align:t,inner:n}=e;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 uY(this.state.innerRect,r),uY(this.state.outerRect,i),n},beforeRender(){const{scale:e,formatter:t}=this,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=T0(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter((e=>e.position>=0&&e.position<=1))},render(){const{state:e}=this,t=[];return t.push(...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})),B2.multiple(t),t}};const T5={render:()=>[]};function L5(e,t,n){let r="";if("function"==typeof e)r=e();else if("string"==typeof e)r=e;else if(n){const e=(n.data().fields||[]).map((e=>e.title()));r=e.join(t)}return r}function q5(e,t){let 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}const N5={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(){this.definitionSettings=this.settings.settings;const e=this.settings.text,t=this.definitionSettings.join;this.title=L5(e,t,this.scale)},preferredSize(){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(){const{title:e,definitionSettings:t,rect:n}=this,r=[];return r.push(function(e){let{title:t,definitionSettings:n,dock:r,rect:i,measureText:o,style:a}=e;const s={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:q5(r,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};uY(s,a.text);const l=o(s);if("top"===r||"bottom"===r){let e=i.width/2;"left"===n.anchor?e=n.paddingLeft||0:"right"===n.anchor&&(e=i.width-(n.paddingRight||0)),s.x=e,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{let e=i.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=i.height-n.paddingStart),s.y=e,s.x="left"===r?i.width-n.paddingStart:n.paddingStart,s.dx="left"===r?-l.height/3:l.height/3;const t="left"===r?270:90;s.transform="rotate(".concat(t,", ").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(e){e.settings&&(uY(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=L5(t,n,this.scale)}};function j5(e,t){const n=e.settings.layout.dock,r=e.settings.settings.invert,i="top"===n||"bottom"===n,o=i?"width":"height",a=e.rect[o],s=e.chart.scroll(e.settings.scroll);let l;{let e=t[i?"x":"y"];r&&(e=a-e);const n=s.getState();l={startOffset:e,startScroll:n.start,swipe:!1};const o=e/a*(n.max-n.min)+n.min;o<n.start?l.startScroll=o:o>n.start+n.viewSize&&(l.startScroll=o-n.viewSize)}return{update:e=>{let t=e[i?"x":"y"];if(r&&(t=a-t),!l.swipe){if(Math.abs(l.startOffset-t)<=1)return;l.swipe=!0}const n=s.getState(),o=(t-l.startOffset)/a*(n.max-n.min),c=l.startScroll+o;s.moveTo(c)},end:e=>{let t=e[i?"x":"y"];r&&(t=a-t);const n=s.getState();if(l.swipe){const e=(t-l.startOffset)/a*(n.max-n.min),r=l.startScroll+e;s.moveTo(r)}else{const e=t/a*(n.max-n.min)+n.min-n.viewSize/2;s.moveTo(e)}}}}function z5(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const F5={require:["chart","renderer"],on:{panStart(e){const t=z5(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=j5(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=z5(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=z5(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=z5(e,this.renderer);j5(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){const t=this.chart.scroll(this.settings.scroll).getState();if(t.viewSize>=t.max-t.min){return Math.max(e.width,e.height)}return this.settings.settings.width},render:function(e){const t=this.settings.layout.dock,n=this.settings.settings.invert,r="top"===t||"bottom"===t,i=r?"width":"height",o=this.rect[i],a=this.chart.scroll(this.settings.scroll).getState();let s=o*(a.start-a.min)/(a.max-a.min);const l=o*a.viewSize/(a.max-a.min);return n&&(s=o-s-l),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("div",{class:"scroller",style:{position:"absolute",[r?"left":"top"]:"".concat(s,"px"),[r?"top":"left"]:"25%",[r?"height":"width"]:"50%",[i]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function W5(e){let{h:t,isVertical:n,value:r,pos:i,align:o,borderHit:a,state:s,idx:l}=e;const c="end"!==o,u=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let d=0,h="100%",p="100%";return s.targetRect&&"start"===s.settings.bubbles.align?(h="".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,h="".concat(s.rect.width-d,"px"),p="".concat(s.rect.height-d,"px")),c||(i-=a),t("div",{onmouseover(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(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?h:"".concat(a,"px"),pointerEvents:"auto"}},[t("div",{style:uY({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function $5(e){let{h:t,isVertical:n,label:r,otherValue:i,rangeIdx:o,idx:a,pos:s,align:l,state:c,value:u}=e;const d="end"!==l,h="outside"===c.settings.bubbles.placement;let p,f="none";n?(p=d?"left":"right",h&&(f=d?"translate(-100%, 0px)":"translate(100%, 0px)")):(p=d?"top":"bottom",h&&(f=d?"translate(0px, -100%)":"translate(0px, 100%)"));let m=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===a;const g={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let y=c.style.bubble.stroke;const v=m?t("input",{type:"text",value:u,style:fY(fY({},g),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)?(y="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(y)):c.onEditConfirmed(o,t,i)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c.onEditCanceled())}}):t("div",{"data-key":[c.key,"bubble",o,a].join("-"),"data-other-value":i,"data-idx":o,"data-bidx":a,style:g},[r]);return t("div",{style:{position:"absolute",[p]:"0",[n?"top":"left"]:"".concat(s,"px"),transform:f}},[v])}function B5(e){let{h:t,isVertical:n,top:r,height:i,color:o,on:a,opacity:s}=e;return t("div",uY({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 H5(e){let{borderHit:t,els:n,isVertical:r,state:i,vStart:o,vEnd:a,idx:s}=e,l=0;i.targetRect&&(l=r?i.targetRect.y:i.targetRect.x);const c=!!i.scale,u=c?i.scale.norm(o)*i.size:o,d=c?i.scale.norm(a)*i.size:a,h=Math.abs(u-d),p=Math.min(u,d)+l,f=p+h;if(i.targetRect){const e=i.targetFillRect||i.targetRect,t=r?e.height:e.width,s=c?i.scale.norm(o)*t:o,l=c?i.scale.norm(a)*t:a,u=Math.abs(s-l),d=Math.min(s,l),h={h:i.h,isVertical:r,top:d,height:u,color:i.style.target.fill,opacity:i.style.target.opacity};i.style.target.opacity<.8&&(h.on={onmouseover(e){e.srcElement.style.opacity=i.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=i.style.target.opacity}}),n.push(i.h("div",{style:{position:"absolute",left:"".concat(e.x,"px"),top:"".concat(e.y,"px"),height:"".concat(e.height,"px"),width:"".concat(e.width,"px")}},[B5(h)]))}const m=u<d?o:a,g=u<d?a:o,[y,v]=c?i.scale.domain():[Math.min(o,a),Math.max(o,a)],b=m+1e-5>=y&&m-1e-5<=v,x=g-1e-5<=v&&g+1e-5>=y;b&&n.push(W5({h:i.h,isVertical:r,borderHit:t,value:m,pos:p,align:"start",state:i,idx:s})),x&&n.push(W5({h:i.h,isVertical:r,borderHit:t,value:g,pos:f,align:"end",state:i,idx:s}));const w=i.settings.bubbles;if(w&&w.show){w.fontSize,w.fontFamily,w.fill;const e=[o,a];b&&n.push($5({h:i.h,isVertical:r,align:w.align,rangeIdx:s,idx:0,otherValue:g,value:m,label:"".concat(i.format(m,e)),pos:p,state:i})),x&&n.push($5({h:i.h,isVertical:r,align:w.align,rangeIdx:s,idx:1,otherValue:m,value:g,label:"".concat(i.format(g,e)),pos:f,state:i}))}}function V5(e){const t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start;let r=e.current-e.start;return r=r<0?Math.max(r,n):Math.min(r,t),r}function G5(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach(((r,i)=>{e.active&&i===e.active.idx||H5({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){let 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{const t=V5(e);r=e.active.start+t,i=e.active.end+t}H5({borderHit:5,els:t,isVertical:n,state:e,vStart:r,vEnd:i,idx:e.active.idx})}return t}function U5(e){return{min:e.scale.min(),max:e.scale.max()}}function Y5(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function K5(e,t,n){let 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 X5(e){e.renderer.render(G5(e))}function J5(e,t){if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map((e=>e.id())),i=t.brushes().filter((e=>"range"===e.type&&-1!==r.indexOf(e.id)))[0];return i?i.brush.ranges():[]}function Z5(e,t){let n,r=1/0;const i=t.domain(),o=t.bandwidth()/2;for(let a=0;a<i.length;++a){const s=Math.abs(e-o-t(i[a]));s<r&&(r=s,n=i[a])}return n}function Q5(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function e3(e){const t=e.reduce(((e,t)=>(e.push(...xY(t.bounds)),e)),[]);return wY(t)}const t3={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(e){this.start(e)},rangeMove(e){this.move(e)},rangeEnd(e){this.end(e)},rangeClear(e){this.clear(e)},bubbleStart(e){this.bubbleStart(e)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(e){this.state.rect=e.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=J5(this.state,this.state.brushInstance),this.state.active=null,X5(this.state))},render(e){const t=this.settings.settings;this.state.direction="vertical"===t.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),r=this.state.rect[0===this.state.direction?"height":"width"];let i=T0(this.chart.scale(t.scale),r);const o=function(e){const 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((t=>e.chart.component(t))).filter((e=>!!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){const r=e3(i);if(t.size=r[0===e.state.direction?"height":"width"],t.scale=T0(e.chart.scale(n.scale),t.size),t.targetRect=r,o.length>0){const e=e3(o);t.targetFillRect=e}}else if(r&&r.length>0){const n=r.slice(1).reduce(((e,t)=>({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:n.x0-e.state.rect.x,y:n.y0-e.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return t}(this);if(i=o.scale?o.scale:i,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?r:o.size,this.state.settings=t,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof t.brush?t.brush.context:t.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.onEditConfirmed=(e,t,n)=>{this.state.edit=null,function(e,t,n,r){let i=e.ranges.map((e=>({min:e.min,max:e.max})));const 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]=fY({},i[t]);const s=e.scale.data();s&&s.fields&&s.fields.forEach((t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),i)}))}(this.state,e,t,n),this.emit("bubbleEnd"),X5(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,X5(this.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 t.bubbles.label&&((e,n)=>t.bubbles.label.call(void 0,{datum:e,data:n,scale:i,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(i,"norm")){this.state.editable=!0,this.state.observeBrush="object"==typeof t.brush&&t.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=i;const e=this.state.scale.data();!this.state.format&&e&&e.fields&&e.fields[0]&&(this.state.format=e.fields[0].formatter())}else this.state.editable=!1,this.state.scale=NQ(),this.state.scale.data=i.data,this.state.format||(this.state.format=(e,t)=>Q5(i.range(),t)?function(e,t){const n=t.ticks(),r=t.domain().indexOf(Z5(e,t));return-1!==r?n[r].label:"-"}(e,i):"-"),this.state.fauxBrushInstance=w0(),this.state.findValues=e=>function(e,t){const n=t.domain(),r=t.range(),i=[];return e.forEach((e=>{if(!Q5(r,[e.min,e.max]))return;const o=n.indexOf(Z5(e.min,t)),a=n.indexOf(Z5(e.max,t));i.push.apply(i,n.slice(Math.min(o,a),Math.max(o,a)+1))})),i}(e,i);return this.state.ranges=J5(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[G5(this.state)]:[]},mounted(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start(e){!function(e){let{state:t,e:n,renderer:r,ranges:i,targetSize:o}=e;if(t.started)return;t.edit=null;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);const c={started:!0};t.offset=uY({},r.element().getBoundingClientRect());const u=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);const h=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];c.current=t.scale.normInvert(p/t.size),c.start=t.scale.normInvert(h/t.size);let f=t.ranges;const m=U5(t);let g,y,v=-1;if(l&&l.hasAttribute("data-idx"))v=parseInt(l.getAttribute("data-idx"),10),m.min=v>0?f[v-1].max:m.min,m.max=v+1<f.length?f[v+1].min:m.max;else{for(g=0;g<f.length;g++){if(f[g].min<=c.start&&c.start<=f[g].max){v=g,m.min=g?f[g-1].max:m.min,m.max=g+1<f.length?f[g+1].min:m.max;break}if(c.start<f[g].min){m.max=f[g].min,m.min=g?f[g-1].max:m.min;break}}-1===v&&f.length&&g>=f.length&&(m.min=f[f.length-1].max)}if(-1!==v||t.multi||(c.ranges=[],m.min=t.scale.min(),m.max=t.scale.max()),-1!==v)if(y={idx:v,start:f[v].min,end:f[v].max,limitLow:m.min,limitHigh:m.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{let e=t.scale.norm(y.start)*t.size,n=t.scale.norm(y.end)*t.size;Math.abs(h-e)<=o?(c.start=y.end,y.mode="modify"):Math.abs(h-n)<=o&&(c.start=y.start,y.mode="modify")}else y={idx:-1,start:c.start,end:c.current,limitLow:m.min,limitHigh:m.max,mode:"current"};c.active=y,"modify"!==y.mode&&t.targetRect&&!D1(t.targetRect,{x:u,y:d})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:J5,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=U5(e);K5(e,e.current,n)}(this.state,J5),X5(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(e){this.state.started&&(!function(e,t){const 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){let t=e.ranges.map((e=>({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{const n=V5(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)});const n=e.scale.data();n&&n.fields&&n.fields.forEach((n=>{if(e.fauxBrushInstance){let r=J5(e,e.fauxBrushInstance),i=e.findValues(r),o=e.findValues(t),a=o.filter((e=>-1===i.indexOf(e))),s=i.filter((e=>-1===o.indexOf(e))),l=a.map((e=>({key:n.id(),value:e}))),c=s.map((e=>({key:n.id(),value:e})));e.brushInstance.addAndRemoveValues(l,c),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)}))}(this.state),X5(this.state))},clear(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart(e){if(!this.state.editable)return;const 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))return;this.state.edit=r,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const i=n.parentNode;X5(this.state);const o=i.querySelector("input");o.focus(),o.select()}};function n3(e){e.renderer.render(G5(e))}function r3(e){return e.rc.ranges()}function i3(e,t){const 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)}const o3={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(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaClear(e){this.clear(e)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(e){this.state.rect=this.rect;const t=this.settings.settings,n="vertical"===t.direction?0:1,r=this.state.rect[0===n?"height":"width"],i=this.renderer.element().getBoundingClientRect(),o=(t.target?t.target.components||[t.target.component]:[]).map((e=>this.chart.component(e))).filter((e=>!!e&&!!e.rect)),a=o[0]?o.slice(1).reduce(((e,t)=>({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:o[0].rect.x,y0:o[0].rect.y,x1:o[0].rect.x+o[0].rect.width,y1:o[0].rect.y+o[0].rect.height}):null;return this.state.targetRect=a?{x:a.x0-this.rect.x,y:a.y0-this.rect.y,width:a.x1-a.x0,height:a.y1-a.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=n,this.state.settings=t,this.state.offset=i,this.state.rc=c0(),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.size=r,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){const r=Math.min(...n),i=Math.max(...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"-";const s=a.reduce(((n,i)=>{const 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(((e,t)=>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(e){!function(e){let{state:t,e:n,renderer:r,ranges:i,targetSize:o}=e;if(t.started)return;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);const c={started:!0};t.offset=r.element().getBoundingClientRect(),t.ranges=i(t);const u=a-t.offset.left,d=s-t.offset.top,h=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];let f=p,m=h;c.start=h,c.current=p;let g=t.ranges;const y=Y5(t);let v,b,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),y.min=x>0?g[x-1].max:y.min,y.max=x+1<g.length?g[x+1].min:y.max;else{for(v=0;v<g.length;v++){if(g[v].min<=m&&m<=g[v].max){x=v,y.min=v?g[v-1].max:y.min,y.max=v+1<g.length?g[v+1].min:y.max;break}if(m<g[v].min){y.max=g[v].min,y.min=v?g[v-1].max:y.min;break}}-1===x&&g.length&&v>=g.length&&(y.min=g[g.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(b={idx:x,start:g[x].min,end:g[x].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),b.mode="modify";else{let e=b.start,t=b.end;Math.abs(h-e)<=o?(c.start=b.end,b.mode="modify"):Math.abs(h-t)<=o&&(c.start=b.start,b.mode="modify")}else b={idx:-1,start:m,end:f,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=b,"modify"!==b.mode&&t.targetRect&&!D1(t.targetRect,{x:u,y:d})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:r3,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=Y5(e);K5(e,e.current,n)}(this.state,r3),n3(this.state))},move(e){this.state.started&&(!function(e,t){const 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){const t=e.ranges.map((e=>({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{const n=V5(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);let n=[];t.forEach((t=>{n=[...n,...i3(e,t)]})),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),n3(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function a3(e){const t="vertical"===e.direction,n=e.rect[t?"height":"width"],r=e.rect[t?"width":"height"];return function(e){const t=e.brush;if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map((e=>e.id())),i=t.brushes().filter((e=>"range"===e.type&&-1!==r.indexOf(e.id)))[0];return i?i.brush.ranges():[]}(e).map((i=>{const 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 s3(e,t,n,r){function i(){!function(e){e.renderer.render(a3(e))}(e)}function o(){!function(e){e.renderer.render(a3(e))}(e)}function a(){!function(e){e.renderer.render(a3(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 l3(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}const c3={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",r="horizontal"===n?this.rect.width:this.rect.height,i=T0(this.chart.scale(e.scale),r);return l3(this.state),s3(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,a3(this.state)},beforeDestroy(){l3(this.state)}};function u3(e,t){const n=t.center.x,r=t.center.y;return{x:n-e.left,y:r-e.top}}function d3(e,t,n){return Z0(e,t.points[0])<n.settings.snapIndicator.threshold**2}function h3(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 p3(e){let{state:t,start:n=null,end:r=null}=e;null!==n&&(t.snapIndicator.x1=n.x,t.snapIndicator.y1=n.y),null!==r&&(t.snapIndicator.x2=r.x,t.snapIndicator.y2=r.y)}function f3(e,t){e.snapIndicator.visible=t}const m3={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(e){this.start(e)},lassoEnd(e){this.end(e)},lassoMove(e){this.move(e)},lassoCancel(){this.cancel()}},created(){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(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){const n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=function(e){return e.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"})))}(this.settings);const n=u3(this.state.rendererBounds,e);h3(this.state,n),p3({state:this.state,start:n}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,n)},move(e){if(!this.state.active)return;const t=u3(this.state.rendererBounds,e);d3(t,this.state,this.settings)?f3(this.state,!0):f3(this.state,!1),h3(this.state,t),p3({state:this.state,end:t}),function(e,t){const n=[e.startPoint,e.path,e.snapIndicator].filter((e=>e.visible));t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){const 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;const i=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(i,{components:e.brushConfig})}}(this.state,this.chart)},end(e){if(!this.state.active)return;f3(this.state,!1);d3(u3(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){const n=e.componentDelta.x,r=e.componentDelta.y,i=e.points.map((e=>({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(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{e.contexts.forEach((e=>{t.brush(e).end()}))})),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 g3(e,t,n,r,i){let o,a=0,s=t.length-1;for(;a<s;){let l=Math.floor((a+s)/2);o=i(t[l]),o[n]+o[r]<e[n]?a=l+1:s=l}return a}function y3(e){let{orientation:t,targetNodes:n,labels:r,container:i}=e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g3;const a=[],s="v"===t?"x":"y",l="v"===t?"width":"height",c=e=>e.textBounds,u=e=>e.node.localBounds;return(e,t)=>{const{textBounds:d,node:h}=r[t];if(d[s]<i[s]||d[s]+d[l]>i[s]+i[l])return!1;for(let e=o(d,a,s,l,c);e<a.length;e++)if(R1(d,a[e].textBounds))return!1;const p=o(d,n,s,l,u),f=d[s]+d[l];for(let e=p;e<n.length;e++){const t=n[e].node;if(f<t.localBounds[s])break;if(R1(d,t.localBounds)&&h!==t)return!1}return a.push(r[t]),!0}}const v3=4;function b3(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function x3(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function w3(e){return fY(fY({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds),{},{data:"".concat(e.data," ").concat(e.text),rotation:e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal"})}function S3(e,t,n){return n?e.width>=t.height:e.width>=t.width}function C3(e,t,n){return n?e.height>=t.width:e.height>=t.height}function M3(e,t,n,r,i){let o,a;return"v"===e?(o=r||i||S3(t,n,!0),a=C3(t,n,!r)):(o=S3(t,n),a=i||C3(t,n,!1)),o&&a}function k3(e,t,n,r){return e+.5*t+(r-.5)*(t-n)-.5*n}function E3(e,t,n){const 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 S3(e,t,n.rotate)&&C3(e,t,n.rotate)}(e,i,n))return!1;const o=.5*i.height;return n.rotate?(r.x=k3(e.x,e.width,i.height,n.align)+o,r.y=k3(e.y,e.height,i.width,n.justify),"right"===n.dock?r.transform="rotate(90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,") translate(").concat(i.width,", 0)"):r.transform="rotate(-90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,")")):(r.x=k3(e.x,e.width,i.width,n.align),r.y=k3(e.y,e.height,i.height,n.justify)+o),r}function _3(e){let{bar:t,view:n,direction:r,position:i,padding:o=v3,measured:a}=e;const s={};if(uY(s,t),i&&"inside"!==i)if("up"===r||"down"===r){const e=Math.max(0,Math.min(t.y,n.height)),o=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===i&&"up"===r||"opposite"===i&&"down"===r?(s.y=0,s.height=e):("outside"===i&&"down"===r||"opposite"===i&&"up"===r)&&(s.y=o,s.height=n.height-o)}else{const e=Math.max(0,Math.min(t.x,n.width)),o=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===i&&"left"===r||"opposite"===i&&"right"===r?(s.x=0,s.width=e):("outside"===i&&"right"===r||"opposite"===i&&"left"===r)&&(s.x=o,s.width=n.width-o)}else;return function(e,t){const 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,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{top:r=v3,bottom:i=v3,left:o=v3,right:a=v3}=n,s="function"==typeof o?o(t):o,l="function"==typeof a?a(t):a,c="function"==typeof r?r(t):r,u="function"==typeof i?i(t):i;e.x+=s,e.width-=s+l,e.y+=c,e.height-=c+u}(s,a,o),s}function R3(e){let t,n,r,i,o,{direction:a,fitsHorizontally:s,measured:l,node:c,orientation:u,placementSettings:d,rect:h}=e,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_3;const f=[],m="h"===u?"width":"height";for(o=0;o<d.length;o++)if(r=d[o],i=p({bar:c.localBounds,view:h,direction:a,position:r.position,padding:r.padding,measured:l}),f.push(i),t=!o||i[m]>t[m]?i:t,M3(u,i,l,s,r.overflow)){n=i;break}return n||(n=t,o=f.indexOf(n)),r=d[o],{bounds:n,placement:r}}function I3(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{top:o=v3,bottom:a=v3,left:s=v3,right:l=v3}=i,c="function"==typeof s?s(t):s,u="function"==typeof l?l(t):l,d="function"==typeof o?o(t):o,h="function"==typeof a?a(t):a,p=e.x+e.dx,f=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),y=.5*t.height,v=1e-9;return{x:(n?p-y:p)-c-v,y:(n?f:f-y)-d-v,width:g+(c+u)-v,height:m+(d+h)-v}}function D3(e){let{chart:t,targetNodes:n,rect:r,fitsHorizontally:i,collectiveOrientation:o}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:R3,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:E3,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:y3;const c=[],u={container:r,targetNodes:n,labels:[],orientation:o};let d,h,p,f,m,g,y,v,b,x,w,S,C,M;for(let e=0,l=n.length;e<l;e++){g=null,h=n[e],p=h.node,C=b3(p,t),b=h.direction,M="left"===b||"right"===b?"h":"v";for(let t=0;t<h.texts.length;t++){if(f=h.texts[t],!x3(f))continue;x=h.labelSettings[t],v=h.measurements[t],S=x.placements;const n=a({direction:b,fitsHorizontally:i,lblStngs:x,measured:v,node:p,orientation:M,placements:S,placementSettings:h.placementSettings[t],rect:r});if(g=n.bounds,w=n.placement,g&&w){var k;m=w.justify;const t="function"==typeof x.linkData?x.linkData(C,e):void 0,n="function"==typeof w.overflow?w.overflow(C,e):w.overflow;"up"===b&&(m=1-m),"opposite"===w.position&&(m=1-m),"left"===b&&(m=1-m);const r=!("h"===o||i);if(d=s(g,f,{justify:"h"===M?w.align:m,align:"h"===M?m:w.align,fontSize:x.fontSize,fontFamily:x.fontFamily,textMetrics:v,rotate:r,overflow:!!n,dock:null!==(k=x.dock)&&void 0!==k?k:"left"}),d){const n=I3(d,v,r,g,w.padding);y="function"==typeof w.fill?w.fill(fY(fY({},C),{},{textBounds:n}),e):w.fill,d.fill=y,void 0!==t&&(d.data=t),"object"==typeof w.background&&(d.backgroundColor="function"==typeof w.background.fill?w.background.fill(fY(fY({},C),{},{textBounds:n}),e):w.background.fill,void 0!==d.backgroundColor&&(d.backgroundBounds=I3(d,v,r,g,w.background.padding))),c.push(d),u.labels.push({node:p,textBounds:n})}}}}const E=c.filter(l(u));return[...E.filter((e=>void 0!==e.backgroundBounds)).map(w3),...E]}function A3(e){const t=2*Math.PI;return(e%t+t)%t}function P3(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function O3(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function T3(e,t,n){let{x:r,y:i}=t;if(r*r+i*i>e*e)return null;let o=Math.sin(n),a=Math.cos(n),s=r*a-i*o,l=e*e-s*s;if(l<0)return null;let c=Math.sqrt(l);return{x:s*a+o*c,y:-s*o+a*c}}function L3(e){let t,n,{radius:r,size:i,angle:o}=e,{width:a,height:s}=i,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=T3(r,l,o),!t)return null;t.y*=-1,n={x:-a,y:0};break;case 1:if(t=T3(r,l,Math.PI-o),!t)return null;n={x:-a,y:-s};break;case 2:if(t=T3(r,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-s};break;case 3:if(t=T3(r,l,2*Math.PI-o),!t)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 q3(e){let{slice:t,measured:n,padding:r}=e,{start:i,end:o,innerRadius:a,outerRadius:s}=t,l=s-a-2*r,c=o-i;if(c<Math.PI){let e=(n.height/2+r)/Math.tan(c/2);e>a&&(l=s-e-2*r)}if(l<0||l<n.minReqWidth)return null;const u=A3((i+o)/2);let d=s-r,h={x:Math.sin(u)*d,y:-Math.cos(u)*d,width:l,height:n.height};return u<Math.PI?(h.angle=u-Math.PI/2,h.anchor="end"):(h.angle=u+Math.PI/2,h.anchor="start"),h}function N3(e){let{context:t,node:n,bounds:r}=e;let{start:i,end:o}=n.desc.slice;const a=A3((i+o)/2);switch(Math.floor(a/(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 j3(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function z3(e,t,n){const 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)){let t=e.angle*(360/(2*Math.PI));r.transform="rotate(".concat(t,", ").concat(r.x,", ").concat(r.y,")")}return r}function F3(e){let t,n,{slice:r,direction:i,position:o,padding:a,measured:s,view:l,context:c,store:u}=e,{start:d,end:h,innerRadius:p,offset:f}=r;switch(o){case"into":t="rotate"===i?q3({slice:r,measured:s,padding:a}):function(e){let{slice:t,padding:n,measured:r}=e,{start:i,end:o,innerRadius:a,outerRadius:s}=t;const l=A3((i+o)/2);let c=L3({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",A1(c,{x1:0,y1:0,x2:Math.sin(i)*s,y2:-Math.cos(i)*s})||A1(c,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||S1({cx:0,cy:0,r:a},c)?null:(P3(c,n),c)):null}({slice:r,measured:s,padding:a});break;case"inside":n={start:d,end:h,innerRadius:0,outerRadius:p},t="rotate"===i?q3({slice:n,measured:s,padding:a}):function(e){let{slice:t,padding:n,measured:r,store:i}=e;const{start:o,end:a,outerRadius:s}=t,l=A3((o+a)/2);let c=L3({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",P3(c,n),i.insideLabelBounds.some((e=>R1(e,c)))?null:(i.insideLabelBounds.push({x:c.x-4,y:c.y,width:c.width+8,height:c.height}),c)):null}({slice:n,measured:s,padding:a,store:u});break;case"outside":t="rotate"===i?function(e){let{slice:t,measured:n,padding:r,view:i}=e,{start:o,end:a,outerRadius:s,offset:l}=t,c=s+r,u=a-o;if(u<Math.PI&&(n.height/2+r)/Math.tan(u/2)>c)return null;const d=A3((o+a)/2);let h=Math.sin(d)*c,p=-Math.cos(d)*c,f=n.width+1,m=d%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){let e=p<0?i.y:i.y+i.height,t=Math.abs(e-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*r-s;t<f&&(f=t)}if(Math.sin(m)>.001){let e=h<0?i.x:i.x+i.width,t=Math.abs(e-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*r-s;t<f&&(f=t)}if(f<=0||f<n.minReqWidth)return null;let g={x:h,y:p,width:f,height:n.height};return d<Math.PI?(g.angle=d-Math.PI/2,g.anchor="start"):(g.angle=d+Math.PI/2,g.anchor="end"),g}({slice:r,measured:s,padding:a,view:l}):function(e){let{slice:t,measured:n,padding:r,view:i,context:o}=e,{start:a,end:s,outerRadius:l,offset:c}=t;const u=A3((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(u/(Math.PI/2)),i))return null;let d=l+r+n.height/2,h=Math.sin(u)*d,p=-Math.cos(u)*d,f=n.width+1;if(u<Math.PI){let e=Math.abs(i.x+i.width-(h+c.x));e<f&&(f=e)}else{let e=Math.abs(i.x-(h+c.x));e<f&&(f=e)}if(f<n.minReqWidth)return null;let m={x:h,y:p,width:f,height:n.height};return u<Math.PI?m.anchor="start":m.anchor="end",m}({slice:r,measured:s,padding:a,view:l,context:c});break;default:throw new Error("not implemented")}return t&&(t.x+=f.x,t.y+=f.y,"outside"===o&&"rotate"!==i&&function(e,t,n){const{start:r,end:i,offset:o,outerRadius:a}=n,s=A3((r+i)/2);switch(Math.floor(s/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){let n=Math.min(e.y,t.q1maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){let n=Math.max(e.y,t.q2minY),r=n-e.y;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){let n=Math.max(e.y,t.q3minY),r=n-e.y;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){let n=Math.min(e.y,t.q4maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}}}(t,c,r)),t}function W3(e){let{context:t,direction:n,measured:r,node:i,placementSettings:o,rect:a,store:s}=e,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F3;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,slice:i.desc.slice,view:a,direction:n,position:c.position,measured:r,padding:c.padding,store:s});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function $3(e,t,n){const 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}const B3=/\n+|\r+|\r\n/,H3=/\s/,V3=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function G3(e){return"string"==typeof e?-1!==e.search(B3):-1!==String(e).search(B3)}function U3(e){return-1!==e.search(H3)}function Y3(e){return-1!==e.search(V3)}function K3(e,t,n){return Math.max(t,Math.min(n,e))}function X3(){let{string:e,separator:t="",reverse:n=!1,measureText:r=e=>({width:e.length,height:1}),mandatoryBreakIdentifiers:i=[G3],noBreakAllowedIdentifiers:o=[],suppressIdentifier:a=[U3,G3,e=>""===e],hyphenationIdentifiers:s=[Y3]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=String(e).split(t);!function(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}(l);const c=l.length,u=n?e=>e>=0:e=>e<c;let d=n?c:-1;function h(e){const t=K3(e,0,c-1),n=l[t],u=r(n),d=function(e,t,n,r,i){return r.some((r=>r(e,t,n)))?1:i.some((r=>r(e,t,n)))?0:2}(n,t,l,i,o);return{index:t,value:n,breakOpportunity:d,suppress:a.some((e=>e(n,t,l))),hyphenation:s.some((e=>e(n,t,l))),width:u.width,height:u.height,done:!1}}return{next:function(e){return isNaN(e)?n?d--:d++:d=K3(e,0,c-1),u(d)?h(d):{done:!0}},peek:h,length:c}}const J3="…",Z3=/^\s*\d+(\.\d+)?px\s*$/i;function Q3(e){return"string"===typeof e&&Z3.test(e)}function e6(e){const t=e["font-size"]||e.fontSize;return Q3(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function t6(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const r=e6(e);return Math.max(1,Math.min(Math.floor(t/r),n))}function n6(e,t){return{lines:[],line:"",width:0,maxLines:t6(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function r6(e){e.lines.push(e.line),e.line="",e.width=0}function i6(e,t){e.line+=t.value,e.width+=t.width}function o6(e,t,n){if(t.width>e.maxWidth)return t;const r=t.index;for(let i=1;i<5;i++){const 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 a6(e,t,n){const r=X3({string:t.value,measureText:n});for(;e.lines.length<e.maxLines;){let t=r.next();if(t.done)break;e.width+t.width>e.maxWidth&&2===t.breakOpportunity&&e.line.length>0?(t=e.hyphens.enabled?o6(e,t,r):t,r6(e),i6(e,t)):i6(e,t)}}function s6(e,t){const n=X3({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),r=n6(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){r6(r),i=!1;break}1===e.breakOpportunity?r6(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?r.width+=e.width:(e=r.hyphens.enabled?o6(r,e,n):e,r6(r),i6(r,e)):i6(r,e)}return{lines:r.lines,reduced:i}}function l6(e,t){const n=X3({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),r=n6(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){r6(r),i=!1;break}1===e.breakOpportunity?r6(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?r6(r):e.width>r.maxWidth?a6(r,e,t):(r6(r),i6(r,e)):i6(r,e)}return{lines:r.lines,reduced:i}}function c6(e){return{"break-all":s6,"break-word":l6}[e.wordBreak]}function u6(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const r=c6(n);if(!r)return;const i=e(n);if(i.width>n.maxWidth||G3(n.text)){const o=(e6(n)-i.height)/2,a=r(n,function(e,t){return n=>t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}(n,e));t.node=function(e,t,n,r){const i={type:"container",children:[]};void 0!==t.id&&(i.id=t.id);let o=0;return e.lines.forEach(((a,s)=>{const l=uY({},t);l.text=a,l._lineBreak=!0,o+=n,e.reduced&&s===e.lines.length-1?l.text+=J3: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 d6(e,t){const n=e["font-family"]||e.fontFamily,r=e["font-size"]||e.fontSize,i="string"==typeof e.text?e.text:"".concat(e.text),{maxWidth:o}=e;if(void 0===o)return i;let a=t({text:i,fontSize:r,fontFamily:n}).width;if(a<=o)return i;let s=0,l=i.length-1;for(;s<=l;){let e=Math.floor((s+l)/2);a=t({text:i.substr(0,e)+J3,fontSize:r,fontFamily:n}).width,a<=o?s=e+1:l=e-1}return i.substr(0,l)+J3}function h6(e){const t=e.baseline||e["dominant-baseline"];let n=0;const 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}const p6={},f6={},m6={fontSize:void 0,fontFamily:void 0};let g6;function y6(e,t){return!e&&!t||e===t}function v6(e){let{text:t,fontWeight:n,fontSize:r,fontFamily:i}=e;const o="".concat(t," ").concat(n," ").concat(r," ").concat(i);return"number"!=typeof f6[o]&&(g6=g6||document.createElement("canvas").getContext("2d"),function(e){let{fontWeight:t,fontSize:n,fontFamily:r}=e;y6(m6.fontWeight,t)&&y6(m6.fontSize,n)&&y6(m6.fontFamily,r)||(g6.font=[t,n,r].filter((e=>!!e)).join(" "),m6.fontWeight=t,m6.fontSize=n,m6.fontFamily=r)}({fontWeight:n,fontSize:r,fontFamily:i}),f6[o]=g6.measureText(t).width),f6[o]}function b6(e){return"number"!=typeof p6[e]&&(p6[e]=function(e){if(Q3(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),p6[e]}function x6(e){let{text:t,fontWeight:n,fontSize:r,fontFamily:i}=e;return{width:v6({text:t,fontWeight:n,fontSize:r,fontFamily:i}),height:b6(r)}}function w6(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:x6;const 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,c={x:0,y:s+((e.dy||0)+h6(e))-.75*i.height,width:o,height:i.height},u=e["text-anchor"]||e.anchor;return c.x="middle"===u?a+l-o/2:"end"===u?a+l-o:a+l,c}function S6(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:x6;const n=c6(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||G3(e.text))){const o=n(e,(e=>t({text:e,fontFamily:i,fontSize:r}))),a=uY({},e);let s=0,l="";for(let e=0,n=o.lines.length;e<n;e++){let a=o.lines[e];a+=e===n-1&&o.reduced?J3:"";const c=t({text:a,fontSize:r,fontFamily:i}).width;c>=s&&(s=c,l=a)}a.text=l;const c=w6(a,t);return c.height=e6(e)*o.lines.length,c}return w6(e,t)}function C6(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function M6(e,t,n){const 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;const 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 k6(e){let{cx:t,cy:n,r:r}=e;return{type:"circle",bounds:{cx:t,cy:n,r:r}}}function E6(e){return e.desc&&e.desc.slice?function(e){let{start:t,end:n,innerRadius:r,outerRadius:i,offset:o}=e;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let a=0!==r?r:i;return k6({cx:o.x,cy:o.y,r:a})}(e.desc.slice):"circle"===e.type?k6(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var _6={bar:function(e){let{settings:t,chart:n,nodes:r,rect:i,renderer:o,style:a}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:D3;const l=uY({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map((e=>uY({},l,t,e))),u=t.labels.map((e=>e.placements.map((n=>uY({},l,t,e,n))))),{fitsHorizontally:d,hasHorizontalDirection:h,targetNodes:p}=function(e){let{nodes:t,rect:n,chart:r,labelSettings:i,placementSettings:o,settings:a,renderer:s}=e;const l={},c=[];let u,d,h,p,f,m,g,y=!0,v=!1;for(let e=0;e<t.length;e++){if(d=t[e],p=d.localBounds,!R1(p,n))continue;let b=b3(d,r);u={node:d,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<i.length;t++)m=i[t],h="function"==typeof m.label?m.label(b,e):void 0,x3(h)&&(g="function"==typeof a.direction?a.direction(b,e):a.direction||"up",v=v||"left"===g||"right"===g,l.fontFamily=m.fontFamily,l.fontSize="".concat(m.fontSize,"px"),l.text=h,f=s.measureText(l),u.measurements.push(f),u.texts.push(h),u.labelSettings.push(m),u.placementSettings.push(o[t]),u.direction=g,y=y&&f.width<=p.width-2*v3);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:v}}({nodes:r,chart:n,renderer:o,settings:t,rect:i,labelSettings:c,placementSettings:u}),f=function(e){let{orientation:t="auto",defaultOrientation:n="h"}=e;switch(t.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return n}}({orientation:t.orientation,defaultOrientation:h?"h":"v"}),m="h"===f?"y":"x",g="h"===f?"height":"width";return p.sort(((e,t)=>e.node.localBounds[m]+e.node.localBounds[g]-(t.node.localBounds[m]+t.node.localBounds[g]))),s({chart:n,targetNodes:p,stngs:t,rect:i,fitsHorizontally:d,collectiveOrientation:f})},slice:function(e){let{settings:t,chart:n,nodes:r,rect:i,renderer:o,style:a}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:W3,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:z3;const c=uY({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);c.fontSize=parseInt(c.fontSize,10);const u=t.labels.map((e=>uY({},c,t,e))),d=t.labels.map((e=>e.placements.map((n=>uY({},c,t,e,n))))),h=[],p={insideLabelBounds:[]};r=function(e){const t=[],n=[],r=[],i=[];for(let o=0;o<e.length;++o){const{start:a,end:s}=e[o].desc.slice,l=A3((a+s)/2);switch(Math.floor(l/(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])}}const o=(e,t)=>A3((e.desc.slice.start+e.desc.slice.end)/2)-A3((t.desc.slice.start+t.desc.slice.end)/2),a=(e,t)=>o(t,e);return t.sort(a),n.sort(o),r.sort(a),i.sort(o),t.concat(n,i,r)}(r);const f={};for(let e=0,t=r.length;e<t;e++){const t=r[e],a=j3(t,n);for(let n=0;n<u.length;n++){const r=u[n],c="function"==typeof r.label?r.label(a,e):"";if(!c)continue;const m="function"==typeof r.direction?r.direction(a,e):r.direction||"horizontal",g="function"==typeof r.linkData?r.linkData(a,e):void 0,y=$3(c,r,o),v=s({context:f,direction:m,lblStngs:r,measured:y,node:t,placementSettings:d[n],rect:i,store:p}),b=v.bounds,x=v.placement;if(b&&x){if("outside"===x.position&&"rotate"!==m){N3({context:f,node:t,bounds:b});if(!f1(O3(b),i))continue}const n="function"==typeof x.fill?x.fill(a,e):x.fill,o=l(b,c,{fill:n,fontSize:r.fontSize,fontFamily:r.fontFamily,textMetrics:y});o&&(void 0!==g&&(o.data=g),h.push(o),b.line&&(b.line.stroke=n,h.push(b.line)))}}}return h},rows:function(e){let{settings:t,chart:n,nodes:r,renderer:i,style:o}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:M6;const s=uY({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);const l=uY({},s,t),c=t.labels.map((e=>uY({},l,e))),u={},d=[];for(let e=0,t=r.length;e<t;e++){let t=r[e],o=C6(t,n),{type:s,bounds:h}=E6(t);if(!h)continue;let p,f=0,m=[],g=[],y="circle"===s?2*h.r*.9:h.height;for(f+=l.padding,p=0;p<c.length;p++){let t=c[p],n="function"==typeof t.label?t.label(o,e):"";u.fontFamily=t.fontFamily,u.fontSize="".concat(t.fontSize,"px"),u.text=n;let r=i.measureText(u);if(f+=r.height+t.padding,f>y)break;g.push(n),m.push(r)}const v=p,b=Math.max(0,y-f);let x;for(x="circle"===s?h.cy-.9*h.r:h.y,x+=l.justify*b+l.padding,p=0;p<v;p++){let t,n=c[p];if("circle"===s){let e=Math.max(Math.abs(x-h.cy),Math.abs(x+m[p].height-h.cy)),n=Math.sqrt(h.r*h.r-e*e);t={x:h.cx-n+l.padding,y:x,width:2*n-2*l.padding,height:m[p].height}}else t={x:h.x+l.padding,y:x,width:h.width-2*l.padding,height:m[p].height};x+=m[p].height+l.padding;let r="function"==typeof n.fill?n.fill(o,e):n.fill;const u="function"==typeof n.linkData?n.linkData(o,e):void 0;let f=a(t,g[p],{fill:r,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:m[p]});if(f){if(f.text&&f.text!==J3){const e=d6(f,i.measureText);if(J3===e)continue;f.ellipsed=e}void 0!==u&&(f.data=u),d.push(f)}}}return d}};const R6={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach((e=>{e.strategy&&_6[e.strategy.type]&&e.component&&t.push(...function(e,t){let{chart:n,source:r,rect:i,renderer:o,style:a}=e;if(!n.component(r.component))return[];const s=n.findShapes(r.selector).filter((e=>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:this.chart,rect:this.rect,renderer:this.renderer,source:e,style:this.style},_6[e.strategy.type]))})),t}};const I6={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,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}};function D6(e){let{x:t=0,y:n,item:r,globalMetrics:i,createSymbol:o,direction:a="ltr"}=e,s=r.label.displayObject,l=r.label.bounds,c=r.symbol.meta;const u="rtl"===a;let d={x:u?t+i.maxLabelBounds.width:t+i.maxSymbolSize+i.spacing,y:n,width:i.maxLabelBounds.width,height:Math.max(i.maxSymbolSize,i.maxLabelBounds.height)},h=function(e,t,n){const 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:u?t+i.maxLabelBounds.width+i.spacing:t,y:n,width:i.maxSymbolSize,height:d.height},c.size,{align:void 0===c.align?.5:c.align,justify:void 0===c.justify?.5:c.justify});const p=o(uY({},c,h));return delete p.collider,s.anchor=u?"end":"start",function(e,t,n){const r=n.textMetrics;if(e.height<r.height)return!1;const i=Math.max(0,e.width-r.width);t.baseline="text-before-edge";const 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)}(d,s,{textMetrics:l,fontSize:parseInt(s.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:r.label.displayObject.data,children:[p,s],collider:{type:"rect",x:t,y:n,width:i.maxItemBounds.width,height:i.maxItemBounds.height}},metrics:d}}function A6(e,t){const 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 P6(e,t){let n,r,i,o,{onScroll:a=()=>{}}=t,s=null,l=0;const c={itemize:t=>{n=function(e,t){let n,r,{resolved:i,dock:o}=e,a=[],s=i.items.items,l=i.symbols.items,c=i.labels.items,u=0,d=0,h=0;for(let e=0;e<s.length;e++){if(!1===s[e].show)continue;const i=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=uY({},c[e],{type:"text",fontSize:"".concat(parseInt(c[e].fontSize,10),"px"),text:i,title:i}),r={symbol:{meta:l[e]},label:{displayObject:n,bounds:t.textBounds(n)}},a.push(r),u=Math.max(l[e].size,u),d=Math.max(r.label.bounds.width,d),h=Math.max(r.label.bounds.height,h)}return{items:a,globalMetrics:{spacing:8,maxSymbolSize:u,maxItemBounds:{height:Math.max(u,h),width:u+8+d},maxLabelBounds:{width:d,height:h}},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),s=isNaN(n.layout.scrollOffset)?s:n.layout.scrollOffset},getItemsToRender:t=>{i=t.viewRect,l=c.getContentOverflow(i);const a=c.extent();s=Math.max(0,Math.min(s,l)),o=uY({},i);const u="horizontal"===c.orientation()?"x":"y";return o[u]-=s,o["x"===u?"width":"height"]=a,function(e,t,n){let{viewRect:r}=e,{itemized:i,create:o=D6,parallels:a,createSymbol:s}=n;const l=i.layout.direction,c=i.globalMetrics,u=i.items,d="horizontal"===i.layout.orientation;let h=0;const p=[],f=c.maxItemBounds.height,m=c.maxItemBounds.width,g=i.layout.margin.vertical+f,y=i.layout.margin.horizontal+m;let v=t.x,b=t.y,x=r.x-t.x;for(let e=0;e<u.length;e++){let n=o({y:b,x:"rtl"===l?r.x+x+r.width-m-(v-t.x):v,item:u[e],globalMetrics:c,direction:l,createSymbol:s});if((d&&v>=r.x-m||!d&&b>=r.y-f)&&p.push(n.item),h++,h>=a?(h=0,d?(v+=y,b=t.y):(b+=g,v=t.x)):d?b+=g:v+=y,!d&&b>r.y+r.height)break;if(d&&v>r.x+r.width)break}return p}(t,o,{itemized:n,parallels:r,createSymbol:e.symbol})},parallelize:(e,t)=>(r=function(e,t,n){const 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];let s=Math.ceil(a/e);if(null!=t){const e="horizontal"===n.layout.orientation?"height":"width",r="width"===e?"horizontal":"vertical",i=n.layout.margin[r]||4,o=Math.floor((t+i)/(i+n.globalMetrics.maxItemBounds[e]));s=Math.min(s,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(s,l))}(e,t,n),r),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return A6(n,r)>i[e]},getContentOverflow:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;const t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,A6(n,r)-e[t])},getNextSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},hasNext:()=>"horizontal"===c.orientation()?i.x+i.width<o.x+o.width:i.y+i.height<o.y+o.height,hasPrev:()=>"horizontal"===c.orientation()?o.x<i.x:o.y<i.y,next:()=>{c.scroll(-c.getNextSize())},prev:()=>{c.scroll(c.getPrevSize())},scroll:e=>{const t=Math.max(0,Math.min(l,s-e));t!==s&&(s=t,a())},offset:()=>s,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>A6(n,r),spread:()=>function(e,t){const 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 O6(e){return Object.keys(e).filter((t=>e[t])).join(" ")}const T6={up:"▲",right:"▶",down:"▼",left:"◀"};function L6(e,t){let{size:n,isActive:r,direction:i,nav:o,attrs:a}=t,s={},l="";const c=a;o&&o.button&&("function"==typeof o.button.class?s=o.button.class({direction:i}):o.button.class&&(s=o.button.class),"function"==typeof o.button.content&&(l=o.button.content(e,{direction:i})),void 0!==o.button.tabIndex&&(c.tabindex=o.button.tabIndex));const u={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(s).length||(u.border="0",u.background="none"),(!r||o&&o.disabled)&&(c.disabled="disabled"),e("button",uY({class:O6(s),style:u},c),[l||e("span",{style:{pointerEvents:"none"}},[T6[i]])])}function q6(e){let t;const n={itemize:e=>{t=function(e){let{dock:t,navigation:n}=e;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:n}}(e)},render:r=>function(e,t,n,r){let{rect:i,itemRenderer:o}=t;if(!e||!e.renderArgs)return;e.size(i);const a=e.renderArgs[0],s="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void e.render([]);const d=s?["right","left"]:["down","up"];l&&s&&d.reverse();const h=[a("div",{style:{position:"relative",display:"flex","flex-direction":s?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!s?"rtl":"ltr"},[L6(a,{size:32,isActive:c,direction:d[0],attrs:{"data-action":"next","data-component-key":r.settings.key},nav:n.navigation}),L6(a,{size:32,isActive:u,direction:d[1],attrs:{"data-action":"prev","data-component-key":r.settings.key},nav:n.navigation})])];e.render(h)}(n.renderer,r,t,e),extent:()=>32,spread:()=>64};return n}function N6(e){let t;const n={itemize:n=>{t=function(e,t){let{resolved:n}=e;if(!1===n.title.item.show)return null;const r=uY({},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){const e=t.scale.data().fields;r.text=e&&e[0]?e[0].title():""}return{displayObject:r,bounds:t.renderer.textBounds(r)}}(n,e)},render:e=>{!function(e,t,n){let{rect:r}=e;if(!t)return;const i=[];if(t.size(r),n){const e={start:0,end:r.width,middle:r.width/2};i.push(uY({},n.displayObject,{x:e[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(i)}(e,n.renderer,t)},spread:()=>t?t.bounds.height:0,extent:()=>t?t.bounds.width:0};return n}function j6(e,t,n,r){let i,o,a,{itemRenderer:s,navigationRenderer:l,titleRenderer:c,isPreliminary:u=!1}=r,d=0;const h={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(i={x:h.x,y:h.y,width:h.width,height:c.spread()},"horizontal"===n){i={x:h.x,y:h.y,width:c.extent(),height:c.spread()};const e=h.width-i.width-(i.width?t.spacing:0),n=h.height;s.parallelize(e,u?void 0:n);const r=s.extent()>e?l.extent():0,p=s.spread(),f=r?l.spread():0;o={x:i.x+i.width+(i.width?t.spacing:0),y:h.y+Math.max(0,(f-p)/2),width:h.width-r-i.width-(r?t.spacing:0)-(i.width?t.spacing:0),height:n},a={x:o.x+o.width+(r?t.spacing:0),y:h.y,width:r,height:h.height},i.y=o.y;"rtl"===s.direction()&&(a.x=h.x,o.x=a.x+a.width+(a.width?t.spacing:0),i.x=o.x+o.width+(i.width?t.spacing:0)),d=Math.max(i.height,f,s.spread())}else{const e=h.height-i.height-(i.height?t.spacing:0),n=h.width;s.parallelize(e,u?void 0:n);const r=s.extent()>e?l.extent():0;a={x:h.x,y:h.y+h.height-r,width:h.width,height:r},o={x:h.x,y:i.y+i.height+(i.height?t.spacing:0),width:h.width,height:h.height-i.height-(i.height?t.spacing:0)-a.height-(a.height?t.spacing:0)},d=Math.max(c.extent(),r?l.spread():0,s.spread())}return o=uY({},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:uY({},e,i),content:uY({},e,o),navigation:uY({},e,a),orientation:n,preferredSize:d}}function z6(e){e.state.resolved=function(e){const t=e.scale.domain();let n={items:[]};const r=e.settings.layout.dock;if("threshold-color"===e.scale.type){const i=e.scale.data().fields[0];let o=e=>String(e);e.settings.formatter?o=e.chart.formatter(e.settings.formatter):i&&(o=i.formatter());for(let e=0;e<t.length-1;e++){const r={value:t[e],label:"".concat(o(t[e])," - < ").concat(o(t[e+1]))};i&&(r.source={field:i.id()}),n.items.push(r)}"vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")&&n.items.reverse()}else{const r=e.scale.labels?e.scale.labels():null;n.items=t.map(((t,n)=>{const i=e.scale.datum?uY({},e.scale.datum(t)):{value:t};return i.value=t,e.scale.label?i.label=e.scale.label(t):r&&(i.label=r[n]),i}))}const i=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:uY(!0,{},I6.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:I6.layout,settings:e.settings.settings.layout}),a=e.resolver.resolve({data:n,defaults:uY(!0,{},I6.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),s=uY(!0,{},(e.settings.settings.item||{}).shape);void 0===s.fill&&e.settings.scale&&(s.fill={scale:e.settings.scale});const l=e.resolver.resolve({data:n,defaults:uY(!0,{},I6.item.shape,e.style.item.shape),settings:s}),c=e.resolver.resolve({data:n,defaults:uY(!0,{},{show:I6.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function u(e,n){let r=e.data.value,i=t[n+1];e.data.value=[r,i]}"threshold-color"===e.scale.type&&("vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")?(c.items.reverse().forEach(u),c.items.reverse()):c.items.forEach(u));return{title:i,labels:a,symbols:l,items:c,layout:o}}(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 F6(e){const{rect:t,settings:n,state:r,itemRenderer:i,navigationRenderer:o,titleRenderer:a}=e,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",c=j6(t,r.display,l,{itemRenderer:i,navigationRenderer:o,titleRenderer:a});e.renderer.size(c.content);let u=i.getItemsToRender({viewRect:uY({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:i}),a.render({rect:c.title}),e.state.views={layout:c},u}const W6={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(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(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart(){if(this.state.interaction.started)return;this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove(e){if(!this.state.interaction.started)return;const 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(){this.state.interaction.started=!1},scroll(e){this.itemRenderer.scroll(-e)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const e=F6(this);this.update(e)},this.itemRenderer=P6(this,{onScroll:this.onScroll}),this.navigationRenderer=q6(this),this.titleRenderer=N6(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),z6(this)},preferredSize(e){return function(e,t){let n=0;const r=e.settings.layout.dock||"center",i="top"===r||"bottom"===r?"horizontal":"vertical",o=e.state.display,a=j6(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,n}(this,e)},beforeUpdate(){z6(this)},render(){return F6(this)},beforeDestroy(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo(){return{offset:this.itemRenderer.offset()}}};function $6(e,t){let n=0;const 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 B6(e,t,n){const r=n[e];return"object"==typeof r?-1!==r.valid.indexOf(t)?t:r.default:n.default}function H6(e){return B6(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 V6(e,t){const 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 G6(e){const t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,r=e.chart.scale(e.stgns.fill),i=e.chart.scale(e.stgns.major),o=function(e,t){const n=t.domain();let r=n,i=e.stgns.tick.label;!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));const o=n.map(((n,i)=>{const 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})}}));return o}(e,i),a=function(e){return B6(e.layout.dock,e.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"})}(e.settings);if(void 0===n.text){const e=i.data().fields;n.text=e&&e[0]?e[0].title():""}const s=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),l=e.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),c={isVertical:t,nodes:[],title:{anchor:H6(e.settings),textMetrics:s,textBounds:l,requiredWidth:()=>{if(!n.show)return 0;let e=l.width,r=n.maxLengthPx;return t||(e+=n.padding,r+=n.padding),Math.min(e,r,c.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let e=l.height;return t&&(e+=n.padding),Math.min(e,c.rect.height)}},ticks:{values:o,anchor:a,length:Math.min(Math.max(...o.map((e=>e.textMetrics.width))),e.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===a?Math.max(...c.ticks.values.map((e=>e.textMetrics.height)))+e.stgns.tick.padding:0,height:Math.max(...o.map((e=>e.textMetrics.height)))},legend:{fillScale:r,majorScale:i,length:()=>{const n=t?"height":"width",r=t?"requiredHeight":"requiredWidth",i=Math.min(c.rect[n],c.rect[n]*e.stgns.length)-c.title[r]();return Math.max(0,Math.min(i,e.stgns.maxLengthPx))}}};return c}const U6={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(e){const t=this.state;t.rect=V6(this,e.inner);let n=this.stgns.size;const r=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=r;const i=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){const e=t.ticks.values.reduce(((e,t)=>e+t.textMetrics.height),0);if(e>this.state.legend.length())return i;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return i;n+=Math.max(...t.ticks.values.map((e=>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(){this.stgns=this.settings.settings,this.state=G6(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=G6(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=V6(this,e.size),this.stgns.title.show){const e=function(e){const t=e.state,n=e.stgns,r="left"===t.ticks.anchor,i="top"===t.ticks.anchor;let 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");const 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 $6(e,l),l}(this);this.state.nodes.push(e)}const t=function(e){const t=e.state.legend.fillScale,n=e.state.legend.majorScale,r=t.domain().map((e=>({type:"stop",color:t(e),offset:Math.min(1,Math.max(0,n.norm(e)))})));return r.sort(((e,t)=>e.offset-t.offset))}(this),n=function(e,t){const n=e.state,r=e.stgns,i=n.rect;let 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());const c={type:"rect",x:o,y:a,width:s,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return $6(e,c),c}(this,t),r=function(e,t){const n=e.state,r=e.stgns;let i="start";const 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((a=>{let s=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=t.y+t.height*a.pos,u=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,c-=.25*a.textMetrics.height,i=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+r.tick.padding,c=.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:c,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:u}}));return{type:"container",id:"legend-seq-ticks",children:[...a,o]}}(this,n),i={id:"legend-seq-target",type:"container",children:[n,r]};this.state.nodes.push(i)},render(){return this.state.nodes}};const Y6={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},layers:{curve:"linear",show:!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 K6(e,t){let{generatorType:n,item:r,data:i,major:o,minor:a,layerObj:s,stngs:l}=t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:e,generatorType:n,major:o,minor:a,layerObj:s,stngs:l,opacity:r.opacity,stroke:r.stroke,strokeWidth:r.strokeWidth,strokeLinejoin:r.strokeLinejoin,fill:c||r.fill,data:i};return r.strokeDasharray&&(u.strokeDasharray=r.strokeDasharray),u}function X6(e){const{metaLayers:t,coordinates:n,layers:r,lines:i,areas:o}=function(e){let{data:t,stngs:n,rect:r,resolver:i,style:o,domain:a}=e;const{width:s,height:l}=r,c=i.resolve({data:t,defaults:Y6.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:s,minor:"vertical"===n.orientation?s:l}}),u=!n.connect&&a.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),d={};let h=0;for(let e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(u){const e=d[n]?d[n].items[d[n].items.length-1]:null,r=e?a.indexOf(e.data.major?e.data.major.value:e.data.value):null;e&&a.indexOf(t.data.major?t.data.major.value:t.data.value)-1!==r&&d[n].items.push({dummy:!0})}d[n]=d[n]||{order:h++,id:n,items:[],dataItems:[],consumableData:{}},d[n].dataItems.push(t.data),d[n].items.push(t)}const p=Object.keys(d).map((e=>(d[e].consumableData=fY({points:d[e].dataItems},d[e].dataItems[0]),d[e]))),f={items:p.map((e=>e.consumableData))},m=n.layers||{};return{coordinates:c,metaLayers:p,layers:i.resolve({data:f,defaults:{curve:Y6.layers.curve,show:Y6.layers.show},settings:{curve:m.curve,show:m.show}}),lines:i.resolve({data:f,defaults:uY({},Y6.layers.line,o.line),settings:m.line}),areas:i.resolve({data:f,defaults:uY({},Y6.layers.area,o.area),settings:m.area})}}(e),a=[];return t.forEach(((t,s)=>{const l=r.items[s];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=t.id;const c=[],u=[];let d,h;for(let r=0;r<t.items.length;r++){if(d=t.items[r],h=d.data,!d.dummy){if(isNaN(d.major))continue;e.missingMinor0&&(d.minor0=n.settings.minor.scale?n.settings.minor.scale(h.minor0?h.minor0.value:0):0),isNaN(d.minor)||c.push(d.minor),l.data.push(d.data)}u.push(d)}const p=c.sort(((e,t)=>e-t))[Math.floor((c.length-1)/2)];a.push({layerObj:l,lineObj:i.items[s],areaObj:o.items[s],median:p,points:u,consumableData:t.consumableData})})),a}const J6={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(e){let{data:t}=e;const{width:n,height:r}=this.rect;this.stngs=this.settings.settings||{};const i=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,o=X6({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:i,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){const e=o.map((e=>({id:e.layerObj.id,data:e.layerObj.data}))).sort(this.stngs.layers.sort).map((e=>e.id));o.sort(((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id)))}else o.sort(((e,t)=>e.median-t.median));return function(e,t){let{width:n,height:r,missingMinor0:i,stngs:o}=t;const a=[],s=o.layers||{};return e.forEach((e=>{const{lineObj:t,layerObj:l,areaObj:c,points:u}=e;let d={size:r,p:"y"},h={size:n,p:"x"};if("vertical"===o.orientation){const e=uY(!0,{},h);h=uY(!0,{},d),d=uY(!0,{},e)}s.area&&!1!==c.show&&a.push(K6(u,{data:e.consumableData,item:c,generatorType:"area",major:h,minor:d,layerObj:l,stngs:o})),t&&!1!==t.show&&(a.push(K6(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"1"),major:h,minor:d,layerObj:l,stngs:o},"none")),!i&&s.area&&!1!==c.show&&!1!==t.showMinor0&&a.push(K6(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"0"),major:h,minor:d,layerObj:l,stngs:o},"none")))})),a}(o,{width:n,height:r,missingMinor0:i,stngs:this.stngs})}};function Z6(e,t){let n,r,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof t.center?(n=t.center.x,r=t.center.y):(n=t.clientX,r=t.clientY);const 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 Q6(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function e4(e,t){const 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}}const t4={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const t=Z6(this,e,!1);D1({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=function(e){return e.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"})))}(this.settings),this.state.start=Z6(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=Z6(this,e),function(e){if(e.state.active){const t=Q6(e,e.state.start),n=Q6(e,e.state.end),r=e.chart.shapesAt(e4(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(r,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([uY({type:"rect"},e4(t.state.start,t.state.end),t.style.area)]))},end(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{Array.isArray(e.contexts)&&e.contexts.forEach((e=>{t.brush(e).end()}))})),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function n4(e,t,n){let{renderer:r,style:i,props:o,h:a}=n;const 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),c=a("div",{dir:o.direction,class:O6(uY({"pic-tooltip":!0},s.tooltip)),style:uY({position:"relative",display:"inline-block"},t.computedTooltipStyle)},a("div",{style:i.content,class:O6(uY({"pic-tooltip-content":!0},s.content))},l),a("div",{class:O6(uY({"pic-tooltip-arrow":!0},s.arrow)),style:uY({},i.arrow,i["arrow-".concat(t.dock)],t.computedArrowStyle)}));return r.render(c),r.element().children[0]}function r4(e){let{defaultDuration:t,defaultDelay:n}=e,r=null,i=null,o=!1;const a=function(){const e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return e.set=e=>{n=e,t[n].forEach((t=>t(e)))},e.on=(e,n)=>{Array.isArray(e)?e.forEach((e=>t[e].push(n))):t[e].push(n)},e.destroy=()=>{Object.keys(t).forEach((e=>{t[e].length=0}))},e}(),s=function(){},l=()=>{r=null,i=null,o=!1,a.set("fulfilled")};return s.invoke=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;r&&(clearTimeout(r),a.set("debounced")),a.set("pending"),r=setTimeout((()=>{e(),o=!0,r=null,a.set("active")}),c),s>0&&(i&&clearTimeout(i),i=setTimeout(l,s+Math.max(c,0)))},s.clear=()=>{o?a.set("cancelled"):r&&(clearTimeout(r),a.set("rejected")),i&&clearTimeout(i),r=null,i=null,o=!1},s.on=(e,t)=>{a.on(e,t)},s.destroy=()=>{s.clear(),a.destroy()},s}function i4(){let 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)"),inside:"translate(-50%, -50%)"}}function o4(e,t){let 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},inside:{x:-e/2,y:-t/2}}}function a4(e,t){const n=e>0?"-":"+";return e=Math.abs(e),void 0===t&&(t=e),{left:{left:"100%",top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},top:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"100%",borderWidth:"".concat(t,"px")},bottom:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(t,"px")},inside:{left:"0px",top:"0px",borderWidth:"0px"}}}function s4(e,t,n,r,i,o){const a=t+o.x,s=n+o.y,l=i;return!(a<0||s<0)&&!(a+r>e.width||s+l>e.height)}function l4(e){let{area:t,vx:n,vy:r,width:i,height:o,offset:a}=e;const s=n+a.x,l=r+a.y,c=i,u=o;let d=s<0?-s:0,h=l<0?-l:0;return d+=s+c>t.width?-(s+c-t.width):0,h+=l+u>t.height?-(l+u-t.height):0,{x:d,y:h}}function c4(e){let{options:t,pointer:n,width:r,height:i,dockOrder:o,x:a,y:s}=e;const{targetBounds:l}=n,c=i4(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u},computedArrowStyle:a4(t.offset)[t.dock],dock:t.dock};const d={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},h=o4(r,i,t.offset),p=[],f="target"===t.area?a:l.left+a,m="target"===t.area?s:l.top+s;for(let e=0;e<o.length;e+=1){const n=o[e],l=l4({area:d,vx:f,vy:m,width:r,height:i,offset:h[n]}),u={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c[n]},g=a4(t.offset)[n];0!==l.x&&(u.width="".concat(r-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(a+l.x,"px"),g.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:g,dock:n,rect:{width:r,height:i}};if(0===l.x&&0===l.y)return y;y.offset=l,p.push(y)}return p.sort(((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x))),p[0]}function u4(e,t,n){const 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}};const i=r.rect;return uY({scaleRatio:i.scaleRatio},i.computedInner)}const d4={bounds:function(e){let{resources:t,nodes:n,pointer:r,width:i,height:o,options:a}=e;const{targetBounds:s}=r,{x:l,y:c,width:u,height:d}=t.getNodeBoundsRelativeToTarget(n[0]),h={left:{x:l,y:c+d/2},right:{x:l+u,y:c+d/2},top:{x:l+u/2,y:c},bottom:{x:l+u/2,y:c+d},inside:{x:l+u/2,y:c+d/2}},p=i4(a.offset),f=p[a.dock];if(f)return{computedTooltipStyle:{left:"".concat(h[a.dock].x,"px"),top:"".concat(h[a.dock].y,"px"),transform:f},computedArrowStyle:a4(a.offset)[a.dock],dock:a.dock};const m={width:"target"===a.area?s.width:window.innerWidth,height:"target"===a.area?s.height:window.innerHeight},g=o4(i,o,a.offset),y=["top","left","right","bottom","inside"];for(let e=0;e<y.length;e+=1){const t=y[e];if(s4(m,"target"===a.area?h[t].x:s.left+h[t].x,"target"===a.area?h[t].y:s.top+h[t].y,i,o,g[t]))return{computedTooltipStyle:{left:"".concat(h[t].x,"px"),top:"".concat(h[t].y,"px"),transform:p[t]},computedArrowStyle:a4(a.offset)[t],dock:t}}const v=function(e){let{options:t,docks:n,dockOffsets:r,targetBounds:i,area:o,width:a}=e;const s="top",l="target"===t.area?n[s].x:i.left+n[s].x,c=("target"===t.area?n[s].y:(i.top,n[s].y),r[s]),u=l+c.x,d=(c.y,a);let h=n.top.x;return u<0&&u+d>o.width||(u<0?h-=u:u+d>o.width&&(h-=u+d-o.width)),h}({options:a,docks:h,dockOffsets:g,targetBounds:s,area:m,width:i});return{computedTooltipStyle:{left:"".concat(v,"px"),top:"".concat(h.top.y,"px"),transform:p.top},computedArrowStyle:a4(a.offset+v-h.top.x,a.offset).top,dock:"top"}},pointer:function(e){let{options:t,pointer:n,width:r,height:i}=e;const{x:o,y:a}=n;return c4({x:o,y:a,pointer:n,width:r,height:i,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){let{options:t,pointer:n,width:r,height:i,nodes:o,resources:a}=e;const s=o[0],{dx:l,dy:c}=n,u=a.getComponentBoundsFromNode(s),d=l+u.x+u.width/2,h=c+u.y+u.height/2,{start:p,end:f,outerRadius:m}=s.desc.slice,g=(p+f)/2-Math.PI/2,y=2*Math.PI,v=(g%y+y)%y;let b=["top","left","right","bottom"];return"auto"===t.dock&&(b=v<=Math.PI/4||v>=7*Math.PI/4?["right","top","bottom","left"]:v<=3*Math.PI/4?["bottom","left","right","top"]:v<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),c4({x:d+m*u.scaleRatio.x*Math.cos(v),y:h+m*u.scaleRatio.y*Math.sin(v),pointer:n,width:r,height:i,options:t,dockOrder:b})}};function h4(e,t){let{width:n,height:r}=e,{chart:i,state:o,props:a}=t;const s={resources:{formatter:i.formatter,scale:i.scale,component:i.component,getComponentBoundsFromNode:e=>u4(e,o.pointer,i),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const r=u4(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=typeof a.placement;if("object"===l&&"function"==typeof a.placement.fn)return a.placement.fn(s);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=uY(c,a.placement(s))),"object"===l&&d4[a.placement.type]?c=uY(c,a.placement):"string"===l&&d4[a.placement]&&(c=uY(c,{type:a.placement})),s.options=c;const u=d4[c.type](s);let{x:d,y:h,width:p,height:f}=s.resources.getComponentBoundsFromNode(s.nodes[0]);return d+=s.pointer.dx,p+=d,h+=s.pointer.dy,f+=h,u.computedTooltipStyle.left="".concat(Math.min(Math.max(0,d,parseFloat(u.computedTooltipStyle.left)),p),"px"),u.computedTooltipStyle.top="".concat(Math.min(Math.max(0,h,parseFloat(u.computedTooltipStyle.top)),f),"px"),u}let p4;function f4(){p4=null}const m4={duration:8e3,delay:500,filter:e=>e.filter((e=>e.data&&void 0!==e.data.value)),extract:e=>e.node.data.value,content:e=>{let{h:t,data:n}=e;return n.map((e=>t("div",{},e)))},isEqual:(e,t)=>e.length&&e.length===t.length&&e.every(((e,n)=>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};const g4={require:["chart","renderer"],defaultSettings:{settings:m4,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(){this.hide()},show(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent(e){this.prevent(e)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(e){let t,{nodes:n,duration:r,delay:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(e,t){let{chart:n,state:r}=t,i=0,o=0;e.center?(i+=e.center.x,o+=e.center.y):(i+=e.clientX,o+=e.clientY);const a=n.element.getBoundingClientRect(),s=r.targetElement.getBoundingClientRect(),l=i,c=o,u=a.left-s.left,d=a.top-s.top,h=i-a.left,p=o-a.top;return i-=s.left,o-=s.top,{x:i,y:o,dx:u,dy:d,cx:h,cy:p,clientX:l,clientY:c,targetBounds:s,chartBounds:a}}(e,this),t=Array.isArray(n)?this.props.filter(n):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((()=>this.invokeRenderer(this.state.activeNodes)),r,i)))},prevent(e){this.state.prevent=!!e},init(e){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=r4({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",(()=>{!function(e){p4&&p4!==e&&p4()}(t),p4=t,"function"==typeof this.props.beforeShow&&this.props.beforeShow.call(void 0,{resources:{formatter:this.chart.formatter,scale:this.chart.scale}})})),this.dispatcher.on(["cancelled","fulfilled"],(()=>{const e={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,uY({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,uY({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),p4===t&&(p4=null),this.state.tooltipElm=void 0})),this.dispatcher.on("active",(()=>{"function"==typeof this.props.afterShow&&this.props.afterShow.call(void 0,{element:this.state.tooltipElm,resources:{formatter:this.chart.formatter,scale:this.chart.scale}})}))},created(){this.init(this.settings)},beforeUpdate(e){let{settings:t}=e;this.dispatcher&&(this.dispatcher.destroy(),f4()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),f4()},appendTo(){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;const{width:e,height:t}=this.state.targetElement.getBoundingClientRect();this.renderer.destroy(),this.renderer.size({width:e,height:t}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(e){const t=function(e,t){let{chart:n,scale:r,props:i,h:o}=t;const a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:r,h:o},s=[];return e.forEach((e=>{if("function"==typeof i.extract){const t=uY({node:e},a);s.push(i.extract(t))}})),s}(e,this),n=h4(n4(t,{},this).getBoundingClientRect(),this);this.state.tooltipElm=n4(t,n,this)}};const y4={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes(this.props.selector).filter((e=>e.key===this.props.target)),t=e.filter((e=>e.collider)).map((e=>e.collider));t.forEach((e=>{e.fill=this.props.fill,e.stroke=this.props.stroke,e.opacity=this.props.opacity,e.collider={type:null}})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var v4={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},b4=/([astvzqmhlc])([^astvzqmhlc]*)/gi,x4=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function w4(e){const t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(b4,((e,n,r)=>{const i=function(e){const t=e.match(x4);return t?t.map(Number):[]}(r);let o=n.toLowerCase(),a=n;if("m"===o&&i.length>2&&(t.push([a,...i.splice(0,2)]),o="l",a="m"===a?"l":"L"),i.length<v4[o])return"";for(t.push([a,...i.splice(0,v4[o])]);i.length>=v4[o]&&i.length&&v4[o];)t.push([a,...i.splice(0,v4[o])]);return""})),t}const S4=2*Math.PI;function C4(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function M4(e,t,n,r,i){const o=1-e;return o**3*t+3*o**2*e*n+3*o*e**2*r+e**3*i}function k4(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||function(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))}(e,t,n,r)<=10)return i[i.length-1]!==e&&i.push(e),i.push(r),i;const a=C4(e,t),s=C4(t,n),l=C4(n,r),c={x:M4(.5,e.x,t.x,n.x,r.x),y:M4(.5,e.y,t.y,n.y,r.y)},u=C4(a,s),d=C4(s,l);return k4(e,a,u,c,i,o-1),k4(c,d,l,r,i,o-1),i}function E4(e,t,n){const{cp1:r,cp2:i}=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 k4(e,r,i,n)}function _4(e,t,n){const r=[],i=!!e[4],o=!!e[5],a=e[3];let s,l,c,u,d=e[6],h=e[7],p=e[1],f=e[2];if("a"===e[0]&&(d+=t,h+=n),t===h&&n===h)return r;if(!p||!f)return r.push({x:d,y:h}),r;({cx:s,cy:l,rx:p,ry:f,sweepAngle:c,startAngle:u}=function(e,t,n,r,i,o,a,s,l){let c,u,d,h,p,f;const m=V0(n%360),g=Math.cos(m),y=Math.sin(m),v=(s-o)/2,b=(l-a)/2,x=g*v+y*b,w=g*b-y*v;f=x**2/(e=Math.abs(e))**2+w**2/(t=Math.abs(t))**2,f>1&&(f=Math.sqrt(f),e*=f,t*=f);const S=e*w,C=t*x,M=S**2+C**2,k=(e*t)**2-M;let E=Math.sqrt(Math.max(k/M,0));r===i&&(E=-E);const _=E*(S/t),R=E*(-C/e);h=g*_-y*R+(s+o)/2,p=y*_+g*R+(l+a)/2;const I=(x-_)/e,D=(w-R)/t,A=(-x-_)/e,P=(-w-R)/t;return c=Math.atan2(D,I),c+=c<0?S4:0,u=Math.atan2(P,A),u+=u<0?S4:0,d=u-c,!i&&c<u?d-=S4:i&&u<c&&(d+=S4),d%=S4,{startAngle:c,sweepAngle:d,cx:h,cy:p,rx:e,ry:t}}(p,f,a,i,o,d,h,t,n));const m=Math.abs(c*Math.sqrt((p**2+f**2)/2)),g=Math.ceil(m/10),y=c/g;for(let e=1;e<=g;e++){const t=(u+y*e)%S4,n=Math.cos(t),i=Math.sin(t);r.push({x:s+n*p+-i*n,y:l+i*f+n*i})}return r}function R4(e){const t=w4(e),n=[],r=[];let i=0,o=0,a=null,s=null,l=null,c=null;for(let e=0;e<t.length;++e){const u=t[e],d=u[0];switch("S"!==d&&"s"!==d&&"C"!==d&&"c"!==d&&(a=null,s=null),"T"!==d&&"t"!==d&&"Q"!==d&&"q"!==d&&(l=null,c=null),d){case"m":r.length&&n.push(r.splice(0));case"l":i+=u[1],o+=u[2],r.push({x:i,y:o});break;case"M":r.length&&n.push(r.splice(0));case"L":i=u[1],o=u[2],r.push({x:i,y:o});break;case"H":i=u[1],r.push({x:i,y:o});break;case"h":i+=u[1],r.push({x:i,y:o});break;case"V":o=u[1],r.push({x:i,y:o});break;case"v":o+=u[1],r.push({x:i,y:o});break;case"a":r.push(..._4(u,i,o)),i+=u[6],o+=u[7];break;case"A":r.push(..._4(u,i,o)),i=u[6],o=u[7];break;case"c":r.push(...k4({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o},{x:u[5]+i,y:u[6]+o})),a=u[3]+i,s=u[4]+o,i+=u[5],o+=u[6];break;case"C":r.push(...k4({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),a=u[3],s=u[4],i=u[5],o=u[6];break;case"s":null!==a&&null!==a||(a=i,s=o),r.push(...k4({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),a=u[1]+i,s=u[2]+o,i+=u[3],o+=u[4];break;case"S":null!==a&&null!==a||(a=i,s=o),r.push(...k4({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),a=u[1],s=u[2],i=u[3],o=u[4];break;case"Q":r.push(...E4({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],i=u[3],o=u[4];break;case"q":r.push(...E4({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),l=u[1]+i,c=u[2]+o,i+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...E4({x:i,y:o},{x:l,y:c},{x:u[1],y:u[2]})),i=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...E4({x:i,y:o},{x:l,y:c},{x:u[1]+i,y:u[2]+o})),i+=u[1],o+=u[2];break;case"z":case"Z":r.length&&r.push({x:r[0].x,y:r[0].y})}}return function(e){for(let t=0;t<e.length-1;t++){const 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}const I4={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes("path").filter((e=>e.key===this.props.target)),t=[];e.forEach((e=>{R4(e.attrs.d).forEach((e=>{e.forEach((e=>{t.push({type:"circle",cx:e.x,cy:e.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})}))}))})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var D4=[function(e){e.component("box",D2),e.component("box-marker",D2)},function(e){e.component("point",j2),e.component("point-marker",j2)},function(e){e.component("pie",$2)},function(e){e.component("grid-line",U2)},function(e){e.component("ref-line",i5)},function(e){e.component("axis",O5)},function(e){e.component("container",T5)},function(e){e.component("text",N5)},function(e){e.component("scrollbar",F5)},function(e){e.component("brush-range",t3),e.component("brush-area-dir",o3)},function(e){e.component("range",c3)},function(e){e.component("brush-lasso",m3)},function(e){e.component("labels",R6)},function(e){e.component("legend-cat",W6)},function(e){e.component("legend-seq",U6)},function(e){e.component("line",J6)},function(e){e.component("brush-area",t4)},function(e){e.component("tooltip",g4)},function(e){e.component("debug-collider",y4)},function(e){e.component("debug-path-to-points",I4)}];let A4=class{constructor(e){this._parent=null,this._children=[],this._ancestors=null,this.type=e,this.data=null}detach(){return this._parent&&this._parent.removeChild(this),this}get parent(){return this._parent}get isBranch(){return this._children&&this._children.length}get children(){return this._children}get ancestors(){return this._ancestors||(this._ancestors=[],this.parent&&this._ancestors.push(this.parent,...this.parent.ancestors)),this._ancestors}get descendants(){let e=[];const t=this.children.length;let n,r;for(n=0;n<t;n++)r=this.children[n],e.push(r),r.children.length&&(e=[...e,...r.descendants]);return e}equals(e){const t=this.children,n=e.children;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(!t[e].equals(n[e]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map((e=>e.toJSON()))}}};class P4{constructor(){let{x:e=0,y:t=0,width:n=0,height:r=0,minWidth:i=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x:e,y:t,width:n,height:r,minWidth:i,minHeight:o})}set(){let{x:e=0,y:t=0,width:n=0,height:r=0,minWidth:i=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="rect",n>=0?(this.x=e,this.width=Math.max(n,i)):(this.x=e+Math.min(n,-i),this.width=-Math.min(n,-i)),r>=0?(this.y=t,this.height=Math.max(r,o)):(this.y=t+Math.min(r,-o),this.height=-Math.min(r,-o))}containsPoint(e){return D1(this,e)}intersectsLine(e){return A1(this,SY(e))}intersectsRect(e){return R1(this,wY(e))}intersectsCircle(e){return S1(e,this)}intersectsPolygon(e){return _1(e,this)}intersectsGeoPolygon(e){return z1(e,this)}points(){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}]}}class O4{constructor(){let{cx:e=0,cy:t=0,r:n=0,minRadius:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({cx:e,cy:t,r:n,minRadius:r})}set(){let{cx:e=0,cy:t=0,r:n=0,minRadius:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="circle",this.cx=e,this.cy=t,this.r=Math.max(n,r),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return w1(this,e)}intersectsLine(e){return C1(this,SY(e))}intersectsRect(e){return S1(this,wY(e))}intersectsCircle(e){return n=e,!y1(t=this)&&!y1(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return M1(this,e)}intersectsGeoPolygon(e){return q1(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class T4{constructor(){let{x1:e=0,y1:t=0,x2:n=0,y2:r=0,tolerance:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x1:e,y1:t,x2:n,y2:r,tolerance:i})}set(){let{x1:e=0,y1:t=0,x2:n=0,y2:r=0,tolerance:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="line",this.x1=e,this.y1=t,this.x2=n,this.y2=r,this.tolerance=Math.max(0,Math.round(i)),this.vectors=this.points(),this.zeroSize=e===n&&t===r}containsPoint(e){if(this.tolerance>0){return C1({cx:e.x,cy:e.y,r:this.tolerance},this)}return O1(this,e)}intersectsLine(e){return P1(this,SY(e))}intersectsRect(e){return A1(wY(e),this)}intersectsCircle(e){return C1(e,this)}intersectsPolygon(e){return E1(e,this)}intersectsGeoPolygon(e){return j1(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class L4{constructor(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polygon",this.vertices=e.slice(),this.edges=[],function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}(this.vertices),!(this.vertices.length<=2)){!function(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.vertices.length;e++)e<this.vertices.length-1&&this.edges.push([this.vertices[e],this.vertices[e+1]]),this.xMin=isNaN(this.xMin)?this.vertices[e].x:Math.min(this.xMin,this.vertices[e].x),this.xMax=isNaN(this.xMax)?this.vertices[e].x:Math.max(this.xMax,this.vertices[e].x),this.yMin=isNaN(this.yMin)?this.vertices[e].y:Math.min(this.yMin,this.vertices[e].y),this.yMax=isNaN(this.yMax)?this.vertices[e].y:Math.max(this.yMax,this.vertices[e].y);this._bounds=null,this._boundingRect=null}}containsPoint(e){return k1(this,e)}intersectsCircle(e){return M1(e,this)}intersectsLine(e){return E1(this,SY(e))}intersectsRect(e){return _1(this,wY(e))}intersectsPolygon(e){return T1(this,e)}intersectsGeoPolygon(e){return L1(e,this)}points(){return this.vertices}bounds(){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}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function q4(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new L4(...t)}function N4(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function j4(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}class z4{constructor(){let{vertices:e=[[]]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="geopolygon",this.vertices=e.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.numPolygons;e++)j4(this.vertices[e]),this.vertices[e].length>2&&N4(this.vertices[e]),this.polygons[e]=q4({vertices:this.vertices[e]}),this.xMin=isNaN(this.xMin)?this.polygons[e].xMin:Math.min(this.xMin,this.polygons[e].xMin),this.xMax=isNaN(this.xMax)?this.polygons[e].xMax:Math.max(this.xMax,this.polygons[e].xMax),this.yMin=isNaN(this.yMin)?this.polygons[e].yMin:Math.min(this.yMin,this.polygons[e].yMin),this.yMax=isNaN(this.yMax)?this.polygons[e].yMax:Math.max(this.yMax,this.polygons[e].yMax);this._bounds=null,this._boundingRect=null}containsPoint(e){return N1(this,e)}intersectsCircle(e){return q1(e,this)}intersectsLine(e){return j1(this,SY(e))}intersectsRect(e){return z1(this,wY(e))}intersectsPolygon(e){return L1(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!R1(n,r)&&(I1(r,n)?x1(t,e):x1(e,t))}(this,e)}points(){return this.vertices}bounds(){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}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function F4(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new z4(...t)}class W4{constructor(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({points:e})}set(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polyline",this.segments=[],this._points=e.slice(),this._points.length>1)for(let e=0,r=this._points.length-1;e<r;e++)t=this._points[e],n=this._points[e+1],(t.x!==n.x||t.y!==n.y)&&this.segments.push({x1:this._points[e].x,y1:this._points[e].y,x2:this._points[e+1].x,y2:this._points[e+1].y});var t,n}containsPoint(e){return this.segments.some((t=>O1(t,e)))}intersectsCircle(e){return this.segments.some((t=>C1(e,t)))}intersectsLine(e){const t=SY(e);return this.segments.some((e=>P1(e,t)))}intersectsRect(e){const t=wY(e);return this.segments.some((e=>A1(t,e)))}intersectsPolygon(e){return this.segments.some((t=>E1(e,t)))}intersectsGeoPolygon(e){return this.segments.some((t=>j1(e,t)))}points(){return this._points}}const $4=_K();function B4(e,t){return $4.get(e)(t)}$4.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new P4(...t)})),$4.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new O4(...t)})),$4.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new T4(...t)})),$4.add("polygon",q4),$4.add("geopolygon",F4),$4.add("polyline",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new W4(...t)}));class H4{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],e.forEach((e=>{const t=B4(e.type,e);t&&this.geometries.push(t)}))}containsPoint(e){return this.geometries.some((t=>t.containsPoint(e)))}intersectsLine(e){return this.geometries.some((t=>t.intersectsLine(e)))}intersectsRect(e){return this.geometries.some((t=>t.intersectsRect(e)))}intersectsCircle(e){return this.geometries.some((t=>t.intersectsCircle(e)))}intersectsPolygon(e){return this.geometries.some((t=>t.intersectsPolygon(e)))}intersectsGeoPolygon(e){return this.geometries.some((t=>t.intersectsGeoPolygon(e)))}}class V4{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new V4).multiply(this)}set(e){return this._elements=e,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(e){let 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}translate(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}rotate(e){let t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}multiply(e){let t,n,r,i;if(e instanceof V4&&(e=e._elements),Array.isArray(e)){for(r=[[0,0,0],[0,0,0],[0,0,0]],t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)for(i=0;i<3;i++)r[t][n]+=this._elements[t][i]*e[i][n];this._elements=r}else for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]*=e;return this}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}transform(e,t,n,r,i,o){return this.multiply([[e,n,i],[t,r,o],[0,0,1]]),this}determinant(){let 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],c=0;return c=e*i*l+t*o*a+n*r*s-n*i*a-t*r*l-e*o*s,c}invert(){let 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],c=this._elements[2][2];return this._elements=[[o*c-a*l,r*l-n*c,n*a-r*o],[a*s-i*c,t*c-r*s,r*i-t*a],[i*l-o*s,s*n-t*l,t*o-n*i]],this.multiply(1/e),this}transpose(){const 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}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map((e=>e.join("\t"))).join("\n"))}isIdentity(){const 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]}transformPoint(e){let 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]}}transformPoints(e){let 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}get elements(){const 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]]]}}const G4=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function U4(e,t){const n=t.args[0]*(Math.PI/180);if(t.args.length>2){const 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 Y4(e,t){const n=t.args[0],r=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,r)}function K4(e,t){const n=t.args[0],r=isNaN(t.args[1])?0:t.args[1];e.translate(n,r)}function X4(e,t){t.args.length>=6&&e.transform(...t.args)}function J4(e,t){const n=function(e){let t,n=[];for(;null!==(t=G4.exec(e));){const e=t[2].trim(),r=-1===e.indexOf(",")?e.split(" "):e.split(",");n.push({cmd:t[1],args:r.filter((e=>e.trim().length>0)).map((e=>Number(e)))})}return n}(e);let r;for(let e=0,i=n.length;e<i;e++)r=n[e],"rotate"===r.cmd?U4(t,r):"scale"===r.cmd?Y4(t,r):"matrix"===r.cmd?X4(t,r):"translate"===r.cmd&&K4(t,r)}const Z4={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},Q4={type:(e,t)=>t.filter((t=>{const n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()})),attr:(e,t,n,r)=>r.filter((r=>{const 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:e=>e,tag:(e,t)=>t.filter((t=>{const n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))}))};function e8(e,t){if(!t||!t.length||!e||"function"!=typeof Q4[e.type])return[];switch(e.type){case"type":case"tag":return Q4[e.type](e.value,t);case"attr":return Q4[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return Q4[e.type](t);default:return[]}}var t8={find:function(e,t){const n=[],r=[];let i,o;if(t.isBranch){let a;i=function(e){const t=[];let n,r,i,o;return e.split(/\s*,\s*/).forEach((e=>{e=e.trim(),n=[];const a=t=>{i=e.match(Z4[t]),i&&(o=!0,e=e.slice(i[0].length),r={type:t,value:i[0]},"attr"===t&&(i=i[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),r.attribute=i[1],r.operator=i[2],r.attributeValue=i[3]),n.push(r))};for(;e&&(o=!1,i=e.match(/^\s*([>+~]|\s)\s*/),i&&(o=!0,n.push({type:" ",value:i[0]}),e=e.slice(i[0].length)),Object.keys(Z4).forEach(a),n&&n.length&&t.indexOf(n)<0&&t.push(n),o););})),t}(e),o=t.descendants;for(let e=0,t=i.length;e<t;e++){a=i[e];const t=[];let n=o.slice(),s=!1;a.reverse().forEach((e=>{if(" "===e.type)return t.push(n),n=o.slice(),void(s=!1);n=e8(e,n),s=!0})),s&&t.push(n);const l=t[0].filter((e=>{let n,r=e.parent;for(let e=1;e<t.length;e++){for(n=t[e].indexOf(r);r&&n<0;)r=r.parent,n=t[e].indexOf(r);if(n<0)return!1}return!0}));r.push(l)}for(let e=0,t=r.length;e<t;e++)for(let t=0,i=r[e].length;t<i;t++)n.indexOf(r[e][t])<0&&n.push(r[e][t])}return n||[]}};function n8(e,t,n){const r=e.type;let i=e.points();n&&(i=i.every((e=>Array.isArray(e)))?i.map((e=>n.transformPoints(e))):n.transformPoints(i)),function(e,t){for(let n=0,r=e.length;n<r;n++)e[n].x/=t,e[n].y/=t}(i,t);let o=null;if("rect"===r||"bounds"===r)o=wY(i),o.type=r;else if("circle"===r)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(i,e.r),o.type=r;else if("line"===r)o=SY(i),o.type=r;else if("polygon"===r||"polyline"===r){o={type:"path",d:B0(i,"polygon"===r)}}else if("geopolygon"===r){let e="";for(let t=0;t<i.length;t++)e+=B0(i[t],!0);o={type:"path",d:e}}return o}class r8{constructor(e){this._bounds=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{x:n,y:r,width:i,height:o}=e.boundingRect?e.boundingRect(t):{x:0,y:0,width:0,height:0};return{x:n,y:r,width:i,height:o}},this._attrs=e.attrs,this._type=e.type,this._data=e.data,this._dpi=e.stage?e.stage.dpi:1,this._collider=()=>function(e,t){if(e.collider){const n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map((e=>n8(e,t,n)))}:n8(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map((e=>new r8(e))),this._parent=()=>e.parent?new r8(e.parent):null,this._cache={elementBoundingRect:null},this._getElementBoundingRect=()=>(!this._cache.elementBoundingRect&&this.element&&(this._cache.elementBoundingRect=this.element.getBoundingClientRect()),this._cache.elementBoundingRect||{left:0,top:0})}get children(){return this._children()}get parent(){return this._parent()}get type(){return this._type}get data(){return this._data}get attrs(){return this._attrs}set element(e){this._cache.elementBoundingRect=null,this._element=e}get element(){return this._element}set key(e){this._key=e}get key(){return this._key}get bounds(){const e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}get localBounds(){return this._bounds(!1)}boundsRelativeTo(e){const t=typeof e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.bounds:this.localBounds,r=this._getElementBoundingRect();let i=r.left,o=r.top;if("object"===t&&null!==e&&"function"==typeof e.getBoundingClientRect){const{left:t=0,top:n=0}=e.getBoundingClientRect();i-=t,o-=n}return n.x+=i,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function i8(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new r8(...t)}class o8{constructor(e){this._node=i8(e),this._parent=null,this._input=null}get node(){return this._node}set parent(e){this._parent=e}get parent(){return this._parent}set input(e){this._input=e}get input(){return this._input}}function a8(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new o8(...t)}function s8(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=a8(n);const e=n.parent;e&&"stage"!==e.type&&s8(e,t.parent)}}function l8(e,t,n){if(null===e.colliderType)return null;const r=function(e,t){let 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{const r={x:t.cx,y:t.cy};({x:n.cx,y:n.cy}=e.inverseModelViewMatrix.transformPoint(r)),n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every((e=>Array.isArray(e)))?F4(n):q4(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(let r=e.descendants.length-1;r>=0;r--){const i=e.descendants[r];if(null!==i.collider&&i.collider[t](n)){const e=a8(i);return s8(i,e),e}}return null}(e,t,r):function(e,t,n){if(e.collider[t](n)){const t=a8(e);return s8(e,t),t}return null}(e,t,r)}function c8(e,t,n,r){const i=e.length;for(let o=0;o<i;o++){const i=e[o],a=l8(i,t,r);a&&n.push(a),!i.children||a||i.collider||c8(i.children,t,n,r)}}function u8(e,t,n){const r=e.length;for(let i=0;i<r;i++){const r=e[i];if(null!==l8(r,t,n))return!0;if(r.children&&!r.collider)return u8(r.children,t,n)}return!1}function d8(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(CY(e)){case"circle":return n.cx=e.cx*t,n.cy=e.cy*t,n.r=e.r,["intersectsCircle",n];case"rect":return n=xY(e).map((e=>K0(e,t))),["intersectsRect",n];case"line":return n=bY(e).map((e=>K0(e,t))),["intersectsLine",n];case"point":return n=K0(e,t),["containsPoint",n];case"polygon":return n.vertices=e.vertices.map((e=>K0(e,t))),["intersectsPolygon",n];case"geopolygon":return n.vertices=e.vertices.map((e=>e.map((e=>K0(e,t))))),["intersectsGeoPolygon",n];default:return[]}}function h8(e,t){const[n,r]=d8(t,e.dpi),i=[];return n&&(c8([e],n,i,r),function(e,t){for(let n=0,r=t.length;n<r;n++)t[n].input=e}(t,i)),i}function p8(e,t){const[n,r]=d8(t,e.dpi);return u8([e],n,r)}class f8 extends A4{constructor(e){super(e),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;const{data:t,desc:n,tag:r,strokeReference:i,fillReference:o}=e;!function(e,t){Object.keys($0).forEach((n=>{const r=t[n];void 0!==r&&(e[$0[n]]=r)}))}(this.attrs,e),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=uY(!0,{},n)),"string"==typeof r&&(this.tag=r),"string"==typeof i&&(this.strokeReference=i),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return t8.find(e,this).map((e=>i8(e)))}getItemsFrom(e){return h8(this,e)}containsPoint(e){return p8(this,e)}intersectsLine(e){return p8(this,e)}intersectsRect(e){return p8(this,e)}intersectsCircle(e){return p8(this,e)}intersectsPolygon(e){return p8(this,e)}intersectsGeoPolygon(e){return p8(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new V4;void 0!==this.attrs.transform&&J4(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new V4;const t=this.ancestors;if(t.length>0)for(let n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}attr(e){return this.attrs[e]}equals(e){const t=this.attrs,n=Object.keys(t),r=e.attrs,i=Object.keys(r);if(n.length!==i.length)return!1;for(let e=0;e<n.length;e++){const i=n[e];if(!Object.hasOwnProperty.call(r,i))return!1;if(t[i]!==r[i])return!1}return super.equals(e)}toJSON(){const e=super.toJSON();return e.attrs=this.attrs,e}get attrs(){return this._attrs}get stage(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}set modelViewMatrix(e){this._mvm=e,this._imvm=null}get modelViewMatrix(){return this._mvm}get inverseModelViewMatrix(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}set node(e){this._node=e}get node(){return this._node}set collider(e){const 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))}get collider(){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 new H4(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=B4("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=B4(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class m8 extends A4{addChild(e){if(!(e&&e instanceof A4))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}addChildren(e){let t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}removeChild(e){const t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}removeChildren(e){let 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}}const g8=m8.prototype;class y8 extends f8{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const{collider:t}=e,n=uY({type:null},t);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(e,t){if(void 0!==e.bounds){const n=this.__boundingRect[t]||{},[r,,i]=e.bounds(t),{x:o,y:a}=r,{x:s,y:l}=i,c=isNaN(n.width)?s:Math.max(s,n.width+n.x),u=isNaN(n.height)?l:Math.max(l,n.height+n.y);n.x=isNaN(n.x)?o:Math.min(o,n.x),n.y=isNaN(n.y)?a:Math.min(a,n.y),n.width=c-n.x,n.height=u-n.y,this.__boundingRect[t]=n}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.children.length;for(let n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=uY({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const 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]}addChild(e){const t=g8.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=uY({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=g8.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let t=0;t<n;t++)this.appendChildRect(e[t],!0);const t=uY({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;if(g8.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=uY(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(g8.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=uY(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function v8(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new y8(...t)}class b8 extends y8{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const x8=m8.prototype,w8=["x1","x2","y1","y2","id","offset","style"];class S8 extends f8{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=w8.length;r!==i;r++)n=w8[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return x8.addChild.call(this,e)}addChildren(e){return x8.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return x8.removeChild.call(this,e),this}removeChildren(e){return x8.removeChildren.call(this,e),this}}function C8(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new S8(...t)}const M8=m8.prototype,k8=["patternUnits","x","y","width","height","id"];class E8 extends f8{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=k8.length;r!==i;r++)n=k8[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return M8.addChild.call(this,e)}addChildren(e){return M8.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return M8.removeChild.call(this,e),this}removeChildren(e){return M8.removeChildren.call(this,e),this}}class _8 extends f8{constructor(){super("rect"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,width:r=0,height:i=0,rx:o=0,ry:a=0,collider:s}=e,l=uY({type:"rect",x:t,y:n,width:r,height:i},s);super.set(e),r>=0?(this.attrs.x=t,this.attrs.width=r):(this.attrs.x=t+r,this.attrs.width=-r),i>=0?(this.attrs.y=n,this.attrs.height=i):(this.attrs.y=n+i,this.attrs.height=-i),o>0&&(this.attrs.rx=o),a>0&&(this.attrs.ry=a),this.collider=l,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=xY(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,[r,i,o,a]=vY(n);return this.__boundingRect[e]={x:r,y:i,width:o-r,height:a-i},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const 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]}}class R8 extends f8{constructor(){super("circle"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{cx:t=0,cy:n=0,r:r=0,collider:i}=e,o=uY({type:"circle",cx:t,cy:n,r:r},i);super.set(e),this.attrs.cx=t,this.attrs.cy=n,this.attrs.r=r,this.collider=o,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const 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]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const{cx:t,cy:n,r:r,r:i}=this.attrs,o=t-r,a=n-i;let s=2*r,l=2*i,c=[{x:o,y:a},{x:o+s,y:a},{x:o+s,y:a+l},{x:o,y:a+l}];if(e&&this.modelViewMatrix){c=this.modelViewMatrix.transformPoints(c);const[t,n,r,i]=vY(c);s=r-t,l=i-n,this.__bounds[e]=[{x:t,y:n},{x:t+s,y:n},{x:t+s,y:n+l},{x:t,y:n+l}]}else this.__bounds[e]=c;return this.__bounds[e]}}class I8 extends f8{constructor(){super("line"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x1:t=0,y1:n=0,x2:r=0,y2:i=0,collider:o}=e;super.set(e),this.attrs.x1=t,this.attrs.y1=n,this.attrs.x2=r,this.attrs.y2=i;const a={type:"line",x1:t,y1:n,x2:r,y2:i};this.collider=uY(a,o),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];let t=bY(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const[n,r,i,o]=vY(t),a=n!==i||r!==o;return this.__boundingRect[e]={x:n,y:r,width:a?Math.max(1,i-n):0,height:a?Math.max(1,o-r):0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const 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]}}const D8=Math.PI/2;function A8(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function P8(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const O8={step:function(e){return new wK(e,.5)},stepAfter:function(e){return new wK(e,1)},stepBefore:function(e){return new wK(e,0)},linear:ZY,basis:function(e){return new aK(e)},cardinal:cK.tension(0),catmullRom:dK,monotonex:function(e){return new gK(e)},monotoney:function(e){return new yK(e)},natural:function(e){return new bK(e)}};function T8(e){if(e.length<2)return!1;const 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}class L8 extends f8{constructor(){super("path"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(e),this.segments=[],this.points=[],e.arcDatum){const t=XY();t.innerRadius(e.desc.slice.innerRadius),t.outerRadius(e.desc.slice.outerRadius),t.cornerRadius(e.desc.slice.cornerRadius);const n=t(e.arcDatum);this.attrs.d=n}else if(e.points){const{major:t,minor:n,layerObj:r,points:i,stngs:o,generatorType:a}=e,s=tK(),l=o.coordinates?o.coordinates.defined:null;s[t.p]((e=>e.major*t.size))["".concat(n.p,"1")]((e=>e.minor*n.size))["".concat(n.p,"0")]((e=>e.minor0*n.size)).curve(O8["monotone"===r.curve?"monotone".concat(t.p):r.curve]),l?s.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined)):s.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)));const c=o.connect?i.filter(s.defined()):i,u=("area"===a?s:s[a]())(c);this.attrs.d=u}else e.d&&(this.attrs.d=e.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(e.collider)||"object"==typeof e.collider&&void 0!==e.collider.type)this.collider=e.collider;else if(this.attrs.d){if(this.segments=R4(this.attrs.d),this.segments.length>1&&this.segments.every((e=>T8(e))))return void(this.collider=uY({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach((t=>{if(t.length<=1);else if(T8(t))this.collider=uY({type:"polygon",vertices:t},e.collider);else if("object"==typeof e.collider&&e.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=[],i=[];if("h"===n.forceOrientation){const t=e[0].x<e[1].x?-1:1,n=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+t,y:e[0].y}),e.push({x:e[e.length-1].x+n,y:e[e.length-1].y})}else if("v"===n.forceOrientation){const t=e[0].y<e[1].y?-1:1,n=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+t}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+n})}const o=e.length-1;for(let n=1;n<o;n++){const a=e[n-1],s=e[n],l=e[n+1],c=A8(s,a),u=A8(s,l),d=(c+u)/2,h=d+Math.PI,p=Math.max(d,h),f=Math.min(d,h),m=c>u;if(1===n){const e=A8(a,s);r.push(P8(a,e-D8,t)),i.unshift(P8(a,e+D8,t))}const g=m?p:f,y=m?f:p;if(r.push(P8(s,g,t)),i.unshift(P8(s,y,t)),n===o-1){const e=A8(l,s);r.push(P8(l,e+D8,t)),i.unshift(P8(l,e-D8,t))}}return{type:"polygon",vertices:[...r,...i]}}(t,n,e.collider)}else this.collider=uY({type:"polyline",points:t},e.collider)}))}}boundingRect(){let 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:R4(this.attrs.d),this.points=function(e){const t=[];let n,r=e.length;for(let i=0;i<r;i++){n=e[i];for(let e=0;e<n.length;e++)t.push(n[e])}return t}(this.segments));const t=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points,[n,r,i,o]=vY(t);return this.__boundingRect[e]={x:n||0,y:r||0,width:i-n||0,height:o-r||0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const 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]}}function q8(e){let{data:t,_boundingRect:n,_textBoundsFn:r}=e;return null!=t&&(n||r)}let N8=class extends f8{constructor(){super("text"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,dx:r=0,dy:i=0,textBoundsFn:o,text:a,title:s,collider:l,boundingRect:c,ellipsed:u}=e;super.set(e),this.attrs.x=t,this.attrs.y=n,this.attrs.dx=r,this.attrs.dy=i,this.attrs.text=a,void 0!==s&&(this.attrs.title=String(s)),"object"==typeof c?this._textBoundsFn=()=>c:"function"==typeof o&&(this._textBoundsFn=o),"string"==typeof u&&(this.ellipsed=u),this.collider=uY({type:q8(this)?"bounds":null},l),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};e=this._textBoundsFn(this.attrs);const n=xY(e),r=t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n,[i,o,a,s]=vY(r);return this.__boundingRect[t]={x:i,y:o,width:a-i,height:s-o},this.__boundingRect[t]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const 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]}};class j8 extends f8{constructor(){super("image"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,width:r=0,height:i=0,rx:o=0,ry:a=0,src:s,collider:l,cx:c=0,cy:u=0,r:d=0,opacity:h,imageScalingFactor:p,imagePosition:f,symbol:m}=e;let g;g="circle"===e.symbol?uY({type:"circle",cx:c,cy:u,r:d},l):uY({type:"bounds",x:t,y:n,width:r,height:i},l),super.set(e),r>=0?(this.attrs.x=t,this.attrs.width=r):(this.attrs.x=t+r,this.attrs.width=-r),i>=0?(this.attrs.y=n,this.attrs.height=i):(this.attrs.y=n+i,this.attrs.height=-i),o>0&&(this.attrs.rx=o),a>0&&(this.attrs.ry=a),s&&(this.attrs.src=s),this.attrs.r=d,this.attrs.cx=c,this.attrs.cy=u,this.attrs.opacity=void 0!==h?h:1,this.attrs.imageScalingFactor=void 0!==p?p:1,this.attrs.imagePosition=f||"center-center",this.attrs.symbol=m||"rectangle",this.collider=g,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},e.collider||(this.attrs.updateCollider=this.updateCollider.bind(this))}updateCollider(e){let t;t="circle"===e.symbol?uY(this.collider,{type:"circle",cx:e.cx,cy:e.cy,r:e.r}):uY(this.collider,{type:"bounds",x:e.x,y:e.y,width:e.width,height:e.height}),this.collider=t}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=xY(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,[r,i,o,a]=vY(n);return this.__boundingRect[e]={x:r,y:i,width:o-r,height:a-i},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];if("circle"===this._node.symbol){const t=this.boundingRect(e),n=Math.min(t.width,t.height)/2,r=t.x-n,i=t.y-n;let o=2*n,a=2*n,s=[{x:r,y:i},{x:r+o,y:i},{x:r+o,y:i+a},{x:r,y:i+a}];if(e&&this.modelViewMatrix){s=this.modelViewMatrix.transformPoints(s);const[t,n,r,i]=vY(s);o=r-t,a=i-n,this.__bounds[e]=[{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+a},{x:t,y:n+a}]}else this.__bounds[e]=s;return this.__bounds[e]}const 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]}}const z8=_K();function F8(e,t){return z8.get(e)(t)}z8.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new _8(...t)})),z8.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new R8(...t)})),z8.add("text",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new N8(...t)})),z8.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new I8(...t)})),z8.add("path",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new L8(...t)})),z8.add("stage",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new b8(...t)})),z8.add("container",v8),z8.add("defs",v8),z8.add("linearGradient",C8),z8.add("radialGradient",C8),z8.add("conicGradient",C8),z8.add("stop",C8),z8.add("pattern",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new E8(...t)})),z8.add("image",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new j8(...t)}));const W8=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[{}];function n(){return t[t.length-1]}return n.save=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=n(),o={};let a="";for(let t=0;t<e.length;t++)a=e[t],void 0!==i[a]&&(o[a]=i[a]);return uY(o,r),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function $8(e,t){if(Array.isArray(t))for(let n=0,r=t.length;n<r;n++)t[n](e)}function B8(e,t,n){e.node=n[t],e.index=t}function H8(e,t,n,r){let i=!1;const o={siblings:e,node:null,index:0};for(let a=0,s=e.length;a<s;a++){if(B8(o,a,e),$8(o,r.create),i="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,i)continue;o.node=W8.save(o.node);const s=F8(o.node.type,o.node);s&&(o.node.transform&&(n.save(),J4(o.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),t.addChild(s),o.node.children&&H8(o.node.children,s,n,r),o.node.transform&&n.restore()),W8.restore()}}function V8(e){let{items:t,stage:n,dpi:r,on:i={}}=e;return n||(n=F8("stage",r)),H8(t,n,new V4,i),n}function G8(e,t,n){const{orientation:r,degree:i,stops:o=[]}=n;let a=null;if("radial"===r){const n=t.boundingRect();a=e.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else if("conic"===r){const t=n.startAngle||0,r=n.x||0,i=n.y||0;a=e.createConicGradient(t,r,i)}else{const r=G0(i);["x1","x2","y1","y2"].forEach((e=>{e in n&&(r[e]=n[e])}));const o=t.boundingRect();a=e.createLinearGradient(o.x+r.x1*o.width,o.y+r.y1*o.height,o.x+r.x2*o.width,o.y+r.y2*o.height)}for(let e=0,t=o.length;e<t;e++){let t=o[e];a.addColorStop(t.offset,t.color)}return a}function U8(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach((e=>{if("rect"===e.type)n.rect(e.x,e.y,e.width,e.height)})),n.fill(),n.restore(),n.createPattern(t,"repeat")}function Y8(){let{x:e,y:t,width:n,height:r,scaleRatio:i,margin:o,edgeBleed:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s={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 s.x=isNaN(e)?s.x:e,s.y=isNaN(t)?s.y:t,s.width=isNaN(n)?s.width:n,s.height=isNaN(r)?s.height:r,void 0!==i&&(s.scaleRatio.x=isNaN(i.x)?s.scaleRatio.x:i.x,s.scaleRatio.y=isNaN(i.y)?s.scaleRatio.y:i.y),void 0!==o&&(s.margin.left=isNaN(o.left)?0:o.left,s.margin.top=isNaN(o.top)?0:o.top),"object"==typeof a&&["left","right","top","bottom"].forEach((e=>{!isNaN(a[e])&&a[e]>0&&(s.edgeBleed[e]=a[e],s.edgeBleed.bool=!0)})),s.computedPhysical={x:Math.round(s.margin.left+(s.x-s.edgeBleed.left)*s.scaleRatio.x),y:Math.round(s.margin.top+(s.y-s.edgeBleed.top)*s.scaleRatio.y),width:Math.round((s.width+s.edgeBleed.left+s.edgeBleed.right)*s.scaleRatio.x),height:Math.round((s.height+s.edgeBleed.top+s.edgeBleed.bottom)*s.scaleRatio.y)},s}function K8(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:x6,textBounds:S6,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function X8(e){return t=>{let{node:n}=t;"text"!==n.type||null==n.data||n.textBoundsFn||(n.textBoundsFn=e.textBounds)}}const J8=200,Z8=200;class Q8{constructor(e){this.targetCanvas=e,this.bufferCanvas=e.cloneNode()}updateSize(e){let t,{rect:n,dpiRatio:r,canvasBufferSize:i}=e;t=i?"function"==typeof i?i(n):i:{width:n.computedPhysical.width+2*J8,height:n.computedPhysical.height+2*Z8},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)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const e7=_K();function t7(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function n7(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function r7(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function i7(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Object.keys(r);for(let i=0,o=n.length;i<o;i++){let o=n[i];const a=o[0],s=o[1],l=o[2];if(a in t.attrs&&!(s in r)&&e[s]!==t.attrs[a]){const n=l?l(t.attrs[a]):t.attrs[a];"function"==typeof e[s]?e[s](n):e[s]=n}}for(let t=0,n=i.length;t<n;t++){const n=i[t];e[n]=r[n]}}function o7(e,t,n,r){for(let i=0,o=e.length;i<o;i++){let o=e[i],a={};t.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?a.fillStyle=G8(t,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(a.fillStyle=r.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?a.strokeStyle=G8(t,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(a.strokeStyle=r.patterns.create(o.attrs.stroke))),i7(t,o,n,a),o.modelViewMatrix&&r7(o.modelViewMatrix.elements,t),e7.has(o.type)&&e7.get(o.type)(o.attrs,{g:t,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&o7(o.children,t,n,r),t.restore()}}function a7(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:V8;const r={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let i,o=!1,a=Y8();const s=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",t7]];let l;const c=K8();return c.element=()=>e,c.root=()=>e,c.settings=e=>(e&&Object.keys(r).forEach((t=>{void 0!==e[t]&&(r[t]=e[t])})),r),c.appendTo=n=>(e||(e=n.ownerDocument.createElement("canvas"),e.style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof r.transform||t||(t=new Q8(e)),n.appendChild(e),e),c.getScene=r=>{const i=n7(t&&t.getContext()||e.getContext("2d")),o=a.scaleRatio.x,s=a.scaleRatio.y,l={type:"container",children:r,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*i*o,", ").concat(a.edgeBleed.top*i*s,")"):""};return 1===i&&1===o&&1===s||(l.transform+="scale(".concat(i*o,", ").concat(i*s,")")),n({items:[l],dpi:i,on:{create:[u6(c.measureText),X8(c)]}})},c.render=n=>{if(!e)return!1;l||(l=function(e){const t=e.createElement("canvas"),n=t.getContext("2d");let r={};return{create(e){const i=e.key;return i?(r[i]=r[i]||U8(e,t,n),r[i]):U8(e,t,n)},clear(){r={}}}}(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),d=n7(u),h=t&&r.transform();if(h)return e.width=e.width,function(e){let{el:t,dpiRatio:n,transform:r}=e;if("object"==typeof r){const e=[r.horizontalScaling,r.horizontalSkewing,r.verticalSkewing,r.verticalScaling,r.horizontalMoving*n,r.verticalMoving*n];t.getContext("2d").setTransform(...e)}}({el:e,dpiRatio:d,transform:h}),t.apply(),!0;o&&(e.style.left="".concat(a.computedPhysical.x,"px"),e.style.top="".concat(a.computedPhysical.y,"px"),e.style.width="".concat(a.computedPhysical.width,"px"),e.style.height="".concat(a.computedPhysical.height,"px"),e.width=Math.round(a.computedPhysical.width*d),e.height=Math.round(a.computedPhysical.height*d),t&&t.updateSize({rect:a,dpiRatio:d,canvasBufferSize:r.canvasBufferSize}));const p=c.getScene(n),f=!i||!p.equals(i);l.clear();const m=o||f,g="function"==typeof r.progressive&&r.progressive();return m&&(g&&!g.isFirst||c.clear(),o7(p.children,u,s,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,g&&!g.isFirst&&p.children.unshift(...i.children),i=p,m},c.itemsAt=e=>i?i.getItemsFrom(e):[],c.findShapes=e=>i?i.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),i=null,c),c.size=e=>{if(e){const t=Y8(e);JSON.stringify(a)!==JSON.stringify(t)&&(o=!0,a=t)}return a},c.destroy=()=>{e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),i=null},c}function s7(e,t){e7.add(e,t)}function l7(e,t){return Math.max(0,Math.min(e,t))}const c7=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),u7=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),d7=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function h7(e){return c7.test(e)}function p7(e){return u7.test(e)||d7.test(e)}function f7(e){let t,n,r=e?e.length:0;for(t=0;t<r;t++){if(n=e[t],h7(n))return"ltr";if(p7(n))return"rtl"}return"ltr"}const m7={start:"end",end:"start",center:"center",middle:"middle"};function g7(e,t){return"rtl"===t?m7[e]:e}function y7(e,t){if(y7.cache[e])return void t(y7.cache[e]);const n=new Image;n.src=e,n.onload=()=>{y7.cache[e]=n,t(n)},n.onerror=e=>{console.error("Image load error",e)}}function v7(e,t){const n=[];let r;const i=[],o=[],a=[];let s,l;const c=e=>e.id,u=(e,t)=>{let n;return n="object"==typeof e?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(u)),t=t.map(u),s=e.map(c),l=t.map(c);for(let e=0,r=t.length;e<r;e++){-1===s.indexOf(t[e].id)?n.push(t[e]):o.push(t[e])}for(let t=0,n=e.length;t<n;t++){-1===l.indexOf(e[t].id)?i.push(e[t]):a.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=v7([],n[e].content.children),n[e].children=n[e].diff.updatedNew.concat(n[e].diff.added),n[e].children.isTree=!0);for(let e=0,t=o.length;e<t;e++)o[e].diff=v7(a[e].children||[],o[e].content.children||[]),o[e].object=a[e].object,o[e].children=o[e].diff.items;return r=o.concat(n),n.isTree=!0,i.isTree=!0,o.isTree=!0,a.isTree=!0,r.isTree=!0,{added:n,updatedNew:o,updatedOld:a,removed:i,items:r}}function b7(e,t,n){for(let r=0,i=e.length;r<i;r++)e[r].object=n(e[r].content.type,t)}function x7(e,t){for(let 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 w7(e,t,n,r){let i;for(let o=0,a=e.length;o<a;o++)i=e[o],null!==i.object&&void 0!==i.object&&(n(i.object,i.content),i.diff&&(b7(i.diff.added,i.object,t),x7(i.diff.removed,r),w7(i.diff.items,t,n,r)))}function S7(e,t,n,r,i,o){const a=v7(e,t);return b7(a.added,n,r),x7(a.removed,o),w7(a.items,r,i,o),a.items}y7.cache={},s7("rect",(function(e,t){let{g:n,doFill:r,doStroke:i}=t;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,r,i,o,a){o=l7(r/2,o>0?o:a),a=l7(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()})),s7("circle",(function(e,t){let{g:n,doFill:r,doStroke:i}=t;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()})),s7("line",(function(e,t){let{g:n,doStroke:r}=t;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),r&&n.stroke()})),s7("path",(function(e,t){let{g:n,doStroke:r,doFill:i}=t;const o=new Path2D(e.d);i&&n.fill(o),r&&n.stroke(o)})),s7("text",(function(e,t){let{g:n,ellipsed:r,doStroke:i}=t;const o=r||d6(e,x6);n.font=[e["font-style"],e["font-weight"],e["font-size"],e["font-family"]].filter((e=>!!e)).join(" ");const a=f7(e.text);n.canvas.dir!==a&&(n.canvas.dir=a);const s=g7("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);const l=h6(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)})),s7("image",(function(e,t){let{g:n}=t;const r=n.canvas,i=n.getTransform(),o=window.devicePixelRatio||1,a=r.clientWidth*o,s=r.clientHeight*o;r.width===a&&r.height===s||(r.width=a,r.height=s),y7(e.src,(t=>{if(n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,r.width,r.height),n.setTransform(i),n.globalAlpha=e.opacity,e.width||e.height||(e.width=t.naturalWidth*e.imageScalingFactor,e.height=t.naturalHeight*e.imageScalingFactor),function(e){const t=e.imagePosition||"center-center";let n=e.width,r=e.height;if("circle"===e.symbol){const t=Math.min(e.width,e.height)/2;n=2*t,r=2*t}switch(t){case"top-center":e.y-=r/2;break;case"center-left":e.x-=n/2;break;case"center-right":e.x+=n/2;break;case"top-left":e.x-=n/2,e.y-=r/2;break;case"top-right":e.x+=n/2,e.y-=r/2;break;case"bottom-left":e.x-=n/2,e.y+=r/2;break;case"bottom-right":e.x+=n/2,e.y+=r/2;break;case"bottom-center":e.y+=r/2}}(e),"circle"===e.symbol){const r=e.x,i=e.y;e.r=Math.min(e.width,e.height)/2;const o=r-e.width/2,a=i-e.height/2;n.save(),n.beginPath(),n.arc(r,i,e.r,0,2*Math.PI),n.clip(),n.drawImage(t,o,a,e.width,e.height),n.restore()}else e.x-=e.width/2,e.y-=e.height/2,n.drawImage(t,e.x,e.y,e.width,e.height);n.globalAlpha=1,e.updateCollider&&e.updateCollider(e)}))}));const C7="http://www.w3.org/2000/svg",M7=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(C7,"container"===e?"g":e);return t.appendChild(n),n},k7=e=>{e.parentNode&&e.parentNode.removeChild(e)};function E7(e){let{element:t,attrs:n}=e;return function(){const{width:e,height:r,imagePosition:i,imageScalingFactor:o,symbol:a}=n;let{x:s=0,y:l=0}=n,c=e>0?e:this.naturalWidth,u=r>0?r:this.naturalHeight;switch(o&&(c*=o,u*=o),i){case"top-center":l-=u/2;break;case"center-left":s-=c/2;break;case"center-right":s+=c/2;break;case"top-left":s-=c/2,l-=u/2;break;case"top-right":s+=c/2,l-=u/2;break;case"bottom-left":s-=c/2,l+=u/2;break;case"bottom-right":s+=c/2,l+=u/2;break;case"bottom-center":l+=u/2}if(t.setAttribute("width",c),t.setAttribute("height",u),t.setAttribute("x",s-c/2),t.setAttribute("y",l-u/2),t.setAttribute("preserveAspectRatio","none"),"circle"===a){const e=t.ownerSVGElement;if(!e)return;const n="clip-".concat(Math.random().toString(36).substr(2,9));if(!e.querySelector("#".concat(n))){const t=e.querySelector("defs")||e.insertBefore(document.createElementNS(C7,"defs"),e.firstChild),r=document.createElementNS(C7,"clipPath");r.setAttribute("id",n);const i=document.createElementNS(C7,"circle");i.setAttribute("cx",s),i.setAttribute("cy",l),i.setAttribute("r",Math.min(c,u)/2),r.appendChild(i),t.appendChild(r)}t.setAttribute("clip-path","url(#".concat(n,")"))}}}const _7=(e,t)=>{if((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":case"image":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}})(t)){for(const 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||d6(t.attrs,x6);const n=f7(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",g7(e.getAttribute("text-anchor"),n)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){const n=e.ownerDocument.createElementNS(C7,"title");n.textContent=t.attrs.title,e.appendChild(n)}else if("image"===t.type&&"src"===n){e.setAttributeNS("http://www.w3.org/1999/xlink","href",t.attrs.src);let n=new Image;n.src=t.attrs.src,n.onload=E7({element:e,attrs:t.attrs})}else e.setAttribute(n,t.attrs[n]);else{const r=+e.getAttribute(n)||0;let i=0;i="dominant-baseline"===n?h6(t.attrs):t.attrs[n],e.setAttribute("dy",i+r)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"==typeof t.data&&null!==t.data)for(const n in t.data)"string"!=typeof t.data[n]&&"number"!=typeof t.data[n]&&"boolean"!=typeof t.data[n]||e.setAttribute("data-".concat(n),t.data[n])}};class R7{constructor(e,t,n,r){this.create=e,this.nodeCreator=t,this.nodeMaintainer=n,this.nodeDestroyer=r}render(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function I7(){return new R7(S7,M7,_7,k7)}function D7(e){let t,n,r,i=0;if(0===(e=JSON.stringify(e)).length)return i;for(t=0,r=e.length;t<r;t++)n=e.charCodeAt(t),i=(i<<5)-i+n,i&=i;return i}function A7(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C7,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:V8;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:I7)();let r,i,o,a=!1,s=Y8();const l={transform:void 0,disableScreenReader:!1},c=K8(),u={type:"defs",children:[]},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:D7,n={},r=Date.now();const i={onCreate(i){let o={};i.node&&"object"==typeof i.node.fill&&"pattern"===i.node.fill.type&&i.node.fill.shapes&&(o.fill=i.node.fill),i.node&&"object"==typeof i.node.stroke&&"pattern"===i.node.stroke.type&&i.node.stroke.shapes&&(o.stroke=i.node.stroke),Object.keys(o).forEach((a=>{let s="";const l=o[a],c=t(l),u="picasso-pattern-".concat(r,"-").concat(c);if("undefined"!=typeof window&&(s=window.location.href.split("#")[0]),!n[c]){const t={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach((e=>{t.children.push(e)})),e.push(t),n[c]=!0}i.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(u,"')")}))},clear(){n={}}};return i}(u.children),h=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:D7,n={},r=Date.now();const i={getOrCreateGradient(){let 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]){let{orientation:t,degree:r,stops:a=[]}=i[o],c={};void 0===r&&(r=90),"radial"===t?c.type="radialGradient":(c=G0(r),["x1","x2","y1","y2"].forEach((e=>{e in i[o]&&(c[e]=i[o][e])})),c.type="linearGradient"),c.id=l,c.children=a.map((e=>{let{offset:t,color:n,opacity:r}=e;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==r?r:1)}})),e.push(c),n[s]=l}return"url('".concat(a,"#").concat(l,"')")},onCreate(e){let t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);const n=e.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=i.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=i.getOrCreateGradient(n,"stroke",t))},clear(){n={}}};return i}(u.children);return c.element=()=>r,c.root=()=>i,c.settings=e=>(e&&Object.keys(l).forEach((t=>{void 0!==e[t]&&(l[t]=e[t])})),l),c.appendTo=t=>(r||(r=t.ownerDocument.createElementNS(e,"svg"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none",r.setAttribute("xmlns",e),i=t.ownerDocument.createElementNS(e,"g"),i.style.pointerEvents="auto",r.appendChild(i)),t.appendChild(r),r),c.getScene=e=>{const n=s.scaleRatio.x,r=s.scaleRatio.y,i={type:"container",children:Array.isArray(e)?[...e,u]:e,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*n,", ").concat(s.edgeBleed.top*r,")"):""};return 1===n&&1===r||(i.transform+="scale(".concat(n,", ").concat(r,")")),t({items:[i],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},h.onCreate,d.onCreate,u6(c.measureText),X8(c)]}})},c.render=e=>{if(!r)return!1;const t="function"==typeof l.transform&&l.transform();if(t){const{horizontalScaling:e,horizontalSkewing:n,verticalSkewing:r,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=t;return i.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(r,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}i.style.transform="";l.disableScreenReader&&r.setAttribute("aria-hidden",!0),a&&(r.style.left="".concat(s.computedPhysical.x,"px"),r.style.top="".concat(s.computedPhysical.y,"px"),r.setAttribute("width",s.computedPhysical.width),r.setAttribute("height",s.computedPhysical.height)),h.clear(),d.clear(),u.children.length=0;const p=c.getScene(e),f=!o||!p.equals(o),m=a||f;return m&&(c.clear(),n.render(p.children,i)),a=!1,o=p,m},c.itemsAt=e=>o?o.getItemsFrom(e):[],c.findShapes=e=>o?o.findShapes(e):[],c.clear=()=>{if(!i)return c;o=null;const e=i.cloneNode(!1);return r.replaceChild(e,i),i=e,c},c.destroy=()=>{r&&r.parentNode&&r.parentNode.removeChild(r),r=null,i=null},c.size=e=>{if(e){const t=Y8(e);JSON.stringify(s)!==JSON.stringify(t)&&(a=!0,s=t)}return s},c}var P7,O7,T7,L7,q7,N7,j7,z7={},F7=[],W7=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function $7(e,t){for(var n in t)e[n]=t[n];return e}function B7(e){var t=e.parentNode;t&&t.removeChild(e)}function H7(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?P7.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 V7(e,a,r,i,null)}function V7(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?++T7:i};return null==i&&null!=O7.vnode&&O7.vnode(o),o}function G7(e){return e.children}function U7(e,t){this.props=e,this.context=t}function Y7(e,t){if(null==t)return e.__?Y7(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?Y7(e):null}function K7(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 K7(e)}}function X7(e){(!e.__d&&(e.__d=!0)&&L7.push(e)&&!J7.__r++||q7!==O7.debounceRendering)&&((q7=O7.debounceRendering)||N7)(J7)}function J7(){var e,t,n,r,i,o,a,s;for(L7.sort(j7);e=L7.shift();)e.__d&&(t=L7.length,r=void 0,i=void 0,a=(o=(n=e).__v).__e,(s=n.__P)&&(r=[],(i=$7({},o)).__v=o.__v+1,a9(s,o,i,n.__n,void 0!==s.ownerSVGElement,null!=o.__h?[a]:null,r,null==a?Y7(o):a,o.__h),s9(r,o),o.__e!=a&&K7(o)),L7.length>t&&L7.sort(j7));J7.__r=0}function Z7(e,t,n,r,i,o,a,s,l,c){var u,d,h,p,f,m,g,y=r&&r.__k||F7,v=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(p=n.__k[u]=null==(p=t[u])||"boolean"==typeof p||"function"==typeof p?null:"string"==typeof p||"number"==typeof p||"bigint"==typeof p?V7(null,p,null,null,p):Array.isArray(p)?V7(G7,{children:p},null,null,null):p.__b>0?V7(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)){if(p.__=n,p.__b=n.__b+1,null===(h=y[u])||h&&p.key==h.key&&p.type===h.type)y[u]=void 0;else for(d=0;d<v;d++){if((h=y[d])&&p.key==h.key&&p.type===h.type){y[d]=void 0;break}h=null}a9(e,p,h=h||z7,i,o,a,s,l,c),f=p.__e,(d=p.ref)&&h.ref!=d&&(g||(g=[]),h.ref&&g.push(h.ref,null,p),g.push(d,p.__c||f,p)),null!=f?(null==m&&(m=f),"function"==typeof p.type&&p.__k===h.__k?p.__d=l=Q7(p,l,e):l=e9(e,p,h,y,f,l),"function"==typeof n.type&&(n.__d=l)):l&&h.__e==l&&l.parentNode!=e&&(l=Y7(h))}for(n.__e=m,u=v;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=t9(r).nextSibling),u9(y[u],y[u]));if(g)for(u=0;u<g.length;u++)c9(g[u],g[++u],g[++u])}function Q7(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?Q7(r,t,n):e9(n,r,r,i,r.__e,t));return t}function e9(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+=1)if(s==i)break e;e.insertBefore(i,o),a=o}return void 0!==a?a:i.nextSibling}function t9(e){var t,n,r;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=t9(n)))return r;return null}function n9(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||W7.test(t)?n:n+"px"}function r9(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||n9(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||n9(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?o9:i9,o):e.removeEventListener(t,o?o9:i9,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"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&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function i9(e){return this.l[e.type+!1](O7.event?O7.event(e):e)}function o9(e){return this.l[e.type+!0](O7.event?O7.event(e):e)}function a9(e,t,n,r,i,o,a,s,l){var c,u,d,h,p,f,m,g,y,v,b,x,w,S,C,M=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]),(c=O7.__b)&&c(t);try{e:if("function"==typeof M){if(g=t.props,y=(c=M.contextType)&&r[c.__c],v=c?y?y.props.value:c.__:r,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in M&&M.prototype.render?t.__c=u=new M(g,v):(t.__c=u=new U7(g,v),u.constructor=M,u.render=d9),y&&y.sub(u),u.props=g,u.state||(u.state={}),u.context=v,u.__n=r,d=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=M.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=$7({},u.__s)),$7(u.__s,M.getDerivedStateFromProps(g,u.__s))),h=u.props,p=u.state,u.__v=t,d)null==M.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==M.getDerivedStateFromProps&&g!==h&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,v),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,v)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<u._sb.length;b++)u.__h.push(u._sb[b]);u._sb=[],u.__h.length&&a.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,v),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(h,p,f)}))}if(u.context=v,u.props=g,u.__P=e,x=O7.__r,w=0,"prototype"in M&&M.prototype.render){for(u.state=u.__s,u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),S=0;S<u._sb.length;S++)u.__h.push(u._sb[S]);u._sb=[]}else do{u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(r=$7($7({},r),u.getChildContext())),d||null==u.getSnapshotBeforeUpdate||(f=u.getSnapshotBeforeUpdate(h,p)),C=null!=c&&c.type===G7&&null==c.key?c.props.children:c,Z7(e,Array.isArray(C)?C:[C],t,n,r,i,o,a,s,l),u.base=t.__e,t.__h=null,u.__h.length&&a.push(u),m&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=l9(n.__e,t,n,r,i,o,a,l);(c=O7.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=s,t.__h=!!l,o[o.indexOf(s)]=null),O7.__e(e,t,n)}}function s9(e,t){O7.__c&&O7.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){O7.__e(e,t.__v)}}))}function l9(e,t,n,r,i,o,a,s){var l,c,u,d=n.props,h=t.props,p=t.type,f=0;if("svg"===p&&(i=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&"setAttribute"in l==!!p&&(p?l.localName===p:3===l.nodeType)){e=l,o[f]=null;break}if(null==e){if(null===p)return document.createTextNode(h);e=i?document.createElementNS("http://www.w3.org/2000/svg",p):document.createElement(p,h.is&&h),o=null,s=!1}if(null===p)d===h||s&&e.data===h||(e.data=h);else{if(o=o&&P7.call(e.childNodes),c=(d=n.props||z7).dangerouslySetInnerHTML,u=h.dangerouslySetInnerHTML,!s){if(null!=o)for(d={},f=0;f<e.attributes.length;f++)d[e.attributes[f].name]=e.attributes[f].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||r9(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]||r9(e,o,t[o],n[o],r)}(e,h,d,i,s),u)t.__k=[];else if(f=t.props.children,Z7(e,Array.isArray(f)?f:[f],t,n,r,i&&"foreignObject"!==p,o,a,o?o[0]:n.__k&&Y7(n,0),s),null!=o)for(f=o.length;f--;)null!=o[f]&&B7(o[f]);s||("value"in h&&void 0!==(f=h.value)&&(f!==e.value||"progress"===p&&!f||"option"===p&&f!==d.value)&&r9(e,"value",f,d.value,!1),"checked"in h&&void 0!==(f=h.checked)&&f!==e.checked&&r9(e,"checked",f,d.checked,!1))}return e}function c9(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){O7.__e(e,n)}}function u9(e,t,n){var r,i;if(O7.unmount&&O7.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||c9(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){O7.__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]&&u9(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||B7(e.__e),e.__=e.__e=e.__d=void 0}function d9(e,t,n){return this.constructor(e,n)}function h9(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createElement:t=document.createElement.bind(document)}=e;let n,r,i=Y8();const o={transform:void 0,disableScreenReader:!1},a=K8();return a.element=()=>n,a.root=()=>n,a.settings=e=>(e&&Object.keys(o).forEach((t=>{void 0!==e[t]&&(o[t]=e[t])})),o),a.appendTo=e=>(n||(n=t("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),e.appendChild(n),n),a.render=e=>{if(!n)return!1;const t="function"==typeof o.transform&&o.transform();if(t){const{horizontalScaling:e,horizontalSkewing:r,verticalSkewing:i,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=t;return n.style.transform="matrix(".concat(e,", ").concat(r,", ").concat(i,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}n.style.transform="";let a;return o.disableScreenReader&&n.setAttribute("aria-hidden",!0),n.style.left="".concat(i.computedPhysical.x,"px"),n.style.top="".concat(i.computedPhysical.y,"px"),n.style.width="".concat(i.computedPhysical.width,"px"),n.style.height="".concat(i.computedPhysical.height,"px"),a=Array.isArray(e)?H7("div",null,e):e,r=function(e,t,n){var r,i,o;O7.__&&O7.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],a9(t,e=(!r&&n||t).__k=H7(G7,null,[e]),i||z7,z7,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?P7.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),s9(o,e)}(a,n,r),!0},a.renderArgs=[H7],a.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;r=null}return a},a.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,r=null},a.size=e=>(e&&(i=Y8(e)),i),a}P7=F7.slice,O7={__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}},T7=0,U7.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=$7({},this.state),"function"==typeof e&&(e=e($7({},n),this.props)),e&&$7(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),X7(this))},U7.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),X7(this))},U7.prototype.render=G7,L7=[],N7="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,j7=function(e,t){return e.__v.__b-t.__v.__b},J7.__r=0;var p9=[function(e){e.renderer("svg",A7)},function(e){e.renderer("canvas",a7)},function(e){e.renderer("dom",h9)}];const f9={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const m9=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=function(){let{level:e=f9.OFF,pipe:t=console}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e;const r={[f9.OFF]:()=>{},[f9.ERROR]:function(){return t.error(...arguments)},[f9.WARN]:function(){return t.warn(...arguments)},[f9.INFO]:function(){return t.info(...arguments)},[f9.DEBUG]:function(){return t.log(...arguments)}},i=function(e){if(e&&!(n<e)){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];(r[e]||r[f9.DEBUG])(...i)}};return{log:i,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(f9.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(f9.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(f9.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i(f9.DEBUG,...t)},level:e=>("number"==typeof e&&(n=e),n),LOG_LEVEL:f9}}(t.logger),i={component:_K(n.component,"component",r),data:_K(n.data,"data",r),formatter:_K(n.formatter,"formatter",r),interaction:_K(n.interaction,"interaction",r),renderer:f2(n.renderer),scale:_K(n.scale,"scale",r),symbol:_K(n.symbol,"symbol",r),logger:r};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e({palettes:t.palettes.concat(n.palettes||[]),style:uY({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer},i)}return t.renderer&&t.renderer.prio&&i.renderer.default(t.renderer.prio[0]),o.use=function(e){return function(e){e(arguments.length>2?arguments[2]:void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i)},o.chart=e=>p2(e,{registries:i,logger:r,style:t.style,palettes:t.palettes}),o.config=()=>t,Object.keys(i).forEach((e=>{o[e]=i[e]})),o.version=dY,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:m2,data:x2,formatter:JJ,interaction:w2,renderer:f2(),scale:ZQ,symbol:i1});D4.forEach(m9.use),p9.forEach(m9.use),[].forEach(m9.use);const g9=m9();g9.use(tY),g9.renderer.prio(["canvas"]);const y9=(e,t)=>e&&"center"!==e&&"rtl"===t?IH(e):e,v9=({cell:e,representation:t,textStyle:n,imageContainerHorizontalAlignment:r})=>{const{imageBox:i}=t,{styleService:{grid:{lineClamp:o}}}=ZF(),{direction:a}=GF();return Ji.jsxs("div",{style:{display:"grid",gridTemplateColumns:`${i?.width??24}px 1fr`,maxHeight:"fit-content",alignItems:"center",justifyContent:"flex-start",boxSizing:"border-box"},children:[Ji.jsx("div",{"data-key":"image-container--partial-image",style:{display:"flex",flexDirection:"column",justifyContent:WH(e),alignItems:y9(r,a),overflow:"hidden",boxSizing:"border-box",border:"4px solid transparent",width:i?.width??24,height:"100%"},children:Ji.jsx(sV,{representation:t,textStyle:n})}),Ji.jsx(FV,{padding:4/(o<=2?2:1),alignSelf:WH(e,!0),children:!!t.labelStructure&&oV(t.labelStructure)})]})},b9=({suffix:e,delimeter:t})=>` ${e?t:""} ${e}`,x9=({href:e,text:t,labelStructure:n,interactions:r,color:i})=>Ji.jsxs("span",{children:[Ji.jsx(fd,{...pG({href:e,text:t,interactions:r,color:i}),children:n?.maskedValue?n.maskedValue:n?.originalValue}),!!n&&b9(n)]}),w9=({children:e,textStyle:t,shouldEnableStickyText:n})=>Ji.jsx("span",{style:{...t,border:"4px solid transparent",boxSizing:"border-box",...n&&{alignSelf:"flex-start",position:"sticky",top:0}},children:e}),S9=({isLeftColumn:e,styleService:t,cell:n,isIndentModeEnabled:r})=>e?r?t.grid.lineClamp:Math.max(t.grid.lineClamp,n.leafCount*t.grid.lineClamp):t.grid.columnLineClamp,C9=({cell:e,isCellSelected:t,isLeftColumn:n})=>{const{direction:r}=GF(),{isActive:i}=jH(),{layoutService:o,styleService:a}=ZF(),{interactions:s}=KF(),l=n&&o.isIndentModeEnabled;let c=n&&!e.isNull?(e=>{const{representation:{text:t,labelStructure:n}}=e;if(!n||!n.originalValue)return t;const{originalValue:r,maskedValue:i,suffix:o,delimeter:a}=n;return`${0!==i.length?i:r} ${o?a:""} ${o}`.trim()})(e):e.representation.text;if(e.isEmpty)return null;const u=(({cell:e,styleService:t,isCellSelected:n,isLeftColumn:r,isIndentModeEnabled:i})=>({...Hj,...Vj(S9({cell:e,isLeftColumn:r,styleService:t,isIndentModeEnabled:i})),color:GH({cell:e,styleService:t,isCellSelected:n}),fontWeight:UH({cell:e,styleService:t}),fontStyle:YH({cell:e,styleService:t}),textDecoration:KH({cell:e,styleService:t}),fontFamily:t.dimensionValues.fontFamily,fontSize:t.dimensionValues.fontSize}))({cell:e,styleService:a,isCellSelected:t,isLeftColumn:n,isIndentModeEnabled:o.isIndentModeEnabled});if(e.representation.type===QN.Image&&!e.isTotal&&!e.isNull){const{labelStructure:t}=e.representation,i=n&&t&&t.suffix?v9:lV;return Ji.jsx(i,{cell:e,representation:e.representation,leafCount:e.leafCount,textStyle:u,isLeftColumn:n,canExpandOrCollapse:e.ref.qCanCollapse||e.ref.qCanExpand,imageContainerHorizontalAlignment:cG(e,o,n,r)})}if(e.representation.type===QN.Link&&!i&&!e.isTotal){const t=n&&e.representation.labelStructure?x9:fG;c=Ji.jsx(t,{text:e.representation.text,labelStructure:e.representation.labelStructure,href:e.representation.url,interactions:s,color:e.expressionColor.color})}return Ji.jsx(w9,{shouldEnableStickyText:l,textStyle:{...u,...e.representation.type===QN.Image&&e.isNull?{alignSelf:WH(e)}:{}},children:c})},M9=({index:e,style:t,data:n})=>{const{styleService:r,layoutService:i}=ZF(),{isSelected:o}=jH(),{isLeftColumn:a=!1,showLastBorder:s,itemCount:l,isLast:c,totalDividerIndex:u}=n,{isAdjustingWidth:d,setIsAdjustingWidth:h}=_V([n]),p=lG(e,n),f=a?e===l-1:c,m=a?c:e===l-1,g=QB(p,u,i.isIndentModeEnabled);if(void 0===p){const{background:n}=r.dimensionValues;return Ji.jsx(eH,{style:{...t,background:n},index:e,isLastRow:f,isLastColumn:m,showLastBorder:s,isLeftColumn:a,showTotalCellDivider:g})}const y=o(p);return Ji.jsxs(dG,{reactWindowStyle:t,isLeftColumn:a,isLastRow:f,isLastColumn:m,isCellSelected:y,showTotalCellDivider:g,cell:p,data:n,isAdjustingWidth:d,index:e,children:[Ji.jsxs(tH,{verticalAlign:WH(p),width:nH(p.representation),right:p.isLeftColumn?void 0:4,isLeftColumn:a,children:[Ji.jsx(QH,{isLeftColumn:a,isCellSelected:y,cell:p}),Ji.jsx(C9,{isLeftColumn:a,isCellSelected:y,cell:p})]}),Ji.jsx(DV,{cellInfo:{...p,columnWidthLocation:p.isPseudoDimension?aj.Measures:aj.Dimension},columnWidth:t.width,isLastColumn:m,setIsAdjustingWidth:h})]})};var k9=t.memo(M9,jB);const E9=({list:e,listValues:t,isLastRow:n,getRightGridColumnWidth:r})=>i=>{const o=n?e[i]:t.at(i);return o&&0===i&&o.x>0?(o.leafCount+o.x+o.distanceToNextCell)*r():!n&&o?(o.leafCount+o.distanceToNextCell)*r():r(o?.x??i)},_9=(e,t,n,r)=>{const i=Object.values(e);let o,a=i.length;return r&&(a=n,o=t/a),{itemCount:a,estimatedItemSize:o,listValues:i}},R9=(e,t)=>n=>{e.current&&(e.current[t]=n)},I9={display:"flex",height:"fit-content",borderWidth:"1px 0px 0px 0px",...$j},D9={overflow:"hidden",willChange:"auto",flexShrink:0},A9=({leftGridRef:e,width:t,height:n,columnWidths:r,showLastBorder:i})=>{const{pageInfo:o,direction:a}=GF(),{layoutService:s,styleService:{contentCellHeight:l,grid:{divider:c}}}=ZF(),{qSize:u}=s.layout.qHyperCube,{gridSectionsData:{leftDimensionData:d},visibleDimensionsInfo:{visibleLeftDimensionInfo:h}}=w$();sG(e,d),aG(e,t,n,l);const p=o.rowsOnCurrentPage*l,f={...I9,borderColor:c,width:r.reduce(((e,t)=>e+t),0)};return Ji.jsx("div",{style:f,"data-section-id":"LEFT_GRID",children:d.grid.map(((t,c)=>{const f=c===d.columnCount-1,m=iW(h[c]),{itemCount:g,estimatedItemSize:y,listValues:v}=_9(t,p,o.rowsOnCurrentPage,f),b=s.isIndentModeEnabled?()=>l:((e,t,n,r,i)=>o=>{const a=r?e[o]:t.at(o);if(a&&0===o&&a.pageY>0)return(a.leafCount+a.pageY+a.distanceToNextCell)*n;if(a&&a.leafCount>0){const e=a.y===i-a.leafCount;return(a.leafCount-(e?a.ref.qUp:0)+a.distanceToNextCell)*n}return n})(t,v,l,f,u.qcy);return Ji.jsx(TB,{ref:R9(e,c),style:{...D9,flexGrow:f?1:0,direction:a},height:n,width:r[c],itemCount:g,itemSize:b,layout:"vertical",itemData:{list:t,isLeftColumn:!0,isLast:f,itemCount:g,showLastBorder:i,listValues:v,totalDividerIndex:d.totalDividerIndex},itemKey:wV,estimatedItemSize:y,children:k9},m)}))})};var P9=g(A9);const O9={overflow:"hidden",willChange:"auto"},T9=e=>({...$j,borderWidth:"rtl"===e?"0px 1px 0px 0px":"0px 0px 0px 1px"}),L9=({topGridRef:e,rowHightCallback:t,width:n,height:r,showLastBorder:i,getRightGridColumnWidth:o})=>{const{direction:a}=GF(),{layoutService:s,styleService:{grid:{divider:l},headerCellHeight:c}}=ZF(),{gridSectionsData:{headersData:u,topDimensionData:d}}=w$(),h={...T9(a),borderColor:l,height:r};sG(e,d),aG(e,n,r,c);const p=s.size.x*o();return 0===d.rowCount?Ji.jsx("div",{style:{width:n,height:r,...T9(a)}}):Ji.jsx("div",{style:h,"data-section-id":"TOP_GRID",children:d.grid.map(((r,l)=>{const c=l===d.rowCount-1,{itemCount:h,estimatedItemSize:f,listValues:m}=_9(r,p,s.size.x,c),g=(({layoutService:e,headersData:t,topRowIndex:n})=>{const r=t.data.at(n);if(void 0===r)return;const i=t.size.x-1,o=nG({layoutService:e,headersData:t,topRowIndex:n})?0:i,a=r.at(o),s=Array.isArray(a)?a.at(i):a;return s?e.getDimensionInfo(s.dimensionInfoIndex):void 0})({layoutService:s,headersData:u,topRowIndex:l}),y=g?iW(g):`empty ${l}`;return Ji.jsx(TB,{ref:R9(e,l),style:O9,height:t(),width:n,itemCount:h,itemSize:E9({list:r,listValues:m,isLastRow:c,getRightGridColumnWidth:o}),layout:"horizontal",itemData:{list:r,isLast:c,itemCount:h,showLastBorder:i,listValues:m,totalDividerIndex:d.totalDividerIndex},itemKey:wV,estimatedItemSize:f,direction:a,children:k9},y)}))})};var q9=g(L9);const N9=()=>{const{styleService:{headerCellHeight:e,contentCellHeight:t}}=ZF(),n=Y$(),r=(()=>{const{model:e}=KF(),t=h((async(t,n)=>{if(!e)throw new Error("No Model provided!");const{qReverseSort:r,dimensionInfoIndex:i,sortDirection:o}=t,a=[];if(n===o)return!1;a.push({qPath:`/qHyperCubeDef/qDimensions/${i}/qDef/qReverseSort`,qOp:"Replace",qValue:(!r).toString()});try{return await e.applyPatches(a,!0),!0}catch(e){return console.error("Error while applying patch: ",e),!1}}),[e]);return t})(),{gridSectionsWrapperRefs:{headerGridWrapperRef:i,topGridWrapperRef:o,leftGridWrapperRef:a,dataGridWrapperRef:s},gridRefs:{topGridRef:l,leftGridRef:u,dataGridRef:d},scrollDirectionRefs:{verticalScrollDirection:p,horizontalScrollDirection:f},scrollbarsDimensions:{verticalScrollbarWidth:m,horizontalScrollbarHeight:g,resetHorizontalScrollbarHeight:y}}=U$(),{leftGridWidth:v,leftGridFullWidth:b,leftGridColumnWidths:x,rightGridFullWidth:w,showLastRightBorder:S,getRightGridColumnWidth:C,getHeaderCellsIconsVisibilityStatus:M,overrideLeftGridWidth:k}=function({tableWidth:e,verticalScrollbarWidth:t,resetHorizontalScrollbarHeight:n}){const{layoutService:r,styleService:i}=ZF(),{gridSectionsData:{headersData:o}}=w$(),{measureText:a}=gz(i.header),s=z$({tableWidth:e}),l=F$({tableWidth:e,verticalScrollbarWidth:t,leftGridWidth:s.leftGridWidth}),u=s.leftGridWidth+l.rightGridFullWidth+1<e,d=h(((e,t,n="")=>{let i=e;r.isIndentModeEnabled&&(i=1,1===o.size.x&&(i=0));const l=s.leftGridColumnWidths[i];let c=!1,u=!1,d=a(n)+M$;return t&&d+C$<=l&&(u=!0,d+=C$),d+C$<=l&&(c=!0),{shouldShowMenuIcon:c,shouldShowLockIcon:u}}),[s.leftGridColumnWidths,a,r.isIndentModeEnabled,o.size.x]);return c((()=>{const e=s.leftGridWidth===s.leftGridFullWidth,t=l.rightGridWidth===l.rightGridFullWidth;e&&t&&n()}),[n,s.leftGridWidth,s.leftGridFullWidth,l.rightGridWidth,l.rightGridFullWidth]),{...s,...l,showLastRightBorder:u,getHeaderCellsIconsVisibilityStatus:d}}({tableWidth:n.width,verticalScrollbarWidth:m,resetHorizontalScrollbarHeight:y}),{gridScaffoldDimensions:E,headerGridDims:_,topGridDims:R,leftGridDims:I,dataGridDims:D,metadata:{everyThingFitsInTableRectHeight:A,scrollbarsVisibilityStatus:P}}=(({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:n,leftGridOriginalWidth:r,rightGridOriginalWidth:i},scrollBarsDimensions:{verticalScrollbarWidth:o,horizontalScrollbarHeight:a}})=>{const s=Y$(),{pageInfo:l}=GF(),{gridSectionsData:{headersData:c,topDimensionData:u}}=w$(),d=Math.min(s.height*k$,Math.max(s.height*k$-25,s.height-t-a)),h=s.width*k$,p=l.rowsOnCurrentPage*t,f=Math.max(c.size.y,u.rowCount,1),m=e*f,g=e*f,y=Math.min(h,n),v=s.width-h,b=Math.max(v,s.width-y),x=Math.min(d,m,g),{availableHeight:w,everyThingFitsInTableRectHeight:S,everyThingFitsInTableRectWidth:C}=((e,t,n)=>{const r=t+1+n+o<=s.width,i=e+1+p+a,l=i-s.height<a||i<=s.height;return{availableHeight:l?i:s.height,everyThingFitsInTableRectHeight:l,everyThingFitsInTableRectWidth:r}})(x,y,b),M=w-d,k=Math.max(M,w-x),E=Math.min(k,p),_=Math.min(k,p),R=m+1+p,{visibilityStatus:I,metadata:{hasLeftGridOverflowX:D,hasDataGridOverflowX:A}}=(e=>{const{gridScaffold:{X_AXIS:{leftSectionWidth:t,rightSectionWidth:n},Y_AXIS:{topSectionHeight:r,bottomSectionHeight:i}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:o,rightSectionFullWidth:a},Y_AXIS:{topSectionFullHeight:s,bottomSectionFullHeight:l}}}=e,c=s>r,u=o>t,d=a>n,h=l>i;return{visibilityStatus:{topGrid:{overflowX:"hidden",overflowY:c?"scroll":"hidden"},leftGrid:{overflowX:u?"scroll":"hidden",overflowY:"hidden"},dataGrid:{overflowX:d?"scroll":"hidden",overflowY:h?"scroll":"hidden"}},metadata:{hasTopGridOverflowY:c,hasLeftGridOverflowX:u,hasDataGridOverflowX:d,hasDataGridOverflowY:h}}})({gridScaffold:{X_AXIS:{leftSectionWidth:y,rightSectionWidth:b},Y_AXIS:{topSectionHeight:x,bottomSectionHeight:k}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:r,rightSectionFullWidth:i},Y_AXIS:{topSectionFullHeight:g,bottomSectionFullHeight:R-g}}});return{gridScaffoldDimensions:{width:s.width,height:s.height,gridTemplateColumns:`${y}px ${b}px`,gridTemplateRows:`${x}px ${k}px`},headerGridDims:{width:-1,height:x},topGridDims:{fullSizeWrapper:{width:i-o+(A?o:0),height:g},stickyWrapper:{width:b-1-o,height:-1},self:{width:Math.min(i,b)-(C?1:0)-o,height:g}},leftGridDims:{fullSizeWrapper:{width:y,height:R-g+(!D&&A?a:0)},stickyWrapper:{width:y,height:k-1-a},self:{width:y,height:Math.max(t,E-(S?0:a-1))}},dataGridDims:{fullSizeWrapper:{width:i-o+(A?o:0),height:R-g+(!A&&D?a:0)},stickyWrapper:{width:b-1-o,height:k-1-a},self:{width:Math.min(i,b)-(C?1:0)-o,height:Math.max(t,_-(S?0:a-1))}},metadata:{everyThingFitsInTableRectHeight:S,scrollbarsVisibilityStatus:I}}})({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:v,leftGridOriginalWidth:b,rightGridOriginalWidth:w},scrollBarsDimensions:{verticalScrollbarWidth:m,horizontalScrollbarHeight:g}}),O=h((()=>e),[e]),T=h((()=>t),[t]);return(()=>{const{downloadService:e}=ZF();c((()=>{e.isDownloadedAsPDForImage&&e.notifyIsDoneRendering()}))})(),Ji.jsxs(X$,{style:E,children:[Ji.jsx("div",{style:{overflow:"hidden"},ref:i,children:Ji.jsx(oG,{tableWidth:n.width,leftGridWidth:v,columnWidths:x,getHeaderCellsIconsVisibilityStatus:M,rowHight:e,height:_.height,changeSortOrder:r,overrideLeftGridWidth:k})}),Ji.jsx(Q$,{style:P.topGrid,origin:lj.TopGrid,ref:o,children:Ji.jsx(K$,{style:R.fullSizeWrapper,children:Ji.jsx(eB,{style:R.stickyWrapper,children:Ji.jsx(q9,{topGridRef:l,rowHightCallback:O,...R.self,showLastBorder:{right:S,bottom:!1},getRightGridColumnWidth:C})})})}),Ji.jsx(Q$,{style:P.leftGrid,origin:lj.LeftGrid,ref:a,children:Ji.jsx(K$,{style:I.fullSizeWrapper,children:Ji.jsx(eB,{style:I.stickyWrapper,children:Ji.jsx(P9,{leftGridRef:u,...I.self,columnWidths:x,showLastBorder:{right:!1,bottom:A}})})})}),Ji.jsx(Q$,{style:P.dataGrid,origin:lj.DataGrid,ref:s,children:Ji.jsx(K$,{style:D.fullSizeWrapper,children:Ji.jsx(eB,{style:D.stickyWrapper,children:Ji.jsx(kV,{dataGridRef:d,rowHightCallback:T,...D.self,showLastBorder:{right:S,bottom:A},getRightGridColumnWidth:C,verticalScrollDirection:p,horizontalScrollDirection:f})})})})]})},j9=()=>{const{keyboard:e,theme:t,interactions:n,translator:r}=KF(),{pageInfo:i,updatePageInfo:o,rect:a}=GF(),{layoutService:s}=ZF(),{layout:l,hasData:c}=s;return Ji.jsxs(Ji.Fragment,{children:[c?Ji.jsx(N9,{}):null,Ji.jsx(eW,{}),Ji.jsx(HF,{paginationNeeded:i.shouldShowPagination,handleChangePage:e=>{o({page:e})},pageInfo:i,totalRowCount:i.totalRowCount,totalColumnCount:0,totalPages:i.totalPages,keyboard:e,translator:r,theme:t,interactions:n,rect:a,layout:l})]})};const z9=(e,{selections:n,baseObjects:r,coreServices:i,nebulaObjects:o})=>{const a=function(e){const t=Aw();return t?.components?.MuiTable?.styleOverrides&&(t.components.MuiTable.styleOverrides.root={}),ks({...t,direction:e})}(r.direction);e.render(Ji.jsx(t.StrictMode,{children:Ji.jsx(ul,{theme:a,children:Ji.jsx(XF,{...o,children:Ji.jsx(UF,{...r,children:Ji.jsx(zH,{selections:n,children:Ji.jsx(QF,{...i,children:Ji.jsx(S$,{children:Ji.jsx(j9,{})})})})})})})}))};var F9=function(e){return e.FontSize="fontSize",e.FontFamily="fontFamily",e.FontColor="fontColor",e.FontStyle="fontStyle",e.Background="background",e.LineClamp="lineClamp",e.ColumnLineClamp="columnLineClamp",e.Border="border",e.Divider="divider",e}(F9||{}),W9=function(e){return e.Dimension="object.pivotTableV2.dimension",e.Measure="object.pivotTableV2.measure",e.Total="object.pivotTableV2.total",e.Null="object.pivotTableV2.null",e.Grid="object.pivotTableV2",e}(W9||{}),$9=function(e){return e.Grid="grid",e.Divider="grid.divider",e.LabelName="label.name",e.LabelValue="label.value",e}($9||{}),B9=function(e){return e.FontSize="fontSize",e.FontFamily="fontFamily",e.FontColor="color",e.BackgroundColor="backgroundColor",e.LineClamp="lineClamp",e.ColumnLineClamp="columnLineClamp",e.BorderColor="borderColor",e}(B9||{});const H9=e=>e?`${parseInt(e,10)}px`:void 0,V9=(e,t)=>{if(t){const n=e.getColorPickerColor(t);return"none"===n?zj.Transparent:n}},G9=(e,t)=>+(parseInt(e,10)*jj*t+8).toFixed(2),U9=(e,t)=>void 0===e?t:e.some((e=>"bold"===e))?qj:"normal",Y9=e=>e?.some((e=>"italic"===e))?"italic":"normal",K9=e=>e?.some((e=>"underline"===e))?"underline":"none",X9=document.createElement("textarea");function J9(e){X9.value=e,document.body.appendChild(X9),X9.select(),X9.setSelectionRange(0,X9.value.length),document.execCommand("copy"),document.body.removeChild(X9)}X9.style.position="absolute",X9.style.left="-9999px",X9.setAttribute("readonly","");function Z9(e){O?.(((t,n)=>{const r=n.target,i=r?.closest(`.${CT}`);i?.title&&t.addItem({translation:"contextMenu.copyCellValue",icon:"lui-icon lui-icon--copy",tid:"copy-cell-context-item",id:"copy-cell-context-item",select:async()=>{(e=>{const t=e.title;t&&(navigator.clipboard?.writeText?navigator.clipboard.writeText(t).catch((()=>{J9(t)})):J9(t))})(i)}}),e?.forEach((e=>{e(t,n,i)}))}))}const Q9=({model:e,layoutService:t,effectivePropertiesService:n,translator:r})=>oz(((i,o,a)=>{if(!e||n.qAlwaysFullyExpanded)return;const s=e,l=i.addItem({translation:"Object.PivotTable.ContextMenu.ExpandCollapse",tid:"expand-collapse-group",id:"expand-collapse-group"}),{qEffectiveDimensionName:c,label:u}=((e,t)=>{const n=((e,t)=>{const n=e?.getAttribute("data-dimension-info-index");if("string"==typeof n)return t.getDimensionInfo(+n)})(e,t);return"object"==typeof n?{qEffectiveDimensionName:n.qEffectiveDimensionName,label:n.qFallbackTitle}:{qEffectiveDimensionName:void 0,label:void 0}})(a,t);l.addItem((e=>({icon:"lui-icon lui-icon--plus",translation:"Object.PivotTable.ContextMenu.ExpandAll",tid:"expand-all",select:async()=>{try{await e.expandTop(tW,0,0,!0),await e.expandLeft(tW,0,0,!0)}catch(e){console.error("Failed to expand all",e)}}}))(s)),"string"==typeof c&&l.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:n,label:r,translator:i})=>({icon:"lui-icon lui-icon--plus",translation:i.get("SNPivotTable.ContextMenu.ExpandDimension",[r??""]),tid:"expand-dimension",id:"expand-dimension",select:HV({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n,action:WV.Expand})}))({model:s,effectivePropertiesService:n,qEffectiveDimensionName:c,label:u,translator:r})),l.addItem((e=>({icon:"lui-icon lui-icon--minus",translation:"Object.PivotTable.ContextMenu.CollapseAll",tid:"collapse-all",select:async()=>{try{await e.collapseTop(tW,0,0,!0),await e.collapseLeft(tW,0,0,!0)}catch(e){console.error("Failed to collapse all",e)}}}))(s)),"string"==typeof c&&l.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:n,label:r,translator:i})=>({icon:"lui-icon lui-icon--minus",translation:i.get("SNPivotTable.ContextMenu.CollapseDimension",[r??""]),tid:"collapse-dimension",id:"collapse-dimension",select:HV({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n,action:WV.Collapse})}))({model:s,effectivePropertiesService:n,qEffectiveDimensionName:c,label:u,translator:r}))}),[e,t,n]),eee=(e,t)=>E((()=>(({layout:e})=>{const{qHyperCube:t,nullValueRepresentation:n,snapshotData:r}=e,{qNoOfLeftDims:i,qEffectiveInterColumnSortOrder:o,qMeasureInfo:a,qDimensionInfo:s}=t,l=!!r,c=r?.content?.rowsPerPage??15e3,u={x:Math.min(e.qHyperCube.qSize.qcx,Nj),y:Math.min(e.qHyperCube.qSize.qcy,c)},d=o.slice(0,i),h=e=>d.some((t=>t===e)),p=h(nW),f=new Map(o.map((e=>[s[e]??nW,e]))),m=a.filter((e=>7005!==e.qError?.qErrorCode));return{layout:e,getNullValueText:()=>n?.text??"-",getMeasureInfoIndexFromCellIndex:(e,t=!1)=>{if(p)return 0;const n=e%m.length;return t?n:a.findIndex((e=>e===m[n]))},getDimensionInfo:e=>e===nW?void 0:s.at(e),getDimensionInfoIndex:e=>f.get(e)??-1,size:u,isSnapshot:l,hasLimitedData:!l&&u.x<e.qHyperCube.qSize.qcx,hasData:u.x>0&&u.y>0,hasLeftDimensions:0!==e.qHyperCube.qNoOfLeftDims,hasPseudoDimOnLeft:p,leftDimensionInfoIndexes:d,isLeftDimension:h,triggerdByExpandOrCollapse:!!e.qHyperCube.qLastExpandedPos,visibleMeasureInfo:m,isIndentModeEnabled:Boolean(e.qHyperCube.qIndentMode),indentModeColumnWidth:e.qHyperCube.indentModeColumnWidth??{type:RT.Auto,pixels:_T.PixelsDefault,percentage:_T.PercentageDefault},searchSortFromDimension:"inherit"===e.search?.sorting}})({layout:e})),[e,t]),tee=({model:e,layoutService:t,viewService:n,pageInfo:r,rect:i})=>{const{layout:o,isSnapshot:a,triggerdByExpandOrCollapse:s}=t,l=(e=>{const t=sz(e);return t.current=e,t})(m$(i));return pz((async()=>{const{qHyperCube:t}=o,{maxNumberOfVisibleRows:i,maxNumberOfVisibleColumns:c}=l.current;if(a)return o.snapshotData?.content?.qPivotDataPages??[];if(void 0!==e&&"getHyperCubePivotData"in e&&(((e,t,n,r)=>!!e&&(t.gridColumnStartIndex+t.gridWidth>=r||t.gridRowStartIndex+t.gridHeight>=n))(s,n,i,c)||((e,t,n,r)=>{const{qHyperCube:{qPivotDataPages:i,qSize:o}}=e,{qTop:a,qWidth:s,qHeight:l}=i[0]?.qArea??{qTop:0,qWidth:0,qHeight:0};return a<t.page*t.rowsPerPage||s<Math.min(r,o.qcx)||l<Math.min(n,o.qcy)})(o,r,i,c))){const t=((e,t,n,r,i,o)=>{const a=r.page*r.rowsPerPage,s=Math.min(a+r.rowsPerPage,n.qcy),l=Math.min(Nj,n.qcx);if(n.qcy<a)return null;let c=0,u=a;if(e){c=t.gridColumnStartIndex,u=a+t.gridRowStartIndex;const e=u+t.gridHeight,n=t.gridColumnStartIndex+t.gridWidth;e>s&&(u=Math.max(0,s-i)),n>l&&(c=Math.max(0,l-o))}return{qLeft:c,qTop:u,qWidth:Math.min(l-c,o),qHeight:Math.min(s-u,i)}})(s,n,o.qHyperCube.qSize,r,i,c);return t?e.getHyperCubePivotData(tW,g$(t)):[]}return t.qPivotDataPages}),[o,a,e,n,r.page,r.rowsPerPage,l,s])},nee=({rowsPerPage:e,totalRowCount:t,page:n})=>Math.min(e,t-n*e),ree=(e,t,n=15e3)=>({rowsPerPage:n,totalPages:Math.max(1,Math.ceil(e/n)),totalRowCount:e,rowsOnCurrentPage:nee({rowsPerPage:n,totalRowCount:e,page:t})}),iee=15,oee=({layoutService:e,viewService:t,rect:n,model:r,pageInfo:i})=>{const{freeResize:o}=_();return T((async e=>{const o=e;if(!o.snapshotData||!r||o.snapshotData.content)return o;if("getHyperCubePivotData"in r){const{scrollTop:e,scrollLeft:a,leftGridScrollLeft:s,topGridScrollTop:l}=t,c=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:a}=e,s=t.page*t.rowsPerPage,l=Math.max(r-iee,0),c=Math.max(s+i-iee,s,0),u=Nj-l,d=s+t.rowsOnCurrentPage-c;if((e=>0===e.gridWidth&&0===e.gridHeight)(e)){const{maxNumberOfVisibleColumns:e,maxNumberOfVisibleRows:t}=m$(n);return{qLeft:l,qTop:c,qWidth:Math.min(u,e+30),qHeight:Math.min(d,t+30)}}return{qLeft:l,qTop:c,qWidth:Math.min(u,o+30),qHeight:Math.min(d,a+30)}})(t,i,n),u=g$(c),d={qLeft:0,qTop:i.page*i.rowsPerPage,qWidth:1,qHeight:1};o.snapshotData.content={qPivotDataPages:await r.getHyperCubePivotData(tW,[d,...u]),scrollTop:e,scrollLeft:a,leftGridScrollLeft:s,topGridScrollTop:l,page:i.page,rowsPerPage:i.rowsPerPage},o.snapshotData.object.size.w=n.width,o.snapshotData.object.size.h=n.height}return o})),L((()=>({getViewState:()=>((e,t)=>({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,leftGridScrollLeft:e.leftGridScrollLeft,topGridScrollTop:e.topGridScrollTop,renderPage:t.page}))(t,i)})),[t]),e.layout.snapshotData?.content&&!o?{left:n.left,top:n.top,width:e.layout.snapshotData.object.size.w,height:e.layout.snapshotData.object.size.h}:n};var aee={SNPivotTable_ContextMenu_CollapseDimension:{id:"SNPivotTable.ContextMenu.CollapseDimension",locale:{"de-DE":"{0} reduzieren","en-US":"Collapse {0}","es-ES":"Contraer {0}","fr-FR":"Réduire {0}","it-IT":"Comprimi {0}","ja-JP":"{0} を折りたたむ","ko-KR":"{0} 축소","nl-NL":"{0} samenvouwen","pl-PL":"Zwiń {0}","pt-BR":"Recolher {0}","ru-RU":"Свернуть {0}","sv-SE":"Dölj {0}","tr-TR":"{0} öğelerini daralt","zh-CN":"折叠 {0}","zh-TW":"收合 {0}"}},SNPivotTable_ContextMenu_ExpandDimension:{id:"SNPivotTable.ContextMenu.ExpandDimension",locale:{"de-DE":"{0} erweitern","en-US":"Expand {0}","es-ES":"Expandir {0}","fr-FR":"Développer {0}","it-IT":"Espandi {0}","ja-JP":"{0} を展開","ko-KR":"{0} 확장","nl-NL":"{0} uitvouwen","pl-PL":"Rozwiń {0}","pt-BR":"Expandir {0}","ru-RU":"Развернуть {0}","sv-SE":"Visa {0}","tr-TR":"{0} öğelerini genişlet","zh-CN":"展开 {0}","zh-TW":"展開 {0}"}},SNPivotTable_IndentMode_Rows:{id:"SNPivotTable.IndentMode.Rows",locale:{"de-DE":"Zeilen","en-US":"Rows","es-ES":"Filas","fr-FR":"Lignes","it-IT":"Righe","ja-JP":"行","ko-KR":"행","nl-NL":"Rijen","pl-PL":"Wiersze","pt-BR":"Linhas","ru-RU":"Строки","sv-SE":"Rader","tr-TR":"Satırlar","zh-CN":"行","zh-TW":"列"}},SNPivotTable_LimitedData:{id:"SNPivotTable.LimitedData",locale:{"de-DE":"* Derzeit wird eine begrenzte Anzahl Spalten angezeigt","en-US":"* Currently showing a limited number of columns","es-ES":"* Actualmente mostrando un número limitado de columnas","fr-FR":"*Affichage actuel d'un nombre limité de colonnes","it-IT":"* Attualmente visualizzato un numero limitato di colonne","ja-JP":"* 現在、限られた列の数を表示","ko-KR":"* 현재 제한된 수의 열만 표시","nl-NL":"* Op dit moment wordt slechts een beperkt aantal kolommen getoond","pl-PL":"* Obecnie wyświetlana jest ograniczona liczba kolumn","pt-BR":"* Atualmente mostrando um número limitado de colunas","ru-RU":"* В настоящее время отображается ограниченное количество столбцов","sv-SE":"* Visar för närvarande ett begränsat antal kolumner","tr-TR":"*Şu anda sınırlı sayıda sütun gösteriliyor","zh-CN":"* 当前显示的列数有限","zh-TW":"* 目前顯示有限欄數"}},SNPivotTable_NoData:{id:"SNPivotTable.NoData",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, weil es keine Werte enthält.","en-US":"The chart is not displayed because it contains no values.","es-ES":"El gráfico no se muestra porque no contiene valores.","fr-FR":"Le graphique n'est pas affiché, car il ne contient aucune valeur.","it-IT":"Il grafico non è visualizzato poiché non contiene alcun valore.","ja-JP":"チャートには値が含まれていないため、チャートは表示されません。","ko-KR":"차트에 값이 없으므로 차트가 표시되지 않습니다.","nl-NL":"Het diagram wordt niet weergegeven omdat deze geen waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ nie zawiera wartości.","pt-BR":"O gráfico não foi exibido porque não contém valores.","ru-RU":"Диаграмма не отображается, так как не содержит значений.","sv-SE":"Diagrammet visas inte eftersom det inte innehåller några värden.","tr-TR":"Değer içermemesi nedeniyle grafik görüntülenmiyor.","zh-CN":"图表未显示,因为它不包含任何值。","zh-TW":"系統不會顯示圖表,因為這沒有包含任何值。"}}};const see=()=>{const e=q(),t=e.language();return E((()=>{!function(e){const t="SNPivotTable_LimitedData";e.get(t)===t&&Object.keys(aee).forEach((t=>{e.add(aee[t])}))}(e)}),[e]),{translator:e,language:t}},lee=e=>{const{flags:t}=e,n=N(),r=(e=>{const t=E((()=>yz(e)),[e]);return D((()=>()=>{t.unmount()}),[t]),t})(n),i=j(),o=z(),a=F(),s=W(),l=$(),c=(()=>{const{viewState:e}=_(),t=sz(new Set),n=void 0!==window.qlikprinting,{promise:r,resolve:i}=E((()=>iz()),[]),o=oz((e=>{n&&t.current.add(e)}),[t]),a=oz(LN((async()=>{await Promise.all(t.current),t.current.clear(),i()}),1e3),[i,t]);return R((async()=>{n&&await r}),[r,n]),E((()=>({viewState:e,isDownloadedAsPDForImage:n,notifyIsDoneRendering:a,waitForPromise:o})),[a,n,e,o])})(),u=((e,t)=>{const[n]=pz((async()=>{if(void 0!==e&&!t.snapshotData&&"getEffectiveProperties"in e)return{...await e.getEffectiveProperties()}}),[e,t]),r=E((()=>{const e=void 0!==n?.qHyperCubeDef.qSortbyYValue&&1===Math.abs(n.qHyperCubeDef.qSortbyYValue),t=n?.qHyperCubeDef.qDimensions.map((e=>e.qDef?.qSortCriterias))??[];return{qAlwaysFullyExpanded:n?.qHyperCubeDef.qAlwaysFullyExpanded??!1,qExpansionState:n?.qHyperCubeDef.qExpansionState,isSortedByFirstMeasure:e,getSortCriteriaForDimension:e=>t[e]}}),[n]);return r})(o,i),d=eee(i,t),h=(e=>{const t=P();return{...t,select:!!t.active&&!!t.select&&!e,active:!!t.active&&!e,scroll:!!t.active}})(d.isSnapshot),p=B(),f=hz(i,n),{translator:m,language:g}=see(),{pageInfo:y,updatePageInfo:v}=((e,t)=>{const{size:n,layout:{qHyperCube:{qSize:r}}}=e,i=t.isDownloadedAsPDForImage||e.isSnapshot,o=(e=>e.layout.snapshotData?.content?.rowsPerPage)(e),[a,s]=I((()=>{const a=((e,t)=>t.isDownloadedAsPDForImage?t.viewState?.renderPage??0:e.isSnapshot?e.layout.snapshotData?.content?.page??0:0)(e,t);return{page:a,shouldShowPagination:r.qcy>n.y&&!i,...ree(r.qcy,a,o)}})),l=e.layout.qHyperCube.qSize.qcy;return D((()=>{s((t=>({...t,...ree(l,t.page,o),shouldShowPagination:l>e.size.y&&!i})))}),[l,e.size.y,s,i,o]),D((()=>{const{page:e,totalPages:t}=a;if(e+1>t){const e=t-1,n=nee({...a,page:e});s({...a,page:e,rowsOnCurrentPage:n})}}),[a]),{pageInfo:a,updatePageInfo:e=>{s({...a,...e,rowsOnCurrentPage:nee({...a,...e})})}}})(d,c),b=((e,t,n)=>E((()=>((e,t)=>{if(e.isDownloadedAsPDForImage){const{viewState:t}=e;return{gridColumnStartIndex:0,gridRowStartIndex:0,gridWidth:0,gridHeight:0,scrollTop:t?.scrollTop??0,scrollLeft:t?.scrollLeft??0,leftGridScrollLeft:t?.leftGridScrollLeft??0,topGridScrollTop:t?.topGridScrollTop??0}}return{gridColumnStartIndex:0,gridRowStartIndex:0,gridWidth:0,gridHeight:0,scrollTop:t?.content?.scrollTop??0,scrollLeft:t?.content?.scrollLeft??0,leftGridScrollLeft:t?.content?.leftGridScrollLeft??0,topGridScrollTop:t?.content?.topGridScrollTop??0}})(n,t.snapshotData)),[n,e.page,t.snapshotData]))(y,i,c),x=oee({rect:H(),layoutService:d,viewService:b,model:o,pageInfo:y}),[w,S]=tee({model:o,layoutService:d,viewService:b,pageInfo:y,rect:x}),C=E((()=>((e,t)=>{const n=t.layout.components?.find((e=>"theme"===e.key)),r=n?.header,i=n?.dimensionValues,o=n?.measureValues,a=n?.measureLabels,s=n?.totalValues,l=n?.nullValues,c=n?.grid,u=(t,n,r)=>e.getStyle(t,n,r),d=+(c?.[F9.LineClamp]??u(W9.Grid,$9.Grid,B9.LineClamp)??1),h=+(c?.[F9.ColumnLineClamp]??u(W9.Grid,$9.Grid,B9.ColumnLineClamp)??1),p=V9(e,r?.[F9.Background])??u(W9.Dimension,$9.LabelName,B9.BackgroundColor)??zj.Transparent,f={header:{fontSize:H9(r?.[F9.FontSize])??u(W9.Dimension,$9.LabelName,B9.FontSize)??Tj,fontFamily:r?.[F9.FontFamily]??u(W9.Dimension,$9.LabelName,B9.FontFamily)??Lj,fontWeight:U9(r?.[F9.FontStyle],qj),fontStyle:Y9(r?.[F9.FontStyle]),textDecoration:K9(r?.[F9.FontStyle]),color:V9(e,r?.[F9.FontColor])??u(W9.Dimension,$9.LabelName,B9.FontColor)??xj.TEXT,background:p,hoverBackground:Cj(p,IT),activeBackground:Cj(p,DT)},dimensionValues:{fontSize:H9(i?.[F9.FontSize])??u(W9.Dimension,$9.LabelValue,B9.FontSize)??Tj,fontFamily:i?.[F9.FontFamily]??u(W9.Dimension,$9.LabelValue,B9.FontFamily)??Lj,fontWeight:U9(i?.[F9.FontStyle],void 0),fontStyle:Y9(i?.[F9.FontStyle]),textDecoration:K9(i?.[F9.FontStyle]),color:V9(e,i?.[F9.FontColor])??u(W9.Dimension,$9.LabelValue,B9.FontColor)??xj.TEXT,background:V9(e,i?.[F9.Background])??u(W9.Dimension,$9.LabelValue,B9.BackgroundColor)??zj.Transparent},measureValues:{fontSize:H9(o?.[F9.FontSize])??u(W9.Measure,$9.LabelValue,B9.FontSize)??Tj,fontFamily:o?.[F9.FontFamily]??u(W9.Measure,$9.LabelValue,B9.FontFamily)??Lj,fontWeight:U9(o?.[F9.FontStyle],"normal"),fontStyle:Y9(o?.[F9.FontStyle]),textDecoration:K9(o?.[F9.FontStyle]),color:V9(e,o?.[F9.FontColor])??u(W9.Measure,$9.LabelValue,B9.FontColor)??zj.FontSecondary,background:V9(e,o?.[F9.Background])??u(W9.Measure,$9.LabelValue,B9.BackgroundColor)??zj.Transparent},measureLabels:{fontWeight:U9(a?.[F9.FontStyle],"normal"),fontStyle:Y9(a?.[F9.FontStyle]),textDecoration:K9(a?.[F9.FontStyle]),color:V9(e,a?.[F9.FontColor])??u(W9.Measure,$9.LabelName,B9.FontColor)??zj.FontSecondary,background:V9(e,a?.[F9.Background])??u(W9.Measure,$9.LabelName,B9.BackgroundColor)??zj.Transparent},totalValues:{fontWeight:U9(s?.[F9.FontStyle],qj),fontStyle:Y9(s?.[F9.FontStyle]),textDecoration:K9(s?.[F9.FontStyle]),color:V9(e,s?.[F9.FontColor])??u(W9.Total,$9.LabelValue,B9.FontColor)??xj.TEXT,background:V9(e,s?.[F9.Background])??u(W9.Total,$9.LabelValue,B9.BackgroundColor)??zj.Transparent},nullValues:{fontWeight:U9(l?.[F9.FontStyle],"normal"),fontStyle:Y9(l?.[F9.FontStyle]),textDecoration:K9(l?.[F9.FontStyle]),color:V9(e,l?.[F9.FontColor])??u(W9.Null,$9.LabelValue,B9.FontColor)??xj.TEXT,background:V9(e,l?.[F9.Background])??u(W9.Null,$9.LabelValue,B9.BackgroundColor)??zj.NullValueBackground},grid:{columnLineClamp:h,lineClamp:d,border:V9(e,c?.[F9.Border])??u(W9.Grid,$9.Grid,B9.BorderColor)??zj.DividerLight,divider:V9(e,c?.[F9.Divider])??u(W9.Grid,$9.Divider,B9.BorderColor)??zj.DividerDark,background:V9(e,c?.[F9.Background])??u(W9.Grid,$9.Grid,B9.BackgroundColor)??zj.Transparent},selectedColors:Sj(e)};return f.headerCellHeight=Math.max(G9(f.header.fontSize,h),G9(f.dimensionValues.fontSize,h),32),f.contentCellHeight=Math.max(G9(f.measureValues.fontSize,d),G9(f.dimensionValues.fontSize,d),24),f.dimensionValueTextHeight=G9(f.dimensionValues.fontSize,1),f})(f,d)),[f,d]),M=((e,t,n)=>{const[,r,i]=pz((async()=>{const t=Pq(n.flags),r=e.getStyle("","","fontFamily"),i=e.getStyle("object","label.name","fontFamily"),o=e.getStyle("object","label.value","fontFamily"),a=e.getStyle("","","fontFamilies")??[];return Promise.all([...t,...a,r,i,o,bz].filter((e=>void 0!==e)).map((async e=>{await document.fonts.load(`600 12px ${e}`),await document.fonts.load(`12px ${e}`)})))}),[t,e,n]);return i?(console.warn("Failed to load fonts:",i),!0):!r})(f,i,e),{direction:k}=_();Z9([Q9({model:o,layoutService:d,effectivePropertiesService:u,translator:m})]),D((()=>{!S&&o&&!!w&&M&&z9(r,{selections:p,baseObjects:{rect:x,pageInfo:y,qPivotDataPages:w,updatePageInfo:v,direction:k},nebulaObjects:{env:e,app:a,model:o,embed:s,theme:f,keyboard:l,translator:m,interactions:h},coreServices:{styleService:C,viewService:b,layoutService:d,downloadService:c,effectivePropertiesService:u}})}),[o,a,x,h,p,b,d,c,S,w,C,r,M,m,g,y,v,u,s,l,f,e,k])},cee={version:"7.0.10",qHyperCubeDef:{qAlwaysFullyExpanded:!1,qDimensions:[],qMeasures:[],qMode:"P",qSuppressMissing:!0,qSuppressZero:!1,qShowTotalsAbove:!0,qInitialDataFetch:[{qTop:0,qLeft:0,qWidth:50,qHeight:50}],qIndentMode:!1},showTitles:!0,title:"",subtitle:"",footnote:"",nullValueRepresentation:{text:"-"},components:[]};function uee(e){return{qae:{properties:{initial:{...cee,qHyperCubeDef:{...cee.qHyperCubeDef,qIndentMode:!1}}},data:BN(e)},ext:rz(e),component(){lee(e)}}}export{uee as default};
|