@nebula.js/sn-table 6.65.0 → 6.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-specifications/properties.json +1 -1
- package/api-specifications/sn-table.json +5158 -0
- package/core/esm/index.js +2 -2
- package/dist/sn-table.js +3 -3
- package/dist/sn-table.systemjs.js +3 -3
- package/package.json +2 -2
- package/sn-table-ext/dist/sn-table.js +3 -3
- package/sn-table-ext/sn-table.qext +1 -1
package/dist/sn-table.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @nebula.js/sn-table v6.
|
|
2
|
+
* @nebula.js/sn-table v6.66.0
|
|
3
3
|
* Copyright (c) 2026 QlikTech International AB
|
|
4
4
|
* Released under the MIT license.
|
|
5
5
|
*/
|
|
@@ -136,6 +136,6 @@ function lo(e,t){let n;return n=t?Wi(e).withConfig({displayName:t.label,shouldFo
|
|
|
136
136
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
137
137
|
* See the License for the specific language governing permissions and
|
|
138
138
|
* limitations under the License.
|
|
139
|
-
*/var aB=(iB||(iB=1,function(e,t){var n;function r(e,t){var n=[],r=0;function i(e){return n.push(e),t}function o(){return n[r++]}return{tokenize:function(t){return t.replace(e,i)},detokenize:function(e){return e.replace(new RegExp("("+t+")","g"),o)}}}n=new function(){var e="`TMP`",t="`COMMENT`",n="[^\\u0020-\\u007e]",i="(?:[0-9]*\\.[0-9]+|[0-9]+)",o="(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)",a="direction\\s*:\\s*",s="['\"]?\\s*",l="(^|[^a-zA-Z])",c="\\/\\*\\!?\\s*@noflip\\s*\\*\\/",u="(?:(?:(?:\\\\[0-9a-f]{1,6})(?:\\r\\n|\\s)?)|\\\\[^\\r\\n\\f0-9a-f])",d="(?:[_a-z0-9-]|"+n+"|"+u+")",p=i+"(?:\\s*"+o+"|-?(?:[_a-z]|"+n+"|"+u+")"+d+"*)?",f="((?:-?"+p+")|(?:inherit|auto))",h="((?:-?"+p+")|(?:inherit|auto)|(?:calc\\((?:(?:(?:\\(|\\)|\\t| )|(?:-?"+i+"(?:\\s*"+o+")?)|(?:\\+|\\-|\\*|\\/)){3,})\\)))",m="(#?"+d+"+|(?:rgba?|hsla?)\\([ \\d.,%-]+\\))",g="(?:[!#$%&*-~]|"+n+"|"+u+")*?",y="(?![a-zA-Z])",b="(?!("+d+"|\\r?\\n|\\s|#|\\:|\\.|\\,|\\+|>|~|\\(|\\)|\\[|\\]|=|\\*=|~=|\\^=|'[^']*'|\"[^\"]*\"|"+t+")*?{)",v="(?!"+g+s+"\\))",x="(?="+g+s+"\\))",w="(\\s*(?:!important\\s*)?[;}])",S=/`TMP`/g,k=/`TMPLTR`/g,C=/`TMPRTL`/g,E=new RegExp("\\/\\*[^*]*\\*+([^\\/*][^*]*\\*+)*\\/","gi"),M=new RegExp("("+c+b+"[^;}]+;?)","gi"),R=new RegExp("("+c+"[^\\}]*?})","gi"),_=new RegExp("("+a+")ltr","gi"),A=new RegExp("("+a+")rtl","gi"),I=new RegExp(l+"(left)"+y+v+b,"gi"),P=new RegExp(l+"(right)"+y+v+b,"gi"),T=new RegExp(l+"(left)"+x,"gi"),D=new RegExp(l+"(right)"+x,"gi"),O=/(:dir\( *)ltr( *\))/g,N=/(:dir\( *)rtl( *\))/g,q=new RegExp(l+"(ltr)"+x,"gi"),L=new RegExp(l+"(rtl)"+x,"gi"),j=new RegExp(l+"([ns]?)e-resize","gi"),z=new RegExp(l+"([ns]?)w-resize","gi"),F=new RegExp("((?:margin|padding|border-width)\\s*:\\s*)"+h+"(\\s+)"+h+"(\\s+)"+h+"(\\s+)"+h+w,"gi"),$=new RegExp("((?:-color|border-style)\\s*:\\s*)"+m+"(\\s+)"+m+"(\\s+)"+m+"(\\s+)"+m+w,"gi"),B=new RegExp("(background(?:-position)?\\s*:\\s*(?:[^:;}\\s]+\\s+)*?)("+p+")","gi"),H=new RegExp("(background-position-x\\s*:\\s*)(-?"+i+"%)","gi"),V=new RegExp("(border-radius\\s*:\\s*)"+f+"(?:(?:\\s+"+f+")(?:\\s+"+f+")?(?:\\s+"+f+")?)?(?:(?:(?:\\s*\\/\\s*)"+f+")(?:\\s+"+f+")?(?:\\s+"+f+")?(?:\\s+"+f+")?)?"+w,"gi"),W=new RegExp("(box-shadow\\s*:\\s*(?:inset\\s*)?)"+f,"gi"),U=new RegExp("(text-shadow\\s*:\\s*)"+f+"(\\s*)"+m,"gi"),G=new RegExp("(text-shadow\\s*:\\s*)"+m+"(\\s*)"+f,"gi"),Y=new RegExp("(text-shadow\\s*:\\s*)"+f,"gi"),K=new RegExp("(transform\\s*:[^;}]*)(translateX\\s*\\(\\s*)"+f+"(\\s*\\))","gi"),X=new RegExp("(transform\\s*:[^;}]*)(translate\\s*\\(\\s*)"+f+"((?:\\s*,\\s*"+f+"){0,2}\\s*\\))","gi");function J(e,t,n){var r,i;return t.split("(").length>t.split(")").length?e:("%"===n.slice(-1)&&(-1!==(r=n.indexOf("."))?(i=n.length-r-2,n=(n=100-parseFloat(n)).toFixed(i)+"%"):n=100-parseFloat(n)+"%"),t+n)}function Q(e){switch(e.length){case 4:e=[e[1],e[0],e[3],e[2]];break;case 3:e=[e[1],e[0],e[1],e[2]];break;case 2:e=[e[1],e[0]];break;case 1:e=[e[0]]}return e.join(" ")}function Z(e,t){var n=[].slice.call(arguments),r=n.slice(2,6).filter(function(e){return e}),i=n.slice(6,10).filter(function(e){return e}),o=n[10]||"";return t+(i.length?Q(r)+" / "+Q(i):Q(r))+o}function ee(e){return 0===parseFloat(e)?e:"-"===e[0]?e.slice(1):"-"+e}function te(e,t,n){return t+ee(n)}function ne(e,t,n,r,i){return t+n+ee(r)+i}function re(e,t,n,r,i){return t+n+r+ee(i)}return{transform:function(n,i){var o=new r(M,"`NOFLIP_SINGLE`"),a=new r(R,"`NOFLIP_CLASS`"),s=new r(E,t);return n=s.tokenize(a.tokenize(o.tokenize(n.replace("`","%60")))),i.transformDirInUrl&&(n=n.replace(O,"$1`TMPLTR`$2").replace(N,"$1`TMPRTL`$2").replace(q,"$1"+e).replace(L,"$1ltr").replace(S,"rtl").replace(k,"ltr").replace(C,"rtl")),i.transformEdgeInUrl&&(n=n.replace(T,"$1"+e).replace(D,"$1left").replace(S,"right")),n=n.replace(_,"$1"+e).replace(A,"$1ltr").replace(S,"rtl").replace(I,"$1"+e).replace(P,"$1left").replace(S,"right").replace(j,"$1$2"+e).replace(z,"$1$2e-resize").replace(S,"w-resize").replace(V,Z).replace(W,te).replace(U,re).replace(G,re).replace(Y,te).replace(K,ne).replace(X,ne).replace(F,"$1$2$3$8$5$6$7$4$9").replace($,"$1$2$3$8$5$6$7$4$9").replace(B,J).replace(H,J),n=o.detokenize(a.detokenize(s.detokenize(n)))}}},e.exports?t.transform=function(e,t,r){var i;return"object"==typeof t?i=t:(i={},"boolean"==typeof t&&(i.transformDirInUrl=t),"boolean"==typeof r&&(i.transformEdgeInUrl=r)),n.transform(e,i)}:"undefined"!=typeof window&&(window.cssjanus=n)}(oB,oB.exports)),oB.exports),sB=Xe(aB),lB="comm",cB="rule",uB="decl",dB=Math.abs,pB=String.fromCharCode;function fB(e){return e.trim()}function hB(e,t,n){return e.replace(t,n)}function mB(e,t){return 0|e.charCodeAt(t)}function gB(e,t,n){return e.slice(t,n)}function yB(e){return e.length}function bB(e,t){return t.push(e),e}var vB=1,xB=1,wB=0,SB=0,kB=0,CB="";function EB(e,t,n,r,i,o,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:vB,column:xB,length:a,return:"",siblings:s}}function MB(){return kB=SB>0?mB(CB,--SB):0,xB--,10===kB&&(xB=1,vB--),kB}function RB(){return kB=SB<wB?mB(CB,SB++):0,xB++,10===kB&&(xB=1,vB++),kB}function _B(){return mB(CB,SB)}function AB(){return SB}function IB(e,t){return gB(CB,e,t)}function PB(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function TB(e){return fB(IB(SB-1,NB(91===e?e+2:40===e?e+1:e)))}function DB(e){for(;(kB=_B())&&kB<33;)RB();return PB(e)>2||PB(kB)>3?"":" "}function OB(e,t){for(;--t&&RB()&&!(kB<48||kB>102||kB>57&&kB<65||kB>70&&kB<97););return IB(e,AB()+(t<6&&32==_B()&&32==RB()))}function NB(e){for(;RB();)switch(kB){case e:return SB;case 34:case 39:34!==e&&39!==e&&NB(kB);break;case 40:41===e&&NB(e);break;case 92:RB()}return SB}function qB(e,t){for(;RB()&&e+kB!==57&&(e+kB!==84||47!==_B()););return"/*"+IB(t,SB-1)+"*"+pB(47===e?e:RB())}function LB(e){for(;!PB(_B());)RB();return IB(e,SB)}function jB(e){return function(e){return CB="",e}(zB("",null,null,null,[""],e=function(e){return vB=xB=1,wB=yB(CB=e),SB=0,[]}(e),0,[0],e))}function zB(e,t,n,r,i,o,a,s,l){for(var c=0,u=0,d=a,p=0,f=0,h=0,m=1,g=1,y=1,b=0,v=0,x="",w=i,S=o,k=r,C=x;g;)switch(h=v,v=RB()){case 40:108!=h&&58==mB(C,d-1)?(b++,C+="("):C+=TB(v);break;case 41:b--,C+=")";break;case 34:case 39:case 91:C+=TB(v);break;case 9:case 10:case 13:case 32:if(b>0){C+=pB(v);break}C+=DB(h);break;case 92:C+=OB(AB()-1,7);continue;case 47:switch(_B()){case 42:case 47:bB($B(qB(RB(),AB()),t,n,l),l),5!=PB(h||1)&&5!=PB(_B()||1)||!yB(C)||" "===gB(C,-1,void 0)||(C+=" ");break;default:C+="/"}break;case 123*m:s[c++]=yB(C)*y;case 125*m:case 59:case 0:if(b>0&&v){C+=pB(v);break}switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(C=hB(C,/\f/g,"")),f>0&&(yB(C)-d||0===m)&&bB(f>32?BB(C+";",r,n,d-1,l):BB(hB(C," ","")+";",r,n,d-2,l),l);break;case 59:C+=";";default:if(bB(k=FB(C,t,n,c,u,i,s,x,w=[],S=[],d,o),o),123===v)if(0===u)zB(C,t,k,k,w,o,d,s,S);else{switch(p){case 99:if(110===mB(C,3))break;case 108:if(97===mB(C,2))break;default:u=0;case 100:case 109:case 115:}u?zB(e,k,k,r&&bB(FB(e,k,k,0,0,i,s,x,i,w=[],d,S),S),i,S,d,s,r?w:S):zB(C,k,k,k,[""],S,0,s,S)}}c=u=f=0,m=y=1,x=C="",d=a;break;case 58:d=1+yB(C),f=h;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==MB())continue;switch(C+=pB(v),v*m){case 38:y=u>0?1:(C+="\f",-1);break;case 44:if(b>0)break;s[c++]=(yB(C)-1)*y,y=1;break;case 64:45===_B()&&(C+=TB(RB())),p=_B(),u=d=yB(x=C+=LB(AB())),v++;break;case 45:45===h&&2==yB(C)&&(m=0)}}return o}function FB(e,t,n,r,i,o,a,s,l,c,u,d){for(var p=i-1,f=0===i?o:[""],h=function(e){return e.length}(f),m=0,g=0,y=0;m<r;++m)for(var b=0,v=gB(e,p+1,p=dB(g=a[m])),x=e;b<h;++b)(x=fB(g>0?f[b]+" "+v:hB(v,/&\f/g,f[b])))&&(l[y++]=x);return EB(e,t,n,0===i?cB:s,l,c,u,d)}function $B(e,t,n,r){return EB(e,t,n,lB,pB(kB),gB(e,2,-2),0,r)}function BB(e,t,n,r,i){return EB(e,t,n,uB,gB(e,0,r),gB(e,r+1,-1),r,i)}function HB(e,t,n){switch(e.type){case"@import":case uB:case lB:return e.return=e.return||e.value;case cB:e.value=Array.isArray(e.props)?e.props.join(","):e.props,Array.isArray(e.children)&&e.children.forEach(function(e){e.type===lB&&(e.children=e.value)})}var r=function(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}(Array.prototype.concat(e.children),HB);return yB(r)?e.return=e.value+"{"+r+"}":""}function VB(e,t,n,r){if("@keyframes"===e.type||"@supports"===e.type||e.type===cB&&(!e.parent||"@media"===e.parent.type||e.parent.type===cB)){var i=sB.transform(HB(e));e.children=i?jB(i)[0].children:[],e.return=""}}Object.defineProperty(VB,"name",{value:"stylisRTLPlugin"});const WB=KR(({options:e,...t})=>gg(cm(t,e)()),(e,t)=>e.fontSize===t.fontSize&&e.fontFamily===t.fontFamily&&e.fontStyle===t.fontStyle&&e.fontWeight===t.fontWeight&&e.options?.maxNbrLinesOfText===t.options?.maxNbrLinesOfText&&e.options?.allowLineBreaks===t.options?.allowLineBreaks);let UB=class{#v={on:new Map,once:new Map};#x=10;#w(e){this.listenerCount(e)>this.#x&&console.warn(`Possible EventEmitter memory leak detected. ${this.listenerCount(e)} listeners added to "${String(e)}".`)}#S(e,t,n){const r=this.#v[e].get(t)??new Set;r.add(n),this.#v[e].set(t,r),this.#w(t)}setMaxListeners(e){this.#x=e}on(e,t){this.#S("on",e,t)}once(e,t){this.#S("once",e,t)}off(e,t){this.#v.on.get(e)?.delete(t),this.#v.once.get(e)?.delete(t)}emit(e,...t){this.#v.on.get(e)?.forEach(e=>{e(...t)}),this.#v.once.get(e)?.forEach(e=>{e(...t)}),this.#v.once.delete(e)}listenerCount(e){return(this.#v.on.get(e)?.size??0)+(this.#v.once.get(e)?.size??0)}removeAllListeners(e){void 0===e?(this.#v.on.clear(),this.#v.once.clear()):(this.#v.on.delete(e),this.#v.once.delete(e))}};const GB=gg(()=>new UB);let YB=function(e){return e.Selected="selected",e.Possible="possible",e.Disabled="disabled",e.Inactive="inactive",e}({}),KB=function(e){return e.Select="Select",e.SelectMouseDown="SelectMouseDown",e.SelectMouseUp="SelectMouseUp",e.SelectMultiAdd="SelectMultiAdd",e.SelectMultiEnd="SelectMultiEnd",e.Reset="Reset",e.Clear="Clear",e.UpdatePageRows="UpdatePageRows",e}({}),XB=function(e){return e.A="ascending",e.D="descending",e}({}),JB=function(e){return e.First="sn-table-announcer-1",e.Second="sn-table-announcer-2",e}({});const QB=[0,0],ZB=e=>"number"==typeof e&&!Number.isNaN(+e),eH=e=>ZB(e.qNum),tH=e=>"string"==typeof e&&e.length>0&&!Number.isNaN(+e),nH=e=>"string"==typeof e&&e.length>0||"number"==typeof e?+e:NaN,rH=(e,t)=>e.max===e.min?.5:(t-e.min)/(e.max-e.min),iH=(e,t,n)=>{const r=e.paletteColors?e.paletteColors[t]:e.localPaletteColors[t];return n.getColorPickerColor(r)},oH=(e,t,n)=>{const r={previousColor:(i=e.localPaletteColors)[(o=t)-(o>0?1:0)],nextColor:i[o+(o<i.length-1?1:0)]};var i,o;const a=((e,t)=>{const n=e.limits&&e.limits.concat().sort((e,t)=>e.value-t.value);return{lowerLimit:n&&t>0?n[t-1]:{value:0,gradient:!1},upperLimit:n&&n[t]?n[t]:{value:1,gradient:!1}}})(e,t),s=((e,t,n,r,i)=>{const{upperLimit:o,lowerLimit:a}=e,{previousColor:s,nextColor:l}=t,c=r===o.value?1:(r-a.value)/(o.value-a.value);return a.gradient&&o.gradient?r-a.value<o.value-r?{color:s.color,t:.5-c}:{color:l.color,t:c-.5}:a.gradient?{color:s.color,t:1-(.5+c/2)}:o.gradient?{color:l.color,t:c/2}:{color:i.localPaletteColors[n].color,t:r}})(a,r,t,n,e);return h(e.localPaletteColors[t].color??"").blend(h(s.color??""),s.t)},aH=(e,t,n)=>{const r=((e,t)=>{const{limits:n}=e;return n&&(e.limits=n.sort((e,t)=>e.value-t.value),e.limits=n.map(e=>({...e,value:rH(t,e.value)}))),e})({...e},t),i=r.paletteColors||r.localPaletteColors;return i&&(r.localPaletteColors=i.concat().map((e,t)=>({color:iH(r,t,n)}))),r},sH=(e,t,n,r)=>{const i=aH(e,n,r),{localPaletteColors:o}=i;if(t<=0)return o[0].color;if(t>=1)return o[o.length-1].color;const a=((e,t)=>{let n="",r=0;const{limits:i,localPaletteColors:o}=e;for(let a=0;a<o.length;a++){const o=i&&i[a]?i[a].value:1;if(t>=r&&t<o){n=oH(e,a,t);break}r=o}return n})(i,t);return a},lH=(e,t)=>{const n=(e=>e.map(e=>e.value??e).sort((e,t)=>e-t))(e),r=n.some(e=>!ZB(e));return 0===n.length||r?(e=>{const t=0===e?0:.5*e;return{min:e-t,max:e+t}})(t):1===n.length?((e,t)=>{const n=e[0]-t;if(0===n||!ZB(n)){const e=0===t?.5:Math.abs(.5*t);return{min:t-e,max:t+e}}return n>0?{min:t-.5*Math.abs(t),max:e[0]+2*n}:{min:e[0]+2*n,max:t+.5*Math.abs(t)}})(n,t):((e,t)=>{let n=e[e.length-1]-e[0];return n=n>0?n:1,{min:Math.min(t,e[0])-n/2,max:Math.max(t,e[e.length-1])+n/2}})(n,t)},cH=(e,t)=>{const{limits:n}=e.segments;if(!n)return;const r=((e,t)=>{const{min:n,max:r}=lH(e,t),i=Math.abs(t);return{min:n??t-i,max:r??t+i}})(n,t),i=((e,t,n)=>{const{limits:r,paletteColors:i,localPaletteColors:o}=e.segments;if(!r||!ZB(t))return 0;let a=n&&ZB(n)?Math.min(n,t):0;const s=r.sort((e,t)=>e.value-t.value),l=i||o;for(let e=0;e<l.length;e++){if(e===l.length-1||t<s[e].value&&t>=a)return e;a=s[e].value}return 0})(e,t,r.min);return{limitRange:r,limitPaletteColorIndex:i}},uH=(e,t)=>lt.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:lt.jsx("path",{d:"M7.5 8.5H2v-1h5.5V2h1v5.5H14v1H8.5V14h-1z"})}),dH=Yt.forwardRef(uH),pH=(e,t)=>lt.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:lt.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"})}),fH=Yt.forwardRef(pH),hH=(e,t)=>lt.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:[lt.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"}),lt.jsx("use",{fillRule:"evenodd"})]}),mH=Yt.forwardRef(hH),gH=(e,t)=>lt.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:lt.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"})}),yH=Yt.forwardRef(gH),bH=(e,t)=>lt.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:lt.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"})}),vH=Yt.forwardRef(bH),xH=(e,t)=>lt.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:lt.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"})}),wH=Yt.forwardRef(xH),SH=(e,t)=>lt.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:lt.jsx("path",{d:"M2 7.5h12v1H2z"})}),kH=Yt.forwardRef(SH),CH=(e,t)=>lt.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:lt.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"})}),EH=Yt.forwardRef(CH),MH=(e,t)=>lt.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:lt.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"})}),RH=Yt.forwardRef(MH),_H=(e,t)=>lt.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:lt.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"})}),AH=Yt.forwardRef(_H),IH=(e,t)=>lt.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:lt.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"})}),PH=Yt.forwardRef(IH),TH=(e,t)=>lt.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:lt.jsx("path",{d:"m6 10 7-7 2 2-7 7-2 2-5-5 2-2z"})}),DH=Yt.forwardRef(TH),OH=(e,t)=>lt.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:lt.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"})}),NH=Yt.forwardRef(OH),qH=(e,t)=>lt.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:lt.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"})}),LH=Yt.forwardRef(qH),jH=(e,t)=>lt.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:lt.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"})}),zH=Yt.forwardRef(jH),FH=(e,t)=>lt.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:lt.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"})}),$H=Yt.forwardRef(FH),BH=(e,t)=>lt.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:lt.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"})}),HH={m:DH,"ï":AH,R:$H,S:NH,T:LH,U:zH,P:RH,Q:wH,"è":Yt.forwardRef(BH),"¢":yH,"©":mH,"23F4":vH,2013:PH,"&":EH,add:dH,"minus-2":kH,dot:fH},VH=(e,t,n,r)=>{const i=e.indicatorConditionalColoring;if(!i)return;const o=cH(i,t),a=((e,t,n,r)=>{const{segments:i}=e;if(!i||!n)return;const{limits:o}=i;if(!o?.length||!((e,t)=>!(!e||0===e.length||!(e[t]?.gradient??e[t-1]?.gradient)))(o,n.limitPaletteColorIndex))return iH(i,n.limitPaletteColorIndex,r);const a=rH(n.limitRange,t);return sH(i,a,n.limitRange,r)})(i,t,o,r),{paletteColors:s}=i.segments,l=o?.limitPaletteColorIndex||0,c=s[l]?.icon??"dot",{indicator:u}=e;let d=u?.position||"right";return"rtl"===n&&(d="right"===d?"left":"right"),{color:a,iconKey:c,position:d}},WH=(Hh().palette.primary.light,"repeating-linear-gradient(-45deg, rgba(200,200,200,0.08), rgba(200,200,200,0.08) 2px, rgba(200,200,200,0.3) 2.5px, rgba(200,200,200,0.08) 3px, rgba(200,200,200,0.08) 5px)"),UH=4/3,GH="12px",YH="600",KH="Source Sans Pro, sans-serif",XH={height:"auto",fontSize:GH,lineHeight:"unset",padding:"4px",borderStyle:"solid",borderWidth:"0px 1px 1px 0px",userSelect:"none",outline:"none","&:focus-visible":{boxShadow:"0 0 0 2px #177fe6 inset, 0 0 0 3px #fff inset"},"&:focus:not(:focus-visible)":{boxShadow:"none"},"&:last-child":{borderRightWidth:"0px"}},JH=(e,t)=>"rtl"===e&&"center"!==t.resolvedImagePosition?.horizontal?t.resolvedImagePosition?.horizontal&&(e=>"flex-start"===e?"flex-end":"flex-start")(t.resolvedImagePosition?.horizontal):t.resolvedImagePosition?.horizontal,QH=(e,t)=>e.representation.type===t$.Image&&"fitHeight"===e.representation.imageSize?JH(t,e.representation):e.align,ZH=(e,t)=>t||"right"!==e&&"left"!==e?t||"center"!==e?void 0:"row":"row-reverse",eV=(e,t,n)=>{if(!t&&"rtl"===n){if("left"===e.headTextAlign)return"right";if("right"===e.headTextAlign)return"left"}return e.headTextAlign},tV=(e,t)=>"rtl"===e&&"center"!==t?"right"===t?"left":"right":t,nV=(e,t,n)=>"rtl"===e||t&&!n?"0px":"1px",rV=(e,t,n)=>"rtl"===e?t&&!n?"0px":"1px":"0px",iV=24,oV=Ul("div",{shouldForwardProp:e=>!["direction","isPagination"].includes(e)})(({direction:e,isPagination:t})=>({position:"absolute",left:t&&"rtl"===e?0:void 0,bottom:0})),aV=Ul(Xu,{shouldForwardProp:e=>!["textAlign","direction","isPagination"].includes(e)})(({textAlign:e,theme:t,direction:n,isPagination:r})=>({textAlign:e,height:"auto",padding:t.spacing(.5,1),display:"flex",alignItems:"flex-end",justifySelf:e,alignSelf:"center",flexDirection:"rtl"===n?ZH(e,r):void 0})),sV=Ul(Xu,{shouldForwardProp:e=>"shouldShowMenuIcon"!==e&&"shouldShowLockIcon"!==e&&"alignment"!==e})(({shouldShowMenuIcon:e,shouldShowLockIcon:t,alignment:n})=>{const r=e?"24px":"";let i;switch(n){case"left":i={gridTemplateColumns:t?`20px 2fr ${r}`:`1fr ${r}`};break;case"center":{const n=e||t;i={gridTemplateColumns:n?"24px 2fr 24px":"1fr","& .sn-table-lock-icon":{gridColumn:1},"& .sn-table-head-label":{gridColumn:n?2:1},[`& .${wm}`]:{gridColumn:3}};break}case"right":i={gridTemplateColumns:t?`${r} 2fr 20px`:`${r} 1fr`,"& .sn-table-lock-icon":{gridColumn:t?3:"unset"},"& .sn-table-head-label":{gridColumn:e?2:"span 2"},[`& .${wm}`]:{gridColumn:1}}}return{width:"100%",display:"grid",gridAutoFlow:"dense",fontSize:"inherit",fontFamily:"inherit",alignItems:"end",overflow:"hidden",...i}}),lV=Ul(Xu,{shouldForwardProp:e=>"rightAligned"!==e})(({rightAligned:e})=>({display:"flex",alignItems:"center",width:"20px",height:"24px",flexShrink:0,flexDirection:"inherit",justifyContent:e?"flex-start":"flex-end"})),cV=Ul(Xu,{shouldForwardProp:e=>"justifyContent"!==e})(({justifyContent:e})=>({display:"flex",flexGrow:1,textAlign:e,justifyContent:e,alignItems:"center",padding:"4px"})),uV=Ul(au,{shouldForwardProp:e=>"hoverBackground"!==e&&"activeBackground"!==e&&"isActive"!==e&&"order"!==e})(({hoverBackground:e,activeBackground:t,isActive:n,order:r})=>({padding:"4px !important",width:"fit-content",height:"auto",background:n?t:void 0,"&:hover":{background:e},color:"inherit",order:r})),dV=gg(),pV=gg(0),fV=gg(0),hV=e=>parseInt(e??XH.fontSize,10)*UH,mV=/<[bius]>/g;const gV=4/3,yV=e=>!!e?.color||"number"==typeof e?.index&&e.index>-1;function bV(e,t,n={index:-1}){const r=t.getColorPickerColor(n);return r&&"none"!==r?r:e}const vV=(e,t)=>e?{borderBottomColor:Uh.DARK_MODE_BORDER,borderRightColor:Uh.DARK_MODE_BORDER,borderLeftColor:Uh.DARK_MODE_BORDER,borderTopColor:Uh.DARK_MODE_BORDER}:{borderLeftColor:Uh.BORDER_MEDIUM,borderRightColor:Uh.BORDER_MEDIUM,borderTopColor:Uh.BORDER_HEAVY,borderBottomColor:t?Uh.BORDER_HEAVY:Uh.BORDER_LIGHT},xV=(e,t,n)=>{if(e&&t&&n){const r=(e=>parseInt(e,10)*gV+8+1)(e);return r*(t+2)<n.clientHeight-40?"1px":"0px"}return"0px"},wV=e=>e.components?.find(e=>"theme"===e.key),SV=(e,t,n,r=!1)=>{const i=t.getStyle("object",`straightTableV2.${e}`,"fontFamily"),o=t.getStyle("object",`straightTableV2.${e}`,"color"),a=t.getStyle("object",`straightTableV2.${e}`,"fontSize"),s={fontFamily:i,color:yV(n?.fontColor)?bV(Uh.TEXT,t,n?.fontColor):o||Uh.TEXT,fontSize:n?.fontSize&&`${n.fontSize}px`||a,padding:n&&"padding"in n?n.padding:void 0,...vV(t.background.isDark,r)};return Object.keys(s).forEach(e=>{const t=e;null==s[t]&&delete s[t]}),s};function kV(e,t,n){const r=wV(e)?.header,i=SV("header",t,r,n);return i.background=(e=>{if(void 0===e)return;const t=h(e);return t.setAlpha(1),t.getRGB()})(t.background.headerColor),i.hoverBackground=Kh(i.background??Uh.WHITE,Am),i.activeBackground=Kh(i.background??Uh.WHITE,Im),i}function CV(e,t,n){const r={};let i={fontStyle:e.fontStyle,fontWeight:e.fontWeight,textDecoration:e.textDecoration};return t?.qValues?.forEach((e,t)=>{const o=e.qText,a=o&&Jh(o);a&&(r[n[t]]=a);const s=((e,{boldFontWeight:t,combineDecorations:n=!1})=>{const r=e?.toLowerCase().match(mV),i={},o=new Set;return r?.forEach(e=>{switch(e){case"<b>":i.fontWeight=t;break;case"<i>":i.fontStyle="italic";break;case"<u>":o.add("underline"),i.textDecoration="underline";break;case"<s>":o.add("line-through"),i.textDecoration="line-through"}}),n&&o.size>0&&(i.textDecoration=["underline","line-through"].filter(e=>o.has(e)).join(" ")),Object.keys(i).length>0?i:void 0})(o,{boldFontWeight:YH,combineDecorations:!0});var l,c;i={...i,...s,textDecoration:(l=i.textDecoration,c=s?.textDecoration,c?l?[...new Set(`${l} ${c}`.split(/\s+/).filter(e=>e&&"none"!==e))].join(" "):c:l)}}),r.cellBackgroundColor&&!r.cellForegroundColor&&(r.cellForegroundColor=Gh(r.cellBackgroundColor)),{...e,...r,color:r.cellForegroundColor||e.color,background:r.cellBackgroundColor||e.background,fontStyle:i.fontStyle,fontWeight:i.fontWeight,textDecoration:i.textDecoration}}const EV=25e4,MV=(e,t)=>t.qAttrExps?.qValues?.[e],RV=e=>{const t=Number(e?.qNum);return void 0!==e?.qNum&&Number.isFinite(t)?t:void 0},_V=e=>{const t=e?.qText?.trim();return t&&"ARGB(0,0,0,0)"!==t.toUpperCase()?Jh(t)??void 0:void 0},AV=/^data:(?<!\s)\s*(image\/[\w+-.]+)(?<!\s)\s*(;.*?){0,1}(?<!\s)\s*,(.*)/i,IV=5e6,PV=5e5;const TV={fromSearchString:function(e){if(!e)return[];"?"===e[0]&&(e=e.substr(1));const t=[];return e.split("&").forEach(e=>{if(!e)return;const n=e.indexOf("=");let r,i="",o=!1;-1===n?r=e:(r=e.slice(0,n),i=e.slice(n+1),o=!0),t.push(function(e,t,n){return{key:DV(e),value:DV(t.replace(/%2B/g,"shouldNotDecodePlus")),useEqualSign:n}}(r,i,o))}),t}};function DV(e){try{return decodeURIComponent(e)}catch{return e}}function OV(e){if(!(this instanceof OV))throw new Error("Url needs to be called with the new keyword");if(!e)throw new Error("Url needs a string to operate on");const t=function(e){const t={authorityAndPath:"",search:"",hash:""};let n=e.indexOf("#");-1!==n&&(t.hash=e.substr(n),e=e.substr(0,n));n=e.indexOf("?"),-1!==n&&(t.search=e.substr(n),e=e.substr(0,n));return t.authorityAndPath=e,t}(e);Object.defineProperties(this,{authorityAndPath:{value:t.authorityAndPath},search:{value:t.search},hash:{value:t.hash},searchParams:{get:()=>TV.fromSearchString(t.search)}})}function NV(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")}OV.encodeAuthorityAndPath=function(e){return encodeURI(e).replace(/%5B/gi,"[").replace(/%5D/gi,"]").replace(/%25/gi,"%")},OV.encodeSearchParams=function(e){let t,n="";for(let r=0;r<e.length;r++)t=e[r],n+=0===r?"?":"&",n+=NV(t.key),t.value?n+=`=${NV(t.value)}`:n+=t.useEqualSign?"=":"";return n};var qV=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}},LV=class{decode(e){let t="";const n=new qV(e);let r;for(;n.hasNext();)r=this.decodeCharacter(n),t+=null!=r?r:n.next();return t}decodeCharacter(e){return e.next()}};const jV=e=>e>=0&&e<=1114111,zV=e=>e.match(/[\s]/);var FV=class extends LV{decodeCharacter(e){e.mark();const t=e.next();let n,r,i;if(null==t||"\\"!==t)return e.reset(),null;const o=e.next();if(null==o)return e.reset(),null;switch(o){case"\r":e.peek("\n")&&e.next();case"\n":case"\f":case"\0":return this.decodeCharacter(e)}if("NaN"===parseInt(o,16))return o;for(n=o,r=0;r<5&&(i=e.next(),null!=i&&!zV(i));r++){if("NaN"===parseInt(i,16)){e.pushback(i);break}n+=i}const a=parseInt(n,16);return jV(a)?String.fromCharCode(a):"�"}},$V=class e{constructor(e,t){this._key=e,this._value=t}getKey(){return this._key}getValue(){return this._value}equals(t){return t instanceof e&&(this._key===t._key&&this._value===t._value)}static newInstanceIfNeeded(){let t,n,r=arguments[0];return"string"==typeof arguments[1]?(t=arguments[1],n=r.length):(n=arguments[1],t=arguments[2]),t&&r?(r.length>n&&(r=r.substr(0,n)),new e(r,t)):null}},BV=class e{setValue(e){this._nextMap=null,this._value=e}getNextNode(e){return this._nextMap?this._nextMap[e]:null}put(t,n,r){let i,o;if(t.length===n)return o=this._value,this.setValue(r),o;const a=t.charAt(n);return this._nextMap?(i=this._nextMap[a],i||(i=new e,this._nextMap[a]=i)):(this._nextMap={},i=new e,this._nextMap[a]=i),i.put(t,n+1,r)}get(e,t){if(e.length<=t)return this._value;const n=this.getNextNode(e.charAt(t));return n?n.get(e,t+1):null}getLongestMatch(e,t){if(e.length<=t)return $V.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return $V.newInstanceIfNeeded(e,t,this._value);const r=n.getLongestMatch(e,t+1);return r||$V.newInstanceIfNeeded(e,t,this._value)}},HV=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 BV);const n=this.root.put(e,0,t);return n||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}};const VV=(()=>{const e=[],t=[],n=new HV;let r,i,o;for(r in e["""]="34",e["&"]="38",e["<"]="60",e[">"]="62",e[" "]="160",e["¡"]="161",e["¢"]="162",e["£"]="163",e["¤"]="164",e["¥"]="165",e["¦"]="166",e["§"]="167",e["¨"]="168",e["©"]="169",e["ª"]="170",e["«"]="171",e["¬"]="172",e["­"]="173",e["®"]="174",e["¯"]="175",e["°"]="176",e["±"]="177",e["²"]="178",e["³"]="179",e["´"]="180",e["µ"]="181",e["¶"]="182",e["·"]="183",e["¸"]="184",e["¹"]="185",e["º"]="186",e["»"]="187",e["¼"]="188",e["½"]="189",e["¾"]="190",e["¿"]="191",e["À"]="192",e["Á"]="193",e["Â"]="194",e["Ã"]="195",e["Ä"]="196",e["Å"]="197",e["Æ"]="198",e["Ç"]="199",e["È"]="200",e["É"]="201",e["Ê"]="202",e["Ë"]="203",e["Ì"]="204",e["Í"]="205",e["Î"]="206",e["Ï"]="207",e["Ð"]="208",e["Ñ"]="209",e["Ò"]="210",e["Ó"]="211",e["Ô"]="212",e["Õ"]="213",e["Ö"]="214",e["×"]="215",e["Ø"]="216",e["Ù"]="217",e["Ú"]="218",e["Û"]="219",e["Ü"]="220",e["Ý"]="221",e["Þ"]="222",e["ß"]="223",e["à"]="224",e["á"]="225",e["â"]="226",e["ã"]="227",e["ä"]="228",e["å"]="229",e["æ"]="230",e["ç"]="231",e["è"]="232",e["é"]="233",e["ê"]="234",e["ë"]="235",e["ì"]="236",e["í"]="237",e["î"]="238",e["ï"]="239",e["ð"]="240",e["ñ"]="241",e["ò"]="242",e["ó"]="243",e["ô"]="244",e["õ"]="245",e["ö"]="246",e["÷"]="247",e["ø"]="248",e["ù"]="249",e["ú"]="250",e["û"]="251",e["ü"]="252",e["ý"]="253",e["þ"]="254",e["ÿ"]="255",e["&OElig"]="338",e["&oelig"]="339",e["&Scaron"]="352",e["&scaron"]="353",e["&Yuml"]="376",e["&fnof"]="402",e["&circ"]="710",e["&tilde"]="732",e["&Alpha"]="913",e["&Beta"]="914",e["&Gamma"]="915",e["&Delta"]="916",e["&Epsilon"]="917",e["&Zeta"]="918",e["&Eta"]="919",e["&Theta"]="920",e["&Iota"]="921",e["&Kappa"]="922",e["&Lambda"]="923",e["&Mu"]="924",e["&Nu"]="925",e["&Xi"]="926",e["&Omicron"]="927",e["&Pi"]="928",e["&Rho"]="929",e["&Sigma"]="931",e["&Tau"]="932",e["&Upsilon"]="933",e["&Phi"]="934",e["&Chi"]="935",e["&Psi"]="936",e["&Omega"]="937",e["&alpha"]="945",e["&beta"]="946",e["&gamma"]="947",e["&delta"]="948",e["&epsilon"]="949",e["&zeta"]="950",e["&eta"]="951",e["&theta"]="952",e["&iota"]="953",e["&kappa"]="954",e["&lambda"]="955",e["&mu"]="956",e["&nu"]="957",e["&xi"]="958",e["&omicron"]="959",e["&pi"]="960",e["&rho"]="961",e["&sigmaf"]="962",e["&sigma"]="963",e["&tau"]="964",e["&upsilon"]="965",e["&phi"]="966",e["&chi"]="967",e["&psi"]="968",e["&omega"]="969",e["&thetasym"]="977",e["&upsih"]="978",e["&piv"]="982",e["&ensp"]="8194",e["&emsp"]="8195",e["&thinsp"]="8201",e["&zwnj"]="8204",e["&zwj"]="8205",e["&lrm"]="8206",e["&rlm"]="8207",e["&ndash"]="8211",e["&mdash"]="8212",e["&lsquo"]="8216",e["&rsquo"]="8217",e["&sbquo"]="8218",e["&ldquo"]="8220",e["&rdquo"]="8221",e["&bdquo"]="8222",e["&dagger"]="8224",e["&Dagger"]="8225",e["&bull"]="8226",e["&hellip"]="8230",e["&permil"]="8240",e["&prime"]="8242",e["&Prime"]="8243",e["&lsaquo"]="8249",e["&rsaquo"]="8250",e["&oline"]="8254",e["&frasl"]="8260",e["&euro"]="8364",e["&image"]="8365",e["&weierp"]="8472",e["&real"]="8476",e["&trade"]="8482",e["&alefsym"]="8501",e["&larr"]="8592",e["&uarr"]="8593",e["&rarr"]="8594",e["&darr"]="8595",e["&harr"]="8596",e["&crarr"]="8629",e["&lArr"]="8656",e["&uArr"]="8657",e["&rArr"]="8658",e["&dArr"]="8659",e["&hArr"]="8660",e["&forall"]="8704",e["&part"]="8706",e["&exist"]="8707",e["&empty"]="8709",e["&nabla"]="8711",e["&isin"]="8712",e["¬in"]="8713",e["&ni"]="8715",e["&prod"]="8719",e["&sum"]="8721",e["&minus"]="8722",e["&lowast"]="8727",e["&radic"]="8730",e["&prop"]="8733",e["&infin"]="8734",e["&ang"]="8736",e["&and"]="8743",e["&or"]="8744",e["&cap"]="8745",e["&cup"]="8746",e["&int"]="8747",e["&there4"]="8756",e["&sim"]="8764",e["&cong"]="8773",e["&asymp"]="8776",e["&ne"]="8800",e["&equiv"]="8801",e["&le"]="8804",e["&ge"]="8805",e["&sub"]="8834",e["&sup"]="8835",e["&nsub"]="8836",e["&sube"]="8838",e["&supe"]="8839",e["&oplus"]="8853",e["&otimes"]="8855",e["&perp"]="8869",e["&sdot"]="8901",e["&lceil"]="8968",e["&rceil"]="8969",e["&lfloor"]="8970",e["&rfloor"]="8971",e["&lang"]="9001",e["&rang"]="9002",e["&loz"]="9674",e["&spades"]="9824",e["&clubs"]="9827",e["&hearts"]="9829",e["&diams"]="9830",e)"function"!=typeof e[r]&&e.hasOwnProperty(r)&&(t[e[r]]=r);for(i in t)"function"!=typeof t[i]&&t.hasOwnProperty(i)&&(o=t[i].toLowerCase().substr(1),n.put(o,String.fromCharCode(i)));return n})();var WV=class extends LV{decodeCharacter(e){let t;e.mark();const n=e.next();if(null==n||"&"!==n)return e.reset(),null;const r=e.next();if(null==r)return e.reset(),null;if("#"===r){if(t=this._getNumericEntity(e),null!=t)return t}else if(r.match(/[A-Za-z]/)&&(e.pushback(r),t=this._getNamedEntity(e),null!=t))return t;return e.reset(),null}_getNamedEntity(e){let t,n,r,i="";for(t=Math.min(e.remainder().length,VV.getMaxKeyLength()),r=0;r<t;r++)i+=e.next().toLowerCase();const o=VV.getLongestMatch(i);if(null==o)return null;for(e.reset(),e.next(),t=o.getKey().length,n=0;n<t;n++)e.next();return e.peek(";")&&e.next(),o.getValue()}_getNumericEntity(e){const t=e.peek();return null==t?null:"x"===t||"X"===t?(e.next(),this._parseHex(e)):this._parseNumber(e)}_parseHex(e){let t,n="";for(;e.hasNext();){if(t=e.peek(),Number.isNaN(+parseInt(t,16))){if(";"===t){e.next();break}break}n+=t,e.next()}const r=parseInt(n,16);return!Number.isNaN(+r)&&jV(r)?String.fromCharCode(r):null}_parseNumber(e){let t,n="";for(;e.hasNext();){if(t=e.peek(),Number.isNaN(+parseInt(t,10))){if(";"===t){e.next();break}break}n+=t,e.next()}const r=parseInt(n,10);return!Number.isNaN(+r)&&jV(r)?String.fromCharCode(r):null}},UV=class extends LV{decodeCharacter(e){e.mark();const t=e.next();let n,r,i,o;if(null==t)return e.reset(),null;if("%"!==t)return e.reset(),null;for(n="",r=0;r<2;r++)i=e.nextHex(),null!=i&&(n+=i);return 2===n.length&&(o=parseInt(n,16),jV(o))?String.fromCharCode(o):(e.reset(),null)}};let GV;"undefined"!=typeof document&&(GV=document.createElement("div"));const YV=Array.prototype.indexOf,KV=[",",".","_"," "],XV=[",",".","-","_"," "],JV={width:["%"],height:["%"]},QV={default:["-"," ","%"],color:["#"," ","(",")"],image:["(",")",":","/","?","&","-",".",'"',"="," "]},ZV={background:["(",")",":","%","/","?","&","-"," ",".",'"',"=","#"],"background-image":QV.image,"background-color":QV.color,"border-color":QV.color,"border-image":QV.image,color:QV.color,icon:QV.image,"list-style-image":QV.image,"outline-color":QV.color},eW={attr_name:["^on[a-z]{1,}","style","href","src"],attr_val:["javascript:","data:"],css_key:["behavior","-moz-behavior","-ms-behavior"],css_val:["expression"]};function tW(e,t,n){let r;if(t){if(YV)return YV.call(t,e,n);for(r=t.length,n=n?n<0?Math.max(0,r+n):n:0;n<r;n++)if(n in t&&t[n]===e)return n}return-1}function nW(e){if(null==e)return"";let t="";const n=document.createTextNode(e);return GV.appendChild(n),t=GV.innerHTML,GV.removeChild(n),t}function rW(e,t,n){let r,i,o,a,s,l,c,u,d;for(e=oW(e).toLowerCase(),t=oW(t),o=0;o<eW.attr_name.length;o++)if(e.match(eW.attr_name[o]))throw new Error(`Unsafe attribute name used: ${e}`);for(o=0;o<eW.attr_val.length;o++)if(t.toLowerCase().match(eW.attr_val[o]))throw new Error(`Unsafe attribute value used: ${t}`);if(r=JV[e],r||(r=XV),i="",!n){for(a=0;a<e.length;a++){if(s=e.charAt(a),!s.match(/[a-zA-Z\-0-9]/))throw new Error("Invalid attribute name specified");i+=s}i+='="'}for(l=0;l<t.length;l++)c=t.charAt(l),u=t.charCodeAt(l),!c.match(/[a-zA-Z0-9]/)&&tW(c,r)<0?(d=u.toString(16),i+=`&#x${d};`):i+=c;return n||(i+='"'),i}function iW(e,t,n){let r,i,o,a,s,l,c,u,d,p;if(e=oW(e).toLowerCase(),t=oW(t),tW(e,eW.css_key)>=0)throw new Error(`Unsafe property name used: ${e}`);for(r=0;r<eW.css_val.length;r++)if(t.toLowerCase().indexOf(eW.css_val[r])>=0)throw new Error(`Unsafe property value used: ${t}`);if(i=ZV[e],i||(i=QV.default),o="",!n){for(a=0;a<e.length;a++){if(s=e.charAt(a),!s.match(/[a-zA-Z-]/))throw new Error("Invalid Property Name specified");o+=s}o+=": "}for(l=0;l<t.length;l++)c=t.charAt(l),u=t.charCodeAt(l),!c.match(/[a-zA-Z0-9]/)&&tW(c,i)<0?(d=u.toString(16),p="000000".substr(d.length),o+=`\\${p}${d}`):o+=c;return o}function oW(e,t){let n,r,i,o,a=!1;if(null===e)return null;n=e,r=e,i=0;const s=[new WV,new UV,new FV];for(;!a;){r=n;for(let e=0;e<s.length;e++)o=s[e].decode(n),o!==n&&(i++,n=o);r!==n||(a=!0)}if(t&&i>1)throw new Error("Attack Detected - Multiple/Double Encodings used in input");return n}const aW=[];for(let e=0;e<255;e++)aW[e]=e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122?null:e.toString(16);const sW={html:e=>nW(e.unsafe),css(e){let t,n=[];const r=[],i={};let o="";for(t in e.map?n=e.map:n[e.name]=e.unsafe,n)"function"!=typeof n[t]&&n.hasOwnProperty(t)&&(r[t]=iW(t,n[t],!0),o+=iW(t,n[t],!0),i[t]=r[t]);return e.map?i:o},attr(e){let t=[];const n=[],r={};let i="";e.map?t=e.map:t[e.name]=e.unsafe;for(const e in t)"function"!=typeof t[e]&&t.hasOwnProperty(e)&&(n[e]=rW(e,t[e],!0),i+=rW(e,t[e],!0),r[e]=n[e]);return e.map?r:i}};function lW(e,t){throw new Error(t)}var cW={canonicalize:oW,encode:function(){const e={context:"html",unsafe:null,name:null,map:null,setter:null,strict:!0};return 1===arguments.length&&"object"==typeof arguments[0]?function(){let e,t,n;const r=arguments[0]||{};let i=1;const o=arguments.length;for(;i<o;i++)if(null!=(e=arguments[i]))for(t in e)if(e.hasOwnProperty(t)){if(n=e[t],r===n)continue;void 0!==n&&(r[t]=n)}}(e,arguments[0]):(e.context=arguments[0],2===arguments.length?"html"===e.context?e.unsafe=arguments[1]:"attr"!==e.context&&"css"!==e.context||(e.map=arguments[1]):(e.name=arguments[2],e.unsafe=arguments[1])),"html"===e.context?sW.html(e):"css"===e.context?(null!=e.map&&"object"!=typeof e.map&&lW(this,"Invalid parameter type"),sW.css(e)):"attr"===e.context?(null!=e.map&&"object"!=typeof e.map&&lW(this,"Invalid parameter type"),sW.attr(e)):void lW(this,"Invalid parameter type")},encodeForAttr:rW,encodeForAttr2:function(e){return rW("nonsens",e,!0)},encodeForCSS:iW,encodeForHref:function(e){oW(e),0!==e.search("[a-zA-Z0-9]+:")&&(e=`http://${e}`);const t=new OV(e),n=OV.encodeAuthorityAndPath(t.authorityAndPath),r=t.searchParams;e=n+OV.encodeSearchParams(r)+t.hash;const i=decodeURI(e).toLowerCase();if(-1!==i.indexOf("javascript:"))throw new Error("Attack Detected - Javascript in input");if(-1!==i.indexOf("data:"))throw new Error("Attack Detected - data in input");return e},encodeForJS:function(e,t){let n,r,i,o,a,s;for(t||(t=KV),s="",n=0;n<e.length;n++)i=e.charAt(n),o=e.charCodeAt(n),tW(i,t)>=0||null==aW[o]?s+=i:(r=o.toString(16),o<256?(a="00".substr(r.length),s+=`\\x${a}${r.toUpperCase()}`):(a="0000".substr(r.length),s+=`\\u${a}${r.toUpperCase()}`));return s},encodeForHTML:nW,encodeForURL:function(e,t){let n="";return t&&(t.match(/^[A-Za-z\-0-9]{1,}$/)?n+=oW(t).toLowerCase():lW(this,"Illegal Attribute Name Specified"),n+='="'),n+=encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A"),n+=t?'"':"",n},isSafeDataURL:(e,t)=>{const{maxByteSizeSvg:n=PV,maxByteSizeImage:r=IV}=t??{},{mimeType:i,encoding:o,data:a}=(e=>{const[,t,n,r]=AV.exec(e.trim())??[];return{encoding:n,data:r,mimeType:t?.toLocaleLowerCase()}})(e);if(!a)return!0;const s=((e,t,n)=>{const r={type:e};if(t?.includes(";base64"))try{return new Blob([atob(n)],r).size}catch{return new Blob([n],r).size}return"image/svg+xml"===e?new Blob([n],r).size:0})(i,o,a);return"image/svg+xml"===i?s<=n:s<=r},validateURI:function(e){if(""===e||function(e){if("canParse"in URL)return URL.canParse(e);try{return new URL(e),!0}catch{return!1}}(e))return!1;const t=e.replace(/%2E/gi,".");if(t.match(/[#&=: ]/))return!1;const n=function(e){let t=e,n="";for(;t.length>0;)if(t.startsWith("../")||t.startsWith("./"))t=t.replace(/^\.\.?\//,"");else if(t.startsWith("/./"))t=t.replace(/^\/\.\//,"/");else if("/."===t)t="/";else if(t.startsWith("/../")){t=t.replace(/^\/\.\.\//,"/");const e=n.lastIndexOf("/");-1!==e&&(n=n.slice(0,e))}else if("/.."===t){t="/";const e=n.lastIndexOf("/");-1!==e&&(n=n.slice(0,e))}else if("."===t||".."===t)t="";else{const e=t.match(/^\/?[^/]*/),r=e?e[0]:"";t=t.slice(r.length),n+=r}return n}(t);return""!==n&&"/"!==n&&n}};const uW=(e,t)=>{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"}}},dW=({text:e,url:t,imageSize:n,imagePosition:r,labelStructure:i,imageBox:o,direction:a})=>!r||t&&(t.toLowerCase().includes("javascript:")||!cW.isSafeDataURL(t))?{type:t$.Text,url:void 0,text:e,labelStructure:i}:{type:t$.Image,url:t||"",text:e,imageSize:n,resolvedImagePosition:uW(r,a),labelStructure:i,imageBox:o},pW=(e,t,n,r)=>{if(!e.qMiniChart||!t?.miniChart||!n)return{type:t$.Text,text:r};const{minY:i,maxY:o}=((e,t,n)=>{const r="global"===t.yAxis?.scale,i="zeroCenter"===t.yAxis?.position,o=r?n.qYMin:e.qMiniChart.qMin,a=r?n.qYMax:e.qMiniChart.qMax;if(i){const e=Math.max(Math.abs(o),Math.abs(a));return{minY:-e,maxY:e}}return(e=>"zeroBaseline"===e.yAxis?.position||"bars"===e.type&&"auto"===e.yAxis?.position)(t)?{minY:Math.min(0,o),maxY:Math.max(0,a)}:{minY:o,maxY:a}})(e,t.miniChart,n),a={type:t.miniChart.type,qMatrix:e.qMiniChart.qMatrix,minY:i,maxY:o,showDots:!!t.miniChart.showDots,colors:t.miniChart.colors,colorMin:e.qMiniChart.qMin,colorMax:e.qMiniChart.qMax};return{type:t$.MiniChart,text:r,miniChart:a}},fW=(e,t,n)=>{const r=Array.isArray(t.qAttrExps)?t.qAttrExps[0]:t.qAttrExps,i=r?.qValues?.[e];if(i){const e=Number.isNaN(+i.qNum)?void 0:`${i.qNum}`;return i.qText||e}return n?.urlPosition===n$.Attribute?void 0:n?.urlLabel},hW=({labelStructure:e,text:t,url:n})=>{try{if(!n)throw Error("Invalid url");return{type:t$.Link,url:cW.encodeForHref(n),text:t,labelStructure:e}}catch{return{type:t$.Text,url:void 0,text:t,labelStructure:e}}},mW=({cell:e,representationProperties:t,attrExprInfoIndex:n,env:r,conditionalColoring:i,miniChartOnMeasure:o,measureMinMax:a,labelStructure:s,getText:l=e=>e.qText,direction:c,enabledFeatures:u})=>{const d=r$(t),p=l(e);return d===t$.Image&&u[t$.Image]&&!r.anything.sense?.isUnsupportedFeature?.("tableImages")?((e,t,n,r,i,o)=>{const{imageSize:a,imagePosition:s,imageSetting:l,imageLabel:c,imageBox:u}=t??{};if("url"===l){const t=MV(n.imageUrl??-1,e)?.qText;return o&&(o.maskedValue=t??""),dW({text:r,url:t,imageSize:a,imagePosition:s,labelStructure:o,imageBox:u,direction:i})}if("label"===l){const t=o?o.originalValue:r;if(-1===n.imageLabel)return dW({text:c||t||"",url:t,imageSize:a,imagePosition:s,labelStructure:o,imageBox:u,direction:i});const l=MV(n.imageLabel??-1,e)?.qText??r;return dW({text:l,url:t,imageSize:a,imagePosition:s,labelStructure:o,imageBox:u,direction:i})}return{type:t$.Text,url:void 0,labelStructure:o,text:r}})(e,t,n,p,c,s):d===t$.Link?((e,t,n,r,i)=>{const{urlPosition:o}=t??{};if(o===n$.Attribute){const o=fW(n.url??-1,e,t);return hW({labelStructure:r,text:i||o||"",url:o})}if(o===n$.Dimension){const o=fW(n.urlLabel??-1,e,t)||i;return r&&(r.maskedValue=o),hW({text:o,labelStructure:r,url:r?.originalValue??i})}return{type:t$.Text,url:void 0,text:i,labelStructure:r}})(e,t,n,s,p):d===t$.Indicator&&u[t$.Indicator]&&!r.anything.sense?.isUnsupportedFeature?.("tableIndicators")?((e,t,n)=>{const{indicator:r}=e??{};return{type:t$.Indicator,url:void 0,text:n,indicator:{applySegmentColors:r?.applySegmentColors,position:r?.position,showTextValues:r?.showTextValues},indicatorConditionalColoring:t}})(t,i,p):d===t$.MiniChart&&u[t$.MiniChart]&&!r.anything.sense?.isUnsupportedFeature?.("qMiniChartDef")?pW(e,t,o,p):d===t$.Bar&&u[t$.Bar]?((e,t,n,r,i)=>{const o={type:t$.Text,text:i},a=RV(e);if(!t||void 0===a)return o;const s=t=>{const r=n[t];return void 0===r||r<0?void 0:MV(r,e)},{barRangeMode:l,barColorMode:c,barLabelColorMode:u}=t,d="manual"===l,p=e=>d&&"number"==typeof e&&Number.isFinite(e)?e:void 0,f={value:a,columnMin:p(t.barRangeMin)??r?.qMin??0,columnMax:p(t.barRangeMax)??r?.qMax??0,isManualRange:d,hasNegativeValues:r?.hasNegativeValues,hasPositiveValues:r?.hasPositiveValues,offsetValue:RV(s("barOffset"))??0,thicknessPx:RV(s("barWidth")),label:s("barLabel")?.qText??i,fallbackLabel:i,color:"expression"===c?_V(s("barColor")):void 0,colorPalette:t.barColor,labelColor:"expression"===u?_V(s("barLabelColor")):void 0,labelColorPalette:t.barLabelColor,barEnd:t.barEnd??"none"};return{type:t$.Bar,text:i,bar:f}})(e,t,n,a,p):{type:t$.Text,url:void 0,text:p,labelStructure:s}},gW=gg(e=>{const t=e(yy),n=e(ey);return e(ty),{qTop:0,qHeight:0,rowPartialHeight:n?.content?.rowPartialHeight??0,visibleTop:n?.content?.visibleTop??t?.visibleTop,visibleHeight:n?.content?.visibleHeight??t?.visibleHeight,scrollLeft:n?.content?.scrollLeft??t?.scrollLeft??0,scrollTopRatio:n?.content?.scrollTopRatio??t?.scrollTopRatio,rowsPerPage:n?.content?.rowsPerPage??t?.rowsPerPage,page:n?.content?.page??t?.page,estimatedRowHeight:n?.content?.estimatedRowHeight??0}}),yW=e=>-1===e?{}:e.qAttrExprInfo.reduce((e,{id:t},n)=>(e[t]=n,e),{}),bW=({cId:e})=>e??WF(),vW=["D","T","TS","IV"],xW=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],wW=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],SW=["January","February","March","April","May","June","July","August","September","October","November","December"],kW=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CW={D:"YYYY-MM-DD",T:"hh:mm:ss",TS:"YYYY-MM-DD hh:mm:ss"},EW=864e5,MW=2**32,RW=e=>{let t=Math.floor(e),n=Math.round((e-t)*EW);n>=EW&&(t+=1,n=0);const r=t-25569,i=r+719468,o=Math.floor(i/146097),a=i-146097*o,s=Math.floor((a-Math.floor(a/1460)+Math.floor(a/36524)-Math.floor(a/146096))/365),l=a-(365*s+Math.floor(s/4)-Math.floor(s/100)),c=Math.floor((5*l+2)/153),u=c<10?c+2:c-10;return{year:s+400*o+(u<=1?1:0),month:u,date:l-Math.floor((153*c+2)/5)+1,day:(r%7+7+3)%7,h:Math.floor(n/36e5),m:Math.floor(n%36e5/6e4),s:Math.floor(n%6e4/1e3),f:n%1e3}},_W=(e,t)=>String(e).padStart(t,"0"),AW=e=>{const[,t]=e.toString().split(".");return t?Number(`0.${t}`):0},IW=/Y+|y+|M+|W+|w+|D+|d+|h+|H+|m+|s+|S+|f+|F+|t{1,2}|T{1,2}/g,PW=(e,t,n)=>{if(Number.isNaN(e)||!Number.isFinite(e))return String(e);let r,i=(n||("IV"===t?CW.T:CW[t])).replace(/\[.+]|\[|]/g,"");"IV"===t?(e<0&&(e=-e,i=`-${i}`),r=((e,t)=>{const n=Math.floor(e);let r=24*AW(e),i=60*AW(r),o=60*AW(i);const a=Math.round(1e3*AW(o));r=Math.floor(r),i=Math.floor(i),o=Math.floor(o),/D+/i.test(t)||(r+=24*n),/h+/i.test(t)||(i+=60*r),/m+/i.test(t)||(o+=60*i);let s=0,l="";if(/w+|t+/i.test(t)){const t=RW(e);s=t.day,l=t.h>=12?"pm":"am"}return{year:0,month:0,day:s,date:n%MW,h:r%MW,m:i%MW,s:o%MW,f:a,t:l}})(e,i)):r=((e,t)=>{const n=RW(e);let r=n.h;return t&&(r%=12,r=r||12),{year:n.year,month:n.month,day:n.day,date:n.date,h:r,m:n.m,s:n.s,f:n.f,t:n.h>=12?"pm":"am"}})(e,/t+/i.test(i));const o=(e=>[[/^(Y+|y+)$/,{Y:`${Number(`${e.year}`.slice(-2))}`,YY:_W(`${e.year}`.slice(-2),2),YYY:_W(`${e.year}`.slice(-3),3),def:t=>_W(`${e.year}`,t.length)}],[/^M+$/,{M:e.month+1,MM:_W(e.month+1,2),MMM:kW[e.month],def:SW[e.month]}],[/^(W+|w+)$/,{W:e.day,WW:_W(e.day,2),WWW:wW[e.day],def:xW[e.day]}],[/^(D+|d+)$/,{def:t=>_W(e.date,t.length)}],[/^(h+|H+)$/,{h:e.h,def:t=>_W(e.h,t.length)}],[/^m+$/,{m:e.m,def:t=>_W(e.m,t.length)}],[/^(s+|S+)$/,{s:e.s,def:t=>_W(e.s,t.length)}],[/^(f+|F+)$/,{def:t=>{const n=`${e.f}`;return n.length>t.length?n.slice(0,t.length):n.padEnd(t.length,"0")}}],[/^(t{1,2}|T{1,2})$/,{def:t=>(t[0].toUpperCase()===t[0]?e.t.toUpperCase():e.t).slice(0,t.length)}]])(r);return i.replace(IW,e=>((e,t)=>{const n=t.find(([t])=>t.test(e))?.[1];if(!n)return"";const r=Object.keys(n).find(t=>"def"!==t&&(t===e||t.toLowerCase()===e)),i=void 0===r?n.def:n[r];return String("function"==typeof i?i(e):i)})(e,o))},TW=/[#0]/,DW={prefix:"",suffix:""},OW=e=>{const t=e.search(TW);if(-1===t)return DW;let n=t;for(let t=e.length-1;t>n;t--)if(TW.test(e[t])){n=t;break}return{prefix:e.slice(0,t),suffix:e.slice(n+1)}},NW=/\B(?=(\d{3})+(?!\d))/g,qW={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y",[-3]:"m",[-6]:"μ",[-9]:"n",[-12]:"p",[-15]:"f",[-18]:"a",[-21]:"z",[-24]:"y"},LW=e=>Number(e.toPrecision(15)),jW=(e,t,n=!1)=>{if(Number.isNaN(e))return String(e);const{qFmt:r,qType:i,qDec:o=".",qThou:a=","}=t??{};if((e=>vW.includes(e))(i))return PW(e,i,r);if(!r)return String(e);const[s,l]=r.split(";"),{suffix:c}=OW(s),u=c.startsWith("A"),d=(u?c.slice(1):c).endsWith("%"),{value:p,siPrefix:f}=((e,t,n)=>{let r=t?LW(100*e):e,i="";if(n&&0!==r&&Number.isFinite(r)){let e=Number(r.toExponential().split("e")[1]);e-=e%3,e in qW&&(i=qW[e],r=LW(r/10**e))}return{value:r,siPrefix:i}})(e,d,u),h=p<0,m=h&&l?l:s,{prefix:g,suffix:y}=OW(m),b=u&&y.startsWith("A")?y.slice(1):y,{decimals:v,useThousands:x}=((e,t,n)=>{const r=e.indexOf(".");let i=0;return-1!==r?i=(e.slice(r+1).match(/[#0]/g)??[]).length:n&&(i=String(Math.abs(t)).split(".")[1]?.length??0),{decimals:Math.min(i,100),useThousands:e.includes(",")}})(m,p,n||"U"===i),[w,S]=Math.abs(p).toFixed(v).split("."),k=x?w.replace(NW,a):w;return`${h&&!l?"-":""}${g}${S?`${k}${o}${S}`:k}${f}${b}`},zW=1e4;function FW(e,t){return[...t].reverse().find(t=>t*e<=zW)||Math.floor(zW/e)}function $W(e,t){if(t?.skipTotals)return{atTop:!1,atBottom:!1};const n=e.qHyperCube.qDimensionInfo.length>0,r=e.qHyperCube.qMeasureInfo.length>0,i=e.qHyperCube.qGrandTotalRow.length>0,o=e.totals?.show,a=e.totals?.position;if(i&&(n&&r||!o&&!n)){if(o||"top"===a)return{atTop:!0,atBottom:!1};if("bottom"===a)return{atTop:!1,atBottom:!0}}return{atTop:!1,atBottom:!1}}function BW(e,t,n,r){return t?0===n?e.totals?.label??"":"":e.qHyperCube.qGrandTotalRow.at(r)?.qText??""}function HW(e,t){const n=e.qHyperCube.qGrandTotalRow.at(t);return ZB(n?.qNum)}function VW(e,t,n,r,i){return e&&!e.auto?r&&"rtl"===i&&"center"!==e.align?{headTextAlign:"right"===e.align?"left":"right",totalsTextAlign:"right"===e.align?"left":"right",bodyTextAlign:"right"===e.align?"left":"right"}:{headTextAlign:e.align,totalsTextAlign:e.align,bodyTextAlign:e.align}:r||"rtl"!==i?{headTextAlign:"N"===t||void 0===t?"right":"left",totalsTextAlign:n?"left":"right",bodyTextAlign:"auto"}:{headTextAlign:"N"===t||void 0===t?"left":"right",totalsTextAlign:n?"right":"left",bodyTextAlign:"auto"}}const WW=(e,t,n,r)=>"auto"!==t?t:r||"rtl"!==n?e?"right":"left":e?"left":"right",UW=(e,t)=>{if(!e)return;const{background:n,foreground:r}=e,i=h(n??""),o=h(r??""),a=t?"getRGB":"getRGBA",s=i.isInvalid()?void 0:i[a](),l=s?Kh(s,Am):void 0,c=s?Kh(s,Im):void 0;return o.isInvalid()&&void 0!==s?{background:s,color:Gh(s),headerMenuHoverBackground:l,headerMenuActiveBackground:c}:{background:s,color:o.isInvalid()?void 0:o.getRGBA(),headerMenuHoverBackground:l,headerMenuActiveBackground:c}};function GW(e,t,n,r,i=()=>!1){const{qDimensionInfo:o,qMeasureInfo:a,qEffectiveInterColumnSortOrder:s}=e.qHyperCube,{colIdx:l,pageColIdx:c,visibleDimInfoIdx:u,visibleMeasureInfoIdx:d}=t,p=o.length,f=l<p,h=f?o[l]:a[l-p],m=f&&o[l].qGrouping===Pm.Cyclic,g=l===s[0];let y,b,v,x="",w=!1,S=-1,k=0,C=[];const{representation:E,conditionalColoring:M}=h;if(f&&void 0!==u){const e=h;x=e.qGroupFieldDefs[e.qGroupPos],k=e.qGroupPos,C=e.qGroupFallbackTitles,w=e.qLocked??!1,S=u,({qDimensionType:y}=e)}else({qMiniChart:b}=h),"bar"===E?.type&&(v=(({qMin:e,qMax:t,qAttrExprInfo:n})=>{if("number"!=typeof e||"number"!=typeof t||!Number.isFinite(e)||!Number.isFinite(t))return;const r=n.find(({id:e})=>"barOffset"===e),i=Number.isFinite(r?.qMin)?r?.qMin:0,o=Number.isFinite(r?.qMax)?r?.qMax:0;return{qMin:Math.min(i,i+e),qMax:Math.max(o,o+t),hasNegativeValues:e<0,hasPositiveValues:t>=0}})(h));const{qFallbackTitle:R,textAlign:_,qAttrExprInfo:A,qSortIndicator:I,qReverseSort:P,qApprMaxGlyphCount:T,columnWidth:D,qLibraryId:O,headerColor:N}=h,q=e.nullValueRepresentation?.text,L=!f&&void 0!==q&&tH(q)?jW(nH(q),h.qNumFormat,h.qIsAutoFormat):void 0;return{isDim:f,isCyclic:m,isLocked:w,fieldId:x,colIdx:l,qLibraryId:O,pageColIdx:c,qApprMaxGlyphCount:T,qReverseSort:P,columnWidth:D??{type:_m.Auto},selectionColIdx:S,isActivelySorted:g,id:bW(h),label:R??"",groupDimensionPos:k,groupDimensionLabels:C,qAttrExprInfoIDs:A.map(e=>e.id),qAttrExprInfoIndex:yW(h),sortDirection:I&&"N"!==I?I:"A",totalInfo:BW(e,f,c,d??-1),...!f&&{isTotalNumeric:HW(e,d??-1)},...VW(_,y,f,n,r),representation:E,conditionalColoring:f?void 0:M,qNumFormat:f?void 0:h.qNumFormat,qIsAutoFormat:f?void 0:h.qIsAutoFormat,formattedNullValueText:L,qMiniChart:b,measureMinMax:v,headerColor:i("VNA-626-TABLE_HEADER_COLOR_BY_EXPRESSION")?UW(N,n):void 0}}const YW=(e,t,n,r=()=>!1)=>{const{qHyperCube:{qColumnOrder:i,qDimensionInfo:o,qMeasureInfo:a}}=e,s=o.length+a.length,l=((e,t,n)=>{const r=t.length,{visible:i,hiddenDim:o,hiddenMea:a}=e.reduce((e,i)=>{const o=i<r,{qError:a}=o?t[i]:n[i-r];return 7005===a?.qErrorCode?o?e.hiddenDim.push(i):e.hiddenMea.push(i):e.visible.push(i),e},{visible:[],hiddenDim:[],hiddenMea:[]});return i.map((e,t)=>{const n=e<r,i=(n?o:a).filter(t=>t<e).length,s=e-i;return{colIdx:e,pageColIdx:t,visibleDimInfoIdx:n?s:void 0,visibleMeasureInfoIdx:n?void 0:s-r}})})(i.length===s?i:Array.from(Array(s).keys()),o,a);return l.map(i=>GW(e,i,t,n,r))},KW=(e,t,n,r)=>e?(r?n.nullValueRepresentation?.dimensionText:void 0)??t.qText??"-":n.nullValueRepresentation?.text??t.qText??"-",XW=(e,t)=>t?-2===e.qElemNumber:!!e.qIsNull,JW={page:0,rowsPerPage:100,rowsPerPageOptions:[10,25,100]},QW=gg(e=>{const t=e(ZW),n=e(Yg),r=e(gW),i=n.qHyperCube.qSize.qcy,o=r.visibleHeight??t.rowsPerPage,a=r.visibleTop??t.page*o,s=r.visibleHeight??Math.min(o,i-a),l=n.qHyperCube.qSize.qcx;return t.page>0&&a>=i?{...t,page:0}:s*l>zW?{...t,rowsPerPage:FW(l,t.rowsPerPageOptions),page:0}:t}),ZW=gg(JW),eU=gg(e=>{const t=e(Yg),n=e(yy),r=e(gW);return fy(t,n)?{page:r.page||JW.page,rowsPerPage:r.rowsPerPage||JW.rowsPerPage,rowsPerPageOptions:JW.rowsPerPageOptions}:e(QW)},(e,t,n)=>{t(ZW,e=>({...e,...n}))}),tU=!0,nU=e=>-1===e.qElemNumber||!!e.qIsTotalCell,rU=gg(async e=>{const t=e(Yg),n=e(yy),r=e(my),{page:i,rowsPerPage:o}=e(eU),a=e(gW),s=e(Sy),l=e(Vg),c=e(Xg),u=e(Wg),d=t.qHyperCube.qSize.qcx,p=t.qHyperCube.qSize.qcy,f=Math.ceil(p/o),h=a.visibleTop??i*o,m=a.visibleHeight??Math.min(o,p-h),g=p>10,y=$W(t,n),b=YW(t,tU,r,u),v=l.flags.isEnabled("VNA-670-SEPARATE_NULL_VALUE_STYLING"),x=u("VNA-977-TABLE-BARS"),w=await(async(e,t,n)=>{if(t.snapshotData)return t.qHyperCube.qDataPages;const r=t.qHyperCube.qDataPages.at(0),i=r?.qArea;return r&&i?.qLeft===n.qLeft&&i.qTop===n.qTop&&i.qWidth===n.qWidth&&i.qHeight>=n.qHeight?[{...r,qMatrix:r.qMatrix.slice(0,n.qHeight)}]:e&&"getHyperCubeData"in e?e.getHyperCubeData("/qHyperCubeDef",[n]):[]})(s,t,{qLeft:0,qTop:h,qHeight:m,qWidth:d});c||(a.qTop=h,a.qHeight=m,a.rowsPerPage=o,a.page=i);const S=w.at(0)?.qMatrix.map((e,n)=>{const i=[],o=e.some(nU);return b.forEach((a,s)=>{const c=e[s],u=!a.isDim&&c.qIsNull,d=a.isDim&&XW(c,a.isDim),p=u||d?KW(a.isDim,c,t,v):c.qText,f=u?tH(p):eH(c),g=eH(c)&&!tH(c.qText??"");i[s]={id:WF(),...c,align:WW(f,a.bodyTextAlign,r,tU),rowIdx:n+h,colIdx:a.colIdx,pageRowIdx:n,pageColIdx:s,selectionColIdx:a.selectionColIdx,isSelectable:a.isDim&&!a.isLocked&&!o&&!d,isTotalRow:o,isLastRow:n===m-1,isNumeric:f,isDual:g,isNull:(!u||!f)&&XW(c,a.isDim),qNumFormat:a.qNumFormat,qIsAutoFormat:a.qIsAutoFormat,formattedNullValueText:a.formattedNullValueText,representation:mW({cell:c,representationProperties:a.representation,attrExprInfoIndex:a.qAttrExprInfoIndex,env:l,conditionalColoring:a.conditionalColoring,miniChartOnMeasure:a.qMiniChart,measureMinMax:a.measureMinMax,getText:()=>p,direction:r,enabledFeatures:{[t$.Image]:!0,[t$.Indicator]:!0,[t$.MiniChart]:!0,[t$.Bar]:!a.isDim&&x}})}}),i})??[];return{totalColumnCount:d,totalRowCount:p,totalPages:f,paginationNeeded:g,totalsPosition:y,columns:b,rows:S}}),iU=_E(rU,e=>e),oU=gg(e=>{const t=e(Yg),n=e(yy),r=e(sy),i=e(my),o=e(Wg),a=YW(t,false,i,o),s=$W(t,n),l=t.qHyperCube.qSize.qcy,c=Math.min(EV,l),u=l>EV&&!!r.active;return{totalsPosition:s,columns:a,rows:[],totalRowCount:l,totalColumnCount:t.qHyperCube.qSize.qcx,totalPages:Math.ceil(l/c),paginationNeeded:u}}),aU={totalsPosition:{atTop:!1,atBottom:!1},columns:[],rows:[],totalRowCount:0,totalColumnCount:0,totalPages:0,paginationNeeded:!1},sU=gg(),lU=gg(e=>{const t=e(vy),n=e(sU);return n||(t?e(iU)??aU:e(oU))}),cU=gg(e=>e(lU).totalsPosition),uU=gg(e=>e(lU).columns),dU=gg(e=>e(uU).length),pU=gg(e=>e(lU).rows),fU=gg(e=>e(lU).totalRowCount),hU=gg(e=>e(lU).totalColumnCount),mU=gg(e=>e(lU).paginationNeeded),gU=gg(e=>{const t=e(_y),n=e(Py),r=e(Yg),i=e(cU),o=e(pU),a=i.atTop,s=function(e,t,n,r){const i=wV(e)?.content,o=SV("content",t,i);o.background=t.background.color;const a=xV(o.fontSize,n,r),s=i?.hoverColor,l=i?.hoverFontColor,c=t.getStyle("object","","straightTableV2.content.hover.backgroundColor"),u=t.getStyle("object","","straightTableV2.content.hover.color"),d=yV(l)||!!u,p=yV(s)||!!c,f=d||p;let h;h=yV(s)?bV(Uh.HOVER,t,s):c||(d?"":Uh.HOVER);const m=f?bV(Gh(h),t,l):"";return{...o,lastRowBottomBorder:a,hoverColors:{background:h,color:m}}}(r,n,o.length,t),l=kV(r,n,!a),c=function(e,t,n){const r=wV(e)?.content,i=SV("content",t,r),{borderBottomColor:o,borderTopColor:a,background:s}=kV(e,t,n);return{...i,borderBottomColor:o,background:s,borderTopColor:a}}(r,n,a);return{body:s,head:l,totals:c}}),yU=(e,t)=>{if(t){const n=e.getColorPickerColor(t);return"none"===n?"transparent":n}},bU=(e,t,n)=>{const{objectColorFromCSS:r,sheetColorFromCSS:i}=e.background,o=yU(e,t?.background),a=e.getStyle("","",n);return{backgroundColor:o||r||a,backgroundFromStyling:o,sheetColorFromCSS:i}},vU=(e,t,n,r=Uh.WHITE)=>{const{backgroundColor:i,backgroundFromStyling:o,sheetColorFromCSS:a}=bU(e,t,n);return nm(o,i,a,r)??r},xU=e=>{switch(typeof e){case"string":return`${parseInt(e,10)}px`;case"number":return`${e}px`;default:return GH}},wU=e=>e?.some(e=>"italic"===e)?"italic":"normal",SU=(e,t)=>void 0===e?t:e.some(e=>"bold"===e)?YH:"normal",kU=e=>!1===e?1:3,CU=e=>e?.some(e=>"underline"===e)?"underline":"none",EU=gg(e=>{const t=e(yy),n=e(vy),r=e(Py),i=e(Yg),o=e(gU),a=e(Wg),{header:s,dimensionValues:l,measureValues:c,totalValues:u,subTotalValues:d,nullValues:p,dimensionNullValues:f,grid:h,content:m}=wV(i)??{},g=a("VNA-670-SEPARATE_NULL_VALUE_STYLING"),y=n?Uh.WHITE:Uh.TRANSPARENT,b=vU(r,s,"object.straightTableV2.dimension.label.name.backgroundColor",y),v=t?.maxLineCount??m?.rowHeight??r.getStyle("object.straightTableV2","grid","lineClamp"),x=(g?f:void 0)??p;return{header:{fontFamily:s?.fontFamily??r.getStyle("object.straightTableV2.dimension","label.name","fontFamily")??o.head.fontFamily??KH,fontSize:xU(s?.fontSize??r.getStyle("object.straightTableV2.dimension","label.name","fontSize")??o.head.fontSize),fontStyle:wU(s?.fontStyle),fontWeight:SU(s?.fontStyle,YH),textDecoration:CU(s?.fontStyle),color:yU(r,s?.fontColor)??r.getStyle("object.straightTableV2.dimension","label.name","color")??o.head.color??Uh.TEXT,background:b},headerMenuHoverBackground:Kh(b,Am),headerMenuActiveBackground:Kh(b,Im),dimension:{values:{fontFamily:l?.fontFamily??r.getStyle("object.straightTableV2.dimension","label.value","fontFamily")??o.body.fontFamily??KH,fontSize:xU(l?.fontSize??m?.fontSize??r.getStyle("object.straightTableV2.dimension","label.value","fontSize")??o.body.fontSize),fontStyle:wU(l?.fontStyle),fontWeight:SU(l?.fontStyle,"normal"),textDecoration:CU(l?.fontStyle),color:yU(r,l?.fontColor)??yU(r,m?.fontColor)??r.getStyle("object.straightTableV2.dimension","label.value","color")??o.body.color??Uh.TEXT,background:bU(r,l,"object.straightTableV2.dimension.label.value.backgroundColor").backgroundColor??o.body.background??Uh.TRANSPARENT}},measure:{values:{fontFamily:c?.fontFamily??r.getStyle("object.straightTableV2.measure","label.value","fontFamily")??o.body.fontFamily??KH,fontSize:xU(c?.fontSize??m?.fontSize??r.getStyle("object.straightTableV2.measure","label.value","fontSize")??o.body.fontSize),fontStyle:wU(c?.fontStyle),fontWeight:SU(c?.fontStyle,"normal"),textDecoration:CU(c?.fontStyle),color:yU(r,c?.fontColor)??yU(r,m?.fontColor)??r.getStyle("object.straightTableV2.measure","label.value","color")??o.body.color??Uh.TEXT,background:bU(r,c,"object.straightTableV2.measure.label.value.backgroundColor").backgroundColor??o.body.background??Uh.TRANSPARENT}},totalRow:{fontFamily:u?.fontFamily??r.getStyle("object.straightTableV2.total","label.value","fontFamily")??o.totals.fontFamily??KH,fontSize:xU(u?.fontSize??m?.fontSize??r.getStyle("object.straightTableV2.total","label.value","fontSize")??o.totals.fontSize),fontStyle:wU(u?.fontStyle),fontWeight:SU(u?.fontStyle,YH),textDecoration:CU(u?.fontStyle),color:yU(r,u?.fontColor)??yU(r,m?.fontColor)??r.getStyle("object.straightTableV2.total","label.value","color")??o.totals.color??Uh.TEXT,background:vU(r,u,"object.straightTableV2.total.label.value.backgroundColor",y)},subTotalRow:{fontFamily:d?.fontFamily??r.getStyle("object.straightTableV2.subTotal","label.value","fontFamily")??o.totals.fontFamily??KH,fontSize:xU(d?.fontSize??m?.fontSize??r.getStyle("object.straightTableV2.subTotal","label.value","fontSize")??o.totals.fontSize),fontStyle:wU(d?.fontStyle),fontWeight:SU(d?.fontStyle,YH),textDecoration:CU(d?.fontStyle),color:yU(r,d?.fontColor)??yU(r,m?.fontColor)??r.getStyle("object.straightTableV2.subTotal","label.value","color")??o.totals.color??Uh.TEXT,background:vU(r,d,"object.straightTableV2.subTotal.label.value.backgroundColor",y)},dimensionNull:{fontStyle:wU(x?.fontStyle),fontWeight:SU(x?.fontStyle,"normal"),textDecoration:CU(x?.fontStyle),color:yU(r,x?.fontColor)??yU(r,m?.fontColor)??r.getStyle("object.straightTableV2.null","label.value","color")??o.body.color??Uh.TEXT,background:yU(r,x?.background)??r.getStyle("","","object.straightTableV2.null.label.value.backgroundColor")??Uh.NULL_VALUE_BACKGROUND},measureNull:{fontStyle:wU(p?.fontStyle),fontWeight:SU(p?.fontStyle,"normal"),textDecoration:CU(p?.fontStyle),color:yU(r,p?.fontColor)??yU(r,m?.fontColor)??r.getStyle("object.straightTableV2.null","label.value","color")??o.body.color??Uh.TEXT,background:yU(r,p?.background)??r.getStyle("","","object.straightTableV2.null.label.value.backgroundColor")??Uh.NULL_VALUE_BACKGROUND},grid:{contentLineClamp:v??kU(i.multiline?.wrapTextInCells),headerLineClamp:kU(i.multiline?.wrapTextInHeaders),border:yU(r,h?.border)??r.getStyle("object.straightTableV2","grid","borderColor")??(r.background.isDark?Uh.DARK_MODE_BORDER:Uh.BORDER_MEDIUM),divider:yU(r,h?.divider)??r.getStyle("object.straightTableV2.grid","","divider.borderColor")??Uh.BORDER_HEAVY,hoverColors:{color:yU(r,m?.hoverFontColor)??r.getStyle("object.straightTableV2","","grid.hover.color")??o.body.hoverColors?.color,background:yU(r,m?.hoverColor)??r.getStyle("object.straightTableV2","","grid.hover.backgroundColor")??o.body.hoverColors?.background},zebraStripes:{show:!!h?.zebraStripes?.show,odd:{color:yU(r,h?.zebraStripes?.color?.odd),background:yU(r,h?.zebraStripes?.background?.odd)},even:{color:yU(r,h?.zebraStripes?.color?.even),background:yU(r,h?.zebraStripes?.background?.even)},overrideDimNullValueBackground:void 0===yU(r,x?.background),overrideDimNullValueColor:void 0===yU(r,x?.fontColor),overrideMeasNullValueBackground:void 0===yU(r,p?.background),overrideMeasNullValueColor:void 0===yU(r,p?.fontColor)},lastRowBottomBorder:o.body.lastRowBottomBorder},selectedColors:Yh(r),contentStaticLineCount:v}}),MU=gg(e=>{const t=e(EU);return Math.max(hV(t.header.fontSize)+8,32)}),RU=gg(e=>{const t=e(EU),n=hV(t.totalRow.fontSize);return Math.max(n+9,24)}),_U=gg(e=>{const t=e(EU),n=e(Jg),r=e(Qg);return Math.max(n>0?hV(t.dimension.values.fontSize):0,r>0?hV(t.measure.values.fontSize):0)}),AU=gg(e=>{const t=e(EU),n=e(_U),r=(t.contentStaticLineCount||1)*n;return Math.max(r+9,24)}),IU=gg(e=>{const t=e(EU),n=hV(t.subTotalRow.fontSize),r=(t.contentStaticLineCount||1)*n;return Math.max(r+9,24)}),PU=(e,t,n)=>{if(!e.length)return[];const r=[],i=[];let o=t;if(e.forEach((e,a)=>{const{columnWidth:{type:s,pixels:l,percentage:c},label:u,qApprMaxGlyphCount:d,totalInfo:p}=e;let f=0;const h=()=>{r[a]=Math.min(Rm.PixelsMax,Math.max(Rm.PixelsMin,f)),o-=r[a]};switch(s){case _m.Pixels:f=(e=>void 0===e||Number.isNaN(+e)?Rm.PixelsDefault:+e)(l),h();break;case _m.Percentage:f=(e=>void 0===e||Number.isNaN(+e)?Rm.PercentageDefault:+e)(c)/100*t,h();break;case _m.FitToContent:e.representation?.type===t$.Image?i.push(a):(f=n(u,p,d,e.isLocked,e.isActivelySorted,e.isDim,e.isCyclic),h());break;case _m.Auto:i.push(a);break;default:throw new Error(`${s} is not a valid column width type`)}}),i.length){const e=o/i.length;i.forEach(t=>{r[t]=Math.max(Rm.AutoMinTable,e)})}return r},TU=gg(e=>{const t=e(EU),n=e(lU).totalsPosition,r=e(ny),{measureText:i}=e(WB({...t.header,fontWeight:YH})),{measureText:o}=e(WB({...t.totalRow,fontWeight:YH})),{estimateWidth:a}=e(WB(t.dimension.values)),{estimateWidth:s}=e(WB(t.measure.values)),l=n.atBottom||n.atTop;return(e,t,n,c,u,d,p)=>{let f;if(r){const t=4;let n=25;n+=t+24,c&&(n+=20+t),u&&(n+=20),f=i(e)+n}else{let t=9;t+=16,p&&(t+=iV),t+=iV,t+=iV,f=i(e)+t}const h=d?a:s;return Math.max(f,l?o(t)+24+1:0,h(n))}}),DU=gg(null),OU=gg(e=>{const t=e(lU),n=e(Ry).width,r=e(fV),i=e(TU);return PU(t.columns,n-r,i)}),NU=gg(e=>e(DU)??e(OU),(e,t,n)=>{t(DU,n)}),qU=ZE(e=>{const t=e(GB);!1===e(dV)&&t.emit("done-adjusting-column-width")}),LU=ZE((e,t)=>{e(Yg),t(DU,null)}),jU=gg(e=>e(NU).reduce((e,t)=>e+t,0)),zU=({children:e})=>(_g(LU),_g(qU),e);function FU(e){const t=Hh();return t.components?.MuiTable?.styleOverrides&&(t.components.MuiTable.styleOverrides.root={}),Ml({...t,direction:e})}const $U={width:"100%",height:"100%",color:"transparent",background:"transparent",borderColor:"transparent"},BU={border:0,boxShadow:"none",borderRadius:0,outline:0,width:0,height:0,background:"transparent",cursor:"pointer",visibility:"hidden"},HU=Ul("input",{shouldForwardProp:e=>"isLastColumn"!==e&&"hoverColor"!==e})(({isLastColumn:e,hoverColor:t,dir:n})=>({position:"absolute",display:"flex",height:"100%",top:0,marginLeft:"-4px",marginRight:"rtl"===n?"-4px":void 0,touchAction:"none",cursor:"col-resize",pointerEvents:"auto",width:(e?4:9)+"px",justifyContent:e?"flex-end":"center",outline:"none",appearance:"none",WebkitAppearance:"none",backgroundColor:"transparent","&::-webkit-slider-runnable-track":{...$U},"&::-moz-range-track":{...$U},"&::-ms-track":{...$U},"&::-webkit-slider-thumb":{appearance:"none",WebkitAppearance:"none",...BU},"&::-moz-range-thumb":{...BU},"&::-ms-thumb":{...BU},"&: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"}})),VU=({columnWidth:e,keyValue:t,isLastColumn:n,isPivot:r,hoverColor:i,updateWidthCallback:o,confirmWidthCallback:a,handleBlur:s,setIsAdjustingWidth:l,isLeftColumn:c,accessibilityRelatedArgs:u,direction:d="ltr"})=>{const p=bm({translator:u.translator}),f=Yt.useRef({initWidth:e,columnWidth:e,initX:0}),h=n?0:1,m=r&&!c,g=()=>m?f.current.columnWidth-h:"100%",y={left:"rtl"!==d?g():void 0,right:"rtl"===d?g():void 0},b=t=>{f.current={initWidth:e,columnWidth:e,initX:t??f.current.initX}};gm(()=>{m&&b()},[e]);const v=e=>{const t=Math.max(e,Rm.PixelsMin);f.current.columnWidth=t,o(t)},x=()=>{if(f.current.columnWidth!==f.current.initWidth){const e={type:_m.Pixels,pixels:f.current.columnWidth};a(e)}l?.(!1)},w=e=>{const t="rtl"===d?f.current.initWidth+f.current.initX-e.clientX:f.current.initWidth+e.clientX-f.current.initX;v(t)},S=e=>{Zh(e),document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S),x()},k=e=>{const t="rtl"===d?f.current.initWidth+-f.current.initX-e.touches[0].clientX:f.current.initWidth+e.touches[0].clientX-f.current.initX;v(t)},C=e=>{Zh(e),document.removeEventListener("touchmove",k),document.removeEventListener("touchend",C),x()},E=!r&&s?e=>{if(e.key===Em.Left||e.key===Em.Right){Zh(e);const t=5,n=e.key===Em.Left?t:-t,r="rtl"===d?n:-n;l?.(!0),v(f.current.columnWidth+r)}else e.key===Em.Space||e.key===Em.Enter?(Zh(e),s(e),l?.(!1),x()):e.key===Em.Esc&&(Zh(e),s(e),l?.(!1),v(f.current.initWidth))}:void 0,M=p.get("NebulaTableUtils.ColumnAdjuster.ColumnNameLabel",[String(u.columnLabel)]);return lt.jsx(HU,{style:y,hoverColor:i,isLastColumn:n,className:Mm,"data-testid":Mm,onMouseDown:e=>{Zh(e),document.addEventListener("mousemove",w),document.addEventListener("mouseup",S),l?.(!0),b(e.clientX)},onDoubleClick:()=>{a({type:_m.FitToContent})},onTouchStart:e=>{1===e.touches.length&&(Zh(e),document.addEventListener("touchmove",k),document.addEventListener("touchend",C),l?.(!0),b(e.touches[0].clientX))},onKeyDown:E,onBlur:s,onFocus:()=>{b()},type:"range",tabIndex:-1,"aria-label":M,"aria-valuemin":Rm.PixelsMin,"aria-valuemax":Rm.PixelsMax,"aria-valuenow":Number(e.toFixed(1)),dir:d},t)},WU=(e,t)=>lt.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:lt.jsx("path",{d:"M15 4H1V2h14zm0 10H1v-2h14zm0-5H1V7h14z"})}),UU=Yt.forwardRef(WU),GU=({model:e,headerData:t})=>{if(e&&"setActiveField"in e&&void 0!==t.dimensionInfoIndex){const n=t.dimensionInfoIndex;return async t=>{try{await e.setActiveField("/qHyperCubeDef",n,t)}catch(e){console.error(e)}}}return null},YU=Ul(Xu,{shouldForwardProp:e=>"rightAligned"!==e&&"shouldShowMenuIcon"!==e&&"isAccessibleHeader"!==e})(({rightAligned:e,shouldShowMenuIcon:t,isAccessibleHeader:n})=>({...e?{marginRight:"auto"}:{marginLeft:"auto"},height:n?24:void 0,display:t?"flex":"none",fontWeight:"bold",width:n?"100%":void 0,alignItems:"center",justifyContent:"center"})),KU=Ul(UU,{shouldForwardProp:e=>"isInteractionsActive"!==e})(({isInteractionsActive:e})=>({minWidth:"unset",position:"relative",cursor:e?"pointer":"default"})),XU=Ul(pf)(({theme:e})=>({".MuiList-root":{padding:e.spacing(.5,0)}})),JU=Ul(Vd)(({theme:e})=>({"&.MuiDivider-root":{margin:e.spacing(.5)}})),QU=Ul(yf)(({theme:e})=>({fontSize:"12px",height:24,fontWeight:"bold",padding:`${e.spacing(.25,2)} !important`,marginBottom:e.spacing(.5)})),ZU=Ul(yf,{shouldForwardProp:e=>"isSubMenu"!==e&&"isActive"!==e})(({theme:e,isSubMenu:t,isActive:n})=>({width:`calc(220px - ${e.spacing(1)} - ${t?10:0}px)`,maxHeight:32,borderRadius:`${e.spacing(.5)} !important`,margin:`${e.spacing(.25,.5)} !important`,padding:`${e.spacing(1,1.5)} !important`,display:"flex !important",justifyContent:"space-between !important","&&:focus":{boxShadow:"rgb(23, 127, 230) 0px 0px 0px 2px"},position:"relative !important",overflow:"hidden",boxSizing:"border-box !important",background:n?"rgba(0, 0, 0, 0.05)":"transparent"})),eG=Ul("div",{shouldForwardProp:e=>!["direction","isPagination"].includes(e)})(({theme:e,direction:t,isPagination:n})=>({position:"absolute",width:e.spacing(.5),height:16,left:0,right:n||"rtl"!==t?void 0:0,top:"50%",transform:"TranslateY(-50%)",borderRadius:"0 2px 2px 0",background:"#01873d"})),tG=Ul("div")(()=>({display:"flex",justifyContent:"space-between",alignItems:"center",maxWidth:"100%"})),nG=Ul(pu)(()=>({fontFamily:'"Source Sans Pro", HelveticaNeue, "Helvetica Neue", Helvetica, Arial, sans-serif',fontSize:"14px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"})),rG=Ul(jp,{shouldForwardProp:e=>!["direction","isPagination"].includes(e)})(({theme:e,direction:t,isPagination:n})=>({width:16,minWidth:"unset !important",marginRight:n||"rtl"!==t?e.spacing(1.5):0,marginLeft:n||"rtl"!==t?void 0:e.spacing(1.5),lineHeight:0})),iG=(e,t)=>lt.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:lt.jsx("path",{d:"M8.5 8 4 3.5 5.5 2l6 6-6 6L4 12.5z"})}),oG=Yt.forwardRef(iG),aG=e=>{const t=e.nextElementSibling;return t?"HR"===t.tagName?aG(t):t:e.parentElement?.children?.[0]},sG=e=>{const t=e.previousElementSibling;if(!t){const t=e.parentElement?.children?.length;return e.parentElement?.children?.[t-1]}return"HR"===t.tagName?sG(t):t},lG=e=>{const{key:t,currentTarget:n}=e,r=document.activeElement??n;if(t===Em.Down||t===Em.Up){const n=e=>t===Em.Down?aG(e):sG(e);e.preventDefault(),e.stopPropagation();let i=n(r);for(;i;){if("true"!==i.ariaDisabled){i.focus();break}i=n(i)}}},cG=(e,t)=>e.map(e=>e.map(e=>({...e.groupHeading?{groupHeading:e.groupHeading}:{},items:e.items.map(({onClick:e,...n})=>({...n,...e?{onClick:async n=>{Object.entries(t).forEach(([,e])=>{e(!1)}),await e(n)}}:{}}))})));let uG={};const dG=({autoFocus:e,id:t,onClick:n,itemTitle:r,icon:i,enabled:o,subMenus:a,isSubMenu:s,isActive:l,direction:c,isPagination:u})=>{const[d,p]=Yt.useState(!1),f=Kt.useRef(null),h=Yt.useCallback(e=>{e.stopPropagation(),p(!1)},[p]);return lt.jsxs(lt.Fragment,{children:[lt.jsxs(ZU,{ref:a?f:null,"data-testid":`menu-item-${t}`,className:"nebula-table-utils-head-menu-item",onClick:async e=>{"keyup"!==e.type&&(n&&(await n(e),uG={}),a?.length&&(p(!0),uG[r]=p,e.stopPropagation()))},disabled:!o,autoFocus:e,isSubMenu:!!s,isActive:!!l,onKeyDown:lG,children:[l?lt.jsx(eG,{direction:c,isPagination:u}):null,lt.jsxs(tG,{children:[lt.jsx(rG,{direction:c,isPagination:u,children:lt.jsx(i,{})}),lt.jsx(nG,{variant:"body2",children:r})]}),a?.length?lt.jsx(oG,{}):null]},t),a?.length?lt.jsx(mG,{isSubMenu:!0,open:d,anchorEl:f.current,onClose:h,menuGroups:cG(a,uG),transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"top"},direction:c,isPagination:u}):null]})},pG=({menuGroup:e,isSubMenu:t,direction:n,isPagination:r})=>e.map(e=>[[e.groupHeading&<.jsx(QU,{disabled:!0,style:{opacity:1},children:e.groupHeading},e.groupHeading),e.items.map(e=>lt.jsx(dG,{...e,isSubMenu:t,direction:n,isPagination:r},e.id))].filter(Boolean)]),fG=({itemGroups:e,isSubMenu:t,direction:n,isPagination:r})=>e.map((i,o)=>[pG({menuGroup:i,isSubMenu:t,direction:n,isPagination:r}),o<e.length-1?lt.jsx(JU,{"data-testid":"group-divider",variant:"middle"}):void 0]),hG={appear:0,enter:0,exit:0},mG=({anchorEl:e,open:t,onClose:n,menuGroups:r,transformOrigin:i,anchorOrigin:o,isSubMenu:a,direction:s,isPagination:l})=>r.length?lt.jsx(XU,{className:Sm,open:t,anchorEl:e,onClose:n,transitionDuration:hG,MenuListProps:{id:km},...o?{anchorOrigin:o}:{},...i?{transformOrigin:i}:{},dir:s,children:fG({itemGroups:r,isSubMenu:a,direction:s,isPagination:l})}):null,gG=({qLibraryId:e,fieldId:t,searchRelatedArgs:n,selectionRelatedArgs:r,direction:i,onPopoverClose:o})=>Yt.useCallback(()=>{const a=e?{qLibraryId:e,type:"dimension"}:t;if(n?.embed){const{embed:e,listboxRef:t}=n;e.__DO_NOT_USE__.popover(t.current,a,{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"rtl"===i?"right":"left"},sortCriteria:n.sortCriteria,stateName:r?.qStateName,direction:i,onPopoverClose:o})}},[e,t,n,r?.qStateName,i,o]),yG=(e,t)=>({qInfo:{qType:"tableListbox"},qListObjectDef:Boolean(t.qLibraryId)?{qLibraryId:t.qLibraryId,qStateName:e}:{qDef:{qFieldDefs:[t.fieldId]},qStateName:e}}),bG=(e,t)=>e.some(e=>t[e]>0),vG={canSelectAll:!1,canClearSelections:!1,canSelectPossible:!1,canSelectAlternative:!1,canSelectExcluded:!1},xG=({open:e,qStateName:t="$",headerData:n,app:r})=>{const[i,o]=Yt.useState(null),[a,s]=Yt.useState(vG);return gm(()=>{e||(s(vG),o(null))},[e]),Yt.useEffect(()=>{if(!r?.createSessionObject||!n.isDim||!e)return()=>{};let i,a=!1;const l=()=>{i&&r.destroySessionObject(i)};return(async()=>{try{const e=yG(t,n),c=await r.createSessionObject(e),u=await c.getLayout(),{qStateCounts:d}=u.qListObject?.qDimensionInfo??{};i=u.qInfo?.qId,a?l():(o(c),d&&s((e=>({canSelectAll:bG(["qOption","qAlternative","qExcluded","qDeselected"],e),canClearSelections:bG(["qSelected"],e),canSelectPossible:bG(["qOption"],e),canSelectAlternative:bG(["qAlternative"],e),canSelectExcluded:bG(["qAlternative","qExcluded"],e)}))(d)))}catch(e){console.error(e)}})(),()=>{a=!0,l()}},[e,r,n,t]),{fieldInstance:i,selectionActionsEnabledStatus:a}},wG=(e,t)=>lt.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:lt.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"})}),SG=Yt.forwardRef(wG),kG=(e,t)=>lt.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:lt.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"})}),CG=Yt.forwardRef(kG),EG=(e,t)=>lt.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:lt.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"})}),MG=Yt.forwardRef(EG),RG=(e,t)=>lt.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:lt.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"})}),_G=Yt.forwardRef(RG),AG=(e,t)=>lt.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:lt.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"})}),IG=Yt.forwardRef(AG),PG=(e,t)=>lt.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:lt.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"})}),TG=Yt.forwardRef(PG),DG=(e,t)=>lt.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:lt.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"})}),OG=Yt.forwardRef(DG),NG=(e,t)=>lt.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:lt.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"})}),qG=Yt.forwardRef(NG),LG=(e,t)=>lt.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:lt.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"})}),jG=Yt.forwardRef(LG),zG=(e,t)=>lt.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:lt.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"})}),FG=Yt.forwardRef(zG),$G=(e,t)=>lt.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:lt.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"})}),BG=Yt.forwardRef($G),HG=(e,t)=>lt.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:lt.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"})}),VG=Yt.forwardRef(HG),WG=(e,t)=>lt.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:lt.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"})}),UG=Yt.forwardRef(WG);let GG=function(e){return e.Sorting="sorting",e.Searching="searching",e.Selections="selections",e.AdjusterHeaderSize="adjustHeaderSize",e}({});const YG="/qListObjectDef",KG=({headerData:e,translator:t,menuAvailabilityFlags:n,setOpen:r,sortFromMenu:i,interactions:o,embedListbox:a,fieldInstance:s,selectionActionsEnabledStatus:l,anchorRef:c,focusColumnAdjuster:u,setActiveFieldCallback:d,expandOrCollapseArgs:p})=>{const f=[];if(n[GG.Sorting]){const{isActivelySorted:n,sortDirection:o}=e,{ascendingEnabled:a,descendingEnabled:s}=(({isActivelySorted:e,sortDirection:t,isPivot:n,isSortedByFirstMeasure:r})=>{let i=!n&&!e||"D"===t,o=!n&&!e||"A"===t;return r&&(i=!1,o=!1),{ascendingEnabled:i,descendingEnabled:o}})(e);f.push([{groupHeading:t.get("NebulaTableUtils.MenuGroupLabel.Sorting"),items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SortAscending"),onClick:async e=>{e.stopPropagation(),await(i?.(e,"A")),r(!1)},icon:SG,enabled:a,isActive:!!n&&"A"===o,autoFocus:a},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SortDescending"),onClick:async e=>{e.stopPropagation(),await(i?.(e,"D")),r(!1)},icon:_G,enabled:s,isActive:!!n&&"D"===o,autoFocus:!a&&s}]}])}if(e.isCyclic&&d){const t=[];t.push([{items:[{id:1,itemTitle:e.groupDimensionLabels[e.groupDimensionPos],enabled:!0,icon:OG,subMenus:[[{items:e.groupDimensionLabels.map((t,n)=>({id:n+1,itemTitle:t,onClick:e=>{e.stopPropagation(),r(!1),d(n)},enabled:!0,icon:yF,isActive:e.groupDimensionPos===n}))}]]}]}]),t.length>0&&f.push(...t)}if(e.isDim&&o?.select){const i=[];n[GG.Searching]&&i.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Search"),onClick:e=>{e.stopPropagation(),r(!1),a()},icon:qG,enabled:!0}]}]),!e.isLocked&&n[GG.Selections]&&i.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Selections"),icon:UG,enabled:!!s,subMenus:[[{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectAll"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectAll(YG))},icon:jG,enabled:l.canSelectAll},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectPossible"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectPossible(YG))},icon:VG,enabled:l.canSelectPossible},{id:3,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectAlternative"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectAlternative(YG))},icon:FG,enabled:l.canSelectAlternative},{id:4,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectExcluded"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectExcluded(YG))},icon:BG,enabled:l.canSelectExcluded}]}],[{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.ClearSelections"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.clearSelections(YG))},icon:CG,enabled:l.canClearSelections}]}]]}]}]),p&&!p.alwaysFullyExpanded&&f.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Expand"),onClick:async e=>{e.stopPropagation(),e.preventDefault(),r(!1),await p.expandCallback()},icon:TG,enabled:!0},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Collapse"),onClick:async e=>{e.stopPropagation(),e.preventDefault(),r(!1),await p.collapseCallback()},icon:IG,enabled:!0}]}]),i.length>0&&f.push(...i)}return n[GG.AdjusterHeaderSize]&&f.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.AdjustColumnSize"),onClick:e=>{e.stopPropagation(),e.preventDefault(),r(!1),u?.(c)},icon:MG,enabled:!0}]}]),f},XG=({open:e,setOpen:t,anchorRef:n,headerData:r,translator:i,interactions:o,menuAvailabilityFlags:a,shouldShowMenuIcon:s=!0,sortRelatedArgs:l,searchRelatedArgs:c,selectionRelatedArgs:u,adjustHeaderSizeRelatedArgs:d,expandOrCollapseArgs:p,model:f,direction:h="ltr",isPagination:m,isAccessibleHeader:g,iconSize:y=vm})=>{const b=Yt.useRef(null),v=bm({translator:i}),{qLibraryId:x,fieldId:w,headTextAlign:S}=r,k=u?.app,{fieldInstance:C,selectionActionsEnabledStatus:E}=xG({open:e,headerData:r,app:k,qStateName:u?.qStateName}),M=GU({model:f,headerData:r}),R=gG({qLibraryId:x,fieldId:w,searchRelatedArgs:c,selectionRelatedArgs:u,direction:h}),_=Yt.useCallback(e=>{e.stopPropagation(),t(!1)},[t]),A=Yt.useCallback(e=>{e.stopPropagation(),t(e=>!e)},[t]);return o.active?lt.jsxs(YU,{rightAligned:"right"===S,shouldShowMenuIcon:s,className:wm,onClick:!1===g?A:void 0,ref:b,isAccessibleHeader:g,children:[s?lt.jsx(KU,{height:y,className:xm,"data-testid":xm,isInteractionsActive:o.active??!1,children:lt.jsx(UU,{})}):null,lt.jsx(mG,{open:e,anchorEl:!1===g?b.current:n.current,onClose:_,menuGroups:KG({headerData:r,translator:v,menuAvailabilityFlags:a,setOpen:t,...l,embedListbox:R,interactions:o,fieldInstance:C,selectionActionsEnabledStatus:E,anchorRef:n,focusColumnAdjuster:d?.focusColumnAdjuster,setActiveFieldCallback:M,expandOrCollapseArgs:p}),direction:h,isPagination:m})]}):null},JG=e=>e.isDark?{background:e.color,borderColor:Uh.DARK_MODE_BORDER,color:Uh.DARK_MODE_TEXT,disabledColor:Uh.DARK_MODE_DISABLED,iconColor:Uh.DARK_MODE_TEXT}:{background:e.color,borderColor:Uh.BORDER_MEDIUM,color:Uh.TEXT,disabledColor:Uh.DISABLED},QG=Ul(Xu,{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}`})),ZG=Ul(Jf,{shouldForwardProp:e=>"footerStyle"!==e})(({footerStyle:e,theme:t})=>({background:"inherit",marginRight:t.spacing(1),color:e.color,"& .MuiNativeSelect-icon, .MuiNativeSelect-select":{color:e.iconColor}})),eY=Ul(ad,{shouldForwardProp:e=>"disabledCondition"!==e&&"footerStyle"!==e})(({disabledCondition:e,footerStyle:t,theme:n})=>({color:e?t.disabledColor:t.color,cursor:e?"default":"pointer",marginLeft:n.spacing(1)})),tY=Ul(pu)(({theme:e})=>({color:"inherit",margin:e.spacing(0,1,0,1)})),nY=({children:e,footerContainer:t,interactions:n,theme:r,paginationNeeded:i=!0})=>{const o=Yt.useMemo(()=>JG(r.background),[r]);if(!n.active)return null;const a=i?lt.jsx(QG,{footerStyle:o,children:e}):null;return t?gc.createPortal(e,t):a},rY=(e,t)=>lt.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:lt.jsx("path",{d:"m12 2 1.5 1.5L9 8l4.5 4.5L12 14 6 8zM4 2v12H2V2z"})}),iY=Yt.forwardRef(rY),oY=(e,t)=>lt.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:lt.jsx("path",{d:"m3.5 2 6 6-6 6L2 12.5 6.5 8 2 3.5zM14 2v12h-2V2z"})}),aY=Yt.forwardRef(oY),sY={},lY=Yt.createContext(sY),cY=()=>Yt.useContext(lY),uY=({children:e,direction:t,pageInfo:n,handleChangeRowsPerPage:r,footerContainer:i,isSelectionMode:o,handleChangePage:a,totalRowCount:s,totalColumnCount:l,totalPages:c,keyboard:u,translator:d,theme:p,interactions:f,rect:h,layout:m,visibilityThreshold:g})=>{const y=(e=>!e.enabled||e.active)(u)?0:-1,b=Yt.useMemo(()=>JG(p.background),[p]),v=i?i.getBoundingClientRect().width:h.width,x=bm({translator:d}),w=Yt.useMemo(()=>({direction:t,pageInfo:n,handleChangeRowsPerPage:r,footerContainer:i,isSelectionMode:o,handleChangePage:a,totalRowCount:s,totalColumnCount:l,totalPages:c,keyboard:u,translator:x,theme:p,interactions:f,rect:h,layout:m,footerStyle:b,tabIndex:y,width:v,visibilityThreshold:g}),[t,n,r,i,o,a,s,l,c,u,x,p,f,h,m,b,y,v,g]);return lt.jsx(lY.Provider,{value:w,children:e})},dY=({disabledCondition:e,pageNumber:t,type:n,footerStyle:r,handleChangePage:i,translator:o,interactions:a,tabIndex:s})=>({footerStyle:r,disabledCondition:e,size:"small","data-testid":"pagination-action-icon-button","aria-disabled":e,"aria-label":o.get(`NebulaTableUtils.Pagination.${n}`),title:a.passive?o.get(`NebulaTableUtils.Pagination.${n}`):void 0,tabIndex:s,onClick:e?void 0:()=>{i(t)}});let pY=function(e){return e.FirstPage="FirstPage",e.LastPage="LastPage",e.NextPage="NextPage",e.PreviousPage="PreviousPage",e}({}),fY=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 hY=()=>{const{direction:e,pageInfo:t,width:n,interactions:r,visibilityThreshold:i,footerStyle:o,handleChangePage:a,translator:s,tabIndex:l}=cY(),c=0===t.page,u=dY({type:pY.FirstPage,disabledCondition:c,pageNumber:0,footerStyle:o,handleChangePage:a,translator:s,interactions:r,tabIndex:l});return n<=(i?.firstPage||fY.FirstPage)?null:lt.jsx(eY,{...u,disabled:!r.active,children:"rtl"===e?lt.jsx(aY,{height:vm}):lt.jsx(iY,{height:vm})})},mY=(e,t,n=!1)=>{n&&e.key===Em.Tab&&!e.shiftKey&&(Zh(e),Qh(e.target,t,!1))},gY=()=>{const{direction:e,pageInfo:t,keyboard:n,totalPages:r,isSelectionMode:i,width:o,interactions:a,visibilityThreshold:s,footerStyle:l,handleChangePage:c,translator:u,tabIndex:d}=cY(),p=t.page>=r-1,f=dY({type:pY.LastPage,disabledCondition:p,pageNumber:r-1,footerStyle:l,handleChangePage:c,translator:u,interactions:a,tabIndex:d}),h=n.enabled?e=>{mY(e,n,i)}:void 0;return o<=(s?.lastPage||fY.LastPage)?null:lt.jsx(eY,{...f,onKeyDown:h,disabled:!a.active,children:"rtl"===e?lt.jsx(iY,{height:vm}):lt.jsx(aY,{height:vm})})},yY=(e,t)=>lt.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:lt.jsx("path",{d:"m7 8 4.5 4.5L10 14 4 8l6-6 1.5 1.5z"})}),bY=Yt.forwardRef(yY),vY=()=>{const{direction:e,pageInfo:t,keyboard:n,totalPages:r,isSelectionMode:i,width:o,interactions:a,footerStyle:s,handleChangePage:l,translator:c,tabIndex:u}=cY(),d=t.page>=r-1,p=dY({type:pY.NextPage,disabledCondition:d,pageNumber:t.page+1,footerStyle:s,handleChangePage:l,translator:c,interactions:a,tabIndex:u}),f=!(o>fY.FirstPage&&o>fY.LastPage)&&n.enabled?e=>{mY(e,n,i)}:void 0;return lt.jsx(eY,{...p,onKeyDown:f,disabled:!a.active,children:"rtl"===e?lt.jsx(bY,{height:vm}):lt.jsx(oG,{height:vm})})},xY=()=>{const{direction:e,pageInfo:t,interactions:n,footerStyle:r,handleChangePage:i,translator:o,tabIndex:a}=cY(),s=0===t.page,l=dY({type:pY.PreviousPage,disabledCondition:s,pageNumber:t.page-1,footerStyle:r,handleChangePage:i,translator:o,interactions:n,tabIndex:a});return lt.jsx(eY,{...l,disabled:!n.active,children:"rtl"===e?lt.jsx(oG,{height:vm}):lt.jsx(bY,{height:vm})})},wY=()=>{const{translator:e,width:t,pageInfo:n,totalRowCount:r,visibilityThreshold:i}=cY(),{page:o,rowsPerPage:a}=n;if(t<=(i?.displayedRowsLabel||fY.DisplayedRowsLabel))return null;const s=e.get("NebulaTableUtils.Pagination.DisplayedRowsLabel",[`${o*a+1} - ${Math.min((o+1)*a,r)}`,r.toString()]);return lt.jsx(tY,{variant:"caption",dir:"ltr",children:s})},SY=({name:e,value:t,options:n,handleChange:r})=>{const{layout:i,footerStyle:o,translator:a,tabIndex:s,interactions:l}=cY(),c=i.qInfo.qId,u=a.get(`NebulaTableUtils.Pagination.${e}`),d=`${e}-dropdown`,p=`${d}-label-${c}`,f={tabIndex:s,id:`${d}-${c}`,"data-testid":d,"aria-labelledby":p};return lt.jsxs(lt.Fragment,{children:[lt.jsxs(tY,{variant:"caption",id:p,children:[u,":"]}),lt.jsx(ZG,{footerStyle:o,size:"small",native:!0,value:t,onChange:r,inputProps:f,disabled:!l.active,children:n})]})},kY=()=>{const{pageInfo:e,isSelectionMode:t,totalColumnCount:n,width:r,handleChangeRowsPerPage:i,visibilityThreshold:o}=cY();if(!(!!e.rowsPerPageOptions?.length&&!t&&r>(o?.rowsPerPage||fY.RowsPerPage)&&n<=100)||void 0===e.rowsPerPageOptions)return null;const a=lt.jsx(lt.Fragment,{children:e.rowsPerPageOptions.map(e=>lt.jsx("option",{value:e,children:e},e))});return lt.jsx(SY,{name:"RowsPerPage",value:e.rowsPerPage,options:a,handleChange:e=>{i?.(+e.target.value)}})},CY=1e3,EY="…",MY=({totalPages:e,page:t})=>{const n=Math.min(e,CY),r=n<e&&t>500,i=r?Math.min(500+t,e):n,o=r?Math.max(0,i-CY):0,a=Array.from(Array(n).keys()).map(e=>{const t=e+o;return lt.jsx("option",{value:t,children:t+1},t)});return o>0&&a.unshift(lt.jsx("option",{value:EY,disabled:!0,children:EY},"startMoreOptions")),i<e-1&&a.push(lt.jsx("option",{value:EY,disabled:!0,children:EY},"endMoreOptions")),lt.jsx(lt.Fragment,{children:a})},RY=()=>{const{pageInfo:e,width:t,totalPages:n,handleChangePage:r,visibilityThreshold:i}=cY(),{page:o}=e;if(t<=(i?.selectPage||fY.SelectPage))return null;const a=lt.jsx(MY,{totalPages:n,page:o});return lt.jsx(SY,{name:"SelectPage",value:o,options:a,handleChange:e=>{r(+e.target.value)}})},_Y=e=>lt.jsxs(uY,{...e,children:[lt.jsx(kY,{}),lt.jsx(RY,{}),lt.jsx(wY,{}),lt.jsx(hY,{}),lt.jsx(xY,{}),lt.jsx(vY,{}),lt.jsx(gY,{})]});var AY=Yt.memo(_Y);const IY=e=>lt.jsx(nY,{...e,children:lt.jsx(AY,{...e})}),PY=(e,t,n)=>{const r=n.size,i=r>=t.size;if(r){e({keys:[i?"SNTable.SelectionLabel.SelectedValue":"SNTable.SelectionLabel.DeselectedValue",1===r?"SNTable.SelectionLabel.OneSelectedValue":["SNTable.SelectionLabel.SelectedValues",r.toString()]]})}else e({keys:["SNTable.SelectionLabel.ExitedSelectionMode"]})},TY=(e,t,n)=>{n&&t&&(t.classList.contains("selected")?e({keys:["SNTable.SelectionLabel.SelectedValue"]}):e({keys:["SNTable.SelectionLabel.NotSelectedValue"]}))},DY=e=>e.ctrlKey||e.metaKey,OY=e=>e.shiftKey&&DY(e),NY=e=>[Em.Left,Em.Right,Em.Up,Em.Down].includes(e),qY=e=>e.shiftKey&&NY(e.key),LY=e=>(e=>NY(e)||[Em.Home,Em.End,Em.PageUp,Em.PageDown].includes(e))(e.key)&&!OY(e),jY=(e,t)=>{const{api:n,rows:r,colIdx:i}=e,{cell:o,announce:a,evt:s}=t;let l=new Map;if(-1===i)n?.begin(["/qHyperCubeDef"]);else{if(i!==o.selectionColIdx)return e;l=new Map(r)}return l=((e,t,n)=>{const{qElemNumber:r,rowIdx:i}=t;return n.ctrlKey||n.metaKey?(new Map).set(r,i):(e.has(r)?e.delete(r):e.set(r,i),new Map(e))})(l,o,s),PY(a,r,l),l.size?(n?.select({method:"selectHyperCubeCells",params:["/qHyperCubeDef",Array.from(l.values()),[o.selectionColIdx]]}),{...e,rows:l,colIdx:o.selectionColIdx}):(n?.cancel(),{...e,rows:l,colIdx:-1})},zY=(e,t)=>{const{api:n,rows:r,colIdx:i,pageRows:o,firstCell:a}=e,{cell:s,announce:l,evt:c}=t;if(!(a||"key"in c&&qY(c)))return e;-1===i&&n?.begin(["/qHyperCubeDef"]);const u=((e,t,n,r,i)=>{if(!n.isSelectable)return t;const o=new Map(t);if("key"in r&&qY(r)){o.set(n.qElemNumber,n.rowIdx);const t=r.key===Em.Down?1:-1,i=e[n.pageRowIdx+t][n.pageColIdx];return i.isSelectable&&o.set(i.qElemNumber,n.rowIdx+t),o}if(!i)return t;const a=Math.min(i.pageRowIdx,n.pageRowIdx),s=Math.max(i.pageRowIdx,n.pageRowIdx);for(let t=a;t<=s;t++){const n=e[t][i.pageColIdx];n.isSelectable&&o.set(n.qElemNumber,n.rowIdx)}return o})(o,r,s,c,a);return PY(l,r,u),{...e,rows:u,colIdx:a?.selectionColIdx??s.selectionColIdx,isSelectMultiValues:!0}},FY=e=>{const{api:t,rows:n,colIdx:r,isSelectMultiValues:i,mouseupOutsideCallback:o}=e;return o&&document.removeEventListener("mouseup",o),i&&t?.select({method:"selectHyperCubeCells",params:["/qHyperCubeDef",Array.from(n.values()),[r]]}),{...e,isSelectMultiValues:!1,firstCell:void 0,mouseupOutsideCallback:void 0}},$Y=(e,t)=>{switch(t.type){case KB.Select:return jY(e,t.payload);case KB.SelectMouseDown:return((e,{cell:t,mouseupOutsideCallback:n})=>!n||-1!==e.colIdx&&e.colIdx!==t.selectionColIdx?e:(document.addEventListener("mouseup",n),{...e,firstCell:t,mouseupOutsideCallback:n}))(e,t.payload);case KB.SelectMouseUp:return((e,t)=>FY(e.isSelectMultiValues||e.firstCell!==t.cell?e:jY(e,t)))(e,t.payload);case KB.SelectMultiAdd:return zY(e,t.payload);case KB.SelectMultiEnd:return FY(e);case KB.Reset:return e.api?.isModal()?e:{...e,rows:new Map,colIdx:-1};case KB.Clear:return e.rows.size?{...e,rows:new Map}:e;case KB.UpdatePageRows:return{...e,pageRows:t.payload.pageRows};default:throw new Error("reducer called with invalid action type")}},BY=gg(e=>{const t=e(oy);return function(e,t){return gg(e,function(e,n,r){n(this,t(e(this),r))})}({pageRows:e(lU).rows,rows:new Map,colIdx:-1,api:t,isSelectMultiValues:!1},$Y)}),HY=gg(e=>e(e(BY)),(e,t,n)=>{t(e(BY),n)}),VY=KR(e=>gg(t=>{const{colIdx:n,rows:r,api:i}=t(HY);return"object"==typeof e&&i?.isModal()?n!==e.selectionColIdx?YB.Disabled:r.has(e.qElemNumber)?YB.Selected:YB.Possible:YB.Inactive}),(e,t)=>"object"!=typeof e||"object"!=typeof t?e===t:e.qElemNumber===t.qElemNumber&&e.selectionColIdx===t.selectionColIdx),WY=gg(e=>{const t=e(jU),n=e(Ry).width,r=e(fV);return t>0&&t+r<n}),UY=()=>{const[e,t]=Yt.useState(!1);return ej({onDragStart:()=>{t(!0)},onDragEnd:()=>{t(!1)}}),e?lt.jsx("div",{style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:100}}):null},GY=(e,{atTop:t,atBottom:n},r)=>({borderLeftColor:e.grid.border,borderRightColor:e.grid.border,borderTopColor:!r&&n?e.grid.divider:e.grid.border,borderBottomColor:r&&!t||!r&&t?e.grid.divider:e.grid.border}),YY=gg(e=>{const t=e(Jg),n=e(ky);if(void 0!==n)return async(e,r)=>{const{isDim:i,colIdx:o,qReverseSort:a,sortDirection:s,isActivelySorted:l}=e,c=i?o:o-t,u=await n.getEffectiveProperties(),{qInterColumnSortOrder:d}=u.qHyperCubeDef,p=[],f=r!==s||l;if(!i){const e=u.qHyperCubeDef.qMeasures.at(c)?.qSortBy;void 0===e?.qSortByNumeric&&p.push({qPath:`/qHyperCubeDef/qMeasures/${c}/qSortBy`,qOp:"Replace",qValue:JSON.stringify({...e,qSortByNumeric:"A"===s?1:-1})})}if(!l){const e=[o,...d.filter(e=>e!==o)];p.push({qPath:"/qHyperCubeDef/qInterColumnSortOrder",qOp:"Replace",qValue:`[${e.join(",")}]`})}f&&p.push({qPath:`/qHyperCubeDef/${i?"qDimensions":"qMeasures"}/${c}/qDef/qReverseSort`,qOp:"Replace",qValue:(!a).toString()}),n.applyPatches(p,!0)}}),KY=e=>{e&&(e.focus(),(e=>{e?.setAttribute("tabIndex","0")})(e))},XY=({colIdx:e,rowIdx:t,firstColIdx:n,lastColIdx:r})=>(e>n?e--:t>n&&(t--,e=r),[t,e]),JY=({colIdx:e,rowIdx:t,firstColIdx:n,lastColIdx:r,lastRowIdx:i})=>(e<r?e++:t<i&&(t++,e=n),[t,e]),QY=e=>e.atTop?2:1,ZY=(e,t)=>({top:e?QY(t):0,bottom:e&&t.atBottom?1:0}),eK=(e,t)=>e.getElementsByClassName("sn-table-row")[t[0]]?.getElementsByClassName("sn-table-cell")[t[1]],tK=e=>e?.setAttribute("tabIndex","0"),nK=e=>e?.setAttribute("tabIndex","-1"),rK=e=>{e.querySelectorAll("td[tabindex='0'], th[tabindex='0']").forEach(nK)},iK=e=>{e?.focus(),tK(e)},oK=e=>{setTimeout(()=>{const t=e.current?.closest(".sn-table-cell")?.querySelector(`.${Mm}`);iK(t)},0)},aK=({evt:e,rootElement:t,cellCoord:n,setFocusedCellCoord:r,allowedRows:i,direction:o})=>{rK(t);const a=((e,t,n,r,i={top:0,bottom:0})=>{const o=i.top>0,a=i.top,s=t.getElementsByClassName("sn-table-row").length-1-i.bottom,l=t.getElementsByClassName("sn-table-head-cell").length-1;let[c,u]=n;switch(e.key){case Em.Down:c<s&&c++;break;case Em.Up:c>a&&c--;break;case Em.Right:if(o)break;[c,u]="rtl"===r?XY({colIdx:u,rowIdx:c,lastColIdx:l,firstColIdx:0}):JY({colIdx:u,rowIdx:c,lastColIdx:l,lastRowIdx:s,firstColIdx:0});break;case Em.Left:if(o)break;[c,u]="rtl"===r?JY({colIdx:u,rowIdx:c,lastColIdx:l,lastRowIdx:s,firstColIdx:0}):XY({colIdx:u,rowIdx:c,lastColIdx:l,firstColIdx:0});break;case Em.Home:(DY(e)||o)&&(c=a),o||(u=0);break;case Em.End:(DY(e)||o)&&(c=s),o||(u=l);break;case Em.PageDown:c=Math.min(s,c+10);break;case Em.PageUp:c=Math.max(a,c-10)}return[c,u]})(e,t,n,o,i),s=eK(t,a);return iK(s),((e,t)=>{const n=t.getElementsByClassName("sn-table-container")[0];if(!n?.scrollTo)return;const[r,i]=e;if(r<2)n.scrollTo({top:0,behavior:"auto"});else{const e=t.getElementsByClassName("sn-table-head-cell")[0],o=t.getElementsByClassName("sn-table-row")[r].getElementsByClassName("sn-table-cell")[i];if(!o||!e)return;if(o.offsetTop-e.offsetHeight<n.scrollTop){const t=n.scrollTop-o.offsetHeight-e.offsetHeight;n.scrollTo({top:Math.max(0,t),behavior:"auto"})}}})(a,t),r(a),{nextCell:s,nextCellCoord:a}},sK=(e,t,n,r)=>{rK(t),n(e),r.enabled&&!r.active?r.focus?.():iK(eK(t,e))},lK=(e,t,n)=>{const r=e.currentTarget;if(!r)return;const i=e.relatedTarget??document.activeElement;if(!!i?.closest(`.${Sm}`))return;const o=!!i&&r.contains(i);!n.enabled||t.current||o||(e=>{const t=e.querySelector(`.${JB.First}`),n=e.querySelector(`.${JB.Second}`);t&&n&&(t.innerHTML="",n.innerHTML="")})(r),((e,t,n)=>{const r=e.currentTarget;if(!n.enabled||t.current||!r)return;const i=e.relatedTarget??document.activeElement;i&&r.contains(i)||n.blur?.(!1)})(e,t,n)},cK=(e,t)=>lt.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:lt.jsx("path",{d:"M8 10a1 1 0 0 1 .5 1.866v.634a.5.5 0 0 1-1 0v-.634A1 1 0 0 1 8 10M3.625 7.035A2 2 0 0 0 2 9v5a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V9a2 2 0 0 0-1.625-1.965V5.383a4.375 4.375 0 0 0-8.75 0zM3 9a1 1 0 0 1 .931-.998h8.138A1 1 0 0 1 13 9v5a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1zm8.375-3.617V7h-6.75V5.383a3.375 3.375 0 0 1 6.75 0"})}),uK=Yt.forwardRef(cK),dK=Ul(mh,{shouldForwardProp:e=>"headerStyle"!==e&&"interactions"!==e&&"hoverBackground"!==e&&"background"!==e&&"color"!==e})(({headerStyle:e,interactions:t,hoverBackground:n,background:r,color:i})=>({...XH,...e,cursor:t.active?"pointer":"default",background:r,color:i,verticalAlign:"bottom",boxSizing:"border-box","&&:focus-visible, &&:hover:not(:has(button:hover))":{background:t.active?n:r}})),pK=Ul("span",{shouldForwardProp:e=>"align"!==e&&"dir"!==e})(({align:e,dir:t})=>({minWidth:GH,display:"flex",paddingBottom:"2px",alignSelf:"end",..."right"===e||"rtl"===t&&"center"===e?{paddingRight:"8px"}:{paddingLeft:"8px"}})),fK=parseInt(GH,10)/2,hK=Ul("div")({position:"absolute",bottom:-fK,left:`calc(50% - ${fK}px)`}),mK=Ul(Ph)({position:"sticky",top:0,zIndex:1}),gK={lineHeight:"calc(4/3)",fontSize:"inherit",textOverflow:"ellipsis",overflow:"hidden"},yK=Ul(Xu)({height:"100%","& .sn-table-cell:focus-visible":{outline:"none",boxShadow:"0 0 0 2px #177fe6 inset, 0 0 0 3px #fff inset"},"& .sn-table-cell:focus:not(:focus-visible)":{outline:"none"}}),bK=Ul("span",{shouldForwardProp:e=>"lineClamp"!==e&&"isHeadCell"!==e&&"isPagination"!==e&&"isNumeric"!==e&&"isDual"!==e})(({lineClamp:e,isHeadCell:t=!1,isPagination:n=!1,isNumeric:r=!1,isDual:i=!1})=>r&&!i||1===e&&!t?{...gK,whiteSpace:"nowrap",display:n?"block":void 0}:{...gK,wordBreak:"break-word",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical",whiteSpace:"pre-line"}),vK=Ul("div")({display:"grid",gridAutoFlow:"column",width:"100%",gridAutoColumns:"1fr auto",gap:"4px"}),xK="cell-text",wK=({children:e,forwardRef:t,isNumeric:n=!1,isPagination:r=!1,isHeadCell:i=!1,isDual:o=!1,lineClamp:a})=>{const s=_g(EU);return i?lt.jsx(bK,{"data-testid":xK,ref:t,className:"sn-table-cell-text",lineClamp:s.grid.headerLineClamp,isPagination:r,isHeadCell:!0,style:{direction:n?"ltr":void 0},children:e}):lt.jsx(bK,{"data-testid":xK,ref:t,className:"sn-table-cell-text",isDual:o,isNumeric:n,lineClamp:a??s.grid.contentLineClamp,isPagination:r,style:{direction:n?"ltr":void 0},children:e})},SK=e=>{const{column:t,isInteractionEnabled:n,open:r,setOpen:i,isPagination:o,forwardRef:a}=e,s=_g(Zg),l=_g(YY),c=_g(my),u=_g(sy),d=_g(Dg),p=_g(Ty),f=_g(Pg),h=_g(NU)[t.pageColIdx],m=_g(Sy),g=Yt.useRef(null),y=Yt.useRef(null),b=(({column:e,columnWidth:t})=>{const n=_g(EU),{measureText:r}=um({fontSize:n.header.fontSize,fontFamily:n.header.fontFamily,fontWeight:YH});let i=!1,o=!1,a=!1;const s=e.isLocked,l=e.isActivelySorted,c=t-25,u=s?20:0,d=l?20:0;let p=r(e.label);return s&&p+u<=c&&(a=!0,p+=u,l&&p+d<=c&&(o=!0,p+=d)),!s&&l&&p+d<=c&&(o=!0,p+=d),p+24<=c&&(i=!0),{shouldShowMenuIcon:i,shouldShowSortIcon:o,shouldShowLockIcon:a}})({column:t,columnWidth:h}),{StartIcon:v,EndIcon:x,LockIcon:w}=(({sortDirection:e,headTextAlign:t},{shouldShowSortIcon:n,shouldShowLockIcon:r},i)=>{const o="A"===e?lt.jsx(SG,{height:GH,"data-testid":"head-cell-sort-ascending-icon"}):lt.jsx(_G,{height:GH,"data-testid":"head-cell-sort-descending-icon"}),a=n?lt.jsx(pK,{align:t,dir:i,children:o}):void 0,s=r?lt.jsx(lV,{rightAligned:"right"===t,className:"sn-table-lock-icon",children:lt.jsx(uK,{height:GH,"data-testid":"head-cell-lock-icon"})}):void 0;return"right"===t?{StartIcon:a,LockIcon:s}:{EndIcon:a,LockIcon:s}})(t,b,c);return lt.jsxs(sV,{shouldShowMenuIcon:b.shouldShowMenuIcon,shouldShowLockIcon:b.shouldShowLockIcon,alignment:eV(t,o,c),children:[w,lt.jsxs(aV,{className:"sn-table-head-label",textAlign:t.headTextAlign,direction:c,isPagination:o,children:[v,lt.jsx(wK,{forwardRef:a,isPagination:o,isHeadCell:!0,children:t.label}),x]}),n?lt.jsxs(lt.Fragment,{children:[lt.jsx(XG,{headerData:{...t,dimensionInfoIndex:t.colIdx},translator:p,anchorRef:g,menuAvailabilityFlags:{[GG.Sorting]:!0,[GG.Searching]:!0,[GG.Selections]:!0,[GG.AdjusterHeaderSize]:!0},open:r,setOpen:i,interactions:u,sortRelatedArgs:{sortFromMenu:(e,n)=>(e.stopPropagation(),l?.(t,n)??Promise.resolve())},searchRelatedArgs:{embed:d,listboxRef:y},selectionRelatedArgs:{app:f,qStateName:s},adjustHeaderSizeRelatedArgs:{focusColumnAdjuster:oK},shouldShowMenuIcon:b.shouldShowMenuIcon,model:m,direction:c,isPagination:o,isAccessibleHeader:!0}),lt.jsx(oV,{ref:y,direction:c,isPagination:o}),lt.jsx(oV,{ref:g,direction:c})]}):null]})},kK=(e,t)=>lt.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:lt.jsx("path",{d:"M6 2h10V1H6zm5 5h5V6h-5zm5 5h-5v-1h5zM5 10h1v2.663a3.5 3.5 0 1 0-2.922.036l-.406.914A4.501 4.501 0 1 1 7.329 13H9v1H5z"})}),CK=Yt.forwardRef(kK),EK=(e,t)=>e.isCyclic&&t,MK=({column:e})=>{const t=_g(EU),n=_g(my),r=_g(Sy),i=Kt.useRef(null),[o,a]=Kt.useState(!1),s=GU({model:r,headerData:{...e,dimensionInfoIndex:e.colIdx}});return lt.jsxs(lt.Fragment,{children:[lt.jsx(uV,{hoverBackground:e.headerColor?.headerMenuHoverBackground??t.headerMenuHoverBackground,activeBackground:e.headerColor?.headerMenuActiveBackground??t.headerMenuActiveBackground,isActive:o,tabIndex:-1,onClick:e=>{e.stopPropagation(),a(!0)},children:lt.jsx(CK,{ref:i,height:16,"data-testid":"head-cell-cyclic-icon"})}),lt.jsx(mG,{open:o,onClose:()=>{a(!1)},menuGroups:[[{items:e.groupDimensionLabels.map((t,n)=>({id:n+1,itemTitle:t,onClick:e=>{e.stopPropagation(),a(!1),s?.(n)},enabled:!0,icon:yF,isActive:e.groupDimensionPos===n}))}]],anchorEl:i.current,direction:n,isPagination:!1})]})},RK=e=>e.isLocked,_K=({column:e})=>{const t=_g(Pg),n=_g(Zg),r=_g(Ug),i=_g(EU);return lt.jsx(uV,{tabIndex:-1,hoverBackground:e.headerColor?.headerMenuHoverBackground??i.headerMenuHoverBackground,onClick:i=>{i.stopPropagation(),(async(e,t,n,r={warn:()=>{},error:()=>{}})=>{const i=yG(t??"$",n);let o;try{const t=await(e?.createSessionObject(i));o=t?.id,await(t?.unlock("/qListObjectDef"))}catch(e){r.error({msg:"Failed to unlock field from table header",payload:e})}finally{o&&(await(e?.destroySessionObject(o))||r.error({msg:"Failed to destroy session object when unlocking field from table header"}))}})(t,n,e,r)},children:lt.jsx(uK,{height:16,"data-testid":"head-cell-lock-icon"})})},AK=({column:e,menuIconRef:t,open:n,setOpen:r})=>{const i=_g(EU);return lt.jsx(uV,{tabIndex:-1,hoverBackground:e.headerColor?.headerMenuHoverBackground??i.headerMenuHoverBackground,activeBackground:e.headerColor?.headerMenuActiveBackground??i.headerMenuActiveBackground,isActive:n,order:e.isDim?void 0:-1,onClick:e=>{e.stopPropagation(),r(e=>!e)},ref:t,children:lt.jsx(UU,{height:16})})},IK=({anchorRef:e,column:t,isPagination:n,listboxRef:r,open:i,setOpen:o})=>{const a=_g(Pg),s=_g(my),l=_g(Dg),c=_g(sy),u=_g(Sy),d=_g(Zg),p=_g(Ty),f=_g(YY);return lt.jsx(XG,{headerData:{...t,dimensionInfoIndex:t.colIdx},translator:p,anchorRef:e,menuAvailabilityFlags:{[GG.Sorting]:!0,[GG.Searching]:!0,[GG.Selections]:!0,[GG.AdjusterHeaderSize]:!0},open:i,setOpen:o,interactions:c,sortRelatedArgs:{sortFromMenu:(e,n)=>(e.stopPropagation(),f?.(t,n)??Promise.resolve())},searchRelatedArgs:{embed:l,listboxRef:r},selectionRelatedArgs:{app:a,qStateName:d},adjustHeaderSizeRelatedArgs:{focusColumnAdjuster:oK},shouldShowMenuIcon:!1,model:u,direction:s,isPagination:n})},PK=gg();PK.onMount=e=>{const t=new Map,n=new ResizeObserver(e=>{for(const n of e){const e=t.get(n.target);e&&e.current(n)}});return e({callbacks:t,observer:n}),()=>{t.clear(),n.disconnect()}};const TK=({ref:e,callback:t})=>{const n=_g(PK),r=Yt.useRef(t);r.current=t,Yt.useLayoutEffect(()=>{const t=e.current;return void 0===n?()=>{}:(t&&(n.callbacks.set(t,r),n.observer.observe(t)),()=>{t&&(n.callbacks.delete(t),n.observer.unobserve(t))})},[e,r,n])},DK=Ul(Xu)({display:"flex",alignItems:"flex-end",justifyContent:"center",width:"100%",boxSizing:"border-box"}),OK=({children:e})=>{const t=Kt.useRef(null),[n,r]=Yt.useState(()=>new Set(e.filter(({props:e})=>void 0!==e.prio&&e.children).map(({key:e})=>e))),i=Yt.useMemo(()=>Array.from(e).sort((e,t)=>(e.props.prio??-1/0)-(t.props.prio??-1/0)),[e]),o=Yt.useCallback(e=>{const t=new Set,n=e.contentBoxSize.at(0)?.inlineSize??0;let o=0;i.forEach(e=>{if(e.props.ignore||!e.props.children)return;const r=e.props.minWidth+1;void 0===e.props.prio||o+r<=n?o+=r:t.add(e.key)}),r(e=>e.size===t.size&&[...e].every(e=>t.has(e))?e:t)},[i]);return TK({ref:t,callback:o}),lt.jsx(DK,{ref:t,"data-testid":"responsive-container",children:e.filter(e=>!n.has(e.key))})},NK=({children:e})=>e,qK=(e,t)=>!e.isLocked&&e.isDim&&t,LK=({column:e,open:t,setOpen:n})=>{const r=_g(EU),i=_g(Zg),o=_g(my),a=_g(Dg);_g(Pg);const s=Kt.useRef(null),l=Yt.useCallback(()=>{n(!1)},[n]),c=gG({qLibraryId:e.qLibraryId,fieldId:e.fieldId,searchRelatedArgs:{embed:a,listboxRef:s},selectionRelatedArgs:{qStateName:i},direction:o,onPopoverClose:l});return lt.jsx(uV,{tabIndex:-1,hoverBackground:e.headerColor?.headerMenuHoverBackground??r.headerMenuHoverBackground,activeBackground:e.headerColor?.headerMenuActiveBackground??r.headerMenuActiveBackground,isActive:t,onClick:e=>{e.stopPropagation(),c(),n(!0)},children:lt.jsx(qG,{ref:s,height:16,"data-testid":"head-cell-search-icon"})})},jK=({column:e})=>{const{sortDirection:t,isActivelySorted:n}=e,r="A"===t?lt.jsx($H,{height:GH,"data-testid":"head-cell-sort-ascending-icon"}):lt.jsx(NH,{height:GH,"data-testid":"head-cell-sort-descending-icon"});return n?lt.jsx(hK,{children:r}):void 0},zK=0,FK=1,$K=2,BK=3,HK=e=>{const{column:t,open:n,setOpen:r,isPagination:i,forwardRef:o,columnWidth:a,isInteractionEnabled:s}=e,l=_g(EU),c=_g(my),{measureText:u}=um(l.header),[d,p]=Yt.useState(!1),f=Yt.useRef(null),h=Yt.useRef(null),m=Yt.useRef(null),g="number"==typeof a&&a>Rm.PixelsMin+18;return lt.jsxs(lt.Fragment,{children:[lt.jsxs(OK,{children:[lt.jsx(NK,{prio:$K,minWidth:iV,children:RK(t)?lt.jsx(_K,{column:t}):null},"Lock"),lt.jsx(NK,{prio:FK,minWidth:iV,children:EK(t,s)?lt.jsx(MK,{column:t}):null},"Cyclic"),lt.jsx(NK,{ignore:!0,children:lt.jsx(jK,{column:t})},"Sort"),lt.jsx(NK,{minWidth:u(t.label)+8,children:lt.jsx(cV,{justifyContent:t.headTextAlign,children:lt.jsx(wK,{forwardRef:o,isPagination:i,isHeadCell:!0,children:t.label})})},"Text"),lt.jsx(NK,{prio:g?void 0:zK,minWidth:iV,children:d||qK(t,s)?lt.jsx(LK,{open:d,setOpen:p,column:t}):null},"Search"),lt.jsx(NK,{prio:BK,minWidth:iV,children:s?lt.jsx(AK,{menuIconRef:m,column:t,open:n,setOpen:r}):null},"Menu")]}),s?lt.jsxs(lt.Fragment,{children:[lt.jsx(oV,{ref:h,direction:c,isPagination:i}),lt.jsx(oV,{ref:f,direction:c}),lt.jsx(IK,{anchorRef:m.current?m:f,column:t,isPagination:i,listboxRef:h,open:n,setOpen:r})]}):null]})},VK=Ul("div",{shouldForwardProp:e=>"background"!==e&&"applicableStyle"!==e&&"color"!==e})(({background:e,applicableStyle:t,color:n})=>({...t,background:e,color:n})),WK=()=>{},UK=({column:e,isPagination:t})=>{const n=_g(EU),r=_g(my),i=_g(WY),o=_g(cU),a=!1,s=_g(ny)?SK:HK;return lt.jsx(VK,{className:"sn-table-cell",applicableStyle:{...n.header,...GY(n,o,!0)},style:{cursor:"pointer",display:"flex",alignItems:"flex-end",borderStyle:"solid",borderRightWidth:nV(r,a,i),borderLeftWidth:rV(r,a,i),borderTopWidth:"0px",borderBottomWidth:"1px",padding:"4px",justifyContent:e.headTextAlign,boxSizing:"border-box",flexDirection:"right"===e.headTextAlign?"row-reverse":"row",userSelect:"none",width:"100%"},background:e.headerColor?.background??n.header.background,color:e.headerColor?.color??n.header.color,children:lt.jsx(s,{column:e,isInteractionEnabled:!1,isPagination:t,open:!1,setOpen:WK})})},GK=({isPagination:e})=>{const t=_g(uU),[n,r]=Yt.useState();ej({onDragStart:e=>{const t=e.operation.source?.id;r(t)},onDragEnd:()=>{}});const i=n?t.find(e=>e.id===n):void 0;return i?lt.jsx(PL,{children:lt.jsx("div",{style:{background:"white",height:"100%",display:"flex",position:"relative"},children:lt.jsx(UK,{column:i,isPagination:e})})}):null},YK=gg(async e=>{e(Yg);const t=e(ky),n=await(t?.getEffectiveProperties());return n&&structuredClone(n)}),KK=_E(YK,e=>e),XK=gg(e=>e(KK)?.qHyperCubeDef),JK=[Lq.configure({activationConstraints:[new Dq.Distance({value:5})],preventActivation:e=>{const t=e.target;return t instanceof HTMLElement&&t.classList.contains("nebula-table-utils-column-adjuster")}})],QK=iL.plugins.filter(e=>e!==oN),ZK=(e,t,n)=>{const r=JSON.stringify(t),i=JSON.stringify(n);if(r!==i)return{qPath:e,qOp:"Replace",qValue:i}},eX=(e,t,n,r,i)=>{if(!e||!t||r===i)return;const o=(({qDimensions:e,qMeasures:t,qInterColumnSortOrder:n,visibleColumnIds:r,sourceId:i,targetId:o})=>{const a=UF({qDimensions:e,qMeasures:t}),s=[...e,...t],l=r.findIndex(e=>e===i),c=r.findIndex(e=>e===o);if(l<0||c<0||l===c)return;const u=((e,t,n)=>{const r=[...e],[i]=r.splice(t,1);return r.splice(n,0,i),r})(r,l,c),d=new Map(u.map((e,t)=>[e,t])),p=a.toSorted((e,t)=>{const n=d.get(e.id),r=d.get(t.id);return void 0===n||void 0===r?0:n-r}),f=p.filter(e=>e.isDimension).map(e=>e.def),h=p.filter(e=>!e.isDimension).map(e=>e.def),m=[...f,...h],g=new Map(m.map((e,t)=>[e.qDef.cId,t]));return{qDimensions:f,qMeasures:h,qInterColumnSortOrder:GF({previousColumns:s,nextColumns:m,qInterColumnSortOrder:n}),qColumnOrder:u.map(e=>g.get(e)).filter(e=>void 0!==e)}})({qDimensions:t.qDimensions,qMeasures:t.qMeasures,qInterColumnSortOrder:t.qInterColumnSortOrder,visibleColumnIds:n.map(e=>e.id),sourceId:r,targetId:i});if(!o)return;const a=[ZK("/qHyperCubeDef/qDimensions",t.qDimensions,o.qDimensions),ZK("/qHyperCubeDef/qMeasures",t.qMeasures,o.qMeasures),ZK("/qHyperCubeDef/qInterColumnSortOrder",t.qInterColumnSortOrder,o.qInterColumnSortOrder),ZK("/qHyperCubeDef/qColumnOrder",t.qColumnOrder,o.qColumnOrder)].filter(e=>void 0!==e);0!==a.length&&e.applyPatches(a,!0)},tX=({children:e})=>{const t=_g(ky),n=_g(XK),r=_g(uU);return lt.jsx(_L,{onDragOver:e=>{const i=e.operation.source?.id,o=e.operation.target?.id;void 0!==o&&i!==o&&eX(t,n,r,i,o)},sensors:JK,plugins:QK,children:e})};function nX(e,t){const n=Yt.useRef(!1);Yt.useEffect(()=>{n.current?e():n.current=!0},t)}const rX=(e,t)=>{const n=_g(wy);Yt.useEffect(()=>{const r=e.current;if(!r)return;const i=e=>{lK(e,t,n)};return r.addEventListener("focusout",i),()=>{r.removeEventListener("focusout",i)}},[e,t,n])},iX=gg(QB),oX=KR(e=>gg(t=>{const[n,r]=t(iX);return 0===n&&r===e})),aX=()=>{const e=_g(Tg);Yt.useEffect(()=>{e.notifyIsDoneRendering()})};var sX={SNTable_Accessibility_Ascending:{id:"SNTable.Accessibility.Ascending",locale:{"de-DE":"Aufsteigend","en-US":"Ascending","es-ES":"Ascendente","fr-FR":"Croissant","it-IT":"Crescente","ja-JP":"昇順","ko-KR":"오름차순","nl-NL":"Oplopend","pl-PL":"Rosnąco","pt-BR":"Crescente","ru-RU":"По возрастанию","sv-SE":"Stigande","tr-TR":"Artan","zh-CN":"升序","zh-TW":"遞增"}},SNTable_Accessibility_ColumnOptions:{id:"SNTable.Accessibility.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":"欄選項"}},SNTable_Accessibility_Descending:{id:"SNTable.Accessibility.Descending",locale:{"de-DE":"Absteigend","en-US":"Descending","es-ES":"Descendente","fr-FR":"Décroissant","it-IT":"Decrescente","ja-JP":"降順","ko-KR":"내림차순","nl-NL":"Aflopend","pl-PL":"Malejąco","pt-BR":"Decrescente","ru-RU":"По убыванию","sv-SE":"Fallande","tr-TR":"Azalan","zh-CN":"降序","zh-TW":"遞減"}},SNTable_Accessibility_NavigationInstructions:{id:"SNTable.Accessibility.NavigationInstructions",locale:{"de-DE":"Verwenden Sie die Pfeiltasten, um zwischen den Tabellenzellen zu navigieren, und die Tabulatortaste, um zu den Paginierungssteuerelementen zu wechseln. Drücken Sie die Leertaste in den Kopfzellen, um das Spaltenmenü zu öffnen, und drücken Sie die Leertaste in den Körperzellen, um eine Auswahl zu treffen. Duch die Auswahl wird der Seiteninhalt aktualisiert. Die vollständige Liste der Navigationssteuerungen finden Sie in der Dokumentation.","en-US":"Use arrow keys to navigate between table cells and tab to move to pagination controls. Press space on header cells to open the column menu, press space on body cells to make selections. Selections will cause content on the page to be updated. The full list of navigation controls can be found in the documentation.","es-ES":"Utilice las teclas de flecha para desplazarse entre las celdas de la tabla y la pestaña a fin de pasar a los controles de paginación. Pulse la barra espaciadora en las celdas del encabezado para abrir el menú de columnas; pulse la barra espaciadora en las celdas del cuerpo para realizar selecciones. Las selecciones harán que se actualice el contenido de la página. Encontrará la lista completa de controles de navegación en la documentación.","fr-FR":"Utilisez les touches fléchées pour naviguer parmi les cellules du tableau et la tabulation pour accéder aux commandes de pagination. Appuyez sur la touche Espace dans les cellules d'en-tête pour ouvrir le menu de la colonne. Appuyez sur Espace dans les cellules de corps pour effectuer une sélection. Les sélections actualiseront le contenu de la page. Vous pouvez consulter la liste complète des commandes de navigation dans la documentation.","it-IT":"Utilizzare i tasti freccia per navigare tra le celle della tabella e il tasto TAB per passare ai controlli di paginazione. Premere lo spazio nelle celle dell'intestazione per aprire il menu della colonna; premere lo spazio nelle celle del corpo per effettuare selezioni. Le selezioni determineranno l'aggiornamento del contenuto della pagina. È possibile trovare l'elenco completo dei controlli di navigazione nella documentazione.","ja-JP":"矢印キーで表のセル間を移動し、タブ キーでページネーション コントロールに移動します。ヘッダー セルでスペースを押すと列メニューが開き、ボディ セルでスペースを押すと選択ができます。選択によって、ページのコンテンツが更新されます。ナビゲーション コントロールの全リストは、ドキュメントをご覧ください。","ko-KR":"화살표 키를 사용하여 표 셀 사이를 탐색하고, 탭을 사용하여 페이지 번호 컨트롤로 이동하십시오. 헤더 셀에서 스페이스바를 눌러 열 메뉴를 열고, 본문 셀에서 스페이스바를 눌러 선택하십시오. 선택하면 페이지의 콘텐츠가 업데이트됩니다. 전체 탐색 컨트롤 목록은 설명서에서 확인할 수 있습니다.","nl-NL":"Gebruik de pijltjestoetsen om te navigeren tussen tabelcellen en de Tab-toets om naar besturingselementen voor paginering te gaan. Druk op de spatietoets in koptekstcellen om het kolommenu te openen, druk op de spatietoets in hoofdtekstcellen om selecties te maken. Door selecties te maken, wordt de inhoud op de pagina bijgewerkt. De volledige lijst met besturingselementen voor navigatie vindt u in de documentatie.","pl-PL":"Użyj klawiszy strzałek do poruszania się między komórkami tabeli oraz tabulatora do poruszania się po elementach sterujących stronami. Naciśnij klawisz spacji na komórkach nagłówka, aby otworzyć menu kolumny i naciśnij go na komórkach treści, aby dokonać wyborów. Wybory będą powodować aktualizację zawartości na stronie. Pełną listę nawigacyjnych elementów sterujących można znaleźć w dokumentacji.","pt-BR":"Use as teclas de seta para navegar entre as células da tabela e a tecla Tab para mover para os controles de paginação. Pressione espaço nas células do cabeçalho para abrir o menu da coluna, pressione espaço nas células do corpo para fazer seleções. As seleções farão com que o conteúdo da página seja atualizado. A lista completa de controles de navegação pode ser encontrada na documentação.","ru-RU":"Используйте клавиши со стрелками для перемещения между ячейками таблицы и клавишу табуляции для перехода к элементам управления разбивки на страницы. Нажмите пробел на ячейках заголовка, чтобы открыть меню столбца; нажмите пробел на ячейках тела, чтобы сделать выборки. Выборки приведут к обновлению содержимого страницы. Полный перечень элементов управления навигацией см. в документации.","sv-SE":"Använd piltangenterna för att navigera mellan tabellcellerna och tabbtangenten för att flytta till pagineringskontrollerna. Tryck på mellanslag på rubrikceller för att öppna kolumnmenyn och tryck på mellanslag på innehållsceller för att göra urval. Med urval kommer innehåll på sidan att uppdateras. Den fullständiga listan med navigeringsreglage.","tr-TR":"Tablo hücreleri arasında gezinmek için ok tuşlarını, sayfalandırma kontrollerine geçmek için sekmeyi kullanın. Sütun menüsünü açmak için başlık hücrelerinde boşluğa basın, seçim yapmak için gövde hücrelerinde boşluğa basın. Seçimler, sayfadaki içeriğin güncellenmesine neden olur. Navigasyon kontrollerinin tam listesi belgede bulunabilir.","zh-CN":"使用箭头键在表格单元格之间导航,使用 tab 键移动到分页控件。按标题单元格上的空间打开列菜单,按正文单元格上的空间进行选择。选择将导致页面上的内容更新。导航控件的完整列表可以在文档中找到。","zh-TW":"使用方向鍵以在表格儲存格之間導覽,並使用 Tab 以前往分頁控制。按下標頭儲存格的空白處可開啟欄功能表,按下正文儲存格的空白處可進行選取。選項將會造成更新頁面上的內容。導覽控制的完整清單可見於文件中。"}},SNTable_Accessibility_RowsAndColumns:{id:"SNTable.Accessibility.RowsAndColumns",locale:{"de-DE":"Es werden {0} Zeilen und {1} Spalten angezeigt.","en-US":"Showing {0} rows and {1} columns.","es-ES":"Mostrando {0} filas y {1} columnas.","fr-FR":"Affichage de {0} lignes et de {1} colonnes.","it-IT":"Visualizzazione di {0} righe e {1} colonne.","ja-JP":"{0} 行 {1} 列を表示しています。","ko-KR":"{0}개의 행과 {1}개의 열을 표시합니다.","nl-NL":"{0} rijen en {1} kolommen worden getoond.","pl-PL":"Wyświetlane wiersze: {0} i kolumny: {1}.","pt-BR":"Mostrando {0} linhas e {1} colunas.","ru-RU":"Показаны строки ({0}) и столбцы ({1}).","sv-SE":"Visar {0} rader och {1} kolumner.","tr-TR":"{0} satır ve {1} sütun gösteriliyor.","zh-CN":"正在显示 {0} 行,{1} 列。","zh-TW":"顯示 {0} 列和 {1} 欄。"}},SNTable_MenuItem_AdjustColumnSize:{id:"SNTable.MenuItem.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":"調整欄大小"}},SNTable_MenuItem_ClearSelections:{id:"SNTable.MenuItem.ClearSelections",locale:{"de-DE":"Auswahl 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":"Selecties 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":"清除選項"}},SNTable_MenuItem_Search:{id:"SNTable.MenuItem.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":"搜尋"}},SNTable_MenuItem_SelectAll:{id:"SNTable.MenuItem.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":"全選"}},SNTable_MenuItem_SelectAlternative:{id:"SNTable.MenuItem.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":"選取替代選項"}},SNTable_MenuItem_SelectExcluded:{id:"SNTable.MenuItem.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":"選取排除值"}},SNTable_MenuItem_SelectPossible:{id:"SNTable.MenuItem.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":"選取可能值"}},SNTable_MenuItem_Selections:{id:"SNTable.MenuItem.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":"選項"}},SNTable_MenuItem_SortAscending:{id:"SNTable.MenuItem.SortAscending",locale:{"de-DE":"Sortierung in aufsteigender Reihenfolge","en-US":"Sort ascending","es-ES":"Orden ascendente","fr-FR":"Tri 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":"以遞增方式排序"}},SNTable_MenuItem_SortDescending:{id:"SNTable.MenuItem.SortDescending",locale:{"de-DE":"Sortierung in absteigender Reihenfolge","en-US":"Sort descending","es-ES":"Orden descendente","fr-FR":"Tri 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":"以遞減方式排序"}},SNTable_Pagination_DisplayedRowsLabel:{id:"SNTable.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":"{1}의 {0}","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}"}},SNTable_Pagination_FirstPage:{id:"SNTable.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":"移至第一頁"}},SNTable_Pagination_LastPage:{id:"SNTable.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":"移至最後一頁"}},SNTable_Pagination_NextPage:{id:"SNTable.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":"移至下一頁"}},SNTable_Pagination_PageStatusReport:{id:"SNTable.Pagination.PageStatusReport",locale:{"de-DE":"Die Seite wurde geändert. Seite {0} von {1} wird angezeigt.","en-US":"Page has changed. Showing page {0} of {1}.","es-ES":"La página ha cambiado. Mostrando página {0} de {1}.","fr-FR":"La page a changé. Affichage de la page {0} sur {1}.","it-IT":"La pagina è cambiata. Visualizzazione pagina {0} di {1}.","ja-JP":"ページが変更されました。{1} ページ中の {0} ページ目を表示しています。","ko-KR":"페이지가 변경되었습니다. {1}의 {0} 페이지를 보여 줍니다.","nl-NL":"Pagina is gewijzigd. Pagina {0} van {1} wordt weergeven.","pl-PL":"Strona się zmieniła Wyświetlanie strony {0} z {1}.","pt-BR":"A página mudou. Mostrando página {0} de {1}.","ru-RU":"Страница изменилась. Показана страница {0} из {1}.","sv-SE":"Sidan har ändrats. Visar sida {0} av {1}.","tr-TR":"Sayfa değişti. Sayfa {0} / {1} gösteriliyor.","zh-CN":"页面已更改。显示页面 {0} / {1}。","zh-TW":"頁面已變更。顯示第 {0} 頁,共 {1} 頁。"}},SNTable_Pagination_PreviousPage:{id:"SNTable.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":"移至上一頁"}},SNTable_Pagination_RowsPerPage:{id:"SNTable.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":"每頁列數"}},SNTable_Pagination_RowsPerPageChange:{id:"SNTable.Pagination.RowsPerPageChange",locale:{"de-DE":"Zeilen pro Seite wurden in {0} geändert. Jetzt wird die erste Seite angezeigt.","en-US":"Rows per page has changed to {0}. Now showing the first page.","es-ES":"El número de filas por página ha cambiado a {0}. Mostrando ahora la primera página.","fr-FR":"Le nombre de lignes par page a été remplacé par {0}. Affichage en cours de la première page.","it-IT":"Le righe per pagina sono cambiate a {0}. Viene ora mostrata la prima pagina.","ja-JP":"ページあたりの行数が {0} に変更されました。現在、最初のページを表示しています。","ko-KR":"페이지당 행 수가 {0}(으)로 변경되었습니다. 이제 첫 페이지를 보여 줍니다.","nl-NL":"Aantal rijen per pagina is gewijzigd naar {0}. De eerste pagina wordt nu weergegeven.","pl-PL":"Liczba wierszy na stronę została zmieniona na {0}. Wyświetlana jest pierwsza strona.","pt-BR":"Linhas por página mudou para {0}. Agora mostrando a primeira página.","ru-RU":"Количество строк на странице изменилось на {0}. Теперь отображается первая страница.","sv-SE":"Rader per sida har ändrats till {0}. Nu visas första sidan.","tr-TR":"Sayfa başına satır sayısı {0} olarak değiştirildi. Şimdi ilk sayfa gösteriliyor.","zh-CN":"每页行数已更改为 {0}。现在显示第一页。","zh-TW":"每頁列數已變更為 {0}。現在顯示第一頁。"}},SNTable_Pagination_SelectPage:{id:"SNTable.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":"選取頁面"}},SNTable_SelectionLabel_DeselectedValue:{id:"SNTable.SelectionLabel.DeselectedValue",locale:{"de-DE":"Die Werteauswahl ist aufgehoben.","en-US":"Value is deselected.","es-ES":"El valor no está seleccionado.","fr-FR":"La valeur est désélectionnée.","it-IT":"Il valore è deselezionato.","ja-JP":"値が選択解除されました。","ko-KR":"값이 선택 취소되었습니다.","nl-NL":"Selectie van waarde opgeheven.","pl-PL":"Wartość nie jest zaznaczona.","pt-BR":"O valor está desmarcado.","ru-RU":"Выбор значения отменен.","sv-SE":"Val av värde har tagits bort.","tr-TR":"Değer seçimi iptal edildi.","zh-CN":"值已取消选择。","zh-TW":"值已取消選取。"}},SNTable_SelectionLabel_ExitedSelectionMode:{id:"SNTable.SelectionLabel.ExitedSelectionMode",locale:{"de-DE":"Die Werteauswahl ist aufgehoben. Auswahlmodus beendet.","en-US":"Value is deselected. Exited selection mode.","es-ES":"El valor no está seleccionado. Salió del modo de selección.","fr-FR":"La valeur est désélectionnée. Mode de sélection désactivé.","it-IT":"Il valore è deselezionato. Uscita dalla modalità selezione.","ja-JP":"値が選択解除されました。選択モードを終了しました。","ko-KR":"값이 선택 취소되었습니다. 선택 모드를 종료했습니다.","nl-NL":"Selectie van waarde opgeheven. Selectiemodus afgesloten.","pl-PL":"Wartość nie jest zaznaczona. Zakończono tryb wyboru.","pt-BR":"O valor está desmarcado. Modo de seleção encerrado.","ru-RU":"Выбор значения отменен. Выполнен выход из режима выборки.","sv-SE":"Val av värde har tagits bort. Lämnade urvalsläge.","tr-TR":"Değer seçimi iptal edildi. Seçim modundan çıkıldı.","zh-CN":"值已取消选择。已退出选择模式。","zh-TW":"值已取消選取。輸入的選取模式。"}},SNTable_SelectionLabel_NotSelectedValue:{id:"SNTable.SelectionLabel.NotSelectedValue",locale:{"de-DE":"Wert ist nicht ausgewählt.","en-US":"Value is not selected.","es-ES":"El valor no está seleccionado.","fr-FR":"La valeur n'est pas sélectionnée.","it-IT":"Il valore non è selezionato.","ja-JP":"値が選択されていません。","ko-KR":"값이 선택되지 않았습니다.","nl-NL":"Waarde is niet geselecteerd.","pl-PL":"Wartość nie jest wybrana.","pt-BR":"O valor não está selecionado.","ru-RU":"Значение не выбрано.","sv-SE":"Värdet är inte valt.","tr-TR":"Değer seçilmedi.","zh-CN":"未选择值。","zh-TW":"未選取值。"}},SNTable_SelectionLabel_OneSelectedValue:{id:"SNTable.SelectionLabel.OneSelectedValue",locale:{"de-DE":"Aktuell ist ein Wert ausgewählt.","en-US":"Currently there is one selected value.","es-ES":"Actualmente hay un valor seleccionado.","fr-FR":"Actuellement, une valeur est sélectionnée.","it-IT":"Attualmente è presente un solo valore selezionato.","ja-JP":"現在、値が 1 つ選択されています。","ko-KR":"현재 하나의 값이 선택되었습니다.","nl-NL":"Er is momenteel één waarde geselecteerd.","pl-PL":"Aktualnie jest jedna wybrana wartość.","pt-BR":"Atualmente, há um valor selecionado.","ru-RU":"В настоящее время выбрано одно значение.","sv-SE":"Just nu är ett värde valt.","tr-TR":"Şu anda seçili bir değer var.","zh-CN":"当前有一个已选择的值。","zh-TW":"目前有一個選取的值。"}},SNTable_SelectionLabel_SelectedValue:{id:"SNTable.SelectionLabel.SelectedValue",locale:{"de-DE":"Wert ist ausgewählt.","en-US":"Value is selected.","es-ES":"El valor está seleccionado.","fr-FR":"La valeur est sélectionnée.","it-IT":"Il valore è selezionato.","ja-JP":"値が選択されました。","ko-KR":"값이 선택되었습니다.","nl-NL":"Waarde is geselecteerd.","pl-PL":"Wartość jest wybrana.","pt-BR":"O valor está selecionado.","ru-RU":"Значение выбрано.","sv-SE":"Värdet är valt.","tr-TR":"Değer seçildi.","zh-CN":"已选择值。","zh-TW":"已選取值。"}},SNTable_SelectionLabel_SelectedValues:{id:"SNTable.SelectionLabel.SelectedValues",locale:{"de-DE":"Aktuell sind {0} Werte ausgewählt.","en-US":"Currently there are {0} selected values.","es-ES":"Actualmente hay {0} valores seleccionados.","fr-FR":"Actuellement, {0} valeurs sont sélectionnées.","it-IT":"Attualmente sono presenti {0} valori selezionati.","ja-JP":"現在、値が {0} つ選択されています。","ko-KR":"현재 {0}개의 값이 선택되었습니다.","nl-NL":"Er zijn momenteel {0} geselecteerde waarden.","pl-PL":"Liczba aktualnie wybranych wartości: {0}.","pt-BR":"Atualmente, há {0} valores selecionados.","ru-RU":"В настоящее время выбраны значения: {0}.","sv-SE":"Just nu är {0} värden valda.","tr-TR":"Şu anda seçili {0} değer var.","zh-CN":"当前有 {0} 个已选择的值。","zh-TW":"目前有 {0} 個選取的值。"}},SNTable_SelectionLabel_SelectionsConfirmed:{id:"SNTable.SelectionLabel.SelectionsConfirmed",locale:{"de-DE":"Auswahl bestätigt.","en-US":"Selections confirmed.","es-ES":"Confirmadas las selecciones.","fr-FR":"Sélections confirmées.","it-IT":"Selezioni confermate.","ja-JP":"選択が確定されました。","ko-KR":"선택 내용이 확인되었습니다.","nl-NL":"Selecties bevestigd.","pl-PL":"Potwierdzono wybory.","pt-BR":"Seleções confirmadas.","ru-RU":"Выборки подтверждены.","sv-SE":"Valen har bekräftats.","tr-TR":"Seçimler onaylandı.","zh-CN":"选择已确认。","zh-TW":"選項已確認。"}},SNTable_SelectionLabel_selected:{id:"SNTable.SelectionLabel.selected",locale:{"de-DE":"Ausgewählt","en-US":"Selected","es-ES":"Seleccionado","fr-FR":"Sélectionné","it-IT":"Selezionato","ja-JP":"選択済み","ko-KR":"선택됨","nl-NL":"Geselecteerd","pl-PL":"Wybrane","pt-BR":"Selecionado","ru-RU":"Выбрано","sv-SE":"Urval","tr-TR":"Seçildi","zh-CN":"已选择","zh-TW":"已選取"}},SNTable_SortLabel_PressSpaceToSort:{id:"SNTable.SortLabel.PressSpaceToSort",locale:{"de-DE":"Drücken Sie die Leertaste, um nach dieser Spalte zu sortieren","en-US":"Press space to sort on this column","es-ES":"Pulse la barra espaciadora para ordenar en esta columna.","fr-FR":"Appuyez sur Espace pour trier en fonction de cette colonne.","it-IT":"Premere la barra spaziatrice per ordinare questa colonna","ja-JP":"スペース キーを押して、この列をソートします","ko-KR":"이 열을 정렬하려면 스페이스바를 누르십시오.","nl-NL":"Druk op de spatiebalk om sorteren in deze kolom in te schakelen","pl-PL":"Naciśnij spację, aby posortować według tej kolumny","pt-BR":"Pressione espaço para classificar por esta coluna","ru-RU":"Нажмите пробел, чтобы отсортировать по этому столбцу","sv-SE":"Tryck på Blanksteg om du vill sortera efter den här kolumnen","tr-TR":"Bu sütunda sıralama yapmak için boşluk tuşuna basın.","zh-CN":"按下空格键以在该列上排序。","zh-TW":"在此欄按下空格鍵以進行排序"}},SNTable_SortLabel_SortedAscending:{id:"SNTable.SortLabel.SortedAscending",locale:{"de-DE":"In aufsteigender Reihenfolge sortiert.","en-US":"Sorted in ascending order.","es-ES":"Ordenado por orden ascendente.","fr-FR":"Tri dans l'ordre croissant.","it-IT":"Ordinato in ordine crescente.","ja-JP":"昇順で並べ替えられます。","ko-KR":"오름차순으로 정렬되었습니다.","nl-NL":"Gesorteerd in oplopende volgorde.","pl-PL":"Posortowane rosnąco.","pt-BR":"Classificado em ordem crescente.","ru-RU":"Сортировка в порядке возрастания.","sv-SE":"Sorterat i stigande ordning.","tr-TR":"Artan düzende sıralanmıştır.","zh-CN":"已按升序排列。","zh-TW":"已依遞增順序排序。"}},SNTable_SortLabel_SortedDescending:{id:"SNTable.SortLabel.SortedDescending",locale:{"de-DE":"In absteigender Reihenfolge sortiert.","en-US":"Sorted in descending order.","es-ES":"Ordenado por orden descendente.","fr-FR":"Tri dans l'ordre décroissant.","it-IT":"Ordinato in ordine decrescente.","ja-JP":"降順で並べ替えられます。","ko-KR":"내림차순으로 정렬되었습니다.","nl-NL":"Gesorteerd in aflopende volgorde.","pl-PL":"Posortowane malejąco.","pt-BR":"Classificado em ordem decrescente.","ru-RU":"Сортировка в порядке убывания.","sv-SE":"Sorterat i fallande ordning.","tr-TR":"Azalan düzende sıralanmıştır.","zh-CN":"已按降序排列。","zh-TW":"已依遞減順序排序。"}}};const lX=gg(e=>{const t=e(Ty),n=e(_y),r=e(Ug);let i;return function(e){const t="SNTable.Accessibility.RowsAndColumns";e.get(t)===t&&Object.keys(sX).forEach(t=>{e.add(sX[t])})}(t),({keys:e,politeness:o="polite"})=>{const a=e.map(e=>{if(Array.isArray(e)){const[n,...r]=e;return t.get(n,r)}return t.get(e)}).join(" "),s=n.querySelector(`.${JB.First}`),l=n.querySelector(`.${JB.Second}`);if(!s||!l)return void r.error({msg:"could not find aria-live elements, which means accessibility is not working properly"});let c;i===JB.First?(c=l,i=JB.Second):(c=s,i=JB.First),c.innerHTML=c.innerHTML.endsWith(" ")?a:`${a} `,c.setAttribute("aria-live",o)}}),cX=(e,t)=>{const n=_g(lX),r=_g(_y),i=_g(hU),o=_g(fU),a=_g(pU),s=_g(cU),[l,c]=Ig(iX),u=_g(iy),d=_g(wy);nX(()=>{const t=((e,t,n=!1)=>{const r=[QY(t),e[1]];return n?r:QB})(l,s,u);(({resetCellCoord:e,rootElement:t,shouldRefocus:n,isSelectionMode:r,setFocusedCellCoord:i,keyboard:o,announce:a})=>{if(rK(t),i(e),!(e=>!e.enabled||e.active)(o))return;const s=eK(t,e);n.current?(iK(s),n.current=!1):tK(s),r&&(a({keys:[s?.textContent??""]}),TY(a,s,r))})({resetCellCoord:t,rootElement:r,shouldRefocus:e,setFocusedCellCoord:c,isSelectionMode:u,keyboard:d,announce:n})},[a.length,o,i,t])},uX=e=>{Zh(e),DY(e)&&Om(e.currentTarget)},dX=e=>{LY(e.evt)&&(Zh(e.evt),aK(e))},pX=e=>{const{evt:t,totalsPosition:n,cell:r,isSelectionMode:i}=e;if(!LY(t))return;Zh(t);const o=((e,t)=>[e.pageRowIdx+QY(t),e.pageColIdx])(r,n),a=ZY(i,n),{nextCell:s,nextCellCoord:l}=aK({...e,cellCoord:o,allowedRows:a});l[0]!==o[0]&&(({evt:e,isSelectionsEnabled:t,cell:n,selectionDispatch:r,announce:i,isSelectionMode:o,nextCell:a})=>{e.shiftKey&&t&&n.isSelectable?r({type:KB.SelectMultiAdd,payload:{cell:n,evt:e,announce:i}}):TY(i,a,o)})({...e,nextCell:s})},fX=e=>{const{evt:t}=e;OY(t)?(({evt:e,totalRowCount:t,rowsPerPage:n,page:r,updateShouldRefocus:i,handleChangePage:o})=>{Zh(e);const a=Math.ceil(t/n)-1;e.key===Em.Right&&r<a?(i(),o(r+1)):e.key===Em.Left&&r>0&&(i(),o(r-1))})(e):t.key===Em.Esc?(({evt:e,keyboard:t,isSelectionMode:n})=>{t.enabled&&!n&&(Zh(e),t.blur?.(!0))})(e):NY(t.key)&&Zh(t)},hX=e=>{const{evt:t,selectionsAPI:n}=e;if(t.currentTarget.classList.contains(YB.Disabled))return void Zh(t);const r={...e,isSelectionMode:!!n?.isModal()};switch(t.key){case Em.Space:(({evt:e,cell:t,isSelectionsEnabled:n,selectionDispatch:r,announce:i})=>{Zh(e),t.isSelectable&&n&&r({type:KB.Select,payload:{cell:t,evt:e,announce:i}})})(r);break;case Em.Enter:(({isSelectionMode:e,selectionsAPI:t,evt:n,announce:r})=>{Zh(n),e&&(t?.confirm(),r({keys:["SNTable.SelectionLabel.SelectionsConfirmed"]}))})(r);break;case Em.Esc:(({isSelectionMode:e,selectionsAPI:t,evt:n,announce:r})=>{e&&(Zh(n),t?.cancel(),r({keys:["SNTable.SelectionLabel.ExitedSelectionMode"]}))})(r);break;case Em.C:uX(t);break;case Em.Tab:(({evt:e,keyboard:t,isSelectionMode:n,paginationNeeded:r})=>{const i=e.shiftKey||!r;t.enabled&&n&&i&&(Zh(e),Qh(e.currentTarget,t,e.shiftKey))})(r);break;default:pX(r)}},mX=e=>{const t=_g(dV),n=Ag(pV),r=Ag(fV),i=_g(GB),o=Yt.useRef();TK({ref:e,callback:a=>{const s=()=>{if(e.current){const e=a.borderBoxSize.at(0)?.inlineSize??0,t=a.borderBoxSize.at(0)?.blockSize??0,i=a.contentBoxSize.at(0)?.inlineSize??0,o=t-(a.contentBoxSize.at(0)?.blockSize??0);r(e-i),n(o)}};t?(o.current&&i.off("done-adjusting-column-width",o.current),i.once("done-adjusting-column-width",s),o.current=s):s()}}),Yt.useEffect(()=>{const e=i;return()=>{o.current&&e.off("done-adjusting-column-width",o.current)}},[i])},gX=Ul("div")({clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",width:"1px"}),yX=Ul(vh,{shouldForwardProp:e=>"fullHeight"!==e&&"interactions"!==e})(({fullHeight:e,interactions:t})=>({height:e?"100%":"calc(100% - 41px)",overflow:t.scroll?"auto":"hidden",border:"none"})),bX=Ul(rh,{shouldForwardProp:e=>"borderRight"!==e})(({borderRight:e})=>({tableLayout:"fixed",width:"min-content",borderRight:e})),vX=()=>lt.jsxs(lt.Fragment,{children:[lt.jsx(gX,{className:JB.First,"data-testid":JB.First,"aria-live":"polite","aria-atomic":"true"}),lt.jsx(gX,{className:JB.Second,"data-testid":JB.Second,"aria-live":"polite","aria-atomic":"true"})]}),xX=e=>{const t=Yt.useRef(new Map),n=Yt.useRef(null);Yt.useEffect(()=>{n.current=e(t.current),t.current.forEach((e,t)=>{n.current?.observe(t)});const r=t.current,i=n.current;return()=>{i.disconnect(),r.clear()}},[e,n,t]);const r=Yt.useCallback((e,r)=>{t.current.set(e,r),n.current?.observe(e)},[t,n]),i=Yt.useCallback(e=>{t.current.delete(e),n.current?.unobserve(e)},[n,t]);return Yt.useMemo(()=>({addTask:r,removeTask:i}),[r,i])},wX=e=>new ResizeObserver(t=>{t.forEach(t=>{const n=e.get(t.target);n?.(t)})}),SX=()=>xX(wX),kX=({updateShouldRefocus:e,tableWrapperRef:t})=>{const n=_g(oy),r=_g(wy),i=Ag(HY);Yt.useEffect(()=>{const o=()=>{i({type:KB.Reset})},a=()=>{i({type:KB.Clear})},s=()=>{t.current?.contains(document.activeElement)?e():r.enabled&&r.blur?.(!0),o()};return n?.on("deactivated",o),n?.on("canceled",o),n?.on("confirmed",s),n?.on("cleared",a),()=>{n?.removeListener("deactivated",o),n?.removeListener("canceled",o),n?.removeListener("confirmed",s),n?.removeListener("cleared",a)}},[n,r,i,e,t])},CX="min(50px, 20%)",EX=({bar:e,height:t})=>{const{value:n,offsetValue:r,columnMin:i,columnMax:o,isManualRange:a,thicknessPx:s,barEnd:l}=e,c=a?i:Math.min(i,0);let u=a?o:Math.max(o,0);u>c||(u=c+1);const d=r,p=r+n,f=n>=0,h=Math.min(d,p),m=Math.max(d,p),g=Math.round(((e,t,n)=>Math.max(t,Math.min(n,e)))(s??("none"===l?1*t:4),2,Math.max(2,t-2))),y=Math.min(((e,t)=>"circle"===e?2*t:"box"===e?t+4:0)(l,g),t),b=Math.min(d,p)<c,v=Math.max(d,p)>u,x="none"===l?25:10+("none"===l?0:y/2+2);return{rangeMin:c,rangeMax:u,hasRoomAtMin:e.hasNegativeValues??(a||c<0||!f),hasRoomAtMax:e.hasPositiveValues??(a||o>=0||f),low:h,high:m,valueEnd:f?m:h,growsTowardsHigh:f,overflowMin:b,overflowMax:v,hasBar:m>h&&m>c&&h<u,thicknessPx:g,capSize:y,hasZeroAxis:c<=0&&u>=0,oobSizePx:x}},MX=Ul("div")({position:"relative",width:"100%",overflow:"hidden"}),RX=Ul("div")({position:"absolute"}),_X=Ul("span")({position:"absolute",top:0,height:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),AX=Ul("svg")({position:"absolute",display:"block"}),IX=({shape:e,pointsRight:t,width:n,height:r})=>{if("slice"===e)return`M0 0L${n-8} ${r}L0 ${r}ZM8 0L${n} ${r}L${n} 0Z`;const i=n/2,o=i*Math.sin(Math.PI/3),a=t?i/2:1.5*i;return`M${a} ${i-o}L${t?n:0} ${i}L${a} ${i+o}Z`},PX=({height:e,theme:t,bar:n,direction:r,fontFamily:i,fontSize:o})=>{const a=(({bar:e,height:t,isRtl:n})=>{const r=EX({bar:e,height:t}),{rangeMin:i,rangeMax:o,low:a,high:s,overflowMin:l,overflowMax:c,thicknessPx:u,capSize:d,oobSizePx:p}=r,f=r.hasRoomAtMin?CX:"0px",h=r.hasRoomAtMax?CX:"0px",m=f,g=`calc(100% - ${h})`,y=e=>{const t=(Math.min(Math.max(e,i),o)-i)/(o-i);return`calc(${f} + ${t} * (100% - ${f} - ${h}))`},b="none"===e.barEnd,v=b?25:10,x=c?`max(${g} - ${p}px, ${l?m:y(a)})`:y(s),w=l?`min(${m} + ${p}px, ${c?g:y(s)})`:y(a),S=r.growsTowardsHigh?x:w,k=e=>Math.floor((t-e)/2),C=k(u),E=d>0?d/2+4:4,M=e=>{const t=b?u:10;return{key:e,shape:b?"slice":"triangle",pointsRight:"max"===e!==n,width:v,height:t,style:{..."min"===e?{insetInlineStart:f}:{insetInlineEnd:h},top:k(t),width:v,height:t}}};return{zeroAxis:r.hasZeroAxis?{insetInlineStart:`calc(${y(0)} - 0.5px)`,top:0,width:1,height:"100%"}:void 0,bar:r.hasBar?{insetInlineStart:w,width:`max(1px, ${x} - ${w})`,top:C,height:u}:void 0,cap:r.hasBar&&d>0?{insetInlineStart:`calc(${S} - ${d/2}px)`,top:k(d),width:d,height:d,borderRadius:"circle"===e.barEnd?"50%":void 0}:void 0,label:e.label?r.growsTowardsHigh?{insetInlineStart:c?`calc(${g} + 4px)`:l?`max(${x} + ${E}px, ${m} + ${v+4}px)`:`calc(${x} + ${E}px)`,insetInlineEnd:"4px",textAlign:"start"}:{insetInlineStart:"4px",insetInlineEnd:`calc(100% - ${l?`calc(${m} - 4px)`:c?`min(${w} - ${E}px, ${g} - ${v+4}px)`:`calc(${w} - ${E}px)`})`,textAlign:"end"}:void 0,markers:[l?M("min"):void 0,c?M("max"):void 0].filter(e=>void 0!==e)}})({bar:n,height:e,isRtl:"rtl"===r}),s=n.color??Xh(t,n.colorPalette,t.getDataColorSpecials().primary),l=n.labelColor??Xh(t,n.labelColorPalette,"inherit");return lt.jsxs(MX,{"data-testid":"bar-container",role:"img","aria-label":n.label||n.fallbackLabel,dir:r,style:{height:e},children:[a.zeroAxis?lt.jsx(RX,{"data-testid":"bar-zero-axis",style:{...a.zeroAxis,backgroundColor:"#d0d0d0"}}):null,a.bar?lt.jsx(RX,{"data-testid":"bar",style:{...a.bar,backgroundColor:s}}):null,a.cap?lt.jsx(RX,{"data-testid":"bar-end-cap",style:{...a.cap,backgroundColor:s}}):null,a.label?lt.jsx(_X,{"data-testid":"bar-label",style:{...a.label,fontFamily:i,fontSize:o??"14px",lineHeight:`${e}px`,color:l},children:n.label}):null,a.markers.map(e=>lt.jsx(AX,{"data-testid":`bar-oob-${e.key}`,width:e.width,height:e.height,viewBox:`0 0 ${e.width} ${e.height}`,style:e.style,children:lt.jsx("path",{d:IX(e),fill:s})},e.key))]})},TX=e=>{e.stopPropagation()},DX=({href:e,text:t,interactions:n,color:r})=>({href:e,title:t,rel:"noreferrer",target:"_blank",underline:"hover",onClick:TX,color:Uh.LINK,style:{pointerEvents:n.active?"auto":"none",color:r??void 0,opacity:n.active&&n.passive||r?void 0:.4}}),OX=({href:e,text:t,interactions:n,color:r})=>lt.jsx(gp,{...DX({href:e,text:t,interactions:n,color:r}),children:t}),NX=window.requestIdleCallback??(e=>setTimeout(()=>{e({})},0)),qX=window.cancelIdleCallback??(e=>{clearTimeout(e)});let LX=0,jX=0,zX=0;function FX(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function $X(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function HX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?BX(Object(n),!0).forEach(function(t){$X(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BX(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function VX(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return FX(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?FX(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var WX=Object.prototype.hasOwnProperty,UX=Object.prototype.toString,GX=Object.defineProperty,YX=Object.getOwnPropertyDescriptor,KX=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===UX.call(e)},XX=function(e){if(!e||"[object Object]"!==UX.call(e))return!1;var t,n=WX.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&WX.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||WX.call(e,t)},JX=function(e,t){GX&&"__proto__"===t.name?GX(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},QX=function(e,t){if("__proto__"===t){if(!WX.call(e,t))return;if(YX)return YX(e,t).value}return e[t]},ZX=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=QX(s,n),s!==(i=QX(t,n))&&(u&&i&&(XX(i)||(o=KX(i)))?(o?(o=!1,a=r&&KX(r)?r:[]):a=r&&XX(r)?r:{},JX(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&JX(s,{name:n,newValue:i}));return s};function eJ(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=i.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map(e=>e.instance).indexOf(e),s=i.wrappedFields[t].attrExps.map(e=>e.instance).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(r)&&r.some((e,t)=>e!==t)){const e=r.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:l>=0?e=>e[a].qAttrDims.qValues[l]:s>=0?e=>e[a].qAttrExps.qValues[s]:e=>e[a]}function tJ(e,t,n){let r=n.key;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function nJ(e){let t=e.cache,n=e.f,r=e.mainCell,i=e.p,o=e.page,a=e.rowIdx,s=e.row,l=e.sourceKey,c=e.target,u=e.targetProp,d=e.columnOrder,p=r;if(i.field&&i.field!==n){const e=eJ(i.field,o,{cache:t},d);if(-1===e)return;p=ZX({qRow:a},e(s))}c[u]=tJ(i,p,{key:l})}function rJ(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const a=t.raw(),s=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),c=r.normalizeConfig(i[e],t),u=c.props,d=c.main,p=Object.keys(u),f=!!i[e].trackBy,h=typeof i[e].trackBy,m={},g=[],y=[];for(let t=0;t<a.qDataPages.length;t++){const o=eJ(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let c=0;c<a.qDataPages[t].qMatrix.length;c++){const b=a.qDataPages[t].qArea.qTop+c,v=ZX({qRow:b},o(a.qDataPages[t].qMatrix[c])),x=tJ(d,v,{key:s});if(!(d.filter&&!d.filter(v))){for(let e=0;e<p.length;e++){const r=u[p[e]];let i=r.fields||[r];r.fields&&(x[p[e]]=[]);for(let o=0;o<i.length;o++)nJ({cache:n,f:l,mainCell:v,p:i[o],prop:p[e],page:a.qDataPages[t],rowIdx:b,row:a.qDataPages[t].qMatrix[c],sourceKey:s,target:r.fields?x[p[e]]:x,targetProp:r.fields?o:p[e],columnOrder:a.qColumnOrder});if(r.fields){const t=x[p[e]].map(e=>e.value),n=x[p[e]].map(e=>e.label);x[p[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[p[e]].value)}}}f&&r.track({cfg:i[e],itemData:v,obj:x,target:g,tracker:m,trackType:h}),y.push(x)}}}const b=f?r.collect(g,{main:d,propsArr:p,props:u}):y;o=[...o,...b]}return o}function iJ(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function oJ(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=sJ)):void 0===t&&(t=aJ);for(var n,r,i,o,a,s=new uJ(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new uJ(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(cJ)}function aJ(e){return e.children}function sJ(e){return Array.isArray(e)?e[1]:null}function lJ(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function cJ(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function uJ(e){this.data=e,this.depth=this.height=0,this.parent=null}function dJ(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}uJ.prototype=oJ.prototype={constructor:uJ,count:function(){return this.eachAfter(iJ)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;e=n.pop(),t=r.pop();for(;e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t},copy:function(){return oJ(this).eachBefore(lJ)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}};var pJ={depth:-1},fJ={},hJ={};function mJ(e){return e.id}function gJ(e){return e.parentId}function yJ(){var e,t=mJ,n=gJ;function r(r){var i,o,a,s,l,c,u,d,p=Array.from(r),f=t,h=n,m=new Map;if(null!=e){const t=p.map((t,n)=>function(e){e=`${e}`;let t=e.length;vJ(e,t-1)&&!vJ(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,r))),n=t.map(bJ),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(bJ(e)),p.push(hJ));f=(e,n)=>t[n],h=(e,t)=>n[t]}for(a=0,i=p.length;a<i;++a)o=p[a],c=p[a]=new uJ(o),null!=(u=f(o,a,r))&&(u+="")&&(d=c.id=u,m.set(d,m.has(d)?fJ:c)),null!=(u=h(o,a,r))&&(u+="")&&(c.parent=u);for(a=0;a<i;++a)if(u=(c=p[a]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===fJ)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(s)throw new Error("multiple roots");s=c}if(!s)throw new Error("no root");if(null!=e){for(;s.data===hJ&&1===s.children.length;)s=s.children[0],--i;for(let e=p.length-1;e>=0&&(c=p[e]).data===hJ;--e)c.data=null}if(s.parent=pJ,s.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(cJ),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=dJ(e),r):t},r.parentId=function(e){return arguments.length?(n=dJ(e),r):n},r.path=function(t){return arguments.length?(e=dJ(t),r):e},r}function bJ(e){let t=e.length;if(t<2)return"";for(;--t>1&&!vJ(e,t););return e.slice(0,t)}function vJ(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function xJ(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=xJ(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=xJ(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function wJ(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...wJ(e[i].children,t-1,n)]);return r}function SJ(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const r=Math.max(0,Math.min(100,t-e));return e=>wJ(e.children,r-1,n)}return!1}const kJ=/^qDimensionInfo(?:\/(\d+))?/,CJ=/^\/?qMeasureInfo\/(\d+)/,EJ=/\/qAttrExprInfo\/(\d+)/,MJ=/\/qAttrDimInfo\/(\d+)/;function RJ(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function _J(e,t){let n=t.cube;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,d=r;const p=n.qEffectiveInterColumnSortOrder,f=RJ(n);return kJ.test(d)&&(i=!0,o=+kJ.exec(d)[1],d=r.replace(kJ,"")),CJ.test(d)&&("K"===n.qMode?c=+CJ.exec(d)[1]:p&&-1!==p.indexOf(-1)?(c=+CJ.exec(d)[1],u=0):u=+CJ.exec(d)[1],d=d.replace(CJ,"")),d&&(MJ.exec(d)?s=+MJ.exec(d)[1]:EJ.exec(d)&&(a=+EJ.exec(d)[1])),l=i?"S"===n.qMode?f[o]:p?p.indexOf(o):o:p&&-1!==p.indexOf(-1)?p.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:s,attrIdx:a}}function AJ(e,t){let n,r,i=SJ(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function IJ(e,t,n){let r=n.key;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function PJ(e){let t=e.propsArr,n=e.props,r=e.item,i=e.itemData,o=e.ret,a=e.sourceKey;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let c,u;s.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const d=l[n];let p,f,h,m,g,y;if("primitive"===d.type?(h=d.value,y=String(d.value)):("function"==typeof d.value&&(p=e=>d.value(e,r)),"function"==typeof d.label&&(f=e=>d.label(e,r)),d.accessor?(m=d.accessor(r),Array.isArray(m)?(g=m.map(d.valueAccessor),d.attrAccessor&&(g=g.map(d.attrAccessor)),p&&(h=g.map(p),p=null),f&&(y=g.map(f),f=null),h=d.reduce?d.reduce(h):h,y=d.reduceLabel?d.reduceLabel(y,h):String(h)):(h=d.attrAccessor?d.attrAccessor(d.valueAccessor(m)):d.valueAccessor(m),y=h)):(h=i,y=i)),s.fields){const e=p?p(h):h;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=p?p(h):h;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},d.field&&(o[t[e]].source={field:d.field.key(),key:a})}}c&&(o[t[e]]={value:"function"==typeof s.value?s.value(c,r):c,label:"function"==typeof s.label?s.label(u,r):u})}}const TJ=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=xJ(r,e);return o&&o[0]?(t.tree=oJ(o[0],n.children||(e=>e[i])),t.tree):null};const DJ=e=>{let t=e.propsArr,n=e.props,r=e.cube;e.cache;let i=e.itemDepthObject,o=e.f;for(let e=0;e<t.length;e++){const a=n[t[e]],s=a.fields?a.fields:[a];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==o){const e=AJ(i,_J(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function OJ(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const i=t.raw(),o=t.key(),a="S"===i.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}(e),r=e.fields(),i=e.fields().filter(e=>"dimension"===e.type()).map(e=>n.indexOf(r.indexOf(e))),o=e.fields().filter(e=>"measure"===e.type()).map(e=>n.indexOf(r.indexOf(e))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let r="__root",l=!1;for(let e=0;e<i.length;e++){var s;const t=n[i[e]],o="".concat(r,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=HX({__id:o,__parent:r,qValues:[]},t),l=!0),r=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[r].qValues.push(t)}}const l=Object.keys(a).map(e=>a[e]),c=yJ().id(e=>e.__id).parentId(e=>e.__parent)(l);return c}(t):TJ(i,n,e);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===i.qMode){let e=RJ(i)[o-1];a=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),a=n.fields[e]}const s=r.normalizeConfig(HX(HX({},e),{},{field:a?a.key():void 0}),t),c=s.props,u=s.main,d=Object.keys(c);l[o]={propsArr:d,props:c,main:u};const p=a?_J(a,{cube:i}):{fieldDepth:0};DJ({propsArr:d,props:c,cube:i,cache:n,itemDepthObject:p,f:a})}const c=a.copy().descendants(),u=a.descendants();for(let e=0;e<u.length;e++){const t=l[u[e].depth].propsArr,n=l[u[e].depth].props,r=l[u[e].depth].main,i=c[e],a=i.data,s=IJ(r,a,{key:o});PJ({propsArr:t,props:n,item:i,itemData:a,ret:s,sourceKey:o}),u[e].data=s}return a}function NJ(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<i.length;a++)if(void 0!==i[a].field){const s=t.raw(),l=t.key();if(!TJ(s,n,e))continue;const c="object"==typeof i[a].field?i[a].field:t.field(i[a].field),u=r.normalizeConfig(i[a],t),d=u.props,p=u.main,f=Object.keys(d),h=_J(c,{cube:s}),m=AJ({fieldDepth:0},h),g=m.nodeFn,y=m.attrFn,b=m.valueFn;DJ({propsArr:f,props:d,cube:s,cache:n,itemDepthObject:h,f:c});const v=!!i[a].trackBy,x=typeof i[a].trackBy,w={},S=[],k=g(n.tree),C=[];for(let e=0;e<k.length;e++){const t=k[e],n=y?y(b(t)):b(t);if(p.filter&&!p.filter(n))continue;const o=IJ(p,n,{key:l});PJ({propsArr:f,props:d,item:t,itemData:n,ret:o,sourceKey:l}),v&&r.track({cfg:i[a],itemData:n,obj:o,target:S,tracker:w,trackType:x}),C.push(o)}const E=v?r.collect(S,{main:p,propsArr:f,props:d}):C;o=[...o,...E]}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var qJ=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e){
|
|
139
|
+
*/var aB=(iB||(iB=1,function(e,t){var n;function r(e,t){var n=[],r=0;function i(e){return n.push(e),t}function o(){return n[r++]}return{tokenize:function(t){return t.replace(e,i)},detokenize:function(e){return e.replace(new RegExp("("+t+")","g"),o)}}}n=new function(){var e="`TMP`",t="`COMMENT`",n="[^\\u0020-\\u007e]",i="(?:[0-9]*\\.[0-9]+|[0-9]+)",o="(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)",a="direction\\s*:\\s*",s="['\"]?\\s*",l="(^|[^a-zA-Z])",c="\\/\\*\\!?\\s*@noflip\\s*\\*\\/",u="(?:(?:(?:\\\\[0-9a-f]{1,6})(?:\\r\\n|\\s)?)|\\\\[^\\r\\n\\f0-9a-f])",d="(?:[_a-z0-9-]|"+n+"|"+u+")",p=i+"(?:\\s*"+o+"|-?(?:[_a-z]|"+n+"|"+u+")"+d+"*)?",f="((?:-?"+p+")|(?:inherit|auto))",h="((?:-?"+p+")|(?:inherit|auto)|(?:calc\\((?:(?:(?:\\(|\\)|\\t| )|(?:-?"+i+"(?:\\s*"+o+")?)|(?:\\+|\\-|\\*|\\/)){3,})\\)))",m="(#?"+d+"+|(?:rgba?|hsla?)\\([ \\d.,%-]+\\))",g="(?:[!#$%&*-~]|"+n+"|"+u+")*?",y="(?![a-zA-Z])",b="(?!("+d+"|\\r?\\n|\\s|#|\\:|\\.|\\,|\\+|>|~|\\(|\\)|\\[|\\]|=|\\*=|~=|\\^=|'[^']*'|\"[^\"]*\"|"+t+")*?{)",v="(?!"+g+s+"\\))",x="(?="+g+s+"\\))",w="(\\s*(?:!important\\s*)?[;}])",S=/`TMP`/g,k=/`TMPLTR`/g,C=/`TMPRTL`/g,E=new RegExp("\\/\\*[^*]*\\*+([^\\/*][^*]*\\*+)*\\/","gi"),M=new RegExp("("+c+b+"[^;}]+;?)","gi"),R=new RegExp("("+c+"[^\\}]*?})","gi"),_=new RegExp("("+a+")ltr","gi"),A=new RegExp("("+a+")rtl","gi"),I=new RegExp(l+"(left)"+y+v+b,"gi"),P=new RegExp(l+"(right)"+y+v+b,"gi"),T=new RegExp(l+"(left)"+x,"gi"),D=new RegExp(l+"(right)"+x,"gi"),O=/(:dir\( *)ltr( *\))/g,N=/(:dir\( *)rtl( *\))/g,q=new RegExp(l+"(ltr)"+x,"gi"),L=new RegExp(l+"(rtl)"+x,"gi"),j=new RegExp(l+"([ns]?)e-resize","gi"),z=new RegExp(l+"([ns]?)w-resize","gi"),F=new RegExp("((?:margin|padding|border-width)\\s*:\\s*)"+h+"(\\s+)"+h+"(\\s+)"+h+"(\\s+)"+h+w,"gi"),$=new RegExp("((?:-color|border-style)\\s*:\\s*)"+m+"(\\s+)"+m+"(\\s+)"+m+"(\\s+)"+m+w,"gi"),B=new RegExp("(background(?:-position)?\\s*:\\s*(?:[^:;}\\s]+\\s+)*?)("+p+")","gi"),H=new RegExp("(background-position-x\\s*:\\s*)(-?"+i+"%)","gi"),V=new RegExp("(border-radius\\s*:\\s*)"+f+"(?:(?:\\s+"+f+")(?:\\s+"+f+")?(?:\\s+"+f+")?)?(?:(?:(?:\\s*\\/\\s*)"+f+")(?:\\s+"+f+")?(?:\\s+"+f+")?(?:\\s+"+f+")?)?"+w,"gi"),W=new RegExp("(box-shadow\\s*:\\s*(?:inset\\s*)?)"+f,"gi"),U=new RegExp("(text-shadow\\s*:\\s*)"+f+"(\\s*)"+m,"gi"),G=new RegExp("(text-shadow\\s*:\\s*)"+m+"(\\s*)"+f,"gi"),Y=new RegExp("(text-shadow\\s*:\\s*)"+f,"gi"),K=new RegExp("(transform\\s*:[^;}]*)(translateX\\s*\\(\\s*)"+f+"(\\s*\\))","gi"),X=new RegExp("(transform\\s*:[^;}]*)(translate\\s*\\(\\s*)"+f+"((?:\\s*,\\s*"+f+"){0,2}\\s*\\))","gi");function J(e,t,n){var r,i;return t.split("(").length>t.split(")").length?e:("%"===n.slice(-1)&&(-1!==(r=n.indexOf("."))?(i=n.length-r-2,n=(n=100-parseFloat(n)).toFixed(i)+"%"):n=100-parseFloat(n)+"%"),t+n)}function Q(e){switch(e.length){case 4:e=[e[1],e[0],e[3],e[2]];break;case 3:e=[e[1],e[0],e[1],e[2]];break;case 2:e=[e[1],e[0]];break;case 1:e=[e[0]]}return e.join(" ")}function Z(e,t){var n=[].slice.call(arguments),r=n.slice(2,6).filter(function(e){return e}),i=n.slice(6,10).filter(function(e){return e}),o=n[10]||"";return t+(i.length?Q(r)+" / "+Q(i):Q(r))+o}function ee(e){return 0===parseFloat(e)?e:"-"===e[0]?e.slice(1):"-"+e}function te(e,t,n){return t+ee(n)}function ne(e,t,n,r,i){return t+n+ee(r)+i}function re(e,t,n,r,i){return t+n+r+ee(i)}return{transform:function(n,i){var o=new r(M,"`NOFLIP_SINGLE`"),a=new r(R,"`NOFLIP_CLASS`"),s=new r(E,t);return n=s.tokenize(a.tokenize(o.tokenize(n.replace("`","%60")))),i.transformDirInUrl&&(n=n.replace(O,"$1`TMPLTR`$2").replace(N,"$1`TMPRTL`$2").replace(q,"$1"+e).replace(L,"$1ltr").replace(S,"rtl").replace(k,"ltr").replace(C,"rtl")),i.transformEdgeInUrl&&(n=n.replace(T,"$1"+e).replace(D,"$1left").replace(S,"right")),n=n.replace(_,"$1"+e).replace(A,"$1ltr").replace(S,"rtl").replace(I,"$1"+e).replace(P,"$1left").replace(S,"right").replace(j,"$1$2"+e).replace(z,"$1$2e-resize").replace(S,"w-resize").replace(V,Z).replace(W,te).replace(U,re).replace(G,re).replace(Y,te).replace(K,ne).replace(X,ne).replace(F,"$1$2$3$8$5$6$7$4$9").replace($,"$1$2$3$8$5$6$7$4$9").replace(B,J).replace(H,J),n=o.detokenize(a.detokenize(s.detokenize(n)))}}},e.exports?t.transform=function(e,t,r){var i;return"object"==typeof t?i=t:(i={},"boolean"==typeof t&&(i.transformDirInUrl=t),"boolean"==typeof r&&(i.transformEdgeInUrl=r)),n.transform(e,i)}:"undefined"!=typeof window&&(window.cssjanus=n)}(oB,oB.exports)),oB.exports),sB=Xe(aB),lB="comm",cB="rule",uB="decl",dB=Math.abs,pB=String.fromCharCode;function fB(e){return e.trim()}function hB(e,t,n){return e.replace(t,n)}function mB(e,t){return 0|e.charCodeAt(t)}function gB(e,t,n){return e.slice(t,n)}function yB(e){return e.length}function bB(e,t){return t.push(e),e}var vB=1,xB=1,wB=0,SB=0,kB=0,CB="";function EB(e,t,n,r,i,o,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:vB,column:xB,length:a,return:"",siblings:s}}function MB(){return kB=SB>0?mB(CB,--SB):0,xB--,10===kB&&(xB=1,vB--),kB}function RB(){return kB=SB<wB?mB(CB,SB++):0,xB++,10===kB&&(xB=1,vB++),kB}function _B(){return mB(CB,SB)}function AB(){return SB}function IB(e,t){return gB(CB,e,t)}function PB(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function TB(e){return fB(IB(SB-1,NB(91===e?e+2:40===e?e+1:e)))}function DB(e){for(;(kB=_B())&&kB<33;)RB();return PB(e)>2||PB(kB)>3?"":" "}function OB(e,t){for(;--t&&RB()&&!(kB<48||kB>102||kB>57&&kB<65||kB>70&&kB<97););return IB(e,AB()+(t<6&&32==_B()&&32==RB()))}function NB(e){for(;RB();)switch(kB){case e:return SB;case 34:case 39:34!==e&&39!==e&&NB(kB);break;case 40:41===e&&NB(e);break;case 92:RB()}return SB}function qB(e,t){for(;RB()&&e+kB!==57&&(e+kB!==84||47!==_B()););return"/*"+IB(t,SB-1)+"*"+pB(47===e?e:RB())}function LB(e){for(;!PB(_B());)RB();return IB(e,SB)}function jB(e){return function(e){return CB="",e}(zB("",null,null,null,[""],e=function(e){return vB=xB=1,wB=yB(CB=e),SB=0,[]}(e),0,[0],e))}function zB(e,t,n,r,i,o,a,s,l){for(var c=0,u=0,d=a,p=0,f=0,h=0,m=1,g=1,y=1,b=0,v=0,x="",w=i,S=o,k=r,C=x;g;)switch(h=v,v=RB()){case 40:108!=h&&58==mB(C,d-1)?(b++,C+="("):C+=TB(v);break;case 41:b--,C+=")";break;case 34:case 39:case 91:C+=TB(v);break;case 9:case 10:case 13:case 32:if(b>0){C+=pB(v);break}C+=DB(h);break;case 92:C+=OB(AB()-1,7);continue;case 47:switch(_B()){case 42:case 47:bB($B(qB(RB(),AB()),t,n,l),l),5!=PB(h||1)&&5!=PB(_B()||1)||!yB(C)||" "===gB(C,-1,void 0)||(C+=" ");break;default:C+="/"}break;case 123*m:s[c++]=yB(C)*y;case 125*m:case 59:case 0:if(b>0&&v){C+=pB(v);break}switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(C=hB(C,/\f/g,"")),f>0&&(yB(C)-d||0===m)&&bB(f>32?BB(C+";",r,n,d-1,l):BB(hB(C," ","")+";",r,n,d-2,l),l);break;case 59:C+=";";default:if(bB(k=FB(C,t,n,c,u,i,s,x,w=[],S=[],d,o),o),123===v)if(0===u)zB(C,t,k,k,w,o,d,s,S);else{switch(p){case 99:if(110===mB(C,3))break;case 108:if(97===mB(C,2))break;default:u=0;case 100:case 109:case 115:}u?zB(e,k,k,r&&bB(FB(e,k,k,0,0,i,s,x,i,w=[],d,S),S),i,S,d,s,r?w:S):zB(C,k,k,k,[""],S,0,s,S)}}c=u=f=0,m=y=1,x=C="",d=a;break;case 58:d=1+yB(C),f=h;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==MB())continue;switch(C+=pB(v),v*m){case 38:y=u>0?1:(C+="\f",-1);break;case 44:if(b>0)break;s[c++]=(yB(C)-1)*y,y=1;break;case 64:45===_B()&&(C+=TB(RB())),p=_B(),u=d=yB(x=C+=LB(AB())),v++;break;case 45:45===h&&2==yB(C)&&(m=0)}}return o}function FB(e,t,n,r,i,o,a,s,l,c,u,d){for(var p=i-1,f=0===i?o:[""],h=function(e){return e.length}(f),m=0,g=0,y=0;m<r;++m)for(var b=0,v=gB(e,p+1,p=dB(g=a[m])),x=e;b<h;++b)(x=fB(g>0?f[b]+" "+v:hB(v,/&\f/g,f[b])))&&(l[y++]=x);return EB(e,t,n,0===i?cB:s,l,c,u,d)}function $B(e,t,n,r){return EB(e,t,n,lB,pB(kB),gB(e,2,-2),0,r)}function BB(e,t,n,r,i){return EB(e,t,n,uB,gB(e,0,r),gB(e,r+1,-1),r,i)}function HB(e,t,n){switch(e.type){case"@import":case uB:case lB:return e.return=e.return||e.value;case cB:e.value=Array.isArray(e.props)?e.props.join(","):e.props,Array.isArray(e.children)&&e.children.forEach(function(e){e.type===lB&&(e.children=e.value)})}var r=function(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}(Array.prototype.concat(e.children),HB);return yB(r)?e.return=e.value+"{"+r+"}":""}function VB(e,t,n,r){if("@keyframes"===e.type||"@supports"===e.type||e.type===cB&&(!e.parent||"@media"===e.parent.type||e.parent.type===cB)){var i=sB.transform(HB(e));e.children=i?jB(i)[0].children:[],e.return=""}}Object.defineProperty(VB,"name",{value:"stylisRTLPlugin"});const WB=KR(({options:e,...t})=>gg(cm(t,e)()),(e,t)=>e.fontSize===t.fontSize&&e.fontFamily===t.fontFamily&&e.fontStyle===t.fontStyle&&e.fontWeight===t.fontWeight&&e.options?.maxNbrLinesOfText===t.options?.maxNbrLinesOfText&&e.options?.allowLineBreaks===t.options?.allowLineBreaks);let UB=class{#v={on:new Map,once:new Map};#x=10;#w(e){this.listenerCount(e)>this.#x&&console.warn(`Possible EventEmitter memory leak detected. ${this.listenerCount(e)} listeners added to "${String(e)}".`)}#S(e,t,n){const r=this.#v[e].get(t)??new Set;r.add(n),this.#v[e].set(t,r),this.#w(t)}setMaxListeners(e){this.#x=e}on(e,t){this.#S("on",e,t)}once(e,t){this.#S("once",e,t)}off(e,t){this.#v.on.get(e)?.delete(t),this.#v.once.get(e)?.delete(t)}emit(e,...t){this.#v.on.get(e)?.forEach(e=>{e(...t)}),this.#v.once.get(e)?.forEach(e=>{e(...t)}),this.#v.once.delete(e)}listenerCount(e){return(this.#v.on.get(e)?.size??0)+(this.#v.once.get(e)?.size??0)}removeAllListeners(e){void 0===e?(this.#v.on.clear(),this.#v.once.clear()):(this.#v.on.delete(e),this.#v.once.delete(e))}};const GB=gg(()=>new UB);let YB=function(e){return e.Selected="selected",e.Possible="possible",e.Disabled="disabled",e.Inactive="inactive",e}({}),KB=function(e){return e.Select="Select",e.SelectMouseDown="SelectMouseDown",e.SelectMouseUp="SelectMouseUp",e.SelectMultiAdd="SelectMultiAdd",e.SelectMultiEnd="SelectMultiEnd",e.Reset="Reset",e.Clear="Clear",e.UpdatePageRows="UpdatePageRows",e}({}),XB=function(e){return e.A="ascending",e.D="descending",e}({}),JB=function(e){return e.First="sn-table-announcer-1",e.Second="sn-table-announcer-2",e}({});const QB=[0,0],ZB=e=>"number"==typeof e&&!Number.isNaN(+e),eH=e=>ZB(e.qNum),tH=e=>"string"==typeof e&&e.length>0&&!Number.isNaN(+e),nH=e=>"string"==typeof e&&e.length>0||"number"==typeof e?+e:NaN,rH=(e,t)=>e.max===e.min?.5:(t-e.min)/(e.max-e.min),iH=(e,t,n)=>{const r=e.paletteColors?e.paletteColors[t]:e.localPaletteColors[t];return n.getColorPickerColor(r)},oH=(e,t,n)=>{const r={previousColor:(i=e.localPaletteColors)[(o=t)-(o>0?1:0)],nextColor:i[o+(o<i.length-1?1:0)]};var i,o;const a=((e,t)=>{const n=e.limits&&e.limits.concat().sort((e,t)=>e.value-t.value);return{lowerLimit:n&&t>0?n[t-1]:{value:0,gradient:!1},upperLimit:n&&n[t]?n[t]:{value:1,gradient:!1}}})(e,t),s=((e,t,n,r,i)=>{const{upperLimit:o,lowerLimit:a}=e,{previousColor:s,nextColor:l}=t,c=r===o.value?1:(r-a.value)/(o.value-a.value);return a.gradient&&o.gradient?r-a.value<o.value-r?{color:s.color,t:.5-c}:{color:l.color,t:c-.5}:a.gradient?{color:s.color,t:1-(.5+c/2)}:o.gradient?{color:l.color,t:c/2}:{color:i.localPaletteColors[n].color,t:r}})(a,r,t,n,e);return h(e.localPaletteColors[t].color??"").blend(h(s.color??""),s.t)},aH=(e,t,n)=>{const r=((e,t)=>{const{limits:n}=e;return n&&(e.limits=n.sort((e,t)=>e.value-t.value),e.limits=n.map(e=>({...e,value:rH(t,e.value)}))),e})({...e},t),i=r.paletteColors||r.localPaletteColors;return i&&(r.localPaletteColors=i.concat().map((e,t)=>({color:iH(r,t,n)}))),r},sH=(e,t,n,r)=>{const i=aH(e,n,r),{localPaletteColors:o}=i;if(t<=0)return o[0].color;if(t>=1)return o[o.length-1].color;const a=((e,t)=>{let n="",r=0;const{limits:i,localPaletteColors:o}=e;for(let a=0;a<o.length;a++){const o=i&&i[a]?i[a].value:1;if(t>=r&&t<o){n=oH(e,a,t);break}r=o}return n})(i,t);return a},lH=(e,t)=>{const n=(e=>e.map(e=>e.value??e).sort((e,t)=>e-t))(e),r=n.some(e=>!ZB(e));return 0===n.length||r?(e=>{const t=0===e?0:.5*e;return{min:e-t,max:e+t}})(t):1===n.length?((e,t)=>{const n=e[0]-t;if(0===n||!ZB(n)){const e=0===t?.5:Math.abs(.5*t);return{min:t-e,max:t+e}}return n>0?{min:t-.5*Math.abs(t),max:e[0]+2*n}:{min:e[0]+2*n,max:t+.5*Math.abs(t)}})(n,t):((e,t)=>{let n=e[e.length-1]-e[0];return n=n>0?n:1,{min:Math.min(t,e[0])-n/2,max:Math.max(t,e[e.length-1])+n/2}})(n,t)},cH=(e,t)=>{const{limits:n}=e.segments;if(!n)return;const r=((e,t)=>{const{min:n,max:r}=lH(e,t),i=Math.abs(t);return{min:n??t-i,max:r??t+i}})(n,t),i=((e,t,n)=>{const{limits:r,paletteColors:i,localPaletteColors:o}=e.segments;if(!r||!ZB(t))return 0;let a=n&&ZB(n)?Math.min(n,t):0;const s=r.sort((e,t)=>e.value-t.value),l=i||o;for(let e=0;e<l.length;e++){if(e===l.length-1||t<s[e].value&&t>=a)return e;a=s[e].value}return 0})(e,t,r.min);return{limitRange:r,limitPaletteColorIndex:i}},uH=(e,t)=>lt.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:lt.jsx("path",{d:"M7.5 8.5H2v-1h5.5V2h1v5.5H14v1H8.5V14h-1z"})}),dH=Yt.forwardRef(uH),pH=(e,t)=>lt.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:lt.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"})}),fH=Yt.forwardRef(pH),hH=(e,t)=>lt.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:[lt.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"}),lt.jsx("use",{fillRule:"evenodd"})]}),mH=Yt.forwardRef(hH),gH=(e,t)=>lt.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:lt.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"})}),yH=Yt.forwardRef(gH),bH=(e,t)=>lt.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:lt.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"})}),vH=Yt.forwardRef(bH),xH=(e,t)=>lt.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:lt.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"})}),wH=Yt.forwardRef(xH),SH=(e,t)=>lt.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:lt.jsx("path",{d:"M2 7.5h12v1H2z"})}),kH=Yt.forwardRef(SH),CH=(e,t)=>lt.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:lt.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"})}),EH=Yt.forwardRef(CH),MH=(e,t)=>lt.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:lt.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"})}),RH=Yt.forwardRef(MH),_H=(e,t)=>lt.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:lt.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"})}),AH=Yt.forwardRef(_H),IH=(e,t)=>lt.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:lt.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"})}),PH=Yt.forwardRef(IH),TH=(e,t)=>lt.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:lt.jsx("path",{d:"m6 10 7-7 2 2-7 7-2 2-5-5 2-2z"})}),DH=Yt.forwardRef(TH),OH=(e,t)=>lt.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:lt.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"})}),NH=Yt.forwardRef(OH),qH=(e,t)=>lt.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:lt.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"})}),LH=Yt.forwardRef(qH),jH=(e,t)=>lt.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:lt.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"})}),zH=Yt.forwardRef(jH),FH=(e,t)=>lt.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:lt.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"})}),$H=Yt.forwardRef(FH),BH=(e,t)=>lt.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:lt.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"})}),HH={m:DH,"ï":AH,R:$H,S:NH,T:LH,U:zH,P:RH,Q:wH,"è":Yt.forwardRef(BH),"¢":yH,"©":mH,"23F4":vH,2013:PH,"&":EH,add:dH,"minus-2":kH,dot:fH},VH=(e,t,n,r)=>{const i=e.indicatorConditionalColoring;if(!i)return;const o=cH(i,t),a=((e,t,n,r)=>{const{segments:i}=e;if(!i||!n)return;const{limits:o}=i;if(!o?.length||!((e,t)=>!(!e||0===e.length||!(e[t]?.gradient??e[t-1]?.gradient)))(o,n.limitPaletteColorIndex))return iH(i,n.limitPaletteColorIndex,r);const a=rH(n.limitRange,t);return sH(i,a,n.limitRange,r)})(i,t,o,r),{paletteColors:s}=i.segments,l=o?.limitPaletteColorIndex||0,c=s[l]?.icon??"dot",{indicator:u}=e;let d=u?.position||"right";return"rtl"===n&&(d="right"===d?"left":"right"),{color:a,iconKey:c,position:d}},WH=(Hh().palette.primary.light,"repeating-linear-gradient(-45deg, rgba(200,200,200,0.08), rgba(200,200,200,0.08) 2px, rgba(200,200,200,0.3) 2.5px, rgba(200,200,200,0.08) 3px, rgba(200,200,200,0.08) 5px)"),UH=4/3,GH="12px",YH="600",KH="Source Sans Pro, sans-serif",XH={height:"auto",fontSize:GH,lineHeight:"unset",padding:"4px",borderStyle:"solid",borderWidth:"0px 1px 1px 0px",userSelect:"none",outline:"none","&:focus-visible":{boxShadow:"0 0 0 2px #177fe6 inset, 0 0 0 3px #fff inset"},"&:focus:not(:focus-visible)":{boxShadow:"none"},"&:last-child":{borderRightWidth:"0px"}},JH=(e,t)=>"rtl"===e&&"center"!==t.resolvedImagePosition?.horizontal?t.resolvedImagePosition?.horizontal&&(e=>"flex-start"===e?"flex-end":"flex-start")(t.resolvedImagePosition?.horizontal):t.resolvedImagePosition?.horizontal,QH=(e,t)=>t||"right"!==e&&"left"!==e?t||"center"!==e?void 0:"row":"row-reverse",ZH=(e,t,n)=>{if(!t&&"rtl"===n){if("left"===e.headTextAlign)return"right";if("right"===e.headTextAlign)return"left"}return e.headTextAlign},eV=(e,t)=>"rtl"===e&&"center"!==t?"right"===t?"left":"right":t,tV=(e,t,n)=>"rtl"===e||t&&!n?"0px":"1px",nV=(e,t,n)=>"rtl"===e?t&&!n?"0px":"1px":"0px",rV=24,iV=Ul("div",{shouldForwardProp:e=>!["direction","isPagination"].includes(e)})(({direction:e,isPagination:t})=>({position:"absolute",left:t&&"rtl"===e?0:void 0,bottom:0})),oV=Ul(Xu,{shouldForwardProp:e=>!["textAlign","direction","isPagination"].includes(e)})(({textAlign:e,theme:t,direction:n,isPagination:r})=>({textAlign:e,height:"auto",padding:t.spacing(.5,1),display:"flex",alignItems:"flex-end",justifySelf:e,alignSelf:"center",flexDirection:"rtl"===n?QH(e,r):void 0})),aV=Ul(Xu,{shouldForwardProp:e=>"shouldShowMenuIcon"!==e&&"shouldShowLockIcon"!==e&&"alignment"!==e})(({shouldShowMenuIcon:e,shouldShowLockIcon:t,alignment:n})=>{const r=e?"24px":"";let i;switch(n){case"left":i={gridTemplateColumns:t?`20px 2fr ${r}`:`1fr ${r}`};break;case"center":{const n=e||t;i={gridTemplateColumns:n?"24px 2fr 24px":"1fr","& .sn-table-lock-icon":{gridColumn:1},"& .sn-table-head-label":{gridColumn:n?2:1},[`& .${wm}`]:{gridColumn:3}};break}case"right":i={gridTemplateColumns:t?`${r} 2fr 20px`:`${r} 1fr`,"& .sn-table-lock-icon":{gridColumn:t?3:"unset"},"& .sn-table-head-label":{gridColumn:e?2:"span 2"},[`& .${wm}`]:{gridColumn:1}}}return{width:"100%",display:"grid",gridAutoFlow:"dense",fontSize:"inherit",fontFamily:"inherit",alignItems:"end",overflow:"hidden",...i}}),sV=Ul(Xu,{shouldForwardProp:e=>"rightAligned"!==e})(({rightAligned:e})=>({display:"flex",alignItems:"center",width:"20px",height:"24px",flexShrink:0,flexDirection:"inherit",justifyContent:e?"flex-start":"flex-end"})),lV=Ul(Xu,{shouldForwardProp:e=>"justifyContent"!==e})(({justifyContent:e})=>({display:"flex",flexGrow:1,textAlign:e,justifyContent:e,alignItems:"center",padding:"4px"})),cV=Ul(au,{shouldForwardProp:e=>"hoverBackground"!==e&&"activeBackground"!==e&&"isActive"!==e&&"order"!==e})(({hoverBackground:e,activeBackground:t,isActive:n,order:r})=>({padding:"4px !important",width:"fit-content",height:"auto",background:n?t:void 0,"&:hover":{background:e},color:"inherit",order:r})),uV=gg(),dV=gg(0),pV=gg(0),fV=e=>parseInt(e??XH.fontSize,10)*UH,hV=/<[biust]>/g,mV=(e,{boldFontWeight:t,combineDecorations:n=!1,allowIndentation:r=!1})=>{const i=e?.toLowerCase().match(hV),o={},a=new Set;let s=0;return i?.forEach(e=>{switch(e){case"<t>":r&&(s++,o.textIndent=`${s}em`);break;case"<b>":o.fontWeight=t;break;case"<i>":o.fontStyle="italic";break;case"<u>":a.add("underline"),o.textDecoration="underline";break;case"<s>":a.add("line-through"),o.textDecoration="line-through"}}),n&&a.size>0&&(o.textDecoration=["underline","line-through"].filter(e=>a.has(e)).join(" ")),Object.keys(o).length>0?o:void 0};const gV=4/3,yV=e=>!!e?.color||"number"==typeof e?.index&&e.index>-1;function bV(e,t,n={index:-1}){const r=t.getColorPickerColor(n);return r&&"none"!==r?r:e}const vV=(e,t)=>e?{borderBottomColor:Uh.DARK_MODE_BORDER,borderRightColor:Uh.DARK_MODE_BORDER,borderLeftColor:Uh.DARK_MODE_BORDER,borderTopColor:Uh.DARK_MODE_BORDER}:{borderLeftColor:Uh.BORDER_MEDIUM,borderRightColor:Uh.BORDER_MEDIUM,borderTopColor:Uh.BORDER_HEAVY,borderBottomColor:t?Uh.BORDER_HEAVY:Uh.BORDER_LIGHT},xV=(e,t,n)=>{if(e&&t&&n){const r=(e=>parseInt(e,10)*gV+8+1)(e);return r*(t+2)<n.clientHeight-40?"1px":"0px"}return"0px"},wV=e=>e.components?.find(e=>"theme"===e.key),SV=(e,t,n,r=!1)=>{const i=t.getStyle("object",`straightTableV2.${e}`,"fontFamily"),o=t.getStyle("object",`straightTableV2.${e}`,"color"),a=t.getStyle("object",`straightTableV2.${e}`,"fontSize"),s={fontFamily:i,color:yV(n?.fontColor)?bV(Uh.TEXT,t,n?.fontColor):o||Uh.TEXT,fontSize:n?.fontSize&&`${n.fontSize}px`||a,padding:n&&"padding"in n?n.padding:void 0,...vV(t.background.isDark,r)};return Object.keys(s).forEach(e=>{const t=e;null==s[t]&&delete s[t]}),s};function kV(e,t,n){const r=wV(e)?.header,i=SV("header",t,r,n);return i.background=(e=>{if(void 0===e)return;const t=h(e);return t.setAlpha(1),t.getRGB()})(t.background.headerColor),i.hoverBackground=Kh(i.background??Uh.WHITE,Am),i.activeBackground=Kh(i.background??Uh.WHITE,Im),i}function CV(e,t,n){const r={};let i={fontStyle:e.fontStyle,fontWeight:e.fontWeight,textDecoration:e.textDecoration};return t?.qValues?.forEach((e,t)=>{const o=e.qText,a=o&&Jh(o);a&&(r[n[t]]=a);const s=mV(o,{boldFontWeight:YH,combineDecorations:!0});var l,c;i={...i,...s,textDecoration:(l=i.textDecoration,c=s?.textDecoration,c?l?[...new Set(`${l} ${c}`.split(/\s+/).filter(e=>e&&"none"!==e))].join(" "):c:l)}}),r.cellBackgroundColor&&!r.cellForegroundColor&&(r.cellForegroundColor=Gh(r.cellBackgroundColor)),{...e,...r,color:r.cellForegroundColor||e.color,background:r.cellBackgroundColor||e.background,fontStyle:i.fontStyle,fontWeight:i.fontWeight,textDecoration:i.textDecoration}}function EV(e,t,n){if(!n("TLV_254_TABLE_INDENT_TAG"))return;const r=e.isTotalRow&&n("TLV-2303-SUB-TOTALS");if(e.isNull||r&&t.isDim)return;const i=t.qAttrExprInfoIDs.indexOf("textStyleExpression");return-1!==i?mV(e.qAttrExps?.qValues?.[i]?.qText,{boldFontWeight:YH,allowIndentation:!0})?.textIndent:void 0}const MV=25e4,RV=(e,t)=>t.qAttrExps?.qValues?.[e],_V=e=>{const t=Number(e?.qNum);return void 0!==e?.qNum&&Number.isFinite(t)?t:void 0},AV=e=>{const t=e?.qText?.trim();return t&&"ARGB(0,0,0,0)"!==t.toUpperCase()?Jh(t)??void 0:void 0},IV=/^data:(?<!\s)\s*(image\/[\w+-.]+)(?<!\s)\s*(;.*?){0,1}(?<!\s)\s*,(.*)/i,PV=5e6,TV=5e5;const DV={fromSearchString:function(e){if(!e)return[];"?"===e[0]&&(e=e.substr(1));const t=[];return e.split("&").forEach(e=>{if(!e)return;const n=e.indexOf("=");let r,i="",o=!1;-1===n?r=e:(r=e.slice(0,n),i=e.slice(n+1),o=!0),t.push(function(e,t,n){return{key:OV(e),value:OV(t.replace(/%2B/g,"shouldNotDecodePlus")),useEqualSign:n}}(r,i,o))}),t}};function OV(e){try{return decodeURIComponent(e)}catch{return e}}function NV(e){if(!(this instanceof NV))throw new Error("Url needs to be called with the new keyword");if(!e)throw new Error("Url needs a string to operate on");const t=function(e){const t={authorityAndPath:"",search:"",hash:""};let n=e.indexOf("#");-1!==n&&(t.hash=e.substr(n),e=e.substr(0,n));n=e.indexOf("?"),-1!==n&&(t.search=e.substr(n),e=e.substr(0,n));return t.authorityAndPath=e,t}(e);Object.defineProperties(this,{authorityAndPath:{value:t.authorityAndPath},search:{value:t.search},hash:{value:t.hash},searchParams:{get:()=>DV.fromSearchString(t.search)}})}function qV(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")}NV.encodeAuthorityAndPath=function(e){return encodeURI(e).replace(/%5B/gi,"[").replace(/%5D/gi,"]").replace(/%25/gi,"%")},NV.encodeSearchParams=function(e){let t,n="";for(let r=0;r<e.length;r++)t=e[r],n+=0===r?"?":"&",n+=qV(t.key),t.value?n+=`=${qV(t.value)}`:n+=t.useEqualSign?"=":"";return n};var LV=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}},jV=class{decode(e){let t="";const n=new LV(e);let r;for(;n.hasNext();)r=this.decodeCharacter(n),t+=null!=r?r:n.next();return t}decodeCharacter(e){return e.next()}};const zV=e=>e>=0&&e<=1114111,FV=e=>e.match(/[\s]/);var $V=class extends jV{decodeCharacter(e){e.mark();const t=e.next();let n,r,i;if(null==t||"\\"!==t)return e.reset(),null;const o=e.next();if(null==o)return e.reset(),null;switch(o){case"\r":e.peek("\n")&&e.next();case"\n":case"\f":case"\0":return this.decodeCharacter(e)}if("NaN"===parseInt(o,16))return o;for(n=o,r=0;r<5&&(i=e.next(),null!=i&&!FV(i));r++){if("NaN"===parseInt(i,16)){e.pushback(i);break}n+=i}const a=parseInt(n,16);return zV(a)?String.fromCharCode(a):"�"}},BV=class e{constructor(e,t){this._key=e,this._value=t}getKey(){return this._key}getValue(){return this._value}equals(t){return t instanceof e&&(this._key===t._key&&this._value===t._value)}static newInstanceIfNeeded(){let t,n,r=arguments[0];return"string"==typeof arguments[1]?(t=arguments[1],n=r.length):(n=arguments[1],t=arguments[2]),t&&r?(r.length>n&&(r=r.substr(0,n)),new e(r,t)):null}},HV=class e{setValue(e){this._nextMap=null,this._value=e}getNextNode(e){return this._nextMap?this._nextMap[e]:null}put(t,n,r){let i,o;if(t.length===n)return o=this._value,this.setValue(r),o;const a=t.charAt(n);return this._nextMap?(i=this._nextMap[a],i||(i=new e,this._nextMap[a]=i)):(this._nextMap={},i=new e,this._nextMap[a]=i),i.put(t,n+1,r)}get(e,t){if(e.length<=t)return this._value;const n=this.getNextNode(e.charAt(t));return n?n.get(e,t+1):null}getLongestMatch(e,t){if(e.length<=t)return BV.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return BV.newInstanceIfNeeded(e,t,this._value);const r=n.getLongestMatch(e,t+1);return r||BV.newInstanceIfNeeded(e,t,this._value)}},VV=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 HV);const n=this.root.put(e,0,t);return n||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}};const WV=(()=>{const e=[],t=[],n=new VV;let r,i,o;for(r in e["""]="34",e["&"]="38",e["<"]="60",e[">"]="62",e[" "]="160",e["¡"]="161",e["¢"]="162",e["£"]="163",e["¤"]="164",e["¥"]="165",e["¦"]="166",e["§"]="167",e["¨"]="168",e["©"]="169",e["ª"]="170",e["«"]="171",e["¬"]="172",e["­"]="173",e["®"]="174",e["¯"]="175",e["°"]="176",e["±"]="177",e["²"]="178",e["³"]="179",e["´"]="180",e["µ"]="181",e["¶"]="182",e["·"]="183",e["¸"]="184",e["¹"]="185",e["º"]="186",e["»"]="187",e["¼"]="188",e["½"]="189",e["¾"]="190",e["¿"]="191",e["À"]="192",e["Á"]="193",e["Â"]="194",e["Ã"]="195",e["Ä"]="196",e["Å"]="197",e["Æ"]="198",e["Ç"]="199",e["È"]="200",e["É"]="201",e["Ê"]="202",e["Ë"]="203",e["Ì"]="204",e["Í"]="205",e["Î"]="206",e["Ï"]="207",e["Ð"]="208",e["Ñ"]="209",e["Ò"]="210",e["Ó"]="211",e["Ô"]="212",e["Õ"]="213",e["Ö"]="214",e["×"]="215",e["Ø"]="216",e["Ù"]="217",e["Ú"]="218",e["Û"]="219",e["Ü"]="220",e["Ý"]="221",e["Þ"]="222",e["ß"]="223",e["à"]="224",e["á"]="225",e["â"]="226",e["ã"]="227",e["ä"]="228",e["å"]="229",e["æ"]="230",e["ç"]="231",e["è"]="232",e["é"]="233",e["ê"]="234",e["ë"]="235",e["ì"]="236",e["í"]="237",e["î"]="238",e["ï"]="239",e["ð"]="240",e["ñ"]="241",e["ò"]="242",e["ó"]="243",e["ô"]="244",e["õ"]="245",e["ö"]="246",e["÷"]="247",e["ø"]="248",e["ù"]="249",e["ú"]="250",e["û"]="251",e["ü"]="252",e["ý"]="253",e["þ"]="254",e["ÿ"]="255",e["&OElig"]="338",e["&oelig"]="339",e["&Scaron"]="352",e["&scaron"]="353",e["&Yuml"]="376",e["&fnof"]="402",e["&circ"]="710",e["&tilde"]="732",e["&Alpha"]="913",e["&Beta"]="914",e["&Gamma"]="915",e["&Delta"]="916",e["&Epsilon"]="917",e["&Zeta"]="918",e["&Eta"]="919",e["&Theta"]="920",e["&Iota"]="921",e["&Kappa"]="922",e["&Lambda"]="923",e["&Mu"]="924",e["&Nu"]="925",e["&Xi"]="926",e["&Omicron"]="927",e["&Pi"]="928",e["&Rho"]="929",e["&Sigma"]="931",e["&Tau"]="932",e["&Upsilon"]="933",e["&Phi"]="934",e["&Chi"]="935",e["&Psi"]="936",e["&Omega"]="937",e["&alpha"]="945",e["&beta"]="946",e["&gamma"]="947",e["&delta"]="948",e["&epsilon"]="949",e["&zeta"]="950",e["&eta"]="951",e["&theta"]="952",e["&iota"]="953",e["&kappa"]="954",e["&lambda"]="955",e["&mu"]="956",e["&nu"]="957",e["&xi"]="958",e["&omicron"]="959",e["&pi"]="960",e["&rho"]="961",e["&sigmaf"]="962",e["&sigma"]="963",e["&tau"]="964",e["&upsilon"]="965",e["&phi"]="966",e["&chi"]="967",e["&psi"]="968",e["&omega"]="969",e["&thetasym"]="977",e["&upsih"]="978",e["&piv"]="982",e["&ensp"]="8194",e["&emsp"]="8195",e["&thinsp"]="8201",e["&zwnj"]="8204",e["&zwj"]="8205",e["&lrm"]="8206",e["&rlm"]="8207",e["&ndash"]="8211",e["&mdash"]="8212",e["&lsquo"]="8216",e["&rsquo"]="8217",e["&sbquo"]="8218",e["&ldquo"]="8220",e["&rdquo"]="8221",e["&bdquo"]="8222",e["&dagger"]="8224",e["&Dagger"]="8225",e["&bull"]="8226",e["&hellip"]="8230",e["&permil"]="8240",e["&prime"]="8242",e["&Prime"]="8243",e["&lsaquo"]="8249",e["&rsaquo"]="8250",e["&oline"]="8254",e["&frasl"]="8260",e["&euro"]="8364",e["&image"]="8365",e["&weierp"]="8472",e["&real"]="8476",e["&trade"]="8482",e["&alefsym"]="8501",e["&larr"]="8592",e["&uarr"]="8593",e["&rarr"]="8594",e["&darr"]="8595",e["&harr"]="8596",e["&crarr"]="8629",e["&lArr"]="8656",e["&uArr"]="8657",e["&rArr"]="8658",e["&dArr"]="8659",e["&hArr"]="8660",e["&forall"]="8704",e["&part"]="8706",e["&exist"]="8707",e["&empty"]="8709",e["&nabla"]="8711",e["&isin"]="8712",e["¬in"]="8713",e["&ni"]="8715",e["&prod"]="8719",e["&sum"]="8721",e["&minus"]="8722",e["&lowast"]="8727",e["&radic"]="8730",e["&prop"]="8733",e["&infin"]="8734",e["&ang"]="8736",e["&and"]="8743",e["&or"]="8744",e["&cap"]="8745",e["&cup"]="8746",e["&int"]="8747",e["&there4"]="8756",e["&sim"]="8764",e["&cong"]="8773",e["&asymp"]="8776",e["&ne"]="8800",e["&equiv"]="8801",e["&le"]="8804",e["&ge"]="8805",e["&sub"]="8834",e["&sup"]="8835",e["&nsub"]="8836",e["&sube"]="8838",e["&supe"]="8839",e["&oplus"]="8853",e["&otimes"]="8855",e["&perp"]="8869",e["&sdot"]="8901",e["&lceil"]="8968",e["&rceil"]="8969",e["&lfloor"]="8970",e["&rfloor"]="8971",e["&lang"]="9001",e["&rang"]="9002",e["&loz"]="9674",e["&spades"]="9824",e["&clubs"]="9827",e["&hearts"]="9829",e["&diams"]="9830",e)"function"!=typeof e[r]&&e.hasOwnProperty(r)&&(t[e[r]]=r);for(i in t)"function"!=typeof t[i]&&t.hasOwnProperty(i)&&(o=t[i].toLowerCase().substr(1),n.put(o,String.fromCharCode(i)));return n})();var UV=class extends jV{decodeCharacter(e){let t;e.mark();const n=e.next();if(null==n||"&"!==n)return e.reset(),null;const r=e.next();if(null==r)return e.reset(),null;if("#"===r){if(t=this._getNumericEntity(e),null!=t)return t}else if(r.match(/[A-Za-z]/)&&(e.pushback(r),t=this._getNamedEntity(e),null!=t))return t;return e.reset(),null}_getNamedEntity(e){let t,n,r,i="";for(t=Math.min(e.remainder().length,WV.getMaxKeyLength()),r=0;r<t;r++)i+=e.next().toLowerCase();const o=WV.getLongestMatch(i);if(null==o)return null;for(e.reset(),e.next(),t=o.getKey().length,n=0;n<t;n++)e.next();return e.peek(";")&&e.next(),o.getValue()}_getNumericEntity(e){const t=e.peek();return null==t?null:"x"===t||"X"===t?(e.next(),this._parseHex(e)):this._parseNumber(e)}_parseHex(e){let t,n="";for(;e.hasNext();){if(t=e.peek(),Number.isNaN(+parseInt(t,16))){if(";"===t){e.next();break}break}n+=t,e.next()}const r=parseInt(n,16);return!Number.isNaN(+r)&&zV(r)?String.fromCharCode(r):null}_parseNumber(e){let t,n="";for(;e.hasNext();){if(t=e.peek(),Number.isNaN(+parseInt(t,10))){if(";"===t){e.next();break}break}n+=t,e.next()}const r=parseInt(n,10);return!Number.isNaN(+r)&&zV(r)?String.fromCharCode(r):null}},GV=class extends jV{decodeCharacter(e){e.mark();const t=e.next();let n,r,i,o;if(null==t)return e.reset(),null;if("%"!==t)return e.reset(),null;for(n="",r=0;r<2;r++)i=e.nextHex(),null!=i&&(n+=i);return 2===n.length&&(o=parseInt(n,16),zV(o))?String.fromCharCode(o):(e.reset(),null)}};let YV;"undefined"!=typeof document&&(YV=document.createElement("div"));const KV=Array.prototype.indexOf,XV=[",",".","_"," "],JV=[",",".","-","_"," "],QV={width:["%"],height:["%"]},ZV={default:["-"," ","%"],color:["#"," ","(",")"],image:["(",")",":","/","?","&","-",".",'"',"="," "]},eW={background:["(",")",":","%","/","?","&","-"," ",".",'"',"=","#"],"background-image":ZV.image,"background-color":ZV.color,"border-color":ZV.color,"border-image":ZV.image,color:ZV.color,icon:ZV.image,"list-style-image":ZV.image,"outline-color":ZV.color},tW={attr_name:["^on[a-z]{1,}","style","href","src"],attr_val:["javascript:","data:"],css_key:["behavior","-moz-behavior","-ms-behavior"],css_val:["expression"]};function nW(e,t,n){let r;if(t){if(KV)return KV.call(t,e,n);for(r=t.length,n=n?n<0?Math.max(0,r+n):n:0;n<r;n++)if(n in t&&t[n]===e)return n}return-1}function rW(e){if(null==e)return"";let t="";const n=document.createTextNode(e);return YV.appendChild(n),t=YV.innerHTML,YV.removeChild(n),t}function iW(e,t,n){let r,i,o,a,s,l,c,u,d;for(e=aW(e).toLowerCase(),t=aW(t),o=0;o<tW.attr_name.length;o++)if(e.match(tW.attr_name[o]))throw new Error(`Unsafe attribute name used: ${e}`);for(o=0;o<tW.attr_val.length;o++)if(t.toLowerCase().match(tW.attr_val[o]))throw new Error(`Unsafe attribute value used: ${t}`);if(r=QV[e],r||(r=JV),i="",!n){for(a=0;a<e.length;a++){if(s=e.charAt(a),!s.match(/[a-zA-Z\-0-9]/))throw new Error("Invalid attribute name specified");i+=s}i+='="'}for(l=0;l<t.length;l++)c=t.charAt(l),u=t.charCodeAt(l),!c.match(/[a-zA-Z0-9]/)&&nW(c,r)<0?(d=u.toString(16),i+=`&#x${d};`):i+=c;return n||(i+='"'),i}function oW(e,t,n){let r,i,o,a,s,l,c,u,d,p;if(e=aW(e).toLowerCase(),t=aW(t),nW(e,tW.css_key)>=0)throw new Error(`Unsafe property name used: ${e}`);for(r=0;r<tW.css_val.length;r++)if(t.toLowerCase().indexOf(tW.css_val[r])>=0)throw new Error(`Unsafe property value used: ${t}`);if(i=eW[e],i||(i=ZV.default),o="",!n){for(a=0;a<e.length;a++){if(s=e.charAt(a),!s.match(/[a-zA-Z-]/))throw new Error("Invalid Property Name specified");o+=s}o+=": "}for(l=0;l<t.length;l++)c=t.charAt(l),u=t.charCodeAt(l),!c.match(/[a-zA-Z0-9]/)&&nW(c,i)<0?(d=u.toString(16),p="000000".substr(d.length),o+=`\\${p}${d}`):o+=c;return o}function aW(e,t){let n,r,i,o,a=!1;if(null===e)return null;n=e,r=e,i=0;const s=[new UV,new GV,new $V];for(;!a;){r=n;for(let e=0;e<s.length;e++)o=s[e].decode(n),o!==n&&(i++,n=o);r!==n||(a=!0)}if(t&&i>1)throw new Error("Attack Detected - Multiple/Double Encodings used in input");return n}const sW=[];for(let e=0;e<255;e++)sW[e]=e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122?null:e.toString(16);const lW={html:e=>rW(e.unsafe),css(e){let t,n=[];const r=[],i={};let o="";for(t in e.map?n=e.map:n[e.name]=e.unsafe,n)"function"!=typeof n[t]&&n.hasOwnProperty(t)&&(r[t]=oW(t,n[t],!0),o+=oW(t,n[t],!0),i[t]=r[t]);return e.map?i:o},attr(e){let t=[];const n=[],r={};let i="";e.map?t=e.map:t[e.name]=e.unsafe;for(const e in t)"function"!=typeof t[e]&&t.hasOwnProperty(e)&&(n[e]=iW(e,t[e],!0),i+=iW(e,t[e],!0),r[e]=n[e]);return e.map?r:i}};function cW(e,t){throw new Error(t)}var uW={canonicalize:aW,encode:function(){const e={context:"html",unsafe:null,name:null,map:null,setter:null,strict:!0};return 1===arguments.length&&"object"==typeof arguments[0]?function(){let e,t,n;const r=arguments[0]||{};let i=1;const o=arguments.length;for(;i<o;i++)if(null!=(e=arguments[i]))for(t in e)if(e.hasOwnProperty(t)){if(n=e[t],r===n)continue;void 0!==n&&(r[t]=n)}}(e,arguments[0]):(e.context=arguments[0],2===arguments.length?"html"===e.context?e.unsafe=arguments[1]:"attr"!==e.context&&"css"!==e.context||(e.map=arguments[1]):(e.name=arguments[2],e.unsafe=arguments[1])),"html"===e.context?lW.html(e):"css"===e.context?(null!=e.map&&"object"!=typeof e.map&&cW(this,"Invalid parameter type"),lW.css(e)):"attr"===e.context?(null!=e.map&&"object"!=typeof e.map&&cW(this,"Invalid parameter type"),lW.attr(e)):void cW(this,"Invalid parameter type")},encodeForAttr:iW,encodeForAttr2:function(e){return iW("nonsens",e,!0)},encodeForCSS:oW,encodeForHref:function(e){aW(e),0!==e.search("[a-zA-Z0-9]+:")&&(e=`http://${e}`);const t=new NV(e),n=NV.encodeAuthorityAndPath(t.authorityAndPath),r=t.searchParams;e=n+NV.encodeSearchParams(r)+t.hash;const i=decodeURI(e).toLowerCase();if(-1!==i.indexOf("javascript:"))throw new Error("Attack Detected - Javascript in input");if(-1!==i.indexOf("data:"))throw new Error("Attack Detected - data in input");return e},encodeForJS:function(e,t){let n,r,i,o,a,s;for(t||(t=XV),s="",n=0;n<e.length;n++)i=e.charAt(n),o=e.charCodeAt(n),nW(i,t)>=0||null==sW[o]?s+=i:(r=o.toString(16),o<256?(a="00".substr(r.length),s+=`\\x${a}${r.toUpperCase()}`):(a="0000".substr(r.length),s+=`\\u${a}${r.toUpperCase()}`));return s},encodeForHTML:rW,encodeForURL:function(e,t){let n="";return t&&(t.match(/^[A-Za-z\-0-9]{1,}$/)?n+=aW(t).toLowerCase():cW(this,"Illegal Attribute Name Specified"),n+='="'),n+=encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A"),n+=t?'"':"",n},isSafeDataURL:(e,t)=>{const{maxByteSizeSvg:n=TV,maxByteSizeImage:r=PV}=t??{},{mimeType:i,encoding:o,data:a}=(e=>{const[,t,n,r]=IV.exec(e.trim())??[];return{encoding:n,data:r,mimeType:t?.toLocaleLowerCase()}})(e);if(!a)return!0;const s=((e,t,n)=>{const r={type:e};if(t?.includes(";base64"))try{return new Blob([atob(n)],r).size}catch{return new Blob([n],r).size}return"image/svg+xml"===e?new Blob([n],r).size:0})(i,o,a);return"image/svg+xml"===i?s<=n:s<=r},validateURI:function(e){if(""===e||function(e){if("canParse"in URL)return URL.canParse(e);try{return new URL(e),!0}catch{return!1}}(e))return!1;const t=e.replace(/%2E/gi,".");if(t.match(/[#&=: ]/))return!1;const n=function(e){let t=e,n="";for(;t.length>0;)if(t.startsWith("../")||t.startsWith("./"))t=t.replace(/^\.\.?\//,"");else if(t.startsWith("/./"))t=t.replace(/^\/\.\//,"/");else if("/."===t)t="/";else if(t.startsWith("/../")){t=t.replace(/^\/\.\.\//,"/");const e=n.lastIndexOf("/");-1!==e&&(n=n.slice(0,e))}else if("/.."===t){t="/";const e=n.lastIndexOf("/");-1!==e&&(n=n.slice(0,e))}else if("."===t||".."===t)t="";else{const e=t.match(/^\/?[^/]*/),r=e?e[0]:"";t=t.slice(r.length),n+=r}return n}(t);return""!==n&&"/"!==n&&n}};const dW=(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"}}},pW=({text:e,url:t,imageSize:n,imagePosition:r,labelStructure:i,imageBox:o,direction:a})=>!r||t&&(t.toLowerCase().includes("javascript:")||!uW.isSafeDataURL(t))?{type:t$.Text,url:void 0,text:e,labelStructure:i}:{type:t$.Image,url:t||"",text:e,imageSize:n,resolvedImagePosition:dW(r,a),labelStructure:i,imageBox:o},fW=(e,t,n,r)=>{if(!e.qMiniChart||!t?.miniChart||!n)return{type:t$.Text,text:r};const{minY:i,maxY:o}=((e,t,n)=>{const r="global"===t.yAxis?.scale,i="zeroCenter"===t.yAxis?.position,o=r?n.qYMin:e.qMiniChart.qMin,a=r?n.qYMax:e.qMiniChart.qMax;if(i){const e=Math.max(Math.abs(o),Math.abs(a));return{minY:-e,maxY:e}}return(e=>"zeroBaseline"===e.yAxis?.position||"bars"===e.type&&"auto"===e.yAxis?.position)(t)?{minY:Math.min(0,o),maxY:Math.max(0,a)}:{minY:o,maxY:a}})(e,t.miniChart,n),a={type:t.miniChart.type,qMatrix:e.qMiniChart.qMatrix,minY:i,maxY:o,showDots:!!t.miniChart.showDots,colors:t.miniChart.colors,colorMin:e.qMiniChart.qMin,colorMax:e.qMiniChart.qMax};return{type:t$.MiniChart,text:r,miniChart:a}},hW=(e,t,n)=>{const r=Array.isArray(t.qAttrExps)?t.qAttrExps[0]:t.qAttrExps,i=r?.qValues?.[e];if(i){const e=Number.isNaN(+i.qNum)?void 0:`${i.qNum}`;return i.qText||e}return n?.urlPosition===n$.Attribute?void 0:n?.urlLabel},mW=({labelStructure:e,text:t,url:n})=>{try{if(!n)throw Error("Invalid url");return{type:t$.Link,url:uW.encodeForHref(n),text:t,labelStructure:e}}catch{return{type:t$.Text,url:void 0,text:t,labelStructure:e}}},gW=({cell:e,representationProperties:t,attrExprInfoIndex:n,env:r,conditionalColoring:i,miniChartOnMeasure:o,measureMinMax:a,labelStructure:s,getText:l=e=>e.qText,direction:c,enabledFeatures:u})=>{const d=r$(t),p=l(e);return d===t$.Image&&u[t$.Image]&&!r.anything.sense?.isUnsupportedFeature?.("tableImages")?((e,t,n,r,i,o)=>{const{imageSize:a,imagePosition:s,imageSetting:l,imageLabel:c,imageBox:u}=t??{};if("url"===l){const t=RV(n.imageUrl??-1,e)?.qText;return o&&(o.maskedValue=t??""),pW({text:r,url:t,imageSize:a,imagePosition:s,labelStructure:o,imageBox:u,direction:i})}if("label"===l){const t=o?o.originalValue:r;if(-1===n.imageLabel)return pW({text:c||t||"",url:t,imageSize:a,imagePosition:s,labelStructure:o,imageBox:u,direction:i});const l=RV(n.imageLabel??-1,e)?.qText??r;return pW({text:l,url:t,imageSize:a,imagePosition:s,labelStructure:o,imageBox:u,direction:i})}return{type:t$.Text,url:void 0,labelStructure:o,text:r}})(e,t,n,p,c,s):d===t$.Link?((e,t,n,r,i)=>{const{urlPosition:o}=t??{};if(o===n$.Attribute){const o=hW(n.url??-1,e,t);return mW({labelStructure:r,text:i||o||"",url:o})}if(o===n$.Dimension){const o=hW(n.urlLabel??-1,e,t)||i;return r&&(r.maskedValue=o),mW({text:o,labelStructure:r,url:r?.originalValue??i})}return{type:t$.Text,url:void 0,text:i,labelStructure:r}})(e,t,n,s,p):d===t$.Indicator&&u[t$.Indicator]&&!r.anything.sense?.isUnsupportedFeature?.("tableIndicators")?((e,t,n)=>{const{indicator:r}=e??{};return{type:t$.Indicator,url:void 0,text:n,indicator:{applySegmentColors:r?.applySegmentColors,position:r?.position,showTextValues:r?.showTextValues},indicatorConditionalColoring:t}})(t,i,p):d===t$.MiniChart&&u[t$.MiniChart]&&!r.anything.sense?.isUnsupportedFeature?.("qMiniChartDef")?fW(e,t,o,p):d===t$.Bar&&u[t$.Bar]?((e,t,n,r,i)=>{const o={type:t$.Text,text:i},a=_V(e);if(!t||void 0===a)return o;const s=t=>{const r=n[t];return void 0===r||r<0?void 0:RV(r,e)},{barRangeMode:l,barColorMode:c,barLabelColorMode:u}=t,d="manual"===l,p=e=>d&&"number"==typeof e&&Number.isFinite(e)?e:void 0,f={value:a,columnMin:p(t.barRangeMin)??r?.qMin??0,columnMax:p(t.barRangeMax)??r?.qMax??0,isManualRange:d,hasNegativeValues:r?.hasNegativeValues,hasPositiveValues:r?.hasPositiveValues,offsetValue:_V(s("barOffset"))??0,thicknessPx:_V(s("barWidth")),label:s("barLabel")?.qText??i,fallbackLabel:i,color:"expression"===c?AV(s("barColor")):void 0,colorPalette:t.barColor,labelColor:"expression"===u?AV(s("barLabelColor")):void 0,labelColorPalette:t.barLabelColor,barEnd:t.barEnd??"none"};return{type:t$.Bar,text:i,bar:f}})(e,t,n,a,p):{type:t$.Text,url:void 0,text:p,labelStructure:s}},yW=gg(e=>{const t=e(yy),n=e(ey);return e(ty),{qTop:0,qHeight:0,rowPartialHeight:n?.content?.rowPartialHeight??0,visibleTop:n?.content?.visibleTop??t?.visibleTop,visibleHeight:n?.content?.visibleHeight??t?.visibleHeight,scrollLeft:n?.content?.scrollLeft??t?.scrollLeft??0,scrollTopRatio:n?.content?.scrollTopRatio??t?.scrollTopRatio,rowsPerPage:n?.content?.rowsPerPage??t?.rowsPerPage,page:n?.content?.page??t?.page,estimatedRowHeight:n?.content?.estimatedRowHeight??0}}),bW=e=>-1===e?{}:e.qAttrExprInfo.reduce((e,{id:t},n)=>(e[t]=n,e),{}),vW=({cId:e})=>e??WF(),xW=["D","T","TS","IV"],wW=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],SW=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],kW=["January","February","March","April","May","June","July","August","September","October","November","December"],CW=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],EW={D:"YYYY-MM-DD",T:"hh:mm:ss",TS:"YYYY-MM-DD hh:mm:ss"},MW=864e5,RW=2**32,_W=e=>{let t=Math.floor(e),n=Math.round((e-t)*MW);n>=MW&&(t+=1,n=0);const r=t-25569,i=r+719468,o=Math.floor(i/146097),a=i-146097*o,s=Math.floor((a-Math.floor(a/1460)+Math.floor(a/36524)-Math.floor(a/146096))/365),l=a-(365*s+Math.floor(s/4)-Math.floor(s/100)),c=Math.floor((5*l+2)/153),u=c<10?c+2:c-10;return{year:s+400*o+(u<=1?1:0),month:u,date:l-Math.floor((153*c+2)/5)+1,day:(r%7+7+3)%7,h:Math.floor(n/36e5),m:Math.floor(n%36e5/6e4),s:Math.floor(n%6e4/1e3),f:n%1e3}},AW=(e,t)=>String(e).padStart(t,"0"),IW=e=>{const[,t]=e.toString().split(".");return t?Number(`0.${t}`):0},PW=/Y+|y+|M+|W+|w+|D+|d+|h+|H+|m+|s+|S+|f+|F+|t{1,2}|T{1,2}/g,TW=(e,t,n)=>{if(Number.isNaN(e)||!Number.isFinite(e))return String(e);let r,i=(n||("IV"===t?EW.T:EW[t])).replace(/\[.+]|\[|]/g,"");"IV"===t?(e<0&&(e=-e,i=`-${i}`),r=((e,t)=>{const n=Math.floor(e);let r=24*IW(e),i=60*IW(r),o=60*IW(i);const a=Math.round(1e3*IW(o));r=Math.floor(r),i=Math.floor(i),o=Math.floor(o),/D+/i.test(t)||(r+=24*n),/h+/i.test(t)||(i+=60*r),/m+/i.test(t)||(o+=60*i);let s=0,l="";if(/w+|t+/i.test(t)){const t=_W(e);s=t.day,l=t.h>=12?"pm":"am"}return{year:0,month:0,day:s,date:n%RW,h:r%RW,m:i%RW,s:o%RW,f:a,t:l}})(e,i)):r=((e,t)=>{const n=_W(e);let r=n.h;return t&&(r%=12,r=r||12),{year:n.year,month:n.month,day:n.day,date:n.date,h:r,m:n.m,s:n.s,f:n.f,t:n.h>=12?"pm":"am"}})(e,/t+/i.test(i));const o=(e=>[[/^(Y+|y+)$/,{Y:`${Number(`${e.year}`.slice(-2))}`,YY:AW(`${e.year}`.slice(-2),2),YYY:AW(`${e.year}`.slice(-3),3),def:t=>AW(`${e.year}`,t.length)}],[/^M+$/,{M:e.month+1,MM:AW(e.month+1,2),MMM:CW[e.month],def:kW[e.month]}],[/^(W+|w+)$/,{W:e.day,WW:AW(e.day,2),WWW:SW[e.day],def:wW[e.day]}],[/^(D+|d+)$/,{def:t=>AW(e.date,t.length)}],[/^(h+|H+)$/,{h:e.h,def:t=>AW(e.h,t.length)}],[/^m+$/,{m:e.m,def:t=>AW(e.m,t.length)}],[/^(s+|S+)$/,{s:e.s,def:t=>AW(e.s,t.length)}],[/^(f+|F+)$/,{def:t=>{const n=`${e.f}`;return n.length>t.length?n.slice(0,t.length):n.padEnd(t.length,"0")}}],[/^(t{1,2}|T{1,2})$/,{def:t=>(t[0].toUpperCase()===t[0]?e.t.toUpperCase():e.t).slice(0,t.length)}]])(r);return i.replace(PW,e=>((e,t)=>{const n=t.find(([t])=>t.test(e))?.[1];if(!n)return"";const r=Object.keys(n).find(t=>"def"!==t&&(t===e||t.toLowerCase()===e)),i=void 0===r?n.def:n[r];return String("function"==typeof i?i(e):i)})(e,o))},DW=/[#0]/,OW={prefix:"",suffix:""},NW=e=>{const t=e.search(DW);if(-1===t)return OW;let n=t;for(let t=e.length-1;t>n;t--)if(DW.test(e[t])){n=t;break}return{prefix:e.slice(0,t),suffix:e.slice(n+1)}},qW=/\B(?=(\d{3})+(?!\d))/g,LW={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y",[-3]:"m",[-6]:"μ",[-9]:"n",[-12]:"p",[-15]:"f",[-18]:"a",[-21]:"z",[-24]:"y"},jW=e=>Number(e.toPrecision(15)),zW=(e,t,n=!1)=>{if(Number.isNaN(e))return String(e);const{qFmt:r,qType:i,qDec:o=".",qThou:a=","}=t??{};if((e=>xW.includes(e))(i))return TW(e,i,r);if(!r)return String(e);const[s,l]=r.split(";"),{suffix:c}=NW(s),u=c.startsWith("A"),d=(u?c.slice(1):c).endsWith("%"),{value:p,siPrefix:f}=((e,t,n)=>{let r=t?jW(100*e):e,i="";if(n&&0!==r&&Number.isFinite(r)){let e=Number(r.toExponential().split("e")[1]);e-=e%3,e in LW&&(i=LW[e],r=jW(r/10**e))}return{value:r,siPrefix:i}})(e,d,u),h=p<0,m=h&&l?l:s,{prefix:g,suffix:y}=NW(m),b=u&&y.startsWith("A")?y.slice(1):y,{decimals:v,useThousands:x}=((e,t,n)=>{const r=e.indexOf(".");let i=0;return-1!==r?i=(e.slice(r+1).match(/[#0]/g)??[]).length:n&&(i=String(Math.abs(t)).split(".")[1]?.length??0),{decimals:Math.min(i,100),useThousands:e.includes(",")}})(m,p,n||"U"===i),[w,S]=Math.abs(p).toFixed(v).split("."),k=x?w.replace(qW,a):w;return`${h&&!l?"-":""}${g}${S?`${k}${o}${S}`:k}${f}${b}`},FW=1e4;function $W(e,t){return[...t].reverse().find(t=>t*e<=FW)||Math.floor(FW/e)}function BW(e,t){if(t?.skipTotals)return{atTop:!1,atBottom:!1};const n=e.qHyperCube.qDimensionInfo.length>0,r=e.qHyperCube.qMeasureInfo.length>0,i=e.qHyperCube.qGrandTotalRow.length>0,o=e.totals?.show,a=e.totals?.position;if(i&&(n&&r||!o&&!n)){if(o||"top"===a)return{atTop:!0,atBottom:!1};if("bottom"===a)return{atTop:!1,atBottom:!0}}return{atTop:!1,atBottom:!1}}function HW(e,t,n,r){return t?0===n?e.totals?.label??"":"":e.qHyperCube.qGrandTotalRow.at(r)?.qText??""}function VW(e,t){const n=e.qHyperCube.qGrandTotalRow.at(t);return ZB(n?.qNum)}function WW(e,t,n,r,i){return e&&!e.auto?r&&"rtl"===i&&"center"!==e.align?{headTextAlign:"right"===e.align?"left":"right",totalsTextAlign:"right"===e.align?"left":"right",bodyTextAlign:"right"===e.align?"left":"right"}:{headTextAlign:e.align,totalsTextAlign:e.align,bodyTextAlign:e.align}:r||"rtl"!==i?{headTextAlign:"N"===t||void 0===t?"right":"left",totalsTextAlign:n?"left":"right",bodyTextAlign:"auto"}:{headTextAlign:"N"===t||void 0===t?"left":"right",totalsTextAlign:n?"right":"left",bodyTextAlign:"auto"}}const UW=(e,t,n,r)=>"auto"!==t?t:r||"rtl"!==n?e?"right":"left":e?"left":"right",GW=(e,t)=>{if(!e)return;const{background:n,foreground:r}=e,i=h(n??""),o=h(r??""),a=t?"getRGB":"getRGBA",s=i.isInvalid()?void 0:i[a](),l=s?Kh(s,Am):void 0,c=s?Kh(s,Im):void 0;return o.isInvalid()&&void 0!==s?{background:s,color:Gh(s),headerMenuHoverBackground:l,headerMenuActiveBackground:c}:{background:s,color:o.isInvalid()?void 0:o.getRGBA(),headerMenuHoverBackground:l,headerMenuActiveBackground:c}};function YW(e,t,n,r,i=()=>!1){const{qDimensionInfo:o,qMeasureInfo:a,qEffectiveInterColumnSortOrder:s}=e.qHyperCube,{colIdx:l,pageColIdx:c,visibleDimInfoIdx:u,visibleMeasureInfoIdx:d}=t,p=o.length,f=l<p,h=f?o[l]:a[l-p],m=f&&o[l].qGrouping===Pm.Cyclic,g=l===s[0];let y,b,v,x="",w=!1,S=-1,k=0,C=[];const{representation:E,conditionalColoring:M}=h;if(f&&void 0!==u){const e=h;x=e.qGroupFieldDefs[e.qGroupPos],k=e.qGroupPos,C=e.qGroupFallbackTitles,w=e.qLocked??!1,S=u,({qDimensionType:y}=e)}else({qMiniChart:b}=h),"bar"===E?.type&&(v=(({qMin:e,qMax:t,qAttrExprInfo:n})=>{if("number"!=typeof e||"number"!=typeof t||!Number.isFinite(e)||!Number.isFinite(t))return;const r=n.find(({id:e})=>"barOffset"===e),i=Number.isFinite(r?.qMin)?r?.qMin:0,o=Number.isFinite(r?.qMax)?r?.qMax:0;return{qMin:Math.min(i,i+e),qMax:Math.max(o,o+t),hasNegativeValues:e<0,hasPositiveValues:t>=0}})(h));const{qFallbackTitle:R,textAlign:_,qAttrExprInfo:A,qSortIndicator:I,qReverseSort:P,qApprMaxGlyphCount:T,columnWidth:D,qLibraryId:O,headerColor:N}=h,q=e.nullValueRepresentation?.text,L=!f&&void 0!==q&&tH(q)?zW(nH(q),h.qNumFormat,h.qIsAutoFormat):void 0;return{isDim:f,isCyclic:m,isLocked:w,fieldId:x,colIdx:l,qLibraryId:O,pageColIdx:c,qApprMaxGlyphCount:T,qReverseSort:P,columnWidth:D??{type:_m.Auto},selectionColIdx:S,isActivelySorted:g,id:vW(h),label:R??"",groupDimensionPos:k,groupDimensionLabels:C,qAttrExprInfoIDs:A.map(e=>e.id),qAttrExprInfoIndex:bW(h),sortDirection:I&&"N"!==I?I:"A",totalInfo:HW(e,f,c,d??-1),...!f&&{isTotalNumeric:VW(e,d??-1)},...WW(_,y,f,n,r),representation:E,conditionalColoring:f?void 0:M,qNumFormat:f?void 0:h.qNumFormat,qIsAutoFormat:f?void 0:h.qIsAutoFormat,formattedNullValueText:L,qMiniChart:b,measureMinMax:v,headerColor:i("VNA-626-TABLE_HEADER_COLOR_BY_EXPRESSION")?GW(N,n):void 0}}const KW=(e,t,n,r=()=>!1)=>{const{qHyperCube:{qColumnOrder:i,qDimensionInfo:o,qMeasureInfo:a}}=e,s=o.length+a.length,l=((e,t,n)=>{const r=t.length,{visible:i,hiddenDim:o,hiddenMea:a}=e.reduce((e,i)=>{const o=i<r,{qError:a}=o?t[i]:n[i-r];return 7005===a?.qErrorCode?o?e.hiddenDim.push(i):e.hiddenMea.push(i):e.visible.push(i),e},{visible:[],hiddenDim:[],hiddenMea:[]});return i.map((e,t)=>{const n=e<r,i=(n?o:a).filter(t=>t<e).length,s=e-i;return{colIdx:e,pageColIdx:t,visibleDimInfoIdx:n?s:void 0,visibleMeasureInfoIdx:n?void 0:s-r}})})(i.length===s?i:Array.from(Array(s).keys()),o,a);return l.map(i=>YW(e,i,t,n,r))},XW=(e,t,n,r)=>e?(r?n.nullValueRepresentation?.dimensionText:void 0)??t.qText??"-":n.nullValueRepresentation?.text??t.qText??"-",JW=(e,t)=>t?-2===e.qElemNumber:!!e.qIsNull,QW={page:0,rowsPerPage:100,rowsPerPageOptions:[10,25,100]},ZW=gg(e=>{const t=e(eU),n=e(Yg),r=e(yW),i=n.qHyperCube.qSize.qcy,o=r.visibleHeight??t.rowsPerPage,a=r.visibleTop??t.page*o,s=r.visibleHeight??Math.min(o,i-a),l=n.qHyperCube.qSize.qcx;return t.page>0&&a>=i?{...t,page:0}:s*l>FW?{...t,rowsPerPage:$W(l,t.rowsPerPageOptions),page:0}:t}),eU=gg(QW),tU=gg(e=>{const t=e(Yg),n=e(yy),r=e(yW);return fy(t,n)?{page:r.page||QW.page,rowsPerPage:r.rowsPerPage||QW.rowsPerPage,rowsPerPageOptions:QW.rowsPerPageOptions}:e(ZW)},(e,t,n)=>{t(eU,e=>({...e,...n}))}),nU=!0,rU=e=>-1===e.qElemNumber||!!e.qIsTotalCell,iU=gg(async e=>{const t=e(Yg),n=e(yy),r=e(my),{page:i,rowsPerPage:o}=e(tU),a=e(yW),s=e(Sy),l=e(Vg),c=e(Xg),u=e(Wg),d=t.qHyperCube.qSize.qcx,p=t.qHyperCube.qSize.qcy,f=Math.ceil(p/o),h=a.visibleTop??i*o,m=a.visibleHeight??Math.min(o,p-h),g=p>10,y=BW(t,n),b=KW(t,nU,r,u),v=l.flags.isEnabled("VNA-670-SEPARATE_NULL_VALUE_STYLING"),x=u("VNA-977-TABLE-BARS"),w=await(async(e,t,n)=>{if(t.snapshotData)return t.qHyperCube.qDataPages;const r=t.qHyperCube.qDataPages.at(0),i=r?.qArea;return r&&i?.qLeft===n.qLeft&&i.qTop===n.qTop&&i.qWidth===n.qWidth&&i.qHeight>=n.qHeight?[{...r,qMatrix:r.qMatrix.slice(0,n.qHeight)}]:e&&"getHyperCubeData"in e?e.getHyperCubeData("/qHyperCubeDef",[n]):[]})(s,t,{qLeft:0,qTop:h,qHeight:m,qWidth:d});c||(a.qTop=h,a.qHeight=m,a.rowsPerPage=o,a.page=i);const S=w.at(0)?.qMatrix.map((e,n)=>{const i=[],o=e.some(rU);return b.forEach((a,s)=>{const c=e[s],u=!a.isDim&&c.qIsNull,d=a.isDim&&JW(c,a.isDim),p=u||d?XW(a.isDim,c,t,v):c.qText,f=u?tH(p):eH(c),g=eH(c)&&!tH(c.qText??"");i[s]={id:WF(),...c,align:UW(f,a.bodyTextAlign,r,nU),rowIdx:n+h,colIdx:a.colIdx,pageRowIdx:n,pageColIdx:s,selectionColIdx:a.selectionColIdx,isSelectable:a.isDim&&!a.isLocked&&!o&&!d,isTotalRow:o,isLastRow:n===m-1,isNumeric:f,isDual:g,isNull:(!u||!f)&&JW(c,a.isDim),qNumFormat:a.qNumFormat,qIsAutoFormat:a.qIsAutoFormat,formattedNullValueText:a.formattedNullValueText,representation:gW({cell:c,representationProperties:a.representation,attrExprInfoIndex:a.qAttrExprInfoIndex,env:l,conditionalColoring:a.conditionalColoring,miniChartOnMeasure:a.qMiniChart,measureMinMax:a.measureMinMax,getText:()=>p,direction:r,enabledFeatures:{[t$.Image]:!0,[t$.Indicator]:!0,[t$.MiniChart]:!0,[t$.Bar]:!a.isDim&&x}})}}),i})??[];return{totalColumnCount:d,totalRowCount:p,totalPages:f,paginationNeeded:g,totalsPosition:y,columns:b,rows:S}}),oU=_E(iU,e=>e),aU=gg(e=>{const t=e(Yg),n=e(yy),r=e(sy),i=e(my),o=e(Wg),a=KW(t,false,i,o),s=BW(t,n),l=t.qHyperCube.qSize.qcy,c=Math.min(MV,l),u=l>MV&&!!r.active;return{totalsPosition:s,columns:a,rows:[],totalRowCount:l,totalColumnCount:t.qHyperCube.qSize.qcx,totalPages:Math.ceil(l/c),paginationNeeded:u}}),sU={totalsPosition:{atTop:!1,atBottom:!1},columns:[],rows:[],totalRowCount:0,totalColumnCount:0,totalPages:0,paginationNeeded:!1},lU=gg(),cU=gg(e=>{const t=e(vy),n=e(lU);return n||(t?e(oU)??sU:e(aU))}),uU=gg(e=>e(cU).totalsPosition),dU=gg(e=>e(cU).columns),pU=gg(e=>e(dU).length),fU=gg(e=>e(cU).rows),hU=gg(e=>e(cU).totalRowCount),mU=gg(e=>e(cU).totalColumnCount),gU=gg(e=>e(cU).paginationNeeded),yU=gg(e=>{const t=e(_y),n=e(Py),r=e(Yg),i=e(uU),o=e(fU),a=i.atTop,s=function(e,t,n,r){const i=wV(e)?.content,o=SV("content",t,i);o.background=t.background.color;const a=xV(o.fontSize,n,r),s=i?.hoverColor,l=i?.hoverFontColor,c=t.getStyle("object","","straightTableV2.content.hover.backgroundColor"),u=t.getStyle("object","","straightTableV2.content.hover.color"),d=yV(l)||!!u,p=yV(s)||!!c,f=d||p;let h;h=yV(s)?bV(Uh.HOVER,t,s):c||(d?"":Uh.HOVER);const m=f?bV(Gh(h),t,l):"";return{...o,lastRowBottomBorder:a,hoverColors:{background:h,color:m}}}(r,n,o.length,t),l=kV(r,n,!a),c=function(e,t,n){const r=wV(e)?.content,i=SV("content",t,r),{borderBottomColor:o,borderTopColor:a,background:s}=kV(e,t,n);return{...i,borderBottomColor:o,background:s,borderTopColor:a}}(r,n,a);return{body:s,head:l,totals:c}}),bU=(e,t)=>{if(t){const n=e.getColorPickerColor(t);return"none"===n?"transparent":n}},vU=(e,t,n)=>{const{objectColorFromCSS:r,sheetColorFromCSS:i}=e.background,o=bU(e,t?.background),a=e.getStyle("","",n);return{backgroundColor:o||r||a,backgroundFromStyling:o,sheetColorFromCSS:i}},xU=(e,t,n,r=Uh.WHITE)=>{const{backgroundColor:i,backgroundFromStyling:o,sheetColorFromCSS:a}=vU(e,t,n);return nm(o,i,a,r)??r},wU=e=>{switch(typeof e){case"string":return`${parseInt(e,10)}px`;case"number":return`${e}px`;default:return GH}},SU=e=>e?.some(e=>"italic"===e)?"italic":"normal",kU=(e,t)=>void 0===e?t:e.some(e=>"bold"===e)?YH:"normal",CU=e=>!1===e?1:3,EU=e=>e?.some(e=>"underline"===e)?"underline":"none",MU=gg(e=>{const t=e(yy),n=e(vy),r=e(Py),i=e(Yg),o=e(yU),a=e(Wg),{header:s,dimensionValues:l,measureValues:c,totalValues:u,subTotalValues:d,nullValues:p,dimensionNullValues:f,grid:h,content:m}=wV(i)??{},g=a("VNA-670-SEPARATE_NULL_VALUE_STYLING"),y=n?Uh.WHITE:Uh.TRANSPARENT,b=xU(r,s,"object.straightTableV2.dimension.label.name.backgroundColor",y),v=t?.maxLineCount??m?.rowHeight??r.getStyle("object.straightTableV2","grid","lineClamp"),x=(g?f:void 0)??p;return{header:{fontFamily:s?.fontFamily??r.getStyle("object.straightTableV2.dimension","label.name","fontFamily")??o.head.fontFamily??KH,fontSize:wU(s?.fontSize??r.getStyle("object.straightTableV2.dimension","label.name","fontSize")??o.head.fontSize),fontStyle:SU(s?.fontStyle),fontWeight:kU(s?.fontStyle,YH),textDecoration:EU(s?.fontStyle),color:bU(r,s?.fontColor)??r.getStyle("object.straightTableV2.dimension","label.name","color")??o.head.color??Uh.TEXT,background:b},headerMenuHoverBackground:Kh(b,Am),headerMenuActiveBackground:Kh(b,Im),dimension:{values:{fontFamily:l?.fontFamily??r.getStyle("object.straightTableV2.dimension","label.value","fontFamily")??o.body.fontFamily??KH,fontSize:wU(l?.fontSize??m?.fontSize??r.getStyle("object.straightTableV2.dimension","label.value","fontSize")??o.body.fontSize),fontStyle:SU(l?.fontStyle),fontWeight:kU(l?.fontStyle,"normal"),textDecoration:EU(l?.fontStyle),color:bU(r,l?.fontColor)??bU(r,m?.fontColor)??r.getStyle("object.straightTableV2.dimension","label.value","color")??o.body.color??Uh.TEXT,background:vU(r,l,"object.straightTableV2.dimension.label.value.backgroundColor").backgroundColor??o.body.background??Uh.TRANSPARENT}},measure:{values:{fontFamily:c?.fontFamily??r.getStyle("object.straightTableV2.measure","label.value","fontFamily")??o.body.fontFamily??KH,fontSize:wU(c?.fontSize??m?.fontSize??r.getStyle("object.straightTableV2.measure","label.value","fontSize")??o.body.fontSize),fontStyle:SU(c?.fontStyle),fontWeight:kU(c?.fontStyle,"normal"),textDecoration:EU(c?.fontStyle),color:bU(r,c?.fontColor)??bU(r,m?.fontColor)??r.getStyle("object.straightTableV2.measure","label.value","color")??o.body.color??Uh.TEXT,background:vU(r,c,"object.straightTableV2.measure.label.value.backgroundColor").backgroundColor??o.body.background??Uh.TRANSPARENT}},totalRow:{fontFamily:u?.fontFamily??r.getStyle("object.straightTableV2.total","label.value","fontFamily")??o.totals.fontFamily??KH,fontSize:wU(u?.fontSize??m?.fontSize??r.getStyle("object.straightTableV2.total","label.value","fontSize")??o.totals.fontSize),fontStyle:SU(u?.fontStyle),fontWeight:kU(u?.fontStyle,YH),textDecoration:EU(u?.fontStyle),color:bU(r,u?.fontColor)??bU(r,m?.fontColor)??r.getStyle("object.straightTableV2.total","label.value","color")??o.totals.color??Uh.TEXT,background:xU(r,u,"object.straightTableV2.total.label.value.backgroundColor",y)},subTotalRow:{fontFamily:d?.fontFamily??r.getStyle("object.straightTableV2.subTotal","label.value","fontFamily")??o.totals.fontFamily??KH,fontSize:wU(d?.fontSize??m?.fontSize??r.getStyle("object.straightTableV2.subTotal","label.value","fontSize")??o.totals.fontSize),fontStyle:SU(d?.fontStyle),fontWeight:kU(d?.fontStyle,YH),textDecoration:EU(d?.fontStyle),color:bU(r,d?.fontColor)??bU(r,m?.fontColor)??r.getStyle("object.straightTableV2.subTotal","label.value","color")??o.totals.color??Uh.TEXT,background:xU(r,d,"object.straightTableV2.subTotal.label.value.backgroundColor",y)},dimensionNull:{fontStyle:SU(x?.fontStyle),fontWeight:kU(x?.fontStyle,"normal"),textDecoration:EU(x?.fontStyle),color:bU(r,x?.fontColor)??bU(r,m?.fontColor)??r.getStyle("object.straightTableV2.null","label.value","color")??o.body.color??Uh.TEXT,background:bU(r,x?.background)??r.getStyle("","","object.straightTableV2.null.label.value.backgroundColor")??Uh.NULL_VALUE_BACKGROUND},measureNull:{fontStyle:SU(p?.fontStyle),fontWeight:kU(p?.fontStyle,"normal"),textDecoration:EU(p?.fontStyle),color:bU(r,p?.fontColor)??bU(r,m?.fontColor)??r.getStyle("object.straightTableV2.null","label.value","color")??o.body.color??Uh.TEXT,background:bU(r,p?.background)??r.getStyle("","","object.straightTableV2.null.label.value.backgroundColor")??Uh.NULL_VALUE_BACKGROUND},grid:{contentLineClamp:v??CU(i.multiline?.wrapTextInCells),headerLineClamp:CU(i.multiline?.wrapTextInHeaders),border:bU(r,h?.border)??r.getStyle("object.straightTableV2","grid","borderColor")??(r.background.isDark?Uh.DARK_MODE_BORDER:Uh.BORDER_MEDIUM),divider:bU(r,h?.divider)??r.getStyle("object.straightTableV2.grid","","divider.borderColor")??Uh.BORDER_HEAVY,hoverColors:{color:bU(r,m?.hoverFontColor)??r.getStyle("object.straightTableV2","","grid.hover.color")??o.body.hoverColors?.color,background:bU(r,m?.hoverColor)??r.getStyle("object.straightTableV2","","grid.hover.backgroundColor")??o.body.hoverColors?.background},zebraStripes:{show:!!h?.zebraStripes?.show,odd:{color:bU(r,h?.zebraStripes?.color?.odd),background:bU(r,h?.zebraStripes?.background?.odd)},even:{color:bU(r,h?.zebraStripes?.color?.even),background:bU(r,h?.zebraStripes?.background?.even)},overrideDimNullValueBackground:void 0===bU(r,x?.background),overrideDimNullValueColor:void 0===bU(r,x?.fontColor),overrideMeasNullValueBackground:void 0===bU(r,p?.background),overrideMeasNullValueColor:void 0===bU(r,p?.fontColor)},lastRowBottomBorder:o.body.lastRowBottomBorder},selectedColors:Yh(r),contentStaticLineCount:v}}),RU=gg(e=>{const t=e(MU);return Math.max(fV(t.header.fontSize)+8,32)}),_U=gg(e=>{const t=e(MU),n=fV(t.totalRow.fontSize);return Math.max(n+9,24)}),AU=gg(e=>{const t=e(MU),n=e(Jg),r=e(Qg);return Math.max(n>0?fV(t.dimension.values.fontSize):0,r>0?fV(t.measure.values.fontSize):0)}),IU=gg(e=>{const t=e(MU),n=e(AU),r=(t.contentStaticLineCount||1)*n;return Math.max(r+9,24)}),PU=gg(e=>{const t=e(MU),n=fV(t.subTotalRow.fontSize),r=(t.contentStaticLineCount||1)*n;return Math.max(r+9,24)}),TU=(e,t,n)=>{if(!e.length)return[];const r=[],i=[];let o=t;if(e.forEach((e,a)=>{const{columnWidth:{type:s,pixels:l,percentage:c},label:u,qApprMaxGlyphCount:d,totalInfo:p}=e;let f=0;const h=()=>{r[a]=Math.min(Rm.PixelsMax,Math.max(Rm.PixelsMin,f)),o-=r[a]};switch(s){case _m.Pixels:f=(e=>void 0===e||Number.isNaN(+e)?Rm.PixelsDefault:+e)(l),h();break;case _m.Percentage:f=(e=>void 0===e||Number.isNaN(+e)?Rm.PercentageDefault:+e)(c)/100*t,h();break;case _m.FitToContent:e.representation?.type===t$.Image?i.push(a):(f=n(u,p,d,e.isLocked,e.isActivelySorted,e.isDim,e.isCyclic),h());break;case _m.Auto:i.push(a);break;default:throw new Error(`${s} is not a valid column width type`)}}),i.length){const e=o/i.length;i.forEach(t=>{r[t]=Math.max(Rm.AutoMinTable,e)})}return r},DU=gg(e=>{const t=e(MU),n=e(cU).totalsPosition,r=e(ny),{measureText:i}=e(WB({...t.header,fontWeight:YH})),{measureText:o}=e(WB({...t.totalRow,fontWeight:YH})),{estimateWidth:a}=e(WB(t.dimension.values)),{estimateWidth:s}=e(WB(t.measure.values)),l=n.atBottom||n.atTop;return(e,t,n,c,u,d,p)=>{let f;if(r){const t=4;let n=25;n+=t+24,c&&(n+=20+t),u&&(n+=20),f=i(e)+n}else{let t=9;t+=16,p&&(t+=rV),t+=rV,t+=rV,f=i(e)+t}const h=d?a:s;return Math.max(f,l?o(t)+24+1:0,h(n))}}),OU=gg(null),NU=gg(e=>{const t=e(cU),n=e(Ry).width,r=e(pV),i=e(DU);return TU(t.columns,n-r,i)}),qU=gg(e=>e(OU)??e(NU),(e,t,n)=>{t(OU,n)}),LU=ZE(e=>{const t=e(GB);!1===e(uV)&&t.emit("done-adjusting-column-width")}),jU=ZE((e,t)=>{e(Yg),t(OU,null)}),zU=gg(e=>e(qU).reduce((e,t)=>e+t,0)),FU=({children:e})=>(_g(jU),_g(LU),e);function $U(e){const t=Hh();return t.components?.MuiTable?.styleOverrides&&(t.components.MuiTable.styleOverrides.root={}),Ml({...t,direction:e})}const BU={width:"100%",height:"100%",color:"transparent",background:"transparent",borderColor:"transparent"},HU={border:0,boxShadow:"none",borderRadius:0,outline:0,width:0,height:0,background:"transparent",cursor:"pointer",visibility:"hidden"},VU=Ul("input",{shouldForwardProp:e=>"isLastColumn"!==e&&"hoverColor"!==e})(({isLastColumn:e,hoverColor:t,dir:n})=>({position:"absolute",display:"flex",height:"100%",top:0,marginLeft:"-4px",marginRight:"rtl"===n?"-4px":void 0,touchAction:"none",cursor:"col-resize",pointerEvents:"auto",width:(e?4:9)+"px",justifyContent:e?"flex-end":"center",outline:"none",appearance:"none",WebkitAppearance:"none",backgroundColor:"transparent","&::-webkit-slider-runnable-track":{...BU},"&::-moz-range-track":{...BU},"&::-ms-track":{...BU},"&::-webkit-slider-thumb":{appearance:"none",WebkitAppearance:"none",...HU},"&::-moz-range-thumb":{...HU},"&::-ms-thumb":{...HU},"&: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"}})),WU=({columnWidth:e,keyValue:t,isLastColumn:n,isPivot:r,hoverColor:i,updateWidthCallback:o,confirmWidthCallback:a,handleBlur:s,setIsAdjustingWidth:l,isLeftColumn:c,accessibilityRelatedArgs:u,direction:d="ltr"})=>{const p=bm({translator:u.translator}),f=Yt.useRef({initWidth:e,columnWidth:e,initX:0}),h=n?0:1,m=r&&!c,g=()=>m?f.current.columnWidth-h:"100%",y={left:"rtl"!==d?g():void 0,right:"rtl"===d?g():void 0},b=t=>{f.current={initWidth:e,columnWidth:e,initX:t??f.current.initX}};gm(()=>{m&&b()},[e]);const v=e=>{const t=Math.max(e,Rm.PixelsMin);f.current.columnWidth=t,o(t)},x=()=>{if(f.current.columnWidth!==f.current.initWidth){const e={type:_m.Pixels,pixels:f.current.columnWidth};a(e)}l?.(!1)},w=e=>{const t="rtl"===d?f.current.initWidth+f.current.initX-e.clientX:f.current.initWidth+e.clientX-f.current.initX;v(t)},S=e=>{Zh(e),document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S),x()},k=e=>{const t="rtl"===d?f.current.initWidth+-f.current.initX-e.touches[0].clientX:f.current.initWidth+e.touches[0].clientX-f.current.initX;v(t)},C=e=>{Zh(e),document.removeEventListener("touchmove",k),document.removeEventListener("touchend",C),x()},E=!r&&s?e=>{if(e.key===Em.Left||e.key===Em.Right){Zh(e);const t=5,n=e.key===Em.Left?t:-t,r="rtl"===d?n:-n;l?.(!0),v(f.current.columnWidth+r)}else e.key===Em.Space||e.key===Em.Enter?(Zh(e),s(e),l?.(!1),x()):e.key===Em.Esc&&(Zh(e),s(e),l?.(!1),v(f.current.initWidth))}:void 0,M=p.get("NebulaTableUtils.ColumnAdjuster.ColumnNameLabel",[String(u.columnLabel)]);return lt.jsx(VU,{style:y,hoverColor:i,isLastColumn:n,className:Mm,"data-testid":Mm,onMouseDown:e=>{Zh(e),document.addEventListener("mousemove",w),document.addEventListener("mouseup",S),l?.(!0),b(e.clientX)},onDoubleClick:()=>{a({type:_m.FitToContent})},onTouchStart:e=>{1===e.touches.length&&(Zh(e),document.addEventListener("touchmove",k),document.addEventListener("touchend",C),l?.(!0),b(e.touches[0].clientX))},onKeyDown:E,onBlur:s,onFocus:()=>{b()},type:"range",tabIndex:-1,"aria-label":M,"aria-valuemin":Rm.PixelsMin,"aria-valuemax":Rm.PixelsMax,"aria-valuenow":Number(e.toFixed(1)),dir:d},t)},UU=(e,t)=>lt.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:lt.jsx("path",{d:"M15 4H1V2h14zm0 10H1v-2h14zm0-5H1V7h14z"})}),GU=Yt.forwardRef(UU),YU=({model:e,headerData:t})=>{if(e&&"setActiveField"in e&&void 0!==t.dimensionInfoIndex){const n=t.dimensionInfoIndex;return async t=>{try{await e.setActiveField("/qHyperCubeDef",n,t)}catch(e){console.error(e)}}}return null},KU=Ul(Xu,{shouldForwardProp:e=>"rightAligned"!==e&&"shouldShowMenuIcon"!==e&&"isAccessibleHeader"!==e})(({rightAligned:e,shouldShowMenuIcon:t,isAccessibleHeader:n})=>({...e?{marginRight:"auto"}:{marginLeft:"auto"},height:n?24:void 0,display:t?"flex":"none",fontWeight:"bold",width:n?"100%":void 0,alignItems:"center",justifyContent:"center"})),XU=Ul(GU,{shouldForwardProp:e=>"isInteractionsActive"!==e})(({isInteractionsActive:e})=>({minWidth:"unset",position:"relative",cursor:e?"pointer":"default"})),JU=Ul(pf)(({theme:e})=>({".MuiList-root":{padding:e.spacing(.5,0)}})),QU=Ul(Vd)(({theme:e})=>({"&.MuiDivider-root":{margin:e.spacing(.5)}})),ZU=Ul(yf)(({theme:e})=>({fontSize:"12px",height:24,fontWeight:"bold",padding:`${e.spacing(.25,2)} !important`,marginBottom:e.spacing(.5)})),eG=Ul(yf,{shouldForwardProp:e=>"isSubMenu"!==e&&"isActive"!==e})(({theme:e,isSubMenu:t,isActive:n})=>({width:`calc(220px - ${e.spacing(1)} - ${t?10:0}px)`,maxHeight:32,borderRadius:`${e.spacing(.5)} !important`,margin:`${e.spacing(.25,.5)} !important`,padding:`${e.spacing(1,1.5)} !important`,display:"flex !important",justifyContent:"space-between !important","&&:focus":{boxShadow:"rgb(23, 127, 230) 0px 0px 0px 2px"},position:"relative !important",overflow:"hidden",boxSizing:"border-box !important",background:n?"rgba(0, 0, 0, 0.05)":"transparent"})),tG=Ul("div",{shouldForwardProp:e=>!["direction","isPagination"].includes(e)})(({theme:e,direction:t,isPagination:n})=>({position:"absolute",width:e.spacing(.5),height:16,left:0,right:n||"rtl"!==t?void 0:0,top:"50%",transform:"TranslateY(-50%)",borderRadius:"0 2px 2px 0",background:"#01873d"})),nG=Ul("div")(()=>({display:"flex",justifyContent:"space-between",alignItems:"center",maxWidth:"100%"})),rG=Ul(pu)(()=>({fontFamily:'"Source Sans Pro", HelveticaNeue, "Helvetica Neue", Helvetica, Arial, sans-serif',fontSize:"14px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"})),iG=Ul(jp,{shouldForwardProp:e=>!["direction","isPagination"].includes(e)})(({theme:e,direction:t,isPagination:n})=>({width:16,minWidth:"unset !important",marginRight:n||"rtl"!==t?e.spacing(1.5):0,marginLeft:n||"rtl"!==t?void 0:e.spacing(1.5),lineHeight:0})),oG=(e,t)=>lt.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:lt.jsx("path",{d:"M8.5 8 4 3.5 5.5 2l6 6-6 6L4 12.5z"})}),aG=Yt.forwardRef(oG),sG=e=>{const t=e.nextElementSibling;return t?"HR"===t.tagName?sG(t):t:e.parentElement?.children?.[0]},lG=e=>{const t=e.previousElementSibling;if(!t){const t=e.parentElement?.children?.length;return e.parentElement?.children?.[t-1]}return"HR"===t.tagName?lG(t):t},cG=e=>{const{key:t,currentTarget:n}=e,r=document.activeElement??n;if(t===Em.Down||t===Em.Up){const n=e=>t===Em.Down?sG(e):lG(e);e.preventDefault(),e.stopPropagation();let i=n(r);for(;i;){if("true"!==i.ariaDisabled){i.focus();break}i=n(i)}}},uG=(e,t)=>e.map(e=>e.map(e=>({...e.groupHeading?{groupHeading:e.groupHeading}:{},items:e.items.map(({onClick:e,...n})=>({...n,...e?{onClick:async n=>{Object.entries(t).forEach(([,e])=>{e(!1)}),await e(n)}}:{}}))})));let dG={};const pG=({autoFocus:e,id:t,onClick:n,itemTitle:r,icon:i,enabled:o,subMenus:a,isSubMenu:s,isActive:l,direction:c,isPagination:u})=>{const[d,p]=Yt.useState(!1),f=Kt.useRef(null),h=Yt.useCallback(e=>{e.stopPropagation(),p(!1)},[p]);return lt.jsxs(lt.Fragment,{children:[lt.jsxs(eG,{ref:a?f:null,"data-testid":`menu-item-${t}`,className:"nebula-table-utils-head-menu-item",onClick:async e=>{"keyup"!==e.type&&(n&&(await n(e),dG={}),a?.length&&(p(!0),dG[r]=p,e.stopPropagation()))},disabled:!o,autoFocus:e,isSubMenu:!!s,isActive:!!l,onKeyDown:cG,children:[l?lt.jsx(tG,{direction:c,isPagination:u}):null,lt.jsxs(nG,{children:[lt.jsx(iG,{direction:c,isPagination:u,children:lt.jsx(i,{})}),lt.jsx(rG,{variant:"body2",children:r})]}),a?.length?lt.jsx(aG,{}):null]},t),a?.length?lt.jsx(gG,{isSubMenu:!0,open:d,anchorEl:f.current,onClose:h,menuGroups:uG(a,dG),transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"top"},direction:c,isPagination:u}):null]})},fG=({menuGroup:e,isSubMenu:t,direction:n,isPagination:r})=>e.map(e=>[[e.groupHeading&<.jsx(ZU,{disabled:!0,style:{opacity:1},children:e.groupHeading},e.groupHeading),e.items.map(e=>lt.jsx(pG,{...e,isSubMenu:t,direction:n,isPagination:r},e.id))].filter(Boolean)]),hG=({itemGroups:e,isSubMenu:t,direction:n,isPagination:r})=>e.map((i,o)=>[fG({menuGroup:i,isSubMenu:t,direction:n,isPagination:r}),o<e.length-1?lt.jsx(QU,{"data-testid":"group-divider",variant:"middle"}):void 0]),mG={appear:0,enter:0,exit:0},gG=({anchorEl:e,open:t,onClose:n,menuGroups:r,transformOrigin:i,anchorOrigin:o,isSubMenu:a,direction:s,isPagination:l})=>r.length?lt.jsx(JU,{className:Sm,open:t,anchorEl:e,onClose:n,transitionDuration:mG,MenuListProps:{id:km},...o?{anchorOrigin:o}:{},...i?{transformOrigin:i}:{},dir:s,children:hG({itemGroups:r,isSubMenu:a,direction:s,isPagination:l})}):null,yG=({qLibraryId:e,fieldId:t,searchRelatedArgs:n,selectionRelatedArgs:r,direction:i,onPopoverClose:o})=>Yt.useCallback(()=>{const a=e?{qLibraryId:e,type:"dimension"}:t;if(n?.embed){const{embed:e,listboxRef:t}=n;e.__DO_NOT_USE__.popover(t.current,a,{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"rtl"===i?"right":"left"},sortCriteria:n.sortCriteria,stateName:r?.qStateName,direction:i,onPopoverClose:o})}},[e,t,n,r?.qStateName,i,o]),bG=(e,t)=>({qInfo:{qType:"tableListbox"},qListObjectDef:Boolean(t.qLibraryId)?{qLibraryId:t.qLibraryId,qStateName:e}:{qDef:{qFieldDefs:[t.fieldId]},qStateName:e}}),vG=(e,t)=>e.some(e=>t[e]>0),xG={canSelectAll:!1,canClearSelections:!1,canSelectPossible:!1,canSelectAlternative:!1,canSelectExcluded:!1},wG=({open:e,qStateName:t="$",headerData:n,app:r})=>{const[i,o]=Yt.useState(null),[a,s]=Yt.useState(xG);return gm(()=>{e||(s(xG),o(null))},[e]),Yt.useEffect(()=>{if(!r?.createSessionObject||!n.isDim||!e)return()=>{};let i,a=!1;const l=()=>{i&&r.destroySessionObject(i)};return(async()=>{try{const e=bG(t,n),c=await r.createSessionObject(e),u=await c.getLayout(),{qStateCounts:d}=u.qListObject?.qDimensionInfo??{};i=u.qInfo?.qId,a?l():(o(c),d&&s((e=>({canSelectAll:vG(["qOption","qAlternative","qExcluded","qDeselected"],e),canClearSelections:vG(["qSelected"],e),canSelectPossible:vG(["qOption"],e),canSelectAlternative:vG(["qAlternative"],e),canSelectExcluded:vG(["qAlternative","qExcluded"],e)}))(d)))}catch(e){console.error(e)}})(),()=>{a=!0,l()}},[e,r,n,t]),{fieldInstance:i,selectionActionsEnabledStatus:a}},SG=(e,t)=>lt.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:lt.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"})}),kG=Yt.forwardRef(SG),CG=(e,t)=>lt.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:lt.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"})}),EG=Yt.forwardRef(CG),MG=(e,t)=>lt.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:lt.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"})}),RG=Yt.forwardRef(MG),_G=(e,t)=>lt.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:lt.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"})}),AG=Yt.forwardRef(_G),IG=(e,t)=>lt.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:lt.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"})}),PG=Yt.forwardRef(IG),TG=(e,t)=>lt.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:lt.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"})}),DG=Yt.forwardRef(TG),OG=(e,t)=>lt.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:lt.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"})}),NG=Yt.forwardRef(OG),qG=(e,t)=>lt.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:lt.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"})}),LG=Yt.forwardRef(qG),jG=(e,t)=>lt.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:lt.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"})}),zG=Yt.forwardRef(jG),FG=(e,t)=>lt.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:lt.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"})}),$G=Yt.forwardRef(FG),BG=(e,t)=>lt.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:lt.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"})}),HG=Yt.forwardRef(BG),VG=(e,t)=>lt.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:lt.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"})}),WG=Yt.forwardRef(VG),UG=(e,t)=>lt.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:lt.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"})}),GG=Yt.forwardRef(UG);let YG=function(e){return e.Sorting="sorting",e.Searching="searching",e.Selections="selections",e.AdjusterHeaderSize="adjustHeaderSize",e}({});const KG="/qListObjectDef",XG=({headerData:e,translator:t,menuAvailabilityFlags:n,setOpen:r,sortFromMenu:i,interactions:o,embedListbox:a,fieldInstance:s,selectionActionsEnabledStatus:l,anchorRef:c,focusColumnAdjuster:u,setActiveFieldCallback:d,expandOrCollapseArgs:p})=>{const f=[];if(n[YG.Sorting]){const{isActivelySorted:n,sortDirection:o}=e,{ascendingEnabled:a,descendingEnabled:s}=(({isActivelySorted:e,sortDirection:t,isPivot:n,isSortedByFirstMeasure:r})=>{let i=!n&&!e||"D"===t,o=!n&&!e||"A"===t;return r&&(i=!1,o=!1),{ascendingEnabled:i,descendingEnabled:o}})(e);f.push([{groupHeading:t.get("NebulaTableUtils.MenuGroupLabel.Sorting"),items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SortAscending"),onClick:async e=>{e.stopPropagation(),await(i?.(e,"A")),r(!1)},icon:kG,enabled:a,isActive:!!n&&"A"===o,autoFocus:a},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SortDescending"),onClick:async e=>{e.stopPropagation(),await(i?.(e,"D")),r(!1)},icon:AG,enabled:s,isActive:!!n&&"D"===o,autoFocus:!a&&s}]}])}if(e.isCyclic&&d){const t=[];t.push([{items:[{id:1,itemTitle:e.groupDimensionLabels[e.groupDimensionPos],enabled:!0,icon:NG,subMenus:[[{items:e.groupDimensionLabels.map((t,n)=>({id:n+1,itemTitle:t,onClick:e=>{e.stopPropagation(),r(!1),d(n)},enabled:!0,icon:yF,isActive:e.groupDimensionPos===n}))}]]}]}]),t.length>0&&f.push(...t)}if(e.isDim&&o?.select){const i=[];n[YG.Searching]&&i.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Search"),onClick:e=>{e.stopPropagation(),r(!1),a()},icon:LG,enabled:!0}]}]),!e.isLocked&&n[YG.Selections]&&i.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Selections"),icon:GG,enabled:!!s,subMenus:[[{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectAll"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectAll(KG))},icon:zG,enabled:l.canSelectAll},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectPossible"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectPossible(KG))},icon:WG,enabled:l.canSelectPossible},{id:3,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectAlternative"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectAlternative(KG))},icon:$G,enabled:l.canSelectAlternative},{id:4,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectExcluded"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.selectListObjectExcluded(KG))},icon:HG,enabled:l.canSelectExcluded}]}],[{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.ClearSelections"),onClick:async e=>{e.stopPropagation(),r(!1),await(s?.clearSelections(KG))},icon:EG,enabled:l.canClearSelections}]}]]}]}]),p&&!p.alwaysFullyExpanded&&f.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Expand"),onClick:async e=>{e.stopPropagation(),e.preventDefault(),r(!1),await p.expandCallback()},icon:DG,enabled:!0},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Collapse"),onClick:async e=>{e.stopPropagation(),e.preventDefault(),r(!1),await p.collapseCallback()},icon:PG,enabled:!0}]}]),i.length>0&&f.push(...i)}return n[YG.AdjusterHeaderSize]&&f.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.AdjustColumnSize"),onClick:e=>{e.stopPropagation(),e.preventDefault(),r(!1),u?.(c)},icon:RG,enabled:!0}]}]),f},JG=({open:e,setOpen:t,anchorRef:n,headerData:r,translator:i,interactions:o,menuAvailabilityFlags:a,shouldShowMenuIcon:s=!0,sortRelatedArgs:l,searchRelatedArgs:c,selectionRelatedArgs:u,adjustHeaderSizeRelatedArgs:d,expandOrCollapseArgs:p,model:f,direction:h="ltr",isPagination:m,isAccessibleHeader:g,iconSize:y=vm})=>{const b=Yt.useRef(null),v=bm({translator:i}),{qLibraryId:x,fieldId:w,headTextAlign:S}=r,k=u?.app,{fieldInstance:C,selectionActionsEnabledStatus:E}=wG({open:e,headerData:r,app:k,qStateName:u?.qStateName}),M=YU({model:f,headerData:r}),R=yG({qLibraryId:x,fieldId:w,searchRelatedArgs:c,selectionRelatedArgs:u,direction:h}),_=Yt.useCallback(e=>{e.stopPropagation(),t(!1)},[t]),A=Yt.useCallback(e=>{e.stopPropagation(),t(e=>!e)},[t]);return o.active?lt.jsxs(KU,{rightAligned:"right"===S,shouldShowMenuIcon:s,className:wm,onClick:!1===g?A:void 0,ref:b,isAccessibleHeader:g,children:[s?lt.jsx(XU,{height:y,className:xm,"data-testid":xm,isInteractionsActive:o.active??!1,children:lt.jsx(GU,{})}):null,lt.jsx(gG,{open:e,anchorEl:!1===g?b.current:n.current,onClose:_,menuGroups:XG({headerData:r,translator:v,menuAvailabilityFlags:a,setOpen:t,...l,embedListbox:R,interactions:o,fieldInstance:C,selectionActionsEnabledStatus:E,anchorRef:n,focusColumnAdjuster:d?.focusColumnAdjuster,setActiveFieldCallback:M,expandOrCollapseArgs:p}),direction:h,isPagination:m})]}):null},QG=e=>e.isDark?{background:e.color,borderColor:Uh.DARK_MODE_BORDER,color:Uh.DARK_MODE_TEXT,disabledColor:Uh.DARK_MODE_DISABLED,iconColor:Uh.DARK_MODE_TEXT}:{background:e.color,borderColor:Uh.BORDER_MEDIUM,color:Uh.TEXT,disabledColor:Uh.DISABLED},ZG=Ul(Xu,{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}`})),eY=Ul(Jf,{shouldForwardProp:e=>"footerStyle"!==e})(({footerStyle:e,theme:t})=>({background:"inherit",marginRight:t.spacing(1),color:e.color,"& .MuiNativeSelect-icon, .MuiNativeSelect-select":{color:e.iconColor}})),tY=Ul(ad,{shouldForwardProp:e=>"disabledCondition"!==e&&"footerStyle"!==e})(({disabledCondition:e,footerStyle:t,theme:n})=>({color:e?t.disabledColor:t.color,cursor:e?"default":"pointer",marginLeft:n.spacing(1)})),nY=Ul(pu)(({theme:e})=>({color:"inherit",margin:e.spacing(0,1,0,1)})),rY=({children:e,footerContainer:t,interactions:n,theme:r,paginationNeeded:i=!0})=>{const o=Yt.useMemo(()=>QG(r.background),[r]);if(!n.active)return null;const a=i?lt.jsx(ZG,{footerStyle:o,children:e}):null;return t?gc.createPortal(e,t):a},iY=(e,t)=>lt.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:lt.jsx("path",{d:"m12 2 1.5 1.5L9 8l4.5 4.5L12 14 6 8zM4 2v12H2V2z"})}),oY=Yt.forwardRef(iY),aY=(e,t)=>lt.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:lt.jsx("path",{d:"m3.5 2 6 6-6 6L2 12.5 6.5 8 2 3.5zM14 2v12h-2V2z"})}),sY=Yt.forwardRef(aY),lY={},cY=Yt.createContext(lY),uY=()=>Yt.useContext(cY),dY=({children:e,direction:t,pageInfo:n,handleChangeRowsPerPage:r,footerContainer:i,isSelectionMode:o,handleChangePage:a,totalRowCount:s,totalColumnCount:l,totalPages:c,keyboard:u,translator:d,theme:p,interactions:f,rect:h,layout:m,visibilityThreshold:g})=>{const y=(e=>!e.enabled||e.active)(u)?0:-1,b=Yt.useMemo(()=>QG(p.background),[p]),v=i?i.getBoundingClientRect().width:h.width,x=bm({translator:d}),w=Yt.useMemo(()=>({direction:t,pageInfo:n,handleChangeRowsPerPage:r,footerContainer:i,isSelectionMode:o,handleChangePage:a,totalRowCount:s,totalColumnCount:l,totalPages:c,keyboard:u,translator:x,theme:p,interactions:f,rect:h,layout:m,footerStyle:b,tabIndex:y,width:v,visibilityThreshold:g}),[t,n,r,i,o,a,s,l,c,u,x,p,f,h,m,b,y,v,g]);return lt.jsx(cY.Provider,{value:w,children:e})},pY=({disabledCondition:e,pageNumber:t,type:n,footerStyle:r,handleChangePage:i,translator:o,interactions:a,tabIndex:s})=>({footerStyle:r,disabledCondition:e,size:"small","data-testid":"pagination-action-icon-button","aria-disabled":e,"aria-label":o.get(`NebulaTableUtils.Pagination.${n}`),title:a.passive?o.get(`NebulaTableUtils.Pagination.${n}`):void 0,tabIndex:s,onClick:e?void 0:()=>{i(t)}});let fY=function(e){return e.FirstPage="FirstPage",e.LastPage="LastPage",e.NextPage="NextPage",e.PreviousPage="PreviousPage",e}({}),hY=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 mY=()=>{const{direction:e,pageInfo:t,width:n,interactions:r,visibilityThreshold:i,footerStyle:o,handleChangePage:a,translator:s,tabIndex:l}=uY(),c=0===t.page,u=pY({type:fY.FirstPage,disabledCondition:c,pageNumber:0,footerStyle:o,handleChangePage:a,translator:s,interactions:r,tabIndex:l});return n<=(i?.firstPage||hY.FirstPage)?null:lt.jsx(tY,{...u,disabled:!r.active,children:"rtl"===e?lt.jsx(sY,{height:vm}):lt.jsx(oY,{height:vm})})},gY=(e,t,n=!1)=>{n&&e.key===Em.Tab&&!e.shiftKey&&(Zh(e),Qh(e.target,t,!1))},yY=()=>{const{direction:e,pageInfo:t,keyboard:n,totalPages:r,isSelectionMode:i,width:o,interactions:a,visibilityThreshold:s,footerStyle:l,handleChangePage:c,translator:u,tabIndex:d}=uY(),p=t.page>=r-1,f=pY({type:fY.LastPage,disabledCondition:p,pageNumber:r-1,footerStyle:l,handleChangePage:c,translator:u,interactions:a,tabIndex:d}),h=n.enabled?e=>{gY(e,n,i)}:void 0;return o<=(s?.lastPage||hY.LastPage)?null:lt.jsx(tY,{...f,onKeyDown:h,disabled:!a.active,children:"rtl"===e?lt.jsx(oY,{height:vm}):lt.jsx(sY,{height:vm})})},bY=(e,t)=>lt.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:lt.jsx("path",{d:"m7 8 4.5 4.5L10 14 4 8l6-6 1.5 1.5z"})}),vY=Yt.forwardRef(bY),xY=()=>{const{direction:e,pageInfo:t,keyboard:n,totalPages:r,isSelectionMode:i,width:o,interactions:a,footerStyle:s,handleChangePage:l,translator:c,tabIndex:u}=uY(),d=t.page>=r-1,p=pY({type:fY.NextPage,disabledCondition:d,pageNumber:t.page+1,footerStyle:s,handleChangePage:l,translator:c,interactions:a,tabIndex:u}),f=!(o>hY.FirstPage&&o>hY.LastPage)&&n.enabled?e=>{gY(e,n,i)}:void 0;return lt.jsx(tY,{...p,onKeyDown:f,disabled:!a.active,children:"rtl"===e?lt.jsx(vY,{height:vm}):lt.jsx(aG,{height:vm})})},wY=()=>{const{direction:e,pageInfo:t,interactions:n,footerStyle:r,handleChangePage:i,translator:o,tabIndex:a}=uY(),s=0===t.page,l=pY({type:fY.PreviousPage,disabledCondition:s,pageNumber:t.page-1,footerStyle:r,handleChangePage:i,translator:o,interactions:n,tabIndex:a});return lt.jsx(tY,{...l,disabled:!n.active,children:"rtl"===e?lt.jsx(aG,{height:vm}):lt.jsx(vY,{height:vm})})},SY=()=>{const{translator:e,width:t,pageInfo:n,totalRowCount:r,visibilityThreshold:i}=uY(),{page:o,rowsPerPage:a}=n;if(t<=(i?.displayedRowsLabel||hY.DisplayedRowsLabel))return null;const s=e.get("NebulaTableUtils.Pagination.DisplayedRowsLabel",[`${o*a+1} - ${Math.min((o+1)*a,r)}`,r.toString()]);return lt.jsx(nY,{variant:"caption",dir:"ltr",children:s})},kY=({name:e,value:t,options:n,handleChange:r})=>{const{layout:i,footerStyle:o,translator:a,tabIndex:s,interactions:l}=uY(),c=i.qInfo.qId,u=a.get(`NebulaTableUtils.Pagination.${e}`),d=`${e}-dropdown`,p=`${d}-label-${c}`,f={tabIndex:s,id:`${d}-${c}`,"data-testid":d,"aria-labelledby":p};return lt.jsxs(lt.Fragment,{children:[lt.jsxs(nY,{variant:"caption",id:p,children:[u,":"]}),lt.jsx(eY,{footerStyle:o,size:"small",native:!0,value:t,onChange:r,inputProps:f,disabled:!l.active,children:n})]})},CY=()=>{const{pageInfo:e,isSelectionMode:t,totalColumnCount:n,width:r,handleChangeRowsPerPage:i,visibilityThreshold:o}=uY();if(!(!!e.rowsPerPageOptions?.length&&!t&&r>(o?.rowsPerPage||hY.RowsPerPage)&&n<=100)||void 0===e.rowsPerPageOptions)return null;const a=lt.jsx(lt.Fragment,{children:e.rowsPerPageOptions.map(e=>lt.jsx("option",{value:e,children:e},e))});return lt.jsx(kY,{name:"RowsPerPage",value:e.rowsPerPage,options:a,handleChange:e=>{i?.(+e.target.value)}})},EY=1e3,MY="…",RY=({totalPages:e,page:t})=>{const n=Math.min(e,EY),r=n<e&&t>500,i=r?Math.min(500+t,e):n,o=r?Math.max(0,i-EY):0,a=Array.from(Array(n).keys()).map(e=>{const t=e+o;return lt.jsx("option",{value:t,children:t+1},t)});return o>0&&a.unshift(lt.jsx("option",{value:MY,disabled:!0,children:MY},"startMoreOptions")),i<e-1&&a.push(lt.jsx("option",{value:MY,disabled:!0,children:MY},"endMoreOptions")),lt.jsx(lt.Fragment,{children:a})},_Y=()=>{const{pageInfo:e,width:t,totalPages:n,handleChangePage:r,visibilityThreshold:i}=uY(),{page:o}=e;if(t<=(i?.selectPage||hY.SelectPage))return null;const a=lt.jsx(RY,{totalPages:n,page:o});return lt.jsx(kY,{name:"SelectPage",value:o,options:a,handleChange:e=>{r(+e.target.value)}})},AY=e=>lt.jsxs(dY,{...e,children:[lt.jsx(CY,{}),lt.jsx(_Y,{}),lt.jsx(SY,{}),lt.jsx(mY,{}),lt.jsx(wY,{}),lt.jsx(xY,{}),lt.jsx(yY,{})]});var IY=Yt.memo(AY);const PY=e=>lt.jsx(rY,{...e,children:lt.jsx(IY,{...e})}),TY=(e,t,n)=>{const r=n.size,i=r>=t.size;if(r){e({keys:[i?"SNTable.SelectionLabel.SelectedValue":"SNTable.SelectionLabel.DeselectedValue",1===r?"SNTable.SelectionLabel.OneSelectedValue":["SNTable.SelectionLabel.SelectedValues",r.toString()]]})}else e({keys:["SNTable.SelectionLabel.ExitedSelectionMode"]})},DY=(e,t,n)=>{n&&t&&(t.classList.contains("selected")?e({keys:["SNTable.SelectionLabel.SelectedValue"]}):e({keys:["SNTable.SelectionLabel.NotSelectedValue"]}))},OY=e=>e.ctrlKey||e.metaKey,NY=e=>e.shiftKey&&OY(e),qY=e=>[Em.Left,Em.Right,Em.Up,Em.Down].includes(e),LY=e=>e.shiftKey&&qY(e.key),jY=e=>(e=>qY(e)||[Em.Home,Em.End,Em.PageUp,Em.PageDown].includes(e))(e.key)&&!NY(e),zY=(e,t)=>{const{api:n,rows:r,colIdx:i}=e,{cell:o,announce:a,evt:s}=t;let l=new Map;if(-1===i)n?.begin(["/qHyperCubeDef"]);else{if(i!==o.selectionColIdx)return e;l=new Map(r)}return l=((e,t,n)=>{const{qElemNumber:r,rowIdx:i}=t;return n.ctrlKey||n.metaKey?(new Map).set(r,i):(e.has(r)?e.delete(r):e.set(r,i),new Map(e))})(l,o,s),TY(a,r,l),l.size?(n?.select({method:"selectHyperCubeCells",params:["/qHyperCubeDef",Array.from(l.values()),[o.selectionColIdx]]}),{...e,rows:l,colIdx:o.selectionColIdx}):(n?.cancel(),{...e,rows:l,colIdx:-1})},FY=(e,t)=>{const{api:n,rows:r,colIdx:i,pageRows:o,firstCell:a}=e,{cell:s,announce:l,evt:c}=t;if(!(a||"key"in c&&LY(c)))return e;-1===i&&n?.begin(["/qHyperCubeDef"]);const u=((e,t,n,r,i)=>{if(!n.isSelectable)return t;const o=new Map(t);if("key"in r&&LY(r)){o.set(n.qElemNumber,n.rowIdx);const t=r.key===Em.Down?1:-1,i=e[n.pageRowIdx+t][n.pageColIdx];return i.isSelectable&&o.set(i.qElemNumber,n.rowIdx+t),o}if(!i)return t;const a=Math.min(i.pageRowIdx,n.pageRowIdx),s=Math.max(i.pageRowIdx,n.pageRowIdx);for(let t=a;t<=s;t++){const n=e[t][i.pageColIdx];n.isSelectable&&o.set(n.qElemNumber,n.rowIdx)}return o})(o,r,s,c,a);return TY(l,r,u),{...e,rows:u,colIdx:a?.selectionColIdx??s.selectionColIdx,isSelectMultiValues:!0}},$Y=e=>{const{api:t,rows:n,colIdx:r,isSelectMultiValues:i,mouseupOutsideCallback:o}=e;return o&&document.removeEventListener("mouseup",o),i&&t?.select({method:"selectHyperCubeCells",params:["/qHyperCubeDef",Array.from(n.values()),[r]]}),{...e,isSelectMultiValues:!1,firstCell:void 0,mouseupOutsideCallback:void 0}},BY=(e,t)=>{switch(t.type){case KB.Select:return zY(e,t.payload);case KB.SelectMouseDown:return((e,{cell:t,mouseupOutsideCallback:n})=>!n||-1!==e.colIdx&&e.colIdx!==t.selectionColIdx?e:(document.addEventListener("mouseup",n),{...e,firstCell:t,mouseupOutsideCallback:n}))(e,t.payload);case KB.SelectMouseUp:return((e,t)=>$Y(e.isSelectMultiValues||e.firstCell!==t.cell?e:zY(e,t)))(e,t.payload);case KB.SelectMultiAdd:return FY(e,t.payload);case KB.SelectMultiEnd:return $Y(e);case KB.Reset:return e.api?.isModal()?e:{...e,rows:new Map,colIdx:-1};case KB.Clear:return e.rows.size?{...e,rows:new Map}:e;case KB.UpdatePageRows:return{...e,pageRows:t.payload.pageRows};default:throw new Error("reducer called with invalid action type")}},HY=gg(e=>{const t=e(oy);return function(e,t){return gg(e,function(e,n,r){n(this,t(e(this),r))})}({pageRows:e(cU).rows,rows:new Map,colIdx:-1,api:t,isSelectMultiValues:!1},BY)}),VY=gg(e=>e(e(HY)),(e,t,n)=>{t(e(HY),n)}),WY=KR(e=>gg(t=>{const{colIdx:n,rows:r,api:i}=t(VY);return"object"==typeof e&&i?.isModal()?n!==e.selectionColIdx?YB.Disabled:r.has(e.qElemNumber)?YB.Selected:YB.Possible:YB.Inactive}),(e,t)=>"object"!=typeof e||"object"!=typeof t?e===t:e.qElemNumber===t.qElemNumber&&e.selectionColIdx===t.selectionColIdx),UY=gg(e=>{const t=e(zU),n=e(Ry).width,r=e(pV);return t>0&&t+r<n}),GY=()=>{const[e,t]=Yt.useState(!1);return ej({onDragStart:()=>{t(!0)},onDragEnd:()=>{t(!1)}}),e?lt.jsx("div",{style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:100}}):null},YY=(e,{atTop:t,atBottom:n},r)=>({borderLeftColor:e.grid.border,borderRightColor:e.grid.border,borderTopColor:!r&&n?e.grid.divider:e.grid.border,borderBottomColor:r&&!t||!r&&t?e.grid.divider:e.grid.border}),KY=gg(e=>{const t=e(Jg),n=e(ky);if(void 0!==n)return async(e,r)=>{const{isDim:i,colIdx:o,qReverseSort:a,sortDirection:s,isActivelySorted:l}=e,c=i?o:o-t,u=await n.getEffectiveProperties(),{qInterColumnSortOrder:d}=u.qHyperCubeDef,p=[],f=r!==s||l;if(!i){const e=u.qHyperCubeDef.qMeasures.at(c)?.qSortBy;void 0===e?.qSortByNumeric&&p.push({qPath:`/qHyperCubeDef/qMeasures/${c}/qSortBy`,qOp:"Replace",qValue:JSON.stringify({...e,qSortByNumeric:"A"===s?1:-1})})}if(!l){const e=[o,...d.filter(e=>e!==o)];p.push({qPath:"/qHyperCubeDef/qInterColumnSortOrder",qOp:"Replace",qValue:`[${e.join(",")}]`})}f&&p.push({qPath:`/qHyperCubeDef/${i?"qDimensions":"qMeasures"}/${c}/qDef/qReverseSort`,qOp:"Replace",qValue:(!a).toString()}),n.applyPatches(p,!0)}}),XY=e=>{e&&(e.focus(),(e=>{e?.setAttribute("tabIndex","0")})(e))},JY=({colIdx:e,rowIdx:t,firstColIdx:n,lastColIdx:r})=>(e>n?e--:t>n&&(t--,e=r),[t,e]),QY=({colIdx:e,rowIdx:t,firstColIdx:n,lastColIdx:r,lastRowIdx:i})=>(e<r?e++:t<i&&(t++,e=n),[t,e]),ZY=e=>e.atTop?2:1,eK=(e,t)=>({top:e?ZY(t):0,bottom:e&&t.atBottom?1:0}),tK=(e,t)=>e.getElementsByClassName("sn-table-row")[t[0]]?.getElementsByClassName("sn-table-cell")[t[1]],nK=e=>e?.setAttribute("tabIndex","0"),rK=e=>e?.setAttribute("tabIndex","-1"),iK=e=>{e.querySelectorAll("td[tabindex='0'], th[tabindex='0']").forEach(rK)},oK=e=>{e?.focus(),nK(e)},aK=e=>{setTimeout(()=>{const t=e.current?.closest(".sn-table-cell")?.querySelector(`.${Mm}`);oK(t)},0)},sK=({evt:e,rootElement:t,cellCoord:n,setFocusedCellCoord:r,allowedRows:i,direction:o})=>{iK(t);const a=((e,t,n,r,i={top:0,bottom:0})=>{const o=i.top>0,a=i.top,s=t.getElementsByClassName("sn-table-row").length-1-i.bottom,l=t.getElementsByClassName("sn-table-head-cell").length-1;let[c,u]=n;switch(e.key){case Em.Down:c<s&&c++;break;case Em.Up:c>a&&c--;break;case Em.Right:if(o)break;[c,u]="rtl"===r?JY({colIdx:u,rowIdx:c,lastColIdx:l,firstColIdx:0}):QY({colIdx:u,rowIdx:c,lastColIdx:l,lastRowIdx:s,firstColIdx:0});break;case Em.Left:if(o)break;[c,u]="rtl"===r?QY({colIdx:u,rowIdx:c,lastColIdx:l,lastRowIdx:s,firstColIdx:0}):JY({colIdx:u,rowIdx:c,lastColIdx:l,firstColIdx:0});break;case Em.Home:(OY(e)||o)&&(c=a),o||(u=0);break;case Em.End:(OY(e)||o)&&(c=s),o||(u=l);break;case Em.PageDown:c=Math.min(s,c+10);break;case Em.PageUp:c=Math.max(a,c-10)}return[c,u]})(e,t,n,o,i),s=tK(t,a);return oK(s),((e,t)=>{const n=t.getElementsByClassName("sn-table-container")[0];if(!n?.scrollTo)return;const[r,i]=e;if(r<2)n.scrollTo({top:0,behavior:"auto"});else{const e=t.getElementsByClassName("sn-table-head-cell")[0],o=t.getElementsByClassName("sn-table-row")[r].getElementsByClassName("sn-table-cell")[i];if(!o||!e)return;if(o.offsetTop-e.offsetHeight<n.scrollTop){const t=n.scrollTop-o.offsetHeight-e.offsetHeight;n.scrollTo({top:Math.max(0,t),behavior:"auto"})}}})(a,t),r(a),{nextCell:s,nextCellCoord:a}},lK=(e,t,n,r)=>{iK(t),n(e),r.enabled&&!r.active?r.focus?.():oK(tK(t,e))},cK=(e,t,n)=>{const r=e.currentTarget;if(!r)return;const i=e.relatedTarget??document.activeElement;if(!!i?.closest(`.${Sm}`))return;const o=!!i&&r.contains(i);!n.enabled||t.current||o||(e=>{const t=e.querySelector(`.${JB.First}`),n=e.querySelector(`.${JB.Second}`);t&&n&&(t.innerHTML="",n.innerHTML="")})(r),((e,t,n)=>{const r=e.currentTarget;if(!n.enabled||t.current||!r)return;const i=e.relatedTarget??document.activeElement;i&&r.contains(i)||n.blur?.(!1)})(e,t,n)},uK=(e,t)=>lt.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:lt.jsx("path",{d:"M8 10a1 1 0 0 1 .5 1.866v.634a.5.5 0 0 1-1 0v-.634A1 1 0 0 1 8 10M3.625 7.035A2 2 0 0 0 2 9v5a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V9a2 2 0 0 0-1.625-1.965V5.383a4.375 4.375 0 0 0-8.75 0zM3 9a1 1 0 0 1 .931-.998h8.138A1 1 0 0 1 13 9v5a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1zm8.375-3.617V7h-6.75V5.383a3.375 3.375 0 0 1 6.75 0"})}),dK=Yt.forwardRef(uK),pK=Ul(mh,{shouldForwardProp:e=>"headerStyle"!==e&&"interactions"!==e&&"hoverBackground"!==e&&"background"!==e&&"color"!==e})(({headerStyle:e,interactions:t,hoverBackground:n,background:r,color:i})=>({...XH,...e,cursor:t.active?"pointer":"default",background:r,color:i,verticalAlign:"bottom",boxSizing:"border-box","&&:focus-visible, &&:hover:not(:has(button:hover))":{background:t.active?n:r}})),fK=Ul("span",{shouldForwardProp:e=>"align"!==e&&"dir"!==e})(({align:e,dir:t})=>({minWidth:GH,display:"flex",paddingBottom:"2px",alignSelf:"end",..."right"===e||"rtl"===t&&"center"===e?{paddingRight:"8px"}:{paddingLeft:"8px"}})),hK=parseInt(GH,10)/2,mK=Ul("div")({position:"absolute",bottom:-hK,left:`calc(50% - ${hK}px)`}),gK=Ul(Ph)({position:"sticky",top:0,zIndex:1}),yK={lineHeight:"calc(4/3)",fontSize:"inherit",textOverflow:"ellipsis",overflow:"hidden"},bK=Ul(Xu)({height:"100%","& .sn-table-cell:focus-visible":{outline:"none",boxShadow:"0 0 0 2px #177fe6 inset, 0 0 0 3px #fff inset"},"& .sn-table-cell:focus:not(:focus-visible)":{outline:"none"}}),vK=Ul("span",{shouldForwardProp:e=>"lineClamp"!==e&&"isHeadCell"!==e&&"isPagination"!==e&&"isNumeric"!==e&&"isDual"!==e})(({lineClamp:e,isHeadCell:t=!1,isPagination:n=!1,isNumeric:r=!1,isDual:i=!1})=>r&&!i||1===e&&!t?{...yK,whiteSpace:"nowrap",display:n?"block":void 0}:{...yK,wordBreak:"break-word",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical",whiteSpace:"pre-line"}),xK=Ul("div",{shouldForwardProp:e=>"indentation"!==e&&"isFlex"!==e&&"justifyContent"!==e})(({indentation:e,isFlex:t,justifyContent:n})=>({width:"100%",height:"100%",boxSizing:"border-box",minWidth:0,paddingInlineStart:`min(${e}, 50%)`,...t&&{display:"flex",justifyContent:n,alignItems:"inherit"}})),wK=Ul("div")({display:"grid",gridAutoFlow:"column",width:"100%",gridAutoColumns:"1fr auto",gap:"4px"}),SK="cell-text",kK=({children:e,forwardRef:t,isNumeric:n=!1,isPagination:r=!1,isHeadCell:i=!1,isDual:o=!1,lineClamp:a})=>{const s=_g(MU);return i?lt.jsx(vK,{"data-testid":SK,ref:t,className:"sn-table-cell-text",lineClamp:s.grid.headerLineClamp,isPagination:r,isHeadCell:!0,style:{direction:n?"ltr":void 0},children:e}):lt.jsx(vK,{"data-testid":SK,ref:t,className:"sn-table-cell-text",isDual:o,isNumeric:n,lineClamp:a??s.grid.contentLineClamp,isPagination:r,style:{direction:n?"ltr":void 0},children:e})},CK=e=>{const{column:t,isInteractionEnabled:n,open:r,setOpen:i,isPagination:o,forwardRef:a}=e,s=_g(Zg),l=_g(KY),c=_g(my),u=_g(sy),d=_g(Dg),p=_g(Ty),f=_g(Pg),h=_g(qU)[t.pageColIdx],m=_g(Sy),g=Yt.useRef(null),y=Yt.useRef(null),b=(({column:e,columnWidth:t})=>{const n=_g(MU),{measureText:r}=um({fontSize:n.header.fontSize,fontFamily:n.header.fontFamily,fontWeight:YH});let i=!1,o=!1,a=!1;const s=e.isLocked,l=e.isActivelySorted,c=t-25,u=s?20:0,d=l?20:0;let p=r(e.label);return s&&p+u<=c&&(a=!0,p+=u,l&&p+d<=c&&(o=!0,p+=d)),!s&&l&&p+d<=c&&(o=!0,p+=d),p+24<=c&&(i=!0),{shouldShowMenuIcon:i,shouldShowSortIcon:o,shouldShowLockIcon:a}})({column:t,columnWidth:h}),{StartIcon:v,EndIcon:x,LockIcon:w}=(({sortDirection:e,headTextAlign:t},{shouldShowSortIcon:n,shouldShowLockIcon:r},i)=>{const o="A"===e?lt.jsx(kG,{height:GH,"data-testid":"head-cell-sort-ascending-icon"}):lt.jsx(AG,{height:GH,"data-testid":"head-cell-sort-descending-icon"}),a=n?lt.jsx(fK,{align:t,dir:i,children:o}):void 0,s=r?lt.jsx(sV,{rightAligned:"right"===t,className:"sn-table-lock-icon",children:lt.jsx(dK,{height:GH,"data-testid":"head-cell-lock-icon"})}):void 0;return"right"===t?{StartIcon:a,LockIcon:s}:{EndIcon:a,LockIcon:s}})(t,b,c);return lt.jsxs(aV,{shouldShowMenuIcon:b.shouldShowMenuIcon,shouldShowLockIcon:b.shouldShowLockIcon,alignment:ZH(t,o,c),children:[w,lt.jsxs(oV,{className:"sn-table-head-label",textAlign:t.headTextAlign,direction:c,isPagination:o,children:[v,lt.jsx(kK,{forwardRef:a,isPagination:o,isHeadCell:!0,children:t.label}),x]}),n?lt.jsxs(lt.Fragment,{children:[lt.jsx(JG,{headerData:{...t,dimensionInfoIndex:t.colIdx},translator:p,anchorRef:g,menuAvailabilityFlags:{[YG.Sorting]:!0,[YG.Searching]:!0,[YG.Selections]:!0,[YG.AdjusterHeaderSize]:!0},open:r,setOpen:i,interactions:u,sortRelatedArgs:{sortFromMenu:(e,n)=>(e.stopPropagation(),l?.(t,n)??Promise.resolve())},searchRelatedArgs:{embed:d,listboxRef:y},selectionRelatedArgs:{app:f,qStateName:s},adjustHeaderSizeRelatedArgs:{focusColumnAdjuster:aK},shouldShowMenuIcon:b.shouldShowMenuIcon,model:m,direction:c,isPagination:o,isAccessibleHeader:!0}),lt.jsx(iV,{ref:y,direction:c,isPagination:o}),lt.jsx(iV,{ref:g,direction:c})]}):null]})},EK=(e,t)=>lt.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:lt.jsx("path",{d:"M6 2h10V1H6zm5 5h5V6h-5zm5 5h-5v-1h5zM5 10h1v2.663a3.5 3.5 0 1 0-2.922.036l-.406.914A4.501 4.501 0 1 1 7.329 13H9v1H5z"})}),MK=Yt.forwardRef(EK),RK=(e,t)=>e.isCyclic&&t,_K=({column:e})=>{const t=_g(MU),n=_g(my),r=_g(Sy),i=Kt.useRef(null),[o,a]=Kt.useState(!1),s=YU({model:r,headerData:{...e,dimensionInfoIndex:e.colIdx}});return lt.jsxs(lt.Fragment,{children:[lt.jsx(cV,{hoverBackground:e.headerColor?.headerMenuHoverBackground??t.headerMenuHoverBackground,activeBackground:e.headerColor?.headerMenuActiveBackground??t.headerMenuActiveBackground,isActive:o,tabIndex:-1,onClick:e=>{e.stopPropagation(),a(!0)},children:lt.jsx(MK,{ref:i,height:16,"data-testid":"head-cell-cyclic-icon"})}),lt.jsx(gG,{open:o,onClose:()=>{a(!1)},menuGroups:[[{items:e.groupDimensionLabels.map((t,n)=>({id:n+1,itemTitle:t,onClick:e=>{e.stopPropagation(),a(!1),s?.(n)},enabled:!0,icon:yF,isActive:e.groupDimensionPos===n}))}]],anchorEl:i.current,direction:n,isPagination:!1})]})},AK=e=>e.isLocked,IK=({column:e})=>{const t=_g(Pg),n=_g(Zg),r=_g(Ug),i=_g(MU);return lt.jsx(cV,{tabIndex:-1,hoverBackground:e.headerColor?.headerMenuHoverBackground??i.headerMenuHoverBackground,onClick:i=>{i.stopPropagation(),(async(e,t,n,r={warn:()=>{},error:()=>{}})=>{const i=bG(t??"$",n);let o;try{const t=await(e?.createSessionObject(i));o=t?.id,await(t?.unlock("/qListObjectDef"))}catch(e){r.error({msg:"Failed to unlock field from table header",payload:e})}finally{o&&(await(e?.destroySessionObject(o))||r.error({msg:"Failed to destroy session object when unlocking field from table header"}))}})(t,n,e,r)},children:lt.jsx(dK,{height:16,"data-testid":"head-cell-lock-icon"})})},PK=({column:e,menuIconRef:t,open:n,setOpen:r})=>{const i=_g(MU);return lt.jsx(cV,{tabIndex:-1,hoverBackground:e.headerColor?.headerMenuHoverBackground??i.headerMenuHoverBackground,activeBackground:e.headerColor?.headerMenuActiveBackground??i.headerMenuActiveBackground,isActive:n,order:e.isDim?void 0:-1,onClick:e=>{e.stopPropagation(),r(e=>!e)},ref:t,children:lt.jsx(GU,{height:16})})},TK=({anchorRef:e,column:t,isPagination:n,listboxRef:r,open:i,setOpen:o})=>{const a=_g(Pg),s=_g(my),l=_g(Dg),c=_g(sy),u=_g(Sy),d=_g(Zg),p=_g(Ty),f=_g(KY);return lt.jsx(JG,{headerData:{...t,dimensionInfoIndex:t.colIdx},translator:p,anchorRef:e,menuAvailabilityFlags:{[YG.Sorting]:!0,[YG.Searching]:!0,[YG.Selections]:!0,[YG.AdjusterHeaderSize]:!0},open:i,setOpen:o,interactions:c,sortRelatedArgs:{sortFromMenu:(e,n)=>(e.stopPropagation(),f?.(t,n)??Promise.resolve())},searchRelatedArgs:{embed:l,listboxRef:r},selectionRelatedArgs:{app:a,qStateName:d},adjustHeaderSizeRelatedArgs:{focusColumnAdjuster:aK},shouldShowMenuIcon:!1,model:u,direction:s,isPagination:n})},DK=gg();DK.onMount=e=>{const t=new Map,n=new ResizeObserver(e=>{for(const n of e){const e=t.get(n.target);e&&e.current(n)}});return e({callbacks:t,observer:n}),()=>{t.clear(),n.disconnect()}};const OK=({ref:e,callback:t})=>{const n=_g(DK),r=Yt.useRef(t);r.current=t,Yt.useLayoutEffect(()=>{const t=e.current;return void 0===n?()=>{}:(t&&(n.callbacks.set(t,r),n.observer.observe(t)),()=>{t&&(n.callbacks.delete(t),n.observer.unobserve(t))})},[e,r,n])},NK=Ul(Xu)({display:"flex",alignItems:"flex-end",justifyContent:"center",width:"100%",boxSizing:"border-box"}),qK=({children:e})=>{const t=Kt.useRef(null),[n,r]=Yt.useState(()=>new Set(e.filter(({props:e})=>void 0!==e.prio&&e.children).map(({key:e})=>e))),i=Yt.useMemo(()=>Array.from(e).sort((e,t)=>(e.props.prio??-1/0)-(t.props.prio??-1/0)),[e]),o=Yt.useCallback(e=>{const t=new Set,n=e.contentBoxSize.at(0)?.inlineSize??0;let o=0;i.forEach(e=>{if(e.props.ignore||!e.props.children)return;const r=e.props.minWidth+1;void 0===e.props.prio||o+r<=n?o+=r:t.add(e.key)}),r(e=>e.size===t.size&&[...e].every(e=>t.has(e))?e:t)},[i]);return OK({ref:t,callback:o}),lt.jsx(NK,{ref:t,"data-testid":"responsive-container",children:e.filter(e=>!n.has(e.key))})},LK=({children:e})=>e,jK=(e,t)=>!e.isLocked&&e.isDim&&t,zK=({column:e,open:t,setOpen:n})=>{const r=_g(MU),i=_g(Zg),o=_g(my),a=_g(Dg);_g(Pg);const s=Kt.useRef(null),l=Yt.useCallback(()=>{n(!1)},[n]),c=yG({qLibraryId:e.qLibraryId,fieldId:e.fieldId,searchRelatedArgs:{embed:a,listboxRef:s},selectionRelatedArgs:{qStateName:i},direction:o,onPopoverClose:l});return lt.jsx(cV,{tabIndex:-1,hoverBackground:e.headerColor?.headerMenuHoverBackground??r.headerMenuHoverBackground,activeBackground:e.headerColor?.headerMenuActiveBackground??r.headerMenuActiveBackground,isActive:t,onClick:e=>{e.stopPropagation(),c(),n(!0)},children:lt.jsx(LG,{ref:s,height:16,"data-testid":"head-cell-search-icon"})})},FK=({column:e})=>{const{sortDirection:t,isActivelySorted:n}=e,r="A"===t?lt.jsx($H,{height:GH,"data-testid":"head-cell-sort-ascending-icon"}):lt.jsx(NH,{height:GH,"data-testid":"head-cell-sort-descending-icon"});return n?lt.jsx(mK,{children:r}):void 0},$K=0,BK=1,HK=2,VK=3,WK=e=>{const{column:t,open:n,setOpen:r,isPagination:i,forwardRef:o,columnWidth:a,isInteractionEnabled:s}=e,l=_g(MU),c=_g(my),{measureText:u}=um(l.header),[d,p]=Yt.useState(!1),f=Yt.useRef(null),h=Yt.useRef(null),m=Yt.useRef(null),g="number"==typeof a&&a>Rm.PixelsMin+18;return lt.jsxs(lt.Fragment,{children:[lt.jsxs(qK,{children:[lt.jsx(LK,{prio:HK,minWidth:rV,children:AK(t)?lt.jsx(IK,{column:t}):null},"Lock"),lt.jsx(LK,{prio:BK,minWidth:rV,children:RK(t,s)?lt.jsx(_K,{column:t}):null},"Cyclic"),lt.jsx(LK,{ignore:!0,children:lt.jsx(FK,{column:t})},"Sort"),lt.jsx(LK,{minWidth:u(t.label)+8,children:lt.jsx(lV,{justifyContent:t.headTextAlign,children:lt.jsx(kK,{forwardRef:o,isPagination:i,isHeadCell:!0,children:t.label})})},"Text"),lt.jsx(LK,{prio:g?void 0:$K,minWidth:rV,children:d||jK(t,s)?lt.jsx(zK,{open:d,setOpen:p,column:t}):null},"Search"),lt.jsx(LK,{prio:VK,minWidth:rV,children:s?lt.jsx(PK,{menuIconRef:m,column:t,open:n,setOpen:r}):null},"Menu")]}),s?lt.jsxs(lt.Fragment,{children:[lt.jsx(iV,{ref:h,direction:c,isPagination:i}),lt.jsx(iV,{ref:f,direction:c}),lt.jsx(TK,{anchorRef:m.current?m:f,column:t,isPagination:i,listboxRef:h,open:n,setOpen:r})]}):null]})},UK=Ul("div",{shouldForwardProp:e=>"background"!==e&&"applicableStyle"!==e&&"color"!==e})(({background:e,applicableStyle:t,color:n})=>({...t,background:e,color:n})),GK=()=>{},YK=({column:e,isPagination:t})=>{const n=_g(MU),r=_g(my),i=_g(UY),o=_g(uU),a=!1,s=_g(ny)?CK:WK;return lt.jsx(UK,{className:"sn-table-cell",applicableStyle:{...n.header,...YY(n,o,!0)},style:{cursor:"pointer",display:"flex",alignItems:"flex-end",borderStyle:"solid",borderRightWidth:tV(r,a,i),borderLeftWidth:nV(r,a,i),borderTopWidth:"0px",borderBottomWidth:"1px",padding:"4px",justifyContent:e.headTextAlign,boxSizing:"border-box",flexDirection:"right"===e.headTextAlign?"row-reverse":"row",userSelect:"none",width:"100%"},background:e.headerColor?.background??n.header.background,color:e.headerColor?.color??n.header.color,children:lt.jsx(s,{column:e,isInteractionEnabled:!1,isPagination:t,open:!1,setOpen:GK})})},KK=({isPagination:e})=>{const t=_g(dU),[n,r]=Yt.useState();ej({onDragStart:e=>{const t=e.operation.source?.id;r(t)},onDragEnd:()=>{}});const i=n?t.find(e=>e.id===n):void 0;return i?lt.jsx(PL,{children:lt.jsx("div",{style:{background:"white",height:"100%",display:"flex",position:"relative"},children:lt.jsx(YK,{column:i,isPagination:e})})}):null},XK=gg(async e=>{e(Yg);const t=e(ky),n=await(t?.getEffectiveProperties());return n&&structuredClone(n)}),JK=_E(XK,e=>e),QK=gg(e=>e(JK)?.qHyperCubeDef),ZK=[Lq.configure({activationConstraints:[new Dq.Distance({value:5})],preventActivation:e=>{const t=e.target;return t instanceof HTMLElement&&t.classList.contains("nebula-table-utils-column-adjuster")}})],eX=iL.plugins.filter(e=>e!==oN),tX=(e,t,n)=>{const r=JSON.stringify(t),i=JSON.stringify(n);if(r!==i)return{qPath:e,qOp:"Replace",qValue:i}},nX=(e,t,n,r,i)=>{if(!e||!t||r===i)return;const o=(({qDimensions:e,qMeasures:t,qInterColumnSortOrder:n,visibleColumnIds:r,sourceId:i,targetId:o})=>{const a=UF({qDimensions:e,qMeasures:t}),s=[...e,...t],l=r.findIndex(e=>e===i),c=r.findIndex(e=>e===o);if(l<0||c<0||l===c)return;const u=((e,t,n)=>{const r=[...e],[i]=r.splice(t,1);return r.splice(n,0,i),r})(r,l,c),d=new Map(u.map((e,t)=>[e,t])),p=a.toSorted((e,t)=>{const n=d.get(e.id),r=d.get(t.id);return void 0===n||void 0===r?0:n-r}),f=p.filter(e=>e.isDimension).map(e=>e.def),h=p.filter(e=>!e.isDimension).map(e=>e.def),m=[...f,...h],g=new Map(m.map((e,t)=>[e.qDef.cId,t]));return{qDimensions:f,qMeasures:h,qInterColumnSortOrder:GF({previousColumns:s,nextColumns:m,qInterColumnSortOrder:n}),qColumnOrder:u.map(e=>g.get(e)).filter(e=>void 0!==e)}})({qDimensions:t.qDimensions,qMeasures:t.qMeasures,qInterColumnSortOrder:t.qInterColumnSortOrder,visibleColumnIds:n.map(e=>e.id),sourceId:r,targetId:i});if(!o)return;const a=[tX("/qHyperCubeDef/qDimensions",t.qDimensions,o.qDimensions),tX("/qHyperCubeDef/qMeasures",t.qMeasures,o.qMeasures),tX("/qHyperCubeDef/qInterColumnSortOrder",t.qInterColumnSortOrder,o.qInterColumnSortOrder),tX("/qHyperCubeDef/qColumnOrder",t.qColumnOrder,o.qColumnOrder)].filter(e=>void 0!==e);0!==a.length&&e.applyPatches(a,!0)},rX=({children:e})=>{const t=_g(ky),n=_g(QK),r=_g(dU);return lt.jsx(_L,{onDragOver:e=>{const i=e.operation.source?.id,o=e.operation.target?.id;void 0!==o&&i!==o&&nX(t,n,r,i,o)},sensors:ZK,plugins:eX,children:e})};function iX(e,t){const n=Yt.useRef(!1);Yt.useEffect(()=>{n.current?e():n.current=!0},t)}const oX=(e,t)=>{const n=_g(wy);Yt.useEffect(()=>{const r=e.current;if(!r)return;const i=e=>{cK(e,t,n)};return r.addEventListener("focusout",i),()=>{r.removeEventListener("focusout",i)}},[e,t,n])},aX=gg(QB),sX=KR(e=>gg(t=>{const[n,r]=t(aX);return 0===n&&r===e})),lX=()=>{const e=_g(Tg);Yt.useEffect(()=>{e.notifyIsDoneRendering()})};var cX={SNTable_Accessibility_Ascending:{id:"SNTable.Accessibility.Ascending",locale:{"de-DE":"Aufsteigend","en-US":"Ascending","es-ES":"Ascendente","fr-FR":"Croissant","it-IT":"Crescente","ja-JP":"昇順","ko-KR":"오름차순","nl-NL":"Oplopend","pl-PL":"Rosnąco","pt-BR":"Crescente","ru-RU":"По возрастанию","sv-SE":"Stigande","tr-TR":"Artan","zh-CN":"升序","zh-TW":"遞增"}},SNTable_Accessibility_ColumnOptions:{id:"SNTable.Accessibility.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":"欄選項"}},SNTable_Accessibility_Descending:{id:"SNTable.Accessibility.Descending",locale:{"de-DE":"Absteigend","en-US":"Descending","es-ES":"Descendente","fr-FR":"Décroissant","it-IT":"Decrescente","ja-JP":"降順","ko-KR":"내림차순","nl-NL":"Aflopend","pl-PL":"Malejąco","pt-BR":"Decrescente","ru-RU":"По убыванию","sv-SE":"Fallande","tr-TR":"Azalan","zh-CN":"降序","zh-TW":"遞減"}},SNTable_Accessibility_NavigationInstructions:{id:"SNTable.Accessibility.NavigationInstructions",locale:{"de-DE":"Verwenden Sie die Pfeiltasten, um zwischen den Tabellenzellen zu navigieren, und die Tabulatortaste, um zu den Paginierungssteuerelementen zu wechseln. Drücken Sie die Leertaste in den Kopfzellen, um das Spaltenmenü zu öffnen, und drücken Sie die Leertaste in den Körperzellen, um eine Auswahl zu treffen. Duch die Auswahl wird der Seiteninhalt aktualisiert. Die vollständige Liste der Navigationssteuerungen finden Sie in der Dokumentation.","en-US":"Use arrow keys to navigate between table cells and tab to move to pagination controls. Press space on header cells to open the column menu, press space on body cells to make selections. Selections will cause content on the page to be updated. The full list of navigation controls can be found in the documentation.","es-ES":"Utilice las teclas de flecha para desplazarse entre las celdas de la tabla y la pestaña a fin de pasar a los controles de paginación. Pulse la barra espaciadora en las celdas del encabezado para abrir el menú de columnas; pulse la barra espaciadora en las celdas del cuerpo para realizar selecciones. Las selecciones harán que se actualice el contenido de la página. Encontrará la lista completa de controles de navegación en la documentación.","fr-FR":"Utilisez les touches fléchées pour naviguer parmi les cellules du tableau et la tabulation pour accéder aux commandes de pagination. Appuyez sur la touche Espace dans les cellules d'en-tête pour ouvrir le menu de la colonne. Appuyez sur Espace dans les cellules de corps pour effectuer une sélection. Les sélections actualiseront le contenu de la page. Vous pouvez consulter la liste complète des commandes de navigation dans la documentation.","it-IT":"Utilizzare i tasti freccia per navigare tra le celle della tabella e il tasto TAB per passare ai controlli di paginazione. Premere lo spazio nelle celle dell'intestazione per aprire il menu della colonna; premere lo spazio nelle celle del corpo per effettuare selezioni. Le selezioni determineranno l'aggiornamento del contenuto della pagina. È possibile trovare l'elenco completo dei controlli di navigazione nella documentazione.","ja-JP":"矢印キーで表のセル間を移動し、タブ キーでページネーション コントロールに移動します。ヘッダー セルでスペースを押すと列メニューが開き、ボディ セルでスペースを押すと選択ができます。選択によって、ページのコンテンツが更新されます。ナビゲーション コントロールの全リストは、ドキュメントをご覧ください。","ko-KR":"화살표 키를 사용하여 표 셀 사이를 탐색하고, 탭을 사용하여 페이지 번호 컨트롤로 이동하십시오. 헤더 셀에서 스페이스바를 눌러 열 메뉴를 열고, 본문 셀에서 스페이스바를 눌러 선택하십시오. 선택하면 페이지의 콘텐츠가 업데이트됩니다. 전체 탐색 컨트롤 목록은 설명서에서 확인할 수 있습니다.","nl-NL":"Gebruik de pijltjestoetsen om te navigeren tussen tabelcellen en de Tab-toets om naar besturingselementen voor paginering te gaan. Druk op de spatietoets in koptekstcellen om het kolommenu te openen, druk op de spatietoets in hoofdtekstcellen om selecties te maken. Door selecties te maken, wordt de inhoud op de pagina bijgewerkt. De volledige lijst met besturingselementen voor navigatie vindt u in de documentatie.","pl-PL":"Użyj klawiszy strzałek do poruszania się między komórkami tabeli oraz tabulatora do poruszania się po elementach sterujących stronami. Naciśnij klawisz spacji na komórkach nagłówka, aby otworzyć menu kolumny i naciśnij go na komórkach treści, aby dokonać wyborów. Wybory będą powodować aktualizację zawartości na stronie. Pełną listę nawigacyjnych elementów sterujących można znaleźć w dokumentacji.","pt-BR":"Use as teclas de seta para navegar entre as células da tabela e a tecla Tab para mover para os controles de paginação. Pressione espaço nas células do cabeçalho para abrir o menu da coluna, pressione espaço nas células do corpo para fazer seleções. As seleções farão com que o conteúdo da página seja atualizado. A lista completa de controles de navegação pode ser encontrada na documentação.","ru-RU":"Используйте клавиши со стрелками для перемещения между ячейками таблицы и клавишу табуляции для перехода к элементам управления разбивки на страницы. Нажмите пробел на ячейках заголовка, чтобы открыть меню столбца; нажмите пробел на ячейках тела, чтобы сделать выборки. Выборки приведут к обновлению содержимого страницы. Полный перечень элементов управления навигацией см. в документации.","sv-SE":"Använd piltangenterna för att navigera mellan tabellcellerna och tabbtangenten för att flytta till pagineringskontrollerna. Tryck på mellanslag på rubrikceller för att öppna kolumnmenyn och tryck på mellanslag på innehållsceller för att göra urval. Med urval kommer innehåll på sidan att uppdateras. Den fullständiga listan med navigeringsreglage.","tr-TR":"Tablo hücreleri arasında gezinmek için ok tuşlarını, sayfalandırma kontrollerine geçmek için sekmeyi kullanın. Sütun menüsünü açmak için başlık hücrelerinde boşluğa basın, seçim yapmak için gövde hücrelerinde boşluğa basın. Seçimler, sayfadaki içeriğin güncellenmesine neden olur. Navigasyon kontrollerinin tam listesi belgede bulunabilir.","zh-CN":"使用箭头键在表格单元格之间导航,使用 tab 键移动到分页控件。按标题单元格上的空间打开列菜单,按正文单元格上的空间进行选择。选择将导致页面上的内容更新。导航控件的完整列表可以在文档中找到。","zh-TW":"使用方向鍵以在表格儲存格之間導覽,並使用 Tab 以前往分頁控制。按下標頭儲存格的空白處可開啟欄功能表,按下正文儲存格的空白處可進行選取。選項將會造成更新頁面上的內容。導覽控制的完整清單可見於文件中。"}},SNTable_Accessibility_RowsAndColumns:{id:"SNTable.Accessibility.RowsAndColumns",locale:{"de-DE":"Es werden {0} Zeilen und {1} Spalten angezeigt.","en-US":"Showing {0} rows and {1} columns.","es-ES":"Mostrando {0} filas y {1} columnas.","fr-FR":"Affichage de {0} lignes et de {1} colonnes.","it-IT":"Visualizzazione di {0} righe e {1} colonne.","ja-JP":"{0} 行 {1} 列を表示しています。","ko-KR":"{0}개의 행과 {1}개의 열을 표시합니다.","nl-NL":"{0} rijen en {1} kolommen worden getoond.","pl-PL":"Wyświetlane wiersze: {0} i kolumny: {1}.","pt-BR":"Mostrando {0} linhas e {1} colunas.","ru-RU":"Показаны строки ({0}) и столбцы ({1}).","sv-SE":"Visar {0} rader och {1} kolumner.","tr-TR":"{0} satır ve {1} sütun gösteriliyor.","zh-CN":"正在显示 {0} 行,{1} 列。","zh-TW":"顯示 {0} 列和 {1} 欄。"}},SNTable_MenuItem_AdjustColumnSize:{id:"SNTable.MenuItem.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":"調整欄大小"}},SNTable_MenuItem_ClearSelections:{id:"SNTable.MenuItem.ClearSelections",locale:{"de-DE":"Auswahl 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":"Selecties 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":"清除選項"}},SNTable_MenuItem_Search:{id:"SNTable.MenuItem.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":"搜尋"}},SNTable_MenuItem_SelectAll:{id:"SNTable.MenuItem.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":"全選"}},SNTable_MenuItem_SelectAlternative:{id:"SNTable.MenuItem.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":"選取替代選項"}},SNTable_MenuItem_SelectExcluded:{id:"SNTable.MenuItem.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":"選取排除值"}},SNTable_MenuItem_SelectPossible:{id:"SNTable.MenuItem.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":"選取可能值"}},SNTable_MenuItem_Selections:{id:"SNTable.MenuItem.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":"選項"}},SNTable_MenuItem_SortAscending:{id:"SNTable.MenuItem.SortAscending",locale:{"de-DE":"Sortierung in aufsteigender Reihenfolge","en-US":"Sort ascending","es-ES":"Orden ascendente","fr-FR":"Tri 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":"以遞增方式排序"}},SNTable_MenuItem_SortDescending:{id:"SNTable.MenuItem.SortDescending",locale:{"de-DE":"Sortierung in absteigender Reihenfolge","en-US":"Sort descending","es-ES":"Orden descendente","fr-FR":"Tri 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":"以遞減方式排序"}},SNTable_Pagination_DisplayedRowsLabel:{id:"SNTable.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":"{1}의 {0}","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}"}},SNTable_Pagination_FirstPage:{id:"SNTable.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":"移至第一頁"}},SNTable_Pagination_LastPage:{id:"SNTable.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":"移至最後一頁"}},SNTable_Pagination_NextPage:{id:"SNTable.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":"移至下一頁"}},SNTable_Pagination_PageStatusReport:{id:"SNTable.Pagination.PageStatusReport",locale:{"de-DE":"Die Seite wurde geändert. Seite {0} von {1} wird angezeigt.","en-US":"Page has changed. Showing page {0} of {1}.","es-ES":"La página ha cambiado. Mostrando página {0} de {1}.","fr-FR":"La page a changé. Affichage de la page {0} sur {1}.","it-IT":"La pagina è cambiata. Visualizzazione pagina {0} di {1}.","ja-JP":"ページが変更されました。{1} ページ中の {0} ページ目を表示しています。","ko-KR":"페이지가 변경되었습니다. {1}의 {0} 페이지를 보여 줍니다.","nl-NL":"Pagina is gewijzigd. Pagina {0} van {1} wordt weergeven.","pl-PL":"Strona się zmieniła Wyświetlanie strony {0} z {1}.","pt-BR":"A página mudou. Mostrando página {0} de {1}.","ru-RU":"Страница изменилась. Показана страница {0} из {1}.","sv-SE":"Sidan har ändrats. Visar sida {0} av {1}.","tr-TR":"Sayfa değişti. Sayfa {0} / {1} gösteriliyor.","zh-CN":"页面已更改。显示页面 {0} / {1}。","zh-TW":"頁面已變更。顯示第 {0} 頁,共 {1} 頁。"}},SNTable_Pagination_PreviousPage:{id:"SNTable.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":"移至上一頁"}},SNTable_Pagination_RowsPerPage:{id:"SNTable.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":"每頁列數"}},SNTable_Pagination_RowsPerPageChange:{id:"SNTable.Pagination.RowsPerPageChange",locale:{"de-DE":"Zeilen pro Seite wurden in {0} geändert. Jetzt wird die erste Seite angezeigt.","en-US":"Rows per page has changed to {0}. Now showing the first page.","es-ES":"El número de filas por página ha cambiado a {0}. Mostrando ahora la primera página.","fr-FR":"Le nombre de lignes par page a été remplacé par {0}. Affichage en cours de la première page.","it-IT":"Le righe per pagina sono cambiate a {0}. Viene ora mostrata la prima pagina.","ja-JP":"ページあたりの行数が {0} に変更されました。現在、最初のページを表示しています。","ko-KR":"페이지당 행 수가 {0}(으)로 변경되었습니다. 이제 첫 페이지를 보여 줍니다.","nl-NL":"Aantal rijen per pagina is gewijzigd naar {0}. De eerste pagina wordt nu weergegeven.","pl-PL":"Liczba wierszy na stronę została zmieniona na {0}. Wyświetlana jest pierwsza strona.","pt-BR":"Linhas por página mudou para {0}. Agora mostrando a primeira página.","ru-RU":"Количество строк на странице изменилось на {0}. Теперь отображается первая страница.","sv-SE":"Rader per sida har ändrats till {0}. Nu visas första sidan.","tr-TR":"Sayfa başına satır sayısı {0} olarak değiştirildi. Şimdi ilk sayfa gösteriliyor.","zh-CN":"每页行数已更改为 {0}。现在显示第一页。","zh-TW":"每頁列數已變更為 {0}。現在顯示第一頁。"}},SNTable_Pagination_SelectPage:{id:"SNTable.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":"選取頁面"}},SNTable_SelectionLabel_DeselectedValue:{id:"SNTable.SelectionLabel.DeselectedValue",locale:{"de-DE":"Die Werteauswahl ist aufgehoben.","en-US":"Value is deselected.","es-ES":"El valor no está seleccionado.","fr-FR":"La valeur est désélectionnée.","it-IT":"Il valore è deselezionato.","ja-JP":"値が選択解除されました。","ko-KR":"값이 선택 취소되었습니다.","nl-NL":"Selectie van waarde opgeheven.","pl-PL":"Wartość nie jest zaznaczona.","pt-BR":"O valor está desmarcado.","ru-RU":"Выбор значения отменен.","sv-SE":"Val av värde har tagits bort.","tr-TR":"Değer seçimi iptal edildi.","zh-CN":"值已取消选择。","zh-TW":"值已取消選取。"}},SNTable_SelectionLabel_ExitedSelectionMode:{id:"SNTable.SelectionLabel.ExitedSelectionMode",locale:{"de-DE":"Die Werteauswahl ist aufgehoben. Auswahlmodus beendet.","en-US":"Value is deselected. Exited selection mode.","es-ES":"El valor no está seleccionado. Salió del modo de selección.","fr-FR":"La valeur est désélectionnée. Mode de sélection désactivé.","it-IT":"Il valore è deselezionato. Uscita dalla modalità selezione.","ja-JP":"値が選択解除されました。選択モードを終了しました。","ko-KR":"값이 선택 취소되었습니다. 선택 모드를 종료했습니다.","nl-NL":"Selectie van waarde opgeheven. Selectiemodus afgesloten.","pl-PL":"Wartość nie jest zaznaczona. Zakończono tryb wyboru.","pt-BR":"O valor está desmarcado. Modo de seleção encerrado.","ru-RU":"Выбор значения отменен. Выполнен выход из режима выборки.","sv-SE":"Val av värde har tagits bort. Lämnade urvalsläge.","tr-TR":"Değer seçimi iptal edildi. Seçim modundan çıkıldı.","zh-CN":"值已取消选择。已退出选择模式。","zh-TW":"值已取消選取。輸入的選取模式。"}},SNTable_SelectionLabel_NotSelectedValue:{id:"SNTable.SelectionLabel.NotSelectedValue",locale:{"de-DE":"Wert ist nicht ausgewählt.","en-US":"Value is not selected.","es-ES":"El valor no está seleccionado.","fr-FR":"La valeur n'est pas sélectionnée.","it-IT":"Il valore non è selezionato.","ja-JP":"値が選択されていません。","ko-KR":"값이 선택되지 않았습니다.","nl-NL":"Waarde is niet geselecteerd.","pl-PL":"Wartość nie jest wybrana.","pt-BR":"O valor não está selecionado.","ru-RU":"Значение не выбрано.","sv-SE":"Värdet är inte valt.","tr-TR":"Değer seçilmedi.","zh-CN":"未选择值。","zh-TW":"未選取值。"}},SNTable_SelectionLabel_OneSelectedValue:{id:"SNTable.SelectionLabel.OneSelectedValue",locale:{"de-DE":"Aktuell ist ein Wert ausgewählt.","en-US":"Currently there is one selected value.","es-ES":"Actualmente hay un valor seleccionado.","fr-FR":"Actuellement, une valeur est sélectionnée.","it-IT":"Attualmente è presente un solo valore selezionato.","ja-JP":"現在、値が 1 つ選択されています。","ko-KR":"현재 하나의 값이 선택되었습니다.","nl-NL":"Er is momenteel één waarde geselecteerd.","pl-PL":"Aktualnie jest jedna wybrana wartość.","pt-BR":"Atualmente, há um valor selecionado.","ru-RU":"В настоящее время выбрано одно значение.","sv-SE":"Just nu är ett värde valt.","tr-TR":"Şu anda seçili bir değer var.","zh-CN":"当前有一个已选择的值。","zh-TW":"目前有一個選取的值。"}},SNTable_SelectionLabel_SelectedValue:{id:"SNTable.SelectionLabel.SelectedValue",locale:{"de-DE":"Wert ist ausgewählt.","en-US":"Value is selected.","es-ES":"El valor está seleccionado.","fr-FR":"La valeur est sélectionnée.","it-IT":"Il valore è selezionato.","ja-JP":"値が選択されました。","ko-KR":"값이 선택되었습니다.","nl-NL":"Waarde is geselecteerd.","pl-PL":"Wartość jest wybrana.","pt-BR":"O valor está selecionado.","ru-RU":"Значение выбрано.","sv-SE":"Värdet är valt.","tr-TR":"Değer seçildi.","zh-CN":"已选择值。","zh-TW":"已選取值。"}},SNTable_SelectionLabel_SelectedValues:{id:"SNTable.SelectionLabel.SelectedValues",locale:{"de-DE":"Aktuell sind {0} Werte ausgewählt.","en-US":"Currently there are {0} selected values.","es-ES":"Actualmente hay {0} valores seleccionados.","fr-FR":"Actuellement, {0} valeurs sont sélectionnées.","it-IT":"Attualmente sono presenti {0} valori selezionati.","ja-JP":"現在、値が {0} つ選択されています。","ko-KR":"현재 {0}개의 값이 선택되었습니다.","nl-NL":"Er zijn momenteel {0} geselecteerde waarden.","pl-PL":"Liczba aktualnie wybranych wartości: {0}.","pt-BR":"Atualmente, há {0} valores selecionados.","ru-RU":"В настоящее время выбраны значения: {0}.","sv-SE":"Just nu är {0} värden valda.","tr-TR":"Şu anda seçili {0} değer var.","zh-CN":"当前有 {0} 个已选择的值。","zh-TW":"目前有 {0} 個選取的值。"}},SNTable_SelectionLabel_SelectionsConfirmed:{id:"SNTable.SelectionLabel.SelectionsConfirmed",locale:{"de-DE":"Auswahl bestätigt.","en-US":"Selections confirmed.","es-ES":"Confirmadas las selecciones.","fr-FR":"Sélections confirmées.","it-IT":"Selezioni confermate.","ja-JP":"選択が確定されました。","ko-KR":"선택 내용이 확인되었습니다.","nl-NL":"Selecties bevestigd.","pl-PL":"Potwierdzono wybory.","pt-BR":"Seleções confirmadas.","ru-RU":"Выборки подтверждены.","sv-SE":"Valen har bekräftats.","tr-TR":"Seçimler onaylandı.","zh-CN":"选择已确认。","zh-TW":"選項已確認。"}},SNTable_SelectionLabel_selected:{id:"SNTable.SelectionLabel.selected",locale:{"de-DE":"Ausgewählt","en-US":"Selected","es-ES":"Seleccionado","fr-FR":"Sélectionné","it-IT":"Selezionato","ja-JP":"選択済み","ko-KR":"선택됨","nl-NL":"Geselecteerd","pl-PL":"Wybrane","pt-BR":"Selecionado","ru-RU":"Выбрано","sv-SE":"Urval","tr-TR":"Seçildi","zh-CN":"已选择","zh-TW":"已選取"}},SNTable_SortLabel_PressSpaceToSort:{id:"SNTable.SortLabel.PressSpaceToSort",locale:{"de-DE":"Drücken Sie die Leertaste, um nach dieser Spalte zu sortieren","en-US":"Press space to sort on this column","es-ES":"Pulse la barra espaciadora para ordenar en esta columna.","fr-FR":"Appuyez sur Espace pour trier en fonction de cette colonne.","it-IT":"Premere la barra spaziatrice per ordinare questa colonna","ja-JP":"スペース キーを押して、この列をソートします","ko-KR":"이 열을 정렬하려면 스페이스바를 누르십시오.","nl-NL":"Druk op de spatiebalk om sorteren in deze kolom in te schakelen","pl-PL":"Naciśnij spację, aby posortować według tej kolumny","pt-BR":"Pressione espaço para classificar por esta coluna","ru-RU":"Нажмите пробел, чтобы отсортировать по этому столбцу","sv-SE":"Tryck på Blanksteg om du vill sortera efter den här kolumnen","tr-TR":"Bu sütunda sıralama yapmak için boşluk tuşuna basın.","zh-CN":"按下空格键以在该列上排序。","zh-TW":"在此欄按下空格鍵以進行排序"}},SNTable_SortLabel_SortedAscending:{id:"SNTable.SortLabel.SortedAscending",locale:{"de-DE":"In aufsteigender Reihenfolge sortiert.","en-US":"Sorted in ascending order.","es-ES":"Ordenado por orden ascendente.","fr-FR":"Tri dans l'ordre croissant.","it-IT":"Ordinato in ordine crescente.","ja-JP":"昇順で並べ替えられます。","ko-KR":"오름차순으로 정렬되었습니다.","nl-NL":"Gesorteerd in oplopende volgorde.","pl-PL":"Posortowane rosnąco.","pt-BR":"Classificado em ordem crescente.","ru-RU":"Сортировка в порядке возрастания.","sv-SE":"Sorterat i stigande ordning.","tr-TR":"Artan düzende sıralanmıştır.","zh-CN":"已按升序排列。","zh-TW":"已依遞增順序排序。"}},SNTable_SortLabel_SortedDescending:{id:"SNTable.SortLabel.SortedDescending",locale:{"de-DE":"In absteigender Reihenfolge sortiert.","en-US":"Sorted in descending order.","es-ES":"Ordenado por orden descendente.","fr-FR":"Tri dans l'ordre décroissant.","it-IT":"Ordinato in ordine decrescente.","ja-JP":"降順で並べ替えられます。","ko-KR":"내림차순으로 정렬되었습니다.","nl-NL":"Gesorteerd in aflopende volgorde.","pl-PL":"Posortowane malejąco.","pt-BR":"Classificado em ordem decrescente.","ru-RU":"Сортировка в порядке убывания.","sv-SE":"Sorterat i fallande ordning.","tr-TR":"Azalan düzende sıralanmıştır.","zh-CN":"已按降序排列。","zh-TW":"已依遞減順序排序。"}}};const uX=gg(e=>{const t=e(Ty),n=e(_y),r=e(Ug);let i;return function(e){const t="SNTable.Accessibility.RowsAndColumns";e.get(t)===t&&Object.keys(cX).forEach(t=>{e.add(cX[t])})}(t),({keys:e,politeness:o="polite"})=>{const a=e.map(e=>{if(Array.isArray(e)){const[n,...r]=e;return t.get(n,r)}return t.get(e)}).join(" "),s=n.querySelector(`.${JB.First}`),l=n.querySelector(`.${JB.Second}`);if(!s||!l)return void r.error({msg:"could not find aria-live elements, which means accessibility is not working properly"});let c;i===JB.First?(c=l,i=JB.Second):(c=s,i=JB.First),c.innerHTML=c.innerHTML.endsWith(" ")?a:`${a} `,c.setAttribute("aria-live",o)}}),dX=(e,t)=>{const n=_g(uX),r=_g(_y),i=_g(mU),o=_g(hU),a=_g(fU),s=_g(uU),[l,c]=Ig(aX),u=_g(iy),d=_g(wy);iX(()=>{const t=((e,t,n=!1)=>{const r=[ZY(t),e[1]];return n?r:QB})(l,s,u);(({resetCellCoord:e,rootElement:t,shouldRefocus:n,isSelectionMode:r,setFocusedCellCoord:i,keyboard:o,announce:a})=>{if(iK(t),i(e),!(e=>!e.enabled||e.active)(o))return;const s=tK(t,e);n.current?(oK(s),n.current=!1):nK(s),r&&(a({keys:[s?.textContent??""]}),DY(a,s,r))})({resetCellCoord:t,rootElement:r,shouldRefocus:e,setFocusedCellCoord:c,isSelectionMode:u,keyboard:d,announce:n})},[a.length,o,i,t])},pX=e=>{Zh(e),OY(e)&&Om(e.currentTarget)},fX=e=>{jY(e.evt)&&(Zh(e.evt),sK(e))},hX=e=>{const{evt:t,totalsPosition:n,cell:r,isSelectionMode:i}=e;if(!jY(t))return;Zh(t);const o=((e,t)=>[e.pageRowIdx+ZY(t),e.pageColIdx])(r,n),a=eK(i,n),{nextCell:s,nextCellCoord:l}=sK({...e,cellCoord:o,allowedRows:a});l[0]!==o[0]&&(({evt:e,isSelectionsEnabled:t,cell:n,selectionDispatch:r,announce:i,isSelectionMode:o,nextCell:a})=>{e.shiftKey&&t&&n.isSelectable?r({type:KB.SelectMultiAdd,payload:{cell:n,evt:e,announce:i}}):DY(i,a,o)})({...e,nextCell:s})},mX=e=>{const{evt:t}=e;NY(t)?(({evt:e,totalRowCount:t,rowsPerPage:n,page:r,updateShouldRefocus:i,handleChangePage:o})=>{Zh(e);const a=Math.ceil(t/n)-1;e.key===Em.Right&&r<a?(i(),o(r+1)):e.key===Em.Left&&r>0&&(i(),o(r-1))})(e):t.key===Em.Esc?(({evt:e,keyboard:t,isSelectionMode:n})=>{t.enabled&&!n&&(Zh(e),t.blur?.(!0))})(e):qY(t.key)&&Zh(t)},gX=e=>{const{evt:t,selectionsAPI:n}=e;if(t.currentTarget.classList.contains(YB.Disabled))return void Zh(t);const r={...e,isSelectionMode:!!n?.isModal()};switch(t.key){case Em.Space:(({evt:e,cell:t,isSelectionsEnabled:n,selectionDispatch:r,announce:i})=>{Zh(e),t.isSelectable&&n&&r({type:KB.Select,payload:{cell:t,evt:e,announce:i}})})(r);break;case Em.Enter:(({isSelectionMode:e,selectionsAPI:t,evt:n,announce:r})=>{Zh(n),e&&(t?.confirm(),r({keys:["SNTable.SelectionLabel.SelectionsConfirmed"]}))})(r);break;case Em.Esc:(({isSelectionMode:e,selectionsAPI:t,evt:n,announce:r})=>{e&&(Zh(n),t?.cancel(),r({keys:["SNTable.SelectionLabel.ExitedSelectionMode"]}))})(r);break;case Em.C:pX(t);break;case Em.Tab:(({evt:e,keyboard:t,isSelectionMode:n,paginationNeeded:r})=>{const i=e.shiftKey||!r;t.enabled&&n&&i&&(Zh(e),Qh(e.currentTarget,t,e.shiftKey))})(r);break;default:hX(r)}},yX=e=>{const t=_g(uV),n=Ag(dV),r=Ag(pV),i=_g(GB),o=Yt.useRef();OK({ref:e,callback:a=>{const s=()=>{if(e.current){const e=a.borderBoxSize.at(0)?.inlineSize??0,t=a.borderBoxSize.at(0)?.blockSize??0,i=a.contentBoxSize.at(0)?.inlineSize??0,o=t-(a.contentBoxSize.at(0)?.blockSize??0);r(e-i),n(o)}};t?(o.current&&i.off("done-adjusting-column-width",o.current),i.once("done-adjusting-column-width",s),o.current=s):s()}}),Yt.useEffect(()=>{const e=i;return()=>{o.current&&e.off("done-adjusting-column-width",o.current)}},[i])},bX=Ul("div")({clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",width:"1px"}),vX=Ul(vh,{shouldForwardProp:e=>"fullHeight"!==e&&"interactions"!==e})(({fullHeight:e,interactions:t})=>({height:e?"100%":"calc(100% - 41px)",overflow:t.scroll?"auto":"hidden",border:"none"})),xX=Ul(rh,{shouldForwardProp:e=>"borderRight"!==e})(({borderRight:e})=>({tableLayout:"fixed",width:"min-content",borderRight:e})),wX=()=>lt.jsxs(lt.Fragment,{children:[lt.jsx(bX,{className:JB.First,"data-testid":JB.First,"aria-live":"polite","aria-atomic":"true"}),lt.jsx(bX,{className:JB.Second,"data-testid":JB.Second,"aria-live":"polite","aria-atomic":"true"})]}),SX=e=>{const t=Yt.useRef(new Map),n=Yt.useRef(null);Yt.useEffect(()=>{n.current=e(t.current),t.current.forEach((e,t)=>{n.current?.observe(t)});const r=t.current,i=n.current;return()=>{i.disconnect(),r.clear()}},[e,n,t]);const r=Yt.useCallback((e,r)=>{t.current.set(e,r),n.current?.observe(e)},[t,n]),i=Yt.useCallback(e=>{t.current.delete(e),n.current?.unobserve(e)},[n,t]);return Yt.useMemo(()=>({addTask:r,removeTask:i}),[r,i])},kX=e=>new ResizeObserver(t=>{t.forEach(t=>{const n=e.get(t.target);n?.(t)})}),CX=()=>SX(kX),EX=({updateShouldRefocus:e,tableWrapperRef:t})=>{const n=_g(oy),r=_g(wy),i=Ag(VY);Yt.useEffect(()=>{const o=()=>{i({type:KB.Reset})},a=()=>{i({type:KB.Clear})},s=()=>{t.current?.contains(document.activeElement)?e():r.enabled&&r.blur?.(!0),o()};return n?.on("deactivated",o),n?.on("canceled",o),n?.on("confirmed",s),n?.on("cleared",a),()=>{n?.removeListener("deactivated",o),n?.removeListener("canceled",o),n?.removeListener("confirmed",s),n?.removeListener("cleared",a)}},[n,r,i,e,t])},MX="min(50px, 20%)",RX=({bar:e,height:t})=>{const{value:n,offsetValue:r,columnMin:i,columnMax:o,isManualRange:a,thicknessPx:s,barEnd:l}=e,c=a?i:Math.min(i,0);let u=a?o:Math.max(o,0);u>c||(u=c+1);const d=r,p=r+n,f=n>=0,h=Math.min(d,p),m=Math.max(d,p),g=Math.round(((e,t,n)=>Math.max(t,Math.min(n,e)))(s??("none"===l?1*t:4),2,Math.max(2,t-2))),y=Math.min(((e,t)=>"circle"===e?2*t:"box"===e?t+4:0)(l,g),t),b=Math.min(d,p)<c,v=Math.max(d,p)>u,x="none"===l?25:10+("none"===l?0:y/2+2);return{rangeMin:c,rangeMax:u,hasRoomAtMin:e.hasNegativeValues??(a||c<0||!f),hasRoomAtMax:e.hasPositiveValues??(a||o>=0||f),low:h,high:m,valueEnd:f?m:h,growsTowardsHigh:f,overflowMin:b,overflowMax:v,hasBar:m>h&&m>c&&h<u,thicknessPx:g,capSize:y,hasZeroAxis:c<=0&&u>=0,oobSizePx:x}},_X=Ul("div")({position:"relative",width:"100%",overflow:"hidden"}),AX=Ul("div")({position:"absolute"}),IX=Ul("span")({position:"absolute",top:0,height:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),PX=Ul("svg")({position:"absolute",display:"block"}),TX=({shape:e,pointsRight:t,width:n,height:r})=>{if("slice"===e)return`M0 0L${n-8} ${r}L0 ${r}ZM8 0L${n} ${r}L${n} 0Z`;const i=n/2,o=i*Math.sin(Math.PI/3),a=t?i/2:1.5*i;return`M${a} ${i-o}L${t?n:0} ${i}L${a} ${i+o}Z`},DX=({height:e,theme:t,bar:n,direction:r,fontFamily:i,fontSize:o})=>{const a=(({bar:e,height:t,isRtl:n})=>{const r=RX({bar:e,height:t}),{rangeMin:i,rangeMax:o,low:a,high:s,overflowMin:l,overflowMax:c,thicknessPx:u,capSize:d,oobSizePx:p}=r,f=r.hasRoomAtMin?MX:"0px",h=r.hasRoomAtMax?MX:"0px",m=f,g=`calc(100% - ${h})`,y=e=>{const t=(Math.min(Math.max(e,i),o)-i)/(o-i);return`calc(${f} + ${t} * (100% - ${f} - ${h}))`},b="none"===e.barEnd,v=b?25:10,x=c?`max(${g} - ${p}px, ${l?m:y(a)})`:y(s),w=l?`min(${m} + ${p}px, ${c?g:y(s)})`:y(a),S=r.growsTowardsHigh?x:w,k=e=>Math.floor((t-e)/2),C=k(u),E=d>0?d/2+4:4,M=e=>{const t=b?u:10;return{key:e,shape:b?"slice":"triangle",pointsRight:"max"===e!==n,width:v,height:t,style:{..."min"===e?{insetInlineStart:f}:{insetInlineEnd:h},top:k(t),width:v,height:t}}};return{zeroAxis:r.hasZeroAxis?{insetInlineStart:`calc(${y(0)} - 0.5px)`,top:0,width:1,height:"100%"}:void 0,bar:r.hasBar?{insetInlineStart:w,width:`max(1px, ${x} - ${w})`,top:C,height:u}:void 0,cap:r.hasBar&&d>0?{insetInlineStart:`calc(${S} - ${d/2}px)`,top:k(d),width:d,height:d,borderRadius:"circle"===e.barEnd?"50%":void 0}:void 0,label:e.label?r.growsTowardsHigh?{insetInlineStart:c?`calc(${g} + 4px)`:l?`max(${x} + ${E}px, ${m} + ${v+4}px)`:`calc(${x} + ${E}px)`,insetInlineEnd:"4px",textAlign:"start"}:{insetInlineStart:"4px",insetInlineEnd:`calc(100% - ${l?`calc(${m} - 4px)`:c?`min(${w} - ${E}px, ${g} - ${v+4}px)`:`calc(${w} - ${E}px)`})`,textAlign:"end"}:void 0,markers:[l?M("min"):void 0,c?M("max"):void 0].filter(e=>void 0!==e)}})({bar:n,height:e,isRtl:"rtl"===r}),s=n.color??Xh(t,n.colorPalette,t.getDataColorSpecials().primary),l=n.labelColor??Xh(t,n.labelColorPalette,"inherit");return lt.jsxs(_X,{"data-testid":"bar-container",role:"img","aria-label":n.label||n.fallbackLabel,dir:r,style:{height:e},children:[a.zeroAxis?lt.jsx(AX,{"data-testid":"bar-zero-axis",style:{...a.zeroAxis,backgroundColor:"#d0d0d0"}}):null,a.bar?lt.jsx(AX,{"data-testid":"bar",style:{...a.bar,backgroundColor:s}}):null,a.cap?lt.jsx(AX,{"data-testid":"bar-end-cap",style:{...a.cap,backgroundColor:s}}):null,a.label?lt.jsx(IX,{"data-testid":"bar-label",style:{...a.label,fontFamily:i,fontSize:o??"14px",lineHeight:`${e}px`,color:l},children:n.label}):null,a.markers.map(e=>lt.jsx(PX,{"data-testid":`bar-oob-${e.key}`,width:e.width,height:e.height,viewBox:`0 0 ${e.width} ${e.height}`,style:e.style,children:lt.jsx("path",{d:TX(e),fill:s})},e.key))]})},OX=e=>{e.stopPropagation()},NX=({href:e,text:t,interactions:n,color:r})=>({href:e,title:t,rel:"noreferrer",target:"_blank",underline:"hover",onClick:OX,color:Uh.LINK,style:{pointerEvents:n.active?"auto":"none",color:r??void 0,opacity:n.active&&n.passive||r?void 0:.4}}),qX=({href:e,text:t,interactions:n,color:r})=>lt.jsx(gp,{...NX({href:e,text:t,interactions:n,color:r}),children:t}),LX=window.requestIdleCallback??(e=>setTimeout(()=>{e({})},0)),jX=window.cancelIdleCallback??(e=>{clearTimeout(e)});let zX=0,FX=0,$X=0;function BX(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function HX(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function WX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?VX(Object(n),!0).forEach(function(t){HX(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VX(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function UX(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return BX(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?BX(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var GX=Object.prototype.hasOwnProperty,YX=Object.prototype.toString,KX=Object.defineProperty,XX=Object.getOwnPropertyDescriptor,JX=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===YX.call(e)},QX=function(e){if(!e||"[object Object]"!==YX.call(e))return!1;var t,n=GX.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&GX.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||GX.call(e,t)},ZX=function(e,t){KX&&"__proto__"===t.name?KX(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},eJ=function(e,t){if("__proto__"===t){if(!GX.call(e,t))return;if(XX)return XX(e,t).value}return e[t]},tJ=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=eJ(s,n),s!==(i=eJ(t,n))&&(u&&i&&(QX(i)||(o=JX(i)))?(o?(o=!1,a=r&&JX(r)?r:[]):a=r&&QX(r)?r:{},ZX(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&ZX(s,{name:n,newValue:i}));return s};function nJ(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=i.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map(e=>e.instance).indexOf(e),s=i.wrappedFields[t].attrExps.map(e=>e.instance).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(r)&&r.some((e,t)=>e!==t)){const e=r.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:l>=0?e=>e[a].qAttrDims.qValues[l]:s>=0?e=>e[a].qAttrExps.qValues[s]:e=>e[a]}function rJ(e,t,n){let r=n.key;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function iJ(e){let t=e.cache,n=e.f,r=e.mainCell,i=e.p,o=e.page,a=e.rowIdx,s=e.row,l=e.sourceKey,c=e.target,u=e.targetProp,d=e.columnOrder,p=r;if(i.field&&i.field!==n){const e=nJ(i.field,o,{cache:t},d);if(-1===e)return;p=tJ({qRow:a},e(s))}c[u]=rJ(i,p,{key:l})}function oJ(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const a=t.raw(),s=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),c=r.normalizeConfig(i[e],t),u=c.props,d=c.main,p=Object.keys(u),f=!!i[e].trackBy,h=typeof i[e].trackBy,m={},g=[],y=[];for(let t=0;t<a.qDataPages.length;t++){const o=nJ(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let c=0;c<a.qDataPages[t].qMatrix.length;c++){const b=a.qDataPages[t].qArea.qTop+c,v=tJ({qRow:b},o(a.qDataPages[t].qMatrix[c])),x=rJ(d,v,{key:s});if(!(d.filter&&!d.filter(v))){for(let e=0;e<p.length;e++){const r=u[p[e]];let i=r.fields||[r];r.fields&&(x[p[e]]=[]);for(let o=0;o<i.length;o++)iJ({cache:n,f:l,mainCell:v,p:i[o],prop:p[e],page:a.qDataPages[t],rowIdx:b,row:a.qDataPages[t].qMatrix[c],sourceKey:s,target:r.fields?x[p[e]]:x,targetProp:r.fields?o:p[e],columnOrder:a.qColumnOrder});if(r.fields){const t=x[p[e]].map(e=>e.value),n=x[p[e]].map(e=>e.label);x[p[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[p[e]].value)}}}f&&r.track({cfg:i[e],itemData:v,obj:x,target:g,tracker:m,trackType:h}),y.push(x)}}}const b=f?r.collect(g,{main:d,propsArr:p,props:u}):y;o=[...o,...b]}return o}function aJ(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function sJ(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=cJ)):void 0===t&&(t=lJ);for(var n,r,i,o,a,s=new pJ(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new pJ(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(dJ)}function lJ(e){return e.children}function cJ(e){return Array.isArray(e)?e[1]:null}function uJ(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function dJ(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function pJ(e){this.data=e,this.depth=this.height=0,this.parent=null}function fJ(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}pJ.prototype=sJ.prototype={constructor:pJ,count:function(){return this.eachAfter(aJ)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;e=n.pop(),t=r.pop();for(;e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t},copy:function(){return sJ(this).eachBefore(uJ)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}};var hJ={depth:-1},mJ={},gJ={};function yJ(e){return e.id}function bJ(e){return e.parentId}function vJ(){var e,t=yJ,n=bJ;function r(r){var i,o,a,s,l,c,u,d,p=Array.from(r),f=t,h=n,m=new Map;if(null!=e){const t=p.map((t,n)=>function(e){e=`${e}`;let t=e.length;wJ(e,t-1)&&!wJ(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,r))),n=t.map(xJ),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(xJ(e)),p.push(gJ));f=(e,n)=>t[n],h=(e,t)=>n[t]}for(a=0,i=p.length;a<i;++a)o=p[a],c=p[a]=new pJ(o),null!=(u=f(o,a,r))&&(u+="")&&(d=c.id=u,m.set(d,m.has(d)?mJ:c)),null!=(u=h(o,a,r))&&(u+="")&&(c.parent=u);for(a=0;a<i;++a)if(u=(c=p[a]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===mJ)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(s)throw new Error("multiple roots");s=c}if(!s)throw new Error("no root");if(null!=e){for(;s.data===gJ&&1===s.children.length;)s=s.children[0],--i;for(let e=p.length-1;e>=0&&(c=p[e]).data===gJ;--e)c.data=null}if(s.parent=hJ,s.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(dJ),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=fJ(e),r):t},r.parentId=function(e){return arguments.length?(n=fJ(e),r):n},r.path=function(t){return arguments.length?(e=fJ(t),r):e},r}function xJ(e){let t=e.length;if(t<2)return"";for(;--t>1&&!wJ(e,t););return e.slice(0,t)}function wJ(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function SJ(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=SJ(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=SJ(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function kJ(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...kJ(e[i].children,t-1,n)]);return r}function CJ(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const r=Math.max(0,Math.min(100,t-e));return e=>kJ(e.children,r-1,n)}return!1}const EJ=/^qDimensionInfo(?:\/(\d+))?/,MJ=/^\/?qMeasureInfo\/(\d+)/,RJ=/\/qAttrExprInfo\/(\d+)/,_J=/\/qAttrDimInfo\/(\d+)/;function AJ(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function IJ(e,t){let n=t.cube;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,d=r;const p=n.qEffectiveInterColumnSortOrder,f=AJ(n);return EJ.test(d)&&(i=!0,o=+EJ.exec(d)[1],d=r.replace(EJ,"")),MJ.test(d)&&("K"===n.qMode?c=+MJ.exec(d)[1]:p&&-1!==p.indexOf(-1)?(c=+MJ.exec(d)[1],u=0):u=+MJ.exec(d)[1],d=d.replace(MJ,"")),d&&(_J.exec(d)?s=+_J.exec(d)[1]:RJ.exec(d)&&(a=+RJ.exec(d)[1])),l=i?"S"===n.qMode?f[o]:p?p.indexOf(o):o:p&&-1!==p.indexOf(-1)?p.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:s,attrIdx:a}}function PJ(e,t){let n,r,i=CJ(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function TJ(e,t,n){let r=n.key;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function DJ(e){let t=e.propsArr,n=e.props,r=e.item,i=e.itemData,o=e.ret,a=e.sourceKey;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let c,u;s.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const d=l[n];let p,f,h,m,g,y;if("primitive"===d.type?(h=d.value,y=String(d.value)):("function"==typeof d.value&&(p=e=>d.value(e,r)),"function"==typeof d.label&&(f=e=>d.label(e,r)),d.accessor?(m=d.accessor(r),Array.isArray(m)?(g=m.map(d.valueAccessor),d.attrAccessor&&(g=g.map(d.attrAccessor)),p&&(h=g.map(p),p=null),f&&(y=g.map(f),f=null),h=d.reduce?d.reduce(h):h,y=d.reduceLabel?d.reduceLabel(y,h):String(h)):(h=d.attrAccessor?d.attrAccessor(d.valueAccessor(m)):d.valueAccessor(m),y=h)):(h=i,y=i)),s.fields){const e=p?p(h):h;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=p?p(h):h;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},d.field&&(o[t[e]].source={field:d.field.key(),key:a})}}c&&(o[t[e]]={value:"function"==typeof s.value?s.value(c,r):c,label:"function"==typeof s.label?s.label(u,r):u})}}const OJ=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=SJ(r,e);return o&&o[0]?(t.tree=sJ(o[0],n.children||(e=>e[i])),t.tree):null};const NJ=e=>{let t=e.propsArr,n=e.props,r=e.cube;e.cache;let i=e.itemDepthObject,o=e.f;for(let e=0;e<t.length;e++){const a=n[t[e]],s=a.fields?a.fields:[a];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==o){const e=PJ(i,IJ(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function qJ(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const i=t.raw(),o=t.key(),a="S"===i.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}(e),r=e.fields(),i=e.fields().filter(e=>"dimension"===e.type()).map(e=>n.indexOf(r.indexOf(e))),o=e.fields().filter(e=>"measure"===e.type()).map(e=>n.indexOf(r.indexOf(e))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let r="__root",l=!1;for(let e=0;e<i.length;e++){var s;const t=n[i[e]],o="".concat(r,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=WX({__id:o,__parent:r,qValues:[]},t),l=!0),r=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[r].qValues.push(t)}}const l=Object.keys(a).map(e=>a[e]),c=vJ().id(e=>e.__id).parentId(e=>e.__parent)(l);return c}(t):OJ(i,n,e);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===i.qMode){let e=AJ(i)[o-1];a=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),a=n.fields[e]}const s=r.normalizeConfig(WX(WX({},e),{},{field:a?a.key():void 0}),t),c=s.props,u=s.main,d=Object.keys(c);l[o]={propsArr:d,props:c,main:u};const p=a?IJ(a,{cube:i}):{fieldDepth:0};NJ({propsArr:d,props:c,cube:i,cache:n,itemDepthObject:p,f:a})}const c=a.copy().descendants(),u=a.descendants();for(let e=0;e<u.length;e++){const t=l[u[e].depth].propsArr,n=l[u[e].depth].props,r=l[u[e].depth].main,i=c[e],a=i.data,s=TJ(r,a,{key:o});DJ({propsArr:t,props:n,item:i,itemData:a,ret:s,sourceKey:o}),u[e].data=s}return a}function LJ(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<i.length;a++)if(void 0!==i[a].field){const s=t.raw(),l=t.key();if(!OJ(s,n,e))continue;const c="object"==typeof i[a].field?i[a].field:t.field(i[a].field),u=r.normalizeConfig(i[a],t),d=u.props,p=u.main,f=Object.keys(d),h=IJ(c,{cube:s}),m=PJ({fieldDepth:0},h),g=m.nodeFn,y=m.attrFn,b=m.valueFn;NJ({propsArr:f,props:d,cube:s,cache:n,itemDepthObject:h,f:c});const v=!!i[a].trackBy,x=typeof i[a].trackBy,w={},S=[],k=g(n.tree),C=[];for(let e=0;e<k.length;e++){const t=k[e],n=y?y(b(t)):b(t);if(p.filter&&!p.filter(n))continue;const o=TJ(p,n,{key:l});DJ({propsArr:f,props:d,item:t,itemData:n,ret:o,sourceKey:l}),v&&r.track({cfg:i[a],itemData:n,obj:o,target:S,tracker:w,trackType:x}),C.push(o)}const E=v?r.collect(S,{main:p,propsArr:f,props:d}):C;o=[...o,...E]}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var jJ=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e){
|
|
140
140
|
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
|
|
141
|
-
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,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\-\+#]/),y=p-g,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),x=g>0?e.substring(v,p):"";if(n=(t="-"===(e=e.substring(f,v)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0===+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(d=t[0]).length%l,p=d.length,v=0;v<p;v++)m+=d.charAt(v),!((v-y+1)%l)&&v<p-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),h+(n?"-":"")+r+x}});function LJ(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const jJ={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},zJ=/%\)?$/,FJ=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,$J=/^\(oct\)/i,BJ=/^\(dec\)/i,HJ=/^\(hex\)/i,VJ=/^\(bin\)/i,WJ=/^\(rom\)/i,UJ=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,GJ=/#|0/g;function YJ(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function KJ(e,t,n){let r;return FJ.test(t)?e=YJ(e,Number(/\d{2}/.exec(t)[0]),t,n):$J.test(t)?e=YJ(e,8,t,n):BJ.test(t)?e=YJ(e,10,t,n):HJ.test(t)?e=YJ(e,16,t,n):VJ.test(t)?e=YJ(e,2,t,n):WJ.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}function XJ(e,t,n){const r=LJ(e);return n?r:new RegExp(r||"",t)}function JJ(e,t,n,r){let i,o,a,s,l,c,u,d,p,f=e.pattern;var h,m;r&&(e.abbreviate=!0),h=t,(m=n)&&(m=LJ(m)),h&&(h=LJ(h)),p=new RegExp("(?:[#0]+".concat(h,")?[#0]+(?:").concat(m,"[#0]+)?")),a=f.match(p),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(XJ(c,"g"),t)),u=n,n=".",u&&(a=a.replace(XJ(u,"g"),n)),d=a.match(/#/g),d=d?d.length:0;const g=f.split(u);let y;g[1]&&(y=g[1].match(GJ)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=y?y.length:2,e.percentage=zJ.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(XJ(t,null,!0),"|").concat(XJ(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class QJ{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return jJ;const n={};return e.qNumericalAbbreviation.split(t).forEach(e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])}),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new QJ(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],UJ.test(e[0])&&(r.positive.isFunctional=!0),e[1]?UJ.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?UJ.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||JJ(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&JJ(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&JJ(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,c,u=this._prepared,d="",p="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,a=u.t,u.isFunctional)e=KJ(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=qJ(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),p=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=qJ(l,e)}e=e.replace(u.numericRegex,e=>e===a?u.groupTemp:e===o?u.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+p+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function ZJ(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=t.size,r=void 0===n?5e3:n,i=t.multipleArguments,o=void 0!==i&&i,a=t.toKey,s=void 0===a?e=>e:a;let l,c,u=Object.create(null),d=Object.create(null),p=0,f=0;return l=o?function(){return c=s(...arguments),l.has(c)?l.get(c):l.set(c,e(...arguments))}:t=>(c=s(t),l.has(c)?l.get(c):l.set(c,e(t))),l.set=(e,t)=>(p>=r&&(delete u[d[f]],delete d[f],p--,f++),u[e]=t,d[p]=e,p++,t),l.get=e=>u[e],l.has=e=>e in u,l.clear=()=>{u=Object.create(null),d=Object.create(null),p=0,f=0},l.size=()=>p,l}function eQ(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new QJ(...t)}(i,e,t,n,r),a=ZJ(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const tQ="D",nQ="T",rQ="TS",iQ="IV",oQ=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],aQ=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],sQ=["January","February","March","April","May","June","July","August","September","October","November","December"],lQ=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function cQ(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function uQ(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function dQ(e,t){let n,r=function(e){const t=e,n=24*uQ(t),r=60*uQ(n),i=60*uQ(r),o=1e3*uQ(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:a,s:s,f:l,t:u}}class pQ{constructor(e,t,n){const r=e||{};if(r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:oQ,qDayNames:aQ,qLongMonthNames:sQ,qMonthNames:lQ}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),!t){t={[nQ]:r.qTimeFmt||"hh:mm:ss",[tQ]:r.qDateFmt||"YYYY-MM-DD",[rQ]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new pQ(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),r=dQ(e,t));const i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:cQ("".concat(t.year).slice(-2),2),YYY:cQ("".concat(t.year).slice(-3),3),def:e=>cQ("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:cQ("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:cQ("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>cQ("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>cQ("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>cQ("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>cQ("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const a=new RegExp(o.join("|"),"g"),s=t.replace(a,e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r});return s}}function fQ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new pQ(...t)}function hQ(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=fQ(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=ZJ(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==iQ?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=fQ(i,e,t),r=ZJ(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function mQ(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.meta,r=t.id,i=t.key,o=t.localeInfo,a=t.fieldExtractor,s=t.value,l=t.type,c=t.sourceField;const u=s||("dimension"===l?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),d="dimension"===l?"first":"avg",p=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return hQ(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),eQ(n,r,i,o,t)}(n,o),f="dimension"===l?"first":(e,t)=>p(t),h={id:()=>r,key:()=>i,raw:()=>n,title:()=>n.qFallbackTitle||n.label,type:()=>l,origin:()=>c,items:()=>(e||(e=a(h)),e),min:()=>n.qMin,max:()=>n.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:d,reduceLabel:f,formatter:()=>p,tags:()=>n.qTags};return h}function gQ(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:mQ(ZX({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=gQ("qAttrDimInfo",t,n,a,ZX({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=gQ("qAttrExprInfo",t,n,a,ZX({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=gQ("qMeasureInfo",t,n,a,ZX({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s})}function yQ(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=e.data,r=e.config,i=void 0===r?{}:r;const o={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},a=n;if(!a)throw new Error('Missing "data" input');if(!a.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=yQ.util,l={cache:o,cube:a,localeInfo:i.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:i.virtualFields},c={key:()=>t,raw:()=>a,field:e=>function(e,t){let n=t.cache;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,l),fields:()=>o.fields.slice(),extract:e=>l.extractor(e,c,o,s),hierarchy:e=>l.hierarchy(e,c,o,s),_cache:()=>o};"K"===a.qMode||"T"===a.qMode||!a.qMode&&a.qNodesOnDim?(l.extractor=NJ,l.hierarchy=OJ,l.pages="K"===a.qMode?a.qStackedDataPages:a.qTreeDataPages):"S"===a.qMode?(l.extractor=rJ,l.pages=a.qDataPages,l.hierarchy=OJ):l.extractor=()=>[],l.fieldExtractor=e=>l.extractor({field:e},c,o,s);const u="S"===a.qMode?e=>e.qElemNumber:void 0,d="S"===a.qMode?e=>e.qNum:void 0;o.wrappedFields.push(...gQ("qDimensionInfo",a,t,"",ZX({},l,{value:u,type:"dimension"}))),o.wrappedFields.push(...gQ("qMeasureInfo",a,t,"",ZX({},l,{value:d,type:"measure"}))),o.fields=o.wrappedFields.map(e=>e.instance);const p=e=>{e.forEach(e=>{o.allFields.push(e.instance),p(e.measures),p(e.attrDims),p(e.attrExps)})};return p(o.wrappedFields),(i.virtualFields||[]).forEach(e=>{const n=c.field(e.from),r=mQ(HX({meta:n.raw(),id:"".concat(t,"/").concat(e.key),sourceField:n,fieldExtractor:e=>l.extractor({field:e},c,o,s),key:e.key,type:n.type(),localeInfo:l.localeInfo,value:n.value},e.override||{}));o.virtualFields.push(r)}),o.allFields.push(...o.virtualFields),c}const bQ=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],vQ=/\/qDimensionInfo(?:\/(\d+))?/,xQ=/\/qMeasureInfo\/(\d+)/,wQ=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,SQ=/\/qAttrExprInfo\/(\d+)/,kQ=/\/?qHyperCube/,CQ=/\/?qTreeData/,EQ=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),MQ=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function RQ(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;if(e.brushes().forEach(e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;kQ.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=EQ):CQ.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=MQ);let s=!0;if(vQ.test(e)&&(r=+vQ.exec(e)[1]),xQ.test(e)&&(i=+xQ.exec(e)[1]),wQ.test(e)){i=-1,r=0;const e=+wQ.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(SQ.test(e)){const e=i;if(t){i=0;const a=xJ(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=a.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=a.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+SQ.exec(n)[1]}else r>-1?(r=-1,i=+SQ.exec(n)[1]):i+=+SQ.exec(n)[1]+1}return bQ.forEach(e=>{let t=VX(e,2),r=t[0],i=t[1];n=n.replace(r,i)}),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach(e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach(e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach(e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));(0===o||s>=o)&&o>-1?n.forEach(e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})}):n.forEach(e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})}),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map(e=>+e).filter(e=>!isNaN(e)),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}}),!l&&s)return[{method:"resetMadeSelections",params:[]}];var c;a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]});return a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o}function _Q(e){yQ.util=e.data("matrix").util,e.data("q",yQ),e.formatter("q-number",eQ),e.formatter("q-time",hQ)}_Q.qBrushHelper=RQ,_Q.selections=RQ;var AQ=Object.prototype.hasOwnProperty,IQ=Object.prototype.toString,PQ=Object.defineProperty,TQ=Object.getOwnPropertyDescriptor,DQ=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===IQ.call(e)},OQ=function(e){if(!e||"[object Object]"!==IQ.call(e))return!1;var t,n=AQ.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&AQ.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||AQ.call(e,t)},NQ=function(e,t){PQ&&"__proto__"===t.name?PQ(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},qQ=function(e,t){if("__proto__"===t){if(!AQ.call(e,t))return;if(TQ)return TQ(e,t).value}return e[t]},LQ=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=qQ(s,n),s!==(i=qQ(t,n))&&(u&&i&&(OQ(i)||(o=DQ(i)))?(o?(o=!1,a=r&&DQ(r)?r:[]):a=r&&OQ(r)?r:{},NQ(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&NQ(s,{name:n,newValue:i}));return s},jQ="2.11.7";function zQ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function FQ(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $Q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function BQ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$Q(Object(n),!0).forEach(function(t){FQ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$Q(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function HQ(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return zQ(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zQ(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function VQ(e){return!!e.changedTouches}function WQ(e){return"number"==typeof e&&!isNaN(e)}function UQ(e){return"number"!=typeof e||isNaN(e)}function GQ(e){const t=e.length;let n=NaN,r=NaN,i=NaN,o=NaN;for(let a=0;a<t;a++)n=isNaN(n)?e[a].x:Math.min(n,e[a].x),r=isNaN(r)?e[a].x:Math.max(r,e[a].x),i=isNaN(i)?e[a].y:Math.min(i,e[a].y),o=isNaN(o)?e[a].y:Math.max(o,e[a].y);return[n,i,r,o]}function YQ(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function KQ(e){return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}]}function XQ(e){const t=HQ(GQ(e),4),n=t[0],r=t[1];return{x:n,y:r,width:t[2]-n,height:t[3]-r}}function JQ(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function QQ(e){const t=e||{},n=t.x,r=t.y,i=t.width,o=t.height,a=t.x1,s=t.x2,l=t.y1,c=t.y2,u=t.cx,d=t.cy,p=t.r,f=t.vertices;return WQ(u)&&WQ(d)&&WQ(p)?"circle":WQ(a)&&WQ(s)&&WQ(l)&&WQ(c)?"line":WQ(n)&&WQ(r)&&WQ(i)&&WQ(o)?"rect":WQ(n)&&WQ(r)?"point":Array.isArray(f)?f.every(e=>Array.isArray(e))?"geopolygon":"polygon":null}function ZQ(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}function eZ(e){return function(){return e}}const tZ=Math.abs,nZ=Math.atan2,rZ=Math.cos,iZ=Math.max,oZ=Math.min,aZ=Math.sin,sZ=Math.sqrt,lZ=1e-12,cZ=Math.PI,uZ=cZ/2,dZ=2*cZ;function pZ(e){return e>=1?uZ:e<=-1?-uZ:Math.asin(e)}const fZ=Math.PI,hZ=2*fZ,mZ=1e-6,gZ=hZ-mZ;function yZ(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class bZ{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?yZ:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return yZ;const n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,o){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+o}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let o=this._x1,a=this._y1,s=n-e,l=r-t,c=o-e,u=a-t,d=c*c+u*u;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(d>mZ)if(Math.abs(u*s-l*c)>mZ&&i){let p=n-o,f=r-a,h=s*s+l*l,m=p*p+f*f,g=Math.sqrt(h),y=Math.sqrt(d),b=i*Math.tan((fZ-Math.acos((h+d-m)/(2*g*y)))/2),v=b/y,x=b/g;Math.abs(v-1)>mZ&&this._append`L${e+v*c},${t+v*u}`,this._append`A${i},${i},0,0,${+(u*p>c*f)},${this._x1=e+x*s},${this._y1=t+x*l}`}else this._append`L${this._x1=e},${this._y1=t}`;else;}arc(e,t,n,r,i,o){if(e=+e,t=+t,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),l=e+a,c=t+s,u=1^o,d=o?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>mZ||Math.abs(this._y1-c)>mZ)&&this._append`L${l},${c}`,n&&(d<0&&(d=d%hZ+hZ),d>gZ?this._append`A${n},${n},0,1,${u},${e-a},${t-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:d>mZ&&this._append`A${n},${n},0,${+(d>=fZ)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function vZ(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new bZ(t)}function xZ(e){return e.innerRadius}function wZ(e){return e.outerRadius}function SZ(e){return e.startAngle}function kZ(e){return e.endAngle}function CZ(e){return e&&e.padAngle}function EZ(e,t,n,r,i,o,a){var s=e-n,l=t-r,c=(a?o:-o)/sZ(s*s+l*l),u=c*l,d=-c*s,p=e+u,f=t+d,h=n+u,m=r+d,g=(p+h)/2,y=(f+m)/2,b=h-p,v=m-f,x=b*b+v*v,w=i-o,S=p*m-h*f,k=(v<0?-1:1)*sZ(iZ(0,w*w*x-S*S)),C=(S*v-b*k)/x,E=(-S*b-v*k)/x,M=(S*v+b*k)/x,R=(-S*b+v*k)/x,_=C-g,A=E-y,I=M-g,P=R-y;return _*_+A*A>I*I+P*P&&(C=M,E=R),{cx:C,cy:E,x01:-u,y01:-d,x11:C*(i/w-1),y11:E*(i/w-1)}}function MZ(){var e=xZ,t=wZ,n=eZ(0),r=null,i=SZ,o=kZ,a=CZ,s=null,l=vZ(c);function c(){var c,u,d=+e.apply(this,arguments),p=+t.apply(this,arguments),f=i.apply(this,arguments)-uZ,h=o.apply(this,arguments)-uZ,m=tZ(h-f),g=h>f;if(s||(s=c=l()),p<d&&(u=p,p=d,d=u),p>lZ)if(m>dZ-lZ)s.moveTo(p*rZ(f),p*aZ(f)),s.arc(0,0,p,f,h,!g),d>lZ&&(s.moveTo(d*rZ(h),d*aZ(h)),s.arc(0,0,d,h,f,g));else{var y,b,v=f,x=h,w=f,S=h,k=m,C=m,E=a.apply(this,arguments)/2,M=E>lZ&&(r?+r.apply(this,arguments):sZ(d*d+p*p)),R=oZ(tZ(p-d)/2,+n.apply(this,arguments)),_=R,A=R;if(M>lZ){var I=pZ(M/d*aZ(E)),P=pZ(M/p*aZ(E));(k-=2*I)>lZ?(w+=I*=g?1:-1,S-=I):(k=0,w=S=(f+h)/2),(C-=2*P)>lZ?(v+=P*=g?1:-1,x-=P):(C=0,v=x=(f+h)/2)}var T=p*rZ(v),D=p*aZ(v),O=d*rZ(S),N=d*aZ(S);if(R>lZ){var q,L=p*rZ(x),j=p*aZ(x),z=d*rZ(w),F=d*aZ(w);if(m<cZ)if(q=function(e,t,n,r,i,o,a,s){var l=n-e,c=r-t,u=a-i,d=s-o,p=d*l-u*c;if(!(p*p<lZ))return[e+(p=(u*(t-o)-d*(e-i))/p)*l,t+p*c]}(T,D,z,F,L,j,O,N)){var $=T-q[0],B=D-q[1],H=L-q[0],V=j-q[1],W=1/aZ(function(e){return e>1?0:e<-1?cZ:Math.acos(e)}(($*H+B*V)/(sZ($*$+B*B)*sZ(H*H+V*V)))/2),U=sZ(q[0]*q[0]+q[1]*q[1]);_=oZ(R,(d-U)/(W-1)),A=oZ(R,(p-U)/(W+1))}else _=A=0}C>lZ?A>lZ?(y=EZ(z,F,T,D,p,A,g),b=EZ(L,j,O,N,p,A,g),s.moveTo(y.cx+y.x01,y.cy+y.y01),A<R?s.arc(y.cx,y.cy,A,nZ(y.y01,y.x01),nZ(b.y01,b.x01),!g):(s.arc(y.cx,y.cy,A,nZ(y.y01,y.x01),nZ(y.y11,y.x11),!g),s.arc(0,0,p,nZ(y.cy+y.y11,y.cx+y.x11),nZ(b.cy+b.y11,b.cx+b.x11),!g),s.arc(b.cx,b.cy,A,nZ(b.y11,b.x11),nZ(b.y01,b.x01),!g))):(s.moveTo(T,D),s.arc(0,0,p,v,x,!g)):s.moveTo(T,D),d>lZ&&k>lZ?_>lZ?(y=EZ(O,N,L,j,d,-_,g),b=EZ(T,D,z,F,d,-_,g),s.lineTo(y.cx+y.x01,y.cy+y.y01),_<R?s.arc(y.cx,y.cy,_,nZ(y.y01,y.x01),nZ(b.y01,b.x01),!g):(s.arc(y.cx,y.cy,_,nZ(y.y01,y.x01),nZ(y.y11,y.x11),!g),s.arc(0,0,d,nZ(y.cy+y.y11,y.cx+y.x11),nZ(b.cy+b.y11,b.cx+b.x11),g),s.arc(b.cx,b.cy,_,nZ(b.y11,b.x11),nZ(b.y01,b.x01),!g))):s.arc(0,0,d,S,w,g):s.lineTo(O,N)}else s.moveTo(0,0);if(s.closePath(),c)return s=null,c+""||null}return c.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-cZ/2;return[rZ(r)*n,aZ(r)*n]},c.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:eZ(+t),c):e},c.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:eZ(+e),c):t},c.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:eZ(+e),c):n},c.padRadius=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:eZ(+e),c):r},c.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:eZ(+e),c):i},c.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:eZ(+e),c):o},c.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:eZ(+e),c):a},c.context=function(e){return arguments.length?(s=null==e?null:e,c):s},c}function RZ(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function _Z(e){this._context=e}function AZ(e){return new _Z(e)}function IZ(e){return e[0]}function PZ(e){return e[1]}function TZ(e,t,n){var r=null,i=eZ(!0),o=null,a=AZ,s=null,l=vZ(c);function c(c){var u,d,p,f,h,m=(c=RZ(c)).length,g=!1,y=new Array(m),b=new Array(m);for(null==o&&(s=a(h=l())),u=0;u<=m;++u){if(!(u<m&&i(f=c[u],u,c))===g)if(g=!g)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),p=u-1;p>=d;--p)s.point(y[p],b[p]);s.lineEnd(),s.areaEnd()}g&&(y[u]=+e(f,u,c),b[u]=+t(f,u,c),s.point(r?+r(f,u,c):y[u],n?+n(f,u,c):b[u]))}if(h)return s=null,h+""||null}function u(){return function(e,t){var n=eZ(!0),r=null,i=AZ,o=null,a=vZ(s);function s(s){var l,c,u,d=(s=RZ(s)).length,p=!1;for(null==r&&(o=i(u=a())),l=0;l<=d;++l)!(l<d&&n(c=s[l],l,s))===p&&((p=!p)?o.lineStart():o.lineEnd()),p&&o.point(+e(c,l,s),+t(c,l,s));if(u)return o=null,u+""||null}return e="function"==typeof e?e:void 0===e?IZ:eZ(e),t="function"==typeof t?t:void 0===t?PZ:eZ(t),s.x=function(t){return arguments.length?(e="function"==typeof t?t:eZ(+t),s):e},s.y=function(e){return arguments.length?(t="function"==typeof e?e:eZ(+e),s):t},s.defined=function(e){return arguments.length?(n="function"==typeof e?e:eZ(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,null!=r&&(o=i(r)),s):i},s.context=function(e){return arguments.length?(null==e?r=o=null:o=i(r=e),s):r},s}().defined(i).curve(a).context(o)}return e="function"==typeof e?e:void 0===e?IZ:eZ(+e),t="function"==typeof t?t:eZ(void 0===t?0:+t),n="function"==typeof n?n:void 0===n?PZ:eZ(+n),c.x=function(t){return arguments.length?(e="function"==typeof t?t:eZ(+t),r=null,c):e},c.x0=function(t){return arguments.length?(e="function"==typeof t?t:eZ(+t),c):e},c.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:eZ(+e),c):r},c.y=function(e){return arguments.length?(t="function"==typeof e?e:eZ(+e),n=null,c):t},c.y0=function(e){return arguments.length?(t="function"==typeof e?e:eZ(+e),c):t},c.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:eZ(+e),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(e){return arguments.length?(i="function"==typeof e?e:eZ(!!e),c):i},c.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),c):a},c.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),c):o},c}function DZ(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function OZ(e){return e}function NZ(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function qZ(e){this._context=e}function LZ(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function jZ(e,t){this._context=e,this._k=(1-t)/6}_Z.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},qZ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:NZ(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:NZ(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},jZ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:LZ(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:LZ(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var zZ=function e(t){function n(e){return new jZ(e,t)}return n.tension=function(t){return e(+t)},n}(0);function FZ(e,t){this._context=e,this._alpha=t}FZ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>lZ){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>lZ){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var $Z=function e(t){function n(e){return t?new FZ(e,t):new jZ(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function BZ(e){return e<0?-1:1}function HZ(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(BZ(o)+BZ(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function VZ(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function WZ(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function UZ(e){this._context=e}function GZ(e){this._context=new YZ(e)}function YZ(e){this._context=e}function KZ(e){this._context=e}function XZ(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/o[t-1],o[t]-=n,a[t]-=n*a[t-1];for(i[r-1]=a[r-1]/o[r-1],t=r-2;t>=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function JZ(e,t){this._context=e,this._t=t}function QZ(e,t){if((i=e.length)>1)for(var n,r,i,o=1,a=e[t[0]],s=a.length;o<i;++o)for(r=a,a=e[t[o]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function ZZ(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function e0(e,t){return e[t]}function t0(e){const t=[];return t.key=e,t}function n0(e){for(var t,n=-1,r=0,i=e.length,o=-1/0;++n<i;)(t=+e[n][1])>o&&(o=t,r=n);return r}function r0(e){for(var t,n=0,r=-1,i=e.length;++r<i;)(t=+e[r][1])&&(n+=t);return n}function i0(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",r=arguments.length>2?arguments[2]:void 0;const i={},o=e||{get:()=>{},has:()=>!1,default:()=>{}};function a(e,t){if(!e||"string"!=typeof e)throw new TypeError("Invalid argument: key must be a non-empty string");return!(e in i)&&(i[e]=t,!0)}function s(e){return i[e]||o.get(e)}function l(e,i){if(void 0!==i)return a(e,i);const o=s(e);return r&&void 0===o&&r.warn("".concat(e," does not exist in ").concat(n," registry")),o||s(t)}return t=o.default(),l.add=a,l.get=s,l.has=function(e){return!!i[e]||o.has(e)},l.remove=function(e){const t=i[e];return delete i[e],t},l.getKeys=function(){return Object.keys(i)},l.getValues=function(){return Object.keys(i).map(e=>i[e])},l.default=function(e){return void 0!==e&&(t=e),t},l.register=a,l}function o0(e,t){if(!isFinite(e)||0===e)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function a0(e){return(e=o0(Math.abs(e)))?e[1]:NaN}UZ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:WZ(this,this._t0,VZ(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,WZ(this,VZ(this,n=HZ(this,e,t)),n);break;default:WZ(this,this._t0,n=HZ(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(GZ.prototype=Object.create(UZ.prototype)).point=function(e,t){UZ.prototype.point.call(this,t,e)},YZ.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}},KZ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=XZ(e),i=XZ(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[a],t[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},JZ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var s0,l0=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function c0(e){if(!(t=l0.exec(e)))throw new Error("invalid format: "+e);var t;return new u0({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function u0(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function d0(e,t){var n=o0(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}c0.prototype=u0.prototype,u0.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var p0={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>d0(100*e,t),r:d0,s:function(e,t){var n=o0(e,t);if(!n)return s0=void 0,e.toPrecision(t);var r=n[0],i=n[1],o=i-(s0=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+o0(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function f0(e){return e}var h0,m0,g0,y0=Array.prototype.map,b0=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function v0(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?f0:(t=y0.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?f0:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(y0.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function d(e,t){var n=(e=c0(e)).fill,d=e.align,p=e.sign,f=e.symbol,h=e.zero,m=e.width,g=e.comma,y=e.precision,b=e.trim,v=e.type;"n"===v?(g=!0,v="g"):p0[v]||(void 0===y&&(y=12),b=!0,v="g"),(h||"0"===n&&"="===d)&&(h=!0,n="0",d="=");var x=(t&&void 0!==t.prefix?t.prefix:"")+("$"===f?i:"#"===f&&/[boxX]/.test(v)?"0"+v.toLowerCase():""),w=("$"===f?o:/[%p]/.test(v)?l:"")+(t&&void 0!==t.suffix?t.suffix:""),S=p0[v],k=/[defgprs%]/.test(v);function C(e){var t,i,o,l=x,f=w;if("c"===v)f=S(e)+f,e="";else{var C=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:S(Math.abs(e),y),b&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),C&&0===+e&&"+"!==p&&(C=!1),l=(C?"("===p?p:c:"-"===p||"("===p?"":p)+l,f=("s"!==v||isNaN(e)||void 0===s0?"":b0[8+s0/3])+f+(C&&"("===p?")":""),k)for(t=-1,i=e.length;++t<i;)if(48>(o=e.charCodeAt(t))||o>57){f=(46===o?a+e.slice(t+1):e.slice(t))+f,e=e.slice(0,t);break}}g&&!h&&(e=r(e,1/0));var E=l.length+e.length+f.length,M=E<m?new Array(m-E+1).join(n):"";switch(g&&h&&(e=r(M+e,M.length?m-f.length:1/0),M=""),d){case"<":e=l+e+f+M;break;case"=":e=l+M+e+f;break;case"^":e=M.slice(0,E=M.length>>1)+l+e+f+M.slice(E);break;default:e=M+l+e+f}return s(e)}return y=void 0===y?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),C.toString=function(){return e+""},C}return{format:d,formatPrefix:function(e,t){var n=3*Math.max(-8,Math.min(8,Math.floor(a0(t)/3))),r=Math.pow(10,-n),i=d(((e=c0(e)).type="f",e),{suffix:b0[8+n/3]});return function(e){return i(r*e)}}}}!function(e){h0=v0(e),m0=h0.format,g0=h0.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const x0=new Date,w0=new Date;function S0(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(s<n&&n<r);return a},i.filter=n=>S0(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(x0.setTime(+t),w0.setTime(+r),e(x0),e(w0),Math.floor(n(x0,w0))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i:null)),i}const k0=6e4,C0=864e5,E0=6048e5,M0=S0(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*k0)/C0,e=>e.getDate()-1);M0.range;const R0=S0(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/C0,e=>e.getUTCDate()-1);R0.range;const _0=S0(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/C0,e=>Math.floor(e/C0));function A0(e){return S0(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*k0)/E0)}_0.range;const I0=A0(0),P0=A0(1),T0=A0(2),D0=A0(3),O0=A0(4),N0=A0(5),q0=A0(6);function L0(e){return S0(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/E0)}I0.range,P0.range,T0.range,D0.range,O0.range,N0.range,q0.range;const j0=L0(0),z0=L0(1),F0=L0(2),$0=L0(3),B0=L0(4),H0=L0(5),V0=L0(6);j0.range,z0.range,F0.range,$0.range,B0.range,H0.range,V0.range;const W0=S0(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());W0.every=e=>isFinite(e=Math.floor(e))&&e>0?S0(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null,W0.range;const U0=S0(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());function G0(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Y0(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function K0(e){let t,n,r;function i(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<0?i=t+1:o=t}while(i<o)}return i}return 2!==e.length?(t=G0,n=(t,n)=>G0(e(t),n),r=(t,n)=>e(t)-n):(t=e===G0||e===Y0?e:X0,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<=0?i=t+1:o=t}while(i<o)}return i}}}function X0(){return 0}U0.every=e=>isFinite(e=Math.floor(e))&&e>0?S0(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null,U0.range;const J0=K0(G0).right;K0(function(e){return null===e?NaN:+e}).center;var Q0=J0;class Z0 extends Map{constructor(e,t=t1){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(e1(this,e))}has(e){return super.has(e1(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const r=t(n);e.has(r)&&(n=e.get(r),e.delete(r));return n}(this,e))}}function e1({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function t1(e){return null!==e&&"object"==typeof e?e.valueOf():e}const n1=Math.sqrt(50),r1=Math.sqrt(10),i1=Math.sqrt(2);function o1(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=n1?10:o>=r1?5:o>=i1?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(e*c),l=Math.round(t*c),s/c<e&&++s,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(e/c),l=Math.round(t/c),s*c<e&&++s,l*c>t&&--l),l<s&&.5<=n&&n<2?o1(e,t,2*n):[s,l,c]}function a1(e,t,n){return o1(e=+e,t=+t,n=+n)[2]}function s1(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function l1(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function c1(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function u1(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,c=y1(i),u=b1(i),d=y1(o),p=b1(o),f=y1(a),h=b1(a),m=y1(s),g=b1(s),y=y1(l),b=b1(l),v={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:z1,e:z1,f:V1,g:t2,G:r2,H:F1,I:$1,j:B1,L:H1,m:W1,M:U1,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:M2,s:R2,S:G1,u:Y1,U:K1,V:J1,w:Q1,W:Z1,x:null,X:null,y:e2,Y:n2,Z:i2,"%":E2},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:o2,e:o2,f:u2,g:w2,G:k2,H:a2,I:s2,j:l2,L:c2,m:d2,M:p2,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:M2,s:R2,S:f2,u:h2,U:m2,V:y2,w:b2,W:v2,x:null,X:null,y:x2,Y:S2,Z:C2,"%":E2},w={a:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=b.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return C(e,t,n,r)},d:A1,e:A1,f:N1,g:E1,G:C1,H:P1,I:P1,j:I1,L:O1,m:_1,M:T1,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:R1,Q:L1,s:j1,S:D1,u:x1,U:w1,V:S1,w:v1,W:k1,x:function(e,t,r){return C(e,n,t,r)},X:function(e,t,n){return C(e,r,t,n)},y:E1,Y:C1,Z:M1,"%":q1};function S(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=d1[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function k(e,t){return function(n){var r,i,o=c1(1900,void 0,1);if(C(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(t&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=l1(c1(o.y,0,1))).getUTCDay(),r=i>4||0===i?z0.ceil(r):z0(r),r=R0.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=s1(c1(o.y,0,1))).getDay(),r=i>4||0===i?P0.ceil(r):P0(r),r=M0.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?l1(c1(o.y,0,1)).getUTCDay():s1(c1(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,l1(o)):s1(o)}}function C(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a<s;){if(r>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=w[i in d1?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return v.x=S(n,v),v.X=S(r,v),v.c=S(t,v),x.x=S(n,x),x.X=S(r,x),x.c=S(t,x),{format:function(e){var t=S(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=k(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=k(e+="",!0);return t.toString=function(){return e},t}}}var d1={"-":"",_:" ",0:"0"},p1=/^\s*\d+/,f1=/^%/,h1=/[\\^$*+?|[\]().{}]/g;function m1(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function g1(e){return e.replace(h1,"\\$&")}function y1(e){return new RegExp("^(?:"+e.map(g1).join("|")+")","i")}function b1(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function v1(e,t,n){var r=p1.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function x1(e,t,n){var r=p1.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function w1(e,t,n){var r=p1.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function S1(e,t,n){var r=p1.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function k1(e,t,n){var r=p1.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function C1(e,t,n){var r=p1.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function E1(e,t,n){var r=p1.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function M1(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function R1(e,t,n){var r=p1.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function _1(e,t,n){var r=p1.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function A1(e,t,n){var r=p1.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function I1(e,t,n){var r=p1.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function P1(e,t,n){var r=p1.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function T1(e,t,n){var r=p1.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function D1(e,t,n){var r=p1.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function O1(e,t,n){var r=p1.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function N1(e,t,n){var r=p1.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function q1(e,t,n){var r=f1.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function L1(e,t,n){var r=p1.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function j1(e,t,n){var r=p1.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function z1(e,t){return m1(e.getDate(),t,2)}function F1(e,t){return m1(e.getHours(),t,2)}function $1(e,t){return m1(e.getHours()%12||12,t,2)}function B1(e,t){return m1(1+M0.count(W0(e),e),t,3)}function H1(e,t){return m1(e.getMilliseconds(),t,3)}function V1(e,t){return H1(e,t)+"000"}function W1(e,t){return m1(e.getMonth()+1,t,2)}function U1(e,t){return m1(e.getMinutes(),t,2)}function G1(e,t){return m1(e.getSeconds(),t,2)}function Y1(e){var t=e.getDay();return 0===t?7:t}function K1(e,t){return m1(I0.count(W0(e)-1,e),t,2)}function X1(e){var t=e.getDay();return t>=4||0===t?O0(e):O0.ceil(e)}function J1(e,t){return e=X1(e),m1(O0.count(W0(e),e)+(4===W0(e).getDay()),t,2)}function Q1(e){return e.getDay()}function Z1(e,t){return m1(P0.count(W0(e)-1,e),t,2)}function e2(e,t){return m1(e.getFullYear()%100,t,2)}function t2(e,t){return m1((e=X1(e)).getFullYear()%100,t,2)}function n2(e,t){return m1(e.getFullYear()%1e4,t,4)}function r2(e,t){var n=e.getDay();return m1((e=n>=4||0===n?O0(e):O0.ceil(e)).getFullYear()%1e4,t,4)}function i2(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+m1(t/60|0,"0",2)+m1(t%60,"0",2)}function o2(e,t){return m1(e.getUTCDate(),t,2)}function a2(e,t){return m1(e.getUTCHours(),t,2)}function s2(e,t){return m1(e.getUTCHours()%12||12,t,2)}function l2(e,t){return m1(1+R0.count(U0(e),e),t,3)}function c2(e,t){return m1(e.getUTCMilliseconds(),t,3)}function u2(e,t){return c2(e,t)+"000"}function d2(e,t){return m1(e.getUTCMonth()+1,t,2)}function p2(e,t){return m1(e.getUTCMinutes(),t,2)}function f2(e,t){return m1(e.getUTCSeconds(),t,2)}function h2(e){var t=e.getUTCDay();return 0===t?7:t}function m2(e,t){return m1(j0.count(U0(e)-1,e),t,2)}function g2(e){var t=e.getUTCDay();return t>=4||0===t?B0(e):B0.ceil(e)}function y2(e,t){return e=g2(e),m1(B0.count(U0(e),e)+(4===U0(e).getUTCDay()),t,2)}function b2(e){return e.getUTCDay()}function v2(e,t){return m1(z0.count(U0(e)-1,e),t,2)}function x2(e,t){return m1(e.getUTCFullYear()%100,t,2)}function w2(e,t){return m1((e=g2(e)).getUTCFullYear()%100,t,2)}function S2(e,t){return m1(e.getUTCFullYear()%1e4,t,4)}function k2(e,t){var n=e.getUTCDay();return m1((e=n>=4||0===n?B0(e):B0.ceil(e)).getUTCFullYear()%1e4,t,4)}function C2(){return"+0000"}function E2(){return"%"}function M2(e){return+e}function R2(e){return Math.floor(+e/1e3)}const _2=i0();_2("d3-number",function(e,t,n){let r,i;function o(e){return i(e)}function a(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return r=v0(t),i=r.format(e),this},a(),o.format=function(e,i,o,s){return(o||s)&&(t=o,n=s,a()),r.format(e)(i)},o.pattern=function(t){return t&&(e=t,i=r.format(t)),e},o}),_2("d3-time",function(e){let t=u1({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),n=t.format(e);function r(e){return n(e)}return r.format=function(e,n){return t.format(e)(n)},r.locale=function(){return t=u1(...arguments),n=t.format(e),this},r.parse=function(e,n){return t.parse(e)(n)},r.parsePattern=function(e){return t.parse(e)},r});const A2={id:e=>"".concat(e.source,"/").concat(e.key||e.title),key:e=>String(e.key||e.title),tags:e=>e.tags,min:e=>e.min,max:e=>e.max,type:e=>e.type,title:e=>String(e.title),values:e=>e.values,value:e=>e,label:e=>e,formatter:e=>(e=>{if("function"==typeof e.formatter)return e.formatter();const t=e.formatter||{};return _2(t.type||"d3-number")(t.format||"")})(e)};function I2(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.id,r=void 0===n?A2.id:n,i=t.key,o=void 0===i?A2.key:i,a=t.min,s=void 0===a?A2.min:a,l=t.max,c=void 0===l?A2.max:l,u=t.type,d=void 0===u?A2.type:u,p=t.tags,f=void 0===p?A2.tags:p,h=t.title,m=void 0===h?A2.title:h,g=t.values,y=void 0===g?A2.values:g,b=t.value,v=void 0===b?A2.value:b,x=t.label,w=void 0===x?A2.label:x,S=t.formatter,k=void 0===S?A2.formatter:S;return{id:()=>r(e),key:()=>o(e),raw:()=>e,tags:()=>f(e),type:()=>d(e),min:()=>s(e),max:()=>c(e),title:()=>m(e),items:()=>y(e),formatter:()=>k(e),value:v,label:w}}const P2=e=>e.filter(e=>"number"==typeof e&&!isNaN(e)),T2=e=>e.reduce((e,t)=>e+t,0),D2={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=P2(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=P2(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=P2(e);return t.length?t.reduce((e,t)=>e+t,0):NaN},avg:e=>{const t=P2(e),n=t.length;return n?T2(t)/n:NaN}};function O2(e,t,n,r){const i={},o=r.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach(a=>{const s=n[a],l=i[a]={};-1!==["number","string","boolean"].indexOf(typeof s)?(l.type="primitive",l.value=s):"function"==typeof s?(l.type="function",l.value=s,l.label=s,l.field=o):"object"==typeof s&&(s.fields?l.fields=s.fields.map(n=>O2(e,t,{main:n},r).main):void 0!==s.field?(l.type="field",l.field=t.field(s.field),l.value=l.field.value,l.label=l.field.label):o&&(l.value=o.value,l.label=o.label,l.field=o),"function"==typeof s.filter&&(l.filter=s.filter),void 0!==s.value&&(l.value=s.value),void 0!==s.label&&(l.label=s.label),"function"==typeof s.reduce?l.reduce=s.reduce:s.reduce?l.reduce=D2[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?D2[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=D2[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?D2[l.field.reduceLabel]:l.field.reduceLabel))}),i}function N2(e,t){const n=O2(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{}).main;return{props:O2(e,t,e.props||{},n),main:n}}function q2(e,t,n,r){const i=Array(e.length),o=Array(e.length);let a;for(let t=0;t<e.length;t++)a=r?e[t][r]:e[t],i[t]=a.value,o[t]=a.label;const s=t.reduce,l=t.reduceLabel,c=s?s(i):i,u={value:c,label:l?l(o,c):n?n(c):String(c)};return r&&e[0][r].source?(u.source=e[0][r].source,u):!r&&e[0].source?(u.source=e[0].source,u):u}function L2(e,t){let n=t.main,r=t.propsArr,i=t.props,o=[];const a=n.field.formatter(),s={};return r.forEach(e=>{s[e]=i[e].field?i[e].field.formatter():e=>e}),o.push(...e.map(e=>{const t=q2(e.items,n,a);return r.forEach(n=>{t[n]=q2(e.items,i[n],s[n],n)}),t})),o}function j2(e){let t=e.cfg,n=e.itemData,r=e.obj,i=e.target,o=e.tracker;const a="function"===e.trackType?t.trackBy(n):n[t.trackBy];let s=o[a];s||(s=o[a]={items:[],id:a},i.push(s)),s.items.push(r)}function z2(e){if(e.length<1e4)return Math.max(...e);let t=-1/0;const n=e.length;for(let r=0;r<n;r++)t<e[r]&&(t=e[r]);return t}function F2(e){if(e.length<1e4)return Math.min(...e);let t=1/0;const n=e.length;for(let r=0;r<n;r++)t>e[r]&&(t=e[r]);return t}const $2={diverging:function(e,t){const n=e.length;if(n<=0)return;const r=e[t[0]].length;for(let i=0;i<r;++i){let r=0,o=0;for(let a=0;a<n;++a){const n=e[t[a]][i],s=n[1]-n[0];s>=0?(n[0]=r,r+=s,n[1]=r):s<0?(n[1]=o,o+=s,n[0]=o):n[0]=r}}},none:QZ,silhouette:function(e,t){if((n=e.length)>0){for(var n,r=0,i=e[t[0]],o=i.length;r<o;++r){for(var a=0,s=0;a<n;++a)s+=e[a][r][1]||0;i[r][1]+=i[r][0]=-s/2}QZ(e,t)}},expand:function(e,t){if((r=e.length)>0){for(var n,r,i,o=0,a=e[0].length;o<a;++o){for(i=n=0;n<r;++n)i+=e[n][o][1]||0;if(i)for(n=0;n<r;++n)e[n][o][1]/=i}QZ(e,t)}},wiggle:function(e,t){if((i=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,i,o=0,a=1;a<r;++a){for(var s=0,l=0,c=0;s<i;++s){for(var u=e[t[s]],d=u[a][1]||0,p=(d-(u[a-1][1]||0))/2,f=0;f<s;++f){var h=e[t[f]];p+=(h[a][1]||0)-(h[a-1][1]||0)}l+=d,c+=p*d}n[a-1][1]+=n[a-1][0]=o,l&&(o-=c/l)}n[a-1][1]+=n[a-1][0]=o,QZ(e,t)}}},B2={ascending:function(e){var t=e.map(r0);return ZZ(e).sort(function(e,n){return t[e]-t[n]})},insideout:function(e){var t,n,r=e.length,i=e.map(r0),o=function(e){var t=e.map(n0);return ZZ(e).sort(function(e,n){return t[e]-t[n]})}(e),a=0,s=0,l=[],c=[];for(t=0;t<r;++t)n=o[t],a<s?(a+=i[n],l.push(n)):(s+=i[n],c.push(n));return c.reverse().concat(l)},none:ZZ,reverse:function(e){return ZZ(e).reverse()}};function H2(e,t,n,r){const i=r||e.items,o={},a=t.stackKey,s=t.value,l=t.startProp||"start",c=t.endProp||"end",u=t.offset||"none",d=t.order||"none",p=t.valueRef||"";let f=0,h={};for(let e=0;e<i.length;e++){let t=i[e],n=p?t[p]:null;if(n&&n.source){let e="".concat(n.source.key||"","/").concat(n.source.field);h[e]||(h[e]=n.source)}let r=a(t);o[r]=o[r]||{items:[]},o[r].items.push(t),f=Math.max(f,o[r].items.length)}const m=Array.apply(null,{length:f}).map(Number.call,Number),g=Object.keys(o).map(e=>o[e].items),y=function(){var e=eZ([]),t=ZZ,n=QZ,r=e0;function i(i){var o,a,s=Array.from(e.apply(this,arguments),t0),l=s.length,c=-1;for(const e of i)for(o=0,++c;o<l;++o)(s[o][c]=[0,+r(e,s[o].key,c,i)]).data=e;for(o=0,a=RZ(t(s));o<l;++o)s[a[o]].index=o;return n(s,a),s}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:eZ(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r="function"==typeof e?e:eZ(+e),i):r},i.order=function(e){return arguments.length?(t=null==e?ZZ:"function"==typeof e?e:eZ(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?QZ:e,i):n},i}().keys(m).value((e,t)=>e[t]?s(e[t]):0).order(B2[d]).offset($2[u]);let b=y(g),v=[];for(let e=0;e<b.length;e++){let t=b[e];for(let e=0;e<t.length;e++){let n=t[e],r=t[e].data[t.key];r&&(r[l]={value:n[0]},r[c]={value:n[1]},v.push(n[0],n[1]))}}let x=Object.keys(h).map(e=>{let t=n(h[e].key);return t?t.field(h[e].field):null}).filter(e=>!!e);const w=I2({title:x.map(e=>e.title()).join(", "),min:F2(v),max:z2(v),type:"measure",formatter:x[0]?x[0].formatter:void 0});e.fields.push(w)}function V2(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};const r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).logger;if(Array.isArray(e))n.items=e.map(e=>({value:e,label:String(e)}));else if(e){if("collection"in e)n=BQ({},t.collection(e.collection));else{const i=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),a=e.label||(e=>e);if(e.groupBy||e.mapTo)r.warn('Deprecated "data" configuration',e),n.items=[];else if(e.hierarchy)n.root=i.hierarchy?i.hierarchy(e.hierarchy):null,n.fields=i.fields();else if(e.items)n.items=e.skipNormalize?e.items:e.items.map(e=>({value:o(e),label:String(a(e))}));else if(e.extract){const r=Array.isArray(e.extract)?e.extract:[e.extract];n.items=[];const o=[];r.forEach(e=>{const r=e.source?t.dataset(e.source):i;r&&(n.items=[...n.items,...r.extract(e)],void 0!==e.field&&o.push(r.field(e.field)))}),o.length&&(n.fields=o),e.amend&&Array.isArray(e.amend)&&(n.items=[...n.items,...e.amend])}else if(void 0!==e.field&&i){const t=i.field(e.field);t&&(n.fields||(n.fields=[]),n.fields.push(t),"value"in e||(o=t.value||(e=>e),a=t.label||(e=>e),n.value=o),n.items=t.items().map(t=>({value:o(t),label:String(a(t)),source:{field:e.field}})))}else e.fields&&e.fields.forEach(e=>{const r="object"==typeof e&&e.source?t.dataset(e.source):i;if(!r)return;let o;o="object"==typeof e&&void 0!==e.field?r.field(e.field):r.field(e),o&&(n.fields||(n.fields=[]),n.fields.push(o))});n.items&&e.map&&(n.items=n.items.map(e.map))}e&&e.stack&&(Array.isArray(e.stack.stackByKey)?e.stack.stackByKey.forEach(r=>{const i=n.items.filter(e=>{var t;return(null===(t=e.key)||void 0===t?void 0:t.value)&&e.key.value===r});H2(n,e.stack,t.dataset,i)}):H2(n,e.stack,t.dataset,n.items))}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&n.items&&(n.items=n.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&n.items&&(n.items=n.items.sort(e.sort)),n}function W2(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:V2;if(e.data){const r=i(e.data,t,n);if(r&&r.fields&&r.fields[0])return r.fields[0].formatter()}if(r=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(r)){return n.formatter.get(r)(e.format||"")}throw new Error("Formatter of type '".concat(r,"' was not found"))}function U2(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const G2=Symbol("implicit");function Y2(){var e=new Z0,t=[],n=[],r=G2;function i(i){let o=e.get(i);if(void 0===o){if(r!==G2)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new Z0;for(const r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return Y2(t,n).unknown(r)},U2.apply(i,arguments),i}function K2(){var e,t,n=Y2().unknown(void 0),r=n.domain,i=n.range,o=0,a=1,s=!1,l=0,c=0,u=.5;function d(){var n=r().length,d=a<o,p=d?a:o,f=d?o:a;e=(f-p)/Math.max(1,n-l+2*c),s&&(e=Math.floor(e)),p+=(f-p-e*(n-l))*u,t=e*(1-l),s&&(p=Math.round(p),t=Math.round(t));var h=function(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r<i;)o[r]=e+r*n;return o}(n).map(function(t){return p+e*t});return i(d?h.reverse():h)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),d()):r()},n.range=function(e){return arguments.length?([o,a]=e,o=+o,a=+a,d()):[o,a]},n.rangeRound=function(e){return[o,a]=e,o=+o,a=+a,s=!0,d()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(s=!!e,d()):s},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),d()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),d()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,d()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},n.copy=function(){return K2(r(),[o,a]).round(s).paddingInner(l).paddingOuter(c).align(u)},U2.apply(d(),arguments)}function X2(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function J2(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Q2(){}var Z2=.7,e5=1/Z2,t5="\\s*([+-]?\\d+)\\s*",n5="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",r5="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",i5=/^#([0-9a-f]{3,8})$/,o5=new RegExp(`^rgb\\(${t5},${t5},${t5}\\)$`),a5=new RegExp(`^rgb\\(${r5},${r5},${r5}\\)$`),s5=new RegExp(`^rgba\\(${t5},${t5},${t5},${n5}\\)$`),l5=new RegExp(`^rgba\\(${r5},${r5},${r5},${n5}\\)$`),c5=new RegExp(`^hsl\\(${n5},${r5},${r5}\\)$`),u5=new RegExp(`^hsla\\(${n5},${r5},${r5},${n5}\\)$`),d5={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 p5(){return this.rgb().formatHex()}function f5(){return this.rgb().formatRgb()}function h5(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=i5.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?m5(t):3===n?new b5(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?g5(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?g5(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=o5.exec(e))?new b5(t[1],t[2],t[3],1):(t=a5.exec(e))?new b5(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=s5.exec(e))?g5(t[1],t[2],t[3],t[4]):(t=l5.exec(e))?g5(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=c5.exec(e))?C5(t[1],t[2]/100,t[3]/100,1):(t=u5.exec(e))?C5(t[1],t[2]/100,t[3]/100,t[4]):d5.hasOwnProperty(e)?m5(d5[e]):"transparent"===e?new b5(NaN,NaN,NaN,0):null}function m5(e){return new b5(e>>16&255,e>>8&255,255&e,1)}function g5(e,t,n,r){return r<=0&&(e=t=n=NaN),new b5(e,t,n,r)}function y5(e,t,n,r){return 1===arguments.length?function(e){return e instanceof Q2||(e=h5(e)),e?new b5((e=e.rgb()).r,e.g,e.b,e.opacity):new b5}(e):new b5(e,t,n,null==r?1:r)}function b5(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function v5(){return`#${k5(this.r)}${k5(this.g)}${k5(this.b)}`}function x5(){const e=w5(this.opacity);return`${1===e?"rgb(":"rgba("}${S5(this.r)}, ${S5(this.g)}, ${S5(this.b)}${1===e?")":`, ${e})`}`}function w5(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function S5(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function k5(e){return((e=S5(e))<16?"0":"")+e.toString(16)}function C5(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new M5(e,t,n,r)}function E5(e){if(e instanceof M5)return new M5(e.h,e.s,e.l,e.opacity);if(e instanceof Q2||(e=h5(e)),!e)return new M5;if(e instanceof M5)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new M5(a,s,l,e.opacity)}function M5(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function R5(e){return(e=(e||0)%360)<0?e+360:e}function _5(e){return Math.max(0,Math.min(1,e||0))}function A5(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}X2(Q2,h5,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:p5,formatHex:p5,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return E5(this).formatHsl()},formatRgb:f5,toString:f5}),X2(b5,y5,J2(Q2,{brighter(e){return e=null==e?e5:Math.pow(e5,e),new b5(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Z2:Math.pow(Z2,e),new b5(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new b5(S5(this.r),S5(this.g),S5(this.b),w5(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:v5,formatHex:v5,formatHex8:function(){return`#${k5(this.r)}${k5(this.g)}${k5(this.b)}${k5(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:x5,toString:x5})),X2(M5,function(e,t,n,r){return 1===arguments.length?E5(e):new M5(e,t,n,null==r?1:r)},J2(Q2,{brighter(e){return e=null==e?e5:Math.pow(e5,e),new M5(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Z2:Math.pow(Z2,e),new M5(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new b5(A5(e>=240?e-240:e+120,i,r),A5(e,i,r),A5(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new M5(R5(this.h),_5(this.s),_5(this.l),w5(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=w5(this.opacity);return`${1===e?"hsl(":"hsla("}${R5(this.h)}, ${100*_5(this.s)}%, ${100*_5(this.l)}%${1===e?")":`, ${e})`}`}}));var I5=e=>()=>e;function P5(e){return 1===(e=+e)?T5:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):I5(isNaN(t)?n:t)}}function T5(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):I5(isNaN(e)?t:e)}var D5=function e(t){var n=P5(t);function r(e,t){var r=n((e=y5(e)).r,(t=y5(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=T5(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function O5(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function N5(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=B5(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}function q5(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function L5(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function j5(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=B5(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var z5=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,F5=new RegExp(z5.source,"g");function $5(e,t){var n,r,i,o=z5.lastIndex=F5.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=z5.exec(e))&&(r=F5.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:L5(n,r)})),o=F5.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function B5(e,t){var n,r=typeof t;return null==t||"boolean"===r?I5(t):("number"===r?L5:"string"===r?(n=h5(t))?(t=n,D5):$5:t instanceof h5?D5:t instanceof Date?q5:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?O5:Array.isArray(t)?N5:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?j5:L5)(e,t)}function H5(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function V5(e){return+e}var W5=[0,1];function U5(e){return e}function G5(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function Y5(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=G5(i,r),o=n(a,o)):(r=G5(r,i),o=n(o,a)),function(e){return o(r(e))}}function K5(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=G5(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=Q0(e,t,1,r)-1;return o[n](i[n](t))}}function X5(){var e,t,n,r,i,o,a=W5,s=W5,l=B5,c=U5;function u(){var e=Math.min(a.length,s.length);return c!==U5&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),r=e>2?K5:Y5,i=o=null,d}function d(t){return null==t||isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(c(t)))}return d.invert=function(n){return c(t((o||(o=r(s,a.map(e),L5)))(n)))},d.domain=function(e){return arguments.length?(a=Array.from(e,V5),u()):a.slice()},d.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},d.rangeRound=function(e){return s=Array.from(e),l=H5,u()},d.clamp=function(e){return arguments.length?(c=!!e||U5,u()):c!==U5},d.interpolate=function(e){return arguments.length?(l=e,u()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}function J5(e,t,n,r){var i,o=function(e,t,n){n=+n;const r=(t=+t)<(e=+e),i=r?a1(t,e,n):a1(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}(e,t,n);switch((r=c0(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(a0(t)/3)))-a0(Math.abs(e)))}(o,a))||(r.precision=i),g0(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,a0(t)-a0(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-a0(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return m0(r)}function Q5(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)===(t=+t))return[e];const r=t<e,[i,o,a]=r?o1(t,e,n):o1(e,t,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let e=0;e<s;++e)l[e]=(o-e)/-a;else for(let e=0;e<s;++e)l[e]=(o-e)*a;else if(a<0)for(let e=0;e<s;++e)l[e]=(i+e)/-a;else for(let e=0;e<s;++e)l[e]=(i+e)*a;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return J5(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),a=0,s=o.length-1,l=o[a],c=o[s],u=10;for(c<l&&(i=l,l=c,c=i,i=a,a=s,s=i);u-- >0;){if((i=a1(l,c,n))===r)return o[a]=l,o[s]=c,t(o);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}r=i}return e},e}function Z5(){var e=X5()(U5,U5);return e.copy=function(){return t=e,Z5().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},U2.apply(e,arguments),Q5(e)}function e3(){var e,t=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[Q0(t,i,0,r)]:e}return i.domain=function(e){return arguments.length?(t=Array.from(e),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(e){return arguments.length?(n=Array.from(e),r=Math.min(t.length,n.length-1),i):n.slice()},i.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return e3().domain(t).range(n).unknown(e)},U2.apply(i,arguments)}function t3(e){return void 0===e?e=>e:t=>e(t)}function n3(e){return Math.max(0,Math.min(1,e))}function r3(e){return"object"==typeof e}function i3(e,t,n){const r=Math.abs(t-n)/(e+1),i=[];for(let o=1;o<=e;o++){const e=o*r;i.push(t<n?t+e:t-e)}return i}function o3(e,t,n){if(1===e.length)return e;const r=e.concat([]);for(let i=0;i<e.length;i++){let o=e[i],a=e[i+1];0===i&&o!==n.start()?(r.push(...i3(t,o,a)),o-=a-o,a=e[i],r.push(...i3(t,o,a))):i===e.length-1&&a!==n.end()?(a=o+(o-e[i-1]),r.push(...i3(t,o,a))):r.push(...i3(t,o,a))}return r.filter(e=>e>=n.min()&&e<=n.max())}function a3(e){let t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,a=void 0===o?100:o,s=e.formatter,l=void 0===s?void 0:s;const c=UQ(a)||UQ(t)?2:Math.max(t/a,2),u=Math.min(1e3,Math.round(c));let d=n.ticks(u);d.length<=1&&(d=n.ticks(u+1));const p=i>0?o3(d,i,n):d;p.sort((e,t)=>e-t);const f=p.map(t3(l));return p.map((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:f[t],value:e,isMinor:-1===d.indexOf(e)}})}function s3(e){let t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,a=void 0===o?100:o,s=e.formatter,l=void 0===s?void 0:s;const c=UQ(a)||UQ(t)?2:Math.max(t/a,2),u=Math.min(1e3,Math.round(c)),d=u>10?10:u;n.nice(d);const p=n.ticks(u),f=i>0?o3(p,i,n):p;f.sort((e,t)=>e-t);const h=f.map(t3(l));return f.map((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:h[t],value:e,isMinor:-1===p.indexOf(e)}})}function l3(e){let t,n=e.settings,r=e.scale,i=e.distance,o=e.formatter,a=void 0===o?e=>e:o;const s=n.minorTicks&&!UQ(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const e=n.ticks.values.filter(e=>"object"==typeof e?!UQ(e.value):!UQ(e));t=function(e){let t=e.values,n=e.scale,r=e.formatter,i=void 0===r?e=>e:r;return t.sort((e,t)=>(r3(e)?e.value:e)-(r3(t)?t.value:t)).filter((e,t,r)=>{const i=r3(e)?e.value:e;return i<=n.max()&&i>=n.min()&&r.indexOf(e)===t}).map(e=>{const t=r3(e),r=t?e.value:e,o=n(r);return{position:o,value:r,label:t&&void 0!==e.label?e.label:i(r),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?n3(n(e.start)):o,end:t&&!isNaN(e.end)?n3(n(e.end)):o}})}({values:e,scale:r.copy(),formatter:a})}else if(UQ(n.ticks.count)){t=(n.ticks.tight?s3:a3)({distance:i,minorCount:s,unitDivider:n.ticks.distance,scale:r,formatter:a}),n.ticks.forceBounds&&function(e,t,n){const r=e.map(e=>e.position),i=t.range();-1===r.indexOf(i[0])?e.splice(0,0,{position:i[0],start:i[0],end:i[0],label:n(t.start()),isMinor:!1,value:t.start()}):e[0]&&e[0].isMinor&&(e[0].isMinor=!1);const o=e[e.length-1];-1===r.indexOf(i[1])?e.push({position:i[1],start:i[1],end:i[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,r,a)}else{t=function(e){let t=e.count,n=e.minorCount,r=e.scale,i=e.formatter;return r.ticks((t-1)*n+t).map((e,t)=>{const o=r(e);return{position:o,start:o,end:o,label:i(e),isMinor:t%(n+1)!==0,value:e}})}({count:Math.min(1e3,n.ticks.count),minorCount:s,scale:r.copy(),formatter:a})}return t}function c3(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={};return Object.keys(t).forEach(i=>{const o=typeof e[i];r[i]="function"===o?e[i](n):"undefined"===o?t[i]:e[i]}),r}const u3={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},d3={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},p3={count:NaN};function f3(e,t){e.instance||(e.instance=t.copy(),e.instance.domain([t.start(),t.end()]),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}function h3(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Z5(),i={instance:null,invert:!1},o={data:t,resources:n},a=c3(e,u3,o);let s;function l(e){return UQ(e)?NaN:r(e)}a.ticks=c3(e.ticks,d3,o),a.minorTicks=c3(e.minorTicks,p3,o),l.data=()=>t,l.invert=function(e){return r.invert(e)},l.rangeRound=function(e){return r.rangeRound(e),l},l.clamp=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return r.clamp(e),l},l.cachedTicks=function(){return s},l.clearTicksCache=function(){return s=void 0,this},l.ticks=function(e){return null!==e&&"object"==typeof e?(e.settings=e.settings||{},e.settings=LQ(!0,{},a,e.settings),e.scale=l,s=l3(e),s):(s=r.ticks(e),s)},l.nice=function(e){return r.nice(e),l},l.tickFormat=function(e,t){return r.tickFormat(e,t)},l.interpolate=function(e){return r.interpolate(e),l},l.domain=function(e){return arguments.length?(r.domain(e),i.instance&&i.instance.domain([l.start(),l.end()]),l):r.domain()},l.range=function(e){return arguments.length?(r.range(e),l):r.range()},l.start=function(){return l.domain()[0]},l.end=function(){return l.domain()[this.domain().length-1]},l.min=function(){return Math.min(this.start(),this.end())},l.max=function(){return Math.max(this.start(),this.end())},l.classify=function(e){let t=(l.start()-l.end())/e,n=[l.end()],r=[],i=t/2;for(let o=0;o<e;o++){let e=n[n.length-1]||0,o=e+t,a=l(e+i);n.push(o,o),r.push(a,a)}return n.pop(),l.domain(n),l.range(r),l},l.copy=function(){const i=h3(e,t,n);return i.domain(l.domain()),i.range(l.range()),i.clamp(r.clamp()),i},l.norm=function(e){return f3(i,l),i.instance(e)},l.normInvert=function(e){return f3(i,l),i.instance.invert(e)};const c=function(e,t){const n=+e.min,r=+e.max;let i=0,o=1;if(t&&t[0]){const n=t.map(e=>e.min()).filter(e=>!isNaN(e)),r=t.map(e=>e.max()).filter(e=>!isNaN(e));if(i=n.length?Math.min(...n):Number.NaN,o=r.length?Math.max(...r):Number.NaN,isNaN(i)||isNaN(o))i=-1,o=1;else if(i===o&&0===i)i=-1,o=1;else if(i===o&&i)i-=Math.abs(.1*i),o+=Math.abs(.1*o);else if(!isNaN(e.expand)){const t=o-i;i-=t*e.expand,o+=t*e.expand}if(Array.isArray(e.include)){const t=e.include.filter(e=>!isNaN(e));i=Math.min(...t,i),o=Math.max(...t,o)}}return{mini:isNaN(n)?i:n,maxi:isNaN(r)?o:r}}(a,t?t.fields:[]),u=c.mini,d=c.maxi;return l.domain([u,d]),l.range(a.invert?[1,0]:[0,1]),i.invert=a.invert,l}const m3={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function g3(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={data:t,resources:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}},r=c3(e,m3,n),i=t.items||[],o={},a=[],s=[];function l(e,n){e.data=()=>t,e.datum=e=>i[o[e]],e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=()=>s,e.ticks=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,function(e){let t=e.scale;const n=t.domain(),r=t.data().items,i=t.labels?t.labels():n,o=t.bandwidth();return n.map((e,n)=>{const a=t(e);return{position:a+o/2,label:"".concat(i[n]),data:r?r[n]:void 0,start:a,end:a+o}})}(t,n.trackBy)}}const c=K2();l(c,e),c.pxScale=function(t){const n=r.maxPxStep;if(isNaN(n))return c;const i=c.domain().length,o=Math.max(1,i-c.paddingInner()+2*c.paddingOuter());if(o*n>=t)return c;const a=c.copy();a.type=c.type,l(a,e);const s=o*n/t,u=(1-s)*c.align();return a.range(r.invert?[s+u,u]:[u,s+u]),a};const u="function"==typeof e.value?e.value:e=>e.datum.value,d="function"==typeof e.label?e.label:e=>e.datum.label;for(let e=0;e<i.length;e++){const t=LQ({datum:i[e]},n),r=u(t,e);-1===a.indexOf(r)&&(a.push(r),s.push(d(t,e)),o[r]=e)}return c.domain(a),c.range(r.invert?r.range.slice().reverse():r.range),c.padding(isNaN(r.padding)?0:r.padding),isNaN(r.paddingInner)||c.paddingInner(r.paddingInner),isNaN(r.paddingOuter)||c.paddingOuter(r.paddingOuter),c.align(isNaN(r.align)?.5:r.align),c}const y3={depth:0};function b3(e,t,n){return e.ancestors().map(e=>t(LQ({datum:e.data},n))).reverse().slice(1).toString()}const v3=e=>e.min(),x3=e=>e.max();function w3(e,t){const n=e&&!isNaN(e.min),r=e&&!isNaN(e.max);let i=n?+e.min:0,o=r?+e.max:1;if(t&&t.length){if(!n){const e=t.map(v3).filter(WQ);i=e.length?Math.min(...e):i}if(!r){const e=t.map(x3).filter(WQ);o=e.length?Math.max(...e):o}}return[i,o]}const S3={domain:[],range:[],invert:!1,min:NaN,max:NaN};function k3(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=h3(e,t,n).clamp(!0).interpolate(D5),i=c3(e,S3,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length,s=r;LQ(!0,s,r);const l=HQ(w3(i,t?t.fields:[]),2),c=l[0],u=l[1],d=o?i.domain.length:-1,p=n.theme?n.theme.palette("sequential",d>0?d:2):[],f=a?i.range:p;return s.range(i.invert?f.slice().reverse():f.slice()),s.domain(o?i.domain:function(e,t,n){const r=e.length;if(2===r)return[t,n];const i=[],o=(n-t)/(r-1);i.push(t);for(let e=1;e<r-1;e++)i.push(t+o*e);return i.push(n),i}(s.range(),c,u)),s}const C3={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function E3(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}const M3={domain:[],range:[]};const R3={domain:[],range:[],unknown:void 0},_3={domain:[],range:[],override:!1};const A3=i0();function I3(e,t,n){let r=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),r={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach(e=>{r.extract.push({field:e})}));const i=V2(r,t,n);let o,a=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?function(e){const t=e.map(e=>"dimension"===e.type()?"band":"linear");return-1!==t.indexOf("linear")?"linear":"band"}(e.fields):"linear"}(i);return"color"===a&&(a=i.fields&&i.fields[0]&&"dimension"===i.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(a)&&(o=n.scale.get(a),o=o(e,i,{theme:n.theme,logger:n.logger}),o.type=a),o}A3("linear",h3),A3("band",g3),A3("h-band",function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={data:n,resources:r},o=c3(t,m3,i);o.ticks=c3(t.ticks,y3,i),o.value="function"==typeof t.value?t.value:e=>e.datum.value,o.label="function"==typeof t.label?t.label:e=>e.datum.value;let a=g3(o);const s=function(e,t,n){const r=t.ticks.depth,i=t.value,o=t.label,a=[],s=[],l={},c=[];let u=0;if(!e)return{values:a,labels:s,items:l,ticks:c};e.eachAfter(e=>{if(e.depth>0){const t=b3(e,i,n),d=e.leaves()||[e],p=i(LQ({datum:e.data},n)),f=o(LQ({datum:e.data},n)),h=Array.isArray(e.children),m={key:t,count:d.length,value:p,label:f,leftEdge:b3(d[0],i,n),rightEdge:b3(d[Math.max(d.length-1,0)],i,n),node:e};h?(a.push("SPACER_".concat(u,"_SPACER")),u++):(a.push(t),s.push(f)),(r<=0&&!h||e.depth===r)&&c.push(m),l[t]=m}});const d=e.height-1;return d>0&&a.splice(-d),{values:a,labels:s,items:l,ticks:c}}(n.root,o,i),l=s.values,c=s.labels,u=s.items,d=s.ticks,p=function(e){const t=String(e),n=u[t];return a(n?o.invert?n.rightEdge:n.leftEdge:t)};LQ(!0,p,a),p.bandwidth=function(e){const t=u[String(e)],n=a.bandwidth();if(t&&!t.isLeaf){const e=p(t.leftEdge),r=p(t.rightEdge);return Math.abs(e-r)+n}return n},p.step=function(e){const t=u[String(e)],n=t?t.count:1;let r=a.step();return r*=n,r},p.data=()=>n,p.datum=e=>{const t=u[String(e)];return t?t.node.data:null},p.copy=()=>e(t,n,r),p.labels=()=>c,p.ticks=()=>d.map(e=>{const t=p(e.key),n=p.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}});const f=a.pxScale;return p.pxScale=function(e){return a=f(e),p},p.domain(l),p}),A3("sequential-color",k3),A3("threshold-color",function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=e3(),i=c3(e,C3,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length;function s(e){return UQ(e)?NaN:r(e)}Object.keys(r).forEach(e=>s[e]=r[e]);const l=HQ(w3(i,t.fields),2),c=l[0],u=l[1],d=o?i.domain.length:-1,p=n.theme?n.theme.palette("sequential",d>0?d:2):[];let f=a?i.range:p,h=[];return h=o?i.domain:i.nice?function(e,t,n){const r=2===e.length?10:Math.max(1,e.length),i=Z5().domain([t,n]).nice(r).ticks(r);if(!e||!e.length)return i;const o=Math.max(0,e.length-1);for(;i.length>o;)i[0]-t<=n-i[i.length-1]?i.shift():i.pop();return i}(f,c,u):[c+(u-c)/2],f.length>h.length+1?h=function(e,t,n){const r=e.length;if(2===r)return[t+(n-t)/2];const i=[],o=(n-t)/r;for(let e=1;e<r;e++)i.push(t+o*e);return i}(f,c,u):f.length<h.length+1&&(f=function(e,t,n,r){n=e[0],r=e&&e.length>=2?e[e.length-1]:r;const i=k3().domain([n,r]).range(t);return[n,...E3(e),r].map(e=>i(e))}(h,f,c,u)),s.data=()=>t,s.range(i.invert?f.slice().reverse():f),s.domain(h),s}),A3("categorical-color",function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Y2(),i={data:t,resources:n},o=c3(e,M3,i),a="function"==typeof e.value?e.value:e=>e.datum.value,s="function"==typeof e.label?e.label:e=>e.datum.label,l=t.items||[],c={},u=[],d=[];for(let e=0;e<l.length;e++){const t=LQ({datum:l[e]},i),n=a(t,e);-1===u.indexOf(n)&&(u.push(n),d.push(s(t,e)),c[n]=e)}return r.data=()=>t,r.labels=()=>d,r.label=e=>d[u.indexOf(e)],r.datum=e=>l[c[e]],r.range(o.range),Array.isArray(o.domain)&&o.domain.length?r.domain(o.domain):r.domain(u),r}(e,t,n),i=n.theme,o=c3(e,R3,{data:t,resources:n});let a;if(o.explicit=c3(e.explicit,_3,{data:t,resources:n}),a=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():i?i.palette("categorical",r.domain().length).slice():[],o.unknown)r.unknown(o.unknown);else if(i&&i.palette("unknown")){let e=i.palette("unknown");r.unknown(e[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const e=r.domain().slice(),t=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],i=Math.floor(e.length/a.length);for(let e=1;e<i+1;e*=2)a=a.concat(a);if(o.explicit.override)for(let r=0;r<t.length;r++){const i=e.indexOf(t[r]);i>-1&&(a[i]=n[r])}else{const r=t.map((t,r)=>[e.indexOf(t),t,n[r]]).sort((e,t)=>e[0]-t[0]);r.forEach(t=>{const n=e.indexOf(t[1]);-1!==n&&a.splice(n,0,t[2])})}a.length=e.length}return r.range(a),r});var P3={};function T3(){T3.init.call(this)}P3.isObject=function(e){return"object"==typeof e&&null!==e},P3.isNumber=function(e){return"number"==typeof e},P3.isUndefined=function(e){return void 0===e},P3.isFunction=function(e){return"function"==typeof e};var D3=T3;T3.EventEmitter=T3,T3.prototype._events=void 0,T3.prototype._maxListeners=void 0,T3.defaultMaxListeners=10,T3.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},T3.prototype.setMaxListeners=function(e){if(!P3.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},T3.prototype.emit=function(e){var t,n,r,i,o,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],P3.isUndefined(n))return!1;if(P3.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(P3.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(a=n.slice()).length,o=0;o<r;o++)a[o].apply(this,i)}return!0},T3.prototype.addListener=function(e,t){var n;if(!P3.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,P3.isFunction(t.listener)?t.listener:t),this._events[e]?P3.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,P3.isObject(this._events[e])&&!this._events[e].warned)&&((n=P3.isUndefined(this._maxListeners)?T3.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,P3.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),P3.isFunction(console.trace)&&console.trace()));return this},T3.prototype.on=T3.prototype.addListener,T3.prototype.once=function(e,t){if(!P3.isFunction(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},T3.prototype.removeListener=function(e,t){var n,r,i,o;if(!P3.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||P3.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(P3.isObject(n)){for(o=i;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},T3.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],P3.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},T3.prototype.listeners=function(e){return this._events&&this._events[e]?P3.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},T3.listenerCount=function(e,t){return e._events&&e._events[t]?P3.isFunction(e._events[t])?1:e._events[t].length:0};var O3={mixin:e=>(Object.keys(D3.prototype).forEach(t=>{e[t]=D3.prototype[t]}),D3.init(e),e)};function N3(){let e=0,t=0,n=0,r=0;n=n||e;const i={move(e){this.moveTo(n+e)},moveTo(o){const a=Math.max(e,Math.min(t-r,o));n!==a&&(n=a,i.emit("update"))},update(o){let a=!1;var s=o.min;e=void 0===s?e:s;var l=o.max;t=void 0===l?t:l,void 0!==o.viewSize&&o.viewSize!==r&&(r=o.viewSize,a=!0);const c=Math.max(e,Math.min(t-r,n));n!==c&&(n=c,a=!0),a&&i.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:r})};return O3.mixin(i),i}function q3(e,t){const n=e.min||0,r=e.max||0,i=e.viewSize||0,o=t||N3();return o.update({min:n,max:r,viewSize:i}),o}function L3(e,t){return e<=t}function j3(e,t){return e<t}function z3(e,t,n){let r=0;for(;r<e.length&&t>e[r];)++r;return e[r]===t&&n&&++r,r}function F3(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=[];function i(){}return i.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=n.includeMax,i=void 0===r||r,o=n.includeMin;e=i?L3:j3,t=void 0===o||o?L3:j3},i.add=e=>{let t=e.min,n=e.max;const i=z3(r,t),o=z3(r,n,!0),a=[i,o-i];i%2==0&&a.push(t),o%2==0&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.remove=e=>{let t=e.min,n=e.max;const i=z3(r,t),o=z3(r,n,!0),a=[i,o-i];i%2==1&&a.push(t),o%2==1&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.set=e=>{const t=r.join(",");r=[],Array.isArray(e)?e.forEach(i.add):i.add(e);return t!==r.join(",")},i.clear=()=>{const e=r.length>0;return r=[],e},i.containsValue=n=>function(e,t,n,r){const i=e.length;for(let o=1;o<i;o+=2)if(n(e[o-1],t)&&r(t,e[o]))return!0;return!1}(r,n,t,e),i.containsRange=e=>{let t=e.min,n=e.max;const i=z3(r,t,!0),o=z3(r,n);return i===o&&o%2==1},i.toggle=e=>i.containsRange(e)?i.remove(e):i.add(e),i.ranges=()=>{const e=[];for(let t=1;t<r.length;t+=2)e.push({min:r[t-1],max:r[t]});return e},i.configure(n),i}function $3(){let e=[];function t(){}return t.add=t=>-1===e.indexOf(t)&&(e.push(t),!0),t.remove=t=>{const n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=t=>-1!==e.indexOf(t),t.values=()=>e.slice(),t.clear=()=>e=[],t.toString=()=>e.join(";"),t}const B3={key:void 0,includeMin:!0,includeMax:!0};function H3(e){let t=e.items,n=e.collection,r=e.vc;const i={},o=[];let a,s;for(let e=0,o=t.length;e<o;e++){a=t[e].key,n[a]||(n[a]=r()),s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[a].add(s[e])&&(i[a]=i[a]||[],i[a].push(s[e]))}const l=Object.keys(i);for(let e=0,t=l.length;e<t;e++)a=l[e],o.push({id:a,values:i[a]});return o}function V3(e){let t=e.items,n=e.collection;const r={},i=[];let o,a;for(let e=0,i=t.length;e<i;e++)if(o=t[e].key,n[o]){a=t[e].values||[t[e].value];for(let e=0;e<a.length;e++)n[o].remove(a[e])&&(r[o]=r[o]||[],r[o].push(a[e]))}const s=Object.keys(r);for(let e=0,t=s.length;e<t;e++)o=s[e],i.push({id:o,values:r[o]});return i}function W3(e){const t={};let n,r;for(let i=0,o=e.length;i<o;i++){n=e[i].key,r=e[i].values||[e[i].value],t[n]||(t[n]=[]);for(let e=0;e<r.length;e++){-1===t[n].indexOf(r[e])&&t[n].push(r[e])}}return t}function U3(e){let t=e.key,n=e.collection,r=e.obj,i=e.fn,o=e.value;n[t]||(n[t]=i()),r[t]=r[t]||[],r[t].push(o),n[t].add(o)}function G3(e,t){const n=[],r=Object.keys(e);let i,o;const a=e=>-1===t[i].indexOf(e);for(let s=0,l=r.length;s<l;s++)i=r[s],t[i]?(o=e[i].filter(a),o.length&&n.push({id:i,values:o})):n.push({id:i,values:e[i]});return n}function Y3(e,t,n){const r=function(e,t){if(!Object.keys(t).length)return e;const n=e.length,r=Array(n);for(let i=0;i<n;i++)r[i]=e[i].key in t?LQ({},e[i],{key:t[e[i].key]}):e[i];return r}(t,n);return e&&e.length?e.reduce((e,t)=>t(e),r):r}function K3(e){return e.replace(/(-[a-z])/g,e=>e.toUpperCase().replace("-",""))}function X3(e){return e.replace(/([A-Z])/g,e=>"-".concat(e.toLowerCase()))}function J3(e,t,n){let r=n.ranges,i=n.interceptors,o=n.rc,a=n.aliases,s=n.rangeConfig;const l=Y3(i["".concat(t,"Ranges")],e,a);let c=!1;return l.forEach(e=>{const n=e.key;if(r[n]||(r[n]=o(s.sources[n]||s.default)),"set"===t)c=r[n][t](e.ranges||e.range)||c;else{const i=e.ranges||[e.range];for(let e=0;e<i.length;e++)c=r[n][t](i[e])||c}}),c}function Q3(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vc,n=void 0===t?$3:t,r=e.rc,i=void 0===r?F3:r,o=!1,a={},s={},l={},c={sources:{},default:LQ({},B3)};const u={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},d=()=>{const e={values:{},ranges:{}};return Object.keys(s).forEach(t=>{e.values[t]=s[t].values()}),Object.keys(a).forEach(t=>{e.ranges[t]=a[t].ranges()}),e},p={ls:[],clear(){this.ls.forEach(e=>e.clear())},start(){this.ls.forEach(e=>e.start())},end(){this.ls.forEach(e=>e.end())},update(){const e=d();this.ls.forEach(t=>t._state(e))},updateValues(){const e=d();this.ls.forEach(t=>t._state({values:e.values}))},updateRanges(){const e=d();this.ls.forEach(t=>t._state({ranges:e.ranges}))}},f={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(c={sources:{},default:LQ({},B3)},e.ranges.forEach(e=>{const t={};Object.keys(B3).filter(e=>"key"!==e).forEach(n=>{t[n]=void 0!==e[n]?e[n]:B3[n]}),void 0!==e.key?c.sources[e.key]=t:c.default=t}),Object.keys(a).forEach(e=>a[e].configure(c.sources[e]||c.default)),f.emit("update",[],[]))},link:e=>{if(f===e)throw new Error("Can't link to self");p.ls.push(e),e._state(d())},_state:e=>{if(!e)return d();if(e.values){const t=[];Object.keys(e.values).forEach(n=>{s[n]&&e.values[n].join(";")===s[n].toString()||t.push({key:n,values:e.values[n]})}),Object.keys(s).forEach(n=>{e.values[n]||t.push({key:n,values:[]})}),t.length&&f.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach(n=>{a[n]&&e.ranges[n].join(";")===a[n].toString()||t.push({key:n,ranges:e.ranges[n]})}),Object.keys(a).forEach(n=>{e.ranges[n]||t.push({key:n,ranges:[]})}),t.length&&f.setRanges(t)}},start:function(){if(!o){o=!0;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];f.emit("start",...t),p.start()}},end:function(){if(o){o=!1,a={},s={};for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];f.emit("end",...t),p.end()}},isActive:()=>o,clear:()=>{const e=f.brushes().filter(e=>"value"===e.type&&e.brush.values().length).map(e=>({id:e.id,values:e.brush.values()})),t=Object.keys(a).length>0||e.length;a={},s={},t&&(f.emit("update",[],e),p.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(a).map(e=>({type:"range",id:e,brush:a[e]}))),e=e.concat(Object.keys(s).map(e=>({type:"value",id:e,brush:s[e]}))),e},addValue:(e,t)=>{f.addValues([{key:e,value:t}])},addValues:e=>{const t=Y3(u.addValues,e,l),r=H3({vc:n,collection:s,items:t});f.emit("add-values",t),r.length&&(o||(o=!0,f.emit("start")),f.emit("update",r,[]),p.updateValues())}};return f.setValues=e=>{const t=Y3(u.setValues,e,l),r=function(e){let t=e.items,n=e.vCollection,r=e.vc;const i={},o=W3(t);let a,s=[],l=[];const c={},u=Object.keys(n);for(let e=0,t=u.length;e<t;e++)a=u[e],c[a]=n[a].values().slice(),delete n[a];const d=e=>{n[a]&&n[a].contains(e)||U3({key:a,value:e,collection:n,obj:i,fn:r})},p=Object.keys(o);for(let e=0,t=p.length;e<t;e++)a=p[e],o[a].forEach(d);return l=G3(c,i),s=G3(i,c),[s,l]}({items:t,vCollection:s,vc:n});f.emit("set-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,f.emit("start")),f.emit("update",r[0],r[1]),p.updateValues())},f.removeValue=(e,t)=>{f.removeValues([{key:e,value:t}])},f.removeValues=e=>{const t=Y3(u.removeValues,e,l),n=V3({collection:s,items:t});f.emit("remove-values",t),n.length&&(f.emit("update",[],n),p.updateValues())},f.addAndRemoveValues=(e,t)=>{const r=Y3(u.addValues,e,l),i=Y3(u.removeValues,t,l),a=H3({vc:n,collection:s,items:r}),c=V3({collection:s,items:i});f.emit("add-values",r),f.emit("remove-values",i),(a.length||c.length)&&(o||(o=!0,f.emit("start")),f.emit("update",a,c),p.updateValues())},f.toggleValue=(e,t)=>{f.toggleValues([{key:e,value:t}])},f.toggleValues=e=>{const t=Y3(u.toggleValues,e,l),r=function(e){let t=e.items,n=e.values,r=e.vc;const i={},o={},a=[],s=[],l=W3(t);let c,u,d;const p=Object.keys(l);for(let e=0,t=p.length;e<t;e++){c=p[e],d=l[c];for(let e=0,t=d.length;e<t;e++)u=d[e],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):U3({key:c,value:u,collection:n,obj:i,fn:r})}const f=Object.keys(i);for(let e=0,t=f.length;e<t;e++)c=f[e],a.push({id:c,values:i[c]});const h=Object.keys(o);for(let e=0,t=h.length;e<t;e++)c=h[e],s.push({id:c,values:o[c]});return[a,s]}({items:t,values:s,vc:n});f.emit("toggle-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,f.emit("start")),f.emit("update",r[0],r[1]),p.updateValues())},f.containsValue=(e,t)=>{let n=l[e]||e;return!!s[n]&&s[n].contains(t)},f.addRange=(e,t)=>{f.addRanges([{key:e,range:t}])},f.addRanges=e=>{J3(e,"add",{ranges:a,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,f.emit("start")),f.emit("update",[],[]),p.updateRanges())},f.removeRange=(e,t)=>{f.removeRanges([{key:e,range:t}])},f.removeRanges=e=>{J3(e,"remove",{ranges:a,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,f.emit("start")),f.emit("update",[],[]),p.updateRanges())},f.setRange=(e,t)=>{f.setRanges([{key:e,range:t}])},f.setRanges=e=>{J3(e,"set",{ranges:a,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,f.emit("start")),f.emit("update",[],[]),p.updateRanges())},f.toggleRange=(e,t)=>{f.toggleRanges([{key:e,range:t}])},f.toggleRanges=e=>{J3(e,"toggle",{ranges:a,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,f.emit("start")),f.emit("update",[],[]),p.updateRanges())},f.containsRangeValue=(e,t)=>{let n=l[e]||e;return!!a[n]&&a[n].containsValue(t)},f.containsRange=(e,t)=>{let n=l[e]||e;return!!a[n]&&a[n].containsRange(t)},f.containsMappedData=(e,t,n)=>{let r=[];const i=Object.keys(e);let o,c,u,d;for(let t=0,n=i.length;t<n;t++){if(o=i[t],"value"===o)c=e,r[t]={key:"",i:t,bool:!1};else{if("source"===o)continue;c=e[o],r[t]={key:o,i:t,bool:!1}}u=c.source&&c.source.field,void 0!==u&&(void 0!==c.source.key&&(u="".concat(c.source.key,"/").concat(u)),u in l&&(u=l[u]),d=c.value,a[u]?r[t].bool=Array.isArray(d)?a[u].containsRange({min:d[0],max:d[1]}):a[u].containsValue(d):s[u]&&s[u].contains(d)&&(r[t].bool=!0))}return t?(r=r.filter(e=>-1!==t.indexOf(e.key)),"and"===n?!!r.length&&!r.some(e=>!1===e.bool):"xor"===n?!!r.length&&r.some(e=>e.bool)&&r.some(e=>!1===e.bool):r.some(e=>e.bool)):r.some(e=>e.bool)},f.intercept=(e,t)=>{const n=K3(e);u[n]&&u[n].push(t)},f.removeInterceptor=(e,t)=>{const n=K3(e);if(!u[n])return;const r=u[n].indexOf(t);-1!==r&&u[n].splice(r,1)},f.removeAllInterceptors=e=>{const t=[];if(e){const n=K3(e);u[n]&&u[n].length&&t.push({name:e,handlers:u[n]})}else Object.keys(u).forEach(e=>{u[e].length&&t.push({name:X3(e),handlers:u[e]})});t.forEach(e=>{e.handlers.slice().forEach(t=>f.removeInterceptor(e.name,t))})},f.addKeyAlias=(e,t)=>{l[e]=t},f.removeKeyAlias=e=>{delete l[e]},O3.mixin(f),f}function Z3(e){return e*e*e}function e4(e){return--e*e*e+1}function t4(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}i0();const n4=["stroke","fill","color","backgroundColor","thumbColor"];function r4(e,t){const n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n);let a;for(a=0;a<r;++a)i[a]=i4(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(e){for(a=0;a<r;++a)o[a]=i[a](e);return o}}function i4(e,t,n){const r=typeof t;let i;return null==t||"boolean"===r?function(e){return()=>e}(t):("number"===r?L5:"string"===r?(i=h5(t))&&n4.includes(n)?(t=i,D5):$5:t instanceof h5?D5:t instanceof Date?q5:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?O5:Array.isArray(t)?r4:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?o4:L5)(e,t)}function o4(e,t){const n={},r={};let i;for(i in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)i in e?n[i]=i4(e[i],t[i],i):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}function a4(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}const s4={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},l4=/^\$/;function c4(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function u4(e,t,n){const r=e[t];r&&r.scale&&r.scale.pxScale?r.scale=r.scale.pxScale(n):r&&r.pxScale&&(e[t]=r.pxScale(n))}function d4(e,t){return e.pxScale?e.pxScale(t):e}const p4={normalizeSettings:function(e,t,n){const r=LQ({},e),i=LQ({},t);return Object.keys(r).forEach(e=>{i[e]={};const o=r[e],a=typeof o;if("function"==typeof o)i[e].fn=o;else if(c4(o)){let n=t[e];"string"==typeof n&&l4.test(n)&&(n=s4[n]);const r=typeof n;i[e]="undefined"===r||r===a?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(i[e].fn=o.fn),void 0!==o.scale&&(i[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(i[e].ref=o.ref))}),Object.keys(t).forEach(e=>{if(e in r)return;const n=t[e];"string"===typeof n&&l4.test(n)?i[e]=s4[n]:i[e]=n}),i},resolveForItem:function(e,t,n){const r={},i=Object.keys(t),o=i.length,a=e.datum,s=e.datum;for(let l=0;l<o;l++){const o=i[l],c=t[o],u="object"==typeof s&&void 0!==c,d=u&&"string"==typeof c.ref,p=u&&o in s,f=d?s[c.ref]:p?s[o]:a;c4(c)?r[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),r[o]=c.fn.call(null,e,n)):u&&c.scale&&f?(r[o]=c.scale(f.value),c.scale.bandwidth&&(r[o]+=c.scale.bandwidth()/2)):d&&f?r[o]=f.value:c.fn?r[o]=c.fn.call(null,e,n):r[o]=c}return r},updateScaleSize:u4};function f4(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((e,t)=>Array.isArray(t.children)?(e.push(...f4(t.children)),e):(e.push(t),e),[])}function h4(e,t){let n=t.context,r=t.data,i=t.style,o=t.filter,a=t.mode;const s=e.chart.brush(n),l=r,c=i.active||{},u=i.inactive||{},d=[];Object.keys(c).forEach(e=>{d.push(e)}),Object.keys(u).forEach(e=>{-1===d.indexOf(e)&&d.push(e)});const p=[];let f=!1;const h=()=>{let t=f4(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=()=>{const e=h(),t=e.length;let n,r=!1;const i="function"==typeof l?l({brush:s}):l;for(let r=0;r<t;r++){if(n=e[r].data,!n)continue;e[r].__style||(e[r].__style={},d.forEach(t=>{e[r].__style[t]=e[r][t]}));const t=s.containsMappedData(n,i,a),o=p.indexOf(e[r]);let l=!1;t&&-1===o?(p.push(e[r]),l=!0):t||-1===o||(p.splice(o,1),l=!0),e[r].needToUpdate=l||f,e[r].isActive=t}for(let i=0;i<t;i++)if(n=e[i].data,n){if(e[i].needToUpdate){const t=LQ({},e[i],e[i].__style),n=e[i].isActive;d.forEach(r=>{e[i][r]=n&&r in c?"function"==typeof c[r]?c[r].call(null,t,p):c[r]:!n&&r in u?"function"==typeof u[r]?u[r].call(null,t,p):u[r]:e[i].__style[r]}),r=!0}delete e[i].needToUpdate}return f=!1,r},g=function(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1}).suppressRender,n=h(),r=n.length;for(let e=0;e<r;e++)n[e].data&&(n[e].__style=n[e].__style||{},d.forEach(t=>{n[e].__style[t]=n[e][t],t in u&&(n[e][t]="function"==typeof u[t]?u[t].call(null,n[e]):u[t])}));f=!0,p.length=0,t||e.renderer.render(e.nodes)},y=function(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1}).suppressRender,n=h(),r=n.length;for(let e=0;e<r;e++)n[e].__style&&(Object.keys(n[e].__style).forEach(t=>{n[e][t]=n[e].__style[t]}),n[e].__style=void 0);p.length=0,t||e.renderer.render(e.nodes)},b=()=>{if(m()){const t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return s.on("start",g),s.on("end",y),s.on("update",b),{isActive:()=>s.isActive(),update:()=>{p.length=0,f=!0,m()},cleanUp:function(){s.removeListener("start",g),s.removeListener("end",y),s.removeListener("update",b)}}}function m4(e){let t=e.nodes,n=e.action,r=e.chart,i=e.trigger;const o=[];for(let e=0;e<t.length;e++){let n=t[e].data;null!==n&&o.push(n)}!function(e){let t=e.dataPoints,n=e.action,r=e.chart,i=e.trigger;if(!i)return;const o=i.data||[""];let a={items:[],actionFn:"toggleRanges"},s={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(a.actionFn="".concat(n,"Ranges"),s.actionFn="".concat(n,"Values"));for(let e=0;e<t.length;e++){const n=t[e];n&&o.forEach(e=>{let t=n&&!e?n:n[e];if(t){let e={key:t.source.field};void 0!==t.source.key&&(e.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(e.range={min:t.value[0],max:t.value[1]},a.items.push(e)):(e.value=t.value,s.items.push(e))}})}i.contexts.forEach(e=>{a.items.length?r.brush(e)[a.actionFn](a.items):r.brush(e)[s.actionFn](s.items)})}({dataPoints:o,action:n,chart:r,trigger:i})}function g4(e){let t=e.collisions,n=e.t,r=e.config,i=e.action,o=[],a=!1;t.length>0&&(o=t,a=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));const s=o.map(e=>e.node);return m4({nodes:s,action:i,chart:r.chart,data:r.data,trigger:n}),a}function y4(e,t,n){const r=n.element().getBoundingClientRect();let i=VQ(e)?function(e,t){return 1!==e.changedTouches.length?null:{x:e.changedTouches[0].clientX-t.left,y:e.changedTouches[0].clientY-t.top}}(e,r):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,r);return null===i||i.x<0||i.y<0||i.x>r.width||i.y>r.height?[]:(t.touchRadius>0&&VQ(e)?i={cx:i.x,cy:i.y,r:t.touchRadius}:t.mouseRadius>0&&!VQ(e)&&(i={cx:i.x,cy:i.y,r:t.mouseRadius}),n.itemsAt(i))}function b4(e,t,n){return e?"function"==typeof e?e(t):e:n}const v4={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontStyle:"font-style",textDecoration:"text-decoration",fontWeight:"font-weight",baseline:"dominant-baseline",dominantBaseline:"dominant-baseline",anchor:"text-anchor",textAnchor:"text-anchor",maxWidth:"maxWidth",transform:"transform",strokeDasharray:"stroke-dasharray",id:"id"};function x4(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?"M".concat(r.x," ").concat(r.y):"L".concat(r.x," ").concat(r.y),n+=" "}return t&&(n+="Z"),n}function w4(e,t,n,r){const i=n/2,o=e-r/2,a=t-r/2,s=e-i,l=t-i;return[{x:o,y:a},{x:o,y:l},{x:o+r,y:l},{x:o+r,y:a},{x:s+n,y:a},{x:s+n,y:a+r},{x:o+r,y:a+r},{x:o+r,y:l+n},{x:o,y:l+n},{x:o,y:a+r},{x:s,y:a+r},{x:s,y:a}]}function S4(e){return-e/180*Math.PI}function k4(e){return function(e){let t=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(t-e))*Math.sqrt(2),r=n*Math.cos(e),i=n*Math.sin(e);return{x1:r<0?1:0,y1:i<0?1:0,x2:r>=0?r:r+1,y2:i>=0?i:i+1}}(S4(e))}function C4(e,t){return{x:e.x+t.x,y:e.y+t.y}}function E4(e,t){return{x:e.x-t.x,y:e.y-t.y}}function M4(e,t){return{x:e.x*t,y:e.y*t}}function R4(e,t){return e.x-t.x}function _4(e,t){return e.y-t.y}function A4(e,t){return R4(e,t)**2+_4(e,t)**2}function I4(e,t){return Math.sqrt(A4(e,t))}function P4(e,t){return e.x*t.x+e.y*t.y}function T4(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const r=Math.cos(t),i=Math.sin(t),o=E4(e,n);return C4({x:r*o.x-i*o.y,y:i*o.x+r*o.y},n)}const D4={up:0,down:180,left:90,right:-90};function O4(e){let t=e.x,n=e.y,r=e.size;const i=r/2;return{type:"rect",x:t-i,y:n-i,width:r,height:r}}const N4=i0();N4.add("circle",function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}}),N4.add("diamond",function(e){const t=e.size,n=e.x-t/2,r=e.y-t/2;return{type:"path",fill:"black",d:x4([{x:n,y:r+t/2},{x:n+t/2,y:r},{x:n+t,y:r+t/2},{x:n+t/2,y:r+t},{x:n,y:r+t/2}])}}),N4.add("saltire",function(e){const t=S4(45),n=e.size/2,r=isNaN(e.width)?n/2:e.width,i=Math.min(r,n);let o=e.size;const a=Math.sin(Math.asin(-t))*(i/2);o+=2*(n/Math.sin(-t)-n),o-=2*a;const s={x:e.x,y:e.y},l=w4(e.x,e.y,o,i).map(e=>T4(e,t,s));return{type:"path",fill:"black",d:x4(l)}}),N4.add("square",function(e){const t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}}),N4.add("triangle",function(e){const t=e.size,n={x:e.x,y:e.y},r=D4[e.direction]||0,i=t/2,o=e.x-i,a=e.y-i;let s=[{x:o,y:a+t},{x:o+i,y:a},{x:o+t,y:a+t},{x:o,y:a+t}];const l=S4(r);return s=s.map(e=>T4(e,l,n)),{type:"path",fill:"black",d:x4(s)}}),N4.add("line",function(e){const t="vertical"===e.direction,n=e.size/2,r=e.x,i=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:r-(t?0:n),y1:i-(t?n:0),x2:r+(t?0:n),y2:i+(t?n:0),collider:O4(e)}}),N4.add("star",function(e){const t=e.size,n=[],r=t/2,i=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,a=isNaN(e.startAngle)?90:e.startAngle,s=360/i;for(let t=1;t<=i;t++){const i=s*t+a,l=S4(i),c=S4(i+s/2),u=Math.sin(l),d=Math.cos(l),p=Math.sin(c),f=Math.cos(c);n.push({x:e.x+d*r,y:e.y+u*r}),n.push({x:e.x+f*o,y:e.y+p*o})}return{type:"path",fill:"black",d:x4(n)}}),N4.add("n-polygon",function(e){const t=[],n=e.size/2,r=Math.max(isNaN(e.sides)?6:e.sides,3),i=360/r,o=isNaN(e.startAngle)?0:e.startAngle;for(let a=1;a<=r;a++){const r=S4(i*a+o),s=Math.sin(r),l=Math.cos(r);t.push({x:e.x+l*n,y:e.y+s*n})}return{type:"path",fill:"black",d:x4(t)}}),N4.add("cross",function(e){const t=e.x,n=e.y,r=e.size/2,i=isNaN(e.width)?r/2:e.width,o=Math.min(i,r);return{type:"path",fill:"black",d:x4(w4(t,n,e.size,o))}}),N4.add("bar",function(e){const t={x:e.x,y:e.y},n="vertical"===e.direction,r=e.size/2,i=r/2/2;let o=[{x:t.x-r,y:t.y+i},{x:t.x-r,y:t.y-i},{x:t.x+r,y:t.y-i},{x:t.x+r,y:t.y+i}];if(n){const e=S4(90);o=o.map(n=>T4(n,e,t))}const a=XQ(o);return a.type="rect",a.fill="black",a}),N4.add("rect",function(e){const t=e.x,n=e.y,r=e.size,i=void 0===e.width?r:e.width,o=void 0===e.height?r:e.height;return{type:"rect",fill:"black",x:t-i/2,y:n-o/2,width:i,height:o}}),N4.add("image",function(e){const t=e.x,n=e.y,r=e.imageSettings||{},i=r.width,o=r.height,a=r.imageSrc,s=r.position;return{type:"image",x:t,y:n,width:i,height:o,src:a,symbol:r.symbol,r:10,cx:0,cy:0,imageScalingFactor:r.imageScalingFactor,imagePosition:s}});const q4=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:N4;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=e.get(t.type);if(n){const e=n(t);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach(n=>{void 0!==v4[n]&&"transform"!==n&&(e[n]=t[n])})}(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function L4(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.dock,r=void 0===n?"center":n,i=e.displayOrder,o=void 0===i?0:i,a=e.prioOrder,s=void 0===a?0:a,l=e.preferredSize,c=void 0===l?0:l,u=e.minimumLayoutMode,d=e.show,p=void 0===d||d;r=r||"center";return{computePreferredSize(e){let n=e.inner,r=e.outer,i=e.children;return"function"==typeof c?c({inner:n,outer:r,children:i,dock:this.dock()},t):c},dock(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},displayOrder(e){return void 0!==e?(o=e,this):"function"==typeof o?o(t):o},prioOrder(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s},minimumLayoutMode(e){return void 0!==e?(u=e,this):"function"==typeof u?u(t):u},show(e){return void 0!==e?(p=e,this):"function"==typeof p?p(t):p}}}function j4(e,t,n){const r=t.require,i=void 0===r?[]:r,o=t.mediator||{},a=n.settings,s=n.formatter,l=n.scale,c=n.data,u=n.renderer,d=n.chart,p=n.dockConfig,f=n.mediator,h=n.instance,m=n.rect,g=n.style,y=n.registries,b=n.resolver,v=n.update,x=n._DO_NOT_USE_getInfo,w=n.symbol,S=n.isVisible;e.emit=()=>{},S&&(e.isVisible=S),Object.defineProperty(e,"settings",{get:a}),Object.defineProperty(e,"data",{get:c}),Object.defineProperty(e,"formatter",{get:s}),Object.defineProperty(e,"scale",{get:l}),Object.defineProperty(e,"mediator",{get:f}),Object.defineProperty(e,"style",{get:g}),Object.defineProperty(e,"registries",{get:y}),m&&Object.defineProperty(e,"rect",{get:m}),x&&(e._DO_NOT_USE_getInfo=x),Object.keys(t).forEach(n=>{var r;r=n,["on","preferredSize","created","beforeMount","mounted","resize","beforeUpdate","updated","beforeRender","render","beforeUnmount","beforeDestroy","destroyed","defaultSettings","data","settings","formatter","scale","chart","dockConfig","mediator","style","resolver","registries","_DO_NOT_USE_getInfo","symbol","isVisible"].some(e=>e===r)||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])}),i.forEach(t=>{"renderer"===t?Object.defineProperty(e,"renderer",{get:u}):"chart"===t?Object.defineProperty(e,"chart",{get:d}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:p}):"instance"===t?Object.defineProperty(e,"instance",{get:h}):"update"===t&&v?Object.defineProperty(e,"update",{get:v}):"resolver"===t?Object.defineProperty(e,"resolver",{get:b}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:w})}),Object.keys(o).forEach(t=>{e.mediator.on(t,o[t].bind(e))})}function z4(e,t,n){const r=t=>e[t]?(n.warn("Deprecation Warning the ".concat(t," property should be moved into layout: {} property")),e[t]):e.layout?e.layout[t]:void 0,i={};return i.displayOrder=r("displayOrder"),i.dock=r("dock"),i.prioOrder=r("prioOrder"),i.minimumLayoutMode=r("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==i.displayOrder?i.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==i.prioOrder?i.prioOrder:e.layout.prioOrder,e.layout.dock=i.dock||e.layout.dock,e.layout.minimumLayoutMode=i.minimumLayoutMode||e.layout.minimumLayoutMode,i.show=e.show,i.preferredSize=t,i}function F4(e,t,n){Object.keys(n.on||{}).forEach(r=>{e.eventListeners=e.eventListeners||[];const i=n.on[r].bind(e);e.eventListeners.push({event:r,listener:i}),t.on(r,i)}),e.emit=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.emit(e,...r)}}function $4(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.defaultSettings,r=void 0===n?{}:n,i=e._DO_NOT_USE_getInfo,o=void 0===i?()=>({}):i,a=t.chart,s=t.container,l=t.mediator,c=t.registries,u=t.theme,d=t.renderer,p=O3.mixin({});let f,h,m,g,y,b=t.settings||{},v=LQ(!0,{},r,b),x=[],w=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p4,n={};return{resolve:function(r){let i=r.data,o=r.settings,a=r.defaults,s=void 0===a?{}:a,l=r.scaled;const c=n.norm=t.normalizeSettings(o,s,e.chart),u={scale:e.chart.scale,formatter:e.chart.formatter};l&&Object.keys(l).forEach(e=>{c[e]&&t.updateScaleSize(c,e,l[e])});const d=[];if(!i||!Array.isArray(i.items)){const e={data:i,resources:u};let r=t.resolveForItem(e,n.norm,-1);return{settings:n.norm,item:r}}{let e;for(let r=0,o=i.items.length;r<o;r++){e={datum:i.items[r],data:i,resources:u};let o=t.resolveForItem(e,n.norm,r);o.data=i.items[r],d.push(o)}}return{settings:n.norm,items:d}}}}({chart:a}),S=!1;const k={nodes:[],chart:a,config:v.brush||{},renderer:null},C={tap:[],over:[]},E=[],M={},R=LQ({},b);function _(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const i=void 0!==e[t],o=void 0!==b[t];let a;for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return i&&("function"==typeof e[t]?a=e[t].call(M,...l):r&&(a=e[t])),o&&("function"==typeof b[t]?a=b[t].call(R,...l):r&&(a=b[t])),i||o||(a=n.call(M,...l)),a}}const A=_("preferredSize",()=>0,!0),I=_("resize",e=>e.inner),P=_("created"),T=_("beforeMount"),D=_("mounted"),O=_("beforeUnmount"),N=_("beforeUpdate"),q=_("updated"),L=_("beforeRender"),j=_("beforeDestroy"),z=_("destroyed"),F=e.render,$=()=>{v.brush&&(v.brush.consume||[]).forEach(e=>{e.context&&e.style&&E.push(h4(k,e))})},B=()=>{v.brush&&(v.brush.trigger||[]).forEach(e=>{"over"===e.on?C.over.push(e):C.tap.push(e)})};Object.defineProperty(k,"data",{get:()=>x});const H=v.renderer||e.renderer,V=H?d||c.renderer(H)():d||c.renderer()();"function"==typeof V.settings&&V.settings(v.rendererSettings),k.renderer=V;const W={resources:a.logger?{logger:a.logger()}:{}};let U=L4(z4(v,A,a.logger()),W);const G=e=>{e.key=v.key,e.element=V.element()},Y=()=>{};Y.dockConfig=()=>U,Y.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(b=e.settings,v=LQ(!0,{},r,e.settings),U=L4(z4(v,A,a.logger()),W),k.config=v.brush||{}),v.scale&&(f=a.scale(v.scale)),v.data){const e=v.rendererSettings,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=V2(v.data,{dataset:a.dataset,collection:a.dataCollection},{logger:a.logger()},a.dataCollection);t?t.isFirst?(x=n,x.items&&(x.items=[...n.items])):x.items&&(x.items=[...x.items,...n.items||[]]):x=n}else x=f?f.data():[];"string"==typeof v.formatter||"object"==typeof v.formatter?h=a.formatter(v.formatter):f&&f.data().fields&&(h=f.data().fields[0].formatter()),y=u.style(v.style||{})},Y.resize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=I({inner:e,outer:t});g=n?V.size(n):V.size(e),R.rect=LQ(!0,{computedPhysical:g.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),g=LQ(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},g)},Y.getRect=()=>R.rect;const K=()=>{const e=V.renderArgs?V.renderArgs.slice(0):[],t=v.rendererSettings;let n=x;const r="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return x.items&&r&&(n=BQ(BQ({},x),{},{items:x.items.slice(r.start,r.end)})),e.push({data:n}),e};let X,J,Q;function Z(e){const t=v.rendererSettings,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?k.nodes=[...e||[]]:k.nodes&&(k.nodes=[...k.nodes,...e||[]]):k.nodes=e}Y.beforeMount=T,Y.beforeRender=()=>{L({size:g})},Y.render=()=>{const e=F.call(M,...K());Z(e),V.render(e),X=e,J=R.rect.computed},Y.hide=()=>{Y.unmount(),V.size({x:0,y:0,width:0,height:0}),V.clear()},Y.beforeUpdate=()=>{N({settings:v,data:x})},Y.update=()=>{Q&&Q.stop();const e=v,t=e.rendererSettings,n=e.brush,r=e.animations;if("function"==typeof(null==t?void 0:t.transform)&&t.transform())return V.render(),void(X=null);const i=F.call(M,...K());Z(i),E.forEach(e=>e.cleanUp()),E.length=0,C.tap=[],C.over=[],n&&($(),B()),E.forEach(e=>{e.isActive()&&e.update()}),X&&r&&("function"==typeof r.enabled?r.enabled():r.enabled)?(r.compensateForLayoutChanges&&r.compensateForLayoutChanges({currentNodes:X,currentRect:R.rect.computed,previousRect:J}),Q=function(e,t,n,r){let i,o=e.old,a=e.current,s=t.renderer,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},d={nodes:[],ips:[]},p=[],f=null;const h=n.trackBy||a4,m={start(){let e={};if(o.forEach((t,n)=>{let r=h(t,n);e[r]=t}),a.forEach((t,n)=>{let r=h(t,n);if(e[r]){if("path"===t.type&&t.points&&t.points.length>0&&"trend"!==t.data.source.key){const n=function(e,t){const n=e.points.filter(e=>!e.dummy),r=t.points.filter(e=>!e.dummy),i=r.map(e=>e.data.major.value),o=n.filter(e=>i.includes(e.data.major.value)).map(e=>e.data.major.value),a=n.filter(e=>o.includes(e.data.major.value)),s=r.filter(e=>o.includes(e.data.major.value));return{old:a,current:s}}(e[r],t);d.ips.push(o4(LQ({},e[r],{points:n.old}),LQ({},t,{points:n.current}))),l.push(LQ({},e[r],{commonPoints:n.old}))}else d.ips.push(o4(e[r],t)),l.push(e[r]);d.nodes.push(t),e[r]=!1}else c.nodes.push(t),c.ips.push(o4(LQ({},t,{r:.001,opacity:0}),t))}),Object.keys(e).forEach(t=>{e[t]&&(u.nodes.push(e[t]),u.ips.push(o4(e[t],LQ({},e[t],{r:1e-4,opacity:0}))))}),p.push({name:"exiting",easing:Z3,duration:200,tweens:u.ips,nodes:[...l]}),p.push({name:"updating",easing:t4,duration:400,tweens:d.ips,nodes:[]}),p.push({name:"entering",easing:e4,duration:200,tweens:c.ips,nodes:[...d.nodes]}),n.isMainComponent){var t;const e=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,i=e?l.filter(e).length:l.length,o=r.getValue("animations.updatingStageMeta"),a=o.isInit,s=o.shouldBeRemoved;!1===a?(r.setValue("animations.updatingStageMeta.shouldBeRemoved",0===i),r.setValue("animations.updatingStageMeta.isInit",!0)):r.setValue("animations.updatingStageMeta.shouldBeRemoved",s&&0===i)}p.length&&(f=s.getScene(a),p[0].started=Date.now(),"undefined"!=typeof window&&(i=window.requestAnimationFrame(m.tick)))},tick(){let e=p[0];e||m.stop(),e.started||(e.started=Date.now());let t=(Date.now()-e.started)/e.duration,o=[],a=e.tweens.map(n=>n(e.easing(Math.min(1,t))));const l=n.adjustTweenedNodes;if(l&&l(a),o.push(...a),o.push(...e.nodes),s.render(o),t>=1){p.shift();const e=r.getValue("animations.updatingStageMeta"),t=e.isInit,n=e.shouldBeRemoved;p.length?"updating"===p[0].name&&n&&p.shift():(!0===t&&r.setValue("animations.updatingStageMeta.isInit",!1),m.stop())}i&&(i=window.requestAnimationFrame(m.tick))},stop(){i&&(window.cancelAnimationFrame(i),i=!1)},inProgress:()=>!!i,get targetScene(){return f}};return m}({old:X,current:i},{renderer:V},r,a.storage),Q.start()):V.render(i),X=i,J=R.rect.computed,V.setKey&&"string"==typeof b.key&&V.setKey(b.key)},Y.updated=q,Y.destroy=()=>{Y.unmount(),j(m),V.destroy(),z(),m=null};const ee=e=>{k.nodes=e,E.forEach(e=>{e.isActive()&&e.update()}),V.render(e)};return j4(M,e,{settings:()=>v,data:()=>x,scale:()=>f,formatter:()=>h,renderer:()=>V,chart:()=>a,dockConfig:()=>U,mediator:()=>l,instance:()=>R,rect:()=>R.rect,style:()=>y,update:()=>ee,registries:()=>c,resolver:()=>w,symbol:()=>q4(c.symbol)}),j4(R,b,{settings:()=>v,data:()=>x,scale:()=>f,formatter:()=>h,renderer:()=>V,chart:()=>a,dockConfig:()=>U,mediator:()=>l,style:()=>y,_DO_NOT_USE_getInfo:o.bind(M),isVisible:()=>S}),Y.getBrushedShapes=function(e,t,n){const r=[];if(v.brush&&v.brush.consume){const i=a.brush(e),o=V.findShapes("*");v.brush.consume.filter(t=>t.context===e).forEach(e=>{for(let a=0;a<o.length;a++){const s=o[a];s.data&&i.containsMappedData(s.data,n||e.data,t)&&(G(s),r.push(s),o.splice(a,1),a--)}})}return r},Y.findShapes=e=>{var t;const n=(null!==(t=Q)&&void 0!==t&&t.inProgress()?Q.targetScene:V).findShapes(e);for(let e=0,t=n.length;e<t;e++)G(n[e]);return n},Y.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=V.itemsAt(e);let r;r=t&&"stop"===t.propagation&&n.length>0?[n.pop().node]:n.map(e=>e.node);for(let e=0,t=r.length;e<t;e++)G(r[e]);return r},Y.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[];m4({nodes:e,action:t.action||"toggle",trigger:t,chart:a,data:k.data})},Y.mount=()=>{m=V.element&&V.element()?m:V.appendTo(s),V.setKey&&"string"==typeof b.key&&V.setKey(b.key),v.brush&&($(),B()),F4(R,p,b),F4(M,p,e),S=!0},Y.mounted=()=>D(m),Y.unmount=()=>{[R,M].forEach(e=>{!function(e,t){e.eventListeners&&(e.eventListeners.forEach(e=>{let n=e.event,r=e.listener;t.removeListener(n,r)}),e.eventListeners.length=0),e.emit=()=>{}}(e,p)}),C.tap=[],C.over=[],E.forEach(e=>{e.cleanUp()}),E.length=0,O(),S=!1},Y.onBrushTap=e=>{C.tap.forEach(t=>{(function(e){let t=e.e,n=e.t,r=e.config;return g4({collisions:y4(t,n,r.renderer),t:n,config:r,action:b4(n.action,t,"toggle")})})({e:e,t:t,config:k})&&"stop"===t.globalPropagation&&a.toggleBrushing(!0)})},Y.onBrushOver=e=>{C.over.forEach(t=>{(function(e){let t=e.e,n=e.t,r=e.config;return g4({collisions:y4(t,n,r.renderer),t:n,config:r,action:b4(n.action,t,"set")})})({e:e,t:t,config:k})&&"stop"===t.globalPropagation&&a.toggleBrushing(!0)})},Y.def=M,Y.ctx=R,Y.renderer=()=>V,Y.set({settings:b}),P(),Y}const B4=["__proto__","constructor","prototype"];function H4(e){const t=LQ(!0,{},e),n={getAll:()=>t,getValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return n;const r=t.split(".");let i=e;for(let e=0;e<r.length;++e){const t=r[e];if(void 0===i[t])return n;i=i[t]}return i}(t,e,n),setValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return;const r=t.split("."),i=r[r.length-1];let o=e;for(let e=0;e<r.length-1;++e){const t=r[e];if(B4.includes(t))throw new Error("Unsafe key in path: ".concat(t));void 0===o[t]&&(o[t]=Number.isNaN(+r[e+1])?{}:[]),o=o[t]}void 0!==n?o[i]=n:delete o[i]}(t,e,n)};return n}function V4(e,t,n){const r=C4(function(e,t){const n=P4(e,t)/P4(t,t)||1;return{x:t.x*n,y:t.y*n}}(E4(n,e),E4(t,e)),e);return r}function W4(e,t,n){return I4(e,n)+I4(t,n)-I4(e,t)<1e-12}function U4(e,t){return e.x>=t.x&&e.x+e.width<=t.x+t.width&&e.y>=t.y&&e.y+e.height<=t.y+t.height}function G4(e){return e.x1===e.x2&&e.y1===e.y2}function Y4(e){return e.width<=0||e.height<=0}function K4(e){return e.r<=0}function X4(e){return e.edges.length<=2}function J4(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=i6(e,JQ(t.edges[r])),!0===n)return!0;return!1}function Q4(e,t){let n=!1;const r=t.numPolygons,i=t.polygons;for(let t=0;t<r;t++){if(n=f6(e,i[t]),!0===n)return!0}return!1}function Z4(e,t){if(K4(e))return!1;return A4({x:e.cx,y:e.cy},t)<=e.r**2}function e6(e,t){if(Y4(t)||K4(e))return!1;const n=t.width/2,r=t.height/2,i=t.x+n,o=t.y+r,a=e.r,s=e.cx,l=e.cy,c=Math.abs(s-i),u=Math.abs(l-o);if(c>n+a||u>r+a)return!1;if(c<=n||u<=r)return!0;return(c-n)**2+(u-r)**2<=a**2}function t6(e,t){if(K4(e)||G4(t))return!1;const n=HQ(YQ(t),2),r=n[0],i=n[1];if(Z4(e,r)||Z4(e,i))return!0;const o={x:e.cx,y:e.cy},a=V4(r,i,o);return A4(a,o)<=e.r**2&&W4(r,i,a)}function n6(e,t){if(X4(t)||K4(e))return!1;if(r6(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let r=0;r<n;r++){if(t6(e,JQ(t.edges[r])))return!0}return!1}function r6(e,t){if(X4(e)||!l6(e.boundingRect(),t))return!1;const n=t.x,r=t.y,i=e.vertices;let o,a,s,l,c;for(o=!1,l=-1,a=i.length,s=a-1;++l<a;s=l){if(i[l].x===n&&i[l].y===r)return!0;if(i[l].y===i[s].y&&i[l].y===r&&(n-i[l].x)*(n-i[s].x)<=0)return!0;if(i[l].y<r&&r<=i[s].y||i[s].y<r&&r<=i[l].y){if(c=(i[s].x-i[l].x)*(r-i[l].y)/(i[s].y-i[l].y)+i[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function i6(e,t){if(X4(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(u6(t,JQ(e.edges[n])))return!0}const n=HQ(YQ(t),2),r=n[0],i=n[1];return r6(e,r)||r6(e,i)}function o6(e,t){if(X4(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(c6(t,JQ(e.edges[n])))return!0}const n=HQ(KQ(t),4),r=n[0],i=n[1],o=n[2],a=n[3];return r6(e,r)||r6(e,i)||r6(e,o)||r6(e,a)}function a6(e,t){return!Y4(e)&&!Y4(t)&&(e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height)}function s6(e,t){if(Y4(e)||Y4(t))return!1;return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}].every(t=>l6(e,t))}function l6(e,t){return!Y4(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function c6(e,t){if(G4(t)||Y4(e))return!1;const n=HQ(YQ(t),2),r=n[0],i=n[1];if(l6(e,r)||l6(e,i))return!0;const o=KQ(e);let a=o.length;for(let e=0;e<a;e++){if(u6(JQ([o[e],o[3!==e?e+1:0]]),t))return!0}return!1}function u6(e,t){const n=HQ(YQ(e),2),r=n[0],i=n[1],o=HQ(YQ(t),2),a=o[0],s=o[1],l=R4(i,r),c=_4(i,r),u=R4(s,a),d=_4(s,a),p=R4(r,a),f=_4(r,a);let h=d*l-u*c;const m=u*f-d*p,g=l*f-c*p;let y,b;if(0===l&&0===c)return!1;if(0===u&&0===d)return!1;if(0===h){if(0===m&&0===g){if(0===l){if(0===c)return r.x===i.x&&r.y===i.y;y=_4(a,r)/c,b=_4(s,r)/c}else y=(a.x-r.x)/l,b=(s.x-r.x)/l;return!(y<0&&b<0||y>1&&b>1)}return!1}const v=m/h;return h=g/h,v>=0&&v<=1&&h>=0&&h<=1}function d6(e,t){if(G4(e))return!1;const n=HQ(YQ(e),2);return W4(n[0],n[1],t)}function p6(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!a6(n,r)&&(s6(n,r)?J4(e,t):J4(t,e))}function f6(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!a6(n,r)&&(s6(r,n)?function(e,t){let n=!1;const r=e.numPolygons,i=e.polygons;for(let e=0;e<r;e++)if(n=p6(t,i[e]),!0===n)return!0;return!1}(e,t):function(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=g6(e,JQ(t.edges[r])),!0===n)return!0;return!1}(e,t))}function h6(e,t){if(K4(e))return!1;if(m6(t,{x:e.cx,y:e.cy}))return!0;const n=t.numPolygons,r=t.polygons;for(let t=0;t<n;t++){const n=r[t],i=n.edges.length;for(let t=0;t<i;t++){if(t6(e,JQ(n.edges[t])))return!0}}return!1}function m6(e,t){if(!l6(e.boundingRect(),t))return!1;const n=t.x,r=t.y,i=e.numPolygons;let o,a,s,l,c,u,d=!1;for(a=0;a<i;a++)for(o=e.vertices[a],c=-1,s=o.length,l=s-1;++c<s;l=c){if(o[c].x===n&&o[c].y===r)return!0;if(o[c].y===o[l].y&&o[c].y===r&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<r&&r<=o[l].y||o[l].y<r&&r<=o[c].y){if(u=(o[l].x-o[c].x)*(r-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(d=!d)}}return d}function g6(e,t){const n=HQ(YQ(t),2),r=n[0],i=n[1];if(m6(e,r)||m6(e,i))return!0;const o=e.numPolygons,a=e.polygons;for(let e=0;e<o;e++){const n=a[e];for(let e=0,r=n.edges.length;e<r;e++){if(u6(t,JQ(n.edges[e])))return!0}}return!1}function y6(e,t){const n=HQ(KQ(t),4),r=n[0],i=n[1],o=n[2],a=n[3];if(m6(e,r)||m6(e,i)||m6(e,o)||m6(e,a))return!0;const s=e.numPolygons,l=e.polygons;for(let e=0;e<s;e++){const n=l[e];for(let e=0,r=n.edges.length;e<r;e++){if(c6(t,JQ(n.edges[e])))return!0}}return!1}const b6=/^\$/,v6="@extend";function x6(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function w6(e,t,n){if("string"==typeof e){let r=t[e];return-1!==n.indexOf(e)&&x6(e),b6.test(r)?(n.push(e),w6(r,t,n)):r}let r=e;const i=LQ(!0,{},t,e),o={};if(e[v6]){const o=e[v6];-1!==n.indexOf(o)&&x6(o);let a=n.slice();a.push(o),r=LQ(!0,{},w6(i[o],t,a),e)}return Object.keys(r).forEach(e=>{let t=n.slice();if(e===v6||b6.test(e))return;o[e]=r[e];let a=o[e];b6.test(a)&&a in i?(-1!==n.indexOf(a)&&x6(a),t.push(a),a=i[a],"object"==typeof a||b6.test(a)&&a in i?o[e]=w6(a,i,t):o[e]=a):"object"==typeof a&&(o[e]=w6(a,i,t))}),o}function S6(e,t){return w6(e,t,[])}function k6(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e;const r=e=>{e.forEach(e=>{const n=Array.isArray(e.colors[0])?e.colors:[e.colors];t[e.key]={colors:n,sizes:n.map(e=>e?e.length:0)}})},i={palette:(e,n)=>((e,n)=>{const r=t[e];if(!r)return[];const i=r.sizes;for(let e=0;e<i.length;e++)if(n<=i[e])return r.colors[e];return r.colors[i.length-1]})(e,n),setPalettes:r,style:e=>S6(e,n),setStyle:t=>{n=LQ({},e,t)}};return r(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),i}function C6(e){e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height)}function E6(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return LQ(!0,t,e),t.center.minWidthRatio=Math.min(Math.max(t.center.minWidthRatio,0),1),t.center.minHeightRatio=Math.min(Math.max(t.center.minHeightRatio,0),1),t.center.minWidth=Math.max(t.center.minWidth,0),t.center.minHeight=Math.max(t.center.minHeight,0),t}function M6(e,t,n,r,i){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:r,margin:isNaN(i)?0:i}}function R6(e,t,n){if(void 0===e.cachedSize){const r=e.config.dock();let i,o=e.comp.preferredSize({inner:t,outer:n,dock:r});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},i="top"===r||"bottom"===r?o.height:"right"===r||"left"===r?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(i),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function _6(e,t){switch(t.config.dock()){case"top":e.y+=t.cachedSize,e.height-=t.cachedSize;break;case"bottom":e.height-=t.cachedSize;break;case"left":e.x+=t.cachedSize,e.width-=t.cachedSize;break;case"right":e.width-=t.cachedSize}}function A6(e,t){const n=t.edgeBleed;n&&(e.left=Math.max(e.left,n.left||0),e.right=Math.max(e.right,n.right||0),e.top=Math.max(e.top,n.top||0),e.bottom=Math.max(e.bottom,n.bottom||0))}function I6(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);const r=e.width-(t.x+t.width);r<n.right&&(t.width-=n.right-r),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);const i=e.height-(t.y+t.height);i<n.bottom&&(t.height-=n.bottom-i)}function P6(e,t,n,r,i){const o=LQ({},t),a=LQ({},n);_6(o,r),A6(a,r),I6(e,o,a);const s=function(e,t,n){const r=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),i=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=r&&t.height>=i}(e,o,i);return!!s&&(_6(t,r),A6(n,r),!0)}function T6(e){return{x:e.margin.left+e.x*e.scaleRatio.x,y:e.margin.top+e.y*e.scaleRatio.y,width:e.width*e.scaleRatio.x,height:e.height*e.scaleRatio.y}}function D6(e){return XQ([].concat(...e.map(KQ)))}function O6(e){let t=e.visible,n=e.layoutRect,r=e.reducedRect,i=e.containerRect,o=e.translation;const a=M6(r.x,r.y,r.width,r.height),s=M6(r.x,r.y,r.width,r.height),l={},c=t.slice(),u=c.slice().sort((e,t)=>e.config.displayOrder()-t.config.displayOrder());return t.sort((e,t)=>{if(e.referencedDocks.length>0&&t.referencedDocks.length>0)return 0;if(t.referencedDocks.length>0)return-1;if(e.referencedDocks.length>0)return 1;const n=e.config.displayOrder()-t.config.displayOrder();return 0===n?c.indexOf(e)-c.indexOf(t):n}).forEach(e=>{let t={},c={};switch(e.config.dock()){case"top":t.height=c.height=e.cachedSize,t.width=n.width,c.width=a.width,t.x=n.x,c.x=a.x,t.y=c.y=a.y-e.cachedSize,a.y-=e.cachedSize,a.height+=e.cachedSize;break;case"bottom":t.x=n.x,c.x=a.x,t.y=c.y=a.y+a.height,t.width=n.width,c.width=a.width,t.height=c.height=e.cachedSize,a.height+=e.cachedSize;break;case"left":t.x=c.x=s.x-e.cachedSize,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.x-=e.cachedSize,s.width+=e.cachedSize;break;case"right":t.x=c.x=s.x+s.width,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.width+=e.cachedSize;break;case"center":t.x=c.x=r.x,t.y=c.y=r.y,t.width=c.width=r.width,t.height=c.height=r.height;break;default:if(e.referencedDocks.length>0){const n=e.referencedDocks.map(e=>l[e]).filter(e=>!!e);n.length>0&&(t=D6(n.map(e=>e.outerRect)),c=D6(n.map(e=>e.r)))}}e.key&&(l[e.key]={r:c,outerRect:t}),function(e,t,n,r){const i={x:r.width/n.width,y:r.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const e=i.x<i.y,t=Math.min(i.x,i.y);i.x=t,i.y=t;const a=e?"height":"width",s=(r[a]-n[a]*i.x)*n.align;o.left=e?0:s,o.top=e?s:0}e.scaleRatio=i,e.margin=o,t.scaleRatio=i,t.margin=o,n.scaleRatio=i,n.margin=o}(c,t,n,i),c.edgeBleed=e.edgeBleed,c.computed=T6(c),t.edgeBleed=e.edgeBleed,t.computed=T6(t),c.x+=o.x,c.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(c,t),e.cachedSize=void 0,e.edgeBleed=void 0}),u}function N6(e,t,n){const r=e.layoutModes||{},i=t.minimumLayoutMode();let o=t.show();return o&&"object"==typeof i?o=r[i.width]&&r[i.height]&&n.width>=r[i.width].width&&n.height>=r[i.height].height:o&&void 0!==i&&(o=r[i]&&n.width>=r[i].width&&n.height>=r[i].height),o}function q6(e){if(!e.resize||"function"!=typeof e.resize)throw new Error("Component is missing resize function");if(!e.dockConfig&&!e.preferredSize)throw new Error("Component is missing preferredSize function")}function L6(e){let t=E6(e);const n={};return n.layout=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||isNaN(e.x)||isNaN(e.y)||isNaN(e.width)||isNaN(e.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};const r=function(e,t){const n={x:0,y:0,width:0,height:0},r={x:0,y:0,width:0,height:0};return n.width=e.width||0,n.height=e.height||0,void 0!==t.size&&(n.width=isNaN(t.size.width)?n.width:t.size.width,n.height=isNaN(t.size.height)?n.height:t.size.height),void 0!==t.logicalSize?(r.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,r.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,r.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),r.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(r.width=n.width,r.height=n.height,r.preserveAspectRatio=!1),C6(r),C6(n),{logicalContainerRect:r,containerRect:n}}(e,t),i=r.logicalContainerRect,o=r.containerRect,a=function(e,t,n){const r=[],i=[];for(let o=0;o<e.length;++o){const a=e[o];q6(a);let s=a.dockConfig;const l=a.key,c=s.dock(),u=/@/.test(c)?c.split(",").map(e=>e.replace(/^\s*@/,"")):[];N6(t,s,n)?r.push({comp:a,key:l,config:s,referencedDocks:u}):i.push({comp:a,key:l,config:s,referencedDocks:u})}return[r,i]}(n,t,i),s=HQ(a,2),l=s[0],c=s[1],u=function(e){let t=e.layoutRect,n=e.visible,r=e.hidden,i=e.settings;const o=M6(t.x,t.y,t.width,t.height),a={left:0,right:0,top:0,bottom:0},s=n.slice();s.sort((e,t)=>e.config.prioOrder()-t.config.prioOrder());for(let e=0;e<s.length;++e){const n=s[e];R6(n,o,t),P6(t,o,a,n,i)||(r.push(s.splice(e,1)[0]),--e)}!function(e,t){if(0!==t.length)for(let n=0;n<e.length;++n){let r=e[n];if(r.referencedDocks.length){const i=r.referencedDocks.every(e=>t.some(t=>t.key===e));i&&t.push(e.splice(n,1)[0])}}}(n,r);const l=n.filter(e=>-1!==s.indexOf(e));return n.length=0,n.push(...l),I6(t,o,a),o}({layoutRect:i,visible:l,hidden:c,settings:t}),d=O6({visible:l,layoutRect:i,reducedRect:u,containerRect:o,translation:{x:e.x,y:e.y}});return c.forEach(e=>{e.comp.visible=!1;const t=M6();e.comp.resize(t,t)}),{visible:l.map(e=>e.comp),hidden:c.map(e=>e.comp),ordered:d.map(e=>e.comp)}},n.settings=function(e){t=E6(e)},n}const j6=(e,t)=>{for(let n=0;n<e.length;n++){const r=e[n];if(r.hasKey&&r.key===t)return e[n]}return null},z6=e=>null==e?void 0:e.map(e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(BQ(BQ({},n),{},{children:z6(e.children)}))}}),F6=(e,t)=>({visible:[],hidden:t,ordered:[]}),$6=e=>(t,n)=>{var r;const i=n.map((e,t)=>{const n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:t=>n.computePreferredSize(BQ(BQ({},t),{},{children:z6(e.children)}))}}),o=e=>n[e.index],a=null!==(r=e(t,i))&&void 0!==r?r:{},s=a.visible,l=void 0===s?i:s,c=a.hidden,u=void 0===c?[]:c,d=a.ordered,p=void 0===d?l:d;return{visible:l.map(o),hidden:u.map(o),ordered:p.map(o)}},B6=e=>"function"==typeof e?$6(e):(e=>{const t=L6(e);return $6((e,n)=>t.layout(e,n))})(e);function H6(e,t,n){const r=t.left-n.left,i=t.top-n.top,o=QQ(e),a=LQ(!0,{},e);switch(o){case"circle":a.cx+=r,a.cy+=i;break;case"polygon":for(let e=0,t=a.vertices.length;e<t;e++){const t=a.vertices[e];t.x+=r,t.y+=i}break;case"geopolygon":for(let e=0;e<a.vertices.length;e++){const t=a.vertices[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n.x+=r,n.y+=i}}break;case"line":a.x1+=r,a.y1+=i,a.x2+=r,a.y2+=i;break;case"point":case"rect":a.x+=r,a.y+=i}return a}function V6(e,t){const n=[];let r=0;t.forEach(e=>{n.push(r),r++;const t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(r+=t.length)}),t.forEach((t,r)=>((e,t,n)=>{const r=t.instance.renderer().element();if(isNaN(n)||!r||!e||!e.children)return;const i=e.children[Math.max(0,n)];if(r===i)return;const o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==i?(e.insertBefore(r,i),o&&o.forEach(t=>{e.insertBefore(t,r)})):(o&&o.forEach(t=>{e.appendChild(t,r)}),e.appendChild(r))})(e,t,n[r]))}function W6(e,t){let n=e.element,r=e.data,i=void 0===r?[]:r,o=e.settings,a=void 0===o?{}:o,s=e.on,l=void 0===s?{}:s;const c=t.registries,u=t.logger,d=k6(t.style,t.palettes),p=[],f=LQ({},e),h=function(){const e={};return O3.mixin(e),e}();let m=[],g=null,y=null,b=null,v=[],x=()=>{},w=()=>{};const S={};let k=!1;const C=function(e){let t=e.createComponent;const n={};let r=[],i=[];const o=e=>{const n=t(e);return n&&(r.push(n),e.components&&(n.children=e.components.map(e=>o(e)).filter(e=>!!e))),n},a=e=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)},s=(e,t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n],i=t.find(e=>r.hasKey&&r.key===e.key);i?r.children&&i.components&&s(r.children,i.components):(e.splice(n,1),a(r),r.children&&s(r.children,[]),r.instance.destroy())}},l=e=>{let t=e.compList,n=e.data,r=e.excludeFromUpdate,i=e.formatters,a=e.scales;return e.settingsList.map(e=>{const s=j6(t,e.key);return r.indexOf(e.key)>-1?(delete s.updateWith,s):s?(e.rendererSettings&&"function"==typeof s.instance.renderer().settings&&s.instance.renderer().settings(e.rendererSettings),e.rendererSettings&&"function"==typeof e.rendererSettings.transform&&e.rendererSettings.transform()?(s.applyTransform=!0,s):(s.updateWith={formatters:i,scales:a,data:n,settings:e},e.components&&(s.children=l({compList:s.children||[],data:n,excludeFromUpdate:r,formatters:i,scales:a,settingsList:e.components})),s)):o(e)}).filter(e=>!!e)},c=e=>{let t=e.components,n=e.hidden,r=e.layoutFn,i=e.ordered,o=e.rect,a=e.visible;const s=r(o,t),l=s.visible,u=s.hidden,d=s.ordered;a.push(...l),n.push(...u),i.push(...d),l.forEach(e=>{if(e.children){var t,r;const o=B6(null!==(t=null===(r=e.settings)||void 0===r?void 0:r.strategy)&&void 0!==t?t:{});c({components:e.children,hidden:n,layoutFn:o,ordered:i,rect:e.instance.getRect(),visible:a})}}),u.forEach(e=>{e.children&&c({components:e.children,hidden:n,layoutFn:F6,ordered:i,rect:null,visible:a})})};return n.destroy=()=>{r.forEach(e=>e.instance.destroy()),r=[],i=[]},n.findComponentByKey=e=>j6(r,e),n.forEach=e=>{r.forEach(e)},n.layout=e=>{let t=e.layoutSettings,n=e.rect;const r=[],o=[],a=[],s=B6(t);return c({components:i,hidden:o,layoutFn:s,ordered:a,rect:n,visible:r}),{visible:r,hidden:o,ordered:a}},n.set=e=>{let t=e.components;i=t.map(e=>o(e)).filter(e=>!!e)},n.update=e=>{let t=e.components,n=e.data,r=e.excludeFromUpdate,o=e.formatters,a=e.scales;s(i,t),i=l({compList:i,data:n,excludeFromUpdate:r,formatters:o,scales:a,settingsList:t})},n}({createComponent:e=>{if(!c.component.has(e.type))return u.warn("Unknown component: ".concat(e.type)),!1;return{instance:$4(c.component(e.type),{settings:e,chart:f,mediator:h,registries:c,theme:d,container:n}),settings:LQ(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function E(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const r="function"==typeof e[t];let i;for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return i=r?e[t].call(f,...a):n.call(f,...a),i}}const M=()=>{let e;a.dockLayout?(u.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=a.dockLayout):e=a.strategy;const t=function(e){if("function"==typeof e.getBoundingClientRect){const t=e.getBoundingClientRect();return{x:0,y:0,width:t.width,height:t.height}}return{x:0,y:0,width:0,height:0}}(n);return C.layout({layoutSettings:e,rect:t})},R=E("created"),_=E("beforeMount"),A=E("mounted"),I=E("beforeUpdate"),P=E("updated"),T=E("beforeRender"),D=E("beforeDestroy"),O=E("destroyed"),N=function(e,t){let n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).partialData;const r=t.formatters,i=void 0===r?{}:r,o=t.scales,a=void 0===o?{}:o,s=t.scroll,l=void 0===s?{}:s;x=function(e,t){let n=t.types,r=t.logger;const i={},o=[];return Array.isArray(e)?o.push(...e):(r.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach((e,t)=>{let o=n(e.type);if(o){let n=e.key;void 0===e.key&&(r.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),n=t);let a=o({key:n,data:e.data,config:e.config});i[n]=a}}),e=>e?i[e]:i[Object.keys(i)[0]]}(e,{logger:u,types:c.data}),n||Object.keys(S).forEach(e=>S[e].clear()),t.palettes&&d.setPalettes(t.palettes),t.style&&d.setStyle(t.style),w=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:V2;const i={};return(e||[]).forEach(e=>{if(!e.key)throw new Error('Data collection is missing "key" property');if("object"==typeof e.data&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");i[e.key]=()=>r(e.data,t,n)}),e=>{let t,n;if("string"==typeof e?t=e:"object"==typeof e&&(t=e.key,n=e),!(t in i))throw new Error("Unknown data collection: ".concat(t));"function"==typeof i[t]&&(i[t]=i[t]());let r=i[t];if(n&&n.fields&&n.fields.filter){let e=r.fields.filter(n.fields.filter);r.fields.length!==e.length&&(r=LQ(r,{fields:e}))}return r}}(t.collections,{dataset:x},{logger:u});const p={theme:d,logger:u};g=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:I3;const i={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"scale"in o&&e[o.scale]&&(a=o.scale),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o,t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(a,{dataset:x,collection:w},BQ(BQ({},p),{},{scale:c.scale})),y=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:W2;const i={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"formatter"in o&&e[o.formatter]?a=o.formatter:"object"==typeof o&&"type"in o&&e[o.type]&&(a=o.type),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o||{},t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(i,{dataset:x,collection:w},BQ(BQ({},p),{},{formatter:c.formatter})),b=function(e,t){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=q3(e[r],t?t[r]:null));return n}(l,b)};function q(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},r=e.filter(e=>!!e.key).map(e=>e.key);v.forEach(e=>{e.key&&-1!==r.indexOf(e.key)?t[e.key]=e:e.destroy()}),v=e.map(e=>{const r=e.key&&t[e.key]?t[e.key]:c.interaction(e.type)(f,h,n);return r.set(e),r})}const L=e=>{const t=n.getBoundingClientRect(),r="clientX"in e?e.clientX:e.x,i="clientY"in e?e.clientY:e.y,o={x:r-t.left,y:i-t.top},a=[];return m.forEach(e=>{const t=e.instance.getRect();l6(t.computedPhysical?t.computedPhysical:{x:t.margin.left+t.x*t.scaleRatio.x,y:t.margin.top+t.y*t.scaleRatio.y,width:t.width*t.scaleRatio.x,height:t.height*t.scaleRatio.y},o)&&a.push(e)}),a},j=()=>{if(p.length||!n)return;Object.keys(l).forEach(e=>{const t=l[e].bind(f);n.addEventListener(e,t),p.push({key:e,listener:t})});const e={},t=t=>{t.touches?(e.x=t.touches[0].clientX,e.y=t.touches[0].clientY,e.multiTouch=t.touches.length>1):(e.x=t.clientX,e.y=t.clientY,e.multiTouch=!1),e.time=Date.now(),e.comps=L(e)},r=t=>{const n=e.comps||L(t);if(!n.every(e=>e.instance.def.disableTriggers)&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=VQ(e),r=n?e.changedTouches[0]:e,i=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(r.clientX-t.x),a=isNaN(t.y)?0:Math.abs(r.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&a<=12&&i<=300}(t,e)))for(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),k){k=!1;break}}},i=[];i.push({key:"mousedown",listener:t}),i.push({key:"mouseup",listener:r}),function(e){return"ontouchstart"in e&&"ontouchend"in e||navigator.maxTouchPoints>1}(n)&&(i.push({key:"touchstart",listener:t}),i.push({key:"touchend",listener:r})),i.push({key:"mousemove",listener:e=>{const t=L(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),k){k=!1;break}}}}),i.forEach(e=>{n.addEventListener(e.key,e.listener),p.push(e)})},z=()=>{p.forEach(e=>{let t=e.key,r=e.listener;return n.removeEventListener(t,r)}),p.length=0},F=()=>{n.innerHTML="",(()=>{const e=a.components,t=void 0===e?[]:e;T(),N(i,a),C.set({components:t});const r=M(),o=r.visible,s=r.hidden,l=r.ordered;m=o,s.forEach(e=>{e.instance.hide(),e.visible=!1}),o.forEach(e=>e.instance.beforeMount()),o.forEach(e=>e.instance.mount()),o.forEach(e=>e.instance.beforeRender()),o.forEach(e=>e.instance.render()),o.forEach(e=>e.instance.mounted()),o.forEach(e=>{e.visible=!0}),V6(n,l)})(),j(),q(a.interactions)};return f.layoutComponents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.excludeFromUpdate,n=void 0===t?[]:t;e.data&&(i=e.data),e.settings&&(a=e.settings,q(e.settings.interactions)),I(),N(i,a);const r=a,o=r.formatters,s=r.scales,l=r.components,c=void 0===l?[]:l;C.update({components:c,data:i,excludeFromUpdate:n,formatters:o,scales:s}),C.forEach(e=>{e.updateWith&&e.instance.set(e.updateWith)}),C.forEach(e=>{e.updateWith&&e.instance.beforeUpdate()}),M()},f.update=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.partialData,r=e.excludeFromUpdate,o=void 0===r?[]:r;let s;e.data&&(i=e.data),e.settings&&(a=e.settings,q(e.settings.interactions)),I(),N(i,a,{partialData:t});const l=a,c=l.formatters,u=l.scales,d=l.components,p=void 0===d?[]:d;C.update({components:p,data:i,excludeFromUpdate:o,formatters:c,scales:u}),C.forEach(e=>{e.updateWith&&e.instance.set(e.updateWith)}),C.forEach(e=>{e.updateWith&&e.instance.beforeUpdate()});const f=[],h=[];let g;if(t)C.forEach(e=>{(e.updateWith||e.applyTransform)&&e.visible&&f.push(e)}),g=f;else{const e=M(),t=e.visible,n=e.hidden,r=e.ordered;m=t,g=t,s=r,t.forEach(e=>{e.updateWith&&e.visible?f.push(e):h.push(e)}),n.forEach(e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1})}h.forEach(e=>e.instance.beforeMount()),h.forEach(e=>e.instance.mount()),g.forEach(e=>e.instance.beforeRender()),g.forEach(e=>{(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()}),t||V6(n,s),h.forEach(e=>e.instance.mounted()),f.forEach(e=>e.instance.updated()),m.forEach(e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1}),P()},f.destroy=()=>{D(),C.destroy(),z(),q(),delete f.update,delete f.destroy,O()},f.getAffectedShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=[];return m.filter(e=>null==r||e.key===r).forEach(r=>{const o=r.instance.getBrushedShapes(e,t,n);i=[...i,...o]}),i},f.findShapes=e=>{let t=[];return m.forEach(n=>{const r=n.instance.findShapes(e);t=[...t,...r]}),t},f.componentsFromPoint=e=>L(e).map(e=>e.instance.ctx),f.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[];const i=n.getBoundingClientRect();let o=m;if(Array.isArray(t.components)&&t.components.length>0){const e=t.components.map(e=>e.key);o=m.filter(t=>-1!==e.indexOf(t.key)).map(n=>({instance:n.instance,opts:t.components[e.indexOf(n.key)]}))}for(let n=o.length-1;n>=0;n--){const a=o[n],s=H6(e,i,a.instance.renderer().element().getBoundingClientRect()),l=a.instance.shapesAt(s,a.opts),c=l.length>0&&"stop"===t.propagation;if(r=[...r,...l],r.length>0&&c)return r}return r},f.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<t.components.length;n++){const r=t.components[n].key;m.filter(e=>r===e.key).forEach(r=>{let i=e.filter(e=>e.key===r.key);r.instance.brushFromShapes(i,t.components[n])})}},f.scroll=function(){return function(e,t){return t[e]||(t[e]=N3()),t[e]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",b)},f.dataset=e=>x(e),f.dataCollection=e=>w(e),f.scales=function(){return g.all()},f.formatters=function(){return y.all()},f.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return S[e]||(S[e]=Q3()),S[e]},f.scale=function(e){return g.get(e)},f.formatter=function(e){return y.get(e)},f.toggleBrushing=function(e){k=void 0!==e?e:!k},f.component=e=>{const t=C.findComponentByKey(e);return null==t?void 0:t.instance.ctx},f.logger=()=>u,f.theme=()=>d,f.storage=H4({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(f,"interactions",{get:()=>({instances:v,on(){j(),v.forEach(e=>e.on())},off(){z(),v.forEach(e=>e.off())}})}),R(),n&&(_(),F(),A(n),f.element=n),f}const U6=e=>{let t=i0(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var G6=i0();function Y6(e,t,n){let r=n.key;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}const K6=e=>e.filter(e=>"number"==typeof e&&!isNaN(e));const X6=e=>{let t=e.key,n=e.data,r=e.cache,i=e.config;if(!n)return;let o=n;"string"==typeof o&&(o=(e=>{let t=e.data,n=e.config;const r=t.split("\n"),i=r[0],o=r[1];let a=",";if(n&&n.parse&&n.parse.delimiter)a=n.parse.delimiter;else if(i){const e=[/,/,/\t/,/;/];for(let t=0;t<e.length;t++){const n=e[t];if(i&&o){if(n.test(i)&&n.test(o)&&i.split(n).length===o.split(n).length){a=n;break}}else n.test(i)&&(a=n)}}return r.map(e=>e.split(a))})({data:n,config:i})),Array.isArray(o)&&function(e){let t,n=e.source,r=e.data,i=e.cache,o=e.config,a=r;const s=o&&o.parse;Array.isArray(r[0])?s&&!1===s.headers?t=r[0].map((e,t)=>t):(t=r[0],a=r.slice(1)):t=Object.keys(r[0]);const l=!!s&&"function"==typeof s.row&&s.row;let c,u=t;u=s&&"function"==typeof s.fields?s.fields(u.slice()):t.map(e=>({key:e,title:e})),Array.isArray(r[0])?c=u.map(()=>[]):(c={},u.forEach(e=>{c[e.key]=[]}));for(let e=0;e<a.length;e++){const t=l?l(a[e],e,u):a[e];if(t)if(Array.isArray(t))for(let e=0;e<u.length;e++)c[e].push(t[e]);else for(let e=0;e<u.length;e++)c[u[e].key].push(t[u[e].key])}const d=Array.isArray(c)?e=>c[e]:e=>c[u[e].key];for(let e=0;e<u.length;e++){const t=d(e),r=K6(t),o=r.length>0,a=o?"measure":"dimension",s=o?Math.min(...r):NaN,l=o?Math.max(...r):NaN;i.fields.push(I2(LQ({source:n,key:e,title:u[e].title,values:t,min:s,max:l,type:a},u[e]),{value:u[e].value,label:u[e].label}))}}({data:o,cache:r,source:t,config:i})};function J6(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=e.data,r=e.config;const i={fields:[]},o={key:()=>t,raw:()=>n,field:e=>function(e,t){let n=t.cache;if("number"==typeof e)return n.fields[e];for(let t=0;t<n.fields.length;t++)if(n.fields[t].key()===e)return n.fields[t];for(let t=0;t<n.fields.length;t++)if(n.fields[t].title()===e)return n.fields[t];return null}(e,{cache:i}),fields:()=>i.fields.slice(),extract:e=>function(e,t){const n=Array.isArray(e)?e:[e];let r=[];return n.forEach(e=>{if(void 0!==e.field){const n=t.field(e.field),i=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));const o=N2(e,t),a=o.props,s=o.main,l=Object.keys(a),c=!!e.trackBy,u=typeof e.trackBy,d={},p=[],f=n.items(),h=[];for(let t=0;t<f.length;t++){const n=f[t];if(s.filter&&!s.filter(n))continue;const r=Y6(s,n,{key:i});l.forEach(e=>{const o=a[e];let s=o.field?o.field.items()[t]:n;r[e]=Y6(o,s,{key:i})}),c&&j2({cfg:e,itemData:n,obj:r,target:p,tracker:d,trackType:u}),h.push(r)}r=c?[...r,...L2(p,{main:s,propsArr:l,props:a})]:[...r,...h]}}),r}(e,o),hierarchy:()=>null};return X6({key:t,data:n,config:r,cache:i}),o}J6.util={normalizeConfig:N2,collect:L2,track:j2};const Q6=i0();Q6.default("matrix"),Q6("matrix",J6),Q6("default",J6);const Z6=i0();function e8(e,t,n){return Math.max(e,Math.min(t,n))}function t8(e){let t=e.item,n=e.value,r=e.boxCenter,i=e.rendWidth,o=e.rendHeight,a="x",s="y",l=i,c=o,u=n<.5?90:-90;return e.flipXY&&(a="y",s="x",l=o,c=i,u=n<.5?180:0),(0,e.symbol)(LQ({},t.oob,{[a]:r*l,[s]:Math.max(t.oob.size/2,Math.min(n*c,c-t.oob.size/2)),startAngle:u}))}function n8(e){let t=e.item,n=e.boxWidth,r=e.boxPadding,i=e.rendWidth,o=e.rendHeight,a="x",s="y",l="width",c="height",u=i,d=o;e.flipXY&&(a="y",s="x",l="height",c="width",u=o,d=i);const p=function(e){let t=e.start,n=e.end,r=e.minPx,i=void 0===r?.1:r,o=e.maxPx,a=void 0===o?1:o;const s=Math.max(t,n),l=Math.min(t,n),c=e8(-.1,1.2,s),u=e8(-.1,1.2,l),d=c*a-u*a,p=Math.max(i,d),f=(p-d)/2;return{actualDiff:p,startModifier:f,actualLow:u*a-f}}({start:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:d}),f=p.actualDiff,h=p.actualLow;return LQ({},t.box,{type:"rect",[a]:(r+t.major)*u,[s]:h,[c]:f,[l]:n*u,data:t.data||{},collider:{type:null}})}function r8(e){let t=e.item,n=e.from,r=e.to,i=e.boxCenter,o=e.rendWidth,a=e.rendHeight,s="x1",l="y1",c="x2",u="y2",d=o,p=a;return e.flipXY&&(s="y1",l="x1",c="y2",u="x2",d=a,p=o),LQ({},t.line,{type:"line",[u]:Math.floor(n*p),[s]:i*d,[l]:Math.floor(r*p),[c]:i*d,data:t.data||{},collider:{type:null}})}function i8(e){let t=e.item,n=e.key,r=e.position,i=e.width,o=e.boxCenter,a=e.rendWidth,s=e.rendHeight,l="x1",c="y1",u="x2",d="y2",p=a,f=s;e.flipXY&&(l="y1",c="x1",u="y2",d="x2",p=s,f=a);const h=i/2;return LQ({type:"line"},t[n],{[c]:Math.floor(r*f),[l]:(o-h)*p,[d]:Math.floor(r*f),[u]:(o+h)*p,r:h*p,cx:o*p,cy:r*f,width:i*p,data:t.data||{},collider:{type:null}})}function o8(e,t,n){const r=t.box,i=r.width,o=r.maxWidthPx,a=r.minWidthPx,s=e>=0?1:-1;let l=Math.min(s*e*i,isNaN(o)?n:o/n);return l=isNaN(a)?l:Math.max(a/n,l),l*s}Z6("native",function(e,t,n){let r,i,o={chart:e,mediator:t,element:n},a=[],s=!0;function l(){"function"==typeof r.enable&&(r.enable=r.enable.bind(o)()),r.enable&&Object.keys(r.events).forEach(e=>{const t=r.events[e].bind(o);n.addEventListener(e,t),a.push({key:e,listener:t})})}function c(){a.forEach(e=>{let t=e.key,r=e.listener;n.removeEventListener(t,r)}),a=[]}return{get key(){return i},set(e){!function(e){i=e.key,r=e,r.events=r.events||[],void 0===r.enable&&(r.enable=!0)}(e),c(),s&&l()},off(){s=!1,c()},on(){s=!0,0===a.length&&l()},destroy(){c(),o=null,r=null}}});const a8={oob:{show:!0,type:"n-polygon",fill:"#999",stroke:"#000",strokeWidth:0,size:10,sides:3,startAngle:-90},box:{show:!0,fill:"#fff",stroke:"#000",strokeWidth:1,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1},line:{show:!0,stroke:"#000",strokeWidth:1},median:{show:!0,stroke:"#000",strokeWidth:1},whisker:{show:!0,stroke:"#000",strokeWidth:1,fill:"",type:"line",width:1}},s8=Object.keys(a8),l8={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(e){let t=e.data;const n=this.rect,r=n.width,i=n.height,o="horizontal"===this.settings.settings.orientation,a=this.style,s=this.resolver,l=this.symbol,c=s8.filter(e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show),u={};c.forEach(e=>u[e]=a8[e]);const d=function(e){let t=e.keys,n=e.data,r=e.defaultSettings,i=e.style,o=e.settings,a=e.width,s=e.height,l=e.resolver;const c=LQ(!0,{},r||{},i||{}),u={major:"horizontal"===o.orientation?s:a,minor:"horizontal"===o.orientation?a:s},d=o.major;let p;p="object"==typeof d&&"object"==typeof d.ref&&void 0!==d.ref.start&&void 0!==d.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:LQ(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof d&&void 0!==d.binStart&&void 0!==d.binEnd?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:LQ(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:u,defaults:{major:.5},settings:{major:o.major}});const f=o.minor||{},h={};["start","end","min","max","med"].forEach(e=>{(f[e]||n.items&&n.items.length&&n.items[0][e])&&(h[e]={scale:f.scale,ref:e})});let m,g={major:p,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:LQ(!0,{},h,f)})};for(let e=0,r=t.length;e<r;e++)o[m]&&!1===o[m].show||(m=t[e],g[m]=l.resolve({data:n,defaults:c[m],settings:o[m],scaled:u}));return g}({keys:c,data:t,defaultSettings:u,style:a,settings:this.settings.settings,width:r,height:i,resolver:s});d.settings,d.items;const p=function(e){let t=e.width,n=e.height,r=e.flipXY,i=e.resolved,o=e.keys,a=e.symbol;const s=[],l=i.major.items;if(!l.length)return s;const c=t,u=n,d=r?n:t,p=i.major.settings,f=["start","end","min","max","med"].filter(e=>void 0!==i.minor.settings[e]),h=f.length,m=o.filter(e=>"oob"!==e);let g,y,b,v,x,w,S,k,C;const E=o?o.length:0,M=m?m.length:0;function R(){S?g.push(t8({item:b,value:0,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:a})):k&&g.push(t8({item:b,value:1,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:a}))}const _={box:function(){b.box&&WQ(b.start)&&WQ(b.end)&&g.push(n8({item:b,boxWidth:v,boxPadding:x,rendWidth:c,rendHeight:u,flipXY:r}))},line:function(){WQ(b.min)&&WQ(b.start)&&g.push(r8({item:b,from:b.min,to:b.start,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),WQ(b.max)&&WQ(b.end)&&g.push(r8({item:b,from:b.max,to:b.end,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},median:function(){b.median&&WQ(b.med)&&g.push(i8({item:b,key:"median",position:b.med,width:v,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},whisker:function(){if(b.whisker){const e=v*b.whisker.width;WQ(b.min)&&g.push(i8({item:b,key:"whisker",position:b.min,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),WQ(b.max)&&g.push(i8({item:b,key:"whisker",position:b.max,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))}}};function A(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let r=0;r<h;r++)e=b[f[r]],WQ(e)&&(t<e&&(t=e),n>e&&(n=e));S=t<0&&t!==-Number.MAX_VALUE,k=n>1&&n!==Number.MAX_VALUE,C=S||k}for(let e=0,t=l.length;e<t;e++){g=[],y=null;const t=l[e],n=t.data;let r=null,a=null;void 0!==p.binStart?(r=t.binStart,a=t.binEnd,y=p.binStart.scale):(y=p.major.scale,r=y?t.major:0);let c=0;y?y.bandwidth?(c=y.bandwidth(),r-=c/2):c=a-r:c=1,b=LQ({},{major:r,majorEnd:a},i.minor.items[e]);for(let t=0;t<E;t++)b[o[t]]=i[o[t]].items[e];if(v=o8(c,b,d),x=(c-v)/2,w=x+b.major+v/2,A(),C)b.oob&&R();else for(let e=0;e<M;e++)b[m[e]]&&!1===b[m[e]].show||_[m[e]]();const u={type:"container",data:n,collider:{type:"bounds"},children:g};s.push(u)}return s}({width:r,height:i,flipXY:o,resolved:d,keys:c,symbol:l});return p}};const c8={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},u8=/px$/,d8={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},p8={imageSrc:void 0,imageScalingFactor:void 0,position:"center-center",symbol:"rectangle",width:void 0,height:void 0},f8={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function h8(e,t){return e&&"function"==typeof e.bandwidth?{isBandwidth:!0,value:Math.max(1,e.bandwidth()*t)}:{isBandwidth:!1,value:Math.max(1,t)}}function m8(e,t,n,r){let i=t.width,o=t.height;return e.filter(e=>!1!==e.show&&!isNaN(e.x+e.y)).map(e=>{let t=e,a=u8.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);UQ(a)&&(t=c8,a=n.min+t.size*(n.max-n.min));const s=function(e){let t=d8.shape,n={};return"object"==typeof e.shape&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),l=HQ(s,2),c=l[0],u=BQ(BQ({},l[1]),{},{type:c,label:e.label,x:e.x*i,y:e.y*o,fill:t.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,a)),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray,opacity:t.opacity,imageSettings:t.imageSettings});t===e.errorShape&&(u.width=t.width);const d=r(u);return d.data=e.data,d})}const g8={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:e=>e.data.value},style:{item:"$shape"}},render(e){let t=e.data;const n=this.resolver.resolve({data:t,defaults:LQ({},d8,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),r=this.rect,i=r.width,o=r.height,a=LQ({},f8,this.settings.settings.sizeLimits),s=n.items;s.length>0&&"image"===s[0].shape&&t.items.forEach((e,t)=>{s[t].imageSettings=LQ({},p8,this.settings.settings.imageSettings)});const l=function(e,t,n,r,i){const o=h8(e?e.scale:void 0,n),a=h8(t?t.scale:void 0,r);let s=Math.min(o.value*i[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],a.value*i[a.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*i[o.isBandwidth?"minRelDiscrete":"minRelExtent"],a.value*i[a.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(s)),maxGlobal:i.maxPx,minGlobal:i.minPx}}(n.settings.x,n.settings.y,i,o,a);return m8(s,this.rect,l,this.settings.shapeFn||this.symbol)}};const y8={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function b8(e,t,n,r){let i=t.x,o=t.y,a=t.width,s=t.height;const l=MZ(),c={x:i+a/2,y:o+s/2},u=Math.min(a,s)/2,d=Math.min(a,s)/2,p=d/100;return e.map((e,t)=>{const i=n[t];i.type="path";const o=d*i.outerRadius,a=u*i.innerRadius,s=p*i.cornerRadius;l.innerRadius(a),l.outerRadius(o),l.cornerRadius(s),i.arcDatum=e;const f=l.centroid(e),h=i.offset?function(e,t,n,r){let i=HQ(e,2),o=i[0],a=i[1];const s=Math.sqrt(o*o+a*a);o/=s,a/=s;const l=n-r;return{x:o*t*l,y:a*t*l}}(f,i.offset,o,a):{x:0,y:0};return i.transform="translate(".concat(h.x,", ").concat(h.y,") translate(").concat(c.x,", ").concat(c.y,")"),i.desc={share:e.value/r,slice:{start:e.startAngle,end:e.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:c.x+h.x,y:c.y+h.y}}},i})}function v8(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const x8={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(e){let t=e.data;const n=[],r=[],i=this.settings.settings,o=this.resolver.resolve({data:t,defaults:LQ({},y8,this.style.slice),settings:i.slice}).items;let a=0;for(let e=0,t=o.length;e<t;e++){const t=v8(i,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),r.push(o[e]),a+=t)}const s=function(){var e=OZ,t=DZ,n=null,r=eZ(0),i=eZ(dZ),o=eZ(0);function a(a){var s,l,c,u,d,p=(a=RZ(a)).length,f=0,h=new Array(p),m=new Array(p),g=+r.apply(this,arguments),y=Math.min(dZ,Math.max(-dZ,i.apply(this,arguments)-g)),b=Math.min(Math.abs(y)/p,o.apply(this,arguments)),v=b*(y<0?-1:1);for(s=0;s<p;++s)(d=m[h[s]=s]=+e(a[s],s,a))>0&&(f+=d);for(null!=t?h.sort(function(e,n){return t(m[e],m[n])}):null!=n&&h.sort(function(e,t){return n(a[e],a[t])}),s=0,c=f?(y-p*v)/f:0;s<p;++s,g=u)l=h[s],u=g+((d=m[l])>0?d*c:0)+v,m[l]={data:a[l],index:s,value:d,startAngle:g,endAngle:u,padAngle:b};return m}return a.value=function(t){return arguments.length?(e="function"==typeof t?t:eZ(+t),a):e},a.sortValues=function(e){return arguments.length?(t=e,n=null,a):t},a.sort=function(e){return arguments.length?(n=e,t=null,a):n},a.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:eZ(+e),a):r},a.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:eZ(+e),a):i},a.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:eZ(+e),a):o},a}().sortValues(null);s.startAngle(i.startAngle),s.endAngle(i.endAngle),s.padAngle(i.padAngle);return b8(s(n),LQ({},this.rect,{x:0,y:0}),r,a)}};const w8=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){const n=e[t.type],r=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach(e=>{const n=Math.round(t[e.key]),i=t[e.key]-n;t[e.key]=n,r&&"append"===e.type&&(i>0?t[e.key]+=.5:t[e.key]-=.5)})}}return void 0===e&&((e={}).line={append:["x1","x2","y1","y2"],round:[],condition:e=>e.x1===e.x2||e.y1===e.y2,conditionAppend:e=>e.strokeWidth%2!=0},e.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:e=>e.strokeWidth%2!=0}),Object.keys(e).forEach(t=>{const n=e[t];n.items=[],n.append.forEach(e=>{n.items.push({key:e,type:"append"})}),n.round.forEach(e=>{n.items.push({key:e,type:"round"})})}),t.multiple=e=>e.forEach(e=>t(e)),t}();class S8{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(e,t){if(t){const t=e.substring(0,1),n=e.substring(1);if("x"===t)return"y".concat(n);if("y"===t)return"x".concat(n);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}transposeCoordinate(e,t,n){if("number"==typeof t&&isFinite(t)){const r=e.substring(0,1);if("x"===r||"cx"===e)return t*this.width;if("width"===e)return t*this.width;if("r"===e)return t*(n?this.height:this.width);if("y"===r||"cy"===e)return t*this.height;if("height"===e)return t*this.height}return t}push(){return this.storage.push(...arguments),this}processItem(e){let t={};const n=void 0!==e.flipXY?e.flipXY:this.flipXY,r=void 0!==e.crisp?e.crisp:this.crisp;if(e.fn&&"function"==typeof e.fn){let r=n?this.height:this.width,i=n?this.width:this.height;e=e.fn({width:r,height:i,flipXY:n});const o=Object.keys(e);for(let r=0,i=o.length;r<i;r++){let i=o[r];t[S8.evaluateKey(i,n)]=e[i]}}else{const r=Object.keys(e);for(let i=0,o=r.length;i<o;i++){let o=r[i];const a=S8.evaluateKey(o,n),s=this.transposeCoordinate(a,e[o],n);t[a]=s}}return r&&w8(t),t}output(){let e=[];for(let t=0,n=this.storage.length;t<n;t++){let n=this.processItem(this.storage[t]);e.push(n)}return e}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function k8(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new S8(...t)}function C8(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const E8={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=k8(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){if(this.x=this.settings.x?this.chart.scale(this.settings.x):null,this.y=this.settings.y?this.chart.scale(this.settings.y):null,u4(this,"x",this.rect.width),u4(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=LQ({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=LQ({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=C8(this.x,this.rect.width),this.lines.y=C8(this.y,this.rect.height),this.lines.y=this.lines.y.map(e=>LQ(e,{flipXY:!0}));let e=e=>{let t=e.dir,n=e.isMinor,r=this.lines[t].filter(e=>!!e.isMinor===n),i=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:i,data:{items:r,dir:t}}).items.forEach(e=>{let n=e.data;var r,i;e.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:e.stroke||"black",strokeWidth:void 0!==e.strokeWidth?e.strokeWidth:1,strokeDasharray:void 0!==e.strokeDasharray?e.strokeDasharray:void 0,flipXY:n.flipXY||!1,value:null!==(r=n.value)&&void 0!==r?r:null===(i=n.data)||void 0===i?void 0:i.value,dir:t})})};return e({dir:"x",isMinor:!1}),e({dir:"x",isMinor:!0}),e({dir:"y",isMinor:!1}),e({dir:"y",isMinor:!0}),this.blueprint.output()}};function M8(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===r||"right"===r){let i="right"===r;return"\n M ".concat(e," ").concat(t-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?0:1,", ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}let i="bottom"===r;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(i?t+n:t-n," Z\n ")}function R8(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===r||"right"===r){let i="right"===r;return"\n M ".concat(e+=i?1.5*n:-1.5*n," ").concat(t-n,"\n L ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}let i="bottom"===r;return t+=i?1.5*n:-1.5*n,"\n M ".concat(e-n," ").concat(t,"\n L ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(i?t+n:t-n," Z\n ")}function _8(e,t,n){return e<t||e>n}function A8(e,t){if("string"==typeof e.formatter)return t.formatter(e.formatter);if("object"==typeof e.formatter)return t.formatter(e.formatter);if(void 0!==e.scale&&e.scale.data){const t=e.scale.data()&&e.scale.data().fields;return t&&t[0]?t[0].formatter():null}return null}function I8(e){if(void 0===e)return 0;if("number"==typeof e&&isFinite(e))return e;if("string"==typeof e)switch(e){case"center":case"middle":return.5;case"bottom":case"right":return 1;default:return 0}return 0}function P8(e){var t,n;let r=e.chart,i=e.blueprint,o=e.renderer,a=e.p,s=e.settings,l=e.items,c=e.slopeLine,u=!0,d=!1,p=!1,f=!1,h=!1,m=LQ(!0,{},s.style.line,a.line||{}),g=LQ(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:m.stroke});if(d=c?i.processItem({type:"line",x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:!1,value:a.valueInfo?a.valueInfo.id:a.value}):i.processItem({type:"line",x1:a.position,y1:0,x2:a.position,y2:1,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:a.flipXY||!1,value:a.valueInfo?a.valueInfo.id:a.value}),a.label&&!1!==a.label.show&&(null==c||!c.slope||0===c.slope)){const e=LQ(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:m.stroke},a.label);let t,n={width:0,height:0},c="";t=A8(a,r),!1!==a.label.showValue&&(t?c=" (".concat(t(a.value),")"):a.scale&&(c=" (".concat(a.value,")"))),c&&(n=o.measureText({text:c,fontFamily:e.fontFamily,fontSize:e.fontSize}));let d=o.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),g={width:d.width+n.width,height:Math.max(d.height,n.height)},y=e.padding,b=I8(a.flipXY?e.vAlign:e.align),v=I8(a.flipXY?e.align:e.vAlign),x=Math.min(1+g.width+2*y,e.maxWidth*i.width,e.maxWidthPx),w=g.height+2*y,S=a.flipXY?w:x,k=a.flipXY?x:w;if(p=i.processItem({fn:t=>{let n=t.width,r=t.height,o=a.position*n-(a.flipXY?w:x)*(1-b);o=a.flipXY?o:Math.max(o,0);return{type:"rect",x:o,y:Math.max(Math.abs(v*r-k*v),0),width:a.flipXY?S:Math.min(S,i.width-o),height:k,stroke:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.background.opacity}},flipXY:a.flipXY||!1}),p.x<-1||p.x+p.width>i.width+1||p.y<-1||p.y+p.height>i.height+1)p=void 0;else{f={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:p.x+y,y:p.y+p.height/2+g.height/3,maxWidth:p.width-2*y-n.width,anchor:"start"},c&&(h={type:"text",text:c||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:f.x+3+(p.width-(n.width+2*y)),y:f.y});for(let e=0,t=l.length;e<t;e++){let t=l[e];"rect"===t.type?a6(p,t)&&(u=!1):"line"===t.type&&a.flipXY===t.flipXY&&c6(p,t)&&(u=!1)}}}if(d&&l.push(d),c&&0!==c.slope&&(!1!==(null===(t=c.label)||void 0===t?void 0:t.show)||!1!==(null===(n=c.label)||void 0===n?void 0:n.showValue))){var y,b,v;let e,t;const n=120;let s=!1!==(null===(y=c.label)||void 0===y?void 0:y.show)?null===(b=c.label)||void 0===b?void 0:b.text:"";if(!1!==(null===(v=c.label)||void 0===v?void 0:v.showValue)){var x;const t=A8(a,r),n=t?t(c.value):c.value;e="(".concat(c.slope,"x + ").concat(n,")"),s+=null!==(x=c.label)&&void 0!==x&&x.text?" ".concat(e):e}if(s.length>1){var w,S,k;const e=o.measureText({text:s,fontFamily:g.fontFamily,fontSize:g.fontSize});e.width=e.width>n?n:e.width;const a=function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});if(t>0){if(r.max()*t+n>=i.max())return!0}else if(t<0&&r.min()*t+n>=i.max())return!0;return!1}(r,c.slope,c.value)?function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});return r((i.max()-n)/t)}(r,c.slope,c.value):void 0,u=void 0===a||c.isRtl?g.padding:3*g.padding,p=void 0!==a||c.slope>0?3*g.padding:g.padding,f=function(e,t,n,r,i,o){let a=0;if(void 0!==n){if(n<.8)return a=e.slope<0||e.isRtl?3*o.padding:2*o.padding,e.isRtl,n*i.width+a;if(1===n)return e.isRtl?n*i.width-(r.width+3*o.padding):n*i.width-(r.width+6*o.padding);if(n>.8)return e.isRtl?n*i.width-(r.width+3*o.padding):n*i.width-(r.width+6*o.padding)}else if(e.slope>0)return t.x2-(r.width+2*o.padding);return e.isRtl?t.x1-(r.width+2*o.padding):t.x1}(c,d,a,e,i,g),h=Math.min(d.y1,d.y2);null!==(w=c.label)&&void 0!==w&&w.stroke&&(t={type:"rect",x:c.isRtl?Math.max(f,u)-2:Math.max(f,u)+2,y:Math.abs(Math.max(h,p)-e.height),rx:3,ry:3,width:e.width+g.padding,height:e.height-2,stroke:m.stroke,fill:m.stroke});const y={type:"text",text:s,fill:null!==(S=null===(k=c.label)||void 0===k?void 0:k.stroke)&&void 0!==S?S:m.stroke,opacity:g.opacity,fontFamily:g.fontFamily,fontSize:g.fontSize,x:t?t.x+2:Math.max(f,u)+2,y:t?t.y+e.height-g.padding:Math.abs(Math.max(h,p)-g.padding/2),anchor:"start",title:s,maxWidth:n,width:e.width};(function(e,t,n,r,i){for(let o=0,a=e.length;o<a;o++){const a=e[o];if("text"===(null==a?void 0:a.type)&&Math.abs(a.x-t.x)<Math.max(a.width+r,t.width+r)&&Math.abs(a.y-t.y)<n.height+i)return!0}return!1})(l,y,e,u,p)||(t&&l.push(t),l.push(y))}}u&&p&&f&&(l.push(p,f),h&&l.push(h))}function T8(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function D8(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function O8(e,t){const n=e.min();if(n===e.max()){const r=function(e){const t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return r?2:-1;if(t>n)return r?-1:2}return e(t)}function N8(e,t){return e&&t&&Math.abs(e.x-t.x)<1e-15&&Math.abs(e.y-t.y)<1e-15}const q8={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:0},style:{oob:{show:!0,width:10,fill:"#1A1A1A",stroke:"transparent",strokeWidth:0,opacity:1,text:{fontFamily:"Arial",stroke:"transparent",fill:"#fff",strokeWidth:0,opacity:1},triangle:{fill:"#4D4D4D",stroke:"transparent",strokeWidth:0,opacity:1},padding:{x:28,y:5}},line:{stroke:"#000"},label:{strokeWidth:0}}},preferredSize:()=>30,beforeRender(){this.blueprint=k8(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){let e=this.settings;if(this.lines={x:[],y:[]},this.lines.x=e.lines&&e.lines.x||[],this.lines.y=e.lines&&e.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const t={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(D8).map(e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=O8(t,e.value);return LQ(e,{scale:t,position:n})}return LQ(e,{position:e.value})}),this.lines.y=this.lines.y.filter(D8).map(e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=O8(t,e.value);return LQ(e,{scale:t,position:n,flipXY:!0})}return LQ(e,{position:e.value,flipXY:!0})}),this.lines.x=this.lines.x.filter(e=>!(e.position<0||e.position>1)||(t["x".concat(e.position>1?1:0)].push(T8(e)),!1)),this.lines.y=this.lines.y.filter(e=>!(!e.slope||0===e.slope)||(!(e.position<0||e.position>1)||(t["y".concat(e.position>1?1:0)].push(T8(e)),!1)));let n=[];return[...this.lines.x,...this.lines.y].forEach(r=>{if(!0===r.show||void 0===r.show){let i;if(r.slope&&0!==r.slope){const e=this.chart.scale({scale:"x"}),n=this.chart.scale({scale:"y"}),o=e.min(),a=e.max(),s=n.min(),l=n.max();i=BQ(BQ({},r),{},{x1:void 0,y1:void 0,x2:void 0,y2:void 0});const c=o*r.slope+r.value,u=a*r.slope+r.value,d=(s-r.value)/r.slope,p=(l-r.value)/r.slope;let f=[];_8(c,s,l)||(f[0]={x:O8(e,o),y:O8(n,c)}),_8(d,o,a)||(f[1]={x:O8(e,d),y:1}),_8(u,s,l)||(f[2]={x:O8(e,a),y:O8(n,u)}),_8(p,o,a)||(f[3]={x:O8(e,p),y:0});const h=f.filter(e=>!!e).length;if(h>2&&function(e){N8(e[0],e[1])&&(e[1]=void 0),N8(e[1],e[2])&&(e[2]=void 0),N8(e[2],e[3])&&(e[3]=void 0),N8(e[3],e[0])&&(e[3]=void 0)}(f),f=f.filter(e=>!!e),f.length<2)return void t["y".concat(c>l?0:1)].push(T8(r));i.x1=f[0].x,i.y1=f[0].y,i.x2=f[1].x,i.y2=f[1].y}else i=void 0;P8({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:r,settings:e,items:n,slopeLine:i})}}),e.style.oob.show&&function(e){let t=e.blueprint,n=e.oob,r=e.settings,i=e.items;const o=Object.keys(n);let a=r.style.oob||{};for(let e=0,r=o.length;e<r;e++){const r=o[e],s=n[r];if(s.length>0){let e=r.charAt(1),n="y"===r.charAt(0),o=a.padding.x+a.width,l=a.padding.y+a.width,c="bottom";c=n?"1"===e?"bottom":"top":"1"===e?"right":"left";let u=t.processItem({fn:t=>{let r=t.width,i=t.height,u=e*r+("1"===e?-o:o),d=n?l:i-l;return"arc"===a.type?{type:"path",d:M8(n?d:u,n?u:d,a.width,c),x:u,y:d,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0}:{type:"circle",cx:u,cy:d,r:a.width,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0,opacity:a.opacity,data:s}},flipXY:n}),d=u.cx||u.x,p=u.cy||u.y;const f=s.map(e=>e.label?"".concat(e.label," (").concat(e.value,")"):"(".concat(e.value,")")),h=f.reduce((e,t,n)=>0===n?t:"".concat(e,"\n\n").concat(t),"");let m={type:"text",text:s.length||"",title:h,x:d-.4*a.width,y:p+.4*a.width,fontFamily:a.text.fontFamily,fontSize:"".concat(1.3*a.width,"px"),stroke:a.text.stroke,fill:a.text.fill,strokeWidth:a.text.strokeWidth||0,opacity:a.text.opacity},g={type:"path",d:R8(d,p,a.width,c),x:d,y:p,stroke:a.triangle.stroke,fill:a.triangle.fill,strokeWidth:a.triangle.strokeWidth||0,opacity:a.triangle.opacity};i.push(u,m,g)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function L8(e){const t={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===e.align||"bottom"===e.align?(t.x1=e.innerRect.x-e.outerRect.x,t.x2=t.x1+e.innerRect.width,t.y1=t.y2="top"===e.align?e.innerRect.height-e.padding:e.padding):(t.x1=t.x2="left"===e.align?e.innerRect.width-e.padding:e.padding,t.y1=e.innerRect.y-e.outerRect.y,t.y2=t.y1+e.innerRect.height),function(e,t){LQ(e,t.style)}(t,e),t}function j8(e){return"string"==typeof e||"number"==typeof e?e:"-"}function z8(e,t,n){n.layered||!n.stepSize?function(e,t){t.collider={type:"polygon",vertices:[{x:t.boundingRect.x,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y+t.boundingRect.height},{x:t.boundingRect.x,y:t.boundingRect.y+t.boundingRect.height}]}}(0,t):n.tilted?function(e,t,n){const r=n.angle*(Math.PI/180),i=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,a="end"===t.anchor&&r<0,s="start"===t.anchor&&r>=0,l=t.boundingRect.y+(s||a?t.boundingRect.height:0),c=[{x:t.x-i,y:l},{x:t.x+i,y:l}].map(e=>T4(e,r,{x:t.x,y:t.y})),u={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},d={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},p=r>=0?[u,d]:[d,u];c.push(...p),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const r=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:r,y:0,width:r<0?n.stepSize+r:n.stepSize,height:n.innerRect.height}}else{const r=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:r,width:n.innerRect.width,height:r<0?n.stepSize+r:n.stepSize}}const r=t.collider;r.x=Math.max(r.x,0),r.y=Math.max(r.y,0);const i=r.x+r.width-(n.outerRect.x+n.outerRect.width);r.width=i>0?r.width-i:r.width;const o=r.y+r.height-(n.outerRect.y+n.outerRect.height);r.height=o>0?r.height-o:r.height}(e,t,n)}function F8(e,t){const n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1);let r=0;if(e.tilted)r=e.stepSize*n;else{const i=t?e.textRect.height:e.textRect.width;r=Math.max(0,e.stepSize-i)*n}return r}function $8(e,t){var n,r;const i={type:"text",text:j8(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(r=e.data)||void 0===r?void 0:r.value};return"top"===t.align||"bottom"===t.align?(i.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+F8(t,!1),i.y="top"===t.align?t.innerRect.height:0,i.anchor=t.stepSize?"start":"middle",i.x+=isNaN(t.style.offset)?0:+t.style.offset):(i.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+F8(t,!0),i.x="left"===t.align?t.innerRect.width:0,i.anchor="left"===t.align?"end":"start",i.baseline=t.stepSize?"text-before-edge":"central",i.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach(n=>{e[n]=t.style[n]})}(i,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){const n=0,r=t.outerRect.width,i=Math.min(t.maxWidth/2,t.textRect.width/2),o=e.x-i,a=e.x+i;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):a>r&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{const n=0,r=t.outerRect.height,i=t.maxHeight/2,o=e.y-i,a=e.y+i;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):a>r&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(i,t),function(e,t){"top"===t.align?e.y-=t.padding:"bottom"===t.align?e.y+=t.padding+t.maxHeight:"left"===t.align?e.x-=t.padding:"right"===t.align&&(e.x+=t.padding)}(i,t),function(e,t){if(t.tilted){const n=-t.angle,r=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(r)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(r)/2):e.x-=t.maxHeight*Math.sin(r)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";const i=Math.cos(r)*t.maxWidth;if("bottom"===t.align==t.angle<0){const n=t.outerRect.width-t.paddingEnd;e.x+i>n&&(e.maxWidth=(n-e.x-10)/Math.cos(r))}else{const n=t.paddingEnd;e.x-i<n&&(e.maxWidth=(e.x-n-10)/Math.cos(r))}}}(i,t),function(e,t){e.boundingRect=t.textBounds(e)}(i,t),z8(e,i,t),i}function B8(e,t){const n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:e.value};return"top"===t.align||"bottom"===t.align?(n.x1=n.x2=e.position*t.innerRect.width+(t.innerRect.x-t.outerRect.x),n.y1="top"===t.align?t.innerRect.height:0,n.y2="top"===t.align?n.y1-t.tickSize:n.y1+t.tickSize):(n.y1=n.y2=e.position*t.innerRect.height+(t.innerRect.y-t.outerRect.y),n.x1="left"===t.align?t.innerRect.width:0,n.x2="left"===t.align?n.x1-t.tickSize:n.x1+t.tickSize),function(e,t){LQ(e,t.style)}(n,t),function(e,t){"top"===t.align?(e.y1-=t.padding,e.y2-=t.padding):"bottom"===t.align?(e.y1+=t.padding,e.y2+=t.padding):"left"===t.align?(e.x1-=t.padding,e.x2-=t.padding):"right"===t.align&&(e.x1+=t.padding,e.x2+=t.padding)}(n,t),function(e,t){const n=e.strokeWidth/2;e.x1===t.innerRect.width?(e.x1-=n,e.x2-=n):0===e.x1?(e.x1+=n,e.x2+=n):e.y1===t.innerRect.height?(e.y1-=n,e.y2-=n):0===e.y1&&(e.y1+=n,e.y2+=n)}(n,t),n}function H8(e){return!e.isMinor&&e.position>=0&&e.position<=1}function V8(e){let t=e.rect,n=e.state,r=e.majorTicks,i=e.measure;return e.horizontal?function(e){let t=e.majorTicks,n=e.measureText,r=e.rect;const i="layered"===e.state.labels.activeMode?2:1,o=r.width,a=t.map(e=>e.label).map(e=>"".concat(e.slice(0,1)).concat(e.length>1?"…":"")).map(n).map(e=>e.width);for(let e=0;e<t.length;++e){const n=t[e];if(i*o*Math.abs(n.start-n.end)<a[e])return!0}return!1}({majorTicks:r,measureText:i,rect:t,state:n}):function(e){let t=e.majorTicks,n=e.measureText;const r=e.rect.height,i=n("M").height;return!(t.length<2)&&r*Math.abs(t[0].position-t[1].position)<i}({majorTicks:r,measureText:i,rect:t})}function W8(e){let t=e.value,n=e.maxValue,r=e.minValue,i=e.range,o=e.modifier;return isNaN(i)||isNaN(o)||(t=i*o),t>n&&(t=n),t<r&&(t=r),t}function U8(e){let t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,a=e.settings,s=e.state,l=0;const c={left:0,top:0,right:0,bottom:0},u=a.labels,d=u.maxLengthPx,p=u.minLengthPx;if(a.labels.show){const e=a.align,u="top"===e||"bottom"===e,f=u?n.inner.width:n.inner.height,h=o.ticks({settings:a,distance:f,formatter:r}).filter(H8),m=e=>{const t=i({text:e,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return t.width=W8({value:t.width,maxValue:d,minValue:p}),t};if(t&&u&&"auto"===a.labels.mode&&(!function(e){let t=e.majorTicks,n=e.measure,r=e.rect,i=e.state,o=e.settings;const a=o.labels.maxGlyphCount,s="layered"===i.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=r.width;let d=0,p=0;if(isNaN(a))for(let e=0;e<t.length;e++){const r=t[e],i=r.label,o=n(i).width*(i.length>1?l:1);if(p=s*u*Math.abs(r.start-r.end),o+c>p)return!0}else{const e=t.reduce((e,t)=>Math.min(Math.abs(t.start-t.end),e),1/0);if(p=s*u*e,d=n("M").width*l*a,d+c>p)return!0}return!1}({majorTicks:h,measure:m,rect:n.inner,state:s,settings:a})?s.labels.activeMode="horizontal":s.labels.activeMode="tilted"),!a.labels.filterOverlapping&&"tilted"!==s.labels.activeMode&&V8({rect:n.inner,state:s,majorTicks:h,measure:m,horizontal:u})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let g,y;if("tilted"===s.labels.activeMode){const e=Math.abs(a.labels.tiltAngle)*(Math.PI/180);g=t=>W8({value:t.width,maxValue:d,minValue:p})*Math.sin(e)+t.height*Math.cos(e)}else g=u?e=>e.height:e=>W8({value:e.width,maxValue:d,minValue:p});if(u&&"tilted"!==s.labels.activeMode)y=["M"];else if(isNaN(a.labels.maxGlyphCount))y=h.map(e=>e.label);else{let e="";for(let t=0;t<a.labels.maxGlyphCount;t++)e+="M";y=[e]}const b=y.map(m),v=b.map(g),x=Math.max(...v,0);if(l+=x,l+=a.labels.margin,"layered"===s.labels.activeMode&&(l*=2),"tilted"===s.labels.activeMode){const e="bottom"===a.align==a.labels.tiltAngle>=0,t=Math.abs(a.labels.tiltAngle)*(Math.PI/180),r=(x-m("M").height*Math.cos(t))/Math.sin(t),i=e=>Math.min(r,e.width)*Math.cos(t)+e.height,o=(t,r)=>{const i=h[r]?h[r].position:0;return e?t-i*n.inner.width:t-(1-i)*n.inner.width},s=Math.min(a.labels.maxEdgeBleed,Math.max(...b.map(i).map(o),0))+a.paddingEnd;if(c[e?"left":"right"]=s,!a.labels.filterOverlapping&&function(e){let t=e.majorTicks,n=e.measureText,r=e.rect,i=e.bleedSize,o=e.angle;if(t.length<2)return!1;if(0===o)return!0;const a=Math.abs(o),s=1/(Math.min(r.outer.width-i,r.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(a*(Math.PI/180))/s}({majorTicks:h,measureText:m,rect:n,bleedSize:s,angle:a.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const G8=(e,t,n)=>e.width*Math.abs(t.position-n.position);function Y8(e){let t=e.layered,n=e.major,r=e.innerRect,i=e.outerRect,o=e.tick,a=e.index;const s=t?2:1,l=n[a-s],c=n[a+s],u=l?G8(r,o,l)/2-2:1/0,d=c?G8(r,o,c)/2-2:1/0;return n.length<2?r.width:l?c?2*Math.min(u,d):(e=>{let t=e.innerRect,n=e.outerRect,r=e.tick,i=e.prevWidth;const o=t.x-n.x,a=n.width-t.width-o,s=t.width-t.width*r.position+a,l=2*Math.min(i,s),c=1===r.position?t.width/2-2:0;return Math.max(i,l,c)})({innerRect:r,outerRect:i,tick:o,prevWidth:u}):(e=>{let t=e.innerRect,n=e.outerRect,r=e.tick,i=e.nextWidth;const o=t.x-n.x,a=t.width*r.position+o,s=2*Math.min(i,a),l=0===r.position?t.width/2-2:0;return Math.max(i,s,l)})({innerRect:r,outerRect:i,tick:o,nextWidth:d})}function K8(e){const t=e.innerRect,n={cx:t.width/2,cy:t.height/2},r=Math.min(t.height,t.width)/2*e.radius,i=r+e.style.strokeWidth,o={visible:!0,type:"path",arcDatum:{startAngle:e.startAngle,endAngle:e.endAngle},transform:"translate(0, 0) translate(".concat(n.cx,", ").concat(n.cy,")"),desc:{share:1,slice:{cornerRadius:0,innerRadius:r,outerRadius:i}},ticks:[]};return function(e,t){LQ(e,t.style)}(o,e),o}function X8(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function J8(e,t){const n=t.innerRect,r={cx:n.width/2,cy:n.height/2},i=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o;let c=a-e.position*l;c-=Math.PI/2;const u=X8(r.cx,r.cy,i+s,c),d=X8(r.cx,r.cy,i,c),p={type:"line",x1:u.x,y1:u.y,x2:d.x,y2:d.y,value:e.value};return function(e,t){const n=BQ({},t.style);LQ(e,n)}(p,t),p}function Q8(e){return"string"==typeof e||"number"==typeof e?e:"-"}function Z8(e,t,n){let r;return r="left"===t?n.x:"right"===t?e.outerRect.width-n.x:Math.max(n.x,e.outerRect.width-n.x),r}function e7(e,t){const n=t.innerRect,r={cx:n.width/2,cy:n.height/2},i=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o,c=.2;let u,d;u="top"===t.align||"bottom"===t.align?a-e.position*l:o+e.position*l,d=u<-.2&&u>-Math.PI+c?"left":u>.2&&u<Math.PI-c?"right":"center",u-=Math.PI/2;const p=function(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}(r.cx,r.cy,i+s+6,u);let f;f="left"===d?"end":"right"===d?"start":"middle";const h={type:"text",text:Q8(e.label),align:d,x:p.x,y:p.y,maxHeight:t.maxHeight,maxWidth:Z8(t,d,p),anchor:f,baseline:"middle"};return function(e,t){["fill","fontSize","fontFamily"].forEach(n=>{e[n]=t.style[n]})}(h,t),function(e,t){e.boundingRect=t.textBounds(e)}(h,t),function(e,t,n){let r,i;const o=parseFloat(n.fontSize)||0;r=t.y-o/2,i=e.innerRect.height-(t.y+o/2),(r<0||i<0)&&(n.text="")}(t,p,h),h}function t7(e){let t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function n7(e){let t=0;return t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function r7(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=t7(e)+e.labels.margin,t}function i7(e,t){return e.map(e=>B8(e,t))}function o7(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function a7(e){let t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.scale,o=e.tilted,a=e.layered,s=e.tick;const l=t.height,c=o7(i,s),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=r.width-r7(n)-n.paddingEnd;else if(a)u.width=c*r.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(r.height-r7(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*r.width;return u.width=W8({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function s7(e){let t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.outerRect,o=e.tilted,a=e.layered,s=e.tick,l=e.index,c=e.major;const u=t.height,d={width:0,height:u};if("left"===n.align||"right"===n.align)d.width=r.width-r7(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);d.width=(r.height-r7(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else d.width=Y8({layered:a,major:c,innerRect:r,outerRect:i,tick:s,index:l});return d.width=W8({value:d.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),d}function l7(e){let t;function n(){return t=s7,n}function r(){return t=a7,r}function i(e){let n=e.settings,r=e.scale,i=e.innerRect,o=e.outerRect,a=e.measureText,s=e.ticks,l=e.state,c=e.textBounds;const u=[],d=function(e){return e.filter(e=>!e.isMinor)}(s),p=function(e){return e.filter(e=>e.isMinor)}(s),f={innerRect:i,align:n.align,outerRect:o},h="tilted"===l.labels.activeMode,m="layered"===l.labels.activeMode;let g;if(n.arc&&(f.startAngle=n.arc.startAngle,f.endAngle=n.arc.endAngle,f.radius=n.arc.radius),n.line.show&&(f.style=n.line,f.padding=n.paddingStart,n.arc?u.push(K8(f)):u.push(L8(f))),n.ticks.show&&(f.style=n.ticks,f.tickSize=n.ticks.tickSize,f.padding=t7(n),n.arc?(f.padding=n7(n),g=function(e,t){return e.map(e=>J8(e,t))}(d,f)):g=i7(d,f)),n.labels.show){const e=r7(n);f.style=n.labels,f.padding=e,f.tilted=h,f.layered=m,f.angle=n.labels.tiltAngle,f.paddingEnd=n.paddingEnd,f.textBounds=c;const s=(e,s)=>{f.textRect=function(e){let t=e.style;return(0,e.measureText)({text:e.tick.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:a,style:f.style});const l=t({textMetrics:f.textRect,settings:n,innerRect:i,outerRect:o,scale:r,tilted:h,layered:m,tick:e,major:d,index:s});f.maxWidth=l.width,f.maxHeight=l.height,f.stepSize=function(e){let t=e.innerRect,n=e.scale,r=e.settings,i=e.tick;return("top"===r.align||"bottom"===r.align?t.width:t.height)*o7(n,i)}({innerRect:i,scale:r,settings:n,tick:e})};let l=[];n.arc?(f.padding=function(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=n7(e)+e.labels.margin,t}(n),l=function(e,t,n){return e.map((e,r)=>{n(e,r);const i=e7(e,t);return i.data=e.data,i})}(d,f,s)):l=!m||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map((e,r)=>{n(e,r);const i=$8(e,t);return i.data=e.data,i})}(d,f,s):function(e,t,n,r){const i=t.padding,o=r7(n);return e.map((e,a)=>{r(e,a);const s=o+t.maxHeight+n.labels.margin;t.layer=a%2,t.padding=a%2==0?i:s;const l=$8(e,t);return l.data=e.data,l})}(d,f,n,s),n.labels.filterOverlapping&&function(e,t,n){let r=(t,n)=>a6(ZQ(1,e[t].boundingRect),ZQ(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);r=(n,r)=>{const i=1/Math.abs(e[n].x-e[r].x),o=Math.sin(t*(Math.PI/180))/i;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let i=n+1;i<=Math.min(n+5,n+(e.length-1));i++)e[n]&&e[i]&&r(n,i)&&(i===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(i,1),t&&t.splice(i,1)),i--,n--)}(l,g,f),u.push(...l)}return n.minorTicks&&n.minorTicks.show&&p.length>0&&(f.style=n.minorTicks,f.tickSize=n.minorTicks.tickSize,f.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...i7(p,f))),g&&u.push(...g),u}return n.build=i,r.build=i,e?r():n()}const c7={labels:{show:!0,tiltAngle:40,tiltThreshold:.7,maxEdgeBleed:1/0,margin:4,maxLengthPx:150,minLengthPx:0,mode:"auto",maxGlyphCount:NaN,align:.5,offset:0,filterOverlapping:!1},ticks:{show:!1,margin:0,tickSize:4},line:{show:!1},paddingStart:0,paddingEnd:10,align:"auto"},u7={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0,centerEndLabels:!1},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};const d7={require:["chart","renderer","dockConfig"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{},style:{labels:"$label",ticks:"$guide-line",minorTicks:"$guide-line--minor",line:"$guide-line"}},created(){this.state={isDiscrete:!!this.scale.bandwidth,isHorizontal:!1,labels:{activeMode:"horizontal"},ticks:[],innerRect:{width:0,height:0,x:0,y:0},outerRect:{width:0,height:0,x:0,y:0},defaultDock:void 0,concreteNodeBuilder:void 0,settings:void 0},this.state.isDiscrete?this.state.defaultDock="bottom":this.state.defaultDock="left",this.setState(this.settings)},setState(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(e){let t=e.state,n=e.style,r=e.settings;const i=LQ(!0,{},t.isDiscrete?c7:u7,n),o=LQ(!0,{},i,r.settings),a=r.layout.dock||t.defaultDock;o.dock=a,o.align=function(e,t){const n=["top","bottom"],r=["left","right"];return-1!==n.indexOf(e)&&-1===r.indexOf(t)||-1!==r.indexOf(e)&&-1===n.indexOf(t)?e:t}(r.settings.align,a),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const s=o.paddingStart,l=o.paddingEnd;return o.paddingStart="function"==typeof s?s.call(null):s,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=l7(this.state.isDiscrete),this.dockConfig.dock(this.state.settings.dock),this.state.isHorizontal="top"===this.state.settings.align||"bottom"===this.state.settings.align,this.state.labels.activeMode=function(e,t,n){const r=t.labels.mode;return n&&e.isHorizontal?"auto"===r?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?r:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(e){const t=this.formatter,n=this.state,r=this.scale,i=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=d4(r,i);const o=function(e){let t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,a=e.settings,s=0;const l=U8({isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:e.state}),c=l.size,u=l.edgeBleed;if(s+=c,l.isToLarge)return{size:s};if(a.ticks.show&&(s+=a.ticks.margin,s+=a.ticks.tickSize),a.minorTicks&&a.minorTicks.show){const e=a.minorTicks.margin+a.minorTicks.tickSize;e>s&&(s=e)}if(a.line.show){const e=a.line.strokeWidth/2;s+=e,u[function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return e}}(a.align)]=Math.ceil(e)}return s+=a.paddingStart,s+=a.paddingEnd,{size:s,edgeBleed:u}}({isDiscrete:this.state.isDiscrete,rect:{inner:e.inner,outer:e.outer},formatter:t,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n});return o},beforeUpdate(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).settings;this.setState(e)},resize(e){const t=e.inner,n=e.outer,r=LQ({},t,function(e){let t=e.align,n=e.inner;return"left"===t?{x:n.width+n.x}:"right"===t||"bottom"===t?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:t})),i=n||r;return LQ(this.state.innerRect,r),LQ(this.state.outerRect,i),n},beforeRender(){const e=this.scale,t=this.formatter,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=d4(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter(e=>e.position>=0&&e.position<=1)},render(){const e=this.state,t=[];return t.push(...this.state.concreteNodeBuilder.build({settings:this.state.settings,scale:this.state.pxScale,innerRect:this.state.innerRect,outerRect:this.state.outerRect,measureText:this.renderer.measureText,textBounds:this.renderer.textBounds,ticks:this.state.ticks,state:e})),w8.multiple(t),t}};const p7={render:()=>[]};function f7(e,t,n){let r="";if("function"==typeof e)r=e();else if("string"==typeof e)r=e;else if(n){const e=(n.data().fields||[]).map(e=>e.title());r=e.join(t)}return r}function h7(e,t){let n="middle";return"left"===e?"top"===t?n="end":"bottom"===t&&(n="start"):"right"===e?"top"===t?n="start":"bottom"===t&&(n="end"):"left"===t?n="start":"right"===t&&(n="end"),n}const m7={require:["renderer","chart"],defaultSettings:{layout:{dock:"bottom",displayOrder:0,prioOrder:0},settings:{paddingStart:5,paddingEnd:5,paddingLeft:0,paddingRight:0,anchor:"center",join:", ",maxLengthPx:NaN},style:{text:"$title"}},created(){this.definitionSettings=this.settings.settings;const e=this.settings.text,t=this.definitionSettings.join;this.title=f7(e,t,this.scale)},preferredSize(){return this.renderer.measureText({text:this.title,fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily}).height+this.definitionSettings.paddingStart+this.definitionSettings.paddingEnd},render(){const e=this.title,t=this.definitionSettings,n=this.rect,r=[];return r.push(function(e){let t=e.title,n=e.definitionSettings,r=e.dock,i=e.rect,o=e.measureText,a=e.style;const s={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:h7(r,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};LQ(s,a.text);const l=o(s);if("top"===r||"bottom"===r){let e=i.width/2;"left"===n.anchor?e=n.paddingLeft||0:"right"===n.anchor&&(e=i.width-(n.paddingRight||0)),s.x=e,s.y="top"===r?i.height-n.paddingStart:n.paddingStart+l.height,s.dy="top"===r?-l.height/6:-l.height/3,s.maxWidth=.8*i.width}else{let e=i.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=i.height-n.paddingStart),s.y=e,s.x="left"===r?i.width-n.paddingStart:n.paddingStart,s.dx="left"===r?-l.height/3:l.height/3;const t="left"===r?270:90;s.transform="rotate(".concat(t,", ").concat(s.x+s.dx,", ").concat(s.y+s.dy,")"),s.maxWidth=.8*i.height}return isNaN(n.maxLengthPx)||(s.maxWidth=Math.min(s.maxWidth,n.maxLengthPx)),s}({title:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),r},beforeUpdate(e){e.settings&&(LQ(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=f7(t,n,this.scale)}};function g7(e,t){const n=e.settings.layout.dock,r=e.settings.settings.invert,i="top"===n||"bottom"===n,o=i?"width":"height",a=e.rect[o],s=e.chart.scroll(e.settings.scroll);let l;{let e=t[i?"x":"y"];r&&(e=a-e);const n=s.getState();l={startOffset:e,startScroll:n.start,swipe:!1};const o=e/a*(n.max-n.min)+n.min;o<n.start?l.startScroll=o:o>n.start+n.viewSize&&(l.startScroll=o-n.viewSize)}return{update:e=>{let t=e[i?"x":"y"];if(r&&(t=a-t),!l.swipe){if(Math.abs(l.startOffset-t)<=1)return;l.swipe=!0}const n=s.getState(),o=(t-l.startOffset)/a*(n.max-n.min),c=l.startScroll+o;s.moveTo(c)},end:e=>{let t=e[i?"x":"y"];r&&(t=a-t);const n=s.getState();if(l.swipe){const e=(t-l.startOffset)/a*(n.max-n.min),r=l.startScroll+e;s.moveTo(r)}else{const e=t/a*(n.max-n.min)+n.min-n.viewSize/2;s.moveTo(e)}}}}function y7(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const b7={require:["chart","renderer"],on:{panStart(e){const t=y7(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=g7(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=y7(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=y7(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=y7(e,this.renderer);g7(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){const t=this.chart.scroll(this.settings.scroll).getState();if(t.viewSize>=t.max-t.min){return Math.max(e.width,e.height)}return this.settings.settings.width},render:function(e){const t=this.settings.layout.dock,n=this.settings.settings.invert,r="top"===t||"bottom"===t,i=r?"width":"height",o=this.rect[i],a=this.chart.scroll(this.settings.scroll).getState();let s=o*(a.start-a.min)/(a.max-a.min);const l=o*a.viewSize/(a.max-a.min);return n&&(s=o-s-l),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("div",{class:"scroller",style:{position:"absolute",[r?"left":"top"]:"".concat(s,"px"),[r?"top":"left"]:"25%",[r?"height":"width"]:"50%",[i]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function v7(e){let t=e.h,n=e.isVertical,r=e.value,i=e.pos,o=e.align,a=e.borderHit,s=e.state,l=e.idx;const c="end"!==o,u=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let d=0,p="100%",f="100%";return s.targetRect&&"start"===s.settings.bubbles.align?(p="".concat(s.targetRect.x+s.targetRect.width,"px"),f="".concat(s.targetRect.y+s.targetRect.height,"px")):s.targetRect&&"end"===s.settings.bubbles.align&&(d=n?s.targetRect.x:s.targetRect.y,p="".concat(s.rect.width-d,"px"),f="".concat(s.rect.height-d,"px")),c||(i-=a),t("div",{onmouseover(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(e){e.srcElement.children[0].style.backgroundColor=s.style.line.stroke,e.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":r,"data-key":[s.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?d:i,"px"),top:"".concat(n?i:d,"px"),height:n?"".concat(a,"px"):f,width:n?p:"".concat(a,"px"),pointerEvents:"auto"}},[t("div",{style:LQ({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function x7(e){let t=e.h,n=e.isVertical,r=e.label,i=e.otherValue,o=e.rangeIdx,a=e.idx,s=e.pos,l=e.align,c=e.state,u=e.value;const d="end"!==l,p="outside"===c.settings.bubbles.placement;let f,h="none";n?(f=d?"left":"right",p&&(h=d?"translate(-100%, 0px)":"translate(100%, 0px)")):(f=d?"top":"bottom",p&&(h=d?"translate(0px, -100%)":"translate(0px, 100%)"));let m=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===a;const g={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let y=c.style.bubble.stroke;const b=m?t("input",{type:"text",value:u,style:BQ(BQ({},g),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)?(y="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(y)):c.onEditConfirmed(o,t,i)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c.onEditCanceled())}}):t("div",{"data-key":[c.key,"bubble",o,a].join("-"),"data-other-value":i,"data-idx":o,"data-bidx":a,style:g},[r]);return t("div",{style:{position:"absolute",[f]:"0",[n?"top":"left"]:"".concat(s,"px"),transform:h}},[b])}function w7(e){let t=e.h,n=e.isVertical,r=e.top,i=e.height,o=e.color,a=e.on,s=e.opacity;return t("div",LQ({style:{backgroundColor:o,opacity:s,position:"absolute",left:n?0:"".concat(r,"px"),top:n?"".concat(r,"px"):0,height:n?"".concat(i,"px"):"100%",width:n?"100%":"".concat(i,"px"),pointerEvents:"auto"}},a),[])}function S7(e){let t=e.borderHit,n=e.els,r=e.isVertical,i=e.state,o=e.vStart,a=e.vEnd,s=e.idx,l=0;i.targetRect&&(l=r?i.targetRect.y:i.targetRect.x);const c=!!i.scale,u=c?i.scale.norm(o)*i.size:o,d=c?i.scale.norm(a)*i.size:a,p=Math.abs(u-d),f=Math.min(u,d)+l,h=f+p;if(i.targetRect){const e=i.targetFillRect||i.targetRect,t=r?e.height:e.width,s=c?i.scale.norm(o)*t:o,l=c?i.scale.norm(a)*t:a,u=Math.abs(s-l),d=Math.min(s,l),p={h:i.h,isVertical:r,top:d,height:u,color:i.style.target.fill,opacity:i.style.target.opacity};i.style.target.opacity<.8&&(p.on={onmouseover(e){e.srcElement.style.opacity=i.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=i.style.target.opacity}}),n.push(i.h("div",{style:{position:"absolute",left:"".concat(e.x,"px"),top:"".concat(e.y,"px"),height:"".concat(e.height,"px"),width:"".concat(e.width,"px")}},[w7(p)]))}const m=u<d?o:a,g=u<d?a:o,y=HQ(c?i.scale.domain():[Math.min(o,a),Math.max(o,a)],2),b=y[0],v=y[1],x=m+1e-5>=b&&m-1e-5<=v,w=g-1e-5<=v&&g+1e-5>=b;x&&n.push(v7({h:i.h,isVertical:r,borderHit:t,value:m,pos:f,align:"start",state:i,idx:s})),w&&n.push(v7({h:i.h,isVertical:r,borderHit:t,value:g,pos:h,align:"end",state:i,idx:s}));const S=i.settings.bubbles;if(S&&S.show){S.fontSize,S.fontFamily,S.fill;const e=[o,a];x&&n.push(x7({h:i.h,isVertical:r,align:S.align,rangeIdx:s,idx:0,otherValue:g,value:m,label:"".concat(i.format(m,e)),pos:f,state:i})),w&&n.push(x7({h:i.h,isVertical:r,align:S.align,rangeIdx:s,idx:1,otherValue:m,value:g,label:"".concat(i.format(g,e)),pos:h,state:i}))}}function k7(e){const t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start;let r=e.current-e.start;return r=r<0?Math.max(r,n):Math.min(r,t),r}function C7(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach((r,i)=>{e.active&&i===e.active.idx||S7({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(r.min,r.max),vEnd:Math.max(r.min,r.max),idx:i})}),e.active){let r=e.start,i=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)r=Math.min(e.active.start,e.active.end),i=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)r=Math.min(e.start,e.current),i=Math.max(e.start,e.current);else{const t=k7(e);r=e.active.start+t,i=e.active.end+t}S7({borderHit:5,els:t,isVertical:n,state:e,vStart:r,vEnd:i,idx:e.active.idx})}return t}function E7(e){return{min:e.scale.min(),max:e.scale.max()}}function M7(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function R7(e,t,n){let r,i,o=e.ranges,a=-1;for(r=0;r<o.length;r++){if(o[r].min<=t&&t<=o[r].max){a=r,n.min=r?o[r-1].max:n.min,n.max=r+1<o.length?o[r+1].min:n.max;break}if(t<o[r].min){n.max=o[r].min,n.min=r?o[r-1].max:n.min;break}}-1===a&&o.length&&r>=o.length&&(n.min=o[o.length-1].max),-1!==a&&(i={idx:a,start:o[a].min,end:o[a].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=i}function _7(e){e.renderer.render(C7(e))}function A7(e,t){if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map(e=>e.id()),i=t.brushes().filter(e=>"range"===e.type&&-1!==r.indexOf(e.id))[0];return i?i.brush.ranges():[]}function I7(e,t){let n,r=1/0;const i=t.domain(),o=t.bandwidth()/2;for(let a=0;a<i.length;++a){const s=Math.abs(e-o-t(i[a]));s<r&&(r=s,n=i[a])}return n}function P7(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function T7(e){const t=e.reduce((e,t)=>(e.push(...KQ(t.bounds)),e),[]);return XQ(t)}const D7={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{rangeStart(e){this.start(e)},rangeMove(e){this.move(e)},rangeEnd(e){this.end(e)},rangeClear(e){this.clear(e)},bubbleStart(e){this.bubbleStart(e)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(e){this.state.rect=e.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=A7(this.state,this.state.brushInstance),this.state.active=null,_7(this.state))},render(e){const t=this.settings.settings;this.state.direction="vertical"===t.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),r=this.state.rect[0===this.state.direction?"height":"width"];let i=d4(this.chart.scale(t.scale),r);const o=function(e){const t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,r=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map(t=>e.chart.component(t)).filter(e=>!!e&&!!e.rect),i=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(i.length>0){const r=T7(i);if(t.size=r[0===e.state.direction?"height":"width"],t.scale=d4(e.chart.scale(n.scale),t.size),t.targetRect=r,o.length>0){const e=T7(o);t.targetFillRect=e}}else if(r&&r.length>0){const n=r.slice(1).reduce((e,t)=>({x0:Math.min(e.x0,t.rect.computedInner.x),y0:Math.min(e.y0,t.rect.computedInner.y),x1:Math.max(e.x1,t.rect.computedInner.x+t.rect.computedInner.width),y1:Math.max(e.y1,t.rect.computedInner.y+t.rect.computedInner.height)}),{x0:r[0].rect.computedInner.x,y0:r[0].rect.computedInner.y,x1:r[0].rect.computedInner.x+r[0].rect.computedInner.width,y1:r[0].rect.computedInner.y+r[0].rect.computedInner.height});t.targetRect={x:n.x0-e.state.rect.x,y:n.y0-e.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return t}(this);if(i=o.scale?o.scale:i,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?r:o.size,this.state.settings=t,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof t.brush?t.brush.context:t.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.onEditConfirmed=(e,t,n)=>{this.state.edit=null,function(e,t,n,r){let i=e.ranges.map(e=>({min:e.min,max:e.max}));const o=e.scale.min(),a=e.scale.max();i[t]={min:Math.max(o,Math.min(n,r)),max:Math.min(a,Math.max(n,r))},e.ranges[t]=BQ({},i[t]);const s=e.scale.data();s&&s.fields&&s.fields.forEach(t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),i)})}(this.state,e,t,n),this.emit("bubbleEnd"),_7(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,_7(this.state)},this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX"},this.state.format="function"==typeof t.bubbles.label&&((e,n)=>t.bubbles.label.call(void 0,{datum:e,data:n,scale:i,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(i,"norm")){this.state.editable=!0,this.state.observeBrush="object"==typeof t.brush&&t.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=i;const e=this.state.scale.data();!this.state.format&&e&&e.fields&&e.fields[0]&&(this.state.format=e.fields[0].formatter())}else this.state.editable=!1,this.state.scale=h3(),this.state.scale.data=i.data,this.state.format||(this.state.format=(e,t)=>P7(i.range(),t)?function(e,t){const n=t.ticks(),r=t.domain().indexOf(I7(e,t));return-1!==r?n[r].label:"-"}(e,i):"-"),this.state.fauxBrushInstance=Q3(),this.state.findValues=e=>function(e,t){const n=t.domain(),r=t.range(),i=[];return e.forEach(e=>{if(!P7(r,[e.min,e.max]))return;const o=n.indexOf(I7(e.min,t)),a=n.indexOf(I7(e.max,t));i.push.apply(i,n.slice(Math.min(o,a),Math.max(o,a)+1))}),i}(e,i);return this.state.ranges=A7(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[C7(this.state)]:[]},mounted(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start(e){!function(e){let t=e.state,n=e.e,r=e.renderer,i=e.ranges,o=e.targetSize;if(t.started)return;t.edit=null;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);const c={started:!0};t.offset=LQ({},r.element().getBoundingClientRect());const u=a-t.offset.left,d=s-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=i(t,t.fauxBrushInstance||t.brushInstance);const p=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];c.current=t.scale.normInvert(f/t.size),c.start=t.scale.normInvert(p/t.size);let h=t.ranges;const m=E7(t);let g,y,b=-1;if(l&&l.hasAttribute("data-idx"))b=parseInt(l.getAttribute("data-idx"),10),m.min=b>0?h[b-1].max:m.min,m.max=b+1<h.length?h[b+1].min:m.max;else{for(g=0;g<h.length;g++){if(h[g].min<=c.start&&c.start<=h[g].max){b=g,m.min=g?h[g-1].max:m.min,m.max=g+1<h.length?h[g+1].min:m.max;break}if(c.start<h[g].min){m.max=h[g].min,m.min=g?h[g-1].max:m.min;break}}-1===b&&h.length&&g>=h.length&&(m.min=h[h.length-1].max)}if(-1!==b||t.multi||(c.ranges=[],m.min=t.scale.min(),m.max=t.scale.max()),-1!==b)if(y={idx:b,start:h[b].min,end:h[b].max,limitLow:m.min,limitHigh:m.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{let e=t.scale.norm(y.start)*t.size,n=t.scale.norm(y.end)*t.size;Math.abs(p-e)<=o?(c.start=y.end,y.mode="modify"):Math.abs(p-n)<=o&&(c.start=y.start,y.mode="modify")}else y={idx:-1,start:c.start,end:c.current,limitLow:m.min,limitHigh:m.max,mode:"current"};c.active=y,"modify"!==y.mode&&t.targetRect&&!l6(t.targetRect,{x:u,y:d})||Object.keys(c).forEach(e=>t[e]=c[e])}({e:e,state:this.state,renderer:this.renderer,ranges:A7,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=E7(e);R7(e,e.current,n)}(this.state,A7),_7(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(e){this.state.started&&(!function(e,t){const n=(t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset])/e.size,r=e.scale.normInvert(n);e.current=Math.max(Math.min(r,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){let t=e.ranges.map(e=>({min:e.min,max:e.max}));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=k7(e);t[e.active.idx].min+=n,t[e.active.idx].max+=n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});const n=e.scale.data();n&&n.fields&&n.fields.forEach(n=>{if(e.fauxBrushInstance){let r=A7(e,e.fauxBrushInstance),i=e.findValues(r),o=e.findValues(t),a=o.filter(e=>-1===i.indexOf(e)),s=i.filter(e=>-1===o.indexOf(e)),l=a.map(e=>({key:n.id(),value:e})),c=s.map(e=>({key:n.id(),value:e}));e.brushInstance.addAndRemoveValues(l,c),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)})}(this.state),_7(this.state))},clear(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart(e){if(!this.state.editable)return;const t=e.srcEvent||e,n=t.target,r={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(isNaN(r.rangeIdx)||JSON.stringify(r)===JSON.stringify(this.state.edit))return;this.state.edit=r,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const i=n.parentNode;_7(this.state);const o=i.querySelector("input");o.focus(),o.select()}};function O7(e){e.renderer.render(C7(e))}function N7(e){return e.rc.ranges()}function q7(e,t){const n={x:e.direction?t.min+e.rect.x:e.rect.x,y:e.direction?e.rect.y:t.min+e.rect.y,width:e.direction?t.max-t.min:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:t.max-t.min};return e.chart.shapesAt(n,e.settings.brush)}const L7={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaClear(e){this.clear(e)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(e){this.state.rect=this.rect;const t=this.settings.settings,n="vertical"===t.direction?0:1,r=this.state.rect[0===n?"height":"width"],i=this.renderer.element().getBoundingClientRect(),o=(t.target?t.target.components||[t.target.component]:[]).map(e=>this.chart.component(e)).filter(e=>!!e&&!!e.rect),a=o[0]?o.slice(1).reduce((e,t)=>({x0:Math.min(e.x0,t.rect.x),y0:Math.min(e.y0,t.rect.y),x1:Math.max(e.x1,t.rect.x+t.rect.width),y1:Math.max(e.y1,t.rect.y+t.rect.height)}),{x0:o[0].rect.x,y0:o[0].rect.y,x1:o[0].rect.x+o[0].rect.width,y1:o[0].rect.y+o[0].rect.height}):null;return this.state.targetRect=a?{x:a.x0-this.rect.x,y:a.y0-this.rect.y,width:a.x1-a.x0,height:a.y1-a.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=n,this.state.settings=t,this.state.offset=i,this.state.rc=F3(),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.size=r,this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX",area:0===this.state.direction?"height":"width"},this.state.format=function(e,t){return function(e,t,n){const r=Math.min(...n),i=Math.max(...n),o={x:e.direction?r+e.rect.x:e.rect.x,y:e.direction?e.rect.y:r+e.rect.y,width:e.direction?i-r:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:i-r},a=e.chart.shapesAt(o,e.settings.brush);if(0===a.length)return"-";const s=a.reduce((n,i)=>{const o=n.bounds,a=i.bounds;return t===r?o[e.cssCoord.coord]<=a[e.cssCoord.coord]?n:i:o[e.cssCoord.coord]+o[e.cssCoord.area]>=a[e.cssCoord.coord]+a[e.cssCoord.area]?n:i}),l=e.settings.brush.components.reduce((e,t)=>e.key===s.key?e:t);return"function"==typeof e.settings.bubbles.label?e.settings.bubbles.label(s.data):Array.isArray(l.data)&&l.data.length?s.data[l.data[0]].label:s.data&&s.data.label?s.data.label:"-"}(this,e,t)},[]},start(e){!function(e){let t=e.state,n=e.e,r=e.renderer,i=e.ranges,o=e.targetSize;if(t.started)return;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);const c={started:!0};t.offset=r.element().getBoundingClientRect(),t.ranges=i(t);const u=a-t.offset.left,d=s-t.offset.top,p=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];let h=f,m=p;c.start=p,c.current=f;let g=t.ranges;const y=M7(t);let b,v,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),y.min=x>0?g[x-1].max:y.min,y.max=x+1<g.length?g[x+1].min:y.max;else{for(b=0;b<g.length;b++){if(g[b].min<=m&&m<=g[b].max){x=b,y.min=b?g[b-1].max:y.min,y.max=b+1<g.length?g[b+1].min:y.max;break}if(m<g[b].min){y.max=g[b].min,y.min=b?g[b-1].max:y.min;break}}-1===x&&g.length&&b>=g.length&&(y.min=g[g.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(v={idx:x,start:g[x].min,end:g[x].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),v.mode="modify";else{let e=v.start,t=v.end;Math.abs(p-e)<=o?(c.start=v.end,v.mode="modify"):Math.abs(p-t)<=o&&(c.start=v.start,v.mode="modify")}else v={idx:-1,start:m,end:h,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=v,"modify"!==v.mode&&t.targetRect&&!l6(t.targetRect,{x:u,y:d})||Object.keys(c).forEach(e=>t[e]=c[e])}({e:e,state:this.state,renderer:this.renderer,ranges:N7,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=M7(e);R7(e,e.current,n)}(this.state,N7),O7(this.state))},move(e){this.state.started&&(!function(e,t){const n=t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];e.current=Math.max(Math.min(n,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){const t=e.ranges.map(e=>({min:e.min,max:e.max}));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=k7(e);t[e.active.idx].min=e.active.start+n,t[e.active.idx].max=e.active.end+n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});e.rc.set(t);let n=[];t.forEach(t=>{n=[...n,...q7(e,t)]}),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),O7(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function j7(e){const t="vertical"===e.direction,n=e.rect[t?"height":"width"],r=e.rect[t?"width":"height"];return function(e){const t=e.brush;if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map(e=>e.id()),i=t.brushes().filter(e=>"range"===e.type&&-1!==r.indexOf(e.id))[0];return i?i.brush.ranges():[]}(e).map(i=>{const o=e.scale(i.min)*n,a=e.scale(i.max)*n,s=Math.min(o,a),l=Math.abs(o-a);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:s,width:t?r:l,y:t?s:0,height:t?l:r}})}function z7(e,t,n,r){function i(){!function(e){e.renderer.render(j7(e))}(e)}function o(){!function(e){e.renderer.render(j7(e))}(e)}function a(){!function(e){e.renderer.render(j7(e))}(e)}e.brush=t,t&&(t.on("start",i),t.on("update",o),t.on("end",a),e.start=i,e.update=o,e.end=a,e.brush=t,e.scale=n,e.renderer=r)}function F7(e){e.brush&&(e.brush.removeListener("start",e.start),e.brush.removeListener("update",e.update),e.brush.removeListener("end",e.end)),e.start=void 0,e.update=void 0,e.end=void 0,e.brush=void 0,e.scale=void 0,e.renderer=void 0}const $7={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",r="horizontal"===n?this.rect.width:this.rect.height,i=d4(this.chart.scale(e.scale),r);return F7(this.state),z7(this.state,t,i,this.renderer),this.state.rect=this.rect,this.state.fill=e.fill||"#ccc",this.state.opacity=void 0!==e.opacity?e.opacity:1,this.state.direction=n,j7(this.state)},beforeDestroy(){F7(this.state)}};function B7(e,t){const n=t.center.x,r=t.center.y;return{x:n-e.left,y:r-e.top}}function H7(e,t,n){return A4(e,t.points[0])<n.settings.snapIndicator.threshold**2}function V7(e,t){null==e.path.d?e.path.d="M".concat(t.x," ").concat(t.y," "):e.path.d+="L".concat(t.x," ").concat(t.y," "),e.points.push(t)}function W7(e){let t=e.state,n=e.start,r=void 0===n?null:n,i=e.end,o=void 0===i?null:i;null!==r&&(t.snapIndicator.x1=r.x,t.snapIndicator.y1=r.y),null!==o&&(t.snapIndicator.x2=o.x,t.snapIndicator.y2=o.y)}function U7(e,t){e.snapIndicator.visible=t}const G7={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart(e){this.start(e)},lassoEnd(e){this.end(e)},lassoMove(e){this.move(e)},lassoCancel(){this.cancel()}},created(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start(e){var t;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(e,t){const n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=this.settings.settings.brush.components.map(e=>({key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"}));const n=B7(this.state.rendererBounds,e);V7(this.state,n),W7({state:this.state,start:n}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,n)},move(e){if(!this.state.active)return;const t=B7(this.state.rendererBounds,e);H7(t,this.state,this.settings)?U7(this.state,!0):U7(this.state,!1),V7(this.state,t),W7({state:this.state,end:t}),function(e,t){const n=[e.startPoint,e.path,e.snapIndicator].filter(e=>e.visible);t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){const n=e.points[e.points.length-2],r=e.points[e.points.length-1];e.lineBrushShape.x1=n.x+e.componentDelta.x,e.lineBrushShape.y1=n.y+e.componentDelta.y,e.lineBrushShape.x2=r.x+e.componentDelta.x,e.lineBrushShape.y2=r.y+e.componentDelta.y;const i=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(i,{components:e.brushConfig})}}(this.state,this.chart)},end(e){if(!this.state.active)return;U7(this.state,!1);H7(B7(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){const n=e.componentDelta.x,r=e.componentDelta.y,i=e.points.map(e=>({x:e.x+n,y:e.y+r})),o=t.shapesAt({vertices:i},{components:e.brushConfig});t.brushFromShapes(o,{components:e.brushConfig})}}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([])},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach(e=>{e.contexts.forEach(e=>{t.brush(e).end()})}),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},render(){}};function Y7(e,t,n,r,i){let o,a=0,s=t.length-1;for(;a<s;){let l=Math.floor((a+s)/2);o=i(t[l]),o[n]+o[r]<e[n]?a=l+1:s=l}return a}function K7(e){let t=e.orientation,n=e.targetNodes,r=e.labels,i=e.container,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Y7;const a=[],s="v"===t?"x":"y",l="v"===t?"width":"height",c=e=>e.textBounds,u=e=>e.node.localBounds;return(e,t)=>{const d=r[t],p=d.textBounds,f=d.node;if(p[s]<i[s]||p[s]+p[l]>i[s]+i[l])return!1;for(let e=o(p,a,s,l,c);e<a.length;e++)if(a6(p,a[e].textBounds))return!1;const h=o(p,n,s,l,u),m=p[s]+p[l];for(let e=h;e<n.length;e++){const t=n[e].node;if(m<t.localBounds[s])break;if(a6(p,t.localBounds)&&f!==t)return!1}return a.push(r[t]),!0}}function X7(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function J7(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function Q7(e){return BQ(BQ({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds),{},{data:"".concat(e.data," ").concat(e.text),rotation:e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal"})}function Z7(e,t,n){return n?e.width>=t.height:e.width>=t.width}function e9(e,t,n){return n?e.height>=t.width:e.height>=t.height}function t9(e,t,n,r,i){let o,a;return"v"===e?(o=r||i||Z7(t,n,!0),a=e9(t,n,!r)):(o=Z7(t,n),a=i||e9(t,n,!1)),o&&a}function n9(e,t,n,r){return e+.5*t+(r-.5)*(t-n)-.5*n}function r9(e,t,n){const r={type:"text",text:t,maxWidth:n.rotate?e.height:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:n.rotate?"end":"start",baseline:"central",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(!n.overflow&&!function(e,t,n){return Z7(e,t,n.rotate)&&e9(e,t,n.rotate)}(e,i,n))return!1;const o=.5*i.height;return n.rotate?(r.x=n9(e.x,e.width,i.height,n.align)+o,r.y=n9(e.y,e.height,i.width,n.justify),"right"===n.dock?r.transform="rotate(90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,") translate(").concat(i.width,", 0)"):r.transform="rotate(-90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,")")):(r.x=n9(e.x,e.width,i.width,n.align),r.y=n9(e.y,e.height,i.height,n.justify)+o),r}function i9(e){let t=e.bar,n=e.view,r=e.direction,i=e.position,o=e.padding,a=void 0===o?4:o,s=e.measured;const l={};if(LQ(l,t),i&&"inside"!==i)if("up"===r||"down"===r){const e=Math.max(0,Math.min(t.y,n.height)),o=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===i&&"up"===r||"opposite"===i&&"down"===r?(l.y=0,l.height=e):("outside"===i&&"down"===r||"opposite"===i&&"up"===r)&&(l.y=o,l.height=n.height-o)}else{const e=Math.max(0,Math.min(t.x,n.width)),o=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===i&&"left"===r||"opposite"===i&&"right"===r?(l.x=0,l.width=e):("outside"===i&&"right"===r||"opposite"===i&&"left"===r)&&(l.x=o,l.width=n.width-o)}else;return function(e,t){const n=Math.max(0,Math.min(e.y,t.height)),r=Math.max(0,Math.min(e.y+e.height,t.height)),i=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=i,e.width=o-i,e.y=n,e.height=r-n}(l,n),function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=n.top,i=void 0===r?4:r,o=n.bottom,a=void 0===o?4:o,s=n.left,l=void 0===s?4:s,c=n.right,u=void 0===c?4:c,d="function"==typeof l?l(t):l,p="function"==typeof u?u(t):u,f="function"==typeof i?i(t):i,h="function"==typeof a?a(t):a;e.x+=d,e.width-=d+p,e.y+=f,e.height-=f+h}(l,s,a),l}function o9(e){let t,n,r,i,o,a=e.direction,s=e.fitsHorizontally,l=e.measured,c=e.node,u=e.orientation,d=e.placementSettings,p=e.rect,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i9;const h=[],m="h"===u?"width":"height";for(o=0;o<d.length;o++)if(r=d[o],i=f({bar:c.localBounds,view:p,direction:a,position:r.position,padding:r.padding,measured:l}),h.push(i),t=!o||i[m]>t[m]?i:t,t9(u,i,l,s,r.overflow)){n=i;break}return n||(n=t,o=h.indexOf(n)),r=d[o],{bounds:n,placement:r}}function a9(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const o=i.top,a=void 0===o?4:o,s=i.bottom,l=void 0===s?4:s,c=i.left,u=void 0===c?4:c,d=i.right,p=void 0===d?4:d,f="function"==typeof u?u(t):u,h="function"==typeof p?p(t):p,m="function"==typeof a?a(t):a,g="function"==typeof l?l(t):l,y=e.x+e.dx,b=e.y+e.dy,v=n?Math.min(t.width,r.height):Math.min(t.height,r.width),x=n?Math.min(t.height,r.height):Math.min(t.width,r.width),w=.5*t.height,S=1e-9;return{x:(n?y-w:y)-f-S,y:(n?b:b-w)-m-S,width:x+(f+h)-S,height:v+(m+g)-S}}function s9(e){let t=e.chart,n=e.targetNodes,r=e.rect,i=e.fitsHorizontally,o=e.collectiveOrientation,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o9,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r9,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:K7;const c=[],u={container:r,targetNodes:n,labels:[],orientation:o};let d,p,f,h,m,g,y,b,v,x,w,S,k,C;for(let e=0,l=n.length;e<l;e++){g=null,p=n[e],f=p.node,k=X7(f,t),v=p.direction,C="left"===v||"right"===v?"h":"v";for(let t=0;t<p.texts.length;t++){if(h=p.texts[t],!J7(h))continue;x=p.labelSettings[t],b=p.measurements[t],S=x.placements;const n=a({direction:v,fitsHorizontally:i,lblStngs:x,measured:b,node:f,orientation:C,placements:S,placementSettings:p.placementSettings[t],rect:r});if(g=n.bounds,w=n.placement,g&&w){var E;m=w.justify;const t="function"==typeof x.linkData?x.linkData(k,e):void 0,n="function"==typeof w.overflow?w.overflow(k,e):w.overflow;"up"===v&&(m=1-m),"opposite"===w.position&&(m=1-m),"left"===v&&(m=1-m);const r=!("h"===o||i);if(d=s(g,h,{justify:"h"===C?w.align:m,align:"h"===C?m:w.align,fontSize:x.fontSize,fontFamily:x.fontFamily,textMetrics:b,rotate:r,overflow:!!n,dock:null!==(E=x.dock)&&void 0!==E?E:"left"}),d){const n=a9(d,b,r,g,w.padding);y="function"==typeof w.fill?w.fill(BQ(BQ({},k),{},{textBounds:n}),e):w.fill,d.fill=y,void 0!==t&&(d.data=t),"object"==typeof w.background&&(d.backgroundColor="function"==typeof w.background.fill?w.background.fill(BQ(BQ({},k),{},{textBounds:n}),e):w.background.fill,void 0!==d.backgroundColor&&(d.backgroundBounds=a9(d,b,r,g,w.background.padding))),c.push(d),u.labels.push({node:f,textBounds:n})}}}}const M=c.filter(l(u));return[...M.filter(e=>void 0!==e.backgroundBounds).map(Q7),...M]}function l9(e){const t=2*Math.PI;return(e%t+t)%t}function c9(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function u9(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function d9(e,t,n){let r=t.x,i=t.y;if(r*r+i*i>e*e)return null;let o=Math.sin(n),a=Math.cos(n),s=r*a-i*o,l=e*e-s*s;if(l<0)return null;let c=Math.sqrt(l);return{x:s*a+o*c,y:-s*o+a*c}}function p9(e){let t,n,r=e.radius,i=e.size,o=e.angle,a=i.width,s=i.height,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=d9(r,l,o),!t)return null;t.y*=-1,n={x:-a,y:0};break;case 1:if(t=d9(r,l,Math.PI-o),!t)return null;n={x:-a,y:-s};break;case 2:if(t=d9(r,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-s};break;case 3:if(t=d9(r,l,2*Math.PI-o),!t)return null;t.x*=-1,t.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:t.x+n.x,y:t.y+n.y,width:a,height:s}}function f9(e){let t=e.slice,n=e.measured,r=e.padding,i=t.start,o=t.end,a=t.innerRadius,s=t.outerRadius,l=s-a-2*r,c=o-i;if(c<Math.PI){let e=(n.height/2+r)/Math.tan(c/2);e>a&&(l=s-e-2*r)}if(l<0||l<n.minReqWidth)return null;const u=l9((i+o)/2);let d=s-r,p={x:Math.sin(u)*d,y:-Math.cos(u)*d,width:l,height:n.height};return u<Math.PI?(p.angle=u-Math.PI/2,p.anchor="end"):(p.angle=u+Math.PI/2,p.anchor="start"),p}function h9(e){let t=e.context,n=e.node,r=e.bounds;let i=n.desc.slice;const o=l9((i.start+i.end)/2);switch(Math.floor(o/(Math.PI/2))){case 0:t.q1maxY=r.y-2,void 0===t.q2minY&&(t.q2minY=r.y+r.height+2);break;case 1:t.q2minY=r.y+r.height+2;break;case 2:t.q3minY=r.y+r.height+2;break;case 3:t.q4maxY=r.y-2,void 0===t.q3minY&&(t.q3minY=r.y+r.height+2)}}function m9(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function g9(e,t,n){const r={type:"text",text:t,maxWidth:e.width,x:e.x,y:e.y+("top"===e.baseline?e.height/2:0),fill:n.fill,anchor:e.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(e.angle)){let t=e.angle*(360/(2*Math.PI));r.transform="rotate(".concat(t,", ").concat(r.x,", ").concat(r.y,")")}return r}function y9(e){let t,n,r=e.slice,i=e.direction,o=e.position,a=e.padding,s=e.measured,l=e.view,c=e.context,u=e.store,d=r.start,p=r.end,f=r.innerRadius,h=r.offset;switch(o){case"into":t="rotate"===i?f9({slice:r,measured:s,padding:a}):function(e){let t=e.slice,n=e.padding,r=e.measured,i=t.start,o=t.end,a=t.innerRadius,s=t.outerRadius;const l=l9((i+o)/2);let c=p9({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",c6(c,{x1:0,y1:0,x2:Math.sin(i)*s,y2:-Math.cos(i)*s})||c6(c,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||e6({cx:0,cy:0,r:a},c)?null:(c9(c,n),c)):null}({slice:r,measured:s,padding:a});break;case"inside":n={start:d,end:p,innerRadius:0,outerRadius:f},t="rotate"===i?f9({slice:n,measured:s,padding:a}):function(e){let t=e.slice,n=e.padding,r=e.measured,i=e.store;const o=t.start,a=t.end,s=t.outerRadius,l=l9((o+a)/2);let c=p9({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",c9(c,n),i.insideLabelBounds.some(e=>a6(e,c))?null:(i.insideLabelBounds.push({x:c.x-4,y:c.y,width:c.width+8,height:c.height}),c)):null}({slice:n,measured:s,padding:a,store:u});break;case"outside":t="rotate"===i?function(e){let t=e.slice,n=e.measured,r=e.padding,i=e.view,o=t.start,a=t.end,s=t.outerRadius,l=t.offset,c=s+r,u=a-o;if(u<Math.PI&&(n.height/2+r)/Math.tan(u/2)>c)return null;const d=l9((o+a)/2);let p=Math.sin(d)*c,f=-Math.cos(d)*c,h=n.width+1,m=d%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){let e=f<0?i.y:i.y+i.height,t=Math.abs(e-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*r-s;t<h&&(h=t)}if(Math.sin(m)>.001){let e=p<0?i.x:i.x+i.width,t=Math.abs(e-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*r-s;t<h&&(h=t)}if(h<=0||h<n.minReqWidth)return null;let g={x:p,y:f,width:h,height:n.height};return d<Math.PI?(g.angle=d-Math.PI/2,g.anchor="start"):(g.angle=d+Math.PI/2,g.anchor="end"),g}({slice:r,measured:s,padding:a,view:l}):function(e){let t=e.slice,n=e.measured,r=e.padding,i=e.view,o=e.context,a=t.start,s=t.end,l=t.outerRadius,c=t.offset;const u=l9((a+s)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.q4maxY<0;default:return!0}}(o,Math.floor(u/(Math.PI/2)),i))return null;let d=l+r+n.height/2,p=Math.sin(u)*d,f=-Math.cos(u)*d,h=n.width+1;if(u<Math.PI){let e=Math.abs(i.x+i.width-(p+c.x));e<h&&(h=e)}else{let e=Math.abs(i.x-(p+c.x));e<h&&(h=e)}if(h<n.minReqWidth)return null;let m={x:p,y:f,width:h,height:n.height};return u<Math.PI?m.anchor="start":m.anchor="end",m}({slice:r,measured:s,padding:a,view:l,context:c});break;default:throw new Error("not implemented")}return t&&(t.x+=h.x,t.y+=h.y,"outside"===o&&"rotate"!==i&&function(e,t,n){const r=n.start,i=n.end,o=n.offset,a=n.outerRadius,s=l9((r+i)/2);switch(Math.floor(s/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){let n=Math.min(e.y,t.q1maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){let n=Math.max(e.y,t.q2minY),r=n-e.y;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){let n=Math.max(e.y,t.q3minY),r=n-e.y;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){let n=Math.min(e.y,t.q4maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}}}(t,c,r)),t}function b9(e){let t=e.context,n=e.direction,r=e.measured,i=e.node,o=e.placementSettings,a=e.rect,s=e.store,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y9;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,slice:i.desc.slice,view:a,direction:n,position:c.position,measured:r,padding:c.padding,store:s});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function v9(e,t,n){const r=t.fontFamily,i="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:r,fontSize:i});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:r,fontSize:i}).width),o}const x9=/\n+|\r+|\r\n/,w9=/\s/,S9=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function k9(e){return"string"==typeof e?-1!==e.search(x9):-1!==String(e).search(x9)}function C9(e){return-1!==e.search(w9)}function E9(e){return-1!==e.search(S9)}function M9(e,t,n){return Math.max(t,Math.min(n,e))}function R9(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.string,n=e.separator,r=void 0===n?"":n,i=e.reverse,o=void 0!==i&&i,a=e.measureText,s=void 0===a?e=>({width:e.length,height:1}):a,l=e.mandatoryBreakIdentifiers,c=void 0===l?[k9]:l,u=e.noBreakAllowedIdentifiers,d=void 0===u?[]:u,p=e.suppressIdentifier,f=void 0===p?[C9,k9,e=>""===e]:p,h=e.hyphenationIdentifiers,m=void 0===h?[E9]:h;const g=String(t).split(r);!function(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}(g);const y=g.length,b=o?e=>e>=0:e=>e<y;let v=o?y:-1;function x(e){const t=M9(e,0,y-1),n=g[t],r=s(n),i=function(e,t,n,r,i){return r.some(r=>r(e,t,n))?1:i.some(r=>r(e,t,n))?0:2}(n,t,g,c,d);return{index:t,value:n,breakOpportunity:i,suppress:f.some(e=>e(n,t,g)),hyphenation:m.some(e=>e(n,t,g)),width:r.width,height:r.height,done:!1}}return{next:function(e){return isNaN(e)?o?v--:v++:v=M9(e,0,y-1),b(v)?x(v):{done:!0}},peek:x,length:y}}const _9="…",A9=/^\s*\d+(\.\d+)?px\s*$/i;function I9(e){return"string"===typeof e&&A9.test(e)}function P9(e){const t=e["font-size"]||e.fontSize;return I9(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function T9(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const r=P9(e);return Math.max(1,Math.min(Math.floor(t/r),n))}function D9(e,t){return{lines:[],line:"",width:0,maxLines:T9(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function O9(e){e.lines.push(e.line),e.line="",e.width=0}function N9(e,t){e.line+=t.value,e.width+=t.width}function q9(e,t,n){if(t.width>e.maxWidth)return t;const r=t.index;for(let i=1;i<5;i++){const o=n.peek(t.index-1);if(!t.hyphenation||!o.hyphenation||0===t.index)return t;if(e.width+e.hyphens.metrics.width<=e.maxWidth)return e.line+=e.hyphens.char,t;if(1===e.line.length)return t;t=n.next(r-i),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function L9(e,t,n){const r=R9({string:t.value,measureText:n});for(;e.lines.length<e.maxLines;){let t=r.next();if(t.done)break;e.width+t.width>e.maxWidth&&2===t.breakOpportunity&&e.line.length>0?(t=e.hyphens.enabled?q9(e,t,r):t,O9(e),N9(e,t)):N9(e,t)}}function j9(e,t){const n=R9({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),r=D9(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){O9(r),i=!1;break}1===e.breakOpportunity?O9(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?r.width+=e.width:(e=r.hyphens.enabled?q9(r,e,n):e,O9(r),N9(r,e)):N9(r,e)}return{lines:r.lines,reduced:i}}function z9(e,t){const n=R9({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),r=D9(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){O9(r),i=!1;break}1===e.breakOpportunity?O9(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?O9(r):e.width>r.maxWidth?L9(r,e,t):(O9(r),N9(r,e)):N9(r,e)}return{lines:r.lines,reduced:i}}function F9(e){return{"break-all":j9,"break-word":z9}[e.wordBreak]}function $9(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const r=F9(n);if(!r)return;const i=e(n);if(i.width>n.maxWidth||k9(n.text)){const o=(P9(n)-i.height)/2,a=r(n,function(e,t){return n=>t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}(n,e));t.node=function(e,t,n,r){const i={type:"container",children:[]};void 0!==t.id&&(i.id=t.id);let o=0;return e.lines.forEach((a,s)=>{const l=LQ({},t);l.text=a,l._lineBreak=!0,o+=n,e.reduced&&s===e.lines.length-1?l.text+=_9:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=r,o+=n,i.children.push(l)}),i}(a,n,o,i.height)}}}}function B9(e,t){const n=e["font-family"]||e.fontFamily,r=e["font-size"]||e.fontSize,i="string"==typeof e.text?e.text:"".concat(e.text),o=e.maxWidth;if(void 0===o)return i;let a=t({text:i,fontSize:r,fontFamily:n}).width;if(a<=o)return i;let s=0,l=i.length-1;for(;s<=l;){let e=Math.floor((s+l)/2);a=t({text:i.substr(0,e)+_9,fontSize:r,fontFamily:n}).width,a<=o?s=e+1:l=e-1}return i.substr(0,l)+_9}function H9(e){const t=e.baseline||e["dominant-baseline"];let n=0;const r=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){case"hanging":n=.75*r;break;case"text-before-edge":n=.85*r;break;case"middle":n=.25*r;break;case"central":n=.35*r;break;case"mathemetical":n=r/2;break;case"text-after-edge":case"ideographic":n=.2*-r;break;default:n=0}return n}const V9={},W9={},U9={fontSize:void 0,fontFamily:void 0};let G9;function Y9(e,t){return!e&&!t||e===t}function K9(e){let t=e.text,n=e.fontWeight,r=e.fontSize,i=e.fontFamily;const o="".concat(t," ").concat(n," ").concat(r," ").concat(i);return"number"!=typeof W9[o]&&(G9=G9||document.createElement("canvas").getContext("2d"),function(e){let t=e.fontWeight,n=e.fontSize,r=e.fontFamily;Y9(U9.fontWeight,t)&&Y9(U9.fontSize,n)&&Y9(U9.fontFamily,r)||(G9.font=[t,n,r].filter(e=>!!e).join(" "),U9.fontWeight=t,U9.fontSize=n,U9.fontFamily=r)}({fontWeight:n,fontSize:r,fontFamily:i}),W9[o]=G9.measureText(t).width),W9[o]}function X9(e){return"number"!=typeof V9[e]&&(V9[e]=function(e){if(I9(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),V9[e]}function J9(e){let t=e.text,n=e.fontWeight,r=e.fontSize;return{width:K9({text:t,fontWeight:n,fontSize:r,fontFamily:e.fontFamily}),height:X9(r)}}function Q9(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:J9;const n=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,i=t({text:e.text,fontFamily:r,fontSize:n}),o=Math.min(e.maxWidth||i.width,i.width),a=e.x||0,s=e.y||0,l=e.dx||0,c={x:0,y:s+((e.dy||0)+H9(e))-.75*i.height,width:o,height:i.height},u=e["text-anchor"]||e.anchor;return c.x="middle"===u?a+l-o/2:"end"===u?a+l-o:a+l,c}function Z9(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:J9;const n=F9(e),r=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:i,fontSize:r});if(n&&(o.width>e.maxWidth||k9(e.text))){const o=n(e,e=>t({text:e,fontFamily:i,fontSize:r})),a=LQ({},e);let s=0,l="";for(let e=0,n=o.lines.length;e<n;e++){let a=o.lines[e];a+=e===n-1&&o.reduced?_9:"";const c=t({text:a,fontSize:r,fontFamily:i}).width;c>=s&&(s=c,l=a)}a.text=l;const c=Q9(a,t);return c.height=P9(e)*o.lines.length,c}return Q9(e,t)}function eee(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function tee(e,t,n){const r={type:"text",text:t,maxWidth:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(e.width<n.fontSize)return!1;const o=Math.max(0,e.width-i.width);return r.x=e.x+n.align*o,r.y=e.y+i.height/1.2,r}function nee(e){return{type:"circle",bounds:{cx:e.cx,cy:e.cy,r:e.r}}}function ree(e){return e.desc&&e.desc.slice?function(e){let t=e.start,n=e.end,r=e.innerRadius,i=e.outerRadius,o=e.offset;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let a=0!==r?r:i;return nee({cx:o.x,cy:o.y,r:a})}(e.desc.slice):"circle"===e.type?nee(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var iee={bar:function(e){let t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,a=e.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s9;const l=LQ({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map(e=>LQ({},l,t,e)),u=t.labels.map(e=>e.placements.map(n=>LQ({},l,t,e,n))),d=function(e){let t=e.nodes,n=e.rect,r=e.chart,i=e.labelSettings,o=e.placementSettings,a=e.settings,s=e.renderer;const l={},c=[];let u,d,p,f,h,m,g,y=!0,b=!1;for(let e=0;e<t.length;e++){if(d=t[e],f=d.localBounds,!a6(f,n))continue;let v=X7(d,r);u={node:d,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<i.length;t++)m=i[t],p="function"==typeof m.label?m.label(v,e):void 0,J7(p)&&(g="function"==typeof a.direction?a.direction(v,e):a.direction||"up",b=b||"left"===g||"right"===g,l.fontFamily=m.fontFamily,l.fontSize="".concat(m.fontSize,"px"),l.text=p,h=s.measureText(l),u.measurements.push(h),u.texts.push(p),u.labelSettings.push(m),u.placementSettings.push(o[t]),u.direction=g,y=y&&h.width<=f.width-8);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:b}}({nodes:r,chart:n,renderer:o,settings:t,rect:i,labelSettings:c,placementSettings:u}),p=d.fitsHorizontally,f=d.hasHorizontalDirection,h=d.targetNodes,m=function(e){let t=e.orientation,n=void 0===t?"auto":t,r=e.defaultOrientation,i=void 0===r?"h":r;switch(n.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return i}}({orientation:t.orientation,defaultOrientation:f?"h":"v"}),g="h"===m?"y":"x",y="h"===m?"height":"width";return h.sort((e,t)=>e.node.localBounds[g]+e.node.localBounds[y]-(t.node.localBounds[g]+t.node.localBounds[y])),s({chart:n,targetNodes:h,stngs:t,rect:i,fitsHorizontally:p,collectiveOrientation:m})},slice:function(e){let t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,a=e.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b9,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g9;const c=LQ({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);c.fontSize=parseInt(c.fontSize,10);const u=t.labels.map(e=>LQ({},c,t,e)),d=t.labels.map(e=>e.placements.map(n=>LQ({},c,t,e,n))),p=[],f={insideLabelBounds:[]};r=function(e){const t=[],n=[],r=[],i=[];for(let o=0;o<e.length;++o){const a=e[o].desc.slice,s=l9((a.start+a.end)/2);switch(Math.floor(s/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:r.push(e[o]);break;case 3:i.push(e[o])}}const o=(e,t)=>l9((e.desc.slice.start+e.desc.slice.end)/2)-l9((t.desc.slice.start+t.desc.slice.end)/2),a=(e,t)=>o(t,e);return t.sort(a),n.sort(o),r.sort(a),i.sort(o),t.concat(n,i,r)}(r);const h={};for(let e=0,t=r.length;e<t;e++){const t=r[e],a=m9(t,n);for(let n=0;n<u.length;n++){const r=u[n],c="function"==typeof r.label?r.label(a,e):"";if(!c)continue;const m="function"==typeof r.direction?r.direction(a,e):r.direction||"horizontal",g="function"==typeof r.linkData?r.linkData(a,e):void 0,y=v9(c,r,o),b=s({context:h,direction:m,lblStngs:r,measured:y,node:t,placementSettings:d[n],rect:i,store:f}),v=b.bounds,x=b.placement;if(v&&x){if("outside"===x.position&&"rotate"!==m){h9({context:h,node:t,bounds:v});if(!U4(u9(v),i))continue}const n="function"==typeof x.fill?x.fill(a,e):x.fill,o=l(v,c,{fill:n,fontSize:r.fontSize,fontFamily:r.fontFamily,textMetrics:y});o&&(void 0!==g&&(o.data=g),p.push(o),v.line&&(v.line.stroke=n,p.push(v.line)))}}}return p},rows:function(e){let t=e.settings,n=e.chart,r=e.nodes,i=e.renderer,o=e.style,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tee;const s=LQ({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);const l=LQ({},s,t),c=t.labels.map(e=>LQ({},l,e)),u={},d=[];for(let e=0,t=r.length;e<t;e++){let t=r[e],o=eee(t,n),s=ree(t),p=s.type,f=s.bounds;if(!f)continue;let h,m=0,g=[],y=[],b="circle"===p?2*f.r*.9:f.height;for(m+=l.padding,h=0;h<c.length;h++){let t=c[h],n="function"==typeof t.label?t.label(o,e):"";u.fontFamily=t.fontFamily,u.fontSize="".concat(t.fontSize,"px"),u.text=n;let r=i.measureText(u);if(m+=r.height+t.padding,m>b)break;y.push(n),g.push(r)}const v=h,x=Math.max(0,b-m);let w;for(w="circle"===p?f.cy-.9*f.r:f.y,w+=l.justify*x+l.padding,h=0;h<v;h++){let t,n=c[h];if("circle"===p){let e=Math.max(Math.abs(w-f.cy),Math.abs(w+g[h].height-f.cy)),n=Math.sqrt(f.r*f.r-e*e);t={x:f.cx-n+l.padding,y:w,width:2*n-2*l.padding,height:g[h].height}}else t={x:f.x+l.padding,y:w,width:f.width-2*l.padding,height:g[h].height};w+=g[h].height+l.padding;let r="function"==typeof n.fill?n.fill(o,e):n.fill;const s="function"==typeof n.linkData?n.linkData(o,e):void 0;let u=a(t,y[h],{fill:r,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:g[h]});if(u){if(u.text&&u.text!==_9){const e=B9(u,i.measureText);if(_9===e)continue;u.ellipsed=e}void 0!==s&&(u.data=s),d.push(u)}}}return d}};const oee={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach(e=>{e.strategy&&iee[e.strategy.type]&&e.component&&t.push(...function(e,t){let n=e.chart,r=e.source,i=e.rect,o=e.renderer,a=e.style;if(!n.component(r.component))return[];const s=n.findShapes(r.selector).filter(e=>e.key===r.component);return t({chart:n,settings:r.strategy.settings,nodes:s,rect:{x:0,y:0,width:i.width,height:i.height},renderer:o,style:a})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:e,style:this.style},iee[e.strategy.type]))}),t}};const aee={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,label:{fontSize:"12px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:136,lineHeight:1.2},shape:{type:"square",size:12}},title:{show:!0,text:void 0,anchor:"start",fontSize:"16px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:156,lineHeight:1.25}};function see(e){let t=e.x,n=void 0===t?0:t,r=e.y,i=e.item,o=e.globalMetrics,a=e.createSymbol,s=e.direction,l=void 0===s?"ltr":s,c=i.label.displayObject,u=i.label.bounds,d=i.symbol.meta;const p="rtl"===l;let f={x:p?n+o.maxLabelBounds.width:n+o.maxSymbolSize+o.spacing,y:r,width:o.maxLabelBounds.width,height:Math.max(o.maxSymbolSize,o.maxLabelBounds.height)},h=function(e,t,n){const r=Math.max(0,e.width-t),i=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*r,y:e.y+t/2+n.justify*i}}({x:p?n+o.maxLabelBounds.width+o.spacing:n,y:r,width:o.maxSymbolSize,height:f.height},d.size,{align:void 0===d.align?.5:d.align,justify:void 0===d.justify?.5:d.justify});const m=a(LQ({},d,h));return delete m.collider,c.anchor=p?"end":"start",function(e,t,n){const r=n.textMetrics;if(e.height<r.height)return!1;const i=Math.max(0,e.width-r.width);t.baseline="text-before-edge";const o=Math.max(0,e.height-r.height);t.x=e.x+n.align*i,t.y=e.y+n.justify*o+.175*parseInt(t.fontSize,10)}(f,c,{textMetrics:u,fontSize:parseInt(c.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:i.label.displayObject.data,children:[m,c],collider:{type:"rect",x:n,y:r,width:o.maxItemBounds.width,height:o.maxItemBounds.height}},metrics:f}}function lee(e,t){const n=e.items.length,r=Math.ceil(n/t),i="horizontal"===e.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*r+(r-1)*e.layout.margin[o]}function cee(e,t){let n,r,i,o,a=t.onScroll,s=void 0===a?()=>{}:a,l=null,c=0;const u={itemize:t=>{n=function(e,t){let n,r,i=e.resolved,o=e.dock,a=[],s=i.items.items,l=i.symbols.items,c=i.labels.items,u=0,d=0,p=0;for(let e=0;e<s.length;e++){if(!1===s[e].show)continue;const i=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=LQ({},c[e],{type:"text",fontSize:"".concat(parseInt(c[e].fontSize,10),"px"),text:i,title:i}),r={symbol:{meta:l[e]},label:{displayObject:n,bounds:t.textBounds(n)}},a.push(r),u=Math.max(l[e].size,u),d=Math.max(r.label.bounds.width,d),p=Math.max(r.label.bounds.height,p)}return{items:a,globalMetrics:{spacing:8,maxSymbolSize:u,maxItemBounds:{height:Math.max(u,p),width:u+8+d},maxLabelBounds:{width:d,height:p}},layout:{margin:{vertical:void 0!==i.layout.item.vertical?i.layout.item.vertical:4,horizontal:void 0!==i.layout.item.horizontal?i.layout.item.horizontal:4},mode:i.layout.item.mode,size:i.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:i.layout.item.direction,scrollOffset:i.layout.item.scrollOffset}}}(t,e.renderer),l=isNaN(n.layout.scrollOffset)?l:n.layout.scrollOffset},getItemsToRender:t=>{i=t.viewRect,c=u.getContentOverflow(i);const a=u.extent();l=Math.max(0,Math.min(l,c)),o=LQ({},i);const s="horizontal"===u.orientation()?"x":"y";return o[s]-=l,o["x"===s?"width":"height"]=a,function(e,t,n){let r=e.viewRect,i=n.itemized,o=n.create,a=void 0===o?see:o,s=n.parallels,l=n.createSymbol;const c=i.layout.direction,u=i.globalMetrics,d=i.items,p="horizontal"===i.layout.orientation;let f=0;const h=[],m=u.maxItemBounds.height,g=u.maxItemBounds.width,y=i.layout.margin.vertical+m,b=i.layout.margin.horizontal+g;let v=t.x,x=t.y,w=r.x-t.x;for(let e=0;e<d.length;e++){let n=a({y:x,x:"rtl"===c?r.x+w+r.width-g-(v-t.x):v,item:d[e],globalMetrics:u,direction:c,createSymbol:l});if((p&&v>=r.x-g||!p&&x>=r.y-m)&&h.push(n.item),f++,f>=s?(f=0,p?(v+=b,x=t.y):(x+=y,v=t.x)):p?x+=y:v+=b,!p&&x>r.y+r.height)break;if(p&&v>r.x+r.width)break}return h}(t,o,{itemized:n,parallels:r,createSymbol:e.symbol})},parallelize:(e,t)=>(r=function(e,t,n){const r=n.items.length,i="horizontal"===n.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical",a=n.globalMetrics.maxItemBounds[i]*r+(r-1)*n.layout.margin[o];let s=Math.ceil(a/e);if(null!=t){const e="horizontal"===n.layout.orientation?"height":"width",r="width"===e?"horizontal":"vertical",i=n.layout.margin[r]||4,o=Math.floor((t+i)/(i+n.globalMetrics.maxItemBounds[e]));s=Math.min(s,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(s,l))}(e,t,n),r),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return lee(n,r)>i[e]},getContentOverflow:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;const t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,lee(n,r)-e[t])},getNextSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},hasNext:()=>"horizontal"===u.orientation()?i.x+i.width<o.x+o.width:i.y+i.height<o.y+o.height,hasPrev:()=>"horizontal"===u.orientation()?o.x<i.x:o.y<i.y,next:()=>{u.scroll(-u.getNextSize())},prev:()=>{u.scroll(u.getPrevSize())},scroll:e=>{const t=Math.max(0,Math.min(c,l-e));t!==l&&(l=t,s())},offset:()=>l,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>lee(n,r),spread:()=>function(e,t){const n=t,r="horizontal"===e.layout.orientation?"height":"width",i="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*n+(n-1)*e.layout.margin[i]}(n,r)};return u}function uee(e){return Object.keys(e).filter(t=>e[t]).join(" ")}const dee={up:"▲",right:"▶",down:"▼",left:"◀"};function pee(e,t){let n=t.size,r=t.isActive,i=t.direction,o=t.nav,a={},s="";const l=t.attrs;o&&o.button&&("function"==typeof o.button.class?a=o.button.class({direction:i}):o.button.class&&(a=o.button.class),"function"==typeof o.button.content&&(s=o.button.content(e,{direction:i})),void 0!==o.button.tabIndex&&(l.tabindex=o.button.tabIndex));const c={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(a).length||(c.border="0",c.background="none"),(!r||o&&o.disabled)&&(l.disabled="disabled"),e("button",LQ({class:uee(a),style:c},l),[s||e("span",{style:{pointerEvents:"none"}},[dee[i]])])}function fee(e){let t;const n={itemize:e=>{t=function(e){let t=e.dock;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:e.navigation}}(e)},render:r=>function(e,t,n,r){let i=t.rect,o=t.itemRenderer;if(!e||!e.renderArgs)return;e.size(i);const a=e.renderArgs[0],s="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void e.render([]);const d=s?["right","left"]:["down","up"];l&&s&&d.reverse();const p=[a("div",{style:{position:"relative",display:"flex","flex-direction":s?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!s?"rtl":"ltr"},[pee(a,{size:32,isActive:c,direction:d[0],attrs:{"data-action":"next","data-component-key":r.settings.key},nav:n.navigation}),pee(a,{size:32,isActive:u,direction:d[1],attrs:{"data-action":"prev","data-component-key":r.settings.key},nav:n.navigation})])];e.render(p)}(n.renderer,r,t,e),extent:()=>32,spread:()=>64};return n}function hee(e){let t;const n={itemize:n=>{t=function(e,t){let n=e.resolved;if(!1===n.title.item.show)return null;const r=LQ({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(r.anchor&&"start"!==r.anchor?"end"===r.anchor&&(r.anchor="start"):r.anchor="end"),void 0===n.title.settings.text){const e=t.scale.data().fields;r.text=e&&e[0]?e[0].title():""}return{displayObject:r,bounds:t.renderer.textBounds(r)}}(n,e)},render:e=>{!function(e,t,n){let r=e.rect;if(!t)return;const i=[];if(t.size(r),n){const e={start:0,end:r.width,middle:r.width/2};i.push(LQ({},n.displayObject,{x:e[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(i)}(e,n.renderer,t)},spread:()=>t?t.bounds.height:0,extent:()=>t?t.bounds.width:0};return n}function mee(e,t,n,r){let i,o,a,s=r.itemRenderer,l=r.navigationRenderer,c=r.titleRenderer,u=r.isPreliminary,d=void 0!==u&&u,p=0;const f={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(i={x:f.x,y:f.y,width:f.width,height:c.spread()},"horizontal"===n){i={x:f.x,y:f.y,width:c.extent(),height:c.spread()};const e=f.width-i.width-(i.width?t.spacing:0),n=f.height;s.parallelize(e,d?void 0:n);const r=s.extent()>e?l.extent():0,u=s.spread(),h=r?l.spread():0;o={x:i.x+i.width+(i.width?t.spacing:0),y:f.y+Math.max(0,(h-u)/2),width:f.width-r-i.width-(r?t.spacing:0)-(i.width?t.spacing:0),height:n},a={x:o.x+o.width+(r?t.spacing:0),y:f.y,width:r,height:f.height},i.y=o.y;"rtl"===s.direction()&&(a.x=f.x,o.x=a.x+a.width+(a.width?t.spacing:0),i.x=o.x+o.width+(i.width?t.spacing:0)),p=Math.max(i.height,h,s.spread())}else{const e=f.height-i.height-(i.height?t.spacing:0),n=f.width;s.parallelize(e,d?void 0:n);const r=s.extent()>e?l.extent():0;a={x:f.x,y:f.y+f.height-r,width:f.width,height:r},o={x:f.x,y:i.y+i.height+(i.height?t.spacing:0),width:f.width,height:f.height-i.height-(i.height?t.spacing:0)-a.height-(a.height?t.spacing:0)},p=Math.max(c.extent(),r?l.spread():0,s.spread())}return o=LQ({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),a.x+=e.x,a.y+=e.y,i.x+=e.x,i.y+=e.y,{title:LQ({},e,i),content:LQ({},e,o),navigation:LQ({},e,a),orientation:n,preferredSize:p}}function gee(e){e.state.resolved=function(e){const t=e.scale.domain();let n={items:[]};const r=e.settings.layout.dock;if("threshold-color"===e.scale.type){const i=e.scale.data().fields[0];let o=e=>String(e);e.settings.formatter?o=e.chart.formatter(e.settings.formatter):i&&(o=i.formatter());for(let e=0;e<t.length-1;e++){const r={value:t[e],label:"".concat(o(t[e])," - < ").concat(o(t[e+1]))};i&&(r.source={field:i.id()}),n.items.push(r)}"vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")&&n.items.reverse()}else{const r=e.scale.labels?e.scale.labels():null;n.items=t.map((t,n)=>{const i=e.scale.datum?LQ({},e.scale.datum(t)):{value:t};return i.value=t,e.scale.label?i.label=e.scale.label(t):r&&(i.label=r[n]),i})}const i=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:LQ(!0,{},aee.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:aee.layout,settings:e.settings.settings.layout}),a=e.resolver.resolve({data:n,defaults:LQ(!0,{},aee.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),s=LQ(!0,{},(e.settings.settings.item||{}).shape);void 0===s.fill&&e.settings.scale&&(s.fill={scale:e.settings.scale});const l=e.resolver.resolve({data:n,defaults:LQ(!0,{},aee.item.shape,e.style.item.shape),settings:s}),c=e.resolver.resolve({data:n,defaults:LQ(!0,{},{show:aee.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function u(e,n){let r=e.data.value,i=t[n+1];e.data.value=[r,i]}"threshold-color"===e.scale.type&&("vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")?(c.items.reverse().forEach(u),c.items.reverse()):c.items.forEach(u));return{title:i,labels:a,symbols:l,items:c,layout:o}}(e),e.titleRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.itemRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.navigationRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center",navigation:e.settings.settings.navigation}),e.state.display={spacing:8}}function yee(e){const t=e.rect,n=e.settings,r=e.state,i=e.itemRenderer,o=e.navigationRenderer,a=e.titleRenderer,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",c=mee(t,r.display,l,{itemRenderer:i,navigationRenderer:o,titleRenderer:a});e.renderer.size(c.content);let u=i.getItemsToRender({viewRect:LQ({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:i}),a.render({rect:c.title}),e.state.views={layout:c},u}const bee={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(e){e&&e.parentNode&&(this.navigationRenderer.renderer.appendTo(e.parentNode),this.titleRenderer.renderer.appendTo(e.parentNode),e.parentNode.insertBefore(this.navigationRenderer.renderer.element(),e),e.parentNode.insertBefore(this.titleRenderer.renderer.element(),e)),this.navigationRenderer.render({rect:this.state.views.layout.navigation,itemRenderer:this.itemRenderer}),this.titleRenderer.render({rect:this.state.views.layout.title})},beforeUnmount(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart(){if(this.state.interaction.started)return;this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove(e){if(!this.state.interaction.started)return;const t="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*e.deltaX:e.deltaY;this.itemRenderer.scroll(t-this.state.interaction.delta),this.state.interaction.delta=t},panend(){this.state.interaction.started=!1},scroll(e){this.itemRenderer.scroll(-e)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const e=yee(this);this.update(e)},this.itemRenderer=cee(this,{onScroll:this.onScroll}),this.navigationRenderer=fee(this),this.titleRenderer=hee(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),gee(this)},preferredSize(e){return function(e,t){let n=0;const r=e.settings.layout.dock||"center",i="top"===r||"bottom"===r?"horizontal":"vertical",o=e.state.display,a=mee(t.inner,o,i,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=a.preferredSize,n+=o.spacing,n}(this,e)},beforeUpdate(){gee(this)},render(){return yee(this)},beforeDestroy(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo(){return{offset:this.itemRenderer.offset()}}};function vee(e,t){let n=0;const r=e.state.isVertical?"justify":"align",i=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",a=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[a](),n*=Math.min(1,Math.max(e.stgns[r],0)),t[i]+=n}function xee(e,t,n){const r=n[e];return"object"==typeof r?-1!==r.valid.indexOf(t)?t:r.default:n.default}function wee(e){return xee(e.layout.dock,e.settings.title.anchor,{left:{valid:["top"],default:"top"},right:{valid:["top"],default:"top"},top:{valid:["left","right"],default:"left"},bottom:{valid:["left","right"],default:"left"},default:"top"})}function See(e,t){const n={x:0,y:0,width:0,height:0},r=e.stgns.padding;return n.x=r.left,n.y=r.top,n.width=t.width-r.left-r.right,n.height=t.height-r.top-r.bottom,n}function kee(e){const t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,r=e.chart.scale(e.stgns.fill),i=e.chart.scale(e.stgns.major),o=function(e,t){const n=t.domain();let r=n,i=e.stgns.tick.label;!i&&e.formatter?i=e.formatter:!i&&t.data().fields&&(i=t.data().fields[0].formatter()),"function"==typeof i&&(r=n.map(i).map(String));const o=n.map((n,i)=>{const o=r[i];return{value:n,label:o,pos:t.norm(parseFloat(n,10)),textMetrics:e.renderer.measureText({text:o,fontSize:e.stgns.tick.fontSize,fontFamily:e.stgns.tick.fontFamily})}});return o}(e,i),a=xee((s=e.settings).layout.dock,s.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"});var s;if(void 0===n.text){const e=i.data().fields;n.text=e&&e[0]?e[0].title():""}const l=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),c=e.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),u={isVertical:t,nodes:[],title:{anchor:wee(e.settings),textMetrics:l,textBounds:c,requiredWidth:()=>{if(!n.show)return 0;let e=c.width,r=n.maxLengthPx;return t||(e+=n.padding,r+=n.padding),Math.min(e,r,u.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let e=c.height;return t&&(e+=n.padding),Math.min(e,u.rect.height)}},ticks:{values:o,anchor:a,length:Math.min(Math.max(...o.map(e=>e.textMetrics.width)),e.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===a?Math.max(...u.ticks.values.map(e=>e.textMetrics.height))+e.stgns.tick.padding:0,height:Math.max(...o.map(e=>e.textMetrics.height))},legend:{fillScale:r,majorScale:i,length:()=>{const n=t?"height":"width",r=t?"requiredHeight":"requiredWidth",i=Math.min(u.rect[n],u.rect[n]*e.stgns.length)-u.title[r]();return Math.max(0,Math.min(i,e.stgns.maxLengthPx))}}};return u}const Cee={require:["chart","settings","renderer"],defaultSettings:{layout:{displayOrder:0,dock:"right"},settings:{size:15,length:.5,maxLengthPx:250,align:.5,justify:0,padding:{left:5,right:5,top:5,bottom:5},tick:{label:null,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,anchor:null,padding:5},title:{show:!0,text:void 0,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,padding:5,maxLines:2,wordBreak:"none",lineHeight:1.2,hyphens:"auto",anchor:null}}},preferredSize(e){const t=this.state;t.rect=See(this,e.inner);let n=this.stgns.size;const r=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=r;const i=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){const e=t.ticks.values.reduce((e,t)=>e+t.textMetrics.height,0);if(e>this.state.legend.length())return i;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return i;n+=Math.max(...t.ticks.values.map(e=>e.textMetrics.height))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===t.title.anchor||"right"===t.title.anchor?Math.max(t.title.textBounds.height+r,n):Math.max(n,t.title.requiredWidth()+r)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=kee(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=kee(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=See(this,e.size),this.stgns.title.show){const e=function(e){const t=e.state,n=e.stgns,r="left"===t.ticks.anchor,i="top"===t.ticks.anchor;let o=t.rect.x,a=t.rect.y,s="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0,s="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=r?t.rect.width:0,a+=t.title.textMetrics.height,s=r?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(a,t.rect.y+t.rect.height),text:n.title.text,fill:n.title.fill,fontSize:n.title.fontSize,fontFamily:n.title.fontFamily,maxWidth:n.title.maxLengthPx,maxLines:n.title.maxLines,wordBreak:n.title.wordBreak,hyphens:n.title.hyphens,lineHeight:n.title.lineHeight,anchor:s,title:n.title.text};return vee(e,l),l}(this);this.state.nodes.push(e)}const t=function(e){const t=e.state.legend.fillScale,n=e.state.legend.majorScale,r=t.domain().map(e=>({type:"stop",color:t(e),offset:Math.min(1,Math.max(0,n.norm(e)))}));return r.sort((e,t)=>e.offset-t.offset)}(this),n=function(e,t){const n=e.state,r=e.stgns,i=n.rect;let o=i.x,a=i.y,s=n.isVertical?r.size:n.legend.length(),l=n.isVertical?n.legend.length():r.size;"left"===n.ticks.anchor?o+=n.rect.width-r.size:"top"===n.ticks.anchor&&(a+=n.rect.height-r.size),"top"===n.title.anchor?a+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());const c={type:"rect",x:o,y:a,width:s,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return vee(e,c),c}(this,t),r=function(e,t){const n=e.state,r=e.stgns;let i="start";const o={type:"rect",x:t.x,y:t.y,width:n.isVertical?0:t.width,height:n.isVertical?t.height:0,fill:"transparent"},a=n.ticks.values.map(a=>{let s=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=t.y+t.height*a.pos,u=0===a.pos?"text-before-edge":"text-after-edge"):s=t.x+t.width*a.pos,"right"===n.ticks.anchor?(s=t.x+r.size+r.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(s=t.x-r.tick.padding,i="end"):"top"===n.ticks.anchor?(l=t.y-r.tick.padding,c-=.25*a.textMetrics.height,i=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+r.tick.padding,c=.8*a.textMetrics.height,i=0===a.pos?"start":"end",o.y=t.y+t.height),{type:"text",x:s,y:l,dx:0,dy:c,text:a.label,fontSize:r.tick.fontSize,fontFamily:r.tick.fontFamily,fill:r.tick.fill,maxWidth:n.isVertical?r.tick.maxLengthPx:Math.min(r.tick.maxLengthPx,n.legend.length()/2),anchor:i,textBoundsFn:e.renderer.textBounds,title:a.label,baseline:u}});return{type:"container",id:"legend-seq-ticks",children:[...a,o]}}(this,n),i={id:"legend-seq-target",type:"container",children:[n,r]};this.state.nodes.push(i)},render(){return this.state.nodes}};const Eee={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},layers:{curve:"linear",show:!0,line:{stroke:"#ccc",strokeWidth:1,strokeLinejoin:"miter",strokeDasharray:void 0,opacity:1,show:!0,showMinor0:!0},area:{fill:"#ccc",opacity:.8,show:!0}}};function Mee(e,t){let n=t.generatorType,r=t.item,i=t.data,o=t.major,a=t.minor,s=t.layerObj,l=t.stngs,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:e,generatorType:n,major:o,minor:a,layerObj:s,stngs:l,opacity:r.opacity,stroke:r.stroke,strokeWidth:r.strokeWidth,strokeLinejoin:r.strokeLinejoin,fill:c||r.fill,data:i};return r.strokeDasharray&&(u.strokeDasharray=r.strokeDasharray),u}function Ree(e){const t=function(e){let t=e.data,n=e.stngs,r=e.rect,i=e.resolver,o=e.style,a=e.domain;const s=r.width,l=r.height,c=i.resolve({data:t,defaults:Eee.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:s,minor:"vertical"===n.orientation?s:l}}),u=!n.connect&&a.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),d={};let p=0;for(let e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(u){const e=d[n]?d[n].items[d[n].items.length-1]:null,r=e?a.indexOf(e.data.major?e.data.major.value:e.data.value):null;e&&a.indexOf(t.data.major?t.data.major.value:t.data.value)-1!==r&&d[n].items.push({dummy:!0})}d[n]=d[n]||{order:p++,id:n,items:[],dataItems:[],consumableData:{}},d[n].dataItems.push(t.data),d[n].items.push(t)}const f=Object.keys(d).map(e=>(d[e].consumableData=BQ({points:d[e].dataItems},d[e].dataItems[0]),d[e])),h={items:f.map(e=>e.consumableData)},m=n.layers||{};return{coordinates:c,metaLayers:f,layers:i.resolve({data:h,defaults:{curve:Eee.layers.curve,show:Eee.layers.show},settings:{curve:m.curve,show:m.show}}),lines:i.resolve({data:h,defaults:LQ({},Eee.layers.line,o.line),settings:m.line}),areas:i.resolve({data:h,defaults:LQ({},Eee.layers.area,o.area),settings:m.area})}}(e),n=t.metaLayers,r=t.coordinates,i=t.layers,o=t.lines,a=t.areas,s=[];return n.forEach((t,n)=>{const l=i.items[n];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=t.id;const c=[],u=[];let d,p;for(let n=0;n<t.items.length;n++){if(d=t.items[n],p=d.data,!d.dummy){if(isNaN(d.major))continue;e.missingMinor0&&(d.minor0=r.settings.minor.scale?r.settings.minor.scale(p.minor0?p.minor0.value:0):0),isNaN(d.minor)||c.push(d.minor),l.data.push(d.data)}u.push(d)}const f=c.sort((e,t)=>e-t)[Math.floor((c.length-1)/2)];s.push({layerObj:l,lineObj:o.items[n],areaObj:a.items[n],median:f,points:u,consumableData:t.consumableData})}),s}const _ee={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(e){let t=e.data;const n=this.rect,r=n.width,i=n.height;this.stngs=this.settings.settings||{};const o=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,a=Ree({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:o,domain:this.stngs.coordinates&&this.stngs.coordinates.major&&this.stngs.coordinates.major.scale?this.chart.scale(this.stngs.coordinates.major.scale).domain():[]});if(this.stngs.layers&&this.stngs.layers.sort){const e=a.map(e=>({id:e.layerObj.id,data:e.layerObj.data})).sort(this.stngs.layers.sort).map(e=>e.id);a.sort((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id))}else a.sort((e,t)=>e.median-t.median);return function(e,t){let n=t.width,r=t.height,i=t.missingMinor0,o=t.stngs;const a=[],s=o.layers||{};return e.forEach(e=>{const t=e.lineObj,l=e.layerObj,c=e.areaObj,u=e.points;let d={size:r,p:"y"},p={size:n,p:"x"};if("vertical"===o.orientation){const e=LQ(!0,{},p);p=LQ(!0,{},d),d=LQ(!0,{},e)}s.area&&!1!==c.show&&a.push(Mee(u,{data:e.consumableData,item:c,generatorType:"area",major:p,minor:d,layerObj:l,stngs:o})),t&&!1!==t.show&&(a.push(Mee(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"1"),major:p,minor:d,layerObj:l,stngs:o},"none")),!i&&s.area&&!1!==c.show&&!1!==t.showMinor0&&a.push(Mee(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"0"),major:p,minor:d,layerObj:l,stngs:o},"none")))}),a}(a,{width:r,height:i,missingMinor0:o,stngs:this.stngs})}};function Aee(e,t){let n,r,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof t.center?(n=t.center.x,r=t.center.y):(n=t.clientX,r=t.clientY);const o=n-e.state.boundingRect.left,a=r-e.state.boundingRect.top;return{x:i?Math.max(0,Math.min(o,e.rect.width)):o,y:i?Math.max(0,Math.min(a,e.rect.height)):a}}function Iee(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function Pee(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-r}}const Tee={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const t=Aee(this,e,!1);l6({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=this.settings.settings.brush.components.map(e=>({key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"})),this.state.start=Aee(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=Aee(this,e),function(e){if(e.state.active){const t=Iee(e,e.state.start),n=Iee(e,e.state.end),r=e.chart.shapesAt(Pee(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(r,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([LQ({type:"rect"},Pee(t.state.start,t.state.end),t.style.area)]))},end(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach(e=>{Array.isArray(e.contexts)&&e.contexts.forEach(e=>{t.brush(e).end()})}),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function Dee(e,t,n){let r=n.renderer,i=n.style,o=n.props,a=n.h;const s=function(e,t){return{tooltip:"function"==typeof e.tooltipClass?e.tooltipClass({dock:t.dock}):e.tooltipClass,content:"function"==typeof e.contentClass?e.contentClass({dock:t.dock}):e.contentClass,arrow:"function"==typeof e.arrowClass?e.arrowClass({dock:t.dock}):e.arrowClass}}(o,t),l=function(e,t,n,r){return r.content({h:e,style:n,data:t})}(a,e,i,o),c=a("div",{dir:o.direction,class:uee(LQ({"pic-tooltip":!0},s.tooltip)),style:LQ({position:"relative",display:"inline-block"},t.computedTooltipStyle)},a("div",{style:i.content,class:uee(LQ({"pic-tooltip-content":!0},s.content))},l),a("div",{class:uee(LQ({"pic-tooltip-arrow":!0},s.arrow)),style:LQ({},i.arrow,i["arrow-".concat(t.dock)],t.computedArrowStyle)}));return r.render(c),r.element().children[0]}function Oee(e){let t=e.defaultDuration,n=e.defaultDelay,r=null,i=null,o=!1;const a=function(){const e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return e.set=e=>{n=e,t[n].forEach(t=>t(e))},e.on=(e,n)=>{Array.isArray(e)?e.forEach(e=>t[e].push(n)):t[e].push(n)},e.destroy=()=>{Object.keys(t).forEach(e=>{t[e].length=0})},e}(),s=function(){},l=()=>{r=null,i=null,o=!1,a.set("fulfilled")};return s.invoke=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;r&&(clearTimeout(r),a.set("debounced")),a.set("pending"),r=setTimeout(()=>{e(),o=!0,r=null,a.set("active")},c),s>0&&(i&&clearTimeout(i),i=setTimeout(l,s+Math.max(c,0)))},s.clear=()=>{o?a.set("cancelled"):r&&(clearTimeout(r),a.set("rejected")),i&&clearTimeout(i),r=null,i=null,o=!1},s.on=(e,t)=>{a.on(e,t)},s.destroy=()=>{s.clear(),a.destroy()},s}function Nee(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-e,"px)"),right:"translate(".concat(e,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-e,"px)"),bottom:"translate(-50%, ".concat(e,"px)"),inside:"translate(-50%, -50%)"}}function qee(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-e-n,y:-t/2},right:{x:n,y:-t/2},top:{x:-e/2,y:-t-n},bottom:{x:-e/2,y:n},inside:{x:-e/2,y:-t/2}}}function Lee(e,t){const n=e>0?"-":"+";return e=Math.abs(e),void 0===t&&(t=e),{left:{left:"100%",top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},top:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"100%",borderWidth:"".concat(t,"px")},bottom:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(t,"px")},inside:{left:"0px",top:"0px",borderWidth:"0px"}}}function jee(e,t,n,r,i,o){const a=t+o.x,s=n+o.y,l=i;return!(a<0||s<0)&&!(a+r>e.width||s+l>e.height)}function zee(e){let t=e.area,n=e.vx,r=e.vy,i=e.width,o=e.height,a=e.offset;const s=n+a.x,l=r+a.y,c=i,u=o;let d=s<0?-s:0,p=l<0?-l:0;return d+=s+c>t.width?-(s+c-t.width):0,p+=l+u>t.height?-(l+u-t.height):0,{x:d,y:p}}function Fee(e){let t=e.options,n=e.pointer,r=e.width,i=e.height,o=e.dockOrder,a=e.x,s=e.y;const l=n.targetBounds,c=Nee(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u},computedArrowStyle:Lee(t.offset)[t.dock],dock:t.dock};const d={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},p=qee(r,i,t.offset),f=[],h="target"===t.area?a:l.left+a,m="target"===t.area?s:l.top+s;for(let e=0;e<o.length;e+=1){const n=o[e],l=zee({area:d,vx:h,vy:m,width:r,height:i,offset:p[n]}),u={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c[n]},g=Lee(t.offset)[n];0!==l.x&&(u.width="".concat(r-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(a+l.x,"px"),g.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:g,dock:n,rect:{width:r,height:i}};if(0===l.x&&0===l.y)return y;y.offset=l,f.push(y)}return f.sort((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x)),f[0]}function $ee(e,t,n){const r=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!r)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const i=r.rect;return LQ({scaleRatio:i.scaleRatio},i.computedInner)}const Bee={bounds:function(e){let t=e.resources,n=e.nodes,r=e.pointer,i=e.width,o=e.height,a=e.options;const s=r.targetBounds,l=t.getNodeBoundsRelativeToTarget(n[0]),c=l.x,u=l.y,d=l.width,p=l.height,f={left:{x:c,y:u+p/2},right:{x:c+d,y:u+p/2},top:{x:c+d/2,y:u},bottom:{x:c+d/2,y:u+p},inside:{x:c+d/2,y:u+p/2}},h=Nee(a.offset),m=h[a.dock];if(m)return{computedTooltipStyle:{left:"".concat(f[a.dock].x,"px"),top:"".concat(f[a.dock].y,"px"),transform:m},computedArrowStyle:Lee(a.offset)[a.dock],dock:a.dock};const g={width:"target"===a.area?s.width:window.innerWidth,height:"target"===a.area?s.height:window.innerHeight},y=qee(i,o,a.offset),b=["top","left","right","bottom","inside"];for(let e=0;e<b.length;e+=1){const t=b[e];if(jee(g,"target"===a.area?f[t].x:s.left+f[t].x,"target"===a.area?f[t].y:s.top+f[t].y,i,o,y[t]))return{computedTooltipStyle:{left:"".concat(f[t].x,"px"),top:"".concat(f[t].y,"px"),transform:h[t]},computedArrowStyle:Lee(a.offset)[t],dock:t}}const v=function(e){let t=e.options,n=e.docks,r=e.dockOffsets,i=e.targetBounds,o=e.area,a=e.width;const s="top",l="target"===t.area?n[s].x:i.left+n[s].x,c=("target"===t.area?n[s].y:(i.top,n[s].y),r[s]),u=l+c.x,d=(c.y,a);let p=n.top.x;return u<0&&u+d>o.width||(u<0?p-=u:u+d>o.width&&(p-=u+d-o.width)),p}({options:a,docks:f,dockOffsets:y,targetBounds:s,area:g,width:i});return{computedTooltipStyle:{left:"".concat(v,"px"),top:"".concat(f.top.y,"px"),transform:h.top},computedArrowStyle:Lee(a.offset+v-f.top.x,a.offset).top,dock:"top"}},pointer:function(e){let t=e.options,n=e.pointer,r=e.width,i=e.height;return Fee({x:n.x,y:n.y,pointer:n,width:r,height:i,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){let t=e.options,n=e.pointer,r=e.width,i=e.height,o=e.nodes,a=e.resources;const s=o[0],l=n.dx,c=n.dy,u=a.getComponentBoundsFromNode(s),d=l+u.x+u.width/2,p=c+u.y+u.height/2,f=s.desc.slice,h=f.start,m=f.end,g=f.outerRadius,y=(h+m)/2-Math.PI/2,b=2*Math.PI,v=(y%b+b)%b;let x=["top","left","right","bottom"];return"auto"===t.dock&&(x=v<=Math.PI/4||v>=7*Math.PI/4?["right","top","bottom","left"]:v<=3*Math.PI/4?["bottom","left","right","top"]:v<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),Fee({x:d+g*u.scaleRatio.x*Math.cos(v),y:p+g*u.scaleRatio.y*Math.sin(v),pointer:n,width:r,height:i,options:t,dockOrder:x})}};function Hee(e,t){let n=e.width,r=e.height,i=t.chart,o=t.state,a=t.props;const s={resources:{formatter:i.formatter,scale:i.scale,component:i.component,getComponentBoundsFromNode:e=>$ee(e,o.pointer,i),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const r=$ee(e,t,n),i=e.bounds;return{x:r.x+t.dx+i.x,y:r.y+t.dy+i.y,width:i.width,height:i.height}}(e,o.pointer,i)},nodes:o.activeNodes,pointer:o.pointer,width:n,height:r},l=typeof a.placement;if("object"===l&&"function"==typeof a.placement.fn)return a.placement.fn(s);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=LQ(c,a.placement(s))),"object"===l&&Bee[a.placement.type]?c=LQ(c,a.placement):"string"===l&&Bee[a.placement]&&(c=LQ(c,{type:a.placement})),s.options=c;const u=Bee[c.type](s);let d=s.resources.getComponentBoundsFromNode(s.nodes[0]),p=d.x,f=d.y,h=d.width,m=d.height;return p+=s.pointer.dx,h+=p,f+=s.pointer.dy,m+=f,u.computedTooltipStyle.left="".concat(Math.min(Math.max(0,p,parseFloat(u.computedTooltipStyle.left)),h),"px"),u.computedTooltipStyle.top="".concat(Math.min(Math.max(0,f,parseFloat(u.computedTooltipStyle.top)),m),"px"),u}let Vee;function Wee(){Vee=null}const Uee={duration:8e3,delay:500,filter:e=>e.filter(e=>e.data&&void 0!==e.data.value),extract:e=>e.node.data.value,content:e=>{let t=e.h;return e.data.map(e=>t("div",{},e))},isEqual:(e,t)=>e.length&&e.length===t.length&&e.every((e,n)=>t[n]&&JSON.stringify(e.data)===JSON.stringify(t[n].data)),placement:{type:"pointer",dock:"auto",offset:8,area:"viewport"},tooltipClass:{},contentClass:{},arrowClass:{},direction:"ltr",appendTo:void 0,beforeShow:void 0,afterShow:void 0,beforeHide:void 0,onHide:void 0,afterHide:void 0};const Gee={require:["chart","renderer"],defaultSettings:{settings:Uee,style:{tooltip:{},content:{backgroundColor:"$gray-25",color:"$font-color--inverted",fontFamily:"$font-family",fontSize:"$font-size",lineHeight:"$line-height",borderRadius:"4px",padding:"8px",opacity:.9},arrow:{position:"absolute",width:"0px",height:"0px",borderStyle:"solid",color:"$gray-25",opacity:.9},"arrow-bottom":{borderTopColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-top":{borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-right":{borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent"},"arrow-left":{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent"}}},renderer:"dom",on:{hide(){this.hide()},show(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent(e){this.prevent(e)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.nodes,i=n.duration,o=n.delay;!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(e,t){let n=t.chart,r=t.state,i=0,o=0;e.center?(i+=e.center.x,o+=e.center.y):(i+=e.clientX,o+=e.clientY);const a=n.element.getBoundingClientRect(),s=r.targetElement.getBoundingClientRect(),l=i,c=o,u=a.left-s.left,d=a.top-s.top,p=i-a.left,f=o-a.top;return i-=s.left,o-=s.top,{x:i,y:o,dx:u,dy:d,cx:p,cy:f,clientX:l,clientY:c,targetBounds:s,chartBounds:a}}(e,this),t=Array.isArray(r)?this.props.filter(r):this.props.filter(this.chart.shapesAt({x:this.state.pointer.cx,y:this.state.pointer.cy})),this.props.isEqual(this.state.activeNodes,t)||(this.dispatcher.clear(),this.state.activeNodes=t,this.state.activeNodes.length&&this.dispatcher.invoke(()=>this.invokeRenderer(this.state.activeNodes),i,o)))},prevent(e){this.state.prevent=!!e},init(e){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=Oee({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",()=>{!function(e){Vee&&Vee!==e&&Vee()}(t),Vee=t,"function"==typeof this.props.beforeShow&&this.props.beforeShow.call(void 0,{resources:{formatter:this.chart.formatter,scale:this.chart.scale}})}),this.dispatcher.on(["cancelled","fulfilled"],()=>{const e={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,LQ({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,LQ({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),Vee===t&&(Vee=null),this.state.tooltipElm=void 0}),this.dispatcher.on("active",()=>{"function"==typeof this.props.afterShow&&this.props.afterShow.call(void 0,{element:this.state.tooltipElm,resources:{formatter:this.chart.formatter,scale:this.chart.scale}})})},created(){this.init(this.settings)},beforeUpdate(e){let t=e.settings;this.dispatcher&&(this.dispatcher.destroy(),Wee()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),Wee()},appendTo(){if(this.props.appendTo){this.state.targetElement="function"==typeof this.props.appendTo?this.props.appendTo({resources:{formatter:this.chart.formatter,scale:this.chart.scale}}):this.props.appendTo;const e=this.state.targetElement.getBoundingClientRect(),t=e.width,n=e.height;this.renderer.destroy(),this.renderer.size({width:t,height:n}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(e){const t=function(e,t){let n=t.chart,r=t.scale,i=t.props,o=t.h;const a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:r,h:o},s=[];return e.forEach(e=>{if("function"==typeof i.extract){const t=LQ({node:e},a);s.push(i.extract(t))}}),s}(e,this),n=Hee(Dee(t,{},this).getBoundingClientRect(),this);this.state.tooltipElm=Dee(t,n,this)}};const Yee={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes(this.props.selector).filter(e=>e.key===this.props.target),t=e.filter(e=>e.collider).map(e=>e.collider);t.forEach(e=>{e.fill=this.props.fill,e.stroke=this.props.stroke,e.opacity=this.props.opacity,e.collider={type:null}}),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let t=e.outer,n=e.inner;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}},Kee={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},Xee=/([astvzqmhlc])([^astvzqmhlc]*)/gi,Jee=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function Qee(e){const t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(Xee,(e,n,r)=>{const i=function(e){const t=e.match(Jee);return t?t.map(Number):[]}(r);let o=n.toLowerCase(),a=n;if("m"===o&&i.length>2&&(t.push([a,...i.splice(0,2)]),o="l",a="m"===a?"l":"L"),i.length<Kee[o])return"";for(t.push([a,...i.splice(0,Kee[o])]);i.length>=Kee[o]&&i.length&&Kee[o];)t.push([a,...i.splice(0,Kee[o])]);return""}),t}const Zee=2*Math.PI;function ete(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function tte(e,t,n,r,i){const o=1-e;return o**3*t+3*o**2*e*n+3*o*e**2*r+e**3*i}function nte(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||function(e,t,n,r){return Math.abs(e.x+n.x-(t.x+t.x))+Math.abs(e.y+n.y-(t.y+t.y))+Math.abs(t.x+r.x-(n.x+n.x))+Math.abs(t.y+r.y-(n.y+n.y))}(e,t,n,r)<=10)return i[i.length-1]!==e&&i.push(e),i.push(r),i;const a=ete(e,t),s=ete(t,n),l=ete(n,r),c={x:tte(.5,e.x,t.x,n.x,r.x),y:tte(.5,e.y,t.y,n.y,r.y)},u=ete(a,s),d=ete(s,l);return nte(e,a,u,c,i,o-1),nte(c,d,l,r,i,o-1),i}function rte(e,t,n){const r=function(e,t,n){return{cp1:{x:e.x+2/3*(t.x-e.x),y:e.y+2/3*(t.y-e.y)},cp2:{x:n.x+2/3*(t.x-n.x),y:n.y+2/3*(t.y-n.y)}}}(e,t,n);return nte(e,r.cp1,r.cp2,n)}function ite(e,t,n){const r=[],i=!!e[4],o=!!e[5],a=e[3];let s,l,c,u,d=e[6],p=e[7],f=e[1],h=e[2];if("a"===e[0]&&(d+=t,p+=n),t===p&&n===p)return r;if(!f||!h)return r.push({x:d,y:p}),r;var m=function(e,t,n,r,i,o,a,s,l){let c,u,d,p,f,h;const m=S4(n%360),g=Math.cos(m),y=Math.sin(m),b=(s-o)/2,v=(l-a)/2,x=g*b+y*v,w=g*v-y*b;h=x**2/(e=Math.abs(e))**2+w**2/(t=Math.abs(t))**2,h>1&&(h=Math.sqrt(h),e*=h,t*=h);const S=e*w,k=t*x,C=S**2+k**2,E=(e*t)**2-C;let M=Math.sqrt(Math.max(E/C,0));r===i&&(M=-M);const R=M*(S/t),_=M*(-k/e);p=g*R-y*_+(s+o)/2,f=y*R+g*_+(l+a)/2;const A=(x-R)/e,I=(w-_)/t,P=(-x-R)/e,T=(-w-_)/t;return c=Math.atan2(I,A),c+=c<0?Zee:0,u=Math.atan2(T,P),u+=u<0?Zee:0,d=u-c,!i&&c<u?d-=Zee:i&&u<c&&(d+=Zee),d%=Zee,{startAngle:c,sweepAngle:d,cx:p,cy:f,rx:e,ry:t}}(f,h,a,i,o,d,p,t,n);s=m.cx,l=m.cy,f=m.rx,h=m.ry,c=m.sweepAngle,u=m.startAngle;const g=Math.abs(c*Math.sqrt((f**2+h**2)/2)),y=Math.ceil(g/10),b=c/y;for(let e=1;e<=y;e++){const t=(u+b*e)%Zee,n=Math.cos(t),i=Math.sin(t);r.push({x:s+n*f+-i*n,y:l+i*h+n*i})}return r}function ote(e){const t=Qee(e),n=[],r=[];let i=0,o=0,a=null,s=null,l=null,c=null;for(let e=0;e<t.length;++e){const u=t[e],d=u[0];switch("S"!==d&&"s"!==d&&"C"!==d&&"c"!==d&&(a=null,s=null),"T"!==d&&"t"!==d&&"Q"!==d&&"q"!==d&&(l=null,c=null),d){case"m":r.length&&n.push(r.splice(0));case"l":i+=u[1],o+=u[2],r.push({x:i,y:o});break;case"M":r.length&&n.push(r.splice(0));case"L":i=u[1],o=u[2],r.push({x:i,y:o});break;case"H":i=u[1],r.push({x:i,y:o});break;case"h":i+=u[1],r.push({x:i,y:o});break;case"V":o=u[1],r.push({x:i,y:o});break;case"v":o+=u[1],r.push({x:i,y:o});break;case"a":r.push(...ite(u,i,o)),i+=u[6],o+=u[7];break;case"A":r.push(...ite(u,i,o)),i=u[6],o=u[7];break;case"c":r.push(...nte({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o},{x:u[5]+i,y:u[6]+o})),a=u[3]+i,s=u[4]+o,i+=u[5],o+=u[6];break;case"C":r.push(...nte({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),a=u[3],s=u[4],i=u[5],o=u[6];break;case"s":null!==a&&null!==a||(a=i,s=o),r.push(...nte({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),a=u[1]+i,s=u[2]+o,i+=u[3],o+=u[4];break;case"S":null!==a&&null!==a||(a=i,s=o),r.push(...nte({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),a=u[1],s=u[2],i=u[3],o=u[4];break;case"Q":r.push(...rte({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],i=u[3],o=u[4];break;case"q":r.push(...rte({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),l=u[1]+i,c=u[2]+o,i+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...rte({x:i,y:o},{x:l,y:c},{x:u[1],y:u[2]})),i=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...rte({x:i,y:o},{x:l,y:c},{x:u[1]+i,y:u[2]+o})),i+=u[1],o+=u[2];break;case"z":case"Z":r.length&&r.push({x:r[0].x,y:r[0].y})}}return function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];Math.abs(n.x-r.x)<1e-12&&Math.abs(n.y-r.y)<1e-12&&(e.splice(t,1),t--)}}(r),n.push(r.splice(0)),n}const ate={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes("path").filter(e=>e.key===this.props.target),t=[];e.forEach(e=>{ote(e.attrs.d).forEach(e=>{e.forEach(e=>{t.push({type:"circle",cx:e.x,cy:e.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})})})}),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let t=e.outer,n=e.inner;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var ste=[function(e){e.component("box",l8),e.component("box-marker",l8)},function(e){e.component("point",g8),e.component("point-marker",g8)},function(e){e.component("pie",x8)},function(e){e.component("grid-line",E8)},function(e){e.component("ref-line",q8)},function(e){e.component("axis",d7)},function(e){e.component("container",p7)},function(e){e.component("text",m7)},function(e){e.component("scrollbar",b7)},function(e){e.component("brush-range",D7),e.component("brush-area-dir",L7)},function(e){e.component("range",$7)},function(e){e.component("brush-lasso",G7)},function(e){e.component("labels",oee)},function(e){e.component("legend-cat",bee)},function(e){e.component("legend-seq",Cee)},function(e){e.component("line",_ee)},function(e){e.component("brush-area",Tee)},function(e){e.component("tooltip",Gee)},function(e){e.component("debug-collider",Yee)},function(e){e.component("debug-path-to-points",ate)}];let lte=class{constructor(e){this._parent=null,this._children=[],this._ancestors=null,this.type=e,this.data=null}detach(){return this._parent&&this._parent.removeChild(this),this}get parent(){return this._parent}get isBranch(){return this._children&&this._children.length}get children(){return this._children}get ancestors(){return this._ancestors||(this._ancestors=[],this.parent&&this._ancestors.push(this.parent,...this.parent.ancestors)),this._ancestors}get descendants(){let e=[];const t=this.children.length;let n,r;for(n=0;n<t;n++)r=this.children[n],e.push(r),r.children.length&&(e=[...e,...r.descendants]);return e}equals(e){const t=this.children,n=e.children;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(!t[e].equals(n[e]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map(e=>e.toJSON())}}};class cte{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,c=e.minWidth,u=void 0===c?0:c,d=e.minHeight,p=void 0===d?0:d;this.set({x:n,y:i,width:a,height:l,minWidth:u,minHeight:p})}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,c=e.minWidth,u=void 0===c?0:c,d=e.minHeight,p=void 0===d?0:d;this.type="rect",a>=0?(this.x=n,this.width=Math.max(a,u)):(this.x=n+Math.min(a,-u),this.width=-Math.min(a,-u)),l>=0?(this.y=i,this.height=Math.max(l,p)):(this.y=i+Math.min(l,-p),this.height=-Math.min(l,-p))}containsPoint(e){return l6(this,e)}intersectsLine(e){return c6(this,JQ(e))}intersectsRect(e){return a6(this,XQ(e))}intersectsCircle(e){return e6(e,this)}intersectsPolygon(e){return o6(e,this)}intersectsGeoPolygon(e){return y6(e,this)}points(){return[{x:this.x,y:this.y},{x:this.x+this.width,y:this.y},{x:this.x+this.width,y:this.y+this.height},{x:this.x,y:this.y+this.height}]}}class ute{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cx,n=void 0===t?0:t,r=e.cy,i=void 0===r?0:r,o=e.r,a=void 0===o?0:o,s=e.minRadius,l=void 0===s?0:s;this.set({cx:n,cy:i,r:a,minRadius:l})}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cx,n=void 0===t?0:t,r=e.cy,i=void 0===r?0:r,o=e.r,a=void 0===o?0:o,s=e.minRadius,l=void 0===s?0:s;this.type="circle",this.cx=n,this.cy=i,this.r=Math.max(a,l),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return Z4(this,e)}intersectsLine(e){return t6(this,JQ(e))}intersectsRect(e){return e6(this,XQ(e))}intersectsCircle(e){return n=e,!K4(t=this)&&!K4(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return n6(this,e)}intersectsGeoPolygon(e){return h6(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class dte{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x1,n=void 0===t?0:t,r=e.y1,i=void 0===r?0:r,o=e.x2,a=void 0===o?0:o,s=e.y2,l=void 0===s?0:s,c=e.tolerance,u=void 0===c?0:c;this.set({x1:n,y1:i,x2:a,y2:l,tolerance:u})}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x1,n=void 0===t?0:t,r=e.y1,i=void 0===r?0:r,o=e.x2,a=void 0===o?0:o,s=e.y2,l=void 0===s?0:s,c=e.tolerance,u=void 0===c?0:c;this.type="line",this.x1=n,this.y1=i,this.x2=a,this.y2=l,this.tolerance=Math.max(0,Math.round(u)),this.vectors=this.points(),this.zeroSize=n===a&&i===l}containsPoint(e){if(this.tolerance>0){return t6({cx:e.x,cy:e.y,r:this.tolerance},this)}return d6(this,e)}intersectsLine(e){return u6(this,JQ(e))}intersectsRect(e){return c6(XQ(e),this)}intersectsCircle(e){return t6(e,this)}intersectsPolygon(e){return i6(e,this)}intersectsGeoPolygon(e){return g6(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class pte{constructor(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[]:e;this.set({vertices:t})}set(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[]:e;if(this.type="polygon",this.vertices=t.slice(),this.edges=[],function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}(this.vertices),!(this.vertices.length<=2)){!function(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.vertices.length;e++)e<this.vertices.length-1&&this.edges.push([this.vertices[e],this.vertices[e+1]]),this.xMin=isNaN(this.xMin)?this.vertices[e].x:Math.min(this.xMin,this.vertices[e].x),this.xMax=isNaN(this.xMax)?this.vertices[e].x:Math.max(this.xMax,this.vertices[e].x),this.yMin=isNaN(this.yMin)?this.vertices[e].y:Math.min(this.yMin,this.vertices[e].y),this.yMax=isNaN(this.yMax)?this.vertices[e].y:Math.max(this.yMax,this.vertices[e].y);this._bounds=null,this._boundingRect=null}}containsPoint(e){return r6(this,e)}intersectsCircle(e){return n6(e,this)}intersectsLine(e){return i6(this,JQ(e))}intersectsRect(e){return o6(this,XQ(e))}intersectsPolygon(e){return p6(this,e)}intersectsGeoPolygon(e){return f6(e,this)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function fte(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new pte(...t)}function hte(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function mte(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}class gte{constructor(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[[]]:e;this.set({vertices:t})}set(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[]:e;this.type="geopolygon",this.vertices=t.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.numPolygons;e++)mte(this.vertices[e]),this.vertices[e].length>2&&hte(this.vertices[e]),this.polygons[e]=fte({vertices:this.vertices[e]}),this.xMin=isNaN(this.xMin)?this.polygons[e].xMin:Math.min(this.xMin,this.polygons[e].xMin),this.xMax=isNaN(this.xMax)?this.polygons[e].xMax:Math.max(this.xMax,this.polygons[e].xMax),this.yMin=isNaN(this.yMin)?this.polygons[e].yMin:Math.min(this.yMin,this.polygons[e].yMin),this.yMax=isNaN(this.yMax)?this.polygons[e].yMax:Math.max(this.yMax,this.polygons[e].yMax);this._bounds=null,this._boundingRect=null}containsPoint(e){return m6(this,e)}intersectsCircle(e){return h6(e,this)}intersectsLine(e){return g6(this,JQ(e))}intersectsRect(e){return y6(this,XQ(e))}intersectsPolygon(e){return f6(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!a6(n,r)&&(s6(r,n)?Q4(t,e):Q4(e,t))}(this,e)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function yte(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new gte(...t)}function bte(e,t){return e.x!==t.x||e.y!==t.y}class vte{constructor(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).points,t=void 0===e?[]:e;this.set({points:t})}set(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).points,t=void 0===e?[]:e;if(this.type="polyline",this.segments=[],this._points=t.slice(),this._points.length>1)for(let e=0,t=this._points.length-1;e<t;e++)bte(this._points[e],this._points[e+1])&&this.segments.push({x1:this._points[e].x,y1:this._points[e].y,x2:this._points[e+1].x,y2:this._points[e+1].y})}containsPoint(e){return this.segments.some(t=>d6(t,e))}intersectsCircle(e){return this.segments.some(t=>t6(e,t))}intersectsLine(e){const t=JQ(e);return this.segments.some(e=>u6(e,t))}intersectsRect(e){const t=XQ(e);return this.segments.some(e=>c6(t,e))}intersectsPolygon(e){return this.segments.some(t=>i6(e,t))}intersectsGeoPolygon(e){return this.segments.some(t=>g6(e,t))}points(){return this._points}}const xte=i0();function wte(e,t){return xte.get(e)(t)}xte.add("rect",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new cte(...t)}),xte.add("circle",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ute(...t)}),xte.add("line",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new dte(...t)}),xte.add("polygon",fte),xte.add("geopolygon",yte),xte.add("polyline",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new vte(...t)});class Ste{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],e.forEach(e=>{const t=wte(e.type,e);t&&this.geometries.push(t)})}containsPoint(e){return this.geometries.some(t=>t.containsPoint(e))}intersectsLine(e){return this.geometries.some(t=>t.intersectsLine(e))}intersectsRect(e){return this.geometries.some(t=>t.intersectsRect(e))}intersectsCircle(e){return this.geometries.some(t=>t.intersectsCircle(e))}intersectsPolygon(e){return this.geometries.some(t=>t.intersectsPolygon(e))}intersectsGeoPolygon(e){return this.geometries.some(t=>t.intersectsGeoPolygon(e))}}class kte{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new kte).multiply(this)}set(e){return this._elements=e,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(e){let t,n;for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]+=e;return this}translate(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}rotate(e){let t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}multiply(e){let t,n,r,i;if(e instanceof kte&&(e=e._elements),Array.isArray(e)){for(r=[[0,0,0],[0,0,0],[0,0,0]],t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)for(i=0;i<3;i++)r[t][n]+=this._elements[t][i]*e[i][n];this._elements=r}else for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]*=e;return this}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}transform(e,t,n,r,i,o){return this.multiply([[e,n,i],[t,r,o],[0,0,1]]),this}determinant(){let e=this._elements[0][0],t=this._elements[0][1],n=this._elements[0][2],r=this._elements[1][0],i=this._elements[1][1],o=this._elements[1][2],a=this._elements[2][0],s=this._elements[2][1],l=this._elements[2][2],c=0;return c=e*i*l+t*o*a+n*r*s-n*i*a-t*r*l-e*o*s,c}invert(){let e=this.determinant(),t=this._elements[0][0],n=this._elements[0][1],r=this._elements[0][2],i=this._elements[1][0],o=this._elements[1][1],a=this._elements[1][2],s=this._elements[2][0],l=this._elements[2][1],c=this._elements[2][2];return this._elements=[[o*c-a*l,r*l-n*c,n*a-r*o],[a*s-i*c,t*c-r*s,r*i-t*a],[i*l-o*s,s*n-t*l,t*o-n*i]],this.multiply(1/e),this}transpose(){const e=Object.create(this._elements);return this._elements=[[e[0][0],e[1][0],e[2][0]],[e[0][1],e[1][1],e[2][1]],[e[0][2],e[1][2],e[2][2]]],this}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map(e=>e.join("\t")).join("\n"))}isIdentity(){const e=this._elements;return 1===e[0][0]&&0===e[0][1]&&0===e[0][2]&&0===e[1][0]&&1===e[1][1]&&0===e[1][2]&&0===e[2][0]&&0===e[2][1]&&1===e[2][2]}transformPoint(e){let t,n,r=[e.x,e.y,1],i=this._elements,o=[0,0,0];for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)o[t]+=r[n]*i[t][n];return{x:o[0],y:o[1]}}transformPoints(e){let t,n,r,i,o,a=this._elements,s=[];for(i=0;i<e.length;i++){for(t=[e[i].x,e[i].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)o[n]+=t[r]*a[n][r];s.push({x:o[0],y:o[1]})}return s}get elements(){const e=this._elements;return[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]],[e[2][0],e[2][1],e[2][2]]]}}const Cte=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function Ete(e,t){const n=t.args[0]*(Math.PI/180);if(t.args.length>2){const r=t.args[1],i=t.args[2];e.translate(r,i),e.rotate(n),e.translate(-r,-i)}else 1===t.args.length&&e.rotate(n)}function Mte(e,t){const n=t.args[0],r=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,r)}function Rte(e,t){const n=t.args[0],r=isNaN(t.args[1])?0:t.args[1];e.translate(n,r)}function _te(e,t){t.args.length>=6&&e.transform(...t.args)}function Ate(e,t){const n=function(e){let t,n=[];for(;null!==(t=Cte.exec(e));){const e=t[2].trim(),r=-1===e.indexOf(",")?e.split(" "):e.split(",");n.push({cmd:t[1],args:r.filter(e=>e.trim().length>0).map(e=>Number(e))})}return n}(e);let r;for(let e=0,i=n.length;e<i;e++)r=n[e],"rotate"===r.cmd?Ete(t,r):"scale"===r.cmd?Mte(t,r):"matrix"===r.cmd?_te(t,r):"translate"===r.cmd&&Rte(t,r)}const Ite={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},Pte={type:(e,t)=>t.filter(t=>{const n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()}),attr:(e,t,n,r)=>r.filter(r=>{const i=r.attrs[e];if(!t)return void 0!==i;if(void 0===i)return!1;switch(t){case"=":return n===String(i);case"!=":return n!==String(i);default:return!1}}),universal:e=>e,tag:(e,t)=>t.filter(t=>{const n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))})};function Tte(e,t){if(!t||!t.length||!e||"function"!=typeof Pte[e.type])return[];switch(e.type){case"type":case"tag":return Pte[e.type](e.value,t);case"attr":return Pte[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return Pte[e.type](t);default:return[]}}var Dte={find:function(e,t){const n=[],r=[];let i,o;if(t.isBranch){let a;i=function(e){const t=[];let n,r,i,o;return e.split(/\s*,\s*/).forEach(e=>{e=e.trim(),n=[];const a=t=>{i=e.match(Ite[t]),i&&(o=!0,e=e.slice(i[0].length),r={type:t,value:i[0]},"attr"===t&&(i=i[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),r.attribute=i[1],r.operator=i[2],r.attributeValue=i[3]),n.push(r))};for(;e&&(o=!1,i=e.match(/^\s*([>+~]|\s)\s*/),i&&(o=!0,n.push({type:" ",value:i[0]}),e=e.slice(i[0].length)),Object.keys(Ite).forEach(a),n&&n.length&&t.indexOf(n)<0&&t.push(n),o););}),t}(e),o=t.descendants;for(let e=0,t=i.length;e<t;e++){a=i[e];const t=[];let n=o.slice(),s=!1;a.reverse().forEach(e=>{if(" "===e.type)return t.push(n),n=o.slice(),void(s=!1);n=Tte(e,n),s=!0}),s&&t.push(n);const l=t[0].filter(e=>{let n,r=e.parent;for(let e=1;e<t.length;e++){for(n=t[e].indexOf(r);r&&n<0;)r=r.parent,n=t[e].indexOf(r);if(n<0)return!1}return!0});r.push(l)}for(let e=0,t=r.length;e<t;e++)for(let t=0,i=r[e].length;t<i;t++)n.indexOf(r[e][t])<0&&n.push(r[e][t])}return n||[]}};function Ote(e,t,n){const r=e.type;let i=e.points();n&&(i=i.every(e=>Array.isArray(e))?i.map(e=>n.transformPoints(e)):n.transformPoints(i)),function(e,t){for(let n=0,r=e.length;n<r;n++)e[n].x/=t,e[n].y/=t}(i,t);let o=null;if("rect"===r||"bounds"===r)o=XQ(i),o.type=r;else if("circle"===r)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(i,e.r),o.type=r;else if("line"===r)o=JQ(i),o.type=r;else if("polygon"===r||"polyline"===r){o={type:"path",d:x4(i,"polygon"===r)}}else if("geopolygon"===r){let e="";for(let t=0;t<i.length;t++)e+=x4(i[t],!0);o={type:"path",d:e}}return o}class Nte{constructor(e){this._bounds=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const n=e.boundingRect?e.boundingRect(t):{x:0,y:0,width:0,height:0};return{x:n.x,y:n.y,width:n.width,height:n.height}},this._attrs=e.attrs,this._type=e.type,this._data=e.data,this._dpi=e.stage?e.stage.dpi:1,this._collider=()=>function(e,t){if(e.collider){const n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map(e=>Ote(e,t,n))}:Ote(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map(e=>new Nte(e)),this._parent=()=>e.parent?new Nte(e.parent):null,this._cache={elementBoundingRect:null},this._getElementBoundingRect=()=>(!this._cache.elementBoundingRect&&this.element&&(this._cache.elementBoundingRect=this.element.getBoundingClientRect()),this._cache.elementBoundingRect||{left:0,top:0})}get children(){return this._children()}get parent(){return this._parent()}get type(){return this._type}get data(){return this._data}get attrs(){return this._attrs}set element(e){this._cache.elementBoundingRect=null,this._element=e}get element(){return this._element}set key(e){this._key=e}get key(){return this._key}get bounds(){const e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}get localBounds(){return this._bounds(!1)}boundsRelativeTo(e){const t=typeof e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.bounds:this.localBounds,r=this._getElementBoundingRect();let i=r.left,o=r.top;if("object"===t&&null!==e&&"function"==typeof e.getBoundingClientRect){const t=e.getBoundingClientRect(),n=t.left,r=void 0===n?0:n,a=t.top;i-=r,o-=void 0===a?0:a}return n.x+=i,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function qte(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Nte(...t)}class Lte{constructor(e){this._node=qte(e),this._parent=null,this._input=null}get node(){return this._node}set parent(e){this._parent=e}get parent(){return this._parent}set input(e){this._input=e}get input(){return this._input}}function jte(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Lte(...t)}function zte(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=jte(n);const e=n.parent;e&&"stage"!==e.type&&zte(e,t.parent)}}function Fte(e,t,n){if(null===e.colliderType)return null;const r=function(e,t){let n={};if(e.modelViewMatrix)if(Array.isArray(t))n=e.inverseModelViewMatrix.transformPoints(t);else if(isNaN(t.r))Array.isArray(t.vertices)?n.vertices=e.inverseModelViewMatrix.transformPoints(t.vertices):n=e.inverseModelViewMatrix.transformPoint(t);else{const i={x:t.cx,y:t.cy};var r=e.inverseModelViewMatrix.transformPoint(i);n.cx=r.x,n.cy=r.y,n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every(e=>Array.isArray(e))?yte(n):fte(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(let r=e.descendants.length-1;r>=0;r--){const i=e.descendants[r];if(null!==i.collider&&i.collider[t](n)){const e=jte(i);return zte(i,e),e}}return null}(e,t,r):function(e,t,n){if(e.collider[t](n)){const t=jte(e);return zte(e,t),t}return null}(e,t,r)}function $te(e,t,n,r){const i=e.length;for(let o=0;o<i;o++){const i=e[o],a=Fte(i,t,r);a&&n.push(a),!i.children||a||i.collider||$te(i.children,t,n,r)}}function Bte(e,t,n){const r=e.length;for(let i=0;i<r;i++){const r=e[i];if(null!==Fte(r,t,n))return!0;if(r.children&&!r.collider)return Bte(r.children,t,n)}return!1}function Hte(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(QQ(e)){case"circle":return n.cx=e.cx*t,n.cy=e.cy*t,n.r=e.r,["intersectsCircle",n];case"rect":return n=KQ(e).map(e=>M4(e,t)),["intersectsRect",n];case"line":return n=YQ(e).map(e=>M4(e,t)),["intersectsLine",n];case"point":return n=M4(e,t),["containsPoint",n];case"polygon":return n.vertices=e.vertices.map(e=>M4(e,t)),["intersectsPolygon",n];case"geopolygon":return n.vertices=e.vertices.map(e=>e.map(e=>M4(e,t))),["intersectsGeoPolygon",n];default:return[]}}function Vte(e,t){const n=HQ(Hte(t,e.dpi),2),r=n[0],i=n[1],o=[];return r&&($te([e],r,o,i),function(e,t){for(let n=0,r=t.length;n<r;n++)t[n].input=e}(t,o)),o}function Wte(e,t){const n=HQ(Hte(t,e.dpi),2);return Bte([e],n[0],n[1])}class Ute extends lte{constructor(e){super(e),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;const t=e.data,n=e.desc,r=e.tag,i=e.strokeReference,o=e.fillReference;var a,s;a=this.attrs,s=e,Object.keys(v4).forEach(e=>{const t=s[e];void 0!==t&&(a[v4[e]]=t)}),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=LQ(!0,{},n)),"string"==typeof r&&(this.tag=r),"string"==typeof i&&(this.strokeReference=i),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return Dte.find(e,this).map(e=>qte(e))}getItemsFrom(e){return Vte(this,e)}containsPoint(e){return Wte(this,e)}intersectsLine(e){return Wte(this,e)}intersectsRect(e){return Wte(this,e)}intersectsCircle(e){return Wte(this,e)}intersectsPolygon(e){return Wte(this,e)}intersectsGeoPolygon(e){return Wte(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new kte;void 0!==this.attrs.transform&&Ate(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new kte;const t=this.ancestors;if(t.length>0)for(let n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}attr(e){return this.attrs[e]}equals(e){const t=this.attrs,n=Object.keys(t),r=e.attrs,i=Object.keys(r);if(n.length!==i.length)return!1;for(let e=0;e<n.length;e++){const i=n[e];if(!Object.hasOwnProperty.call(r,i))return!1;if(t[i]!==r[i])return!1}return super.equals(e)}toJSON(){const e=super.toJSON();return e.attrs=this.attrs,e}get attrs(){return this._attrs}get stage(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}set modelViewMatrix(e){this._mvm=e,this._imvm=null}get modelViewMatrix(){return this._mvm}get inverseModelViewMatrix(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}set node(e){this._node=e}get node(){return this._node}set collider(e){const t=Array.isArray(e)?"collection":e&&e.type;return"string"!=typeof t?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===t&&null!==this._collider.fn?(this._collider.fn.set(e),void(this._collider.definition=e)):(this._collider.type=t,void(this._collider.definition=e))}get collider(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Ste(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=wte("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=wte(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class Gte extends lte{addChild(e){if(!(e&&e instanceof lte))throw new TypeError("Expecting a Node as argument, but got ".concat(e));if(e===this)throw new Error("Can not add itself as child!");if(e._children&&e._children.length&&this.ancestors.indexOf(e)>=0)throw new Error("Can not add an ancestor as child!");return e._parent&&e._parent!==this&&e._parent.removeChild(e),this._children.push(e),e._parent=this,e._ancestors=null,this}addChildren(e){let t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}removeChild(e){const t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}removeChildren(e){let t,n;if(!this._children)return this;if(e)for(n=e.length,t=0;t<n;t++)this.removeChild(e[t]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}const Yte=Gte.prototype;class Kte extends Ute{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.type;super(void 0===t?"container":t),this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=e.collider,n=LQ({type:null},t);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(e,t){if(void 0!==e.bounds){const n=this.__boundingRect[t]||{},r=HQ(e.bounds(t),3),i=r[0],o=r[2],a=i.x,s=i.y,l=o.x,c=o.y,u=isNaN(n.width)?l:Math.max(l,n.width+n.x),d=isNaN(n.height)?c:Math.max(c,n.height+n.y);n.x=isNaN(n.x)?a:Math.min(a,n.x),n.y=isNaN(n.y)?s:Math.min(s,n.y),n.width=u-n.x,n.height=d-n.y,this.__boundingRect[t]=n}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.children.length;for(let n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=LQ({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}addChild(e){const t=Yte.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=LQ({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=Yte.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let t=0;t<n;t++)this.appendChildRect(e[t],!0);const t=LQ({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;if(Yte.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=LQ(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(Yte.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=LQ(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function Xte(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Kte(...t)}class Jte extends Kte{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const Qte=Gte.prototype,Zte=["x1","x2","y1","y2","id","offset","style"];class ene extends Ute{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.type;super(void 0===t?"container":t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=Zte.length;r!==i;r++)n=Zte[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return Qte.addChild.call(this,e)}addChildren(e){return Qte.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return Qte.removeChild.call(this,e),this}removeChildren(e){return Qte.removeChildren.call(this,e),this}}function tne(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ene(...t)}const nne=Gte.prototype,rne=["patternUnits","x","y","width","height","id"];class ine extends Ute{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.type;super(void 0===t?"container":t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=rne.length;r!==i;r++)n=rne[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return nne.addChild.call(this,e)}addChildren(e){return nne.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return nne.removeChild.call(this,e),this}removeChildren(e){return nne.removeChildren.call(this,e),this}}class one extends Ute{constructor(){super("rect"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,c=e.rx,u=void 0===c?0:c,d=e.ry,p=void 0===d?0:d,f=e.collider,h=LQ({type:"rect",x:n,y:i,width:a,height:l},f);super.set(e),a>=0?(this.attrs.x=n,this.attrs.width=a):(this.attrs.x=n+a,this.attrs.width=-a),l>=0?(this.attrs.y=i,this.attrs.height=l):(this.attrs.y=i+l,this.attrs.height=-l),u>0&&(this.attrs.rx=u),p>0&&(this.attrs.ry=p),this.collider=h,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=KQ(this.attrs),n=HQ(GQ(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t),4),r=n[0],i=n[1],o=n[2],a=n[3];return this.__boundingRect[e]={x:r,y:i,width:o-r,height:a-i},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}class ane extends Ute{constructor(){super("circle"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.cx,n=void 0===t?0:t,r=e.cy,i=void 0===r?0:r,o=e.r,a=void 0===o?0:o,s=e.collider,l=LQ({type:"circle",cx:n,cy:i,r:a},s);super.set(e),this.attrs.cx=n,this.attrs.cy=i,this.attrs.r=a,this.collider=l,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.bounds(e);return this.__boundingRect[e]={x:t[0].x,y:t[0].y,width:t[2].x-t[0].x,height:t[2].y-t[0].y},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.attrs,n=t.cx,r=t.cy,i=t.r,o=t.r,a=n-i,s=r-o;let l=2*i,c=2*o,u=[{x:a,y:s},{x:a+l,y:s},{x:a+l,y:s+c},{x:a,y:s+c}];if(e&&this.modelViewMatrix){u=this.modelViewMatrix.transformPoints(u);const t=HQ(GQ(u),4),n=t[0],r=t[1];l=t[2]-n,c=t[3]-r,this.__bounds[e]=[{x:n,y:r},{x:n+l,y:r},{x:n+l,y:r+c},{x:n,y:r+c}]}else this.__bounds[e]=u;return this.__bounds[e]}}class sne extends Ute{constructor(){super("line"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x1,n=void 0===t?0:t,r=e.y1,i=void 0===r?0:r,o=e.x2,a=void 0===o?0:o,s=e.y2,l=void 0===s?0:s,c=e.collider;super.set(e),this.attrs.x1=n,this.attrs.y1=i,this.attrs.x2=a,this.attrs.y2=l;const u={type:"line",x1:n,y1:i,x2:a,y2:l};this.collider=LQ(u,c),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];let t=YQ(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const n=HQ(GQ(t),4),r=n[0],i=n[1],o=n[2],a=n[3],s=r!==o||i!==a;return this.__boundingRect[e]={x:r,y:i,width:s?Math.max(1,o-r):0,height:s?Math.max(1,a-i):0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const lne=Math.PI/2;function cne(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function une(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const dne={step:function(e){return new JZ(e,.5)},stepAfter:function(e){return new JZ(e,1)},stepBefore:function(e){return new JZ(e,0)},linear:AZ,basis:function(e){return new qZ(e)},cardinal:zZ.tension(0),catmullRom:$Z,monotonex:function(e){return new UZ(e)},monotoney:function(e){return new GZ(e)},natural:function(e){return new KZ(e)}};function pne(e){if(e.length<2)return!1;const t=e[0],n=e[e.length-1];return Math.abs(t.x-n.x)<1e-12&&Math.abs(t.y-n.y)<1e-12}class fne extends Ute{constructor(){super("path"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(e),this.segments=[],this.points=[],e.arcDatum){const t=MZ();t.innerRadius(e.desc.slice.innerRadius),t.outerRadius(e.desc.slice.outerRadius),t.cornerRadius(e.desc.slice.cornerRadius);const n=t(e.arcDatum);this.attrs.d=n}else if(e.points){const t=e.major,n=e.minor,r=e.layerObj,i=e.points,o=e.stngs,a=e.generatorType,s=TZ(),l=o.coordinates?o.coordinates.defined:null;s[t.p](e=>e.major*t.size)["".concat(n.p,"1")](e=>e.minor*n.size)["".concat(n.p,"0")](e=>e.minor0*n.size).curve(dne["monotone"===r.curve?"monotone".concat(t.p):r.curve]),l?s.defined(e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined):s.defined(e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor));const c=o.connect?i.filter(s.defined()):i,u=("area"===a?s:s[a]())(c);this.attrs.d=u}else e.d&&(this.attrs.d=e.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(e.collider)||"object"==typeof e.collider&&void 0!==e.collider.type)this.collider=e.collider;else if(this.attrs.d){if(this.segments=ote(this.attrs.d),this.segments.length>1&&this.segments.every(e=>pne(e)))return void(this.collider=LQ({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach(t=>{if(t.length<=1);else if(pne(t))this.collider=LQ({type:"polygon",vertices:t},e.collider);else if("object"==typeof e.collider&&e.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=[],i=[];if("h"===n.forceOrientation){const t=e[0].x<e[1].x?-1:1,n=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+t,y:e[0].y}),e.push({x:e[e.length-1].x+n,y:e[e.length-1].y})}else if("v"===n.forceOrientation){const t=e[0].y<e[1].y?-1:1,n=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+t}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+n})}const o=e.length-1;for(let n=1;n<o;n++){const a=e[n-1],s=e[n],l=e[n+1],c=cne(s,a),u=cne(s,l),d=(c+u)/2,p=d+Math.PI,f=Math.max(d,p),h=Math.min(d,p),m=c>u;if(1===n){const e=cne(a,s);r.push(une(a,e-lne,t)),i.unshift(une(a,e+lne,t))}const g=m?f:h,y=m?h:f;if(r.push(une(s,g,t)),i.unshift(une(s,y,t)),n===o-1){const e=cne(l,s);r.push(une(l,e+lne,t)),i.unshift(une(l,e-lne,t))}}return{type:"polygon",vertices:[...r,...i]}}(t,n,e.collider)}else this.collider=LQ({type:"polyline",points:t},e.collider)})}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];this.points.length||(this.segments=this.segments.length?this.segments:ote(this.attrs.d),this.points=function(e){const t=[];let n,r=e.length;for(let i=0;i<r;i++){n=e[i];for(let e=0;e<n.length;e++)t.push(n[e])}return t}(this.segments));const t=HQ(GQ(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points),4),n=t[0],r=t[1],i=t[2],o=t[3];return this.__boundingRect[e]={x:n||0,y:r||0,width:i-n||0,height:o-r||0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}function hne(e){let t=e.data,n=e._boundingRect,r=e._textBoundsFn;return null!=t&&(n||r)}class mne extends Ute{constructor(){super("text"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.dx,a=void 0===o?0:o,s=e.dy,l=void 0===s?0:s,c=e.textBoundsFn,u=e.text,d=e.title,p=e.collider,f=e.boundingRect,h=e.ellipsed;super.set(e),this.attrs.x=n,this.attrs.y=i,this.attrs.dx=a,this.attrs.dy=l,this.attrs.text=u,void 0!==d&&(this.attrs.title=String(d)),"object"==typeof f?this._textBoundsFn=()=>f:"function"==typeof c&&(this._textBoundsFn=c),"string"==typeof h&&(this.ellipsed=h),this.collider=LQ({type:hne(this)?"bounds":null},p),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};e=this._textBoundsFn(this.attrs);const n=KQ(e),r=HQ(GQ(t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n),4),i=r[0],o=r[1],a=r[2],s=r[3];return this.__boundingRect[t]={x:i,y:o,width:a-i,height:s-o},this.__boundingRect[t]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}let gne=class extends Ute{constructor(){super("image"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,c=e.rx,u=void 0===c?0:c,d=e.ry,p=void 0===d?0:d,f=e.src,h=e.collider,m=e.cx,g=void 0===m?0:m,y=e.cy,b=void 0===y?0:y,v=e.r,x=void 0===v?0:v,w=e.opacity,S=e.imageScalingFactor,k=e.imagePosition,C=e.symbol;let E;E="circle"===e.symbol?LQ({type:"circle",cx:g,cy:b,r:x},h):LQ({type:"bounds",x:n,y:i,width:a,height:l},h),super.set(e),a>=0?(this.attrs.x=n,this.attrs.width=a):(this.attrs.x=n+a,this.attrs.width=-a),l>=0?(this.attrs.y=i,this.attrs.height=l):(this.attrs.y=i+l,this.attrs.height=-l),u>0&&(this.attrs.rx=u),p>0&&(this.attrs.ry=p),f&&(this.attrs.src=f),this.attrs.r=x,this.attrs.cx=g,this.attrs.cy=b,this.attrs.opacity=void 0!==w?w:1,this.attrs.imageScalingFactor=void 0!==S?S:1,this.attrs.imagePosition=k||"center-center",this.attrs.symbol=C||"rectangle",this.collider=E,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},e.collider||(this.attrs.updateCollider=this.updateCollider.bind(this))}updateCollider(e){let t;t="circle"===e.symbol?LQ(this.collider,{type:"circle",cx:e.cx,cy:e.cy,r:e.r}):LQ(this.collider,{type:"bounds",x:e.x,y:e.y,width:e.width,height:e.height}),this.collider=t}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=KQ(this.attrs),n=HQ(GQ(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t),4),r=n[0],i=n[1],o=n[2],a=n[3];return this.__boundingRect[e]={x:r,y:i,width:o-r,height:a-i},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];if("circle"===this._node.symbol){const t=this.boundingRect(e),n=Math.min(t.width,t.height)/2,r=t.x-n,i=t.y-n;let o=2*n,a=2*n,s=[{x:r,y:i},{x:r+o,y:i},{x:r+o,y:i+a},{x:r,y:i+a}];if(e&&this.modelViewMatrix){s=this.modelViewMatrix.transformPoints(s);const t=HQ(GQ(s),4),n=t[0],r=t[1];o=t[2]-n,a=t[3]-r,this.__bounds[e]=[{x:n,y:r},{x:n+o,y:r},{x:n+o,y:r+a},{x:n,y:r+a}]}else this.__bounds[e]=s;return this.__bounds[e]}const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}};const yne=i0();function bne(e,t){return yne.get(e)(t)}yne.add("rect",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new one(...t)}),yne.add("circle",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ane(...t)}),yne.add("text",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new mne(...t)}),yne.add("line",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new sne(...t)}),yne.add("path",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new fne(...t)}),yne.add("stage",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Jte(...t)}),yne.add("container",Xte),yne.add("defs",Xte),yne.add("linearGradient",tne),yne.add("radialGradient",tne),yne.add("conicGradient",tne),yne.add("stop",tne),yne.add("pattern",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ine(...t)}),yne.add("image",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new gne(...t)});const vne=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[{}];function n(){return t[t.length-1]}return n.save=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=n(),o={};let a="";for(let t=0;t<e.length;t++)a=e[t],void 0!==i[a]&&(o[a]=i[a]);return LQ(o,r),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function xne(e,t){if(Array.isArray(t))for(let n=0,r=t.length;n<r;n++)t[n](e)}function wne(e,t,n){e.node=n[t],e.index=t}function Sne(e,t,n,r){let i=!1;const o={siblings:e,node:null,index:0};for(let a=0,s=e.length;a<s;a++){if(wne(o,a,e),xne(o,r.create),i="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,i)continue;o.node=vne.save(o.node);const s=bne(o.node.type,o.node);s&&(o.node.transform&&(n.save(),Ate(o.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),t.addChild(s),o.node.children&&Sne(o.node.children,s,n,r),o.node.transform&&n.restore()),vne.restore()}}function kne(e){let t=e.items,n=e.stage,r=e.dpi,i=e.on,o=void 0===i?{}:i;return n||(n=bne("stage",r)),Sne(t,n,new kte,o),n}function Cne(e,t,n){const r=n.orientation,i=n.degree,o=n.stops,a=void 0===o?[]:o;let s=null;if("radial"===r){const n=t.boundingRect();s=e.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else if("conic"===r){const t=n.startAngle||0,r=n.x||0,i=n.y||0;s=e.createConicGradient(t,r,i)}else{const r=k4(i);["x1","x2","y1","y2"].forEach(e=>{e in n&&(r[e]=n[e])});const o=t.boundingRect();s=e.createLinearGradient(o.x+r.x1*o.width,o.y+r.y1*o.height,o.x+r.x2*o.width,o.y+r.y2*o.height)}for(let e=0,t=a.length;e<t;e++){let t=a[e];s.addColorStop(t.offset,t.color)}return s}function Ene(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach(e=>{if("rect"===e.type)n.rect(e.x,e.y,e.width,e.height)}),n.fill(),n.restore(),n.createPattern(t,"repeat")}function Mne(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=e.y,r=e.width,i=e.height,o=e.scaleRatio,a=e.margin,s=e.edgeBleed;const l={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0},edgeBleed:{left:0,right:0,top:0,bottom:0,bool:!1}};return l.x=isNaN(t)?l.x:t,l.y=isNaN(n)?l.y:n,l.width=isNaN(r)?l.width:r,l.height=isNaN(i)?l.height:i,void 0!==o&&(l.scaleRatio.x=isNaN(o.x)?l.scaleRatio.x:o.x,l.scaleRatio.y=isNaN(o.y)?l.scaleRatio.y:o.y),void 0!==a&&(l.margin.left=isNaN(a.left)?0:a.left,l.margin.top=isNaN(a.top)?0:a.top),"object"==typeof s&&["left","right","top","bottom"].forEach(e=>{!isNaN(s[e])&&s[e]>0&&(l.edgeBleed[e]=s[e],l.edgeBleed.bool=!0)}),l.computedPhysical={x:Math.round(l.margin.left+(l.x-l.edgeBleed.left)*l.scaleRatio.x),y:Math.round(l.margin.top+(l.y-l.edgeBleed.top)*l.scaleRatio.y),width:Math.round((l.width+l.edgeBleed.left+l.edgeBleed.right)*l.scaleRatio.x),height:Math.round((l.height+l.edgeBleed.top+l.edgeBleed.bottom)*l.scaleRatio.y)},l}function Rne(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:J9,textBounds:Z9,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function _ne(e){return t=>{let n=t.node;"text"===n.type&&function(e){return null!=e}(n.data)&&!n.textBoundsFn&&(n.textBoundsFn=e.textBounds)}}const Ane=200,Ine=200;class Pne{constructor(e){this.targetCanvas=e,this.bufferCanvas=e.cloneNode()}updateSize(e){let t,n=e.rect,r=e.dpiRatio,i=e.canvasBufferSize;t=i?"function"==typeof i?i(n):i:{width:n.computedPhysical.width+2*Ane,height:n.computedPhysical.height+2*Ine},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*r),this.bufferCanvas.height=Math.round(t.height*r)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const Tne=i0();function Dne(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function One(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function Nne(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function qne(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Object.keys(r);for(let i=0,o=n.length;i<o;i++){let o=n[i];const a=o[0],s=o[1],l=o[2];if(a in t.attrs&&!(s in r)&&e[s]!==t.attrs[a]){const n=l?l(t.attrs[a]):t.attrs[a];"function"==typeof e[s]?e[s](n):e[s]=n}}for(let t=0,n=i.length;t<n;t++){const n=i[t];e[n]=r[n]}}function Lne(e,t,n,r){for(let i=0,o=e.length;i<o;i++){let o=e[i],a={};t.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?a.fillStyle=Cne(t,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(a.fillStyle=r.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?a.strokeStyle=Cne(t,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(a.strokeStyle=r.patterns.create(o.attrs.stroke))),qne(t,o,n,a),o.modelViewMatrix&&Nne(o.modelViewMatrix.elements,t),Tne.has(o.type)&&Tne.get(o.type)(o.attrs,{g:t,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&Lne(o.children,t,n,r),t.restore()}}function jne(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:kne;const r={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let i,o=!1,a=Mne();const s=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",Dne]];let l;const c=Rne();return c.element=()=>e,c.root=()=>e,c.settings=e=>(e&&Object.keys(r).forEach(t=>{void 0!==e[t]&&(r[t]=e[t])}),r),c.appendTo=n=>(e||(e=n.ownerDocument.createElement("canvas"),e.style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof r.transform||t||(t=new Pne(e)),n.appendChild(e),e),c.getScene=r=>{const i=One(t&&t.getContext()||e.getContext("2d")),o=a.scaleRatio.x,s=a.scaleRatio.y,l={type:"container",children:r,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*i*o,", ").concat(a.edgeBleed.top*i*s,")"):""};return 1===i&&1===o&&1===s||(l.transform+="scale(".concat(i*o,", ").concat(i*s,")")),n({items:[l],dpi:i,on:{create:[$9(c.measureText),_ne(c)]}})},c.render=n=>{if(!e)return!1;l||(l=function(e){const t=e.createElement("canvas"),n=t.getContext("2d");let r={};return{create(e){const i=e.key;return i?(r[i]=r[i]||Ene(e,t,n),r[i]):Ene(e,t,n)},clear(){r={}}}}(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),d=One(u),p=t&&r.transform();if(p)return e.width=e.width,function(e){let t=e.el,n=e.dpiRatio,r=e.transform;if("object"==typeof r){const e=[r.horizontalScaling,r.horizontalSkewing,r.verticalSkewing,r.verticalScaling,r.horizontalMoving*n,r.verticalMoving*n];t.getContext("2d").setTransform(...e)}}({el:e,dpiRatio:d,transform:p}),t.apply(),!0;o&&(e.style.left="".concat(a.computedPhysical.x,"px"),e.style.top="".concat(a.computedPhysical.y,"px"),e.style.width="".concat(a.computedPhysical.width,"px"),e.style.height="".concat(a.computedPhysical.height,"px"),e.width=Math.round(a.computedPhysical.width*d),e.height=Math.round(a.computedPhysical.height*d),t&&t.updateSize({rect:a,dpiRatio:d,canvasBufferSize:r.canvasBufferSize}));const f=c.getScene(n),h=!i||!f.equals(i);l.clear();const m=o||h,g="function"==typeof r.progressive&&r.progressive();return m&&(g&&!g.isFirst||c.clear(),Lne(f.children,u,s,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,g&&!g.isFirst&&f.children.unshift(...i.children),i=f,m},c.itemsAt=e=>i?i.getItemsFrom(e):[],c.findShapes=e=>i?i.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),i=null,c),c.size=e=>{if(e){const t=Mne(e);JSON.stringify(a)!==JSON.stringify(t)&&(o=!0,a=t)}return a},c.destroy=()=>{e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),i=null},c}function zne(e,t){Tne.add(e,t)}function Fne(e,t){return Math.max(0,Math.min(e,t))}const $ne=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Bne=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),Hne=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function Vne(e){return $ne.test(e)}function Wne(e){return Bne.test(e)||Hne.test(e)}function Une(e){let t,n,r=e?e.length:0;for(t=0;t<r;t++){if(n=e[t],Vne(n))return"ltr";if(Wne(n))return"rtl"}return"ltr"}const Gne={start:"end",end:"start",center:"center",middle:"middle"};function Yne(e,t){return"rtl"===t?Gne[e]:e}function Kne(e,t){if(Kne.cache[e])return void t(Kne.cache[e]);const n=new Image;n.src=e,n.onload=()=>{Kne.cache[e]=n,t(n)},n.onerror=e=>{console.error("Image load error",e)}}function Xne(e,t){const n=[];let r;const i=[],o=[],a=[];let s,l;const c=e=>e.id,u=(e,t)=>{let n;return n="object"==typeof e?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(u)),t=t.map(u),s=e.map(c),l=t.map(c);for(let e=0,r=t.length;e<r;e++){-1===s.indexOf(t[e].id)?n.push(t[e]):o.push(t[e])}for(let t=0,n=e.length;t<n;t++){-1===l.indexOf(e[t].id)?i.push(e[t]):a.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=Xne([],n[e].content.children),n[e].children=n[e].diff.updatedNew.concat(n[e].diff.added),n[e].children.isTree=!0);for(let e=0,t=o.length;e<t;e++)o[e].diff=Xne(a[e].children||[],o[e].content.children||[]),o[e].object=a[e].object,o[e].children=o[e].diff.items;return r=o.concat(n),n.isTree=!0,i.isTree=!0,o.isTree=!0,a.isTree=!0,r.isTree=!0,{added:n,updatedNew:o,updatedOld:a,removed:i,items:r}}function Jne(e,t,n){for(let r=0,i=e.length;r<i;r++)e[r].object=n(e[r].content.type,t)}function Qne(e,t){for(let n=0,r=e.length;n<r;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function Zne(e,t,n,r){let i;for(let o=0,a=e.length;o<a;o++)i=e[o],null!==i.object&&void 0!==i.object&&(n(i.object,i.content),i.diff&&(Jne(i.diff.added,i.object,t),Qne(i.diff.removed,r),Zne(i.diff.items,t,n,r)))}function ere(e,t,n,r,i,o){const a=Xne(e,t);return Jne(a.added,n,r),Qne(a.removed,o),Zne(a.items,r,i,o),a.items}Kne.cache={},zne("rect",function(e,t){let n=t.g,r=t.doFill,i=t.doStroke;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,r,i,o,a){o=Fne(r/2,o>0?o:a),a=Fne(i/2,a>0?a:o),e.moveTo(t,n+a),e.lineTo(t,n+i-a),e.quadraticCurveTo(t,n+i,t+o,n+i),e.lineTo(t+r-o,n+i),e.quadraticCurveTo(t+r,n+i,t+r,n+i-a),e.lineTo(t+r,n+a),e.quadraticCurveTo(t+r,n,t+r-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+a)}(n,e.x,e.y,e.width,e.height,e.rx,e.ry):n.rect(e.x,e.y,e.width,e.height),r&&n.fill(),i&&n.stroke()}),zne("circle",function(e,t){let n=t.g,r=t.doFill,i=t.doStroke;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),r&&n.fill(),i&&n.stroke()}),zne("line",function(e,t){let n=t.g,r=t.doStroke;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),r&&n.stroke()}),zne("path",function(e,t){let n=t.g,r=t.doStroke,i=t.doFill;const o=new Path2D(e.d);i&&n.fill(o),r&&n.stroke(o)}),zne("text",function(e,t){let n=t.g,r=t.ellipsed,i=t.doStroke;const o=r||B9(e,J9);n.font=[e["font-style"],e["font-weight"],e["font-size"],e["font-family"]].filter(e=>!!e).join(" ");const a=Une(e.text);n.canvas.dir!==a&&(n.canvas.dir=a);const s=Yne("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);const l=H9(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),i&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)}),zne("image",function(e,t){let n=t.g;const r=n.canvas,i=n.getTransform(),o=window.devicePixelRatio||1,a=r.clientWidth*o,s=r.clientHeight*o;r.width===a&&r.height===s||(r.width=a,r.height=s),Kne(e.src,t=>{if(n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,r.width,r.height),n.setTransform(i),n.globalAlpha=e.opacity,e.width||e.height||(e.width=t.naturalWidth*e.imageScalingFactor,e.height=t.naturalHeight*e.imageScalingFactor),function(e){const t=e.imagePosition||"center-center";let n=e.width,r=e.height;if("circle"===e.symbol){const t=Math.min(e.width,e.height)/2;n=2*t,r=2*t}switch(t){case"top-center":e.y-=r/2;break;case"center-left":e.x-=n/2;break;case"center-right":e.x+=n/2;break;case"top-left":e.x-=n/2,e.y-=r/2;break;case"top-right":e.x+=n/2,e.y-=r/2;break;case"bottom-left":e.x-=n/2,e.y+=r/2;break;case"bottom-right":e.x+=n/2,e.y+=r/2;break;case"bottom-center":e.y+=r/2}}(e),"circle"===e.symbol){const r=e.x,i=e.y;e.r=Math.min(e.width,e.height)/2;const o=r-e.width/2,a=i-e.height/2;n.save(),n.beginPath(),n.arc(r,i,e.r,0,2*Math.PI),n.clip(),n.drawImage(t,o,a,e.width,e.height),n.restore()}else e.x-=e.width/2,e.y-=e.height/2,n.drawImage(t,e.x,e.y,e.width,e.height);n.globalAlpha=1,e.updateCollider&&e.updateCollider(e)})});const tre="http://www.w3.org/2000/svg",nre=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(tre,"container"===e?"g":e);return t.appendChild(n),n},rre=e=>{e.parentNode&&e.parentNode.removeChild(e)};function ire(e){let t=e.element,n=e.attrs;return function(){const e=n.width,r=n.height,i=n.imagePosition,o=n.imageScalingFactor,a=n.symbol;let s=n.x,l=void 0===s?0:s,c=n.y,u=void 0===c?0:c,d=e>0?e:this.naturalWidth,p=r>0?r:this.naturalHeight;switch(o&&(d*=o,p*=o),i){case"top-center":u-=p/2;break;case"center-left":l-=d/2;break;case"center-right":l+=d/2;break;case"top-left":l-=d/2,u-=p/2;break;case"top-right":l+=d/2,u-=p/2;break;case"bottom-left":l-=d/2,u+=p/2;break;case"bottom-right":l+=d/2,u+=p/2;break;case"bottom-center":u+=p/2}if(t.setAttribute("width",d),t.setAttribute("height",p),t.setAttribute("x",l-d/2),t.setAttribute("y",u-p/2),t.setAttribute("preserveAspectRatio","none"),"circle"===a){const e=t.ownerSVGElement;if(!e)return;const n="clip-".concat(Math.random().toString(36).substr(2,9));if(!e.querySelector("#".concat(n))){const t=e.querySelector("defs")||e.insertBefore(document.createElementNS(tre,"defs"),e.firstChild),r=document.createElementNS(tre,"clipPath");r.setAttribute("id",n);const i=document.createElementNS(tre,"circle");i.setAttribute("cx",l),i.setAttribute("cy",u),i.setAttribute("r",Math.min(d,p)/2),r.appendChild(i),t.appendChild(r)}t.setAttribute("clip-path","url(#".concat(n,")"))}}}const ore=(e,t)=>{if((e=>{switch(e.type){case"circle":return!isNaN(e.attrs.cx)&&!isNaN(e.attrs.cy)&&!isNaN(e.attrs.r);case"line":return!(isNaN(e.attrs.x1)||isNaN(e.attrs.y1)||isNaN(e.attrs.x2)||isNaN(e.attrs.y2));case"rect":return!(isNaN(e.attrs.x)||isNaN(e.attrs.y)||isNaN(e.attrs.width)||isNaN(e.attrs.height));case"text":case"image":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}})(t)){for(const n in t.attrs)if("stroke"===n&&t.strokeReference)e.setAttribute("stroke",t.strokeReference);else if("fill"===n&&t.fillReference)e.setAttribute("fill",t.fillReference);else if("text"===n){e.setAttribute("style","white-space: pre"),e.textContent=t.ellipsed||B9(t.attrs,J9);const n=Une(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",Yne(e.getAttribute("text-anchor"),n)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){const n=e.ownerDocument.createElementNS(tre,"title");n.textContent=t.attrs.title,e.appendChild(n)}else if("image"===t.type&&"src"===n){e.setAttributeNS("http://www.w3.org/1999/xlink","href",t.attrs.src);let n=new Image;n.src=t.attrs.src,n.onload=ire({element:e,attrs:t.attrs})}else e.setAttribute(n,t.attrs[n]);else{const r=+e.getAttribute(n)||0;let i=0;i="dominant-baseline"===n?H9(t.attrs):t.attrs[n],e.setAttribute("dy",i+r)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"==typeof t.data&&null!==t.data)for(const n in t.data)"string"!=typeof t.data[n]&&"number"!=typeof t.data[n]&&"boolean"!=typeof t.data[n]||e.setAttribute("data-".concat(n),t.data[n])}};class are{constructor(e,t,n,r){this.create=e,this.nodeCreator=t,this.nodeMaintainer=n,this.nodeDestroyer=r}render(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function sre(){return new are(ere,nre,ore,rre)}function lre(e){let t,n,r,i=0;if(0===(e=JSON.stringify(e)).length)return i;for(t=0,r=e.length;t<r;t++)n=e.charCodeAt(t),i=(i<<5)-i+n,i&=i;return i}function cre(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tre,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:kne;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:sre)();let r,i,o,a=!1,s=Mne();const l={transform:void 0,disableScreenReader:!1},c=Rne(),u={type:"defs",children:[]},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lre,n={},r=Date.now();const i={onCreate(i){let o={};i.node&&"object"==typeof i.node.fill&&"pattern"===i.node.fill.type&&i.node.fill.shapes&&(o.fill=i.node.fill),i.node&&"object"==typeof i.node.stroke&&"pattern"===i.node.stroke.type&&i.node.stroke.shapes&&(o.stroke=i.node.stroke),Object.keys(o).forEach(a=>{let s="";const l=o[a],c=t(l),u="picasso-pattern-".concat(r,"-").concat(c);if("undefined"!=typeof window&&(s=window.location.href.split("#")[0]),!n[c]){const t={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach(e=>{t.children.push(e)}),e.push(t),n[c]=!0}i.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(u,"')")})},clear(){n={}}};return i}(u.children),p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lre,n={},r=Date.now();const i={getOrCreateGradient(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=t(i[o]),l="picasso-gradient-".concat(r,"-").concat(s);if(!n[s]){let t=i[o],r=t.orientation,a=t.degree,c=t.stops,u=void 0===c?[]:c,d={};void 0===a&&(a=90),"radial"===r?d.type="radialGradient":(d=k4(a),["x1","x2","y1","y2"].forEach(e=>{e in i[o]&&(d[e]=i[o][e])}),d.type="linearGradient"),d.id=l,d.children=u.map(e=>{let t=e.offset,n=e.color,r=e.opacity;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==r?r:1)}}),e.push(d),n[s]=l}return"url('".concat(a,"#").concat(l,"')")},onCreate(e){let t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);const n=e.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=i.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=i.getOrCreateGradient(n,"stroke",t))},clear(){n={}}};return i}(u.children);return c.element=()=>r,c.root=()=>i,c.settings=e=>(e&&Object.keys(l).forEach(t=>{void 0!==e[t]&&(l[t]=e[t])}),l),c.appendTo=t=>(r||(r=t.ownerDocument.createElementNS(e,"svg"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none",r.setAttribute("xmlns",e),i=t.ownerDocument.createElementNS(e,"g"),i.style.pointerEvents="auto",r.appendChild(i)),t.appendChild(r),r),c.getScene=e=>{const n=s.scaleRatio.x,r=s.scaleRatio.y,i={type:"container",children:Array.isArray(e)?[...e,u]:e,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*n,", ").concat(s.edgeBleed.top*r,")"):""};return 1===n&&1===r||(i.transform+="scale(".concat(n,", ").concat(r,")")),t({items:[i],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},p.onCreate,d.onCreate,$9(c.measureText),_ne(c)]}})},c.render=e=>{if(!r)return!1;const t="function"==typeof l.transform&&l.transform();if(t){const e=t.horizontalScaling,n=t.horizontalSkewing,r=t.verticalSkewing,o=t.verticalScaling,a=t.horizontalMoving,s=t.verticalMoving;return i.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(r,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}i.style.transform="";l.disableScreenReader&&r.setAttribute("aria-hidden",!0),a&&(r.style.left="".concat(s.computedPhysical.x,"px"),r.style.top="".concat(s.computedPhysical.y,"px"),r.setAttribute("width",s.computedPhysical.width),r.setAttribute("height",s.computedPhysical.height)),p.clear(),d.clear(),u.children.length=0;const f=c.getScene(e),h=!o||!f.equals(o),m=a||h;return m&&(c.clear(),n.render(f.children,i)),a=!1,o=f,m},c.itemsAt=e=>o?o.getItemsFrom(e):[],c.findShapes=e=>o?o.findShapes(e):[],c.clear=()=>{if(!i)return c;o=null;const e=i.cloneNode(!1);return r.replaceChild(e,i),i=e,c},c.destroy=()=>{r&&r.parentNode&&r.parentNode.removeChild(r),r=null,i=null},c.size=e=>{if(e){const t=Mne(e);JSON.stringify(s)!==JSON.stringify(t)&&(a=!0,s=t)}return s},c}var ure,dre,pre,fre,hre,mre,gre,yre={},bre=[],vre=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function xre(e,t){for(var n in t)e[n]=t[n];return e}function wre(e){var t=e.parentNode;t&&t.removeChild(e)}function Sre(e,t,n){var r,i,o,a={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?ure.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return kre(e,a,r,i,null)}function kre(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++pre:i};return null==i&&null!=dre.vnode&&dre.vnode(o),o}function Cre(e){return e.children}function Ere(e,t){this.props=e,this.context=t}function Mre(e,t){if(null==t)return e.__?Mre(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Mre(e):null}function Rre(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Rre(e)}}function _re(e){(!e.__d&&(e.__d=!0)&&fre.push(e)&&!Are.__r++||hre!==dre.debounceRendering)&&((hre=dre.debounceRendering)||mre)(Are)}function Are(){var e,t,n,r,i,o,a,s;for(fre.sort(gre);e=fre.shift();)e.__d&&(t=fre.length,r=void 0,i=void 0,a=(o=(n=e).__v).__e,(s=n.__P)&&(r=[],(i=xre({},o)).__v=o.__v+1,jre(s,o,i,n.__n,void 0!==s.ownerSVGElement,null!=o.__h?[a]:null,r,null==a?Mre(o):a,o.__h),zre(r,o),o.__e!=a&&Rre(o)),fre.length>t&&fre.sort(gre));Are.__r=0}function Ire(e,t,n,r,i,o,a,s,l,c){var u,d,p,f,h,m,g,y=r&&r.__k||bre,b=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(f=n.__k[u]=null==(f=t[u])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?kre(null,f,null,null,f):Array.isArray(f)?kre(Cre,{children:f},null,null,null):f.__b>0?kre(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)){if(f.__=n,f.__b=n.__b+1,null===(p=y[u])||p&&f.key==p.key&&f.type===p.type)y[u]=void 0;else for(d=0;d<b;d++){if((p=y[d])&&f.key==p.key&&f.type===p.type){y[d]=void 0;break}p=null}jre(e,f,p=p||yre,i,o,a,s,l,c),h=f.__e,(d=f.ref)&&p.ref!=d&&(g||(g=[]),p.ref&&g.push(p.ref,null,f),g.push(d,f.__c||h,f)),null!=h?(null==m&&(m=h),"function"==typeof f.type&&f.__k===p.__k?f.__d=l=Pre(f,l,e):l=Tre(e,f,p,y,h,l),"function"==typeof n.type&&(n.__d=l)):l&&p.__e==l&&l.parentNode!=e&&(l=Mre(p))}for(n.__e=m,u=b;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=Dre(r).nextSibling),Bre(y[u],y[u]));if(g)for(u=0;u<g.length;u++)$re(g[u],g[++u],g[++u])}function Pre(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?Pre(r,t,n):Tre(n,r,r,i,r.__e,t));return t}function Tre(e,t,n,r,i,o){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<r.length;l+=1)if(s==i)break e;e.insertBefore(i,o),a=o}return void 0!==a?a:i.nextSibling}function Dre(e){var t,n,r;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=Dre(n)))return r;return null}function Ore(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||vre.test(t)?n:n+"px"}function Nre(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Ore(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Ore(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?Lre:qre,o):e.removeEventListener(t,o?Lre:qre,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function qre(e){return this.l[e.type+!1](dre.event?dre.event(e):e)}function Lre(e){return this.l[e.type+!0](dre.event?dre.event(e):e)}function jre(e,t,n,r,i,o,a,s,l){var c,u,d,p,f,h,m,g,y,b,v,x,w,S,k,C=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,s=t.__e=n.__e,t.__h=null,o=[s]),(c=dre.__b)&&c(t);try{e:if("function"==typeof C){if(g=t.props,y=(c=C.contextType)&&r[c.__c],b=c?y?y.props.value:c.__:r,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in C&&C.prototype.render?t.__c=u=new C(g,b):(t.__c=u=new Ere(g,b),u.constructor=C,u.render=Hre),y&&y.sub(u),u.props=g,u.state||(u.state={}),u.context=b,u.__n=r,d=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=C.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=xre({},u.__s)),xre(u.__s,C.getDerivedStateFromProps(g,u.__s))),p=u.props,f=u.state,u.__v=t,d)null==C.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==C.getDerivedStateFromProps&&g!==p&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,b),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,b)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(e){e&&(e.__=t)}),v=0;v<u._sb.length;v++)u.__h.push(u._sb[v]);u._sb=[],u.__h.length&&a.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,b),null!=u.componentDidUpdate&&u.__h.push(function(){u.componentDidUpdate(p,f,h)})}if(u.context=b,u.props=g,u.__P=e,x=dre.__r,w=0,"prototype"in C&&C.prototype.render){for(u.state=u.__s,u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),S=0;S<u._sb.length;S++)u.__h.push(u._sb[S]);u._sb=[]}else do{u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(r=xre(xre({},r),u.getChildContext())),d||null==u.getSnapshotBeforeUpdate||(h=u.getSnapshotBeforeUpdate(p,f)),k=null!=c&&c.type===Cre&&null==c.key?c.props.children:c,Ire(e,Array.isArray(k)?k:[k],t,n,r,i,o,a,s,l),u.base=t.__e,t.__h=null,u.__h.length&&a.push(u),m&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Fre(n.__e,t,n,r,i,o,a,l);(c=dre.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=s,t.__h=!!l,o[o.indexOf(s)]=null),dre.__e(e,t,n)}}function zre(e,t){dre.__c&&dre.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){dre.__e(e,t.__v)}})}function Fre(e,t,n,r,i,o,a,s){var l,c,u,d=n.props,p=t.props,f=t.type,h=0;if("svg"===f&&(i=!0),null!=o)for(;h<o.length;h++)if((l=o[h])&&"setAttribute"in l==!!f&&(f?l.localName===f:3===l.nodeType)){e=l,o[h]=null;break}if(null==e){if(null===f)return document.createTextNode(p);e=i?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,p.is&&p),o=null,s=!1}if(null===f)d===p||s&&e.data===p||(e.data=p);else{if(o=o&&ure.call(e.childNodes),c=(d=n.props||yre).dangerouslySetInnerHTML,u=p.dangerouslySetInnerHTML,!s){if(null!=o)for(d={},h=0;h<e.attributes.length;h++)d[e.attributes[h].name]=e.attributes[h].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||Nre(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||Nre(e,o,t[o],n[o],r)}(e,p,d,i,s),u)t.__k=[];else if(h=t.props.children,Ire(e,Array.isArray(h)?h:[h],t,n,r,i&&"foreignObject"!==f,o,a,o?o[0]:n.__k&&Mre(n,0),s),null!=o)for(h=o.length;h--;)null!=o[h]&&wre(o[h]);s||("value"in p&&void 0!==(h=p.value)&&(h!==e.value||"progress"===f&&!h||"option"===f&&h!==d.value)&&Nre(e,"value",h,d.value,!1),"checked"in p&&void 0!==(h=p.checked)&&h!==e.checked&&Nre(e,"checked",h,d.checked,!1))}return e}function $re(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){dre.__e(e,n)}}function Bre(e,t,n){var r,i;if(dre.unmount&&dre.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||$re(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){dre.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Bre(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||wre(e.__e),e.__=e.__e=e.__d=void 0}function Hre(e,t,n){return this.constructor(e,n)}function Vre(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createElement,t=void 0===e?document.createElement.bind(document):e;let n,r,i=Mne();const o={transform:void 0,disableScreenReader:!1},a=Rne();return a.element=()=>n,a.root=()=>n,a.settings=e=>(e&&Object.keys(o).forEach(t=>{void 0!==e[t]&&(o[t]=e[t])}),o),a.appendTo=e=>(n||(n=t("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),e.appendChild(n),n),a.render=e=>{if(!n)return!1;const t="function"==typeof o.transform&&o.transform();if(t){const e=t.horizontalScaling,r=t.horizontalSkewing,i=t.verticalSkewing,o=t.verticalScaling,a=t.horizontalMoving,s=t.verticalMoving;return n.style.transform="matrix(".concat(e,", ").concat(r,", ").concat(i,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}n.style.transform="";let a;return o.disableScreenReader&&n.setAttribute("aria-hidden",!0),n.style.left="".concat(i.computedPhysical.x,"px"),n.style.top="".concat(i.computedPhysical.y,"px"),n.style.width="".concat(i.computedPhysical.width,"px"),n.style.height="".concat(i.computedPhysical.height,"px"),a=Array.isArray(e)?Sre("div",null,e):e,r=function(e,t,n){var r,i,o;dre.__&&dre.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],jre(t,e=(!r&&n||t).__k=Sre(Cre,null,[e]),i||yre,yre,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?ure.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),zre(o,e)}(a,n,r),!0},a.renderArgs=[Sre],a.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;r=null}return a},a.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,r=null},a.size=e=>(e&&(i=Mne(e)),i),a}ure=bre.slice,dre={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},pre=0,Ere.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=xre({},this.state),"function"==typeof e&&(e=e(xre({},n),this.props)),e&&xre(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),_re(this))},Ere.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_re(this))},Ere.prototype.render=Cre,fre=[],mre="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,gre=function(e,t){return e.__v.__b-t.__v.__b},Are.__r=0;var Wre=[function(e){e.renderer("svg",cre)},function(e){e.renderer("canvas",jne)},function(e){e.renderer("dom",Vre)}];const Ure={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const Gre=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.level,n=void 0===t?Ure.OFF:t,r=e.pipe,i=void 0===r?console:r,o=n;const a={[Ure.OFF]:()=>{},[Ure.ERROR]:function(){return i.error(...arguments)},[Ure.WARN]:function(){return i.warn(...arguments)},[Ure.INFO]:function(){return i.info(...arguments)},[Ure.DEBUG]:function(){return i.log(...arguments)}},s=function(e){if(e&&!(o<e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];(a[e]||a[Ure.DEBUG])(...n)}};return{log:s,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(Ure.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(Ure.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(Ure.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(Ure.DEBUG,...t)},level:e=>("number"==typeof e&&(o=e),o),LOG_LEVEL:Ure}}(t.logger),i={component:i0(n.component,"component",r),data:i0(n.data,"data",r),formatter:i0(n.formatter,"formatter",r),interaction:i0(n.interaction,"interaction",r),renderer:U6(n.renderer),scale:i0(n.scale,"scale",r),symbol:i0(n.symbol,"symbol",r),logger:r};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e({palettes:t.palettes.concat(n.palettes||[]),style:LQ({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer},i)}return t.renderer&&t.renderer.prio&&i.renderer.default(t.renderer.prio[0]),o.use=function(e){return function(e){e(arguments.length>2?arguments[2]:void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i)},o.chart=e=>W6(e,{registries:i,logger:r,style:t.style,palettes:t.palettes}),o.config=()=>t,Object.keys(i).forEach(e=>{o[e]=i[e]}),o.version=jQ,o}({renderer:{prio:["svg","canvas"]},logger:{level:0},style:{"$font-family":"'Source Sans Pro', Arial, sans-serif","$font-size":"12px","$line-height":"16px","$font-size--l":"16px","$font-weight":"normal","$gray-100":"#ffffff","$gray-98":"#f9f9f9","$gray-95":"#f2f2f2","$gray-90":"#e6e6e6","$gray-35":"#595959","$gray-30":"#4d4d4d","$gray-25":"#404040","$gray-20":"#333333","$border-95":"rgba(255, 255, 255, 0.05)","$border-90":"rgba(255, 255, 255, 0.1)","$border-80":"rgba(255, 255, 255, 0.2)","$border-20":"rgba(0, 0, 0, 0.2)","$border-10":"rgba(0, 0, 0, 0.1)","$border-5":"rgba(0, 0, 0, 0.05)","$primary-blue":"#3F8AB3","$primary-green":"#6CB33F","$primary-red":"#DC423F","$primary-orange":"#EF960F","$spacing--s":4,$spacing:8,"$spacing--l":12,"$font-color":"$gray-35","$font-color--inverted":"$gray-90","$guide-color":"$gray-90","$guide-color--inverted":"$gray-35",$border:"$border-80","$border--inverted":"$border-10",$shape:{fill:"$primary-blue",strokeWidth:1,stroke:"$border"},"$shape-outline":{stroke:"$primary-blue",strokeWidth:2},"$shape-guide":{stroke:"$guide-color",strokeWidth:1},"$shape-guide--inverted":{"@extend":"$shape-guide",stroke:"$guide-color--inverted"},$label:{fontSize:"$font-size",fontFamily:"$font-family",fill:"$font-color"},"$label--inverted":{$extend:"$label",fill:"$font-color--inverted"},"$label-overlay":{fontSize:"$font-size--l",fontFamily:"$font-family",fill:"$gray-100",color:"$font-color",stroke:"$guide-color--inverted",strokeWidth:1,borderRadius:4},$title:{"@extend":"$label",fontSize:"$font-size--l",fontWeight:"$font-weight",stroke:"$guide-color--inverted",strokeWidth:0},"$guide-line":{strokeWidth:1,stroke:"$guide-color"},"$guide-line--minor":{strokeWidth:1,stroke:"$gray-95"},"$padding--s":{left:"$spacing--s",right:"$spacing--s",top:"$spacing--s",bottom:"$spacing--s"},$padding:{left:"$spacing",right:"$spacing",top:"$spacing",bottom:"$spacing"},"$selection-area-target":{fill:"$primary-green",strokeWidth:0,opacity:.2}},palettes:[{key:"categorical",colors:[["#a54343","#d76c6c","#ec983d","#ecc43d","#f9ec86","#cbe989","#70ba6e","#578b60","#79d69f","#26a0a7","#138185","#65d3da"]]},{key:"diverging",colors:[["#3d52a1","#3a89c9","#77b7e5","#b4ddf7","#e6f5fe","#ffe3aa","#f9bd7e","#ed875e","#d24d3e","#ae1c3e"]]},{key:"sequential",colors:[["rgb(180,221,212)","rgb(34, 83, 90)"]]}]},{component:G6,data:Q6,formatter:_2,interaction:Z6,renderer:U6(),scale:A3,symbol:N4});ste.forEach(Gre.use),Wre.forEach(Gre.use),[].forEach(Gre.use);const Yre="qDimensionInfo/0",Kre="qMeasureInfo/0",Xre="x",Jre="y",Qre=e=>({key:"bars",type:"box",data:{extract:{field:Yre,props:{start:0,end:{field:Kre}}}},settings:{major:{scale:Xre},minor:{scale:Jre},box:{maxWidthPx:8,fill:{fn:e}}}}),Zre=e=>({key:"p",type:"point",data:{extract:{field:Yre,props:{y:{field:Kre}}}},settings:{x:{scale:Xre},y:{scale:Jre},shape:"circle",size:1,opacity:1,sizeLimits:{minPx:4,maxPx:4},fill:{fn:e}},preferredSize:{edgeBleed:{left:2,right:2,top:2,bottom:2}}}),eie=({qNum:e})=>void 0===e?0:Math.sign(e),tie=(e,t)=>{const{primary:n,nil:r,others:i}=e.getDataColorSpecials(),o=Xh(e,t?.negative,n),a=Xh(e,t?.positive,n);return{key:"pos-neg",type:"box",data:{extract:{field:Yre,props:{start:0,end:{field:Kre,value:eie}}}},settings:{major:{scale:Xre},minor:{scale:Jre},box:{maxWidthPx:8,fill:{fn:e=>-2===e.datum.value?r:-3===e.datum.value?i:0===e.datum.end.value?"#DDDDDD":Math.sign(e.datum.end.value)<0?o:a}}}}},nie=(e,{type:t,showDots:n,colors:r,colorMin:i,colorMax:o})=>{const a=((e,t,n,r)=>{const{primary:i,nil:o,others:a}=e.getDataColorSpecials(),s=Xh(e,t?.main,i),l=Xh(e,t?.max,s),c=Xh(e,t?.min,s),u=Xh(e,t?.first,s),d=Xh(e,t?.last,s);return e=>{const t=Jre in e.datum?Jre:"end";return-2===e.datum.value?o:-3===e.datum.value?a:e.datum[t].value>=r?l:e.datum[t].value<=n?c:e.data.items.at(0)===e.datum?u:e.data.items.at(-1)===e.datum?d:s}})(e,r,i,o);switch(t){case"bars":return[Qre(a)];case"dots":return[Zre(a)];case"sparkline":{const t=(e=>({key:"lines",type:"line",data:{extract:{field:Yre,props:{v:{field:Kre}}}},settings:{coordinates:{major:{scale:Xre},minor:{scale:Jre,ref:"v"}},layers:{line:{strokeWidth:1,stroke:e}}}}))(Xh(e,r?.main,e.getDataColorSpecials().primary));return n?[t,Zre(a)]:[t]}case"posNeg":return[tie(e,r)];default:return[]}},rie=e=>({qDimensionInfo:[{qFallbackTitle:"",qCardinal:1}],qMeasureInfo:[{qFallbackTitle:""}],qDataPages:[{qArea:{qTop:0,qLeft:0,qHeight:e.length,qWidth:2},qMatrix:e}],qEffectiveInterColumnSortOrder:[0,1],qSize:{qcx:2,qcy:e.length},qMode:"S"}),iie=(e,t,n,r)=>({y:{data:{field:Kre},invert:!0,min:"posNeg"===e?-1:t,max:"posNeg"===e?1:n},x:{data:{extract:{field:Yre}},paddingInner:.3,paddingOuter:0,invert:"rtl"===r,align:"rtl"===r?1:0,maxPxStep:12}}),oie=Gre();oie.use(_Q),oie.renderer.prio(["canvas"]);const aie={resolve:()=>{},promise:{}},sie=({chart:e,element:t,theme:n,isSnapshot:r,direction:i,miniChartData:o,downloadService:a})=>{const{resolveChartPromise:s,addChartPromiseToQueue:l}=(e=>{const t=Yt.useRef(e.isDownloadedAsPDForImage?Oe():aie);return{addChartPromiseToQueue:Yt.useCallback(()=>{e.waitForPromise(t.current.promise)},[e]),resolveChartPromise:t.current.resolve}})(a),c=Yt.useRef(null),u=Yt.useCallback(()=>{null!==t.current&&null===e.current&&(l(),c.current=(e=>{const t=performance.now();if(t-LX>50&&(LX=t,jX=0),jX+=1,0===zX&&jX<=20)return e(),()=>{};zX+=1;let n=!1;const r=()=>{n||(n=!0,zX-=1)},i=NX(()=>{r(),e()},{timeout:2e3});return()=>{qX(i),r()}})(()=>{c.current=null,t.current&&(e.current=(({element:e,theme:t,isSnapshot:n,miniChartData:r,onChartRendered:i,direction:o})=>{const{type:a,qMatrix:s,minY:l,maxY:c}=r;return oie.chart({element:e,data:{type:"q",key:"qHyperCube",data:rie(s)},settings:{scales:iie(a,l,c,o),components:nie(t,r),strategy:n?{size:{width:e.offsetWidth,height:e.offsetHeight}}:void 0},mounted:()=>{i()}})})({element:t.current,theme:n,isSnapshot:r,miniChartData:o,direction:i,onChartRendered:s}))}))},[t,e,l,n,r,o,i,s]);return{renderChartWithRequestIdleCallback:u,safeCancelIdleCallback:Yt.useCallback(()=>{c.current?.(),c.current=null,s()},[s])}},lie=e=>{const t=Yt.useRef(null),n=Yt.useRef(!1);return Yt.useCallback(r=>{const i=r.contentBoxSize.at(0)?.inlineSize??0;(e=>{e.current&&(qX(e.current),e.current=null)})(t),n.current?0!==i?null!==e.current&&(t.current=NX(()=>{e.current?.update()},{timeout:2e3})):n.current=!1:n.current=!0},[e])},cie=({intersectionObserverTaskScheduler:e,resizeObserverTaskScheduler:t,theme:n,isSnapshot:r,miniChartData:i,downloadService:o,direction:a})=>{const s=Yt.useRef(null),l=Yt.useRef(null),{renderChartWithRequestIdleCallback:c,safeCancelIdleCallback:u}=sie({element:s,chart:l,theme:n,isSnapshot:r,direction:a,miniChartData:i,downloadService:o});return(({element:e,intersectionObserverTaskScheduler:t,safeCancelIdleCallback:n,renderChartWithRequestIdleCallback:r,chart:i})=>{const o=Yt.useCallback(e=>{e.isIntersecting?r():n()},[r,n]);Yt.useEffect(()=>{if(!e.current||!t)return()=>{};const r=e.current;return t.addTask(r,o),()=>{t.removeTask(r),n(),i.current?.destroy(),i.current=null}},[i,e,t,n,o])})({element:s,intersectionObserverTaskScheduler:e,safeCancelIdleCallback:u,renderChartWithRequestIdleCallback:c,chart:l}),(({renderChartWithRequestIdleCallback:e,safeCancelIdleCallback:t,chart:n,intersectionObserverTaskScheduler:r})=>{Yt.useEffect(()=>r?()=>{}:(e(),()=>{t(),n.current?.destroy(),n.current=null}),[r,t,e,n])})({intersectionObserverTaskScheduler:e,safeCancelIdleCallback:u,renderChartWithRequestIdleCallback:c,chart:l}),(({element:e,chart:t,resizeObserverTaskScheduler:n})=>{const r=lie(t);Yt.useEffect(()=>{const t=e.current;return t?(n.addTask(t,r),()=>{n.removeTask(t)}):()=>{}},[e,r,n])})({element:s,chart:l,resizeObserverTaskScheduler:t}),s},uie=({height:e,intersectionObserverTaskScheduler:t,resizeObserverTaskScheduler:n,theme:r,isSnapshot:i,miniChartData:o,downloadService:a,direction:s})=>{const l=cie({intersectionObserverTaskScheduler:t,resizeObserverTaskScheduler:n,theme:r,isSnapshot:i,miniChartData:o,downloadService:a,direction:s});return lt.jsx("div",{"data-testid":"picasso-container",ref:l,style:{position:"relative",width:"100%",height:e,overflow:"hidden"}})},die=e=>{let t="center",n="center";return"flex-start"===e?.vertical?t="top":"flex-end"===e?.vertical&&(t="bottom"),"flex-start"===e?.horizontal?n="left":"flex-end"===e?.horizontal&&(n="right"),`${n} ${t}`},pie=e=>{switch(e){case"alwaysFit":return"contain";case"fill":return"fill";case"fitHeight":case"fitWidth":return"cover";case"originalSize":return"none";default:return}},fie=({representation:e,textStyle:t,maxImageHeight:n,wrapInContainer:r})=>{const i=_g(my),{url:o,text:a,imageSize:s,resolvedImagePosition:l}=e,c="fitHeight"===s,u=lt.jsx("img",{src:o,alt:a,style:{...t,width:c?"auto":"100%",height:"100%",maxHeight:n,objectFit:pie(s),objectPosition:die(l),overflow:"hidden"}});return r?lt.jsx("div",{"data-key":"image-horizontal-container",style:{width:"100%",height:c?n:"100%",overflow:"hidden",display:"flex",justifyContent:c?JH(i,e):void 0},children:u}):u},hie=({size:e,iconKey:t,color:n,pvStyle:r})=>{const i=t&&HH[t];return i&<.jsx("div",{"data-testid":"representation-indicator-icon",style:{color:n,height:e,...r},children:lt.jsx(i,{style:{height:e}})})},mie=({representation:e,cellValue:t,paginationCellAlign:n})=>{const r=_g(EU),i=_g(my),o=_g(Py),{text:a,indicator:s}=e,{showTextValues:l,applySegmentColors:c}=s??{},u=VH(e,t,i,o),d=(e=>parseInt(e||GH,10))(r.measure.values.fontSize),{color:p,iconKey:f,position:h}=u||{};return l?lt.jsxs("div",{"data-key":"representation-indicator",style:{display:"flex",justifyContent:n??"flex-end",alignItems:"center",gap:"2px",overflow:"hidden",color:c?p:void 0},children:["left"===h&&hie({size:d,iconKey:f,color:p}),lt.jsx(wK,{isNumeric:!0,children:a}),"right"===h&&hie({size:d,iconKey:f,color:p})]}):hie({size:d,iconKey:f,color:p})},gie=(e,t,n)=>e.contentStaticLineCount?t*(n??e.grid.contentLineClamp):t,yie=({forwardRef:e,cell:t,style:n,virtualizedCell:r,lineClamp:i,intersectionObserverTaskScheduler:o,resizeObserverTaskScheduler:a,paginationCellAlign:s})=>{const l=_g(EU),c=_g(_U),u=_g(Tg),d=_g(Yg),p=_g(Py),f=_g(my),h=_g(sy),m=_g(iy);if(t.representation.type===t$.Image&&!t.representation.url?.trim())return null;if(t.representation.type===t$.Image)return lt.jsx(fie,{representation:t.representation,textStyle:n,maxImageHeight:gie(l,c,i),wrapInContainer:!r});const g=nH(t.qIsNull?t.representation.text:t.qNum);let y=t.representation;if(t.qIsNull&&t.isNumeric&&!Number.isNaN(g)){const e=t.formattedNullValueText??jW(g,t.qNumFormat,t.qIsAutoFormat);y={...t.representation,text:e}}let b=y.text;return t.representation.type!==t$.Link||m||t.isNull||(b=lt.jsx(OX,{href:t.representation.url,text:t.representation.text,interactions:h,color:n.cellForegroundColor})),t.representation.type!==t$.Indicator||Number.isNaN(g)?t.representation.type===t$.MiniChart&&t.representation.miniChart&&!t.isNull?lt.jsx(uie,{height:gie(l,c,i),intersectionObserverTaskScheduler:o,resizeObserverTaskScheduler:a,miniChartData:t.representation.miniChart,theme:p,isSnapshot:!!d.snapshotData,direction:f,downloadService:u}):t.representation.type===t$.Bar&&t.representation.bar&&!t.isNull?lt.jsx(PX,{height:gie(l,c,i),bar:t.representation.bar,theme:p,direction:f,fontFamily:l.measure.values.fontFamily,fontSize:n.fontSize??l.measure.values.fontSize}):lt.jsx(wK,{forwardRef:e,isDual:t.isDual,isNumeric:t.isNumeric,lineClamp:i,isPagination:!r,children:b}):lt.jsx(mie,{representation:y,cellValue:g,paginationCellAlign:r?void 0:s})},bie=()=>lt.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",width:"0.75em",height:"0.75em",children:lt.jsx("path",{d:"M6,10 L13,3 L15,5 L8,12 L6,14 L1,9 L3,7 L6,10 Z"})}),vie=Ul("div")({"& path":{stroke:"none !important"}}),xie=({children:e,cellSelectionState:t,hideTickIcon:n})=>t!==YB.Selected||n?e:lt.jsxs(vK,{children:[e,lt.jsx(vie,{children:lt.jsx(bie,{})})]}),wie=e=>{const t=function(){const e=AL(),t=dL(()=>null==e?void 0:e.dragOperation.source,[e]),n=dL(()=>null==e?void 0:e.dragOperation.target,[e]);return{get source(){return t.value},get target(){return n.value}}}();return t.source&&t.source.id!==e?.5:1},Sie=(e,t,n,r)=>({handleMouseDown:r=>{e?.(r);const i=r.target;if(t.isSelectable&&"A"!==i.tagName){const e=()=>{n({type:KB.SelectMultiEnd})};n({type:KB.SelectMouseDown,payload:{cell:t,mouseupOutsideCallback:e}})}},handleMouseOver:e=>{1===e.buttons&&n({type:KB.SelectMultiAdd,payload:{cell:t,evt:e,announce:r}})},handleMouseUp:e=>{0===e.button&&n({type:KB.SelectMouseUp,payload:{cell:t,evt:e,announce:r}})}}),kie=e=>{const t=_g(mU),n=_g(cU),r=_g(lX),i=_g(_y),o=_g(my),a=Ag(iX),s=Ag(HY),l=_g(wy),c=_g(uy),u=_g(oy),d=d=>{hX({evt:d,rootElement:i,selectionsAPI:u,cell:e,selectionDispatch:s,isSelectionsEnabled:c,setFocusedCellCoord:a,announce:r,keyboard:l,paginationNeeded:t,totalsPosition:n,direction:o})},p=e=>{((e,t)=>{e.key===Em.Shift&&t({type:KB.SelectMultiEnd})})(e,s)},f=()=>{((e,t,n,r,i)=>{const{pageRowIdx:o,pageColIdx:a}=e,s=i.atTop?o+2:o+1;sK([s,a],t,n,r)})(e,i,a,l,n)};if(!c)return{onKeyDown:d,onKeyUp:p,onMouseDown:f};const{handleMouseDown:h,handleMouseOver:m,handleMouseUp:g}=Sie(f,e,s,r);return{onKeyDown:d,onKeyUp:p,onMouseDown:h,onMouseUp:g,onMouseOver:m}},Cie=e=>{Yt.useEffect(()=>()=>{VY.remove(e)},[e])},Eie=(e,t,n,r)=>{if(!n.isNull)return e;const i=r?t.dimensionNull:t.measureNull,o={...e,...i};if(!t.grid.zebraStripes.show)return o;const a=r?t.grid.zebraStripes.overrideDimNullValueColor:t.grid.zebraStripes.overrideMeasNullValueColor,s=r?t.grid.zebraStripes.overrideDimNullValueBackground:t.grid.zebraStripes.overrideMeasNullValueBackground;return a&&(o.color=e.color),s&&(o.background=e.background),o},Mie=(e,t,n)=>{const{color:r,background:i}=e.grid.zebraStripes[n];return{...t,...r?{color:r}:void 0,...i?{background:i}:void 0}},Rie=(e,t,n)=>{if(t.grid.zebraStripes.show){const r=(n.rowIdx+1)%2==0;return Mie(t,e,r?"even":"odd")}return e},_ie=(e,t)=>{const n=_g(EU),r=_g(VY(e)),i=_g(Wg),o=e.isTotalRow&&i("TLV-2303-SUB-TOTALS");Cie(e);let a=t.isDim?n.dimension.values:n.measure.values;a=Rie(a,n,e),a=o?n.subTotalRow:a,a=Eie(a,n,e,t.isDim);const s=e.isNull||o&&t.isDim?a:CV(a,e.qAttrExps,t.qAttrExprInfoIDs),l=o?s:function(e,t,n){return t===YB.Selected?{...e,...n}:t===YB.Disabled?{...e,background:`${WH}, ${e.background}`}:e}(s,r,n.selectedColors);return{cellStyle:{...l,borderColor:n.grid.border},representationStyle:s,cellSelectionState:r}},Aie=Ul(uh,{shouldForwardProp:e=>"lastRowBottomBorder"!==e})(({lastRowBottomBorder:e})=>({"& tr:last-child":{"& td, th":{borderBottomWidth:e}}})),Iie=Ul(Ph,{shouldForwardProp:e=>"hoverColors"!==e&&"hover"!==e&&"height"!==e})(({hover:e,hoverColors:t,height:n})=>({height:n,"&&:hover":{background:"none"},...e&&{"&&:hover":{"& td:not(.selected), th:not(.selected)":t}}})),Pie=Ul(mh,{shouldForwardProp:e=>"cellStyle"!==e})(({cellStyle:e,theme:t})=>({...XH,...e,padding:t.spacing(.5,1.5),verticalAlign:"top",boxSizing:"border-box",width:"100%",height:"100%"})),Tie=Ul(mh,{shouldForwardProp:e=>!["atTop","headRowHeight","totalsStyle","direction"].includes(e)})(({totalsStyle:e,atTop:t,headRowHeight:n,theme:r})=>({...XH,...e,fontWeight:YH,position:"sticky",padding:r.spacing(.5,1.5),borderWidth:t?"0px 1px 1px 0px":"1px 1px 1px 0px",top:t?n:void 0,bottom:t?void 0:0,verticalAlign:t?"bottom":"top",boxSizing:"border-box",zIndex:t?1:void 0})),Die=({cell:e,column:t,columnIndex:n,intersectionObserverTaskScheduler:r,resizeObserverTaskScheduler:i})=>{const o=_g(my),a=_g(sy),{onKeyDown:s,onKeyUp:l,onMouseDown:c,onMouseUp:u,onMouseOver:d}=kie(e),{cellStyle:p,representationStyle:f,cellSelectionState:h}=_ie(e,t),m=wie(t.id);return lt.jsx(Pie,{cellStyle:{...p,opacity:m},scope:0===n?"row":void 0,component:0===n?"th":void 0,align:e.align,tabIndex:-1,className:`sn-table-cell ${h} ${Cm}`,title:a.passive?e.representation.text:void 0,onKeyDown:s,onKeyUp:l,onMouseDown:c,onMouseUp:u,onMouseOver:d,children:lt.jsx(xie,{cellSelectionState:h,hideTickIcon:!!e.isTotalRow,children:lt.jsx(yie,{cell:e,style:f,intersectionObserverTaskScheduler:r,resizeObserverTaskScheduler:i,paginationCellAlign:tV(o,e.align)})})})},Oie=gg(0),Nie=({column:e,totalsPosition:t,onKeyDown:n,onMouseDown:r})=>{const i=_g(EU),o=_g(cy),a=_g(Oie),s=wie(e.id);return lt.jsx(Tie,{totalsStyle:{...i.totalRow,...GY(i,t,!1),opacity:s},headRowHeight:a,atTop:t.atTop,align:e.totalsTextAlign,className:`sn-table-cell ${Cm}`,tabIndex:-1,title:o?e.totalInfo:void 0,onKeyDown:n,onMouseDown:r,children:lt.jsx(wK,{isNumeric:e.isTotalNumeric,isPagination:!0,children:e.totalInfo})},e.id)},qie=()=>{const e=_g(cU),t=_g(uU),n=_g(pU),r=_g(_y),i=_g(ly),o=_g(my),a=Ag(iX),s=_g(iy),l=_g(wy);return lt.jsx(Ph,{className:"sn-table-row sn-table-totals-row",children:t.map((t,c)=>{const u=[e.atTop?1:n.length+1,c];return lt.jsx(Nie,{column:t,totalsPosition:e,onKeyDown:e=>{(e=>{const{isSelectionMode:t,evt:n,isInteractionEnabled:r}=e;if(!t&&r)switch(n.key){case Em.C:uX(n);break;case Em.Space:n.preventDefault();break;default:dX(e)}else Zh(n)})({evt:e,rootElement:r,cellCoord:u,setFocusedCellCoord:a,isSelectionMode:s,isInteractionEnabled:i,direction:o})},onMouseDown:()=>{sK(u,r,a,l)}},t.id)})})};var Lie=Yt.memo(qie);const jie=({updateShouldRefocus:e,tableWrapperRef:t})=>{const n=_g(pU),r=_g(cU),i=_g(uU),o=_g(EU),a=_g(AU),s=_g(IU),l=_g(Yg),c=!!wV(l)?.content?.hoverEffect;kX({updateShouldRefocus:e,tableWrapperRef:t});const u=(e=>{const t=Yt.useCallback(t=>new IntersectionObserver(e=>{e.forEach(e=>{const n=t.get(e.target);n?.(e)})},{root:e.current}),[e]);return xX(t)})(t),d=SX();return lt.jsxs(Aie,{lastRowBottomBorder:o.grid.lastRowBottomBorder,children:[r.atTop?lt.jsx(Lie,{}):void 0,n.map((e,t)=>{const n=e.at(0)?.isTotalRow??!1;return lt.jsx(Iie,{hoverColors:o.grid.hoverColors,hover:c,tabIndex:-1,className:"sn-table-row sn-table-data-row",height:n?s:a,children:i.map((t,n)=>{const{id:r}=t,i=e[n];return lt.jsx(Die,{columnIndex:n,cell:i,column:t,intersectionObserverTaskScheduler:u,resizeObserverTaskScheduler:d},r)})},`row-${t}`)}),r.atBottom?lt.jsx(Lie,{}):void 0]})};var zie=Yt.memo(jie);const Fie=(e,t)=>!!e?.skipHeader||!!t.hideHeader,$ie=gg(e=>{const t=e(Yg),n=e(Sy);if(n)return(e,{isDim:r,colIdx:i})=>{const o=r?i:i-t.qHyperCube.qDimensionInfo.length,a=`/qHyperCubeDef/${r?"qDimensions":"qMeasures"}/${o}/qDef/columnWidth`,s=t.qHyperCube[r?"qDimensionInfo":"qMeasureInfo"].at(o)?.columnWidth,l=s?{qPath:a,qOp:"Replace",qValue:JSON.stringify({...s,...e})}:{qPath:a,qOp:"Add",qValue:JSON.stringify(e)};n.applyPatches([l],!0)}}),Bie=({column:e,isLastColumn:t,onColumnResize:n,setIsAdjustingWidth:r})=>{const{pageColIdx:i,label:o}=e,a=_g($ie),s=_g(my),l=_g(ly),c=_g(Ty),[u,d]=Ig(NU);if(!l)return null;return lt.jsx(VU,{columnWidth:u.at(i)??0,isLastColumn:t,keyValue:`adjuster-${i}`,updateWidthCallback:e=>{n?.();const t=[...u];t[i]=e,d(t)},confirmWidthCallback:t=>{a?.(t,e)},handleBlur:e=>{(e=>{nK(e);const t=e.closest(".sn-table-cell");iK(t)})(e.currentTarget)},setIsAdjustingWidth:r,accessibilityRelatedArgs:{translator:c,columnLabel:o},direction:s})},Hie=e=>e.target?.getAttribute("class")?.includes(Mm),Vie=({isInteractionEnabled:e,column:t})=>{const[n,r]=Yt.useState(!1),i=_g(YY),o=_g(dV);return{open:n,setOpen:r,handleOpenMenu:t=>{!e||Hie(t)||o||r(!0)},toggleSortOrder:n=>{e&&!Hie(n)&&!o&&(e=>null!==e.target.closest(".sn-table-cell"))(n)&&(n.stopPropagation(),i?.(t,"A"===t.sortDirection?"D":"A"))}}};var Wie=class extends RT{constructor(e,t){super(e,t),this.boundingRectangle=I_(null),this.destroy=F_(()=>{if(!this.options)return;const{dragOperation:t}=e,{status:n}=t;if(n.initialized){const{element:e}=this.options,n="function"==typeof e?e(t):e;if(!n)return;let r;const i=()=>{this.boundingRectangle.value=$T(n)},o=()=>{r||(r=setTimeout(()=>{i(),r=void 0},25))},a=new ResizeObserver(i);return a.observe(n),document.addEventListener("scroll",o,{passive:!0,capture:!0}),()=>{document.removeEventListener("scroll",o,{capture:!0}),a.disconnect(),this.boundingRectangle.value=null}}})}apply(e){const{shape:t,transform:n}=e;if(!t)return n;const r=this.boundingRectangle.value;if(!r)return n;const{initial:i,current:o}=t,{height:a,width:s}=o.boundingRectangle,l=i.center.x-s/2,c=i.center.y-a/2,u=function(e,t,n){const r=mj({},t);return e.boundingRectangle.top+t.y<=n.top?r.y=n.top-e.boundingRectangle.top:e.boundingRectangle.bottom+t.y>=n.top+n.height&&(r.y=n.top+n.height-e.boundingRectangle.bottom),e.boundingRectangle.left+t.x<=n.left?r.x=n.left-e.boundingRectangle.left:e.boundingRectangle.right+t.x>=n.left+n.width&&(r.x=n.left+n.width-e.boundingRectangle.right),r}(new aI(l,c,s,a),n,r);return u}};Wie.configure=VI(Wie);const Uie=({invert:e})=>({dragOperation:t,droppable:n})=>{if(!n.shape)return null;const{shape:r}=t;if(!r)return null;const i=function(e){return e.sortable?.index}(n);if(void 0===i)return null;const o=function(e){return e.source.index}(t);if(void 0===o)return null;if(o===i)return null;const a=o<i!==e?"right":"left",{center:s,boundingRectangle:l}=r.current;return"left"===a&&l.left+.3*l.width<=n.shape.center.x||"right"===a&&l.right-.3*l.width>=n.shape.center.x?{id:n.id,value:1/oI.distance(n.shape.center,s),type:tT.Collision,priority:eT.Normal}:null},Gie=[Wie.configure({element:e=>{const t=e.activatorEvent?.target;return t instanceof HTMLElement?t.closest(".sn-table-head-row"):null}})],Yie=(e,t)=>{const n=_g(my),r=!_g(py);return Tz({id:e.id,disabled:r,index:t,type:"item",accept:"item",group:"column",modifiers:Gie,data:e,plugins:e=>[...e,tq.configure({feedback:"clone"})],collisionDetector:Uie({invert:"rtl"===n})})},Kie=({column:e,columnIndex:t,columnsLength:n})=>{const r=_g(EU),i=_g(_y),o=_g(my),a=_g(sy),s=_g(uU),l=_g(cU),c=_g(NU)[t],u=Ag(iX),d=_g(oX(t)),p=_g(py),f=_g(wy),{open:h,setOpen:m,handleOpenMenu:g,toggleSortOrder:y}=Vie({isInteractionEnabled:p,column:e}),b=Ag(dV),{ref:v,isDragging:x}=Yie(e,t),w=wie(e.id),S=_g(ny),k=S?SK:HK,C=e.isActivelySorted?XB[e.sortDirection]:void 0,E=h?km:void 0,M=h?"true":void 0,R=t===n-1,_=[0,e.pageColIdx],A={width:c,zIndex:s.length-t},I=d&&0===t&&!f.enabled&&p?0:-1;return lt.jsxs(dK,{"data-dragging":x,ref:v,headerStyle:{...r.header,...GY(r,l,!0),opacity:w},background:S&&h?e.headerColor?.headerMenuActiveBackground??r.headerMenuActiveBackground:e.headerColor?.background??r.header.background,hoverBackground:e.headerColor?.headerMenuHoverBackground??r.headerMenuHoverBackground,color:e.headerColor?.color??r.header.color,interactions:a,style:A,align:e.headTextAlign,className:`sn-table-head-cell sn-table-cell ${Cm}`,tabIndex:I,title:a.passive?e.label:void 0,onKeyDown:e=>{(e=>{const{isInteractionEnabled:t,evt:n,handleOpenMenu:r}=e;if(t)switch(n.key){case Em.C:uX(n);break;case Em.Enter:case Em.Space:r?.(n);break;default:dX(e)}else Zh(n)})({evt:e,rootElement:i,cellCoord:_,setFocusedCellCoord:u,isInteractionEnabled:p,handleOpenMenu:g,direction:o})},onMouseDown:e=>{(({evt:e,rootElement:t,cellCoord:n,setFocusedCellCoord:r,keyboard:i,isInteractionEnabled:o})=>{e.preventDefault(),o&&sK(n,t,r,i)})({evt:e,rootElement:i,cellCoord:_,setFocusedCellCoord:u,keyboard:f,isInteractionEnabled:p})},onClick:S?g:y,"aria-sort":C,"aria-controls":E,"aria-expanded":M,"aria-haspopup":"true",children:[lt.jsx(k,{column:e,isInteractionEnabled:p,open:h,setOpen:m,isPagination:!0,columnWidth:c}),lt.jsx(Bie,{column:e,isLastColumn:R,setIsAdjustingWidth:b})]},e.id)},Xie=()=>{const e=_g(uU),t=_g(EU),n=_g(Yg),r=_g(yy),i=Ag(Oie),o=_g(NU),a=Yt.useRef(null),s=Fie(r,n);return Yt.useEffect(()=>{a.current&&i(a.current.getBoundingClientRect().height)},[t.header.fontSize,o,i,s]),lt.jsx(Eh,{style:{visibility:s?"collapse":void 0},children:lt.jsx(mK,{ref:a,className:"sn-table-row sn-table-head-row",children:e.map((t,n)=>lt.jsx(Kie,{column:t,columnIndex:n,columnsLength:e.length},t.id))})})};var Jie=Yt.memo(Xie);const Qie=()=>{const e=_g(lX),[t,n]=Ig(eU),{page:r,rowsPerPage:i}=t,o=_g(gy),{totalColumnCount:a,totalRowCount:s,totalPages:l,paginationNeeded:c,rows:u,columns:d}=_g(lU),p=_g(EU),f=_g(gW),h=_g(Yg),m=_g(Py),g=_g(Ry),y=_g(_y),b=_g(yy),v=_g(my),x=_g(sy),w=_g(Ty),S=_g(WY),k=Ag(HY),C=_g(iy),E=_g(wy),M=Yt.useRef(!1),R=Yt.useRef(null),_=Yt.useRef(null),A=`${w.get("SNTable.Accessibility.RowsAndColumns",[String(u.length),String(d.length)])} ${w.get("SNTable.Accessibility.NavigationInstructions")}`,I=fy(h,b),P=I?f.scrollLeft??0:0,T=I?f.rowPartialHeight??0:0,D=Yt.useCallback(()=>{M.current=y.getElementsByTagName("table")[0].contains(document.activeElement)},[y]),O=Yt.useCallback(r=>{n({...t,page:r}),e({keys:[["SNTable.Pagination.PageStatusReport",(r+1).toString(),l.toString()]],politeness:"assertive"})},[t,n,l,e]),N=Yt.useCallback(r=>{n({...t,page:0,rowsPerPage:r}),e({keys:[["SNTable.Pagination.RowsPerPageChange",r.toString()]],politeness:"assertive"})},[e,t,n]);return(e=>{const t=_g(my),n=_g(gW);Yt.useEffect(()=>{const r=e.current;if(!r)return;const i=e=>{((e,t,n)=>{if(0===e.deltaX)return;e.stopPropagation();const r=n.scrollWidth-n.offsetWidth,{scrollLeft:i}=n;let o=i+e.deltaX;t&&(o=r+o),r>0&&(o<0||o>r+1)&&e.preventDefault()})(e,"rtl"===t,r)},o=e=>{n.scrollLeft=e.currentTarget?.scrollLeft||0};return r.addEventListener("wheel",i),r.addEventListener("scroll",o),()=>{r.removeEventListener("wheel",i),r.removeEventListener("scroll",o)}},[e,t,n])})(R),rX(_,M),(()=>{const e=_g(_y),t=_g(wy),n=_g(iX);gm(()=>{const r=eK(e,n);t.active?iK(r):(r?.blur(),rK(e))},[t.active,e])})(),cX(M,r),Yt.useEffect(()=>{const e=R.current;e&&(e.scrollLeft=P,e.scrollTop=T)},[t,s,P,T]),nX(()=>{k({type:KB.UpdatePageRows,payload:{pageRows:u}})},[u]),aX(),mX(R),lt.jsxs(tX,{children:[lt.jsxs(yK,{ref:_,dir:v,onKeyDown:e=>{fX({evt:e,totalRowCount:s,page:r,rowsPerPage:i,handleChangePage:O,updateShouldRefocus:D,keyboard:E,isSelectionMode:C})},"data-testid":"sn-table",children:[lt.jsx(vX,{}),lt.jsxs(yX,{ref:R,className:"sn-table-container",fullHeight:!!o||!x.active||!c,interactions:x,tabIndex:-1,role:"application","data-testid":"table-container",children:[lt.jsxs(bX,{stickyHeader:!0,"aria-label":A,borderRight:S?`1px solid ${p.grid.border}`:void 0,children:[lt.jsx(Jie,{}),lt.jsx(zie,{updateShouldRefocus:D,tableWrapperRef:_})]}),lt.jsx(UY,{})]}),lt.jsx(IY,{footerContainer:o,pageInfo:t,paginationNeeded:c,theme:m,totalRowCount:s,totalColumnCount:a,totalPages:l,keyboard:E,translator:w,interactions:x,rect:g,layout:h,handleChangePage:O,handleChangeRowsPerPage:N,isSelectionMode:C,direction:v})]}),lt.jsx(GK,{isPagination:!0})]})};var Zie=Yt.memo(Qie);const eoe=gg(0),toe=gg(e=>{const t=e(Kg);return Math.min(EV,t)}),noe=gg(e=>{const t=e(Kg);return t===EV?0:Math.floor(t/EV)}),roe=gg(e=>{const t=e(eoe),n=e(noe);return Math.min(t,n)}),ioe=gg(e=>({page:e(roe),rowsPerPage:e(toe),rowsPerPageOptions:[]}),(e,t,n)=>{const r=e(noe);t(eoe,Math.max(0,Math.min(n,r)))}),ooe=gg(null),aoe=gg(null),soe=gg(e=>{const t=e(ioe),n=e(Kg);return Math.min(t.rowsPerPage,n-t.page*t.rowsPerPage)}),loe=gg(null),coe=gg(null),uoe=gg(e=>e(cU).atTop?2:1),doe=gg(e=>e(cU).atTop?1:e(uoe)+e(soe)),poe=gg(e=>ZY(Boolean(e(iy)),e(cU))),foe=gg(e=>({firstBodyRowIdx:e(uoe),totalsRowIdx:e(doe),allowedRows:e(poe)})),hoe=gg(e=>({rootElement:e(_y),totalsPosition:e(cU),rowCount:e(soe),colCount:e(dU),columnWidths:e(NU)})),moe=gg(e=>({scrollToCell:e(loe),scrollableContainerElement:e(coe)})),goe=gg(e=>({keyboard:e(wy),isInSelectionMode:e(iy),selectionsAPI:e(oy),isSelectionsEnabled:e(uy)})),yoe=gg(e=>({direction:e(my),isInteractionEnabled:e(py),paginationNeeded:e(mU),announce:e(lX),shouldRefocusRef:e(ooe)})),boe=10,voe=e=>e.atTop?2:1,xoe=(e,[t,n],r,i)=>{const o=voe(r);if(0===t)return e.querySelector(`.sn-table-head-row [data-col="${n}"]`);if(r.atTop&&1===t)return e.querySelector(`.sn-table-totals-row [data-col="${n}"]`);const a=t-o;return a>=0&&a<i?e.querySelector(`.sn-table-body .sn-table-cell[rowindex="${a}"][columnindex="${n}"]`):e.querySelector(`.sn-table-totals-row [data-col="${n}"]`)},woe=(e,t,n,r,i,o,a,s,l)=>{if(!e)return l(!1),()=>{};const[c,u]=n,d=c-voe(r),p=d>=0&&d<i;let f=a,h=!1,m=null;const g=()=>h||s&&!s(),y=()=>{g()||(p&&e(d,u),m=requestAnimationFrame(()=>{if(g())return;const e=((e,t)=>{if(!e||!t)return!1;const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top>=r.top&&n.bottom<=r.bottom&&n.left>=r.left&&n.right<=r.right})(xoe(t,n,r,i),o);if(!e)return f>0?(f-=1,void y()):void l(!1);l(!0)}))};return y(),()=>{h=!0,null!==m&&cancelAnimationFrame(m)}},Soe=(e,t,n,r,i,o)=>e<o?[t,e+1]:t<r?[t+1,i]:[t,e],koe=(e,t,n,r,i,o)=>e>i?[t,e-1]:t>n?[t-1,o]:[t,e],Coe=(e,[t,n],r,i,o,a={top:0,bottom:0},s)=>{const l=a.top>0,c=a.top,u=r-1-a.bottom,d=i-1;switch(e.key){case Em.Down:case Em.Up:t=((e,t,n,r)=>e===Em.Down&&t<r?t+1:e===Em.Up&&t>n?t-1:t)(e.key,t,c,u);break;case Em.Right:l||([t,n]=((e,t,n,r,i,o,a)=>"rtl"===a?koe(e,t,n,0,i,o):Soe(e,t,0,r,i,o))(n,t,c,u,0,d,o));break;case Em.Left:l||([t,n]=((e,t,n,r,i,o,a)=>"rtl"===a?Soe(e,t,0,r,i,o):koe(e,t,n,0,i,o))(n,t,c,u,0,d,o));break;case Em.Home:l?t=Math.max(c,t-boe):(DY(e)&&(t=c),n=0);break;case Em.End:l?t=Math.min(u,t+boe):(DY(e)&&(t=u),n=d);break;case Em.PageDown:t=Math.min(u,t+boe);break;case Em.PageUp:if(l)t=Math.max(c,t-boe);else{const e=s?voe(s):1,n=t-e;t=n>0&&n<=boe?e:Math.max(c,t-boe)}}return[t,n]},Eoe=e=>{((e,t)=>{e.querySelectorAll(t).forEach(e=>{e.setAttribute("tabIndex","-1")})})(e,".sn-table-cell[tabindex='0']")},Moe=[Em.Home,Em.End,Em.PageUp,Em.PageDown],Roe=()=>{const e=Yt.useRef(!1),t=Yt.useRef(0),n=Yt.useRef(0),r=Yt.useRef(null),i=Yt.useRef(null),o=Yt.useRef(null),a=Yt.useRef(0),s=Ag(iX),l=Ag(HY),c=_g(Wg)("VNA-700-KEYBOARD_NAV_VIRTUALIZED_STRAIGHT_TABLE"),{rootElement:u,totalsPosition:d,rowCount:p,colCount:f,columnWidths:h}=_g(hoe),{firstBodyRowIdx:m,allowedRows:g,totalsRowIdx:y}=_g(foe),{scrollToCell:b,scrollableContainerElement:v}=_g(moe),{keyboard:x,isInSelectionMode:w,selectionsAPI:S,isSelectionsEnabled:k}=_g(goe),{direction:C,announce:E,isInteractionEnabled:M,paginationNeeded:R,shouldRefocusRef:_}=_g(yoe),A=Yt.useMemo(()=>(e=>{const t=new Array(e.length+1);t[0]=0;for(let n=0;n<e.length;n++)t[n+1]=t[n]+(e[n]??0);return t})(h),[h]);Yt.useEffect(()=>()=>{t.current+=1,n.current+=1,a.current+=1,r.current?.(),r.current=null,i.current?.(),i.current=null,o.current?.(),o.current=null},[]);const I=Yt.useCallback((e,t,n,r)=>{const i=t=>{if(r&&!r())return void n?.(!1);const o=xoe(u,e,d,p);if(o)return document.activeElement!==o&&KY(o),document.activeElement===o?void n?.(!0):t>0?void requestAnimationFrame(()=>{i(t-1)}):void n?.(!1);t>0?requestAnimationFrame(()=>{i(t-1)}):n?.(!1)};requestAnimationFrame(()=>{i(t)})},[u,d,p]),P=Yt.useCallback((e,t)=>{const r=a.current+1;a.current=r;let o=0;const s=Date.now()+5e3,l=()=>{if(a.current!==r)return;if(n.current!==t)return;if(u instanceof HTMLElement&&!u.isConnected)return;if(Date.now()>s||o>=5)return;const c=document.activeElement;c&&c!==document.body&&c!==document.documentElement||(o+=1,_&&(_.current=!0),i.current?.(),i.current=woe(b,u,e,d,p,v,10,()=>a.current===r&&n.current===t,()=>{I(e,300,()=>{_&&(_.current=!1)},()=>a.current===r&&n.current===t)})),requestAnimationFrame(()=>{requestAnimationFrame(l)})};requestAnimationFrame(()=>{requestAnimationFrame(l)})},[I,u,p,b,v,_,d]),T=Yt.useCallback(()=>(_&&(_.current=!0),t.current+=1,t.current),[_]),D=Yt.useCallback(()=>{t.current+=1,o.current?.(),o.current=null},[]),O=Yt.useCallback((e,n)=>{const r=i=>{t.current===e&&(o.current?.(),o.current=woe(b,u,n,d,p,v,10,()=>t.current===e,()=>{if(t.current!==e)return;const o=xoe(u,n,d,p);o&&document.activeElement!==o&&KY(o),i>0?requestAnimationFrame(()=>{r(i-1)}):t.current===e&&_&&(_.current=!1)}))};requestAnimationFrame(()=>{requestAnimationFrame(()=>{r(300)})})},[u,d,p,b,_,v]),N=Yt.useCallback((e,t)=>{if(!LY(e))return;Zh(e),D(),n.current+=1;const i=n.current;a.current+=1,r.current?.(),r.current=null;const o=((e,t)=>voe(t)+e+(t.atBottom?1:0))(p,d),l=Coe(e,t,o,f,C,g,d);Eoe(u),s(l);const[,c]=l,[,h]=t;return c!==h&&((e,t,n)=>{if(!e)return;const r=t[n]??0,i=t[n+1]??r,{scrollLeft:o,clientWidth:a}=e;r<o?e.scrollLeft=r:i>o+a&&(e.scrollLeft=i-a)})(v,A,c),_&&(_.current=!0),r.current=woe(b,u,l,d,p,v,10,()=>n.current===i,()=>{I(l,300,t=>{_&&(_.current=!1),t&&(e=>Moe.includes(e))(e.key)&&P(l,i)},()=>n.current===i)}),l},[u,d,p,f,C,b,s,g,v,_,I,D,A,P]),q=Yt.useCallback(e=>{e.key===Em.Esc?x.enabled&&!w&&(Zh(e),x.blur?.(!0)):NY(e.key)&&Zh(e)},[x,w]),L=Yt.useCallback((e,t,n)=>{switch(e.key){case Em.C:Zh(e),M&&(e.ctrlKey||e.metaKey)&&Om(e.currentTarget);break;case Em.Enter:case Em.Space:if(!M){Zh(e);break}n?.(e);break;default:N(e,[0,t])}},[N,M]),j=Yt.useCallback((t,r,i,o)=>{const a=[r+m,i];switch(t.key){case Em.Space:if(Zh(t),o.isSelectable&&k){e.current=!0;const n=T();l({type:KB.Select,payload:{cell:o,evt:t,announce:E}}),O(n,a)}break;case Em.Enter:if(Zh(t),e.current=!1,w){T(),s(QB),S?.confirm(),v&&(v.scrollTop=0,v.scrollLeft=0);const e=t=>{b?.(0,0),t>0&&requestAnimationFrame(()=>{e(t-1)})};e(10),n.current+=1;const t=n.current;I(QB,300,()=>{_&&(_.current=!1)},()=>n.current===t)}break;case Em.Esc:if(e.current=!1,w){Zh(t);const e=T();S?.cancel(),O(e,a)}break;case Em.C:Zh(t),M&&(t.ctrlKey||t.metaKey)&&Om(t.currentTarget);break;case Em.Tab:{const e=t.shiftKey||!R;x.enabled&&w&&e&&(Zh(t),Qh(t.currentTarget,x,t.shiftKey));break}default:{const n=t.key===Em.Left||t.key===Em.Right,r=w||Boolean(S?.isModal())||e.current;if(n&&r){Zh(t);break}const i=N(t,a);!!i&&i[0]!==a[0]&&t.shiftKey&&k&&o.isSelectable&&l({type:KB.SelectMultiAdd,payload:{cell:o,evt:t,announce:E}});break}}},[m,N,k,l,E,w,S,x,R,M,T,O,s,b,v,I,_]),z=Yt.useCallback(t=>{t.key===Em.Space&&(e.current=!1),t.key===Em.Shift&&l({type:KB.SelectMultiEnd})},[l]),F=Yt.useCallback((e,t)=>{if(w)Zh(e);else{if(e.key!==Em.Space)return e.key===Em.C?(Zh(e),void(M&&(e.ctrlKey||e.metaKey)&&Om(e.currentTarget))):void N(e,[y,t]);e.preventDefault()}},[w,N,y,M]),$=Yt.useCallback(e=>{D(),n.current+=1;const t=n.current;Eoe(u),s(e),x.enabled&&x.focus?.(),I(e,2,n=>{n&&P(e,t)},()=>n.current===t)},[u,s,x,I,D,P]);return{handleWrapperKeyDown:q,handleHeadKeyDown:L,handleBodyKeyDown:j,handleBodyKeyUp:z,handleTotalsKeyDown:F,focusHeadCellOnClick:Yt.useCallback(e=>{c&&$([0,e])},[$,c]),focusBodyCellOnClick:Yt.useCallback((e,t)=>{c&&$([e+m,t])},[$,m,c]),focusTotalsCellOnClick:Yt.useCallback(e=>{c&&$([y,e])},[$,y,c])}};var _oe=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Aoe(e,t){return e===t||!(!_oe(e)||!_oe(t))}function Ioe(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Aoe(e[n],t[n]))return!1;return!0}function Poe(e,t){var n;void 0===t&&(t=Ioe);var r,i=[],o=!1;return function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return o&&n===this&&t(a,i)||(r=e.apply(this,a),o=!0,n=this,i=a),r}}var Toe="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function Doe(e){cancelAnimationFrame(e.id)}function Ooe(e,t){var n=Toe();var r={id:requestAnimationFrame(function i(){Toe()-n>=t?e.call(null):r.id=requestAnimationFrame(i)})};return r}var Noe=-1;function qoe(e){if(void 0===e&&(e=!1),-1===Noe||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),Noe=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Noe}var Loe=null;function joe(e){if(void 0===e&&(e=!1),null===Loe||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;return i.width="100px",i.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?Loe="positive-descending":(t.scrollLeft=1,Loe=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),Loe}return Loe}var zoe=function(e){var t=e.columnIndex;return e.data,e.rowIndex+":"+t};function Foe(e){var t,n=e.getColumnOffset,r=e.getColumnStartIndexForOffset,i=e.getColumnStopIndexForStartIndex,o=e.getColumnWidth,a=e.getEstimatedTotalHeight,s=e.getEstimatedTotalWidth,l=e.getOffsetForColumnAndAlignment,c=e.getOffsetForRowAndAlignment,u=e.getRowHeight,d=e.getRowOffset,p=e.getRowStartIndexForOffset,f=e.getRowStopIndexForStartIndex,h=e.initInstanceProps,m=e.shouldResetStyleCacheOnItemSizeChange,g=e.validateProps;return t=function(e){function t(t){var r;return(r=e.call(this,t)||this)._instanceProps=h(r.props,Mc(r)),r._resetIsScrollingTimeoutId=null,r._outerRef=void 0,r.state={instance:Mc(r),isScrolling:!1,horizontalScrollDirection:"forward",scrollLeft:"number"==typeof r.props.initialScrollLeft?r.props.initialScrollLeft:0,scrollTop:"number"==typeof r.props.initialScrollTop?r.props.initialScrollTop:0,scrollUpdateWasRequested:!1,verticalScrollDirection:"forward"},r._callOnItemsRendered=void 0,r._callOnItemsRendered=Poe(function(e,t,n,i,o,a,s,l){return r.props.onItemsRendered({overscanColumnStartIndex:e,overscanColumnStopIndex:t,overscanRowStartIndex:n,overscanRowStopIndex:i,visibleColumnStartIndex:o,visibleColumnStopIndex:a,visibleRowStartIndex:s,visibleRowStopIndex:l})}),r._callOnScroll=void 0,r._callOnScroll=Poe(function(e,t,n,i,o){return r.props.onScroll({horizontalScrollDirection:n,scrollLeft:e,scrollTop:t,verticalScrollDirection:i,scrollUpdateWasRequested:o})}),r._getItemStyle=void 0,r._getItemStyle=function(e,t){var i,a=r.props,s=a.columnWidth,l=a.direction,c=a.rowHeight,p=r._getItemStyleCache(m&&s,m&&l,m&&c),f=e+":"+t;if(p.hasOwnProperty(f))i=p[f];else{var h=n(r.props,t,r._instanceProps),g="rtl"===l;p[f]=i={position:"absolute",left:g?void 0:h,right:g?h:void 0,top:d(r.props,e,r._instanceProps),height:u(r.props,e,r._instanceProps),width:o(r.props,t,r._instanceProps)}}return i},r._getItemStyleCache=void 0,r._getItemStyleCache=Poe(function(e,t,n){return{}}),r._onScroll=function(e){var t=e.currentTarget,n=t.clientHeight,i=t.clientWidth,o=t.scrollLeft,a=t.scrollTop,s=t.scrollHeight,l=t.scrollWidth;r.setState(function(e){if(e.scrollLeft===o&&e.scrollTop===a)return null;var t=r.props.direction,c=o;if("rtl"===t)switch(joe()){case"negative":c=-o;break;case"positive-descending":c=l-i-o}c=Math.max(0,Math.min(c,l-i));var u=Math.max(0,Math.min(a,s-n));return{isScrolling:!0,horizontalScrollDirection:e.scrollLeft<o?"forward":"backward",scrollLeft:c,scrollTop:u,verticalScrollDirection:e.scrollTop<a?"forward":"backward",scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){null!==r._resetIsScrollingTimeoutId&&Doe(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=Ooe(r._resetIsScrolling,150)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},function(){r._getItemStyleCache(-1)})},r}rc(t,e),t.getDerivedStateFromProps=function(e,t){return $oe(e,t),g(e),null};var y=t.prototype;return y.scrollTo=function(e){var t=e.scrollLeft,n=e.scrollTop;void 0!==t&&(t=Math.max(0,t)),void 0!==n&&(n=Math.max(0,n)),this.setState(function(e){return void 0===t&&(t=e.scrollLeft),void 0===n&&(n=e.scrollTop),e.scrollLeft===t&&e.scrollTop===n?null:{horizontalScrollDirection:e.scrollLeft<t?"forward":"backward",scrollLeft:t,scrollTop:n,scrollUpdateWasRequested:!0,verticalScrollDirection:e.scrollTop<n?"forward":"backward"}},this._resetIsScrollingDebounced)},y.scrollToItem=function(e){var t=e.align,n=void 0===t?"auto":t,r=e.columnIndex,i=e.rowIndex,o=this.props,u=o.columnCount,d=o.height,p=o.rowCount,f=o.width,h=this.state,m=h.scrollLeft,g=h.scrollTop,y=qoe();void 0!==r&&(r=Math.max(0,Math.min(r,u-1))),void 0!==i&&(i=Math.max(0,Math.min(i,p-1)));var b=a(this.props,this._instanceProps),v=s(this.props,this._instanceProps)>f?y:0,x=b>d?y:0;this.scrollTo({scrollLeft:void 0!==r?l(this.props,r,n,m,this._instanceProps,x):m,scrollTop:void 0!==i?c(this.props,i,n,g,this._instanceProps,v):g})},y.componentDidMount=function(){var e=this.props,t=e.initialScrollLeft,n=e.initialScrollTop;if(null!=this._outerRef){var r=this._outerRef;"number"==typeof t&&(r.scrollLeft=t),"number"==typeof n&&(r.scrollTop=n)}this._callPropsCallbacks()},y.componentDidUpdate=function(){var e=this.props.direction,t=this.state,n=t.scrollLeft,r=t.scrollTop;if(t.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("rtl"===e)switch(joe()){case"negative":i.scrollLeft=-n;break;case"positive-ascending":i.scrollLeft=n;break;default:var o=i.clientWidth,a=i.scrollWidth;i.scrollLeft=a-o-n}else i.scrollLeft=Math.max(0,n);i.scrollTop=Math.max(0,r)}this._callPropsCallbacks()},y.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&Doe(this._resetIsScrollingTimeoutId)},y.render=function(){var e=this.props,t=e.children,n=e.className,r=e.columnCount,i=e.direction,o=e.height,l=e.innerRef,c=e.innerElementType,u=e.innerTagName,d=e.itemData,p=e.itemKey,f=void 0===p?zoe:p,h=e.outerElementType,m=e.outerTagName,g=e.rowCount,y=e.style,b=e.useIsScrolling,v=e.width,x=this.state.isScrolling,w=this._getHorizontalRangeToRender(),S=w[0],k=w[1],C=this._getVerticalRangeToRender(),E=C[0],M=C[1],R=[];if(r>0&&g)for(var _=E;_<=M;_++)for(var A=S;A<=k;A++)R.push(Yt.createElement(t,{columnIndex:A,data:d,isScrolling:b?x:void 0,key:f({columnIndex:A,data:d,rowIndex:_}),rowIndex:_,style:this._getItemStyle(_,A)}));var I=a(this.props,this._instanceProps),P=s(this.props,this._instanceProps);return Yt.createElement(h||m||"div",{className:n,onScroll:this._onScroll,ref:this._outerRefSetter,style:Ut({position:"relative",height:o,width:v,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:i},y)},Yt.createElement(c||u||"div",{children:R,ref:l,style:{height:I,pointerEvents:x?"none":void 0,width:P}}))},y._callPropsCallbacks=function(){var e=this.props,t=e.columnCount,n=e.onItemsRendered,r=e.onScroll,i=e.rowCount;if("function"==typeof n&&t>0&&i>0){var o=this._getHorizontalRangeToRender(),a=o[0],s=o[1],l=o[2],c=o[3],u=this._getVerticalRangeToRender(),d=u[0],p=u[1],f=u[2],h=u[3];this._callOnItemsRendered(a,s,d,p,l,c,f,h)}if("function"==typeof r){var m=this.state,g=m.horizontalScrollDirection,y=m.scrollLeft,b=m.scrollTop,v=m.scrollUpdateWasRequested,x=m.verticalScrollDirection;this._callOnScroll(y,b,g,x,v)}},y._getHorizontalRangeToRender=function(){var e=this.props,t=e.columnCount,n=e.overscanColumnCount,o=e.overscanColumnsCount,a=e.overscanCount,s=e.rowCount,l=this.state,c=l.horizontalScrollDirection,u=l.isScrolling,d=l.scrollLeft,p=n||o||a||1;if(0===t||0===s)return[0,0,0,0];var f=r(this.props,d,this._instanceProps),h=i(this.props,f,d,this._instanceProps),m=u&&"backward"!==c?1:Math.max(1,p),g=u&&"forward"!==c?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,n=e.overscanCount,r=e.overscanRowCount,i=e.overscanRowsCount,o=e.rowCount,a=this.state,s=a.isScrolling,l=a.verticalScrollDirection,c=a.scrollTop,u=r||i||n||1;if(0===t||0===o)return[0,0,0,0];var d=p(this.props,c,this._instanceProps),h=f(this.props,d,c,this._instanceProps),m=s&&"backward"!==l?1:Math.max(1,u),g=s&&"forward"!==l?1:Math.max(1,u);return[Math.max(0,d-m),Math.max(0,Math.min(o-1,h+g)),d,h]},t}(Yt.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,useIsScrolling:!1},t}var $oe=function(e,t){e.children,e.direction,e.height,e.innerTagName,e.outerTagName,e.overscanColumnsCount,e.overscanCount,e.overscanRowsCount,e.width,t.instance},Boe=function(e,t){var n=e.rowCount,r=t.rowMetadataMap,i=t.estimatedRowHeight,o=t.lastMeasuredRowIndex,a=0;if(o>=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},Hoe=function(e,t){var n=e.columnCount,r=t.columnMetadataMap,i=t.estimatedColumnWidth,o=t.lastMeasuredColumnIndex,a=0;if(o>=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},Voe=function(e,t,n,r){var i,o,a;if("column"===e?(i=r.columnMetadataMap,o=t.columnWidth,a=r.lastMeasuredColumnIndex):(i=r.rowMetadataMap,o=t.rowHeight,a=r.lastMeasuredRowIndex),n>a){var s=0;if(a>=0){var l=i[a];s=l.offset+l.size}for(var c=a+1;c<=n;c++){var u=o(c);i[c]={offset:s,size:u},s+=u}"column"===e?r.lastMeasuredColumnIndex=n:r.lastMeasuredRowIndex=n}return i[n]},Woe=function(e,t,n,r){var i,o;return"column"===e?(i=n.columnMetadataMap,o=n.lastMeasuredColumnIndex):(i=n.rowMetadataMap,o=n.lastMeasuredRowIndex),(o>0?i[o].offset:0)>=r?Uoe(e,t,n,o,0,r):Goe(e,t,n,Math.max(0,o),r)},Uoe=function(e,t,n,r,i,o){for(;i<=r;){var a=i+Math.floor((r-i)/2),s=Voe(e,t,a,n).offset;if(s===o)return a;s<o?i=a+1:s>o&&(r=a-1)}return i>0?i-1:0},Goe=function(e,t,n,r,i){for(var o="column"===e?t.columnCount:t.rowCount,a=1;r<o&&Voe(e,t,r,n).offset<i;)r+=a,a*=2;return Uoe(e,t,n,Math.min(r,o-1),Math.floor(r/2),i)},Yoe=function(e,t,n,r,i,o,a){var s="column"===e?t.width:t.height,l=Voe(e,t,n,o),c="column"===e?Hoe(t,o):Boe(t,o),u=Math.max(0,Math.min(c-s,l.offset)),d=Math.max(0,l.offset-s+a+l.size);switch("smart"===r&&(r=i>=d-s&&i<=u+s?"auto":"center"),r){case"start":return u;case"end":return d;case"center":return Math.round(d+(u-d)/2);default:return i>=d&&i<=u?i:d>u||i<d?d:u}},Koe=Foe({getColumnOffset:function(e,t,n){return Voe("column",e,t,n).offset},getColumnStartIndexForOffset:function(e,t,n){return Woe("column",e,n,t)},getColumnStopIndexForStartIndex:function(e,t,n,r){for(var i=e.columnCount,o=e.width,a=Voe("column",e,t,r),s=n+o,l=a.offset+a.size,c=t;c<i-1&&l<s;)c++,l+=Voe("column",e,c,r).size;return c},getColumnWidth:function(e,t,n){return n.columnMetadataMap[t].size},getEstimatedTotalHeight:Boe,getEstimatedTotalWidth:Hoe,getOffsetForColumnAndAlignment:function(e,t,n,r,i,o){return Yoe("column",e,t,n,r,i,o)},getOffsetForRowAndAlignment:function(e,t,n,r,i,o){return Yoe("row",e,t,n,r,i,o)},getRowOffset:function(e,t,n){return Voe("row",e,t,n).offset},getRowHeight:function(e,t,n){return n.rowMetadataMap[t].size},getRowStartIndexForOffset:function(e,t,n){return Woe("row",e,n,t)},getRowStopIndexForStartIndex:function(e,t,n,r){for(var i=e.rowCount,o=e.height,a=Voe("row",e,t,r),s=n+o,l=a.offset+a.size,c=t;c<i-1&&l<s;)c++,l+=Voe("row",e,c,r).size;return c},initInstanceProps:function(e,t){var n=e,r={columnMetadataMap:{},estimatedColumnWidth:n.estimatedColumnWidth||50,estimatedRowHeight:n.estimatedRowHeight||50,lastMeasuredColumnIndex:-1,lastMeasuredRowIndex:-1,rowMetadataMap:{}};return t.resetAfterColumnIndex=function(e,n){void 0===n&&(n=!0),t.resetAfterIndices({columnIndex:e,shouldForceUpdate:n})},t.resetAfterRowIndex=function(e,n){void 0===n&&(n=!0),t.resetAfterIndices({rowIndex:e,shouldForceUpdate:n})},t.resetAfterIndices=function(e){var n=e.columnIndex,i=e.rowIndex,o=e.shouldForceUpdate,a=void 0===o||o;"number"==typeof n&&(r.lastMeasuredColumnIndex=Math.min(r.lastMeasuredColumnIndex,n-1)),"number"==typeof i&&(r.lastMeasuredRowIndex=Math.min(r.lastMeasuredRowIndex,i-1)),t._getItemStyleCache(-1),a&&t.forceUpdate()},r},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.columnWidth,e.rowHeight}}),Xoe=function(e,t){return e};function Joe(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,i=e.getItemSize,o=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,s=e.getStopIndexForStartIndex,l=e.initInstanceProps,c=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return t=function(e){function t(t){var r;return(r=e.call(this,t)||this)._instanceProps=l(r.props,Mc(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:Mc(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=Poe(function(e,t,n,i){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:i})}),r._callOnScroll=void 0,r._callOnScroll=Poe(function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})}),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,o=r.props,a=o.direction,s=o.itemSize,l=o.layout,u=r._getItemStyleCache(c&&s,c&&l,c&&a);if(u.hasOwnProperty(e))t=u[e];else{var d=n(r.props,e,r._instanceProps),p=i(r.props,e,r._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},r._getItemStyleCache=void 0,r._getItemStyleCache=Poe(function(e,t,n){return{}}),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,i=t.scrollLeft,o=t.scrollWidth;r.setState(function(e){if(e.scrollOffset===i)return null;var t=r.props.direction,a=i;if("rtl"===t)switch(joe()){case"negative":a=-i;break;case"positive-descending":a=o-n-i}return a=Math.max(0,Math.min(a,o-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,i=t.scrollHeight,o=t.scrollTop;r.setState(function(e){if(e.scrollOffset===o)return null;var t=Math.max(0,Math.min(o,i-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){null!==r._resetIsScrollingTimeoutId&&Doe(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=Ooe(r._resetIsScrolling,150)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},function(){r._getItemStyleCache(-1,null)})},r}rc(t,e),t.getDerivedStateFromProps=function(e,t){return Qoe(e,t),u(e),null};var d=t.prototype;return d.scrollTo=function(e){e=Math.max(0,e),this.setState(function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},d.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,i=n.layout,a=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var s=0;if(this._outerRef){var l=this._outerRef;s="vertical"===i?l.scrollWidth>l.clientWidth?qoe():0:l.scrollHeight>l.clientHeight?qoe():0}this.scrollTo(o(this.props,e,t,a,this._instanceProps,s))},d.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var i=this._outerRef;"horizontal"===t||"horizontal"===r?i.scrollLeft=n:i.scrollTop=n}this._callPropsCallbacks()},d.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,i=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("horizontal"===t||"horizontal"===n)if("rtl"===t)switch(joe()){case"negative":o.scrollLeft=-i;break;case"positive-ascending":o.scrollLeft=i;break;default:var a=o.clientWidth,s=o.scrollWidth;o.scrollLeft=s-a-i}else o.scrollLeft=i;else o.scrollTop=i}this._callPropsCallbacks()},d.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&Doe(this._resetIsScrollingTimeoutId)},d.render=function(){var e=this.props,t=e.children,n=e.className,i=e.direction,o=e.height,a=e.innerRef,s=e.innerElementType,l=e.innerTagName,c=e.itemCount,u=e.itemData,d=e.itemKey,p=void 0===d?Xoe:d,f=e.layout,h=e.outerElementType,m=e.outerTagName,g=e.style,y=e.useIsScrolling,b=e.width,v=this.state.isScrolling,x="horizontal"===i||"horizontal"===f,w=x?this._onScrollHorizontal:this._onScrollVertical,S=this._getRangeToRender(),k=S[0],C=S[1],E=[];if(c>0)for(var M=k;M<=C;M++)E.push(Yt.createElement(t,{data:u,key:p(M,u),index:M,isScrolling:y?v:void 0,style:this._getItemStyle(M)}));var R=r(this.props,this._instanceProps);return Yt.createElement(h||m||"div",{className:n,onScroll:w,ref:this._outerRefSetter,style:Ut({position:"relative",height:o,width:b,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:i},g)},Yt.createElement(s||l||"div",{children:E,ref:a,style:{height:x?"100%":R,pointerEvents:v?"none":void 0,width:x?R:"100%"}}))},d._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],i=e[3];this._callOnItemsRendered(t,n,r,i)}if("function"==typeof this.props.onScroll){var o=this.state,a=o.scrollDirection,s=o.scrollOffset,l=o.scrollUpdateWasRequested;this._callOnScroll(a,s,l)}},d._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,i=r.isScrolling,o=r.scrollDirection,l=r.scrollOffset;if(0===t)return[0,0,0,0];var c=a(this.props,l,this._instanceProps),u=s(this.props,c,l,this._instanceProps),d=i&&"backward"!==o?1:Math.max(1,n),p=i&&"forward"!==o?1:Math.max(1,n);return[Math.max(0,c-d),Math.max(0,Math.min(t-1,u+p)),c,u]},t}(Yt.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Qoe=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},Zoe=function(e,t,n){var r=e.itemSize,i=n.itemMetadataMap,o=n.lastMeasuredIndex;if(t>o){var a=0;if(o>=0){var s=i[o];a=s.offset+s.size}for(var l=o+1;l<=t;l++){var c=r(l);i[l]={offset:a,size:c},a+=c}n.lastMeasuredIndex=t}return i[t]},eae=function(e,t,n,r,i){for(;r<=n;){var o=r+Math.floor((n-r)/2),a=Zoe(e,o,t).offset;if(a===i)return o;a<i?r=o+1:a>i&&(n=o-1)}return r>0?r-1:0},tae=function(e,t,n,r){for(var i=e.itemCount,o=1;n<i&&Zoe(e,n,t).offset<r;)n+=o,o*=2;return eae(e,t,Math.min(n,i-1),Math.floor(n/2),r)},nae=function(e,t){var n=e.itemCount,r=t.itemMetadataMap,i=t.estimatedItemSize,o=t.lastMeasuredIndex,a=0;if(o>=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},rae=Joe({getItemOffset:function(e,t,n){return Zoe(e,t,n).offset},getItemSize:function(e,t,n){return n.itemMetadataMap[t].size},getEstimatedTotalSize:nae,getOffsetForIndexAndAlignment:function(e,t,n,r,i,o){var a=e.direction,s=e.height,l=e.layout,c=e.width,u="horizontal"===a||"horizontal"===l?c:s,d=Zoe(e,t,i),p=nae(e,i),f=Math.max(0,Math.min(p-u,d.offset)),h=Math.max(0,d.offset-u+d.size+o);switch("smart"===n&&(n=r>=h-u&&r<=f+u?"auto":"center"),n){case"start":return f;case"end":return h;case"center":return Math.round(h+(f-h)/2);default:return r>=h&&r<=f?r:r<h?h:f}},getStartIndexForOffset:function(e,t,n){return function(e,t,n){var r=t.itemMetadataMap,i=t.lastMeasuredIndex;return(i>0?r[i].offset:0)>=n?eae(e,t,i,0,n):tae(e,t,Math.max(0,i),n)}(e,n,t)},getStopIndexForStartIndex:function(e,t,n,r){for(var i=e.direction,o=e.height,a=e.itemCount,s=e.layout,l=e.width,c="horizontal"===i||"horizontal"===s?l:o,u=Zoe(e,t,r),d=n+c,p=u.offset+u.size,f=t;f<a-1&&p<d;)f++,p+=Zoe(e,f,r).size;return f},initInstanceProps:function(e,t){var n={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,r){void 0===r&&(r=!0),n.lastMeasuredIndex=Math.min(n.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),r&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.itemSize}});function iae(e,t){for(var n in e)if(!(n in t))return!0;for(var r in t)if(e[r]!==t[r])return!0;return!1}var oae=["style"],aae=["style"];function sae(e,t){var n=e.style,r=Gt(e,oae),i=t.style,o=Gt(t,aae);return!iae(n,i)&&!iae(r,o)}const lae=gg(0),cae=gg(0),uae=gg(0),dae=gg(e=>e(lae)+e(cae)),pae=gg(e=>{const t=e(Ry),n=e(mU),r=t.height-(n?41:0);return{width:t.width,height:r}}),fae=gg(e=>{const t=e(pae),n=e(pV),r=e(fV);return{width:t.width-r,height:t.height-n}}),hae=gg(e=>{const t=e(fae),n=e(dae),r=e(uae);return Math.min(t.height-n,r)}),mae=gg(-1),gae=KR(e=>gg(t=>t(mae)===e)),yae=({style:e})=>lt.jsx("div",{className:"sn-table-cell",style:{...e,borderWidth:"0px 1px 1px 0px",boxSizing:"border-box"}});var bae=Kt.memo(yae,sae);const vae=gg(e=>{const t=e(fae),n=e(AU),r=e(dae),i=e(uae)+r,o=e(soe)*n+r;return i<2*t.height?i:o}),xae=gg(e=>e(vae)<=e(pae).height),wae=()=>{},Sae=e=>{e.preventDefault()};const kae=({columnIndex:e,rowIndex:t,style:n,data:r})=>{const{rowsInPage:i,columns:o,isHoverEnabled:a,setMeasuredCellHeight:s,lineClamp:l,resizeObserverTaskScheduler:c,onKeyDown:u,onKeyUp:d,onCellClick:p}=r,f=_g(gae(t)),h=Ag(mae),m=_g(EU),g=_g(my),y=_g(cy),b=_g(py),v=_g(WY),x=_g(Wg),w=_g(xae),S=i[t]?.[e],{handleMouseDown:k,handleMouseOver:C,handleMouseUp:E,cellSelectionState:M}=function(e){const t="object"==typeof e,n=_g(uy),r=Ag(HY),i=_g(VY(e));if(Cie(e),t&&n){const{handleMouseDown:t,handleMouseOver:n,handleMouseUp:o}=Sie(Sae,e,r,wae);return{handleMouseDown:t,handleMouseOver:n,handleMouseUp:o,cellSelectionState:i}}return{cellSelectionState:i}}(S),R=((e,t,n,r)=>{const i=Yt.useRef(null),o=n&&(!n.isNumeric||n.isDual),a=n?.isTotalRow??!1,s=Yt.useCallback(n=>{const i=n.contentBoxSize.at(0)?.blockSize;i&&o&&r(i,e,t,a)},[a,t,r,e,o]);return TK({ref:i,callback:s}),i})(t,e,S,s),_=o[e]?.isDim?m.dimension.values:m.measure.values,A=wie(o[e].id);if("object"==typeof S){const r=((e,t,n,r,i,o,a)=>{const s=e.isTotalRow&&a("TLV-2303-SUB-TOTALS");let l=Rie(i,o,e);l=s?o.subTotalRow:l,l=Eie(l,o,e,t.isDim);const c=e.isNull||s&&t.isDim?l:CV(l,e.qAttrExps,t.qAttrExprInfoIDs);return r!==YB.Selected||s?r!==YB.Disabled||s?n?{...c,...o.grid.hoverColors}:c:{...c,color:n?o.grid.hoverColors?.color:c.color,background:`${WH}, ${n?o.grid.hoverColors?.background:c.background}`}:{...c,...o.selectedColors}})(S,o[e],a&&f,M,_,m,x),i={rowindex:t,columnindex:e},s=n=>{b&&p?.(t,e),k?.(n)},I=u?n=>{u(n,t,e,S)}:void 0;return lt.jsx("div",{className:`sn-table-cell ${M} ${Cm}`,tabIndex:-1,style:{...n,...r,display:"flex",alignItems:"start",borderColor:m.grid.border,borderTop:"0px",borderBottomWidth:!w&&S.isLastRow?"0px":"1px",borderRightWidth:nV(g,S.isLastColumn,v),borderLeftWidth:rV(g,S.isLastColumn,v),justifyContent:QH(S,g),borderStyle:"solid",padding:"4px 12px",boxSizing:"border-box",cursor:"default",overflow:"hidden",textAlign:S.align,opacity:A},onMouseDown:s,onMouseUp:E,onMouseOver:C,onMouseEnter:a?()=>{h(t)}:void 0,onMouseLeave:a?()=>{h(-1)}:void 0,onKeyDown:I,onKeyUp:d,title:y?S.representation.text:void 0,...i,children:lt.jsx(xie,{cellSelectionState:M,hideTickIcon:!!S.isTotalRow,children:lt.jsx(yie,{forwardRef:m.contentStaticLineCount||1===l?void 0:R,cell:S,style:r,lineClamp:l,virtualizedCell:!0,resizeObserverTaskScheduler:c})})})}return lt.jsx(bae,{style:{...n,..._,borderColor:m.grid.border,borderWidth:"0px 1px 1px 0px",borderStyle:"solid",boxSizing:"border-box",opacity:A}})};var Cae=Yt.memo(kae,sae);const Eae=gg(async e=>{const t=e(Yg),n=e(Sy),r=e(ioe).page,{qDataPages:i}=t.qHyperCube;if(0!==r||0===i.length){const e=r*Math.min(EV,t.qHyperCube.qSize.qcy);if(n&&"getHyperCubeData"in n)return n.getHyperCubeData("/qHyperCubeDef",[{qLeft:0,qTop:e,qWidth:50,qHeight:100}])}return[...i]}),Mae=_E(Eae),Rae=gg(e=>{const t=e(soe),n=e(fae),r=e(AU);return Math.min(t,Math.ceil(n.height/r))}),_ae=gg(e=>{const t=e(NU),n=e(fae);return t.reduce((e,t)=>e.width<n.width?{width:e.width+t,count:e.count+1}:e,{count:0,width:0}).count}),Aae=e=>{const t=Yt.useRef(e);return t.current=e,t},Iae=({qLeft:e,qTop:t,qWidth:n,qHeight:r})=>`${e}-${t}-${n}-${r}`,Pae=e=>-1===e.qElemNumber||!!e.qIsTotalCell,Tae=(e,t,n,r,i)=>{const o=e[n];if(!o)return!0;for(let e=t;e<t+r;e++){const t=o[e];if(t?.rowIdx!==i)return!0}return!1},Dae=(e,t,n,r)=>{const i=e.slice(n,r);return 0===i.length||i.some(e=>!e[t])},Oae=(e,t,n,r,i,o,a,s)=>{e.forEach(e=>{e.qMatrix.forEach((l,c)=>{const u=e.qArea.qTop-t.page*t.rowsPerPage,{row:d,pageRowIdx:p}=((e,t,n,r,i,o,a,s,l,c)=>{const{qSize:u}=a.qHyperCube,d=r.qTop+n,p=i+n,f=e[p]??[],h=t.some(Pae);return t.forEach((e,t)=>{const n=t+r.qLeft;if(f.at(n))return;const{colIdx:i,isDim:m,isLocked:g,bodyTextAlign:y,selectionColIdx:b,qAttrExprInfoIndex:v,representation:x,conditionalColoring:w,qMiniChart:S,measureMinMax:k,qNumFormat:C,qIsAutoFormat:E,formattedNullValueText:M}=o[n],R=s.flags.isEnabled("VNA-670-SEPARATE_NULL_VALUE_STYLING"),_=!m&&e.qIsNull,A=m&&XW(e,m),I=_||A?KW(m,e,a,R):e.qText,P=_?tH(I):eH(e),T=eH(e)&&!tH(e.qText??"");f[n]={id:WF(),...e,align:WW(P,y,c),rowIdx:d,colIdx:i,isSelectable:m&&!g&&!h&&!A,isTotalRow:h,pageRowIdx:p,pageColIdx:n,selectionColIdx:b,isLastRow:d===u.qcy-1,isLastColumn:n===u.qcx-1,isNumeric:P,isDual:T,isNull:(!_||!P)&&XW(e,m),qNumFormat:C,qIsAutoFormat:E,formattedNullValueText:M,representation:mW({cell:e,representationProperties:x,attrExprInfoIndex:v,env:s,conditionalColoring:w,miniChartOnMeasure:S,measureMinMax:k,getText:()=>I,direction:c,enabledFeatures:{[t$.Image]:!0,[t$.Indicator]:!0,[t$.MiniChart]:!0,[t$.Bar]:!m&&s.flags.isEnabled("VNA-977-TABLE-BARS")}})},l(f[n],d,n)}),{row:f,pageRowIdx:p}})(n,l,c,e.qArea,u,r,i,o,a,s);n[p]=d})})},Nae=({gridState:e,setEstimatedCellHeight:t})=>{const n=_g(Yg),r=_g(Py),i=_g(Sy),o=_g(Vg),a=_g(my),s=_g(ioe),l=_g(Mae),c=_g(uU),u=_g(soe),d=_g(Rae),p=_g(_ae),f=Yt.useRef([]),h=Yt.useCallback((e,r)=>{const i=Array.isArray(r)?r.slice(0,u):(e=>Array(e).fill(void 0))(u);return Oae(e,s,i,c,n,o,t,a),f.current=i,i},[u,s,c,n,o,t,a]),[m,g]=Yt.useState(()=>h(l??[]));gm(()=>{g(h(l??[]))},[l,a,u]);const y=((e,t)=>{const n=_g(Ug),r=Yt.useRef(new Set),i=Yt.useRef(new Set),o=Yt.useRef(new Set),a=Aae(e),s=Aae(t),l=Yt.useMemo(()=>({enqueue:e=>{const t=Iae(e);o.current.has(t)||(r.current.add(e),o.current.add(t),1===r.current.size&&setTimeout(async()=>{const e=Array.from(r.current.values());if(0!==e.length){r.current.clear(),i.current.add(e);try{const t=(e=>{const t=[];return e.forEach(e=>{if(t.length>0){const n=t[t.length-1];((e,t)=>e.qTop+e.qHeight===t.qTop&&e.qLeft===t.qLeft&&e.qWidth===t.qWidth)(n,e)?n.qHeight+=e.qHeight:((e,t)=>e.qLeft+e.qWidth===t.qLeft&&e.qTop===t.qTop&&e.qHeight===t.qHeight)(n,e)?n.qWidth+=e.qWidth:t.push({...e})}else t.push({...e})}),t})(e),n=await a.current(t);i.current.has(e)&&s.current(n)}catch(t){e.forEach(e=>{o.current.delete(Iae(e))}),n.error({msg:"Failed to fetch pages",payload:t})}finally{i.current.delete(e)}}},75))},clear:()=>{r.current.clear(),i.current.clear(),o.current.clear()}}),[n,a,s]);return l})(e=>i&&"getHyperCubeData"in i?i.getHyperCubeData("/qHyperCubeDef",e):Promise.resolve([]),e=>{g(t=>h(e,t))}),b=Yt.useCallback((e,t,n,r)=>{for(let i=e;i<e+n;i++)if(Dae(f.current,i,t,r)){const e={qLeft:i,qTop:t,qHeight:r,qWidth:1};y.enqueue(e)}},[y]),v=Yt.useCallback((e,t,n,r)=>{for(let i=t;i<t+r;i++){const t=Math.max(0,i-s.page*s.rowsPerPage);if(Tae(f.current,e,t,n,i)){const t={qLeft:e,qTop:i,qHeight:1,qWidth:n};y.enqueue(t)}}},[y,s]);return Yt.useEffect(()=>{if(void 0===l)return;const{qcx:t,qcy:r}=n.qHyperCube.qSize,i=e.current.overscanRowStartIndex,o=e.current.overscanColumnStartIndex,a=i+s.page*s.rowsPerPage,c=t-o,u=s.rowsPerPage-i,f=Math.min(100,c,t,p+5),h=Math.min(100,u,r,d+25);return v(o,a,f,h),()=>{y.clear()}},[l,n,d,p,s,y,v,e,r]),{rowsInPage:m,loadRows:v,loadColumns:b}},qae=e=>{let t=0;return e.forEach(e=>{e>t&&(t=e)}),t},Lae=(e,t)=>void 0===e||Math.abs(e-t)>1e-4,jae=({isSnapshot:e,isStaticNbrOfLines:t,lineClamp:n,setCellHeight:r})=>{const i=_g(EU),o=_g(NU),{estimateLineCount:a}=um(i.dimension.values),s=hV(i.dimension.values.fontSize),l=e||t||1===n;return Yt.useCallback((e,t,i)=>{if(l||e.representation.type===t$.Image||e.isNumeric&&!e.isDual)return;const c=(e=>Math.max(0,e-24-1))(o[i]),u=e.representation.text?a({text:e.representation.text,maxWidth:c,isNumeric:!1}):1,d=Math.min(n,Math.max(1,u));r(d*s,t,i,e.isTotalRow??!1)},[l,o,a,n,s,r])},zae=({isStaticNbrOfLines:e,minRowHeight:t,state:n,staticRowHeight:r=0})=>{const i=_g(gW);Yt.useLayoutEffect(()=>{const o=e?r:((e,t)=>{const n=0===t?0:e/t;return Math.ceil(n)})(n.sumHeight,n.rowHeights.size);i.estimatedRowHeight=Math.max(o,t)},[e,t,n,r,i])},Fae=({isSnapshot:e,gridRef:t})=>{const n=_g(EU),r=_g(soe),[i,o]=Yt.useState(()=>({rowHeights:new Map,cellHeightsInGrid:new Map,sumHeight:0})),a=_g(_U),s=_g(AU),l=_g(IU),c=!!n.contentStaticLineCount,u=Math.max(8e6/r,s,l)-9,d=u+9,p=Math.max(1,Math.min(n.grid.contentLineClamp,Math.round(u/a))),f=(({lineClamp:e,lineHeight:t,isStaticNbrOfLines:n})=>n?t*e+8+1:void 0)({lineClamp:p,lineHeight:a,isStaticNbrOfLines:c});(({gridRef:e,setState:t})=>{const n=_g(Yg),r=_g(ioe),i=_g(NU),o=n.multiline?.wrapTextInCells,a=n.nullValueRepresentation?.text;gm(()=>{e.current?.resetAfterIndices({columnIndex:0,rowIndex:0,shouldForceUpdate:!1}),t({rowHeights:new Map,cellHeightsInGrid:new Map,sumHeight:0})},[n.qHyperCube.qSize.qcx,n.qHyperCube.qSize.qcy,r.page,o,a]),gm(()=>{e.current?.resetAfterIndices({columnIndex:0,rowIndex:0,shouldForceUpdate:!1})},[i])})({gridRef:t,setState:o});const h=(({setState:e,maxCellHeight:t,gridRef:n})=>{const r=_g(AU),i=_g(IU);return Yt.useCallback((o,a,s,l=!1)=>{Yt.startTransition(()=>{e(e=>{const c=l?i:r,u=Math.max(c,o+9),d=Math.min(t,u),p=e.cellHeightsInGrid.get(a)??e.cellHeightsInGrid.set(a,new Map).get(a);if(!Lae(p.get(s),d))return e;const f={...e},h=e.rowHeights.get(a);p.set(s,d);const m=void 0===h||d>=h?d:qae(p);return f.rowHeights.set(a,m),f.sumHeight=e.sumHeight-(h??0)+m,n.current?.resetAfterIndices({columnIndex:s,rowIndex:a,shouldForceUpdate:!1}),f})})},[e,t,r,i,n])})({maxCellHeight:d,setState:o,gridRef:t}),m=(({isSnapshot:e,isStaticNbrOfLines:t,lineClamp:n,setCellHeight:r})=>Yt.useCallback((i,o,a,s)=>{e||t||1===n||r(i,o,a,s)},[e,t,n,r]))({isSnapshot:e,isStaticNbrOfLines:c,lineClamp:p,setCellHeight:h}),g=jae({isSnapshot:e,isStaticNbrOfLines:c,lineClamp:p,setCellHeight:h}),y=Yt.useCallback(e=>c?f??s:i.rowHeights.get(e)??s,[c,s,i.rowHeights,f]);return zae({isStaticNbrOfLines:c,minRowHeight:s,state:i,staticRowHeight:f}),{setMeasuredCellHeight:m,setEstimatedCellHeight:g,getRowHeight:y,lineClamp:p}},$ae=(e,t)=>{Yt.useLayoutEffect(()=>()=>{t(0)},[e,t]);const n=Yt.useCallback(e=>{const n=e.contentBoxSize.at(0)?.blockSize;void 0!==n&&t(n)},[t]);TK({ref:e,callback:n})};let Bae=function(e){return e.Left="Left",e.Right="Right",e.Up="Up",e.Down="Down",e.None="None",e}({});const Hae=({loadRows:e,loadColumns:t,gridState:n})=>{const r=_g(gW),i=_g(Yg),o=_g(ioe),a=_g(soe);return Yt.useCallback(({overscanColumnStartIndex:s,overscanColumnStopIndex:l,overscanRowStartIndex:c,overscanRowStopIndex:u,visibleColumnStartIndex:d,visibleColumnStopIndex:p,visibleRowStartIndex:f,visibleRowStopIndex:h})=>{const{verticalScrollDirection:m,horizontalScrollDirection:g}=(({overscanColumnStartIndex:e,overscanRowStartIndex:t},n,r)=>{let i,o;return i=r>t?Bae.Down:r<t?Bae.Up:Bae.None,o=n>e?Bae.Right:n<e?Bae.Left:Bae.None,{verticalScrollDirection:i,horizontalScrollDirection:o}})(n.current,s,c);if(n.current.overscanColumnStartIndex=s,n.current.overscanColumnStopIndex=l,n.current.overscanRowStartIndex=c,n.current.overscanRowStopIndex=u,c>a)return;const y=s,b=c+o.page*o.rowsPerPage,v=l-s+1,x=u-c+1;if(r.visibleLeft=d,r.visibleWidth=p-d+1,r.visibleTop=f+o.page*o.rowsPerPage,r.visibleHeight=h-f+1,r.page=o.page,r.rowsPerPage=o.rowsPerPage,m===Bae.Down){const t=x+25;e(y,b,v,c+t>a?a-c:t)}else if(m===Bae.Up){const t=x+25,n=o.page*o.rowsPerPage,r=Math.max(n,b-25);e(y,r,v,t)}if(g===Bae.Right){const e=i.qHyperCube.qSize.qcx-y,n=v+5,r=Math.min(e,n);t(y,b,r,x)}else if(g===Bae.Left){const e=Math.max(0,y-5),n=Math.min(i.qHyperCube.qSize.qcx,v+5);t(e,b,n,x)}},[n,a,o.page,o.rowsPerPage,r,e,i.qHyperCube.qSize.qcx,t])};const Vae=({columnIndex:e,data:t,rowIndex:n})=>{const r=t.rowsInPage[n]?.[e];return r?.id??`${n}-${e}`},Wae=(e,t)=>{if(!e||!t)return;const n=e.scrollHeight-e.clientHeight,r=Math.round(n*(e=>{const t=e.scrollHeight-e.clientHeight;return t<=0?0:Math.max(0,Math.min(1,e.scrollTop/t))})(t));e.scrollTop!==r&&(e.scrollTop=r)},Uae={overflow:"hidden",willChange:"auto"},Gae=Yt.forwardRef((e,t)=>{const{handleBodyKeyDown:n,handleBodyKeyUp:r,focusBodyCellOnClick:i}=Roe(),o=_g(uU),a=_g(fae),s=Ag(uae),l=_g(hae),c=_g(gW),u=_g(Yg),d=_g(my),p=_g(NU),f=_g(soe),h=_g(coe),m=Ag(loe),g=Yt.useRef(null),y=Yt.useRef(null),b=Yt.useRef(null),v=Yt.useRef({overscanColumnStartIndex:0,overscanRowStartIndex:0,overscanColumnStopIndex:0,overscanRowStopIndex:0}),x=Yt.useRef(0),w=!!wV(u)?.content?.hoverEffect,{setMeasuredCellHeight:S,setEstimatedCellHeight:k,getRowHeight:C,lineClamp:E}=Fae({isSnapshot:!!u.snapshotData,gridRef:g}),{rowsInPage:M,loadRows:R,loadColumns:_}=Nae({gridState:v,setEstimatedCellHeight:k}),A=Hae({loadRows:R,loadColumns:_,gridState:v}),I=SX(),P=Yt.useMemo(()=>({rowsInPage:M,columns:o,isHoverEnabled:w,lineClamp:E,setMeasuredCellHeight:S,resizeObserverTaskScheduler:I,onKeyDown:n,onKeyUp:r,onCellClick:i}),[M,o,w,E,S,I,n,r,i]);return Yt.useLayoutEffect(()=>{1===x.current&&g.current?.scrollToItem({rowIndex:f-1,align:"start"})}),function(e){const t=Ag(HY),{shouldRefocusRef:n}=_g(yoe),r=_g(_y),i=_g(aoe);Yt.useEffect(()=>{t({type:KB.UpdatePageRows,payload:{pageRows:e}})},[t,e]);const o=Yt.useCallback(()=>{n&&(n.current=r.contains(document.activeElement))},[n,r]);kX({updateShouldRefocus:o,tableWrapperRef:{current:i}})}(M),Yt.useImperativeHandle(t,()=>({interpolatedScrollTo:(e,t)=>{const n=(b.current?.clientHeight??l)-l,r=Math.round(n*e);x.current=e,1===x.current?(g.current?.scrollToItem({rowIndex:f-1,align:"start"}),g.current?.scrollTo({scrollLeft:t})):g.current?.scrollTo({scrollTop:r,scrollLeft:t})}}),[b,l,f]),Yt.useEffect(()=>(m(()=>(e,t)=>{g.current?.scrollToItem({rowIndex:e,columnIndex:t,align:"auto"}),Wae(h,y.current)}),()=>{m(null)}),[h,m]),$ae(b,s),lt.jsx(Koe,{"data-key":"body",ref:g,outerRef:y,innerRef:b,style:Uae,columnCount:o.length,columnWidth:e=>p[e],height:l,rowCount:f,rowHeight:C,estimatedRowHeight:c.estimatedRowHeight,width:a.width,itemData:P,onItemsRendered:A,itemKey:Vae,className:"sn-table-body",direction:d,children:Cae})});var Yae=Yt.memo(Gae);const Kae=({children:e})=>{const t=_g(jU),n=_g(vae);return lt.jsx("div",{"data-key":"full-size-container",style:{display:"block",width:t,height:n},children:e})},Xae=(e,t)=>{const n=Yt.useRef(null),r=_g(NU);Yt.useLayoutEffect(()=>{n.current&&t(n.current.getBoundingClientRect().height+9,e)},[t,n,e,r.length]);const i=Yt.useCallback(n=>{const r=n.contentBoxSize.at(0)?.blockSize;r&&t(r+9,e)},[e,t]);return TK({ref:n,callback:i}),n},Jae=Ul("div",{shouldForwardProp:e=>"interactions"!==e&&"hoverBackground"!==e&&"background"!==e&&"applicableStyle"!==e&&"color"!==e})(({interactions:e,hoverBackground:t,background:n,applicableStyle:r,color:i})=>({...r,background:n,color:i,"&&:hover:not(:has(button:hover))":{background:e.active?t:void 0}})),Qae=({index:e,style:t,data:n})=>{const{columns:r,columResizeHandler:i,setMeasuredCellHeight:o,onKeyDown:a,onCellClick:s}=n,l=_g(EU),c=_g(my),u=_g(sy),d=_g(WY),p=Ag(dV),f=_g(cU),h=_g(py),m=_g(NU)[e],g=_g(wy),y=_g(oX(e)),b=r[e],{open:v,setOpen:x,handleOpenMenu:w,toggleSortOrder:S}=Vie({isInteractionEnabled:h,column:b}),k=_g(ny),C=Xae(e,o),E=r.length-1===e,M=k?SK:HK,{ref:R,isDragging:_}=Yie(b,e),A=wie(b.id),I=y&&!g.enabled&&h?0:-1,P=a?t=>{a(t,e,w)}:void 0;return lt.jsxs(Jae,{"data-dragging":_,ref:R,className:`sn-table-cell ${Cm}`,title:u.passive?b.label:void 0,onClick:k?w:S,applicableStyle:{...l.header,...GY(l,f,!0)},style:{...t,cursor:"pointer",display:"flex",alignItems:"flex-end",borderStyle:"solid",borderRightWidth:nV(c,E,d),borderLeftWidth:rV(c,E,d),borderTopWidth:"0px",borderBottomWidth:"1px",padding:"4px",justifyContent:b.headTextAlign,boxSizing:"border-box",zIndex:r.length-e,flexDirection:"right"===b.headTextAlign?"row-reverse":"row",userSelect:"none",opacity:A},interactions:u,hoverBackground:b.headerColor?.headerMenuHoverBackground??l.headerMenuHoverBackground,background:k&&v?b.headerColor?.headerMenuActiveBackground??l.headerMenuActiveBackground:b.headerColor?.background??l.header.background,color:b.headerColor?.color??l.header.color,tabIndex:I,onKeyDown:P,onMouseDown:t=>{t.preventDefault(),h&&s?.(e)},"data-col":e,children:[lt.jsx(M,{forwardRef:C,column:b,isInteractionEnabled:h,open:v,setOpen:x,columnWidth:m}),lt.jsx(Bie,{column:b,isLastColumn:E,onColumnResize:i,setIsAdjustingWidth:p})]})},Zae=e=>{const[t,n]=Yt.useState(new Map);gm(()=>{n(new Map)},[e.length]);const r=Yt.useCallback((e,t)=>{n(n=>Lae(n.get(t),e)?new Map(n).set(t,e):n)},[]);return{rowHeight:Yt.useMemo(()=>qae(t),[t]),setMeasuredCellHeight:r}},ese=(e,t)=>{Yt.useImperativeHandle(e,()=>({scrollTo:e=>t.current?.scrollTo(e)}),[t])},tse=e=>{const t=_g(Py),n=_g(Yg),r=_g(ioe),i=_g(NU);gm(()=>{e.current?.resetAfterIndex(0,!1)},[n,r,e,i,t])},nse={overflow:"hidden",boxSizing:"border-box",willChange:"auto"},rse=Yt.forwardRef((e,t)=>{const{columResizeHandler:n}=e,r=_g(uU),i=_g(fae),o=Ag(lae),a=Kt.useRef(null),s=Yt.useRef(null),l=_g(MU),c=_g(Yg),u=_g(yy),d=_g(my),p=_g(NU),{rowHeight:f,setMeasuredCellHeight:h}=Zae(r),m=Fie(u,c),{handleHeadKeyDown:g,focusHeadCellOnClick:y}=Roe();return ese(t,a),tse(a),$ae(s,o),lt.jsx(rae,{className:"sn-table-head-row",ref:a,outerRef:s,layout:"horizontal",style:{...nse,...m?{display:"none"}:void 0},itemCount:r.length,itemSize:e=>p[e],height:Math.max(f+8,l),width:i.width,itemKey:e=>r[e].id,itemData:{columns:r,columResizeHandler:n,setMeasuredCellHeight:h,onKeyDown:g,onCellClick:y},direction:d,children:Qae})});var ise=Yt.memo(rse);const ose=Yt.forwardRef((e,t)=>{const{children:n,onScroll:r}=e,i=_g(my),o=_g(dy),{width:a,height:s}=_g(pae),l=Ag(coe),c=Yt.useCallback(e=>{l(e),"function"==typeof t?t(e):t&&(t.current=e)},[t,l]);return lt.jsx("div",{"data-testid":"scrollable-container",ref:c,style:{overflow:o?"auto":"hidden",width:a,height:s},onScroll:r,dir:i,tabIndex:-1,children:n})}),ase=({children:e})=>{const t=_g(my),n=_g(fae);return lt.jsx("div",{"data-testid":"sticky-container",style:{position:"sticky",top:"0px",left:"rtl"!==t?"0px":void 0,right:"rtl"===t?"0px":void 0,width:n.width,height:n.height},children:e})},sse=({index:e,style:t,data:n})=>{const{columns:r,totals:i,setMeasuredCellHeight:o,onKeyDown:a,onCellClick:s}=n,l=_g(EU),c=_g(Yg),u=_g(my),d=_g(cy),p=_g(py),f=_g(WY),h=_g(xae),m=Xae(e,o),g=r[e].totalInfo,{totalsTextAlign:y,isTotalNumeric:b}=r[e],v=c.qHyperCube.qSize.qcx-1===e,x=wie(r[e].id),w=a?t=>{a(t,e)}:void 0;return lt.jsx("div",{className:`sn-table-cell ${Cm}`,tabIndex:-1,title:d?g:void 0,"data-col":e,onKeyDown:w,onMouseDown:t=>{t.preventDefault(),p&&s?.(e)},style:{...t,...l.totalRow,...GY(l,i,!1),background:l.totalRow.background,display:"flex",alignItems:i.atTop?"end":"start",borderStyle:"solid",borderRightWidth:nV(u,v,f),borderLeftWidth:rV(u,v,f),borderTopWidth:i.atBottom?"1px":"0px",borderBottomWidth:h&&i.atBottom||i.atTop?"1px":"0px",padding:"4px 12px",justifyContent:y,textAlign:y,boxSizing:"border-box",cursor:"default",opacity:x},children:lt.jsx(wK,{forwardRef:b?void 0:m,isNumeric:b,children:g})})},lse=Yt.forwardRef((e,t)=>{const{totals:n}=e,r=_g(uU),i=_g(fae),o=Ag(cae),a=Yt.useRef(null),s=Yt.useRef(null),l=_g(RU),c=_g(my),u=_g(Yg),d=_g(NU),{rowHeight:p,setMeasuredCellHeight:f}=Zae(r),{handleTotalsKeyDown:h,focusTotalsCellOnClick:m}=Roe();return ese(t,a),tse(a),$ae(s,o),lt.jsx(rae,{className:"sn-table-totals-row",ref:a,outerRef:s,layout:"horizontal",style:nse,itemCount:u.qHyperCube.qSize.qcx,itemSize:e=>d[e],height:Math.max(p,l),width:i.width,itemData:{columns:r,totals:n,setMeasuredCellHeight:f,onKeyDown:h,onCellClick:m},direction:c,children:sse})});var cse=Yt.memo(lse);const use=(e,t,n)=>{const r=_g(my),i=_g(gW);return Yt.useCallback(o=>{const{scrollHeight:a,clientHeight:s,scrollTop:l}=o.currentTarget,c=((e,t)=>{const{scrollWidth:n,clientWidth:r,scrollLeft:i}=e,o=n-r;if("rtl"===t){if(i>o)return o;if(i<0)return Math.abs(i)}return i})(o.currentTarget,r),u=Math.max(0,Math.min(1,l/(a-s)));i.scrollTopRatio=u,i.scrollLeft=c,n.current?.interpolatedScrollTo(Number.isNaN(u)?0:u,c),e.current?.scrollTo(c),t.current?.scrollTo(c)},[i,n,e,t,r])},dse=()=>{const e=_g(cU),t=Yt.useRef(null),n=Yt.useRef(null),r=Yt.useRef(null),i=Yt.useRef(null),o=use(n,r,i),a=Yt.useCallback(()=>{t.current&&(t.current.scrollTop=0)},[t]);aX(),(e=>{const t=_g(dU),n=_g(ioe),r=_g(Py),i=_g(soe);Yt.useEffect(()=>{const t=requestAnimationFrame(()=>{e.current&&(e.current.scrollLeft=0,e.current.scrollTop=0)});return()=>{cancelAnimationFrame(t)}},[t,e]),Yt.useEffect(()=>{const t=requestAnimationFrame(()=>{e.current&&(e.current.scrollTop=0)});return()=>{cancelAnimationFrame(t)}},[n,i,r,e])})(t),mX(t);const s=lt.jsx(cse,{ref:r,totals:e},"totals");return lt.jsxs(tX,{children:[lt.jsx(ose,{ref:t,onScroll:o,children:lt.jsxs(Kae,{children:[lt.jsxs(ase,{children:[lt.jsx(ise,{ref:n,columResizeHandler:a}),e.atTop?s:null,lt.jsx(Yae,{ref:i}),e.atBottom?s:null]}),lt.jsx(UY,{})]})}),lt.jsx(GK,{isPagination:!1})]})};var pse=Yt.memo(dse);const fse=()=>{const e=_g(Yg),t=_g(Ry),n=_g(sy),{paginationNeeded:r,totalRowCount:i,totalColumnCount:o,totalPages:a}=_g(lU),s=_g(Py),l=_g(Ty),c=_g(wy),[u,d]=Ig(ioe),p=Yt.useRef(null),f=Yt.useRef(!1),h=Ag(ooe),m=Ag(aoe);Yt.useEffect(()=>{h(f)},[h]);const g=Kt.useCallback(e=>{p.current=e,m(e)},[m]),{handleWrapperKeyDown:y}=Roe();return(()=>{const e=_g(_y),{keyboard:t}=_g(goe),n=_g(iX),r=_g(cU),i=_g(soe),{scrollToCell:o}=_g(moe),{shouldRefocusRef:a}=_g(yoe),s=Yt.useRef({focusedCellCoord:n,totalsPosition:r,rowCount:i,scrollToCell:o,rootElement:e}),l=Yt.useRef(null),c=Yt.useRef(null);Yt.useLayoutEffect(()=>{s.current={focusedCellCoord:n,totalsPosition:r,rowCount:i,scrollToCell:o,rootElement:e}},[n,r,i,o,e]),Yt.useEffect(()=>{let e=!1;const{focusedCellCoord:n,totalsPosition:r,rowCount:i,scrollToCell:o,rootElement:u}=s.current;if("function"==typeof u.querySelector){if(t.active){const[t,a]=n,d=r.atTop?2:1;if(t>=d&&t<d+i){null!==c.current&&(cancelAnimationFrame(c.current),c.current=null),o?.(t-d,a);const n=t=>{if(e)return;const r=xoe(s.current.rootElement,s.current.focusedCellCoord,s.current.totalsPosition,s.current.rowCount);r&&document.activeElement!==r&&KY(r),r&&document.activeElement===r||t>0&&(l.current=requestAnimationFrame(()=>{n(t-1)}))};l.current=requestAnimationFrame(()=>{e||n(5)})}else{const e=xoe(u,n,r,i);e&&KY(e)}}else null!==l.current&&(cancelAnimationFrame(l.current),l.current=null),c.current=requestAnimationFrame(()=>{if(e)return;const t=s.current;if(a?.current)return;if(t.rootElement.contains(document.activeElement))return;const n=xoe(t.rootElement,t.focusedCellCoord,t.totalsPosition,t.rowCount);n?.blur(),Eoe(t.rootElement)});return()=>{e=!0,null!==l.current&&(cancelAnimationFrame(l.current),l.current=null),null!==c.current&&(cancelAnimationFrame(c.current),c.current=null)}}},[t.active,e,a])})(),rX(p,f),lt.jsxs(yK,{ref:g,"data-testid":"sn-table",onKeyDown:y,children:[lt.jsx(vX,{}),lt.jsx(pse,{}),lt.jsx(IY,{paginationNeeded:r,handleChangePage:e=>{d(e)},pageInfo:u,totalRowCount:i,totalColumnCount:o,totalPages:a,keyboard:c,translator:l,theme:s,interactions:n,rect:t,layout:e})]})};var hse=Yt.memo(fse);const mse=t=>{const n=t.get(Sy),r=t.get(vy),i=t.get(Gg),o=t.get(my);e.useEffect(()=>{i&&n&&(r?function(e){const t=e.get(my),n=e.get(Iy),r=FU(t);n.render(lt.jsx(Oi,{stylisPlugins:"rtl"===t?[VB]:void 0,children:lt.jsx(Yl,{theme:r,children:lt.jsx(Sg,{store:e,children:lt.jsx(zU,{children:lt.jsx(Zie,{})})})})}))}(t):function(e){const t=e.get(my),n=e.get(Iy),r=FU(t);n.render(lt.jsx(Kt.StrictMode,{children:lt.jsx(Yl,{theme:r,children:lt.jsx(Sg,{store:e,children:lt.jsx(zU,{children:lt.jsx(hse,{})})})})}))}(t))},[i,r,t,n,o])};function gse(e,t){const n=e.getElementsByClassName("sn-table-container")[0];if(!n)return{};const r=n.getBoundingClientRect(),i=e.getElementsByClassName("sn-table-head-row")[0],o=i?.getBoundingClientRect()??{height:0},a=e.getElementsByClassName("sn-table-totals-row")[0],s=a?.getBoundingClientRect()??{height:0},l=e.getElementsByClassName("sn-table-data-row"),c={top:r.y+o.height+(t.atTop?s.height:0),bottom:r.y+r.height-(t.atBottom?s.height:0)},u=((e,t)=>{if(!e)return-1;for(let n=0;n<e.length;n++)if(e[n].getBoundingClientRect().bottom>t.top)return n;return-1})(l,c),d=((e,t)=>{if(!e)return-1;for(let n=e.length-1;n>-1;n--){const r=e[n].getBoundingClientRect();if(t.bottom>r.top)return n}return-1})(l,c),p=((e,t,n)=>{if(!e||0===e.length||n<0)return 0;const r=e[n].getBoundingClientRect();return Math.max(t.top-r.top,0)})(l,c,u);return{visibleRowStartIndex:u,visibleRowEndIndex:d,rowPartialHeight:p}}const yse=(e,t)=>{if(t)for(let n=0;n<t.length;n++){const r=t[n].getAttribute("rowindex");if(r&&parseInt(r,10)===e)return t[n]}},bse=(e,t,n)=>{if(!e)return!1;const r=e.y+e.height/2;return r>=t&&r<=n};const vse=(e,t,n,r,i)=>{if(e<0)return 0;const o=n.qHyperCube.qSize.qcy,a=r.rowsPerPage||JW.rowsPerPage,s=i?.isMultiPage?0:3;return Math.min(o,a,e-t+1+s)},xse=(e,t,n,r,i)=>{if(r&&!r.isMultiPage)return r;const o=$W(e,r);if(i){const{visibleRowStartIndex:i=-1,visibleRowEndIndex:a=-1,rowPartialHeight:s}=gse(n,o);return{rowPartialHeight:s,scrollLeft:t.scrollLeft,visibleTop:t.qTop+i,visibleHeight:vse(a,i,e,t,r),rowsPerPage:t.rowsPerPage,page:t.page,totalsPosition:o}}const{visibleRowStartIndex:a=-1,visibleRowEndIndex:s=-1}=function(e,t){const n=e.querySelector(".sn-table-body"),r=n?.getBoundingClientRect(),i=n?.querySelectorAll(".sn-table-body .sn-table-cell");if(!i||!r)return{};const{scrollTopRatio:o=0,visibleTop:a=0,visibleHeight:s=0,page:l=0,rowsPerPage:c=0}=t,u=l*c,d=a-u,p=d+s-1,f=yse(d,i),h=f?.getBoundingClientRect();if(!f||!h)return{};const m=r.y;if(1-o<.001)return{visibleRowStartIndex:d+(h.y>=m-4?0:1)+u,visibleRowEndIndex:p+u};const g=r.y+r.height,y=(bse(h,m,g)?d:d+1)+u;let b=p+u;const v=yse(p,i),x=v?.getBoundingClientRect();return v&&x&&(bse(x,m,g)||(b=p-1+u)),{visibleRowStartIndex:y,visibleRowEndIndex:b}}(n,t);return{scrollLeft:t.scrollLeft,visibleLeft:t.visibleLeft,visibleWidth:t.visibleWidth,visibleTop:a,visibleHeight:vse(s,a,e,t,r),scrollTopRatio:t.scrollTopRatio,rowsPerPage:t.rowsPerPage,page:t.page,totalsPosition:o}},wse={version:JSON.stringify("6.65.0"),qHyperCubeDef:{qDimensions:[],qMeasures:[],qColumnOrder:[],qInitialDataFetch:[{qWidth:50,qHeight:100}]},showTitles:!0,enableChartExploration:!1,title:"",subtitle:"",footnote:"",totals:{show:!0,position:"noTotals"},usePagination:!1,components:[],accessibleHeader:!1};var Sse=e=>({properties:{initial:wse},data:{targets:[{path:"/qHyperCubeDef",dimensions:{min:0,max:1e3},measures:{min:0,max:1e3}}]},importProperties:t=>Zy({...t,env:e}),exportProperties:Gy,exploration:NF(e)});const kse=e=>e.getStyle("","","object.straightTableV2.backgroundColor"),Cse=e=>e.getStyle("object","straightTableV2","backgroundColor");return function(t){return{qae:Sse(t),ext:rB(t),component(){const n=e.useStaleLayout(),r=e.useMemo(()=>vg(),[!1!==n.usePagination]);r.set(Vg,t);const i=e.useElement();r.set(_y,i),r.set(Yg,n),r.set(Pg,e.useApp()),r.set(Sy,e.useModel()),r.set(sy,e.useInteractionState()),r.set(Ty,e.useTranslator()),r.set(oy,e.useSelections()),r.set(hy,e.useOptions()),r.set(wy,e.useKeyboard()),r.set(Ry,e.useRect()),r.set(Dg,e.useEmbed());const o=om(n,i,kse,Cse);r.set(Py,o),r.set(Gg,mm(o,n,t)),r.set(Tg,Le()),(t=>{const n=t.get(Iy);e.useEffect(()=>()=>{n.unmount()},[n])})(r),e.onContextMenu?.((e,t)=>{const n=t.target,r=n?.closest(`.${Cm}`);r?.title&&e.addItem({translation:"contextMenu.copyCellValue",icon:"lui-icon lui-icon--copy",tid:"copy-cell-context-item",id:"copy-cell-context-item",select:()=>{Om(r)}})}),(({store:t})=>{const n=t.get(Yg),r=t.get(Sy),i=t.get(_y),o=t.get(My),a=t.get(yy),s=t.get(vy);e.onTakeSnapshot(async e=>{const l=e;if(!l.snapshotData||!r||l.snapshotData.content)return l;if("getHyperCubeData"in r){const e=t.get(gW),{rowPartialHeight:c,scrollLeft:u,scrollTopRatio:d,visibleLeft:p,visibleWidth:f,visibleTop:h,visibleHeight:m,rowsPerPage:g,page:y}=xse(n,e,i,a,s);l.qHyperCube.qDataPages=await r.getHyperCubeData("/qHyperCubeDef",[{qLeft:0,qTop:h,qWidth:n.qHyperCube.qSize.qcx,qHeight:m}]),l.snapshotData.content={rowPartialHeight:c,scrollLeft:u,scrollTopRatio:d,visibleLeft:p,visibleWidth:f,visibleTop:h,visibleHeight:m,rowsPerPage:g,page:y,size:{width:o.width,height:o.height},estimatedRowHeight:e.estimatedRowHeight}}return l}),e.useImperativeHandle(()=>({getViewState:()=>xse(n,t.get(gW),i,a,s)}),[n,t,i,s])})({store:r}),mse(r)}}}});
|
|
141
|
+
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,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\-\+#]/),y=p-g,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),x=g>0?e.substring(v,p):"";if(n=(t="-"===(e=e.substring(f,v)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0===+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(d=t[0]).length%l,p=d.length,v=0;v<p;v++)m+=d.charAt(v),!((v-y+1)%l)&&v<p-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),h+(n?"-":"")+r+x}});function zJ(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const FJ={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},$J=/%\)?$/,BJ=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,HJ=/^\(oct\)/i,VJ=/^\(dec\)/i,WJ=/^\(hex\)/i,UJ=/^\(bin\)/i,GJ=/^\(rom\)/i,YJ=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,KJ=/#|0/g;function XJ(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function JJ(e,t,n){let r;return BJ.test(t)?e=XJ(e,Number(/\d{2}/.exec(t)[0]),t,n):HJ.test(t)?e=XJ(e,8,t,n):VJ.test(t)?e=XJ(e,10,t,n):WJ.test(t)?e=XJ(e,16,t,n):UJ.test(t)?e=XJ(e,2,t,n):GJ.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}function QJ(e,t,n){const r=zJ(e);return n?r:new RegExp(r||"",t)}function ZJ(e,t,n,r){let i,o,a,s,l,c,u,d,p,f=e.pattern;var h,m;r&&(e.abbreviate=!0),h=t,(m=n)&&(m=zJ(m)),h&&(h=zJ(h)),p=new RegExp("(?:[#0]+".concat(h,")?[#0]+(?:").concat(m,"[#0]+)?")),a=f.match(p),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(QJ(c,"g"),t)),u=n,n=".",u&&(a=a.replace(QJ(u,"g"),n)),d=a.match(/#/g),d=d?d.length:0;const g=f.split(u);let y;g[1]&&(y=g[1].match(KJ)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=y?y.length:2,e.percentage=$J.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(QJ(t,null,!0),"|").concat(QJ(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class eQ{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return FJ;const n={};return e.qNumericalAbbreviation.split(t).forEach(e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])}),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new eQ(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],YJ.test(e[0])&&(r.positive.isFunctional=!0),e[1]?YJ.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?YJ.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||ZJ(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&ZJ(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&ZJ(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,c,u=this._prepared,d="",p="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,a=u.t,u.isFunctional)e=JJ(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=jJ(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),p=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=jJ(l,e)}e=e.replace(u.numericRegex,e=>e===a?u.groupTemp:e===o?u.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+p+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function tQ(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=t.size,r=void 0===n?5e3:n,i=t.multipleArguments,o=void 0!==i&&i,a=t.toKey,s=void 0===a?e=>e:a;let l,c,u=Object.create(null),d=Object.create(null),p=0,f=0;return l=o?function(){return c=s(...arguments),l.has(c)?l.get(c):l.set(c,e(...arguments))}:t=>(c=s(t),l.has(c)?l.get(c):l.set(c,e(t))),l.set=(e,t)=>(p>=r&&(delete u[d[f]],delete d[f],p--,f++),u[e]=t,d[p]=e,p++,t),l.get=e=>u[e],l.has=e=>e in u,l.clear=()=>{u=Object.create(null),d=Object.create(null),p=0,f=0},l.size=()=>p,l}function nQ(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new eQ(...t)}(i,e,t,n,r),a=tQ(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const rQ="D",iQ="T",oQ="TS",aQ="IV",sQ=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],lQ=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],cQ=["January","February","March","April","May","June","July","August","September","October","November","December"],uQ=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function dQ(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function pQ(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function fQ(e,t){let n,r=function(e){const t=e,n=24*pQ(t),r=60*pQ(n),i=60*pQ(r),o=1e3*pQ(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:a,s:s,f:l,t:u}}class hQ{constructor(e,t,n){const r=e||{};if(r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:sQ,qDayNames:lQ,qLongMonthNames:cQ,qMonthNames:uQ}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),!t){t={[iQ]:r.qTimeFmt||"hh:mm:ss",[rQ]:r.qDateFmt||"YYYY-MM-DD",[oQ]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new hQ(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),r=fQ(e,t));const i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:dQ("".concat(t.year).slice(-2),2),YYY:dQ("".concat(t.year).slice(-3),3),def:e=>dQ("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:dQ("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:dQ("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>dQ("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>dQ("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>dQ("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>dQ("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const a=new RegExp(o.join("|"),"g"),s=t.replace(a,e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r});return s}}function mQ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new hQ(...t)}function gQ(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=mQ(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=tQ(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==aQ?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=mQ(i,e,t),r=tQ(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function yQ(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.meta,r=t.id,i=t.key,o=t.localeInfo,a=t.fieldExtractor,s=t.value,l=t.type,c=t.sourceField;const u=s||("dimension"===l?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),d="dimension"===l?"first":"avg",p=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return gQ(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),nQ(n,r,i,o,t)}(n,o),f="dimension"===l?"first":(e,t)=>p(t),h={id:()=>r,key:()=>i,raw:()=>n,title:()=>n.qFallbackTitle||n.label,type:()=>l,origin:()=>c,items:()=>(e||(e=a(h)),e),min:()=>n.qMin,max:()=>n.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:d,reduceLabel:f,formatter:()=>p,tags:()=>n.qTags};return h}function bQ(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:yQ(tJ({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=bQ("qAttrDimInfo",t,n,a,tJ({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=bQ("qAttrExprInfo",t,n,a,tJ({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=bQ("qMeasureInfo",t,n,a,tJ({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s})}function vQ(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=e.data,r=e.config,i=void 0===r?{}:r;const o={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},a=n;if(!a)throw new Error('Missing "data" input');if(!a.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=vQ.util,l={cache:o,cube:a,localeInfo:i.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:i.virtualFields},c={key:()=>t,raw:()=>a,field:e=>function(e,t){let n=t.cache;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,l),fields:()=>o.fields.slice(),extract:e=>l.extractor(e,c,o,s),hierarchy:e=>l.hierarchy(e,c,o,s),_cache:()=>o};"K"===a.qMode||"T"===a.qMode||!a.qMode&&a.qNodesOnDim?(l.extractor=LJ,l.hierarchy=qJ,l.pages="K"===a.qMode?a.qStackedDataPages:a.qTreeDataPages):"S"===a.qMode?(l.extractor=oJ,l.pages=a.qDataPages,l.hierarchy=qJ):l.extractor=()=>[],l.fieldExtractor=e=>l.extractor({field:e},c,o,s);const u="S"===a.qMode?e=>e.qElemNumber:void 0,d="S"===a.qMode?e=>e.qNum:void 0;o.wrappedFields.push(...bQ("qDimensionInfo",a,t,"",tJ({},l,{value:u,type:"dimension"}))),o.wrappedFields.push(...bQ("qMeasureInfo",a,t,"",tJ({},l,{value:d,type:"measure"}))),o.fields=o.wrappedFields.map(e=>e.instance);const p=e=>{e.forEach(e=>{o.allFields.push(e.instance),p(e.measures),p(e.attrDims),p(e.attrExps)})};return p(o.wrappedFields),(i.virtualFields||[]).forEach(e=>{const n=c.field(e.from),r=yQ(WX({meta:n.raw(),id:"".concat(t,"/").concat(e.key),sourceField:n,fieldExtractor:e=>l.extractor({field:e},c,o,s),key:e.key,type:n.type(),localeInfo:l.localeInfo,value:n.value},e.override||{}));o.virtualFields.push(r)}),o.allFields.push(...o.virtualFields),c}const xQ=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],wQ=/\/qDimensionInfo(?:\/(\d+))?/,SQ=/\/qMeasureInfo\/(\d+)/,kQ=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,CQ=/\/qAttrExprInfo\/(\d+)/,EQ=/\/?qHyperCube/,MQ=/\/?qTreeData/,RQ=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),_Q=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function AQ(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;if(e.brushes().forEach(e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;EQ.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=RQ):MQ.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=_Q);let s=!0;if(wQ.test(e)&&(r=+wQ.exec(e)[1]),SQ.test(e)&&(i=+SQ.exec(e)[1]),kQ.test(e)){i=-1,r=0;const e=+kQ.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(CQ.test(e)){const e=i;if(t){i=0;const a=SJ(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=a.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=a.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+CQ.exec(n)[1]}else r>-1?(r=-1,i=+CQ.exec(n)[1]):i+=+CQ.exec(n)[1]+1}return xQ.forEach(e=>{let t=UX(e,2),r=t[0],i=t[1];n=n.replace(r,i)}),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach(e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach(e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach(e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));(0===o||s>=o)&&o>-1?n.forEach(e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})}):n.forEach(e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})}),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map(e=>+e).filter(e=>!isNaN(e)),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}}),!l&&s)return[{method:"resetMadeSelections",params:[]}];var c;a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]});return a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o}function IQ(e){vQ.util=e.data("matrix").util,e.data("q",vQ),e.formatter("q-number",nQ),e.formatter("q-time",gQ)}IQ.qBrushHelper=AQ,IQ.selections=AQ;var PQ=Object.prototype.hasOwnProperty,TQ=Object.prototype.toString,DQ=Object.defineProperty,OQ=Object.getOwnPropertyDescriptor,NQ=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===TQ.call(e)},qQ=function(e){if(!e||"[object Object]"!==TQ.call(e))return!1;var t,n=PQ.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&PQ.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||PQ.call(e,t)},LQ=function(e,t){DQ&&"__proto__"===t.name?DQ(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},jQ=function(e,t){if("__proto__"===t){if(!PQ.call(e,t))return;if(OQ)return OQ(e,t).value}return e[t]},zQ=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=jQ(s,n),s!==(i=jQ(t,n))&&(u&&i&&(qQ(i)||(o=NQ(i)))?(o?(o=!1,a=r&&NQ(r)?r:[]):a=r&&qQ(r)?r:{},LQ(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&LQ(s,{name:n,newValue:i}));return s},FQ="2.11.7";function $Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function BQ(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function VQ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?HQ(Object(n),!0).forEach(function(t){BQ(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HQ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function WQ(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return $Q(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$Q(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function UQ(e){return!!e.changedTouches}function GQ(e){return"number"==typeof e&&!isNaN(e)}function YQ(e){return"number"!=typeof e||isNaN(e)}function KQ(e){const t=e.length;let n=NaN,r=NaN,i=NaN,o=NaN;for(let a=0;a<t;a++)n=isNaN(n)?e[a].x:Math.min(n,e[a].x),r=isNaN(r)?e[a].x:Math.max(r,e[a].x),i=isNaN(i)?e[a].y:Math.min(i,e[a].y),o=isNaN(o)?e[a].y:Math.max(o,e[a].y);return[n,i,r,o]}function XQ(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function JQ(e){return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}]}function QQ(e){const t=WQ(KQ(e),4),n=t[0],r=t[1];return{x:n,y:r,width:t[2]-n,height:t[3]-r}}function ZQ(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function eZ(e){const t=e||{},n=t.x,r=t.y,i=t.width,o=t.height,a=t.x1,s=t.x2,l=t.y1,c=t.y2,u=t.cx,d=t.cy,p=t.r,f=t.vertices;return GQ(u)&&GQ(d)&&GQ(p)?"circle":GQ(a)&&GQ(s)&&GQ(l)&&GQ(c)?"line":GQ(n)&&GQ(r)&&GQ(i)&&GQ(o)?"rect":GQ(n)&&GQ(r)?"point":Array.isArray(f)?f.every(e=>Array.isArray(e))?"geopolygon":"polygon":null}function tZ(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}function nZ(e){return function(){return e}}const rZ=Math.abs,iZ=Math.atan2,oZ=Math.cos,aZ=Math.max,sZ=Math.min,lZ=Math.sin,cZ=Math.sqrt,uZ=1e-12,dZ=Math.PI,pZ=dZ/2,fZ=2*dZ;function hZ(e){return e>=1?pZ:e<=-1?-pZ:Math.asin(e)}const mZ=Math.PI,gZ=2*mZ,yZ=1e-6,bZ=gZ-yZ;function vZ(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class xZ{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?vZ:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return vZ;const n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,o){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+o}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let o=this._x1,a=this._y1,s=n-e,l=r-t,c=o-e,u=a-t,d=c*c+u*u;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(d>yZ)if(Math.abs(u*s-l*c)>yZ&&i){let p=n-o,f=r-a,h=s*s+l*l,m=p*p+f*f,g=Math.sqrt(h),y=Math.sqrt(d),b=i*Math.tan((mZ-Math.acos((h+d-m)/(2*g*y)))/2),v=b/y,x=b/g;Math.abs(v-1)>yZ&&this._append`L${e+v*c},${t+v*u}`,this._append`A${i},${i},0,0,${+(u*p>c*f)},${this._x1=e+x*s},${this._y1=t+x*l}`}else this._append`L${this._x1=e},${this._y1=t}`;else;}arc(e,t,n,r,i,o){if(e=+e,t=+t,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),l=e+a,c=t+s,u=1^o,d=o?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>yZ||Math.abs(this._y1-c)>yZ)&&this._append`L${l},${c}`,n&&(d<0&&(d=d%gZ+gZ),d>bZ?this._append`A${n},${n},0,1,${u},${e-a},${t-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:d>yZ&&this._append`A${n},${n},0,${+(d>=mZ)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function wZ(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new xZ(t)}function SZ(e){return e.innerRadius}function kZ(e){return e.outerRadius}function CZ(e){return e.startAngle}function EZ(e){return e.endAngle}function MZ(e){return e&&e.padAngle}function RZ(e,t,n,r,i,o,a){var s=e-n,l=t-r,c=(a?o:-o)/cZ(s*s+l*l),u=c*l,d=-c*s,p=e+u,f=t+d,h=n+u,m=r+d,g=(p+h)/2,y=(f+m)/2,b=h-p,v=m-f,x=b*b+v*v,w=i-o,S=p*m-h*f,k=(v<0?-1:1)*cZ(aZ(0,w*w*x-S*S)),C=(S*v-b*k)/x,E=(-S*b-v*k)/x,M=(S*v+b*k)/x,R=(-S*b+v*k)/x,_=C-g,A=E-y,I=M-g,P=R-y;return _*_+A*A>I*I+P*P&&(C=M,E=R),{cx:C,cy:E,x01:-u,y01:-d,x11:C*(i/w-1),y11:E*(i/w-1)}}function _Z(){var e=SZ,t=kZ,n=nZ(0),r=null,i=CZ,o=EZ,a=MZ,s=null,l=wZ(c);function c(){var c,u,d=+e.apply(this,arguments),p=+t.apply(this,arguments),f=i.apply(this,arguments)-pZ,h=o.apply(this,arguments)-pZ,m=rZ(h-f),g=h>f;if(s||(s=c=l()),p<d&&(u=p,p=d,d=u),p>uZ)if(m>fZ-uZ)s.moveTo(p*oZ(f),p*lZ(f)),s.arc(0,0,p,f,h,!g),d>uZ&&(s.moveTo(d*oZ(h),d*lZ(h)),s.arc(0,0,d,h,f,g));else{var y,b,v=f,x=h,w=f,S=h,k=m,C=m,E=a.apply(this,arguments)/2,M=E>uZ&&(r?+r.apply(this,arguments):cZ(d*d+p*p)),R=sZ(rZ(p-d)/2,+n.apply(this,arguments)),_=R,A=R;if(M>uZ){var I=hZ(M/d*lZ(E)),P=hZ(M/p*lZ(E));(k-=2*I)>uZ?(w+=I*=g?1:-1,S-=I):(k=0,w=S=(f+h)/2),(C-=2*P)>uZ?(v+=P*=g?1:-1,x-=P):(C=0,v=x=(f+h)/2)}var T=p*oZ(v),D=p*lZ(v),O=d*oZ(S),N=d*lZ(S);if(R>uZ){var q,L=p*oZ(x),j=p*lZ(x),z=d*oZ(w),F=d*lZ(w);if(m<dZ)if(q=function(e,t,n,r,i,o,a,s){var l=n-e,c=r-t,u=a-i,d=s-o,p=d*l-u*c;if(!(p*p<uZ))return[e+(p=(u*(t-o)-d*(e-i))/p)*l,t+p*c]}(T,D,z,F,L,j,O,N)){var $=T-q[0],B=D-q[1],H=L-q[0],V=j-q[1],W=1/lZ(function(e){return e>1?0:e<-1?dZ:Math.acos(e)}(($*H+B*V)/(cZ($*$+B*B)*cZ(H*H+V*V)))/2),U=cZ(q[0]*q[0]+q[1]*q[1]);_=sZ(R,(d-U)/(W-1)),A=sZ(R,(p-U)/(W+1))}else _=A=0}C>uZ?A>uZ?(y=RZ(z,F,T,D,p,A,g),b=RZ(L,j,O,N,p,A,g),s.moveTo(y.cx+y.x01,y.cy+y.y01),A<R?s.arc(y.cx,y.cy,A,iZ(y.y01,y.x01),iZ(b.y01,b.x01),!g):(s.arc(y.cx,y.cy,A,iZ(y.y01,y.x01),iZ(y.y11,y.x11),!g),s.arc(0,0,p,iZ(y.cy+y.y11,y.cx+y.x11),iZ(b.cy+b.y11,b.cx+b.x11),!g),s.arc(b.cx,b.cy,A,iZ(b.y11,b.x11),iZ(b.y01,b.x01),!g))):(s.moveTo(T,D),s.arc(0,0,p,v,x,!g)):s.moveTo(T,D),d>uZ&&k>uZ?_>uZ?(y=RZ(O,N,L,j,d,-_,g),b=RZ(T,D,z,F,d,-_,g),s.lineTo(y.cx+y.x01,y.cy+y.y01),_<R?s.arc(y.cx,y.cy,_,iZ(y.y01,y.x01),iZ(b.y01,b.x01),!g):(s.arc(y.cx,y.cy,_,iZ(y.y01,y.x01),iZ(y.y11,y.x11),!g),s.arc(0,0,d,iZ(y.cy+y.y11,y.cx+y.x11),iZ(b.cy+b.y11,b.cx+b.x11),g),s.arc(b.cx,b.cy,_,iZ(b.y11,b.x11),iZ(b.y01,b.x01),!g))):s.arc(0,0,d,S,w,g):s.lineTo(O,N)}else s.moveTo(0,0);if(s.closePath(),c)return s=null,c+""||null}return c.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-dZ/2;return[oZ(r)*n,lZ(r)*n]},c.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:nZ(+t),c):e},c.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:nZ(+e),c):t},c.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:nZ(+e),c):n},c.padRadius=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:nZ(+e),c):r},c.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:nZ(+e),c):i},c.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:nZ(+e),c):o},c.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:nZ(+e),c):a},c.context=function(e){return arguments.length?(s=null==e?null:e,c):s},c}function AZ(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function IZ(e){this._context=e}function PZ(e){return new IZ(e)}function TZ(e){return e[0]}function DZ(e){return e[1]}function OZ(e,t,n){var r=null,i=nZ(!0),o=null,a=PZ,s=null,l=wZ(c);function c(c){var u,d,p,f,h,m=(c=AZ(c)).length,g=!1,y=new Array(m),b=new Array(m);for(null==o&&(s=a(h=l())),u=0;u<=m;++u){if(!(u<m&&i(f=c[u],u,c))===g)if(g=!g)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),p=u-1;p>=d;--p)s.point(y[p],b[p]);s.lineEnd(),s.areaEnd()}g&&(y[u]=+e(f,u,c),b[u]=+t(f,u,c),s.point(r?+r(f,u,c):y[u],n?+n(f,u,c):b[u]))}if(h)return s=null,h+""||null}function u(){return function(e,t){var n=nZ(!0),r=null,i=PZ,o=null,a=wZ(s);function s(s){var l,c,u,d=(s=AZ(s)).length,p=!1;for(null==r&&(o=i(u=a())),l=0;l<=d;++l)!(l<d&&n(c=s[l],l,s))===p&&((p=!p)?o.lineStart():o.lineEnd()),p&&o.point(+e(c,l,s),+t(c,l,s));if(u)return o=null,u+""||null}return e="function"==typeof e?e:void 0===e?TZ:nZ(e),t="function"==typeof t?t:void 0===t?DZ:nZ(t),s.x=function(t){return arguments.length?(e="function"==typeof t?t:nZ(+t),s):e},s.y=function(e){return arguments.length?(t="function"==typeof e?e:nZ(+e),s):t},s.defined=function(e){return arguments.length?(n="function"==typeof e?e:nZ(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,null!=r&&(o=i(r)),s):i},s.context=function(e){return arguments.length?(null==e?r=o=null:o=i(r=e),s):r},s}().defined(i).curve(a).context(o)}return e="function"==typeof e?e:void 0===e?TZ:nZ(+e),t="function"==typeof t?t:nZ(void 0===t?0:+t),n="function"==typeof n?n:void 0===n?DZ:nZ(+n),c.x=function(t){return arguments.length?(e="function"==typeof t?t:nZ(+t),r=null,c):e},c.x0=function(t){return arguments.length?(e="function"==typeof t?t:nZ(+t),c):e},c.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:nZ(+e),c):r},c.y=function(e){return arguments.length?(t="function"==typeof e?e:nZ(+e),n=null,c):t},c.y0=function(e){return arguments.length?(t="function"==typeof e?e:nZ(+e),c):t},c.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:nZ(+e),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(e){return arguments.length?(i="function"==typeof e?e:nZ(!!e),c):i},c.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),c):a},c.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),c):o},c}function NZ(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function qZ(e){return e}function LZ(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function jZ(e){this._context=e}function zZ(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function FZ(e,t){this._context=e,this._k=(1-t)/6}IZ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},jZ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:LZ(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:LZ(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},FZ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:zZ(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:zZ(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var $Z=function e(t){function n(e){return new FZ(e,t)}return n.tension=function(t){return e(+t)},n}(0);function BZ(e,t){this._context=e,this._alpha=t}BZ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>uZ){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>uZ){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var HZ=function e(t){function n(e){return t?new BZ(e,t):new FZ(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function VZ(e){return e<0?-1:1}function WZ(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(VZ(o)+VZ(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function UZ(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function GZ(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function YZ(e){this._context=e}function KZ(e){this._context=new XZ(e)}function XZ(e){this._context=e}function JZ(e){this._context=e}function QZ(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/o[t-1],o[t]-=n,a[t]-=n*a[t-1];for(i[r-1]=a[r-1]/o[r-1],t=r-2;t>=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function ZZ(e,t){this._context=e,this._t=t}function e0(e,t){if((i=e.length)>1)for(var n,r,i,o=1,a=e[t[0]],s=a.length;o<i;++o)for(r=a,a=e[t[o]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function t0(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function n0(e,t){return e[t]}function r0(e){const t=[];return t.key=e,t}function i0(e){for(var t,n=-1,r=0,i=e.length,o=-1/0;++n<i;)(t=+e[n][1])>o&&(o=t,r=n);return r}function o0(e){for(var t,n=0,r=-1,i=e.length;++r<i;)(t=+e[r][1])&&(n+=t);return n}function a0(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",r=arguments.length>2?arguments[2]:void 0;const i={},o=e||{get:()=>{},has:()=>!1,default:()=>{}};function a(e,t){if(!e||"string"!=typeof e)throw new TypeError("Invalid argument: key must be a non-empty string");return!(e in i)&&(i[e]=t,!0)}function s(e){return i[e]||o.get(e)}function l(e,i){if(void 0!==i)return a(e,i);const o=s(e);return r&&void 0===o&&r.warn("".concat(e," does not exist in ").concat(n," registry")),o||s(t)}return t=o.default(),l.add=a,l.get=s,l.has=function(e){return!!i[e]||o.has(e)},l.remove=function(e){const t=i[e];return delete i[e],t},l.getKeys=function(){return Object.keys(i)},l.getValues=function(){return Object.keys(i).map(e=>i[e])},l.default=function(e){return void 0!==e&&(t=e),t},l.register=a,l}function s0(e,t){if(!isFinite(e)||0===e)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function l0(e){return(e=s0(Math.abs(e)))?e[1]:NaN}YZ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:GZ(this,this._t0,UZ(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,GZ(this,UZ(this,n=WZ(this,e,t)),n);break;default:GZ(this,this._t0,n=WZ(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(KZ.prototype=Object.create(YZ.prototype)).point=function(e,t){YZ.prototype.point.call(this,t,e)},XZ.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}},JZ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=QZ(e),i=QZ(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[a],t[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},ZZ.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var c0,u0=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function d0(e){if(!(t=u0.exec(e)))throw new Error("invalid format: "+e);var t;return new p0({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function p0(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function f0(e,t){var n=s0(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}d0.prototype=p0.prototype,p0.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var h0={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>f0(100*e,t),r:f0,s:function(e,t){var n=s0(e,t);if(!n)return c0=void 0,e.toPrecision(t);var r=n[0],i=n[1],o=i-(c0=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+s0(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function m0(e){return e}var g0,y0,b0,v0=Array.prototype.map,x0=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function w0(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?m0:(t=v0.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,s=t[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?m0:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(v0.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function d(e,t){var n=(e=d0(e)).fill,d=e.align,p=e.sign,f=e.symbol,h=e.zero,m=e.width,g=e.comma,y=e.precision,b=e.trim,v=e.type;"n"===v?(g=!0,v="g"):h0[v]||(void 0===y&&(y=12),b=!0,v="g"),(h||"0"===n&&"="===d)&&(h=!0,n="0",d="=");var x=(t&&void 0!==t.prefix?t.prefix:"")+("$"===f?i:"#"===f&&/[boxX]/.test(v)?"0"+v.toLowerCase():""),w=("$"===f?o:/[%p]/.test(v)?l:"")+(t&&void 0!==t.suffix?t.suffix:""),S=h0[v],k=/[defgprs%]/.test(v);function C(e){var t,i,o,l=x,f=w;if("c"===v)f=S(e)+f,e="";else{var C=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:S(Math.abs(e),y),b&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),C&&0===+e&&"+"!==p&&(C=!1),l=(C?"("===p?p:c:"-"===p||"("===p?"":p)+l,f=("s"!==v||isNaN(e)||void 0===c0?"":x0[8+c0/3])+f+(C&&"("===p?")":""),k)for(t=-1,i=e.length;++t<i;)if(48>(o=e.charCodeAt(t))||o>57){f=(46===o?a+e.slice(t+1):e.slice(t))+f,e=e.slice(0,t);break}}g&&!h&&(e=r(e,1/0));var E=l.length+e.length+f.length,M=E<m?new Array(m-E+1).join(n):"";switch(g&&h&&(e=r(M+e,M.length?m-f.length:1/0),M=""),d){case"<":e=l+e+f+M;break;case"=":e=l+M+e+f;break;case"^":e=M.slice(0,E=M.length>>1)+l+e+f+M.slice(E);break;default:e=M+l+e+f}return s(e)}return y=void 0===y?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),C.toString=function(){return e+""},C}return{format:d,formatPrefix:function(e,t){var n=3*Math.max(-8,Math.min(8,Math.floor(l0(t)/3))),r=Math.pow(10,-n),i=d(((e=d0(e)).type="f",e),{suffix:x0[8+n/3]});return function(e){return i(r*e)}}}}!function(e){g0=w0(e),y0=g0.format,b0=g0.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const S0=new Date,k0=new Date;function C0(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(s<n&&n<r);return a},i.filter=n=>C0(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(S0.setTime(+t),k0.setTime(+r),e(S0),e(k0),Math.floor(n(S0,k0))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i:null)),i}const E0=6e4,M0=864e5,R0=6048e5,_0=C0(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*E0)/M0,e=>e.getDate()-1);_0.range;const A0=C0(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/M0,e=>e.getUTCDate()-1);A0.range;const I0=C0(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/M0,e=>Math.floor(e/M0));function P0(e){return C0(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*E0)/R0)}I0.range;const T0=P0(0),D0=P0(1),O0=P0(2),N0=P0(3),q0=P0(4),L0=P0(5),j0=P0(6);function z0(e){return C0(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/R0)}T0.range,D0.range,O0.range,N0.range,q0.range,L0.range,j0.range;const F0=z0(0),$0=z0(1),B0=z0(2),H0=z0(3),V0=z0(4),W0=z0(5),U0=z0(6);F0.range,$0.range,B0.range,H0.range,V0.range,W0.range,U0.range;const G0=C0(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());G0.every=e=>isFinite(e=Math.floor(e))&&e>0?C0(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null,G0.range;const Y0=C0(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());function K0(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function X0(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function J0(e){let t,n,r;function i(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<0?i=t+1:o=t}while(i<o)}return i}return 2!==e.length?(t=K0,n=(t,n)=>K0(e(t),n),r=(t,n)=>e(t)-n):(t=e===K0||e===X0?e:Q0,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<=0?i=t+1:o=t}while(i<o)}return i}}}function Q0(){return 0}Y0.every=e=>isFinite(e=Math.floor(e))&&e>0?C0(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null,Y0.range;const Z0=J0(K0).right;J0(function(e){return null===e?NaN:+e}).center;var e1=Z0;class t1 extends Map{constructor(e,t=r1){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(n1(this,e))}has(e){return super.has(n1(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const r=t(n);e.has(r)&&(n=e.get(r),e.delete(r));return n}(this,e))}}function n1({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function r1(e){return null!==e&&"object"==typeof e?e.valueOf():e}const i1=Math.sqrt(50),o1=Math.sqrt(10),a1=Math.sqrt(2);function s1(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=i1?10:o>=o1?5:o>=a1?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(e*c),l=Math.round(t*c),s/c<e&&++s,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(e/c),l=Math.round(t/c),s*c<e&&++s,l*c>t&&--l),l<s&&.5<=n&&n<2?s1(e,t,2*n):[s,l,c]}function l1(e,t,n){return s1(e=+e,t=+t,n=+n)[2]}function c1(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function u1(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function d1(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function p1(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,c=v1(i),u=x1(i),d=v1(o),p=x1(o),f=v1(a),h=x1(a),m=v1(s),g=x1(s),y=v1(l),b=x1(l),v={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:$1,e:$1,f:U1,g:r2,G:o2,H:B1,I:H1,j:V1,L:W1,m:G1,M:Y1,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:_2,s:A2,S:K1,u:X1,U:J1,V:Z1,w:e2,W:t2,x:null,X:null,y:n2,Y:i2,Z:a2,"%":R2},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:s2,e:s2,f:p2,g:k2,G:E2,H:l2,I:c2,j:u2,L:d2,m:f2,M:h2,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:_2,s:A2,S:m2,u:g2,U:y2,V:v2,w:x2,W:w2,x:null,X:null,y:S2,Y:C2,Z:M2,"%":R2},w={a:function(e,t,n){var r=f.exec(t.slice(n));return r?(e.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=b.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return C(e,t,n,r)},d:P1,e:P1,f:L1,g:R1,G:M1,H:D1,I:D1,j:T1,L:q1,m:I1,M:O1,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:A1,Q:z1,s:F1,S:N1,u:S1,U:k1,V:C1,w:w1,W:E1,x:function(e,t,r){return C(e,n,t,r)},X:function(e,t,n){return C(e,r,t,n)},y:R1,Y:M1,Z:_1,"%":j1};function S(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=f1[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function k(e,t){return function(n){var r,i,o=d1(1900,void 0,1);if(C(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(t&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=u1(d1(o.y,0,1))).getUTCDay(),r=i>4||0===i?$0.ceil(r):$0(r),r=A0.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=c1(d1(o.y,0,1))).getDay(),r=i>4||0===i?D0.ceil(r):D0(r),r=_0.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?u1(d1(o.y,0,1)).getUTCDay():c1(d1(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,u1(o)):c1(o)}}function C(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a<s;){if(r>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=w[i in f1?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return v.x=S(n,v),v.X=S(r,v),v.c=S(t,v),x.x=S(n,x),x.X=S(r,x),x.c=S(t,x),{format:function(e){var t=S(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=k(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=k(e+="",!0);return t.toString=function(){return e},t}}}var f1={"-":"",_:" ",0:"0"},h1=/^\s*\d+/,m1=/^%/,g1=/[\\^$*+?|[\]().{}]/g;function y1(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function b1(e){return e.replace(g1,"\\$&")}function v1(e){return new RegExp("^(?:"+e.map(b1).join("|")+")","i")}function x1(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function w1(e,t,n){var r=h1.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function S1(e,t,n){var r=h1.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function k1(e,t,n){var r=h1.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function C1(e,t,n){var r=h1.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function E1(e,t,n){var r=h1.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function M1(e,t,n){var r=h1.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function R1(e,t,n){var r=h1.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function _1(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function A1(e,t,n){var r=h1.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function I1(e,t,n){var r=h1.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function P1(e,t,n){var r=h1.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function T1(e,t,n){var r=h1.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function D1(e,t,n){var r=h1.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function O1(e,t,n){var r=h1.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function N1(e,t,n){var r=h1.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function q1(e,t,n){var r=h1.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function L1(e,t,n){var r=h1.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function j1(e,t,n){var r=m1.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function z1(e,t,n){var r=h1.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function F1(e,t,n){var r=h1.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function $1(e,t){return y1(e.getDate(),t,2)}function B1(e,t){return y1(e.getHours(),t,2)}function H1(e,t){return y1(e.getHours()%12||12,t,2)}function V1(e,t){return y1(1+_0.count(G0(e),e),t,3)}function W1(e,t){return y1(e.getMilliseconds(),t,3)}function U1(e,t){return W1(e,t)+"000"}function G1(e,t){return y1(e.getMonth()+1,t,2)}function Y1(e,t){return y1(e.getMinutes(),t,2)}function K1(e,t){return y1(e.getSeconds(),t,2)}function X1(e){var t=e.getDay();return 0===t?7:t}function J1(e,t){return y1(T0.count(G0(e)-1,e),t,2)}function Q1(e){var t=e.getDay();return t>=4||0===t?q0(e):q0.ceil(e)}function Z1(e,t){return e=Q1(e),y1(q0.count(G0(e),e)+(4===G0(e).getDay()),t,2)}function e2(e){return e.getDay()}function t2(e,t){return y1(D0.count(G0(e)-1,e),t,2)}function n2(e,t){return y1(e.getFullYear()%100,t,2)}function r2(e,t){return y1((e=Q1(e)).getFullYear()%100,t,2)}function i2(e,t){return y1(e.getFullYear()%1e4,t,4)}function o2(e,t){var n=e.getDay();return y1((e=n>=4||0===n?q0(e):q0.ceil(e)).getFullYear()%1e4,t,4)}function a2(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+y1(t/60|0,"0",2)+y1(t%60,"0",2)}function s2(e,t){return y1(e.getUTCDate(),t,2)}function l2(e,t){return y1(e.getUTCHours(),t,2)}function c2(e,t){return y1(e.getUTCHours()%12||12,t,2)}function u2(e,t){return y1(1+A0.count(Y0(e),e),t,3)}function d2(e,t){return y1(e.getUTCMilliseconds(),t,3)}function p2(e,t){return d2(e,t)+"000"}function f2(e,t){return y1(e.getUTCMonth()+1,t,2)}function h2(e,t){return y1(e.getUTCMinutes(),t,2)}function m2(e,t){return y1(e.getUTCSeconds(),t,2)}function g2(e){var t=e.getUTCDay();return 0===t?7:t}function y2(e,t){return y1(F0.count(Y0(e)-1,e),t,2)}function b2(e){var t=e.getUTCDay();return t>=4||0===t?V0(e):V0.ceil(e)}function v2(e,t){return e=b2(e),y1(V0.count(Y0(e),e)+(4===Y0(e).getUTCDay()),t,2)}function x2(e){return e.getUTCDay()}function w2(e,t){return y1($0.count(Y0(e)-1,e),t,2)}function S2(e,t){return y1(e.getUTCFullYear()%100,t,2)}function k2(e,t){return y1((e=b2(e)).getUTCFullYear()%100,t,2)}function C2(e,t){return y1(e.getUTCFullYear()%1e4,t,4)}function E2(e,t){var n=e.getUTCDay();return y1((e=n>=4||0===n?V0(e):V0.ceil(e)).getUTCFullYear()%1e4,t,4)}function M2(){return"+0000"}function R2(){return"%"}function _2(e){return+e}function A2(e){return Math.floor(+e/1e3)}const I2=a0();I2("d3-number",function(e,t,n){let r,i;function o(e){return i(e)}function a(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return r=w0(t),i=r.format(e),this},a(),o.format=function(e,i,o,s){return(o||s)&&(t=o,n=s,a()),r.format(e)(i)},o.pattern=function(t){return t&&(e=t,i=r.format(t)),e},o}),I2("d3-time",function(e){let t=p1({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),n=t.format(e);function r(e){return n(e)}return r.format=function(e,n){return t.format(e)(n)},r.locale=function(){return t=p1(...arguments),n=t.format(e),this},r.parse=function(e,n){return t.parse(e)(n)},r.parsePattern=function(e){return t.parse(e)},r});const P2={id:e=>"".concat(e.source,"/").concat(e.key||e.title),key:e=>String(e.key||e.title),tags:e=>e.tags,min:e=>e.min,max:e=>e.max,type:e=>e.type,title:e=>String(e.title),values:e=>e.values,value:e=>e,label:e=>e,formatter:e=>(e=>{if("function"==typeof e.formatter)return e.formatter();const t=e.formatter||{};return I2(t.type||"d3-number")(t.format||"")})(e)};function T2(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.id,r=void 0===n?P2.id:n,i=t.key,o=void 0===i?P2.key:i,a=t.min,s=void 0===a?P2.min:a,l=t.max,c=void 0===l?P2.max:l,u=t.type,d=void 0===u?P2.type:u,p=t.tags,f=void 0===p?P2.tags:p,h=t.title,m=void 0===h?P2.title:h,g=t.values,y=void 0===g?P2.values:g,b=t.value,v=void 0===b?P2.value:b,x=t.label,w=void 0===x?P2.label:x,S=t.formatter,k=void 0===S?P2.formatter:S;return{id:()=>r(e),key:()=>o(e),raw:()=>e,tags:()=>f(e),type:()=>d(e),min:()=>s(e),max:()=>c(e),title:()=>m(e),items:()=>y(e),formatter:()=>k(e),value:v,label:w}}const D2=e=>e.filter(e=>"number"==typeof e&&!isNaN(e)),O2=e=>e.reduce((e,t)=>e+t,0),N2={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=D2(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=D2(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=D2(e);return t.length?t.reduce((e,t)=>e+t,0):NaN},avg:e=>{const t=D2(e),n=t.length;return n?O2(t)/n:NaN}};function q2(e,t,n,r){const i={},o=r.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach(a=>{const s=n[a],l=i[a]={};-1!==["number","string","boolean"].indexOf(typeof s)?(l.type="primitive",l.value=s):"function"==typeof s?(l.type="function",l.value=s,l.label=s,l.field=o):"object"==typeof s&&(s.fields?l.fields=s.fields.map(n=>q2(e,t,{main:n},r).main):void 0!==s.field?(l.type="field",l.field=t.field(s.field),l.value=l.field.value,l.label=l.field.label):o&&(l.value=o.value,l.label=o.label,l.field=o),"function"==typeof s.filter&&(l.filter=s.filter),void 0!==s.value&&(l.value=s.value),void 0!==s.label&&(l.label=s.label),"function"==typeof s.reduce?l.reduce=s.reduce:s.reduce?l.reduce=N2[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?N2[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=N2[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?N2[l.field.reduceLabel]:l.field.reduceLabel))}),i}function L2(e,t){const n=q2(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{}).main;return{props:q2(e,t,e.props||{},n),main:n}}function j2(e,t,n,r){const i=Array(e.length),o=Array(e.length);let a;for(let t=0;t<e.length;t++)a=r?e[t][r]:e[t],i[t]=a.value,o[t]=a.label;const s=t.reduce,l=t.reduceLabel,c=s?s(i):i,u={value:c,label:l?l(o,c):n?n(c):String(c)};return r&&e[0][r].source?(u.source=e[0][r].source,u):!r&&e[0].source?(u.source=e[0].source,u):u}function z2(e,t){let n=t.main,r=t.propsArr,i=t.props,o=[];const a=n.field.formatter(),s={};return r.forEach(e=>{s[e]=i[e].field?i[e].field.formatter():e=>e}),o.push(...e.map(e=>{const t=j2(e.items,n,a);return r.forEach(n=>{t[n]=j2(e.items,i[n],s[n],n)}),t})),o}function F2(e){let t=e.cfg,n=e.itemData,r=e.obj,i=e.target,o=e.tracker;const a="function"===e.trackType?t.trackBy(n):n[t.trackBy];let s=o[a];s||(s=o[a]={items:[],id:a},i.push(s)),s.items.push(r)}function $2(e){if(e.length<1e4)return Math.max(...e);let t=-1/0;const n=e.length;for(let r=0;r<n;r++)t<e[r]&&(t=e[r]);return t}function B2(e){if(e.length<1e4)return Math.min(...e);let t=1/0;const n=e.length;for(let r=0;r<n;r++)t>e[r]&&(t=e[r]);return t}const H2={diverging:function(e,t){const n=e.length;if(n<=0)return;const r=e[t[0]].length;for(let i=0;i<r;++i){let r=0,o=0;for(let a=0;a<n;++a){const n=e[t[a]][i],s=n[1]-n[0];s>=0?(n[0]=r,r+=s,n[1]=r):s<0?(n[1]=o,o+=s,n[0]=o):n[0]=r}}},none:e0,silhouette:function(e,t){if((n=e.length)>0){for(var n,r=0,i=e[t[0]],o=i.length;r<o;++r){for(var a=0,s=0;a<n;++a)s+=e[a][r][1]||0;i[r][1]+=i[r][0]=-s/2}e0(e,t)}},expand:function(e,t){if((r=e.length)>0){for(var n,r,i,o=0,a=e[0].length;o<a;++o){for(i=n=0;n<r;++n)i+=e[n][o][1]||0;if(i)for(n=0;n<r;++n)e[n][o][1]/=i}e0(e,t)}},wiggle:function(e,t){if((i=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,i,o=0,a=1;a<r;++a){for(var s=0,l=0,c=0;s<i;++s){for(var u=e[t[s]],d=u[a][1]||0,p=(d-(u[a-1][1]||0))/2,f=0;f<s;++f){var h=e[t[f]];p+=(h[a][1]||0)-(h[a-1][1]||0)}l+=d,c+=p*d}n[a-1][1]+=n[a-1][0]=o,l&&(o-=c/l)}n[a-1][1]+=n[a-1][0]=o,e0(e,t)}}},V2={ascending:function(e){var t=e.map(o0);return t0(e).sort(function(e,n){return t[e]-t[n]})},insideout:function(e){var t,n,r=e.length,i=e.map(o0),o=function(e){var t=e.map(i0);return t0(e).sort(function(e,n){return t[e]-t[n]})}(e),a=0,s=0,l=[],c=[];for(t=0;t<r;++t)n=o[t],a<s?(a+=i[n],l.push(n)):(s+=i[n],c.push(n));return c.reverse().concat(l)},none:t0,reverse:function(e){return t0(e).reverse()}};function W2(e,t,n,r){const i=r||e.items,o={},a=t.stackKey,s=t.value,l=t.startProp||"start",c=t.endProp||"end",u=t.offset||"none",d=t.order||"none",p=t.valueRef||"";let f=0,h={};for(let e=0;e<i.length;e++){let t=i[e],n=p?t[p]:null;if(n&&n.source){let e="".concat(n.source.key||"","/").concat(n.source.field);h[e]||(h[e]=n.source)}let r=a(t);o[r]=o[r]||{items:[]},o[r].items.push(t),f=Math.max(f,o[r].items.length)}const m=Array.apply(null,{length:f}).map(Number.call,Number),g=Object.keys(o).map(e=>o[e].items),y=function(){var e=nZ([]),t=t0,n=e0,r=n0;function i(i){var o,a,s=Array.from(e.apply(this,arguments),r0),l=s.length,c=-1;for(const e of i)for(o=0,++c;o<l;++o)(s[o][c]=[0,+r(e,s[o].key,c,i)]).data=e;for(o=0,a=AZ(t(s));o<l;++o)s[a[o]].index=o;return n(s,a),s}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:nZ(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r="function"==typeof e?e:nZ(+e),i):r},i.order=function(e){return arguments.length?(t=null==e?t0:"function"==typeof e?e:nZ(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?e0:e,i):n},i}().keys(m).value((e,t)=>e[t]?s(e[t]):0).order(V2[d]).offset(H2[u]);let b=y(g),v=[];for(let e=0;e<b.length;e++){let t=b[e];for(let e=0;e<t.length;e++){let n=t[e],r=t[e].data[t.key];r&&(r[l]={value:n[0]},r[c]={value:n[1]},v.push(n[0],n[1]))}}let x=Object.keys(h).map(e=>{let t=n(h[e].key);return t?t.field(h[e].field):null}).filter(e=>!!e);const w=T2({title:x.map(e=>e.title()).join(", "),min:B2(v),max:$2(v),type:"measure",formatter:x[0]?x[0].formatter:void 0});e.fields.push(w)}function U2(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};const r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).logger;if(Array.isArray(e))n.items=e.map(e=>({value:e,label:String(e)}));else if(e){if("collection"in e)n=VQ({},t.collection(e.collection));else{const i=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),a=e.label||(e=>e);if(e.groupBy||e.mapTo)r.warn('Deprecated "data" configuration',e),n.items=[];else if(e.hierarchy)n.root=i.hierarchy?i.hierarchy(e.hierarchy):null,n.fields=i.fields();else if(e.items)n.items=e.skipNormalize?e.items:e.items.map(e=>({value:o(e),label:String(a(e))}));else if(e.extract){const r=Array.isArray(e.extract)?e.extract:[e.extract];n.items=[];const o=[];r.forEach(e=>{const r=e.source?t.dataset(e.source):i;r&&(n.items=[...n.items,...r.extract(e)],void 0!==e.field&&o.push(r.field(e.field)))}),o.length&&(n.fields=o),e.amend&&Array.isArray(e.amend)&&(n.items=[...n.items,...e.amend])}else if(void 0!==e.field&&i){const t=i.field(e.field);t&&(n.fields||(n.fields=[]),n.fields.push(t),"value"in e||(o=t.value||(e=>e),a=t.label||(e=>e),n.value=o),n.items=t.items().map(t=>({value:o(t),label:String(a(t)),source:{field:e.field}})))}else e.fields&&e.fields.forEach(e=>{const r="object"==typeof e&&e.source?t.dataset(e.source):i;if(!r)return;let o;o="object"==typeof e&&void 0!==e.field?r.field(e.field):r.field(e),o&&(n.fields||(n.fields=[]),n.fields.push(o))});n.items&&e.map&&(n.items=n.items.map(e.map))}e&&e.stack&&(Array.isArray(e.stack.stackByKey)?e.stack.stackByKey.forEach(r=>{const i=n.items.filter(e=>{var t;return(null===(t=e.key)||void 0===t?void 0:t.value)&&e.key.value===r});W2(n,e.stack,t.dataset,i)}):W2(n,e.stack,t.dataset,n.items))}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&n.items&&(n.items=n.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&n.items&&(n.items=n.items.sort(e.sort)),n}function G2(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:U2;if(e.data){const r=i(e.data,t,n);if(r&&r.fields&&r.fields[0])return r.fields[0].formatter()}if(r=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(r)){return n.formatter.get(r)(e.format||"")}throw new Error("Formatter of type '".concat(r,"' was not found"))}function Y2(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const K2=Symbol("implicit");function X2(){var e=new t1,t=[],n=[],r=K2;function i(i){let o=e.get(i);if(void 0===o){if(r!==K2)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new t1;for(const r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return X2(t,n).unknown(r)},Y2.apply(i,arguments),i}function J2(){var e,t,n=X2().unknown(void 0),r=n.domain,i=n.range,o=0,a=1,s=!1,l=0,c=0,u=.5;function d(){var n=r().length,d=a<o,p=d?a:o,f=d?o:a;e=(f-p)/Math.max(1,n-l+2*c),s&&(e=Math.floor(e)),p+=(f-p-e*(n-l))*u,t=e*(1-l),s&&(p=Math.round(p),t=Math.round(t));var h=function(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r<i;)o[r]=e+r*n;return o}(n).map(function(t){return p+e*t});return i(d?h.reverse():h)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),d()):r()},n.range=function(e){return arguments.length?([o,a]=e,o=+o,a=+a,d()):[o,a]},n.rangeRound=function(e){return[o,a]=e,o=+o,a=+a,s=!0,d()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(s=!!e,d()):s},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),d()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),d()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,d()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},n.copy=function(){return J2(r(),[o,a]).round(s).paddingInner(l).paddingOuter(c).align(u)},Y2.apply(d(),arguments)}function Q2(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Z2(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function e5(){}var t5=.7,n5=1/t5,r5="\\s*([+-]?\\d+)\\s*",i5="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",o5="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",a5=/^#([0-9a-f]{3,8})$/,s5=new RegExp(`^rgb\\(${r5},${r5},${r5}\\)$`),l5=new RegExp(`^rgb\\(${o5},${o5},${o5}\\)$`),c5=new RegExp(`^rgba\\(${r5},${r5},${r5},${i5}\\)$`),u5=new RegExp(`^rgba\\(${o5},${o5},${o5},${i5}\\)$`),d5=new RegExp(`^hsl\\(${i5},${o5},${o5}\\)$`),p5=new RegExp(`^hsla\\(${i5},${o5},${o5},${i5}\\)$`),f5={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 h5(){return this.rgb().formatHex()}function m5(){return this.rgb().formatRgb()}function g5(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=a5.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?y5(t):3===n?new x5(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?b5(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?b5(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=s5.exec(e))?new x5(t[1],t[2],t[3],1):(t=l5.exec(e))?new x5(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=c5.exec(e))?b5(t[1],t[2],t[3],t[4]):(t=u5.exec(e))?b5(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=d5.exec(e))?M5(t[1],t[2]/100,t[3]/100,1):(t=p5.exec(e))?M5(t[1],t[2]/100,t[3]/100,t[4]):f5.hasOwnProperty(e)?y5(f5[e]):"transparent"===e?new x5(NaN,NaN,NaN,0):null}function y5(e){return new x5(e>>16&255,e>>8&255,255&e,1)}function b5(e,t,n,r){return r<=0&&(e=t=n=NaN),new x5(e,t,n,r)}function v5(e,t,n,r){return 1===arguments.length?function(e){return e instanceof e5||(e=g5(e)),e?new x5((e=e.rgb()).r,e.g,e.b,e.opacity):new x5}(e):new x5(e,t,n,null==r?1:r)}function x5(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function w5(){return`#${E5(this.r)}${E5(this.g)}${E5(this.b)}`}function S5(){const e=k5(this.opacity);return`${1===e?"rgb(":"rgba("}${C5(this.r)}, ${C5(this.g)}, ${C5(this.b)}${1===e?")":`, ${e})`}`}function k5(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function C5(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function E5(e){return((e=C5(e))<16?"0":"")+e.toString(16)}function M5(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new _5(e,t,n,r)}function R5(e){if(e instanceof _5)return new _5(e.h,e.s,e.l,e.opacity);if(e instanceof e5||(e=g5(e)),!e)return new _5;if(e instanceof _5)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new _5(a,s,l,e.opacity)}function _5(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function A5(e){return(e=(e||0)%360)<0?e+360:e}function I5(e){return Math.max(0,Math.min(1,e||0))}function P5(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Q2(e5,g5,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:h5,formatHex:h5,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return R5(this).formatHsl()},formatRgb:m5,toString:m5}),Q2(x5,v5,Z2(e5,{brighter(e){return e=null==e?n5:Math.pow(n5,e),new x5(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?t5:Math.pow(t5,e),new x5(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new x5(C5(this.r),C5(this.g),C5(this.b),k5(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:w5,formatHex:w5,formatHex8:function(){return`#${E5(this.r)}${E5(this.g)}${E5(this.b)}${E5(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:S5,toString:S5})),Q2(_5,function(e,t,n,r){return 1===arguments.length?R5(e):new _5(e,t,n,null==r?1:r)},Z2(e5,{brighter(e){return e=null==e?n5:Math.pow(n5,e),new _5(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?t5:Math.pow(t5,e),new _5(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new x5(P5(e>=240?e-240:e+120,i,r),P5(e,i,r),P5(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new _5(A5(this.h),I5(this.s),I5(this.l),k5(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=k5(this.opacity);return`${1===e?"hsl(":"hsla("}${A5(this.h)}, ${100*I5(this.s)}%, ${100*I5(this.l)}%${1===e?")":`, ${e})`}`}}));var T5=e=>()=>e;function D5(e){return 1===(e=+e)?O5:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):T5(isNaN(t)?n:t)}}function O5(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):T5(isNaN(e)?t:e)}var N5=function e(t){var n=D5(t);function r(e,t){var r=n((e=v5(e)).r,(t=v5(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=O5(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function q5(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function L5(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=V5(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}function j5(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function z5(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function F5(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=V5(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var $5=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,B5=new RegExp($5.source,"g");function H5(e,t){var n,r,i,o=$5.lastIndex=B5.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=$5.exec(e))&&(r=B5.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:z5(n,r)})),o=B5.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function V5(e,t){var n,r=typeof t;return null==t||"boolean"===r?T5(t):("number"===r?z5:"string"===r?(n=g5(t))?(t=n,N5):H5:t instanceof g5?N5:t instanceof Date?j5:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?q5:Array.isArray(t)?L5:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?F5:z5)(e,t)}function W5(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function U5(e){return+e}var G5=[0,1];function Y5(e){return e}function K5(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function X5(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=K5(i,r),o=n(a,o)):(r=K5(r,i),o=n(o,a)),function(e){return o(r(e))}}function J5(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=K5(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=e1(e,t,1,r)-1;return o[n](i[n](t))}}function Q5(){var e,t,n,r,i,o,a=G5,s=G5,l=V5,c=Y5;function u(){var e=Math.min(a.length,s.length);return c!==Y5&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),r=e>2?J5:X5,i=o=null,d}function d(t){return null==t||isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(c(t)))}return d.invert=function(n){return c(t((o||(o=r(s,a.map(e),z5)))(n)))},d.domain=function(e){return arguments.length?(a=Array.from(e,U5),u()):a.slice()},d.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},d.rangeRound=function(e){return s=Array.from(e),l=W5,u()},d.clamp=function(e){return arguments.length?(c=!!e||Y5,u()):c!==Y5},d.interpolate=function(e){return arguments.length?(l=e,u()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}function Z5(e,t,n,r){var i,o=function(e,t,n){n=+n;const r=(t=+t)<(e=+e),i=r?l1(t,e,n):l1(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}(e,t,n);switch((r=d0(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(l0(t)/3)))-l0(Math.abs(e)))}(o,a))||(r.precision=i),b0(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,l0(t)-l0(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-l0(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return y0(r)}function e3(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)===(t=+t))return[e];const r=t<e,[i,o,a]=r?s1(t,e,n):s1(e,t,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let e=0;e<s;++e)l[e]=(o-e)/-a;else for(let e=0;e<s;++e)l[e]=(o-e)*a;else if(a<0)for(let e=0;e<s;++e)l[e]=(i+e)/-a;else for(let e=0;e<s;++e)l[e]=(i+e)*a;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return Z5(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),a=0,s=o.length-1,l=o[a],c=o[s],u=10;for(c<l&&(i=l,l=c,c=i,i=a,a=s,s=i);u-- >0;){if((i=l1(l,c,n))===r)return o[a]=l,o[s]=c,t(o);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}r=i}return e},e}function t3(){var e=Q5()(Y5,Y5);return e.copy=function(){return t=e,t3().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},Y2.apply(e,arguments),e3(e)}function n3(){var e,t=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[e1(t,i,0,r)]:e}return i.domain=function(e){return arguments.length?(t=Array.from(e),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(e){return arguments.length?(n=Array.from(e),r=Math.min(t.length,n.length-1),i):n.slice()},i.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return n3().domain(t).range(n).unknown(e)},Y2.apply(i,arguments)}function r3(e){return void 0===e?e=>e:t=>e(t)}function i3(e){return Math.max(0,Math.min(1,e))}function o3(e){return"object"==typeof e}function a3(e,t,n){const r=Math.abs(t-n)/(e+1),i=[];for(let o=1;o<=e;o++){const e=o*r;i.push(t<n?t+e:t-e)}return i}function s3(e,t,n){if(1===e.length)return e;const r=e.concat([]);for(let i=0;i<e.length;i++){let o=e[i],a=e[i+1];0===i&&o!==n.start()?(r.push(...a3(t,o,a)),o-=a-o,a=e[i],r.push(...a3(t,o,a))):i===e.length-1&&a!==n.end()?(a=o+(o-e[i-1]),r.push(...a3(t,o,a))):r.push(...a3(t,o,a))}return r.filter(e=>e>=n.min()&&e<=n.max())}function l3(e){let t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,a=void 0===o?100:o,s=e.formatter,l=void 0===s?void 0:s;const c=YQ(a)||YQ(t)?2:Math.max(t/a,2),u=Math.min(1e3,Math.round(c));let d=n.ticks(u);d.length<=1&&(d=n.ticks(u+1));const p=i>0?s3(d,i,n):d;p.sort((e,t)=>e-t);const f=p.map(r3(l));return p.map((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:f[t],value:e,isMinor:-1===d.indexOf(e)}})}function c3(e){let t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,a=void 0===o?100:o,s=e.formatter,l=void 0===s?void 0:s;const c=YQ(a)||YQ(t)?2:Math.max(t/a,2),u=Math.min(1e3,Math.round(c)),d=u>10?10:u;n.nice(d);const p=n.ticks(u),f=i>0?s3(p,i,n):p;f.sort((e,t)=>e-t);const h=f.map(r3(l));return f.map((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:h[t],value:e,isMinor:-1===p.indexOf(e)}})}function u3(e){let t,n=e.settings,r=e.scale,i=e.distance,o=e.formatter,a=void 0===o?e=>e:o;const s=n.minorTicks&&!YQ(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const e=n.ticks.values.filter(e=>"object"==typeof e?!YQ(e.value):!YQ(e));t=function(e){let t=e.values,n=e.scale,r=e.formatter,i=void 0===r?e=>e:r;return t.sort((e,t)=>(o3(e)?e.value:e)-(o3(t)?t.value:t)).filter((e,t,r)=>{const i=o3(e)?e.value:e;return i<=n.max()&&i>=n.min()&&r.indexOf(e)===t}).map(e=>{const t=o3(e),r=t?e.value:e,o=n(r);return{position:o,value:r,label:t&&void 0!==e.label?e.label:i(r),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?i3(n(e.start)):o,end:t&&!isNaN(e.end)?i3(n(e.end)):o}})}({values:e,scale:r.copy(),formatter:a})}else if(YQ(n.ticks.count)){t=(n.ticks.tight?c3:l3)({distance:i,minorCount:s,unitDivider:n.ticks.distance,scale:r,formatter:a}),n.ticks.forceBounds&&function(e,t,n){const r=e.map(e=>e.position),i=t.range();-1===r.indexOf(i[0])?e.splice(0,0,{position:i[0],start:i[0],end:i[0],label:n(t.start()),isMinor:!1,value:t.start()}):e[0]&&e[0].isMinor&&(e[0].isMinor=!1);const o=e[e.length-1];-1===r.indexOf(i[1])?e.push({position:i[1],start:i[1],end:i[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,r,a)}else{t=function(e){let t=e.count,n=e.minorCount,r=e.scale,i=e.formatter;return r.ticks((t-1)*n+t).map((e,t)=>{const o=r(e);return{position:o,start:o,end:o,label:i(e),isMinor:t%(n+1)!==0,value:e}})}({count:Math.min(1e3,n.ticks.count),minorCount:s,scale:r.copy(),formatter:a})}return t}function d3(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={};return Object.keys(t).forEach(i=>{const o=typeof e[i];r[i]="function"===o?e[i](n):"undefined"===o?t[i]:e[i]}),r}const p3={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},f3={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},h3={count:NaN};function m3(e,t){e.instance||(e.instance=t.copy(),e.instance.domain([t.start(),t.end()]),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}function g3(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=t3(),i={instance:null,invert:!1},o={data:t,resources:n},a=d3(e,p3,o);let s;function l(e){return YQ(e)?NaN:r(e)}a.ticks=d3(e.ticks,f3,o),a.minorTicks=d3(e.minorTicks,h3,o),l.data=()=>t,l.invert=function(e){return r.invert(e)},l.rangeRound=function(e){return r.rangeRound(e),l},l.clamp=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return r.clamp(e),l},l.cachedTicks=function(){return s},l.clearTicksCache=function(){return s=void 0,this},l.ticks=function(e){return null!==e&&"object"==typeof e?(e.settings=e.settings||{},e.settings=zQ(!0,{},a,e.settings),e.scale=l,s=u3(e),s):(s=r.ticks(e),s)},l.nice=function(e){return r.nice(e),l},l.tickFormat=function(e,t){return r.tickFormat(e,t)},l.interpolate=function(e){return r.interpolate(e),l},l.domain=function(e){return arguments.length?(r.domain(e),i.instance&&i.instance.domain([l.start(),l.end()]),l):r.domain()},l.range=function(e){return arguments.length?(r.range(e),l):r.range()},l.start=function(){return l.domain()[0]},l.end=function(){return l.domain()[this.domain().length-1]},l.min=function(){return Math.min(this.start(),this.end())},l.max=function(){return Math.max(this.start(),this.end())},l.classify=function(e){let t=(l.start()-l.end())/e,n=[l.end()],r=[],i=t/2;for(let o=0;o<e;o++){let e=n[n.length-1]||0,o=e+t,a=l(e+i);n.push(o,o),r.push(a,a)}return n.pop(),l.domain(n),l.range(r),l},l.copy=function(){const i=g3(e,t,n);return i.domain(l.domain()),i.range(l.range()),i.clamp(r.clamp()),i},l.norm=function(e){return m3(i,l),i.instance(e)},l.normInvert=function(e){return m3(i,l),i.instance.invert(e)};const c=function(e,t){const n=+e.min,r=+e.max;let i=0,o=1;if(t&&t[0]){const n=t.map(e=>e.min()).filter(e=>!isNaN(e)),r=t.map(e=>e.max()).filter(e=>!isNaN(e));if(i=n.length?Math.min(...n):Number.NaN,o=r.length?Math.max(...r):Number.NaN,isNaN(i)||isNaN(o))i=-1,o=1;else if(i===o&&0===i)i=-1,o=1;else if(i===o&&i)i-=Math.abs(.1*i),o+=Math.abs(.1*o);else if(!isNaN(e.expand)){const t=o-i;i-=t*e.expand,o+=t*e.expand}if(Array.isArray(e.include)){const t=e.include.filter(e=>!isNaN(e));i=Math.min(...t,i),o=Math.max(...t,o)}}return{mini:isNaN(n)?i:n,maxi:isNaN(r)?o:r}}(a,t?t.fields:[]),u=c.mini,d=c.maxi;return l.domain([u,d]),l.range(a.invert?[1,0]:[0,1]),i.invert=a.invert,l}const y3={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function b3(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={data:t,resources:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}},r=d3(e,y3,n),i=t.items||[],o={},a=[],s=[];function l(e,n){e.data=()=>t,e.datum=e=>i[o[e]],e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=()=>s,e.ticks=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,function(e){let t=e.scale;const n=t.domain(),r=t.data().items,i=t.labels?t.labels():n,o=t.bandwidth();return n.map((e,n)=>{const a=t(e);return{position:a+o/2,label:"".concat(i[n]),data:r?r[n]:void 0,start:a,end:a+o}})}(t,n.trackBy)}}const c=J2();l(c,e),c.pxScale=function(t){const n=r.maxPxStep;if(isNaN(n))return c;const i=c.domain().length,o=Math.max(1,i-c.paddingInner()+2*c.paddingOuter());if(o*n>=t)return c;const a=c.copy();a.type=c.type,l(a,e);const s=o*n/t,u=(1-s)*c.align();return a.range(r.invert?[s+u,u]:[u,s+u]),a};const u="function"==typeof e.value?e.value:e=>e.datum.value,d="function"==typeof e.label?e.label:e=>e.datum.label;for(let e=0;e<i.length;e++){const t=zQ({datum:i[e]},n),r=u(t,e);-1===a.indexOf(r)&&(a.push(r),s.push(d(t,e)),o[r]=e)}return c.domain(a),c.range(r.invert?r.range.slice().reverse():r.range),c.padding(isNaN(r.padding)?0:r.padding),isNaN(r.paddingInner)||c.paddingInner(r.paddingInner),isNaN(r.paddingOuter)||c.paddingOuter(r.paddingOuter),c.align(isNaN(r.align)?.5:r.align),c}const v3={depth:0};function x3(e,t,n){return e.ancestors().map(e=>t(zQ({datum:e.data},n))).reverse().slice(1).toString()}const w3=e=>e.min(),S3=e=>e.max();function k3(e,t){const n=e&&!isNaN(e.min),r=e&&!isNaN(e.max);let i=n?+e.min:0,o=r?+e.max:1;if(t&&t.length){if(!n){const e=t.map(w3).filter(GQ);i=e.length?Math.min(...e):i}if(!r){const e=t.map(S3).filter(GQ);o=e.length?Math.max(...e):o}}return[i,o]}const C3={domain:[],range:[],invert:!1,min:NaN,max:NaN};function E3(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=g3(e,t,n).clamp(!0).interpolate(N5),i=d3(e,C3,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length,s=r;zQ(!0,s,r);const l=WQ(k3(i,t?t.fields:[]),2),c=l[0],u=l[1],d=o?i.domain.length:-1,p=n.theme?n.theme.palette("sequential",d>0?d:2):[],f=a?i.range:p;return s.range(i.invert?f.slice().reverse():f.slice()),s.domain(o?i.domain:function(e,t,n){const r=e.length;if(2===r)return[t,n];const i=[],o=(n-t)/(r-1);i.push(t);for(let e=1;e<r-1;e++)i.push(t+o*e);return i.push(n),i}(s.range(),c,u)),s}const M3={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function R3(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}const _3={domain:[],range:[]};const A3={domain:[],range:[],unknown:void 0},I3={domain:[],range:[],override:!1};const P3=a0();function T3(e,t,n){let r=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),r={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach(e=>{r.extract.push({field:e})}));const i=U2(r,t,n);let o,a=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?function(e){const t=e.map(e=>"dimension"===e.type()?"band":"linear");return-1!==t.indexOf("linear")?"linear":"band"}(e.fields):"linear"}(i);return"color"===a&&(a=i.fields&&i.fields[0]&&"dimension"===i.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(a)&&(o=n.scale.get(a),o=o(e,i,{theme:n.theme,logger:n.logger}),o.type=a),o}P3("linear",g3),P3("band",b3),P3("h-band",function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={data:n,resources:r},o=d3(t,y3,i);o.ticks=d3(t.ticks,v3,i),o.value="function"==typeof t.value?t.value:e=>e.datum.value,o.label="function"==typeof t.label?t.label:e=>e.datum.value;let a=b3(o);const s=function(e,t,n){const r=t.ticks.depth,i=t.value,o=t.label,a=[],s=[],l={},c=[];let u=0;if(!e)return{values:a,labels:s,items:l,ticks:c};e.eachAfter(e=>{if(e.depth>0){const t=x3(e,i,n),d=e.leaves()||[e],p=i(zQ({datum:e.data},n)),f=o(zQ({datum:e.data},n)),h=Array.isArray(e.children),m={key:t,count:d.length,value:p,label:f,leftEdge:x3(d[0],i,n),rightEdge:x3(d[Math.max(d.length-1,0)],i,n),node:e};h?(a.push("SPACER_".concat(u,"_SPACER")),u++):(a.push(t),s.push(f)),(r<=0&&!h||e.depth===r)&&c.push(m),l[t]=m}});const d=e.height-1;return d>0&&a.splice(-d),{values:a,labels:s,items:l,ticks:c}}(n.root,o,i),l=s.values,c=s.labels,u=s.items,d=s.ticks,p=function(e){const t=String(e),n=u[t];return a(n?o.invert?n.rightEdge:n.leftEdge:t)};zQ(!0,p,a),p.bandwidth=function(e){const t=u[String(e)],n=a.bandwidth();if(t&&!t.isLeaf){const e=p(t.leftEdge),r=p(t.rightEdge);return Math.abs(e-r)+n}return n},p.step=function(e){const t=u[String(e)],n=t?t.count:1;let r=a.step();return r*=n,r},p.data=()=>n,p.datum=e=>{const t=u[String(e)];return t?t.node.data:null},p.copy=()=>e(t,n,r),p.labels=()=>c,p.ticks=()=>d.map(e=>{const t=p(e.key),n=p.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}});const f=a.pxScale;return p.pxScale=function(e){return a=f(e),p},p.domain(l),p}),P3("sequential-color",E3),P3("threshold-color",function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=n3(),i=d3(e,M3,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length;function s(e){return YQ(e)?NaN:r(e)}Object.keys(r).forEach(e=>s[e]=r[e]);const l=WQ(k3(i,t.fields),2),c=l[0],u=l[1],d=o?i.domain.length:-1,p=n.theme?n.theme.palette("sequential",d>0?d:2):[];let f=a?i.range:p,h=[];return h=o?i.domain:i.nice?function(e,t,n){const r=2===e.length?10:Math.max(1,e.length),i=t3().domain([t,n]).nice(r).ticks(r);if(!e||!e.length)return i;const o=Math.max(0,e.length-1);for(;i.length>o;)i[0]-t<=n-i[i.length-1]?i.shift():i.pop();return i}(f,c,u):[c+(u-c)/2],f.length>h.length+1?h=function(e,t,n){const r=e.length;if(2===r)return[t+(n-t)/2];const i=[],o=(n-t)/r;for(let e=1;e<r;e++)i.push(t+o*e);return i}(f,c,u):f.length<h.length+1&&(f=function(e,t,n,r){n=e[0],r=e&&e.length>=2?e[e.length-1]:r;const i=E3().domain([n,r]).range(t);return[n,...R3(e),r].map(e=>i(e))}(h,f,c,u)),s.data=()=>t,s.range(i.invert?f.slice().reverse():f),s.domain(h),s}),P3("categorical-color",function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=X2(),i={data:t,resources:n},o=d3(e,_3,i),a="function"==typeof e.value?e.value:e=>e.datum.value,s="function"==typeof e.label?e.label:e=>e.datum.label,l=t.items||[],c={},u=[],d=[];for(let e=0;e<l.length;e++){const t=zQ({datum:l[e]},i),n=a(t,e);-1===u.indexOf(n)&&(u.push(n),d.push(s(t,e)),c[n]=e)}return r.data=()=>t,r.labels=()=>d,r.label=e=>d[u.indexOf(e)],r.datum=e=>l[c[e]],r.range(o.range),Array.isArray(o.domain)&&o.domain.length?r.domain(o.domain):r.domain(u),r}(e,t,n),i=n.theme,o=d3(e,A3,{data:t,resources:n});let a;if(o.explicit=d3(e.explicit,I3,{data:t,resources:n}),a=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():i?i.palette("categorical",r.domain().length).slice():[],o.unknown)r.unknown(o.unknown);else if(i&&i.palette("unknown")){let e=i.palette("unknown");r.unknown(e[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const e=r.domain().slice(),t=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],i=Math.floor(e.length/a.length);for(let e=1;e<i+1;e*=2)a=a.concat(a);if(o.explicit.override)for(let r=0;r<t.length;r++){const i=e.indexOf(t[r]);i>-1&&(a[i]=n[r])}else{const r=t.map((t,r)=>[e.indexOf(t),t,n[r]]).sort((e,t)=>e[0]-t[0]);r.forEach(t=>{const n=e.indexOf(t[1]);-1!==n&&a.splice(n,0,t[2])})}a.length=e.length}return r.range(a),r});var D3={};function O3(){O3.init.call(this)}D3.isObject=function(e){return"object"==typeof e&&null!==e},D3.isNumber=function(e){return"number"==typeof e},D3.isUndefined=function(e){return void 0===e},D3.isFunction=function(e){return"function"==typeof e};var N3=O3;O3.EventEmitter=O3,O3.prototype._events=void 0,O3.prototype._maxListeners=void 0,O3.defaultMaxListeners=10,O3.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},O3.prototype.setMaxListeners=function(e){if(!D3.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},O3.prototype.emit=function(e){var t,n,r,i,o,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],D3.isUndefined(n))return!1;if(D3.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(D3.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(a=n.slice()).length,o=0;o<r;o++)a[o].apply(this,i)}return!0},O3.prototype.addListener=function(e,t){var n;if(!D3.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,D3.isFunction(t.listener)?t.listener:t),this._events[e]?D3.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,D3.isObject(this._events[e])&&!this._events[e].warned)&&((n=D3.isUndefined(this._maxListeners)?O3.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,D3.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),D3.isFunction(console.trace)&&console.trace()));return this},O3.prototype.on=O3.prototype.addListener,O3.prototype.once=function(e,t){if(!D3.isFunction(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},O3.prototype.removeListener=function(e,t){var n,r,i,o;if(!D3.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||D3.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(D3.isObject(n)){for(o=i;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},O3.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],D3.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},O3.prototype.listeners=function(e){return this._events&&this._events[e]?D3.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},O3.listenerCount=function(e,t){return e._events&&e._events[t]?D3.isFunction(e._events[t])?1:e._events[t].length:0};var q3={mixin:e=>(Object.keys(N3.prototype).forEach(t=>{e[t]=N3.prototype[t]}),N3.init(e),e)};function L3(){let e=0,t=0,n=0,r=0;n=n||e;const i={move(e){this.moveTo(n+e)},moveTo(o){const a=Math.max(e,Math.min(t-r,o));n!==a&&(n=a,i.emit("update"))},update(o){let a=!1;var s=o.min;e=void 0===s?e:s;var l=o.max;t=void 0===l?t:l,void 0!==o.viewSize&&o.viewSize!==r&&(r=o.viewSize,a=!0);const c=Math.max(e,Math.min(t-r,n));n!==c&&(n=c,a=!0),a&&i.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:r})};return q3.mixin(i),i}function j3(e,t){const n=e.min||0,r=e.max||0,i=e.viewSize||0,o=t||L3();return o.update({min:n,max:r,viewSize:i}),o}function z3(e,t){return e<=t}function F3(e,t){return e<t}function $3(e,t,n){let r=0;for(;r<e.length&&t>e[r];)++r;return e[r]===t&&n&&++r,r}function B3(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=[];function i(){}return i.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=n.includeMax,i=void 0===r||r,o=n.includeMin;e=i?z3:F3,t=void 0===o||o?z3:F3},i.add=e=>{let t=e.min,n=e.max;const i=$3(r,t),o=$3(r,n,!0),a=[i,o-i];i%2==0&&a.push(t),o%2==0&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.remove=e=>{let t=e.min,n=e.max;const i=$3(r,t),o=$3(r,n,!0),a=[i,o-i];i%2==1&&a.push(t),o%2==1&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.set=e=>{const t=r.join(",");r=[],Array.isArray(e)?e.forEach(i.add):i.add(e);return t!==r.join(",")},i.clear=()=>{const e=r.length>0;return r=[],e},i.containsValue=n=>function(e,t,n,r){const i=e.length;for(let o=1;o<i;o+=2)if(n(e[o-1],t)&&r(t,e[o]))return!0;return!1}(r,n,t,e),i.containsRange=e=>{let t=e.min,n=e.max;const i=$3(r,t,!0),o=$3(r,n);return i===o&&o%2==1},i.toggle=e=>i.containsRange(e)?i.remove(e):i.add(e),i.ranges=()=>{const e=[];for(let t=1;t<r.length;t+=2)e.push({min:r[t-1],max:r[t]});return e},i.configure(n),i}function H3(){let e=[];function t(){}return t.add=t=>-1===e.indexOf(t)&&(e.push(t),!0),t.remove=t=>{const n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=t=>-1!==e.indexOf(t),t.values=()=>e.slice(),t.clear=()=>e=[],t.toString=()=>e.join(";"),t}const V3={key:void 0,includeMin:!0,includeMax:!0};function W3(e){let t=e.items,n=e.collection,r=e.vc;const i={},o=[];let a,s;for(let e=0,o=t.length;e<o;e++){a=t[e].key,n[a]||(n[a]=r()),s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[a].add(s[e])&&(i[a]=i[a]||[],i[a].push(s[e]))}const l=Object.keys(i);for(let e=0,t=l.length;e<t;e++)a=l[e],o.push({id:a,values:i[a]});return o}function U3(e){let t=e.items,n=e.collection;const r={},i=[];let o,a;for(let e=0,i=t.length;e<i;e++)if(o=t[e].key,n[o]){a=t[e].values||[t[e].value];for(let e=0;e<a.length;e++)n[o].remove(a[e])&&(r[o]=r[o]||[],r[o].push(a[e]))}const s=Object.keys(r);for(let e=0,t=s.length;e<t;e++)o=s[e],i.push({id:o,values:r[o]});return i}function G3(e){const t={};let n,r;for(let i=0,o=e.length;i<o;i++){n=e[i].key,r=e[i].values||[e[i].value],t[n]||(t[n]=[]);for(let e=0;e<r.length;e++){-1===t[n].indexOf(r[e])&&t[n].push(r[e])}}return t}function Y3(e){let t=e.key,n=e.collection,r=e.obj,i=e.fn,o=e.value;n[t]||(n[t]=i()),r[t]=r[t]||[],r[t].push(o),n[t].add(o)}function K3(e,t){const n=[],r=Object.keys(e);let i,o;const a=e=>-1===t[i].indexOf(e);for(let s=0,l=r.length;s<l;s++)i=r[s],t[i]?(o=e[i].filter(a),o.length&&n.push({id:i,values:o})):n.push({id:i,values:e[i]});return n}function X3(e,t,n){const r=function(e,t){if(!Object.keys(t).length)return e;const n=e.length,r=Array(n);for(let i=0;i<n;i++)r[i]=e[i].key in t?zQ({},e[i],{key:t[e[i].key]}):e[i];return r}(t,n);return e&&e.length?e.reduce((e,t)=>t(e),r):r}function J3(e){return e.replace(/(-[a-z])/g,e=>e.toUpperCase().replace("-",""))}function Q3(e){return e.replace(/([A-Z])/g,e=>"-".concat(e.toLowerCase()))}function Z3(e,t,n){let r=n.ranges,i=n.interceptors,o=n.rc,a=n.aliases,s=n.rangeConfig;const l=X3(i["".concat(t,"Ranges")],e,a);let c=!1;return l.forEach(e=>{const n=e.key;if(r[n]||(r[n]=o(s.sources[n]||s.default)),"set"===t)c=r[n][t](e.ranges||e.range)||c;else{const i=e.ranges||[e.range];for(let e=0;e<i.length;e++)c=r[n][t](i[e])||c}}),c}function e4(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vc,n=void 0===t?H3:t,r=e.rc,i=void 0===r?B3:r,o=!1,a={},s={},l={},c={sources:{},default:zQ({},V3)};const u={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},d=()=>{const e={values:{},ranges:{}};return Object.keys(s).forEach(t=>{e.values[t]=s[t].values()}),Object.keys(a).forEach(t=>{e.ranges[t]=a[t].ranges()}),e},p={ls:[],clear(){this.ls.forEach(e=>e.clear())},start(){this.ls.forEach(e=>e.start())},end(){this.ls.forEach(e=>e.end())},update(){const e=d();this.ls.forEach(t=>t._state(e))},updateValues(){const e=d();this.ls.forEach(t=>t._state({values:e.values}))},updateRanges(){const e=d();this.ls.forEach(t=>t._state({ranges:e.ranges}))}},f={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(c={sources:{},default:zQ({},V3)},e.ranges.forEach(e=>{const t={};Object.keys(V3).filter(e=>"key"!==e).forEach(n=>{t[n]=void 0!==e[n]?e[n]:V3[n]}),void 0!==e.key?c.sources[e.key]=t:c.default=t}),Object.keys(a).forEach(e=>a[e].configure(c.sources[e]||c.default)),f.emit("update",[],[]))},link:e=>{if(f===e)throw new Error("Can't link to self");p.ls.push(e),e._state(d())},_state:e=>{if(!e)return d();if(e.values){const t=[];Object.keys(e.values).forEach(n=>{s[n]&&e.values[n].join(";")===s[n].toString()||t.push({key:n,values:e.values[n]})}),Object.keys(s).forEach(n=>{e.values[n]||t.push({key:n,values:[]})}),t.length&&f.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach(n=>{a[n]&&e.ranges[n].join(";")===a[n].toString()||t.push({key:n,ranges:e.ranges[n]})}),Object.keys(a).forEach(n=>{e.ranges[n]||t.push({key:n,ranges:[]})}),t.length&&f.setRanges(t)}},start:function(){if(!o){o=!0;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];f.emit("start",...t),p.start()}},end:function(){if(o){o=!1,a={},s={};for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];f.emit("end",...t),p.end()}},isActive:()=>o,clear:()=>{const e=f.brushes().filter(e=>"value"===e.type&&e.brush.values().length).map(e=>({id:e.id,values:e.brush.values()})),t=Object.keys(a).length>0||e.length;a={},s={},t&&(f.emit("update",[],e),p.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(a).map(e=>({type:"range",id:e,brush:a[e]}))),e=e.concat(Object.keys(s).map(e=>({type:"value",id:e,brush:s[e]}))),e},addValue:(e,t)=>{f.addValues([{key:e,value:t}])},addValues:e=>{const t=X3(u.addValues,e,l),r=W3({vc:n,collection:s,items:t});f.emit("add-values",t),r.length&&(o||(o=!0,f.emit("start")),f.emit("update",r,[]),p.updateValues())}};return f.setValues=e=>{const t=X3(u.setValues,e,l),r=function(e){let t=e.items,n=e.vCollection,r=e.vc;const i={},o=G3(t);let a,s=[],l=[];const c={},u=Object.keys(n);for(let e=0,t=u.length;e<t;e++)a=u[e],c[a]=n[a].values().slice(),delete n[a];const d=e=>{n[a]&&n[a].contains(e)||Y3({key:a,value:e,collection:n,obj:i,fn:r})},p=Object.keys(o);for(let e=0,t=p.length;e<t;e++)a=p[e],o[a].forEach(d);return l=K3(c,i),s=K3(i,c),[s,l]}({items:t,vCollection:s,vc:n});f.emit("set-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,f.emit("start")),f.emit("update",r[0],r[1]),p.updateValues())},f.removeValue=(e,t)=>{f.removeValues([{key:e,value:t}])},f.removeValues=e=>{const t=X3(u.removeValues,e,l),n=U3({collection:s,items:t});f.emit("remove-values",t),n.length&&(f.emit("update",[],n),p.updateValues())},f.addAndRemoveValues=(e,t)=>{const r=X3(u.addValues,e,l),i=X3(u.removeValues,t,l),a=W3({vc:n,collection:s,items:r}),c=U3({collection:s,items:i});f.emit("add-values",r),f.emit("remove-values",i),(a.length||c.length)&&(o||(o=!0,f.emit("start")),f.emit("update",a,c),p.updateValues())},f.toggleValue=(e,t)=>{f.toggleValues([{key:e,value:t}])},f.toggleValues=e=>{const t=X3(u.toggleValues,e,l),r=function(e){let t=e.items,n=e.values,r=e.vc;const i={},o={},a=[],s=[],l=G3(t);let c,u,d;const p=Object.keys(l);for(let e=0,t=p.length;e<t;e++){c=p[e],d=l[c];for(let e=0,t=d.length;e<t;e++)u=d[e],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):Y3({key:c,value:u,collection:n,obj:i,fn:r})}const f=Object.keys(i);for(let e=0,t=f.length;e<t;e++)c=f[e],a.push({id:c,values:i[c]});const h=Object.keys(o);for(let e=0,t=h.length;e<t;e++)c=h[e],s.push({id:c,values:o[c]});return[a,s]}({items:t,values:s,vc:n});f.emit("toggle-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,f.emit("start")),f.emit("update",r[0],r[1]),p.updateValues())},f.containsValue=(e,t)=>{let n=l[e]||e;return!!s[n]&&s[n].contains(t)},f.addRange=(e,t)=>{f.addRanges([{key:e,range:t}])},f.addRanges=e=>{Z3(e,"add",{ranges:a,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,f.emit("start")),f.emit("update",[],[]),p.updateRanges())},f.removeRange=(e,t)=>{f.removeRanges([{key:e,range:t}])},f.removeRanges=e=>{Z3(e,"remove",{ranges:a,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,f.emit("start")),f.emit("update",[],[]),p.updateRanges())},f.setRange=(e,t)=>{f.setRanges([{key:e,range:t}])},f.setRanges=e=>{Z3(e,"set",{ranges:a,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,f.emit("start")),f.emit("update",[],[]),p.updateRanges())},f.toggleRange=(e,t)=>{f.toggleRanges([{key:e,range:t}])},f.toggleRanges=e=>{Z3(e,"toggle",{ranges:a,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,f.emit("start")),f.emit("update",[],[]),p.updateRanges())},f.containsRangeValue=(e,t)=>{let n=l[e]||e;return!!a[n]&&a[n].containsValue(t)},f.containsRange=(e,t)=>{let n=l[e]||e;return!!a[n]&&a[n].containsRange(t)},f.containsMappedData=(e,t,n)=>{let r=[];const i=Object.keys(e);let o,c,u,d;for(let t=0,n=i.length;t<n;t++){if(o=i[t],"value"===o)c=e,r[t]={key:"",i:t,bool:!1};else{if("source"===o)continue;c=e[o],r[t]={key:o,i:t,bool:!1}}u=c.source&&c.source.field,void 0!==u&&(void 0!==c.source.key&&(u="".concat(c.source.key,"/").concat(u)),u in l&&(u=l[u]),d=c.value,a[u]?r[t].bool=Array.isArray(d)?a[u].containsRange({min:d[0],max:d[1]}):a[u].containsValue(d):s[u]&&s[u].contains(d)&&(r[t].bool=!0))}return t?(r=r.filter(e=>-1!==t.indexOf(e.key)),"and"===n?!!r.length&&!r.some(e=>!1===e.bool):"xor"===n?!!r.length&&r.some(e=>e.bool)&&r.some(e=>!1===e.bool):r.some(e=>e.bool)):r.some(e=>e.bool)},f.intercept=(e,t)=>{const n=J3(e);u[n]&&u[n].push(t)},f.removeInterceptor=(e,t)=>{const n=J3(e);if(!u[n])return;const r=u[n].indexOf(t);-1!==r&&u[n].splice(r,1)},f.removeAllInterceptors=e=>{const t=[];if(e){const n=J3(e);u[n]&&u[n].length&&t.push({name:e,handlers:u[n]})}else Object.keys(u).forEach(e=>{u[e].length&&t.push({name:Q3(e),handlers:u[e]})});t.forEach(e=>{e.handlers.slice().forEach(t=>f.removeInterceptor(e.name,t))})},f.addKeyAlias=(e,t)=>{l[e]=t},f.removeKeyAlias=e=>{delete l[e]},q3.mixin(f),f}function t4(e){return e*e*e}function n4(e){return--e*e*e+1}function r4(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}a0();const i4=["stroke","fill","color","backgroundColor","thumbColor"];function o4(e,t){const n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n);let a;for(a=0;a<r;++a)i[a]=a4(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(e){for(a=0;a<r;++a)o[a]=i[a](e);return o}}function a4(e,t,n){const r=typeof t;let i;return null==t||"boolean"===r?function(e){return()=>e}(t):("number"===r?z5:"string"===r?(i=g5(t))&&i4.includes(n)?(t=i,N5):H5:t instanceof g5?N5:t instanceof Date?j5:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?q5:Array.isArray(t)?o4:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?s4:z5)(e,t)}function s4(e,t){const n={},r={};let i;for(i in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)i in e?n[i]=a4(e[i],t[i],i):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}function l4(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}const c4={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},u4=/^\$/;function d4(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function p4(e,t,n){const r=e[t];r&&r.scale&&r.scale.pxScale?r.scale=r.scale.pxScale(n):r&&r.pxScale&&(e[t]=r.pxScale(n))}function f4(e,t){return e.pxScale?e.pxScale(t):e}const h4={normalizeSettings:function(e,t,n){const r=zQ({},e),i=zQ({},t);return Object.keys(r).forEach(e=>{i[e]={};const o=r[e],a=typeof o;if("function"==typeof o)i[e].fn=o;else if(d4(o)){let n=t[e];"string"==typeof n&&u4.test(n)&&(n=c4[n]);const r=typeof n;i[e]="undefined"===r||r===a?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(i[e].fn=o.fn),void 0!==o.scale&&(i[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(i[e].ref=o.ref))}),Object.keys(t).forEach(e=>{if(e in r)return;const n=t[e];"string"===typeof n&&u4.test(n)?i[e]=c4[n]:i[e]=n}),i},resolveForItem:function(e,t,n){const r={},i=Object.keys(t),o=i.length,a=e.datum,s=e.datum;for(let l=0;l<o;l++){const o=i[l],c=t[o],u="object"==typeof s&&void 0!==c,d=u&&"string"==typeof c.ref,p=u&&o in s,f=d?s[c.ref]:p?s[o]:a;d4(c)?r[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),r[o]=c.fn.call(null,e,n)):u&&c.scale&&f?(r[o]=c.scale(f.value),c.scale.bandwidth&&(r[o]+=c.scale.bandwidth()/2)):d&&f?r[o]=f.value:c.fn?r[o]=c.fn.call(null,e,n):r[o]=c}return r},updateScaleSize:p4};function m4(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((e,t)=>Array.isArray(t.children)?(e.push(...m4(t.children)),e):(e.push(t),e),[])}function g4(e,t){let n=t.context,r=t.data,i=t.style,o=t.filter,a=t.mode;const s=e.chart.brush(n),l=r,c=i.active||{},u=i.inactive||{},d=[];Object.keys(c).forEach(e=>{d.push(e)}),Object.keys(u).forEach(e=>{-1===d.indexOf(e)&&d.push(e)});const p=[];let f=!1;const h=()=>{let t=m4(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=()=>{const e=h(),t=e.length;let n,r=!1;const i="function"==typeof l?l({brush:s}):l;for(let r=0;r<t;r++){if(n=e[r].data,!n)continue;e[r].__style||(e[r].__style={},d.forEach(t=>{e[r].__style[t]=e[r][t]}));const t=s.containsMappedData(n,i,a),o=p.indexOf(e[r]);let l=!1;t&&-1===o?(p.push(e[r]),l=!0):t||-1===o||(p.splice(o,1),l=!0),e[r].needToUpdate=l||f,e[r].isActive=t}for(let i=0;i<t;i++)if(n=e[i].data,n){if(e[i].needToUpdate){const t=zQ({},e[i],e[i].__style),n=e[i].isActive;d.forEach(r=>{e[i][r]=n&&r in c?"function"==typeof c[r]?c[r].call(null,t,p):c[r]:!n&&r in u?"function"==typeof u[r]?u[r].call(null,t,p):u[r]:e[i].__style[r]}),r=!0}delete e[i].needToUpdate}return f=!1,r},g=function(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1}).suppressRender,n=h(),r=n.length;for(let e=0;e<r;e++)n[e].data&&(n[e].__style=n[e].__style||{},d.forEach(t=>{n[e].__style[t]=n[e][t],t in u&&(n[e][t]="function"==typeof u[t]?u[t].call(null,n[e]):u[t])}));f=!0,p.length=0,t||e.renderer.render(e.nodes)},y=function(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1}).suppressRender,n=h(),r=n.length;for(let e=0;e<r;e++)n[e].__style&&(Object.keys(n[e].__style).forEach(t=>{n[e][t]=n[e].__style[t]}),n[e].__style=void 0);p.length=0,t||e.renderer.render(e.nodes)},b=()=>{if(m()){const t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return s.on("start",g),s.on("end",y),s.on("update",b),{isActive:()=>s.isActive(),update:()=>{p.length=0,f=!0,m()},cleanUp:function(){s.removeListener("start",g),s.removeListener("end",y),s.removeListener("update",b)}}}function y4(e){let t=e.nodes,n=e.action,r=e.chart,i=e.trigger;const o=[];for(let e=0;e<t.length;e++){let n=t[e].data;null!==n&&o.push(n)}!function(e){let t=e.dataPoints,n=e.action,r=e.chart,i=e.trigger;if(!i)return;const o=i.data||[""];let a={items:[],actionFn:"toggleRanges"},s={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(a.actionFn="".concat(n,"Ranges"),s.actionFn="".concat(n,"Values"));for(let e=0;e<t.length;e++){const n=t[e];n&&o.forEach(e=>{let t=n&&!e?n:n[e];if(t){let e={key:t.source.field};void 0!==t.source.key&&(e.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(e.range={min:t.value[0],max:t.value[1]},a.items.push(e)):(e.value=t.value,s.items.push(e))}})}i.contexts.forEach(e=>{a.items.length?r.brush(e)[a.actionFn](a.items):r.brush(e)[s.actionFn](s.items)})}({dataPoints:o,action:n,chart:r,trigger:i})}function b4(e){let t=e.collisions,n=e.t,r=e.config,i=e.action,o=[],a=!1;t.length>0&&(o=t,a=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));const s=o.map(e=>e.node);return y4({nodes:s,action:i,chart:r.chart,data:r.data,trigger:n}),a}function v4(e,t,n){const r=n.element().getBoundingClientRect();let i=UQ(e)?function(e,t){return 1!==e.changedTouches.length?null:{x:e.changedTouches[0].clientX-t.left,y:e.changedTouches[0].clientY-t.top}}(e,r):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,r);return null===i||i.x<0||i.y<0||i.x>r.width||i.y>r.height?[]:(t.touchRadius>0&&UQ(e)?i={cx:i.x,cy:i.y,r:t.touchRadius}:t.mouseRadius>0&&!UQ(e)&&(i={cx:i.x,cy:i.y,r:t.mouseRadius}),n.itemsAt(i))}function x4(e,t,n){return e?"function"==typeof e?e(t):e:n}const w4={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontStyle:"font-style",textDecoration:"text-decoration",fontWeight:"font-weight",baseline:"dominant-baseline",dominantBaseline:"dominant-baseline",anchor:"text-anchor",textAnchor:"text-anchor",maxWidth:"maxWidth",transform:"transform",strokeDasharray:"stroke-dasharray",id:"id"};function S4(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?"M".concat(r.x," ").concat(r.y):"L".concat(r.x," ").concat(r.y),n+=" "}return t&&(n+="Z"),n}function k4(e,t,n,r){const i=n/2,o=e-r/2,a=t-r/2,s=e-i,l=t-i;return[{x:o,y:a},{x:o,y:l},{x:o+r,y:l},{x:o+r,y:a},{x:s+n,y:a},{x:s+n,y:a+r},{x:o+r,y:a+r},{x:o+r,y:l+n},{x:o,y:l+n},{x:o,y:a+r},{x:s,y:a+r},{x:s,y:a}]}function C4(e){return-e/180*Math.PI}function E4(e){return function(e){let t=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(t-e))*Math.sqrt(2),r=n*Math.cos(e),i=n*Math.sin(e);return{x1:r<0?1:0,y1:i<0?1:0,x2:r>=0?r:r+1,y2:i>=0?i:i+1}}(C4(e))}function M4(e,t){return{x:e.x+t.x,y:e.y+t.y}}function R4(e,t){return{x:e.x-t.x,y:e.y-t.y}}function _4(e,t){return{x:e.x*t,y:e.y*t}}function A4(e,t){return e.x-t.x}function I4(e,t){return e.y-t.y}function P4(e,t){return A4(e,t)**2+I4(e,t)**2}function T4(e,t){return Math.sqrt(P4(e,t))}function D4(e,t){return e.x*t.x+e.y*t.y}function O4(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const r=Math.cos(t),i=Math.sin(t),o=R4(e,n);return M4({x:r*o.x-i*o.y,y:i*o.x+r*o.y},n)}const N4={up:0,down:180,left:90,right:-90};function q4(e){let t=e.x,n=e.y,r=e.size;const i=r/2;return{type:"rect",x:t-i,y:n-i,width:r,height:r}}const L4=a0();L4.add("circle",function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}}),L4.add("diamond",function(e){const t=e.size,n=e.x-t/2,r=e.y-t/2;return{type:"path",fill:"black",d:S4([{x:n,y:r+t/2},{x:n+t/2,y:r},{x:n+t,y:r+t/2},{x:n+t/2,y:r+t},{x:n,y:r+t/2}])}}),L4.add("saltire",function(e){const t=C4(45),n=e.size/2,r=isNaN(e.width)?n/2:e.width,i=Math.min(r,n);let o=e.size;const a=Math.sin(Math.asin(-t))*(i/2);o+=2*(n/Math.sin(-t)-n),o-=2*a;const s={x:e.x,y:e.y},l=k4(e.x,e.y,o,i).map(e=>O4(e,t,s));return{type:"path",fill:"black",d:S4(l)}}),L4.add("square",function(e){const t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}}),L4.add("triangle",function(e){const t=e.size,n={x:e.x,y:e.y},r=N4[e.direction]||0,i=t/2,o=e.x-i,a=e.y-i;let s=[{x:o,y:a+t},{x:o+i,y:a},{x:o+t,y:a+t},{x:o,y:a+t}];const l=C4(r);return s=s.map(e=>O4(e,l,n)),{type:"path",fill:"black",d:S4(s)}}),L4.add("line",function(e){const t="vertical"===e.direction,n=e.size/2,r=e.x,i=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:r-(t?0:n),y1:i-(t?n:0),x2:r+(t?0:n),y2:i+(t?n:0),collider:q4(e)}}),L4.add("star",function(e){const t=e.size,n=[],r=t/2,i=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,a=isNaN(e.startAngle)?90:e.startAngle,s=360/i;for(let t=1;t<=i;t++){const i=s*t+a,l=C4(i),c=C4(i+s/2),u=Math.sin(l),d=Math.cos(l),p=Math.sin(c),f=Math.cos(c);n.push({x:e.x+d*r,y:e.y+u*r}),n.push({x:e.x+f*o,y:e.y+p*o})}return{type:"path",fill:"black",d:S4(n)}}),L4.add("n-polygon",function(e){const t=[],n=e.size/2,r=Math.max(isNaN(e.sides)?6:e.sides,3),i=360/r,o=isNaN(e.startAngle)?0:e.startAngle;for(let a=1;a<=r;a++){const r=C4(i*a+o),s=Math.sin(r),l=Math.cos(r);t.push({x:e.x+l*n,y:e.y+s*n})}return{type:"path",fill:"black",d:S4(t)}}),L4.add("cross",function(e){const t=e.x,n=e.y,r=e.size/2,i=isNaN(e.width)?r/2:e.width,o=Math.min(i,r);return{type:"path",fill:"black",d:S4(k4(t,n,e.size,o))}}),L4.add("bar",function(e){const t={x:e.x,y:e.y},n="vertical"===e.direction,r=e.size/2,i=r/2/2;let o=[{x:t.x-r,y:t.y+i},{x:t.x-r,y:t.y-i},{x:t.x+r,y:t.y-i},{x:t.x+r,y:t.y+i}];if(n){const e=C4(90);o=o.map(n=>O4(n,e,t))}const a=QQ(o);return a.type="rect",a.fill="black",a}),L4.add("rect",function(e){const t=e.x,n=e.y,r=e.size,i=void 0===e.width?r:e.width,o=void 0===e.height?r:e.height;return{type:"rect",fill:"black",x:t-i/2,y:n-o/2,width:i,height:o}}),L4.add("image",function(e){const t=e.x,n=e.y,r=e.imageSettings||{},i=r.width,o=r.height,a=r.imageSrc,s=r.position;return{type:"image",x:t,y:n,width:i,height:o,src:a,symbol:r.symbol,r:10,cx:0,cy:0,imageScalingFactor:r.imageScalingFactor,imagePosition:s}});const j4=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:L4;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=e.get(t.type);if(n){const e=n(t);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach(n=>{void 0!==w4[n]&&"transform"!==n&&(e[n]=t[n])})}(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function z4(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.dock,r=void 0===n?"center":n,i=e.displayOrder,o=void 0===i?0:i,a=e.prioOrder,s=void 0===a?0:a,l=e.preferredSize,c=void 0===l?0:l,u=e.minimumLayoutMode,d=e.show,p=void 0===d||d;r=r||"center";return{computePreferredSize(e){let n=e.inner,r=e.outer,i=e.children;return"function"==typeof c?c({inner:n,outer:r,children:i,dock:this.dock()},t):c},dock(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},displayOrder(e){return void 0!==e?(o=e,this):"function"==typeof o?o(t):o},prioOrder(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s},minimumLayoutMode(e){return void 0!==e?(u=e,this):"function"==typeof u?u(t):u},show(e){return void 0!==e?(p=e,this):"function"==typeof p?p(t):p}}}function F4(e,t,n){const r=t.require,i=void 0===r?[]:r,o=t.mediator||{},a=n.settings,s=n.formatter,l=n.scale,c=n.data,u=n.renderer,d=n.chart,p=n.dockConfig,f=n.mediator,h=n.instance,m=n.rect,g=n.style,y=n.registries,b=n.resolver,v=n.update,x=n._DO_NOT_USE_getInfo,w=n.symbol,S=n.isVisible;e.emit=()=>{},S&&(e.isVisible=S),Object.defineProperty(e,"settings",{get:a}),Object.defineProperty(e,"data",{get:c}),Object.defineProperty(e,"formatter",{get:s}),Object.defineProperty(e,"scale",{get:l}),Object.defineProperty(e,"mediator",{get:f}),Object.defineProperty(e,"style",{get:g}),Object.defineProperty(e,"registries",{get:y}),m&&Object.defineProperty(e,"rect",{get:m}),x&&(e._DO_NOT_USE_getInfo=x),Object.keys(t).forEach(n=>{var r;r=n,["on","preferredSize","created","beforeMount","mounted","resize","beforeUpdate","updated","beforeRender","render","beforeUnmount","beforeDestroy","destroyed","defaultSettings","data","settings","formatter","scale","chart","dockConfig","mediator","style","resolver","registries","_DO_NOT_USE_getInfo","symbol","isVisible"].some(e=>e===r)||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])}),i.forEach(t=>{"renderer"===t?Object.defineProperty(e,"renderer",{get:u}):"chart"===t?Object.defineProperty(e,"chart",{get:d}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:p}):"instance"===t?Object.defineProperty(e,"instance",{get:h}):"update"===t&&v?Object.defineProperty(e,"update",{get:v}):"resolver"===t?Object.defineProperty(e,"resolver",{get:b}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:w})}),Object.keys(o).forEach(t=>{e.mediator.on(t,o[t].bind(e))})}function $4(e,t,n){const r=t=>e[t]?(n.warn("Deprecation Warning the ".concat(t," property should be moved into layout: {} property")),e[t]):e.layout?e.layout[t]:void 0,i={};return i.displayOrder=r("displayOrder"),i.dock=r("dock"),i.prioOrder=r("prioOrder"),i.minimumLayoutMode=r("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==i.displayOrder?i.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==i.prioOrder?i.prioOrder:e.layout.prioOrder,e.layout.dock=i.dock||e.layout.dock,e.layout.minimumLayoutMode=i.minimumLayoutMode||e.layout.minimumLayoutMode,i.show=e.show,i.preferredSize=t,i}function B4(e,t,n){Object.keys(n.on||{}).forEach(r=>{e.eventListeners=e.eventListeners||[];const i=n.on[r].bind(e);e.eventListeners.push({event:r,listener:i}),t.on(r,i)}),e.emit=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.emit(e,...r)}}function H4(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.defaultSettings,r=void 0===n?{}:n,i=e._DO_NOT_USE_getInfo,o=void 0===i?()=>({}):i,a=t.chart,s=t.container,l=t.mediator,c=t.registries,u=t.theme,d=t.renderer,p=q3.mixin({});let f,h,m,g,y,b=t.settings||{},v=zQ(!0,{},r,b),x=[],w=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h4,n={};return{resolve:function(r){let i=r.data,o=r.settings,a=r.defaults,s=void 0===a?{}:a,l=r.scaled;const c=n.norm=t.normalizeSettings(o,s,e.chart),u={scale:e.chart.scale,formatter:e.chart.formatter};l&&Object.keys(l).forEach(e=>{c[e]&&t.updateScaleSize(c,e,l[e])});const d=[];if(!i||!Array.isArray(i.items)){const e={data:i,resources:u};let r=t.resolveForItem(e,n.norm,-1);return{settings:n.norm,item:r}}{let e;for(let r=0,o=i.items.length;r<o;r++){e={datum:i.items[r],data:i,resources:u};let o=t.resolveForItem(e,n.norm,r);o.data=i.items[r],d.push(o)}}return{settings:n.norm,items:d}}}}({chart:a}),S=!1;const k={nodes:[],chart:a,config:v.brush||{},renderer:null},C={tap:[],over:[]},E=[],M={},R=zQ({},b);function _(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const i=void 0!==e[t],o=void 0!==b[t];let a;for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return i&&("function"==typeof e[t]?a=e[t].call(M,...l):r&&(a=e[t])),o&&("function"==typeof b[t]?a=b[t].call(R,...l):r&&(a=b[t])),i||o||(a=n.call(M,...l)),a}}const A=_("preferredSize",()=>0,!0),I=_("resize",e=>e.inner),P=_("created"),T=_("beforeMount"),D=_("mounted"),O=_("beforeUnmount"),N=_("beforeUpdate"),q=_("updated"),L=_("beforeRender"),j=_("beforeDestroy"),z=_("destroyed"),F=e.render,$=()=>{v.brush&&(v.brush.consume||[]).forEach(e=>{e.context&&e.style&&E.push(g4(k,e))})},B=()=>{v.brush&&(v.brush.trigger||[]).forEach(e=>{"over"===e.on?C.over.push(e):C.tap.push(e)})};Object.defineProperty(k,"data",{get:()=>x});const H=v.renderer||e.renderer,V=H?d||c.renderer(H)():d||c.renderer()();"function"==typeof V.settings&&V.settings(v.rendererSettings),k.renderer=V;const W={resources:a.logger?{logger:a.logger()}:{}};let U=z4($4(v,A,a.logger()),W);const G=e=>{e.key=v.key,e.element=V.element()},Y=()=>{};Y.dockConfig=()=>U,Y.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(b=e.settings,v=zQ(!0,{},r,e.settings),U=z4($4(v,A,a.logger()),W),k.config=v.brush||{}),v.scale&&(f=a.scale(v.scale)),v.data){const e=v.rendererSettings,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=U2(v.data,{dataset:a.dataset,collection:a.dataCollection},{logger:a.logger()},a.dataCollection);t?t.isFirst?(x=n,x.items&&(x.items=[...n.items])):x.items&&(x.items=[...x.items,...n.items||[]]):x=n}else x=f?f.data():[];"string"==typeof v.formatter||"object"==typeof v.formatter?h=a.formatter(v.formatter):f&&f.data().fields&&(h=f.data().fields[0].formatter()),y=u.style(v.style||{})},Y.resize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=I({inner:e,outer:t});g=n?V.size(n):V.size(e),R.rect=zQ(!0,{computedPhysical:g.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),g=zQ(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},g)},Y.getRect=()=>R.rect;const K=()=>{const e=V.renderArgs?V.renderArgs.slice(0):[],t=v.rendererSettings;let n=x;const r="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return x.items&&r&&(n=VQ(VQ({},x),{},{items:x.items.slice(r.start,r.end)})),e.push({data:n}),e};let X,J,Q;function Z(e){const t=v.rendererSettings,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?k.nodes=[...e||[]]:k.nodes&&(k.nodes=[...k.nodes,...e||[]]):k.nodes=e}Y.beforeMount=T,Y.beforeRender=()=>{L({size:g})},Y.render=()=>{const e=F.call(M,...K());Z(e),V.render(e),X=e,J=R.rect.computed},Y.hide=()=>{Y.unmount(),V.size({x:0,y:0,width:0,height:0}),V.clear()},Y.beforeUpdate=()=>{N({settings:v,data:x})},Y.update=()=>{Q&&Q.stop();const e=v,t=e.rendererSettings,n=e.brush,r=e.animations;if("function"==typeof(null==t?void 0:t.transform)&&t.transform())return V.render(),void(X=null);const i=F.call(M,...K());Z(i),E.forEach(e=>e.cleanUp()),E.length=0,C.tap=[],C.over=[],n&&($(),B()),E.forEach(e=>{e.isActive()&&e.update()}),X&&r&&("function"==typeof r.enabled?r.enabled():r.enabled)?(r.compensateForLayoutChanges&&r.compensateForLayoutChanges({currentNodes:X,currentRect:R.rect.computed,previousRect:J}),Q=function(e,t,n,r){let i,o=e.old,a=e.current,s=t.renderer,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},d={nodes:[],ips:[]},p=[],f=null;const h=n.trackBy||l4,m={start(){let e={};if(o.forEach((t,n)=>{let r=h(t,n);e[r]=t}),a.forEach((t,n)=>{let r=h(t,n);if(e[r]){if("path"===t.type&&t.points&&t.points.length>0&&"trend"!==t.data.source.key){const n=function(e,t){const n=e.points.filter(e=>!e.dummy),r=t.points.filter(e=>!e.dummy),i=r.map(e=>e.data.major.value),o=n.filter(e=>i.includes(e.data.major.value)).map(e=>e.data.major.value),a=n.filter(e=>o.includes(e.data.major.value)),s=r.filter(e=>o.includes(e.data.major.value));return{old:a,current:s}}(e[r],t);d.ips.push(s4(zQ({},e[r],{points:n.old}),zQ({},t,{points:n.current}))),l.push(zQ({},e[r],{commonPoints:n.old}))}else d.ips.push(s4(e[r],t)),l.push(e[r]);d.nodes.push(t),e[r]=!1}else c.nodes.push(t),c.ips.push(s4(zQ({},t,{r:.001,opacity:0}),t))}),Object.keys(e).forEach(t=>{e[t]&&(u.nodes.push(e[t]),u.ips.push(s4(e[t],zQ({},e[t],{r:1e-4,opacity:0}))))}),p.push({name:"exiting",easing:t4,duration:200,tweens:u.ips,nodes:[...l]}),p.push({name:"updating",easing:r4,duration:400,tweens:d.ips,nodes:[]}),p.push({name:"entering",easing:n4,duration:200,tweens:c.ips,nodes:[...d.nodes]}),n.isMainComponent){var t;const e=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,i=e?l.filter(e).length:l.length,o=r.getValue("animations.updatingStageMeta"),a=o.isInit,s=o.shouldBeRemoved;!1===a?(r.setValue("animations.updatingStageMeta.shouldBeRemoved",0===i),r.setValue("animations.updatingStageMeta.isInit",!0)):r.setValue("animations.updatingStageMeta.shouldBeRemoved",s&&0===i)}p.length&&(f=s.getScene(a),p[0].started=Date.now(),"undefined"!=typeof window&&(i=window.requestAnimationFrame(m.tick)))},tick(){let e=p[0];e||m.stop(),e.started||(e.started=Date.now());let t=(Date.now()-e.started)/e.duration,o=[],a=e.tweens.map(n=>n(e.easing(Math.min(1,t))));const l=n.adjustTweenedNodes;if(l&&l(a),o.push(...a),o.push(...e.nodes),s.render(o),t>=1){p.shift();const e=r.getValue("animations.updatingStageMeta"),t=e.isInit,n=e.shouldBeRemoved;p.length?"updating"===p[0].name&&n&&p.shift():(!0===t&&r.setValue("animations.updatingStageMeta.isInit",!1),m.stop())}i&&(i=window.requestAnimationFrame(m.tick))},stop(){i&&(window.cancelAnimationFrame(i),i=!1)},inProgress:()=>!!i,get targetScene(){return f}};return m}({old:X,current:i},{renderer:V},r,a.storage),Q.start()):V.render(i),X=i,J=R.rect.computed,V.setKey&&"string"==typeof b.key&&V.setKey(b.key)},Y.updated=q,Y.destroy=()=>{Y.unmount(),j(m),V.destroy(),z(),m=null};const ee=e=>{k.nodes=e,E.forEach(e=>{e.isActive()&&e.update()}),V.render(e)};return F4(M,e,{settings:()=>v,data:()=>x,scale:()=>f,formatter:()=>h,renderer:()=>V,chart:()=>a,dockConfig:()=>U,mediator:()=>l,instance:()=>R,rect:()=>R.rect,style:()=>y,update:()=>ee,registries:()=>c,resolver:()=>w,symbol:()=>j4(c.symbol)}),F4(R,b,{settings:()=>v,data:()=>x,scale:()=>f,formatter:()=>h,renderer:()=>V,chart:()=>a,dockConfig:()=>U,mediator:()=>l,style:()=>y,_DO_NOT_USE_getInfo:o.bind(M),isVisible:()=>S}),Y.getBrushedShapes=function(e,t,n){const r=[];if(v.brush&&v.brush.consume){const i=a.brush(e),o=V.findShapes("*");v.brush.consume.filter(t=>t.context===e).forEach(e=>{for(let a=0;a<o.length;a++){const s=o[a];s.data&&i.containsMappedData(s.data,n||e.data,t)&&(G(s),r.push(s),o.splice(a,1),a--)}})}return r},Y.findShapes=e=>{var t;const n=(null!==(t=Q)&&void 0!==t&&t.inProgress()?Q.targetScene:V).findShapes(e);for(let e=0,t=n.length;e<t;e++)G(n[e]);return n},Y.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=V.itemsAt(e);let r;r=t&&"stop"===t.propagation&&n.length>0?[n.pop().node]:n.map(e=>e.node);for(let e=0,t=r.length;e<t;e++)G(r[e]);return r},Y.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[];y4({nodes:e,action:t.action||"toggle",trigger:t,chart:a,data:k.data})},Y.mount=()=>{m=V.element&&V.element()?m:V.appendTo(s),V.setKey&&"string"==typeof b.key&&V.setKey(b.key),v.brush&&($(),B()),B4(R,p,b),B4(M,p,e),S=!0},Y.mounted=()=>D(m),Y.unmount=()=>{[R,M].forEach(e=>{!function(e,t){e.eventListeners&&(e.eventListeners.forEach(e=>{let n=e.event,r=e.listener;t.removeListener(n,r)}),e.eventListeners.length=0),e.emit=()=>{}}(e,p)}),C.tap=[],C.over=[],E.forEach(e=>{e.cleanUp()}),E.length=0,O(),S=!1},Y.onBrushTap=e=>{C.tap.forEach(t=>{(function(e){let t=e.e,n=e.t,r=e.config;return b4({collisions:v4(t,n,r.renderer),t:n,config:r,action:x4(n.action,t,"toggle")})})({e:e,t:t,config:k})&&"stop"===t.globalPropagation&&a.toggleBrushing(!0)})},Y.onBrushOver=e=>{C.over.forEach(t=>{(function(e){let t=e.e,n=e.t,r=e.config;return b4({collisions:v4(t,n,r.renderer),t:n,config:r,action:x4(n.action,t,"set")})})({e:e,t:t,config:k})&&"stop"===t.globalPropagation&&a.toggleBrushing(!0)})},Y.def=M,Y.ctx=R,Y.renderer=()=>V,Y.set({settings:b}),P(),Y}const V4=["__proto__","constructor","prototype"];function W4(e){const t=zQ(!0,{},e),n={getAll:()=>t,getValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return n;const r=t.split(".");let i=e;for(let e=0;e<r.length;++e){const t=r[e];if(void 0===i[t])return n;i=i[t]}return i}(t,e,n),setValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return;const r=t.split("."),i=r[r.length-1];let o=e;for(let e=0;e<r.length-1;++e){const t=r[e];if(V4.includes(t))throw new Error("Unsafe key in path: ".concat(t));void 0===o[t]&&(o[t]=Number.isNaN(+r[e+1])?{}:[]),o=o[t]}void 0!==n?o[i]=n:delete o[i]}(t,e,n)};return n}function U4(e,t,n){const r=M4(function(e,t){const n=D4(e,t)/D4(t,t)||1;return{x:t.x*n,y:t.y*n}}(R4(n,e),R4(t,e)),e);return r}function G4(e,t,n){return T4(e,n)+T4(t,n)-T4(e,t)<1e-12}function Y4(e,t){return e.x>=t.x&&e.x+e.width<=t.x+t.width&&e.y>=t.y&&e.y+e.height<=t.y+t.height}function K4(e){return e.x1===e.x2&&e.y1===e.y2}function X4(e){return e.width<=0||e.height<=0}function J4(e){return e.r<=0}function Q4(e){return e.edges.length<=2}function Z4(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=a6(e,ZQ(t.edges[r])),!0===n)return!0;return!1}function e6(e,t){let n=!1;const r=t.numPolygons,i=t.polygons;for(let t=0;t<r;t++){if(n=m6(e,i[t]),!0===n)return!0}return!1}function t6(e,t){if(J4(e))return!1;return P4({x:e.cx,y:e.cy},t)<=e.r**2}function n6(e,t){if(X4(t)||J4(e))return!1;const n=t.width/2,r=t.height/2,i=t.x+n,o=t.y+r,a=e.r,s=e.cx,l=e.cy,c=Math.abs(s-i),u=Math.abs(l-o);if(c>n+a||u>r+a)return!1;if(c<=n||u<=r)return!0;return(c-n)**2+(u-r)**2<=a**2}function r6(e,t){if(J4(e)||K4(t))return!1;const n=WQ(XQ(t),2),r=n[0],i=n[1];if(t6(e,r)||t6(e,i))return!0;const o={x:e.cx,y:e.cy},a=U4(r,i,o);return P4(a,o)<=e.r**2&&G4(r,i,a)}function i6(e,t){if(Q4(t)||J4(e))return!1;if(o6(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let r=0;r<n;r++){if(r6(e,ZQ(t.edges[r])))return!0}return!1}function o6(e,t){if(Q4(e)||!u6(e.boundingRect(),t))return!1;const n=t.x,r=t.y,i=e.vertices;let o,a,s,l,c;for(o=!1,l=-1,a=i.length,s=a-1;++l<a;s=l){if(i[l].x===n&&i[l].y===r)return!0;if(i[l].y===i[s].y&&i[l].y===r&&(n-i[l].x)*(n-i[s].x)<=0)return!0;if(i[l].y<r&&r<=i[s].y||i[s].y<r&&r<=i[l].y){if(c=(i[s].x-i[l].x)*(r-i[l].y)/(i[s].y-i[l].y)+i[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function a6(e,t){if(Q4(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(p6(t,ZQ(e.edges[n])))return!0}const n=WQ(XQ(t),2),r=n[0],i=n[1];return o6(e,r)||o6(e,i)}function s6(e,t){if(Q4(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(d6(t,ZQ(e.edges[n])))return!0}const n=WQ(JQ(t),4),r=n[0],i=n[1],o=n[2],a=n[3];return o6(e,r)||o6(e,i)||o6(e,o)||o6(e,a)}function l6(e,t){return!X4(e)&&!X4(t)&&(e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height)}function c6(e,t){if(X4(e)||X4(t))return!1;return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}].every(t=>u6(e,t))}function u6(e,t){return!X4(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function d6(e,t){if(K4(t)||X4(e))return!1;const n=WQ(XQ(t),2),r=n[0],i=n[1];if(u6(e,r)||u6(e,i))return!0;const o=JQ(e);let a=o.length;for(let e=0;e<a;e++){if(p6(ZQ([o[e],o[3!==e?e+1:0]]),t))return!0}return!1}function p6(e,t){const n=WQ(XQ(e),2),r=n[0],i=n[1],o=WQ(XQ(t),2),a=o[0],s=o[1],l=A4(i,r),c=I4(i,r),u=A4(s,a),d=I4(s,a),p=A4(r,a),f=I4(r,a);let h=d*l-u*c;const m=u*f-d*p,g=l*f-c*p;let y,b;if(0===l&&0===c)return!1;if(0===u&&0===d)return!1;if(0===h){if(0===m&&0===g){if(0===l){if(0===c)return r.x===i.x&&r.y===i.y;y=I4(a,r)/c,b=I4(s,r)/c}else y=(a.x-r.x)/l,b=(s.x-r.x)/l;return!(y<0&&b<0||y>1&&b>1)}return!1}const v=m/h;return h=g/h,v>=0&&v<=1&&h>=0&&h<=1}function f6(e,t){if(K4(e))return!1;const n=WQ(XQ(e),2);return G4(n[0],n[1],t)}function h6(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!l6(n,r)&&(c6(n,r)?Z4(e,t):Z4(t,e))}function m6(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!l6(n,r)&&(c6(r,n)?function(e,t){let n=!1;const r=e.numPolygons,i=e.polygons;for(let e=0;e<r;e++)if(n=h6(t,i[e]),!0===n)return!0;return!1}(e,t):function(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=b6(e,ZQ(t.edges[r])),!0===n)return!0;return!1}(e,t))}function g6(e,t){if(J4(e))return!1;if(y6(t,{x:e.cx,y:e.cy}))return!0;const n=t.numPolygons,r=t.polygons;for(let t=0;t<n;t++){const n=r[t],i=n.edges.length;for(let t=0;t<i;t++){if(r6(e,ZQ(n.edges[t])))return!0}}return!1}function y6(e,t){if(!u6(e.boundingRect(),t))return!1;const n=t.x,r=t.y,i=e.numPolygons;let o,a,s,l,c,u,d=!1;for(a=0;a<i;a++)for(o=e.vertices[a],c=-1,s=o.length,l=s-1;++c<s;l=c){if(o[c].x===n&&o[c].y===r)return!0;if(o[c].y===o[l].y&&o[c].y===r&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<r&&r<=o[l].y||o[l].y<r&&r<=o[c].y){if(u=(o[l].x-o[c].x)*(r-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(d=!d)}}return d}function b6(e,t){const n=WQ(XQ(t),2),r=n[0],i=n[1];if(y6(e,r)||y6(e,i))return!0;const o=e.numPolygons,a=e.polygons;for(let e=0;e<o;e++){const n=a[e];for(let e=0,r=n.edges.length;e<r;e++){if(p6(t,ZQ(n.edges[e])))return!0}}return!1}function v6(e,t){const n=WQ(JQ(t),4),r=n[0],i=n[1],o=n[2],a=n[3];if(y6(e,r)||y6(e,i)||y6(e,o)||y6(e,a))return!0;const s=e.numPolygons,l=e.polygons;for(let e=0;e<s;e++){const n=l[e];for(let e=0,r=n.edges.length;e<r;e++){if(d6(t,ZQ(n.edges[e])))return!0}}return!1}const x6=/^\$/,w6="@extend";function S6(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function k6(e,t,n){if("string"==typeof e){let r=t[e];return-1!==n.indexOf(e)&&S6(e),x6.test(r)?(n.push(e),k6(r,t,n)):r}let r=e;const i=zQ(!0,{},t,e),o={};if(e[w6]){const o=e[w6];-1!==n.indexOf(o)&&S6(o);let a=n.slice();a.push(o),r=zQ(!0,{},k6(i[o],t,a),e)}return Object.keys(r).forEach(e=>{let t=n.slice();if(e===w6||x6.test(e))return;o[e]=r[e];let a=o[e];x6.test(a)&&a in i?(-1!==n.indexOf(a)&&S6(a),t.push(a),a=i[a],"object"==typeof a||x6.test(a)&&a in i?o[e]=k6(a,i,t):o[e]=a):"object"==typeof a&&(o[e]=k6(a,i,t))}),o}function C6(e,t){return k6(e,t,[])}function E6(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e;const r=e=>{e.forEach(e=>{const n=Array.isArray(e.colors[0])?e.colors:[e.colors];t[e.key]={colors:n,sizes:n.map(e=>e?e.length:0)}})},i={palette:(e,n)=>((e,n)=>{const r=t[e];if(!r)return[];const i=r.sizes;for(let e=0;e<i.length;e++)if(n<=i[e])return r.colors[e];return r.colors[i.length-1]})(e,n),setPalettes:r,style:e=>C6(e,n),setStyle:t=>{n=zQ({},e,t)}};return r(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),i}function M6(e){e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height)}function R6(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return zQ(!0,t,e),t.center.minWidthRatio=Math.min(Math.max(t.center.minWidthRatio,0),1),t.center.minHeightRatio=Math.min(Math.max(t.center.minHeightRatio,0),1),t.center.minWidth=Math.max(t.center.minWidth,0),t.center.minHeight=Math.max(t.center.minHeight,0),t}function _6(e,t,n,r,i){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:r,margin:isNaN(i)?0:i}}function A6(e,t,n){if(void 0===e.cachedSize){const r=e.config.dock();let i,o=e.comp.preferredSize({inner:t,outer:n,dock:r});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},i="top"===r||"bottom"===r?o.height:"right"===r||"left"===r?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(i),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function I6(e,t){switch(t.config.dock()){case"top":e.y+=t.cachedSize,e.height-=t.cachedSize;break;case"bottom":e.height-=t.cachedSize;break;case"left":e.x+=t.cachedSize,e.width-=t.cachedSize;break;case"right":e.width-=t.cachedSize}}function P6(e,t){const n=t.edgeBleed;n&&(e.left=Math.max(e.left,n.left||0),e.right=Math.max(e.right,n.right||0),e.top=Math.max(e.top,n.top||0),e.bottom=Math.max(e.bottom,n.bottom||0))}function T6(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);const r=e.width-(t.x+t.width);r<n.right&&(t.width-=n.right-r),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);const i=e.height-(t.y+t.height);i<n.bottom&&(t.height-=n.bottom-i)}function D6(e,t,n,r,i){const o=zQ({},t),a=zQ({},n);I6(o,r),P6(a,r),T6(e,o,a);const s=function(e,t,n){const r=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),i=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=r&&t.height>=i}(e,o,i);return!!s&&(I6(t,r),P6(n,r),!0)}function O6(e){return{x:e.margin.left+e.x*e.scaleRatio.x,y:e.margin.top+e.y*e.scaleRatio.y,width:e.width*e.scaleRatio.x,height:e.height*e.scaleRatio.y}}function N6(e){return QQ([].concat(...e.map(JQ)))}function q6(e){let t=e.visible,n=e.layoutRect,r=e.reducedRect,i=e.containerRect,o=e.translation;const a=_6(r.x,r.y,r.width,r.height),s=_6(r.x,r.y,r.width,r.height),l={},c=t.slice(),u=c.slice().sort((e,t)=>e.config.displayOrder()-t.config.displayOrder());return t.sort((e,t)=>{if(e.referencedDocks.length>0&&t.referencedDocks.length>0)return 0;if(t.referencedDocks.length>0)return-1;if(e.referencedDocks.length>0)return 1;const n=e.config.displayOrder()-t.config.displayOrder();return 0===n?c.indexOf(e)-c.indexOf(t):n}).forEach(e=>{let t={},c={};switch(e.config.dock()){case"top":t.height=c.height=e.cachedSize,t.width=n.width,c.width=a.width,t.x=n.x,c.x=a.x,t.y=c.y=a.y-e.cachedSize,a.y-=e.cachedSize,a.height+=e.cachedSize;break;case"bottom":t.x=n.x,c.x=a.x,t.y=c.y=a.y+a.height,t.width=n.width,c.width=a.width,t.height=c.height=e.cachedSize,a.height+=e.cachedSize;break;case"left":t.x=c.x=s.x-e.cachedSize,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.x-=e.cachedSize,s.width+=e.cachedSize;break;case"right":t.x=c.x=s.x+s.width,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.width+=e.cachedSize;break;case"center":t.x=c.x=r.x,t.y=c.y=r.y,t.width=c.width=r.width,t.height=c.height=r.height;break;default:if(e.referencedDocks.length>0){const n=e.referencedDocks.map(e=>l[e]).filter(e=>!!e);n.length>0&&(t=N6(n.map(e=>e.outerRect)),c=N6(n.map(e=>e.r)))}}e.key&&(l[e.key]={r:c,outerRect:t}),function(e,t,n,r){const i={x:r.width/n.width,y:r.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const e=i.x<i.y,t=Math.min(i.x,i.y);i.x=t,i.y=t;const a=e?"height":"width",s=(r[a]-n[a]*i.x)*n.align;o.left=e?0:s,o.top=e?s:0}e.scaleRatio=i,e.margin=o,t.scaleRatio=i,t.margin=o,n.scaleRatio=i,n.margin=o}(c,t,n,i),c.edgeBleed=e.edgeBleed,c.computed=O6(c),t.edgeBleed=e.edgeBleed,t.computed=O6(t),c.x+=o.x,c.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(c,t),e.cachedSize=void 0,e.edgeBleed=void 0}),u}function L6(e,t,n){const r=e.layoutModes||{},i=t.minimumLayoutMode();let o=t.show();return o&&"object"==typeof i?o=r[i.width]&&r[i.height]&&n.width>=r[i.width].width&&n.height>=r[i.height].height:o&&void 0!==i&&(o=r[i]&&n.width>=r[i].width&&n.height>=r[i].height),o}function j6(e){if(!e.resize||"function"!=typeof e.resize)throw new Error("Component is missing resize function");if(!e.dockConfig&&!e.preferredSize)throw new Error("Component is missing preferredSize function")}function z6(e){let t=R6(e);const n={};return n.layout=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||isNaN(e.x)||isNaN(e.y)||isNaN(e.width)||isNaN(e.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};const r=function(e,t){const n={x:0,y:0,width:0,height:0},r={x:0,y:0,width:0,height:0};return n.width=e.width||0,n.height=e.height||0,void 0!==t.size&&(n.width=isNaN(t.size.width)?n.width:t.size.width,n.height=isNaN(t.size.height)?n.height:t.size.height),void 0!==t.logicalSize?(r.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,r.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,r.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),r.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(r.width=n.width,r.height=n.height,r.preserveAspectRatio=!1),M6(r),M6(n),{logicalContainerRect:r,containerRect:n}}(e,t),i=r.logicalContainerRect,o=r.containerRect,a=function(e,t,n){const r=[],i=[];for(let o=0;o<e.length;++o){const a=e[o];j6(a);let s=a.dockConfig;const l=a.key,c=s.dock(),u=/@/.test(c)?c.split(",").map(e=>e.replace(/^\s*@/,"")):[];L6(t,s,n)?r.push({comp:a,key:l,config:s,referencedDocks:u}):i.push({comp:a,key:l,config:s,referencedDocks:u})}return[r,i]}(n,t,i),s=WQ(a,2),l=s[0],c=s[1],u=function(e){let t=e.layoutRect,n=e.visible,r=e.hidden,i=e.settings;const o=_6(t.x,t.y,t.width,t.height),a={left:0,right:0,top:0,bottom:0},s=n.slice();s.sort((e,t)=>e.config.prioOrder()-t.config.prioOrder());for(let e=0;e<s.length;++e){const n=s[e];A6(n,o,t),D6(t,o,a,n,i)||(r.push(s.splice(e,1)[0]),--e)}!function(e,t){if(0!==t.length)for(let n=0;n<e.length;++n){let r=e[n];if(r.referencedDocks.length){const i=r.referencedDocks.every(e=>t.some(t=>t.key===e));i&&t.push(e.splice(n,1)[0])}}}(n,r);const l=n.filter(e=>-1!==s.indexOf(e));return n.length=0,n.push(...l),T6(t,o,a),o}({layoutRect:i,visible:l,hidden:c,settings:t}),d=q6({visible:l,layoutRect:i,reducedRect:u,containerRect:o,translation:{x:e.x,y:e.y}});return c.forEach(e=>{e.comp.visible=!1;const t=_6();e.comp.resize(t,t)}),{visible:l.map(e=>e.comp),hidden:c.map(e=>e.comp),ordered:d.map(e=>e.comp)}},n.settings=function(e){t=R6(e)},n}const F6=(e,t)=>{for(let n=0;n<e.length;n++){const r=e[n];if(r.hasKey&&r.key===t)return e[n]}return null},$6=e=>null==e?void 0:e.map(e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(VQ(VQ({},n),{},{children:$6(e.children)}))}}),B6=(e,t)=>({visible:[],hidden:t,ordered:[]}),H6=e=>(t,n)=>{var r;const i=n.map((e,t)=>{const n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:t=>n.computePreferredSize(VQ(VQ({},t),{},{children:$6(e.children)}))}}),o=e=>n[e.index],a=null!==(r=e(t,i))&&void 0!==r?r:{},s=a.visible,l=void 0===s?i:s,c=a.hidden,u=void 0===c?[]:c,d=a.ordered,p=void 0===d?l:d;return{visible:l.map(o),hidden:u.map(o),ordered:p.map(o)}},V6=e=>"function"==typeof e?H6(e):(e=>{const t=z6(e);return H6((e,n)=>t.layout(e,n))})(e);function W6(e,t,n){const r=t.left-n.left,i=t.top-n.top,o=eZ(e),a=zQ(!0,{},e);switch(o){case"circle":a.cx+=r,a.cy+=i;break;case"polygon":for(let e=0,t=a.vertices.length;e<t;e++){const t=a.vertices[e];t.x+=r,t.y+=i}break;case"geopolygon":for(let e=0;e<a.vertices.length;e++){const t=a.vertices[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n.x+=r,n.y+=i}}break;case"line":a.x1+=r,a.y1+=i,a.x2+=r,a.y2+=i;break;case"point":case"rect":a.x+=r,a.y+=i}return a}function U6(e,t){const n=[];let r=0;t.forEach(e=>{n.push(r),r++;const t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(r+=t.length)}),t.forEach((t,r)=>((e,t,n)=>{const r=t.instance.renderer().element();if(isNaN(n)||!r||!e||!e.children)return;const i=e.children[Math.max(0,n)];if(r===i)return;const o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==i?(e.insertBefore(r,i),o&&o.forEach(t=>{e.insertBefore(t,r)})):(o&&o.forEach(t=>{e.appendChild(t,r)}),e.appendChild(r))})(e,t,n[r]))}function G6(e,t){let n=e.element,r=e.data,i=void 0===r?[]:r,o=e.settings,a=void 0===o?{}:o,s=e.on,l=void 0===s?{}:s;const c=t.registries,u=t.logger,d=E6(t.style,t.palettes),p=[],f=zQ({},e),h=function(){const e={};return q3.mixin(e),e}();let m=[],g=null,y=null,b=null,v=[],x=()=>{},w=()=>{};const S={};let k=!1;const C=function(e){let t=e.createComponent;const n={};let r=[],i=[];const o=e=>{const n=t(e);return n&&(r.push(n),e.components&&(n.children=e.components.map(e=>o(e)).filter(e=>!!e))),n},a=e=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)},s=(e,t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n],i=t.find(e=>r.hasKey&&r.key===e.key);i?r.children&&i.components&&s(r.children,i.components):(e.splice(n,1),a(r),r.children&&s(r.children,[]),r.instance.destroy())}},l=e=>{let t=e.compList,n=e.data,r=e.excludeFromUpdate,i=e.formatters,a=e.scales;return e.settingsList.map(e=>{const s=F6(t,e.key);return r.indexOf(e.key)>-1?(delete s.updateWith,s):s?(e.rendererSettings&&"function"==typeof s.instance.renderer().settings&&s.instance.renderer().settings(e.rendererSettings),e.rendererSettings&&"function"==typeof e.rendererSettings.transform&&e.rendererSettings.transform()?(s.applyTransform=!0,s):(s.updateWith={formatters:i,scales:a,data:n,settings:e},e.components&&(s.children=l({compList:s.children||[],data:n,excludeFromUpdate:r,formatters:i,scales:a,settingsList:e.components})),s)):o(e)}).filter(e=>!!e)},c=e=>{let t=e.components,n=e.hidden,r=e.layoutFn,i=e.ordered,o=e.rect,a=e.visible;const s=r(o,t),l=s.visible,u=s.hidden,d=s.ordered;a.push(...l),n.push(...u),i.push(...d),l.forEach(e=>{if(e.children){var t,r;const o=V6(null!==(t=null===(r=e.settings)||void 0===r?void 0:r.strategy)&&void 0!==t?t:{});c({components:e.children,hidden:n,layoutFn:o,ordered:i,rect:e.instance.getRect(),visible:a})}}),u.forEach(e=>{e.children&&c({components:e.children,hidden:n,layoutFn:B6,ordered:i,rect:null,visible:a})})};return n.destroy=()=>{r.forEach(e=>e.instance.destroy()),r=[],i=[]},n.findComponentByKey=e=>F6(r,e),n.forEach=e=>{r.forEach(e)},n.layout=e=>{let t=e.layoutSettings,n=e.rect;const r=[],o=[],a=[],s=V6(t);return c({components:i,hidden:o,layoutFn:s,ordered:a,rect:n,visible:r}),{visible:r,hidden:o,ordered:a}},n.set=e=>{let t=e.components;i=t.map(e=>o(e)).filter(e=>!!e)},n.update=e=>{let t=e.components,n=e.data,r=e.excludeFromUpdate,o=e.formatters,a=e.scales;s(i,t),i=l({compList:i,data:n,excludeFromUpdate:r,formatters:o,scales:a,settingsList:t})},n}({createComponent:e=>{if(!c.component.has(e.type))return u.warn("Unknown component: ".concat(e.type)),!1;return{instance:H4(c.component(e.type),{settings:e,chart:f,mediator:h,registries:c,theme:d,container:n}),settings:zQ(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function E(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const r="function"==typeof e[t];let i;for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return i=r?e[t].call(f,...a):n.call(f,...a),i}}const M=()=>{let e;a.dockLayout?(u.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=a.dockLayout):e=a.strategy;const t=function(e){if("function"==typeof e.getBoundingClientRect){const t=e.getBoundingClientRect();return{x:0,y:0,width:t.width,height:t.height}}return{x:0,y:0,width:0,height:0}}(n);return C.layout({layoutSettings:e,rect:t})},R=E("created"),_=E("beforeMount"),A=E("mounted"),I=E("beforeUpdate"),P=E("updated"),T=E("beforeRender"),D=E("beforeDestroy"),O=E("destroyed"),N=function(e,t){let n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).partialData;const r=t.formatters,i=void 0===r?{}:r,o=t.scales,a=void 0===o?{}:o,s=t.scroll,l=void 0===s?{}:s;x=function(e,t){let n=t.types,r=t.logger;const i={},o=[];return Array.isArray(e)?o.push(...e):(r.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach((e,t)=>{let o=n(e.type);if(o){let n=e.key;void 0===e.key&&(r.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),n=t);let a=o({key:n,data:e.data,config:e.config});i[n]=a}}),e=>e?i[e]:i[Object.keys(i)[0]]}(e,{logger:u,types:c.data}),n||Object.keys(S).forEach(e=>S[e].clear()),t.palettes&&d.setPalettes(t.palettes),t.style&&d.setStyle(t.style),w=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:U2;const i={};return(e||[]).forEach(e=>{if(!e.key)throw new Error('Data collection is missing "key" property');if("object"==typeof e.data&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");i[e.key]=()=>r(e.data,t,n)}),e=>{let t,n;if("string"==typeof e?t=e:"object"==typeof e&&(t=e.key,n=e),!(t in i))throw new Error("Unknown data collection: ".concat(t));"function"==typeof i[t]&&(i[t]=i[t]());let r=i[t];if(n&&n.fields&&n.fields.filter){let e=r.fields.filter(n.fields.filter);r.fields.length!==e.length&&(r=zQ(r,{fields:e}))}return r}}(t.collections,{dataset:x},{logger:u});const p={theme:d,logger:u};g=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:T3;const i={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"scale"in o&&e[o.scale]&&(a=o.scale),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o,t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(a,{dataset:x,collection:w},VQ(VQ({},p),{},{scale:c.scale})),y=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:G2;const i={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"formatter"in o&&e[o.formatter]?a=o.formatter:"object"==typeof o&&"type"in o&&e[o.type]&&(a=o.type),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o||{},t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(i,{dataset:x,collection:w},VQ(VQ({},p),{},{formatter:c.formatter})),b=function(e,t){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=j3(e[r],t?t[r]:null));return n}(l,b)};function q(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},r=e.filter(e=>!!e.key).map(e=>e.key);v.forEach(e=>{e.key&&-1!==r.indexOf(e.key)?t[e.key]=e:e.destroy()}),v=e.map(e=>{const r=e.key&&t[e.key]?t[e.key]:c.interaction(e.type)(f,h,n);return r.set(e),r})}const L=e=>{const t=n.getBoundingClientRect(),r="clientX"in e?e.clientX:e.x,i="clientY"in e?e.clientY:e.y,o={x:r-t.left,y:i-t.top},a=[];return m.forEach(e=>{const t=e.instance.getRect();u6(t.computedPhysical?t.computedPhysical:{x:t.margin.left+t.x*t.scaleRatio.x,y:t.margin.top+t.y*t.scaleRatio.y,width:t.width*t.scaleRatio.x,height:t.height*t.scaleRatio.y},o)&&a.push(e)}),a},j=()=>{if(p.length||!n)return;Object.keys(l).forEach(e=>{const t=l[e].bind(f);n.addEventListener(e,t),p.push({key:e,listener:t})});const e={},t=t=>{t.touches?(e.x=t.touches[0].clientX,e.y=t.touches[0].clientY,e.multiTouch=t.touches.length>1):(e.x=t.clientX,e.y=t.clientY,e.multiTouch=!1),e.time=Date.now(),e.comps=L(e)},r=t=>{const n=e.comps||L(t);if(!n.every(e=>e.instance.def.disableTriggers)&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=UQ(e),r=n?e.changedTouches[0]:e,i=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(r.clientX-t.x),a=isNaN(t.y)?0:Math.abs(r.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&a<=12&&i<=300}(t,e)))for(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),k){k=!1;break}}},i=[];i.push({key:"mousedown",listener:t}),i.push({key:"mouseup",listener:r}),function(e){return"ontouchstart"in e&&"ontouchend"in e||navigator.maxTouchPoints>1}(n)&&(i.push({key:"touchstart",listener:t}),i.push({key:"touchend",listener:r})),i.push({key:"mousemove",listener:e=>{const t=L(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),k){k=!1;break}}}}),i.forEach(e=>{n.addEventListener(e.key,e.listener),p.push(e)})},z=()=>{p.forEach(e=>{let t=e.key,r=e.listener;return n.removeEventListener(t,r)}),p.length=0},F=()=>{n.innerHTML="",(()=>{const e=a.components,t=void 0===e?[]:e;T(),N(i,a),C.set({components:t});const r=M(),o=r.visible,s=r.hidden,l=r.ordered;m=o,s.forEach(e=>{e.instance.hide(),e.visible=!1}),o.forEach(e=>e.instance.beforeMount()),o.forEach(e=>e.instance.mount()),o.forEach(e=>e.instance.beforeRender()),o.forEach(e=>e.instance.render()),o.forEach(e=>e.instance.mounted()),o.forEach(e=>{e.visible=!0}),U6(n,l)})(),j(),q(a.interactions)};return f.layoutComponents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.excludeFromUpdate,n=void 0===t?[]:t;e.data&&(i=e.data),e.settings&&(a=e.settings,q(e.settings.interactions)),I(),N(i,a);const r=a,o=r.formatters,s=r.scales,l=r.components,c=void 0===l?[]:l;C.update({components:c,data:i,excludeFromUpdate:n,formatters:o,scales:s}),C.forEach(e=>{e.updateWith&&e.instance.set(e.updateWith)}),C.forEach(e=>{e.updateWith&&e.instance.beforeUpdate()}),M()},f.update=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.partialData,r=e.excludeFromUpdate,o=void 0===r?[]:r;let s;e.data&&(i=e.data),e.settings&&(a=e.settings,q(e.settings.interactions)),I(),N(i,a,{partialData:t});const l=a,c=l.formatters,u=l.scales,d=l.components,p=void 0===d?[]:d;C.update({components:p,data:i,excludeFromUpdate:o,formatters:c,scales:u}),C.forEach(e=>{e.updateWith&&e.instance.set(e.updateWith)}),C.forEach(e=>{e.updateWith&&e.instance.beforeUpdate()});const f=[],h=[];let g;if(t)C.forEach(e=>{(e.updateWith||e.applyTransform)&&e.visible&&f.push(e)}),g=f;else{const e=M(),t=e.visible,n=e.hidden,r=e.ordered;m=t,g=t,s=r,t.forEach(e=>{e.updateWith&&e.visible?f.push(e):h.push(e)}),n.forEach(e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1})}h.forEach(e=>e.instance.beforeMount()),h.forEach(e=>e.instance.mount()),g.forEach(e=>e.instance.beforeRender()),g.forEach(e=>{(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()}),t||U6(n,s),h.forEach(e=>e.instance.mounted()),f.forEach(e=>e.instance.updated()),m.forEach(e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1}),P()},f.destroy=()=>{D(),C.destroy(),z(),q(),delete f.update,delete f.destroy,O()},f.getAffectedShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=[];return m.filter(e=>null==r||e.key===r).forEach(r=>{const o=r.instance.getBrushedShapes(e,t,n);i=[...i,...o]}),i},f.findShapes=e=>{let t=[];return m.forEach(n=>{const r=n.instance.findShapes(e);t=[...t,...r]}),t},f.componentsFromPoint=e=>L(e).map(e=>e.instance.ctx),f.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[];const i=n.getBoundingClientRect();let o=m;if(Array.isArray(t.components)&&t.components.length>0){const e=t.components.map(e=>e.key);o=m.filter(t=>-1!==e.indexOf(t.key)).map(n=>({instance:n.instance,opts:t.components[e.indexOf(n.key)]}))}for(let n=o.length-1;n>=0;n--){const a=o[n],s=W6(e,i,a.instance.renderer().element().getBoundingClientRect()),l=a.instance.shapesAt(s,a.opts),c=l.length>0&&"stop"===t.propagation;if(r=[...r,...l],r.length>0&&c)return r}return r},f.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<t.components.length;n++){const r=t.components[n].key;m.filter(e=>r===e.key).forEach(r=>{let i=e.filter(e=>e.key===r.key);r.instance.brushFromShapes(i,t.components[n])})}},f.scroll=function(){return function(e,t){return t[e]||(t[e]=L3()),t[e]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",b)},f.dataset=e=>x(e),f.dataCollection=e=>w(e),f.scales=function(){return g.all()},f.formatters=function(){return y.all()},f.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return S[e]||(S[e]=e4()),S[e]},f.scale=function(e){return g.get(e)},f.formatter=function(e){return y.get(e)},f.toggleBrushing=function(e){k=void 0!==e?e:!k},f.component=e=>{const t=C.findComponentByKey(e);return null==t?void 0:t.instance.ctx},f.logger=()=>u,f.theme=()=>d,f.storage=W4({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(f,"interactions",{get:()=>({instances:v,on(){j(),v.forEach(e=>e.on())},off(){z(),v.forEach(e=>e.off())}})}),R(),n&&(_(),F(),A(n),f.element=n),f}const Y6=e=>{let t=a0(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var K6=a0();function X6(e,t,n){let r=n.key;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}const J6=e=>e.filter(e=>"number"==typeof e&&!isNaN(e));const Q6=e=>{let t=e.key,n=e.data,r=e.cache,i=e.config;if(!n)return;let o=n;"string"==typeof o&&(o=(e=>{let t=e.data,n=e.config;const r=t.split("\n"),i=r[0],o=r[1];let a=",";if(n&&n.parse&&n.parse.delimiter)a=n.parse.delimiter;else if(i){const e=[/,/,/\t/,/;/];for(let t=0;t<e.length;t++){const n=e[t];if(i&&o){if(n.test(i)&&n.test(o)&&i.split(n).length===o.split(n).length){a=n;break}}else n.test(i)&&(a=n)}}return r.map(e=>e.split(a))})({data:n,config:i})),Array.isArray(o)&&function(e){let t,n=e.source,r=e.data,i=e.cache,o=e.config,a=r;const s=o&&o.parse;Array.isArray(r[0])?s&&!1===s.headers?t=r[0].map((e,t)=>t):(t=r[0],a=r.slice(1)):t=Object.keys(r[0]);const l=!!s&&"function"==typeof s.row&&s.row;let c,u=t;u=s&&"function"==typeof s.fields?s.fields(u.slice()):t.map(e=>({key:e,title:e})),Array.isArray(r[0])?c=u.map(()=>[]):(c={},u.forEach(e=>{c[e.key]=[]}));for(let e=0;e<a.length;e++){const t=l?l(a[e],e,u):a[e];if(t)if(Array.isArray(t))for(let e=0;e<u.length;e++)c[e].push(t[e]);else for(let e=0;e<u.length;e++)c[u[e].key].push(t[u[e].key])}const d=Array.isArray(c)?e=>c[e]:e=>c[u[e].key];for(let e=0;e<u.length;e++){const t=d(e),r=J6(t),o=r.length>0,a=o?"measure":"dimension",s=o?Math.min(...r):NaN,l=o?Math.max(...r):NaN;i.fields.push(T2(zQ({source:n,key:e,title:u[e].title,values:t,min:s,max:l,type:a},u[e]),{value:u[e].value,label:u[e].label}))}}({data:o,cache:r,source:t,config:i})};function Z6(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=e.data,r=e.config;const i={fields:[]},o={key:()=>t,raw:()=>n,field:e=>function(e,t){let n=t.cache;if("number"==typeof e)return n.fields[e];for(let t=0;t<n.fields.length;t++)if(n.fields[t].key()===e)return n.fields[t];for(let t=0;t<n.fields.length;t++)if(n.fields[t].title()===e)return n.fields[t];return null}(e,{cache:i}),fields:()=>i.fields.slice(),extract:e=>function(e,t){const n=Array.isArray(e)?e:[e];let r=[];return n.forEach(e=>{if(void 0!==e.field){const n=t.field(e.field),i=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));const o=L2(e,t),a=o.props,s=o.main,l=Object.keys(a),c=!!e.trackBy,u=typeof e.trackBy,d={},p=[],f=n.items(),h=[];for(let t=0;t<f.length;t++){const n=f[t];if(s.filter&&!s.filter(n))continue;const r=X6(s,n,{key:i});l.forEach(e=>{const o=a[e];let s=o.field?o.field.items()[t]:n;r[e]=X6(o,s,{key:i})}),c&&F2({cfg:e,itemData:n,obj:r,target:p,tracker:d,trackType:u}),h.push(r)}r=c?[...r,...z2(p,{main:s,propsArr:l,props:a})]:[...r,...h]}}),r}(e,o),hierarchy:()=>null};return Q6({key:t,data:n,config:r,cache:i}),o}Z6.util={normalizeConfig:L2,collect:z2,track:F2};const e8=a0();e8.default("matrix"),e8("matrix",Z6),e8("default",Z6);const t8=a0();function n8(e,t,n){return Math.max(e,Math.min(t,n))}function r8(e){let t=e.item,n=e.value,r=e.boxCenter,i=e.rendWidth,o=e.rendHeight,a="x",s="y",l=i,c=o,u=n<.5?90:-90;return e.flipXY&&(a="y",s="x",l=o,c=i,u=n<.5?180:0),(0,e.symbol)(zQ({},t.oob,{[a]:r*l,[s]:Math.max(t.oob.size/2,Math.min(n*c,c-t.oob.size/2)),startAngle:u}))}function i8(e){let t=e.item,n=e.boxWidth,r=e.boxPadding,i=e.rendWidth,o=e.rendHeight,a="x",s="y",l="width",c="height",u=i,d=o;e.flipXY&&(a="y",s="x",l="height",c="width",u=o,d=i);const p=function(e){let t=e.start,n=e.end,r=e.minPx,i=void 0===r?.1:r,o=e.maxPx,a=void 0===o?1:o;const s=Math.max(t,n),l=Math.min(t,n),c=n8(-.1,1.2,s),u=n8(-.1,1.2,l),d=c*a-u*a,p=Math.max(i,d),f=(p-d)/2;return{actualDiff:p,startModifier:f,actualLow:u*a-f}}({start:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:d}),f=p.actualDiff,h=p.actualLow;return zQ({},t.box,{type:"rect",[a]:(r+t.major)*u,[s]:h,[c]:f,[l]:n*u,data:t.data||{},collider:{type:null}})}function o8(e){let t=e.item,n=e.from,r=e.to,i=e.boxCenter,o=e.rendWidth,a=e.rendHeight,s="x1",l="y1",c="x2",u="y2",d=o,p=a;return e.flipXY&&(s="y1",l="x1",c="y2",u="x2",d=a,p=o),zQ({},t.line,{type:"line",[u]:Math.floor(n*p),[s]:i*d,[l]:Math.floor(r*p),[c]:i*d,data:t.data||{},collider:{type:null}})}function a8(e){let t=e.item,n=e.key,r=e.position,i=e.width,o=e.boxCenter,a=e.rendWidth,s=e.rendHeight,l="x1",c="y1",u="x2",d="y2",p=a,f=s;e.flipXY&&(l="y1",c="x1",u="y2",d="x2",p=s,f=a);const h=i/2;return zQ({type:"line"},t[n],{[c]:Math.floor(r*f),[l]:(o-h)*p,[d]:Math.floor(r*f),[u]:(o+h)*p,r:h*p,cx:o*p,cy:r*f,width:i*p,data:t.data||{},collider:{type:null}})}function s8(e,t,n){const r=t.box,i=r.width,o=r.maxWidthPx,a=r.minWidthPx,s=e>=0?1:-1;let l=Math.min(s*e*i,isNaN(o)?n:o/n);return l=isNaN(a)?l:Math.max(a/n,l),l*s}t8("native",function(e,t,n){let r,i,o={chart:e,mediator:t,element:n},a=[],s=!0;function l(){"function"==typeof r.enable&&(r.enable=r.enable.bind(o)()),r.enable&&Object.keys(r.events).forEach(e=>{const t=r.events[e].bind(o);n.addEventListener(e,t),a.push({key:e,listener:t})})}function c(){a.forEach(e=>{let t=e.key,r=e.listener;n.removeEventListener(t,r)}),a=[]}return{get key(){return i},set(e){!function(e){i=e.key,r=e,r.events=r.events||[],void 0===r.enable&&(r.enable=!0)}(e),c(),s&&l()},off(){s=!1,c()},on(){s=!0,0===a.length&&l()},destroy(){c(),o=null,r=null}}});const l8={oob:{show:!0,type:"n-polygon",fill:"#999",stroke:"#000",strokeWidth:0,size:10,sides:3,startAngle:-90},box:{show:!0,fill:"#fff",stroke:"#000",strokeWidth:1,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1},line:{show:!0,stroke:"#000",strokeWidth:1},median:{show:!0,stroke:"#000",strokeWidth:1},whisker:{show:!0,stroke:"#000",strokeWidth:1,fill:"",type:"line",width:1}},c8=Object.keys(l8),u8={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(e){let t=e.data;const n=this.rect,r=n.width,i=n.height,o="horizontal"===this.settings.settings.orientation,a=this.style,s=this.resolver,l=this.symbol,c=c8.filter(e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show),u={};c.forEach(e=>u[e]=l8[e]);const d=function(e){let t=e.keys,n=e.data,r=e.defaultSettings,i=e.style,o=e.settings,a=e.width,s=e.height,l=e.resolver;const c=zQ(!0,{},r||{},i||{}),u={major:"horizontal"===o.orientation?s:a,minor:"horizontal"===o.orientation?a:s},d=o.major;let p;p="object"==typeof d&&"object"==typeof d.ref&&void 0!==d.ref.start&&void 0!==d.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:zQ(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof d&&void 0!==d.binStart&&void 0!==d.binEnd?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:zQ(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:u,defaults:{major:.5},settings:{major:o.major}});const f=o.minor||{},h={};["start","end","min","max","med"].forEach(e=>{(f[e]||n.items&&n.items.length&&n.items[0][e])&&(h[e]={scale:f.scale,ref:e})});let m,g={major:p,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:zQ(!0,{},h,f)})};for(let e=0,r=t.length;e<r;e++)o[m]&&!1===o[m].show||(m=t[e],g[m]=l.resolve({data:n,defaults:c[m],settings:o[m],scaled:u}));return g}({keys:c,data:t,defaultSettings:u,style:a,settings:this.settings.settings,width:r,height:i,resolver:s});d.settings,d.items;const p=function(e){let t=e.width,n=e.height,r=e.flipXY,i=e.resolved,o=e.keys,a=e.symbol;const s=[],l=i.major.items;if(!l.length)return s;const c=t,u=n,d=r?n:t,p=i.major.settings,f=["start","end","min","max","med"].filter(e=>void 0!==i.minor.settings[e]),h=f.length,m=o.filter(e=>"oob"!==e);let g,y,b,v,x,w,S,k,C;const E=o?o.length:0,M=m?m.length:0;function R(){S?g.push(r8({item:b,value:0,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:a})):k&&g.push(r8({item:b,value:1,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:a}))}const _={box:function(){b.box&&GQ(b.start)&&GQ(b.end)&&g.push(i8({item:b,boxWidth:v,boxPadding:x,rendWidth:c,rendHeight:u,flipXY:r}))},line:function(){GQ(b.min)&&GQ(b.start)&&g.push(o8({item:b,from:b.min,to:b.start,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),GQ(b.max)&&GQ(b.end)&&g.push(o8({item:b,from:b.max,to:b.end,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},median:function(){b.median&&GQ(b.med)&&g.push(a8({item:b,key:"median",position:b.med,width:v,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},whisker:function(){if(b.whisker){const e=v*b.whisker.width;GQ(b.min)&&g.push(a8({item:b,key:"whisker",position:b.min,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),GQ(b.max)&&g.push(a8({item:b,key:"whisker",position:b.max,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))}}};function A(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let r=0;r<h;r++)e=b[f[r]],GQ(e)&&(t<e&&(t=e),n>e&&(n=e));S=t<0&&t!==-Number.MAX_VALUE,k=n>1&&n!==Number.MAX_VALUE,C=S||k}for(let e=0,t=l.length;e<t;e++){g=[],y=null;const t=l[e],n=t.data;let r=null,a=null;void 0!==p.binStart?(r=t.binStart,a=t.binEnd,y=p.binStart.scale):(y=p.major.scale,r=y?t.major:0);let c=0;y?y.bandwidth?(c=y.bandwidth(),r-=c/2):c=a-r:c=1,b=zQ({},{major:r,majorEnd:a},i.minor.items[e]);for(let t=0;t<E;t++)b[o[t]]=i[o[t]].items[e];if(v=s8(c,b,d),x=(c-v)/2,w=x+b.major+v/2,A(),C)b.oob&&R();else for(let e=0;e<M;e++)b[m[e]]&&!1===b[m[e]].show||_[m[e]]();const u={type:"container",data:n,collider:{type:"bounds"},children:g};s.push(u)}return s}({width:r,height:i,flipXY:o,resolved:d,keys:c,symbol:l});return p}};const d8={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},p8=/px$/,f8={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},h8={imageSrc:void 0,imageScalingFactor:void 0,position:"center-center",symbol:"rectangle",width:void 0,height:void 0},m8={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function g8(e,t){return e&&"function"==typeof e.bandwidth?{isBandwidth:!0,value:Math.max(1,e.bandwidth()*t)}:{isBandwidth:!1,value:Math.max(1,t)}}function y8(e,t,n,r){let i=t.width,o=t.height;return e.filter(e=>!1!==e.show&&!isNaN(e.x+e.y)).map(e=>{let t=e,a=p8.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);YQ(a)&&(t=d8,a=n.min+t.size*(n.max-n.min));const s=function(e){let t=f8.shape,n={};return"object"==typeof e.shape&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),l=WQ(s,2),c=l[0],u=VQ(VQ({},l[1]),{},{type:c,label:e.label,x:e.x*i,y:e.y*o,fill:t.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,a)),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray,opacity:t.opacity,imageSettings:t.imageSettings});t===e.errorShape&&(u.width=t.width);const d=r(u);return d.data=e.data,d})}const b8={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:e=>e.data.value},style:{item:"$shape"}},render(e){let t=e.data;const n=this.resolver.resolve({data:t,defaults:zQ({},f8,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),r=this.rect,i=r.width,o=r.height,a=zQ({},m8,this.settings.settings.sizeLimits),s=n.items;s.length>0&&"image"===s[0].shape&&t.items.forEach((e,t)=>{s[t].imageSettings=zQ({},h8,this.settings.settings.imageSettings)});const l=function(e,t,n,r,i){const o=g8(e?e.scale:void 0,n),a=g8(t?t.scale:void 0,r);let s=Math.min(o.value*i[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],a.value*i[a.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*i[o.isBandwidth?"minRelDiscrete":"minRelExtent"],a.value*i[a.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(s)),maxGlobal:i.maxPx,minGlobal:i.minPx}}(n.settings.x,n.settings.y,i,o,a);return y8(s,this.rect,l,this.settings.shapeFn||this.symbol)}};const v8={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function x8(e,t,n,r){let i=t.x,o=t.y,a=t.width,s=t.height;const l=_Z(),c={x:i+a/2,y:o+s/2},u=Math.min(a,s)/2,d=Math.min(a,s)/2,p=d/100;return e.map((e,t)=>{const i=n[t];i.type="path";const o=d*i.outerRadius,a=u*i.innerRadius,s=p*i.cornerRadius;l.innerRadius(a),l.outerRadius(o),l.cornerRadius(s),i.arcDatum=e;const f=l.centroid(e),h=i.offset?function(e,t,n,r){let i=WQ(e,2),o=i[0],a=i[1];const s=Math.sqrt(o*o+a*a);o/=s,a/=s;const l=n-r;return{x:o*t*l,y:a*t*l}}(f,i.offset,o,a):{x:0,y:0};return i.transform="translate(".concat(h.x,", ").concat(h.y,") translate(").concat(c.x,", ").concat(c.y,")"),i.desc={share:e.value/r,slice:{start:e.startAngle,end:e.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:c.x+h.x,y:c.y+h.y}}},i})}function w8(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const S8={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(e){let t=e.data;const n=[],r=[],i=this.settings.settings,o=this.resolver.resolve({data:t,defaults:zQ({},v8,this.style.slice),settings:i.slice}).items;let a=0;for(let e=0,t=o.length;e<t;e++){const t=w8(i,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),r.push(o[e]),a+=t)}const s=function(){var e=qZ,t=NZ,n=null,r=nZ(0),i=nZ(fZ),o=nZ(0);function a(a){var s,l,c,u,d,p=(a=AZ(a)).length,f=0,h=new Array(p),m=new Array(p),g=+r.apply(this,arguments),y=Math.min(fZ,Math.max(-fZ,i.apply(this,arguments)-g)),b=Math.min(Math.abs(y)/p,o.apply(this,arguments)),v=b*(y<0?-1:1);for(s=0;s<p;++s)(d=m[h[s]=s]=+e(a[s],s,a))>0&&(f+=d);for(null!=t?h.sort(function(e,n){return t(m[e],m[n])}):null!=n&&h.sort(function(e,t){return n(a[e],a[t])}),s=0,c=f?(y-p*v)/f:0;s<p;++s,g=u)l=h[s],u=g+((d=m[l])>0?d*c:0)+v,m[l]={data:a[l],index:s,value:d,startAngle:g,endAngle:u,padAngle:b};return m}return a.value=function(t){return arguments.length?(e="function"==typeof t?t:nZ(+t),a):e},a.sortValues=function(e){return arguments.length?(t=e,n=null,a):t},a.sort=function(e){return arguments.length?(n=e,t=null,a):n},a.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:nZ(+e),a):r},a.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:nZ(+e),a):i},a.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:nZ(+e),a):o},a}().sortValues(null);s.startAngle(i.startAngle),s.endAngle(i.endAngle),s.padAngle(i.padAngle);return x8(s(n),zQ({},this.rect,{x:0,y:0}),r,a)}};const k8=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){const n=e[t.type],r=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach(e=>{const n=Math.round(t[e.key]),i=t[e.key]-n;t[e.key]=n,r&&"append"===e.type&&(i>0?t[e.key]+=.5:t[e.key]-=.5)})}}return void 0===e&&((e={}).line={append:["x1","x2","y1","y2"],round:[],condition:e=>e.x1===e.x2||e.y1===e.y2,conditionAppend:e=>e.strokeWidth%2!=0},e.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:e=>e.strokeWidth%2!=0}),Object.keys(e).forEach(t=>{const n=e[t];n.items=[],n.append.forEach(e=>{n.items.push({key:e,type:"append"})}),n.round.forEach(e=>{n.items.push({key:e,type:"round"})})}),t.multiple=e=>e.forEach(e=>t(e)),t}();class C8{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(e,t){if(t){const t=e.substring(0,1),n=e.substring(1);if("x"===t)return"y".concat(n);if("y"===t)return"x".concat(n);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}transposeCoordinate(e,t,n){if("number"==typeof t&&isFinite(t)){const r=e.substring(0,1);if("x"===r||"cx"===e)return t*this.width;if("width"===e)return t*this.width;if("r"===e)return t*(n?this.height:this.width);if("y"===r||"cy"===e)return t*this.height;if("height"===e)return t*this.height}return t}push(){return this.storage.push(...arguments),this}processItem(e){let t={};const n=void 0!==e.flipXY?e.flipXY:this.flipXY,r=void 0!==e.crisp?e.crisp:this.crisp;if(e.fn&&"function"==typeof e.fn){let r=n?this.height:this.width,i=n?this.width:this.height;e=e.fn({width:r,height:i,flipXY:n});const o=Object.keys(e);for(let r=0,i=o.length;r<i;r++){let i=o[r];t[C8.evaluateKey(i,n)]=e[i]}}else{const r=Object.keys(e);for(let i=0,o=r.length;i<o;i++){let o=r[i];const a=C8.evaluateKey(o,n),s=this.transposeCoordinate(a,e[o],n);t[a]=s}}return r&&k8(t),t}output(){let e=[];for(let t=0,n=this.storage.length;t<n;t++){let n=this.processItem(this.storage[t]);e.push(n)}return e}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function E8(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new C8(...t)}function M8(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const R8={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=E8(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){if(this.x=this.settings.x?this.chart.scale(this.settings.x):null,this.y=this.settings.y?this.chart.scale(this.settings.y):null,p4(this,"x",this.rect.width),p4(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=zQ({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=zQ({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=M8(this.x,this.rect.width),this.lines.y=M8(this.y,this.rect.height),this.lines.y=this.lines.y.map(e=>zQ(e,{flipXY:!0}));let e=e=>{let t=e.dir,n=e.isMinor,r=this.lines[t].filter(e=>!!e.isMinor===n),i=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:i,data:{items:r,dir:t}}).items.forEach(e=>{let n=e.data;var r,i;e.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:e.stroke||"black",strokeWidth:void 0!==e.strokeWidth?e.strokeWidth:1,strokeDasharray:void 0!==e.strokeDasharray?e.strokeDasharray:void 0,flipXY:n.flipXY||!1,value:null!==(r=n.value)&&void 0!==r?r:null===(i=n.data)||void 0===i?void 0:i.value,dir:t})})};return e({dir:"x",isMinor:!1}),e({dir:"x",isMinor:!0}),e({dir:"y",isMinor:!1}),e({dir:"y",isMinor:!0}),this.blueprint.output()}};function _8(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===r||"right"===r){let i="right"===r;return"\n M ".concat(e," ").concat(t-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?0:1,", ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}let i="bottom"===r;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(i?t+n:t-n," Z\n ")}function A8(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===r||"right"===r){let i="right"===r;return"\n M ".concat(e+=i?1.5*n:-1.5*n," ").concat(t-n,"\n L ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}let i="bottom"===r;return t+=i?1.5*n:-1.5*n,"\n M ".concat(e-n," ").concat(t,"\n L ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(i?t+n:t-n," Z\n ")}function I8(e,t,n){return e<t||e>n}function P8(e,t){if("string"==typeof e.formatter)return t.formatter(e.formatter);if("object"==typeof e.formatter)return t.formatter(e.formatter);if(void 0!==e.scale&&e.scale.data){const t=e.scale.data()&&e.scale.data().fields;return t&&t[0]?t[0].formatter():null}return null}function T8(e){if(void 0===e)return 0;if("number"==typeof e&&isFinite(e))return e;if("string"==typeof e)switch(e){case"center":case"middle":return.5;case"bottom":case"right":return 1;default:return 0}return 0}function D8(e){var t,n;let r=e.chart,i=e.blueprint,o=e.renderer,a=e.p,s=e.settings,l=e.items,c=e.slopeLine,u=!0,d=!1,p=!1,f=!1,h=!1,m=zQ(!0,{},s.style.line,a.line||{}),g=zQ(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:m.stroke});if(d=c?i.processItem({type:"line",x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:!1,value:a.valueInfo?a.valueInfo.id:a.value}):i.processItem({type:"line",x1:a.position,y1:0,x2:a.position,y2:1,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:a.flipXY||!1,value:a.valueInfo?a.valueInfo.id:a.value}),a.label&&!1!==a.label.show&&(null==c||!c.slope||0===c.slope)){const e=zQ(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:m.stroke},a.label);let t,n={width:0,height:0},c="";t=P8(a,r),!1!==a.label.showValue&&(t?c=" (".concat(t(a.value),")"):a.scale&&(c=" (".concat(a.value,")"))),c&&(n=o.measureText({text:c,fontFamily:e.fontFamily,fontSize:e.fontSize}));let d=o.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),g={width:d.width+n.width,height:Math.max(d.height,n.height)},y=e.padding,b=T8(a.flipXY?e.vAlign:e.align),v=T8(a.flipXY?e.align:e.vAlign),x=Math.min(1+g.width+2*y,e.maxWidth*i.width,e.maxWidthPx),w=g.height+2*y,S=a.flipXY?w:x,k=a.flipXY?x:w;if(p=i.processItem({fn:t=>{let n=t.width,r=t.height,o=a.position*n-(a.flipXY?w:x)*(1-b);o=a.flipXY?o:Math.max(o,0);return{type:"rect",x:o,y:Math.max(Math.abs(v*r-k*v),0),width:a.flipXY?S:Math.min(S,i.width-o),height:k,stroke:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.background.opacity}},flipXY:a.flipXY||!1}),p.x<-1||p.x+p.width>i.width+1||p.y<-1||p.y+p.height>i.height+1)p=void 0;else{f={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:p.x+y,y:p.y+p.height/2+g.height/3,maxWidth:p.width-2*y-n.width,anchor:"start"},c&&(h={type:"text",text:c||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:f.x+3+(p.width-(n.width+2*y)),y:f.y});for(let e=0,t=l.length;e<t;e++){let t=l[e];"rect"===t.type?l6(p,t)&&(u=!1):"line"===t.type&&a.flipXY===t.flipXY&&d6(p,t)&&(u=!1)}}}if(d&&l.push(d),c&&0!==c.slope&&(!1!==(null===(t=c.label)||void 0===t?void 0:t.show)||!1!==(null===(n=c.label)||void 0===n?void 0:n.showValue))){var y,b,v;let e,t;const n=120;let s=!1!==(null===(y=c.label)||void 0===y?void 0:y.show)?null===(b=c.label)||void 0===b?void 0:b.text:"";if(!1!==(null===(v=c.label)||void 0===v?void 0:v.showValue)){var x;const t=P8(a,r),n=t?t(c.value):c.value;e="(".concat(c.slope,"x + ").concat(n,")"),s+=null!==(x=c.label)&&void 0!==x&&x.text?" ".concat(e):e}if(s.length>1){var w,S,k;const e=o.measureText({text:s,fontFamily:g.fontFamily,fontSize:g.fontSize});e.width=e.width>n?n:e.width;const a=function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});if(t>0){if(r.max()*t+n>=i.max())return!0}else if(t<0&&r.min()*t+n>=i.max())return!0;return!1}(r,c.slope,c.value)?function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});return r((i.max()-n)/t)}(r,c.slope,c.value):void 0,u=void 0===a||c.isRtl?g.padding:3*g.padding,p=void 0!==a||c.slope>0?3*g.padding:g.padding,f=function(e,t,n,r,i,o){let a=0;if(void 0!==n){if(n<.8)return a=e.slope<0||e.isRtl?3*o.padding:2*o.padding,e.isRtl,n*i.width+a;if(1===n)return e.isRtl?n*i.width-(r.width+3*o.padding):n*i.width-(r.width+6*o.padding);if(n>.8)return e.isRtl?n*i.width-(r.width+3*o.padding):n*i.width-(r.width+6*o.padding)}else if(e.slope>0)return t.x2-(r.width+2*o.padding);return e.isRtl?t.x1-(r.width+2*o.padding):t.x1}(c,d,a,e,i,g),h=Math.min(d.y1,d.y2);null!==(w=c.label)&&void 0!==w&&w.stroke&&(t={type:"rect",x:c.isRtl?Math.max(f,u)-2:Math.max(f,u)+2,y:Math.abs(Math.max(h,p)-e.height),rx:3,ry:3,width:e.width+g.padding,height:e.height-2,stroke:m.stroke,fill:m.stroke});const y={type:"text",text:s,fill:null!==(S=null===(k=c.label)||void 0===k?void 0:k.stroke)&&void 0!==S?S:m.stroke,opacity:g.opacity,fontFamily:g.fontFamily,fontSize:g.fontSize,x:t?t.x+2:Math.max(f,u)+2,y:t?t.y+e.height-g.padding:Math.abs(Math.max(h,p)-g.padding/2),anchor:"start",title:s,maxWidth:n,width:e.width};(function(e,t,n,r,i){for(let o=0,a=e.length;o<a;o++){const a=e[o];if("text"===(null==a?void 0:a.type)&&Math.abs(a.x-t.x)<Math.max(a.width+r,t.width+r)&&Math.abs(a.y-t.y)<n.height+i)return!0}return!1})(l,y,e,u,p)||(t&&l.push(t),l.push(y))}}u&&p&&f&&(l.push(p,f),h&&l.push(h))}function O8(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function N8(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function q8(e,t){const n=e.min();if(n===e.max()){const r=function(e){const t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return r?2:-1;if(t>n)return r?-1:2}return e(t)}function L8(e,t){return e&&t&&Math.abs(e.x-t.x)<1e-15&&Math.abs(e.y-t.y)<1e-15}const j8={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:0},style:{oob:{show:!0,width:10,fill:"#1A1A1A",stroke:"transparent",strokeWidth:0,opacity:1,text:{fontFamily:"Arial",stroke:"transparent",fill:"#fff",strokeWidth:0,opacity:1},triangle:{fill:"#4D4D4D",stroke:"transparent",strokeWidth:0,opacity:1},padding:{x:28,y:5}},line:{stroke:"#000"},label:{strokeWidth:0}}},preferredSize:()=>30,beforeRender(){this.blueprint=E8(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){let e=this.settings;if(this.lines={x:[],y:[]},this.lines.x=e.lines&&e.lines.x||[],this.lines.y=e.lines&&e.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const t={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(N8).map(e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=q8(t,e.value);return zQ(e,{scale:t,position:n})}return zQ(e,{position:e.value})}),this.lines.y=this.lines.y.filter(N8).map(e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=q8(t,e.value);return zQ(e,{scale:t,position:n,flipXY:!0})}return zQ(e,{position:e.value,flipXY:!0})}),this.lines.x=this.lines.x.filter(e=>!(e.position<0||e.position>1)||(t["x".concat(e.position>1?1:0)].push(O8(e)),!1)),this.lines.y=this.lines.y.filter(e=>!(!e.slope||0===e.slope)||(!(e.position<0||e.position>1)||(t["y".concat(e.position>1?1:0)].push(O8(e)),!1)));let n=[];return[...this.lines.x,...this.lines.y].forEach(r=>{if(!0===r.show||void 0===r.show){let i;if(r.slope&&0!==r.slope){const e=this.chart.scale({scale:"x"}),n=this.chart.scale({scale:"y"}),o=e.min(),a=e.max(),s=n.min(),l=n.max();i=VQ(VQ({},r),{},{x1:void 0,y1:void 0,x2:void 0,y2:void 0});const c=o*r.slope+r.value,u=a*r.slope+r.value,d=(s-r.value)/r.slope,p=(l-r.value)/r.slope;let f=[];I8(c,s,l)||(f[0]={x:q8(e,o),y:q8(n,c)}),I8(d,o,a)||(f[1]={x:q8(e,d),y:1}),I8(u,s,l)||(f[2]={x:q8(e,a),y:q8(n,u)}),I8(p,o,a)||(f[3]={x:q8(e,p),y:0});const h=f.filter(e=>!!e).length;if(h>2&&function(e){L8(e[0],e[1])&&(e[1]=void 0),L8(e[1],e[2])&&(e[2]=void 0),L8(e[2],e[3])&&(e[3]=void 0),L8(e[3],e[0])&&(e[3]=void 0)}(f),f=f.filter(e=>!!e),f.length<2)return void t["y".concat(c>l?0:1)].push(O8(r));i.x1=f[0].x,i.y1=f[0].y,i.x2=f[1].x,i.y2=f[1].y}else i=void 0;D8({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:r,settings:e,items:n,slopeLine:i})}}),e.style.oob.show&&function(e){let t=e.blueprint,n=e.oob,r=e.settings,i=e.items;const o=Object.keys(n);let a=r.style.oob||{};for(let e=0,r=o.length;e<r;e++){const r=o[e],s=n[r];if(s.length>0){let e=r.charAt(1),n="y"===r.charAt(0),o=a.padding.x+a.width,l=a.padding.y+a.width,c="bottom";c=n?"1"===e?"bottom":"top":"1"===e?"right":"left";let u=t.processItem({fn:t=>{let r=t.width,i=t.height,u=e*r+("1"===e?-o:o),d=n?l:i-l;return"arc"===a.type?{type:"path",d:_8(n?d:u,n?u:d,a.width,c),x:u,y:d,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0}:{type:"circle",cx:u,cy:d,r:a.width,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0,opacity:a.opacity,data:s}},flipXY:n}),d=u.cx||u.x,p=u.cy||u.y;const f=s.map(e=>e.label?"".concat(e.label," (").concat(e.value,")"):"(".concat(e.value,")")),h=f.reduce((e,t,n)=>0===n?t:"".concat(e,"\n\n").concat(t),"");let m={type:"text",text:s.length||"",title:h,x:d-.4*a.width,y:p+.4*a.width,fontFamily:a.text.fontFamily,fontSize:"".concat(1.3*a.width,"px"),stroke:a.text.stroke,fill:a.text.fill,strokeWidth:a.text.strokeWidth||0,opacity:a.text.opacity},g={type:"path",d:A8(d,p,a.width,c),x:d,y:p,stroke:a.triangle.stroke,fill:a.triangle.fill,strokeWidth:a.triangle.strokeWidth||0,opacity:a.triangle.opacity};i.push(u,m,g)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function z8(e){const t={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===e.align||"bottom"===e.align?(t.x1=e.innerRect.x-e.outerRect.x,t.x2=t.x1+e.innerRect.width,t.y1=t.y2="top"===e.align?e.innerRect.height-e.padding:e.padding):(t.x1=t.x2="left"===e.align?e.innerRect.width-e.padding:e.padding,t.y1=e.innerRect.y-e.outerRect.y,t.y2=t.y1+e.innerRect.height),function(e,t){zQ(e,t.style)}(t,e),t}function F8(e){return"string"==typeof e||"number"==typeof e?e:"-"}function $8(e,t,n){n.layered||!n.stepSize?function(e,t){t.collider={type:"polygon",vertices:[{x:t.boundingRect.x,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y+t.boundingRect.height},{x:t.boundingRect.x,y:t.boundingRect.y+t.boundingRect.height}]}}(0,t):n.tilted?function(e,t,n){const r=n.angle*(Math.PI/180),i=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,a="end"===t.anchor&&r<0,s="start"===t.anchor&&r>=0,l=t.boundingRect.y+(s||a?t.boundingRect.height:0),c=[{x:t.x-i,y:l},{x:t.x+i,y:l}].map(e=>O4(e,r,{x:t.x,y:t.y})),u={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},d={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},p=r>=0?[u,d]:[d,u];c.push(...p),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const r=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:r,y:0,width:r<0?n.stepSize+r:n.stepSize,height:n.innerRect.height}}else{const r=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:r,width:n.innerRect.width,height:r<0?n.stepSize+r:n.stepSize}}const r=t.collider;r.x=Math.max(r.x,0),r.y=Math.max(r.y,0);const i=r.x+r.width-(n.outerRect.x+n.outerRect.width);r.width=i>0?r.width-i:r.width;const o=r.y+r.height-(n.outerRect.y+n.outerRect.height);r.height=o>0?r.height-o:r.height}(e,t,n)}function B8(e,t){const n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1);let r=0;if(e.tilted)r=e.stepSize*n;else{const i=t?e.textRect.height:e.textRect.width;r=Math.max(0,e.stepSize-i)*n}return r}function H8(e,t){var n,r;const i={type:"text",text:F8(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(r=e.data)||void 0===r?void 0:r.value};return"top"===t.align||"bottom"===t.align?(i.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+B8(t,!1),i.y="top"===t.align?t.innerRect.height:0,i.anchor=t.stepSize?"start":"middle",i.x+=isNaN(t.style.offset)?0:+t.style.offset):(i.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+B8(t,!0),i.x="left"===t.align?t.innerRect.width:0,i.anchor="left"===t.align?"end":"start",i.baseline=t.stepSize?"text-before-edge":"central",i.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach(n=>{e[n]=t.style[n]})}(i,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){const n=0,r=t.outerRect.width,i=Math.min(t.maxWidth/2,t.textRect.width/2),o=e.x-i,a=e.x+i;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):a>r&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{const n=0,r=t.outerRect.height,i=t.maxHeight/2,o=e.y-i,a=e.y+i;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):a>r&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(i,t),function(e,t){"top"===t.align?e.y-=t.padding:"bottom"===t.align?e.y+=t.padding+t.maxHeight:"left"===t.align?e.x-=t.padding:"right"===t.align&&(e.x+=t.padding)}(i,t),function(e,t){if(t.tilted){const n=-t.angle,r=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(r)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(r)/2):e.x-=t.maxHeight*Math.sin(r)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";const i=Math.cos(r)*t.maxWidth;if("bottom"===t.align==t.angle<0){const n=t.outerRect.width-t.paddingEnd;e.x+i>n&&(e.maxWidth=(n-e.x-10)/Math.cos(r))}else{const n=t.paddingEnd;e.x-i<n&&(e.maxWidth=(e.x-n-10)/Math.cos(r))}}}(i,t),function(e,t){e.boundingRect=t.textBounds(e)}(i,t),$8(e,i,t),i}function V8(e,t){const n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:e.value};return"top"===t.align||"bottom"===t.align?(n.x1=n.x2=e.position*t.innerRect.width+(t.innerRect.x-t.outerRect.x),n.y1="top"===t.align?t.innerRect.height:0,n.y2="top"===t.align?n.y1-t.tickSize:n.y1+t.tickSize):(n.y1=n.y2=e.position*t.innerRect.height+(t.innerRect.y-t.outerRect.y),n.x1="left"===t.align?t.innerRect.width:0,n.x2="left"===t.align?n.x1-t.tickSize:n.x1+t.tickSize),function(e,t){zQ(e,t.style)}(n,t),function(e,t){"top"===t.align?(e.y1-=t.padding,e.y2-=t.padding):"bottom"===t.align?(e.y1+=t.padding,e.y2+=t.padding):"left"===t.align?(e.x1-=t.padding,e.x2-=t.padding):"right"===t.align&&(e.x1+=t.padding,e.x2+=t.padding)}(n,t),function(e,t){const n=e.strokeWidth/2;e.x1===t.innerRect.width?(e.x1-=n,e.x2-=n):0===e.x1?(e.x1+=n,e.x2+=n):e.y1===t.innerRect.height?(e.y1-=n,e.y2-=n):0===e.y1&&(e.y1+=n,e.y2+=n)}(n,t),n}function W8(e){return!e.isMinor&&e.position>=0&&e.position<=1}function U8(e){let t=e.rect,n=e.state,r=e.majorTicks,i=e.measure;return e.horizontal?function(e){let t=e.majorTicks,n=e.measureText,r=e.rect;const i="layered"===e.state.labels.activeMode?2:1,o=r.width,a=t.map(e=>e.label).map(e=>"".concat(e.slice(0,1)).concat(e.length>1?"…":"")).map(n).map(e=>e.width);for(let e=0;e<t.length;++e){const n=t[e];if(i*o*Math.abs(n.start-n.end)<a[e])return!0}return!1}({majorTicks:r,measureText:i,rect:t,state:n}):function(e){let t=e.majorTicks,n=e.measureText;const r=e.rect.height,i=n("M").height;return!(t.length<2)&&r*Math.abs(t[0].position-t[1].position)<i}({majorTicks:r,measureText:i,rect:t})}function G8(e){let t=e.value,n=e.maxValue,r=e.minValue,i=e.range,o=e.modifier;return isNaN(i)||isNaN(o)||(t=i*o),t>n&&(t=n),t<r&&(t=r),t}function Y8(e){let t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,a=e.settings,s=e.state,l=0;const c={left:0,top:0,right:0,bottom:0},u=a.labels,d=u.maxLengthPx,p=u.minLengthPx;if(a.labels.show){const e=a.align,u="top"===e||"bottom"===e,f=u?n.inner.width:n.inner.height,h=o.ticks({settings:a,distance:f,formatter:r}).filter(W8),m=e=>{const t=i({text:e,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return t.width=G8({value:t.width,maxValue:d,minValue:p}),t};if(t&&u&&"auto"===a.labels.mode&&(!function(e){let t=e.majorTicks,n=e.measure,r=e.rect,i=e.state,o=e.settings;const a=o.labels.maxGlyphCount,s="layered"===i.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=r.width;let d=0,p=0;if(isNaN(a))for(let e=0;e<t.length;e++){const r=t[e],i=r.label,o=n(i).width*(i.length>1?l:1);if(p=s*u*Math.abs(r.start-r.end),o+c>p)return!0}else{const e=t.reduce((e,t)=>Math.min(Math.abs(t.start-t.end),e),1/0);if(p=s*u*e,d=n("M").width*l*a,d+c>p)return!0}return!1}({majorTicks:h,measure:m,rect:n.inner,state:s,settings:a})?s.labels.activeMode="horizontal":s.labels.activeMode="tilted"),!a.labels.filterOverlapping&&"tilted"!==s.labels.activeMode&&U8({rect:n.inner,state:s,majorTicks:h,measure:m,horizontal:u})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let g,y;if("tilted"===s.labels.activeMode){const e=Math.abs(a.labels.tiltAngle)*(Math.PI/180);g=t=>G8({value:t.width,maxValue:d,minValue:p})*Math.sin(e)+t.height*Math.cos(e)}else g=u?e=>e.height:e=>G8({value:e.width,maxValue:d,minValue:p});if(u&&"tilted"!==s.labels.activeMode)y=["M"];else if(isNaN(a.labels.maxGlyphCount))y=h.map(e=>e.label);else{let e="";for(let t=0;t<a.labels.maxGlyphCount;t++)e+="M";y=[e]}const b=y.map(m),v=b.map(g),x=Math.max(...v,0);if(l+=x,l+=a.labels.margin,"layered"===s.labels.activeMode&&(l*=2),"tilted"===s.labels.activeMode){const e="bottom"===a.align==a.labels.tiltAngle>=0,t=Math.abs(a.labels.tiltAngle)*(Math.PI/180),r=(x-m("M").height*Math.cos(t))/Math.sin(t),i=e=>Math.min(r,e.width)*Math.cos(t)+e.height,o=(t,r)=>{const i=h[r]?h[r].position:0;return e?t-i*n.inner.width:t-(1-i)*n.inner.width},s=Math.min(a.labels.maxEdgeBleed,Math.max(...b.map(i).map(o),0))+a.paddingEnd;if(c[e?"left":"right"]=s,!a.labels.filterOverlapping&&function(e){let t=e.majorTicks,n=e.measureText,r=e.rect,i=e.bleedSize,o=e.angle;if(t.length<2)return!1;if(0===o)return!0;const a=Math.abs(o),s=1/(Math.min(r.outer.width-i,r.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(a*(Math.PI/180))/s}({majorTicks:h,measureText:m,rect:n,bleedSize:s,angle:a.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const K8=(e,t,n)=>e.width*Math.abs(t.position-n.position);function X8(e){let t=e.layered,n=e.major,r=e.innerRect,i=e.outerRect,o=e.tick,a=e.index;const s=t?2:1,l=n[a-s],c=n[a+s],u=l?K8(r,o,l)/2-2:1/0,d=c?K8(r,o,c)/2-2:1/0;return n.length<2?r.width:l?c?2*Math.min(u,d):(e=>{let t=e.innerRect,n=e.outerRect,r=e.tick,i=e.prevWidth;const o=t.x-n.x,a=n.width-t.width-o,s=t.width-t.width*r.position+a,l=2*Math.min(i,s),c=1===r.position?t.width/2-2:0;return Math.max(i,l,c)})({innerRect:r,outerRect:i,tick:o,prevWidth:u}):(e=>{let t=e.innerRect,n=e.outerRect,r=e.tick,i=e.nextWidth;const o=t.x-n.x,a=t.width*r.position+o,s=2*Math.min(i,a),l=0===r.position?t.width/2-2:0;return Math.max(i,s,l)})({innerRect:r,outerRect:i,tick:o,nextWidth:d})}function J8(e){const t=e.innerRect,n={cx:t.width/2,cy:t.height/2},r=Math.min(t.height,t.width)/2*e.radius,i=r+e.style.strokeWidth,o={visible:!0,type:"path",arcDatum:{startAngle:e.startAngle,endAngle:e.endAngle},transform:"translate(0, 0) translate(".concat(n.cx,", ").concat(n.cy,")"),desc:{share:1,slice:{cornerRadius:0,innerRadius:r,outerRadius:i}},ticks:[]};return function(e,t){zQ(e,t.style)}(o,e),o}function Q8(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function Z8(e,t){const n=t.innerRect,r={cx:n.width/2,cy:n.height/2},i=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o;let c=a-e.position*l;c-=Math.PI/2;const u=Q8(r.cx,r.cy,i+s,c),d=Q8(r.cx,r.cy,i,c),p={type:"line",x1:u.x,y1:u.y,x2:d.x,y2:d.y,value:e.value};return function(e,t){const n=VQ({},t.style);zQ(e,n)}(p,t),p}function e7(e){return"string"==typeof e||"number"==typeof e?e:"-"}function t7(e,t,n){let r;return r="left"===t?n.x:"right"===t?e.outerRect.width-n.x:Math.max(n.x,e.outerRect.width-n.x),r}function n7(e,t){const n=t.innerRect,r={cx:n.width/2,cy:n.height/2},i=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o,c=.2;let u,d;u="top"===t.align||"bottom"===t.align?a-e.position*l:o+e.position*l,d=u<-.2&&u>-Math.PI+c?"left":u>.2&&u<Math.PI-c?"right":"center",u-=Math.PI/2;const p=function(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}(r.cx,r.cy,i+s+6,u);let f;f="left"===d?"end":"right"===d?"start":"middle";const h={type:"text",text:e7(e.label),align:d,x:p.x,y:p.y,maxHeight:t.maxHeight,maxWidth:t7(t,d,p),anchor:f,baseline:"middle"};return function(e,t){["fill","fontSize","fontFamily"].forEach(n=>{e[n]=t.style[n]})}(h,t),function(e,t){e.boundingRect=t.textBounds(e)}(h,t),function(e,t,n){let r,i;const o=parseFloat(n.fontSize)||0;r=t.y-o/2,i=e.innerRect.height-(t.y+o/2),(r<0||i<0)&&(n.text="")}(t,p,h),h}function r7(e){let t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function i7(e){let t=0;return t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function o7(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=r7(e)+e.labels.margin,t}function a7(e,t){return e.map(e=>V8(e,t))}function s7(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function l7(e){let t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.scale,o=e.tilted,a=e.layered,s=e.tick;const l=t.height,c=s7(i,s),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=r.width-o7(n)-n.paddingEnd;else if(a)u.width=c*r.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(r.height-o7(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*r.width;return u.width=G8({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function c7(e){let t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.outerRect,o=e.tilted,a=e.layered,s=e.tick,l=e.index,c=e.major;const u=t.height,d={width:0,height:u};if("left"===n.align||"right"===n.align)d.width=r.width-o7(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);d.width=(r.height-o7(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else d.width=X8({layered:a,major:c,innerRect:r,outerRect:i,tick:s,index:l});return d.width=G8({value:d.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),d}function u7(e){let t;function n(){return t=c7,n}function r(){return t=l7,r}function i(e){let n=e.settings,r=e.scale,i=e.innerRect,o=e.outerRect,a=e.measureText,s=e.ticks,l=e.state,c=e.textBounds;const u=[],d=function(e){return e.filter(e=>!e.isMinor)}(s),p=function(e){return e.filter(e=>e.isMinor)}(s),f={innerRect:i,align:n.align,outerRect:o},h="tilted"===l.labels.activeMode,m="layered"===l.labels.activeMode;let g;if(n.arc&&(f.startAngle=n.arc.startAngle,f.endAngle=n.arc.endAngle,f.radius=n.arc.radius),n.line.show&&(f.style=n.line,f.padding=n.paddingStart,n.arc?u.push(J8(f)):u.push(z8(f))),n.ticks.show&&(f.style=n.ticks,f.tickSize=n.ticks.tickSize,f.padding=r7(n),n.arc?(f.padding=i7(n),g=function(e,t){return e.map(e=>Z8(e,t))}(d,f)):g=a7(d,f)),n.labels.show){const e=o7(n);f.style=n.labels,f.padding=e,f.tilted=h,f.layered=m,f.angle=n.labels.tiltAngle,f.paddingEnd=n.paddingEnd,f.textBounds=c;const s=(e,s)=>{f.textRect=function(e){let t=e.style;return(0,e.measureText)({text:e.tick.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:a,style:f.style});const l=t({textMetrics:f.textRect,settings:n,innerRect:i,outerRect:o,scale:r,tilted:h,layered:m,tick:e,major:d,index:s});f.maxWidth=l.width,f.maxHeight=l.height,f.stepSize=function(e){let t=e.innerRect,n=e.scale,r=e.settings,i=e.tick;return("top"===r.align||"bottom"===r.align?t.width:t.height)*s7(n,i)}({innerRect:i,scale:r,settings:n,tick:e})};let l=[];n.arc?(f.padding=function(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=i7(e)+e.labels.margin,t}(n),l=function(e,t,n){return e.map((e,r)=>{n(e,r);const i=n7(e,t);return i.data=e.data,i})}(d,f,s)):l=!m||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map((e,r)=>{n(e,r);const i=H8(e,t);return i.data=e.data,i})}(d,f,s):function(e,t,n,r){const i=t.padding,o=o7(n);return e.map((e,a)=>{r(e,a);const s=o+t.maxHeight+n.labels.margin;t.layer=a%2,t.padding=a%2==0?i:s;const l=H8(e,t);return l.data=e.data,l})}(d,f,n,s),n.labels.filterOverlapping&&function(e,t,n){let r=(t,n)=>l6(tZ(1,e[t].boundingRect),tZ(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);r=(n,r)=>{const i=1/Math.abs(e[n].x-e[r].x),o=Math.sin(t*(Math.PI/180))/i;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let i=n+1;i<=Math.min(n+5,n+(e.length-1));i++)e[n]&&e[i]&&r(n,i)&&(i===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(i,1),t&&t.splice(i,1)),i--,n--)}(l,g,f),u.push(...l)}return n.minorTicks&&n.minorTicks.show&&p.length>0&&(f.style=n.minorTicks,f.tickSize=n.minorTicks.tickSize,f.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...a7(p,f))),g&&u.push(...g),u}return n.build=i,r.build=i,e?r():n()}const d7={labels:{show:!0,tiltAngle:40,tiltThreshold:.7,maxEdgeBleed:1/0,margin:4,maxLengthPx:150,minLengthPx:0,mode:"auto",maxGlyphCount:NaN,align:.5,offset:0,filterOverlapping:!1},ticks:{show:!1,margin:0,tickSize:4},line:{show:!1},paddingStart:0,paddingEnd:10,align:"auto"},p7={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0,centerEndLabels:!1},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};const f7={require:["chart","renderer","dockConfig"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{},style:{labels:"$label",ticks:"$guide-line",minorTicks:"$guide-line--minor",line:"$guide-line"}},created(){this.state={isDiscrete:!!this.scale.bandwidth,isHorizontal:!1,labels:{activeMode:"horizontal"},ticks:[],innerRect:{width:0,height:0,x:0,y:0},outerRect:{width:0,height:0,x:0,y:0},defaultDock:void 0,concreteNodeBuilder:void 0,settings:void 0},this.state.isDiscrete?this.state.defaultDock="bottom":this.state.defaultDock="left",this.setState(this.settings)},setState(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(e){let t=e.state,n=e.style,r=e.settings;const i=zQ(!0,{},t.isDiscrete?d7:p7,n),o=zQ(!0,{},i,r.settings),a=r.layout.dock||t.defaultDock;o.dock=a,o.align=function(e,t){const n=["top","bottom"],r=["left","right"];return-1!==n.indexOf(e)&&-1===r.indexOf(t)||-1!==r.indexOf(e)&&-1===n.indexOf(t)?e:t}(r.settings.align,a),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const s=o.paddingStart,l=o.paddingEnd;return o.paddingStart="function"==typeof s?s.call(null):s,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=u7(this.state.isDiscrete),this.dockConfig.dock(this.state.settings.dock),this.state.isHorizontal="top"===this.state.settings.align||"bottom"===this.state.settings.align,this.state.labels.activeMode=function(e,t,n){const r=t.labels.mode;return n&&e.isHorizontal?"auto"===r?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?r:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(e){const t=this.formatter,n=this.state,r=this.scale,i=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=f4(r,i);const o=function(e){let t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,a=e.settings,s=0;const l=Y8({isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:e.state}),c=l.size,u=l.edgeBleed;if(s+=c,l.isToLarge)return{size:s};if(a.ticks.show&&(s+=a.ticks.margin,s+=a.ticks.tickSize),a.minorTicks&&a.minorTicks.show){const e=a.minorTicks.margin+a.minorTicks.tickSize;e>s&&(s=e)}if(a.line.show){const e=a.line.strokeWidth/2;s+=e,u[function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return e}}(a.align)]=Math.ceil(e)}return s+=a.paddingStart,s+=a.paddingEnd,{size:s,edgeBleed:u}}({isDiscrete:this.state.isDiscrete,rect:{inner:e.inner,outer:e.outer},formatter:t,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n});return o},beforeUpdate(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).settings;this.setState(e)},resize(e){const t=e.inner,n=e.outer,r=zQ({},t,function(e){let t=e.align,n=e.inner;return"left"===t?{x:n.width+n.x}:"right"===t||"bottom"===t?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:t})),i=n||r;return zQ(this.state.innerRect,r),zQ(this.state.outerRect,i),n},beforeRender(){const e=this.scale,t=this.formatter,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=f4(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter(e=>e.position>=0&&e.position<=1)},render(){const e=this.state,t=[];return t.push(...this.state.concreteNodeBuilder.build({settings:this.state.settings,scale:this.state.pxScale,innerRect:this.state.innerRect,outerRect:this.state.outerRect,measureText:this.renderer.measureText,textBounds:this.renderer.textBounds,ticks:this.state.ticks,state:e})),k8.multiple(t),t}};const h7={render:()=>[]};function m7(e,t,n){let r="";if("function"==typeof e)r=e();else if("string"==typeof e)r=e;else if(n){const e=(n.data().fields||[]).map(e=>e.title());r=e.join(t)}return r}function g7(e,t){let n="middle";return"left"===e?"top"===t?n="end":"bottom"===t&&(n="start"):"right"===e?"top"===t?n="start":"bottom"===t&&(n="end"):"left"===t?n="start":"right"===t&&(n="end"),n}const y7={require:["renderer","chart"],defaultSettings:{layout:{dock:"bottom",displayOrder:0,prioOrder:0},settings:{paddingStart:5,paddingEnd:5,paddingLeft:0,paddingRight:0,anchor:"center",join:", ",maxLengthPx:NaN},style:{text:"$title"}},created(){this.definitionSettings=this.settings.settings;const e=this.settings.text,t=this.definitionSettings.join;this.title=m7(e,t,this.scale)},preferredSize(){return this.renderer.measureText({text:this.title,fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily}).height+this.definitionSettings.paddingStart+this.definitionSettings.paddingEnd},render(){const e=this.title,t=this.definitionSettings,n=this.rect,r=[];return r.push(function(e){let t=e.title,n=e.definitionSettings,r=e.dock,i=e.rect,o=e.measureText,a=e.style;const s={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:g7(r,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};zQ(s,a.text);const l=o(s);if("top"===r||"bottom"===r){let e=i.width/2;"left"===n.anchor?e=n.paddingLeft||0:"right"===n.anchor&&(e=i.width-(n.paddingRight||0)),s.x=e,s.y="top"===r?i.height-n.paddingStart:n.paddingStart+l.height,s.dy="top"===r?-l.height/6:-l.height/3,s.maxWidth=.8*i.width}else{let e=i.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=i.height-n.paddingStart),s.y=e,s.x="left"===r?i.width-n.paddingStart:n.paddingStart,s.dx="left"===r?-l.height/3:l.height/3;const t="left"===r?270:90;s.transform="rotate(".concat(t,", ").concat(s.x+s.dx,", ").concat(s.y+s.dy,")"),s.maxWidth=.8*i.height}return isNaN(n.maxLengthPx)||(s.maxWidth=Math.min(s.maxWidth,n.maxLengthPx)),s}({title:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),r},beforeUpdate(e){e.settings&&(zQ(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=m7(t,n,this.scale)}};function b7(e,t){const n=e.settings.layout.dock,r=e.settings.settings.invert,i="top"===n||"bottom"===n,o=i?"width":"height",a=e.rect[o],s=e.chart.scroll(e.settings.scroll);let l;{let e=t[i?"x":"y"];r&&(e=a-e);const n=s.getState();l={startOffset:e,startScroll:n.start,swipe:!1};const o=e/a*(n.max-n.min)+n.min;o<n.start?l.startScroll=o:o>n.start+n.viewSize&&(l.startScroll=o-n.viewSize)}return{update:e=>{let t=e[i?"x":"y"];if(r&&(t=a-t),!l.swipe){if(Math.abs(l.startOffset-t)<=1)return;l.swipe=!0}const n=s.getState(),o=(t-l.startOffset)/a*(n.max-n.min),c=l.startScroll+o;s.moveTo(c)},end:e=>{let t=e[i?"x":"y"];r&&(t=a-t);const n=s.getState();if(l.swipe){const e=(t-l.startOffset)/a*(n.max-n.min),r=l.startScroll+e;s.moveTo(r)}else{const e=t/a*(n.max-n.min)+n.min-n.viewSize/2;s.moveTo(e)}}}}function v7(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const x7={require:["chart","renderer"],on:{panStart(e){const t=v7(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=b7(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=v7(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=v7(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=v7(e,this.renderer);b7(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){const t=this.chart.scroll(this.settings.scroll).getState();if(t.viewSize>=t.max-t.min){return Math.max(e.width,e.height)}return this.settings.settings.width},render:function(e){const t=this.settings.layout.dock,n=this.settings.settings.invert,r="top"===t||"bottom"===t,i=r?"width":"height",o=this.rect[i],a=this.chart.scroll(this.settings.scroll).getState();let s=o*(a.start-a.min)/(a.max-a.min);const l=o*a.viewSize/(a.max-a.min);return n&&(s=o-s-l),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("div",{class:"scroller",style:{position:"absolute",[r?"left":"top"]:"".concat(s,"px"),[r?"top":"left"]:"25%",[r?"height":"width"]:"50%",[i]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function w7(e){let t=e.h,n=e.isVertical,r=e.value,i=e.pos,o=e.align,a=e.borderHit,s=e.state,l=e.idx;const c="end"!==o,u=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let d=0,p="100%",f="100%";return s.targetRect&&"start"===s.settings.bubbles.align?(p="".concat(s.targetRect.x+s.targetRect.width,"px"),f="".concat(s.targetRect.y+s.targetRect.height,"px")):s.targetRect&&"end"===s.settings.bubbles.align&&(d=n?s.targetRect.x:s.targetRect.y,p="".concat(s.rect.width-d,"px"),f="".concat(s.rect.height-d,"px")),c||(i-=a),t("div",{onmouseover(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(e){e.srcElement.children[0].style.backgroundColor=s.style.line.stroke,e.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":r,"data-key":[s.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?d:i,"px"),top:"".concat(n?i:d,"px"),height:n?"".concat(a,"px"):f,width:n?p:"".concat(a,"px"),pointerEvents:"auto"}},[t("div",{style:zQ({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function S7(e){let t=e.h,n=e.isVertical,r=e.label,i=e.otherValue,o=e.rangeIdx,a=e.idx,s=e.pos,l=e.align,c=e.state,u=e.value;const d="end"!==l,p="outside"===c.settings.bubbles.placement;let f,h="none";n?(f=d?"left":"right",p&&(h=d?"translate(-100%, 0px)":"translate(100%, 0px)")):(f=d?"top":"bottom",p&&(h=d?"translate(0px, -100%)":"translate(0px, 100%)"));let m=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===a;const g={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let y=c.style.bubble.stroke;const b=m?t("input",{type:"text",value:u,style:VQ(VQ({},g),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)?(y="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(y)):c.onEditConfirmed(o,t,i)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c.onEditCanceled())}}):t("div",{"data-key":[c.key,"bubble",o,a].join("-"),"data-other-value":i,"data-idx":o,"data-bidx":a,style:g},[r]);return t("div",{style:{position:"absolute",[f]:"0",[n?"top":"left"]:"".concat(s,"px"),transform:h}},[b])}function k7(e){let t=e.h,n=e.isVertical,r=e.top,i=e.height,o=e.color,a=e.on,s=e.opacity;return t("div",zQ({style:{backgroundColor:o,opacity:s,position:"absolute",left:n?0:"".concat(r,"px"),top:n?"".concat(r,"px"):0,height:n?"".concat(i,"px"):"100%",width:n?"100%":"".concat(i,"px"),pointerEvents:"auto"}},a),[])}function C7(e){let t=e.borderHit,n=e.els,r=e.isVertical,i=e.state,o=e.vStart,a=e.vEnd,s=e.idx,l=0;i.targetRect&&(l=r?i.targetRect.y:i.targetRect.x);const c=!!i.scale,u=c?i.scale.norm(o)*i.size:o,d=c?i.scale.norm(a)*i.size:a,p=Math.abs(u-d),f=Math.min(u,d)+l,h=f+p;if(i.targetRect){const e=i.targetFillRect||i.targetRect,t=r?e.height:e.width,s=c?i.scale.norm(o)*t:o,l=c?i.scale.norm(a)*t:a,u=Math.abs(s-l),d=Math.min(s,l),p={h:i.h,isVertical:r,top:d,height:u,color:i.style.target.fill,opacity:i.style.target.opacity};i.style.target.opacity<.8&&(p.on={onmouseover(e){e.srcElement.style.opacity=i.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=i.style.target.opacity}}),n.push(i.h("div",{style:{position:"absolute",left:"".concat(e.x,"px"),top:"".concat(e.y,"px"),height:"".concat(e.height,"px"),width:"".concat(e.width,"px")}},[k7(p)]))}const m=u<d?o:a,g=u<d?a:o,y=WQ(c?i.scale.domain():[Math.min(o,a),Math.max(o,a)],2),b=y[0],v=y[1],x=m+1e-5>=b&&m-1e-5<=v,w=g-1e-5<=v&&g+1e-5>=b;x&&n.push(w7({h:i.h,isVertical:r,borderHit:t,value:m,pos:f,align:"start",state:i,idx:s})),w&&n.push(w7({h:i.h,isVertical:r,borderHit:t,value:g,pos:h,align:"end",state:i,idx:s}));const S=i.settings.bubbles;if(S&&S.show){S.fontSize,S.fontFamily,S.fill;const e=[o,a];x&&n.push(S7({h:i.h,isVertical:r,align:S.align,rangeIdx:s,idx:0,otherValue:g,value:m,label:"".concat(i.format(m,e)),pos:f,state:i})),w&&n.push(S7({h:i.h,isVertical:r,align:S.align,rangeIdx:s,idx:1,otherValue:m,value:g,label:"".concat(i.format(g,e)),pos:h,state:i}))}}function E7(e){const t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start;let r=e.current-e.start;return r=r<0?Math.max(r,n):Math.min(r,t),r}function M7(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach((r,i)=>{e.active&&i===e.active.idx||C7({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(r.min,r.max),vEnd:Math.max(r.min,r.max),idx:i})}),e.active){let r=e.start,i=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)r=Math.min(e.active.start,e.active.end),i=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)r=Math.min(e.start,e.current),i=Math.max(e.start,e.current);else{const t=E7(e);r=e.active.start+t,i=e.active.end+t}C7({borderHit:5,els:t,isVertical:n,state:e,vStart:r,vEnd:i,idx:e.active.idx})}return t}function R7(e){return{min:e.scale.min(),max:e.scale.max()}}function _7(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function A7(e,t,n){let r,i,o=e.ranges,a=-1;for(r=0;r<o.length;r++){if(o[r].min<=t&&t<=o[r].max){a=r,n.min=r?o[r-1].max:n.min,n.max=r+1<o.length?o[r+1].min:n.max;break}if(t<o[r].min){n.max=o[r].min,n.min=r?o[r-1].max:n.min;break}}-1===a&&o.length&&r>=o.length&&(n.min=o[o.length-1].max),-1!==a&&(i={idx:a,start:o[a].min,end:o[a].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=i}function I7(e){e.renderer.render(M7(e))}function P7(e,t){if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map(e=>e.id()),i=t.brushes().filter(e=>"range"===e.type&&-1!==r.indexOf(e.id))[0];return i?i.brush.ranges():[]}function T7(e,t){let n,r=1/0;const i=t.domain(),o=t.bandwidth()/2;for(let a=0;a<i.length;++a){const s=Math.abs(e-o-t(i[a]));s<r&&(r=s,n=i[a])}return n}function D7(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function O7(e){const t=e.reduce((e,t)=>(e.push(...JQ(t.bounds)),e),[]);return QQ(t)}const N7={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{rangeStart(e){this.start(e)},rangeMove(e){this.move(e)},rangeEnd(e){this.end(e)},rangeClear(e){this.clear(e)},bubbleStart(e){this.bubbleStart(e)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(e){this.state.rect=e.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=P7(this.state,this.state.brushInstance),this.state.active=null,I7(this.state))},render(e){const t=this.settings.settings;this.state.direction="vertical"===t.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),r=this.state.rect[0===this.state.direction?"height":"width"];let i=f4(this.chart.scale(t.scale),r);const o=function(e){const t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,r=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map(t=>e.chart.component(t)).filter(e=>!!e&&!!e.rect),i=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(i.length>0){const r=O7(i);if(t.size=r[0===e.state.direction?"height":"width"],t.scale=f4(e.chart.scale(n.scale),t.size),t.targetRect=r,o.length>0){const e=O7(o);t.targetFillRect=e}}else if(r&&r.length>0){const n=r.slice(1).reduce((e,t)=>({x0:Math.min(e.x0,t.rect.computedInner.x),y0:Math.min(e.y0,t.rect.computedInner.y),x1:Math.max(e.x1,t.rect.computedInner.x+t.rect.computedInner.width),y1:Math.max(e.y1,t.rect.computedInner.y+t.rect.computedInner.height)}),{x0:r[0].rect.computedInner.x,y0:r[0].rect.computedInner.y,x1:r[0].rect.computedInner.x+r[0].rect.computedInner.width,y1:r[0].rect.computedInner.y+r[0].rect.computedInner.height});t.targetRect={x:n.x0-e.state.rect.x,y:n.y0-e.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return t}(this);if(i=o.scale?o.scale:i,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?r:o.size,this.state.settings=t,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof t.brush?t.brush.context:t.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.onEditConfirmed=(e,t,n)=>{this.state.edit=null,function(e,t,n,r){let i=e.ranges.map(e=>({min:e.min,max:e.max}));const o=e.scale.min(),a=e.scale.max();i[t]={min:Math.max(o,Math.min(n,r)),max:Math.min(a,Math.max(n,r))},e.ranges[t]=VQ({},i[t]);const s=e.scale.data();s&&s.fields&&s.fields.forEach(t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),i)})}(this.state,e,t,n),this.emit("bubbleEnd"),I7(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,I7(this.state)},this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX"},this.state.format="function"==typeof t.bubbles.label&&((e,n)=>t.bubbles.label.call(void 0,{datum:e,data:n,scale:i,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(i,"norm")){this.state.editable=!0,this.state.observeBrush="object"==typeof t.brush&&t.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=i;const e=this.state.scale.data();!this.state.format&&e&&e.fields&&e.fields[0]&&(this.state.format=e.fields[0].formatter())}else this.state.editable=!1,this.state.scale=g3(),this.state.scale.data=i.data,this.state.format||(this.state.format=(e,t)=>D7(i.range(),t)?function(e,t){const n=t.ticks(),r=t.domain().indexOf(T7(e,t));return-1!==r?n[r].label:"-"}(e,i):"-"),this.state.fauxBrushInstance=e4(),this.state.findValues=e=>function(e,t){const n=t.domain(),r=t.range(),i=[];return e.forEach(e=>{if(!D7(r,[e.min,e.max]))return;const o=n.indexOf(T7(e.min,t)),a=n.indexOf(T7(e.max,t));i.push.apply(i,n.slice(Math.min(o,a),Math.max(o,a)+1))}),i}(e,i);return this.state.ranges=P7(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[M7(this.state)]:[]},mounted(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start(e){!function(e){let t=e.state,n=e.e,r=e.renderer,i=e.ranges,o=e.targetSize;if(t.started)return;t.edit=null;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);const c={started:!0};t.offset=zQ({},r.element().getBoundingClientRect());const u=a-t.offset.left,d=s-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=i(t,t.fauxBrushInstance||t.brushInstance);const p=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];c.current=t.scale.normInvert(f/t.size),c.start=t.scale.normInvert(p/t.size);let h=t.ranges;const m=R7(t);let g,y,b=-1;if(l&&l.hasAttribute("data-idx"))b=parseInt(l.getAttribute("data-idx"),10),m.min=b>0?h[b-1].max:m.min,m.max=b+1<h.length?h[b+1].min:m.max;else{for(g=0;g<h.length;g++){if(h[g].min<=c.start&&c.start<=h[g].max){b=g,m.min=g?h[g-1].max:m.min,m.max=g+1<h.length?h[g+1].min:m.max;break}if(c.start<h[g].min){m.max=h[g].min,m.min=g?h[g-1].max:m.min;break}}-1===b&&h.length&&g>=h.length&&(m.min=h[h.length-1].max)}if(-1!==b||t.multi||(c.ranges=[],m.min=t.scale.min(),m.max=t.scale.max()),-1!==b)if(y={idx:b,start:h[b].min,end:h[b].max,limitLow:m.min,limitHigh:m.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{let e=t.scale.norm(y.start)*t.size,n=t.scale.norm(y.end)*t.size;Math.abs(p-e)<=o?(c.start=y.end,y.mode="modify"):Math.abs(p-n)<=o&&(c.start=y.start,y.mode="modify")}else y={idx:-1,start:c.start,end:c.current,limitLow:m.min,limitHigh:m.max,mode:"current"};c.active=y,"modify"!==y.mode&&t.targetRect&&!u6(t.targetRect,{x:u,y:d})||Object.keys(c).forEach(e=>t[e]=c[e])}({e:e,state:this.state,renderer:this.renderer,ranges:P7,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=R7(e);A7(e,e.current,n)}(this.state,P7),I7(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(e){this.state.started&&(!function(e,t){const n=(t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset])/e.size,r=e.scale.normInvert(n);e.current=Math.max(Math.min(r,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){let t=e.ranges.map(e=>({min:e.min,max:e.max}));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=E7(e);t[e.active.idx].min+=n,t[e.active.idx].max+=n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});const n=e.scale.data();n&&n.fields&&n.fields.forEach(n=>{if(e.fauxBrushInstance){let r=P7(e,e.fauxBrushInstance),i=e.findValues(r),o=e.findValues(t),a=o.filter(e=>-1===i.indexOf(e)),s=i.filter(e=>-1===o.indexOf(e)),l=a.map(e=>({key:n.id(),value:e})),c=s.map(e=>({key:n.id(),value:e}));e.brushInstance.addAndRemoveValues(l,c),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)})}(this.state),I7(this.state))},clear(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart(e){if(!this.state.editable)return;const t=e.srcEvent||e,n=t.target,r={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(isNaN(r.rangeIdx)||JSON.stringify(r)===JSON.stringify(this.state.edit))return;this.state.edit=r,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const i=n.parentNode;I7(this.state);const o=i.querySelector("input");o.focus(),o.select()}};function q7(e){e.renderer.render(M7(e))}function L7(e){return e.rc.ranges()}function j7(e,t){const n={x:e.direction?t.min+e.rect.x:e.rect.x,y:e.direction?e.rect.y:t.min+e.rect.y,width:e.direction?t.max-t.min:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:t.max-t.min};return e.chart.shapesAt(n,e.settings.brush)}const z7={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaClear(e){this.clear(e)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(e){this.state.rect=this.rect;const t=this.settings.settings,n="vertical"===t.direction?0:1,r=this.state.rect[0===n?"height":"width"],i=this.renderer.element().getBoundingClientRect(),o=(t.target?t.target.components||[t.target.component]:[]).map(e=>this.chart.component(e)).filter(e=>!!e&&!!e.rect),a=o[0]?o.slice(1).reduce((e,t)=>({x0:Math.min(e.x0,t.rect.x),y0:Math.min(e.y0,t.rect.y),x1:Math.max(e.x1,t.rect.x+t.rect.width),y1:Math.max(e.y1,t.rect.y+t.rect.height)}),{x0:o[0].rect.x,y0:o[0].rect.y,x1:o[0].rect.x+o[0].rect.width,y1:o[0].rect.y+o[0].rect.height}):null;return this.state.targetRect=a?{x:a.x0-this.rect.x,y:a.y0-this.rect.y,width:a.x1-a.x0,height:a.y1-a.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=n,this.state.settings=t,this.state.offset=i,this.state.rc=B3(),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.size=r,this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX",area:0===this.state.direction?"height":"width"},this.state.format=function(e,t){return function(e,t,n){const r=Math.min(...n),i=Math.max(...n),o={x:e.direction?r+e.rect.x:e.rect.x,y:e.direction?e.rect.y:r+e.rect.y,width:e.direction?i-r:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:i-r},a=e.chart.shapesAt(o,e.settings.brush);if(0===a.length)return"-";const s=a.reduce((n,i)=>{const o=n.bounds,a=i.bounds;return t===r?o[e.cssCoord.coord]<=a[e.cssCoord.coord]?n:i:o[e.cssCoord.coord]+o[e.cssCoord.area]>=a[e.cssCoord.coord]+a[e.cssCoord.area]?n:i}),l=e.settings.brush.components.reduce((e,t)=>e.key===s.key?e:t);return"function"==typeof e.settings.bubbles.label?e.settings.bubbles.label(s.data):Array.isArray(l.data)&&l.data.length?s.data[l.data[0]].label:s.data&&s.data.label?s.data.label:"-"}(this,e,t)},[]},start(e){!function(e){let t=e.state,n=e.e,r=e.renderer,i=e.ranges,o=e.targetSize;if(t.started)return;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);const c={started:!0};t.offset=r.element().getBoundingClientRect(),t.ranges=i(t);const u=a-t.offset.left,d=s-t.offset.top,p=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];let h=f,m=p;c.start=p,c.current=f;let g=t.ranges;const y=_7(t);let b,v,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),y.min=x>0?g[x-1].max:y.min,y.max=x+1<g.length?g[x+1].min:y.max;else{for(b=0;b<g.length;b++){if(g[b].min<=m&&m<=g[b].max){x=b,y.min=b?g[b-1].max:y.min,y.max=b+1<g.length?g[b+1].min:y.max;break}if(m<g[b].min){y.max=g[b].min,y.min=b?g[b-1].max:y.min;break}}-1===x&&g.length&&b>=g.length&&(y.min=g[g.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(v={idx:x,start:g[x].min,end:g[x].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),v.mode="modify";else{let e=v.start,t=v.end;Math.abs(p-e)<=o?(c.start=v.end,v.mode="modify"):Math.abs(p-t)<=o&&(c.start=v.start,v.mode="modify")}else v={idx:-1,start:m,end:h,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=v,"modify"!==v.mode&&t.targetRect&&!u6(t.targetRect,{x:u,y:d})||Object.keys(c).forEach(e=>t[e]=c[e])}({e:e,state:this.state,renderer:this.renderer,ranges:L7,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=_7(e);A7(e,e.current,n)}(this.state,L7),q7(this.state))},move(e){this.state.started&&(!function(e,t){const n=t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];e.current=Math.max(Math.min(n,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){const t=e.ranges.map(e=>({min:e.min,max:e.max}));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=E7(e);t[e.active.idx].min=e.active.start+n,t[e.active.idx].max=e.active.end+n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});e.rc.set(t);let n=[];t.forEach(t=>{n=[...n,...j7(e,t)]}),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),q7(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function F7(e){const t="vertical"===e.direction,n=e.rect[t?"height":"width"],r=e.rect[t?"width":"height"];return function(e){const t=e.brush;if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map(e=>e.id()),i=t.brushes().filter(e=>"range"===e.type&&-1!==r.indexOf(e.id))[0];return i?i.brush.ranges():[]}(e).map(i=>{const o=e.scale(i.min)*n,a=e.scale(i.max)*n,s=Math.min(o,a),l=Math.abs(o-a);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:s,width:t?r:l,y:t?s:0,height:t?l:r}})}function $7(e,t,n,r){function i(){!function(e){e.renderer.render(F7(e))}(e)}function o(){!function(e){e.renderer.render(F7(e))}(e)}function a(){!function(e){e.renderer.render(F7(e))}(e)}e.brush=t,t&&(t.on("start",i),t.on("update",o),t.on("end",a),e.start=i,e.update=o,e.end=a,e.brush=t,e.scale=n,e.renderer=r)}function B7(e){e.brush&&(e.brush.removeListener("start",e.start),e.brush.removeListener("update",e.update),e.brush.removeListener("end",e.end)),e.start=void 0,e.update=void 0,e.end=void 0,e.brush=void 0,e.scale=void 0,e.renderer=void 0}const H7={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",r="horizontal"===n?this.rect.width:this.rect.height,i=f4(this.chart.scale(e.scale),r);return B7(this.state),$7(this.state,t,i,this.renderer),this.state.rect=this.rect,this.state.fill=e.fill||"#ccc",this.state.opacity=void 0!==e.opacity?e.opacity:1,this.state.direction=n,F7(this.state)},beforeDestroy(){B7(this.state)}};function V7(e,t){const n=t.center.x,r=t.center.y;return{x:n-e.left,y:r-e.top}}function W7(e,t,n){return P4(e,t.points[0])<n.settings.snapIndicator.threshold**2}function U7(e,t){null==e.path.d?e.path.d="M".concat(t.x," ").concat(t.y," "):e.path.d+="L".concat(t.x," ").concat(t.y," "),e.points.push(t)}function G7(e){let t=e.state,n=e.start,r=void 0===n?null:n,i=e.end,o=void 0===i?null:i;null!==r&&(t.snapIndicator.x1=r.x,t.snapIndicator.y1=r.y),null!==o&&(t.snapIndicator.x2=o.x,t.snapIndicator.y2=o.y)}function Y7(e,t){e.snapIndicator.visible=t}const K7={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart(e){this.start(e)},lassoEnd(e){this.end(e)},lassoMove(e){this.move(e)},lassoCancel(){this.cancel()}},created(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start(e){var t;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(e,t){const n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=this.settings.settings.brush.components.map(e=>({key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"}));const n=V7(this.state.rendererBounds,e);U7(this.state,n),G7({state:this.state,start:n}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,n)},move(e){if(!this.state.active)return;const t=V7(this.state.rendererBounds,e);W7(t,this.state,this.settings)?Y7(this.state,!0):Y7(this.state,!1),U7(this.state,t),G7({state:this.state,end:t}),function(e,t){const n=[e.startPoint,e.path,e.snapIndicator].filter(e=>e.visible);t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){const n=e.points[e.points.length-2],r=e.points[e.points.length-1];e.lineBrushShape.x1=n.x+e.componentDelta.x,e.lineBrushShape.y1=n.y+e.componentDelta.y,e.lineBrushShape.x2=r.x+e.componentDelta.x,e.lineBrushShape.y2=r.y+e.componentDelta.y;const i=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(i,{components:e.brushConfig})}}(this.state,this.chart)},end(e){if(!this.state.active)return;Y7(this.state,!1);W7(V7(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){const n=e.componentDelta.x,r=e.componentDelta.y,i=e.points.map(e=>({x:e.x+n,y:e.y+r})),o=t.shapesAt({vertices:i},{components:e.brushConfig});t.brushFromShapes(o,{components:e.brushConfig})}}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([])},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach(e=>{e.contexts.forEach(e=>{t.brush(e).end()})}),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},render(){}};function X7(e,t,n,r,i){let o,a=0,s=t.length-1;for(;a<s;){let l=Math.floor((a+s)/2);o=i(t[l]),o[n]+o[r]<e[n]?a=l+1:s=l}return a}function J7(e){let t=e.orientation,n=e.targetNodes,r=e.labels,i=e.container,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:X7;const a=[],s="v"===t?"x":"y",l="v"===t?"width":"height",c=e=>e.textBounds,u=e=>e.node.localBounds;return(e,t)=>{const d=r[t],p=d.textBounds,f=d.node;if(p[s]<i[s]||p[s]+p[l]>i[s]+i[l])return!1;for(let e=o(p,a,s,l,c);e<a.length;e++)if(l6(p,a[e].textBounds))return!1;const h=o(p,n,s,l,u),m=p[s]+p[l];for(let e=h;e<n.length;e++){const t=n[e].node;if(m<t.localBounds[s])break;if(l6(p,t.localBounds)&&f!==t)return!1}return a.push(r[t]),!0}}function Q7(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Z7(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function e9(e){return VQ(VQ({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds),{},{data:"".concat(e.data," ").concat(e.text),rotation:e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal"})}function t9(e,t,n){return n?e.width>=t.height:e.width>=t.width}function n9(e,t,n){return n?e.height>=t.width:e.height>=t.height}function r9(e,t,n,r,i){let o,a;return"v"===e?(o=r||i||t9(t,n,!0),a=n9(t,n,!r)):(o=t9(t,n),a=i||n9(t,n,!1)),o&&a}function i9(e,t,n,r){return e+.5*t+(r-.5)*(t-n)-.5*n}function o9(e,t,n){const r={type:"text",text:t,maxWidth:n.rotate?e.height:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:n.rotate?"end":"start",baseline:"central",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(!n.overflow&&!function(e,t,n){return t9(e,t,n.rotate)&&n9(e,t,n.rotate)}(e,i,n))return!1;const o=.5*i.height;return n.rotate?(r.x=i9(e.x,e.width,i.height,n.align)+o,r.y=i9(e.y,e.height,i.width,n.justify),"right"===n.dock?r.transform="rotate(90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,") translate(").concat(i.width,", 0)"):r.transform="rotate(-90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,")")):(r.x=i9(e.x,e.width,i.width,n.align),r.y=i9(e.y,e.height,i.height,n.justify)+o),r}function a9(e){let t=e.bar,n=e.view,r=e.direction,i=e.position,o=e.padding,a=void 0===o?4:o,s=e.measured;const l={};if(zQ(l,t),i&&"inside"!==i)if("up"===r||"down"===r){const e=Math.max(0,Math.min(t.y,n.height)),o=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===i&&"up"===r||"opposite"===i&&"down"===r?(l.y=0,l.height=e):("outside"===i&&"down"===r||"opposite"===i&&"up"===r)&&(l.y=o,l.height=n.height-o)}else{const e=Math.max(0,Math.min(t.x,n.width)),o=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===i&&"left"===r||"opposite"===i&&"right"===r?(l.x=0,l.width=e):("outside"===i&&"right"===r||"opposite"===i&&"left"===r)&&(l.x=o,l.width=n.width-o)}else;return function(e,t){const n=Math.max(0,Math.min(e.y,t.height)),r=Math.max(0,Math.min(e.y+e.height,t.height)),i=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=i,e.width=o-i,e.y=n,e.height=r-n}(l,n),function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=n.top,i=void 0===r?4:r,o=n.bottom,a=void 0===o?4:o,s=n.left,l=void 0===s?4:s,c=n.right,u=void 0===c?4:c,d="function"==typeof l?l(t):l,p="function"==typeof u?u(t):u,f="function"==typeof i?i(t):i,h="function"==typeof a?a(t):a;e.x+=d,e.width-=d+p,e.y+=f,e.height-=f+h}(l,s,a),l}function s9(e){let t,n,r,i,o,a=e.direction,s=e.fitsHorizontally,l=e.measured,c=e.node,u=e.orientation,d=e.placementSettings,p=e.rect,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a9;const h=[],m="h"===u?"width":"height";for(o=0;o<d.length;o++)if(r=d[o],i=f({bar:c.localBounds,view:p,direction:a,position:r.position,padding:r.padding,measured:l}),h.push(i),t=!o||i[m]>t[m]?i:t,r9(u,i,l,s,r.overflow)){n=i;break}return n||(n=t,o=h.indexOf(n)),r=d[o],{bounds:n,placement:r}}function l9(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const o=i.top,a=void 0===o?4:o,s=i.bottom,l=void 0===s?4:s,c=i.left,u=void 0===c?4:c,d=i.right,p=void 0===d?4:d,f="function"==typeof u?u(t):u,h="function"==typeof p?p(t):p,m="function"==typeof a?a(t):a,g="function"==typeof l?l(t):l,y=e.x+e.dx,b=e.y+e.dy,v=n?Math.min(t.width,r.height):Math.min(t.height,r.width),x=n?Math.min(t.height,r.height):Math.min(t.width,r.width),w=.5*t.height,S=1e-9;return{x:(n?y-w:y)-f-S,y:(n?b:b-w)-m-S,width:x+(f+h)-S,height:v+(m+g)-S}}function c9(e){let t=e.chart,n=e.targetNodes,r=e.rect,i=e.fitsHorizontally,o=e.collectiveOrientation,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s9,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o9,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:J7;const c=[],u={container:r,targetNodes:n,labels:[],orientation:o};let d,p,f,h,m,g,y,b,v,x,w,S,k,C;for(let e=0,l=n.length;e<l;e++){g=null,p=n[e],f=p.node,k=Q7(f,t),v=p.direction,C="left"===v||"right"===v?"h":"v";for(let t=0;t<p.texts.length;t++){if(h=p.texts[t],!Z7(h))continue;x=p.labelSettings[t],b=p.measurements[t],S=x.placements;const n=a({direction:v,fitsHorizontally:i,lblStngs:x,measured:b,node:f,orientation:C,placements:S,placementSettings:p.placementSettings[t],rect:r});if(g=n.bounds,w=n.placement,g&&w){var E;m=w.justify;const t="function"==typeof x.linkData?x.linkData(k,e):void 0,n="function"==typeof w.overflow?w.overflow(k,e):w.overflow;"up"===v&&(m=1-m),"opposite"===w.position&&(m=1-m),"left"===v&&(m=1-m);const r=!("h"===o||i);if(d=s(g,h,{justify:"h"===C?w.align:m,align:"h"===C?m:w.align,fontSize:x.fontSize,fontFamily:x.fontFamily,textMetrics:b,rotate:r,overflow:!!n,dock:null!==(E=x.dock)&&void 0!==E?E:"left"}),d){const n=l9(d,b,r,g,w.padding);y="function"==typeof w.fill?w.fill(VQ(VQ({},k),{},{textBounds:n}),e):w.fill,d.fill=y,void 0!==t&&(d.data=t),"object"==typeof w.background&&(d.backgroundColor="function"==typeof w.background.fill?w.background.fill(VQ(VQ({},k),{},{textBounds:n}),e):w.background.fill,void 0!==d.backgroundColor&&(d.backgroundBounds=l9(d,b,r,g,w.background.padding))),c.push(d),u.labels.push({node:f,textBounds:n})}}}}const M=c.filter(l(u));return[...M.filter(e=>void 0!==e.backgroundBounds).map(e9),...M]}function u9(e){const t=2*Math.PI;return(e%t+t)%t}function d9(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function p9(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function f9(e,t,n){let r=t.x,i=t.y;if(r*r+i*i>e*e)return null;let o=Math.sin(n),a=Math.cos(n),s=r*a-i*o,l=e*e-s*s;if(l<0)return null;let c=Math.sqrt(l);return{x:s*a+o*c,y:-s*o+a*c}}function h9(e){let t,n,r=e.radius,i=e.size,o=e.angle,a=i.width,s=i.height,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=f9(r,l,o),!t)return null;t.y*=-1,n={x:-a,y:0};break;case 1:if(t=f9(r,l,Math.PI-o),!t)return null;n={x:-a,y:-s};break;case 2:if(t=f9(r,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-s};break;case 3:if(t=f9(r,l,2*Math.PI-o),!t)return null;t.x*=-1,t.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:t.x+n.x,y:t.y+n.y,width:a,height:s}}function m9(e){let t=e.slice,n=e.measured,r=e.padding,i=t.start,o=t.end,a=t.innerRadius,s=t.outerRadius,l=s-a-2*r,c=o-i;if(c<Math.PI){let e=(n.height/2+r)/Math.tan(c/2);e>a&&(l=s-e-2*r)}if(l<0||l<n.minReqWidth)return null;const u=u9((i+o)/2);let d=s-r,p={x:Math.sin(u)*d,y:-Math.cos(u)*d,width:l,height:n.height};return u<Math.PI?(p.angle=u-Math.PI/2,p.anchor="end"):(p.angle=u+Math.PI/2,p.anchor="start"),p}function g9(e){let t=e.context,n=e.node,r=e.bounds;let i=n.desc.slice;const o=u9((i.start+i.end)/2);switch(Math.floor(o/(Math.PI/2))){case 0:t.q1maxY=r.y-2,void 0===t.q2minY&&(t.q2minY=r.y+r.height+2);break;case 1:t.q2minY=r.y+r.height+2;break;case 2:t.q3minY=r.y+r.height+2;break;case 3:t.q4maxY=r.y-2,void 0===t.q3minY&&(t.q3minY=r.y+r.height+2)}}function y9(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function b9(e,t,n){const r={type:"text",text:t,maxWidth:e.width,x:e.x,y:e.y+("top"===e.baseline?e.height/2:0),fill:n.fill,anchor:e.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(e.angle)){let t=e.angle*(360/(2*Math.PI));r.transform="rotate(".concat(t,", ").concat(r.x,", ").concat(r.y,")")}return r}function v9(e){let t,n,r=e.slice,i=e.direction,o=e.position,a=e.padding,s=e.measured,l=e.view,c=e.context,u=e.store,d=r.start,p=r.end,f=r.innerRadius,h=r.offset;switch(o){case"into":t="rotate"===i?m9({slice:r,measured:s,padding:a}):function(e){let t=e.slice,n=e.padding,r=e.measured,i=t.start,o=t.end,a=t.innerRadius,s=t.outerRadius;const l=u9((i+o)/2);let c=h9({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",d6(c,{x1:0,y1:0,x2:Math.sin(i)*s,y2:-Math.cos(i)*s})||d6(c,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||n6({cx:0,cy:0,r:a},c)?null:(d9(c,n),c)):null}({slice:r,measured:s,padding:a});break;case"inside":n={start:d,end:p,innerRadius:0,outerRadius:f},t="rotate"===i?m9({slice:n,measured:s,padding:a}):function(e){let t=e.slice,n=e.padding,r=e.measured,i=e.store;const o=t.start,a=t.end,s=t.outerRadius,l=u9((o+a)/2);let c=h9({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",d9(c,n),i.insideLabelBounds.some(e=>l6(e,c))?null:(i.insideLabelBounds.push({x:c.x-4,y:c.y,width:c.width+8,height:c.height}),c)):null}({slice:n,measured:s,padding:a,store:u});break;case"outside":t="rotate"===i?function(e){let t=e.slice,n=e.measured,r=e.padding,i=e.view,o=t.start,a=t.end,s=t.outerRadius,l=t.offset,c=s+r,u=a-o;if(u<Math.PI&&(n.height/2+r)/Math.tan(u/2)>c)return null;const d=u9((o+a)/2);let p=Math.sin(d)*c,f=-Math.cos(d)*c,h=n.width+1,m=d%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){let e=f<0?i.y:i.y+i.height,t=Math.abs(e-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*r-s;t<h&&(h=t)}if(Math.sin(m)>.001){let e=p<0?i.x:i.x+i.width,t=Math.abs(e-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*r-s;t<h&&(h=t)}if(h<=0||h<n.minReqWidth)return null;let g={x:p,y:f,width:h,height:n.height};return d<Math.PI?(g.angle=d-Math.PI/2,g.anchor="start"):(g.angle=d+Math.PI/2,g.anchor="end"),g}({slice:r,measured:s,padding:a,view:l}):function(e){let t=e.slice,n=e.measured,r=e.padding,i=e.view,o=e.context,a=t.start,s=t.end,l=t.outerRadius,c=t.offset;const u=u9((a+s)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.q4maxY<0;default:return!0}}(o,Math.floor(u/(Math.PI/2)),i))return null;let d=l+r+n.height/2,p=Math.sin(u)*d,f=-Math.cos(u)*d,h=n.width+1;if(u<Math.PI){let e=Math.abs(i.x+i.width-(p+c.x));e<h&&(h=e)}else{let e=Math.abs(i.x-(p+c.x));e<h&&(h=e)}if(h<n.minReqWidth)return null;let m={x:p,y:f,width:h,height:n.height};return u<Math.PI?m.anchor="start":m.anchor="end",m}({slice:r,measured:s,padding:a,view:l,context:c});break;default:throw new Error("not implemented")}return t&&(t.x+=h.x,t.y+=h.y,"outside"===o&&"rotate"!==i&&function(e,t,n){const r=n.start,i=n.end,o=n.offset,a=n.outerRadius,s=u9((r+i)/2);switch(Math.floor(s/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){let n=Math.min(e.y,t.q1maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){let n=Math.max(e.y,t.q2minY),r=n-e.y;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){let n=Math.max(e.y,t.q3minY),r=n-e.y;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){let n=Math.min(e.y,t.q4maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}}}(t,c,r)),t}function x9(e){let t=e.context,n=e.direction,r=e.measured,i=e.node,o=e.placementSettings,a=e.rect,s=e.store,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v9;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,slice:i.desc.slice,view:a,direction:n,position:c.position,measured:r,padding:c.padding,store:s});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function w9(e,t,n){const r=t.fontFamily,i="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:r,fontSize:i});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:r,fontSize:i}).width),o}const S9=/\n+|\r+|\r\n/,k9=/\s/,C9=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function E9(e){return"string"==typeof e?-1!==e.search(S9):-1!==String(e).search(S9)}function M9(e){return-1!==e.search(k9)}function R9(e){return-1!==e.search(C9)}function _9(e,t,n){return Math.max(t,Math.min(n,e))}function A9(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.string,n=e.separator,r=void 0===n?"":n,i=e.reverse,o=void 0!==i&&i,a=e.measureText,s=void 0===a?e=>({width:e.length,height:1}):a,l=e.mandatoryBreakIdentifiers,c=void 0===l?[E9]:l,u=e.noBreakAllowedIdentifiers,d=void 0===u?[]:u,p=e.suppressIdentifier,f=void 0===p?[M9,E9,e=>""===e]:p,h=e.hyphenationIdentifiers,m=void 0===h?[R9]:h;const g=String(t).split(r);!function(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}(g);const y=g.length,b=o?e=>e>=0:e=>e<y;let v=o?y:-1;function x(e){const t=_9(e,0,y-1),n=g[t],r=s(n),i=function(e,t,n,r,i){return r.some(r=>r(e,t,n))?1:i.some(r=>r(e,t,n))?0:2}(n,t,g,c,d);return{index:t,value:n,breakOpportunity:i,suppress:f.some(e=>e(n,t,g)),hyphenation:m.some(e=>e(n,t,g)),width:r.width,height:r.height,done:!1}}return{next:function(e){return isNaN(e)?o?v--:v++:v=_9(e,0,y-1),b(v)?x(v):{done:!0}},peek:x,length:y}}const I9="…",P9=/^\s*\d+(\.\d+)?px\s*$/i;function T9(e){return"string"===typeof e&&P9.test(e)}function D9(e){const t=e["font-size"]||e.fontSize;return T9(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function O9(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const r=D9(e);return Math.max(1,Math.min(Math.floor(t/r),n))}function N9(e,t){return{lines:[],line:"",width:0,maxLines:O9(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function q9(e){e.lines.push(e.line),e.line="",e.width=0}function L9(e,t){e.line+=t.value,e.width+=t.width}function j9(e,t,n){if(t.width>e.maxWidth)return t;const r=t.index;for(let i=1;i<5;i++){const o=n.peek(t.index-1);if(!t.hyphenation||!o.hyphenation||0===t.index)return t;if(e.width+e.hyphens.metrics.width<=e.maxWidth)return e.line+=e.hyphens.char,t;if(1===e.line.length)return t;t=n.next(r-i),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function z9(e,t,n){const r=A9({string:t.value,measureText:n});for(;e.lines.length<e.maxLines;){let t=r.next();if(t.done)break;e.width+t.width>e.maxWidth&&2===t.breakOpportunity&&e.line.length>0?(t=e.hyphens.enabled?j9(e,t,r):t,q9(e),L9(e,t)):L9(e,t)}}function F9(e,t){const n=A9({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),r=N9(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){q9(r),i=!1;break}1===e.breakOpportunity?q9(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?r.width+=e.width:(e=r.hyphens.enabled?j9(r,e,n):e,q9(r),L9(r,e)):L9(r,e)}return{lines:r.lines,reduced:i}}function $9(e,t){const n=A9({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),r=N9(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){q9(r),i=!1;break}1===e.breakOpportunity?q9(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?q9(r):e.width>r.maxWidth?z9(r,e,t):(q9(r),L9(r,e)):L9(r,e)}return{lines:r.lines,reduced:i}}function B9(e){return{"break-all":F9,"break-word":$9}[e.wordBreak]}function H9(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const r=B9(n);if(!r)return;const i=e(n);if(i.width>n.maxWidth||E9(n.text)){const o=(D9(n)-i.height)/2,a=r(n,function(e,t){return n=>t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}(n,e));t.node=function(e,t,n,r){const i={type:"container",children:[]};void 0!==t.id&&(i.id=t.id);let o=0;return e.lines.forEach((a,s)=>{const l=zQ({},t);l.text=a,l._lineBreak=!0,o+=n,e.reduced&&s===e.lines.length-1?l.text+=I9:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=r,o+=n,i.children.push(l)}),i}(a,n,o,i.height)}}}}function V9(e,t){const n=e["font-family"]||e.fontFamily,r=e["font-size"]||e.fontSize,i="string"==typeof e.text?e.text:"".concat(e.text),o=e.maxWidth;if(void 0===o)return i;let a=t({text:i,fontSize:r,fontFamily:n}).width;if(a<=o)return i;let s=0,l=i.length-1;for(;s<=l;){let e=Math.floor((s+l)/2);a=t({text:i.substr(0,e)+I9,fontSize:r,fontFamily:n}).width,a<=o?s=e+1:l=e-1}return i.substr(0,l)+I9}function W9(e){const t=e.baseline||e["dominant-baseline"];let n=0;const r=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){case"hanging":n=.75*r;break;case"text-before-edge":n=.85*r;break;case"middle":n=.25*r;break;case"central":n=.35*r;break;case"mathemetical":n=r/2;break;case"text-after-edge":case"ideographic":n=.2*-r;break;default:n=0}return n}const U9={},G9={},Y9={fontSize:void 0,fontFamily:void 0};let K9;function X9(e,t){return!e&&!t||e===t}function J9(e){let t=e.text,n=e.fontWeight,r=e.fontSize,i=e.fontFamily;const o="".concat(t," ").concat(n," ").concat(r," ").concat(i);return"number"!=typeof G9[o]&&(K9=K9||document.createElement("canvas").getContext("2d"),function(e){let t=e.fontWeight,n=e.fontSize,r=e.fontFamily;X9(Y9.fontWeight,t)&&X9(Y9.fontSize,n)&&X9(Y9.fontFamily,r)||(K9.font=[t,n,r].filter(e=>!!e).join(" "),Y9.fontWeight=t,Y9.fontSize=n,Y9.fontFamily=r)}({fontWeight:n,fontSize:r,fontFamily:i}),G9[o]=K9.measureText(t).width),G9[o]}function Q9(e){return"number"!=typeof U9[e]&&(U9[e]=function(e){if(T9(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),U9[e]}function Z9(e){let t=e.text,n=e.fontWeight,r=e.fontSize;return{width:J9({text:t,fontWeight:n,fontSize:r,fontFamily:e.fontFamily}),height:Q9(r)}}function eee(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Z9;const n=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,i=t({text:e.text,fontFamily:r,fontSize:n}),o=Math.min(e.maxWidth||i.width,i.width),a=e.x||0,s=e.y||0,l=e.dx||0,c={x:0,y:s+((e.dy||0)+W9(e))-.75*i.height,width:o,height:i.height},u=e["text-anchor"]||e.anchor;return c.x="middle"===u?a+l-o/2:"end"===u?a+l-o:a+l,c}function tee(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Z9;const n=B9(e),r=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:i,fontSize:r});if(n&&(o.width>e.maxWidth||E9(e.text))){const o=n(e,e=>t({text:e,fontFamily:i,fontSize:r})),a=zQ({},e);let s=0,l="";for(let e=0,n=o.lines.length;e<n;e++){let a=o.lines[e];a+=e===n-1&&o.reduced?I9:"";const c=t({text:a,fontSize:r,fontFamily:i}).width;c>=s&&(s=c,l=a)}a.text=l;const c=eee(a,t);return c.height=D9(e)*o.lines.length,c}return eee(e,t)}function nee(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function ree(e,t,n){const r={type:"text",text:t,maxWidth:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(e.width<n.fontSize)return!1;const o=Math.max(0,e.width-i.width);return r.x=e.x+n.align*o,r.y=e.y+i.height/1.2,r}function iee(e){return{type:"circle",bounds:{cx:e.cx,cy:e.cy,r:e.r}}}function oee(e){return e.desc&&e.desc.slice?function(e){let t=e.start,n=e.end,r=e.innerRadius,i=e.outerRadius,o=e.offset;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let a=0!==r?r:i;return iee({cx:o.x,cy:o.y,r:a})}(e.desc.slice):"circle"===e.type?iee(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var aee={bar:function(e){let t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,a=e.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c9;const l=zQ({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map(e=>zQ({},l,t,e)),u=t.labels.map(e=>e.placements.map(n=>zQ({},l,t,e,n))),d=function(e){let t=e.nodes,n=e.rect,r=e.chart,i=e.labelSettings,o=e.placementSettings,a=e.settings,s=e.renderer;const l={},c=[];let u,d,p,f,h,m,g,y=!0,b=!1;for(let e=0;e<t.length;e++){if(d=t[e],f=d.localBounds,!l6(f,n))continue;let v=Q7(d,r);u={node:d,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<i.length;t++)m=i[t],p="function"==typeof m.label?m.label(v,e):void 0,Z7(p)&&(g="function"==typeof a.direction?a.direction(v,e):a.direction||"up",b=b||"left"===g||"right"===g,l.fontFamily=m.fontFamily,l.fontSize="".concat(m.fontSize,"px"),l.text=p,h=s.measureText(l),u.measurements.push(h),u.texts.push(p),u.labelSettings.push(m),u.placementSettings.push(o[t]),u.direction=g,y=y&&h.width<=f.width-8);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:b}}({nodes:r,chart:n,renderer:o,settings:t,rect:i,labelSettings:c,placementSettings:u}),p=d.fitsHorizontally,f=d.hasHorizontalDirection,h=d.targetNodes,m=function(e){let t=e.orientation,n=void 0===t?"auto":t,r=e.defaultOrientation,i=void 0===r?"h":r;switch(n.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return i}}({orientation:t.orientation,defaultOrientation:f?"h":"v"}),g="h"===m?"y":"x",y="h"===m?"height":"width";return h.sort((e,t)=>e.node.localBounds[g]+e.node.localBounds[y]-(t.node.localBounds[g]+t.node.localBounds[y])),s({chart:n,targetNodes:h,stngs:t,rect:i,fitsHorizontally:p,collectiveOrientation:m})},slice:function(e){let t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,a=e.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:x9,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:b9;const c=zQ({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);c.fontSize=parseInt(c.fontSize,10);const u=t.labels.map(e=>zQ({},c,t,e)),d=t.labels.map(e=>e.placements.map(n=>zQ({},c,t,e,n))),p=[],f={insideLabelBounds:[]};r=function(e){const t=[],n=[],r=[],i=[];for(let o=0;o<e.length;++o){const a=e[o].desc.slice,s=u9((a.start+a.end)/2);switch(Math.floor(s/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:r.push(e[o]);break;case 3:i.push(e[o])}}const o=(e,t)=>u9((e.desc.slice.start+e.desc.slice.end)/2)-u9((t.desc.slice.start+t.desc.slice.end)/2),a=(e,t)=>o(t,e);return t.sort(a),n.sort(o),r.sort(a),i.sort(o),t.concat(n,i,r)}(r);const h={};for(let e=0,t=r.length;e<t;e++){const t=r[e],a=y9(t,n);for(let n=0;n<u.length;n++){const r=u[n],c="function"==typeof r.label?r.label(a,e):"";if(!c)continue;const m="function"==typeof r.direction?r.direction(a,e):r.direction||"horizontal",g="function"==typeof r.linkData?r.linkData(a,e):void 0,y=w9(c,r,o),b=s({context:h,direction:m,lblStngs:r,measured:y,node:t,placementSettings:d[n],rect:i,store:f}),v=b.bounds,x=b.placement;if(v&&x){if("outside"===x.position&&"rotate"!==m){g9({context:h,node:t,bounds:v});if(!Y4(p9(v),i))continue}const n="function"==typeof x.fill?x.fill(a,e):x.fill,o=l(v,c,{fill:n,fontSize:r.fontSize,fontFamily:r.fontFamily,textMetrics:y});o&&(void 0!==g&&(o.data=g),p.push(o),v.line&&(v.line.stroke=n,p.push(v.line)))}}}return p},rows:function(e){let t=e.settings,n=e.chart,r=e.nodes,i=e.renderer,o=e.style,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ree;const s=zQ({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);const l=zQ({},s,t),c=t.labels.map(e=>zQ({},l,e)),u={},d=[];for(let e=0,t=r.length;e<t;e++){let t=r[e],o=nee(t,n),s=oee(t),p=s.type,f=s.bounds;if(!f)continue;let h,m=0,g=[],y=[],b="circle"===p?2*f.r*.9:f.height;for(m+=l.padding,h=0;h<c.length;h++){let t=c[h],n="function"==typeof t.label?t.label(o,e):"";u.fontFamily=t.fontFamily,u.fontSize="".concat(t.fontSize,"px"),u.text=n;let r=i.measureText(u);if(m+=r.height+t.padding,m>b)break;y.push(n),g.push(r)}const v=h,x=Math.max(0,b-m);let w;for(w="circle"===p?f.cy-.9*f.r:f.y,w+=l.justify*x+l.padding,h=0;h<v;h++){let t,n=c[h];if("circle"===p){let e=Math.max(Math.abs(w-f.cy),Math.abs(w+g[h].height-f.cy)),n=Math.sqrt(f.r*f.r-e*e);t={x:f.cx-n+l.padding,y:w,width:2*n-2*l.padding,height:g[h].height}}else t={x:f.x+l.padding,y:w,width:f.width-2*l.padding,height:g[h].height};w+=g[h].height+l.padding;let r="function"==typeof n.fill?n.fill(o,e):n.fill;const s="function"==typeof n.linkData?n.linkData(o,e):void 0;let u=a(t,y[h],{fill:r,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:g[h]});if(u){if(u.text&&u.text!==I9){const e=V9(u,i.measureText);if(I9===e)continue;u.ellipsed=e}void 0!==s&&(u.data=s),d.push(u)}}}return d}};const see={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach(e=>{e.strategy&&aee[e.strategy.type]&&e.component&&t.push(...function(e,t){let n=e.chart,r=e.source,i=e.rect,o=e.renderer,a=e.style;if(!n.component(r.component))return[];const s=n.findShapes(r.selector).filter(e=>e.key===r.component);return t({chart:n,settings:r.strategy.settings,nodes:s,rect:{x:0,y:0,width:i.width,height:i.height},renderer:o,style:a})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:e,style:this.style},aee[e.strategy.type]))}),t}};const lee={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,label:{fontSize:"12px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:136,lineHeight:1.2},shape:{type:"square",size:12}},title:{show:!0,text:void 0,anchor:"start",fontSize:"16px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:156,lineHeight:1.25}};function cee(e){let t=e.x,n=void 0===t?0:t,r=e.y,i=e.item,o=e.globalMetrics,a=e.createSymbol,s=e.direction,l=void 0===s?"ltr":s,c=i.label.displayObject,u=i.label.bounds,d=i.symbol.meta;const p="rtl"===l;let f={x:p?n+o.maxLabelBounds.width:n+o.maxSymbolSize+o.spacing,y:r,width:o.maxLabelBounds.width,height:Math.max(o.maxSymbolSize,o.maxLabelBounds.height)},h=function(e,t,n){const r=Math.max(0,e.width-t),i=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*r,y:e.y+t/2+n.justify*i}}({x:p?n+o.maxLabelBounds.width+o.spacing:n,y:r,width:o.maxSymbolSize,height:f.height},d.size,{align:void 0===d.align?.5:d.align,justify:void 0===d.justify?.5:d.justify});const m=a(zQ({},d,h));return delete m.collider,c.anchor=p?"end":"start",function(e,t,n){const r=n.textMetrics;if(e.height<r.height)return!1;const i=Math.max(0,e.width-r.width);t.baseline="text-before-edge";const o=Math.max(0,e.height-r.height);t.x=e.x+n.align*i,t.y=e.y+n.justify*o+.175*parseInt(t.fontSize,10)}(f,c,{textMetrics:u,fontSize:parseInt(c.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:i.label.displayObject.data,children:[m,c],collider:{type:"rect",x:n,y:r,width:o.maxItemBounds.width,height:o.maxItemBounds.height}},metrics:f}}function uee(e,t){const n=e.items.length,r=Math.ceil(n/t),i="horizontal"===e.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*r+(r-1)*e.layout.margin[o]}function dee(e,t){let n,r,i,o,a=t.onScroll,s=void 0===a?()=>{}:a,l=null,c=0;const u={itemize:t=>{n=function(e,t){let n,r,i=e.resolved,o=e.dock,a=[],s=i.items.items,l=i.symbols.items,c=i.labels.items,u=0,d=0,p=0;for(let e=0;e<s.length;e++){if(!1===s[e].show)continue;const i=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=zQ({},c[e],{type:"text",fontSize:"".concat(parseInt(c[e].fontSize,10),"px"),text:i,title:i}),r={symbol:{meta:l[e]},label:{displayObject:n,bounds:t.textBounds(n)}},a.push(r),u=Math.max(l[e].size,u),d=Math.max(r.label.bounds.width,d),p=Math.max(r.label.bounds.height,p)}return{items:a,globalMetrics:{spacing:8,maxSymbolSize:u,maxItemBounds:{height:Math.max(u,p),width:u+8+d},maxLabelBounds:{width:d,height:p}},layout:{margin:{vertical:void 0!==i.layout.item.vertical?i.layout.item.vertical:4,horizontal:void 0!==i.layout.item.horizontal?i.layout.item.horizontal:4},mode:i.layout.item.mode,size:i.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:i.layout.item.direction,scrollOffset:i.layout.item.scrollOffset}}}(t,e.renderer),l=isNaN(n.layout.scrollOffset)?l:n.layout.scrollOffset},getItemsToRender:t=>{i=t.viewRect,c=u.getContentOverflow(i);const a=u.extent();l=Math.max(0,Math.min(l,c)),o=zQ({},i);const s="horizontal"===u.orientation()?"x":"y";return o[s]-=l,o["x"===s?"width":"height"]=a,function(e,t,n){let r=e.viewRect,i=n.itemized,o=n.create,a=void 0===o?cee:o,s=n.parallels,l=n.createSymbol;const c=i.layout.direction,u=i.globalMetrics,d=i.items,p="horizontal"===i.layout.orientation;let f=0;const h=[],m=u.maxItemBounds.height,g=u.maxItemBounds.width,y=i.layout.margin.vertical+m,b=i.layout.margin.horizontal+g;let v=t.x,x=t.y,w=r.x-t.x;for(let e=0;e<d.length;e++){let n=a({y:x,x:"rtl"===c?r.x+w+r.width-g-(v-t.x):v,item:d[e],globalMetrics:u,direction:c,createSymbol:l});if((p&&v>=r.x-g||!p&&x>=r.y-m)&&h.push(n.item),f++,f>=s?(f=0,p?(v+=b,x=t.y):(x+=y,v=t.x)):p?x+=y:v+=b,!p&&x>r.y+r.height)break;if(p&&v>r.x+r.width)break}return h}(t,o,{itemized:n,parallels:r,createSymbol:e.symbol})},parallelize:(e,t)=>(r=function(e,t,n){const r=n.items.length,i="horizontal"===n.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical",a=n.globalMetrics.maxItemBounds[i]*r+(r-1)*n.layout.margin[o];let s=Math.ceil(a/e);if(null!=t){const e="horizontal"===n.layout.orientation?"height":"width",r="width"===e?"horizontal":"vertical",i=n.layout.margin[r]||4,o=Math.floor((t+i)/(i+n.globalMetrics.maxItemBounds[e]));s=Math.min(s,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(s,l))}(e,t,n),r),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return uee(n,r)>i[e]},getContentOverflow:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;const t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,uee(n,r)-e[t])},getNextSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},hasNext:()=>"horizontal"===u.orientation()?i.x+i.width<o.x+o.width:i.y+i.height<o.y+o.height,hasPrev:()=>"horizontal"===u.orientation()?o.x<i.x:o.y<i.y,next:()=>{u.scroll(-u.getNextSize())},prev:()=>{u.scroll(u.getPrevSize())},scroll:e=>{const t=Math.max(0,Math.min(c,l-e));t!==l&&(l=t,s())},offset:()=>l,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>uee(n,r),spread:()=>function(e,t){const n=t,r="horizontal"===e.layout.orientation?"height":"width",i="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*n+(n-1)*e.layout.margin[i]}(n,r)};return u}function pee(e){return Object.keys(e).filter(t=>e[t]).join(" ")}const fee={up:"▲",right:"▶",down:"▼",left:"◀"};function hee(e,t){let n=t.size,r=t.isActive,i=t.direction,o=t.nav,a={},s="";const l=t.attrs;o&&o.button&&("function"==typeof o.button.class?a=o.button.class({direction:i}):o.button.class&&(a=o.button.class),"function"==typeof o.button.content&&(s=o.button.content(e,{direction:i})),void 0!==o.button.tabIndex&&(l.tabindex=o.button.tabIndex));const c={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(a).length||(c.border="0",c.background="none"),(!r||o&&o.disabled)&&(l.disabled="disabled"),e("button",zQ({class:pee(a),style:c},l),[s||e("span",{style:{pointerEvents:"none"}},[fee[i]])])}function mee(e){let t;const n={itemize:e=>{t=function(e){let t=e.dock;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:e.navigation}}(e)},render:r=>function(e,t,n,r){let i=t.rect,o=t.itemRenderer;if(!e||!e.renderArgs)return;e.size(i);const a=e.renderArgs[0],s="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void e.render([]);const d=s?["right","left"]:["down","up"];l&&s&&d.reverse();const p=[a("div",{style:{position:"relative",display:"flex","flex-direction":s?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!s?"rtl":"ltr"},[hee(a,{size:32,isActive:c,direction:d[0],attrs:{"data-action":"next","data-component-key":r.settings.key},nav:n.navigation}),hee(a,{size:32,isActive:u,direction:d[1],attrs:{"data-action":"prev","data-component-key":r.settings.key},nav:n.navigation})])];e.render(p)}(n.renderer,r,t,e),extent:()=>32,spread:()=>64};return n}function gee(e){let t;const n={itemize:n=>{t=function(e,t){let n=e.resolved;if(!1===n.title.item.show)return null;const r=zQ({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(r.anchor&&"start"!==r.anchor?"end"===r.anchor&&(r.anchor="start"):r.anchor="end"),void 0===n.title.settings.text){const e=t.scale.data().fields;r.text=e&&e[0]?e[0].title():""}return{displayObject:r,bounds:t.renderer.textBounds(r)}}(n,e)},render:e=>{!function(e,t,n){let r=e.rect;if(!t)return;const i=[];if(t.size(r),n){const e={start:0,end:r.width,middle:r.width/2};i.push(zQ({},n.displayObject,{x:e[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(i)}(e,n.renderer,t)},spread:()=>t?t.bounds.height:0,extent:()=>t?t.bounds.width:0};return n}function yee(e,t,n,r){let i,o,a,s=r.itemRenderer,l=r.navigationRenderer,c=r.titleRenderer,u=r.isPreliminary,d=void 0!==u&&u,p=0;const f={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(i={x:f.x,y:f.y,width:f.width,height:c.spread()},"horizontal"===n){i={x:f.x,y:f.y,width:c.extent(),height:c.spread()};const e=f.width-i.width-(i.width?t.spacing:0),n=f.height;s.parallelize(e,d?void 0:n);const r=s.extent()>e?l.extent():0,u=s.spread(),h=r?l.spread():0;o={x:i.x+i.width+(i.width?t.spacing:0),y:f.y+Math.max(0,(h-u)/2),width:f.width-r-i.width-(r?t.spacing:0)-(i.width?t.spacing:0),height:n},a={x:o.x+o.width+(r?t.spacing:0),y:f.y,width:r,height:f.height},i.y=o.y;"rtl"===s.direction()&&(a.x=f.x,o.x=a.x+a.width+(a.width?t.spacing:0),i.x=o.x+o.width+(i.width?t.spacing:0)),p=Math.max(i.height,h,s.spread())}else{const e=f.height-i.height-(i.height?t.spacing:0),n=f.width;s.parallelize(e,d?void 0:n);const r=s.extent()>e?l.extent():0;a={x:f.x,y:f.y+f.height-r,width:f.width,height:r},o={x:f.x,y:i.y+i.height+(i.height?t.spacing:0),width:f.width,height:f.height-i.height-(i.height?t.spacing:0)-a.height-(a.height?t.spacing:0)},p=Math.max(c.extent(),r?l.spread():0,s.spread())}return o=zQ({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),a.x+=e.x,a.y+=e.y,i.x+=e.x,i.y+=e.y,{title:zQ({},e,i),content:zQ({},e,o),navigation:zQ({},e,a),orientation:n,preferredSize:p}}function bee(e){e.state.resolved=function(e){const t=e.scale.domain();let n={items:[]};const r=e.settings.layout.dock;if("threshold-color"===e.scale.type){const i=e.scale.data().fields[0];let o=e=>String(e);e.settings.formatter?o=e.chart.formatter(e.settings.formatter):i&&(o=i.formatter());for(let e=0;e<t.length-1;e++){const r={value:t[e],label:"".concat(o(t[e])," - < ").concat(o(t[e+1]))};i&&(r.source={field:i.id()}),n.items.push(r)}"vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")&&n.items.reverse()}else{const r=e.scale.labels?e.scale.labels():null;n.items=t.map((t,n)=>{const i=e.scale.datum?zQ({},e.scale.datum(t)):{value:t};return i.value=t,e.scale.label?i.label=e.scale.label(t):r&&(i.label=r[n]),i})}const i=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:zQ(!0,{},lee.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:lee.layout,settings:e.settings.settings.layout}),a=e.resolver.resolve({data:n,defaults:zQ(!0,{},lee.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),s=zQ(!0,{},(e.settings.settings.item||{}).shape);void 0===s.fill&&e.settings.scale&&(s.fill={scale:e.settings.scale});const l=e.resolver.resolve({data:n,defaults:zQ(!0,{},lee.item.shape,e.style.item.shape),settings:s}),c=e.resolver.resolve({data:n,defaults:zQ(!0,{},{show:lee.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function u(e,n){let r=e.data.value,i=t[n+1];e.data.value=[r,i]}"threshold-color"===e.scale.type&&("vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")?(c.items.reverse().forEach(u),c.items.reverse()):c.items.forEach(u));return{title:i,labels:a,symbols:l,items:c,layout:o}}(e),e.titleRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.itemRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.navigationRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center",navigation:e.settings.settings.navigation}),e.state.display={spacing:8}}function vee(e){const t=e.rect,n=e.settings,r=e.state,i=e.itemRenderer,o=e.navigationRenderer,a=e.titleRenderer,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",c=yee(t,r.display,l,{itemRenderer:i,navigationRenderer:o,titleRenderer:a});e.renderer.size(c.content);let u=i.getItemsToRender({viewRect:zQ({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:i}),a.render({rect:c.title}),e.state.views={layout:c},u}const xee={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(e){e&&e.parentNode&&(this.navigationRenderer.renderer.appendTo(e.parentNode),this.titleRenderer.renderer.appendTo(e.parentNode),e.parentNode.insertBefore(this.navigationRenderer.renderer.element(),e),e.parentNode.insertBefore(this.titleRenderer.renderer.element(),e)),this.navigationRenderer.render({rect:this.state.views.layout.navigation,itemRenderer:this.itemRenderer}),this.titleRenderer.render({rect:this.state.views.layout.title})},beforeUnmount(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart(){if(this.state.interaction.started)return;this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove(e){if(!this.state.interaction.started)return;const t="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*e.deltaX:e.deltaY;this.itemRenderer.scroll(t-this.state.interaction.delta),this.state.interaction.delta=t},panend(){this.state.interaction.started=!1},scroll(e){this.itemRenderer.scroll(-e)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const e=vee(this);this.update(e)},this.itemRenderer=dee(this,{onScroll:this.onScroll}),this.navigationRenderer=mee(this),this.titleRenderer=gee(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),bee(this)},preferredSize(e){return function(e,t){let n=0;const r=e.settings.layout.dock||"center",i="top"===r||"bottom"===r?"horizontal":"vertical",o=e.state.display,a=yee(t.inner,o,i,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=a.preferredSize,n+=o.spacing,n}(this,e)},beforeUpdate(){bee(this)},render(){return vee(this)},beforeDestroy(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo(){return{offset:this.itemRenderer.offset()}}};function wee(e,t){let n=0;const r=e.state.isVertical?"justify":"align",i=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",a=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[a](),n*=Math.min(1,Math.max(e.stgns[r],0)),t[i]+=n}function See(e,t,n){const r=n[e];return"object"==typeof r?-1!==r.valid.indexOf(t)?t:r.default:n.default}function kee(e){return See(e.layout.dock,e.settings.title.anchor,{left:{valid:["top"],default:"top"},right:{valid:["top"],default:"top"},top:{valid:["left","right"],default:"left"},bottom:{valid:["left","right"],default:"left"},default:"top"})}function Cee(e,t){const n={x:0,y:0,width:0,height:0},r=e.stgns.padding;return n.x=r.left,n.y=r.top,n.width=t.width-r.left-r.right,n.height=t.height-r.top-r.bottom,n}function Eee(e){const t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,r=e.chart.scale(e.stgns.fill),i=e.chart.scale(e.stgns.major),o=function(e,t){const n=t.domain();let r=n,i=e.stgns.tick.label;!i&&e.formatter?i=e.formatter:!i&&t.data().fields&&(i=t.data().fields[0].formatter()),"function"==typeof i&&(r=n.map(i).map(String));const o=n.map((n,i)=>{const o=r[i];return{value:n,label:o,pos:t.norm(parseFloat(n,10)),textMetrics:e.renderer.measureText({text:o,fontSize:e.stgns.tick.fontSize,fontFamily:e.stgns.tick.fontFamily})}});return o}(e,i),a=See((s=e.settings).layout.dock,s.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"});var s;if(void 0===n.text){const e=i.data().fields;n.text=e&&e[0]?e[0].title():""}const l=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),c=e.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),u={isVertical:t,nodes:[],title:{anchor:kee(e.settings),textMetrics:l,textBounds:c,requiredWidth:()=>{if(!n.show)return 0;let e=c.width,r=n.maxLengthPx;return t||(e+=n.padding,r+=n.padding),Math.min(e,r,u.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let e=c.height;return t&&(e+=n.padding),Math.min(e,u.rect.height)}},ticks:{values:o,anchor:a,length:Math.min(Math.max(...o.map(e=>e.textMetrics.width)),e.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===a?Math.max(...u.ticks.values.map(e=>e.textMetrics.height))+e.stgns.tick.padding:0,height:Math.max(...o.map(e=>e.textMetrics.height))},legend:{fillScale:r,majorScale:i,length:()=>{const n=t?"height":"width",r=t?"requiredHeight":"requiredWidth",i=Math.min(u.rect[n],u.rect[n]*e.stgns.length)-u.title[r]();return Math.max(0,Math.min(i,e.stgns.maxLengthPx))}}};return u}const Mee={require:["chart","settings","renderer"],defaultSettings:{layout:{displayOrder:0,dock:"right"},settings:{size:15,length:.5,maxLengthPx:250,align:.5,justify:0,padding:{left:5,right:5,top:5,bottom:5},tick:{label:null,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,anchor:null,padding:5},title:{show:!0,text:void 0,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,padding:5,maxLines:2,wordBreak:"none",lineHeight:1.2,hyphens:"auto",anchor:null}}},preferredSize(e){const t=this.state;t.rect=Cee(this,e.inner);let n=this.stgns.size;const r=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=r;const i=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){const e=t.ticks.values.reduce((e,t)=>e+t.textMetrics.height,0);if(e>this.state.legend.length())return i;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return i;n+=Math.max(...t.ticks.values.map(e=>e.textMetrics.height))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===t.title.anchor||"right"===t.title.anchor?Math.max(t.title.textBounds.height+r,n):Math.max(n,t.title.requiredWidth()+r)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=Eee(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=Eee(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=Cee(this,e.size),this.stgns.title.show){const e=function(e){const t=e.state,n=e.stgns,r="left"===t.ticks.anchor,i="top"===t.ticks.anchor;let o=t.rect.x,a=t.rect.y,s="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0,s="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=r?t.rect.width:0,a+=t.title.textMetrics.height,s=r?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(a,t.rect.y+t.rect.height),text:n.title.text,fill:n.title.fill,fontSize:n.title.fontSize,fontFamily:n.title.fontFamily,maxWidth:n.title.maxLengthPx,maxLines:n.title.maxLines,wordBreak:n.title.wordBreak,hyphens:n.title.hyphens,lineHeight:n.title.lineHeight,anchor:s,title:n.title.text};return wee(e,l),l}(this);this.state.nodes.push(e)}const t=function(e){const t=e.state.legend.fillScale,n=e.state.legend.majorScale,r=t.domain().map(e=>({type:"stop",color:t(e),offset:Math.min(1,Math.max(0,n.norm(e)))}));return r.sort((e,t)=>e.offset-t.offset)}(this),n=function(e,t){const n=e.state,r=e.stgns,i=n.rect;let o=i.x,a=i.y,s=n.isVertical?r.size:n.legend.length(),l=n.isVertical?n.legend.length():r.size;"left"===n.ticks.anchor?o+=n.rect.width-r.size:"top"===n.ticks.anchor&&(a+=n.rect.height-r.size),"top"===n.title.anchor?a+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());const c={type:"rect",x:o,y:a,width:s,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return wee(e,c),c}(this,t),r=function(e,t){const n=e.state,r=e.stgns;let i="start";const o={type:"rect",x:t.x,y:t.y,width:n.isVertical?0:t.width,height:n.isVertical?t.height:0,fill:"transparent"},a=n.ticks.values.map(a=>{let s=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=t.y+t.height*a.pos,u=0===a.pos?"text-before-edge":"text-after-edge"):s=t.x+t.width*a.pos,"right"===n.ticks.anchor?(s=t.x+r.size+r.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(s=t.x-r.tick.padding,i="end"):"top"===n.ticks.anchor?(l=t.y-r.tick.padding,c-=.25*a.textMetrics.height,i=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+r.tick.padding,c=.8*a.textMetrics.height,i=0===a.pos?"start":"end",o.y=t.y+t.height),{type:"text",x:s,y:l,dx:0,dy:c,text:a.label,fontSize:r.tick.fontSize,fontFamily:r.tick.fontFamily,fill:r.tick.fill,maxWidth:n.isVertical?r.tick.maxLengthPx:Math.min(r.tick.maxLengthPx,n.legend.length()/2),anchor:i,textBoundsFn:e.renderer.textBounds,title:a.label,baseline:u}});return{type:"container",id:"legend-seq-ticks",children:[...a,o]}}(this,n),i={id:"legend-seq-target",type:"container",children:[n,r]};this.state.nodes.push(i)},render(){return this.state.nodes}};const Ree={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},layers:{curve:"linear",show:!0,line:{stroke:"#ccc",strokeWidth:1,strokeLinejoin:"miter",strokeDasharray:void 0,opacity:1,show:!0,showMinor0:!0},area:{fill:"#ccc",opacity:.8,show:!0}}};function _ee(e,t){let n=t.generatorType,r=t.item,i=t.data,o=t.major,a=t.minor,s=t.layerObj,l=t.stngs,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:e,generatorType:n,major:o,minor:a,layerObj:s,stngs:l,opacity:r.opacity,stroke:r.stroke,strokeWidth:r.strokeWidth,strokeLinejoin:r.strokeLinejoin,fill:c||r.fill,data:i};return r.strokeDasharray&&(u.strokeDasharray=r.strokeDasharray),u}function Aee(e){const t=function(e){let t=e.data,n=e.stngs,r=e.rect,i=e.resolver,o=e.style,a=e.domain;const s=r.width,l=r.height,c=i.resolve({data:t,defaults:Ree.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:s,minor:"vertical"===n.orientation?s:l}}),u=!n.connect&&a.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),d={};let p=0;for(let e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(u){const e=d[n]?d[n].items[d[n].items.length-1]:null,r=e?a.indexOf(e.data.major?e.data.major.value:e.data.value):null;e&&a.indexOf(t.data.major?t.data.major.value:t.data.value)-1!==r&&d[n].items.push({dummy:!0})}d[n]=d[n]||{order:p++,id:n,items:[],dataItems:[],consumableData:{}},d[n].dataItems.push(t.data),d[n].items.push(t)}const f=Object.keys(d).map(e=>(d[e].consumableData=VQ({points:d[e].dataItems},d[e].dataItems[0]),d[e])),h={items:f.map(e=>e.consumableData)},m=n.layers||{};return{coordinates:c,metaLayers:f,layers:i.resolve({data:h,defaults:{curve:Ree.layers.curve,show:Ree.layers.show},settings:{curve:m.curve,show:m.show}}),lines:i.resolve({data:h,defaults:zQ({},Ree.layers.line,o.line),settings:m.line}),areas:i.resolve({data:h,defaults:zQ({},Ree.layers.area,o.area),settings:m.area})}}(e),n=t.metaLayers,r=t.coordinates,i=t.layers,o=t.lines,a=t.areas,s=[];return n.forEach((t,n)=>{const l=i.items[n];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=t.id;const c=[],u=[];let d,p;for(let n=0;n<t.items.length;n++){if(d=t.items[n],p=d.data,!d.dummy){if(isNaN(d.major))continue;e.missingMinor0&&(d.minor0=r.settings.minor.scale?r.settings.minor.scale(p.minor0?p.minor0.value:0):0),isNaN(d.minor)||c.push(d.minor),l.data.push(d.data)}u.push(d)}const f=c.sort((e,t)=>e-t)[Math.floor((c.length-1)/2)];s.push({layerObj:l,lineObj:o.items[n],areaObj:a.items[n],median:f,points:u,consumableData:t.consumableData})}),s}const Iee={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(e){let t=e.data;const n=this.rect,r=n.width,i=n.height;this.stngs=this.settings.settings||{};const o=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,a=Aee({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:o,domain:this.stngs.coordinates&&this.stngs.coordinates.major&&this.stngs.coordinates.major.scale?this.chart.scale(this.stngs.coordinates.major.scale).domain():[]});if(this.stngs.layers&&this.stngs.layers.sort){const e=a.map(e=>({id:e.layerObj.id,data:e.layerObj.data})).sort(this.stngs.layers.sort).map(e=>e.id);a.sort((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id))}else a.sort((e,t)=>e.median-t.median);return function(e,t){let n=t.width,r=t.height,i=t.missingMinor0,o=t.stngs;const a=[],s=o.layers||{};return e.forEach(e=>{const t=e.lineObj,l=e.layerObj,c=e.areaObj,u=e.points;let d={size:r,p:"y"},p={size:n,p:"x"};if("vertical"===o.orientation){const e=zQ(!0,{},p);p=zQ(!0,{},d),d=zQ(!0,{},e)}s.area&&!1!==c.show&&a.push(_ee(u,{data:e.consumableData,item:c,generatorType:"area",major:p,minor:d,layerObj:l,stngs:o})),t&&!1!==t.show&&(a.push(_ee(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"1"),major:p,minor:d,layerObj:l,stngs:o},"none")),!i&&s.area&&!1!==c.show&&!1!==t.showMinor0&&a.push(_ee(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"0"),major:p,minor:d,layerObj:l,stngs:o},"none")))}),a}(a,{width:r,height:i,missingMinor0:o,stngs:this.stngs})}};function Pee(e,t){let n,r,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof t.center?(n=t.center.x,r=t.center.y):(n=t.clientX,r=t.clientY);const o=n-e.state.boundingRect.left,a=r-e.state.boundingRect.top;return{x:i?Math.max(0,Math.min(o,e.rect.width)):o,y:i?Math.max(0,Math.min(a,e.rect.height)):a}}function Tee(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function Dee(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-r}}const Oee={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const t=Pee(this,e,!1);u6({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=this.settings.settings.brush.components.map(e=>({key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"})),this.state.start=Pee(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=Pee(this,e),function(e){if(e.state.active){const t=Tee(e,e.state.start),n=Tee(e,e.state.end),r=e.chart.shapesAt(Dee(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(r,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([zQ({type:"rect"},Dee(t.state.start,t.state.end),t.style.area)]))},end(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach(e=>{Array.isArray(e.contexts)&&e.contexts.forEach(e=>{t.brush(e).end()})}),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function Nee(e,t,n){let r=n.renderer,i=n.style,o=n.props,a=n.h;const s=function(e,t){return{tooltip:"function"==typeof e.tooltipClass?e.tooltipClass({dock:t.dock}):e.tooltipClass,content:"function"==typeof e.contentClass?e.contentClass({dock:t.dock}):e.contentClass,arrow:"function"==typeof e.arrowClass?e.arrowClass({dock:t.dock}):e.arrowClass}}(o,t),l=function(e,t,n,r){return r.content({h:e,style:n,data:t})}(a,e,i,o),c=a("div",{dir:o.direction,class:pee(zQ({"pic-tooltip":!0},s.tooltip)),style:zQ({position:"relative",display:"inline-block"},t.computedTooltipStyle)},a("div",{style:i.content,class:pee(zQ({"pic-tooltip-content":!0},s.content))},l),a("div",{class:pee(zQ({"pic-tooltip-arrow":!0},s.arrow)),style:zQ({},i.arrow,i["arrow-".concat(t.dock)],t.computedArrowStyle)}));return r.render(c),r.element().children[0]}function qee(e){let t=e.defaultDuration,n=e.defaultDelay,r=null,i=null,o=!1;const a=function(){const e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return e.set=e=>{n=e,t[n].forEach(t=>t(e))},e.on=(e,n)=>{Array.isArray(e)?e.forEach(e=>t[e].push(n)):t[e].push(n)},e.destroy=()=>{Object.keys(t).forEach(e=>{t[e].length=0})},e}(),s=function(){},l=()=>{r=null,i=null,o=!1,a.set("fulfilled")};return s.invoke=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;r&&(clearTimeout(r),a.set("debounced")),a.set("pending"),r=setTimeout(()=>{e(),o=!0,r=null,a.set("active")},c),s>0&&(i&&clearTimeout(i),i=setTimeout(l,s+Math.max(c,0)))},s.clear=()=>{o?a.set("cancelled"):r&&(clearTimeout(r),a.set("rejected")),i&&clearTimeout(i),r=null,i=null,o=!1},s.on=(e,t)=>{a.on(e,t)},s.destroy=()=>{s.clear(),a.destroy()},s}function Lee(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-e,"px)"),right:"translate(".concat(e,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-e,"px)"),bottom:"translate(-50%, ".concat(e,"px)"),inside:"translate(-50%, -50%)"}}function jee(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-e-n,y:-t/2},right:{x:n,y:-t/2},top:{x:-e/2,y:-t-n},bottom:{x:-e/2,y:n},inside:{x:-e/2,y:-t/2}}}function zee(e,t){const n=e>0?"-":"+";return e=Math.abs(e),void 0===t&&(t=e),{left:{left:"100%",top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},top:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"100%",borderWidth:"".concat(t,"px")},bottom:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(t,"px")},inside:{left:"0px",top:"0px",borderWidth:"0px"}}}function Fee(e,t,n,r,i,o){const a=t+o.x,s=n+o.y,l=i;return!(a<0||s<0)&&!(a+r>e.width||s+l>e.height)}function $ee(e){let t=e.area,n=e.vx,r=e.vy,i=e.width,o=e.height,a=e.offset;const s=n+a.x,l=r+a.y,c=i,u=o;let d=s<0?-s:0,p=l<0?-l:0;return d+=s+c>t.width?-(s+c-t.width):0,p+=l+u>t.height?-(l+u-t.height):0,{x:d,y:p}}function Bee(e){let t=e.options,n=e.pointer,r=e.width,i=e.height,o=e.dockOrder,a=e.x,s=e.y;const l=n.targetBounds,c=Lee(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u},computedArrowStyle:zee(t.offset)[t.dock],dock:t.dock};const d={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},p=jee(r,i,t.offset),f=[],h="target"===t.area?a:l.left+a,m="target"===t.area?s:l.top+s;for(let e=0;e<o.length;e+=1){const n=o[e],l=$ee({area:d,vx:h,vy:m,width:r,height:i,offset:p[n]}),u={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c[n]},g=zee(t.offset)[n];0!==l.x&&(u.width="".concat(r-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(a+l.x,"px"),g.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:g,dock:n,rect:{width:r,height:i}};if(0===l.x&&0===l.y)return y;y.offset=l,f.push(y)}return f.sort((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x)),f[0]}function Hee(e,t,n){const r=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!r)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const i=r.rect;return zQ({scaleRatio:i.scaleRatio},i.computedInner)}const Vee={bounds:function(e){let t=e.resources,n=e.nodes,r=e.pointer,i=e.width,o=e.height,a=e.options;const s=r.targetBounds,l=t.getNodeBoundsRelativeToTarget(n[0]),c=l.x,u=l.y,d=l.width,p=l.height,f={left:{x:c,y:u+p/2},right:{x:c+d,y:u+p/2},top:{x:c+d/2,y:u},bottom:{x:c+d/2,y:u+p},inside:{x:c+d/2,y:u+p/2}},h=Lee(a.offset),m=h[a.dock];if(m)return{computedTooltipStyle:{left:"".concat(f[a.dock].x,"px"),top:"".concat(f[a.dock].y,"px"),transform:m},computedArrowStyle:zee(a.offset)[a.dock],dock:a.dock};const g={width:"target"===a.area?s.width:window.innerWidth,height:"target"===a.area?s.height:window.innerHeight},y=jee(i,o,a.offset),b=["top","left","right","bottom","inside"];for(let e=0;e<b.length;e+=1){const t=b[e];if(Fee(g,"target"===a.area?f[t].x:s.left+f[t].x,"target"===a.area?f[t].y:s.top+f[t].y,i,o,y[t]))return{computedTooltipStyle:{left:"".concat(f[t].x,"px"),top:"".concat(f[t].y,"px"),transform:h[t]},computedArrowStyle:zee(a.offset)[t],dock:t}}const v=function(e){let t=e.options,n=e.docks,r=e.dockOffsets,i=e.targetBounds,o=e.area,a=e.width;const s="top",l="target"===t.area?n[s].x:i.left+n[s].x,c=("target"===t.area?n[s].y:(i.top,n[s].y),r[s]),u=l+c.x,d=(c.y,a);let p=n.top.x;return u<0&&u+d>o.width||(u<0?p-=u:u+d>o.width&&(p-=u+d-o.width)),p}({options:a,docks:f,dockOffsets:y,targetBounds:s,area:g,width:i});return{computedTooltipStyle:{left:"".concat(v,"px"),top:"".concat(f.top.y,"px"),transform:h.top},computedArrowStyle:zee(a.offset+v-f.top.x,a.offset).top,dock:"top"}},pointer:function(e){let t=e.options,n=e.pointer,r=e.width,i=e.height;return Bee({x:n.x,y:n.y,pointer:n,width:r,height:i,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){let t=e.options,n=e.pointer,r=e.width,i=e.height,o=e.nodes,a=e.resources;const s=o[0],l=n.dx,c=n.dy,u=a.getComponentBoundsFromNode(s),d=l+u.x+u.width/2,p=c+u.y+u.height/2,f=s.desc.slice,h=f.start,m=f.end,g=f.outerRadius,y=(h+m)/2-Math.PI/2,b=2*Math.PI,v=(y%b+b)%b;let x=["top","left","right","bottom"];return"auto"===t.dock&&(x=v<=Math.PI/4||v>=7*Math.PI/4?["right","top","bottom","left"]:v<=3*Math.PI/4?["bottom","left","right","top"]:v<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),Bee({x:d+g*u.scaleRatio.x*Math.cos(v),y:p+g*u.scaleRatio.y*Math.sin(v),pointer:n,width:r,height:i,options:t,dockOrder:x})}};function Wee(e,t){let n=e.width,r=e.height,i=t.chart,o=t.state,a=t.props;const s={resources:{formatter:i.formatter,scale:i.scale,component:i.component,getComponentBoundsFromNode:e=>Hee(e,o.pointer,i),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const r=Hee(e,t,n),i=e.bounds;return{x:r.x+t.dx+i.x,y:r.y+t.dy+i.y,width:i.width,height:i.height}}(e,o.pointer,i)},nodes:o.activeNodes,pointer:o.pointer,width:n,height:r},l=typeof a.placement;if("object"===l&&"function"==typeof a.placement.fn)return a.placement.fn(s);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=zQ(c,a.placement(s))),"object"===l&&Vee[a.placement.type]?c=zQ(c,a.placement):"string"===l&&Vee[a.placement]&&(c=zQ(c,{type:a.placement})),s.options=c;const u=Vee[c.type](s);let d=s.resources.getComponentBoundsFromNode(s.nodes[0]),p=d.x,f=d.y,h=d.width,m=d.height;return p+=s.pointer.dx,h+=p,f+=s.pointer.dy,m+=f,u.computedTooltipStyle.left="".concat(Math.min(Math.max(0,p,parseFloat(u.computedTooltipStyle.left)),h),"px"),u.computedTooltipStyle.top="".concat(Math.min(Math.max(0,f,parseFloat(u.computedTooltipStyle.top)),m),"px"),u}let Uee;function Gee(){Uee=null}const Yee={duration:8e3,delay:500,filter:e=>e.filter(e=>e.data&&void 0!==e.data.value),extract:e=>e.node.data.value,content:e=>{let t=e.h;return e.data.map(e=>t("div",{},e))},isEqual:(e,t)=>e.length&&e.length===t.length&&e.every((e,n)=>t[n]&&JSON.stringify(e.data)===JSON.stringify(t[n].data)),placement:{type:"pointer",dock:"auto",offset:8,area:"viewport"},tooltipClass:{},contentClass:{},arrowClass:{},direction:"ltr",appendTo:void 0,beforeShow:void 0,afterShow:void 0,beforeHide:void 0,onHide:void 0,afterHide:void 0};const Kee={require:["chart","renderer"],defaultSettings:{settings:Yee,style:{tooltip:{},content:{backgroundColor:"$gray-25",color:"$font-color--inverted",fontFamily:"$font-family",fontSize:"$font-size",lineHeight:"$line-height",borderRadius:"4px",padding:"8px",opacity:.9},arrow:{position:"absolute",width:"0px",height:"0px",borderStyle:"solid",color:"$gray-25",opacity:.9},"arrow-bottom":{borderTopColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-top":{borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-right":{borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent"},"arrow-left":{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent"}}},renderer:"dom",on:{hide(){this.hide()},show(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent(e){this.prevent(e)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.nodes,i=n.duration,o=n.delay;!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(e,t){let n=t.chart,r=t.state,i=0,o=0;e.center?(i+=e.center.x,o+=e.center.y):(i+=e.clientX,o+=e.clientY);const a=n.element.getBoundingClientRect(),s=r.targetElement.getBoundingClientRect(),l=i,c=o,u=a.left-s.left,d=a.top-s.top,p=i-a.left,f=o-a.top;return i-=s.left,o-=s.top,{x:i,y:o,dx:u,dy:d,cx:p,cy:f,clientX:l,clientY:c,targetBounds:s,chartBounds:a}}(e,this),t=Array.isArray(r)?this.props.filter(r):this.props.filter(this.chart.shapesAt({x:this.state.pointer.cx,y:this.state.pointer.cy})),this.props.isEqual(this.state.activeNodes,t)||(this.dispatcher.clear(),this.state.activeNodes=t,this.state.activeNodes.length&&this.dispatcher.invoke(()=>this.invokeRenderer(this.state.activeNodes),i,o)))},prevent(e){this.state.prevent=!!e},init(e){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=qee({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",()=>{!function(e){Uee&&Uee!==e&&Uee()}(t),Uee=t,"function"==typeof this.props.beforeShow&&this.props.beforeShow.call(void 0,{resources:{formatter:this.chart.formatter,scale:this.chart.scale}})}),this.dispatcher.on(["cancelled","fulfilled"],()=>{const e={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,zQ({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,zQ({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),Uee===t&&(Uee=null),this.state.tooltipElm=void 0}),this.dispatcher.on("active",()=>{"function"==typeof this.props.afterShow&&this.props.afterShow.call(void 0,{element:this.state.tooltipElm,resources:{formatter:this.chart.formatter,scale:this.chart.scale}})})},created(){this.init(this.settings)},beforeUpdate(e){let t=e.settings;this.dispatcher&&(this.dispatcher.destroy(),Gee()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),Gee()},appendTo(){if(this.props.appendTo){this.state.targetElement="function"==typeof this.props.appendTo?this.props.appendTo({resources:{formatter:this.chart.formatter,scale:this.chart.scale}}):this.props.appendTo;const e=this.state.targetElement.getBoundingClientRect(),t=e.width,n=e.height;this.renderer.destroy(),this.renderer.size({width:t,height:n}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(e){const t=function(e,t){let n=t.chart,r=t.scale,i=t.props,o=t.h;const a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:r,h:o},s=[];return e.forEach(e=>{if("function"==typeof i.extract){const t=zQ({node:e},a);s.push(i.extract(t))}}),s}(e,this),n=Wee(Nee(t,{},this).getBoundingClientRect(),this);this.state.tooltipElm=Nee(t,n,this)}};const Xee={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes(this.props.selector).filter(e=>e.key===this.props.target),t=e.filter(e=>e.collider).map(e=>e.collider);t.forEach(e=>{e.fill=this.props.fill,e.stroke=this.props.stroke,e.opacity=this.props.opacity,e.collider={type:null}}),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let t=e.outer,n=e.inner;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}},Jee={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},Qee=/([astvzqmhlc])([^astvzqmhlc]*)/gi,Zee=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function ete(e){const t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(Qee,(e,n,r)=>{const i=function(e){const t=e.match(Zee);return t?t.map(Number):[]}(r);let o=n.toLowerCase(),a=n;if("m"===o&&i.length>2&&(t.push([a,...i.splice(0,2)]),o="l",a="m"===a?"l":"L"),i.length<Jee[o])return"";for(t.push([a,...i.splice(0,Jee[o])]);i.length>=Jee[o]&&i.length&&Jee[o];)t.push([a,...i.splice(0,Jee[o])]);return""}),t}const tte=2*Math.PI;function nte(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function rte(e,t,n,r,i){const o=1-e;return o**3*t+3*o**2*e*n+3*o*e**2*r+e**3*i}function ite(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||function(e,t,n,r){return Math.abs(e.x+n.x-(t.x+t.x))+Math.abs(e.y+n.y-(t.y+t.y))+Math.abs(t.x+r.x-(n.x+n.x))+Math.abs(t.y+r.y-(n.y+n.y))}(e,t,n,r)<=10)return i[i.length-1]!==e&&i.push(e),i.push(r),i;const a=nte(e,t),s=nte(t,n),l=nte(n,r),c={x:rte(.5,e.x,t.x,n.x,r.x),y:rte(.5,e.y,t.y,n.y,r.y)},u=nte(a,s),d=nte(s,l);return ite(e,a,u,c,i,o-1),ite(c,d,l,r,i,o-1),i}function ote(e,t,n){const r=function(e,t,n){return{cp1:{x:e.x+2/3*(t.x-e.x),y:e.y+2/3*(t.y-e.y)},cp2:{x:n.x+2/3*(t.x-n.x),y:n.y+2/3*(t.y-n.y)}}}(e,t,n);return ite(e,r.cp1,r.cp2,n)}function ate(e,t,n){const r=[],i=!!e[4],o=!!e[5],a=e[3];let s,l,c,u,d=e[6],p=e[7],f=e[1],h=e[2];if("a"===e[0]&&(d+=t,p+=n),t===p&&n===p)return r;if(!f||!h)return r.push({x:d,y:p}),r;var m=function(e,t,n,r,i,o,a,s,l){let c,u,d,p,f,h;const m=C4(n%360),g=Math.cos(m),y=Math.sin(m),b=(s-o)/2,v=(l-a)/2,x=g*b+y*v,w=g*v-y*b;h=x**2/(e=Math.abs(e))**2+w**2/(t=Math.abs(t))**2,h>1&&(h=Math.sqrt(h),e*=h,t*=h);const S=e*w,k=t*x,C=S**2+k**2,E=(e*t)**2-C;let M=Math.sqrt(Math.max(E/C,0));r===i&&(M=-M);const R=M*(S/t),_=M*(-k/e);p=g*R-y*_+(s+o)/2,f=y*R+g*_+(l+a)/2;const A=(x-R)/e,I=(w-_)/t,P=(-x-R)/e,T=(-w-_)/t;return c=Math.atan2(I,A),c+=c<0?tte:0,u=Math.atan2(T,P),u+=u<0?tte:0,d=u-c,!i&&c<u?d-=tte:i&&u<c&&(d+=tte),d%=tte,{startAngle:c,sweepAngle:d,cx:p,cy:f,rx:e,ry:t}}(f,h,a,i,o,d,p,t,n);s=m.cx,l=m.cy,f=m.rx,h=m.ry,c=m.sweepAngle,u=m.startAngle;const g=Math.abs(c*Math.sqrt((f**2+h**2)/2)),y=Math.ceil(g/10),b=c/y;for(let e=1;e<=y;e++){const t=(u+b*e)%tte,n=Math.cos(t),i=Math.sin(t);r.push({x:s+n*f+-i*n,y:l+i*h+n*i})}return r}function ste(e){const t=ete(e),n=[],r=[];let i=0,o=0,a=null,s=null,l=null,c=null;for(let e=0;e<t.length;++e){const u=t[e],d=u[0];switch("S"!==d&&"s"!==d&&"C"!==d&&"c"!==d&&(a=null,s=null),"T"!==d&&"t"!==d&&"Q"!==d&&"q"!==d&&(l=null,c=null),d){case"m":r.length&&n.push(r.splice(0));case"l":i+=u[1],o+=u[2],r.push({x:i,y:o});break;case"M":r.length&&n.push(r.splice(0));case"L":i=u[1],o=u[2],r.push({x:i,y:o});break;case"H":i=u[1],r.push({x:i,y:o});break;case"h":i+=u[1],r.push({x:i,y:o});break;case"V":o=u[1],r.push({x:i,y:o});break;case"v":o+=u[1],r.push({x:i,y:o});break;case"a":r.push(...ate(u,i,o)),i+=u[6],o+=u[7];break;case"A":r.push(...ate(u,i,o)),i=u[6],o=u[7];break;case"c":r.push(...ite({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o},{x:u[5]+i,y:u[6]+o})),a=u[3]+i,s=u[4]+o,i+=u[5],o+=u[6];break;case"C":r.push(...ite({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),a=u[3],s=u[4],i=u[5],o=u[6];break;case"s":null!==a&&null!==a||(a=i,s=o),r.push(...ite({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),a=u[1]+i,s=u[2]+o,i+=u[3],o+=u[4];break;case"S":null!==a&&null!==a||(a=i,s=o),r.push(...ite({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),a=u[1],s=u[2],i=u[3],o=u[4];break;case"Q":r.push(...ote({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],i=u[3],o=u[4];break;case"q":r.push(...ote({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),l=u[1]+i,c=u[2]+o,i+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...ote({x:i,y:o},{x:l,y:c},{x:u[1],y:u[2]})),i=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...ote({x:i,y:o},{x:l,y:c},{x:u[1]+i,y:u[2]+o})),i+=u[1],o+=u[2];break;case"z":case"Z":r.length&&r.push({x:r[0].x,y:r[0].y})}}return function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];Math.abs(n.x-r.x)<1e-12&&Math.abs(n.y-r.y)<1e-12&&(e.splice(t,1),t--)}}(r),n.push(r.splice(0)),n}const lte={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes("path").filter(e=>e.key===this.props.target),t=[];e.forEach(e=>{ste(e.attrs.d).forEach(e=>{e.forEach(e=>{t.push({type:"circle",cx:e.x,cy:e.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})})})}),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let t=e.outer,n=e.inner;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var cte=[function(e){e.component("box",u8),e.component("box-marker",u8)},function(e){e.component("point",b8),e.component("point-marker",b8)},function(e){e.component("pie",S8)},function(e){e.component("grid-line",R8)},function(e){e.component("ref-line",j8)},function(e){e.component("axis",f7)},function(e){e.component("container",h7)},function(e){e.component("text",y7)},function(e){e.component("scrollbar",x7)},function(e){e.component("brush-range",N7),e.component("brush-area-dir",z7)},function(e){e.component("range",H7)},function(e){e.component("brush-lasso",K7)},function(e){e.component("labels",see)},function(e){e.component("legend-cat",xee)},function(e){e.component("legend-seq",Mee)},function(e){e.component("line",Iee)},function(e){e.component("brush-area",Oee)},function(e){e.component("tooltip",Kee)},function(e){e.component("debug-collider",Xee)},function(e){e.component("debug-path-to-points",lte)}];let ute=class{constructor(e){this._parent=null,this._children=[],this._ancestors=null,this.type=e,this.data=null}detach(){return this._parent&&this._parent.removeChild(this),this}get parent(){return this._parent}get isBranch(){return this._children&&this._children.length}get children(){return this._children}get ancestors(){return this._ancestors||(this._ancestors=[],this.parent&&this._ancestors.push(this.parent,...this.parent.ancestors)),this._ancestors}get descendants(){let e=[];const t=this.children.length;let n,r;for(n=0;n<t;n++)r=this.children[n],e.push(r),r.children.length&&(e=[...e,...r.descendants]);return e}equals(e){const t=this.children,n=e.children;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(!t[e].equals(n[e]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map(e=>e.toJSON())}}};class dte{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,c=e.minWidth,u=void 0===c?0:c,d=e.minHeight,p=void 0===d?0:d;this.set({x:n,y:i,width:a,height:l,minWidth:u,minHeight:p})}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,c=e.minWidth,u=void 0===c?0:c,d=e.minHeight,p=void 0===d?0:d;this.type="rect",a>=0?(this.x=n,this.width=Math.max(a,u)):(this.x=n+Math.min(a,-u),this.width=-Math.min(a,-u)),l>=0?(this.y=i,this.height=Math.max(l,p)):(this.y=i+Math.min(l,-p),this.height=-Math.min(l,-p))}containsPoint(e){return u6(this,e)}intersectsLine(e){return d6(this,ZQ(e))}intersectsRect(e){return l6(this,QQ(e))}intersectsCircle(e){return n6(e,this)}intersectsPolygon(e){return s6(e,this)}intersectsGeoPolygon(e){return v6(e,this)}points(){return[{x:this.x,y:this.y},{x:this.x+this.width,y:this.y},{x:this.x+this.width,y:this.y+this.height},{x:this.x,y:this.y+this.height}]}}class pte{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cx,n=void 0===t?0:t,r=e.cy,i=void 0===r?0:r,o=e.r,a=void 0===o?0:o,s=e.minRadius,l=void 0===s?0:s;this.set({cx:n,cy:i,r:a,minRadius:l})}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cx,n=void 0===t?0:t,r=e.cy,i=void 0===r?0:r,o=e.r,a=void 0===o?0:o,s=e.minRadius,l=void 0===s?0:s;this.type="circle",this.cx=n,this.cy=i,this.r=Math.max(a,l),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return t6(this,e)}intersectsLine(e){return r6(this,ZQ(e))}intersectsRect(e){return n6(this,QQ(e))}intersectsCircle(e){return n=e,!J4(t=this)&&!J4(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return i6(this,e)}intersectsGeoPolygon(e){return g6(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class fte{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x1,n=void 0===t?0:t,r=e.y1,i=void 0===r?0:r,o=e.x2,a=void 0===o?0:o,s=e.y2,l=void 0===s?0:s,c=e.tolerance,u=void 0===c?0:c;this.set({x1:n,y1:i,x2:a,y2:l,tolerance:u})}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x1,n=void 0===t?0:t,r=e.y1,i=void 0===r?0:r,o=e.x2,a=void 0===o?0:o,s=e.y2,l=void 0===s?0:s,c=e.tolerance,u=void 0===c?0:c;this.type="line",this.x1=n,this.y1=i,this.x2=a,this.y2=l,this.tolerance=Math.max(0,Math.round(u)),this.vectors=this.points(),this.zeroSize=n===a&&i===l}containsPoint(e){if(this.tolerance>0){return r6({cx:e.x,cy:e.y,r:this.tolerance},this)}return f6(this,e)}intersectsLine(e){return p6(this,ZQ(e))}intersectsRect(e){return d6(QQ(e),this)}intersectsCircle(e){return r6(e,this)}intersectsPolygon(e){return a6(e,this)}intersectsGeoPolygon(e){return b6(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class hte{constructor(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[]:e;this.set({vertices:t})}set(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[]:e;if(this.type="polygon",this.vertices=t.slice(),this.edges=[],function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}(this.vertices),!(this.vertices.length<=2)){!function(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.vertices.length;e++)e<this.vertices.length-1&&this.edges.push([this.vertices[e],this.vertices[e+1]]),this.xMin=isNaN(this.xMin)?this.vertices[e].x:Math.min(this.xMin,this.vertices[e].x),this.xMax=isNaN(this.xMax)?this.vertices[e].x:Math.max(this.xMax,this.vertices[e].x),this.yMin=isNaN(this.yMin)?this.vertices[e].y:Math.min(this.yMin,this.vertices[e].y),this.yMax=isNaN(this.yMax)?this.vertices[e].y:Math.max(this.yMax,this.vertices[e].y);this._bounds=null,this._boundingRect=null}}containsPoint(e){return o6(this,e)}intersectsCircle(e){return i6(e,this)}intersectsLine(e){return a6(this,ZQ(e))}intersectsRect(e){return s6(this,QQ(e))}intersectsPolygon(e){return h6(this,e)}intersectsGeoPolygon(e){return m6(e,this)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function mte(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new hte(...t)}function gte(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function yte(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}class bte{constructor(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[[]]:e;this.set({vertices:t})}set(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[]:e;this.type="geopolygon",this.vertices=t.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.numPolygons;e++)yte(this.vertices[e]),this.vertices[e].length>2&>e(this.vertices[e]),this.polygons[e]=mte({vertices:this.vertices[e]}),this.xMin=isNaN(this.xMin)?this.polygons[e].xMin:Math.min(this.xMin,this.polygons[e].xMin),this.xMax=isNaN(this.xMax)?this.polygons[e].xMax:Math.max(this.xMax,this.polygons[e].xMax),this.yMin=isNaN(this.yMin)?this.polygons[e].yMin:Math.min(this.yMin,this.polygons[e].yMin),this.yMax=isNaN(this.yMax)?this.polygons[e].yMax:Math.max(this.yMax,this.polygons[e].yMax);this._bounds=null,this._boundingRect=null}containsPoint(e){return y6(this,e)}intersectsCircle(e){return g6(e,this)}intersectsLine(e){return b6(this,ZQ(e))}intersectsRect(e){return v6(this,QQ(e))}intersectsPolygon(e){return m6(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!l6(n,r)&&(c6(r,n)?e6(t,e):e6(e,t))}(this,e)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function vte(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new bte(...t)}function xte(e,t){return e.x!==t.x||e.y!==t.y}class wte{constructor(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).points,t=void 0===e?[]:e;this.set({points:t})}set(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).points,t=void 0===e?[]:e;if(this.type="polyline",this.segments=[],this._points=t.slice(),this._points.length>1)for(let e=0,t=this._points.length-1;e<t;e++)xte(this._points[e],this._points[e+1])&&this.segments.push({x1:this._points[e].x,y1:this._points[e].y,x2:this._points[e+1].x,y2:this._points[e+1].y})}containsPoint(e){return this.segments.some(t=>f6(t,e))}intersectsCircle(e){return this.segments.some(t=>r6(e,t))}intersectsLine(e){const t=ZQ(e);return this.segments.some(e=>p6(e,t))}intersectsRect(e){const t=QQ(e);return this.segments.some(e=>d6(t,e))}intersectsPolygon(e){return this.segments.some(t=>a6(e,t))}intersectsGeoPolygon(e){return this.segments.some(t=>b6(e,t))}points(){return this._points}}const Ste=a0();function kte(e,t){return Ste.get(e)(t)}Ste.add("rect",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new dte(...t)}),Ste.add("circle",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new pte(...t)}),Ste.add("line",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new fte(...t)}),Ste.add("polygon",mte),Ste.add("geopolygon",vte),Ste.add("polyline",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new wte(...t)});class Cte{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],e.forEach(e=>{const t=kte(e.type,e);t&&this.geometries.push(t)})}containsPoint(e){return this.geometries.some(t=>t.containsPoint(e))}intersectsLine(e){return this.geometries.some(t=>t.intersectsLine(e))}intersectsRect(e){return this.geometries.some(t=>t.intersectsRect(e))}intersectsCircle(e){return this.geometries.some(t=>t.intersectsCircle(e))}intersectsPolygon(e){return this.geometries.some(t=>t.intersectsPolygon(e))}intersectsGeoPolygon(e){return this.geometries.some(t=>t.intersectsGeoPolygon(e))}}class Ete{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new Ete).multiply(this)}set(e){return this._elements=e,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(e){let t,n;for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]+=e;return this}translate(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}rotate(e){let t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}multiply(e){let t,n,r,i;if(e instanceof Ete&&(e=e._elements),Array.isArray(e)){for(r=[[0,0,0],[0,0,0],[0,0,0]],t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)for(i=0;i<3;i++)r[t][n]+=this._elements[t][i]*e[i][n];this._elements=r}else for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]*=e;return this}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}transform(e,t,n,r,i,o){return this.multiply([[e,n,i],[t,r,o],[0,0,1]]),this}determinant(){let e=this._elements[0][0],t=this._elements[0][1],n=this._elements[0][2],r=this._elements[1][0],i=this._elements[1][1],o=this._elements[1][2],a=this._elements[2][0],s=this._elements[2][1],l=this._elements[2][2],c=0;return c=e*i*l+t*o*a+n*r*s-n*i*a-t*r*l-e*o*s,c}invert(){let e=this.determinant(),t=this._elements[0][0],n=this._elements[0][1],r=this._elements[0][2],i=this._elements[1][0],o=this._elements[1][1],a=this._elements[1][2],s=this._elements[2][0],l=this._elements[2][1],c=this._elements[2][2];return this._elements=[[o*c-a*l,r*l-n*c,n*a-r*o],[a*s-i*c,t*c-r*s,r*i-t*a],[i*l-o*s,s*n-t*l,t*o-n*i]],this.multiply(1/e),this}transpose(){const e=Object.create(this._elements);return this._elements=[[e[0][0],e[1][0],e[2][0]],[e[0][1],e[1][1],e[2][1]],[e[0][2],e[1][2],e[2][2]]],this}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map(e=>e.join("\t")).join("\n"))}isIdentity(){const e=this._elements;return 1===e[0][0]&&0===e[0][1]&&0===e[0][2]&&0===e[1][0]&&1===e[1][1]&&0===e[1][2]&&0===e[2][0]&&0===e[2][1]&&1===e[2][2]}transformPoint(e){let t,n,r=[e.x,e.y,1],i=this._elements,o=[0,0,0];for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)o[t]+=r[n]*i[t][n];return{x:o[0],y:o[1]}}transformPoints(e){let t,n,r,i,o,a=this._elements,s=[];for(i=0;i<e.length;i++){for(t=[e[i].x,e[i].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)o[n]+=t[r]*a[n][r];s.push({x:o[0],y:o[1]})}return s}get elements(){const e=this._elements;return[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]],[e[2][0],e[2][1],e[2][2]]]}}const Mte=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function Rte(e,t){const n=t.args[0]*(Math.PI/180);if(t.args.length>2){const r=t.args[1],i=t.args[2];e.translate(r,i),e.rotate(n),e.translate(-r,-i)}else 1===t.args.length&&e.rotate(n)}function _te(e,t){const n=t.args[0],r=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,r)}function Ate(e,t){const n=t.args[0],r=isNaN(t.args[1])?0:t.args[1];e.translate(n,r)}function Ite(e,t){t.args.length>=6&&e.transform(...t.args)}function Pte(e,t){const n=function(e){let t,n=[];for(;null!==(t=Mte.exec(e));){const e=t[2].trim(),r=-1===e.indexOf(",")?e.split(" "):e.split(",");n.push({cmd:t[1],args:r.filter(e=>e.trim().length>0).map(e=>Number(e))})}return n}(e);let r;for(let e=0,i=n.length;e<i;e++)r=n[e],"rotate"===r.cmd?Rte(t,r):"scale"===r.cmd?_te(t,r):"matrix"===r.cmd?Ite(t,r):"translate"===r.cmd&&Ate(t,r)}const Tte={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},Dte={type:(e,t)=>t.filter(t=>{const n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()}),attr:(e,t,n,r)=>r.filter(r=>{const i=r.attrs[e];if(!t)return void 0!==i;if(void 0===i)return!1;switch(t){case"=":return n===String(i);case"!=":return n!==String(i);default:return!1}}),universal:e=>e,tag:(e,t)=>t.filter(t=>{const n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))})};function Ote(e,t){if(!t||!t.length||!e||"function"!=typeof Dte[e.type])return[];switch(e.type){case"type":case"tag":return Dte[e.type](e.value,t);case"attr":return Dte[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return Dte[e.type](t);default:return[]}}var Nte={find:function(e,t){const n=[],r=[];let i,o;if(t.isBranch){let a;i=function(e){const t=[];let n,r,i,o;return e.split(/\s*,\s*/).forEach(e=>{e=e.trim(),n=[];const a=t=>{i=e.match(Tte[t]),i&&(o=!0,e=e.slice(i[0].length),r={type:t,value:i[0]},"attr"===t&&(i=i[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),r.attribute=i[1],r.operator=i[2],r.attributeValue=i[3]),n.push(r))};for(;e&&(o=!1,i=e.match(/^\s*([>+~]|\s)\s*/),i&&(o=!0,n.push({type:" ",value:i[0]}),e=e.slice(i[0].length)),Object.keys(Tte).forEach(a),n&&n.length&&t.indexOf(n)<0&&t.push(n),o););}),t}(e),o=t.descendants;for(let e=0,t=i.length;e<t;e++){a=i[e];const t=[];let n=o.slice(),s=!1;a.reverse().forEach(e=>{if(" "===e.type)return t.push(n),n=o.slice(),void(s=!1);n=Ote(e,n),s=!0}),s&&t.push(n);const l=t[0].filter(e=>{let n,r=e.parent;for(let e=1;e<t.length;e++){for(n=t[e].indexOf(r);r&&n<0;)r=r.parent,n=t[e].indexOf(r);if(n<0)return!1}return!0});r.push(l)}for(let e=0,t=r.length;e<t;e++)for(let t=0,i=r[e].length;t<i;t++)n.indexOf(r[e][t])<0&&n.push(r[e][t])}return n||[]}};function qte(e,t,n){const r=e.type;let i=e.points();n&&(i=i.every(e=>Array.isArray(e))?i.map(e=>n.transformPoints(e)):n.transformPoints(i)),function(e,t){for(let n=0,r=e.length;n<r;n++)e[n].x/=t,e[n].y/=t}(i,t);let o=null;if("rect"===r||"bounds"===r)o=QQ(i),o.type=r;else if("circle"===r)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(i,e.r),o.type=r;else if("line"===r)o=ZQ(i),o.type=r;else if("polygon"===r||"polyline"===r){o={type:"path",d:S4(i,"polygon"===r)}}else if("geopolygon"===r){let e="";for(let t=0;t<i.length;t++)e+=S4(i[t],!0);o={type:"path",d:e}}return o}class Lte{constructor(e){this._bounds=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const n=e.boundingRect?e.boundingRect(t):{x:0,y:0,width:0,height:0};return{x:n.x,y:n.y,width:n.width,height:n.height}},this._attrs=e.attrs,this._type=e.type,this._data=e.data,this._dpi=e.stage?e.stage.dpi:1,this._collider=()=>function(e,t){if(e.collider){const n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map(e=>qte(e,t,n))}:qte(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map(e=>new Lte(e)),this._parent=()=>e.parent?new Lte(e.parent):null,this._cache={elementBoundingRect:null},this._getElementBoundingRect=()=>(!this._cache.elementBoundingRect&&this.element&&(this._cache.elementBoundingRect=this.element.getBoundingClientRect()),this._cache.elementBoundingRect||{left:0,top:0})}get children(){return this._children()}get parent(){return this._parent()}get type(){return this._type}get data(){return this._data}get attrs(){return this._attrs}set element(e){this._cache.elementBoundingRect=null,this._element=e}get element(){return this._element}set key(e){this._key=e}get key(){return this._key}get bounds(){const e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}get localBounds(){return this._bounds(!1)}boundsRelativeTo(e){const t=typeof e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.bounds:this.localBounds,r=this._getElementBoundingRect();let i=r.left,o=r.top;if("object"===t&&null!==e&&"function"==typeof e.getBoundingClientRect){const t=e.getBoundingClientRect(),n=t.left,r=void 0===n?0:n,a=t.top;i-=r,o-=void 0===a?0:a}return n.x+=i,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function jte(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Lte(...t)}class zte{constructor(e){this._node=jte(e),this._parent=null,this._input=null}get node(){return this._node}set parent(e){this._parent=e}get parent(){return this._parent}set input(e){this._input=e}get input(){return this._input}}function Fte(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new zte(...t)}function $te(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=Fte(n);const e=n.parent;e&&"stage"!==e.type&&$te(e,t.parent)}}function Bte(e,t,n){if(null===e.colliderType)return null;const r=function(e,t){let n={};if(e.modelViewMatrix)if(Array.isArray(t))n=e.inverseModelViewMatrix.transformPoints(t);else if(isNaN(t.r))Array.isArray(t.vertices)?n.vertices=e.inverseModelViewMatrix.transformPoints(t.vertices):n=e.inverseModelViewMatrix.transformPoint(t);else{const i={x:t.cx,y:t.cy};var r=e.inverseModelViewMatrix.transformPoint(i);n.cx=r.x,n.cy=r.y,n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every(e=>Array.isArray(e))?vte(n):mte(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(let r=e.descendants.length-1;r>=0;r--){const i=e.descendants[r];if(null!==i.collider&&i.collider[t](n)){const e=Fte(i);return $te(i,e),e}}return null}(e,t,r):function(e,t,n){if(e.collider[t](n)){const t=Fte(e);return $te(e,t),t}return null}(e,t,r)}function Hte(e,t,n,r){const i=e.length;for(let o=0;o<i;o++){const i=e[o],a=Bte(i,t,r);a&&n.push(a),!i.children||a||i.collider||Hte(i.children,t,n,r)}}function Vte(e,t,n){const r=e.length;for(let i=0;i<r;i++){const r=e[i];if(null!==Bte(r,t,n))return!0;if(r.children&&!r.collider)return Vte(r.children,t,n)}return!1}function Wte(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(eZ(e)){case"circle":return n.cx=e.cx*t,n.cy=e.cy*t,n.r=e.r,["intersectsCircle",n];case"rect":return n=JQ(e).map(e=>_4(e,t)),["intersectsRect",n];case"line":return n=XQ(e).map(e=>_4(e,t)),["intersectsLine",n];case"point":return n=_4(e,t),["containsPoint",n];case"polygon":return n.vertices=e.vertices.map(e=>_4(e,t)),["intersectsPolygon",n];case"geopolygon":return n.vertices=e.vertices.map(e=>e.map(e=>_4(e,t))),["intersectsGeoPolygon",n];default:return[]}}function Ute(e,t){const n=WQ(Wte(t,e.dpi),2),r=n[0],i=n[1],o=[];return r&&(Hte([e],r,o,i),function(e,t){for(let n=0,r=t.length;n<r;n++)t[n].input=e}(t,o)),o}function Gte(e,t){const n=WQ(Wte(t,e.dpi),2);return Vte([e],n[0],n[1])}class Yte extends ute{constructor(e){super(e),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;const t=e.data,n=e.desc,r=e.tag,i=e.strokeReference,o=e.fillReference;var a,s;a=this.attrs,s=e,Object.keys(w4).forEach(e=>{const t=s[e];void 0!==t&&(a[w4[e]]=t)}),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=zQ(!0,{},n)),"string"==typeof r&&(this.tag=r),"string"==typeof i&&(this.strokeReference=i),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return Nte.find(e,this).map(e=>jte(e))}getItemsFrom(e){return Ute(this,e)}containsPoint(e){return Gte(this,e)}intersectsLine(e){return Gte(this,e)}intersectsRect(e){return Gte(this,e)}intersectsCircle(e){return Gte(this,e)}intersectsPolygon(e){return Gte(this,e)}intersectsGeoPolygon(e){return Gte(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ete;void 0!==this.attrs.transform&&Pte(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Ete;const t=this.ancestors;if(t.length>0)for(let n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}attr(e){return this.attrs[e]}equals(e){const t=this.attrs,n=Object.keys(t),r=e.attrs,i=Object.keys(r);if(n.length!==i.length)return!1;for(let e=0;e<n.length;e++){const i=n[e];if(!Object.hasOwnProperty.call(r,i))return!1;if(t[i]!==r[i])return!1}return super.equals(e)}toJSON(){const e=super.toJSON();return e.attrs=this.attrs,e}get attrs(){return this._attrs}get stage(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}set modelViewMatrix(e){this._mvm=e,this._imvm=null}get modelViewMatrix(){return this._mvm}get inverseModelViewMatrix(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}set node(e){this._node=e}get node(){return this._node}set collider(e){const t=Array.isArray(e)?"collection":e&&e.type;return"string"!=typeof t?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===t&&null!==this._collider.fn?(this._collider.fn.set(e),void(this._collider.definition=e)):(this._collider.type=t,void(this._collider.definition=e))}get collider(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Cte(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=kte("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=kte(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class Kte extends ute{addChild(e){if(!(e&&e instanceof ute))throw new TypeError("Expecting a Node as argument, but got ".concat(e));if(e===this)throw new Error("Can not add itself as child!");if(e._children&&e._children.length&&this.ancestors.indexOf(e)>=0)throw new Error("Can not add an ancestor as child!");return e._parent&&e._parent!==this&&e._parent.removeChild(e),this._children.push(e),e._parent=this,e._ancestors=null,this}addChildren(e){let t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}removeChild(e){const t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}removeChildren(e){let t,n;if(!this._children)return this;if(e)for(n=e.length,t=0;t<n;t++)this.removeChild(e[t]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}const Xte=Kte.prototype;class Jte extends Yte{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.type;super(void 0===t?"container":t),this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=e.collider,n=zQ({type:null},t);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(e,t){if(void 0!==e.bounds){const n=this.__boundingRect[t]||{},r=WQ(e.bounds(t),3),i=r[0],o=r[2],a=i.x,s=i.y,l=o.x,c=o.y,u=isNaN(n.width)?l:Math.max(l,n.width+n.x),d=isNaN(n.height)?c:Math.max(c,n.height+n.y);n.x=isNaN(n.x)?a:Math.min(a,n.x),n.y=isNaN(n.y)?s:Math.min(s,n.y),n.width=u-n.x,n.height=d-n.y,this.__boundingRect[t]=n}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.children.length;for(let n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=zQ({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}addChild(e){const t=Xte.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=zQ({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=Xte.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let t=0;t<n;t++)this.appendChildRect(e[t],!0);const t=zQ({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;if(Xte.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=zQ(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(Xte.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=zQ(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function Qte(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Jte(...t)}class Zte extends Jte{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const ene=Kte.prototype,tne=["x1","x2","y1","y2","id","offset","style"];class nne extends Yte{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.type;super(void 0===t?"container":t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=tne.length;r!==i;r++)n=tne[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return ene.addChild.call(this,e)}addChildren(e){return ene.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return ene.removeChild.call(this,e),this}removeChildren(e){return ene.removeChildren.call(this,e),this}}function rne(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new nne(...t)}const ine=Kte.prototype,one=["patternUnits","x","y","width","height","id"];class ane extends Yte{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.type;super(void 0===t?"container":t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=one.length;r!==i;r++)n=one[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return ine.addChild.call(this,e)}addChildren(e){return ine.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return ine.removeChild.call(this,e),this}removeChildren(e){return ine.removeChildren.call(this,e),this}}class sne extends Yte{constructor(){super("rect"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,c=e.rx,u=void 0===c?0:c,d=e.ry,p=void 0===d?0:d,f=e.collider,h=zQ({type:"rect",x:n,y:i,width:a,height:l},f);super.set(e),a>=0?(this.attrs.x=n,this.attrs.width=a):(this.attrs.x=n+a,this.attrs.width=-a),l>=0?(this.attrs.y=i,this.attrs.height=l):(this.attrs.y=i+l,this.attrs.height=-l),u>0&&(this.attrs.rx=u),p>0&&(this.attrs.ry=p),this.collider=h,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=JQ(this.attrs),n=WQ(KQ(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t),4),r=n[0],i=n[1],o=n[2],a=n[3];return this.__boundingRect[e]={x:r,y:i,width:o-r,height:a-i},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}class lne extends Yte{constructor(){super("circle"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.cx,n=void 0===t?0:t,r=e.cy,i=void 0===r?0:r,o=e.r,a=void 0===o?0:o,s=e.collider,l=zQ({type:"circle",cx:n,cy:i,r:a},s);super.set(e),this.attrs.cx=n,this.attrs.cy=i,this.attrs.r=a,this.collider=l,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.bounds(e);return this.__boundingRect[e]={x:t[0].x,y:t[0].y,width:t[2].x-t[0].x,height:t[2].y-t[0].y},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.attrs,n=t.cx,r=t.cy,i=t.r,o=t.r,a=n-i,s=r-o;let l=2*i,c=2*o,u=[{x:a,y:s},{x:a+l,y:s},{x:a+l,y:s+c},{x:a,y:s+c}];if(e&&this.modelViewMatrix){u=this.modelViewMatrix.transformPoints(u);const t=WQ(KQ(u),4),n=t[0],r=t[1];l=t[2]-n,c=t[3]-r,this.__bounds[e]=[{x:n,y:r},{x:n+l,y:r},{x:n+l,y:r+c},{x:n,y:r+c}]}else this.__bounds[e]=u;return this.__bounds[e]}}class cne extends Yte{constructor(){super("line"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x1,n=void 0===t?0:t,r=e.y1,i=void 0===r?0:r,o=e.x2,a=void 0===o?0:o,s=e.y2,l=void 0===s?0:s,c=e.collider;super.set(e),this.attrs.x1=n,this.attrs.y1=i,this.attrs.x2=a,this.attrs.y2=l;const u={type:"line",x1:n,y1:i,x2:a,y2:l};this.collider=zQ(u,c),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];let t=XQ(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const n=WQ(KQ(t),4),r=n[0],i=n[1],o=n[2],a=n[3],s=r!==o||i!==a;return this.__boundingRect[e]={x:r,y:i,width:s?Math.max(1,o-r):0,height:s?Math.max(1,a-i):0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const une=Math.PI/2;function dne(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function pne(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const fne={step:function(e){return new ZZ(e,.5)},stepAfter:function(e){return new ZZ(e,1)},stepBefore:function(e){return new ZZ(e,0)},linear:PZ,basis:function(e){return new jZ(e)},cardinal:$Z.tension(0),catmullRom:HZ,monotonex:function(e){return new YZ(e)},monotoney:function(e){return new KZ(e)},natural:function(e){return new JZ(e)}};function hne(e){if(e.length<2)return!1;const t=e[0],n=e[e.length-1];return Math.abs(t.x-n.x)<1e-12&&Math.abs(t.y-n.y)<1e-12}class mne extends Yte{constructor(){super("path"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(e),this.segments=[],this.points=[],e.arcDatum){const t=_Z();t.innerRadius(e.desc.slice.innerRadius),t.outerRadius(e.desc.slice.outerRadius),t.cornerRadius(e.desc.slice.cornerRadius);const n=t(e.arcDatum);this.attrs.d=n}else if(e.points){const t=e.major,n=e.minor,r=e.layerObj,i=e.points,o=e.stngs,a=e.generatorType,s=OZ(),l=o.coordinates?o.coordinates.defined:null;s[t.p](e=>e.major*t.size)["".concat(n.p,"1")](e=>e.minor*n.size)["".concat(n.p,"0")](e=>e.minor0*n.size).curve(fne["monotone"===r.curve?"monotone".concat(t.p):r.curve]),l?s.defined(e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined):s.defined(e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor));const c=o.connect?i.filter(s.defined()):i,u=("area"===a?s:s[a]())(c);this.attrs.d=u}else e.d&&(this.attrs.d=e.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(e.collider)||"object"==typeof e.collider&&void 0!==e.collider.type)this.collider=e.collider;else if(this.attrs.d){if(this.segments=ste(this.attrs.d),this.segments.length>1&&this.segments.every(e=>hne(e)))return void(this.collider=zQ({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach(t=>{if(t.length<=1);else if(hne(t))this.collider=zQ({type:"polygon",vertices:t},e.collider);else if("object"==typeof e.collider&&e.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=[],i=[];if("h"===n.forceOrientation){const t=e[0].x<e[1].x?-1:1,n=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+t,y:e[0].y}),e.push({x:e[e.length-1].x+n,y:e[e.length-1].y})}else if("v"===n.forceOrientation){const t=e[0].y<e[1].y?-1:1,n=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+t}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+n})}const o=e.length-1;for(let n=1;n<o;n++){const a=e[n-1],s=e[n],l=e[n+1],c=dne(s,a),u=dne(s,l),d=(c+u)/2,p=d+Math.PI,f=Math.max(d,p),h=Math.min(d,p),m=c>u;if(1===n){const e=dne(a,s);r.push(pne(a,e-une,t)),i.unshift(pne(a,e+une,t))}const g=m?f:h,y=m?h:f;if(r.push(pne(s,g,t)),i.unshift(pne(s,y,t)),n===o-1){const e=dne(l,s);r.push(pne(l,e+une,t)),i.unshift(pne(l,e-une,t))}}return{type:"polygon",vertices:[...r,...i]}}(t,n,e.collider)}else this.collider=zQ({type:"polyline",points:t},e.collider)})}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];this.points.length||(this.segments=this.segments.length?this.segments:ste(this.attrs.d),this.points=function(e){const t=[];let n,r=e.length;for(let i=0;i<r;i++){n=e[i];for(let e=0;e<n.length;e++)t.push(n[e])}return t}(this.segments));const t=WQ(KQ(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points),4),n=t[0],r=t[1],i=t[2],o=t[3];return this.__boundingRect[e]={x:n||0,y:r||0,width:i-n||0,height:o-r||0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}function gne(e){let t=e.data,n=e._boundingRect,r=e._textBoundsFn;return null!=t&&(n||r)}class yne extends Yte{constructor(){super("text"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.dx,a=void 0===o?0:o,s=e.dy,l=void 0===s?0:s,c=e.textBoundsFn,u=e.text,d=e.title,p=e.collider,f=e.boundingRect,h=e.ellipsed;super.set(e),this.attrs.x=n,this.attrs.y=i,this.attrs.dx=a,this.attrs.dy=l,this.attrs.text=u,void 0!==d&&(this.attrs.title=String(d)),"object"==typeof f?this._textBoundsFn=()=>f:"function"==typeof c&&(this._textBoundsFn=c),"string"==typeof h&&(this.ellipsed=h),this.collider=zQ({type:gne(this)?"bounds":null},p),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};e=this._textBoundsFn(this.attrs);const n=JQ(e),r=WQ(KQ(t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n),4),i=r[0],o=r[1],a=r[2],s=r[3];return this.__boundingRect[t]={x:i,y:o,width:a-i,height:s-o},this.__boundingRect[t]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}let bne=class extends Yte{constructor(){super("image"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,c=e.rx,u=void 0===c?0:c,d=e.ry,p=void 0===d?0:d,f=e.src,h=e.collider,m=e.cx,g=void 0===m?0:m,y=e.cy,b=void 0===y?0:y,v=e.r,x=void 0===v?0:v,w=e.opacity,S=e.imageScalingFactor,k=e.imagePosition,C=e.symbol;let E;E="circle"===e.symbol?zQ({type:"circle",cx:g,cy:b,r:x},h):zQ({type:"bounds",x:n,y:i,width:a,height:l},h),super.set(e),a>=0?(this.attrs.x=n,this.attrs.width=a):(this.attrs.x=n+a,this.attrs.width=-a),l>=0?(this.attrs.y=i,this.attrs.height=l):(this.attrs.y=i+l,this.attrs.height=-l),u>0&&(this.attrs.rx=u),p>0&&(this.attrs.ry=p),f&&(this.attrs.src=f),this.attrs.r=x,this.attrs.cx=g,this.attrs.cy=b,this.attrs.opacity=void 0!==w?w:1,this.attrs.imageScalingFactor=void 0!==S?S:1,this.attrs.imagePosition=k||"center-center",this.attrs.symbol=C||"rectangle",this.collider=E,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},e.collider||(this.attrs.updateCollider=this.updateCollider.bind(this))}updateCollider(e){let t;t="circle"===e.symbol?zQ(this.collider,{type:"circle",cx:e.cx,cy:e.cy,r:e.r}):zQ(this.collider,{type:"bounds",x:e.x,y:e.y,width:e.width,height:e.height}),this.collider=t}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=JQ(this.attrs),n=WQ(KQ(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t),4),r=n[0],i=n[1],o=n[2],a=n[3];return this.__boundingRect[e]={x:r,y:i,width:o-r,height:a-i},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];if("circle"===this._node.symbol){const t=this.boundingRect(e),n=Math.min(t.width,t.height)/2,r=t.x-n,i=t.y-n;let o=2*n,a=2*n,s=[{x:r,y:i},{x:r+o,y:i},{x:r+o,y:i+a},{x:r,y:i+a}];if(e&&this.modelViewMatrix){s=this.modelViewMatrix.transformPoints(s);const t=WQ(KQ(s),4),n=t[0],r=t[1];o=t[2]-n,a=t[3]-r,this.__bounds[e]=[{x:n,y:r},{x:n+o,y:r},{x:n+o,y:r+a},{x:n,y:r+a}]}else this.__bounds[e]=s;return this.__bounds[e]}const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}};const vne=a0();function xne(e,t){return vne.get(e)(t)}vne.add("rect",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new sne(...t)}),vne.add("circle",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new lne(...t)}),vne.add("text",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new yne(...t)}),vne.add("line",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new cne(...t)}),vne.add("path",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new mne(...t)}),vne.add("stage",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Zte(...t)}),vne.add("container",Qte),vne.add("defs",Qte),vne.add("linearGradient",rne),vne.add("radialGradient",rne),vne.add("conicGradient",rne),vne.add("stop",rne),vne.add("pattern",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ane(...t)}),vne.add("image",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new bne(...t)});const wne=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[{}];function n(){return t[t.length-1]}return n.save=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=n(),o={};let a="";for(let t=0;t<e.length;t++)a=e[t],void 0!==i[a]&&(o[a]=i[a]);return zQ(o,r),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function Sne(e,t){if(Array.isArray(t))for(let n=0,r=t.length;n<r;n++)t[n](e)}function kne(e,t,n){e.node=n[t],e.index=t}function Cne(e,t,n,r){let i=!1;const o={siblings:e,node:null,index:0};for(let a=0,s=e.length;a<s;a++){if(kne(o,a,e),Sne(o,r.create),i="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,i)continue;o.node=wne.save(o.node);const s=xne(o.node.type,o.node);s&&(o.node.transform&&(n.save(),Pte(o.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),t.addChild(s),o.node.children&&Cne(o.node.children,s,n,r),o.node.transform&&n.restore()),wne.restore()}}function Ene(e){let t=e.items,n=e.stage,r=e.dpi,i=e.on,o=void 0===i?{}:i;return n||(n=xne("stage",r)),Cne(t,n,new Ete,o),n}function Mne(e,t,n){const r=n.orientation,i=n.degree,o=n.stops,a=void 0===o?[]:o;let s=null;if("radial"===r){const n=t.boundingRect();s=e.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else if("conic"===r){const t=n.startAngle||0,r=n.x||0,i=n.y||0;s=e.createConicGradient(t,r,i)}else{const r=E4(i);["x1","x2","y1","y2"].forEach(e=>{e in n&&(r[e]=n[e])});const o=t.boundingRect();s=e.createLinearGradient(o.x+r.x1*o.width,o.y+r.y1*o.height,o.x+r.x2*o.width,o.y+r.y2*o.height)}for(let e=0,t=a.length;e<t;e++){let t=a[e];s.addColorStop(t.offset,t.color)}return s}function Rne(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach(e=>{if("rect"===e.type)n.rect(e.x,e.y,e.width,e.height)}),n.fill(),n.restore(),n.createPattern(t,"repeat")}function _ne(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=e.y,r=e.width,i=e.height,o=e.scaleRatio,a=e.margin,s=e.edgeBleed;const l={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0},edgeBleed:{left:0,right:0,top:0,bottom:0,bool:!1}};return l.x=isNaN(t)?l.x:t,l.y=isNaN(n)?l.y:n,l.width=isNaN(r)?l.width:r,l.height=isNaN(i)?l.height:i,void 0!==o&&(l.scaleRatio.x=isNaN(o.x)?l.scaleRatio.x:o.x,l.scaleRatio.y=isNaN(o.y)?l.scaleRatio.y:o.y),void 0!==a&&(l.margin.left=isNaN(a.left)?0:a.left,l.margin.top=isNaN(a.top)?0:a.top),"object"==typeof s&&["left","right","top","bottom"].forEach(e=>{!isNaN(s[e])&&s[e]>0&&(l.edgeBleed[e]=s[e],l.edgeBleed.bool=!0)}),l.computedPhysical={x:Math.round(l.margin.left+(l.x-l.edgeBleed.left)*l.scaleRatio.x),y:Math.round(l.margin.top+(l.y-l.edgeBleed.top)*l.scaleRatio.y),width:Math.round((l.width+l.edgeBleed.left+l.edgeBleed.right)*l.scaleRatio.x),height:Math.round((l.height+l.edgeBleed.top+l.edgeBleed.bottom)*l.scaleRatio.y)},l}function Ane(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:Z9,textBounds:tee,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function Ine(e){return t=>{let n=t.node;"text"===n.type&&function(e){return null!=e}(n.data)&&!n.textBoundsFn&&(n.textBoundsFn=e.textBounds)}}const Pne=200,Tne=200;class Dne{constructor(e){this.targetCanvas=e,this.bufferCanvas=e.cloneNode()}updateSize(e){let t,n=e.rect,r=e.dpiRatio,i=e.canvasBufferSize;t=i?"function"==typeof i?i(n):i:{width:n.computedPhysical.width+2*Pne,height:n.computedPhysical.height+2*Tne},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*r),this.bufferCanvas.height=Math.round(t.height*r)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const One=a0();function Nne(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function qne(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function Lne(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function jne(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Object.keys(r);for(let i=0,o=n.length;i<o;i++){let o=n[i];const a=o[0],s=o[1],l=o[2];if(a in t.attrs&&!(s in r)&&e[s]!==t.attrs[a]){const n=l?l(t.attrs[a]):t.attrs[a];"function"==typeof e[s]?e[s](n):e[s]=n}}for(let t=0,n=i.length;t<n;t++){const n=i[t];e[n]=r[n]}}function zne(e,t,n,r){for(let i=0,o=e.length;i<o;i++){let o=e[i],a={};t.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?a.fillStyle=Mne(t,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(a.fillStyle=r.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?a.strokeStyle=Mne(t,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(a.strokeStyle=r.patterns.create(o.attrs.stroke))),jne(t,o,n,a),o.modelViewMatrix&&Lne(o.modelViewMatrix.elements,t),One.has(o.type)&&One.get(o.type)(o.attrs,{g:t,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&zne(o.children,t,n,r),t.restore()}}function Fne(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ene;const r={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let i,o=!1,a=_ne();const s=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",Nne]];let l;const c=Ane();return c.element=()=>e,c.root=()=>e,c.settings=e=>(e&&Object.keys(r).forEach(t=>{void 0!==e[t]&&(r[t]=e[t])}),r),c.appendTo=n=>(e||(e=n.ownerDocument.createElement("canvas"),e.style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof r.transform||t||(t=new Dne(e)),n.appendChild(e),e),c.getScene=r=>{const i=qne(t&&t.getContext()||e.getContext("2d")),o=a.scaleRatio.x,s=a.scaleRatio.y,l={type:"container",children:r,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*i*o,", ").concat(a.edgeBleed.top*i*s,")"):""};return 1===i&&1===o&&1===s||(l.transform+="scale(".concat(i*o,", ").concat(i*s,")")),n({items:[l],dpi:i,on:{create:[H9(c.measureText),Ine(c)]}})},c.render=n=>{if(!e)return!1;l||(l=function(e){const t=e.createElement("canvas"),n=t.getContext("2d");let r={};return{create(e){const i=e.key;return i?(r[i]=r[i]||Rne(e,t,n),r[i]):Rne(e,t,n)},clear(){r={}}}}(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),d=qne(u),p=t&&r.transform();if(p)return e.width=e.width,function(e){let t=e.el,n=e.dpiRatio,r=e.transform;if("object"==typeof r){const e=[r.horizontalScaling,r.horizontalSkewing,r.verticalSkewing,r.verticalScaling,r.horizontalMoving*n,r.verticalMoving*n];t.getContext("2d").setTransform(...e)}}({el:e,dpiRatio:d,transform:p}),t.apply(),!0;o&&(e.style.left="".concat(a.computedPhysical.x,"px"),e.style.top="".concat(a.computedPhysical.y,"px"),e.style.width="".concat(a.computedPhysical.width,"px"),e.style.height="".concat(a.computedPhysical.height,"px"),e.width=Math.round(a.computedPhysical.width*d),e.height=Math.round(a.computedPhysical.height*d),t&&t.updateSize({rect:a,dpiRatio:d,canvasBufferSize:r.canvasBufferSize}));const f=c.getScene(n),h=!i||!f.equals(i);l.clear();const m=o||h,g="function"==typeof r.progressive&&r.progressive();return m&&(g&&!g.isFirst||c.clear(),zne(f.children,u,s,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,g&&!g.isFirst&&f.children.unshift(...i.children),i=f,m},c.itemsAt=e=>i?i.getItemsFrom(e):[],c.findShapes=e=>i?i.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),i=null,c),c.size=e=>{if(e){const t=_ne(e);JSON.stringify(a)!==JSON.stringify(t)&&(o=!0,a=t)}return a},c.destroy=()=>{e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),i=null},c}function $ne(e,t){One.add(e,t)}function Bne(e,t){return Math.max(0,Math.min(e,t))}const Hne=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Vne=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞יִײַ-ﬨשׁ-ﭏ]"),Wne=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function Une(e){return Hne.test(e)}function Gne(e){return Vne.test(e)||Wne.test(e)}function Yne(e){let t,n,r=e?e.length:0;for(t=0;t<r;t++){if(n=e[t],Une(n))return"ltr";if(Gne(n))return"rtl"}return"ltr"}const Kne={start:"end",end:"start",center:"center",middle:"middle"};function Xne(e,t){return"rtl"===t?Kne[e]:e}function Jne(e,t){if(Jne.cache[e])return void t(Jne.cache[e]);const n=new Image;n.src=e,n.onload=()=>{Jne.cache[e]=n,t(n)},n.onerror=e=>{console.error("Image load error",e)}}function Qne(e,t){const n=[];let r;const i=[],o=[],a=[];let s,l;const c=e=>e.id,u=(e,t)=>{let n;return n="object"==typeof e?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(u)),t=t.map(u),s=e.map(c),l=t.map(c);for(let e=0,r=t.length;e<r;e++){-1===s.indexOf(t[e].id)?n.push(t[e]):o.push(t[e])}for(let t=0,n=e.length;t<n;t++){-1===l.indexOf(e[t].id)?i.push(e[t]):a.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=Qne([],n[e].content.children),n[e].children=n[e].diff.updatedNew.concat(n[e].diff.added),n[e].children.isTree=!0);for(let e=0,t=o.length;e<t;e++)o[e].diff=Qne(a[e].children||[],o[e].content.children||[]),o[e].object=a[e].object,o[e].children=o[e].diff.items;return r=o.concat(n),n.isTree=!0,i.isTree=!0,o.isTree=!0,a.isTree=!0,r.isTree=!0,{added:n,updatedNew:o,updatedOld:a,removed:i,items:r}}function Zne(e,t,n){for(let r=0,i=e.length;r<i;r++)e[r].object=n(e[r].content.type,t)}function ere(e,t){for(let n=0,r=e.length;n<r;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function tre(e,t,n,r){let i;for(let o=0,a=e.length;o<a;o++)i=e[o],null!==i.object&&void 0!==i.object&&(n(i.object,i.content),i.diff&&(Zne(i.diff.added,i.object,t),ere(i.diff.removed,r),tre(i.diff.items,t,n,r)))}function nre(e,t,n,r,i,o){const a=Qne(e,t);return Zne(a.added,n,r),ere(a.removed,o),tre(a.items,r,i,o),a.items}Jne.cache={},$ne("rect",function(e,t){let n=t.g,r=t.doFill,i=t.doStroke;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,r,i,o,a){o=Bne(r/2,o>0?o:a),a=Bne(i/2,a>0?a:o),e.moveTo(t,n+a),e.lineTo(t,n+i-a),e.quadraticCurveTo(t,n+i,t+o,n+i),e.lineTo(t+r-o,n+i),e.quadraticCurveTo(t+r,n+i,t+r,n+i-a),e.lineTo(t+r,n+a),e.quadraticCurveTo(t+r,n,t+r-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+a)}(n,e.x,e.y,e.width,e.height,e.rx,e.ry):n.rect(e.x,e.y,e.width,e.height),r&&n.fill(),i&&n.stroke()}),$ne("circle",function(e,t){let n=t.g,r=t.doFill,i=t.doStroke;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),r&&n.fill(),i&&n.stroke()}),$ne("line",function(e,t){let n=t.g,r=t.doStroke;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),r&&n.stroke()}),$ne("path",function(e,t){let n=t.g,r=t.doStroke,i=t.doFill;const o=new Path2D(e.d);i&&n.fill(o),r&&n.stroke(o)}),$ne("text",function(e,t){let n=t.g,r=t.ellipsed,i=t.doStroke;const o=r||V9(e,Z9);n.font=[e["font-style"],e["font-weight"],e["font-size"],e["font-family"]].filter(e=>!!e).join(" ");const a=Yne(e.text);n.canvas.dir!==a&&(n.canvas.dir=a);const s=Xne("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);const l=W9(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),i&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)}),$ne("image",function(e,t){let n=t.g;const r=n.canvas,i=n.getTransform(),o=window.devicePixelRatio||1,a=r.clientWidth*o,s=r.clientHeight*o;r.width===a&&r.height===s||(r.width=a,r.height=s),Jne(e.src,t=>{if(n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,r.width,r.height),n.setTransform(i),n.globalAlpha=e.opacity,e.width||e.height||(e.width=t.naturalWidth*e.imageScalingFactor,e.height=t.naturalHeight*e.imageScalingFactor),function(e){const t=e.imagePosition||"center-center";let n=e.width,r=e.height;if("circle"===e.symbol){const t=Math.min(e.width,e.height)/2;n=2*t,r=2*t}switch(t){case"top-center":e.y-=r/2;break;case"center-left":e.x-=n/2;break;case"center-right":e.x+=n/2;break;case"top-left":e.x-=n/2,e.y-=r/2;break;case"top-right":e.x+=n/2,e.y-=r/2;break;case"bottom-left":e.x-=n/2,e.y+=r/2;break;case"bottom-right":e.x+=n/2,e.y+=r/2;break;case"bottom-center":e.y+=r/2}}(e),"circle"===e.symbol){const r=e.x,i=e.y;e.r=Math.min(e.width,e.height)/2;const o=r-e.width/2,a=i-e.height/2;n.save(),n.beginPath(),n.arc(r,i,e.r,0,2*Math.PI),n.clip(),n.drawImage(t,o,a,e.width,e.height),n.restore()}else e.x-=e.width/2,e.y-=e.height/2,n.drawImage(t,e.x,e.y,e.width,e.height);n.globalAlpha=1,e.updateCollider&&e.updateCollider(e)})});const rre="http://www.w3.org/2000/svg",ire=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(rre,"container"===e?"g":e);return t.appendChild(n),n},ore=e=>{e.parentNode&&e.parentNode.removeChild(e)};function are(e){let t=e.element,n=e.attrs;return function(){const e=n.width,r=n.height,i=n.imagePosition,o=n.imageScalingFactor,a=n.symbol;let s=n.x,l=void 0===s?0:s,c=n.y,u=void 0===c?0:c,d=e>0?e:this.naturalWidth,p=r>0?r:this.naturalHeight;switch(o&&(d*=o,p*=o),i){case"top-center":u-=p/2;break;case"center-left":l-=d/2;break;case"center-right":l+=d/2;break;case"top-left":l-=d/2,u-=p/2;break;case"top-right":l+=d/2,u-=p/2;break;case"bottom-left":l-=d/2,u+=p/2;break;case"bottom-right":l+=d/2,u+=p/2;break;case"bottom-center":u+=p/2}if(t.setAttribute("width",d),t.setAttribute("height",p),t.setAttribute("x",l-d/2),t.setAttribute("y",u-p/2),t.setAttribute("preserveAspectRatio","none"),"circle"===a){const e=t.ownerSVGElement;if(!e)return;const n="clip-".concat(Math.random().toString(36).substr(2,9));if(!e.querySelector("#".concat(n))){const t=e.querySelector("defs")||e.insertBefore(document.createElementNS(rre,"defs"),e.firstChild),r=document.createElementNS(rre,"clipPath");r.setAttribute("id",n);const i=document.createElementNS(rre,"circle");i.setAttribute("cx",l),i.setAttribute("cy",u),i.setAttribute("r",Math.min(d,p)/2),r.appendChild(i),t.appendChild(r)}t.setAttribute("clip-path","url(#".concat(n,")"))}}}const sre=(e,t)=>{if((e=>{switch(e.type){case"circle":return!isNaN(e.attrs.cx)&&!isNaN(e.attrs.cy)&&!isNaN(e.attrs.r);case"line":return!(isNaN(e.attrs.x1)||isNaN(e.attrs.y1)||isNaN(e.attrs.x2)||isNaN(e.attrs.y2));case"rect":return!(isNaN(e.attrs.x)||isNaN(e.attrs.y)||isNaN(e.attrs.width)||isNaN(e.attrs.height));case"text":case"image":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}})(t)){for(const n in t.attrs)if("stroke"===n&&t.strokeReference)e.setAttribute("stroke",t.strokeReference);else if("fill"===n&&t.fillReference)e.setAttribute("fill",t.fillReference);else if("text"===n){e.setAttribute("style","white-space: pre"),e.textContent=t.ellipsed||V9(t.attrs,Z9);const n=Yne(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",Xne(e.getAttribute("text-anchor"),n)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){const n=e.ownerDocument.createElementNS(rre,"title");n.textContent=t.attrs.title,e.appendChild(n)}else if("image"===t.type&&"src"===n){e.setAttributeNS("http://www.w3.org/1999/xlink","href",t.attrs.src);let n=new Image;n.src=t.attrs.src,n.onload=are({element:e,attrs:t.attrs})}else e.setAttribute(n,t.attrs[n]);else{const r=+e.getAttribute(n)||0;let i=0;i="dominant-baseline"===n?W9(t.attrs):t.attrs[n],e.setAttribute("dy",i+r)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"==typeof t.data&&null!==t.data)for(const n in t.data)"string"!=typeof t.data[n]&&"number"!=typeof t.data[n]&&"boolean"!=typeof t.data[n]||e.setAttribute("data-".concat(n),t.data[n])}};class lre{constructor(e,t,n,r){this.create=e,this.nodeCreator=t,this.nodeMaintainer=n,this.nodeDestroyer=r}render(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function cre(){return new lre(nre,ire,sre,ore)}function ure(e){let t,n,r,i=0;if(0===(e=JSON.stringify(e)).length)return i;for(t=0,r=e.length;t<r;t++)n=e.charCodeAt(t),i=(i<<5)-i+n,i&=i;return i}function dre(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rre,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Ene;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:cre)();let r,i,o,a=!1,s=_ne();const l={transform:void 0,disableScreenReader:!1},c=Ane(),u={type:"defs",children:[]},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ure,n={},r=Date.now();const i={onCreate(i){let o={};i.node&&"object"==typeof i.node.fill&&"pattern"===i.node.fill.type&&i.node.fill.shapes&&(o.fill=i.node.fill),i.node&&"object"==typeof i.node.stroke&&"pattern"===i.node.stroke.type&&i.node.stroke.shapes&&(o.stroke=i.node.stroke),Object.keys(o).forEach(a=>{let s="";const l=o[a],c=t(l),u="picasso-pattern-".concat(r,"-").concat(c);if("undefined"!=typeof window&&(s=window.location.href.split("#")[0]),!n[c]){const t={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach(e=>{t.children.push(e)}),e.push(t),n[c]=!0}i.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(u,"')")})},clear(){n={}}};return i}(u.children),p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ure,n={},r=Date.now();const i={getOrCreateGradient(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=t(i[o]),l="picasso-gradient-".concat(r,"-").concat(s);if(!n[s]){let t=i[o],r=t.orientation,a=t.degree,c=t.stops,u=void 0===c?[]:c,d={};void 0===a&&(a=90),"radial"===r?d.type="radialGradient":(d=E4(a),["x1","x2","y1","y2"].forEach(e=>{e in i[o]&&(d[e]=i[o][e])}),d.type="linearGradient"),d.id=l,d.children=u.map(e=>{let t=e.offset,n=e.color,r=e.opacity;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==r?r:1)}}),e.push(d),n[s]=l}return"url('".concat(a,"#").concat(l,"')")},onCreate(e){let t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);const n=e.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=i.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=i.getOrCreateGradient(n,"stroke",t))},clear(){n={}}};return i}(u.children);return c.element=()=>r,c.root=()=>i,c.settings=e=>(e&&Object.keys(l).forEach(t=>{void 0!==e[t]&&(l[t]=e[t])}),l),c.appendTo=t=>(r||(r=t.ownerDocument.createElementNS(e,"svg"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none",r.setAttribute("xmlns",e),i=t.ownerDocument.createElementNS(e,"g"),i.style.pointerEvents="auto",r.appendChild(i)),t.appendChild(r),r),c.getScene=e=>{const n=s.scaleRatio.x,r=s.scaleRatio.y,i={type:"container",children:Array.isArray(e)?[...e,u]:e,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*n,", ").concat(s.edgeBleed.top*r,")"):""};return 1===n&&1===r||(i.transform+="scale(".concat(n,", ").concat(r,")")),t({items:[i],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},p.onCreate,d.onCreate,H9(c.measureText),Ine(c)]}})},c.render=e=>{if(!r)return!1;const t="function"==typeof l.transform&&l.transform();if(t){const e=t.horizontalScaling,n=t.horizontalSkewing,r=t.verticalSkewing,o=t.verticalScaling,a=t.horizontalMoving,s=t.verticalMoving;return i.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(r,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}i.style.transform="";l.disableScreenReader&&r.setAttribute("aria-hidden",!0),a&&(r.style.left="".concat(s.computedPhysical.x,"px"),r.style.top="".concat(s.computedPhysical.y,"px"),r.setAttribute("width",s.computedPhysical.width),r.setAttribute("height",s.computedPhysical.height)),p.clear(),d.clear(),u.children.length=0;const f=c.getScene(e),h=!o||!f.equals(o),m=a||h;return m&&(c.clear(),n.render(f.children,i)),a=!1,o=f,m},c.itemsAt=e=>o?o.getItemsFrom(e):[],c.findShapes=e=>o?o.findShapes(e):[],c.clear=()=>{if(!i)return c;o=null;const e=i.cloneNode(!1);return r.replaceChild(e,i),i=e,c},c.destroy=()=>{r&&r.parentNode&&r.parentNode.removeChild(r),r=null,i=null},c.size=e=>{if(e){const t=_ne(e);JSON.stringify(s)!==JSON.stringify(t)&&(a=!0,s=t)}return s},c}var pre,fre,hre,mre,gre,yre,bre,vre={},xre=[],wre=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Sre(e,t){for(var n in t)e[n]=t[n];return e}function kre(e){var t=e.parentNode;t&&t.removeChild(e)}function Cre(e,t,n){var r,i,o,a={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?pre.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return Ere(e,a,r,i,null)}function Ere(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++hre:i};return null==i&&null!=fre.vnode&&fre.vnode(o),o}function Mre(e){return e.children}function Rre(e,t){this.props=e,this.context=t}function _re(e,t){if(null==t)return e.__?_re(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?_re(e):null}function Are(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Are(e)}}function Ire(e){(!e.__d&&(e.__d=!0)&&mre.push(e)&&!Pre.__r++||gre!==fre.debounceRendering)&&((gre=fre.debounceRendering)||yre)(Pre)}function Pre(){var e,t,n,r,i,o,a,s;for(mre.sort(bre);e=mre.shift();)e.__d&&(t=mre.length,r=void 0,i=void 0,a=(o=(n=e).__v).__e,(s=n.__P)&&(r=[],(i=Sre({},o)).__v=o.__v+1,Fre(s,o,i,n.__n,void 0!==s.ownerSVGElement,null!=o.__h?[a]:null,r,null==a?_re(o):a,o.__h),$re(r,o),o.__e!=a&&Are(o)),mre.length>t&&mre.sort(bre));Pre.__r=0}function Tre(e,t,n,r,i,o,a,s,l,c){var u,d,p,f,h,m,g,y=r&&r.__k||xre,b=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(f=n.__k[u]=null==(f=t[u])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?Ere(null,f,null,null,f):Array.isArray(f)?Ere(Mre,{children:f},null,null,null):f.__b>0?Ere(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)){if(f.__=n,f.__b=n.__b+1,null===(p=y[u])||p&&f.key==p.key&&f.type===p.type)y[u]=void 0;else for(d=0;d<b;d++){if((p=y[d])&&f.key==p.key&&f.type===p.type){y[d]=void 0;break}p=null}Fre(e,f,p=p||vre,i,o,a,s,l,c),h=f.__e,(d=f.ref)&&p.ref!=d&&(g||(g=[]),p.ref&&g.push(p.ref,null,f),g.push(d,f.__c||h,f)),null!=h?(null==m&&(m=h),"function"==typeof f.type&&f.__k===p.__k?f.__d=l=Dre(f,l,e):l=Ore(e,f,p,y,h,l),"function"==typeof n.type&&(n.__d=l)):l&&p.__e==l&&l.parentNode!=e&&(l=_re(p))}for(n.__e=m,u=b;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=Nre(r).nextSibling),Vre(y[u],y[u]));if(g)for(u=0;u<g.length;u++)Hre(g[u],g[++u],g[++u])}function Dre(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?Dre(r,t,n):Ore(n,r,r,i,r.__e,t));return t}function Ore(e,t,n,r,i,o){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<r.length;l+=1)if(s==i)break e;e.insertBefore(i,o),a=o}return void 0!==a?a:i.nextSibling}function Nre(e){var t,n,r;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=Nre(n)))return r;return null}function qre(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||wre.test(t)?n:n+"px"}function Lre(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||qre(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||qre(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?zre:jre,o):e.removeEventListener(t,o?zre:jre,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function jre(e){return this.l[e.type+!1](fre.event?fre.event(e):e)}function zre(e){return this.l[e.type+!0](fre.event?fre.event(e):e)}function Fre(e,t,n,r,i,o,a,s,l){var c,u,d,p,f,h,m,g,y,b,v,x,w,S,k,C=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,s=t.__e=n.__e,t.__h=null,o=[s]),(c=fre.__b)&&c(t);try{e:if("function"==typeof C){if(g=t.props,y=(c=C.contextType)&&r[c.__c],b=c?y?y.props.value:c.__:r,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in C&&C.prototype.render?t.__c=u=new C(g,b):(t.__c=u=new Rre(g,b),u.constructor=C,u.render=Wre),y&&y.sub(u),u.props=g,u.state||(u.state={}),u.context=b,u.__n=r,d=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=C.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=Sre({},u.__s)),Sre(u.__s,C.getDerivedStateFromProps(g,u.__s))),p=u.props,f=u.state,u.__v=t,d)null==C.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==C.getDerivedStateFromProps&&g!==p&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,b),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,b)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(e){e&&(e.__=t)}),v=0;v<u._sb.length;v++)u.__h.push(u._sb[v]);u._sb=[],u.__h.length&&a.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,b),null!=u.componentDidUpdate&&u.__h.push(function(){u.componentDidUpdate(p,f,h)})}if(u.context=b,u.props=g,u.__P=e,x=fre.__r,w=0,"prototype"in C&&C.prototype.render){for(u.state=u.__s,u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),S=0;S<u._sb.length;S++)u.__h.push(u._sb[S]);u._sb=[]}else do{u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(r=Sre(Sre({},r),u.getChildContext())),d||null==u.getSnapshotBeforeUpdate||(h=u.getSnapshotBeforeUpdate(p,f)),k=null!=c&&c.type===Mre&&null==c.key?c.props.children:c,Tre(e,Array.isArray(k)?k:[k],t,n,r,i,o,a,s,l),u.base=t.__e,t.__h=null,u.__h.length&&a.push(u),m&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Bre(n.__e,t,n,r,i,o,a,l);(c=fre.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=s,t.__h=!!l,o[o.indexOf(s)]=null),fre.__e(e,t,n)}}function $re(e,t){fre.__c&&fre.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){fre.__e(e,t.__v)}})}function Bre(e,t,n,r,i,o,a,s){var l,c,u,d=n.props,p=t.props,f=t.type,h=0;if("svg"===f&&(i=!0),null!=o)for(;h<o.length;h++)if((l=o[h])&&"setAttribute"in l==!!f&&(f?l.localName===f:3===l.nodeType)){e=l,o[h]=null;break}if(null==e){if(null===f)return document.createTextNode(p);e=i?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,p.is&&p),o=null,s=!1}if(null===f)d===p||s&&e.data===p||(e.data=p);else{if(o=o&&pre.call(e.childNodes),c=(d=n.props||vre).dangerouslySetInnerHTML,u=p.dangerouslySetInnerHTML,!s){if(null!=o)for(d={},h=0;h<e.attributes.length;h++)d[e.attributes[h].name]=e.attributes[h].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||Lre(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||Lre(e,o,t[o],n[o],r)}(e,p,d,i,s),u)t.__k=[];else if(h=t.props.children,Tre(e,Array.isArray(h)?h:[h],t,n,r,i&&"foreignObject"!==f,o,a,o?o[0]:n.__k&&_re(n,0),s),null!=o)for(h=o.length;h--;)null!=o[h]&&kre(o[h]);s||("value"in p&&void 0!==(h=p.value)&&(h!==e.value||"progress"===f&&!h||"option"===f&&h!==d.value)&&Lre(e,"value",h,d.value,!1),"checked"in p&&void 0!==(h=p.checked)&&h!==e.checked&&Lre(e,"checked",h,d.checked,!1))}return e}function Hre(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){fre.__e(e,n)}}function Vre(e,t,n){var r,i;if(fre.unmount&&fre.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Hre(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){fre.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Vre(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||kre(e.__e),e.__=e.__e=e.__d=void 0}function Wre(e,t,n){return this.constructor(e,n)}function Ure(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createElement,t=void 0===e?document.createElement.bind(document):e;let n,r,i=_ne();const o={transform:void 0,disableScreenReader:!1},a=Ane();return a.element=()=>n,a.root=()=>n,a.settings=e=>(e&&Object.keys(o).forEach(t=>{void 0!==e[t]&&(o[t]=e[t])}),o),a.appendTo=e=>(n||(n=t("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),e.appendChild(n),n),a.render=e=>{if(!n)return!1;const t="function"==typeof o.transform&&o.transform();if(t){const e=t.horizontalScaling,r=t.horizontalSkewing,i=t.verticalSkewing,o=t.verticalScaling,a=t.horizontalMoving,s=t.verticalMoving;return n.style.transform="matrix(".concat(e,", ").concat(r,", ").concat(i,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}n.style.transform="";let a;return o.disableScreenReader&&n.setAttribute("aria-hidden",!0),n.style.left="".concat(i.computedPhysical.x,"px"),n.style.top="".concat(i.computedPhysical.y,"px"),n.style.width="".concat(i.computedPhysical.width,"px"),n.style.height="".concat(i.computedPhysical.height,"px"),a=Array.isArray(e)?Cre("div",null,e):e,r=function(e,t,n){var r,i,o;fre.__&&fre.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],Fre(t,e=(!r&&n||t).__k=Cre(Mre,null,[e]),i||vre,vre,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?pre.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),$re(o,e)}(a,n,r),!0},a.renderArgs=[Cre],a.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;r=null}return a},a.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,r=null},a.size=e=>(e&&(i=_ne(e)),i),a}pre=xre.slice,fre={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},hre=0,Rre.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Sre({},this.state),"function"==typeof e&&(e=e(Sre({},n),this.props)),e&&Sre(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Ire(this))},Rre.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ire(this))},Rre.prototype.render=Mre,mre=[],yre="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,bre=function(e,t){return e.__v.__b-t.__v.__b},Pre.__r=0;var Gre=[function(e){e.renderer("svg",dre)},function(e){e.renderer("canvas",Fne)},function(e){e.renderer("dom",Ure)}];const Yre={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const Kre=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.level,n=void 0===t?Yre.OFF:t,r=e.pipe,i=void 0===r?console:r,o=n;const a={[Yre.OFF]:()=>{},[Yre.ERROR]:function(){return i.error(...arguments)},[Yre.WARN]:function(){return i.warn(...arguments)},[Yre.INFO]:function(){return i.info(...arguments)},[Yre.DEBUG]:function(){return i.log(...arguments)}},s=function(e){if(e&&!(o<e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];(a[e]||a[Yre.DEBUG])(...n)}};return{log:s,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(Yre.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(Yre.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(Yre.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(Yre.DEBUG,...t)},level:e=>("number"==typeof e&&(o=e),o),LOG_LEVEL:Yre}}(t.logger),i={component:a0(n.component,"component",r),data:a0(n.data,"data",r),formatter:a0(n.formatter,"formatter",r),interaction:a0(n.interaction,"interaction",r),renderer:Y6(n.renderer),scale:a0(n.scale,"scale",r),symbol:a0(n.symbol,"symbol",r),logger:r};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e({palettes:t.palettes.concat(n.palettes||[]),style:zQ({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer},i)}return t.renderer&&t.renderer.prio&&i.renderer.default(t.renderer.prio[0]),o.use=function(e){return function(e){e(arguments.length>2?arguments[2]:void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i)},o.chart=e=>G6(e,{registries:i,logger:r,style:t.style,palettes:t.palettes}),o.config=()=>t,Object.keys(i).forEach(e=>{o[e]=i[e]}),o.version=FQ,o}({renderer:{prio:["svg","canvas"]},logger:{level:0},style:{"$font-family":"'Source Sans Pro', Arial, sans-serif","$font-size":"12px","$line-height":"16px","$font-size--l":"16px","$font-weight":"normal","$gray-100":"#ffffff","$gray-98":"#f9f9f9","$gray-95":"#f2f2f2","$gray-90":"#e6e6e6","$gray-35":"#595959","$gray-30":"#4d4d4d","$gray-25":"#404040","$gray-20":"#333333","$border-95":"rgba(255, 255, 255, 0.05)","$border-90":"rgba(255, 255, 255, 0.1)","$border-80":"rgba(255, 255, 255, 0.2)","$border-20":"rgba(0, 0, 0, 0.2)","$border-10":"rgba(0, 0, 0, 0.1)","$border-5":"rgba(0, 0, 0, 0.05)","$primary-blue":"#3F8AB3","$primary-green":"#6CB33F","$primary-red":"#DC423F","$primary-orange":"#EF960F","$spacing--s":4,$spacing:8,"$spacing--l":12,"$font-color":"$gray-35","$font-color--inverted":"$gray-90","$guide-color":"$gray-90","$guide-color--inverted":"$gray-35",$border:"$border-80","$border--inverted":"$border-10",$shape:{fill:"$primary-blue",strokeWidth:1,stroke:"$border"},"$shape-outline":{stroke:"$primary-blue",strokeWidth:2},"$shape-guide":{stroke:"$guide-color",strokeWidth:1},"$shape-guide--inverted":{"@extend":"$shape-guide",stroke:"$guide-color--inverted"},$label:{fontSize:"$font-size",fontFamily:"$font-family",fill:"$font-color"},"$label--inverted":{$extend:"$label",fill:"$font-color--inverted"},"$label-overlay":{fontSize:"$font-size--l",fontFamily:"$font-family",fill:"$gray-100",color:"$font-color",stroke:"$guide-color--inverted",strokeWidth:1,borderRadius:4},$title:{"@extend":"$label",fontSize:"$font-size--l",fontWeight:"$font-weight",stroke:"$guide-color--inverted",strokeWidth:0},"$guide-line":{strokeWidth:1,stroke:"$guide-color"},"$guide-line--minor":{strokeWidth:1,stroke:"$gray-95"},"$padding--s":{left:"$spacing--s",right:"$spacing--s",top:"$spacing--s",bottom:"$spacing--s"},$padding:{left:"$spacing",right:"$spacing",top:"$spacing",bottom:"$spacing"},"$selection-area-target":{fill:"$primary-green",strokeWidth:0,opacity:.2}},palettes:[{key:"categorical",colors:[["#a54343","#d76c6c","#ec983d","#ecc43d","#f9ec86","#cbe989","#70ba6e","#578b60","#79d69f","#26a0a7","#138185","#65d3da"]]},{key:"diverging",colors:[["#3d52a1","#3a89c9","#77b7e5","#b4ddf7","#e6f5fe","#ffe3aa","#f9bd7e","#ed875e","#d24d3e","#ae1c3e"]]},{key:"sequential",colors:[["rgb(180,221,212)","rgb(34, 83, 90)"]]}]},{component:K6,data:e8,formatter:I2,interaction:t8,renderer:Y6(),scale:P3,symbol:L4});cte.forEach(Kre.use),Gre.forEach(Kre.use),[].forEach(Kre.use);const Xre="qDimensionInfo/0",Jre="qMeasureInfo/0",Qre="x",Zre="y",eie=e=>({key:"bars",type:"box",data:{extract:{field:Xre,props:{start:0,end:{field:Jre}}}},settings:{major:{scale:Qre},minor:{scale:Zre},box:{maxWidthPx:8,fill:{fn:e}}}}),tie=e=>({key:"p",type:"point",data:{extract:{field:Xre,props:{y:{field:Jre}}}},settings:{x:{scale:Qre},y:{scale:Zre},shape:"circle",size:1,opacity:1,sizeLimits:{minPx:4,maxPx:4},fill:{fn:e}},preferredSize:{edgeBleed:{left:2,right:2,top:2,bottom:2}}}),nie=({qNum:e})=>void 0===e?0:Math.sign(e),rie=(e,t)=>{const{primary:n,nil:r,others:i}=e.getDataColorSpecials(),o=Xh(e,t?.negative,n),a=Xh(e,t?.positive,n);return{key:"pos-neg",type:"box",data:{extract:{field:Xre,props:{start:0,end:{field:Jre,value:nie}}}},settings:{major:{scale:Qre},minor:{scale:Zre},box:{maxWidthPx:8,fill:{fn:e=>-2===e.datum.value?r:-3===e.datum.value?i:0===e.datum.end.value?"#DDDDDD":Math.sign(e.datum.end.value)<0?o:a}}}}},iie=(e,{type:t,showDots:n,colors:r,colorMin:i,colorMax:o})=>{const a=((e,t,n,r)=>{const{primary:i,nil:o,others:a}=e.getDataColorSpecials(),s=Xh(e,t?.main,i),l=Xh(e,t?.max,s),c=Xh(e,t?.min,s),u=Xh(e,t?.first,s),d=Xh(e,t?.last,s);return e=>{const t=Zre in e.datum?Zre:"end";return-2===e.datum.value?o:-3===e.datum.value?a:e.datum[t].value>=r?l:e.datum[t].value<=n?c:e.data.items.at(0)===e.datum?u:e.data.items.at(-1)===e.datum?d:s}})(e,r,i,o);switch(t){case"bars":return[eie(a)];case"dots":return[tie(a)];case"sparkline":{const t=(e=>({key:"lines",type:"line",data:{extract:{field:Xre,props:{v:{field:Jre}}}},settings:{coordinates:{major:{scale:Qre},minor:{scale:Zre,ref:"v"}},layers:{line:{strokeWidth:1,stroke:e}}}}))(Xh(e,r?.main,e.getDataColorSpecials().primary));return n?[t,tie(a)]:[t]}case"posNeg":return[rie(e,r)];default:return[]}},oie=e=>({qDimensionInfo:[{qFallbackTitle:"",qCardinal:1}],qMeasureInfo:[{qFallbackTitle:""}],qDataPages:[{qArea:{qTop:0,qLeft:0,qHeight:e.length,qWidth:2},qMatrix:e}],qEffectiveInterColumnSortOrder:[0,1],qSize:{qcx:2,qcy:e.length},qMode:"S"}),aie=(e,t,n,r)=>({y:{data:{field:Jre},invert:!0,min:"posNeg"===e?-1:t,max:"posNeg"===e?1:n},x:{data:{extract:{field:Xre}},paddingInner:.3,paddingOuter:0,invert:"rtl"===r,align:"rtl"===r?1:0,maxPxStep:12}}),sie=Kre();sie.use(IQ),sie.renderer.prio(["canvas"]);const lie={resolve:()=>{},promise:{}},cie=({chart:e,element:t,theme:n,isSnapshot:r,direction:i,miniChartData:o,downloadService:a})=>{const{resolveChartPromise:s,addChartPromiseToQueue:l}=(e=>{const t=Yt.useRef(e.isDownloadedAsPDForImage?Oe():lie);return{addChartPromiseToQueue:Yt.useCallback(()=>{e.waitForPromise(t.current.promise)},[e]),resolveChartPromise:t.current.resolve}})(a),c=Yt.useRef(null),u=Yt.useCallback(()=>{null!==t.current&&null===e.current&&(l(),c.current=(e=>{const t=performance.now();if(t-zX>50&&(zX=t,FX=0),FX+=1,0===$X&&FX<=20)return e(),()=>{};$X+=1;let n=!1;const r=()=>{n||(n=!0,$X-=1)},i=LX(()=>{r(),e()},{timeout:2e3});return()=>{jX(i),r()}})(()=>{c.current=null,t.current&&(e.current=(({element:e,theme:t,isSnapshot:n,miniChartData:r,onChartRendered:i,direction:o})=>{const{type:a,qMatrix:s,minY:l,maxY:c}=r;return sie.chart({element:e,data:{type:"q",key:"qHyperCube",data:oie(s)},settings:{scales:aie(a,l,c,o),components:iie(t,r),strategy:n?{size:{width:e.offsetWidth,height:e.offsetHeight}}:void 0},mounted:()=>{i()}})})({element:t.current,theme:n,isSnapshot:r,miniChartData:o,direction:i,onChartRendered:s}))}))},[t,e,l,n,r,o,i,s]);return{renderChartWithRequestIdleCallback:u,safeCancelIdleCallback:Yt.useCallback(()=>{c.current?.(),c.current=null,s()},[s])}},uie=e=>{const t=Yt.useRef(null),n=Yt.useRef(!1);return Yt.useCallback(r=>{const i=r.contentBoxSize.at(0)?.inlineSize??0;(e=>{e.current&&(jX(e.current),e.current=null)})(t),n.current?0!==i?null!==e.current&&(t.current=LX(()=>{e.current?.update()},{timeout:2e3})):n.current=!1:n.current=!0},[e])},die=({intersectionObserverTaskScheduler:e,resizeObserverTaskScheduler:t,theme:n,isSnapshot:r,miniChartData:i,downloadService:o,direction:a})=>{const s=Yt.useRef(null),l=Yt.useRef(null),{renderChartWithRequestIdleCallback:c,safeCancelIdleCallback:u}=cie({element:s,chart:l,theme:n,isSnapshot:r,direction:a,miniChartData:i,downloadService:o});return(({element:e,intersectionObserverTaskScheduler:t,safeCancelIdleCallback:n,renderChartWithRequestIdleCallback:r,chart:i})=>{const o=Yt.useCallback(e=>{e.isIntersecting?r():n()},[r,n]);Yt.useEffect(()=>{if(!e.current||!t)return()=>{};const r=e.current;return t.addTask(r,o),()=>{t.removeTask(r),n(),i.current?.destroy(),i.current=null}},[i,e,t,n,o])})({element:s,intersectionObserverTaskScheduler:e,safeCancelIdleCallback:u,renderChartWithRequestIdleCallback:c,chart:l}),(({renderChartWithRequestIdleCallback:e,safeCancelIdleCallback:t,chart:n,intersectionObserverTaskScheduler:r})=>{Yt.useEffect(()=>r?()=>{}:(e(),()=>{t(),n.current?.destroy(),n.current=null}),[r,t,e,n])})({intersectionObserverTaskScheduler:e,safeCancelIdleCallback:u,renderChartWithRequestIdleCallback:c,chart:l}),(({element:e,chart:t,resizeObserverTaskScheduler:n})=>{const r=uie(t);Yt.useEffect(()=>{const t=e.current;return t?(n.addTask(t,r),()=>{n.removeTask(t)}):()=>{}},[e,r,n])})({element:s,chart:l,resizeObserverTaskScheduler:t}),s},pie=({height:e,intersectionObserverTaskScheduler:t,resizeObserverTaskScheduler:n,theme:r,isSnapshot:i,miniChartData:o,downloadService:a,direction:s})=>{const l=die({intersectionObserverTaskScheduler:t,resizeObserverTaskScheduler:n,theme:r,isSnapshot:i,miniChartData:o,downloadService:a,direction:s});return lt.jsx("div",{"data-testid":"picasso-container",ref:l,style:{position:"relative",width:"100%",height:e,overflow:"hidden"}})},fie=e=>{let t="center",n="center";return"flex-start"===e?.vertical?t="top":"flex-end"===e?.vertical&&(t="bottom"),"flex-start"===e?.horizontal?n="left":"flex-end"===e?.horizontal&&(n="right"),`${n} ${t}`},hie=e=>{switch(e){case"alwaysFit":return"contain";case"fill":return"fill";case"fitHeight":case"fitWidth":return"cover";case"originalSize":return"none";default:return}},mie=({representation:e,textStyle:t,maxImageHeight:n,wrapInContainer:r})=>{const i=_g(my),{url:o,text:a,imageSize:s,resolvedImagePosition:l}=e,c="fitHeight"===s,u=lt.jsx("img",{src:o,alt:a,style:{...t,width:c?"auto":"100%",height:"100%",maxHeight:n,objectFit:hie(s),objectPosition:fie(l),overflow:"hidden"}});return r?lt.jsx("div",{"data-key":"image-horizontal-container",style:{width:"100%",height:c?n:"100%",overflow:"hidden",display:"flex",justifyContent:c?JH(i,e):void 0},children:u}):u},gie=({size:e,iconKey:t,color:n,pvStyle:r})=>{const i=t&&HH[t];return i&<.jsx("div",{"data-testid":"representation-indicator-icon",style:{color:n,height:e,...r},children:lt.jsx(i,{style:{height:e}})})},yie=({representation:e,cellValue:t,paginationCellAlign:n})=>{const r=_g(MU),i=_g(my),o=_g(Py),{text:a,indicator:s}=e,{showTextValues:l,applySegmentColors:c}=s??{},u=VH(e,t,i,o),d=(e=>parseInt(e||GH,10))(r.measure.values.fontSize),{color:p,iconKey:f,position:h}=u||{};return l?lt.jsxs("div",{"data-key":"representation-indicator",style:{display:"flex",justifyContent:n??"flex-end",alignItems:"center",gap:"2px",overflow:"hidden",color:c?p:void 0},children:["left"===h&&gie({size:d,iconKey:f,color:p}),lt.jsx(kK,{isNumeric:!0,children:a}),"right"===h&&gie({size:d,iconKey:f,color:p})]}):gie({size:d,iconKey:f,color:p})},bie=(e,t,n)=>e.contentStaticLineCount?t*(n??e.grid.contentLineClamp):t,vie=({forwardRef:e,cell:t,style:n,virtualizedCell:r,lineClamp:i,intersectionObserverTaskScheduler:o,resizeObserverTaskScheduler:a,paginationCellAlign:s})=>{const l=_g(MU),c=_g(AU),u=_g(Tg),d=_g(Yg),p=_g(Py),f=_g(my),h=_g(sy),m=_g(iy);if(t.representation.type===t$.Image&&!t.representation.url?.trim())return null;if(t.representation.type===t$.Image)return lt.jsx(mie,{representation:t.representation,textStyle:n,maxImageHeight:bie(l,c,i),wrapInContainer:!r});const g=nH(t.qIsNull?t.representation.text:t.qNum);let y=t.representation;if(t.qIsNull&&t.isNumeric&&!Number.isNaN(g)){const e=t.formattedNullValueText??zW(g,t.qNumFormat,t.qIsAutoFormat);y={...t.representation,text:e}}let b=y.text;return t.representation.type!==t$.Link||m||t.isNull||(b=lt.jsx(qX,{href:t.representation.url,text:t.representation.text,interactions:h,color:n.cellForegroundColor})),t.representation.type!==t$.Indicator||Number.isNaN(g)?t.representation.type===t$.MiniChart&&t.representation.miniChart&&!t.isNull?lt.jsx(pie,{height:bie(l,c,i),intersectionObserverTaskScheduler:o,resizeObserverTaskScheduler:a,miniChartData:t.representation.miniChart,theme:p,isSnapshot:!!d.snapshotData,direction:f,downloadService:u}):t.representation.type===t$.Bar&&t.representation.bar&&!t.isNull?lt.jsx(DX,{height:bie(l,c,i),bar:t.representation.bar,theme:p,direction:f,fontFamily:l.measure.values.fontFamily,fontSize:n.fontSize??l.measure.values.fontSize}):lt.jsx(kK,{forwardRef:e,isDual:t.isDual,isNumeric:t.isNumeric,lineClamp:i,isPagination:!r,children:b}):lt.jsx(yie,{representation:y,cellValue:g,paginationCellAlign:r?void 0:s})},xie=e=>{const t=lt.jsx(vie,{...e});return e.indentation?lt.jsx(xK,{indentation:e.indentation,isFlex:!!e.virtualizedCell,justifyContent:e.justifyContent,children:t}):t},wie=()=>lt.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",width:"0.75em",height:"0.75em",children:lt.jsx("path",{d:"M6,10 L13,3 L15,5 L8,12 L6,14 L1,9 L3,7 L6,10 Z"})}),Sie=Ul("div")({"& path":{stroke:"none !important"}}),kie=({children:e,cellSelectionState:t,hideTickIcon:n})=>t!==YB.Selected||n?e:lt.jsxs(wK,{children:[e,lt.jsx(Sie,{children:lt.jsx(wie,{})})]}),Cie=e=>{const t=function(){const e=AL(),t=dL(()=>null==e?void 0:e.dragOperation.source,[e]),n=dL(()=>null==e?void 0:e.dragOperation.target,[e]);return{get source(){return t.value},get target(){return n.value}}}();return t.source&&t.source.id!==e?.5:1},Eie=(e,t,n,r)=>({handleMouseDown:r=>{e?.(r);const i=r.target;if(t.isSelectable&&"A"!==i.tagName){const e=()=>{n({type:KB.SelectMultiEnd})};n({type:KB.SelectMouseDown,payload:{cell:t,mouseupOutsideCallback:e}})}},handleMouseOver:e=>{1===e.buttons&&n({type:KB.SelectMultiAdd,payload:{cell:t,evt:e,announce:r}})},handleMouseUp:e=>{0===e.button&&n({type:KB.SelectMouseUp,payload:{cell:t,evt:e,announce:r}})}}),Mie=e=>{const t=_g(gU),n=_g(uU),r=_g(uX),i=_g(_y),o=_g(my),a=Ag(aX),s=Ag(VY),l=_g(wy),c=_g(uy),u=_g(oy),d=d=>{gX({evt:d,rootElement:i,selectionsAPI:u,cell:e,selectionDispatch:s,isSelectionsEnabled:c,setFocusedCellCoord:a,announce:r,keyboard:l,paginationNeeded:t,totalsPosition:n,direction:o})},p=e=>{((e,t)=>{e.key===Em.Shift&&t({type:KB.SelectMultiEnd})})(e,s)},f=()=>{((e,t,n,r,i)=>{const{pageRowIdx:o,pageColIdx:a}=e,s=i.atTop?o+2:o+1;lK([s,a],t,n,r)})(e,i,a,l,n)};if(!c)return{onKeyDown:d,onKeyUp:p,onMouseDown:f};const{handleMouseDown:h,handleMouseOver:m,handleMouseUp:g}=Eie(f,e,s,r);return{onKeyDown:d,onKeyUp:p,onMouseDown:h,onMouseUp:g,onMouseOver:m}},Rie=e=>{Yt.useEffect(()=>()=>{WY.remove(e)},[e])},_ie=(e,t,n,r)=>{if(!n.isNull)return e;const i=r?t.dimensionNull:t.measureNull,o={...e,...i};if(!t.grid.zebraStripes.show)return o;const a=r?t.grid.zebraStripes.overrideDimNullValueColor:t.grid.zebraStripes.overrideMeasNullValueColor,s=r?t.grid.zebraStripes.overrideDimNullValueBackground:t.grid.zebraStripes.overrideMeasNullValueBackground;return a&&(o.color=e.color),s&&(o.background=e.background),o},Aie=(e,t,n)=>{const{color:r,background:i}=e.grid.zebraStripes[n];return{...t,...r?{color:r}:void 0,...i?{background:i}:void 0}},Iie=(e,t,n)=>{if(t.grid.zebraStripes.show){const r=(n.rowIdx+1)%2==0;return Aie(t,e,r?"even":"odd")}return e},Pie=(e,t)=>{const n=_g(MU),r=_g(WY(e)),i=_g(Wg),o=e.isTotalRow&&i("TLV-2303-SUB-TOTALS");Rie(e);let a=t.isDim?n.dimension.values:n.measure.values;a=Iie(a,n,e),a=o?n.subTotalRow:a,a=_ie(a,n,e,t.isDim);const s=e.isNull||o&&t.isDim?a:CV(a,e.qAttrExps,t.qAttrExprInfoIDs),l=o?s:function(e,t,n){return t===YB.Selected?{...e,...n}:t===YB.Disabled?{...e,background:`${WH}, ${e.background}`}:e}(s,r,n.selectedColors);return{cellStyle:{...l,borderColor:n.grid.border},representationStyle:s,indentation:EV(e,t,i),cellSelectionState:r}},Tie=Ul(uh,{shouldForwardProp:e=>"lastRowBottomBorder"!==e})(({lastRowBottomBorder:e})=>({"& tr:last-child":{"& td, th":{borderBottomWidth:e}}})),Die=Ul(Ph,{shouldForwardProp:e=>"hoverColors"!==e&&"hover"!==e&&"height"!==e})(({hover:e,hoverColors:t,height:n})=>({height:n,"&&:hover":{background:"none"},...e&&{"&&:hover":{"& td:not(.selected), th:not(.selected)":t}}})),Oie=Ul(mh,{shouldForwardProp:e=>"cellStyle"!==e})(({cellStyle:e,theme:t})=>({...XH,...e,padding:t.spacing(.5,1.5),verticalAlign:"top",boxSizing:"border-box",width:"100%",height:"100%"})),Nie=Ul(mh,{shouldForwardProp:e=>!["atTop","headRowHeight","totalsStyle","direction"].includes(e)})(({totalsStyle:e,atTop:t,headRowHeight:n,theme:r})=>({...XH,...e,fontWeight:YH,position:"sticky",padding:r.spacing(.5,1.5),borderWidth:t?"0px 1px 1px 0px":"1px 1px 1px 0px",top:t?n:void 0,bottom:t?void 0:0,verticalAlign:t?"bottom":"top",boxSizing:"border-box",zIndex:t?1:void 0})),qie=({cell:e,column:t,columnIndex:n,intersectionObserverTaskScheduler:r,resizeObserverTaskScheduler:i})=>{const o=_g(my),a=_g(sy),{onKeyDown:s,onKeyUp:l,onMouseDown:c,onMouseUp:u,onMouseOver:d}=Mie(e),{cellStyle:p,representationStyle:f,indentation:h,cellSelectionState:m}=Pie(e,t),g=Cie(t.id);return lt.jsx(Oie,{cellStyle:{...p,opacity:g},scope:0===n?"row":void 0,component:0===n?"th":void 0,align:e.align,tabIndex:-1,className:`sn-table-cell ${m} ${Cm}`,title:a.passive?e.representation.text:void 0,onKeyDown:s,onKeyUp:l,onMouseDown:c,onMouseUp:u,onMouseOver:d,children:lt.jsx(kie,{cellSelectionState:m,hideTickIcon:!!e.isTotalRow,children:lt.jsx(xie,{cell:e,style:f,indentation:h,intersectionObserverTaskScheduler:r,resizeObserverTaskScheduler:i,paginationCellAlign:eV(o,e.align)})})})},Lie=gg(0),jie=({column:e,totalsPosition:t,onKeyDown:n,onMouseDown:r})=>{const i=_g(MU),o=_g(cy),a=_g(Lie),s=Cie(e.id);return lt.jsx(Nie,{totalsStyle:{...i.totalRow,...YY(i,t,!1),opacity:s},headRowHeight:a,atTop:t.atTop,align:e.totalsTextAlign,className:`sn-table-cell ${Cm}`,tabIndex:-1,title:o?e.totalInfo:void 0,onKeyDown:n,onMouseDown:r,children:lt.jsx(kK,{isNumeric:e.isTotalNumeric,isPagination:!0,children:e.totalInfo})},e.id)},zie=()=>{const e=_g(uU),t=_g(dU),n=_g(fU),r=_g(_y),i=_g(ly),o=_g(my),a=Ag(aX),s=_g(iy),l=_g(wy);return lt.jsx(Ph,{className:"sn-table-row sn-table-totals-row",children:t.map((t,c)=>{const u=[e.atTop?1:n.length+1,c];return lt.jsx(jie,{column:t,totalsPosition:e,onKeyDown:e=>{(e=>{const{isSelectionMode:t,evt:n,isInteractionEnabled:r}=e;if(!t&&r)switch(n.key){case Em.C:pX(n);break;case Em.Space:n.preventDefault();break;default:fX(e)}else Zh(n)})({evt:e,rootElement:r,cellCoord:u,setFocusedCellCoord:a,isSelectionMode:s,isInteractionEnabled:i,direction:o})},onMouseDown:()=>{lK(u,r,a,l)}},t.id)})})};var Fie=Yt.memo(zie);const $ie=({updateShouldRefocus:e,tableWrapperRef:t})=>{const n=_g(fU),r=_g(uU),i=_g(dU),o=_g(MU),a=_g(IU),s=_g(PU),l=_g(Yg),c=!!wV(l)?.content?.hoverEffect;EX({updateShouldRefocus:e,tableWrapperRef:t});const u=(e=>{const t=Yt.useCallback(t=>new IntersectionObserver(e=>{e.forEach(e=>{const n=t.get(e.target);n?.(e)})},{root:e.current}),[e]);return SX(t)})(t),d=CX();return lt.jsxs(Tie,{lastRowBottomBorder:o.grid.lastRowBottomBorder,children:[r.atTop?lt.jsx(Fie,{}):void 0,n.map((e,t)=>{const n=e.at(0)?.isTotalRow??!1;return lt.jsx(Die,{hoverColors:o.grid.hoverColors,hover:c,tabIndex:-1,className:"sn-table-row sn-table-data-row",height:n?s:a,children:i.map((t,n)=>{const{id:r}=t,i=e[n];return lt.jsx(qie,{columnIndex:n,cell:i,column:t,intersectionObserverTaskScheduler:u,resizeObserverTaskScheduler:d},r)})},`row-${t}`)}),r.atBottom?lt.jsx(Fie,{}):void 0]})};var Bie=Yt.memo($ie);const Hie=(e,t)=>!!e?.skipHeader||!!t.hideHeader,Vie=gg(e=>{const t=e(Yg),n=e(Sy);if(n)return(e,{isDim:r,colIdx:i})=>{const o=r?i:i-t.qHyperCube.qDimensionInfo.length,a=`/qHyperCubeDef/${r?"qDimensions":"qMeasures"}/${o}/qDef/columnWidth`,s=t.qHyperCube[r?"qDimensionInfo":"qMeasureInfo"].at(o)?.columnWidth,l=s?{qPath:a,qOp:"Replace",qValue:JSON.stringify({...s,...e})}:{qPath:a,qOp:"Add",qValue:JSON.stringify(e)};n.applyPatches([l],!0)}}),Wie=({column:e,isLastColumn:t,onColumnResize:n,setIsAdjustingWidth:r})=>{const{pageColIdx:i,label:o}=e,a=_g(Vie),s=_g(my),l=_g(ly),c=_g(Ty),[u,d]=Ig(qU);if(!l)return null;return lt.jsx(WU,{columnWidth:u.at(i)??0,isLastColumn:t,keyValue:`adjuster-${i}`,updateWidthCallback:e=>{n?.();const t=[...u];t[i]=e,d(t)},confirmWidthCallback:t=>{a?.(t,e)},handleBlur:e=>{(e=>{rK(e);const t=e.closest(".sn-table-cell");oK(t)})(e.currentTarget)},setIsAdjustingWidth:r,accessibilityRelatedArgs:{translator:c,columnLabel:o},direction:s})},Uie=e=>e.target?.getAttribute("class")?.includes(Mm),Gie=({isInteractionEnabled:e,column:t})=>{const[n,r]=Yt.useState(!1),i=_g(KY),o=_g(uV);return{open:n,setOpen:r,handleOpenMenu:t=>{!e||Uie(t)||o||r(!0)},toggleSortOrder:n=>{e&&!Uie(n)&&!o&&(e=>null!==e.target.closest(".sn-table-cell"))(n)&&(n.stopPropagation(),i?.(t,"A"===t.sortDirection?"D":"A"))}}};var Yie=class extends RT{constructor(e,t){super(e,t),this.boundingRectangle=I_(null),this.destroy=F_(()=>{if(!this.options)return;const{dragOperation:t}=e,{status:n}=t;if(n.initialized){const{element:e}=this.options,n="function"==typeof e?e(t):e;if(!n)return;let r;const i=()=>{this.boundingRectangle.value=$T(n)},o=()=>{r||(r=setTimeout(()=>{i(),r=void 0},25))},a=new ResizeObserver(i);return a.observe(n),document.addEventListener("scroll",o,{passive:!0,capture:!0}),()=>{document.removeEventListener("scroll",o,{capture:!0}),a.disconnect(),this.boundingRectangle.value=null}}})}apply(e){const{shape:t,transform:n}=e;if(!t)return n;const r=this.boundingRectangle.value;if(!r)return n;const{initial:i,current:o}=t,{height:a,width:s}=o.boundingRectangle,l=i.center.x-s/2,c=i.center.y-a/2,u=function(e,t,n){const r=mj({},t);return e.boundingRectangle.top+t.y<=n.top?r.y=n.top-e.boundingRectangle.top:e.boundingRectangle.bottom+t.y>=n.top+n.height&&(r.y=n.top+n.height-e.boundingRectangle.bottom),e.boundingRectangle.left+t.x<=n.left?r.x=n.left-e.boundingRectangle.left:e.boundingRectangle.right+t.x>=n.left+n.width&&(r.x=n.left+n.width-e.boundingRectangle.right),r}(new aI(l,c,s,a),n,r);return u}};Yie.configure=VI(Yie);const Kie=({invert:e})=>({dragOperation:t,droppable:n})=>{if(!n.shape)return null;const{shape:r}=t;if(!r)return null;const i=function(e){return e.sortable?.index}(n);if(void 0===i)return null;const o=function(e){return e.source.index}(t);if(void 0===o)return null;if(o===i)return null;const a=o<i!==e?"right":"left",{center:s,boundingRectangle:l}=r.current;return"left"===a&&l.left+.3*l.width<=n.shape.center.x||"right"===a&&l.right-.3*l.width>=n.shape.center.x?{id:n.id,value:1/oI.distance(n.shape.center,s),type:tT.Collision,priority:eT.Normal}:null},Xie=[Yie.configure({element:e=>{const t=e.activatorEvent?.target;return t instanceof HTMLElement?t.closest(".sn-table-head-row"):null}})],Jie=(e,t)=>{const n=_g(my),r=!_g(py);return Tz({id:e.id,disabled:r,index:t,type:"item",accept:"item",group:"column",modifiers:Xie,data:e,plugins:e=>[...e,tq.configure({feedback:"clone"})],collisionDetector:Kie({invert:"rtl"===n})})},Qie=({column:e,columnIndex:t,columnsLength:n})=>{const r=_g(MU),i=_g(_y),o=_g(my),a=_g(sy),s=_g(dU),l=_g(uU),c=_g(qU)[t],u=Ag(aX),d=_g(sX(t)),p=_g(py),f=_g(wy),{open:h,setOpen:m,handleOpenMenu:g,toggleSortOrder:y}=Gie({isInteractionEnabled:p,column:e}),b=Ag(uV),{ref:v,isDragging:x}=Jie(e,t),w=Cie(e.id),S=_g(ny),k=S?CK:WK,C=e.isActivelySorted?XB[e.sortDirection]:void 0,E=h?km:void 0,M=h?"true":void 0,R=t===n-1,_=[0,e.pageColIdx],A={width:c,zIndex:s.length-t},I=d&&0===t&&!f.enabled&&p?0:-1;return lt.jsxs(pK,{"data-dragging":x,ref:v,headerStyle:{...r.header,...YY(r,l,!0),opacity:w},background:S&&h?e.headerColor?.headerMenuActiveBackground??r.headerMenuActiveBackground:e.headerColor?.background??r.header.background,hoverBackground:e.headerColor?.headerMenuHoverBackground??r.headerMenuHoverBackground,color:e.headerColor?.color??r.header.color,interactions:a,style:A,align:e.headTextAlign,className:`sn-table-head-cell sn-table-cell ${Cm}`,tabIndex:I,title:a.passive?e.label:void 0,onKeyDown:e=>{(e=>{const{isInteractionEnabled:t,evt:n,handleOpenMenu:r}=e;if(t)switch(n.key){case Em.C:pX(n);break;case Em.Enter:case Em.Space:r?.(n);break;default:fX(e)}else Zh(n)})({evt:e,rootElement:i,cellCoord:_,setFocusedCellCoord:u,isInteractionEnabled:p,handleOpenMenu:g,direction:o})},onMouseDown:e=>{(({evt:e,rootElement:t,cellCoord:n,setFocusedCellCoord:r,keyboard:i,isInteractionEnabled:o})=>{e.preventDefault(),o&&lK(n,t,r,i)})({evt:e,rootElement:i,cellCoord:_,setFocusedCellCoord:u,keyboard:f,isInteractionEnabled:p})},onClick:S?g:y,"aria-sort":C,"aria-controls":E,"aria-expanded":M,"aria-haspopup":"true",children:[lt.jsx(k,{column:e,isInteractionEnabled:p,open:h,setOpen:m,isPagination:!0,columnWidth:c}),lt.jsx(Wie,{column:e,isLastColumn:R,setIsAdjustingWidth:b})]},e.id)},Zie=()=>{const e=_g(dU),t=_g(MU),n=_g(Yg),r=_g(yy),i=Ag(Lie),o=_g(qU),a=Yt.useRef(null),s=Hie(r,n);return Yt.useEffect(()=>{a.current&&i(a.current.getBoundingClientRect().height)},[t.header.fontSize,o,i,s]),lt.jsx(Eh,{style:{visibility:s?"collapse":void 0},children:lt.jsx(gK,{ref:a,className:"sn-table-row sn-table-head-row",children:e.map((t,n)=>lt.jsx(Qie,{column:t,columnIndex:n,columnsLength:e.length},t.id))})})};var eoe=Yt.memo(Zie);const toe=()=>{const e=_g(uX),[t,n]=Ig(tU),{page:r,rowsPerPage:i}=t,o=_g(gy),{totalColumnCount:a,totalRowCount:s,totalPages:l,paginationNeeded:c,rows:u,columns:d}=_g(cU),p=_g(MU),f=_g(yW),h=_g(Yg),m=_g(Py),g=_g(Ry),y=_g(_y),b=_g(yy),v=_g(my),x=_g(sy),w=_g(Ty),S=_g(UY),k=Ag(VY),C=_g(iy),E=_g(wy),M=Yt.useRef(!1),R=Yt.useRef(null),_=Yt.useRef(null),A=`${w.get("SNTable.Accessibility.RowsAndColumns",[String(u.length),String(d.length)])} ${w.get("SNTable.Accessibility.NavigationInstructions")}`,I=fy(h,b),P=I?f.scrollLeft??0:0,T=I?f.rowPartialHeight??0:0,D=Yt.useCallback(()=>{M.current=y.getElementsByTagName("table")[0].contains(document.activeElement)},[y]),O=Yt.useCallback(r=>{n({...t,page:r}),e({keys:[["SNTable.Pagination.PageStatusReport",(r+1).toString(),l.toString()]],politeness:"assertive"})},[t,n,l,e]),N=Yt.useCallback(r=>{n({...t,page:0,rowsPerPage:r}),e({keys:[["SNTable.Pagination.RowsPerPageChange",r.toString()]],politeness:"assertive"})},[e,t,n]);return(e=>{const t=_g(my),n=_g(yW);Yt.useEffect(()=>{const r=e.current;if(!r)return;const i=e=>{((e,t,n)=>{if(0===e.deltaX)return;e.stopPropagation();const r=n.scrollWidth-n.offsetWidth,{scrollLeft:i}=n;let o=i+e.deltaX;t&&(o=r+o),r>0&&(o<0||o>r+1)&&e.preventDefault()})(e,"rtl"===t,r)},o=e=>{n.scrollLeft=e.currentTarget?.scrollLeft||0};return r.addEventListener("wheel",i),r.addEventListener("scroll",o),()=>{r.removeEventListener("wheel",i),r.removeEventListener("scroll",o)}},[e,t,n])})(R),oX(_,M),(()=>{const e=_g(_y),t=_g(wy),n=_g(aX);gm(()=>{const r=tK(e,n);t.active?oK(r):(r?.blur(),iK(e))},[t.active,e])})(),dX(M,r),Yt.useEffect(()=>{const e=R.current;e&&(e.scrollLeft=P,e.scrollTop=T)},[t,s,P,T]),iX(()=>{k({type:KB.UpdatePageRows,payload:{pageRows:u}})},[u]),lX(),yX(R),lt.jsxs(rX,{children:[lt.jsxs(bK,{ref:_,dir:v,onKeyDown:e=>{mX({evt:e,totalRowCount:s,page:r,rowsPerPage:i,handleChangePage:O,updateShouldRefocus:D,keyboard:E,isSelectionMode:C})},"data-testid":"sn-table",children:[lt.jsx(wX,{}),lt.jsxs(vX,{ref:R,className:"sn-table-container",fullHeight:!!o||!x.active||!c,interactions:x,tabIndex:-1,role:"application","data-testid":"table-container",children:[lt.jsxs(xX,{stickyHeader:!0,"aria-label":A,borderRight:S?`1px solid ${p.grid.border}`:void 0,children:[lt.jsx(eoe,{}),lt.jsx(Bie,{updateShouldRefocus:D,tableWrapperRef:_})]}),lt.jsx(GY,{})]}),lt.jsx(PY,{footerContainer:o,pageInfo:t,paginationNeeded:c,theme:m,totalRowCount:s,totalColumnCount:a,totalPages:l,keyboard:E,translator:w,interactions:x,rect:g,layout:h,handleChangePage:O,handleChangeRowsPerPage:N,isSelectionMode:C,direction:v})]}),lt.jsx(KK,{isPagination:!0})]})};var noe=Yt.memo(toe);const roe=gg(0),ioe=gg(e=>{const t=e(Kg);return Math.min(MV,t)}),ooe=gg(e=>{const t=e(Kg);return t===MV?0:Math.floor(t/MV)}),aoe=gg(e=>{const t=e(roe),n=e(ooe);return Math.min(t,n)}),soe=gg(e=>({page:e(aoe),rowsPerPage:e(ioe),rowsPerPageOptions:[]}),(e,t,n)=>{const r=e(ooe);t(roe,Math.max(0,Math.min(n,r)))}),loe=gg(null),coe=gg(null),uoe=gg(e=>{const t=e(soe),n=e(Kg);return Math.min(t.rowsPerPage,n-t.page*t.rowsPerPage)}),doe=gg(null),poe=gg(null),foe=gg(e=>e(uU).atTop?2:1),hoe=gg(e=>e(uU).atTop?1:e(foe)+e(uoe)),moe=gg(e=>eK(Boolean(e(iy)),e(uU))),goe=gg(e=>({firstBodyRowIdx:e(foe),totalsRowIdx:e(hoe),allowedRows:e(moe)})),yoe=gg(e=>({rootElement:e(_y),totalsPosition:e(uU),rowCount:e(uoe),colCount:e(pU),columnWidths:e(qU)})),boe=gg(e=>({scrollToCell:e(doe),scrollableContainerElement:e(poe)})),voe=gg(e=>({keyboard:e(wy),isInSelectionMode:e(iy),selectionsAPI:e(oy),isSelectionsEnabled:e(uy)})),xoe=gg(e=>({direction:e(my),isInteractionEnabled:e(py),paginationNeeded:e(gU),announce:e(uX),shouldRefocusRef:e(loe)})),woe=10,Soe=e=>e.atTop?2:1,koe=(e,[t,n],r,i)=>{const o=Soe(r);if(0===t)return e.querySelector(`.sn-table-head-row [data-col="${n}"]`);if(r.atTop&&1===t)return e.querySelector(`.sn-table-totals-row [data-col="${n}"]`);const a=t-o;return a>=0&&a<i?e.querySelector(`.sn-table-body .sn-table-cell[rowindex="${a}"][columnindex="${n}"]`):e.querySelector(`.sn-table-totals-row [data-col="${n}"]`)},Coe=(e,t,n,r,i,o,a,s,l)=>{if(!e)return l(!1),()=>{};const[c,u]=n,d=c-Soe(r),p=d>=0&&d<i;let f=a,h=!1,m=null;const g=()=>h||s&&!s(),y=()=>{g()||(p&&e(d,u),m=requestAnimationFrame(()=>{if(g())return;const e=((e,t)=>{if(!e||!t)return!1;const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top>=r.top&&n.bottom<=r.bottom&&n.left>=r.left&&n.right<=r.right})(koe(t,n,r,i),o);if(!e)return f>0?(f-=1,void y()):void l(!1);l(!0)}))};return y(),()=>{h=!0,null!==m&&cancelAnimationFrame(m)}},Eoe=(e,t,n,r,i,o)=>e<o?[t,e+1]:t<r?[t+1,i]:[t,e],Moe=(e,t,n,r,i,o)=>e>i?[t,e-1]:t>n?[t-1,o]:[t,e],Roe=(e,[t,n],r,i,o,a={top:0,bottom:0},s)=>{const l=a.top>0,c=a.top,u=r-1-a.bottom,d=i-1;switch(e.key){case Em.Down:case Em.Up:t=((e,t,n,r)=>e===Em.Down&&t<r?t+1:e===Em.Up&&t>n?t-1:t)(e.key,t,c,u);break;case Em.Right:l||([t,n]=((e,t,n,r,i,o,a)=>"rtl"===a?Moe(e,t,n,0,i,o):Eoe(e,t,0,r,i,o))(n,t,c,u,0,d,o));break;case Em.Left:l||([t,n]=((e,t,n,r,i,o,a)=>"rtl"===a?Eoe(e,t,0,r,i,o):Moe(e,t,n,0,i,o))(n,t,c,u,0,d,o));break;case Em.Home:l?t=Math.max(c,t-woe):(OY(e)&&(t=c),n=0);break;case Em.End:l?t=Math.min(u,t+woe):(OY(e)&&(t=u),n=d);break;case Em.PageDown:t=Math.min(u,t+woe);break;case Em.PageUp:if(l)t=Math.max(c,t-woe);else{const e=s?Soe(s):1,n=t-e;t=n>0&&n<=woe?e:Math.max(c,t-woe)}}return[t,n]},_oe=e=>{((e,t)=>{e.querySelectorAll(t).forEach(e=>{e.setAttribute("tabIndex","-1")})})(e,".sn-table-cell[tabindex='0']")},Aoe=[Em.Home,Em.End,Em.PageUp,Em.PageDown],Ioe=()=>{const e=Yt.useRef(!1),t=Yt.useRef(0),n=Yt.useRef(0),r=Yt.useRef(null),i=Yt.useRef(null),o=Yt.useRef(null),a=Yt.useRef(0),s=Ag(aX),l=Ag(VY),c=_g(Wg)("VNA-700-KEYBOARD_NAV_VIRTUALIZED_STRAIGHT_TABLE"),{rootElement:u,totalsPosition:d,rowCount:p,colCount:f,columnWidths:h}=_g(yoe),{firstBodyRowIdx:m,allowedRows:g,totalsRowIdx:y}=_g(goe),{scrollToCell:b,scrollableContainerElement:v}=_g(boe),{keyboard:x,isInSelectionMode:w,selectionsAPI:S,isSelectionsEnabled:k}=_g(voe),{direction:C,announce:E,isInteractionEnabled:M,paginationNeeded:R,shouldRefocusRef:_}=_g(xoe),A=Yt.useMemo(()=>(e=>{const t=new Array(e.length+1);t[0]=0;for(let n=0;n<e.length;n++)t[n+1]=t[n]+(e[n]??0);return t})(h),[h]);Yt.useEffect(()=>()=>{t.current+=1,n.current+=1,a.current+=1,r.current?.(),r.current=null,i.current?.(),i.current=null,o.current?.(),o.current=null},[]);const I=Yt.useCallback((e,t,n,r)=>{const i=t=>{if(r&&!r())return void n?.(!1);const o=koe(u,e,d,p);if(o)return document.activeElement!==o&&XY(o),document.activeElement===o?void n?.(!0):t>0?void requestAnimationFrame(()=>{i(t-1)}):void n?.(!1);t>0?requestAnimationFrame(()=>{i(t-1)}):n?.(!1)};requestAnimationFrame(()=>{i(t)})},[u,d,p]),P=Yt.useCallback((e,t)=>{const r=a.current+1;a.current=r;let o=0;const s=Date.now()+5e3,l=()=>{if(a.current!==r)return;if(n.current!==t)return;if(u instanceof HTMLElement&&!u.isConnected)return;if(Date.now()>s||o>=5)return;const c=document.activeElement;c&&c!==document.body&&c!==document.documentElement||(o+=1,_&&(_.current=!0),i.current?.(),i.current=Coe(b,u,e,d,p,v,10,()=>a.current===r&&n.current===t,()=>{I(e,300,()=>{_&&(_.current=!1)},()=>a.current===r&&n.current===t)})),requestAnimationFrame(()=>{requestAnimationFrame(l)})};requestAnimationFrame(()=>{requestAnimationFrame(l)})},[I,u,p,b,v,_,d]),T=Yt.useCallback(()=>(_&&(_.current=!0),t.current+=1,t.current),[_]),D=Yt.useCallback(()=>{t.current+=1,o.current?.(),o.current=null},[]),O=Yt.useCallback((e,n)=>{const r=i=>{t.current===e&&(o.current?.(),o.current=Coe(b,u,n,d,p,v,10,()=>t.current===e,()=>{if(t.current!==e)return;const o=koe(u,n,d,p);o&&document.activeElement!==o&&XY(o),i>0?requestAnimationFrame(()=>{r(i-1)}):t.current===e&&_&&(_.current=!1)}))};requestAnimationFrame(()=>{requestAnimationFrame(()=>{r(300)})})},[u,d,p,b,_,v]),N=Yt.useCallback((e,t)=>{if(!jY(e))return;Zh(e),D(),n.current+=1;const i=n.current;a.current+=1,r.current?.(),r.current=null;const o=((e,t)=>Soe(t)+e+(t.atBottom?1:0))(p,d),l=Roe(e,t,o,f,C,g,d);_oe(u),s(l);const[,c]=l,[,h]=t;return c!==h&&((e,t,n)=>{if(!e)return;const r=t[n]??0,i=t[n+1]??r,{scrollLeft:o,clientWidth:a}=e;r<o?e.scrollLeft=r:i>o+a&&(e.scrollLeft=i-a)})(v,A,c),_&&(_.current=!0),r.current=Coe(b,u,l,d,p,v,10,()=>n.current===i,()=>{I(l,300,t=>{_&&(_.current=!1),t&&(e=>Aoe.includes(e))(e.key)&&P(l,i)},()=>n.current===i)}),l},[u,d,p,f,C,b,s,g,v,_,I,D,A,P]),q=Yt.useCallback(e=>{e.key===Em.Esc?x.enabled&&!w&&(Zh(e),x.blur?.(!0)):qY(e.key)&&Zh(e)},[x,w]),L=Yt.useCallback((e,t,n)=>{switch(e.key){case Em.C:Zh(e),M&&(e.ctrlKey||e.metaKey)&&Om(e.currentTarget);break;case Em.Enter:case Em.Space:if(!M){Zh(e);break}n?.(e);break;default:N(e,[0,t])}},[N,M]),j=Yt.useCallback((t,r,i,o)=>{const a=[r+m,i];switch(t.key){case Em.Space:if(Zh(t),o.isSelectable&&k){e.current=!0;const n=T();l({type:KB.Select,payload:{cell:o,evt:t,announce:E}}),O(n,a)}break;case Em.Enter:if(Zh(t),e.current=!1,w){T(),s(QB),S?.confirm(),v&&(v.scrollTop=0,v.scrollLeft=0);const e=t=>{b?.(0,0),t>0&&requestAnimationFrame(()=>{e(t-1)})};e(10),n.current+=1;const t=n.current;I(QB,300,()=>{_&&(_.current=!1)},()=>n.current===t)}break;case Em.Esc:if(e.current=!1,w){Zh(t);const e=T();S?.cancel(),O(e,a)}break;case Em.C:Zh(t),M&&(t.ctrlKey||t.metaKey)&&Om(t.currentTarget);break;case Em.Tab:{const e=t.shiftKey||!R;x.enabled&&w&&e&&(Zh(t),Qh(t.currentTarget,x,t.shiftKey));break}default:{const n=t.key===Em.Left||t.key===Em.Right,r=w||Boolean(S?.isModal())||e.current;if(n&&r){Zh(t);break}const i=N(t,a);!!i&&i[0]!==a[0]&&t.shiftKey&&k&&o.isSelectable&&l({type:KB.SelectMultiAdd,payload:{cell:o,evt:t,announce:E}});break}}},[m,N,k,l,E,w,S,x,R,M,T,O,s,b,v,I,_]),z=Yt.useCallback(t=>{t.key===Em.Space&&(e.current=!1),t.key===Em.Shift&&l({type:KB.SelectMultiEnd})},[l]),F=Yt.useCallback((e,t)=>{if(w)Zh(e);else{if(e.key!==Em.Space)return e.key===Em.C?(Zh(e),void(M&&(e.ctrlKey||e.metaKey)&&Om(e.currentTarget))):void N(e,[y,t]);e.preventDefault()}},[w,N,y,M]),$=Yt.useCallback(e=>{D(),n.current+=1;const t=n.current;_oe(u),s(e),x.enabled&&x.focus?.(),I(e,2,n=>{n&&P(e,t)},()=>n.current===t)},[u,s,x,I,D,P]);return{handleWrapperKeyDown:q,handleHeadKeyDown:L,handleBodyKeyDown:j,handleBodyKeyUp:z,handleTotalsKeyDown:F,focusHeadCellOnClick:Yt.useCallback(e=>{c&&$([0,e])},[$,c]),focusBodyCellOnClick:Yt.useCallback((e,t)=>{c&&$([e+m,t])},[$,m,c]),focusTotalsCellOnClick:Yt.useCallback(e=>{c&&$([y,e])},[$,y,c])}};var Poe=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function Toe(e,t){return e===t||!(!Poe(e)||!Poe(t))}function Doe(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Toe(e[n],t[n]))return!1;return!0}function Ooe(e,t){var n;void 0===t&&(t=Doe);var r,i=[],o=!1;return function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return o&&n===this&&t(a,i)||(r=e.apply(this,a),o=!0,n=this,i=a),r}}var Noe="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function qoe(e){cancelAnimationFrame(e.id)}function Loe(e,t){var n=Noe();var r={id:requestAnimationFrame(function i(){Noe()-n>=t?e.call(null):r.id=requestAnimationFrame(i)})};return r}var joe=-1;function zoe(e){if(void 0===e&&(e=!1),-1===joe||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),joe=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return joe}var Foe=null;function $oe(e){if(void 0===e&&(e=!1),null===Foe||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;return i.width="100px",i.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?Foe="positive-descending":(t.scrollLeft=1,Foe=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),Foe}return Foe}var Boe=function(e){var t=e.columnIndex;return e.data,e.rowIndex+":"+t};function Hoe(e){var t,n=e.getColumnOffset,r=e.getColumnStartIndexForOffset,i=e.getColumnStopIndexForStartIndex,o=e.getColumnWidth,a=e.getEstimatedTotalHeight,s=e.getEstimatedTotalWidth,l=e.getOffsetForColumnAndAlignment,c=e.getOffsetForRowAndAlignment,u=e.getRowHeight,d=e.getRowOffset,p=e.getRowStartIndexForOffset,f=e.getRowStopIndexForStartIndex,h=e.initInstanceProps,m=e.shouldResetStyleCacheOnItemSizeChange,g=e.validateProps;return t=function(e){function t(t){var r;return(r=e.call(this,t)||this)._instanceProps=h(r.props,Mc(r)),r._resetIsScrollingTimeoutId=null,r._outerRef=void 0,r.state={instance:Mc(r),isScrolling:!1,horizontalScrollDirection:"forward",scrollLeft:"number"==typeof r.props.initialScrollLeft?r.props.initialScrollLeft:0,scrollTop:"number"==typeof r.props.initialScrollTop?r.props.initialScrollTop:0,scrollUpdateWasRequested:!1,verticalScrollDirection:"forward"},r._callOnItemsRendered=void 0,r._callOnItemsRendered=Ooe(function(e,t,n,i,o,a,s,l){return r.props.onItemsRendered({overscanColumnStartIndex:e,overscanColumnStopIndex:t,overscanRowStartIndex:n,overscanRowStopIndex:i,visibleColumnStartIndex:o,visibleColumnStopIndex:a,visibleRowStartIndex:s,visibleRowStopIndex:l})}),r._callOnScroll=void 0,r._callOnScroll=Ooe(function(e,t,n,i,o){return r.props.onScroll({horizontalScrollDirection:n,scrollLeft:e,scrollTop:t,verticalScrollDirection:i,scrollUpdateWasRequested:o})}),r._getItemStyle=void 0,r._getItemStyle=function(e,t){var i,a=r.props,s=a.columnWidth,l=a.direction,c=a.rowHeight,p=r._getItemStyleCache(m&&s,m&&l,m&&c),f=e+":"+t;if(p.hasOwnProperty(f))i=p[f];else{var h=n(r.props,t,r._instanceProps),g="rtl"===l;p[f]=i={position:"absolute",left:g?void 0:h,right:g?h:void 0,top:d(r.props,e,r._instanceProps),height:u(r.props,e,r._instanceProps),width:o(r.props,t,r._instanceProps)}}return i},r._getItemStyleCache=void 0,r._getItemStyleCache=Ooe(function(e,t,n){return{}}),r._onScroll=function(e){var t=e.currentTarget,n=t.clientHeight,i=t.clientWidth,o=t.scrollLeft,a=t.scrollTop,s=t.scrollHeight,l=t.scrollWidth;r.setState(function(e){if(e.scrollLeft===o&&e.scrollTop===a)return null;var t=r.props.direction,c=o;if("rtl"===t)switch($oe()){case"negative":c=-o;break;case"positive-descending":c=l-i-o}c=Math.max(0,Math.min(c,l-i));var u=Math.max(0,Math.min(a,s-n));return{isScrolling:!0,horizontalScrollDirection:e.scrollLeft<o?"forward":"backward",scrollLeft:c,scrollTop:u,verticalScrollDirection:e.scrollTop<a?"forward":"backward",scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){null!==r._resetIsScrollingTimeoutId&&qoe(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=Loe(r._resetIsScrolling,150)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},function(){r._getItemStyleCache(-1)})},r}rc(t,e),t.getDerivedStateFromProps=function(e,t){return Voe(e,t),g(e),null};var y=t.prototype;return y.scrollTo=function(e){var t=e.scrollLeft,n=e.scrollTop;void 0!==t&&(t=Math.max(0,t)),void 0!==n&&(n=Math.max(0,n)),this.setState(function(e){return void 0===t&&(t=e.scrollLeft),void 0===n&&(n=e.scrollTop),e.scrollLeft===t&&e.scrollTop===n?null:{horizontalScrollDirection:e.scrollLeft<t?"forward":"backward",scrollLeft:t,scrollTop:n,scrollUpdateWasRequested:!0,verticalScrollDirection:e.scrollTop<n?"forward":"backward"}},this._resetIsScrollingDebounced)},y.scrollToItem=function(e){var t=e.align,n=void 0===t?"auto":t,r=e.columnIndex,i=e.rowIndex,o=this.props,u=o.columnCount,d=o.height,p=o.rowCount,f=o.width,h=this.state,m=h.scrollLeft,g=h.scrollTop,y=zoe();void 0!==r&&(r=Math.max(0,Math.min(r,u-1))),void 0!==i&&(i=Math.max(0,Math.min(i,p-1)));var b=a(this.props,this._instanceProps),v=s(this.props,this._instanceProps)>f?y:0,x=b>d?y:0;this.scrollTo({scrollLeft:void 0!==r?l(this.props,r,n,m,this._instanceProps,x):m,scrollTop:void 0!==i?c(this.props,i,n,g,this._instanceProps,v):g})},y.componentDidMount=function(){var e=this.props,t=e.initialScrollLeft,n=e.initialScrollTop;if(null!=this._outerRef){var r=this._outerRef;"number"==typeof t&&(r.scrollLeft=t),"number"==typeof n&&(r.scrollTop=n)}this._callPropsCallbacks()},y.componentDidUpdate=function(){var e=this.props.direction,t=this.state,n=t.scrollLeft,r=t.scrollTop;if(t.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("rtl"===e)switch($oe()){case"negative":i.scrollLeft=-n;break;case"positive-ascending":i.scrollLeft=n;break;default:var o=i.clientWidth,a=i.scrollWidth;i.scrollLeft=a-o-n}else i.scrollLeft=Math.max(0,n);i.scrollTop=Math.max(0,r)}this._callPropsCallbacks()},y.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&qoe(this._resetIsScrollingTimeoutId)},y.render=function(){var e=this.props,t=e.children,n=e.className,r=e.columnCount,i=e.direction,o=e.height,l=e.innerRef,c=e.innerElementType,u=e.innerTagName,d=e.itemData,p=e.itemKey,f=void 0===p?Boe:p,h=e.outerElementType,m=e.outerTagName,g=e.rowCount,y=e.style,b=e.useIsScrolling,v=e.width,x=this.state.isScrolling,w=this._getHorizontalRangeToRender(),S=w[0],k=w[1],C=this._getVerticalRangeToRender(),E=C[0],M=C[1],R=[];if(r>0&&g)for(var _=E;_<=M;_++)for(var A=S;A<=k;A++)R.push(Yt.createElement(t,{columnIndex:A,data:d,isScrolling:b?x:void 0,key:f({columnIndex:A,data:d,rowIndex:_}),rowIndex:_,style:this._getItemStyle(_,A)}));var I=a(this.props,this._instanceProps),P=s(this.props,this._instanceProps);return Yt.createElement(h||m||"div",{className:n,onScroll:this._onScroll,ref:this._outerRefSetter,style:Ut({position:"relative",height:o,width:v,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:i},y)},Yt.createElement(c||u||"div",{children:R,ref:l,style:{height:I,pointerEvents:x?"none":void 0,width:P}}))},y._callPropsCallbacks=function(){var e=this.props,t=e.columnCount,n=e.onItemsRendered,r=e.onScroll,i=e.rowCount;if("function"==typeof n&&t>0&&i>0){var o=this._getHorizontalRangeToRender(),a=o[0],s=o[1],l=o[2],c=o[3],u=this._getVerticalRangeToRender(),d=u[0],p=u[1],f=u[2],h=u[3];this._callOnItemsRendered(a,s,d,p,l,c,f,h)}if("function"==typeof r){var m=this.state,g=m.horizontalScrollDirection,y=m.scrollLeft,b=m.scrollTop,v=m.scrollUpdateWasRequested,x=m.verticalScrollDirection;this._callOnScroll(y,b,g,x,v)}},y._getHorizontalRangeToRender=function(){var e=this.props,t=e.columnCount,n=e.overscanColumnCount,o=e.overscanColumnsCount,a=e.overscanCount,s=e.rowCount,l=this.state,c=l.horizontalScrollDirection,u=l.isScrolling,d=l.scrollLeft,p=n||o||a||1;if(0===t||0===s)return[0,0,0,0];var f=r(this.props,d,this._instanceProps),h=i(this.props,f,d,this._instanceProps),m=u&&"backward"!==c?1:Math.max(1,p),g=u&&"forward"!==c?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,n=e.overscanCount,r=e.overscanRowCount,i=e.overscanRowsCount,o=e.rowCount,a=this.state,s=a.isScrolling,l=a.verticalScrollDirection,c=a.scrollTop,u=r||i||n||1;if(0===t||0===o)return[0,0,0,0];var d=p(this.props,c,this._instanceProps),h=f(this.props,d,c,this._instanceProps),m=s&&"backward"!==l?1:Math.max(1,u),g=s&&"forward"!==l?1:Math.max(1,u);return[Math.max(0,d-m),Math.max(0,Math.min(o-1,h+g)),d,h]},t}(Yt.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,useIsScrolling:!1},t}var Voe=function(e,t){e.children,e.direction,e.height,e.innerTagName,e.outerTagName,e.overscanColumnsCount,e.overscanCount,e.overscanRowsCount,e.width,t.instance},Woe=function(e,t){var n=e.rowCount,r=t.rowMetadataMap,i=t.estimatedRowHeight,o=t.lastMeasuredRowIndex,a=0;if(o>=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},Uoe=function(e,t){var n=e.columnCount,r=t.columnMetadataMap,i=t.estimatedColumnWidth,o=t.lastMeasuredColumnIndex,a=0;if(o>=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},Goe=function(e,t,n,r){var i,o,a;if("column"===e?(i=r.columnMetadataMap,o=t.columnWidth,a=r.lastMeasuredColumnIndex):(i=r.rowMetadataMap,o=t.rowHeight,a=r.lastMeasuredRowIndex),n>a){var s=0;if(a>=0){var l=i[a];s=l.offset+l.size}for(var c=a+1;c<=n;c++){var u=o(c);i[c]={offset:s,size:u},s+=u}"column"===e?r.lastMeasuredColumnIndex=n:r.lastMeasuredRowIndex=n}return i[n]},Yoe=function(e,t,n,r){var i,o;return"column"===e?(i=n.columnMetadataMap,o=n.lastMeasuredColumnIndex):(i=n.rowMetadataMap,o=n.lastMeasuredRowIndex),(o>0?i[o].offset:0)>=r?Koe(e,t,n,o,0,r):Xoe(e,t,n,Math.max(0,o),r)},Koe=function(e,t,n,r,i,o){for(;i<=r;){var a=i+Math.floor((r-i)/2),s=Goe(e,t,a,n).offset;if(s===o)return a;s<o?i=a+1:s>o&&(r=a-1)}return i>0?i-1:0},Xoe=function(e,t,n,r,i){for(var o="column"===e?t.columnCount:t.rowCount,a=1;r<o&&Goe(e,t,r,n).offset<i;)r+=a,a*=2;return Koe(e,t,n,Math.min(r,o-1),Math.floor(r/2),i)},Joe=function(e,t,n,r,i,o,a){var s="column"===e?t.width:t.height,l=Goe(e,t,n,o),c="column"===e?Uoe(t,o):Woe(t,o),u=Math.max(0,Math.min(c-s,l.offset)),d=Math.max(0,l.offset-s+a+l.size);switch("smart"===r&&(r=i>=d-s&&i<=u+s?"auto":"center"),r){case"start":return u;case"end":return d;case"center":return Math.round(d+(u-d)/2);default:return i>=d&&i<=u?i:d>u||i<d?d:u}},Qoe=Hoe({getColumnOffset:function(e,t,n){return Goe("column",e,t,n).offset},getColumnStartIndexForOffset:function(e,t,n){return Yoe("column",e,n,t)},getColumnStopIndexForStartIndex:function(e,t,n,r){for(var i=e.columnCount,o=e.width,a=Goe("column",e,t,r),s=n+o,l=a.offset+a.size,c=t;c<i-1&&l<s;)c++,l+=Goe("column",e,c,r).size;return c},getColumnWidth:function(e,t,n){return n.columnMetadataMap[t].size},getEstimatedTotalHeight:Woe,getEstimatedTotalWidth:Uoe,getOffsetForColumnAndAlignment:function(e,t,n,r,i,o){return Joe("column",e,t,n,r,i,o)},getOffsetForRowAndAlignment:function(e,t,n,r,i,o){return Joe("row",e,t,n,r,i,o)},getRowOffset:function(e,t,n){return Goe("row",e,t,n).offset},getRowHeight:function(e,t,n){return n.rowMetadataMap[t].size},getRowStartIndexForOffset:function(e,t,n){return Yoe("row",e,n,t)},getRowStopIndexForStartIndex:function(e,t,n,r){for(var i=e.rowCount,o=e.height,a=Goe("row",e,t,r),s=n+o,l=a.offset+a.size,c=t;c<i-1&&l<s;)c++,l+=Goe("row",e,c,r).size;return c},initInstanceProps:function(e,t){var n=e,r={columnMetadataMap:{},estimatedColumnWidth:n.estimatedColumnWidth||50,estimatedRowHeight:n.estimatedRowHeight||50,lastMeasuredColumnIndex:-1,lastMeasuredRowIndex:-1,rowMetadataMap:{}};return t.resetAfterColumnIndex=function(e,n){void 0===n&&(n=!0),t.resetAfterIndices({columnIndex:e,shouldForceUpdate:n})},t.resetAfterRowIndex=function(e,n){void 0===n&&(n=!0),t.resetAfterIndices({rowIndex:e,shouldForceUpdate:n})},t.resetAfterIndices=function(e){var n=e.columnIndex,i=e.rowIndex,o=e.shouldForceUpdate,a=void 0===o||o;"number"==typeof n&&(r.lastMeasuredColumnIndex=Math.min(r.lastMeasuredColumnIndex,n-1)),"number"==typeof i&&(r.lastMeasuredRowIndex=Math.min(r.lastMeasuredRowIndex,i-1)),t._getItemStyleCache(-1),a&&t.forceUpdate()},r},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.columnWidth,e.rowHeight}}),Zoe=function(e,t){return e};function eae(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,i=e.getItemSize,o=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,s=e.getStopIndexForStartIndex,l=e.initInstanceProps,c=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return t=function(e){function t(t){var r;return(r=e.call(this,t)||this)._instanceProps=l(r.props,Mc(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:Mc(r),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof r.props.initialScrollOffset?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=Ooe(function(e,t,n,i){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:i})}),r._callOnScroll=void 0,r._callOnScroll=Ooe(function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})}),r._getItemStyle=void 0,r._getItemStyle=function(e){var t,o=r.props,a=o.direction,s=o.itemSize,l=o.layout,u=r._getItemStyleCache(c&&s,c&&l,c&&a);if(u.hasOwnProperty(e))t=u[e];else{var d=n(r.props,e,r._instanceProps),p=i(r.props,e,r._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},r._getItemStyleCache=void 0,r._getItemStyleCache=Ooe(function(e,t,n){return{}}),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,i=t.scrollLeft,o=t.scrollWidth;r.setState(function(e){if(e.scrollOffset===i)return null;var t=r.props.direction,a=i;if("rtl"===t)switch($oe()){case"negative":a=-i;break;case"positive-descending":a=o-n-i}return a=Math.max(0,Math.min(a,o-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,i=t.scrollHeight,o=t.scrollTop;r.setState(function(e){if(e.scrollOffset===o)return null;var t=Math.max(0,Math.min(o,i-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},r._resetIsScrollingDebounced=function(){null!==r._resetIsScrollingTimeoutId&&qoe(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=Loe(r._resetIsScrolling,150)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},function(){r._getItemStyleCache(-1,null)})},r}rc(t,e),t.getDerivedStateFromProps=function(e,t){return tae(e,t),u(e),null};var d=t.prototype;return d.scrollTo=function(e){e=Math.max(0,e),this.setState(function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},d.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,i=n.layout,a=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var s=0;if(this._outerRef){var l=this._outerRef;s="vertical"===i?l.scrollWidth>l.clientWidth?zoe():0:l.scrollHeight>l.clientHeight?zoe():0}this.scrollTo(o(this.props,e,t,a,this._instanceProps,s))},d.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var i=this._outerRef;"horizontal"===t||"horizontal"===r?i.scrollLeft=n:i.scrollTop=n}this._callPropsCallbacks()},d.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,i=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("horizontal"===t||"horizontal"===n)if("rtl"===t)switch($oe()){case"negative":o.scrollLeft=-i;break;case"positive-ascending":o.scrollLeft=i;break;default:var a=o.clientWidth,s=o.scrollWidth;o.scrollLeft=s-a-i}else o.scrollLeft=i;else o.scrollTop=i}this._callPropsCallbacks()},d.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&qoe(this._resetIsScrollingTimeoutId)},d.render=function(){var e=this.props,t=e.children,n=e.className,i=e.direction,o=e.height,a=e.innerRef,s=e.innerElementType,l=e.innerTagName,c=e.itemCount,u=e.itemData,d=e.itemKey,p=void 0===d?Zoe:d,f=e.layout,h=e.outerElementType,m=e.outerTagName,g=e.style,y=e.useIsScrolling,b=e.width,v=this.state.isScrolling,x="horizontal"===i||"horizontal"===f,w=x?this._onScrollHorizontal:this._onScrollVertical,S=this._getRangeToRender(),k=S[0],C=S[1],E=[];if(c>0)for(var M=k;M<=C;M++)E.push(Yt.createElement(t,{data:u,key:p(M,u),index:M,isScrolling:y?v:void 0,style:this._getItemStyle(M)}));var R=r(this.props,this._instanceProps);return Yt.createElement(h||m||"div",{className:n,onScroll:w,ref:this._outerRefSetter,style:Ut({position:"relative",height:o,width:b,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:i},g)},Yt.createElement(s||l||"div",{children:E,ref:a,style:{height:x?"100%":R,pointerEvents:v?"none":void 0,width:x?R:"100%"}}))},d._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],i=e[3];this._callOnItemsRendered(t,n,r,i)}if("function"==typeof this.props.onScroll){var o=this.state,a=o.scrollDirection,s=o.scrollOffset,l=o.scrollUpdateWasRequested;this._callOnScroll(a,s,l)}},d._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,i=r.isScrolling,o=r.scrollDirection,l=r.scrollOffset;if(0===t)return[0,0,0,0];var c=a(this.props,l,this._instanceProps),u=s(this.props,c,l,this._instanceProps),d=i&&"backward"!==o?1:Math.max(1,n),p=i&&"forward"!==o?1:Math.max(1,n);return[Math.max(0,c-d),Math.max(0,Math.min(t-1,u+p)),c,u]},t}(Yt.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var tae=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},nae=function(e,t,n){var r=e.itemSize,i=n.itemMetadataMap,o=n.lastMeasuredIndex;if(t>o){var a=0;if(o>=0){var s=i[o];a=s.offset+s.size}for(var l=o+1;l<=t;l++){var c=r(l);i[l]={offset:a,size:c},a+=c}n.lastMeasuredIndex=t}return i[t]},rae=function(e,t,n,r,i){for(;r<=n;){var o=r+Math.floor((n-r)/2),a=nae(e,o,t).offset;if(a===i)return o;a<i?r=o+1:a>i&&(n=o-1)}return r>0?r-1:0},iae=function(e,t,n,r){for(var i=e.itemCount,o=1;n<i&&nae(e,n,t).offset<r;)n+=o,o*=2;return rae(e,t,Math.min(n,i-1),Math.floor(n/2),r)},oae=function(e,t){var n=e.itemCount,r=t.itemMetadataMap,i=t.estimatedItemSize,o=t.lastMeasuredIndex,a=0;if(o>=n&&(o=n-1),o>=0){var s=r[o];a=s.offset+s.size}return a+(n-o-1)*i},aae=eae({getItemOffset:function(e,t,n){return nae(e,t,n).offset},getItemSize:function(e,t,n){return n.itemMetadataMap[t].size},getEstimatedTotalSize:oae,getOffsetForIndexAndAlignment:function(e,t,n,r,i,o){var a=e.direction,s=e.height,l=e.layout,c=e.width,u="horizontal"===a||"horizontal"===l?c:s,d=nae(e,t,i),p=oae(e,i),f=Math.max(0,Math.min(p-u,d.offset)),h=Math.max(0,d.offset-u+d.size+o);switch("smart"===n&&(n=r>=h-u&&r<=f+u?"auto":"center"),n){case"start":return f;case"end":return h;case"center":return Math.round(h+(f-h)/2);default:return r>=h&&r<=f?r:r<h?h:f}},getStartIndexForOffset:function(e,t,n){return function(e,t,n){var r=t.itemMetadataMap,i=t.lastMeasuredIndex;return(i>0?r[i].offset:0)>=n?rae(e,t,i,0,n):iae(e,t,Math.max(0,i),n)}(e,n,t)},getStopIndexForStartIndex:function(e,t,n,r){for(var i=e.direction,o=e.height,a=e.itemCount,s=e.layout,l=e.width,c="horizontal"===i||"horizontal"===s?l:o,u=nae(e,t,r),d=n+c,p=u.offset+u.size,f=t;f<a-1&&p<d;)f++,p+=nae(e,f,r).size;return f},initInstanceProps:function(e,t){var n={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,r){void 0===r&&(r=!0),n.lastMeasuredIndex=Math.min(n.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),r&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.itemSize}});function sae(e,t){for(var n in e)if(!(n in t))return!0;for(var r in t)if(e[r]!==t[r])return!0;return!1}var lae=["style"],cae=["style"];function uae(e,t){var n=e.style,r=Gt(e,lae),i=t.style,o=Gt(t,cae);return!sae(n,i)&&!sae(r,o)}const dae=gg(0),pae=gg(0),fae=gg(0),hae=gg(e=>e(dae)+e(pae)),mae=gg(e=>{const t=e(Ry),n=e(gU),r=t.height-(n?41:0);return{width:t.width,height:r}}),gae=gg(e=>{const t=e(mae),n=e(dV),r=e(pV);return{width:t.width-r,height:t.height-n}}),yae=gg(e=>{const t=e(gae),n=e(hae),r=e(fae);return Math.min(t.height-n,r)}),bae=gg(-1),vae=KR(e=>gg(t=>t(bae)===e)),xae=({style:e})=>lt.jsx("div",{className:"sn-table-cell",style:{...e,borderWidth:"0px 1px 1px 0px",boxSizing:"border-box"}});var wae=Kt.memo(xae,uae);const Sae=gg(e=>{const t=e(gae),n=e(IU),r=e(hae),i=e(fae)+r,o=e(uoe)*n+r;return i<2*t.height?i:o}),kae=gg(e=>e(Sae)<=e(mae).height),Cae=()=>{},Eae=e=>{e.preventDefault()};const Mae=({columnIndex:e,rowIndex:t,style:n,data:r})=>{const{rowsInPage:i,columns:o,isHoverEnabled:a,setMeasuredCellHeight:s,lineClamp:l,resizeObserverTaskScheduler:c,onKeyDown:u,onKeyUp:d,onCellClick:p}=r,f=_g(vae(t)),h=Ag(bae),m=_g(MU),g=_g(my),y=_g(cy),b=_g(py),v=_g(UY),x=_g(Wg),w=_g(kae),S=i[t]?.[e],{handleMouseDown:k,handleMouseOver:C,handleMouseUp:E,cellSelectionState:M}=function(e){const t="object"==typeof e,n=_g(uy),r=Ag(VY),i=_g(WY(e));if(Rie(e),t&&n){const{handleMouseDown:t,handleMouseOver:n,handleMouseUp:o}=Eie(Eae,e,r,Cae);return{handleMouseDown:t,handleMouseOver:n,handleMouseUp:o,cellSelectionState:i}}return{cellSelectionState:i}}(S),R=((e,t,n,r)=>{const i=Yt.useRef(null),o=n&&(!n.isNumeric||n.isDual),a=n?.isTotalRow??!1,s=Yt.useCallback(n=>{const i=n.contentBoxSize.at(0)?.blockSize;i&&o&&r(i,e,t,a)},[a,t,r,e,o]);return OK({ref:i,callback:s}),i})(t,e,S,s),_=o[e]?.isDim?m.dimension.values:m.measure.values,A=Cie(o[e].id);if("object"==typeof S){const r=((e,t,n,r,i,o,a)=>{const s=e.isTotalRow&&a("TLV-2303-SUB-TOTALS");let l=Iie(i,o,e);l=s?o.subTotalRow:l,l=_ie(l,o,e,t.isDim);const c=e.isNull||s&&t.isDim?l:CV(l,e.qAttrExps,t.qAttrExprInfoIDs);return r!==YB.Selected||s?r!==YB.Disabled||s?n?{...c,...o.grid.hoverColors}:c:{...c,color:n?o.grid.hoverColors?.color:c.color,background:`${WH}, ${n?o.grid.hoverColors?.background:c.background}`}:{...c,...o.selectedColors}})(S,o[e],a&&f,M,_,m,x),i={rowindex:t,columnindex:e},s=((e,t)=>e.representation.type===t$.Image&&"fitHeight"===e.representation.imageSize?JH(t,e.representation):e.align)(S,g),I=n=>{b&&p?.(t,e),k?.(n)},P=u?n=>{u(n,t,e,S)}:void 0;return lt.jsx("div",{className:`sn-table-cell ${M} ${Cm}`,tabIndex:-1,style:{...n,...r,display:"flex",alignItems:"start",borderColor:m.grid.border,borderTop:"0px",borderBottomWidth:!w&&S.isLastRow?"0px":"1px",borderRightWidth:tV(g,S.isLastColumn,v),borderLeftWidth:nV(g,S.isLastColumn,v),justifyContent:s,borderStyle:"solid",padding:"4px 12px",boxSizing:"border-box",cursor:"default",overflow:"hidden",textAlign:S.align,opacity:A},onMouseDown:I,onMouseUp:E,onMouseOver:C,onMouseEnter:a?()=>{h(t)}:void 0,onMouseLeave:a?()=>{h(-1)}:void 0,onKeyDown:P,onKeyUp:d,title:y?S.representation.text:void 0,...i,children:lt.jsx(kie,{cellSelectionState:M,hideTickIcon:!!S.isTotalRow,children:lt.jsx(xie,{forwardRef:m.contentStaticLineCount||1===l?void 0:R,cell:S,style:r,indentation:EV(S,o[e],x),justifyContent:s,lineClamp:l,virtualizedCell:!0,resizeObserverTaskScheduler:c})})})}return lt.jsx(wae,{style:{...n,..._,borderColor:m.grid.border,borderWidth:"0px 1px 1px 0px",borderStyle:"solid",boxSizing:"border-box",opacity:A}})};var Rae=Yt.memo(Mae,uae);const _ae=gg(async e=>{const t=e(Yg),n=e(Sy),r=e(soe).page,{qDataPages:i}=t.qHyperCube;if(0!==r||0===i.length){const e=r*Math.min(MV,t.qHyperCube.qSize.qcy);if(n&&"getHyperCubeData"in n)return n.getHyperCubeData("/qHyperCubeDef",[{qLeft:0,qTop:e,qWidth:50,qHeight:100}])}return[...i]}),Aae=_E(_ae),Iae=gg(e=>{const t=e(uoe),n=e(gae),r=e(IU);return Math.min(t,Math.ceil(n.height/r))}),Pae=gg(e=>{const t=e(qU),n=e(gae);return t.reduce((e,t)=>e.width<n.width?{width:e.width+t,count:e.count+1}:e,{count:0,width:0}).count}),Tae=e=>{const t=Yt.useRef(e);return t.current=e,t},Dae=({qLeft:e,qTop:t,qWidth:n,qHeight:r})=>`${e}-${t}-${n}-${r}`,Oae=e=>-1===e.qElemNumber||!!e.qIsTotalCell,Nae=(e,t,n,r,i)=>{const o=e[n];if(!o)return!0;for(let e=t;e<t+r;e++){const t=o[e];if(t?.rowIdx!==i)return!0}return!1},qae=(e,t,n,r)=>{const i=e.slice(n,r);return 0===i.length||i.some(e=>!e[t])},Lae=(e,t,n,r,i,o,a,s)=>{e.forEach(e=>{e.qMatrix.forEach((l,c)=>{const u=e.qArea.qTop-t.page*t.rowsPerPage,{row:d,pageRowIdx:p}=((e,t,n,r,i,o,a,s,l,c)=>{const{qSize:u}=a.qHyperCube,d=r.qTop+n,p=i+n,f=e[p]??[],h=t.some(Oae);return t.forEach((e,t)=>{const n=t+r.qLeft;if(f.at(n))return;const{colIdx:i,isDim:m,isLocked:g,bodyTextAlign:y,selectionColIdx:b,qAttrExprInfoIndex:v,representation:x,conditionalColoring:w,qMiniChart:S,measureMinMax:k,qNumFormat:C,qIsAutoFormat:E,formattedNullValueText:M}=o[n],R=s.flags.isEnabled("VNA-670-SEPARATE_NULL_VALUE_STYLING"),_=!m&&e.qIsNull,A=m&&JW(e,m),I=_||A?XW(m,e,a,R):e.qText,P=_?tH(I):eH(e),T=eH(e)&&!tH(e.qText??"");f[n]={id:WF(),...e,align:UW(P,y,c),rowIdx:d,colIdx:i,isSelectable:m&&!g&&!h&&!A,isTotalRow:h,pageRowIdx:p,pageColIdx:n,selectionColIdx:b,isLastRow:d===u.qcy-1,isLastColumn:n===u.qcx-1,isNumeric:P,isDual:T,isNull:(!_||!P)&&JW(e,m),qNumFormat:C,qIsAutoFormat:E,formattedNullValueText:M,representation:gW({cell:e,representationProperties:x,attrExprInfoIndex:v,env:s,conditionalColoring:w,miniChartOnMeasure:S,measureMinMax:k,getText:()=>I,direction:c,enabledFeatures:{[t$.Image]:!0,[t$.Indicator]:!0,[t$.MiniChart]:!0,[t$.Bar]:!m&&s.flags.isEnabled("VNA-977-TABLE-BARS")}})},l(f[n],d,n)}),{row:f,pageRowIdx:p}})(n,l,c,e.qArea,u,r,i,o,a,s);n[p]=d})})},jae=({gridState:e,setEstimatedCellHeight:t})=>{const n=_g(Yg),r=_g(Py),i=_g(Sy),o=_g(Vg),a=_g(my),s=_g(soe),l=_g(Aae),c=_g(dU),u=_g(uoe),d=_g(Iae),p=_g(Pae),f=Yt.useRef([]),h=Yt.useCallback((e,r)=>{const i=Array.isArray(r)?r.slice(0,u):(e=>Array(e).fill(void 0))(u);return Lae(e,s,i,c,n,o,t,a),f.current=i,i},[u,s,c,n,o,t,a]),[m,g]=Yt.useState(()=>h(l??[]));gm(()=>{g(h(l??[]))},[l,a,u]);const y=((e,t)=>{const n=_g(Ug),r=Yt.useRef(new Set),i=Yt.useRef(new Set),o=Yt.useRef(new Set),a=Tae(e),s=Tae(t),l=Yt.useMemo(()=>({enqueue:e=>{const t=Dae(e);o.current.has(t)||(r.current.add(e),o.current.add(t),1===r.current.size&&setTimeout(async()=>{const e=Array.from(r.current.values());if(0!==e.length){r.current.clear(),i.current.add(e);try{const t=(e=>{const t=[];return e.forEach(e=>{if(t.length>0){const n=t[t.length-1];((e,t)=>e.qTop+e.qHeight===t.qTop&&e.qLeft===t.qLeft&&e.qWidth===t.qWidth)(n,e)?n.qHeight+=e.qHeight:((e,t)=>e.qLeft+e.qWidth===t.qLeft&&e.qTop===t.qTop&&e.qHeight===t.qHeight)(n,e)?n.qWidth+=e.qWidth:t.push({...e})}else t.push({...e})}),t})(e),n=await a.current(t);i.current.has(e)&&s.current(n)}catch(t){e.forEach(e=>{o.current.delete(Dae(e))}),n.error({msg:"Failed to fetch pages",payload:t})}finally{i.current.delete(e)}}},75))},clear:()=>{r.current.clear(),i.current.clear(),o.current.clear()}}),[n,a,s]);return l})(e=>i&&"getHyperCubeData"in i?i.getHyperCubeData("/qHyperCubeDef",e):Promise.resolve([]),e=>{g(t=>h(e,t))}),b=Yt.useCallback((e,t,n,r)=>{for(let i=e;i<e+n;i++)if(qae(f.current,i,t,r)){const e={qLeft:i,qTop:t,qHeight:r,qWidth:1};y.enqueue(e)}},[y]),v=Yt.useCallback((e,t,n,r)=>{for(let i=t;i<t+r;i++){const t=Math.max(0,i-s.page*s.rowsPerPage);if(Nae(f.current,e,t,n,i)){const t={qLeft:e,qTop:i,qHeight:1,qWidth:n};y.enqueue(t)}}},[y,s]);return Yt.useEffect(()=>{if(void 0===l)return;const{qcx:t,qcy:r}=n.qHyperCube.qSize,i=e.current.overscanRowStartIndex,o=e.current.overscanColumnStartIndex,a=i+s.page*s.rowsPerPage,c=t-o,u=s.rowsPerPage-i,f=Math.min(100,c,t,p+5),h=Math.min(100,u,r,d+25);return v(o,a,f,h),()=>{y.clear()}},[l,n,d,p,s,y,v,e,r]),{rowsInPage:m,loadRows:v,loadColumns:b}},zae=e=>{let t=0;return e.forEach(e=>{e>t&&(t=e)}),t},Fae=(e,t)=>void 0===e||Math.abs(e-t)>1e-4,$ae=({isSnapshot:e,isStaticNbrOfLines:t,lineClamp:n,setCellHeight:r})=>{const i=_g(MU),o=_g(qU),{estimateLineCount:a}=um(i.dimension.values),s=fV(i.dimension.values.fontSize),l=e||t||1===n;return Yt.useCallback((e,t,i)=>{if(l||e.representation.type===t$.Image||e.isNumeric&&!e.isDual)return;const c=(e=>Math.max(0,e-24-1))(o[i]),u=e.representation.text?a({text:e.representation.text,maxWidth:c,isNumeric:!1}):1,d=Math.min(n,Math.max(1,u));r(d*s,t,i,e.isTotalRow??!1)},[l,o,a,n,s,r])},Bae=({isStaticNbrOfLines:e,minRowHeight:t,state:n,staticRowHeight:r=0})=>{const i=_g(yW);Yt.useLayoutEffect(()=>{const o=e?r:((e,t)=>{const n=0===t?0:e/t;return Math.ceil(n)})(n.sumHeight,n.rowHeights.size);i.estimatedRowHeight=Math.max(o,t)},[e,t,n,r,i])},Hae=({isSnapshot:e,gridRef:t})=>{const n=_g(MU),r=_g(uoe),[i,o]=Yt.useState(()=>({rowHeights:new Map,cellHeightsInGrid:new Map,sumHeight:0})),a=_g(AU),s=_g(IU),l=_g(PU),c=!!n.contentStaticLineCount,u=Math.max(8e6/r,s,l)-9,d=u+9,p=Math.max(1,Math.min(n.grid.contentLineClamp,Math.round(u/a))),f=(({lineClamp:e,lineHeight:t,isStaticNbrOfLines:n})=>n?t*e+8+1:void 0)({lineClamp:p,lineHeight:a,isStaticNbrOfLines:c});(({gridRef:e,setState:t})=>{const n=_g(Yg),r=_g(soe),i=_g(qU),o=n.multiline?.wrapTextInCells,a=n.nullValueRepresentation?.text;gm(()=>{e.current?.resetAfterIndices({columnIndex:0,rowIndex:0,shouldForceUpdate:!1}),t({rowHeights:new Map,cellHeightsInGrid:new Map,sumHeight:0})},[n.qHyperCube.qSize.qcx,n.qHyperCube.qSize.qcy,r.page,o,a]),gm(()=>{e.current?.resetAfterIndices({columnIndex:0,rowIndex:0,shouldForceUpdate:!1})},[i])})({gridRef:t,setState:o});const h=(({setState:e,maxCellHeight:t,gridRef:n})=>{const r=_g(IU),i=_g(PU);return Yt.useCallback((o,a,s,l=!1)=>{Yt.startTransition(()=>{e(e=>{const c=l?i:r,u=Math.max(c,o+9),d=Math.min(t,u),p=e.cellHeightsInGrid.get(a)??e.cellHeightsInGrid.set(a,new Map).get(a);if(!Fae(p.get(s),d))return e;const f={...e},h=e.rowHeights.get(a);p.set(s,d);const m=void 0===h||d>=h?d:zae(p);return f.rowHeights.set(a,m),f.sumHeight=e.sumHeight-(h??0)+m,n.current?.resetAfterIndices({columnIndex:s,rowIndex:a,shouldForceUpdate:!1}),f})})},[e,t,r,i,n])})({maxCellHeight:d,setState:o,gridRef:t}),m=(({isSnapshot:e,isStaticNbrOfLines:t,lineClamp:n,setCellHeight:r})=>Yt.useCallback((i,o,a,s)=>{e||t||1===n||r(i,o,a,s)},[e,t,n,r]))({isSnapshot:e,isStaticNbrOfLines:c,lineClamp:p,setCellHeight:h}),g=$ae({isSnapshot:e,isStaticNbrOfLines:c,lineClamp:p,setCellHeight:h}),y=Yt.useCallback(e=>c?f??s:i.rowHeights.get(e)??s,[c,s,i.rowHeights,f]);return Bae({isStaticNbrOfLines:c,minRowHeight:s,state:i,staticRowHeight:f}),{setMeasuredCellHeight:m,setEstimatedCellHeight:g,getRowHeight:y,lineClamp:p}},Vae=(e,t)=>{Yt.useLayoutEffect(()=>()=>{t(0)},[e,t]);const n=Yt.useCallback(e=>{const n=e.contentBoxSize.at(0)?.blockSize;void 0!==n&&t(n)},[t]);OK({ref:e,callback:n})};let Wae=function(e){return e.Left="Left",e.Right="Right",e.Up="Up",e.Down="Down",e.None="None",e}({});const Uae=({loadRows:e,loadColumns:t,gridState:n})=>{const r=_g(yW),i=_g(Yg),o=_g(soe),a=_g(uoe);return Yt.useCallback(({overscanColumnStartIndex:s,overscanColumnStopIndex:l,overscanRowStartIndex:c,overscanRowStopIndex:u,visibleColumnStartIndex:d,visibleColumnStopIndex:p,visibleRowStartIndex:f,visibleRowStopIndex:h})=>{const{verticalScrollDirection:m,horizontalScrollDirection:g}=(({overscanColumnStartIndex:e,overscanRowStartIndex:t},n,r)=>{let i,o;return i=r>t?Wae.Down:r<t?Wae.Up:Wae.None,o=n>e?Wae.Right:n<e?Wae.Left:Wae.None,{verticalScrollDirection:i,horizontalScrollDirection:o}})(n.current,s,c);if(n.current.overscanColumnStartIndex=s,n.current.overscanColumnStopIndex=l,n.current.overscanRowStartIndex=c,n.current.overscanRowStopIndex=u,c>a)return;const y=s,b=c+o.page*o.rowsPerPage,v=l-s+1,x=u-c+1;if(r.visibleLeft=d,r.visibleWidth=p-d+1,r.visibleTop=f+o.page*o.rowsPerPage,r.visibleHeight=h-f+1,r.page=o.page,r.rowsPerPage=o.rowsPerPage,m===Wae.Down){const t=x+25;e(y,b,v,c+t>a?a-c:t)}else if(m===Wae.Up){const t=x+25,n=o.page*o.rowsPerPage,r=Math.max(n,b-25);e(y,r,v,t)}if(g===Wae.Right){const e=i.qHyperCube.qSize.qcx-y,n=v+5,r=Math.min(e,n);t(y,b,r,x)}else if(g===Wae.Left){const e=Math.max(0,y-5),n=Math.min(i.qHyperCube.qSize.qcx,v+5);t(e,b,n,x)}},[n,a,o.page,o.rowsPerPage,r,e,i.qHyperCube.qSize.qcx,t])};const Gae=({columnIndex:e,data:t,rowIndex:n})=>{const r=t.rowsInPage[n]?.[e];return r?.id??`${n}-${e}`},Yae=(e,t)=>{if(!e||!t)return;const n=e.scrollHeight-e.clientHeight,r=Math.round(n*(e=>{const t=e.scrollHeight-e.clientHeight;return t<=0?0:Math.max(0,Math.min(1,e.scrollTop/t))})(t));e.scrollTop!==r&&(e.scrollTop=r)},Kae={overflow:"hidden",willChange:"auto"},Xae=Yt.forwardRef((e,t)=>{const{handleBodyKeyDown:n,handleBodyKeyUp:r,focusBodyCellOnClick:i}=Ioe(),o=_g(dU),a=_g(gae),s=Ag(fae),l=_g(yae),c=_g(yW),u=_g(Yg),d=_g(my),p=_g(qU),f=_g(uoe),h=_g(poe),m=Ag(doe),g=Yt.useRef(null),y=Yt.useRef(null),b=Yt.useRef(null),v=Yt.useRef({overscanColumnStartIndex:0,overscanRowStartIndex:0,overscanColumnStopIndex:0,overscanRowStopIndex:0}),x=Yt.useRef(0),w=!!wV(u)?.content?.hoverEffect,{setMeasuredCellHeight:S,setEstimatedCellHeight:k,getRowHeight:C,lineClamp:E}=Hae({isSnapshot:!!u.snapshotData,gridRef:g}),{rowsInPage:M,loadRows:R,loadColumns:_}=jae({gridState:v,setEstimatedCellHeight:k}),A=Uae({loadRows:R,loadColumns:_,gridState:v}),I=CX(),P=Yt.useMemo(()=>({rowsInPage:M,columns:o,isHoverEnabled:w,lineClamp:E,setMeasuredCellHeight:S,resizeObserverTaskScheduler:I,onKeyDown:n,onKeyUp:r,onCellClick:i}),[M,o,w,E,S,I,n,r,i]);return Yt.useLayoutEffect(()=>{1===x.current&&g.current?.scrollToItem({rowIndex:f-1,align:"start"})}),function(e){const t=Ag(VY),{shouldRefocusRef:n}=_g(xoe),r=_g(_y),i=_g(coe);Yt.useEffect(()=>{t({type:KB.UpdatePageRows,payload:{pageRows:e}})},[t,e]);const o=Yt.useCallback(()=>{n&&(n.current=r.contains(document.activeElement))},[n,r]);EX({updateShouldRefocus:o,tableWrapperRef:{current:i}})}(M),Yt.useImperativeHandle(t,()=>({interpolatedScrollTo:(e,t)=>{const n=(b.current?.clientHeight??l)-l,r=Math.round(n*e);x.current=e,1===x.current?(g.current?.scrollToItem({rowIndex:f-1,align:"start"}),g.current?.scrollTo({scrollLeft:t})):g.current?.scrollTo({scrollTop:r,scrollLeft:t})}}),[b,l,f]),Yt.useEffect(()=>(m(()=>(e,t)=>{g.current?.scrollToItem({rowIndex:e,columnIndex:t,align:"auto"}),Yae(h,y.current)}),()=>{m(null)}),[h,m]),Vae(b,s),lt.jsx(Qoe,{"data-key":"body",ref:g,outerRef:y,innerRef:b,style:Kae,columnCount:o.length,columnWidth:e=>p[e],height:l,rowCount:f,rowHeight:C,estimatedRowHeight:c.estimatedRowHeight,width:a.width,itemData:P,onItemsRendered:A,itemKey:Gae,className:"sn-table-body",direction:d,children:Rae})});var Jae=Yt.memo(Xae);const Qae=({children:e})=>{const t=_g(zU),n=_g(Sae);return lt.jsx("div",{"data-key":"full-size-container",style:{display:"block",width:t,height:n},children:e})},Zae=(e,t)=>{const n=Yt.useRef(null),r=_g(qU);Yt.useLayoutEffect(()=>{n.current&&t(n.current.getBoundingClientRect().height+9,e)},[t,n,e,r.length]);const i=Yt.useCallback(n=>{const r=n.contentBoxSize.at(0)?.blockSize;r&&t(r+9,e)},[e,t]);return OK({ref:n,callback:i}),n},ese=Ul("div",{shouldForwardProp:e=>"interactions"!==e&&"hoverBackground"!==e&&"background"!==e&&"applicableStyle"!==e&&"color"!==e})(({interactions:e,hoverBackground:t,background:n,applicableStyle:r,color:i})=>({...r,background:n,color:i,"&&:hover:not(:has(button:hover))":{background:e.active?t:void 0}})),tse=({index:e,style:t,data:n})=>{const{columns:r,columResizeHandler:i,setMeasuredCellHeight:o,onKeyDown:a,onCellClick:s}=n,l=_g(MU),c=_g(my),u=_g(sy),d=_g(UY),p=Ag(uV),f=_g(uU),h=_g(py),m=_g(qU)[e],g=_g(wy),y=_g(sX(e)),b=r[e],{open:v,setOpen:x,handleOpenMenu:w,toggleSortOrder:S}=Gie({isInteractionEnabled:h,column:b}),k=_g(ny),C=Zae(e,o),E=r.length-1===e,M=k?CK:WK,{ref:R,isDragging:_}=Jie(b,e),A=Cie(b.id),I=y&&!g.enabled&&h?0:-1,P=a?t=>{a(t,e,w)}:void 0;return lt.jsxs(ese,{"data-dragging":_,ref:R,className:`sn-table-cell ${Cm}`,title:u.passive?b.label:void 0,onClick:k?w:S,applicableStyle:{...l.header,...YY(l,f,!0)},style:{...t,cursor:"pointer",display:"flex",alignItems:"flex-end",borderStyle:"solid",borderRightWidth:tV(c,E,d),borderLeftWidth:nV(c,E,d),borderTopWidth:"0px",borderBottomWidth:"1px",padding:"4px",justifyContent:b.headTextAlign,boxSizing:"border-box",zIndex:r.length-e,flexDirection:"right"===b.headTextAlign?"row-reverse":"row",userSelect:"none",opacity:A},interactions:u,hoverBackground:b.headerColor?.headerMenuHoverBackground??l.headerMenuHoverBackground,background:k&&v?b.headerColor?.headerMenuActiveBackground??l.headerMenuActiveBackground:b.headerColor?.background??l.header.background,color:b.headerColor?.color??l.header.color,tabIndex:I,onKeyDown:P,onMouseDown:t=>{t.preventDefault(),h&&s?.(e)},"data-col":e,children:[lt.jsx(M,{forwardRef:C,column:b,isInteractionEnabled:h,open:v,setOpen:x,columnWidth:m}),lt.jsx(Wie,{column:b,isLastColumn:E,onColumnResize:i,setIsAdjustingWidth:p})]})},nse=e=>{const[t,n]=Yt.useState(new Map);gm(()=>{n(new Map)},[e.length]);const r=Yt.useCallback((e,t)=>{n(n=>Fae(n.get(t),e)?new Map(n).set(t,e):n)},[]);return{rowHeight:Yt.useMemo(()=>zae(t),[t]),setMeasuredCellHeight:r}},rse=(e,t)=>{Yt.useImperativeHandle(e,()=>({scrollTo:e=>t.current?.scrollTo(e)}),[t])},ise=e=>{const t=_g(Py),n=_g(Yg),r=_g(soe),i=_g(qU);gm(()=>{e.current?.resetAfterIndex(0,!1)},[n,r,e,i,t])},ose={overflow:"hidden",boxSizing:"border-box",willChange:"auto"},ase=Yt.forwardRef((e,t)=>{const{columResizeHandler:n}=e,r=_g(dU),i=_g(gae),o=Ag(dae),a=Kt.useRef(null),s=Yt.useRef(null),l=_g(RU),c=_g(Yg),u=_g(yy),d=_g(my),p=_g(qU),{rowHeight:f,setMeasuredCellHeight:h}=nse(r),m=Hie(u,c),{handleHeadKeyDown:g,focusHeadCellOnClick:y}=Ioe();return rse(t,a),ise(a),Vae(s,o),lt.jsx(aae,{className:"sn-table-head-row",ref:a,outerRef:s,layout:"horizontal",style:{...ose,...m?{display:"none"}:void 0},itemCount:r.length,itemSize:e=>p[e],height:Math.max(f+8,l),width:i.width,itemKey:e=>r[e].id,itemData:{columns:r,columResizeHandler:n,setMeasuredCellHeight:h,onKeyDown:g,onCellClick:y},direction:d,children:tse})});var sse=Yt.memo(ase);const lse=Yt.forwardRef((e,t)=>{const{children:n,onScroll:r}=e,i=_g(my),o=_g(dy),{width:a,height:s}=_g(mae),l=Ag(poe),c=Yt.useCallback(e=>{l(e),"function"==typeof t?t(e):t&&(t.current=e)},[t,l]);return lt.jsx("div",{"data-testid":"scrollable-container",ref:c,style:{overflow:o?"auto":"hidden",width:a,height:s},onScroll:r,dir:i,tabIndex:-1,children:n})}),cse=({children:e})=>{const t=_g(my),n=_g(gae);return lt.jsx("div",{"data-testid":"sticky-container",style:{position:"sticky",top:"0px",left:"rtl"!==t?"0px":void 0,right:"rtl"===t?"0px":void 0,width:n.width,height:n.height},children:e})},use=({index:e,style:t,data:n})=>{const{columns:r,totals:i,setMeasuredCellHeight:o,onKeyDown:a,onCellClick:s}=n,l=_g(MU),c=_g(Yg),u=_g(my),d=_g(cy),p=_g(py),f=_g(UY),h=_g(kae),m=Zae(e,o),g=r[e].totalInfo,{totalsTextAlign:y,isTotalNumeric:b}=r[e],v=c.qHyperCube.qSize.qcx-1===e,x=Cie(r[e].id),w=a?t=>{a(t,e)}:void 0;return lt.jsx("div",{className:`sn-table-cell ${Cm}`,tabIndex:-1,title:d?g:void 0,"data-col":e,onKeyDown:w,onMouseDown:t=>{t.preventDefault(),p&&s?.(e)},style:{...t,...l.totalRow,...YY(l,i,!1),background:l.totalRow.background,display:"flex",alignItems:i.atTop?"end":"start",borderStyle:"solid",borderRightWidth:tV(u,v,f),borderLeftWidth:nV(u,v,f),borderTopWidth:i.atBottom?"1px":"0px",borderBottomWidth:h&&i.atBottom||i.atTop?"1px":"0px",padding:"4px 12px",justifyContent:y,textAlign:y,boxSizing:"border-box",cursor:"default",opacity:x},children:lt.jsx(kK,{forwardRef:b?void 0:m,isNumeric:b,children:g})})},dse=Yt.forwardRef((e,t)=>{const{totals:n}=e,r=_g(dU),i=_g(gae),o=Ag(pae),a=Yt.useRef(null),s=Yt.useRef(null),l=_g(_U),c=_g(my),u=_g(Yg),d=_g(qU),{rowHeight:p,setMeasuredCellHeight:f}=nse(r),{handleTotalsKeyDown:h,focusTotalsCellOnClick:m}=Ioe();return rse(t,a),ise(a),Vae(s,o),lt.jsx(aae,{className:"sn-table-totals-row",ref:a,outerRef:s,layout:"horizontal",style:ose,itemCount:u.qHyperCube.qSize.qcx,itemSize:e=>d[e],height:Math.max(p,l),width:i.width,itemData:{columns:r,totals:n,setMeasuredCellHeight:f,onKeyDown:h,onCellClick:m},direction:c,children:use})});var pse=Yt.memo(dse);const fse=(e,t,n)=>{const r=_g(my),i=_g(yW);return Yt.useCallback(o=>{const{scrollHeight:a,clientHeight:s,scrollTop:l}=o.currentTarget,c=((e,t)=>{const{scrollWidth:n,clientWidth:r,scrollLeft:i}=e,o=n-r;if("rtl"===t){if(i>o)return o;if(i<0)return Math.abs(i)}return i})(o.currentTarget,r),u=Math.max(0,Math.min(1,l/(a-s)));i.scrollTopRatio=u,i.scrollLeft=c,n.current?.interpolatedScrollTo(Number.isNaN(u)?0:u,c),e.current?.scrollTo(c),t.current?.scrollTo(c)},[i,n,e,t,r])},hse=()=>{const e=_g(uU),t=Yt.useRef(null),n=Yt.useRef(null),r=Yt.useRef(null),i=Yt.useRef(null),o=fse(n,r,i),a=Yt.useCallback(()=>{t.current&&(t.current.scrollTop=0)},[t]);lX(),(e=>{const t=_g(pU),n=_g(soe),r=_g(Py),i=_g(uoe);Yt.useEffect(()=>{const t=requestAnimationFrame(()=>{e.current&&(e.current.scrollLeft=0,e.current.scrollTop=0)});return()=>{cancelAnimationFrame(t)}},[t,e]),Yt.useEffect(()=>{const t=requestAnimationFrame(()=>{e.current&&(e.current.scrollTop=0)});return()=>{cancelAnimationFrame(t)}},[n,i,r,e])})(t),yX(t);const s=lt.jsx(pse,{ref:r,totals:e},"totals");return lt.jsxs(rX,{children:[lt.jsx(lse,{ref:t,onScroll:o,children:lt.jsxs(Qae,{children:[lt.jsxs(cse,{children:[lt.jsx(sse,{ref:n,columResizeHandler:a}),e.atTop?s:null,lt.jsx(Jae,{ref:i}),e.atBottom?s:null]}),lt.jsx(GY,{})]})}),lt.jsx(KK,{isPagination:!1})]})};var mse=Yt.memo(hse);const gse=()=>{const e=_g(Yg),t=_g(Ry),n=_g(sy),{paginationNeeded:r,totalRowCount:i,totalColumnCount:o,totalPages:a}=_g(cU),s=_g(Py),l=_g(Ty),c=_g(wy),[u,d]=Ig(soe),p=Yt.useRef(null),f=Yt.useRef(!1),h=Ag(loe),m=Ag(coe);Yt.useEffect(()=>{h(f)},[h]);const g=Kt.useCallback(e=>{p.current=e,m(e)},[m]),{handleWrapperKeyDown:y}=Ioe();return(()=>{const e=_g(_y),{keyboard:t}=_g(voe),n=_g(aX),r=_g(uU),i=_g(uoe),{scrollToCell:o}=_g(boe),{shouldRefocusRef:a}=_g(xoe),s=Yt.useRef({focusedCellCoord:n,totalsPosition:r,rowCount:i,scrollToCell:o,rootElement:e}),l=Yt.useRef(null),c=Yt.useRef(null);Yt.useLayoutEffect(()=>{s.current={focusedCellCoord:n,totalsPosition:r,rowCount:i,scrollToCell:o,rootElement:e}},[n,r,i,o,e]),Yt.useEffect(()=>{let e=!1;const{focusedCellCoord:n,totalsPosition:r,rowCount:i,scrollToCell:o,rootElement:u}=s.current;if("function"==typeof u.querySelector){if(t.active){const[t,a]=n,d=r.atTop?2:1;if(t>=d&&t<d+i){null!==c.current&&(cancelAnimationFrame(c.current),c.current=null),o?.(t-d,a);const n=t=>{if(e)return;const r=koe(s.current.rootElement,s.current.focusedCellCoord,s.current.totalsPosition,s.current.rowCount);r&&document.activeElement!==r&&XY(r),r&&document.activeElement===r||t>0&&(l.current=requestAnimationFrame(()=>{n(t-1)}))};l.current=requestAnimationFrame(()=>{e||n(5)})}else{const e=koe(u,n,r,i);e&&XY(e)}}else null!==l.current&&(cancelAnimationFrame(l.current),l.current=null),c.current=requestAnimationFrame(()=>{if(e)return;const t=s.current;if(a?.current)return;if(t.rootElement.contains(document.activeElement))return;const n=koe(t.rootElement,t.focusedCellCoord,t.totalsPosition,t.rowCount);n?.blur(),_oe(t.rootElement)});return()=>{e=!0,null!==l.current&&(cancelAnimationFrame(l.current),l.current=null),null!==c.current&&(cancelAnimationFrame(c.current),c.current=null)}}},[t.active,e,a])})(),oX(p,f),lt.jsxs(bK,{ref:g,"data-testid":"sn-table",onKeyDown:y,children:[lt.jsx(wX,{}),lt.jsx(mse,{}),lt.jsx(PY,{paginationNeeded:r,handleChangePage:e=>{d(e)},pageInfo:u,totalRowCount:i,totalColumnCount:o,totalPages:a,keyboard:c,translator:l,theme:s,interactions:n,rect:t,layout:e})]})};var yse=Yt.memo(gse);const bse=t=>{const n=t.get(Sy),r=t.get(vy),i=t.get(Gg),o=t.get(my);e.useEffect(()=>{i&&n&&(r?function(e){const t=e.get(my),n=e.get(Iy),r=$U(t);n.render(lt.jsx(Oi,{stylisPlugins:"rtl"===t?[VB]:void 0,children:lt.jsx(Yl,{theme:r,children:lt.jsx(Sg,{store:e,children:lt.jsx(FU,{children:lt.jsx(noe,{})})})})}))}(t):function(e){const t=e.get(my),n=e.get(Iy),r=$U(t);n.render(lt.jsx(Kt.StrictMode,{children:lt.jsx(Yl,{theme:r,children:lt.jsx(Sg,{store:e,children:lt.jsx(FU,{children:lt.jsx(yse,{})})})})}))}(t))},[i,r,t,n,o])};function vse(e,t){const n=e.getElementsByClassName("sn-table-container")[0];if(!n)return{};const r=n.getBoundingClientRect(),i=e.getElementsByClassName("sn-table-head-row")[0],o=i?.getBoundingClientRect()??{height:0},a=e.getElementsByClassName("sn-table-totals-row")[0],s=a?.getBoundingClientRect()??{height:0},l=e.getElementsByClassName("sn-table-data-row"),c={top:r.y+o.height+(t.atTop?s.height:0),bottom:r.y+r.height-(t.atBottom?s.height:0)},u=((e,t)=>{if(!e)return-1;for(let n=0;n<e.length;n++)if(e[n].getBoundingClientRect().bottom>t.top)return n;return-1})(l,c),d=((e,t)=>{if(!e)return-1;for(let n=e.length-1;n>-1;n--){const r=e[n].getBoundingClientRect();if(t.bottom>r.top)return n}return-1})(l,c),p=((e,t,n)=>{if(!e||0===e.length||n<0)return 0;const r=e[n].getBoundingClientRect();return Math.max(t.top-r.top,0)})(l,c,u);return{visibleRowStartIndex:u,visibleRowEndIndex:d,rowPartialHeight:p}}const xse=(e,t)=>{if(t)for(let n=0;n<t.length;n++){const r=t[n].getAttribute("rowindex");if(r&&parseInt(r,10)===e)return t[n]}},wse=(e,t,n)=>{if(!e)return!1;const r=e.y+e.height/2;return r>=t&&r<=n};const Sse=(e,t,n,r,i)=>{if(e<0)return 0;const o=n.qHyperCube.qSize.qcy,a=r.rowsPerPage||QW.rowsPerPage,s=i?.isMultiPage?0:3;return Math.min(o,a,e-t+1+s)},kse=(e,t,n,r,i)=>{if(r&&!r.isMultiPage)return r;const o=BW(e,r);if(i){const{visibleRowStartIndex:i=-1,visibleRowEndIndex:a=-1,rowPartialHeight:s}=vse(n,o);return{rowPartialHeight:s,scrollLeft:t.scrollLeft,visibleTop:t.qTop+i,visibleHeight:Sse(a,i,e,t,r),rowsPerPage:t.rowsPerPage,page:t.page,totalsPosition:o}}const{visibleRowStartIndex:a=-1,visibleRowEndIndex:s=-1}=function(e,t){const n=e.querySelector(".sn-table-body"),r=n?.getBoundingClientRect(),i=n?.querySelectorAll(".sn-table-body .sn-table-cell");if(!i||!r)return{};const{scrollTopRatio:o=0,visibleTop:a=0,visibleHeight:s=0,page:l=0,rowsPerPage:c=0}=t,u=l*c,d=a-u,p=d+s-1,f=xse(d,i),h=f?.getBoundingClientRect();if(!f||!h)return{};const m=r.y;if(1-o<.001)return{visibleRowStartIndex:d+(h.y>=m-4?0:1)+u,visibleRowEndIndex:p+u};const g=r.y+r.height,y=(wse(h,m,g)?d:d+1)+u;let b=p+u;const v=xse(p,i),x=v?.getBoundingClientRect();return v&&x&&(wse(x,m,g)||(b=p-1+u)),{visibleRowStartIndex:y,visibleRowEndIndex:b}}(n,t);return{scrollLeft:t.scrollLeft,visibleLeft:t.visibleLeft,visibleWidth:t.visibleWidth,visibleTop:a,visibleHeight:Sse(s,a,e,t,r),scrollTopRatio:t.scrollTopRatio,rowsPerPage:t.rowsPerPage,page:t.page,totalsPosition:o}},Cse={version:JSON.stringify("6.66.0"),qHyperCubeDef:{qDimensions:[],qMeasures:[],qColumnOrder:[],qInitialDataFetch:[{qWidth:50,qHeight:100}]},showTitles:!0,enableChartExploration:!1,title:"",subtitle:"",footnote:"",totals:{show:!0,position:"noTotals"},usePagination:!1,components:[],accessibleHeader:!1};var Ese=e=>({properties:{initial:Cse},data:{targets:[{path:"/qHyperCubeDef",dimensions:{min:0,max:1e3},measures:{min:0,max:1e3}}]},importProperties:t=>Zy({...t,env:e}),exportProperties:Gy,exploration:NF(e)});const Mse=e=>e.getStyle("","","object.straightTableV2.backgroundColor"),Rse=e=>e.getStyle("object","straightTableV2","backgroundColor");return function(t){return{qae:Ese(t),ext:rB(t),component(){const n=e.useStaleLayout(),r=e.useMemo(()=>vg(),[!1!==n.usePagination]);r.set(Vg,t);const i=e.useElement();r.set(_y,i),r.set(Yg,n),r.set(Pg,e.useApp()),r.set(Sy,e.useModel()),r.set(sy,e.useInteractionState()),r.set(Ty,e.useTranslator()),r.set(oy,e.useSelections()),r.set(hy,e.useOptions()),r.set(wy,e.useKeyboard()),r.set(Ry,e.useRect()),r.set(Dg,e.useEmbed());const o=om(n,i,Mse,Rse);r.set(Py,o),r.set(Gg,mm(o,n,t)),r.set(Tg,Le()),(t=>{const n=t.get(Iy);e.useEffect(()=>()=>{n.unmount()},[n])})(r),e.onContextMenu?.((e,t)=>{const n=t.target,r=n?.closest(`.${Cm}`);r?.title&&e.addItem({translation:"contextMenu.copyCellValue",icon:"lui-icon lui-icon--copy",tid:"copy-cell-context-item",id:"copy-cell-context-item",select:()=>{Om(r)}})}),(({store:t})=>{const n=t.get(Yg),r=t.get(Sy),i=t.get(_y),o=t.get(My),a=t.get(yy),s=t.get(vy);e.onTakeSnapshot(async e=>{const l=e;if(!l.snapshotData||!r||l.snapshotData.content)return l;if("getHyperCubeData"in r){const e=t.get(yW),{rowPartialHeight:c,scrollLeft:u,scrollTopRatio:d,visibleLeft:p,visibleWidth:f,visibleTop:h,visibleHeight:m,rowsPerPage:g,page:y}=kse(n,e,i,a,s);l.qHyperCube.qDataPages=await r.getHyperCubeData("/qHyperCubeDef",[{qLeft:0,qTop:h,qWidth:n.qHyperCube.qSize.qcx,qHeight:m}]),l.snapshotData.content={rowPartialHeight:c,scrollLeft:u,scrollTopRatio:d,visibleLeft:p,visibleWidth:f,visibleTop:h,visibleHeight:m,rowsPerPage:g,page:y,size:{width:o.width,height:o.height},estimatedRowHeight:e.estimatedRowHeight}}return l}),e.useImperativeHandle(()=>({getViewState:()=>kse(n,t.get(yW),i,a,s)}),[n,t,i,s])})({store:r}),bse(r)}}}});
|