@nebula.js/sn-pivot-table 7.14.0 → 7.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/sn-pivot-table v7.14.0
2
+ * @nebula.js/sn-pivot-table v7.15.0
3
3
  * Copyright (c) 2026 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -97,6 +97,6 @@ function kn(e,t){let r;return r=t?bn(e).withConfig({displayName:t.label,shouldFo
97
97
  *
98
98
  * This source code is licensed under the MIT license found in the
99
99
  * LICENSE file in the root directory of this source tree.
100
- */var mS,gS,vS={},yS={};function bS(){if(mS)return yS;mS=1;var e=Va;Object.defineProperty(yS,"__esModule",{value:!0}),yS.default=void 0;var t=(0,e(dv()).default)();return yS.default=t,yS}var xS,SS,wS={},CS={};function ES(){if(SS)return wS;SS=1;var e=Va;Object.defineProperty(wS,"__esModule",{value:!0}),wS.default=function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=o.breakpoints,a=void 0===i?["sm","md","lg"]:i,s=o.disableAlign,l=void 0!==s&&s,u=o.factor,c=void 0===u?2:u,d=o.variants,p=void 0===d?["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","caption","button","overline"]:d,f=(0,t.default)({},e);f.typography=(0,t.default)({},f.typography);var h=f.typography,m=(0,n.convertLength)(h.htmlFontSize),g=a.map(function(e){return f.breakpoints.values[e]});return p.forEach(function(e){var o=h[e],i=parseFloat(m(o.fontSize,"rem"));if(!(i<=1)){var a=i,s=1+(a-1)/c,u=o.lineHeight;if(!(0,n.isUnitless)(u)&&!l)throw new Error((0,r.formatMuiErrorMessage)(6));(0,n.isUnitless)(u)||(u=parseFloat(m(u,"rem"))/parseFloat(i));var d=null;l||(d=function(e){return(0,n.alignProperty)({size:e,grid:(0,n.fontGrid)({pixels:4,lineHeight:u,htmlFontSize:h.htmlFontSize})})}),h[e]=(0,t.default)({},o,(0,n.responsiveProperty)({cssProperty:"fontSize",min:s,max:a,unit:"rem",breakpoints:g,transform:d}))}}),f};var t=e(Ns()),r=wh,n=function(){if(xS)return CS;xS=1;var e=Va;Object.defineProperty(CS,"__esModule",{value:!0}),CS.isUnitless=function(e){return String(parseFloat(e)).length===String(e).length},CS.getUnit=r,CS.toUnitless=n,CS.convertLength=function(e){return function(t,o){var i=r(t);if(i===o)return t;var a=n(t);if("px"!==i)if("em"===i)a=n(t)*n(e);else if("rem"===i)return a=n(t)*n(e),t;var s=a;if("px"!==o)if("em"===o)s=a/n(e);else{if("rem"!==o)return t;s=a/n(e)}return parseFloat(s.toFixed(5))+o}},CS.alignProperty=function(e){var t=e.size,r=e.grid,n=t-t%r,o=n+r;return t-n<o-t?n:o},CS.fontGrid=function(e){var t=e.lineHeight;return e.pixels/(t*e.htmlFontSize)},CS.responsiveProperty=function(e){var r=e.cssProperty,n=e.min,o=e.max,i=e.unit,a=void 0===i?"rem":i,s=e.breakpoints,l=void 0===s?[600,960,1280]:s,u=e.transform,c=void 0===u?null:u,d=(0,t.default)({},r,"".concat(n).concat(a)),p=(o-n)/l[l.length-1];return l.forEach(function(e){var o=n+p*e;null!==c&&(o=c(o)),d["@media (min-width:".concat(e,"px)")]=(0,t.default)({},r,"".concat(Math.round(1e4*o)/1e4).concat(a))}),d};var t=e($h());function r(e){return String(e).match(/[\d.\-+]*\s*(.*)/)[1]||""}function n(e){return parseFloat(e)}return CS}();return wS}var IS,DS={};var PS,RS={};var MS,LS={};var AS,kS={};!function(e){var t=Va,n=Af;Object.defineProperty(e,"__esModule",{value:!0});var o={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 u.default}}),Object.defineProperty(e,"responsiveFontSizes",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"styled",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"useTheme",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"withStyles",{enumerable:!0,get:function(){return h.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 i=kf;Object.keys(i).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(o,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return i[t]}}))});var a=n(dv()),s=t(function(){if(pv)return fv;pv=1;var e=Va;Object.defineProperty(fv,"__esModule",{value:!0}),fv.default=function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return r.default.apply(void 0,[(0,t.deepmerge)({unstable_strictMode:!0},e)].concat(o))};var t=wh,r=e(dv());return fv}()),l=t(function(){if(dS)return hv;dS=1,Object.defineProperty(hv,"__esModule",{value:!0}),hv.default=function(t){return(0,e.createStyles)(t)};var e=hS;return hv}()),u=t(function(){if(gS)return vS;gS=1;var e=Va;Object.defineProperty(vS,"__esModule",{value:!0}),vS.default=void 0;var t=e(Ns()),r=hS,n=e(bS()),o=function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,r.makeStyles)(e,(0,t.default)({defaultTheme:n.default},o))};return vS.default=o,vS}()),c=t(ES()),d=t(function(){if(IS)return DS;IS=1;var e=Va;Object.defineProperty(DS,"__esModule",{value:!0}),DS.default=void 0;var t=e(Ns()),r=hS,n=e(bS()),o=function(e){var o=(0,r.styled)(e);return function(e,r){return o(e,(0,t.default)({defaultTheme:n.default},r))}};return DS.default=o,DS}()),p=sv();Object.keys(p).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(o,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return p[t]}}))});var f=t(function(){if(PS)return RS;PS=1;var e=Va;Object.defineProperty(RS,"__esModule",{value:!0}),RS.default=function(){return(0,t.useTheme)()||n.default};var t=hS;e(r);var n=e(bS());return RS}()),h=t(function(){if(MS)return LS;MS=1;var e=Va;Object.defineProperty(LS,"__esModule",{value:!0}),LS.default=void 0;var t=e(Ns()),r=hS,n=e(bS()),o=function(e,o){return(0,r.withStyles)(e,(0,t.default)({defaultTheme:n.default},o))};return LS.default=o,LS}()),m=t(function(){if(AS)return kS;AS=1;var e=Va;Object.defineProperty(kS,"__esModule",{value:!0}),kS.default=void 0;var t=hS,r=e(bS()),n=(0,t.withThemeCreator)({defaultTheme:r.default});return kS.default=n,kS}()),g=hS}(Pf),Pf.alpha(tf.GREYSCALE_0,.05),Pf.alpha(tf.GREEN_PALE,.5),Pf.alpha(tf.BLUE_PALE,.5),Pf.alpha(tf.GREEN_PALE,.5),Pf.alpha(tf.BLUE_PALE,.5),Pf.alpha(tf.GREEN_PALE,.5),Pf.alpha(tf.BLUE_PALE,.5),Pf.alpha(tf.GREEN_PALE,.5),Pf.alpha(tf.BLUE_PALE,.5),Pf.alpha(tf.GREEN_PALE,.5),Pf.alpha(tf.BLUE_PALE,.5);const OS=(e="light",t=!1)=>If(0,t);function qS(e){return"init"in e}function TS(e){return!!e.write}function NS(e){return"v"in e||"e"in e}function _S(e){if("e"in e)throw e.e;if("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v}function jS(e){return"function"==typeof(null==e?void 0:e.then)}function FS(e,t,r){if(!r.p.has(e)){r.p.add(e);const n=()=>r.p.delete(e);t.then(n,n)}}function zS(e,t,r){var n;const o=new Set;for(const t of(null==(n=r.get(e))?void 0:n.t)||[])o.add(t);for(const e of t.p)o.add(e);return o}const WS=()=>{const e={},t=new WeakMap,r=r=>{var n,o;null==(n=t.get(e))||n.forEach(e=>e(r)),null==(o=t.get(r))||o.forEach(e=>e())};return r.add=(r,n)=>{const o=r||e;let i=t.get(o);return i||(i=new Set,t.set(o,i)),i.add(n),()=>{i.delete(n),i.size||t.delete(o)}},r};function $S(e){return e.i||(e.i=WS()),e.r||(e.r=WS()),e.c||(e.c=WS()),e.m||(e.m=WS()),e.u||(e.u=WS()),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 HS=(e,t,...r)=>t.read(...r),VS=(e,t,...r)=>t.write(...r),BS=(e,t)=>{var r;return null==(r=t.INTERNAL_onInit)?void 0:r.call(t,e)},GS=(e,t,r)=>{var n;return null==(n=t.onMount)?void 0:n.call(t,r)},US=(e,r)=>{var n;const o=cw(e),i=o[0],a=o[6],s=o[9];if("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&!r)throw new Error("Atom is undefined or null");let l=i.get(r);return l||(l={d:new Map,p:new Set,n:0},i.set(r,l),null==(n=a.i)||n.call(a,r),null==s||s(e,r)),l},YS=e=>{const t=cw(e),r=t[1],n=t[3],o=t[4],i=t[5],a=t[6],s=t[13],l=[],u=e=>{try{e()}catch(e){l.push(e)}};do{a.f&&u(a.f);const t=new Set,l=t.add.bind(t);n.forEach(e=>{var t;return null==(t=r.get(e))?void 0:t.l.forEach(l)}),n.clear(),i.forEach(l),i.clear(),o.forEach(l),o.clear(),t.forEach(u),n.size&&s(e)}while(n.size||i.size||o.size);if(l.length)throw new AggregateError(l)},KS=e=>{const r=cw(e),n=r[1],o=r[2],i=r[3],a=r[11],s=r[14],l=r[17],u=[],c=new WeakSet,d=new WeakSet,p=Array.from(i);for(;p.length;){const r=p[p.length-1],i=a(e,r);if(d.has(r))p.pop();else if(c.has(r)){if(o.get(r)===i.n)u.push([r,i]);else if("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&o.has(r))throw new Error("[Bug] invalidated atom exists");d.add(r),p.pop()}else{c.add(r);for(const e of zS(r,i,n))c.has(e)||p.push(e)}}for(let t=u.length-1;t>=0;--t){const[r,n]=u[t];let a=!1;for(const e of n.d.keys())if(e!==r&&i.has(e)){a=!0;break}a&&(o.set(r,n.n),s(e,r),l(e,r)),o.delete(r)}},XS=new WeakSet,JS=(e,r)=>{var n,o;const i=cw(e),a=i[1],s=i[2],l=i[3],u=i[6],c=i[7],d=i[11],p=i[12],f=i[13],h=i[14],m=i[16],g=i[17],v=i[20],y=i[26],b=d(e,r);if(NS(b)){if(a.has(r)&&s.get(r)!==b.n)return b;let t=!1;for(const[r,n]of b.d)if(h(e,r).n!==n){t=!0;break}if(!t)return b}let x=!0;const S=new Set(b.d.keys()),w=new Map,C=()=>{for(const e of S)w.has(e)||b.d.delete(e)},E=()=>{if(a.has(r)){const t=!l.size;g(e,r),t&&(f(e),p(e))}},I=t=>{var n;if(t===r){const r=d(e,t);if(!NS(r)){if(!qS(t))throw new Error("no atom init");v(e,t,t.init)}return _S(r)}const o=h(e,t);try{return _S(o)}finally{w.set(t,o.n),b.d.set(t,o.n),jS(b.v)&&FS(r,b.v,o),a.has(r)&&(null==(n=a.get(t))||n.t.add(r)),x||E()}};let D,P;const R={get signal(){return D||(D=new AbortController),D.signal},get setSelf(){return"production"!==(t.meta.env?t.meta.env.MODE:void 0)&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),"production"===(t.meta.env?t.meta.env.MODE:void 0)||TS(r)||console.warn("setSelf function cannot be used with read-only atom"),!P&&TS(r)&&(P=(...n)=>{if("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&x&&console.warn("setSelf function cannot be called in sync"),!x)try{return m(e,r,...n)}finally{f(e),p(e)}}),P}},M=b.n,L=s.get(r)===M;try{"production"!==(t.meta.env?t.meta.env.MODE:void 0)&&XS.delete(e);const o=c(e,r,I,R);if("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&XS.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),v(e,r,o),jS(o)){y(e,o,()=>null==D?void 0:D.abort());const t=()=>{C(),E()};o.then(t,t)}else C();return null==(n=u.r)||n.call(u,r),b}catch(e){return delete b.v,b.e=e,++b.n,b}finally{x=!1,b.n!==M&&L&&(s.set(r,b.n),l.add(r),null==(o=u.c)||o.call(u,r))}},ZS=(e,t)=>{const r=cw(e),n=r[1],o=r[2],i=r[11],a=[t];for(;a.length;){const t=a.pop(),r=i(e,t);for(const s of zS(t,r,n)){const t=i(e,s);o.get(s)!==t.n&&(o.set(s,t.n),a.push(s))}}},QS=(e,r,...n)=>{const o=cw(e),i=o[3],a=o[6],s=o[8],l=o[11],u=o[12],c=o[13],d=o[14],p=o[15],f=o[16],h=o[17],m=o[20];let g=!0;const v=t=>_S(d(e,t)),y=(n,...o)=>{var s;const d=l(e,n);try{if(n===r){if(!qS(n))throw new Error("atom not writable");"production"!==(t.meta.env?t.meta.env.MODE:void 0)&&XS.add(e);const r=d.n,l=o[0];return m(e,n,l),h(e,n),void(r!==d.n&&(i.add(n),p(e,n),null==(s=a.c)||s.call(a,n)))}return f(e,n,...o)}finally{g||(c(e),u(e))}};try{return s(e,r,v,y,...n)}finally{g=!1}},ew=(e,t)=>{var r;const n=cw(e),o=n[1],i=n[3],a=n[6],s=n[11],l=n[15],u=n[18],c=n[19],d=s(e,t),p=o.get(t);if(p){for(const[n,o]of d.d)if(!p.d.has(n)){const c=s(e,n);u(e,n).t.add(t),p.d.add(n),o!==c.n&&(i.add(n),l(e,n),null==(r=a.c)||r.call(a,n))}for(const r of p.d)if(!d.d.has(r)){p.d.delete(r);const n=c(e,r);null==n||n.t.delete(t)}}},tw=(e,t)=>{var r;const n=cw(e),o=n[1],i=n[4],a=n[6],s=n[10],l=n[11],u=n[12],c=n[13],d=n[14],p=n[16],f=n[18],h=l(e,t);let m=o.get(t);if(!m){d(e,t);for(const r of h.d.keys()){f(e,r).t.add(t)}if(m={l:new Set,d:new Set(h.d.keys()),t:new Set},o.set(t,m),TS(t)){const r=()=>{let r=!0;const n=(...n)=>{try{return p(e,t,...n)}finally{r||(c(e),u(e))}};try{const o=s(e,t,n);o&&(m.u=()=>{r=!0;try{o()}finally{r=!1}})}finally{r=!1}};i.add(r)}null==(r=a.m)||r.call(a,t)}return m},rw=(e,t)=>{var r,n;const o=cw(e),i=o[1],a=o[5],s=o[6],l=o[11],u=o[19],c=l(e,t);let d=i.get(t);if(!d||d.l.size)return d;let p=!1;for(const e of d.t)if(null==(r=i.get(e))?void 0:r.d.has(t)){p=!0;break}if(p)return d;d.u&&a.add(d.u),d=void 0,i.delete(t);for(const r of c.d.keys()){const n=u(e,r);null==n||n.t.delete(t)}null==(n=s.u)||n.call(s,t)},nw=(e,t,r)=>{const n=cw(e),o=n[11],i=n[27],a=o(e,t),s="v"in a,l=a.v;if(jS(r))for(const n of a.d.keys())FS(t,r,o(e,n));a.v=r,delete a.e,s&&Object.is(l,a.v)||(++a.n,jS(l)&&i(e,l))},ow=(e,t)=>_S((0,cw(e)[14])(e,t)),iw=(e,t,...r)=>{const n=cw(e),o=n[3],i=n[12],a=n[13],s=n[16],l=o.size;try{return s(e,t,...r)}finally{o.size!==l&&(a(e),i(e))}},aw=(e,t,r)=>{const n=cw(e),o=n[12],i=n[18],a=n[19],s=i(e,t).l;return s.add(r),o(e),()=>{s.delete(r),a(e,t),o(e)}},sw=(e,t,r)=>{const n=cw(e)[25];let o=n.get(t);if(!o){o=new Set,n.set(t,o);const e=()=>n.delete(t);t.then(e,e)}o.add(r)},lw=(e,t)=>{const r=cw(e)[25].get(t);null==r||r.forEach(e=>e())},uw=new WeakMap,cw=e=>{const r=uw.get(e);if("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&!r)throw new Error("Store must be created by buildStore to read its building blocks");return r};function dw(e){const t=cw(e),r=t[24];return r?r(t):t}function pw(...e){const t={get:e=>(0,cw(t)[21])(t,e),set:(e,...r)=>(0,cw(t)[22])(t,e,...r),sub:(e,r)=>(0,cw(t)[23])(t,e,r)},r=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},HS,VS,BS,GS,US,YS,KS,JS,ZS,QS,ew,tw,rw,nw,ow,iw,aw,void 0,new WeakMap,sw,lw].map((t,r)=>e[r]||t);return uw.set(t,Object.freeze(r)),t}let fw,hw=0;function mw(e,r){const n="atom"+ ++hw,o={toString(){return"production"!==(t.meta.env?t.meta.env.MODE:void 0)&&this.debugLabel?n+":"+this.debugLabel:n}};return"function"==typeof e?o.read=e:(o.init=e,o.read=gw,o.write=vw),r&&(o.write=r),o}function gw(e){return e(this)}function vw(e,t,r){return t(this,"function"==typeof r?r(e(this)):r)}function yw(){return pw()}const bw=u(void 0);function xw(e){const r=h(bw);return(null==e?void 0:e.store)||r||(fw||(fw=yw(),"production"!==(t.meta.env?t.meta.env.MODE:void 0)&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=fw),globalThis.__JOTAI_DEFAULT_STORE__!==fw&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),fw)}function Sw({children:e,store:t}){const r=l(null);return t?n(bw.Provider,{value:t},e):(null===r.current&&(r.current=yw()),n(bw.Provider,{value:r.current},e))}const ww=e=>"function"==typeof(null==e?void 0:e.then),Cw=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},Ew=r.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(Cw(e),e)}),Iw=new WeakMap,Dw=(e,t,r)=>{const n=dw(e)[26];let o=Iw.get(t);return o||(o=new Promise((i,a)=>{let s=t;const l=e=>t=>{s===e&&i(t)},u=e=>t=>{s===e&&a(t)},c=()=>{try{const t=r();ww(t)?(Iw.set(t,o),s=t,t.then(l(t),u(t)),n(e,t,c)):i(t)}catch(e){a(e)}};t.then(l(t),u(t)),n(e,t,c)}),Iw.set(t,o)),o};function Pw(e,t){const{delay:n,unstable_promiseStatus:o=!r.use}={},i=xw(t),[[a,s,l],u]=c(t=>{const r=i.get(e);return Object.is(t[0],r)&&t[1]===i&&t[2]===e?t:[r,i,e]},void 0,()=>[i.get(e),i,e]);let f=a;if(s===i&&l===e||(u(),f=i.get(e)),d(()=>{const t=i.sub(e,()=>{if(o)try{const t=i.get(e);ww(t)&&Cw(Dw(i,t,()=>i.get(e)))}catch(e){}"number"!=typeof n?u():setTimeout(u,n)});return u(),t},[i,e,n,o]),p(f),ww(f)){const t=Dw(i,f,()=>i.get(e));return o&&Cw(t),Ew(t)}return f}function Rw(e,r){const n=xw(r);return f((...r)=>{if("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&!("write"in e))throw new Error("not writable atom");return n.set(e,...r)},[n,e])}function Mw(e,t){return[Pw(e,t),Rw(e,t)]}t.meta.env&&t.meta.env.MODE;!function(e=()=>{try{return window.localStorage}catch(e){return void("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&"undefined"!=typeof window&&console.warn(e))}},r){var n;let o,i;const a={getItem:(t,n)=>{var a,s;const l=e=>{if(o!==(e=e||"")){try{i=JSON.parse(e,null==r?void 0:r.reviver)}catch(e){return n}o=e}return i},u=null!=(s=null==(a=e())?void 0:a.getItem(t))?s:null;return(e=>"function"==typeof(null==e?void 0:e.then))(u)?u.then(l):l(u)},setItem:(t,r)=>{var n;return null==(n=e())?void 0:n.setItem(t,JSON.stringify(r,void 0))},removeItem:t=>{var r;return null==(r=e())?void 0:r.removeItem(t)}};let s;try{s=null==(n=e())?void 0:n.subscribe}catch(e){}var l;!s&&"undefined"!=typeof window&&"function"==typeof window.addEventListener&&window.Storage&&(s=(t,r)=>{if(!(e()instanceof window.Storage))return()=>{};const n=n=>{n.storageArea===e()&&n.key===t&&r(n.newValue)};return window.addEventListener("storage",n),()=>{window.removeEventListener("storage",n)}}),s&&(a.subscribe=(l=s,(e,t,r)=>l(e,e=>{let n;try{n=JSON.parse(e||"")}catch(e){n=r}t(n)})))}();const Lw=(e,t,r)=>(t.has(r)?t:t.set(r,e())).get(r),Aw=new WeakMap,kw=()=>{};const Ow=new WeakMap;function qw(e,t){const r=xw(t),n=Tw(r);for(const[o,...i]of e)n.has(o)&&!(null==t?void 0:t.dangerouslyForceHydrate)||(n.add(o),r.set(o,...i))}const Tw=e=>{let t=Ow.get(e);return t||(t=new WeakSet,Ow.set(e,t)),t};function Nw(){return Boolean("undefined"!=typeof process&&process.env?.NODE_ENV&&!1)}function _w(e){const t=mw(()=>[]),r=mw(function(e){const[n,o,i]=e(t);i.has(r)&&(n.forEach(e),++o.n)});return r.effect=e,r.INTERNAL_onInit=e=>{const n=new Set;let o,i=0,a=!1,s=!1,l=!1;function u(){if(i)return;n.clear();let t=!0;const c=o=>{if(l)return e.get(o);if(o===r){const t=h(e,o);if(!NS(t)){if(!qS(o))throw new Error("no atom init");S(e,o,o.init)}return _S(t)}const i=v(e,o);try{return _S(i)}finally{C.d.set(o,i.n),d.get(o)?.t.add(r),t?n.add(o):d.has(o)&&(x(e,r),g(e),m(e))}};c.peek=e.get;const w=(n,...o)=>{const a=h(e,n);try{if(++i,n===r){if(!qS(n))throw new Error("atom not writable");const t=a.n,r=o[0];return S(e,n,r),x(e,n),void(t!==a.n&&(p.add(n),f.c?.(n),y(e,n)))}return b(e,n,...o)}finally{t||(g(e),m(e)),--i}};w.recurse=(t,...n)=>{if(l){if(Nw())throw new Error("set.recurse is not allowed in cleanup")}else try{return a=!0,x(e,r),w(t,...n)}finally{g(e),a=!1,s&&(s=!1,u())}};try{o?.();const e=r.effect(c,w);if("function"!=typeof e)return;o=()=>{if(!i)try{return t=!0,l=!0,e()}finally{t=!1,l=!1,o=void 0}}}finally{t=!1,n.forEach(t=>{C.d.set(t,h(e,t).n)}),x(e,r),g(e)}}const c=dw(e),d=c[1],p=c[3],f=$S(c[6]),h=c[11],m=c[12],g=c[13],v=c[14],y=c[15],b=c[16],x=c[17],S=c[20],w=function(e,t){let r=jw.get(e);r||(r=new Set,jw.set(e,r),t.f.add(function(){for(const e of r)r.delete(e),e()}));return r}(e,f),C=h(e,r);C.v=void 0,Object.assign(e.get(t),[n,C,d]),f.c.add(r,function(){p.delete(r)}),f.m.add(r,function(){w.add(u),o&&w.delete(o)}),f.u.add(r,function(){w.delete(u),o&&w.add(o)}),f.c.add(r,function(){a?s=!0:w.add(u)})},Nw()&&(Object.defineProperty(t,"debugLabel",{get:()=>r.debugLabel?`${r.debugLabel}:ref`:void 0,configurable:!0,enumerable:!0}),t.debugPrivate=!0),r}const jw=new WeakMap;const Fw=async(e,t,r)=>{const n=e.get(r);void 0!==n&&("dimension"===n.type?await t.moveDimensionToAlternative(n.def.qDef.cId):await t.moveMeasureToAlternative(n.def.qDef.cId))},zw=async(e,t,r)=>{const n=e.get(r);void 0!==n&&("dimension"===n.type?await t.moveDimensionFromAlternative(n.def.qDef.cId):await t.moveMeasureFromAlternative(n.def.qDef.cId))},Ww=async e=>{const{type:t,handler:r,model:n,fieldInfo:o,handlerQueue:i}=e;void 0!==r&&void 0!==n&&i&&i.add(async()=>{switch(t){case"apply":for(const t of e.localChecked)await zw(o,r,t);for(const t of e.localUnchecked)await Fw(o,r,t);break;case"checked":await zw(o,r,e.cId);break;case"unchecked":await Fw(o,r,e.cId)}})},$w=mw(),Hw=mw(),Vw=mw(),Bw=mw(e=>e(Vw)?.translate??(e=>e)),Gw=mw(""),Uw=mw(e=>{const t=e(Gw).toLowerCase().trim();return({title:e})=>e.toLowerCase().trim().includes(t)}),Yw=e=>7005!==e.qError?.qErrorCode,Kw=new WeakMap,Xw={qInfo:{qType:"AlternativeLayout"},qHyperCubeDef:{qMode:"S",qDimensions:[],qMeasures:[],qInitialDataFetch:[{qTop:0,qLeft:0,qHeight:0,qWidth:0}],excludedNoOfLeftDims:-1,qCalcCond:{qv:"0"}}},Jw=function(e,r=kw){return((e,t,r)=>{const n=Lw(()=>new WeakMap,Aw,t);return Lw(e,n,r)})(()=>{const n=new WeakMap,o=new WeakMap,i=mw(0),a=mw([]);a.INTERNAL_onInit=e=>{e.set(a,[()=>e.set(i,e=>e+1)])},"production"!==(t.meta.env?t.meta.env.MODE:void 0)&&(i.debugPrivate=!0,a.debugPrivate=!0);const s=mw(t=>{let l;t(i);try{l=t(s)}catch(e){}const u=t(e);if(!(e=>"function"==typeof(null==e?void 0:e.then))(u))return{v:u};if(u!==(null==l?void 0:l.p)&&u.then(e=>{o.set(u,e);const[r]=t(a);r()},e=>{n.set(u,e);const[r]=t(a);r()}),n.has(u))throw n.get(u);return o.has(u)?{p:u,v:o.get(u)}:l&&"v"in l?{p:u,f:r(l.v),v:l.v}:{p:u,f:r()}});return s.init=void 0,"production"!==(t.meta.env?t.meta.env.MODE:void 0)&&(s.debugPrivate=!0),mw(e=>{const t=e(s);return"f"in t?t.f:t.v},(t,r,...n)=>r(e,...n))},e,r)}(mw(async e=>{const t=e($w);if(t){if(Kw.has(t))return Kw.get(t);try{const e=await t.app.createSessionObject(Xw);return Kw.set(t,e),e}catch(e){return void console.error("Error creating alternative layout model:",e)}}})),Zw=mw(null),Qw=mw(),eC=_w((e,t)=>{const r=e($w),n=e(Jw);if(!r||!n)return;const o=async()=>{const e=await r.getLayout();if(e.qSelectionInfo?.qInSelections)return;const o=await r.getEffectiveProperties();await n.applyPatches([{qOp:"replace",qPath:"/qHyperCubeDef/qDimensions",qValue:JSON.stringify(o.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions)},{qOp:"replace",qPath:"/qHyperCubeDef/qMeasures",qValue:JSON.stringify(o.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures)}]);const i=await n.getLayout();t(Qw,{layout:structuredClone(e),properties:structuredClone(o),altLayout:structuredClone(i)}),t(Zw,null)};return o(),r.Invalidated?.bind(o),()=>{r.Invalidated?.unbind(o)}}),tC=mw(e=>e(Qw)?.layout),rC=mw(e=>e(Qw)?.altLayout),nC=mw(e=>e(Qw)?.properties),oC=mw(e=>{const t=e(Qw)?.layout;return t?.qHyperCube.qDimensionInfo.filter(Yw)??[]}),iC=mw(e=>{const t=e(Qw)?.layout;return t?.qHyperCube.qMeasureInfo.filter(Yw)??[]}),aC=mw(e=>{const t=e(tC),r=e(oC),n=e(iC),o=e(nC),i=new Map;return t&&o?(r.forEach((e,t)=>{i.set(e.cId,{id:e.cId,type:"dimension",def:o.qHyperCubeDef.qDimensions[t]})}),n.forEach((e,t)=>{i.set(e.cId,{id:e.cId,type:"measure",def:o.qHyperCubeDef.qMeasures[t]})}),o.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.forEach(e=>{i.set(e.qDef.cId,{id:e.qDef.cId,type:"dimension",def:e})}),o.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures.forEach(e=>{i.set(e.qDef.cId,{id:e.qDef.cId,type:"measure",def:e})}),i):i});class sC{#e=[];#t=!1;#r=!1;#n;#o;#i;#a;constructor({onQueueCompleted:e}){this.#n=e}#s(){this.#o=void 0,this.#i=void 0,this.#a=void 0}pause(){this.#o&&(clearTimeout(this.#a),console.warn("[SequentialPromiseQueue] Queue is already paused, resetting timeout"),this.#i?.(),this.#s());const{promise:e,resolve:t}=Promise.withResolvers();this.#o=e,this.#i=t,this.#a=setTimeout(()=>{this.abort("Aborting queue after being paused for too long")},6e4)}async continue(e=0){const t=this.#i;await(e=>new Promise(t=>{setTimeout(t,e)}))(e),t===this.#i&&(t?.(),clearTimeout(this.#a),this.#s())}abort(e="Queue aborted"){clearTimeout(this.#a),(this.#e.length>0||this.#t)&&console.warn(`[SequentialPromiseQueue] ${e}`),this.#r=!0,this.#e=[],this.#i?.(),this.#s()}add(e){this.#e.push(e),this.#t||this.#l()}async#l(){if(!this.#t){for(this.#t=!0,this.#r=!1;this.#e.length>0;)if(this.#o)await this.#o;else try{const e=this.#e.shift();await(e?.())}catch(e){return console.error("[SequentialPromiseQueue] Error executing action:",e),this.#e=[],void(this.#t=!1)}try{this.#r||await(this.#n?.())}catch(e){console.error("[SequentialPromiseQueue] Error executing onQueueCompleted:",e)}finally{this.#t=!1,this.#e.length>0&&this.#l()}}}}const lC=mw(null),uC=_w((e,t)=>{const r=e($w),n=e(Hw),o=new sC({onQueueCompleted:async()=>{r&&n&&await r.applyPatches([{qPath:"/qHyperCubeDef",qOp:"replace",qValue:JSON.stringify(n.properties.qHyperCubeDef)}],!0)}});t(lC,o);const i=()=>{o.pause()},a=()=>{o.continue(500)},s=()=>{o.abort()};return r?.Invalidated?.bind(i),r?.Validated?.bind(a),r?.Cancelled?.bind(s),r?.Closing?.bind(s),()=>{o.abort(),r?.Invalidated?.unbind(i),r?.Validated?.unbind(a),r?.Cancelled?.unbind(s),r?.Closing?.unbind(s)}}),cC=mw(e=>{const t=[...e(oC),...e(iC)].map(e=>e.cId);return new Set(t)}),dC=mw(new Set),pC=mw(new Set),fC=mw(e=>{const t=e(dC),r=e(pC);return e(cC).difference(r).union(t)}),hC=_w((e,t)=>{e(cC),t(dC,new Set),t(pC,new Set)}),mC=mw(e=>e(fC),(e,t,r)=>{const n=e(fC).has(r),o=new Set(e(pC)),i=new Set(e(dC));n?(o.add(r),i.delete(r)):(i.add(r),o.delete(r)),t(pC,o),t(dC,i),Ww({type:n?"unchecked":"checked",cId:r,handler:e(Hw),model:e($w),fieldInfo:e(aC),handlerQueue:e(lC)})}),gC=({props:e,children:t})=>(qw([[$w,e.args.model],[Vw,e.args.apis],[Hw,e.args.handler]]),Pw(hC),Pw(eC),Pw(uC),t);function vC(e,t){const r=new Set(e),n=new Set(t);return e===t||r.size===n.size&&Array.from(r).every(n.has.bind(n))}function yC(e){return"write"in e}const bC=new WeakMap,xC={},{read:SC,write:wC}=mw(null);function CC(e,t,r){const[n,o,i,,a]=e,s=n.get(t);if(s)return s;if(r===e){let n=o.get(t);return n||(n=[PC(e,t,r),r],o.set(t,n)),n}const l=r??xC;let u=i.get(l);u||(u=new WeakMap,i.set(l,u));let c=u.get(t);if(!c){const[n,o]=a?CC(a,t,r):[t];c=[t.read===SC?n:PC(e,t,o),o],u.set(t,c)}return c}function EC(e){for(const t of e[5])t()}function IC(e,t,r,n,o){if(r.read===SC&&yC(r)&&yC(t)&&r.write!==wC&&e!==n){const{write:i}=r;return t.write=DC(e,r.write.bind(r),n,o),()=>{t.write=i}}}function DC(e,t,r,n=r){return function(o,i,...a){return t(function(t){const[n]=CC(e,t,r);return o(n)},function(t,...o){const[a]=CC(e,t,r),s=IC(e,a,t,r,n);try{return i(a,...o)}finally{null==s||s()}},...a)}}function PC(e,t,r){const n=Object.getOwnPropertyDescriptors(t);Object.keys(n).filter(e=>["read","write","debugLabel"].includes(e)).forEach(e=>n[e].configurable=!0);const o=Object.getPrototypeOf(t),i=Object.create(o,n);return i.read!==SC&&(i.read=function(e,t,r){return function(n,o){return t(function(t){const[o]=CC(e,t,r);return n(o)},o)}}(e,t.read.bind(t),r)),yC(i)&&yC(t)&&i.write!==wC&&(i.write=DC(e,t.write.bind(t),r)),i}function RC({atoms:e=[],atomFamilies:t=[],parentStore:r,name:n}){const o=new WeakSet(e),i=bC.get(r),a=(null==i?void 0:i[3])??r,s=[new WeakMap,new WeakMap,new WeakMap,a,i,new Set,void 0],l=s[0],u=s[5],c=function(e){const t=e[3],r=[...dw(t)],n=r[21],o=r[22],i=r[23],a=r[9],s={};r[9]=(e,t)=>a(l,t),r[21]=h(n),r[22]=p,r[23]=h(i),r[24]=([...e])=>{const t=[m(e[0],u),m(e[1],c),m(e[2]),g(e[3]),e[4],e[5],y(e[6]),h(e[7]),h(e[8]),e[9],h(e[10]),h(e[11],e=>d(t[0],e)),e[12],e[13],h(e[14]),h(e[15]),h(e[16]),h(e[17]),h(e[18]),h(e[19]),h(e[20]),h(e[21]),h(e[22]),h(e[23]),()=>e];return t};const l=pw(...r);return l;function u(t){const r=new WeakMap;return function(n){let o=r.get(n);if(o)return o;const i=t(n);return i?(o={...i,d:m(i.d,function(t){return r=>t(CC(e,r)[0])}),p:g(i.p),get n(){return i.n},set n(e){i.n=e},get v(){return i.v},set v(e){i.v=e},get e(){return i.e},set e(e){i.e=e}},r.set(n,o),o):void 0}}function c(e){const t=new WeakMap;return function(r){let n=t.get(r);if(n)return n;const o=e(r);return o?(n={...o,d:g(o.d),t:g(o.t),get u(){return o.u},set u(e){o.u=e}},t.set(r,n),n):void 0}}function d(e,t){return function(r,n){return e.get(n)||(e.set(n,t(r,n)),e.get(n))}}function p(t,r,...n){const[i,a]=CC(e,r),s=IC(e,i,r,a,e);try{return o(t,i,...n)}finally{null==s||s()}}function f(t,r){return function(n,...o){const[i]=CC(e,n);return(r?r(t):t)(i,...o)}}function h(t,r){return function(n,o,...i){const[a]=CC(e,o);return(r?r(t):t)(n,a,...i)}}function m(e,t){return{get:f(e.get.bind(e),t),set:f(e.set.bind(e)),has:f(e.has.bind(e)),delete:f(e.delete.bind(e))}}function g(t){return{get size(){return t.size},add:f(t.add.bind(t)),has:f(t.has.bind(t)),delete:f(t.delete.bind(t)),clear:t.clear.bind(t),forEach:e=>t.forEach(f(e)),*[Symbol.iterator](){for(const r of t)yield CC(e,r)[0]}}}function v(t){if(!t)return;const r=f(t);return r.add=function(r,n){if(void 0===r)return t.add(void 0,n);const[o]=CC(e,r);return t.add(o,n)},r}function y(e){const t={get f(){return e.f},set f(t){e.f=t}};return Object.defineProperties(t,Object.fromEntries(["r","c","m","u"].map(t=>[t,{get:()=>s[t]??(s[t]=v(e[t])),set(r){delete s[t],e[t]=r},configurable:!0,enumerable:!0}]))),Object.assign(t,e)}}(s);s[6]=c,Object.assign(c,{name:n}),bC.set(c,s);for(const t of new Set(e))l.set(t,[PC(s,t,s),s]);for(const e of new Set(t)){for(const t of e.getParams()){const r=e(t);l.has(r)||l.set(r,[PC(s,r,s),s])}const t=e.unstable_listen(({type:e,atom:t})=>{"CREATE"!==e||l.has(t)?"REMOVE"===e&&!o.has(t)&&l.delete(t):l.set(t,[PC(s,t,s),s])});u.add(t)}return c}const MC=function(e,t){return function(r){const{atoms:o=[],atomFamilies:i=[],children:a,scope:s,name:l}=r,u=t(),c=Array.from(o,e=>Array.isArray(e)?e[0]:e);function p(){return[s??RC({atoms:c,atomFamilies:i,parentStore:u,name:l}),function(e){return u!==e.parentStore||!vC(c,e.atoms)||!vC(i,e.atomFamilies)||s!==e.providedScope}]}const[[f,h],g]=m(p);if(h({atoms:c,atomFamilies:i,parentStore:u,providedScope:s})){const e=bC.get(f);e&&EC(e),g(p)}return qw(Array.from(o).filter(Array.isArray),{store:f}),d(()=>{const e=bC.get(f);return()=>{e&&EC(e)}},[f]),n(e,{store:f,children:a})}}(Sw,xw);var LC=Object.defineProperty,AC=Object.defineProperties,kC=Object.getOwnPropertyDescriptors,OC=Object.getOwnPropertySymbols,qC=Object.prototype.hasOwnProperty,TC=Object.prototype.propertyIsEnumerable,NC=(e,t,r)=>t in e?LC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_C=(e,t)=>{for(var r in t||(t={}))qC.call(t,r)&&NC(e,r,t[r]);if(OC)for(var r of OC(t))TC.call(t,r)&&NC(e,r,t[r]);return e},jC=(e,t)=>AC(e,kC(t));function FC(e,t,r){if(t===r)return e;const n=e.slice();return n.splice(r,0,n.splice(t,1)[0]),n}function zC(e){return"initialIndex"in e&&"number"==typeof e.initialIndex&&"index"in e&&"number"==typeof e.index}function WC(e,t){return function(e,t,r){var n,o,i;const{source:a,target:s,canceled:l}=t.operation;if(!a||!s||l)return"preventDefault"in t&&t.preventDefault(),e;const u=(e,t)=>e===t||"object"==typeof e&&"id"in e&&e.id===t;if(Array.isArray(e)){const n=e.findIndex(e=>u(e,a.id)),o=e.findIndex(e=>u(e,s.id));if(-1===n||-1===o){if(zC(a)){const n=a.initialIndex,o=a.index;return n===o||n<0||n>=e.length?("preventDefault"in t&&t.preventDefault(),e):r(e,n,o)}return e}if(!l&&"index"in a&&"number"==typeof a.index){const t=a.index;if(t!==n)return r(e,n,t)}return r(e,n,o)}const c=Object.entries(e);let d,p,f=-1,h=-1;for(const[e,t]of c)if(-1===f&&(f=t.findIndex(e=>u(e,a.id)),-1!==f&&(d=e)),-1===h&&(h=t.findIndex(e=>u(e,s.id)),-1!==h&&(p=e)),-1!==f&&-1!==h)break;if(-1===f&&zC(a)){const n=a.initialGroup,o=a.initialIndex,i=a.group,s=a.index;if(null==n||null==i||!(n in e)||!(i in e))return"preventDefault"in t&&t.preventDefault(),e;if(n===i&&o===s)return"preventDefault"in t&&t.preventDefault(),e;if(n===i)return jC(_C({},e),{[n]:r(e[n],o,s)});const l=e[n][o];return jC(_C({},e),{[n]:[...e[n].slice(0,o),...e[n].slice(o+1)],[i]:[...e[i].slice(0,s),l,...e[i].slice(s)]})}if(!a.manager)return e;const{dragOperation:m}=a.manager,g=null!=(o=null==(n=m.shape)?void 0:n.current.center)?o:m.position.current;if(null==p&&s.id in e){const t=s.shape&&g.y>s.shape.center.y?e[s.id].length:0;p=s.id,h=t}if(null==d||null==p||d===p&&f===h){if(null!=d&&d===p&&f===h&&zC(a)){const t=null!=a.group&&a.group!==d,n=a.index!==f;if(t||n){const t=null!=(i=a.group)?i:d;if(t in e){if(d===t)return jC(_C({},e),{[d]:r(e[d],f,a.index)});const n=e[d][f];return jC(_C({},e),{[d]:[...e[d].slice(0,f),...e[d].slice(f+1)],[t]:[...e[t].slice(0,a.index),n,...e[t].slice(a.index)]})}}}return"preventDefault"in t&&t.preventDefault(),e}if(d===p)return jC(_C({},e),{[d]:r(e[d],f,h)});const v=s.shape&&Math.round(g.y)>Math.round(s.shape.center.y)?1:0,y=e[d][f];return jC(_C({},e),{[d]:[...e[d].slice(0,f),...e[d].slice(f+1)],[p]:[...e[p].slice(0,h+v),y,...e[p].slice(h+v)]})}(e,t,FC)}function $C(e,t){let r=null;const n=new Map,o=new Set;function i(o){let s;if(void 0===t)s=n.get(o);else for(const[e,r]of n)if(t(e,o)){s=r;break}if(void 0!==s){if(!r?.(s[1],o))return s[0];i.remove(o)}const l=e(o);return n.set(o,[l,Date.now()]),a("CREATE",o,l),l}function a(e,t,r){for(const n of o)n({type:e,param:t,atom:r})}return i.unstable_listen=e=>(o.add(e),()=>{o.delete(e)}),i.getParams=()=>n.keys(),i.remove=e=>{if(void 0===t){if(!n.has(e))return;const[t]=n.get(e);n.delete(e),a("REMOVE",e,t)}else for(const[r,[o]]of n)if(t(r,e)){n.delete(r),a("REMOVE",r,o);break}},i.setShouldRemove=e=>{if(r=e,r)for(const[e,[t,o]]of n)r(o,e)&&(n.delete(e),a("REMOVE",e,t))},i}const HC=({itemIndex:e,sectionIndex:t})=>void 0!==e?`${t}-${e}`:`${t}`,VC=mw(),BC=mw(e=>e(VC)?.numberOfSections??0),GC=mw(e=>e(VC)?.numberOfItemsInSection??[]),UC=mw(e=>e(VC)?.keyExtractor??HC),YC=mw(e=>e(VC)?.emptyTexts??(()=>({title:"No items",message:"There are no items to display."}))),KC=mw(e=>e(VC)?.onDragEnd),XC=mw(e=>e(VC)?.onDragOver),JC=mw(e=>e(VC)?.itemRenderer),ZC=mw(e=>e(VC)?.headerRenderer),QC=mw(e=>e(VC)?.dragOverlayRenderer),eE=mw(e=>e(VC)?.onClick),tE=mw(e=>{const t=e(BC),r=e(GC),n=e(UC),o={};for(let e=0;e<t;e++)o[e]=Array.from({length:r[e]},(t,r)=>n({sectionIndex:e,itemIndex:r}));return o}),rE=mw(null),nE=mw(e=>e(rE),(e,t,r)=>{if(null===r)return void t(rE,null);const n=e(rE);t(rE,{...n,...r})}),oE=$C(e=>mw(null,(t,r,n)=>{let o;"over"===e?o=t(XC):"end"===e&&(o=t(KC),r(nE,null));const{source:i,target:a}=n.operation;if(null===a)return void r(nE,{toIndex:void 0,toSectionIndex:void 0});const s=WC(t(tE),n)[a.data.sectionIndex].indexOf(i.id),l=-1!==s?s:a.sortable?.index??0;"start"===e?r(nE,{id:i.id,startSection:i.data.sectionKey,startIndex:i.data.itemIndex,startSectionIndex:i.data.sectionIndex}):"over"===e&&r(nE,{toIndex:l,toSectionIndex:a.data.sectionIndex}),o?.({id:i.id,toIndex:l,toSection:a.data.sectionKey,fromSection:i.data.sectionKey,startSection:t(nE)?.startSection??i.data.sectionKey,event:n})})),iE=[VC,BC,GC,UC,YC,KC,JC,ZC,eE,nE],aE=[oE],sE=({props:e,children:t})=>{const r=Rw(VC);return g(()=>{r(e)},[e,r]),t};var lE=Symbol.for("preact-signals");function uE(){if(hE>1)hE--;else{var e,t=!1;for(!function(){var e=yE;for(yE=void 0;void 0!==e;)e.S.v===e.v&&(e.S.i=e.i),e=e.o}();void 0!==fE;){var r=fE;for(fE=void 0,mE++;void 0!==r;){var n=r.u;if(r.u=void 0,r.f&=-3,!(8&r.f)&&CE(r))try{r.c()}catch(r){t||(e=r,t=!0)}r=n}}if(mE=0,hE--,t)throw e}}function cE(e){if(hE>0)return e();vE=++gE,hE++;try{return e()}finally{uE()}}var dE=void 0;function pE(e){var t=dE;dE=void 0;try{return e()}finally{dE=t}}var fE=void 0,hE=0,mE=0,gE=0,vE=0,yE=void 0,bE=0;function xE(e){if(void 0!==dE){var t=e.n;if(void 0===t||t.t!==dE)return t={i:0,S:e,p:dE.s,n:void 0,t:dE,e:void 0,x:void 0,r:t},void 0!==dE.s&&(dE.s.n=t),dE.s=t,e.n=t,32&dE.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=dE.s,t.n=void 0,dE.s.n=t,dE.s=t),t}}function SE(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=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 wE(e,t){return new SE(e,t)}function CE(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 EE(e){for(var t=e.s;void 0!==t;t=t.n){var r=t.S.n;if(void 0!==r&&(t.r=r),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function IE(e){for(var t=e.s,r=void 0;void 0!==t;){var n=t.p;-1===t.i?(t.S.U(t),void 0!==n&&(n.n=t.n),void 0!==t.n&&(t.n.p=n)):r=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=n}e.s=r}function DE(e,t){SE.call(this,void 0),this.x=e,this.s=void 0,this.g=bE-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 PE(e,t){return new DE(e,t)}function RE(e){var t=e.m;if(e.m=void 0,"function"==typeof t){hE++;var r=dE;dE=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,ME(e),t}finally{dE=r,uE()}}}function ME(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,RE(e)}function LE(e){if(dE!==this)throw new Error("Out-of-order effect");IE(this),dE=e,this.f&=-2,8&this.f&&ME(this),uE()}function AE(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=null==t?void 0:t.name}function kE(e,t){var r=new AE(e,t);try{r.c()}catch(e){throw r.d(),e}var n=r.d.bind(r);return n[Symbol.dispose]=n,n}SE.prototype.brand=lE,SE.prototype.h=function(){return!0},SE.prototype.S=function(e){var t=this,r=this.t;r!==e&&void 0===e.e&&(e.x=r,this.t=e,void 0!==r?r.e=e:pE(function(){var e;null==(e=t.W)||e.call(t)}))},SE.prototype.U=function(e){var t=this;if(void 0!==this.t){var r=e.e,n=e.x;void 0!==r&&(r.x=n,e.e=void 0),void 0!==n&&(n.e=r,e.x=void 0),e===this.t&&(this.t=n,void 0===n&&pE(function(){var e;null==(e=t.Z)||e.call(t)}))}},SE.prototype.subscribe=function(e){var t=this;return kE(function(){var r=t.value,n=dE;dE=void 0;try{e(r)}finally{dE=n}},{name:"sub"})},SE.prototype.valueOf=function(){return this.value},SE.prototype.toString=function(){return this.value+""},SE.prototype.toJSON=function(){return this.value},SE.prototype.peek=function(){var e=dE;dE=void 0;try{return this.value}finally{dE=e}},Object.defineProperty(SE.prototype,"value",{get:function(){var e=xE(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(mE>100)throw new Error("Cycle detected");!function(e){0!==hE&&0===mE&&e.l!==vE&&(e.l=vE,yE={S:e,v:e.v,i:e.i,o:yE})}(this),this.v=e,this.i++,bE++,hE++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{uE()}}}}),DE.prototype=new SE,DE.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===bE)return!0;if(this.g=bE,this.f|=1,this.i>0&&!CE(this))return this.f&=-2,!0;var e=dE;try{EE(this),dE=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 dE=e,IE(this),this.f&=-2,!0},DE.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)}SE.prototype.S.call(this,e)},DE.prototype.U=function(e){if(void 0!==this.t&&(SE.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)}},DE.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(DE.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=xE(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),AE.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.m=t)}finally{e()}},AE.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,RE(this),EE(this),hE++;var e=dE;return dE=this,LE.bind(this,e)},AE.prototype.N=function(){2&this.f||(this.f|=2,this.u=fE,fE=this)},AE.prototype.d=function(){this.f|=8,1&this.f||ME(this)},AE.prototype.dispose=function(){this.d()};var OE,qE,TE,NE,_E,jE,FE,zE,WE,$E,HE,VE,BE,GE,UE,YE,KE,XE,JE,ZE,QE=Object.create,eI=Object.defineProperty,tI=Object.defineProperties,rI=Object.getOwnPropertyDescriptor,nI=Object.getOwnPropertyDescriptors,oI=Object.getOwnPropertySymbols,iI=Object.prototype.hasOwnProperty,aI=Object.prototype.propertyIsEnumerable,sI=e=>{throw TypeError(e)},lI=(e,t,r)=>t in e?eI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,uI=(e,t)=>eI(e,"name",{value:t,configurable:!0}),cI=["class","method","getter","setter","accessor","field","value","get","set"],dI=e=>void 0!==e&&"function"!=typeof e?sI("Function expected"):e,pI=(e,t,r,n,o)=>({kind:cI[e],name:t,metadata:n,addInitializer:e=>r._?sI("Already initialized"):o.push(dI(e||null))}),fI=(e,t)=>{return lI(t,(r="metadata",(n=Symbol[r])?n:Symbol.for("Symbol."+r)),e[3]);var r,n},hI=(e,t,r,n)=>{for(var o=0,i=e[t>>1],a=i&&i.length;o<a;o++)1&t?i[o].call(r):n=i[o].call(r,n);return n},mI=(e,t,r,n,o,i)=>{var a,s,l,u,c,d=7&t,p=!!(8&t),f=!!(16&t),h=d>3?e.length+1:d?p?1:2:0,m=cI[d+5],g=d>3&&(e[h-1]=[]),v=e[h]||(e[h]=[]),y=d&&(!f&&!p&&(o=o.prototype),d<5&&(d>3||!f)&&rI(d<4?o:{get[r](){return yI(this,i)},set[r](e){return xI(this,i,e)}},r));d?f&&d<4&&uI(i,(d>2?"set ":d>1?"get ":"")+r):uI(o,r);for(var b=n.length-1;b>=0;b--)u=pI(d,r,l={},e[3],v),d&&(u.static=p,u.private=f,c=u.access={has:f?e=>vI(o,e):e=>r in e},3^d&&(c.get=f?e=>(1^d?yI:SI)(e,o,4^d?i:y.get):e=>e[r]),d>2&&(c.set=f?(e,t)=>xI(e,o,t,4^d?i:y.set):(e,t)=>e[r]=t)),s=(0,n[b])(d?d<4?f?i:y[m]:d>4?void 0:{get:y.get,set:y.set}:o,u),l._=1,4^d||void 0===s?dI(s)&&(d>4?g.unshift(s):d?f?i=s:y[m]=s:o=s):"object"!=typeof s||null===s?sI("Object expected"):(dI(a=s.get)&&(y.get=a),dI(a=s.set)&&(y.set=a),dI(a=s.init)&&g.unshift(a));return d||fI(e,o),y&&eI(o,r,y),f?4^d?i:y:o},gI=(e,t,r)=>t.has(e)||sI("Cannot "+r),vI=(e,t)=>Object(t)!==t?sI('Cannot use the "in" operator on this value'):e.has(t),yI=(e,t,r)=>(gI(e,t,"read from private field"),r?r.call(e):t.get(e)),bI=(e,t,r)=>t.has(e)?sI("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),xI=(e,t,r,n)=>(gI(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),SI=(e,t,r)=>(gI(e,t,"access private method"),r);function wI(e,t){if(t){let r;return PE(()=>{const n=e();return n&&r&&t(r,n)?r:(r=n,n)})}return PE(e)}function CI(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 r of e)if(!t.has(r))return!1;return!0}if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;return!e.some((e,r)=>!CI(e,t[r]))}if("object"==typeof e&&"object"==typeof t){const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;const o=r.some(r=>!CI(e[r],t[r]));return!o}return!1}function EI({get:e},t){return{init:e=>wE(e),get(){return e.call(this).value},set(t){const r=e.call(this);r.peek()!==t&&(r.value=t)}}}function II(e,t){const r=new WeakMap;return function(){let t=r.get(this);return t||(t=wI(e.bind(this)),r.set(this,t)),t.value}}function DI(e=!0){return function(t,r){r.addInitializer(function(){const t="field"===r.kind||r.static?this:Object.getPrototypeOf(this),n=Object.getOwnPropertyDescriptor(t,r.name);n&&Object.defineProperty(t,r.name,((e,t)=>tI(e,nI(t)))(((e,t)=>{for(var r in t||(t={}))iI.call(t,r)&&lI(e,r,t[r]);if(oI)for(var r of oI(t))aI.call(t,r)&&lI(e,r,t[r]);return e})({},n),{enumerable:e}))})}}function PI(...e){const t=e.map(e=>kE(e));return()=>t.forEach(e=>e())}jE=[EI],_E=[EI],NE=[EI],TE=[DI()],qE=[DI()],OE=[DI()];var RI,MI=class{constructor(e,t=Object.is){this.defaultValue=e,this.equals=t,hI(FE,5,this),bI(this,VE),bI(this,zE,hI(FE,8,this)),hI(FE,11,this),bI(this,BE,hI(FE,12,this)),hI(FE,15,this),bI(this,KE,hI(FE,16,this)),hI(FE,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return yI(this,VE,JE)}get initial(){return yI(this,VE,$E)}get previous(){return yI(this,VE,UE)}set current(e){const t=pE(()=>yI(this,VE,JE));e&&t&&this.equals(t,e)||cE(()=>{yI(this,VE,$E)||xI(this,VE,e,HE),xI(this,VE,t,YE),xI(this,VE,e,ZE)})}reset(e=this.defaultValue){cE(()=>{xI(this,VE,void 0,YE),xI(this,VE,e,HE),xI(this,VE,e,ZE)})}};function LI(e){return pE(()=>{const t={};for(const r in e)t[r]=e[r];return t})}FE=[,,,QE(null)],zE=new WeakMap,VE=new WeakSet,BE=new WeakMap,KE=new WeakMap,WE=mI(FE,20,"#initial",jE,VE,zE),$E=WE.get,HE=WE.set,GE=mI(FE,20,"#previous",_E,VE,BE),UE=GE.get,YE=GE.set,XE=mI(FE,20,"#current",NE,VE,KE),JE=XE.get,ZE=XE.set,mI(FE,2,"current",TE,MI),mI(FE,2,"initial",qE,MI),mI(FE,2,"previous",OE,MI),fI(FE,MI);RI=new WeakMap;var AI,kI,OI,qI,TI,NI=Object.create,_I=Object.defineProperty,jI=Object.getOwnPropertyDescriptor,FI=Object.getOwnPropertySymbols,zI=Object.prototype.hasOwnProperty,WI=Object.prototype.propertyIsEnumerable,$I=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),HI=e=>{throw TypeError(e)},VI=Math.pow,BI=(e,t,r)=>t in e?_I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,GI=["class","method","getter","setter","accessor","field","value","get","set"],UI=e=>void 0!==e&&"function"!=typeof e?HI("Function expected"):e,YI=(e,t,r,n,o)=>({kind:GI[e],name:t,metadata:n,addInitializer:e=>r._?HI("Already initialized"):o.push(UI(e||null))}),KI=(e,t,r,n,o,i)=>{for(var a,s,l,u,c=7&t,d=GI[c+5],p=e[2]||(e[2]=[]),f=(o=o.prototype,jI(o,r)),h=n.length-1;h>=0;h--)(l=YI(c,r,s={},e[3],p)).static=false,l.private=false,u=l.access={has:e=>r in e},u.get=e=>e[r],a=(0,n[h])(f[d],l),s._=1,UI(a)&&(f[d]=a);return f&&_I(o,r,f),o},XI=(e,t,r)=>t.has(e)||HI("Cannot "+r),JI=class e{constructor(e,t){this.x=e,this.y=t}static delta(t,r){return new e(t.x-r.x,t.y-r.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:r}){return new e(t,r)}},ZI=class e{constructor(e,t,r,n){this.left=e,this.top=t,this.width=r,this.height=n,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(t,r){const{top:n,left:o,width:i,height:a,scale:s}=this,l=new e(o+t,n+r,i,a);return l.scale=((e,t)=>{for(var r in t||(t={}))zI.call(t,r)&&BI(e,r,t[r]);if(FI)for(var r of FI(t))WI.call(t,r)&&BI(e,r,t[r]);return e})({},s),l}get boundingRectangle(){const{width:e,height:t,left:r,top:n,right:o,bottom:i}=this;return{width:e,height:t,left:r,top:n,right:o,bottom:i}}get center(){const{left:e,top:t,right:r,bottom:n}=this;return new JI((e+r)/2,(t+n)/2)}get area(){const{width:e,height:t}=this;return e*t}equals(t){if(!(t instanceof e))return!1;const{left:r,top:n,width:o,height:i}=this;return r===t.left&&n===t.top&&o===t.width&&i===t.height}containsPoint(e){const{top:t,left:r,bottom:n,right:o}=this;return t<=e.y&&e.y<=n&&r<=e.x&&e.x<=o}intersectionArea(t){return t instanceof e?function(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-n,s=i-r;if(n<o&&r<i){return a*s}return 0}(this,t):0}intersectionRatio(e){const{area:t}=this,r=this.intersectionArea(e);return r/(e.area+t-r)}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:r,width:n,height:o}){return new e(r,t,n,o)}static delta(e,t,r={x:"center",y:"center"}){const n=(e,t)=>{const n=r[t],o="x"===t?e.left:e.top,i="x"===t?e.width:e.height;return"start"==n?o:"end"==n?o+i:o+i/2};return JI.delta({x:n(e,"x"),y:n(e,"y")},{x:n(t,"x"),y:n(t,"y")})}static intersectionRatio(t,r){return e.from(t).intersectionRatio(e.from(r))}};var QI,eD=class extends(OI=MI,kI=[II],AI=[II],OI){constructor(e){var t,r,n;super(JI.from(e),(e,t)=>JI.equals(e,t)),((e,t,r)=>{for(var n=0,o=e[t>>1],i=o&&o.length;n<i;n++)o[n].call(r)})(TI,5,this),t=this,n=0,(r=qI).has(t)?HI("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(t):r.set(t,n),this.velocity={x:0,y:0}}get delta(){return JI.delta(this.current,this.initial)}get direction(){const{current:e,previous:t}=this;if(!t)return null;const r={x:e.x-t.x,y:e.y-t.y};return r.x||r.y?Math.abs(r.x)>Math.abs(r.y)?r.x>0?"right":"left":r.y>0?"down":"up":null}get current(){return super.current}set current(e){const{current:t}=this,r=JI.from(e),n={x:r.x-t.x,y:r.y-t.y},o=Date.now(),i=o-(XI(a=this,s=qI,"read from private field"),s.get(a));var a,s;const l=e=>Math.round(e/i*100);cE(()=>{((e,t,r)=>{XI(e,t,"write to private field"),t.set(e,r)})(this,qI,o),this.velocity={x:l(n.x),y:l(n.y)},super.current=r})}reset(e=this.defaultValue){super.reset(JI.from(e)),this.velocity={x:0,y:0}}};function tD({x:e,y:t},r){const n=Math.abs(e),o=Math.abs(t);return"number"==typeof r?Math.sqrt(VI(n,2)+VI(o,2))>r:"x"in r&&"y"in r?n>r.x&&o>r.y:"x"in r?n>r.x:"y"in r&&o>r.y}TI=(e=>{var t;return[,,,NI(null!=(t=null==e?void 0:e[$I("metadata")])?t:null)]})(OI),qI=new WeakMap,KI(TI,2,"delta",kI,eD),KI(TI,2,"direction",AI,eD),QI=TI,BI(eD,$I("metadata"),QI[3]);var rD,nD,oD,iD,aD=(e=>(e.Horizontal="x",e.Vertical="y",e))(aD||{}),sD=Object.values(aD),lD=Object.create,uD=Object.defineProperty,cD=Object.defineProperties,dD=Object.getOwnPropertyDescriptor,pD=Object.getOwnPropertyDescriptors,fD=Object.getOwnPropertySymbols,hD=Object.prototype.hasOwnProperty,mD=Object.prototype.propertyIsEnumerable,gD=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),vD=e=>{throw TypeError(e)},yD=(e,t,r)=>t in e?uD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bD=(e,t)=>{for(var r in t||(t={}))hD.call(t,r)&&yD(e,r,t[r]);if(fD)for(var r of fD(t))mD.call(t,r)&&yD(e,r,t[r]);return e},xD=(e,t)=>cD(e,pD(t)),SD=(e,t)=>uD(e,"name",{value:t,configurable:!0}),wD=(e,t)=>{var r={};for(var n in e)hD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&fD)for(var n of fD(e))t.indexOf(n)<0&&mD.call(e,n)&&(r[n]=e[n]);return r},CD=e=>{var t;return[,,,lD(null!=(t=null==e?void 0:e[gD("metadata")])?t:null)]},ED=["class","method","getter","setter","accessor","field","value","get","set"],ID=e=>void 0!==e&&"function"!=typeof e?vD("Function expected"):e,DD=(e,t,r,n,o)=>({kind:ED[e],name:t,metadata:n,addInitializer:e=>r._?vD("Already initialized"):o.push(ID(e||null))}),PD=(e,t)=>yD(t,gD("metadata"),e[3]),RD=(e,t,r,n)=>{for(var o=0,i=e[t>>1],a=i&&i.length;o<a;o++)1&t?i[o].call(r):n=i[o].call(r,n);return n},MD=(e,t,r,n,o,i)=>{var a,s,l,u,c,d=7&t,p=!!(8&t),f=!!(16&t),h=d>3?e.length+1:d?p?1:2:0,m=ED[d+5],g=d>3&&(e[h-1]=[]),v=e[h]||(e[h]=[]),y=d&&(!f&&!p&&(o=o.prototype),d<5&&(d>3||!f)&&dD(d<4?o:{get[r](){return kD(this,i)},set[r](e){return qD(this,i,e)}},r));d?f&&d<4&&SD(i,(d>2?"set ":d>1?"get ":"")+r):SD(o,r);for(var b=n.length-1;b>=0;b--)u=DD(d,r,l={},e[3],v),d&&(u.static=p,u.private=f,c=u.access={has:f?e=>AD(o,e):e=>r in e},3^d&&(c.get=f?e=>(1^d?kD:TD)(e,o,4^d?i:y.get):e=>e[r]),d>2&&(c.set=f?(e,t)=>qD(e,o,t,4^d?i:y.set):(e,t)=>e[r]=t)),s=(0,n[b])(d?d<4?f?i:y[m]:d>4?void 0:{get:y.get,set:y.set}:o,u),l._=1,4^d||void 0===s?ID(s)&&(d>4?g.unshift(s):d?f?i=s:y[m]=s:o=s):"object"!=typeof s||null===s?vD("Object expected"):(ID(a=s.get)&&(y.get=a),ID(a=s.set)&&(y.set=a),ID(a=s.init)&&g.unshift(a));return d||PD(e,o),y&&uD(o,r,y),f?4^d?i:y:o},LD=(e,t,r)=>t.has(e)||vD("Cannot "+r),AD=(e,t)=>Object(t)!==t?vD('Cannot use the "in" operator on this value'):e.has(t),kD=(e,t,r)=>(LD(e,t,"read from private field"),r?r.call(e):t.get(e)),OD=(e,t,r)=>t.has(e)?vD("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),qD=(e,t,r,n)=>(LD(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),TD=(e,t,r)=>(LD(e,t,"access private method"),r);function ND(e,t){return{plugin:e,options:t}}function _D(e){return t=>ND(e,t)}function jD(e){return"function"==typeof e?{plugin:e,options:void 0}:e}rD=[EI];var FD=class{constructor(e,t){this.manager=e,this.options=t,OD(this,oD,RD(nD,8,this,!1)),RD(nD,11,this),OD(this,iD,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return pE(()=>this.disabled)}configure(e){this.options=e}registerEffect(e){const t=kE(e.bind(this));return kD(this,iD).add(t),t}destroy(){kD(this,iD).forEach(e=>e())}static configure(e){return ND(this,e)}};nD=CD(null),oD=new WeakMap,iD=new WeakMap,MD(nD,4,"disabled",rD,FD,oD),PD(nD,FD);var zD,WD=class extends FD{},$D=class{constructor(e){this.manager=e,this.instances=new Map,OD(this,zD,[])}get values(){return Array.from(this.instances.values())}set values(e){const t=e.map(jD).reduceRight((e,t)=>e.some(({plugin:e})=>e===t.plugin)?e:[t,...e],[]),r=t.map(({plugin:e})=>e);for(const e of kD(this,zD))if(!r.includes(e)){if(e.prototype instanceof WD)continue;this.unregister(e)}for(const{plugin:e,options:r}of t)this.register(e,r);qD(this,zD,r)}get(e){return this.instances.get(e)}register(e,t){const r=this.instances.get(e);if(r)return r.options!==t&&(r.options=t),r;const n=new e(this.manager,t);return this.instances.set(e,n),n}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 HD(e,t){return e.priority===t.priority?e.type===t.type?t.value-e.value:t.type-e.type:t.priority-e.priority}zD=new WeakMap;var VD,BD,GD=[],UD=class extends FD{constructor(e){super(e),OD(this,VD),OD(this,BD),this.computeCollisions=this.computeCollisions.bind(this),qD(this,BD,wE(GD)),this.destroy=PI(()=>{const e=this.computeCollisions(),t=pE(()=>this.manager.dragOperation.position.current);if(e!==GD){const e=kD(this,VD);if(qD(this,VD,t),e&&t.x==e.x&&t.y==e.y)return}else qD(this,VD,void 0);kD(this,BD).value=e},()=>{const{dragOperation:e}=this.manager;e.status.initialized&&this.forceUpdate()})}forceUpdate(e=!0){pE(()=>{e?kD(this,BD).value=this.computeCollisions():qD(this,VD,void 0)})}computeCollisions(e,t){const{registry:r,dragOperation:n}=this.manager,{source:o,shape:i,status:a}=n;if(!a.initialized||!i)return GD;const s=[],l=[];for(const i of null!=e?e:r.droppables){if(i.disabled)continue;if(o&&!i.accepts(o))continue;const e=null!=t?t:i.collisionDetector;if(!e)continue;l.push(i),i.shape;const r=pE(()=>e({droppable:i,dragOperation:n}));r&&(null!=i.collisionPriority&&(r.priority=i.collisionPriority),s.push(r))}return 0===l.length?GD:(s.sort(HD),s)}get collisions(){return kD(this,BD).value}};VD=new WeakMap,BD=new WeakMap;var YD=class{constructor(){this.registry=new Map}addEventListener(e,t){const{registry:r}=this,n=new Set(r.get(e));return n.add(t),r.set(e,n),()=>this.removeEventListener(e,t)}removeEventListener(e,t){const{registry:r}=this,n=new Set(r.get(e));n.delete(t),r.set(e,n)}dispatch(e,...t){const{registry:r}=this,n=r.get(e);if(n)for(const e of n)e(...t)}},KD=class extends YD{constructor(e){super(),this.manager=e}dispatch(e,t){const r=[t,this.manager];super.dispatch(e,...r)}};function XD(e,t=!0){let r=!1;return xD(bD({},e),{cancelable:t,get defaultPrevented(){return r},preventDefault(){t&&(r=!0)}})}var JD,ZD,QD,eP,tP,rP,nP,oP,iP,aP=class extends WD{constructor(e){super(e);let t=[];this.destroy=PI(()=>{const{dragOperation:r,collisionObserver:n}=e;r.status.initializing&&(t=[],n.enable())},()=>{const{collisionObserver:r,monitor:n}=e,{collisions:o}=r;if(r.isDisabled())return;const i=XD({collisions:o});if(n.dispatch("collision",i),i.defaultPrevented)return;if(((e,t)=>e.map(({id:e})=>e).join("")===t.map(({id:e})=>e).join(""))(o,t))return;t=o;const[a]=o;pE(()=>{var t;(null==a?void 0:a.id)!==(null==(t=e.dragOperation.target)?void 0:t.id)&&(r.disable(),e.actions.setDropTarget(null==a?void 0:a.id).then(()=>{r.enable()}))})})}},sP=(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))(sP||{}),lP=(e=>(e[e.Collision=0]="Collision",e[e.ShapeIntersection=1]="ShapeIntersection",e[e.PointerIntersection=2]="PointerIntersection",e))(lP||{});nP=[EI],rP=[II],tP=[II],eP=[II],QD=[II],ZD=[II],JD=[II];var uP=class{constructor(){RD(oP,5,this),OD(this,iP,RD(oP,8,this,"idle")),RD(oP,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}};oP=CD(null),iP=new WeakMap,MD(oP,4,"value",nP,uP,iP),MD(oP,2,"current",rP,uP),MD(oP,2,"idle",tP,uP),MD(oP,2,"initializing",eP,uP),MD(oP,2,"initialized",QD,uP),MD(oP,2,"dragging",ZD,uP),MD(oP,2,"dropped",JD,uP),PD(oP,uP);var cP,dP,pP,fP,hP,mP,gP,vP,yP,bP=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 pE(()=>{const{dragOperation:t}=this.manager,r=null!=e?e:null;if(t.targetIdentifier===r)return Promise.resolve(!1);t.targetIdentifier=r;const n=XD({operation:t.snapshot()});return t.status.dragging&&this.manager.monitor.dispatch("dragover",n),this.manager.renderer.rendering.then(()=>n.defaultPrevented)})}start(e){return pE(()=>{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 r=new AbortController,{event:n,coordinates:o}=e;cE(()=>{t.status.set("initialization-pending"),t.shape=null,t.canceled=!1,t.activatorEvent=null!=n?n:null,t.position.reset(o)});const i=XD({operation:t.snapshot()});return this.manager.monitor.dispatch("beforedragstart",i),i.defaultPrevented?(t.reset(),r.abort(),r):(t.status.set("initializing"),t.controller=r,this.manager.renderer.rendering.then(()=>{if(r.signal.aborted)return;const{status:e}=t;"initializing"===e.current&&(t.status.set("dragging"),this.manager.monitor.dispatch("dragstart",{nativeEvent:n,operation:t.snapshot(),cancelable:!1}))}),r)})}move(e){return pE(()=>{var t,r;const{dragOperation:n}=this.manager,{status:o,controller:i}=n;if(!o.dragging||!i||i.signal.aborted)return;const a=XD({nativeEvent:e.event,operation:n.snapshot(),by:e.by,to:e.to},null==(t=e.cancelable)||t);(null==(r=e.propagate)||r)&&this.manager.monitor.dispatch("dragmove",a),queueMicrotask(()=>{var t,r,o,i,s;if(a.defaultPrevented)return;const l=null!=(s=e.to)?s:{x:n.position.current.x+(null!=(r=null==(t=e.by)?void 0:t.x)?r:0),y:n.position.current.y+(null!=(i=null==(o=e.by)?void 0:o.y)?i:0)};n.position.current=l})})}stop(e={}){return pE(()=>{var t,r;const{dragOperation:n}=this.manager,{controller:o}=n;if(!o||o.signal.aborted)return;let i;o.abort();const a=()=>{this.manager.renderer.rendering.then(()=>{n.status.set("dropped");const e=pE(()=>{var e;return"dropping"===(null==(e=n.source)?void 0:e.status)}),t=()=>{n.controller===o&&(n.controller=void 0),n.reset()};if(e){const{source:e}=n,r=kE(()=>{"idle"===(null==e?void 0:e.status)&&(r(),t())})}else this.manager.renderer.rendering.then(t)})};n.canceled=null!=(t=e.canceled)&&t,this.manager.monitor.dispatch("dragend",{nativeEvent:e.event,operation:n.snapshot(),canceled:null!=(r=e.canceled)&&r,suspend:()=>{const e={resume:()=>{},abort:()=>{}};return i=new Promise((t,r)=>{e.resume=t,e.abort=r}),e}}),i?i.then(a).catch(()=>n.reset()):a()})}};fP=[EI],pP=[EI],dP=[EI],cP=[EI];var xP=class{constructor(e,t){OD(this,mP,RD(hP,8,this)),RD(hP,11,this),OD(this,gP,RD(hP,12,this)),RD(hP,15,this),OD(this,vP,RD(hP,16,this)),RD(hP,19,this),OD(this,yP,RD(hP,20,this)),RD(hP,23,this);const{effects:r,id:n,data:o={},disabled:i=!1,register:a=!0}=e;let s=n;this.manager=t,this.id=n,this.data=o,this.disabled=i,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==r?void 0:r())?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)}};hP=CD(null),mP=new WeakMap,gP=new WeakMap,vP=new WeakMap,yP=new WeakMap,MD(hP,4,"manager",fP,xP,mP),MD(hP,4,"id",pP,xP,gP),MD(hP,4,"data",dP,xP,vP),MD(hP,4,"disabled",cP,xP,yP),PD(hP,xP);var SP,wP,CP,EP,IP,DP,PP,RP,MP,LP,AP,kP,OP,qP,TP,NP,_P,jP,FP,zP,WP,$P,HP,VP,BP=class{constructor(){this.map=wE(new Map),this.cleanupFunctions=new WeakMap,this.register=(e,t)=>{const r=this.map.peek(),n=r.get(e),o=()=>this.unregister(e,t);if(n===t)return o;if(n){const e=this.cleanupFunctions.get(n);null==e||e(),this.cleanupFunctions.delete(n)}const i=new Map(r);i.set(e,t),this.map.value=i;const a=PI(...t.effects());return this.cleanupFunctions.set(t,a),o},this.unregister=(e,t)=>{const r=this.map.peek();if(r.get(e)!==t)return;const n=this.cleanupFunctions.get(t);null==n||n(),this.cleanupFunctions.delete(t);const o=new Map(r);o.delete(e),this.map.value=o}}[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}},GP=class extends(PP=xP,DP=[EI],IP=[EI],EP=[EI],CP=[II],wP=[II],SP=[II],PP){constructor(e,t){var r=e,{modifiers:n,type:o,sensors:i}=r,a=wD(r,["modifiers","type","sensors"]);super(a,t),RD(RP,5,this),OD(this,MP,RD(RP,8,this)),RD(RP,11,this),OD(this,LP,RD(RP,12,this)),RD(RP,15,this),OD(this,AP,RD(RP,16,this,this.isDragSource?"dragging":"idle")),RD(RP,19,this),this.type=o,this.sensors=i,this.modifiers=n,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}};RP=CD(PP),MP=new WeakMap,LP=new WeakMap,AP=new WeakMap,MD(RP,4,"type",DP,GP,MP),MD(RP,4,"modifiers",IP,GP,LP),MD(RP,4,"status",EP,GP,AP),MD(RP,2,"isDropping",CP,GP),MD(RP,2,"isDragging",wP,GP),MD(RP,2,"isDragSource",SP,GP),PD(RP,GP);var UP=class extends(jP=xP,_P=[EI],NP=[EI],TP=[EI],qP=[EI],OP=[EI],kP=[II],jP){constructor(e,t){var r=e,{accept:n,collisionDetector:o,collisionPriority:i,type:a}=r;super(wD(r,["accept","collisionDetector","collisionPriority","type"]),t),RD(FP,5,this),OD(this,zP,RD(FP,8,this)),RD(FP,11,this),OD(this,WP,RD(FP,12,this)),RD(FP,15,this),OD(this,$P,RD(FP,16,this)),RD(FP,19,this),OD(this,HP,RD(FP,20,this)),RD(FP,23,this),OD(this,VP,RD(FP,24,this)),RD(FP,27,this),this.accept=n,this.collisionDetector=o,this.collisionPriority=i,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}};FP=CD(jP),zP=new WeakMap,WP=new WeakMap,$P=new WeakMap,HP=new WeakMap,VP=new WeakMap,MD(FP,4,"accept",_P,UP,zP),MD(FP,4,"type",NP,UP,WP),MD(FP,4,"collisionDetector",TP,UP,$P),MD(FP,4,"collisionPriority",qP,UP,HP),MD(FP,4,"shape",OP,UP,VP),MD(FP,2,"isDropTarget",kP,UP),PD(FP,UP);var YP,KP=class extends FD{constructor(e,t){super(e,t),this.manager=e,this.options=t}},XP=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)}},JP=class{constructor(e){this.options=e,OD(this,YP)}set controller(e){qD(this,YP,e),e.signal.addEventListener("abort",()=>this.abort())}activate(e){var t;null==(t=kD(this,YP))||t.activate(e)}};YP=new WeakMap;var ZP,QP,eR,tR,rR,nR,oR,iR,aR,sR,lR,uR,cR,dR,pR,fR,hR,mR,gR,vR=class extends FD{constructor(e,t){super(e,t),this.manager=e,this.options=t}apply(e){return e.transform}},yR=class{constructor(e){this.draggables=new BP,this.droppables=new BP,this.plugins=new $D(e),this.sensors=new $D(e),this.modifiers=new $D(e)}register(e,t){if(e instanceof GP)return this.draggables.register(e.id,e);if(e instanceof UP)return this.droppables.register(e.id,e);if(e.prototype instanceof vR)return this.modifiers.register(e,t);if(e.prototype instanceof KP)return this.sensors.register(e,t);if(e.prototype instanceof FD)return this.plugins.register(e,t);throw new Error("Invalid instance type")}unregister(e){if(e instanceof xP)return e instanceof GP?this.draggables.unregister(e.id,e):e instanceof UP?this.droppables.unregister(e.id,e):()=>{};if(e.prototype instanceof vR)return this.modifiers.unregister(e);if(e.prototype instanceof KP)return this.sensors.unregister(e);if(e.prototype instanceof FD)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()}};aR=[II],iR=[EI],oR=[EI],nR=[EI],rR=[EI],tR=[EI],eR=[II],QP=[II],ZP=[II];var bR=class{constructor(e){RD(cR,5,this),OD(this,sR),OD(this,lR),OD(this,uR,new MI(void 0,(e,t)=>e&&t?e.equals(t):e===t)),this.status=new uP,OD(this,dR,RD(cR,8,this,!1)),RD(cR,11,this),OD(this,pR,RD(cR,12,this,null)),RD(cR,15,this),OD(this,fR,RD(cR,16,this,null)),RD(cR,19,this),OD(this,hR,RD(cR,20,this,null)),RD(cR,23,this),OD(this,mR,RD(cR,24,this,[])),RD(cR,27,this),this.position=new eD({x:0,y:0}),OD(this,gR,{x:0,y:0}),qD(this,sR,e)}get shape(){const{current:e,initial:t,previous:r}=kD(this,uR);return e&&t?{current:e,initial:t,previous:r}:null}set shape(e){e?kD(this,uR).current=e:kD(this,uR).reset()}get source(){var e;const t=this.sourceIdentifier;if(null==t)return null;const r=kD(this,sR).registry.draggables.get(t);return r&&qD(this,lR,r),null!=(e=null!=r?r:kD(this,lR))?e:null}get target(){var e;const t=this.targetIdentifier;return null!=t&&null!=(e=kD(this,sR).registry.droppables.get(t))?e:null}get transform(){const{x:e,y:t}=this.position.delta;let r={x:e,y:t};for(const e of this.modifiers)r=e.apply(xD(bD({},this.snapshot()),{transform:r}));return qD(this,gR,r),r}snapshot(){return pE(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:kD(this,gR),shape:this.shape?LI(this.shape):null,position:LI(this.position),status:LI(this.status),canceled:this.canceled}))}reset(){cE(()=>{this.status.set("idle"),this.sourceIdentifier=null,this.targetIdentifier=null,kD(this,uR).reset(),this.position.reset({x:0,y:0}),qD(this,gR,{x:0,y:0}),this.modifiers=[]})}};cR=CD(null),sR=new WeakMap,lR=new WeakMap,uR=new WeakMap,dR=new WeakMap,pR=new WeakMap,fR=new WeakMap,hR=new WeakMap,mR=new WeakMap,gR=new WeakMap,MD(cR,2,"shape",aR,bR),MD(cR,4,"canceled",iR,bR,dR),MD(cR,4,"activatorEvent",oR,bR,pR),MD(cR,4,"sourceIdentifier",nR,bR,fR),MD(cR,4,"targetIdentifier",rR,bR,hR),MD(cR,4,"modifiers",tR,bR,mR),MD(cR,2,"source",eR,bR),MD(cR,2,"target",QP,bR),MD(cR,2,"transform",ZP,bR),PD(cR,bR);var xR={get rendering(){return Promise.resolve()}};function SR(e,t){return"function"==typeof e?e(t):null!=e?e:t}var wR=class{constructor(e){var t;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 r=null!=e?e:{},n=SR(r.plugins,[]),o=SR(r.sensors,[]),i=SR(r.modifiers,[]),a=null!=(t=r.renderer)?t:xR,s=new KD(this),l=new yR(this);this.registry=l,this.monitor=s,this.renderer=a,this.actions=new bP(this),this.dragOperation=new bR(this),this.collisionObserver=new UD(this),this.plugins=[aP,...n],this.modifiers=i,this.sensors=o;const{destroy:u}=this,c=PI(()=>{var e,t,r;const n=pE(()=>this.dragOperation.modifiers),o=this.modifiers;for(const e of n)o.includes(e)||e.destroy();this.dragOperation.modifiers=null!=(r=null==(t=null==(e=this.dragOperation.source)?void 0:e.modifiers)?void 0:t.map(e=>{const{plugin:t,options:r}=jD(e);return new t(this,r)}))?r:o});this.destroy=()=>{c(),u()}}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}},CR=e=>{throw TypeError(e)},ER=(e,t,r)=>t.has(e)||CR("Cannot "+r),IR=(e,t,r)=>(ER(e,t,"read from private field"),t.get(e)),DR=(e,t,r)=>t.has(e)?CR("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),PR=(e,t,r,n)=>(ER(e,t,"write to private field"),t.set(e,r),r),RR=(e,t,r)=>(ER(e,t,"access private method"),r);function MR(e){return!!e&&(e instanceof KeyframeEffect||"getKeyframes"in e&&"function"==typeof e.getKeyframes)}function LR(e,t){const r=e.getAnimations();if(r.length>0)for(const e of r){if("running"!==e.playState)continue;const{effect:r}=e,n=(MR(r)?r.getKeyframes():[]).filter(t);if(n.length>0)return[n[n.length-1],e]}return null}function AR(e){const{width:t,height:r,top:n,left:o,bottom:i,right:a}=e.getBoundingClientRect();return{width:t,height:r,top:n,left:o,bottom:i,right:a}}function kR(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function OR(e){return"nodeType"in e}function qR(e){var t,r,n;return e?kR(e)?e:OR(e)?"defaultView"in e?null!=(t=e.defaultView)?t:window:null!=(n=null==(r=e.ownerDocument)?void 0:r.defaultView)?n:window:window:window}function TR(e){const{Document:t}=qR(e);return e instanceof t||"nodeType"in e&&e.nodeType===Node.DOCUMENT_NODE}function NR(e){return!(!e||kR(e))&&(e instanceof qR(e).HTMLElement||"namespaceURI"in e&&"string"==typeof e.namespaceURI&&e.namespaceURI.endsWith("html"))}function _R(e){return e instanceof qR(e).SVGElement||"namespaceURI"in e&&"string"==typeof e.namespaceURI&&e.namespaceURI.endsWith("svg")}function jR(e){return e?kR(e)?e.document:OR(e)?TR(e)?e:NR(e)||_R(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:r,overflowX:n,overflowY:o}=getComputedStyle(e);return"visible"===r&&"visible"===n&&"visible"===o}function zR(e,t=e.getBoundingClientRect(),r=0){var n,o,i,a,s;let l=t;const{ownerDocument:u}=e,c=null!=(n=u.defaultView)?n:window;let d=e.parentElement;for(;d&&d!==u.documentElement;){if(!FR(d)){const e=d.getBoundingClientRect(),t=r*(e.bottom-e.top),n=r*(e.right-e.left),o=r*(e.bottom-e.top),i=r*(e.right-e.left);l={top:Math.max(l.top,e.top-t),right:Math.min(l.right,e.right+n),bottom:Math.min(l.bottom,e.bottom+o),left:Math.max(l.left,e.left-i),width:0,height:0},l.width=l.right-l.left,l.height=l.bottom-l.top}d=d.parentElement}const p=c.visualViewport,f=null!=(o=null==p?void 0:p.offsetTop)?o:0,h=null!=(i=null==p?void 0:p.offsetLeft)?i:0,m=null!=(a=null==p?void 0:p.width)?a:c.innerWidth,g=null!=(s=null==p?void 0:p.height)?s:c.innerHeight,v=r*g,y=r*m;return l={top:Math.max(l.top,f-v),right:Math.min(l.right,h+m+y),bottom:Math.min(l.bottom,f+g+v),left:Math.max(l.left,h-y),width:0,height:0},l.width=l.right-l.left,l.height=l.bottom-l.top,l.width<0&&(l.width=0),l.height<0&&(l.height=0),l}function WR(e){return{x:e.clientX,y:e.clientY}}var $R="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 r=[e];for(const n of Array.from(e.querySelectorAll("iframe, frame")))try{const e=n.contentDocument;e&&!t.has(e)&&r.push(...HR(e,t))}catch(e){}try{const n=e.defaultView;if(n&&n!==window.top){const o=n.parent;o&&o.document&&o.document!==e&&r.push(...HR(o.document,t))}}catch(e){}return r}function VR(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function BR(){var e,t;const r=VR()?window.visualViewport:null;return{x:null!=(e=null==r?void 0:r.offsetLeft)?e:0,y:null!=(t=null==r?void 0:r.offsetTop)?t:0}}function GR(e){return!(!e||!OR(e))&&e instanceof qR(e).ShadowRoot}function UR(e){if(e&&OR(e)){let t=e.getRootNode();if(GR(t))return t;if(t instanceof Document)return t}return jR(e)}function YR(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches}function KR(e){return"value"in e}function XR(e){return"CANVAS"===e.tagName}function JR(e,{x:t,y:r}){const n=e.elementFromPoint(t,r);if(function(e){return"IFRAME"===(null==e?void 0:e.tagName)}(n)){const{contentDocument:e}=n;if(e){const{left:o,top:i}=n.getBoundingClientRect();return JR(e,{x:t-o,y:r-i})}}return n}var ZR=new WeakMap;var QR=class{constructor(){this.entries=new Set,this.clear=()=>{for(const e of this.entries){const[t,{type:r,listener:n,options:o}]=e;t.removeEventListener(r,n,o)}this.entries.clear()}}bind(e,t){const r=Array.isArray(e)?e:[e],n=Array.isArray(t)?t:[t],o=[];for(const e of r)for(const t of n){const{type:r,listener:n,options:i}=t,a=[e,t];e.addEventListener(r,n,i),this.entries.add(a),o.push(a)}return function(){for(const[e,{type:t,listener:r,options:n}]of o)e.removeEventListener(t,r,n)}}};function eM(e){const t=null==e?void 0:e.ownerDocument.defaultView;if(t&&t.self!==t.parent)return t.frameElement}function tM(e,t){const r=()=>performance.now();let n,o;return function(...i){const a=this;o?(null==n||n(),n=function(e,t){const r=setTimeout(e,t);return()=>clearTimeout(r)}(()=>{e.apply(a,i),o=r()},t-(r()-o))):(e.apply(a,i),o=r())}}var rM,nM=$R?ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},oM=class extends nM{constructor(e){super(t=>{IR(this,rM)?e(t,this):PR(this,rM,!0)}),DR(this,rM,!1)}};rM=new WeakMap;var iM,aM,sM,lM,uM,cM,dM,pM,fM,hM,mM,gM=Array.from({length:100},(e,t)=>t/100),vM=class{constructor(e,t,r={debug:!1,skipInitial:!1}){this.element=e,this.callback=t,DR(this,fM),this.disconnect=()=>{var e,t,r;PR(this,dM,!0),null==(e=IR(this,sM))||e.disconnect(),null==(t=IR(this,lM))||t.disconnect(),IR(this,uM).disconnect(),null==(r=IR(this,cM))||r.remove()},DR(this,iM,!0),DR(this,aM),DR(this,sM),DR(this,lM),DR(this,uM),DR(this,cM),DR(this,dM,!1),DR(this,pM,tM(()=>{var e,t,r;const{element:n}=this;if(null==(e=IR(this,lM))||e.disconnect(),IR(this,dM)||!IR(this,iM)||!n.isConnected)return;const o=null!=(t=n.ownerDocument)?t:document,{innerHeight:i,innerWidth:a}=null!=(r=o.defaultView)?r:window,s=n.getBoundingClientRect(),l=zR(n,s),{top:u,left:c,bottom:d,right:p}=l,f=-Math.floor(u),h=-Math.floor(c),m=`${f}px ${-Math.floor(a-p)}px ${-Math.floor(i-d)}px ${h}px`;this.boundingClientRect=s,PR(this,lM,new IntersectionObserver(e=>{const[t]=e,{intersectionRect:r}=t;1!==(1!==t.intersectionRatio?t.intersectionRatio:ZI.intersectionRatio(r,zR(n)))&&IR(this,pM).call(this)},{threshold:gM,rootMargin:m,root:o})),IR(this,lM).observe(n),RR(this,fM,hM).call(this)},75)),this.boundingClientRect=e.getBoundingClientRect(),PR(this,iM,function(e,t=e.getBoundingClientRect()){const{width:r,height:n}=zR(e,t);return r>0&&n>0}(e,this.boundingClientRect));let n=!0;this.callback=e=>{n&&(n=!1,r.skipInitial)||t(e)};const o=e.ownerDocument;(null==r?void 0:r.debug)&&(PR(this,cM,document.createElement("div")),IR(this,cM).style.background="rgba(0,0,0,0.15)",IR(this,cM).style.position="fixed",IR(this,cM).style.pointerEvents="none",o.body.appendChild(IR(this,cM))),PR(this,uM,new IntersectionObserver(t=>{var r,n;const o=t[t.length-1],{boundingClientRect:i,isIntersecting:a}=o,{width:s,height:l}=i,u=IR(this,iM);PR(this,iM,a),(s||l)&&(u&&!a?(null==(r=IR(this,lM))||r.disconnect(),this.callback(null),null==(n=IR(this,sM))||n.disconnect(),PR(this,sM,void 0),IR(this,cM)&&(IR(this,cM).style.visibility="hidden")):IR(this,pM).call(this),a&&!IR(this,sM)&&(PR(this,sM,new oM(IR(this,pM))),IR(this,sM).observe(e)))},{threshold:gM,root:o})),IR(this,iM)&&!r.skipInitial&&this.callback(this.boundingClientRect),IR(this,uM).observe(e)}};iM=new WeakMap,aM=new WeakMap,sM=new WeakMap,lM=new WeakMap,uM=new WeakMap,cM=new WeakMap,dM=new WeakMap,pM=new WeakMap,fM=new WeakSet,hM=function(){IR(this,dM)||(RR(this,fM,mM).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,IR(this,aM))||(this.callback(this.boundingClientRect),PR(this,aM,this.boundingClientRect)))},mM=function(){if(IR(this,cM)){const{top:e,left:t,width:r,height:n}=zR(this.element);IR(this,cM).style.overflow="hidden",IR(this,cM).style.visibility="visible",IR(this,cM).style.top=`${Math.floor(e)}px`,IR(this,cM).style.left=`${Math.floor(t)}px`,IR(this,cM).style.width=`${Math.floor(r)}px`,IR(this,cM).style.height=`${Math.floor(n)}px`}};var yM,bM,xM,SM,wM=new WeakMap,CM=new WeakMap;function EM(e,t){let r=wM.get(e);if(!r){const t=new vM(e,t=>{const r=wM.get(e);r&&r.callbacks.forEach(e=>e(t))},{skipInitial:!0});r={disconnect:t.disconnect,callbacks:new Set}}return r.callbacks.add(t),wM.set(e,r),()=>{r.callbacks.delete(t),0===r.callbacks.size&&(wM.delete(e),r.disconnect())}}var IM=class{constructor(e,t,r){this.callback=t,DR(this,yM),DR(this,bM,!1),DR(this,xM),DR(this,SM,tM(e=>{if(!IR(this,bM)&&e.target&&"contains"in e.target&&"function"==typeof e.target.contains)for(const t of IR(this,xM))if(e.target.contains(t)){this.callback(IR(this,yM).boundingClientRect);break}},75));const n=function(e){const t=new Set;let r=eM(e);for(;r;)t.add(r),r=eM(r);return t}(e),o=function(e,t){const r=new Set;for(const n of e){const e=EM(n,t);r.add(e)}return()=>r.forEach(e=>e())}(n,t),i=function(e,t){var r;const n=e.ownerDocument;if(!CM.has(n)){const e=new AbortController,t=new Set;document.addEventListener("scroll",e=>t.forEach(t=>t(e)),{capture:!0,passive:!0,signal:e.signal}),CM.set(n,{disconnect:()=>e.abort(),listeners:t})}const{listeners:o,disconnect:i}=null!=(r=CM.get(n))?r:{};return o&&i?(o.add(t),()=>{o.delete(t),0===o.size&&(i(),CM.delete(n))}):()=>{}}(e,IR(this,SM));PR(this,xM,n),PR(this,yM,new vM(e,t,r)),this.disconnect=()=>{IR(this,bM)||(PR(this,bM,!0),o(),i(),IR(this,yM).disconnect())}}};function DM(e){return"showPopover"in e&&"hidePopover"in e&&"function"==typeof e.showPopover&&"function"==typeof e.hidePopover}function PM(e){try{DM(e)&&e.isConnected&&e.hasAttribute("popover")&&!e.matches(":popover-open")&&e.showPopover()}catch(e){}}function RM(e){return!(!$R||!e)&&e===jR(e).scrollingElement}function MM(e){var t,r;const n=qR(e),o=RM(e)?function(e){var t,r,n,o;const{documentElement:i}=jR(e),a=qR(e).visualViewport,s=null!=(t=null==a?void 0:a.width)?t:i.clientWidth,l=null!=(r=null==a?void 0:a.height)?r:i.clientHeight,u=null!=(n=null==a?void 0:a.offsetTop)?n:0,c=null!=(o=null==a?void 0:a.offsetLeft)?o:0;return{top:u,left:c,right:c+s,bottom:u+l,width:s,height:l}}(e):AR(e),i=n.visualViewport,a=RM(e)?{height:null!=(t=null==i?void 0:i.height)?t:n.innerHeight,width:null!=(r=null==i?void 0:i.width)?r:n.innerWidth}:{height:e.clientHeight,width:e.clientWidth},s={current:{x:e.scrollLeft,y:e.scrollTop},max:{x:e.scrollWidth-a.width,y:e.scrollHeight-a.height}};return{rect:o,position:s,isTop:s.current.y<=0,isLeft:s.current.x<=0,isBottom:s.current.y>=s.max.y,isRight:s.current.x>=s.max.x}}function LM(e,t){const{isTop:r,isBottom:n,isLeft:o,isRight:i,position:a}=MM(e),{x:s,y:l}=null!=t?t:{x:0,y:0},u=!r&&a.current.y+l>0,c=!n&&a.current.y+l<a.max.y,d=!o&&a.current.x+s>0,p=!i&&a.current.x+s<a.max.x;return{top:u,bottom:c,left:d,right:p,x:d||p,y:u||c}}yM=new WeakMap,bM=new WeakMap,xM=new WeakMap,SM=new WeakMap;var AM=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))}},kM=new AM(e=>{"function"==typeof requestAnimationFrame?requestAnimationFrame(e):e()}),OM=new AM(e=>setTimeout(e,50)),qM=new Map,TM=qM.clear.bind(qM);function NM(e,t=!1){if(!t)return _M(e);let r=qM.get(e);return r||(r=_M(e),qM.set(e,r),OM.schedule(TM),r)}function _M(e){return qR(e).getComputedStyle(e)}var jM={excludeElement:!0,escapeShadowDOM:!0};function FM(e,t=jM){const{limit:r,excludeElement:n,escapeShadowDOM:o}=t,i=new Set;return e?function t(a){if(null!=r&&i.size>=r)return i;if(!a)return i;if(TR(a)&&null!=a.scrollingElement&&!i.has(a.scrollingElement))return i.add(a.scrollingElement),i;if(o&&GR(a))return t(a.host);if(!NR(a))return _R(a)?t(a.parentElement):i;if(i.has(a))return i;const s=NM(a,!0);if(n&&a===e||function(e,t=NM(e,!0)){const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const n=t[e];return"string"==typeof n&&r.test(n)})}(a,s)&&i.add(a),function(e,t=NM(e,!0)){return"fixed"===t.position||"sticky"===t.position}(a,s)){const{scrollingElement:e}=a.ownerDocument;return e&&i.add(e),i}return t(a.parentNode)}(e):i}function zM(e,t=window.frameElement){const r={x:0,y:0,scaleX:1,scaleY:1};if(!e)return r;let n=eM(e);for(;n;){if(n===t)return r;const e=AR(n),{x:o,y:i}=WM(n,e);r.x=r.x+e.left,r.y=r.y+e.top,r.scaleX=r.scaleX*o,r.scaleY=r.scaleY*i,n=eM(n)}return r}function WM(e,t=AR(e)){const r=Math.round(t.width),n=Math.round(t.height);if(NR(e))return{x:r/e.offsetWidth,y:n/e.offsetHeight};const o=NM(e,!0);return{x:(parseFloat(o.width)||r)/r,y:(parseFloat(o.height)||n)/n}}function $M(e){if("none"===e)return null;const[t,r,n="0"]=e.split(" "),o={x:parseFloat(t),y:parseFloat(r),z:parseInt(n,10)};return isNaN(o.x)&&isNaN(o.y)?null:{x:isNaN(o.x)?0:o.x,y:isNaN(o.y)?0:o.y,z:isNaN(o.z)?0:o.z}}function HM(e){var t,r,n,o,i,a,s,l,u;const{scale:c,transform:d,translate:p}=e,f=function(e){if("none"===e)return null;const t=e.split(" "),r=parseFloat(t[0]),n=parseFloat(t[1]);return isNaN(r)&&isNaN(n)?null:{x:isNaN(r)?n:r,y:isNaN(n)?r:n}}(c),h=$M(p),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&&!f&&!h)return null;const g=null!=(t=null==f?void 0:f.x)?t:1,v=null!=(r=null==f?void 0:f.y)?r:1,y=null!=(n=null==h?void 0:h.x)?n:0,b=null!=(o=null==h?void 0:h.y)?o:0,x=null!=(i=null==m?void 0:m.x)?i:0,S=null!=(a=null==m?void 0:m.y)?a:0,w=null!=(s=null==m?void 0:m.scaleX)?s:1,C=null!=(l=null==m?void 0:m.scaleY)?l:1;return{x:y+x,y:b+S,z:null!=(u=null==h?void 0:h.z)?u:0,scaleX:g*w,scaleY:v*C}}var VM=(e=>(e[e.Idle=0]="Idle",e[e.Forward=1]="Forward",e[e.Reverse=-1]="Reverse",e))(VM||{}),BM={x:.2,y:.2},GM={x:10,y:10};function UM(e,t,r,n=25,o=BM,i=GM){const{x:a,y:s}=t,{rect:l,isTop:u,isBottom:c,isLeft:d,isRight:p}=MM(e),f=zM(e),h=HM(NM(e,!0)),m=null!==h&&(null==h?void 0:h.scaleX)<0,g=null!==h&&(null==h?void 0:h.scaleY)<0,v=new ZI(l.left*f.scaleX+f.x,l.top*f.scaleY+f.y,l.width*f.scaleX,l.height*f.scaleY),y={x:0,y:0},b={x:0,y:0},x=v.height*o.y,S=v.width*o.x;return(!u||g&&!c)&&s<=v.top+x&&1!==(null==r?void 0:r.y)&&a>=v.left-i.x&&a<=v.right+i.x?(y.y=g?1:-1,b.y=n*Math.abs((v.top+x-s)/x)):(!c||g&&!u)&&s>=v.bottom-x&&-1!==(null==r?void 0:r.y)&&a>=v.left-i.x&&a<=v.right+i.x&&(y.y=g?-1:1,b.y=n*Math.abs((v.bottom-x-s)/x)),(!p||m&&!d)&&a>=v.right-S&&-1!==(null==r?void 0:r.x)&&s>=v.top-i.y&&s<=v.bottom+i.y?(y.x=m?-1:1,b.x=n*Math.abs((v.right-S-a)/S)):(!d||m&&!p)&&a<=v.left+S&&1!==(null==r?void 0:r.x)&&s>=v.top-i.y&&s<=v.bottom+i.y&&(y.x=m?1:-1,b.x=n*Math.abs((v.left+S-a)/S)),{direction:y,speed:b}}function YM(e,t=!1){if("scrollIntoViewIfNeeded"in(r=e)&&"function"==typeof r.scrollIntoViewIfNeeded)return void e.scrollIntoViewIfNeeded(t);var r;if(!NR(e))return e.scrollIntoView();var n=function(e){const[t]=FM(e,{limit:1});return null!=t?t:null}(e);if(!NR(n))return;const o=NM(n,!0),i=parseInt(o.getPropertyValue("border-top-width")),a=parseInt(o.getPropertyValue("border-left-width")),s=e.offsetTop-n.offsetTop<n.scrollTop,l=e.offsetTop-n.offsetTop+e.clientHeight-i>n.scrollTop+n.clientHeight,u=e.offsetLeft-n.offsetLeft<n.scrollLeft,c=e.offsetLeft-n.offsetLeft+e.clientWidth-a>n.scrollLeft+n.clientWidth,d=s&&!l;(s||l)&&t&&(n.scrollTop=e.offsetTop-n.offsetTop-n.clientHeight/2-i+e.clientHeight/2),(u||c)&&t&&(n.scrollLeft=e.offsetLeft-n.offsetLeft-n.clientWidth/2-a+e.clientWidth/2),(s||l||u||c)&&!t&&e.scrollIntoView(d)}function KM({element:e,keyframes:t,options:r}){return e.animate(t,r).finished}function XM(e,t=NM(e).translate,r=!0){if(r){const t=LR(e,e=>"translate"in e);if(t){const{translate:e=""}=t[0];if("string"==typeof e){const t=$M(e);if(t)return t}}}if(t){const e=$M(t);if(e)return e}return{x:0,y:0,z:0}}var JM=new AM(e=>setTimeout(e,0)),ZM=new Map,QM=ZM.clear.bind(ZM);function eL(e,t){const r=function(e){const t=e.ownerDocument;let r=ZM.get(t);if(r)return r;r=t.getAnimations(),ZM.set(t,r),JM.schedule(QM);const n=r.filter(t=>MR(t.effect)&&t.effect.target===e);return ZM.set(e,n),r}(e).filter(e=>{var r,n;if(MR(e.effect)){const{target:o}=e.effect;if(null==(n=o&&(null==(r=t.isValidTarget)?void 0:r.call(t,o)))||n)return e.effect.getKeyframes().some(e=>{for(const r of t.properties)if(e[r])return!0})}}).map(e=>{const{effect:t,currentTime:r}=e,n=null==t?void 0:t.getComputedTiming().duration;if(!e.pending&&"finished"!==e.playState)return"number"==typeof n&&"number"==typeof r&&r<n?(e.currentTime=n,()=>{e.currentTime=r}):void 0});if(r.length>0)return()=>r.forEach(e=>null==e?void 0:e())}var tL=class extends ZI{constructor(e,t={}){var r,n,o,i;const{frameTransform:a=zM(e),ignoreTransforms:s,getBoundingClientRect:l=AR}=t,u=eL(e,{properties:["transform","translate","scale","width","height"],isValidTarget:t=>(t!==e||VR())&&t.contains(e)}),c=l(e);let d,{top:p,left:f,width:h,height:m}=c;const g=NM(e),v=HM(g),y={x:null!=(r=null==v?void 0:v.scaleX)?r:1,y:null!=(n=null==v?void 0:v.scaleY)?n:1},b=function(e,t){var r;const n=e.getAnimations();let o=null;if(!n.length)return null;for(const e of n){if("running"!==e.playState)continue;const n=MR(e.effect)?e.effect.getKeyframes():[],i=n[n.length-1];if(!i)continue;const{transform:a,translate:s,scale:l}=i;if(a||s||l){const e=HM({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&&(o=o?{x:o.x+e.x,y:o.y+e.y,z:null!=(r=o.z)?r:e.z,scaleX:o.scaleX*e.scaleX,scaleY:o.scaleY*e.scaleY}:e)}}return o}(e,g);null==u||u(),v&&(d=function(e,t,r){const{scaleX:n,scaleY:o,x:i,y:a}=t,s=e.left-i-(1-n)*parseFloat(r),l=e.top-a-(1-o)*parseFloat(r.slice(r.indexOf(" ")+1)),u=n?e.width/n:e.width,c=o?e.height/o:e.height;return{width:u,height:c,top:l,right:s+u,bottom:l+c,left:s}}(c,v,g.transformOrigin),(s||b)&&(p=d.top,f=d.left,h=d.width,m=d.height));const x={width:null!=(o=null==d?void 0:d.width)?o:h,height:null!=(i=null==d?void 0:d.height)?i:m};if(b&&!s&&d){const e=function(e,t,r){const{scaleX:n,scaleY:o,x:i,y:a}=t,s=e.left+i+(1-n)*parseFloat(r),l=e.top+a+(1-o)*parseFloat(r.slice(r.indexOf(" ")+1)),u=n?e.width*n:e.width,c=o?e.height*o:e.height;return{width:u,height:c,top:l,right:s+u,bottom:l+c,left:s}}(d,b,g.transformOrigin);p=e.top,f=e.left,h=e.width,m=e.height,y.x=b.scaleX,y.y=b.scaleY}a&&(s||(f*=a.scaleX,h*=a.scaleX,p*=a.scaleY,m*=a.scaleY),f+=a.x,p+=a.y),super(f,p,h,m),this.scale=y,this.intrinsicWidth=x.width,this.intrinsicHeight=x.height}};function rL(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 nL=class{constructor(e){this.element=e,this.initial=new Map}set(e,t=""){const{element:r}=this;if(rL(r))for(const[n,o]of Object.entries(e)){const e=`${t}${n}`;this.initial.has(e)||this.initial.set(e,r.style.getPropertyValue(e)),r.style.setProperty(e,"string"==typeof o?o:`${o}px`)}}remove(e,t=""){const{element:r}=this;if(rL(r))for(const n of e){const e=`${t}${n}`;r.style.removeProperty(e)}}reset(){const{element:e}=this;if(rL(e)){for(const[t,r]of this.initial)e.style.setProperty(t,r);""===e.getAttribute("style")&&e.removeAttribute("style")}}};function oL(e){return!!e&&(e instanceof qR(e).Element||OR(e)&&e.nodeType===Node.ELEMENT_NODE)}function iL(e){if(!e)return!1;const{KeyboardEvent:t}=qR(e.target);return e instanceof t}var aL={};function sL(e){const t=null==aL[e]?0:aL[e]+1;return aL[e]=t,`${e}-${t}`}var lL=e=>{var t;return null!=(t=(({dragOperation:e,droppable:t})=>{const r=e.position.current;if(!r)return null;const{id:n}=t;if(!t.shape)return null;if(t.shape.containsPoint(r))return{id:n,value:1/JI.distance(t.shape.center,r),type:lP.PointerIntersection,priority:sP.High};return null})(e))?t:(({dragOperation:e,droppable:t})=>{const{shape:r}=e;if(!t.shape||!(null==r?void 0:r.current))return null;const n=r.current.intersectionArea(t.shape);if(n){const{position:o}=e,i=JI.distance(t.shape.center,o.current),a=n/(r.current.area+t.shape.area-n)/i;return{id:t.id,value:a,type:lP.ShapeIntersection,priority:sP.Normal}}return null})(e)},uL=e=>{const{dragOperation:t,droppable:r}=e,{shape:n,position:o}=t;if(!r.shape)return null;const i=n?ZI.from(n.current.boundingRectangle).corners:void 0,a=ZI.from(r.shape.boundingRectangle).corners.reduce((e,t,r)=>{var n;return e+JI.distance(JI.from(t),null!=(n=null==i?void 0:i[r])?n:o.current)},0),s=a/4;return{id:r.id,value:1/s,type:lP.Collision,priority:sP.Normal}},cL=Object.create,dL=Object.defineProperty,pL=Object.defineProperties,fL=Object.getOwnPropertyDescriptor,hL=Object.getOwnPropertyDescriptors,mL=Object.getOwnPropertySymbols,gL=Object.prototype.hasOwnProperty,vL=Object.prototype.propertyIsEnumerable,yL=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),bL=e=>{throw TypeError(e)},xL=(e,t,r)=>t in e?dL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,SL=(e,t)=>{for(var r in t||(t={}))gL.call(t,r)&&xL(e,r,t[r]);if(mL)for(var r of mL(t))vL.call(t,r)&&xL(e,r,t[r]);return e},wL=(e,t)=>pL(e,hL(t)),CL=(e,t)=>dL(e,"name",{value:t,configurable:!0}),EL=(e,t)=>{var r={};for(var n in e)gL.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&mL)for(var n of mL(e))t.indexOf(n)<0&&vL.call(e,n)&&(r[n]=e[n]);return r},IL=e=>{var t;return[,,,cL(null!=(t=null==e?void 0:e[yL("metadata")])?t:null)]},DL=["class","method","getter","setter","accessor","field","value","get","set"],PL=e=>void 0!==e&&"function"!=typeof e?bL("Function expected"):e,RL=(e,t,r,n,o)=>({kind:DL[e],name:t,metadata:n,addInitializer:e=>r._?bL("Already initialized"):o.push(PL(e||null))}),ML=(e,t)=>xL(t,yL("metadata"),e[3]),LL=(e,t,r,n)=>{for(var o=0,i=e[t>>1],a=i&&i.length;o<a;o++)1&t?i[o].call(r):n=i[o].call(r,n);return n},AL=(e,t,r,n,o,i)=>{var a,s,l,u,c,d=7&t,p=!!(8&t),f=!!(16&t),h=d>3?e.length+1:d?p?1:2:0,m=DL[d+5],g=d>3&&(e[h-1]=[]),v=e[h]||(e[h]=[]),y=d&&(!f&&!p&&(o=o.prototype),d<5&&(d>3||!f)&&fL(d<4?o:{get[r](){return qL(this,i)},set[r](e){return NL(this,i,e)}},r));d?f&&d<4&&CL(i,(d>2?"set ":d>1?"get ":"")+r):CL(o,r);for(var b=n.length-1;b>=0;b--)u=RL(d,r,l={},e[3],v),d&&(u.static=p,u.private=f,c=u.access={has:f?e=>OL(o,e):e=>r in e},3^d&&(c.get=f?e=>(1^d?qL:_L)(e,o,4^d?i:y.get):e=>e[r]),d>2&&(c.set=f?(e,t)=>NL(e,o,t,4^d?i:y.set):(e,t)=>e[r]=t)),s=(0,n[b])(d?d<4?f?i:y[m]:d>4?void 0:{get:y.get,set:y.set}:o,u),l._=1,4^d||void 0===s?PL(s)&&(d>4?g.unshift(s):d?f?i=s:y[m]=s:o=s):"object"!=typeof s||null===s?bL("Object expected"):(PL(a=s.get)&&(y.get=a),PL(a=s.set)&&(y.set=a),PL(a=s.init)&&g.unshift(a));return d||ML(e,o),y&&dL(o,r,y),f?4^d?i:y:o},kL=(e,t,r)=>t.has(e)||bL("Cannot "+r),OL=(e,t)=>Object(t)!==t?bL('Cannot use the "in" operator on this value'):e.has(t),qL=(e,t,r)=>(kL(e,t,"read from private field"),r?r.call(e):t.get(e)),TL=(e,t,r)=>t.has(e)?bL("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),NL=(e,t,r,n)=>(kL(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),_L=(e,t,r)=>(kL(e,t,"access private method"),r),jL="button",FL="draggable",zL="dnd-kit-description",WL="dnd-kit-announcement",$L={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."},HL={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:r}){if(e)return r?`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 VL(e){const t=e.tagName.toLowerCase();return["input","select","textarea","a","button"].includes(t)}var BL=["dragover","dragmove"];var GL,UL,YL,KL,XL,JL,ZL,QL,eA,tA,rA,nA,oA,iA=new Map,aA=class extends(XL=WD,KL=[EI],YL=[II],UL=[II],GL=[II],XL){constructor(e){super(e),LL(ZL,5,this),TL(this,eA),TL(this,JL,new Set),TL(this,QL,LL(ZL,8,this,new Set)),LL(ZL,11,this),this.registerEffect(_L(this,eA,tA))}register(e){return qL(this,JL).add(e),()=>{qL(this,JL).delete(e)}}addRoot(e){return pE(()=>{const t=new Set(this.additionalRoots);t.add(e),this.additionalRoots=t}),()=>{pE(()=>{const t=new Set(this.additionalRoots);t.delete(e),this.additionalRoots=t})}}get sourceRoot(){var e;const{source:t}=this.manager.dragOperation;return UR(null!=(e=null==t?void 0:t.element)?e:null)}get targetRoot(){var e;const{target:t}=this.manager.dragOperation;return UR(null!=(e=null==t?void 0:t.element)?e:null)}get roots(){const{status:e}=this.manager.dragOperation;if(e.initializing||e.initialized){const e=[this.sourceRoot,this.targetRoot].filter(e=>null!=e);return new Set([...e,...this.additionalRoots])}return new Set}};ZL=IL(XL),JL=new WeakMap,QL=new WeakMap,eA=new WeakSet,tA=function(){const{roots:e}=this,t=[];for(const r of e)for(const e of qL(this,JL))t.push(_L(this,eA,rA).call(this,r,e));return()=>{for(const e of t)e()}},rA=function(e,t){let r=iA.get(e);r||(r=new Map,iA.set(e,r));let n=r.get(t);if(!n){const o=TR(e)?_L(this,eA,nA).call(this,e,r,t):_L(this,eA,oA).call(this,e,r,t);if(!o)return()=>{};n=o,r.set(t,n)}n.refCount++;let o=!1;return()=>{o||(o=!0,n.refCount--,0===n.refCount&&n.cleanup())}},nA=function(e,t,r){const n=e.createElement("style");n.textContent=r,e.head.prepend(n);const o=new MutationObserver(t=>{for(const r of t)for(const t of Array.from(r.removedNodes))if(t===n)return void e.head.prepend(n)});return o.observe(e.head,{childList:!0}),{refCount:0,cleanup:()=>{o.disconnect(),n.remove(),t.delete(r),0===t.size&&iA.delete(e)}}},oA=function(e,t,r){!("adoptedStyleSheets"in e)||Array.isArray(e.adoptedStyleSheets);const n=e.ownerDocument.defaultView,{CSSStyleSheet:o}=null!=n?n:{};if(!o)return null;const i=new o;return i.replaceSync(r),e.adoptedStyleSheets.push(i),{refCount:0,cleanup:()=>{var n;if(GR(e)&&(null==(n=e.host)?void 0:n.isConnected)){const t=e.adoptedStyleSheets.indexOf(i);-1!==t&&e.adoptedStyleSheets.splice(t,1)}t.delete(r),0===t.size&&iA.delete(e)}}},AL(ZL,4,"additionalRoots",KL,aA,QL),AL(ZL,2,"sourceRoot",YL,aA),AL(ZL,2,"targetRoot",UL,aA),AL(ZL,2,"roots",GL,aA),ML(ZL,aA);var sA="data-dnd-",lA=`${sA}dropping`,uA="--dnd-",cA=`${sA}dragging`,dA=`${sA}placeholder`,pA=[cA,dA,"popover","aria-pressed","aria-grabbing"],fA=["view-transition-name"],hA=`\n :is(:root,:host) [${cA}] {\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(${uA}top, 0px) !important;\n left: var(${uA}left, 0px) !important;\n right: unset !important;\n bottom: unset !important;\n width: var(${uA}width, auto);\n max-width: var(${uA}width, auto);\n height: var(${uA}height, auto);\n max-height: var(${uA}height, auto);\n transition: var(${uA}transition) !important;\n }\n\n :is(:root,:host) [${dA}] {\n transition: none;\n }\n\n :is(:root,:host) [${dA}='hidden'] {\n visibility: hidden;\n }\n\n [${cA}] * {\n pointer-events: none !important;\n }\n\n [${cA}]:not([${lA}]) {\n translate: var(${uA}translate) !important;\n }\n\n [${cA}][style*='${uA}scale'] {\n scale: var(${uA}scale) !important;\n transform-origin: var(${uA}transform-origin) !important;\n }\n\n @layer dnd-kit {\n :where([${cA}][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 [${cA}]::backdrop, [${sA}overlay]:not([${cA}]) {\n display: none;\n visibility: hidden;\n }\n`.replace(/\n+/g," ").replace(/\s+/g," ").trim();function mA(e,t="hidden"){return pE(()=>{const{element:r,manager:n}=e;if(!r||!n)return;const o=function(e,t){const r=new Map;for(const n of t)if(n.element&&(e===n.element||e.contains(n.element))){const e=`${sA}${sL("dom-id")}`;n.element.setAttribute(e,""),r.set(n,e)}return r}(r,n.registry.droppables),i=[],a=function(e){const t="input, textarea, select, canvas, [contenteditable]",r=e.cloneNode(!0),n=Array.from(e.querySelectorAll(t));return Array.from(r.querySelectorAll(t)).forEach((e,t)=>{const r=n[t];if(KR(e)&&KR(r)&&("file"!==e.type&&(e.value=r.value),"radio"===e.type&&e.name&&(e.name=`Cloned__${e.name}`)),XR(e)&&XR(r)&&r.width>0&&r.height>0){const t=e.getContext("2d");null==t||t.drawImage(r,0,0)}}),r}(r),{remove:s}=a;return function(e,t,r){for(const[n,o]of e){if(!n.element)continue;const e=`[${o}]`,i=t.matches(e)?t:t.querySelector(e);if(n.element.removeAttribute(o),!i)continue;const a=n.element;n.proxy=i,i.removeAttribute(o),ZR.set(a,i),r.push(()=>{ZR.delete(a),n.proxy=void 0})}}(o,a,i),function(e,t="hidden"){e.setAttribute("inert","true"),e.setAttribute("tab-index","-1"),e.setAttribute("aria-hidden","true"),e.setAttribute(dA,t)}(a,t),a.remove=()=>{i.forEach(e=>e()),s.call(a)},a})}function gA(e,t){return e===t||eM(e)===eM(t)}function vA(e){const{target:t}=e;"newState"in e&&"closed"===e.newState&&oL(t)&&t.hasAttribute("popover")&&requestAnimationFrame(()=>PM(t))}function yA(e){return"TR"===e.tagName}var bA,xA,SA,wA,CA,EA,IA,DA=250,PA="ease";var RA=class extends(xA=FD,bA=[EI],xA){constructor(e,t){super(e,t),TL(this,CA),TL(this,wA,LL(SA,8,this)),LL(SA,11,this),this.state={initial:{},current:{}};const r=e.registry.plugins.get(aA),n=null==r?void 0:r.register(hA);if(n){const e=this.destroy.bind(this);this.destroy=()=>{n(),e()}}this.registerEffect(_L(this,CA,EA).bind(this,r)),this.registerEffect(_L(this,CA,IA))}};SA=IL(xA),wA=new WeakMap,CA=new WeakSet,EA=function(e){const{overlay:t}=this;if(!t||!e)return;const r=UR(t);return r?e.addRoot(r):void 0},IA=function(){var e,t,r;const{state:n,manager:o,options:i}=this,{dragOperation:a}=o,{position:s,source:l,status:u}=a;if(u.idle)return n.current={},void(n.initial={});if(!l)return;const{element:c,feedback:d}=l;if(!c||"none"===d||!u.initialized||u.initializing)return;const{initial:p}=n,f=null!=(e=this.overlay)?e:c,h=zM(f),m=zM(c),g=!gA(c,f),v=new tL(c,{frameTransform:g?m:null,ignoreTransforms:!g}),y=m.scaleX/h.scaleX,b=m.scaleY/h.scaleY;let{width:x,height:S,top:w,left:C}=v;g&&(x/=y,S/=b);const E=new nL(f),{transition:I,translate:D,boxSizing:P,paddingBlockStart:R,paddingBlockEnd:M,paddingInlineStart:L,paddingInlineEnd:A,borderInlineStartWidth:k,borderInlineEndWidth:O,borderBlockStartWidth:q,borderBlockEndWidth:T}=NM(c),N="clone"===d,_="content-box"===P,j=_?parseInt(L)+parseInt(A)+parseInt(k)+parseInt(O):0,F=_?parseInt(R)+parseInt(M)+parseInt(q)+parseInt(T):0,z="move"===d||this.overlay?null:mA(l,N?"clone":"hidden"),W=pE(()=>iL(o.dragOperation.activatorEvent));if("none"!==D){const e=$M(D);e&&!p.translate&&(p.translate=e)}if(!p.transformOrigin){const e=pE(()=>s.current);p.transformOrigin={x:(e.x-C*h.scaleX-h.x)/(x*h.scaleX),y:(e.y-w*h.scaleY-h.y)/(S*h.scaleY)}}const{transformOrigin:$}=p,H=w*h.scaleY+h.y,V=C*h.scaleX+h.x;if(!p.coordinates&&(p.coordinates={x:V,y:H},1!==y||1!==b)){const{scaleX:e,scaleY:t}=m,{x:r,y:n}=$;p.coordinates.x+=(x*e-x)*r,p.coordinates.y+=(S*t-S)*n}p.dimensions||(p.dimensions={width:x,height:S}),p.frameTransform||(p.frameTransform=h);const B=p.coordinates.x-V,G=p.coordinates.y-H,U=(p.dimensions.width*p.frameTransform.scaleX-x*h.scaleX)*$.x,Y=(p.dimensions.height*p.frameTransform.scaleY-S*h.scaleY)*$.y,K={x:B/h.scaleX+U,y:G/h.scaleY+Y},X=C+K.x,J=w+K.y;f.setAttribute(cA,"true");const Z=pE(()=>a.transform),Q=null!=(t=p.translate)?t:{x:0,y:0},ee=Z.x*h.scaleX+Q.x,te=Z.y*h.scaleY+Q.y,re=BR();if(E.set({width:x-j,height:S-F,top:J+re.y,left:X+re.x,translate:`${ee}px ${te}px 0`,transition:I?`${I}, translate 0ms linear`:"",scale:g?`${y} ${b}`:"","transform-origin":`${100*$.x}% ${100*$.y}%`},uA),z&&(c.insertAdjacentElement("afterend",z),null==i?void 0:i.rootElement)){("function"==typeof i.rootElement?i.rootElement(l):i.rootElement).appendChild(c)}let ne,oe,ie;DM(f)&&(f.hasAttribute("popover")||f.setAttribute("popover","manual"),PM(f),f.addEventListener("beforetoggle",vA));const ae=(se={placeholder:z,element:c,feedbackElement:f,frameTransform:h,transformOrigin:$,width:x,height:S,top:w,left:C,widthOffset:j,heightOffset:F,delta:K,styles:E,dragOperation:a,getElementMutationObserver:()=>ne,getSavedCellWidths:()=>ie,setSavedCellWidths:e=>{ie=e}},new ResizeObserver(()=>{var e,t;const r=new tL(se.placeholder,{frameTransform:se.frameTransform,ignoreTransforms:!0}),n=null!=(e=se.transformOrigin)?e:{x:1,y:1},o=(se.width-r.width)*n.x+se.delta.x,i=(se.height-r.height)*n.y+se.delta.y,a=BR();if(se.styles.set({width:r.width-se.widthOffset,height:r.height-se.heightOffset,top:se.top+i+a.y,left:se.left+o+a.x},uA),null==(t=se.getElementMutationObserver())||t.takeRecords(),yA(se.element)&&yA(se.placeholder)){const e=Array.from(se.element.cells),t=Array.from(se.placeholder.cells);se.getSavedCellWidths()||se.setSavedCellWidths(e.map(e=>e.style.width));for(const[r,n]of e.entries()){const e=t[r];n.style.width=`${e.getBoundingClientRect().width}px`}}se.dragOperation.shape=new tL(se.feedbackElement)}));var se;const le=new tL(f);pE(()=>a.shape=le);const ue=qR(f),ce=e=>{this.manager.actions.stop({event:e})},de=YR(ue);W&&ue.addEventListener("resize",ce),"idle"===pE(()=>l.status)&&requestAnimationFrame(()=>l.status="dragging"),z&&(ae.observe(z),ne=function(e,t,r){const n=new MutationObserver(n=>{let o=!1;for(const r of n){if(r.target!==e){o=!0;continue}if("attributes"!==r.type)continue;const n=r.attributeName;if(n.startsWith("aria-")||pA.includes(n))continue;const i=e.getAttribute(n);if("style"===n){if(rL(e)&&rL(t)){const r=e.style;for(const e of Array.from(t.style))""===r.getPropertyValue(e)&&t.style.removeProperty(e);for(const e of Array.from(r)){if(fA.includes(e)||e.startsWith(uA))continue;const n=r.getPropertyValue(e);t.style.setProperty(e,n)}}}else null!==i?t.setAttribute(n,i):t.removeAttribute(n)}o&&r&&(t.innerHTML=e.innerHTML)});return n.observe(e,{attributes:!0,subtree:!0,childList:!0}),n}(c,z,N),oe=function(e,t,r){const n=new MutationObserver(n=>{for(const o of n)if(0!==o.addedNodes.length)for(const n of Array.from(o.addedNodes)){if(n.contains(e)&&e.nextElementSibling!==t)return e.insertAdjacentElement("afterend",t),void PM(r);if(n.contains(t)&&t.previousElementSibling!==e)return t.insertAdjacentElement("beforebegin",e),void PM(r)}});return n.observe(e.ownerDocument.body,{childList:!0,subtree:!0}),n}(c,z,f));const pe=null==(r=o.dragOperation.source)?void 0:r.id,fe=()=>{var e;if(!W||null==pe)return;const t=o.registry.draggables.get(pe),r=null!=(e=null==t?void 0:t.handle)?e:null==t?void 0:t.element;NR(r)&&r.focus()},he=()=>{var e;if(null==ne||ne.disconnect(),null==oe||oe.disconnect(),ae.disconnect(),ue.removeEventListener("resize",ce),DM(f)&&(f.removeEventListener("beforetoggle",vA),f.removeAttribute("popover")),f.removeAttribute(cA),E.reset(),ie&&yA(c)){const t=Array.from(c.cells);for(const[r,n]of t.entries())n.style.width=null!=(e=ie[r])?e:""}l.status="idle";const t=null!=n.current.translate;z&&(t||z.parentElement!==f.parentElement)&&f.isConnected&&z.replaceWith(f),null==z||z.remove()},me=null==i?void 0:i.dropAnimation,ge=this,ve=PI(()=>{var e;const{transform:t,status:r}=a;if((t.x||t.y||n.current.translate)&&r.dragging){const r=null!=(e=p.translate)?e:{x:0,y:0},o={x:t.x/h.scaleX+r.x,y:t.y/h.scaleY+r.y},i=n.current.translate,s=pE(()=>a.modifiers),l=pE(()=>{var e;return null==(e=a.shape)?void 0:e.current}),u=W&&!de?"250ms cubic-bezier(0.25, 1, 0.5, 1)":"0ms linear";if(E.set({transition:`${I}, translate ${u}`,translate:`${o.x}px ${o.y}px 0`},uA),null==ne||ne.takeRecords(),l&&l!==le&&i&&!s.length){const e=JI.delta(o,i);a.shape=ZI.from(l.boundingRectangle).translate(e.x*h.scaleX,e.y*h.scaleY)}else a.shape=new tL(f);n.current.translate=o}},function(){if(a.status.dropped){this.dispose(),l.status="dropping";const e=void 0!==ge.dropAnimation?ge.dropAnimation:me;let t=n.current.translate;const r=null!=t;if(t||c===f||(t={x:0,y:0}),!t||null===e)return void he();o.renderer.rendering.then(()=>{!function(e){var t,r,n,o;const{animation:i}=e;if("function"==typeof i){const t=i({element:e.element,feedbackElement:e.feedbackElement,placeholder:e.placeholder,translate:e.translate,moved:e.moved});return void Promise.resolve(t).then(()=>{e.cleanup(),requestAnimationFrame(e.restoreFocus)})}const{duration:a=DA,easing:s=PA}=null!=i?i:{};PM(e.feedbackElement);const[,l]=null!=(t=LR(e.feedbackElement,e=>"translate"in e))?t:[];null==l||l.pause();const u=null!=(r=e.placeholder)?r:e.element,c={frameTransform:gA(e.feedbackElement,u)?null:void 0},d=new tL(e.feedbackElement,c),p=null!=(n=$M(NM(e.feedbackElement).translate))?n:e.translate,f=new tL(u,c),h=ZI.delta(d,f,e.alignment),m=p.x-h.x,g=p.y-h.y,v=Math.round(d.intrinsicHeight)!==Math.round(f.intrinsicHeight)?{minHeight:[`${d.intrinsicHeight}px`,`${f.intrinsicHeight}px`],maxHeight:[`${d.intrinsicHeight}px`,`${f.intrinsicHeight}px`]}:{},y=Math.round(d.intrinsicWidth)!==Math.round(f.intrinsicWidth)?{minWidth:[`${d.intrinsicWidth}px`,`${f.intrinsicWidth}px`],maxWidth:[`${d.intrinsicWidth}px`,`${f.intrinsicWidth}px`]}:{};e.styles.set({transition:e.transition},uA),e.feedbackElement.setAttribute(lA,""),null==(o=e.getElementMutationObserver())||o.takeRecords(),KM({element:e.feedbackElement,keyframes:wL(SL(SL({},v),y),{translate:[`${p.x}px ${p.y}px 0`,`${m}px ${g}px 0`]}),options:{duration:YR(qR(e.feedbackElement))?0:e.moved||e.feedbackElement!==e.element?a:0,easing:s}}).then(()=>{e.feedbackElement.removeAttribute(lA),null==l||l.finish(),e.cleanup(),requestAnimationFrame(e.restoreFocus)})}({element:c,feedbackElement:f,placeholder:z,translate:t,moved:r,transition:I,alignment:l.alignment,styles:E,animation:null!=e?e:void 0,getElementMutationObserver:()=>ne,cleanup:he,restoreFocus:fe})})}});return()=>{he(),ve()}},AL(SA,4,"overlay",bA,RA,wA),ML(SA,RA),RA.configure=_D(RA);var MA,LA,AA,kA,OA,qA,TA,NA=RA,_A=!0;AA=[EI],kA=VM.Forward,MA=[EI],LA=VM.Reverse;var jA=class{constructor(){TL(this,qA,LL(OA,8,this,_A)),LL(OA,11,this),TL(this,TA,LL(OA,12,this,_A)),LL(OA,15,this)}isLocked(e){return e!==VM.Idle&&(null==e?this[VM.Forward]===_A&&this[VM.Reverse]===_A:this[e]===_A)}unlock(e){e!==VM.Idle&&(this[e]=false)}};OA=IL(null),qA=new WeakMap,TA=new WeakMap,AL(OA,4,kA,AA,jA,qA),AL(OA,4,LA,MA,jA,TA),ML(OA,jA);var FA,zA,WA,$A,HA,VA,BA=[VM.Forward,VM.Reverse],GA=class{constructor(){this.x=new jA,this.y=new jA}isLocked(){return this.x.isLocked()&&this.y.isLocked()}},UA=class extends FD{constructor(e){super(e);const t=wE(new GA);let r=null;this.signal=t,kE(()=>{const{status:n}=e.dragOperation;if(!n.initialized)return r=null,void(t.value=new GA);const{delta:o}=e.dragOperation.position;if(r){const e={x:YA(o.x,r.x),y:YA(o.y,r.y)},n=t.peek();cE(()=>{for(const t of sD)for(const r of BA)e[t]===r&&n[t].unlock(r);t.value=n})}r=o})}get current(){return this.signal.peek()}};function YA(e,t){return Math.sign(e-t)}var KA=class extends(zA=WD,FA=[EI],zA){constructor(e){super(e),TL(this,$A,LL(WA,8,this,!1)),LL(WA,11,this),TL(this,HA),TL(this,VA,()=>{if(!qL(this,HA))return;const{element:e,by:t}=qL(this,HA);t.y&&(e.scrollTop+=t.y),t.x&&(e.scrollLeft+=t.x)}),this.scroll=e=>{var t;if(this.disabled)return!1;const r=this.getScrollableElements();if(!r)return NL(this,HA,void 0),!1;const{position:n}=this.manager.dragOperation,o=null==n?void 0:n.current;if(o){const{by:n}=null!=e?e:{},i=n?{x:XA(n.x),y:XA(n.y)}:void 0,a=i?void 0:this.scrollIntentTracker.current;if(null==a?void 0:a.isLocked())return!1;for(const e of r){const r=LM(e,n);if(r.x||r.y){const{speed:r,direction:s}=UM(e,o,i);if(a)for(const e of sD)a[e].isLocked(s[e])&&(r[e]=0,s[e]=0);if(s.x||s.y){const{x:o,y:i}=null!=n?n:s,a=o*r.x,l=i*r.y;if(a||l){const r=null==(t=qL(this,HA))?void 0:t.by;if(this.autoScrolling&&r){if(r.x&&!a||r.y&&!l)continue}return NL(this,HA,{element:e,by:{x:a,y:l}}),kM.schedule(qL(this,VA)),!0}}}}}return NL(this,HA,void 0),!1};let t=null,r=null;const n=wI(()=>{const{position:r,source:n}=e.dragOperation;if(!r)return null;const o=JR(UR(null==n?void 0:n.element),r.current);return o&&(t=o),null!=o?o:t}),o=wI(()=>{const t=n.value,{documentElement:o}=jR(t);if(!t||t===o){const{target:t}=e.dragOperation,n=null==t?void 0:t.element;if(n){const e=FM(n,{excludeElement:!1});return r=e,e}}if(t){const e=FM(t,{excludeElement:!1});return this.autoScrolling&&r&&e.size<(null==r?void 0:r.size)?r:(r=e,e)}return r=null,null},CI);this.getScrollableElements=()=>o.value,this.scrollIntentTracker=new UA(e),this.destroy=e.monitor.addEventListener("dragmove",t=>{!this.disabled&&!t.defaultPrevented&&iL(e.dragOperation.activatorEvent)&&t.by&&this.scroll({by:t.by})&&t.preventDefault()})}};function XA(e){return e>0?VM.Forward:e<0?VM.Reverse:VM.Idle}WA=IL(zA),$A=new WeakMap,HA=new WeakMap,VA=new WeakMap,AL(WA,4,"autoScrolling",FA,KA,$A),ML(WA,KA);var JA,ZA=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()}),QA=class extends FD{constructor(e,t){super(e);const r=e.registry.plugins.get(KA);if(!r)throw new Error("AutoScroller plugin depends on Scroller plugin");this.destroy=kE(()=>{if(this.disabled)return;const{position:t,status:n}=e.dragOperation;if(n.dragging){if(r.scroll()){r.autoScrolling=!0;const e=setInterval(()=>ZA.schedule(r.scroll),10);return()=>{clearInterval(e)}}r.autoScrolling=!1}})}},ek={capture:!0,passive:!0},tk=class extends WD{constructor(e){super(e),TL(this,JA),this.handleScroll=()=>{null==qL(this,JA)&&NL(this,JA,setTimeout(()=>{this.manager.collisionObserver.forceUpdate(!1),NL(this,JA,void 0)},50))};const{dragOperation:t}=this.manager;this.destroy=kE(()=>{var e,r,n;if(t.status.dragging){const o=null!=(n=null==(r=null==(e=t.source)?void 0:e.element)?void 0:r.ownerDocument)?n:document;return o.addEventListener("scroll",this.handleScroll,ek),()=>{o.removeEventListener("scroll",this.handleScroll,ek)}}})}};JA=new WeakMap;function rk(){var e;null==(e=document.getSelection())||e.removeAllRanges()}var nk,ok=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 r;const n=null!=(r=t.handle)?r:t.element;return e.target!==n}}),ik=class extends KP{constructor(e,t){super(e),this.manager=e,this.options=t,TL(this,nk,[]),this.listeners=new QR,this.handleSourceKeyDown=(e,t,r)=>{if(this.disabled||e.defaultPrevented)return;if(!oL(e.target))return;if(t.disabled)return;const{keyboardCodes:n=ok.keyboardCodes,preventActivation:o=ok.preventActivation}=null!=r?r:{};n.start.includes(e.code)&&this.manager.dragOperation.status.idle&&((null==o?void 0:o(e,t))||this.handleStart(e,t,r))}}bind(e,t=this.options){const r=kE(()=>{var r;const n=null!=(r=e.handle)?r:e.element,o=r=>{iL(r)&&this.handleSourceKeyDown(r,e,t)};if(n)return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}});return r}handleStart(e,t,r){const{element:n}=t;if(!n)throw new Error("Source draggable does not have an associated element");e.preventDefault(),e.stopImmediatePropagation(),YM(n);const{center:o}=new tL(n);if(this.manager.actions.start({event:e,coordinates:{x:o.x,y:o.y},source:t}).signal.aborted)return this.cleanup();this.sideEffects();const i=jR(n),a=[this.listeners.bind(i,[{type:"keydown",listener:e=>this.handleKeyDown(e,t,r),options:{capture:!0}}])];qL(this,nk).push(...a)}handleKeyDown(e,t,r){const{keyboardCodes:n=ok.keyboardCodes}=null!=r?r:{};if(lk(e,[...n.end,...n.cancel])){e.preventDefault();const t=lk(e,n.cancel);return void this.handleEnd(e,t)}lk(e,n.up)?this.handleMove("up",e):lk(e,n.down)&&this.handleMove("down",e),lk(e,n.left)?this.handleMove("left",e):lk(e,n.right)&&this.handleMove("right",e)}handleEnd(e,t){this.manager.actions.stop({event:e,canceled:t}),this.cleanup()}handleMove(e,t){var r,n;const{shape:o}=this.manager.dragOperation,i=t.shiftKey?5:1;let a={x:0,y:0},s=null!=(n=null==(r=this.options)?void 0:r.offset)?n:ok.offset;if("number"==typeof s&&(s={x:s,y:s}),o){switch(e){case"up":a={x:0,y:-s.y*i};break;case"down":a={x:0,y:s.y*i};break;case"left":a={x:-s.x*i,y:0};break;case"right":a={x:s.x*i,y:0}}(a.x||a.y)&&(t.preventDefault(),this.manager.actions.move({event:t,by:a}))}}sideEffects(){const e=this.manager.registry.plugins.get(QA);!1===(null==e?void 0:e.disabled)&&(e.disable(),qL(this,nk).push(()=>{e.enable()}))}cleanup(){qL(this,nk).forEach(e=>e()),NL(this,nk,[])}destroy(){this.cleanup(),this.listeners.clear()}};nk=new WeakMap,ik.configure=_D(ik),ik.defaults=ok;var ak,sk=ik;function lk(e,t){return t.includes(e.code)}var uk,ck;ak=new WeakMap;uk=new WeakMap,ck=new WeakMap;var dk=class{};dk.Delay=class extends JP{constructor(){super(...arguments),TL(this,uk),TL(this,ck)}onEvent(e){switch(e.type){case"pointerdown":NL(this,ck,WR(e)),NL(this,uk,setTimeout(()=>this.activate(e),this.options.value));break;case"pointermove":if(!qL(this,ck))return;const{x:t,y:r}=WR(e);tD({x:t-qL(this,ck).x,y:r-qL(this,ck).y},this.options.tolerance)&&this.abort();break;case"pointerup":this.abort()}}abort(){qL(this,uk)&&(clearTimeout(qL(this,uk)),NL(this,ck,void 0),NL(this,uk,void 0))}},dk.Distance=class extends JP{constructor(){super(...arguments),TL(this,ak)}onEvent(e){switch(e.type){case"pointerdown":NL(this,ak,WR(e));break;case"pointermove":if(!qL(this,ak))return;const{x:t,y:r}=WR(e),n={x:t-qL(this,ak).x,y:r-qL(this,ak).y},{tolerance:o}=this.options;if(o&&tD(n,o))return void this.abort();tD(n,this.options.value)&&this.activate(e);break;case"pointerup":this.abort()}}abort(){NL(this,ak,void 0)}};var pk,fk=Object.freeze({activationConstraints(e,t){var r;const{pointerType:n,target:o}=e;if("mouse"!==n||!oL(o)||t.handle!==o&&!(null==(r=t.handle)?void 0:r.contains(o)))return"touch"===n?[new dk.Delay({value:250,tolerance:5})]:function(e){if(!oL(e))return!1;const{tagName:t}=e;return"INPUT"===t||"TEXTAREA"===t||(r=e).hasAttribute("contenteditable")&&"false"!==r.getAttribute("contenteditable");var r}(o)&&!e.defaultPrevented?[new dk.Delay({value:200,tolerance:0})]:[new dk.Delay({value:200,tolerance:10}),new dk.Distance({value:5})]},preventActivation(e,t){var r;const{target:n}=e;return n!==t.element&&(n!==t.handle&&(!!oL(n)&&(!(null==(r=t.handle)?void 0:r.contains(n))&&Boolean(n.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 ')))))}}),hk=class extends KP{constructor(e,t){super(e),this.manager=e,this.options=t,TL(this,pk,new Set),this.listeners=new QR,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,r=this.options){const{activationConstraints:n=fk.activationConstraints}=null!=r?r:{};return"function"==typeof n?n(e,t):n}bind(e,t=this.options){const r=kE(()=>{var r;const n=new AbortController,{signal:o}=n,i=r=>{(function(e){if(!e)return!1;const{PointerEvent:t}=qR(e.target);return e instanceof t})(r)&&this.handlePointerDown(r,e,t)};let a=[null!=(r=e.handle)?r:e.element];(null==t?void 0:t.activatorElements)&&(a=Array.isArray(t.activatorElements)?t.activatorElements:t.activatorElements(e));for(const e of a)e&&(bk(e.ownerDocument.defaultView),e.addEventListener("pointerdown",i,{signal:o}));return()=>n.abort()});return r}handlePointerDown(e,t,r){if(this.disabled||!e.isPrimary||0!==e.button||!oL(e.target)||t.disabled||function(e){return"sensor"in e}(e)||!this.manager.dragOperation.status.idle)return;const{preventActivation:n=fk.preventActivation}=null!=r?r:{};if(null==n?void 0:n(e,t))return;const{target:o}=e,i=NR(o)&&o.draggable&&"true"===o.getAttribute("draggable"),a=zM(t.element),{x:s,y:l}=WR(e);this.initialCoordinates={x:s*a.scaleX+a.x,y:l*a.scaleY+a.y};const u=this.activationConstraints(e,t,r);e.sensor=this;const c=new XP(u,e=>this.handleStart(t,e));c.signal.onabort=()=>this.handleCancel(e),c.onEvent(e),this.controller=c;const d=HR(),p=this.listeners.bind(d,[{type:"pointermove",listener:e=>this.handlePointerMove(e,t)},{type:"pointerup",listener:this.handlePointerUp,options:{capture:!0}},{type:"pointercancel",listener:this.handleCancel},{type:"dragstart",listener:i?this.handleCancel:gk,options:{capture:!0}}]);qL(this,pk).add(()=>{p(),this.initialCoordinates=void 0})}handlePointerMove(e,t){var r,n;if(!1!==(null==(r=this.controller)?void 0:r.activated)){if(this.manager.dragOperation.status.dragging){const r=WR(e),n=zM(t.element);r.x=r.x*n.scaleX+n.x,r.y=r.y*n.scaleY+n.y,e.preventDefault(),e.stopPropagation(),this.latest.event=e,this.latest.coordinates=r,kM.schedule(this.handleMove)}}else null==(n=this.controller)||n.onEvent(e)}handlePointerUp(e){const{status:t}=this.manager.dragOperation;if(!t.idle){e.preventDefault(),e.stopPropagation();const r=!t.initialized;this.manager.actions.stop({event:e,canceled:r})}this.cleanup()}handleKeyDown(e){"Escape"===e.key&&(e.preventDefault(),this.handleCancel(e))}handleStart(e,t){const{manager:r,initialCoordinates:n}=this;if(!n||!r.dragOperation.status.idle)return;if(t.defaultPrevented)return;if(r.actions.start({coordinates:n,event:t,source:e}).signal.aborted)return this.cleanup();t.preventDefault();const o=jR(t.target).body;o.setPointerCapture(t.pointerId);const i=oL(t.target)?[t.target,o]:o,a=this.listeners.bind(i,[{type:"touchmove",listener:gk,options:{passive:!1}},{type:"click",listener:gk},{type:"contextmenu",listener:gk},{type:"keydown",listener:this.handleKeyDown}]);qL(this,pk).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},qL(this,pk).forEach(e=>e()),qL(this,pk).clear()}destroy(){this.cleanup(),this.listeners.clear()}};pk=new WeakMap,hk.configure=_D(hk),hk.defaults=fk;var mk=hk;function gk(e){e.preventDefault()}function vk(){}var yk=new WeakSet;function bk(e){e&&!yk.has(e)&&(e.addEventListener("touchmove",vk,{capture:!1,passive:!1}),yk.add(e))}var xk,Sk,wk,Ck,Ek,Ik,Dk,Pk,Rk,Mk,Lk,Ak,kk,Ok,qk,Tk,Nk,_k,jk={modifiers:[],plugins:[class extends FD{constructor(e,t){super(e);const{id:r,idPrefix:{description:n=zL,announcement:o=WL}={},announcements:i=HL,screenReaderInstructions:a=$L,debounce:s=500}=null!=t?t:{},l=r?`${n}-${r}`:sL(n),u=r?`${o}-${r}`:sL(o);let c,d,p,f;const h=(e=f)=>{p&&e&&(null==p?void 0:p.nodeValue)!==e&&(p.nodeValue=e)},m=()=>kM.schedule(h),g=function(e,t){let r;const n=()=>{clearTimeout(r),r=setTimeout(e,t)};return n.cancel=()=>clearTimeout(r),n}(m,s),v=Object.entries(i).map(([e,t])=>this.manager.monitor.addEventListener(e,(r,n)=>{const o=p;if(!o)return;const i=null==t?void 0:t(r,n);i&&o.nodeValue!==i&&(f=i,BL.includes(e)?g():(m(),g.cancel()))})),y=()=>{let e=[];(null==c?void 0:c.isConnected)||(c=function(e,t){const r=document.createElement("div");return r.id=e,r.style.setProperty("display","none"),r.textContent=t,r}(l,a.draggable),e.push(c)),(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}(u),p=document.createTextNode(""),d.appendChild(p),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 r=null!=(e=t.handle)?e:t.element;if(r){c&&d||b.add(y),VL(r)&&!VR()||r.hasAttribute("tabindex")||b.add(()=>r.setAttribute("tabindex","0")),r.hasAttribute("role")||"button"===r.tagName.toLowerCase()||b.add(()=>r.setAttribute("role",jL)),r.hasAttribute("aria-roledescription")||b.add(()=>r.setAttribute("aria-roledescription",FL)),r.hasAttribute("aria-describedby")||b.add(()=>r.setAttribute("aria-describedby",l));for(const e of["aria-pressed","aria-grabbed"]){const n=String(t.isDragging);r.getAttribute(e)!==n&&b.add(()=>r.setAttribute(e,n))}const e=String(t.disabled);r.getAttribute("aria-disabled")!==e&&b.add(()=>r.setAttribute("aria-disabled",e))}}b.size>0&&kM.schedule(x)}),this.destroy=()=>{super.destroy(),null==c||c.remove(),null==d||d.remove(),v.forEach(e=>e())}}},QA,class extends FD{constructor(e,t){super(e,t),this.manager=e;const r=wI(()=>{var e;return jR(null==(e=this.manager.dragOperation.source)?void 0:e.element)});this.destroy=kE(()=>{var e;const{dragOperation:t}=this.manager,{cursor:n="grabbing",nonce:o}=null!=(e=this.options)?e:{};if(t.status.initialized){const e=r.value,t=e.createElement("style");return o&&t.setAttribute("nonce",o),t.textContent=`* { cursor: ${n} !important; }`,e.head.appendChild(t),()=>t.remove()}})}},NA,class extends FD{constructor(e,t){super(e,t),this.manager=e,this.destroy=kE(()=>{var e;const{dragOperation:t}=this.manager,{nonce:r}=null!=(e=this.options)?e:{};if(t.status.initialized){const e=document.createElement("style");return r&&e.setAttribute("nonce",r),e.textContent="* { user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(e),rk(),document.addEventListener("selectionchange",rk,{capture:!0}),()=>{document.removeEventListener("selectionchange",rk,{capture:!0}),e.remove()}}})}}],sensors:[mk,sk]},Fk=class extends wR{constructor(e={}){const t=SR(e.plugins,jk.plugins),r=SR(e.sensors,jk.sensors),n=SR(e.modifiers,jk.modifiers);super(wL(SL({},e),{plugins:[tk,KA,aA,...t],sensors:r,modifiers:n}))}},zk=class extends(Ck=GP,wk=[EI],Sk=[EI],xk=[EI],Ck){constructor(e,t){var r=e,{element:n,effects:o=()=>[],handle:i,feedback:a="default"}=r,s=EL(r,["element","effects","handle","feedback"]);super(SL({effects:()=>[...o(),()=>{var e,t;const{manager:r}=this;if(!r)return;const n=(null!=(t=null==(e=this.sensors)?void 0:e.map(jD))?t:[...r.sensors]).map(e=>{const t=e instanceof KP?e:r.registry.register(e.plugin),n=e instanceof KP?void 0:e.options;return t.bind(this,n)});return function(){n.forEach(e=>e())}}]},s),t),TL(this,Ik,LL(Ek,8,this)),LL(Ek,11,this),TL(this,Dk,LL(Ek,12,this)),LL(Ek,15,this),TL(this,Pk,LL(Ek,16,this)),LL(Ek,19,this),this.element=n,this.handle=i,this.feedback=a}};Ek=IL(Ck),Ik=new WeakMap,Dk=new WeakMap,Pk=new WeakMap,AL(Ek,4,"handle",wk,zk,Ik),AL(Ek,4,"element",Sk,zk,Dk),AL(Ek,4,"feedback",xk,zk,Pk),ML(Ek,zk);var Wk=class extends(Lk=UP,Mk=[EI],Rk=[EI],Lk){constructor(e,t){var r=e,{element:n,effects:o=()=>[]}=r,i=EL(r,["element","effects"]);const{collisionDetector:a=lL}=i,s=e=>{const{manager:t,element:r}=this;if(!r||null===e)return void(this.shape=void 0);if(!t)return;const n=new tL(r),o=pE(()=>this.shape);return n&&(null==o?void 0:o.equals(n))?o:(this.shape=n,n)},l=wE(!1);super(wL(SL({},i),{collisionDetector:a,effects:()=>[...o(),()=>{const{element:e,manager:t}=this;if(!t)return;const{dragOperation:r}=t,{source:n}=r;l.value=Boolean(n&&r.status.initialized&&e&&!this.disabled&&this.accepts(n))},()=>{const{element:e}=this;if(l.value&&e){const t=new IM(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),TL(this,Nk),TL(this,kk,LL(Ak,8,this)),LL(Ak,11,this),TL(this,_k,LL(Ak,12,this)),LL(Ak,15,this),this.element=n,this.refreshShape=()=>s()}set element(e){NL(this,Nk,e,Tk)}get element(){var e;return null!=(e=this.proxy)?e:qL(this,Nk,qk)}};function $k(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}Ak=IL(Lk),kk=new WeakMap,Nk=new WeakSet,_k=new WeakMap,Ok=AL(Ak,20,"#element",Mk,Nk,kk),qk=Ok.get,Tk=Ok.set,AL(Ak,4,"proxy",Rk,Wk,_k),ML(Ak,Wk);var Hk="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?g:d;function Vk(){const e=m(0)[1];return f(()=>{e(e=>e+1)},[e])}function Bk(e,t=[],r=!1){const n=l(e);return n.current=e,function(e,t=!1){const r=l(e.peek()),n=l(!1),o=Vk();return Hk(()=>kE(()=>{const i=r.current,a=e.value;if(i!==a){if(r.current=a,!n.current)return;t?D(o):o()}}),[e,t,o]),{get value(){return n.current=!0,e.peek()}}}(v(()=>wI(()=>n.current()),t),r)}function Gk(e,t){const r=l(new Map),n=Vk();return Hk(()=>{if(e)return kE(()=>{var o;let i=!1,a=!1;for(const n of r.current){const[s]=n,l=pE(()=>n[1]),u=e[s];l!==u&&(i=!0,r.current.set(s,u),a=null!=(o=null==t?void 0:t(s,l,u))&&o)}i&&(a?D(n):n())});r.current.clear()},[e]),v(()=>e?new Proxy(e,{get(e,t){const n=e[t];return r.current.set(t,n),n}}):e,[e])}function Uk(e,t){e()}function Yk(e){const t=l(e);return Hk(()=>{t.current=e},[e]),t}function Kk(e,t,r=d,n=Object.is){const o=l(e);r(()=>{const r=o.current;n(e,r)||(o.current=e,t(e,r))},[t,e])}function Xk(e,t){const r=l($k(e));Hk(()=>{const n=$k(e);n!==r.current&&(r.current=n,t(n))})}var Jk=Object.defineProperty,Zk=Object.defineProperties,Qk=Object.getOwnPropertyDescriptors,eO=Object.getOwnPropertySymbols,tO=Object.prototype.hasOwnProperty,rO=Object.prototype.propertyIsEnumerable,nO=(e,t,r)=>t in e?Jk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,oO=new Fk,iO=u(oO),aO=b(x(({children:e},t)=>{const[r,n]=m(0),o=l(null),i=l(null),a=v(()=>({renderer:{get rendering(){var e;return null!=(e=o.current)?e:Promise.resolve()}},trackRendering(e){o.current||(o.current=new Promise(e=>{i.current=e})),S(()=>{e(),n(e=>e+1)})}}),[]);return Hk(()=>{var e;null==(e=i.current)||e.call(i),o.current=null},[e,r]),w(t,()=>a),null})),sO=[void 0,CI];function lO(e){var t=e,{children:r,onCollision:n,onBeforeDragStart:o,onDragStart:i,onDragMove:a,onDragOver:s,onDragEnd:u}=t,c=((e,t)=>{var r={};for(var n in e)tO.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&eO)for(var n of eO(e))t.indexOf(n)<0&&rO.call(e,n)&&(r[n]=e[n]);return r})(t,["children","onCollision","onBeforeDragStart","onDragStart","onDragMove","onDragOver","onDragEnd"]);const p=l(null),{plugins:f,modifiers:h,sensors:m}=c,g=SR(f,jk.plugins),v=SR(m,jk.sensors),b=SR(h,jk.modifiers),x=Yk(o),S=Yk(i),w=Yk(s),C=Yk(a),E=Yk(u),I=Yk(n),D=function(e){const t=l(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=c.manager)?e:new Fk(c)});return d(()=>{if(!p.current)throw new Error("Renderer not found");const{renderer:e,trackRendering:t}=p.current,{monitor:r}=D;D.renderer=e;const n=[r.addEventListener("beforedragstart",e=>{const r=x.current;r&&t(()=>r(e,D))}),r.addEventListener("dragstart",e=>{var t;return null==(t=S.current)?void 0:t.call(S,e,D)}),r.addEventListener("dragover",e=>{const r=w.current;r&&t(()=>r(e,D))}),r.addEventListener("dragmove",e=>{const r=C.current;r&&t(()=>r(e,D))}),r.addEventListener("dragend",e=>{const r=E.current;r&&t(()=>r(e,D))}),r.addEventListener("collision",e=>{var t;return null==(t=I.current)?void 0:t.call(I,e,D)})];return()=>n.forEach(e=>e())},[D]),Kk(g,()=>D&&(D.plugins=g),...sO),Kk(v,()=>D&&(D.sensors=v),...sO),Kk(b,()=>D&&(D.modifiers=b),...sO),ii.jsxs(iO.Provider,{value:D,children:[ii.jsx(aO,{ref:p,children:r}),r]})}function uO(){return h(iO)}function cO(e){var t;const r=null!=(t=uO())?t:void 0,[n]=m(()=>e(r));return n.manager!==r&&(n.manager=r),Hk(n.register,[r,n]),n}function dO({children:e,className:t,dropAnimation:r,style:o,tag:i,disabled:a}){var s;const u=l(null),c=uO(),p=null!=(s=Bk(()=>null==c?void 0:c.dragOperation.source,[c]).value)?s:null,f="function"==typeof a?a(p):a;d(()=>{if(!u.current||!c||f)return;const e=c.plugins.find(e=>e instanceof NA);return e?(e.overlay=u.current,()=>{e.overlay=void 0}):void 0},[c,f]),d(()=>{if(!c)return;const e=c.plugins.find(e=>e instanceof NA);return e?(e.dropAnimation=r,()=>{e.dropAnimation=void 0}):void 0},[c,r]);const h=v(()=>{if(!c)return null;const e=new Proxy(c.registry,{get:(e,t)=>"register"===t||"unregister"===t?pO:e[t]});return new Proxy(c,{get:(t,r)=>"registry"===r?e:t[r]})},[c]);return ii.jsx(iO.Provider,{value:h,children:n(i||"div",{ref:u,className:t,style:o,"data-dnd-overlay":!0},function(){if(!p||f)return null;if("function"==typeof e)return ii.jsx(fO,{source:p,children:e});return e}())})}function pO(){return()=>{}}function fO({children:e,source:t}){return e(Gk(t))}var hO,mO,gO,vO,yO,bO=Object.create,xO=Object.defineProperty,SO=Object.getOwnPropertyDescriptor,wO=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),CO=e=>{throw TypeError(e)},EO=["class","method","getter","setter","accessor","field","value","get","set"],IO=e=>void 0!==e&&"function"!=typeof e?CO("Function expected"):e,DO=(e,t,r,n,o)=>({kind:EO[e],name:t,metadata:n,addInitializer:e=>r._?CO("Already initialized"):o.push(IO(e||null))}),PO=(e,t,r,n,o,i)=>{for(var a,s,l,u,c=7&t,d=EO[c+5],p=e[2]||(e[2]=[]),f=(o=o.prototype,SO(o,r)),h=n.length-1;h>=0;h--)(l=DO(c,r,s={},e[3],p)).static=false,l.private=false,u=l.access={has:e=>r in e},u.get=e=>e[r],a=(0,n[h])(f[d],l),s._=1,IO(a)&&(f[d]=a);return f&&xO(o,r,f),o},RO=(e,t,r)=>t.has(e)||CO("Cannot "+r),MO=class e{constructor(e,t){this.x=e,this.y=t}static delta(t,r){return new e(t.x-r.x,t.y-r.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:r}){return new e(t,r)}},LO=class extends(gO=MI,mO=[II],hO=[II],gO){constructor(e){var t,r,n;super(MO.from(e),(e,t)=>MO.equals(e,t)),((e,t,r)=>{for(var n=0,o=e[t>>1],i=o&&o.length;n<i;n++)o[n].call(r)})(yO,5,this),t=this,n=0,(r=vO).has(t)?CO("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(t):r.set(t,n),this.velocity={x:0,y:0}}get delta(){return MO.delta(this.current,this.initial)}get direction(){const{current:e,previous:t}=this;if(!t)return null;const r={x:e.x-t.x,y:e.y-t.y};return r.x||r.y?Math.abs(r.x)>Math.abs(r.y)?r.x>0?"right":"left":r.y>0?"down":"up":null}get current(){return super.current}set current(e){const{current:t}=this,r=MO.from(e),n={x:r.x-t.x,y:r.y-t.y},o=Date.now(),i=o-(RO(a=this,s=vO,"read from private field"),s.get(a));var a,s;const l=e=>Math.round(e/i*100);cE(()=>{((e,t,r)=>{RO(e,t,"write to private field"),t.set(e,r)})(this,vO,o),this.velocity={x:l(n.x),y:l(n.y)},super.current=r})}reset(e=this.defaultValue){super.reset(MO.from(e)),this.velocity={x:0,y:0}}};yO=(e=>{var t;return[,,,bO(null!=(t=null==e?void 0:e[wO("metadata")])?t:null)]})(gO),vO=new WeakMap,PO(yO,2,"delta",mO,LO),PO(yO,2,"direction",hO,LO),((e,t)=>{((e,t,r)=>{t in e?xO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(t,wO("metadata"),e[3])})(yO,LO);var AO=(e=>(e.Horizontal="x",e.Vertical="y",e))(AO||{});Object.values(AO);var kO=e=>{var t;return null!=(t=(({dragOperation:e,droppable:t})=>{const r=e.position.current;if(!r)return null;const{id:n}=t;if(!t.shape)return null;if(t.shape.containsPoint(r))return{id:n,value:1/MO.distance(t.shape.center,r),type:lP.PointerIntersection,priority:sP.High};return null})(e))?t:(({dragOperation:e,droppable:t})=>{const{shape:r}=e;if(!t.shape||!(null==r?void 0:r.current))return null;const n=r.current.intersectionArea(t.shape);if(n){const{position:o}=e,i=MO.distance(t.shape.center,o.current),a=n/(r.current.area+t.shape.area-n)/i;return{id:t.id,value:a,type:lP.ShapeIntersection,priority:sP.Normal}}return null})(e)};function OO(e){const{collisionDetector:t,data:r,disabled:n,element:o,id:i,accept:a,type:s}=e,l=cO(t=>new Wk(((e,t)=>Zk(e,Qk(t)))(((e,t)=>{for(var r in t||(t={}))tO.call(t,r)&&nO(e,r,t[r]);if(eO)for(var r of eO(t))rO.call(t,r)&&nO(e,r,t[r]);return e})({},e),{register:!1,element:$k(o)}),t)),u=Gk(l);return Kk(i,()=>l.id=i),Xk(o,e=>l.element=e),Kk(a,()=>l.accept=a,void 0,CI),Kk(t,()=>l.collisionDetector=null!=t?t:kO),Kk(r,()=>r&&(l.data=r)),Kk(n,()=>l.disabled=!0===n),Kk(s,()=>l.type=s),{droppable:u,get isDropTarget(){return u.isDropTarget},ref:f(e=>{var t,r;(e||!(null==(t=l.element)?void 0:t.isConnected)||(null==(r=l.manager)?void 0:r.dragOperation.status.idle))&&(l.element=null!=e?e:void 0)},[l])}}const qO=e=>Array.from({length:e},(e,t)=>t),TO=({id:e,sectionIndex:t,itemIndex:r})=>ii.jsx("span",{children:`${e}-${t}-${r}`}),NO=r.memo(()=>{const e=Pw(QC)??TO,{startSectionIndex:t,startIndex:r,id:n}=Pw(nE)??{};return"number"!=typeof t||"number"!=typeof r||void 0===n?null:ii.jsx(dO,{dropAnimation:null,children:ii.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px",background:"white",boxShadow:"0px 4px 10px 0px rgba(0, 0, 0, 0.15)",borderRadius:"4px",border:"1px solid rgba(0, 0, 0, 0.15)",width:"208px",maxHeight:"32px",fontSize:"12px",lineHeight:"16px"},children:ii.jsx(e,{id:n,sectionIndex:t,itemIndex:r})})})}),_O=({sectionIndex:e,itemIndex:t,isDragging:r})=>{const n=Pw(nE),o=n?.toSectionIndex===e,i=n?.startSectionIndex===e,a=t>(n?.startIndex??t)&&e===n?.startSectionIndex?t-1:t;let s=!1;return i&&n.startIndex===a?s=!1:o&&n.toIndex===a&&(s=!0),ii.jsx("div",{"data-key":"drop-target-indicator",style:{visibility:s&&!r?"visible":"hidden",padding:0,background:"rgba(64, 64, 64, 1)",borderRadius:2,marginLeft:"4px",width:"calc(100% - 8px)",height:"2px"}})},jO=(e,t)=>e?"2px solid rgba(0, 135, 61, 1)":t?"1px dashed rgba(0, 0, 0, 0.43)":void 0,FO=r.memo(({sectionIndex:e})=>{const t=Pw(GC)[e],r=Pw(UC),n=Pw(YC),o=null!==Pw(nE),i=n(e),a=r({sectionIndex:e}),{ref:s,isDropTarget:l}=OO({id:a,type:"section",accept:"item",collisionPriority:sP.Low,data:{id:a,sectionIndex:e,sectionKey:a}});return!l&&t>0?null:ii.jsxs(Qu,{ref:s,sx:{margin:"4px",outline:jO(l,o),borderRadius:"4px",boxSizing:"border-box"},children:[ii.jsx(Qu,{sx:{position:"relative",top:"4px"},children:ii.jsx(_O,{sectionIndex:e,itemIndex:0,isDragging:!1})}),ii.jsxs(Qu,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",padding:"20px 4px"},children:[ii.jsx(mu,{sx:{textAlign:"center",width:"fit-content",maxWidth:"100%",overflowWrap:"break-word",textOverflow:"ellipsis",fontWeight:"600",fontSize:"14px",lineHeight:"16px",color:"rgba(64, 64, 64, 1)"},children:i.title}),ii.jsx(mu,{sx:{textAlign:"center",width:"fit-content",maxWidth:"100%",overflowWrap:"break-word",textOverflow:"ellipsis",fontSize:"12px",lineHeight:"150%",color:"rgba(64, 64, 64, 1)"},children:i.message})]})]})}),zO=r.memo(({id:e,sectionIndex:t})=>{const r=Pw(ZC);return void 0===r?null:ii.jsx(r,{id:e,sectionIndex:t})});var WO=Object.defineProperty,$O=Object.defineProperties,HO=Object.getOwnPropertyDescriptors,VO=Object.getOwnPropertySymbols,BO=Object.prototype.hasOwnProperty,GO=Object.prototype.propertyIsEnumerable,UO=(e,t,r)=>t in e?WO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,YO=(e,t)=>{for(var r in t||(t={}))BO.call(t,r)&&UO(e,r,t[r]);if(VO)for(var r of VO(t))GO.call(t,r)&&UO(e,r,t[r]);return e},KO=(e,t)=>$O(e,HO(t)),XO=class extends vR{apply({transform:e}){if(!this.options)return e;const{axis:t,value:r}=this.options;return KO(YO({},e),{[t]:r})}};XO.configure=_D(XO);var JO=XO,ZO=JO.configure({axis:"x",value:0});JO.configure({axis:"y",value:0});var QO=class extends vR{apply({transform:e}){var t;const{size:r=20}=null!=(t=this.options)?t:{},n="number"==typeof r?r:r.x,o="number"==typeof r?r:r.y;return KO(YO({},e),{x:Math.ceil(e.x/n)*n,y:Math.ceil(e.y/o)*o})}};QO.configure=_D(QO);var eq=Object.create,tq=Object.defineProperty,rq=Object.defineProperties,nq=Object.getOwnPropertyDescriptor,oq=Object.getOwnPropertyDescriptors,iq=Object.getOwnPropertySymbols,aq=Object.prototype.hasOwnProperty,sq=Object.prototype.propertyIsEnumerable,lq=e=>{throw TypeError(e)},uq=(e,t,r)=>t in e?tq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,cq=(e,t)=>{for(var r in t||(t={}))aq.call(t,r)&&uq(e,r,t[r]);if(iq)for(var r of iq(t))sq.call(t,r)&&uq(e,r,t[r]);return e},dq=(e,t)=>rq(e,oq(t)),pq=["class","method","getter","setter","accessor","field","value","get","set"],fq=e=>void 0!==e&&"function"!=typeof e?lq("Function expected"):e,hq=(e,t,r,n,o)=>({kind:pq[e],name:t,metadata:n,addInitializer:e=>r._?lq("Already initialized"):o.push(fq(e||null))}),mq=(e,t,r,n)=>{for(var o=0,i=e[t>>1],a=i&&i.length;o<a;o++)1&t?i[o].call(r):n=i[o].call(r,n);return n},gq=(e,t,r,n,o,i)=>{for(var a,s,l,u,c,d=7&t,p=e.length+1,f=pq[d+5],h=e[p-1]=[],m=e[p]||(e[p]=[]),g=(o=o.prototype,nq({get[r](){return yq(this,i)},set[r](e){return xq(this,i,e)}},r)),v=n.length-1;v>=0;v--)(u=hq(d,r,l={},e[3],m)).static=false,u.private=false,c=u.access={has:e=>r in e},c.get=e=>e[r],c.set=(e,t)=>e[r]=t,s=(0,n[v])({get:g.get,set:g.set},u),l._=1,void 0===s?fq(s)&&(g[f]=s):"object"!=typeof s||null===s?lq("Object expected"):(fq(a=s.get)&&(g.get=a),fq(a=s.set)&&(g.set=a),fq(a=s.init)&&h.unshift(a));return g&&tq(o,r,g),o},vq=(e,t,r)=>t.has(e)||lq("Cannot "+r),yq=(e,t,r)=>(vq(e,t,"read from private field"),t.get(e)),bq=(e,t,r)=>t.has(e)?lq("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),xq=(e,t,r,n)=>(vq(e,t,"write to private field"),t.set(e,r),r);function Sq(e){return e instanceof Zq||e instanceof Jq}var wq=class extends FD{constructor(e){super(e);const t=kE(()=>{const{dragOperation:t}=e;if(iL(t.activatorEvent)&&Sq(t.source)&&t.status.initialized){const t=e.registry.plugins.get(KA);if(t)return t.disable(),()=>t.enable()}}),r=e.monitor.addEventListener("dragmove",(e,t)=>{queueMicrotask(()=>{if(this.disabled||e.defaultPrevented||!e.nativeEvent)return;const{dragOperation:r}=t;if(!iL(e.nativeEvent))return;if(!Sq(r.source))return;if(!r.shape)return;const{actions:n,collisionObserver:o,registry:i}=t,{by:a}=e;if(!a)return;const s=function(e){const{x:t,y:r}=e;if(t>0)return"right";if(t<0)return"left";if(r>0)return"down";if(r<0)return"up"}(a),{source:l,target:u}=r,{center:c}=r.shape.current,d=[],p=[];cE(()=>{for(const e of i.droppables){const{id:t}=e;if(!e.accepts(l)||t===(null==u?void 0:u.id)&&Sq(e)||!e.element)continue;let r=e.shape;const n=new tL(e.element,{getBoundingClientRect:e=>zR(e,void 0,.2)});n.height&&n.width&&(("down"==s&&c.y+10<n.center.y||"up"==s&&c.y-10>n.center.y||"left"==s&&c.x-10>n.center.x||"right"==s&&c.x+10<n.center.x)&&(d.push(e),e.shape=n,p.push(()=>e.shape=r)))}}),e.preventDefault(),o.disable();const f=o.computeCollisions(d,uL);cE(()=>p.forEach(e=>e()));const[h]=f;if(!h)return;const{id:m}=h,{index:g,group:v}=l.sortable;n.setDropTarget(m).then(()=>{const{source:e,target:t,shape:i}=r;if(!e||!Sq(e)||!i)return;const{index:a,group:s,target:l}=e.sortable,u=g!==a||v!==s,c=u?l:null==t?void 0:t.element;if(!c)return;YM(c);const d=new tL(c);if(!d)return;const p=ZI.delta(d,ZI.from(i.current.boundingRectangle),e.alignment);n.move({by:p}),u?n.setDropTarget(e.id).then(()=>o.enable()):o.enable()})})});this.destroy=()=>{r(),t()}}};var Cq=Object.defineProperty,Eq=Object.defineProperties,Iq=Object.getOwnPropertyDescriptors,Dq=Object.getOwnPropertySymbols,Pq=Object.prototype.hasOwnProperty,Rq=Object.prototype.propertyIsEnumerable,Mq=(e,t,r)=>t in e?Cq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Lq=(e,t)=>{for(var r in t||(t={}))Pq.call(t,r)&&Mq(e,r,t[r]);if(Dq)for(var r of Dq(t))Rq.call(t,r)&&Mq(e,r,t[r]);return e},Aq=(e,t)=>Eq(e,Iq(t));function kq(e,t,r){if(t===r)return e;const n=e.slice();return n.splice(r,0,n.splice(t,1)[0]),n}function Oq(e){return"initialIndex"in e&&"number"==typeof e.initialIndex&&"index"in e&&"number"==typeof e.index}function qq(e,t){return function(e,t,r){var n,o,i;const{source:a,target:s,canceled:l}=t.operation;if(!a||!s||l)return"preventDefault"in t&&t.preventDefault(),e;const u=(e,t)=>e===t||"object"==typeof e&&"id"in e&&e.id===t;if(Array.isArray(e)){const n=e.findIndex(e=>u(e,a.id)),o=e.findIndex(e=>u(e,s.id));if(-1===n||-1===o){if(Oq(a)){const n=a.initialIndex,o=a.index;return n===o||n<0||n>=e.length?("preventDefault"in t&&t.preventDefault(),e):r(e,n,o)}return e}if(!l&&"index"in a&&"number"==typeof a.index){const t=a.index;if(t!==n)return r(e,n,t)}return r(e,n,o)}const c=Object.entries(e);let d,p,f=-1,h=-1;for(const[e,t]of c)if(-1===f&&(f=t.findIndex(e=>u(e,a.id)),-1!==f&&(d=e)),-1===h&&(h=t.findIndex(e=>u(e,s.id)),-1!==h&&(p=e)),-1!==f&&-1!==h)break;if(-1===f&&Oq(a)){const n=a.initialGroup,o=a.initialIndex,i=a.group,s=a.index;if(null==n||null==i||!(n in e)||!(i in e))return"preventDefault"in t&&t.preventDefault(),e;if(n===i&&o===s)return"preventDefault"in t&&t.preventDefault(),e;if(n===i)return Aq(Lq({},e),{[n]:r(e[n],o,s)});const l=e[n][o];return Aq(Lq({},e),{[n]:[...e[n].slice(0,o),...e[n].slice(o+1)],[i]:[...e[i].slice(0,s),l,...e[i].slice(s)]})}if(!a.manager)return e;const{dragOperation:m}=a.manager,g=null!=(o=null==(n=m.shape)?void 0:n.current.center)?o:m.position.current;if(null==p&&s.id in e){const t=s.shape&&g.y>s.shape.center.y?e[s.id].length:0;p=s.id,h=t}if(null==d||null==p||d===p&&f===h){if(null!=d&&d===p&&f===h&&Oq(a)){const t=null!=a.group&&a.group!==d,n=a.index!==f;if(t||n){const t=null!=(i=a.group)?i:d;if(t in e){if(d===t)return Aq(Lq({},e),{[d]:r(e[d],f,a.index)});const n=e[d][f];return Aq(Lq({},e),{[d]:[...e[d].slice(0,f),...e[d].slice(f+1)],[t]:[...e[t].slice(0,a.index),n,...e[t].slice(a.index)]})}}}return"preventDefault"in t&&t.preventDefault(),e}if(d===p)return Aq(Lq({},e),{[d]:r(e[d],f,h)});const v=s.shape&&Math.round(g.y)>Math.round(s.shape.center.y)?1:0,y=e[d][f];return Aq(Lq({},e),{[d]:[...e[d].slice(0,f),...e[d].slice(f+1)],[p]:[...e[p].slice(0,h+v),y,...e[p].slice(h+v)]})}(e,t,kq)}var Tq="__default__";function Nq(e,t,r,n){const o=n<t?"afterend":"beforebegin";r.insertAdjacentElement(o,e)}function _q(e,t){return e.index-t.index}function jq(e){return Array.from(e).sort(_q)}var Fq,zq,Wq,$q,Hq,Vq,Bq,Gq,Uq=[wq,class extends FD{constructor(e){super(e);const t=()=>{const t=new Map;for(const r of e.registry.droppables)if(r instanceof Zq){const{sortable:e}=r,{group:n}=e;let o=t.get(n);o||(o=new Set,t.set(n,o)),o.add(e)}for(const[e,r]of t)t.set(e,new Set(jq(r)));return t},r=[e.monitor.addEventListener("dragover",(e,r)=>{if(this.disabled)return;const{dragOperation:n}=r,{source:o,target:i}=n;if(!Sq(o)||!Sq(i))return;if(o.sortable===i.sortable)return;const a=t(),s=o.sortable.group===i.sortable.group,l=a.get(o.sortable.group),u=s?l:a.get(i.sortable.group);l&&u&&queueMicrotask(()=>{e.defaultPrevented||r.renderer.rendering.then(()=>{var n,c,d;const p=t();for(const[e,t]of a.entries()){const r=Array.from(t).entries();for(const[t,o]of r)if(o.index!==t||o.group!==e||!(null==(n=p.get(e))?void 0:n.has(o)))return}const f=o.sortable.element,h=i.sortable.element;if(!h||!f)return;if(!s&&i.id===o.sortable.group)return;const m=jq(l),g=s?m:jq(u),v=null!=(c=o.sortable.group)?c:Tq,y=null!=(d=i.sortable.group)?d:Tq,b={[v]:m,[y]:g},x=qq(b,e);if(b===x)return;const S=x[y].indexOf(o.sortable),w=x[y].indexOf(i.sortable);r.collisionObserver.disable(),Nq(f,S,h,w),cE(()=>{for(const[e,t]of x[v].entries())t.index=e;if(!s)for(const[e,t]of x[y].entries())t.group=i.sortable.group,t.index=e}),r.actions.setDropTarget(o.id).then(()=>r.collisionObserver.enable())})})}),e.monitor.addEventListener("dragend",(e,r)=>{if(!e.canceled)return;const{dragOperation:n}=r,{source:o}=n;Sq(o)&&(o.sortable.initialIndex===o.sortable.index&&o.sortable.initialGroup===o.sortable.group||queueMicrotask(()=>{const e=t(),n=e.get(o.sortable.initialGroup);n&&r.renderer.rendering.then(()=>{for(const[t,r]of e.entries()){const e=Array.from(r).entries();for(const[r,n]of e)if(n.index!==r||n.group!==t)return}const t=jq(n),r=o.sortable.element,i=t[o.sortable.initialIndex],a=null==i?void 0:i.element;i&&a&&r&&(Nq(r,i.index,a,o.index),cE(()=>{for(const[t,r]of e.entries()){const e=Array.from(r).values();for(const t of e)t.index=t.initialIndex,t.group=t.initialGroup}}))})}))})];this.destroy=()=>{for(const e of r)e()}}}],Yq={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1},Kq=new class{constructor(){bI(this,RI,new WeakMap)}get(e,t){var r;return e?null==(r=yI(this,RI).get(e))?void 0:r.get(t):void 0}set(e,t,r){var n;if(e)return yI(this,RI).has(e)||yI(this,RI).set(e,new Map),null==(n=yI(this,RI).get(e))?void 0:n.set(t,r)}clear(e){var t;return e?null==(t=yI(this,RI).get(e))?void 0:t.clear():void 0}};zq=[EI],Fq=[EI];var Xq=class{constructor(e,t){bq(this,$q,mq(Wq,8,this)),mq(Wq,11,this),bq(this,Hq),bq(this,Vq),bq(this,Bq,mq(Wq,12,this)),mq(Wq,15,this),bq(this,Gq),this.register=()=>(cE(()=>{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=()=>{cE(()=>{var e,t;null==(e=this.manager)||e.registry.unregister(this.droppable),null==(t=this.manager)||t.registry.unregister(this.draggable)})},this.destroy=()=>{cE(()=>{this.droppable.destroy(),this.draggable.destroy()})};var r=e,{effects:n=()=>[],group:o,index:i,sensors:a,type:s,transition:l=Yq,plugins:u=Uq}=r,c=((e,t)=>{var r={};for(var n in e)aq.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&iq)for(var n of iq(e))t.indexOf(n)<0&&sq.call(e,n)&&(r[n]=e[n]);return r})(r,["effects","group","index","sensors","type","transition","plugins"]);this.droppable=new Zq(c,t,this),this.draggable=new Jq(dq(cq({},c),{effects:()=>[()=>{var e,t,r;const n=null==(e=this.manager)?void 0:e.dragOperation.status;(null==n?void 0:n.initializing)&&this.id===(null==(r=null==(t=this.manager)?void 0:t.dragOperation.source)?void 0:r.id)&&Kq.clear(this.manager),(null==n?void 0:n.dragging)&&Kq.set(this.manager,this.id,pE(()=>({initialIndex:this.index,initialGroup:this.group})))},()=>{const{index:e,group:t,manager:r}=this,n=yq(this,Vq),o=yq(this,Hq);e===n&&t===o||(xq(this,Vq,e),xq(this,Hq,t),this.animate())},()=>{const{target:e}=this,{feedback:t,isDragSource:r}=this.draggable;"move"==t&&r&&(this.droppable.disabled=!e)},()=>{const{manager:e}=this;for(const t of u)null==e||e.registry.register(t)},...n()],type:s,sensors:a}),t,this),xq(this,Gq,c.element),this.manager=t,this.index=i,xq(this,Vq,i),this.group=o,xq(this,Hq,o),this.type=s,this.transition=l}get initialIndex(){var e,t;return null!=(t=null==(e=Kq.get(this.manager,this.id))?void 0:e.initialIndex)?t:this.index}get initialGroup(){var e,t;return null!=(t=null==(e=Kq.get(this.manager,this.id))?void 0:e.initialGroup)?t:this.group}animate(){pE(()=>{const{manager:e,transition:t}=this,{shape:r}=this.droppable;if(!e)return;const{idle:n}=e.dragOperation.status;r&&t&&(!n||t.idle)&&e.renderer.rendering.then(()=>{const{element:n}=this;if(!n)return;const o=this.refreshShape();if(!o)return;const i=r.boundingRectangle.left-o.boundingRectangle.left,a=r.boundingRectangle.top-o.boundingRectangle.top,{translate:s}=NM(n),l=XM(n,s,!1),u=XM(n,s);if(i||a){const r=YR(qR(n))?dq(cq({},t),{duration:0}):t;KM({element:n,keyframes:{translate:[`${l.x+i}px ${l.y+a}px ${l.z}`,`${u.x}px ${u.y}px ${u.z}`]},options:r}).then(()=>{e.dragOperation.status.dragging||(this.droppable.shape=void 0)})}})})}get manager(){return this.draggable.manager}set manager(e){cE(()=>{this.draggable.manager=e,this.droppable.manager=e})}set element(e){cE(()=>{const t=yq(this,Gq),r=this.droppable.element,n=this.draggable.element;r&&r!==t||(this.droppable.element=e),n&&n!==t||(this.draggable.element=e),xq(this,Gq,e)})}get element(){var e,t;const r=yq(this,Gq);if(r)return null!=(t=null!=(e=ZR.get(r))?e:r)?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){cE(()=>{this.droppable.disabled=e,this.draggable.disabled=e})}set data(e){cE(()=>{this.droppable.data=e,this.draggable.data=e})}set handle(e){this.draggable.handle=e}set id(e){cE(()=>{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:lL}set alignment(e){this.draggable.alignment=e}get alignment(){return this.draggable.alignment}set type(e){cE(()=>{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)}};Wq=[,,,eq(null)],$q=new WeakMap,Hq=new WeakMap,Vq=new WeakMap,Bq=new WeakMap,Gq=new WeakMap,gq(Wq,4,"index",zq,Xq,$q),gq(Wq,4,"group",Fq,Xq,Bq),((e,t)=>{return uq(t,(r="metadata",(n=Symbol[r])?n:Symbol.for("Symbol."+r)),e[3]);var r,n})(Wq,Xq);var Jq=class extends zk{constructor(e,t,r){super(e,t),this.sortable=r}get index(){return this.sortable.index}get initialIndex(){return this.sortable.initialIndex}get group(){return this.sortable.group}get initialGroup(){return this.sortable.initialGroup}},Zq=class extends Wk{constructor(e,t,r){super(e,t),this.sortable=r}get index(){return this.sortable.index}get group(){return this.sortable.group}},Qq=Object.defineProperty,eT=Object.defineProperties,tT=Object.getOwnPropertyDescriptors,rT=Object.getOwnPropertySymbols,nT=Object.prototype.hasOwnProperty,oT=Object.prototype.propertyIsEnumerable,iT=(e,t,r)=>t in e?Qq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,aT=(e,t)=>{for(var r in t||(t={}))nT.call(t,r)&&iT(e,r,t[r]);if(rT)for(var r of rT(t))oT.call(t,r)&&iT(e,r,t[r]);return e};function sT(e){const{accept:t,collisionDetector:r,collisionPriority:n,id:o,data:i,element:a,handle:s,index:l,group:u,disabled:c,feedback:d,modifiers:p,sensors:h,target:m,type:g}=e,v=aT(aT({},Yq),e.transition),y=cO(t=>new Xq(((e,t)=>eT(e,tT(t)))(aT({},e),{transition:v,register:!1,handle:$k(s),element:$k(a),target:$k(m),feedback:d}),t)),b=Gk(y,lT);return Kk(o,()=>y.id=o),Hk(()=>{cE(()=>{y.group=u,y.index=l})},[y,u,l]),Kk(g,()=>y.type=g),Kk(t,()=>y.accept=t,void 0,CI),Kk(i,()=>i&&(y.data=i)),Kk(l,()=>{var e;(null==(e=y.manager)?void 0:e.dragOperation.status.idle)&&(null==v?void 0:v.idle)&&y.refreshShape()},Uk),Xk(s,e=>y.handle=e),Xk(a,e=>y.element=e),Xk(m,e=>y.target=e),Kk(c,()=>y.disabled=!0===c),Kk(h,()=>y.sensors=h),Kk(r,()=>y.collisionDetector=r),Kk(n,()=>y.collisionPriority=n),Kk(d,()=>y.feedback=null!=d?d:"default"),Kk(v,()=>y.transition=v,void 0,CI),Kk(p,()=>y.modifiers=p,void 0,CI),Kk(e.alignment,()=>y.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:f(e=>{y.handle=null!=e?e:void 0},[y]),ref:f(e=>{var t,r;(e||!(null==(t=y.element)?void 0:t.isConnected)||(null==(r=y.manager)?void 0:r.dragOperation.status.idle))&&(y.element=null!=e?e:void 0)},[y]),sourceRef:f(e=>{var t,r;(e||!(null==(t=y.source)?void 0:t.isConnected)||(null==(r=y.manager)?void 0:r.dragOperation.status.idle))&&(y.source=null!=e?e:void 0)},[y]),targetRef:f(e=>{var t,r;(e||!(null==(t=y.target)?void 0:t.isConnected)||(null==(r=y.manager)?void 0:r.dragOperation.status.idle))&&(y.target=null!=e?e:void 0)},[y])}}function lT(e,t,r){return!("isDragSource"!==e||r||!t)}const uT=({id:e,itemIndex:t,sectionIndex:r})=>ii.jsx("div",{children:`${r}:${t} - ${e}`}),cT=({id:e,itemIndex:t,sectionIndex:r})=>{const n=Pw(eE),o=Pw(JC),i=Pw(GC).at(r)??0,a=Pw(UC)({sectionIndex:r}),{ref:s,isDragging:l}=sT({id:e,index:t,type:"item",accept:"item",group:a,modifiers:[ZO],plugins:[wq],data:{id:e,sectionIndex:r,sectionKey:a,itemIndex:t}}),u=void 0!==n?()=>{n({id:e,itemIndex:t,sectionIndex:r})}:void 0,c=o??uT;return ii.jsx(Nd,{"data-testid":"section-item",onClick:u,ref:s,"data-dragging":l,sx:{padding:0,backgroundColor:l?"rgba(242, 242, 242, 1)":void 0,borderRadius:l?"4px":void 0},children:ii.jsxs("div",{style:{width:"100%",opacity:l?.4:1},children:[ii.jsx(_O,{isDragging:l,itemIndex:t,sectionIndex:r}),ii.jsx(c,{id:e,itemIndex:t,sectionIndex:r}),t===i-1&&ii.jsx(_O,{isDragging:l,itemIndex:t+1,sectionIndex:r})]})})},dT=r.memo(cT),pT=r.memo(({sectionIndex:e})=>{const t=Pw(UC),r=Pw(GC).at(e)??0,n=t({sectionIndex:e});return ii.jsxs(Qu,{className:"exploration-list",style:{overflow:"auto"},children:[ii.jsx(Uc,{}),ii.jsx(zO,{id:n,sectionIndex:e}),ii.jsx(Uc,{}),ii.jsx(FO,{sectionIndex:e}),ii.jsx(Ed,{sx:{padding:"2px 8px"},children:qO(r).map(r=>{const n=t({sectionIndex:e,itemIndex:r});return ii.jsx(dT,{id:n,itemIndex:r,sectionIndex:e},n)})})]},n)}),fT=r.memo(()=>{const e=Pw(BC),t=Pw(UC),r=Rw(oE("start")),n=Rw(oE("over")),o=Rw(oE("end"));return ii.jsxs(lO,{onDragEnd:o,onDragOver:n,onDragStart:r,children:[ii.jsx(Qu,{style:{display:"flex",flexDirection:"column"},children:qO(e).map(e=>ii.jsx(pT,{sectionIndex:e},t({sectionIndex:e})))}),ii.jsx(NO,{})]})}),hT=r.memo(e=>ii.jsx(MC,{atoms:iE,atomFamilies:aE,children:ii.jsx(sE,{props:e,children:ii.jsx(fT,{})})})),mT="12px",gT="nebula-table-utils-head-menu-button",vT="sn-copy-cell";let yT=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 bT="nebula-table-utils-column-adjuster";let xT=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}({}),ST=function(e){return e.Auto="auto",e.FitToContent="fitToContent",e.Pixels="pixels",e.Percentage="percentage",e}({});const wT={darker:.15,brighter:.3,opacity:.03},CT={darker:.3,brighter:.5,opacity:.05};let ET=function(e){return e.Cyclic="C",e}({});const IT=(e,t)=>{const r=new Map;for(const t of e)r.set(t.id,t);return t.reduce((e,t)=>{const n=r.get(t);return n&&e.push(n),e},[])},DT=$C(e=>mw(t=>{const r=t(tC),n=t(Hw),o=t(Zw)?.[e],i=r?.qHyperCube.rankedList?.[e];return o||(n?.isRankedListCorrupt(e)||void 0===i?n?.createRankedList(e):i)})),PT=(e,t=new Set)=>mw(r=>{const n=r(e),o=r(mC);if(!n||0===n.length)return"disabled";const i=n.filter(e=>!t.has(e.id));if(0===i.length)return"disabled";const a=i.filter(e=>o.has(e.id)).length;return 0===a?"none":a===i.length?"all":"some"}),RT=(e,t=new Set)=>mw(null,(r,n,o)=>{const i=r(e);i&&0!==i.length&&(e=>{const{items:t,shouldCheckAll:r,get:n,set:o,excludedIds:i}=e,a=t.filter(e=>!i?.has(e.id));if(0===a.length)return;const s=n(mC),l=new Set,u=new Set;if(a.forEach(e=>{const t=s.has(e.id);t&&!r&&u.add(e.id),!t&&r&&l.add(e.id)}),0===l.size&&0===u.size)return;const c=new Set(n(dC)),d=new Set(n(pC));l.forEach(e=>c.add(e)),l.forEach(e=>d.delete(e)),u.forEach(e=>d.add(e)),u.forEach(e=>c.delete(e)),o(dC,c),o(pC,d),Ww({type:"apply",localChecked:l,localUnchecked:u,handler:n(Hw),model:n($w),fieldInfo:n(aC),handlerQueue:n(lC)})})({items:i,shouldCheckAll:o,get:r,set:n,excludedIds:t})}),MT=mw(e=>{const t=e(rC);return t?.qHyperCube.qDimensionInfo.filter(Yw).map(({cId:e,qFallbackTitle:t})=>({id:e,title:t,alternative:!0}))}),LT=mw(e=>{const t=e(tC),r=e(Bw),n=t?.qHyperCube.qEffectiveInterColumnSortOrder.map(e=>{if(-1===e)return{id:-1,title:r("Common.Values")};const{cId:n,qFallbackTitle:o}=t.qHyperCube.qDimensionInfo[e];return{id:n,title:o}});return n}),AT=mw(e=>{const t=e(Bw),r=e(MT),n=e(Uw),o=e(DT("columns")),i=e(DT("rows")),a=e(LT);if(void 0===r||void 0===o||void 0===i||void 0===a)return[];const s=[...a,...r].filter(n);return[{id:"rows",title:t("Common.Rows"),items:IT(s,i)},{id:"columns",title:t("Common.Columns"),items:IT(s,o)}]}),kT=$C(e=>mw(t=>t(AT).at(e))),OT=$C(({sectionIndex:e,itemIndex:t})=>mw(r=>r(kT(e))?.items.at(t)?.title),(e,t)=>e.sectionIndex===t.sectionIndex&&e.itemIndex===t.itemIndex),qT=$C(e=>mw(t=>t(kT(e))?.title)),TT=mw(e=>({sectionIndex:t,itemIndex:r})=>{const n=e(kT(t));return void 0===n?0===t?"rows":"columns":void 0===r?n.id:n.items.at(r)?.id??`missing-item-${t}-${r}`}),NT=mw(e=>e(AT).map(e=>e.items.length)),_T=$C(e=>PT(mw(t=>t(kT(e))?.items),new Set([-1]))),jT=$C(e=>RT(mw(t=>t(kT(e))?.items),new Set([-1]))),FT=mw(null,async(e,t,{event:r,id:n,toIndex:o,toSection:i,startSection:a})=>{const s=e(Hw),l=e($w),u=e(lC),c=e(DT("rows")),d=e(DT("columns")),p=i;if(void 0===s||void 0===l||void 0===c||void 0===d||null===u)return;if(r.operation.canceled)return void t(Zw,null);if("section"===r.operation.target?.type&&a===i)return void t(Zw,null);const f=WC({rows:c,columns:d},r);t(Zw,f),u.add(async()=>{"number"==typeof n?await s.movePseudoDimension({toIndex:o,toSection:p}):await s.moveDimension({cId:n,toIndex:o,toSection:p})})}),zT={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"}},WT="ChartExploration.PivotTable.DimensionSectionEmpty.Message",$T="ChartExploration.PivotTable.MeasureSectionEmpty.Message",HT="#177fe6",VT=(e,t,r,n)=>{if("measure"===t)return e(n?zT.noSearchFound.measure:zT.noItems.measure);const o=n?zT.noSearchFound:zT.noItems;return e(r?o.row:o.column)},BT=(e,t,r)=>r?"":e("measure"===t?$T:WT),GT=$C(e=>mw(t=>{const r=t(Bw),n=t(Gw).length>0;return t=>({title:VT(r,e,0===t,n),message:BT(r,e,n)})})),UT=GT("measure"),YT=GT("dimensions"),KT=({children:e})=>ii.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),XT=e=>{const t=Pw(OT(e));return ii.jsx(KT,{children:t})},JT=mw(e=>{const t=e(rC);return t?.qHyperCube.qMeasureInfo.filter(Yw).map(({cId:e,qFallbackTitle:t})=>({id:e,title:t}))}),ZT=mw(e=>{const t=e(tC),r=e(JT),n=e(Uw),o=e(DT("measures"));if(void 0===t||void 0===r||void 0===o)return[];const i=t.qHyperCube.qMeasureInfo.filter(Yw).map(({cId:e,qFallbackTitle:t})=>({id:e,title:t}));i.push(...r);const a=i.filter(n);return IT(a,o)}),QT=$C(e=>mw(t=>t(ZT).at(e)?.title??"")),eN=mw(e=>({itemIndex:t})=>{const r=e(ZT);return void 0===t?"measures":r.at(t)?.id??`missing-item-${t}`}),tN=mw(e=>[e(ZT).length]),rN=PT(ZT),nN=RT(ZT),oN=mw(null,async(e,t,{id:r,toIndex:n,event:o})=>{const i=e(Hw),a=e($w),s=e(lC),l=e(DT("measures"));if(void 0===i||void 0===a||void 0===l||"string"!=typeof r||null===s)return;const u=WC({measures:l},o);t(Zw,u),s.add(async()=>{await i.moveMeasure({cId:r,toIndex:n})})}),iN=e=>"svg"===e.tagName?"exploration-draggable-icon":e.className,aN=e=>{const t=e.closest(".exploration-list"),r=t?.nextElementSibling||t?.parentElement?.nextElementSibling;return null!==r&&r?r.getElementsByClassName("exploration-section-header")[0]:t?.closest(".exploration-panel")?.getElementsByClassName("exploration-section-header")[0]},sN=e=>{const{currentTarget:t}=e,r=iN(t);let n=t.closest("li")?.previousElementSibling?.getElementsByClassName(r)[0];if(!n){const e=t.closest(".exploration-list"),o=e?.querySelector(".exploration-section-header");if(o)return o;if(n=((e,t)=>{const r=e.closest(".exploration-list"),n=r?.previousElementSibling;if(null===n||!n)return e.closest(".exploration-panel")?.getElementsByClassName(t)[1];const o=n.getElementsByClassName(t);return o.length>0?o[o.length-1]:void 0})(t,r),!n){const e=t.closest(".exploration-panel")?.getElementsByClassName(r)[1];return e??null}}return n},lN=e=>{(e instanceof HTMLElement||e instanceof SVGElement)&&e.focus()},uN=e=>{const t=e.key===yT.Down?(e=>{const{currentTarget:t}=e,r=iN(t),n=t.closest("li");let o=n?.nextElementSibling?.getElementsByClassName(r)[0];return o||(o=aN(t),o)?o:t.closest(".exploration-panel")?.getElementsByClassName(r)[0]})(e):sN(e);t&&lN(t)},cN=(e,t)=>{const{key:r}=e;switch(r){case yT.Tab:e.preventDefault(),e.shiftKey?((e,t)=>{const{currentTarget:r}=e,n=r.closest("ul")?.getElementsByClassName("exploration-item-focus");if(r===t.items.draggableIconRef.current){if(t.itemIndex>=0){const e=n&&n[t.itemIndex];return void(e&&lN(e))}const r=sN(e);r&&lN(r)}if(r===t.items.explorationItemFocusRef.current){const t=r.closest("li")?.previousElementSibling?.getElementsByClassName("exploration-draggable-icon")[0];if(t)return void lN(t);const n=sN(e);n&&lN(n)}})(e,t):((e,t)=>{const{currentTarget:r}=e;if(!e.shiftKey){if(r===t.items.explorationItemFocusRef.current){const e=r.closest("li")?.getElementsByClassName("exploration-draggable-icon")[0];return void(e&&lN(e))}if(r===t.items.draggableIconRef.current){const e=r.closest("ul")?.getElementsByClassName("exploration-item-focus");if((e?.length||0)-1>t.itemIndex){const r=e&&e[t.itemIndex+1];return void(r&&lN(r))}const n=aN(r);n&&lN(n)}}})(e,t);break;case yT.Down:case yT.Up:e.preventDefault(),e.stopPropagation(),uN(e);break;case yT.Enter:case yT.Space:e.preventDefault(),e.stopPropagation(),((e,t)=>{const{currentTarget:r}=e;if(r===t.items.draggableIconRef.current){const e=r.closest("li")?.getElementsByClassName("exploration-item")[0];return void(e&&lN(e))}if(r===t.items.explorationItemRef.current){const e=r.getElementsByClassName("exploration-draggable-icon")[0];return void lN(e)}r===t.items.explorationItemFocusRef.current&&t.toggleCheckedById(t.id)})(e,t)}},dN=(e,t)=>{const{key:r,currentTarget:n}=e;if(n===t.current&&r===yT.Tab)if(e.preventDefault(),e.shiftKey)((e,t)=>{const{currentTarget:r}=e;if(r!==t.current)return;const n=r.closest('[role="region"]')?.getElementsByTagName("button")[0];n&&lN(n)})(e,t);else{const e=n.parentElement?.getElementsByClassName("exploration-section-header")[0];e&&lN(e)}},pN=(e,t)=>{const{currentTarget:r}=e;if(r!==t.ref.current)return;const n=t.sectionIndex??2;if(0===n)return void((e,t)=>{const{currentTarget:r}=e;if(r!==t.ref.current)return;const n=r.closest(".exploration-panel")?.getElementsByTagName("input")[0];n&&lN(n)})(e,t);const o=r.closest(".exploration-panel")?.getElementsByClassName("exploration-list")[n-1],i=o?.getElementsByClassName("exploration-item-focus").length??0;if(i>0){const e=o?.getElementsByClassName("exploration-draggable-icon")[i-1];e&&lN(e)}},fN=(e,t)=>{const{key:r}=e;switch(r){case yT.Tab:e.preventDefault(),e.stopPropagation(),e.shiftKey?pN(e,t):((e,t)=>{const{currentTarget:r}=e;if(r!==t.ref.current)return;const n=r.closest(".exploration-list"),o=n?.getElementsByClassName("exploration-item-focus")[0];o&&lN(o)})(e,t);break;case yT.Down:e.preventDefault(),((e,t)=>{const{currentTarget:r}=e;if(r!==t.ref.current)return;const n=r.closest(".exploration-panel"),o=n?.getElementsByClassName("exploration-section-header").length??0;let i=null;if(0===o)return;const a=t.sectionIndex??2;i=a+1<o?n?.getElementsByClassName("exploration-section-header")[a+1]:n?.getElementsByClassName("exploration-section-header")[0],i&&lN(i)})(e,t);break;case yT.Up:e.preventDefault(),((e,t)=>{const{currentTarget:r}=e;if(r!==t.ref.current)return;const n=r.closest(".exploration-panel"),o=n?.getElementsByClassName("exploration-section-header").length??0;let i=null;if(0===o)return;const a=t.sectionIndex??2;i=a-1>=0?n?.getElementsByClassName("exploration-section-header")[a-1]:n?.getElementsByClassName("exploration-section-header")[o-1],i&&lN(i)})(e,t);break;case yT.Enter:case yT.Space:e.preventDefault(),((e,t)=>{const{currentTarget:r}=e;if(e.preventDefault(),r!==t.ref.current)return;const n="all"!==t.checkState;t.toggleAllCheckboxes(n)})(e,t)}},hN=({children:e})=>ii.jsx("span",{style:{width:"fit-content",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontWeight:"bold"},children:e}),mN=({children:e,sectionIndex:t})=>{const n=Pw(void 0!==t?_T(t):rN),o=Rw(void 0!==t?jT(t):nN),i=r.useRef(null),a={ref:i,toggleAllCheckboxes:o,checkState:n,sectionIndex:t};return ii.jsxs(Qu,{ref:i,className:"exploration-section-header",tabIndex:0,onKeyDown:e=>{fN(e,a)},sx:{display:"flex",alignItems:"center",width:"100%",padding:"2px 8px 2px 8px",boxSizing:"border-box",fontSize:"12px","&:focus-visible":{boxShadow:`0 0 0 2px ${HT} inset`}},children:[ii.jsx(Ic,{disabled:"disabled"===n,checked:"all"===n,indeterminate:"some"===n,onChange:e=>{o(e.target.checked)},size:"small",style:{flexShrink:0,padding:9}}),ii.jsx(hN,{children:e})]})},gN=({sectionIndex:e})=>{const t=Pw(qT(e));return ii.jsx(mN,{sectionIndex:e,children:t})},vN=x((e,t)=>ii.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:ii.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"})})),yN=x((e,t)=>ii.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:ii.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"})})),bN=fl("div")({position:"absolute",width:"1px",height:"1px",padding:0,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}),xN=fl(yN)(()=>({padding:"6px 6px",flexShrink:0,cursor:"grab","&:focus-visible":{boxShadow:`0 0 0 2px ${HT} inset`}})),SN=({children:e})=>ii.jsx("span",{style:{width:"fit-content",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,paddingLeft:4},children:e}),wN=({icon:e,title:t,...n})=>{const[o,i]=Mw(mC),a=Pw(Bw),s=r.useRef(null),l=r.useRef(null),u=r.useRef(null),c={id:n.id,itemIndex:n.itemIndex,toggleCheckedById:i,items:{explorationItemRef:s,explorationItemFocusRef:l,draggableIconRef:u}};return ii.jsxs(Qu,{ref:s,className:"exploration-item",onClick:e=>{e.stopPropagation(),i(n.id)},onKeyDown:e=>{cN(e,c)},tabIndex:0,style:{display:"flex",alignItems:"center",width:"100%",cursor:"pointer",padding:0,boxSizing:"border-box",fontSize:"12px"},title:t,sx:{"&:hover":{backgroundColor:"action.hover"},"&:focus-visible":{boxShadow:`0 0 0 2px ${HT} inset`}},children:[ii.jsxs(Qu,{ref:l,className:"exploration-item-focus",component:"div",tabIndex:0,onKeyDownCapture:e=>{cN(e,c)},sx:{display:"flex",minWidth:0,alignItems:"center",justifyContent:"space-between",flexGrow:1,marginRight:"4px","&:focus-visible":{boxShadow:`0 0 0 2px ${HT} inset`}},children:[ii.jsx(Ic,{checked:o.has(n.id),"aria-label":a("ChartExploration.ListItem.Label",t),size:"small",tabIndex:-1,style:{padding:9,flexShrink:0,visibility:-1===n.id?"hidden":"visible"}}),ii.jsx(e,{height:"12px",style:{flexShrink:0}}),ii.jsx(SN,{children:t})]}),ii.jsx(xN,{ref:u,className:"exploration-draggable-icon",tabIndex:0,height:"16px",onClick:e=>{e.stopPropagation()},onKeyDownCapture:e=>{cN(e,c)}})]})},CN=e=>{const t=Pw(OT(e))??"";return ii.jsx(wN,{title:t,icon:vN,...e})},EN=()=>{const e=Pw(TT),t=Pw(NT),r=Pw(YT),n=Rw(FT);return ii.jsx(hT,{numberOfSections:2,numberOfItemsInSection:t,keyExtractor:e,emptyTexts:r,onDragEnd:n,dragOverlayRenderer:XT,headerRenderer:gN,itemRenderer:CN})},IN=({itemIndex:e})=>{const t=Pw(QT(e));return ii.jsx(KT,{children:t})},DN=()=>{const e=Pw(Bw);return ii.jsx(mN,{children:e("Common.Values")})},PN=x((e,t)=>ii.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:[ii.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"}),ii.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"})]})),RN=e=>{const{itemIndex:t}=e,r=Pw(QT(t));return ii.jsx(wN,{title:r,icon:PN,...e})},MN=()=>{const e=Pw(eN),t=Pw(tN),r=Pw(UT),n=Rw(oN);return ii.jsx(Qu,{className:"exploration-header-section",style:{height:"100%",display:"flex",flexDirection:"column-reverse"},children:ii.jsx(hT,{numberOfSections:1,numberOfItemsInSection:t,keyExtractor:e,emptyTexts:r,onDragEnd:n,dragOverlayRenderer:IN,headerRenderer:DN,itemRenderer:RN})})},LN=x((e,t)=>ii.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:ii.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"})})),AN=()=>{const[e,t]=Mw(Gw),n=Pw(Bw),o=r.useRef(null),[i]=Pw(tN),[a=0,s=0]=Pw(NT),l=f(e=>{t(e.target.value)},[t]),u=0===e.length||0===a&&0===s&&0===i?n("Common.Search.NoResultsAvailable"):n("ChartExploration.Pivot.Search.ResultsFound",a.toString(),s.toString(),i.toString());return ii.jsxs(Qu,{ref:o,onKeyDown:e=>{dN(e,o)},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:[ii.jsx(bN,{"data-testid":"screenOnly-search-results","aria-live":"polite","aria-atomic":"true",children:u}),ii.jsx(Np,{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:l,startAdornment:ii.jsx(pd,{position:"start",children:ii.jsx(LN,{})}),inputProps:{style:{fontSize:"14px",paddingTop:6,paddingBottom:6}}})]})},kN=e=>{const t=((e="light",t=!1)=>Ls(If(0,t)))();return ii.jsx(ml,{theme:t,children:ii.jsx(Sw,{children:ii.jsx(gC,{props:e,children:ii.jsxs(Qu,{className:"exploration-panel",style:{display:"flex",flexDirection:"column"},children:[ii.jsx(AN,{}),ii.jsx(EN,{}),ii.jsx(MN,{})]})})})})},ON=e=>{if(e.flags.isEnabled("CLIENT_IM_5973_PIVOT_TABLE_EXPLORATION"))return{component:kN,classification:{tags:["exploration"],exclusive:!0}}};var qN=function(e){return e.CONTAINS="contains",e.MATCHES_EXACTLY="matches_exactly",e.STARTS_WITH="starts_with",e.ENDS_WITH="ends_with",e.BEGINNING_OF_WORD="beginning_of_word",e}(qN||{}),TN=function(e){return e.COMPARE="compare",e.GENERAL="general",e}(TN||{}),NN=function(e){return e.VALUES="values",e.CONDITION="condition",e.SEARCH="search",e.CLEAR_SELECTION="clear_selection",e.TOP_BOTTOM="top_bottom",e}(NN||{}),_N=function(e){return e.FIXED_VALUE="fixed_value",e.CALCULATED_VALUE="calculated_value",e}(_N||{});const jN=e=>e&&"]"!==e?/^[A-Za-z][A-Za-z0-9_]*$/.test(e)||(e=>{if(!e)return!1;if("["===e[0]&&"]"===e[e.length-1]){let t=e.substring(1,e.length-1);if(/^[A-Za-z][A-Za-z0-9_]*$/.test(t))return!0;if(t=t.replace(/\]\]/g,"]"),e===`[${t.replace(/\]/g,"]]")}]`)return!0}return!1})(e)?e:`[${e.replace(/\]/g,"]]")}]`:e,FN=e=>{if(!Array.isArray(e))return"";let t="{<";const r=[];if(e.forEach(e=>{let t=`[${e.field}]${e.exclude?"-":""}={`,n="}",o="";switch(e.type){case NN.SEARCH:o=(e=>{let t="",r="";const n=e.options?.mode;if(!n)return"";switch(n){case qN.BEGINNING_OF_WORD:t="*^",r="*";break;case qN.ENDS_WITH:t="*";break;case qN.STARTS_WITH:r="*";break;case qN.MATCHES_EXACTLY:break;case qN.CONTAINS:default:t="*",r="*"}const o=e.options.values?.[0]??"";return""!==o?`"${t}${o}${r}"`:""})(e);break;case NN.CONDITION:o=(e=>{const{options:t}=e,r=t?.mode===TN.GENERAL,n=t?.modifier?.type===_N.FIXED_VALUE,o=t?.modifier?.operator?t.modifier.operator.split(" "):[];if(0===o.length||!n&&(!t.firstValue?.aggregator||!t.firstValue?.field)||n&&!t.firstValue?.fixedValue||r&&(!t.conditionField?.aggregator||!t.conditionField?.field))return"";let i,a,s="=";r&&n?(i=`${t.conditionField?.aggregator}(${jN(t.conditionField?.field)})`,a=`${t.firstValue?.fixedValue}`):!r&&n?(i="",a=`${t.firstValue?.fixedValue}`,s=""):r||n?(i=`${t.conditionField?.aggregator}(${jN(t.conditionField?.field)})`,a=`${t.firstValue?.aggregator}(${jN(t.firstValue?.field)})`):(i=`${jN(e.field)}`,a=`${t.firstValue?.aggregator}(total ${jN(t.firstValue?.field)})`);const l=`${s}${i}${o[0]}${a}`;let u="";if(o.length>1){if(!n&&(!t.secondValue?.aggregator||!t.secondValue?.field)||n&&!t.secondValue?.fixedValue)return"";let e,a;r&&n?(e=`${t.secondValue?.fixedValue}`,a=` and ${i}`):!r&&n?(e=`${t.secondValue?.fixedValue}`,a=""):r||n?(e=`${t.secondValue?.aggregator}(${jN(t.secondValue?.field)})`,a=` and ${i}`):(e=`${t.secondValue?.aggregator}(total ${jN(t.secondValue?.field)})`,a=` and ${i}`),u=`${a}${o[1]}${e}`}return`"${l}${u}"`})(e);break;case NN.CLEAR_SELECTION:o=`[${e.field}]=`,t="",n="";break;case NN.VALUES:default:o=e.options?.values?e.options.values.map(e=>`'${e.replace(/'/g,"''")}'`).join(","):""}""!==o&&r.push(`${t}${o}${n}`)}),0===r.length)return;return t+=`${r.join(",")}>}`,t},zN=[];for(let e=0;e<256;++e)zN.push((e+256).toString(16).slice(1));let WN;const $N=new Uint8Array(16);var HN={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function VN(e,t,r){const n=(e=e||{}).random??e.rng?.()??function(){if(!WN){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");WN=crypto.getRandomValues.bind(crypto)}return WN($N)}();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(e,t=0){return(zN[e[t+0]]+zN[e[t+1]]+zN[e[t+2]]+zN[e[t+3]]+"-"+zN[e[t+4]]+zN[e[t+5]]+"-"+zN[e[t+6]]+zN[e[t+7]]+"-"+zN[e[t+8]]+zN[e[t+9]]+"-"+zN[e[t+10]]+zN[e[t+11]]+zN[e[t+12]]+zN[e[t+13]]+zN[e[t+14]]+zN[e[t+15]]).toLowerCase()}(n)}const BN=()=>crypto?.randomUUID?.()??function(e){return HN.randomUUID&&!e?HN.randomUUID():VN(e)}(),GN=1e3,UN=1e3,YN=e=>{if(0===e.qInterColumnSortOrder.length)return;const t=e.qDimensions,r=((e,t)=>{const r=new Set;for(const t of e){if(r.has(t))return!0;r.add(t)}const n=e.includes(-1),o=e.filter(e=>-1!==e);if(t){const r=n?t.length+1:t.length;if(e.length!==r)return!0}const i=[...o].sort((e,t)=>e-t);for(let e=0;e<i.length;e++)if(i[e]!==e)return!0;return!1})(e.qInterColumnSortOrder,t);r&&(e.qInterColumnSortOrder=((e,t)=>{const r=[];if(t)for(let e=0;e<t.length;e++)r.push(e);return e.qMeasures.length>=2&&r.push(-1),r})(e,t))},KN=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]},XN=e=>{if(!e)return;YN(e);const t=e.qDimensions,{qInterColumnSortOrder:r}=e;((e,t=[])=>{const r=t.filter(e=>-1!==e);for(let n=0;n<r.length;n++)if(-1!==r[n]&&r[n]!==n){const o=r[n],i=r.indexOf(n),a=r[i];KN(r,n,i),KN(e,n,i),KN(t,t.indexOf(o),t.indexOf(a))}})(t,r)},JN=P;class ZN extends JN{#u;constructor(e,t){super(e),this.path=e.path,this.#u=t}async addDimension(e,t,r,n){if(!e||this.#c(e))return;const o=t??!1;if(e.qDef.cId||(e.qDef.cId=BN()),n)return this.addAlternativeDimension(e,o,r);if(this.getDimensions().length<this.maxDimensions()){const t=await(async(e,t,r,n)=>{const o=e.getDimensions(),i=e.hcProperties.qNoOfLeftDims;return await e.autoSortDimension(t),XN(e.hcProperties),(-1===i||Number.isNaN(+i))&&(e.hcProperties.qNoOfLeftDims=o.length),r?((e,t,r,n)=>{if(!e)return;const{qInterColumnSortOrder:o,qNoOfLeftDims:i}=e,a=t.length,s=o.indexOf(-1),l=-1!==s,u=void 0!==n?n+(i||0):void 0;if(l&&void 0!==u&&s>=u?((e,t,r)=>{t.splice(r,1),t.push(e),t.splice(r+1,0,-1)})(a,o,s):o.push(a),void 0===n)t.push(r);else if(void 0!==u){const e=l&&u>s?u-1:u;t.splice(e,0,r)}})(e.hcProperties,o,t,n):((e,t,r,n)=>{if(!e||"number"!=typeof e.qNoOfLeftDims)return;const o=e.qNoOfLeftDims,{qInterColumnSortOrder:i}=e,a=t.length,s=i.indexOf(-1),l=-1!==s&&o>0&&s<o;if(i.push(a),l)void 0===n?t.splice(o-1,0,r):s<n?t.splice(n-1,0,r):(t.splice(n,0,r),i.splice(s,1),i.splice(s+1,0,-1));else{const e=n??o;t.splice(e,0,r),-1!==s&&(i.splice(s,1),i.splice(s+1,0,-1))}e.qNoOfLeftDims++})(e.hcProperties,o,t,n),t})(this,e,o,r);return this.#d({section:o?"columns":"rows",cId:e.qDef.cId,addLast:void 0===r}),t}}async addDimensions(e,t,r){const n=[];for await(const o of e){const e=await this.addDimension(o,r,void 0,t);e&&n.push(e)}return n}addAlternativeDimension(e,t,r){if(!e||this.#c(e))return;const n=this.getAlternativeDimensions();void 0===this.hcProperties.excludedNoOfLeftDims&&(this.hcProperties.excludedNoOfLeftDims=n.length);let o=r;return o=void 0===o?t?n.length:this.hcProperties.excludedNoOfLeftDims:t?this.hcProperties.excludedNoOfLeftDims+o:Math.min(o,this.hcProperties.excludedNoOfLeftDims),n.splice(o,0,e),t||this.hcProperties.excludedNoOfLeftDims++,this.#d({section:t?"columns":"rows",cId:e.qDef.cId,alternative:!0,addLast:void 0===r}),e}async addFieldDimension(e,t,r,n={}){const o=this.createFieldDimension(e,t,r);return this.addDimension(o,n.asColumn,void 0,!1)}async addFieldDimensions(e,t={}){const r=e.map(e=>this.createFieldDimension(e.field,e.label,e.defaults));return this.addDimensions(r,void 0,t.asColumn)}async addLibraryDimensions(e,t={}){const r=e.map(e=>this.createLibraryDimension(e.id,e.defaults));return this.addDimensions(r,void 0,t.asColumn)}reinsertDimension(e,t,r){e.qDef.cId||(e.qDef.cId=BN());if(this.getDimensions().length<this.maxDimensions())return this.addDimension(e,t,r);return this.reinsertAlternativeDimension(e,r,t)}reinsertAlternativeDimension(e,t,r){const n=this.getDimensions(),o=this.getAlternativeDimensions();if(n.length>=GN)return Promise.resolve();const i="number"==typeof t?t:o.length;return o.splice(i,0,e),this.#d({section:r?"columns":"rows",cId:e.qDef.cId,alternative:!0}),Promise.resolve(e)}async removeDimensions(e,t,r){return Promise.all([...e].reverse().map(e=>this.removeDimension(e,t,r)))}async removeDimension(e,t,r){if(t){const t=this.getAlternativeDimensions().splice(e,1)[0];return!r&&this.hcProperties.excludedNoOfLeftDims&&this.hcProperties.excludedNoOfLeftDims--,this.#p({cId:t.qDef.cId,section:r?"columns":"rows"}),t}const n=this.getDimensions(),o=this.properties.qHyperCubeDef.qNoOfLeftDims,i=this.hcProperties.qInterColumnSortOrder.indexOf(e);"number"==typeof this.properties.qHyperCubeDef.qNoOfLeftDims&&"number"==typeof i&&"number"==typeof o&&i+1<=o&&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=n.splice(e,1).at(0);if(s)return((e,t)=>{if(!e)return-1;const r=e.indexOf(t);if(-1===r)return-1;for(let r=0;r<e.length;++r)e[r]>t&&e[r]--;e.splice(r,1)})(this.hcProperties.qInterColumnSortOrder,e),XN(this.hcProperties),this.#p({cId:s.qDef.cId,section:r?"columns":"rows"}),s}#c(e){return!(!e||void 0===e.qDef.cId)&&[...this.getDimensions(),...this.getAlternativeDimensions()].some(t=>t.qDef.cId===e.qDef.cId)}async addMeasures(e,t=!1){const r=[];for await(const n of e){const e=await this.addMeasure(n,t,void 0,!0);e&&r.push(e)}return r}addAlternativeMeasures(e,t){if(this.#f(e))return;const r=this.getAlternativeMeasures(),n=void 0===t?r.length:t,o=r.splice(n,0,e);return this.#h({cId:e.qDef.cId,alternative:!0,addLast:void 0===t}),o}async addMeasure(e,t,r,n){if(this.#f(e))return;if(e.qDef.cId||(e.qDef.cId=BN()),t)return this.addAlternativeMeasures(e,r);n||delete e.qDef.qNumFormat;const o=this.getMeasures();if(o.length<this.maxMeasures()){const t=1===o.length;return void 0!==r&&r>=0?o.splice(r,0,e):o.push(e),this.autoSortMeasure(e).then(()=>(t&&(this.hcProperties.qInterColumnSortOrder.push(-1),0===this.getDimensions().length&&(this.hcProperties.qNoOfLeftDims=0)),this.#h({cId:e.qDef.cId,addLast:void 0===r}),e))}return o.length<UN?(this.getAlternativeMeasures().push(e),this.#h({cId:e.qDef.cId,alternative:!0,addLast:void 0===r}),Promise.resolve(e)):Promise.resolve()}reinsertMeasure(e,t){const r=this.getMeasures(),n=this.getAlternativeMeasures(),o=this.hcProperties.qInterColumnSortOrder;if(e.qDef.cId||(e.qDef.cId=BN()),t=void 0!==t?t:r.length,r.length<this.maxMeasures()){if(r.splice(t,0,e),2===r.length){-1===o.indexOf(-1)&&o.push(-1)}this.#h({cId:e.qDef.cId})}else r.length<UN&&(t=n.length,n.splice(t,0,e),this.#h({cId:e.qDef.cId}));return Promise.resolve(e)}async removeMeasure(e,t){if(t&&"number"==typeof e){const t=this.getAlternativeMeasures().splice(e,1)[0];return this.#p({cId:t.qDef.cId,section:"measures"}),t}const r=this.getMeasures();let n,o,i;if("number"==typeof e&&e<r.length){n=2===r.length,o=this.getMeasures().splice(e,1)[0];const t=this.hcProperties.qInterColumnSortOrder;n&&(i=t.indexOf(-1),t.splice(i,1),this.hcProperties.qNoOfLeftDims&&i+1<=this.hcProperties.qNoOfLeftDims&&this.hcProperties.qNoOfLeftDims--)}else"number"==typeof e&&(o=this.getAlternativeMeasures().splice(e-r.length,1)[0]);if(o)return this.#p({cId:o.qDef.cId,section:"measures"}),o}async removeMeasures(e,t){return await Promise.all([...e].reverse().map(e=>this.removeMeasure(e,t))),e}#f(e){return!(!e||void 0===e.qDef.cId)&&[...this.getMeasures(),...this.getAlternativeMeasures()].some(t=>t.qDef.cId===e.qDef.cId)}getSorting(){throw new Error("don't call this")}changeSorting(){throw new Error("don't call this")}setSorting(){throw new Error("don't call this")}getRowDimensions(){const e=this.#m("rows"),t=this.getDimensions();return e.filter(e=>e>=0).map(e=>t[e])}getColumnDimensions(){const e=this.#m("columns"),t=this.getDimensions();return e.filter(e=>e>=0).map(e=>t[e])}getAlternativeRowDimensions(){const e=this.getAlternativeDimensions(),{excludedNoOfLeftDims:t}=this.hcProperties;return-1===t?e:e.slice(0,t)}getAlternativeColumnDimensions(){const e=this.getAlternativeDimensions(),{excludedNoOfLeftDims:t}=this.hcProperties;return-1===t?[]:e.slice(t)}#g(e){const t=this.hcProperties.rankedList?.[e];return t||this.createRankedList(e)}#v(e){return[...this.#g(e)]}#y(e,t){return void 0===this.hcProperties.rankedList&&(this.hcProperties.rankedList={}),this.hcProperties.rankedList[e]=t,t}#b(e){const t=({qDef:t})=>t.cId===e;if(-1===e){return this.hcProperties.qInterColumnSortOrder.indexOf(-1)+1<=this.hcProperties.qNoOfLeftDims?"rows":"columns"}return this.getRowDimensions().some(t)||this.getAlternativeRowDimensions().some(t)?"rows":this.getColumnDimensions().some(t)||this.getAlternativeColumnDimensions().some(t)?"columns":null}#x(e){const t=({qDef:t})=>t.cId===e;return!(!this.getAlternativeDimensions().some(t)&&!this.getAlternativeMeasures().some(t))}#m(e){const{qInterColumnSortOrder:t,qNoOfLeftDims:r}=this.hcProperties;if(this.#S())return"columns"===e?t:[];switch(e){case"rows":return-1===r?t:t.slice(0,r);case"columns":return-1===r?[]:t.slice(r);default:throw new Error(`Unknown section in #getInterColumnSortOrderBySection: ${e}`)}}#S(){const{qNoOfLeftDims:e}=this.hcProperties,t=-1===e||Number.isNaN(+e);return 0===this.getDimensions().length&&this.getMeasures().length>0&&t}#w(e){const t=this.hcProperties.qInterColumnSortOrder.indexOf(-1);if(-1===t)return!1;if(this.#S())return"columns"===e;if(void 0===this.hcProperties.qNoOfLeftDims)return"rows"===e;switch(e){case"rows":return t+1<=this.hcProperties.qNoOfLeftDims;case"columns":return t+1>this.hcProperties.qNoOfLeftDims;default:return!1}}#C(e,t=!0){const r=e=>-1===e?-1:e.qDef.cId;if("measures"===e)return this.getMeasures().concat(t?this.getAlternativeMeasures():[]).map(r);const n=this.#m(e),o=this.getDimensions(),i=n.map(e=>-1===e?-1:o[e]);switch(e){case"rows":return i.concat(t?this.getAlternativeRowDimensions():[]).map(r);case"columns":return i.concat(t?this.getAlternativeColumnDimensions():[]).map(r);default:throw new Error(`Unknown section in #isCorruptRankedList: ${e}`)}}isRankedListCorrupt(e){const t=this.hcProperties.rankedList?.[e],r=this.properties.qInfo?.qId;if(!t)return!0;if(new Set(t).size!==t.length){const n=t.filter((e,r)=>t.indexOf(e)!==r);return console.warn("Corrupt ranked list detected: duplicate ids",{duplicates:n,section:e,chartId:r}),!0}const n=this.#C(e);if(t.length!==n.length)return console.warn("Corrupt ranked list detected: length mismatch",{section:e,chartId:r,fieldIds:n,rankedList:t,diff:new Set(n).symmetricDifference(new Set(t))}),!0;const o=n.filter(e=>!t.includes(e));if(o.length>0)return console.warn("Corrupt ranked list detected: missing ids",{missingIds:o,section:e,chartId:r}),!0;const i=this.#C(e,!1),a=t.filter(e=>i.includes(e)),s=i.filter((e,t)=>e!==a[t]);return s.length>0&&(console.warn("Corrupt ranked list detected: main field order mismatch",{section:e,chartId:r,orderMismatchIds:s}),!0)}createRankedList(e){switch(e){case"rows":case"columns":return this.#E({section:e});case"measures":return this.#I();default:throw new Error(`Unknown section in getRankedList: ${e}`)}}#E({section:e}){const t=this.getDimensions(),r=this.#m(e),n="columns"===e?this.getAlternativeColumnDimensions():this.getAlternativeRowDimensions(),o=r.map(e=>-1===e?-1:t[e].qDef.cId);return o.push(...n.map(e=>e.qDef.cId)),this.#y(e,o)}#I(){if(void 0!==this.hcProperties.rankedList?.measures)return this.hcProperties.rankedList.measures;const e=[...this.getMeasures(),...this.getAlternativeMeasures()].map(e=>e.qDef.cId);return this.#y("measures",e)}#D({section:e,cId:t,fields:r,addLast:n}){const o=this.#g(e),i=r.findIndex(e=>e.qDef.cId===t),a=r[i+1]?.qDef.cId,s=r[i-1]?.qDef.cId;if(n)o.push(t);else if(i>=0)if(a){const e=o.indexOf(a);o.splice(e,0,t)}else if(s){const e=o.indexOf(s);o.splice(e+1,0,t)}else o.push(t);return void 0===this.hcProperties.rankedList&&(this.hcProperties.rankedList={}),this.hcProperties.rankedList[e]}#d({section:e,cId:t,alternative:r=!1,addLast:n=!1}){if(void 0===this.hcProperties.rankedList?.[e])return this.#E({section:e});let o=[];return o="columns"===e?r?this.getAlternativeColumnDimensions():this.getColumnDimensions():r?this.getAlternativeRowDimensions():this.getRowDimensions(),this.#D({section:e,cId:t,fields:o,addLast:n})}#h({cId:e,alternative:t=!1,addLast:r=!1}){if(void 0===this.hcProperties.rankedList?.measures)return this.#I();const n=t?this.getAlternativeMeasures():this.getMeasures();return this.#P(),this.#D({section:"measures",cId:e,fields:n,addLast:r})}#P(){const e=this.#g("rows"),t=this.#g("columns");this.#w("rows")&&!e.includes(-1)?e.push(-1):this.#w("columns")&&!t.includes(-1)&&t.push(-1)}#R(){if(this.hcProperties.qInterColumnSortOrder.includes(-1))return;const e=this.#g("rows"),t=this.#g("columns"),r=e.indexOf(-1),n=t.indexOf(-1);-1!==r&&e.splice(r,1),-1!==n&&t.splice(n,1)}#p({cId:e,section:t}){const r=this.#g(t),n=r.indexOf(e);-1!==n&&(r.splice(n,1),this.#R())}async moveMeasureToAlternative(e){const t=this.getMeasures().findIndex(t=>t.qDef.cId===e),r=this.#v("measures"),n=r.indexOf(e);if(-1===t)return;const o=await this.removeMeasure(t);if(void 0===o)return;const i=r.slice(n+1).find(e=>this.getAlternativeMeasures().some(t=>t.qDef.cId===e)),a=this.getAlternativeMeasures().findIndex(e=>e.qDef.cId===i);await this.addAlternativeMeasures(o,-1===a?void 0:a),this.#y("measures",r)}async moveMeasureFromAlternative(e){const t=this.getAlternativeMeasures().findIndex(t=>t.qDef.cId===e),r=this.#v("measures"),n=r.indexOf(e);if(-1===t)return;const o=await this.removeMeasure(t,!0);if(void 0===o)return;const i=this.getMeasures().map(e=>e.qDef.cId),a=r.slice(n+1).find(e=>i.includes(e)),s=i.findIndex(e=>e===a);await this.addMeasure(o,!1,-1===s?void 0:s),this.#y("measures",r)}async moveDimensionToAlternative(e){const t=this.#b(e),r=this.getDimensions().findIndex(t=>t.qDef.cId===e);if(-1===r||null===t)return;const n=this.#v(t),o=n.indexOf(e),i="columns"===t,a=await this.removeDimension(r,!1,i);if(void 0===a)return;const s=n.slice(o+1).find(e=>this.getAlternativeDimensions().some(({qDef:t})=>t.cId===e));let l=this.getAlternativeDimensions().findIndex(({qDef:e})=>e.cId===s);l=-1===l?void 0:l;void 0!==this.addAlternativeDimension(a,i,l)&&this.#y(t,n)}async moveDimensionFromAlternative(e){const t=this.#b(e),r=this.getAlternativeDimensions().findIndex(t=>t.qDef.cId===e);if(-1===r||null===t)return;const n=this.#v(t),o=n.indexOf(e),i="columns"===t,a=await this.removeDimension(r,!0,i);if(void 0===a)return;const s=this.#C(t,!1),l=n.slice(o+1).find(e=>s.includes(e));let u=s.findIndex(e=>e===l);u=-1===u?void 0:u;void 0!==await this.addDimension(a,i,u)&&this.#y(t,n)}movePseudoDimension({toIndex:e,toSection:t}){const r=this.#b(-1);if(null===r)return void console.error("Cannot move pseudo dimension, unable to find it in any section",{toIndex:e,toSection:t});const n="columns"===t,o=r===t,i=this.#v(t);if(o){const e=i.indexOf(-1);i.splice(e,1)}else{const o=this.#g(r),i=o.indexOf(-1);if(-1===i)return void console.error("Couldn't delete pseudo dimension from current section",{toIndex:e,toSection:t,fromSection:r});o.splice(i,1),this.hcProperties.qNoOfLeftDims=n?Math.max(0,this.hcProperties.qNoOfLeftDims-1):this.hcProperties.qNoOfLeftDims+1}const a=e-i.slice(0,e).filter(e=>this.#x(e)).length,s=n?this.hcProperties.qNoOfLeftDims+a:a,l=this.hcProperties.qInterColumnSortOrder.indexOf(-1);this.hcProperties.qInterColumnSortOrder.splice(l,1),this.hcProperties.qInterColumnSortOrder.splice(s,0,-1),i.splice(e,0,-1),this.#y(t,i)}async moveDimension({cId:e,toIndex:t,toSection:r}){const n=this.#b(e),o=this.#x(e);if(null===n)return void console.error("Cannot move dimension, unable to find it in any section",{cId:e});const i=(o?this.getAlternativeDimensions():this.getDimensions()).findIndex(({qDef:t})=>t.cId===e);if(-1===i)return void console.error("Couldn't find dimension to move",{cId:e,toIndex:t,toSection:r});const a=this.#v(r),s=a.indexOf(e);-1!==s&&a.splice(s,1);const l=t-a.slice(0,t).filter(e=>this.#x(e)!==o).length,u="columns"===r,c="columns"===n,d=await this.removeDimension(i,o,c);if(void 0===d)return;void 0!==await this.addDimension(d,u,l,o)&&(a.splice(t,0,e),this.#y(r,a))}async moveMeasure({cId:e,toIndex:t}){const r=this.#x(e),n=(r?this.getAlternativeMeasures():this.getMeasures()).findIndex(t=>t.qDef.cId===e);if(-1===n)return void console.error("Cannot move measure, unable to find it in any section",{cId:e});const o=this.#v("measures"),i=o.indexOf(e);-1!==i&&o.splice(i,1);const a=t-o.slice(0,t).filter(e=>this.#x(e)!==r).length,s=await this.removeMeasure(n,r);if(void 0===s)return;void 0!==await this.addMeasure(s,r,a)&&(o.splice(t,0,e),this.#y("measures",o))}getLabels(){return this.getMeasures().filter(e=>!e.qLibraryId&&!!e.qDef.qLabel).map(e=>e.qDef.qLabel)}IsHCInStraightMode(){return"S"===this.hcProperties.qMode}getFilters(){return this.properties.filters??[]}getFilter(e){return this.getFilters().find(t=>t.id===e)}addFilterField(e){const t=e.qTags??e.tags,r=Array.isArray(t)&&t.includes("$numeric"),n=e.isDerived,o=Array.isArray(this.properties.filters)?this.properties.filters:[],i={type:"values",field:n?e.value??e.fullname:e.name??e.label??e.field,options:{values:[]},exclude:!1,id:BN(),qTags:Array.isArray(t)?t:[],isNumeric:r};return o.push(i),this.properties.filters=o,this.properties.qHyperCubeDef.qContextSetExpression=FN(o),i}addFilters(e){const t=[];for(const r of e)t.push(this.addFilterField(r));return t}#M(e){const t=this.getFilters();return t.splice(e,1),this.properties.qHyperCubeDef.qContextSetExpression=FN(t),t}removeFilters(e){if(0===e.length)return[];let t=[];const r=[...e].sort((e,t)=>t-e);t=this.getFilters().filter((t,r)=>e.includes(r));for(const e of r)this.#M(e);return t}getAddDimensionLabel(){return this.#u.get("Visualization.Requirements.AddDimension")}canColorBy(){return!1}}var QN={exports:{}};!function(e){self,e.exports=(()=>{var e={909:e=>{var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},a=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var n,o=t.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!o&&!i)return!1;for(n in e);return void 0===n||t.call(e,n)},s=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,r){if("__proto__"===r){if(!t.call(e,r))return;if(o)return o(e,r).value}return e[r]};e.exports=function e(){var t,r,n,o,u,c,d=arguments[0],p=1,f=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<f;++p)if(null!=(t=arguments[p]))for(r in t)n=l(d,r),d!==(o=l(t,r))&&(h&&o&&(a(o)||(u=i(o)))?(u?(u=!1,c=n&&i(n)?n:[]):c=n&&a(n)?n:{},s(d,{name:r,newValue:e(h,c,o)})):void 0!==o&&s(d,{name:r,newValue:o}));return d}},8:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},a=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var n,o=t.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!o&&!i)return!1;for(n in e);return void 0===n||t.call(e,n)},s=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,r){if("__proto__"===r){if(!t.call(e,r))return;if(o)return o(e,r).value}return e[r]};e.exports=function e(){var t,r,n,o,u,c,d=arguments[0],p=1,f=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<f;++p)if(null!=(t=arguments[p]))for(r in t)n=l(d,r),d!==(o=l(t,r))&&(h&&o&&(a(o)||(u=i(o)))?(u?(u=!1,c=n&&i(n)?n:[]):c=n&&a(n)?n:{},s(d,{name:r,newValue:e(h,c,o)})):void 0!==o&&s(d,{name:r,newValue:o}));return d}}},r={};function n(t){var o=r[t];if(void 0!==o)return o.exports;var i=r[t]={exports:{}};return e[t](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{n.r(o),n.d(o,{default:()=>Ae});var e=n(229),t=n.n(e);const r=function(e,t,r){if(!t)return!1;var n,o=t.split("."),i=o[o.length-1],a=e;for(n=0;n<o.length-1;++n)void 0===a[o[n]]&&(a[o[n]]=Number.isNaN(+o[n+1])?{}:[]),a=a[o[n]];if(void 0!==r){var s=a[i];return a[i]=r,{updated:r,previous:s}}return delete a[i],!1},i=function(e,t,r){var n,o=t.split("."),i=e;if(void 0===i)return r;for(n=0;n<o.length;++n){if(void 0===i[o[n]])return r;i=i[o[n]]}return i},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function u(e){return s+e+l}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var r=function(e,t){if(!t)return null;var r,n;for(r=0;r<t.length;r++)if((n=t[r]).qInfo.qId===e)return n;return null}(e.qLibraryId,t.dimensionList);return r&&r.qData.info[0].qTags.indexOf("$numeric")>-1}var n=function(e,t){if(!t)return null;var r,n,o=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var r=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(r)&&(t=(t=t.substring(1,r)).trim()),t}(e);for(r=0;r<t.length;r++){if((n=t[r]).qName===o)return n;if(n.qDerivedFieldData)for(var i=0;i<n.qDerivedFieldData.qDerivedFieldLists.length;++i)for(var a=n.qDerivedFieldData.qDerivedFieldLists[i],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===o)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return n&&n.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function p(e,t){var r=e.crossAllDimensions;return 2===t&&r?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),r=t.trim();return"="===r.substring(0,1)?r.substring(1).trim():r}function h(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(e,t){var r=e.crossAllDimensions;return 2===t&&r?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function v(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function y(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(v("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(v("MaxString(".concat(t,")")),")'\"}")}function b(e){var t=e.modifier,r=void 0===t?{}:t,n=e.dimensions,o=e.dimensionAndFieldList,i=e.funcComp,a=void 0===i?"Sum":i,s=e.valueComp,l=void 0===s?"0":s;if(!r.showExcludedValues)return"";if(n&&1===n.length){var u=y(c(n[0],o),h(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(n&&2===n.length){var d=c(n[0],o),p=c(n[1],o),f=h(0),m=h(1),g=y(d,f),v=y(p,m);return"".concat(a,"({1<").concat(g,",").concat(v,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function S(e){var t=e.properties,r=e.layout;return i(t,"qHyperCubeDef.qDimensions",i(r,"qHyperCube.qDimensionInfo",[])).length}const w={isFullRange:d,getNumDimensions:S,getExpressionWithExcludedComp:function(e){var t=e.expression,r=e.modifier,n=e.dimensions,o=e.dimensionAndFieldList,i=e.treatMissingAsNull,a=u(f(t));if(!r.showExcludedValues)return a;var s=b({modifier:r,dimensions:n,dimensionAndFieldList:o}),l=i?"":", 0";if(n&&1===n.length){var c=h(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(n&&2===n.length){var d=h(0),p=h(1);return"If(Count(".concat(d,") * Count(").concat(p,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:p,getNumStepComp:function(e,t){if(!d(e)){var r=e.steps;return"number"!=typeof r||Number.isNaN(r)?6:r}return p(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,r,n){return m(e,t)+r+g(n)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,r){return"Aggr(".concat(e,", ").concat(t,", ").concat(r,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,r=e.properties,n=e.layout,o=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===o&&2===S({properties:r,layout:n})},getDimComp:function(e,t){var r=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),n=h(t);if(!r.qSortByExpression&&!r.qSortByNumeric&&!r.qSortByAscii)return n;var o=["Descending","Ascending"],i=r.qSortByNumeric?"(Numeric, ".concat(o[(r.qSortByNumeric+1)/2],")"):"",a=r.qSortByAscii?"(Text, ".concat(o[(r.qSortByAscii+1)/2],")"):"";return r.qSortByNumeric&&r.qSortByAscii?"(".concat(n,", ").concat(i,", ").concat(a,")"):r.qSortByNumeric?"(".concat(n,", ").concat(i,")"):r.qSortByAscii?"(".concat(n,", ").concat(a,")"):n},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var r=t.indexOf(s);if(-1!==r){var n=t.indexOf(l);if(-1!==n)return t.substring(r+s.length,n)}}},initModifier:function(e,t){Object.keys(t).forEach(function(r){void 0===e[r]&&(e[r]=t[r])})},isNumeric:c,isApplicable:function(e){var t=e.properties,r=e.layout,n=e.minDimensions,o=void 0===n?1:n,i=e.maxDimensions,a=void 0===i?2:i;if(!t&&!r)return!0;var s=S({properties:t,layout:r});return s>=o&&s<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(s),r=e.indexOf(l);return t>-1&&r>-1&&t<r},getDimDefWithWrapper:h,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,r){var n=t||e.outputExpression;if(e.base&&e.base.qDef&&(n=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var o=r.qHyperCubeDef.qMeasures.find(function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null});o&&t!==o.qDef.qLabel&&(n=o.qLibraryId||o.qDef.base.qLibraryId?"[".concat(o.qDef.qLabel,"]"):o.qDef.base.qDef);var i=function(e){var t=a.OPTIONS.find(function(t){return t.value===e.decomposition});return t?a.EXPRESSIONS[t.value]:""}(e);n=n.startsWith("=")?n.substr(1):n,n="".concat(i,"(").concat(n,", ").concat(e.steps,")")}return n},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find(function(r){var n=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[r]&&n.includes(a.EXPRESSIONS[r].toLowerCase())&&(t=r),r}),t}};function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}var I=t().bind(null,!0),D={},P=Array.isArray;function R(e){return null!=e&&!Array.isArray(e)&&"object"===E(e)}function M(e){return void 0===e}function L(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function A(e,t){var r,n=t.substring(1).split("/").slice(0,-1);return n.forEach(function(t,o){if(o!==n.length){r=+t;var i=Number.isNaN(r)?{}:[];e[r||t]=M(e[r||t])?i:e[t],e=e[r||t]}}),e}function k(e,t){var r=!0;if(R(e)&&R(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(n){k(e[n],t[n])||(r=!1)}),r);if(P(e)&&P(t)){if(e.length!==t.length)return!1;for(var n=0,o=e.length;n<o;n+=1)if(!k(e[n],t[n]))return!1;return!0}return e===t}D.generate=function(e,t,r){r=r||"";var n=[];return Object.keys(t).forEach(function(o){var i=function(e){return e?I({},{val:e}).val:e}(t[o]),a=e[o],s="".concat(r,"/").concat(o);k(i,a)||L(t,o)||(M(a)?n.push({op:"add",path:s,value:i}):R(i)&&R(a)?n=n.concat(D.generate(a,i,s)):P(i)&&P(a)?n=n.concat(function(e,t,r){var n=[],o=e.slice(),i=-1;function a(e,t,r){if(e[r]&&M(e[r].qInfo))return null;if(e[r]&&e[r].qInfo.qId===t)return r;for(var n=0,o=e.length;n<o;n+=1)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(k(t,o))return n;if(!M(t[0])&&M(t[0].qInfo))return n.push({op:"replace",path:r,value:t}),n;for(var s=o.length-1;s>=0;s-=1)-1===(i=a(t,o[s].qInfo&&o[s].qInfo.qId,s))?(n.push({op:"remove",path:"".concat(r,"/").concat(s)}),o.splice(s,1)):n=n.concat(D.generate(o[s],t[i],"".concat(r,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(i=a(o,t[l].qInfo&&t[l].qInfo.qId))?(n.push({op:"add",path:"".concat(r,"/").concat(l),value:t[l]}),o.splice(l,0,t[l])):i!==l&&(n.push({op:"move",path:"".concat(r,"/").concat(l),from:"".concat(r,"/").concat(i)}),o.splice(l,0,o.splice(i,1)[0]));return n}(a,i,s)):n.push({op:"replace",path:"".concat(r,"/").concat(o),value:i}))}),Object.keys(e).forEach(function(o){M(t[o])&&!L(e,o)&&n.push({op:"remove",path:"".concat(r,"/").concat(o)})}),n},D.apply=function(e,t){t.forEach(function(t){var r,n,o=A(e,t.path),i=t.path.split("/").splice(-1)[0],a=i&&Number.isNaN(+i)?o[i]:o[+i]||o,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(o=null,a=e),"add"===t.op||"replace"===t.op)if(P(o))"-"===i&&(i=o.length),o.splice(+i,"add"===t.op?0:1,t.value);else if(P(a)&&P(t.value)){var l,u=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return C(e)}(n=u)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?C(e,t):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(R(a)&&R(t.value))r=a,Object.keys(r).forEach(function(e){Object.getOwnPropertyDescriptor(r,e).configurable&&!L(r,e)&&delete r[e]}),I(a,t.value);else{if(!o)throw new Error("Patchee is not an object we can patch");o[i]=t.value}else if("move"===t.op){var c=A(e,t.from);P(o)?o.splice(+i,0,c.splice(+s,1)[0]):(o[i]=c[s],delete c[s])}else"remove"===t.op&&(P(o)?o.splice(+i,1):delete o[i])})},D.clone=function(e){return I({},e)},D.createPatch=function(e,t,r){var n={op:e.toLowerCase(),path:r};return"move"===n.op?n.from=t:void 0!==t&&(n.value=t),n},D.updateObject=function(e,t){Object.keys(e).length?D.apply(e,D.generate(e,t)):I(e,t)};const O=D,q=function(e,r,n){if(!e)return Promise.resolve();var o=O.generate(r,n);return t()(!0,r,n),o&&o.length?(o=o.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),e.applyPatches(o,!0)):Promise.resolve()};var T="accumulation";function N(e,t){var r=i(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===T)return r[n]}function _(e,t){var r=function(e,t){var r=i(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===T)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}var j={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const F={translationKey:"properties.modifier.accumulation",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,r=e.layout;return w.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,r=e.modifier,n=e.properties,o=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!r)return t;var l=a;void 0===l&&(l=w.getNumDimensions({properties:n,layout:o}));var u=i(n,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:r,dimensions:u,dimensionAndFieldList:s}),d=w.getNumStepComp(r,l),p=w.getAboveComp(r,l,c,d),f=w.getRangeComp("RangeSum",p);if(w.needDimension({modifier:r,properties:n,layout:o})){var h=w.getDimComp(u,1),m=w.getDimComp(u,0),g=w.getAggrComp(f,h,m);f=r.showExcludedValues?w.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return f},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,j)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(_(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(_(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(_(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(_(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var r=N(t,e);if(r){var n=r.steps;r.steps="number"!=typeof n||Number.isNaN(n)?6:Math.abs(n)}},show:function(t){var r=N(t,e);return r&&!r.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(_(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,r,n){var o=n.ext.support.modifiers;if(!Array.isArray(o)||-1===o.indexOf(T))return!1;var i=N(t,e);return i&&!i.disabled}};return r}};var z="movingAverage";function W(e,t){var r=i(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===z)return r[n]}function $(e,t){var r=function(e,t){var r=i(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===z)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}var H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const V={translationKey:"properties.modifier.movingAverage",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,r=e.layout;return w.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,r=e.expression,n=e.modifier,o=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!n)return r;var u=s;void 0===u&&(u=w.getNumDimensions({properties:o,layout:a}));var c=i(o,"qHyperCubeDef.qDimensions",[]),d=n.showExcludedValues&&n.nullSuppression,p=w.getExpressionWithExcludedComp({expression:r,modifier:n,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:d}),f=w.getNumStepComp(n,u),h=w.getAboveComp(n,u,p,f);if(n.nullSuppression)t=w.getRangeComp("RangeAvg",h);else{var m=w.getRangeComp("RangeSum",h),g=function(e,t){var r=w.getRowNoComp(e,t);if(!w.isFullRange(e)){var n=e.steps,o="number"!=typeof n||Number.isNaN(n)?6:n;return"RangeMin(".concat(o,", ").concat(r,")")}return r}(n,u);t="".concat(m," / ").concat(g)}var v=t;if(w.needDimension({modifier:n,properties:o,layout:a})){var y=w.getDimComp(c,1),b=w.getDimComp(c,0),x=w.getAggrComp(v,y,b);v=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return v},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat($(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat($(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat($(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat($(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var r=W(t,e);if(r){var n=r.steps;r.steps="number"!=typeof n||Number.isNaN(n)?6:Math.abs(n)}},show:function(t){var r=W(t,e);return r&&!r.fullRange}},showExcludedValues:{refFn:function(t){return"".concat($(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat($(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,r,n){var o=n.ext.support.modifiers;if(!Array.isArray(o)||-1===o.indexOf(z))return!1;var i=W(t,e);return i&&!i.disabled}};return r}};var B="timeSeriesDecomposition";function G(e,t){var r=i(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===B)return r[n]}function U(e,t){var r=function(e,t){var r=i(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===B)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}var Y={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const K={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,r=e.layout;return w.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,r=e.modifier,n=e.properties;return r?w.generateTSDExpression(r,t,n):t},extractInputExpression:w.extractInputExpression,initModifier:function(e,t){w.initModifier(e,Y),""===e.decomposition&&t&&(e.decomposition=w.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!w.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,r){var n=G(t,e);if(n){var o=n.steps;n.steps="number"!=typeof o||Number.isNaN(o)?2:Math.abs(o),r.properties.qHyperCubeDef.qMeasures=r.properties.qHyperCubeDef.qMeasures.map(function(e){return e.qDef.modifiers.map(function(e){return"timeSeriesDecomposition"===e.type?e.steps=o:e.steps=e.steps,e}),e})}},show:function(t){var r=G(t,e);return r&&!r.fullRange}}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,r,n){var o=n.ext.support.modifiers;if(!Array.isArray(o)||-1===o.indexOf(B))return!1;var i=G(t,e);return i&&!i.disabled}};return r}};var X="difference";function J(e,t){var r=i(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===X)return r[n]}function Z(e,t){var r=function(e,t){var r=i(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===X)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,r=e.layout;return w.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,r=e.modifier,n=e.properties,o=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!r)return t;var l=a;void 0===l&&(l=w.getNumDimensions({properties:n,layout:o}));var u=i(n,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:r,dimensions:u,dimensionAndFieldList:s}),d=w.getAboveComp(r,l,c),p="".concat(c," - ").concat(d);if(w.needDimension({modifier:r,properties:n,layout:o})){var f=w.getDimComp(u,1),h=w.getDimComp(u,0),m=w.getAggrComp(p,f,h);p=r.showExcludedValues?w.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return p},initModifier:function(e){Object.keys(Q).forEach(function(t){void 0===e[t]&&(e[t]=Q[t])})},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!w.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 w.isApplicable({properties:t.properties})}}},show:function(t,r,n){var o=n.ext.support.modifiers;if(!Array.isArray(o)||-1===o.indexOf(X))return!1;var i=J(t,e);return i&&!i.disabled}};return r}};var te="normalization";function re(e,t){var r=i(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===te)return r[n]}function ne(e,t){var r=function(e,t){var r=i(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===te)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}function oe(e,t){for(var r=0;r<e.length;r++)if(e[r].value===t)return r;return-1}var ie={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,r){return 1===e?"{$<".concat(w.getFieldWithWrapper(t),"={'").concat(r,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ue(e,t,r){return 0===e&&t>1?"<".concat(w.getDimDefWithWrapper(r),">"):""}const ce={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,r=e.layout;return w.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,r=e.modifier,n=e.properties,o=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!r)return t;var l=a;void 0===l&&(l=w.getNumDimensions({properties:n,layout:o}));var u=i(n,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:r,dimensions:u,dimensionAndFieldList:s}),d=r.selectionScope,p=r.dimensionalScope;return function(e,t,r,n,o,i,a){var s=ae(t),l=se(t,r,n),u=""===s&&""===l?"":s||l,c=le(o,i),d=ue(o,i,a),p=function(e){for(var t=[],r=0;r<e;r++)t[r]=w.getDimDefWithWrapper(r);return t.join(", ")}(i);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(d," Aggr(").concat(u," ").concat(e,", ").concat(p,"))")}(c,d,r.field,r.value,p,l,r.primaryDimension)},initModifier:function(e){Object.keys(ie).forEach(function(t){void 0===e[t]&&(e[t]=ie[t])})},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(ne(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(r){return function(e,t,r){var n=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return n=function(e,t){if(1===e){var r=oe(t,0);t.splice(r,1)}return t}(re(e,r).dimensionalScope,n),n}(r,t,e)}},field:{refFn:function(t){return"".concat(ne(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,r){return r.app.getFieldList().then(function(e){return e.map(function(e){return{label:e.qName,value:e.qName}})})},show:function(t){return 1===re(t,e).selectionScope}},value:{refFn:function(t){return"".concat(ne(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===re(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(ne(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(r,n){return function(e,t,r,n){var o=t.layout.qHyperCube.qDimensionInfo.length,i=[{value:0,translation:r.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:r.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:r.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===o?"respectAllDimensions":"respectDimension"),tooltipTranslation:r.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===o?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:r.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===o?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:r.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===o?"disregardAllDimensions":"disregardDimension",".tooltip")}];return i=function(e,t){if(e<2){var r=oe(t,0);t.splice(r,1)}return t}(o,i),i=function(e,t){if(0===e){var r=oe(t,1);t.splice(r,1)}return t}(re(e,n).selectionScope,i),i}(r,n,t,e)}},primaryDimension:{refFn:function(t){return"".concat(ne(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(t,r){return 0===(re(t,e).dimensionalScope||0)&&r.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,r,n){var o=n.ext.support.modifiers;if(!Array.isArray(o)||-1===o.indexOf(te))return!1;var i=re(t,e);return i&&!i.disabled}};return r},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ue};var de="qDef.base",pe="qDef.qDef",fe="qDef.base.qDef",he="qLibraryId",me="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=i(e,fe);return void 0!==t?t:i(e,pe)},getExpressionRef:function(e){return void 0!==i(e,fe)?fe:pe},getLibraryIdRef:function(e){return i(e,me)?me:he},getLibraryId:function(e){return i(e,me)||i(e,he)},getLabelRef:function(e){return i(e,de)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return i(e,de)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ve="qDef.qDef",ye="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",Se="qDef.qLabel",we="qDef.qLabelExpression",Ce="qDef.base.qLabel",Ee="qDef.base.qLabelExpression",Ie="qDef.qAggrFunc",De="qDef.base.qAggrFunc",Pe={initBase:function(e,t){(t||Pe.isValid(e))&&(r(e,ye,i(e,ve)),r(e,xe,i(e,be)),r(e,Ce,i(e,Se)),r(e,Ee,i(e,we)))},restoreBase:function(e){Pe.isValid(e)&&(r(e,ve,i(e,ye)),r(e,be,i(e,xe)),r(e,Se,i(e,Ce)),r(e,we,i(e,Ee)),i(e,Ie)&&i(e,De)&&r(e,Ie,i(e,De)),delete e.qDef.base)},isValid:function(e){var t=i(e,ye),r=i(e,xe);return void 0!==t||void 0!==r}};const Re=Pe;function Me(e){return Me="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},Me(e)}var Le={accumulation:F,movingAverage:V,difference:ee,normalization:ce,timeSeriesDecomposition:K};const Ae={modifiers:Le,apply:Oe,applyModifiers:qe,cleanUpMeasure:Te,destroy:function(e){e&&ke[e.id]&&ke[e.id].masterItemSubscriber&&(ke[e.id].masterItemSubscriber&&ke[e.id].masterItemSubscriber.unsubscribe(),delete ke[e.id])},hasActiveModifiers:Ne,getActiveModifier:_e,initBase:Re.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Le[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,r=e.properties,n=e.layout;return Array.isArray(t)&&t.some(function(e){return Le[e]&&Le[e].isApplicable({properties:r,layout:n})})},measureBase:ge,limitedSorting:function(e){var t=e.measures,r=e.properties,n=e.layout,o=!1,i=!1;return t.forEach(function(e){var t=ze(e);Ue({modifiers:t,properties:r,layout:n})&&(o=!0,i=i||Ze({modifiers:t,properties:r,layout:n}))}),o&&!i},ifEnableTotalsFunction:je};var ke={};function Oe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.model,n=e.properties,o=e.isSnapshot,a=void 0!==o&&o,s=e.masterItem,l=!1;ke[r.id]=ke[r.id]||{isFirstTime:!0};var u=ke[r.id].isFirstTime;if(ke[r.id].isFirstTime=!1,n&&"object"===Me(n))return qe({model:r,properties:n});var c=r?r.layout:void 0,d=i(c,"qSelectionInfo.qInSelections");if(a||d)return Promise.resolve(l);var p=i(c,"qHyperCube.qMeasureInfo"),f=ke[r.id].lastReloadTime;if(ke[r.id].lastReloadTime=i(r,"app.layout.qLastReloadTime"),Ne({measures:p,layout:c})){var h=function(e){var t=e.measures,r=e.layout,n=e.lastReloadTime;return i(e.model,"app.layout.qLastReloadTime")!==n&&function(e){var t=e.measures,r=e.properties,n=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ge({measure:e,properties:r,layout:n})})}({measures:t,layout:r})}({measures:p,layout:c,model:r,lastReloadTime:f});return h||function(e){var t=e.measures,r=e.layout,n=e.masterItem,o=e.isFirstTime;return!!Array.isArray(t)&&(o||n||t.some(function(e){return function(e){var t=e.measure,r=e.layout;return Ue({modifiers:ze(t),layout:r})?!t.base:!!t.base}({measure:e,layout:r})}))}({measures:p,layout:c,masterItem:s,isFirstTime:u})?r.getEffectiveProperties().then(function(e){var n=t()(!0,{},e);$e(n);var o=Qe(n);return Ye({model:r}).then(function(t){return Ke({libraryIds:o,model:r}).then(function(o){return h&&function(e){var t=e.properties;Fe(t).forEach(function(e){return function(e){var t=e.measure;if(Ge({measure:t,properties:e.properties})){var r=0,n=t.qDef.modifiers;Array.isArray(n)&&n.forEach(function(e){if("object"===Me(e)&&!e.disabled){if(r++,"object"!==Me(Le[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(r>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var n=Le[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==n&&Ve(t)&&w.simplifyExpression(t.qDef.base.qDef)!==w.simplifyExpression(n)&&(t.qDef.base.qDef=n)}})}}({measure:e,properties:t})})}({properties:n}),qe({model:r,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:o,dimensionAndFieldList:t})})})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===Me(e.base)})}(p)?r.getEffectiveProperties().then(function(e){return function(e){var r=e.model,n=e.properties,o=Qe(n);return et({model:r,libraryIds:o}).then(function(){var e=t()(!0,{},n);return Fe(n).forEach(function(e){return Te(e)}),Je({oldProperties:e,newProperties:n,model:r})})}({model:r,properties:e})}):Promise.resolve(l)}function qe(e){var r=e.model,n=e.oldProperties,o=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===n&&(n=l?t()(!0,{},o):o),$e(o);var p=Qe(o);return et({model:r,libraryIds:p,masterItem:u}).then(function(){return function(e){var r=e.measures,n=e.properties,o=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(r||(r=Fe(n)),!r.length)return Promise.resolve();if(!Ne({measures:r,properties:n}))return r.forEach(function(e){return Te(e)}),Promise.resolve();var l=a?void 0:Qe(n);return Ye({model:o,dimensionAndFieldList:s}).then(function(e){return Ke({libraryIds:l,model:o,libraryItemsProps:a}).then(function(o){r.forEach(function(r){Ue({modifiers:r.qDef.modifiers,properties:n})?(function(e){var r=e.measure,n=e.properties,o=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;Re.isValid(r)||Re.initBase(r,!0);var l=r.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach(function(e){if("object"===Me(e)&&!e.disabled){if(s++,"object"!==Me(Le[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Le[e.type].initModifier(e,r);var l=r.qLibraryId||c&&c.qLibraryId;l?function(e){var r=e.measure,n=e.modifier,o=e.properties,i=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Le[n.type].generateExpression({expression:s,modifier:n,properties:o,dimensionAndFieldList:i});n.outputExpression=l,r.qDef.qDef=n.outputExpression,(r.qDef.qLabel||a.qMeasure.qLabel)&&(r.qDef.qLabel=a.qMeasure.qLabel),(r.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(r.qDef.qLabelExpression=a.qMeasure.qLabelExpression),r.qDef.quarantine&&r.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(r.qDef.qNumFormat=a.qMeasure.qNumFormat,r.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete r.qLibraryId,r.qDef.coloring=a.qMeasure.coloring,n.base=t()(!0,{},r.qDef.base)}({measure:r,modifier:e,libraryId:l,properties:n,libraryItemsProps:o,dimensionAndFieldList:a}):function(e){var r=e.measure,n=e.modifier,o=e.properties,i=e.dimensionAndFieldList;"function"==typeof Le[n.type].updateModifier&&Le[n.type].updateModifier(n,o.qHyperCubeDef);var a=ge.getExpression(r),s=""===a?a:Le[n.type].generateExpression({expression:a,modifier:n,properties:o,dimensionAndFieldList:i});n.outputExpression=s,r.qDef.qDef=n.outputExpression,r.qDef.base.qLabelExpression?r.qDef.qLabelExpression=r.qDef.base.qLabelExpression:r.qDef.qLabel=r.qDef.base.qLabel||a,n.base=t()(!0,{},r.qDef.base)}({measure:r,modifier:e,properties:n,dimensionAndFieldList:a}),function(e){var t=i(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")}(r)}})}({measure:r,properties:n,libraryItemsProps:o,dimensionAndFieldList:e}),He(r)):Te(r)})})})}({measures:a,properties:o,model:r,libraryItemsProps:c,dimensionAndFieldList:d}).then(function(){return l?Je({oldProperties:n,newProperties:o,model:r}):Promise.resolve(!1)})})}function Te(e){!function(e){var t=ze(e);return Array.isArray(t)&&t.some(function(e){return"object"===Me(e)&&!e.disabled&&!Le[e.type]})}(e)?Re.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,He(e)}function Ne(e){var t=e.measures,r=e.properties,n=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ue({modifiers:ze(e),properties:r,layout:n})})}function _e(e){var t=ze(e);if(Array.isArray(t))for(var r=0;r<t.length;r++){var n=t[r];if(Le[n.type]&&!n.disabled)return n}}function je(e){var t=_e(e);return!t||Le[t.type].enableTotalsFunction(e)}function Fe(e){return i(e,"qHyperCubeDef.qMeasures",[]).concat(i(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function ze(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function We(e){return i(e,"outputExpression.qValueExpression.qExpr")||i(e,"outputExpression")}function $e(e){Fe(e).forEach(function(e){return function(e){var r=_e(e);r&&(void 0!==r.outputExpression&&We(r)!==e.qDef.qDef?delete e.qDef.base:!Re.isValid(e)&&r.base&&(e.qDef.base=t()(!0,{},r.base)))}(e)})}function He(e){var t=ze(e);Array.isArray(t)&&t.forEach(function(t){"object"===Me(t)&&(t.disabled||!Le[t.type]&&We(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function Ve(e){return e.base||e.qDef&&e.qDef.base}function Be(e){var t=Ve(e);return e.qLibraryId||t&&t.qLibraryId}function Ge(e){var t=e.measure,r=e.properties,n=e.layout;return!Be(t)&&Ue({modifiers:ze(t),properties:r,layout:n})}function Ue(e){var t=e.modifiers,r=e.properties,n=e.layout,o={};return Array.isArray(t)&&t.some(function(e){return!("object"!==Me(e)||e.disabled||!Le[e.type])&&(void 0===o[e.type]&&(o[e.type]=Le[e.type].isApplicable({properties:r,layout:n})),o[e.type])})}function Ye(e){var t=e.model,r=e.dimensionAndFieldList;if(r)return Promise.resolve(r);var n=[],o={},i=t.app.getDimensionList().then(function(e){o.dimensionList=e});n.push(i);var a=t.app.getFieldList().then(function(e){o.fieldList=e});return n.push(a),Promise.all(n).then(function(){return o})}function Ke(e){var t=e.libraryIds,r=e.model,n=e.libraryItemsProps;if(n)return Promise.resolve(n);var o=t.measureLibraryIds,i=t.dimensionLibraryIds,a={},s=[];return o.forEach(function(e){var t=r.app.getMeasure(e).then(function(t){return t.getProperties().then(function(t){a[e]=t})});s.push(t)}),i.forEach(function(e){var t=r.app.getDimension(e).then(function(t){return t.getProperties().then(function(t){a[e]=t})});s.push(t)}),Promise.all(s).then(function(){return a})}function Xe(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,r=e.newProperties,n=e.model,o=JSON.stringify(i(t,"qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(i(r,"qHyperCubeDef.qMeasures"),Xe)||JSON.stringify(i(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(i(r,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe);return o?function(e){var t=e.model,r=e.oldProperties,n=e.newProperties,o=t.layout;return o&&!o.qHasSoftPatches&&!o.qExtendsId&&i(o,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(n):q(t,r,n)}({model:n,oldProperties:t,newProperties:r}).then(function(){return o}):Promise.resolve(o)}function Ze(e){var t=e.modifiers,r=e.properties,n=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===Me(e)&&!e.disabled&&Le[e.type]&&Le[e.type].needDimension({modifier:e,properties:r,layout:n})})}function Qe(e){var t=Fe(e),r=[],n=[],o=!1;return t.forEach(function(t){var n=ze(t);if(Ue({modifiers:n,properties:e})){var i=Be(t);i&&r.push(i),o=o||Ze({modifiers:n,properties:e})}}),i(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&n.push(t)}),{measureLibraryIds:r,dimensionLibraryIds:n}}function et(e){var t=e.model,r=e.libraryIds;return!e.masterItem&&r&&(r.measureLibraryIds.length||r.dimensionLibraryIds.length)?(ke[t.id].masterItemSubscriber=ke[t.id].masterItemSubscriber||function(e){var t=e.model,r=e.callback,n={},o={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},r=i(e,"qInfo.qType");return r&&s[r]&&s[r].forEach(function(r){t[r]=i(e,r)}),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(n[t]){var o=l(e);n[t].properties!==o&&(n[t].properties=o,"function"==typeof r&&n[t].enabled&&r(e)),n[t].enabled=!0}}function c(e,r){return t.app[r](e).then(function(t){n[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}})}return{subscribe:function(e){var r=e.measureLibraryIds,i=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;o={},e.measureLibraryIds.forEach(function(e){o[e]=!0}),a={},t.forEach(function(e){a[e]=!0})}({measureLibraryIds:r,dimensionLibraryIds:i}),Object.keys(n).forEach(function(e){o[e]||a[e]||(n[e].listener.dispose(),delete n[e])}),t.app&&(Object.keys(o).forEach(function(e){o[e]&&!n[e]&&s.push(c(e,"getMeasure"))}),Object.keys(a).forEach(function(e){a[e]&&!n[e]&&s.push(c(e,"getDimension"))})),Promise.all(s)},unsubscribe:function(){Object.keys(n).forEach(function(e){n[e].listener.dispose()}),n={}}}}({model:t,callback:function(e){return Oe({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),ke[t.id].masterItemSubscriber.subscribe(r)):Promise.resolve()}})(),t.default=o.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};return(()=>{function e(t){var r,n=t;return n>9?(r=65+n-10)>90&&(r+=6):n="".concat(n).charCodeAt(0),[48,111,79,105,73,108].indexOf(r)>-1?e(n+1):String.fromCharCode(r)}function t(r){var n=e(r%62),o=Math.floor(r/62);return o>0?t(o)+n:n}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}r.d(n,{default:()=>$e});const i={getValue:function(e,t,r){if(null==e||null==t)return r;for(var n=t.split("."),o=e,i=0;i<n.length;++i){var a=n[i];if(""!==a){if(void 0===o[a]||null===o[a])return r;o=o[a]}}return o},setValue:function(e,t,r){if(null!=e&&null!=t){for(var n=t.split("."),o=n[n.length-1],i=e,a=0;a<n.length-1;++a){var s=n[a];void 0!==i[s]&&null!==i[s]||(i[s]=Number.isNaN(+n[a+1])?{}:[]),i=i[s]}void 0!==r?i[o]=r:delete i[o]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(o(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t,r){if(e){for(var n=0;n<e.length;n++)if(e[n][t]===r)return n;return-1}return-1}const d={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var r=e.indexOf(t[0]);if(-1!==r){for(var n=0;n<t.length;n++){var o=e.indexOf(t[n]);if(r>o)return!1;r=o}return!0}return!1},indexAdded:function(e,t){var r;for(r=0;r<e.length;++r)e[r]>=0&&e[r]>=t&&++e[r];e.push(t)},indexRemoved:function(e,t){var r,n=0;for(r=0;r<e.length;++r)e[r]>t?--e[r]:e[r]===t&&(n=r);return e.splice(n,1),n},findItemByPropertyValue:function(e,t,r){if(e){for(var n=0;n<e.length;n++)if(e[n][t]===r)return e[n];return null}return null},findIndexByPropertyValue:c};var p=r(8),f=r.n(p);const h=function(e){var t,r=e.exportFormat,n=e.qHyperCubeDef,o=r.data[0];(t=o.dimensions).push.apply(t,a(n.qDimensions));var s,l=i.getValue(n,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=o.excludedDimensions).push.apply(s,a(l))},m=function(e){var t,r=e.exportFormat,n=e.qHyperCubeDef,o=r.data[0];(t=o.measures).push.apply(t,l(n.qMeasures));var a,s=i.getValue(n,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=o.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,r=e.qHyperCubeDef,n=t.data[0];r.qInterColumnSortOrder||(r.qInterColumnSortOrder=[]),n.interColumnSortOrder=r.qInterColumnSortOrder.concat();var o=i.getValue(r,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");o&&d.isOrderedSubset(o,n.interColumnSortOrder)&&(n.interColumnSortOrder=o.concat())},v=function(e){var t=e.exportFormat,r=e.properties;Object.keys(r).forEach(function(e){t.properties[e]=r[e]})},y=function(e){var t=e.exportFormat,r=e.properties;r.qLayoutExclude||(r.qLayoutExclude={}),r.qLayoutExclude.disabled&&(Object.keys(r.qLayoutExclude.disabled).forEach(function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=r.qLayoutExclude.disabled[e])}),delete r.qLayoutExclude.disabled),r.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach(function(t){e.qLayoutExclude.changed[t].to===i.getValue(e,t)&&i.setValue(e,t,e.qLayoutExclude.changed[t].from)})}(r),delete r.qLayoutExclude.changed),r.qLayoutExclude.quarantine&&!i.isEmpty(r.qLayoutExclude.quarantine)||delete r.qLayoutExclude},b=function(e){e.forEach(function(e){f().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)})};function x(e,t,r){var n,o,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=i.getValue(e,t);if(!i.isAtomicValue(s))try{if((o=(o=(n=JSON.stringify(s)).match(/:\{/g))?o.length:0)>2&&!a)return;s=JSON.parse(n)}catch(e){return}i.getValue(e,"qLayoutExclude.quarantine")||i.setValue(e,"qLayoutExclude.quarantine",{});var l=i.getValue(e,"qLayoutExclude.quarantine");l[r]||(l[r]={}),l[r][t]=s}var S=r(909),w=r.n(S);function C(e,t){var r=w()(!0,{},t,e);return i.getValue(r,"qOtherTotalSpec.qOtherCounted")||i.setValue(r,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),i.getValue(r,"qOtherTotalSpec.qOtherLimit")||i.setValue(r,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),r.hasOwnProperty("othersLabel")||(r.othersLabel="Others"),r}function E(e,t){return w()(!0,{},t,e)}function I(e,t,r){return"function"==typeof e?e(t):Number.isNaN(+e)?r:e}var D=Math.pow(2,53)-1;function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}const M=function(e,t,r){var n="masterobject"===i.getValue(t,"properties.qInfo.qType")?"masterobject":i.getValue(r,"qInfo.qType");i.setValue(e,"qInfo.qType",n),e.visualization=r.visualization},L=function(e,t,r){t.hasOwnProperty(e)&&(r[e]=t[e])},A=function(e,t,r,n){t.hasOwnProperty(e)?r[e]=t[e]:r[e]=n},k=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:[]}},q=function(e){var t,r=e.exportFormat,n=e.maxDimensions,o=e.minDimensions,i=e.newHyperCubeDef,a=e.defaultDimension,s=r.data[0];for(t=0;t<s.dimensions.length;++t){var l=C(s.dimensions[t],a);i.qDimensions.length<n?i.qDimensions.push(l):i.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var u=C(s.excludedDimensions[t],a);i.qDimensions.length<o?i.qDimensions.push(u):i.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},T=function(e){var t,r=e.exportFormat,n=e.maxMeasures,o=e.minMeasures,i=e.newHyperCubeDef,a=e.defaultMeasure,s=r.data[0];for(t=0;t<s.measures.length;++t){var l=E(s.measures[t],a);i.qMeasures.length<n?i.qMeasures.push(l):i.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var u=E(s.excludedMeasures[t],a);i.qMeasures.length<o?i.qMeasures.push(u):i.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},N=function(e){var t=e.exportFormat,r=e.dataDefinition,n=void 0===r?{}:r,o=t.data[0],i=n.dimensions||{max:0},a=n.measures||{max:0},s=I(a.max,o.dimensions.length,D),l=I(a.min,o.dimensions.length,0);return{maxDimensions:I(i.max,s,D),minDimensions:I(i.min,l,0),maxMeasures:s,minMeasures:l}},_=function(e){var t=e.exportFormat,r=e.newHyperCubeDef,n=t.data[0],o=r.qDimensions.length+r.qMeasures.length;r.qInterColumnSortOrder=n.interColumnSortOrder.concat();var i=r.qInterColumnSortOrder.length;if(i!==o)for(r.qLayoutExclude&&(r.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=n.interColumnSortOrder.concat());i!==o;)i<o?(d.indexAdded(r.qInterColumnSortOrder,i),++i):(--i,d.indexRemoved(r.qInterColumnSortOrder,i))},j=function(e){var t=e.exportFormat,r=e.initialProperties,n=e.hypercubePath,o={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach(function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(o.qLayoutExclude.quarantine=w()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&n?i.setValue(o,"".concat(n,".qHyperCubeDef"),t.properties.qHyperCubeDef):r.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some(function(e){return"general"===e.key})}(t.properties,e)?o[e]=t.properties[e]:o.qLayoutExclude.disabled[e]=t.properties[e]}),null===(o=w()(!0,{},r,o)).components&&(o.components=[]),o},F=function(e){var t=e.exportFormat,r=e.maxDimensions,n=e.minDimensions,o=e.maxMeasures,i=e.minMeasures,a=t.data[0];return a.dimensions.length>r&&r>0||a.measures.length>o&&o>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>n||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>i||!o&&a.measures.length>0||!r&&a.dimensions.length>0},z=function(e){var t=e.exportFormat,r=e.maxDimensions,n=e.minDimensions,o=e.maxMeasures,i=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>r&&r>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>n)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>o&&o>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>i)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!o&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!r&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},W=function(e){var t,r=e.newProperties,n=e.dataDefinition,o=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var a=i.getValue(r,o||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return P(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 P(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?P(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qDimensions=[],s.forEach(function(e){a.qDimensions.push(e),n.dimensions.added(e,r)})}},$=function(e){var t,r=e.newProperties,n=e.dataDefinition,o=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var a=i.getValue(r,o||"").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 r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?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),n.measures.added(e,r)})}},H=function(e){var t=e.measures,r=e.modifierTypes;t&&r&&f().isSupportedModifiers(r)&&t.forEach(function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store})};function V(e,t){var r=i.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!r&&(Object.keys(r).forEach(function(t){i.setValue(e,t,r[t])}),delete e.qLayoutExclude.quarantine[t],!0)}const B={exportProperties:function(e){var t=e.propertyTree,r=e.hypercubePath,n=e.viewDataMode,o=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},r=0;r<e;++r)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=i.getValue(a,r||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),h({exportFormat:o,qHyperCubeDef:l}),m({exportFormat:o,qHyperCubeDef:l}),g({exportFormat:o,qHyperCubeDef:l}),delete l.qLayoutExclude,v({exportFormat:o,properties:a}),r&&(o.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),y({exportFormat:o,properties:a}),n||b(o.properties.qHyperCubeDef.qMeasures),Array.isArray(o.properties.filters)&&(x(o.properties,"filters","storedFilters",!0),delete o.properties.filters),o.properties.qHyperCubeDef.qContextSetExpression&&(x(o.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),o.properties.qHyperCubeDef.qContextSetExpression=""),o.properties.qHyperCubeDef.qDynamicScript&&o.properties.qHyperCubeDef.qDynamicScript.length&&(x(o.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),o.properties.qHyperCubeDef.qDynamicScript=[]),o},importProperties:function(e){var t=e.exportFormat,r=e.initialProperties,n=void 0===r?{}:r,o=e.dataDefinition,a=void 0===o?{}:o,s=e.defaultPropertyValues,l=void 0===s?{}:s,u=e.hypercubePath,c=e.extension,d=e.supportedFilters,p=void 0===d||d,f=e.isHCModifierSupported,h=void 0===f||f,m={qChildren:[]},g=j({exportFormat:t,initialProperties:n,hypercubePath:u}),v=i.getValue(n,u||"").qHyperCubeDef,y=i.getValue(g,u||"").qHyperCubeDef,b=N({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,S=b.minDimensions,w=b.maxMeasures,C=b.minMeasures,E=l.defaultDimension,I=void 0===E?k():E,D=l.defaultMeasure,P=void 0===D?O():D;y.qDimensions.length=0,y.qMeasures.length=0,F({exportFormat:t,maxDimensions:x,minDimensions:S,maxMeasures:w,minMeasures:C})&&z({exportFormat:t,maxDimensions:x,minDimensions:S,maxMeasures:w,minMeasures:C,newHyperCubeDef:y}),q({exportFormat:t,maxDimensions:x,minDimensions:S,newHyperCubeDef:y,defaultDimension:I}),T({exportFormat:t,maxMeasures:w,minMeasures:C,newHyperCubeDef:y,defaultMeasure:P}),W({newProperties:g,dataDefinition:a,hypercubePath:u}),$({newProperties:g,dataDefinition:a,hypercubePath:u}),_({exportFormat:t,newHyperCubeDef:y}),L("qMaxStackedCells",v,y),L("qNoOfLeftDims",v,y),A("qInitialDataFetch",v,y,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),A("qMode",v,y,"S"),A("qReductionMode",v,y,"N"),A("qSortbyYValue",v,y),A("qIndentMode",v,y),A("qShowTotalsAbove",v,y),M(g,t,n),m.qProperty=g;var R=i.getValue(c||{},"support.modifiers");return H({measures:y.qMeasures,modifierTypes:R}),p&&V(m.qProperty,"storedFilters"),"S"===y.qMode&&h&&V(m.qProperty,"dynamicScript"),m}};var G={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function U(e,t,r,n){t=t||[];var o=c(e,n,r),i=c(t,n,r);if(-1!==o&&-1===i){var a=e.splice(o,1);t.push(a[0])}return t}function 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 r={};return t&&Object.keys(t).forEach(function(e){r[e]=t[e]}),r.id=e,r.qAttribute=!0,r},moveByIdFromGroup:function(e,t,r,n,o){r=r||"qAttributeExpressions",o=o||"id";for(var i=0;i<e.length;i++){var a=e[i][r],s=t.length;if(U(a,t,n,o),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 i.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return i.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},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,r){if(Array.isArray(e[t])){var n=d.findIndexByPropertyValue(e[t],"id",r);n>=0&&e[t].splice(n,1)}else e[t]=[]}function te(e,t){var r=K.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach(function(e){ee(e,"qAttributeDimensions",r),ee(e,"qAttributeExpressions",r)}),t.forEach(function(e){ee(e,"qAttributeDimensions",r),ee(e,"qAttributeExpressions",r)})}function re(e,t){if(t){var r="="===t.charAt(0);e.color.altLabel=r?{qStringExpression:{qExpr:t.substr(1)}}:t}}function ne(e){var t=e.properties,r=e.isDimension,n=e.dimensions,o=e.excludedDimensions,a=e.measures,s=e.label;te(n,o);var l=n[n.length-1];if(l){var u=r?i.getValue(t,"color.byDimDef"):i.getValue(t,"color.byMeasureDef"),c=i.getValue(t,"color.formatting.qNumFormat"),p=i.getValue(t,"color.formatting.isCustomFormatted");if(u){var f=K.create(K.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,r=e.label,n=e.item,o=e.isDimension,i=e.qNumFormat,a=e.isCustomFormatted;t.label=r||n.label,o?t.qDef=n.key:(t.qExpression=n.key,i&&(t.qNumFormat=i,t.isCustomFormatted=a)),t.matchMeasure=n.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:s,item:u,isDimension:r,qNumFormat:c,isCustomFormatted:p});break;case"libraryItem":!function(e){var t=e.attributeExpression,r=e.measures,n=e.item,o=e.qNumFormat,i=e.isCustomFormatted;e.isDimension||(t.matchMeasure=d.findIndexByPropertyValue(r,"qLibraryId",n.key),o&&(t.qNumFormat=o,t.isCustomFormatted=i)),void 0!==n.expression?t.qExpression=n.expression:t.qLibraryId=n.key,t.colorMapRef=n.key}({attributeExpression:f,measures:a,item:u,isDimension:r,qNumFormat:c,isCustomFormatted:p})}r?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function oe(e,t,r,n){var o,i,a,s={};switch(e){case"dimension":r.qLibraryId?(s.type="dimension",s.name=r.qLibraryId,s.id=r.qLibraryId):(s.type="field",t?(s.name=r.label||r.qDef,s.id=r.qDef):(s.name=r.qDef.qFieldDefs[0],s.label=(a=r.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":o=function(e,t){return t?e.qLibraryId:f().measureBase.getLibraryId(e)}(r,t),o?(s.type="measure",s.name=o,s.id=o,i=function(e,t){return f().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(r,n),i&&(s.expression=i)):(s.type="expression",t?(s.name=r.label||r.qExpression,s.id=r.qExpression):(s.name=r.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(r)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}const ie={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,r,n){var o=t.type,i=e.color,a=i.mode,s=X.getItemLabel(t);switch(re(e,s||""),o){case"field":a="byDimension",i.byDimDef={label:t.label||X.wrapFieldName(t.name),key:X.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",i.byMeasureDef={label:s,key:t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",i.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",i.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},i.formatting&&ie.useMasterNumberFormat(i.formatting)}i.auto=!1,i.mode=a}function se(e,t){var r=i.getValue(e,"".concat(t,"qDimensions"),[]),n=i.getValue(e,"".concat(t,"qMeasures"),[]),o=i.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=i.getValue(e,"color.byDimDef");if(a&&re(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var r=i.getValue(e,"".concat(t,"qDimensions"),[]),n=i.getValue(e,"color.byDimDef");n.activeDimensionIndex=Math.min(n.activeDimensionIndex,r.length-1);var o=oe("dimension",!1,r[n.activeDimensionIndex]);o.activeDimensionIndex=n.activeDimensionIndex,ae(e,o)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var r=i.getValue(e,"".concat(t,"qDimensions"),[]),n=r[function(e,t,r){var n=i.getValue(t,"visualization"),o=r.split("."),a=Number(o[1]),s=i.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===n&&"point"===s}(r,e,t)?0:r.length-1],o=K.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(n.qAttributeDimensions,"id",o);return ae(e,oe("dimension",!!a,a||n)),!!a}(e,t))return;ne({properties:e,isDimension:!0,dimensions:r,excludedDimensions:o,measures:n,label:i.getValue(e,"color.byDimDef.label")})}const le=function(e,t,r){i.setValue(e,t,r),i.isAtomicValue(r)&&function(e,t,r){var n=e.qLayoutExclude;n&&(n.changed||(n.changed={}),n.changed[t]={from:i.getValue(e,t),to:r})}(e,t,r)},ue=function(e,t){var r={primary:!0};if(e){var n=(Q[t]||J).colorModeOptions||J.colorModeOptions;r.byDimension=n.dimension(e),r.byMeasure=n.measure(e),r.byMultiple=n.multiColor(e),r.byExpression=n.expression(e)}return r},ce=function(e){var t=e.canColorBy,r=e.autoColor,n=e.colorMode,o=e.dimensions;return!(t[n]&&!r&&("byDimension"!==n&&"byMeasure"!==n||!o.length))},de=function(e,t){var r,n=i.getValue(e,"color.mode"),o=i.getValue(e,"color.auto"),a=i.getValue(e,"".concat(t,"qDimensions"),[]),s=i.getValue(e,"".concat(t,"qMeasures"),[]),l=i.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);o?te(a,l):!(r={auto:o,colorMode:n,dimensions:a}).auto&&"byDimension"===r.colorMode&&r.dimensions.length>0?se(e,t):function(e){var t=e.auto,r=e.colorMode,n=e.dimensions,o=e.measures,a=e.properties,s=i.getValue(a,"visualization");return!(t||"byMeasure"!==r||!n.length||"map"!==s&&!o.length)}({auto:o,colorMode:n,dimensions:a,measures:s,properties:e})?function(e,t){var r=i.getValue(e,"".concat(t,"qDimensions"),[]),n=i.getValue(e,"".concat(t,"qMeasures"),[]),o=i.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=i.getValue(e,"color.byMeasureDef");if(a&&re(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var r=i.getValue(e,"".concat(t,"qMeasures"),[]),n=i.getValue(e,"color.byMeasureDef");if(n.activeMeasureIndex=Math.min(n.activeMeasureIndex,r.length-1),n.activeMeasureIndex>-1){var o=oe("measure",!1,r[n.activeMeasureIndex],!0);o.activeMeasureIndex=n.activeMeasureIndex,ae(e,o)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,n)&&function(e,t){var r=i.getValue(e,"".concat(t,"qDimensions"),[]),n=i.getValue(e,"".concat(t,"qMeasures"),[]),o=r[r.length-1],a=K.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(o.qAttributeExpressions,"id",a);return ae(e,oe("measure",!!s,s||n[0])),!!s}(e,t))return;ne({properties:e,isDimension:!1,dimensions:r,excludedDimensions:o,measures:n,label:i.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var r=i.getValue(e,"color.mode"),n=i.getValue(e,"".concat(t,"qDimensions"),[]),o=i.getValue(e,"".concat(t,"qMeasures"),[]),a=i.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===r&&o.length<2&&i.setValue(e,"color.mode","primary"),te(n,a)}(e,t)},pe=function(e){e.forEach(function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode})},fe=function(e){var t=e.shouldUpdateColorBy,r=e.properties,n=i.getValue(r,"qHyperCubeDef.qMeasures",[]),o=i.getValue(r,"color.mode","");return!t&&"byExpression"===o&&n.length>0},he=function(e){var t=i.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),r=i.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:r,id:"colorByExpression"}),i.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},me=function(e){i.setValue(e,"color.mode","primary"),i.setValue(e,"color.auto",!0)},ge=function(e){var t=i.getValue(e,"qHyperCubeDef.qDimensions",[]),r=i.getValue(e,"color.persistent",!1);return t.length>1&&!r},ve={exportProperties:function(e){var t=e.propertyTree,r=e.hypercubePath,n=e.viewDataMode,o=B.exportProperties({propertyTree:t,hypercubePath:r,viewDataMode:n}),i=o.data[0],a=i.dimensions.concat(i.excludedDimensions),s=i.measures.concat(i.excludedMeasures),l=K.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return K.moveByIdFromGroup(a,[],"qAttributeDimensions",u),K.moveByIdFromGroup(a,[],"qAttributeExpressions",u),K.moveByIdFromGroup(s,[],"qAttributeExpressions",c),o},importProperties:function(e){var t=e.exportFormat,r=e.initialProperties,n=e.dataDefinition,o=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=B.importProperties({exportFormat:t,initialProperties:r,dataDefinition:n,defaultPropertyValues:o,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty,p=i.getValue(d,"visualization"),f=i.getValue(d,"qHyperCubeDef.qDimensions",[]),h=i.getValue(d,"color.mode",""),m=i.getValue(d,"color.auto",""),g=ue(d,p),v=ce({canColorBy:g,autoColor:m,colorMode:h,dimensions:f});return g[h]?fe({shouldUpdateColorBy:v,properties:d})&&he(d):me(d),v&&de(d,"qHyperCubeDef."),ge(d)&&le(d,"color.persistent",!0),pe(f),c}};var ye=["bar","marker","line"];const be=function(e){var t=e.initialProperties,r=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?V(r,"unsupportedAutoMinMax")||w()(r.measureAxis,t.measureAxis):V(r,"supportedAutoMinMax")||w()(r.measureAxis,t.measureAxis)},xe=function(e){var t,r=e.exportFormat,n=e.initialProperties,o=e.properties,i=e.measureType,a=o.qHyperCubeDef,s=o.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:r,initialProperties:n})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach(function(e){if(e.qDef.series){var r=e.qDef.series,n=r.type,o=r.axis;t[o]||(t[o]={axis:o,type:{line:0,marker:0,bar:0,total:0}}),ye.includes(n)&&t[o].type[n]++,t[o].type.total++}}),t}(a);l.length?(i&&(t=l.filter(function(e){return e.type[i]>0}).sort(function(e,t){return t.type[i]-e.type[i]})),t&&t.length||(t=l.sort(function(e,t){return t.type.total-e.type.total})),t&&t[0]&&w()(s,r.properties.measureAxes[t[0].axis])):w()(s,r.properties.measureAxes[0])}},Se=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var r=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=r}}},we={exportProperties:function(e){var t=e.propertyTree,r=e.hypercubePath,n=e.viewDataMode,o=e.supportedAutoMinMax,i=void 0===o||o,a=ve.exportProperties({propertyTree:t,hypercubePath:r,viewDataMode:n}),s=a.properties;return i?(x(s,"measureAxis.min","supportedAutoMinMax"),x(s,"measureAxis.max","supportedAutoMinMax")):(x(s,"measureAxis.min","unsupportedAutoMinMax"),x(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,r=e.initialProperties,n=e.dataDefinition,o=e.defaultPropertyValues,i=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=ve.importProperties({exportFormat:t,initialProperties:r,dataDefinition:n,defaultPropertyValues:o,hypercubePath:i,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty;return be({initialProperties:r,properties:d}),xe({exportFormat:t,initialProperties:r,properties:d,measureType:a}),Se(d.qHyperCubeDef),d.qHyperCubeDef.qColumnOrder=[],d.qHyperCubeDef.columnOrder=[],c}};function Ce(e,t,r){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(r)}function Ee(e){var t=e.properties,r=e.arrayPath,n=e.quarantineName,o=e.arrayName,a=e.itemPath;i.getValue(t,r,[]).forEach(function(e){return function(e){var t=e.properties,r=e.quarantineName,n=e.arrayName,o=e.item,a=e.itemPath,s=i.getValue(o,a);if(void 0!==s){var l=i.getValue(o,"qDef.cId");l||(l=i.generateId(),i.setValue(o,"qDef.cId",l));var u=Ce(r,n,l);i.setValue(t,u,s),i.setValue(o,a,void 0)}}({properties:t,quarantineName:n,arrayName:o,item:e,itemPath:a})})}function Ie(e){var t=e.properties,r=e.arrayPath,n=e.quarantineName,o=e.arrayName,a=e.itemPath;i.getValue(t,r,[]).forEach(function(e){return function(e){var t=e.properties,r=e.quarantineName,n=e.arrayName,o=e.item,a=e.itemPath,s=i.getValue(o,"qDef.cId");if(s){var l=Ce(r,n,s),u=i.getValue(t,l);void 0!==u&&(i.setValue(o,a,u),i.setValue(t,l,void 0))}}({properties:t,quarantineName:n,arrayName:o,item:e,itemPath:a})})}var De="qHyperCubeDef.qMeasures",Pe="conditionalColoring",Re="measures",Me="qDef.conditionalColoring";const Le={quarantine:function(e){Ee({properties:e,arrayPath:De,quarantineName:Pe,arrayName:Re,itemPath:Me})},unquarantine:function(e){Ie({properties:e,arrayPath:De,itemPath:Me,arrayName:Re,quarantineName:Pe})}};var Ae="qHyperCubeDef.qMeasures",ke="measures",Oe="qHyperCubeDef.qDimensions",qe="dimensions",Te="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Ne="alternativeMeasures",_e="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",je="alternativeDimensions",Fe="qCalcCondition",ze="conditionalShowHide";const We={quarantine:function(e){Ee({properties:e,arrayPath:Ae,quarantineName:ze,arrayName:ke,itemPath:Fe}),Ee({properties:e,arrayPath:Oe,quarantineName:ze,arrayName:qe,itemPath:Fe})},unquarantine:function(e){Ie({properties:e,arrayPath:Ae,quarantineName:ze,arrayName:ke,itemPath:Fe}),Ie({properties:e,arrayPath:Oe,quarantineName:ze,arrayName:qe,itemPath:Fe})},quarantineAlternative:function(e){Ee({properties:e,arrayPath:Te,quarantineName:ze,arrayName:Ne,itemPath:Fe}),Ee({properties:e,arrayPath:_e,quarantineName:ze,arrayName:je,itemPath:Fe})},unquarantineAlternative:function(e){Ie({properties:e,arrayPath:Te,quarantineName:ze,arrayName:Ne,itemPath:Fe}),Ie({properties:e,arrayPath:_e,quarantineName:ze,arrayName:je,itemPath:Fe})}},$e={hypercube:B,colorChart:ve,axisChart:we,quarantineProperty:x,unquarantineProperty:V,quarantineArrayProp:Ee,unquarantineArrayProp:Ie,conditionalColoring:Le,conditionalShow:We}})(),n.default})()}(QN);var e_=En(QN.exports);const t_="qHyperCubeDef.qMeasures",r_="measures",n_="qHyperCubeDef.qDimensions",o_="dimensions",i_="qDef.representation",a_="tableRepresentation",s_="qDef.conditionalColoring",l_="conditionalColoring",u_="qMiniChartDef",c_="miniChartDef",d_=e=>{e_.unquarantineArrayProp({properties:e,arrayPath:n_,itemPath:i_,arrayName:o_,quarantineName:a_}),e_.unquarantineArrayProp({properties:e,arrayPath:t_,itemPath:i_,arrayName:r_,quarantineName:a_}),e_.unquarantineArrayProp({properties:e,arrayPath:t_,itemPath:s_,arrayName:r_,quarantineName:l_}),e_.unquarantineArrayProp({properties:e,arrayPath:t_,itemPath:u_,arrayName:r_,quarantineName:c_})},p_=e=>{e_.quarantineArrayProp({properties:e,arrayPath:n_,itemPath:i_,arrayName:o_,quarantineName:a_}),e_.quarantineArrayProp({properties:e,arrayPath:t_,itemPath:i_,arrayName:r_,quarantineName:a_}),e_.quarantineArrayProp({properties:e,arrayPath:t_,itemPath:s_,arrayName:r_,quarantineName:l_}),e_.quarantineArrayProp({properties:e,arrayPath:t_,itemPath:u_,arrayName:r_,quarantineName:c_})};function f_(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 h_(e){if("object"==typeof e&&f_(e))return(e.r<<16)+(e.g<<8)+e.b;let t=0,r=0,n=0;if("string"==typeof e){let o;(o=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(e))?(t=parseInt(o[1],10),r=parseInt(o[2],10),n=parseInt(o[3],10)):(o=/^#([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})$/i.exec(e))?(t=parseInt(o[1],16),r=parseInt(o[2],16),n=parseInt(o[3],16)):(o=/^#([A-Fa-f0-9])([A-Fa-f0-9])([A-Fa-f0-9])$/i.exec(e))&&(t=parseInt(o[1]+o[1],16),r=parseInt(o[2]+o[2],16),n=parseInt(o[3]+o[3],16))}return(t<<16)+(r<<8)+n}const m_={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 g_(...e){const t={type:"qcm-color",r:0,g:0,b:0,a:1,invalid:!1,spaces:{}};let r=0,n=0,o=0,i=1;if(null!==(a=e[0])&&"object"==typeof a&&"type"in a&&"qcm-color"===a.type)({r:r,g:n,b:o,a:i}=e[0]),t.invalid=e[0].invalid,t.spaces={...e[0].spaces};else if(f_(e[0]))({r:r,g:n,b:o}=e[0]),"a"in e[0]&&({a:i}=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))r=parseInt(s[1],10),n=parseInt(s[2],10),o=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))r=parseInt(s[1],10),n=parseInt(s[2],10),o=parseInt(s[3],10),i=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))i=parseInt(s[1],10)/255,r=parseInt(s[2],10),n=parseInt(s[3],10),o=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))r=parseInt(s[1],16),n=parseInt(s[2],16),o=parseInt(s[3],16),i=1;else if(s=/^#([A-Fa-f0-9])([A-Fa-f0-9])([A-Fa-f0-9])$/i.exec(a))r=parseInt(s[1]+s[1],16),n=parseInt(s[2]+s[2],16),o=parseInt(s[3]+s[3],16),i=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 u=e/60;const c=l*(1-Math.abs(u%2-1));let d=[];switch(u=Math.floor(u),u){case 0:d=[l,c,0];break;case 1:d=[c,l,0];break;case 2:d=[0,l,c];break;case 3:d=[0,c,l];break;case 4:d=[c,0,l];break;case 5:d=[l,0,c];break;default:d=[0,0,0]}const p=a-.5*l;r=d[0]+p,n=d[1]+p,o=d[2]+p,r=Math.round(255*r),n=Math.round(255*n),o=Math.round(255*o),i=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]);i=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 u=e/60;const c=l*(1-Math.abs(u%2-1));let d=[];switch(u=Math.floor(u),u){case 0:d=[l,c,0];break;case 1:d=[c,l,0];break;case 2:d=[0,l,c];break;case 3:d=[0,c,l];break;case 4:d=[c,0,l];break;case 5:d=[l,0,c];break;default:d=[0,0,0]}const p=a-.5*l;r=d[0]+p,n=d[1]+p,o=d[2]+p,r=Math.round(255*r),n=Math.round(255*n),o=Math.round(255*o)}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 u=e/60;const c=l*(1-Math.abs(u%2-1));let d=[];switch(u=Math.floor(u),u){case 0:d=[l,c,0];break;case 1:d=[c,l,0];break;case 2:d=[0,l,c];break;case 3:d=[0,c,l];break;case 4:d=[c,0,l];break;case 5:d=[l,0,c];break;default:d=[0,0,0]}const p=a-l;r=d[0]+p,n=d[1]+p,o=d[2]+p,r=Math.round(255*r),n=Math.round(255*n),o=Math.round(255*o),i=1}else{const e=a.toLowerCase();if(function(e){return e in m_}(e)){const t=m_[e];({r:r,g:n,b:o}=t),i="a"in t?t.a:1}else t.invalid=!0}}else"number"==typeof e[0]&&e[0]>=0&&"argb"===e[1]?(i=(4278190080&e[0])>>>24,i/=255,r=(16711680&e[0])>>16,n=(65280&e[0])>>8,o=255&e[0]):"number"==typeof e[0]&&e[0]>=0?(r=(16711680&e[0])>>16,n=(65280&e[0])>>8,o=255&e[0]):t.invalid=!0;else 3===e.length||4===e.length?(r=e[0],n=e[1],o=e[2],i=4===e.length?e[3]:1):t.invalid=!0;var a;return Number.isNaN(+r+n+o+i)&&(t.invalid=!0),t.r=Math.floor(r),t.g=Math.floor(n),t.b=Math.floor(o),t.a=i,t}function v_(e){let t,r,n;if(f_(e))return t=e.r.toString(16),r=e.g.toString(16),n=e.b.toString(16),1===t.length&&(t=`0${t}`),1===r.length&&(r=`0${r}`),1===n.length&&(n=`0${n}`),`#${[t,r,n].join("")}`;const o="string"==typeof e?h_(e):e;return t=((16711680&o)>>16).toString(16),r=((65280&o)>>8).toString(16),n=(255&o).toString(16),1===t.length&&(t=`0${t}`),1===r.length&&(r=`0${r}`),1===n.length&&(n=`0${n}`),`#${t}${r}${n}`}function y_(e){let t,r,n=0;const o="string"==typeof e?g_(e):e,i=o.r/255,a=o.g/255,s=o.b/255,{a:l}=o,u=Math.max(i,a,s),c=Math.min(i,a,s),d=(u+c)/2;if(u===c)t=0,n=0;else{switch(r=u-c,t=d>.5?r/(2-u-c):r/(u+c),u){case i:n=(a-s)/r+(a<s?6:0);break;case a:n=(s-i)/r+2;break;case s:n=(i-a)/r+4}n/=6}return{h:360*n,s:100*t,l:100*d,a:l}}function b_(e){let t,r,n=0;const o="string"==typeof e?g_(e):e,i=o.r/255,a=o.g/255,s=o.b/255,l=Math.max(i,a,s),u=Math.min(i,a,s),c=l;if(l===u)t=0,n=0;else{switch(r=l-u,t=0===r?0:r/c,l){case i:n=(a-s)/r+(a<s?6:0);break;case a:n=(s-i)/r+2;break;case s:n=(i-a)/r+4}n/=6}return{h:360*n%360,s:100*t,v:100*c}}function x_(e){if(f_(e))return`rgb(${e.r}, ${e.g}, ${e.b})`;const t="string"==typeof e?h_(e):e;return`rgb(${(16711680&t)>>16}, ${(65280&t)>>8}, ${255&t})`}function S_(e,t){return f_(e)?`rgba(${e.r}, ${e.g}, ${e.b}, ${e.a})`:S_(g_(e))}function w_(e){return f_(e)?1===e.a?x_(e):S_(e):w_(g_(e))}const C_=e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};function E_(e){return.2126*C_(e.r)+.7152*C_(e.g)+.0722*C_(e.b)}function I_(...e){const t=g_(...e);return t.invalid||E_(t)<.4}function D_(...e){const t=g_(...e),r={type:t.type,r:t.r,g:t.g,b:t.b,a:t.a,invalid:t.invalid,spaces:t.spaces},n=()=>(r.spaces.hslaObject||(r.spaces.hslaObject=y_(r)),r.spaces.hslaObject),o=e=>{const t=n(),{h:r,s:o,l:i,a:a}=t;return`hsla(${r}, ${o}, ${Math.max(0,Math.min(i+e,100))}, ${a})`};return{get type(){return r.type},isInvalid:()=>r.invalid,get r(){return r.r},get g(){return r.g},get b(){return r.b},get a(){return r.a},getR:()=>r.r,getG:()=>r.g,getB:()=>r.b,getAlpha:()=>r.a,setAlpha:e=>{r.a=e,r.spaces={}},isEqualTo:e=>{let t;if("string"==typeof e)t=g_(e);else{if(e.type!==r.type)return!1;t=e}return t.r===r.r&&t.g===r.g&&t.b===r.b&&t.a===r.a},isDark:()=>I_(r),getRGB:()=>(r.spaces.rgb||(r.spaces.rgb=x_(r)),r.spaces.rgb),getRGBA:()=>(r.spaces.rgba||(r.spaces.rgba=S_(r)),r.spaces.rgba),getString:()=>(r.spaces.string||(r.spaces.string=w_(r)),r.spaces.string),getHex:()=>(r.spaces.hex||(r.spaces.hex=v_(r)),r.spaces.hex),getHSL:()=>(r.spaces.hsl||(r.spaces.hsl=function(e){let t,r,n=0;const o="string"==typeof e?g_(e):e,i=o.r/255,a=o.g/255,s=o.b/255,l=Math.max(i,a,s),u=Math.min(i,a,s),c=(l+u)/2;if(l===u)t=0,n=0;else{switch(r=l-u,t=c>.5?r/(2-l-u):r/(l+u),l){case i:n=(a-s)/r+(a<s?6:0);break;case a:n=(s-i)/r+2;break;case s:n=(i-a)/r+4}n/=6}return`hsl(${360*n}, ${100*t}, ${100*c})`}(r)),r.spaces.hsl),getHSLA:()=>(r.spaces.hsla||(r.spaces.hsla=function(e){const{h:t,s:r,l:n,a:o}=y_(e);return`hsla(${t}, ${r}, ${n}, ${o})`}(r)),r.spaces.hsla),getHSLAObject:n,getShiftedHSLA:o,getHSV:()=>(r.spaces.hsv||(r.spaces.hsv=function(e){const{h:t,s:r,v:n}=b_(e);return`hsv(${t}, ${r}, ${n})`}(r)),r.spaces.hsv),getHSVObject:()=>(r.spaces.hsvObject||(r.spaces.hsvObject=b_(r)),r.spaces.hsvObject),blend:(e,t)=>`rgba(${Math.floor(r.r+(e.r-r.r)*t)}, ${Math.floor(r.g+(e.g-r.g)*t)}, ${Math.floor(r.b+(e.b-r.b)*t)}, ${Math.floor(r.a+(e.getAlpha()-r.a)*t)})`,getBrightenedColor:(e=1)=>D_(o(18*e)),getDarkenedColor:(e=1)=>D_(o(18*-e))}}function P_(e,t){if(!e||!t)return;const r=E_(e),n=E_(t);return r>n?(r+.05)/(n+.05):(n+.05)/(r+.05)}function R_(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var M_,L_="top",A_="top-right",k_="right",O_="bottom-right",q_="bottom",T_="bottom-left",N_="left",__="top-left";R_(R_(R_(R_(R_(R_(R_(R_(R_(R_(M_={},"equal-equal",[L_,q_]),"equal-higher",[q_,O_]),"equal-lower",[L_,A_]),"equal-void",[L_,q_]),"higher-equal",[N_,T_,L_,A_]),"higher-higher-acute",[q_,T_,N_,A_]),"higher-higher-obtuse",[q_,L_]),"higher-lower-negative",[L_,A_,k_]),"higher-lower-positive",[q_,T_,N_]),"higher-void",[L_]),R_(R_(R_(R_(R_(R_(R_(R_(R_(R_(M_,"lower-equal",[L_]),"lower-higher-negative",[L_,__]),"lower-higher-positive",[O_]),"lower-lower-acute",[L_,__,N_,A_,k_]),"lower-lower-obtuse",[L_,q_]),"lower-void",[L_]),"void-equal",[L_]),"void-higher",[L_,q_]),"void-lower",[L_,q_,N_]),"void-void",[L_]),R_(M_,"unclassified",[L_,q_,k_,N_,A_,O_,T_,__]);var j_,F_,z_=["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"],W_=["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 $_(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?W_:z_}var H_=function(){if(F_)return j_;F_=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},i=function(r){if(!r||"[object Object]"!==t.call(r))return!1;var n,o=e.call(r,"constructor"),i=r.constructor&&r.constructor.prototype&&e.call(r.constructor.prototype,"isPrototypeOf");if(r.constructor&&!o&&!i)return!1;for(n in r);return void 0===n||e.call(r,n)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,r){if("__proto__"===r){if(!e.call(t,r))return;if(n)return n(t,r).value}return t[r]};return j_=function e(){var t,r,n,l,u,c,d=arguments[0],p=1,f=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<f;++p)if(null!=(t=arguments[p]))for(r in t)n=s(d,r),d!==(l=s(t,r))&&(h&&l&&(i(l)||(u=o(l)))?(u?(u=!1,c=n&&o(n)?n:[]):c=n&&i(n)?n:{},a(d,{name:r,newValue:e(h,c,l)})):void 0!==l&&a(d,{name:r,newValue:l}));return d},j_}();function V_(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function B_(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function G_(){}!function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}(H_);var U_=1/.7,Y_="\\s*([+-]?\\d+)\\s*",K_="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",X_="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",J_=/^#([0-9a-f]{3,8})$/,Z_=new RegExp(`^rgb\\(${Y_},${Y_},${Y_}\\)$`),Q_=new RegExp(`^rgb\\(${X_},${X_},${X_}\\)$`),ej=new RegExp(`^rgba\\(${Y_},${Y_},${Y_},${K_}\\)$`),tj=new RegExp(`^rgba\\(${X_},${X_},${X_},${K_}\\)$`),rj=new RegExp(`^hsl\\(${K_},${X_},${X_}\\)$`),nj=new RegExp(`^hsla\\(${K_},${X_},${X_},${K_}\\)$`),oj={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 ij(){return this.rgb().formatHex()}function aj(){return this.rgb().formatRgb()}function sj(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=J_.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?lj(t):3===r?new pj(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?uj(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?uj(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 pj(t[1],t[2],t[3],1):(t=Q_.exec(e))?new pj(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ej.exec(e))?uj(t[1],t[2],t[3],t[4]):(t=tj.exec(e))?uj(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=rj.exec(e))?yj(t[1],t[2]/100,t[3]/100,1):(t=nj.exec(e))?yj(t[1],t[2]/100,t[3]/100,t[4]):oj.hasOwnProperty(e)?lj(oj[e]):"transparent"===e?new pj(NaN,NaN,NaN,0):null}function lj(e){return new pj(e>>16&255,e>>8&255,255&e,1)}function uj(e,t,r,n){return n<=0&&(e=t=r=NaN),new pj(e,t,r,n)}function cj(e){return e instanceof G_||(e=sj(e)),e?new pj((e=e.rgb()).r,e.g,e.b,e.opacity):new pj}function dj(e,t,r,n){return 1===arguments.length?cj(e):new pj(e,t,r,null==n?1:n)}function pj(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function fj(){return`#${vj(this.r)}${vj(this.g)}${vj(this.b)}`}function hj(){const e=mj(this.opacity);return`${1===e?"rgb(":"rgba("}${gj(this.r)}, ${gj(this.g)}, ${gj(this.b)}${1===e?")":`, ${e})`}`}function mj(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function gj(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function vj(e){return((e=gj(e))<16?"0":"")+e.toString(16)}function yj(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new xj(e,t,r,n)}function bj(e){if(e instanceof xj)return new xj(e.h,e.s,e.l,e.opacity);if(e instanceof G_||(e=sj(e)),!e)return new xj;if(e instanceof xj)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,o=Math.min(t,r,n),i=Math.max(t,r,n),a=NaN,s=i-o,l=(i+o)/2;return s?(a=t===i?(r-n)/s+6*(r<n):r===i?(n-t)/s+2:(t-r)/s+4,s/=l<.5?i+o:2-i-o,a*=60):s=l>0&&l<1?0:a,new xj(a,s,l,e.opacity)}function xj(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function Sj(e){return(e=(e||0)%360)<0?e+360:e}function wj(e){return Math.max(0,Math.min(1,e||0))}function Cj(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}V_(G_,sj,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ij,formatHex:ij,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return bj(this).formatHsl()},formatRgb:aj,toString:aj}),V_(pj,dj,B_(G_,{brighter(e){return e=null==e?U_:Math.pow(U_,e),new pj(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new pj(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new pj(gj(this.r),gj(this.g),gj(this.b),mj(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:fj,formatHex:fj,formatHex8:function(){return`#${vj(this.r)}${vj(this.g)}${vj(this.b)}${vj(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:hj,toString:hj})),V_(xj,function(e,t,r,n){return 1===arguments.length?bj(e):new xj(e,t,r,null==n?1:n)},B_(G_,{brighter(e){return e=null==e?U_:Math.pow(U_,e),new xj(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new xj(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,o=2*r-n;return new pj(Cj(e>=240?e-240:e+120,o,n),Cj(e,o,n),Cj(e<120?e+240:e-120,o,n),this.opacity)},clamp(){return new xj(Sj(this.h),wj(this.s),wj(this.l),mj(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=mj(this.opacity);return`${1===e?"hsl(":"hsla("}${Sj(this.h)}, ${100*wj(this.s)}%, ${100*wj(this.l)}%${1===e?")":`, ${e})`}`}}));const Ej=Math.PI/180,Ij=180/Math.PI,Dj=4/29,Pj=6/29,Rj=3*Pj*Pj;function Mj(e){if(e instanceof Lj)return new Lj(e.l,e.a,e.b,e.opacity);if(e instanceof Tj)return Nj(e);e instanceof pj||(e=cj(e));var t,r,n=qj(e.r),o=qj(e.g),i=qj(e.b),a=Aj((.2225045*n+.7168786*o+.0606169*i)/1);return n===o&&o===i?t=r=a:(t=Aj((.4360747*n+.3850649*o+.1430804*i)/.96422),r=Aj((.0139322*n+.0971045*o+.7141733*i)/.82521)),new Lj(116*a-16,500*(t-a),200*(a-r),e.opacity)}function Lj(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function Aj(e){return e>.008856451679035631?Math.pow(e,1/3):e/Rj+Dj}function kj(e){return e>Pj?e*e*e:Rj*(e-Dj)}function Oj(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function qj(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Tj(e,t,r,n){this.h=+e,this.c=+t,this.l=+r,this.opacity=+n}function Nj(e){if(isNaN(e.h))return new Lj(e.l,0,0,e.opacity);var t=e.h*Ej;return new Lj(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}V_(Lj,function(e,t,r,n){return 1===arguments.length?Mj(e):new Lj(e,t,r,null==n?1:n)},B_(G_,{brighter(e){return new Lj(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Lj(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return new pj(Oj(3.1338561*(t=.96422*kj(t))-1.6168667*(e=1*kj(e))-.4906146*(r=.82521*kj(r))),Oj(-.9787684*t+1.9161415*e+.033454*r),Oj(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}})),V_(Tj,function(e,t,r,n){return 1===arguments.length?function(e){if(e instanceof Tj)return new Tj(e.h,e.c,e.l,e.opacity);if(e instanceof Lj||(e=Mj(e)),0===e.a&&0===e.b)return new Tj(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Ij;return new Tj(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Tj(e,t,r,null==n?1:n)},B_(G_,{brighter(e){return new Tj(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Tj(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Nj(this).rgb()}}));var _j=e=>()=>e;function jj(e,t){var r=t-e;return r?function(e,t){return function(r){return e+r*t}}(e,r):_j(isNaN(e)?t:e)}!function e(t){var r=function(e){return 1==(e=+e)?jj:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):_j(isNaN(t)?r:t)}}(t);function n(e,t){var n=r((e=dj(e)).r,(t=dj(t)).r),o=r(e.g,t.g),i=r(e.b,t.b),a=jj(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=o(t),e.b=i(t),e.opacity=a(t),e+""}}return n.gamma=e,n}(1);var Fj="center",zj="bottom";[{key:"NoDataExist",alignment:Fj,condition:function(e){var t=e.layoutService;if(!t)return!1;var r=t.meta.size;return r.x*r.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:Fj,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:Fj,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var r=t.getHyperCubeValue("qDimensionInfo.0");return r&&(r.qMax<r.qMin||"NaN"===r.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:Fj},{key:"DataRangeIncludingZero",alignment:zj},{key:"LimitedData",alignment:zj},{key:"NegativeOrZeroValues",alignment:zj}].reduce(function(e,t){return e[t.key]=t,e},{});var Wj,$j=["__proto__","constructor"];function Hj(e,t,r){if(void 0!==e&&void 0!==t){var n=t.split("."),o=n[n.length-1];if(!$j.some(function(e){return n.includes(e)})){for(var i=e,a=0;a<n.length-1;++a){var s=n[a];void 0===i[s]&&(i[s]=Number.isNaN(+n[a+1])?{}:[]),i=i[s]}void 0!==r?i[o]=r:delete i[o]}}}function Vj(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e},r=function(){var e={};return{get:function(t){return e[t]},set:function(t,r){return e[t]=r,r},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}();return function(n){var o=t(n);return r.has(o)?r.get(o):r.set(o,e(n))}}function Bj(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return function(){for(var n=this,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];clearTimeout(t),t=setTimeout(function(){return e.apply(n,i)},r)}}function Gj(e){var t=0,r=e.children,n=r&&r.length;if(n)for(;--n>=0;)t+=r[n].value;else t=1;e.value=t}function Uj(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Kj)):void 0===t&&(t=Yj);for(var r,n,o,i,a,s=new Zj(e),l=[s];r=l.pop();)if((o=t(r.data))&&(a=(o=Array.from(o)).length))for(r.children=o,i=a-1;i>=0;--i)l.push(n=o[i]=new Zj(o[i])),n.parent=r,n.depth=r.depth+1;return s.eachBefore(Jj)}function Yj(e){return e.children}function Kj(e){return Array.isArray(e)?e[1]:null}function Xj(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Jj(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Zj(e){this.data=e,this.depth=this.height=0,this.parent=null}function Qj(e){const{translator:t}=e;return{targets:[{path:"/qHyperCubeDef",dimensions:{min:1,max:1e3,description(e,r,n){const o="rows"===n?.type?"Visualizations.Descriptions.Row":"Visualizations.Descriptions.Column";return t.get(o)}},measures:{min:1,max:1e3,description:()=>t.get("Visualizations.Descriptions.Values")},filters:{description:()=>t.get("SimpleProperties.Filters.Filter")}}]}}Zj.prototype=Uj.prototype={constructor:Zj,count:function(){return this.eachAfter(Gj)},each:function(e,t){let r=-1;for(const n of this)e.call(t,n,++r,this);return this},eachAfter:function(e,t){for(var r,n,o,i=this,a=[i],s=[],l=-1;i=a.pop();)if(s.push(i),r=i.children)for(n=0,o=r.length;n<o;++n)a.push(r[n]);for(;i=s.pop();)e.call(t,i,++l,this);return this},eachBefore:function(e,t){for(var r,n,o=this,i=[o],a=-1;o=i.pop();)if(e.call(t,o,++a,this),r=o.children)for(n=r.length-1;n>=0;--n)i.push(r[n]);return this},find:function(e,t){let r=-1;for(const n of this)if(e.call(t,n,++r,this))return n},sum:function(e){return this.eachAfter(function(t){for(var r=+e(t.data)||0,n=t.children,o=n&&n.length;--o>=0;)r+=n[o].value;t.value=r})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(e){for(var t=this,r=function(e,t){if(e===t)return e;var r=e.ancestors(),n=t.ancestors(),o=null;for(e=r.pop(),t=n.pop();e===t;)o=e,e=r.pop(),t=n.pop();return o}(t,e),n=[t];t!==r;)t=t.parent,n.push(t);for(var o=n.length;e!==r;)n.splice(o,0,e),e=e.parent;return n},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,t=[];return e.each(function(r){r!==e&&t.push({source:r.parent,target:r})}),t},copy:function(){return Uj(this).eachBefore(Xj)},[Symbol.iterator]:function*(){var e,t,r,n,o=this,i=[o];do{for(e=i.reverse(),i=[];o=e.pop();)if(yield o,t=o.children)for(r=0,n=t.length;r<n;++r)i.push(t[r])}while(i.length)}},Wj=function(e){
100
+ */var mS,gS,vS={},yS={};function bS(){if(mS)return yS;mS=1;var e=Va;Object.defineProperty(yS,"__esModule",{value:!0}),yS.default=void 0;var t=(0,e(dv()).default)();return yS.default=t,yS}var xS,SS,wS={},CS={};function ES(){if(SS)return wS;SS=1;var e=Va;Object.defineProperty(wS,"__esModule",{value:!0}),wS.default=function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=o.breakpoints,a=void 0===i?["sm","md","lg"]:i,s=o.disableAlign,l=void 0!==s&&s,u=o.factor,c=void 0===u?2:u,d=o.variants,p=void 0===d?["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","caption","button","overline"]:d,f=(0,t.default)({},e);f.typography=(0,t.default)({},f.typography);var h=f.typography,m=(0,n.convertLength)(h.htmlFontSize),g=a.map(function(e){return f.breakpoints.values[e]});return p.forEach(function(e){var o=h[e],i=parseFloat(m(o.fontSize,"rem"));if(!(i<=1)){var a=i,s=1+(a-1)/c,u=o.lineHeight;if(!(0,n.isUnitless)(u)&&!l)throw new Error((0,r.formatMuiErrorMessage)(6));(0,n.isUnitless)(u)||(u=parseFloat(m(u,"rem"))/parseFloat(i));var d=null;l||(d=function(e){return(0,n.alignProperty)({size:e,grid:(0,n.fontGrid)({pixels:4,lineHeight:u,htmlFontSize:h.htmlFontSize})})}),h[e]=(0,t.default)({},o,(0,n.responsiveProperty)({cssProperty:"fontSize",min:s,max:a,unit:"rem",breakpoints:g,transform:d}))}}),f};var t=e(Ns()),r=wh,n=function(){if(xS)return CS;xS=1;var e=Va;Object.defineProperty(CS,"__esModule",{value:!0}),CS.isUnitless=function(e){return String(parseFloat(e)).length===String(e).length},CS.getUnit=r,CS.toUnitless=n,CS.convertLength=function(e){return function(t,o){var i=r(t);if(i===o)return t;var a=n(t);if("px"!==i)if("em"===i)a=n(t)*n(e);else if("rem"===i)return a=n(t)*n(e),t;var s=a;if("px"!==o)if("em"===o)s=a/n(e);else{if("rem"!==o)return t;s=a/n(e)}return parseFloat(s.toFixed(5))+o}},CS.alignProperty=function(e){var t=e.size,r=e.grid,n=t-t%r,o=n+r;return t-n<o-t?n:o},CS.fontGrid=function(e){var t=e.lineHeight;return e.pixels/(t*e.htmlFontSize)},CS.responsiveProperty=function(e){var r=e.cssProperty,n=e.min,o=e.max,i=e.unit,a=void 0===i?"rem":i,s=e.breakpoints,l=void 0===s?[600,960,1280]:s,u=e.transform,c=void 0===u?null:u,d=(0,t.default)({},r,"".concat(n).concat(a)),p=(o-n)/l[l.length-1];return l.forEach(function(e){var o=n+p*e;null!==c&&(o=c(o)),d["@media (min-width:".concat(e,"px)")]=(0,t.default)({},r,"".concat(Math.round(1e4*o)/1e4).concat(a))}),d};var t=e($h());function r(e){return String(e).match(/[\d.\-+]*\s*(.*)/)[1]||""}function n(e){return parseFloat(e)}return CS}();return wS}var IS,DS={};var PS,RS={};var MS,LS={};var AS,kS={};!function(e){var t=Va,n=Af;Object.defineProperty(e,"__esModule",{value:!0});var o={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 u.default}}),Object.defineProperty(e,"responsiveFontSizes",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"styled",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"useTheme",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"withStyles",{enumerable:!0,get:function(){return h.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 i=kf;Object.keys(i).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(o,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return i[t]}}))});var a=n(dv()),s=t(function(){if(pv)return fv;pv=1;var e=Va;Object.defineProperty(fv,"__esModule",{value:!0}),fv.default=function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return r.default.apply(void 0,[(0,t.deepmerge)({unstable_strictMode:!0},e)].concat(o))};var t=wh,r=e(dv());return fv}()),l=t(function(){if(dS)return hv;dS=1,Object.defineProperty(hv,"__esModule",{value:!0}),hv.default=function(t){return(0,e.createStyles)(t)};var e=hS;return hv}()),u=t(function(){if(gS)return vS;gS=1;var e=Va;Object.defineProperty(vS,"__esModule",{value:!0}),vS.default=void 0;var t=e(Ns()),r=hS,n=e(bS()),o=function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,r.makeStyles)(e,(0,t.default)({defaultTheme:n.default},o))};return vS.default=o,vS}()),c=t(ES()),d=t(function(){if(IS)return DS;IS=1;var e=Va;Object.defineProperty(DS,"__esModule",{value:!0}),DS.default=void 0;var t=e(Ns()),r=hS,n=e(bS()),o=function(e){var o=(0,r.styled)(e);return function(e,r){return o(e,(0,t.default)({defaultTheme:n.default},r))}};return DS.default=o,DS}()),p=sv();Object.keys(p).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(o,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return p[t]}}))});var f=t(function(){if(PS)return RS;PS=1;var e=Va;Object.defineProperty(RS,"__esModule",{value:!0}),RS.default=function(){return(0,t.useTheme)()||n.default};var t=hS;e(r);var n=e(bS());return RS}()),h=t(function(){if(MS)return LS;MS=1;var e=Va;Object.defineProperty(LS,"__esModule",{value:!0}),LS.default=void 0;var t=e(Ns()),r=hS,n=e(bS()),o=function(e,o){return(0,r.withStyles)(e,(0,t.default)({defaultTheme:n.default},o))};return LS.default=o,LS}()),m=t(function(){if(AS)return kS;AS=1;var e=Va;Object.defineProperty(kS,"__esModule",{value:!0}),kS.default=void 0;var t=hS,r=e(bS()),n=(0,t.withThemeCreator)({defaultTheme:r.default});return kS.default=n,kS}()),g=hS}(Pf),Pf.alpha(tf.GREYSCALE_0,.05),Pf.alpha(tf.GREEN_PALE,.5),Pf.alpha(tf.BLUE_PALE,.5),Pf.alpha(tf.GREEN_PALE,.5),Pf.alpha(tf.BLUE_PALE,.5),Pf.alpha(tf.GREEN_PALE,.5),Pf.alpha(tf.BLUE_PALE,.5),Pf.alpha(tf.GREEN_PALE,.5),Pf.alpha(tf.BLUE_PALE,.5),Pf.alpha(tf.GREEN_PALE,.5),Pf.alpha(tf.BLUE_PALE,.5);const OS=(e="light",t=!1)=>If(0,t);function qS(e){return"init"in e}function TS(e){return!!e.write}function NS(e){return"v"in e||"e"in e}function _S(e){if("e"in e)throw e.e;if("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v}function jS(e){return"function"==typeof(null==e?void 0:e.then)}function FS(e,t,r){if(!r.p.has(e)){r.p.add(e);const n=()=>r.p.delete(e);t.then(n,n)}}function zS(e,t,r){var n;const o=new Set;for(const t of(null==(n=r.get(e))?void 0:n.t)||[])o.add(t);for(const e of t.p)o.add(e);return o}const WS=()=>{const e={},t=new WeakMap,r=r=>{var n,o;null==(n=t.get(e))||n.forEach(e=>e(r)),null==(o=t.get(r))||o.forEach(e=>e())};return r.add=(r,n)=>{const o=r||e;let i=t.get(o);return i||(i=new Set,t.set(o,i)),i.add(n),()=>{i.delete(n),i.size||t.delete(o)}},r};function $S(e){return e.i||(e.i=WS()),e.r||(e.r=WS()),e.c||(e.c=WS()),e.m||(e.m=WS()),e.u||(e.u=WS()),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 HS=(e,t,...r)=>t.read(...r),VS=(e,t,...r)=>t.write(...r),BS=(e,t)=>{var r;return null==(r=t.INTERNAL_onInit)?void 0:r.call(t,e)},GS=(e,t,r)=>{var n;return null==(n=t.onMount)?void 0:n.call(t,r)},US=(e,r)=>{var n;const o=cw(e),i=o[0],a=o[6],s=o[9];if("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&!r)throw new Error("Atom is undefined or null");let l=i.get(r);return l||(l={d:new Map,p:new Set,n:0},i.set(r,l),null==(n=a.i)||n.call(a,r),null==s||s(e,r)),l},YS=e=>{const t=cw(e),r=t[1],n=t[3],o=t[4],i=t[5],a=t[6],s=t[13],l=[],u=e=>{try{e()}catch(e){l.push(e)}};do{a.f&&u(a.f);const t=new Set,l=t.add.bind(t);n.forEach(e=>{var t;return null==(t=r.get(e))?void 0:t.l.forEach(l)}),n.clear(),i.forEach(l),i.clear(),o.forEach(l),o.clear(),t.forEach(u),n.size&&s(e)}while(n.size||i.size||o.size);if(l.length)throw new AggregateError(l)},KS=e=>{const r=cw(e),n=r[1],o=r[2],i=r[3],a=r[11],s=r[14],l=r[17],u=[],c=new WeakSet,d=new WeakSet,p=Array.from(i);for(;p.length;){const r=p[p.length-1],i=a(e,r);if(d.has(r))p.pop();else if(c.has(r)){if(o.get(r)===i.n)u.push([r,i]);else if("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&o.has(r))throw new Error("[Bug] invalidated atom exists");d.add(r),p.pop()}else{c.add(r);for(const e of zS(r,i,n))c.has(e)||p.push(e)}}for(let t=u.length-1;t>=0;--t){const[r,n]=u[t];let a=!1;for(const e of n.d.keys())if(e!==r&&i.has(e)){a=!0;break}a&&(o.set(r,n.n),s(e,r),l(e,r)),o.delete(r)}},XS=new WeakSet,JS=(e,r)=>{var n,o;const i=cw(e),a=i[1],s=i[2],l=i[3],u=i[6],c=i[7],d=i[11],p=i[12],f=i[13],h=i[14],m=i[16],g=i[17],v=i[20],y=i[26],b=d(e,r);if(NS(b)){if(a.has(r)&&s.get(r)!==b.n)return b;let t=!1;for(const[r,n]of b.d)if(h(e,r).n!==n){t=!0;break}if(!t)return b}let x=!0;const S=new Set(b.d.keys()),w=new Map,C=()=>{for(const e of S)w.has(e)||b.d.delete(e)},E=()=>{if(a.has(r)){const t=!l.size;g(e,r),t&&(f(e),p(e))}},I=t=>{var n;if(t===r){const r=d(e,t);if(!NS(r)){if(!qS(t))throw new Error("no atom init");v(e,t,t.init)}return _S(r)}const o=h(e,t);try{return _S(o)}finally{w.set(t,o.n),b.d.set(t,o.n),jS(b.v)&&FS(r,b.v,o),a.has(r)&&(null==(n=a.get(t))||n.t.add(r)),x||E()}};let D,P;const R={get signal(){return D||(D=new AbortController),D.signal},get setSelf(){return"production"!==(t.meta.env?t.meta.env.MODE:void 0)&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),"production"===(t.meta.env?t.meta.env.MODE:void 0)||TS(r)||console.warn("setSelf function cannot be used with read-only atom"),!P&&TS(r)&&(P=(...n)=>{if("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&x&&console.warn("setSelf function cannot be called in sync"),!x)try{return m(e,r,...n)}finally{f(e),p(e)}}),P}},M=b.n,L=s.get(r)===M;try{"production"!==(t.meta.env?t.meta.env.MODE:void 0)&&XS.delete(e);const o=c(e,r,I,R);if("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&XS.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),v(e,r,o),jS(o)){y(e,o,()=>null==D?void 0:D.abort());const t=()=>{C(),E()};o.then(t,t)}else C();return null==(n=u.r)||n.call(u,r),b}catch(e){return delete b.v,b.e=e,++b.n,b}finally{x=!1,b.n!==M&&L&&(s.set(r,b.n),l.add(r),null==(o=u.c)||o.call(u,r))}},ZS=(e,t)=>{const r=cw(e),n=r[1],o=r[2],i=r[11],a=[t];for(;a.length;){const t=a.pop(),r=i(e,t);for(const s of zS(t,r,n)){const t=i(e,s);o.get(s)!==t.n&&(o.set(s,t.n),a.push(s))}}},QS=(e,r,...n)=>{const o=cw(e),i=o[3],a=o[6],s=o[8],l=o[11],u=o[12],c=o[13],d=o[14],p=o[15],f=o[16],h=o[17],m=o[20];let g=!0;const v=t=>_S(d(e,t)),y=(n,...o)=>{var s;const d=l(e,n);try{if(n===r){if(!qS(n))throw new Error("atom not writable");"production"!==(t.meta.env?t.meta.env.MODE:void 0)&&XS.add(e);const r=d.n,l=o[0];return m(e,n,l),h(e,n),void(r!==d.n&&(i.add(n),p(e,n),null==(s=a.c)||s.call(a,n)))}return f(e,n,...o)}finally{g||(c(e),u(e))}};try{return s(e,r,v,y,...n)}finally{g=!1}},ew=(e,t)=>{var r;const n=cw(e),o=n[1],i=n[3],a=n[6],s=n[11],l=n[15],u=n[18],c=n[19],d=s(e,t),p=o.get(t);if(p){for(const[n,o]of d.d)if(!p.d.has(n)){const c=s(e,n);u(e,n).t.add(t),p.d.add(n),o!==c.n&&(i.add(n),l(e,n),null==(r=a.c)||r.call(a,n))}for(const r of p.d)if(!d.d.has(r)){p.d.delete(r);const n=c(e,r);null==n||n.t.delete(t)}}},tw=(e,t)=>{var r;const n=cw(e),o=n[1],i=n[4],a=n[6],s=n[10],l=n[11],u=n[12],c=n[13],d=n[14],p=n[16],f=n[18],h=l(e,t);let m=o.get(t);if(!m){d(e,t);for(const r of h.d.keys()){f(e,r).t.add(t)}if(m={l:new Set,d:new Set(h.d.keys()),t:new Set},o.set(t,m),TS(t)){const r=()=>{let r=!0;const n=(...n)=>{try{return p(e,t,...n)}finally{r||(c(e),u(e))}};try{const o=s(e,t,n);o&&(m.u=()=>{r=!0;try{o()}finally{r=!1}})}finally{r=!1}};i.add(r)}null==(r=a.m)||r.call(a,t)}return m},rw=(e,t)=>{var r,n;const o=cw(e),i=o[1],a=o[5],s=o[6],l=o[11],u=o[19],c=l(e,t);let d=i.get(t);if(!d||d.l.size)return d;let p=!1;for(const e of d.t)if(null==(r=i.get(e))?void 0:r.d.has(t)){p=!0;break}if(p)return d;d.u&&a.add(d.u),d=void 0,i.delete(t);for(const r of c.d.keys()){const n=u(e,r);null==n||n.t.delete(t)}null==(n=s.u)||n.call(s,t)},nw=(e,t,r)=>{const n=cw(e),o=n[11],i=n[27],a=o(e,t),s="v"in a,l=a.v;if(jS(r))for(const n of a.d.keys())FS(t,r,o(e,n));a.v=r,delete a.e,s&&Object.is(l,a.v)||(++a.n,jS(l)&&i(e,l))},ow=(e,t)=>_S((0,cw(e)[14])(e,t)),iw=(e,t,...r)=>{const n=cw(e),o=n[3],i=n[12],a=n[13],s=n[16],l=o.size;try{return s(e,t,...r)}finally{o.size!==l&&(a(e),i(e))}},aw=(e,t,r)=>{const n=cw(e),o=n[12],i=n[18],a=n[19],s=i(e,t).l;return s.add(r),o(e),()=>{s.delete(r),a(e,t),o(e)}},sw=(e,t,r)=>{const n=cw(e)[25];let o=n.get(t);if(!o){o=new Set,n.set(t,o);const e=()=>n.delete(t);t.then(e,e)}o.add(r)},lw=(e,t)=>{const r=cw(e)[25].get(t);null==r||r.forEach(e=>e())},uw=new WeakMap,cw=e=>{const r=uw.get(e);if("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&!r)throw new Error("Store must be created by buildStore to read its building blocks");return r};function dw(e){const t=cw(e),r=t[24];return r?r(t):t}function pw(...e){const t={get:e=>(0,cw(t)[21])(t,e),set:(e,...r)=>(0,cw(t)[22])(t,e,...r),sub:(e,r)=>(0,cw(t)[23])(t,e,r)},r=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},HS,VS,BS,GS,US,YS,KS,JS,ZS,QS,ew,tw,rw,nw,ow,iw,aw,void 0,new WeakMap,sw,lw].map((t,r)=>e[r]||t);return uw.set(t,Object.freeze(r)),t}let fw,hw=0;function mw(e,r){const n="atom"+ ++hw,o={toString(){return"production"!==(t.meta.env?t.meta.env.MODE:void 0)&&this.debugLabel?n+":"+this.debugLabel:n}};return"function"==typeof e?o.read=e:(o.init=e,o.read=gw,o.write=vw),r&&(o.write=r),o}function gw(e){return e(this)}function vw(e,t,r){return t(this,"function"==typeof r?r(e(this)):r)}function yw(){return pw()}const bw=u(void 0);function xw(e){const r=h(bw);return(null==e?void 0:e.store)||r||(fw||(fw=yw(),"production"!==(t.meta.env?t.meta.env.MODE:void 0)&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=fw),globalThis.__JOTAI_DEFAULT_STORE__!==fw&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),fw)}function Sw({children:e,store:t}){const r=l(null);return t?n(bw.Provider,{value:t},e):(null===r.current&&(r.current=yw()),n(bw.Provider,{value:r.current},e))}const ww=e=>"function"==typeof(null==e?void 0:e.then),Cw=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},Ew=r.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(Cw(e),e)}),Iw=new WeakMap,Dw=(e,t,r)=>{const n=dw(e)[26];let o=Iw.get(t);return o||(o=new Promise((i,a)=>{let s=t;const l=e=>t=>{s===e&&i(t)},u=e=>t=>{s===e&&a(t)},c=()=>{try{const t=r();ww(t)?(Iw.set(t,o),s=t,t.then(l(t),u(t)),n(e,t,c)):i(t)}catch(e){a(e)}};t.then(l(t),u(t)),n(e,t,c)}),Iw.set(t,o)),o};function Pw(e,t){const{delay:n,unstable_promiseStatus:o=!r.use}={},i=xw(t),[[a,s,l],u]=c(t=>{const r=i.get(e);return Object.is(t[0],r)&&t[1]===i&&t[2]===e?t:[r,i,e]},void 0,()=>[i.get(e),i,e]);let f=a;if(s===i&&l===e||(u(),f=i.get(e)),d(()=>{const t=i.sub(e,()=>{if(o)try{const t=i.get(e);ww(t)&&Cw(Dw(i,t,()=>i.get(e)))}catch(e){}"number"!=typeof n?u():setTimeout(u,n)});return u(),t},[i,e,n,o]),p(f),ww(f)){const t=Dw(i,f,()=>i.get(e));return o&&Cw(t),Ew(t)}return f}function Rw(e,r){const n=xw(r);return f((...r)=>{if("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&!("write"in e))throw new Error("not writable atom");return n.set(e,...r)},[n,e])}function Mw(e,t){return[Pw(e,t),Rw(e,t)]}t.meta.env&&t.meta.env.MODE;!function(e=()=>{try{return window.localStorage}catch(e){return void("production"!==(t.meta.env?t.meta.env.MODE:void 0)&&"undefined"!=typeof window&&console.warn(e))}},r){var n;let o,i;const a={getItem:(t,n)=>{var a,s;const l=e=>{if(o!==(e=e||"")){try{i=JSON.parse(e,null==r?void 0:r.reviver)}catch(e){return n}o=e}return i},u=null!=(s=null==(a=e())?void 0:a.getItem(t))?s:null;return(e=>"function"==typeof(null==e?void 0:e.then))(u)?u.then(l):l(u)},setItem:(t,r)=>{var n;return null==(n=e())?void 0:n.setItem(t,JSON.stringify(r,void 0))},removeItem:t=>{var r;return null==(r=e())?void 0:r.removeItem(t)}};let s;try{s=null==(n=e())?void 0:n.subscribe}catch(e){}var l;!s&&"undefined"!=typeof window&&"function"==typeof window.addEventListener&&window.Storage&&(s=(t,r)=>{if(!(e()instanceof window.Storage))return()=>{};const n=n=>{n.storageArea===e()&&n.key===t&&r(n.newValue)};return window.addEventListener("storage",n),()=>{window.removeEventListener("storage",n)}}),s&&(a.subscribe=(l=s,(e,t,r)=>l(e,e=>{let n;try{n=JSON.parse(e||"")}catch(e){n=r}t(n)})))}();const Lw=(e,t,r)=>(t.has(r)?t:t.set(r,e())).get(r),Aw=new WeakMap,kw=()=>{};const Ow=new WeakMap;function qw(e,t){const r=xw(t),n=Tw(r);for(const[o,...i]of e)n.has(o)&&!(null==t?void 0:t.dangerouslyForceHydrate)||(n.add(o),r.set(o,...i))}const Tw=e=>{let t=Ow.get(e);return t||(t=new WeakSet,Ow.set(e,t)),t};function Nw(){return Boolean("undefined"!=typeof process&&process.env?.NODE_ENV&&!1)}function _w(e){const t=mw(()=>[]),r=mw(function(e){const[n,o,i]=e(t);i.has(r)&&(n.forEach(e),++o.n)});return r.effect=e,r.INTERNAL_onInit=e=>{const n=new Set;let o,i=0,a=!1,s=!1,l=!1;function u(){if(i)return;n.clear();let t=!0;const c=o=>{if(l)return e.get(o);if(o===r){const t=h(e,o);if(!NS(t)){if(!qS(o))throw new Error("no atom init");S(e,o,o.init)}return _S(t)}const i=v(e,o);try{return _S(i)}finally{C.d.set(o,i.n),d.get(o)?.t.add(r),t?n.add(o):d.has(o)&&(x(e,r),g(e),m(e))}};c.peek=e.get;const w=(n,...o)=>{const a=h(e,n);try{if(++i,n===r){if(!qS(n))throw new Error("atom not writable");const t=a.n,r=o[0];return S(e,n,r),x(e,n),void(t!==a.n&&(p.add(n),f.c?.(n),y(e,n)))}return b(e,n,...o)}finally{t||(g(e),m(e)),--i}};w.recurse=(t,...n)=>{if(l){if(Nw())throw new Error("set.recurse is not allowed in cleanup")}else try{return a=!0,x(e,r),w(t,...n)}finally{g(e),a=!1,s&&(s=!1,u())}};try{o?.();const e=r.effect(c,w);if("function"!=typeof e)return;o=()=>{if(!i)try{return t=!0,l=!0,e()}finally{t=!1,l=!1,o=void 0}}}finally{t=!1,n.forEach(t=>{C.d.set(t,h(e,t).n)}),x(e,r),g(e)}}const c=dw(e),d=c[1],p=c[3],f=$S(c[6]),h=c[11],m=c[12],g=c[13],v=c[14],y=c[15],b=c[16],x=c[17],S=c[20],w=function(e,t){let r=jw.get(e);r||(r=new Set,jw.set(e,r),t.f.add(function(){for(const e of r)r.delete(e),e()}));return r}(e,f),C=h(e,r);C.v=void 0,Object.assign(e.get(t),[n,C,d]),f.c.add(r,function(){p.delete(r)}),f.m.add(r,function(){w.add(u),o&&w.delete(o)}),f.u.add(r,function(){w.delete(u),o&&w.add(o)}),f.c.add(r,function(){a?s=!0:w.add(u)})},Nw()&&(Object.defineProperty(t,"debugLabel",{get:()=>r.debugLabel?`${r.debugLabel}:ref`:void 0,configurable:!0,enumerable:!0}),t.debugPrivate=!0),r}const jw=new WeakMap;const Fw=async(e,t,r)=>{const n=e.get(r);void 0!==n&&("dimension"===n.type?await t.moveDimensionToAlternative(n.def.qDef.cId):await t.moveMeasureToAlternative(n.def.qDef.cId))},zw=async(e,t,r)=>{const n=e.get(r);void 0!==n&&("dimension"===n.type?await t.moveDimensionFromAlternative(n.def.qDef.cId):await t.moveMeasureFromAlternative(n.def.qDef.cId))},Ww=async e=>{const{type:t,handler:r,model:n,fieldInfo:o,handlerQueue:i}=e;void 0!==r&&void 0!==n&&i&&i.add(async()=>{switch(t){case"apply":for(const t of e.localChecked)await zw(o,r,t);for(const t of e.localUnchecked)await Fw(o,r,t);break;case"checked":await zw(o,r,e.cId);break;case"unchecked":await Fw(o,r,e.cId)}})},$w=mw(),Hw=mw(),Vw=mw(),Bw=mw(e=>e(Vw)?.translate??(e=>e)),Gw=mw(""),Uw=mw(e=>{const t=e(Gw).toLowerCase().trim();return({title:e})=>e.toLowerCase().trim().includes(t)}),Yw=e=>7005!==e.qError?.qErrorCode,Kw=new WeakMap,Xw={qInfo:{qType:"AlternativeLayout"},qHyperCubeDef:{qMode:"S",qDimensions:[],qMeasures:[],qInitialDataFetch:[{qTop:0,qLeft:0,qHeight:0,qWidth:0}],excludedNoOfLeftDims:-1,qCalcCond:{qv:"0"}}},Jw=function(e,r=kw){return((e,t,r)=>{const n=Lw(()=>new WeakMap,Aw,t);return Lw(e,n,r)})(()=>{const n=new WeakMap,o=new WeakMap,i=mw(0),a=mw([]);a.INTERNAL_onInit=e=>{e.set(a,[()=>e.set(i,e=>e+1)])},"production"!==(t.meta.env?t.meta.env.MODE:void 0)&&(i.debugPrivate=!0,a.debugPrivate=!0);const s=mw(t=>{let l;t(i);try{l=t(s)}catch(e){}const u=t(e);if(!(e=>"function"==typeof(null==e?void 0:e.then))(u))return{v:u};if(u!==(null==l?void 0:l.p)&&u.then(e=>{o.set(u,e);const[r]=t(a);r()},e=>{n.set(u,e);const[r]=t(a);r()}),n.has(u))throw n.get(u);return o.has(u)?{p:u,v:o.get(u)}:l&&"v"in l?{p:u,f:r(l.v),v:l.v}:{p:u,f:r()}});return s.init=void 0,"production"!==(t.meta.env?t.meta.env.MODE:void 0)&&(s.debugPrivate=!0),mw(e=>{const t=e(s);return"f"in t?t.f:t.v},(t,r,...n)=>r(e,...n))},e,r)}(mw(async e=>{const t=e($w);if(t){if(Kw.has(t))return Kw.get(t);try{const e=await t.app.createSessionObject(Xw);return Kw.set(t,e),e}catch(e){return void console.error("Error creating alternative layout model:",e)}}})),Zw=mw(null),Qw=mw(),eC=_w((e,t)=>{const r=e($w),n=e(Jw);if(!r||!n)return;const o=async()=>{const e=await r.getLayout();if(e.qSelectionInfo?.qInSelections)return;const o=await r.getEffectiveProperties();await n.applyPatches([{qOp:"replace",qPath:"/qHyperCubeDef/qDimensions",qValue:JSON.stringify(o.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions)},{qOp:"replace",qPath:"/qHyperCubeDef/qMeasures",qValue:JSON.stringify(o.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures)}]);const i=await n.getLayout();t(Qw,{layout:structuredClone(e),properties:structuredClone(o),altLayout:structuredClone(i)}),t(Zw,null)};return o(),r.Invalidated?.bind(o),()=>{r.Invalidated?.unbind(o)}}),tC=mw(e=>e(Qw)?.layout),rC=mw(e=>e(Qw)?.altLayout),nC=mw(e=>e(Qw)?.properties),oC=mw(e=>{const t=e(Qw)?.layout;return t?.qHyperCube.qDimensionInfo.filter(Yw)??[]}),iC=mw(e=>{const t=e(Qw)?.layout;return t?.qHyperCube.qMeasureInfo.filter(Yw)??[]}),aC=mw(e=>{const t=e(tC),r=e(oC),n=e(iC),o=e(nC),i=new Map;return t&&o?(r.forEach((e,t)=>{i.set(e.cId,{id:e.cId,type:"dimension",def:o.qHyperCubeDef.qDimensions[t]})}),n.forEach((e,t)=>{i.set(e.cId,{id:e.cId,type:"measure",def:o.qHyperCubeDef.qMeasures[t]})}),o.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.forEach(e=>{i.set(e.qDef.cId,{id:e.qDef.cId,type:"dimension",def:e})}),o.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures.forEach(e=>{i.set(e.qDef.cId,{id:e.qDef.cId,type:"measure",def:e})}),i):i});class sC{#e=[];#t=!1;#r=!1;#n;#o;#i;#a;constructor({onQueueCompleted:e}){this.#n=e}#s(){this.#o=void 0,this.#i=void 0,this.#a=void 0}pause(){this.#o&&(clearTimeout(this.#a),this.#i?.(),this.#s());const{promise:e,resolve:t}=Promise.withResolvers();this.#o=e,this.#i=t,this.#a=setTimeout(()=>{this.abort("Aborting queue after being paused for too long")},6e4)}async continue(e=0){const t=this.#i;await(e=>new Promise(t=>{setTimeout(t,e)}))(e),t===this.#i&&(t?.(),clearTimeout(this.#a),this.#s())}abort(e="Queue aborted"){clearTimeout(this.#a),(this.#e.length>0||this.#t)&&console.warn(`[SequentialPromiseQueue] ${e}`),this.#r=!0,this.#e=[],this.#i?.(),this.#s()}add(e){this.#e.push(e),this.#t||this.#l()}async#l(){if(!this.#t){for(this.#t=!0,this.#r=!1;this.#e.length>0;)if(this.#o)await this.#o;else try{const e=this.#e.shift();await(e?.())}catch(e){return console.error("[SequentialPromiseQueue] Error executing action:",e),this.#e=[],void(this.#t=!1)}try{this.#r||await(this.#n?.())}catch(e){console.error("[SequentialPromiseQueue] Error executing onQueueCompleted:",e)}finally{this.#t=!1,this.#e.length>0&&this.#l()}}}}const lC=mw(null),uC=_w((e,t)=>{const r=e($w),n=e(Hw),o=new sC({onQueueCompleted:async()=>{r&&n&&await r.applyPatches([{qPath:"/qHyperCubeDef",qOp:"replace",qValue:JSON.stringify(n.properties.qHyperCubeDef)}],!0)}});t(lC,o);const i=()=>{o.pause()},a=()=>{o.continue(500)},s=()=>{o.abort()};return r?.Invalidated?.bind(i),r?.Validated?.bind(a),r?.Cancelled?.bind(s),r?.Closing?.bind(s),()=>{o.abort(),r?.Invalidated?.unbind(i),r?.Validated?.unbind(a),r?.Cancelled?.unbind(s),r?.Closing?.unbind(s)}}),cC=mw(e=>{const t=[...e(oC),...e(iC)].map(e=>e.cId);return new Set(t)}),dC=mw(new Set),pC=mw(new Set),fC=mw(e=>{const t=e(dC),r=e(pC);return e(cC).difference(r).union(t)}),hC=_w((e,t)=>{e(cC),t(dC,new Set),t(pC,new Set)}),mC=mw(e=>e(fC),(e,t,r)=>{const n=e(fC).has(r),o=new Set(e(pC)),i=new Set(e(dC));n?(o.add(r),i.delete(r)):(i.add(r),o.delete(r)),t(pC,o),t(dC,i),Ww({type:n?"unchecked":"checked",cId:r,handler:e(Hw),model:e($w),fieldInfo:e(aC),handlerQueue:e(lC)})}),gC=({props:e,children:t})=>(qw([[$w,e.args.model],[Vw,e.args.apis],[Hw,e.args.handler]]),Pw(hC),Pw(eC),Pw(uC),t);function vC(e,t){const r=new Set(e),n=new Set(t);return e===t||r.size===n.size&&Array.from(r).every(n.has.bind(n))}function yC(e){return"write"in e}const bC=new WeakMap,xC={},{read:SC,write:wC}=mw(null);function CC(e,t,r){const[n,o,i,,a]=e,s=n.get(t);if(s)return s;if(r===e){let n=o.get(t);return n||(n=[PC(e,t,r),r],o.set(t,n)),n}const l=r??xC;let u=i.get(l);u||(u=new WeakMap,i.set(l,u));let c=u.get(t);if(!c){const[n,o]=a?CC(a,t,r):[t];c=[t.read===SC?n:PC(e,t,o),o],u.set(t,c)}return c}function EC(e){for(const t of e[5])t()}function IC(e,t,r,n,o){if(r.read===SC&&yC(r)&&yC(t)&&r.write!==wC&&e!==n){const{write:i}=r;return t.write=DC(e,r.write.bind(r),n,o),()=>{t.write=i}}}function DC(e,t,r,n=r){return function(o,i,...a){return t(function(t){const[n]=CC(e,t,r);return o(n)},function(t,...o){const[a]=CC(e,t,r),s=IC(e,a,t,r,n);try{return i(a,...o)}finally{null==s||s()}},...a)}}function PC(e,t,r){const n=Object.getOwnPropertyDescriptors(t);Object.keys(n).filter(e=>["read","write","debugLabel"].includes(e)).forEach(e=>n[e].configurable=!0);const o=Object.getPrototypeOf(t),i=Object.create(o,n);return i.read!==SC&&(i.read=function(e,t,r){return function(n,o){return t(function(t){const[o]=CC(e,t,r);return n(o)},o)}}(e,t.read.bind(t),r)),yC(i)&&yC(t)&&i.write!==wC&&(i.write=DC(e,t.write.bind(t),r)),i}function RC({atoms:e=[],atomFamilies:t=[],parentStore:r,name:n}){const o=new WeakSet(e),i=bC.get(r),a=(null==i?void 0:i[3])??r,s=[new WeakMap,new WeakMap,new WeakMap,a,i,new Set,void 0],l=s[0],u=s[5],c=function(e){const t=e[3],r=[...dw(t)],n=r[21],o=r[22],i=r[23],a=r[9],s={};r[9]=(e,t)=>a(l,t),r[21]=h(n),r[22]=p,r[23]=h(i),r[24]=([...e])=>{const t=[m(e[0],u),m(e[1],c),m(e[2]),g(e[3]),e[4],e[5],y(e[6]),h(e[7]),h(e[8]),e[9],h(e[10]),h(e[11],e=>d(t[0],e)),e[12],e[13],h(e[14]),h(e[15]),h(e[16]),h(e[17]),h(e[18]),h(e[19]),h(e[20]),h(e[21]),h(e[22]),h(e[23]),()=>e];return t};const l=pw(...r);return l;function u(t){const r=new WeakMap;return function(n){let o=r.get(n);if(o)return o;const i=t(n);return i?(o={...i,d:m(i.d,function(t){return r=>t(CC(e,r)[0])}),p:g(i.p),get n(){return i.n},set n(e){i.n=e},get v(){return i.v},set v(e){i.v=e},get e(){return i.e},set e(e){i.e=e}},r.set(n,o),o):void 0}}function c(e){const t=new WeakMap;return function(r){let n=t.get(r);if(n)return n;const o=e(r);return o?(n={...o,d:g(o.d),t:g(o.t),get u(){return o.u},set u(e){o.u=e}},t.set(r,n),n):void 0}}function d(e,t){return function(r,n){return e.get(n)||(e.set(n,t(r,n)),e.get(n))}}function p(t,r,...n){const[i,a]=CC(e,r),s=IC(e,i,r,a,e);try{return o(t,i,...n)}finally{null==s||s()}}function f(t,r){return function(n,...o){const[i]=CC(e,n);return(r?r(t):t)(i,...o)}}function h(t,r){return function(n,o,...i){const[a]=CC(e,o);return(r?r(t):t)(n,a,...i)}}function m(e,t){return{get:f(e.get.bind(e),t),set:f(e.set.bind(e)),has:f(e.has.bind(e)),delete:f(e.delete.bind(e))}}function g(t){return{get size(){return t.size},add:f(t.add.bind(t)),has:f(t.has.bind(t)),delete:f(t.delete.bind(t)),clear:t.clear.bind(t),forEach:e=>t.forEach(f(e)),*[Symbol.iterator](){for(const r of t)yield CC(e,r)[0]}}}function v(t){if(!t)return;const r=f(t);return r.add=function(r,n){if(void 0===r)return t.add(void 0,n);const[o]=CC(e,r);return t.add(o,n)},r}function y(e){const t={get f(){return e.f},set f(t){e.f=t}};return Object.defineProperties(t,Object.fromEntries(["r","c","m","u"].map(t=>[t,{get:()=>s[t]??(s[t]=v(e[t])),set(r){delete s[t],e[t]=r},configurable:!0,enumerable:!0}]))),Object.assign(t,e)}}(s);s[6]=c,Object.assign(c,{name:n}),bC.set(c,s);for(const t of new Set(e))l.set(t,[PC(s,t,s),s]);for(const e of new Set(t)){for(const t of e.getParams()){const r=e(t);l.has(r)||l.set(r,[PC(s,r,s),s])}const t=e.unstable_listen(({type:e,atom:t})=>{"CREATE"!==e||l.has(t)?"REMOVE"===e&&!o.has(t)&&l.delete(t):l.set(t,[PC(s,t,s),s])});u.add(t)}return c}const MC=function(e,t){return function(r){const{atoms:o=[],atomFamilies:i=[],children:a,scope:s,name:l}=r,u=t(),c=Array.from(o,e=>Array.isArray(e)?e[0]:e);function p(){return[s??RC({atoms:c,atomFamilies:i,parentStore:u,name:l}),function(e){return u!==e.parentStore||!vC(c,e.atoms)||!vC(i,e.atomFamilies)||s!==e.providedScope}]}const[[f,h],g]=m(p);if(h({atoms:c,atomFamilies:i,parentStore:u,providedScope:s})){const e=bC.get(f);e&&EC(e),g(p)}return qw(Array.from(o).filter(Array.isArray),{store:f}),d(()=>{const e=bC.get(f);return()=>{e&&EC(e)}},[f]),n(e,{store:f,children:a})}}(Sw,xw);var LC=Object.defineProperty,AC=Object.defineProperties,kC=Object.getOwnPropertyDescriptors,OC=Object.getOwnPropertySymbols,qC=Object.prototype.hasOwnProperty,TC=Object.prototype.propertyIsEnumerable,NC=(e,t,r)=>t in e?LC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_C=(e,t)=>{for(var r in t||(t={}))qC.call(t,r)&&NC(e,r,t[r]);if(OC)for(var r of OC(t))TC.call(t,r)&&NC(e,r,t[r]);return e},jC=(e,t)=>AC(e,kC(t));function FC(e,t,r){if(t===r)return e;const n=e.slice();return n.splice(r,0,n.splice(t,1)[0]),n}function zC(e){return"initialIndex"in e&&"number"==typeof e.initialIndex&&"index"in e&&"number"==typeof e.index}function WC(e,t){return function(e,t,r){var n,o,i;const{source:a,target:s,canceled:l}=t.operation;if(!a||!s||l)return"preventDefault"in t&&t.preventDefault(),e;const u=(e,t)=>e===t||"object"==typeof e&&"id"in e&&e.id===t;if(Array.isArray(e)){const n=e.findIndex(e=>u(e,a.id)),o=e.findIndex(e=>u(e,s.id));if(-1===n||-1===o){if(zC(a)){const n=a.initialIndex,o=a.index;return n===o||n<0||n>=e.length?("preventDefault"in t&&t.preventDefault(),e):r(e,n,o)}return e}if(!l&&"index"in a&&"number"==typeof a.index){const t=a.index;if(t!==n)return r(e,n,t)}return r(e,n,o)}const c=Object.entries(e);let d,p,f=-1,h=-1;for(const[e,t]of c)if(-1===f&&(f=t.findIndex(e=>u(e,a.id)),-1!==f&&(d=e)),-1===h&&(h=t.findIndex(e=>u(e,s.id)),-1!==h&&(p=e)),-1!==f&&-1!==h)break;if(-1===f&&zC(a)){const n=a.initialGroup,o=a.initialIndex,i=a.group,s=a.index;if(null==n||null==i||!(n in e)||!(i in e))return"preventDefault"in t&&t.preventDefault(),e;if(n===i&&o===s)return"preventDefault"in t&&t.preventDefault(),e;if(n===i)return jC(_C({},e),{[n]:r(e[n],o,s)});const l=e[n][o];return jC(_C({},e),{[n]:[...e[n].slice(0,o),...e[n].slice(o+1)],[i]:[...e[i].slice(0,s),l,...e[i].slice(s)]})}if(!a.manager)return e;const{dragOperation:m}=a.manager,g=null!=(o=null==(n=m.shape)?void 0:n.current.center)?o:m.position.current;if(null==p&&s.id in e){const t=s.shape&&g.y>s.shape.center.y?e[s.id].length:0;p=s.id,h=t}if(null==d||null==p||d===p&&f===h){if(null!=d&&d===p&&f===h&&zC(a)){const t=null!=a.group&&a.group!==d,n=a.index!==f;if(t||n){const t=null!=(i=a.group)?i:d;if(t in e){if(d===t)return jC(_C({},e),{[d]:r(e[d],f,a.index)});const n=e[d][f];return jC(_C({},e),{[d]:[...e[d].slice(0,f),...e[d].slice(f+1)],[t]:[...e[t].slice(0,a.index),n,...e[t].slice(a.index)]})}}}return"preventDefault"in t&&t.preventDefault(),e}if(d===p)return jC(_C({},e),{[d]:r(e[d],f,h)});const v=s.shape&&Math.round(g.y)>Math.round(s.shape.center.y)?1:0,y=e[d][f];return jC(_C({},e),{[d]:[...e[d].slice(0,f),...e[d].slice(f+1)],[p]:[...e[p].slice(0,h+v),y,...e[p].slice(h+v)]})}(e,t,FC)}function $C(e,t){let r=null;const n=new Map,o=new Set;function i(o){let s;if(void 0===t)s=n.get(o);else for(const[e,r]of n)if(t(e,o)){s=r;break}if(void 0!==s){if(!r?.(s[1],o))return s[0];i.remove(o)}const l=e(o);return n.set(o,[l,Date.now()]),a("CREATE",o,l),l}function a(e,t,r){for(const n of o)n({type:e,param:t,atom:r})}return i.unstable_listen=e=>(o.add(e),()=>{o.delete(e)}),i.getParams=()=>n.keys(),i.remove=e=>{if(void 0===t){if(!n.has(e))return;const[t]=n.get(e);n.delete(e),a("REMOVE",e,t)}else for(const[r,[o]]of n)if(t(r,e)){n.delete(r),a("REMOVE",r,o);break}},i.setShouldRemove=e=>{if(r=e,r)for(const[e,[t,o]]of n)r(o,e)&&(n.delete(e),a("REMOVE",e,t))},i}const HC=({itemIndex:e,sectionIndex:t})=>void 0!==e?`${t}-${e}`:`${t}`,VC=mw(),BC=mw(e=>e(VC)?.numberOfSections??0),GC=mw(e=>e(VC)?.numberOfItemsInSection??[]),UC=mw(e=>e(VC)?.keyExtractor??HC),YC=mw(e=>e(VC)?.emptyTexts??(()=>({title:"No items",message:"There are no items to display."}))),KC=mw(e=>e(VC)?.onDragEnd),XC=mw(e=>e(VC)?.onDragOver),JC=mw(e=>e(VC)?.itemRenderer),ZC=mw(e=>e(VC)?.headerRenderer),QC=mw(e=>e(VC)?.dragOverlayRenderer),eE=mw(e=>e(VC)?.onClick),tE=mw(e=>{const t=e(BC),r=e(GC),n=e(UC),o={};for(let e=0;e<t;e++)o[e]=Array.from({length:r[e]},(t,r)=>n({sectionIndex:e,itemIndex:r}));return o}),rE=mw(null),nE=mw(e=>e(rE),(e,t,r)=>{if(null===r)return void t(rE,null);const n=e(rE);t(rE,{...n,...r})}),oE=$C(e=>mw(null,(t,r,n)=>{let o;"over"===e?o=t(XC):"end"===e&&(o=t(KC),r(nE,null));const{source:i,target:a}=n.operation;if(null===a)return void r(nE,{toIndex:void 0,toSectionIndex:void 0});const s=WC(t(tE),n)[a.data.sectionIndex].indexOf(i.id),l=-1!==s?s:a.sortable?.index??0;"start"===e?r(nE,{id:i.id,startSection:i.data.sectionKey,startIndex:i.data.itemIndex,startSectionIndex:i.data.sectionIndex}):"over"===e&&r(nE,{toIndex:l,toSectionIndex:a.data.sectionIndex}),o?.({id:i.id,toIndex:l,toSection:a.data.sectionKey,fromSection:i.data.sectionKey,startSection:t(nE)?.startSection??i.data.sectionKey,event:n})})),iE=[VC,BC,GC,UC,YC,KC,JC,ZC,eE,nE],aE=[oE],sE=({props:e,children:t})=>{const r=Rw(VC);return g(()=>{r(e)},[e,r]),t};var lE=Symbol.for("preact-signals");function uE(){if(hE>1)hE--;else{var e,t=!1;for(!function(){var e=yE;for(yE=void 0;void 0!==e;)e.S.v===e.v&&(e.S.i=e.i),e=e.o}();void 0!==fE;){var r=fE;for(fE=void 0,mE++;void 0!==r;){var n=r.u;if(r.u=void 0,r.f&=-3,!(8&r.f)&&CE(r))try{r.c()}catch(r){t||(e=r,t=!0)}r=n}}if(mE=0,hE--,t)throw e}}function cE(e){if(hE>0)return e();vE=++gE,hE++;try{return e()}finally{uE()}}var dE=void 0;function pE(e){var t=dE;dE=void 0;try{return e()}finally{dE=t}}var fE=void 0,hE=0,mE=0,gE=0,vE=0,yE=void 0,bE=0;function xE(e){if(void 0!==dE){var t=e.n;if(void 0===t||t.t!==dE)return t={i:0,S:e,p:dE.s,n:void 0,t:dE,e:void 0,x:void 0,r:t},void 0!==dE.s&&(dE.s.n=t),dE.s=t,e.n=t,32&dE.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=dE.s,t.n=void 0,dE.s.n=t,dE.s=t),t}}function SE(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=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 wE(e,t){return new SE(e,t)}function CE(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 EE(e){for(var t=e.s;void 0!==t;t=t.n){var r=t.S.n;if(void 0!==r&&(t.r=r),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function IE(e){for(var t=e.s,r=void 0;void 0!==t;){var n=t.p;-1===t.i?(t.S.U(t),void 0!==n&&(n.n=t.n),void 0!==t.n&&(t.n.p=n)):r=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=n}e.s=r}function DE(e,t){SE.call(this,void 0),this.x=e,this.s=void 0,this.g=bE-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 PE(e,t){return new DE(e,t)}function RE(e){var t=e.m;if(e.m=void 0,"function"==typeof t){hE++;var r=dE;dE=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,ME(e),t}finally{dE=r,uE()}}}function ME(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,RE(e)}function LE(e){if(dE!==this)throw new Error("Out-of-order effect");IE(this),dE=e,this.f&=-2,8&this.f&&ME(this),uE()}function AE(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=null==t?void 0:t.name}function kE(e,t){var r=new AE(e,t);try{r.c()}catch(e){throw r.d(),e}var n=r.d.bind(r);return n[Symbol.dispose]=n,n}SE.prototype.brand=lE,SE.prototype.h=function(){return!0},SE.prototype.S=function(e){var t=this,r=this.t;r!==e&&void 0===e.e&&(e.x=r,this.t=e,void 0!==r?r.e=e:pE(function(){var e;null==(e=t.W)||e.call(t)}))},SE.prototype.U=function(e){var t=this;if(void 0!==this.t){var r=e.e,n=e.x;void 0!==r&&(r.x=n,e.e=void 0),void 0!==n&&(n.e=r,e.x=void 0),e===this.t&&(this.t=n,void 0===n&&pE(function(){var e;null==(e=t.Z)||e.call(t)}))}},SE.prototype.subscribe=function(e){var t=this;return kE(function(){var r=t.value,n=dE;dE=void 0;try{e(r)}finally{dE=n}},{name:"sub"})},SE.prototype.valueOf=function(){return this.value},SE.prototype.toString=function(){return this.value+""},SE.prototype.toJSON=function(){return this.value},SE.prototype.peek=function(){var e=dE;dE=void 0;try{return this.value}finally{dE=e}},Object.defineProperty(SE.prototype,"value",{get:function(){var e=xE(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(mE>100)throw new Error("Cycle detected");!function(e){0!==hE&&0===mE&&e.l!==vE&&(e.l=vE,yE={S:e,v:e.v,i:e.i,o:yE})}(this),this.v=e,this.i++,bE++,hE++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{uE()}}}}),DE.prototype=new SE,DE.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===bE)return!0;if(this.g=bE,this.f|=1,this.i>0&&!CE(this))return this.f&=-2,!0;var e=dE;try{EE(this),dE=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 dE=e,IE(this),this.f&=-2,!0},DE.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)}SE.prototype.S.call(this,e)},DE.prototype.U=function(e){if(void 0!==this.t&&(SE.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)}},DE.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(DE.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=xE(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),AE.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.m=t)}finally{e()}},AE.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,RE(this),EE(this),hE++;var e=dE;return dE=this,LE.bind(this,e)},AE.prototype.N=function(){2&this.f||(this.f|=2,this.u=fE,fE=this)},AE.prototype.d=function(){this.f|=8,1&this.f||ME(this)},AE.prototype.dispose=function(){this.d()};var OE,qE,TE,NE,_E,jE,FE,zE,WE,$E,HE,VE,BE,GE,UE,YE,KE,XE,JE,ZE,QE=Object.create,eI=Object.defineProperty,tI=Object.defineProperties,rI=Object.getOwnPropertyDescriptor,nI=Object.getOwnPropertyDescriptors,oI=Object.getOwnPropertySymbols,iI=Object.prototype.hasOwnProperty,aI=Object.prototype.propertyIsEnumerable,sI=e=>{throw TypeError(e)},lI=(e,t,r)=>t in e?eI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,uI=(e,t)=>eI(e,"name",{value:t,configurable:!0}),cI=["class","method","getter","setter","accessor","field","value","get","set"],dI=e=>void 0!==e&&"function"!=typeof e?sI("Function expected"):e,pI=(e,t,r,n,o)=>({kind:cI[e],name:t,metadata:n,addInitializer:e=>r._?sI("Already initialized"):o.push(dI(e||null))}),fI=(e,t)=>{return lI(t,(r="metadata",(n=Symbol[r])?n:Symbol.for("Symbol."+r)),e[3]);var r,n},hI=(e,t,r,n)=>{for(var o=0,i=e[t>>1],a=i&&i.length;o<a;o++)1&t?i[o].call(r):n=i[o].call(r,n);return n},mI=(e,t,r,n,o,i)=>{var a,s,l,u,c,d=7&t,p=!!(8&t),f=!!(16&t),h=d>3?e.length+1:d?p?1:2:0,m=cI[d+5],g=d>3&&(e[h-1]=[]),v=e[h]||(e[h]=[]),y=d&&(!f&&!p&&(o=o.prototype),d<5&&(d>3||!f)&&rI(d<4?o:{get[r](){return yI(this,i)},set[r](e){return xI(this,i,e)}},r));d?f&&d<4&&uI(i,(d>2?"set ":d>1?"get ":"")+r):uI(o,r);for(var b=n.length-1;b>=0;b--)u=pI(d,r,l={},e[3],v),d&&(u.static=p,u.private=f,c=u.access={has:f?e=>vI(o,e):e=>r in e},3^d&&(c.get=f?e=>(1^d?yI:SI)(e,o,4^d?i:y.get):e=>e[r]),d>2&&(c.set=f?(e,t)=>xI(e,o,t,4^d?i:y.set):(e,t)=>e[r]=t)),s=(0,n[b])(d?d<4?f?i:y[m]:d>4?void 0:{get:y.get,set:y.set}:o,u),l._=1,4^d||void 0===s?dI(s)&&(d>4?g.unshift(s):d?f?i=s:y[m]=s:o=s):"object"!=typeof s||null===s?sI("Object expected"):(dI(a=s.get)&&(y.get=a),dI(a=s.set)&&(y.set=a),dI(a=s.init)&&g.unshift(a));return d||fI(e,o),y&&eI(o,r,y),f?4^d?i:y:o},gI=(e,t,r)=>t.has(e)||sI("Cannot "+r),vI=(e,t)=>Object(t)!==t?sI('Cannot use the "in" operator on this value'):e.has(t),yI=(e,t,r)=>(gI(e,t,"read from private field"),r?r.call(e):t.get(e)),bI=(e,t,r)=>t.has(e)?sI("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),xI=(e,t,r,n)=>(gI(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),SI=(e,t,r)=>(gI(e,t,"access private method"),r);function wI(e,t){if(t){let r;return PE(()=>{const n=e();return n&&r&&t(r,n)?r:(r=n,n)})}return PE(e)}function CI(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 r of e)if(!t.has(r))return!1;return!0}if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;return!e.some((e,r)=>!CI(e,t[r]))}if("object"==typeof e&&"object"==typeof t){const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;const o=r.some(r=>!CI(e[r],t[r]));return!o}return!1}function EI({get:e},t){return{init:e=>wE(e),get(){return e.call(this).value},set(t){const r=e.call(this);r.peek()!==t&&(r.value=t)}}}function II(e,t){const r=new WeakMap;return function(){let t=r.get(this);return t||(t=wI(e.bind(this)),r.set(this,t)),t.value}}function DI(e=!0){return function(t,r){r.addInitializer(function(){const t="field"===r.kind||r.static?this:Object.getPrototypeOf(this),n=Object.getOwnPropertyDescriptor(t,r.name);n&&Object.defineProperty(t,r.name,((e,t)=>tI(e,nI(t)))(((e,t)=>{for(var r in t||(t={}))iI.call(t,r)&&lI(e,r,t[r]);if(oI)for(var r of oI(t))aI.call(t,r)&&lI(e,r,t[r]);return e})({},n),{enumerable:e}))})}}function PI(...e){const t=e.map(e=>kE(e));return()=>t.forEach(e=>e())}jE=[EI],_E=[EI],NE=[EI],TE=[DI()],qE=[DI()],OE=[DI()];var RI,MI=class{constructor(e,t=Object.is){this.defaultValue=e,this.equals=t,hI(FE,5,this),bI(this,VE),bI(this,zE,hI(FE,8,this)),hI(FE,11,this),bI(this,BE,hI(FE,12,this)),hI(FE,15,this),bI(this,KE,hI(FE,16,this)),hI(FE,19,this),this.reset=this.reset.bind(this),this.reset()}get current(){return yI(this,VE,JE)}get initial(){return yI(this,VE,$E)}get previous(){return yI(this,VE,UE)}set current(e){const t=pE(()=>yI(this,VE,JE));e&&t&&this.equals(t,e)||cE(()=>{yI(this,VE,$E)||xI(this,VE,e,HE),xI(this,VE,t,YE),xI(this,VE,e,ZE)})}reset(e=this.defaultValue){cE(()=>{xI(this,VE,void 0,YE),xI(this,VE,e,HE),xI(this,VE,e,ZE)})}};function LI(e){return pE(()=>{const t={};for(const r in e)t[r]=e[r];return t})}FE=[,,,QE(null)],zE=new WeakMap,VE=new WeakSet,BE=new WeakMap,KE=new WeakMap,WE=mI(FE,20,"#initial",jE,VE,zE),$E=WE.get,HE=WE.set,GE=mI(FE,20,"#previous",_E,VE,BE),UE=GE.get,YE=GE.set,XE=mI(FE,20,"#current",NE,VE,KE),JE=XE.get,ZE=XE.set,mI(FE,2,"current",TE,MI),mI(FE,2,"initial",qE,MI),mI(FE,2,"previous",OE,MI),fI(FE,MI);RI=new WeakMap;var AI,kI,OI,qI,TI,NI=Object.create,_I=Object.defineProperty,jI=Object.getOwnPropertyDescriptor,FI=Object.getOwnPropertySymbols,zI=Object.prototype.hasOwnProperty,WI=Object.prototype.propertyIsEnumerable,$I=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),HI=e=>{throw TypeError(e)},VI=Math.pow,BI=(e,t,r)=>t in e?_I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,GI=["class","method","getter","setter","accessor","field","value","get","set"],UI=e=>void 0!==e&&"function"!=typeof e?HI("Function expected"):e,YI=(e,t,r,n,o)=>({kind:GI[e],name:t,metadata:n,addInitializer:e=>r._?HI("Already initialized"):o.push(UI(e||null))}),KI=(e,t,r,n,o,i)=>{for(var a,s,l,u,c=7&t,d=GI[c+5],p=e[2]||(e[2]=[]),f=(o=o.prototype,jI(o,r)),h=n.length-1;h>=0;h--)(l=YI(c,r,s={},e[3],p)).static=false,l.private=false,u=l.access={has:e=>r in e},u.get=e=>e[r],a=(0,n[h])(f[d],l),s._=1,UI(a)&&(f[d]=a);return f&&_I(o,r,f),o},XI=(e,t,r)=>t.has(e)||HI("Cannot "+r),JI=class e{constructor(e,t){this.x=e,this.y=t}static delta(t,r){return new e(t.x-r.x,t.y-r.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:r}){return new e(t,r)}},ZI=class e{constructor(e,t,r,n){this.left=e,this.top=t,this.width=r,this.height=n,this.scale={x:1,y:1}}get inverseScale(){return{x:1/this.scale.x,y:1/this.scale.y}}translate(t,r){const{top:n,left:o,width:i,height:a,scale:s}=this,l=new e(o+t,n+r,i,a);return l.scale=((e,t)=>{for(var r in t||(t={}))zI.call(t,r)&&BI(e,r,t[r]);if(FI)for(var r of FI(t))WI.call(t,r)&&BI(e,r,t[r]);return e})({},s),l}get boundingRectangle(){const{width:e,height:t,left:r,top:n,right:o,bottom:i}=this;return{width:e,height:t,left:r,top:n,right:o,bottom:i}}get center(){const{left:e,top:t,right:r,bottom:n}=this;return new JI((e+r)/2,(t+n)/2)}get area(){const{width:e,height:t}=this;return e*t}equals(t){if(!(t instanceof e))return!1;const{left:r,top:n,width:o,height:i}=this;return r===t.left&&n===t.top&&o===t.width&&i===t.height}containsPoint(e){const{top:t,left:r,bottom:n,right:o}=this;return t<=e.y&&e.y<=n&&r<=e.x&&e.x<=o}intersectionArea(t){return t instanceof e?function(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-n,s=i-r;if(n<o&&r<i){return a*s}return 0}(this,t):0}intersectionRatio(e){const{area:t}=this,r=this.intersectionArea(e);return r/(e.area+t-r)}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:r,width:n,height:o}){return new e(r,t,n,o)}static delta(e,t,r={x:"center",y:"center"}){const n=(e,t)=>{const n=r[t],o="x"===t?e.left:e.top,i="x"===t?e.width:e.height;return"start"==n?o:"end"==n?o+i:o+i/2};return JI.delta({x:n(e,"x"),y:n(e,"y")},{x:n(t,"x"),y:n(t,"y")})}static intersectionRatio(t,r){return e.from(t).intersectionRatio(e.from(r))}};var QI,eD=class extends(OI=MI,kI=[II],AI=[II],OI){constructor(e){var t,r,n;super(JI.from(e),(e,t)=>JI.equals(e,t)),((e,t,r)=>{for(var n=0,o=e[t>>1],i=o&&o.length;n<i;n++)o[n].call(r)})(TI,5,this),t=this,n=0,(r=qI).has(t)?HI("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(t):r.set(t,n),this.velocity={x:0,y:0}}get delta(){return JI.delta(this.current,this.initial)}get direction(){const{current:e,previous:t}=this;if(!t)return null;const r={x:e.x-t.x,y:e.y-t.y};return r.x||r.y?Math.abs(r.x)>Math.abs(r.y)?r.x>0?"right":"left":r.y>0?"down":"up":null}get current(){return super.current}set current(e){const{current:t}=this,r=JI.from(e),n={x:r.x-t.x,y:r.y-t.y},o=Date.now(),i=o-(XI(a=this,s=qI,"read from private field"),s.get(a));var a,s;const l=e=>Math.round(e/i*100);cE(()=>{((e,t,r)=>{XI(e,t,"write to private field"),t.set(e,r)})(this,qI,o),this.velocity={x:l(n.x),y:l(n.y)},super.current=r})}reset(e=this.defaultValue){super.reset(JI.from(e)),this.velocity={x:0,y:0}}};function tD({x:e,y:t},r){const n=Math.abs(e),o=Math.abs(t);return"number"==typeof r?Math.sqrt(VI(n,2)+VI(o,2))>r:"x"in r&&"y"in r?n>r.x&&o>r.y:"x"in r?n>r.x:"y"in r&&o>r.y}TI=(e=>{var t;return[,,,NI(null!=(t=null==e?void 0:e[$I("metadata")])?t:null)]})(OI),qI=new WeakMap,KI(TI,2,"delta",kI,eD),KI(TI,2,"direction",AI,eD),QI=TI,BI(eD,$I("metadata"),QI[3]);var rD,nD,oD,iD,aD=(e=>(e.Horizontal="x",e.Vertical="y",e))(aD||{}),sD=Object.values(aD),lD=Object.create,uD=Object.defineProperty,cD=Object.defineProperties,dD=Object.getOwnPropertyDescriptor,pD=Object.getOwnPropertyDescriptors,fD=Object.getOwnPropertySymbols,hD=Object.prototype.hasOwnProperty,mD=Object.prototype.propertyIsEnumerable,gD=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),vD=e=>{throw TypeError(e)},yD=(e,t,r)=>t in e?uD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bD=(e,t)=>{for(var r in t||(t={}))hD.call(t,r)&&yD(e,r,t[r]);if(fD)for(var r of fD(t))mD.call(t,r)&&yD(e,r,t[r]);return e},xD=(e,t)=>cD(e,pD(t)),SD=(e,t)=>uD(e,"name",{value:t,configurable:!0}),wD=(e,t)=>{var r={};for(var n in e)hD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&fD)for(var n of fD(e))t.indexOf(n)<0&&mD.call(e,n)&&(r[n]=e[n]);return r},CD=e=>{var t;return[,,,lD(null!=(t=null==e?void 0:e[gD("metadata")])?t:null)]},ED=["class","method","getter","setter","accessor","field","value","get","set"],ID=e=>void 0!==e&&"function"!=typeof e?vD("Function expected"):e,DD=(e,t,r,n,o)=>({kind:ED[e],name:t,metadata:n,addInitializer:e=>r._?vD("Already initialized"):o.push(ID(e||null))}),PD=(e,t)=>yD(t,gD("metadata"),e[3]),RD=(e,t,r,n)=>{for(var o=0,i=e[t>>1],a=i&&i.length;o<a;o++)1&t?i[o].call(r):n=i[o].call(r,n);return n},MD=(e,t,r,n,o,i)=>{var a,s,l,u,c,d=7&t,p=!!(8&t),f=!!(16&t),h=d>3?e.length+1:d?p?1:2:0,m=ED[d+5],g=d>3&&(e[h-1]=[]),v=e[h]||(e[h]=[]),y=d&&(!f&&!p&&(o=o.prototype),d<5&&(d>3||!f)&&dD(d<4?o:{get[r](){return kD(this,i)},set[r](e){return qD(this,i,e)}},r));d?f&&d<4&&SD(i,(d>2?"set ":d>1?"get ":"")+r):SD(o,r);for(var b=n.length-1;b>=0;b--)u=DD(d,r,l={},e[3],v),d&&(u.static=p,u.private=f,c=u.access={has:f?e=>AD(o,e):e=>r in e},3^d&&(c.get=f?e=>(1^d?kD:TD)(e,o,4^d?i:y.get):e=>e[r]),d>2&&(c.set=f?(e,t)=>qD(e,o,t,4^d?i:y.set):(e,t)=>e[r]=t)),s=(0,n[b])(d?d<4?f?i:y[m]:d>4?void 0:{get:y.get,set:y.set}:o,u),l._=1,4^d||void 0===s?ID(s)&&(d>4?g.unshift(s):d?f?i=s:y[m]=s:o=s):"object"!=typeof s||null===s?vD("Object expected"):(ID(a=s.get)&&(y.get=a),ID(a=s.set)&&(y.set=a),ID(a=s.init)&&g.unshift(a));return d||PD(e,o),y&&uD(o,r,y),f?4^d?i:y:o},LD=(e,t,r)=>t.has(e)||vD("Cannot "+r),AD=(e,t)=>Object(t)!==t?vD('Cannot use the "in" operator on this value'):e.has(t),kD=(e,t,r)=>(LD(e,t,"read from private field"),r?r.call(e):t.get(e)),OD=(e,t,r)=>t.has(e)?vD("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),qD=(e,t,r,n)=>(LD(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),TD=(e,t,r)=>(LD(e,t,"access private method"),r);function ND(e,t){return{plugin:e,options:t}}function _D(e){return t=>ND(e,t)}function jD(e){return"function"==typeof e?{plugin:e,options:void 0}:e}rD=[EI];var FD=class{constructor(e,t){this.manager=e,this.options=t,OD(this,oD,RD(nD,8,this,!1)),RD(nD,11,this),OD(this,iD,new Set)}enable(){this.disabled=!1}disable(){this.disabled=!0}isDisabled(){return pE(()=>this.disabled)}configure(e){this.options=e}registerEffect(e){const t=kE(e.bind(this));return kD(this,iD).add(t),t}destroy(){kD(this,iD).forEach(e=>e())}static configure(e){return ND(this,e)}};nD=CD(null),oD=new WeakMap,iD=new WeakMap,MD(nD,4,"disabled",rD,FD,oD),PD(nD,FD);var zD,WD=class extends FD{},$D=class{constructor(e){this.manager=e,this.instances=new Map,OD(this,zD,[])}get values(){return Array.from(this.instances.values())}set values(e){const t=e.map(jD).reduceRight((e,t)=>e.some(({plugin:e})=>e===t.plugin)?e:[t,...e],[]),r=t.map(({plugin:e})=>e);for(const e of kD(this,zD))if(!r.includes(e)){if(e.prototype instanceof WD)continue;this.unregister(e)}for(const{plugin:e,options:r}of t)this.register(e,r);qD(this,zD,r)}get(e){return this.instances.get(e)}register(e,t){const r=this.instances.get(e);if(r)return r.options!==t&&(r.options=t),r;const n=new e(this.manager,t);return this.instances.set(e,n),n}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 HD(e,t){return e.priority===t.priority?e.type===t.type?t.value-e.value:t.type-e.type:t.priority-e.priority}zD=new WeakMap;var VD,BD,GD=[],UD=class extends FD{constructor(e){super(e),OD(this,VD),OD(this,BD),this.computeCollisions=this.computeCollisions.bind(this),qD(this,BD,wE(GD)),this.destroy=PI(()=>{const e=this.computeCollisions(),t=pE(()=>this.manager.dragOperation.position.current);if(e!==GD){const e=kD(this,VD);if(qD(this,VD,t),e&&t.x==e.x&&t.y==e.y)return}else qD(this,VD,void 0);kD(this,BD).value=e},()=>{const{dragOperation:e}=this.manager;e.status.initialized&&this.forceUpdate()})}forceUpdate(e=!0){pE(()=>{e?kD(this,BD).value=this.computeCollisions():qD(this,VD,void 0)})}computeCollisions(e,t){const{registry:r,dragOperation:n}=this.manager,{source:o,shape:i,status:a}=n;if(!a.initialized||!i)return GD;const s=[],l=[];for(const i of null!=e?e:r.droppables){if(i.disabled)continue;if(o&&!i.accepts(o))continue;const e=null!=t?t:i.collisionDetector;if(!e)continue;l.push(i),i.shape;const r=pE(()=>e({droppable:i,dragOperation:n}));r&&(null!=i.collisionPriority&&(r.priority=i.collisionPriority),s.push(r))}return 0===l.length?GD:(s.sort(HD),s)}get collisions(){return kD(this,BD).value}};VD=new WeakMap,BD=new WeakMap;var YD=class{constructor(){this.registry=new Map}addEventListener(e,t){const{registry:r}=this,n=new Set(r.get(e));return n.add(t),r.set(e,n),()=>this.removeEventListener(e,t)}removeEventListener(e,t){const{registry:r}=this,n=new Set(r.get(e));n.delete(t),r.set(e,n)}dispatch(e,...t){const{registry:r}=this,n=r.get(e);if(n)for(const e of n)e(...t)}},KD=class extends YD{constructor(e){super(),this.manager=e}dispatch(e,t){const r=[t,this.manager];super.dispatch(e,...r)}};function XD(e,t=!0){let r=!1;return xD(bD({},e),{cancelable:t,get defaultPrevented(){return r},preventDefault(){t&&(r=!0)}})}var JD,ZD,QD,eP,tP,rP,nP,oP,iP,aP=class extends WD{constructor(e){super(e);let t=[];this.destroy=PI(()=>{const{dragOperation:r,collisionObserver:n}=e;r.status.initializing&&(t=[],n.enable())},()=>{const{collisionObserver:r,monitor:n}=e,{collisions:o}=r;if(r.isDisabled())return;const i=XD({collisions:o});if(n.dispatch("collision",i),i.defaultPrevented)return;if(((e,t)=>e.map(({id:e})=>e).join("")===t.map(({id:e})=>e).join(""))(o,t))return;t=o;const[a]=o;pE(()=>{var t;(null==a?void 0:a.id)!==(null==(t=e.dragOperation.target)?void 0:t.id)&&(r.disable(),e.actions.setDropTarget(null==a?void 0:a.id).then(()=>{r.enable()}))})})}},sP=(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))(sP||{}),lP=(e=>(e[e.Collision=0]="Collision",e[e.ShapeIntersection=1]="ShapeIntersection",e[e.PointerIntersection=2]="PointerIntersection",e))(lP||{});nP=[EI],rP=[II],tP=[II],eP=[II],QD=[II],ZD=[II],JD=[II];var uP=class{constructor(){RD(oP,5,this),OD(this,iP,RD(oP,8,this,"idle")),RD(oP,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}};oP=CD(null),iP=new WeakMap,MD(oP,4,"value",nP,uP,iP),MD(oP,2,"current",rP,uP),MD(oP,2,"idle",tP,uP),MD(oP,2,"initializing",eP,uP),MD(oP,2,"initialized",QD,uP),MD(oP,2,"dragging",ZD,uP),MD(oP,2,"dropped",JD,uP),PD(oP,uP);var cP,dP,pP,fP,hP,mP,gP,vP,yP,bP=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 pE(()=>{const{dragOperation:t}=this.manager,r=null!=e?e:null;if(t.targetIdentifier===r)return Promise.resolve(!1);t.targetIdentifier=r;const n=XD({operation:t.snapshot()});return t.status.dragging&&this.manager.monitor.dispatch("dragover",n),this.manager.renderer.rendering.then(()=>n.defaultPrevented)})}start(e){return pE(()=>{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 r=new AbortController,{event:n,coordinates:o}=e;cE(()=>{t.status.set("initialization-pending"),t.shape=null,t.canceled=!1,t.activatorEvent=null!=n?n:null,t.position.reset(o)});const i=XD({operation:t.snapshot()});return this.manager.monitor.dispatch("beforedragstart",i),i.defaultPrevented?(t.reset(),r.abort(),r):(t.status.set("initializing"),t.controller=r,this.manager.renderer.rendering.then(()=>{if(r.signal.aborted)return;const{status:e}=t;"initializing"===e.current&&(t.status.set("dragging"),this.manager.monitor.dispatch("dragstart",{nativeEvent:n,operation:t.snapshot(),cancelable:!1}))}),r)})}move(e){return pE(()=>{var t,r;const{dragOperation:n}=this.manager,{status:o,controller:i}=n;if(!o.dragging||!i||i.signal.aborted)return;const a=XD({nativeEvent:e.event,operation:n.snapshot(),by:e.by,to:e.to},null==(t=e.cancelable)||t);(null==(r=e.propagate)||r)&&this.manager.monitor.dispatch("dragmove",a),queueMicrotask(()=>{var t,r,o,i,s;if(a.defaultPrevented)return;const l=null!=(s=e.to)?s:{x:n.position.current.x+(null!=(r=null==(t=e.by)?void 0:t.x)?r:0),y:n.position.current.y+(null!=(i=null==(o=e.by)?void 0:o.y)?i:0)};n.position.current=l})})}stop(e={}){return pE(()=>{var t,r;const{dragOperation:n}=this.manager,{controller:o}=n;if(!o||o.signal.aborted)return;let i;o.abort();const a=()=>{this.manager.renderer.rendering.then(()=>{n.status.set("dropped");const e=pE(()=>{var e;return"dropping"===(null==(e=n.source)?void 0:e.status)}),t=()=>{n.controller===o&&(n.controller=void 0),n.reset()};if(e){const{source:e}=n,r=kE(()=>{"idle"===(null==e?void 0:e.status)&&(r(),t())})}else this.manager.renderer.rendering.then(t)})};n.canceled=null!=(t=e.canceled)&&t,this.manager.monitor.dispatch("dragend",{nativeEvent:e.event,operation:n.snapshot(),canceled:null!=(r=e.canceled)&&r,suspend:()=>{const e={resume:()=>{},abort:()=>{}};return i=new Promise((t,r)=>{e.resume=t,e.abort=r}),e}}),i?i.then(a).catch(()=>n.reset()):a()})}};fP=[EI],pP=[EI],dP=[EI],cP=[EI];var xP=class{constructor(e,t){OD(this,mP,RD(hP,8,this)),RD(hP,11,this),OD(this,gP,RD(hP,12,this)),RD(hP,15,this),OD(this,vP,RD(hP,16,this)),RD(hP,19,this),OD(this,yP,RD(hP,20,this)),RD(hP,23,this);const{effects:r,id:n,data:o={},disabled:i=!1,register:a=!0}=e;let s=n;this.manager=t,this.id=n,this.data=o,this.disabled=i,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==r?void 0:r())?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)}};hP=CD(null),mP=new WeakMap,gP=new WeakMap,vP=new WeakMap,yP=new WeakMap,MD(hP,4,"manager",fP,xP,mP),MD(hP,4,"id",pP,xP,gP),MD(hP,4,"data",dP,xP,vP),MD(hP,4,"disabled",cP,xP,yP),PD(hP,xP);var SP,wP,CP,EP,IP,DP,PP,RP,MP,LP,AP,kP,OP,qP,TP,NP,_P,jP,FP,zP,WP,$P,HP,VP,BP=class{constructor(){this.map=wE(new Map),this.cleanupFunctions=new WeakMap,this.register=(e,t)=>{const r=this.map.peek(),n=r.get(e),o=()=>this.unregister(e,t);if(n===t)return o;if(n){const e=this.cleanupFunctions.get(n);null==e||e(),this.cleanupFunctions.delete(n)}const i=new Map(r);i.set(e,t),this.map.value=i;const a=PI(...t.effects());return this.cleanupFunctions.set(t,a),o},this.unregister=(e,t)=>{const r=this.map.peek();if(r.get(e)!==t)return;const n=this.cleanupFunctions.get(t);null==n||n(),this.cleanupFunctions.delete(t);const o=new Map(r);o.delete(e),this.map.value=o}}[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}},GP=class extends(PP=xP,DP=[EI],IP=[EI],EP=[EI],CP=[II],wP=[II],SP=[II],PP){constructor(e,t){var r=e,{modifiers:n,type:o,sensors:i}=r,a=wD(r,["modifiers","type","sensors"]);super(a,t),RD(RP,5,this),OD(this,MP,RD(RP,8,this)),RD(RP,11,this),OD(this,LP,RD(RP,12,this)),RD(RP,15,this),OD(this,AP,RD(RP,16,this,this.isDragSource?"dragging":"idle")),RD(RP,19,this),this.type=o,this.sensors=i,this.modifiers=n,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}};RP=CD(PP),MP=new WeakMap,LP=new WeakMap,AP=new WeakMap,MD(RP,4,"type",DP,GP,MP),MD(RP,4,"modifiers",IP,GP,LP),MD(RP,4,"status",EP,GP,AP),MD(RP,2,"isDropping",CP,GP),MD(RP,2,"isDragging",wP,GP),MD(RP,2,"isDragSource",SP,GP),PD(RP,GP);var UP=class extends(jP=xP,_P=[EI],NP=[EI],TP=[EI],qP=[EI],OP=[EI],kP=[II],jP){constructor(e,t){var r=e,{accept:n,collisionDetector:o,collisionPriority:i,type:a}=r;super(wD(r,["accept","collisionDetector","collisionPriority","type"]),t),RD(FP,5,this),OD(this,zP,RD(FP,8,this)),RD(FP,11,this),OD(this,WP,RD(FP,12,this)),RD(FP,15,this),OD(this,$P,RD(FP,16,this)),RD(FP,19,this),OD(this,HP,RD(FP,20,this)),RD(FP,23,this),OD(this,VP,RD(FP,24,this)),RD(FP,27,this),this.accept=n,this.collisionDetector=o,this.collisionPriority=i,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}};FP=CD(jP),zP=new WeakMap,WP=new WeakMap,$P=new WeakMap,HP=new WeakMap,VP=new WeakMap,MD(FP,4,"accept",_P,UP,zP),MD(FP,4,"type",NP,UP,WP),MD(FP,4,"collisionDetector",TP,UP,$P),MD(FP,4,"collisionPriority",qP,UP,HP),MD(FP,4,"shape",OP,UP,VP),MD(FP,2,"isDropTarget",kP,UP),PD(FP,UP);var YP,KP=class extends FD{constructor(e,t){super(e,t),this.manager=e,this.options=t}},XP=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)}},JP=class{constructor(e){this.options=e,OD(this,YP)}set controller(e){qD(this,YP,e),e.signal.addEventListener("abort",()=>this.abort())}activate(e){var t;null==(t=kD(this,YP))||t.activate(e)}};YP=new WeakMap;var ZP,QP,eR,tR,rR,nR,oR,iR,aR,sR,lR,uR,cR,dR,pR,fR,hR,mR,gR,vR=class extends FD{constructor(e,t){super(e,t),this.manager=e,this.options=t}apply(e){return e.transform}},yR=class{constructor(e){this.draggables=new BP,this.droppables=new BP,this.plugins=new $D(e),this.sensors=new $D(e),this.modifiers=new $D(e)}register(e,t){if(e instanceof GP)return this.draggables.register(e.id,e);if(e instanceof UP)return this.droppables.register(e.id,e);if(e.prototype instanceof vR)return this.modifiers.register(e,t);if(e.prototype instanceof KP)return this.sensors.register(e,t);if(e.prototype instanceof FD)return this.plugins.register(e,t);throw new Error("Invalid instance type")}unregister(e){if(e instanceof xP)return e instanceof GP?this.draggables.unregister(e.id,e):e instanceof UP?this.droppables.unregister(e.id,e):()=>{};if(e.prototype instanceof vR)return this.modifiers.unregister(e);if(e.prototype instanceof KP)return this.sensors.unregister(e);if(e.prototype instanceof FD)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()}};aR=[II],iR=[EI],oR=[EI],nR=[EI],rR=[EI],tR=[EI],eR=[II],QP=[II],ZP=[II];var bR=class{constructor(e){RD(cR,5,this),OD(this,sR),OD(this,lR),OD(this,uR,new MI(void 0,(e,t)=>e&&t?e.equals(t):e===t)),this.status=new uP,OD(this,dR,RD(cR,8,this,!1)),RD(cR,11,this),OD(this,pR,RD(cR,12,this,null)),RD(cR,15,this),OD(this,fR,RD(cR,16,this,null)),RD(cR,19,this),OD(this,hR,RD(cR,20,this,null)),RD(cR,23,this),OD(this,mR,RD(cR,24,this,[])),RD(cR,27,this),this.position=new eD({x:0,y:0}),OD(this,gR,{x:0,y:0}),qD(this,sR,e)}get shape(){const{current:e,initial:t,previous:r}=kD(this,uR);return e&&t?{current:e,initial:t,previous:r}:null}set shape(e){e?kD(this,uR).current=e:kD(this,uR).reset()}get source(){var e;const t=this.sourceIdentifier;if(null==t)return null;const r=kD(this,sR).registry.draggables.get(t);return r&&qD(this,lR,r),null!=(e=null!=r?r:kD(this,lR))?e:null}get target(){var e;const t=this.targetIdentifier;return null!=t&&null!=(e=kD(this,sR).registry.droppables.get(t))?e:null}get transform(){const{x:e,y:t}=this.position.delta;let r={x:e,y:t};for(const e of this.modifiers)r=e.apply(xD(bD({},this.snapshot()),{transform:r}));return qD(this,gR,r),r}snapshot(){return pE(()=>({source:this.source,target:this.target,activatorEvent:this.activatorEvent,transform:kD(this,gR),shape:this.shape?LI(this.shape):null,position:LI(this.position),status:LI(this.status),canceled:this.canceled}))}reset(){cE(()=>{this.status.set("idle"),this.sourceIdentifier=null,this.targetIdentifier=null,kD(this,uR).reset(),this.position.reset({x:0,y:0}),qD(this,gR,{x:0,y:0}),this.modifiers=[]})}};cR=CD(null),sR=new WeakMap,lR=new WeakMap,uR=new WeakMap,dR=new WeakMap,pR=new WeakMap,fR=new WeakMap,hR=new WeakMap,mR=new WeakMap,gR=new WeakMap,MD(cR,2,"shape",aR,bR),MD(cR,4,"canceled",iR,bR,dR),MD(cR,4,"activatorEvent",oR,bR,pR),MD(cR,4,"sourceIdentifier",nR,bR,fR),MD(cR,4,"targetIdentifier",rR,bR,hR),MD(cR,4,"modifiers",tR,bR,mR),MD(cR,2,"source",eR,bR),MD(cR,2,"target",QP,bR),MD(cR,2,"transform",ZP,bR),PD(cR,bR);var xR={get rendering(){return Promise.resolve()}};function SR(e,t){return"function"==typeof e?e(t):null!=e?e:t}var wR=class{constructor(e){var t;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 r=null!=e?e:{},n=SR(r.plugins,[]),o=SR(r.sensors,[]),i=SR(r.modifiers,[]),a=null!=(t=r.renderer)?t:xR,s=new KD(this),l=new yR(this);this.registry=l,this.monitor=s,this.renderer=a,this.actions=new bP(this),this.dragOperation=new bR(this),this.collisionObserver=new UD(this),this.plugins=[aP,...n],this.modifiers=i,this.sensors=o;const{destroy:u}=this,c=PI(()=>{var e,t,r;const n=pE(()=>this.dragOperation.modifiers),o=this.modifiers;for(const e of n)o.includes(e)||e.destroy();this.dragOperation.modifiers=null!=(r=null==(t=null==(e=this.dragOperation.source)?void 0:e.modifiers)?void 0:t.map(e=>{const{plugin:t,options:r}=jD(e);return new t(this,r)}))?r:o});this.destroy=()=>{c(),u()}}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}},CR=e=>{throw TypeError(e)},ER=(e,t,r)=>t.has(e)||CR("Cannot "+r),IR=(e,t,r)=>(ER(e,t,"read from private field"),t.get(e)),DR=(e,t,r)=>t.has(e)?CR("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),PR=(e,t,r,n)=>(ER(e,t,"write to private field"),t.set(e,r),r),RR=(e,t,r)=>(ER(e,t,"access private method"),r);function MR(e){return!!e&&(e instanceof KeyframeEffect||"getKeyframes"in e&&"function"==typeof e.getKeyframes)}function LR(e,t){const r=e.getAnimations();if(r.length>0)for(const e of r){if("running"!==e.playState)continue;const{effect:r}=e,n=(MR(r)?r.getKeyframes():[]).filter(t);if(n.length>0)return[n[n.length-1],e]}return null}function AR(e){const{width:t,height:r,top:n,left:o,bottom:i,right:a}=e.getBoundingClientRect();return{width:t,height:r,top:n,left:o,bottom:i,right:a}}function kR(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function OR(e){return"nodeType"in e}function qR(e){var t,r,n;return e?kR(e)?e:OR(e)?"defaultView"in e?null!=(t=e.defaultView)?t:window:null!=(n=null==(r=e.ownerDocument)?void 0:r.defaultView)?n:window:window:window}function TR(e){const{Document:t}=qR(e);return e instanceof t||"nodeType"in e&&e.nodeType===Node.DOCUMENT_NODE}function NR(e){return!(!e||kR(e))&&(e instanceof qR(e).HTMLElement||"namespaceURI"in e&&"string"==typeof e.namespaceURI&&e.namespaceURI.endsWith("html"))}function _R(e){return e instanceof qR(e).SVGElement||"namespaceURI"in e&&"string"==typeof e.namespaceURI&&e.namespaceURI.endsWith("svg")}function jR(e){return e?kR(e)?e.document:OR(e)?TR(e)?e:NR(e)||_R(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:r,overflowX:n,overflowY:o}=getComputedStyle(e);return"visible"===r&&"visible"===n&&"visible"===o}function zR(e,t=e.getBoundingClientRect(),r=0){var n,o,i,a,s;let l=t;const{ownerDocument:u}=e,c=null!=(n=u.defaultView)?n:window;let d=e.parentElement;for(;d&&d!==u.documentElement;){if(!FR(d)){const e=d.getBoundingClientRect(),t=r*(e.bottom-e.top),n=r*(e.right-e.left),o=r*(e.bottom-e.top),i=r*(e.right-e.left);l={top:Math.max(l.top,e.top-t),right:Math.min(l.right,e.right+n),bottom:Math.min(l.bottom,e.bottom+o),left:Math.max(l.left,e.left-i),width:0,height:0},l.width=l.right-l.left,l.height=l.bottom-l.top}d=d.parentElement}const p=c.visualViewport,f=null!=(o=null==p?void 0:p.offsetTop)?o:0,h=null!=(i=null==p?void 0:p.offsetLeft)?i:0,m=null!=(a=null==p?void 0:p.width)?a:c.innerWidth,g=null!=(s=null==p?void 0:p.height)?s:c.innerHeight,v=r*g,y=r*m;return l={top:Math.max(l.top,f-v),right:Math.min(l.right,h+m+y),bottom:Math.min(l.bottom,f+g+v),left:Math.max(l.left,h-y),width:0,height:0},l.width=l.right-l.left,l.height=l.bottom-l.top,l.width<0&&(l.width=0),l.height<0&&(l.height=0),l}function WR(e){return{x:e.clientX,y:e.clientY}}var $R="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 r=[e];for(const n of Array.from(e.querySelectorAll("iframe, frame")))try{const e=n.contentDocument;e&&!t.has(e)&&r.push(...HR(e,t))}catch(e){}try{const n=e.defaultView;if(n&&n!==window.top){const o=n.parent;o&&o.document&&o.document!==e&&r.push(...HR(o.document,t))}}catch(e){}return r}function VR(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function BR(){var e,t;const r=VR()?window.visualViewport:null;return{x:null!=(e=null==r?void 0:r.offsetLeft)?e:0,y:null!=(t=null==r?void 0:r.offsetTop)?t:0}}function GR(e){return!(!e||!OR(e))&&e instanceof qR(e).ShadowRoot}function UR(e){if(e&&OR(e)){let t=e.getRootNode();if(GR(t))return t;if(t instanceof Document)return t}return jR(e)}function YR(e){return e.matchMedia("(prefers-reduced-motion: reduce)").matches}function KR(e){return"value"in e}function XR(e){return"CANVAS"===e.tagName}function JR(e,{x:t,y:r}){const n=e.elementFromPoint(t,r);if(function(e){return"IFRAME"===(null==e?void 0:e.tagName)}(n)){const{contentDocument:e}=n;if(e){const{left:o,top:i}=n.getBoundingClientRect();return JR(e,{x:t-o,y:r-i})}}return n}var ZR=new WeakMap;var QR=class{constructor(){this.entries=new Set,this.clear=()=>{for(const e of this.entries){const[t,{type:r,listener:n,options:o}]=e;t.removeEventListener(r,n,o)}this.entries.clear()}}bind(e,t){const r=Array.isArray(e)?e:[e],n=Array.isArray(t)?t:[t],o=[];for(const e of r)for(const t of n){const{type:r,listener:n,options:i}=t,a=[e,t];e.addEventListener(r,n,i),this.entries.add(a),o.push(a)}return function(){for(const[e,{type:t,listener:r,options:n}]of o)e.removeEventListener(t,r,n)}}};function eM(e){const t=null==e?void 0:e.ownerDocument.defaultView;if(t&&t.self!==t.parent)return t.frameElement}function tM(e,t){const r=()=>performance.now();let n,o;return function(...i){const a=this;o?(null==n||n(),n=function(e,t){const r=setTimeout(e,t);return()=>clearTimeout(r)}(()=>{e.apply(a,i),o=r()},t-(r()-o))):(e.apply(a,i),o=r())}}var rM,nM=$R?ResizeObserver:class{observe(){}unobserve(){}disconnect(){}},oM=class extends nM{constructor(e){super(t=>{IR(this,rM)?e(t,this):PR(this,rM,!0)}),DR(this,rM,!1)}};rM=new WeakMap;var iM,aM,sM,lM,uM,cM,dM,pM,fM,hM,mM,gM=Array.from({length:100},(e,t)=>t/100),vM=class{constructor(e,t,r={debug:!1,skipInitial:!1}){this.element=e,this.callback=t,DR(this,fM),this.disconnect=()=>{var e,t,r;PR(this,dM,!0),null==(e=IR(this,sM))||e.disconnect(),null==(t=IR(this,lM))||t.disconnect(),IR(this,uM).disconnect(),null==(r=IR(this,cM))||r.remove()},DR(this,iM,!0),DR(this,aM),DR(this,sM),DR(this,lM),DR(this,uM),DR(this,cM),DR(this,dM,!1),DR(this,pM,tM(()=>{var e,t,r;const{element:n}=this;if(null==(e=IR(this,lM))||e.disconnect(),IR(this,dM)||!IR(this,iM)||!n.isConnected)return;const o=null!=(t=n.ownerDocument)?t:document,{innerHeight:i,innerWidth:a}=null!=(r=o.defaultView)?r:window,s=n.getBoundingClientRect(),l=zR(n,s),{top:u,left:c,bottom:d,right:p}=l,f=-Math.floor(u),h=-Math.floor(c),m=`${f}px ${-Math.floor(a-p)}px ${-Math.floor(i-d)}px ${h}px`;this.boundingClientRect=s,PR(this,lM,new IntersectionObserver(e=>{const[t]=e,{intersectionRect:r}=t;1!==(1!==t.intersectionRatio?t.intersectionRatio:ZI.intersectionRatio(r,zR(n)))&&IR(this,pM).call(this)},{threshold:gM,rootMargin:m,root:o})),IR(this,lM).observe(n),RR(this,fM,hM).call(this)},75)),this.boundingClientRect=e.getBoundingClientRect(),PR(this,iM,function(e,t=e.getBoundingClientRect()){const{width:r,height:n}=zR(e,t);return r>0&&n>0}(e,this.boundingClientRect));let n=!0;this.callback=e=>{n&&(n=!1,r.skipInitial)||t(e)};const o=e.ownerDocument;(null==r?void 0:r.debug)&&(PR(this,cM,document.createElement("div")),IR(this,cM).style.background="rgba(0,0,0,0.15)",IR(this,cM).style.position="fixed",IR(this,cM).style.pointerEvents="none",o.body.appendChild(IR(this,cM))),PR(this,uM,new IntersectionObserver(t=>{var r,n;const o=t[t.length-1],{boundingClientRect:i,isIntersecting:a}=o,{width:s,height:l}=i,u=IR(this,iM);PR(this,iM,a),(s||l)&&(u&&!a?(null==(r=IR(this,lM))||r.disconnect(),this.callback(null),null==(n=IR(this,sM))||n.disconnect(),PR(this,sM,void 0),IR(this,cM)&&(IR(this,cM).style.visibility="hidden")):IR(this,pM).call(this),a&&!IR(this,sM)&&(PR(this,sM,new oM(IR(this,pM))),IR(this,sM).observe(e)))},{threshold:gM,root:o})),IR(this,iM)&&!r.skipInitial&&this.callback(this.boundingClientRect),IR(this,uM).observe(e)}};iM=new WeakMap,aM=new WeakMap,sM=new WeakMap,lM=new WeakMap,uM=new WeakMap,cM=new WeakMap,dM=new WeakMap,pM=new WeakMap,fM=new WeakSet,hM=function(){IR(this,dM)||(RR(this,fM,mM).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,IR(this,aM))||(this.callback(this.boundingClientRect),PR(this,aM,this.boundingClientRect)))},mM=function(){if(IR(this,cM)){const{top:e,left:t,width:r,height:n}=zR(this.element);IR(this,cM).style.overflow="hidden",IR(this,cM).style.visibility="visible",IR(this,cM).style.top=`${Math.floor(e)}px`,IR(this,cM).style.left=`${Math.floor(t)}px`,IR(this,cM).style.width=`${Math.floor(r)}px`,IR(this,cM).style.height=`${Math.floor(n)}px`}};var yM,bM,xM,SM,wM=new WeakMap,CM=new WeakMap;function EM(e,t){let r=wM.get(e);if(!r){const t=new vM(e,t=>{const r=wM.get(e);r&&r.callbacks.forEach(e=>e(t))},{skipInitial:!0});r={disconnect:t.disconnect,callbacks:new Set}}return r.callbacks.add(t),wM.set(e,r),()=>{r.callbacks.delete(t),0===r.callbacks.size&&(wM.delete(e),r.disconnect())}}var IM=class{constructor(e,t,r){this.callback=t,DR(this,yM),DR(this,bM,!1),DR(this,xM),DR(this,SM,tM(e=>{if(!IR(this,bM)&&e.target&&"contains"in e.target&&"function"==typeof e.target.contains)for(const t of IR(this,xM))if(e.target.contains(t)){this.callback(IR(this,yM).boundingClientRect);break}},75));const n=function(e){const t=new Set;let r=eM(e);for(;r;)t.add(r),r=eM(r);return t}(e),o=function(e,t){const r=new Set;for(const n of e){const e=EM(n,t);r.add(e)}return()=>r.forEach(e=>e())}(n,t),i=function(e,t){var r;const n=e.ownerDocument;if(!CM.has(n)){const e=new AbortController,t=new Set;document.addEventListener("scroll",e=>t.forEach(t=>t(e)),{capture:!0,passive:!0,signal:e.signal}),CM.set(n,{disconnect:()=>e.abort(),listeners:t})}const{listeners:o,disconnect:i}=null!=(r=CM.get(n))?r:{};return o&&i?(o.add(t),()=>{o.delete(t),0===o.size&&(i(),CM.delete(n))}):()=>{}}(e,IR(this,SM));PR(this,xM,n),PR(this,yM,new vM(e,t,r)),this.disconnect=()=>{IR(this,bM)||(PR(this,bM,!0),o(),i(),IR(this,yM).disconnect())}}};function DM(e){return"showPopover"in e&&"hidePopover"in e&&"function"==typeof e.showPopover&&"function"==typeof e.hidePopover}function PM(e){try{DM(e)&&e.isConnected&&e.hasAttribute("popover")&&!e.matches(":popover-open")&&e.showPopover()}catch(e){}}function RM(e){return!(!$R||!e)&&e===jR(e).scrollingElement}function MM(e){var t,r;const n=qR(e),o=RM(e)?function(e){var t,r,n,o;const{documentElement:i}=jR(e),a=qR(e).visualViewport,s=null!=(t=null==a?void 0:a.width)?t:i.clientWidth,l=null!=(r=null==a?void 0:a.height)?r:i.clientHeight,u=null!=(n=null==a?void 0:a.offsetTop)?n:0,c=null!=(o=null==a?void 0:a.offsetLeft)?o:0;return{top:u,left:c,right:c+s,bottom:u+l,width:s,height:l}}(e):AR(e),i=n.visualViewport,a=RM(e)?{height:null!=(t=null==i?void 0:i.height)?t:n.innerHeight,width:null!=(r=null==i?void 0:i.width)?r:n.innerWidth}:{height:e.clientHeight,width:e.clientWidth},s={current:{x:e.scrollLeft,y:e.scrollTop},max:{x:e.scrollWidth-a.width,y:e.scrollHeight-a.height}};return{rect:o,position:s,isTop:s.current.y<=0,isLeft:s.current.x<=0,isBottom:s.current.y>=s.max.y,isRight:s.current.x>=s.max.x}}function LM(e,t){const{isTop:r,isBottom:n,isLeft:o,isRight:i,position:a}=MM(e),{x:s,y:l}=null!=t?t:{x:0,y:0},u=!r&&a.current.y+l>0,c=!n&&a.current.y+l<a.max.y,d=!o&&a.current.x+s>0,p=!i&&a.current.x+s<a.max.x;return{top:u,bottom:c,left:d,right:p,x:d||p,y:u||c}}yM=new WeakMap,bM=new WeakMap,xM=new WeakMap,SM=new WeakMap;var AM=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))}},kM=new AM(e=>{"function"==typeof requestAnimationFrame?requestAnimationFrame(e):e()}),OM=new AM(e=>setTimeout(e,50)),qM=new Map,TM=qM.clear.bind(qM);function NM(e,t=!1){if(!t)return _M(e);let r=qM.get(e);return r||(r=_M(e),qM.set(e,r),OM.schedule(TM),r)}function _M(e){return qR(e).getComputedStyle(e)}var jM={excludeElement:!0,escapeShadowDOM:!0};function FM(e,t=jM){const{limit:r,excludeElement:n,escapeShadowDOM:o}=t,i=new Set;return e?function t(a){if(null!=r&&i.size>=r)return i;if(!a)return i;if(TR(a)&&null!=a.scrollingElement&&!i.has(a.scrollingElement))return i.add(a.scrollingElement),i;if(o&&GR(a))return t(a.host);if(!NR(a))return _R(a)?t(a.parentElement):i;if(i.has(a))return i;const s=NM(a,!0);if(n&&a===e||function(e,t=NM(e,!0)){const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const n=t[e];return"string"==typeof n&&r.test(n)})}(a,s)&&i.add(a),function(e,t=NM(e,!0)){return"fixed"===t.position||"sticky"===t.position}(a,s)){const{scrollingElement:e}=a.ownerDocument;return e&&i.add(e),i}return t(a.parentNode)}(e):i}function zM(e,t=window.frameElement){const r={x:0,y:0,scaleX:1,scaleY:1};if(!e)return r;let n=eM(e);for(;n;){if(n===t)return r;const e=AR(n),{x:o,y:i}=WM(n,e);r.x=r.x+e.left,r.y=r.y+e.top,r.scaleX=r.scaleX*o,r.scaleY=r.scaleY*i,n=eM(n)}return r}function WM(e,t=AR(e)){const r=Math.round(t.width),n=Math.round(t.height);if(NR(e))return{x:r/e.offsetWidth,y:n/e.offsetHeight};const o=NM(e,!0);return{x:(parseFloat(o.width)||r)/r,y:(parseFloat(o.height)||n)/n}}function $M(e){if("none"===e)return null;const[t,r,n="0"]=e.split(" "),o={x:parseFloat(t),y:parseFloat(r),z:parseInt(n,10)};return isNaN(o.x)&&isNaN(o.y)?null:{x:isNaN(o.x)?0:o.x,y:isNaN(o.y)?0:o.y,z:isNaN(o.z)?0:o.z}}function HM(e){var t,r,n,o,i,a,s,l,u;const{scale:c,transform:d,translate:p}=e,f=function(e){if("none"===e)return null;const t=e.split(" "),r=parseFloat(t[0]),n=parseFloat(t[1]);return isNaN(r)&&isNaN(n)?null:{x:isNaN(r)?n:r,y:isNaN(n)?r:n}}(c),h=$M(p),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&&!f&&!h)return null;const g=null!=(t=null==f?void 0:f.x)?t:1,v=null!=(r=null==f?void 0:f.y)?r:1,y=null!=(n=null==h?void 0:h.x)?n:0,b=null!=(o=null==h?void 0:h.y)?o:0,x=null!=(i=null==m?void 0:m.x)?i:0,S=null!=(a=null==m?void 0:m.y)?a:0,w=null!=(s=null==m?void 0:m.scaleX)?s:1,C=null!=(l=null==m?void 0:m.scaleY)?l:1;return{x:y+x,y:b+S,z:null!=(u=null==h?void 0:h.z)?u:0,scaleX:g*w,scaleY:v*C}}var VM=(e=>(e[e.Idle=0]="Idle",e[e.Forward=1]="Forward",e[e.Reverse=-1]="Reverse",e))(VM||{}),BM={x:.2,y:.2},GM={x:10,y:10};function UM(e,t,r,n=25,o=BM,i=GM){const{x:a,y:s}=t,{rect:l,isTop:u,isBottom:c,isLeft:d,isRight:p}=MM(e),f=zM(e),h=HM(NM(e,!0)),m=null!==h&&(null==h?void 0:h.scaleX)<0,g=null!==h&&(null==h?void 0:h.scaleY)<0,v=new ZI(l.left*f.scaleX+f.x,l.top*f.scaleY+f.y,l.width*f.scaleX,l.height*f.scaleY),y={x:0,y:0},b={x:0,y:0},x=v.height*o.y,S=v.width*o.x;return(!u||g&&!c)&&s<=v.top+x&&1!==(null==r?void 0:r.y)&&a>=v.left-i.x&&a<=v.right+i.x?(y.y=g?1:-1,b.y=n*Math.abs((v.top+x-s)/x)):(!c||g&&!u)&&s>=v.bottom-x&&-1!==(null==r?void 0:r.y)&&a>=v.left-i.x&&a<=v.right+i.x&&(y.y=g?-1:1,b.y=n*Math.abs((v.bottom-x-s)/x)),(!p||m&&!d)&&a>=v.right-S&&-1!==(null==r?void 0:r.x)&&s>=v.top-i.y&&s<=v.bottom+i.y?(y.x=m?-1:1,b.x=n*Math.abs((v.right-S-a)/S)):(!d||m&&!p)&&a<=v.left+S&&1!==(null==r?void 0:r.x)&&s>=v.top-i.y&&s<=v.bottom+i.y&&(y.x=m?1:-1,b.x=n*Math.abs((v.left+S-a)/S)),{direction:y,speed:b}}function YM(e,t=!1){if("scrollIntoViewIfNeeded"in(r=e)&&"function"==typeof r.scrollIntoViewIfNeeded)return void e.scrollIntoViewIfNeeded(t);var r;if(!NR(e))return e.scrollIntoView();var n=function(e){const[t]=FM(e,{limit:1});return null!=t?t:null}(e);if(!NR(n))return;const o=NM(n,!0),i=parseInt(o.getPropertyValue("border-top-width")),a=parseInt(o.getPropertyValue("border-left-width")),s=e.offsetTop-n.offsetTop<n.scrollTop,l=e.offsetTop-n.offsetTop+e.clientHeight-i>n.scrollTop+n.clientHeight,u=e.offsetLeft-n.offsetLeft<n.scrollLeft,c=e.offsetLeft-n.offsetLeft+e.clientWidth-a>n.scrollLeft+n.clientWidth,d=s&&!l;(s||l)&&t&&(n.scrollTop=e.offsetTop-n.offsetTop-n.clientHeight/2-i+e.clientHeight/2),(u||c)&&t&&(n.scrollLeft=e.offsetLeft-n.offsetLeft-n.clientWidth/2-a+e.clientWidth/2),(s||l||u||c)&&!t&&e.scrollIntoView(d)}function KM({element:e,keyframes:t,options:r}){return e.animate(t,r).finished}function XM(e,t=NM(e).translate,r=!0){if(r){const t=LR(e,e=>"translate"in e);if(t){const{translate:e=""}=t[0];if("string"==typeof e){const t=$M(e);if(t)return t}}}if(t){const e=$M(t);if(e)return e}return{x:0,y:0,z:0}}var JM=new AM(e=>setTimeout(e,0)),ZM=new Map,QM=ZM.clear.bind(ZM);function eL(e,t){const r=function(e){const t=e.ownerDocument;let r=ZM.get(t);if(r)return r;r=t.getAnimations(),ZM.set(t,r),JM.schedule(QM);const n=r.filter(t=>MR(t.effect)&&t.effect.target===e);return ZM.set(e,n),r}(e).filter(e=>{var r,n;if(MR(e.effect)){const{target:o}=e.effect;if(null==(n=o&&(null==(r=t.isValidTarget)?void 0:r.call(t,o)))||n)return e.effect.getKeyframes().some(e=>{for(const r of t.properties)if(e[r])return!0})}}).map(e=>{const{effect:t,currentTime:r}=e,n=null==t?void 0:t.getComputedTiming().duration;if(!e.pending&&"finished"!==e.playState)return"number"==typeof n&&"number"==typeof r&&r<n?(e.currentTime=n,()=>{e.currentTime=r}):void 0});if(r.length>0)return()=>r.forEach(e=>null==e?void 0:e())}var tL=class extends ZI{constructor(e,t={}){var r,n,o,i;const{frameTransform:a=zM(e),ignoreTransforms:s,getBoundingClientRect:l=AR}=t,u=eL(e,{properties:["transform","translate","scale","width","height"],isValidTarget:t=>(t!==e||VR())&&t.contains(e)}),c=l(e);let d,{top:p,left:f,width:h,height:m}=c;const g=NM(e),v=HM(g),y={x:null!=(r=null==v?void 0:v.scaleX)?r:1,y:null!=(n=null==v?void 0:v.scaleY)?n:1},b=function(e,t){var r;const n=e.getAnimations();let o=null;if(!n.length)return null;for(const e of n){if("running"!==e.playState)continue;const n=MR(e.effect)?e.effect.getKeyframes():[],i=n[n.length-1];if(!i)continue;const{transform:a,translate:s,scale:l}=i;if(a||s||l){const e=HM({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&&(o=o?{x:o.x+e.x,y:o.y+e.y,z:null!=(r=o.z)?r:e.z,scaleX:o.scaleX*e.scaleX,scaleY:o.scaleY*e.scaleY}:e)}}return o}(e,g);null==u||u(),v&&(d=function(e,t,r){const{scaleX:n,scaleY:o,x:i,y:a}=t,s=e.left-i-(1-n)*parseFloat(r),l=e.top-a-(1-o)*parseFloat(r.slice(r.indexOf(" ")+1)),u=n?e.width/n:e.width,c=o?e.height/o:e.height;return{width:u,height:c,top:l,right:s+u,bottom:l+c,left:s}}(c,v,g.transformOrigin),(s||b)&&(p=d.top,f=d.left,h=d.width,m=d.height));const x={width:null!=(o=null==d?void 0:d.width)?o:h,height:null!=(i=null==d?void 0:d.height)?i:m};if(b&&!s&&d){const e=function(e,t,r){const{scaleX:n,scaleY:o,x:i,y:a}=t,s=e.left+i+(1-n)*parseFloat(r),l=e.top+a+(1-o)*parseFloat(r.slice(r.indexOf(" ")+1)),u=n?e.width*n:e.width,c=o?e.height*o:e.height;return{width:u,height:c,top:l,right:s+u,bottom:l+c,left:s}}(d,b,g.transformOrigin);p=e.top,f=e.left,h=e.width,m=e.height,y.x=b.scaleX,y.y=b.scaleY}a&&(s||(f*=a.scaleX,h*=a.scaleX,p*=a.scaleY,m*=a.scaleY),f+=a.x,p+=a.y),super(f,p,h,m),this.scale=y,this.intrinsicWidth=x.width,this.intrinsicHeight=x.height}};function rL(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 nL=class{constructor(e){this.element=e,this.initial=new Map}set(e,t=""){const{element:r}=this;if(rL(r))for(const[n,o]of Object.entries(e)){const e=`${t}${n}`;this.initial.has(e)||this.initial.set(e,r.style.getPropertyValue(e)),r.style.setProperty(e,"string"==typeof o?o:`${o}px`)}}remove(e,t=""){const{element:r}=this;if(rL(r))for(const n of e){const e=`${t}${n}`;r.style.removeProperty(e)}}reset(){const{element:e}=this;if(rL(e)){for(const[t,r]of this.initial)e.style.setProperty(t,r);""===e.getAttribute("style")&&e.removeAttribute("style")}}};function oL(e){return!!e&&(e instanceof qR(e).Element||OR(e)&&e.nodeType===Node.ELEMENT_NODE)}function iL(e){if(!e)return!1;const{KeyboardEvent:t}=qR(e.target);return e instanceof t}var aL={};function sL(e){const t=null==aL[e]?0:aL[e]+1;return aL[e]=t,`${e}-${t}`}var lL=e=>{var t;return null!=(t=(({dragOperation:e,droppable:t})=>{const r=e.position.current;if(!r)return null;const{id:n}=t;if(!t.shape)return null;if(t.shape.containsPoint(r))return{id:n,value:1/JI.distance(t.shape.center,r),type:lP.PointerIntersection,priority:sP.High};return null})(e))?t:(({dragOperation:e,droppable:t})=>{const{shape:r}=e;if(!t.shape||!(null==r?void 0:r.current))return null;const n=r.current.intersectionArea(t.shape);if(n){const{position:o}=e,i=JI.distance(t.shape.center,o.current),a=n/(r.current.area+t.shape.area-n)/i;return{id:t.id,value:a,type:lP.ShapeIntersection,priority:sP.Normal}}return null})(e)},uL=e=>{const{dragOperation:t,droppable:r}=e,{shape:n,position:o}=t;if(!r.shape)return null;const i=n?ZI.from(n.current.boundingRectangle).corners:void 0,a=ZI.from(r.shape.boundingRectangle).corners.reduce((e,t,r)=>{var n;return e+JI.distance(JI.from(t),null!=(n=null==i?void 0:i[r])?n:o.current)},0),s=a/4;return{id:r.id,value:1/s,type:lP.Collision,priority:sP.Normal}},cL=Object.create,dL=Object.defineProperty,pL=Object.defineProperties,fL=Object.getOwnPropertyDescriptor,hL=Object.getOwnPropertyDescriptors,mL=Object.getOwnPropertySymbols,gL=Object.prototype.hasOwnProperty,vL=Object.prototype.propertyIsEnumerable,yL=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),bL=e=>{throw TypeError(e)},xL=(e,t,r)=>t in e?dL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,SL=(e,t)=>{for(var r in t||(t={}))gL.call(t,r)&&xL(e,r,t[r]);if(mL)for(var r of mL(t))vL.call(t,r)&&xL(e,r,t[r]);return e},wL=(e,t)=>pL(e,hL(t)),CL=(e,t)=>dL(e,"name",{value:t,configurable:!0}),EL=(e,t)=>{var r={};for(var n in e)gL.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&mL)for(var n of mL(e))t.indexOf(n)<0&&vL.call(e,n)&&(r[n]=e[n]);return r},IL=e=>{var t;return[,,,cL(null!=(t=null==e?void 0:e[yL("metadata")])?t:null)]},DL=["class","method","getter","setter","accessor","field","value","get","set"],PL=e=>void 0!==e&&"function"!=typeof e?bL("Function expected"):e,RL=(e,t,r,n,o)=>({kind:DL[e],name:t,metadata:n,addInitializer:e=>r._?bL("Already initialized"):o.push(PL(e||null))}),ML=(e,t)=>xL(t,yL("metadata"),e[3]),LL=(e,t,r,n)=>{for(var o=0,i=e[t>>1],a=i&&i.length;o<a;o++)1&t?i[o].call(r):n=i[o].call(r,n);return n},AL=(e,t,r,n,o,i)=>{var a,s,l,u,c,d=7&t,p=!!(8&t),f=!!(16&t),h=d>3?e.length+1:d?p?1:2:0,m=DL[d+5],g=d>3&&(e[h-1]=[]),v=e[h]||(e[h]=[]),y=d&&(!f&&!p&&(o=o.prototype),d<5&&(d>3||!f)&&fL(d<4?o:{get[r](){return qL(this,i)},set[r](e){return NL(this,i,e)}},r));d?f&&d<4&&CL(i,(d>2?"set ":d>1?"get ":"")+r):CL(o,r);for(var b=n.length-1;b>=0;b--)u=RL(d,r,l={},e[3],v),d&&(u.static=p,u.private=f,c=u.access={has:f?e=>OL(o,e):e=>r in e},3^d&&(c.get=f?e=>(1^d?qL:_L)(e,o,4^d?i:y.get):e=>e[r]),d>2&&(c.set=f?(e,t)=>NL(e,o,t,4^d?i:y.set):(e,t)=>e[r]=t)),s=(0,n[b])(d?d<4?f?i:y[m]:d>4?void 0:{get:y.get,set:y.set}:o,u),l._=1,4^d||void 0===s?PL(s)&&(d>4?g.unshift(s):d?f?i=s:y[m]=s:o=s):"object"!=typeof s||null===s?bL("Object expected"):(PL(a=s.get)&&(y.get=a),PL(a=s.set)&&(y.set=a),PL(a=s.init)&&g.unshift(a));return d||ML(e,o),y&&dL(o,r,y),f?4^d?i:y:o},kL=(e,t,r)=>t.has(e)||bL("Cannot "+r),OL=(e,t)=>Object(t)!==t?bL('Cannot use the "in" operator on this value'):e.has(t),qL=(e,t,r)=>(kL(e,t,"read from private field"),r?r.call(e):t.get(e)),TL=(e,t,r)=>t.has(e)?bL("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),NL=(e,t,r,n)=>(kL(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),_L=(e,t,r)=>(kL(e,t,"access private method"),r),jL="button",FL="draggable",zL="dnd-kit-description",WL="dnd-kit-announcement",$L={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."},HL={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:r}){if(e)return r?`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 VL(e){const t=e.tagName.toLowerCase();return["input","select","textarea","a","button"].includes(t)}var BL=["dragover","dragmove"];var GL,UL,YL,KL,XL,JL,ZL,QL,eA,tA,rA,nA,oA,iA=new Map,aA=class extends(XL=WD,KL=[EI],YL=[II],UL=[II],GL=[II],XL){constructor(e){super(e),LL(ZL,5,this),TL(this,eA),TL(this,JL,new Set),TL(this,QL,LL(ZL,8,this,new Set)),LL(ZL,11,this),this.registerEffect(_L(this,eA,tA))}register(e){return qL(this,JL).add(e),()=>{qL(this,JL).delete(e)}}addRoot(e){return pE(()=>{const t=new Set(this.additionalRoots);t.add(e),this.additionalRoots=t}),()=>{pE(()=>{const t=new Set(this.additionalRoots);t.delete(e),this.additionalRoots=t})}}get sourceRoot(){var e;const{source:t}=this.manager.dragOperation;return UR(null!=(e=null==t?void 0:t.element)?e:null)}get targetRoot(){var e;const{target:t}=this.manager.dragOperation;return UR(null!=(e=null==t?void 0:t.element)?e:null)}get roots(){const{status:e}=this.manager.dragOperation;if(e.initializing||e.initialized){const e=[this.sourceRoot,this.targetRoot].filter(e=>null!=e);return new Set([...e,...this.additionalRoots])}return new Set}};ZL=IL(XL),JL=new WeakMap,QL=new WeakMap,eA=new WeakSet,tA=function(){const{roots:e}=this,t=[];for(const r of e)for(const e of qL(this,JL))t.push(_L(this,eA,rA).call(this,r,e));return()=>{for(const e of t)e()}},rA=function(e,t){let r=iA.get(e);r||(r=new Map,iA.set(e,r));let n=r.get(t);if(!n){const o=TR(e)?_L(this,eA,nA).call(this,e,r,t):_L(this,eA,oA).call(this,e,r,t);if(!o)return()=>{};n=o,r.set(t,n)}n.refCount++;let o=!1;return()=>{o||(o=!0,n.refCount--,0===n.refCount&&n.cleanup())}},nA=function(e,t,r){const n=e.createElement("style");n.textContent=r,e.head.prepend(n);const o=new MutationObserver(t=>{for(const r of t)for(const t of Array.from(r.removedNodes))if(t===n)return void e.head.prepend(n)});return o.observe(e.head,{childList:!0}),{refCount:0,cleanup:()=>{o.disconnect(),n.remove(),t.delete(r),0===t.size&&iA.delete(e)}}},oA=function(e,t,r){!("adoptedStyleSheets"in e)||Array.isArray(e.adoptedStyleSheets);const n=e.ownerDocument.defaultView,{CSSStyleSheet:o}=null!=n?n:{};if(!o)return null;const i=new o;return i.replaceSync(r),e.adoptedStyleSheets.push(i),{refCount:0,cleanup:()=>{var n;if(GR(e)&&(null==(n=e.host)?void 0:n.isConnected)){const t=e.adoptedStyleSheets.indexOf(i);-1!==t&&e.adoptedStyleSheets.splice(t,1)}t.delete(r),0===t.size&&iA.delete(e)}}},AL(ZL,4,"additionalRoots",KL,aA,QL),AL(ZL,2,"sourceRoot",YL,aA),AL(ZL,2,"targetRoot",UL,aA),AL(ZL,2,"roots",GL,aA),ML(ZL,aA);var sA="data-dnd-",lA=`${sA}dropping`,uA="--dnd-",cA=`${sA}dragging`,dA=`${sA}placeholder`,pA=[cA,dA,"popover","aria-pressed","aria-grabbing"],fA=["view-transition-name"],hA=`\n :is(:root,:host) [${cA}] {\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(${uA}top, 0px) !important;\n left: var(${uA}left, 0px) !important;\n right: unset !important;\n bottom: unset !important;\n width: var(${uA}width, auto);\n max-width: var(${uA}width, auto);\n height: var(${uA}height, auto);\n max-height: var(${uA}height, auto);\n transition: var(${uA}transition) !important;\n }\n\n :is(:root,:host) [${dA}] {\n transition: none;\n }\n\n :is(:root,:host) [${dA}='hidden'] {\n visibility: hidden;\n }\n\n [${cA}] * {\n pointer-events: none !important;\n }\n\n [${cA}]:not([${lA}]) {\n translate: var(${uA}translate) !important;\n }\n\n [${cA}][style*='${uA}scale'] {\n scale: var(${uA}scale) !important;\n transform-origin: var(${uA}transform-origin) !important;\n }\n\n @layer dnd-kit {\n :where([${cA}][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 [${cA}]::backdrop, [${sA}overlay]:not([${cA}]) {\n display: none;\n visibility: hidden;\n }\n`.replace(/\n+/g," ").replace(/\s+/g," ").trim();function mA(e,t="hidden"){return pE(()=>{const{element:r,manager:n}=e;if(!r||!n)return;const o=function(e,t){const r=new Map;for(const n of t)if(n.element&&(e===n.element||e.contains(n.element))){const e=`${sA}${sL("dom-id")}`;n.element.setAttribute(e,""),r.set(n,e)}return r}(r,n.registry.droppables),i=[],a=function(e){const t="input, textarea, select, canvas, [contenteditable]",r=e.cloneNode(!0),n=Array.from(e.querySelectorAll(t));return Array.from(r.querySelectorAll(t)).forEach((e,t)=>{const r=n[t];if(KR(e)&&KR(r)&&("file"!==e.type&&(e.value=r.value),"radio"===e.type&&e.name&&(e.name=`Cloned__${e.name}`)),XR(e)&&XR(r)&&r.width>0&&r.height>0){const t=e.getContext("2d");null==t||t.drawImage(r,0,0)}}),r}(r),{remove:s}=a;return function(e,t,r){for(const[n,o]of e){if(!n.element)continue;const e=`[${o}]`,i=t.matches(e)?t:t.querySelector(e);if(n.element.removeAttribute(o),!i)continue;const a=n.element;n.proxy=i,i.removeAttribute(o),ZR.set(a,i),r.push(()=>{ZR.delete(a),n.proxy=void 0})}}(o,a,i),function(e,t="hidden"){e.setAttribute("inert","true"),e.setAttribute("tab-index","-1"),e.setAttribute("aria-hidden","true"),e.setAttribute(dA,t)}(a,t),a.remove=()=>{i.forEach(e=>e()),s.call(a)},a})}function gA(e,t){return e===t||eM(e)===eM(t)}function vA(e){const{target:t}=e;"newState"in e&&"closed"===e.newState&&oL(t)&&t.hasAttribute("popover")&&requestAnimationFrame(()=>PM(t))}function yA(e){return"TR"===e.tagName}var bA,xA,SA,wA,CA,EA,IA,DA=250,PA="ease";var RA=class extends(xA=FD,bA=[EI],xA){constructor(e,t){super(e,t),TL(this,CA),TL(this,wA,LL(SA,8,this)),LL(SA,11,this),this.state={initial:{},current:{}};const r=e.registry.plugins.get(aA),n=null==r?void 0:r.register(hA);if(n){const e=this.destroy.bind(this);this.destroy=()=>{n(),e()}}this.registerEffect(_L(this,CA,EA).bind(this,r)),this.registerEffect(_L(this,CA,IA))}};SA=IL(xA),wA=new WeakMap,CA=new WeakSet,EA=function(e){const{overlay:t}=this;if(!t||!e)return;const r=UR(t);return r?e.addRoot(r):void 0},IA=function(){var e,t,r;const{state:n,manager:o,options:i}=this,{dragOperation:a}=o,{position:s,source:l,status:u}=a;if(u.idle)return n.current={},void(n.initial={});if(!l)return;const{element:c,feedback:d}=l;if(!c||"none"===d||!u.initialized||u.initializing)return;const{initial:p}=n,f=null!=(e=this.overlay)?e:c,h=zM(f),m=zM(c),g=!gA(c,f),v=new tL(c,{frameTransform:g?m:null,ignoreTransforms:!g}),y=m.scaleX/h.scaleX,b=m.scaleY/h.scaleY;let{width:x,height:S,top:w,left:C}=v;g&&(x/=y,S/=b);const E=new nL(f),{transition:I,translate:D,boxSizing:P,paddingBlockStart:R,paddingBlockEnd:M,paddingInlineStart:L,paddingInlineEnd:A,borderInlineStartWidth:k,borderInlineEndWidth:O,borderBlockStartWidth:q,borderBlockEndWidth:T}=NM(c),N="clone"===d,_="content-box"===P,j=_?parseInt(L)+parseInt(A)+parseInt(k)+parseInt(O):0,F=_?parseInt(R)+parseInt(M)+parseInt(q)+parseInt(T):0,z="move"===d||this.overlay?null:mA(l,N?"clone":"hidden"),W=pE(()=>iL(o.dragOperation.activatorEvent));if("none"!==D){const e=$M(D);e&&!p.translate&&(p.translate=e)}if(!p.transformOrigin){const e=pE(()=>s.current);p.transformOrigin={x:(e.x-C*h.scaleX-h.x)/(x*h.scaleX),y:(e.y-w*h.scaleY-h.y)/(S*h.scaleY)}}const{transformOrigin:$}=p,H=w*h.scaleY+h.y,V=C*h.scaleX+h.x;if(!p.coordinates&&(p.coordinates={x:V,y:H},1!==y||1!==b)){const{scaleX:e,scaleY:t}=m,{x:r,y:n}=$;p.coordinates.x+=(x*e-x)*r,p.coordinates.y+=(S*t-S)*n}p.dimensions||(p.dimensions={width:x,height:S}),p.frameTransform||(p.frameTransform=h);const B=p.coordinates.x-V,G=p.coordinates.y-H,U=(p.dimensions.width*p.frameTransform.scaleX-x*h.scaleX)*$.x,Y=(p.dimensions.height*p.frameTransform.scaleY-S*h.scaleY)*$.y,K={x:B/h.scaleX+U,y:G/h.scaleY+Y},X=C+K.x,J=w+K.y;f.setAttribute(cA,"true");const Z=pE(()=>a.transform),Q=null!=(t=p.translate)?t:{x:0,y:0},ee=Z.x*h.scaleX+Q.x,te=Z.y*h.scaleY+Q.y,re=BR();if(E.set({width:x-j,height:S-F,top:J+re.y,left:X+re.x,translate:`${ee}px ${te}px 0`,transition:I?`${I}, translate 0ms linear`:"",scale:g?`${y} ${b}`:"","transform-origin":`${100*$.x}% ${100*$.y}%`},uA),z&&(c.insertAdjacentElement("afterend",z),null==i?void 0:i.rootElement)){("function"==typeof i.rootElement?i.rootElement(l):i.rootElement).appendChild(c)}let ne,oe,ie;DM(f)&&(f.hasAttribute("popover")||f.setAttribute("popover","manual"),PM(f),f.addEventListener("beforetoggle",vA));const ae=(se={placeholder:z,element:c,feedbackElement:f,frameTransform:h,transformOrigin:$,width:x,height:S,top:w,left:C,widthOffset:j,heightOffset:F,delta:K,styles:E,dragOperation:a,getElementMutationObserver:()=>ne,getSavedCellWidths:()=>ie,setSavedCellWidths:e=>{ie=e}},new ResizeObserver(()=>{var e,t;const r=new tL(se.placeholder,{frameTransform:se.frameTransform,ignoreTransforms:!0}),n=null!=(e=se.transformOrigin)?e:{x:1,y:1},o=(se.width-r.width)*n.x+se.delta.x,i=(se.height-r.height)*n.y+se.delta.y,a=BR();if(se.styles.set({width:r.width-se.widthOffset,height:r.height-se.heightOffset,top:se.top+i+a.y,left:se.left+o+a.x},uA),null==(t=se.getElementMutationObserver())||t.takeRecords(),yA(se.element)&&yA(se.placeholder)){const e=Array.from(se.element.cells),t=Array.from(se.placeholder.cells);se.getSavedCellWidths()||se.setSavedCellWidths(e.map(e=>e.style.width));for(const[r,n]of e.entries()){const e=t[r];n.style.width=`${e.getBoundingClientRect().width}px`}}se.dragOperation.shape=new tL(se.feedbackElement)}));var se;const le=new tL(f);pE(()=>a.shape=le);const ue=qR(f),ce=e=>{this.manager.actions.stop({event:e})},de=YR(ue);W&&ue.addEventListener("resize",ce),"idle"===pE(()=>l.status)&&requestAnimationFrame(()=>l.status="dragging"),z&&(ae.observe(z),ne=function(e,t,r){const n=new MutationObserver(n=>{let o=!1;for(const r of n){if(r.target!==e){o=!0;continue}if("attributes"!==r.type)continue;const n=r.attributeName;if(n.startsWith("aria-")||pA.includes(n))continue;const i=e.getAttribute(n);if("style"===n){if(rL(e)&&rL(t)){const r=e.style;for(const e of Array.from(t.style))""===r.getPropertyValue(e)&&t.style.removeProperty(e);for(const e of Array.from(r)){if(fA.includes(e)||e.startsWith(uA))continue;const n=r.getPropertyValue(e);t.style.setProperty(e,n)}}}else null!==i?t.setAttribute(n,i):t.removeAttribute(n)}o&&r&&(t.innerHTML=e.innerHTML)});return n.observe(e,{attributes:!0,subtree:!0,childList:!0}),n}(c,z,N),oe=function(e,t,r){const n=new MutationObserver(n=>{for(const o of n)if(0!==o.addedNodes.length)for(const n of Array.from(o.addedNodes)){if(n.contains(e)&&e.nextElementSibling!==t)return e.insertAdjacentElement("afterend",t),void PM(r);if(n.contains(t)&&t.previousElementSibling!==e)return t.insertAdjacentElement("beforebegin",e),void PM(r)}});return n.observe(e.ownerDocument.body,{childList:!0,subtree:!0}),n}(c,z,f));const pe=null==(r=o.dragOperation.source)?void 0:r.id,fe=()=>{var e;if(!W||null==pe)return;const t=o.registry.draggables.get(pe),r=null!=(e=null==t?void 0:t.handle)?e:null==t?void 0:t.element;NR(r)&&r.focus()},he=()=>{var e;if(null==ne||ne.disconnect(),null==oe||oe.disconnect(),ae.disconnect(),ue.removeEventListener("resize",ce),DM(f)&&(f.removeEventListener("beforetoggle",vA),f.removeAttribute("popover")),f.removeAttribute(cA),E.reset(),ie&&yA(c)){const t=Array.from(c.cells);for(const[r,n]of t.entries())n.style.width=null!=(e=ie[r])?e:""}l.status="idle";const t=null!=n.current.translate;z&&(t||z.parentElement!==f.parentElement)&&f.isConnected&&z.replaceWith(f),null==z||z.remove()},me=null==i?void 0:i.dropAnimation,ge=this,ve=PI(()=>{var e;const{transform:t,status:r}=a;if((t.x||t.y||n.current.translate)&&r.dragging){const r=null!=(e=p.translate)?e:{x:0,y:0},o={x:t.x/h.scaleX+r.x,y:t.y/h.scaleY+r.y},i=n.current.translate,s=pE(()=>a.modifiers),l=pE(()=>{var e;return null==(e=a.shape)?void 0:e.current}),u=W&&!de?"250ms cubic-bezier(0.25, 1, 0.5, 1)":"0ms linear";if(E.set({transition:`${I}, translate ${u}`,translate:`${o.x}px ${o.y}px 0`},uA),null==ne||ne.takeRecords(),l&&l!==le&&i&&!s.length){const e=JI.delta(o,i);a.shape=ZI.from(l.boundingRectangle).translate(e.x*h.scaleX,e.y*h.scaleY)}else a.shape=new tL(f);n.current.translate=o}},function(){if(a.status.dropped){this.dispose(),l.status="dropping";const e=void 0!==ge.dropAnimation?ge.dropAnimation:me;let t=n.current.translate;const r=null!=t;if(t||c===f||(t={x:0,y:0}),!t||null===e)return void he();o.renderer.rendering.then(()=>{!function(e){var t,r,n,o;const{animation:i}=e;if("function"==typeof i){const t=i({element:e.element,feedbackElement:e.feedbackElement,placeholder:e.placeholder,translate:e.translate,moved:e.moved});return void Promise.resolve(t).then(()=>{e.cleanup(),requestAnimationFrame(e.restoreFocus)})}const{duration:a=DA,easing:s=PA}=null!=i?i:{};PM(e.feedbackElement);const[,l]=null!=(t=LR(e.feedbackElement,e=>"translate"in e))?t:[];null==l||l.pause();const u=null!=(r=e.placeholder)?r:e.element,c={frameTransform:gA(e.feedbackElement,u)?null:void 0},d=new tL(e.feedbackElement,c),p=null!=(n=$M(NM(e.feedbackElement).translate))?n:e.translate,f=new tL(u,c),h=ZI.delta(d,f,e.alignment),m=p.x-h.x,g=p.y-h.y,v=Math.round(d.intrinsicHeight)!==Math.round(f.intrinsicHeight)?{minHeight:[`${d.intrinsicHeight}px`,`${f.intrinsicHeight}px`],maxHeight:[`${d.intrinsicHeight}px`,`${f.intrinsicHeight}px`]}:{},y=Math.round(d.intrinsicWidth)!==Math.round(f.intrinsicWidth)?{minWidth:[`${d.intrinsicWidth}px`,`${f.intrinsicWidth}px`],maxWidth:[`${d.intrinsicWidth}px`,`${f.intrinsicWidth}px`]}:{};e.styles.set({transition:e.transition},uA),e.feedbackElement.setAttribute(lA,""),null==(o=e.getElementMutationObserver())||o.takeRecords(),KM({element:e.feedbackElement,keyframes:wL(SL(SL({},v),y),{translate:[`${p.x}px ${p.y}px 0`,`${m}px ${g}px 0`]}),options:{duration:YR(qR(e.feedbackElement))?0:e.moved||e.feedbackElement!==e.element?a:0,easing:s}}).then(()=>{e.feedbackElement.removeAttribute(lA),null==l||l.finish(),e.cleanup(),requestAnimationFrame(e.restoreFocus)})}({element:c,feedbackElement:f,placeholder:z,translate:t,moved:r,transition:I,alignment:l.alignment,styles:E,animation:null!=e?e:void 0,getElementMutationObserver:()=>ne,cleanup:he,restoreFocus:fe})})}});return()=>{he(),ve()}},AL(SA,4,"overlay",bA,RA,wA),ML(SA,RA),RA.configure=_D(RA);var MA,LA,AA,kA,OA,qA,TA,NA=RA,_A=!0;AA=[EI],kA=VM.Forward,MA=[EI],LA=VM.Reverse;var jA=class{constructor(){TL(this,qA,LL(OA,8,this,_A)),LL(OA,11,this),TL(this,TA,LL(OA,12,this,_A)),LL(OA,15,this)}isLocked(e){return e!==VM.Idle&&(null==e?this[VM.Forward]===_A&&this[VM.Reverse]===_A:this[e]===_A)}unlock(e){e!==VM.Idle&&(this[e]=false)}};OA=IL(null),qA=new WeakMap,TA=new WeakMap,AL(OA,4,kA,AA,jA,qA),AL(OA,4,LA,MA,jA,TA),ML(OA,jA);var FA,zA,WA,$A,HA,VA,BA=[VM.Forward,VM.Reverse],GA=class{constructor(){this.x=new jA,this.y=new jA}isLocked(){return this.x.isLocked()&&this.y.isLocked()}},UA=class extends FD{constructor(e){super(e);const t=wE(new GA);let r=null;this.signal=t,kE(()=>{const{status:n}=e.dragOperation;if(!n.initialized)return r=null,void(t.value=new GA);const{delta:o}=e.dragOperation.position;if(r){const e={x:YA(o.x,r.x),y:YA(o.y,r.y)},n=t.peek();cE(()=>{for(const t of sD)for(const r of BA)e[t]===r&&n[t].unlock(r);t.value=n})}r=o})}get current(){return this.signal.peek()}};function YA(e,t){return Math.sign(e-t)}var KA=class extends(zA=WD,FA=[EI],zA){constructor(e){super(e),TL(this,$A,LL(WA,8,this,!1)),LL(WA,11,this),TL(this,HA),TL(this,VA,()=>{if(!qL(this,HA))return;const{element:e,by:t}=qL(this,HA);t.y&&(e.scrollTop+=t.y),t.x&&(e.scrollLeft+=t.x)}),this.scroll=e=>{var t;if(this.disabled)return!1;const r=this.getScrollableElements();if(!r)return NL(this,HA,void 0),!1;const{position:n}=this.manager.dragOperation,o=null==n?void 0:n.current;if(o){const{by:n}=null!=e?e:{},i=n?{x:XA(n.x),y:XA(n.y)}:void 0,a=i?void 0:this.scrollIntentTracker.current;if(null==a?void 0:a.isLocked())return!1;for(const e of r){const r=LM(e,n);if(r.x||r.y){const{speed:r,direction:s}=UM(e,o,i);if(a)for(const e of sD)a[e].isLocked(s[e])&&(r[e]=0,s[e]=0);if(s.x||s.y){const{x:o,y:i}=null!=n?n:s,a=o*r.x,l=i*r.y;if(a||l){const r=null==(t=qL(this,HA))?void 0:t.by;if(this.autoScrolling&&r){if(r.x&&!a||r.y&&!l)continue}return NL(this,HA,{element:e,by:{x:a,y:l}}),kM.schedule(qL(this,VA)),!0}}}}}return NL(this,HA,void 0),!1};let t=null,r=null;const n=wI(()=>{const{position:r,source:n}=e.dragOperation;if(!r)return null;const o=JR(UR(null==n?void 0:n.element),r.current);return o&&(t=o),null!=o?o:t}),o=wI(()=>{const t=n.value,{documentElement:o}=jR(t);if(!t||t===o){const{target:t}=e.dragOperation,n=null==t?void 0:t.element;if(n){const e=FM(n,{excludeElement:!1});return r=e,e}}if(t){const e=FM(t,{excludeElement:!1});return this.autoScrolling&&r&&e.size<(null==r?void 0:r.size)?r:(r=e,e)}return r=null,null},CI);this.getScrollableElements=()=>o.value,this.scrollIntentTracker=new UA(e),this.destroy=e.monitor.addEventListener("dragmove",t=>{!this.disabled&&!t.defaultPrevented&&iL(e.dragOperation.activatorEvent)&&t.by&&this.scroll({by:t.by})&&t.preventDefault()})}};function XA(e){return e>0?VM.Forward:e<0?VM.Reverse:VM.Idle}WA=IL(zA),$A=new WeakMap,HA=new WeakMap,VA=new WeakMap,AL(WA,4,"autoScrolling",FA,KA,$A),ML(WA,KA);var JA,ZA=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()}),QA=class extends FD{constructor(e,t){super(e);const r=e.registry.plugins.get(KA);if(!r)throw new Error("AutoScroller plugin depends on Scroller plugin");this.destroy=kE(()=>{if(this.disabled)return;const{position:t,status:n}=e.dragOperation;if(n.dragging){if(r.scroll()){r.autoScrolling=!0;const e=setInterval(()=>ZA.schedule(r.scroll),10);return()=>{clearInterval(e)}}r.autoScrolling=!1}})}},ek={capture:!0,passive:!0},tk=class extends WD{constructor(e){super(e),TL(this,JA),this.handleScroll=()=>{null==qL(this,JA)&&NL(this,JA,setTimeout(()=>{this.manager.collisionObserver.forceUpdate(!1),NL(this,JA,void 0)},50))};const{dragOperation:t}=this.manager;this.destroy=kE(()=>{var e,r,n;if(t.status.dragging){const o=null!=(n=null==(r=null==(e=t.source)?void 0:e.element)?void 0:r.ownerDocument)?n:document;return o.addEventListener("scroll",this.handleScroll,ek),()=>{o.removeEventListener("scroll",this.handleScroll,ek)}}})}};JA=new WeakMap;function rk(){var e;null==(e=document.getSelection())||e.removeAllRanges()}var nk,ok=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 r;const n=null!=(r=t.handle)?r:t.element;return e.target!==n}}),ik=class extends KP{constructor(e,t){super(e),this.manager=e,this.options=t,TL(this,nk,[]),this.listeners=new QR,this.handleSourceKeyDown=(e,t,r)=>{if(this.disabled||e.defaultPrevented)return;if(!oL(e.target))return;if(t.disabled)return;const{keyboardCodes:n=ok.keyboardCodes,preventActivation:o=ok.preventActivation}=null!=r?r:{};n.start.includes(e.code)&&this.manager.dragOperation.status.idle&&((null==o?void 0:o(e,t))||this.handleStart(e,t,r))}}bind(e,t=this.options){const r=kE(()=>{var r;const n=null!=(r=e.handle)?r:e.element,o=r=>{iL(r)&&this.handleSourceKeyDown(r,e,t)};if(n)return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}});return r}handleStart(e,t,r){const{element:n}=t;if(!n)throw new Error("Source draggable does not have an associated element");e.preventDefault(),e.stopImmediatePropagation(),YM(n);const{center:o}=new tL(n);if(this.manager.actions.start({event:e,coordinates:{x:o.x,y:o.y},source:t}).signal.aborted)return this.cleanup();this.sideEffects();const i=jR(n),a=[this.listeners.bind(i,[{type:"keydown",listener:e=>this.handleKeyDown(e,t,r),options:{capture:!0}}])];qL(this,nk).push(...a)}handleKeyDown(e,t,r){const{keyboardCodes:n=ok.keyboardCodes}=null!=r?r:{};if(lk(e,[...n.end,...n.cancel])){e.preventDefault();const t=lk(e,n.cancel);return void this.handleEnd(e,t)}lk(e,n.up)?this.handleMove("up",e):lk(e,n.down)&&this.handleMove("down",e),lk(e,n.left)?this.handleMove("left",e):lk(e,n.right)&&this.handleMove("right",e)}handleEnd(e,t){this.manager.actions.stop({event:e,canceled:t}),this.cleanup()}handleMove(e,t){var r,n;const{shape:o}=this.manager.dragOperation,i=t.shiftKey?5:1;let a={x:0,y:0},s=null!=(n=null==(r=this.options)?void 0:r.offset)?n:ok.offset;if("number"==typeof s&&(s={x:s,y:s}),o){switch(e){case"up":a={x:0,y:-s.y*i};break;case"down":a={x:0,y:s.y*i};break;case"left":a={x:-s.x*i,y:0};break;case"right":a={x:s.x*i,y:0}}(a.x||a.y)&&(t.preventDefault(),this.manager.actions.move({event:t,by:a}))}}sideEffects(){const e=this.manager.registry.plugins.get(QA);!1===(null==e?void 0:e.disabled)&&(e.disable(),qL(this,nk).push(()=>{e.enable()}))}cleanup(){qL(this,nk).forEach(e=>e()),NL(this,nk,[])}destroy(){this.cleanup(),this.listeners.clear()}};nk=new WeakMap,ik.configure=_D(ik),ik.defaults=ok;var ak,sk=ik;function lk(e,t){return t.includes(e.code)}var uk,ck;ak=new WeakMap;uk=new WeakMap,ck=new WeakMap;var dk=class{};dk.Delay=class extends JP{constructor(){super(...arguments),TL(this,uk),TL(this,ck)}onEvent(e){switch(e.type){case"pointerdown":NL(this,ck,WR(e)),NL(this,uk,setTimeout(()=>this.activate(e),this.options.value));break;case"pointermove":if(!qL(this,ck))return;const{x:t,y:r}=WR(e);tD({x:t-qL(this,ck).x,y:r-qL(this,ck).y},this.options.tolerance)&&this.abort();break;case"pointerup":this.abort()}}abort(){qL(this,uk)&&(clearTimeout(qL(this,uk)),NL(this,ck,void 0),NL(this,uk,void 0))}},dk.Distance=class extends JP{constructor(){super(...arguments),TL(this,ak)}onEvent(e){switch(e.type){case"pointerdown":NL(this,ak,WR(e));break;case"pointermove":if(!qL(this,ak))return;const{x:t,y:r}=WR(e),n={x:t-qL(this,ak).x,y:r-qL(this,ak).y},{tolerance:o}=this.options;if(o&&tD(n,o))return void this.abort();tD(n,this.options.value)&&this.activate(e);break;case"pointerup":this.abort()}}abort(){NL(this,ak,void 0)}};var pk,fk=Object.freeze({activationConstraints(e,t){var r;const{pointerType:n,target:o}=e;if("mouse"!==n||!oL(o)||t.handle!==o&&!(null==(r=t.handle)?void 0:r.contains(o)))return"touch"===n?[new dk.Delay({value:250,tolerance:5})]:function(e){if(!oL(e))return!1;const{tagName:t}=e;return"INPUT"===t||"TEXTAREA"===t||(r=e).hasAttribute("contenteditable")&&"false"!==r.getAttribute("contenteditable");var r}(o)&&!e.defaultPrevented?[new dk.Delay({value:200,tolerance:0})]:[new dk.Delay({value:200,tolerance:10}),new dk.Distance({value:5})]},preventActivation(e,t){var r;const{target:n}=e;return n!==t.element&&(n!==t.handle&&(!!oL(n)&&(!(null==(r=t.handle)?void 0:r.contains(n))&&Boolean(n.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 ')))))}}),hk=class extends KP{constructor(e,t){super(e),this.manager=e,this.options=t,TL(this,pk,new Set),this.listeners=new QR,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,r=this.options){const{activationConstraints:n=fk.activationConstraints}=null!=r?r:{};return"function"==typeof n?n(e,t):n}bind(e,t=this.options){const r=kE(()=>{var r;const n=new AbortController,{signal:o}=n,i=r=>{(function(e){if(!e)return!1;const{PointerEvent:t}=qR(e.target);return e instanceof t})(r)&&this.handlePointerDown(r,e,t)};let a=[null!=(r=e.handle)?r:e.element];(null==t?void 0:t.activatorElements)&&(a=Array.isArray(t.activatorElements)?t.activatorElements:t.activatorElements(e));for(const e of a)e&&(bk(e.ownerDocument.defaultView),e.addEventListener("pointerdown",i,{signal:o}));return()=>n.abort()});return r}handlePointerDown(e,t,r){if(this.disabled||!e.isPrimary||0!==e.button||!oL(e.target)||t.disabled||function(e){return"sensor"in e}(e)||!this.manager.dragOperation.status.idle)return;const{preventActivation:n=fk.preventActivation}=null!=r?r:{};if(null==n?void 0:n(e,t))return;const{target:o}=e,i=NR(o)&&o.draggable&&"true"===o.getAttribute("draggable"),a=zM(t.element),{x:s,y:l}=WR(e);this.initialCoordinates={x:s*a.scaleX+a.x,y:l*a.scaleY+a.y};const u=this.activationConstraints(e,t,r);e.sensor=this;const c=new XP(u,e=>this.handleStart(t,e));c.signal.onabort=()=>this.handleCancel(e),c.onEvent(e),this.controller=c;const d=HR(),p=this.listeners.bind(d,[{type:"pointermove",listener:e=>this.handlePointerMove(e,t)},{type:"pointerup",listener:this.handlePointerUp,options:{capture:!0}},{type:"pointercancel",listener:this.handleCancel},{type:"dragstart",listener:i?this.handleCancel:gk,options:{capture:!0}}]);qL(this,pk).add(()=>{p(),this.initialCoordinates=void 0})}handlePointerMove(e,t){var r,n;if(!1!==(null==(r=this.controller)?void 0:r.activated)){if(this.manager.dragOperation.status.dragging){const r=WR(e),n=zM(t.element);r.x=r.x*n.scaleX+n.x,r.y=r.y*n.scaleY+n.y,e.preventDefault(),e.stopPropagation(),this.latest.event=e,this.latest.coordinates=r,kM.schedule(this.handleMove)}}else null==(n=this.controller)||n.onEvent(e)}handlePointerUp(e){const{status:t}=this.manager.dragOperation;if(!t.idle){e.preventDefault(),e.stopPropagation();const r=!t.initialized;this.manager.actions.stop({event:e,canceled:r})}this.cleanup()}handleKeyDown(e){"Escape"===e.key&&(e.preventDefault(),this.handleCancel(e))}handleStart(e,t){const{manager:r,initialCoordinates:n}=this;if(!n||!r.dragOperation.status.idle)return;if(t.defaultPrevented)return;if(r.actions.start({coordinates:n,event:t,source:e}).signal.aborted)return this.cleanup();t.preventDefault();const o=jR(t.target).body;o.setPointerCapture(t.pointerId);const i=oL(t.target)?[t.target,o]:o,a=this.listeners.bind(i,[{type:"touchmove",listener:gk,options:{passive:!1}},{type:"click",listener:gk},{type:"contextmenu",listener:gk},{type:"keydown",listener:this.handleKeyDown}]);qL(this,pk).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},qL(this,pk).forEach(e=>e()),qL(this,pk).clear()}destroy(){this.cleanup(),this.listeners.clear()}};pk=new WeakMap,hk.configure=_D(hk),hk.defaults=fk;var mk=hk;function gk(e){e.preventDefault()}function vk(){}var yk=new WeakSet;function bk(e){e&&!yk.has(e)&&(e.addEventListener("touchmove",vk,{capture:!1,passive:!1}),yk.add(e))}var xk,Sk,wk,Ck,Ek,Ik,Dk,Pk,Rk,Mk,Lk,Ak,kk,Ok,qk,Tk,Nk,_k,jk={modifiers:[],plugins:[class extends FD{constructor(e,t){super(e);const{id:r,idPrefix:{description:n=zL,announcement:o=WL}={},announcements:i=HL,screenReaderInstructions:a=$L,debounce:s=500}=null!=t?t:{},l=r?`${n}-${r}`:sL(n),u=r?`${o}-${r}`:sL(o);let c,d,p,f;const h=(e=f)=>{p&&e&&(null==p?void 0:p.nodeValue)!==e&&(p.nodeValue=e)},m=()=>kM.schedule(h),g=function(e,t){let r;const n=()=>{clearTimeout(r),r=setTimeout(e,t)};return n.cancel=()=>clearTimeout(r),n}(m,s),v=Object.entries(i).map(([e,t])=>this.manager.monitor.addEventListener(e,(r,n)=>{const o=p;if(!o)return;const i=null==t?void 0:t(r,n);i&&o.nodeValue!==i&&(f=i,BL.includes(e)?g():(m(),g.cancel()))})),y=()=>{let e=[];(null==c?void 0:c.isConnected)||(c=function(e,t){const r=document.createElement("div");return r.id=e,r.style.setProperty("display","none"),r.textContent=t,r}(l,a.draggable),e.push(c)),(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}(u),p=document.createTextNode(""),d.appendChild(p),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 r=null!=(e=t.handle)?e:t.element;if(r){c&&d||b.add(y),VL(r)&&!VR()||r.hasAttribute("tabindex")||b.add(()=>r.setAttribute("tabindex","0")),r.hasAttribute("role")||"button"===r.tagName.toLowerCase()||b.add(()=>r.setAttribute("role",jL)),r.hasAttribute("aria-roledescription")||b.add(()=>r.setAttribute("aria-roledescription",FL)),r.hasAttribute("aria-describedby")||b.add(()=>r.setAttribute("aria-describedby",l));for(const e of["aria-pressed","aria-grabbed"]){const n=String(t.isDragging);r.getAttribute(e)!==n&&b.add(()=>r.setAttribute(e,n))}const e=String(t.disabled);r.getAttribute("aria-disabled")!==e&&b.add(()=>r.setAttribute("aria-disabled",e))}}b.size>0&&kM.schedule(x)}),this.destroy=()=>{super.destroy(),null==c||c.remove(),null==d||d.remove(),v.forEach(e=>e())}}},QA,class extends FD{constructor(e,t){super(e,t),this.manager=e;const r=wI(()=>{var e;return jR(null==(e=this.manager.dragOperation.source)?void 0:e.element)});this.destroy=kE(()=>{var e;const{dragOperation:t}=this.manager,{cursor:n="grabbing",nonce:o}=null!=(e=this.options)?e:{};if(t.status.initialized){const e=r.value,t=e.createElement("style");return o&&t.setAttribute("nonce",o),t.textContent=`* { cursor: ${n} !important; }`,e.head.appendChild(t),()=>t.remove()}})}},NA,class extends FD{constructor(e,t){super(e,t),this.manager=e,this.destroy=kE(()=>{var e;const{dragOperation:t}=this.manager,{nonce:r}=null!=(e=this.options)?e:{};if(t.status.initialized){const e=document.createElement("style");return r&&e.setAttribute("nonce",r),e.textContent="* { user-select: none !important; -webkit-user-select: none !important; }",document.head.appendChild(e),rk(),document.addEventListener("selectionchange",rk,{capture:!0}),()=>{document.removeEventListener("selectionchange",rk,{capture:!0}),e.remove()}}})}}],sensors:[mk,sk]},Fk=class extends wR{constructor(e={}){const t=SR(e.plugins,jk.plugins),r=SR(e.sensors,jk.sensors),n=SR(e.modifiers,jk.modifiers);super(wL(SL({},e),{plugins:[tk,KA,aA,...t],sensors:r,modifiers:n}))}},zk=class extends(Ck=GP,wk=[EI],Sk=[EI],xk=[EI],Ck){constructor(e,t){var r=e,{element:n,effects:o=()=>[],handle:i,feedback:a="default"}=r,s=EL(r,["element","effects","handle","feedback"]);super(SL({effects:()=>[...o(),()=>{var e,t;const{manager:r}=this;if(!r)return;const n=(null!=(t=null==(e=this.sensors)?void 0:e.map(jD))?t:[...r.sensors]).map(e=>{const t=e instanceof KP?e:r.registry.register(e.plugin),n=e instanceof KP?void 0:e.options;return t.bind(this,n)});return function(){n.forEach(e=>e())}}]},s),t),TL(this,Ik,LL(Ek,8,this)),LL(Ek,11,this),TL(this,Dk,LL(Ek,12,this)),LL(Ek,15,this),TL(this,Pk,LL(Ek,16,this)),LL(Ek,19,this),this.element=n,this.handle=i,this.feedback=a}};Ek=IL(Ck),Ik=new WeakMap,Dk=new WeakMap,Pk=new WeakMap,AL(Ek,4,"handle",wk,zk,Ik),AL(Ek,4,"element",Sk,zk,Dk),AL(Ek,4,"feedback",xk,zk,Pk),ML(Ek,zk);var Wk=class extends(Lk=UP,Mk=[EI],Rk=[EI],Lk){constructor(e,t){var r=e,{element:n,effects:o=()=>[]}=r,i=EL(r,["element","effects"]);const{collisionDetector:a=lL}=i,s=e=>{const{manager:t,element:r}=this;if(!r||null===e)return void(this.shape=void 0);if(!t)return;const n=new tL(r),o=pE(()=>this.shape);return n&&(null==o?void 0:o.equals(n))?o:(this.shape=n,n)},l=wE(!1);super(wL(SL({},i),{collisionDetector:a,effects:()=>[...o(),()=>{const{element:e,manager:t}=this;if(!t)return;const{dragOperation:r}=t,{source:n}=r;l.value=Boolean(n&&r.status.initialized&&e&&!this.disabled&&this.accepts(n))},()=>{const{element:e}=this;if(l.value&&e){const t=new IM(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),TL(this,Nk),TL(this,kk,LL(Ak,8,this)),LL(Ak,11,this),TL(this,_k,LL(Ak,12,this)),LL(Ak,15,this),this.element=n,this.refreshShape=()=>s()}set element(e){NL(this,Nk,e,Tk)}get element(){var e;return null!=(e=this.proxy)?e:qL(this,Nk,qk)}};function $k(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}Ak=IL(Lk),kk=new WeakMap,Nk=new WeakSet,_k=new WeakMap,Ok=AL(Ak,20,"#element",Mk,Nk,kk),qk=Ok.get,Tk=Ok.set,AL(Ak,4,"proxy",Rk,Wk,_k),ML(Ak,Wk);var Hk="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?g:d;function Vk(){const e=m(0)[1];return f(()=>{e(e=>e+1)},[e])}function Bk(e,t=[],r=!1){const n=l(e);return n.current=e,function(e,t=!1){const r=l(e.peek()),n=l(!1),o=Vk();return Hk(()=>kE(()=>{const i=r.current,a=e.value;if(i!==a){if(r.current=a,!n.current)return;t?D(o):o()}}),[e,t,o]),{get value(){return n.current=!0,e.peek()}}}(v(()=>wI(()=>n.current()),t),r)}function Gk(e,t){const r=l(new Map),n=Vk();return Hk(()=>{if(e)return kE(()=>{var o;let i=!1,a=!1;for(const n of r.current){const[s]=n,l=pE(()=>n[1]),u=e[s];l!==u&&(i=!0,r.current.set(s,u),a=null!=(o=null==t?void 0:t(s,l,u))&&o)}i&&(a?D(n):n())});r.current.clear()},[e]),v(()=>e?new Proxy(e,{get(e,t){const n=e[t];return r.current.set(t,n),n}}):e,[e])}function Uk(e,t){e()}function Yk(e){const t=l(e);return Hk(()=>{t.current=e},[e]),t}function Kk(e,t,r=d,n=Object.is){const o=l(e);r(()=>{const r=o.current;n(e,r)||(o.current=e,t(e,r))},[t,e])}function Xk(e,t){const r=l($k(e));Hk(()=>{const n=$k(e);n!==r.current&&(r.current=n,t(n))})}var Jk=Object.defineProperty,Zk=Object.defineProperties,Qk=Object.getOwnPropertyDescriptors,eO=Object.getOwnPropertySymbols,tO=Object.prototype.hasOwnProperty,rO=Object.prototype.propertyIsEnumerable,nO=(e,t,r)=>t in e?Jk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,oO=new Fk,iO=u(oO),aO=b(x(({children:e},t)=>{const[r,n]=m(0),o=l(null),i=l(null),a=v(()=>({renderer:{get rendering(){var e;return null!=(e=o.current)?e:Promise.resolve()}},trackRendering(e){o.current||(o.current=new Promise(e=>{i.current=e})),S(()=>{e(),n(e=>e+1)})}}),[]);return Hk(()=>{var e;null==(e=i.current)||e.call(i),o.current=null},[e,r]),w(t,()=>a),null})),sO=[void 0,CI];function lO(e){var t=e,{children:r,onCollision:n,onBeforeDragStart:o,onDragStart:i,onDragMove:a,onDragOver:s,onDragEnd:u}=t,c=((e,t)=>{var r={};for(var n in e)tO.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&eO)for(var n of eO(e))t.indexOf(n)<0&&rO.call(e,n)&&(r[n]=e[n]);return r})(t,["children","onCollision","onBeforeDragStart","onDragStart","onDragMove","onDragOver","onDragEnd"]);const p=l(null),{plugins:f,modifiers:h,sensors:m}=c,g=SR(f,jk.plugins),v=SR(m,jk.sensors),b=SR(h,jk.modifiers),x=Yk(o),S=Yk(i),w=Yk(s),C=Yk(a),E=Yk(u),I=Yk(n),D=function(e){const t=l(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=c.manager)?e:new Fk(c)});return d(()=>{if(!p.current)throw new Error("Renderer not found");const{renderer:e,trackRendering:t}=p.current,{monitor:r}=D;D.renderer=e;const n=[r.addEventListener("beforedragstart",e=>{const r=x.current;r&&t(()=>r(e,D))}),r.addEventListener("dragstart",e=>{var t;return null==(t=S.current)?void 0:t.call(S,e,D)}),r.addEventListener("dragover",e=>{const r=w.current;r&&t(()=>r(e,D))}),r.addEventListener("dragmove",e=>{const r=C.current;r&&t(()=>r(e,D))}),r.addEventListener("dragend",e=>{const r=E.current;r&&t(()=>r(e,D))}),r.addEventListener("collision",e=>{var t;return null==(t=I.current)?void 0:t.call(I,e,D)})];return()=>n.forEach(e=>e())},[D]),Kk(g,()=>D&&(D.plugins=g),...sO),Kk(v,()=>D&&(D.sensors=v),...sO),Kk(b,()=>D&&(D.modifiers=b),...sO),ii.jsxs(iO.Provider,{value:D,children:[ii.jsx(aO,{ref:p,children:r}),r]})}function uO(){return h(iO)}function cO(e){var t;const r=null!=(t=uO())?t:void 0,[n]=m(()=>e(r));return n.manager!==r&&(n.manager=r),Hk(n.register,[r,n]),n}function dO({children:e,className:t,dropAnimation:r,style:o,tag:i,disabled:a}){var s;const u=l(null),c=uO(),p=null!=(s=Bk(()=>null==c?void 0:c.dragOperation.source,[c]).value)?s:null,f="function"==typeof a?a(p):a;d(()=>{if(!u.current||!c||f)return;const e=c.plugins.find(e=>e instanceof NA);return e?(e.overlay=u.current,()=>{e.overlay=void 0}):void 0},[c,f]),d(()=>{if(!c)return;const e=c.plugins.find(e=>e instanceof NA);return e?(e.dropAnimation=r,()=>{e.dropAnimation=void 0}):void 0},[c,r]);const h=v(()=>{if(!c)return null;const e=new Proxy(c.registry,{get:(e,t)=>"register"===t||"unregister"===t?pO:e[t]});return new Proxy(c,{get:(t,r)=>"registry"===r?e:t[r]})},[c]);return ii.jsx(iO.Provider,{value:h,children:n(i||"div",{ref:u,className:t,style:o,"data-dnd-overlay":!0},function(){if(!p||f)return null;if("function"==typeof e)return ii.jsx(fO,{source:p,children:e});return e}())})}function pO(){return()=>{}}function fO({children:e,source:t}){return e(Gk(t))}var hO,mO,gO,vO,yO,bO=Object.create,xO=Object.defineProperty,SO=Object.getOwnPropertyDescriptor,wO=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),CO=e=>{throw TypeError(e)},EO=["class","method","getter","setter","accessor","field","value","get","set"],IO=e=>void 0!==e&&"function"!=typeof e?CO("Function expected"):e,DO=(e,t,r,n,o)=>({kind:EO[e],name:t,metadata:n,addInitializer:e=>r._?CO("Already initialized"):o.push(IO(e||null))}),PO=(e,t,r,n,o,i)=>{for(var a,s,l,u,c=7&t,d=EO[c+5],p=e[2]||(e[2]=[]),f=(o=o.prototype,SO(o,r)),h=n.length-1;h>=0;h--)(l=DO(c,r,s={},e[3],p)).static=false,l.private=false,u=l.access={has:e=>r in e},u.get=e=>e[r],a=(0,n[h])(f[d],l),s._=1,IO(a)&&(f[d]=a);return f&&xO(o,r,f),o},RO=(e,t,r)=>t.has(e)||CO("Cannot "+r),MO=class e{constructor(e,t){this.x=e,this.y=t}static delta(t,r){return new e(t.x-r.x,t.y-r.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:r}){return new e(t,r)}},LO=class extends(gO=MI,mO=[II],hO=[II],gO){constructor(e){var t,r,n;super(MO.from(e),(e,t)=>MO.equals(e,t)),((e,t,r)=>{for(var n=0,o=e[t>>1],i=o&&o.length;n<i;n++)o[n].call(r)})(yO,5,this),t=this,n=0,(r=vO).has(t)?CO("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(t):r.set(t,n),this.velocity={x:0,y:0}}get delta(){return MO.delta(this.current,this.initial)}get direction(){const{current:e,previous:t}=this;if(!t)return null;const r={x:e.x-t.x,y:e.y-t.y};return r.x||r.y?Math.abs(r.x)>Math.abs(r.y)?r.x>0?"right":"left":r.y>0?"down":"up":null}get current(){return super.current}set current(e){const{current:t}=this,r=MO.from(e),n={x:r.x-t.x,y:r.y-t.y},o=Date.now(),i=o-(RO(a=this,s=vO,"read from private field"),s.get(a));var a,s;const l=e=>Math.round(e/i*100);cE(()=>{((e,t,r)=>{RO(e,t,"write to private field"),t.set(e,r)})(this,vO,o),this.velocity={x:l(n.x),y:l(n.y)},super.current=r})}reset(e=this.defaultValue){super.reset(MO.from(e)),this.velocity={x:0,y:0}}};yO=(e=>{var t;return[,,,bO(null!=(t=null==e?void 0:e[wO("metadata")])?t:null)]})(gO),vO=new WeakMap,PO(yO,2,"delta",mO,LO),PO(yO,2,"direction",hO,LO),((e,t)=>{((e,t,r)=>{t in e?xO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(t,wO("metadata"),e[3])})(yO,LO);var AO=(e=>(e.Horizontal="x",e.Vertical="y",e))(AO||{});Object.values(AO);var kO=e=>{var t;return null!=(t=(({dragOperation:e,droppable:t})=>{const r=e.position.current;if(!r)return null;const{id:n}=t;if(!t.shape)return null;if(t.shape.containsPoint(r))return{id:n,value:1/MO.distance(t.shape.center,r),type:lP.PointerIntersection,priority:sP.High};return null})(e))?t:(({dragOperation:e,droppable:t})=>{const{shape:r}=e;if(!t.shape||!(null==r?void 0:r.current))return null;const n=r.current.intersectionArea(t.shape);if(n){const{position:o}=e,i=MO.distance(t.shape.center,o.current),a=n/(r.current.area+t.shape.area-n)/i;return{id:t.id,value:a,type:lP.ShapeIntersection,priority:sP.Normal}}return null})(e)};function OO(e){const{collisionDetector:t,data:r,disabled:n,element:o,id:i,accept:a,type:s}=e,l=cO(t=>new Wk(((e,t)=>Zk(e,Qk(t)))(((e,t)=>{for(var r in t||(t={}))tO.call(t,r)&&nO(e,r,t[r]);if(eO)for(var r of eO(t))rO.call(t,r)&&nO(e,r,t[r]);return e})({},e),{register:!1,element:$k(o)}),t)),u=Gk(l);return Kk(i,()=>l.id=i),Xk(o,e=>l.element=e),Kk(a,()=>l.accept=a,void 0,CI),Kk(t,()=>l.collisionDetector=null!=t?t:kO),Kk(r,()=>r&&(l.data=r)),Kk(n,()=>l.disabled=!0===n),Kk(s,()=>l.type=s),{droppable:u,get isDropTarget(){return u.isDropTarget},ref:f(e=>{var t,r;(e||!(null==(t=l.element)?void 0:t.isConnected)||(null==(r=l.manager)?void 0:r.dragOperation.status.idle))&&(l.element=null!=e?e:void 0)},[l])}}const qO=e=>Array.from({length:e},(e,t)=>t),TO=({id:e,sectionIndex:t,itemIndex:r})=>ii.jsx("span",{children:`${e}-${t}-${r}`}),NO=r.memo(()=>{const e=Pw(QC)??TO,{startSectionIndex:t,startIndex:r,id:n}=Pw(nE)??{};return"number"!=typeof t||"number"!=typeof r||void 0===n?null:ii.jsx(dO,{dropAnimation:null,children:ii.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px",background:"white",boxShadow:"0px 4px 10px 0px rgba(0, 0, 0, 0.15)",borderRadius:"4px",border:"1px solid rgba(0, 0, 0, 0.15)",width:"208px",maxHeight:"32px",fontSize:"12px",lineHeight:"16px"},children:ii.jsx(e,{id:n,sectionIndex:t,itemIndex:r})})})}),_O=({sectionIndex:e,itemIndex:t,isDragging:r})=>{const n=Pw(nE),o=n?.toSectionIndex===e,i=n?.startSectionIndex===e,a=t>(n?.startIndex??t)&&e===n?.startSectionIndex?t-1:t;let s=!1;return i&&n.startIndex===a?s=!1:o&&n.toIndex===a&&(s=!0),ii.jsx("div",{"data-key":"drop-target-indicator",style:{visibility:s&&!r?"visible":"hidden",padding:0,background:"rgba(64, 64, 64, 1)",borderRadius:2,marginLeft:"4px",width:"calc(100% - 8px)",height:"2px"}})},jO=(e,t)=>e?"2px solid rgba(0, 135, 61, 1)":t?"1px dashed rgba(0, 0, 0, 0.43)":void 0,FO=r.memo(({sectionIndex:e})=>{const t=Pw(GC)[e],r=Pw(UC),n=Pw(YC),o=null!==Pw(nE),i=n(e),a=r({sectionIndex:e}),{ref:s,isDropTarget:l}=OO({id:a,type:"section",accept:"item",collisionPriority:sP.Low,data:{id:a,sectionIndex:e,sectionKey:a}});return!l&&t>0?null:ii.jsxs(Qu,{ref:s,sx:{margin:"4px",outline:jO(l,o),borderRadius:"4px",boxSizing:"border-box"},children:[ii.jsx(Qu,{sx:{position:"relative",top:"4px"},children:ii.jsx(_O,{sectionIndex:e,itemIndex:0,isDragging:!1})}),ii.jsxs(Qu,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",padding:"20px 4px"},children:[ii.jsx(mu,{sx:{textAlign:"center",width:"fit-content",maxWidth:"100%",overflowWrap:"break-word",textOverflow:"ellipsis",fontWeight:"600",fontSize:"14px",lineHeight:"16px",color:"rgba(64, 64, 64, 1)"},children:i.title}),ii.jsx(mu,{sx:{textAlign:"center",width:"fit-content",maxWidth:"100%",overflowWrap:"break-word",textOverflow:"ellipsis",fontSize:"12px",lineHeight:"150%",color:"rgba(64, 64, 64, 1)"},children:i.message})]})]})}),zO=r.memo(({id:e,sectionIndex:t})=>{const r=Pw(ZC);return void 0===r?null:ii.jsx(r,{id:e,sectionIndex:t})});var WO=Object.defineProperty,$O=Object.defineProperties,HO=Object.getOwnPropertyDescriptors,VO=Object.getOwnPropertySymbols,BO=Object.prototype.hasOwnProperty,GO=Object.prototype.propertyIsEnumerable,UO=(e,t,r)=>t in e?WO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,YO=(e,t)=>{for(var r in t||(t={}))BO.call(t,r)&&UO(e,r,t[r]);if(VO)for(var r of VO(t))GO.call(t,r)&&UO(e,r,t[r]);return e},KO=(e,t)=>$O(e,HO(t)),XO=class extends vR{apply({transform:e}){if(!this.options)return e;const{axis:t,value:r}=this.options;return KO(YO({},e),{[t]:r})}};XO.configure=_D(XO);var JO=XO,ZO=JO.configure({axis:"x",value:0});JO.configure({axis:"y",value:0});var QO=class extends vR{apply({transform:e}){var t;const{size:r=20}=null!=(t=this.options)?t:{},n="number"==typeof r?r:r.x,o="number"==typeof r?r:r.y;return KO(YO({},e),{x:Math.ceil(e.x/n)*n,y:Math.ceil(e.y/o)*o})}};QO.configure=_D(QO);var eq=Object.create,tq=Object.defineProperty,rq=Object.defineProperties,nq=Object.getOwnPropertyDescriptor,oq=Object.getOwnPropertyDescriptors,iq=Object.getOwnPropertySymbols,aq=Object.prototype.hasOwnProperty,sq=Object.prototype.propertyIsEnumerable,lq=e=>{throw TypeError(e)},uq=(e,t,r)=>t in e?tq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,cq=(e,t)=>{for(var r in t||(t={}))aq.call(t,r)&&uq(e,r,t[r]);if(iq)for(var r of iq(t))sq.call(t,r)&&uq(e,r,t[r]);return e},dq=(e,t)=>rq(e,oq(t)),pq=["class","method","getter","setter","accessor","field","value","get","set"],fq=e=>void 0!==e&&"function"!=typeof e?lq("Function expected"):e,hq=(e,t,r,n,o)=>({kind:pq[e],name:t,metadata:n,addInitializer:e=>r._?lq("Already initialized"):o.push(fq(e||null))}),mq=(e,t,r,n)=>{for(var o=0,i=e[t>>1],a=i&&i.length;o<a;o++)1&t?i[o].call(r):n=i[o].call(r,n);return n},gq=(e,t,r,n,o,i)=>{for(var a,s,l,u,c,d=7&t,p=e.length+1,f=pq[d+5],h=e[p-1]=[],m=e[p]||(e[p]=[]),g=(o=o.prototype,nq({get[r](){return yq(this,i)},set[r](e){return xq(this,i,e)}},r)),v=n.length-1;v>=0;v--)(u=hq(d,r,l={},e[3],m)).static=false,u.private=false,c=u.access={has:e=>r in e},c.get=e=>e[r],c.set=(e,t)=>e[r]=t,s=(0,n[v])({get:g.get,set:g.set},u),l._=1,void 0===s?fq(s)&&(g[f]=s):"object"!=typeof s||null===s?lq("Object expected"):(fq(a=s.get)&&(g.get=a),fq(a=s.set)&&(g.set=a),fq(a=s.init)&&h.unshift(a));return g&&tq(o,r,g),o},vq=(e,t,r)=>t.has(e)||lq("Cannot "+r),yq=(e,t,r)=>(vq(e,t,"read from private field"),t.get(e)),bq=(e,t,r)=>t.has(e)?lq("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),xq=(e,t,r,n)=>(vq(e,t,"write to private field"),t.set(e,r),r);function Sq(e){return e instanceof Zq||e instanceof Jq}var wq=class extends FD{constructor(e){super(e);const t=kE(()=>{const{dragOperation:t}=e;if(iL(t.activatorEvent)&&Sq(t.source)&&t.status.initialized){const t=e.registry.plugins.get(KA);if(t)return t.disable(),()=>t.enable()}}),r=e.monitor.addEventListener("dragmove",(e,t)=>{queueMicrotask(()=>{if(this.disabled||e.defaultPrevented||!e.nativeEvent)return;const{dragOperation:r}=t;if(!iL(e.nativeEvent))return;if(!Sq(r.source))return;if(!r.shape)return;const{actions:n,collisionObserver:o,registry:i}=t,{by:a}=e;if(!a)return;const s=function(e){const{x:t,y:r}=e;if(t>0)return"right";if(t<0)return"left";if(r>0)return"down";if(r<0)return"up"}(a),{source:l,target:u}=r,{center:c}=r.shape.current,d=[],p=[];cE(()=>{for(const e of i.droppables){const{id:t}=e;if(!e.accepts(l)||t===(null==u?void 0:u.id)&&Sq(e)||!e.element)continue;let r=e.shape;const n=new tL(e.element,{getBoundingClientRect:e=>zR(e,void 0,.2)});n.height&&n.width&&(("down"==s&&c.y+10<n.center.y||"up"==s&&c.y-10>n.center.y||"left"==s&&c.x-10>n.center.x||"right"==s&&c.x+10<n.center.x)&&(d.push(e),e.shape=n,p.push(()=>e.shape=r)))}}),e.preventDefault(),o.disable();const f=o.computeCollisions(d,uL);cE(()=>p.forEach(e=>e()));const[h]=f;if(!h)return;const{id:m}=h,{index:g,group:v}=l.sortable;n.setDropTarget(m).then(()=>{const{source:e,target:t,shape:i}=r;if(!e||!Sq(e)||!i)return;const{index:a,group:s,target:l}=e.sortable,u=g!==a||v!==s,c=u?l:null==t?void 0:t.element;if(!c)return;YM(c);const d=new tL(c);if(!d)return;const p=ZI.delta(d,ZI.from(i.current.boundingRectangle),e.alignment);n.move({by:p}),u?n.setDropTarget(e.id).then(()=>o.enable()):o.enable()})})});this.destroy=()=>{r(),t()}}};var Cq=Object.defineProperty,Eq=Object.defineProperties,Iq=Object.getOwnPropertyDescriptors,Dq=Object.getOwnPropertySymbols,Pq=Object.prototype.hasOwnProperty,Rq=Object.prototype.propertyIsEnumerable,Mq=(e,t,r)=>t in e?Cq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Lq=(e,t)=>{for(var r in t||(t={}))Pq.call(t,r)&&Mq(e,r,t[r]);if(Dq)for(var r of Dq(t))Rq.call(t,r)&&Mq(e,r,t[r]);return e},Aq=(e,t)=>Eq(e,Iq(t));function kq(e,t,r){if(t===r)return e;const n=e.slice();return n.splice(r,0,n.splice(t,1)[0]),n}function Oq(e){return"initialIndex"in e&&"number"==typeof e.initialIndex&&"index"in e&&"number"==typeof e.index}function qq(e,t){return function(e,t,r){var n,o,i;const{source:a,target:s,canceled:l}=t.operation;if(!a||!s||l)return"preventDefault"in t&&t.preventDefault(),e;const u=(e,t)=>e===t||"object"==typeof e&&"id"in e&&e.id===t;if(Array.isArray(e)){const n=e.findIndex(e=>u(e,a.id)),o=e.findIndex(e=>u(e,s.id));if(-1===n||-1===o){if(Oq(a)){const n=a.initialIndex,o=a.index;return n===o||n<0||n>=e.length?("preventDefault"in t&&t.preventDefault(),e):r(e,n,o)}return e}if(!l&&"index"in a&&"number"==typeof a.index){const t=a.index;if(t!==n)return r(e,n,t)}return r(e,n,o)}const c=Object.entries(e);let d,p,f=-1,h=-1;for(const[e,t]of c)if(-1===f&&(f=t.findIndex(e=>u(e,a.id)),-1!==f&&(d=e)),-1===h&&(h=t.findIndex(e=>u(e,s.id)),-1!==h&&(p=e)),-1!==f&&-1!==h)break;if(-1===f&&Oq(a)){const n=a.initialGroup,o=a.initialIndex,i=a.group,s=a.index;if(null==n||null==i||!(n in e)||!(i in e))return"preventDefault"in t&&t.preventDefault(),e;if(n===i&&o===s)return"preventDefault"in t&&t.preventDefault(),e;if(n===i)return Aq(Lq({},e),{[n]:r(e[n],o,s)});const l=e[n][o];return Aq(Lq({},e),{[n]:[...e[n].slice(0,o),...e[n].slice(o+1)],[i]:[...e[i].slice(0,s),l,...e[i].slice(s)]})}if(!a.manager)return e;const{dragOperation:m}=a.manager,g=null!=(o=null==(n=m.shape)?void 0:n.current.center)?o:m.position.current;if(null==p&&s.id in e){const t=s.shape&&g.y>s.shape.center.y?e[s.id].length:0;p=s.id,h=t}if(null==d||null==p||d===p&&f===h){if(null!=d&&d===p&&f===h&&Oq(a)){const t=null!=a.group&&a.group!==d,n=a.index!==f;if(t||n){const t=null!=(i=a.group)?i:d;if(t in e){if(d===t)return Aq(Lq({},e),{[d]:r(e[d],f,a.index)});const n=e[d][f];return Aq(Lq({},e),{[d]:[...e[d].slice(0,f),...e[d].slice(f+1)],[t]:[...e[t].slice(0,a.index),n,...e[t].slice(a.index)]})}}}return"preventDefault"in t&&t.preventDefault(),e}if(d===p)return Aq(Lq({},e),{[d]:r(e[d],f,h)});const v=s.shape&&Math.round(g.y)>Math.round(s.shape.center.y)?1:0,y=e[d][f];return Aq(Lq({},e),{[d]:[...e[d].slice(0,f),...e[d].slice(f+1)],[p]:[...e[p].slice(0,h+v),y,...e[p].slice(h+v)]})}(e,t,kq)}var Tq="__default__";function Nq(e,t,r,n){const o=n<t?"afterend":"beforebegin";r.insertAdjacentElement(o,e)}function _q(e,t){return e.index-t.index}function jq(e){return Array.from(e).sort(_q)}var Fq,zq,Wq,$q,Hq,Vq,Bq,Gq,Uq=[wq,class extends FD{constructor(e){super(e);const t=()=>{const t=new Map;for(const r of e.registry.droppables)if(r instanceof Zq){const{sortable:e}=r,{group:n}=e;let o=t.get(n);o||(o=new Set,t.set(n,o)),o.add(e)}for(const[e,r]of t)t.set(e,new Set(jq(r)));return t},r=[e.monitor.addEventListener("dragover",(e,r)=>{if(this.disabled)return;const{dragOperation:n}=r,{source:o,target:i}=n;if(!Sq(o)||!Sq(i))return;if(o.sortable===i.sortable)return;const a=t(),s=o.sortable.group===i.sortable.group,l=a.get(o.sortable.group),u=s?l:a.get(i.sortable.group);l&&u&&queueMicrotask(()=>{e.defaultPrevented||r.renderer.rendering.then(()=>{var n,c,d;const p=t();for(const[e,t]of a.entries()){const r=Array.from(t).entries();for(const[t,o]of r)if(o.index!==t||o.group!==e||!(null==(n=p.get(e))?void 0:n.has(o)))return}const f=o.sortable.element,h=i.sortable.element;if(!h||!f)return;if(!s&&i.id===o.sortable.group)return;const m=jq(l),g=s?m:jq(u),v=null!=(c=o.sortable.group)?c:Tq,y=null!=(d=i.sortable.group)?d:Tq,b={[v]:m,[y]:g},x=qq(b,e);if(b===x)return;const S=x[y].indexOf(o.sortable),w=x[y].indexOf(i.sortable);r.collisionObserver.disable(),Nq(f,S,h,w),cE(()=>{for(const[e,t]of x[v].entries())t.index=e;if(!s)for(const[e,t]of x[y].entries())t.group=i.sortable.group,t.index=e}),r.actions.setDropTarget(o.id).then(()=>r.collisionObserver.enable())})})}),e.monitor.addEventListener("dragend",(e,r)=>{if(!e.canceled)return;const{dragOperation:n}=r,{source:o}=n;Sq(o)&&(o.sortable.initialIndex===o.sortable.index&&o.sortable.initialGroup===o.sortable.group||queueMicrotask(()=>{const e=t(),n=e.get(o.sortable.initialGroup);n&&r.renderer.rendering.then(()=>{for(const[t,r]of e.entries()){const e=Array.from(r).entries();for(const[r,n]of e)if(n.index!==r||n.group!==t)return}const t=jq(n),r=o.sortable.element,i=t[o.sortable.initialIndex],a=null==i?void 0:i.element;i&&a&&r&&(Nq(r,i.index,a,o.index),cE(()=>{for(const[t,r]of e.entries()){const e=Array.from(r).values();for(const t of e)t.index=t.initialIndex,t.group=t.initialGroup}}))})}))})];this.destroy=()=>{for(const e of r)e()}}}],Yq={duration:250,easing:"cubic-bezier(0.25, 1, 0.5, 1)",idle:!1},Kq=new class{constructor(){bI(this,RI,new WeakMap)}get(e,t){var r;return e?null==(r=yI(this,RI).get(e))?void 0:r.get(t):void 0}set(e,t,r){var n;if(e)return yI(this,RI).has(e)||yI(this,RI).set(e,new Map),null==(n=yI(this,RI).get(e))?void 0:n.set(t,r)}clear(e){var t;return e?null==(t=yI(this,RI).get(e))?void 0:t.clear():void 0}};zq=[EI],Fq=[EI];var Xq=class{constructor(e,t){bq(this,$q,mq(Wq,8,this)),mq(Wq,11,this),bq(this,Hq),bq(this,Vq),bq(this,Bq,mq(Wq,12,this)),mq(Wq,15,this),bq(this,Gq),this.register=()=>(cE(()=>{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=()=>{cE(()=>{var e,t;null==(e=this.manager)||e.registry.unregister(this.droppable),null==(t=this.manager)||t.registry.unregister(this.draggable)})},this.destroy=()=>{cE(()=>{this.droppable.destroy(),this.draggable.destroy()})};var r=e,{effects:n=()=>[],group:o,index:i,sensors:a,type:s,transition:l=Yq,plugins:u=Uq}=r,c=((e,t)=>{var r={};for(var n in e)aq.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&iq)for(var n of iq(e))t.indexOf(n)<0&&sq.call(e,n)&&(r[n]=e[n]);return r})(r,["effects","group","index","sensors","type","transition","plugins"]);this.droppable=new Zq(c,t,this),this.draggable=new Jq(dq(cq({},c),{effects:()=>[()=>{var e,t,r;const n=null==(e=this.manager)?void 0:e.dragOperation.status;(null==n?void 0:n.initializing)&&this.id===(null==(r=null==(t=this.manager)?void 0:t.dragOperation.source)?void 0:r.id)&&Kq.clear(this.manager),(null==n?void 0:n.dragging)&&Kq.set(this.manager,this.id,pE(()=>({initialIndex:this.index,initialGroup:this.group})))},()=>{const{index:e,group:t,manager:r}=this,n=yq(this,Vq),o=yq(this,Hq);e===n&&t===o||(xq(this,Vq,e),xq(this,Hq,t),this.animate())},()=>{const{target:e}=this,{feedback:t,isDragSource:r}=this.draggable;"move"==t&&r&&(this.droppable.disabled=!e)},()=>{const{manager:e}=this;for(const t of u)null==e||e.registry.register(t)},...n()],type:s,sensors:a}),t,this),xq(this,Gq,c.element),this.manager=t,this.index=i,xq(this,Vq,i),this.group=o,xq(this,Hq,o),this.type=s,this.transition=l}get initialIndex(){var e,t;return null!=(t=null==(e=Kq.get(this.manager,this.id))?void 0:e.initialIndex)?t:this.index}get initialGroup(){var e,t;return null!=(t=null==(e=Kq.get(this.manager,this.id))?void 0:e.initialGroup)?t:this.group}animate(){pE(()=>{const{manager:e,transition:t}=this,{shape:r}=this.droppable;if(!e)return;const{idle:n}=e.dragOperation.status;r&&t&&(!n||t.idle)&&e.renderer.rendering.then(()=>{const{element:n}=this;if(!n)return;const o=this.refreshShape();if(!o)return;const i=r.boundingRectangle.left-o.boundingRectangle.left,a=r.boundingRectangle.top-o.boundingRectangle.top,{translate:s}=NM(n),l=XM(n,s,!1),u=XM(n,s);if(i||a){const r=YR(qR(n))?dq(cq({},t),{duration:0}):t;KM({element:n,keyframes:{translate:[`${l.x+i}px ${l.y+a}px ${l.z}`,`${u.x}px ${u.y}px ${u.z}`]},options:r}).then(()=>{e.dragOperation.status.dragging||(this.droppable.shape=void 0)})}})})}get manager(){return this.draggable.manager}set manager(e){cE(()=>{this.draggable.manager=e,this.droppable.manager=e})}set element(e){cE(()=>{const t=yq(this,Gq),r=this.droppable.element,n=this.draggable.element;r&&r!==t||(this.droppable.element=e),n&&n!==t||(this.draggable.element=e),xq(this,Gq,e)})}get element(){var e,t;const r=yq(this,Gq);if(r)return null!=(t=null!=(e=ZR.get(r))?e:r)?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){cE(()=>{this.droppable.disabled=e,this.draggable.disabled=e})}set data(e){cE(()=>{this.droppable.data=e,this.draggable.data=e})}set handle(e){this.draggable.handle=e}set id(e){cE(()=>{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:lL}set alignment(e){this.draggable.alignment=e}get alignment(){return this.draggable.alignment}set type(e){cE(()=>{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)}};Wq=[,,,eq(null)],$q=new WeakMap,Hq=new WeakMap,Vq=new WeakMap,Bq=new WeakMap,Gq=new WeakMap,gq(Wq,4,"index",zq,Xq,$q),gq(Wq,4,"group",Fq,Xq,Bq),((e,t)=>{return uq(t,(r="metadata",(n=Symbol[r])?n:Symbol.for("Symbol."+r)),e[3]);var r,n})(Wq,Xq);var Jq=class extends zk{constructor(e,t,r){super(e,t),this.sortable=r}get index(){return this.sortable.index}get initialIndex(){return this.sortable.initialIndex}get group(){return this.sortable.group}get initialGroup(){return this.sortable.initialGroup}},Zq=class extends Wk{constructor(e,t,r){super(e,t),this.sortable=r}get index(){return this.sortable.index}get group(){return this.sortable.group}},Qq=Object.defineProperty,eT=Object.defineProperties,tT=Object.getOwnPropertyDescriptors,rT=Object.getOwnPropertySymbols,nT=Object.prototype.hasOwnProperty,oT=Object.prototype.propertyIsEnumerable,iT=(e,t,r)=>t in e?Qq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,aT=(e,t)=>{for(var r in t||(t={}))nT.call(t,r)&&iT(e,r,t[r]);if(rT)for(var r of rT(t))oT.call(t,r)&&iT(e,r,t[r]);return e};function sT(e){const{accept:t,collisionDetector:r,collisionPriority:n,id:o,data:i,element:a,handle:s,index:l,group:u,disabled:c,feedback:d,modifiers:p,sensors:h,target:m,type:g}=e,v=aT(aT({},Yq),e.transition),y=cO(t=>new Xq(((e,t)=>eT(e,tT(t)))(aT({},e),{transition:v,register:!1,handle:$k(s),element:$k(a),target:$k(m),feedback:d}),t)),b=Gk(y,lT);return Kk(o,()=>y.id=o),Hk(()=>{cE(()=>{y.group=u,y.index=l})},[y,u,l]),Kk(g,()=>y.type=g),Kk(t,()=>y.accept=t,void 0,CI),Kk(i,()=>i&&(y.data=i)),Kk(l,()=>{var e;(null==(e=y.manager)?void 0:e.dragOperation.status.idle)&&(null==v?void 0:v.idle)&&y.refreshShape()},Uk),Xk(s,e=>y.handle=e),Xk(a,e=>y.element=e),Xk(m,e=>y.target=e),Kk(c,()=>y.disabled=!0===c),Kk(h,()=>y.sensors=h),Kk(r,()=>y.collisionDetector=r),Kk(n,()=>y.collisionPriority=n),Kk(d,()=>y.feedback=null!=d?d:"default"),Kk(v,()=>y.transition=v,void 0,CI),Kk(p,()=>y.modifiers=p,void 0,CI),Kk(e.alignment,()=>y.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:f(e=>{y.handle=null!=e?e:void 0},[y]),ref:f(e=>{var t,r;(e||!(null==(t=y.element)?void 0:t.isConnected)||(null==(r=y.manager)?void 0:r.dragOperation.status.idle))&&(y.element=null!=e?e:void 0)},[y]),sourceRef:f(e=>{var t,r;(e||!(null==(t=y.source)?void 0:t.isConnected)||(null==(r=y.manager)?void 0:r.dragOperation.status.idle))&&(y.source=null!=e?e:void 0)},[y]),targetRef:f(e=>{var t,r;(e||!(null==(t=y.target)?void 0:t.isConnected)||(null==(r=y.manager)?void 0:r.dragOperation.status.idle))&&(y.target=null!=e?e:void 0)},[y])}}function lT(e,t,r){return!("isDragSource"!==e||r||!t)}const uT=({id:e,itemIndex:t,sectionIndex:r})=>ii.jsx("div",{children:`${r}:${t} - ${e}`}),cT=({id:e,itemIndex:t,sectionIndex:r})=>{const n=Pw(eE),o=Pw(JC),i=Pw(GC).at(r)??0,a=Pw(UC)({sectionIndex:r}),{ref:s,isDragging:l}=sT({id:e,index:t,type:"item",accept:"item",group:a,modifiers:[ZO],plugins:[wq],data:{id:e,sectionIndex:r,sectionKey:a,itemIndex:t}}),u=void 0!==n?()=>{n({id:e,itemIndex:t,sectionIndex:r})}:void 0,c=o??uT;return ii.jsx(Nd,{"data-testid":"section-item",onClick:u,ref:s,"data-dragging":l,sx:{padding:0,backgroundColor:l?"rgba(242, 242, 242, 1)":void 0,borderRadius:l?"4px":void 0},children:ii.jsxs("div",{style:{width:"100%",opacity:l?.4:1},children:[ii.jsx(_O,{isDragging:l,itemIndex:t,sectionIndex:r}),ii.jsx(c,{id:e,itemIndex:t,sectionIndex:r}),t===i-1&&ii.jsx(_O,{isDragging:l,itemIndex:t+1,sectionIndex:r})]})})},dT=r.memo(cT),pT=r.memo(({sectionIndex:e})=>{const t=Pw(UC),r=Pw(GC).at(e)??0,n=t({sectionIndex:e});return ii.jsxs(Qu,{className:"exploration-list",style:{overflow:"auto"},children:[ii.jsx(Uc,{}),ii.jsx(zO,{id:n,sectionIndex:e}),ii.jsx(Uc,{}),ii.jsx(FO,{sectionIndex:e}),ii.jsx(Ed,{sx:{padding:"2px 8px"},children:qO(r).map(r=>{const n=t({sectionIndex:e,itemIndex:r});return ii.jsx(dT,{id:n,itemIndex:r,sectionIndex:e},n)})})]},n)}),fT=r.memo(()=>{const e=Pw(BC),t=Pw(UC),r=Rw(oE("start")),n=Rw(oE("over")),o=Rw(oE("end"));return ii.jsxs(lO,{onDragEnd:o,onDragOver:n,onDragStart:r,children:[ii.jsx(Qu,{style:{display:"flex",flexDirection:"column"},children:qO(e).map(e=>ii.jsx(pT,{sectionIndex:e},t({sectionIndex:e})))}),ii.jsx(NO,{})]})}),hT=r.memo(e=>ii.jsx(MC,{atoms:iE,atomFamilies:aE,children:ii.jsx(sE,{props:e,children:ii.jsx(fT,{})})})),mT="12px",gT="nebula-table-utils-head-menu-button",vT="sn-copy-cell";let yT=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 bT="nebula-table-utils-column-adjuster";let xT=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}({}),ST=function(e){return e.Auto="auto",e.FitToContent="fitToContent",e.Pixels="pixels",e.Percentage="percentage",e}({});const wT={darker:.15,brighter:.3,opacity:.03},CT={darker:.3,brighter:.5,opacity:.05};let ET=function(e){return e.Cyclic="C",e}({});const IT=(e,t)=>{const r=new Map;for(const t of e)r.set(t.id,t);return t.reduce((e,t)=>{const n=r.get(t);return n&&e.push(n),e},[])},DT=$C(e=>mw(t=>{const r=t(tC),n=t(Hw),o=t(Zw)?.[e],i=r?.qHyperCube.rankedList?.[e];return o||(n?.isRankedListCorrupt(e)||void 0===i?n?.createRankedList(e):i)})),PT=(e,t=new Set)=>mw(r=>{const n=r(e),o=r(mC);if(!n||0===n.length)return"disabled";const i=n.filter(e=>!t.has(e.id));if(0===i.length)return"disabled";const a=i.filter(e=>o.has(e.id)).length;return 0===a?"none":a===i.length?"all":"some"}),RT=(e,t=new Set)=>mw(null,(r,n,o)=>{const i=r(e);i&&0!==i.length&&(e=>{const{items:t,shouldCheckAll:r,get:n,set:o,excludedIds:i}=e,a=t.filter(e=>!i?.has(e.id));if(0===a.length)return;const s=n(mC),l=new Set,u=new Set;if(a.forEach(e=>{const t=s.has(e.id);t&&!r&&u.add(e.id),!t&&r&&l.add(e.id)}),0===l.size&&0===u.size)return;const c=new Set(n(dC)),d=new Set(n(pC));l.forEach(e=>c.add(e)),l.forEach(e=>d.delete(e)),u.forEach(e=>d.add(e)),u.forEach(e=>c.delete(e)),o(dC,c),o(pC,d),Ww({type:"apply",localChecked:l,localUnchecked:u,handler:n(Hw),model:n($w),fieldInfo:n(aC),handlerQueue:n(lC)})})({items:i,shouldCheckAll:o,get:r,set:n,excludedIds:t})}),MT=mw(e=>{const t=e(rC);return t?.qHyperCube.qDimensionInfo.filter(Yw).map(({cId:e,qFallbackTitle:t})=>({id:e,title:t,alternative:!0}))}),LT=mw(e=>{const t=e(tC),r=e(Bw),n=t?.qHyperCube.qEffectiveInterColumnSortOrder.map(e=>{if(-1===e)return{id:-1,title:r("Common.Values")};const{cId:n,qFallbackTitle:o}=t.qHyperCube.qDimensionInfo[e];return{id:n,title:o}});return n}),AT=mw(e=>{const t=e(Bw),r=e(MT),n=e(Uw),o=e(DT("columns")),i=e(DT("rows")),a=e(LT);if(void 0===r||void 0===o||void 0===i||void 0===a)return[];const s=[...a,...r].filter(n);return[{id:"rows",title:t("Common.Rows"),items:IT(s,i)},{id:"columns",title:t("Common.Columns"),items:IT(s,o)}]}),kT=$C(e=>mw(t=>t(AT).at(e))),OT=$C(({sectionIndex:e,itemIndex:t})=>mw(r=>r(kT(e))?.items.at(t)?.title),(e,t)=>e.sectionIndex===t.sectionIndex&&e.itemIndex===t.itemIndex),qT=$C(e=>mw(t=>t(kT(e))?.title)),TT=mw(e=>({sectionIndex:t,itemIndex:r})=>{const n=e(kT(t));return void 0===n?0===t?"rows":"columns":void 0===r?n.id:n.items.at(r)?.id??`missing-item-${t}-${r}`}),NT=mw(e=>e(AT).map(e=>e.items.length)),_T=$C(e=>PT(mw(t=>t(kT(e))?.items),new Set([-1]))),jT=$C(e=>RT(mw(t=>t(kT(e))?.items),new Set([-1]))),FT=mw(null,async(e,t,{event:r,id:n,toIndex:o,toSection:i,startSection:a})=>{const s=e(Hw),l=e($w),u=e(lC),c=e(DT("rows")),d=e(DT("columns")),p=i;if(void 0===s||void 0===l||void 0===c||void 0===d||null===u)return;if(r.operation.canceled)return void t(Zw,null);if("section"===r.operation.target?.type&&a===i)return void t(Zw,null);const f=WC({rows:c,columns:d},r);t(Zw,f),u.add(async()=>{"number"==typeof n?await s.movePseudoDimension({toIndex:o,toSection:p}):await s.moveDimension({cId:n,toIndex:o,toSection:p})})}),zT={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"}},WT="ChartExploration.PivotTable.DimensionSectionEmpty.Message",$T="ChartExploration.PivotTable.MeasureSectionEmpty.Message",HT="#177fe6",VT=(e,t,r,n)=>{if("measure"===t)return e(n?zT.noSearchFound.measure:zT.noItems.measure);const o=n?zT.noSearchFound:zT.noItems;return e(r?o.row:o.column)},BT=(e,t,r)=>r?"":e("measure"===t?$T:WT),GT=$C(e=>mw(t=>{const r=t(Bw),n=t(Gw).length>0;return t=>({title:VT(r,e,0===t,n),message:BT(r,e,n)})})),UT=GT("measure"),YT=GT("dimensions"),KT=({children:e})=>ii.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),XT=e=>{const t=Pw(OT(e));return ii.jsx(KT,{children:t})},JT=mw(e=>{const t=e(rC);return t?.qHyperCube.qMeasureInfo.filter(Yw).map(({cId:e,qFallbackTitle:t})=>({id:e,title:t}))}),ZT=mw(e=>{const t=e(tC),r=e(JT),n=e(Uw),o=e(DT("measures"));if(void 0===t||void 0===r||void 0===o)return[];const i=t.qHyperCube.qMeasureInfo.filter(Yw).map(({cId:e,qFallbackTitle:t})=>({id:e,title:t}));i.push(...r);const a=i.filter(n);return IT(a,o)}),QT=$C(e=>mw(t=>t(ZT).at(e)?.title??"")),eN=mw(e=>({itemIndex:t})=>{const r=e(ZT);return void 0===t?"measures":r.at(t)?.id??`missing-item-${t}`}),tN=mw(e=>[e(ZT).length]),rN=PT(ZT),nN=RT(ZT),oN=mw(null,async(e,t,{id:r,toIndex:n,event:o})=>{const i=e(Hw),a=e($w),s=e(lC),l=e(DT("measures"));if(void 0===i||void 0===a||void 0===l||"string"!=typeof r||null===s)return;const u=WC({measures:l},o);t(Zw,u),s.add(async()=>{await i.moveMeasure({cId:r,toIndex:n})})}),iN=e=>"svg"===e.tagName?"exploration-draggable-icon":e.className,aN=e=>{const t=e.closest(".exploration-list"),r=t?.nextElementSibling||t?.parentElement?.nextElementSibling;return null!==r&&r?r.getElementsByClassName("exploration-section-header")[0]:t?.closest(".exploration-panel")?.getElementsByClassName("exploration-section-header")[0]},sN=e=>{const{currentTarget:t}=e,r=iN(t);let n=t.closest("li")?.previousElementSibling?.getElementsByClassName(r)[0];if(!n){const e=t.closest(".exploration-list"),o=e?.querySelector(".exploration-section-header");if(o)return o;if(n=((e,t)=>{const r=e.closest(".exploration-list"),n=r?.previousElementSibling;if(null===n||!n)return e.closest(".exploration-panel")?.getElementsByClassName(t)[1];const o=n.getElementsByClassName(t);return o.length>0?o[o.length-1]:void 0})(t,r),!n){const e=t.closest(".exploration-panel")?.getElementsByClassName(r)[1];return e??null}}return n},lN=e=>{(e instanceof HTMLElement||e instanceof SVGElement)&&e.focus()},uN=e=>{const t=e.key===yT.Down?(e=>{const{currentTarget:t}=e,r=iN(t),n=t.closest("li");let o=n?.nextElementSibling?.getElementsByClassName(r)[0];return o||(o=aN(t),o)?o:t.closest(".exploration-panel")?.getElementsByClassName(r)[0]})(e):sN(e);t&&lN(t)},cN=(e,t)=>{const{key:r}=e;switch(r){case yT.Tab:e.preventDefault(),e.shiftKey?((e,t)=>{const{currentTarget:r}=e,n=r.closest("ul")?.getElementsByClassName("exploration-item-focus");if(r===t.items.draggableIconRef.current){if(t.itemIndex>=0){const e=n&&n[t.itemIndex];return void(e&&lN(e))}const r=sN(e);r&&lN(r)}if(r===t.items.explorationItemFocusRef.current){const t=r.closest("li")?.previousElementSibling?.getElementsByClassName("exploration-draggable-icon")[0];if(t)return void lN(t);const n=sN(e);n&&lN(n)}})(e,t):((e,t)=>{const{currentTarget:r}=e;if(!e.shiftKey){if(r===t.items.explorationItemFocusRef.current){const e=r.closest("li")?.getElementsByClassName("exploration-draggable-icon")[0];return void(e&&lN(e))}if(r===t.items.draggableIconRef.current){const e=r.closest("ul")?.getElementsByClassName("exploration-item-focus");if((e?.length||0)-1>t.itemIndex){const r=e&&e[t.itemIndex+1];return void(r&&lN(r))}const n=aN(r);n&&lN(n)}}})(e,t);break;case yT.Down:case yT.Up:e.preventDefault(),e.stopPropagation(),uN(e);break;case yT.Enter:case yT.Space:e.preventDefault(),e.stopPropagation(),((e,t)=>{const{currentTarget:r}=e;if(r===t.items.draggableIconRef.current){const e=r.closest("li")?.getElementsByClassName("exploration-item")[0];return void(e&&lN(e))}if(r===t.items.explorationItemRef.current){const e=r.getElementsByClassName("exploration-draggable-icon")[0];return void lN(e)}r===t.items.explorationItemFocusRef.current&&t.toggleCheckedById(t.id)})(e,t)}},dN=(e,t)=>{const{key:r,currentTarget:n}=e;if(n===t.current&&r===yT.Tab)if(e.preventDefault(),e.shiftKey)((e,t)=>{const{currentTarget:r}=e;if(r!==t.current)return;const n=r.closest('[role="region"]')?.getElementsByTagName("button")[0];n&&lN(n)})(e,t);else{const e=n.parentElement?.getElementsByClassName("exploration-section-header")[0];e&&lN(e)}},pN=(e,t)=>{const{currentTarget:r}=e;if(r!==t.ref.current)return;const n=t.sectionIndex??2;if(0===n)return void((e,t)=>{const{currentTarget:r}=e;if(r!==t.ref.current)return;const n=r.closest(".exploration-panel")?.getElementsByTagName("input")[0];n&&lN(n)})(e,t);const o=r.closest(".exploration-panel")?.getElementsByClassName("exploration-list")[n-1],i=o?.getElementsByClassName("exploration-item-focus").length??0;if(i>0){const e=o?.getElementsByClassName("exploration-draggable-icon")[i-1];e&&lN(e)}},fN=(e,t)=>{const{key:r}=e;switch(r){case yT.Tab:e.preventDefault(),e.stopPropagation(),e.shiftKey?pN(e,t):((e,t)=>{const{currentTarget:r}=e;if(r!==t.ref.current)return;const n=r.closest(".exploration-list"),o=n?.getElementsByClassName("exploration-item-focus")[0];o&&lN(o)})(e,t);break;case yT.Down:e.preventDefault(),((e,t)=>{const{currentTarget:r}=e;if(r!==t.ref.current)return;const n=r.closest(".exploration-panel"),o=n?.getElementsByClassName("exploration-section-header").length??0;let i=null;if(0===o)return;const a=t.sectionIndex??2;i=a+1<o?n?.getElementsByClassName("exploration-section-header")[a+1]:n?.getElementsByClassName("exploration-section-header")[0],i&&lN(i)})(e,t);break;case yT.Up:e.preventDefault(),((e,t)=>{const{currentTarget:r}=e;if(r!==t.ref.current)return;const n=r.closest(".exploration-panel"),o=n?.getElementsByClassName("exploration-section-header").length??0;let i=null;if(0===o)return;const a=t.sectionIndex??2;i=a-1>=0?n?.getElementsByClassName("exploration-section-header")[a-1]:n?.getElementsByClassName("exploration-section-header")[o-1],i&&lN(i)})(e,t);break;case yT.Enter:case yT.Space:e.preventDefault(),((e,t)=>{const{currentTarget:r}=e;if(e.preventDefault(),r!==t.ref.current)return;const n="all"!==t.checkState;t.toggleAllCheckboxes(n)})(e,t)}},hN=({children:e})=>ii.jsx("span",{style:{width:"fit-content",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontWeight:"bold"},children:e}),mN=({children:e,sectionIndex:t})=>{const n=Pw(void 0!==t?_T(t):rN),o=Rw(void 0!==t?jT(t):nN),i=r.useRef(null),a={ref:i,toggleAllCheckboxes:o,checkState:n,sectionIndex:t};return ii.jsxs(Qu,{ref:i,className:"exploration-section-header",tabIndex:0,onKeyDown:e=>{fN(e,a)},sx:{display:"flex",alignItems:"center",width:"100%",padding:"2px 8px 2px 8px",boxSizing:"border-box",fontSize:"12px","&:focus-visible":{boxShadow:`0 0 0 2px ${HT} inset`}},children:[ii.jsx(Ic,{disabled:"disabled"===n,checked:"all"===n,indeterminate:"some"===n,onChange:e=>{o(e.target.checked)},size:"small",style:{flexShrink:0,padding:9}}),ii.jsx(hN,{children:e})]})},gN=({sectionIndex:e})=>{const t=Pw(qT(e));return ii.jsx(mN,{sectionIndex:e,children:t})},vN=x((e,t)=>ii.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:ii.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"})})),yN=x((e,t)=>ii.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:ii.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"})})),bN=fl("div")({position:"absolute",width:"1px",height:"1px",padding:0,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}),xN=fl(yN)(()=>({padding:"6px 6px",flexShrink:0,cursor:"grab","&:focus-visible":{boxShadow:`0 0 0 2px ${HT} inset`}})),SN=({children:e})=>ii.jsx("span",{style:{width:"fit-content",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1,paddingLeft:4},children:e}),wN=({icon:e,title:t,...n})=>{const[o,i]=Mw(mC),a=Pw(Bw),s=r.useRef(null),l=r.useRef(null),u=r.useRef(null),c={id:n.id,itemIndex:n.itemIndex,toggleCheckedById:i,items:{explorationItemRef:s,explorationItemFocusRef:l,draggableIconRef:u}};return ii.jsxs(Qu,{ref:s,className:"exploration-item",onClick:e=>{e.stopPropagation(),i(n.id)},onKeyDown:e=>{cN(e,c)},tabIndex:0,style:{display:"flex",alignItems:"center",width:"100%",cursor:"pointer",padding:0,boxSizing:"border-box",fontSize:"12px"},title:t,sx:{"&:hover":{backgroundColor:"action.hover"},"&:focus-visible":{boxShadow:`0 0 0 2px ${HT} inset`}},children:[ii.jsxs(Qu,{ref:l,className:"exploration-item-focus",component:"div",tabIndex:0,onKeyDownCapture:e=>{cN(e,c)},sx:{display:"flex",minWidth:0,alignItems:"center",justifyContent:"space-between",flexGrow:1,marginRight:"4px","&:focus-visible":{boxShadow:`0 0 0 2px ${HT} inset`}},children:[ii.jsx(Ic,{checked:o.has(n.id),"aria-label":a("ChartExploration.ListItem.Label",t),size:"small",tabIndex:-1,style:{padding:9,flexShrink:0,visibility:-1===n.id?"hidden":"visible"}}),ii.jsx(e,{height:"12px",style:{flexShrink:0}}),ii.jsx(SN,{children:t})]}),ii.jsx(xN,{ref:u,className:"exploration-draggable-icon",tabIndex:0,height:"16px",onClick:e=>{e.stopPropagation()},onKeyDownCapture:e=>{cN(e,c)}})]})},CN=e=>{const t=Pw(OT(e))??"";return ii.jsx(wN,{title:t,icon:vN,...e})},EN=()=>{const e=Pw(TT),t=Pw(NT),r=Pw(YT),n=Rw(FT);return ii.jsx(hT,{numberOfSections:2,numberOfItemsInSection:t,keyExtractor:e,emptyTexts:r,onDragEnd:n,dragOverlayRenderer:XT,headerRenderer:gN,itemRenderer:CN})},IN=({itemIndex:e})=>{const t=Pw(QT(e));return ii.jsx(KT,{children:t})},DN=()=>{const e=Pw(Bw);return ii.jsx(mN,{children:e("Common.Values")})},PN=x((e,t)=>ii.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:[ii.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"}),ii.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"})]})),RN=e=>{const{itemIndex:t}=e,r=Pw(QT(t));return ii.jsx(wN,{title:r,icon:PN,...e})},MN=()=>{const e=Pw(eN),t=Pw(tN),r=Pw(UT),n=Rw(oN);return ii.jsx(Qu,{className:"exploration-header-section",style:{height:"100%",display:"flex",flexDirection:"column-reverse"},children:ii.jsx(hT,{numberOfSections:1,numberOfItemsInSection:t,keyExtractor:e,emptyTexts:r,onDragEnd:n,dragOverlayRenderer:IN,headerRenderer:DN,itemRenderer:RN})})},LN=x((e,t)=>ii.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:ii.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"})})),AN=()=>{const[e,t]=Mw(Gw),n=Pw(Bw),o=r.useRef(null),[i]=Pw(tN),[a=0,s=0]=Pw(NT),l=f(e=>{t(e.target.value)},[t]),u=0===e.length||0===a&&0===s&&0===i?n("Common.Search.NoResultsAvailable"):n("ChartExploration.Pivot.Search.ResultsFound",a.toString(),s.toString(),i.toString());return ii.jsxs(Qu,{ref:o,onKeyDown:e=>{dN(e,o)},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:[ii.jsx(bN,{"data-testid":"screenOnly-search-results","aria-live":"polite","aria-atomic":"true",children:u}),ii.jsx(Np,{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:l,startAdornment:ii.jsx(pd,{position:"start",children:ii.jsx(LN,{})}),inputProps:{style:{fontSize:"14px",paddingTop:6,paddingBottom:6}}})]})},kN=e=>{const t=((e="light",t=!1)=>Ls(If(0,t)))();return ii.jsx(ml,{theme:t,children:ii.jsx(Sw,{children:ii.jsx(gC,{props:e,children:ii.jsxs(Qu,{className:"exploration-panel",style:{display:"flex",flexDirection:"column"},children:[ii.jsx(AN,{}),ii.jsx(EN,{}),ii.jsx(MN,{})]})})})})},ON=e=>{if(e.flags.isEnabled("CLIENT_IM_5973_PIVOT_TABLE_EXPLORATION"))return{component:kN,classification:{tags:["exploration"],exclusive:!0}}};var qN=function(e){return e.CONTAINS="contains",e.MATCHES_EXACTLY="matches_exactly",e.STARTS_WITH="starts_with",e.ENDS_WITH="ends_with",e.BEGINNING_OF_WORD="beginning_of_word",e}(qN||{}),TN=function(e){return e.COMPARE="compare",e.GENERAL="general",e}(TN||{}),NN=function(e){return e.VALUES="values",e.CONDITION="condition",e.SEARCH="search",e.CLEAR_SELECTION="clear_selection",e.TOP_BOTTOM="top_bottom",e}(NN||{}),_N=function(e){return e.FIXED_VALUE="fixed_value",e.CALCULATED_VALUE="calculated_value",e}(_N||{});const jN=e=>e&&"]"!==e?/^[A-Za-z][A-Za-z0-9_]*$/.test(e)||(e=>{if(!e)return!1;if("["===e[0]&&"]"===e[e.length-1]){let t=e.substring(1,e.length-1);if(/^[A-Za-z][A-Za-z0-9_]*$/.test(t))return!0;if(t=t.replace(/\]\]/g,"]"),e===`[${t.replace(/\]/g,"]]")}]`)return!0}return!1})(e)?e:`[${e.replace(/\]/g,"]]")}]`:e,FN=e=>{if(!Array.isArray(e))return"";let t="{<";const r=[];if(e.forEach(e=>{let t=`[${e.field}]${e.exclude?"-":""}={`,n="}",o="";switch(e.type){case NN.SEARCH:o=(e=>{let t="",r="";const n=e.options?.mode;if(!n)return"";switch(n){case qN.BEGINNING_OF_WORD:t="*^",r="*";break;case qN.ENDS_WITH:t="*";break;case qN.STARTS_WITH:r="*";break;case qN.MATCHES_EXACTLY:break;case qN.CONTAINS:default:t="*",r="*"}const o=e.options.values?.[0]??"";return""!==o?`"${t}${o}${r}"`:""})(e);break;case NN.CONDITION:o=(e=>{const{options:t}=e,r=t?.mode===TN.GENERAL,n=t?.modifier?.type===_N.FIXED_VALUE,o=t?.modifier?.operator?t.modifier.operator.split(" "):[];if(0===o.length||!n&&(!t.firstValue?.aggregator||!t.firstValue?.field)||n&&!t.firstValue?.fixedValue||r&&(!t.conditionField?.aggregator||!t.conditionField?.field))return"";let i,a,s="=";r&&n?(i=`${t.conditionField?.aggregator}(${jN(t.conditionField?.field)})`,a=`${t.firstValue?.fixedValue}`):!r&&n?(i="",a=`${t.firstValue?.fixedValue}`,s=""):r||n?(i=`${t.conditionField?.aggregator}(${jN(t.conditionField?.field)})`,a=`${t.firstValue?.aggregator}(${jN(t.firstValue?.field)})`):(i=`${jN(e.field)}`,a=`${t.firstValue?.aggregator}(total ${jN(t.firstValue?.field)})`);const l=`${s}${i}${o[0]}${a}`;let u="";if(o.length>1){if(!n&&(!t.secondValue?.aggregator||!t.secondValue?.field)||n&&!t.secondValue?.fixedValue)return"";let e,a;r&&n?(e=`${t.secondValue?.fixedValue}`,a=` and ${i}`):!r&&n?(e=`${t.secondValue?.fixedValue}`,a=""):r||n?(e=`${t.secondValue?.aggregator}(${jN(t.secondValue?.field)})`,a=` and ${i}`):(e=`${t.secondValue?.aggregator}(total ${jN(t.secondValue?.field)})`,a=` and ${i}`),u=`${a}${o[1]}${e}`}return`"${l}${u}"`})(e);break;case NN.CLEAR_SELECTION:o=`[${e.field}]=`,t="",n="";break;case NN.VALUES:default:o=e.options?.values?e.options.values.map(e=>`'${e.replace(/'/g,"''")}'`).join(","):""}""!==o&&r.push(`${t}${o}${n}`)}),0===r.length)return;return t+=`${r.join(",")}>}`,t},zN=[];for(let e=0;e<256;++e)zN.push((e+256).toString(16).slice(1));let WN;const $N=new Uint8Array(16);var HN={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function VN(e,t,r){const n=(e=e||{}).random??e.rng?.()??function(){if(!WN){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");WN=crypto.getRandomValues.bind(crypto)}return WN($N)}();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(e,t=0){return(zN[e[t+0]]+zN[e[t+1]]+zN[e[t+2]]+zN[e[t+3]]+"-"+zN[e[t+4]]+zN[e[t+5]]+"-"+zN[e[t+6]]+zN[e[t+7]]+"-"+zN[e[t+8]]+zN[e[t+9]]+"-"+zN[e[t+10]]+zN[e[t+11]]+zN[e[t+12]]+zN[e[t+13]]+zN[e[t+14]]+zN[e[t+15]]).toLowerCase()}(n)}const BN=()=>crypto?.randomUUID?.()??function(e){return HN.randomUUID&&!e?HN.randomUUID():VN(e)}(),GN=1e3,UN=1e3,YN=e=>{if(0===e.qInterColumnSortOrder.length)return;const t=e.qDimensions,r=((e,t)=>{const r=new Set;for(const t of e){if(r.has(t))return!0;r.add(t)}const n=e.includes(-1),o=e.filter(e=>-1!==e);if(t){const r=n?t.length+1:t.length;if(e.length!==r)return!0}const i=[...o].sort((e,t)=>e-t);for(let e=0;e<i.length;e++)if(i[e]!==e)return!0;return!1})(e.qInterColumnSortOrder,t);r&&(e.qInterColumnSortOrder=((e,t)=>{const r=[];if(t)for(let e=0;e<t.length;e++)r.push(e);return e.qMeasures.length>=2&&r.push(-1),r})(e,t))},KN=(e,t,r)=>{[e[t],e[r]]=[e[r],e[t]]},XN=e=>{if(!e)return;YN(e);const t=e.qDimensions,{qInterColumnSortOrder:r}=e;((e,t=[])=>{const r=t.filter(e=>-1!==e);for(let n=0;n<r.length;n++)if(-1!==r[n]&&r[n]!==n){const o=r[n],i=r.indexOf(n),a=r[i];KN(r,n,i),KN(e,n,i),KN(t,t.indexOf(o),t.indexOf(a))}})(t,r)},JN=P;class ZN extends JN{#u;constructor(e,t){super(e),this.path=e.path,this.#u=t}async addDimension(e,t,r,n){if(!e||this.#c(e))return;const o=t??!1;if(e.qDef.cId||(e.qDef.cId=BN()),n)return this.addAlternativeDimension(e,o,r);if(this.getDimensions().length<this.maxDimensions()){const t=await(async(e,t,r,n)=>{const o=e.getDimensions(),i=e.hcProperties.qNoOfLeftDims;return await e.autoSortDimension(t),XN(e.hcProperties),(-1===i||Number.isNaN(+i))&&(e.hcProperties.qNoOfLeftDims=o.length),r?((e,t,r,n)=>{if(!e)return;const{qInterColumnSortOrder:o,qNoOfLeftDims:i}=e,a=t.length,s=o.indexOf(-1),l=-1!==s,u=void 0!==n?n+(i||0):void 0;if(l&&void 0!==u&&s>=u?((e,t,r)=>{t.splice(r,1),t.push(e),t.splice(r+1,0,-1)})(a,o,s):o.push(a),void 0===n)t.push(r);else if(void 0!==u){const e=l&&u>s?u-1:u;t.splice(e,0,r)}})(e.hcProperties,o,t,n):((e,t,r,n)=>{if(!e||"number"!=typeof e.qNoOfLeftDims)return;const o=e.qNoOfLeftDims,{qInterColumnSortOrder:i}=e,a=t.length,s=i.indexOf(-1),l=-1!==s&&o>0&&s<o;if(i.push(a),l)void 0===n?t.splice(o-1,0,r):s<n?t.splice(n-1,0,r):(t.splice(n,0,r),i.splice(s,1),i.splice(s+1,0,-1));else{const e=n??o;t.splice(e,0,r),-1!==s&&(i.splice(s,1),i.splice(s+1,0,-1))}e.qNoOfLeftDims++})(e.hcProperties,o,t,n),t})(this,e,o,r);return this.#d({section:o?"columns":"rows",cId:e.qDef.cId,addLast:void 0===r}),t}}async addDimensions(e,t,r){const n=[];for await(const o of e){const e=await this.addDimension(o,r,void 0,t);e&&n.push(e)}return n}addAlternativeDimension(e,t,r){if(!e||this.#c(e))return;const n=this.getAlternativeDimensions();void 0===this.hcProperties.excludedNoOfLeftDims&&(this.hcProperties.excludedNoOfLeftDims=n.length);let o=r;return o=void 0===o?t?n.length:this.hcProperties.excludedNoOfLeftDims:t?this.hcProperties.excludedNoOfLeftDims+o:Math.min(o,this.hcProperties.excludedNoOfLeftDims),n.splice(o,0,e),t||this.hcProperties.excludedNoOfLeftDims++,this.#d({section:t?"columns":"rows",cId:e.qDef.cId,alternative:!0,addLast:void 0===r}),e}async addFieldDimension(e,t,r,n={}){const o=this.createFieldDimension(e,t,r);return this.addDimension(o,n.asColumn,void 0,!1)}async addFieldDimensions(e,t={}){const r=e.map(e=>this.createFieldDimension(e.field,e.label,e.defaults));return this.addDimensions(r,void 0,t.asColumn)}async addLibraryDimensions(e,t={}){const r=e.map(e=>this.createLibraryDimension(e.id,e.defaults));return this.addDimensions(r,void 0,t.asColumn)}reinsertDimension(e,t,r){e.qDef.cId||(e.qDef.cId=BN());if(this.getDimensions().length<this.maxDimensions())return this.addDimension(e,t,r);return this.reinsertAlternativeDimension(e,r,t)}reinsertAlternativeDimension(e,t,r){const n=this.getDimensions(),o=this.getAlternativeDimensions();if(n.length>=GN)return Promise.resolve();const i="number"==typeof t?t:o.length;return o.splice(i,0,e),this.#d({section:r?"columns":"rows",cId:e.qDef.cId,alternative:!0}),Promise.resolve(e)}async removeDimensions(e,t,r){return Promise.all([...e].reverse().map(e=>this.removeDimension(e,t,r)))}async removeDimension(e,t,r){if(t){const t=this.getAlternativeDimensions().splice(e,1)[0];return!r&&this.hcProperties.excludedNoOfLeftDims&&this.hcProperties.excludedNoOfLeftDims--,this.#p({cId:t.qDef.cId,section:r?"columns":"rows"}),t}const n=this.getDimensions(),o=this.properties.qHyperCubeDef.qNoOfLeftDims,i=this.hcProperties.qInterColumnSortOrder.indexOf(e);"number"==typeof this.properties.qHyperCubeDef.qNoOfLeftDims&&"number"==typeof i&&"number"==typeof o&&i+1<=o&&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=n.splice(e,1).at(0);if(s)return((e,t)=>{if(!e)return-1;const r=e.indexOf(t);if(-1===r)return-1;for(let r=0;r<e.length;++r)e[r]>t&&e[r]--;e.splice(r,1)})(this.hcProperties.qInterColumnSortOrder,e),XN(this.hcProperties),this.#p({cId:s.qDef.cId,section:r?"columns":"rows"}),s}#c(e){return!(!e||void 0===e.qDef.cId)&&[...this.getDimensions(),...this.getAlternativeDimensions()].some(t=>t.qDef.cId===e.qDef.cId)}async addMeasures(e,t=!1){const r=[];for await(const n of e){const e=await this.addMeasure(n,t,void 0,!0);e&&r.push(e)}return r}addAlternativeMeasures(e,t){if(this.#f(e))return;const r=this.getAlternativeMeasures(),n=void 0===t?r.length:t,o=r.splice(n,0,e);return this.#h({cId:e.qDef.cId,alternative:!0,addLast:void 0===t}),o}async addMeasure(e,t,r,n){if(this.#f(e))return;if(e.qDef.cId||(e.qDef.cId=BN()),t)return this.addAlternativeMeasures(e,r);n||delete e.qDef.qNumFormat;const o=this.getMeasures();if(o.length<this.maxMeasures()){const t=1===o.length;return void 0!==r&&r>=0?o.splice(r,0,e):o.push(e),this.autoSortMeasure(e).then(()=>(t&&(this.hcProperties.qInterColumnSortOrder.push(-1),0===this.getDimensions().length&&(this.hcProperties.qNoOfLeftDims=0)),this.#h({cId:e.qDef.cId,addLast:void 0===r}),e))}return o.length<UN?(this.getAlternativeMeasures().push(e),this.#h({cId:e.qDef.cId,alternative:!0,addLast:void 0===r}),Promise.resolve(e)):Promise.resolve()}reinsertMeasure(e,t){const r=this.getMeasures(),n=this.getAlternativeMeasures(),o=this.hcProperties.qInterColumnSortOrder;if(e.qDef.cId||(e.qDef.cId=BN()),t=void 0!==t?t:r.length,r.length<this.maxMeasures()){if(r.splice(t,0,e),2===r.length){-1===o.indexOf(-1)&&o.push(-1)}this.#h({cId:e.qDef.cId})}else r.length<UN&&(t=n.length,n.splice(t,0,e),this.#h({cId:e.qDef.cId}));return Promise.resolve(e)}async removeMeasure(e,t){if(t&&"number"==typeof e){const t=this.getAlternativeMeasures().splice(e,1)[0];return this.#p({cId:t.qDef.cId,section:"measures"}),t}const r=this.getMeasures();let n,o,i;if("number"==typeof e&&e<r.length){n=2===r.length,o=this.getMeasures().splice(e,1)[0];const t=this.hcProperties.qInterColumnSortOrder;n&&(i=t.indexOf(-1),t.splice(i,1),this.hcProperties.qNoOfLeftDims&&i+1<=this.hcProperties.qNoOfLeftDims&&this.hcProperties.qNoOfLeftDims--)}else"number"==typeof e&&(o=this.getAlternativeMeasures().splice(e-r.length,1)[0]);if(o)return this.#p({cId:o.qDef.cId,section:"measures"}),o}async removeMeasures(e,t){return await Promise.all([...e].reverse().map(e=>this.removeMeasure(e,t))),e}#f(e){return!(!e||void 0===e.qDef.cId)&&[...this.getMeasures(),...this.getAlternativeMeasures()].some(t=>t.qDef.cId===e.qDef.cId)}getSorting(){throw new Error("don't call this")}changeSorting(){throw new Error("don't call this")}setSorting(){throw new Error("don't call this")}getRowDimensions(){const e=this.#m("rows"),t=this.getDimensions();return e.filter(e=>e>=0).map(e=>t[e])}getColumnDimensions(){const e=this.#m("columns"),t=this.getDimensions();return e.filter(e=>e>=0).map(e=>t[e])}getAlternativeRowDimensions(){const e=this.getAlternativeDimensions(),{excludedNoOfLeftDims:t}=this.hcProperties;return-1===t?e:e.slice(0,t)}getAlternativeColumnDimensions(){const e=this.getAlternativeDimensions(),{excludedNoOfLeftDims:t}=this.hcProperties;return-1===t?[]:e.slice(t)}#g(e){const t=this.hcProperties.rankedList?.[e];return t||this.createRankedList(e)}#v(e){return[...this.#g(e)]}#y(e,t){return void 0===this.hcProperties.rankedList&&(this.hcProperties.rankedList={}),this.hcProperties.rankedList[e]=t,t}#b(e){const t=({qDef:t})=>t.cId===e;if(-1===e){return this.hcProperties.qInterColumnSortOrder.indexOf(-1)+1<=this.hcProperties.qNoOfLeftDims?"rows":"columns"}return this.getRowDimensions().some(t)||this.getAlternativeRowDimensions().some(t)?"rows":this.getColumnDimensions().some(t)||this.getAlternativeColumnDimensions().some(t)?"columns":null}#x(e){const t=({qDef:t})=>t.cId===e;return!(!this.getAlternativeDimensions().some(t)&&!this.getAlternativeMeasures().some(t))}#m(e){const{qInterColumnSortOrder:t,qNoOfLeftDims:r}=this.hcProperties;if(this.#S())return"columns"===e?t:[];switch(e){case"rows":return-1===r?t:t.slice(0,r);case"columns":return-1===r?[]:t.slice(r);default:throw new Error(`Unknown section in #getInterColumnSortOrderBySection: ${e}`)}}#S(){const{qNoOfLeftDims:e}=this.hcProperties,t=-1===e||Number.isNaN(+e);return 0===this.getDimensions().length&&this.getMeasures().length>0&&t}#w(e){const t=this.hcProperties.qInterColumnSortOrder.indexOf(-1);if(-1===t)return!1;if(this.#S())return"columns"===e;if(void 0===this.hcProperties.qNoOfLeftDims)return"rows"===e;switch(e){case"rows":return t+1<=this.hcProperties.qNoOfLeftDims;case"columns":return t+1>this.hcProperties.qNoOfLeftDims;default:return!1}}#C(e,t=!0){const r=e=>-1===e?-1:e.qDef.cId;if("measures"===e)return this.getMeasures().concat(t?this.getAlternativeMeasures():[]).map(r);const n=this.#m(e),o=this.getDimensions(),i=n.map(e=>-1===e?-1:o[e]);switch(e){case"rows":return i.concat(t?this.getAlternativeRowDimensions():[]).map(r);case"columns":return i.concat(t?this.getAlternativeColumnDimensions():[]).map(r);default:throw new Error(`Unknown section in #isCorruptRankedList: ${e}`)}}isRankedListCorrupt(e){const t=this.hcProperties.rankedList?.[e],r=this.properties.qInfo?.qId;if(!t)return!0;if(new Set(t).size!==t.length){const n=t.filter((e,r)=>t.indexOf(e)!==r);return console.warn("Corrupt ranked list detected: duplicate ids",{duplicates:n,section:e,chartId:r}),!0}const n=this.#C(e);if(t.length!==n.length)return console.warn("Corrupt ranked list detected: length mismatch",{section:e,chartId:r,fieldIds:n,rankedList:t,diff:new Set(n).symmetricDifference(new Set(t))}),!0;const o=n.filter(e=>!t.includes(e));if(o.length>0)return console.warn("Corrupt ranked list detected: missing ids",{missingIds:o,section:e,chartId:r}),!0;const i=this.#C(e,!1),a=t.filter(e=>i.includes(e)),s=i.filter((e,t)=>e!==a[t]);return s.length>0&&(console.warn("Corrupt ranked list detected: main field order mismatch",{section:e,chartId:r,orderMismatchIds:s}),!0)}createRankedList(e){switch(e){case"rows":case"columns":return this.#E({section:e});case"measures":return this.#I();default:throw new Error(`Unknown section in getRankedList: ${e}`)}}#E({section:e}){const t=this.getDimensions(),r=this.#m(e),n="columns"===e?this.getAlternativeColumnDimensions():this.getAlternativeRowDimensions(),o=r.map(e=>-1===e?-1:t[e].qDef.cId);return o.push(...n.map(e=>e.qDef.cId)),this.#y(e,o)}#I(){if(void 0!==this.hcProperties.rankedList?.measures)return this.hcProperties.rankedList.measures;const e=[...this.getMeasures(),...this.getAlternativeMeasures()].map(e=>e.qDef.cId);return this.#y("measures",e)}#D({section:e,cId:t,fields:r,addLast:n}){const o=this.#g(e),i=r.findIndex(e=>e.qDef.cId===t),a=r[i+1]?.qDef.cId,s=r[i-1]?.qDef.cId;if(n)o.push(t);else if(i>=0)if(a){const e=o.indexOf(a);o.splice(e,0,t)}else if(s){const e=o.indexOf(s);o.splice(e+1,0,t)}else o.push(t);return void 0===this.hcProperties.rankedList&&(this.hcProperties.rankedList={}),this.hcProperties.rankedList[e]}#d({section:e,cId:t,alternative:r=!1,addLast:n=!1}){if(void 0===this.hcProperties.rankedList?.[e])return this.#E({section:e});let o=[];return o="columns"===e?r?this.getAlternativeColumnDimensions():this.getColumnDimensions():r?this.getAlternativeRowDimensions():this.getRowDimensions(),this.#D({section:e,cId:t,fields:o,addLast:n})}#h({cId:e,alternative:t=!1,addLast:r=!1}){if(void 0===this.hcProperties.rankedList?.measures)return this.#I();const n=t?this.getAlternativeMeasures():this.getMeasures();return this.#P(),this.#D({section:"measures",cId:e,fields:n,addLast:r})}#P(){const e=this.#g("rows"),t=this.#g("columns");this.#w("rows")&&!e.includes(-1)?e.push(-1):this.#w("columns")&&!t.includes(-1)&&t.push(-1)}#R(){if(this.hcProperties.qInterColumnSortOrder.includes(-1))return;const e=this.#g("rows"),t=this.#g("columns"),r=e.indexOf(-1),n=t.indexOf(-1);-1!==r&&e.splice(r,1),-1!==n&&t.splice(n,1)}#p({cId:e,section:t}){const r=this.#g(t),n=r.indexOf(e);-1!==n&&(r.splice(n,1),this.#R())}async moveMeasureToAlternative(e){const t=this.getMeasures().findIndex(t=>t.qDef.cId===e),r=this.#v("measures"),n=r.indexOf(e);if(-1===t)return;const o=await this.removeMeasure(t);if(void 0===o)return;const i=r.slice(n+1).find(e=>this.getAlternativeMeasures().some(t=>t.qDef.cId===e)),a=this.getAlternativeMeasures().findIndex(e=>e.qDef.cId===i);await this.addAlternativeMeasures(o,-1===a?void 0:a),this.#y("measures",r)}async moveMeasureFromAlternative(e){const t=this.getAlternativeMeasures().findIndex(t=>t.qDef.cId===e),r=this.#v("measures"),n=r.indexOf(e);if(-1===t)return;const o=await this.removeMeasure(t,!0);if(void 0===o)return;const i=this.getMeasures().map(e=>e.qDef.cId),a=r.slice(n+1).find(e=>i.includes(e)),s=i.findIndex(e=>e===a);await this.addMeasure(o,!1,-1===s?void 0:s),this.#y("measures",r)}async moveDimensionToAlternative(e){const t=this.#b(e),r=this.getDimensions().findIndex(t=>t.qDef.cId===e);if(-1===r||null===t)return;const n=this.#v(t),o=n.indexOf(e),i="columns"===t,a=await this.removeDimension(r,!1,i);if(void 0===a)return;const s=n.slice(o+1).find(e=>this.getAlternativeDimensions().some(({qDef:t})=>t.cId===e));let l=this.getAlternativeDimensions().findIndex(({qDef:e})=>e.cId===s);l=-1===l?void 0:l;void 0!==this.addAlternativeDimension(a,i,l)&&this.#y(t,n)}async moveDimensionFromAlternative(e){const t=this.#b(e),r=this.getAlternativeDimensions().findIndex(t=>t.qDef.cId===e);if(-1===r||null===t)return;const n=this.#v(t),o=n.indexOf(e),i="columns"===t,a=await this.removeDimension(r,!0,i);if(void 0===a)return;const s=this.#C(t,!1),l=n.slice(o+1).find(e=>s.includes(e));let u=s.findIndex(e=>e===l);u=-1===u?void 0:u;void 0!==await this.addDimension(a,i,u)&&this.#y(t,n)}movePseudoDimension({toIndex:e,toSection:t}){const r=this.#b(-1);if(null===r)return void console.error("Cannot move pseudo dimension, unable to find it in any section",{toIndex:e,toSection:t});const n="columns"===t,o=r===t,i=this.#v(t);if(o){const e=i.indexOf(-1);i.splice(e,1)}else{const o=this.#g(r),i=o.indexOf(-1);if(-1===i)return void console.error("Couldn't delete pseudo dimension from current section",{toIndex:e,toSection:t,fromSection:r});o.splice(i,1),this.hcProperties.qNoOfLeftDims=n?Math.max(0,this.hcProperties.qNoOfLeftDims-1):this.hcProperties.qNoOfLeftDims+1}const a=e-i.slice(0,e).filter(e=>this.#x(e)).length,s=n?this.hcProperties.qNoOfLeftDims+a:a,l=this.hcProperties.qInterColumnSortOrder.indexOf(-1);this.hcProperties.qInterColumnSortOrder.splice(l,1),this.hcProperties.qInterColumnSortOrder.splice(s,0,-1),i.splice(e,0,-1),this.#y(t,i)}async moveDimension({cId:e,toIndex:t,toSection:r}){const n=this.#b(e),o=this.#x(e);if(null===n)return void console.error("Cannot move dimension, unable to find it in any section",{cId:e});const i=(o?this.getAlternativeDimensions():this.getDimensions()).findIndex(({qDef:t})=>t.cId===e);if(-1===i)return void console.error("Couldn't find dimension to move",{cId:e,toIndex:t,toSection:r});const a=this.#v(r),s=a.indexOf(e);-1!==s&&a.splice(s,1);const l=t-a.slice(0,t).filter(e=>this.#x(e)!==o).length,u="columns"===r,c="columns"===n,d=await this.removeDimension(i,o,c);if(void 0===d)return;void 0!==await this.addDimension(d,u,l,o)&&(a.splice(t,0,e),this.#y(r,a))}async moveMeasure({cId:e,toIndex:t}){const r=this.#x(e),n=(r?this.getAlternativeMeasures():this.getMeasures()).findIndex(t=>t.qDef.cId===e);if(-1===n)return void console.error("Cannot move measure, unable to find it in any section",{cId:e});const o=this.#v("measures"),i=o.indexOf(e);-1!==i&&o.splice(i,1);const a=t-o.slice(0,t).filter(e=>this.#x(e)!==r).length,s=await this.removeMeasure(n,r);if(void 0===s)return;void 0!==await this.addMeasure(s,r,a)&&(o.splice(t,0,e),this.#y("measures",o))}getLabels(){return this.getMeasures().filter(e=>!e.qLibraryId&&!!e.qDef.qLabel).map(e=>e.qDef.qLabel)}IsHCInStraightMode(){return"S"===this.hcProperties.qMode}getFilters(){return this.properties.filters??[]}getFilter(e){return this.getFilters().find(t=>t.id===e)}addFilterField(e){const t=e.qTags??e.tags,r=Array.isArray(t)&&t.includes("$numeric"),n=e.isDerived,o=Array.isArray(this.properties.filters)?this.properties.filters:[],i={type:"values",field:n?e.value??e.fullname:e.name??e.label??e.field,options:{values:[]},exclude:!1,id:BN(),qTags:Array.isArray(t)?t:[],isNumeric:r};return o.push(i),this.properties.filters=o,this.properties.qHyperCubeDef.qContextSetExpression=FN(o),i}addFilters(e){const t=[];for(const r of e)t.push(this.addFilterField(r));return t}#M(e){const t=this.getFilters();return t.splice(e,1),this.properties.qHyperCubeDef.qContextSetExpression=FN(t),t}removeFilters(e){if(0===e.length)return[];let t=[];const r=[...e].sort((e,t)=>t-e);t=this.getFilters().filter((t,r)=>e.includes(r));for(const e of r)this.#M(e);return t}getAddDimensionLabel(){return this.#u.get("Visualization.Requirements.AddDimension")}canColorBy(){return!1}}var QN={exports:{}};!function(e){self,e.exports=(()=>{var e={909:e=>{var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},a=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var n,o=t.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!o&&!i)return!1;for(n in e);return void 0===n||t.call(e,n)},s=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,r){if("__proto__"===r){if(!t.call(e,r))return;if(o)return o(e,r).value}return e[r]};e.exports=function e(){var t,r,n,o,u,c,d=arguments[0],p=1,f=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<f;++p)if(null!=(t=arguments[p]))for(r in t)n=l(d,r),d!==(o=l(t,r))&&(h&&o&&(a(o)||(u=i(o)))?(u?(u=!1,c=n&&i(n)?n:[]):c=n&&a(n)?n:{},s(d,{name:r,newValue:e(h,c,o)})):void 0!==o&&s(d,{name:r,newValue:o}));return d}},8:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},a=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var n,o=t.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!o&&!i)return!1;for(n in e);return void 0===n||t.call(e,n)},s=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,r){if("__proto__"===r){if(!t.call(e,r))return;if(o)return o(e,r).value}return e[r]};e.exports=function e(){var t,r,n,o,u,c,d=arguments[0],p=1,f=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<f;++p)if(null!=(t=arguments[p]))for(r in t)n=l(d,r),d!==(o=l(t,r))&&(h&&o&&(a(o)||(u=i(o)))?(u?(u=!1,c=n&&i(n)?n:[]):c=n&&a(n)?n:{},s(d,{name:r,newValue:e(h,c,o)})):void 0!==o&&s(d,{name:r,newValue:o}));return d}}},r={};function n(t){var o=r[t];if(void 0!==o)return o.exports;var i=r[t]={exports:{}};return e[t](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{n.r(o),n.d(o,{default:()=>Ae});var e=n(229),t=n.n(e);const r=function(e,t,r){if(!t)return!1;var n,o=t.split("."),i=o[o.length-1],a=e;for(n=0;n<o.length-1;++n)void 0===a[o[n]]&&(a[o[n]]=Number.isNaN(+o[n+1])?{}:[]),a=a[o[n]];if(void 0!==r){var s=a[i];return a[i]=r,{updated:r,previous:s}}return delete a[i],!1},i=function(e,t,r){var n,o=t.split("."),i=e;if(void 0===i)return r;for(n=0;n<o.length;++n){if(void 0===i[o[n]])return r;i=i[o[n]]}return i},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function u(e){return s+e+l}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var r=function(e,t){if(!t)return null;var r,n;for(r=0;r<t.length;r++)if((n=t[r]).qInfo.qId===e)return n;return null}(e.qLibraryId,t.dimensionList);return r&&r.qData.info[0].qTags.indexOf("$numeric")>-1}var n=function(e,t){if(!t)return null;var r,n,o=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var r=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(r)&&(t=(t=t.substring(1,r)).trim()),t}(e);for(r=0;r<t.length;r++){if((n=t[r]).qName===o)return n;if(n.qDerivedFieldData)for(var i=0;i<n.qDerivedFieldData.qDerivedFieldLists.length;++i)for(var a=n.qDerivedFieldData.qDerivedFieldLists[i],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===o)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return n&&n.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function p(e,t){var r=e.crossAllDimensions;return 2===t&&r?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),r=t.trim();return"="===r.substring(0,1)?r.substring(1).trim():r}function h(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(e,t){var r=e.crossAllDimensions;return 2===t&&r?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function v(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function y(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(v("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(v("MaxString(".concat(t,")")),")'\"}")}function b(e){var t=e.modifier,r=void 0===t?{}:t,n=e.dimensions,o=e.dimensionAndFieldList,i=e.funcComp,a=void 0===i?"Sum":i,s=e.valueComp,l=void 0===s?"0":s;if(!r.showExcludedValues)return"";if(n&&1===n.length){var u=y(c(n[0],o),h(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(n&&2===n.length){var d=c(n[0],o),p=c(n[1],o),f=h(0),m=h(1),g=y(d,f),v=y(p,m);return"".concat(a,"({1<").concat(g,",").concat(v,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function S(e){var t=e.properties,r=e.layout;return i(t,"qHyperCubeDef.qDimensions",i(r,"qHyperCube.qDimensionInfo",[])).length}const w={isFullRange:d,getNumDimensions:S,getExpressionWithExcludedComp:function(e){var t=e.expression,r=e.modifier,n=e.dimensions,o=e.dimensionAndFieldList,i=e.treatMissingAsNull,a=u(f(t));if(!r.showExcludedValues)return a;var s=b({modifier:r,dimensions:n,dimensionAndFieldList:o}),l=i?"":", 0";if(n&&1===n.length){var c=h(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(n&&2===n.length){var d=h(0),p=h(1);return"If(Count(".concat(d,") * Count(").concat(p,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:p,getNumStepComp:function(e,t){if(!d(e)){var r=e.steps;return"number"!=typeof r||Number.isNaN(r)?6:r}return p(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,r,n){return m(e,t)+r+g(n)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,r){return"Aggr(".concat(e,", ").concat(t,", ").concat(r,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,r=e.properties,n=e.layout,o=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===o&&2===S({properties:r,layout:n})},getDimComp:function(e,t){var r=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),n=h(t);if(!r.qSortByExpression&&!r.qSortByNumeric&&!r.qSortByAscii)return n;var o=["Descending","Ascending"],i=r.qSortByNumeric?"(Numeric, ".concat(o[(r.qSortByNumeric+1)/2],")"):"",a=r.qSortByAscii?"(Text, ".concat(o[(r.qSortByAscii+1)/2],")"):"";return r.qSortByNumeric&&r.qSortByAscii?"(".concat(n,", ").concat(i,", ").concat(a,")"):r.qSortByNumeric?"(".concat(n,", ").concat(i,")"):r.qSortByAscii?"(".concat(n,", ").concat(a,")"):n},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var r=t.indexOf(s);if(-1!==r){var n=t.indexOf(l);if(-1!==n)return t.substring(r+s.length,n)}}},initModifier:function(e,t){Object.keys(t).forEach(function(r){void 0===e[r]&&(e[r]=t[r])})},isNumeric:c,isApplicable:function(e){var t=e.properties,r=e.layout,n=e.minDimensions,o=void 0===n?1:n,i=e.maxDimensions,a=void 0===i?2:i;if(!t&&!r)return!0;var s=S({properties:t,layout:r});return s>=o&&s<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(s),r=e.indexOf(l);return t>-1&&r>-1&&t<r},getDimDefWithWrapper:h,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,r){var n=t||e.outputExpression;if(e.base&&e.base.qDef&&(n=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var o=r.qHyperCubeDef.qMeasures.find(function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null});o&&t!==o.qDef.qLabel&&(n=o.qLibraryId||o.qDef.base.qLibraryId?"[".concat(o.qDef.qLabel,"]"):o.qDef.base.qDef);var i=function(e){var t=a.OPTIONS.find(function(t){return t.value===e.decomposition});return t?a.EXPRESSIONS[t.value]:""}(e);n=n.startsWith("=")?n.substr(1):n,n="".concat(i,"(").concat(n,", ").concat(e.steps,")")}return n},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find(function(r){var n=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[r]&&n.includes(a.EXPRESSIONS[r].toLowerCase())&&(t=r),r}),t}};function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}var I=t().bind(null,!0),D={},P=Array.isArray;function R(e){return null!=e&&!Array.isArray(e)&&"object"===E(e)}function M(e){return void 0===e}function L(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function A(e,t){var r,n=t.substring(1).split("/").slice(0,-1);return n.forEach(function(t,o){if(o!==n.length){r=+t;var i=Number.isNaN(r)?{}:[];e[r||t]=M(e[r||t])?i:e[t],e=e[r||t]}}),e}function k(e,t){var r=!0;if(R(e)&&R(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(n){k(e[n],t[n])||(r=!1)}),r);if(P(e)&&P(t)){if(e.length!==t.length)return!1;for(var n=0,o=e.length;n<o;n+=1)if(!k(e[n],t[n]))return!1;return!0}return e===t}D.generate=function(e,t,r){r=r||"";var n=[];return Object.keys(t).forEach(function(o){var i=function(e){return e?I({},{val:e}).val:e}(t[o]),a=e[o],s="".concat(r,"/").concat(o);k(i,a)||L(t,o)||(M(a)?n.push({op:"add",path:s,value:i}):R(i)&&R(a)?n=n.concat(D.generate(a,i,s)):P(i)&&P(a)?n=n.concat(function(e,t,r){var n=[],o=e.slice(),i=-1;function a(e,t,r){if(e[r]&&M(e[r].qInfo))return null;if(e[r]&&e[r].qInfo.qId===t)return r;for(var n=0,o=e.length;n<o;n+=1)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(k(t,o))return n;if(!M(t[0])&&M(t[0].qInfo))return n.push({op:"replace",path:r,value:t}),n;for(var s=o.length-1;s>=0;s-=1)-1===(i=a(t,o[s].qInfo&&o[s].qInfo.qId,s))?(n.push({op:"remove",path:"".concat(r,"/").concat(s)}),o.splice(s,1)):n=n.concat(D.generate(o[s],t[i],"".concat(r,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(i=a(o,t[l].qInfo&&t[l].qInfo.qId))?(n.push({op:"add",path:"".concat(r,"/").concat(l),value:t[l]}),o.splice(l,0,t[l])):i!==l&&(n.push({op:"move",path:"".concat(r,"/").concat(l),from:"".concat(r,"/").concat(i)}),o.splice(l,0,o.splice(i,1)[0]));return n}(a,i,s)):n.push({op:"replace",path:"".concat(r,"/").concat(o),value:i}))}),Object.keys(e).forEach(function(o){M(t[o])&&!L(e,o)&&n.push({op:"remove",path:"".concat(r,"/").concat(o)})}),n},D.apply=function(e,t){t.forEach(function(t){var r,n,o=A(e,t.path),i=t.path.split("/").splice(-1)[0],a=i&&Number.isNaN(+i)?o[i]:o[+i]||o,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(o=null,a=e),"add"===t.op||"replace"===t.op)if(P(o))"-"===i&&(i=o.length),o.splice(+i,"add"===t.op?0:1,t.value);else if(P(a)&&P(t.value)){var l,u=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return C(e)}(n=u)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?C(e,t):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(R(a)&&R(t.value))r=a,Object.keys(r).forEach(function(e){Object.getOwnPropertyDescriptor(r,e).configurable&&!L(r,e)&&delete r[e]}),I(a,t.value);else{if(!o)throw new Error("Patchee is not an object we can patch");o[i]=t.value}else if("move"===t.op){var c=A(e,t.from);P(o)?o.splice(+i,0,c.splice(+s,1)[0]):(o[i]=c[s],delete c[s])}else"remove"===t.op&&(P(o)?o.splice(+i,1):delete o[i])})},D.clone=function(e){return I({},e)},D.createPatch=function(e,t,r){var n={op:e.toLowerCase(),path:r};return"move"===n.op?n.from=t:void 0!==t&&(n.value=t),n},D.updateObject=function(e,t){Object.keys(e).length?D.apply(e,D.generate(e,t)):I(e,t)};const O=D,q=function(e,r,n){if(!e)return Promise.resolve();var o=O.generate(r,n);return t()(!0,r,n),o&&o.length?(o=o.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),e.applyPatches(o,!0)):Promise.resolve()};var T="accumulation";function N(e,t){var r=i(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===T)return r[n]}function _(e,t){var r=function(e,t){var r=i(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===T)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}var j={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const F={translationKey:"properties.modifier.accumulation",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,r=e.layout;return w.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,r=e.modifier,n=e.properties,o=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!r)return t;var l=a;void 0===l&&(l=w.getNumDimensions({properties:n,layout:o}));var u=i(n,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:r,dimensions:u,dimensionAndFieldList:s}),d=w.getNumStepComp(r,l),p=w.getAboveComp(r,l,c,d),f=w.getRangeComp("RangeSum",p);if(w.needDimension({modifier:r,properties:n,layout:o})){var h=w.getDimComp(u,1),m=w.getDimComp(u,0),g=w.getAggrComp(f,h,m);f=r.showExcludedValues?w.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return f},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,j)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(_(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(_(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(_(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(_(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var r=N(t,e);if(r){var n=r.steps;r.steps="number"!=typeof n||Number.isNaN(n)?6:Math.abs(n)}},show:function(t){var r=N(t,e);return r&&!r.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(_(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,r,n){var o=n.ext.support.modifiers;if(!Array.isArray(o)||-1===o.indexOf(T))return!1;var i=N(t,e);return i&&!i.disabled}};return r}};var z="movingAverage";function W(e,t){var r=i(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===z)return r[n]}function $(e,t){var r=function(e,t){var r=i(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===z)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}var H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const V={translationKey:"properties.modifier.movingAverage",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,r=e.layout;return w.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,r=e.expression,n=e.modifier,o=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!n)return r;var u=s;void 0===u&&(u=w.getNumDimensions({properties:o,layout:a}));var c=i(o,"qHyperCubeDef.qDimensions",[]),d=n.showExcludedValues&&n.nullSuppression,p=w.getExpressionWithExcludedComp({expression:r,modifier:n,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:d}),f=w.getNumStepComp(n,u),h=w.getAboveComp(n,u,p,f);if(n.nullSuppression)t=w.getRangeComp("RangeAvg",h);else{var m=w.getRangeComp("RangeSum",h),g=function(e,t){var r=w.getRowNoComp(e,t);if(!w.isFullRange(e)){var n=e.steps,o="number"!=typeof n||Number.isNaN(n)?6:n;return"RangeMin(".concat(o,", ").concat(r,")")}return r}(n,u);t="".concat(m," / ").concat(g)}var v=t;if(w.needDimension({modifier:n,properties:o,layout:a})){var y=w.getDimComp(c,1),b=w.getDimComp(c,0),x=w.getAggrComp(v,y,b);v=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return v},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat($(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat($(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat($(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat($(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var r=W(t,e);if(r){var n=r.steps;r.steps="number"!=typeof n||Number.isNaN(n)?6:Math.abs(n)}},show:function(t){var r=W(t,e);return r&&!r.fullRange}},showExcludedValues:{refFn:function(t){return"".concat($(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat($(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,r,n){var o=n.ext.support.modifiers;if(!Array.isArray(o)||-1===o.indexOf(z))return!1;var i=W(t,e);return i&&!i.disabled}};return r}};var B="timeSeriesDecomposition";function G(e,t){var r=i(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===B)return r[n]}function U(e,t){var r=function(e,t){var r=i(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===B)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}var Y={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const K={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,r=e.layout;return w.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,r=e.modifier,n=e.properties;return r?w.generateTSDExpression(r,t,n):t},extractInputExpression:w.extractInputExpression,initModifier:function(e,t){w.initModifier(e,Y),""===e.decomposition&&t&&(e.decomposition=w.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!w.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,r){var n=G(t,e);if(n){var o=n.steps;n.steps="number"!=typeof o||Number.isNaN(o)?2:Math.abs(o),r.properties.qHyperCubeDef.qMeasures=r.properties.qHyperCubeDef.qMeasures.map(function(e){return e.qDef.modifiers.map(function(e){return"timeSeriesDecomposition"===e.type?e.steps=o:e.steps=e.steps,e}),e})}},show:function(t){var r=G(t,e);return r&&!r.fullRange}}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,r,n){var o=n.ext.support.modifiers;if(!Array.isArray(o)||-1===o.indexOf(B))return!1;var i=G(t,e);return i&&!i.disabled}};return r}};var X="difference";function J(e,t){var r=i(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===X)return r[n]}function Z(e,t){var r=function(e,t){var r=i(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===X)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,r=e.layout;return w.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,r=e.modifier,n=e.properties,o=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!r)return t;var l=a;void 0===l&&(l=w.getNumDimensions({properties:n,layout:o}));var u=i(n,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:r,dimensions:u,dimensionAndFieldList:s}),d=w.getAboveComp(r,l,c),p="".concat(c," - ").concat(d);if(w.needDimension({modifier:r,properties:n,layout:o})){var f=w.getDimComp(u,1),h=w.getDimComp(u,0),m=w.getAggrComp(p,f,h);p=r.showExcludedValues?w.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return p},initModifier:function(e){Object.keys(Q).forEach(function(t){void 0===e[t]&&(e[t]=Q[t])})},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!w.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 w.isApplicable({properties:t.properties})}}},show:function(t,r,n){var o=n.ext.support.modifiers;if(!Array.isArray(o)||-1===o.indexOf(X))return!1;var i=J(t,e);return i&&!i.disabled}};return r}};var te="normalization";function re(e,t){var r=i(e,t);if(r)for(var n=0;n<r.length;n++)if(r[n].type===te)return r[n]}function ne(e,t){var r=function(e,t){var r=i(e,t);if(!r)return-1;for(var n=0;n<r.length;n++)if(r[n].type===te)return n;return-1}(e,t);return r>-1?"".concat(t,".").concat(r):t}function oe(e,t){for(var r=0;r<e.length;r++)if(e[r].value===t)return r;return-1}var ie={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,r){return 1===e?"{$<".concat(w.getFieldWithWrapper(t),"={'").concat(r,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ue(e,t,r){return 0===e&&t>1?"<".concat(w.getDimDefWithWrapper(r),">"):""}const ce={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,r=e.layout;return w.isApplicable({properties:t,layout:r,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,r=e.modifier,n=e.properties,o=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!r)return t;var l=a;void 0===l&&(l=w.getNumDimensions({properties:n,layout:o}));var u=i(n,"qHyperCubeDef.qDimensions",[]),c=w.getExpressionWithExcludedComp({expression:t,modifier:r,dimensions:u,dimensionAndFieldList:s}),d=r.selectionScope,p=r.dimensionalScope;return function(e,t,r,n,o,i,a){var s=ae(t),l=se(t,r,n),u=""===s&&""===l?"":s||l,c=le(o,i),d=ue(o,i,a),p=function(e){for(var t=[],r=0;r<e;r++)t[r]=w.getDimDefWithWrapper(r);return t.join(", ")}(i);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(d," Aggr(").concat(u," ").concat(e,", ").concat(p,"))")}(c,d,r.field,r.value,p,l,r.primaryDimension)},initModifier:function(e){Object.keys(ie).forEach(function(t){void 0===e[t]&&(e[t]=ie[t])})},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(ne(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(r){return function(e,t,r){var n=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return n=function(e,t){if(1===e){var r=oe(t,0);t.splice(r,1)}return t}(re(e,r).dimensionalScope,n),n}(r,t,e)}},field:{refFn:function(t){return"".concat(ne(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,r){return r.app.getFieldList().then(function(e){return e.map(function(e){return{label:e.qName,value:e.qName}})})},show:function(t){return 1===re(t,e).selectionScope}},value:{refFn:function(t){return"".concat(ne(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===re(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(ne(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(r,n){return function(e,t,r,n){var o=t.layout.qHyperCube.qDimensionInfo.length,i=[{value:0,translation:r.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:r.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:r.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===o?"respectAllDimensions":"respectDimension"),tooltipTranslation:r.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===o?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:r.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===o?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:r.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===o?"disregardAllDimensions":"disregardDimension",".tooltip")}];return i=function(e,t){if(e<2){var r=oe(t,0);t.splice(r,1)}return t}(o,i),i=function(e,t){if(0===e){var r=oe(t,1);t.splice(r,1)}return t}(re(e,n).selectionScope,i),i}(r,n,t,e)}},primaryDimension:{refFn:function(t){return"".concat(ne(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(t,r){return 0===(re(t,e).dimensionalScope||0)&&r.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,r,n){var o=n.ext.support.modifiers;if(!Array.isArray(o)||-1===o.indexOf(te))return!1;var i=re(t,e);return i&&!i.disabled}};return r},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ue};var de="qDef.base",pe="qDef.qDef",fe="qDef.base.qDef",he="qLibraryId",me="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=i(e,fe);return void 0!==t?t:i(e,pe)},getExpressionRef:function(e){return void 0!==i(e,fe)?fe:pe},getLibraryIdRef:function(e){return i(e,me)?me:he},getLibraryId:function(e){return i(e,me)||i(e,he)},getLabelRef:function(e){return i(e,de)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return i(e,de)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ve="qDef.qDef",ye="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",Se="qDef.qLabel",we="qDef.qLabelExpression",Ce="qDef.base.qLabel",Ee="qDef.base.qLabelExpression",Ie="qDef.qAggrFunc",De="qDef.base.qAggrFunc",Pe={initBase:function(e,t){(t||Pe.isValid(e))&&(r(e,ye,i(e,ve)),r(e,xe,i(e,be)),r(e,Ce,i(e,Se)),r(e,Ee,i(e,we)))},restoreBase:function(e){Pe.isValid(e)&&(r(e,ve,i(e,ye)),r(e,be,i(e,xe)),r(e,Se,i(e,Ce)),r(e,we,i(e,Ee)),i(e,Ie)&&i(e,De)&&r(e,Ie,i(e,De)),delete e.qDef.base)},isValid:function(e){var t=i(e,ye),r=i(e,xe);return void 0!==t||void 0!==r}};const Re=Pe;function Me(e){return Me="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},Me(e)}var Le={accumulation:F,movingAverage:V,difference:ee,normalization:ce,timeSeriesDecomposition:K};const Ae={modifiers:Le,apply:Oe,applyModifiers:qe,cleanUpMeasure:Te,destroy:function(e){e&&ke[e.id]&&ke[e.id].masterItemSubscriber&&(ke[e.id].masterItemSubscriber&&ke[e.id].masterItemSubscriber.unsubscribe(),delete ke[e.id])},hasActiveModifiers:Ne,getActiveModifier:_e,initBase:Re.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Le[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,r=e.properties,n=e.layout;return Array.isArray(t)&&t.some(function(e){return Le[e]&&Le[e].isApplicable({properties:r,layout:n})})},measureBase:ge,limitedSorting:function(e){var t=e.measures,r=e.properties,n=e.layout,o=!1,i=!1;return t.forEach(function(e){var t=ze(e);Ue({modifiers:t,properties:r,layout:n})&&(o=!0,i=i||Ze({modifiers:t,properties:r,layout:n}))}),o&&!i},ifEnableTotalsFunction:je};var ke={};function Oe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.model,n=e.properties,o=e.isSnapshot,a=void 0!==o&&o,s=e.masterItem,l=!1;ke[r.id]=ke[r.id]||{isFirstTime:!0};var u=ke[r.id].isFirstTime;if(ke[r.id].isFirstTime=!1,n&&"object"===Me(n))return qe({model:r,properties:n});var c=r?r.layout:void 0,d=i(c,"qSelectionInfo.qInSelections");if(a||d)return Promise.resolve(l);var p=i(c,"qHyperCube.qMeasureInfo"),f=ke[r.id].lastReloadTime;if(ke[r.id].lastReloadTime=i(r,"app.layout.qLastReloadTime"),Ne({measures:p,layout:c})){var h=function(e){var t=e.measures,r=e.layout,n=e.lastReloadTime;return i(e.model,"app.layout.qLastReloadTime")!==n&&function(e){var t=e.measures,r=e.properties,n=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ge({measure:e,properties:r,layout:n})})}({measures:t,layout:r})}({measures:p,layout:c,model:r,lastReloadTime:f});return h||function(e){var t=e.measures,r=e.layout,n=e.masterItem,o=e.isFirstTime;return!!Array.isArray(t)&&(o||n||t.some(function(e){return function(e){var t=e.measure,r=e.layout;return Ue({modifiers:ze(t),layout:r})?!t.base:!!t.base}({measure:e,layout:r})}))}({measures:p,layout:c,masterItem:s,isFirstTime:u})?r.getEffectiveProperties().then(function(e){var n=t()(!0,{},e);$e(n);var o=Qe(n);return Ye({model:r}).then(function(t){return Ke({libraryIds:o,model:r}).then(function(o){return h&&function(e){var t=e.properties;Fe(t).forEach(function(e){return function(e){var t=e.measure;if(Ge({measure:t,properties:e.properties})){var r=0,n=t.qDef.modifiers;Array.isArray(n)&&n.forEach(function(e){if("object"===Me(e)&&!e.disabled){if(r++,"object"!==Me(Le[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(r>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var n=Le[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==n&&Ve(t)&&w.simplifyExpression(t.qDef.base.qDef)!==w.simplifyExpression(n)&&(t.qDef.base.qDef=n)}})}}({measure:e,properties:t})})}({properties:n}),qe({model:r,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:o,dimensionAndFieldList:t})})})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===Me(e.base)})}(p)?r.getEffectiveProperties().then(function(e){return function(e){var r=e.model,n=e.properties,o=Qe(n);return et({model:r,libraryIds:o}).then(function(){var e=t()(!0,{},n);return Fe(n).forEach(function(e){return Te(e)}),Je({oldProperties:e,newProperties:n,model:r})})}({model:r,properties:e})}):Promise.resolve(l)}function qe(e){var r=e.model,n=e.oldProperties,o=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===n&&(n=l?t()(!0,{},o):o),$e(o);var p=Qe(o);return et({model:r,libraryIds:p,masterItem:u}).then(function(){return function(e){var r=e.measures,n=e.properties,o=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(r||(r=Fe(n)),!r.length)return Promise.resolve();if(!Ne({measures:r,properties:n}))return r.forEach(function(e){return Te(e)}),Promise.resolve();var l=a?void 0:Qe(n);return Ye({model:o,dimensionAndFieldList:s}).then(function(e){return Ke({libraryIds:l,model:o,libraryItemsProps:a}).then(function(o){r.forEach(function(r){Ue({modifiers:r.qDef.modifiers,properties:n})?(function(e){var r=e.measure,n=e.properties,o=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;Re.isValid(r)||Re.initBase(r,!0);var l=r.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach(function(e){if("object"===Me(e)&&!e.disabled){if(s++,"object"!==Me(Le[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Le[e.type].initModifier(e,r);var l=r.qLibraryId||c&&c.qLibraryId;l?function(e){var r=e.measure,n=e.modifier,o=e.properties,i=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Le[n.type].generateExpression({expression:s,modifier:n,properties:o,dimensionAndFieldList:i});n.outputExpression=l,r.qDef.qDef=n.outputExpression,(r.qDef.qLabel||a.qMeasure.qLabel)&&(r.qDef.qLabel=a.qMeasure.qLabel),(r.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(r.qDef.qLabelExpression=a.qMeasure.qLabelExpression),r.qDef.quarantine&&r.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(r.qDef.qNumFormat=a.qMeasure.qNumFormat,r.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete r.qLibraryId,r.qDef.coloring=a.qMeasure.coloring,n.base=t()(!0,{},r.qDef.base)}({measure:r,modifier:e,libraryId:l,properties:n,libraryItemsProps:o,dimensionAndFieldList:a}):function(e){var r=e.measure,n=e.modifier,o=e.properties,i=e.dimensionAndFieldList;"function"==typeof Le[n.type].updateModifier&&Le[n.type].updateModifier(n,o.qHyperCubeDef);var a=ge.getExpression(r),s=""===a?a:Le[n.type].generateExpression({expression:a,modifier:n,properties:o,dimensionAndFieldList:i});n.outputExpression=s,r.qDef.qDef=n.outputExpression,r.qDef.base.qLabelExpression?r.qDef.qLabelExpression=r.qDef.base.qLabelExpression:r.qDef.qLabel=r.qDef.base.qLabel||a,n.base=t()(!0,{},r.qDef.base)}({measure:r,modifier:e,properties:n,dimensionAndFieldList:a}),function(e){var t=i(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")}(r)}})}({measure:r,properties:n,libraryItemsProps:o,dimensionAndFieldList:e}),He(r)):Te(r)})})})}({measures:a,properties:o,model:r,libraryItemsProps:c,dimensionAndFieldList:d}).then(function(){return l?Je({oldProperties:n,newProperties:o,model:r}):Promise.resolve(!1)})})}function Te(e){!function(e){var t=ze(e);return Array.isArray(t)&&t.some(function(e){return"object"===Me(e)&&!e.disabled&&!Le[e.type]})}(e)?Re.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,He(e)}function Ne(e){var t=e.measures,r=e.properties,n=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ue({modifiers:ze(e),properties:r,layout:n})})}function _e(e){var t=ze(e);if(Array.isArray(t))for(var r=0;r<t.length;r++){var n=t[r];if(Le[n.type]&&!n.disabled)return n}}function je(e){var t=_e(e);return!t||Le[t.type].enableTotalsFunction(e)}function Fe(e){return i(e,"qHyperCubeDef.qMeasures",[]).concat(i(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function ze(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function We(e){return i(e,"outputExpression.qValueExpression.qExpr")||i(e,"outputExpression")}function $e(e){Fe(e).forEach(function(e){return function(e){var r=_e(e);r&&(void 0!==r.outputExpression&&We(r)!==e.qDef.qDef?delete e.qDef.base:!Re.isValid(e)&&r.base&&(e.qDef.base=t()(!0,{},r.base)))}(e)})}function He(e){var t=ze(e);Array.isArray(t)&&t.forEach(function(t){"object"===Me(t)&&(t.disabled||!Le[t.type]&&We(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function Ve(e){return e.base||e.qDef&&e.qDef.base}function Be(e){var t=Ve(e);return e.qLibraryId||t&&t.qLibraryId}function Ge(e){var t=e.measure,r=e.properties,n=e.layout;return!Be(t)&&Ue({modifiers:ze(t),properties:r,layout:n})}function Ue(e){var t=e.modifiers,r=e.properties,n=e.layout,o={};return Array.isArray(t)&&t.some(function(e){return!("object"!==Me(e)||e.disabled||!Le[e.type])&&(void 0===o[e.type]&&(o[e.type]=Le[e.type].isApplicable({properties:r,layout:n})),o[e.type])})}function Ye(e){var t=e.model,r=e.dimensionAndFieldList;if(r)return Promise.resolve(r);var n=[],o={},i=t.app.getDimensionList().then(function(e){o.dimensionList=e});n.push(i);var a=t.app.getFieldList().then(function(e){o.fieldList=e});return n.push(a),Promise.all(n).then(function(){return o})}function Ke(e){var t=e.libraryIds,r=e.model,n=e.libraryItemsProps;if(n)return Promise.resolve(n);var o=t.measureLibraryIds,i=t.dimensionLibraryIds,a={},s=[];return o.forEach(function(e){var t=r.app.getMeasure(e).then(function(t){return t.getProperties().then(function(t){a[e]=t})});s.push(t)}),i.forEach(function(e){var t=r.app.getDimension(e).then(function(t){return t.getProperties().then(function(t){a[e]=t})});s.push(t)}),Promise.all(s).then(function(){return a})}function Xe(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,r=e.newProperties,n=e.model,o=JSON.stringify(i(t,"qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(i(r,"qHyperCubeDef.qMeasures"),Xe)||JSON.stringify(i(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(i(r,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe);return o?function(e){var t=e.model,r=e.oldProperties,n=e.newProperties,o=t.layout;return o&&!o.qHasSoftPatches&&!o.qExtendsId&&i(o,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(n):q(t,r,n)}({model:n,oldProperties:t,newProperties:r}).then(function(){return o}):Promise.resolve(o)}function Ze(e){var t=e.modifiers,r=e.properties,n=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===Me(e)&&!e.disabled&&Le[e.type]&&Le[e.type].needDimension({modifier:e,properties:r,layout:n})})}function Qe(e){var t=Fe(e),r=[],n=[],o=!1;return t.forEach(function(t){var n=ze(t);if(Ue({modifiers:n,properties:e})){var i=Be(t);i&&r.push(i),o=o||Ze({modifiers:n,properties:e})}}),i(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&n.push(t)}),{measureLibraryIds:r,dimensionLibraryIds:n}}function et(e){var t=e.model,r=e.libraryIds;return!e.masterItem&&r&&(r.measureLibraryIds.length||r.dimensionLibraryIds.length)?(ke[t.id].masterItemSubscriber=ke[t.id].masterItemSubscriber||function(e){var t=e.model,r=e.callback,n={},o={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},r=i(e,"qInfo.qType");return r&&s[r]&&s[r].forEach(function(r){t[r]=i(e,r)}),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(n[t]){var o=l(e);n[t].properties!==o&&(n[t].properties=o,"function"==typeof r&&n[t].enabled&&r(e)),n[t].enabled=!0}}function c(e,r){return t.app[r](e).then(function(t){n[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}})}return{subscribe:function(e){var r=e.measureLibraryIds,i=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;o={},e.measureLibraryIds.forEach(function(e){o[e]=!0}),a={},t.forEach(function(e){a[e]=!0})}({measureLibraryIds:r,dimensionLibraryIds:i}),Object.keys(n).forEach(function(e){o[e]||a[e]||(n[e].listener.dispose(),delete n[e])}),t.app&&(Object.keys(o).forEach(function(e){o[e]&&!n[e]&&s.push(c(e,"getMeasure"))}),Object.keys(a).forEach(function(e){a[e]&&!n[e]&&s.push(c(e,"getDimension"))})),Promise.all(s)},unsubscribe:function(){Object.keys(n).forEach(function(e){n[e].listener.dispose()}),n={}}}}({model:t,callback:function(e){return Oe({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),ke[t.id].masterItemSubscriber.subscribe(r)):Promise.resolve()}})(),t.default=o.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};return(()=>{function e(t){var r,n=t;return n>9?(r=65+n-10)>90&&(r+=6):n="".concat(n).charCodeAt(0),[48,111,79,105,73,108].indexOf(r)>-1?e(n+1):String.fromCharCode(r)}function t(r){var n=e(r%62),o=Math.floor(r/62);return o>0?t(o)+n:n}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}r.d(n,{default:()=>$e});const i={getValue:function(e,t,r){if(null==e||null==t)return r;for(var n=t.split("."),o=e,i=0;i<n.length;++i){var a=n[i];if(""!==a){if(void 0===o[a]||null===o[a])return r;o=o[a]}}return o},setValue:function(e,t,r){if(null!=e&&null!=t){for(var n=t.split("."),o=n[n.length-1],i=e,a=0;a<n.length-1;++a){var s=n[a];void 0!==i[s]&&null!==i[s]||(i[s]=Number.isNaN(+n[a+1])?{}:[]),i=i[s]}void 0!==r?i[o]=r:delete i[o]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(o(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t,r){if(e){for(var n=0;n<e.length;n++)if(e[n][t]===r)return n;return-1}return-1}const d={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var r=e.indexOf(t[0]);if(-1!==r){for(var n=0;n<t.length;n++){var o=e.indexOf(t[n]);if(r>o)return!1;r=o}return!0}return!1},indexAdded:function(e,t){var r;for(r=0;r<e.length;++r)e[r]>=0&&e[r]>=t&&++e[r];e.push(t)},indexRemoved:function(e,t){var r,n=0;for(r=0;r<e.length;++r)e[r]>t?--e[r]:e[r]===t&&(n=r);return e.splice(n,1),n},findItemByPropertyValue:function(e,t,r){if(e){for(var n=0;n<e.length;n++)if(e[n][t]===r)return e[n];return null}return null},findIndexByPropertyValue:c};var p=r(8),f=r.n(p);const h=function(e){var t,r=e.exportFormat,n=e.qHyperCubeDef,o=r.data[0];(t=o.dimensions).push.apply(t,a(n.qDimensions));var s,l=i.getValue(n,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=o.excludedDimensions).push.apply(s,a(l))},m=function(e){var t,r=e.exportFormat,n=e.qHyperCubeDef,o=r.data[0];(t=o.measures).push.apply(t,l(n.qMeasures));var a,s=i.getValue(n,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=o.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,r=e.qHyperCubeDef,n=t.data[0];r.qInterColumnSortOrder||(r.qInterColumnSortOrder=[]),n.interColumnSortOrder=r.qInterColumnSortOrder.concat();var o=i.getValue(r,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");o&&d.isOrderedSubset(o,n.interColumnSortOrder)&&(n.interColumnSortOrder=o.concat())},v=function(e){var t=e.exportFormat,r=e.properties;Object.keys(r).forEach(function(e){t.properties[e]=r[e]})},y=function(e){var t=e.exportFormat,r=e.properties;r.qLayoutExclude||(r.qLayoutExclude={}),r.qLayoutExclude.disabled&&(Object.keys(r.qLayoutExclude.disabled).forEach(function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=r.qLayoutExclude.disabled[e])}),delete r.qLayoutExclude.disabled),r.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach(function(t){e.qLayoutExclude.changed[t].to===i.getValue(e,t)&&i.setValue(e,t,e.qLayoutExclude.changed[t].from)})}(r),delete r.qLayoutExclude.changed),r.qLayoutExclude.quarantine&&!i.isEmpty(r.qLayoutExclude.quarantine)||delete r.qLayoutExclude},b=function(e){e.forEach(function(e){f().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)})};function x(e,t,r){var n,o,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=i.getValue(e,t);if(!i.isAtomicValue(s))try{if((o=(o=(n=JSON.stringify(s)).match(/:\{/g))?o.length:0)>2&&!a)return;s=JSON.parse(n)}catch(e){return}i.getValue(e,"qLayoutExclude.quarantine")||i.setValue(e,"qLayoutExclude.quarantine",{});var l=i.getValue(e,"qLayoutExclude.quarantine");l[r]||(l[r]={}),l[r][t]=s}var S=r(909),w=r.n(S);function C(e,t){var r=w()(!0,{},t,e);return i.getValue(r,"qOtherTotalSpec.qOtherCounted")||i.setValue(r,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),i.getValue(r,"qOtherTotalSpec.qOtherLimit")||i.setValue(r,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),r.hasOwnProperty("othersLabel")||(r.othersLabel="Others"),r}function E(e,t){return w()(!0,{},t,e)}function I(e,t,r){return"function"==typeof e?e(t):Number.isNaN(+e)?r:e}var D=Math.pow(2,53)-1;function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}const M=function(e,t,r){var n="masterobject"===i.getValue(t,"properties.qInfo.qType")?"masterobject":i.getValue(r,"qInfo.qType");i.setValue(e,"qInfo.qType",n),e.visualization=r.visualization},L=function(e,t,r){t.hasOwnProperty(e)&&(r[e]=t[e])},A=function(e,t,r,n){t.hasOwnProperty(e)?r[e]=t[e]:r[e]=n},k=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:[]}},q=function(e){var t,r=e.exportFormat,n=e.maxDimensions,o=e.minDimensions,i=e.newHyperCubeDef,a=e.defaultDimension,s=r.data[0];for(t=0;t<s.dimensions.length;++t){var l=C(s.dimensions[t],a);i.qDimensions.length<n?i.qDimensions.push(l):i.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var u=C(s.excludedDimensions[t],a);i.qDimensions.length<o?i.qDimensions.push(u):i.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},T=function(e){var t,r=e.exportFormat,n=e.maxMeasures,o=e.minMeasures,i=e.newHyperCubeDef,a=e.defaultMeasure,s=r.data[0];for(t=0;t<s.measures.length;++t){var l=E(s.measures[t],a);i.qMeasures.length<n?i.qMeasures.push(l):i.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var u=E(s.excludedMeasures[t],a);i.qMeasures.length<o?i.qMeasures.push(u):i.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},N=function(e){var t=e.exportFormat,r=e.dataDefinition,n=void 0===r?{}:r,o=t.data[0],i=n.dimensions||{max:0},a=n.measures||{max:0},s=I(a.max,o.dimensions.length,D),l=I(a.min,o.dimensions.length,0);return{maxDimensions:I(i.max,s,D),minDimensions:I(i.min,l,0),maxMeasures:s,minMeasures:l}},_=function(e){var t=e.exportFormat,r=e.newHyperCubeDef,n=t.data[0],o=r.qDimensions.length+r.qMeasures.length;r.qInterColumnSortOrder=n.interColumnSortOrder.concat();var i=r.qInterColumnSortOrder.length;if(i!==o)for(r.qLayoutExclude&&(r.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=n.interColumnSortOrder.concat());i!==o;)i<o?(d.indexAdded(r.qInterColumnSortOrder,i),++i):(--i,d.indexRemoved(r.qInterColumnSortOrder,i))},j=function(e){var t=e.exportFormat,r=e.initialProperties,n=e.hypercubePath,o={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach(function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(o.qLayoutExclude.quarantine=w()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&n?i.setValue(o,"".concat(n,".qHyperCubeDef"),t.properties.qHyperCubeDef):r.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some(function(e){return"general"===e.key})}(t.properties,e)?o[e]=t.properties[e]:o.qLayoutExclude.disabled[e]=t.properties[e]}),null===(o=w()(!0,{},r,o)).components&&(o.components=[]),o},F=function(e){var t=e.exportFormat,r=e.maxDimensions,n=e.minDimensions,o=e.maxMeasures,i=e.minMeasures,a=t.data[0];return a.dimensions.length>r&&r>0||a.measures.length>o&&o>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>n||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>i||!o&&a.measures.length>0||!r&&a.dimensions.length>0},z=function(e){var t=e.exportFormat,r=e.maxDimensions,n=e.minDimensions,o=e.maxMeasures,i=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>r&&r>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>n)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>o&&o>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>i)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!o&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!r&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},W=function(e){var t,r=e.newProperties,n=e.dataDefinition,o=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var a=i.getValue(r,o||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return P(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 P(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?P(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qDimensions=[],s.forEach(function(e){a.qDimensions.push(e),n.dimensions.added(e,r)})}},$=function(e){var t,r=e.newProperties,n=e.dataDefinition,o=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var a=i.getValue(r,o||"").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 r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?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),n.measures.added(e,r)})}},H=function(e){var t=e.measures,r=e.modifierTypes;t&&r&&f().isSupportedModifiers(r)&&t.forEach(function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store})};function V(e,t){var r=i.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!r&&(Object.keys(r).forEach(function(t){i.setValue(e,t,r[t])}),delete e.qLayoutExclude.quarantine[t],!0)}const B={exportProperties:function(e){var t=e.propertyTree,r=e.hypercubePath,n=e.viewDataMode,o=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},r=0;r<e;++r)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=i.getValue(a,r||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),h({exportFormat:o,qHyperCubeDef:l}),m({exportFormat:o,qHyperCubeDef:l}),g({exportFormat:o,qHyperCubeDef:l}),delete l.qLayoutExclude,v({exportFormat:o,properties:a}),r&&(o.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),y({exportFormat:o,properties:a}),n||b(o.properties.qHyperCubeDef.qMeasures),Array.isArray(o.properties.filters)&&(x(o.properties,"filters","storedFilters",!0),delete o.properties.filters),o.properties.qHyperCubeDef.qContextSetExpression&&(x(o.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),o.properties.qHyperCubeDef.qContextSetExpression=""),o.properties.qHyperCubeDef.qDynamicScript&&o.properties.qHyperCubeDef.qDynamicScript.length&&(x(o.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),o.properties.qHyperCubeDef.qDynamicScript=[]),o},importProperties:function(e){var t=e.exportFormat,r=e.initialProperties,n=void 0===r?{}:r,o=e.dataDefinition,a=void 0===o?{}:o,s=e.defaultPropertyValues,l=void 0===s?{}:s,u=e.hypercubePath,c=e.extension,d=e.supportedFilters,p=void 0===d||d,f=e.isHCModifierSupported,h=void 0===f||f,m={qChildren:[]},g=j({exportFormat:t,initialProperties:n,hypercubePath:u}),v=i.getValue(n,u||"").qHyperCubeDef,y=i.getValue(g,u||"").qHyperCubeDef,b=N({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,S=b.minDimensions,w=b.maxMeasures,C=b.minMeasures,E=l.defaultDimension,I=void 0===E?k():E,D=l.defaultMeasure,P=void 0===D?O():D;y.qDimensions.length=0,y.qMeasures.length=0,F({exportFormat:t,maxDimensions:x,minDimensions:S,maxMeasures:w,minMeasures:C})&&z({exportFormat:t,maxDimensions:x,minDimensions:S,maxMeasures:w,minMeasures:C,newHyperCubeDef:y}),q({exportFormat:t,maxDimensions:x,minDimensions:S,newHyperCubeDef:y,defaultDimension:I}),T({exportFormat:t,maxMeasures:w,minMeasures:C,newHyperCubeDef:y,defaultMeasure:P}),W({newProperties:g,dataDefinition:a,hypercubePath:u}),$({newProperties:g,dataDefinition:a,hypercubePath:u}),_({exportFormat:t,newHyperCubeDef:y}),L("qMaxStackedCells",v,y),L("qNoOfLeftDims",v,y),A("qInitialDataFetch",v,y,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),A("qMode",v,y,"S"),A("qReductionMode",v,y,"N"),A("qSortbyYValue",v,y),A("qIndentMode",v,y),A("qShowTotalsAbove",v,y),M(g,t,n),m.qProperty=g;var R=i.getValue(c||{},"support.modifiers");return H({measures:y.qMeasures,modifierTypes:R}),p&&V(m.qProperty,"storedFilters"),"S"===y.qMode&&h&&V(m.qProperty,"dynamicScript"),m}};var G={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function U(e,t,r,n){t=t||[];var o=c(e,n,r),i=c(t,n,r);if(-1!==o&&-1===i){var a=e.splice(o,1);t.push(a[0])}return t}function 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 r={};return t&&Object.keys(t).forEach(function(e){r[e]=t[e]}),r.id=e,r.qAttribute=!0,r},moveByIdFromGroup:function(e,t,r,n,o){r=r||"qAttributeExpressions",o=o||"id";for(var i=0;i<e.length;i++){var a=e[i][r],s=t.length;if(U(a,t,n,o),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 i.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return i.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},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,r){if(Array.isArray(e[t])){var n=d.findIndexByPropertyValue(e[t],"id",r);n>=0&&e[t].splice(n,1)}else e[t]=[]}function te(e,t){var r=K.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach(function(e){ee(e,"qAttributeDimensions",r),ee(e,"qAttributeExpressions",r)}),t.forEach(function(e){ee(e,"qAttributeDimensions",r),ee(e,"qAttributeExpressions",r)})}function re(e,t){if(t){var r="="===t.charAt(0);e.color.altLabel=r?{qStringExpression:{qExpr:t.substr(1)}}:t}}function ne(e){var t=e.properties,r=e.isDimension,n=e.dimensions,o=e.excludedDimensions,a=e.measures,s=e.label;te(n,o);var l=n[n.length-1];if(l){var u=r?i.getValue(t,"color.byDimDef"):i.getValue(t,"color.byMeasureDef"),c=i.getValue(t,"color.formatting.qNumFormat"),p=i.getValue(t,"color.formatting.isCustomFormatted");if(u){var f=K.create(K.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,r=e.label,n=e.item,o=e.isDimension,i=e.qNumFormat,a=e.isCustomFormatted;t.label=r||n.label,o?t.qDef=n.key:(t.qExpression=n.key,i&&(t.qNumFormat=i,t.isCustomFormatted=a)),t.matchMeasure=n.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:s,item:u,isDimension:r,qNumFormat:c,isCustomFormatted:p});break;case"libraryItem":!function(e){var t=e.attributeExpression,r=e.measures,n=e.item,o=e.qNumFormat,i=e.isCustomFormatted;e.isDimension||(t.matchMeasure=d.findIndexByPropertyValue(r,"qLibraryId",n.key),o&&(t.qNumFormat=o,t.isCustomFormatted=i)),void 0!==n.expression?t.qExpression=n.expression:t.qLibraryId=n.key,t.colorMapRef=n.key}({attributeExpression:f,measures:a,item:u,isDimension:r,qNumFormat:c,isCustomFormatted:p})}r?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function oe(e,t,r,n){var o,i,a,s={};switch(e){case"dimension":r.qLibraryId?(s.type="dimension",s.name=r.qLibraryId,s.id=r.qLibraryId):(s.type="field",t?(s.name=r.label||r.qDef,s.id=r.qDef):(s.name=r.qDef.qFieldDefs[0],s.label=(a=r.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":o=function(e,t){return t?e.qLibraryId:f().measureBase.getLibraryId(e)}(r,t),o?(s.type="measure",s.name=o,s.id=o,i=function(e,t){return f().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(r,n),i&&(s.expression=i)):(s.type="expression",t?(s.name=r.label||r.qExpression,s.id=r.qExpression):(s.name=r.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(r)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}const ie={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,r,n){var o=t.type,i=e.color,a=i.mode,s=X.getItemLabel(t);switch(re(e,s||""),o){case"field":a="byDimension",i.byDimDef={label:t.label||X.wrapFieldName(t.name),key:X.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",i.byMeasureDef={label:s,key:t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",i.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",i.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},i.formatting&&ie.useMasterNumberFormat(i.formatting)}i.auto=!1,i.mode=a}function se(e,t){var r=i.getValue(e,"".concat(t,"qDimensions"),[]),n=i.getValue(e,"".concat(t,"qMeasures"),[]),o=i.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=i.getValue(e,"color.byDimDef");if(a&&re(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var r=i.getValue(e,"".concat(t,"qDimensions"),[]),n=i.getValue(e,"color.byDimDef");n.activeDimensionIndex=Math.min(n.activeDimensionIndex,r.length-1);var o=oe("dimension",!1,r[n.activeDimensionIndex]);o.activeDimensionIndex=n.activeDimensionIndex,ae(e,o)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var r=i.getValue(e,"".concat(t,"qDimensions"),[]),n=r[function(e,t,r){var n=i.getValue(t,"visualization"),o=r.split("."),a=Number(o[1]),s=i.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===n&&"point"===s}(r,e,t)?0:r.length-1],o=K.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(n.qAttributeDimensions,"id",o);return ae(e,oe("dimension",!!a,a||n)),!!a}(e,t))return;ne({properties:e,isDimension:!0,dimensions:r,excludedDimensions:o,measures:n,label:i.getValue(e,"color.byDimDef.label")})}const le=function(e,t,r){i.setValue(e,t,r),i.isAtomicValue(r)&&function(e,t,r){var n=e.qLayoutExclude;n&&(n.changed||(n.changed={}),n.changed[t]={from:i.getValue(e,t),to:r})}(e,t,r)},ue=function(e,t){var r={primary:!0};if(e){var n=(Q[t]||J).colorModeOptions||J.colorModeOptions;r.byDimension=n.dimension(e),r.byMeasure=n.measure(e),r.byMultiple=n.multiColor(e),r.byExpression=n.expression(e)}return r},ce=function(e){var t=e.canColorBy,r=e.autoColor,n=e.colorMode,o=e.dimensions;return!(t[n]&&!r&&("byDimension"!==n&&"byMeasure"!==n||!o.length))},de=function(e,t){var r,n=i.getValue(e,"color.mode"),o=i.getValue(e,"color.auto"),a=i.getValue(e,"".concat(t,"qDimensions"),[]),s=i.getValue(e,"".concat(t,"qMeasures"),[]),l=i.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);o?te(a,l):!(r={auto:o,colorMode:n,dimensions:a}).auto&&"byDimension"===r.colorMode&&r.dimensions.length>0?se(e,t):function(e){var t=e.auto,r=e.colorMode,n=e.dimensions,o=e.measures,a=e.properties,s=i.getValue(a,"visualization");return!(t||"byMeasure"!==r||!n.length||"map"!==s&&!o.length)}({auto:o,colorMode:n,dimensions:a,measures:s,properties:e})?function(e,t){var r=i.getValue(e,"".concat(t,"qDimensions"),[]),n=i.getValue(e,"".concat(t,"qMeasures"),[]),o=i.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=i.getValue(e,"color.byMeasureDef");if(a&&re(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var r=i.getValue(e,"".concat(t,"qMeasures"),[]),n=i.getValue(e,"color.byMeasureDef");if(n.activeMeasureIndex=Math.min(n.activeMeasureIndex,r.length-1),n.activeMeasureIndex>-1){var o=oe("measure",!1,r[n.activeMeasureIndex],!0);o.activeMeasureIndex=n.activeMeasureIndex,ae(e,o)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,n)&&function(e,t){var r=i.getValue(e,"".concat(t,"qDimensions"),[]),n=i.getValue(e,"".concat(t,"qMeasures"),[]),o=r[r.length-1],a=K.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(o.qAttributeExpressions,"id",a);return ae(e,oe("measure",!!s,s||n[0])),!!s}(e,t))return;ne({properties:e,isDimension:!1,dimensions:r,excludedDimensions:o,measures:n,label:i.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var r=i.getValue(e,"color.mode"),n=i.getValue(e,"".concat(t,"qDimensions"),[]),o=i.getValue(e,"".concat(t,"qMeasures"),[]),a=i.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===r&&o.length<2&&i.setValue(e,"color.mode","primary"),te(n,a)}(e,t)},pe=function(e){e.forEach(function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode})},fe=function(e){var t=e.shouldUpdateColorBy,r=e.properties,n=i.getValue(r,"qHyperCubeDef.qMeasures",[]),o=i.getValue(r,"color.mode","");return!t&&"byExpression"===o&&n.length>0},he=function(e){var t=i.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),r=i.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:r,id:"colorByExpression"}),i.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},me=function(e){i.setValue(e,"color.mode","primary"),i.setValue(e,"color.auto",!0)},ge=function(e){var t=i.getValue(e,"qHyperCubeDef.qDimensions",[]),r=i.getValue(e,"color.persistent",!1);return t.length>1&&!r},ve={exportProperties:function(e){var t=e.propertyTree,r=e.hypercubePath,n=e.viewDataMode,o=B.exportProperties({propertyTree:t,hypercubePath:r,viewDataMode:n}),i=o.data[0],a=i.dimensions.concat(i.excludedDimensions),s=i.measures.concat(i.excludedMeasures),l=K.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return K.moveByIdFromGroup(a,[],"qAttributeDimensions",u),K.moveByIdFromGroup(a,[],"qAttributeExpressions",u),K.moveByIdFromGroup(s,[],"qAttributeExpressions",c),o},importProperties:function(e){var t=e.exportFormat,r=e.initialProperties,n=e.dataDefinition,o=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=B.importProperties({exportFormat:t,initialProperties:r,dataDefinition:n,defaultPropertyValues:o,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty,p=i.getValue(d,"visualization"),f=i.getValue(d,"qHyperCubeDef.qDimensions",[]),h=i.getValue(d,"color.mode",""),m=i.getValue(d,"color.auto",""),g=ue(d,p),v=ce({canColorBy:g,autoColor:m,colorMode:h,dimensions:f});return g[h]?fe({shouldUpdateColorBy:v,properties:d})&&he(d):me(d),v&&de(d,"qHyperCubeDef."),ge(d)&&le(d,"color.persistent",!0),pe(f),c}};var ye=["bar","marker","line"];const be=function(e){var t=e.initialProperties,r=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?V(r,"unsupportedAutoMinMax")||w()(r.measureAxis,t.measureAxis):V(r,"supportedAutoMinMax")||w()(r.measureAxis,t.measureAxis)},xe=function(e){var t,r=e.exportFormat,n=e.initialProperties,o=e.properties,i=e.measureType,a=o.qHyperCubeDef,s=o.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:r,initialProperties:n})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach(function(e){if(e.qDef.series){var r=e.qDef.series,n=r.type,o=r.axis;t[o]||(t[o]={axis:o,type:{line:0,marker:0,bar:0,total:0}}),ye.includes(n)&&t[o].type[n]++,t[o].type.total++}}),t}(a);l.length?(i&&(t=l.filter(function(e){return e.type[i]>0}).sort(function(e,t){return t.type[i]-e.type[i]})),t&&t.length||(t=l.sort(function(e,t){return t.type.total-e.type.total})),t&&t[0]&&w()(s,r.properties.measureAxes[t[0].axis])):w()(s,r.properties.measureAxes[0])}},Se=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var r=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=r}}},we={exportProperties:function(e){var t=e.propertyTree,r=e.hypercubePath,n=e.viewDataMode,o=e.supportedAutoMinMax,i=void 0===o||o,a=ve.exportProperties({propertyTree:t,hypercubePath:r,viewDataMode:n}),s=a.properties;return i?(x(s,"measureAxis.min","supportedAutoMinMax"),x(s,"measureAxis.max","supportedAutoMinMax")):(x(s,"measureAxis.min","unsupportedAutoMinMax"),x(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,r=e.initialProperties,n=e.dataDefinition,o=e.defaultPropertyValues,i=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=ve.importProperties({exportFormat:t,initialProperties:r,dataDefinition:n,defaultPropertyValues:o,hypercubePath:i,extension:s,supportedFilters:l,isHCModifierSupported:u}),d=c.qProperty;return be({initialProperties:r,properties:d}),xe({exportFormat:t,initialProperties:r,properties:d,measureType:a}),Se(d.qHyperCubeDef),d.qHyperCubeDef.qColumnOrder=[],d.qHyperCubeDef.columnOrder=[],c}};function Ce(e,t,r){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(r)}function Ee(e){var t=e.properties,r=e.arrayPath,n=e.quarantineName,o=e.arrayName,a=e.itemPath;i.getValue(t,r,[]).forEach(function(e){return function(e){var t=e.properties,r=e.quarantineName,n=e.arrayName,o=e.item,a=e.itemPath,s=i.getValue(o,a);if(void 0!==s){var l=i.getValue(o,"qDef.cId");l||(l=i.generateId(),i.setValue(o,"qDef.cId",l));var u=Ce(r,n,l);i.setValue(t,u,s),i.setValue(o,a,void 0)}}({properties:t,quarantineName:n,arrayName:o,item:e,itemPath:a})})}function Ie(e){var t=e.properties,r=e.arrayPath,n=e.quarantineName,o=e.arrayName,a=e.itemPath;i.getValue(t,r,[]).forEach(function(e){return function(e){var t=e.properties,r=e.quarantineName,n=e.arrayName,o=e.item,a=e.itemPath,s=i.getValue(o,"qDef.cId");if(s){var l=Ce(r,n,s),u=i.getValue(t,l);void 0!==u&&(i.setValue(o,a,u),i.setValue(t,l,void 0))}}({properties:t,quarantineName:n,arrayName:o,item:e,itemPath:a})})}var De="qHyperCubeDef.qMeasures",Pe="conditionalColoring",Re="measures",Me="qDef.conditionalColoring";const Le={quarantine:function(e){Ee({properties:e,arrayPath:De,quarantineName:Pe,arrayName:Re,itemPath:Me})},unquarantine:function(e){Ie({properties:e,arrayPath:De,itemPath:Me,arrayName:Re,quarantineName:Pe})}};var Ae="qHyperCubeDef.qMeasures",ke="measures",Oe="qHyperCubeDef.qDimensions",qe="dimensions",Te="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Ne="alternativeMeasures",_e="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",je="alternativeDimensions",Fe="qCalcCondition",ze="conditionalShowHide";const We={quarantine:function(e){Ee({properties:e,arrayPath:Ae,quarantineName:ze,arrayName:ke,itemPath:Fe}),Ee({properties:e,arrayPath:Oe,quarantineName:ze,arrayName:qe,itemPath:Fe})},unquarantine:function(e){Ie({properties:e,arrayPath:Ae,quarantineName:ze,arrayName:ke,itemPath:Fe}),Ie({properties:e,arrayPath:Oe,quarantineName:ze,arrayName:qe,itemPath:Fe})},quarantineAlternative:function(e){Ee({properties:e,arrayPath:Te,quarantineName:ze,arrayName:Ne,itemPath:Fe}),Ee({properties:e,arrayPath:_e,quarantineName:ze,arrayName:je,itemPath:Fe})},unquarantineAlternative:function(e){Ie({properties:e,arrayPath:Te,quarantineName:ze,arrayName:Ne,itemPath:Fe}),Ie({properties:e,arrayPath:_e,quarantineName:ze,arrayName:je,itemPath:Fe})}},$e={hypercube:B,colorChart:ve,axisChart:we,quarantineProperty:x,unquarantineProperty:V,quarantineArrayProp:Ee,unquarantineArrayProp:Ie,conditionalColoring:Le,conditionalShow:We}})(),n.default})()}(QN);var e_=En(QN.exports);const t_="qHyperCubeDef.qMeasures",r_="measures",n_="qHyperCubeDef.qDimensions",o_="dimensions",i_="qDef.representation",a_="tableRepresentation",s_="qDef.conditionalColoring",l_="conditionalColoring",u_="qMiniChartDef",c_="miniChartDef",d_=e=>{e_.unquarantineArrayProp({properties:e,arrayPath:n_,itemPath:i_,arrayName:o_,quarantineName:a_}),e_.unquarantineArrayProp({properties:e,arrayPath:t_,itemPath:i_,arrayName:r_,quarantineName:a_}),e_.unquarantineArrayProp({properties:e,arrayPath:t_,itemPath:s_,arrayName:r_,quarantineName:l_}),e_.unquarantineArrayProp({properties:e,arrayPath:t_,itemPath:u_,arrayName:r_,quarantineName:c_})},p_=e=>{e_.quarantineArrayProp({properties:e,arrayPath:n_,itemPath:i_,arrayName:o_,quarantineName:a_}),e_.quarantineArrayProp({properties:e,arrayPath:t_,itemPath:i_,arrayName:r_,quarantineName:a_}),e_.quarantineArrayProp({properties:e,arrayPath:t_,itemPath:s_,arrayName:r_,quarantineName:l_}),e_.quarantineArrayProp({properties:e,arrayPath:t_,itemPath:u_,arrayName:r_,quarantineName:c_})};function f_(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 h_(e){if("object"==typeof e&&f_(e))return(e.r<<16)+(e.g<<8)+e.b;let t=0,r=0,n=0;if("string"==typeof e){let o;(o=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(e))?(t=parseInt(o[1],10),r=parseInt(o[2],10),n=parseInt(o[3],10)):(o=/^#([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})$/i.exec(e))?(t=parseInt(o[1],16),r=parseInt(o[2],16),n=parseInt(o[3],16)):(o=/^#([A-Fa-f0-9])([A-Fa-f0-9])([A-Fa-f0-9])$/i.exec(e))&&(t=parseInt(o[1]+o[1],16),r=parseInt(o[2]+o[2],16),n=parseInt(o[3]+o[3],16))}return(t<<16)+(r<<8)+n}const m_={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 g_(...e){const t={type:"qcm-color",r:0,g:0,b:0,a:1,invalid:!1,spaces:{}};let r=0,n=0,o=0,i=1;if(null!==(a=e[0])&&"object"==typeof a&&"type"in a&&"qcm-color"===a.type)({r:r,g:n,b:o,a:i}=e[0]),t.invalid=e[0].invalid,t.spaces={...e[0].spaces};else if(f_(e[0]))({r:r,g:n,b:o}=e[0]),"a"in e[0]&&({a:i}=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))r=parseInt(s[1],10),n=parseInt(s[2],10),o=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))r=parseInt(s[1],10),n=parseInt(s[2],10),o=parseInt(s[3],10),i=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))i=parseInt(s[1],10)/255,r=parseInt(s[2],10),n=parseInt(s[3],10),o=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))r=parseInt(s[1],16),n=parseInt(s[2],16),o=parseInt(s[3],16),i=1;else if(s=/^#([A-Fa-f0-9])([A-Fa-f0-9])([A-Fa-f0-9])$/i.exec(a))r=parseInt(s[1]+s[1],16),n=parseInt(s[2]+s[2],16),o=parseInt(s[3]+s[3],16),i=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 u=e/60;const c=l*(1-Math.abs(u%2-1));let d=[];switch(u=Math.floor(u),u){case 0:d=[l,c,0];break;case 1:d=[c,l,0];break;case 2:d=[0,l,c];break;case 3:d=[0,c,l];break;case 4:d=[c,0,l];break;case 5:d=[l,0,c];break;default:d=[0,0,0]}const p=a-.5*l;r=d[0]+p,n=d[1]+p,o=d[2]+p,r=Math.round(255*r),n=Math.round(255*n),o=Math.round(255*o),i=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]);i=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 u=e/60;const c=l*(1-Math.abs(u%2-1));let d=[];switch(u=Math.floor(u),u){case 0:d=[l,c,0];break;case 1:d=[c,l,0];break;case 2:d=[0,l,c];break;case 3:d=[0,c,l];break;case 4:d=[c,0,l];break;case 5:d=[l,0,c];break;default:d=[0,0,0]}const p=a-.5*l;r=d[0]+p,n=d[1]+p,o=d[2]+p,r=Math.round(255*r),n=Math.round(255*n),o=Math.round(255*o)}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 u=e/60;const c=l*(1-Math.abs(u%2-1));let d=[];switch(u=Math.floor(u),u){case 0:d=[l,c,0];break;case 1:d=[c,l,0];break;case 2:d=[0,l,c];break;case 3:d=[0,c,l];break;case 4:d=[c,0,l];break;case 5:d=[l,0,c];break;default:d=[0,0,0]}const p=a-l;r=d[0]+p,n=d[1]+p,o=d[2]+p,r=Math.round(255*r),n=Math.round(255*n),o=Math.round(255*o),i=1}else{const e=a.toLowerCase();if(function(e){return e in m_}(e)){const t=m_[e];({r:r,g:n,b:o}=t),i="a"in t?t.a:1}else t.invalid=!0}}else"number"==typeof e[0]&&e[0]>=0&&"argb"===e[1]?(i=(4278190080&e[0])>>>24,i/=255,r=(16711680&e[0])>>16,n=(65280&e[0])>>8,o=255&e[0]):"number"==typeof e[0]&&e[0]>=0?(r=(16711680&e[0])>>16,n=(65280&e[0])>>8,o=255&e[0]):t.invalid=!0;else 3===e.length||4===e.length?(r=e[0],n=e[1],o=e[2],i=4===e.length?e[3]:1):t.invalid=!0;var a;return Number.isNaN(+r+n+o+i)&&(t.invalid=!0),t.r=Math.floor(r),t.g=Math.floor(n),t.b=Math.floor(o),t.a=i,t}function v_(e){let t,r,n;if(f_(e))return t=e.r.toString(16),r=e.g.toString(16),n=e.b.toString(16),1===t.length&&(t=`0${t}`),1===r.length&&(r=`0${r}`),1===n.length&&(n=`0${n}`),`#${[t,r,n].join("")}`;const o="string"==typeof e?h_(e):e;return t=((16711680&o)>>16).toString(16),r=((65280&o)>>8).toString(16),n=(255&o).toString(16),1===t.length&&(t=`0${t}`),1===r.length&&(r=`0${r}`),1===n.length&&(n=`0${n}`),`#${t}${r}${n}`}function y_(e){let t,r,n=0;const o="string"==typeof e?g_(e):e,i=o.r/255,a=o.g/255,s=o.b/255,{a:l}=o,u=Math.max(i,a,s),c=Math.min(i,a,s),d=(u+c)/2;if(u===c)t=0,n=0;else{switch(r=u-c,t=d>.5?r/(2-u-c):r/(u+c),u){case i:n=(a-s)/r+(a<s?6:0);break;case a:n=(s-i)/r+2;break;case s:n=(i-a)/r+4}n/=6}return{h:360*n,s:100*t,l:100*d,a:l}}function b_(e){let t,r,n=0;const o="string"==typeof e?g_(e):e,i=o.r/255,a=o.g/255,s=o.b/255,l=Math.max(i,a,s),u=Math.min(i,a,s),c=l;if(l===u)t=0,n=0;else{switch(r=l-u,t=0===r?0:r/c,l){case i:n=(a-s)/r+(a<s?6:0);break;case a:n=(s-i)/r+2;break;case s:n=(i-a)/r+4}n/=6}return{h:360*n%360,s:100*t,v:100*c}}function x_(e){if(f_(e))return`rgb(${e.r}, ${e.g}, ${e.b})`;const t="string"==typeof e?h_(e):e;return`rgb(${(16711680&t)>>16}, ${(65280&t)>>8}, ${255&t})`}function S_(e,t){return f_(e)?`rgba(${e.r}, ${e.g}, ${e.b}, ${e.a})`:S_(g_(e))}function w_(e){return f_(e)?1===e.a?x_(e):S_(e):w_(g_(e))}const C_=e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};function E_(e){return.2126*C_(e.r)+.7152*C_(e.g)+.0722*C_(e.b)}function I_(...e){const t=g_(...e);return t.invalid||E_(t)<.4}function D_(...e){const t=g_(...e),r={type:t.type,r:t.r,g:t.g,b:t.b,a:t.a,invalid:t.invalid,spaces:t.spaces},n=()=>(r.spaces.hslaObject||(r.spaces.hslaObject=y_(r)),r.spaces.hslaObject),o=e=>{const t=n(),{h:r,s:o,l:i,a:a}=t;return`hsla(${r}, ${o}, ${Math.max(0,Math.min(i+e,100))}, ${a})`};return{get type(){return r.type},isInvalid:()=>r.invalid,get r(){return r.r},get g(){return r.g},get b(){return r.b},get a(){return r.a},getR:()=>r.r,getG:()=>r.g,getB:()=>r.b,getAlpha:()=>r.a,setAlpha:e=>{r.a=e,r.spaces={}},isEqualTo:e=>{let t;if("string"==typeof e)t=g_(e);else{if(e.type!==r.type)return!1;t=e}return t.r===r.r&&t.g===r.g&&t.b===r.b&&t.a===r.a},isDark:()=>I_(r),getRGB:()=>(r.spaces.rgb||(r.spaces.rgb=x_(r)),r.spaces.rgb),getRGBA:()=>(r.spaces.rgba||(r.spaces.rgba=S_(r)),r.spaces.rgba),getString:()=>(r.spaces.string||(r.spaces.string=w_(r)),r.spaces.string),getHex:()=>(r.spaces.hex||(r.spaces.hex=v_(r)),r.spaces.hex),getHSL:()=>(r.spaces.hsl||(r.spaces.hsl=function(e){let t,r,n=0;const o="string"==typeof e?g_(e):e,i=o.r/255,a=o.g/255,s=o.b/255,l=Math.max(i,a,s),u=Math.min(i,a,s),c=(l+u)/2;if(l===u)t=0,n=0;else{switch(r=l-u,t=c>.5?r/(2-l-u):r/(l+u),l){case i:n=(a-s)/r+(a<s?6:0);break;case a:n=(s-i)/r+2;break;case s:n=(i-a)/r+4}n/=6}return`hsl(${360*n}, ${100*t}, ${100*c})`}(r)),r.spaces.hsl),getHSLA:()=>(r.spaces.hsla||(r.spaces.hsla=function(e){const{h:t,s:r,l:n,a:o}=y_(e);return`hsla(${t}, ${r}, ${n}, ${o})`}(r)),r.spaces.hsla),getHSLAObject:n,getShiftedHSLA:o,getHSV:()=>(r.spaces.hsv||(r.spaces.hsv=function(e){const{h:t,s:r,v:n}=b_(e);return`hsv(${t}, ${r}, ${n})`}(r)),r.spaces.hsv),getHSVObject:()=>(r.spaces.hsvObject||(r.spaces.hsvObject=b_(r)),r.spaces.hsvObject),blend:(e,t)=>`rgba(${Math.floor(r.r+(e.r-r.r)*t)}, ${Math.floor(r.g+(e.g-r.g)*t)}, ${Math.floor(r.b+(e.b-r.b)*t)}, ${Math.floor(r.a+(e.getAlpha()-r.a)*t)})`,getBrightenedColor:(e=1)=>D_(o(18*e)),getDarkenedColor:(e=1)=>D_(o(18*-e))}}function P_(e,t){if(!e||!t)return;const r=E_(e),n=E_(t);return r>n?(r+.05)/(n+.05):(n+.05)/(r+.05)}function R_(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var M_,L_="top",A_="top-right",k_="right",O_="bottom-right",q_="bottom",T_="bottom-left",N_="left",__="top-left";R_(R_(R_(R_(R_(R_(R_(R_(R_(R_(M_={},"equal-equal",[L_,q_]),"equal-higher",[q_,O_]),"equal-lower",[L_,A_]),"equal-void",[L_,q_]),"higher-equal",[N_,T_,L_,A_]),"higher-higher-acute",[q_,T_,N_,A_]),"higher-higher-obtuse",[q_,L_]),"higher-lower-negative",[L_,A_,k_]),"higher-lower-positive",[q_,T_,N_]),"higher-void",[L_]),R_(R_(R_(R_(R_(R_(R_(R_(R_(R_(M_,"lower-equal",[L_]),"lower-higher-negative",[L_,__]),"lower-higher-positive",[O_]),"lower-lower-acute",[L_,__,N_,A_,k_]),"lower-lower-obtuse",[L_,q_]),"lower-void",[L_]),"void-equal",[L_]),"void-higher",[L_,q_]),"void-lower",[L_,q_,N_]),"void-void",[L_]),R_(M_,"unclassified",[L_,q_,k_,N_,A_,O_,T_,__]);var j_,F_,z_=["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"],W_=["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 $_(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?W_:z_}var H_=function(){if(F_)return j_;F_=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},i=function(r){if(!r||"[object Object]"!==t.call(r))return!1;var n,o=e.call(r,"constructor"),i=r.constructor&&r.constructor.prototype&&e.call(r.constructor.prototype,"isPrototypeOf");if(r.constructor&&!o&&!i)return!1;for(n in r);return void 0===n||e.call(r,n)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,r){if("__proto__"===r){if(!e.call(t,r))return;if(n)return n(t,r).value}return t[r]};return j_=function e(){var t,r,n,l,u,c,d=arguments[0],p=1,f=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},p=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});p<f;++p)if(null!=(t=arguments[p]))for(r in t)n=s(d,r),d!==(l=s(t,r))&&(h&&l&&(i(l)||(u=o(l)))?(u?(u=!1,c=n&&o(n)?n:[]):c=n&&i(n)?n:{},a(d,{name:r,newValue:e(h,c,l)})):void 0!==l&&a(d,{name:r,newValue:l}));return d},j_}();function V_(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function B_(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function G_(){}!function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}(H_);var U_=1/.7,Y_="\\s*([+-]?\\d+)\\s*",K_="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",X_="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",J_=/^#([0-9a-f]{3,8})$/,Z_=new RegExp(`^rgb\\(${Y_},${Y_},${Y_}\\)$`),Q_=new RegExp(`^rgb\\(${X_},${X_},${X_}\\)$`),ej=new RegExp(`^rgba\\(${Y_},${Y_},${Y_},${K_}\\)$`),tj=new RegExp(`^rgba\\(${X_},${X_},${X_},${K_}\\)$`),rj=new RegExp(`^hsl\\(${K_},${X_},${X_}\\)$`),nj=new RegExp(`^hsla\\(${K_},${X_},${X_},${K_}\\)$`),oj={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 ij(){return this.rgb().formatHex()}function aj(){return this.rgb().formatRgb()}function sj(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=J_.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?lj(t):3===r?new pj(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?uj(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?uj(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 pj(t[1],t[2],t[3],1):(t=Q_.exec(e))?new pj(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ej.exec(e))?uj(t[1],t[2],t[3],t[4]):(t=tj.exec(e))?uj(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=rj.exec(e))?yj(t[1],t[2]/100,t[3]/100,1):(t=nj.exec(e))?yj(t[1],t[2]/100,t[3]/100,t[4]):oj.hasOwnProperty(e)?lj(oj[e]):"transparent"===e?new pj(NaN,NaN,NaN,0):null}function lj(e){return new pj(e>>16&255,e>>8&255,255&e,1)}function uj(e,t,r,n){return n<=0&&(e=t=r=NaN),new pj(e,t,r,n)}function cj(e){return e instanceof G_||(e=sj(e)),e?new pj((e=e.rgb()).r,e.g,e.b,e.opacity):new pj}function dj(e,t,r,n){return 1===arguments.length?cj(e):new pj(e,t,r,null==n?1:n)}function pj(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function fj(){return`#${vj(this.r)}${vj(this.g)}${vj(this.b)}`}function hj(){const e=mj(this.opacity);return`${1===e?"rgb(":"rgba("}${gj(this.r)}, ${gj(this.g)}, ${gj(this.b)}${1===e?")":`, ${e})`}`}function mj(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function gj(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function vj(e){return((e=gj(e))<16?"0":"")+e.toString(16)}function yj(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new xj(e,t,r,n)}function bj(e){if(e instanceof xj)return new xj(e.h,e.s,e.l,e.opacity);if(e instanceof G_||(e=sj(e)),!e)return new xj;if(e instanceof xj)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,o=Math.min(t,r,n),i=Math.max(t,r,n),a=NaN,s=i-o,l=(i+o)/2;return s?(a=t===i?(r-n)/s+6*(r<n):r===i?(n-t)/s+2:(t-r)/s+4,s/=l<.5?i+o:2-i-o,a*=60):s=l>0&&l<1?0:a,new xj(a,s,l,e.opacity)}function xj(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function Sj(e){return(e=(e||0)%360)<0?e+360:e}function wj(e){return Math.max(0,Math.min(1,e||0))}function Cj(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}V_(G_,sj,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ij,formatHex:ij,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return bj(this).formatHsl()},formatRgb:aj,toString:aj}),V_(pj,dj,B_(G_,{brighter(e){return e=null==e?U_:Math.pow(U_,e),new pj(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new pj(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new pj(gj(this.r),gj(this.g),gj(this.b),mj(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:fj,formatHex:fj,formatHex8:function(){return`#${vj(this.r)}${vj(this.g)}${vj(this.b)}${vj(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:hj,toString:hj})),V_(xj,function(e,t,r,n){return 1===arguments.length?bj(e):new xj(e,t,r,null==n?1:n)},B_(G_,{brighter(e){return e=null==e?U_:Math.pow(U_,e),new xj(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new xj(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,o=2*r-n;return new pj(Cj(e>=240?e-240:e+120,o,n),Cj(e,o,n),Cj(e<120?e+240:e-120,o,n),this.opacity)},clamp(){return new xj(Sj(this.h),wj(this.s),wj(this.l),mj(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=mj(this.opacity);return`${1===e?"hsl(":"hsla("}${Sj(this.h)}, ${100*wj(this.s)}%, ${100*wj(this.l)}%${1===e?")":`, ${e})`}`}}));const Ej=Math.PI/180,Ij=180/Math.PI,Dj=4/29,Pj=6/29,Rj=3*Pj*Pj;function Mj(e){if(e instanceof Lj)return new Lj(e.l,e.a,e.b,e.opacity);if(e instanceof Tj)return Nj(e);e instanceof pj||(e=cj(e));var t,r,n=qj(e.r),o=qj(e.g),i=qj(e.b),a=Aj((.2225045*n+.7168786*o+.0606169*i)/1);return n===o&&o===i?t=r=a:(t=Aj((.4360747*n+.3850649*o+.1430804*i)/.96422),r=Aj((.0139322*n+.0971045*o+.7141733*i)/.82521)),new Lj(116*a-16,500*(t-a),200*(a-r),e.opacity)}function Lj(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function Aj(e){return e>.008856451679035631?Math.pow(e,1/3):e/Rj+Dj}function kj(e){return e>Pj?e*e*e:Rj*(e-Dj)}function Oj(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function qj(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Tj(e,t,r,n){this.h=+e,this.c=+t,this.l=+r,this.opacity=+n}function Nj(e){if(isNaN(e.h))return new Lj(e.l,0,0,e.opacity);var t=e.h*Ej;return new Lj(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}V_(Lj,function(e,t,r,n){return 1===arguments.length?Mj(e):new Lj(e,t,r,null==n?1:n)},B_(G_,{brighter(e){return new Lj(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Lj(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return new pj(Oj(3.1338561*(t=.96422*kj(t))-1.6168667*(e=1*kj(e))-.4906146*(r=.82521*kj(r))),Oj(-.9787684*t+1.9161415*e+.033454*r),Oj(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}})),V_(Tj,function(e,t,r,n){return 1===arguments.length?function(e){if(e instanceof Tj)return new Tj(e.h,e.c,e.l,e.opacity);if(e instanceof Lj||(e=Mj(e)),0===e.a&&0===e.b)return new Tj(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Ij;return new Tj(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Tj(e,t,r,null==n?1:n)},B_(G_,{brighter(e){return new Tj(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Tj(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Nj(this).rgb()}}));var _j=e=>()=>e;function jj(e,t){var r=t-e;return r?function(e,t){return function(r){return e+r*t}}(e,r):_j(isNaN(e)?t:e)}!function e(t){var r=function(e){return 1==(e=+e)?jj:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):_j(isNaN(t)?r:t)}}(t);function n(e,t){var n=r((e=dj(e)).r,(t=dj(t)).r),o=r(e.g,t.g),i=r(e.b,t.b),a=jj(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=o(t),e.b=i(t),e.opacity=a(t),e+""}}return n.gamma=e,n}(1);var Fj="center",zj="bottom";[{key:"NoDataExist",alignment:Fj,condition:function(e){var t=e.layoutService;if(!t)return!1;var r=t.meta.size;return r.x*r.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:Fj,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:Fj,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var r=t.getHyperCubeValue("qDimensionInfo.0");return r&&(r.qMax<r.qMin||"NaN"===r.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:Fj},{key:"DataRangeIncludingZero",alignment:zj},{key:"LimitedData",alignment:zj},{key:"NegativeOrZeroValues",alignment:zj}].reduce(function(e,t){return e[t.key]=t,e},{});var Wj,$j=["__proto__","constructor"];function Hj(e,t,r){if(void 0!==e&&void 0!==t){var n=t.split("."),o=n[n.length-1];if(!$j.some(function(e){return n.includes(e)})){for(var i=e,a=0;a<n.length-1;++a){var s=n[a];void 0===i[s]&&(i[s]=Number.isNaN(+n[a+1])?{}:[]),i=i[s]}void 0!==r?i[o]=r:delete i[o]}}}function Vj(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e},r=function(){var e={};return{get:function(t){return e[t]},set:function(t,r){return e[t]=r,r},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}();return function(n){var o=t(n);return r.has(o)?r.get(o):r.set(o,e(n))}}function Bj(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return function(){for(var n=this,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];clearTimeout(t),t=setTimeout(function(){return e.apply(n,i)},r)}}function Gj(e){var t=0,r=e.children,n=r&&r.length;if(n)for(;--n>=0;)t+=r[n].value;else t=1;e.value=t}function Uj(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Kj)):void 0===t&&(t=Yj);for(var r,n,o,i,a,s=new Zj(e),l=[s];r=l.pop();)if((o=t(r.data))&&(a=(o=Array.from(o)).length))for(r.children=o,i=a-1;i>=0;--i)l.push(n=o[i]=new Zj(o[i])),n.parent=r,n.depth=r.depth+1;return s.eachBefore(Jj)}function Yj(e){return e.children}function Kj(e){return Array.isArray(e)?e[1]:null}function Xj(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Jj(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Zj(e){this.data=e,this.depth=this.height=0,this.parent=null}function Qj(e){const{translator:t}=e;return{targets:[{path:"/qHyperCubeDef",dimensions:{min:1,max:1e3,description(e,r,n){const o="rows"===n?.type?"Visualizations.Descriptions.Row":"Visualizations.Descriptions.Column";return t.get(o)}},measures:{min:1,max:1e3,description:()=>t.get("Visualizations.Descriptions.Values")},filters:{description:()=>t.get("SimpleProperties.Filters.Filter")}}]}}Zj.prototype=Uj.prototype={constructor:Zj,count:function(){return this.eachAfter(Gj)},each:function(e,t){let r=-1;for(const n of this)e.call(t,n,++r,this);return this},eachAfter:function(e,t){for(var r,n,o,i=this,a=[i],s=[],l=-1;i=a.pop();)if(s.push(i),r=i.children)for(n=0,o=r.length;n<o;++n)a.push(r[n]);for(;i=s.pop();)e.call(t,i,++l,this);return this},eachBefore:function(e,t){for(var r,n,o=this,i=[o],a=-1;o=i.pop();)if(e.call(t,o,++a,this),r=o.children)for(n=r.length-1;n>=0;--n)i.push(r[n]);return this},find:function(e,t){let r=-1;for(const n of this)if(e.call(t,n,++r,this))return n},sum:function(e){return this.eachAfter(function(t){for(var r=+e(t.data)||0,n=t.children,o=n&&n.length;--o>=0;)r+=n[o].value;t.value=r})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(e){for(var t=this,r=function(e,t){if(e===t)return e;var r=e.ancestors(),n=t.ancestors(),o=null;for(e=r.pop(),t=n.pop();e===t;)o=e,e=r.pop(),t=n.pop();return o}(t,e),n=[t];t!==r;)t=t.parent,n.push(t);for(var o=n.length;e!==r;)n.splice(o,0,e),e=e.parent;return n},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,t=[];return e.each(function(r){r!==e&&t.push({source:r.parent,target:r})}),t},copy:function(){return Uj(this).eachBefore(Xj)},[Symbol.iterator]:function*(){var e,t,r,n,o=this,i=[o];do{for(e=i.reverse(),i=[];o=e.pop();)if(yield o,t=o.children)for(r=0,n=t.length;r<n;++r)i.push(t[r])}while(i.length)}},Wj=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 r,n,o,i,a,s,l,u,c,d,p=e.length,f=e.search(/[0-9\-\+#]/),h=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),v=p-g,y=e.substring(v,v+1),b=v+("."===y||","===y?1:0),x=g>0?e.substring(b,p):"";if(r=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,o=(n=e.match(/[^\d\-\+#]/g))&&n[n.length-1]||".",i=n&&n[1]&&n[0]||",",e=e.split(o),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(i),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(m="",v=(d=t[0]).length%l,p=d.length,b=0;b<p;b++)m+=d.charAt(b),!((b-v+1)%l)&&b<p-l&&(m+=i);t[0]=m}return t[1]=e[1]&&t[1]?o+t[1]:"","0"!==(n=t.join(""))&&""!==n||(r=!1),h+(r?"-":"")+n+x}},Wj({exports:{}});const eF="qHyperCubeDef.qDimensions",tF="dimensions",rF="qOtherTotalSpec.qTotalMode",nF="totalMode",oF={quarantine(e){e_.quarantineArrayProp({properties:e,arrayPath:eF,quarantineName:nF,arrayName:tF,itemPath:rF})},unquarantine(e){e_.unquarantineArrayProp({properties:e,arrayPath:eF,quarantineName:nF,arrayName:tF,itemPath:rF})}};function iF(e){const t=Qj(e);return(e,r,n,o)=>{const i=e_.hypercube.importProperties({exportFormat:e,initialProperties:r,dataDefinition:t.targets[0],hypercubePath:o}),a=i.qProperty.qHyperCubeDef.qDimensions.length,s=i.qProperty.qHyperCubeDef.qMeasures.length;let l,u=i.qProperty.qHyperCubeDef.qInterColumnSortOrder,c=!0;a+s===u.length&&Hj(i,"qProperty.qLayoutExclude.quarantine.interColSortOrder",u.concat());const d=i.qProperty.qLayoutExclude.quarantine?.pivotInterColSortOrder;d?(u=d,l=[...d],Hj(i,"qProperty.qHyperCubeDef.qInterColumnSortOrder",u),i.qProperty.qLayoutExclude.quarantine&&delete i.qProperty.qLayoutExclude.quarantine.pivotInterColSortOrder):u.length=0;const p=+(u.indexOf(-1)>-1),f=a+p;if(f>u.length)for(let e=u.length;e<f;e++)u.indexOf(e)<0&&u.push(e-p);for(let e=u.length-1;e>=0;e--)u[e]>=a&&u.splice(e,1);s>1&&u.indexOf(-1)<0?u.push(-1):s<2&&u.indexOf(-1)>-1&&u.splice(u.indexOf(-1),1);const h=i.qProperty.qHyperCubeDef.qNoOfLeftDims??-1;if(a>0&&-1===h&&Hj(i,"qProperty.qHyperCubeDef.qNoOfLeftDims",a),l?.length===u.length){for(let e=0;e<l.length;e++)if(l[e]!==u[e]){c=!1;break}c&&(e_.unquarantineProperty(i.qProperty,"noOfLeftDims"),e_.unquarantineProperty(i.qProperty,"excludedNoOfLeftDims "))}return e_.unquarantineProperty(i.qProperty,"rankedList"),e_.conditionalShow.unquarantine(i.qProperty),oF.unquarantine(i.qProperty),d_(i.qProperty),e_.unquarantineProperty(i.qProperty,"pivotTableIndentMode"),i}}function aF(e,t){const r=e.qProperty.qHyperCubeDef.qInterColumnSortOrder,n=r.slice(),o=r.indexOf(-1);o>-1&&r.splice(o,1);const i=e_.hypercube.exportProperties({propertyTree:e,hyperCubePath:t}),a=i.properties.qHyperCubeDef,s=a.qDimensions.length,l=a.qMeasures.length;let u=a.qInterColumnSortOrder;Hj(i,"properties.qLayoutExclude.quarantine.pivotInterColSortOrder",n),e_.quarantineProperty(i.properties,"qHyperCubeDef.qNoOfLeftDims","noOfLeftDims"),delete i.properties.qHyperCubeDef.qNoOfLeftDims,e_.quarantineProperty(i.properties,"qHyperCubeDef.rankedList","rankedList"),delete i.properties.qHyperCubeDef.rankedList;const c=i.properties.qLayoutExclude.quarantine?.interColSortOrder;c&&(u=c,Hj(i,"properties.qHyperCubeDef.qInterColumnSortOrder",u),Hj(i,"data.0.interColumnSortOrder",u),i.properties.qLayoutExclude.quarantine&&delete i.properties.qLayoutExclude.quarantine.interColSortOrder);for(let e=u.length;e<s+l;e++)u.length<=e&&u.push(e);return e_.quarantineProperty(i.properties,"qHyperCubeDef.qIndentMode","pivotTableIndentMode"),e_.quarantineProperty(i.properties,"qHyperCubeDef.excludedNoOfLeftDims ","excludedNoOfLeftDims "),e_.conditionalShow.quarantine(i.properties),oF.quarantine(i.properties),p_(i.properties),i}const sF=e=>({dimensions:{min:1,max:1e3,description(t,r,n){const o="rows"===n?.type?"Visualizations.Descriptions.Row":"Visualizations.Descriptions.Column";return e.translator.get(o)}},measures:{min:1,max:1e3,description:()=>e.translator.get("Visualizations.Descriptions.Values")}}),lF={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}}}};let uF=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}({}),cF=function(e){return e.Attribute="attribute",e.Dimension="dimension",e}({});const dF=e=>{switch(e?.type){case"url":return uF.Link;case"image":return uF.Image;case"indicator":return uF.Indicator;case"miniChart":return uF.MiniChart;default:return uF.Text}},pF=({isImagesEnabled:e})=>({uses:"dimensionRepresentationItems.representationType",options(t,r,n){const{qIndentMode:o}=n.properties.qHyperCubeDef,i=[{value:"text",translation:"Object.Table.Representation.Text"},{value:"url",translation:"Object.Table.Representation.Link"}];return(!o&&e||o)&&i.push({value:"image",translation:"Object.Table.Representation.Image"}),i}}),fF=e=>{if(e)return{representationImage:{uses:"dimensionRepresentationItems.representationImage",show:e=>dF(e.qDef.representation)===uF.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,r)=>{if(!r.properties.qHyperCubeDef)return!1;const{qInterColumnSortOrder:n,qNoOfLeftDims:o,qDimensions:i,qIndentMode:a}=r.properties.qHyperCubeDef;let s=!1;n?.indexOf(-1);const l=i?.indexOf(e)??1/0;return(n?.slice(0,o)??[]).indexOf(l)>-1&&(s=!0),s&&a}}}}}},hF=e=>{const{anything:t}=e,r=!t.sense?.isUnsupportedFeature?.("tableImages");return{representationType:pF({isImagesEnabled:r}),representationUrlPosition:{uses:"dimensionRepresentationItems.representationUrlPosition",show:e=>dF(e.qDef.representation)===uF.Link},representationUrlLabel:{uses:"dimensionRepresentationItems.representationUrlLabel",show:e=>dF(e.qDef.representation)===uF.Link&&e.qDef.representation?.urlPosition===cF.Dimension},representationLinkUrl:{uses:"dimensionRepresentationItems.representationLinkUrl",show:e=>dF(e.qDef.representation)===uF.Link&&e.qDef.representation?.urlPosition===cF.Attribute},...fF(r)}},mF=(e,t)=>{const{anything:r}=e,n=r.sense?.isUnsupportedFeature,o=!n?.("tableImages")&&t[uF.Image],i=!n?.("qMiniChartDef")&&t[uF.MiniChart],a=!n?.("tableIndicators")&&t[uF.Indicator],s=o&&t[uF.ImagesInIndentMode];return{representationType:{uses:"measureRepresentationItems.representationType",options:(e,t,r)=>(e=>{const{qIndentMode:t}=e.properties.qHyperCubeDef??{},r=[{value:"text",translation:"Object.Table.Representation.Text"}];return(!t&&o||t&&s)&&r.push({value:"image",translation:"Object.Table.Representation.Image"}),a&&r.push({value:"indicator",translation:"Object.Table.Representation.Indicator"}),i&&r.push({value:"miniChart",translation:"Common.MiniChart"}),r})(r)},representationImage:o?{uses:"measureRepresentationItems.representationImage",show:e=>dF(e.qDef.representation)===uF.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:i?{uses:"measureRepresentationItems.representationMiniChart"}:void 0}};let gF=function(e){return e.Dimension="dimensions",e.Measures="measures",e.Pivot="pivot",e}({}),vF=function(e){return e.CellForegroundColor="cellForegroundColor",e.CellBackgroundColor="cellBackgroundColor",e.ImageUrl="imageUrl",e.ImageLabel="imageLabel",e.Link="url",e.LinkLabel="urlLabel",e}({}),yF=function(e){return e.TopGrid="topGrid",e.LeftGrid="leftGrid",e.DataGrid="dataGrid",e}({}),bF=function(e){return e.Forward="forward",e.Backward="backward",e.None="none",e}({});const xF="image",SF=(e,t,r)=>{if(!r.properties.qHyperCubeDef.qIndentMode)return!0;const n=r.properties.qHyperCubeDef.qInterColumnSortOrder?.indexOf(-1)??-1;let o=r.properties.qHyperCubeDef.qNoOfLeftDims??-1;n>-1&&n<o&&(o-=1);const i=r.properties.qHyperCubeDef.qDimensions.indexOf(e);return 0===i||i>=o},wF=()=>({type:{type:"string",component:"dropdown",ref:"qDef.columnWidth.type",translation:"Object.Table.Column.Width",options:[{value:ST.Auto,translation:"Common.Auto"},{value:ST.FitToContent,translation:"Object.Table.Column.FitToContent"},{value:ST.Pixels,translation:"Object.Table.Column.Pixels"},{value:ST.Percentage,translation:"Object.Table.Column.Percentage"}],defaultValue:ST.Auto},sizePixels:{ref:"qDef.columnWidth.pixels",translation:"Object.Table.Column.Pixels",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:xT.PixelsDefault,show:e=>e.qDef.columnWidth?.type===ST.Pixels},sizePercentage:{ref:"qDef.columnWidth.percentage",translation:"Object.Table.Column.Percentage",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:xT.PercentageDefault,show:e=>e.qDef.columnWidth?.type===ST.Percentage}}),CF=({key:e,translation:t,env:r})=>{const n=!r.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=>!n||"labelTextAlign"===e||t.qDef.representation?.type!==xF},[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&&(!n||"labelTextAlign"===e||t.qDef.representation?.type!==xF)}}},EF="TOTAL_OFF",IF={component:"attribute-expression-reference",defaultValue:[],ref:"qAttributeExpressions",items:[{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.BackgroundExpression",defaultValue:"",id:vF.CellBackgroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.ForegroundExpression",defaultValue:"",id:vF.CellForegroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:vF.LinkLabel,tid:"URLLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:vF.Link,tid:"URLByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:vF.ImageLabel,tid:"ImageLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:vF.ImageUrl,tid:"ImageUrlByExpression",show:!1}]},DF="TOTAL_OFF",PF={component:"attribute-expression-reference",defaultValue:[],ref:"qAttributeExpressions",items:[{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.BackgroundExpression",defaultValue:"",id:vF.CellBackgroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.ForegroundExpression",defaultValue:"",id:vF.CellForegroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:vF.LinkLabel,tid:"URLLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:vF.Link,tid:"URLByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:vF.ImageLabel,tid:"ImageLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:vF.ImageUrl,tid:"ImageUrlByExpression",show:!1}]},RF=e=>{const{translator:t,anything:r,flags:n}=e,o=(e=>{const{translator:t,anything:r}=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:EF,trueOption:{value:"TOTAL_EXPR",translation:"properties.on"},falseOption:{value:EF,translation:"properties.off"},show:!r.sense?.isUnsupportedFeature?.("totals")&&SF},totalsLabel:{type:"string",component:"expression",expressionType:"StringExpr",ref:"qTotalLabel",translation:"properties.totals.label",defaultValue:()=>t.get("Object.Table.Totals"),show:(e,t,n)=>!r.sense?.isUnsupportedFeature?.("totals")&&e.qOtherTotalSpec?.qTotalMode!==EF&&SF(e,0,n)},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:IF,...CF({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...CF({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...hF(e),...wF()}}}},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:IF,...CF({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...CF({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...mF(e,{[uF.Image]:!0,[uF.Indicator]:!0}),...wF()}}}},filter:{type:"object",component:"filter-item-react",ref:"filter",tabName:"SimpleProperties.Filters.Filters"}}}})(e);return n.isEnabled("CLIENT_IM5974_PIVOT_DATA_PROPERTIES")?o:{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:DF,trueOption:{value:"TOTAL_EXPR",translation:"properties.on"},falseOption:{value:DF,translation:"properties.off"},show:!r.sense?.isUnsupportedFeature?.("totals")&&SF},totalsLabel:{type:"string",component:"expression",expressionType:"StringExpr",ref:"qTotalLabel",translation:"properties.totals.label",defaultValue:()=>t.get("Object.Table.Totals"),show:(e,t,n)=>!r.sense?.isUnsupportedFeature?.("totals")&&e.qOtherTotalSpec?.qTotalMode!==DF&&SF(e,0,n)},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:PF,...CF({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...CF({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...hF(e),...wF()}},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:PF,...CF({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...CF({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...mF(e,{[uF.Image]:!0,[uF.ImagesInIndentMode]:!0,[uF.Indicator]:!0}),...wF()}},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"}}}}}},MF=OS().palette,LF={TEXT:MF.text.primary,DISABLED:MF.text.disabled,HOVER:MF.action.hover,WHITE:Df.GREYSCALE_100,BORDER_MEDIUM:Df.GREYSCALE_85,DARK_MODE_TEXT:Df.GREYSCALE_95,DARK_MODE_BORDER:Df.GREYSCALE_95,DARK_MODE_DISABLED:Df.GREYSCALE_70,TRANSPARENT:"transparent",SELECTED:MF.primary.main,LINK:MF.info.main,ERROR:MF.error.main},AF=(e,t=LF.TEXT,r=LF.WHITE)=>{const n=D_(e??""),o=D_(t),i=D_(r);return n.isInvalid()?t:function(e,t,r){const n=P_(e,t),o=P_(e,r);if(void 0!==n&&void 0!==o)return n>o?t:r}(n,i,o).getRGB()},kF=e=>{const t=e.getStyle("","","dataColors.selected")||LF.SELECTED,r=function(e,t){const r=D_("#FFFFFF"),n=D_(e),o=D_(t);if(n.isInvalid()||o.isInvalid()||n.getAlpha()<1||o.getAlpha()<1)return t;const i=P_(r,n),a=P_(o,n),s=i>a||i>4.5;return!s&&a>3?o.getHex():s?"#FFFFFF":"#000000"}(t,LF.TEXT);return{background:t,color:r}},OF=(e,t)=>{const r=D_(e);return 0===r.a?(r.setAlpha(t.opacity),r.getString()):r.isDark()?r.getBrightenedColor(t.brighter).getString():r.getDarkenedColor(t.darker).getString()},qF=e=>{const t=D_(e);return t.isInvalid()?null:1===t.a?t.getRGB():t.getRGBA()},TF=e=>{e.stopPropagation(),e.preventDefault()},NF=(e,t,r,n)=>({ref:e,translation:t,dualOutput:!0,type:"object",component:"color-picker",width:"auto",disableNone:n??!1,defaultValue(e,t,o){const i=n?.(e,t,o)??!1,a=o.theme.current(),s=r(a,i);return{color:"transparent"===s?"none":s}}}),_F=(e,t=!1)=>{return{value:e,label:t?(r=e,r.charAt(0).toUpperCase()+r.slice(1)):e,groupHeader:!1,disabled:!1,styles:t?{fontFamily:e}:void 0};var r},jF=({ref:e,themeAccessor:t,translator:r,flags:n})=>({component:"dropdown",ref:e,options:(e,o,i)=>{const a=i.theme.current();return((e,t,r,n)=>{const o=t.fontFamily??"Source Sans Pro, sans-serif",i=t.fontFamilies??[],a=Array.from(new Set([e,o,...i])),s=[{value:"ThemeHeader",label:r.get("properties.themeFonts"),metaText:r.get("properties.theme"),groupHeader:!0},...a.sort().map(e=>_F(e,!0))],l=[{value:"DefaultHeader",label:r.get("properties.allFonts"),metaText:r.get("properties.default"),groupHeader:!0},...$_(n).filter(e=>!a.includes(e)).map(e=>_F(e,!0))];return[...s,...l.length>1?l:[]]})(t(a),a,r,n)},defaultValue:(e,r,n)=>t(n.theme.current())}),FF=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],zF=({ref:e,themeAccessor:t,translator:r})=>({component:"dropdown",ref:e,options:(e,n,o)=>{const i=o.theme.current();return((e,t,r)=>{const n=t.fontSize,o=t.fontSizes??[],i=Array.from(new Set([e,n,...o])),a=[{value:"ThemeHeader",label:r.get("properties.themeFontSizes"),metaText:r.get("properties.theme"),groupHeader:!0},...i.sort((e,t)=>parseInt(e,10)-parseInt(t,10)).map(e=>_F(e,!1))],s=[{value:"DefaultHeader",label:r.get("properties.allFontSizes"),metaText:r.get("properties.default"),groupHeader:!0},...FF.filter(e=>!i.includes(e)).map(e=>_F(e,!1))];return[...a,...s.length>1?s:[]]})(t(i),i,r)},defaultValue:(e,r,n)=>t(n.theme.current())}),WF=({section:e,defaultFontStyle:t,translator:r,flags:n,getThemeValue:o,translation:i,disableNoneCallback:a})=>({component:"panel-section",translation:i??`properties.pivot.${e}`,items:{content:{component:"items",ref:"components",key:"theme",items:{fontFamily:jF({ref:`${e}.fontFamily`,themeAccessor:t=>o(t,e,"fontFamily")??t.fontFamily,translator:r,flags:n}),fontWrapperItem:{component:"inline-wrapper",items:{fontStyle:{component:"font-style-buttons",width:!1,ref:`${e}.fontStyle`,defaultValue:t??[]},fontSize:zF({ref:`${e}.fontSize`,themeAccessor:t=>o(t,e,"fontSize")??t.fontSize,translator:r}),fontColor:NF(`${e}.fontColor`,void 0,t=>o(t,e,"color")??t.color)}},background:NF(`${e}.background`,"properties.background",(t,r)=>{const n=r?LF.WHITE:LF.TRANSPARENT;return o(t,e,"backgroundColor")??n},a)}}}}),$F=({section:e,defaultFontStyle:t,fallbackBackground:r,getThemeValue:n})=>({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:NF(`${e}.fontColor`,void 0,t=>n(t,e,"color")??t.color)}},background:NF(`${e}.background`,"properties.background",t=>n(t,e,"backgroundColor")??r??"transparent")}}}}),HF=(e,t)=>({component:"dropdown",ref:e,translation:t,options:[...Array(10).keys()].map(e=>({value:e+1,translation:e+1})),defaultValue:1}),VF="12px",BF="Source Sans Pro, sans-serif",GF="600",UF=15e3,YF=4/3;let KF=function(e){return e.Transparent="transparent",e.FontSecondary="#737373",e.DividerDark="#595959",e.DividerLight="#D9D9D9",e.NullValueBackground="#F2F2F2",e}({}),XF=function(e){return e.Solid="solid",e.None="none",e}({});const JF={display:"flex",justifyContent:"center",alignItems:"center"},ZF={borderStyle:"solid"},QF={boxSizing:"border-box",padding:"4px 8px",userSelect:"none",WebkitUserSelect:"none"},ez={lineHeight:YF,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},tz=e=>({whiteSpace:"unset",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",wordBreak:e>1?"break-word":"break-all"}),rz=(e,t)=>e>0?`${e}px ${XF.Solid} ${t}`:XF.None,nz=(e,t,r,n,o)=>{const i=Number(!t||o?.right),a=Number(!e||o?.bottom);return{borderRight:"rtl"!==n?rz(i,r):XF.None,borderBottom:rz(a,r),borderLeft:"rtl"===n?rz(i,r):XF.None,borderTop:XF.None}},oz=(e,t,r,n,o,i,a)=>{const s=nz(t,n,o,i,a);return e.isLeftDimension||(e.isLastDimension&&!t&&(s.borderBottom=rz(2,o)),r||(s.borderLeft="rtl"!==i?rz(1,o):"none",s.borderRight="rtl"===i?rz(1,o):"none")),s},iz=({bottomDivider:e,rightDivider:t,borderColor:r})=>{const n={};return e&&(n.borderBottom=rz(1,r)),t&&(n.borderRight=rz(1,r)),n},az=(e,t,r)=>{switch(t){case"header":return e.object?.pivotTableV2?.dimension?.label?.name?.[r];case"dimensionValues":return e.object?.pivotTableV2?.dimension?.label?.value?.[r];case"measureLabels":return e.object?.pivotTableV2?.measure?.label?.name?.[r];case"measureValues":return e.object?.pivotTableV2?.measure?.label?.value?.[r];case"totalValues":return e.object?.pivotTableV2?.total?.label?.value?.[r];case"nullValues":return e.object?.pivotTableV2?.null?.label?.value?.[r];default:return}},sz=(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:WF({section:"header",defaultFontStyle:["bold"],translator:e,flags:t,getThemeValue:az}),dimensionValueSection:WF({section:"dimensionValues",translator:e,flags:t,getThemeValue:az}),measureValueSection:WF({section:"measureValues",translator:e,flags:t,getThemeValue:az}),measureLabelSection:$F({section:"measureLabels",getThemeValue:az}),totalValuesSection:$F({section:"totalValues",defaultFontStyle:["bold"],getThemeValue:az}),nullValuesSection:$F({section:"nullValues",fallbackBackground:KF.NullValueBackground,getThemeValue:az}),gridSection:{translation:"properties.pivot.grid",component:"panel-section",items:{gridItems:{component:"items",ref:"components",key:"theme",items:{lineClamp:HF("grid.lineClamp","ThemeStyleEditor.style.rowHeight"),columnLineClamp:HF("grid.columnLineClamp","ThemeStyleEditor.style.columnHeight"),border:NF("grid.border","properties.border",e=>e.object?.pivotTableV2?.grid?.borderColor??KF.DividerLight),divider:NF("grid.divider","properties.pivot.divider",e=>e.object?.pivotTableV2?.grid?.divider?.borderColor??KF.DividerDark),background:NF("grid.background","properties.background",e=>e.object?.pivotTableV2?.grid?.backgroundColor??KF.Transparent)}}}}}}]}),lz=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}}},uz=(e,t)=>({uses:"settings",items:{presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:[sz(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:ST.Auto,translation:"Common.Auto"},{value:ST.Pixels,translation:"Object.Table.Column.Pixels"},{value:ST.Percentage,translation:"Object.Table.Column.Percentage"}],defaultValue:ST.Auto,show:e=>!!e.qHyperCubeDef.qIndentMode},sizePixels:{ref:"qHyperCubeDef.indentModeColumnWidth.pixels",translation:"Object.Table.Column.Pixels",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:xT.PixelsDefault,show:e=>{const t=e.qHyperCubeDef;return t.qIndentMode&&t.indentModeColumnWidth?.type===ST.Pixels}},sizePercentage:{ref:"qHyperCubeDef.indentModeColumnWidth.percentage",translation:"Object.Table.Column.Percentage",component:"expression",expressionType:"ValueExpression",expression:"optional",defaultValue:xT.PercentageDefault,show:e=>{const t=e.qHyperCubeDef;return t.qIndentMode&&t.indentModeColumnWidth?.type===ST.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,r,n){e.qHyperCubeDef.qExpansionState=[],n.$emit("saveProperties",e)}}}}]},...lz(t)}}),cz="auto",dz={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:cz,translation:"Object.Table.SortingInSearch",options:[{value:cz,translation:"Common.Auto"},{value:"inherit",translation:"Object.Table.SortingInSearch.InheritFromDimension"}]}}};function pz(e){const{translator:t,flags:r}=e;return{type:"items",component:"accordion",items:{data:RF(e),sorting:dz,addons:lF,settings:uz(t,r)}}}function fz(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:pz(e),importProperties:iF(e),exportProperties:aF,exploration:ON(e),data:sF(e),propertyHandler:e.flags.isEnabled("VNA-147_NEBULA_PIVOT_DATA_HANDLERS")?t=>new ZN(t,e.translator):void 0}}const hz=()=>{let e;return{promise:new Promise(t=>{e=t}),resolve:e}};function mz(e,t){return R(()=>e,t)}const gz={},vz=e=>{const t=R(()=>({current:gz}),[]);return t.current=t.current===gz?e:t.current,t},yz=e=>!!e&&0===D_(e).a,bz="#grid",xz=(e,t)=>{const r=t?.closest(e);return r&&window.getComputedStyle(r).backgroundColor},Sz=(e,t,r,n,o)=>{const i=xz(".qv-object .qv-inner-object",r),a=xz(".qv-panel-sheet",r),s=xz(bz,r)??a,l=(e=>{const t=e.components?.find(e=>"general"===e.key),r=t?.bgColor?.colorExpression,n=t?.bgColor?.color?.color,o=t?.bgColor?.useColorExpression;if(o&&r)return qF(r);if("none"===n)return"transparent";if(void 0===n)return;const i=D_(n);return i.setAlpha(t?.bgColor?.color?.alpha??i.a),i.getRGBA()})(e),u=n?.(t),c=o?.(t),d=l||u||i||c,p=yz(d),f=!yz(h=p?s:d)&&AF(h,LF.TEXT,LF.DARK_MODE_TEXT)===x_(LF.DARK_MODE_TEXT);var h;const m=((e,t,r,n=LF.WHITE)=>e&&!yz(e)?e:yz(t)?r&&!yz(r)?r:n:t)(l,d,s);return{color:d,headerColor:m,isDark:f}},wz=(e,t,r,n)=>{const o=O(),i=((e,t={attributeFilter:["style"],childList:!1,subtree:!1})=>{const[r,n]=A([]);return k(()=>{let r;return e&&(r=new MutationObserver(e=>{n(e)}),r.observe(e,t)),()=>{r?.disconnect()}},[e,t]),r})(t.closest(bz),{attributeFilter:["style"],childList:!1,subtree:!1,attributeOldValue:!0}).filter(({oldValue:e})=>e?.includes("background")).map(({oldValue:e})=>e).join(",");return R(()=>({...o,background:Sz(e,o,t,r,n)}),[o.name(),t,r,n,e,i])};function Cz(e,t){const r=R(()=>({isLoading:!0}),t),[n,o]=L(async()=>{try{return await e()}finally{r.isLoading=!1}},t);return[n,r.isLoading,o]}const Ez=3,Iz=/\n/g;function Dz(e,t,r){let n=0,o=e.length;if(Number.isNaN(t))return null;if(e.length<=1)return null;if(r(e)<=t)return null;for(;n<=o;){const i=Math.floor((n+o)/2),a=e.slice(0,i),s=e.slice(0,i-1),l=r(a),u=r(s);if(l>t&&u<=t)return e.slice(i-1)||null;if(l===t)return e.slice(i)||null;l<t?n=i+1:o=i}return null}function Pz({fontSize:e="12px",fontFamily:t="Source Sans Pro, Arial, sans-serif",fontStyle:r="normal",fontWeight:n="normal"},o){const{maxNbrLinesOfText:i=Ez,allowLineBreaks:a=!0}=o??{},{estimateWidth:s,measureText:l,estimateLineCount:u}=v(()=>(({fontSize:e="12px",fontFamily:t="Source Sans Pro, Arial, sans-serif",fontStyle:r="normal",fontWeight:n="normal"},o)=>{const{maxNbrLinesOfText:i=Ez,allowLineBreaks:a=!0}=o??{};return()=>{const o=document.createElement("canvas").getContext("2d");o.font=`${r} ${n} ${e} ${t}`;const s=o.measureText.bind(o),l=Vj(e=>{if(void 0===e)return 0;if(a){const t=e.split(Iz).map(e=>s(e).width);return t.reduce((e,t)=>t>e?t:e,0)}const t=e.replace(Iz," ");return s(t).width}),u=e=>+l(e).toFixed(2),c=Vj(({text:e,maxWidth:t,isNumeric:r=!1})=>{if(r)return 1;const n=a?e.split(Iz):[e];let o=0;for(const e of n){let r=e;do{o+=1,r=Dz(r,t,u)}while(null!==r&&o<i);if(o>=i)break}return o},({text:e,maxWidth:t,isNumeric:r})=>`${e}-${t}-${r?"true":"false"}`);return{measureText:e=>l(e),estimateWidth:e=>l("N")*e,estimateLineCount:c}}})({fontStyle:r,fontWeight:n,fontSize:e,fontFamily:t},{maxNbrLinesOfText:i,allowLineBreaks:a})(),[r,n,e,t,i,a]);return{estimateWidth:s,measureText:l,estimateLineCount:u}}var Rz,Mz=E;Rz=Mz.createRoot,Mz.hydrateRoot;const Lz="Source Sans Pro, sans-serif";function Az(e,t){const[r,n]=m(t);r.some((e,r)=>e!==t[r])&&(n(t),e())}var kz={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 Oz=({translator:e})=>(v(()=>{!function(e){if(e&&e.get&&e.add){const t="NebulaTableUtils.MenuGroupLabel.Sorting";if(e.get(t)!==t)return;Object.keys(kz).forEach(t=>{e.add(kz[t])})}}(e)},[e]),e),qz={width:"100%",height:"100%",color:"transparent",background:"transparent",borderColor:"transparent"},Tz={border:0,boxShadow:"none",borderRadius:0,outline:0,width:0,height:0,background:"transparent",cursor:"pointer",visibility:"hidden"},Nz=fl("input",{shouldForwardProp:e=>"isLastColumn"!==e&&"hoverColor"!==e})(({isLastColumn:e,hoverColor:t,dir:r})=>({position:"absolute",display:"flex",height:"100%",top:0,marginLeft:"-4px",marginRight:"rtl"===r?"-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":{...qz},"&::-moz-range-track":{...qz},"&::-ms-track":{...qz},"&::-webkit-slider-thumb":{appearance:"none",WebkitAppearance:"none",...Tz},"&::-moz-range-thumb":{...Tz},"&::-ms-thumb":{...Tz},"&: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"}})),_z=({columnWidth:e,keyValue:t,isLastColumn:r,isPivot:n,hoverColor:o,updateWidthCallback:i,confirmWidthCallback:a,handleBlur:s,setIsAdjustingWidth:u,isLeftColumn:c,accessibilityRelatedArgs:d,direction:p="ltr"})=>{const f=Oz({translator:d.translator}),h=l({initWidth:e,columnWidth:e,initX:0}),m=r?0:1,g=n&&!c,v=()=>g?h.current.columnWidth-m:"100%",y={left:"rtl"!==p?v():void 0,right:"rtl"===p?v():void 0},b=t=>{h.current={initWidth:e,columnWidth:e,initX:t??h.current.initX}};Az(()=>{g&&b()},[e]);const x=e=>{const t=Math.max(e,xT.PixelsMin);h.current.columnWidth=t,i(t)},S=()=>{if(h.current.columnWidth!==h.current.initWidth){const e={type:ST.Pixels,pixels:h.current.columnWidth};a(e)}u?.(!1)},w=e=>{const t="rtl"===p?h.current.initWidth+h.current.initX-e.clientX:h.current.initWidth+e.clientX-h.current.initX;x(t)},C=e=>{TF(e),document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",C),S()},E=e=>{const t="rtl"===p?h.current.initWidth+-h.current.initX-e.touches[0].clientX:h.current.initWidth+e.touches[0].clientX-h.current.initX;x(t)},I=e=>{TF(e),document.removeEventListener("touchmove",E),document.removeEventListener("touchend",I),S()},D=!n&&s?e=>{if(e.key===yT.Left||e.key===yT.Right){TF(e);const t=5,r=e.key===yT.Left?t:-t,n="rtl"===p?r:-r;u?.(!0),x(h.current.columnWidth+n)}else e.key===yT.Space||e.key===yT.Enter?(TF(e),s(e),u?.(!1),S()):e.key===yT.Esc&&(TF(e),s(e),u?.(!1),x(h.current.initWidth))}:void 0,P=f.get("NebulaTableUtils.ColumnAdjuster.ColumnNameLabel",[String(d.columnLabel)]);return ii.jsx(Nz,{style:y,hoverColor:o,isLastColumn:r,className:bT,"data-testid":bT,onMouseDown:e=>{TF(e),document.addEventListener("mousemove",w),document.addEventListener("mouseup",C),u?.(!0),b(e.clientX)},onDoubleClick:()=>{a({type:ST.FitToContent})},onTouchStart:e=>{1===e.touches.length&&(TF(e),document.addEventListener("touchmove",E),document.addEventListener("touchend",I),u?.(!0),b(e.touches[0].clientX))},onKeyDown:D,onBlur:s,onFocus:()=>{b()},type:"range",tabIndex:-1,"aria-label":P,"aria-valuemin":xT.PixelsMin,"aria-valuemax":xT.PixelsMax,"aria-valuenow":Number(e.toFixed(1)),dir:p},t)},jz=x((e,t)=>ii.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:ii.jsx("path",{d:"M15 4H1V2h14zm0 10H1v-2h14zm0-5H1V7h14z"})})),Fz=fl(Qu,{shouldForwardProp:e=>"rightAligned"!==e&&"shouldShowMenuIcon"!==e&&"isAccessibleHeader"!==e})(({rightAligned:e,shouldShowMenuIcon:t,isAccessibleHeader:r})=>({...e?{marginRight:"auto"}:{marginLeft:"auto"},height:r?24:void 0,display:t?"flex":"none",fontWeight:"bold",width:r?"100%":void 0,alignItems:"center",justifyContent:"center"})),zz=fl(jz,{shouldForwardProp:e=>"isInteractionsActive"!==e})(({isInteractionsActive:e})=>({minWidth:"unset",position:"relative",cursor:e?"pointer":"default"})),Wz=fl(hp)(({theme:e})=>({".MuiList-root":{padding:e.spacing(.5,0)}})),$z=fl(Uc)(({theme:e})=>({"&.MuiDivider-root":{margin:e.spacing(.5)}})),Hz=fl(bp)(({theme:e})=>({fontSize:"12px",height:24,fontWeight:"bold",padding:`${e.spacing(.25,2)} !important`,marginBottom:e.spacing(.5)})),Vz=fl(bp,{shouldForwardProp:e=>"isSubMenu"!==e&&"isActive"!==e})(({theme:e,isSubMenu:t,isActive:r})=>({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:r?"rgba(0, 0, 0, 0.05)":"transparent"})),Bz=fl("div",{shouldForwardProp:e=>!["direction","isPagination"].includes(e)})(({theme:e,direction:t,isPagination:r})=>({position:"absolute",width:e.spacing(.5),height:16,left:0,right:r||"rtl"!==t?void 0:0,top:"50%",transform:"TranslateY(-50%)",borderRadius:"0 2px 2px 0",background:"#01873d"})),Gz=fl("div")(()=>({display:"flex",justifyContent:"space-between",alignItems:"center",maxWidth:"100%"})),Uz=fl(mu)(()=>({fontFamily:'"Source Sans Pro", HelveticaNeue, "Helvetica Neue", Helvetica, Arial, sans-serif',fontSize:"14px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"})),Yz=fl(Wd,{shouldForwardProp:e=>!["direction","isPagination"].includes(e)})(({theme:e,direction:t,isPagination:r})=>({width:16,minWidth:"unset !important",marginRight:r||"rtl"!==t?e.spacing(1.5):0,marginLeft:r||"rtl"!==t?void 0:e.spacing(1.5),lineHeight:0})),Kz=x((e,t)=>ii.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:ii.jsx("path",{d:"M8.5 8 4 3.5 5.5 2l6 6-6 6L4 12.5z"})})),Xz=e=>{const t=e.nextElementSibling;return t?"HR"===t.tagName?Xz(t):t:e.parentElement?.children?.[0]},Jz=e=>{const t=e.previousElementSibling;if(!t){const t=e.parentElement?.children?.length;return e.parentElement?.children?.[t-1]}return"HR"===t.tagName?Jz(t):t},Zz=e=>{const{key:t,currentTarget:r}=e,n=document.activeElement??r;if(t===yT.Down||t===yT.Up){const r=e=>t===yT.Down?Xz(e):Jz(e);e.preventDefault(),e.stopPropagation();let o=r(n);for(;o;){if("true"!==o.ariaDisabled){o.focus();break}o=r(o)}}},Qz=(e,t)=>e.map(e=>e.map(e=>({...e.groupHeading?{groupHeading:e.groupHeading}:{},items:e.items.map(({onClick:e,...r})=>({...r,...e?{onClick:async r=>{Object.entries(t).forEach(([,e])=>{e(!1)}),await e(r)}}:{}}))})));let eW={};const tW=({autoFocus:e,id:t,onClick:n,itemTitle:o,icon:i,enabled:a,subMenus:s,isSubMenu:l,isActive:u,direction:c,isPagination:d})=>{const[p,h]=m(!1),g=r.useRef(null),v=f(e=>{e.stopPropagation(),h(!1)},[h]);return ii.jsxs(ii.Fragment,{children:[ii.jsxs(Vz,{ref:s?g:null,"data-testid":`menu-item-${t}`,className:"nebula-table-utils-head-menu-item",onClick:async e=>{"keyup"!==e.type&&(n&&(await n(e),eW={}),s?.length&&(h(!0),eW[o]=h,e.stopPropagation()))},disabled:!a,autoFocus:e,isSubMenu:!!l,isActive:!!u,onKeyDown:Zz,children:[u?ii.jsx(Bz,{direction:c,isPagination:d}):null,ii.jsxs(Gz,{children:[ii.jsx(Yz,{direction:c,isPagination:d,children:ii.jsx(i,{})}),ii.jsx(Uz,{variant:"body2",children:o})]}),s?.length?ii.jsx(Kz,{}):null]},t),s?.length?ii.jsx(iW,{isSubMenu:!0,open:p,anchorEl:g.current,onClose:v,menuGroups:Qz(s,eW),transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"top"},direction:c,isPagination:d}):null]})},rW=({menuGroup:e,isSubMenu:t,direction:r,isPagination:n})=>e.map(e=>[[e.groupHeading&&ii.jsx(Hz,{disabled:!0,style:{opacity:1},children:e.groupHeading},e.groupHeading),e.items.map(e=>ii.jsx(tW,{...e,isSubMenu:t,direction:r,isPagination:n},e.id))].filter(Boolean)]),nW=({itemGroups:e,isSubMenu:t,direction:r,isPagination:n})=>e.map((o,i)=>[rW({menuGroup:o,isSubMenu:t,direction:r,isPagination:n}),i<e.length-1?ii.jsx($z,{"data-testid":"group-divider",variant:"middle"}):void 0]),oW={appear:0,enter:0,exit:0},iW=({anchorEl:e,open:t,onClose:r,menuGroups:n,transformOrigin:o,anchorOrigin:i,isSubMenu:a,direction:s,isPagination:l})=>n.length?ii.jsx(Wz,{className:"nebula-table-utils-head-menu",open:t,anchorEl:e,onClose:r,transitionDuration:oW,MenuListProps:{id:"nebula-table-utils-head-menu-list-id"},...i?{anchorOrigin:i}:{},...o?{transformOrigin:o}:{},dir:s,children:nW({itemGroups:n,isSubMenu:a,direction:s,isPagination:l})}):null,aW=(e,t)=>e.some(e=>t[e]>0),sW={canSelectAll:!1,canClearSelections:!1,canSelectPossible:!1,canSelectAlternative:!1,canSelectExcluded:!1},lW=({open:e,qStateName:t="$",headerData:r,app:n})=>{const[o,i]=m(null),[a,s]=m(sW);return Az(()=>{e||(s(sW),i(null))},[e]),d(()=>{if(!n?.createSessionObject||!r.isDim||!e)return()=>{};let o,a=!1;const l=()=>{o&&n.destroySessionObject(o)};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,r),u=await n.createSessionObject(e),c=await u.getLayout(),{qStateCounts:d}=c.qListObject?.qDimensionInfo??{};o=c.qInfo?.qId,a?l():(i(u),d&&s((e=>({canSelectAll:aW(["qOption","qAlternative","qExcluded","qDeselected"],e),canClearSelections:aW(["qSelected"],e),canSelectPossible:aW(["qOption"],e),canSelectAlternative:aW(["qAlternative"],e),canSelectExcluded:aW(["qAlternative","qExcluded"],e)}))(d)))}catch(e){console.error(e)}})(),()=>{a=!0,l()}},[e,n,r,t]),{fieldInstance:o,selectionActionsEnabledStatus:a}},uW=x((e,t)=>ii.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:ii.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"})})),cW=x((e,t)=>ii.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:ii.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"})})),dW=x((e,t)=>ii.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:ii.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"})})),pW=x((e,t)=>ii.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:ii.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"})})),fW=x((e,t)=>ii.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:ii.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"})})),hW=x((e,t)=>ii.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:ii.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"})})),mW=x((e,t)=>ii.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:ii.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"})})),gW=x((e,t)=>ii.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:ii.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"})})),vW=x((e,t)=>ii.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:ii.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"})})),yW=x((e,t)=>ii.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:ii.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"})})),bW=x((e,t)=>ii.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:ii.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"})})),xW=x((e,t)=>ii.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:ii.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"})})),SW=x((e,t)=>ii.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:ii.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 wW=function(e){return e.Sorting="sorting",e.Searching="searching",e.Selections="selections",e.AdjusterHeaderSize="adjustHeaderSize",e}({});const CW="/qListObjectDef",EW=({headerData:e,translator:t,menuAvailabilityFlags:r,setOpen:n,sortFromMenu:o,interactions:i,embedListbox:a,fieldInstance:s,selectionActionsEnabledStatus:l,anchorRef:u,focusColumnAdjuster:c,setActiveFieldCallback:d,expandOrCollapseArgs:p})=>{const f=[];if(r[wW.Sorting]){const{isActivelySorted:r,sortDirection:i}=e,{ascendingEnabled:a,descendingEnabled:s}=(({isActivelySorted:e,sortDirection:t,isPivot:r,isSortedByFirstMeasure:n})=>{let o=!r&&!e||"D"===t,i=!r&&!e||"A"===t;return n&&(o=!1,i=!1),{ascendingEnabled:o,descendingEnabled:i}})(e);f.push([{groupHeading:t.get("NebulaTableUtils.MenuGroupLabel.Sorting"),items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SortAscending"),onClick:async e=>{e.stopPropagation(),await(o?.(e,"A")),n(!1)},icon:uW,enabled:a,isActive:!!r&&"A"===i,autoFocus:a},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SortDescending"),onClick:async e=>{e.stopPropagation(),await(o?.(e,"D")),n(!1)},icon:pW,enabled:s,isActive:!!r&&"D"===i,autoFocus:!a&&s}]}])}if(e.isCyclic&&d){const t=[];t.push([{items:[{id:1,itemTitle:e.groupDimensionLabels[e.groupDimensionPos],enabled:!0,icon:mW,subMenus:[[{items:e.groupDimensionLabels.map((t,r)=>({id:r+1,itemTitle:t,onClick:async e=>{e.stopPropagation(),n(!1),d(r)},enabled:!0,icon:vN,isActive:e.groupDimensionPos===r}))}]]}]}]),t.length>0&&f.push(...t)}if(e.isDim&&i?.select){const o=[];r[wW.Searching]&&o.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Search"),onClick:e=>{e.stopPropagation(),n(!1),a()},icon:gW,enabled:!0}]}]),!e.isLocked&&r[wW.Selections]&&o.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Selections"),icon:SW,enabled:!!s,subMenus:[[{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectAll"),onClick:async e=>{e.stopPropagation(),n(!1),await(s?.selectListObjectAll(CW))},icon:vW,enabled:l.canSelectAll},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectPossible"),onClick:async e=>{e.stopPropagation(),n(!1),await(s?.selectListObjectPossible(CW))},icon:xW,enabled:l.canSelectPossible},{id:3,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectAlternative"),onClick:async e=>{e.stopPropagation(),n(!1),await(s?.selectListObjectAlternative(CW))},icon:yW,enabled:l.canSelectAlternative},{id:4,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectExcluded"),onClick:async e=>{e.stopPropagation(),n(!1),await(s?.selectListObjectExcluded(CW))},icon:bW,enabled:l.canSelectExcluded}]}],[{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.ClearSelections"),onClick:async e=>{e.stopPropagation(),n(!1),await(s?.clearSelections(CW))},icon:cW,enabled:l.canClearSelections}]}]]}]}]),p&&!p.alwaysFullyExpanded&&f.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Expand"),onClick:async e=>{e.stopPropagation(),e.preventDefault(),n(!1),await p.expandCallback()},icon:hW,enabled:!0},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Collapse"),onClick:async e=>{e.stopPropagation(),e.preventDefault(),n(!1),await p.collapseCallback()},icon:fW,enabled:!0}]}]),o.length>0&&f.push(...o)}return r[wW.AdjusterHeaderSize]&&f.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.AdjustColumnSize"),onClick:e=>{e.stopPropagation(),e.preventDefault(),n(!1),c?.(u)},icon:dW,enabled:!0}]}]),f},IW=({open:e,setOpen:t,anchorRef:r,headerData:n,translator:o,interactions:i,menuAvailabilityFlags:a,shouldShowMenuIcon:s=!0,sortRelatedArgs:u,searchRelatedArgs:c,selectionRelatedArgs:d,adjustHeaderSizeRelatedArgs:p,expandOrCollapseArgs:h,model:m,direction:g="ltr",isPagination:v,isAccessibleHeader:y,iconSize:b=mT})=>{const x=l(null),S=Oz({translator:o}),{qLibraryId:w,fieldId:C,headTextAlign:E}=n,I=d?.app,{fieldInstance:D,selectionActionsEnabledStatus:P}=lW({open:e,headerData:n,app:I,qStateName:d?.qStateName}),R=(({model:e,headerData:t})=>{if(e&&"setActiveField"in e&&void 0!==t.dimensionInfoIndex){const r=t.dimensionInfoIndex;return async t=>{try{await e.setActiveField("/qHyperCubeDef",r,t)}catch(e){console.error(e)}}}return null})({model:m,headerData:n}),M=(({qLibraryId:e,fieldId:t,searchRelatedArgs:r,selectionRelatedArgs:n,direction:o,onPopoverClose:i})=>f(()=>{const a=e?{qLibraryId:e,type:"dimension"}:t;if(r?.embed){const{embed:e,listboxRef:t}=r;e.__DO_NOT_USE__.popover(t.current,a,{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"rtl"===o?"right":"left"},sortCriteria:r.sortCriteria,stateName:n?.qStateName,direction:o,onPopoverClose:i})}},[e,t,r,n?.qStateName,o,i]))({qLibraryId:w,fieldId:C,searchRelatedArgs:c,selectionRelatedArgs:d,direction:g}),L=f(e=>{e.stopPropagation(),t(!1)},[t]),A=f(e=>{e.stopPropagation(),t(e=>!e)},[t]);return i.active?ii.jsxs(Fz,{rightAligned:"right"===E,shouldShowMenuIcon:s,className:"nebula-table-utils-head-menu-wrapper",onClick:!1===y?A:void 0,ref:x,isAccessibleHeader:y,children:[s?ii.jsx(zz,{height:b,className:gT,"data-testid":gT,isInteractionsActive:i.active??!1,children:ii.jsx(jz,{})}):null,ii.jsx(iW,{open:e,anchorEl:!1===y?x.current:r.current,onClose:L,menuGroups:EW({headerData:n,translator:S,menuAvailabilityFlags:a,setOpen:t,...u,embedListbox:M,interactions:i,fieldInstance:D,selectionActionsEnabledStatus:P,anchorRef:r,focusColumnAdjuster:p?.focusColumnAdjuster,setActiveFieldCallback:R,expandOrCollapseArgs:h}),direction:g,isPagination:v})]}):null},DW=e=>e.isDark?{background:e.color,borderColor:LF.DARK_MODE_BORDER,color:LF.DARK_MODE_TEXT,disabledColor:LF.DARK_MODE_DISABLED,iconColor:LF.DARK_MODE_TEXT}:{background:e.color,borderColor:LF.BORDER_MEDIUM,color:LF.TEXT,disabledColor:LF.DISABLED},PW=fl(Qu,{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}`})),RW=fl(Qp,{shouldForwardProp:e=>"footerStyle"!==e})(({footerStyle:e,theme:t})=>({background:"inherit",marginRight:t.spacing(1),color:e.color,"& .MuiNativeSelect-icon, .MuiNativeSelect-select":{color:e.iconColor}})),MW=fl(uc,{shouldForwardProp:e=>"disabledCondition"!==e&&"footerStyle"!==e})(({disabledCondition:e,footerStyle:t,theme:r})=>({color:e?t.disabledColor:t.color,cursor:e?"default":"pointer",marginLeft:r.spacing(1)})),LW=fl(mu)(({theme:e})=>({color:"inherit",margin:e.spacing(0,1,0,1)})),AW=({children:e,footerContainer:t,interactions:r,theme:n,paginationNeeded:o=!0})=>{const i=v(()=>DW(n.background),[n]);if(!r.active)return null;const a=o?ii.jsx(PW,{footerStyle:i,children:e}):null;return t?E.createPortal(e,t):a},kW=u({}),OW=()=>h(kW),qW=({children:e,direction:t,pageInfo:r,handleChangeRowsPerPage:n,footerContainer:o,isSelectionMode:i,handleChangePage:a,totalRowCount:s,totalColumnCount:l,totalPages:u,keyboard:c,translator:d,theme:p,interactions:f,rect:h,layout:m,visibilityThreshold:g})=>{const y=(e=>!e.enabled||e.active)(c)?0:-1,b=v(()=>DW(p.background),[p]),x=o?o.getBoundingClientRect().width:h.width,S=Oz({translator:d}),w=v(()=>({direction:t,pageInfo:r,handleChangeRowsPerPage:n,footerContainer:o,isSelectionMode:i,handleChangePage:a,totalRowCount:s,totalColumnCount:l,totalPages:u,keyboard:c,translator:S,theme:p,interactions:f,rect:h,layout:m,footerStyle:b,tabIndex:y,width:x,visibilityThreshold:g}),[t,r,n,o,i,a,s,l,u,c,S,p,f,h,m,b,y,x,g]);return ii.jsx(kW.Provider,{value:w,children:e})};let TW=function(e){return e.FirstPage="FirstPage",e.LastPage="LastPage",e.NextPage="NextPage",e.PreviousPage="PreviousPage",e}({}),NW=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 _W=x((e,t)=>ii.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:ii.jsx("path",{d:"m7 8 4.5 4.5L10 14 4 8l6-6 1.5 1.5z"})})),jW=x((e,t)=>ii.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:ii.jsx("path",{d:"m12 2 1.5 1.5L9 8l4.5 4.5L12 14 6 8zM4 2v12H2V2z"})})),FW=x((e,t)=>ii.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:ii.jsx("path",{d:"m3.5 2 6 6-6 6L2 12.5 6.5 8 2 3.5zM14 2v12h-2V2z"})})),zW={FirstPage:jW,PreviousPage:_W,NextPage:Kz,LastPage:FW,FirstPageRTL:FW,PreviousPageRTL:Kz,NextPageRTL:_W,LastPageRTL:jW},WW=({disabledCondition:e,pageNumber:t,type:r})=>{const{direction:n,footerStyle:o,handleChangePage:i,translator:a,interactions:s,tabIndex:l}=OW(),u=r.concat("rtl"===n?"RTL":""),c=zW[u];return{styledProps:{footerStyle:o,disabledCondition:e,size:"small","data-testid":"pagination-action-icon-button","aria-disabled":e,"aria-label":a.get(`NebulaTableUtils.Pagination.${r}`),title:s.passive?a.get(`NebulaTableUtils.Pagination.${r}`):void 0,tabIndex:l,onClick:e?void 0:()=>{i(t)}},IconComponent:c}},$W=()=>{const{pageInfo:e,width:t,interactions:r,visibilityThreshold:n}=OW(),o=0===e.page,{IconComponent:i,styledProps:a}=WW({type:TW.FirstPage,disabledCondition:o,pageNumber:0});return t<=(n?.firstPage||NW.FirstPage)?null:ii.jsx(MW,{...a,disabled:!r.active,children:ii.jsx(i,{height:mT})})},HW=(e,t,r=!1)=>{r&&e.key===yT.Tab&&!e.shiftKey&&(TF(e),((e,t,r)=>{const n=e.closest(".qv-object-wrapper")?.querySelector(".sel-toolbar-confirm")?.parentElement??document.querySelector("#qv-selection-toolbar-popover .sel-toolbar-confirm")?.parentElement;n?n.focus():t.focusSelection?.(r)})(e.target,t,!1))},VW=()=>{const{pageInfo:e,keyboard:t,totalPages:r,isSelectionMode:n,width:o,interactions:i,visibilityThreshold:a}=OW(),s=e.page>=r-1,{IconComponent:l,styledProps:u}=WW({type:TW.LastPage,disabledCondition:s,pageNumber:r-1}),c=t.enabled?e=>{HW(e,t,n)}:void 0;return o<=(a?.lastPage||NW.LastPage)?null:ii.jsx(MW,{...u,onKeyDown:c,disabled:!i.active,children:ii.jsx(l,{height:mT})})},BW=()=>{const{pageInfo:e,keyboard:t,totalPages:r,isSelectionMode:n,width:o,interactions:i}=OW(),a=e.page>=r-1,{IconComponent:s,styledProps:l}=WW({type:TW.NextPage,disabledCondition:a,pageNumber:e.page+1}),u=!(o>NW.FirstPage&&o>NW.LastPage)&&t.enabled?e=>{HW(e,t,n)}:void 0;return ii.jsx(MW,{...l,onKeyDown:u,disabled:!i.active,children:ii.jsx(s,{height:mT})})},GW=()=>{const{pageInfo:e,interactions:t}=OW(),r=0===e.page,{IconComponent:n,styledProps:o}=WW({type:TW.PreviousPage,disabledCondition:r,pageNumber:e.page-1});return ii.jsx(MW,{...o,disabled:!t.active,children:ii.jsx(n,{height:mT})})},UW=()=>{const{translator:e,width:t,pageInfo:r,totalRowCount:n,visibilityThreshold:o}=OW(),{page:i,rowsPerPage:a}=r;if(t<=(o?.displayedRowsLabel||NW.DisplayedRowsLabel))return null;const s=e.get("NebulaTableUtils.Pagination.DisplayedRowsLabel",[`${i*a+1} - ${Math.min((i+1)*a,n)}`,n.toString()]);return ii.jsx(LW,{variant:"caption",dir:"ltr",children:s})},YW=({name:e,value:t,options:r,handleChange:n})=>{const{layout:o,footerStyle:i,translator:a,tabIndex:s,interactions:l}=OW(),u=o.qInfo.qId,c=a.get(`NebulaTableUtils.Pagination.${e}`),d=`${e}-dropdown`,p=`${d}-label-${u}`,f={tabIndex:s,id:`${d}-${u}`,"data-testid":d,"aria-labelledby":p};return ii.jsxs(ii.Fragment,{children:[ii.jsxs(LW,{variant:"caption",id:p,children:[c,":"]}),ii.jsx(RW,{footerStyle:i,size:"small",native:!0,value:t,onChange:n,inputProps:f,disabled:!l.active,children:r})]})},KW=()=>{const{pageInfo:e,isSelectionMode:t,totalColumnCount:r,width:n,handleChangeRowsPerPage:o,visibilityThreshold:i}=OW();if(!(!!e.rowsPerPageOptions?.length&&!t&&n>(i?.rowsPerPage||NW.RowsPerPage)&&r<=100)||void 0===e.rowsPerPageOptions)return null;const a=ii.jsx(ii.Fragment,{children:e.rowsPerPageOptions.map(e=>ii.jsx("option",{value:e,children:e},e))});return ii.jsx(YW,{name:"RowsPerPage",value:e.rowsPerPage,options:a,handleChange:e=>{o?.(+e.target.value)}})},XW=1e3,JW="…",ZW=({totalPages:e,page:t})=>{const r=Math.min(e,XW),n=r<e&&t>500,o=n?Math.min(500+t,e):r,i=n?Math.max(0,o-XW):0,a=Array.from(Array(r).keys()).map(e=>{const t=e+i;return ii.jsx("option",{value:t,children:t+1},t)});return i>0&&a.unshift(ii.jsx("option",{value:JW,disabled:!0,children:JW},"startMoreOptions")),o<e-1&&a.push(ii.jsx("option",{value:JW,disabled:!0,children:JW},"endMoreOptions")),ii.jsx(ii.Fragment,{children:a})},QW=()=>{const{pageInfo:e,width:t,totalPages:r,handleChangePage:n,visibilityThreshold:o}=OW(),{page:i}=e;if(t<=(o?.selectPage||NW.SelectPage))return null;const a=ii.jsx(ZW,{totalPages:r,page:i});return ii.jsx(YW,{name:"SelectPage",value:i,options:a,handleChange:e=>{n(+e.target.value)}})};var e$=b(e=>ii.jsxs(qW,{...e,children:[ii.jsx(KW,{}),ii.jsx(QW,{}),ii.jsx(UW,{}),ii.jsx($W,{}),ii.jsx(GW,{}),ii.jsx(BW,{}),ii.jsx(VW,{})]}));const t$=e=>ii.jsx(AW,{...e,children:ii.jsx(e$,{...e})}),r$=u({}),n$=()=>h(r$),o$=({rect:e,pageInfo:t,qPivotDataPages:r,updatePageInfo:n,direction:o,children:i})=>{const a=v(()=>({rect:e,pageInfo:t,qPivotDataPages:r,updatePageInfo:n,direction:o}),[e,t,r,n,o]);return ii.jsx(r$.Provider,{value:a,children:i})},i$=u({}),a$=()=>h(i$),s$=({app:e,model:t,theme:r,embed:n,keyboard:o,translator:i,interactions:a,env:s,children:l})=>{const u=v(()=>({model:t,app:e,interactions:a,embed:n,theme:r,keyboard:o,env:s,translator:i}),[e,a,t,n,r,o,s,i]);return ii.jsx(i$.Provider,{value:u,children:l})},l$=u({}),u$=()=>h(l$),c$=({children:e,...t})=>ii.jsx(l$.Provider,{value:t,children:e}),d$=()=>{const{text:e,fontFamily:t,fontSize:r,justifyContent:n,alignItems:o,height:i}=(()=>{const{theme:e,translator:t}=a$(),{layoutService:r}=u$(),n=e.getStyle("","","fontFamily")??BF;return r.hasData?r.hasLimitedData?{text:t.get("SNPivotTable.LimitedData"),fontSize:"13px",fontFamily:n,alignItems:"center",height:"22px"}:{}:{text:t.get("SNPivotTable.NoData"),fontSize:"16px",fontFamily:n,justifyContent:"center",alignItems:"center",height:"100%"}})();return void 0===e?null:ii.jsx("div",{style:{display:"flex",justifyContent:n,alignItems:o,width:"100%",height:i},children:ii.jsx("span",{style:{...ez,fontFamily:t,fontSize:r,fontStyle:"italic",color:"#7b7a78"},children:e})})},p$="/qHyperCubeDef",f$=-1,h$="PSEUDO-DIM",m$=e=>e===f$?h$:(({cId:e})=>e??BN())(e),g$=({layoutService:e,visibleLeftDimensionInfos:t,cell:r,colIdx:n})=>{r&&(r.canBeResized=!0,r.colIdx=r.colIdx||n,r.dimensionInfoIndex===f$?r.columnWidthLocation=gF.Measures:r.isLeftDimension?r.columnWidthLocation=gF.Dimension:t.at(-1)===f$?r.columnWidthLocation=gF.Measures:e.hasPseudoDimOnLeft&&(r.columnWidthLocation=gF.Pivot))},v$=(e,t,r,n)=>{const o=m$(r),i=e.getDimensionInfoIndex(r),a=e.isLeftDimension(i);return r===f$?{id:o,colIdx:-1,label:"",sortDirection:"A",fieldId:"",isLocked:!1,isDim:!1,isCyclic:!1,groupDimensionPos:0,groupDimensionLabels:[],headTextAlign:"left",dimensionInfoIndex:i,canBeResized:!1,isLeftDimension:a,isLastDimension:n,columnWidthLocation:gF.Measures,isPivot:!0,qEffectiveDimensionName:void 0}:{id:o,colIdx:0,label:r.qFallbackTitle,qReverseSort:r.qReverseSort,sortDirection:r.qSortIndicator&&"N"!==r.qSortIndicator?r.qSortIndicator:"A",qLibraryId:r.qLibraryId,fieldId:r.qGroupFieldDefs[r.qGroupPos],isLocked:r.qLocked??!1,columnWidth:r.columnWidth,qApprMaxGlyphCount:r.qApprMaxGlyphCount,isDim:!0,isCyclic:r.qGrouping===ET.Cyclic,groupDimensionPos:r.qGroupPos,groupDimensionLabels:r.qGroupFallbackTitles,headTextAlign:"left",dimensionInfoIndex:i,canBeResized:!1,isLeftDimension:a,isLastDimension:n,columnWidthLocation:gF.Dimension,isPivot:!0,isSortedByFirstMeasure:t.isSortedByFirstMeasure,qEffectiveDimensionName:r.qEffectiveDimensionName}},y$=({layoutService:e,effectivePropertiesService:t,lastRow:r,lastCol:n})=>{let o=n;var i;r.length>0&&(o=(i=n).at(-1)===f$?i.slice(0,-1):i);const a=o.length+(r.length?1:0),s=Math.max(1,r.length),l=((e,t)=>Array(e).fill(null).map(()=>Array.from({length:t},()=>null)))(a,s);return r.forEach((r,n,o)=>{const i=n===o.length-1;l[a-1][n]=v$(e,t,r,i)}),o.forEach((r,n,o)=>{const i=n===o.length-1;l[n][s-1]=v$(e,t,r,i)}),l},b$=(e,t,r,n)=>{const o=((e,t,r,n)=>{let o;return o=0===r.length||r.includes(f$)?y$({layoutService:e,effectivePropertiesService:t,lastRow:n,lastCol:r}):(e=>e[0].map((t,r)=>e.map(e=>e[r])))(y$({layoutService:e,effectivePropertiesService:t,lastRow:r,lastCol:n})),e.isIndentModeEnabled&&o[o.length-1].length>1&&(o[o.length-1]=[o.at(-1),...new Array(o[0]?o[0].length-1:0).fill(null)]),o.length&&o.at(-1)?.forEach((t,r)=>{Array.isArray(t)?t.forEach((t,r)=>{g$({layoutService:e,visibleLeftDimensionInfos:n,cell:t,colIdx:r})}):g$({layoutService:e,visibleLeftDimensionInfos:n,cell:t,colIdx:r})}),o})(e,t,r,n);return{data:o,size:{x:o[0]?.length??0,y:o.length}}};var x$={fromSearchString:function(e){if(!e)return[];"?"===e[0]&&(e=e.substr(1));const t=[];return e.split("&").forEach(e=>{if(!e)return;const r=e.indexOf("=");let n,o="",i=!1;-1===r?n=e:(n=e.slice(0,r),o=e.slice(r+1),i=!0),t.push(function(e,t,r){return{key:w$(e),value:w$(t.replace(/%2B/g,"shouldNotDecodePlus")),useEqualSign:r}}(n,o,i))}),t}},S$=x$;function w$(e){try{return decodeURIComponent(e)}catch{return e}}function C$(e){if(!(this instanceof C$))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 r=e.indexOf("#");-1!==r&&(t.hash=e.substr(r),e=e.substr(0,r));r=e.indexOf("?"),-1!==r&&(t.search=e.substr(r),e=e.substr(0,r));return t.authorityAndPath=e,t}(e);Object.defineProperties(this,{authorityAndPath:{value:t.authorityAndPath},search:{value:t.search},hash:{value:t.hash},searchParams:{get:()=>S$.fromSearchString(t.search)}})}function E$(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/shouldNotDecodePlus/gi,"%2B")}C$.encodeAuthorityAndPath=function(e){return encodeURI(e).replace(/%5B/gi,"[").replace(/%5D/gi,"]").replace(/%25/gi,"%")},C$.encodeSearchParams=function(e){let t,r="";for(let n=0;n<e.length;n++)t=e[n],r+=0===n?"?":"&",r+=E$(t.key),t.value?r+=`=${E$(t.value)}`:r+=t.useEqualSign?"=":"";return r};var I$=C$;var D$,P$=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}},R$=class{decode(e){let t="";const r=new P$(e);let n;for(;r.hasNext();)n=this.decodeCharacter(r),t+=null!=n?n:r.next();return t}decodeCharacter(e){return e.next()}},M$=e=>e>=0&&e<=1114111,L$=e=>e.match(/[\s]/),A$=class extends R${decodeCharacter(e){e.mark();const t=e.next();let r,n,o;if(null==t||"\\"!==t)return e.reset(),null;const i=e.next();if(null==i)return e.reset(),null;switch(i){case"\r":e.peek("\n")&&e.next();case"\n":case"\f":case"\0":return this.decodeCharacter(e)}if("NaN"===parseInt(i,16))return i;for(r=i,n=0;n<5&&(o=e.next(),null!=o&&!L$(o));n++){if("NaN"===parseInt(o,16)){e.pushback(o);break}r+=o}const a=parseInt(r,16);return M$(a)?String.fromCharCode(a):"�"}},k$=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,r,n=arguments[0];return"string"==typeof arguments[1]?(t=arguments[1],r=n.length):(r=arguments[1],t=arguments[2]),t&&n?(n.length>r&&(n=n.substr(0,r)),new e(n,t)):null}},O$=class e{setValue(e){this._nextMap=null,this._value=e}getNextNode(e){return this._nextMap?this._nextMap[e]:null}put(t,r,n){let o,i;if(t.length===r)return i=this._value,this.setValue(n),i;const a=t.charAt(r);return this._nextMap?(o=this._nextMap[a],o||(o=new e,this._nextMap[a]=o)):(this._nextMap={},o=new e,this._nextMap[a]=o),o.put(t,r+1,n)}get(e,t){if(e.length<=t)return this._value;const r=this.getNextNode(e.charAt(t));return r?r.get(e,t+1):null}getLongestMatch(e,t){if(e.length<=t)return k$.newInstanceIfNeeded(e,this._value);const r=this.getNextNode(e.charAt(t));if(!r)return k$.newInstanceIfNeeded(e,t,this._value);const n=r.getLongestMatch(e,t+1);return n||k$.newInstanceIfNeeded(e,t,this._value)}},q$=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 O$);const r=this.root.put(e,0,t);return r||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}},T$=(()=>{const e=[],t=[],r=new q$;let n,o,i;for(n in e["&quot"]="34",e["&amp"]="38",e["&lt"]="60",e["&gt"]="62",e["&nbsp"]="160",e["&iexcl"]="161",e["&cent"]="162",e["&pound"]="163",e["&curren"]="164",e["&yen"]="165",e["&brvbar"]="166",e["&sect"]="167",e["&uml"]="168",e["&copy"]="169",e["&ordf"]="170",e["&laquo"]="171",e["&not"]="172",e["&shy"]="173",e["&reg"]="174",e["&macr"]="175",e["&deg"]="176",e["&plusmn"]="177",e["&sup2"]="178",e["&sup3"]="179",e["&acute"]="180",e["&micro"]="181",e["&para"]="182",e["&middot"]="183",e["&cedil"]="184",e["&sup1"]="185",e["&ordm"]="186",e["&raquo"]="187",e["&frac14"]="188",e["&frac12"]="189",e["&frac34"]="190",e["&iquest"]="191",e["&Agrave"]="192",e["&Aacute"]="193",e["&Acirc"]="194",e["&Atilde"]="195",e["&Auml"]="196",e["&Aring"]="197",e["&AElig"]="198",e["&Ccedil"]="199",e["&Egrave"]="200",e["&Eacute"]="201",e["&Ecirc"]="202",e["&Euml"]="203",e["&Igrave"]="204",e["&Iacute"]="205",e["&Icirc"]="206",e["&Iuml"]="207",e["&ETH"]="208",e["&Ntilde"]="209",e["&Ograve"]="210",e["&Oacute"]="211",e["&Ocirc"]="212",e["&Otilde"]="213",e["&Ouml"]="214",e["&times"]="215",e["&Oslash"]="216",e["&Ugrave"]="217",e["&Uacute"]="218",e["&Ucirc"]="219",e["&Uuml"]="220",e["&Yacute"]="221",e["&THORN"]="222",e["&szlig"]="223",e["&agrave"]="224",e["&aacute"]="225",e["&acirc"]="226",e["&atilde"]="227",e["&auml"]="228",e["&aring"]="229",e["&aelig"]="230",e["&ccedil"]="231",e["&egrave"]="232",e["&eacute"]="233",e["&ecirc"]="234",e["&euml"]="235",e["&igrave"]="236",e["&iacute"]="237",e["&icirc"]="238",e["&iuml"]="239",e["&eth"]="240",e["&ntilde"]="241",e["&ograve"]="242",e["&oacute"]="243",e["&ocirc"]="244",e["&otilde"]="245",e["&ouml"]="246",e["&divide"]="247",e["&oslash"]="248",e["&ugrave"]="249",e["&uacute"]="250",e["&ucirc"]="251",e["&uuml"]="252",e["&yacute"]="253",e["&thorn"]="254",e["&yuml"]="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["&notin"]="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[n]&&e.hasOwnProperty(n)&&(t[e[n]]=n);for(o in t)"function"!=typeof t[o]&&t.hasOwnProperty(o)&&(i=t[o].toLowerCase().substr(1),r.put(i,String.fromCharCode(o)));return r})(),N$=class extends R${decodeCharacter(e){let t;e.mark();const r=e.next();if(null==r||"&"!==r)return e.reset(),null;const n=e.next();if(null==n)return e.reset(),null;if("#"===n){if(t=this._getNumericEntity(e),null!=t)return t}else if(n.match(/[A-Za-z]/)&&(e.pushback(n),t=this._getNamedEntity(e),null!=t))return t;return e.reset(),null}_getNamedEntity(e){let t,r,n,o="";for(t=Math.min(e.remainder().length,T$.getMaxKeyLength()),n=0;n<t;n++)o+=e.next().toLowerCase();const i=T$.getLongestMatch(o);if(null==i)return null;for(e.reset(),e.next(),t=i.getKey().length,r=0;r<t;r++)e.next();return e.peek(";")&&e.next(),i.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,r="";for(;e.hasNext();){if(t=e.peek(),Number.isNaN(+parseInt(t,16))){if(";"===t){e.next();break}break}r+=t,e.next()}const n=parseInt(r,16);return!Number.isNaN(+n)&&M$(n)?String.fromCharCode(n):null}_parseNumber(e){let t,r="";for(;e.hasNext();){if(t=e.peek(),Number.isNaN(+parseInt(t,10))){if(";"===t){e.next();break}break}r+=t,e.next()}const n=parseInt(r,10);return!Number.isNaN(+n)&&M$(n)?String.fromCharCode(n):null}},_$=class extends R${decodeCharacter(e){e.mark();const t=e.next();let r,n,o,i;if(null==t)return e.reset(),null;if("%"!==t)return e.reset(),null;for(r="",n=0;n<2;n++)o=e.nextHex(),null!=o&&(r+=o);return 2===r.length&&(i=parseInt(r,16),M$(i))?String.fromCharCode(i):(e.reset(),null)}},j$=/^data:(?<!\s)\s*(image\/[\w+-.]+)(?<!\s)\s*(;.*?){0,1}(?<!\s)\s*,(.*)/i,F$=5e6,z$=5e5,W$=(e,t)=>{const{maxByteSizeSvg:r=z$,maxByteSizeImage:n=F$}=t??{},{mimeType:o,encoding:i,data:a}=(e=>{const[,t,r,n]=j$.exec(e.trim())??[];return{encoding:r,data:n,mimeType:t?.toLocaleLowerCase()}})(e);if(!a)return!0;const s=((e,t,r)=>{const n={type:e};if(t?.includes(";base64"))try{return new Blob([atob(r)],n).size}catch{return new Blob([r],n).size}return"image/svg+xml"===e?new Blob([r],n).size:0})(o,i,a);return"image/svg+xml"===o?s<=r:s<=n};"undefined"!=typeof document&&(D$=document.createElement("div"));var $$=Array.prototype.indexOf,H$=[",",".","_"," "],V$=[",",".","-","_"," "],B$={width:["%"],height:["%"]},G$={default:["-"," ","%"],color:["#"," ","(",")"],image:["(",")",":","/","?","&","-",".",'"',"="," "]},U$={background:["(",")",":","%","/","?","&","-"," ",".",'"',"=","#"],"background-image":G$.image,"background-color":G$.color,"border-color":G$.color,"border-image":G$.image,color:G$.color,icon:G$.image,"list-style-image":G$.image,"outline-color":G$.color},Y$={attr_name:["^on[a-z]{1,}","style","href","src"],attr_val:["javascript:","data:"],css_key:["behavior","-moz-behavior","-ms-behavior"],css_val:["expression"]};function K$(e,t,r){let n;if(t){if($$)return $$.call(t,e,r);for(n=t.length,r=r?r<0?Math.max(0,n+r):r:0;r<n;r++)if(r in t&&t[r]===e)return r}return-1}function X$(e){if(null==e)return"";let t="";const r=document.createTextNode(e);return D$.appendChild(r),t=D$.innerHTML,D$.removeChild(r),t}function J$(e,t,r){let n,o,i,a,s,l,u,c,d;for(e=Q$(e).toLowerCase(),t=Q$(t),i=0;i<Y$.attr_name.length;i++)if(e.match(Y$.attr_name[i]))throw new Error(`Unsafe attribute name used: ${e}`);for(i=0;i<Y$.attr_val.length;i++)if(t.toLowerCase().match(Y$.attr_val[i]))throw new Error(`Unsafe attribute value used: ${t}`);if(n=B$[e],n||(n=V$),o="",!r){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");o+=s}o+='="'}for(l=0;l<t.length;l++)u=t.charAt(l),c=t.charCodeAt(l),!u.match(/[a-zA-Z0-9]/)&&K$(u,n)<0?(d=c.toString(16),o+=`&#x${d};`):o+=u;return r||(o+='"'),o}function Z$(e,t,r){let n,o,i,a,s,l,u,c,d,p;if(e=Q$(e).toLowerCase(),t=Q$(t),K$(e,Y$.css_key)>=0)throw new Error(`Unsafe property name used: ${e}`);for(n=0;n<Y$.css_val.length;n++)if(t.toLowerCase().indexOf(Y$.css_val[n])>=0)throw new Error(`Unsafe property value used: ${t}`);if(o=U$[e],o||(o=G$.default),i="",!r){for(a=0;a<e.length;a++){if(s=e.charAt(a),!s.match(/[a-zA-Z-]/))throw new Error("Invalid Property Name specified");i+=s}i+=": "}for(l=0;l<t.length;l++)u=t.charAt(l),c=t.charCodeAt(l),!u.match(/[a-zA-Z0-9]/)&&K$(u,o)<0?(d=c.toString(16),p="000000".substr(d.length),i+=`\\${p}${d}`):i+=u;return i}function Q$(e,t){let r,n,o,i,a=!1;if(null===e)return null;r=e,n=e,o=0;const s=[new N$,new _$,new A$];for(;!a;){n=r;for(let e=0;e<s.length;e++)i=s[e].decode(r),i!==r&&(o++,r=i);n!==r||(a=!0)}if(t&&o>1)throw new Error("Attack Detected - Multiple/Double Encodings used in input");return r}var eH=[];for(let e=0;e<255;e++)eH[e]=e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122?null:e.toString(16);var tH={html:e=>X$(e.unsafe),css(e){let t,r=[];const n=[],o={};let i="";for(t in e.map?r=e.map:r[e.name]=e.unsafe,r)"function"!=typeof r[t]&&r.hasOwnProperty(t)&&(n[t]=Z$(t,r[t],!0),i+=Z$(t,r[t],!0),o[t]=n[t]);return e.map?o:i},attr(e){let t=[];const r=[],n={};let o="";e.map?t=e.map:t[e.name]=e.unsafe;for(const e in t)"function"!=typeof t[e]&&t.hasOwnProperty(e)&&(r[e]=J$(e,t[e],!0),o+=J$(e,t[e],!0),n[e]=r[e]);return e.map?n:o}};function rH(e,t){throw new Error(t)}var nH={canonicalize:Q$,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,r;const n=arguments[0]||{};let o=1;const i=arguments.length;for(;o<i;o++)if(null!=(e=arguments[o]))for(t in e)if(e.hasOwnProperty(t)){if(r=e[t],n===r)continue;void 0!==r&&(n[t]=r)}}(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?tH.html(e):"css"===e.context?(null!=e.map&&"object"!=typeof e.map&&rH(this,"Invalid parameter type"),tH.css(e)):"attr"===e.context?(null!=e.map&&"object"!=typeof e.map&&rH(this,"Invalid parameter type"),tH.attr(e)):void rH(this,"Invalid parameter type")},encodeForAttr:J$,encodeForAttr2:function(e){return J$("nonsens",e,!0)},encodeForCSS:Z$,encodeForHref:function(e){Q$(e),0!==e.search("[a-zA-Z0-9]+:")&&(e=`http://${e}`);const t=new I$(e),r=I$.encodeAuthorityAndPath(t.authorityAndPath),n=t.searchParams;e=r+I$.encodeSearchParams(n)+t.hash;const o=decodeURI(e).toLowerCase();if(-1!==o.indexOf("javascript:"))throw new Error("Attack Detected - Javascript in input");if(-1!==o.indexOf("data:"))throw new Error("Attack Detected - data in input");return e},encodeForJS:function(e,t){let r,n,o,i,a,s;for(t||(t=H$),s="",r=0;r<e.length;r++)o=e.charAt(r),i=e.charCodeAt(r),K$(o,t)>=0||null==eH[i]?s+=o:(n=i.toString(16),i<256?(a="00".substr(n.length),s+=`\\x${a}${n.toUpperCase()}`):(a="0000".substr(n.length),s+=`\\u${a}${n.toUpperCase()}`));return s},encodeForHTML:X$,encodeForURL:function(e,t){let r="";return t&&(t.match(/^[A-Za-z\-0-9]{1,}$/)?r+=Q$(t).toLowerCase():rH(this,"Illegal Attribute Name Specified"),r+='="'),r+=encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A"),r+=t?'"':"",r},isSafeDataURL:W$,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 r=function(e){let t=e,r="";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=r.lastIndexOf("/");-1!==e&&(r=r.slice(0,e))}else if("/.."===t){t="/";const e=r.lastIndexOf("/");-1!==e&&(r=r.slice(0,e))}else if("."===t||".."===t)t="";else{const e=t.match(/^\/?[^/]*/),n=e?e[0]:"";t=t.slice(n.length),r+=n}return r}(t);return""!==r&&"/"!==r&&r}};const oH=(e,t)=>t.qAttrExps?.qValues?.[e],iH=(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"}}},aH=({text:e,url:t,imageSize:r,imagePosition:n,labelStructure:o,imageBox:i,direction:a})=>!n||t&&(t.toLowerCase().includes("javascript:")||!nH.isSafeDataURL(t))?{type:uF.Text,url:void 0,text:e,labelStructure:o}:{type:uF.Image,url:t||"",text:e,imageSize:r,resolvedImagePosition:iH(n,a),labelStructure:o,imageBox:i},sH=(e,t,r,n)=>{if(!e.qMiniChart||!t?.miniChart||!r)return{type:uF.Text,text:n};const{minY:o,maxY:i}=((e,t,r)=>{const n="global"===t.yAxis?.scale,o="zeroCenter"===t.yAxis?.position,i=n?r.qYMin:e.qMiniChart.qMin,a=n?r.qYMax:e.qMiniChart.qMax;if(o){const e=Math.max(Math.abs(i),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,i),maxY:Math.max(0,a)}:{minY:i,maxY:a}})(e,t.miniChart,r),a={type:t.miniChart.type,qMatrix:e.qMiniChart.qMatrix,minY:o,maxY:i,showDots:!!t.miniChart.showDots,colors:t.miniChart.colors,colorMin:e.qMiniChart.qMin,colorMax:e.qMiniChart.qMax};return{type:uF.MiniChart,text:n,miniChart:a}},lH=(e,t,r)=>{const n=Array.isArray(t.qAttrExps)?t.qAttrExps[0]:t.qAttrExps,o=n?.qValues?.[e];if(o){const e=Number.isNaN(+o.qNum)?void 0:`${o.qNum}`;return o.qText||e}return r?.urlPosition===cF.Attribute?void 0:r?.urlLabel},uH=({labelStructure:e,text:t,url:r})=>{try{if(!r)throw Error("Invalid url");return{type:uF.Link,url:nH.encodeForHref(r),text:t,labelStructure:e}}catch{return{type:uF.Text,url:void 0,text:t,labelStructure:e}}},cH=({cell:e,representationProperties:t,attrExprInfoIndex:r,env:n,conditionalColoring:o,miniChartOnMeasure:i,labelStructure:a,getText:s=e=>e.qText,direction:l,enabledFeatures:u})=>{const c=dF(t),d=s(e);return c===uF.Image&&u[uF.Image]&&!n.anything.sense?.isUnsupportedFeature?.("tableImages")?((e,t,r,n,o,i)=>{const{imageSize:a,imagePosition:s,imageSetting:l,imageLabel:u,imageBox:c}=t??{};if("url"===l){const t=oH(r.imageUrl??-1,e)?.qText;return i&&(i.maskedValue=t??""),aH({text:n,url:t,imageSize:a,imagePosition:s,labelStructure:i,imageBox:c,direction:o})}if("label"===l){const t=i?i.originalValue:n;if(-1===r.imageLabel)return aH({text:u||t||"",url:t,imageSize:a,imagePosition:s,labelStructure:i,imageBox:c,direction:o});const l=oH(r.imageLabel??-1,e)?.qText??n;return aH({text:l,url:t,imageSize:a,imagePosition:s,labelStructure:i,imageBox:c,direction:o})}return{type:uF.Text,url:void 0,labelStructure:i,text:n}})(e,t,r,d,l,a):c===uF.Link?((e,t,r,n,o)=>{const{urlPosition:i}=t??{};if(i===cF.Attribute){const i=lH(r.url??-1,e,t);return uH({labelStructure:n,text:o||i||"",url:i})}if(i===cF.Dimension){const i=lH(r.urlLabel??-1,e,t)||o;return n&&(n.maskedValue=i),uH({text:i,labelStructure:n,url:n?.originalValue??o})}return{type:uF.Text,url:void 0,text:o,labelStructure:n}})(e,t,r,a,d):c===uF.Indicator&&u[uF.Indicator]&&!n.anything.sense?.isUnsupportedFeature?.("tableIndicators")?((e,t,r)=>{const{indicator:n}=e??{};return{type:uF.Indicator,url:void 0,text:r,indicator:{applySegmentColors:n?.applySegmentColors,position:n?.position,showTextValues:n?.showTextValues},indicatorConditionalColoring:t}})(t,o,d):c===uF.MiniChart&&u[uF.MiniChart]&&!n.anything.sense?.isUnsupportedFeature?.("qMiniChartDef")?sH(e,t,i,d):{type:uF.Text,url:void 0,text:d,labelStructure:a}},dH=(e,t)=>{const r=t.qAttrExps,n=r?.qValues?.[e?.cellForegroundColor??-1]?.qText,o=r?.qValues?.[e?.cellBackgroundColor??-1]?.qText,i=o?qF(o):null,a=n?qF(n):null,s=((e,t)=>e||!t?null:AF(t))(a,i);return{color:s??a,background:i}},pH=(e,t)=>t.qSubNodes.reduce((e,t)=>0===t.qSubNodes.length?e+1:pH(e,t),e),fH=(e,t,r,n,o,i)=>{const a=o?i.rowsPerPage-r:UF-n;let s=e.qUp+e.qDown;if(o&&0===r){const r=(t+e.qUp)%i.rowsPerPage;s=e.qDown+r}return Math.min(a,pH(s,e))},hH=({node:e,parent:t,root:r,x:n,y:o,pageY:i,layoutService:a,dimensionInfo:s,attrExprInfoIndex:l,isLeftColumn:u=!0,isIndentModeEnabled:c=!1,indentLevel:d,labelStructure:p,env:f,pageInfo:h,direction:m="ltr"})=>{const g=(!c||!u)&&"P"===e.qType,v=((e,t)=>{if(e!==f$){if(t){const t=dF(e.representation);return t===uF.Link||t===uF.Image?e.representation:{type:uF.Text}}return e.representation}})(s,c),y=(({node:e,isLeftColumn:t,isIndentModeEnabled:r,labelStructure:n,representationType:o,parentOrRootOriginalValue:i})=>{let a=e.qText;if(t&&r&&n){const{originalValue:t,delimeter:r,suffix:s}=n;a=o===uF.Link?"P"===e.qType?i:t:`${t} ${!s||!t&&s?"":r} ${s}`.trim()}return a})({node:e,isLeftColumn:u,isIndentModeEnabled:c,labelStructure:p,representationType:dF(v),parentOrRootOriginalValue:(t||r)?.representation?.labelStructure?.originalValue??""}),b=cH({cell:{...e,qText:y},representationProperties:v,attrExprInfoIndex:l,env:f,labelStructure:p,direction:m,enabledFeatures:{[uF.Image]:!0,[uF.Indicator]:!0}}),x={id:BN(),ref:e,x:n,y:o,pageX:n,pageY:i,mainAxisPageCoord:u?i:n,isLeftColumn:u,parent:t,root:r,children:[],isLeafNode:0===e.qSubNodes.length,leafCount:fH(e,o,i,n,u,h),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:dH(l,e),selectionCellType:u?"L":"T",dimensionInfoIndex:a.getDimensionInfoIndex(s),canBeResized:0===e.qSubNodes.length&&!u,visibleMeasureInfoIndex:g?e.qElemNo:t?.visibleMeasureInfoIndex,representation:b,...void 0!==d&&{indentLevel:d}};return t&&(t.children[x.mainAxisPageCoord-t.mainAxisPageCoord]=x),x},mH=(e,t,r,n,o,i,a,s,l)=>{const{isIndentModeEnabled:u}=o;if(!t.length)return e;let c=0;return function t(d,p,f,h=0,m=-1){e[h]||(e[h]={}),u&&m++;const g=o.leftDimensionInfoIndexes.indexOf(f$);f.forEach((f,v)=>{const y={originalValue:f.qText??"",maskedValue:"",delimeter:"-",suffix:""};c+=0===v?0:1;const b=r.qTop-n.page*n.rowsPerPage,x=Math.max(0,b+c-f.qUp),S=r.qTop+c-f.qUp;if(u){if(o.hasPseudoDimOnLeft&&m<=g)if(y.originalValue=f.qText??"",y.maskedValue=f.qText??"","N"===f.qType||"U"===f.qType||"T"===f.qType)"U"===f.qType&&(y.originalValue=o.getNullValueText()),m<g&&(y.suffix=o.visibleMeasureInfo[0].qFallbackTitle);else if("P"===f.qType){y.originalValue=(p||d)?.representation.labelStructure?.originalValue??"",y.maskedValue=(p||d)?.representation.labelStructure?.originalValue??"",y.suffix=f.qText??"";const e=f.qSubNodes;f={...(p||d)?.ref,...f.qText?{qText:f.qText}:{},qSubNodes:e},m=(p||d)?.indentLevel??0}"U"===f.qType&&(y.originalValue=o.getNullValueText())}let w=h;u&&(w=g>=1&&m>=g?m+1:m,0===m&&0===g&&0===f.qSubNodes.length&&(w=0));const C=e.at(h)?.[x],E=u&&void 0===C?.ref.qText||!C?hH({node:f,parent:p,root:d,x:w,y:S,pageY:x,layoutService:o,dimensionInfo:i[w],attrExprInfoIndex:a[w],isLeftColumn:!0,...u&&{isIndentModeEnabled:u,indentLevel:m},env:s,pageInfo:n,labelStructure:y,direction:l}):e[h][x];if(e[h][x]=E,f.qSubNodes.length){const e=u?0:h+1;t(d||E,E,f.qSubNodes,e,m)}})}(null,null,t,0,-1),e},gH=(e,t)=>{e.slice(0,-1).forEach(e=>{Object.values(e).forEach((e,r,n)=>{const o=n.at(r+1);e.distanceToNextCell=o?o.mainAxisPageCoord-(e.mainAxisPageCoord+e.leafCount):t-(e.mainAxisPageCoord+e.leafCount)})})},vH=(e,t)=>{const r=e[0],n=r?Object.values(r):[],o=t?.isIndentModeEnabled&&t.hasPseudoDimOnLeft?t.visibleMeasureInfo.length-1:0,i=r?.[o],a=n.at(-1);return i?.isTotal?i.isLeafNode?i.mainAxisPageCoord:i.mainAxisPageCoord+i.leafCount-1:a?.isTotal?a.mainAxisPageCoord-1:-1},yH=({prevData:e,nextDataPage:t,pageInfo:r,layoutService:n,visibleLeftDimensionInfo:o,attrExprInfoIndexes:i,env:a,direction:s})=>{const{qLeft:l,qArea:u}=t;if(!l.length)return e;const c=mH(e.grid,l,u,r,n,o,i,a,s);gH(c,r.rowsOnCurrentPage);const d=vH(c,n);return{...e,grid:c,columnCount:c.length,totalDividerIndex:d}},bH=({qArea:e,prevData:t,pivotValuePoints:r,pageInfo:n})=>{const o=[...t];return r.forEach((t,r)=>{t.forEach((t,i)=>{const a=e.qTop-n.page*n.rowsPerPage+r,s=e.qLeft+i;Array.isArray(o[a])||(o[a]=[]);const l="U"===t.qType;o[a][s]=o[a][s]??{id:BN(),ref:t,isNull:l}})}),o},xH=({prevData:e,dataPage:t,pageInfo:r})=>{const{qData:n,qArea:o}=t;return n?.length?bH({qArea:o,prevData:e,pivotValuePoints:n,pageInfo:r}):e},SH=(e,t,r,n,o,i,a,s,l,u)=>{const{isIndentModeEnabled:c}=n;if(!t.length)return e;let d=0;!function t(a,p,f,h=0){e[h]||(e[h]={}),f.forEach((f,m)=>{d+=0===m?0:1;const g=r.qLeft+d-f.qUp,v=e[h][g]??hH({node:f,parent:p,root:a,x:g,y:h,pageY:h,layoutService:n,dimensionInfo:o[h],attrExprInfoIndex:i[h],isLeftColumn:!1,...c&&{isIndentModeEnabled:c},env:s,pageInfo:l,direction:u});e[h][g]=v,f.qSubNodes.length&&t(a||v,v,f.qSubNodes,h+1)})}(null,null,t);for(let t=0;t<a-e.length;t++)e.push({});return e},wH=({prevData:e,nextDataPage:t,layoutService:r,visibleTopDimensionInfo:n,attrExprInfoIndexes:o,headerRows:i,env:a,pageInfo:s,direction:l})=>{const{qTop:u,qArea:c}=t;if(!u.length)return e;const d=SH(e.grid,u,c,r,n,o,i,a,s,l);gH(d,r.size.x);const p=vH(d);return{...e,grid:d,rowCount:d.length,totalDividerIndex:p}},CH=e=>-1===e?{}:e.qAttrExprInfo.reduce((e,{id:t},r)=>(e[t]=r,e),{}),EH=(e,t)=>{const{env:r}=a$(),{direction:n}=n$(),{layoutService:o,effectivePropertiesService:i}=u$(),{qPivotDataPages:a,pageInfo:s}=n$(),[l,u]=m(null),c=((e,t,r)=>v(()=>({left:e.map(CH),top:t.map(CH),measures:r.map(CH)}),[r,e,t]))(e,t,o.visibleMeasureInfo),d=v(()=>b$(o,i,t,e),[o,i,t,e]),p=f(()=>a.slice(1).reduce((e,t)=>xH({prevData:e,dataPage:t,pageInfo:s}),((e,t)=>{const{qData:r,qArea:n}=e;return bH({qArea:n,prevData:[],pivotValuePoints:r,pageInfo:t})})(a[0],s)),[a,s]),h=f(()=>a.slice(1).reduce((e,i)=>wH({prevData:e,nextDataPage:i,layoutService:o,visibleTopDimensionInfo:t,attrExprInfoIndexes:c.top,headerRows:d.size.y,env:r,pageInfo:s,direction:n}),((e,t,r,n,o,i,a,s)=>{const{qArea:l,qTop:u}=e,c=SH([],u,l,t,r,n,o,i,a,s);gH(c,t.size.x);const d=vH(c);return{grid:c,rowCount:c.length,layoutSize:t.size,totalDividerIndex:d}})(a[0],o,t,c.top,d.size.y,r,s,n)),[a,o,t,c.top,d.size.y,r,s,n]),g=f(()=>a.slice(1).reduce((t,i)=>yH({prevData:t,nextDataPage:i,pageInfo:s,layoutService:o,visibleLeftDimensionInfo:e,attrExprInfoIndexes:c.left,env:r,direction:n}),((e,t,r,n,o,i,a)=>{const{qArea:s,qLeft:l}=e,u=mH([],l,s,r,t,n,o,i,a);gH(u,r.rowsOnCurrentPage);const c=vH(u,t);return{grid:u,columnCount:u.length,layoutSize:t.size,totalDividerIndex:c}})(a[0],o,s,e,c.left,r,n)),[a,o,s,e,c,r,n]),[y,b]=m(()=>p()),[x,S]=m(()=>h()),[w,C]=m(()=>g());Az(()=>{b(p())},[p]),Az(()=>{S(h())},[h]),Az(()=>{C(g())},[g]),Az(()=>{l&&l.forEach(i=>{b(e=>xH({prevData:e,dataPage:i,pageInfo:s})),S(e=>wH({prevData:e,nextDataPage:i,layoutService:o,visibleTopDimensionInfo:t,attrExprInfoIndexes:c.top,headerRows:d.size.y,env:r,pageInfo:s,direction:n})),C(t=>yH({prevData:t,nextDataPage:i,pageInfo:s,layoutService:o,visibleLeftDimensionInfo:e,attrExprInfoIndexes:c.left,env:r,direction:n}))})},[l]);const E=f(e=>{u(e)},[]);return{headersData:d,measureData:y,topDimensionData:x,leftDimensionData:w,attrExprInfoIndexes:c,nextPageHandler:E}},IH=Math.sqrt(1e4),DH=e=>({maxNumberOfVisibleRows:Math.ceil(e.height/24),maxNumberOfVisibleColumns:Math.ceil(e.width/xT.PixelsMin)}),PH=e=>{if(null===e)return[];if(e.qWidth*e.qHeight<1e4)return[e];const t=[],r=Math.ceil(e.qWidth/IH),n=Math.ceil(e.qHeight/IH);for(let o=0;o<r;o++)for(let r=0;r<n;r++)t.push({qLeft:e.qLeft+o*IH,qTop:e.qTop+r*IH,qWidth:Math.min(IH,e.qWidth-o*IH),qHeight:Math.min(IH,e.qHeight-r*IH)});return t};function RH({nextPageHandler:e}){const{model:t}=a$(),{pageInfo:r}=n$(),{layoutService:n}=u$(),o=(e=>{const t=l(e);return t.current=e,t})(r.page),i=t,a=f(async(e,t)=>{await(i?.collapseLeft(p$,e,t,!1))},[i]),s=f(async(e,t)=>{await(i?.collapseTop(p$,e,t,!1))},[i]),u=f(async(e,t)=>{await(i?.expandLeft(p$,e,t,!1))},[i]),c=f(async(e,t)=>{await(i?.expandTop(p$,e,t,!1))},[i]),d=f(async t=>{if(i?.getHyperCubePivotData&&0!==t.length)try{const n=await i.getHyperCubePivotData(p$,t.reduce((e,t)=>[...e,...PH(t)],[]));o.current===r.page&&e(n)}catch(e){console.error(e)}},[i,e,r,o]),p=f((e,{dimensionInfoIndex:r,isLeftColumn:o,x:i=0,columnWidthLocation:a})=>{const{qMeasureInfo:s,qDimensionInfo:l,topHeadersColumnWidth:u}=n.layout.qHyperCube;let c=[];switch(a){case gF.Dimension:c=[{qPath:`${p$}/qDimensions/${r}/qDef/columnWidth`,oldValue:l[r].columnWidth}];break;case gF.Measures:if(o)c=s.map((e,t)=>({qPath:`${p$}/qMeasures/${t}/qDef/columnWidth`,oldValue:e.columnWidth}));else{const e=n.getMeasureInfoIndexFromCellIndex(i);c=[{qPath:`${p$}/qMeasures/${e}/qDef/columnWidth`,oldValue:s[e].columnWidth}]}break;case gF.Pivot:c=[{qPath:`${p$}/topHeadersColumnWidth`,oldValue:u}]}const d=c.map(t=>{const{qPath:r,oldValue:n}=t;return{qPath:r,qOp:n?"Replace":"Add",qValue:JSON.stringify({...n,...e})}});t?.applyPatches(d,!0)},[t,n]),h=f(async e=>{await(i?.applyPatches([{qPath:`${p$}/indentModeColumnWidth`,qOp:n.layout.qHyperCube.indentModeColumnWidth?"Replace":"Add",qValue:JSON.stringify({...n.indentModeColumnWidth,...e})}],!0))},[i,n]);return v(()=>({collapseLeft:a,collapseTop:s,expandLeft:u,expandTop:c,applyColumnWidth:p,applyIndentModeColumnWidth:h,fetchPages:d}),[a,s,u,c,p,h,d])}const MH=(e,t,r)=>(n,o)=>{if("P"===n)return f$;const i=t[r+o];return e[i]},LH=e=>{const t=[],r=(e,n=0)=>{e.slice(0,1).forEach(e=>{t[n]=e.qType,e.qSubNodes.length&&r(e.qSubNodes,n+1)})};return r(e),t},AH=u({}),kH=()=>h(AH),OH=({children:e})=>{const{visibleLeftDimensionInfo:t,visibleTopDimensionInfo:r}=(()=>{const{layoutService:{layout:{qHyperCube:{qNoOfLeftDims:e,qEffectiveInterColumnSortOrder:t,qDimensionInfo:r}}}}=u$(),{qPivotDataPages:n}=n$();return v(()=>{const o=LH(n[0]?.qLeft??[]),i=LH(n[0]?.qTop??[]);return{visibleLeftDimensionInfo:o.map(MH(r,t,0)),visibleTopDimensionInfo:i.map(MH(r,t,e))}},[r,t,e,n])})(),{headersData:n,measureData:o,topDimensionData:i,leftDimensionData:a,attrExprInfoIndexes:s,nextPageHandler:l}=EH(t,r),u=RH({nextPageHandler:l}),c=v(()=>({gridSectionsData:{headersData:n,topDimensionData:i,leftDimensionData:a,measureData:o},visibleDimensionsInfo:{visibleLeftDimensionInfo:t,visibleTopDimensionInfo:r},attrExprInfoIndexes:s,dataModel:u}),[t,r,n,o,i,a,s,u]);return ii.jsx(AH.Provider,{value:c,children:e})},qH=20,TH=18,NH=.75,_H=e=>-1!==e&&e?.representation?.type===uF.Image,jH=({isLeftColumn:e,layoutService:t,representation:r})=>Boolean(e)&&t.isIndentModeEnabled&&r.type===uF.Image,FH=e=>void 0===e?GF:e,zH=(e,t)=>{if(void 0!==e&&!Number.isNaN(+e)){const r=+e;return r>=0?r:t}return t},WH=e=>zH(e,xT.PixelsDefault),$H=(e,t)=>zH(e,xT.PercentageDefault)*t/100,HH=(e,t,r)=>{switch(t?.type){case ST.Pixels:return WH(t.pixels);case ST.Percentage:return $H(t.percentage,e);case ST.FitToContent:case ST.Auto:default:return r}},VH=({headers:e,layoutService:t,effectivePropertiesService:r,estimateWidthForDimensionValue:n,shouldConsiderCombinatedLength:o,measureTextForHeader:i,longestMeasureValuePossible:a})=>e.reduce((e,s,l)=>{const{layout:{qHyperCube:{qNoOfLeftDims:u,qDimensionInfo:c}}}=t,{id:d,colIdx:p,qApprMaxGlyphCount:f,isLeftDimension:h}=s,m=c.find(e=>e.cId===d),g={width:24,...m?.representation?.imageBox};if(!h)return e+0;if(d===h$)return e+0;const v=jH({isLeftColumn:h,layoutService:t,representation:m?.representation||{type:uF.Text}})?g.width+8+4:n(f),y=!r.qAlwaysFullyExpanded&&p<u-1?21:0;let b=0;if(o&&i&&a){b=i("- ")+a}return Math.max(e,24*l+TH+y+v+b)},0),BH=(e,t,r)=>e.reduce((e,n)=>{const o=(r?0:1)*TH;return Math.max(e,o+t(n.qFallbackTitle))},0),GH=(e,t,r,n)=>{const o=100*e/t,i=n*NH*(o/100),a=o/100*+r;return Math.min(a,i)},UH=(e,t,r,n)=>n*(+r/100)*(100*e/t/100),YH=(e,t)=>e.some(e=>e>=t*NH),KH=({layoutService:e,effectivePropertiesService:t,headersData:r,columnWidths:n,tableWidth:o,widthOverride:i,measureTextForHeader:a,estimateWidthForDimensionValue:s,measureTextWidthForMeasuresCombinedWithDimensions:l,translator:u})=>{let c=[];const d=o*NH,p=r.data[r.data.length-1][0];if(!Array.isArray(p))return{leftGridWidth:0,leftGridColumnWidths:[],leftGridFullWidth:0};const f=Math.min(d,n.at(-1)),h=Math.min(d,VH({headers:p,layoutService:e,effectivePropertiesService:t,estimateWidthForDimensionValue:s})),m=Math.min(d,BH(e.visibleMeasureInfo,a));let g=0;const v=p.findIndex(e=>e.id===h$),y=(({layoutService:e,measureTextForHeader:t,translator:r,headersData:n})=>{const{type:o}=e.indentModeColumnWidth;return o===ST.Auto&&n.size.y<=1?t(r.get("SNPivotTable.IndentMode.Rows"))+8+TH+16:24})({layoutService:e,measureTextForHeader:a,translator:u,headersData:r});if(e.hasPseudoDimOnLeft)if(0===v){const e=Math.max(f,h,m);c=[Math.max(y,e-f),f]}else{const r=Math.min(d,BH(e.visibleMeasureInfo,l,!0));g=Math.min(d,VH({headers:p.slice(0,v),layoutService:e,effectivePropertiesService:t,estimateWidthForDimensionValue:s,shouldConsiderCombinatedLength:!0,measureTextForHeader:a,longestMeasureValuePossible:r}));const n=Math.max(f,h,g);c=[Math.max(y,n-f),f]}else c=[Math.max(y,h-f),f];const b=Math.min(d,c.reduce((e,t)=>e+t,0)),{indentModeColumnWidth:x}=e;i&&i<=d&&(x.type=ST.Pixels,x.pixels=i);return[ST.Pixels,ST.Percentage].includes(x.type)||YH(c,o)?((e,t,r,n)=>{let o=e[0],i=e[1],a=[];const s=e.reduce((e,t)=>e+t,0),{type:l,pixels:u,percentage:c}=t,d=zH(u,xT.PixelsDefault),p=zH(c,xT.PercentageDefault),f=YH(e,r);l===ST.Auto&&f&&(o>i?o-=i:i-=o),l===ST.Pixels&&d&&(o=GH(e[0],s,d,r),i=GH(e[1],s,d,r)),l===ST.Percentage&&p&&(o=UH(e[0],s,p,r),i=UH(e[1],s,p,r));let h=0;i<=n&&(h=o-5,h>0&&(o-=h,i+=h)),h=i-n,h>0&&(o+=h,i-=h),a=[o,i];const m=a.reduce((e,t)=>e+t,0);return{leftGridColumnWidths:a,leftGridWidth:m,leftGridFullWidth:m}})(c,x,o,f):{leftGridWidth:b,leftGridColumnWidths:c,leftGridFullWidth:b}};function XH({tableWidth:e}){const t=e*NH,{styleService:r,layoutService:n,effectivePropertiesService:o}=u$(),{translator:i}=a$(),{gridSectionsData:{headersData:a}}=kH(),{measureText:s}=Pz(r.header,{allowLineBreaks:!1}),{estimateWidth:l,measureText:u}=Pz({...r.dimensionValues,fontWeight:FH(r.dimensionValues.fontWeight)}),{measureText:c}=Pz({...r.dimensionValues,...r.measureLabels}),d=f((r,d)=>{const{layout:{qHyperCube:{qNoOfLeftDims:p,topHeadersColumnWidth:f}},visibleMeasureInfo:h,isIndentModeEnabled:m,hasPseudoDimOnLeft:g}=n,v=(t=0)=>h.reduce((r,{qFallbackTitle:n,columnWidth:o})=>{const i=c(n)+TH,a=Math.max(i,t);return Math.max(r,m?a:HH(e,o,a))},0),y=e=>a.data.reduce((t,r)=>{const n=r.at(e);if(!n||Array.isArray(n))return t;if(n.id===h$)return t;const o=(e=>{const{label:t,isLocked:r}=e,n=r?qH:0;return TH+s(t)+qH+n})(n);return Math.max(o,t)},0);let b=0,x=a.data.at(-1);m&&a.size.x>1&&x&&x[0]&&(x=x[0]);const S=x.map((i,s)=>{let u=TH;if(m&&1!==a.size.x||!r||void 0===d||d!==i.colIdx){let t;i.columnWidthLocation===gF.Pivot?t=m?void 0:f:i.columnWidthLocation===gF.Dimension&&({columnWidth:t}=i);let r=0;if(i.isLeftDimension)if(i.id===h$)r=v();else{const e=y(s),t=((e,t)=>{const{qApprMaxGlyphCount:r,isLeftDimension:i,dimensionInfoIndex:a}=e,s=n.getDimensionInfo(a);if(_H(s))return xT.PixelsDefault;const u=!o.qAlwaysFullyExpanded&&i&&t<p-1?21:0;return TH+l(r)+u})(i,s);r=Math.max(e,t),m&&!g&&s+1===p&&i.columnWidthLocation===gF.Dimension&&a.size.x>1&&(r=e)}else r=y(s),i.columnWidthLocation===gF.Measures&&(r=v(r));m&&1===a.size.x&&(t=n.indentModeColumnWidth),u=m&&!g&&a.size.x>1?r:HH(e,t,r)}else u=m?Math.min(t,r):r;return b+=u,u});return m&&a.size.x>1?KH({layoutService:n,effectivePropertiesService:o,headersData:a,columnWidths:S,tableWidth:e,widthOverride:r,measureTextForHeader:s,estimateWidthForDimensionValue:l,measureTextWidthForMeasuresCombinedWithDimensions:u,translator:i}):{leftGridWidth:Math.min(t,b),leftGridColumnWidths:S,leftGridFullWidth:b}},[e,a,n,t,s,c,l,u,i,o]),[p,h]=m(d);Az(()=>{h(d())},[d]);const g=f((e,t)=>{h(d(e,t))},[d]);return{...p,overrideLeftGridWidth:g}}function JH({tableWidth:e,verticalScrollbarWidth:t,leftGridWidth:r}){const{styleService:n,layoutService:o}=u$(),{visibleDimensionsInfo:{visibleTopDimensionInfo:i}}=kH(),{layout:{qHyperCube:{qNoOfLeftDims:a,qEffectiveInterColumnSortOrder:s}},size:l,visibleMeasureInfo:u}=o,{estimateWidth:c,measureText:d}=Pz(n.measureValues,{allowLineBreaks:!1}),{estimateWidth:p}=Pz({...n.dimensionValues,fontWeight:FH(n.dimensionValues.fontWeight)},{allowLineBreaks:!1}),h=e-r-1,m=i.at(-1),g=m===f$,y=s.length-a>i.length?21:0,b=v(()=>{const e=g?u:[m],t=l.x/e.length,r=[],n=[];let o=h;const i=(e,n)=>{r[e]=Math.min(xT.PixelsMax,Math.max(xT.PixelsMin,n)),o-=r[e]*t};if(e.forEach((e,t)=>{if(e?.columnWidth){const{columnWidth:{type:r,pixels:o,percentage:a},qApprMaxGlyphCount:s,qFallbackTitle:l}=e;switch(r){case ST.Pixels:i(t,WH(o));break;case ST.Percentage:i(t,$H(a,h));break;case ST.FitToContent:i(t,((e,t,r)=>r?xT.PixelsDefault:TH+(g?Math.max(c(e),d(t)):Math.max(Math.max(...u.map(e=>c(e.qApprMaxGlyphCount))),p(e)+y)))(s,l,_H(e)));break;case ST.Auto:default:n.push(t)}}else n.push(t)}),n.length){const e=n.length*t,i=o/e;n.forEach(e=>{r[e]=Math.max(xT.AutoMinPivot,i)})}return r},[g,u,m,l.x,h,c,d,p,y]),x=v(()=>{if(g){return u.reduce((e,t,r)=>e+b[r],0)/u.length}return b[0]},[g,b,u]),S=parseFloat((t/o.size.x).toFixed(12)),w=f(e=>(g&&void 0!==e?b[o.getMeasureInfoIndexFromCellIndex(e,!0)]:x)-S,[g,b,o,x,S]),C=l.x*x;return{rightGridFullWidth:C,rightGridWidth:Math.min(C,h),getRightGridColumnWidth:w}}const ZH=`scrollable-container--${yF.TopGrid}`,QH=`scrollable-container--${yF.LeftGrid}`,eV=`scrollable-container--${yF.DataGrid}`,tV=e=>e&&e instanceof HTMLDivElement?{width:e.offsetWidth-e.clientWidth,height:e.offsetHeight-e.clientHeight}:{width:0,height:0},rV=(e,t)=>e>t?bF.Forward:e<t?bF.Backward:bF.None,nV=({gridRefs:{topGridRef:e,leftGridRef:t,dataGridRef:r},getWrapperElements:n,updateViewService:o,trackScrollDirection:i,interactions:a})=>{const{direction:s}=n$();d(()=>{const{headerGridWrapperElement:l,topGridWrapperElement:u,leftGridWrapperElement:c,dataGridWrapperElement:d}=n(),p=e=>{const t=e.target;l.scrollLeft=t.scrollLeft,i(e),o?.(e)},f=e=>{const t=e.target;l.scrollTop=t.scrollTop,i(e),o?.(e)},h=n=>{const a=n.target,l=((e,t)=>{const{scrollWidth:r,clientWidth:n,scrollLeft:o}=e,i=r-n;if("rtl"===t){if(o>i)return i;if(o<0)return Math.abs(o)}return o})(a,s);r.current?.scrollTo({scrollLeft:l,scrollTop:a.scrollTop}),u.scrollLeft=l,e.current?.forEach(e=>{e?.scrollTo(l)}),c.scrollTop=d.scrollTop,t.current?.forEach(e=>{e?.scrollTo(a.scrollTop)}),i(n),o?.(n)};return c.addEventListener("scroll",p),u.addEventListener("scroll",f),d.addEventListener("scroll",h),a.scroll||setTimeout(()=>{c.removeEventListener("scroll",p),u.removeEventListener("scroll",f),d.removeEventListener("scroll",h)},0),()=>{c.removeEventListener("scroll",p),u.removeEventListener("scroll",f),d.removeEventListener("scroll",h)}},[i,o,a,e,t,r,n,s])},oV=()=>{const{interactions:e}=a$(),t=l(null),r=l(null),n=l(null),o=l(null),i=l([]),a=l([]),s=l(null),{scrollbarsDimensions:{verticalScrollbarWidth:u,horizontalScrollbarHeight:c},resetHorizontalScrollbarHeight:p}=(({topGridWrapperRef:e,leftGridWrapperRef:t,dataGridWrapperRef:r})=>{const[n,o]=m(0),[i,a]=m(0);return g(()=>{if(e.current||r.current){const t=Math.max(tV(e.current).width,tV(r.current).width);n!==t&&o(t)}}),g(()=>{if(t.current||r.current){const e=Math.max(tV(t.current).height,tV(r.current).height);i!==e&&a(e)}}),{scrollbarsDimensions:{verticalScrollbarWidth:n,horizontalScrollbarHeight:i},resetHorizontalScrollbarHeight:()=>{a(0)}}})({topGridWrapperRef:r,leftGridWrapperRef:n,dataGridWrapperRef:o});(({gridSectionsWrapperRefs:{headerGridWrapperRef:e,topGridWrapperRef:t,leftGridWrapperRef:r,dataGridWrapperRef:n},gridRefs:{topGridRef:o,leftGridRef:i,dataGridRef:a}})=>{const{pageInfo:s}=n$(),{downloadService:l,viewService:u,layoutService:c}=u$(),d=f(()=>{const o={left:0,top:0};e.current?.scrollTo(o),t.current?.scrollTo(o),r.current?.scrollTo(o),n.current?.scrollTo(o)},[e,t,r,n]);g(()=>{d()},[s.page,d]),g(()=>{c.triggerdByExpandOrCollapse||d()},[c,d]),g(()=>{if(c.triggerdByExpandOrCollapse){const e=n.current?.scrollLeft??0,t=n.current?.scrollTop??0;i.current?.forEach(e=>{e?.scrollTo(t)}),o.current?.forEach(t=>{t?.scrollTo(e)}),a.current?.scrollTo({scrollTop:t,scrollLeft:e})}},[c,n,a,i,o]),g(()=>{(l.isDownloadedAsPDForImage||c.isSnapshot)&&n.current&&r.current&&t.current&&(n.current.scrollTop=u.scrollTop,n.current.scrollLeft=u.scrollLeft,r.current.scrollLeft=u.leftGridScrollLeft,t.current.scrollTop=u.topGridScrollTop)},[u,l,c,n,r,t])})({gridSectionsWrapperRefs:{headerGridWrapperRef:t,topGridWrapperRef:r,leftGridWrapperRef:n,dataGridWrapperRef:o},gridRefs:{topGridRef:i,leftGridRef:a,dataGridRef:s}});const{trackScrollDirection:h,scrollDirectionRefs:{verticalScrollDirection:v,horizontalScrollDirection:y}}=(()=>{const e=l(bF.None),t=l(bF.None),r=l({prevScrollTop:0,prevScrollLeft:0}),n=f(n=>{if(n instanceof WheelEvent&&(e.current=rV(n.deltaY,0),t.current=rV(n.deltaX,0)),n instanceof Event&&!(n instanceof WheelEvent)){const o=n.target;e.current=rV(o.scrollTop,r.current.prevScrollTop),r.current.prevScrollTop=o.scrollTop,t.current=rV(o.scrollLeft,r.current.prevScrollLeft),r.current.prevScrollLeft=o.scrollLeft}},[e,t,r]);return{trackScrollDirection:n,scrollDirectionRefs:{verticalScrollDirection:e,horizontalScrollDirection:t}}})(),b=(()=>{const{viewService:e}=u$();return f(t=>{const r=t.target,n=t.currentTarget,o=r.dataset.key;o===QH&&(e.leftGridScrollLeft=n.scrollLeft),o===eV&&(e.scrollLeft=n.scrollLeft),o===ZH&&(e.topGridScrollTop=n.scrollTop),o!==QH&&o!==eV||(e.scrollTop=n.scrollTop)},[e])})(),x={gridRefs:{topGridRef:i,leftGridRef:a,dataGridRef:s},getWrapperElements:f(()=>({headerGridWrapperElement:t.current,topGridWrapperElement:r.current,leftGridWrapperElement:n.current,dataGridWrapperElement:o.current}),[t,r,n,o]),updateViewService:b,trackScrollDirection:h,interactions:e};return(({gridRefs:{topGridRef:e,leftGridRef:t,dataGridRef:r},getWrapperElements:n,updateViewService:o,trackScrollDirection:i,interactions:a})=>{d(()=>{const{headerGridWrapperElement:o,topGridWrapperElement:s,leftGridWrapperElement:l,dataGridWrapperElement:u}=n(),c=e=>{e.ctrlKey||(e.preventDefault(),o.scrollLeft+=e.deltaX,o.scrollTop+=e.deltaY,l.scrollLeft=o.scrollLeft,s.scrollTop=o.scrollTop,i(e))},d=e=>{e.ctrlKey||(e.preventDefault(),l.scrollTop+=e.deltaY,t.current?.forEach(e=>{e?.scrollTo(l.scrollTop)}),o.scrollLeft+=e.deltaX,l.scrollLeft=o.scrollLeft,u.scrollTop=l.scrollTop,r.current?.scrollTo({scrollTop:l.scrollTop}),i(e))},p=t=>{t.ctrlKey||(t.preventDefault(),s.scrollLeft+=t.deltaX,e.current?.forEach(e=>{e?.scrollTo(s.scrollLeft)}),o.scrollTop+=t.deltaY,s.scrollTop=o.scrollTop,u.scrollLeft=s.scrollLeft,r.current?.scrollTo({scrollLeft:s.scrollLeft}),i(t))},f=n=>{n.ctrlKey||(n.preventDefault(),u.scrollLeft+=n.deltaX,u.scrollTop+=n.deltaY,r.current?.scrollTo({scrollLeft:u.scrollLeft,scrollTop:u.scrollTop}),s.scrollLeft=u.scrollLeft,e.current?.forEach(e=>{e?.scrollTo(u.scrollLeft)}),l.scrollTop=u.scrollTop,t.current?.forEach(e=>{e?.scrollTo(u.scrollTop)}),i(n))};return o.addEventListener("wheel",c),l.addEventListener("wheel",d),s.addEventListener("wheel",p),u.addEventListener("wheel",f),a.scroll||setTimeout(()=>{o.removeEventListener("wheel",c),l.removeEventListener("wheel",d),s.removeEventListener("wheel",p),u.removeEventListener("wheel",f)},0),()=>{o.removeEventListener("wheel",c),l.removeEventListener("wheel",d),s.removeEventListener("wheel",p),u.removeEventListener("wheel",f)}},[i,o,a,e,t,r,n])})(x),nV(x),{gridSectionsWrapperRefs:{headerGridWrapperRef:t,topGridWrapperRef:r,leftGridWrapperRef:n,dataGridWrapperRef:o},gridRefs:{topGridRef:i,leftGridRef:a,dataGridRef:s},scrollDirectionRefs:{verticalScrollDirection:v,horizontalScrollDirection:y},scrollbarsDimensions:{verticalScrollbarWidth:u,horizontalScrollbarHeight:c,resetHorizontalScrollbarHeight:p}}},iV=()=>{const{layoutService:e}=u$(),{rect:t,pageInfo:r}=n$();return v(()=>{let{height:n}=t;return e.hasLimitedData&&(n-=22),r.shouldShowPagination&&(n-=41),{...t,height:n}},[t,e,r.shouldShowPagination])},aV=({children:e,style:t})=>ii.jsx("div",{"data-testid":"fullSize",style:t,children:e}),sV=({children:e,style:t})=>{const{direction:r}=n$();return ii.jsx("div",{"data-section-id":"GRID",style:{direction:r,display:"grid",...t},children:e})},lV=e=>e&&`scrollable-container--${e}`,uV=({children:e,style:t,origin:r},n)=>{const{interactions:o}=a$(),i=o.scroll?t:{overflow:"hidden"};return ii.jsx("div",{"data-testid":"scrollable","data-key":lV(r),style:i,ref:n,children:e})};var cV=r.forwardRef(uV);const dV=({children:e,style:t})=>{const{direction:r}=n$();return ii.jsx("div",{"data-testid":"sticky",style:{position:"sticky",top:0,["rtl"===r?"right":"left"]:0,...t},children:e})};var pV=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function fV(e,t){return e===t||!(!pV(e)||!pV(t))}function hV(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!fV(e[r],t[r]))return!1;return!0}function mV(e,t){var r;void 0===t&&(t=hV);var n,o=[],i=!1;return function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return i&&r===this&&t(a,o)||(n=e.apply(this,a),i=!0,r=this,o=a),n}}var gV="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function vV(e){cancelAnimationFrame(e.id)}function yV(e,t){var r=gV();var n={id:requestAnimationFrame(function o(){gV()-r>=t?e.call(null):n.id=requestAnimationFrame(o)})};return n}var bV=-1;function xV(e){if(void 0===e&&(e=!1),-1===bV||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),bV=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return bV}var SV=null;function wV(e){if(void 0===e&&(e=!1),null===SV||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),o=n.style;return o.width="100px",o.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?SV="positive-descending":(t.scrollLeft=1,SV=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),SV}return SV}var CV=function(e){var t=e.columnIndex;return e.data,e.rowIndex+":"+t};function EV(e){var t,r=e.getColumnOffset,o=e.getColumnStartIndexForOffset,i=e.getColumnStopIndexForStartIndex,a=e.getColumnWidth,s=e.getEstimatedTotalHeight,l=e.getEstimatedTotalWidth,u=e.getOffsetForColumnAndAlignment,c=e.getOffsetForRowAndAlignment,d=e.getRowHeight,p=e.getRowOffset,f=e.getRowStartIndexForOffset,h=e.getRowStopIndexForStartIndex,m=e.initInstanceProps,g=e.shouldResetStyleCacheOnItemSizeChange,v=e.validateProps;return t=function(e){function t(t){var n;return(n=e.call(this,t)||this)._instanceProps=m(n.props,ql(n)),n._resetIsScrollingTimeoutId=null,n._outerRef=void 0,n.state={instance:ql(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=mV(function(e,t,r,o,i,a,s,l){return n.props.onItemsRendered({overscanColumnStartIndex:e,overscanColumnStopIndex:t,overscanRowStartIndex:r,overscanRowStopIndex:o,visibleColumnStartIndex:i,visibleColumnStopIndex:a,visibleRowStartIndex:s,visibleRowStopIndex:l})}),n._callOnScroll=void 0,n._callOnScroll=mV(function(e,t,r,o,i){return n.props.onScroll({horizontalScrollDirection:r,scrollLeft:e,scrollTop:t,verticalScrollDirection:o,scrollUpdateWasRequested:i})}),n._getItemStyle=void 0,n._getItemStyle=function(e,t){var o,i=n.props,s=i.columnWidth,l=i.direction,u=i.rowHeight,c=n._getItemStyleCache(g&&s,g&&l,g&&u),f=e+":"+t;if(c.hasOwnProperty(f))o=c[f];else{var h=r(n.props,t,n._instanceProps),m="rtl"===l;c[f]=o={position:"absolute",left:m?void 0:h,right:m?h:void 0,top:p(n.props,e,n._instanceProps),height:d(n.props,e,n._instanceProps),width:a(n.props,t,n._instanceProps)}}return o},n._getItemStyleCache=void 0,n._getItemStyleCache=mV(function(e,t,r){return{}}),n._onScroll=function(e){var t=e.currentTarget,r=t.clientHeight,o=t.clientWidth,i=t.scrollLeft,a=t.scrollTop,s=t.scrollHeight,l=t.scrollWidth;n.setState(function(e){if(e.scrollLeft===i&&e.scrollTop===a)return null;var t=n.props.direction,u=i;if("rtl"===t)switch(wV()){case"negative":u=-i;break;case"positive-descending":u=l-o-i}u=Math.max(0,Math.min(u,l-o));var c=Math.max(0,Math.min(a,s-r));return{isScrolling:!0,horizontalScrollDirection:e.scrollLeft<i?"forward":"backward",scrollLeft:u,scrollTop:c,verticalScrollDirection:e.scrollTop<a?"forward":"backward",scrollUpdateWasRequested:!1}},n._resetIsScrollingDebounced)},n._outerRefSetter=function(e){var t=n.props.outerRef;n._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},n._resetIsScrollingDebounced=function(){null!==n._resetIsScrollingTimeoutId&&vV(n._resetIsScrollingTimeoutId),n._resetIsScrollingTimeoutId=yV(n._resetIsScrolling,150)},n._resetIsScrolling=function(){n._resetIsScrollingTimeoutId=null,n.setState({isScrolling:!1},function(){n._getItemStyleCache(-1)})},n}El(t,e),t.getDerivedStateFromProps=function(e,t){return IV(e,t),v(e),null};var y=t.prototype;return y.scrollTo=function(e){var t=e.scrollLeft,r=e.scrollTop;void 0!==t&&(t=Math.max(0,t)),void 0!==r&&(r=Math.max(0,r)),this.setState(function(e){return void 0===t&&(t=e.scrollLeft),void 0===r&&(r=e.scrollTop),e.scrollLeft===t&&e.scrollTop===r?null:{horizontalScrollDirection:e.scrollLeft<t?"forward":"backward",scrollLeft:t,scrollTop:r,scrollUpdateWasRequested:!0,verticalScrollDirection:e.scrollTop<r?"forward":"backward"}},this._resetIsScrollingDebounced)},y.scrollToItem=function(e){var t=e.align,r=void 0===t?"auto":t,n=e.columnIndex,o=e.rowIndex,i=this.props,a=i.columnCount,d=i.height,p=i.rowCount,f=i.width,h=this.state,m=h.scrollLeft,g=h.scrollTop,v=xV();void 0!==n&&(n=Math.max(0,Math.min(n,a-1))),void 0!==o&&(o=Math.max(0,Math.min(o,p-1)));var y=s(this.props,this._instanceProps),b=l(this.props,this._instanceProps)>f?v:0,x=y>d?v:0;this.scrollTo({scrollLeft:void 0!==n?u(this.props,n,r,m,this._instanceProps,x):m,scrollTop:void 0!==o?c(this.props,o,r,g,this._instanceProps,b):g})},y.componentDidMount=function(){var e=this.props,t=e.initialScrollLeft,r=e.initialScrollTop;if(null!=this._outerRef){var n=this._outerRef;"number"==typeof t&&(n.scrollLeft=t),"number"==typeof r&&(n.scrollTop=r)}this._callPropsCallbacks()},y.componentDidUpdate=function(){var e=this.props.direction,t=this.state,r=t.scrollLeft,n=t.scrollTop;if(t.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("rtl"===e)switch(wV()){case"negative":o.scrollLeft=-r;break;case"positive-ascending":o.scrollLeft=r;break;default:var i=o.clientWidth,a=o.scrollWidth;o.scrollLeft=a-i-r}else o.scrollLeft=Math.max(0,r);o.scrollTop=Math.max(0,n)}this._callPropsCallbacks()},y.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&vV(this._resetIsScrollingTimeoutId)},y.render=function(){var e=this.props,t=e.children,r=e.className,o=e.columnCount,i=e.direction,a=e.height,u=e.innerRef,c=e.innerElementType,d=e.innerTagName,p=e.itemData,f=e.itemKey,h=void 0===f?CV:f,m=e.outerElementType,g=e.outerTagName,v=e.rowCount,y=e.style,b=e.useIsScrolling,x=e.width,S=this.state.isScrolling,w=this._getHorizontalRangeToRender(),C=w[0],E=w[1],I=this._getVerticalRangeToRender(),D=I[0],P=I[1],R=[];if(o>0&&v)for(var M=D;M<=P;M++)for(var L=C;L<=E;L++)R.push(n(t,{columnIndex:L,data:p,isScrolling:b?S:void 0,key:h({columnIndex:L,data:p,rowIndex:M}),rowIndex:M,style:this._getItemStyle(M,L)}));var A=s(this.props,this._instanceProps),k=l(this.props,this._instanceProps);return n(m||g||"div",{className:r,onScroll:this._onScroll,ref:this._outerRefSetter,style:ke({position:"relative",height:a,width:x,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:i},y)},n(c||d||"div",{children:R,ref:u,style:{height:A,pointerEvents:S?"none":void 0,width:k}}))},y._callPropsCallbacks=function(){var e=this.props,t=e.columnCount,r=e.onItemsRendered,n=e.onScroll,o=e.rowCount;if("function"==typeof r&&t>0&&o>0){var i=this._getHorizontalRangeToRender(),a=i[0],s=i[1],l=i[2],u=i[3],c=this._getVerticalRangeToRender(),d=c[0],p=c[1],f=c[2],h=c[3];this._callOnItemsRendered(a,s,d,p,l,u,f,h)}if("function"==typeof n){var m=this.state,g=m.horizontalScrollDirection,v=m.scrollLeft,y=m.scrollTop,b=m.scrollUpdateWasRequested,x=m.verticalScrollDirection;this._callOnScroll(v,y,g,x,b)}},y._getHorizontalRangeToRender=function(){var e=this.props,t=e.columnCount,r=e.overscanColumnCount,n=e.overscanColumnsCount,a=e.overscanCount,s=e.rowCount,l=this.state,u=l.horizontalScrollDirection,c=l.isScrolling,d=l.scrollLeft,p=r||n||a||1;if(0===t||0===s)return[0,0,0,0];var f=o(this.props,d,this._instanceProps),h=i(this.props,f,d,this._instanceProps),m=c&&"backward"!==u?1:Math.max(1,p),g=c&&"forward"!==u?1:Math.max(1,p);return[Math.max(0,f-m),Math.max(0,Math.min(t-1,h+g)),f,h]},y._getVerticalRangeToRender=function(){var e=this.props,t=e.columnCount,r=e.overscanCount,n=e.overscanRowCount,o=e.overscanRowsCount,i=e.rowCount,a=this.state,s=a.isScrolling,l=a.verticalScrollDirection,u=a.scrollTop,c=n||o||r||1;if(0===t||0===i)return[0,0,0,0];var d=f(this.props,u,this._instanceProps),p=h(this.props,d,u,this._instanceProps),m=s&&"backward"!==l?1:Math.max(1,c),g=s&&"forward"!==l?1:Math.max(1,c);return[Math.max(0,d-m),Math.max(0,Math.min(i-1,p+g)),d,p]},t}(C),t.defaultProps={direction:"ltr",itemData:void 0,useIsScrolling:!1},t}var IV=function(e,t){e.children,e.direction,e.height,e.innerTagName,e.outerTagName,e.overscanColumnsCount,e.overscanCount,e.overscanRowsCount,e.width,t.instance},DV=function(e,t){var r=e.rowCount,n=t.rowMetadataMap,o=t.estimatedRowHeight,i=t.lastMeasuredRowIndex,a=0;if(i>=r&&(i=r-1),i>=0){var s=n[i];a=s.offset+s.size}return a+(r-i-1)*o},PV=function(e,t){var r=e.columnCount,n=t.columnMetadataMap,o=t.estimatedColumnWidth,i=t.lastMeasuredColumnIndex,a=0;if(i>=r&&(i=r-1),i>=0){var s=n[i];a=s.offset+s.size}return a+(r-i-1)*o},RV=function(e,t,r,n){var o,i,a;if("column"===e?(o=n.columnMetadataMap,i=t.columnWidth,a=n.lastMeasuredColumnIndex):(o=n.rowMetadataMap,i=t.rowHeight,a=n.lastMeasuredRowIndex),r>a){var s=0;if(a>=0){var l=o[a];s=l.offset+l.size}for(var u=a+1;u<=r;u++){var c=i(u);o[u]={offset:s,size:c},s+=c}"column"===e?n.lastMeasuredColumnIndex=r:n.lastMeasuredRowIndex=r}return o[r]},MV=function(e,t,r,n){var o,i;return"column"===e?(o=r.columnMetadataMap,i=r.lastMeasuredColumnIndex):(o=r.rowMetadataMap,i=r.lastMeasuredRowIndex),(i>0?o[i].offset:0)>=n?LV(e,t,r,i,0,n):AV(e,t,r,Math.max(0,i),n)},LV=function(e,t,r,n,o,i){for(;o<=n;){var a=o+Math.floor((n-o)/2),s=RV(e,t,a,r).offset;if(s===i)return a;s<i?o=a+1:s>i&&(n=a-1)}return o>0?o-1:0},AV=function(e,t,r,n,o){for(var i="column"===e?t.columnCount:t.rowCount,a=1;n<i&&RV(e,t,n,r).offset<o;)n+=a,a*=2;return LV(e,t,r,Math.min(n,i-1),Math.floor(n/2),o)},kV=function(e,t,r,n,o,i,a){var s="column"===e?t.width:t.height,l=RV(e,t,r,i),u="column"===e?PV(t,i):DV(t,i),c=Math.max(0,Math.min(u-s,l.offset)),d=Math.max(0,l.offset-s+a+l.size);switch("smart"===n&&(n=o>=d-s&&o<=c+s?"auto":"center"),n){case"start":return c;case"end":return d;case"center":return Math.round(d+(c-d)/2);default:return o>=d&&o<=c?o:d>c||o<d?d:c}},OV=EV({getColumnOffset:function(e,t,r){return RV("column",e,t,r).offset},getColumnStartIndexForOffset:function(e,t,r){return MV("column",e,r,t)},getColumnStopIndexForStartIndex:function(e,t,r,n){for(var o=e.columnCount,i=e.width,a=RV("column",e,t,n),s=r+i,l=a.offset+a.size,u=t;u<o-1&&l<s;)u++,l+=RV("column",e,u,n).size;return u},getColumnWidth:function(e,t,r){return r.columnMetadataMap[t].size},getEstimatedTotalHeight:DV,getEstimatedTotalWidth:PV,getOffsetForColumnAndAlignment:function(e,t,r,n,o,i){return kV("column",e,t,r,n,o,i)},getOffsetForRowAndAlignment:function(e,t,r,n,o,i){return kV("row",e,t,r,n,o,i)},getRowOffset:function(e,t,r){return RV("row",e,t,r).offset},getRowHeight:function(e,t,r){return r.rowMetadataMap[t].size},getRowStartIndexForOffset:function(e,t,r){return MV("row",e,r,t)},getRowStopIndexForStartIndex:function(e,t,r,n){for(var o=e.rowCount,i=e.height,a=RV("row",e,t,n),s=r+i,l=a.offset+a.size,u=t;u<o-1&&l<s;)u++,l+=RV("row",e,u,n).size;return u},initInstanceProps:function(e,t){var r=e,n={columnMetadataMap:{},estimatedColumnWidth:r.estimatedColumnWidth||50,estimatedRowHeight:r.estimatedRowHeight||50,lastMeasuredColumnIndex:-1,lastMeasuredRowIndex:-1,rowMetadataMap:{}};return t.resetAfterColumnIndex=function(e,r){void 0===r&&(r=!0),t.resetAfterIndices({columnIndex:e,shouldForceUpdate:r})},t.resetAfterRowIndex=function(e,r){void 0===r&&(r=!0),t.resetAfterIndices({rowIndex:e,shouldForceUpdate:r})},t.resetAfterIndices=function(e){var r=e.columnIndex,o=e.rowIndex,i=e.shouldForceUpdate,a=void 0===i||i;"number"==typeof r&&(n.lastMeasuredColumnIndex=Math.min(n.lastMeasuredColumnIndex,r-1)),"number"==typeof o&&(n.lastMeasuredRowIndex=Math.min(n.lastMeasuredRowIndex,o-1)),t._getItemStyleCache(-1),a&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.columnWidth,e.rowHeight}}),qV=function(e,t){return e};function TV(e){var t,r=e.getItemOffset,o=e.getEstimatedTotalSize,i=e.getItemSize,a=e.getOffsetForIndexAndAlignment,s=e.getStartIndexForOffset,l=e.getStopIndexForStartIndex,u=e.initInstanceProps,c=e.shouldResetStyleCacheOnItemSizeChange,d=e.validateProps;return t=function(e){function t(t){var n;return(n=e.call(this,t)||this)._instanceProps=u(n.props,ql(n)),n._outerRef=void 0,n._resetIsScrollingTimeoutId=null,n.state={instance:ql(n),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof n.props.initialScrollOffset?n.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},n._callOnItemsRendered=void 0,n._callOnItemsRendered=mV(function(e,t,r,o){return n.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:r,visibleStopIndex:o})}),n._callOnScroll=void 0,n._callOnScroll=mV(function(e,t,r){return n.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:r})}),n._getItemStyle=void 0,n._getItemStyle=function(e){var t,o=n.props,a=o.direction,s=o.itemSize,l=o.layout,u=n._getItemStyleCache(c&&s,c&&l,c&&a);if(u.hasOwnProperty(e))t=u[e];else{var d=r(n.props,e,n._instanceProps),p=i(n.props,e,n._instanceProps),f="horizontal"===a||"horizontal"===l,h="rtl"===a,m=f?d:0;u[e]=t={position:"absolute",left:h?void 0:m,right:h?m:void 0,top:f?0:d,height:f?"100%":p,width:f?p:"100%"}}return t},n._getItemStyleCache=void 0,n._getItemStyleCache=mV(function(e,t,r){return{}}),n._onScrollHorizontal=function(e){var t=e.currentTarget,r=t.clientWidth,o=t.scrollLeft,i=t.scrollWidth;n.setState(function(e){if(e.scrollOffset===o)return null;var t=n.props.direction,a=o;if("rtl"===t)switch(wV()){case"negative":a=-o;break;case"positive-descending":a=i-r-o}return a=Math.max(0,Math.min(a,i-r)),{isScrolling:!0,scrollDirection:e.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!1}},n._resetIsScrollingDebounced)},n._onScrollVertical=function(e){var t=e.currentTarget,r=t.clientHeight,o=t.scrollHeight,i=t.scrollTop;n.setState(function(e){if(e.scrollOffset===i)return null;var t=Math.max(0,Math.min(i,o-r));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}},n._resetIsScrollingDebounced)},n._outerRefSetter=function(e){var t=n.props.outerRef;n._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},n._resetIsScrollingDebounced=function(){null!==n._resetIsScrollingTimeoutId&&vV(n._resetIsScrollingTimeoutId),n._resetIsScrollingTimeoutId=yV(n._resetIsScrolling,150)},n._resetIsScrolling=function(){n._resetIsScrollingTimeoutId=null,n.setState({isScrolling:!1},function(){n._getItemStyleCache(-1,null)})},n}El(t,e),t.getDerivedStateFromProps=function(e,t){return NV(e,t),d(e),null};var p=t.prototype;return p.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)},p.scrollToItem=function(e,t){void 0===t&&(t="auto");var r=this.props,n=r.itemCount,o=r.layout,i=this.state.scrollOffset;e=Math.max(0,Math.min(e,n-1));var s=0;if(this._outerRef){var l=this._outerRef;s="vertical"===o?l.scrollWidth>l.clientWidth?xV():0:l.scrollHeight>l.clientHeight?xV():0}this.scrollTo(a(this.props,e,t,i,this._instanceProps,s))},p.componentDidMount=function(){var e=this.props,t=e.direction,r=e.initialScrollOffset,n=e.layout;if("number"==typeof r&&null!=this._outerRef){var o=this._outerRef;"horizontal"===t||"horizontal"===n?o.scrollLeft=r:o.scrollTop=r}this._callPropsCallbacks()},p.componentDidUpdate=function(){var e=this.props,t=e.direction,r=e.layout,n=this.state,o=n.scrollOffset;if(n.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("horizontal"===t||"horizontal"===r)if("rtl"===t)switch(wV()){case"negative":i.scrollLeft=-o;break;case"positive-ascending":i.scrollLeft=o;break;default:var a=i.clientWidth,s=i.scrollWidth;i.scrollLeft=s-a-o}else i.scrollLeft=o;else i.scrollTop=o}this._callPropsCallbacks()},p.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&vV(this._resetIsScrollingTimeoutId)},p.render=function(){var e=this.props,t=e.children,r=e.className,i=e.direction,a=e.height,s=e.innerRef,l=e.innerElementType,u=e.innerTagName,c=e.itemCount,d=e.itemData,p=e.itemKey,f=void 0===p?qV:p,h=e.layout,m=e.outerElementType,g=e.outerTagName,v=e.style,y=e.useIsScrolling,b=e.width,x=this.state.isScrolling,S="horizontal"===i||"horizontal"===h,w=S?this._onScrollHorizontal:this._onScrollVertical,C=this._getRangeToRender(),E=C[0],I=C[1],D=[];if(c>0)for(var P=E;P<=I;P++)D.push(n(t,{data:d,key:f(P,d),index:P,isScrolling:y?x:void 0,style:this._getItemStyle(P)}));var R=o(this.props,this._instanceProps);return n(m||g||"div",{className:r,onScroll:w,ref:this._outerRefSetter,style:ke({position:"relative",height:a,width:b,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:i},v)},n(l||u||"div",{children:D,ref:s,style:{height:S?"100%":R,pointerEvents:x?"none":void 0,width:S?R:"100%"}}))},p._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],r=e[1],n=e[2],o=e[3];this._callOnItemsRendered(t,r,n,o)}if("function"==typeof this.props.onScroll){var i=this.state,a=i.scrollDirection,s=i.scrollOffset,l=i.scrollUpdateWasRequested;this._callOnScroll(a,s,l)}},p._getRangeToRender=function(){var e=this.props,t=e.itemCount,r=e.overscanCount,n=this.state,o=n.isScrolling,i=n.scrollDirection,a=n.scrollOffset;if(0===t)return[0,0,0,0];var u=s(this.props,a,this._instanceProps),c=l(this.props,u,a,this._instanceProps),d=o&&"backward"!==i?1:Math.max(1,r),p=o&&"forward"!==i?1:Math.max(1,r);return[Math.max(0,u-d),Math.max(0,Math.min(t-1,c+p)),u,c]},t}(C),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var NV=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},_V=function(e,t,r){var n=e.itemSize,o=r.itemMetadataMap,i=r.lastMeasuredIndex;if(t>i){var a=0;if(i>=0){var s=o[i];a=s.offset+s.size}for(var l=i+1;l<=t;l++){var u=n(l);o[l]={offset:a,size:u},a+=u}r.lastMeasuredIndex=t}return o[t]},jV=function(e,t,r,n,o){for(;n<=r;){var i=n+Math.floor((r-n)/2),a=_V(e,i,t).offset;if(a===o)return i;a<o?n=i+1:a>o&&(r=i-1)}return n>0?n-1:0},FV=function(e,t,r,n){for(var o=e.itemCount,i=1;r<o&&_V(e,r,t).offset<n;)r+=i,i*=2;return jV(e,t,Math.min(r,o-1),Math.floor(r/2),n)},zV=function(e,t){var r=e.itemCount,n=t.itemMetadataMap,o=t.estimatedItemSize,i=t.lastMeasuredIndex,a=0;if(i>=r&&(i=r-1),i>=0){var s=n[i];a=s.offset+s.size}return a+(r-i-1)*o},WV=TV({getItemOffset:function(e,t,r){return _V(e,t,r).offset},getItemSize:function(e,t,r){return r.itemMetadataMap[t].size},getEstimatedTotalSize:zV,getOffsetForIndexAndAlignment:function(e,t,r,n,o,i){var a=e.direction,s=e.height,l=e.layout,u=e.width,c="horizontal"===a||"horizontal"===l?u:s,d=_V(e,t,o),p=zV(e,o),f=Math.max(0,Math.min(p-c,d.offset)),h=Math.max(0,d.offset-c+d.size+i);switch("smart"===r&&(r=n>=h-c&&n<=f+c?"auto":"center"),r){case"start":return f;case"end":return h;case"center":return Math.round(h+(f-h)/2);default:return n>=h&&n<=f?n:n<h?h:f}},getStartIndexForOffset:function(e,t,r){return function(e,t,r){var n=t.itemMetadataMap,o=t.lastMeasuredIndex;return(o>0?n[o].offset:0)>=r?jV(e,t,o,0,r):FV(e,t,Math.max(0,o),r)}(e,r,t)},getStopIndexForStartIndex:function(e,t,r,n){for(var o=e.direction,i=e.height,a=e.itemCount,s=e.layout,l=e.width,u="horizontal"===o||"horizontal"===s?l:i,c=_V(e,t,n),d=r+u,p=c.offset+c.size,f=t;f<a-1&&p<d;)f++,p+=_V(e,f,n).size;return f},initInstanceProps:function(e,t){var r={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,n){void 0===n&&(n=!0),r.lastMeasuredIndex=Math.min(r.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),n&&t.forceUpdate()},r},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.itemSize}});function $V(e,t){for(var r in e)if(!(r in t))return!0;for(var n in t)if(e[n]!==t[n])return!0;return!1}var HV=["style"],VV=["style"];function BV(e,t){var r=e.style,n=Oe(e,HV),o=t.style,i=Oe(t,VV);return!$V(r,o)&&!$V(n,i)}const GV=10,UV=(e,t)=>e.current===bF.Backward?t:0,YV=(e,t,r,n)=>{for(let o=r;o<r+n;o++){const r=e.at(o);if(void 0===r||void 0===r.at(t))return!0}return!1},KV=(e,t)=>e.qLeft+e.qWidth===t.qLeft&&e.qTop===t.qTop&&e.qHeight===t.qHeight,XV=({pageInfo:e,measureData:t,pageTop:r,qHeight:n,startLeft:o,endLeft:i})=>{const a=[],s=e.page*e.rowsPerPage;for(let e=o;e<i;e++)if(YV(t,e,r,n)){const t=a[a.length-1],o={qLeft:e,qTop:r+s,qWidth:1,qHeight:n};void 0!==t&&KV(t,o)?t.qWidth+=o.qWidth:a.push(o)}return a},JV=({pageInfo:e,measureData:t,scrollDirection:r,viewService:n,minBufferStartLeft:o,minBufferEndLeft:i,columnEndIndex:a})=>{const{gridRowStartIndex:s,gridHeight:l}=n,u=r.current===bF.Backward?Math.max(0,o-25):i,c=Math.min(u+25,a);return XV({pageInfo:e,measureData:t,startLeft:u,endLeft:c,pageTop:s,qHeight:l})},ZV=({pageInfo:e,measureData:t,scrollDirection:r,layoutService:n,viewService:o})=>{const{startLeft:i,endLeft:a,pageTop:s,qHeight:l}=((e,t,r)=>{const{gridColumnStartIndex:n,gridRowStartIndex:o,gridWidth:i,gridHeight:a}=t,s=e.size.x,l=UV(r,GV),u=Math.max(n-l,0);return{startLeft:u,endLeft:u+Math.min(i+GV,s-u),pageTop:o,qHeight:a}})(n,o,r),u=XV({pageInfo:e,measureData:t,startLeft:i,endLeft:a,pageTop:s,qHeight:l});return u.length>0?[...u,...JV({pageInfo:e,measureData:t,scrollDirection:r,viewService:o,minBufferStartLeft:i,minBufferEndLeft:a,columnEndIndex:n.size.x})]:u},QV=(e,t,r,n)=>{const o=e[r];if(void 0===o)return!0;for(let e=t;e<t+n;e++){if(void 0===o[e])return!0}return!1},eB=(e,t)=>e.qTop+e.qHeight===t.qTop&&e.qLeft===t.qLeft&&e.qWidth===t.qWidth,tB=({startTop:e,endTop:t,qLeft:r,qWidth:n,measureData:o,pageInfo:i})=>{const a=[],s=i.page*i.rowsPerPage;for(let i=e;i<t;i++)if(QV(o,r,i,n)){const e=a.at(-1),t={qLeft:r,qTop:i+s,qWidth:n,qHeight:1};void 0!==e&&eB(e,t)?e.qHeight+=t.qHeight:a.push(t)}return a},rB=({pageInfo:e,measureData:t,scrollDirection:r,viewService:n})=>{const{startTop:o,endTop:i,qLeft:a,qWidth:s}=((e,t,r)=>{const{gridColumnStartIndex:n,gridRowStartIndex:o,gridWidth:i,gridHeight:a}=t,s=UV(r,GV),l=Math.max(o-s,0);return{startTop:l,endTop:l+Math.min(a+GV,e.rowsOnCurrentPage-l),qLeft:n,qWidth:i}})(e,n,r),l=tB({startTop:o,endTop:i,qLeft:a,qWidth:s,measureData:t,pageInfo:e});if(l.length>0){const n=r.current===bF.Backward?Math.max(0,o-25):i,u=Math.min(n+25,e.rowsOnCurrentPage),c=tB({startTop:n,endTop:u,qLeft:a,qWidth:s,measureData:t,pageInfo:e});return[...l,...c]}return l},nB=async(e,t,r,n,o,i,a,s)=>{const{gridColumnStartIndex:l,gridRowStartIndex:u,gridWidth:c,gridHeight:d}=o;let p=[],f=[];i.current!==bF.None&&(p=rB({pageInfo:n,measureData:r,scrollDirection:i,viewService:o})),a.current!==bF.None&&(f=ZV({pageInfo:n,measureData:r,scrollDirection:a,layoutService:t,viewService:o})),i.current===bF.None&&a.current===bF.None&&(p=tB({measureData:r,pageInfo:n,qLeft:l,qWidth:c,startTop:u,endTop:u+d}));const h=e.fetchPages([...p,...f]);s.isDownloadedAsPDForImage&&s.waitForPromise(h)},oB=function(e){var t,r,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,i=0;return function(){t=this;for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];r=s;var u=Date.now()-i,c=function(){i=Date.now(),n=0,e.apply(t,r)};n||(u>=o?c():n=setTimeout(c,o-u))}}(nB,100),iB=Bj(nB,75),aB=(e,t,r=!1)=>void 0!==e&&(e.isLeafNode||r&&e.isLeftColumn?e.mainAxisPageCoord===t:e.mainAxisPageCoord+e.leafCount-1===t),sB=({style:e,index:t,isLastRow:r,isLastColumn:n,showLastBorder:o,isLeftColumn:i,showTotalCellDivider:a})=>{const{direction:s}=n$(),{styleService:{grid:{border:l,divider:u}}}=u$();return ii.jsx("div",{style:{...e,...QF,...nz(r,n,l,s,o),...iz({bottomDivider:a&&i,rightDivider:a&&!i,borderColor:u})},"data-testid":"empty-cell","data-index":t})},lB=({children:e,verticalAlign:t,width:r,right:n,isLeftColumn:o})=>{const{layoutService:{isIndentModeEnabled:i}}=u$(),a=o&&i;return ii.jsx("div",{"data-key":"sticky-cell-container",style:{display:"flex",flexDirection:"row",width:r,maxWidth:"100%",maxHeight:"100%",position:"sticky",left:4,top:0,bottom:0,right:n,...!a&&{alignItems:t,alignSelf:t,overflow:"hidden"}},children:e})},uB=e=>{const{type:t,imageSize:r}=e;return t!==uF.Image||"fill"!==r&&"fitWidth"!==r?"fit-content":"100%"},cB=e=>"number"==typeof e&&!Number.isNaN(+e),dB=e=>"string"==typeof e&&e.length>0||"number"==typeof e?+e:NaN,pB=x((e,t)=>ii.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:ii.jsx("path",{d:"M7.5 8.5H2v-1h5.5V2h1v5.5H14v1H8.5V14h-1z"})})),fB=x((e,t)=>ii.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:ii.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"})})),hB=x((e,t)=>ii.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:[ii.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"}),ii.jsx("use",{fillRule:"evenodd"})]})),mB=x((e,t)=>ii.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:ii.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"})})),gB=x((e,t)=>ii.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:ii.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"})})),vB=x((e,t)=>ii.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:ii.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"})})),yB=x((e,t)=>ii.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:ii.jsx("path",{d:"M2 7.5h12v1H2z"})})),bB=x((e,t)=>ii.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:ii.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"})})),xB=x((e,t)=>ii.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:ii.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"})})),SB=x((e,t)=>ii.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:ii.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"})})),wB=x((e,t)=>ii.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:ii.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"})})),CB=x((e,t)=>ii.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:ii.jsx("path",{d:"m6 10 7-7 2 2-7 7-2 2-5-5 2-2z"})})),EB=x((e,t)=>ii.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:ii.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"})})),IB=x((e,t)=>ii.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:ii.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"})})),DB=x((e,t)=>ii.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:ii.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"})})),PB={m:CB,"ï":SB,R:x((e,t)=>ii.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:ii.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:EB,T:IB,U:DB,P:xB,Q:vB,"è":x((e,t)=>ii.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:ii.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"})})),"¢":mB,"©":hB,"23F4":gB,2013:wB,"&":bB,add:pB,"minus-2":yB,dot:fB},RB=({size:e,iconKey:t,color:r,pvStyle:n})=>{const o=t&&PB[t];return o&&ii.jsx("div",{"data-testid":"representation-indicator-icon",style:{color:r,height:e,...n},children:ii.jsx(o,{style:{height:e}})})},MB=(e,t)=>e.max===e.min?.5:(t-e.min)/(e.max-e.min),LB=(e,t,r)=>{const n=e.paletteColors?e.paletteColors[t]:e.localPaletteColors[t];return r.getColorPickerColor(n)},AB=(e,t,r)=>{const n={previousColor:(o=e.localPaletteColors)[(i=t)-(i>0?1:0)],nextColor:o[i+(i<o.length-1?1:0)]};var o,i;const a=((e,t)=>{const r=e.limits&&e.limits.concat().sort((e,t)=>e.value-t.value);return{lowerLimit:r&&t>0?r[t-1]:{value:0,gradient:!1},upperLimit:r&&r[t]?r[t]:{value:1,gradient:!1}}})(e,t),s=((e,t,r,n,o)=>{const{upperLimit:i,lowerLimit:a}=e,{previousColor:s,nextColor:l}=t,u=n===i.value?1:(n-a.value)/(i.value-a.value);return a.gradient&&i.gradient?n-a.value<i.value-n?{color:s.color,t:.5-u}:{color:l.color,t:u-.5}:a.gradient?{color:s.color,t:1-(.5+u/2)}:i.gradient?{color:l.color,t:u/2}:{color:o.localPaletteColors[r].color,t:n}})(a,n,t,r,e);return D_(e.localPaletteColors[t].color??"").blend(D_(s.color??""),s.t)},kB=(e,t,r)=>{const n=((e,t)=>{const{limits:r}=e;return r&&(e.limits=r.sort((e,t)=>e.value-t.value),e.limits=r.map(e=>({...e,value:MB(t,e.value)}))),e})({...e},t),o=n.paletteColors||n.localPaletteColors;return o&&(n.localPaletteColors=o.concat().map((e,t)=>({color:LB(n,t,r)}))),n},OB=(e,t,r,n)=>{const o=kB(e,r,n),{localPaletteColors:i}=o;if(t<=0)return i[0].color;if(t>=1)return i[i.length-1].color;const a=((e,t)=>{let r="",n=0;const{limits:o,localPaletteColors:i}=e;for(let a=0;a<i.length;a++){const i=o&&o[a]?o[a].value:1;if(t>=n&&t<i){r=AB(e,a,t);break}n=i}return r})(o,t);return a},qB=(e,t)=>{const r=(e=>e.map(e=>e.value??e).sort((e,t)=>e-t))(e),n=r.some(e=>!cB(e));return 0===r.length||n?(e=>{const t=0===e?0:.5*e;return{min:e-t,max:e+t}})(t):1===r.length?((e,t)=>{const r=e[0]-t;if(0===r||!cB(r)){const e=0===t?.5:Math.abs(.5*t);return{min:t-e,max:t+e}}return r>0?{min:t-.5*Math.abs(t),max:e[0]+2*r}:{min:e[0]+2*r,max:t+.5*Math.abs(t)}})(r,t):((e,t)=>{let r=e[e.length-1]-e[0];return r=r>0?r:1,{min:Math.min(t,e[0])-r/2,max:Math.max(t,e[e.length-1])+r/2}})(r,t)},TB=(e,t)=>{const{limits:r}=e.segments;if(!r)return;const n=((e,t)=>{const{min:r,max:n}=qB(e,t),o=Math.abs(t);return{min:r??t-o,max:n??t+o}})(r,t),o=((e,t,r)=>{const{limits:n,paletteColors:o,localPaletteColors:i}=e.segments;if(!n||!cB(t))return 0;let a=r&&cB(r)?Math.min(r,t):0;const s=n.sort((e,t)=>e.value-t.value),l=o||i;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,n.min);return{limitRange:n,limitPaletteColorIndex:o}},NB=e=>"flex-start"===e?"flex-end":"flex-start",_B=(e,t,r,n)=>{const o=e.indicatorConditionalColoring;if(!o)return;const i=TB(o,t),a=((e,t,r,n)=>{const{segments:o}=e;if(!o||!r)return;const{limits:i}=o;if(!i?.length||!((e,t)=>!(!e||0===e.length||!(e[t]?.gradient??e[t-1]?.gradient)))(i,r.limitPaletteColorIndex))return LB(o,r.limitPaletteColorIndex,n);const a=MB(r.limitRange,t);return OB(o,a,r.limitRange,n)})(o,t,i,n),s=o.segments.paletteColors[i?.limitPaletteColorIndex||0].icon,{indicator:l}=e;let u=l?.position||"right";return"rtl"===r&&(u="right"===u?"left":"right"),{color:a,iconKey:s,position:u}},jB=({representation:e,cellValue:t,textStyle:r})=>{const{styleService:n}=u$(),{theme:o}=a$(),{direction:i}=n$(),{text:a,indicator:s}=e,{showTextValues:l,applySegmentColors:u}=s??{},c=_B(e,t,i,o),{fontSize:d,fontFamily:p,fontStyle:f,fontWeight:h,textDecoration:m}=n.measureValues,g={fontSize:d,fontFamily:p,fontStyle:f,fontWeight:h,textDecoration:m},v=parseInt(d||VF,10),{iconKey:y,color:b,position:x}=c||{},S={display:"flex",paddingTop:2};return l?ii.jsxs("div",{"data-key":"representation-indicator",style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"4px",overflow:r?.overflow,color:u?b:r?.color},children:["left"===x&&RB({size:v,iconKey:y,color:b,pvStyle:S}),ii.jsx("span",{style:{paddingTop:4,overflow:r?.overflow,textOverflow:r?.textOverflow,whiteSpace:"nowrap",direction:t<0?"ltr":void 0,...g},children:a}),"right"===x&&RB({size:v,iconKey:y,color:b,pvStyle:S})]}):(S.paddingTop=5,RB({size:v,iconKey:y,color:b,pvStyle:S}))},FB=(e,t,r)=>{if(e?.auto)return t;switch(e?.align){case"center":return"center";case"left":return"rtl"===r?"flex-end":"flex-start";case"right":return"rtl"===r?"flex-start":"flex-end";default:return t}},zB=(e,t)=>{let{textAlign:r}=t.getDimensionInfo(e.dimensionInfoIndex)??{};return e.isPseudoDimension&&void 0!==e.visibleMeasureInfoIndex&&({labelTextAlign:r}=t.visibleMeasureInfo.at(e.visibleMeasureInfoIndex)??{}),r?.auto||void 0===r?"left":r.align},WB=(e,t,r,n,o)=>{if(o)return;const i=e.representation,a=jH({isLeftColumn:r,layoutService:t,representation:i}),s=r?"flex-start":"center",l=e.representation.resolvedImagePosition?.horizontal;if(e.representation.type===uF.Image)return a&&l&&"center"!==l&&"rtl"===n?NB(l):l??s;if(e.isPseudoDimension&&void 0!==e.visibleMeasureInfoIndex){const{labelTextAlign:r}=t.visibleMeasureInfo[e.visibleMeasureInfoIndex]??{};return FB(r,s,n)}const{textAlign:u}=t.getDimensionInfo(e.dimensionInfoIndex)??{};return FB(u,s,n)},$B=e=>!!e.target?.getAttribute("class")?.includes(bT),HB=(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:r}=t.payload,n=Math.min(r,e.activeSelection.startIndex),o=Math.max(r,e.activeSelection.endIndex);if(n===e.activeSelection.startIndex&&o===e.activeSelection.endIndex)return e;const i={...e.activeSelection,startIndex:n,endIndex:o};return i.clientSelectedCells=(e=>{const{getCellFromIndex:t,startIndex:r,endIndex:n,clientSelectedCells:o}=e,i=new Map(o);for(let e=r;e<=n;e++){const r=t(e);"N"===r?.ref.qType&&i.set(r.ref.qElemNo,r)}return i})(i),{...e,activeSelection:i}}default:return e}},VB=e=>null!==e.target?.closest("[data-prevent-selection]"),BB=e=>"A"===e.target?.tagName,GB=({startIndex:e,getCellFromIndex:t,cell:r})=>({type:"mousedown",payload:{activeSelection:{startIndex:e,endIndex:e,getCellFromIndex:t,clientSelectedCells:(new Map).set(r.ref.qElemNo,r)},selectedField:{selectionCellType:r.selectionCellType,index:"L"===r.selectionCellType?r.x:r.y}}});const UB=u({createMouseDownHandler:()=>()=>{},createMouseOverHandler:()=>()=>{},createPointerUpHandler:()=>()=>{},isSelected:()=>!1,isActive:!1,isLocked:()=>!1}),YB=()=>h(UB),KB=({children:e,selections:t})=>{const r=function(e){const{updatePageInfo:t}=n$(),r=e.isActive(),[n,o]=c(HB,{engineSelectedCells:null,selectedField:null,activeSelection:null});d(()=>{const r=()=>{o({type:"clearSelections"})},n=()=>{r(),t({page:0})};return e.on("deactivated",r),e.on("canceled",r),e.on("confirmed",n),e.on("cleared",r),()=>{e.removeListener("deactivated",r),e.removeListener("canceled",r),e.removeListener("confirmed",n),e.removeListener("cleared",r)}},[e,t]);const i=f(async()=>{if(!n.activeSelection)return;var t,r;1===n.activeSelection.clientSelectedCells.size&&(t=n.engineSelectedCells,(r=n.activeSelection).clientSelectedCells.forEach((e,n)=>{t?.has(n)&&(r.clientSelectedCells.delete(n),t.delete(n))}));const i=new Map([...n.engineSelectedCells??new Map,...n.activeSelection.clientSelectedCells]);try{o({type:"mouseup",payload:{engineSelectedCells:i}}),await e.select({method:"selectPivotCells",params:[p$,Array.from(i,([,e])=>({qType:e.selectionCellType,qRow:e.y,qCol:e.x}))]})}catch(e){console.error(e),o({type:"mouseup",payload:{engineSelectedCells:n.engineSelectedCells}})}},[n,e]);d(()=>{if(n.activeSelection)return document.addEventListener("mouseup",i),()=>{document.removeEventListener("mouseup",i)}},[i,n.activeSelection]);const a=f((e,t)=>r=>{const n=t(e);$B(r)||VB(r)||BB(r)||!(e=>1===e.buttons)(r)||!n||o(GB({startIndex:e,getCellFromIndex:t,cell:n}))},[]),s=f(t=>async()=>{n.activeSelection&&(e.isActive()||await e.begin([p$]),o({type:"mouseover",payload:{index:t}}))},[n.activeSelection,e]),l=f((e,t)=>r=>{if("touch"!==r.pointerType)return;const n=t(e);$B(r)||VB(r)||BB(r)||!n||(o(GB({startIndex:e,getCellFromIndex:t,cell:n})),i())},[i]),u=f(e=>!(!n.engineSelectedCells?.size&&!n.activeSelection?.clientSelectedCells.size||!n.selectedField||e.selectionCellType===n.selectedField.selectionCellType&&("L"===e.selectionCellType?n.selectedField.index===e.x:n.selectedField.index===e.y)),[n.activeSelection?.clientSelectedCells.size,n.engineSelectedCells?.size,n.selectedField]),p=f(e=>!u(e)&&(n.engineSelectedCells?.has(e.ref.qElemNo)||!!n.activeSelection?.clientSelectedCells.has(e.ref.qElemNo)),[u,n.activeSelection?.clientSelectedCells,n.engineSelectedCells]);return v(()=>({isSelected:p,isActive:r,isLocked:u,createMouseDownHandler:a,createMouseOverHandler:s,createPointerUpHandler:l}),[p,r,u,a,s,l])}(t);return ii.jsx(UB.Provider,{value:r,children:e})},XB=e=>"fill"===e.representation.imageSize,JB=(e,t)=>{let r=e.isLeftColumn?"flex-start":"center";return e.isLeftColumn&&XB(e)&&t&&(r="center"),e.representation.type!==uF.Image||XB(e)?r:e.representation.resolvedImagePosition?.vertical};var ZB=function(e){return e.Background="background",e.Color="color",e.FontWeight="fontWeight",e.FontStyle="fontStyle",e.TextDecoration="textDecoration",e}(ZB||{});const QB={brighter:.5,darker:.3,opacity:.03},eG=(e,{cell:t,styleService:r})=>{if(e===ZB.Background||e===ZB.Color){const r=t.expressionColor[e];if(r)return r}return t.isNull?r.nullValues[e]:t.isPseudoDimension?r.measureLabels[e]:t.isTotal?r.totalValues[e]:r.dimensionValues[e]},tG=({styleService:e,isCellSelected:t,cell:r,isCellLocked:n})=>{if(t)return e.selectedColors.background;const o=eG(ZB.Background,{cell:r,styleService:e});return!n||!o||r.isPseudoDimension||r.isEmpty||r.isNull||r.isTotal?eG(ZB.Background,{cell:r,styleService:e}):`repeating-linear-gradient(\n -45deg,\n ${OF(i=o,QB)} 0px 2px,\n ${i} 0px 4px\n ) border-box`;var i},rG=({cell:e,styleService:t,isCellSelected:r})=>r?t.selectedColors.color:eG(ZB.Color,{cell:e,styleService:t}),nG=({cell:e,styleService:t})=>{const{qCanCollapse:r,qCanExpand:n}=e.ref,o=eG(ZB.FontWeight,{cell:e,styleService:t});return void 0===o&&(n||r)?GF:o},oG=({cell:e,styleService:t})=>eG(ZB.FontStyle,{cell:e,styleService:t}),iG=({cell:e,styleService:t})=>eG(ZB.TextDecoration,{cell:e,styleService:t}),aG=e=>e?"pointer":"default",sG=({expandOrCollapse:e,cell:t})=>r=>{e?.(t.y,t.x),r.stopPropagation()},lG=(e,t)=>{if(!e.isLeftColumn||e.representation.type===uF.Image)return{padding:4};return{padding:4,marginTop:t.dimensionValueTextHeight/2-6.5-4}},uG=({cell:e,isLeftColumn:t,isCellSelected:r})=>{const{styleService:n,layoutService:o}=u$(),{interactions:i}=a$(),{isActive:a}=YB(),{dataModel:s}=kH();if(!e.ref.qCanExpand&&!e.ref.qCanCollapse)return null;const l=!i.active||a||!s,u=rG({cell:e,styleService:n,isCellSelected:r}),c=a?.4:1,d=e.ref.qCanExpand?hW:fW;let p;p=e.ref.qCanExpand?t?s.expandLeft:s.expandTop:t?s.collapseLeft:s.collapseTop;const f=jH({isLeftColumn:t,layoutService:o,representation:e.representation});return ii.jsx(d,{opacity:c,color:u,"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,...lG(e,n),...f&&{alignSelf:JB(e)}},onClick:l?void 0:sG({cell:e,expandOrCollapse:p})})},cG=e=>{switch(e){case"fitHeight":case"fill":case"alwaysFit":return"100%";case"originalSize":return"fit-content";default:return"auto"}},dG=(e,t,r)=>{if("alwaysFit"===e&&t&&!r)return"fit-content";switch(e){case"fitHeight":return"auto";case"originalSize":return"fit-content";case"alwaysFit":return r?"unset":"100%";default:return"100%"}},pG=(e,t)=>{if("alwaysFit"===e)switch(t?.vertical){case"flex-start":return"center top";case"flex-end":return"center bottom";default:return"center center"}},fG=({representation:e,canExpandOrCollapse:t,leafCount:r,isLeftColumn:n,styleService:o,layoutService:i,isMeasureCell:a})=>{const{isIndentModeEnabled:s}=i,l=jH({isLeftColumn:n,layoutService:i,representation:e}),u=t?21:0,c=e.imageBox?.width??24;let d=`calc(100% - ${u}px)`,p=o.headerCellHeight;n&&l&&(d=c),(a||n)&&(p=o.contentCellHeight);let f=p;switch(n&&void 0!==r&&!s&&(f=p*Math.max(r,1)),e.imageSize){case"originalSize":return{maxWidth:d,maxHeight:f,...l?{width:d}:{}};case"fitWidth":return{width:d,maxHeight:f};case"fitHeight":return{height:f,maxWidth:d,...l?{width:d}:{}};case"fill":return{height:f,width:d};default:return{width:d,height:p}}},hG=e=>{if("alwaysFit"===e)return"contain"},mG=({suffix:e,delimeter:t})=>` ${e?t:""} ${e}`.trim(),gG=({imageSize:e,resolvedImagePosition:t,isImagesInIndentModeEnabled:r,isMeasureCell:n})=>({width:dG(e,r,n),height:cG(e),objectFit:hG(e),objectPosition:pG(e,t),...r&&"alwaysFit"===e?{"max-width":"100%"}:{}}),vG=({representation:e,textStyle:t,isMeasureCell:r})=>{const{imageRef:n,onLoad:o}=(()=>{const{downloadService:e}=u$(),t=l(null),{promise:r,resolve:n}=v(()=>hz(),[]);return d(()=>(e.isDownloadedAsPDForImage&&(e.waitForPromise(r),t.current?.complete&&n()),()=>{n()}),[t,e,r,n]),{onLoad:f(()=>{n()},[n]),imageRef:t}})(),{layoutService:{isIndentModeEnabled:i}}=u$(),{url:a,text:s,imageSize:u,resolvedImagePosition:c}=e,{overflow:p,...h}=t;return ii.jsx("img",{src:a,alt:s,style:{...gG({imageSize:u,resolvedImagePosition:c,isImagesInIndentModeEnabled:i,isMeasureCell:r}),...h},onLoad:o,ref:n})},yG=({representation:e,textStyle:t,canExpandOrCollapse:r,leafCount:n,isLeftColumn:o=!1,imageContainerHorizontalAlignment:i,isMeasureCell:a})=>{const{styleService:s,layoutService:l}=u$(),{resolvedImagePosition:u}=e;return ii.jsx("div",{"data-key":"image-container--image",style:{display:"flex",flexDirection:"column",justifyContent:u?.vertical,alignItems:i,overflow:"hidden",boxSizing:"border-box",border:"4px solid transparent",...fG({representation:e,canExpandOrCollapse:r,leafCount:n,styleService:s,layoutService:l,isLeftColumn:o,isMeasureCell:a})},children:ii.jsx(vG,{representation:e,textStyle:t,isMeasureCell:!0})})},bG={display:"flex",flexDirection:"row",alignItems:"center"},xG={alignItems:"center",display:"flex",flexDirection:"row",backgroundClip:"padding-box"},SG=(e,t,r,n)=>t?{...xG,...e.nullValues}:r?{...bG,color:e.totalValues.color,background:n??e.totalValues.background}:{...bG,color:e.measureValues.color,background:n??e.measureValues.background},wG=(e,t,r,n,o)=>{const{fontFamily:i,fontSize:a}=e.measureValues,s={...ez,...!r&&tz(e.grid.lineClamp),...t&&{color:t},fontFamily:i,fontSize:a};if(o){const{fontWeight:t,fontStyle:r,textDecoration:n}=e.nullValues;return{...s,fontWeight:t,fontStyle:r,textDecoration:n}}if(n){const{fontWeight:t,fontStyle:r,textDecoration:n}=e.totalValues;return{...s,fontWeight:t,fontStyle:r,textDecoration:n}}const{fontWeight:l,fontStyle:u,textDecoration:c}=e.measureValues;return{...s,fontWeight:void 0===l?GF:l,fontStyle:u,textDecoration:c}},CG=({cell:e,representation:t,color:r,isTotalValueCell:n,cellHorizontalAlignment:o})=>{const{layoutService:i,styleService:a}=u$(),{isIndentModeEnabled:s}=i,l=e.isNull?i.getNullValueText():t.text,u=t.type===uF.Image,c=t.type===uF.Indicator,d=cB(dB(l)),p=wG(a,r,d,n,e.isNull);if(!s&&u&&!e.isNull||s&&u&&!e.isNull)return ii.jsx(yG,{isMeasureCell:!0,textStyle:p,representation:t,imageContainerHorizontalAlignment:o});const f=dB(e.isNull?t.text:e.ref.qNum);return c&&cB(f)?ii.jsx(jB,{representation:t,cellValue:f,textStyle:p}):ii.jsx("span",{style:{padding:4,direction:d?"ltr":void 0,...p},children:l})},EG=(e,t)=>e?.[t]?.visibleMeasureInfoIndex??0,IG="flex-start",DG=(e,t)=>e.isNull?IG:t.type===uF.Image&&"fill"!==t.imageSize?t.resolvedImagePosition?.vertical:IG,PG=({columnIndex:e,rowIndex:t,style:r,data:n})=>{const{env:o}=a$(),{pageInfo:i,direction:a}=n$(),{styleService:s,layoutService:l}=u$(),{attrExprInfoIndexes:u,gridSectionsData:{measureData:c,leftDimensionData:d,topDimensionData:p},visibleDimensionsInfo:{visibleLeftDimensionInfo:h,visibleTopDimensionInfo:m}}=kH(),g=(()=>{const{layoutService:{isIndentModeEnabled:e}}=u$(),{gridSectionsData:{leftDimensionData:t,topDimensionData:r},visibleDimensionsInfo:{visibleLeftDimensionInfo:n,visibleTopDimensionInfo:o}}=kH(),i=n.length,a=o.length;return f((n,o)=>!(!r.grid.at(a-1)?.[n]?.isTotal&&!t.grid.at(e?0:i-1)?.[o]?.isTotal),[r,t,i,a,e])})(),v=(()=>{const{gridSectionsData:{topDimensionData:e},visibleDimensionsInfo:{visibleTopDimensionInfo:t}}=kH(),r=t.length;return f(t=>{const n=e.grid.at(r-1)?.[t];return aB(n,e.totalDividerIndex)},[e,r])})(),y=(()=>{const{layoutService:{isIndentModeEnabled:e}}=u$(),{gridSectionsData:{leftDimensionData:t},visibleDimensionsInfo:{visibleLeftDimensionInfo:r}}=kH(),n=r.length;return f(r=>{const o=e?0:n-1,i=t.grid.at(o)?.[r];return aB(i,t.totalDividerIndex,e)},[t,e,n])})(),{showLastBorder:b}=n,x=p.grid.at(m.length-1),S=d.grid.at(h.length-1),{background:w}=s.measureValues,C=c[t]?.[e],E=t===i.rowsOnCurrentPage-1,I=e===l.size.x-1;if(!C)return ii.jsx(sB,{style:{...r,background:w},isLastRow:E,isLastColumn:I,showLastBorder:b,index:t,isLeftColumn:!1,showTotalCellDivider:!1});const D=l.hasPseudoDimOnLeft?EG(S,t):EG(x,e),P=l.visibleMeasureInfo[D],R=cH({cell:C.ref,representationProperties:P.representation,attrExprInfoIndex:u.measures[D],env:o,direction:a,conditionalColoring:P.conditionalColoring,enabledFeatures:{[uF.Image]:!0,[uF.Indicator]:!0}}),M=!C.isNull&&g(e,t),L=C.isNull?l.getNullValueText():R.text,A=!C.isNull||!Number.isNaN(+L),k=dH(u.measures[D],C.ref),O=((e,t,r,n,o)=>{const{textAlign:i}=t,a=n?"flex-end":"center";return e.isNull||r.type!==uF.Image?FB(i,a,o):r.resolvedImagePosition?.horizontal??"center"})(C,P,R,A,a),q={...SG(s,C.isNull,M,k.background),...nz(E,I,s.grid.border,a,b),...iz({bottomDivider:y(t),rightDivider:v(e),borderColor:s.grid.divider}),...QF,padding:"0px 4px",display:"flex",justifyContent:O};return ii.jsx("div",{className:vT,title:L,style:{...q,...r},"data-testid":"measure-value","data-row-index":t,"data-col-index":e,children:ii.jsx(lB,{width:uB(R),verticalAlign:DG(C,R),children:ii.jsx(CG,{cell:C,representation:R,isTotalValueCell:M,color:k.color,cellHorizontalAlignment:O})})})};var RG=r.memo(PG,BV);const MG=(e,t)=>t.list[e]?.id??e.toString(),LG=({columnIndex:e,rowIndex:t,data:r})=>r.grid[t]?.[e]?.id??`${t}-${e}`,AG=e=>({...ZF,overflow:"hidden",boxSizing:"content-box",borderWidth:"rtl"===e?"1px 1px 0px 0px":"1px 0px 0px 1px"}),kG=({dataGridRef:e,height:t,rowHightCallback:r,width:n,showLastBorder:o,getRightGridColumnWidth:i,verticalScrollDirection:a,horizontalScrollDirection:s})=>{const{pageInfo:l,direction:u}=n$(),{layoutService:c,styleService:{grid:{divider:d},contentCellHeight:p}}=u$(),{dataModel:h,gridSectionsData:{measureData:m}}=kH(),v={...AG(u),borderColor:d,willChange:"auto",userSelect:"none",WebkitUserSelect:"none"},y=(({verticalScrollDirection:e,horizontalScrollDirection:t})=>{const{pageInfo:r}=n$(),{downloadService:n,viewService:o,layoutService:i}=u$(),{dataModel:a,gridSectionsData:{leftDimensionData:s,topDimensionData:l,measureData:u}}=kH(),c=s.columnCount,d=l.rowCount;return f(async({overscanColumnStartIndex:s,overscanColumnStopIndex:l,overscanRowStartIndex:p,overscanRowStopIndex:f})=>{o.gridColumnStartIndex=s,o.gridRowStartIndex=p,o.gridWidth=l-s+1,o.gridHeight=f-p+1;const h=o.gridWidth+c+(t.current===bF.None?0:GV),m=o.gridHeight+d+(e.current===bF.None?0:GV);let g=oB;m*h>1500&&(g=iB),g(a,i,u,r,o,e,t,n)},[o,i,a,u,e,t,r,c,d,n])})({verticalScrollDirection:a,horizontalScrollDirection:s});return Az(()=>{e.current&&e.current.resetAfterColumnIndex(0,!1)},[e,h,m]),g(()=>{e.current&&e.current.resetAfterIndices({columnIndex:0,rowIndex:0,shouldForceUpdate:!0})},[n,t,e,p,u]),0===c.size.x?null:ii.jsx(OV,{"data-section-id":"DATA_GRID",ref:e,style:v,columnCount:c.size.x,columnWidth:i,height:t,rowCount:l.rowsOnCurrentPage,rowHeight:r,width:n,itemData:{showLastBorder:o,grid:m},onItemsRendered:y,estimatedRowHeight:r(),estimatedColumnWidth:i(),itemKey:LG,direction:u,children:RG})};var OG=b(kG);const qG=x((e,t)=>ii.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:[ii.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"}),ii.jsx("use",{fillRule:"evenodd"})]})),TG=e=>{const[t,r]=m(!1);return Az(()=>{r(!1)},e),{isAdjustingWidth:t,setIsAdjustingWidth:r}},NG=()=>{const[e,t]=m(!1),{dataModel:r}=kH(),{interactions:n}=a$(),{isAdjustingWidth:o,setIsAdjustingWidth:i}=TG([r]);return{open:e,setOpen:t,handleOpenMenu:e=>{!n.active||$B(e)||o||t(!0)},setIsAdjustingWidth:i}};function _G(e,t){const r=t.expressionColor?.background??e.dimensionValues.background,n=t.isLeftColumn?e.header.background:r,o=n===KF.Transparent?LF.WHITE:n,i=D_(e.grid.border),a=D_(o);return a.isInvalid()||i.isInvalid()||1===i.a?e.grid.border:function(e,t,r){return D_(e.r+(t.r-e.r)*r,e.g+(t.g-e.g)*r,e.b+(t.b-e.b)*r,e.a+(t.a-e.a)*r)}(a,i,i.a).getRGB()}const jG=({cellInfo:e,columnWidth:t,isLastColumn:r,overrideLeftGridWidth:n,setIsAdjustingWidth:o,shouldApplyIndentModeColumnWidth:i,tableWidth:a})=>{const{direction:s}=n$(),{interactions:l,translator:u}=a$(),{isActive:c}=YB(),{dataModel:d}=kH(),{styleService:p}=u$(),[,f]=m({});if(!(e.canBeResized&&!!l.active&&!c))return null;const h=_G(p,e);return ii.jsx(_z,{isPivot:!0,columnWidth:t,isLastColumn:r,keyValue:`adjuster-${e.dimensionInfoIndex}`,hoverColor:h,updateWidthCallback:t=>{f({}),n&&void 0!==e.colIdx&&n(t,e.colIdx)},confirmWidthCallback:t=>{i?d.applyIndentModeColumnWidth({...t,pixels:Math.min((a??0)*NH,t.pixels??0)}):d.applyColumnWidth(t,e)},setIsAdjustingWidth:o,isLeftColumn:e.isLeftColumn,accessibilityRelatedArgs:{translator:u,columnLabel:e.label??""},direction:s})},FG=fl(Qu,{shouldForwardProp:e=>!["interactions","hoverBackground","background","shouldShowMenuIcon","isDimension"].includes(e)})(({interactions:e,background:t,hoverBackground:r,shouldShowMenuIcon:n,isDimension:o})=>({pointerEvents:o?"all":"none",position:"relative",display:"grid",gridTemplateColumns:n?"1fr 12px":"1fr",gap:8,alignItems:"center",cursor:e.active?"pointer":"default",background:t,"&&:hover":{background:e.active&&o?r:t}})),zG=fl("div",{shouldForwardProp:e=>!["direction"].includes(e)})(({direction:e})=>({position:"absolute",left:"rtl"!==e?0:void 0,bottom:0})),WG=fl("div",{shouldForwardProp:e=>"justifyContent"!==e})(({justifyContent:e})=>({...JF,justifyContent:e??JF.justifyContent,flexDirection:"row",overflow:"hidden",position:"relative",gap:8})),$G=fl("div")(()=>({...JF})),HG=fl("div",{shouldForwardProp:e=>!["fontSize","fontFamily","fontWeight","fontStyle","textDecoration","justifyContent"].includes(e)})(({fontSize:e,fontFamily:t,fontWeight:r,fontStyle:n,textDecoration:o,justifyContent:i})=>({display:"flex",justifyContent:i,alignSelf:"center",flexGrow:1,maxWidth:"100%",fontWeight:r,fontSize:e,fontFamily:t,fontStyle:n,textDecoration:o})),VG=fl(hp)(({theme:e})=>({".MuiList-root":{padding:e.spacing(.5,0)}})),BG=fl(bp,{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}}})),GG=fl("span")({textOverflow:"ellipsis",overflow:"hidden"}),UG=fl("div",{shouldForwardProp:e=>"visible"!==e})(({visible:e})=>({opacity:e?1:0,width:qH,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"})),YG=fl("span",{shouldForwardProp:e=>!["padding","alignSelf"].includes(e)})(({padding:e,alignSelf:t})=>({padding:e,alignSelf:t,position:"sticky",top:0}));let KG=function(e){return e.Expand="Expand",e.Collapse="Collapse",e}({});const XG=(e,t)=>({qExcludeList:t===KG.Expand,qPos:{qDimName:e,qElemNo:[]}}),JG=`${p$}/qExpansionState`,ZG=({model:e,qExpansionState:t,qEffectiveDimensionName:r,action:n})=>async()=>{const o=(({qEffectiveDimensionName:e,oldExpansionState:t,action:r})=>{const n=t?.findIndex(t=>t.qPos?.qDimName===e);return{expansionData:XG(e,r),index:n}})({qEffectiveDimensionName:r,oldExpansionState:t,action:n});await(async({model:e,newExpansionState:t,errorMsg:r})=>{const{index:n,expansionData:o}=t;try{let t,r=JG,i="Add";void 0===n?t=JSON.stringify([o]):-1===n?(r=`${JG}/-`,t=JSON.stringify(o)):(r=`${JG}/${n}`,i="Replace",t=JSON.stringify(o)),await e.applyPatches([{qPath:r,qOp:i,qValue:t}],!0)}catch(e){console.error(r,e)}})({model:e,newExpansionState:o,errorMsg:`Failed to ${n} dimension`})},QG=({model:e,effectivePropertiesService:t,cell:r})=>{if(void 0===r.qEffectiveDimensionName)return;const n={model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:r.qEffectiveDimensionName};return{expandCallback:ZG({...n,action:KG.Expand}),collapseCallback:ZG({...n,action:KG.Collapse}),alwaysFullyExpanded:t.qAlwaysFullyExpanded}},eU={[wW.Sorting]:!0,[wW.Selections]:!0,[wW.Searching]:!0},tU=({cell:e,style:t,isFirstColumn:r,isLastColumn:n,isLastRow:o,changeSortOrder:i,iconsVisibilityStatus:a,columnWidth:s,overrideLeftGridWidth:u,shouldApplyIndentModeColumnWidth:c,tableWidth:d})=>{const p=l(null),{styleService:f,layoutService:h,effectivePropertiesService:m}=u$(),{app:g,interactions:v,embed:y,translator:b,model:x}=a$(),{fontSize:S,fontFamily:w,fontStyle:C,fontWeight:E,textDecoration:I,color:D,background:P,hoverBackground:R,activeBackground:M}=f.header,L=l(null),{shouldShowLockIcon:A,shouldShowMenuIcon:k}=a,{open:O,setOpen:q,handleOpenMenu:T,setIsAdjustingWidth:N}=NG(),{direction:_}=n$(),j={sortFromMenu:async(t,r)=>{t.stopPropagation(),await i(e,r)}},F={embed:y,listboxRef:p,sortCriteria:h.searchSortFromDimension&&e.isDim?m.getSortCriteriaForDimension(e.dimensionInfoIndex):void 0},z={app:g,qStateName:h.layout.qStateName},{labelTextAlign:W}=h.getDimensionInfo(e.dimensionInfoIndex)??{},$=FB(W,"flex-start",_);return ii.jsxs(FG,{className:vT,title:e.label,interactions:v,background:O?M:P,hoverBackground:R,shouldShowMenuIcon:k,isDimension:e.isDim,style:{...t,...QF,...oz(e,o,r,n,f.grid.border,_),color:D},"data-testid":"title-cell",onClick:T,children:[ii.jsxs(WG,{children:[A?ii.jsx($G,{children:ii.jsx(qG,{height:12})}):null,ii.jsx(HG,{fontFamily:w,fontSize:S,fontStyle:C,fontWeight:E,textDecoration:I,justifyContent:$,children:ii.jsx("span",{style:ez,children:e.label})})]}),e.isDim?ii.jsxs(ii.Fragment,{children:[ii.jsx(IW,{headerData:e,translator:b,anchorRef:L,open:O,setOpen:q,interactions:v,menuAvailabilityFlags:eU,sortRelatedArgs:j,searchRelatedArgs:F,selectionRelatedArgs:z,expandOrCollapseArgs:QG({model:x,effectivePropertiesService:m,cell:e}),shouldShowMenuIcon:k,model:x&&"setActiveField"in x?x:void 0,direction:_,isAccessibleHeader:!0}),ii.jsx(zG,{ref:p,direction:_}),ii.jsx(zG,{ref:L,direction:_})]}):null,ii.jsx(jG,{cellInfo:{...e,isLeftColumn:!0},columnWidth:s,isLastColumn:n,overrideLeftGridWidth:u,setIsAdjustingWidth:N,shouldApplyIndentModeColumnWidth:c,tableWidth:d})]})},rU=({rowSpan:e,columnSpan:t})=>{const{styleService:r}=u$(),{direction:n}=n$();return e>0&&t>0?ii.jsx("div",{style:{...ZF,gridRowStart:1,gridRowEnd:`span ${e}`,gridColumnStart:1,gridColumnEnd:`span ${t}`,borderWidth:"rtl"===n?"0px 0px 0px 1px":"0px 1px 0px 0px",borderColor:r.grid.border,background:r.grid.background},"data-testid":"empty-header-cell"}):null},nU=x((e,t)=>ii.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:ii.jsx("path",{d:"m8 9 4.5-4.5L14 6l-4.5 4.5L8 12 2 6l1.5-1.5z"})})),oU=x((e,t)=>ii.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:[ii.jsx("path",{d:"m8 7-4.5 4.5L2 10l6-6 6 6-1.5 1.5z"}),ii.jsx("use",{fillRule:"evenodd"})]})),iU=({tableWidth:e,leftGridWidth:t,overrideLeftGridWidth:r})=>{const{direction:n}=n$(),{styleService:o}=u$(),{interactions:i,translator:a}=a$(),{isActive:s}=YB(),{dataModel:l}=kH(),{setIsAdjustingWidth:u}=TG([l]);if(!(!!i.active&&!s))return null;const c=_G(o,{isLeftColumn:!0});return ii.jsx(_z,{isPivot:!0,isLastColumn:!0,isLeftColumn:!0,keyValue:"adjuster-indent-row",hoverColor:c,columnWidth:t,updateWidthCallback:t=>{r(Math.min(t,e*NH))},confirmWidthCallback:n=>{if(n.type===ST.FitToContent)return void l.applyIndentModeColumnWidth({type:ST.Auto});const o=Math.min(n.pixels??t,e*NH);r(o),l.applyIndentModeColumnWidth({type:ST.Pixels,pixels:o})},setIsAdjustingWidth:u,accessibilityRelatedArgs:{translator:a,columnLabel:a.get("SNPivotTable.IndentMode.Rows")},direction:n})},aU=x((e,t)=>ii.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:ii.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"})})),sU=({cell:e,changeSortOrder:t})=>{const r=l(null),n=l(null),{app:o,interactions:i,embed:a,translator:s,model:u}=a$(),{layoutService:c,effectivePropertiesService:d}=u$(),{open:p,setOpen:f,handleOpenMenu:h}=NG();return ii.jsxs(BG,{onClick:h,isActive:p,children:[ii.jsx(GG,{children:e.label}),ii.jsxs(UG,{className:"indent-mode-dropdown-more",visible:p,children:[ii.jsx(aU,{}),e.isDim?ii.jsxs(ii.Fragment,{children:[ii.jsx(IW,{headerData:e,translator:s,anchorRef:r,open:p,setOpen:f,interactions:i,menuAvailabilityFlags:eU,sortRelatedArgs:{sortFromMenu:async(r,n)=>{r.stopPropagation(),await t(e,n)}},searchRelatedArgs:{embed:a,listboxRef:n},selectionRelatedArgs:{app:o,qStateName:c.layout.qStateName},expandOrCollapseArgs:QG({model:u,effectivePropertiesService:d,cell:e}),shouldShowMenuIcon:!1,model:u&&"setActiveField"in u?u:void 0}),ii.jsx(zG,{ref:n}),ii.jsx(zG,{ref:r})]}):null]})]})},lU=({idx:e,menu:t,menuItems:r,isOnlyOneRow:n})=>{const o=r.at(-1)?.id===h$,i=e+1<r.length&&r[e+1]?.id===h$;return!(n&&o&&i)&&(t?.id!==h$&&e<r.length-1)},uU=({menuItems:e,changeSortOrder:t,overrideLeftGridWidth:r,leftGridWidth:n,tableWidth:o})=>{const{styleService:i}=u$(),{interactions:a,translator:s}=a$(),{dataModel:u,gridSectionsData:{headersData:c}}=kH(),[d,p]=m(!1),f=l(null),{headerCellHeight:h}=i,{color:g,background:v,hoverBackground:y,activeBackground:b,fontFamily:x,fontSize:S,fontStyle:w,fontWeight:C,textDecoration:E}=i.header,{isAdjustingWidth:I}=TG([u]),D=e=>{e.stopPropagation()},P={height:h,gridColumn:`1 / span ${c.size.x}`,gridRow:c.size.y,zIndex:c.size.x-0};return ii.jsxs(FG,{isDimension:!0,background:d?b:v,interactions:a,hoverBackground:y,style:{...P,...QF,color:g},onClick:e=>{!a.active||$B(e)||I||p(!d)},"data-testid":"indentModeHeaderCellWrapper",children:[ii.jsxs(WG,{justifyContent:"flex-start",children:[ii.jsx(HG,{fontFamily:x,fontSize:S,fontStyle:w,fontWeight:C,textDecoration:E,justifyContent:"flex-start",children:ii.jsx("span",{style:ez,children:s.get("SNPivotTable.IndentMode.Rows")})}),d?ii.jsx(oU,{}):ii.jsx(nU,{}),ii.jsx(zG,{ref:f})]}),ii.jsx(VG,{open:d,anchorEl:f.current,disableEnforceFocus:!0,children:e.map((r,n)=>[r&&r.id!==h$&&ii.jsx("li",{role:"presentation",onClick:D,onKeyDown:D,children:ii.jsx(sU,{cell:r,changeSortOrder:t})}),lU({idx:n,menu:r,menuItems:e,isOnlyOneRow:1===c.size.y})&&ii.jsx($z,{"data-testid":"group-divider",variant:"middle"})])}),ii.jsx(iU,{tableWidth:o,leftGridWidth:n,overrideLeftGridWidth:r})]})},cU=({layoutService:e,headersData:t,topRowIndex:r})=>e.isIndentModeEnabled&&t.size.x>1&&r+1===t.size.y,dU={display:"grid",width:"fit-content"},pU=({tableWidth:e,leftGridWidth:t,columnWidths:r,rowHight:n,changeSortOrder:o,getHeaderCellsIconsVisibilityStatus:i,height:a,overrideLeftGridWidth:s})=>{const{layoutService:l}=u$(),{gridSectionsData:{headersData:u}}=kH();return ii.jsxs("div",{"data-testid":"HEADER_GRID",style:{...dU,gridTemplateColumns:r.map(e=>`${e}px`).join(" "),gridTemplateRows:u.data.map(()=>`${n}px`).join(" "),height:a},children:[u.size.y>1&&ii.jsx(rU,{columnSpan:u.size.x-1,rowSpan:u.size.y-1}),u.data.map((a,c)=>{let d=[];if(cU({layoutService:l,headersData:u,topRowIndex:c})){const r=a.at(0);return Array.isArray(r)&&d.push(ii.jsx(uU,{menuItems:r,changeSortOrder:o,overrideLeftGridWidth:s,leftGridWidth:t,tableWidth:e},r.at(0)?.id)),d}return d=a.reduce((t,a,d)=>{if(a&&!Array.isArray(a)){const p=i(d,a.isLocked,a.label),f=l.isIndentModeEnabled&&1===u.size.x;t.push(ii.jsx(tU,{style:{width:r[d],height:n,gridColumn:l.isIndentModeEnabled&&u.size.x>1?2:d+1,gridRow:c+1,zIndex:u.size.x-d},isLastRow:c===u.size.y-1,isFirstColumn:0===d,isLastColumn:d===u.size.x-1,changeSortOrder:o,cell:a,iconsVisibilityStatus:p,columnWidth:r[d],overrideLeftGridWidth:s,shouldApplyIndentModeColumnWidth:f,tableWidth:e},a.id))}return t},[]),d})]})};var fU=b(pU);const hU=(e,t,r,n)=>{const{layoutService:o}=u$();g(()=>{e.current?.forEach(e=>e?.resetAfterIndex(0,!0))},[e,t,r,n,o])},mU=(e,t)=>{Az(()=>{e.current?.forEach(e=>e?.resetAfterIndex(0,!1))},[e,t])},gU=(e,t)=>{const{isLast:r,list:n,listValues:o}=t;return r?n[e]:o[e]},vU=()=>{},yU=({children:e,reactWindowStyle:t,cell:r,data:n,showTotalCellDivider:o,isLastRow:i,isLastColumn:a,isLeftColumn:s,isCellSelected:l,isAdjustingWidth:u,index:c})=>{const{styleService:d,layoutService:p}=u$(),{interactions:f}=a$(),{direction:h}=n$(),{isLocked:m,createMouseDownHandler:g,createMouseOverHandler:v,createPointerUpHandler:y}=YB(),{showLastBorder:b}=n,x=m(r)||r.isLockedByDimension,S=!(x||!f.active||!f.select||r.isEmpty||r.isNull||r.isPseudoDimension||r.isTotal||u),w=S?g(c,e=>gU(e,n)):void 0,C=S?v(c):void 0,E=S?y(c,e=>gU(e,n)):void 0,I=jH({isLeftColumn:s,layoutService:p,representation:r.representation});return ii.jsx("div",{className:vT,title:f.passive?r.representation.text:void 0,style:{...t,...nz(i,a,d.grid.border,h,b),...iz({bottomDivider:o&&s,rightDivider:o&&!s,borderColor:d.grid.divider}),...QF,padding:"rtl"===h?"0px 0px 0px 4px":"0px 4px",cursor:aG(S),background:tG({styleService:d,isCellSelected:l,cell:r,isCellLocked:x}),zIndex:s?void 0:p.size.x-r.x,justifyContent:WB(r,p,s,h,I),display:"flex",...p.isIndentModeEnabled&&s&&{["rtl"===h?"paddingRight":"paddingLeft"]:Math.max(4,24*(r.indentLevel??0))},textAlign:zB(r,p)},"aria-hidden":"true",onMouseDown:w,onMouseOver:C,onPointerUp:E,onKeyUp:vU,role:"button",tabIndex:-1,"data-testid":"dimension-cell","data-x":r.x,"data-page-x":r.pageX,"data-y":r.y,"data-page-y":r.pageY,"data-cell-type":r.ref.qType,"data-dimension-info-index":r.dimensionInfoIndex,children:e})},bU=e=>{e.stopPropagation()},xU=({href:e,text:t,interactions:r,color:n})=>({href:e,title:t,rel:"noreferrer",target:"_blank",underline:"hover",onClick:bU,color:LF.LINK,style:{pointerEvents:r.active?"auto":"none",color:n??void 0,opacity:r.active&&r.passive||n?void 0:.4}}),SU=({href:e,text:t,interactions:r,color:n})=>ii.jsx(bd,{...xU({href:e,text:t,interactions:r,color:n}),children:t}),wU=Y();wU.use(U),wU.renderer.prio(["canvas"]);const CU=(e,t)=>e&&"center"!==e&&"rtl"===t?NB(e):e,EU=({cell:e,representation:t,textStyle:r,imageContainerHorizontalAlignment:n})=>{const{imageBox:o}=t,{styleService:{grid:{lineClamp:i}}}=u$(),{direction:a}=n$();return ii.jsxs("div",{style:{display:"grid",gridTemplateColumns:`${o?.width??24}px 1fr`,maxHeight:"fit-content",alignItems:"center",justifyContent:"flex-start",boxSizing:"border-box"},children:[ii.jsx("div",{"data-key":"image-container--partial-image",style:{display:"flex",flexDirection:"column",justifyContent:JB(e),alignItems:CU(n,a),overflow:"hidden",boxSizing:"border-box",border:"4px solid transparent",width:o?.width??24,height:"100%"},children:ii.jsx(vG,{representation:t,textStyle:r})}),ii.jsx(YG,{padding:4/(i<=2?2:1),alignSelf:JB(e,!0),children:!!t.labelStructure&&mG(t.labelStructure)})]})},IU=({suffix:e,delimeter:t})=>` ${e?t:""} ${e}`,DU=({href:e,text:t,labelStructure:r,interactions:n,color:o})=>ii.jsxs("span",{children:[ii.jsx(bd,{...xU({href:e,text:t,interactions:n,color:o}),children:r?.maskedValue?r.maskedValue:r?.originalValue}),!!r&&IU(r)]}),PU=({children:e,textStyle:t,shouldEnableStickyText:r})=>ii.jsx("span",{style:{...t,border:"4px solid transparent",boxSizing:"border-box",...r&&{alignSelf:"flex-start",position:"sticky",top:0}},children:e}),RU=({isLeftColumn:e,styleService:t,cell:r,isIndentModeEnabled:n})=>e?n?t.grid.lineClamp:Math.max(t.grid.lineClamp,r.leafCount*t.grid.lineClamp):t.grid.columnLineClamp,MU=({cell:e,isCellSelected:t,isLeftColumn:r})=>{const{direction:n}=n$(),{isActive:o}=YB(),{layoutService:i,styleService:a}=u$(),{interactions:s}=a$(),l=r&&i.isIndentModeEnabled;let u=r&&!e.isNull?(e=>{const{representation:{text:t,labelStructure:r}}=e;if(!r||!r.originalValue)return t;const{originalValue:n,maskedValue:o,suffix:i,delimeter:a}=r;return`${0!==o.length?o:n} ${i?a:""} ${i}`.trim()})(e):e.representation.text;if(e.isEmpty)return null;const c=(({cell:e,styleService:t,isCellSelected:r,isLeftColumn:n,isIndentModeEnabled:o})=>({...ez,...tz(RU({cell:e,isLeftColumn:n,styleService:t,isIndentModeEnabled:o})),color:rG({cell:e,styleService:t,isCellSelected:r}),fontWeight:nG({cell:e,styleService:t}),fontStyle:oG({cell:e,styleService:t}),textDecoration:iG({cell:e,styleService:t}),fontFamily:t.dimensionValues.fontFamily,fontSize:t.dimensionValues.fontSize}))({cell:e,styleService:a,isCellSelected:t,isLeftColumn:r,isIndentModeEnabled:i.isIndentModeEnabled});if(e.representation.type===uF.Image&&!e.isTotal&&!e.isNull){const{labelStructure:t}=e.representation,o=r&&t&&t.suffix?EU:yG;return ii.jsx(o,{cell:e,representation:e.representation,leafCount:e.leafCount,textStyle:c,isLeftColumn:r,canExpandOrCollapse:e.ref.qCanCollapse||e.ref.qCanExpand,imageContainerHorizontalAlignment:WB(e,i,r,n)})}if(e.representation.type===uF.Link&&!o&&!e.isTotal){const t=r&&e.representation.labelStructure?DU:SU;u=ii.jsx(t,{text:e.representation.text,labelStructure:e.representation.labelStructure,href:e.representation.url,interactions:s,color:e.expressionColor.color})}return ii.jsx(PU,{shouldEnableStickyText:l,textStyle:{...c,...e.representation.type===uF.Image&&e.isNull?{alignSelf:JB(e)}:{}},children:u})},LU=({index:e,style:t,data:r})=>{const{styleService:n,layoutService:o}=u$(),{isSelected:i}=YB(),{isLeftColumn:a=!1,showLastBorder:s,itemCount:l,isLast:u,totalDividerIndex:c}=r,{isAdjustingWidth:d,setIsAdjustingWidth:p}=TG([r]),f=gU(e,r),h=a?e===l-1:u,m=a?u:e===l-1,g=aB(f,c,o.isIndentModeEnabled);if(void 0===f){const{background:r}=n.dimensionValues;return ii.jsx(sB,{style:{...t,background:r},index:e,isLastRow:h,isLastColumn:m,showLastBorder:s,isLeftColumn:a,showTotalCellDivider:g})}const v=i(f);return ii.jsxs(yU,{reactWindowStyle:t,isLeftColumn:a,isLastRow:h,isLastColumn:m,isCellSelected:v,showTotalCellDivider:g,cell:f,data:r,isAdjustingWidth:d,index:e,children:[ii.jsxs(lB,{verticalAlign:JB(f),width:uB(f.representation),right:f.isLeftColumn?void 0:4,isLeftColumn:a,children:[ii.jsx(uG,{isLeftColumn:a,isCellSelected:v,cell:f}),ii.jsx(MU,{isLeftColumn:a,isCellSelected:v,cell:f})]}),ii.jsx(jG,{cellInfo:{...f,columnWidthLocation:f.isPseudoDimension?gF.Measures:gF.Dimension},columnWidth:t.width,isLastColumn:m,setIsAdjustingWidth:p})]})};var AU=r.memo(LU,BV);const kU=({list:e,listValues:t,isLastRow:r,getRightGridColumnWidth:n})=>o=>{const i=r?e[o]:t.at(o);return i&&0===o&&i.x>0?(i.leafCount+i.x+i.distanceToNextCell)*n():!r&&i?(i.leafCount+i.distanceToNextCell)*n():n(i?.x??o)},OU=(e,t,r,n)=>{const o=Object.values(e);let i,a=o.length;return n&&(a=r,i=t/a),{itemCount:a,estimatedItemSize:i,listValues:o}},qU=(e,t)=>r=>{e.current&&(e.current[t]=r)},TU={display:"flex",height:"fit-content",borderWidth:"1px 0px 0px 0px",...ZF},NU={overflow:"hidden",willChange:"auto",flexShrink:0},_U=({leftGridRef:e,width:t,height:r,columnWidths:n,showLastBorder:o})=>{const{pageInfo:i,direction:a}=n$(),{layoutService:s,styleService:{contentCellHeight:l,grid:{divider:u}}}=u$(),{qSize:c}=s.layout.qHyperCube,{gridSectionsData:{leftDimensionData:d},visibleDimensionsInfo:{visibleLeftDimensionInfo:p}}=kH();mU(e,d),hU(e,t,r,l);const f=i.rowsOnCurrentPage*l,h={...TU,borderColor:u,width:n.reduce((e,t)=>e+t,0)};return ii.jsx("div",{style:h,"data-section-id":"LEFT_GRID",children:d.grid.map((t,u)=>{const h=u===d.columnCount-1,m=m$(p[u]),{itemCount:g,estimatedItemSize:v,listValues:y}=OU(t,f,i.rowsOnCurrentPage,h),b=s.isIndentModeEnabled?()=>l:((e,t,r,n,o)=>i=>{const a=n?e[i]:t.at(i);if(a&&0===i&&a.pageY>0)return(a.leafCount+a.pageY+a.distanceToNextCell)*r;if(a&&a.leafCount>0){const e=a.y===o-a.leafCount;return(a.leafCount-(e?a.ref.qUp:0)+a.distanceToNextCell)*r}return r})(t,y,l,h,c.qcy);return ii.jsx(WV,{ref:qU(e,u),style:{...NU,flexGrow:h?1:0,direction:a},height:r,width:n[u],itemCount:g,itemSize:b,layout:"vertical",itemData:{list:t,isLeftColumn:!0,isLast:h,itemCount:g,showLastBorder:o,listValues:y,totalDividerIndex:d.totalDividerIndex},itemKey:MG,estimatedItemSize:v,children:AU},m)})})};var jU=b(_U);const FU={overflow:"hidden",willChange:"auto"},zU=e=>({...ZF,borderWidth:"rtl"===e?"0px 1px 0px 0px":"0px 0px 0px 1px"}),WU=({topGridRef:e,rowHightCallback:t,width:r,height:n,showLastBorder:o,getRightGridColumnWidth:i})=>{const{direction:a}=n$(),{layoutService:s,styleService:{grid:{divider:l},headerCellHeight:u}}=u$(),{gridSectionsData:{headersData:c,topDimensionData:d}}=kH(),p={...zU(a),borderColor:l,height:n};mU(e,d),hU(e,r,n,u);const f=s.size.x*i();return 0===d.rowCount?ii.jsx("div",{style:{width:r,height:n,...zU(a)}}):ii.jsx("div",{style:p,"data-section-id":"TOP_GRID",children:d.grid.map((n,l)=>{const u=l===d.rowCount-1,{itemCount:p,estimatedItemSize:h,listValues:m}=OU(n,f,s.size.x,u),g=(({layoutService:e,headersData:t,topRowIndex:r})=>{const n=t.data.at(r);if(void 0===n)return;const o=t.size.x-1,i=cU({layoutService:e,headersData:t,topRowIndex:r})?0:o,a=n.at(i),s=Array.isArray(a)?a.at(o):a;return s?e.getDimensionInfo(s.dimensionInfoIndex):void 0})({layoutService:s,headersData:c,topRowIndex:l}),v=g?m$(g):`empty ${l}`;return ii.jsx(WV,{ref:qU(e,l),style:FU,height:t(),width:r,itemCount:p,itemSize:kU({list:n,listValues:m,isLastRow:u,getRightGridColumnWidth:i}),layout:"horizontal",itemData:{list:n,isLast:u,itemCount:p,showLastBorder:o,listValues:m,totalDividerIndex:d.totalDividerIndex},itemKey:MG,estimatedItemSize:h,direction:a,children:AU},v)})})};var $U=b(WU);const HU=()=>{const{styleService:{headerCellHeight:e,contentCellHeight:t}}=u$(),r=iV(),n=(()=>{const{model:e}=a$(),t=f(async(t,r)=>{if(!e)throw new Error("No Model provided!");const{qReverseSort:n,dimensionInfoIndex:o,sortDirection:i}=t,a=[];if(r===i)return!1;a.push({qPath:`/qHyperCubeDef/qDimensions/${o}/qDef/qReverseSort`,qOp:"Replace",qValue:(!n).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:o,topGridWrapperRef:i,leftGridWrapperRef:a,dataGridWrapperRef:s},gridRefs:{topGridRef:l,leftGridRef:u,dataGridRef:c},scrollDirectionRefs:{verticalScrollDirection:p,horizontalScrollDirection:h},scrollbarsDimensions:{verticalScrollbarWidth:m,horizontalScrollbarHeight:g,resetHorizontalScrollbarHeight:v}}=oV(),{leftGridWidth:y,leftGridFullWidth:b,leftGridColumnWidths:x,rightGridFullWidth:S,showLastRightBorder:w,getRightGridColumnWidth:C,getHeaderCellsIconsVisibilityStatus:E,overrideLeftGridWidth:I}=function({tableWidth:e,verticalScrollbarWidth:t,resetHorizontalScrollbarHeight:r}){const{layoutService:n,styleService:o}=u$(),{gridSectionsData:{headersData:i}}=kH(),{measureText:a}=Pz(o.header,{allowLineBreaks:!1}),s=XH({tableWidth:e}),l=JH({tableWidth:e,verticalScrollbarWidth:t,leftGridWidth:s.leftGridWidth}),u=s.leftGridWidth+l.rightGridFullWidth+1<e,c=f((e,t,r="")=>{let o=e;n.isIndentModeEnabled&&(o=1,1===i.size.x&&(o=0));const l=s.leftGridColumnWidths[o];let u=!1,c=!1,d=a(r)+TH;return t&&d+qH<=l&&(c=!0,d+=qH),d+qH<=l&&(u=!0),{shouldShowMenuIcon:u,shouldShowLockIcon:c}},[s.leftGridColumnWidths,a,n.isIndentModeEnabled,i.size.x]);return d(()=>{const e=s.leftGridWidth===s.leftGridFullWidth,t=l.rightGridWidth===l.rightGridFullWidth;e&&t&&r()},[r,s.leftGridWidth,s.leftGridFullWidth,l.rightGridWidth,l.rightGridFullWidth]),{...s,...l,showLastRightBorder:u,getHeaderCellsIconsVisibilityStatus:c}}({tableWidth:r.width,verticalScrollbarWidth:m,resetHorizontalScrollbarHeight:v}),{gridScaffoldDimensions:D,headerGridDims:P,topGridDims:R,leftGridDims:M,dataGridDims:L,metadata:{everyThingFitsInTableRectHeight:A,scrollbarsVisibilityStatus:k}}=(({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:r,leftGridOriginalWidth:n,rightGridOriginalWidth:o},scrollBarsDimensions:{verticalScrollbarWidth:i,horizontalScrollbarHeight:a}})=>{const s=iV(),{pageInfo:l}=n$(),{gridSectionsData:{headersData:u,topDimensionData:c}}=kH(),d=Math.min(s.height*NH,Math.max(s.height*NH-25,s.height-t-a)),p=s.width*NH,f=l.rowsOnCurrentPage*t,h=Math.max(u.size.y,c.rowCount,1),m=e*h,g=e*h,v=Math.min(p,r),y=s.width-p,b=Math.max(y,s.width-v),x=Math.min(d,m,g),{availableHeight:S,everyThingFitsInTableRectHeight:w,everyThingFitsInTableRectWidth:C}=((e,t,r)=>{const n=t+1+r+i<=s.width,o=e+1+f+a,l=o-s.height<a||o<=s.height;return{availableHeight:l?o:s.height,everyThingFitsInTableRectHeight:l,everyThingFitsInTableRectWidth:n}})(x,v,b),E=S-d,I=Math.max(E,S-x),D=Math.min(I,f),P=Math.min(I,f),R=m+1+f,{visibilityStatus:M,metadata:{hasLeftGridOverflowX:L,hasDataGridOverflowX:A}}=(e=>{const{gridScaffold:{X_AXIS:{leftSectionWidth:t,rightSectionWidth:r},Y_AXIS:{topSectionHeight:n,bottomSectionHeight:o}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:i,rightSectionFullWidth:a},Y_AXIS:{topSectionFullHeight:s,bottomSectionFullHeight:l}}}=e,u=s>n,c=i>t,d=a>r,p=l>o;return{visibilityStatus:{topGrid:{overflowX:"hidden",overflowY:u?"scroll":"hidden"},leftGrid:{overflowX:c?"scroll":"hidden",overflowY:"hidden"},dataGrid:{overflowX:d?"scroll":"hidden",overflowY:p?"scroll":"hidden"}},metadata:{hasTopGridOverflowY:u,hasLeftGridOverflowX:c,hasDataGridOverflowX:d,hasDataGridOverflowY:p}}})({gridScaffold:{X_AXIS:{leftSectionWidth:v,rightSectionWidth:b},Y_AXIS:{topSectionHeight:x,bottomSectionHeight:I}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:n,rightSectionFullWidth:o},Y_AXIS:{topSectionFullHeight:g,bottomSectionFullHeight:R-g}}});return{gridScaffoldDimensions:{width:s.width,height:s.height,gridTemplateColumns:`${v}px ${b}px`,gridTemplateRows:`${x}px ${I}px`},headerGridDims:{width:-1,height:x},topGridDims:{fullSizeWrapper:{width:o-i+(A?i:0),height:g},stickyWrapper:{width:b-1-i,height:-1},self:{width:Math.min(o,b)-(C?1:0)-i,height:g}},leftGridDims:{fullSizeWrapper:{width:v,height:R-g+(!L&&A?a:0)},stickyWrapper:{width:v,height:I-1-a},self:{width:v,height:Math.max(t,D-(w?0:a-1))}},dataGridDims:{fullSizeWrapper:{width:o-i+(A?i:0),height:R-g+(!A&&L?a:0)},stickyWrapper:{width:b-1-i,height:I-1-a},self:{width:Math.min(o,b)-(C?1:0)-i,height:Math.max(t,P-(w?0:a-1))}},metadata:{everyThingFitsInTableRectHeight:w,scrollbarsVisibilityStatus:M}}})({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:y,leftGridOriginalWidth:b,rightGridOriginalWidth:S},scrollBarsDimensions:{verticalScrollbarWidth:m,horizontalScrollbarHeight:g}}),O=f(()=>e,[e]),q=f(()=>t,[t]);return(()=>{const{downloadService:e}=u$();d(()=>{e.notifyIsDoneRendering()})})(),ii.jsxs(sV,{style:D,children:[ii.jsx("div",{style:{overflow:"hidden"},ref:o,children:ii.jsx(fU,{tableWidth:r.width,leftGridWidth:y,columnWidths:x,getHeaderCellsIconsVisibilityStatus:E,rowHight:e,height:P.height,changeSortOrder:n,overrideLeftGridWidth:I})}),ii.jsx(cV,{style:k.topGrid,origin:yF.TopGrid,ref:i,children:ii.jsx(aV,{style:R.fullSizeWrapper,children:ii.jsx(dV,{style:R.stickyWrapper,children:ii.jsx($U,{topGridRef:l,rowHightCallback:O,...R.self,showLastBorder:{right:w,bottom:!1},getRightGridColumnWidth:C})})})}),ii.jsx(cV,{style:k.leftGrid,origin:yF.LeftGrid,ref:a,children:ii.jsx(aV,{style:M.fullSizeWrapper,children:ii.jsx(dV,{style:M.stickyWrapper,children:ii.jsx(jU,{leftGridRef:u,...M.self,columnWidths:x,showLastBorder:{right:!1,bottom:A}})})})}),ii.jsx(cV,{style:k.dataGrid,origin:yF.DataGrid,ref:s,children:ii.jsx(aV,{style:L.fullSizeWrapper,children:ii.jsx(dV,{style:L.stickyWrapper,children:ii.jsx(OG,{dataGridRef:c,rowHightCallback:q,...L.self,showLastBorder:{right:w,bottom:A},getRightGridColumnWidth:C,verticalScrollDirection:p,horizontalScrollDirection:h})})})})]})},VU=()=>{const{keyboard:e,theme:t,interactions:r,translator:n}=a$(),{pageInfo:o,updatePageInfo:i,rect:a}=n$(),{layoutService:s}=u$(),{layout:l,hasData:u}=s;return ii.jsxs(ii.Fragment,{children:[u?ii.jsx(HU,{}):null,ii.jsx(d$,{}),ii.jsx(t$,{paginationNeeded:o.shouldShowPagination,handleChangePage:e=>{i({page:e})},pageInfo:o,totalRowCount:o.totalRowCount,totalColumnCount:0,totalPages:o.totalPages,keyboard:e,translator:n,theme:t,interactions:r,rect:a,layout:l})]})};const BU=(e,{selections:t,baseObjects:n,coreServices:o,nebulaObjects:i})=>{const a=function(e){const t=OS();return t?.components?.MuiTable?.styleOverrides&&(t.components.MuiTable.styleOverrides.root={}),Ls({...t,direction:e})}(n.direction);e.render(ii.jsx(r.StrictMode,{children:ii.jsx(ml,{theme:a,children:ii.jsx(s$,{...i,children:ii.jsx(o$,{...n,children:ii.jsx(KB,{selections:t,children:ii.jsx(c$,{...o,children:ii.jsx(OH,{children:ii.jsx(VU,{})})})})})})})}))};var GU=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}(GU||{}),UU=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}(UU||{}),YU=function(e){return e.Grid="grid",e.Divider="grid.divider",e.LabelName="label.name",e.LabelValue="label.value",e}(YU||{}),KU=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}(KU||{});const XU=e=>e?`${parseInt(e,10)}px`:void 0,JU=(e,t)=>{if(t){const r=e.getColorPickerColor(t);return"none"===r?KF.Transparent:r}},ZU=(e,t)=>+(parseInt(e,10)*YF*t+8).toFixed(2),QU=(e,t)=>void 0===e?t:e.some(e=>"bold"===e)?GF:"normal",eY=e=>e?.some(e=>"italic"===e)?"italic":"normal",tY=e=>e?.some(e=>"underline"===e)?"underline":"none",rY=document.createElement("textarea");function nY(e){rY.value=e,document.body.appendChild(rY),rY.select(),rY.setSelectionRange(0,rY.value.length),document.execCommand("copy"),document.body.removeChild(rY)}rY.style.position="absolute",rY.style.left="-9999px",rY.setAttribute("readonly","");function oY(e){T?.((t,r)=>{const n=r.target,o=n?.closest(`.${vT}`);o?.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(()=>{nY(t)}):nY(t))})(o)}}),e?.forEach(e=>{e(t,r,o)})})}const iY=({model:e,layoutService:t,effectivePropertiesService:r,translator:n})=>mz((o,i,a)=>{if(!e||r.qAlwaysFullyExpanded)return;const s=e,l=o.addItem({translation:"Object.PivotTable.ContextMenu.ExpandCollapse",tid:"expand-collapse-group",id:"expand-collapse-group"}),{qEffectiveDimensionName:u,label:c}=((e,t)=>{const r=((e,t)=>{const r=e?.getAttribute("data-dimension-info-index");if("string"==typeof r)return t.getDimensionInfo(+r)})(e,t);return"object"==typeof r?{qEffectiveDimensionName:r.qEffectiveDimensionName,label:r.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(p$,0,0,!0),await e.expandLeft(p$,0,0,!0)}catch(e){console.error("Failed to expand all",e)}}}))(s)),"string"==typeof u&&l.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:r,label:n,translator:o})=>({icon:"lui-icon lui-icon--plus",translation:o.get("SNPivotTable.ContextMenu.ExpandDimension",[n??""]),tid:"expand-dimension",id:"expand-dimension",select:ZG({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:r,action:KG.Expand})}))({model:s,effectivePropertiesService:r,qEffectiveDimensionName:u,label:c,translator:n})),l.addItem((e=>({icon:"lui-icon lui-icon--minus",translation:"Object.PivotTable.ContextMenu.CollapseAll",tid:"collapse-all",select:async()=>{try{await e.collapseTop(p$,0,0,!0),await e.collapseLeft(p$,0,0,!0)}catch(e){console.error("Failed to collapse all",e)}}}))(s)),"string"==typeof u&&l.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:r,label:n,translator:o})=>({icon:"lui-icon lui-icon--minus",translation:o.get("SNPivotTable.ContextMenu.CollapseDimension",[n??""]),tid:"collapse-dimension",id:"collapse-dimension",select:ZG({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:r,action:KG.Collapse})}))({model:s,effectivePropertiesService:r,qEffectiveDimensionName:u,label:c,translator:n}))},[e,t,r]),aY=(e,t)=>R(()=>(({layout:e})=>{const{qHyperCube:t,nullValueRepresentation:r,snapshotData:n}=e,{qNoOfLeftDims:o,qEffectiveInterColumnSortOrder:i,qMeasureInfo:a,qDimensionInfo:s}=t,l=!!n,u=n?.content?.rowsPerPage??15e3,c={x:Math.min(e.qHyperCube.qSize.qcx,UF),y:Math.min(e.qHyperCube.qSize.qcy,u)},d=i.slice(0,o),p=e=>d.some(t=>t===e),f=p(f$),h=new Map(i.map(e=>[s[e]??f$,e])),m=a.filter(e=>7005!==e.qError?.qErrorCode);return{layout:e,getNullValueText:()=>r?.text??"-",getMeasureInfoIndexFromCellIndex:(e,t=!1)=>{if(f)return 0;const r=e%m.length;return t?r:a.findIndex(e=>e===m[r])},getDimensionInfo:e=>e===f$?void 0:s.at(e),getDimensionInfoIndex:e=>h.get(e)??-1,size:c,isSnapshot:l,hasLimitedData:!l&&c.x<e.qHyperCube.qSize.qcx,hasData:c.x>0&&c.y>0,hasLeftDimensions:0!==e.qHyperCube.qNoOfLeftDims,hasPseudoDimOnLeft:f,leftDimensionInfoIndexes:d,isLeftDimension:p,triggerdByExpandOrCollapse:!!e.qHyperCube.qLastExpandedPos,visibleMeasureInfo:m,isIndentModeEnabled:Boolean(e.qHyperCube.qIndentMode),indentModeColumnWidth:e.qHyperCube.indentModeColumnWidth??{type:ST.Auto,pixels:xT.PixelsDefault,percentage:xT.PercentageDefault},searchSortFromDimension:"inherit"===e.search?.sorting}})({layout:e}),[e,t]),sY=({model:e,layoutService:t,viewService:r,pageInfo:n,rect:o})=>{const{layout:i,isSnapshot:a,triggerdByExpandOrCollapse:s}=t,l=(e=>{const t=vz(e);return t.current=e,t})(DH(o));return Cz(async()=>{const{qHyperCube:t}=i,{maxNumberOfVisibleRows:o,maxNumberOfVisibleColumns:u}=l.current;if(a)return i.snapshotData?.content?.qPivotDataPages??[];if(void 0!==e&&"getHyperCubePivotData"in e&&(((e,t,r,n)=>!!e&&(t.gridColumnStartIndex+t.gridWidth>=n||t.gridRowStartIndex+t.gridHeight>=r))(s,r,o,u)||((e,t,r,n)=>{const{qHyperCube:{qPivotDataPages:o,qSize:i}}=e,{qTop:a,qWidth:s,qHeight:l}=o[0]?.qArea??{qTop:0,qWidth:0,qHeight:0};return a<t.page*t.rowsPerPage||s<Math.min(n,i.qcx)||l<Math.min(r,i.qcy)})(i,n,o,u))){const t=((e,t,r,n,o,i)=>{const a=n.page*n.rowsPerPage,s=Math.min(a+n.rowsPerPage,r.qcy),l=Math.min(UF,r.qcx);if(r.qcy<a)return null;let u=0,c=a;if(e){u=t.gridColumnStartIndex,c=a+t.gridRowStartIndex;const e=c+t.gridHeight,r=t.gridColumnStartIndex+t.gridWidth;e>s&&(c=Math.max(0,s-o)),r>l&&(u=Math.max(0,l-i))}return{qLeft:u,qTop:c,qWidth:Math.min(l-u,i),qHeight:Math.min(s-c,o)}})(s,r,i.qHyperCube.qSize,n,o,u);return t?e.getHyperCubePivotData(p$,PH(t)):[]}return t.qPivotDataPages},[i,a,e,r,n.page,n.rowsPerPage,l,s])},lY=({rowsPerPage:e,totalRowCount:t,page:r})=>Math.min(e,t-r*e),uY=(e,t,r=15e3)=>({rowsPerPage:r,totalPages:Math.max(1,Math.ceil(e/r)),totalRowCount:e,rowsOnCurrentPage:lY({rowsPerPage:r,totalRowCount:e,page:t})}),cY=15,dY=({layoutService:e,viewService:t,rect:r,model:n,pageInfo:o})=>{const{freeResize:i}=M();return N(async e=>{const i=e;if(!i.snapshotData||!n||i.snapshotData.content)return i;if("getHyperCubePivotData"in n){const{scrollTop:e,scrollLeft:a,leftGridScrollLeft:s,topGridScrollTop:l}=t,u=((e,t,r)=>{const{gridColumnStartIndex:n,gridRowStartIndex:o,gridWidth:i,gridHeight:a}=e,s=t.page*t.rowsPerPage,l=Math.max(n-cY,0),u=Math.max(s+o-cY,s,0),c=UF-l,d=s+t.rowsOnCurrentPage-u;if((e=>0===e.gridWidth&&0===e.gridHeight)(e)){const{maxNumberOfVisibleColumns:e,maxNumberOfVisibleRows:t}=DH(r);return{qLeft:l,qTop:u,qWidth:Math.min(c,e+30),qHeight:Math.min(d,t+30)}}return{qLeft:l,qTop:u,qWidth:Math.min(c,i+30),qHeight:Math.min(d,a+30)}})(t,o,r),c=PH(u),d={qLeft:0,qTop:o.page*o.rowsPerPage,qWidth:1,qHeight:1};i.snapshotData.content={qPivotDataPages:await n.getHyperCubePivotData(p$,[d,...c]),scrollTop:e,scrollLeft:a,leftGridScrollLeft:s,topGridScrollTop:l,page:o.page,rowsPerPage:o.rowsPerPage},i.snapshotData.object.size.w=r.width,i.snapshotData.object.size.h=r.height}return i}),_(()=>({getViewState:()=>((e,t)=>({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,leftGridScrollLeft:e.leftGridScrollLeft,topGridScrollTop:e.topGridScrollTop,renderPage:t.page}))(t,o)}),[t]),e.layout.snapshotData?.content&&!i?{left:r.left,top:r.top,width:e.layout.snapshotData.object.size.w,height:e.layout.snapshotData.object.size.h}:r};var pY={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 fY=()=>{const e=j(),t=e.language();return R(()=>{!function(e){const t="SNPivotTable_LimitedData";e.get(t)===t&&Object.keys(pY).forEach(t=>{e.add(pY[t])})}(e)},[e]),{translator:e,language:t}},hY=e=>{const{flags:t}=e,r=F(),n=(e=>{const t=R(()=>Rz(e),[e]);return k(()=>()=>{t.unmount()},[t]),t})(r),o=z(),i=W(),a=$(),s=H(),l=V(),u=(()=>{const{viewState:e}=M(),t=vz(new Set),r=void 0!==window.qlikprinting,{promise:n,resolve:o}=R(()=>hz(),[]),i=mz(e=>{t.current.add(e)},[t]),a=mz(Bj(async()=>{await Promise.all(t.current),t.current.clear(),o()},1e3),[o,t]);return L(async()=>{await n},[n]),R(()=>({viewState:e,isDownloadedAsPDForImage:r,notifyIsDoneRendering:a,waitForPromise:i}),[a,r,e,i])})(),c=((e,t)=>{const[r]=Cz(async()=>{if(void 0!==e&&!t.snapshotData&&"getEffectiveProperties"in e)return{...await e.getEffectiveProperties()}},[e,t]);return R(()=>{const e=void 0!==r?.qHyperCubeDef.qSortbyYValue&&1===Math.abs(r.qHyperCubeDef.qSortbyYValue),t=r?.qHyperCubeDef.qDimensions.map(e=>e.qDef?.qSortCriterias)??[];return{qAlwaysFullyExpanded:r?.qHyperCubeDef.qAlwaysFullyExpanded??!1,qExpansionState:r?.qHyperCubeDef.qExpansionState,isSortedByFirstMeasure:e,getSortCriteriaForDimension:e=>t[e]}},[r])})(i,o),d=aY(o,t),p=(e=>{const t=q();return{...t,select:!!t.active&&!!t.select&&!e,active:!!t.active&&!e,scroll:!!t.active}})(d.isSnapshot),f=B(),h=wz(o,r),{translator:m,language:g}=fY(),{pageInfo:v,updatePageInfo:y}=((e,t)=>{const{size:r,layout:{qHyperCube:{qSize:n}}}=e,o=t.isDownloadedAsPDForImage||e.isSnapshot,i=(e=>e.layout.snapshotData?.content?.rowsPerPage)(e),[a,s]=A(()=>{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:n.qcy>r.y&&!o,...uY(n.qcy,a,i)}}),l=e.layout.qHyperCube.qSize.qcy;return k(()=>{s(t=>({...t,...uY(l,t.page,i),shouldShowPagination:l>e.size.y&&!o}))},[l,e.size.y,s,o,i]),k(()=>{const{page:e,totalPages:t}=a;if(e+1>t){const e=t-1,r=lY({...a,page:e});s({...a,page:e,rowsOnCurrentPage:r})}},[a]),{pageInfo:a,updatePageInfo:e=>{s({...a,...e,rowsOnCurrentPage:lY({...a,...e})})}}})(d,u),b=((e,t,r)=>R(()=>((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}})(r,t.snapshotData),[r,e.page,t.snapshotData]))(v,o,u),x=dY({rect:G(),layoutService:d,viewService:b,model:i,pageInfo:v}),[S,w]=sY({model:i,layoutService:d,viewService:b,pageInfo:v,rect:x}),C=R(()=>((e,t)=>{const r=t.layout.components?.find(e=>"theme"===e.key),n=r?.header,o=r?.dimensionValues,i=r?.measureValues,a=r?.measureLabels,s=r?.totalValues,l=r?.nullValues,u=r?.grid,c=(t,r,n)=>e.getStyle(t,r,n),d=+(u?.[GU.LineClamp]??c(UU.Grid,YU.Grid,KU.LineClamp)??1),p=+(u?.[GU.ColumnLineClamp]??c(UU.Grid,YU.Grid,KU.ColumnLineClamp)??1),f=JU(e,n?.[GU.Background])??c(UU.Dimension,YU.LabelName,KU.BackgroundColor)??KF.Transparent,h={header:{fontSize:XU(n?.[GU.FontSize])??c(UU.Dimension,YU.LabelName,KU.FontSize)??VF,fontFamily:n?.[GU.FontFamily]??c(UU.Dimension,YU.LabelName,KU.FontFamily)??BF,fontWeight:QU(n?.[GU.FontStyle],GF),fontStyle:eY(n?.[GU.FontStyle]),textDecoration:tY(n?.[GU.FontStyle]),color:JU(e,n?.[GU.FontColor])??c(UU.Dimension,YU.LabelName,KU.FontColor)??LF.TEXT,background:f,hoverBackground:OF(f,wT),activeBackground:OF(f,CT)},dimensionValues:{fontSize:XU(o?.[GU.FontSize])??c(UU.Dimension,YU.LabelValue,KU.FontSize)??VF,fontFamily:o?.[GU.FontFamily]??c(UU.Dimension,YU.LabelValue,KU.FontFamily)??BF,fontWeight:QU(o?.[GU.FontStyle],void 0),fontStyle:eY(o?.[GU.FontStyle]),textDecoration:tY(o?.[GU.FontStyle]),color:JU(e,o?.[GU.FontColor])??c(UU.Dimension,YU.LabelValue,KU.FontColor)??LF.TEXT,background:JU(e,o?.[GU.Background])??c(UU.Dimension,YU.LabelValue,KU.BackgroundColor)??KF.Transparent},measureValues:{fontSize:XU(i?.[GU.FontSize])??c(UU.Measure,YU.LabelValue,KU.FontSize)??VF,fontFamily:i?.[GU.FontFamily]??c(UU.Measure,YU.LabelValue,KU.FontFamily)??BF,fontWeight:QU(i?.[GU.FontStyle],"normal"),fontStyle:eY(i?.[GU.FontStyle]),textDecoration:tY(i?.[GU.FontStyle]),color:JU(e,i?.[GU.FontColor])??c(UU.Measure,YU.LabelValue,KU.FontColor)??KF.FontSecondary,background:JU(e,i?.[GU.Background])??c(UU.Measure,YU.LabelValue,KU.BackgroundColor)??KF.Transparent},measureLabels:{fontWeight:QU(a?.[GU.FontStyle],"normal"),fontStyle:eY(a?.[GU.FontStyle]),textDecoration:tY(a?.[GU.FontStyle]),color:JU(e,a?.[GU.FontColor])??c(UU.Measure,YU.LabelName,KU.FontColor)??KF.FontSecondary,background:JU(e,a?.[GU.Background])??c(UU.Measure,YU.LabelName,KU.BackgroundColor)??KF.Transparent},totalValues:{fontWeight:QU(s?.[GU.FontStyle],GF),fontStyle:eY(s?.[GU.FontStyle]),textDecoration:tY(s?.[GU.FontStyle]),color:JU(e,s?.[GU.FontColor])??c(UU.Total,YU.LabelValue,KU.FontColor)??LF.TEXT,background:JU(e,s?.[GU.Background])??c(UU.Total,YU.LabelValue,KU.BackgroundColor)??KF.Transparent},nullValues:{fontWeight:QU(l?.[GU.FontStyle],"normal"),fontStyle:eY(l?.[GU.FontStyle]),textDecoration:tY(l?.[GU.FontStyle]),color:JU(e,l?.[GU.FontColor])??c(UU.Null,YU.LabelValue,KU.FontColor)??LF.TEXT,background:JU(e,l?.[GU.Background])??c(UU.Null,YU.LabelValue,KU.BackgroundColor)??KF.NullValueBackground},grid:{columnLineClamp:p,lineClamp:d,border:JU(e,u?.[GU.Border])??c(UU.Grid,YU.Grid,KU.BorderColor)??KF.DividerLight,divider:JU(e,u?.[GU.Divider])??c(UU.Grid,YU.Divider,KU.BorderColor)??KF.DividerDark,background:JU(e,u?.[GU.Background])??c(UU.Grid,YU.Grid,KU.BackgroundColor)??KF.Transparent},selectedColors:kF(e)};return h.headerCellHeight=Math.max(ZU(h.header.fontSize,p),ZU(h.dimensionValues.fontSize,p),32),h.contentCellHeight=Math.max(ZU(h.measureValues.fontSize,d),ZU(h.dimensionValues.fontSize,d),24),h.dimensionValueTextHeight=ZU(h.dimensionValues.fontSize,1),h})(h,d),[h,d]),E=((e,t,r)=>{const[,n,o]=Cz(async()=>{const t=$_(r.flags),n=e.getStyle("","","fontFamily"),o=e.getStyle("object","label.name","fontFamily"),i=e.getStyle("object","label.value","fontFamily"),a=e.getStyle("","","fontFamilies")??[];return Promise.all([...t,...a,n,o,i,Lz].filter(e=>void 0!==e).map(async e=>{await document.fonts.load(`600 12px ${e}`),await document.fonts.load(`12px ${e}`)}))},[t,e,r]);return o?(console.warn("Failed to load fonts:",o),!0):!n})(h,o,e),{direction:I}=M();oY([iY({model:i,layoutService:d,effectivePropertiesService:c,translator:m})]),k(()=>{!w&&i&&!!S&&E&&BU(n,{selections:f,baseObjects:{rect:x,pageInfo:v,qPivotDataPages:S,updatePageInfo:y,direction:I},nebulaObjects:{env:e,app:a,model:i,embed:s,theme:h,keyboard:l,translator:m,interactions:p},coreServices:{styleService:C,viewService:b,layoutService:d,downloadService:u,effectivePropertiesService:c}})},[i,a,x,p,f,b,d,u,w,S,C,n,E,m,g,v,y,c,s,l,h,e,I])},mY={version:"7.14.0",qHyperCubeDef:{qAlwaysFullyExpanded:!1,qDimensions:[],qMeasures:[],qMode:"P",qSuppressMissing:!0,qSuppressZero:!1,qShowTotalsAbove:!0,qInitialDataFetch:[{qTop:0,qLeft:0,qWidth:50,qHeight:50}],qIndentMode:!1},showTitles:!0,title:"",subtitle:"",footnote:"",nullValueRepresentation:{text:"-"},components:[]},gY=()=>({...mY,qHyperCubeDef:{...mY.qHyperCubeDef,qIndentMode:!1}})}}});
102
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var r,n,o,i,a,s,l,u,c,d,p=e.length,f=e.search(/[0-9\-\+#]/),h=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),v=p-g,y=e.substring(v,v+1),b=v+("."===y||","===y?1:0),x=g>0?e.substring(b,p):"";if(r=(t="-"===(e=e.substring(f,b)).charAt(0)?-t:+t)<0?t=-t:0,o=(n=e.match(/[^\d\-\+#]/g))&&n[n.length-1]||".",i=n&&n[1]&&n[0]||",",e=e.split(o),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(i),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(m="",v=(d=t[0]).length%l,p=d.length,b=0;b<p;b++)m+=d.charAt(b),!((b-v+1)%l)&&b<p-l&&(m+=i);t[0]=m}return t[1]=e[1]&&t[1]?o+t[1]:"","0"!==(n=t.join(""))&&""!==n||(r=!1),h+(r?"-":"")+n+x}},Wj({exports:{}});const eF="qHyperCubeDef.qDimensions",tF="dimensions",rF="qOtherTotalSpec.qTotalMode",nF="totalMode",oF={quarantine(e){e_.quarantineArrayProp({properties:e,arrayPath:eF,quarantineName:nF,arrayName:tF,itemPath:rF})},unquarantine(e){e_.unquarantineArrayProp({properties:e,arrayPath:eF,quarantineName:nF,arrayName:tF,itemPath:rF})}};function iF(e){const t=Qj(e);return(e,r,n,o)=>{const i=e_.hypercube.importProperties({exportFormat:e,initialProperties:r,dataDefinition:t.targets[0],hypercubePath:o}),a=i.qProperty.qHyperCubeDef.qDimensions.length,s=i.qProperty.qHyperCubeDef.qMeasures.length;let l,u=i.qProperty.qHyperCubeDef.qInterColumnSortOrder,c=!0;a+s===u.length&&Hj(i,"qProperty.qLayoutExclude.quarantine.interColSortOrder",u.concat());const d=i.qProperty.qLayoutExclude.quarantine?.pivotInterColSortOrder;d?(u=d,l=[...d],Hj(i,"qProperty.qHyperCubeDef.qInterColumnSortOrder",u),i.qProperty.qLayoutExclude.quarantine&&delete i.qProperty.qLayoutExclude.quarantine.pivotInterColSortOrder):u.length=0;const p=+(u.indexOf(-1)>-1),f=a+p;if(f>u.length)for(let e=u.length;e<f;e++)u.indexOf(e)<0&&u.push(e-p);for(let e=u.length-1;e>=0;e--)u[e]>=a&&u.splice(e,1);s>1&&u.indexOf(-1)<0?u.push(-1):s<2&&u.indexOf(-1)>-1&&u.splice(u.indexOf(-1),1);const h=i.qProperty.qHyperCubeDef.qNoOfLeftDims??-1;if(a>0&&-1===h&&Hj(i,"qProperty.qHyperCubeDef.qNoOfLeftDims",a),l?.length===u.length){for(let e=0;e<l.length;e++)if(l[e]!==u[e]){c=!1;break}c&&(e_.unquarantineProperty(i.qProperty,"noOfLeftDims"),e_.unquarantineProperty(i.qProperty,"excludedNoOfLeftDims "))}return e_.unquarantineProperty(i.qProperty,"rankedList"),e_.conditionalShow.unquarantine(i.qProperty),oF.unquarantine(i.qProperty),d_(i.qProperty),e_.unquarantineProperty(i.qProperty,"pivotTableIndentMode"),i}}function aF(e,t){const r=e.qProperty.qHyperCubeDef.qInterColumnSortOrder,n=r.slice(),o=r.indexOf(-1);o>-1&&r.splice(o,1);const i=e_.hypercube.exportProperties({propertyTree:e,hyperCubePath:t}),a=i.properties.qHyperCubeDef,s=a.qDimensions.length,l=a.qMeasures.length;let u=a.qInterColumnSortOrder;Hj(i,"properties.qLayoutExclude.quarantine.pivotInterColSortOrder",n),e_.quarantineProperty(i.properties,"qHyperCubeDef.qNoOfLeftDims","noOfLeftDims"),delete i.properties.qHyperCubeDef.qNoOfLeftDims,e_.quarantineProperty(i.properties,"qHyperCubeDef.rankedList","rankedList"),delete i.properties.qHyperCubeDef.rankedList;const c=i.properties.qLayoutExclude.quarantine?.interColSortOrder;c&&(u=c,Hj(i,"properties.qHyperCubeDef.qInterColumnSortOrder",u),Hj(i,"data.0.interColumnSortOrder",u),i.properties.qLayoutExclude.quarantine&&delete i.properties.qLayoutExclude.quarantine.interColSortOrder);for(let e=u.length;e<s+l;e++)u.length<=e&&u.push(e);return e_.quarantineProperty(i.properties,"qHyperCubeDef.qIndentMode","pivotTableIndentMode"),e_.quarantineProperty(i.properties,"qHyperCubeDef.excludedNoOfLeftDims ","excludedNoOfLeftDims "),e_.conditionalShow.quarantine(i.properties),oF.quarantine(i.properties),p_(i.properties),i}const sF=e=>({dimensions:{min:1,max:1e3,description(t,r,n){const o="rows"===n?.type?"Visualizations.Descriptions.Row":"Visualizations.Descriptions.Column";return e.translator.get(o)}},measures:{min:1,max:1e3,description:()=>e.translator.get("Visualizations.Descriptions.Values")}}),lF={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}}}};let uF=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}({}),cF=function(e){return e.Attribute="attribute",e.Dimension="dimension",e}({});const dF=e=>{switch(e?.type){case"url":return uF.Link;case"image":return uF.Image;case"indicator":return uF.Indicator;case"miniChart":return uF.MiniChart;default:return uF.Text}},pF=({isImagesEnabled:e})=>({uses:"dimensionRepresentationItems.representationType",options(t,r,n){const{qIndentMode:o}=n.properties.qHyperCubeDef,i=[{value:"text",translation:"Object.Table.Representation.Text"},{value:"url",translation:"Object.Table.Representation.Link"}];return(!o&&e||o)&&i.push({value:"image",translation:"Object.Table.Representation.Image"}),i}}),fF=e=>{if(e)return{representationImage:{uses:"dimensionRepresentationItems.representationImage",show:e=>dF(e.qDef.representation)===uF.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,r)=>{if(!r.properties.qHyperCubeDef)return!1;const{qInterColumnSortOrder:n,qNoOfLeftDims:o,qDimensions:i,qIndentMode:a}=r.properties.qHyperCubeDef;let s=!1;n?.indexOf(-1);const l=i?.indexOf(e)??1/0;return(n?.slice(0,o)??[]).indexOf(l)>-1&&(s=!0),s&&a}}}}}},hF=e=>{const{anything:t}=e,r=!t.sense?.isUnsupportedFeature?.("tableImages");return{representationType:pF({isImagesEnabled:r}),representationUrlPosition:{uses:"dimensionRepresentationItems.representationUrlPosition",show:e=>dF(e.qDef.representation)===uF.Link},representationUrlLabel:{uses:"dimensionRepresentationItems.representationUrlLabel",show:e=>dF(e.qDef.representation)===uF.Link&&e.qDef.representation?.urlPosition===cF.Dimension},representationLinkUrl:{uses:"dimensionRepresentationItems.representationLinkUrl",show:e=>dF(e.qDef.representation)===uF.Link&&e.qDef.representation?.urlPosition===cF.Attribute},...fF(r)}},mF=(e,t)=>{const{anything:r}=e,n=r.sense?.isUnsupportedFeature,o=!n?.("tableImages")&&t[uF.Image],i=!n?.("qMiniChartDef")&&t[uF.MiniChart],a=!n?.("tableIndicators")&&t[uF.Indicator],s=o&&t[uF.ImagesInIndentMode];return{representationType:{uses:"measureRepresentationItems.representationType",options:(e,t,r)=>(e=>{const{qIndentMode:t}=e.properties.qHyperCubeDef??{},r=[{value:"text",translation:"Object.Table.Representation.Text"}];return(!t&&o||t&&s)&&r.push({value:"image",translation:"Object.Table.Representation.Image"}),a&&r.push({value:"indicator",translation:"Object.Table.Representation.Indicator"}),i&&r.push({value:"miniChart",translation:"Common.MiniChart"}),r})(r)},representationImage:o?{uses:"measureRepresentationItems.representationImage",show:e=>dF(e.qDef.representation)===uF.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:i?{uses:"measureRepresentationItems.representationMiniChart"}:void 0}};let gF=function(e){return e.Dimension="dimensions",e.Measures="measures",e.Pivot="pivot",e}({}),vF=function(e){return e.CellForegroundColor="cellForegroundColor",e.CellBackgroundColor="cellBackgroundColor",e.ImageUrl="imageUrl",e.ImageLabel="imageLabel",e.Link="url",e.LinkLabel="urlLabel",e}({}),yF=function(e){return e.TopGrid="topGrid",e.LeftGrid="leftGrid",e.DataGrid="dataGrid",e}({}),bF=function(e){return e.Forward="forward",e.Backward="backward",e.None="none",e}({});const xF="image",SF=(e,t,r)=>{if(!r.properties.qHyperCubeDef.qIndentMode)return!0;const n=r.properties.qHyperCubeDef.qInterColumnSortOrder?.indexOf(-1)??-1;let o=r.properties.qHyperCubeDef.qNoOfLeftDims??-1;n>-1&&n<o&&(o-=1);const i=r.properties.qHyperCubeDef.qDimensions.indexOf(e);return 0===i||i>=o},wF=()=>({type:{type:"string",component:"dropdown",ref:"qDef.columnWidth.type",translation:"Object.Table.Column.Width",options:[{value:ST.Auto,translation:"Common.Auto"},{value:ST.FitToContent,translation:"Object.Table.Column.FitToContent"},{value:ST.Pixels,translation:"Object.Table.Column.Pixels"},{value:ST.Percentage,translation:"Object.Table.Column.Percentage"}],defaultValue:ST.Auto},sizePixels:{ref:"qDef.columnWidth.pixels",translation:"Object.Table.Column.Pixels",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:xT.PixelsDefault,show:e=>e.qDef.columnWidth?.type===ST.Pixels},sizePercentage:{ref:"qDef.columnWidth.percentage",translation:"Object.Table.Column.Percentage",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:xT.PercentageDefault,show:e=>e.qDef.columnWidth?.type===ST.Percentage}}),CF=({key:e,translation:t,env:r})=>{const n=!r.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=>!n||"labelTextAlign"===e||t.qDef.representation?.type!==xF},[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&&(!n||"labelTextAlign"===e||t.qDef.representation?.type!==xF)}}},EF="TOTAL_OFF",IF={component:"attribute-expression-reference",defaultValue:[],ref:"qAttributeExpressions",items:[{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.BackgroundExpression",defaultValue:"",id:vF.CellBackgroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.ForegroundExpression",defaultValue:"",id:vF.CellForegroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:vF.LinkLabel,tid:"URLLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:vF.Link,tid:"URLByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:vF.ImageLabel,tid:"ImageLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:vF.ImageUrl,tid:"ImageUrlByExpression",show:!1}]},DF="TOTAL_OFF",PF={component:"attribute-expression-reference",defaultValue:[],ref:"qAttributeExpressions",items:[{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.BackgroundExpression",defaultValue:"",id:vF.CellBackgroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.ForegroundExpression",defaultValue:"",id:vF.CellForegroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:vF.LinkLabel,tid:"URLLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:vF.Link,tid:"URLByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:vF.ImageLabel,tid:"ImageLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:vF.ImageUrl,tid:"ImageUrlByExpression",show:!1}]},RF=e=>{const{translator:t,anything:r,flags:n}=e,o=(e=>{const{translator:t,anything:r}=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:EF,trueOption:{value:"TOTAL_EXPR",translation:"properties.on"},falseOption:{value:EF,translation:"properties.off"},show:!r.sense?.isUnsupportedFeature?.("totals")&&SF},totalsLabel:{type:"string",component:"expression",expressionType:"StringExpr",ref:"qTotalLabel",translation:"properties.totals.label",defaultValue:()=>t.get("Object.Table.Totals"),show:(e,t,n)=>!r.sense?.isUnsupportedFeature?.("totals")&&e.qOtherTotalSpec?.qTotalMode!==EF&&SF(e,0,n)},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:IF,...CF({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...CF({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...hF(e),...wF()}}}},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:IF,...CF({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...CF({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...mF(e,{[uF.Image]:!0,[uF.Indicator]:!0}),...wF()}}}},filter:{type:"object",component:"filter-item-react",ref:"filter",tabName:"SimpleProperties.Filters.Filters"}}}})(e);return n.isEnabled("CLIENT_IM5974_PIVOT_DATA_PROPERTIES")?o:{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:DF,trueOption:{value:"TOTAL_EXPR",translation:"properties.on"},falseOption:{value:DF,translation:"properties.off"},show:!r.sense?.isUnsupportedFeature?.("totals")&&SF},totalsLabel:{type:"string",component:"expression",expressionType:"StringExpr",ref:"qTotalLabel",translation:"properties.totals.label",defaultValue:()=>t.get("Object.Table.Totals"),show:(e,t,n)=>!r.sense?.isUnsupportedFeature?.("totals")&&e.qOtherTotalSpec?.qTotalMode!==DF&&SF(e,0,n)},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:PF,...CF({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...CF({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...hF(e),...wF()}},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:PF,...CF({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...CF({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...mF(e,{[uF.Image]:!0,[uF.ImagesInIndentMode]:!0,[uF.Indicator]:!0}),...wF()}},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"}}}}}},MF=OS().palette,LF={TEXT:MF.text.primary,DISABLED:MF.text.disabled,HOVER:MF.action.hover,WHITE:Df.GREYSCALE_100,BORDER_MEDIUM:Df.GREYSCALE_85,DARK_MODE_TEXT:Df.GREYSCALE_95,DARK_MODE_BORDER:Df.GREYSCALE_95,DARK_MODE_DISABLED:Df.GREYSCALE_70,TRANSPARENT:"transparent",SELECTED:MF.primary.main,LINK:MF.info.main,ERROR:MF.error.main},AF=(e,t=LF.TEXT,r=LF.WHITE)=>{const n=D_(e??""),o=D_(t),i=D_(r);return n.isInvalid()?t:function(e,t,r){const n=P_(e,t),o=P_(e,r);if(void 0!==n&&void 0!==o)return n>o?t:r}(n,i,o).getRGB()},kF=e=>{const t=e.getStyle("","","dataColors.selected")||LF.SELECTED,r=function(e,t){const r=D_("#FFFFFF"),n=D_(e),o=D_(t);if(n.isInvalid()||o.isInvalid()||n.getAlpha()<1||o.getAlpha()<1)return t;const i=P_(r,n),a=P_(o,n),s=i>a||i>4.5;return!s&&a>3?o.getHex():s?"#FFFFFF":"#000000"}(t,LF.TEXT);return{background:t,color:r}},OF=(e,t)=>{const r=D_(e);return 0===r.a?(r.setAlpha(t.opacity),r.getString()):r.isDark()?r.getBrightenedColor(t.brighter).getString():r.getDarkenedColor(t.darker).getString()},qF=e=>{const t=D_(e);return t.isInvalid()?null:1===t.a?t.getRGB():t.getRGBA()},TF=e=>{e.stopPropagation(),e.preventDefault()},NF=(e,t,r,n)=>({ref:e,translation:t,dualOutput:!0,type:"object",component:"color-picker",width:"auto",disableNone:n??!1,defaultValue(e,t,o){const i=n?.(e,t,o)??!1,a=o.theme.current(),s=r(a,i);return{color:"transparent"===s?"none":s}}}),_F=(e,t=!1)=>{return{value:e,label:t?(r=e,r.charAt(0).toUpperCase()+r.slice(1)):e,groupHeader:!1,disabled:!1,styles:t?{fontFamily:e}:void 0};var r},jF=({ref:e,themeAccessor:t,translator:r,flags:n})=>({component:"dropdown",ref:e,options:(e,o,i)=>{const a=i.theme.current();return((e,t,r,n)=>{const o=t.fontFamily??"Source Sans Pro, sans-serif",i=t.fontFamilies??[],a=Array.from(new Set([e,o,...i])),s=[{value:"ThemeHeader",label:r.get("properties.themeFonts"),metaText:r.get("properties.theme"),groupHeader:!0},...a.sort().map(e=>_F(e,!0))],l=[{value:"DefaultHeader",label:r.get("properties.allFonts"),metaText:r.get("properties.default"),groupHeader:!0},...$_(n).filter(e=>!a.includes(e)).map(e=>_F(e,!0))];return[...s,...l.length>1?l:[]]})(t(a),a,r,n)},defaultValue:(e,r,n)=>t(n.theme.current())}),FF=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],zF=({ref:e,themeAccessor:t,translator:r})=>({component:"dropdown",ref:e,options:(e,n,o)=>{const i=o.theme.current();return((e,t,r)=>{const n=t.fontSize,o=t.fontSizes??[],i=Array.from(new Set([e,n,...o])),a=[{value:"ThemeHeader",label:r.get("properties.themeFontSizes"),metaText:r.get("properties.theme"),groupHeader:!0},...i.sort((e,t)=>parseInt(e,10)-parseInt(t,10)).map(e=>_F(e,!1))],s=[{value:"DefaultHeader",label:r.get("properties.allFontSizes"),metaText:r.get("properties.default"),groupHeader:!0},...FF.filter(e=>!i.includes(e)).map(e=>_F(e,!1))];return[...a,...s.length>1?s:[]]})(t(i),i,r)},defaultValue:(e,r,n)=>t(n.theme.current())}),WF=({section:e,defaultFontStyle:t,translator:r,flags:n,getThemeValue:o,translation:i,disableNoneCallback:a})=>({component:"panel-section",translation:i??`properties.pivot.${e}`,items:{content:{component:"items",ref:"components",key:"theme",items:{fontFamily:jF({ref:`${e}.fontFamily`,themeAccessor:t=>o(t,e,"fontFamily")??t.fontFamily,translator:r,flags:n}),fontWrapperItem:{component:"inline-wrapper",items:{fontStyle:{component:"font-style-buttons",width:!1,ref:`${e}.fontStyle`,defaultValue:t??[]},fontSize:zF({ref:`${e}.fontSize`,themeAccessor:t=>o(t,e,"fontSize")??t.fontSize,translator:r}),fontColor:NF(`${e}.fontColor`,void 0,t=>o(t,e,"color")??t.color)}},background:NF(`${e}.background`,"properties.background",(t,r)=>{const n=r?LF.WHITE:LF.TRANSPARENT;return o(t,e,"backgroundColor")??n},a)}}}}),$F=({section:e,defaultFontStyle:t,fallbackBackground:r,getThemeValue:n})=>({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:NF(`${e}.fontColor`,void 0,t=>n(t,e,"color")??t.color)}},background:NF(`${e}.background`,"properties.background",t=>n(t,e,"backgroundColor")??r??"transparent")}}}}),HF=(e,t)=>({component:"dropdown",ref:e,translation:t,options:[...Array(10).keys()].map(e=>({value:e+1,translation:e+1})),defaultValue:1}),VF="12px",BF="Source Sans Pro, sans-serif",GF="600",UF=15e3,YF=4/3;let KF=function(e){return e.Transparent="transparent",e.FontSecondary="#737373",e.DividerDark="#595959",e.DividerLight="#D9D9D9",e.NullValueBackground="#F2F2F2",e}({}),XF=function(e){return e.Solid="solid",e.None="none",e}({});const JF={display:"flex",justifyContent:"center",alignItems:"center"},ZF={borderStyle:"solid"},QF={boxSizing:"border-box",padding:"4px 8px",userSelect:"none",WebkitUserSelect:"none"},ez={lineHeight:YF,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},tz=e=>({whiteSpace:"unset",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",wordBreak:e>1?"break-word":"break-all"}),rz=(e,t)=>e>0?`${e}px ${XF.Solid} ${t}`:XF.None,nz=(e,t,r,n,o)=>{const i=Number(!t||o?.right),a=Number(!e||o?.bottom);return{borderRight:"rtl"!==n?rz(i,r):XF.None,borderBottom:rz(a,r),borderLeft:"rtl"===n?rz(i,r):XF.None,borderTop:XF.None}},oz=(e,t,r,n,o,i,a)=>{const s=nz(t,n,o,i,a);return e.isLeftDimension||(e.isLastDimension&&!t&&(s.borderBottom=rz(2,o)),r||(s.borderLeft="rtl"!==i?rz(1,o):"none",s.borderRight="rtl"===i?rz(1,o):"none")),s},iz=({bottomDivider:e,rightDivider:t,borderColor:r})=>{const n={};return e&&(n.borderBottom=rz(1,r)),t&&(n.borderRight=rz(1,r)),n},az=(e,t,r)=>{switch(t){case"header":return e.object?.pivotTableV2?.dimension?.label?.name?.[r];case"dimensionValues":return e.object?.pivotTableV2?.dimension?.label?.value?.[r];case"measureLabels":return e.object?.pivotTableV2?.measure?.label?.name?.[r];case"measureValues":return e.object?.pivotTableV2?.measure?.label?.value?.[r];case"totalValues":return e.object?.pivotTableV2?.total?.label?.value?.[r];case"nullValues":return e.object?.pivotTableV2?.null?.label?.value?.[r];default:return}},sz=(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:WF({section:"header",defaultFontStyle:["bold"],translator:e,flags:t,getThemeValue:az}),dimensionValueSection:WF({section:"dimensionValues",translator:e,flags:t,getThemeValue:az}),measureValueSection:WF({section:"measureValues",translator:e,flags:t,getThemeValue:az}),measureLabelSection:$F({section:"measureLabels",getThemeValue:az}),totalValuesSection:$F({section:"totalValues",defaultFontStyle:["bold"],getThemeValue:az}),nullValuesSection:$F({section:"nullValues",fallbackBackground:KF.NullValueBackground,getThemeValue:az}),gridSection:{translation:"properties.pivot.grid",component:"panel-section",items:{gridItems:{component:"items",ref:"components",key:"theme",items:{lineClamp:HF("grid.lineClamp","ThemeStyleEditor.style.rowHeight"),columnLineClamp:HF("grid.columnLineClamp","ThemeStyleEditor.style.columnHeight"),border:NF("grid.border","properties.border",e=>e.object?.pivotTableV2?.grid?.borderColor??KF.DividerLight),divider:NF("grid.divider","properties.pivot.divider",e=>e.object?.pivotTableV2?.grid?.divider?.borderColor??KF.DividerDark),background:NF("grid.background","properties.background",e=>e.object?.pivotTableV2?.grid?.backgroundColor??KF.Transparent)}}}}}}]}),lz=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}}},uz=(e,t)=>({uses:"settings",items:{presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:[sz(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:ST.Auto,translation:"Common.Auto"},{value:ST.Pixels,translation:"Object.Table.Column.Pixels"},{value:ST.Percentage,translation:"Object.Table.Column.Percentage"}],defaultValue:ST.Auto,show:e=>!!e.qHyperCubeDef.qIndentMode},sizePixels:{ref:"qHyperCubeDef.indentModeColumnWidth.pixels",translation:"Object.Table.Column.Pixels",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:xT.PixelsDefault,show:e=>{const t=e.qHyperCubeDef;return t.qIndentMode&&t.indentModeColumnWidth?.type===ST.Pixels}},sizePercentage:{ref:"qHyperCubeDef.indentModeColumnWidth.percentage",translation:"Object.Table.Column.Percentage",component:"expression",expressionType:"ValueExpression",expression:"optional",defaultValue:xT.PercentageDefault,show:e=>{const t=e.qHyperCubeDef;return t.qIndentMode&&t.indentModeColumnWidth?.type===ST.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,r,n){e.qHyperCubeDef.qExpansionState=[],n.$emit("saveProperties",e)}}}}]},...lz(t)}}),cz="auto",dz={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:cz,translation:"Object.Table.SortingInSearch",options:[{value:cz,translation:"Common.Auto"},{value:"inherit",translation:"Object.Table.SortingInSearch.InheritFromDimension"}]}}};function pz(e){const{translator:t,flags:r}=e;return{type:"items",component:"accordion",items:{data:RF(e),sorting:dz,addons:lF,settings:uz(t,r)}}}function fz(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:pz(e),importProperties:iF(e),exportProperties:aF,exploration:ON(e),data:sF(e),propertyHandler:e.flags.isEnabled("VNA-147_NEBULA_PIVOT_DATA_HANDLERS")?t=>new ZN(t,e.translator):void 0}}const hz=()=>{let e;return{promise:new Promise(t=>{e=t}),resolve:e}};function mz(e,t){return R(()=>e,t)}const gz={},vz=e=>{const t=R(()=>({current:gz}),[]);return t.current=t.current===gz?e:t.current,t},yz=e=>!!e&&0===D_(e).a,bz="#grid",xz=(e,t)=>{const r=t?.closest(e);return r&&window.getComputedStyle(r).backgroundColor},Sz=(e,t,r,n,o)=>{const i=xz(".qv-object .qv-inner-object",r),a=xz(".qv-panel-sheet",r),s=xz(bz,r)??a,l=(e=>{const t=e.components?.find(e=>"general"===e.key),r=t?.bgColor?.colorExpression,n=t?.bgColor?.color?.color,o=t?.bgColor?.useColorExpression;if(o&&r)return qF(r);if("none"===n)return"transparent";if(void 0===n)return;const i=D_(n);return i.setAlpha(t?.bgColor?.color?.alpha??i.a),i.getRGBA()})(e),u=n?.(t),c=o?.(t),d=l||u||i||c,p=yz(d),f=!yz(h=p?s:d)&&AF(h,LF.TEXT,LF.DARK_MODE_TEXT)===x_(LF.DARK_MODE_TEXT);var h;const m=((e,t,r,n=LF.WHITE)=>e&&!yz(e)?e:yz(t)?r&&!yz(r)?r:n:t)(l,d,s);return{color:d,headerColor:m,isDark:f}},wz=(e,t,r,n)=>{const o=O(),i=((e,t={attributeFilter:["style"],childList:!1,subtree:!1})=>{const[r,n]=A([]);return k(()=>{let r;return e&&(r=new MutationObserver(e=>{n(e)}),r.observe(e,t)),()=>{r?.disconnect()}},[e,t]),r})(t.closest(bz),{attributeFilter:["style"],childList:!1,subtree:!1,attributeOldValue:!0}).filter(({oldValue:e})=>e?.includes("background")).map(({oldValue:e})=>e).join(",");return R(()=>({...o,background:Sz(e,o,t,r,n)}),[o.name(),t,r,n,e,i])};function Cz(e,t){const r=R(()=>({isLoading:!0}),t),[n,o]=L(async()=>{try{return await e()}finally{r.isLoading=!1}},t);return[n,r.isLoading,o]}const Ez=3,Iz=/\n/g;function Dz(e,t,r){let n=0,o=e.length;if(Number.isNaN(t))return null;if(e.length<=1)return null;if(r(e)<=t)return null;for(;n<=o;){const i=Math.floor((n+o)/2),a=e.slice(0,i),s=e.slice(0,i-1),l=r(a),u=r(s);if(l>t&&u<=t)return e.slice(i-1)||null;if(l===t)return e.slice(i)||null;l<t?n=i+1:o=i}return null}function Pz({fontSize:e="12px",fontFamily:t="Source Sans Pro, Arial, sans-serif",fontStyle:r="normal",fontWeight:n="normal"},o){const{maxNbrLinesOfText:i=Ez,allowLineBreaks:a=!0}=o??{},{estimateWidth:s,measureText:l,estimateLineCount:u}=v(()=>(({fontSize:e="12px",fontFamily:t="Source Sans Pro, Arial, sans-serif",fontStyle:r="normal",fontWeight:n="normal"},o)=>{const{maxNbrLinesOfText:i=Ez,allowLineBreaks:a=!0}=o??{};return()=>{const o=document.createElement("canvas").getContext("2d");o.font=`${r} ${n} ${e} ${t}`;const s=o.measureText.bind(o),l=Vj(e=>{if(void 0===e)return 0;if(a){const t=e.split(Iz).map(e=>s(e).width);return t.reduce((e,t)=>t>e?t:e,0)}const t=e.replace(Iz," ");return s(t).width}),u=e=>+l(e).toFixed(2),c=Vj(({text:e,maxWidth:t,isNumeric:r=!1})=>{if(r)return 1;const n=a?e.split(Iz):[e];let o=0;for(const e of n){let r=e;do{o+=1,r=Dz(r,t,u)}while(null!==r&&o<i);if(o>=i)break}return o},({text:e,maxWidth:t,isNumeric:r})=>`${e}-${t}-${r?"true":"false"}`);return{measureText:e=>l(e),estimateWidth:e=>l("N")*e,estimateLineCount:c}}})({fontStyle:r,fontWeight:n,fontSize:e,fontFamily:t},{maxNbrLinesOfText:i,allowLineBreaks:a})(),[r,n,e,t,i,a]);return{estimateWidth:s,measureText:l,estimateLineCount:u}}var Rz,Mz=E;Rz=Mz.createRoot,Mz.hydrateRoot;const Lz="Source Sans Pro, sans-serif";function Az(e,t){const[r,n]=m(t);r.some((e,r)=>e!==t[r])&&(n(t),e())}var kz={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 Oz=({translator:e})=>(v(()=>{!function(e){if(e&&e.get&&e.add){const t="NebulaTableUtils.MenuGroupLabel.Sorting";if(e.get(t)!==t)return;Object.keys(kz).forEach(t=>{e.add(kz[t])})}}(e)},[e]),e),qz={width:"100%",height:"100%",color:"transparent",background:"transparent",borderColor:"transparent"},Tz={border:0,boxShadow:"none",borderRadius:0,outline:0,width:0,height:0,background:"transparent",cursor:"pointer",visibility:"hidden"},Nz=fl("input",{shouldForwardProp:e=>"isLastColumn"!==e&&"hoverColor"!==e})(({isLastColumn:e,hoverColor:t,dir:r})=>({position:"absolute",display:"flex",height:"100%",top:0,marginLeft:"-4px",marginRight:"rtl"===r?"-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":{...qz},"&::-moz-range-track":{...qz},"&::-ms-track":{...qz},"&::-webkit-slider-thumb":{appearance:"none",WebkitAppearance:"none",...Tz},"&::-moz-range-thumb":{...Tz},"&::-ms-thumb":{...Tz},"&: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"}})),_z=({columnWidth:e,keyValue:t,isLastColumn:r,isPivot:n,hoverColor:o,updateWidthCallback:i,confirmWidthCallback:a,handleBlur:s,setIsAdjustingWidth:u,isLeftColumn:c,accessibilityRelatedArgs:d,direction:p="ltr"})=>{const f=Oz({translator:d.translator}),h=l({initWidth:e,columnWidth:e,initX:0}),m=r?0:1,g=n&&!c,v=()=>g?h.current.columnWidth-m:"100%",y={left:"rtl"!==p?v():void 0,right:"rtl"===p?v():void 0},b=t=>{h.current={initWidth:e,columnWidth:e,initX:t??h.current.initX}};Az(()=>{g&&b()},[e]);const x=e=>{const t=Math.max(e,xT.PixelsMin);h.current.columnWidth=t,i(t)},S=()=>{if(h.current.columnWidth!==h.current.initWidth){const e={type:ST.Pixels,pixels:h.current.columnWidth};a(e)}u?.(!1)},w=e=>{const t="rtl"===p?h.current.initWidth+h.current.initX-e.clientX:h.current.initWidth+e.clientX-h.current.initX;x(t)},C=e=>{TF(e),document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",C),S()},E=e=>{const t="rtl"===p?h.current.initWidth+-h.current.initX-e.touches[0].clientX:h.current.initWidth+e.touches[0].clientX-h.current.initX;x(t)},I=e=>{TF(e),document.removeEventListener("touchmove",E),document.removeEventListener("touchend",I),S()},D=!n&&s?e=>{if(e.key===yT.Left||e.key===yT.Right){TF(e);const t=5,r=e.key===yT.Left?t:-t,n="rtl"===p?r:-r;u?.(!0),x(h.current.columnWidth+n)}else e.key===yT.Space||e.key===yT.Enter?(TF(e),s(e),u?.(!1),S()):e.key===yT.Esc&&(TF(e),s(e),u?.(!1),x(h.current.initWidth))}:void 0,P=f.get("NebulaTableUtils.ColumnAdjuster.ColumnNameLabel",[String(d.columnLabel)]);return ii.jsx(Nz,{style:y,hoverColor:o,isLastColumn:r,className:bT,"data-testid":bT,onMouseDown:e=>{TF(e),document.addEventListener("mousemove",w),document.addEventListener("mouseup",C),u?.(!0),b(e.clientX)},onDoubleClick:()=>{a({type:ST.FitToContent})},onTouchStart:e=>{1===e.touches.length&&(TF(e),document.addEventListener("touchmove",E),document.addEventListener("touchend",I),u?.(!0),b(e.touches[0].clientX))},onKeyDown:D,onBlur:s,onFocus:()=>{b()},type:"range",tabIndex:-1,"aria-label":P,"aria-valuemin":xT.PixelsMin,"aria-valuemax":xT.PixelsMax,"aria-valuenow":Number(e.toFixed(1)),dir:p},t)},jz=x((e,t)=>ii.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:ii.jsx("path",{d:"M15 4H1V2h14zm0 10H1v-2h14zm0-5H1V7h14z"})})),Fz=fl(Qu,{shouldForwardProp:e=>"rightAligned"!==e&&"shouldShowMenuIcon"!==e&&"isAccessibleHeader"!==e})(({rightAligned:e,shouldShowMenuIcon:t,isAccessibleHeader:r})=>({...e?{marginRight:"auto"}:{marginLeft:"auto"},height:r?24:void 0,display:t?"flex":"none",fontWeight:"bold",width:r?"100%":void 0,alignItems:"center",justifyContent:"center"})),zz=fl(jz,{shouldForwardProp:e=>"isInteractionsActive"!==e})(({isInteractionsActive:e})=>({minWidth:"unset",position:"relative",cursor:e?"pointer":"default"})),Wz=fl(hp)(({theme:e})=>({".MuiList-root":{padding:e.spacing(.5,0)}})),$z=fl(Uc)(({theme:e})=>({"&.MuiDivider-root":{margin:e.spacing(.5)}})),Hz=fl(bp)(({theme:e})=>({fontSize:"12px",height:24,fontWeight:"bold",padding:`${e.spacing(.25,2)} !important`,marginBottom:e.spacing(.5)})),Vz=fl(bp,{shouldForwardProp:e=>"isSubMenu"!==e&&"isActive"!==e})(({theme:e,isSubMenu:t,isActive:r})=>({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:r?"rgba(0, 0, 0, 0.05)":"transparent"})),Bz=fl("div",{shouldForwardProp:e=>!["direction","isPagination"].includes(e)})(({theme:e,direction:t,isPagination:r})=>({position:"absolute",width:e.spacing(.5),height:16,left:0,right:r||"rtl"!==t?void 0:0,top:"50%",transform:"TranslateY(-50%)",borderRadius:"0 2px 2px 0",background:"#01873d"})),Gz=fl("div")(()=>({display:"flex",justifyContent:"space-between",alignItems:"center",maxWidth:"100%"})),Uz=fl(mu)(()=>({fontFamily:'"Source Sans Pro", HelveticaNeue, "Helvetica Neue", Helvetica, Arial, sans-serif',fontSize:"14px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"})),Yz=fl(Wd,{shouldForwardProp:e=>!["direction","isPagination"].includes(e)})(({theme:e,direction:t,isPagination:r})=>({width:16,minWidth:"unset !important",marginRight:r||"rtl"!==t?e.spacing(1.5):0,marginLeft:r||"rtl"!==t?void 0:e.spacing(1.5),lineHeight:0})),Kz=x((e,t)=>ii.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:ii.jsx("path",{d:"M8.5 8 4 3.5 5.5 2l6 6-6 6L4 12.5z"})})),Xz=e=>{const t=e.nextElementSibling;return t?"HR"===t.tagName?Xz(t):t:e.parentElement?.children?.[0]},Jz=e=>{const t=e.previousElementSibling;if(!t){const t=e.parentElement?.children?.length;return e.parentElement?.children?.[t-1]}return"HR"===t.tagName?Jz(t):t},Zz=e=>{const{key:t,currentTarget:r}=e,n=document.activeElement??r;if(t===yT.Down||t===yT.Up){const r=e=>t===yT.Down?Xz(e):Jz(e);e.preventDefault(),e.stopPropagation();let o=r(n);for(;o;){if("true"!==o.ariaDisabled){o.focus();break}o=r(o)}}},Qz=(e,t)=>e.map(e=>e.map(e=>({...e.groupHeading?{groupHeading:e.groupHeading}:{},items:e.items.map(({onClick:e,...r})=>({...r,...e?{onClick:async r=>{Object.entries(t).forEach(([,e])=>{e(!1)}),await e(r)}}:{}}))})));let eW={};const tW=({autoFocus:e,id:t,onClick:n,itemTitle:o,icon:i,enabled:a,subMenus:s,isSubMenu:l,isActive:u,direction:c,isPagination:d})=>{const[p,h]=m(!1),g=r.useRef(null),v=f(e=>{e.stopPropagation(),h(!1)},[h]);return ii.jsxs(ii.Fragment,{children:[ii.jsxs(Vz,{ref:s?g:null,"data-testid":`menu-item-${t}`,className:"nebula-table-utils-head-menu-item",onClick:async e=>{"keyup"!==e.type&&(n&&(await n(e),eW={}),s?.length&&(h(!0),eW[o]=h,e.stopPropagation()))},disabled:!a,autoFocus:e,isSubMenu:!!l,isActive:!!u,onKeyDown:Zz,children:[u?ii.jsx(Bz,{direction:c,isPagination:d}):null,ii.jsxs(Gz,{children:[ii.jsx(Yz,{direction:c,isPagination:d,children:ii.jsx(i,{})}),ii.jsx(Uz,{variant:"body2",children:o})]}),s?.length?ii.jsx(Kz,{}):null]},t),s?.length?ii.jsx(iW,{isSubMenu:!0,open:p,anchorEl:g.current,onClose:v,menuGroups:Qz(s,eW),transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"top"},direction:c,isPagination:d}):null]})},rW=({menuGroup:e,isSubMenu:t,direction:r,isPagination:n})=>e.map(e=>[[e.groupHeading&&ii.jsx(Hz,{disabled:!0,style:{opacity:1},children:e.groupHeading},e.groupHeading),e.items.map(e=>ii.jsx(tW,{...e,isSubMenu:t,direction:r,isPagination:n},e.id))].filter(Boolean)]),nW=({itemGroups:e,isSubMenu:t,direction:r,isPagination:n})=>e.map((o,i)=>[rW({menuGroup:o,isSubMenu:t,direction:r,isPagination:n}),i<e.length-1?ii.jsx($z,{"data-testid":"group-divider",variant:"middle"}):void 0]),oW={appear:0,enter:0,exit:0},iW=({anchorEl:e,open:t,onClose:r,menuGroups:n,transformOrigin:o,anchorOrigin:i,isSubMenu:a,direction:s,isPagination:l})=>n.length?ii.jsx(Wz,{className:"nebula-table-utils-head-menu",open:t,anchorEl:e,onClose:r,transitionDuration:oW,MenuListProps:{id:"nebula-table-utils-head-menu-list-id"},...i?{anchorOrigin:i}:{},...o?{transformOrigin:o}:{},dir:s,children:nW({itemGroups:n,isSubMenu:a,direction:s,isPagination:l})}):null,aW=(e,t)=>e.some(e=>t[e]>0),sW={canSelectAll:!1,canClearSelections:!1,canSelectPossible:!1,canSelectAlternative:!1,canSelectExcluded:!1},lW=({open:e,qStateName:t="$",headerData:r,app:n})=>{const[o,i]=m(null),[a,s]=m(sW);return Az(()=>{e||(s(sW),i(null))},[e]),d(()=>{if(!n?.createSessionObject||!r.isDim||!e)return()=>{};let o,a=!1;const l=()=>{o&&n.destroySessionObject(o)};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,r),u=await n.createSessionObject(e),c=await u.getLayout(),{qStateCounts:d}=c.qListObject?.qDimensionInfo??{};o=c.qInfo?.qId,a?l():(i(u),d&&s((e=>({canSelectAll:aW(["qOption","qAlternative","qExcluded","qDeselected"],e),canClearSelections:aW(["qSelected"],e),canSelectPossible:aW(["qOption"],e),canSelectAlternative:aW(["qAlternative"],e),canSelectExcluded:aW(["qAlternative","qExcluded"],e)}))(d)))}catch(e){console.error(e)}})(),()=>{a=!0,l()}},[e,n,r,t]),{fieldInstance:o,selectionActionsEnabledStatus:a}},uW=x((e,t)=>ii.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:ii.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"})})),cW=x((e,t)=>ii.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:ii.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"})})),dW=x((e,t)=>ii.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:ii.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"})})),pW=x((e,t)=>ii.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:ii.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"})})),fW=x((e,t)=>ii.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:ii.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"})})),hW=x((e,t)=>ii.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:ii.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"})})),mW=x((e,t)=>ii.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:ii.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"})})),gW=x((e,t)=>ii.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:ii.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"})})),vW=x((e,t)=>ii.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:ii.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"})})),yW=x((e,t)=>ii.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:ii.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"})})),bW=x((e,t)=>ii.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:ii.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"})})),xW=x((e,t)=>ii.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:ii.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"})})),SW=x((e,t)=>ii.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:ii.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 wW=function(e){return e.Sorting="sorting",e.Searching="searching",e.Selections="selections",e.AdjusterHeaderSize="adjustHeaderSize",e}({});const CW="/qListObjectDef",EW=({headerData:e,translator:t,menuAvailabilityFlags:r,setOpen:n,sortFromMenu:o,interactions:i,embedListbox:a,fieldInstance:s,selectionActionsEnabledStatus:l,anchorRef:u,focusColumnAdjuster:c,setActiveFieldCallback:d,expandOrCollapseArgs:p})=>{const f=[];if(r[wW.Sorting]){const{isActivelySorted:r,sortDirection:i}=e,{ascendingEnabled:a,descendingEnabled:s}=(({isActivelySorted:e,sortDirection:t,isPivot:r,isSortedByFirstMeasure:n})=>{let o=!r&&!e||"D"===t,i=!r&&!e||"A"===t;return n&&(o=!1,i=!1),{ascendingEnabled:o,descendingEnabled:i}})(e);f.push([{groupHeading:t.get("NebulaTableUtils.MenuGroupLabel.Sorting"),items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SortAscending"),onClick:async e=>{e.stopPropagation(),await(o?.(e,"A")),n(!1)},icon:uW,enabled:a,isActive:!!r&&"A"===i,autoFocus:a},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SortDescending"),onClick:async e=>{e.stopPropagation(),await(o?.(e,"D")),n(!1)},icon:pW,enabled:s,isActive:!!r&&"D"===i,autoFocus:!a&&s}]}])}if(e.isCyclic&&d){const t=[];t.push([{items:[{id:1,itemTitle:e.groupDimensionLabels[e.groupDimensionPos],enabled:!0,icon:mW,subMenus:[[{items:e.groupDimensionLabels.map((t,r)=>({id:r+1,itemTitle:t,onClick:async e=>{e.stopPropagation(),n(!1),d(r)},enabled:!0,icon:vN,isActive:e.groupDimensionPos===r}))}]]}]}]),t.length>0&&f.push(...t)}if(e.isDim&&i?.select){const o=[];r[wW.Searching]&&o.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Search"),onClick:e=>{e.stopPropagation(),n(!1),a()},icon:gW,enabled:!0}]}]),!e.isLocked&&r[wW.Selections]&&o.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Selections"),icon:SW,enabled:!!s,subMenus:[[{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectAll"),onClick:async e=>{e.stopPropagation(),n(!1),await(s?.selectListObjectAll(CW))},icon:vW,enabled:l.canSelectAll},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectPossible"),onClick:async e=>{e.stopPropagation(),n(!1),await(s?.selectListObjectPossible(CW))},icon:xW,enabled:l.canSelectPossible},{id:3,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectAlternative"),onClick:async e=>{e.stopPropagation(),n(!1),await(s?.selectListObjectAlternative(CW))},icon:yW,enabled:l.canSelectAlternative},{id:4,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectExcluded"),onClick:async e=>{e.stopPropagation(),n(!1),await(s?.selectListObjectExcluded(CW))},icon:bW,enabled:l.canSelectExcluded}]}],[{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.ClearSelections"),onClick:async e=>{e.stopPropagation(),n(!1),await(s?.clearSelections(CW))},icon:cW,enabled:l.canClearSelections}]}]]}]}]),p&&!p.alwaysFullyExpanded&&f.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Expand"),onClick:async e=>{e.stopPropagation(),e.preventDefault(),n(!1),await p.expandCallback()},icon:hW,enabled:!0},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Collapse"),onClick:async e=>{e.stopPropagation(),e.preventDefault(),n(!1),await p.collapseCallback()},icon:fW,enabled:!0}]}]),o.length>0&&f.push(...o)}return r[wW.AdjusterHeaderSize]&&f.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.AdjustColumnSize"),onClick:e=>{e.stopPropagation(),e.preventDefault(),n(!1),c?.(u)},icon:dW,enabled:!0}]}]),f},IW=({open:e,setOpen:t,anchorRef:r,headerData:n,translator:o,interactions:i,menuAvailabilityFlags:a,shouldShowMenuIcon:s=!0,sortRelatedArgs:u,searchRelatedArgs:c,selectionRelatedArgs:d,adjustHeaderSizeRelatedArgs:p,expandOrCollapseArgs:h,model:m,direction:g="ltr",isPagination:v,isAccessibleHeader:y,iconSize:b=mT})=>{const x=l(null),S=Oz({translator:o}),{qLibraryId:w,fieldId:C,headTextAlign:E}=n,I=d?.app,{fieldInstance:D,selectionActionsEnabledStatus:P}=lW({open:e,headerData:n,app:I,qStateName:d?.qStateName}),R=(({model:e,headerData:t})=>{if(e&&"setActiveField"in e&&void 0!==t.dimensionInfoIndex){const r=t.dimensionInfoIndex;return async t=>{try{await e.setActiveField("/qHyperCubeDef",r,t)}catch(e){console.error(e)}}}return null})({model:m,headerData:n}),M=(({qLibraryId:e,fieldId:t,searchRelatedArgs:r,selectionRelatedArgs:n,direction:o,onPopoverClose:i})=>f(()=>{const a=e?{qLibraryId:e,type:"dimension"}:t;if(r?.embed){const{embed:e,listboxRef:t}=r;e.__DO_NOT_USE__.popover(t.current,a,{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"rtl"===o?"right":"left"},sortCriteria:r.sortCriteria,stateName:n?.qStateName,direction:o,onPopoverClose:i})}},[e,t,r,n?.qStateName,o,i]))({qLibraryId:w,fieldId:C,searchRelatedArgs:c,selectionRelatedArgs:d,direction:g}),L=f(e=>{e.stopPropagation(),t(!1)},[t]),A=f(e=>{e.stopPropagation(),t(e=>!e)},[t]);return i.active?ii.jsxs(Fz,{rightAligned:"right"===E,shouldShowMenuIcon:s,className:"nebula-table-utils-head-menu-wrapper",onClick:!1===y?A:void 0,ref:x,isAccessibleHeader:y,children:[s?ii.jsx(zz,{height:b,className:gT,"data-testid":gT,isInteractionsActive:i.active??!1,children:ii.jsx(jz,{})}):null,ii.jsx(iW,{open:e,anchorEl:!1===y?x.current:r.current,onClose:L,menuGroups:EW({headerData:n,translator:S,menuAvailabilityFlags:a,setOpen:t,...u,embedListbox:M,interactions:i,fieldInstance:D,selectionActionsEnabledStatus:P,anchorRef:r,focusColumnAdjuster:p?.focusColumnAdjuster,setActiveFieldCallback:R,expandOrCollapseArgs:h}),direction:g,isPagination:v})]}):null},DW=e=>e.isDark?{background:e.color,borderColor:LF.DARK_MODE_BORDER,color:LF.DARK_MODE_TEXT,disabledColor:LF.DARK_MODE_DISABLED,iconColor:LF.DARK_MODE_TEXT}:{background:e.color,borderColor:LF.BORDER_MEDIUM,color:LF.TEXT,disabledColor:LF.DISABLED},PW=fl(Qu,{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}`})),RW=fl(Qp,{shouldForwardProp:e=>"footerStyle"!==e})(({footerStyle:e,theme:t})=>({background:"inherit",marginRight:t.spacing(1),color:e.color,"& .MuiNativeSelect-icon, .MuiNativeSelect-select":{color:e.iconColor}})),MW=fl(uc,{shouldForwardProp:e=>"disabledCondition"!==e&&"footerStyle"!==e})(({disabledCondition:e,footerStyle:t,theme:r})=>({color:e?t.disabledColor:t.color,cursor:e?"default":"pointer",marginLeft:r.spacing(1)})),LW=fl(mu)(({theme:e})=>({color:"inherit",margin:e.spacing(0,1,0,1)})),AW=({children:e,footerContainer:t,interactions:r,theme:n,paginationNeeded:o=!0})=>{const i=v(()=>DW(n.background),[n]);if(!r.active)return null;const a=o?ii.jsx(PW,{footerStyle:i,children:e}):null;return t?E.createPortal(e,t):a},kW=u({}),OW=()=>h(kW),qW=({children:e,direction:t,pageInfo:r,handleChangeRowsPerPage:n,footerContainer:o,isSelectionMode:i,handleChangePage:a,totalRowCount:s,totalColumnCount:l,totalPages:u,keyboard:c,translator:d,theme:p,interactions:f,rect:h,layout:m,visibilityThreshold:g})=>{const y=(e=>!e.enabled||e.active)(c)?0:-1,b=v(()=>DW(p.background),[p]),x=o?o.getBoundingClientRect().width:h.width,S=Oz({translator:d}),w=v(()=>({direction:t,pageInfo:r,handleChangeRowsPerPage:n,footerContainer:o,isSelectionMode:i,handleChangePage:a,totalRowCount:s,totalColumnCount:l,totalPages:u,keyboard:c,translator:S,theme:p,interactions:f,rect:h,layout:m,footerStyle:b,tabIndex:y,width:x,visibilityThreshold:g}),[t,r,n,o,i,a,s,l,u,c,S,p,f,h,m,b,y,x,g]);return ii.jsx(kW.Provider,{value:w,children:e})};let TW=function(e){return e.FirstPage="FirstPage",e.LastPage="LastPage",e.NextPage="NextPage",e.PreviousPage="PreviousPage",e}({}),NW=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 _W=x((e,t)=>ii.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:ii.jsx("path",{d:"m7 8 4.5 4.5L10 14 4 8l6-6 1.5 1.5z"})})),jW=x((e,t)=>ii.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:ii.jsx("path",{d:"m12 2 1.5 1.5L9 8l4.5 4.5L12 14 6 8zM4 2v12H2V2z"})})),FW=x((e,t)=>ii.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:ii.jsx("path",{d:"m3.5 2 6 6-6 6L2 12.5 6.5 8 2 3.5zM14 2v12h-2V2z"})})),zW={FirstPage:jW,PreviousPage:_W,NextPage:Kz,LastPage:FW,FirstPageRTL:FW,PreviousPageRTL:Kz,NextPageRTL:_W,LastPageRTL:jW},WW=({disabledCondition:e,pageNumber:t,type:r})=>{const{direction:n,footerStyle:o,handleChangePage:i,translator:a,interactions:s,tabIndex:l}=OW(),u=r.concat("rtl"===n?"RTL":""),c=zW[u];return{styledProps:{footerStyle:o,disabledCondition:e,size:"small","data-testid":"pagination-action-icon-button","aria-disabled":e,"aria-label":a.get(`NebulaTableUtils.Pagination.${r}`),title:s.passive?a.get(`NebulaTableUtils.Pagination.${r}`):void 0,tabIndex:l,onClick:e?void 0:()=>{i(t)}},IconComponent:c}},$W=()=>{const{pageInfo:e,width:t,interactions:r,visibilityThreshold:n}=OW(),o=0===e.page,{IconComponent:i,styledProps:a}=WW({type:TW.FirstPage,disabledCondition:o,pageNumber:0});return t<=(n?.firstPage||NW.FirstPage)?null:ii.jsx(MW,{...a,disabled:!r.active,children:ii.jsx(i,{height:mT})})},HW=(e,t,r=!1)=>{r&&e.key===yT.Tab&&!e.shiftKey&&(TF(e),((e,t,r)=>{const n=e.closest(".qv-object-wrapper")?.querySelector(".sel-toolbar-confirm")?.parentElement??document.querySelector("#qv-selection-toolbar-popover .sel-toolbar-confirm")?.parentElement;n?n.focus():t.focusSelection?.(r)})(e.target,t,!1))},VW=()=>{const{pageInfo:e,keyboard:t,totalPages:r,isSelectionMode:n,width:o,interactions:i,visibilityThreshold:a}=OW(),s=e.page>=r-1,{IconComponent:l,styledProps:u}=WW({type:TW.LastPage,disabledCondition:s,pageNumber:r-1}),c=t.enabled?e=>{HW(e,t,n)}:void 0;return o<=(a?.lastPage||NW.LastPage)?null:ii.jsx(MW,{...u,onKeyDown:c,disabled:!i.active,children:ii.jsx(l,{height:mT})})},BW=()=>{const{pageInfo:e,keyboard:t,totalPages:r,isSelectionMode:n,width:o,interactions:i}=OW(),a=e.page>=r-1,{IconComponent:s,styledProps:l}=WW({type:TW.NextPage,disabledCondition:a,pageNumber:e.page+1}),u=!(o>NW.FirstPage&&o>NW.LastPage)&&t.enabled?e=>{HW(e,t,n)}:void 0;return ii.jsx(MW,{...l,onKeyDown:u,disabled:!i.active,children:ii.jsx(s,{height:mT})})},GW=()=>{const{pageInfo:e,interactions:t}=OW(),r=0===e.page,{IconComponent:n,styledProps:o}=WW({type:TW.PreviousPage,disabledCondition:r,pageNumber:e.page-1});return ii.jsx(MW,{...o,disabled:!t.active,children:ii.jsx(n,{height:mT})})},UW=()=>{const{translator:e,width:t,pageInfo:r,totalRowCount:n,visibilityThreshold:o}=OW(),{page:i,rowsPerPage:a}=r;if(t<=(o?.displayedRowsLabel||NW.DisplayedRowsLabel))return null;const s=e.get("NebulaTableUtils.Pagination.DisplayedRowsLabel",[`${i*a+1} - ${Math.min((i+1)*a,n)}`,n.toString()]);return ii.jsx(LW,{variant:"caption",dir:"ltr",children:s})},YW=({name:e,value:t,options:r,handleChange:n})=>{const{layout:o,footerStyle:i,translator:a,tabIndex:s,interactions:l}=OW(),u=o.qInfo.qId,c=a.get(`NebulaTableUtils.Pagination.${e}`),d=`${e}-dropdown`,p=`${d}-label-${u}`,f={tabIndex:s,id:`${d}-${u}`,"data-testid":d,"aria-labelledby":p};return ii.jsxs(ii.Fragment,{children:[ii.jsxs(LW,{variant:"caption",id:p,children:[c,":"]}),ii.jsx(RW,{footerStyle:i,size:"small",native:!0,value:t,onChange:n,inputProps:f,disabled:!l.active,children:r})]})},KW=()=>{const{pageInfo:e,isSelectionMode:t,totalColumnCount:r,width:n,handleChangeRowsPerPage:o,visibilityThreshold:i}=OW();if(!(!!e.rowsPerPageOptions?.length&&!t&&n>(i?.rowsPerPage||NW.RowsPerPage)&&r<=100)||void 0===e.rowsPerPageOptions)return null;const a=ii.jsx(ii.Fragment,{children:e.rowsPerPageOptions.map(e=>ii.jsx("option",{value:e,children:e},e))});return ii.jsx(YW,{name:"RowsPerPage",value:e.rowsPerPage,options:a,handleChange:e=>{o?.(+e.target.value)}})},XW=1e3,JW="…",ZW=({totalPages:e,page:t})=>{const r=Math.min(e,XW),n=r<e&&t>500,o=n?Math.min(500+t,e):r,i=n?Math.max(0,o-XW):0,a=Array.from(Array(r).keys()).map(e=>{const t=e+i;return ii.jsx("option",{value:t,children:t+1},t)});return i>0&&a.unshift(ii.jsx("option",{value:JW,disabled:!0,children:JW},"startMoreOptions")),o<e-1&&a.push(ii.jsx("option",{value:JW,disabled:!0,children:JW},"endMoreOptions")),ii.jsx(ii.Fragment,{children:a})},QW=()=>{const{pageInfo:e,width:t,totalPages:r,handleChangePage:n,visibilityThreshold:o}=OW(),{page:i}=e;if(t<=(o?.selectPage||NW.SelectPage))return null;const a=ii.jsx(ZW,{totalPages:r,page:i});return ii.jsx(YW,{name:"SelectPage",value:i,options:a,handleChange:e=>{n(+e.target.value)}})};var e$=b(e=>ii.jsxs(qW,{...e,children:[ii.jsx(KW,{}),ii.jsx(QW,{}),ii.jsx(UW,{}),ii.jsx($W,{}),ii.jsx(GW,{}),ii.jsx(BW,{}),ii.jsx(VW,{})]}));const t$=e=>ii.jsx(AW,{...e,children:ii.jsx(e$,{...e})}),r$=u({}),n$=()=>h(r$),o$=({rect:e,pageInfo:t,qPivotDataPages:r,updatePageInfo:n,direction:o,children:i})=>{const a=v(()=>({rect:e,pageInfo:t,qPivotDataPages:r,updatePageInfo:n,direction:o}),[e,t,r,n,o]);return ii.jsx(r$.Provider,{value:a,children:i})},i$=u({}),a$=()=>h(i$),s$=({app:e,model:t,theme:r,embed:n,keyboard:o,translator:i,interactions:a,env:s,children:l})=>{const u=v(()=>({model:t,app:e,interactions:a,embed:n,theme:r,keyboard:o,env:s,translator:i}),[e,a,t,n,r,o,s,i]);return ii.jsx(i$.Provider,{value:u,children:l})},l$=u({}),u$=()=>h(l$),c$=({children:e,...t})=>ii.jsx(l$.Provider,{value:t,children:e}),d$=()=>{const{text:e,fontFamily:t,fontSize:r,justifyContent:n,alignItems:o,height:i}=(()=>{const{theme:e,translator:t}=a$(),{layoutService:r}=u$(),n=e.getStyle("","","fontFamily")??BF;return r.hasData?r.hasLimitedData?{text:t.get("SNPivotTable.LimitedData"),fontSize:"13px",fontFamily:n,alignItems:"center",height:"22px"}:{}:{text:t.get("SNPivotTable.NoData"),fontSize:"16px",fontFamily:n,justifyContent:"center",alignItems:"center",height:"100%"}})();return void 0===e?null:ii.jsx("div",{style:{display:"flex",justifyContent:n,alignItems:o,width:"100%",height:i},children:ii.jsx("span",{style:{...ez,fontFamily:t,fontSize:r,fontStyle:"italic",color:"#7b7a78"},children:e})})},p$="/qHyperCubeDef",f$=-1,h$="PSEUDO-DIM",m$=e=>e===f$?h$:(({cId:e})=>e??BN())(e),g$=({layoutService:e,visibleLeftDimensionInfos:t,cell:r,colIdx:n})=>{r&&(r.canBeResized=!0,r.colIdx=r.colIdx||n,r.dimensionInfoIndex===f$?r.columnWidthLocation=gF.Measures:r.isLeftDimension?r.columnWidthLocation=gF.Dimension:t.at(-1)===f$?r.columnWidthLocation=gF.Measures:e.hasPseudoDimOnLeft&&(r.columnWidthLocation=gF.Pivot))},v$=(e,t,r,n)=>{const o=m$(r),i=e.getDimensionInfoIndex(r),a=e.isLeftDimension(i);return r===f$?{id:o,colIdx:-1,label:"",sortDirection:"A",fieldId:"",isLocked:!1,isDim:!1,isCyclic:!1,groupDimensionPos:0,groupDimensionLabels:[],headTextAlign:"left",dimensionInfoIndex:i,canBeResized:!1,isLeftDimension:a,isLastDimension:n,columnWidthLocation:gF.Measures,isPivot:!0,qEffectiveDimensionName:void 0}:{id:o,colIdx:0,label:r.qFallbackTitle,qReverseSort:r.qReverseSort,sortDirection:r.qSortIndicator&&"N"!==r.qSortIndicator?r.qSortIndicator:"A",qLibraryId:r.qLibraryId,fieldId:r.qGroupFieldDefs[r.qGroupPos],isLocked:r.qLocked??!1,columnWidth:r.columnWidth,qApprMaxGlyphCount:r.qApprMaxGlyphCount,isDim:!0,isCyclic:r.qGrouping===ET.Cyclic,groupDimensionPos:r.qGroupPos,groupDimensionLabels:r.qGroupFallbackTitles,headTextAlign:"left",dimensionInfoIndex:i,canBeResized:!1,isLeftDimension:a,isLastDimension:n,columnWidthLocation:gF.Dimension,isPivot:!0,isSortedByFirstMeasure:t.isSortedByFirstMeasure,qEffectiveDimensionName:r.qEffectiveDimensionName}},y$=({layoutService:e,effectivePropertiesService:t,lastRow:r,lastCol:n})=>{let o=n;var i;r.length>0&&(o=(i=n).at(-1)===f$?i.slice(0,-1):i);const a=o.length+(r.length?1:0),s=Math.max(1,r.length),l=((e,t)=>Array(e).fill(null).map(()=>Array.from({length:t},()=>null)))(a,s);return r.forEach((r,n,o)=>{const i=n===o.length-1;l[a-1][n]=v$(e,t,r,i)}),o.forEach((r,n,o)=>{const i=n===o.length-1;l[n][s-1]=v$(e,t,r,i)}),l},b$=(e,t,r,n)=>{const o=((e,t,r,n)=>{let o;return o=0===r.length||r.includes(f$)?y$({layoutService:e,effectivePropertiesService:t,lastRow:n,lastCol:r}):(e=>e[0].map((t,r)=>e.map(e=>e[r])))(y$({layoutService:e,effectivePropertiesService:t,lastRow:r,lastCol:n})),e.isIndentModeEnabled&&o[o.length-1].length>1&&(o[o.length-1]=[o.at(-1),...new Array(o[0]?o[0].length-1:0).fill(null)]),o.length&&o.at(-1)?.forEach((t,r)=>{Array.isArray(t)?t.forEach((t,r)=>{g$({layoutService:e,visibleLeftDimensionInfos:n,cell:t,colIdx:r})}):g$({layoutService:e,visibleLeftDimensionInfos:n,cell:t,colIdx:r})}),o})(e,t,r,n);return{data:o,size:{x:o[0]?.length??0,y:o.length}}};var x$={fromSearchString:function(e){if(!e)return[];"?"===e[0]&&(e=e.substr(1));const t=[];return e.split("&").forEach(e=>{if(!e)return;const r=e.indexOf("=");let n,o="",i=!1;-1===r?n=e:(n=e.slice(0,r),o=e.slice(r+1),i=!0),t.push(function(e,t,r){return{key:w$(e),value:w$(t.replace(/%2B/g,"shouldNotDecodePlus")),useEqualSign:r}}(n,o,i))}),t}},S$=x$;function w$(e){try{return decodeURIComponent(e)}catch{return e}}function C$(e){if(!(this instanceof C$))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 r=e.indexOf("#");-1!==r&&(t.hash=e.substr(r),e=e.substr(0,r));r=e.indexOf("?"),-1!==r&&(t.search=e.substr(r),e=e.substr(0,r));return t.authorityAndPath=e,t}(e);Object.defineProperties(this,{authorityAndPath:{value:t.authorityAndPath},search:{value:t.search},hash:{value:t.hash},searchParams:{get:()=>S$.fromSearchString(t.search)}})}function E$(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/shouldNotDecodePlus/gi,"%2B")}C$.encodeAuthorityAndPath=function(e){return encodeURI(e).replace(/%5B/gi,"[").replace(/%5D/gi,"]").replace(/%25/gi,"%")},C$.encodeSearchParams=function(e){let t,r="";for(let n=0;n<e.length;n++)t=e[n],r+=0===n?"?":"&",r+=E$(t.key),t.value?r+=`=${E$(t.value)}`:r+=t.useEqualSign?"=":"";return r};var I$=C$;var D$,P$=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}},R$=class{decode(e){let t="";const r=new P$(e);let n;for(;r.hasNext();)n=this.decodeCharacter(r),t+=null!=n?n:r.next();return t}decodeCharacter(e){return e.next()}},M$=e=>e>=0&&e<=1114111,L$=e=>e.match(/[\s]/),A$=class extends R${decodeCharacter(e){e.mark();const t=e.next();let r,n,o;if(null==t||"\\"!==t)return e.reset(),null;const i=e.next();if(null==i)return e.reset(),null;switch(i){case"\r":e.peek("\n")&&e.next();case"\n":case"\f":case"\0":return this.decodeCharacter(e)}if("NaN"===parseInt(i,16))return i;for(r=i,n=0;n<5&&(o=e.next(),null!=o&&!L$(o));n++){if("NaN"===parseInt(o,16)){e.pushback(o);break}r+=o}const a=parseInt(r,16);return M$(a)?String.fromCharCode(a):"�"}},k$=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,r,n=arguments[0];return"string"==typeof arguments[1]?(t=arguments[1],r=n.length):(r=arguments[1],t=arguments[2]),t&&n?(n.length>r&&(n=n.substr(0,r)),new e(n,t)):null}},O$=class e{setValue(e){this._nextMap=null,this._value=e}getNextNode(e){return this._nextMap?this._nextMap[e]:null}put(t,r,n){let o,i;if(t.length===r)return i=this._value,this.setValue(n),i;const a=t.charAt(r);return this._nextMap?(o=this._nextMap[a],o||(o=new e,this._nextMap[a]=o)):(this._nextMap={},o=new e,this._nextMap[a]=o),o.put(t,r+1,n)}get(e,t){if(e.length<=t)return this._value;const r=this.getNextNode(e.charAt(t));return r?r.get(e,t+1):null}getLongestMatch(e,t){if(e.length<=t)return k$.newInstanceIfNeeded(e,this._value);const r=this.getNextNode(e.charAt(t));if(!r)return k$.newInstanceIfNeeded(e,t,this._value);const n=r.getLongestMatch(e,t+1);return n||k$.newInstanceIfNeeded(e,t,this._value)}},q$=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 O$);const r=this.root.put(e,0,t);return r||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}},T$=(()=>{const e=[],t=[],r=new q$;let n,o,i;for(n in e["&quot"]="34",e["&amp"]="38",e["&lt"]="60",e["&gt"]="62",e["&nbsp"]="160",e["&iexcl"]="161",e["&cent"]="162",e["&pound"]="163",e["&curren"]="164",e["&yen"]="165",e["&brvbar"]="166",e["&sect"]="167",e["&uml"]="168",e["&copy"]="169",e["&ordf"]="170",e["&laquo"]="171",e["&not"]="172",e["&shy"]="173",e["&reg"]="174",e["&macr"]="175",e["&deg"]="176",e["&plusmn"]="177",e["&sup2"]="178",e["&sup3"]="179",e["&acute"]="180",e["&micro"]="181",e["&para"]="182",e["&middot"]="183",e["&cedil"]="184",e["&sup1"]="185",e["&ordm"]="186",e["&raquo"]="187",e["&frac14"]="188",e["&frac12"]="189",e["&frac34"]="190",e["&iquest"]="191",e["&Agrave"]="192",e["&Aacute"]="193",e["&Acirc"]="194",e["&Atilde"]="195",e["&Auml"]="196",e["&Aring"]="197",e["&AElig"]="198",e["&Ccedil"]="199",e["&Egrave"]="200",e["&Eacute"]="201",e["&Ecirc"]="202",e["&Euml"]="203",e["&Igrave"]="204",e["&Iacute"]="205",e["&Icirc"]="206",e["&Iuml"]="207",e["&ETH"]="208",e["&Ntilde"]="209",e["&Ograve"]="210",e["&Oacute"]="211",e["&Ocirc"]="212",e["&Otilde"]="213",e["&Ouml"]="214",e["&times"]="215",e["&Oslash"]="216",e["&Ugrave"]="217",e["&Uacute"]="218",e["&Ucirc"]="219",e["&Uuml"]="220",e["&Yacute"]="221",e["&THORN"]="222",e["&szlig"]="223",e["&agrave"]="224",e["&aacute"]="225",e["&acirc"]="226",e["&atilde"]="227",e["&auml"]="228",e["&aring"]="229",e["&aelig"]="230",e["&ccedil"]="231",e["&egrave"]="232",e["&eacute"]="233",e["&ecirc"]="234",e["&euml"]="235",e["&igrave"]="236",e["&iacute"]="237",e["&icirc"]="238",e["&iuml"]="239",e["&eth"]="240",e["&ntilde"]="241",e["&ograve"]="242",e["&oacute"]="243",e["&ocirc"]="244",e["&otilde"]="245",e["&ouml"]="246",e["&divide"]="247",e["&oslash"]="248",e["&ugrave"]="249",e["&uacute"]="250",e["&ucirc"]="251",e["&uuml"]="252",e["&yacute"]="253",e["&thorn"]="254",e["&yuml"]="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["&notin"]="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[n]&&e.hasOwnProperty(n)&&(t[e[n]]=n);for(o in t)"function"!=typeof t[o]&&t.hasOwnProperty(o)&&(i=t[o].toLowerCase().substr(1),r.put(i,String.fromCharCode(o)));return r})(),N$=class extends R${decodeCharacter(e){let t;e.mark();const r=e.next();if(null==r||"&"!==r)return e.reset(),null;const n=e.next();if(null==n)return e.reset(),null;if("#"===n){if(t=this._getNumericEntity(e),null!=t)return t}else if(n.match(/[A-Za-z]/)&&(e.pushback(n),t=this._getNamedEntity(e),null!=t))return t;return e.reset(),null}_getNamedEntity(e){let t,r,n,o="";for(t=Math.min(e.remainder().length,T$.getMaxKeyLength()),n=0;n<t;n++)o+=e.next().toLowerCase();const i=T$.getLongestMatch(o);if(null==i)return null;for(e.reset(),e.next(),t=i.getKey().length,r=0;r<t;r++)e.next();return e.peek(";")&&e.next(),i.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,r="";for(;e.hasNext();){if(t=e.peek(),Number.isNaN(+parseInt(t,16))){if(";"===t){e.next();break}break}r+=t,e.next()}const n=parseInt(r,16);return!Number.isNaN(+n)&&M$(n)?String.fromCharCode(n):null}_parseNumber(e){let t,r="";for(;e.hasNext();){if(t=e.peek(),Number.isNaN(+parseInt(t,10))){if(";"===t){e.next();break}break}r+=t,e.next()}const n=parseInt(r,10);return!Number.isNaN(+n)&&M$(n)?String.fromCharCode(n):null}},_$=class extends R${decodeCharacter(e){e.mark();const t=e.next();let r,n,o,i;if(null==t)return e.reset(),null;if("%"!==t)return e.reset(),null;for(r="",n=0;n<2;n++)o=e.nextHex(),null!=o&&(r+=o);return 2===r.length&&(i=parseInt(r,16),M$(i))?String.fromCharCode(i):(e.reset(),null)}},j$=/^data:(?<!\s)\s*(image\/[\w+-.]+)(?<!\s)\s*(;.*?){0,1}(?<!\s)\s*,(.*)/i,F$=5e6,z$=5e5,W$=(e,t)=>{const{maxByteSizeSvg:r=z$,maxByteSizeImage:n=F$}=t??{},{mimeType:o,encoding:i,data:a}=(e=>{const[,t,r,n]=j$.exec(e.trim())??[];return{encoding:r,data:n,mimeType:t?.toLocaleLowerCase()}})(e);if(!a)return!0;const s=((e,t,r)=>{const n={type:e};if(t?.includes(";base64"))try{return new Blob([atob(r)],n).size}catch{return new Blob([r],n).size}return"image/svg+xml"===e?new Blob([r],n).size:0})(o,i,a);return"image/svg+xml"===o?s<=r:s<=n};"undefined"!=typeof document&&(D$=document.createElement("div"));var $$=Array.prototype.indexOf,H$=[",",".","_"," "],V$=[",",".","-","_"," "],B$={width:["%"],height:["%"]},G$={default:["-"," ","%"],color:["#"," ","(",")"],image:["(",")",":","/","?","&","-",".",'"',"="," "]},U$={background:["(",")",":","%","/","?","&","-"," ",".",'"',"=","#"],"background-image":G$.image,"background-color":G$.color,"border-color":G$.color,"border-image":G$.image,color:G$.color,icon:G$.image,"list-style-image":G$.image,"outline-color":G$.color},Y$={attr_name:["^on[a-z]{1,}","style","href","src"],attr_val:["javascript:","data:"],css_key:["behavior","-moz-behavior","-ms-behavior"],css_val:["expression"]};function K$(e,t,r){let n;if(t){if($$)return $$.call(t,e,r);for(n=t.length,r=r?r<0?Math.max(0,n+r):r:0;r<n;r++)if(r in t&&t[r]===e)return r}return-1}function X$(e){if(null==e)return"";let t="";const r=document.createTextNode(e);return D$.appendChild(r),t=D$.innerHTML,D$.removeChild(r),t}function J$(e,t,r){let n,o,i,a,s,l,u,c,d;for(e=Q$(e).toLowerCase(),t=Q$(t),i=0;i<Y$.attr_name.length;i++)if(e.match(Y$.attr_name[i]))throw new Error(`Unsafe attribute name used: ${e}`);for(i=0;i<Y$.attr_val.length;i++)if(t.toLowerCase().match(Y$.attr_val[i]))throw new Error(`Unsafe attribute value used: ${t}`);if(n=B$[e],n||(n=V$),o="",!r){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");o+=s}o+='="'}for(l=0;l<t.length;l++)u=t.charAt(l),c=t.charCodeAt(l),!u.match(/[a-zA-Z0-9]/)&&K$(u,n)<0?(d=c.toString(16),o+=`&#x${d};`):o+=u;return r||(o+='"'),o}function Z$(e,t,r){let n,o,i,a,s,l,u,c,d,p;if(e=Q$(e).toLowerCase(),t=Q$(t),K$(e,Y$.css_key)>=0)throw new Error(`Unsafe property name used: ${e}`);for(n=0;n<Y$.css_val.length;n++)if(t.toLowerCase().indexOf(Y$.css_val[n])>=0)throw new Error(`Unsafe property value used: ${t}`);if(o=U$[e],o||(o=G$.default),i="",!r){for(a=0;a<e.length;a++){if(s=e.charAt(a),!s.match(/[a-zA-Z-]/))throw new Error("Invalid Property Name specified");i+=s}i+=": "}for(l=0;l<t.length;l++)u=t.charAt(l),c=t.charCodeAt(l),!u.match(/[a-zA-Z0-9]/)&&K$(u,o)<0?(d=c.toString(16),p="000000".substr(d.length),i+=`\\${p}${d}`):i+=u;return i}function Q$(e,t){let r,n,o,i,a=!1;if(null===e)return null;r=e,n=e,o=0;const s=[new N$,new _$,new A$];for(;!a;){n=r;for(let e=0;e<s.length;e++)i=s[e].decode(r),i!==r&&(o++,r=i);n!==r||(a=!0)}if(t&&o>1)throw new Error("Attack Detected - Multiple/Double Encodings used in input");return r}var eH=[];for(let e=0;e<255;e++)eH[e]=e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122?null:e.toString(16);var tH={html:e=>X$(e.unsafe),css(e){let t,r=[];const n=[],o={};let i="";for(t in e.map?r=e.map:r[e.name]=e.unsafe,r)"function"!=typeof r[t]&&r.hasOwnProperty(t)&&(n[t]=Z$(t,r[t],!0),i+=Z$(t,r[t],!0),o[t]=n[t]);return e.map?o:i},attr(e){let t=[];const r=[],n={};let o="";e.map?t=e.map:t[e.name]=e.unsafe;for(const e in t)"function"!=typeof t[e]&&t.hasOwnProperty(e)&&(r[e]=J$(e,t[e],!0),o+=J$(e,t[e],!0),n[e]=r[e]);return e.map?n:o}};function rH(e,t){throw new Error(t)}var nH={canonicalize:Q$,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,r;const n=arguments[0]||{};let o=1;const i=arguments.length;for(;o<i;o++)if(null!=(e=arguments[o]))for(t in e)if(e.hasOwnProperty(t)){if(r=e[t],n===r)continue;void 0!==r&&(n[t]=r)}}(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?tH.html(e):"css"===e.context?(null!=e.map&&"object"!=typeof e.map&&rH(this,"Invalid parameter type"),tH.css(e)):"attr"===e.context?(null!=e.map&&"object"!=typeof e.map&&rH(this,"Invalid parameter type"),tH.attr(e)):void rH(this,"Invalid parameter type")},encodeForAttr:J$,encodeForAttr2:function(e){return J$("nonsens",e,!0)},encodeForCSS:Z$,encodeForHref:function(e){Q$(e),0!==e.search("[a-zA-Z0-9]+:")&&(e=`http://${e}`);const t=new I$(e),r=I$.encodeAuthorityAndPath(t.authorityAndPath),n=t.searchParams;e=r+I$.encodeSearchParams(n)+t.hash;const o=decodeURI(e).toLowerCase();if(-1!==o.indexOf("javascript:"))throw new Error("Attack Detected - Javascript in input");if(-1!==o.indexOf("data:"))throw new Error("Attack Detected - data in input");return e},encodeForJS:function(e,t){let r,n,o,i,a,s;for(t||(t=H$),s="",r=0;r<e.length;r++)o=e.charAt(r),i=e.charCodeAt(r),K$(o,t)>=0||null==eH[i]?s+=o:(n=i.toString(16),i<256?(a="00".substr(n.length),s+=`\\x${a}${n.toUpperCase()}`):(a="0000".substr(n.length),s+=`\\u${a}${n.toUpperCase()}`));return s},encodeForHTML:X$,encodeForURL:function(e,t){let r="";return t&&(t.match(/^[A-Za-z\-0-9]{1,}$/)?r+=Q$(t).toLowerCase():rH(this,"Illegal Attribute Name Specified"),r+='="'),r+=encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A"),r+=t?'"':"",r},isSafeDataURL:W$,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 r=function(e){let t=e,r="";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=r.lastIndexOf("/");-1!==e&&(r=r.slice(0,e))}else if("/.."===t){t="/";const e=r.lastIndexOf("/");-1!==e&&(r=r.slice(0,e))}else if("."===t||".."===t)t="";else{const e=t.match(/^\/?[^/]*/),n=e?e[0]:"";t=t.slice(n.length),r+=n}return r}(t);return""!==r&&"/"!==r&&r}};const oH=(e,t)=>t.qAttrExps?.qValues?.[e],iH=(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"}}},aH=({text:e,url:t,imageSize:r,imagePosition:n,labelStructure:o,imageBox:i,direction:a})=>!n||t&&(t.toLowerCase().includes("javascript:")||!nH.isSafeDataURL(t))?{type:uF.Text,url:void 0,text:e,labelStructure:o}:{type:uF.Image,url:t||"",text:e,imageSize:r,resolvedImagePosition:iH(n,a),labelStructure:o,imageBox:i},sH=(e,t,r,n)=>{if(!e.qMiniChart||!t?.miniChart||!r)return{type:uF.Text,text:n};const{minY:o,maxY:i}=((e,t,r)=>{const n="global"===t.yAxis?.scale,o="zeroCenter"===t.yAxis?.position,i=n?r.qYMin:e.qMiniChart.qMin,a=n?r.qYMax:e.qMiniChart.qMax;if(o){const e=Math.max(Math.abs(i),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,i),maxY:Math.max(0,a)}:{minY:i,maxY:a}})(e,t.miniChart,r),a={type:t.miniChart.type,qMatrix:e.qMiniChart.qMatrix,minY:o,maxY:i,showDots:!!t.miniChart.showDots,colors:t.miniChart.colors,colorMin:e.qMiniChart.qMin,colorMax:e.qMiniChart.qMax};return{type:uF.MiniChart,text:n,miniChart:a}},lH=(e,t,r)=>{const n=Array.isArray(t.qAttrExps)?t.qAttrExps[0]:t.qAttrExps,o=n?.qValues?.[e];if(o){const e=Number.isNaN(+o.qNum)?void 0:`${o.qNum}`;return o.qText||e}return r?.urlPosition===cF.Attribute?void 0:r?.urlLabel},uH=({labelStructure:e,text:t,url:r})=>{try{if(!r)throw Error("Invalid url");return{type:uF.Link,url:nH.encodeForHref(r),text:t,labelStructure:e}}catch{return{type:uF.Text,url:void 0,text:t,labelStructure:e}}},cH=({cell:e,representationProperties:t,attrExprInfoIndex:r,env:n,conditionalColoring:o,miniChartOnMeasure:i,labelStructure:a,getText:s=e=>e.qText,direction:l,enabledFeatures:u})=>{const c=dF(t),d=s(e);return c===uF.Image&&u[uF.Image]&&!n.anything.sense?.isUnsupportedFeature?.("tableImages")?((e,t,r,n,o,i)=>{const{imageSize:a,imagePosition:s,imageSetting:l,imageLabel:u,imageBox:c}=t??{};if("url"===l){const t=oH(r.imageUrl??-1,e)?.qText;return i&&(i.maskedValue=t??""),aH({text:n,url:t,imageSize:a,imagePosition:s,labelStructure:i,imageBox:c,direction:o})}if("label"===l){const t=i?i.originalValue:n;if(-1===r.imageLabel)return aH({text:u||t||"",url:t,imageSize:a,imagePosition:s,labelStructure:i,imageBox:c,direction:o});const l=oH(r.imageLabel??-1,e)?.qText??n;return aH({text:l,url:t,imageSize:a,imagePosition:s,labelStructure:i,imageBox:c,direction:o})}return{type:uF.Text,url:void 0,labelStructure:i,text:n}})(e,t,r,d,l,a):c===uF.Link?((e,t,r,n,o)=>{const{urlPosition:i}=t??{};if(i===cF.Attribute){const i=lH(r.url??-1,e,t);return uH({labelStructure:n,text:o||i||"",url:i})}if(i===cF.Dimension){const i=lH(r.urlLabel??-1,e,t)||o;return n&&(n.maskedValue=i),uH({text:i,labelStructure:n,url:n?.originalValue??o})}return{type:uF.Text,url:void 0,text:o,labelStructure:n}})(e,t,r,a,d):c===uF.Indicator&&u[uF.Indicator]&&!n.anything.sense?.isUnsupportedFeature?.("tableIndicators")?((e,t,r)=>{const{indicator:n}=e??{};return{type:uF.Indicator,url:void 0,text:r,indicator:{applySegmentColors:n?.applySegmentColors,position:n?.position,showTextValues:n?.showTextValues},indicatorConditionalColoring:t}})(t,o,d):c===uF.MiniChart&&u[uF.MiniChart]&&!n.anything.sense?.isUnsupportedFeature?.("qMiniChartDef")?sH(e,t,i,d):{type:uF.Text,url:void 0,text:d,labelStructure:a}},dH=(e,t)=>{const r=t.qAttrExps,n=r?.qValues?.[e?.cellForegroundColor??-1]?.qText,o=r?.qValues?.[e?.cellBackgroundColor??-1]?.qText,i=o?qF(o):null,a=n?qF(n):null,s=((e,t)=>e||!t?null:AF(t))(a,i);return{color:s??a,background:i}},pH=(e,t)=>t.qSubNodes.reduce((e,t)=>0===t.qSubNodes.length?e+1:pH(e,t),e),fH=(e,t,r,n,o,i)=>{const a=o?i.rowsPerPage-r:UF-n;let s=e.qUp+e.qDown;if(o&&0===r){const r=(t+e.qUp)%i.rowsPerPage;s=e.qDown+r}return Math.min(a,pH(s,e))},hH=({node:e,parent:t,root:r,x:n,y:o,pageY:i,layoutService:a,dimensionInfo:s,attrExprInfoIndex:l,isLeftColumn:u=!0,isIndentModeEnabled:c=!1,indentLevel:d,labelStructure:p,env:f,pageInfo:h,direction:m="ltr"})=>{const g=(!c||!u)&&"P"===e.qType,v=((e,t)=>{if(e!==f$){if(t){const t=dF(e.representation);return t===uF.Link||t===uF.Image?e.representation:{type:uF.Text}}return e.representation}})(s,c),y=(({node:e,isLeftColumn:t,isIndentModeEnabled:r,labelStructure:n,representationType:o,parentOrRootOriginalValue:i})=>{let a=e.qText;if(t&&r&&n){const{originalValue:t,delimeter:r,suffix:s}=n;a=o===uF.Link?"P"===e.qType?i:t:`${t} ${!s||!t&&s?"":r} ${s}`.trim()}return a})({node:e,isLeftColumn:u,isIndentModeEnabled:c,labelStructure:p,representationType:dF(v),parentOrRootOriginalValue:(t||r)?.representation?.labelStructure?.originalValue??""}),b=cH({cell:{...e,qText:y},representationProperties:v,attrExprInfoIndex:l,env:f,labelStructure:p,direction:m,enabledFeatures:{[uF.Image]:!0,[uF.Indicator]:!0}}),x={id:BN(),ref:e,x:n,y:o,pageX:n,pageY:i,mainAxisPageCoord:u?i:n,isLeftColumn:u,parent:t,root:r,children:[],isLeafNode:0===e.qSubNodes.length,leafCount:fH(e,o,i,n,u,h),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:dH(l,e),selectionCellType:u?"L":"T",dimensionInfoIndex:a.getDimensionInfoIndex(s),canBeResized:0===e.qSubNodes.length&&!u,visibleMeasureInfoIndex:g?e.qElemNo:t?.visibleMeasureInfoIndex,representation:b,...void 0!==d&&{indentLevel:d}};return t&&(t.children[x.mainAxisPageCoord-t.mainAxisPageCoord]=x),x},mH=(e,t,r,n,o,i,a,s,l)=>{const{isIndentModeEnabled:u}=o;if(!t.length)return e;let c=0;return function t(d,p,f,h=0,m=-1){e[h]||(e[h]={}),u&&m++;const g=o.leftDimensionInfoIndexes.indexOf(f$);f.forEach((f,v)=>{const y={originalValue:f.qText??"",maskedValue:"",delimeter:"-",suffix:""};c+=0===v?0:1;const b=r.qTop-n.page*n.rowsPerPage,x=Math.max(0,b+c-f.qUp),S=r.qTop+c-f.qUp;if(u){if(o.hasPseudoDimOnLeft&&m<=g)if(y.originalValue=f.qText??"",y.maskedValue=f.qText??"","N"===f.qType||"U"===f.qType||"T"===f.qType)"U"===f.qType&&(y.originalValue=o.getNullValueText()),m<g&&(y.suffix=o.visibleMeasureInfo[0].qFallbackTitle);else if("P"===f.qType){y.originalValue=(p||d)?.representation.labelStructure?.originalValue??"",y.maskedValue=(p||d)?.representation.labelStructure?.originalValue??"",y.suffix=f.qText??"";const e=f.qSubNodes;f={...(p||d)?.ref,...f.qText?{qText:f.qText}:{},qSubNodes:e},m=(p||d)?.indentLevel??0}"U"===f.qType&&(y.originalValue=o.getNullValueText())}let w=h;u&&(w=g>=1&&m>=g?m+1:m,0===m&&0===g&&0===f.qSubNodes.length&&(w=0));const C=e.at(h)?.[x],E=u&&void 0===C?.ref.qText||!C?hH({node:f,parent:p,root:d,x:w,y:S,pageY:x,layoutService:o,dimensionInfo:i[w],attrExprInfoIndex:a[w],isLeftColumn:!0,...u&&{isIndentModeEnabled:u,indentLevel:m},env:s,pageInfo:n,labelStructure:y,direction:l}):e[h][x];if(e[h][x]=E,f.qSubNodes.length){const e=u?0:h+1;t(d||E,E,f.qSubNodes,e,m)}})}(null,null,t,0,-1),e},gH=(e,t)=>{e.slice(0,-1).forEach(e=>{Object.values(e).forEach((e,r,n)=>{const o=n.at(r+1);e.distanceToNextCell=o?o.mainAxisPageCoord-(e.mainAxisPageCoord+e.leafCount):t-(e.mainAxisPageCoord+e.leafCount)})})},vH=(e,t)=>{const r=e[0],n=r?Object.values(r):[],o=t?.isIndentModeEnabled&&t.hasPseudoDimOnLeft?t.visibleMeasureInfo.length-1:0,i=r?.[o],a=n.at(-1);return i?.isTotal?i.isLeafNode?i.mainAxisPageCoord:i.mainAxisPageCoord+i.leafCount-1:a?.isTotal?a.mainAxisPageCoord-1:-1},yH=({prevData:e,nextDataPage:t,pageInfo:r,layoutService:n,visibleLeftDimensionInfo:o,attrExprInfoIndexes:i,env:a,direction:s})=>{const{qLeft:l,qArea:u}=t;if(!l.length)return e;const c=mH(e.grid,l,u,r,n,o,i,a,s);gH(c,r.rowsOnCurrentPage);const d=vH(c,n);return{...e,grid:c,columnCount:c.length,totalDividerIndex:d}},bH=({qArea:e,prevData:t,pivotValuePoints:r,pageInfo:n})=>{const o=[...t];return r.forEach((t,r)=>{t.forEach((t,i)=>{const a=e.qTop-n.page*n.rowsPerPage+r,s=e.qLeft+i;Array.isArray(o[a])||(o[a]=[]);const l="U"===t.qType;o[a][s]=o[a][s]??{id:BN(),ref:t,isNull:l}})}),o},xH=({prevData:e,dataPage:t,pageInfo:r})=>{const{qData:n,qArea:o}=t;return n?.length?bH({qArea:o,prevData:e,pivotValuePoints:n,pageInfo:r}):e},SH=(e,t,r,n,o,i,a,s,l,u)=>{const{isIndentModeEnabled:c}=n;if(!t.length)return e;let d=0;!function t(a,p,f,h=0){e[h]||(e[h]={}),f.forEach((f,m)=>{d+=0===m?0:1;const g=r.qLeft+d-f.qUp,v=e[h][g]??hH({node:f,parent:p,root:a,x:g,y:h,pageY:h,layoutService:n,dimensionInfo:o[h],attrExprInfoIndex:i[h],isLeftColumn:!1,...c&&{isIndentModeEnabled:c},env:s,pageInfo:l,direction:u});e[h][g]=v,f.qSubNodes.length&&t(a||v,v,f.qSubNodes,h+1)})}(null,null,t);for(let t=0;t<a-e.length;t++)e.push({});return e},wH=({prevData:e,nextDataPage:t,layoutService:r,visibleTopDimensionInfo:n,attrExprInfoIndexes:o,headerRows:i,env:a,pageInfo:s,direction:l})=>{const{qTop:u,qArea:c}=t;if(!u.length)return e;const d=SH(e.grid,u,c,r,n,o,i,a,s,l);gH(d,r.size.x);const p=vH(d);return{...e,grid:d,rowCount:d.length,totalDividerIndex:p}},CH=e=>-1===e?{}:e.qAttrExprInfo.reduce((e,{id:t},r)=>(e[t]=r,e),{}),EH=(e,t)=>{const{env:r}=a$(),{direction:n}=n$(),{layoutService:o,effectivePropertiesService:i}=u$(),{qPivotDataPages:a,pageInfo:s}=n$(),[l,u]=m(null),c=((e,t,r)=>v(()=>({left:e.map(CH),top:t.map(CH),measures:r.map(CH)}),[r,e,t]))(e,t,o.visibleMeasureInfo),d=v(()=>b$(o,i,t,e),[o,i,t,e]),p=f(()=>a.slice(1).reduce((e,t)=>xH({prevData:e,dataPage:t,pageInfo:s}),((e,t)=>{const{qData:r,qArea:n}=e;return bH({qArea:n,prevData:[],pivotValuePoints:r,pageInfo:t})})(a[0],s)),[a,s]),h=f(()=>a.slice(1).reduce((e,i)=>wH({prevData:e,nextDataPage:i,layoutService:o,visibleTopDimensionInfo:t,attrExprInfoIndexes:c.top,headerRows:d.size.y,env:r,pageInfo:s,direction:n}),((e,t,r,n,o,i,a,s)=>{const{qArea:l,qTop:u}=e,c=SH([],u,l,t,r,n,o,i,a,s);gH(c,t.size.x);const d=vH(c);return{grid:c,rowCount:c.length,layoutSize:t.size,totalDividerIndex:d}})(a[0],o,t,c.top,d.size.y,r,s,n)),[a,o,t,c.top,d.size.y,r,s,n]),g=f(()=>a.slice(1).reduce((t,i)=>yH({prevData:t,nextDataPage:i,pageInfo:s,layoutService:o,visibleLeftDimensionInfo:e,attrExprInfoIndexes:c.left,env:r,direction:n}),((e,t,r,n,o,i,a)=>{const{qArea:s,qLeft:l}=e,u=mH([],l,s,r,t,n,o,i,a);gH(u,r.rowsOnCurrentPage);const c=vH(u,t);return{grid:u,columnCount:u.length,layoutSize:t.size,totalDividerIndex:c}})(a[0],o,s,e,c.left,r,n)),[a,o,s,e,c,r,n]),[y,b]=m(()=>p()),[x,S]=m(()=>h()),[w,C]=m(()=>g());Az(()=>{b(p())},[p]),Az(()=>{S(h())},[h]),Az(()=>{C(g())},[g]),Az(()=>{l&&l.forEach(i=>{b(e=>xH({prevData:e,dataPage:i,pageInfo:s})),S(e=>wH({prevData:e,nextDataPage:i,layoutService:o,visibleTopDimensionInfo:t,attrExprInfoIndexes:c.top,headerRows:d.size.y,env:r,pageInfo:s,direction:n})),C(t=>yH({prevData:t,nextDataPage:i,pageInfo:s,layoutService:o,visibleLeftDimensionInfo:e,attrExprInfoIndexes:c.left,env:r,direction:n}))})},[l]);const E=f(e=>{u(e)},[]);return{headersData:d,measureData:y,topDimensionData:x,leftDimensionData:w,attrExprInfoIndexes:c,nextPageHandler:E}},IH=Math.sqrt(1e4),DH=e=>({maxNumberOfVisibleRows:Math.ceil(e.height/24),maxNumberOfVisibleColumns:Math.ceil(e.width/xT.PixelsMin)}),PH=e=>{if(null===e)return[];if(e.qWidth*e.qHeight<1e4)return[e];const t=[],r=Math.ceil(e.qWidth/IH),n=Math.ceil(e.qHeight/IH);for(let o=0;o<r;o++)for(let r=0;r<n;r++)t.push({qLeft:e.qLeft+o*IH,qTop:e.qTop+r*IH,qWidth:Math.min(IH,e.qWidth-o*IH),qHeight:Math.min(IH,e.qHeight-r*IH)});return t};function RH({nextPageHandler:e}){const{model:t}=a$(),{pageInfo:r}=n$(),{layoutService:n}=u$(),o=(e=>{const t=l(e);return t.current=e,t})(r.page),i=t,a=f(async(e,t)=>{await(i?.collapseLeft(p$,e,t,!1))},[i]),s=f(async(e,t)=>{await(i?.collapseTop(p$,e,t,!1))},[i]),u=f(async(e,t)=>{await(i?.expandLeft(p$,e,t,!1))},[i]),c=f(async(e,t)=>{await(i?.expandTop(p$,e,t,!1))},[i]),d=f(async t=>{if(i?.getHyperCubePivotData&&0!==t.length)try{const n=await i.getHyperCubePivotData(p$,t.reduce((e,t)=>[...e,...PH(t)],[]));o.current===r.page&&e(n)}catch(e){console.error(e)}},[i,e,r,o]),p=f((e,{dimensionInfoIndex:r,isLeftColumn:o,x:i=0,columnWidthLocation:a})=>{const{qMeasureInfo:s,qDimensionInfo:l,topHeadersColumnWidth:u}=n.layout.qHyperCube;let c=[];switch(a){case gF.Dimension:c=[{qPath:`${p$}/qDimensions/${r}/qDef/columnWidth`,oldValue:l[r].columnWidth}];break;case gF.Measures:if(o)c=s.map((e,t)=>({qPath:`${p$}/qMeasures/${t}/qDef/columnWidth`,oldValue:e.columnWidth}));else{const e=n.getMeasureInfoIndexFromCellIndex(i);c=[{qPath:`${p$}/qMeasures/${e}/qDef/columnWidth`,oldValue:s[e].columnWidth}]}break;case gF.Pivot:c=[{qPath:`${p$}/topHeadersColumnWidth`,oldValue:u}]}const d=c.map(t=>{const{qPath:r,oldValue:n}=t;return{qPath:r,qOp:n?"Replace":"Add",qValue:JSON.stringify({...n,...e})}});t?.applyPatches(d,!0)},[t,n]),h=f(async e=>{await(i?.applyPatches([{qPath:`${p$}/indentModeColumnWidth`,qOp:n.layout.qHyperCube.indentModeColumnWidth?"Replace":"Add",qValue:JSON.stringify({...n.indentModeColumnWidth,...e})}],!0))},[i,n]);return v(()=>({collapseLeft:a,collapseTop:s,expandLeft:u,expandTop:c,applyColumnWidth:p,applyIndentModeColumnWidth:h,fetchPages:d}),[a,s,u,c,p,h,d])}const MH=(e,t,r)=>(n,o)=>{if("P"===n)return f$;const i=t[r+o];return e[i]},LH=e=>{const t=[],r=(e,n=0)=>{e.slice(0,1).forEach(e=>{t[n]=e.qType,e.qSubNodes.length&&r(e.qSubNodes,n+1)})};return r(e),t},AH=u({}),kH=()=>h(AH),OH=({children:e})=>{const{visibleLeftDimensionInfo:t,visibleTopDimensionInfo:r}=(()=>{const{layoutService:{layout:{qHyperCube:{qNoOfLeftDims:e,qEffectiveInterColumnSortOrder:t,qDimensionInfo:r}}}}=u$(),{qPivotDataPages:n}=n$();return v(()=>{const o=LH(n[0]?.qLeft??[]),i=LH(n[0]?.qTop??[]);return{visibleLeftDimensionInfo:o.map(MH(r,t,0)),visibleTopDimensionInfo:i.map(MH(r,t,e))}},[r,t,e,n])})(),{headersData:n,measureData:o,topDimensionData:i,leftDimensionData:a,attrExprInfoIndexes:s,nextPageHandler:l}=EH(t,r),u=RH({nextPageHandler:l}),c=v(()=>({gridSectionsData:{headersData:n,topDimensionData:i,leftDimensionData:a,measureData:o},visibleDimensionsInfo:{visibleLeftDimensionInfo:t,visibleTopDimensionInfo:r},attrExprInfoIndexes:s,dataModel:u}),[t,r,n,o,i,a,s,u]);return ii.jsx(AH.Provider,{value:c,children:e})},qH=20,TH=18,NH=.75,_H=e=>-1!==e&&e?.representation?.type===uF.Image,jH=({isLeftColumn:e,layoutService:t,representation:r})=>Boolean(e)&&t.isIndentModeEnabled&&r.type===uF.Image,FH=e=>void 0===e?GF:e,zH=(e,t)=>{if(void 0!==e&&!Number.isNaN(+e)){const r=+e;return r>=0?r:t}return t},WH=e=>zH(e,xT.PixelsDefault),$H=(e,t)=>zH(e,xT.PercentageDefault)*t/100,HH=(e,t,r)=>{switch(t?.type){case ST.Pixels:return WH(t.pixels);case ST.Percentage:return $H(t.percentage,e);case ST.FitToContent:case ST.Auto:default:return r}},VH=({headers:e,layoutService:t,effectivePropertiesService:r,estimateWidthForDimensionValue:n,shouldConsiderCombinatedLength:o,measureTextForHeader:i,longestMeasureValuePossible:a})=>e.reduce((e,s,l)=>{const{layout:{qHyperCube:{qNoOfLeftDims:u,qDimensionInfo:c}}}=t,{id:d,colIdx:p,qApprMaxGlyphCount:f,isLeftDimension:h}=s,m=c.find(e=>e.cId===d),g={width:24,...m?.representation?.imageBox};if(!h)return e+0;if(d===h$)return e+0;const v=jH({isLeftColumn:h,layoutService:t,representation:m?.representation||{type:uF.Text}})?g.width+8+4:n(f),y=!r.qAlwaysFullyExpanded&&p<u-1?21:0;let b=0;if(o&&i&&a){b=i("- ")+a}return Math.max(e,24*l+TH+y+v+b)},0),BH=(e,t,r)=>e.reduce((e,n)=>{const o=(r?0:1)*TH;return Math.max(e,o+t(n.qFallbackTitle))},0),GH=(e,t,r,n)=>{const o=100*e/t,i=n*NH*(o/100),a=o/100*+r;return Math.min(a,i)},UH=(e,t,r,n)=>n*(+r/100)*(100*e/t/100),YH=(e,t)=>e.some(e=>e>=t*NH),KH=({layoutService:e,effectivePropertiesService:t,headersData:r,columnWidths:n,tableWidth:o,widthOverride:i,measureTextForHeader:a,estimateWidthForDimensionValue:s,measureTextWidthForMeasuresCombinedWithDimensions:l,translator:u})=>{let c=[];const d=o*NH,p=r.data[r.data.length-1][0];if(!Array.isArray(p))return{leftGridWidth:0,leftGridColumnWidths:[],leftGridFullWidth:0};const f=Math.min(d,n.at(-1)),h=Math.min(d,VH({headers:p,layoutService:e,effectivePropertiesService:t,estimateWidthForDimensionValue:s})),m=Math.min(d,BH(e.visibleMeasureInfo,a));let g=0;const v=p.findIndex(e=>e.id===h$),y=(({layoutService:e,measureTextForHeader:t,translator:r,headersData:n})=>{const{type:o}=e.indentModeColumnWidth;return o===ST.Auto&&n.size.y<=1?t(r.get("SNPivotTable.IndentMode.Rows"))+8+TH+16:24})({layoutService:e,measureTextForHeader:a,translator:u,headersData:r});if(e.hasPseudoDimOnLeft)if(0===v){const e=Math.max(f,h,m);c=[Math.max(y,e-f),f]}else{const r=Math.min(d,BH(e.visibleMeasureInfo,l,!0));g=Math.min(d,VH({headers:p.slice(0,v),layoutService:e,effectivePropertiesService:t,estimateWidthForDimensionValue:s,shouldConsiderCombinatedLength:!0,measureTextForHeader:a,longestMeasureValuePossible:r}));const n=Math.max(f,h,g);c=[Math.max(y,n-f),f]}else c=[Math.max(y,h-f),f];const b=Math.min(d,c.reduce((e,t)=>e+t,0)),{indentModeColumnWidth:x}=e;i&&i<=d&&(x.type=ST.Pixels,x.pixels=i);return[ST.Pixels,ST.Percentage].includes(x.type)||YH(c,o)?((e,t,r,n)=>{let o=e[0],i=e[1],a=[];const s=e.reduce((e,t)=>e+t,0),{type:l,pixels:u,percentage:c}=t,d=zH(u,xT.PixelsDefault),p=zH(c,xT.PercentageDefault),f=YH(e,r);l===ST.Auto&&f&&(o>i?o-=i:i-=o),l===ST.Pixels&&d&&(o=GH(e[0],s,d,r),i=GH(e[1],s,d,r)),l===ST.Percentage&&p&&(o=UH(e[0],s,p,r),i=UH(e[1],s,p,r));let h=0;i<=n&&(h=o-5,h>0&&(o-=h,i+=h)),h=i-n,h>0&&(o+=h,i-=h),a=[o,i];const m=a.reduce((e,t)=>e+t,0);return{leftGridColumnWidths:a,leftGridWidth:m,leftGridFullWidth:m}})(c,x,o,f):{leftGridWidth:b,leftGridColumnWidths:c,leftGridFullWidth:b}};function XH({tableWidth:e}){const t=e*NH,{styleService:r,layoutService:n,effectivePropertiesService:o}=u$(),{translator:i}=a$(),{gridSectionsData:{headersData:a}}=kH(),{measureText:s}=Pz(r.header,{allowLineBreaks:!1}),{estimateWidth:l,measureText:u}=Pz({...r.dimensionValues,fontWeight:FH(r.dimensionValues.fontWeight)}),{measureText:c}=Pz({...r.dimensionValues,...r.measureLabels}),d=f((r,d)=>{const{layout:{qHyperCube:{qNoOfLeftDims:p,topHeadersColumnWidth:f}},visibleMeasureInfo:h,isIndentModeEnabled:m,hasPseudoDimOnLeft:g}=n,v=(t=0)=>h.reduce((r,{qFallbackTitle:n,columnWidth:o})=>{const i=c(n)+TH,a=Math.max(i,t);return Math.max(r,m?a:HH(e,o,a))},0),y=e=>a.data.reduce((t,r)=>{const n=r.at(e);if(!n||Array.isArray(n))return t;if(n.id===h$)return t;const o=(e=>{const{label:t,isLocked:r}=e,n=r?qH:0;return TH+s(t)+qH+n})(n);return Math.max(o,t)},0);let b=0,x=a.data.at(-1);m&&a.size.x>1&&x&&x[0]&&(x=x[0]);const S=x.map((i,s)=>{let u=TH;if(m&&1!==a.size.x||!r||void 0===d||d!==i.colIdx){let t;i.columnWidthLocation===gF.Pivot?t=m?void 0:f:i.columnWidthLocation===gF.Dimension&&({columnWidth:t}=i);let r=0;if(i.isLeftDimension)if(i.id===h$)r=v();else{const e=y(s),t=((e,t)=>{const{qApprMaxGlyphCount:r,isLeftDimension:i,dimensionInfoIndex:a}=e,s=n.getDimensionInfo(a);if(_H(s))return xT.PixelsDefault;const u=!o.qAlwaysFullyExpanded&&i&&t<p-1?21:0;return TH+l(r)+u})(i,s);r=Math.max(e,t),m&&!g&&s+1===p&&i.columnWidthLocation===gF.Dimension&&a.size.x>1&&(r=e)}else r=y(s),i.columnWidthLocation===gF.Measures&&(r=v(r));m&&1===a.size.x&&(t=n.indentModeColumnWidth),u=m&&!g&&a.size.x>1?r:HH(e,t,r)}else u=m?Math.min(t,r):r;return b+=u,u});return m&&a.size.x>1?KH({layoutService:n,effectivePropertiesService:o,headersData:a,columnWidths:S,tableWidth:e,widthOverride:r,measureTextForHeader:s,estimateWidthForDimensionValue:l,measureTextWidthForMeasuresCombinedWithDimensions:u,translator:i}):{leftGridWidth:Math.min(t,b),leftGridColumnWidths:S,leftGridFullWidth:b}},[e,a,n,t,s,c,l,u,i,o]),[p,h]=m(d);Az(()=>{h(d())},[d]);const g=f((e,t)=>{h(d(e,t))},[d]);return{...p,overrideLeftGridWidth:g}}function JH({tableWidth:e,verticalScrollbarWidth:t,leftGridWidth:r}){const{styleService:n,layoutService:o}=u$(),{visibleDimensionsInfo:{visibleTopDimensionInfo:i}}=kH(),{layout:{qHyperCube:{qNoOfLeftDims:a,qEffectiveInterColumnSortOrder:s}},size:l,visibleMeasureInfo:u}=o,{estimateWidth:c,measureText:d}=Pz(n.measureValues,{allowLineBreaks:!1}),{estimateWidth:p}=Pz({...n.dimensionValues,fontWeight:FH(n.dimensionValues.fontWeight)},{allowLineBreaks:!1}),h=e-r-1,m=i.at(-1),g=m===f$,y=s.length-a>i.length?21:0,b=v(()=>{const e=g?u:[m],t=l.x/e.length,r=[],n=[];let o=h;const i=(e,n)=>{r[e]=Math.min(xT.PixelsMax,Math.max(xT.PixelsMin,n)),o-=r[e]*t};if(e.forEach((e,t)=>{if(e?.columnWidth){const{columnWidth:{type:r,pixels:o,percentage:a},qApprMaxGlyphCount:s,qFallbackTitle:l}=e;switch(r){case ST.Pixels:i(t,WH(o));break;case ST.Percentage:i(t,$H(a,h));break;case ST.FitToContent:i(t,((e,t,r)=>r?xT.PixelsDefault:TH+(g?Math.max(c(e),d(t)):Math.max(Math.max(...u.map(e=>c(e.qApprMaxGlyphCount))),p(e)+y)))(s,l,_H(e)));break;case ST.Auto:default:n.push(t)}}else n.push(t)}),n.length){const e=n.length*t,i=o/e;n.forEach(e=>{r[e]=Math.max(xT.AutoMinPivot,i)})}return r},[g,u,m,l.x,h,c,d,p,y]),x=v(()=>{if(g){return u.reduce((e,t,r)=>e+b[r],0)/u.length}return b[0]},[g,b,u]),S=parseFloat((t/o.size.x).toFixed(12)),w=f(e=>(g&&void 0!==e?b[o.getMeasureInfoIndexFromCellIndex(e,!0)]:x)-S,[g,b,o,x,S]),C=l.x*x;return{rightGridFullWidth:C,rightGridWidth:Math.min(C,h),getRightGridColumnWidth:w}}const ZH=`scrollable-container--${yF.TopGrid}`,QH=`scrollable-container--${yF.LeftGrid}`,eV=`scrollable-container--${yF.DataGrid}`,tV=e=>e&&e instanceof HTMLDivElement?{width:e.offsetWidth-e.clientWidth,height:e.offsetHeight-e.clientHeight}:{width:0,height:0},rV=(e,t)=>e>t?bF.Forward:e<t?bF.Backward:bF.None,nV=({gridRefs:{topGridRef:e,leftGridRef:t,dataGridRef:r},getWrapperElements:n,updateViewService:o,trackScrollDirection:i,interactions:a})=>{const{direction:s}=n$();d(()=>{const{headerGridWrapperElement:l,topGridWrapperElement:u,leftGridWrapperElement:c,dataGridWrapperElement:d}=n(),p=e=>{const t=e.target;l.scrollLeft=t.scrollLeft,i(e),o?.(e)},f=e=>{const t=e.target;l.scrollTop=t.scrollTop,i(e),o?.(e)},h=n=>{const a=n.target,l=((e,t)=>{const{scrollWidth:r,clientWidth:n,scrollLeft:o}=e,i=r-n;if("rtl"===t){if(o>i)return i;if(o<0)return Math.abs(o)}return o})(a,s);r.current?.scrollTo({scrollLeft:l,scrollTop:a.scrollTop}),u.scrollLeft=l,e.current?.forEach(e=>{e?.scrollTo(l)}),c.scrollTop=d.scrollTop,t.current?.forEach(e=>{e?.scrollTo(a.scrollTop)}),i(n),o?.(n)};return c.addEventListener("scroll",p),u.addEventListener("scroll",f),d.addEventListener("scroll",h),a.scroll||setTimeout(()=>{c.removeEventListener("scroll",p),u.removeEventListener("scroll",f),d.removeEventListener("scroll",h)},0),()=>{c.removeEventListener("scroll",p),u.removeEventListener("scroll",f),d.removeEventListener("scroll",h)}},[i,o,a,e,t,r,n,s])},oV=()=>{const{interactions:e}=a$(),t=l(null),r=l(null),n=l(null),o=l(null),i=l([]),a=l([]),s=l(null),{scrollbarsDimensions:{verticalScrollbarWidth:u,horizontalScrollbarHeight:c},resetHorizontalScrollbarHeight:p}=(({topGridWrapperRef:e,leftGridWrapperRef:t,dataGridWrapperRef:r})=>{const[n,o]=m(0),[i,a]=m(0);return g(()=>{if(e.current||r.current){const t=Math.max(tV(e.current).width,tV(r.current).width);n!==t&&o(t)}}),g(()=>{if(t.current||r.current){const e=Math.max(tV(t.current).height,tV(r.current).height);i!==e&&a(e)}}),{scrollbarsDimensions:{verticalScrollbarWidth:n,horizontalScrollbarHeight:i},resetHorizontalScrollbarHeight:()=>{a(0)}}})({topGridWrapperRef:r,leftGridWrapperRef:n,dataGridWrapperRef:o});(({gridSectionsWrapperRefs:{headerGridWrapperRef:e,topGridWrapperRef:t,leftGridWrapperRef:r,dataGridWrapperRef:n},gridRefs:{topGridRef:o,leftGridRef:i,dataGridRef:a}})=>{const{pageInfo:s}=n$(),{downloadService:l,viewService:u,layoutService:c}=u$(),d=f(()=>{const o={left:0,top:0};e.current?.scrollTo(o),t.current?.scrollTo(o),r.current?.scrollTo(o),n.current?.scrollTo(o)},[e,t,r,n]);g(()=>{d()},[s.page,d]),g(()=>{c.triggerdByExpandOrCollapse||d()},[c,d]),g(()=>{if(c.triggerdByExpandOrCollapse){const e=n.current?.scrollLeft??0,t=n.current?.scrollTop??0;i.current?.forEach(e=>{e?.scrollTo(t)}),o.current?.forEach(t=>{t?.scrollTo(e)}),a.current?.scrollTo({scrollTop:t,scrollLeft:e})}},[c,n,a,i,o]),g(()=>{(l.isDownloadedAsPDForImage||c.isSnapshot)&&n.current&&r.current&&t.current&&(n.current.scrollTop=u.scrollTop,n.current.scrollLeft=u.scrollLeft,r.current.scrollLeft=u.leftGridScrollLeft,t.current.scrollTop=u.topGridScrollTop)},[u,l,c,n,r,t])})({gridSectionsWrapperRefs:{headerGridWrapperRef:t,topGridWrapperRef:r,leftGridWrapperRef:n,dataGridWrapperRef:o},gridRefs:{topGridRef:i,leftGridRef:a,dataGridRef:s}});const{trackScrollDirection:h,scrollDirectionRefs:{verticalScrollDirection:v,horizontalScrollDirection:y}}=(()=>{const e=l(bF.None),t=l(bF.None),r=l({prevScrollTop:0,prevScrollLeft:0}),n=f(n=>{if(n instanceof WheelEvent&&(e.current=rV(n.deltaY,0),t.current=rV(n.deltaX,0)),n instanceof Event&&!(n instanceof WheelEvent)){const o=n.target;e.current=rV(o.scrollTop,r.current.prevScrollTop),r.current.prevScrollTop=o.scrollTop,t.current=rV(o.scrollLeft,r.current.prevScrollLeft),r.current.prevScrollLeft=o.scrollLeft}},[e,t,r]);return{trackScrollDirection:n,scrollDirectionRefs:{verticalScrollDirection:e,horizontalScrollDirection:t}}})(),b=(()=>{const{viewService:e}=u$();return f(t=>{const r=t.target,n=t.currentTarget,o=r.dataset.key;o===QH&&(e.leftGridScrollLeft=n.scrollLeft),o===eV&&(e.scrollLeft=n.scrollLeft),o===ZH&&(e.topGridScrollTop=n.scrollTop),o!==QH&&o!==eV||(e.scrollTop=n.scrollTop)},[e])})(),x={gridRefs:{topGridRef:i,leftGridRef:a,dataGridRef:s},getWrapperElements:f(()=>({headerGridWrapperElement:t.current,topGridWrapperElement:r.current,leftGridWrapperElement:n.current,dataGridWrapperElement:o.current}),[t,r,n,o]),updateViewService:b,trackScrollDirection:h,interactions:e};return(({gridRefs:{topGridRef:e,leftGridRef:t,dataGridRef:r},getWrapperElements:n,updateViewService:o,trackScrollDirection:i,interactions:a})=>{d(()=>{const{headerGridWrapperElement:o,topGridWrapperElement:s,leftGridWrapperElement:l,dataGridWrapperElement:u}=n(),c=e=>{e.ctrlKey||(e.preventDefault(),o.scrollLeft+=e.deltaX,o.scrollTop+=e.deltaY,l.scrollLeft=o.scrollLeft,s.scrollTop=o.scrollTop,i(e))},d=e=>{e.ctrlKey||(e.preventDefault(),l.scrollTop+=e.deltaY,t.current?.forEach(e=>{e?.scrollTo(l.scrollTop)}),o.scrollLeft+=e.deltaX,l.scrollLeft=o.scrollLeft,u.scrollTop=l.scrollTop,r.current?.scrollTo({scrollTop:l.scrollTop}),i(e))},p=t=>{t.ctrlKey||(t.preventDefault(),s.scrollLeft+=t.deltaX,e.current?.forEach(e=>{e?.scrollTo(s.scrollLeft)}),o.scrollTop+=t.deltaY,s.scrollTop=o.scrollTop,u.scrollLeft=s.scrollLeft,r.current?.scrollTo({scrollLeft:s.scrollLeft}),i(t))},f=n=>{n.ctrlKey||(n.preventDefault(),u.scrollLeft+=n.deltaX,u.scrollTop+=n.deltaY,r.current?.scrollTo({scrollLeft:u.scrollLeft,scrollTop:u.scrollTop}),s.scrollLeft=u.scrollLeft,e.current?.forEach(e=>{e?.scrollTo(u.scrollLeft)}),l.scrollTop=u.scrollTop,t.current?.forEach(e=>{e?.scrollTo(u.scrollTop)}),i(n))};return o.addEventListener("wheel",c),l.addEventListener("wheel",d),s.addEventListener("wheel",p),u.addEventListener("wheel",f),a.scroll||setTimeout(()=>{o.removeEventListener("wheel",c),l.removeEventListener("wheel",d),s.removeEventListener("wheel",p),u.removeEventListener("wheel",f)},0),()=>{o.removeEventListener("wheel",c),l.removeEventListener("wheel",d),s.removeEventListener("wheel",p),u.removeEventListener("wheel",f)}},[i,o,a,e,t,r,n])})(x),nV(x),{gridSectionsWrapperRefs:{headerGridWrapperRef:t,topGridWrapperRef:r,leftGridWrapperRef:n,dataGridWrapperRef:o},gridRefs:{topGridRef:i,leftGridRef:a,dataGridRef:s},scrollDirectionRefs:{verticalScrollDirection:v,horizontalScrollDirection:y},scrollbarsDimensions:{verticalScrollbarWidth:u,horizontalScrollbarHeight:c,resetHorizontalScrollbarHeight:p}}},iV=()=>{const{layoutService:e}=u$(),{rect:t,pageInfo:r}=n$();return v(()=>{let{height:n}=t;return e.hasLimitedData&&(n-=22),r.shouldShowPagination&&(n-=41),{...t,height:n}},[t,e,r.shouldShowPagination])},aV=({children:e,style:t})=>ii.jsx("div",{"data-testid":"fullSize",style:t,children:e}),sV=({children:e,style:t})=>{const{direction:r}=n$();return ii.jsx("div",{"data-section-id":"GRID",style:{direction:r,display:"grid",...t},children:e})},lV=e=>e&&`scrollable-container--${e}`,uV=({children:e,style:t,origin:r},n)=>{const{interactions:o}=a$(),i=o.scroll?t:{overflow:"hidden"};return ii.jsx("div",{"data-testid":"scrollable","data-key":lV(r),style:i,ref:n,children:e})};var cV=r.forwardRef(uV);const dV=({children:e,style:t})=>{const{direction:r}=n$();return ii.jsx("div",{"data-testid":"sticky",style:{position:"sticky",top:0,["rtl"===r?"right":"left"]:0,...t},children:e})};var pV=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function fV(e,t){return e===t||!(!pV(e)||!pV(t))}function hV(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!fV(e[r],t[r]))return!1;return!0}function mV(e,t){var r;void 0===t&&(t=hV);var n,o=[],i=!1;return function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return i&&r===this&&t(a,o)||(n=e.apply(this,a),i=!0,r=this,o=a),n}}var gV="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function vV(e){cancelAnimationFrame(e.id)}function yV(e,t){var r=gV();var n={id:requestAnimationFrame(function o(){gV()-r>=t?e.call(null):n.id=requestAnimationFrame(o)})};return n}var bV=-1;function xV(e){if(void 0===e&&(e=!1),-1===bV||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),bV=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return bV}var SV=null;function wV(e){if(void 0===e&&(e=!1),null===SV||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),o=n.style;return o.width="100px",o.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?SV="positive-descending":(t.scrollLeft=1,SV=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),SV}return SV}var CV=function(e){var t=e.columnIndex;return e.data,e.rowIndex+":"+t};function EV(e){var t,r=e.getColumnOffset,o=e.getColumnStartIndexForOffset,i=e.getColumnStopIndexForStartIndex,a=e.getColumnWidth,s=e.getEstimatedTotalHeight,l=e.getEstimatedTotalWidth,u=e.getOffsetForColumnAndAlignment,c=e.getOffsetForRowAndAlignment,d=e.getRowHeight,p=e.getRowOffset,f=e.getRowStartIndexForOffset,h=e.getRowStopIndexForStartIndex,m=e.initInstanceProps,g=e.shouldResetStyleCacheOnItemSizeChange,v=e.validateProps;return t=function(e){function t(t){var n;return(n=e.call(this,t)||this)._instanceProps=m(n.props,ql(n)),n._resetIsScrollingTimeoutId=null,n._outerRef=void 0,n.state={instance:ql(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=mV(function(e,t,r,o,i,a,s,l){return n.props.onItemsRendered({overscanColumnStartIndex:e,overscanColumnStopIndex:t,overscanRowStartIndex:r,overscanRowStopIndex:o,visibleColumnStartIndex:i,visibleColumnStopIndex:a,visibleRowStartIndex:s,visibleRowStopIndex:l})}),n._callOnScroll=void 0,n._callOnScroll=mV(function(e,t,r,o,i){return n.props.onScroll({horizontalScrollDirection:r,scrollLeft:e,scrollTop:t,verticalScrollDirection:o,scrollUpdateWasRequested:i})}),n._getItemStyle=void 0,n._getItemStyle=function(e,t){var o,i=n.props,s=i.columnWidth,l=i.direction,u=i.rowHeight,c=n._getItemStyleCache(g&&s,g&&l,g&&u),f=e+":"+t;if(c.hasOwnProperty(f))o=c[f];else{var h=r(n.props,t,n._instanceProps),m="rtl"===l;c[f]=o={position:"absolute",left:m?void 0:h,right:m?h:void 0,top:p(n.props,e,n._instanceProps),height:d(n.props,e,n._instanceProps),width:a(n.props,t,n._instanceProps)}}return o},n._getItemStyleCache=void 0,n._getItemStyleCache=mV(function(e,t,r){return{}}),n._onScroll=function(e){var t=e.currentTarget,r=t.clientHeight,o=t.clientWidth,i=t.scrollLeft,a=t.scrollTop,s=t.scrollHeight,l=t.scrollWidth;n.setState(function(e){if(e.scrollLeft===i&&e.scrollTop===a)return null;var t=n.props.direction,u=i;if("rtl"===t)switch(wV()){case"negative":u=-i;break;case"positive-descending":u=l-o-i}u=Math.max(0,Math.min(u,l-o));var c=Math.max(0,Math.min(a,s-r));return{isScrolling:!0,horizontalScrollDirection:e.scrollLeft<i?"forward":"backward",scrollLeft:u,scrollTop:c,verticalScrollDirection:e.scrollTop<a?"forward":"backward",scrollUpdateWasRequested:!1}},n._resetIsScrollingDebounced)},n._outerRefSetter=function(e){var t=n.props.outerRef;n._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},n._resetIsScrollingDebounced=function(){null!==n._resetIsScrollingTimeoutId&&vV(n._resetIsScrollingTimeoutId),n._resetIsScrollingTimeoutId=yV(n._resetIsScrolling,150)},n._resetIsScrolling=function(){n._resetIsScrollingTimeoutId=null,n.setState({isScrolling:!1},function(){n._getItemStyleCache(-1)})},n}El(t,e),t.getDerivedStateFromProps=function(e,t){return IV(e,t),v(e),null};var y=t.prototype;return y.scrollTo=function(e){var t=e.scrollLeft,r=e.scrollTop;void 0!==t&&(t=Math.max(0,t)),void 0!==r&&(r=Math.max(0,r)),this.setState(function(e){return void 0===t&&(t=e.scrollLeft),void 0===r&&(r=e.scrollTop),e.scrollLeft===t&&e.scrollTop===r?null:{horizontalScrollDirection:e.scrollLeft<t?"forward":"backward",scrollLeft:t,scrollTop:r,scrollUpdateWasRequested:!0,verticalScrollDirection:e.scrollTop<r?"forward":"backward"}},this._resetIsScrollingDebounced)},y.scrollToItem=function(e){var t=e.align,r=void 0===t?"auto":t,n=e.columnIndex,o=e.rowIndex,i=this.props,a=i.columnCount,d=i.height,p=i.rowCount,f=i.width,h=this.state,m=h.scrollLeft,g=h.scrollTop,v=xV();void 0!==n&&(n=Math.max(0,Math.min(n,a-1))),void 0!==o&&(o=Math.max(0,Math.min(o,p-1)));var y=s(this.props,this._instanceProps),b=l(this.props,this._instanceProps)>f?v:0,x=y>d?v:0;this.scrollTo({scrollLeft:void 0!==n?u(this.props,n,r,m,this._instanceProps,x):m,scrollTop:void 0!==o?c(this.props,o,r,g,this._instanceProps,b):g})},y.componentDidMount=function(){var e=this.props,t=e.initialScrollLeft,r=e.initialScrollTop;if(null!=this._outerRef){var n=this._outerRef;"number"==typeof t&&(n.scrollLeft=t),"number"==typeof r&&(n.scrollTop=r)}this._callPropsCallbacks()},y.componentDidUpdate=function(){var e=this.props.direction,t=this.state,r=t.scrollLeft,n=t.scrollTop;if(t.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("rtl"===e)switch(wV()){case"negative":o.scrollLeft=-r;break;case"positive-ascending":o.scrollLeft=r;break;default:var i=o.clientWidth,a=o.scrollWidth;o.scrollLeft=a-i-r}else o.scrollLeft=Math.max(0,r);o.scrollTop=Math.max(0,n)}this._callPropsCallbacks()},y.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&vV(this._resetIsScrollingTimeoutId)},y.render=function(){var e=this.props,t=e.children,r=e.className,o=e.columnCount,i=e.direction,a=e.height,u=e.innerRef,c=e.innerElementType,d=e.innerTagName,p=e.itemData,f=e.itemKey,h=void 0===f?CV:f,m=e.outerElementType,g=e.outerTagName,v=e.rowCount,y=e.style,b=e.useIsScrolling,x=e.width,S=this.state.isScrolling,w=this._getHorizontalRangeToRender(),C=w[0],E=w[1],I=this._getVerticalRangeToRender(),D=I[0],P=I[1],R=[];if(o>0&&v)for(var M=D;M<=P;M++)for(var L=C;L<=E;L++)R.push(n(t,{columnIndex:L,data:p,isScrolling:b?S:void 0,key:h({columnIndex:L,data:p,rowIndex:M}),rowIndex:M,style:this._getItemStyle(M,L)}));var A=s(this.props,this._instanceProps),k=l(this.props,this._instanceProps);return n(m||g||"div",{className:r,onScroll:this._onScroll,ref:this._outerRefSetter,style:ke({position:"relative",height:a,width:x,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:i},y)},n(c||d||"div",{children:R,ref:u,style:{height:A,pointerEvents:S?"none":void 0,width:k}}))},y._callPropsCallbacks=function(){var e=this.props,t=e.columnCount,r=e.onItemsRendered,n=e.onScroll,o=e.rowCount;if("function"==typeof r&&t>0&&o>0){var i=this._getHorizontalRangeToRender(),a=i[0],s=i[1],l=i[2],u=i[3],c=this._getVerticalRangeToRender(),d=c[0],p=c[1],f=c[2],h=c[3];this._callOnItemsRendered(a,s,d,p,l,u,f,h)}if("function"==typeof n){var m=this.state,g=m.horizontalScrollDirection,v=m.scrollLeft,y=m.scrollTop,b=m.scrollUpdateWasRequested,x=m.verticalScrollDirection;this._callOnScroll(v,y,g,x,b)}},y._getHorizontalRangeToRender=function(){var e=this.props,t=e.columnCount,r=e.overscanColumnCount,n=e.overscanColumnsCount,a=e.overscanCount,s=e.rowCount,l=this.state,u=l.horizontalScrollDirection,c=l.isScrolling,d=l.scrollLeft,p=r||n||a||1;if(0===t||0===s)return[0,0,0,0];var f=o(this.props,d,this._instanceProps),h=i(this.props,f,d,this._instanceProps),m=c&&"backward"!==u?1:Math.max(1,p),g=c&&"forward"!==u?1:Math.max(1,p);return[Math.max(0,f-m),Math.max(0,Math.min(t-1,h+g)),f,h]},y._getVerticalRangeToRender=function(){var e=this.props,t=e.columnCount,r=e.overscanCount,n=e.overscanRowCount,o=e.overscanRowsCount,i=e.rowCount,a=this.state,s=a.isScrolling,l=a.verticalScrollDirection,u=a.scrollTop,c=n||o||r||1;if(0===t||0===i)return[0,0,0,0];var d=f(this.props,u,this._instanceProps),p=h(this.props,d,u,this._instanceProps),m=s&&"backward"!==l?1:Math.max(1,c),g=s&&"forward"!==l?1:Math.max(1,c);return[Math.max(0,d-m),Math.max(0,Math.min(i-1,p+g)),d,p]},t}(C),t.defaultProps={direction:"ltr",itemData:void 0,useIsScrolling:!1},t}var IV=function(e,t){e.children,e.direction,e.height,e.innerTagName,e.outerTagName,e.overscanColumnsCount,e.overscanCount,e.overscanRowsCount,e.width,t.instance},DV=function(e,t){var r=e.rowCount,n=t.rowMetadataMap,o=t.estimatedRowHeight,i=t.lastMeasuredRowIndex,a=0;if(i>=r&&(i=r-1),i>=0){var s=n[i];a=s.offset+s.size}return a+(r-i-1)*o},PV=function(e,t){var r=e.columnCount,n=t.columnMetadataMap,o=t.estimatedColumnWidth,i=t.lastMeasuredColumnIndex,a=0;if(i>=r&&(i=r-1),i>=0){var s=n[i];a=s.offset+s.size}return a+(r-i-1)*o},RV=function(e,t,r,n){var o,i,a;if("column"===e?(o=n.columnMetadataMap,i=t.columnWidth,a=n.lastMeasuredColumnIndex):(o=n.rowMetadataMap,i=t.rowHeight,a=n.lastMeasuredRowIndex),r>a){var s=0;if(a>=0){var l=o[a];s=l.offset+l.size}for(var u=a+1;u<=r;u++){var c=i(u);o[u]={offset:s,size:c},s+=c}"column"===e?n.lastMeasuredColumnIndex=r:n.lastMeasuredRowIndex=r}return o[r]},MV=function(e,t,r,n){var o,i;return"column"===e?(o=r.columnMetadataMap,i=r.lastMeasuredColumnIndex):(o=r.rowMetadataMap,i=r.lastMeasuredRowIndex),(i>0?o[i].offset:0)>=n?LV(e,t,r,i,0,n):AV(e,t,r,Math.max(0,i),n)},LV=function(e,t,r,n,o,i){for(;o<=n;){var a=o+Math.floor((n-o)/2),s=RV(e,t,a,r).offset;if(s===i)return a;s<i?o=a+1:s>i&&(n=a-1)}return o>0?o-1:0},AV=function(e,t,r,n,o){for(var i="column"===e?t.columnCount:t.rowCount,a=1;n<i&&RV(e,t,n,r).offset<o;)n+=a,a*=2;return LV(e,t,r,Math.min(n,i-1),Math.floor(n/2),o)},kV=function(e,t,r,n,o,i,a){var s="column"===e?t.width:t.height,l=RV(e,t,r,i),u="column"===e?PV(t,i):DV(t,i),c=Math.max(0,Math.min(u-s,l.offset)),d=Math.max(0,l.offset-s+a+l.size);switch("smart"===n&&(n=o>=d-s&&o<=c+s?"auto":"center"),n){case"start":return c;case"end":return d;case"center":return Math.round(d+(c-d)/2);default:return o>=d&&o<=c?o:d>c||o<d?d:c}},OV=EV({getColumnOffset:function(e,t,r){return RV("column",e,t,r).offset},getColumnStartIndexForOffset:function(e,t,r){return MV("column",e,r,t)},getColumnStopIndexForStartIndex:function(e,t,r,n){for(var o=e.columnCount,i=e.width,a=RV("column",e,t,n),s=r+i,l=a.offset+a.size,u=t;u<o-1&&l<s;)u++,l+=RV("column",e,u,n).size;return u},getColumnWidth:function(e,t,r){return r.columnMetadataMap[t].size},getEstimatedTotalHeight:DV,getEstimatedTotalWidth:PV,getOffsetForColumnAndAlignment:function(e,t,r,n,o,i){return kV("column",e,t,r,n,o,i)},getOffsetForRowAndAlignment:function(e,t,r,n,o,i){return kV("row",e,t,r,n,o,i)},getRowOffset:function(e,t,r){return RV("row",e,t,r).offset},getRowHeight:function(e,t,r){return r.rowMetadataMap[t].size},getRowStartIndexForOffset:function(e,t,r){return MV("row",e,r,t)},getRowStopIndexForStartIndex:function(e,t,r,n){for(var o=e.rowCount,i=e.height,a=RV("row",e,t,n),s=r+i,l=a.offset+a.size,u=t;u<o-1&&l<s;)u++,l+=RV("row",e,u,n).size;return u},initInstanceProps:function(e,t){var r=e,n={columnMetadataMap:{},estimatedColumnWidth:r.estimatedColumnWidth||50,estimatedRowHeight:r.estimatedRowHeight||50,lastMeasuredColumnIndex:-1,lastMeasuredRowIndex:-1,rowMetadataMap:{}};return t.resetAfterColumnIndex=function(e,r){void 0===r&&(r=!0),t.resetAfterIndices({columnIndex:e,shouldForceUpdate:r})},t.resetAfterRowIndex=function(e,r){void 0===r&&(r=!0),t.resetAfterIndices({rowIndex:e,shouldForceUpdate:r})},t.resetAfterIndices=function(e){var r=e.columnIndex,o=e.rowIndex,i=e.shouldForceUpdate,a=void 0===i||i;"number"==typeof r&&(n.lastMeasuredColumnIndex=Math.min(n.lastMeasuredColumnIndex,r-1)),"number"==typeof o&&(n.lastMeasuredRowIndex=Math.min(n.lastMeasuredRowIndex,o-1)),t._getItemStyleCache(-1),a&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.columnWidth,e.rowHeight}}),qV=function(e,t){return e};function TV(e){var t,r=e.getItemOffset,o=e.getEstimatedTotalSize,i=e.getItemSize,a=e.getOffsetForIndexAndAlignment,s=e.getStartIndexForOffset,l=e.getStopIndexForStartIndex,u=e.initInstanceProps,c=e.shouldResetStyleCacheOnItemSizeChange,d=e.validateProps;return t=function(e){function t(t){var n;return(n=e.call(this,t)||this)._instanceProps=u(n.props,ql(n)),n._outerRef=void 0,n._resetIsScrollingTimeoutId=null,n.state={instance:ql(n),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof n.props.initialScrollOffset?n.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},n._callOnItemsRendered=void 0,n._callOnItemsRendered=mV(function(e,t,r,o){return n.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:r,visibleStopIndex:o})}),n._callOnScroll=void 0,n._callOnScroll=mV(function(e,t,r){return n.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:r})}),n._getItemStyle=void 0,n._getItemStyle=function(e){var t,o=n.props,a=o.direction,s=o.itemSize,l=o.layout,u=n._getItemStyleCache(c&&s,c&&l,c&&a);if(u.hasOwnProperty(e))t=u[e];else{var d=r(n.props,e,n._instanceProps),p=i(n.props,e,n._instanceProps),f="horizontal"===a||"horizontal"===l,h="rtl"===a,m=f?d:0;u[e]=t={position:"absolute",left:h?void 0:m,right:h?m:void 0,top:f?0:d,height:f?"100%":p,width:f?p:"100%"}}return t},n._getItemStyleCache=void 0,n._getItemStyleCache=mV(function(e,t,r){return{}}),n._onScrollHorizontal=function(e){var t=e.currentTarget,r=t.clientWidth,o=t.scrollLeft,i=t.scrollWidth;n.setState(function(e){if(e.scrollOffset===o)return null;var t=n.props.direction,a=o;if("rtl"===t)switch(wV()){case"negative":a=-o;break;case"positive-descending":a=i-r-o}return a=Math.max(0,Math.min(a,i-r)),{isScrolling:!0,scrollDirection:e.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!1}},n._resetIsScrollingDebounced)},n._onScrollVertical=function(e){var t=e.currentTarget,r=t.clientHeight,o=t.scrollHeight,i=t.scrollTop;n.setState(function(e){if(e.scrollOffset===i)return null;var t=Math.max(0,Math.min(i,o-r));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}},n._resetIsScrollingDebounced)},n._outerRefSetter=function(e){var t=n.props.outerRef;n._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},n._resetIsScrollingDebounced=function(){null!==n._resetIsScrollingTimeoutId&&vV(n._resetIsScrollingTimeoutId),n._resetIsScrollingTimeoutId=yV(n._resetIsScrolling,150)},n._resetIsScrolling=function(){n._resetIsScrollingTimeoutId=null,n.setState({isScrolling:!1},function(){n._getItemStyleCache(-1,null)})},n}El(t,e),t.getDerivedStateFromProps=function(e,t){return NV(e,t),d(e),null};var p=t.prototype;return p.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)},p.scrollToItem=function(e,t){void 0===t&&(t="auto");var r=this.props,n=r.itemCount,o=r.layout,i=this.state.scrollOffset;e=Math.max(0,Math.min(e,n-1));var s=0;if(this._outerRef){var l=this._outerRef;s="vertical"===o?l.scrollWidth>l.clientWidth?xV():0:l.scrollHeight>l.clientHeight?xV():0}this.scrollTo(a(this.props,e,t,i,this._instanceProps,s))},p.componentDidMount=function(){var e=this.props,t=e.direction,r=e.initialScrollOffset,n=e.layout;if("number"==typeof r&&null!=this._outerRef){var o=this._outerRef;"horizontal"===t||"horizontal"===n?o.scrollLeft=r:o.scrollTop=r}this._callPropsCallbacks()},p.componentDidUpdate=function(){var e=this.props,t=e.direction,r=e.layout,n=this.state,o=n.scrollOffset;if(n.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("horizontal"===t||"horizontal"===r)if("rtl"===t)switch(wV()){case"negative":i.scrollLeft=-o;break;case"positive-ascending":i.scrollLeft=o;break;default:var a=i.clientWidth,s=i.scrollWidth;i.scrollLeft=s-a-o}else i.scrollLeft=o;else i.scrollTop=o}this._callPropsCallbacks()},p.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&vV(this._resetIsScrollingTimeoutId)},p.render=function(){var e=this.props,t=e.children,r=e.className,i=e.direction,a=e.height,s=e.innerRef,l=e.innerElementType,u=e.innerTagName,c=e.itemCount,d=e.itemData,p=e.itemKey,f=void 0===p?qV:p,h=e.layout,m=e.outerElementType,g=e.outerTagName,v=e.style,y=e.useIsScrolling,b=e.width,x=this.state.isScrolling,S="horizontal"===i||"horizontal"===h,w=S?this._onScrollHorizontal:this._onScrollVertical,C=this._getRangeToRender(),E=C[0],I=C[1],D=[];if(c>0)for(var P=E;P<=I;P++)D.push(n(t,{data:d,key:f(P,d),index:P,isScrolling:y?x:void 0,style:this._getItemStyle(P)}));var R=o(this.props,this._instanceProps);return n(m||g||"div",{className:r,onScroll:w,ref:this._outerRefSetter,style:ke({position:"relative",height:a,width:b,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:i},v)},n(l||u||"div",{children:D,ref:s,style:{height:S?"100%":R,pointerEvents:x?"none":void 0,width:S?R:"100%"}}))},p._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],r=e[1],n=e[2],o=e[3];this._callOnItemsRendered(t,r,n,o)}if("function"==typeof this.props.onScroll){var i=this.state,a=i.scrollDirection,s=i.scrollOffset,l=i.scrollUpdateWasRequested;this._callOnScroll(a,s,l)}},p._getRangeToRender=function(){var e=this.props,t=e.itemCount,r=e.overscanCount,n=this.state,o=n.isScrolling,i=n.scrollDirection,a=n.scrollOffset;if(0===t)return[0,0,0,0];var u=s(this.props,a,this._instanceProps),c=l(this.props,u,a,this._instanceProps),d=o&&"backward"!==i?1:Math.max(1,r),p=o&&"forward"!==i?1:Math.max(1,r);return[Math.max(0,u-d),Math.max(0,Math.min(t-1,c+p)),u,c]},t}(C),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var NV=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},_V=function(e,t,r){var n=e.itemSize,o=r.itemMetadataMap,i=r.lastMeasuredIndex;if(t>i){var a=0;if(i>=0){var s=o[i];a=s.offset+s.size}for(var l=i+1;l<=t;l++){var u=n(l);o[l]={offset:a,size:u},a+=u}r.lastMeasuredIndex=t}return o[t]},jV=function(e,t,r,n,o){for(;n<=r;){var i=n+Math.floor((r-n)/2),a=_V(e,i,t).offset;if(a===o)return i;a<o?n=i+1:a>o&&(r=i-1)}return n>0?n-1:0},FV=function(e,t,r,n){for(var o=e.itemCount,i=1;r<o&&_V(e,r,t).offset<n;)r+=i,i*=2;return jV(e,t,Math.min(r,o-1),Math.floor(r/2),n)},zV=function(e,t){var r=e.itemCount,n=t.itemMetadataMap,o=t.estimatedItemSize,i=t.lastMeasuredIndex,a=0;if(i>=r&&(i=r-1),i>=0){var s=n[i];a=s.offset+s.size}return a+(r-i-1)*o},WV=TV({getItemOffset:function(e,t,r){return _V(e,t,r).offset},getItemSize:function(e,t,r){return r.itemMetadataMap[t].size},getEstimatedTotalSize:zV,getOffsetForIndexAndAlignment:function(e,t,r,n,o,i){var a=e.direction,s=e.height,l=e.layout,u=e.width,c="horizontal"===a||"horizontal"===l?u:s,d=_V(e,t,o),p=zV(e,o),f=Math.max(0,Math.min(p-c,d.offset)),h=Math.max(0,d.offset-c+d.size+i);switch("smart"===r&&(r=n>=h-c&&n<=f+c?"auto":"center"),r){case"start":return f;case"end":return h;case"center":return Math.round(h+(f-h)/2);default:return n>=h&&n<=f?n:n<h?h:f}},getStartIndexForOffset:function(e,t,r){return function(e,t,r){var n=t.itemMetadataMap,o=t.lastMeasuredIndex;return(o>0?n[o].offset:0)>=r?jV(e,t,o,0,r):FV(e,t,Math.max(0,o),r)}(e,r,t)},getStopIndexForStartIndex:function(e,t,r,n){for(var o=e.direction,i=e.height,a=e.itemCount,s=e.layout,l=e.width,u="horizontal"===o||"horizontal"===s?l:i,c=_V(e,t,n),d=r+u,p=c.offset+c.size,f=t;f<a-1&&p<d;)f++,p+=_V(e,f,n).size;return f},initInstanceProps:function(e,t){var r={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,n){void 0===n&&(n=!0),r.lastMeasuredIndex=Math.min(r.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),n&&t.forceUpdate()},r},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.itemSize}});function $V(e,t){for(var r in e)if(!(r in t))return!0;for(var n in t)if(e[n]!==t[n])return!0;return!1}var HV=["style"],VV=["style"];function BV(e,t){var r=e.style,n=Oe(e,HV),o=t.style,i=Oe(t,VV);return!$V(r,o)&&!$V(n,i)}const GV=10,UV=(e,t)=>e.current===bF.Backward?t:0,YV=(e,t,r,n)=>{for(let o=r;o<r+n;o++){const r=e.at(o);if(void 0===r||void 0===r.at(t))return!0}return!1},KV=(e,t)=>e.qLeft+e.qWidth===t.qLeft&&e.qTop===t.qTop&&e.qHeight===t.qHeight,XV=({pageInfo:e,measureData:t,pageTop:r,qHeight:n,startLeft:o,endLeft:i})=>{const a=[],s=e.page*e.rowsPerPage;for(let e=o;e<i;e++)if(YV(t,e,r,n)){const t=a[a.length-1],o={qLeft:e,qTop:r+s,qWidth:1,qHeight:n};void 0!==t&&KV(t,o)?t.qWidth+=o.qWidth:a.push(o)}return a},JV=({pageInfo:e,measureData:t,scrollDirection:r,viewService:n,minBufferStartLeft:o,minBufferEndLeft:i,columnEndIndex:a})=>{const{gridRowStartIndex:s,gridHeight:l}=n,u=r.current===bF.Backward?Math.max(0,o-25):i,c=Math.min(u+25,a);return XV({pageInfo:e,measureData:t,startLeft:u,endLeft:c,pageTop:s,qHeight:l})},ZV=({pageInfo:e,measureData:t,scrollDirection:r,layoutService:n,viewService:o})=>{const{startLeft:i,endLeft:a,pageTop:s,qHeight:l}=((e,t,r)=>{const{gridColumnStartIndex:n,gridRowStartIndex:o,gridWidth:i,gridHeight:a}=t,s=e.size.x,l=UV(r,GV),u=Math.max(n-l,0);return{startLeft:u,endLeft:u+Math.min(i+GV,s-u),pageTop:o,qHeight:a}})(n,o,r),u=XV({pageInfo:e,measureData:t,startLeft:i,endLeft:a,pageTop:s,qHeight:l});return u.length>0?[...u,...JV({pageInfo:e,measureData:t,scrollDirection:r,viewService:o,minBufferStartLeft:i,minBufferEndLeft:a,columnEndIndex:n.size.x})]:u},QV=(e,t,r,n)=>{const o=e[r];if(void 0===o)return!0;for(let e=t;e<t+n;e++){if(void 0===o[e])return!0}return!1},eB=(e,t)=>e.qTop+e.qHeight===t.qTop&&e.qLeft===t.qLeft&&e.qWidth===t.qWidth,tB=({startTop:e,endTop:t,qLeft:r,qWidth:n,measureData:o,pageInfo:i})=>{const a=[],s=i.page*i.rowsPerPage;for(let i=e;i<t;i++)if(QV(o,r,i,n)){const e=a.at(-1),t={qLeft:r,qTop:i+s,qWidth:n,qHeight:1};void 0!==e&&eB(e,t)?e.qHeight+=t.qHeight:a.push(t)}return a},rB=({pageInfo:e,measureData:t,scrollDirection:r,viewService:n})=>{const{startTop:o,endTop:i,qLeft:a,qWidth:s}=((e,t,r)=>{const{gridColumnStartIndex:n,gridRowStartIndex:o,gridWidth:i,gridHeight:a}=t,s=UV(r,GV),l=Math.max(o-s,0);return{startTop:l,endTop:l+Math.min(a+GV,e.rowsOnCurrentPage-l),qLeft:n,qWidth:i}})(e,n,r),l=tB({startTop:o,endTop:i,qLeft:a,qWidth:s,measureData:t,pageInfo:e});if(l.length>0){const n=r.current===bF.Backward?Math.max(0,o-25):i,u=Math.min(n+25,e.rowsOnCurrentPage),c=tB({startTop:n,endTop:u,qLeft:a,qWidth:s,measureData:t,pageInfo:e});return[...l,...c]}return l},nB=async(e,t,r,n,o,i,a,s)=>{const{gridColumnStartIndex:l,gridRowStartIndex:u,gridWidth:c,gridHeight:d}=o;let p=[],f=[];i.current!==bF.None&&(p=rB({pageInfo:n,measureData:r,scrollDirection:i,viewService:o})),a.current!==bF.None&&(f=ZV({pageInfo:n,measureData:r,scrollDirection:a,layoutService:t,viewService:o})),i.current===bF.None&&a.current===bF.None&&(p=tB({measureData:r,pageInfo:n,qLeft:l,qWidth:c,startTop:u,endTop:u+d}));const h=e.fetchPages([...p,...f]);s.isDownloadedAsPDForImage&&s.waitForPromise(h)},oB=function(e){var t,r,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,i=0;return function(){t=this;for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];r=s;var u=Date.now()-i,c=function(){i=Date.now(),n=0,e.apply(t,r)};n||(u>=o?c():n=setTimeout(c,o-u))}}(nB,100),iB=Bj(nB,75),aB=(e,t,r=!1)=>void 0!==e&&(e.isLeafNode||r&&e.isLeftColumn?e.mainAxisPageCoord===t:e.mainAxisPageCoord+e.leafCount-1===t),sB=({style:e,index:t,isLastRow:r,isLastColumn:n,showLastBorder:o,isLeftColumn:i,showTotalCellDivider:a})=>{const{direction:s}=n$(),{styleService:{grid:{border:l,divider:u}}}=u$();return ii.jsx("div",{style:{...e,...QF,...nz(r,n,l,s,o),...iz({bottomDivider:a&&i,rightDivider:a&&!i,borderColor:u})},"data-testid":"empty-cell","data-index":t})},lB=({children:e,verticalAlign:t,width:r,right:n,isLeftColumn:o})=>{const{layoutService:{isIndentModeEnabled:i}}=u$(),a=o&&i;return ii.jsx("div",{"data-key":"sticky-cell-container",style:{display:"flex",flexDirection:"row",width:r,maxWidth:"100%",maxHeight:"100%",position:"sticky",left:4,top:0,bottom:0,right:n,...!a&&{alignItems:t,alignSelf:t,overflow:"hidden"}},children:e})},uB=e=>{const{type:t,imageSize:r}=e;return t!==uF.Image||"fill"!==r&&"fitWidth"!==r?"fit-content":"100%"},cB=e=>"number"==typeof e&&!Number.isNaN(+e),dB=e=>"string"==typeof e&&e.length>0||"number"==typeof e?+e:NaN,pB=x((e,t)=>ii.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:ii.jsx("path",{d:"M7.5 8.5H2v-1h5.5V2h1v5.5H14v1H8.5V14h-1z"})})),fB=x((e,t)=>ii.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:ii.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"})})),hB=x((e,t)=>ii.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:[ii.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"}),ii.jsx("use",{fillRule:"evenodd"})]})),mB=x((e,t)=>ii.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:ii.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"})})),gB=x((e,t)=>ii.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:ii.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"})})),vB=x((e,t)=>ii.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:ii.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"})})),yB=x((e,t)=>ii.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:ii.jsx("path",{d:"M2 7.5h12v1H2z"})})),bB=x((e,t)=>ii.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:ii.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"})})),xB=x((e,t)=>ii.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:ii.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"})})),SB=x((e,t)=>ii.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:ii.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"})})),wB=x((e,t)=>ii.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:ii.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"})})),CB=x((e,t)=>ii.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:ii.jsx("path",{d:"m6 10 7-7 2 2-7 7-2 2-5-5 2-2z"})})),EB=x((e,t)=>ii.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:ii.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"})})),IB=x((e,t)=>ii.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:ii.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"})})),DB=x((e,t)=>ii.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:ii.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"})})),PB={m:CB,"ï":SB,R:x((e,t)=>ii.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:ii.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:EB,T:IB,U:DB,P:xB,Q:vB,"è":x((e,t)=>ii.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:ii.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"})})),"¢":mB,"©":hB,"23F4":gB,2013:wB,"&":bB,add:pB,"minus-2":yB,dot:fB},RB=({size:e,iconKey:t,color:r,pvStyle:n})=>{const o=t&&PB[t];return o&&ii.jsx("div",{"data-testid":"representation-indicator-icon",style:{color:r,height:e,...n},children:ii.jsx(o,{style:{height:e}})})},MB=(e,t)=>e.max===e.min?.5:(t-e.min)/(e.max-e.min),LB=(e,t,r)=>{const n=e.paletteColors?e.paletteColors[t]:e.localPaletteColors[t];return r.getColorPickerColor(n)},AB=(e,t,r)=>{const n={previousColor:(o=e.localPaletteColors)[(i=t)-(i>0?1:0)],nextColor:o[i+(i<o.length-1?1:0)]};var o,i;const a=((e,t)=>{const r=e.limits&&e.limits.concat().sort((e,t)=>e.value-t.value);return{lowerLimit:r&&t>0?r[t-1]:{value:0,gradient:!1},upperLimit:r&&r[t]?r[t]:{value:1,gradient:!1}}})(e,t),s=((e,t,r,n,o)=>{const{upperLimit:i,lowerLimit:a}=e,{previousColor:s,nextColor:l}=t,u=n===i.value?1:(n-a.value)/(i.value-a.value);return a.gradient&&i.gradient?n-a.value<i.value-n?{color:s.color,t:.5-u}:{color:l.color,t:u-.5}:a.gradient?{color:s.color,t:1-(.5+u/2)}:i.gradient?{color:l.color,t:u/2}:{color:o.localPaletteColors[r].color,t:n}})(a,n,t,r,e);return D_(e.localPaletteColors[t].color??"").blend(D_(s.color??""),s.t)},kB=(e,t,r)=>{const n=((e,t)=>{const{limits:r}=e;return r&&(e.limits=r.sort((e,t)=>e.value-t.value),e.limits=r.map(e=>({...e,value:MB(t,e.value)}))),e})({...e},t),o=n.paletteColors||n.localPaletteColors;return o&&(n.localPaletteColors=o.concat().map((e,t)=>({color:LB(n,t,r)}))),n},OB=(e,t,r,n)=>{const o=kB(e,r,n),{localPaletteColors:i}=o;if(t<=0)return i[0].color;if(t>=1)return i[i.length-1].color;const a=((e,t)=>{let r="",n=0;const{limits:o,localPaletteColors:i}=e;for(let a=0;a<i.length;a++){const i=o&&o[a]?o[a].value:1;if(t>=n&&t<i){r=AB(e,a,t);break}n=i}return r})(o,t);return a},qB=(e,t)=>{const r=(e=>e.map(e=>e.value??e).sort((e,t)=>e-t))(e),n=r.some(e=>!cB(e));return 0===r.length||n?(e=>{const t=0===e?0:.5*e;return{min:e-t,max:e+t}})(t):1===r.length?((e,t)=>{const r=e[0]-t;if(0===r||!cB(r)){const e=0===t?.5:Math.abs(.5*t);return{min:t-e,max:t+e}}return r>0?{min:t-.5*Math.abs(t),max:e[0]+2*r}:{min:e[0]+2*r,max:t+.5*Math.abs(t)}})(r,t):((e,t)=>{let r=e[e.length-1]-e[0];return r=r>0?r:1,{min:Math.min(t,e[0])-r/2,max:Math.max(t,e[e.length-1])+r/2}})(r,t)},TB=(e,t)=>{const{limits:r}=e.segments;if(!r)return;const n=((e,t)=>{const{min:r,max:n}=qB(e,t),o=Math.abs(t);return{min:r??t-o,max:n??t+o}})(r,t),o=((e,t,r)=>{const{limits:n,paletteColors:o,localPaletteColors:i}=e.segments;if(!n||!cB(t))return 0;let a=r&&cB(r)?Math.min(r,t):0;const s=n.sort((e,t)=>e.value-t.value),l=o||i;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,n.min);return{limitRange:n,limitPaletteColorIndex:o}},NB=e=>"flex-start"===e?"flex-end":"flex-start",_B=(e,t,r,n)=>{const o=e.indicatorConditionalColoring;if(!o)return;const i=TB(o,t),a=((e,t,r,n)=>{const{segments:o}=e;if(!o||!r)return;const{limits:i}=o;if(!i?.length||!((e,t)=>!(!e||0===e.length||!(e[t]?.gradient??e[t-1]?.gradient)))(i,r.limitPaletteColorIndex))return LB(o,r.limitPaletteColorIndex,n);const a=MB(r.limitRange,t);return OB(o,a,r.limitRange,n)})(o,t,i,n),s=o.segments.paletteColors[i?.limitPaletteColorIndex||0].icon,{indicator:l}=e;let u=l?.position||"right";return"rtl"===r&&(u="right"===u?"left":"right"),{color:a,iconKey:s,position:u}},jB=({representation:e,cellValue:t,textStyle:r})=>{const{styleService:n}=u$(),{theme:o}=a$(),{direction:i}=n$(),{text:a,indicator:s}=e,{showTextValues:l,applySegmentColors:u}=s??{},c=_B(e,t,i,o),{fontSize:d,fontFamily:p,fontStyle:f,fontWeight:h,textDecoration:m}=n.measureValues,g={fontSize:d,fontFamily:p,fontStyle:f,fontWeight:h,textDecoration:m},v=parseInt(d||VF,10),{iconKey:y,color:b,position:x}=c||{},S={display:"flex",paddingTop:2};return l?ii.jsxs("div",{"data-key":"representation-indicator",style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"4px",overflow:r?.overflow,color:u?b:r?.color},children:["left"===x&&RB({size:v,iconKey:y,color:b,pvStyle:S}),ii.jsx("span",{style:{paddingTop:4,overflow:r?.overflow,textOverflow:r?.textOverflow,whiteSpace:"nowrap",direction:t<0?"ltr":void 0,...g},children:a}),"right"===x&&RB({size:v,iconKey:y,color:b,pvStyle:S})]}):(S.paddingTop=5,RB({size:v,iconKey:y,color:b,pvStyle:S}))},FB=(e,t,r)=>{if(e?.auto)return t;switch(e?.align){case"center":return"center";case"left":return"rtl"===r?"flex-end":"flex-start";case"right":return"rtl"===r?"flex-start":"flex-end";default:return t}},zB=(e,t)=>{let{textAlign:r}=t.getDimensionInfo(e.dimensionInfoIndex)??{};return e.isPseudoDimension&&void 0!==e.visibleMeasureInfoIndex&&({labelTextAlign:r}=t.visibleMeasureInfo.at(e.visibleMeasureInfoIndex)??{}),r?.auto||void 0===r?"left":r.align},WB=(e,t,r,n,o)=>{if(o)return;const i=e.representation,a=jH({isLeftColumn:r,layoutService:t,representation:i}),s=r?"flex-start":"center",l=e.representation.resolvedImagePosition?.horizontal;if(e.representation.type===uF.Image)return a&&l&&"center"!==l&&"rtl"===n?NB(l):l??s;if(e.isPseudoDimension&&void 0!==e.visibleMeasureInfoIndex){const{labelTextAlign:r}=t.visibleMeasureInfo[e.visibleMeasureInfoIndex]??{};return FB(r,s,n)}const{textAlign:u}=t.getDimensionInfo(e.dimensionInfoIndex)??{};return FB(u,s,n)},$B=e=>!!e.target?.getAttribute("class")?.includes(bT),HB=(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:r}=t.payload,n=Math.min(r,e.activeSelection.startIndex),o=Math.max(r,e.activeSelection.endIndex);if(n===e.activeSelection.startIndex&&o===e.activeSelection.endIndex)return e;const i={...e.activeSelection,startIndex:n,endIndex:o};return i.clientSelectedCells=(e=>{const{getCellFromIndex:t,startIndex:r,endIndex:n,clientSelectedCells:o}=e,i=new Map(o);for(let e=r;e<=n;e++){const r=t(e);"N"===r?.ref.qType&&i.set(r.ref.qElemNo,r)}return i})(i),{...e,activeSelection:i}}default:return e}},VB=e=>null!==e.target?.closest("[data-prevent-selection]"),BB=e=>"A"===e.target?.tagName,GB=({startIndex:e,getCellFromIndex:t,cell:r})=>({type:"mousedown",payload:{activeSelection:{startIndex:e,endIndex:e,getCellFromIndex:t,clientSelectedCells:(new Map).set(r.ref.qElemNo,r)},selectedField:{selectionCellType:r.selectionCellType,index:"L"===r.selectionCellType?r.x:r.y}}});const UB=u({createMouseDownHandler:()=>()=>{},createMouseOverHandler:()=>()=>{},createPointerUpHandler:()=>()=>{},isSelected:()=>!1,isActive:!1,isLocked:()=>!1}),YB=()=>h(UB),KB=({children:e,selections:t})=>{const r=function(e){const{updatePageInfo:t}=n$(),r=e.isActive(),[n,o]=c(HB,{engineSelectedCells:null,selectedField:null,activeSelection:null});d(()=>{const r=()=>{o({type:"clearSelections"})},n=()=>{r(),t({page:0})};return e.on("deactivated",r),e.on("canceled",r),e.on("confirmed",n),e.on("cleared",r),()=>{e.removeListener("deactivated",r),e.removeListener("canceled",r),e.removeListener("confirmed",n),e.removeListener("cleared",r)}},[e,t]);const i=f(async()=>{if(!n.activeSelection)return;var t,r;1===n.activeSelection.clientSelectedCells.size&&(t=n.engineSelectedCells,(r=n.activeSelection).clientSelectedCells.forEach((e,n)=>{t?.has(n)&&(r.clientSelectedCells.delete(n),t.delete(n))}));const i=new Map([...n.engineSelectedCells??new Map,...n.activeSelection.clientSelectedCells]);try{o({type:"mouseup",payload:{engineSelectedCells:i}}),await e.select({method:"selectPivotCells",params:[p$,Array.from(i,([,e])=>({qType:e.selectionCellType,qRow:e.y,qCol:e.x}))]})}catch(e){console.error(e),o({type:"mouseup",payload:{engineSelectedCells:n.engineSelectedCells}})}},[n,e]);d(()=>{if(n.activeSelection)return document.addEventListener("mouseup",i),()=>{document.removeEventListener("mouseup",i)}},[i,n.activeSelection]);const a=f((e,t)=>r=>{const n=t(e);$B(r)||VB(r)||BB(r)||!(e=>1===e.buttons)(r)||!n||o(GB({startIndex:e,getCellFromIndex:t,cell:n}))},[]),s=f(t=>async()=>{n.activeSelection&&(e.isActive()||await e.begin([p$]),o({type:"mouseover",payload:{index:t}}))},[n.activeSelection,e]),l=f((e,t)=>r=>{if("touch"!==r.pointerType)return;const n=t(e);$B(r)||VB(r)||BB(r)||!n||(o(GB({startIndex:e,getCellFromIndex:t,cell:n})),i())},[i]),u=f(e=>!(!n.engineSelectedCells?.size&&!n.activeSelection?.clientSelectedCells.size||!n.selectedField||e.selectionCellType===n.selectedField.selectionCellType&&("L"===e.selectionCellType?n.selectedField.index===e.x:n.selectedField.index===e.y)),[n.activeSelection?.clientSelectedCells.size,n.engineSelectedCells?.size,n.selectedField]),p=f(e=>!u(e)&&(n.engineSelectedCells?.has(e.ref.qElemNo)||!!n.activeSelection?.clientSelectedCells.has(e.ref.qElemNo)),[u,n.activeSelection?.clientSelectedCells,n.engineSelectedCells]);return v(()=>({isSelected:p,isActive:r,isLocked:u,createMouseDownHandler:a,createMouseOverHandler:s,createPointerUpHandler:l}),[p,r,u,a,s,l])}(t);return ii.jsx(UB.Provider,{value:r,children:e})},XB=e=>"fill"===e.representation.imageSize,JB=(e,t)=>{let r=e.isLeftColumn?"flex-start":"center";return e.isLeftColumn&&XB(e)&&t&&(r="center"),e.representation.type!==uF.Image||XB(e)?r:e.representation.resolvedImagePosition?.vertical};var ZB=function(e){return e.Background="background",e.Color="color",e.FontWeight="fontWeight",e.FontStyle="fontStyle",e.TextDecoration="textDecoration",e}(ZB||{});const QB={brighter:.5,darker:.3,opacity:.03},eG=(e,{cell:t,styleService:r})=>{if(e===ZB.Background||e===ZB.Color){const r=t.expressionColor[e];if(r)return r}return t.isNull?r.nullValues[e]:t.isPseudoDimension?r.measureLabels[e]:t.isTotal?r.totalValues[e]:r.dimensionValues[e]},tG=({styleService:e,isCellSelected:t,cell:r,isCellLocked:n})=>{if(t)return e.selectedColors.background;const o=eG(ZB.Background,{cell:r,styleService:e});return!n||!o||r.isPseudoDimension||r.isEmpty||r.isNull||r.isTotal?eG(ZB.Background,{cell:r,styleService:e}):`repeating-linear-gradient(\n -45deg,\n ${OF(i=o,QB)} 0px 2px,\n ${i} 0px 4px\n ) border-box`;var i},rG=({cell:e,styleService:t,isCellSelected:r})=>r?t.selectedColors.color:eG(ZB.Color,{cell:e,styleService:t}),nG=({cell:e,styleService:t})=>{const{qCanCollapse:r,qCanExpand:n}=e.ref,o=eG(ZB.FontWeight,{cell:e,styleService:t});return void 0===o&&(n||r)?GF:o},oG=({cell:e,styleService:t})=>eG(ZB.FontStyle,{cell:e,styleService:t}),iG=({cell:e,styleService:t})=>eG(ZB.TextDecoration,{cell:e,styleService:t}),aG=e=>e?"pointer":"default",sG=({expandOrCollapse:e,cell:t})=>r=>{e?.(t.y,t.x),r.stopPropagation()},lG=(e,t)=>{if(!e.isLeftColumn||e.representation.type===uF.Image)return{padding:4};return{padding:4,marginTop:t.dimensionValueTextHeight/2-6.5-4}},uG=({cell:e,isLeftColumn:t,isCellSelected:r})=>{const{styleService:n,layoutService:o}=u$(),{interactions:i}=a$(),{isActive:a}=YB(),{dataModel:s}=kH();if(!e.ref.qCanExpand&&!e.ref.qCanCollapse)return null;const l=!i.active||a||!s,u=rG({cell:e,styleService:n,isCellSelected:r}),c=a?.4:1,d=e.ref.qCanExpand?hW:fW;let p;p=e.ref.qCanExpand?t?s.expandLeft:s.expandTop:t?s.collapseLeft:s.collapseTop;const f=jH({isLeftColumn:t,layoutService:o,representation:e.representation});return ii.jsx(d,{opacity:c,color:u,"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,...lG(e,n),...f&&{alignSelf:JB(e)}},onClick:l?void 0:sG({cell:e,expandOrCollapse:p})})},cG=e=>{switch(e){case"fitHeight":case"fill":case"alwaysFit":return"100%";case"originalSize":return"fit-content";default:return"auto"}},dG=(e,t,r)=>{if("alwaysFit"===e&&t&&!r)return"fit-content";switch(e){case"fitHeight":return"auto";case"originalSize":return"fit-content";case"alwaysFit":return r?"unset":"100%";default:return"100%"}},pG=(e,t)=>{if("alwaysFit"===e)switch(t?.vertical){case"flex-start":return"center top";case"flex-end":return"center bottom";default:return"center center"}},fG=({representation:e,canExpandOrCollapse:t,leafCount:r,isLeftColumn:n,styleService:o,layoutService:i,isMeasureCell:a})=>{const{isIndentModeEnabled:s}=i,l=jH({isLeftColumn:n,layoutService:i,representation:e}),u=t?21:0,c=e.imageBox?.width??24;let d=`calc(100% - ${u}px)`,p=o.headerCellHeight;n&&l&&(d=c),(a||n)&&(p=o.contentCellHeight);let f=p;switch(n&&void 0!==r&&!s&&(f=p*Math.max(r,1)),e.imageSize){case"originalSize":return{maxWidth:d,maxHeight:f,...l?{width:d}:{}};case"fitWidth":return{width:d,maxHeight:f};case"fitHeight":return{height:f,maxWidth:d,...l?{width:d}:{}};case"fill":return{height:f,width:d};default:return{width:d,height:p}}},hG=e=>{if("alwaysFit"===e)return"contain"},mG=({suffix:e,delimeter:t})=>` ${e?t:""} ${e}`.trim(),gG=({imageSize:e,resolvedImagePosition:t,isImagesInIndentModeEnabled:r,isMeasureCell:n})=>({width:dG(e,r,n),height:cG(e),objectFit:hG(e),objectPosition:pG(e,t),...r&&"alwaysFit"===e?{"max-width":"100%"}:{}}),vG=({representation:e,textStyle:t,isMeasureCell:r})=>{const{imageRef:n,onLoad:o}=(()=>{const{downloadService:e}=u$(),t=l(null),{promise:r,resolve:n}=v(()=>hz(),[]);return d(()=>(e.isDownloadedAsPDForImage&&(e.waitForPromise(r),t.current?.complete&&n()),()=>{n()}),[t,e,r,n]),{onLoad:f(()=>{n()},[n]),imageRef:t}})(),{layoutService:{isIndentModeEnabled:i}}=u$(),{url:a,text:s,imageSize:u,resolvedImagePosition:c}=e,{overflow:p,...h}=t;return ii.jsx("img",{src:a,alt:s,style:{...gG({imageSize:u,resolvedImagePosition:c,isImagesInIndentModeEnabled:i,isMeasureCell:r}),...h},onLoad:o,ref:n})},yG=({representation:e,textStyle:t,canExpandOrCollapse:r,leafCount:n,isLeftColumn:o=!1,imageContainerHorizontalAlignment:i,isMeasureCell:a})=>{const{styleService:s,layoutService:l}=u$(),{resolvedImagePosition:u}=e;return ii.jsx("div",{"data-key":"image-container--image",style:{display:"flex",flexDirection:"column",justifyContent:u?.vertical,alignItems:i,overflow:"hidden",boxSizing:"border-box",border:"4px solid transparent",...fG({representation:e,canExpandOrCollapse:r,leafCount:n,styleService:s,layoutService:l,isLeftColumn:o,isMeasureCell:a})},children:ii.jsx(vG,{representation:e,textStyle:t,isMeasureCell:!0})})},bG={display:"flex",flexDirection:"row",alignItems:"center"},xG={alignItems:"center",display:"flex",flexDirection:"row",backgroundClip:"padding-box"},SG=(e,t,r,n)=>t?{...xG,...e.nullValues}:r?{...bG,color:e.totalValues.color,background:n??e.totalValues.background}:{...bG,color:e.measureValues.color,background:n??e.measureValues.background},wG=(e,t,r,n,o)=>{const{fontFamily:i,fontSize:a}=e.measureValues,s={...ez,...!r&&tz(e.grid.lineClamp),...t&&{color:t},fontFamily:i,fontSize:a};if(o){const{fontWeight:t,fontStyle:r,textDecoration:n}=e.nullValues;return{...s,fontWeight:t,fontStyle:r,textDecoration:n}}if(n){const{fontWeight:t,fontStyle:r,textDecoration:n}=e.totalValues;return{...s,fontWeight:t,fontStyle:r,textDecoration:n}}const{fontWeight:l,fontStyle:u,textDecoration:c}=e.measureValues;return{...s,fontWeight:void 0===l?GF:l,fontStyle:u,textDecoration:c}},CG=({cell:e,representation:t,color:r,isTotalValueCell:n,cellHorizontalAlignment:o})=>{const{layoutService:i,styleService:a}=u$(),{isIndentModeEnabled:s}=i,l=e.isNull?i.getNullValueText():t.text,u=t.type===uF.Image,c=t.type===uF.Indicator,d=cB(dB(l)),p=wG(a,r,d,n,e.isNull);if(!s&&u&&!e.isNull||s&&u&&!e.isNull)return ii.jsx(yG,{isMeasureCell:!0,textStyle:p,representation:t,imageContainerHorizontalAlignment:o});const f=dB(e.isNull?t.text:e.ref.qNum);return c&&cB(f)?ii.jsx(jB,{representation:t,cellValue:f,textStyle:p}):ii.jsx("span",{style:{padding:4,direction:d?"ltr":void 0,...p},children:l})},EG=(e,t)=>e?.[t]?.visibleMeasureInfoIndex??0,IG="flex-start",DG=(e,t)=>e.isNull?IG:t.type===uF.Image&&"fill"!==t.imageSize?t.resolvedImagePosition?.vertical:IG,PG=({columnIndex:e,rowIndex:t,style:r,data:n})=>{const{env:o}=a$(),{pageInfo:i,direction:a}=n$(),{styleService:s,layoutService:l}=u$(),{attrExprInfoIndexes:u,gridSectionsData:{measureData:c,leftDimensionData:d,topDimensionData:p},visibleDimensionsInfo:{visibleLeftDimensionInfo:h,visibleTopDimensionInfo:m}}=kH(),g=(()=>{const{layoutService:{isIndentModeEnabled:e}}=u$(),{gridSectionsData:{leftDimensionData:t,topDimensionData:r},visibleDimensionsInfo:{visibleLeftDimensionInfo:n,visibleTopDimensionInfo:o}}=kH(),i=n.length,a=o.length;return f((n,o)=>!(!r.grid.at(a-1)?.[n]?.isTotal&&!t.grid.at(e?0:i-1)?.[o]?.isTotal),[r,t,i,a,e])})(),v=(()=>{const{gridSectionsData:{topDimensionData:e},visibleDimensionsInfo:{visibleTopDimensionInfo:t}}=kH(),r=t.length;return f(t=>{const n=e.grid.at(r-1)?.[t];return aB(n,e.totalDividerIndex)},[e,r])})(),y=(()=>{const{layoutService:{isIndentModeEnabled:e}}=u$(),{gridSectionsData:{leftDimensionData:t},visibleDimensionsInfo:{visibleLeftDimensionInfo:r}}=kH(),n=r.length;return f(r=>{const o=e?0:n-1,i=t.grid.at(o)?.[r];return aB(i,t.totalDividerIndex,e)},[t,e,n])})(),{showLastBorder:b}=n,x=p.grid.at(m.length-1),S=d.grid.at(h.length-1),{background:w}=s.measureValues,C=c[t]?.[e],E=t===i.rowsOnCurrentPage-1,I=e===l.size.x-1;if(!C)return ii.jsx(sB,{style:{...r,background:w},isLastRow:E,isLastColumn:I,showLastBorder:b,index:t,isLeftColumn:!1,showTotalCellDivider:!1});const D=l.hasPseudoDimOnLeft?EG(S,t):EG(x,e),P=l.visibleMeasureInfo[D],R=cH({cell:C.ref,representationProperties:P.representation,attrExprInfoIndex:u.measures[D],env:o,direction:a,conditionalColoring:P.conditionalColoring,enabledFeatures:{[uF.Image]:!0,[uF.Indicator]:!0}}),M=!C.isNull&&g(e,t),L=C.isNull?l.getNullValueText():R.text,A=!C.isNull||!Number.isNaN(+L),k=dH(u.measures[D],C.ref),O=((e,t,r,n,o)=>{const{textAlign:i}=t,a=n?"flex-end":"center";return e.isNull||r.type!==uF.Image?FB(i,a,o):r.resolvedImagePosition?.horizontal??"center"})(C,P,R,A,a),q={...SG(s,C.isNull,M,k.background),...nz(E,I,s.grid.border,a,b),...iz({bottomDivider:y(t),rightDivider:v(e),borderColor:s.grid.divider}),...QF,padding:"0px 4px",display:"flex",justifyContent:O};return ii.jsx("div",{className:vT,title:L,style:{...q,...r},"data-testid":"measure-value","data-row-index":t,"data-col-index":e,children:ii.jsx(lB,{width:uB(R),verticalAlign:DG(C,R),children:ii.jsx(CG,{cell:C,representation:R,isTotalValueCell:M,color:k.color,cellHorizontalAlignment:O})})})};var RG=r.memo(PG,BV);const MG=(e,t)=>t.list[e]?.id??e.toString(),LG=({columnIndex:e,rowIndex:t,data:r})=>r.grid[t]?.[e]?.id??`${t}-${e}`,AG=e=>({...ZF,overflow:"hidden",boxSizing:"content-box",borderWidth:"rtl"===e?"1px 1px 0px 0px":"1px 0px 0px 1px"}),kG=({dataGridRef:e,height:t,rowHightCallback:r,width:n,showLastBorder:o,getRightGridColumnWidth:i,verticalScrollDirection:a,horizontalScrollDirection:s})=>{const{pageInfo:l,direction:u}=n$(),{layoutService:c,styleService:{grid:{divider:d},contentCellHeight:p}}=u$(),{dataModel:h,gridSectionsData:{measureData:m}}=kH(),v={...AG(u),borderColor:d,willChange:"auto",userSelect:"none",WebkitUserSelect:"none"},y=(({verticalScrollDirection:e,horizontalScrollDirection:t})=>{const{pageInfo:r}=n$(),{downloadService:n,viewService:o,layoutService:i}=u$(),{dataModel:a,gridSectionsData:{leftDimensionData:s,topDimensionData:l,measureData:u}}=kH(),c=s.columnCount,d=l.rowCount;return f(async({overscanColumnStartIndex:s,overscanColumnStopIndex:l,overscanRowStartIndex:p,overscanRowStopIndex:f})=>{o.gridColumnStartIndex=s,o.gridRowStartIndex=p,o.gridWidth=l-s+1,o.gridHeight=f-p+1;const h=o.gridWidth+c+(t.current===bF.None?0:GV),m=o.gridHeight+d+(e.current===bF.None?0:GV);let g=oB;m*h>1500&&(g=iB),g(a,i,u,r,o,e,t,n)},[o,i,a,u,e,t,r,c,d,n])})({verticalScrollDirection:a,horizontalScrollDirection:s});return Az(()=>{e.current&&e.current.resetAfterColumnIndex(0,!1)},[e,h,m]),g(()=>{e.current&&e.current.resetAfterIndices({columnIndex:0,rowIndex:0,shouldForceUpdate:!0})},[n,t,e,p,u]),0===c.size.x?null:ii.jsx(OV,{"data-section-id":"DATA_GRID",ref:e,style:v,columnCount:c.size.x,columnWidth:i,height:t,rowCount:l.rowsOnCurrentPage,rowHeight:r,width:n,itemData:{showLastBorder:o,grid:m},onItemsRendered:y,estimatedRowHeight:r(),estimatedColumnWidth:i(),itemKey:LG,direction:u,children:RG})};var OG=b(kG);const qG=x((e,t)=>ii.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:[ii.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"}),ii.jsx("use",{fillRule:"evenodd"})]})),TG=e=>{const[t,r]=m(!1);return Az(()=>{r(!1)},e),{isAdjustingWidth:t,setIsAdjustingWidth:r}},NG=()=>{const[e,t]=m(!1),{dataModel:r}=kH(),{interactions:n}=a$(),{isAdjustingWidth:o,setIsAdjustingWidth:i}=TG([r]);return{open:e,setOpen:t,handleOpenMenu:e=>{!n.active||$B(e)||o||t(!0)},setIsAdjustingWidth:i}};function _G(e,t){const r=t.expressionColor?.background??e.dimensionValues.background,n=t.isLeftColumn?e.header.background:r,o=n===KF.Transparent?LF.WHITE:n,i=D_(e.grid.border),a=D_(o);return a.isInvalid()||i.isInvalid()||1===i.a?e.grid.border:function(e,t,r){return D_(e.r+(t.r-e.r)*r,e.g+(t.g-e.g)*r,e.b+(t.b-e.b)*r,e.a+(t.a-e.a)*r)}(a,i,i.a).getRGB()}const jG=({cellInfo:e,columnWidth:t,isLastColumn:r,overrideLeftGridWidth:n,setIsAdjustingWidth:o,shouldApplyIndentModeColumnWidth:i,tableWidth:a})=>{const{direction:s}=n$(),{interactions:l,translator:u}=a$(),{isActive:c}=YB(),{dataModel:d}=kH(),{styleService:p}=u$(),[,f]=m({});if(!(e.canBeResized&&!!l.active&&!c))return null;const h=_G(p,e);return ii.jsx(_z,{isPivot:!0,columnWidth:t,isLastColumn:r,keyValue:`adjuster-${e.dimensionInfoIndex}`,hoverColor:h,updateWidthCallback:t=>{f({}),n&&void 0!==e.colIdx&&n(t,e.colIdx)},confirmWidthCallback:t=>{i?d.applyIndentModeColumnWidth({...t,pixels:Math.min((a??0)*NH,t.pixels??0)}):d.applyColumnWidth(t,e)},setIsAdjustingWidth:o,isLeftColumn:e.isLeftColumn,accessibilityRelatedArgs:{translator:u,columnLabel:e.label??""},direction:s})},FG=fl(Qu,{shouldForwardProp:e=>!["interactions","hoverBackground","background","shouldShowMenuIcon","isDimension"].includes(e)})(({interactions:e,background:t,hoverBackground:r,shouldShowMenuIcon:n,isDimension:o})=>({pointerEvents:o?"all":"none",position:"relative",display:"grid",gridTemplateColumns:n?"1fr 12px":"1fr",gap:8,alignItems:"center",cursor:e.active?"pointer":"default",background:t,"&&:hover":{background:e.active&&o?r:t}})),zG=fl("div",{shouldForwardProp:e=>!["direction"].includes(e)})(({direction:e})=>({position:"absolute",left:"rtl"!==e?0:void 0,bottom:0})),WG=fl("div",{shouldForwardProp:e=>"justifyContent"!==e})(({justifyContent:e})=>({...JF,justifyContent:e??JF.justifyContent,flexDirection:"row",overflow:"hidden",position:"relative",gap:8})),$G=fl("div")(()=>({...JF})),HG=fl("div",{shouldForwardProp:e=>!["fontSize","fontFamily","fontWeight","fontStyle","textDecoration","justifyContent"].includes(e)})(({fontSize:e,fontFamily:t,fontWeight:r,fontStyle:n,textDecoration:o,justifyContent:i})=>({display:"flex",justifyContent:i,alignSelf:"center",flexGrow:1,maxWidth:"100%",fontWeight:r,fontSize:e,fontFamily:t,fontStyle:n,textDecoration:o})),VG=fl(hp)(({theme:e})=>({".MuiList-root":{padding:e.spacing(.5,0)}})),BG=fl(bp,{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}}})),GG=fl("span")({textOverflow:"ellipsis",overflow:"hidden"}),UG=fl("div",{shouldForwardProp:e=>"visible"!==e})(({visible:e})=>({opacity:e?1:0,width:qH,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"})),YG=fl("span",{shouldForwardProp:e=>!["padding","alignSelf"].includes(e)})(({padding:e,alignSelf:t})=>({padding:e,alignSelf:t,position:"sticky",top:0}));let KG=function(e){return e.Expand="Expand",e.Collapse="Collapse",e}({});const XG=(e,t)=>({qExcludeList:t===KG.Expand,qPos:{qDimName:e,qElemNo:[]}}),JG=`${p$}/qExpansionState`,ZG=({model:e,qExpansionState:t,qEffectiveDimensionName:r,action:n})=>async()=>{const o=(({qEffectiveDimensionName:e,oldExpansionState:t,action:r})=>{const n=t?.findIndex(t=>t.qPos?.qDimName===e);return{expansionData:XG(e,r),index:n}})({qEffectiveDimensionName:r,oldExpansionState:t,action:n});await(async({model:e,newExpansionState:t,errorMsg:r})=>{const{index:n,expansionData:o}=t;try{let t,r=JG,i="Add";void 0===n?t=JSON.stringify([o]):-1===n?(r=`${JG}/-`,t=JSON.stringify(o)):(r=`${JG}/${n}`,i="Replace",t=JSON.stringify(o)),await e.applyPatches([{qPath:r,qOp:i,qValue:t}],!0)}catch(e){console.error(r,e)}})({model:e,newExpansionState:o,errorMsg:`Failed to ${n} dimension`})},QG=({model:e,effectivePropertiesService:t,cell:r})=>{if(void 0===r.qEffectiveDimensionName)return;const n={model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:r.qEffectiveDimensionName};return{expandCallback:ZG({...n,action:KG.Expand}),collapseCallback:ZG({...n,action:KG.Collapse}),alwaysFullyExpanded:t.qAlwaysFullyExpanded}},eU={[wW.Sorting]:!0,[wW.Selections]:!0,[wW.Searching]:!0},tU=({cell:e,style:t,isFirstColumn:r,isLastColumn:n,isLastRow:o,changeSortOrder:i,iconsVisibilityStatus:a,columnWidth:s,overrideLeftGridWidth:u,shouldApplyIndentModeColumnWidth:c,tableWidth:d})=>{const p=l(null),{styleService:f,layoutService:h,effectivePropertiesService:m}=u$(),{app:g,interactions:v,embed:y,translator:b,model:x}=a$(),{fontSize:S,fontFamily:w,fontStyle:C,fontWeight:E,textDecoration:I,color:D,background:P,hoverBackground:R,activeBackground:M}=f.header,L=l(null),{shouldShowLockIcon:A,shouldShowMenuIcon:k}=a,{open:O,setOpen:q,handleOpenMenu:T,setIsAdjustingWidth:N}=NG(),{direction:_}=n$(),j={sortFromMenu:async(t,r)=>{t.stopPropagation(),await i(e,r)}},F={embed:y,listboxRef:p,sortCriteria:h.searchSortFromDimension&&e.isDim?m.getSortCriteriaForDimension(e.dimensionInfoIndex):void 0},z={app:g,qStateName:h.layout.qStateName},{labelTextAlign:W}=h.getDimensionInfo(e.dimensionInfoIndex)??{},$=FB(W,"flex-start",_);return ii.jsxs(FG,{className:vT,title:e.label,interactions:v,background:O?M:P,hoverBackground:R,shouldShowMenuIcon:k,isDimension:e.isDim,style:{...t,...QF,...oz(e,o,r,n,f.grid.border,_),color:D},"data-testid":"title-cell",onClick:T,children:[ii.jsxs(WG,{children:[A?ii.jsx($G,{children:ii.jsx(qG,{height:12})}):null,ii.jsx(HG,{fontFamily:w,fontSize:S,fontStyle:C,fontWeight:E,textDecoration:I,justifyContent:$,children:ii.jsx("span",{style:ez,children:e.label})})]}),e.isDim?ii.jsxs(ii.Fragment,{children:[ii.jsx(IW,{headerData:e,translator:b,anchorRef:L,open:O,setOpen:q,interactions:v,menuAvailabilityFlags:eU,sortRelatedArgs:j,searchRelatedArgs:F,selectionRelatedArgs:z,expandOrCollapseArgs:QG({model:x,effectivePropertiesService:m,cell:e}),shouldShowMenuIcon:k,model:x&&"setActiveField"in x?x:void 0,direction:_,isAccessibleHeader:!0}),ii.jsx(zG,{ref:p,direction:_}),ii.jsx(zG,{ref:L,direction:_})]}):null,ii.jsx(jG,{cellInfo:{...e,isLeftColumn:!0},columnWidth:s,isLastColumn:n,overrideLeftGridWidth:u,setIsAdjustingWidth:N,shouldApplyIndentModeColumnWidth:c,tableWidth:d})]})},rU=({rowSpan:e,columnSpan:t})=>{const{styleService:r}=u$(),{direction:n}=n$();return e>0&&t>0?ii.jsx("div",{style:{...ZF,gridRowStart:1,gridRowEnd:`span ${e}`,gridColumnStart:1,gridColumnEnd:`span ${t}`,borderWidth:"rtl"===n?"0px 0px 0px 1px":"0px 1px 0px 0px",borderColor:r.grid.border,background:r.grid.background},"data-testid":"empty-header-cell"}):null},nU=x((e,t)=>ii.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:ii.jsx("path",{d:"m8 9 4.5-4.5L14 6l-4.5 4.5L8 12 2 6l1.5-1.5z"})})),oU=x((e,t)=>ii.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:[ii.jsx("path",{d:"m8 7-4.5 4.5L2 10l6-6 6 6-1.5 1.5z"}),ii.jsx("use",{fillRule:"evenodd"})]})),iU=({tableWidth:e,leftGridWidth:t,overrideLeftGridWidth:r})=>{const{direction:n}=n$(),{styleService:o}=u$(),{interactions:i,translator:a}=a$(),{isActive:s}=YB(),{dataModel:l}=kH(),{setIsAdjustingWidth:u}=TG([l]);if(!(!!i.active&&!s))return null;const c=_G(o,{isLeftColumn:!0});return ii.jsx(_z,{isPivot:!0,isLastColumn:!0,isLeftColumn:!0,keyValue:"adjuster-indent-row",hoverColor:c,columnWidth:t,updateWidthCallback:t=>{r(Math.min(t,e*NH))},confirmWidthCallback:n=>{if(n.type===ST.FitToContent)return void l.applyIndentModeColumnWidth({type:ST.Auto});const o=Math.min(n.pixels??t,e*NH);r(o),l.applyIndentModeColumnWidth({type:ST.Pixels,pixels:o})},setIsAdjustingWidth:u,accessibilityRelatedArgs:{translator:a,columnLabel:a.get("SNPivotTable.IndentMode.Rows")},direction:n})},aU=x((e,t)=>ii.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:ii.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"})})),sU=({cell:e,changeSortOrder:t})=>{const r=l(null),n=l(null),{app:o,interactions:i,embed:a,translator:s,model:u}=a$(),{layoutService:c,effectivePropertiesService:d}=u$(),{open:p,setOpen:f,handleOpenMenu:h}=NG();return ii.jsxs(BG,{onClick:h,isActive:p,children:[ii.jsx(GG,{children:e.label}),ii.jsxs(UG,{className:"indent-mode-dropdown-more",visible:p,children:[ii.jsx(aU,{}),e.isDim?ii.jsxs(ii.Fragment,{children:[ii.jsx(IW,{headerData:e,translator:s,anchorRef:r,open:p,setOpen:f,interactions:i,menuAvailabilityFlags:eU,sortRelatedArgs:{sortFromMenu:async(r,n)=>{r.stopPropagation(),await t(e,n)}},searchRelatedArgs:{embed:a,listboxRef:n},selectionRelatedArgs:{app:o,qStateName:c.layout.qStateName},expandOrCollapseArgs:QG({model:u,effectivePropertiesService:d,cell:e}),shouldShowMenuIcon:!1,model:u&&"setActiveField"in u?u:void 0}),ii.jsx(zG,{ref:n}),ii.jsx(zG,{ref:r})]}):null]})]})},lU=({idx:e,menu:t,menuItems:r,isOnlyOneRow:n})=>{const o=r.at(-1)?.id===h$,i=e+1<r.length&&r[e+1]?.id===h$;return!(n&&o&&i)&&(t?.id!==h$&&e<r.length-1)},uU=({menuItems:e,changeSortOrder:t,overrideLeftGridWidth:r,leftGridWidth:n,tableWidth:o})=>{const{styleService:i}=u$(),{interactions:a,translator:s}=a$(),{dataModel:u,gridSectionsData:{headersData:c}}=kH(),[d,p]=m(!1),f=l(null),{headerCellHeight:h}=i,{color:g,background:v,hoverBackground:y,activeBackground:b,fontFamily:x,fontSize:S,fontStyle:w,fontWeight:C,textDecoration:E}=i.header,{isAdjustingWidth:I}=TG([u]),D=e=>{e.stopPropagation()},P={height:h,gridColumn:`1 / span ${c.size.x}`,gridRow:c.size.y,zIndex:c.size.x-0};return ii.jsxs(FG,{isDimension:!0,background:d?b:v,interactions:a,hoverBackground:y,style:{...P,...QF,color:g},onClick:e=>{!a.active||$B(e)||I||p(!d)},"data-testid":"indentModeHeaderCellWrapper",children:[ii.jsxs(WG,{justifyContent:"flex-start",children:[ii.jsx(HG,{fontFamily:x,fontSize:S,fontStyle:w,fontWeight:C,textDecoration:E,justifyContent:"flex-start",children:ii.jsx("span",{style:ez,children:s.get("SNPivotTable.IndentMode.Rows")})}),d?ii.jsx(oU,{}):ii.jsx(nU,{}),ii.jsx(zG,{ref:f})]}),ii.jsx(VG,{open:d,anchorEl:f.current,disableEnforceFocus:!0,children:e.map((r,n)=>[r&&r.id!==h$&&ii.jsx("li",{role:"presentation",onClick:D,onKeyDown:D,children:ii.jsx(sU,{cell:r,changeSortOrder:t})}),lU({idx:n,menu:r,menuItems:e,isOnlyOneRow:1===c.size.y})&&ii.jsx($z,{"data-testid":"group-divider",variant:"middle"})])}),ii.jsx(iU,{tableWidth:o,leftGridWidth:n,overrideLeftGridWidth:r})]})},cU=({layoutService:e,headersData:t,topRowIndex:r})=>e.isIndentModeEnabled&&t.size.x>1&&r+1===t.size.y,dU={display:"grid",width:"fit-content"},pU=({tableWidth:e,leftGridWidth:t,columnWidths:r,rowHight:n,changeSortOrder:o,getHeaderCellsIconsVisibilityStatus:i,height:a,overrideLeftGridWidth:s})=>{const{layoutService:l}=u$(),{gridSectionsData:{headersData:u}}=kH();return ii.jsxs("div",{"data-testid":"HEADER_GRID",style:{...dU,gridTemplateColumns:r.map(e=>`${e}px`).join(" "),gridTemplateRows:u.data.map(()=>`${n}px`).join(" "),height:a},children:[u.size.y>1&&ii.jsx(rU,{columnSpan:u.size.x-1,rowSpan:u.size.y-1}),u.data.map((a,c)=>{let d=[];if(cU({layoutService:l,headersData:u,topRowIndex:c})){const r=a.at(0);return Array.isArray(r)&&d.push(ii.jsx(uU,{menuItems:r,changeSortOrder:o,overrideLeftGridWidth:s,leftGridWidth:t,tableWidth:e},r.at(0)?.id)),d}return d=a.reduce((t,a,d)=>{if(a&&!Array.isArray(a)){const p=i(d,a.isLocked,a.label),f=l.isIndentModeEnabled&&1===u.size.x;t.push(ii.jsx(tU,{style:{width:r[d],height:n,gridColumn:l.isIndentModeEnabled&&u.size.x>1?2:d+1,gridRow:c+1,zIndex:u.size.x-d},isLastRow:c===u.size.y-1,isFirstColumn:0===d,isLastColumn:d===u.size.x-1,changeSortOrder:o,cell:a,iconsVisibilityStatus:p,columnWidth:r[d],overrideLeftGridWidth:s,shouldApplyIndentModeColumnWidth:f,tableWidth:e},a.id))}return t},[]),d})]})};var fU=b(pU);const hU=(e,t,r,n)=>{const{layoutService:o}=u$();g(()=>{e.current?.forEach(e=>e?.resetAfterIndex(0,!0))},[e,t,r,n,o])},mU=(e,t)=>{Az(()=>{e.current?.forEach(e=>e?.resetAfterIndex(0,!1))},[e,t])},gU=(e,t)=>{const{isLast:r,list:n,listValues:o}=t;return r?n[e]:o[e]},vU=()=>{},yU=({children:e,reactWindowStyle:t,cell:r,data:n,showTotalCellDivider:o,isLastRow:i,isLastColumn:a,isLeftColumn:s,isCellSelected:l,isAdjustingWidth:u,index:c})=>{const{styleService:d,layoutService:p}=u$(),{interactions:f}=a$(),{direction:h}=n$(),{isLocked:m,createMouseDownHandler:g,createMouseOverHandler:v,createPointerUpHandler:y}=YB(),{showLastBorder:b}=n,x=m(r)||r.isLockedByDimension,S=!(x||!f.active||!f.select||r.isEmpty||r.isNull||r.isPseudoDimension||r.isTotal||u),w=S?g(c,e=>gU(e,n)):void 0,C=S?v(c):void 0,E=S?y(c,e=>gU(e,n)):void 0,I=jH({isLeftColumn:s,layoutService:p,representation:r.representation});return ii.jsx("div",{className:vT,title:f.passive?r.representation.text:void 0,style:{...t,...nz(i,a,d.grid.border,h,b),...iz({bottomDivider:o&&s,rightDivider:o&&!s,borderColor:d.grid.divider}),...QF,padding:"rtl"===h?"0px 0px 0px 4px":"0px 4px",cursor:aG(S),background:tG({styleService:d,isCellSelected:l,cell:r,isCellLocked:x}),zIndex:s?void 0:p.size.x-r.x,justifyContent:WB(r,p,s,h,I),display:"flex",...p.isIndentModeEnabled&&s&&{["rtl"===h?"paddingRight":"paddingLeft"]:Math.max(4,24*(r.indentLevel??0))},textAlign:zB(r,p)},"aria-hidden":"true",onMouseDown:w,onMouseOver:C,onPointerUp:E,onKeyUp:vU,role:"button",tabIndex:-1,"data-testid":"dimension-cell","data-x":r.x,"data-page-x":r.pageX,"data-y":r.y,"data-page-y":r.pageY,"data-cell-type":r.ref.qType,"data-dimension-info-index":r.dimensionInfoIndex,children:e})},bU=e=>{e.stopPropagation()},xU=({href:e,text:t,interactions:r,color:n})=>({href:e,title:t,rel:"noreferrer",target:"_blank",underline:"hover",onClick:bU,color:LF.LINK,style:{pointerEvents:r.active?"auto":"none",color:n??void 0,opacity:r.active&&r.passive||n?void 0:.4}}),SU=({href:e,text:t,interactions:r,color:n})=>ii.jsx(bd,{...xU({href:e,text:t,interactions:r,color:n}),children:t}),wU=Y();wU.use(U),wU.renderer.prio(["canvas"]);const CU=(e,t)=>e&&"center"!==e&&"rtl"===t?NB(e):e,EU=({cell:e,representation:t,textStyle:r,imageContainerHorizontalAlignment:n})=>{const{imageBox:o}=t,{styleService:{grid:{lineClamp:i}}}=u$(),{direction:a}=n$();return ii.jsxs("div",{style:{display:"grid",gridTemplateColumns:`${o?.width??24}px 1fr`,maxHeight:"fit-content",alignItems:"center",justifyContent:"flex-start",boxSizing:"border-box"},children:[ii.jsx("div",{"data-key":"image-container--partial-image",style:{display:"flex",flexDirection:"column",justifyContent:JB(e),alignItems:CU(n,a),overflow:"hidden",boxSizing:"border-box",border:"4px solid transparent",width:o?.width??24,height:"100%"},children:ii.jsx(vG,{representation:t,textStyle:r})}),ii.jsx(YG,{padding:4/(i<=2?2:1),alignSelf:JB(e,!0),children:!!t.labelStructure&&mG(t.labelStructure)})]})},IU=({suffix:e,delimeter:t})=>` ${e?t:""} ${e}`,DU=({href:e,text:t,labelStructure:r,interactions:n,color:o})=>ii.jsxs("span",{children:[ii.jsx(bd,{...xU({href:e,text:t,interactions:n,color:o}),children:r?.maskedValue?r.maskedValue:r?.originalValue}),!!r&&IU(r)]}),PU=({children:e,textStyle:t,shouldEnableStickyText:r})=>ii.jsx("span",{style:{...t,border:"4px solid transparent",boxSizing:"border-box",...r&&{alignSelf:"flex-start",position:"sticky",top:0}},children:e}),RU=({isLeftColumn:e,styleService:t,cell:r,isIndentModeEnabled:n})=>e?n?t.grid.lineClamp:Math.max(t.grid.lineClamp,r.leafCount*t.grid.lineClamp):t.grid.columnLineClamp,MU=({cell:e,isCellSelected:t,isLeftColumn:r})=>{const{direction:n}=n$(),{isActive:o}=YB(),{layoutService:i,styleService:a}=u$(),{interactions:s}=a$(),l=r&&i.isIndentModeEnabled;let u=r&&!e.isNull?(e=>{const{representation:{text:t,labelStructure:r}}=e;if(!r||!r.originalValue)return t;const{originalValue:n,maskedValue:o,suffix:i,delimeter:a}=r;return`${0!==o.length?o:n} ${i?a:""} ${i}`.trim()})(e):e.representation.text;if(e.isEmpty)return null;const c=(({cell:e,styleService:t,isCellSelected:r,isLeftColumn:n,isIndentModeEnabled:o})=>({...ez,...tz(RU({cell:e,isLeftColumn:n,styleService:t,isIndentModeEnabled:o})),color:rG({cell:e,styleService:t,isCellSelected:r}),fontWeight:nG({cell:e,styleService:t}),fontStyle:oG({cell:e,styleService:t}),textDecoration:iG({cell:e,styleService:t}),fontFamily:t.dimensionValues.fontFamily,fontSize:t.dimensionValues.fontSize}))({cell:e,styleService:a,isCellSelected:t,isLeftColumn:r,isIndentModeEnabled:i.isIndentModeEnabled});if(e.representation.type===uF.Image&&!e.isTotal&&!e.isNull){const{labelStructure:t}=e.representation,o=r&&t&&t.suffix?EU:yG;return ii.jsx(o,{cell:e,representation:e.representation,leafCount:e.leafCount,textStyle:c,isLeftColumn:r,canExpandOrCollapse:e.ref.qCanCollapse||e.ref.qCanExpand,imageContainerHorizontalAlignment:WB(e,i,r,n)})}if(e.representation.type===uF.Link&&!o&&!e.isTotal){const t=r&&e.representation.labelStructure?DU:SU;u=ii.jsx(t,{text:e.representation.text,labelStructure:e.representation.labelStructure,href:e.representation.url,interactions:s,color:e.expressionColor.color})}return ii.jsx(PU,{shouldEnableStickyText:l,textStyle:{...c,...e.representation.type===uF.Image&&e.isNull?{alignSelf:JB(e)}:{}},children:u})},LU=({index:e,style:t,data:r})=>{const{styleService:n,layoutService:o}=u$(),{isSelected:i}=YB(),{isLeftColumn:a=!1,showLastBorder:s,itemCount:l,isLast:u,totalDividerIndex:c}=r,{isAdjustingWidth:d,setIsAdjustingWidth:p}=TG([r]),f=gU(e,r),h=a?e===l-1:u,m=a?u:e===l-1,g=aB(f,c,o.isIndentModeEnabled);if(void 0===f){const{background:r}=n.dimensionValues;return ii.jsx(sB,{style:{...t,background:r},index:e,isLastRow:h,isLastColumn:m,showLastBorder:s,isLeftColumn:a,showTotalCellDivider:g})}const v=i(f);return ii.jsxs(yU,{reactWindowStyle:t,isLeftColumn:a,isLastRow:h,isLastColumn:m,isCellSelected:v,showTotalCellDivider:g,cell:f,data:r,isAdjustingWidth:d,index:e,children:[ii.jsxs(lB,{verticalAlign:JB(f),width:uB(f.representation),right:f.isLeftColumn?void 0:4,isLeftColumn:a,children:[ii.jsx(uG,{isLeftColumn:a,isCellSelected:v,cell:f}),ii.jsx(MU,{isLeftColumn:a,isCellSelected:v,cell:f})]}),ii.jsx(jG,{cellInfo:{...f,columnWidthLocation:f.isPseudoDimension?gF.Measures:gF.Dimension},columnWidth:t.width,isLastColumn:m,setIsAdjustingWidth:p})]})};var AU=r.memo(LU,BV);const kU=({list:e,listValues:t,isLastRow:r,getRightGridColumnWidth:n})=>o=>{const i=r?e[o]:t.at(o);return i&&0===o&&i.x>0?(i.leafCount+i.x+i.distanceToNextCell)*n():!r&&i?(i.leafCount+i.distanceToNextCell)*n():n(i?.x??o)},OU=(e,t,r,n)=>{const o=Object.values(e);let i,a=o.length;return n&&(a=r,i=t/a),{itemCount:a,estimatedItemSize:i,listValues:o}},qU=(e,t)=>r=>{e.current&&(e.current[t]=r)},TU={display:"flex",height:"fit-content",borderWidth:"1px 0px 0px 0px",...ZF},NU={overflow:"hidden",willChange:"auto",flexShrink:0},_U=({leftGridRef:e,width:t,height:r,columnWidths:n,showLastBorder:o})=>{const{pageInfo:i,direction:a}=n$(),{layoutService:s,styleService:{contentCellHeight:l,grid:{divider:u}}}=u$(),{qSize:c}=s.layout.qHyperCube,{gridSectionsData:{leftDimensionData:d},visibleDimensionsInfo:{visibleLeftDimensionInfo:p}}=kH();mU(e,d),hU(e,t,r,l);const f=i.rowsOnCurrentPage*l,h={...TU,borderColor:u,width:n.reduce((e,t)=>e+t,0)};return ii.jsx("div",{style:h,"data-section-id":"LEFT_GRID",children:d.grid.map((t,u)=>{const h=u===d.columnCount-1,m=m$(p[u]),{itemCount:g,estimatedItemSize:v,listValues:y}=OU(t,f,i.rowsOnCurrentPage,h),b=s.isIndentModeEnabled?()=>l:((e,t,r,n,o)=>i=>{const a=n?e[i]:t.at(i);if(a&&0===i&&a.pageY>0)return(a.leafCount+a.pageY+a.distanceToNextCell)*r;if(a&&a.leafCount>0){const e=a.y===o-a.leafCount;return(a.leafCount-(e?a.ref.qUp:0)+a.distanceToNextCell)*r}return r})(t,y,l,h,c.qcy);return ii.jsx(WV,{ref:qU(e,u),style:{...NU,flexGrow:h?1:0,direction:a},height:r,width:n[u],itemCount:g,itemSize:b,layout:"vertical",itemData:{list:t,isLeftColumn:!0,isLast:h,itemCount:g,showLastBorder:o,listValues:y,totalDividerIndex:d.totalDividerIndex},itemKey:MG,estimatedItemSize:v,children:AU},m)})})};var jU=b(_U);const FU={overflow:"hidden",willChange:"auto"},zU=e=>({...ZF,borderWidth:"rtl"===e?"0px 1px 0px 0px":"0px 0px 0px 1px"}),WU=({topGridRef:e,rowHightCallback:t,width:r,height:n,showLastBorder:o,getRightGridColumnWidth:i})=>{const{direction:a}=n$(),{layoutService:s,styleService:{grid:{divider:l},headerCellHeight:u}}=u$(),{gridSectionsData:{headersData:c,topDimensionData:d}}=kH(),p={...zU(a),borderColor:l,height:n};mU(e,d),hU(e,r,n,u);const f=s.size.x*i();return 0===d.rowCount?ii.jsx("div",{style:{width:r,height:n,...zU(a)}}):ii.jsx("div",{style:p,"data-section-id":"TOP_GRID",children:d.grid.map((n,l)=>{const u=l===d.rowCount-1,{itemCount:p,estimatedItemSize:h,listValues:m}=OU(n,f,s.size.x,u),g=(({layoutService:e,headersData:t,topRowIndex:r})=>{const n=t.data.at(r);if(void 0===n)return;const o=t.size.x-1,i=cU({layoutService:e,headersData:t,topRowIndex:r})?0:o,a=n.at(i),s=Array.isArray(a)?a.at(o):a;return s?e.getDimensionInfo(s.dimensionInfoIndex):void 0})({layoutService:s,headersData:c,topRowIndex:l}),v=g?m$(g):`empty ${l}`;return ii.jsx(WV,{ref:qU(e,l),style:FU,height:t(),width:r,itemCount:p,itemSize:kU({list:n,listValues:m,isLastRow:u,getRightGridColumnWidth:i}),layout:"horizontal",itemData:{list:n,isLast:u,itemCount:p,showLastBorder:o,listValues:m,totalDividerIndex:d.totalDividerIndex},itemKey:MG,estimatedItemSize:h,direction:a,children:AU},v)})})};var $U=b(WU);const HU=()=>{const{styleService:{headerCellHeight:e,contentCellHeight:t}}=u$(),r=iV(),n=(()=>{const{model:e}=a$(),t=f(async(t,r)=>{if(!e)throw new Error("No Model provided!");const{qReverseSort:n,dimensionInfoIndex:o,sortDirection:i}=t,a=[];if(r===i)return!1;a.push({qPath:`/qHyperCubeDef/qDimensions/${o}/qDef/qReverseSort`,qOp:"Replace",qValue:(!n).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:o,topGridWrapperRef:i,leftGridWrapperRef:a,dataGridWrapperRef:s},gridRefs:{topGridRef:l,leftGridRef:u,dataGridRef:c},scrollDirectionRefs:{verticalScrollDirection:p,horizontalScrollDirection:h},scrollbarsDimensions:{verticalScrollbarWidth:m,horizontalScrollbarHeight:g,resetHorizontalScrollbarHeight:v}}=oV(),{leftGridWidth:y,leftGridFullWidth:b,leftGridColumnWidths:x,rightGridFullWidth:S,showLastRightBorder:w,getRightGridColumnWidth:C,getHeaderCellsIconsVisibilityStatus:E,overrideLeftGridWidth:I}=function({tableWidth:e,verticalScrollbarWidth:t,resetHorizontalScrollbarHeight:r}){const{layoutService:n,styleService:o}=u$(),{gridSectionsData:{headersData:i}}=kH(),{measureText:a}=Pz(o.header,{allowLineBreaks:!1}),s=XH({tableWidth:e}),l=JH({tableWidth:e,verticalScrollbarWidth:t,leftGridWidth:s.leftGridWidth}),u=s.leftGridWidth+l.rightGridFullWidth+1<e,c=f((e,t,r="")=>{let o=e;n.isIndentModeEnabled&&(o=1,1===i.size.x&&(o=0));const l=s.leftGridColumnWidths[o];let u=!1,c=!1,d=a(r)+TH;return t&&d+qH<=l&&(c=!0,d+=qH),d+qH<=l&&(u=!0),{shouldShowMenuIcon:u,shouldShowLockIcon:c}},[s.leftGridColumnWidths,a,n.isIndentModeEnabled,i.size.x]);return d(()=>{const e=s.leftGridWidth===s.leftGridFullWidth,t=l.rightGridWidth===l.rightGridFullWidth;e&&t&&r()},[r,s.leftGridWidth,s.leftGridFullWidth,l.rightGridWidth,l.rightGridFullWidth]),{...s,...l,showLastRightBorder:u,getHeaderCellsIconsVisibilityStatus:c}}({tableWidth:r.width,verticalScrollbarWidth:m,resetHorizontalScrollbarHeight:v}),{gridScaffoldDimensions:D,headerGridDims:P,topGridDims:R,leftGridDims:M,dataGridDims:L,metadata:{everyThingFitsInTableRectHeight:A,scrollbarsVisibilityStatus:k}}=(({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:r,leftGridOriginalWidth:n,rightGridOriginalWidth:o},scrollBarsDimensions:{verticalScrollbarWidth:i,horizontalScrollbarHeight:a}})=>{const s=iV(),{pageInfo:l}=n$(),{gridSectionsData:{headersData:u,topDimensionData:c}}=kH(),d=Math.min(s.height*NH,Math.max(s.height*NH-25,s.height-t-a)),p=s.width*NH,f=l.rowsOnCurrentPage*t,h=Math.max(u.size.y,c.rowCount,1),m=e*h,g=e*h,v=Math.min(p,r),y=s.width-p,b=Math.max(y,s.width-v),x=Math.min(d,m,g),{availableHeight:S,everyThingFitsInTableRectHeight:w,everyThingFitsInTableRectWidth:C}=((e,t,r)=>{const n=t+1+r+i<=s.width,o=e+1+f+a,l=o-s.height<a||o<=s.height;return{availableHeight:l?o:s.height,everyThingFitsInTableRectHeight:l,everyThingFitsInTableRectWidth:n}})(x,v,b),E=S-d,I=Math.max(E,S-x),D=Math.min(I,f),P=Math.min(I,f),R=m+1+f,{visibilityStatus:M,metadata:{hasLeftGridOverflowX:L,hasDataGridOverflowX:A}}=(e=>{const{gridScaffold:{X_AXIS:{leftSectionWidth:t,rightSectionWidth:r},Y_AXIS:{topSectionHeight:n,bottomSectionHeight:o}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:i,rightSectionFullWidth:a},Y_AXIS:{topSectionFullHeight:s,bottomSectionFullHeight:l}}}=e,u=s>n,c=i>t,d=a>r,p=l>o;return{visibilityStatus:{topGrid:{overflowX:"hidden",overflowY:u?"scroll":"hidden"},leftGrid:{overflowX:c?"scroll":"hidden",overflowY:"hidden"},dataGrid:{overflowX:d?"scroll":"hidden",overflowY:p?"scroll":"hidden"}},metadata:{hasTopGridOverflowY:u,hasLeftGridOverflowX:c,hasDataGridOverflowX:d,hasDataGridOverflowY:p}}})({gridScaffold:{X_AXIS:{leftSectionWidth:v,rightSectionWidth:b},Y_AXIS:{topSectionHeight:x,bottomSectionHeight:I}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:n,rightSectionFullWidth:o},Y_AXIS:{topSectionFullHeight:g,bottomSectionFullHeight:R-g}}});return{gridScaffoldDimensions:{width:s.width,height:s.height,gridTemplateColumns:`${v}px ${b}px`,gridTemplateRows:`${x}px ${I}px`},headerGridDims:{width:-1,height:x},topGridDims:{fullSizeWrapper:{width:o-i+(A?i:0),height:g},stickyWrapper:{width:b-1-i,height:-1},self:{width:Math.min(o,b)-(C?1:0)-i,height:g}},leftGridDims:{fullSizeWrapper:{width:v,height:R-g+(!L&&A?a:0)},stickyWrapper:{width:v,height:I-1-a},self:{width:v,height:Math.max(t,D-(w?0:a-1))}},dataGridDims:{fullSizeWrapper:{width:o-i+(A?i:0),height:R-g+(!A&&L?a:0)},stickyWrapper:{width:b-1-i,height:I-1-a},self:{width:Math.min(o,b)-(C?1:0)-i,height:Math.max(t,P-(w?0:a-1))}},metadata:{everyThingFitsInTableRectHeight:w,scrollbarsVisibilityStatus:M}}})({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:y,leftGridOriginalWidth:b,rightGridOriginalWidth:S},scrollBarsDimensions:{verticalScrollbarWidth:m,horizontalScrollbarHeight:g}}),O=f(()=>e,[e]),q=f(()=>t,[t]);return(()=>{const{downloadService:e}=u$();d(()=>{e.notifyIsDoneRendering()})})(),ii.jsxs(sV,{style:D,children:[ii.jsx("div",{style:{overflow:"hidden"},ref:o,children:ii.jsx(fU,{tableWidth:r.width,leftGridWidth:y,columnWidths:x,getHeaderCellsIconsVisibilityStatus:E,rowHight:e,height:P.height,changeSortOrder:n,overrideLeftGridWidth:I})}),ii.jsx(cV,{style:k.topGrid,origin:yF.TopGrid,ref:i,children:ii.jsx(aV,{style:R.fullSizeWrapper,children:ii.jsx(dV,{style:R.stickyWrapper,children:ii.jsx($U,{topGridRef:l,rowHightCallback:O,...R.self,showLastBorder:{right:w,bottom:!1},getRightGridColumnWidth:C})})})}),ii.jsx(cV,{style:k.leftGrid,origin:yF.LeftGrid,ref:a,children:ii.jsx(aV,{style:M.fullSizeWrapper,children:ii.jsx(dV,{style:M.stickyWrapper,children:ii.jsx(jU,{leftGridRef:u,...M.self,columnWidths:x,showLastBorder:{right:!1,bottom:A}})})})}),ii.jsx(cV,{style:k.dataGrid,origin:yF.DataGrid,ref:s,children:ii.jsx(aV,{style:L.fullSizeWrapper,children:ii.jsx(dV,{style:L.stickyWrapper,children:ii.jsx(OG,{dataGridRef:c,rowHightCallback:q,...L.self,showLastBorder:{right:w,bottom:A},getRightGridColumnWidth:C,verticalScrollDirection:p,horizontalScrollDirection:h})})})})]})},VU=()=>{const{keyboard:e,theme:t,interactions:r,translator:n}=a$(),{pageInfo:o,updatePageInfo:i,rect:a}=n$(),{layoutService:s}=u$(),{layout:l,hasData:u}=s;return ii.jsxs(ii.Fragment,{children:[u?ii.jsx(HU,{}):null,ii.jsx(d$,{}),ii.jsx(t$,{paginationNeeded:o.shouldShowPagination,handleChangePage:e=>{i({page:e})},pageInfo:o,totalRowCount:o.totalRowCount,totalColumnCount:0,totalPages:o.totalPages,keyboard:e,translator:n,theme:t,interactions:r,rect:a,layout:l})]})};const BU=(e,{selections:t,baseObjects:n,coreServices:o,nebulaObjects:i})=>{const a=function(e){const t=OS();return t?.components?.MuiTable?.styleOverrides&&(t.components.MuiTable.styleOverrides.root={}),Ls({...t,direction:e})}(n.direction);e.render(ii.jsx(r.StrictMode,{children:ii.jsx(ml,{theme:a,children:ii.jsx(s$,{...i,children:ii.jsx(o$,{...n,children:ii.jsx(KB,{selections:t,children:ii.jsx(c$,{...o,children:ii.jsx(OH,{children:ii.jsx(VU,{})})})})})})})}))};var GU=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}(GU||{}),UU=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}(UU||{}),YU=function(e){return e.Grid="grid",e.Divider="grid.divider",e.LabelName="label.name",e.LabelValue="label.value",e}(YU||{}),KU=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}(KU||{});const XU=e=>e?`${parseInt(e,10)}px`:void 0,JU=(e,t)=>{if(t){const r=e.getColorPickerColor(t);return"none"===r?KF.Transparent:r}},ZU=(e,t)=>+(parseInt(e,10)*YF*t+8).toFixed(2),QU=(e,t)=>void 0===e?t:e.some(e=>"bold"===e)?GF:"normal",eY=e=>e?.some(e=>"italic"===e)?"italic":"normal",tY=e=>e?.some(e=>"underline"===e)?"underline":"none",rY=document.createElement("textarea");function nY(e){rY.value=e,document.body.appendChild(rY),rY.select(),rY.setSelectionRange(0,rY.value.length),document.execCommand("copy"),document.body.removeChild(rY)}rY.style.position="absolute",rY.style.left="-9999px",rY.setAttribute("readonly","");function oY(e){T?.((t,r)=>{const n=r.target,o=n?.closest(`.${vT}`);o?.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(()=>{nY(t)}):nY(t))})(o)}}),e?.forEach(e=>{e(t,r,o)})})}const iY=({model:e,layoutService:t,effectivePropertiesService:r,translator:n})=>mz((o,i,a)=>{if(!e||r.qAlwaysFullyExpanded)return;const s=e,l=o.addItem({translation:"Object.PivotTable.ContextMenu.ExpandCollapse",tid:"expand-collapse-group",id:"expand-collapse-group"}),{qEffectiveDimensionName:u,label:c}=((e,t)=>{const r=((e,t)=>{const r=e?.getAttribute("data-dimension-info-index");if("string"==typeof r)return t.getDimensionInfo(+r)})(e,t);return"object"==typeof r?{qEffectiveDimensionName:r.qEffectiveDimensionName,label:r.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(p$,0,0,!0),await e.expandLeft(p$,0,0,!0)}catch(e){console.error("Failed to expand all",e)}}}))(s)),"string"==typeof u&&l.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:r,label:n,translator:o})=>({icon:"lui-icon lui-icon--plus",translation:o.get("SNPivotTable.ContextMenu.ExpandDimension",[n??""]),tid:"expand-dimension",id:"expand-dimension",select:ZG({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:r,action:KG.Expand})}))({model:s,effectivePropertiesService:r,qEffectiveDimensionName:u,label:c,translator:n})),l.addItem((e=>({icon:"lui-icon lui-icon--minus",translation:"Object.PivotTable.ContextMenu.CollapseAll",tid:"collapse-all",select:async()=>{try{await e.collapseTop(p$,0,0,!0),await e.collapseLeft(p$,0,0,!0)}catch(e){console.error("Failed to collapse all",e)}}}))(s)),"string"==typeof u&&l.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:r,label:n,translator:o})=>({icon:"lui-icon lui-icon--minus",translation:o.get("SNPivotTable.ContextMenu.CollapseDimension",[n??""]),tid:"collapse-dimension",id:"collapse-dimension",select:ZG({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:r,action:KG.Collapse})}))({model:s,effectivePropertiesService:r,qEffectiveDimensionName:u,label:c,translator:n}))},[e,t,r]),aY=(e,t)=>R(()=>(({layout:e})=>{const{qHyperCube:t,nullValueRepresentation:r,snapshotData:n}=e,{qNoOfLeftDims:o,qEffectiveInterColumnSortOrder:i,qMeasureInfo:a,qDimensionInfo:s}=t,l=!!n,u=n?.content?.rowsPerPage??15e3,c={x:Math.min(e.qHyperCube.qSize.qcx,UF),y:Math.min(e.qHyperCube.qSize.qcy,u)},d=i.slice(0,o),p=e=>d.some(t=>t===e),f=p(f$),h=new Map(i.map(e=>[s[e]??f$,e])),m=a.filter(e=>7005!==e.qError?.qErrorCode);return{layout:e,getNullValueText:()=>r?.text??"-",getMeasureInfoIndexFromCellIndex:(e,t=!1)=>{if(f)return 0;const r=e%m.length;return t?r:a.findIndex(e=>e===m[r])},getDimensionInfo:e=>e===f$?void 0:s.at(e),getDimensionInfoIndex:e=>h.get(e)??-1,size:c,isSnapshot:l,hasLimitedData:!l&&c.x<e.qHyperCube.qSize.qcx,hasData:c.x>0&&c.y>0,hasLeftDimensions:0!==e.qHyperCube.qNoOfLeftDims,hasPseudoDimOnLeft:f,leftDimensionInfoIndexes:d,isLeftDimension:p,triggerdByExpandOrCollapse:!!e.qHyperCube.qLastExpandedPos,visibleMeasureInfo:m,isIndentModeEnabled:Boolean(e.qHyperCube.qIndentMode),indentModeColumnWidth:e.qHyperCube.indentModeColumnWidth??{type:ST.Auto,pixels:xT.PixelsDefault,percentage:xT.PercentageDefault},searchSortFromDimension:"inherit"===e.search?.sorting}})({layout:e}),[e,t]),sY=({model:e,layoutService:t,viewService:r,pageInfo:n,rect:o})=>{const{layout:i,isSnapshot:a,triggerdByExpandOrCollapse:s}=t,l=(e=>{const t=vz(e);return t.current=e,t})(DH(o));return Cz(async()=>{const{qHyperCube:t}=i,{maxNumberOfVisibleRows:o,maxNumberOfVisibleColumns:u}=l.current;if(a)return i.snapshotData?.content?.qPivotDataPages??[];if(void 0!==e&&"getHyperCubePivotData"in e&&(((e,t,r,n)=>!!e&&(t.gridColumnStartIndex+t.gridWidth>=n||t.gridRowStartIndex+t.gridHeight>=r))(s,r,o,u)||((e,t,r,n)=>{const{qHyperCube:{qPivotDataPages:o,qSize:i}}=e,{qTop:a,qWidth:s,qHeight:l}=o[0]?.qArea??{qTop:0,qWidth:0,qHeight:0};return a<t.page*t.rowsPerPage||s<Math.min(n,i.qcx)||l<Math.min(r,i.qcy)})(i,n,o,u))){const t=((e,t,r,n,o,i)=>{const a=n.page*n.rowsPerPage,s=Math.min(a+n.rowsPerPage,r.qcy),l=Math.min(UF,r.qcx);if(r.qcy<a)return null;let u=0,c=a;if(e){u=t.gridColumnStartIndex,c=a+t.gridRowStartIndex;const e=c+t.gridHeight,r=t.gridColumnStartIndex+t.gridWidth;e>s&&(c=Math.max(0,s-o)),r>l&&(u=Math.max(0,l-i))}return{qLeft:u,qTop:c,qWidth:Math.min(l-u,i),qHeight:Math.min(s-c,o)}})(s,r,i.qHyperCube.qSize,n,o,u);return t?e.getHyperCubePivotData(p$,PH(t)):[]}return t.qPivotDataPages},[i,a,e,r,n.page,n.rowsPerPage,l,s])},lY=({rowsPerPage:e,totalRowCount:t,page:r})=>Math.min(e,t-r*e),uY=(e,t,r=15e3)=>({rowsPerPage:r,totalPages:Math.max(1,Math.ceil(e/r)),totalRowCount:e,rowsOnCurrentPage:lY({rowsPerPage:r,totalRowCount:e,page:t})}),cY=15,dY=({layoutService:e,viewService:t,rect:r,model:n,pageInfo:o})=>{const{freeResize:i}=M();return N(async e=>{const i=e;if(!i.snapshotData||!n||i.snapshotData.content)return i;if("getHyperCubePivotData"in n){const{scrollTop:e,scrollLeft:a,leftGridScrollLeft:s,topGridScrollTop:l}=t,u=((e,t,r)=>{const{gridColumnStartIndex:n,gridRowStartIndex:o,gridWidth:i,gridHeight:a}=e,s=t.page*t.rowsPerPage,l=Math.max(n-cY,0),u=Math.max(s+o-cY,s,0),c=UF-l,d=s+t.rowsOnCurrentPage-u;if((e=>0===e.gridWidth&&0===e.gridHeight)(e)){const{maxNumberOfVisibleColumns:e,maxNumberOfVisibleRows:t}=DH(r);return{qLeft:l,qTop:u,qWidth:Math.min(c,e+30),qHeight:Math.min(d,t+30)}}return{qLeft:l,qTop:u,qWidth:Math.min(c,i+30),qHeight:Math.min(d,a+30)}})(t,o,r),c=PH(u),d={qLeft:0,qTop:o.page*o.rowsPerPage,qWidth:1,qHeight:1};i.snapshotData.content={qPivotDataPages:await n.getHyperCubePivotData(p$,[d,...c]),scrollTop:e,scrollLeft:a,leftGridScrollLeft:s,topGridScrollTop:l,page:o.page,rowsPerPage:o.rowsPerPage},i.snapshotData.object.size.w=r.width,i.snapshotData.object.size.h=r.height}return i}),_(()=>({getViewState:()=>((e,t)=>({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,leftGridScrollLeft:e.leftGridScrollLeft,topGridScrollTop:e.topGridScrollTop,renderPage:t.page}))(t,o)}),[t]),e.layout.snapshotData?.content&&!i?{left:r.left,top:r.top,width:e.layout.snapshotData.object.size.w,height:e.layout.snapshotData.object.size.h}:r};var pY={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 fY=()=>{const e=j(),t=e.language();return R(()=>{!function(e){const t="SNPivotTable_LimitedData";e.get(t)===t&&Object.keys(pY).forEach(t=>{e.add(pY[t])})}(e)},[e]),{translator:e,language:t}},hY=e=>{const{flags:t}=e,r=F(),n=(e=>{const t=R(()=>Rz(e),[e]);return k(()=>()=>{t.unmount()},[t]),t})(r),o=z(),i=W(),a=$(),s=H(),l=V(),u=(()=>{const{viewState:e}=M(),t=vz(new Set),r=void 0!==window.qlikprinting,{promise:n,resolve:o}=R(()=>hz(),[]),i=mz(e=>{t.current.add(e)},[t]),a=mz(Bj(async()=>{await Promise.all(t.current),t.current.clear(),o()},1e3),[o,t]);return L(async()=>{await n},[n]),R(()=>({viewState:e,isDownloadedAsPDForImage:r,notifyIsDoneRendering:a,waitForPromise:i}),[a,r,e,i])})(),c=((e,t)=>{const[r]=Cz(async()=>{if(void 0!==e&&!t.snapshotData&&"getEffectiveProperties"in e)return{...await e.getEffectiveProperties()}},[e,t]);return R(()=>{const e=void 0!==r?.qHyperCubeDef.qSortbyYValue&&1===Math.abs(r.qHyperCubeDef.qSortbyYValue),t=r?.qHyperCubeDef.qDimensions.map(e=>e.qDef?.qSortCriterias)??[];return{qAlwaysFullyExpanded:r?.qHyperCubeDef.qAlwaysFullyExpanded??!1,qExpansionState:r?.qHyperCubeDef.qExpansionState,isSortedByFirstMeasure:e,getSortCriteriaForDimension:e=>t[e]}},[r])})(i,o),d=aY(o,t),p=(e=>{const t=q();return{...t,select:!!t.active&&!!t.select&&!e,active:!!t.active&&!e,scroll:!!t.active}})(d.isSnapshot),f=B(),h=wz(o,r),{translator:m,language:g}=fY(),{pageInfo:v,updatePageInfo:y}=((e,t)=>{const{size:r,layout:{qHyperCube:{qSize:n}}}=e,o=t.isDownloadedAsPDForImage||e.isSnapshot,i=(e=>e.layout.snapshotData?.content?.rowsPerPage)(e),[a,s]=A(()=>{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:n.qcy>r.y&&!o,...uY(n.qcy,a,i)}}),l=e.layout.qHyperCube.qSize.qcy;return k(()=>{s(t=>({...t,...uY(l,t.page,i),shouldShowPagination:l>e.size.y&&!o}))},[l,e.size.y,s,o,i]),k(()=>{const{page:e,totalPages:t}=a;if(e+1>t){const e=t-1,r=lY({...a,page:e});s({...a,page:e,rowsOnCurrentPage:r})}},[a]),{pageInfo:a,updatePageInfo:e=>{s({...a,...e,rowsOnCurrentPage:lY({...a,...e})})}}})(d,u),b=((e,t,r)=>R(()=>((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}})(r,t.snapshotData),[r,e.page,t.snapshotData]))(v,o,u),x=dY({rect:G(),layoutService:d,viewService:b,model:i,pageInfo:v}),[S,w]=sY({model:i,layoutService:d,viewService:b,pageInfo:v,rect:x}),C=R(()=>((e,t)=>{const r=t.layout.components?.find(e=>"theme"===e.key),n=r?.header,o=r?.dimensionValues,i=r?.measureValues,a=r?.measureLabels,s=r?.totalValues,l=r?.nullValues,u=r?.grid,c=(t,r,n)=>e.getStyle(t,r,n),d=+(u?.[GU.LineClamp]??c(UU.Grid,YU.Grid,KU.LineClamp)??1),p=+(u?.[GU.ColumnLineClamp]??c(UU.Grid,YU.Grid,KU.ColumnLineClamp)??1),f=JU(e,n?.[GU.Background])??c(UU.Dimension,YU.LabelName,KU.BackgroundColor)??KF.Transparent,h={header:{fontSize:XU(n?.[GU.FontSize])??c(UU.Dimension,YU.LabelName,KU.FontSize)??VF,fontFamily:n?.[GU.FontFamily]??c(UU.Dimension,YU.LabelName,KU.FontFamily)??BF,fontWeight:QU(n?.[GU.FontStyle],GF),fontStyle:eY(n?.[GU.FontStyle]),textDecoration:tY(n?.[GU.FontStyle]),color:JU(e,n?.[GU.FontColor])??c(UU.Dimension,YU.LabelName,KU.FontColor)??LF.TEXT,background:f,hoverBackground:OF(f,wT),activeBackground:OF(f,CT)},dimensionValues:{fontSize:XU(o?.[GU.FontSize])??c(UU.Dimension,YU.LabelValue,KU.FontSize)??VF,fontFamily:o?.[GU.FontFamily]??c(UU.Dimension,YU.LabelValue,KU.FontFamily)??BF,fontWeight:QU(o?.[GU.FontStyle],void 0),fontStyle:eY(o?.[GU.FontStyle]),textDecoration:tY(o?.[GU.FontStyle]),color:JU(e,o?.[GU.FontColor])??c(UU.Dimension,YU.LabelValue,KU.FontColor)??LF.TEXT,background:JU(e,o?.[GU.Background])??c(UU.Dimension,YU.LabelValue,KU.BackgroundColor)??KF.Transparent},measureValues:{fontSize:XU(i?.[GU.FontSize])??c(UU.Measure,YU.LabelValue,KU.FontSize)??VF,fontFamily:i?.[GU.FontFamily]??c(UU.Measure,YU.LabelValue,KU.FontFamily)??BF,fontWeight:QU(i?.[GU.FontStyle],"normal"),fontStyle:eY(i?.[GU.FontStyle]),textDecoration:tY(i?.[GU.FontStyle]),color:JU(e,i?.[GU.FontColor])??c(UU.Measure,YU.LabelValue,KU.FontColor)??KF.FontSecondary,background:JU(e,i?.[GU.Background])??c(UU.Measure,YU.LabelValue,KU.BackgroundColor)??KF.Transparent},measureLabels:{fontWeight:QU(a?.[GU.FontStyle],"normal"),fontStyle:eY(a?.[GU.FontStyle]),textDecoration:tY(a?.[GU.FontStyle]),color:JU(e,a?.[GU.FontColor])??c(UU.Measure,YU.LabelName,KU.FontColor)??KF.FontSecondary,background:JU(e,a?.[GU.Background])??c(UU.Measure,YU.LabelName,KU.BackgroundColor)??KF.Transparent},totalValues:{fontWeight:QU(s?.[GU.FontStyle],GF),fontStyle:eY(s?.[GU.FontStyle]),textDecoration:tY(s?.[GU.FontStyle]),color:JU(e,s?.[GU.FontColor])??c(UU.Total,YU.LabelValue,KU.FontColor)??LF.TEXT,background:JU(e,s?.[GU.Background])??c(UU.Total,YU.LabelValue,KU.BackgroundColor)??KF.Transparent},nullValues:{fontWeight:QU(l?.[GU.FontStyle],"normal"),fontStyle:eY(l?.[GU.FontStyle]),textDecoration:tY(l?.[GU.FontStyle]),color:JU(e,l?.[GU.FontColor])??c(UU.Null,YU.LabelValue,KU.FontColor)??LF.TEXT,background:JU(e,l?.[GU.Background])??c(UU.Null,YU.LabelValue,KU.BackgroundColor)??KF.NullValueBackground},grid:{columnLineClamp:p,lineClamp:d,border:JU(e,u?.[GU.Border])??c(UU.Grid,YU.Grid,KU.BorderColor)??KF.DividerLight,divider:JU(e,u?.[GU.Divider])??c(UU.Grid,YU.Divider,KU.BorderColor)??KF.DividerDark,background:JU(e,u?.[GU.Background])??c(UU.Grid,YU.Grid,KU.BackgroundColor)??KF.Transparent},selectedColors:kF(e)};return h.headerCellHeight=Math.max(ZU(h.header.fontSize,p),ZU(h.dimensionValues.fontSize,p),32),h.contentCellHeight=Math.max(ZU(h.measureValues.fontSize,d),ZU(h.dimensionValues.fontSize,d),24),h.dimensionValueTextHeight=ZU(h.dimensionValues.fontSize,1),h})(h,d),[h,d]),E=((e,t,r)=>{const[,n,o]=Cz(async()=>{const t=$_(r.flags),n=e.getStyle("","","fontFamily"),o=e.getStyle("object","label.name","fontFamily"),i=e.getStyle("object","label.value","fontFamily"),a=e.getStyle("","","fontFamilies")??[];return Promise.all([...t,...a,n,o,i,Lz].filter(e=>void 0!==e).map(async e=>{await document.fonts.load(`600 12px ${e}`),await document.fonts.load(`12px ${e}`)}))},[t,e,r]);return o?(console.warn("Failed to load fonts:",o),!0):!n})(h,o,e),{direction:I}=M();oY([iY({model:i,layoutService:d,effectivePropertiesService:c,translator:m})]),k(()=>{!w&&i&&!!S&&E&&BU(n,{selections:f,baseObjects:{rect:x,pageInfo:v,qPivotDataPages:S,updatePageInfo:y,direction:I},nebulaObjects:{env:e,app:a,model:i,embed:s,theme:h,keyboard:l,translator:m,interactions:p},coreServices:{styleService:C,viewService:b,layoutService:d,downloadService:u,effectivePropertiesService:c}})},[i,a,x,p,f,b,d,u,w,S,C,n,E,m,g,v,y,c,s,l,h,e,I])},mY={version:"7.15.0",qHyperCubeDef:{qAlwaysFullyExpanded:!1,qDimensions:[],qMeasures:[],qMode:"P",qSuppressMissing:!0,qSuppressZero:!1,qShowTotalsAbove:!0,qInitialDataFetch:[{qTop:0,qLeft:0,qWidth:50,qHeight:50}],qIndentMode:!1},showTitles:!0,title:"",subtitle:"",footnote:"",nullValueRepresentation:{text:"-"},components:[]},gY=()=>({...mY,qHyperCubeDef:{...mY.qHyperCubeDef,qIndentMode:!1}})}}});