@nebula.js/sn-pivot-table 7.57.0 → 7.59.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/core/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/sn-pivot-table v7.57.0
2
+ * @nebula.js/sn-pivot-table v7.59.0
3
3
  * Copyright (c) 2026 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -89,4 +89,4 @@ function $r(e,t){let n;return n=t?Cr(e).withConfig({displayName:t.label,shouldFo
89
89
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
90
90
  e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,d,h=e.length,p=e.search(/[0-9\-\+#]/),f=p>0?e.substring(0,p):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=h-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,h):"";if(n=(t="-"===(e=e.substring(p,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0===+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(d=t[0]).length%l,h=d.length,b=0;b<h;b++)m+=d.charAt(b),!((b-y+1)%l)&&b<h-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),f+(n?"-":"")+r+x}},MD({exports:{}});const kD=(e,t=HR.TEXT,n=HR.WHITE)=>{const r=o_(e??""),i=o_(t),o=o_(n);return r.isInvalid()?t:function(e,t,n){const r=s_(e,t),i=s_(e,n);if(void 0!==r&&void 0!==i)return r>i?t:n}(r,o,i).getRGB()},ID=e=>{const t=e.getStyle("","","dataColors.selected")||HR.SELECTED,n=function(e,t){const n=o_(a_),r=o_(e),i=o_(t);if(r.isInvalid()||i.isInvalid()||r.getAlpha()<1||i.getAlpha()<1)return t;const o=s_(n,r),s=s_(i,r),a=o>s||o>4.5;return!a&&s>3?i.getHex():a?a_:"#000000"}(t,HR.TEXT);return{background:t,color:n}},RD=(e,t)=>{const n=o_(e);return 0===n.a?(n.setAlpha(t.opacity),n.getString()):n.isDark()?n.getBrightenedColor(t.brighter).getString():n.getDarkenedColor(t.darker).getString()},_D=e=>{const t=o_(e);return t.isInvalid()?null:1===t.a?t.getRGB():t.getRGBA()},DD=e=>{e.stopPropagation(),e.preventDefault()},AD=e=>{(e instanceof HTMLElement||e instanceof SVGElement)&&e.focus()},PD=e=>"svg"===e.tagName?"exploration-draggable-icon":e.className,LD=e=>{const{currentTarget:t}=e,n=PD(t);let r=t.closest("li")?.previousElementSibling?.getElementsByClassName(n)[0];if(!r){const e=t.closest(".exploration-list"),i=e?.querySelector(".exploration-section-header");if(i)return i;if(r=((e,t)=>{const n=e.closest(".exploration-list"),r=n?.previousElementSibling;if(null===r||!r)return e.closest(".exploration-panel")?.getElementsByClassName(t)[1];const i=r.getElementsByClassName(t);return i.length>0?i[i.length-1]:void 0})(t,n),!r){const e=t.closest(".exploration-panel")?.getElementsByClassName(n)[1];return e??null}}return r},TD=(e,t)=>{const n=e.closest(".exploration-list"),r=n?.nextElementSibling||n?.parentElement?.nextElementSibling;if(null===r||!r){if(t===QI.Tab)return;return n?.closest(".exploration-panel")?.getElementsByClassName("exploration-section-header")[0]}return r.getElementsByClassName("exploration-section-header")[0]},OD=e=>{const{currentTarget:t}=e;if("true"===t.getAttribute("data-dragging"))return!0;const n=t.closest(".exploration-panel");if(!n)return!1;const r=n.getElementsByClassName("section-item-container");return Array.from(r).some(e=>"true"===e.getAttribute("data-dragging"))},qD=(e,t)=>{const{key:n,currentTarget:r}=e;if(r===t.current&&n===QI.Tab)if(e.preventDefault(),e.shiftKey)((e,t)=>{const{currentTarget:n}=e;if(n!==t.current)return;const r=n.closest('[role="region"]')?.getElementsByTagName("button")[0];r&&AD(r)})(e,t);else{const e=r.parentElement?.getElementsByClassName("exploration-section-header")[0];e&&AD(e)}},ND=(e,t)=>{const{key:n}=e;switch(n){case QI.Tab:e.shiftKey?((e,t)=>{const{currentTarget:n}=e;if(n!==t.ref.current)return;const r=t.sectionIndex??2;if(0===r)return;const i=n.closest(".exploration-panel")?.getElementsByClassName("exploration-list")[r-1],o=i?.getElementsByClassName("exploration-item-focus").length??0;if(o>0){const t=i?.getElementsByClassName("exploration-draggable-icon")[o-1];t&&(DD(e),AD(t))}})(e,t):(DD(e),((e,t)=>{const{currentTarget:n}=e;if(n!==t.ref.current)return;const r=n.closest(".exploration-list"),i=r?.getElementsByClassName("exploration-item-focus")[0];if(!i){const e=n.closest(".exploration-panel")?.getElementsByClassName("exploration-list")[2].getElementsByClassName("exploration-section-header")[0];return void(e&&AD(e))}AD(i)})(e,t));break;case QI.Down:if(OD(e))break;e.preventDefault(),((e,t)=>{const{currentTarget:n}=e;if(n!==t.ref.current)return;const r=n.closest(".exploration-panel"),i=r?.getElementsByClassName("exploration-section-header").length??0;let o;if(0===i)return;const s=t.sectionIndex??2;o=s+1<i?r?.getElementsByClassName("exploration-section-header")[s+1]:r?.getElementsByClassName("exploration-section-header")[0],o&&AD(o)})(e,t);break;case QI.Up:if(OD(e))break;e.preventDefault(),((e,t)=>{const{currentTarget:n}=e;if(n!==t.ref.current)return;const r=n.closest(".exploration-panel"),i=r?.getElementsByClassName("exploration-section-header").length??0;let o;if(0===i)return;const s=t.sectionIndex??2;o=s-1>=0?r?.getElementsByClassName("exploration-section-header")[s-1]:r?.getElementsByClassName("exploration-section-header")[i-1],o&&AD(o)})(e,t);break;case QI.Enter:case QI.Space:e.preventDefault(),((e,t)=>{const{currentTarget:n}=e;if(e.preventDefault(),n!==t.ref.current)return;const r="all"!==t.checkState;t.toggleAllCheckboxes(r)})(e,t)}},jD=({children:e})=>co.jsx("span",{style:{width:"fit-content",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontWeight:"bold"},children:e}),zD=({children:e,sectionIndex:n})=>{const r=Dp(void 0!==n?wR(n):FR),i=Ap(void 0!==n?SR(n):WR),o=t.useRef(null),s={ref:o,toggleAllCheckboxes:i,checkState:r,sectionIndex:n};return co.jsxs(hc,{ref:o,className:"exploration-section-header",tabIndex:0,onKeyDown:e=>{ND(e,s)},sx:{display:"flex",alignItems:"center",width:"100%",padding:"2px 8px 2px 8px",boxSizing:"border-box",fontSize:"14px","&:focus-visible":{boxShadow:`0 0 0 2px ${IR} inset`}},children:[co.jsx(jc,{disabled:"disabled"===r,checked:"all"===r,indeterminate:"some"===r,onChange:e=>{i(e.target.checked)},size:"small",style:{flexShrink:0,padding:9}}),co.jsx(jD,{children:e})]})},FD=({sectionIndex:e})=>{const t=Dp(vR(e));return co.jsx(zD,{sectionIndex:e,children:t})},WD=v((e,t)=>co.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:co.jsx("path",{d:"M5.5 1a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zm0 4a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zM5 9.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm.5 3.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zM9 1.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zM9.5 5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zM9 9.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5zm.5 3.5a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5z"})})),$D=ka("div")({position:"absolute",width:"1px",height:"1px",padding:0,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}),BD=ka(WD)(()=>({padding:"6px 6px",flexShrink:0,cursor:"grab","&:focus-visible":{boxShadow:`0 0 0 2px ${IR} inset`}})),VD=e=>{const t=e.key===QI.Down?(e=>{const{currentTarget:t,key:n}=e,r=PD(t),i=t.closest("li");let o=i?.nextElementSibling?.getElementsByClassName(r)[0];return o||(o=TD(t,n),o)?o:t.closest(".exploration-panel")?.getElementsByClassName(r)[0]})(e):LD(e);t&&AD(t)},HD=(e,t)=>{const{currentTarget:n}=e;if(n===t.items.draggableIconRef.current){const e=n.closest("li")?.getElementsByClassName("exploration-item")[0];return void(e&&AD(e))}if(n===t.items.explorationItemRef.current){const e=n.getElementsByClassName("exploration-draggable-icon")[0];return void AD(e)}n===t.items.explorationItemFocusRef.current&&t.toggleCheckedById(t.id)},GD=(e,t)=>{const{key:n}=e;switch(n){case QI.Tab:if(e.shiftKey)DD(e),((e,t)=>{const{currentTarget:n}=e,r=n.closest("ul")?.getElementsByClassName("exploration-item-focus");if(n===t.items.draggableIconRef.current){if(t.itemIndex>=0){const e=r&&r[t.itemIndex];return void(e&&AD(e))}const n=LD(e);n&&AD(n)}if(n===t.items.explorationItemFocusRef.current){const t=n.closest("li")?.previousElementSibling?.getElementsByClassName("exploration-draggable-icon")[0];if(t)return void AD(t);const r=LD(e);r&&AD(r)}})(e,t);else{const n=((e,t)=>{const{currentTarget:n,key:r}=e;if(e.shiftKey)return!0;if(n===t.items.explorationItemRef.current){const e=n.getElementsByClassName("exploration-draggable-icon")[0];return AD(e),!0}if(n===t.items.explorationItemFocusRef.current){const e=n.closest("li")?.getElementsByClassName("exploration-draggable-icon")[0];return e&&AD(e),!0}if(n===t.items.draggableIconRef.current){const e=n.closest("ul")?.getElementsByClassName("exploration-item-focus");if((e?.length||0)-1>t.itemIndex){const n=e&&e[t.itemIndex+1];return n&&AD(n),!0}const i=TD(n,r);if(!i)return!1;AD(i)}return!0})(e,t);n?DD(e):e.stopPropagation()}break;case QI.Down:case QI.Up:if(OD(e))break;DD(e),VD(e);break;case QI.Enter:if(e.currentTarget===t.items.explorationItemRef.current&&t.dragHandleRef){t.dragHandleRef(e.currentTarget);break}DD(e),HD(e,t);break;case QI.Space:DD(e),HD(e,t)}},UD=({children:e})=>co.jsx("span",{style:{width:"fit-content",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flexGrow:1},children:e}),YD=({title:e,dragHandleRef:n,...r})=>{const[i,o]=Pp(tm),s=Dp(gf),a=t.useRef(null),l=t.useRef(null),c=t.useRef(null),u={id:r.id,itemIndex:r.itemIndex,toggleCheckedById:o,items:{explorationItemRef:a,explorationItemFocusRef:l,draggableIconRef:c},dragHandleRef:n};return t.useEffect(()=>{n&&a.current&&n(a.current)},[n]),co.jsxs(hc,{ref:a,className:"exploration-item",onClick:e=>{e.stopPropagation(),o(r.id)},onKeyDown:e=>{GD(e,u)},tabIndex:0,style:{display:"flex",alignItems:"center",width:"100%",cursor:"pointer",padding:0,boxSizing:"border-box",fontSize:"14px"},title:e,sx:{"&:hover":{backgroundColor:"action.hover"},"&:focus-visible":{boxShadow:`0 0 0 2px ${IR} inset`}},children:[co.jsxs(hc,{ref:l,className:"exploration-item-focus",component:"div",tabIndex:0,onKeyDownCapture:e=>{GD(e,u)},sx:{display:"flex",minWidth:0,alignItems:"center",justifyContent:"space-between",flexGrow:1,marginRight:"4px","&:focus-visible":{boxShadow:`0 0 0 2px ${IR} inset`}},children:[co.jsx(jc,{checked:-1!==r.id&&i.has(r.id),"aria-label":s("ChartExploration.ListItem.Label",e),size:"small",tabIndex:-1,style:{padding:9,flexShrink:0,visibility:-1===r.id?"hidden":"visible"}}),co.jsx(UD,{children:e})]}),co.jsx(BD,{ref:c,className:"exploration-draggable-icon",tabIndex:0,height:"16px",onClick:e=>{e.stopPropagation()},onKeyDownCapture:e=>{GD(e,u)}})]})},KD=e=>{const t=Dp(yR(e))??"";return co.jsx(YD,{title:t,...e})},XD=()=>{const e=Dp(bR),t=Dp(xR),n=Dp(PR),r=Ap(CR);return co.jsx(KI,{numberOfSections:2,numberOfItemsInSection:t,keyExtractor:e,emptyTexts:n,onDragEnd:r,dragOverlayRenderer:TR,headerRenderer:FD,itemRenderer:KD})},JD=({itemIndex:e})=>{const t=Dp(NR(e));return co.jsx(LR,{children:t})},ZD=()=>{const e=Dp(gf);return co.jsx(zD,{children:e("Common.Values")})},QD=e=>{const{itemIndex:t}=e,n=Dp(NR(t));return co.jsx(YD,{title:n,...e})},eA=()=>{const e=Dp(jR),t=Dp(zR),n=Dp(AR),r=Ap($R);return co.jsx(hc,{className:"exploration-header-section",style:{height:"100%",display:"flex",flexDirection:"column-reverse"},children:co.jsx(KI,{numberOfSections:1,numberOfItemsInSection:t,keyExtractor:e,emptyTexts:n,onDragEnd:r,dragOverlayRenderer:JD,headerRenderer:ZD,itemRenderer:QD})})},tA=v((e,t)=>co.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:co.jsx("path",{d:"M8.588 11.415a6 6 0 1 1 2.828-2.829l4.101 4a1.5 1.5 0 0 1 .014 2.134l-.707.707a1.5 1.5 0 0 1-2.108.014zM11 6A5 5 0 1 0 1 6a5 5 0 0 0 10 0m-1.52 4.888 3.934 3.837a.5.5 0 0 0 .703-.005l.707-.707a.5.5 0 0 0-.005-.711l-3.926-3.829a6 6 0 0 1-1.413 1.415"})})),nA=()=>{const[e,n]=Pp(yf),r=Dp(gf),i=t.useRef(null),[o]=Dp(zR),[s=0,a=0]=Dp(xR),l=d(e=>{n(e.target.value)},[n]),c=0===e.length||0===s&&0===a&&0===o?r("Common.Search.NoResultsAvailable"):r("ChartExploration.Pivot.Search.ResultsFound",s.toString(),a.toString(),o.toString());return co.jsxs(hc,{ref:i,onKeyDown:e=>{qD(e,i)},style:{position:"sticky",top:0,zIndex:1,width:"calc(100% - 24px)",backgroundColor:"var(--sprout-common-background-color-weak)",paddingTop:2,paddingRight:12,paddingLeft:12,paddingBottom:12},children:[co.jsx($D,{"data-testid":"screenOnly-search-results","aria-live":"polite","aria-atomic":"true",children:c}),co.jsx(Kd,{size:"small",fullWidth:!0,"data-testid":"chart-exploration-search-input","aria-label":r("Common.Search.AccessibilityLabel"),type:"search",defaultValue:e,placeholder:r("Common.Search"),onChange:l,startAdornment:co.jsx(Mu,{position:"start",children:co.jsx(tA,{})}),inputProps:{style:{fontSize:"14px",paddingTop:6,paddingBottom:6}}})]})},rA=e=>{const t=qh();return co.jsx(Ra,{theme:t,children:co.jsx(Ep,{children:co.jsx(nm,{props:e,children:co.jsxs(hc,{className:"exploration-panel",style:{display:"flex",flexDirection:"column"},children:[co.jsx(nA,{}),co.jsx(XD,{}),co.jsx(eA,{})]})})})})},iA=e=>{if(e.flags.isEnabled("CLIENT_IM_5973_PIVOT_TABLE_EXPLORATION"))return{component:rA,classification:{tags:["exploration"],exclusive:!0}}};var oA=function(e){return e.CONTAINS="contains",e.MATCHES_EXACTLY="matches_exactly",e.STARTS_WITH="starts_with",e.ENDS_WITH="ends_with",e.BEGINNING_OF_WORD="beginning_of_word",e}(oA||{}),sA=function(e){return e.COMPARE="compare",e.GENERAL="general",e}(sA||{}),aA=function(e){return e.VALUES="values",e.CONDITION="condition",e.SEARCH="search",e.CLEAR_SELECTION="clear_selection",e.TOP_BOTTOM="top_bottom",e}(aA||{}),lA=function(e){return e.FIXED_VALUE="fixed_value",e.CALCULATED_VALUE="calculated_value",e}(lA||{});const cA=e=>e&&"]"!==e?/^[A-Za-z][A-Za-z0-9_]*$/.test(e)||(e=>{if(!e)return!1;if("["===e[0]&&"]"===e[e.length-1]){let t=e.substring(1,e.length-1);if(/^[A-Za-z][A-Za-z0-9_]*$/.test(t))return!0;if(t=t.replace(/\]\]/g,"]"),e===`[${t.replace(/\]/g,"]]")}]`)return!0}return!1})(e)?e:`[${e.replace(/\]/g,"]]")}]`:e,uA=e=>{if(!Array.isArray(e))return"";let t="{<";const n=[];if(e.forEach(e=>{let t,r=`[${e.field}]${e.exclude?"-":""}={`,i="}";switch(e.type){case aA.SEARCH:t=(e=>{let t="",n="";const r=e.options?.mode;if(!r)return"";switch(r){case oA.BEGINNING_OF_WORD:t="*^",n="*";break;case oA.ENDS_WITH:t="*";break;case oA.STARTS_WITH:n="*";break;case oA.MATCHES_EXACTLY:break;case oA.CONTAINS:default:t="*",n="*"}const i=e.options.values?.[0]??"";return""!==i?`"${t}${i}${n}"`:""})(e);break;case aA.CONDITION:t=(e=>{const{options:t}=e,n=t?.mode===sA.GENERAL,r=t?.modifier?.type===lA.FIXED_VALUE,i=t?.modifier?.operator?t.modifier.operator.split(" "):[];if(0===i.length||!r&&(!t.firstValue?.aggregator||!t.firstValue?.field)||r&&!t.firstValue?.fixedValue||n&&(!t.conditionField?.aggregator||!t.conditionField?.field))return"";let o,s,a="=";n&&r?(o=`${t.conditionField?.aggregator}(${cA(t.conditionField?.field)})`,s=`${t.firstValue?.fixedValue}`):!n&&r?(o="",s=`${t.firstValue?.fixedValue}`,a=""):n||r?(o=`${t.conditionField?.aggregator}(${cA(t.conditionField?.field)})`,s=`${t.firstValue?.aggregator}(${cA(t.firstValue?.field)})`):(o=`${cA(e.field)}`,s=`${t.firstValue?.aggregator}(total ${cA(t.firstValue?.field)})`);const l=`${a}${o}${i[0]}${s}`;let c="";if(i.length>1){if(!r&&(!t.secondValue?.aggregator||!t.secondValue?.field)||r&&!t.secondValue?.fixedValue)return"";let e,s;n&&r?(e=`${t.secondValue?.fixedValue}`,s=` and ${o}`):!n&&r?(e=`${t.secondValue?.fixedValue}`,s=""):n||r?(e=`${t.secondValue?.aggregator}(${cA(t.secondValue?.field)})`,s=` and ${o}`):(e=`${t.secondValue?.aggregator}(total ${cA(t.secondValue?.field)})`,s=` and ${o}`),c=`${s}${i[1]}${e}`}return`"${l}${c}"`})(e);break;case aA.CLEAR_SELECTION:t=`[${e.field}]=`,r="",i="";break;case aA.VALUES:default:t=e.options?.values?e.options.values.map(e=>`'${e.replace(/'/g,"''")}'`).join(","):""}""!==t&&n.push(`${r}${t}${i}`)}),0===n.length)return;return t+=`${n.join(",")}>}`,t},dA=[];for(let e=0;e<256;++e)dA.push((e+256).toString(16).slice(1));const hA=new Uint8Array(16);function pA(e,t,n){return crypto.randomUUID?crypto.randomUUID():function(e){e=e||{};const t=e.random??e.rng?.()??crypto.getRandomValues(hA);if(t.length<16)throw new Error("Random bytes length must be >= 16");return t[6]=15&t[6]|64,t[8]=63&t[8]|128,function(e,t=0){return(dA[e[t+0]]+dA[e[t+1]]+dA[e[t+2]]+dA[e[t+3]]+"-"+dA[e[t+4]]+dA[e[t+5]]+"-"+dA[e[t+6]]+dA[e[t+7]]+"-"+dA[e[t+8]]+dA[e[t+9]]+"-"+dA[e[t+10]]+dA[e[t+11]]+dA[e[t+12]]+dA[e[t+13]]+dA[e[t+14]]+dA[e[t+15]]).toLowerCase()}(t)}(e)}const fA=()=>crypto?.randomUUID?.()??pA(),mA=1e3,gA=1e3,yA=e=>{if(0===e.qInterColumnSortOrder.length)return;const t=e.qDimensions,n=((e,t)=>{const n=new Set;for(const t of e){if(n.has(t))return!0;n.add(t)}const r=e.includes(-1),i=e.filter(e=>-1!==e);if(t){const n=r?t.length+1:t.length;if(e.length!==n)return!0}const o=[...i].sort((e,t)=>e-t);for(let e=0;e<o.length;e++)if(o[e]!==e)return!0;return!1})(e.qInterColumnSortOrder,t);n&&(e.qInterColumnSortOrder=((e,t)=>{const n=[];if(t)for(let e=0;e<t.length;e++)n.push(e);return e.qMeasures.length>=2&&n.push(-1),n})(e,t))},vA=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},bA=e=>{if(!e)return;yA(e);const t=e.qDimensions,{qInterColumnSortOrder:n}=e;((e,t=[])=>{const n=t.filter(e=>-1!==e);for(let r=0;r<n.length;r++)if(-1!==n[r]&&n[r]!==r){const i=n[r],o=n.indexOf(r),s=n[o];vA(n,r,o),vA(e,r,o),vA(t,t.indexOf(i),t.indexOf(s))}})(t,n)},xA=M;class wA extends xA{#c;#u;#d;constructor(e,t){super(e),this.path=e.path,this.#c=t.translator,this.#u=t.flags.isEnabled,this.#d=Rf(t,{tag:["sn-pivot-table","PivotHyperCubeHandler"]})}async#h(e,t,n,r,i=!1){if(!e||this.#p(e))return;const o=t??!1;if(e.qDef.cId||(e.qDef.cId=fA()),r)return this.addAlternativeDimension(e,o,n);if(this.getDimensions().length<this.maxDimensions()){const t=await(async(e,t,n,r,i=!1)=>{const o=e.getDimensions(),s=e.hcProperties.qNoOfLeftDims;return i||await e.autoSortDimension(t),bA(e.hcProperties),(-1===s||Number.isNaN(+s))&&(e.hcProperties.qNoOfLeftDims=o.length),n?((e,t,n,r)=>{if(!e)return;const{qInterColumnSortOrder:i,qNoOfLeftDims:o}=e,s=t.length,a=i.indexOf(-1),l=-1!==a,c=void 0!==r?r+(o||0):void 0;if(l&&void 0!==c&&a>=c?((e,t,n)=>{t.splice(n,1),t.push(e),t.splice(n+1,0,-1)})(s,i,a):i.push(s),void 0===r)t.push(n);else if(void 0!==c){const e=l&&c>a?c-1:c;t.splice(e,0,n)}})(e.hcProperties,o,t,r):((e,t,n,r)=>{if(!e||"number"!=typeof e.qNoOfLeftDims)return;const i=e.qNoOfLeftDims,{qInterColumnSortOrder:o}=e,s=t.length,a=o.indexOf(-1),l=-1!==a&&i>0&&a<i;if(o.push(s),l)void 0===r?t.splice(i-1,0,n):a<r?t.splice(r-1,0,n):(t.splice(r,0,n),o.splice(a,1),o.splice(a+1,0,-1));else{const e=r??i;t.splice(e,0,n),-1!==a&&(o.splice(a,1),o.splice(a+1,0,-1))}e.qNoOfLeftDims++})(e.hcProperties,o,t,r),t})(this,e,o,n,i);return this.#f({section:o?"columns":"rows",cId:e.qDef.cId,addLast:void 0===n}),t}}async addDimension(e,t,n,r){return this.#h(e,t,n,r)}async addDimensions(e,t,n){const r=[];for(const i of e){const e=await this.addDimension(i,n,void 0,t);e&&r.push(e)}return r}addAlternativeDimension(e,t,n){if(!e||this.#p(e))return;const r=this.getAlternativeDimensions();void 0===this.hcProperties.excludedNoOfLeftDims&&(this.hcProperties.excludedNoOfLeftDims=r.length);let i=n;return i=void 0===i?t?r.length:this.hcProperties.excludedNoOfLeftDims:t?this.hcProperties.excludedNoOfLeftDims+i:Math.min(i,this.hcProperties.excludedNoOfLeftDims),r.splice(i,0,e),t||this.hcProperties.excludedNoOfLeftDims++,this.#f({section:t?"columns":"rows",cId:e.qDef.cId,alternative:!0,addLast:void 0===n}),e}async addFieldDimension(e,t,n,r={}){const i=this.createFieldDimension(e,t,n);return this.addDimension(i,r.asColumn,void 0,!1)}async addFieldDimensions(e,t={}){const n=e.map(e=>this.createFieldDimension(e.field,e.label,e.defaults));return this.addDimensions(n,void 0,t.asColumn)}async addLibraryDimensions(e,t={}){const n=e.map(e=>this.createLibraryDimension(e.id,e.defaults));return this.addDimensions(n,void 0,t.asColumn)}reinsertDimension(e,t,n){e.qDef.cId||(e.qDef.cId=fA());if(this.getDimensions().length<this.maxDimensions())return this.addDimension(e,t,n);return this.reinsertAlternativeDimension(e,n,t)}reinsertAlternativeDimension(e,t,n){const r=this.getDimensions(),i=this.getAlternativeDimensions();if(r.length>=mA)return Promise.resolve();const o="number"==typeof t?t:i.length;return i.splice(o,0,e),this.#f({section:n?"columns":"rows",cId:e.qDef.cId,alternative:!0}),Promise.resolve(e)}async removeDimensions(e,t,n){return Promise.all([...e].reverse().map(e=>this.removeDimension(e,t,n)))}async removeDimension(e,t,n){if(t){const t=this.getAlternativeDimensions().splice(e,1)[0];return!n&&this.hcProperties.excludedNoOfLeftDims&&this.hcProperties.excludedNoOfLeftDims--,this.#m({cId:t.qDef.cId,section:n?"columns":"rows"}),t}const r=this.getDimensions(),i=this.properties.qHyperCubeDef.qNoOfLeftDims,o=this.hcProperties.qInterColumnSortOrder.indexOf(e);"number"==typeof this.properties.qHyperCubeDef.qNoOfLeftDims&&"number"==typeof o&&"number"==typeof i&&o+1<=i&&this.properties.qHyperCubeDef.qNoOfLeftDims--;const s=this.properties.qHyperCubeDef.columnWidths?this.properties.qHyperCubeDef.columnWidths[1]:void 0;Array.isArray(s)&&s.length>e&&s.splice(e,1);const a=r.splice(e,1).at(0);if(a)return((e,t)=>{if(!e)return-1;const n=e.indexOf(t);if(-1===n)return-1;for(let n=0;n<e.length;++n)e[n]>t&&e[n]--;e.splice(n,1)})(this.hcProperties.qInterColumnSortOrder,e),bA(this.hcProperties),this.#m({cId:a.qDef.cId,section:n?"columns":"rows"}),a}#p(e){return!(!e||void 0===e.qDef.cId)&&[...this.getDimensions(),...this.getAlternativeDimensions()].some(t=>t.qDef.cId===e.qDef.cId)}async addMeasures(e,t=!1){const n=[];for(const r of e){const e=await this.addMeasure(r,t,void 0,!0);e&&n.push(e)}return n}addAlternativeMeasures(e,t){if(this.#g(e))return;const n=this.getAlternativeMeasures(),r=void 0===t?n.length:t,i=n.splice(r,0,e);return this.#y({cId:e.qDef.cId,alternative:!0,addLast:void 0===t}),i}async addMeasure(e,t,n,r){if(this.#g(e))return;if(e.qDef.cId||(e.qDef.cId=fA()),t)return this.addAlternativeMeasures(e,n);r||delete e.qDef.qNumFormat;const i=this.getMeasures();if(i.length<this.maxMeasures()){const t=1===i.length;return void 0!==n&&n>=0?i.splice(n,0,e):i.push(e),this.autoSortMeasure(e).then(()=>(t&&(this.hcProperties.qInterColumnSortOrder.push(-1),0===this.getDimensions().length&&(this.hcProperties.qNoOfLeftDims=0)),this.#y({cId:e.qDef.cId,addLast:void 0===n}),e))}return i.length<gA?(this.getAlternativeMeasures().push(e),this.#y({cId:e.qDef.cId,alternative:!0,addLast:void 0===n}),Promise.resolve(e)):Promise.resolve()}reinsertMeasure(e,t){const n=this.getMeasures(),r=this.getAlternativeMeasures(),i=this.hcProperties.qInterColumnSortOrder;if(e.qDef.cId||(e.qDef.cId=fA()),t=void 0!==t?t:n.length,n.length<this.maxMeasures()){if(n.splice(t,0,e),2===n.length){-1===i.indexOf(-1)&&i.push(-1)}this.#y({cId:e.qDef.cId})}else n.length<gA&&(t=r.length,r.splice(t,0,e),this.#y({cId:e.qDef.cId}));return Promise.resolve(e)}async removeMeasure(e,t){if(t&&"number"==typeof e){const t=this.getAlternativeMeasures().splice(e,1)[0];return this.#m({cId:t.qDef.cId,section:"measures"}),t}const n=this.getMeasures();let r,i,o;if("number"==typeof e&&e<n.length){r=2===n.length,i=this.getMeasures().splice(e,1)[0];const t=this.hcProperties.qInterColumnSortOrder;r&&(o=t.indexOf(-1),t.splice(o,1),this.hcProperties.qNoOfLeftDims&&o+1<=this.hcProperties.qNoOfLeftDims&&this.hcProperties.qNoOfLeftDims--)}else"number"==typeof e&&(i=this.getAlternativeMeasures().splice(e-n.length,1)[0]);if(i)return this.#m({cId:i.qDef.cId,section:"measures"}),i}async removeMeasures(e,t){return await Promise.all([...e].reverse().map(e=>this.removeMeasure(e,t))),e}#g(e){return!(!e||void 0===e.qDef.cId)&&[...this.getMeasures(),...this.getAlternativeMeasures()].some(t=>t.qDef.cId===e.qDef.cId)}getSorting(){throw new Error("don't call this")}changeSorting(){throw new Error("don't call this")}setSorting(){throw new Error("don't call this")}getRowDimensions(){const e=this.#v("rows"),t=this.getDimensions();return e.filter(e=>e>=0).map(e=>t[e])}getColumnDimensions(){const e=this.#v("columns"),t=this.getDimensions();return e.filter(e=>e>=0).map(e=>t[e])}getAlternativeRowDimensions(){const e=this.getAlternativeDimensions(),{excludedNoOfLeftDims:t}=this.hcProperties;return-1===t?e:e.slice(0,t)}getAlternativeColumnDimensions(){const e=this.getAlternativeDimensions(),{excludedNoOfLeftDims:t}=this.hcProperties;return-1===t?[]:e.slice(t)}#b(e){const t=this.hcProperties.rankedList?.[e];return t||this.createRankedList(e)}#x(e){return[...this.#b(e)]}#w(e,t){return void 0===this.hcProperties.rankedList&&(this.hcProperties.rankedList={}),this.hcProperties.rankedList[e]=t,t}#S(e){const t=({qDef:t})=>t.cId===e;if(-1===e){return this.hcProperties.qInterColumnSortOrder.indexOf(-1)+1<=this.hcProperties.qNoOfLeftDims?"rows":"columns"}return this.getRowDimensions().some(t)||this.getAlternativeRowDimensions().some(t)?"rows":this.getColumnDimensions().some(t)||this.getAlternativeColumnDimensions().some(t)?"columns":null}#C(e){const t=({qDef:t})=>t.cId===e;return!(!this.getAlternativeDimensions().some(t)&&!this.getAlternativeMeasures().some(t))}#v(e){const{qInterColumnSortOrder:t,qNoOfLeftDims:n}=this.hcProperties;if(this.#E())return"columns"===e?t:[];switch(e){case"rows":return-1===n?t:t.slice(0,n);case"columns":return-1===n?[]:t.slice(n);default:throw new Error(`Unknown section in #getInterColumnSortOrderBySection: ${e}`)}}#E(){const{qNoOfLeftDims:e}=this.hcProperties,t=-1===e||Number.isNaN(+e);return 0===this.getDimensions().length&&this.getMeasures().length>0&&t}#M(e){const t=this.hcProperties.qInterColumnSortOrder.indexOf(-1);if(-1===t)return!1;if(this.#E())return"columns"===e;if(void 0===this.hcProperties.qNoOfLeftDims)return"rows"===e;switch(e){case"rows":return t+1<=this.hcProperties.qNoOfLeftDims;case"columns":return t+1>this.hcProperties.qNoOfLeftDims;default:return!1}}#k(e,t=!0){const n=e=>-1===e?-1:e.qDef.cId;if("measures"===e)return this.getMeasures().concat(t?this.getAlternativeMeasures():[]).map(n);const r=this.#v(e),i=this.getDimensions(),o=r.map(e=>-1===e?-1:i[e]);switch(e){case"rows":return o.concat(t?this.getAlternativeRowDimensions():[]).map(n);case"columns":return o.concat(t?this.getAlternativeColumnDimensions():[]).map(n);default:throw new Error(`Unknown section in #isCorruptRankedList: ${e}`)}}isRankedListCorrupt(e){const t=this.hcProperties.rankedList?.[e],n=this.properties.qInfo?.qId;if(!t)return!0;if(new Set(t).size!==t.length){const r=t.filter((e,n)=>t.indexOf(e)!==n);return this.#d.warn({msg:"Corrupt ranked list detected: duplicate ids",payload:{duplicates:r,section:e,chartId:n}}),!0}const r=this.#k(e);if(t.length!==r.length)return this.#d.warn({msg:"Corrupt ranked list detected: length mismatch",payload:{section:e,chartId:n,fieldIds:r,rankedList:t,diff:new Set(r).symmetricDifference(new Set(t))}}),!0;const i=r.filter(e=>!t.includes(e));if(i.length>0)return this.#d.warn({msg:"Corrupt ranked list detected: missing ids",payload:{missingIds:i,section:e,chartId:n}}),!0;const o=this.#k(e,!1),s=t.filter(e=>o.includes(e)),a=o.filter((e,t)=>e!==s[t]);return a.length>0&&(this.#d.warn({msg:"Corrupt ranked list detected: main field order mismatch",payload:{section:e,chartId:n,orderMismatchIds:a}}),!0)}createRankedList(e){switch(e){case"rows":case"columns":return this.#I({section:e});case"measures":return this.#R();default:throw new Error(`Unknown section in getRankedList: ${e}`)}}#I({section:e}){const t=this.getDimensions(),n=this.#v(e),r="columns"===e?this.getAlternativeColumnDimensions():this.getAlternativeRowDimensions(),i=n.map(e=>-1===e?-1:t[e].qDef.cId);return i.push(...r.map(e=>e.qDef.cId)),this.#w(e,i)}#R(){if(void 0!==this.hcProperties.rankedList?.measures&&!this.#u("SUPPORT-9810-MISSING-MEASURES")&&!this.#u("SUPPORT-9810-MIGRATE-RANKED-LISTS"))return this.hcProperties.rankedList.measures;const e=[...this.getMeasures(),...this.getAlternativeMeasures()].map(e=>e.qDef.cId);return this.#w("measures",e)}#_({section:e,cId:t,fields:n,addLast:r}){const i=this.#b(e),o=n.findIndex(e=>e.qDef.cId===t),s=n[o+1]?.qDef.cId,a=n[o-1]?.qDef.cId;if(r)i.push(t);else if(o>=0)if(s){const e=i.indexOf(s);i.splice(e,0,t)}else if(a){const e=i.indexOf(a);i.splice(e+1,0,t)}else i.push(t);return void 0===this.hcProperties.rankedList&&(this.hcProperties.rankedList={}),this.hcProperties.rankedList[e]}#f({section:e,cId:t,alternative:n=!1,addLast:r=!1}){if(void 0===this.hcProperties.rankedList?.[e])return this.#I({section:e});let i;return i="columns"===e?n?this.getAlternativeColumnDimensions():this.getColumnDimensions():n?this.getAlternativeRowDimensions():this.getRowDimensions(),this.#_({section:e,cId:t,fields:i,addLast:r})}#y({cId:e,alternative:t=!1,addLast:n=!1}){if(void 0===this.hcProperties.rankedList?.measures)return this.#R();const r=t?this.getAlternativeMeasures():this.getMeasures();return this.#D(),this.#_({section:"measures",cId:e,fields:r,addLast:n})}#D(){const e=this.#b("rows"),t=this.#b("columns");this.#M("rows")&&!e.includes(-1)?e.push(-1):this.#M("columns")&&!t.includes(-1)&&t.push(-1)}#A(){if(this.hcProperties.qInterColumnSortOrder.includes(-1))return;const e=this.#b("rows"),t=this.#b("columns"),n=e.indexOf(-1),r=t.indexOf(-1);-1!==n&&e.splice(n,1),-1!==r&&t.splice(r,1)}#m({cId:e,section:t}){const n=this.#b(t),r=n.indexOf(e);-1!==r&&(n.splice(r,1),this.#A())}async moveMeasureToAlternative(e){const t=this.getMeasures().findIndex(t=>t.qDef.cId===e),n=this.#x("measures"),r=n.indexOf(e);if(-1===t)return;const i=await this.removeMeasure(t);if(void 0===i)return;const o=n.slice(r+1).find(e=>this.getAlternativeMeasures().some(t=>t.qDef.cId===e)),s=this.getAlternativeMeasures().findIndex(e=>e.qDef.cId===o);this.addAlternativeMeasures(i,-1===s?void 0:s),this.#w("measures",n)}async moveMeasureFromAlternative(e){const t=this.getAlternativeMeasures().findIndex(t=>t.qDef.cId===e),n=this.#x("measures"),r=n.indexOf(e);if(-1===t)return;const i=await this.removeMeasure(t,!0);if(void 0===i)return;const o=this.getMeasures().map(e=>e.qDef.cId),s=n.slice(r+1).find(e=>o.includes(e)),a=o.findIndex(e=>e===s);await this.addMeasure(i,!1,-1===a?void 0:a,!0),this.#w("measures",n)}async moveDimensionToAlternative(e){const t=this.#S(e),n=this.getDimensions().findIndex(t=>t.qDef.cId===e);if(-1===n||null===t)return;const r=this.#x(t),i=r.indexOf(e),o="columns"===t,s=await this.removeDimension(n,!1,o);if(void 0===s)return;const a=r.slice(i+1).find(e=>this.getAlternativeDimensions().some(({qDef:t})=>t.cId===e));let l=this.getAlternativeDimensions().findIndex(({qDef:e})=>e.cId===a);l=-1===l?void 0:l;void 0!==this.addAlternativeDimension(s,o,l)&&this.#w(t,r)}async moveDimensionFromAlternative(e){const t=this.#S(e),n=this.getAlternativeDimensions().findIndex(t=>t.qDef.cId===e);if(-1===n||null===t)return;const r=this.#x(t),i=r.indexOf(e),o="columns"===t,s=await this.removeDimension(n,!0,o);if(void 0===s)return;const a=this.#k(t,!1),l=r.slice(i+1).find(e=>a.includes(e));let c=a.findIndex(e=>e===l);c=-1===c?void 0:c;void 0!==await this.#h(s,o,c,!1,!0)&&this.#w(t,r)}movePseudoDimension({toIndex:e,toSection:t}){const n=this.#S(-1);if(null===n)return void this.#d.error({msg:"Cannot move pseudo dimension, unable to find it in any section",payload:{toIndex:e,toSection:t}});const r="columns"===t,i=n===t,o=this.#x(t);if(i){const e=o.indexOf(-1);o.splice(e,1)}else{const i=this.#b(n),o=i.indexOf(-1);if(-1===o)return void this.#d.error({msg:"Couldn't delete pseudo dimension from current section",payload:{toIndex:e,toSection:t,fromSection:n}});i.splice(o,1),this.hcProperties.qNoOfLeftDims=r?Math.max(0,this.hcProperties.qNoOfLeftDims-1):this.hcProperties.qNoOfLeftDims+1}const s=e-o.slice(0,e).filter(e=>this.#C(e)).length,a=r?this.hcProperties.qNoOfLeftDims+s:s,l=this.hcProperties.qInterColumnSortOrder.indexOf(-1);this.hcProperties.qInterColumnSortOrder.splice(l,1),this.hcProperties.qInterColumnSortOrder.splice(a,0,-1),o.splice(e,0,-1),this.#w(t,o)}async moveDimension({cId:e,toIndex:t,toSection:n}){const r=this.#S(e),i=this.#C(e);if(null===r)return void this.#d.error({msg:"Cannot move dimension, unable to find it in any section",payload:{cId:e}});const o=(i?this.getAlternativeDimensions():this.getDimensions()).findIndex(({qDef:t})=>t.cId===e);if(-1===o)return void this.#d.error({msg:"Couldn't find dimension to move",payload:{cId:e,toIndex:t,toSection:n}});const s=this.#x(n),a=s.indexOf(e);-1!==a&&s.splice(a,1);const l=Math.max(0,Math.min(t,s.length));l!==t&&this.#d.warn({msg:"[moveDimension] toIndex is out of bounds, clamping it",payload:{toIndex:t,clampedToIndex:l}});const c=l-s.slice(0,l).filter(e=>this.#C(e)!==i).length,u="columns"===n,d="columns"===r,h=await this.removeDimension(o,i,d);if(void 0===h)return;void 0!==await this.#h(h,u,c,i,!0)&&(s.splice(l,0,e),this.#w(n,s))}async moveMeasure({cId:e,toIndex:t}){const n=this.#C(e),r=(n?this.getAlternativeMeasures():this.getMeasures()).findIndex(t=>t.qDef.cId===e);if(-1===r)return void this.#d.error({msg:"Cannot move measure, unable to find it in any section",payload:{cId:e}});const i=this.#x("measures"),o=i.indexOf(e);-1!==o&&i.splice(o,1);const s=Math.max(0,Math.min(t,i.length));s!==t&&this.#d.warn({msg:"[moveMeasure] toIndex is out of bounds, clamping it",payload:{toIndex:t,clampedToIndex:s}});const a=await this.removeMeasure(r,n);if(void 0===a)return;const l=s-i.slice(0,s).filter(e=>this.#C(e)!==n).length;void 0!==await this.addMeasure(a,n,l,!0)&&(i.splice(s,0,e),this.#w("measures",i))}getLabels(){return this.getMeasures().filter(e=>!e.qLibraryId&&!!e.qDef.qLabel).map(e=>e.qDef.qLabel)}IsHCInStraightMode(){return"S"===this.hcProperties.qMode}getFilters(){return this.properties.filters??[]}getFilter(e){return this.getFilters().find(t=>t.id===e)}addFilterField(e){const t=e.qTags??e.tags,n=Array.isArray(t)&&t.includes("$numeric"),r=e.isDerived,i=Array.isArray(this.properties.filters)?this.properties.filters:[],o={type:"values",field:r?e.value??e.fullname:e.name??e.label??e.field,options:{values:[]},exclude:!1,id:fA(),qTags:Array.isArray(t)?t:[],isNumeric:n};return i.push(o),this.properties.filters=i,this.properties.qHyperCubeDef.qContextSetExpression=uA(i),o}addFilters(e){const t=[];for(const n of e)t.push(this.addFilterField(n));return t}#P(e){const t=this.getFilters();return t.splice(e,1),this.properties.qHyperCubeDef.qContextSetExpression=uA(t),t}removeFilters(e){if(0===e.length)return[];const t=[...e].sort((e,t)=>t-e),n=this.getFilters().filter((t,n)=>e.includes(n));for(const e of t)this.#P(e);return n}getAddDimensionLabel(){return this.#c.get("Visualization.Requirements.AddDimension")}canColorBy(){return!1}}var SA,CA={exports:{}};var EA=(SA||(SA=1,self,CA.exports=(()=>{var e={909:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},s=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],h=1,p=arguments.length,f=!1;for("boolean"==typeof d&&(f=d,d=arguments[1]||{},h=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});h<p;++h)if(null!=(t=arguments[h]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(f&&i&&(s(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},a(d,{name:n,newValue:e(f,u,i)})):void 0!==i&&a(d,{name:n,newValue:i}));return d}},8:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},s=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},a=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],h=1,p=arguments.length,f=!1;for("boolean"==typeof d&&(f=d,d=arguments[1]||{},h=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});h<p;++h)if(null!=(t=arguments[h]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(f&&i&&(s(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},a(d,{name:n,newValue:e(f,u,i)})):void 0!==i&&a(d,{name:n,newValue:i}));return d}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Ae});var e=r(229),t=r.n(e);const n=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],s=e;for(r=0;r<i.length-1;++r)void 0===s[i[r]]&&(s[i[r]]=Number.isNaN(+i[r+1])?{}:[]),s=s[i[r]];if(void 0!==n){var a=s[o];return s[o]=n,{updated:n,previous:a}}return delete s[o],!1},o=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},s={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var a="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function c(e){return a+e+l}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var s=r.qDerivedFieldData.qDerivedFieldLists[o],a=0;a<s.qFieldDefs.length;++a){var l=s.qFieldDefs[a];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function h(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function p(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function f(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function v(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function b(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,s=void 0===o?"Sum":o,a=e.valueComp,l=void 0===a?"0":a;if(!n.showExcludedValues)return"";if(r&&1===r.length){var c=v(u(r[0],i),f(0));return"".concat(s,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var d=u(r[0],i),h=u(r[1],i),p=f(0),m=f(1),g=v(d,p),y=v(h,m);return"".concat(s,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(s,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function w(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const S={isFullRange:d,getNumDimensions:w,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,s=c(p(t));if(!n.showExcludedValues)return s;var a=b({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var u=f(0);return"If(Count(".concat(u,") > 0, ").concat(s," + ").concat(a).concat(l,")")}if(r&&2===r.length){var d=f(0),h=f(1);return"If(Count(".concat(d,") * Count(").concat(h,") > 0, ").concat(s," + ").concat(a).concat(l,")")}return s},getRowNoComp:h,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return h(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return m(e,t)+n+g(r)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===w({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=f(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",s=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(s,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(s,")"):r},simplifyExpression:p,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(a);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+a.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach(function(n){void 0===e[n]&&(e[n]=t[n])})},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,s=void 0===o?2:o;if(!t&&!n)return!0;var a=w({properties:t,layout:n});return a>=i&&a<=s},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(a),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:f,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=n.qHyperCubeDef.qMeasures.find(function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null});i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=s.OPTIONS.find(function(t){return t.value===e.decomposition});return t?s.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(s.EXPRESSIONS).find(function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return s.EXPRESSIONS[n]&&r.includes(s.EXPRESSIONS[n].toLowerCase())&&(t=n),n}),t}};function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}var M=t().bind(null,!0),k={},I=Array.isArray;function R(e){return null!=e&&!Array.isArray(e)&&"object"===E(e)}function _(e){return void 0===e}function D(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function A(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach(function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=_(e[n||t])?o:e[t],e=e[n||t]}}),e}function P(e,t){var n=!0;if(R(e)&&R(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){P(e[r],t[r])||(n=!1)}),n);if(I(e)&&I(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!P(e[r],t[r]))return!1;return!0}return e===t}k.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?M({},{val:e}).val:e}(t[i]),s=e[i],a="".concat(n,"/").concat(i);P(o,s)||D(t,i)||(_(s)?r.push({op:"add",path:a,value:o}):R(o)&&R(s)?r=r.concat(k.generate(s,o,a)):I(o)&&I(s)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function s(e,t,n){if(e[n]&&_(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(P(t,i))return r;if(!_(t[0])&&_(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var a=i.length-1;a>=0;a-=1)-1===(o=s(t,i[a].qInfo&&i[a].qInfo.qId,a))?(r.push({op:"remove",path:"".concat(n,"/").concat(a)}),i.splice(a,1)):r=r.concat(k.generate(i[a],t[o],"".concat(n,"/").concat(a)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=s(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(s,o,a)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))}),Object.keys(e).forEach(function(i){_(t[i])&&!D(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},k.apply=function(e,t){t.forEach(function(t){var n,r,i=A(e,t.path),o=t.path.split("/").splice(-1)[0],s=o&&Number.isNaN(+o)?i[o]:i[+o]||i,a=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,s=e),"add"===t.op||"replace"===t.op)if(I(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(I(s)&&I(t.value)){var l,c=t.value.slice();s.length=0,(l=s).push.apply(l,function(e){if(Array.isArray(e))return C(e)}(r=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(R(s)&&R(t.value))n=s,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!D(n,e)&&delete n[e]}),M(s,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var u=A(e,t.from);I(i)?i.splice(+o,0,u.splice(+a,1)[0]):(i[o]=u[a],delete u[a])}else"remove"===t.op&&(I(i)?i.splice(+o,1):delete i[o])})},k.clone=function(e){return M({},e)},k.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},k.updateObject=function(e,t){Object.keys(e).length?k.apply(e,k.generate(e,t)):M(e,t)};const L=k,T=function(e,n,r){if(!e)return Promise.resolve();var i=L.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),e.applyPatches(i,!0)):Promise.resolve()};var O="accumulation";function q(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===O)return n[r]}function N(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===O)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var j={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const z={translationKey:"properties.modifier.accumulation",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,s=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=s;void 0===l&&(l=S.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=S.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=S.getNumStepComp(n,l),h=S.getAboveComp(n,l,u,d),p=S.getRangeComp("RangeSum",h);if(S.needDimension({modifier:n,properties:r,layout:i})){var f=S.getDimComp(c,1),m=S.getDimComp(c,0),g=S.getAggrComp(p,f,m);p=n.showExcludedValues?S.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,valueComp:g}):g}return p},extractInputExpression:S.extractInputExpression,initModifier:function(e){S.initModifier(e,j)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(N(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(N(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(N(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(N(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=q(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=q(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(N(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(O))return!1;var o=q(t,e);return o&&!o.disabled}};return n}};var F="movingAverage";function W(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===F)return n[r]}function $(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===F)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var B={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const V={translationKey:"properties.modifier.movingAverage",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,s=e.layout,a=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=a;void 0===c&&(c=S.getNumDimensions({properties:i,layout:s}));var u=o(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,h=S.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:d}),p=S.getNumStepComp(r,c),f=S.getAboveComp(r,c,h,p);if(r.nullSuppression)t=S.getRangeComp("RangeAvg",f);else{var m=S.getRangeComp("RangeSum",f),g=function(e,t){var n=S.getRowNoComp(e,t);if(!S.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,c);t="".concat(m," / ").concat(g)}var y=t;if(S.needDimension({modifier:r,properties:i,layout:s})){var v=S.getDimComp(u,1),b=S.getDimComp(u,0),x=S.getAggrComp(y,v,b);y=r.showExcludedValues?S.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:S.extractInputExpression,initModifier:function(e){S.initModifier(e,B)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat($(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat($(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat($(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat($(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=W(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=W(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat($(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat($(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(F))return!1;var o=W(t,e);return o&&!o.disabled}};return n}};var H="timeSeriesDecomposition";function G(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===H)return n[r]}function U(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===H)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Y={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const K={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?S.generateTSDExpression(n,t,r):t},extractInputExpression:S.extractInputExpression,initModifier:function(e,t){S.initModifier(e,Y),""===e.decomposition&&t&&(e.decomposition=S.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(U(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:s.OPTIONS},steps:{refFn:function(t){return"".concat(U(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=G(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map(function(e){return e.qDef.modifiers.map(function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e}),e})}},show:function(t){var n=G(t,e);return n&&!n.fullRange}}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(H))return!1;var o=G(t,e);return o&&!o.disabled}};return n}};var X="difference";function J(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===X)return n[r]}function Z(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===X)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:S.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,s=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=s;void 0===l&&(l=S.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=S.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=S.getAboveComp(n,l,u),h="".concat(u," - ").concat(d);if(S.needDimension({modifier:n,properties:r,layout:i})){var p=S.getDimComp(c,1),f=S.getDimComp(c,0),m=S.getAggrComp(h,p,f);h=n.showExcludedValues?S.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,funcComp:"Only",valueComp:m}):m}return h},initModifier:function(e){Object.keys(Q).forEach(function(t){void 0===e[t]&&(e[t]=Q[t])})},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(Z(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(X))return!1;var o=J(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function se(e){return 2===e?"{1}":""}function ae(e,t,n){return 1===e?"{$<".concat(S.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ce(e,t,n){return 0===e&&t>1?"<".concat(S.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:S.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,s=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=s;void 0===l&&(l=S.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=S.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=n.selectionScope,h=n.dimensionalScope;return function(e,t,n,r,i,o,s){var a=se(t),l=ae(t,n,r),c=""===a&&""===l?"":a||l,u=le(i,o),d=ce(i,o,s),h=function(e){for(var t=[],n=0;n<e;n++)t[n]=S.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(d," Aggr(").concat(c," ").concat(e,", ").concat(h,"))")}(u,d,n.field,n.value,h,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach(function(t){void 0===e[t]&&(e[t]=oe[t])})},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var r=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then(function(e){return e.map(function(e){return{label:e.qName,value:e.qName}})})},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(re(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(re(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,r){return function(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:se,getFieldSelectionComp:ae,getTotalComp:le,getSelectedDimComp:ce};var de="qDef.base",he="qDef.qDef",pe="qDef.base.qDef",fe="qLibraryId",me="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,pe);return void 0!==t?t:o(e,he)},getExpressionRef:function(e){return void 0!==o(e,pe)?pe:he},getLibraryIdRef:function(e){return o(e,me)?me:fe},getLibraryId:function(e){return o(e,me)||o(e,fe)},getLabelRef:function(e){return o(e,de)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,de)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",we="qDef.qLabel",Se="qDef.qLabelExpression",Ce="qDef.base.qLabel",Ee="qDef.base.qLabelExpression",Me="qDef.qAggrFunc",ke="qDef.base.qAggrFunc",Ie={initBase:function(e,t){(t||Ie.isValid(e))&&(n(e,ve,o(e,ye)),n(e,xe,o(e,be)),n(e,Ce,o(e,we)),n(e,Ee,o(e,Se)))},restoreBase:function(e){Ie.isValid(e)&&(n(e,ye,o(e,ve)),n(e,be,o(e,xe)),n(e,we,o(e,Ce)),n(e,Se,o(e,Ee)),o(e,Me)&&o(e,ke)&&n(e,Me,o(e,ke)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),n=o(e,xe);return void 0!==t||void 0!==n}};const Re=Ie;function _e(e){return _e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_e(e)}var De={accumulation:z,movingAverage:V,difference:ee,normalization:ue,timeSeriesDecomposition:K};const Ae={modifiers:De,apply:Le,applyModifiers:Te,cleanUpMeasure:Oe,destroy:function(e){e&&Pe[e.id]&&Pe[e.id].masterItemSubscriber&&(Pe[e.id].masterItemSubscriber&&Pe[e.id].masterItemSubscriber.unsubscribe(),delete Pe[e.id])},hasActiveModifiers:qe,getActiveModifier:Ne,initBase:Re.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return De[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return De[e]&&De[e].isApplicable({properties:n,layout:r})})},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=Fe(e);Ue({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ze({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:je};var Pe={};function Le(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,s=void 0!==i&&i,a=e.masterItem,l=!1;Pe[n.id]=Pe[n.id]||{isFirstTime:!0};var c=Pe[n.id].isFirstTime;if(Pe[n.id].isFirstTime=!1,r&&"object"===_e(r))return Te({model:n,properties:r});var u=n?n.layout:void 0,d=o(u,"qSelectionInfo.qInSelections");if(s||d)return Promise.resolve(l);var h=o(u,"qHyperCube.qMeasureInfo"),p=Pe[n.id].lastReloadTime;if(Pe[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),qe({measures:h,layout:u})){var f=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ge({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:h,layout:u,model:n,lastReloadTime:p});return f||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some(function(e){return function(e){var t=e.measure,n=e.layout;return Ue({modifiers:Fe(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:h,layout:u,masterItem:a,isFirstTime:c})?n.getEffectiveProperties().then(function(e){var r=t()(!0,{},e);$e(r);var i=Qe(r);return Ye({model:n}).then(function(t){return Ke({libraryIds:i,model:n}).then(function(i){return f&&function(e){var t=e.properties;ze(t).forEach(function(e){return function(e){var t=e.measure;if(Ge({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===_e(e)&&!e.disabled){if(n++,"object"!==_e(De[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=De[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Ve(t)&&S.simplifyExpression(t.qDef.base.qDef)!==S.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:r}),Te({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:a,libraryItemsProps:i,dimensionAndFieldList:t})})})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===_e(e.base)})}(h)?n.getEffectiveProperties().then(function(e){return function(e){var n=e.model,r=e.properties,i=Qe(r);return et({model:n,libraryIds:i}).then(function(){var e=t()(!0,{},r);return ze(r).forEach(function(e){return Oe(e)}),Je({oldProperties:e,newProperties:r,model:n})})}({model:n,properties:e})}):Promise.resolve(l)}function Te(e){var n=e.model,r=e.oldProperties,i=e.properties,s=e.measures,a=e.runUpdateIfChange,l=void 0!==a&&a,c=e.masterItem,u=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),$e(i);var h=Qe(i);return et({model:n,libraryIds:h,masterItem:c}).then(function(){return function(e){var n=e.measures,r=e.properties,i=e.model,s=e.libraryItemsProps,a=e.dimensionAndFieldList;if(n||(n=ze(r)),!n.length)return Promise.resolve();if(!qe({measures:n,properties:r}))return n.forEach(function(e){return Oe(e)}),Promise.resolve();var l=s?void 0:Qe(r);return Ye({model:i,dimensionAndFieldList:a}).then(function(e){return Ke({libraryIds:l,model:i,libraryItemsProps:s}).then(function(i){n.forEach(function(n){Ue({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,s=e.dimensionAndFieldList,a=0;Re.isValid(n)||Re.initBase(n,!0);var l=n.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach(function(e){if("object"===_e(e)&&!e.disabled){if(a++,"object"!==_e(De[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(a>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");De[e.type].initModifier(e,n);var l=n.qLibraryId||u&&u.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,s=e.libraryItemsProps[e.libraryId],a=s.qMeasure.qDef,l=""===a?a:De[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||s.qMeasure.qLabel)&&(n.qDef.qLabel=s.qMeasure.qLabel),(n.qDef.qLabelExpression||s.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=s.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&s.qMeasure.qNumFormat&&(n.qDef.qNumFormat=s.qMeasure.qNumFormat,n.qDef.isCustomFormatted=s.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=s.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:s}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof De[r.type].updateModifier&&De[r.type].updateModifier(r,i.qHyperCubeDef);var s=ge.getExpression(n),a=""===s?s:De[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=a,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||s,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:s}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||je(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&je(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}})}({measure:n,properties:r,libraryItemsProps:i,dimensionAndFieldList:e}),Be(n)):Oe(n)})})})}({measures:s,properties:i,model:n,libraryItemsProps:u,dimensionAndFieldList:d}).then(function(){return l?Je({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)})})}function Oe(e){!function(e){var t=Fe(e);return Array.isArray(t)&&t.some(function(e){return"object"===_e(e)&&!e.disabled&&!De[e.type]})}(e)?Re.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Be(e)}function qe(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ue({modifiers:Fe(e),properties:n,layout:r})})}function Ne(e){var t=Fe(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(De[r.type]&&!r.disabled)return r}}function je(e){var t=Ne(e);return!t||De[t.type].enableTotalsFunction(e)}function ze(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function Fe(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function We(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function $e(e){ze(e).forEach(function(e){return function(e){var n=Ne(e);n&&(void 0!==n.outputExpression&&We(n)!==e.qDef.qDef?delete e.qDef.base:!Re.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)})}function Be(e){var t=Fe(e);Array.isArray(t)&&t.forEach(function(t){"object"===_e(t)&&(t.disabled||!De[t.type]&&We(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function Ve(e){return e.base||e.qDef&&e.qDef.base}function He(e){var t=Ve(e);return e.qLibraryId||t&&t.qLibraryId}function Ge(e){var t=e.measure,n=e.properties,r=e.layout;return!He(t)&&Ue({modifiers:Fe(t),properties:n,layout:r})}function Ue(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==_e(e)||e.disabled||!De[e.type])&&(void 0===i[e.type]&&(i[e.type]=De[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Ye(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then(function(e){i.dimensionList=e});r.push(o);var s=t.app.getFieldList().then(function(e){i.fieldList=e});return r.push(s),Promise.all(r).then(function(){return i})}function Ke(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,s={},a=[];return i.forEach(function(e){var t=n.app.getMeasure(e).then(function(t){return t.getProperties().then(function(t){s[e]=t})});a.push(t)}),o.forEach(function(e){var t=n.app.getDimension(e).then(function(t){return t.getProperties().then(function(t){s[e]=t})});a.push(t)}),Promise.all(a).then(function(){return s})}function Xe(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Xe)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):T(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Ze(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===_e(e)&&!e.disabled&&De[e.type]&&De[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Qe(e){var t=ze(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=Fe(t);if(Ue({modifiers:r,properties:e})){var o=He(t);o&&n.push(o),i=i||Ze({modifiers:r,properties:e})}}),o(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&r.push(t)}),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Pe[t.id].masterItemSubscriber=Pe[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},s={},a={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&a[n]&&a[n].forEach(function(n){t[n]=o(e,n)}),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function u(e,n){return t.app[n](e).then(function(t){r[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}})}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,a=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach(function(e){i[e]=!0}),s={},t.forEach(function(e){s[e]=!0})}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach(function(e){i[e]||s[e]||(r[e].listener.dispose(),delete r[e])}),t.app&&(Object.keys(i).forEach(function(e){i[e]&&!r[e]&&a.push(u(e,"getMeasure"))}),Object.keys(s).forEach(function(e){s[e]&&!r[e]&&a.push(u(e,"getDimension"))})),Promise.all(a)},unsubscribe:function(){Object.keys(r).forEach(function(e){r[e].listener.dispose()}),r={}}}}({model:t,callback:function(e){return Le({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),Pe[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}n.d(r,{default:()=>$e});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var s=r[o];if(""!==s){if(void 0===i[s]||null===i[s])return n;i=i[s]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,s=0;s<r.length-1;++s){var a=r[s];void 0!==o[a]&&null!==o[a]||(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function s(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}const d={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:u};var h=n(8),p=n.n(h);const f=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,s(r.qDimensions));var a,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(a=i.excludedDimensions).push.apply(a,s(l))},m=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var s,a=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");a&&(s=i.excludedMeasures).push.apply(s,l(a))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&d.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach(function(e){t.properties[e]=n[e]})},v=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach(function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])}),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach(function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)})}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},b=function(e){e.forEach(function(e){p().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)})};function x(e,t,n){var r,i,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((i=(i=(r=JSON.stringify(a)).match(/:\{/g))?i.length:0)>2&&!s)return;a=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var l=o.getValue(e,"qLayoutExclude.quarantine");l[n]||(l[n]={}),l[n][t]=a}var w=n(909),S=n.n(w);function C(e,t){var n=S()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function E(e,t){return S()(!0,{},t,e)}function M(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var k=Math.pow(2,53)-1;function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const _=function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},D=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},A=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},P=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},L=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},T=function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,s=e.defaultDimension,a=n.data[0];for(t=0;t<a.dimensions.length;++t){var l=C(a.dimensions[t],s);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<a.excludedDimensions.length;++t){var c=C(a.excludedDimensions[t],s);o.qDimensions.length<i?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},O=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,s=e.defaultMeasure,a=n.data[0];for(t=0;t<a.measures.length;++t){var l=E(a.measures[t],s);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<a.excludedMeasures.length;++t){var c=E(a.excludedMeasures[t],s);o.qMeasures.length<i?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},q=function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},s=r.measures||{max:0},a=M(s.max,i.dimensions.length,k),l=M(s.min,i.dimensions.length,0);return{maxDimensions:M(o.max,a,k),minDimensions:M(o.min,l,0),maxMeasures:a,minMeasures:l}},N=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(d.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,d.indexRemoved(n.qInterColumnSortOrder,o))},j=function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach(function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=S()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some(function(e){return"general"===e.key})}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]}),null===(i=S()(!0,{},n,i)).components&&(i.components=[]),i},z=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=t.data[0];return s.dimensions.length>n&&n>0||s.measures.length>i&&i>0||s.excludedDimensions.length>0&&s.dimensions.length+s.excludedDimensions.length>r||s.excludedMeasures.length>0&&s.measures.length+s.excludedMeasures.length>o||!i&&s.measures.length>0||!n&&s.dimensions.length>0},F=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=e.newHyperCubeDef,a=t.data[0];s.qLayoutExclude||(s.qLayoutExclude={}),s.qLayoutExclude.qHyperCubeDef||(s.qLayoutExclude.qHyperCubeDef={}),(a.dimensions.length>n&&n>0||a.excludedDimensions&&a.excludedDimensions.length&&a.dimensions.length+a.excludedDimensions.length>r)&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(a.measures.length>i&&i>0||a.excludedMeasures&&a.excludedMeasures.length&&a.measures.length+a.excludedMeasures.length>o)&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&a.measures.length&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&a.dimensions.length&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},W=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var s=o.getValue(n,i||"").qHyperCubeDef,a=function(e){if(Array.isArray(e))return I(e)}(t=s.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return I(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?I(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();s.qDimensions=[],a.forEach(function(e){s.qDimensions.push(e),r.dimensions.added(e,n)})}},$=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var s=o.getValue(n,i||"").qHyperCubeDef,a=function(e){if(Array.isArray(e))return R(e)}(t=s.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return R(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();s.qMeasures=[],a.forEach(function(e){s.qMeasures.push(e),r.measures.added(e,n)})}},B=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&p().isSupportedModifiers(n)&&t.forEach(function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store})};function V(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach(function(t){o.setValue(e,t,n[t])}),delete e.qLayoutExclude.quarantine[t],!0)}const H={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),s=t.qProperty,a=o.getValue(s,n||""),l=a.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),f({exportFormat:i,qHyperCubeDef:l}),m({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:s}),n&&(i.properties.qHyperCubeDef=l,delete a.qHyperCubeDef),v({exportFormat:i,properties:s}),r||b(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(x(i.properties,"filters","storedFilters",!0),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(x(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(x(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,s=void 0===i?{}:i,a=e.defaultPropertyValues,l=void 0===a?{}:a,c=e.hypercubePath,u=e.extension,d=e.supportedFilters,h=void 0===d||d,p=e.isHCModifierSupported,f=void 0===p||p,m={qChildren:[]},g=j({exportFormat:t,initialProperties:r,hypercubePath:c}),y=o.getValue(r,c||"").qHyperCubeDef,v=o.getValue(g,c||"").qHyperCubeDef,b=q({exportFormat:t,dataDefinition:s}),x=b.maxDimensions,w=b.minDimensions,S=b.maxMeasures,C=b.minMeasures,E=l.defaultDimension,M=void 0===E?P():E,k=l.defaultMeasure,I=void 0===k?L():k;v.qDimensions.length=0,v.qMeasures.length=0,z({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:S,minMeasures:C})&&F({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:S,minMeasures:C,newHyperCubeDef:v}),T({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:v,defaultDimension:M}),O({exportFormat:t,maxMeasures:S,minMeasures:C,newHyperCubeDef:v,defaultMeasure:I}),W({newProperties:g,dataDefinition:s,hypercubePath:c}),$({newProperties:g,dataDefinition:s,hypercubePath:c}),N({exportFormat:t,newHyperCubeDef:v}),D("qMaxStackedCells",y,v),D("qNoOfLeftDims",y,v),A("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),A("qMode",y,v,"S"),A("qReductionMode",y,v,"N"),A("qSortbyYValue",y,v),A("qIndentMode",y,v),A("qShowTotalsAbove",y,v),_(g,t,r),m.qProperty=g;var R=o.getValue(u||{},"support.modifiers");return B({measures:v.qMeasures,modifierTypes:R}),h&&V(m.qProperty,"storedFilters"),"S"===v.qMode&&f&&V(m.qProperty,"dynamicScript"),m}};var G={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function U(e,t,n,r){t=t||[];var i=u(e,r,n),o=u(t,r,n);if(-1!==i&&-1===o){var s=e.splice(i,1);t.push(s[0])}return t}function Y(e,t){return e.length!==t}const K={create:function(e,t){if(!e||!G[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach(function(e){n[e]=t[e]}),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var s=e[o][n],a=t.length;if(U(s,t,r,i),Y(t,a))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},X={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},J={colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>0&&X.getNumMeasures(e)<=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>0},expression:function(e){return X.getNumMeasures(e)>=1}}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}};var Q={scatterplot:Z,"sn-scatter-plot":Z,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)<=1},expression:function(e){return X.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>=1},expression:function(e){return X.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=d.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=K.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}),t.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,s=e.measures,a=e.label;te(r,i);var l=r[r.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),h=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var p=K.create(K.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=s)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:p,label:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:h});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:p,measures:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:h})}n?(p.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(p)):l.qAttributeExpressions.push(p)}}}function ie(e,t,n,r){var i,o,s,a={};switch(e){case"dimension":n.qLibraryId?(a.type="dimension",a.name=n.qLibraryId,a.id=n.qLibraryId):(a.type="field",t?(a.name=n.label||n.qDef,a.id=n.qDef):(a.name=n.qDef.qFieldDefs[0],a.label=(s=n.qDef).qLabelExpression?s.qLabelExpression:s.qFieldLabels&&s.qFieldLabels[0]?s.qFieldLabels[0]:s.qFieldDefs[0]));break;case"measure":i=function(e,t){return t?e.qLibraryId:p().measureBase.getLibraryId(e)}(n,t),i?(a.type="measure",a.name=i,a.id=i,o=function(e,t){return p().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(a.expression=o)):(a.type="expression",t?(a.name=n.label||n.qExpression,a.id=n.qExpression):(a.name=n.qDef.qDef,a.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return a}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function se(e,t,n,r){var i=t.type,o=e.color,s=o.mode,a=X.getItemLabel(t);switch(ne(e,a||""),i){case"field":s="byDimension",o.byDimDef={label:t.label||X.wrapFieldName(t.name),key:X.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":s="byMeasure",o.byMeasureDef={label:a,key:t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":s="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":s="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}o.auto=!1,o.mode=s}function ae(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byDimDef");if(s&&ne(e,s.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,se(e,i)}(e,t);else if(function(e){return!e||!e.key}(s)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),s=Number(i[1]),a=o.getValue(t,"layers.".concat(s,".type"));return 2===e.length&&"map"===r&&"point"===a}(n,e,t)?0:n.length-1],i=K.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return se(e,ie("dimension",!!s,s||r)),!!s}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ce=function(e,t){var n={primary:!0};if(e){var r=(Q[t]||J).colorModeOptions||J.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ue=function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},de=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),s=o.getValue(e,"".concat(t,"qDimensions"),[]),a=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(s,l):!(n={auto:i,colorMode:r,dimensions:s}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?ae(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,s=e.properties,a=o.getValue(s,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==a&&!i.length)}({auto:i,colorMode:r,dimensions:s,measures:a,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),s=o.getValue(e,"color.byMeasureDef");if(s&&ne(e,s.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(s))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,se(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(s,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],s=K.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(i.qAttributeExpressions,"id",s);return se(e,ie("measure",!!a,a||r[0])),!!a}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,s)}(e,t)},he=function(e){e.forEach(function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode})},pe=function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},fe=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},me=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=H.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],s=o.dimensions.concat(o.excludedDimensions),a=o.measures.concat(o.excludedMeasures),l=K.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return K.moveByIdFromGroup(s,[],"qAttributeDimensions",c),K.moveByIdFromGroup(s,[],"qAttributeExpressions",c),K.moveByIdFromGroup(a,[],"qAttributeExpressions",u),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,s=e.hypercubePath,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=H.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:s,extension:a,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty,h=o.getValue(d,"visualization"),p=o.getValue(d,"qHyperCubeDef.qDimensions",[]),f=o.getValue(d,"color.mode",""),m=o.getValue(d,"color.auto",""),g=ce(d,h),y=ue({canColorBy:g,autoColor:m,colorMode:f,dimensions:p});return g[f]?pe({shouldUpdateColorBy:y,properties:d})&&fe(d):me(d),y&&de(d,"qHyperCubeDef."),ge(d)&&le(d,"color.persistent",!0),he(p),u}};var ve=["bar","marker","line"];const be=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?V(n,"unsupportedAutoMinMax")||S()(n.measureAxis,t.measureAxis):V(n,"supportedAutoMinMax")||S()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,s=i.qHyperCubeDef,a=i.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach(function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),ve.includes(r)&&t[i].type[r]++,t[i].type.total++}}),t}(s);l.length?(o&&(t=l.filter(function(e){return e.type[o]>0}).sort(function(e,t){return t.type[o]-e.type[o]})),t&&t.length||(t=l.sort(function(e,t){return t.type.total-e.type.total})),t&&t[0]&&S()(a,n.properties.measureAxes[t[0].axis])):S()(a,n.properties.measureAxes[0])}},we=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},Se={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,s=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),a=s.properties;return o?(x(a,"measureAxis.min","supportedAutoMinMax"),x(a,"measureAxis.max","supportedAutoMinMax")):(x(a,"measureAxis.min","unsupportedAutoMinMax"),x(a,"measureAxis.max","unsupportedAutoMinMax")),s},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,s=e.measureType,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:a,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty;return be({initialProperties:n,properties:d}),xe({exportFormat:t,initialProperties:n,properties:d,measureType:s}),we(d.qHyperCubeDef),d.qHyperCubeDef.qColumnOrder=[],d.qHyperCubeDef.columnOrder=[],u}};function Ce(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,s=e.itemPath,a=o.getValue(i,s);if(void 0!==a){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var c=Ce(n,r,l);o.setValue(t,c,a),o.setValue(i,s,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})})}function Me(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,s=e.itemPath,a=o.getValue(i,"qDef.cId");if(a){var l=Ce(n,r,a),c=o.getValue(t,l);void 0!==c&&(o.setValue(i,s,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})})}var ke="qHyperCubeDef.qMeasures",Ie="conditionalColoring",Re="measures",_e="qDef.conditionalColoring";const De={quarantine:function(e){Ee({properties:e,arrayPath:ke,quarantineName:Ie,arrayName:Re,itemPath:_e})},unquarantine:function(e){Me({properties:e,arrayPath:ke,itemPath:_e,arrayName:Re,quarantineName:Ie})}};var Ae="qHyperCubeDef.qMeasures",Pe="measures",Le="qHyperCubeDef.qDimensions",Te="dimensions",Oe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",qe="alternativeMeasures",Ne="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",je="alternativeDimensions",ze="qCalcCondition",Fe="conditionalShowHide";const We={quarantine:function(e){Ee({properties:e,arrayPath:Ae,quarantineName:Fe,arrayName:Pe,itemPath:ze}),Ee({properties:e,arrayPath:Le,quarantineName:Fe,arrayName:Te,itemPath:ze})},unquarantine:function(e){Me({properties:e,arrayPath:Ae,quarantineName:Fe,arrayName:Pe,itemPath:ze}),Me({properties:e,arrayPath:Le,quarantineName:Fe,arrayName:Te,itemPath:ze})},quarantineAlternative:function(e){Ee({properties:e,arrayPath:Oe,quarantineName:Fe,arrayName:qe,itemPath:ze}),Ee({properties:e,arrayPath:Ne,quarantineName:Fe,arrayName:je,itemPath:ze})},unquarantineAlternative:function(e){Me({properties:e,arrayPath:Oe,quarantineName:Fe,arrayName:qe,itemPath:ze}),Me({properties:e,arrayPath:Ne,quarantineName:Fe,arrayName:je,itemPath:ze})}},$e={hypercube:H,colorChart:ye,axisChart:Se,quarantineProperty:x,unquarantineProperty:V,quarantineArrayProp:Ee,unquarantineArrayProp:Me,conditionalColoring:De,conditionalShow:We}})(),r.default})()),CA.exports),MA=Rr(EA);const kA="qHyperCubeDef.qMeasures",IA="measures",RA="qHyperCubeDef.qDimensions",_A="dimensions",DA="qDef.representation",AA="tableRepresentation",PA="qDef.conditionalColoring",LA="conditionalColoring",TA="qMiniChartDef",OA="miniChartDef";function qA(e){const{translator:t}=e;return{targets:[{path:"/qHyperCubeDef",dimensions:{min:1,max:1e3,description(e,n,r){const i="rows"===r?.type?"Visualizations.Descriptions.Row":"Visualizations.Descriptions.Column";return t.get(i)}},measures:{min:1,max:1e3,description:()=>t.get("Visualizations.Descriptions.Values")},filters:{description:()=>t.get("SimpleProperties.Filters.Filter")}}]}}const NA="qHyperCubeDef.qDimensions",jA="dimensions",zA="qOtherTotalSpec.qTotalMode",FA="totalMode",WA={quarantine(e){MA.quarantineArrayProp({properties:e,arrayPath:NA,quarantineName:FA,arrayName:jA,itemPath:zA})},unquarantine(e){MA.unquarantineArrayProp({properties:e,arrayPath:NA,quarantineName:FA,arrayName:jA,itemPath:zA})}};function $A(e){const t=qA(e);return(e,n,r,i)=>{const o=MA.hypercube.importProperties({exportFormat:e,initialProperties:n,dataDefinition:t.targets[0],hypercubePath:i}),s=o.qProperty.qHyperCubeDef.qDimensions.length,a=o.qProperty.qHyperCubeDef.qMeasures.length;let l,c=o.qProperty.qHyperCubeDef.qInterColumnSortOrder,u=!0;s+a===c.length&&mD(o,"qProperty.qLayoutExclude.quarantine.interColSortOrder",c.concat());const d=o.qProperty.qLayoutExclude.quarantine?.pivotInterColSortOrder;d?(c=d,l=[...d],mD(o,"qProperty.qHyperCubeDef.qInterColumnSortOrder",c),o.qProperty.qLayoutExclude.quarantine&&delete o.qProperty.qLayoutExclude.quarantine.pivotInterColSortOrder):c.length=0;const h=+(c.indexOf(-1)>-1),p=s+h;if(p>c.length)for(let e=c.length;e<p;e++)c.indexOf(e)<0&&c.push(e-h);for(let e=c.length-1;e>=0;e--)c[e]>=s&&c.splice(e,1);a>1&&c.indexOf(-1)<0?c.push(-1):a<2&&c.indexOf(-1)>-1&&c.splice(c.indexOf(-1),1);const f=o.qProperty.qHyperCubeDef.qNoOfLeftDims??-1;if(s>0&&-1===f&&mD(o,"qProperty.qHyperCubeDef.qNoOfLeftDims",s),l?.length===c.length){for(let e=0;e<l.length;e++)if(l[e]!==c[e]){u=!1;break}u&&(MA.unquarantineProperty(o.qProperty,"noOfLeftDims"),MA.unquarantineProperty(o.qProperty,"excludedNoOfLeftDims "))}return MA.unquarantineProperty(o.qProperty,"rankedList"),MA.conditionalShow.unquarantine(o.qProperty),WA.unquarantine(o.qProperty),(e=>{MA.unquarantineArrayProp({properties:e,arrayPath:RA,itemPath:DA,arrayName:_A,quarantineName:AA}),MA.unquarantineArrayProp({properties:e,arrayPath:kA,itemPath:DA,arrayName:IA,quarantineName:AA}),MA.unquarantineArrayProp({properties:e,arrayPath:kA,itemPath:PA,arrayName:IA,quarantineName:LA}),MA.unquarantineArrayProp({properties:e,arrayPath:kA,itemPath:TA,arrayName:IA,quarantineName:OA})})(o.qProperty),MA.unquarantineProperty(o.qProperty,"pivotTableIndentMode"),o}}function BA(e,t){const n=e.qProperty.qHyperCubeDef.qInterColumnSortOrder,r=n.slice(),i=n.indexOf(-1);i>-1&&n.splice(i,1);const o=MA.hypercube.exportProperties({propertyTree:e,hyperCubePath:t}),s=o.properties.qHyperCubeDef,a=s.qDimensions.length,l=s.qMeasures.length;let c=s.qInterColumnSortOrder;mD(o,"properties.qLayoutExclude.quarantine.pivotInterColSortOrder",r),MA.quarantineProperty(o.properties,"qHyperCubeDef.qNoOfLeftDims","noOfLeftDims"),delete o.properties.qHyperCubeDef.qNoOfLeftDims,MA.quarantineProperty(o.properties,"qHyperCubeDef.rankedList","rankedList"),delete o.properties.qHyperCubeDef.rankedList;const u=o.properties.qLayoutExclude.quarantine?.interColSortOrder;u&&(c=u,mD(o,"properties.qHyperCubeDef.qInterColumnSortOrder",c),mD(o,"data.0.interColumnSortOrder",c),o.properties.qLayoutExclude.quarantine&&delete o.properties.qLayoutExclude.quarantine.interColSortOrder);for(let e=c.length;e<a+l;e++)c.length<=e&&c.push(e);return MA.quarantineProperty(o.properties,"qHyperCubeDef.qIndentMode","pivotTableIndentMode"),MA.quarantineProperty(o.properties,"qHyperCubeDef.excludedNoOfLeftDims ","excludedNoOfLeftDims "),MA.conditionalShow.quarantine(o.properties),WA.quarantine(o.properties),(e=>{MA.quarantineArrayProp({properties:e,arrayPath:RA,itemPath:DA,arrayName:_A,quarantineName:AA}),MA.quarantineArrayProp({properties:e,arrayPath:kA,itemPath:DA,arrayName:IA,quarantineName:AA}),MA.quarantineArrayProp({properties:e,arrayPath:kA,itemPath:PA,arrayName:IA,quarantineName:LA}),MA.quarantineArrayProp({properties:e,arrayPath:kA,itemPath:TA,arrayName:IA,quarantineName:OA})})(o.properties),o}const VA=e=>({dimensions:{min:1,max:1e3,description(t,n,r){const i="rows"===r?.type?"Visualizations.Descriptions.Row":"Visualizations.Descriptions.Column";return e.translator.get(i)}},measures:{min:1,max:1e3,description:()=>e.translator.get("Visualizations.Descriptions.Values")}}),HA=["rows","columns","measures"],GA=e=>"string"==typeof e&&e.length>0,UA=e=>{const t=e.flags.isEnabled("SUPPORT-9810-MIGRATE-RANKED-LISTS"),n=e.flags.isEnabled("VNA-670-SEPARATE_NULL_VALUE_STYLING"),r=e.flags.isEnabled("qcb-35151-fix-duplicate-columns-pivot"),i=e.flags.isEnabled("SUPPORT-11928-CORRUPT-SORT-ORDER");if(!(t||n||r||i))return;const o=new wA({},e),s=Rf(e,{tag:"sn-pivot-table"});return{properties(e){if(!("qHyperCubeDef"in e))return e;if(r&&((e,t)=>{const{qHyperCubeDef:n}=e,r=n.qLayoutExclude?.qHyperCubeDef,i=new Set;let o=0,s=0;[...n.qDimensions,...n.qMeasures,...r?.qDimensions??[],...r?.qMeasures??[]].forEach(e=>{const t=e.qDef?.cId;if(!GA(t)||i.has(t)){GA(t)?o++:s++;const n=fA();return e.qDef={...e.qDef,cId:n},void i.add(n)}i.add(t)}),o>0&&t.error({msg:"migrate: duplicate field cId issues detected",payload:{duplicateCount:o}}),s>0&&t.error({msg:"migrate: missing field cId issues detected",payload:{missingCount:s}})})(e,s),i&&((e,t)=>{const{qHyperCubeDef:n}=e,r=new Set(n.qDimensions.map((e,t)=>t));n.qMeasures.length>1&&r.add(-1);const i=new Set(r),o=n.qInterColumnSortOrder,s=Array.isArray(o)?o.filter(e=>i.delete(e)):[],a=[];if(Array.isArray(o)){o.length!==r.size&&a.push(`Incorrect length: expected ${r.size}, received ${o.length}`);const e=o.filter((e,t)=>t in o);e.length!==o.length&&a.push("Sparse array"),new Set(e).size!==e.length&&a.push("Duplicate indexes"),e.some(e=>!r.has(e))&&a.push("Unexpected indexes")}else a.push("Sort order is not an array");i.size>0&&a.push(`Missing indexes: ${[...i].join(", ")}`),a.length>0&&(n.qInterColumnSortOrder=[...s,...i],t.error({msg:"migrate: corrupt sort order detected",payload:{reason:a.join("; ")}}))})(e,s),t&&"sn-pivot-table"===e.visualization&&(o.setProperties(e),HA.forEach(e=>{o.isRankedListCorrupt(e)&&o.createRankedList(e)})),n){const t=e.components?.find(e=>"theme"===e.key);t?.nullValues&&!t.dimensionNullValues&&(t.dimensionNullValues={...t.nullValues})}return e}}},YA={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}}}};let KA=function(e){return e.Text="text",e.Link="link",e.Image="image",e.ImagesInIndentMode="imagesInIndentMode",e.Indicator="indicator",e.MiniChart="miniChart",e.EditableText="editableText",e.EditableSelector="editableSelector",e.EditableDate="editableDate",e}({}),XA=function(e){return e.Attribute="attribute",e.Dimension="dimension",e}({});const JA=e=>{switch(e?.type){case"url":return KA.Link;case"image":return KA.Image;case"indicator":return KA.Indicator;case"miniChart":return KA.MiniChart;default:return KA.Text}},ZA=({isImagesEnabled:e})=>({uses:"dimensionRepresentationItems.representationType",options(t,n,r){const{qIndentMode:i}=r.properties.qHyperCubeDef,o=[{value:"text",translation:"Object.Table.Representation.Text"},{value:"url",translation:"Object.Table.Representation.Link"}];return(!i&&e||i)&&o.push({value:"image",translation:"Object.Table.Representation.Image"}),o}}),QA=e=>{if(e)return{representationImage:{uses:"dimensionRepresentationItems.representationImage",show:e=>JA(e.qDef.representation)===KA.Image,items:{imageSize:{options:[{value:"alwaysFit",translation:"properties.backgroundImage.sizeAlwaysFit"},{value:"fitWidth",translation:"properties.backgroundImage.sizeFitWidth"},{value:"fitHeight",translation:"properties.backgroundImage.sizeFitHeight"},{value:"fill",translation:"properties.backgroundImage.sizeStretch"},{value:"originalSize",translation:"properties.backgroundImage.originalSize"}]},imageBoxWidth:{ref:"qDef.representation.imageBox.width",translation:"properties.pivot.representation.image.imageBox.width",type:"number",expression:"optional",defaultValue:24,show:(e,t,n)=>{if(!n.properties.qHyperCubeDef)return!1;const{qInterColumnSortOrder:r,qNoOfLeftDims:i,qDimensions:o,qIndentMode:s}=n.properties.qHyperCubeDef;let a=!1;const l=o?.indexOf(e)??1/0;return(r?.slice(0,i)??[]).indexOf(l)>-1&&(a=!0),a&&s}}}}}},eP=e=>{const{anything:t}=e,n=!t.sense?.isUnsupportedFeature?.("tableImages");return{representationType:ZA({isImagesEnabled:n}),representationUrlPosition:{uses:"dimensionRepresentationItems.representationUrlPosition",show:e=>JA(e.qDef.representation)===KA.Link},representationUrlLabel:{uses:"dimensionRepresentationItems.representationUrlLabel",show:e=>JA(e.qDef.representation)===KA.Link&&e.qDef.representation?.urlPosition===XA.Dimension},representationLinkUrl:{uses:"dimensionRepresentationItems.representationLinkUrl",show:e=>JA(e.qDef.representation)===KA.Link&&e.qDef.representation?.urlPosition===XA.Attribute},...QA(n)}},tP=(e,t)=>{const{anything:n}=e,r=n.sense?.isUnsupportedFeature,i=!r?.("tableImages")&&t[KA.Image],o=!r?.("qMiniChartDef")&&t[KA.MiniChart],s=!r?.("tableIndicators")&&t[KA.Indicator],a=i&&t[KA.ImagesInIndentMode];return{representationType:{uses:"measureRepresentationItems.representationType",options:(e,t,n)=>(e=>{const{qIndentMode:t}=e.properties.qHyperCubeDef??{},n=[{value:"text",translation:"Object.Table.Representation.Text"}];return(!t&&i||t&&a)&&n.push({value:"image",translation:"Object.Table.Representation.Image"}),s&&n.push({value:"indicator",translation:"Object.Table.Representation.Indicator"}),o&&n.push({value:"miniChart",translation:"Common.MiniChart"}),n})(n)},representationImage:i?{uses:"measureRepresentationItems.representationImage",show:e=>JA(e.qDef.representation)===KA.Image,items:{imageSize:{options:[{value:"alwaysFit",translation:"properties.backgroundImage.sizeAlwaysFit"},{value:"fitWidth",translation:"properties.backgroundImage.sizeFitWidth"},{value:"fitHeight",translation:"properties.backgroundImage.sizeFitHeight"},{value:"fill",translation:"properties.backgroundImage.sizeStretch"},{value:"originalSize",translation:"properties.backgroundImage.originalSize"}]}}}:void 0,representationIndicator:s?{uses:"measureRepresentationItems.representationIndicator"}:void 0,representationMiniChart:o?{uses:"measureRepresentationItems.representationMiniChart"}:void 0}};let nP=function(e){return e.Dimension="dimensions",e.Measures="measures",e.Pivot="pivot",e}({}),rP=function(e){return e.CellForegroundColor="cellForegroundColor",e.CellBackgroundColor="cellBackgroundColor",e.ImageUrl="imageUrl",e.ImageLabel="imageLabel",e.Link="url",e.LinkLabel="urlLabel",e}({}),iP=function(e){return e.TopGrid="topGrid",e.LeftGrid="leftGrid",e.DataGrid="dataGrid",e}({}),oP=function(e){return e.Forward="forward",e.Backward="backward",e.None="none",e}({});const sP="image",aP=(e,t,n)=>{if(!n.properties.qHyperCubeDef.qIndentMode)return!0;const r=n.properties.qHyperCubeDef.qInterColumnSortOrder?.indexOf(-1)??-1;let i=n.properties.qHyperCubeDef.qNoOfLeftDims??-1;r>-1&&r<i&&(i-=1);const o=n.properties.qHyperCubeDef.qDimensions.indexOf(e);return 0===o||o>=i},lP=()=>({type:{type:"string",component:"dropdown",ref:"qDef.columnWidth.type",translation:"Object.Table.Column.Width",options:[{value:nR.Auto,translation:"Common.Auto"},{value:nR.FitToContent,translation:"Object.Table.Column.FitToContent"},{value:nR.Pixels,translation:"Object.Table.Column.Pixels"},{value:nR.Percentage,translation:"Object.Table.Column.Percentage"}],defaultValue:nR.Auto},sizePixels:{ref:"qDef.columnWidth.pixels",translation:"Object.Table.Column.Pixels",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:tR.PixelsDefault,show:e=>e.qDef.columnWidth?.type===nR.Pixels},sizePercentage:{ref:"qDef.columnWidth.percentage",translation:"Object.Table.Column.Percentage",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:tR.PercentageDefault,show:e=>e.qDef.columnWidth?.type===nR.Percentage}}),cP=({key:e,translation:t,env:n})=>{const r=!n.anything.sense?.isUnsupportedFeature?.("tableImages");return{[`${e}Auto`]:{ref:`qDef.${e}.auto`,type:"boolean",component:"switch",translation:t,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],defaultValue:!0,show:t=>!r||"labelTextAlign"===e||t.qDef.representation?.type!==sP},[e]:{ref:`qDef.${e}.align`,type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"align_left",labelPlacement:"bottom",value:"left",translation:"properties.dock.left"},{component:"icon-item",icon:"align_center",labelPlacement:"bottom",value:"center",translation:"Common.Center"},{component:"icon-item",icon:"align_right",labelPlacement:"bottom",value:"right",translation:"properties.dock.right"}],defaultValue:"left",show:t=>void 0!==t.qDef[e]&&!t.qDef[e].auto&&(!r||"labelTextAlign"===e||t.qDef.representation?.type!==sP)}}},uP="TOTAL_OFF",dP={component:"attribute-expression-reference",defaultValue:[],ref:"qAttributeExpressions",items:[{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.BackgroundExpression",defaultValue:"",id:rP.CellBackgroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",translation:"Object.Table.Measure.ForegroundExpression",defaultValue:"",id:rP.CellForegroundColor},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:rP.LinkLabel,tid:"URLLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:rP.Link,tid:"URLByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:rP.ImageLabel,tid:"ImageLabelByExpression",show:!1},{component:"expression",ref:"qExpression",expressionType:"measure",defaultValue:"",id:rP.ImageUrl,tid:"ImageUrlByExpression",show:!1}]},hP=e=>(e=>{const{translator:t,anything:n,flags:r}=e;return{type:"items",component:"data-assets-panel-pivot",translation:"Common.Data",items:{dimensions:{type:"array",component:"expandable-items",ref:"qHyperCubeDef.qDimensions",items:{field:{type:"items",translation:"Common.Field",items:{libraryId:{type:"string",component:"library-item",libraryItemType:"dimension",ref:"qLibraryId",translation:"Common.Dimension",show:e=>!!e.qLibraryId},inlineDimension:{component:"inline-dimension",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},nullSuppression:{type:"boolean",ref:"qNullSuppression",defaultValue:!1,translation:"properties.dimensions.showNull",inverted:!0},totalMode:{type:"string",component:"switch",translation:"properties.showTotals",ref:"qOtherTotalSpec.qTotalMode",defaultValue:uP,trueOption:{value:"TOTAL_EXPR",translation:"properties.on"},falseOption:{value:uP,translation:"properties.off"},show:!n.sense?.isUnsupportedFeature?.("totals")&&aP},totalsLabel:{type:"string",component:"expression",expressionType:"StringExpr",ref:"qTotalLabel",translation:"properties.totals.label",defaultValue:()=>t.get("Object.Table.Totals"),show:(e,t,r)=>!n.sense?.isUnsupportedFeature?.("totals")&&e.qOtherTotalSpec?.qTotalMode!==uP&&aP(e,0,r)},dimensionLimits:{uses:"dimensions.items.dimensionLimits"},showOthers:{uses:"dimensions.items.others"},globalGrouping:{type:"boolean",translation:"properties.dimensionLimits.globalGrouping",ref:"qOtherTotalSpec.qGlobalOtherGrouping",defaultValue:!1,show:e=>"OTHER_OFF"!==e.qOtherTotalSpec?.qOtherMode}}},presentation:{type:"items",translation:"properties.presentation",grouped:e.flags.isEnabled("VNA-727-HEADER-COLOR-EXPRESSION-PIVOT"),items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},...r.isEnabled("VNA-727-HEADER-COLOR-EXPRESSION-PIVOT")?{headerColoring:{type:"items",items:{headerText:{component:"text",translation:"properties.Header",style:"sHeader"},headerBackground:{ref:"qDef.headerColor.background",translation:"Object.Table.Measure.BackgroundExpression",component:"expression",expressionType:"StringExpression",defaultValue:""},headerForeground:{ref:"qDef.headerColor.foreground",translation:"Object.Table.Measure.ForegroundExpression",component:"expression",expressionType:"StringExpression",defaultValue:""}}},contentColoring:{type:"items",items:{contentText:{component:"text",translation:"properties.Content",style:"sHeader"},cellColoring:dP}},alignmentAndRepresentationAndResize:{type:"items",items:{...cP({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...cP({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...eP(e),...lP()}}}:{cellColoring:dP,...cP({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...cP({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...eP(e),...lP()}}}}},measures:{type:"array",component:"expandable-items",ref:"qHyperCubeDef.qMeasures",items:{field:{type:"items",translation:"Common.Field",items:{libraryId:{type:"string",component:"library-item",libraryItemType:"measure",ref:"qLibraryId",translation:"Common.Measure",show:e=>!!e.qLibraryId},inlineMeasure:{component:"inline-measure",show:e=>!e.qLibraryId},autoSort:{ref:"qDef.autoSort",type:"boolean",defaultValue:!0,show:!1},cId:{ref:"qDef.cId",type:"string",show:!1},numberFormatting:{uses:"measures.items.numberFormatting"}}},presentation:{type:"items",translation:"properties.presentation",grouped:e.flags.isEnabled("VNA-727-HEADER-COLOR-EXPRESSION-PIVOT"),items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Table.Columns.VisibilityCondition",defaultValue:{qv:""},isExpression:e=>"string"==typeof e&&e.trim().length>0},...r.isEnabled("VNA-727-HEADER-COLOR-EXPRESSION-PIVOT")?{headerColoring:{type:"items",items:{headerText:{component:"text",translation:"properties.Header",style:"sHeader"},headerBackground:{ref:"qDef.headerColor.background",translation:"Object.Table.Measure.BackgroundExpression",component:"expression",expressionType:"StringExpression",defaultValue:""},headerForeground:{ref:"qDef.headerColor.foreground",translation:"Object.Table.Measure.ForegroundExpression",component:"expression",expressionType:"StringExpression",defaultValue:""}}},contentColoring:{type:"items",items:{contentText:{component:"text",translation:"properties.Content",style:"sHeader"},cellColoring:dP}},alignmentAndRepresentationAndResize:{type:"items",items:{...cP({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...cP({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...tP(e,{[KA.Image]:!0,[KA.Indicator]:!0}),...lP()}}}:{cellColoring:dP,...cP({env:e,key:"labelTextAlign",translation:"Common.Text.LabelTextAlignment"}),...cP({env:e,key:"textAlign",translation:"Common.Text.TextAlignment"}),...tP(e,{[KA.Image]:!0,[KA.Indicator]:!0}),...lP()}}}}},filter:{type:"object",component:"filter-item-react",ref:"filter",tabName:"SimpleProperties.Filters.Filters"}}}})(e),pP="12px",fP="Source Sans Pro, sans-serif",mP="600",gP=15e3,yP=4/3,vP="-",bP=(e,t,n,r)=>({ref:e,translation:t,dualOutput:!0,type:"object",component:"color-picker",width:"auto",disableNone:r??!1,defaultValue(e,t,i){const o=r?.(e,t,i)??!1,s=i.theme.current(),a=n(s,o);return{color:"transparent"===a?"none":a}}}),xP=(e,t=!1)=>{return{value:e,label:t?(n=e,n.charAt(0).toUpperCase()+n.slice(1)):e,groupHeader:!1,disabled:!1,styles:t?{fontFamily:e}:void 0};var n},wP=({ref:e,themeAccessor:t,translator:n})=>({component:"dropdown",ref:e,options:(e,r,i)=>{const o=i.theme.current();return((e,t,n)=>{const r=t.fontFamily??"Source Sans Pro, sans-serif",i=t.fontFamilies??[],o=Array.from(new Set([e,r,...i])),s=[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0},...o.sort().map(e=>xP(e,!0))],a=[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0},...c_().filter(e=>!o.includes(e)).map(e=>xP(e,!0))];return[...s,...a.length>1?a:[]]})(t(o),o,n)},defaultValue:(e,n,r)=>t(r.theme.current())}),SP=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],CP=({ref:e,themeAccessor:t,translator:n})=>({component:"dropdown",ref:e,options:(e,r,i)=>{const o=i.theme.current();return((e,t,n)=>{const r=t.fontSize,i=t.fontSizes??[],o=Array.from(new Set([e,r,...i])),s=[{value:"ThemeHeader",label:n.get("properties.themeFontSizes"),metaText:n.get("properties.theme"),groupHeader:!0},...o.sort((e,t)=>parseInt(e,10)-parseInt(t,10)).map(e=>xP(e,!1))],a=[{value:"DefaultHeader",label:n.get("properties.allFontSizes"),metaText:n.get("properties.default"),groupHeader:!0},...SP.filter(e=>!o.includes(e)).map(e=>xP(e,!1))];return[...s,...a.length>1?a:[]]})(t(o),o,n)},defaultValue:(e,n,r)=>t(r.theme.current())}),EP=({section:e,defaultFontStyle:t,translator:n,flags:r,getThemeValue:i,translation:o,disableNoneCallback:s})=>({component:"panel-section",translation:o??`properties.pivot.${e}`,items:{content:{component:"items",ref:"components",key:"theme",items:{fontFamily:wP({ref:`${e}.fontFamily`,themeAccessor:t=>i(t,e,"fontFamily")??t.fontFamily,translator:n}),fontWrapperItem:{component:"inline-wrapper",items:{fontStyle:{component:"font-style-buttons",width:!1,ref:`${e}.fontStyle`,defaultValue:t??[]},fontSize:CP({ref:`${e}.fontSize`,themeAccessor:t=>i(t,e,"fontSize")??t.fontSize,translator:n}),fontColor:bP(`${e}.fontColor`,void 0,t=>i(t,e,"color")??t.color)}},background:bP(`${e}.background`,"properties.background",(t,n)=>{const r=n?HR.WHITE:HR.TRANSPARENT;return i(t,e,"backgroundColor")??r},s)}}}}),MP=e=>({type:"items",items:[{ref:e,type:"string",translation:"properties.pivot.nullValueText",defaultValue:"-"}]}),kP=e=>MP("dimensionNullValues"===e?"nullValueRepresentation.dimensionText":"nullValueRepresentation.text"),IP=({section:e,defaultFontStyle:t,fallbackBackground:n,getThemeValue:r,isNullValueText:i,translation:o})=>({component:"panel-section",translation:o??`properties.pivot.${e}`,items:{nullValueText:i?kP(e):void 0,content:{component:"items",ref:"components",key:"theme",items:{fontWrapperItem:{component:"inline-wrapper",items:{fontStyle:{component:"font-style-buttons",fullWidth:!0,ref:`${e}.fontStyle`,defaultValue:t??[]},fontColor:bP(`${e}.fontColor`,void 0,t=>r(t,e,"color")??t.color)}},background:bP(`${e}.background`,"properties.background",t=>r(t,e,"backgroundColor")??n??"transparent")}}}}),RP=(e,t)=>({component:"dropdown",ref:e,translation:t,options:[...Array(10).keys()].map(e=>({value:e+1,translation:e+1})),defaultValue:1});let _P=function(e){return e.Transparent="transparent",e.FontSecondary="#737373",e.DividerDark="#595959",e.DividerLight="#D9D9D9",e.NullValueBackground="#F2F2F2",e}({}),DP=function(e){return e.Solid="solid",e.None="none",e}({});const AP={display:"flex",justifyContent:"center",alignItems:"center"},PP={borderStyle:"solid"},LP={boxSizing:"border-box",padding:"4px 8px",userSelect:"none",WebkitUserSelect:"none"},TP={lineHeight:yP,textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},OP=e=>({whiteSpace:"unset",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",wordBreak:e>1?"break-word":"break-all"}),qP=(e,t)=>e>0?`${e}px ${DP.Solid} ${t}`:DP.None,NP=(e,t,n,r,i)=>{const o=Number(!t||i?.right),s=Number(!e||i?.bottom);return{borderRight:"rtl"!==r?qP(o,n):DP.None,borderBottom:qP(s,n),borderLeft:"rtl"===r?qP(o,n):DP.None,borderTop:DP.None}},jP=(e,t,n,r,i,o,s)=>{const a=NP(t,r,i,o,s);return e.isLeftDimension||(e.isLastDimension&&!t&&(a.borderBottom=qP(2,i)),n||(a.borderLeft="rtl"!==o?qP(1,i):"none",a.borderRight="rtl"===o?qP(1,i):"none")),a},zP=({bottomDivider:e,rightDivider:t,borderColor:n})=>{const r={};return e&&(r.borderBottom=qP(1,n)),t&&(r.borderRight=qP(1,n)),r},FP=(e,t,n)=>{switch(t){case"header":return e.object?.pivotTableV2?.dimension?.label?.name?.[n];case"dimensionValues":return e.object?.pivotTableV2?.dimension?.label?.value?.[n];case"measureLabels":return e.object?.pivotTableV2?.measure?.label?.name?.[n];case"measureValues":return e.object?.pivotTableV2?.measure?.label?.value?.[n];case"totalValues":return e.object?.pivotTableV2?.total?.label?.value?.[n];case"nullValues":case"dimensionNullValues":return e.object?.pivotTableV2?.null?.label?.value?.[n];default:return}},WP=e=>e.isEnabled("VNA-670-SEPARATE_NULL_VALUE_STYLING"),$P=(e,t)=>({type:"items",items:[{component:"styling-panel",chartTitle:"Object.PivotTable",subtitle:"LayerStyleEditor.component.styling",translation:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:!0,items:{headerSection:EP({section:"header",defaultFontStyle:["bold"],translator:e,flags:t,getThemeValue:FP}),dimensionValueSection:EP({section:"dimensionValues",translator:e,flags:t,getThemeValue:FP}),measureValueSection:EP({section:"measureValues",translator:e,flags:t,getThemeValue:FP}),measureLabelSection:IP({section:"measureLabels",getThemeValue:FP}),totalValuesSection:IP({section:"totalValues",defaultFontStyle:["bold"],getThemeValue:FP}),...WP(t)?{dimensionNullSection:IP({section:"dimensionNullValues",translation:"properties.table.dimensionNullValues",fallbackBackground:_P.NullValueBackground,getThemeValue:FP,isNullValueText:!0}),nullValues:IP({section:"nullValues",translation:"properties.table.measureNullValues",fallbackBackground:_P.NullValueBackground,getThemeValue:FP,isNullValueText:!0})}:{nullValues:IP({section:"nullValues",fallbackBackground:_P.NullValueBackground,getThemeValue:FP,isNullValueText:!1})},gridSection:{translation:"properties.pivot.grid",component:"panel-section",items:{gridItems:{component:"items",ref:"components",key:"theme",items:{lineClamp:RP("grid.lineClamp","ThemeStyleEditor.style.rowHeight"),columnLineClamp:RP("grid.columnLineClamp","ThemeStyleEditor.style.columnHeight"),border:bP("grid.border","properties.border",e=>e.object?.pivotTableV2?.grid?.borderColor??_P.DividerLight),divider:bP("grid.divider","properties.pivot.divider",e=>e.object?.pivotTableV2?.grid?.divider?.borderColor??_P.DividerDark),background:bP("grid.background","properties.background",e=>e.object?.pivotTableV2?.grid?.backgroundColor??_P.Transparent)}}}}}}]}),BP=e=>({type:"items",items:{nullValueText:e.isEnabled("VNA-670-SEPARATE_NULL_VALUE_STYLING")?void 0:{ref:"nullValueRepresentation.text",type:"string",translation:"properties.pivot.nullValueText",defaultValue:vP},alwaysFullyExpanded:{ref:"qHyperCubeDef.qAlwaysFullyExpanded",type:"boolean",translation:"properties.pivot.fullyExpanded",defaultValue:!1},indentMode:{ref:"qHyperCubeDef.qIndentMode",type:"boolean",translation:"properties.pivot.indentMode",defaultValue:!1,change(e){e.qHyperCubeDef.qShowTotalsAbove=!0}},type:{type:"string",component:"dropdown",ref:"qHyperCubeDef.indentModeColumnWidth.type",translation:"Object.Table.Column.Width",options:[{value:nR.Auto,translation:"Common.Auto"},{value:nR.Pixels,translation:"Object.Table.Column.Pixels"},{value:nR.Percentage,translation:"Object.Table.Column.Percentage"}],defaultValue:nR.Auto,show:e=>!!e.qHyperCubeDef.qIndentMode},sizePixels:{ref:"qHyperCubeDef.indentModeColumnWidth.pixels",translation:"Object.Table.Column.Pixels",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:tR.PixelsDefault,show:e=>{const t=e.qHyperCubeDef;return t.qIndentMode&&t.indentModeColumnWidth?.type===nR.Pixels}},sizePercentage:{ref:"qHyperCubeDef.indentModeColumnWidth.percentage",translation:"Object.Table.Column.Percentage",component:"expression",expressionType:"ValueExpression",expression:"optional",defaultValue:tR.PercentageDefault,show:e=>{const t=e.qHyperCubeDef;return t.qIndentMode&&t.indentModeColumnWidth?.type===nR.Percentage}},showTotalsAbove:{ref:"qHyperCubeDef.qShowTotalsAbove",type:"boolean",translation:"properties.pivot.showTotalsAbove",defaultValue:!0,show(e){const{qIndentMode:t}=e.qHyperCubeDef;return!t&&!!e.qHyperCubeDef.qDimensions.some(e=>"TOTAL_EXPR"===e.qOtherTotalSpec?.qTotalMode)}},resetProperties:{type:"object",component:"button",translation:"properties.pivot.resetExpansionButton",disabled:e=>!!e.qHyperCubeDef.qAlwaysFullyExpanded,action(e,t,n,r){e.qHyperCubeDef.qExpansionState=[],r.$emit("saveProperties",e)}}}}),VP=e=>{if(e.isEnabled("CLIENT_IM_5973_PIVOT_TABLE_EXPLORATION"))return{chartExploration:{type:"items",translation:"properties.chartExploration",items:{chartExplorationToggler:{type:"items",component:"chart-exploration-toggler",translation:"properties.enableChartExploration",ref:"enableChartExploration"},visibilityToggler:{show:e=>e.enableChartExploration,component:"buttongroup",translation:"properties.ChartExploration.VisibilityOption",ref:"chartExploration.menuVisibility",options:[{value:"auto",translation:"Common.Auto"},{value:"minimized",translation:"properties.ChartExploration.Minimized"}]}},show:e=>!e.insideContainer}}},HP=(e,t)=>({uses:"settings",items:{presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:[$P(e,t),BP(t)]},...VP(t)}}),GP="auto",UP={type:"items",translation:"properties.sorting",items:{sortbyY:{type:"items",items:{sortbyYToggle:{ref:"qHyperCubeDef.qSortbyYValue",type:"boolean",component:"switch",translation:"properties.sorting.sortByY.label",convertFunctions:{get:e=>!!e("integer"),set:(e,t)=>{t("integer",e?-1:0)}},options:[{value:!0,translation:"properties.on"},{value:!1,translation:"properties.off"}]},sortbyYOrder:{ref:"qHyperCubeDef.qSortbyYValue",type:"string",component:"dropdown",defaultValue:0,options:[{value:1,translation:"properties.sorting.ascending"},{value:-1,translation:"properties.sorting.descending"}],show:e=>!!e.qHyperCubeDef.qSortbyYValue}}},defaultSorting:{uses:"sorting",items:{dimensions:{showPriority:!1,allowMove:!1},measures:{included:!1}}},searchSorting:{ref:"search.sorting",type:"string",component:"dropdown",defaultValue:GP,translation:"Object.Table.SortingInSearch",options:[{value:GP,translation:"Common.Auto"},{value:"inherit",translation:"Object.Table.SortingInSearch.InheritFromDimension"}]}}};function YP(e){const{translator:t,flags:n}=e;return{type:"items",component:"accordion",items:{data:hP(e),sorting:UP,addons:YA,settings:HP(t,n)}}}function KP(e){return{support:{cssScaling:!0,snapshot:!0,export:!0,exploration:e.flags.isEnabled("CLIENT_IM_5973_PIVOT_TABLE_EXPLORATION"),sharing:!1,exportData:!0,viewData:!0},usePropertyHandler:"pivot-data",definition:YP(e),importProperties:$A(e),exportProperties:BA,exploration:iA(e),data:VA(e),migrate:UA(e),propertyHandler:e.flags.isEnabled("VNA-147_NEBULA_PIVOT_DATA_HANDLERS")?t=>new wA(t,e):void 0}}const XP=()=>{let e;const t=new Promise(t=>{e=t});return{promise:t,resolve:e}};function JP(e,t){return k(()=>e,t)}const ZP={},QP=e=>{const t=k(()=>({current:ZP}),[]);return t.current=t.current===ZP?e:t.current,t},eL=e=>!!e&&0===o_(e).a,tL="#grid",nL=(e,t)=>{const n=t?.closest(e);return n&&window.getComputedStyle(n).backgroundColor},rL=(e,t,n,r,i)=>{const o=nL(".qv-object .qv-inner-object",n),s=nL(".qv-panel-sheet",n),a=nL(tL,n)??s,l=(e=>{const t=e.components?.find(e=>"general"===e.key),n=t?.bgColor?.colorExpression,r=t?.bgColor?.color?.color,i=t?.bgColor?.useColorExpression;if(i&&n)return _D(n);if("none"===r)return"transparent";if(void 0===r)return;const o=o_(r);return o.setAlpha(t?.bgColor?.color?.alpha??o.a),o.getRGBA()})(e),c=r?.(t),u=i?.(t),d=l||c||o||u,h=eL(d),p=!eL(f=h?a:d)&&kD(f,HR.TEXT,HR.DARK_MODE_TEXT)===e_(HR.DARK_MODE_TEXT);var f;const m=((e,t,n,r=HR.WHITE)=>e&&!eL(e)?e:eL(t)?n&&!eL(n)?n:r:t)(l,d,a);return{color:d,headerColor:m,isDark:p}},iL=(e,t,n,r)=>{const i=A(),o=((e,t={attributeFilter:["style"],childList:!1,subtree:!1})=>{const[n,r]=_([]);return D(()=>{let n;return e&&(n=new MutationObserver(e=>{r(e)}),n.observe(e,t)),()=>{n?.disconnect()}},[e,t]),n})(t.closest(tL),{attributeFilter:["style"],childList:!1,subtree:!1,attributeOldValue:!0}).filter(({oldValue:e})=>e?.includes("background")).map(({oldValue:e})=>e).join(",");return k(()=>({...i,background:rL(e,i,t,n,r)}),[i.name(),t,n,r,e,o])};function oL(e,t){const n=k(()=>({isLoading:!0}),t),[r,i]=R(async()=>{try{return await e()}finally{n.isLoading=!1}},t);return[r,n.isLoading,i]}const sL=3,aL=/\n/g;function lL(e,t,n){let r=0,i=e.length;if(Number.isNaN(t))return null;if(e.length<=1)return null;if(n(e)<=t)return null;for(;r<=i;){const o=Math.floor((r+i)/2),s=e.slice(0,o),a=e.slice(0,o-1),l=n(s),c=n(a);if(l>t&&c<=t)return e.slice(o-1)||null;if(l===t)return e.slice(o)||null;l<t?r=o+1:i=o}return null}function cL({fontSize:e="12px",fontFamily:t="Source Sans Pro, Arial, sans-serif",fontStyle:n="normal",fontWeight:r="normal"},i){const{maxNbrLinesOfText:o=sL,allowLineBreaks:s=!0}=i??{},{estimateWidth:a,measureText:l,estimateLineCount:c}=m(()=>(({fontSize:e="12px",fontFamily:t="Source Sans Pro, Arial, sans-serif",fontStyle:n="normal",fontWeight:r="normal"},i)=>{const{maxNbrLinesOfText:o=sL,allowLineBreaks:s=!0}=i??{};return()=>{const i=document.createElement("canvas").getContext("2d");i.font=`${n} ${r} ${e} ${t}`;const a=i.measureText.bind(i),l=gD(e=>{if(void 0===e)return 0;if(s){const t=e.split(aL).map(e=>a(e).width);return t.reduce((e,t)=>t>e?t:e,0)}const t=e.replace(aL," ");return a(t).width}),c=e=>+l(e).toFixed(2),u=gD(({text:e,maxWidth:t,isNumeric:n=!1})=>{if(n)return 1;const r=s?e.split(aL):[e];let i=0;for(const e of r){let n=e;do{i+=1,n=lL(n,t,c)}while(null!==n&&i<o);if(i>=o)break}return i},({text:e,maxWidth:t,isNumeric:n})=>`${e}-${t}-${n?"true":"false"}`);return{measureText:e=>l(e),estimateWidth:e=>l("N")*e,estimateLineCount:u}}})({fontStyle:n,fontWeight:r,fontSize:e,fontFamily:t},{maxNbrLinesOfText:o,allowLineBreaks:s})(),[n,r,e,t,o,s]);return{estimateWidth:a,measureText:l,estimateLineCount:c}}var uL,dL={};var hL=function(){if(uL)return dL;uL=1;var e=C;return dL.createRoot=e.createRoot,dL.hydrateRoot=e.hydrateRoot,dL}();const pL="Source Sans Pro, sans-serif";function fL(e,t){const[n,r]=p(t),i=n.some((e,n)=>e!==t[n]);i&&(r(t),e())}var mL={NebulaTableUtils_ColumnAdjuster_ColumnNameLabel:{id:"NebulaTableUtils.ColumnAdjuster.ColumnNameLabel",locale:{"de-DE":"Breite von {0}","en-US":"Width of {0}","es-ES":"Ancho de {0}","fr-FR":"Largeur de {0}","it-IT":"Larghezza di {0}","ja-JP":"{0} の幅","ko-KR":"{0}의 너비","nl-NL":"Breedte van {0}","pl-PL":"Szerokość kolumny {0}","pt-BR":"Comprimento de {0}","ru-RU":'Ширина столбца "{0}"',"sv-SE":"Bredd på {0}","tr-TR":"{0} genişliği","zh-CN":"{0} 的宽度","zh-TW":"{0} 的寬度"}},NebulaTableUtils_MenuGroupLabel_Sorting:{id:"NebulaTableUtils.MenuGroupLabel.Sorting",locale:{"de-DE":"Sortierung","en-US":"Sorting","es-ES":"Ordenación","fr-FR":"Tri","it-IT":"Ordinamento","ja-JP":"ソート","ko-KR":"정렬","nl-NL":"Sorteren","pl-PL":"Sortowanie","pt-BR":"Classificação","ru-RU":"Сортировка","sv-SE":"Sortering","tr-TR":"Sıralama","zh-CN":"排序","zh-TW":"排序"}},NebulaTableUtils_MenuItemLabel_AdjustColumnSize:{id:"NebulaTableUtils.MenuItemLabel.AdjustColumnSize",locale:{"de-DE":"Spaltengröße anpassen","en-US":"Adjust column size","es-ES":"Ajustar el tamaño de columna","fr-FR":"Ajuster la taille de colonne","it-IT":"Regola dimensioni colonna","ja-JP":"列サイズを調整","ko-KR":"열 크기 조정","nl-NL":"Kolomgrootte aanpassen","pl-PL":"Dostosuj rozmiar kolumny","pt-BR":"Ajustar tamanho da coluna","ru-RU":"Настроить размер столбца","sv-SE":"Justera kolumnens storlek","tr-TR":"Sütun boyutunu ayarla","zh-CN":"调节列大小","zh-TW":"調整欄大小"}},NebulaTableUtils_MenuItemLabel_ClearSelections:{id:"NebulaTableUtils.MenuItemLabel.ClearSelections",locale:{"de-DE":"Auswahlen löschen","en-US":"Clear selections","es-ES":"Borrar selecciones","fr-FR":"Effacer les sélections","it-IT":"Cancella selezioni","ja-JP":"選択をクリア","ko-KR":"선택 지우기","nl-NL":"Geselecteerde waarden wissen","pl-PL":"Wyczyść wybory","pt-BR":"Limpar seleções","ru-RU":"Очистить выбранные","sv-SE":"Radera urval","tr-TR":"Seçimleri temizle","zh-CN":"清除选择项","zh-TW":"清除選項"}},NebulaTableUtils_MenuItemLabel_Collapse:{id:"NebulaTableUtils.MenuItemLabel.Collapse",locale:{"de-DE":"Reduzieren","en-US":"Collapse","es-ES":"Contraer","fr-FR":"Réduire","it-IT":"Comprimi","ja-JP":"折りたたむ","ko-KR":"축소","nl-NL":"Samenvouwen","pl-PL":"Zwiń","pt-BR":"Recolher","ru-RU":"Свернуть","sv-SE":"Dölj","tr-TR":"Daralt","zh-CN":"折叠","zh-TW":"收合"}},NebulaTableUtils_MenuItemLabel_ColumnOptions:{id:"NebulaTableUtils.MenuItemLabel.ColumnOptions",locale:{"de-DE":"Spaltenoptionen","en-US":"Column options","es-ES":"Opciones de columna","fr-FR":"Options de colonne","it-IT":"Opzioni colonna","ja-JP":"列オプション","ko-KR":"열 옵션","nl-NL":"Kolomopties","pl-PL":"Opcje kolumny","pt-BR":"Opções da coluna","ru-RU":"Параметры столбца","sv-SE":"Alternativ för kolumn","tr-TR":"Sütun seçenekleri","zh-CN":"列选项","zh-TW":"欄選項"}},NebulaTableUtils_MenuItemLabel_Expand:{id:"NebulaTableUtils.MenuItemLabel.Expand",locale:{"de-DE":"Erweitern","en-US":"Expand","es-ES":"Expandir","fr-FR":"Développer","it-IT":"Espandi","ja-JP":"展開","ko-KR":"확장","nl-NL":"Uitvouwen","pl-PL":"Rozwiń","pt-BR":"Expandir","ru-RU":"Развернуть","sv-SE":"Utöka","tr-TR":"Genişlet","zh-CN":"展开","zh-TW":"展開"}},NebulaTableUtils_MenuItemLabel_Search:{id:"NebulaTableUtils.MenuItemLabel.Search",locale:{"de-DE":"Suchen","en-US":"Search","es-ES":"Buscar","fr-FR":"Rechercher","it-IT":"Cerca","ja-JP":"検索","ko-KR":"검색","nl-NL":"Zoeken","pl-PL":"Wyszukaj","pt-BR":"Pesquisar","ru-RU":"Поиск","sv-SE":"Sök","tr-TR":"Ara","zh-CN":"搜索","zh-TW":"搜尋"}},NebulaTableUtils_MenuItemLabel_SelectAll:{id:"NebulaTableUtils.MenuItemLabel.SelectAll",locale:{"de-DE":"Alle auswählen","en-US":"Select all","es-ES":"Seleccionar todo","fr-FR":"Sélectionner tout","it-IT":"Seleziona tutti","ja-JP":"すべて選択","ko-KR":"모두 선택","nl-NL":"Alles selecteren","pl-PL":"Wybierz wszystko","pt-BR":"Selecionar tudo","ru-RU":"Выбрать все","sv-SE":"Välj alla","tr-TR":"Tümünü seç","zh-CN":"全选","zh-TW":"全選"}},NebulaTableUtils_MenuItemLabel_SelectAlternative:{id:"NebulaTableUtils.MenuItemLabel.SelectAlternative",locale:{"de-DE":"Alternative Werte auswählen","en-US":"Select alternative","es-ES":"Seleccionar alternativos","fr-FR":"Sélectionner des valeurs alternatives","it-IT":"Seleziona alternativi","ja-JP":"代替項目を選択","ko-KR":"대체 가능 값 선택","nl-NL":"Alternatief selecteren","pl-PL":"Wybierz alternatywę","pt-BR":"Selecionar alternativa","ru-RU":"Выбрать альтернативные","sv-SE":"Välj alternativ","tr-TR":"Alternatifi seç","zh-CN":"选择替代项","zh-TW":"選取替代選項"}},NebulaTableUtils_MenuItemLabel_SelectExcluded:{id:"NebulaTableUtils.MenuItemLabel.SelectExcluded",locale:{"de-DE":"Ausgeschlossene Werte auswählen","en-US":"Select excluded","es-ES":"Seleccionar excluidos","fr-FR":"Sélectionner les valeurs exclues","it-IT":"Seleziona esclusi","ja-JP":"除外項目を選択","ko-KR":"제외 항목 선택","nl-NL":"Uitgesloten waarden selecteren","pl-PL":"Wybierz wykluczone","pt-BR":"Selecionar excluídos","ru-RU":"Выбрать исключенные","sv-SE":"Välj uteslutna","tr-TR":"Hariç tutulanı seç","zh-CN":"选择排除项","zh-TW":"選取排除值"}},NebulaTableUtils_MenuItemLabel_SelectPossible:{id:"NebulaTableUtils.MenuItemLabel.SelectPossible",locale:{"de-DE":"Wählbare Werte auswählen","en-US":"Select possible","es-ES":"Seleccionar posibles","fr-FR":"Sélectionner les valeurs possibles","it-IT":"Seleziona possibili","ja-JP":"絞込項目を選択","ko-KR":"사용 가능 항목 선택","nl-NL":"Mogelijke waarden selecteren","pl-PL":"Wybierz możliwe","pt-BR":"Selecionar possíveis","ru-RU":"Выбрать возможные","sv-SE":"Välj möjliga","tr-TR":"Olası olanı seç","zh-CN":"选择可能值","zh-TW":"選取可能值"}},NebulaTableUtils_MenuItemLabel_Selections:{id:"NebulaTableUtils.MenuItemLabel.Selections",locale:{"de-DE":"Auswahlen","en-US":"Selections","es-ES":"Selecciones","fr-FR":"Sélections","it-IT":"Selezioni","ja-JP":"選択","ko-KR":"선택 내용","nl-NL":"Selecties","pl-PL":"Wybory","pt-BR":"Seleções","ru-RU":"Выборки","sv-SE":"Urval","tr-TR":"Seçimler","zh-CN":"选择项","zh-TW":"選項"}},NebulaTableUtils_MenuItemLabel_SortAscending:{id:"NebulaTableUtils.MenuItemLabel.SortAscending",locale:{"de-DE":"In aufsteigender Reihenfolge sortieren","en-US":"Sort ascending","es-ES":"Orden ascendente","fr-FR":"Trier par ordre croissant","it-IT":"Ordinamento crescente","ja-JP":"昇順でソート","ko-KR":"오름차순으로 정렬","nl-NL":"Oplopend sorteren","pl-PL":"Sortuj rosnąco","pt-BR":"Classificar em ordem crescente","ru-RU":"Сортировка по возрастанию","sv-SE":"Sortera stigande","tr-TR":"Artan sıralama","zh-CN":"升序排序","zh-TW":"以遞增方式排序"}},NebulaTableUtils_MenuItemLabel_SortDescending:{id:"NebulaTableUtils.MenuItemLabel.SortDescending",locale:{"de-DE":"In absteigender Reihenfolge sortieren","en-US":"Sort descending","es-ES":"Orden descendente","fr-FR":"Trier par ordre décroissant","it-IT":"Ordinamento decrescente","ja-JP":"降順でソート","ko-KR":"내림차순으로 정렬","nl-NL":"Aflopend sorteren","pl-PL":"Sortuj malejąco","pt-BR":"Classificar em ordem decrescente","ru-RU":"Сортировка по убыванию","sv-SE":"Sortera fallande","tr-TR":"Azalan sıralama","zh-CN":"降序排序","zh-TW":"以遞減方式排序"}},NebulaTableUtils_Pagination_DisplayedRowsLabel:{id:"NebulaTableUtils.Pagination.DisplayedRowsLabel",locale:{"de-DE":"{0} von {1}","en-US":"{0} of {1}","es-ES":"{0} de {1}","fr-FR":"{0} sur {1}","it-IT":"{0} di {1}","ja-JP":"{0} / {1}","ko-KR":"{0}/{1}","nl-NL":"{0} van {1}","pl-PL":"{0} z {1}","pt-BR":"{0} de {1}","ru-RU":"{0} из {1}","sv-SE":"{0} av {1}","tr-TR":"{0} / {1}","zh-CN":"{0} / {1}","zh-TW":"{0} / {1}"}},NebulaTableUtils_Pagination_FirstPage:{id:"NebulaTableUtils.Pagination.FirstPage",locale:{"de-DE":"Zur ersten Seite","en-US":"Go to the first page","es-ES":"Ir a la primera página","fr-FR":"Accéder à la première page","it-IT":"Vai alla prima pagina","ja-JP":"最初のページに移動","ko-KR":"첫 페이지로 이동","nl-NL":"Ga naar de eerste pagina","pl-PL":"Przejdź do pierwszej strony","pt-BR":"Ir para a primeira página","ru-RU":"Перейти к первой странице","sv-SE":"Gå till första sidan","tr-TR":"İlk sayfaya git","zh-CN":"转到第一页","zh-TW":"移至第一頁"}},NebulaTableUtils_Pagination_LastPage:{id:"NebulaTableUtils.Pagination.LastPage",locale:{"de-DE":"Zur letzten Seite","en-US":"Go to the last page","es-ES":"Ir a la última página","fr-FR":"Accéder à la dernière page","it-IT":"Vai all'ultima pagina","ja-JP":"最後のページに移動","ko-KR":"마지막 페이지로 이동","nl-NL":"Ga naar de laatste pagina","pl-PL":"Przejdź do ostatniej strony","pt-BR":"Ir para a última página","ru-RU":"Перейти к последней странице","sv-SE":"Gå till sista sidan","tr-TR":"Son sayfaya git","zh-CN":"转到最后一页","zh-TW":"移至最後一頁"}},NebulaTableUtils_Pagination_NextPage:{id:"NebulaTableUtils.Pagination.NextPage",locale:{"de-DE":"Zur nächsten Seite","en-US":"Go to the next page","es-ES":"Ir a la página siguiente","fr-FR":"Accéder à la page suivante","it-IT":"Vai alla pagina successiva","ja-JP":"次のページに移動","ko-KR":"다음 페이지로 이동","nl-NL":"Ga naar de volgende pagina","pl-PL":"Przejdź do następnej strony","pt-BR":"Ir para a próxima página","ru-RU":"Перейти к следующей странице","sv-SE":"Gå till nästa sida","tr-TR":"Sonraki sayfaya git","zh-CN":"转到下一页","zh-TW":"移至下一頁"}},NebulaTableUtils_Pagination_PreviousPage:{id:"NebulaTableUtils.Pagination.PreviousPage",locale:{"de-DE":"Zur vorherigen Seite","en-US":"Go to the previous page","es-ES":"Ir a la página anterior","fr-FR":"Accéder à la page précédente","it-IT":"Vai alla pagina precedente","ja-JP":"前のページに移動","ko-KR":"이전 페이지로 이동","nl-NL":"Ga naar de vorige pagina","pl-PL":"Przejdź do poprzedniej strony","pt-BR":"Ir para a página anterior","ru-RU":"Перейти к предыдущей странице","sv-SE":"Gå till föregående sida","tr-TR":"Önceki sayfaya git","zh-CN":"转到前一页","zh-TW":"移至上一頁"}},NebulaTableUtils_Pagination_RowsPerPage:{id:"NebulaTableUtils.Pagination.RowsPerPage",locale:{"de-DE":"Zeilen pro Seite","en-US":"Rows per page","es-ES":"Filas por página","fr-FR":"Lignes par page","it-IT":"Righe per pagina","ja-JP":"ページあたりの行数","ko-KR":"페이지별 행 수","nl-NL":"Rijen per pagina","pl-PL":"Wierszy na stronę","pt-BR":"Linhas por página","ru-RU":"Строк на странице","sv-SE":"Rader per sida","tr-TR":"Sayfa başına satır sayısı","zh-CN":"每页行数","zh-TW":"每頁列數"}},NebulaTableUtils_Pagination_SelectPage:{id:"NebulaTableUtils.Pagination.SelectPage",locale:{"de-DE":"Seite auswählen","en-US":"Select page","es-ES":"Seleccionar página","fr-FR":"Sélectionner une page","it-IT":"Seleziona pagina","ja-JP":"ページを選択","ko-KR":"페이지 선택","nl-NL":"Pagina selecteren","pl-PL":"Wybierz stronę","pt-BR":"Selecionar página","ru-RU":"Выберите страницу","sv-SE":"Välj sida","tr-TR":"Sayfa seç","zh-CN":"选择页面","zh-TW":"選取頁面"}}};const gL=({translator:e})=>(m(()=>{!function(e){if(e&&e.get&&e.add){const t="NebulaTableUtils.MenuGroupLabel.Sorting";if(e.get(t)!==t)return;Object.keys(mL).forEach(t=>{e.add(mL[t])})}}(e)},[e]),e),yL={width:"100%",height:"100%",color:"transparent",background:"transparent",borderColor:"transparent"},vL={border:0,boxShadow:"none",borderRadius:0,outline:0,width:0,height:0,background:"transparent",cursor:"pointer",visibility:"hidden"},bL=ka("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":{...yL},"&::-moz-range-track":{...yL},"&::-ms-track":{...yL},"&::-webkit-slider-thumb":{appearance:"none",WebkitAppearance:"none",...vL},"&::-moz-range-thumb":{...vL},"&::-ms-thumb":{...vL},"&: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"}})),xL=({columnWidth:e,keyValue:t,isLastColumn:n,isPivot:r,hoverColor:i,updateWidthCallback:o,confirmWidthCallback:a,handleBlur:l,setIsAdjustingWidth:c,isLeftColumn:u,accessibilityRelatedArgs:d,direction:h="ltr"})=>{const p=gL({translator:d.translator}),f=s({initWidth:e,columnWidth:e,initX:0}),m=n?0:1,g=r&&!u,y=()=>g?f.current.columnWidth-m:"100%",v={left:"rtl"!==h?y():void 0,right:"rtl"===h?y():void 0},b=t=>{f.current={initWidth:e,columnWidth:e,initX:t??f.current.initX}};fL(()=>{g&&b()},[e]);const x=e=>{const t=Math.max(e,tR.PixelsMin);f.current.columnWidth=t,o(t)},w=()=>{if(f.current.columnWidth!==f.current.initWidth){const e={type:nR.Pixels,pixels:f.current.columnWidth};a(e)}c?.(!1)},S=e=>{const t="rtl"===h?f.current.initWidth+f.current.initX-e.clientX:f.current.initWidth+e.clientX-f.current.initX;x(t)},C=e=>{DD(e),document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",C),w()},E=e=>{const t="rtl"===h?f.current.initWidth+-f.current.initX-e.touches[0].clientX:f.current.initWidth+e.touches[0].clientX-f.current.initX;x(t)},M=e=>{DD(e),document.removeEventListener("touchmove",E),document.removeEventListener("touchend",M),w()},k=!r&&l?e=>{if(e.key===QI.Left||e.key===QI.Right){DD(e);const t=5,n=e.key===QI.Left?t:-t,r="rtl"===h?n:-n;c?.(!0),x(f.current.columnWidth+r)}else e.key===QI.Space||e.key===QI.Enter?(DD(e),l(e),c?.(!1),w()):e.key===QI.Esc&&(DD(e),l(e),c?.(!1),x(f.current.initWidth))}:void 0,I=p.get("NebulaTableUtils.ColumnAdjuster.ColumnNameLabel",[String(d.columnLabel)]);return co.jsx(bL,{style:v,hoverColor:i,isLastColumn:n,className:eR,"data-testid":eR,onMouseDown:e=>{DD(e),document.addEventListener("mousemove",S),document.addEventListener("mouseup",C),c?.(!0),b(e.clientX)},onDoubleClick:()=>{a({type:nR.FitToContent})},onTouchStart:e=>{1===e.touches.length&&(DD(e),document.addEventListener("touchmove",E),document.addEventListener("touchend",M),c?.(!0),b(e.touches[0].clientX))},onKeyDown:k,onBlur:l,onFocus:()=>{b()},type:"range",tabIndex:-1,"aria-label":I,"aria-valuemin":tR.PixelsMin,"aria-valuemax":tR.PixelsMax,"aria-valuenow":Number(e.toFixed(1)),dir:h},t)},wL=v((e,t)=>co.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:co.jsx("path",{d:"M15 4H1V2h14zm0 10H1v-2h14zm0-5H1V7h14z"})})),SL=ka(hc,{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"})),CL=ka(wL,{shouldForwardProp:e=>"isInteractionsActive"!==e})(({isInteractionsActive:e})=>({minWidth:"unset",position:"relative",cursor:e?"pointer":"default"})),EL=ka(Id)(({theme:e})=>({".MuiList-root":{padding:e.spacing(.5,0)}})),ML=ka(su)(({theme:e})=>({"&.MuiDivider-root":{margin:e.spacing(.5)}})),kL=ka(Pd)(({theme:e})=>({fontSize:"12px",height:24,fontWeight:"bold",padding:`${e.spacing(.25,2)} !important`,marginBottom:e.spacing(.5)})),IL=ka(Pd,{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"})),RL=ka("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"})),_L=ka("div")(()=>({display:"flex",justifyContent:"space-between",alignItems:"center",maxWidth:"100%"})),DL=ka(Rl)(()=>({fontFamily:'"Source Sans Pro", HelveticaNeue, "Helvetica Neue", Helvetica, Arial, sans-serif',fontSize:"14px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"})),AL=ka(ed,{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})),PL=v((e,t)=>co.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:co.jsx("path",{d:"M8.5 8 4 3.5 5.5 2l6 6-6 6L4 12.5z"})})),LL=e=>{const t=e.nextElementSibling;return t?"HR"===t.tagName?LL(t):t:e.parentElement?.children?.[0]},TL=e=>{const t=e.previousElementSibling;if(!t){const t=e.parentElement?.children?.length;return e.parentElement?.children?.[t-1]}return"HR"===t.tagName?TL(t):t},OL=e=>{const{key:t,currentTarget:n}=e,r=document.activeElement??n;if(t===QI.Down||t===QI.Up){const n=e=>t===QI.Down?LL(e):TL(e);e.preventDefault(),e.stopPropagation();let i=n(r);for(;i;){if("true"!==i.ariaDisabled){i.focus();break}i=n(i)}}},qL=(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 NL={};const jL=({autoFocus:e,id:n,onClick:r,itemTitle:i,icon:o,enabled:s,subMenus:a,isSubMenu:l,isActive:c,direction:u,isPagination:h})=>{const[f,m]=p(!1),g=t.useRef(null),y=d(e=>{e.stopPropagation(),m(!1)},[m]);return co.jsxs(co.Fragment,{children:[co.jsxs(IL,{ref:a?g:null,"data-testid":`menu-item-${n}`,className:"nebula-table-utils-head-menu-item",onClick:async e=>{"keyup"!==e.type&&(r&&(await r(e),NL={}),a?.length&&(m(!0),NL[i]=m,e.stopPropagation()))},disabled:!s,autoFocus:e,isSubMenu:!!l,isActive:!!c,onKeyDown:OL,children:[c?co.jsx(RL,{direction:u,isPagination:h}):null,co.jsxs(_L,{children:[co.jsx(AL,{direction:u,isPagination:h,children:co.jsx(o,{})}),co.jsx(DL,{variant:"body2",children:i})]}),a?.length?co.jsx(PL,{}):null]},n),a?.length?co.jsx($L,{isSubMenu:!0,open:f,anchorEl:g.current,onClose:y,menuGroups:qL(a,NL),transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"top"},direction:u,isPagination:h}):null]})},zL=({menuGroup:e,isSubMenu:t,direction:n,isPagination:r})=>e.map(e=>[[e.groupHeading&&co.jsx(kL,{disabled:!0,style:{opacity:1},children:e.groupHeading},e.groupHeading),e.items.map(e=>co.jsx(jL,{...e,isSubMenu:t,direction:n,isPagination:r},e.id))].filter(Boolean)]),FL=({itemGroups:e,isSubMenu:t,direction:n,isPagination:r})=>e.map((i,o)=>[zL({menuGroup:i,isSubMenu:t,direction:n,isPagination:r}),o<e.length-1?co.jsx(ML,{"data-testid":"group-divider",variant:"middle"}):void 0]),WL={appear:0,enter:0,exit:0},$L=({anchorEl:e,open:t,onClose:n,menuGroups:r,transformOrigin:i,anchorOrigin:o,isSubMenu:s,direction:a,isPagination:l})=>r.length?co.jsx(EL,{className:"nebula-table-utils-head-menu",open:t,anchorEl:e,onClose:n,transitionDuration:WL,MenuListProps:{id:"nebula-table-utils-head-menu-list-id"},...o?{anchorOrigin:o}:{},...i?{transformOrigin:i}:{},dir:a,children:FL({itemGroups:r,isSubMenu:s,direction:a,isPagination:l})}):null,BL=(e,t)=>e.some(e=>t[e]>0),VL={canSelectAll:!1,canClearSelections:!1,canSelectPossible:!1,canSelectAlternative:!1,canSelectExcluded:!1},HL=({open:e,qStateName:t="$",headerData:n,app:r})=>{const[i,o]=p(null),[s,a]=p(VL);return fL(()=>{e||(a(VL),o(null))},[e]),c(()=>{if(!r?.createSessionObject||!n.isDim||!e)return()=>{};let i,s=!1;const l=()=>{i&&r.destroySessionObject(i)};return(async()=>{try{const e=((e,t)=>({qInfo:{qType:"tableListbox"},qListObjectDef:Boolean(t.qLibraryId)?{qLibraryId:t.qLibraryId,qStateName:e}:{qDef:{qFieldDefs:[t.fieldId]},qStateName:e}}))(t,n),c=await r.createSessionObject(e),u=await c.getLayout(),{qStateCounts:d}=u.qListObject?.qDimensionInfo??{};i=u.qInfo?.qId,s?l():(o(c),d&&a((e=>({canSelectAll:BL(["qOption","qAlternative","qExcluded","qDeselected"],e),canClearSelections:BL(["qSelected"],e),canSelectPossible:BL(["qOption"],e),canSelectAlternative:BL(["qAlternative"],e),canSelectExcluded:BL(["qAlternative","qExcluded"],e)}))(d)))}catch(e){console.error(e)}})(),()=>{s=!0,l()}},[e,r,n,t]),{fieldInstance:i,selectionActionsEnabledStatus:s}},GL=v((e,t)=>co.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:co.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"})})),UL=v((e,t)=>co.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:co.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"})})),YL=v((e,t)=>co.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:co.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"})})),KL=v((e,t)=>co.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:co.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"})})),XL=v((e,t)=>co.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:co.jsx("path",{d:"M.5 4.774v6.452a2 2 0 0 0 1.154 1.813l5.5 2.566a2 2 0 0 0 1.692 0l5.5-2.566a2 2 0 0 0 1.154-1.813V4.774a2 2 0 0 0-1.154-1.813L8.846.395a2 2 0 0 0-1.692 0l-5.5 2.566A2 2 0 0 0 .5 4.774m1 0v-.032l6 2.428v7.493l-5.423-2.53a1 1 0 0 1-.577-.907zm.545-.89.032-.016 5.5-2.567a1 1 0 0 1 .846 0l5.5 2.567.032.015L8 6.293zm12.455.858v6.484a1 1 0 0 1-.577.906L8.5 14.663V7.17z"})})),JL=v((e,t)=>co.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:co.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"})})),ZL=v((e,t)=>co.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:co.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"})})),QL=v((e,t)=>co.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:co.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"})})),eT=v((e,t)=>co.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:co.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"})})),tT=v((e,t)=>co.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:co.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"})})),nT=v((e,t)=>co.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:co.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"})})),rT=v((e,t)=>co.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:co.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"})})),iT=v((e,t)=>co.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:co.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"})})),oT=v((e,t)=>co.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:co.jsx("path",{d:"M1 1.5a.5.5 0 0 1 .5-.5H3V0H1.5A1.5 1.5 0 0 0 0 1.5V3h1zM14.5 1a.5.5 0 0 1 .5.5V3h1V1.5A1.5 1.5 0 0 0 14.5 0H13v1zM1 14.5a.5.5 0 0 0 .5.5H3v1H1.5A1.5 1.5 0 0 1 0 14.5V13h1zm14 0a.5.5 0 0 1-.5.5H13v1h1.5a1.5 1.5 0 0 0 1.5-1.5V13h-1zM6 0h4v1H6zM0 6h1v4H0zm15 0h1v4h-1zm-9 9h4v1H6z"})}));let sT=function(e){return e.Sorting="sorting",e.Searching="searching",e.Selections="selections",e.AdjusterHeaderSize="adjustHeaderSize",e}({});const aT="/qListObjectDef",lT=({headerData:e,translator:t,menuAvailabilityFlags:n,setOpen:r,sortFromMenu:i,interactions:o,embedListbox:s,fieldInstance:a,selectionActionsEnabledStatus:l,anchorRef:c,focusColumnAdjuster:u,setActiveFieldCallback:d,expandOrCollapseArgs:h})=>{const p=[];if(n[sT.Sorting]){const{isActivelySorted:n,sortDirection:o}=e,{ascendingEnabled:s,descendingEnabled:a}=(({isActivelySorted:e,sortDirection:t,isPivot:n,isSortedByFirstMeasure:r})=>{let i=!n&&!e||"D"===t,o=!n&&!e||"A"===t;return r&&(i=!1,o=!1),{ascendingEnabled:i,descendingEnabled:o}})(e);p.push([{groupHeading:t.get("NebulaTableUtils.MenuGroupLabel.Sorting"),items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SortAscending"),onClick:async e=>{e.stopPropagation(),await(i?.(e,"A")),r(!1)},icon:GL,enabled:s,isActive:!!n&&"A"===o,autoFocus:s},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SortDescending"),onClick:async e=>{e.stopPropagation(),await(i?.(e,"D")),r(!1)},icon:KL,enabled:a,isActive:!!n&&"D"===o,autoFocus:!s&&a}]}])}if(e.isCyclic&&d){const t=[];t.push([{items:[{id:1,itemTitle:e.groupDimensionLabels[e.groupDimensionPos],enabled:!0,icon:QL,subMenus:[[{items:e.groupDimensionLabels.map((t,n)=>({id:n+1,itemTitle:t,onClick:e=>{e.stopPropagation(),r(!1),d(n)},enabled:!0,icon:XL,isActive:e.groupDimensionPos===n}))}]]}]}]),t.length>0&&p.push(...t)}if(e.isDim&&o?.select){const i=[];n[sT.Searching]&&i.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Search"),onClick:e=>{e.stopPropagation(),r(!1),s()},icon:eT,enabled:!0}]}]),!e.isLocked&&n[sT.Selections]&&i.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Selections"),icon:oT,enabled:!!a,subMenus:[[{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectAll"),onClick:async e=>{e.stopPropagation(),r(!1),await(a?.selectListObjectAll(aT))},icon:tT,enabled:l.canSelectAll},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectPossible"),onClick:async e=>{e.stopPropagation(),r(!1),await(a?.selectListObjectPossible(aT))},icon:iT,enabled:l.canSelectPossible},{id:3,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectAlternative"),onClick:async e=>{e.stopPropagation(),r(!1),await(a?.selectListObjectAlternative(aT))},icon:nT,enabled:l.canSelectAlternative},{id:4,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.SelectExcluded"),onClick:async e=>{e.stopPropagation(),r(!1),await(a?.selectListObjectExcluded(aT))},icon:rT,enabled:l.canSelectExcluded}]}],[{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.ClearSelections"),onClick:async e=>{e.stopPropagation(),r(!1),await(a?.clearSelections(aT))},icon:UL,enabled:l.canClearSelections}]}]]}]}]),h&&!h.alwaysFullyExpanded&&p.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Expand"),onClick:async e=>{e.stopPropagation(),e.preventDefault(),r(!1),await h.expandCallback()},icon:ZL,enabled:!0},{id:2,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.Collapse"),onClick:async e=>{e.stopPropagation(),e.preventDefault(),r(!1),await h.collapseCallback()},icon:JL,enabled:!0}]}]),i.length>0&&p.push(...i)}return n[sT.AdjusterHeaderSize]&&p.push([{items:[{id:1,itemTitle:t.get("NebulaTableUtils.MenuItemLabel.AdjustColumnSize"),onClick:e=>{e.stopPropagation(),e.preventDefault(),r(!1),u?.(c)},icon:YL,enabled:!0}]}]),p},cT=({open:e,setOpen:t,anchorRef:n,headerData:r,translator:i,interactions:o,menuAvailabilityFlags:a,shouldShowMenuIcon:l=!0,sortRelatedArgs:c,searchRelatedArgs:u,selectionRelatedArgs:h,adjustHeaderSizeRelatedArgs:p,expandOrCollapseArgs:f,model:m,direction:g="ltr",isPagination:y,isAccessibleHeader:v,iconSize:b=XI})=>{const x=s(null),w=gL({translator:i}),{qLibraryId:S,fieldId:C,headTextAlign:E}=r,M=h?.app,{fieldInstance:k,selectionActionsEnabledStatus:I}=HL({open:e,headerData:r,app:M,qStateName:h?.qStateName}),R=(({model:e,headerData:t})=>{if(e&&"setActiveField"in e&&void 0!==t.dimensionInfoIndex){const n=t.dimensionInfoIndex;return async t=>{try{await e.setActiveField("/qHyperCubeDef",n,t)}catch(e){console.error(e)}}}return null})({model:m,headerData:r}),_=(({qLibraryId:e,fieldId:t,searchRelatedArgs:n,selectionRelatedArgs:r,direction:i,onPopoverClose:o})=>d(()=>{const s=e?{qLibraryId:e,type:"dimension"}:t;if(n?.embed){const{embed:e,listboxRef:t}=n;e.__DO_NOT_USE__.popover(t.current,s,{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"rtl"===i?"right":"left"},sortCriteria:n.sortCriteria,stateName:r?.qStateName,direction:i,onPopoverClose:o})}},[e,t,n,r?.qStateName,i,o]))({qLibraryId:S,fieldId:C,searchRelatedArgs:u,selectionRelatedArgs:h,direction:g}),D=d(e=>{e.stopPropagation(),t(!1)},[t]),A=d(e=>{e.stopPropagation(),t(e=>!e)},[t]);return o.active?co.jsxs(SL,{rightAligned:"right"===E,shouldShowMenuIcon:l,className:"nebula-table-utils-head-menu-wrapper",onClick:!1===v?A:void 0,ref:x,isAccessibleHeader:v,children:[l?co.jsx(CL,{height:b,className:JI,"data-testid":JI,isInteractionsActive:o.active??!1,children:co.jsx(wL,{})}):null,co.jsx($L,{open:e,anchorEl:!1===v?x.current:n.current,onClose:D,menuGroups:lT({headerData:r,translator:w,menuAvailabilityFlags:a,setOpen:t,...c,embedListbox:_,interactions:o,fieldInstance:k,selectionActionsEnabledStatus:I,anchorRef:n,focusColumnAdjuster:p?.focusColumnAdjuster,setActiveFieldCallback:R,expandOrCollapseArgs:f}),direction:g,isPagination:y})]}):null},uT=e=>e.isDark?{background:e.color,borderColor:HR.DARK_MODE_BORDER,color:HR.DARK_MODE_TEXT,disabledColor:HR.DARK_MODE_DISABLED,iconColor:HR.DARK_MODE_TEXT}:{background:e.color,borderColor:HR.BORDER_MEDIUM,color:HR.TEXT,disabledColor:HR.DISABLED},dT=ka(hc,{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}`})),hT=ka(hh,{shouldForwardProp:e=>"footerStyle"!==e})(({footerStyle:e,theme:t})=>({background:"inherit",marginRight:t.spacing(1),color:e.color,"& .MuiNativeSelect-icon, .MuiNativeSelect-select":{color:e.iconColor}})),pT=ka(Sc,{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)})),fT=ka(Rl)(({theme:e})=>({color:"inherit",margin:e.spacing(0,1,0,1)})),mT=({children:e,footerContainer:t,interactions:n,theme:r,paginationNeeded:i=!0})=>{const o=m(()=>uT(r.background),[r]);if(!n.active)return null;const s=i?co.jsx(dT,{footerStyle:o,children:e}):null;return t?C.createPortal(e,t):s},gT=v((e,t)=>co.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:co.jsx("path",{d:"m12 2 1.5 1.5L9 8l4.5 4.5L12 14 6 8zM4 2v12H2V2z"})})),yT=v((e,t)=>co.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:co.jsx("path",{d:"m3.5 2 6 6-6 6L2 12.5 6.5 8 2 3.5zM14 2v12h-2V2z"})})),vT=a({}),bT=()=>h(vT),xT=({children:e,direction:t,pageInfo:n,handleChangeRowsPerPage:r,footerContainer:i,isSelectionMode:o,handleChangePage:s,totalRowCount:a,totalColumnCount:l,totalPages:c,keyboard:u,translator:d,theme:h,interactions:p,rect:f,layout:g,visibilityThreshold:y})=>{const v=(e=>!e.enabled||e.active)(u)?0:-1,b=m(()=>uT(h.background),[h]),x=i?i.getBoundingClientRect().width:f.width,w=gL({translator:d}),S=m(()=>({direction:t,pageInfo:n,handleChangeRowsPerPage:r,footerContainer:i,isSelectionMode:o,handleChangePage:s,totalRowCount:a,totalColumnCount:l,totalPages:c,keyboard:u,translator:w,theme:h,interactions:p,rect:f,layout:g,footerStyle:b,tabIndex:v,width:x,visibilityThreshold:y}),[t,n,r,i,o,s,a,l,c,u,w,h,p,f,g,b,v,x,y]);return co.jsx(vT.Provider,{value:S,children:e})},wT=({disabledCondition:e,pageNumber:t,type:n,footerStyle:r,handleChangePage:i,translator:o,interactions:s,tabIndex:a})=>({footerStyle:r,disabledCondition:e,size:"small","data-testid":"pagination-action-icon-button","aria-disabled":e,"aria-label":o.get(`NebulaTableUtils.Pagination.${n}`),title:s.passive?o.get(`NebulaTableUtils.Pagination.${n}`):void 0,tabIndex:a,onClick:e?void 0:()=>{i(t)}});let ST=function(e){return e.FirstPage="FirstPage",e.LastPage="LastPage",e.NextPage="NextPage",e.PreviousPage="PreviousPage",e}({}),CT=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 ET=()=>{const{direction:e,pageInfo:t,width:n,interactions:r,visibilityThreshold:i,footerStyle:o,handleChangePage:s,translator:a,tabIndex:l}=bT(),c=0===t.page,u=wT({type:ST.FirstPage,disabledCondition:c,pageNumber:0,footerStyle:o,handleChangePage:s,translator:a,interactions:r,tabIndex:l});return n<=(i?.firstPage||CT.FirstPage)?null:co.jsx(pT,{...u,disabled:!r.active,children:"rtl"===e?co.jsx(yT,{height:XI}):co.jsx(gT,{height:XI})})},MT=(e,t,n=!1)=>{n&&e.key===QI.Tab&&!e.shiftKey&&(DD(e),((e,t,n)=>{const r=e.closest(".qv-object-wrapper")?.querySelector(".sel-toolbar-confirm")?.parentElement??document.querySelector("#qv-selection-toolbar-popover .sel-toolbar-confirm")?.parentElement;r?r.focus():t.focusSelection?.(n)})(e.target,t,!1))},kT=()=>{const{direction:e,pageInfo:t,keyboard:n,totalPages:r,isSelectionMode:i,width:o,interactions:s,visibilityThreshold:a,footerStyle:l,handleChangePage:c,translator:u,tabIndex:d}=bT(),h=t.page>=r-1,p=wT({type:ST.LastPage,disabledCondition:h,pageNumber:r-1,footerStyle:l,handleChangePage:c,translator:u,interactions:s,tabIndex:d}),f=n.enabled?e=>{MT(e,n,i)}:void 0;return o<=(a?.lastPage||CT.LastPage)?null:co.jsx(pT,{...p,onKeyDown:f,disabled:!s.active,children:"rtl"===e?co.jsx(gT,{height:XI}):co.jsx(yT,{height:XI})})},IT=v((e,t)=>co.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:co.jsx("path",{d:"m7 8 4.5 4.5L10 14 4 8l6-6 1.5 1.5z"})})),RT=()=>{const{direction:e,pageInfo:t,keyboard:n,totalPages:r,isSelectionMode:i,width:o,interactions:s,footerStyle:a,handleChangePage:l,translator:c,tabIndex:u}=bT(),d=t.page>=r-1,h=wT({type:ST.NextPage,disabledCondition:d,pageNumber:t.page+1,footerStyle:a,handleChangePage:l,translator:c,interactions:s,tabIndex:u}),p=!(o>CT.FirstPage&&o>CT.LastPage)&&n.enabled?e=>{MT(e,n,i)}:void 0;return co.jsx(pT,{...h,onKeyDown:p,disabled:!s.active,children:"rtl"===e?co.jsx(IT,{height:XI}):co.jsx(PL,{height:XI})})},_T=()=>{const{direction:e,pageInfo:t,interactions:n,footerStyle:r,handleChangePage:i,translator:o,tabIndex:s}=bT(),a=0===t.page,l=wT({type:ST.PreviousPage,disabledCondition:a,pageNumber:t.page-1,footerStyle:r,handleChangePage:i,translator:o,interactions:n,tabIndex:s});return co.jsx(pT,{...l,disabled:!n.active,children:"rtl"===e?co.jsx(PL,{height:XI}):co.jsx(IT,{height:XI})})},DT=()=>{const{translator:e,width:t,pageInfo:n,totalRowCount:r,visibilityThreshold:i}=bT(),{page:o,rowsPerPage:s}=n;if(t<=(i?.displayedRowsLabel||CT.DisplayedRowsLabel))return null;const a=e.get("NebulaTableUtils.Pagination.DisplayedRowsLabel",[`${o*s+1} - ${Math.min((o+1)*s,r)}`,r.toString()]);return co.jsx(fT,{variant:"caption",dir:"ltr",children:a})},AT=({name:e,value:t,options:n,handleChange:r})=>{const{layout:i,footerStyle:o,translator:s,tabIndex:a,interactions:l}=bT(),c=i.qInfo.qId,u=s.get(`NebulaTableUtils.Pagination.${e}`),d=`${e}-dropdown`,h=`${d}-label-${c}`,p={tabIndex:a,id:`${d}-${c}`,"data-testid":d,"aria-labelledby":h};return co.jsxs(co.Fragment,{children:[co.jsxs(fT,{variant:"caption",id:h,children:[u,":"]}),co.jsx(hT,{footerStyle:o,size:"small",native:!0,value:t,onChange:r,inputProps:p,disabled:!l.active,children:n})]})},PT=()=>{const{pageInfo:e,isSelectionMode:t,totalColumnCount:n,width:r,handleChangeRowsPerPage:i,visibilityThreshold:o}=bT();if(!(!!e.rowsPerPageOptions?.length&&!t&&r>(o?.rowsPerPage||CT.RowsPerPage)&&n<=100)||void 0===e.rowsPerPageOptions)return null;const s=co.jsx(co.Fragment,{children:e.rowsPerPageOptions.map(e=>co.jsx("option",{value:e,children:e},e))});return co.jsx(AT,{name:"RowsPerPage",value:e.rowsPerPage,options:s,handleChange:e=>{i?.(+e.target.value)}})},LT=1e3,TT="…",OT=({totalPages:e,page:t})=>{const n=Math.min(e,LT),r=n<e&&t>500,i=r?Math.min(500+t,e):n,o=r?Math.max(0,i-LT):0,s=Array.from(Array(n).keys()).map(e=>{const t=e+o;return co.jsx("option",{value:t,children:t+1},t)});return o>0&&s.unshift(co.jsx("option",{value:TT,disabled:!0,children:TT},"startMoreOptions")),i<e-1&&s.push(co.jsx("option",{value:TT,disabled:!0,children:TT},"endMoreOptions")),co.jsx(co.Fragment,{children:s})},qT=()=>{const{pageInfo:e,width:t,totalPages:n,handleChangePage:r,visibilityThreshold:i}=bT(),{page:o}=e;if(t<=(i?.selectPage||CT.SelectPage))return null;const s=co.jsx(OT,{totalPages:n,page:o});return co.jsx(AT,{name:"SelectPage",value:o,options:s,handleChange:e=>{r(+e.target.value)}})};var NT=y(e=>co.jsxs(xT,{...e,children:[co.jsx(PT,{}),co.jsx(qT,{}),co.jsx(DT,{}),co.jsx(ET,{}),co.jsx(_T,{}),co.jsx(RT,{}),co.jsx(kT,{})]}));const jT=e=>co.jsx(mT,{...e,children:co.jsx(NT,{...e})}),zT=vp(null),FT=vp(null),WT=vp({minRow:0,maxRow:0,minCol:0,maxCol:0}),$T=vp({HEADER:null,TOP:null,LEFT:null,DATA:null,WRAPPER:null}),BT=vp(null),VT=vp(e=>({focusCoord:e(zT),shouldRefocus:e(FT),pivotSectionBounds:e(WT),pivotSection:e($T),pivotCoord:e(BT)})),HT=vp(null,(e,t,n)=>{t(zT,n)});vp(null,(e,t,n)=>{t(WT,e=>({...e,...n}))});const GT=vp(null,(e,t,n)=>{t($T,e=>({...e,...n}))}),UT=a({}),YT=()=>h(UT),KT=({rect:e,pageInfo:t,qPivotDataPages:n,updatePageInfo:r,direction:i,children:o})=>{const s=m(()=>({rect:e,pageInfo:t,qPivotDataPages:n,updatePageInfo:r,direction:i}),[e,t,n,r,i]);return co.jsx(UT.Provider,{value:s,children:o})},XT=a({}),JT=()=>h(XT),ZT=({app:e,model:t,theme:n,embed:r,keyboard:i,translator:o,interactions:s,env:a,children:l})=>{const c=m(()=>({model:t,app:e,interactions:s,embed:r,theme:n,keyboard:i,env:a,translator:o}),[e,s,t,r,n,i,a,o]);return co.jsx(XT.Provider,{value:c,children:l})},QT=a({}),eO=()=>h(QT),tO=({children:e,...t})=>co.jsx(QT.Provider,{value:t,children:e}),nO="/qHyperCubeDef",rO=-1,iO="PSEUDO-DIM",oO=e=>e===rO?iO:(({cId:e})=>e??fA())(e),sO=({layoutService:e,visibleLeftDimensionInfos:t,cell:n,colIdx:r})=>{n&&(n.canBeResized=!0,n.colIdx=n.colIdx||r,n.dimensionInfoIndex===rO?n.columnWidthLocation=nP.Measures:n.isLeftDimension?n.columnWidthLocation=nP.Dimension:t.at(-1)===rO?n.columnWidthLocation=nP.Measures:e.hasPseudoDimOnLeft&&(n.columnWidthLocation=nP.Pivot))},aO=e=>{if(!e)return;const{background:t,foreground:n}=e,r=o_(t??""),i=o_(n??""),o=r.isInvalid()?void 0:r.getRGBA(),s=o?RD(o,rR):void 0,a=o?RD(o,iR):void 0;return i.isInvalid()&&void 0!==o?{background:o,color:kD(o),headerMenuHoverBackground:s,headerMenuActiveBackground:a}:{background:o,color:i.isInvalid()?void 0:i.getRGBA(),headerMenuHoverBackground:s,headerMenuActiveBackground:a}},lO=(e,t,n,r,i)=>{const o=oO(n),s=e.getDimensionInfoIndex(n),a=e.isLeftDimension(s);return n===rO?{id:o,colIdx:-1,label:"",sortDirection:"A",fieldId:"",isLocked:!1,isDim:!1,isCyclic:!1,groupDimensionPos:0,groupDimensionLabels:[],headTextAlign:"left",dimensionInfoIndex:s,canBeResized:!1,isLeftDimension:a,isLastDimension:r,columnWidthLocation:nP.Measures,isPivot:!0,qEffectiveDimensionName:void 0}:{id:o,colIdx:0,label:n.qFallbackTitle??"",qReverseSort:n.qReverseSort,sortDirection:n.qSortIndicator&&"N"!==n.qSortIndicator?n.qSortIndicator:"A",qLibraryId:n.qLibraryId,fieldId:n.qGroupFieldDefs[n.qGroupPos],isLocked:n.qLocked??!1,columnWidth:n.columnWidth,qApprMaxGlyphCount:n.qApprMaxGlyphCount,isDim:!0,isCyclic:n.qGrouping===oR.Cyclic,groupDimensionPos:n.qGroupPos,groupDimensionLabels:n.qGroupFallbackTitles,headTextAlign:"left",dimensionInfoIndex:s,canBeResized:!1,isLeftDimension:a,isLastDimension:r,columnWidthLocation:nP.Dimension,isPivot:!0,isSortedByFirstMeasure:t.isSortedByFirstMeasure,qEffectiveDimensionName:n.qEffectiveDimensionName,headerColor:i?.("VNA-727-HEADER-COLOR-EXPRESSION-PIVOT")?aO(n.headerColor):void 0}},cO=({layoutService:e,effectivePropertiesService:t,lastRow:n,lastCol:r,isEnabled:i})=>{let o=r;var s;n.length>0&&(o=(s=r).at(-1)===rO?s.slice(0,-1):s);const a=o.length+(n.length?1:0),l=Math.max(1,n.length),c=((e,t)=>Array(e).fill(null).map(()=>Array.from({length:t},()=>null)))(a,l);return n.forEach((n,r,o)=>{const s=r===o.length-1;c[a-1][r]=lO(e,t,n,s,i)}),o.forEach((n,r,o)=>{const s=r===o.length-1;c[r][l-1]=lO(e,t,n,s,i)}),c},uO=(e,t,n,r,i)=>{const o=((e,t,n,r,i)=>{let o;return o=0===n.length||n.includes(rO)?cO({layoutService:e,effectivePropertiesService:t,lastRow:r,lastCol:n,isEnabled:i}):(e=>e[0].map((t,n)=>e.map(e=>e[n])))(cO({layoutService:e,effectivePropertiesService:t,lastRow:n,lastCol:r,isEnabled:i})),e.isIndentModeEnabled&&o.length&&o[o.length-1].length>1&&(o[o.length-1]=[o.at(-1),...new Array(o[0]?o[0].length-1:0).fill(null)]),o.length&&o.at(-1)?.forEach((t,n)=>{Array.isArray(t)?t.forEach((t,n)=>{sO({layoutService:e,visibleLeftDimensionInfos:r,cell:t,colIdx:n})}):sO({layoutService:e,visibleLeftDimensionInfos:r,cell:t,colIdx:n})}),o})(e,t,n,r,i);return{data:o,size:{x:o[0]?.length??0,y:o.length}}},dO=/^data:(?<!\s)\s*(image\/[\w+-.]+)(?<!\s)\s*(;.*?){0,1}(?<!\s)\s*,(.*)/i,hO=5e6,pO=5e5;const fO={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:mO(e),value:mO(t.replace(/%2B/g,"shouldNotDecodePlus")),useEqualSign:n}}(r,i,o))}),t}};function mO(e){try{return decodeURIComponent(e)}catch{return e}}function gO(e){if(!(this instanceof gO))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:()=>fO.fromSearchString(t.search)}})}function yO(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")}gO.encodeAuthorityAndPath=function(e){return encodeURI(e).replace(/%5B/gi,"[").replace(/%5D/gi,"]").replace(/%25/gi,"%")},gO.encodeSearchParams=function(e){let t,n="";for(let r=0;r<e.length;r++)t=e[r],n+=0===r?"?":"&",n+=yO(t.key),t.value?n+=`=${yO(t.value)}`:n+=t.useEqualSign?"=":"";return n};var vO=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}},bO=class{decode(e){let t="";const n=new vO(e);let r;for(;n.hasNext();)r=this.decodeCharacter(n),t+=null!=r?r:n.next();return t}decodeCharacter(e){return e.next()}};const xO=e=>e>=0&&e<=1114111,wO=e=>e.match(/[\s]/);var SO=class extends bO{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&&!wO(i));r++){if("NaN"===parseInt(i,16)){e.pushback(i);break}n+=i}const s=parseInt(n,16);return xO(s)?String.fromCharCode(s):"�"}},CO=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}},EO=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 s=t.charAt(n);return this._nextMap?(i=this._nextMap[s],i||(i=new e,this._nextMap[s]=i)):(this._nextMap={},i=new e,this._nextMap[s]=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 CO.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return CO.newInstanceIfNeeded(e,t,this._value);const r=n.getLongestMatch(e,t+1);return r||CO.newInstanceIfNeeded(e,t,this._value)}},MO=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 EO);const n=this.root.put(e,0,t);return n||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}};const kO=(()=>{const e=[],t=[],n=new MO;let r,i,o;for(r in e["&quot"]="34",e["&amp"]="38",e["&lt"]="60",e["&gt"]="62",e["&nbsp"]="160",e["&iexcl"]="161",e["&cent"]="162",e["&pound"]="163",e["&curren"]="164",e["&yen"]="165",e["&brvbar"]="166",e["&sect"]="167",e["&uml"]="168",e["&copy"]="169",e["&ordf"]="170",e["&laquo"]="171",e["&not"]="172",e["&shy"]="173",e["&reg"]="174",e["&macr"]="175",e["&deg"]="176",e["&plusmn"]="177",e["&sup2"]="178",e["&sup3"]="179",e["&acute"]="180",e["&micro"]="181",e["&para"]="182",e["&middot"]="183",e["&cedil"]="184",e["&sup1"]="185",e["&ordm"]="186",e["&raquo"]="187",e["&frac14"]="188",e["&frac12"]="189",e["&frac34"]="190",e["&iquest"]="191",e["&Agrave"]="192",e["&Aacute"]="193",e["&Acirc"]="194",e["&Atilde"]="195",e["&Auml"]="196",e["&Aring"]="197",e["&AElig"]="198",e["&Ccedil"]="199",e["&Egrave"]="200",e["&Eacute"]="201",e["&Ecirc"]="202",e["&Euml"]="203",e["&Igrave"]="204",e["&Iacute"]="205",e["&Icirc"]="206",e["&Iuml"]="207",e["&ETH"]="208",e["&Ntilde"]="209",e["&Ograve"]="210",e["&Oacute"]="211",e["&Ocirc"]="212",e["&Otilde"]="213",e["&Ouml"]="214",e["&times"]="215",e["&Oslash"]="216",e["&Ugrave"]="217",e["&Uacute"]="218",e["&Ucirc"]="219",e["&Uuml"]="220",e["&Yacute"]="221",e["&THORN"]="222",e["&szlig"]="223",e["&agrave"]="224",e["&aacute"]="225",e["&acirc"]="226",e["&atilde"]="227",e["&auml"]="228",e["&aring"]="229",e["&aelig"]="230",e["&ccedil"]="231",e["&egrave"]="232",e["&eacute"]="233",e["&ecirc"]="234",e["&euml"]="235",e["&igrave"]="236",e["&iacute"]="237",e["&icirc"]="238",e["&iuml"]="239",e["&eth"]="240",e["&ntilde"]="241",e["&ograve"]="242",e["&oacute"]="243",e["&ocirc"]="244",e["&otilde"]="245",e["&ouml"]="246",e["&divide"]="247",e["&oslash"]="248",e["&ugrave"]="249",e["&uacute"]="250",e["&ucirc"]="251",e["&uuml"]="252",e["&yacute"]="253",e["&thorn"]="254",e["&yuml"]="255",e["&OElig"]="338",e["&oelig"]="339",e["&Scaron"]="352",e["&scaron"]="353",e["&Yuml"]="376",e["&fnof"]="402",e["&circ"]="710",e["&tilde"]="732",e["&Alpha"]="913",e["&Beta"]="914",e["&Gamma"]="915",e["&Delta"]="916",e["&Epsilon"]="917",e["&Zeta"]="918",e["&Eta"]="919",e["&Theta"]="920",e["&Iota"]="921",e["&Kappa"]="922",e["&Lambda"]="923",e["&Mu"]="924",e["&Nu"]="925",e["&Xi"]="926",e["&Omicron"]="927",e["&Pi"]="928",e["&Rho"]="929",e["&Sigma"]="931",e["&Tau"]="932",e["&Upsilon"]="933",e["&Phi"]="934",e["&Chi"]="935",e["&Psi"]="936",e["&Omega"]="937",e["&alpha"]="945",e["&beta"]="946",e["&gamma"]="947",e["&delta"]="948",e["&epsilon"]="949",e["&zeta"]="950",e["&eta"]="951",e["&theta"]="952",e["&iota"]="953",e["&kappa"]="954",e["&lambda"]="955",e["&mu"]="956",e["&nu"]="957",e["&xi"]="958",e["&omicron"]="959",e["&pi"]="960",e["&rho"]="961",e["&sigmaf"]="962",e["&sigma"]="963",e["&tau"]="964",e["&upsilon"]="965",e["&phi"]="966",e["&chi"]="967",e["&psi"]="968",e["&omega"]="969",e["&thetasym"]="977",e["&upsih"]="978",e["&piv"]="982",e["&ensp"]="8194",e["&emsp"]="8195",e["&thinsp"]="8201",e["&zwnj"]="8204",e["&zwj"]="8205",e["&lrm"]="8206",e["&rlm"]="8207",e["&ndash"]="8211",e["&mdash"]="8212",e["&lsquo"]="8216",e["&rsquo"]="8217",e["&sbquo"]="8218",e["&ldquo"]="8220",e["&rdquo"]="8221",e["&bdquo"]="8222",e["&dagger"]="8224",e["&Dagger"]="8225",e["&bull"]="8226",e["&hellip"]="8230",e["&permil"]="8240",e["&prime"]="8242",e["&Prime"]="8243",e["&lsaquo"]="8249",e["&rsaquo"]="8250",e["&oline"]="8254",e["&frasl"]="8260",e["&euro"]="8364",e["&image"]="8365",e["&weierp"]="8472",e["&real"]="8476",e["&trade"]="8482",e["&alefsym"]="8501",e["&larr"]="8592",e["&uarr"]="8593",e["&rarr"]="8594",e["&darr"]="8595",e["&harr"]="8596",e["&crarr"]="8629",e["&lArr"]="8656",e["&uArr"]="8657",e["&rArr"]="8658",e["&dArr"]="8659",e["&hArr"]="8660",e["&forall"]="8704",e["&part"]="8706",e["&exist"]="8707",e["&empty"]="8709",e["&nabla"]="8711",e["&isin"]="8712",e["&notin"]="8713",e["&ni"]="8715",e["&prod"]="8719",e["&sum"]="8721",e["&minus"]="8722",e["&lowast"]="8727",e["&radic"]="8730",e["&prop"]="8733",e["&infin"]="8734",e["&ang"]="8736",e["&and"]="8743",e["&or"]="8744",e["&cap"]="8745",e["&cup"]="8746",e["&int"]="8747",e["&there4"]="8756",e["&sim"]="8764",e["&cong"]="8773",e["&asymp"]="8776",e["&ne"]="8800",e["&equiv"]="8801",e["&le"]="8804",e["&ge"]="8805",e["&sub"]="8834",e["&sup"]="8835",e["&nsub"]="8836",e["&sube"]="8838",e["&supe"]="8839",e["&oplus"]="8853",e["&otimes"]="8855",e["&perp"]="8869",e["&sdot"]="8901",e["&lceil"]="8968",e["&rceil"]="8969",e["&lfloor"]="8970",e["&rfloor"]="8971",e["&lang"]="9001",e["&rang"]="9002",e["&loz"]="9674",e["&spades"]="9824",e["&clubs"]="9827",e["&hearts"]="9829",e["&diams"]="9830",e)"function"!=typeof e[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 IO=class extends bO{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,kO.getMaxKeyLength()),r=0;r<t;r++)i+=e.next().toLowerCase();const o=kO.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)&&xO(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)&&xO(r)?String.fromCharCode(r):null}},RO=class extends bO{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),xO(o))?String.fromCharCode(o):(e.reset(),null)}};let _O;"undefined"!=typeof document&&(_O=document.createElement("div"));const DO=Array.prototype.indexOf,AO=[",",".","_"," "],PO=[",",".","-","_"," "],LO={width:["%"],height:["%"]},TO={default:["-"," ","%"],color:["#"," ","(",")"],image:["(",")",":","/","?","&","-",".",'"',"="," "]},OO={background:["(",")",":","%","/","?","&","-"," ",".",'"',"=","#"],"background-image":TO.image,"background-color":TO.color,"border-color":TO.color,"border-image":TO.image,color:TO.color,icon:TO.image,"list-style-image":TO.image,"outline-color":TO.color},qO={attr_name:["^on[a-z]{1,}","style","href","src"],attr_val:["javascript:","data:"],css_key:["behavior","-moz-behavior","-ms-behavior"],css_val:["expression"]};function NO(e,t,n){let r;if(t){if(DO)return DO.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 jO(e){if(null==e)return"";let t="";const n=document.createTextNode(e);return _O.appendChild(n),t=_O.innerHTML,_O.removeChild(n),t}function zO(e,t,n){let r,i,o,s,a,l,c,u,d;for(e=WO(e).toLowerCase(),t=WO(t),o=0;o<qO.attr_name.length;o++)if(e.match(qO.attr_name[o]))throw new Error(`Unsafe attribute name used: ${e}`);for(o=0;o<qO.attr_val.length;o++)if(t.toLowerCase().match(qO.attr_val[o]))throw new Error(`Unsafe attribute value used: ${t}`);if(r=LO[e],r||(r=PO),i="",!n){for(s=0;s<e.length;s++){if(a=e.charAt(s),!a.match(/[a-zA-Z\-0-9]/))throw new Error("Invalid attribute name specified");i+=a}i+='="'}for(l=0;l<t.length;l++)c=t.charAt(l),u=t.charCodeAt(l),!c.match(/[a-zA-Z0-9]/)&&NO(c,r)<0?(d=u.toString(16),i+=`&#x${d};`):i+=c;return n||(i+='"'),i}function FO(e,t,n){let r,i,o,s,a,l,c,u,d,h;if(e=WO(e).toLowerCase(),t=WO(t),NO(e,qO.css_key)>=0)throw new Error(`Unsafe property name used: ${e}`);for(r=0;r<qO.css_val.length;r++)if(t.toLowerCase().indexOf(qO.css_val[r])>=0)throw new Error(`Unsafe property value used: ${t}`);if(i=OO[e],i||(i=TO.default),o="",!n){for(s=0;s<e.length;s++){if(a=e.charAt(s),!a.match(/[a-zA-Z-]/))throw new Error("Invalid Property Name specified");o+=a}o+=": "}for(l=0;l<t.length;l++)c=t.charAt(l),u=t.charCodeAt(l),!c.match(/[a-zA-Z0-9]/)&&NO(c,i)<0?(d=u.toString(16),h="000000".substr(d.length),o+=`\\${h}${d}`):o+=c;return o}function WO(e,t){let n,r,i,o,s=!1;if(null===e)return null;n=e,r=e,i=0;const a=[new IO,new RO,new SO];for(;!s;){r=n;for(let e=0;e<a.length;e++)o=a[e].decode(n),o!==n&&(i++,n=o);r!==n||(s=!0)}if(t&&i>1)throw new Error("Attack Detected - Multiple/Double Encodings used in input");return n}const $O=[];for(let e=0;e<255;e++)$O[e]=e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122?null:e.toString(16);const BO={html:e=>jO(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]=FO(t,n[t],!0),o+=FO(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]=zO(e,t[e],!0),i+=zO(e,t[e],!0),r[e]=n[e]);return e.map?r:i}};function VO(e,t){throw new Error(t)}var HO={canonicalize:WO,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?BO.html(e):"css"===e.context?(null!=e.map&&"object"!=typeof e.map&&VO(this,"Invalid parameter type"),BO.css(e)):"attr"===e.context?(null!=e.map&&"object"!=typeof e.map&&VO(this,"Invalid parameter type"),BO.attr(e)):void VO(this,"Invalid parameter type")},encodeForAttr:zO,encodeForAttr2:function(e){return zO("nonsens",e,!0)},encodeForCSS:FO,encodeForHref:function(e){WO(e),0!==e.search("[a-zA-Z0-9]+:")&&(e=`http://${e}`);const t=new gO(e),n=gO.encodeAuthorityAndPath(t.authorityAndPath),r=t.searchParams;e=n+gO.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,s,a;for(t||(t=AO),a="",n=0;n<e.length;n++)i=e.charAt(n),o=e.charCodeAt(n),NO(i,t)>=0||null==$O[o]?a+=i:(r=o.toString(16),o<256?(s="00".substr(r.length),a+=`\\x${s}${r.toUpperCase()}`):(s="0000".substr(r.length),a+=`\\u${s}${r.toUpperCase()}`));return a},encodeForHTML:jO,encodeForURL:function(e,t){let n="";return t&&(t.match(/^[A-Za-z\-0-9]{1,}$/)?n+=WO(t).toLowerCase():VO(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=pO,maxByteSizeImage:r=hO}=t??{},{mimeType:i,encoding:o,data:s}=(e=>{const[,t,n,r]=dO.exec(e.trim())??[];return{encoding:n,data:r,mimeType:t?.toLocaleLowerCase()}})(e);if(!s)return!0;const a=((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,s);return"image/svg+xml"===i?a<=n:a<=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 GO=(e,t)=>t.qAttrExps?.qValues?.[e],UO=(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"}}},YO=({text:e,url:t,imageSize:n,imagePosition:r,labelStructure:i,imageBox:o,direction:s})=>!r||t&&(t.toLowerCase().includes("javascript:")||!HO.isSafeDataURL(t))?{type:KA.Text,url:void 0,text:e,labelStructure:i}:{type:KA.Image,url:t||"",text:e,imageSize:n,resolvedImagePosition:UO(r,s),labelStructure:i,imageBox:o},KO=(e,t,n,r)=>{if(!e.qMiniChart||!t?.miniChart||!n)return{type:KA.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,s=r?n.qYMax:e.qMiniChart.qMax;if(i){const e=Math.max(Math.abs(o),Math.abs(s));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,s)}:{minY:o,maxY:s}})(e,t.miniChart,n),s={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:KA.MiniChart,text:r,miniChart:s}},XO=(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===XA.Attribute?void 0:n?.urlLabel},JO=({labelStructure:e,text:t,url:n})=>{try{if(!n)throw Error("Invalid url");return{type:KA.Link,url:HO.encodeForHref(n),text:t,labelStructure:e}}catch{return{type:KA.Text,url:void 0,text:t,labelStructure:e}}},ZO=({cell:e,representationProperties:t,attrExprInfoIndex:n,env:r,conditionalColoring:i,miniChartOnMeasure:o,labelStructure:s,getText:a=e=>e.qText,direction:l,enabledFeatures:c})=>{const u=JA(t),d=a(e);return u===KA.Image&&c[KA.Image]&&!r.anything.sense?.isUnsupportedFeature?.("tableImages")?((e,t,n,r,i,o)=>{const{imageSize:s,imagePosition:a,imageSetting:l,imageLabel:c,imageBox:u}=t??{};if("url"===l){const t=GO(n.imageUrl??-1,e)?.qText;return o&&(o.maskedValue=t??""),YO({text:r,url:t,imageSize:s,imagePosition:a,labelStructure:o,imageBox:u,direction:i})}if("label"===l){const t=o?o.originalValue:r;if(-1===n.imageLabel)return YO({text:c||t||"",url:t,imageSize:s,imagePosition:a,labelStructure:o,imageBox:u,direction:i});const l=GO(n.imageLabel??-1,e)?.qText??r;return YO({text:l,url:t,imageSize:s,imagePosition:a,labelStructure:o,imageBox:u,direction:i})}return{type:KA.Text,url:void 0,labelStructure:o,text:r}})(e,t,n,d,l,s):u===KA.Link?((e,t,n,r,i)=>{const{urlPosition:o}=t??{};if(o===XA.Attribute){const o=XO(n.url??-1,e,t);return JO({labelStructure:r,text:i||o||"",url:o})}if(o===XA.Dimension){const o=XO(n.urlLabel??-1,e,t)||i;return r&&(r.maskedValue=o),JO({text:o,labelStructure:r,url:r?.originalValue??i})}return{type:KA.Text,url:void 0,text:i,labelStructure:r}})(e,t,n,s,d):u===KA.Indicator&&c[KA.Indicator]&&!r.anything.sense?.isUnsupportedFeature?.("tableIndicators")?((e,t,n)=>{const{indicator:r}=e??{};return{type:KA.Indicator,url:void 0,text:n,indicator:{applySegmentColors:r?.applySegmentColors,position:r?.position,showTextValues:r?.showTextValues},indicatorConditionalColoring:t}})(t,i,d):u===KA.MiniChart&&c[KA.MiniChart]&&!r.anything.sense?.isUnsupportedFeature?.("qMiniChartDef")?KO(e,t,o,d):{type:KA.Text,url:void 0,text:d,labelStructure:s}},QO=(e,t)=>{const n=t.qAttrExps,r=n?.qValues?.[e?.cellForegroundColor??-1]?.qText,i=n?.qValues?.[e?.cellBackgroundColor??-1]?.qText,o=i?_D(i):null,s=r?_D(r):null,a=((e,t)=>e||!t?null:kD(t))(s,o);return{color:a??s,background:o}},eq=(e,t)=>t.qSubNodes.reduce((e,t)=>0===t.qSubNodes.length?e+1:eq(e,t),e),tq=(e,t,n,r,i,o)=>{const s=i?o.rowsPerPage-n:gP-r;let a=e.qUp+e.qDown;if(i&&0===n){const n=(t+e.qUp)%o.rowsPerPage;a=e.qDown+n}return Math.min(s,eq(a,e))},nq=({node:e,parent:t,root:n,x:r,y:i,pageY:o,layoutService:s,dimensionInfo:a,attrExprInfoIndex:l,isLeftColumn:c=!0,isIndentModeEnabled:u=!1,pseudoDimMeasureIndex:d,indentLevel:h,labelStructure:p,env:f,pageInfo:m,direction:g="ltr"})=>{const y=(!u||!c)&&"P"===e.qType,v=((e,t)=>{if(e!==rO){if(t){const t=JA(e.representation);return t===KA.Link||t===KA.Image?e.representation:{type:KA.Text}}return e.representation}})(a,u),b=(({node:e,isLeftColumn:t,isIndentModeEnabled:n,labelStructure:r,representationType:i,parentOrRootOriginalValue:o})=>{let s=e.qText;if(t&&n&&r){const{originalValue:t,delimeter:n,suffix:a}=r;s=i===KA.Link?"P"===e.qType?o:t:`${t} ${!a||!t&&a?"":n} ${a}`.trim()}return s})({node:e,isLeftColumn:c,isIndentModeEnabled:u,labelStructure:p,representationType:JA(v),parentOrRootOriginalValue:(t||n)?.representation?.labelStructure?.originalValue??""}),x=ZO({cell:{...e,qText:b},representationProperties:v,attrExprInfoIndex:l,env:f,labelStructure:p,direction:g,enabledFeatures:{[KA.Image]:!0,[KA.Indicator]:!0}}),w={id:fA(),ref:e,x:r,y:i,pageX:r,pageY:o,mainAxisPageCoord:c?o:r,isLeftColumn:c,parent:t,root:n,children:[],isLeafNode:0===e.qSubNodes.length,leafCount:tq(e,i,o,r,c,m),distanceToNextCell:0,isLockedByDimension:!("object"!=typeof a||!a.qLocked),isTotal:"T"===e.qType||!!t?.isTotal,isEmpty:"E"===e.qType||-4===e.qElemNo,isNull:"U"===e.qType,isPseudoDimension:y,expressionColor:QO(l,e),selectionCellType:c?"L":"T",dimensionInfoIndex:s.getDimensionInfoIndex(a),canBeResized:0===e.qSubNodes.length&&!c,visibleMeasureInfoIndex:d??(y?e.qElemNo:t?.visibleMeasureInfoIndex),representation:x,...void 0!==h&&{indentLevel:h},headerColor:y&&f.flags.isEnabled("VNA-727-HEADER-COLOR-EXPRESSION-PIVOT")&&void 0!==e.qElemNo?aO(s.visibleMeasureInfo[e.qElemNo]?.headerColor):void 0};return t&&(t.children[w.mainAxisPageCoord-t.mainAxisPageCoord]=w),w},rq=(e,t,n,r,i,o,s,a,l)=>{const{isIndentModeEnabled:c}=i,u=a.flags.isEnabled("VNA-670-SEPARATE_NULL_VALUE_STYLING");if(!t.length)return e;let d=0;return function t(h,p,f,m=0,g=-1){e[m]||(e[m]={}),c&&g++;const y=i.leftDimensionInfoIndexes.indexOf(rO);f.forEach((f,v)=>{const b={originalValue:f.qText??"",maskedValue:"",delimeter:"-",suffix:""};d+=0===v?0:1;const x=n.qTop-r.page*r.rowsPerPage,w=Math.max(0,x+d-f.qUp),S=n.qTop+d-f.qUp;let C;if(c){if(i.hasPseudoDimOnLeft&&g<=y)if(b.originalValue=f.qText??"",b.maskedValue=f.qText??"","N"===f.qType||"U"===f.qType||"T"===f.qType)"U"===f.qType&&(b.originalValue=u?i.getDimensionNullValueText():i.getNullValueText()),g<y&&(b.suffix=i.visibleMeasureInfo[0].qFallbackTitle??"");else if("P"===f.qType){b.originalValue=(p||h)?.representation.labelStructure?.originalValue??"",b.maskedValue=(p||h)?.representation.labelStructure?.originalValue??"",b.suffix=f.qText??"";const e=f.qSubNodes;C=f.qElemNo,f={...(p||h)?.ref,...f.qText?{qText:f.qText}:{},qSubNodes:e},g=(p||h)?.indentLevel??0}"U"===f.qType&&(b.originalValue=u?i.getDimensionNullValueText():i.getNullValueText())}let E=m;c&&(E=y>=1&&g>=y?g+1:g,0===g&&0===y&&0===f.qSubNodes.length&&(E=0));const M=e.at(m)?.[w],k=c&&void 0===M?.ref.qText||!M?nq({node:f,parent:p,root:h,x:E,y:S,pageY:w,layoutService:i,dimensionInfo:o[E],attrExprInfoIndex:s[E],isLeftColumn:!0,...c&&{isIndentModeEnabled:c,indentLevel:g},env:a,pageInfo:r,labelStructure:b,direction:l,pseudoDimMeasureIndex:C}):e[m][w];if(e[m][w]=k,f.qSubNodes.length){const e=c?0:m+1;t(h||k,k,f.qSubNodes,e,g)}})}(null,null,t,0,-1),e},iq=(e,t)=>{e.slice(0,-1).forEach(e=>{Object.values(e).forEach((e,n,r)=>{const i=r.at(n+1);e.distanceToNextCell=i?i.mainAxisPageCoord-(e.mainAxisPageCoord+e.leafCount):t-(e.mainAxisPageCoord+e.leafCount)})})},oq=(e,t)=>{const n=e[0],r=n?Object.values(n):[],i=t?.isIndentModeEnabled&&t.hasPseudoDimOnLeft?t.visibleMeasureInfo.length-1:0,o=n?.[i],s=r.at(-1);return o?.isTotal?o.isLeafNode?o.mainAxisPageCoord:o.mainAxisPageCoord+o.leafCount-1:s?.isTotal?s.mainAxisPageCoord-1:-1},sq=({prevData:e,nextDataPage:t,pageInfo:n,layoutService:r,visibleLeftDimensionInfo:i,attrExprInfoIndexes:o,env:s,direction:a})=>{const{qLeft:l,qArea:c}=t;if(!l.length)return e;const u=rq(e.grid,l,c,n,r,i,o,s,a);iq(u,n.rowsOnCurrentPage);const d=oq(u,r);return{...e,grid:u,columnCount:u.length,totalDividerIndex:d}},aq=({qArea:e,prevData:t,pivotValuePoints:n,pageInfo:r})=>{const i=[...t];return n.forEach((t,n)=>{t.forEach((t,o)=>{const s=e.qTop-r.page*r.rowsPerPage+n,a=e.qLeft+o;Array.isArray(i[s])||(i[s]=[]);const l="U"===t.qType;i[s][a]=i[s][a]??{id:fA(),ref:t,isNull:l}})}),i},lq=({prevData:e,dataPage:t,pageInfo:n})=>{const{qData:r,qArea:i}=t;return r?.length?aq({qArea:i,prevData:e,pivotValuePoints:r,pageInfo:n}):e},cq=(e,t,n,r,i,o,s,a,l,c)=>{const{isIndentModeEnabled:u}=r;if(!t.length)return e;let d=0;!function t(s,h,p,f=0){e[f]||(e[f]={}),p.forEach((p,m)=>{d+=0===m?0:1;const g=n.qLeft+d-p.qUp,y=e[f][g]??nq({node:p,parent:h,root:s,x:g,y:f,pageY:f,layoutService:r,dimensionInfo:i[f],attrExprInfoIndex:o[f],isLeftColumn:!1,...u&&{isIndentModeEnabled:u},env:a,pageInfo:l,direction:c});e[f][g]=y,p.qSubNodes.length&&t(s||y,y,p.qSubNodes,f+1)})}(null,null,t);for(let t=0;t<s-e.length;t++)e.push({});return e},uq=({prevData:e,nextDataPage:t,layoutService:n,visibleTopDimensionInfo:r,attrExprInfoIndexes:i,headerRows:o,env:s,pageInfo:a,direction:l})=>{const{qTop:c,qArea:u}=t;if(!c.length)return e;const d=cq(e.grid,c,u,n,r,i,o,s,a,l);iq(d,n.size.x);const h=oq(d);return{...e,grid:d,rowCount:d.length,totalDividerIndex:h}},dq=e=>-1===e?{}:e.qAttrExprInfo.reduce((e,{id:t},n)=>(e[t]=n,e),{}),hq=(e,t)=>{const{env:n}=JT(),{direction:r}=YT(),{layoutService:i,effectivePropertiesService:o}=eO(),{qPivotDataPages:s,pageInfo:a}=YT(),[l,c]=p(null),u=((e,t,n)=>m(()=>({left:e.map(dq),top:t.map(dq),measures:n.map(dq)}),[n,e,t]))(e,t,i.visibleMeasureInfo),h=n.flags.isEnabled,f=m(()=>uO(i,o,t,e,h),[i,o,t,e,h]),g=d(()=>s.slice(1).reduce((e,t)=>lq({prevData:e,dataPage:t,pageInfo:a}),((e,t)=>{const{qData:n,qArea:r}=e;return aq({qArea:r,prevData:[],pivotValuePoints:n,pageInfo:t})})(s[0],a)),[s,a]),y=d(()=>s.slice(1).reduce((e,o)=>uq({prevData:e,nextDataPage:o,layoutService:i,visibleTopDimensionInfo:t,attrExprInfoIndexes:u.top,headerRows:f.size.y,env:n,pageInfo:a,direction:r}),((e,t,n,r,i,o,s,a)=>{const{qArea:l,qTop:c}=e,u=cq([],c,l,t,n,r,i,o,s,a);iq(u,t.size.x);const d=oq(u);return{grid:u,rowCount:u.length,layoutSize:t.size,totalDividerIndex:d}})(s[0],i,t,u.top,f.size.y,n,a,r)),[s,i,t,u.top,f.size.y,n,a,r]),v=d(()=>s.slice(1).reduce((t,o)=>sq({prevData:t,nextDataPage:o,pageInfo:a,layoutService:i,visibleLeftDimensionInfo:e,attrExprInfoIndexes:u.left,env:n,direction:r}),((e,t,n,r,i,o,s)=>{const{qArea:a,qLeft:l}=e,c=rq([],l,a,n,t,r,i,o,s);iq(c,n.rowsOnCurrentPage);const u=oq(c,t);return{grid:c,columnCount:c.length,layoutSize:t.size,totalDividerIndex:u}})(s[0],i,a,e,u.left,n,r)),[s,i,a,e,u,n,r]),[b,x]=p(()=>g()),[w,S]=p(()=>y()),[C,E]=p(()=>v());fL(()=>{x(g())},[g]),fL(()=>{S(y())},[y]),fL(()=>{E(v())},[v]),fL(()=>{l&&l.forEach(o=>{x(e=>lq({prevData:e,dataPage:o,pageInfo:a})),S(e=>uq({prevData:e,nextDataPage:o,layoutService:i,visibleTopDimensionInfo:t,attrExprInfoIndexes:u.top,headerRows:f.size.y,env:n,pageInfo:a,direction:r})),E(t=>sq({prevData:t,nextDataPage:o,pageInfo:a,layoutService:i,visibleLeftDimensionInfo:e,attrExprInfoIndexes:u.left,env:n,direction:r}))})},[l]);const M=d(e=>{c(e)},[]);return{headersData:f,measureData:b,topDimensionData:w,leftDimensionData:C,attrExprInfoIndexes:u,nextPageHandler:M}},pq=Math.sqrt(1e4),fq=e=>({maxNumberOfVisibleRows:Math.ceil(e.height/24),maxNumberOfVisibleColumns:Math.ceil(e.width/tR.PixelsMin)}),mq=e=>{if(null===e)return[];if(e.qWidth*e.qHeight<1e4)return[e];const t=[],n=Math.ceil(e.qWidth/pq),r=Math.ceil(e.qHeight/pq);for(let i=0;i<n;i++)for(let n=0;n<r;n++)t.push({qLeft:e.qLeft+i*pq,qTop:e.qTop+n*pq,qWidth:Math.min(pq,e.qWidth-i*pq),qHeight:Math.min(pq,e.qHeight-n*pq)});return t};function gq({nextPageHandler:e}){const{model:t}=JT(),n=Dp(Df),{pageInfo:r}=YT(),{layoutService:i}=eO(),o=(e=>{const t=s(e);return t.current=e,t})(r.page),a=t,l=d(async(e,t)=>{try{await(a?.collapseLeft(nO,e,t,!1))}catch(e){n.error({msg:"Failed to collapse left",payload:e})}},[a,n]),c=d(async(e,t)=>{try{await(a?.collapseTop(nO,e,t,!1))}catch(e){n.error({msg:"Failed to collapse top",payload:e})}},[a,n]),u=d(async(e,t)=>{try{await(a?.expandLeft(nO,e,t,!1))}catch(e){n.error({msg:"Failed to expand left",payload:e})}},[a,n]),h=d(async(e,t)=>{try{await(a?.expandTop(nO,e,t,!1))}catch(e){n.error({msg:"Failed to expand top",payload:e})}},[a,n]),p=d(async t=>{if(a?.getHyperCubePivotData&&0!==t.length)try{const n=await a.getHyperCubePivotData(nO,t.reduce((e,t)=>[...e,...mq(t)],[]));o.current===r.page&&e(n)}catch(e){n.error({msg:"Failed to fetch pivot pages",payload:e})}},[a,e,r,o,n]),f=d((e,{dimensionInfoIndex:r,isLeftColumn:o,x:s=0,columnWidthLocation:a})=>{const{qMeasureInfo:l,qDimensionInfo:c,topHeadersColumnWidth:u}=i.layout.qHyperCube;let d=[];switch(a){case nP.Dimension:d=[{qPath:`${nO}/qDimensions/${r}/qDef/columnWidth`,oldValue:c[r].columnWidth}];break;case nP.Measures:if(o)d=l.map((e,t)=>({qPath:`${nO}/qMeasures/${t}/qDef/columnWidth`,oldValue:e.columnWidth}));else{const e=i.getMeasureInfoIndexFromCellIndex(s);d=[{qPath:`${nO}/qMeasures/${e}/qDef/columnWidth`,oldValue:l[e].columnWidth}]}break;case nP.Pivot:d=[{qPath:`${nO}/topHeadersColumnWidth`,oldValue:u}]}const h=d.map(t=>{const{qPath:n,oldValue:r}=t;return{qPath:n,qOp:r?"Replace":"Add",qValue:JSON.stringify({...r,...e})}});t?.applyPatches(h,!0).catch(e=>{n.error({msg:"Failed to apply column width",payload:e})})},[t,i,n]),g=d(async e=>{try{await(a?.applyPatches([{qPath:`${nO}/indentModeColumnWidth`,qOp:i.layout.qHyperCube.indentModeColumnWidth?"Replace":"Add",qValue:JSON.stringify({...i.indentModeColumnWidth,...e})}],!0))}catch(e){n.error({msg:"Failed to apply indent mode column width",payload:e})}},[a,i,n]);return m(()=>({collapseLeft:l,collapseTop:c,expandLeft:u,expandTop:h,applyColumnWidth:f,applyIndentModeColumnWidth:g,fetchPages:p}),[l,c,u,h,f,g,p])}const yq=(e,t,n)=>(r,i)=>{if("P"===r)return rO;const o=t[n+i];return e[o]},vq=e=>{const t=[],n=(e,r=0)=>{e.slice(0,1).forEach(e=>{t[r]=e.qType,e.qSubNodes.length&&n(e.qSubNodes,r+1)})};return n(e),t},bq=a({}),xq=()=>h(bq),wq=({children:e})=>{const{visibleLeftDimensionInfo:t,visibleTopDimensionInfo:n}=(()=>{const{layoutService:{layout:{qHyperCube:{qNoOfLeftDims:e,qEffectiveInterColumnSortOrder:t,qDimensionInfo:n}}}}=eO(),{qPivotDataPages:r}=YT();return m(()=>{const i=vq(r[0]?.qLeft??[]),o=vq(r[0]?.qTop??[]);return{visibleLeftDimensionInfo:i.map(yq(n,t,0)),visibleTopDimensionInfo:o.map(yq(n,t,e))}},[n,t,e,r])})(),{headersData:r,measureData:i,topDimensionData:o,leftDimensionData:s,attrExprInfoIndexes:a,nextPageHandler:l}=hq(t,n),c=gq({nextPageHandler:l}),u=m(()=>({gridSectionsData:{headersData:r,topDimensionData:o,leftDimensionData:s,measureData:i},visibleDimensionsInfo:{visibleLeftDimensionInfo:t,visibleTopDimensionInfo:n},attrExprInfoIndexes:a,dataModel:c}),[t,n,r,i,o,s,a,c]);return co.jsx(bq.Provider,{value:u,children:e})},Sq=(e,t)=>{const n=Math.min(Math.max(e.rowIdx,t.minRow),t.maxRow),r=Math.min(Math.max(e.colIdx,t.minCol),t.maxCol);return{...e,rowIdx:n,colIdx:r}},Cq=e=>(e=>[QI.Left,QI.Right,QI.Up,QI.Down].includes(e))(e)||[QI.Home,QI.End,QI.PageUp,QI.PageDown].includes(e),Eq=()=>{const{env:e}=JT(),t=e.flags.isEnabled("VNA-639-KEYBOARD_NAV_VIRTUALIZED_PIVOT_TABLE"),{gridSectionsData:n}=xq(),r=Dp(BT),i=Dp(VT),o=Ap(HT),s=Dp(FT);return{handleKeyDown:e=>{if(!t)return;if(!(e=>Cq(e.key)&&!(e=>e.shiftKey&&(e=>e.ctrlKey||e.metaKey)(e))(e))(e))return;e.preventDefault();const a=i.focusCoord,l={HEADER:{colCount:n.headersData.size.x,rowCount:n.headersData.size.y},TOP:{colCount:n.topDimensionData.layoutSize.x,rowCount:n.topDimensionData.rowCount},LEFT:{colCount:n.leftDimensionData.columnCount,rowCount:n.leftDimensionData.layoutSize.y},DATA:{colCount:n.topDimensionData.layoutSize.x,rowCount:n.leftDimensionData.layoutSize.y}},c=a?((e,t,n)=>{const r=e?.section??"HEADER",i={minRow:0,maxRow:n[r].rowCount-1,minCol:0,maxCol:n[r].colCount-1};switch(t){case QI.Down:if(e.rowIdx<i.maxRow)return{...e,rowIdx:e.rowIdx+1};if("TOP"===e.section)return{...e,rowIdx:0,section:"DATA"};if("HEADER"===e.section){const t={minRow:0,maxRow:n.LEFT.rowCount-1,minCol:0,maxCol:n.LEFT.colCount-1};return Sq({...e,rowIdx:0,section:"LEFT"},t)}return e;case QI.Up:return e.rowIdx>i.minRow?{...e,rowIdx:e.rowIdx-1}:"DATA"===e.section?{...e,rowIdx:n.TOP.rowCount-1,section:"TOP"}:"LEFT"===e.section?{...e,rowIdx:n.HEADER.rowCount-1,section:"HEADER"}:e;case QI.Right:return e.colIdx<i.maxCol?{...e,colIdx:e.colIdx+1}:"LEFT"===e.section?{...e,colIdx:0,section:"DATA"}:"HEADER"===e.section?{...e,colIdx:0,section:"TOP"}:e;case QI.Left:return e.colIdx>i.minCol?{...e,colIdx:e.colIdx-1}:"DATA"===e.section?{...e,colIdx:n.LEFT.colCount-1,section:"LEFT"}:"TOP"===e.section?{...e,colIdx:n.HEADER.colCount-1,rowIdx:0,section:"HEADER"}:e;case QI.Home:return{...e,colIdx:0};case QI.End:return{...e,colIdx:n[e.section].colCount-1};case QI.PageDown:{const t={...e,rowIdx:e.rowIdx+10};return Sq(t,i)}case QI.PageUp:{const t={...e,rowIdx:e.rowIdx-10};return Sq(t,i)}default:return e}})(a,e.key,l):{section:"HEADER",rowIdx:0,colIdx:0};if(!r)return;r(c);const u=i.pivotSection.WRAPPER;u&&((e,t,n,r)=>{const i=t=>{r&&!r()||e()||t>0&&requestAnimationFrame(()=>{i(t-1)})};requestAnimationFrame(()=>{i(t)})})(()=>{const e=(t=c,u.querySelector(`[data-pivot-section="${t.section}"][data-row-idx="${t.rowIdx}"][data-col-idx="${t.colIdx}"]`));var t;if(!e)return!1;const n=i.pivotSection[c.section];if(!n)return!1;const r=((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})(e,n);var s;return r&&(o(c),(s=e)&&(s.focus(),(e=>{e?.setAttribute("tabIndex","0")})(s))),r},5,0,()=>!s?.current)}}},Mq=()=>{const{text:e,fontFamily:t,fontSize:n,justifyContent:r,alignItems:i,height:o}=(()=>{const{theme:e,translator:t}=JT(),{layoutService:n}=eO(),r=e.getStyle("","","fontFamily")??fP;return n.hasData?n.hasLimitedData?{text:t.get("SNPivotTable.LimitedData"),fontSize:"13px",fontFamily:r,alignItems:"center",height:"22px"}:{}:{text:t.get("SNPivotTable.NoData"),fontSize:"16px",fontFamily:r,justifyContent:"center",alignItems:"center",height:"100%"}})();return void 0===e?null:co.jsx("div",{style:{display:"flex",justifyContent:r,alignItems:i,width:"100%",height:o},children:co.jsx("span",{style:{...TP,fontFamily:t,fontSize:n,fontStyle:"italic",color:"#7b7a78"},children:e})})},kq=20,Iq=18,Rq=.75,_q=e=>-1!==e&&e?.representation?.type===KA.Image,Dq=({isLeftColumn:e,layoutService:t,representation:n})=>Boolean(e)&&t.isIndentModeEnabled&&n.type===KA.Image,Aq=e=>void 0===e?mP:e,Pq=(e,t)=>{if(void 0!==e&&!Number.isNaN(+e)){const n=+e;return n>=0?n:t}return t},Lq=e=>Pq(e,tR.PixelsDefault),Tq=(e,t)=>Pq(e,tR.PercentageDefault)*t/100,Oq=(e,t,n)=>{switch(t?.type){case nR.Pixels:return Lq(t.pixels);case nR.Percentage:return Tq(t.percentage,e);case nR.FitToContent:case nR.Auto:default:return n}},qq=({headers:e,layoutService:t,effectivePropertiesService:n,estimateWidthForDimensionValue:r,shouldConsiderCombinatedLength:i,measureTextForHeader:o,longestMeasureValuePossible:s})=>e.reduce((e,a,l)=>{const{layout:{qHyperCube:{qNoOfLeftDims:c,qDimensionInfo:u}}}=t,{id:d,colIdx:h,qApprMaxGlyphCount:p,isLeftDimension:f}=a,m=u.find(e=>e.cId===d),g={width:24,...m?.representation?.imageBox};if(!f)return e+0;if(d===iO)return e+0;const y=Dq({isLeftColumn:f,layoutService:t,representation:m?.representation||{type:KA.Text}})?g.width+8+4:r(p),v=!n.qAlwaysFullyExpanded&&h<c-1?21:0;let b=0;if(i&&o&&s){b=o("- ")+s}return Math.max(e,24*l+Iq+v+y+b)},0),Nq=(e,t,n)=>e.reduce((e,r)=>{const i=(n?0:1)*Iq;return Math.max(e,i+t(r.qFallbackTitle??""))},0),jq=(e,t,n,r)=>{const i=100*e/t,o=r*Rq*(i/100),s=i/100*+n;return Math.min(s,o)},zq=(e,t,n,r)=>r*(+n/100)*(100*e/t/100),Fq=(e,t)=>e.some(e=>e>=t*Rq),Wq=({layoutService:e,effectivePropertiesService:t,headersData:n,columnWidths:r,tableWidth:i,widthOverride:o,measureTextForHeader:s,estimateWidthForDimensionValue:a,measureTextWidthForMeasuresCombinedWithDimensions:l,translator:c})=>{let u;const d=i*Rq,h=n.data[n.data.length-1][0];if(!Array.isArray(h))return{leftGridWidth:0,leftGridColumnWidths:[],leftGridFullWidth:0};const p=Math.min(d,r.at(-1)),f=Math.min(d,qq({headers:h,layoutService:e,effectivePropertiesService:t,estimateWidthForDimensionValue:a})),m=Math.min(d,Nq(e.visibleMeasureInfo,s));let g;const y=h.findIndex(e=>e.id===iO),v=(({layoutService:e,measureTextForHeader:t,translator:n,headersData:r})=>{const{type:i}=e.indentModeColumnWidth;return i===nR.Auto&&r.size.y<=1?t(n.get("SNPivotTable.IndentMode.Rows"))+8+Iq+16:24})({layoutService:e,measureTextForHeader:s,translator:c,headersData:n});if(e.hasPseudoDimOnLeft)if(0===y){const e=Math.max(p,f,m);u=[Math.max(v,e-p),p]}else{const n=Math.min(d,Nq(e.visibleMeasureInfo,l,!0));g=Math.min(d,qq({headers:h.slice(0,y),layoutService:e,effectivePropertiesService:t,estimateWidthForDimensionValue:a,shouldConsiderCombinatedLength:!0,measureTextForHeader:s,longestMeasureValuePossible:n}));const r=Math.max(p,f,g);u=[Math.max(v,r-p),p]}else u=[Math.max(v,f-p),p];const b=Math.min(d,u.reduce((e,t)=>e+t,0)),{indentModeColumnWidth:x}=e;o&&o<=d&&(x.type=nR.Pixels,x.pixels=o);return[nR.Pixels,nR.Percentage].includes(x.type)||Fq(u,i)?((e,t,n,r)=>{let i=e[0],o=e[1];const s=e.reduce((e,t)=>e+t,0),{type:a,pixels:l,percentage:c}=t,u=Pq(l,tR.PixelsDefault),d=Pq(c,tR.PercentageDefault),h=Fq(e,n);let p;a===nR.Auto&&h&&(i>o?i-=o:o-=i),a===nR.Pixels&&u&&(i=jq(e[0],s,u,n),o=jq(e[1],s,u,n)),a===nR.Percentage&&d&&(i=zq(e[0],s,d,n),o=zq(e[1],s,d,n)),o<=r&&(p=i-5,p>0&&(i-=p,o+=p)),p=o-r,p>0&&(i+=p,o-=p);const f=[i,o],m=f.reduce((e,t)=>e+t,0);return{leftGridColumnWidths:f,leftGridWidth:m,leftGridFullWidth:m}})(u,x,i,p):{leftGridWidth:b,leftGridColumnWidths:u,leftGridFullWidth:b}};function $q({tableWidth:e}){const t=e*Rq,{styleService:n,layoutService:r,effectivePropertiesService:i}=eO(),{translator:o}=JT(),{gridSectionsData:{headersData:s}}=xq(),{measureText:a}=cL(n.header,{allowLineBreaks:!1}),{estimateWidth:l,measureText:c}=cL({...n.dimensionValues,fontWeight:Aq(n.dimensionValues.fontWeight)}),{measureText:u}=cL({...n.dimensionValues,...n.measureLabels}),h=d((n,d)=>{const{layout:{qHyperCube:{qNoOfLeftDims:h,topHeadersColumnWidth:p}},visibleMeasureInfo:f,isIndentModeEnabled:m,hasPseudoDimOnLeft:g}=r,y=(t=0)=>f.reduce((n,{qFallbackTitle:r,columnWidth:i})=>{const o=u(r)+Iq,s=Math.max(o,t);return Math.max(n,m?s:Oq(e,i,s))},0),v=e=>s.data.reduce((t,n)=>{const r=n.at(e);if(!r||Array.isArray(r))return t;if(r.id===iO)return t;const i=(e=>{const{label:t,isLocked:n}=e,r=n?kq:0;return Iq+a(t)+kq+r})(r);return Math.max(i,t)},0);let b=0,x=s.data.at(-1);m&&s.size.x>1&&x&&x[0]&&(x=x[0]);const w=x.map((o,a)=>{let c;if(m&&1!==s.size.x||!n||void 0===d||d!==o.colIdx){let t,n;if(o.columnWidthLocation===nP.Pivot?t=m?void 0:p:o.columnWidthLocation===nP.Dimension&&({columnWidth:t}=o),o.isLeftDimension)if(o.id===iO)n=y();else{const e=v(a),t=((e,t)=>{const{qApprMaxGlyphCount:n,isLeftDimension:o,dimensionInfoIndex:s}=e,a=r.getDimensionInfo(s);if(_q(a))return tR.PixelsDefault;const c=!i.qAlwaysFullyExpanded&&o&&t<h-1?21:0;return Iq+l(n)+c})(o,a);n=Math.max(e,t),m&&!g&&a+1===h&&o.columnWidthLocation===nP.Dimension&&s.size.x>1&&(n=e)}else n=v(a),o.columnWidthLocation===nP.Measures&&(n=y(n));m&&1===s.size.x&&(t=r.indentModeColumnWidth),c=m&&!g&&s.size.x>1?n:Oq(e,t,n)}else c=m?Math.min(t,n):n;return b+=c,c});return m&&s.size.x>1?Wq({layoutService:r,effectivePropertiesService:i,headersData:s,columnWidths:w,tableWidth:e,widthOverride:n,measureTextForHeader:a,estimateWidthForDimensionValue:l,measureTextWidthForMeasuresCombinedWithDimensions:c,translator:o}):{leftGridWidth:Math.min(t,b),leftGridColumnWidths:w,leftGridFullWidth:b}},[e,s,r,t,a,u,l,c,o,i]),[f,m]=p(h);fL(()=>{m(h())},[h]);const g=d((e,t)=>{m(h(e,t))},[h]);return{...f,overrideLeftGridWidth:g}}function Bq({tableWidth:e,verticalScrollbarWidth:t,leftGridWidth:n}){const{styleService:r,layoutService:i}=eO(),{visibleDimensionsInfo:{visibleTopDimensionInfo:o}}=xq(),{layout:{qHyperCube:{qNoOfLeftDims:s,qEffectiveInterColumnSortOrder:a}},size:l,visibleMeasureInfo:c}=i,{estimateWidth:u,measureText:h}=cL(r.measureValues,{allowLineBreaks:!1}),{estimateWidth:p}=cL({...r.dimensionValues,fontWeight:Aq(r.dimensionValues.fontWeight)},{allowLineBreaks:!1}),f=e-n-1,g=o.at(-1),y=g===rO,v=a.length-s>o.length?21:0,b=m(()=>{const e=y?c:[g],t=l.x/e.length,n=[],r=[];let i=f;const o=(e,r)=>{n[e]=Math.min(tR.PixelsMax,Math.max(tR.PixelsMin,r)),i-=n[e]*t};if(e.forEach((e,t)=>{if(e?.columnWidth){const{columnWidth:{type:n,pixels:i,percentage:s},qApprMaxGlyphCount:a,qFallbackTitle:l}=e;switch(n){case nR.Pixels:o(t,Lq(i));break;case nR.Percentage:o(t,Tq(s,f));break;case nR.FitToContent:o(t,((e,t,n)=>n?tR.PixelsDefault:Iq+(y?Math.max(u(e),h(t)):Math.max(Math.max(...c.map(e=>u(e.qApprMaxGlyphCount))),p(e)+v)))(a,l??"",_q(e)));break;case nR.Auto:default:r.push(t)}}else r.push(t)}),r.length){const e=r.length*t,o=i/e;r.forEach(e=>{n[e]=Math.max(tR.AutoMinPivot,o)})}return n},[y,c,g,l.x,f,u,h,p,v]),x=m(()=>{if(y){const e=c.reduce((e,t,n)=>e+b[n],0);return e/c.length}return b[0]},[y,b,c]),w=l.x*x,S=Math.max(0,f-w),C=Math.max(0,t-S),E=parseFloat((C/i.size.x).toFixed(12)),M=d(e=>(y&&void 0!==e?b[i.getMeasureInfoIndexFromCellIndex(e,!0)]:x)-E,[y,b,i,x,E]);return{rightGridFullWidth:w,rightGridWidth:Math.min(w,f),getRightGridColumnWidth:M}}const Vq=`scrollable-container--${iP.TopGrid}`,Hq=`scrollable-container--${iP.LeftGrid}`,Gq=`scrollable-container--${iP.DataGrid}`,Uq=e=>{if(!(e&&e instanceof HTMLDivElement))return{width:0,height:0};const t=e.offsetWidth-e.clientWidth,n=e.offsetHeight-e.clientHeight;return{width:t>=2?t:0,height:n>=2?n:0}},Yq=(e,t)=>e>t?oP.Forward:e<t?oP.Backward:oP.None,Kq=({gridRefs:{topGridRef:e,leftGridRef:t,dataGridRef:n},getWrapperElements:r,updateViewService:i,trackScrollDirection:o,interactions:s})=>{const{direction:a}=YT();c(()=>{const{headerGridWrapperElement:l,topGridWrapperElement:c,leftGridWrapperElement:u,dataGridWrapperElement:d}=r(),h=e=>{const t=e.target;l.scrollLeft=t.scrollLeft,o(e),i?.(e)},p=e=>{const t=e.target;l.scrollTop=t.scrollTop,o(e),i?.(e)},f=r=>{const s=r.target,l=((e,t)=>{const{scrollWidth:n,clientWidth:r,scrollLeft:i}=e,o=n-r;if("rtl"===t){if(i>o)return o;if(i<0)return Math.abs(i)}return i})(s,a);n.current?.scrollTo({scrollLeft:l,scrollTop:s.scrollTop}),c.scrollLeft=l,e.current?.forEach(e=>{e?.scrollTo(l)}),u.scrollTop=d.scrollTop,t.current?.forEach(e=>{e?.scrollTo(s.scrollTop)}),o(r),i?.(r)};return u.addEventListener("scroll",h),c.addEventListener("scroll",p),d.addEventListener("scroll",f),s.scroll||setTimeout(()=>{u.removeEventListener("scroll",h),c.removeEventListener("scroll",p),d.removeEventListener("scroll",f)},0),()=>{u.removeEventListener("scroll",h),c.removeEventListener("scroll",p),d.removeEventListener("scroll",f)}},[o,i,s,e,t,n,r,a])},Xq=vp(!1),Jq=(e,t)=>Math.abs(e.width-t.width)>2||Math.abs(e.height-t.height)>2,Zq=({topGridWrapperRef:e,leftGridWrapperRef:t,dataGridWrapperRef:n})=>{const{top:r,left:i,data:o,resetHorizontalScrollbarHeight:a}=((e,t,n)=>{const[r,i]=p({width:0,height:0}),[o,a]=p({width:0,height:0}),[l,u]=p({width:0,height:0}),[h,f]=p(!1),m=Dp(Xq),g=s(m),y=s(m);g.current=m;const v=d(()=>{f(e=>!e&&e);const r=Uq(e.current),o=Uq(t.current),s=Uq(n.current);i(e=>Jq(e,r)?r:e),a(e=>Jq(e,o)?o:e),u(e=>Jq(e,s)?s:e)},[e,t,n]);c(()=>{const r=new ResizeObserver(()=>{g.current||v()});return[e.current,t.current,n.current].filter(e=>Boolean(e)).forEach(e=>{r.observe(e)}),()=>{r.disconnect()}},[v,e,t,n]),c(()=>{const e=y.current;if(y.current=m,e&&!m){const e=setTimeout(v,0);return()=>{clearTimeout(e)}}},[m,v]);const b=d(()=>{f(!0)},[]);return{top:r,left:h?{...o,height:0}:o,data:h?{...l,height:0}:l,resetHorizontalScrollbarHeight:b}})(e,t,n);return{scrollbarsDimensions:{verticalScrollbarWidth:Math.max(r.width,o.width),horizontalScrollbarHeight:Math.max(i.height,o.height)},resetHorizontalScrollbarHeight:a}},Qq=()=>{const{interactions:e}=JT(),t=s(null),n=s(null),r=s(null),i=s(null),o=s([]),a=s([]),l=s(null),{scrollbarsDimensions:{verticalScrollbarWidth:u,horizontalScrollbarHeight:h},resetHorizontalScrollbarHeight:p}=Zq({topGridWrapperRef:n,leftGridWrapperRef:r,dataGridWrapperRef:i});(({gridSectionsWrapperRefs:{headerGridWrapperRef:e,topGridWrapperRef:t,leftGridWrapperRef:n,dataGridWrapperRef:r},gridRefs:{topGridRef:i,leftGridRef:o,dataGridRef:s}})=>{const{pageInfo:a}=YT(),{downloadService:l,viewService:c,layoutService:u}=eO(),h=d(()=>{const i={left:0,top:0};e.current?.scrollTo(i),t.current?.scrollTo(i),n.current?.scrollTo(i),r.current?.scrollTo(i)},[e,t,n,r]);f(()=>{h()},[a.page,h]),f(()=>{u.triggerdByExpandOrCollapse||h()},[u,h]),f(()=>{if(u.triggerdByExpandOrCollapse){const e=r.current?.scrollLeft??0,t=r.current?.scrollTop??0;o.current?.forEach(e=>{e?.scrollTo(t)}),i.current?.forEach(t=>{t?.scrollTo(e)}),s.current?.scrollTo({scrollTop:t,scrollLeft:e})}},[u,r,s,o,i]),f(()=>{(l.isDownloadedAsPDForImage||u.isSnapshot)&&r.current&&n.current&&t.current&&(r.current.scrollTop=c.scrollTop,r.current.scrollLeft=c.scrollLeft,n.current.scrollLeft=c.leftGridScrollLeft,t.current.scrollTop=c.topGridScrollTop)},[c,l,u,r,n,t])})({gridSectionsWrapperRefs:{headerGridWrapperRef:t,topGridWrapperRef:n,leftGridWrapperRef:r,dataGridWrapperRef:i},gridRefs:{topGridRef:o,leftGridRef:a,dataGridRef:l}});const{trackScrollDirection:m,scrollDirectionRefs:{verticalScrollDirection:g,horizontalScrollDirection:y}}=(()=>{const e=s(oP.None),t=s(oP.None),n=s({prevScrollTop:0,prevScrollLeft:0});return{trackScrollDirection:d(r=>{if(r instanceof WheelEvent&&(e.current=Yq(r.deltaY,0),t.current=Yq(r.deltaX,0)),r instanceof Event&&!(r instanceof WheelEvent)){const i=r.target;e.current=Yq(i.scrollTop,n.current.prevScrollTop),n.current.prevScrollTop=i.scrollTop,t.current=Yq(i.scrollLeft,n.current.prevScrollLeft),n.current.prevScrollLeft=i.scrollLeft}},[e,t,n]),scrollDirectionRefs:{verticalScrollDirection:e,horizontalScrollDirection:t}}})(),v=(()=>{const{viewService:e}=eO();return d(t=>{const n=t.target,r=t.currentTarget,i=n.dataset.key;i===Hq&&(e.leftGridScrollLeft=r.scrollLeft),i===Gq&&(e.scrollLeft=r.scrollLeft),i===Vq&&(e.topGridScrollTop=r.scrollTop),i!==Hq&&i!==Gq||(e.scrollTop=r.scrollTop)},[e])})(),b=d(()=>({headerGridWrapperElement:t.current,topGridWrapperElement:n.current,leftGridWrapperElement:r.current,dataGridWrapperElement:i.current}),[t,n,r,i]),x={gridRefs:{topGridRef:o,leftGridRef:a,dataGridRef:l},getWrapperElements:b,updateViewService:v,trackScrollDirection:m,interactions:e};(({gridRefs:{topGridRef:e,leftGridRef:t,dataGridRef:n},getWrapperElements:r,updateViewService:i,trackScrollDirection:o,interactions:s})=>{c(()=>{const{headerGridWrapperElement:i,topGridWrapperElement:a,leftGridWrapperElement:l,dataGridWrapperElement:c}=r(),u=e=>{e.ctrlKey||(e.preventDefault(),i.scrollLeft+=e.deltaX,i.scrollTop+=e.deltaY,l.scrollLeft=i.scrollLeft,a.scrollTop=i.scrollTop,o(e))},d=e=>{e.ctrlKey||(e.preventDefault(),l.scrollTop+=e.deltaY,t.current?.forEach(e=>{e?.scrollTo(l.scrollTop)}),i.scrollLeft+=e.deltaX,l.scrollLeft=i.scrollLeft,c.scrollTop=l.scrollTop,n.current?.scrollTo({scrollTop:l.scrollTop}),o(e))},h=t=>{t.ctrlKey||(t.preventDefault(),a.scrollLeft+=t.deltaX,e.current?.forEach(e=>{e?.scrollTo(a.scrollLeft)}),i.scrollTop+=t.deltaY,a.scrollTop=i.scrollTop,c.scrollLeft=a.scrollLeft,n.current?.scrollTo({scrollLeft:a.scrollLeft}),o(t))},p=r=>{r.ctrlKey||(r.preventDefault(),c.scrollLeft+=r.deltaX,c.scrollTop+=r.deltaY,n.current?.scrollTo({scrollLeft:c.scrollLeft,scrollTop:c.scrollTop}),a.scrollLeft=c.scrollLeft,e.current?.forEach(e=>{e?.scrollTo(c.scrollLeft)}),l.scrollTop=c.scrollTop,t.current?.forEach(e=>{e?.scrollTo(c.scrollTop)}),o(r))};return i.addEventListener("wheel",u),l.addEventListener("wheel",d),a.addEventListener("wheel",h),c.addEventListener("wheel",p),s.scroll||setTimeout(()=>{i.removeEventListener("wheel",u),l.removeEventListener("wheel",d),a.removeEventListener("wheel",h),c.removeEventListener("wheel",p)},0),()=>{i.removeEventListener("wheel",u),l.removeEventListener("wheel",d),a.removeEventListener("wheel",h),c.removeEventListener("wheel",p)}},[o,i,s,e,t,n,r])})(x),Kq(x);const w=d(e=>{switch(e.section){case"TOP":o.current[0]?.scrollToItem(e.rowIdx);break;case"LEFT":a.current[0]?.scrollToItem(e.rowIdx);break;case"DATA":l.current?.scrollToItem({rowIndex:e.rowIdx,columnIndex:e.colIdx})}},[]);return{gridSectionsWrapperRefs:{headerGridWrapperRef:t,topGridWrapperRef:n,leftGridWrapperRef:r,dataGridWrapperRef:i},gridRefs:{topGridRef:o,leftGridRef:a,dataGridRef:l},scrollDirectionRefs:{verticalScrollDirection:g,horizontalScrollDirection:y},scrollbarsDimensions:{verticalScrollbarWidth:u,horizontalScrollbarHeight:h,resetHorizontalScrollbarHeight:p},scrollToCoordCallBack:w}},eN=()=>{const{layoutService:e}=eO(),{rect:t,pageInfo:n}=YT();return m(()=>{let{height:r}=t;return e.hasLimitedData&&(r-=22),n.shouldShowPagination&&(r-=41),{...t,height:r}},[t,e,n.shouldShowPagination])},tN=({children:e,style:t})=>co.jsx("div",{"data-testid":"fullSize",style:t,children:e}),nN=({children:e,style:t})=>{const{direction:n}=YT();return co.jsx("div",{"data-section-id":"GRID",style:{direction:n,display:"grid",...t},children:e})},rN=e=>e&&`scrollable-container--${e}`,iN=({children:e,style:t,origin:n},r)=>{const{interactions:i}=JT(),o=i.scroll?t:{overflow:"hidden"};return co.jsx("div",{"data-testid":"scrollable","data-key":rN(n),style:o,ref:r,children:e})};var oN=t.forwardRef(iN);const sN=({children:e,style:t})=>{const{direction:n}=YT();return co.jsx("div",{"data-testid":"sticky",style:{position:"sticky",top:0,["rtl"===n?"right":"left"]:0,...t},children:e})};var aN=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function lN(e,t){return e===t||!(!aN(e)||!aN(t))}function cN(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!lN(e[n],t[n]))return!1;return!0}function uN(e,t){var n;void 0===t&&(t=cN);var r,i=[],o=!1;return function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return o&&n===this&&t(s,i)||(r=e.apply(this,s),o=!0,n=this,i=s),r}}var dN="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function hN(e){cancelAnimationFrame(e.id)}function pN(e,t){var n=dN();var r={id:requestAnimationFrame(function i(){dN()-n>=t?e.call(null):r.id=requestAnimationFrame(i)})};return r}var fN=-1;function mN(e){if(void 0===e&&(e=!1),-1===fN||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),fN=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return fN}var gN=null;function yN(e){if(void 0===e&&(e=!1),null===gN||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?gN="positive-descending":(t.scrollLeft=1,gN=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t),gN}return gN}var vN=function(e){var t=e.columnIndex;return e.data,e.rowIndex+":"+t};function bN(e){var t,r=e.getColumnOffset,i=e.getColumnStartIndexForOffset,o=e.getColumnStopIndexForStartIndex,s=e.getColumnWidth,a=e.getEstimatedTotalHeight,l=e.getEstimatedTotalWidth,c=e.getOffsetForColumnAndAlignment,u=e.getOffsetForRowAndAlignment,d=e.getRowHeight,h=e.getRowOffset,p=e.getRowStartIndexForOffset,f=e.getRowStopIndexForStartIndex,m=e.initInstanceProps,g=e.shouldResetStyleCacheOnItemSizeChange,y=e.validateProps;return t=function(e){function t(t){var n;return(n=e.call(this,t)||this)._instanceProps=m(n.props,Ua(n)),n._resetIsScrollingTimeoutId=null,n._outerRef=void 0,n.state={instance:Ua(n),isScrolling:!1,horizontalScrollDirection:"forward",scrollLeft:"number"==typeof n.props.initialScrollLeft?n.props.initialScrollLeft:0,scrollTop:"number"==typeof n.props.initialScrollTop?n.props.initialScrollTop:0,scrollUpdateWasRequested:!1,verticalScrollDirection:"forward"},n._callOnItemsRendered=void 0,n._callOnItemsRendered=uN(function(e,t,r,i,o,s,a,l){return n.props.onItemsRendered({overscanColumnStartIndex:e,overscanColumnStopIndex:t,overscanRowStartIndex:r,overscanRowStopIndex:i,visibleColumnStartIndex:o,visibleColumnStopIndex:s,visibleRowStartIndex:a,visibleRowStopIndex:l})}),n._callOnScroll=void 0,n._callOnScroll=uN(function(e,t,r,i,o){return n.props.onScroll({horizontalScrollDirection:r,scrollLeft:e,scrollTop:t,verticalScrollDirection:i,scrollUpdateWasRequested:o})}),n._getItemStyle=void 0,n._getItemStyle=function(e,t){var i,o=n.props,a=o.columnWidth,l=o.direction,c=o.rowHeight,u=n._getItemStyleCache(g&&a,g&&l,g&&c),p=e+":"+t;if(u.hasOwnProperty(p))i=u[p];else{var f=r(n.props,t,n._instanceProps),m="rtl"===l;u[p]=i={position:"absolute",left:m?void 0:f,right:m?f:void 0,top:h(n.props,e,n._instanceProps),height:d(n.props,e,n._instanceProps),width:s(n.props,t,n._instanceProps)}}return i},n._getItemStyleCache=void 0,n._getItemStyleCache=uN(function(e,t,n){return{}}),n._onScroll=function(e){var t=e.currentTarget,r=t.clientHeight,i=t.clientWidth,o=t.scrollLeft,s=t.scrollTop,a=t.scrollHeight,l=t.scrollWidth;n.setState(function(e){if(e.scrollLeft===o&&e.scrollTop===s)return null;var t=n.props.direction,c=o;if("rtl"===t)switch(yN()){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(s,a-r));return{isScrolling:!0,horizontalScrollDirection:e.scrollLeft<o?"forward":"backward",scrollLeft:c,scrollTop:u,verticalScrollDirection:e.scrollTop<s?"forward":"backward",scrollUpdateWasRequested:!1}},n._resetIsScrollingDebounced)},n._outerRefSetter=function(e){var t=n.props.outerRef;n._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},n._resetIsScrollingDebounced=function(){null!==n._resetIsScrollingTimeoutId&&hN(n._resetIsScrollingTimeoutId),n._resetIsScrollingTimeoutId=pN(n._resetIsScrolling,150)},n._resetIsScrolling=function(){n._resetIsScrollingTimeoutId=null,n.setState({isScrolling:!1},function(){n._getItemStyleCache(-1)})},n}Na(t,e),t.getDerivedStateFromProps=function(e,t){return xN(e,t),y(e),null};var v=t.prototype;return v.scrollTo=function(e){var t=e.scrollLeft,n=e.scrollTop;void 0!==t&&(t=Math.max(0,t)),void 0!==n&&(n=Math.max(0,n)),this.setState(function(e){return void 0===t&&(t=e.scrollLeft),void 0===n&&(n=e.scrollTop),e.scrollLeft===t&&e.scrollTop===n?null:{horizontalScrollDirection:e.scrollLeft<t?"forward":"backward",scrollLeft:t,scrollTop:n,scrollUpdateWasRequested:!0,verticalScrollDirection:e.scrollTop<n?"forward":"backward"}},this._resetIsScrollingDebounced)},v.scrollToItem=function(e){var t=e.align,n=void 0===t?"auto":t,r=e.columnIndex,i=e.rowIndex,o=this.props,s=o.columnCount,d=o.height,h=o.rowCount,p=o.width,f=this.state,m=f.scrollLeft,g=f.scrollTop,y=mN();void 0!==r&&(r=Math.max(0,Math.min(r,s-1))),void 0!==i&&(i=Math.max(0,Math.min(i,h-1)));var v=a(this.props,this._instanceProps),b=l(this.props,this._instanceProps)>p?y:0,x=v>d?y:0;this.scrollTo({scrollLeft:void 0!==r?c(this.props,r,n,m,this._instanceProps,x):m,scrollTop:void 0!==i?u(this.props,i,n,g,this._instanceProps,b):g})},v.componentDidMount=function(){var e=this.props,t=e.initialScrollLeft,n=e.initialScrollTop;if(null!=this._outerRef){var r=this._outerRef;"number"==typeof t&&(r.scrollLeft=t),"number"==typeof n&&(r.scrollTop=n)}this._callPropsCallbacks()},v.componentDidUpdate=function(){var e=this.props.direction,t=this.state,n=t.scrollLeft,r=t.scrollTop;if(t.scrollUpdateWasRequested&&null!=this._outerRef){var i=this._outerRef;if("rtl"===e)switch(yN()){case"negative":i.scrollLeft=-n;break;case"positive-ascending":i.scrollLeft=n;break;default:var o=i.clientWidth,s=i.scrollWidth;i.scrollLeft=s-o-n}else i.scrollLeft=Math.max(0,n);i.scrollTop=Math.max(0,r)}this._callPropsCallbacks()},v.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&hN(this._resetIsScrollingTimeoutId)},v.render=function(){var e=this.props,t=e.children,r=e.className,i=e.columnCount,o=e.direction,s=e.height,c=e.innerRef,u=e.innerElementType,d=e.innerTagName,h=e.itemData,p=e.itemKey,f=void 0===p?vN:p,m=e.outerElementType,g=e.outerTagName,y=e.rowCount,v=e.style,b=e.useIsScrolling,x=e.width,w=this.state.isScrolling,S=this._getHorizontalRangeToRender(),C=S[0],E=S[1],M=this._getVerticalRangeToRender(),k=M[0],I=M[1],R=[];if(i>0&&y)for(var _=k;_<=I;_++)for(var D=C;D<=E;D++)R.push(n(t,{columnIndex:D,data:h,isScrolling:b?w:void 0,key:f({columnIndex:D,data:h,rowIndex:_}),rowIndex:_,style:this._getItemStyle(_,D)}));var A=a(this.props,this._instanceProps),P=l(this.props,this._instanceProps);return n(m||g||"div",{className:r,onScroll:this._onScroll,ref:this._outerRefSetter,style:Re({position:"relative",height:s,width:x,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},v)},n(u||d||"div",{children:R,ref:c,style:{height:A,pointerEvents:w?"none":void 0,width:P}}))},v._callPropsCallbacks=function(){var e=this.props,t=e.columnCount,n=e.onItemsRendered,r=e.onScroll,i=e.rowCount;if("function"==typeof n&&t>0&&i>0){var o=this._getHorizontalRangeToRender(),s=o[0],a=o[1],l=o[2],c=o[3],u=this._getVerticalRangeToRender(),d=u[0],h=u[1],p=u[2],f=u[3];this._callOnItemsRendered(s,a,d,h,l,c,p,f)}if("function"==typeof r){var m=this.state,g=m.horizontalScrollDirection,y=m.scrollLeft,v=m.scrollTop,b=m.scrollUpdateWasRequested,x=m.verticalScrollDirection;this._callOnScroll(y,v,g,x,b)}},v._getHorizontalRangeToRender=function(){var e=this.props,t=e.columnCount,n=e.overscanColumnCount,r=e.overscanColumnsCount,s=e.overscanCount,a=e.rowCount,l=this.state,c=l.horizontalScrollDirection,u=l.isScrolling,d=l.scrollLeft,h=n||r||s||1;if(0===t||0===a)return[0,0,0,0];var p=i(this.props,d,this._instanceProps),f=o(this.props,p,d,this._instanceProps),m=u&&"backward"!==c?1:Math.max(1,h),g=u&&"forward"!==c?1:Math.max(1,h);return[Math.max(0,p-m),Math.max(0,Math.min(t-1,f+g)),p,f]},v._getVerticalRangeToRender=function(){var e=this.props,t=e.columnCount,n=e.overscanCount,r=e.overscanRowCount,i=e.overscanRowsCount,o=e.rowCount,s=this.state,a=s.isScrolling,l=s.verticalScrollDirection,c=s.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=a&&"backward"!==l?1:Math.max(1,u),g=a&&"forward"!==l?1:Math.max(1,u);return[Math.max(0,d-m),Math.max(0,Math.min(o-1,h+g)),d,h]},t}(w),t.defaultProps={direction:"ltr",itemData:void 0,useIsScrolling:!1},t}var xN=function(e,t){e.children,e.direction,e.height,e.innerTagName,e.outerTagName,e.overscanColumnsCount,e.overscanCount,e.overscanRowsCount,e.width,t.instance},wN=function(e,t){var n=e.rowCount,r=t.rowMetadataMap,i=t.estimatedRowHeight,o=t.lastMeasuredRowIndex,s=0;if(o>=n&&(o=n-1),o>=0){var a=r[o];s=a.offset+a.size}return s+(n-o-1)*i},SN=function(e,t){var n=e.columnCount,r=t.columnMetadataMap,i=t.estimatedColumnWidth,o=t.lastMeasuredColumnIndex,s=0;if(o>=n&&(o=n-1),o>=0){var a=r[o];s=a.offset+a.size}return s+(n-o-1)*i},CN=function(e,t,n,r){var i,o,s;if("column"===e?(i=r.columnMetadataMap,o=t.columnWidth,s=r.lastMeasuredColumnIndex):(i=r.rowMetadataMap,o=t.rowHeight,s=r.lastMeasuredRowIndex),n>s){var a=0;if(s>=0){var l=i[s];a=l.offset+l.size}for(var c=s+1;c<=n;c++){var u=o(c);i[c]={offset:a,size:u},a+=u}"column"===e?r.lastMeasuredColumnIndex=n:r.lastMeasuredRowIndex=n}return i[n]},EN=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?MN(e,t,n,o,0,r):kN(e,t,n,Math.max(0,o),r)},MN=function(e,t,n,r,i,o){for(;i<=r;){var s=i+Math.floor((r-i)/2),a=CN(e,t,s,n).offset;if(a===o)return s;a<o?i=s+1:a>o&&(r=s-1)}return i>0?i-1:0},kN=function(e,t,n,r,i){for(var o="column"===e?t.columnCount:t.rowCount,s=1;r<o&&CN(e,t,r,n).offset<i;)r+=s,s*=2;return MN(e,t,n,Math.min(r,o-1),Math.floor(r/2),i)},IN=function(e,t,n,r,i,o,s){var a="column"===e?t.width:t.height,l=CN(e,t,n,o),c="column"===e?SN(t,o):wN(t,o),u=Math.max(0,Math.min(c-a,l.offset)),d=Math.max(0,l.offset-a+s+l.size);switch("smart"===r&&(r=i>=d-a&&i<=u+a?"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}},RN=bN({getColumnOffset:function(e,t,n){return CN("column",e,t,n).offset},getColumnStartIndexForOffset:function(e,t,n){return EN("column",e,n,t)},getColumnStopIndexForStartIndex:function(e,t,n,r){for(var i=e.columnCount,o=e.width,s=CN("column",e,t,r),a=n+o,l=s.offset+s.size,c=t;c<i-1&&l<a;)c++,l+=CN("column",e,c,r).size;return c},getColumnWidth:function(e,t,n){return n.columnMetadataMap[t].size},getEstimatedTotalHeight:wN,getEstimatedTotalWidth:SN,getOffsetForColumnAndAlignment:function(e,t,n,r,i,o){return IN("column",e,t,n,r,i,o)},getOffsetForRowAndAlignment:function(e,t,n,r,i,o){return IN("row",e,t,n,r,i,o)},getRowOffset:function(e,t,n){return CN("row",e,t,n).offset},getRowHeight:function(e,t,n){return n.rowMetadataMap[t].size},getRowStartIndexForOffset:function(e,t,n){return EN("row",e,n,t)},getRowStopIndexForStartIndex:function(e,t,n,r){for(var i=e.rowCount,o=e.height,s=CN("row",e,t,r),a=n+o,l=s.offset+s.size,c=t;c<i-1&&l<a;)c++,l+=CN("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,s=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),s&&t.forceUpdate()},r},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.columnWidth,e.rowHeight}}),_N=function(e,t){return e};function DN(e){var t,r=e.getItemOffset,i=e.getEstimatedTotalSize,o=e.getItemSize,s=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,l=e.getStopIndexForStartIndex,c=e.initInstanceProps,u=e.shouldResetStyleCacheOnItemSizeChange,d=e.validateProps;return t=function(e){function t(t){var n;return(n=e.call(this,t)||this)._instanceProps=c(n.props,Ua(n)),n._outerRef=void 0,n._resetIsScrollingTimeoutId=null,n.state={instance:Ua(n),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof n.props.initialScrollOffset?n.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},n._callOnItemsRendered=void 0,n._callOnItemsRendered=uN(function(e,t,r,i){return n.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:r,visibleStopIndex:i})}),n._callOnScroll=void 0,n._callOnScroll=uN(function(e,t,r){return n.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:r})}),n._getItemStyle=void 0,n._getItemStyle=function(e){var t,i=n.props,s=i.direction,a=i.itemSize,l=i.layout,c=n._getItemStyleCache(u&&a,u&&l,u&&s);if(c.hasOwnProperty(e))t=c[e];else{var d=r(n.props,e,n._instanceProps),h=o(n.props,e,n._instanceProps),p="horizontal"===s||"horizontal"===l,f="rtl"===s,m=p?d:0;c[e]=t={position:"absolute",left:f?void 0:m,right:f?m:void 0,top:p?0:d,height:p?"100%":h,width:p?h:"100%"}}return t},n._getItemStyleCache=void 0,n._getItemStyleCache=uN(function(e,t,n){return{}}),n._onScrollHorizontal=function(e){var t=e.currentTarget,r=t.clientWidth,i=t.scrollLeft,o=t.scrollWidth;n.setState(function(e){if(e.scrollOffset===i)return null;var t=n.props.direction,s=i;if("rtl"===t)switch(yN()){case"negative":s=-i;break;case"positive-descending":s=o-r-i}return s=Math.max(0,Math.min(s,o-r)),{isScrolling:!0,scrollDirection:e.scrollOffset<s?"forward":"backward",scrollOffset:s,scrollUpdateWasRequested:!1}},n._resetIsScrollingDebounced)},n._onScrollVertical=function(e){var t=e.currentTarget,r=t.clientHeight,i=t.scrollHeight,o=t.scrollTop;n.setState(function(e){if(e.scrollOffset===o)return null;var t=Math.max(0,Math.min(o,i-r));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}},n._resetIsScrollingDebounced)},n._outerRefSetter=function(e){var t=n.props.outerRef;n._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},n._resetIsScrollingDebounced=function(){null!==n._resetIsScrollingTimeoutId&&hN(n._resetIsScrollingTimeoutId),n._resetIsScrollingTimeoutId=pN(n._resetIsScrolling,150)},n._resetIsScrolling=function(){n._resetIsScrollingTimeoutId=null,n.setState({isScrolling:!1},function(){n._getItemStyleCache(-1,null)})},n}Na(t,e),t.getDerivedStateFromProps=function(e,t){return AN(e,t),d(e),null};var h=t.prototype;return h.scrollTo=function(e){e=Math.max(0,e),this.setState(function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},h.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,i=n.layout,o=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var a=0;if(this._outerRef){var l=this._outerRef;a="vertical"===i?l.scrollWidth>l.clientWidth?mN():0:l.scrollHeight>l.clientHeight?mN():0}this.scrollTo(s(this.props,e,t,o,this._instanceProps,a))},h.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var i=this._outerRef;"horizontal"===t||"horizontal"===r?i.scrollLeft=n:i.scrollTop=n}this._callPropsCallbacks()},h.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,i=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("horizontal"===t||"horizontal"===n)if("rtl"===t)switch(yN()){case"negative":o.scrollLeft=-i;break;case"positive-ascending":o.scrollLeft=i;break;default:var s=o.clientWidth,a=o.scrollWidth;o.scrollLeft=a-s-i}else o.scrollLeft=i;else o.scrollTop=i}this._callPropsCallbacks()},h.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&hN(this._resetIsScrollingTimeoutId)},h.render=function(){var e=this.props,t=e.children,r=e.className,o=e.direction,s=e.height,a=e.innerRef,l=e.innerElementType,c=e.innerTagName,u=e.itemCount,d=e.itemData,h=e.itemKey,p=void 0===h?_N:h,f=e.layout,m=e.outerElementType,g=e.outerTagName,y=e.style,v=e.useIsScrolling,b=e.width,x=this.state.isScrolling,w="horizontal"===o||"horizontal"===f,S=w?this._onScrollHorizontal:this._onScrollVertical,C=this._getRangeToRender(),E=C[0],M=C[1],k=[];if(u>0)for(var I=E;I<=M;I++)k.push(n(t,{data:d,key:p(I,d),index:I,isScrolling:v?x:void 0,style:this._getItemStyle(I)}));var R=i(this.props,this._instanceProps);return n(m||g||"div",{className:r,onScroll:S,ref:this._outerRefSetter,style:Re({position:"relative",height:s,width:b,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:o},y)},n(l||c||"div",{children:k,ref:a,style:{height:w?"100%":R,pointerEvents:x?"none":void 0,width:w?R:"100%"}}))},h._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],i=e[3];this._callOnItemsRendered(t,n,r,i)}if("function"==typeof this.props.onScroll){var o=this.state,s=o.scrollDirection,a=o.scrollOffset,l=o.scrollUpdateWasRequested;this._callOnScroll(s,a,l)}},h._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,i=r.isScrolling,o=r.scrollDirection,s=r.scrollOffset;if(0===t)return[0,0,0,0];var c=a(this.props,s,this._instanceProps),u=l(this.props,c,s,this._instanceProps),d=i&&"backward"!==o?1:Math.max(1,n),h=i&&"forward"!==o?1:Math.max(1,n);return[Math.max(0,c-d),Math.max(0,Math.min(t-1,u+h)),c,u]},t}(w),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var AN=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},PN=function(e,t,n){var r=e.itemSize,i=n.itemMetadataMap,o=n.lastMeasuredIndex;if(t>o){var s=0;if(o>=0){var a=i[o];s=a.offset+a.size}for(var l=o+1;l<=t;l++){var c=r(l);i[l]={offset:s,size:c},s+=c}n.lastMeasuredIndex=t}return i[t]},LN=function(e,t,n,r,i){for(;r<=n;){var o=r+Math.floor((n-r)/2),s=PN(e,o,t).offset;if(s===i)return o;s<i?r=o+1:s>i&&(n=o-1)}return r>0?r-1:0},TN=function(e,t,n,r){for(var i=e.itemCount,o=1;n<i&&PN(e,n,t).offset<r;)n+=o,o*=2;return LN(e,t,Math.min(n,i-1),Math.floor(n/2),r)},ON=function(e,t){var n=e.itemCount,r=t.itemMetadataMap,i=t.estimatedItemSize,o=t.lastMeasuredIndex,s=0;if(o>=n&&(o=n-1),o>=0){var a=r[o];s=a.offset+a.size}return s+(n-o-1)*i},qN=DN({getItemOffset:function(e,t,n){return PN(e,t,n).offset},getItemSize:function(e,t,n){return n.itemMetadataMap[t].size},getEstimatedTotalSize:ON,getOffsetForIndexAndAlignment:function(e,t,n,r,i,o){var s=e.direction,a=e.height,l=e.layout,c=e.width,u="horizontal"===s||"horizontal"===l?c:a,d=PN(e,t,i),h=ON(e,i),p=Math.max(0,Math.min(h-u,d.offset)),f=Math.max(0,d.offset-u+d.size+o);switch("smart"===n&&(n=r>=f-u&&r<=p+u?"auto":"center"),n){case"start":return p;case"end":return f;case"center":return Math.round(f+(p-f)/2);default:return r>=f&&r<=p?r:r<f?f:p}},getStartIndexForOffset:function(e,t,n){return function(e,t,n){var r=t.itemMetadataMap,i=t.lastMeasuredIndex;return(i>0?r[i].offset:0)>=n?LN(e,t,i,0,n):TN(e,t,Math.max(0,i),n)}(e,n,t)},getStopIndexForStartIndex:function(e,t,n,r){for(var i=e.direction,o=e.height,s=e.itemCount,a=e.layout,l=e.width,c="horizontal"===i||"horizontal"===a?l:o,u=PN(e,t,r),d=n+c,h=u.offset+u.size,p=t;p<s-1&&h<d;)p++,h+=PN(e,p,r).size;return p},initInstanceProps:function(e,t){var n={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||50,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,r){void 0===r&&(r=!0),n.lastMeasuredIndex=Math.min(n.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),r&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.itemSize}});function NN(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 jN=["style"],zN=["style"];function FN(e,t){var n=e.style,r=_e(e,jN),i=t.style,o=_e(t,zN);return!NN(n,i)&&!NN(r,o)}const WN=10,$N=(e,t)=>e.current===oP.Backward?t:0,BN=(e,t,n,r)=>{for(let i=n;i<n+r;i++){const n=e.at(i);if(void 0===n||void 0===n.at(t))return!0}return!1},VN=(e,t)=>e.qLeft+e.qWidth===t.qLeft&&e.qTop===t.qTop&&e.qHeight===t.qHeight,HN=({pageInfo:e,measureData:t,pageTop:n,qHeight:r,startLeft:i,endLeft:o})=>{const s=[],a=e.page*e.rowsPerPage;for(let e=i;e<o;e++)if(BN(t,e,n,r)){const t=s[s.length-1],i={qLeft:e,qTop:n+a,qWidth:1,qHeight:r};void 0!==t&&VN(t,i)?t.qWidth+=i.qWidth:s.push(i)}return s},GN=({pageInfo:e,measureData:t,scrollDirection:n,viewService:r,minBufferStartLeft:i,minBufferEndLeft:o,columnEndIndex:s})=>{const{gridRowStartIndex:a,gridHeight:l}=r,c=n.current===oP.Backward?Math.max(0,i-25):o,u=Math.min(c+25,s);return HN({pageInfo:e,measureData:t,startLeft:c,endLeft:u,pageTop:a,qHeight:l})},UN=({pageInfo:e,measureData:t,scrollDirection:n,layoutService:r,viewService:i})=>{const{startLeft:o,endLeft:s,pageTop:a,qHeight:l}=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:s}=t,a=e.size.x,l=$N(n,WN),c=Math.max(r-l,0);return{startLeft:c,endLeft:c+Math.min(o+WN,a-c),pageTop:i,qHeight:s}})(r,i,n),c=HN({pageInfo:e,measureData:t,startLeft:o,endLeft:s,pageTop:a,qHeight:l});return c.length>0?[...c,...GN({pageInfo:e,measureData:t,scrollDirection:n,viewService:i,minBufferStartLeft:o,minBufferEndLeft:s,columnEndIndex:r.size.x})]:c},YN=(e,t,n,r)=>{const i=e[n];if(void 0===i)return!0;for(let e=t;e<t+r;e++){if(void 0===i[e])return!0}return!1},KN=(e,t)=>e.qTop+e.qHeight===t.qTop&&e.qLeft===t.qLeft&&e.qWidth===t.qWidth,XN=({startTop:e,endTop:t,qLeft:n,qWidth:r,measureData:i,pageInfo:o})=>{const s=[],a=o.page*o.rowsPerPage;for(let o=e;o<t;o++)if(YN(i,n,o,r)){const e=s.at(-1),t={qLeft:n,qTop:o+a,qWidth:r,qHeight:1};void 0!==e&&KN(e,t)?e.qHeight+=t.qHeight:s.push(t)}return s},JN=({pageInfo:e,measureData:t,scrollDirection:n,viewService:r})=>{const{startTop:i,endTop:o,qLeft:s,qWidth:a}=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:s}=t,a=$N(n,WN),l=Math.max(i-a,0);return{startTop:l,endTop:l+Math.min(s+WN,e.rowsOnCurrentPage-l),qLeft:r,qWidth:o}})(e,r,n),l=XN({startTop:i,endTop:o,qLeft:s,qWidth:a,measureData:t,pageInfo:e});if(l.length>0){const r=n.current===oP.Backward?Math.max(0,i-25):o,c=Math.min(r+25,e.rowsOnCurrentPage),u=XN({startTop:r,endTop:c,qLeft:s,qWidth:a,measureData:t,pageInfo:e});return[...l,...u]}return l},ZN=(e,t,n,r,i,o,s,a)=>{const{gridColumnStartIndex:l,gridRowStartIndex:c,gridWidth:u,gridHeight:d}=i;let h=[],p=[];o.current!==oP.None&&(h=JN({pageInfo:r,measureData:n,scrollDirection:o,viewService:i})),s.current!==oP.None&&(p=UN({pageInfo:r,measureData:n,scrollDirection:s,layoutService:t,viewService:i})),o.current===oP.None&&s.current===oP.None&&(h=XN({measureData:n,pageInfo:r,qLeft:l,qWidth:u,startTop:c,endTop:c+d}));const f=e.fetchPages([...h,...p]);a.isDownloadedAsPDForImage&&a.waitForPromise(f)},QN=function(e,t=50){let n,r,i,o=0;return function(...s){n=this,r=s;const a=Date.now()-o,l=()=>{o=Date.now(),i=0,e.apply(n,r)};i||(a>=t?l():i=setTimeout(l,t-a))}}(ZN,100),ej=yD(ZN,75),tj=e=>"number"==typeof e&&!Number.isNaN(+e),nj=e=>tj(e.qNum),rj=(e,t,n=!1)=>void 0!==e&&(e.isLeafNode||n&&e.isLeftColumn?e.mainAxisPageCoord===t:e.mainAxisPageCoord+e.leafCount-1===t),ij=()=>{const{env:e}=JT(),t=e.flags.isEnabled("VNA-639-KEYBOARD_NAV_VIRTUALIZED_PIVOT_TABLE"),n=Ap(HT);return{handleClick:(e,r,i)=>{t&&n({section:e,rowIdx:r,colIdx:i})}}},oj=({style:e,index:t,isLastRow:n,isLastColumn:r,showLastBorder:i,isLeftColumn:o,showTotalCellDivider:s})=>{const{direction:a}=YT(),{styleService:{grid:{border:l,divider:c}}}=eO();return co.jsx("div",{style:{...e,...LP,...NP(n,r,l,a,i),...zP({bottomDivider:s&&o,rightDivider:s&&!o,borderColor:c})},"data-testid":"empty-cell","data-index":t})},sj=({children:e,verticalAlign:t,width:n,right:r,isLeftColumn:i})=>{const{layoutService:{isIndentModeEnabled:o}}=eO(),s=i&&o;return co.jsx("div",{"data-key":"sticky-cell-container",style:{display:"flex",flexDirection:"row",width:n,maxWidth:"100%",maxHeight:"100%",position:"sticky",left:4,top:0,bottom:0,right:r,...!s&&{alignItems:t,alignSelf:t,overflow:"hidden"}},children:e})},aj=e=>{const{type:t,imageSize:n}=e;return t!==KA.Image||"fill"!==n&&"fitWidth"!==n?"fit-content":"100%"},lj=v((e,t)=>co.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:co.jsx("path",{d:"M7.5 8.5H2v-1h5.5V2h1v5.5H14v1H8.5V14h-1z"})})),cj=v((e,t)=>co.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:co.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"})})),uj=v((e,t)=>co.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:[co.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"}),co.jsx("use",{fillRule:"evenodd"})]})),dj=v((e,t)=>co.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:co.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"})})),hj=v((e,t)=>co.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:co.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"})})),pj=v((e,t)=>co.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:co.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"})})),fj=v((e,t)=>co.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:co.jsx("path",{d:"M2 7.5h12v1H2z"})})),mj=v((e,t)=>co.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:co.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"})})),gj=v((e,t)=>co.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:co.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"})})),yj=v((e,t)=>co.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:co.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"})})),vj=v((e,t)=>co.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:co.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"})})),bj=v((e,t)=>co.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:co.jsx("path",{d:"m6 10 7-7 2 2-7 7-2 2-5-5 2-2z"})})),xj=v((e,t)=>co.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:co.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"})})),wj=v((e,t)=>co.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:co.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"})})),Sj=v((e,t)=>co.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:co.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"})})),Cj={m:bj,"ï":yj,R:v((e,t)=>co.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:co.jsx("path",{d:"M13.6 11H2.4a.2.2 0 0 1-.16-.32l5.6-7.467a.2.2 0 0 1 .32 0l5.6 7.467a.2.2 0 0 1-.16.32"})})),S:xj,T:wj,U:Sj,P:gj,Q:pj,"è":v((e,t)=>co.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:co.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"})})),"¢":dj,"©":uj,"23F4":hj,2013:vj,"&":mj,add:lj,"minus-2":fj,dot:cj},Ej=({size:e,iconKey:t,color:n,pvStyle:r})=>{const i=t&&Cj[t];return i&&co.jsx("div",{"data-testid":"representation-indicator-icon",style:{color:n,height:e,...r},children:co.jsx(i,{style:{height:e}})})},Mj=(e,t)=>e.max===e.min?.5:(t-e.min)/(e.max-e.min),kj=(e,t,n)=>{const r=e.paletteColors?e.paletteColors[t]:e.localPaletteColors[t];return n.getColorPickerColor(r)},Ij=(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 s=((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),a=((e,t,n,r,i)=>{const{upperLimit:o,lowerLimit:s}=e,{previousColor:a,nextColor:l}=t,c=r===o.value?1:(r-s.value)/(o.value-s.value);return s.gradient&&o.gradient?r-s.value<o.value-r?{color:a.color,t:.5-c}:{color:l.color,t:c-.5}:s.gradient?{color:a.color,t:1-(.5+c/2)}:o.gradient?{color:l.color,t:c/2}:{color:i.localPaletteColors[n].color,t:r}})(s,r,t,n,e);return o_(e.localPaletteColors[t].color??"").blend(o_(a.color??""),a.t)},Rj=(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:Mj(t,e.value)}))),e})({...e},t),i=r.paletteColors||r.localPaletteColors;return i&&(r.localPaletteColors=i.concat().map((e,t)=>({color:kj(r,t,n)}))),r},_j=(e,t,n,r)=>{const i=Rj(e,n,r),{localPaletteColors:o}=i;if(t<=0)return o[0].color;if(t>=1)return o[o.length-1].color;const s=((e,t)=>{let n="",r=0;const{limits:i,localPaletteColors:o}=e;for(let s=0;s<o.length;s++){const o=i&&i[s]?i[s].value:1;if(t>=r&&t<o){n=Ij(e,s,t);break}r=o}return n})(i,t);return s},Dj=(e,t)=>{const n=(e=>e.map(e=>e.value??e).sort((e,t)=>e-t))(e),r=n.some(e=>!tj(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||!tj(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)},Aj=(e,t)=>{const{limits:n}=e.segments;if(!n)return;const r=((e,t)=>{const{min:n,max:r}=Dj(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||!tj(t))return 0;let s=n&&tj(n)?Math.min(n,t):0;const a=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<a[e].value&&t>=s)return e;s=a[e].value}return 0})(e,t,r.min);return{limitRange:r,limitPaletteColorIndex:i}},Pj=e=>"flex-start"===e?"flex-end":"flex-start",Lj=(e,t,n,r)=>{const i=e.indicatorConditionalColoring;if(!i)return;const o=Aj(i,t),s=((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 kj(i,n.limitPaletteColorIndex,r);const s=Mj(n.limitRange,t);return _j(i,s,n.limitRange,r)})(i,t,o,r),{paletteColors:a}=i.segments,l=o?.limitPaletteColorIndex||0,c=a[l]?.icon??"dot",{indicator:u}=e;let d=u?.position||"right";return"rtl"===n&&(d="right"===d?"left":"right"),{color:s,iconKey:c,position:d}},Tj=({representation:e,cellValue:t,textStyle:n})=>{const{styleService:r}=eO(),{theme:i}=JT(),{direction:o}=YT(),{text:s,indicator:a}=e,{showTextValues:l,applySegmentColors:c}=a??{},u=Lj(e,t,o,i),{fontSize:d,fontFamily:h,fontStyle:p,fontWeight:f,textDecoration:m}=r.measureValues,g={fontSize:d,fontFamily:h,fontStyle:p,fontWeight:f,textDecoration:m},y=parseInt(d||pP,10),{iconKey:v,color:b,position:x}=u||{},w={display:"flex",paddingTop:2};return l?co.jsxs("div",{"data-key":"representation-indicator",style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"4px",overflow:n?.overflow,color:c?b:n?.color},children:["left"===x&&Ej({size:y,iconKey:v,color:b,pvStyle:w}),co.jsx("span",{style:{paddingTop:4,overflow:n?.overflow,textOverflow:n?.textOverflow,whiteSpace:"nowrap",direction:n?.direction,...g},children:s}),"right"===x&&Ej({size:y,iconKey:v,color:b,pvStyle:w})]}):(w.paddingTop=5,Ej({size:y,iconKey:v,color:b,pvStyle:w}))},Oj=e=>!!e.target?.getAttribute("class")?.includes(eR),qj=(e,t)=>{switch(t.type){case"clearSelections":return{engineSelectedCells:null,activeSelection:null,selectedField:null};case"mouseup":return{...e,activeSelection:null,engineSelectedCells:t.payload.engineSelectedCells};case"mousedown":return{...e,activeSelection:t.payload.activeSelection,selectedField:t.payload.selectedField};case"mouseover":{if(!e.activeSelection)return e;const{index:n}=t.payload,r=Math.min(n,e.activeSelection.startIndex),i=Math.max(n,e.activeSelection.endIndex);if(r===e.activeSelection.startIndex&&i===e.activeSelection.endIndex)return e;const o={...e.activeSelection,startIndex:r,endIndex:i};return o.clientSelectedCells=(e=>{const{getCellFromIndex:t,startIndex:n,endIndex:r,clientSelectedCells:i}=e,o=new Map(i);for(let e=n;e<=r;e++){const n=t(e);"N"===n?.ref.qType&&o.set(n.ref.qElemNo,n)}return o})(o),{...e,activeSelection:o}}default:return e}},Nj=e=>null!==e.target?.closest("[data-prevent-selection]"),jj=e=>"A"===e.target?.tagName,zj=({startIndex:e,getCellFromIndex:t,cell:n})=>({type:"mousedown",payload:{activeSelection:{startIndex:e,endIndex:e,getCellFromIndex:t,clientSelectedCells:(new Map).set(n.ref.qElemNo,n)},selectedField:{selectionCellType:n.selectionCellType,index:"L"===n.selectionCellType?n.x:n.y}}});const Fj=a({createMouseDownHandler:()=>()=>{},createMouseOverHandler:()=>()=>{},createPointerUpHandler:()=>()=>{},isSelected:()=>!1,isActive:!1,isLocked:()=>!1}),Wj=()=>h(Fj),$j=({children:e,selections:t})=>{const n=function(e){const{updatePageInfo:t}=YT(),n=Dp(Df),r=e.isActive(),[i,o]=l(qj,{engineSelectedCells:null,selectedField:null,activeSelection:null});c(()=>{const n=()=>{o({type:"clearSelections"})},r=()=>{n(),t({page:0})};return e.on("deactivated",n),e.on("canceled",n),e.on("confirmed",r),e.on("cleared",n),()=>{e.removeListener("deactivated",n),e.removeListener("canceled",n),e.removeListener("confirmed",r),e.removeListener("cleared",n)}},[e,t]);const s=d(async()=>{if(!i.activeSelection)return;var t,r;1===i.activeSelection.clientSelectedCells.size&&(t=i.engineSelectedCells,(r=i.activeSelection).clientSelectedCells.forEach((e,n)=>{t?.has(n)&&(r.clientSelectedCells.delete(n),t.delete(n))}));const s=new Map([...i.engineSelectedCells??new Map,...i.activeSelection.clientSelectedCells]);try{o({type:"mouseup",payload:{engineSelectedCells:s}}),await e.select({method:"selectPivotCells",params:[nO,Array.from(s,([,e])=>({qType:e.selectionCellType,qRow:e.y,qCol:e.x}))]})}catch(e){n.error({msg:"Failed to select pivot cells",payload:e}),o({type:"mouseup",payload:{engineSelectedCells:i.engineSelectedCells}})}},[i,e,n]);c(()=>{if(i.activeSelection)return document.addEventListener("mouseup",s),()=>{document.removeEventListener("mouseup",s)}},[s,i.activeSelection]);const a=d((e,t)=>n=>{const r=t(e);Oj(n)||Nj(n)||jj(n)||!(e=>1===e.buttons)(n)||!r||o(zj({startIndex:e,getCellFromIndex:t,cell:r}))},[]),u=d(t=>async()=>{i.activeSelection&&(e.isActive()||await e.begin([nO]),o({type:"mouseover",payload:{index:t}}))},[i.activeSelection,e]),h=d((e,t)=>n=>{if("touch"!==n.pointerType)return;const r=t(e);Oj(n)||Nj(n)||jj(n)||!r||(o(zj({startIndex:e,getCellFromIndex:t,cell:r})),s())},[s]),p=d(e=>!(!i.engineSelectedCells?.size&&!i.activeSelection?.clientSelectedCells.size||!i.selectedField||e.selectionCellType===i.selectedField.selectionCellType&&("L"===e.selectionCellType?i.selectedField.index===e.x:i.selectedField.index===e.y)),[i.activeSelection?.clientSelectedCells.size,i.engineSelectedCells?.size,i.selectedField]),f=d(e=>!p(e)&&(i.engineSelectedCells?.has(e.ref.qElemNo)||!!i.activeSelection?.clientSelectedCells.has(e.ref.qElemNo)),[p,i.activeSelection?.clientSelectedCells,i.engineSelectedCells]);return m(()=>({isSelected:f,isActive:r,isLocked:p,createMouseDownHandler:a,createMouseOverHandler:u,createPointerUpHandler:h}),[f,r,p,a,u,h])}(t);return co.jsx(Fj.Provider,{value:n,children:e})},Bj=e=>"fill"===e.representation.imageSize,Vj=(e,t)=>{let n=e.isLeftColumn?"flex-start":"center";return e.isLeftColumn&&Bj(e)&&t&&(n="center"),e.representation.type!==KA.Image||Bj(e)?n:e.representation.resolvedImagePosition?.vertical};var Hj=function(e){return e.Background="background",e.Color="color",e.FontWeight="fontWeight",e.FontStyle="fontStyle",e.TextDecoration="textDecoration",e}(Hj||{});const Gj={brighter:.5,darker:.3,opacity:.03},Uj=(e,{cell:t,styleService:n})=>{if(e===Hj.Background||e===Hj.Color){const n=t.expressionColor[e];if(n)return n}return t.isNull?n.dimensionNull[e]:t.isPseudoDimension?e===Hj.Background&&t.headerColor?.background?t.headerColor.background:e===Hj.Color&&t.headerColor?.color?t.headerColor.color:n.measureLabels[e]:t.isTotal?n.totalValues[e]:n.dimensionValues[e]},Yj=({styleService:e,isCellSelected:t,cell:n,isCellLocked:r})=>{if(t)return e.selectedColors.background;const i=Uj(Hj.Background,{cell:n,styleService:e});return!r||!i||n.isPseudoDimension||n.isEmpty||n.isNull||n.isTotal?Uj(Hj.Background,{cell:n,styleService:e}):`repeating-linear-gradient(\n -45deg,\n ${RD(o=i,Gj)} 0px 2px,\n ${o} 0px 4px\n ) border-box`;var o},Kj=({cell:e,styleService:t,isCellSelected:n})=>n?t.selectedColors.color:Uj(Hj.Color,{cell:e,styleService:t}),Xj=({cell:e,styleService:t})=>{const{qCanCollapse:n,qCanExpand:r}=e.ref,i=Uj(Hj.FontWeight,{cell:e,styleService:t});return void 0===i&&(r||n)?mP:i},Jj=({cell:e,styleService:t})=>Uj(Hj.FontStyle,{cell:e,styleService:t}),Zj=({cell:e,styleService:t})=>Uj(Hj.TextDecoration,{cell:e,styleService:t}),Qj=e=>e?"pointer":"default",ez=({expandOrCollapse:e,cell:t})=>n=>{e?.(t.y,t.x),n.stopPropagation()},tz=(e,t)=>{if(!e.isLeftColumn||e.representation.type===KA.Image)return{padding:4};return{padding:4,marginTop:t.dimensionValueTextHeight/2-6.5-4}},nz=({cell:e,isLeftColumn:t,isCellSelected:n})=>{const{styleService:r,layoutService:i}=eO(),{interactions:o}=JT(),{isActive:s}=Wj(),{dataModel:a}=xq();if(!e.ref.qCanExpand&&!e.ref.qCanCollapse)return null;const l=!o.active||s||!a,c=Kj({cell:e,styleService:r,isCellSelected:n}),u=s?.4:1,d=e.ref.qCanExpand?ZL:JL;let h;h=e.ref.qCanExpand?t?a.expandLeft:a.expandTop:t?a.collapseLeft:a.collapseTop;const p=Dq({isLeftColumn:t,layoutService:i,representation:e.representation});return co.jsx(d,{opacity:u,color:c,"data-prevent-selection":!l||void 0,"data-testid":e.ref.qCanExpand?"expand-icon":"collapse-icon",height:13,style:{flexShrink:0,cursor:l?"default":"pointer",position:"sticky",top:0,...tz(e,r),...p&&{alignSelf:Vj(e)}},onClick:l?void 0:ez({cell:e,expandOrCollapse:h})})},rz=e=>{switch(e){case"fitHeight":case"fill":case"alwaysFit":return"100%";case"originalSize":return"fit-content";default:return"auto"}},iz=(e,t,n)=>{if("alwaysFit"===e&&t&&!n)return"fit-content";switch(e){case"fitHeight":return"auto";case"originalSize":return"fit-content";case"alwaysFit":return n?"unset":"100%";default:return"100%"}},oz=(e,t)=>{if("alwaysFit"===e)switch(t?.vertical){case"flex-start":return"center top";case"flex-end":return"center bottom";default:return"center center"}},sz=({representation:e,canExpandOrCollapse:t,leafCount:n,isLeftColumn:r,styleService:i,layoutService:o,isMeasureCell:s})=>{const{isIndentModeEnabled:a}=o,l=Dq({isLeftColumn:r,layoutService:o,representation:e}),c=t?21:0,u=e.imageBox?.width??24;let d=`calc(100% - ${c}px)`,h=i.headerCellHeight;r&&l&&(d=u),(s||r)&&(h=i.contentCellHeight);let p=h;switch(r&&void 0!==n&&!a&&(p=h*Math.max(n,1)),e.imageSize){case"originalSize":return{maxWidth:d,maxHeight:p,...l?{width:d}:{}};case"fitWidth":return{width:d,maxHeight:p};case"fitHeight":return{height:p,maxWidth:d,...l?{width:d}:{}};case"fill":return{height:p,width:d};default:return{width:d,height:h}}},az=e=>{if("alwaysFit"===e)return"contain"},lz=({suffix:e,delimeter:t})=>` ${e?t:""} ${e}`.trim(),cz=({imageSize:e,resolvedImagePosition:t,isImagesInIndentModeEnabled:n,isMeasureCell:r})=>({width:iz(e,n,r),height:rz(e),objectFit:az(e),objectPosition:oz(e,t),...n&&"alwaysFit"===e?{"max-width":"100%"}:{}}),uz=({representation:e,textStyle:t,isMeasureCell:n})=>{const{imageRef:r,onLoad:i}=(()=>{const{downloadService:e}=eO(),t=s(null),{promise:n,resolve:r}=m(()=>XP(),[]);return c(()=>(e.isDownloadedAsPDForImage&&(e.waitForPromise(n),t.current?.complete&&r()),()=>{r()}),[t,e,n,r]),{onLoad:d(()=>{r()},[r]),imageRef:t}})(),{layoutService:{isIndentModeEnabled:o}}=eO(),{url:a,text:l,imageSize:u,resolvedImagePosition:h}=e,{overflow:p,...f}=t;return co.jsx("img",{src:a,alt:l,style:{...cz({imageSize:u,resolvedImagePosition:h,isImagesInIndentModeEnabled:o,isMeasureCell:n}),...f},onLoad:i,ref:r})},dz=({representation:e,textStyle:t,canExpandOrCollapse:n,leafCount:r,isLeftColumn:i=!1,imageContainerHorizontalAlignment:o,isMeasureCell:s})=>{const{styleService:a,layoutService:l}=eO(),{resolvedImagePosition:c}=e;return co.jsx("div",{"data-key":"image-container--image",style:{display:"flex",flexDirection:"column",justifyContent:c?.vertical,alignItems:o,overflow:"hidden",boxSizing:"border-box",border:"4px solid transparent",...sz({representation:e,canExpandOrCollapse:n,leafCount:r,styleService:a,layoutService:l,isLeftColumn:i,isMeasureCell:s})},children:co.jsx(uz,{representation:e,textStyle:t,isMeasureCell:!0})})},hz=(e,t,n)=>{if(e?.auto)return t;switch(e?.align){case"center":return"center";case"left":return"rtl"===n?"flex-end":"flex-start";case"right":return"rtl"===n?"flex-start":"flex-end";default:return t}},pz=(e,t)=>{let{textAlign:n}=t.getDimensionInfo(e.dimensionInfoIndex)??{};return e.isPseudoDimension&&void 0!==e.visibleMeasureInfoIndex&&({labelTextAlign:n}=t.visibleMeasureInfo.at(e.visibleMeasureInfoIndex)??{}),n?.auto||void 0===n?"left":n.align},fz={display:"flex",flexDirection:"row",alignItems:"center"},mz={alignItems:"center",display:"flex",flexDirection:"row",backgroundClip:"padding-box"},gz=(e,t,n,r,i)=>t?{...mz,...i?e.measureValues:e.nullValues}:n?{...fz,color:e.totalValues.color,background:r??e.totalValues.background}:{...fz,color:e.measureValues.color,background:r??e.measureValues.background},yz=(e,t,n,r,i,o)=>{const{fontFamily:s,fontSize:a}=e.measureValues,l={...TP,...!n&&OP(e.grid.lineClamp),...t&&{color:t},fontFamily:s,fontSize:a,direction:n?"ltr":o};if(i){const t=n?e.measureValues:e.nullValues,{fontWeight:r,fontStyle:i,textDecoration:s}=t;return{...l,fontWeight:r,fontStyle:i,textDecoration:s,direction:n?"ltr":o}}if(r){const{fontWeight:t,fontStyle:r,textDecoration:i}=e.totalValues;return{...l,fontWeight:t,fontStyle:r,textDecoration:i,direction:n?"ltr":o}}const{fontWeight:c,fontStyle:u,textDecoration:d}=e.measureValues;return{...l,fontWeight:void 0===c?mP:c,fontStyle:u,textDecoration:d}},vz=({cell:e,representation:t,color:n,isTotalValueCell:r,cellHorizontalAlignment:i,isNumeric:o})=>{const{direction:s}=YT(),{layoutService:a,styleService:l}=eO(),{isIndentModeEnabled:c}=a,u=e.isNull?a.getNullValueText():t.text,d=t.type===KA.Image,h=t.type===KA.Indicator,p=yz(l,n,o,r,e.isNull,s);if(!c&&d&&!e.isNull||c&&d&&!e.isNull)return co.jsx(dz,{isMeasureCell:!0,textStyle:p,representation:t,imageContainerHorizontalAlignment:i});const f=(e=>"string"==typeof e&&e.length>0||"number"==typeof e?+e:NaN)(e.isNull?t.text:e.ref.qNum);return h&&tj(f)?co.jsx(Tj,{representation:t,cellValue:f,textStyle:p}):co.jsx("span",{style:{padding:4,...p},children:u})},bz=(e,t)=>e?.[t]?.visibleMeasureInfoIndex??0,xz="flex-start",wz=(e,t)=>e.isNull?xz:t.type===KA.Image&&"fill"!==t.imageSize?t.resolvedImagePosition?.vertical:xz,Sz=({columnIndex:e,rowIndex:t,style:n,data:r})=>{const{env:i}=JT(),{pageInfo:o,direction:s}=YT(),{styleService:a,layoutService:l}=eO(),{attrExprInfoIndexes:c,gridSectionsData:{measureData:u,leftDimensionData:h,topDimensionData:p},visibleDimensionsInfo:{visibleTopDimensionInfo:f}}=xq(),m=(()=>{const{layoutService:{isIndentModeEnabled:e}}=eO(),{gridSectionsData:{leftDimensionData:t,topDimensionData:n},visibleDimensionsInfo:{visibleLeftDimensionInfo:r,visibleTopDimensionInfo:i}}=xq(),o=r.length,s=i.length;return d((r,i)=>!(!n.grid.at(s-1)?.[r]?.isTotal&&!t.grid.at(e?0:o-1)?.[i]?.isTotal),[n,t,o,s,e])})(),g=(()=>{const{gridSectionsData:{topDimensionData:e},visibleDimensionsInfo:{visibleTopDimensionInfo:t}}=xq(),n=t.length;return d(t=>{const r=e.grid.at(n-1)?.[t];return rj(r,e.totalDividerIndex)},[e,n])})(),y=(()=>{const{layoutService:{isIndentModeEnabled:e}}=eO(),{gridSectionsData:{leftDimensionData:t},visibleDimensionsInfo:{visibleLeftDimensionInfo:n}}=xq(),r=n.length;return d(n=>{const i=e?0:r-1,o=t.grid.at(i)?.[n];return rj(o,t.totalDividerIndex,e)},[t,e,r])})(),{showLastBorder:v}=r,b=p.grid.at(f.length-1),x=h.grid.at(-1),{background:w}=a.measureValues,S=u[t]?.[e],C=t===o.rowsOnCurrentPage-1,E=e===l.size.x-1,{handleClick:M}=ij();if(!S)return co.jsx(oj,{style:{...n,background:w},isLastRow:C,isLastColumn:E,showLastBorder:v,index:t,isLeftColumn:!1,showTotalCellDivider:!1});const k=l.hasPseudoDimOnLeft?bz(x,t):bz(b,e),I=l.visibleMeasureInfo[k],R=ZO({cell:S.ref,representationProperties:I.representation,attrExprInfoIndex:c.measures[k],env:i,direction:s,conditionalColoring:I.conditionalColoring,enabledFeatures:{[KA.Image]:!0,[KA.Indicator]:!0}}),_=!S.isNull&&m(e,t),D=S.isNull?l.getNullValueText():R.text,A=S.isNull?""!==D&&void 0!==D&&!Number.isNaN(+D):nj(S.ref),P=QO(c.measures[k],S.ref),L=((e,t,n,r,i)=>{const{textAlign:o}=t,s=r?"flex-end":"center";return e.isNull||n.type!==KA.Image?hz(o,s,i):n.resolvedImagePosition?.horizontal??"center"})(S,I,R,A,s),T={...gz(a,S.isNull,_,P.background,A),...NP(C,E,a.grid.border,s,v),...zP({bottomDivider:y(t),rightDivider:g(e),borderColor:a.grid.divider}),...LP,padding:"0px 4px",display:"flex",justifyContent:L};return co.jsx("div",{className:ZI,title:D,style:{...T,...n},"data-testid":"measure-value","data-row-index":t,"data-col-index":e,"data-pivot-section":"DATA","data-row-idx":t,"data-col-idx":e,tabIndex:-1,onClick:()=>{M("DATA",t,e)},children:co.jsx(sj,{width:aj(R),verticalAlign:wz(S,R),children:co.jsx(vz,{cell:S,representation:R,isTotalValueCell:_,color:P.color,cellHorizontalAlignment:L,isNumeric:A})})})};var Cz=t.memo(Sz,FN);const Ez=(e,t)=>t.list[e]?.id??e.toString(),Mz=({columnIndex:e,rowIndex:t,data:n})=>n.grid[t]?.[e]?.id??`${t}-${e}`,kz=e=>({...PP,overflow:"hidden",boxSizing:"content-box",borderWidth:"rtl"===e?"1px 1px 0px 0px":"1px 0px 0px 1px"}),Iz=({dataGridRef:e,height:t,rowHightCallback:n,width:r,showLastBorder:i,getRightGridColumnWidth:o,verticalScrollDirection:s,horizontalScrollDirection:a})=>{const{pageInfo:l,direction:c}=YT(),{layoutService:u,styleService:{grid:{divider:h},contentCellHeight:p}}=eO(),{dataModel:m,gridSectionsData:{measureData:g}}=xq(),y={...kz(c),borderColor:h,willChange:"auto",userSelect:"none",WebkitUserSelect:"none"},v=(({verticalScrollDirection:e,horizontalScrollDirection:t})=>{const{pageInfo:n}=YT(),{downloadService:r,viewService:i,layoutService:o}=eO(),{dataModel:s,gridSectionsData:{leftDimensionData:a,topDimensionData:l,measureData:c}}=xq(),u=a.columnCount,h=l.rowCount;return d(({overscanColumnStartIndex:a,overscanColumnStopIndex:l,overscanRowStartIndex:d,overscanRowStopIndex:p})=>{i.gridColumnStartIndex=a,i.gridRowStartIndex=d,i.gridWidth=l-a+1,i.gridHeight=p-d+1;const f=i.gridWidth+u+(t.current===oP.None?0:WN),m=i.gridHeight+h+(e.current===oP.None?0:WN);let g=QN;m*f>1500&&(g=ej),g(s,o,c,n,i,e,t,r)},[i,o,s,c,e,t,n,u,h,r])})({verticalScrollDirection:s,horizontalScrollDirection:a});return fL(()=>{e.current&&e.current.resetAfterColumnIndex(0,!1)},[e,m,g]),f(()=>{e.current&&e.current.resetAfterIndices({columnIndex:0,rowIndex:0,shouldForceUpdate:!0})},[r,t,e,p,c]),0===u.size.x?null:co.jsx(RN,{"data-section-id":"DATA_GRID",ref:e,style:y,columnCount:u.size.x,columnWidth:o,height:t,rowCount:l.rowsOnCurrentPage,rowHeight:n,width:r,itemData:{showLastBorder:i,grid:g},onItemsRendered:v,estimatedRowHeight:n(),estimatedColumnWidth:o(),itemKey:Mz,direction:c,children:Cz})};var Rz=y(Iz);const _z=v((e,t)=>co.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:[co.jsx("path",{d:"M13 7H8zV4.982C13 2.23 10.761 0 8 0S3 2.23 3 4.982V7h.75H3h1.5V5.332C4.5 3.216 5.549 1.5 8 1.5s3.5 1.716 3.5 3.832V7h.75H3a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1H3z"}),co.jsx("use",{fillRule:"evenodd"})]})),Dz=e=>{const[t,n]=Pp(Xq);return fL(()=>{n(!1)},e),{isAdjustingWidth:t,setIsAdjustingWidth:n}},Az=()=>{const[e,t]=p(!1),{dataModel:n}=xq(),{interactions:r}=JT(),{isAdjustingWidth:i,setIsAdjustingWidth:o}=Dz([n]);return{open:e,setOpen:t,handleOpenMenu:e=>{!r.active||Oj(e)||i||t(!0)},isAdjustingWidth:i,setIsAdjustingWidth:o}};function Pz(e,t){const n=t.expressionColor?.background??e.dimensionValues.background,r=t.isLeftColumn?e.header.background:n,i=r===_P.Transparent?HR.WHITE:r,o=o_(e.grid.border),s=o_(i);return s.isInvalid()||o.isInvalid()||1===o.a?e.grid.border:function(e,t,n){return o_(e.r+(t.r-e.r)*n,e.g+(t.g-e.g)*n,e.b+(t.b-e.b)*n,e.a+(t.a-e.a)*n)}(s,o,o.a).getRGB()}const Lz=({cellInfo:e,columnWidth:t,isLastColumn:n,overrideLeftGridWidth:r,setIsAdjustingWidth:i,shouldApplyIndentModeColumnWidth:o,tableWidth:s})=>{const{direction:a}=YT(),{interactions:l,translator:c}=JT(),{isActive:u}=Wj(),{dataModel:d}=xq(),{styleService:h}=eO(),[,f]=p({});if(!(e.canBeResized&&!!l.active&&!u))return null;const m=Pz(h,e);return co.jsx(xL,{isPivot:!0,columnWidth:t,isLastColumn:n,keyValue:`adjuster-${e.dimensionInfoIndex}`,hoverColor:m,updateWidthCallback:t=>{f({}),r&&void 0!==e.colIdx&&r(t,e.colIdx)},confirmWidthCallback:t=>{o?d.applyIndentModeColumnWidth({...t,pixels:Math.min((s??0)*Rq,t.pixels??0)}):d.applyColumnWidth(t,e)},setIsAdjustingWidth:i,isLeftColumn:e.isLeftColumn,accessibilityRelatedArgs:{translator:c,columnLabel:e.label??""},direction:a})},Tz=ka(hc,{shouldForwardProp:e=>!["interactions","hoverBackground","background","shouldShowMenuIcon","isDimension"].includes(e)})(({interactions:e,background:t,hoverBackground:n,shouldShowMenuIcon:r,isDimension:i})=>({pointerEvents:i?"all":"none",position:"relative",display:"grid",gridTemplateColumns:r?"1fr 12px":"1fr",gap:8,alignItems:"center",cursor:e.active?"pointer":"default",background:t,"&&:hover":{background:e.active&&i?n:t}})),Oz=ka("div",{shouldForwardProp:e=>!["direction"].includes(e)})(({direction:e})=>({position:"absolute",left:"rtl"!==e?0:void 0,bottom:0})),qz=ka("div",{shouldForwardProp:e=>"justifyContent"!==e})(({justifyContent:e})=>({...AP,justifyContent:e??AP.justifyContent,flexDirection:"row",overflow:"hidden",position:"relative",gap:8})),Nz=ka("div")(()=>({...AP})),jz=ka("div",{shouldForwardProp:e=>!["fontSize","fontFamily","fontWeight","fontStyle","textDecoration","justifyContent"].includes(e)})(({fontSize:e,fontFamily:t,fontWeight:n,fontStyle:r,textDecoration:i,justifyContent:o})=>({display:"flex",justifyContent:o,alignSelf:"center",flexGrow:1,maxWidth:"100%",fontWeight:n,fontSize:e,fontFamily:t,fontStyle:r,textDecoration:i})),zz=ka(Id)(({theme:e})=>({".MuiList-root":{padding:e.spacing(.5,0)}})),Fz=ka(Pd,{shouldForwardProp:e=>!["isActive"].includes(e)})(({theme:e,isActive:t})=>({width:220,maxHeight:32,borderRadius:e.spacing(.5),margin:e.spacing(.25,.5),padding:e.spacing(1,1.5),display:"flex",justifyContent:"space-between",position:"relative",overflow:"hidden ",boxSizing:"border-box",background:t?"rgba(0, 0, 0, 0.05)":"transparent","&:hover":{".indent-mode-dropdown-more":{opacity:1}}})),Wz=ka("span")({textOverflow:"ellipsis",overflow:"hidden"}),$z=ka("div",{shouldForwardProp:e=>"visible"!==e})(({visible:e})=>({opacity:e?1:0,width:kq,display:"flex",justifyContent:"center",alignItems:"center",position:"relative"})),Bz=ka("span",{shouldForwardProp:e=>!["padding","alignSelf"].includes(e)})(({padding:e,alignSelf:t})=>({padding:e,alignSelf:t,position:"sticky",top:0}));let Vz=function(e){return e.Expand="Expand",e.Collapse="Collapse",e}({});const Hz=(e,t)=>({qExcludeList:t===Vz.Expand,qPos:{qDimName:e,qElemNo:[]}}),Gz=`${nO}/qExpansionState`,Uz=({model:e,qExpansionState:t,qEffectiveDimensionName:n,action:r,logToSentry:i})=>async()=>{const o=(({qEffectiveDimensionName:e,oldExpansionState:t,action:n})=>{const r=t?.findIndex(t=>t.qPos?.qDimName===e);return{expansionData:Hz(e,n),index:r}})({qEffectiveDimensionName:n,oldExpansionState:t,action:r});await(async({model:e,newExpansionState:t,errorMsg:n,logToSentry:r})=>{const{index:i,expansionData:o}=t;try{let t,n=Gz,r="Add";void 0===i?t=JSON.stringify([o]):-1===i?(n=`${Gz}/-`,t=JSON.stringify(o)):(n=`${Gz}/${i}`,r="Replace",t=JSON.stringify(o)),await e.applyPatches([{qPath:n,qOp:r,qValue:t}],!0)}catch(e){r.error({msg:n,payload:e})}})({model:e,newExpansionState:o,errorMsg:`Failed to ${r} dimension`,logToSentry:i})},Yz=({model:e,effectivePropertiesService:t,cell:n,logToSentry:r})=>{if(void 0===n.qEffectiveDimensionName)return;const i={model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n.qEffectiveDimensionName,logToSentry:r};return{expandCallback:Uz({...i,action:Vz.Expand}),collapseCallback:Uz({...i,action:Vz.Collapse}),alwaysFullyExpanded:t.qAlwaysFullyExpanded}},Kz={[sT.Sorting]:!0,[sT.Selections]:!0,[sT.Searching]:!0},Xz=({cell:e,style:t,isFirstColumn:n,isLastColumn:r,isLastRow:i,changeSortOrder:o,iconsVisibilityStatus:a,columnWidth:l,overrideLeftGridWidth:c,shouldApplyIndentModeColumnWidth:u,tableWidth:d})=>{const h=s(null),{styleService:p,layoutService:f,effectivePropertiesService:m}=eO(),{app:g,interactions:y,embed:v,translator:b,model:x}=JT(),w=Dp(Df),{fontSize:S,fontFamily:C,fontStyle:E,fontWeight:M,textDecoration:k,color:I,background:R,hoverBackground:_,activeBackground:D}=p.header,A=s(null),{shouldShowLockIcon:P,shouldShowMenuIcon:L}=a,{open:T,setOpen:O,handleOpenMenu:q,setIsAdjustingWidth:N}=Az(),{direction:j}=YT(),{handleClick:z}=ij(),F={sortFromMenu:async(t,n)=>{t.stopPropagation(),await o(e,n)}},W={embed:v,listboxRef:h,sortCriteria:f.searchSortFromDimension&&e.isDim?m.getSortCriteriaForDimension(e.dimensionInfoIndex):void 0},$={app:g,qStateName:f.layout.qStateName},{labelTextAlign:B}=f.getDimensionInfo(e.dimensionInfoIndex)??{},V=hz(B,"flex-start",j);return co.jsxs(Tz,{className:ZI,title:e.label,interactions:y,background:T?e.headerColor?.headerMenuActiveBackground??D:e.headerColor?.background??R,hoverBackground:e.headerColor?.headerMenuHoverBackground??_,shouldShowMenuIcon:L,isDimension:e.isDim,style:{...t,...LP,...jP(e,i,n,r,p.grid.border,j),color:e.headerColor?.color??I},"data-testid":"title-cell",onClick:t=>{q(t),z("HEADER",0,e.colIdx)},"data-pivot-section":"HEADER","data-col-idx":e.colIdx,"data-row-idx":0,tabIndex:-1,children:[co.jsxs(qz,{children:[P?co.jsx(Nz,{children:co.jsx(_z,{height:12})}):null,co.jsx(jz,{fontFamily:C,fontSize:S,fontStyle:E,fontWeight:M,textDecoration:k,justifyContent:V,children:co.jsx("span",{style:{...TP,...OP(p.grid.columnLineClamp)},children:e.label})})]}),e.isDim?co.jsxs(co.Fragment,{children:[co.jsx(cT,{headerData:e,translator:b,anchorRef:A,open:T,setOpen:O,interactions:y,menuAvailabilityFlags:Kz,sortRelatedArgs:F,searchRelatedArgs:W,selectionRelatedArgs:$,expandOrCollapseArgs:Yz({model:x,effectivePropertiesService:m,cell:e,logToSentry:w}),shouldShowMenuIcon:L,model:x&&"setActiveField"in x?x:void 0,direction:j,isAccessibleHeader:!0}),co.jsx(Oz,{ref:h,direction:j}),co.jsx(Oz,{ref:A,direction:j})]}):null,co.jsx(Lz,{cellInfo:{...e,isLeftColumn:!0},columnWidth:l,isLastColumn:r,overrideLeftGridWidth:c,setIsAdjustingWidth:N,shouldApplyIndentModeColumnWidth:u,tableWidth:d})]})},Jz=({rowSpan:e,columnSpan:t})=>{const{styleService:n}=eO(),{direction:r}=YT();return e>0&&t>0?co.jsx("div",{style:{...PP,gridRowStart:1,gridRowEnd:`span ${e}`,gridColumnStart:1,gridColumnEnd:`span ${t}`,borderWidth:"rtl"===r?"0px 0px 0px 1px":"0px 1px 0px 0px",borderColor:n.grid.border,background:n.grid.background},"data-testid":"empty-header-cell"}):null},Zz=v((e,t)=>co.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:co.jsx("path",{d:"m8 9 4.5-4.5L14 6l-4.5 4.5L8 12 2 6l1.5-1.5z"})})),Qz=v((e,t)=>co.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:[co.jsx("path",{d:"m8 7-4.5 4.5L2 10l6-6 6 6-1.5 1.5z"}),co.jsx("use",{fillRule:"evenodd"})]})),eF=({tableWidth:e,leftGridWidth:t,overrideLeftGridWidth:n})=>{const{direction:r}=YT(),{styleService:i}=eO(),{interactions:o,translator:s}=JT(),{isActive:a}=Wj(),{dataModel:l}=xq(),{setIsAdjustingWidth:c}=Dz([l]);if(!(!!o.active&&!a))return null;const u=Pz(i,{isLeftColumn:!0});return co.jsx(xL,{isPivot:!0,isLastColumn:!0,isLeftColumn:!0,keyValue:"adjuster-indent-row",hoverColor:u,columnWidth:t,updateWidthCallback:t=>{n(Math.min(t,e*Rq))},confirmWidthCallback:r=>{if(r.type===nR.FitToContent)return void l.applyIndentModeColumnWidth({type:nR.Auto});const i=Math.min(r.pixels??t,e*Rq);n(i),l.applyIndentModeColumnWidth({type:nR.Pixels,pixels:i})},setIsAdjustingWidth:c,accessibilityRelatedArgs:{translator:s,columnLabel:s.get("SNPivotTable.IndentMode.Rows")},direction:r})},tF=v((e,t)=>co.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:co.jsx("path",{d:"M3 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0m6 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m5 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2"})})),nF=({cell:e,changeSortOrder:t})=>{const n=s(null),r=s(null),{app:i,interactions:o,embed:a,translator:l,model:c}=JT(),u=Dp(Df),{layoutService:d,effectivePropertiesService:h}=eO(),{open:p,setOpen:f,handleOpenMenu:m}=Az();return co.jsxs(Fz,{onClick:m,isActive:p,children:[co.jsx(Wz,{children:e.label}),co.jsxs($z,{className:"indent-mode-dropdown-more",visible:p,children:[co.jsx(tF,{}),e.isDim?co.jsxs(co.Fragment,{children:[co.jsx(cT,{headerData:e,translator:l,anchorRef:n,open:p,setOpen:f,interactions:o,menuAvailabilityFlags:Kz,sortRelatedArgs:{sortFromMenu:async(n,r)=>{n.stopPropagation(),await t(e,r)}},searchRelatedArgs:{embed:a,listboxRef:r},selectionRelatedArgs:{app:i,qStateName:d.layout.qStateName},expandOrCollapseArgs:Yz({model:c,effectivePropertiesService:h,cell:e,logToSentry:u}),shouldShowMenuIcon:!1,model:c&&"setActiveField"in c?c:void 0}),co.jsx(Oz,{ref:r}),co.jsx(Oz,{ref:n})]}):null]})]})},rF=({idx:e,menu:t,menuItems:n,isOnlyOneRow:r})=>{const i=n.at(-1)?.id===iO,o=e+1<n.length&&n[e+1]?.id===iO;return!(r&&i&&o)&&(t?.id!==iO&&e<n.length-1)},iF=({menuItems:e,changeSortOrder:t,overrideLeftGridWidth:n,leftGridWidth:r,tableWidth:i})=>{const{styleService:o}=eO(),{interactions:a,translator:l}=JT(),{dataModel:c,gridSectionsData:{headersData:u}}=xq(),[d,h]=p(!1),f=s(null),{headerCellHeight:m}=o,{color:g,background:y,hoverBackground:v,activeBackground:b,fontFamily:x,fontSize:w,fontStyle:S,fontWeight:C,textDecoration:E}=o.header,{isAdjustingWidth:M}=Dz([c]),k=e=>{e.stopPropagation()},I={height:m,gridColumn:`1 / span ${u.size.x}`,gridRow:u.size.y,zIndex:u.size.x-0};return co.jsxs(Tz,{isDimension:!0,background:d?b:y,interactions:a,hoverBackground:v,style:{...I,...LP,color:g},onClick:e=>{!a.active||Oj(e)||M||h(!d)},"data-testid":"indentModeHeaderCellWrapper",children:[co.jsxs(qz,{justifyContent:"flex-start",children:[co.jsx(jz,{fontFamily:x,fontSize:w,fontStyle:S,fontWeight:C,textDecoration:E,justifyContent:"flex-start",children:co.jsx("span",{style:TP,children:l.get("SNPivotTable.IndentMode.Rows")})}),d?co.jsx(Qz,{}):co.jsx(Zz,{}),co.jsx(Oz,{ref:f})]}),co.jsx(zz,{open:d,anchorEl:f.current,disableEnforceFocus:!0,children:e.map((n,r)=>[n&&n.id!==iO&&co.jsx("li",{role:"presentation",onClick:k,onKeyDown:k,children:co.jsx(nF,{cell:n,changeSortOrder:t})}),rF({idx:r,menu:n,menuItems:e,isOnlyOneRow:1===u.size.y})&&co.jsx(ML,{"data-testid":"group-divider",variant:"middle"})])}),co.jsx(eF,{tableWidth:i,leftGridWidth:r,overrideLeftGridWidth:n})]})},oF=({layoutService:e,headersData:t,topRowIndex:n})=>e.isIndentModeEnabled&&t.size.x>1&&n+1===t.size.y,sF={display:"grid",width:"fit-content"},aF=({tableWidth:e,leftGridWidth:t,columnWidths:n,rowHight:r,changeSortOrder:i,getHeaderCellsIconsVisibilityStatus:o,height:s,overrideLeftGridWidth:a})=>{const{layoutService:l}=eO(),{gridSectionsData:{headersData:c}}=xq();return co.jsxs("div",{"data-testid":"HEADER_GRID",style:{...sF,gridTemplateColumns:n.map(e=>`${e}px`).join(" "),gridTemplateRows:c.data.map(()=>`${r}px`).join(" "),height:s},children:[c.size.y>1&&co.jsx(Jz,{columnSpan:c.size.x-1,rowSpan:c.size.y-1}),c.data.map((s,u)=>{let d=[];if(oF({layoutService:l,headersData:c,topRowIndex:u})){const n=s.at(0);return Array.isArray(n)&&d.push(co.jsx(iF,{menuItems:n,changeSortOrder:i,overrideLeftGridWidth:a,leftGridWidth:t,tableWidth:e},n.at(0)?.id)),d}return d=s.reduce((t,s,d)=>{if(s&&!Array.isArray(s)){const h=o(d,s.isLocked,s.label),p=l.isIndentModeEnabled&&1===c.size.x;t.push(co.jsx(Xz,{style:{width:n[d],height:r,gridColumn:l.isIndentModeEnabled&&c.size.x>1?2:d+1,gridRow:u+1,zIndex:c.size.x-d},isLastRow:u===c.size.y-1,isFirstColumn:0===d,isLastColumn:d===c.size.x-1,changeSortOrder:i,cell:s,iconsVisibilityStatus:h,columnWidth:n[d],overrideLeftGridWidth:a,shouldApplyIndentModeColumnWidth:p,tableWidth:e},s.id))}return t},[]),d})]})};var lF=y(aF);const cF=(e,t,n,r)=>{const{layoutService:i}=eO();f(()=>{e.current?.forEach(e=>e?.resetAfterIndex(0,!0))},[e,t,n,r,i])},uF=(e,t)=>{fL(()=>{e.current?.forEach(e=>e?.resetAfterIndex(0,!1))},[e,t])},dF=(e,t)=>{const{isLast:n,list:r,listValues:i}=t;return n?r[e]:i[e]},hF=(e,t,n,r,i)=>{if(i)return;const o=e.representation,s=Dq({isLeftColumn:n,layoutService:t,representation:o}),a=n?"flex-start":"center",l=e.representation.resolvedImagePosition?.horizontal;if(e.representation.type===KA.Image)return s&&l&&"center"!==l&&"rtl"===r?Pj(l):l??a;if(e.isPseudoDimension&&void 0!==e.visibleMeasureInfoIndex){const{labelTextAlign:n}=t.visibleMeasureInfo[e.visibleMeasureInfoIndex]??{};return hz(n,a,r)}const{textAlign:c}=t.getDimensionInfo(e.dimensionInfoIndex)??{};return hz(c,a,r)},pF=()=>{},fF=({children:e,reactWindowStyle:t,cell:n,data:r,showTotalCellDivider:i,isLastRow:o,isLastColumn:s,isLeftColumn:a,isCellSelected:l,isAdjustingWidth:c,index:u})=>{const{styleService:d,layoutService:h}=eO(),{interactions:p}=JT(),{direction:f}=YT(),{isLocked:m,createMouseDownHandler:g,createMouseOverHandler:y,createPointerUpHandler:v}=Wj(),{showLastBorder:b}=r,x=m(n)||n.isLockedByDimension,w=!(x||!p.active||!p.select||n.isEmpty||n.isNull||n.isPseudoDimension||n.isTotal||c),S=w?g(u,e=>dF(e,r)):void 0,C=w?y(u):void 0,E=w?v(u,e=>dF(e,r)):void 0,M=Dq({isLeftColumn:a,layoutService:h,representation:n.representation}),{handleClick:k}=ij();return co.jsx("div",{className:ZI,title:p.passive?n.representation.text:void 0,style:{...t,...NP(o,s,d.grid.border,f,b),...zP({bottomDivider:i&&a,rightDivider:i&&!a,borderColor:d.grid.divider}),...LP,padding:"rtl"===f?"0px 0px 0px 4px":"0px 4px",cursor:Qj(w),background:Yj({styleService:d,isCellSelected:l,cell:n,isCellLocked:x}),zIndex:a?void 0:h.size.x-n.x,justifyContent:hF(n,h,a,f,M),display:"flex",...h.isIndentModeEnabled&&a&&{["rtl"===f?"paddingRight":"paddingLeft"]:Math.max(4,24*(n.indentLevel??0))},textAlign:pz(n,h)},"aria-hidden":"true",onMouseDown:S,onMouseOver:C,onPointerUp:E,onKeyUp:pF,role:"button",tabIndex:-1,"data-testid":"dimension-cell","data-x":n.x,"data-page-x":n.pageX,"data-y":n.y,"data-page-y":n.pageY,"data-cell-type":n.ref.qType,"data-dimension-info-index":n.dimensionInfoIndex,"data-pivot-section":a?"LEFT":"TOP","data-row-idx":n.y,"data-col-idx":n.x,onClick:()=>{k(a?"LEFT":"TOP",n.y,n.x)},children:e})},mF=e=>{e.stopPropagation()},gF=({href:e,text:t,interactions:n,color:r})=>({href:e,title:t,rel:"noreferrer",target:"_blank",underline:"hover",onClick:mF,color:HR.LINK,style:{pointerEvents:n.active?"auto":"none",color:r??void 0,opacity:n.active&&n.passive||r?void 0:.4}}),yF=({href:e,text:t,interactions:n,color:r})=>co.jsx(Pu,{...gF({href:e,text:t,interactions:n,color:r}),children:t});function vF(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 bF(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 xF(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 wF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xF(Object(n),!0).forEach(function(t){bF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function SF(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,s,a=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return vF(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)?vF(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 CF=Object.prototype.hasOwnProperty,EF=Object.prototype.toString,MF=Object.defineProperty,kF=Object.getOwnPropertyDescriptor,IF=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===EF.call(e)},RF=function(e){if(!e||"[object Object]"!==EF.call(e))return!1;var t,n=CF.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&CF.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||CF.call(e,t)},_F=function(e,t){MF&&"__proto__"===t.name?MF(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},DF=function(e,t){if("__proto__"===t){if(!CF.call(e,t))return;if(kF)return kF(e,t).value}return e[t]},AF=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=DF(a,n),a!==(i=DF(t,n))&&(u&&i&&(RF(i)||(o=IF(i)))?(o?(o=!1,s=r&&IF(r)?r:[]):s=r&&RF(r)?r:{},_F(a,{name:n,newValue:e(u,s,i)})):void 0!==i&&_F(a,{name:n,newValue:i}));return a};function PF(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=i.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map(e=>e.instance).indexOf(e),a=i.wrappedFields[t].attrExps.map(e=>e.instance).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(r)&&r.some((e,t)=>e!==t)){const e=r.indexOf(s);-1!==e&&(s=e)}return s-=t.qArea.qLeft,s<0||s>=t.qArea.qWidth?-1:l>=0?e=>e[s].qAttrDims.qValues[l]:a>=0?e=>e[s].qAttrExps.qValues[a]:e=>e[s]}function LF(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 TF(e){let t=e.cache,n=e.f,r=e.mainCell,i=e.p,o=e.page,s=e.rowIdx,a=e.row,l=e.sourceKey,c=e.target,u=e.targetProp,d=e.columnOrder,h=r;if(i.field&&i.field!==n){const e=PF(i.field,o,{cache:t},d);if(-1===e)return;h=AF({qRow:s},e(a))}c[u]=LF(i,h,{key:l})}function OF(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const s=t.raw(),a=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),c=r.normalizeConfig(i[e],t),u=c.props,d=c.main,h=Object.keys(u),p=!!i[e].trackBy,f=typeof i[e].trackBy,m={},g=[],y=[];for(let t=0;t<s.qDataPages.length;t++){const o=PF(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let c=0;c<s.qDataPages[t].qMatrix.length;c++){const v=s.qDataPages[t].qArea.qTop+c,b=AF({qRow:v},o(s.qDataPages[t].qMatrix[c])),x=LF(d,b,{key:a});if(!(d.filter&&!d.filter(b))){for(let e=0;e<h.length;e++){const r=u[h[e]];let i=r.fields||[r];r.fields&&(x[h[e]]=[]);for(let o=0;o<i.length;o++)TF({cache:n,f:l,mainCell:b,p:i[o],prop:h[e],page:s.qDataPages[t],rowIdx:v,row:s.qDataPages[t].qMatrix[c],sourceKey:a,target:r.fields?x[h[e]]:x,targetProp:r.fields?o:h[e],columnOrder:s.qColumnOrder});if(r.fields){const t=x[h[e]].map(e=>e.value),n=x[h[e]].map(e=>e.label);x[h[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[h[e]].value)}}}p&&r.track({cfg:i[e],itemData:b,obj:x,target:g,tracker:m,trackType:f}),y.push(x)}}}const v=p?r.collect(g,{main:d,propsArr:h,props:u}):y;o=[...o,...v]}return o}function qF(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 NF(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=zF)):void 0===t&&(t=jF);for(var n,r,i,o,s,a=new $F(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new $F(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(WF)}function jF(e){return e.children}function zF(e){return Array.isArray(e)?e[1]:null}function FF(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function WF(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function $F(e){this.data=e,this.depth=this.height=0,this.parent=null}function BF(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}$F.prototype=NF.prototype={constructor:$F,count:function(){return this.eachAfter(qF)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;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 NF(this).eachBefore(FF)},[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 VF={depth:-1},HF={},GF={};function UF(e){return e.id}function YF(e){return e.parentId}function KF(){var e,t=UF,n=YF;function r(r){var i,o,s,a,l,c,u,d,h=Array.from(r),p=t,f=n,m=new Map;if(null!=e){const t=h.map((t,n)=>function(e){e=`${e}`;let t=e.length;JF(e,t-1)&&!JF(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,r))),n=t.map(XF),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(XF(e)),h.push(GF));p=(e,n)=>t[n],f=(e,t)=>n[t]}for(s=0,i=h.length;s<i;++s)o=h[s],c=h[s]=new $F(o),null!=(u=p(o,s,r))&&(u+="")&&(d=c.id=u,m.set(d,m.has(d)?HF:c)),null!=(u=f(o,s,r))&&(u+="")&&(c.parent=u);for(s=0;s<i;++s)if(u=(c=h[s]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===HF)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===GF&&1===a.children.length;)a=a.children[0],--i;for(let e=h.length-1;e>=0&&(c=h[e]).data===GF;--e)c.data=null}if(a.parent=VF,a.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(WF),a.parent=null,i>0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=BF(e),r):t},r.parentId=function(e){return arguments.length?(n=BF(e),r):n},r.path=function(t){return arguments.length?(e=BF(t),r):e},r}function XF(e){let t=e.length;if(t<2)return"";for(;--t>1&&!JF(e,t););return e.slice(0,t)}function JF(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function ZF(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=ZF(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]=ZF(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function QF(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,...QF(e[i].children,t-1,n)]);return r}function eW(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=>QF(e.children,r-1,n)}return!1}const tW=/^qDimensionInfo(?:\/(\d+))?/,nW=/^\/?qMeasureInfo\/(\d+)/,rW=/\/qAttrExprInfo\/(\d+)/,iW=/\/qAttrDimInfo\/(\d+)/;function oW(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function sW(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,s=-1,a=-1,l=-1,c=-1,u=-1,d=r;const h=n.qEffectiveInterColumnSortOrder,p=oW(n);return tW.test(d)&&(i=!0,o=+tW.exec(d)[1],d=r.replace(tW,"")),nW.test(d)&&("K"===n.qMode?c=+nW.exec(d)[1]:h&&-1!==h.indexOf(-1)?(c=+nW.exec(d)[1],u=0):u=+nW.exec(d)[1],d=d.replace(nW,"")),d&&(iW.exec(d)?a=+iW.exec(d)[1]:rW.exec(d)&&(s=+rW.exec(d)[1])),l=i?"S"===n.qMode?p[o]:h?h.indexOf(o):o:h&&-1!==h.indexOf(-1)?h.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function aW(e,t){let n,r,i=eW(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 lW(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 cW(e){let t=e.propsArr,n=e.props,r=e.item,i=e.itemData,o=e.ret,s=e.sourceKey;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const d=l[n];let h,p,f,m,g,y;if("primitive"===d.type?(f=d.value,y=String(d.value)):("function"==typeof d.value&&(h=e=>d.value(e,r)),"function"==typeof d.label&&(p=e=>d.label(e,r)),d.accessor?(m=d.accessor(r),Array.isArray(m)?(g=m.map(d.valueAccessor),d.attrAccessor&&(g=g.map(d.attrAccessor)),h&&(f=g.map(h),h=null),p&&(y=g.map(p),p=null),f=d.reduce?d.reduce(f):f,y=d.reduceLabel?d.reduceLabel(y,f):String(f)):(f=d.attrAccessor?d.attrAccessor(d.valueAccessor(m)):d.valueAccessor(m),y=f)):(f=i,y=i)),a.fields){const e=h?h(f):f;c.push(e),u.push(p&&null!=y?p(y):null!=y?y:String(e))}else{const n=h?h(f):f;o[t[e]]={value:n,label:p?p(y):null!=y?y:String(n)},d.field&&(o[t[e]].source={field:d.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,r):c,label:"function"==typeof a.label?a.label(u,r):u})}}const uW=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=ZF(r,e);return o&&o[0]?(t.tree=NF(o[0],n.children||(e=>e[i])),t.tree):null};const dW=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 s=n[t[e]],a=s.fields?s.fields:[s];for(let e=0;e<a.length;e++){const t=a[e];if(t.field!==o){const e=aW(i,sW(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function hW(){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(),s="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))),s={__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 a;const t=n[i[e]],o="".concat(r,"__").concat(null!==(a=t.qElemNumber)&&void 0!==a?a:t.qElemNo);s[o]||(s[o]=wF({__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]];s[r].qValues.push(t)}}const l=Object.keys(s).map(e=>s[e]),c=KF().id(e=>e.__id).parentId(e=>e.__parent)(l);return c}(t):uW(i,n,e);if(!s)return null;const a=s.height,l=[];for(let o=0;o<=a;o++){let s=null;if(o>0)if("S"===i.qMode){let e=oW(i)[o-1];s=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),s=n.fields[e]}const a=r.normalizeConfig(wF(wF({},e),{},{field:s?s.key():void 0}),t),c=a.props,u=a.main,d=Object.keys(c);l[o]={propsArr:d,props:c,main:u};const h=s?sW(s,{cube:i}):{fieldDepth:0};dW({propsArr:d,props:c,cube:i,cache:n,itemDepthObject:h,f:s})}const c=s.copy().descendants(),u=s.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],s=i.data,a=lW(r,s,{key:o});cW({propsArr:t,props:n,item:i,itemData:s,ret:a,sourceKey:o}),u[e].data=a}return s}function pW(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<i.length;s++)if(void 0!==i[s].field){const a=t.raw(),l=t.key();if(!uW(a,n,e))continue;const c="object"==typeof i[s].field?i[s].field:t.field(i[s].field),u=r.normalizeConfig(i[s],t),d=u.props,h=u.main,p=Object.keys(d),f=sW(c,{cube:a}),m=aW({fieldDepth:0},f),g=m.nodeFn,y=m.attrFn,v=m.valueFn;dW({propsArr:p,props:d,cube:a,cache:n,itemDepthObject:f,f:c});const b=!!i[s].trackBy,x=typeof i[s].trackBy,w={},S=[],C=g(n.tree),E=[];for(let e=0;e<C.length;e++){const t=C[e],n=y?y(v(t)):v(t);if(h.filter&&!h.filter(n))continue;const o=lW(h,n,{key:l});cW({propsArr:p,props:d,item:t,itemData:n,ret:o,sourceKey:l}),b&&r.track({cfg:i[s],itemData:n,obj:o,target:S,tracker:w,trackType:x}),E.push(o)}const M=b?r.collect(S,{main:h,propsArr:p,props:d}):E;o=[...o,...M]}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var fW=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e){
91
91
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
92
- e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,d,h=e.length,p=e.search(/[0-9\-\+#]/),f=p>0?e.substring(0,p):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=h-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,h):"";if(n=(t="-"===(e=e.substring(p,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0===+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(d=t[0]).length%l,h=d.length,b=0;b<h;b++)m+=d.charAt(b),!((b-y+1)%l)&&b<h-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),f+(n?"-":"")+r+x}});function mW(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const gW={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"},yW=/%\)?$/,vW=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,bW=/^\(oct\)/i,xW=/^\(dec\)/i,wW=/^\(hex\)/i,SW=/^\(bin\)/i,CW=/^\(rom\)/i,EW=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,MW=/#|0/g;function kW(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 IW(e,t,n){let r;return vW.test(t)?e=kW(e,Number(/\d{2}/.exec(t)[0]),t,n):bW.test(t)?e=kW(e,8,t,n):xW.test(t)?e=kW(e,10,t,n):wW.test(t)?e=kW(e,16,t,n):SW.test(t)?e=kW(e,2,t,n):CW.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,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<s.length;n++)if(s[n]<=i){r+=a[n],i-=s[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}function RW(e,t,n){const r=mW(e);return n?r:new RegExp(r||"",t)}function _W(e,t,n,r){let i,o,s,a,l,c,u,d,h,p=e.pattern;var f,m;r&&(e.abbreviate=!0),f=t,(m=n)&&(m=mW(m)),f&&(f=mW(f)),h=new RegExp("(?:[#0]+".concat(f,")?[#0]+(?:").concat(m,"[#0]+)?")),s=p.match(h),s=s?s[0]:"",a=s?p.substr(0,p.indexOf(s)):p,l=s?p.substring(p.indexOf(s)+s.length):"",s||(s=p?"#":"##########"),t&&t===n&&(i=s.split(n),o=i.pop(),s=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(RW(c,"g"),t)),u=n,n=".",u&&(s=s.replace(RW(u,"g"),n)),d=s.match(/#/g),d=d?d.length:0;const g=p.split(u);let y;g[1]&&(y=g[1].match(MW)),e.prefix=a||"",e.postfix=l||"",e.pattern=p,e.maxPrecision=y?y.length:2,e.percentage=yW.test(p),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(RW(t,null,!0),"|").concat(RW(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class DW{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 gW;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 DW(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],EW.test(e[0])&&(r.positive.isFunctional=!0),e[1]?EW.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?EW.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||_W(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&_W(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&_W(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,s,a,l,c,u=this._prepared,d="",h="",p=e;if(isNaN(e))return"".concat(p);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=IW(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let r,i,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(r=t[a-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(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=fW(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(a=i.length;a<n;a++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),h=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),a=0;a<t;a++)l+="#";e=fW(l,e)}e=e.replace(u.numericRegex,e=>e===s?u.groupTemp:e===o?u.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+h+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function AW(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,s=t.toKey,a=void 0===s?e=>e:s;let l,c,u=Object.create(null),d=Object.create(null),h=0,p=0;return l=o?function(){return c=a(...arguments),l.has(c)?l.get(c):l.set(c,e(...arguments))}:t=>(c=a(t),l.has(c)?l.get(c):l.set(c,e(t))),l.set=(e,t)=>(h>=r&&(delete u[d[p]],delete d[p],h--,p++),u[e]=t,d[h]=e,h++,t),l.get=e=>u[e],l.has=e=>e in u,l.clear=()=>{u=Object.create(null),d=Object.create(null),h=0,p=0},l.size=()=>h,l}function PW(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 DW(...t)}(i,e,t,n,r),s=AW(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,r){return s.clear(),o.format(t,e,n,r)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const LW="D",TW="T",OW="TS",qW="IV",NW=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],jW=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],zW=["January","February","March","April","May","June","July","August","September","October","November","December"],FW=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function WW(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function $W(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function BW(e,t){let n,r=function(e){const t=e,n=24*$W(t),r=60*$W(n),i=60*$W(r),o=1e3*$W(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,s=r.m,a=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:s,s:a,f:l,t:u}}class VW{constructor(e,t,n){const r=e||{};if(r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:NW,qDayNames:jW,qLongMonthNames:zW,qMonthNames:FW}),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={[TW]:r.qTimeFmt||"hh:mm:ss",[LW]:r.qDateFmt||"YYYY-MM-DD",[OW]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new VW(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=BW(e,t));const i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:WW("".concat(t.year).slice(-2),2),YYY:WW("".concat(t.year).slice(-3),3),def:e=>WW("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:WW("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:WW("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>WW("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>WW("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>WW("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>WW("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const s=new RegExp(o.join("|"),"g"),a=t.replace(s,e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r});return a}}function HW(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new VW(...t)}function GW(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=HW(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=AW(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==qW?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=HW(i,e,t),r=AW(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 UW(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.meta,r=t.id,i=t.key,o=t.localeInfo,s=t.fieldExtractor,a=t.value,l=t.type,c=t.sourceField;const u=a||("dimension"===l?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),d="dimension"===l?"first":"avg",h=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return GW(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",s=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(i,"##"),o="U"),PW(n,r,i,o,t)}(n,o),p="dimension"===l?"first":(e,t)=>h(t),f={id:()=>r,key:()=>i,raw:()=>n,title:()=>n.qFallbackTitle||n.label,type:()=>l,origin:()=>c,items:()=>(e||(e=s(f)),e),min:()=>n.qMin,max:()=>n.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:d,reduceLabel:p,formatter:()=>h,tags:()=>n.qTags};return f}function YW(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const s="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),a={instance:UW(AF({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},i))};return a.attrDims=YW("qAttrDimInfo",t,n,s,AF({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=YW("qAttrExprInfo",t,n,s,AF({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=YW("qMeasureInfo",t,n,s,AF({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a})}function KW(){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:[]},s=n;if(!s)throw new Error('Missing "data" input');if(!s.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const a=KW.util,l={cache:o,cube:s,localeInfo:i.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:i.virtualFields},c={key:()=>t,raw:()=>s,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,a),hierarchy:e=>l.hierarchy(e,c,o,a),_cache:()=>o};"K"===s.qMode||"T"===s.qMode||!s.qMode&&s.qNodesOnDim?(l.extractor=pW,l.hierarchy=hW,l.pages="K"===s.qMode?s.qStackedDataPages:s.qTreeDataPages):"S"===s.qMode?(l.extractor=OF,l.pages=s.qDataPages,l.hierarchy=hW):l.extractor=()=>[],l.fieldExtractor=e=>l.extractor({field:e},c,o,a);const u="S"===s.qMode?e=>e.qElemNumber:void 0,d="S"===s.qMode?e=>e.qNum:void 0;o.wrappedFields.push(...YW("qDimensionInfo",s,t,"",AF({},l,{value:u,type:"dimension"}))),o.wrappedFields.push(...YW("qMeasureInfo",s,t,"",AF({},l,{value:d,type:"measure"}))),o.fields=o.wrappedFields.map(e=>e.instance);const h=e=>{e.forEach(e=>{o.allFields.push(e.instance),h(e.measures),h(e.attrDims),h(e.attrExps)})};return h(o.wrappedFields),(i.virtualFields||[]).forEach(e=>{const n=c.field(e.from),r=UW(wF({meta:n.raw(),id:"".concat(t,"/").concat(e.key),sourceField:n,fieldExtractor:e=>l.extractor({field:e},c,o,a),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 XW=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],JW=/\/qDimensionInfo(?:\/(\d+))?/,ZW=/\/qMeasureInfo\/(\d+)/,QW=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,e$=/\/qAttrExprInfo\/(\d+)/,t$=/\/?qHyperCube/,n$=/\/?qTreeData/,r$=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),i$=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function o$(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],s={},a=e.isActive();let l=!1;if(e.brushes().forEach(e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",s=e=>e;t$.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=r$):n$.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=i$);let a=!0;if(JW.test(e)&&(r=+JW.exec(e)[1]),ZW.test(e)&&(i=+ZW.exec(e)[1]),QW.test(e)){i=-1,r=0;const e=+QW.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),a=!1}if(e$.test(e)){const e=i;if(t){i=0;const s=ZF(o,t);i+=(s.qMeasureInfo||[]).length,r>-1?(i=s.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=s.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=s.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+e$.exec(n)[1]}else r>-1?(r=-1,i=+e$.exec(n)[1]):i+=+e$.exec(n)[1]+1}return XW.forEach(e=>{let t=SF(e,2),r=t[0],i=t[1];n=n.replace(r,i)}),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach(e=>s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach(e=>s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach(e=>s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,a=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));(0===o||a>=o)&&o>-1?n.forEach(e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})}):n.forEach(e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})}),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map(e=>+e).filter(e=>!isNaN(e)),l=!!s.selectHyperCubeCells.values.length);else{const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}}),!l&&a)return[{method:"resetMadeSelections",params:[]}];var c;s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]});return s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o}function s$(e){KW.util=e.data("matrix").util,e.data("q",KW),e.formatter("q-number",PW),e.formatter("q-time",GW)}s$.qBrushHelper=o$,s$.selections=o$;var a$=Object.prototype.hasOwnProperty,l$=Object.prototype.toString,c$=Object.defineProperty,u$=Object.getOwnPropertyDescriptor,d$=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===l$.call(e)},h$=function(e){if(!e||"[object Object]"!==l$.call(e))return!1;var t,n=a$.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&a$.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||a$.call(e,t)},p$=function(e,t){c$&&"__proto__"===t.name?c$(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},f$=function(e,t){if("__proto__"===t){if(!a$.call(e,t))return;if(u$)return u$(e,t).value}return e[t]},m$=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=f$(a,n),a!==(i=f$(t,n))&&(u&&i&&(h$(i)||(o=d$(i)))?(o?(o=!1,s=r&&d$(r)?r:[]):s=r&&h$(r)?r:{},p$(a,{name:n,newValue:e(u,s,i)})):void 0!==i&&p$(a,{name:n,newValue:i}));return a},g$="2.11.7";function y$(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 v$(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 b$(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 x$(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b$(Object(n),!0).forEach(function(t){v$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function w$(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,s,a=[],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)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return y$(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)?y$(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 S$(e){return!!e.changedTouches}function C$(e){return"number"==typeof e&&!isNaN(e)}function E$(e){return"number"!=typeof e||isNaN(e)}function M$(e){const t=e.length;let n=NaN,r=NaN,i=NaN,o=NaN;for(let s=0;s<t;s++)n=isNaN(n)?e[s].x:Math.min(n,e[s].x),r=isNaN(r)?e[s].x:Math.max(r,e[s].x),i=isNaN(i)?e[s].y:Math.min(i,e[s].y),o=isNaN(o)?e[s].y:Math.max(o,e[s].y);return[n,i,r,o]}function k$(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function I$(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 R$(e){const t=w$(M$(e),4),n=t[0],r=t[1];return{x:n,y:r,width:t[2]-n,height:t[3]-r}}function _$(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function D$(e){const t=e||{},n=t.x,r=t.y,i=t.width,o=t.height,s=t.x1,a=t.x2,l=t.y1,c=t.y2,u=t.cx,d=t.cy,h=t.r,p=t.vertices;return C$(u)&&C$(d)&&C$(h)?"circle":C$(s)&&C$(a)&&C$(l)&&C$(c)?"line":C$(n)&&C$(r)&&C$(i)&&C$(o)?"rect":C$(n)&&C$(r)?"point":Array.isArray(p)?p.every(e=>Array.isArray(e))?"geopolygon":"polygon":null}function A$(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}function P$(e){return function(){return e}}const L$=Math.abs,T$=Math.atan2,O$=Math.cos,q$=Math.max,N$=Math.min,j$=Math.sin,z$=Math.sqrt,F$=1e-12,W$=Math.PI,$$=W$/2,B$=2*W$;function V$(e){return e>=1?$$:e<=-1?-$$:Math.asin(e)}const H$=Math.PI,G$=2*H$,U$=1e-6,Y$=G$-U$;function K$(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class X${constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?K$:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return K$;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,s=this._y1,a=n-e,l=r-t,c=o-e,u=s-t,d=c*c+u*u;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(d>U$)if(Math.abs(u*a-l*c)>U$&&i){let h=n-o,p=r-s,f=a*a+l*l,m=h*h+p*p,g=Math.sqrt(f),y=Math.sqrt(d),v=i*Math.tan((H$-Math.acos((f+d-m)/(2*g*y)))/2),b=v/y,x=v/g;Math.abs(b-1)>U$&&this._append`L${e+b*c},${t+b*u}`,this._append`A${i},${i},0,0,${+(u*h>c*p)},${this._x1=e+x*a},${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 s=n*Math.cos(r),a=n*Math.sin(r),l=e+s,c=t+a,u=1^o,d=o?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>U$||Math.abs(this._y1-c)>U$)&&this._append`L${l},${c}`,n&&(d<0&&(d=d%G$+G$),d>Y$?this._append`A${n},${n},0,1,${u},${e-s},${t-a}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:d>U$&&this._append`A${n},${n},0,${+(d>=H$)},${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 J$(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 X$(t)}function Z$(e){return e.innerRadius}function Q$(e){return e.outerRadius}function eB(e){return e.startAngle}function tB(e){return e.endAngle}function nB(e){return e&&e.padAngle}function rB(e,t,n,r,i,o,s){var a=e-n,l=t-r,c=(s?o:-o)/z$(a*a+l*l),u=c*l,d=-c*a,h=e+u,p=t+d,f=n+u,m=r+d,g=(h+f)/2,y=(p+m)/2,v=f-h,b=m-p,x=v*v+b*b,w=i-o,S=h*m-f*p,C=(b<0?-1:1)*z$(q$(0,w*w*x-S*S)),E=(S*b-v*C)/x,M=(-S*v-b*C)/x,k=(S*b+v*C)/x,I=(-S*v+b*C)/x,R=E-g,_=M-y,D=k-g,A=I-y;return R*R+_*_>D*D+A*A&&(E=k,M=I),{cx:E,cy:M,x01:-u,y01:-d,x11:E*(i/w-1),y11:M*(i/w-1)}}function iB(){var e=Z$,t=Q$,n=P$(0),r=null,i=eB,o=tB,s=nB,a=null,l=J$(c);function c(){var c,u,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=i.apply(this,arguments)-$$,f=o.apply(this,arguments)-$$,m=L$(f-p),g=f>p;if(a||(a=c=l()),h<d&&(u=h,h=d,d=u),h>F$)if(m>B$-F$)a.moveTo(h*O$(p),h*j$(p)),a.arc(0,0,h,p,f,!g),d>F$&&(a.moveTo(d*O$(f),d*j$(f)),a.arc(0,0,d,f,p,g));else{var y,v,b=p,x=f,w=p,S=f,C=m,E=m,M=s.apply(this,arguments)/2,k=M>F$&&(r?+r.apply(this,arguments):z$(d*d+h*h)),I=N$(L$(h-d)/2,+n.apply(this,arguments)),R=I,_=I;if(k>F$){var D=V$(k/d*j$(M)),A=V$(k/h*j$(M));(C-=2*D)>F$?(w+=D*=g?1:-1,S-=D):(C=0,w=S=(p+f)/2),(E-=2*A)>F$?(b+=A*=g?1:-1,x-=A):(E=0,b=x=(p+f)/2)}var P=h*O$(b),L=h*j$(b),T=d*O$(S),O=d*j$(S);if(I>F$){var q,N=h*O$(x),j=h*j$(x),z=d*O$(w),F=d*j$(w);if(m<W$)if(q=function(e,t,n,r,i,o,s,a){var l=n-e,c=r-t,u=s-i,d=a-o,h=d*l-u*c;if(!(h*h<F$))return[e+(h=(u*(t-o)-d*(e-i))/h)*l,t+h*c]}(P,L,z,F,N,j,T,O)){var W=P-q[0],$=L-q[1],B=N-q[0],V=j-q[1],H=1/j$(function(e){return e>1?0:e<-1?W$:Math.acos(e)}((W*B+$*V)/(z$(W*W+$*$)*z$(B*B+V*V)))/2),G=z$(q[0]*q[0]+q[1]*q[1]);R=N$(I,(d-G)/(H-1)),_=N$(I,(h-G)/(H+1))}else R=_=0}E>F$?_>F$?(y=rB(z,F,P,L,h,_,g),v=rB(N,j,T,O,h,_,g),a.moveTo(y.cx+y.x01,y.cy+y.y01),_<I?a.arc(y.cx,y.cy,_,T$(y.y01,y.x01),T$(v.y01,v.x01),!g):(a.arc(y.cx,y.cy,_,T$(y.y01,y.x01),T$(y.y11,y.x11),!g),a.arc(0,0,h,T$(y.cy+y.y11,y.cx+y.x11),T$(v.cy+v.y11,v.cx+v.x11),!g),a.arc(v.cx,v.cy,_,T$(v.y11,v.x11),T$(v.y01,v.x01),!g))):(a.moveTo(P,L),a.arc(0,0,h,b,x,!g)):a.moveTo(P,L),d>F$&&C>F$?R>F$?(y=rB(T,O,N,j,d,-R,g),v=rB(P,L,z,F,d,-R,g),a.lineTo(y.cx+y.x01,y.cy+y.y01),R<I?a.arc(y.cx,y.cy,R,T$(y.y01,y.x01),T$(v.y01,v.x01),!g):(a.arc(y.cx,y.cy,R,T$(y.y01,y.x01),T$(y.y11,y.x11),!g),a.arc(0,0,d,T$(y.cy+y.y11,y.cx+y.x11),T$(v.cy+v.y11,v.cx+v.x11),g),a.arc(v.cx,v.cy,R,T$(v.y11,v.x11),T$(v.y01,v.x01),!g))):a.arc(0,0,d,S,w,g):a.lineTo(T,O)}else a.moveTo(0,0);if(a.closePath(),c)return a=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-W$/2;return[O$(r)*n,j$(r)*n]},c.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:P$(+t),c):e},c.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:P$(+e),c):t},c.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:P$(+e),c):n},c.padRadius=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:P$(+e),c):r},c.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:P$(+e),c):i},c.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:P$(+e),c):o},c.padAngle=function(e){return arguments.length?(s="function"==typeof e?e:P$(+e),c):s},c.context=function(e){return arguments.length?(a=null==e?null:e,c):a},c}function oB(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function sB(e){this._context=e}function aB(e){return new sB(e)}function lB(e){return e[0]}function cB(e){return e[1]}function uB(e,t,n){var r=null,i=P$(!0),o=null,s=aB,a=null,l=J$(c);function c(c){var u,d,h,p,f,m=(c=oB(c)).length,g=!1,y=new Array(m),v=new Array(m);for(null==o&&(a=s(f=l())),u=0;u<=m;++u){if(!(u<m&&i(p=c[u],u,c))===g)if(g=!g)d=u,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),h=u-1;h>=d;--h)a.point(y[h],v[h]);a.lineEnd(),a.areaEnd()}g&&(y[u]=+e(p,u,c),v[u]=+t(p,u,c),a.point(r?+r(p,u,c):y[u],n?+n(p,u,c):v[u]))}if(f)return a=null,f+""||null}function u(){return function(e,t){var n=P$(!0),r=null,i=aB,o=null,s=J$(a);function a(a){var l,c,u,d=(a=oB(a)).length,h=!1;for(null==r&&(o=i(u=s())),l=0;l<=d;++l)!(l<d&&n(c=a[l],l,a))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+e(c,l,a),+t(c,l,a));if(u)return o=null,u+""||null}return e="function"==typeof e?e:void 0===e?lB:P$(e),t="function"==typeof t?t:void 0===t?cB:P$(t),a.x=function(t){return arguments.length?(e="function"==typeof t?t:P$(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:P$(+e),a):t},a.defined=function(e){return arguments.length?(n="function"==typeof e?e:P$(!!e),a):n},a.curve=function(e){return arguments.length?(i=e,null!=r&&(o=i(r)),a):i},a.context=function(e){return arguments.length?(null==e?r=o=null:o=i(r=e),a):r},a}().defined(i).curve(s).context(o)}return e="function"==typeof e?e:void 0===e?lB:P$(+e),t="function"==typeof t?t:P$(void 0===t?0:+t),n="function"==typeof n?n:void 0===n?cB:P$(+n),c.x=function(t){return arguments.length?(e="function"==typeof t?t:P$(+t),r=null,c):e},c.x0=function(t){return arguments.length?(e="function"==typeof t?t:P$(+t),c):e},c.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:P$(+e),c):r},c.y=function(e){return arguments.length?(t="function"==typeof e?e:P$(+e),n=null,c):t},c.y0=function(e){return arguments.length?(t="function"==typeof e?e:P$(+e),c):t},c.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:P$(+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:P$(!!e),c):i},c.curve=function(e){return arguments.length?(s=e,null!=o&&(a=s(o)),c):s},c.context=function(e){return arguments.length?(null==e?o=a=null:a=s(o=e),c):o},c}function dB(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function hB(e){return e}function pB(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 fB(e){this._context=e}function mB(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 gB(e,t){this._context=e,this._k=(1-t)/6}sB.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)}}},fB.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:pB(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:pB(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},gB.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:mB(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:mB(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 yB=function e(t){function n(e){return new gB(e,t)}return n.tension=function(t){return e(+t)},n}(0);function vB(e,t){this._context=e,this._alpha=t}vB.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,s=e._y2;if(e._l01_a>F$){var a=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*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>F$){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,s=(s*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,o,s,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 bB=function e(t){function n(e){return t?new vB(e,t):new gB(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function xB(e){return e<0?-1:1}function wB(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),a=(o*i+s*r)/(r+i);return(xB(o)+xB(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function SB(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function CB(e,t,n){var r=e._x0,i=e._y0,o=e._x1,s=e._y1,a=(o-r)/3;e._context.bezierCurveTo(r+a,i+a*t,o-a,s-a*n,o,s)}function EB(e){this._context=e}function MB(e){this._context=new kB(e)}function kB(e){this._context=e}function IB(e){this._context=e}function RB(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),s=new Array(r);for(i[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,o[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/o[t-1],o[t]-=n,s[t]-=n*s[t-1];for(i[r-1]=s[r-1]/o[r-1],t=r-2;t>=0;--t)i[t]=(s[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 _B(e,t){this._context=e,this._t=t}function DB(e,t){if((i=e.length)>1)for(var n,r,i,o=1,s=e[t[0]],a=s.length;o<i;++o)for(r=s,s=e[t[o]],n=0;n<a;++n)s[n][1]+=s[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function AB(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function PB(e,t){return e[t]}function LB(e){const t=[];return t.key=e,t}function TB(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 OB(e){for(var t,n=0,r=-1,i=e.length;++r<i;)(t=+e[r][1])&&(n+=t);return n}function qB(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 s(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 a(e){return i[e]||o.get(e)}function l(e,i){if(void 0!==i)return s(e,i);const o=a(e);return r&&void 0===o&&r.warn("".concat(e," does not exist in ").concat(n," registry")),o||a(t)}return t=o.default(),l.add=s,l.get=a,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=s,l}function NB(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 jB(e){return(e=NB(Math.abs(e)))?e[1]:NaN}EB.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:CB(this,this._t0,SB(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,CB(this,SB(this,n=wB(this,e,t)),n);break;default:CB(this,this._t0,n=wB(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(MB.prototype=Object.create(EB.prototype)).point=function(e,t){EB.prototype.point.call(this,t,e)},kB.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)}},IB.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=RB(e),i=RB(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[s],t[s]);(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)}},_B.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 zB,FB=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function WB(e){if(!(t=FB.exec(e)))throw new Error("invalid format: "+e);var t;return new $B({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 $B(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 BB(e,t){var n=NB(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")}WB.prototype=$B.prototype,$B.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 VB={"%":(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)=>BB(100*e,t),r:BB,s:function(e,t){var n=NB(e,t);if(!n)return zB=void 0,e.toPrecision(t);var r=n[0],i=n[1],o=i-(zB=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+NB(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function HB(e){return e}var GB,UB,YB,KB=Array.prototype.map,XB=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function JB(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?HB:(t=KB.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],s=0,a=t[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(e.substring(i-=a,i+a)),!((l+=a+1)>r));)a=t[s=(s+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",s=void 0===e.decimal?".":e.decimal+"",a=void 0===e.numerals?HB:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(KB.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=WB(e)).fill,d=e.align,h=e.sign,p=e.symbol,f=e.zero,m=e.width,g=e.comma,y=e.precision,v=e.trim,b=e.type;"n"===b?(g=!0,b="g"):VB[b]||(void 0===y&&(y=12),v=!0,b="g"),(f||"0"===n&&"="===d)&&(f=!0,n="0",d="=");var x=(t&&void 0!==t.prefix?t.prefix:"")+("$"===p?i:"#"===p&&/[boxX]/.test(b)?"0"+b.toLowerCase():""),w=("$"===p?o:/[%p]/.test(b)?l:"")+(t&&void 0!==t.suffix?t.suffix:""),S=VB[b],C=/[defgprs%]/.test(b);function E(e){var t,i,o,l=x,p=w;if("c"===b)p=S(e)+p,e="";else{var E=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:S(Math.abs(e),y),v&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),E&&0===+e&&"+"!==h&&(E=!1),l=(E?"("===h?h:c:"-"===h||"("===h?"":h)+l,p=("s"!==b||isNaN(e)||void 0===zB?"":XB[8+zB/3])+p+(E&&"("===h?")":""),C)for(t=-1,i=e.length;++t<i;)if(48>(o=e.charCodeAt(t))||o>57){p=(46===o?s+e.slice(t+1):e.slice(t))+p,e=e.slice(0,t);break}}g&&!f&&(e=r(e,1/0));var M=l.length+e.length+p.length,k=M<m?new Array(m-M+1).join(n):"";switch(g&&f&&(e=r(k+e,k.length?m-p.length:1/0),k=""),d){case"<":e=l+e+p+k;break;case"=":e=l+k+e+p;break;case"^":e=k.slice(0,M=k.length>>1)+l+e+p+k.slice(M);break;default:e=k+l+e+p}return a(e)}return y=void 0===y?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),E.toString=function(){return e+""},E}return{format:d,formatPrefix:function(e,t){var n=3*Math.max(-8,Math.min(8,Math.floor(jB(t)/3))),r=Math.pow(10,-n),i=d(((e=WB(e)).type="f",e),{suffix:XB[8+n/3]});return function(e){return i(r*e)}}}}!function(e){GB=JB(e),UB=GB.format,YB=GB.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const ZB=new Date,QB=new Date;function eV(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 s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;let a;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<r);return s},i.filter=n=>eV(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)=>(ZB.setTime(+t),QB.setTime(+r),e(ZB),e(QB),Math.floor(n(ZB,QB))),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 tV=6e4,nV=864e5,rV=6048e5,iV=eV(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*tV)/nV,e=>e.getDate()-1);iV.range;const oV=eV(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/nV,e=>e.getUTCDate()-1);oV.range;const sV=eV(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/nV,e=>Math.floor(e/nV));function aV(e){return eV(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())*tV)/rV)}sV.range;const lV=aV(0),cV=aV(1),uV=aV(2),dV=aV(3),hV=aV(4),pV=aV(5),fV=aV(6);function mV(e){return eV(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)/rV)}lV.range,cV.range,uV.range,dV.range,hV.range,pV.range,fV.range;const gV=mV(0),yV=mV(1),vV=mV(2),bV=mV(3),xV=mV(4),wV=mV(5),SV=mV(6);gV.range,yV.range,vV.range,bV.range,xV.range,wV.range,SV.range;const CV=eV(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());CV.every=e=>isFinite(e=Math.floor(e))&&e>0?eV(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,CV.range;const EV=eV(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 MV(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function kV(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function IV(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=MV,n=(t,n)=>MV(e(t),n),r=(t,n)=>e(t)-n):(t=e===MV||e===kV?e:RV,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const s=i(e,t,n,o-1);return s>n&&r(e[s-1],t)>-r(e[s],t)?s-1:s},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 RV(){return 0}EV.every=e=>isFinite(e=Math.floor(e))&&e>0?eV(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,EV.range;const _V=IV(MV).right;IV(function(e){return null===e?NaN:+e}).center;var DV=_V;class AV extends Map{constructor(e,t=LV){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(PV(this,e))}has(e){return super.has(PV(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 PV({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function LV(e){return null!==e&&"object"==typeof e?e.valueOf():e}const TV=Math.sqrt(50),OV=Math.sqrt(10),qV=Math.sqrt(2);function NV(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=TV?10:o>=OV?5:o>=qV?2:1;let a,l,c;return i<0?(c=Math.pow(10,-i)/s,a=Math.round(e*c),l=Math.round(t*c),a/c<e&&++a,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*s,a=Math.round(e/c),l=Math.round(t/c),a*c<e&&++a,l*c>t&&--l),l<a&&.5<=n&&n<2?NV(e,t,2*n):[a,l,c]}function jV(e,t,n){return NV(e=+e,t=+t,n=+n)[2]}function zV(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 FV(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 WV(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function $V(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,s=e.shortDays,a=e.months,l=e.shortMonths,c=KV(i),u=XV(i),d=KV(o),h=XV(o),p=KV(s),f=XV(s),m=KV(a),g=XV(a),y=KV(l),v=XV(l),b={a:function(e){return s[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return a[e.getMonth()]},c:null,d:yH,e:yH,f:SH,g:LH,G:OH,H:vH,I:bH,j:xH,L:wH,m:CH,M:EH,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:iG,s:oG,S:MH,u:kH,U:IH,V:_H,w:DH,W:AH,x:null,X:null,y:PH,Y:TH,Z:qH,"%":rG},x={a:function(e){return s[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return a[e.getUTCMonth()]},c:null,d:NH,e:NH,f:$H,g:QH,G:tG,H:jH,I:zH,j:FH,L:WH,m:BH,M:VH,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:iG,s:oG,S:HH,u:GH,U:UH,V:KH,w:XH,W:JH,x:null,X:null,y:ZH,Y:eG,Z:nG,"%":rG},w={a:function(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return E(e,t,n,r)},d:aH,e:aH,f:pH,g:rH,G:nH,H:cH,I:cH,j:lH,L:hH,m:sH,M:uH,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:oH,Q:mH,s:gH,S:dH,u:ZV,U:QV,V:eH,w:JV,W:tH,x:function(e,t,r){return E(e,n,t,r)},X:function(e,t,n){return E(e,r,t,n)},y:rH,Y:nH,Z:iH,"%":fH};function S(e,t){return function(n){var r,i,o,s=[],a=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++a<c;)37===e.charCodeAt(a)&&(s.push(e.slice(l,a)),null!=(i=BV[r=e.charAt(++a)])?r=e.charAt(++a):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),s.push(r),l=a+1);return s.push(e.slice(l,a)),s.join("")}}function C(e,t){return function(n){var r,i,o=WV(1900,void 0,1);if(E(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=FV(WV(o.y,0,1))).getUTCDay(),r=i>4||0===i?yV.ceil(r):yV(r),r=oV.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=zV(WV(o.y,0,1))).getDay(),r=i>4||0===i?cV.ceil(r):cV(r),r=iV.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?FV(WV(o.y,0,1)).getUTCDay():zV(WV(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,FV(o)):zV(o)}}function E(e,t,n,r){for(var i,o,s=0,a=t.length,l=n.length;s<a;){if(r>=l)return-1;if(37===(i=t.charCodeAt(s++))){if(i=t.charAt(s++),!(o=w[i in BV?t.charAt(s++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=S(n,b),b.X=S(r,b),b.c=S(t,b),x.x=S(n,x),x.X=S(r,x),x.c=S(t,x),{format:function(e){var t=S(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=C(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+="",!0);return t.toString=function(){return e},t}}}var BV={"-":"",_:" ",0:"0"},VV=/^\s*\d+/,HV=/^%/,GV=/[\\^$*+?|[\]().{}]/g;function UV(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 YV(e){return e.replace(GV,"\\$&")}function KV(e){return new RegExp("^(?:"+e.map(YV).join("|")+")","i")}function XV(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function JV(e,t,n){var r=VV.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function ZV(e,t,n){var r=VV.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function QV(e,t,n){var r=VV.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function eH(e,t,n){var r=VV.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function tH(e,t,n){var r=VV.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function nH(e,t,n){var r=VV.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function rH(e,t,n){var r=VV.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function iH(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 oH(e,t,n){var r=VV.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function sH(e,t,n){var r=VV.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function aH(e,t,n){var r=VV.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function lH(e,t,n){var r=VV.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function cH(e,t,n){var r=VV.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function uH(e,t,n){var r=VV.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function dH(e,t,n){var r=VV.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function hH(e,t,n){var r=VV.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function pH(e,t,n){var r=VV.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function fH(e,t,n){var r=HV.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function mH(e,t,n){var r=VV.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function gH(e,t,n){var r=VV.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function yH(e,t){return UV(e.getDate(),t,2)}function vH(e,t){return UV(e.getHours(),t,2)}function bH(e,t){return UV(e.getHours()%12||12,t,2)}function xH(e,t){return UV(1+iV.count(CV(e),e),t,3)}function wH(e,t){return UV(e.getMilliseconds(),t,3)}function SH(e,t){return wH(e,t)+"000"}function CH(e,t){return UV(e.getMonth()+1,t,2)}function EH(e,t){return UV(e.getMinutes(),t,2)}function MH(e,t){return UV(e.getSeconds(),t,2)}function kH(e){var t=e.getDay();return 0===t?7:t}function IH(e,t){return UV(lV.count(CV(e)-1,e),t,2)}function RH(e){var t=e.getDay();return t>=4||0===t?hV(e):hV.ceil(e)}function _H(e,t){return e=RH(e),UV(hV.count(CV(e),e)+(4===CV(e).getDay()),t,2)}function DH(e){return e.getDay()}function AH(e,t){return UV(cV.count(CV(e)-1,e),t,2)}function PH(e,t){return UV(e.getFullYear()%100,t,2)}function LH(e,t){return UV((e=RH(e)).getFullYear()%100,t,2)}function TH(e,t){return UV(e.getFullYear()%1e4,t,4)}function OH(e,t){var n=e.getDay();return UV((e=n>=4||0===n?hV(e):hV.ceil(e)).getFullYear()%1e4,t,4)}function qH(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+UV(t/60|0,"0",2)+UV(t%60,"0",2)}function NH(e,t){return UV(e.getUTCDate(),t,2)}function jH(e,t){return UV(e.getUTCHours(),t,2)}function zH(e,t){return UV(e.getUTCHours()%12||12,t,2)}function FH(e,t){return UV(1+oV.count(EV(e),e),t,3)}function WH(e,t){return UV(e.getUTCMilliseconds(),t,3)}function $H(e,t){return WH(e,t)+"000"}function BH(e,t){return UV(e.getUTCMonth()+1,t,2)}function VH(e,t){return UV(e.getUTCMinutes(),t,2)}function HH(e,t){return UV(e.getUTCSeconds(),t,2)}function GH(e){var t=e.getUTCDay();return 0===t?7:t}function UH(e,t){return UV(gV.count(EV(e)-1,e),t,2)}function YH(e){var t=e.getUTCDay();return t>=4||0===t?xV(e):xV.ceil(e)}function KH(e,t){return e=YH(e),UV(xV.count(EV(e),e)+(4===EV(e).getUTCDay()),t,2)}function XH(e){return e.getUTCDay()}function JH(e,t){return UV(yV.count(EV(e)-1,e),t,2)}function ZH(e,t){return UV(e.getUTCFullYear()%100,t,2)}function QH(e,t){return UV((e=YH(e)).getUTCFullYear()%100,t,2)}function eG(e,t){return UV(e.getUTCFullYear()%1e4,t,4)}function tG(e,t){var n=e.getUTCDay();return UV((e=n>=4||0===n?xV(e):xV.ceil(e)).getUTCFullYear()%1e4,t,4)}function nG(){return"+0000"}function rG(){return"%"}function iG(e){return+e}function oG(e){return Math.floor(+e/1e3)}const sG=qB();sG("d3-number",function(e,t,n){let r,i;function o(e){return i(e)}function s(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return r=JB(t),i=r.format(e),this},s(),o.format=function(e,i,o,a){return(o||a)&&(t=o,n=a,s()),r.format(e)(i)},o.pattern=function(t){return t&&(e=t,i=r.format(t)),e},o}),sG("d3-time",function(e){let t=$V({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=$V(...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 aG={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 sG(t.type||"d3-number")(t.format||"")})(e)};function lG(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.id,r=void 0===n?aG.id:n,i=t.key,o=void 0===i?aG.key:i,s=t.min,a=void 0===s?aG.min:s,l=t.max,c=void 0===l?aG.max:l,u=t.type,d=void 0===u?aG.type:u,h=t.tags,p=void 0===h?aG.tags:h,f=t.title,m=void 0===f?aG.title:f,g=t.values,y=void 0===g?aG.values:g,v=t.value,b=void 0===v?aG.value:v,x=t.label,w=void 0===x?aG.label:x,S=t.formatter,C=void 0===S?aG.formatter:S;return{id:()=>r(e),key:()=>o(e),raw:()=>e,tags:()=>p(e),type:()=>d(e),min:()=>a(e),max:()=>c(e),title:()=>m(e),items:()=>y(e),formatter:()=>C(e),value:b,label:w}}const cG=e=>e.filter(e=>"number"==typeof e&&!isNaN(e)),uG=e=>e.reduce((e,t)=>e+t,0),dG={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=cG(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=cG(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=cG(e);return t.length?t.reduce((e,t)=>e+t,0):NaN},avg:e=>{const t=cG(e),n=t.length;return n?uG(t)/n:NaN}};function hG(e,t,n,r){const i={},o=r.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach(s=>{const a=n[s],l=i[s]={};-1!==["number","string","boolean"].indexOf(typeof a)?(l.type="primitive",l.value=a):"function"==typeof a?(l.type="function",l.value=a,l.label=a,l.field=o):"object"==typeof a&&(a.fields?l.fields=a.fields.map(n=>hG(e,t,{main:n},r).main):void 0!==a.field?(l.type="field",l.field=t.field(a.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 a.filter&&(l.filter=a.filter),void 0!==a.value&&(l.value=a.value),void 0!==a.label&&(l.label=a.label),"function"==typeof a.reduce?l.reduce=a.reduce:a.reduce?l.reduce=dG[a.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?dG[l.field.reduce]:l.field.reduce),"function"==typeof a.reduceLabel?l.reduceLabel=a.reduceLabel:a.reduceLabel?l.reduceLabel=dG[a.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?dG[l.field.reduceLabel]:l.field.reduceLabel))}),i}function pG(e,t){const n=hG(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{}).main;return{props:hG(e,t,e.props||{},n),main:n}}function fG(e,t,n,r){const i=Array(e.length),o=Array(e.length);let s;for(let t=0;t<e.length;t++)s=r?e[t][r]:e[t],i[t]=s.value,o[t]=s.label;const a=t.reduce,l=t.reduceLabel,c=a?a(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 mG(e,t){let n=t.main,r=t.propsArr,i=t.props,o=[];const s=n.field.formatter(),a={};return r.forEach(e=>{a[e]=i[e].field?i[e].field.formatter():e=>e}),o.push(...e.map(e=>{const t=fG(e.items,n,s);return r.forEach(n=>{t[n]=fG(e.items,i[n],a[n],n)}),t})),o}function gG(e){let t=e.cfg,n=e.itemData,r=e.obj,i=e.target,o=e.tracker;const s="function"===e.trackType?t.trackBy(n):n[t.trackBy];let a=o[s];a||(a=o[s]={items:[],id:s},i.push(a)),a.items.push(r)}function yG(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 vG(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 bG={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 s=0;s<n;++s){const n=e[t[s]][i],a=n[1]-n[0];a>=0?(n[0]=r,r+=a,n[1]=r):a<0?(n[1]=o,o+=a,n[0]=o):n[0]=r}}},none:DB,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 s=0,a=0;s<n;++s)a+=e[s][r][1]||0;i[r][1]+=i[r][0]=-a/2}DB(e,t)}},expand:function(e,t){if((r=e.length)>0){for(var n,r,i,o=0,s=e[0].length;o<s;++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}DB(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,s=1;s<r;++s){for(var a=0,l=0,c=0;a<i;++a){for(var u=e[t[a]],d=u[s][1]||0,h=(d-(u[s-1][1]||0))/2,p=0;p<a;++p){var f=e[t[p]];h+=(f[s][1]||0)-(f[s-1][1]||0)}l+=d,c+=h*d}n[s-1][1]+=n[s-1][0]=o,l&&(o-=c/l)}n[s-1][1]+=n[s-1][0]=o,DB(e,t)}}},xG={ascending:function(e){var t=e.map(OB);return AB(e).sort(function(e,n){return t[e]-t[n]})},insideout:function(e){var t,n,r=e.length,i=e.map(OB),o=function(e){var t=e.map(TB);return AB(e).sort(function(e,n){return t[e]-t[n]})}(e),s=0,a=0,l=[],c=[];for(t=0;t<r;++t)n=o[t],s<a?(s+=i[n],l.push(n)):(a+=i[n],c.push(n));return c.reverse().concat(l)},none:AB,reverse:function(e){return AB(e).reverse()}};function wG(e,t,n,r){const i=r||e.items,o={},s=t.stackKey,a=t.value,l=t.startProp||"start",c=t.endProp||"end",u=t.offset||"none",d=t.order||"none",h=t.valueRef||"";let p=0,f={};for(let e=0;e<i.length;e++){let t=i[e],n=h?t[h]:null;if(n&&n.source){let e="".concat(n.source.key||"","/").concat(n.source.field);f[e]||(f[e]=n.source)}let r=s(t);o[r]=o[r]||{items:[]},o[r].items.push(t),p=Math.max(p,o[r].items.length)}const m=Array.apply(null,{length:p}).map(Number.call,Number),g=Object.keys(o).map(e=>o[e].items),y=function(){var e=P$([]),t=AB,n=DB,r=PB;function i(i){var o,s,a=Array.from(e.apply(this,arguments),LB),l=a.length,c=-1;for(const e of i)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,s=oB(t(a));o<l;++o)a[s[o]].index=o;return n(a,s),a}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:P$(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r="function"==typeof e?e:P$(+e),i):r},i.order=function(e){return arguments.length?(t=null==e?AB:"function"==typeof e?e:P$(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?DB:e,i):n},i}().keys(m).value((e,t)=>e[t]?a(e[t]):0).order(xG[d]).offset(bG[u]);let v=y(g),b=[];for(let e=0;e<v.length;e++){let t=v[e];for(let e=0;e<t.length;e++){let n=t[e],r=t[e].data[t.key];r&&(r[l]={value:n[0]},r[c]={value:n[1]},b.push(n[0],n[1]))}}let x=Object.keys(f).map(e=>{let t=n(f[e].key);return t?t.field(f[e].field):null}).filter(e=>!!e);const w=lG({title:x.map(e=>e.title()).join(", "),min:vG(b),max:yG(b),type:"measure",formatter:x[0]?x[0].formatter:void 0});e.fields.push(w)}function SG(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=x$({},t.collection(e.collection));else{const i=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),s=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(s(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),s=t.label||(e=>e),n.value=o),n.items=t.items().map(t=>({value:o(t),label:String(s(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});wG(n,e.stack,t.dataset,i)}):wG(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 CG(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:SG;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 EG(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const MG=Symbol("implicit");function kG(){var e=new AV,t=[],n=[],r=MG;function i(i){let o=e.get(i);if(void 0===o){if(r!==MG)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 AV;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 kG(t,n).unknown(r)},EG.apply(i,arguments),i}function IG(){var e,t,n=kG().unknown(void 0),r=n.domain,i=n.range,o=0,s=1,a=!1,l=0,c=0,u=.5;function d(){var n=r().length,d=s<o,h=d?s:o,p=d?o:s;e=(p-h)/Math.max(1,n-l+2*c),a&&(e=Math.floor(e)),h+=(p-h-e*(n-l))*u,t=e*(1-l),a&&(h=Math.round(h),t=Math.round(t));var f=function(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r<i;)o[r]=e+r*n;return o}(n).map(function(t){return h+e*t});return i(d?f.reverse():f)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),d()):r()},n.range=function(e){return arguments.length?([o,s]=e,o=+o,s=+s,d()):[o,s]},n.rangeRound=function(e){return[o,s]=e,o=+o,s=+s,a=!0,d()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(a=!!e,d()):a},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 IG(r(),[o,s]).round(a).paddingInner(l).paddingOuter(c).align(u)},EG.apply(d(),arguments)}function RG(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _G(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function DG(){}var AG=.7,PG=1/AG,LG="\\s*([+-]?\\d+)\\s*",TG="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",OG="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qG=/^#([0-9a-f]{3,8})$/,NG=new RegExp(`^rgb\\(${LG},${LG},${LG}\\)$`),jG=new RegExp(`^rgb\\(${OG},${OG},${OG}\\)$`),zG=new RegExp(`^rgba\\(${LG},${LG},${LG},${TG}\\)$`),FG=new RegExp(`^rgba\\(${OG},${OG},${OG},${TG}\\)$`),WG=new RegExp(`^hsl\\(${TG},${OG},${OG}\\)$`),$G=new RegExp(`^hsla\\(${TG},${OG},${OG},${TG}\\)$`),BG={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 VG(){return this.rgb().formatHex()}function HG(){return this.rgb().formatRgb()}function GG(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=qG.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?UG(t):3===n?new XG(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?YG(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?YG(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=NG.exec(e))?new XG(t[1],t[2],t[3],1):(t=jG.exec(e))?new XG(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=zG.exec(e))?YG(t[1],t[2],t[3],t[4]):(t=FG.exec(e))?YG(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=WG.exec(e))?nU(t[1],t[2]/100,t[3]/100,1):(t=$G.exec(e))?nU(t[1],t[2]/100,t[3]/100,t[4]):BG.hasOwnProperty(e)?UG(BG[e]):"transparent"===e?new XG(NaN,NaN,NaN,0):null}function UG(e){return new XG(e>>16&255,e>>8&255,255&e,1)}function YG(e,t,n,r){return r<=0&&(e=t=n=NaN),new XG(e,t,n,r)}function KG(e,t,n,r){return 1===arguments.length?function(e){return e instanceof DG||(e=GG(e)),e?new XG((e=e.rgb()).r,e.g,e.b,e.opacity):new XG}(e):new XG(e,t,n,null==r?1:r)}function XG(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function JG(){return`#${tU(this.r)}${tU(this.g)}${tU(this.b)}`}function ZG(){const e=QG(this.opacity);return`${1===e?"rgb(":"rgba("}${eU(this.r)}, ${eU(this.g)}, ${eU(this.b)}${1===e?")":`, ${e})`}`}function QG(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function eU(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function tU(e){return((e=eU(e))<16?"0":"")+e.toString(16)}function nU(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new iU(e,t,n,r)}function rU(e){if(e instanceof iU)return new iU(e.h,e.s,e.l,e.opacity);if(e instanceof DG||(e=GG(e)),!e)return new iU;if(e instanceof iU)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new iU(s,a,l,e.opacity)}function iU(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function oU(e){return(e=(e||0)%360)<0?e+360:e}function sU(e){return Math.max(0,Math.min(1,e||0))}function aU(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}RG(DG,GG,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:VG,formatHex:VG,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return rU(this).formatHsl()},formatRgb:HG,toString:HG}),RG(XG,KG,_G(DG,{brighter(e){return e=null==e?PG:Math.pow(PG,e),new XG(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?AG:Math.pow(AG,e),new XG(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new XG(eU(this.r),eU(this.g),eU(this.b),QG(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:JG,formatHex:JG,formatHex8:function(){return`#${tU(this.r)}${tU(this.g)}${tU(this.b)}${tU(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ZG,toString:ZG})),RG(iU,function(e,t,n,r){return 1===arguments.length?rU(e):new iU(e,t,n,null==r?1:r)},_G(DG,{brighter(e){return e=null==e?PG:Math.pow(PG,e),new iU(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?AG:Math.pow(AG,e),new iU(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 XG(aU(e>=240?e-240:e+120,i,r),aU(e,i,r),aU(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new iU(oU(this.h),sU(this.s),sU(this.l),QG(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=QG(this.opacity);return`${1===e?"hsl(":"hsla("}${oU(this.h)}, ${100*sU(this.s)}%, ${100*sU(this.l)}%${1===e?")":`, ${e})`}`}}));var lU=e=>()=>e;function cU(e){return 1===(e=+e)?uU: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):lU(isNaN(t)?n:t)}}function uU(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):lU(isNaN(e)?t:e)}var dU=function e(t){var n=cU(t);function r(e,t){var r=n((e=KG(e)).r,(t=KG(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=uU(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1);function hU(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 pU(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),s=new Array(r);for(n=0;n<i;++n)o[n]=xU(e[n],t[n]);for(;n<r;++n)s[n]=t[n];return function(e){for(n=0;n<i;++n)s[n]=o[n](e);return s}}function fU(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function mU(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function gU(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]=xU(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var yU=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,vU=new RegExp(yU.source,"g");function bU(e,t){var n,r,i,o=yU.lastIndex=vU.lastIndex=0,s=-1,a=[],l=[];for(e+="",t+="";(n=yU.exec(e))&&(r=vU.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),a[s]?a[s]+=i:a[++s]=i),(n=n[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:mU(n,r)})),o=vU.lastIndex;return o<t.length&&(i=t.slice(o),a[s]?a[s]+=i:a[++s]=i),a.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)a[(n=l[r]).i]=n.x(e);return a.join("")})}function xU(e,t){var n,r=typeof t;return null==t||"boolean"===r?lU(t):("number"===r?mU:"string"===r?(n=GG(t))?(t=n,dU):bU:t instanceof GG?dU:t instanceof Date?fU:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?hU:Array.isArray(t)?pU:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?gU:mU)(e,t)}function wU(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function SU(e){return+e}var CU=[0,1];function EU(e){return e}function MU(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function kU(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i<r?(r=MU(i,r),o=n(s,o)):(r=MU(r,i),o=n(o,s)),function(e){return o(r(e))}}function IU(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=MU(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(t){var n=DV(e,t,1,r)-1;return o[n](i[n](t))}}function RU(){var e,t,n,r,i,o,s=CU,a=CU,l=xU,c=EU;function u(){var e=Math.min(s.length,a.length);return c!==EU&&(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))}}(s[0],s[e-1])),r=e>2?IU:kU,i=o=null,d}function d(t){return null==t||isNaN(t=+t)?n:(i||(i=r(s.map(e),a,l)))(e(c(t)))}return d.invert=function(n){return c(t((o||(o=r(a,s.map(e),mU)))(n)))},d.domain=function(e){return arguments.length?(s=Array.from(e,SU),u()):s.slice()},d.range=function(e){return arguments.length?(a=Array.from(e),u()):a.slice()},d.rangeRound=function(e){return a=Array.from(e),l=wU,u()},d.clamp=function(e){return arguments.length?(c=!!e||EU,u()):c!==EU},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 _U(e,t,n,r){var i,o=function(e,t,n){n=+n;const r=(t=+t)<(e=+e),i=r?jV(t,e,n):jV(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}(e,t,n);switch((r=WB(null==r?",f":r)).type){case"s":var s=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(jB(t)/3)))-jB(Math.abs(e)))}(o,s))||(r.precision=i),YB(r,s);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,jB(t)-jB(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,-jB(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return UB(r)}function DU(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,s]=r?NV(t,e,n):NV(e,t,n);if(!(o>=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let e=0;e<a;++e)l[e]=(o-e)/-s;else for(let e=0;e<a;++e)l[e]=(o-e)*s;else if(s<0)for(let e=0;e<a;++e)l[e]=(i+e)/-s;else for(let e=0;e<a;++e)l[e]=(i+e)*s;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return _U(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),s=0,a=o.length-1,l=o[s],c=o[a],u=10;for(c<l&&(i=l,l=c,c=i,i=s,s=a,a=i);u-- >0;){if((i=jV(l,c,n))===r)return o[s]=l,o[a]=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 AU(){var e=RU()(EU,EU);return e.copy=function(){return t=e,AU().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},EG.apply(e,arguments),DU(e)}function PU(){var e,t=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[DV(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 PU().domain(t).range(n).unknown(e)},EG.apply(i,arguments)}function LU(e){return void 0===e?e=>e:t=>e(t)}function TU(e){return Math.max(0,Math.min(1,e))}function OU(e){return"object"==typeof e}function qU(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 NU(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],s=e[i+1];0===i&&o!==n.start()?(r.push(...qU(t,o,s)),o-=s-o,s=e[i],r.push(...qU(t,o,s))):i===e.length-1&&s!==n.end()?(s=o+(o-e[i-1]),r.push(...qU(t,o,s))):r.push(...qU(t,o,s))}return r.filter(e=>e>=n.min()&&e<=n.max())}function jU(e){let t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,s=void 0===o?100:o,a=e.formatter,l=void 0===a?void 0:a;const c=E$(s)||E$(t)?2:Math.max(t/s,2),u=Math.min(1e3,Math.round(c));let d=n.ticks(u);d.length<=1&&(d=n.ticks(u+1));const h=i>0?NU(d,i,n):d;h.sort((e,t)=>e-t);const p=h.map(LU(l));return h.map((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:p[t],value:e,isMinor:-1===d.indexOf(e)}})}function zU(e){let t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,s=void 0===o?100:o,a=e.formatter,l=void 0===a?void 0:a;const c=E$(s)||E$(t)?2:Math.max(t/s,2),u=Math.min(1e3,Math.round(c)),d=u>10?10:u;n.nice(d);const h=n.ticks(u),p=i>0?NU(h,i,n):h;p.sort((e,t)=>e-t);const f=p.map(LU(l));return p.map((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:f[t],value:e,isMinor:-1===h.indexOf(e)}})}function FU(e){let t,n=e.settings,r=e.scale,i=e.distance,o=e.formatter,s=void 0===o?e=>e:o;const a=n.minorTicks&&!E$(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?!E$(e.value):!E$(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)=>(OU(e)?e.value:e)-(OU(t)?t.value:t)).filter((e,t,r)=>{const i=OU(e)?e.value:e;return i<=n.max()&&i>=n.min()&&r.indexOf(e)===t}).map(e=>{const t=OU(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)?TU(n(e.start)):o,end:t&&!isNaN(e.end)?TU(n(e.end)):o}})}({values:e,scale:r.copy(),formatter:s})}else if(E$(n.ticks.count)){t=(n.ticks.tight?zU:jU)({distance:i,minorCount:a,unitDivider:n.ticks.distance,scale:r,formatter:s}),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,s)}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:a,scale:r.copy(),formatter:s})}return t}function WU(){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 $U={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},BU={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},VU={count:NaN};function HU(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 GU(){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=AU(),i={instance:null,invert:!1},o={data:t,resources:n},s=WU(e,$U,o);let a;function l(e){return E$(e)?NaN:r(e)}s.ticks=WU(e.ticks,BU,o),s.minorTicks=WU(e.minorTicks,VU,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 a},l.clearTicksCache=function(){return a=void 0,this},l.ticks=function(e){return null!==e&&"object"==typeof e?(e.settings=e.settings||{},e.settings=m$(!0,{},s,e.settings),e.scale=l,a=FU(e),a):(a=r.ticks(e),a)},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,s=l(e+i);n.push(o,o),r.push(s,s)}return n.pop(),l.domain(n),l.range(r),l},l.copy=function(){const i=GU(e,t,n);return i.domain(l.domain()),i.range(l.range()),i.clamp(r.clamp()),i},l.norm=function(e){return HU(i,l),i.instance(e)},l.normInvert=function(e){return HU(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}}(s,t?t.fields:[]),u=c.mini,d=c.maxi;return l.domain([u,d]),l.range(s.invert?[1,0]:[0,1]),i.invert=s.invert,l}const UU={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function YU(){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=WU(e,UU,n),i=t.items||[],o={},s=[],a=[];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=()=>a,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 s=t(e);return{position:s+o/2,label:"".concat(i[n]),data:r?r[n]:void 0,start:s,end:s+o}})}(t,n.trackBy)}}const c=IG();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 s=c.copy();s.type=c.type,l(s,e);const a=o*n/t,u=(1-a)*c.align();return s.range(r.invert?[a+u,u]:[u,a+u]),s};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=m$({datum:i[e]},n),r=u(t,e);-1===s.indexOf(r)&&(s.push(r),a.push(d(t,e)),o[r]=e)}return c.domain(s),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 KU={depth:0};function XU(e,t,n){return e.ancestors().map(e=>t(m$({datum:e.data},n))).reverse().slice(1).toString()}const JU=e=>e.min(),ZU=e=>e.max();function QU(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(JU).filter(C$);i=e.length?Math.min(...e):i}if(!r){const e=t.map(ZU).filter(C$);o=e.length?Math.max(...e):o}}return[i,o]}const eY={domain:[],range:[],invert:!1,min:NaN,max:NaN};function tY(){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=GU(e,t,n).clamp(!0).interpolate(dU),i=WU(e,eY,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,s=Array.isArray(i.range)&&i.range.length,a=r;m$(!0,a,r);const l=w$(QU(i,t?t.fields:[]),2),c=l[0],u=l[1],d=o?i.domain.length:-1,h=n.theme?n.theme.palette("sequential",d>0?d:2):[],p=s?i.range:h;return a.range(i.invert?p.slice().reverse():p.slice()),a.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}(a.range(),c,u)),a}const nY={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function rY(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}const iY={domain:[],range:[]};const oY={domain:[],range:[],unknown:void 0},sY={domain:[],range:[],override:!1};const aY=qB();function lY(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=SG(r,t,n);let o,s=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"===s&&(s=i.fields&&i.fields[0]&&"dimension"===i.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(s)&&(o=n.scale.get(s),o=o(e,i,{theme:n.theme,logger:n.logger}),o.type=s),o}aY("linear",GU),aY("band",YU),aY("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=WU(t,UU,i);o.ticks=WU(t.ticks,KU,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 s=YU(o);const a=function(e,t,n){const r=t.ticks.depth,i=t.value,o=t.label,s=[],a=[],l={},c=[];let u=0;if(!e)return{values:s,labels:a,items:l,ticks:c};e.eachAfter(e=>{if(e.depth>0){const t=XU(e,i,n),d=e.leaves()||[e],h=i(m$({datum:e.data},n)),p=o(m$({datum:e.data},n)),f=Array.isArray(e.children),m={key:t,count:d.length,value:h,label:p,leftEdge:XU(d[0],i,n),rightEdge:XU(d[Math.max(d.length-1,0)],i,n),node:e};f?(s.push("SPACER_".concat(u,"_SPACER")),u++):(s.push(t),a.push(p)),(r<=0&&!f||e.depth===r)&&c.push(m),l[t]=m}});const d=e.height-1;return d>0&&s.splice(-d),{values:s,labels:a,items:l,ticks:c}}(n.root,o,i),l=a.values,c=a.labels,u=a.items,d=a.ticks,h=function(e){const t=String(e),n=u[t];return s(n?o.invert?n.rightEdge:n.leftEdge:t)};m$(!0,h,s),h.bandwidth=function(e){const t=u[String(e)],n=s.bandwidth();if(t&&!t.isLeaf){const e=h(t.leftEdge),r=h(t.rightEdge);return Math.abs(e-r)+n}return n},h.step=function(e){const t=u[String(e)],n=t?t.count:1;let r=s.step();return r*=n,r},h.data=()=>n,h.datum=e=>{const t=u[String(e)];return t?t.node.data:null},h.copy=()=>e(t,n,r),h.labels=()=>c,h.ticks=()=>d.map(e=>{const t=h(e.key),n=h.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}});const p=s.pxScale;return h.pxScale=function(e){return s=p(e),h},h.domain(l),h}),aY("sequential-color",tY),aY("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=PU(),i=WU(e,nY,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,s=Array.isArray(i.range)&&i.range.length;function a(e){return E$(e)?NaN:r(e)}Object.keys(r).forEach(e=>a[e]=r[e]);const l=w$(QU(i,t.fields),2),c=l[0],u=l[1],d=o?i.domain.length:-1,h=n.theme?n.theme.palette("sequential",d>0?d:2):[];let p=s?i.range:h,f=[];return f=o?i.domain:i.nice?function(e,t,n){const r=2===e.length?10:Math.max(1,e.length),i=AU().domain([t,n]).nice(r).ticks(r);if(!e||!e.length)return i;const o=Math.max(0,e.length-1);for(;i.length>o;)i[0]-t<=n-i[i.length-1]?i.shift():i.pop();return i}(p,c,u):[c+(u-c)/2],p.length>f.length+1?f=function(e,t,n){const r=e.length;if(2===r)return[t+(n-t)/2];const i=[],o=(n-t)/r;for(let e=1;e<r;e++)i.push(t+o*e);return i}(p,c,u):p.length<f.length+1&&(p=function(e,t,n,r){n=e[0],r=e&&e.length>=2?e[e.length-1]:r;const i=tY().domain([n,r]).range(t);return[n,...rY(e),r].map(e=>i(e))}(f,p,c,u)),a.data=()=>t,a.range(i.invert?p.slice().reverse():p),a.domain(f),a}),aY("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=kG(),i={data:t,resources:n},o=WU(e,iY,i),s="function"==typeof e.value?e.value:e=>e.datum.value,a="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=m$({datum:l[e]},i),n=s(t,e);-1===u.indexOf(n)&&(u.push(n),d.push(a(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=WU(e,oY,{data:t,resources:n});let s;if(o.explicit=WU(e.explicit,sY,{data:t,resources:n}),s=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/s.length);for(let e=1;e<i+1;e*=2)s=s.concat(s);if(o.explicit.override)for(let r=0;r<t.length;r++){const i=e.indexOf(t[r]);i>-1&&(s[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&&s.splice(n,0,t[2])})}s.length=e.length}return r.range(s),r});var cY={};function uY(){uY.init.call(this)}cY.isObject=function(e){return"object"==typeof e&&null!==e},cY.isNumber=function(e){return"number"==typeof e},cY.isUndefined=function(e){return void 0===e},cY.isFunction=function(e){return"function"==typeof e};var dY=uY;uY.EventEmitter=uY,uY.prototype._events=void 0,uY.prototype._maxListeners=void 0,uY.defaultMaxListeners=10,uY.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},uY.prototype.setMaxListeners=function(e){if(!cY.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},uY.prototype.emit=function(e){var t,n,r,i,o,s;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],cY.isUndefined(n))return!1;if(cY.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(cY.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(s=n.slice()).length,o=0;o<r;o++)s[o].apply(this,i)}return!0},uY.prototype.addListener=function(e,t){var n;if(!cY.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,cY.isFunction(t.listener)?t.listener:t),this._events[e]?cY.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,cY.isObject(this._events[e])&&!this._events[e].warned)&&((n=cY.isUndefined(this._maxListeners)?uY.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,cY.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),cY.isFunction(console.trace)&&console.trace()));return this},uY.prototype.on=uY.prototype.addListener,uY.prototype.once=function(e,t){if(!cY.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},uY.prototype.removeListener=function(e,t){var n,r,i,o;if(!cY.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||cY.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(cY.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},uY.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],cY.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},uY.prototype.listeners=function(e){return this._events&&this._events[e]?cY.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},uY.listenerCount=function(e,t){return e._events&&e._events[t]?cY.isFunction(e._events[t])?1:e._events[t].length:0};var hY={mixin:e=>(Object.keys(dY.prototype).forEach(t=>{e[t]=dY.prototype[t]}),dY.init(e),e)};function pY(){let e=0,t=0,n=0,r=0;n=n||e;const i={move(e){this.moveTo(n+e)},moveTo(o){const s=Math.max(e,Math.min(t-r,o));n!==s&&(n=s,i.emit("update"))},update(o){let s=!1;var a=o.min;e=void 0===a?e:a;var l=o.max;t=void 0===l?t:l,void 0!==o.viewSize&&o.viewSize!==r&&(r=o.viewSize,s=!0);const c=Math.max(e,Math.min(t-r,n));n!==c&&(n=c,s=!0),s&&i.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:r})};return hY.mixin(i),i}function fY(e,t){const n=e.min||0,r=e.max||0,i=e.viewSize||0,o=t||pY();return o.update({min:n,max:r,viewSize:i}),o}function mY(e,t){return e<=t}function gY(e,t){return e<t}function yY(e,t,n){let r=0;for(;r<e.length&&t>e[r];)++r;return e[r]===t&&n&&++r,r}function vY(){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?mY:gY,t=void 0===o||o?mY:gY},i.add=e=>{let t=e.min,n=e.max;const i=yY(r,t),o=yY(r,n,!0),s=[i,o-i];i%2==0&&s.push(t),o%2==0&&s.push(n);const a=r.join(",");r.splice(...s);return a!==r.join(",")},i.remove=e=>{let t=e.min,n=e.max;const i=yY(r,t),o=yY(r,n,!0),s=[i,o-i];i%2==1&&s.push(t),o%2==1&&s.push(n);const a=r.join(",");r.splice(...s);return a!==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=yY(r,t,!0),o=yY(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 bY(){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 xY={key:void 0,includeMin:!0,includeMax:!0};function wY(e){let t=e.items,n=e.collection,r=e.vc;const i={},o=[];let s,a;for(let e=0,o=t.length;e<o;e++){s=t[e].key,n[s]||(n[s]=r()),a=t[e].values||[t[e].value];for(let e=0;e<a.length;e++)n[s].add(a[e])&&(i[s]=i[s]||[],i[s].push(a[e]))}const l=Object.keys(i);for(let e=0,t=l.length;e<t;e++)s=l[e],o.push({id:s,values:i[s]});return o}function SY(e){let t=e.items,n=e.collection;const r={},i=[];let o,s;for(let e=0,i=t.length;e<i;e++)if(o=t[e].key,n[o]){s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[o].remove(s[e])&&(r[o]=r[o]||[],r[o].push(s[e]))}const a=Object.keys(r);for(let e=0,t=a.length;e<t;e++)o=a[e],i.push({id:o,values:r[o]});return i}function CY(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 EY(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 MY(e,t){const n=[],r=Object.keys(e);let i,o;const s=e=>-1===t[i].indexOf(e);for(let a=0,l=r.length;a<l;a++)i=r[a],t[i]?(o=e[i].filter(s),o.length&&n.push({id:i,values:o})):n.push({id:i,values:e[i]});return n}function kY(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?m$({},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 IY(e){return e.replace(/(-[a-z])/g,e=>e.toUpperCase().replace("-",""))}function RY(e){return e.replace(/([A-Z])/g,e=>"-".concat(e.toLowerCase()))}function _Y(e,t,n){let r=n.ranges,i=n.interceptors,o=n.rc,s=n.aliases,a=n.rangeConfig;const l=kY(i["".concat(t,"Ranges")],e,s);let c=!1;return l.forEach(e=>{const n=e.key;if(r[n]||(r[n]=o(a.sources[n]||a.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 DY(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vc,n=void 0===t?bY:t,r=e.rc,i=void 0===r?vY:r,o=!1,s={},a={},l={},c={sources:{},default:m$({},xY)};const u={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},d=()=>{const e={values:{},ranges:{}};return Object.keys(a).forEach(t=>{e.values[t]=a[t].values()}),Object.keys(s).forEach(t=>{e.ranges[t]=s[t].ranges()}),e},h={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}))}},p={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(c={sources:{},default:m$({},xY)},e.ranges.forEach(e=>{const t={};Object.keys(xY).filter(e=>"key"!==e).forEach(n=>{t[n]=void 0!==e[n]?e[n]:xY[n]}),void 0!==e.key?c.sources[e.key]=t:c.default=t}),Object.keys(s).forEach(e=>s[e].configure(c.sources[e]||c.default)),p.emit("update",[],[]))},link:e=>{if(p===e)throw new Error("Can't link to self");h.ls.push(e),e._state(d())},_state:e=>{if(!e)return d();if(e.values){const t=[];Object.keys(e.values).forEach(n=>{a[n]&&e.values[n].join(";")===a[n].toString()||t.push({key:n,values:e.values[n]})}),Object.keys(a).forEach(n=>{e.values[n]||t.push({key:n,values:[]})}),t.length&&p.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach(n=>{s[n]&&e.ranges[n].join(";")===s[n].toString()||t.push({key:n,ranges:e.ranges[n]})}),Object.keys(s).forEach(n=>{e.ranges[n]||t.push({key:n,ranges:[]})}),t.length&&p.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];p.emit("start",...t),h.start()}},end:function(){if(o){o=!1,s={},a={};for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];p.emit("end",...t),h.end()}},isActive:()=>o,clear:()=>{const e=p.brushes().filter(e=>"value"===e.type&&e.brush.values().length).map(e=>({id:e.id,values:e.brush.values()})),t=Object.keys(s).length>0||e.length;s={},a={},t&&(p.emit("update",[],e),h.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(s).map(e=>({type:"range",id:e,brush:s[e]}))),e=e.concat(Object.keys(a).map(e=>({type:"value",id:e,brush:a[e]}))),e},addValue:(e,t)=>{p.addValues([{key:e,value:t}])},addValues:e=>{const t=kY(u.addValues,e,l),r=wY({vc:n,collection:a,items:t});p.emit("add-values",t),r.length&&(o||(o=!0,p.emit("start")),p.emit("update",r,[]),h.updateValues())}};return p.setValues=e=>{const t=kY(u.setValues,e,l),r=function(e){let t=e.items,n=e.vCollection,r=e.vc;const i={},o=CY(t);let s,a=[],l=[];const c={},u=Object.keys(n);for(let e=0,t=u.length;e<t;e++)s=u[e],c[s]=n[s].values().slice(),delete n[s];const d=e=>{n[s]&&n[s].contains(e)||EY({key:s,value:e,collection:n,obj:i,fn:r})},h=Object.keys(o);for(let e=0,t=h.length;e<t;e++)s=h[e],o[s].forEach(d);return l=MY(c,i),a=MY(i,c),[a,l]}({items:t,vCollection:a,vc:n});p.emit("set-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,p.emit("start")),p.emit("update",r[0],r[1]),h.updateValues())},p.removeValue=(e,t)=>{p.removeValues([{key:e,value:t}])},p.removeValues=e=>{const t=kY(u.removeValues,e,l),n=SY({collection:a,items:t});p.emit("remove-values",t),n.length&&(p.emit("update",[],n),h.updateValues())},p.addAndRemoveValues=(e,t)=>{const r=kY(u.addValues,e,l),i=kY(u.removeValues,t,l),s=wY({vc:n,collection:a,items:r}),c=SY({collection:a,items:i});p.emit("add-values",r),p.emit("remove-values",i),(s.length||c.length)&&(o||(o=!0,p.emit("start")),p.emit("update",s,c),h.updateValues())},p.toggleValue=(e,t)=>{p.toggleValues([{key:e,value:t}])},p.toggleValues=e=>{const t=kY(u.toggleValues,e,l),r=function(e){let t=e.items,n=e.values,r=e.vc;const i={},o={},s=[],a=[],l=CY(t);let c,u,d;const h=Object.keys(l);for(let e=0,t=h.length;e<t;e++){c=h[e],d=l[c];for(let e=0,t=d.length;e<t;e++)u=d[e],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):EY({key:c,value:u,collection:n,obj:i,fn:r})}const p=Object.keys(i);for(let e=0,t=p.length;e<t;e++)c=p[e],s.push({id:c,values:i[c]});const f=Object.keys(o);for(let e=0,t=f.length;e<t;e++)c=f[e],a.push({id:c,values:o[c]});return[s,a]}({items:t,values:a,vc:n});p.emit("toggle-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,p.emit("start")),p.emit("update",r[0],r[1]),h.updateValues())},p.containsValue=(e,t)=>{let n=l[e]||e;return!!a[n]&&a[n].contains(t)},p.addRange=(e,t)=>{p.addRanges([{key:e,range:t}])},p.addRanges=e=>{_Y(e,"add",{ranges:s,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),h.updateRanges())},p.removeRange=(e,t)=>{p.removeRanges([{key:e,range:t}])},p.removeRanges=e=>{_Y(e,"remove",{ranges:s,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),h.updateRanges())},p.setRange=(e,t)=>{p.setRanges([{key:e,range:t}])},p.setRanges=e=>{_Y(e,"set",{ranges:s,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),h.updateRanges())},p.toggleRange=(e,t)=>{p.toggleRanges([{key:e,range:t}])},p.toggleRanges=e=>{_Y(e,"toggle",{ranges:s,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),h.updateRanges())},p.containsRangeValue=(e,t)=>{let n=l[e]||e;return!!s[n]&&s[n].containsValue(t)},p.containsRange=(e,t)=>{let n=l[e]||e;return!!s[n]&&s[n].containsRange(t)},p.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,s[u]?r[t].bool=Array.isArray(d)?s[u].containsRange({min:d[0],max:d[1]}):s[u].containsValue(d):a[u]&&a[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)},p.intercept=(e,t)=>{const n=IY(e);u[n]&&u[n].push(t)},p.removeInterceptor=(e,t)=>{const n=IY(e);if(!u[n])return;const r=u[n].indexOf(t);-1!==r&&u[n].splice(r,1)},p.removeAllInterceptors=e=>{const t=[];if(e){const n=IY(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:RY(e),handlers:u[e]})});t.forEach(e=>{e.handlers.slice().forEach(t=>p.removeInterceptor(e.name,t))})},p.addKeyAlias=(e,t)=>{l[e]=t},p.removeKeyAlias=e=>{delete l[e]},hY.mixin(p),p}function AY(e){return e*e*e}function PY(e){return--e*e*e+1}function LY(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}qB();const TY=["stroke","fill","color","backgroundColor","thumbColor"];function OY(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 s;for(s=0;s<r;++s)i[s]=qY(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(e){for(s=0;s<r;++s)o[s]=i[s](e);return o}}function qY(e,t,n){const r=typeof t;let i;return null==t||"boolean"===r?function(e){return()=>e}(t):("number"===r?mU:"string"===r?(i=GG(t))&&TY.includes(n)?(t=i,dU):bU:t instanceof GG?dU:t instanceof Date?fU:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?hU:Array.isArray(t)?OY:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?NY:mU)(e,t)}function NY(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]=qY(e[i],t[i],i):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}function jY(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}const zY={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},FY=/^\$/;function WY(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function $Y(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 BY(e,t){return e.pxScale?e.pxScale(t):e}const VY={normalizeSettings:function(e,t,n){const r=m$({},e),i=m$({},t);return Object.keys(r).forEach(e=>{i[e]={};const o=r[e],s=typeof o;if("function"==typeof o)i[e].fn=o;else if(WY(o)){let n=t[e];"string"==typeof n&&FY.test(n)&&(n=zY[n]);const r=typeof n;i[e]="undefined"===r||r===s?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&&FY.test(n)?i[e]=zY[n]:i[e]=n}),i},resolveForItem:function(e,t,n){const r={},i=Object.keys(t),o=i.length,s=e.datum,a=e.datum;for(let l=0;l<o;l++){const o=i[l],c=t[o],u="object"==typeof a&&void 0!==c,d=u&&"string"==typeof c.ref,h=u&&o in a,p=d?a[c.ref]:h?a[o]:s;WY(c)?r[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),r[o]=c.fn.call(null,e,n)):u&&c.scale&&p?(r[o]=c.scale(p.value),c.scale.bandwidth&&(r[o]+=c.scale.bandwidth()/2)):d&&p?r[o]=p.value:c.fn?r[o]=c.fn.call(null,e,n):r[o]=c}return r},updateScaleSize:$Y};function HY(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((e,t)=>Array.isArray(t.children)?(e.push(...HY(t.children)),e):(e.push(t),e),[])}function GY(e,t){let n=t.context,r=t.data,i=t.style,o=t.filter,s=t.mode;const a=e.chart.brush(n),l=r,c=i.active||{},u=i.inactive||{},d=[];Object.keys(c).forEach(e=>{d.push(e)}),Object.keys(u).forEach(e=>{-1===d.indexOf(e)&&d.push(e)});const h=[];let p=!1;const f=()=>{let t=HY(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=()=>{const e=f(),t=e.length;let n,r=!1;const i="function"==typeof l?l({brush:a}):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=a.containsMappedData(n,i,s),o=h.indexOf(e[r]);let l=!1;t&&-1===o?(h.push(e[r]),l=!0):t||-1===o||(h.splice(o,1),l=!0),e[r].needToUpdate=l||p,e[r].isActive=t}for(let i=0;i<t;i++)if(n=e[i].data,n){if(e[i].needToUpdate){const t=m$({},e[i],e[i].__style),n=e[i].isActive;d.forEach(r=>{e[i][r]=n&&r in c?"function"==typeof c[r]?c[r].call(null,t,h):c[r]:!n&&r in u?"function"==typeof u[r]?u[r].call(null,t,h):u[r]:e[i].__style[r]}),r=!0}delete e[i].needToUpdate}return p=!1,r},g=function(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1}).suppressRender,n=f(),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])}));p=!0,h.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=f(),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);h.length=0,t||e.renderer.render(e.nodes)},v=()=>{if(m()){const t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return a.on("start",g),a.on("end",y),a.on("update",v),{isActive:()=>a.isActive(),update:()=>{h.length=0,p=!0,m()},cleanUp:function(){a.removeListener("start",g),a.removeListener("end",y),a.removeListener("update",v)}}}function UY(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 s={items:[],actionFn:"toggleRanges"},a={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(s.actionFn="".concat(n,"Ranges"),a.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]},s.items.push(e)):(e.value=t.value,a.items.push(e))}})}i.contexts.forEach(e=>{s.items.length?r.brush(e)[s.actionFn](s.items):r.brush(e)[a.actionFn](a.items)})}({dataPoints:o,action:n,chart:r,trigger:i})}function YY(e){let t=e.collisions,n=e.t,r=e.config,i=e.action,o=[],s=!1;t.length>0&&(o=t,s=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));const a=o.map(e=>e.node);return UY({nodes:a,action:i,chart:r.chart,data:r.data,trigger:n}),s}function KY(e,t,n){const r=n.element().getBoundingClientRect();let i=S$(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&&S$(e)?i={cx:i.x,cy:i.y,r:t.touchRadius}:t.mouseRadius>0&&!S$(e)&&(i={cx:i.x,cy:i.y,r:t.mouseRadius}),n.itemsAt(i))}function XY(e,t,n){return e?"function"==typeof e?e(t):e:n}const JY={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 ZY(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 QY(e,t,n,r){const i=n/2,o=e-r/2,s=t-r/2,a=e-i,l=t-i;return[{x:o,y:s},{x:o,y:l},{x:o+r,y:l},{x:o+r,y:s},{x:a+n,y:s},{x:a+n,y:s+r},{x:o+r,y:s+r},{x:o+r,y:l+n},{x:o,y:l+n},{x:o,y:s+r},{x:a,y:s+r},{x:a,y:s}]}function eK(e){return-e/180*Math.PI}function tK(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}}(eK(e))}function nK(e,t){return{x:e.x+t.x,y:e.y+t.y}}function rK(e,t){return{x:e.x-t.x,y:e.y-t.y}}function iK(e,t){return{x:e.x*t,y:e.y*t}}function oK(e,t){return e.x-t.x}function sK(e,t){return e.y-t.y}function aK(e,t){return oK(e,t)**2+sK(e,t)**2}function lK(e,t){return Math.sqrt(aK(e,t))}function cK(e,t){return e.x*t.x+e.y*t.y}function uK(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=rK(e,n);return nK({x:r*o.x-i*o.y,y:i*o.x+r*o.y},n)}const dK={up:0,down:180,left:90,right:-90};function hK(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 pK=qB();pK.add("circle",function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}}),pK.add("diamond",function(e){const t=e.size,n=e.x-t/2,r=e.y-t/2;return{type:"path",fill:"black",d:ZY([{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}])}}),pK.add("saltire",function(e){const t=eK(45),n=e.size/2,r=isNaN(e.width)?n/2:e.width,i=Math.min(r,n);let o=e.size;const s=Math.sin(Math.asin(-t))*(i/2);o+=2*(n/Math.sin(-t)-n),o-=2*s;const a={x:e.x,y:e.y},l=QY(e.x,e.y,o,i).map(e=>uK(e,t,a));return{type:"path",fill:"black",d:ZY(l)}}),pK.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}}),pK.add("triangle",function(e){const t=e.size,n={x:e.x,y:e.y},r=dK[e.direction]||0,i=t/2,o=e.x-i,s=e.y-i;let a=[{x:o,y:s+t},{x:o+i,y:s},{x:o+t,y:s+t},{x:o,y:s+t}];const l=eK(r);return a=a.map(e=>uK(e,l,n)),{type:"path",fill:"black",d:ZY(a)}}),pK.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:hK(e)}}),pK.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,s=isNaN(e.startAngle)?90:e.startAngle,a=360/i;for(let t=1;t<=i;t++){const i=a*t+s,l=eK(i),c=eK(i+a/2),u=Math.sin(l),d=Math.cos(l),h=Math.sin(c),p=Math.cos(c);n.push({x:e.x+d*r,y:e.y+u*r}),n.push({x:e.x+p*o,y:e.y+h*o})}return{type:"path",fill:"black",d:ZY(n)}}),pK.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 s=1;s<=r;s++){const r=eK(i*s+o),a=Math.sin(r),l=Math.cos(r);t.push({x:e.x+l*n,y:e.y+a*n})}return{type:"path",fill:"black",d:ZY(t)}}),pK.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:ZY(QY(t,n,e.size,o))}}),pK.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=eK(90);o=o.map(n=>uK(n,e,t))}const s=R$(o);return s.type="rect",s.fill="black",s}),pK.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}}),pK.add("image",function(e){const t=e.x,n=e.y,r=e.imageSettings||{},i=r.width,o=r.height,s=r.imageSrc,a=r.position;return{type:"image",x:t,y:n,width:i,height:o,src:s,symbol:r.symbol,r:10,cx:0,cy:0,imageScalingFactor:r.imageScalingFactor,imagePosition:a}});const fK=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pK;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!==JY[n]&&"transform"!==n&&(e[n]=t[n])})}(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function mK(){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,s=e.prioOrder,a=void 0===s?0:s,l=e.preferredSize,c=void 0===l?0:l,u=e.minimumLayoutMode,d=e.show,h=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?(a=e,this):"function"==typeof a?a(t):a},minimumLayoutMode(e){return void 0!==e?(u=e,this):"function"==typeof u?u(t):u},show(e){return void 0!==e?(h=e,this):"function"==typeof h?h(t):h}}}function gK(e,t,n){const r=t.require,i=void 0===r?[]:r,o=t.mediator||{},s=n.settings,a=n.formatter,l=n.scale,c=n.data,u=n.renderer,d=n.chart,h=n.dockConfig,p=n.mediator,f=n.instance,m=n.rect,g=n.style,y=n.registries,v=n.resolver,b=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:s}),Object.defineProperty(e,"data",{get:c}),Object.defineProperty(e,"formatter",{get:a}),Object.defineProperty(e,"scale",{get:l}),Object.defineProperty(e,"mediator",{get:p}),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:h}):"instance"===t?Object.defineProperty(e,"instance",{get:f}):"update"===t&&b?Object.defineProperty(e,"update",{get:b}):"resolver"===t?Object.defineProperty(e,"resolver",{get:v}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:w})}),Object.keys(o).forEach(t=>{e.mediator.on(t,o[t].bind(e))})}function yK(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 vK(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 bK(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,s=t.chart,a=t.container,l=t.mediator,c=t.registries,u=t.theme,d=t.renderer,h=hY.mixin({});let p,f,m,g,y,v=t.settings||{},b=m$(!0,{},r,v),x=[],w=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:VY,n={};return{resolve:function(r){let i=r.data,o=r.settings,s=r.defaults,a=void 0===s?{}:s,l=r.scaled;const c=n.norm=t.normalizeSettings(o,a,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:s}),S=!1;const C={nodes:[],chart:s,config:b.brush||{},renderer:null},E={tap:[],over:[]},M=[],k={},I=m$({},v);function R(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!==v[t];let s;for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return i&&("function"==typeof e[t]?s=e[t].call(k,...l):r&&(s=e[t])),o&&("function"==typeof v[t]?s=v[t].call(I,...l):r&&(s=v[t])),i||o||(s=n.call(k,...l)),s}}const _=R("preferredSize",()=>0,!0),D=R("resize",e=>e.inner),A=R("created"),P=R("beforeMount"),L=R("mounted"),T=R("beforeUnmount"),O=R("beforeUpdate"),q=R("updated"),N=R("beforeRender"),j=R("beforeDestroy"),z=R("destroyed"),F=e.render,W=()=>{b.brush&&(b.brush.consume||[]).forEach(e=>{e.context&&e.style&&M.push(GY(C,e))})},$=()=>{b.brush&&(b.brush.trigger||[]).forEach(e=>{"over"===e.on?E.over.push(e):E.tap.push(e)})};Object.defineProperty(C,"data",{get:()=>x});const B=b.renderer||e.renderer,V=B?d||c.renderer(B)():d||c.renderer()();"function"==typeof V.settings&&V.settings(b.rendererSettings),C.renderer=V;const H={resources:s.logger?{logger:s.logger()}:{}};let G=mK(yK(b,_,s.logger()),H);const U=e=>{e.key=b.key,e.element=V.element()},Y=()=>{};Y.dockConfig=()=>G,Y.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(v=e.settings,b=m$(!0,{},r,e.settings),G=mK(yK(b,_,s.logger()),H),C.config=b.brush||{}),b.scale&&(p=s.scale(b.scale)),b.data){const e=b.rendererSettings,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=SG(b.data,{dataset:s.dataset,collection:s.dataCollection},{logger:s.logger()},s.dataCollection);t?t.isFirst?(x=n,x.items&&(x.items=[...n.items])):x.items&&(x.items=[...x.items,...n.items||[]]):x=n}else x=p?p.data():[];"string"==typeof b.formatter||"object"==typeof b.formatter?f=s.formatter(b.formatter):p&&p.data().fields&&(f=p.data().fields[0].formatter()),y=u.style(b.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=D({inner:e,outer:t});g=n?V.size(n):V.size(e),I.rect=m$(!0,{computedPhysical:g.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),g=m$(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},g)},Y.getRect=()=>I.rect;const K=()=>{const e=V.renderArgs?V.renderArgs.slice(0):[],t=b.rendererSettings;let n=x;const r="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return x.items&&r&&(n=x$(x$({},x),{},{items:x.items.slice(r.start,r.end)})),e.push({data:n}),e};let X,J,Z;function Q(e){const t=b.rendererSettings,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?C.nodes=[...e||[]]:C.nodes&&(C.nodes=[...C.nodes,...e||[]]):C.nodes=e}Y.beforeMount=P,Y.beforeRender=()=>{N({size:g})},Y.render=()=>{const e=F.call(k,...K());Q(e),V.render(e),X=e,J=I.rect.computed},Y.hide=()=>{Y.unmount(),V.size({x:0,y:0,width:0,height:0}),V.clear()},Y.beforeUpdate=()=>{O({settings:b,data:x})},Y.update=()=>{Z&&Z.stop();const e=b,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(k,...K());Q(i),M.forEach(e=>e.cleanUp()),M.length=0,E.tap=[],E.over=[],n&&(W(),$()),M.forEach(e=>{e.isActive()&&e.update()}),X&&r&&("function"==typeof r.enabled?r.enabled():r.enabled)?(r.compensateForLayoutChanges&&r.compensateForLayoutChanges({currentNodes:X,currentRect:I.rect.computed,previousRect:J}),Z=function(e,t,n,r){let i,o=e.old,s=e.current,a=t.renderer,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},d={nodes:[],ips:[]},h=[],p=null;const f=n.trackBy||jY,m={start(){let e={};if(o.forEach((t,n)=>{let r=f(t,n);e[r]=t}),s.forEach((t,n)=>{let r=f(t,n);if(e[r]){if("path"===t.type&&t.points&&t.points.length>0&&"trend"!==t.data.source.key){const n=function(e,t){const n=e.points.filter(e=>!e.dummy),r=t.points.filter(e=>!e.dummy),i=r.map(e=>e.data.major.value),o=n.filter(e=>i.includes(e.data.major.value)).map(e=>e.data.major.value),s=n.filter(e=>o.includes(e.data.major.value)),a=r.filter(e=>o.includes(e.data.major.value));return{old:s,current:a}}(e[r],t);d.ips.push(NY(m$({},e[r],{points:n.old}),m$({},t,{points:n.current}))),l.push(m$({},e[r],{commonPoints:n.old}))}else d.ips.push(NY(e[r],t)),l.push(e[r]);d.nodes.push(t),e[r]=!1}else c.nodes.push(t),c.ips.push(NY(m$({},t,{r:.001,opacity:0}),t))}),Object.keys(e).forEach(t=>{e[t]&&(u.nodes.push(e[t]),u.ips.push(NY(e[t],m$({},e[t],{r:1e-4,opacity:0}))))}),h.push({name:"exiting",easing:AY,duration:200,tweens:u.ips,nodes:[...l]}),h.push({name:"updating",easing:LY,duration:400,tweens:d.ips,nodes:[]}),h.push({name:"entering",easing:PY,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"),s=o.isInit,a=o.shouldBeRemoved;!1===s?(r.setValue("animations.updatingStageMeta.shouldBeRemoved",0===i),r.setValue("animations.updatingStageMeta.isInit",!0)):r.setValue("animations.updatingStageMeta.shouldBeRemoved",a&&0===i)}h.length&&(p=a.getScene(s),h[0].started=Date.now(),"undefined"!=typeof window&&(i=window.requestAnimationFrame(m.tick)))},tick(){let e=h[0];e||m.stop(),e.started||(e.started=Date.now());let t=(Date.now()-e.started)/e.duration,o=[],s=e.tweens.map(n=>n(e.easing(Math.min(1,t))));const l=n.adjustTweenedNodes;if(l&&l(s),o.push(...s),o.push(...e.nodes),a.render(o),t>=1){h.shift();const e=r.getValue("animations.updatingStageMeta"),t=e.isInit,n=e.shouldBeRemoved;h.length?"updating"===h[0].name&&n&&h.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 p}};return m}({old:X,current:i},{renderer:V},r,s.storage),Z.start()):V.render(i),X=i,J=I.rect.computed,V.setKey&&"string"==typeof v.key&&V.setKey(v.key)},Y.updated=q,Y.destroy=()=>{Y.unmount(),j(m),V.destroy(),z(),m=null};const ee=e=>{C.nodes=e,M.forEach(e=>{e.isActive()&&e.update()}),V.render(e)};return gK(k,e,{settings:()=>b,data:()=>x,scale:()=>p,formatter:()=>f,renderer:()=>V,chart:()=>s,dockConfig:()=>G,mediator:()=>l,instance:()=>I,rect:()=>I.rect,style:()=>y,update:()=>ee,registries:()=>c,resolver:()=>w,symbol:()=>fK(c.symbol)}),gK(I,v,{settings:()=>b,data:()=>x,scale:()=>p,formatter:()=>f,renderer:()=>V,chart:()=>s,dockConfig:()=>G,mediator:()=>l,style:()=>y,_DO_NOT_USE_getInfo:o.bind(k),isVisible:()=>S}),Y.getBrushedShapes=function(e,t,n){const r=[];if(b.brush&&b.brush.consume){const i=s.brush(e),o=V.findShapes("*");b.brush.consume.filter(t=>t.context===e).forEach(e=>{for(let s=0;s<o.length;s++){const a=o[s];a.data&&i.containsMappedData(a.data,n||e.data,t)&&(U(a),r.push(a),o.splice(s,1),s--)}})}return r},Y.findShapes=e=>{var t;const n=(null!==(t=Z)&&void 0!==t&&t.inProgress()?Z.targetScene:V).findShapes(e);for(let e=0,t=n.length;e<t;e++)U(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++)U(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:[];UY({nodes:e,action:t.action||"toggle",trigger:t,chart:s,data:C.data})},Y.mount=()=>{m=V.element&&V.element()?m:V.appendTo(a),V.setKey&&"string"==typeof v.key&&V.setKey(v.key),b.brush&&(W(),$()),vK(I,h,v),vK(k,h,e),S=!0},Y.mounted=()=>L(m),Y.unmount=()=>{[I,k].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,h)}),E.tap=[],E.over=[],M.forEach(e=>{e.cleanUp()}),M.length=0,T(),S=!1},Y.onBrushTap=e=>{E.tap.forEach(t=>{(function(e){let t=e.e,n=e.t,r=e.config;return YY({collisions:KY(t,n,r.renderer),t:n,config:r,action:XY(n.action,t,"toggle")})})({e:e,t:t,config:C})&&"stop"===t.globalPropagation&&s.toggleBrushing(!0)})},Y.onBrushOver=e=>{E.over.forEach(t=>{(function(e){let t=e.e,n=e.t,r=e.config;return YY({collisions:KY(t,n,r.renderer),t:n,config:r,action:XY(n.action,t,"set")})})({e:e,t:t,config:C})&&"stop"===t.globalPropagation&&s.toggleBrushing(!0)})},Y.def=k,Y.ctx=I,Y.renderer=()=>V,Y.set({settings:v}),A(),Y}const xK=["__proto__","constructor","prototype"];function wK(e){const t=m$(!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(xK.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 SK(e,t,n){const r=nK(function(e,t){const n=cK(e,t)/cK(t,t)||1;return{x:t.x*n,y:t.y*n}}(rK(n,e),rK(t,e)),e);return r}function CK(e,t,n){return lK(e,n)+lK(t,n)-lK(e,t)<1e-12}function EK(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 MK(e){return e.x1===e.x2&&e.y1===e.y2}function kK(e){return e.width<=0||e.height<=0}function IK(e){return e.r<=0}function RK(e){return e.edges.length<=2}function _K(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=qK(e,_$(t.edges[r])),!0===n)return!0;return!1}function DK(e,t){let n=!1;const r=t.numPolygons,i=t.polygons;for(let t=0;t<r;t++){if(n=HK(e,i[t]),!0===n)return!0}return!1}function AK(e,t){if(IK(e))return!1;return aK({x:e.cx,y:e.cy},t)<=e.r**2}function PK(e,t){if(kK(t)||IK(e))return!1;const n=t.width/2,r=t.height/2,i=t.x+n,o=t.y+r,s=e.r,a=e.cx,l=e.cy,c=Math.abs(a-i),u=Math.abs(l-o);if(c>n+s||u>r+s)return!1;if(c<=n||u<=r)return!0;return(c-n)**2+(u-r)**2<=s**2}function LK(e,t){if(IK(e)||MK(t))return!1;const n=w$(k$(t),2),r=n[0],i=n[1];if(AK(e,r)||AK(e,i))return!0;const o={x:e.cx,y:e.cy},s=SK(r,i,o);return aK(s,o)<=e.r**2&&CK(r,i,s)}function TK(e,t){if(RK(t)||IK(e))return!1;if(OK(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let r=0;r<n;r++){if(LK(e,_$(t.edges[r])))return!0}return!1}function OK(e,t){if(RK(e)||!FK(e.boundingRect(),t))return!1;const n=t.x,r=t.y,i=e.vertices;let o,s,a,l,c;for(o=!1,l=-1,s=i.length,a=s-1;++l<s;a=l){if(i[l].x===n&&i[l].y===r)return!0;if(i[l].y===i[a].y&&i[l].y===r&&(n-i[l].x)*(n-i[a].x)<=0)return!0;if(i[l].y<r&&r<=i[a].y||i[a].y<r&&r<=i[l].y){if(c=(i[a].x-i[l].x)*(r-i[l].y)/(i[a].y-i[l].y)+i[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function qK(e,t){if(RK(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if($K(t,_$(e.edges[n])))return!0}const n=w$(k$(t),2),r=n[0],i=n[1];return OK(e,r)||OK(e,i)}function NK(e,t){if(RK(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(WK(t,_$(e.edges[n])))return!0}const n=w$(I$(t),4),r=n[0],i=n[1],o=n[2],s=n[3];return OK(e,r)||OK(e,i)||OK(e,o)||OK(e,s)}function jK(e,t){return!kK(e)&&!kK(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 zK(e,t){if(kK(e)||kK(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=>FK(e,t))}function FK(e,t){return!kK(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function WK(e,t){if(MK(t)||kK(e))return!1;const n=w$(k$(t),2),r=n[0],i=n[1];if(FK(e,r)||FK(e,i))return!0;const o=I$(e);let s=o.length;for(let e=0;e<s;e++){if($K(_$([o[e],o[3!==e?e+1:0]]),t))return!0}return!1}function $K(e,t){const n=w$(k$(e),2),r=n[0],i=n[1],o=w$(k$(t),2),s=o[0],a=o[1],l=oK(i,r),c=sK(i,r),u=oK(a,s),d=sK(a,s),h=oK(r,s),p=sK(r,s);let f=d*l-u*c;const m=u*p-d*h,g=l*p-c*h;let y,v;if(0===l&&0===c)return!1;if(0===u&&0===d)return!1;if(0===f){if(0===m&&0===g){if(0===l){if(0===c)return r.x===i.x&&r.y===i.y;y=sK(s,r)/c,v=sK(a,r)/c}else y=(s.x-r.x)/l,v=(a.x-r.x)/l;return!(y<0&&v<0||y>1&&v>1)}return!1}const b=m/f;return f=g/f,b>=0&&b<=1&&f>=0&&f<=1}function BK(e,t){if(MK(e))return!1;const n=w$(k$(e),2);return CK(n[0],n[1],t)}function VK(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!jK(n,r)&&(zK(n,r)?_K(e,t):_K(t,e))}function HK(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!jK(n,r)&&(zK(r,n)?function(e,t){let n=!1;const r=e.numPolygons,i=e.polygons;for(let e=0;e<r;e++)if(n=VK(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=YK(e,_$(t.edges[r])),!0===n)return!0;return!1}(e,t))}function GK(e,t){if(IK(e))return!1;if(UK(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(LK(e,_$(n.edges[t])))return!0}}return!1}function UK(e,t){if(!FK(e.boundingRect(),t))return!1;const n=t.x,r=t.y,i=e.numPolygons;let o,s,a,l,c,u,d=!1;for(s=0;s<i;s++)for(o=e.vertices[s],c=-1,a=o.length,l=a-1;++c<a;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 YK(e,t){const n=w$(k$(t),2),r=n[0],i=n[1];if(UK(e,r)||UK(e,i))return!0;const o=e.numPolygons,s=e.polygons;for(let e=0;e<o;e++){const n=s[e];for(let e=0,r=n.edges.length;e<r;e++){if($K(t,_$(n.edges[e])))return!0}}return!1}function KK(e,t){const n=w$(I$(t),4),r=n[0],i=n[1],o=n[2],s=n[3];if(UK(e,r)||UK(e,i)||UK(e,o)||UK(e,s))return!0;const a=e.numPolygons,l=e.polygons;for(let e=0;e<a;e++){const n=l[e];for(let e=0,r=n.edges.length;e<r;e++){if(WK(t,_$(n.edges[e])))return!0}}return!1}const XK=/^\$/,JK="@extend";function ZK(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function QK(e,t,n){if("string"==typeof e){let r=t[e];return-1!==n.indexOf(e)&&ZK(e),XK.test(r)?(n.push(e),QK(r,t,n)):r}let r=e;const i=m$(!0,{},t,e),o={};if(e[JK]){const o=e[JK];-1!==n.indexOf(o)&&ZK(o);let s=n.slice();s.push(o),r=m$(!0,{},QK(i[o],t,s),e)}return Object.keys(r).forEach(e=>{let t=n.slice();if(e===JK||XK.test(e))return;o[e]=r[e];let s=o[e];XK.test(s)&&s in i?(-1!==n.indexOf(s)&&ZK(s),t.push(s),s=i[s],"object"==typeof s||XK.test(s)&&s in i?o[e]=QK(s,i,t):o[e]=s):"object"==typeof s&&(o[e]=QK(s,i,t))}),o}function eX(e,t){return QK(e,t,[])}function tX(){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=>eX(e,n),setStyle:t=>{n=m$({},e,t)}};return r(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),i}function nX(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 rX(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return m$(!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 iX(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 oX(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 sX(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 aX(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 lX(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 cX(e,t,n,r,i){const o=m$({},t),s=m$({},n);sX(o,r),aX(s,r),lX(e,o,s);const a=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!!a&&(sX(t,r),aX(n,r),!0)}function uX(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 dX(e){return R$([].concat(...e.map(I$)))}function hX(e){let t=e.visible,n=e.layoutRect,r=e.reducedRect,i=e.containerRect,o=e.translation;const s=iX(r.x,r.y,r.width,r.height),a=iX(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=s.width,t.x=n.x,c.x=s.x,t.y=c.y=s.y-e.cachedSize,s.y-=e.cachedSize,s.height+=e.cachedSize;break;case"bottom":t.x=n.x,c.x=s.x,t.y=c.y=s.y+s.height,t.width=n.width,c.width=s.width,t.height=c.height=e.cachedSize,s.height+=e.cachedSize;break;case"left":t.x=c.x=a.x-e.cachedSize,t.y=n.y,c.y=a.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=a.height,a.x-=e.cachedSize,a.width+=e.cachedSize;break;case"right":t.x=c.x=a.x+a.width,t.y=n.y,c.y=a.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=a.height,a.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=dX(n.map(e=>e.outerRect)),c=dX(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 s=e?"height":"width",a=(r[s]-n[s]*i.x)*n.align;o.left=e?0:a,o.top=e?a: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=uX(c),t.edgeBleed=e.edgeBleed,t.computed=uX(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 pX(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 fX(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 mX(e){let t=rX(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),nX(r),nX(n),{logicalContainerRect:r,containerRect:n}}(e,t),i=r.logicalContainerRect,o=r.containerRect,s=function(e,t,n){const r=[],i=[];for(let o=0;o<e.length;++o){const s=e[o];fX(s);let a=s.dockConfig;const l=s.key,c=a.dock(),u=/@/.test(c)?c.split(",").map(e=>e.replace(/^\s*@/,"")):[];pX(t,a,n)?r.push({comp:s,key:l,config:a,referencedDocks:u}):i.push({comp:s,key:l,config:a,referencedDocks:u})}return[r,i]}(n,t,i),a=w$(s,2),l=a[0],c=a[1],u=function(e){let t=e.layoutRect,n=e.visible,r=e.hidden,i=e.settings;const o=iX(t.x,t.y,t.width,t.height),s={left:0,right:0,top:0,bottom:0},a=n.slice();a.sort((e,t)=>e.config.prioOrder()-t.config.prioOrder());for(let e=0;e<a.length;++e){const n=a[e];oX(n,o,t),cX(t,o,s,n,i)||(r.push(a.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!==a.indexOf(e));return n.length=0,n.push(...l),lX(t,o,s),o}({layoutRect:i,visible:l,hidden:c,settings:t}),d=hX({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=iX();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=rX(e)},n}const gX=(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},yX=e=>null==e?void 0:e.map(e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(x$(x$({},n),{},{children:yX(e.children)}))}}),vX=(e,t)=>({visible:[],hidden:t,ordered:[]}),bX=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(x$(x$({},t),{},{children:yX(e.children)}))}}),o=e=>n[e.index],s=null!==(r=e(t,i))&&void 0!==r?r:{},a=s.visible,l=void 0===a?i:a,c=s.hidden,u=void 0===c?[]:c,d=s.ordered,h=void 0===d?l:d;return{visible:l.map(o),hidden:u.map(o),ordered:h.map(o)}},xX=e=>"function"==typeof e?bX(e):(e=>{const t=mX(e);return bX((e,n)=>t.layout(e,n))})(e);function wX(e,t,n){const r=t.left-n.left,i=t.top-n.top,o=D$(e),s=m$(!0,{},e);switch(o){case"circle":s.cx+=r,s.cy+=i;break;case"polygon":for(let e=0,t=s.vertices.length;e<t;e++){const t=s.vertices[e];t.x+=r,t.y+=i}break;case"geopolygon":for(let e=0;e<s.vertices.length;e++){const t=s.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":s.x1+=r,s.y1+=i,s.x2+=r,s.y2+=i;break;case"point":case"rect":s.x+=r,s.y+=i}return s}function SX(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 CX(e,t){let n=e.element,r=e.data,i=void 0===r?[]:r,o=e.settings,s=void 0===o?{}:o,a=e.on,l=void 0===a?{}:a;const c=t.registries,u=t.logger,d=tX(t.style,t.palettes),h=[],p=m$({},e),f=function(){const e={};return hY.mixin(e),e}();let m=[],g=null,y=null,v=null,b=[],x=()=>{},w=()=>{};const S={};let C=!1;const E=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},s=e=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)},a=(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&&a(r.children,i.components):(e.splice(n,1),s(r),r.children&&a(r.children,[]),r.instance.destroy())}},l=e=>{let t=e.compList,n=e.data,r=e.excludeFromUpdate,i=e.formatters,s=e.scales;return e.settingsList.map(e=>{const a=gX(t,e.key);return r.indexOf(e.key)>-1?(delete a.updateWith,a):a?(e.rendererSettings&&"function"==typeof a.instance.renderer().settings&&a.instance.renderer().settings(e.rendererSettings),e.rendererSettings&&"function"==typeof e.rendererSettings.transform&&e.rendererSettings.transform()?(a.applyTransform=!0,a):(a.updateWith={formatters:i,scales:s,data:n,settings:e},e.components&&(a.children=l({compList:a.children||[],data:n,excludeFromUpdate:r,formatters:i,scales:s,settingsList:e.components})),a)):o(e)}).filter(e=>!!e)},c=e=>{let t=e.components,n=e.hidden,r=e.layoutFn,i=e.ordered,o=e.rect,s=e.visible;const a=r(o,t),l=a.visible,u=a.hidden,d=a.ordered;s.push(...l),n.push(...u),i.push(...d),l.forEach(e=>{if(e.children){var t,r;const o=xX(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:s})}}),u.forEach(e=>{e.children&&c({components:e.children,hidden:n,layoutFn:vX,ordered:i,rect:null,visible:s})})};return n.destroy=()=>{r.forEach(e=>e.instance.destroy()),r=[],i=[]},n.findComponentByKey=e=>gX(r,e),n.forEach=e=>{r.forEach(e)},n.layout=e=>{let t=e.layoutSettings,n=e.rect;const r=[],o=[],s=[],a=xX(t);return c({components:i,hidden:o,layoutFn:a,ordered:s,rect:n,visible:r}),{visible:r,hidden:o,ordered:s}},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,s=e.scales;a(i,t),i=l({compList:i,data:n,excludeFromUpdate:r,formatters:o,scales:s,settingsList:t})},n}({createComponent:e=>{if(!c.component.has(e.type))return u.warn("Unknown component: ".concat(e.type)),!1;return{instance:bK(c.component(e.type),{settings:e,chart:p,mediator:f,registries:c,theme:d,container:n}),settings:m$(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function M(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,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i=r?e[t].call(p,...s):n.call(p,...s),i}}const k=()=>{let e;s.dockLayout?(u.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=s.dockLayout):e=s.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 E.layout({layoutSettings:e,rect:t})},I=M("created"),R=M("beforeMount"),_=M("mounted"),D=M("beforeUpdate"),A=M("updated"),P=M("beforeRender"),L=M("beforeDestroy"),T=M("destroyed"),O=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,s=void 0===o?{}:o,a=t.scroll,l=void 0===a?{}:a;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 s=o({key:n,data:e.data,config:e.config});i[n]=s}}),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]:SG;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=m$(r,{fields:e}))}return r}}(t.collections,{dataset:x},{logger:u});const h={theme:d,logger:u};g=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:lY;const i={};return{get(o){let s;return"string"==typeof o&&e[o]?s=o:"object"==typeof o&&"scale"in o&&e[o.scale]&&(s=o.scale),s?(i[s]=i[s]||r(e[s],t,n),i[s]):r(o,t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(s,{dataset:x,collection:w},x$(x$({},h),{},{scale:c.scale})),y=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:CG;const i={};return{get(o){let s;return"string"==typeof o&&e[o]?s=o:"object"==typeof o&&"formatter"in o&&e[o.formatter]?s=o.formatter:"object"==typeof o&&"type"in o&&e[o.type]&&(s=o.type),s?(i[s]=i[s]||r(e[s],t,n),i[s]):r(o||{},t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(i,{dataset:x,collection:w},x$(x$({},h),{},{formatter:c.formatter})),v=function(e,t){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=fY(e[r],t?t[r]:null));return n}(l,v)};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);b.forEach(e=>{e.key&&-1!==r.indexOf(e.key)?t[e.key]=e:e.destroy()}),b=e.map(e=>{const r=e.key&&t[e.key]?t[e.key]:c.interaction(e.type)(p,f,n);return r.set(e),r})}const N=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},s=[];return m.forEach(e=>{const t=e.instance.getRect();FK(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)&&s.push(e)}),s},j=()=>{if(h.length||!n)return;Object.keys(l).forEach(e=>{const t=l[e].bind(p);n.addEventListener(e,t),h.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=N(e)},r=t=>{const n=e.comps||N(t);if(!n.every(e=>e.instance.def.disableTriggers)&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=S$(e),r=n?e.changedTouches[0]:e,i=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(r.clientX-t.x),s=isNaN(t.y)?0:Math.abs(r.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&s<=12&&i<=300}(t,e)))for(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),C){C=!1;break}}},i=[];i.push({key:"mousedown",listener:t}),i.push({key:"mouseup",listener:r}),function(e){return"ontouchstart"in e&&"ontouchend"in e||navigator.maxTouchPoints>1}(n)&&(i.push({key:"touchstart",listener:t}),i.push({key:"touchend",listener:r})),i.push({key:"mousemove",listener:e=>{const t=N(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),C){C=!1;break}}}}),i.forEach(e=>{n.addEventListener(e.key,e.listener),h.push(e)})},z=()=>{h.forEach(e=>{let t=e.key,r=e.listener;return n.removeEventListener(t,r)}),h.length=0},F=()=>{n.innerHTML="",(()=>{const e=s.components,t=void 0===e?[]:e;P(),O(i,s),E.set({components:t});const r=k(),o=r.visible,a=r.hidden,l=r.ordered;m=o,a.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}),SX(n,l)})(),j(),q(s.interactions)};return p.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&&(s=e.settings,q(e.settings.interactions)),D(),O(i,s);const r=s,o=r.formatters,a=r.scales,l=r.components,c=void 0===l?[]:l;E.update({components:c,data:i,excludeFromUpdate:n,formatters:o,scales:a}),E.forEach(e=>{e.updateWith&&e.instance.set(e.updateWith)}),E.forEach(e=>{e.updateWith&&e.instance.beforeUpdate()}),k()},p.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 a;e.data&&(i=e.data),e.settings&&(s=e.settings,q(e.settings.interactions)),D(),O(i,s,{partialData:t});const l=s,c=l.formatters,u=l.scales,d=l.components,h=void 0===d?[]:d;E.update({components:h,data:i,excludeFromUpdate:o,formatters:c,scales:u}),E.forEach(e=>{e.updateWith&&e.instance.set(e.updateWith)}),E.forEach(e=>{e.updateWith&&e.instance.beforeUpdate()});const p=[],f=[];let g;if(t)E.forEach(e=>{(e.updateWith||e.applyTransform)&&e.visible&&p.push(e)}),g=p;else{const e=k(),t=e.visible,n=e.hidden,r=e.ordered;m=t,g=t,a=r,t.forEach(e=>{e.updateWith&&e.visible?p.push(e):f.push(e)}),n.forEach(e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1})}f.forEach(e=>e.instance.beforeMount()),f.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||SX(n,a),f.forEach(e=>e.instance.mounted()),p.forEach(e=>e.instance.updated()),m.forEach(e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1}),A()},p.destroy=()=>{L(),E.destroy(),z(),q(),delete p.update,delete p.destroy,T()},p.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},p.findShapes=e=>{let t=[];return m.forEach(n=>{const r=n.instance.findShapes(e);t=[...t,...r]}),t},p.componentsFromPoint=e=>N(e).map(e=>e.instance.ctx),p.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 s=o[n],a=wX(e,i,s.instance.renderer().element().getBoundingClientRect()),l=s.instance.shapesAt(a,s.opts),c=l.length>0&&"stop"===t.propagation;if(r=[...r,...l],r.length>0&&c)return r}return r},p.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])})}},p.scroll=function(){return function(e,t){return t[e]||(t[e]=pY()),t[e]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",v)},p.dataset=e=>x(e),p.dataCollection=e=>w(e),p.scales=function(){return g.all()},p.formatters=function(){return y.all()},p.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return S[e]||(S[e]=DY()),S[e]},p.scale=function(e){return g.get(e)},p.formatter=function(e){return y.get(e)},p.toggleBrushing=function(e){C=void 0!==e?e:!C},p.component=e=>{const t=E.findComponentByKey(e);return null==t?void 0:t.instance.ctx},p.logger=()=>u,p.theme=()=>d,p.storage=wK({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(p,"interactions",{get:()=>({instances:b,on(){j(),b.forEach(e=>e.on())},off(){z(),b.forEach(e=>e.off())}})}),I(),n&&(R(),F(),_(n),p.element=n),p}const EX=e=>{let t=qB(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var MX=qB();function kX(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 IX=e=>e.filter(e=>"number"==typeof e&&!isNaN(e));const RX=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 s=",";if(n&&n.parse&&n.parse.delimiter)s=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){s=n;break}}else n.test(i)&&(s=n)}}return r.map(e=>e.split(s))})({data:n,config:i})),Array.isArray(o)&&function(e){let t,n=e.source,r=e.data,i=e.cache,o=e.config,s=r;const a=o&&o.parse;Array.isArray(r[0])?a&&!1===a.headers?t=r[0].map((e,t)=>t):(t=r[0],s=r.slice(1)):t=Object.keys(r[0]);const l=!!a&&"function"==typeof a.row&&a.row;let c,u=t;u=a&&"function"==typeof a.fields?a.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<s.length;e++){const t=l?l(s[e],e,u):s[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=IX(t),o=r.length>0,s=o?"measure":"dimension",a=o?Math.min(...r):NaN,l=o?Math.max(...r):NaN;i.fields.push(lG(m$({source:n,key:e,title:u[e].title,values:t,min:a,max:l,type:s},u[e]),{value:u[e].value,label:u[e].label}))}}({data:o,cache:r,source:t,config:i})};function _X(){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=pG(e,t),s=o.props,a=o.main,l=Object.keys(s),c=!!e.trackBy,u=typeof e.trackBy,d={},h=[],p=n.items(),f=[];for(let t=0;t<p.length;t++){const n=p[t];if(a.filter&&!a.filter(n))continue;const r=kX(a,n,{key:i});l.forEach(e=>{const o=s[e];let a=o.field?o.field.items()[t]:n;r[e]=kX(o,a,{key:i})}),c&&gG({cfg:e,itemData:n,obj:r,target:h,tracker:d,trackType:u}),f.push(r)}r=c?[...r,...mG(h,{main:a,propsArr:l,props:s})]:[...r,...f]}}),r}(e,o),hierarchy:()=>null};return RX({key:t,data:n,config:r,cache:i}),o}_X.util={normalizeConfig:pG,collect:mG,track:gG};const DX=qB();DX.default("matrix"),DX("matrix",_X),DX("default",_X);const AX=qB();function PX(e,t,n){return Math.max(e,Math.min(t,n))}function LX(e){let t=e.item,n=e.value,r=e.boxCenter,i=e.rendWidth,o=e.rendHeight,s="x",a="y",l=i,c=o,u=n<.5?90:-90;return e.flipXY&&(s="y",a="x",l=o,c=i,u=n<.5?180:0),(0,e.symbol)(m$({},t.oob,{[s]:r*l,[a]:Math.max(t.oob.size/2,Math.min(n*c,c-t.oob.size/2)),startAngle:u}))}function TX(e){let t=e.item,n=e.boxWidth,r=e.boxPadding,i=e.rendWidth,o=e.rendHeight,s="x",a="y",l="width",c="height",u=i,d=o;e.flipXY&&(s="y",a="x",l="height",c="width",u=o,d=i);const h=function(e){let t=e.start,n=e.end,r=e.minPx,i=void 0===r?.1:r,o=e.maxPx,s=void 0===o?1:o;const a=Math.max(t,n),l=Math.min(t,n),c=PX(-.1,1.2,a),u=PX(-.1,1.2,l),d=c*s-u*s,h=Math.max(i,d),p=(h-d)/2;return{actualDiff:h,startModifier:p,actualLow:u*s-p}}({start:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:d}),p=h.actualDiff,f=h.actualLow;return m$({},t.box,{type:"rect",[s]:(r+t.major)*u,[a]:f,[c]:p,[l]:n*u,data:t.data||{},collider:{type:null}})}function OX(e){let t=e.item,n=e.from,r=e.to,i=e.boxCenter,o=e.rendWidth,s=e.rendHeight,a="x1",l="y1",c="x2",u="y2",d=o,h=s;return e.flipXY&&(a="y1",l="x1",c="y2",u="x2",d=s,h=o),m$({},t.line,{type:"line",[u]:Math.floor(n*h),[a]:i*d,[l]:Math.floor(r*h),[c]:i*d,data:t.data||{},collider:{type:null}})}function qX(e){let t=e.item,n=e.key,r=e.position,i=e.width,o=e.boxCenter,s=e.rendWidth,a=e.rendHeight,l="x1",c="y1",u="x2",d="y2",h=s,p=a;e.flipXY&&(l="y1",c="x1",u="y2",d="x2",h=a,p=s);const f=i/2;return m$({type:"line"},t[n],{[c]:Math.floor(r*p),[l]:(o-f)*h,[d]:Math.floor(r*p),[u]:(o+f)*h,r:f*h,cx:o*h,cy:r*p,width:i*h,data:t.data||{},collider:{type:null}})}function NX(e,t,n){const r=t.box,i=r.width,o=r.maxWidthPx,s=r.minWidthPx,a=e>=0?1:-1;let l=Math.min(a*e*i,isNaN(o)?n:o/n);return l=isNaN(s)?l:Math.max(s/n,l),l*a}AX("native",function(e,t,n){let r,i,o={chart:e,mediator:t,element:n},s=[],a=!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),s.push({key:e,listener:t})})}function c(){s.forEach(e=>{let t=e.key,r=e.listener;n.removeEventListener(t,r)}),s=[]}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(),a&&l()},off(){a=!1,c()},on(){a=!0,0===s.length&&l()},destroy(){c(),o=null,r=null}}});const jX={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}},zX=Object.keys(jX),FX={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,s=this.style,a=this.resolver,l=this.symbol,c=zX.filter(e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show),u={};c.forEach(e=>u[e]=jX[e]);const d=function(e){let t=e.keys,n=e.data,r=e.defaultSettings,i=e.style,o=e.settings,s=e.width,a=e.height,l=e.resolver;const c=m$(!0,{},r||{},i||{}),u={major:"horizontal"===o.orientation?a:s,minor:"horizontal"===o.orientation?s:a},d=o.major;let h;h="object"==typeof d&&"object"==typeof d.ref&&void 0!==d.ref.start&&void 0!==d.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:m$(!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:m$(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:u,defaults:{major:.5},settings:{major:o.major}});const p=o.minor||{},f={};["start","end","min","max","med"].forEach(e=>{(p[e]||n.items&&n.items.length&&n.items[0][e])&&(f[e]={scale:p.scale,ref:e})});let m,g={major:h,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:m$(!0,{},f,p)})};for(let e=0,r=t.length;e<r;e++)o[m]&&!1===o[m].show||(m=t[e],g[m]=l.resolve({data:n,defaults:c[m],settings:o[m],scaled:u}));return g}({keys:c,data:t,defaultSettings:u,style:s,settings:this.settings.settings,width:r,height:i,resolver:a});d.settings,d.items;const h=function(e){let t=e.width,n=e.height,r=e.flipXY,i=e.resolved,o=e.keys,s=e.symbol;const a=[],l=i.major.items;if(!l.length)return a;const c=t,u=n,d=r?n:t,h=i.major.settings,p=["start","end","min","max","med"].filter(e=>void 0!==i.minor.settings[e]),f=p.length,m=o.filter(e=>"oob"!==e);let g,y,v,b,x,w,S,C,E;const M=o?o.length:0,k=m?m.length:0;function I(){S?g.push(LX({item:v,value:0,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:s})):C&&g.push(LX({item:v,value:1,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:s}))}const R={box:function(){v.box&&C$(v.start)&&C$(v.end)&&g.push(TX({item:v,boxWidth:b,boxPadding:x,rendWidth:c,rendHeight:u,flipXY:r}))},line:function(){C$(v.min)&&C$(v.start)&&g.push(OX({item:v,from:v.min,to:v.start,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),C$(v.max)&&C$(v.end)&&g.push(OX({item:v,from:v.max,to:v.end,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},median:function(){v.median&&C$(v.med)&&g.push(qX({item:v,key:"median",position:v.med,width:b,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},whisker:function(){if(v.whisker){const e=b*v.whisker.width;C$(v.min)&&g.push(qX({item:v,key:"whisker",position:v.min,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),C$(v.max)&&g.push(qX({item:v,key:"whisker",position:v.max,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))}}};function _(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let r=0;r<f;r++)e=v[p[r]],C$(e)&&(t<e&&(t=e),n>e&&(n=e));S=t<0&&t!==-Number.MAX_VALUE,C=n>1&&n!==Number.MAX_VALUE,E=S||C}for(let e=0,t=l.length;e<t;e++){g=[],y=null;const t=l[e],n=t.data;let r=null,s=null;void 0!==h.binStart?(r=t.binStart,s=t.binEnd,y=h.binStart.scale):(y=h.major.scale,r=y?t.major:0);let c=0;y?y.bandwidth?(c=y.bandwidth(),r-=c/2):c=s-r:c=1,v=m$({},{major:r,majorEnd:s},i.minor.items[e]);for(let t=0;t<M;t++)v[o[t]]=i[o[t]].items[e];if(b=NX(c,v,d),x=(c-b)/2,w=x+v.major+b/2,_(),E)v.oob&&I();else for(let e=0;e<k;e++)v[m[e]]&&!1===v[m[e]].show||R[m[e]]();const u={type:"container",data:n,collider:{type:"bounds"},children:g};a.push(u)}return a}({width:r,height:i,flipXY:o,resolved:d,keys:c,symbol:l});return h}};const WX={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},$X=/px$/,BX={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},VX={imageSrc:void 0,imageScalingFactor:void 0,position:"center-center",symbol:"rectangle",width:void 0,height:void 0},HX={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function GX(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 UX(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,s=$X.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);E$(s)&&(t=WX,s=n.min+t.size*(n.max-n.min));const a=function(e){let t=BX.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=w$(a,2),c=l[0],u=x$(x$({},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,s)),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 YX={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:m$({},BX,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,s=m$({},HX,this.settings.settings.sizeLimits),a=n.items;a.length>0&&"image"===a[0].shape&&t.items.forEach((e,t)=>{a[t].imageSettings=m$({},VX,this.settings.settings.imageSettings)});const l=function(e,t,n,r,i){const o=GX(e?e.scale:void 0,n),s=GX(t?t.scale:void 0,r);let a=Math.min(o.value*i[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],s.value*i[s.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*i[o.isBandwidth?"minRelDiscrete":"minRelExtent"],s.value*i[s.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(a)),maxGlobal:i.maxPx,minGlobal:i.minPx}}(n.settings.x,n.settings.y,i,o,s);return UX(a,this.rect,l,this.settings.shapeFn||this.symbol)}};const KX={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function XX(e,t,n,r){let i=t.x,o=t.y,s=t.width,a=t.height;const l=iB(),c={x:i+s/2,y:o+a/2},u=Math.min(s,a)/2,d=Math.min(s,a)/2,h=d/100;return e.map((e,t)=>{const i=n[t];i.type="path";const o=d*i.outerRadius,s=u*i.innerRadius,a=h*i.cornerRadius;l.innerRadius(s),l.outerRadius(o),l.cornerRadius(a),i.arcDatum=e;const p=l.centroid(e),f=i.offset?function(e,t,n,r){let i=w$(e,2),o=i[0],s=i[1];const a=Math.sqrt(o*o+s*s);o/=a,s/=a;const l=n-r;return{x:o*t*l,y:s*t*l}}(p,i.offset,o,s):{x:0,y:0};return i.transform="translate(".concat(f.x,", ").concat(f.y,") translate(").concat(c.x,", ").concat(c.y,")"),i.desc={share:e.value/r,slice:{start:e.startAngle,end:e.endAngle,innerRadius:s,outerRadius:o,cornerRadius:a,offset:{x:c.x+f.x,y:c.y+f.y}}},i})}function JX(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const ZX={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:m$({},KX,this.style.slice),settings:i.slice}).items;let s=0;for(let e=0,t=o.length;e<t;e++){const t=JX(i,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),r.push(o[e]),s+=t)}const a=function(){var e=hB,t=dB,n=null,r=P$(0),i=P$(B$),o=P$(0);function s(s){var a,l,c,u,d,h=(s=oB(s)).length,p=0,f=new Array(h),m=new Array(h),g=+r.apply(this,arguments),y=Math.min(B$,Math.max(-B$,i.apply(this,arguments)-g)),v=Math.min(Math.abs(y)/h,o.apply(this,arguments)),b=v*(y<0?-1:1);for(a=0;a<h;++a)(d=m[f[a]=a]=+e(s[a],a,s))>0&&(p+=d);for(null!=t?f.sort(function(e,n){return t(m[e],m[n])}):null!=n&&f.sort(function(e,t){return n(s[e],s[t])}),a=0,c=p?(y-h*b)/p:0;a<h;++a,g=u)l=f[a],u=g+((d=m[l])>0?d*c:0)+b,m[l]={data:s[l],index:a,value:d,startAngle:g,endAngle:u,padAngle:v};return m}return s.value=function(t){return arguments.length?(e="function"==typeof t?t:P$(+t),s):e},s.sortValues=function(e){return arguments.length?(t=e,n=null,s):t},s.sort=function(e){return arguments.length?(n=e,t=null,s):n},s.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:P$(+e),s):r},s.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:P$(+e),s):i},s.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:P$(+e),s):o},s}().sortValues(null);a.startAngle(i.startAngle),a.endAngle(i.endAngle),a.padAngle(i.padAngle);return XX(a(n),m$({},this.rect,{x:0,y:0}),r,s)}};const QX=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 eJ{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[eJ.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 s=eJ.evaluateKey(o,n),a=this.transposeCoordinate(s,e[o],n);t[s]=a}}return r&&QX(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 tJ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new eJ(...t)}function nJ(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const rJ={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=tJ(),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,$Y(this,"x",this.rect.width),$Y(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=m$({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=m$({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=nJ(this.x,this.rect.width),this.lines.y=nJ(this.y,this.rect.height),this.lines.y=this.lines.y.map(e=>m$(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 iJ(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 oJ(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 sJ(e,t,n){return e<t||e>n}function aJ(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 lJ(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 cJ(e){var t,n;let r=e.chart,i=e.blueprint,o=e.renderer,s=e.p,a=e.settings,l=e.items,c=e.slopeLine,u=!0,d=!1,h=!1,p=!1,f=!1,m=m$(!0,{},a.style.line,s.line||{}),g=m$(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},a.style.label||{},{fill: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:s.valueInfo?s.valueInfo.id:s.value}):i.processItem({type:"line",x1:s.position,y1:0,x2:s.position,y2:1,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:s.flipXY||!1,value:s.valueInfo?s.valueInfo.id:s.value}),s.label&&!1!==s.label.show&&(null==c||!c.slope||0===c.slope)){const e=m$(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},a.style.label||{},{fill:m.stroke},s.label);let t,n={width:0,height:0},c="";t=aJ(s,r),!1!==s.label.showValue&&(t?c=" (".concat(t(s.value),")"):s.scale&&(c=" (".concat(s.value,")"))),c&&(n=o.measureText({text:c,fontFamily:e.fontFamily,fontSize:e.fontSize}));let d=o.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),g={width:d.width+n.width,height:Math.max(d.height,n.height)},y=e.padding,v=lJ(s.flipXY?e.vAlign:e.align),b=lJ(s.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=s.flipXY?w:x,C=s.flipXY?x:w;if(h=i.processItem({fn:t=>{let n=t.width,r=t.height,o=s.position*n-(s.flipXY?w:x)*(1-v);o=s.flipXY?o:Math.max(o,0);return{type:"rect",x:o,y:Math.max(Math.abs(b*r-C*b),0),width:s.flipXY?S:Math.min(S,i.width-o),height:C,stroke:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.background.opacity}},flipXY:s.flipXY||!1}),h.x<-1||h.x+h.width>i.width+1||h.y<-1||h.y+h.height>i.height+1)h=void 0;else{p={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:h.x+y,y:h.y+h.height/2+g.height/3,maxWidth:h.width-2*y-n.width,anchor:"start"},c&&(f={type:"text",text:c||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:p.x+3+(h.width-(n.width+2*y)),y:p.y});for(let e=0,t=l.length;e<t;e++){let t=l[e];"rect"===t.type?jK(h,t)&&(u=!1):"line"===t.type&&s.flipXY===t.flipXY&&WK(h,t)&&(u=!1)}}}if(d&&l.push(d),c&&0!==c.slope&&(!1!==(null===(t=c.label)||void 0===t?void 0:t.show)||!1!==(null===(n=c.label)||void 0===n?void 0:n.showValue))){var y,v,b;let e,t;const n=120;let a=!1!==(null===(y=c.label)||void 0===y?void 0:y.show)?null===(v=c.label)||void 0===v?void 0:v.text:"";if(!1!==(null===(b=c.label)||void 0===b?void 0:b.showValue)){var x;const t=aJ(s,r),n=t?t(c.value):c.value;e="(".concat(c.slope,"x + ").concat(n,")"),a+=null!==(x=c.label)&&void 0!==x&&x.text?" ".concat(e):e}if(a.length>1){var w,S,C;const e=o.measureText({text:a,fontFamily:g.fontFamily,fontSize:g.fontSize});e.width=e.width>n?n:e.width;const s=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===s||c.isRtl?g.padding:3*g.padding,h=void 0!==s||c.slope>0?3*g.padding:g.padding,p=function(e,t,n,r,i,o){let s=0;if(void 0!==n){if(n<.8)return s=e.slope<0||e.isRtl?3*o.padding:2*o.padding,e.isRtl,n*i.width+s;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,s,e,i,g),f=Math.min(d.y1,d.y2);null!==(w=c.label)&&void 0!==w&&w.stroke&&(t={type:"rect",x:c.isRtl?Math.max(p,u)-2:Math.max(p,u)+2,y:Math.abs(Math.max(f,h)-e.height),rx:3,ry:3,width:e.width+g.padding,height:e.height-2,stroke:m.stroke,fill:m.stroke});const y={type:"text",text:a,fill:null!==(S=null===(C=c.label)||void 0===C?void 0:C.stroke)&&void 0!==S?S:m.stroke,opacity:g.opacity,fontFamily:g.fontFamily,fontSize:g.fontSize,x:t?t.x+2:Math.max(p,u)+2,y:t?t.y+e.height-g.padding:Math.abs(Math.max(f,h)-g.padding/2),anchor:"start",title:a,maxWidth:n,width:e.width};(function(e,t,n,r,i){for(let o=0,s=e.length;o<s;o++){const s=e[o];if("text"===(null==s?void 0:s.type)&&Math.abs(s.x-t.x)<Math.max(s.width+r,t.width+r)&&Math.abs(s.y-t.y)<n.height+i)return!0}return!1})(l,y,e,u,h)||(t&&l.push(t),l.push(y))}}u&&h&&p&&(l.push(h,p),f&&l.push(f))}function uJ(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function dJ(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function hJ(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 pJ(e,t){return e&&t&&Math.abs(e.x-t.x)<1e-15&&Math.abs(e.y-t.y)<1e-15}const fJ={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=tJ(),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(dJ).map(e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=hJ(t,e.value);return m$(e,{scale:t,position:n})}return m$(e,{position:e.value})}),this.lines.y=this.lines.y.filter(dJ).map(e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=hJ(t,e.value);return m$(e,{scale:t,position:n,flipXY:!0})}return m$(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(uJ(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(uJ(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(),s=e.max(),a=n.min(),l=n.max();i=x$(x$({},r),{},{x1:void 0,y1:void 0,x2:void 0,y2:void 0});const c=o*r.slope+r.value,u=s*r.slope+r.value,d=(a-r.value)/r.slope,h=(l-r.value)/r.slope;let p=[];sJ(c,a,l)||(p[0]={x:hJ(e,o),y:hJ(n,c)}),sJ(d,o,s)||(p[1]={x:hJ(e,d),y:1}),sJ(u,a,l)||(p[2]={x:hJ(e,s),y:hJ(n,u)}),sJ(h,o,s)||(p[3]={x:hJ(e,h),y:0});const f=p.filter(e=>!!e).length;if(f>2&&function(e){pJ(e[0],e[1])&&(e[1]=void 0),pJ(e[1],e[2])&&(e[2]=void 0),pJ(e[2],e[3])&&(e[3]=void 0),pJ(e[3],e[0])&&(e[3]=void 0)}(p),p=p.filter(e=>!!e),p.length<2)return void t["y".concat(c>l?0:1)].push(uJ(r));i.x1=p[0].x,i.y1=p[0].y,i.x2=p[1].x,i.y2=p[1].y}else i=void 0;cJ({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 s=r.style.oob||{};for(let e=0,r=o.length;e<r;e++){const r=o[e],a=n[r];if(a.length>0){let e=r.charAt(1),n="y"===r.charAt(0),o=s.padding.x+s.width,l=s.padding.y+s.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"===s.type?{type:"path",d:iJ(n?d:u,n?u:d,s.width,c),x:u,y:d,stroke:s.stroke,fill:s.fill,strokeWidth:s.strokeWidth||0}:{type:"circle",cx:u,cy:d,r:s.width,stroke:s.stroke,fill:s.fill,strokeWidth:s.strokeWidth||0,opacity:s.opacity,data:a}},flipXY:n}),d=u.cx||u.x,h=u.cy||u.y;const p=a.map(e=>e.label?"".concat(e.label," (").concat(e.value,")"):"(".concat(e.value,")")),f=p.reduce((e,t,n)=>0===n?t:"".concat(e,"\n\n").concat(t),"");let m={type:"text",text:a.length||"",title:f,x:d-.4*s.width,y:h+.4*s.width,fontFamily:s.text.fontFamily,fontSize:"".concat(1.3*s.width,"px"),stroke:s.text.stroke,fill:s.text.fill,strokeWidth:s.text.strokeWidth||0,opacity:s.text.opacity},g={type:"path",d:oJ(d,h,s.width,c),x:d,y:h,stroke:s.triangle.stroke,fill:s.triangle.fill,strokeWidth:s.triangle.strokeWidth||0,opacity:s.triangle.opacity};i.push(u,m,g)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function mJ(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){m$(e,t.style)}(t,e),t}function gJ(e){return"string"==typeof e||"number"==typeof e?e:"-"}function yJ(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,s="end"===t.anchor&&r<0,a="start"===t.anchor&&r>=0,l=t.boundingRect.y+(a||s?t.boundingRect.height:0),c=[{x:t.x-i,y:l},{x:t.x+i,y:l}].map(e=>uK(e,r,{x:t.x,y:t.y})),u={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},d={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},h=r>=0?[u,d]:[d,u];c.push(...h),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const r=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:r,y:0,width:r<0?n.stepSize+r:n.stepSize,height:n.innerRect.height}}else{const r=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:r,width:n.innerRect.width,height:r<0?n.stepSize+r:n.stepSize}}const r=t.collider;r.x=Math.max(r.x,0),r.y=Math.max(r.y,0);const i=r.x+r.width-(n.outerRect.x+n.outerRect.width);r.width=i>0?r.width-i:r.width;const o=r.y+r.height-(n.outerRect.y+n.outerRect.height);r.height=o>0?r.height-o:r.height}(e,t,n)}function vJ(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 bJ(e,t){var n,r;const i={type:"text",text:gJ(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)+vJ(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)+vJ(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,s=e.x+i;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):s>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,s=e.y+i;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):s>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),yJ(e,i,t),i}function xJ(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){m$(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 wJ(e){return!e.isMinor&&e.position>=0&&e.position<=1}function SJ(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,s=t.map(e=>e.label).map(e=>"".concat(e.slice(0,1)).concat(e.length>1?"…":"")).map(n).map(e=>e.width);for(let e=0;e<t.length;++e){const n=t[e];if(i*o*Math.abs(n.start-n.end)<s[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 CJ(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 EJ(e){let t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,s=e.settings,a=e.state,l=0;const c={left:0,top:0,right:0,bottom:0},u=s.labels,d=u.maxLengthPx,h=u.minLengthPx;if(s.labels.show){const e=s.align,u="top"===e||"bottom"===e,p=u?n.inner.width:n.inner.height,f=o.ticks({settings:s,distance:p,formatter:r}).filter(wJ),m=e=>{const t=i({text:e,fontSize:s.labels.fontSize,fontFamily:s.labels.fontFamily});return t.width=CJ({value:t.width,maxValue:d,minValue:h}),t};if(t&&u&&"auto"===s.labels.mode&&(!function(e){let t=e.majorTicks,n=e.measure,r=e.rect,i=e.state,o=e.settings;const s=o.labels.maxGlyphCount,a="layered"===i.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=r.width;let d=0,h=0;if(isNaN(s))for(let e=0;e<t.length;e++){const r=t[e],i=r.label,o=n(i).width*(i.length>1?l:1);if(h=a*u*Math.abs(r.start-r.end),o+c>h)return!0}else{const e=t.reduce((e,t)=>Math.min(Math.abs(t.start-t.end),e),1/0);if(h=a*u*e,d=n("M").width*l*s,d+c>h)return!0}return!1}({majorTicks:f,measure:m,rect:n.inner,state:a,settings:s})?a.labels.activeMode="horizontal":a.labels.activeMode="tilted"),!s.labels.filterOverlapping&&"tilted"!==a.labels.activeMode&&SJ({rect:n.inner,state:a,majorTicks:f,measure:m,horizontal:u})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let g,y;if("tilted"===a.labels.activeMode){const e=Math.abs(s.labels.tiltAngle)*(Math.PI/180);g=t=>CJ({value:t.width,maxValue:d,minValue:h})*Math.sin(e)+t.height*Math.cos(e)}else g=u?e=>e.height:e=>CJ({value:e.width,maxValue:d,minValue:h});if(u&&"tilted"!==a.labels.activeMode)y=["M"];else if(isNaN(s.labels.maxGlyphCount))y=f.map(e=>e.label);else{let e="";for(let t=0;t<s.labels.maxGlyphCount;t++)e+="M";y=[e]}const v=y.map(m),b=v.map(g),x=Math.max(...b,0);if(l+=x,l+=s.labels.margin,"layered"===a.labels.activeMode&&(l*=2),"tilted"===a.labels.activeMode){const e="bottom"===s.align==s.labels.tiltAngle>=0,t=Math.abs(s.labels.tiltAngle)*(Math.PI/180),r=(x-m("M").height*Math.cos(t))/Math.sin(t),i=e=>Math.min(r,e.width)*Math.cos(t)+e.height,o=(t,r)=>{const i=f[r]?f[r].position:0;return e?t-i*n.inner.width:t-(1-i)*n.inner.width},a=Math.min(s.labels.maxEdgeBleed,Math.max(...v.map(i).map(o),0))+s.paddingEnd;if(c[e?"left":"right"]=a,!s.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 s=Math.abs(o),a=1/(Math.min(r.outer.width-i,r.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(s*(Math.PI/180))/a}({majorTicks:f,measureText:m,rect:n,bleedSize:a,angle:s.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const MJ=(e,t,n)=>e.width*Math.abs(t.position-n.position);function kJ(e){let t=e.layered,n=e.major,r=e.innerRect,i=e.outerRect,o=e.tick,s=e.index;const a=t?2:1,l=n[s-a],c=n[s+a],u=l?MJ(r,o,l)/2-2:1/0,d=c?MJ(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,s=n.width-t.width-o,a=t.width-t.width*r.position+s,l=2*Math.min(i,a),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,s=t.width*r.position+o,a=2*Math.min(i,s),l=0===r.position?t.width/2-2:0;return Math.max(i,a,l)})({innerRect:r,outerRect:i,tick:o,nextWidth:d})}function IJ(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){m$(e,t.style)}(o,e),o}function RJ(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function _J(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,s=t.endAngle,a=t.tickSize,l=s-o;let c=s-e.position*l;c-=Math.PI/2;const u=RJ(r.cx,r.cy,i+a,c),d=RJ(r.cx,r.cy,i,c),h={type:"line",x1:u.x,y1:u.y,x2:d.x,y2:d.y,value:e.value};return function(e,t){const n=x$({},t.style);m$(e,n)}(h,t),h}function DJ(e){return"string"==typeof e||"number"==typeof e?e:"-"}function AJ(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 PJ(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,s=t.endAngle,a=t.tickSize,l=s-o,c=.2;let u,d;u="top"===t.align||"bottom"===t.align?s-e.position*l:o+e.position*l,d=u<-.2&&u>-Math.PI+c?"left":u>.2&&u<Math.PI-c?"right":"center",u-=Math.PI/2;const h=function(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}(r.cx,r.cy,i+a+6,u);let p;p="left"===d?"end":"right"===d?"start":"middle";const f={type:"text",text:DJ(e.label),align:d,x:h.x,y:h.y,maxHeight:t.maxHeight,maxWidth:AJ(t,d,h),anchor:p,baseline:"middle"};return function(e,t){["fill","fontSize","fontFamily"].forEach(n=>{e[n]=t.style[n]})}(f,t),function(e,t){e.boundingRect=t.textBounds(e)}(f,t),function(e,t,n){let r,i;const o=parseFloat(n.fontSize)||0;r=t.y-o/2,i=e.innerRect.height-(t.y+o/2),(r<0||i<0)&&(n.text="")}(t,h,f),f}function LJ(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 TJ(e){let t=0;return t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function OJ(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=LJ(e)+e.labels.margin,t}function qJ(e,t){return e.map(e=>xJ(e,t))}function NJ(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function jJ(e){let t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.scale,o=e.tilted,s=e.layered,a=e.tick;const l=t.height,c=NJ(i,a),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=r.width-OJ(n)-n.paddingEnd;else if(s)u.width=c*r.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(r.height-OJ(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*r.width;return u.width=CJ({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function zJ(e){let t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.outerRect,o=e.tilted,s=e.layered,a=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-OJ(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);d.width=(r.height-OJ(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else d.width=kJ({layered:s,major:c,innerRect:r,outerRect:i,tick:a,index:l});return d.width=CJ({value:d.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),d}function FJ(e){let t;function n(){return t=zJ,n}function r(){return t=jJ,r}function i(e){let n=e.settings,r=e.scale,i=e.innerRect,o=e.outerRect,s=e.measureText,a=e.ticks,l=e.state,c=e.textBounds;const u=[],d=function(e){return e.filter(e=>!e.isMinor)}(a),h=function(e){return e.filter(e=>e.isMinor)}(a),p={innerRect:i,align:n.align,outerRect:o},f="tilted"===l.labels.activeMode,m="layered"===l.labels.activeMode;let g;if(n.arc&&(p.startAngle=n.arc.startAngle,p.endAngle=n.arc.endAngle,p.radius=n.arc.radius),n.line.show&&(p.style=n.line,p.padding=n.paddingStart,n.arc?u.push(IJ(p)):u.push(mJ(p))),n.ticks.show&&(p.style=n.ticks,p.tickSize=n.ticks.tickSize,p.padding=LJ(n),n.arc?(p.padding=TJ(n),g=function(e,t){return e.map(e=>_J(e,t))}(d,p)):g=qJ(d,p)),n.labels.show){const e=OJ(n);p.style=n.labels,p.padding=e,p.tilted=f,p.layered=m,p.angle=n.labels.tiltAngle,p.paddingEnd=n.paddingEnd,p.textBounds=c;const a=(e,a)=>{p.textRect=function(e){let t=e.style;return(0,e.measureText)({text:e.tick.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:s,style:p.style});const l=t({textMetrics:p.textRect,settings:n,innerRect:i,outerRect:o,scale:r,tilted:f,layered:m,tick:e,major:d,index:a});p.maxWidth=l.width,p.maxHeight=l.height,p.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)*NJ(n,i)}({innerRect:i,scale:r,settings:n,tick:e})};let l=[];n.arc?(p.padding=function(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=TJ(e)+e.labels.margin,t}(n),l=function(e,t,n){return e.map((e,r)=>{n(e,r);const i=PJ(e,t);return i.data=e.data,i})}(d,p,a)):l=!m||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map((e,r)=>{n(e,r);const i=bJ(e,t);return i.data=e.data,i})}(d,p,a):function(e,t,n,r){const i=t.padding,o=OJ(n);return e.map((e,s)=>{r(e,s);const a=o+t.maxHeight+n.labels.margin;t.layer=s%2,t.padding=s%2==0?i:a;const l=bJ(e,t);return l.data=e.data,l})}(d,p,n,a),n.labels.filterOverlapping&&function(e,t,n){let r=(t,n)=>jK(A$(1,e[t].boundingRect),A$(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);r=(n,r)=>{const i=1/Math.abs(e[n].x-e[r].x),o=Math.sin(t*(Math.PI/180))/i;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let i=n+1;i<=Math.min(n+5,n+(e.length-1));i++)e[n]&&e[i]&&r(n,i)&&(i===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(i,1),t&&t.splice(i,1)),i--,n--)}(l,g,p),u.push(...l)}return n.minorTicks&&n.minorTicks.show&&h.length>0&&(p.style=n.minorTicks,p.tickSize=n.minorTicks.tickSize,p.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...qJ(h,p))),g&&u.push(...g),u}return n.build=i,r.build=i,e?r():n()}const WJ={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"},$J={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 BJ={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=m$(!0,{},t.isDiscrete?WJ:$J,n),o=m$(!0,{},i,r.settings),s=r.layout.dock||t.defaultDock;o.dock=s,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,s),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const a=o.paddingStart,l=o.paddingEnd;return o.paddingStart="function"==typeof a?a.call(null):a,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=FJ(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=BY(r,i);const o=function(e){let t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,s=e.settings,a=0;const l=EJ({isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:s,state:e.state}),c=l.size,u=l.edgeBleed;if(a+=c,l.isToLarge)return{size:a};if(s.ticks.show&&(a+=s.ticks.margin,a+=s.ticks.tickSize),s.minorTicks&&s.minorTicks.show){const e=s.minorTicks.margin+s.minorTicks.tickSize;e>a&&(a=e)}if(s.line.show){const e=s.line.strokeWidth/2;a+=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}}(s.align)]=Math.ceil(e)}return a+=s.paddingStart,a+=s.paddingEnd,{size:a,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=m$({},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 m$(this.state.innerRect,r),m$(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=BY(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})),QX.multiple(t),t}};const VJ={render:()=>[]};function HJ(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 GJ(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 UJ={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=HJ(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,s=e.style;const a={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:GJ(r,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};m$(a,s.text);const l=o(a);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)),a.x=e,a.y="top"===r?i.height-n.paddingStart:n.paddingStart+l.height,a.dy="top"===r?-l.height/6:-l.height/3,a.maxWidth=.8*i.width}else{let e=i.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=i.height-n.paddingStart),a.y=e,a.x="left"===r?i.width-n.paddingStart:n.paddingStart,a.dx="left"===r?-l.height/3:l.height/3;const t="left"===r?270:90;a.transform="rotate(".concat(t,", ").concat(a.x+a.dx,", ").concat(a.y+a.dy,")"),a.maxWidth=.8*i.height}return isNaN(n.maxLengthPx)||(a.maxWidth=Math.min(a.maxWidth,n.maxLengthPx)),a}({title:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),r},beforeUpdate(e){e.settings&&(m$(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=HJ(t,n,this.scale)}};function YJ(e,t){const n=e.settings.layout.dock,r=e.settings.settings.invert,i="top"===n||"bottom"===n,o=i?"width":"height",s=e.rect[o],a=e.chart.scroll(e.settings.scroll);let l;{let e=t[i?"x":"y"];r&&(e=s-e);const n=a.getState();l={startOffset:e,startScroll:n.start,swipe:!1};const o=e/s*(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=s-t),!l.swipe){if(Math.abs(l.startOffset-t)<=1)return;l.swipe=!0}const n=a.getState(),o=(t-l.startOffset)/s*(n.max-n.min),c=l.startScroll+o;a.moveTo(c)},end:e=>{let t=e[i?"x":"y"];r&&(t=s-t);const n=a.getState();if(l.swipe){const e=(t-l.startOffset)/s*(n.max-n.min),r=l.startScroll+e;a.moveTo(r)}else{const e=t/s*(n.max-n.min)+n.min-n.viewSize/2;a.moveTo(e)}}}}function KJ(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const XJ={require:["chart","renderer"],on:{panStart(e){const t=KJ(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=YJ(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=KJ(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=KJ(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=KJ(e,this.renderer);YJ(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],s=this.chart.scroll(this.settings.scroll).getState();let a=o*(s.start-s.min)/(s.max-s.min);const l=o*s.viewSize/(s.max-s.min);return n&&(a=o-a-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(a,"px"),[r?"top":"left"]:"25%",[r?"height":"width"]:"50%",[i]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function JJ(e){let t=e.h,n=e.isVertical,r=e.value,i=e.pos,o=e.align,s=e.borderHit,a=e.state,l=e.idx;const c="end"!==o,u=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let d=0,h="100%",p="100%";return a.targetRect&&"start"===a.settings.bubbles.align?(h="".concat(a.targetRect.x+a.targetRect.width,"px"),p="".concat(a.targetRect.y+a.targetRect.height,"px")):a.targetRect&&"end"===a.settings.bubbles.align&&(d=n?a.targetRect.x:a.targetRect.y,h="".concat(a.rect.width-d,"px"),p="".concat(a.rect.height-d,"px")),c||(i-=s),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=a.style.line.stroke,e.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":r,"data-key":[a.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(s,"px"):p,width:n?h:"".concat(s,"px"),pointerEvents:"auto"}},[t("div",{style:m$({backgroundColor:a.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function ZJ(e){let t=e.h,n=e.isVertical,r=e.label,i=e.otherValue,o=e.rangeIdx,s=e.idx,a=e.pos,l=e.align,c=e.state,u=e.value;const d="end"!==l,h="outside"===c.settings.bubbles.placement;let p,f="none";n?(p=d?"left":"right",h&&(f=d?"translate(-100%, 0px)":"translate(100%, 0px)")):(p=d?"top":"bottom",h&&(f=d?"translate(0px, -100%)":"translate(0px, 100%)"));let m=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===s;const g={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let y=c.style.bubble.stroke;const v=m?t("input",{type:"text",value:u,style:x$(x$({},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,s].join("-"),"data-other-value":i,"data-idx":o,"data-bidx":s,style:g},[r]);return t("div",{style:{position:"absolute",[p]:"0",[n?"top":"left"]:"".concat(a,"px"),transform:f}},[v])}function QJ(e){let t=e.h,n=e.isVertical,r=e.top,i=e.height,o=e.color,s=e.on,a=e.opacity;return t("div",m$({style:{backgroundColor:o,opacity:a,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"}},s),[])}function eZ(e){let t=e.borderHit,n=e.els,r=e.isVertical,i=e.state,o=e.vStart,s=e.vEnd,a=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(s)*i.size:s,h=Math.abs(u-d),p=Math.min(u,d)+l,f=p+h;if(i.targetRect){const e=i.targetFillRect||i.targetRect,t=r?e.height:e.width,a=c?i.scale.norm(o)*t:o,l=c?i.scale.norm(s)*t:s,u=Math.abs(a-l),d=Math.min(a,l),h={h:i.h,isVertical:r,top:d,height:u,color:i.style.target.fill,opacity:i.style.target.opacity};i.style.target.opacity<.8&&(h.on={onmouseover(e){e.srcElement.style.opacity=i.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=i.style.target.opacity}}),n.push(i.h("div",{style:{position:"absolute",left:"".concat(e.x,"px"),top:"".concat(e.y,"px"),height:"".concat(e.height,"px"),width:"".concat(e.width,"px")}},[QJ(h)]))}const m=u<d?o:s,g=u<d?s:o,y=w$(c?i.scale.domain():[Math.min(o,s),Math.max(o,s)],2),v=y[0],b=y[1],x=m+1e-5>=v&&m-1e-5<=b,w=g-1e-5<=b&&g+1e-5>=v;x&&n.push(JJ({h:i.h,isVertical:r,borderHit:t,value:m,pos:p,align:"start",state:i,idx:a})),w&&n.push(JJ({h:i.h,isVertical:r,borderHit:t,value:g,pos:f,align:"end",state:i,idx:a}));const S=i.settings.bubbles;if(S&&S.show){S.fontSize,S.fontFamily,S.fill;const e=[o,s];x&&n.push(ZJ({h:i.h,isVertical:r,align:S.align,rangeIdx:a,idx:0,otherValue:g,value:m,label:"".concat(i.format(m,e)),pos:p,state:i})),w&&n.push(ZJ({h:i.h,isVertical:r,align:S.align,rangeIdx:a,idx:1,otherValue:m,value:g,label:"".concat(i.format(g,e)),pos:f,state:i}))}}function tZ(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 nZ(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach((r,i)=>{e.active&&i===e.active.idx||eZ({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=tZ(e);r=e.active.start+t,i=e.active.end+t}eZ({borderHit:5,els:t,isVertical:n,state:e,vStart:r,vEnd:i,idx:e.active.idx})}return t}function rZ(e){return{min:e.scale.min(),max:e.scale.max()}}function iZ(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function oZ(e,t,n){let r,i,o=e.ranges,s=-1;for(r=0;r<o.length;r++){if(o[r].min<=t&&t<=o[r].max){s=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===s&&o.length&&r>=o.length&&(n.min=o[o.length-1].max),-1!==s&&(i={idx:s,start:o[s].min,end:o[s].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=i}function sZ(e){e.renderer.render(nZ(e))}function aZ(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 lZ(e,t){let n,r=1/0;const i=t.domain(),o=t.bandwidth()/2;for(let s=0;s<i.length;++s){const a=Math.abs(e-o-t(i[s]));a<r&&(r=a,n=i[s])}return n}function cZ(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function uZ(e){const t=e.reduce((e,t)=>(e.push(...I$(t.bounds)),e),[]);return R$(t)}const dZ={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=aZ(this.state,this.state.brushInstance),this.state.active=null,sZ(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=BY(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=uZ(i);if(t.size=r[0===e.state.direction?"height":"width"],t.scale=BY(e.chart.scale(n.scale),t.size),t.targetRect=r,o.length>0){const e=uZ(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(),s=e.scale.max();i[t]={min:Math.max(o,Math.min(n,r)),max:Math.min(s,Math.max(n,r))},e.ranges[t]=x$({},i[t]);const a=e.scale.data();a&&a.fields&&a.fields.forEach(t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),i)})}(this.state,e,t,n),this.emit("bubbleEnd"),sZ(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,sZ(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=GU(),this.state.scale.data=i.data,this.state.format||(this.state.format=(e,t)=>cZ(i.range(),t)?function(e,t){const n=t.ticks(),r=t.domain().indexOf(lZ(e,t));return-1!==r?n[r].label:"-"}(e,i):"-"),this.state.fauxBrushInstance=DY(),this.state.findValues=e=>function(e,t){const n=t.domain(),r=t.range(),i=[];return e.forEach(e=>{if(!cZ(r,[e.min,e.max]))return;const o=n.indexOf(lZ(e.min,t)),s=n.indexOf(lZ(e.max,t));i.push.apply(i,n.slice(Math.min(o,s),Math.max(o,s)+1))}),i}(e,i);return this.state.ranges=aZ(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[nZ(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 s=n.center.x-n.deltaX,a=n.center.y-n.deltaY;let l=document.elementFromPoint(s,a);r.element().contains(l)||(l=null);const c={started:!0};t.offset=m$({},r.element().getBoundingClientRect());const u=s-t.offset.left,d=a-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=i(t,t.fauxBrushInstance||t.brushInstance);const h=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],p=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];c.current=t.scale.normInvert(p/t.size),c.start=t.scale.normInvert(h/t.size);let f=t.ranges;const m=rZ(t);let g,y,v=-1;if(l&&l.hasAttribute("data-idx"))v=parseInt(l.getAttribute("data-idx"),10),m.min=v>0?f[v-1].max:m.min,m.max=v+1<f.length?f[v+1].min:m.max;else{for(g=0;g<f.length;g++){if(f[g].min<=c.start&&c.start<=f[g].max){v=g,m.min=g?f[g-1].max:m.min,m.max=g+1<f.length?f[g+1].min:m.max;break}if(c.start<f[g].min){m.max=f[g].min,m.min=g?f[g-1].max:m.min;break}}-1===v&&f.length&&g>=f.length&&(m.min=f[f.length-1].max)}if(-1!==v||t.multi||(c.ranges=[],m.min=t.scale.min(),m.max=t.scale.max()),-1!==v)if(y={idx:v,start:f[v].min,end:f[v].max,limitLow:m.min,limitHigh:m.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{let e=t.scale.norm(y.start)*t.size,n=t.scale.norm(y.end)*t.size;Math.abs(h-e)<=o?(c.start=y.end,y.mode="modify"):Math.abs(h-n)<=o&&(c.start=y.start,y.mode="modify")}else y={idx:-1,start:c.start,end:c.current,limitLow:m.min,limitHigh:m.max,mode:"current"};c.active=y,"modify"!==y.mode&&t.targetRect&&!FK(t.targetRect,{x:u,y:d})||Object.keys(c).forEach(e=>t[e]=c[e])}({e:e,state:this.state,renderer:this.renderer,ranges:aZ,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=rZ(e);oZ(e,e.current,n)}(this.state,aZ),sZ(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=tZ(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=aZ(e,e.fauxBrushInstance),i=e.findValues(r),o=e.findValues(t),s=o.filter(e=>-1===i.indexOf(e)),a=i.filter(e=>-1===o.indexOf(e)),l=s.map(e=>({key:n.id(),value:e})),c=a.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),sZ(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;sZ(this.state);const o=i.querySelector("input");o.focus(),o.select()}};function hZ(e){e.renderer.render(nZ(e))}function pZ(e){return e.rc.ranges()}function fZ(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 mZ={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),s=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=s?{x:s.x0-this.rect.x,y:s.y0-this.rect.y,width:s.x1-s.x0,height:s.y1-s.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=n,this.state.settings=t,this.state.offset=i,this.state.rc=vY(),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},s=e.chart.shapesAt(o,e.settings.brush);if(0===s.length)return"-";const a=s.reduce((n,i)=>{const o=n.bounds,s=i.bounds;return t===r?o[e.cssCoord.coord]<=s[e.cssCoord.coord]?n:i:o[e.cssCoord.coord]+o[e.cssCoord.area]>=s[e.cssCoord.coord]+s[e.cssCoord.area]?n:i}),l=e.settings.brush.components.reduce((e,t)=>e.key===a.key?e:t);return"function"==typeof e.settings.bubbles.label?e.settings.bubbles.label(a.data):Array.isArray(l.data)&&l.data.length?a.data[l.data[0]].label:a.data&&a.data.label?a.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 s=n.center.x-n.deltaX,a=n.center.y-n.deltaY;let l=document.elementFromPoint(s,a);r.element().contains(l)||(l=null);const c={started:!0};t.offset=r.element().getBoundingClientRect(),t.ranges=i(t);const u=s-t.offset.left,d=a-t.offset.top,h=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],p=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];let f=p,m=h;c.start=h,c.current=p;let g=t.ranges;const y=iZ(t);let v,b,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),y.min=x>0?g[x-1].max:y.min,y.max=x+1<g.length?g[x+1].min:y.max;else{for(v=0;v<g.length;v++){if(g[v].min<=m&&m<=g[v].max){x=v,y.min=v?g[v-1].max:y.min,y.max=v+1<g.length?g[v+1].min:y.max;break}if(m<g[v].min){y.max=g[v].min,y.min=v?g[v-1].max:y.min;break}}-1===x&&g.length&&v>=g.length&&(y.min=g[g.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(b={idx:x,start:g[x].min,end:g[x].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),b.mode="modify";else{let e=b.start,t=b.end;Math.abs(h-e)<=o?(c.start=b.end,b.mode="modify"):Math.abs(h-t)<=o&&(c.start=b.start,b.mode="modify")}else b={idx:-1,start:m,end:f,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=b,"modify"!==b.mode&&t.targetRect&&!FK(t.targetRect,{x:u,y:d})||Object.keys(c).forEach(e=>t[e]=c[e])}({e:e,state:this.state,renderer:this.renderer,ranges:pZ,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=iZ(e);oZ(e,e.current,n)}(this.state,pZ),hZ(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=tZ(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,...fZ(e,t)]}),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),hZ(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function gZ(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,s=e.scale(i.max)*n,a=Math.min(o,s),l=Math.abs(o-s);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:a,width:t?r:l,y:t?a:0,height:t?l:r}})}function yZ(e,t,n,r){function i(){!function(e){e.renderer.render(gZ(e))}(e)}function o(){!function(e){e.renderer.render(gZ(e))}(e)}function s(){!function(e){e.renderer.render(gZ(e))}(e)}e.brush=t,t&&(t.on("start",i),t.on("update",o),t.on("end",s),e.start=i,e.update=o,e.end=s,e.brush=t,e.scale=n,e.renderer=r)}function vZ(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 bZ={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=BY(this.chart.scale(e.scale),r);return vZ(this.state),yZ(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,gZ(this.state)},beforeDestroy(){vZ(this.state)}};function xZ(e,t){const n=t.center.x,r=t.center.y;return{x:n-e.left,y:r-e.top}}function wZ(e,t,n){return aK(e,t.points[0])<n.settings.snapIndicator.threshold**2}function SZ(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 CZ(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 EZ(e,t){e.snapIndicator.visible=t}const MZ={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart(e){this.start(e)},lassoEnd(e){this.end(e)},lassoMove(e){this.move(e)},lassoCancel(){this.cancel()}},created(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start(e){var t;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(e,t){const n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=function(e){return e.settings.brush.components.map(e=>({key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"}))}(this.settings);const n=xZ(this.state.rendererBounds,e);SZ(this.state,n),CZ({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=xZ(this.state.rendererBounds,e);wZ(t,this.state,this.settings)?EZ(this.state,!0):EZ(this.state,!1),SZ(this.state,t),CZ({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;EZ(this.state,!1);wZ(xZ(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 kZ(e,t,n,r,i){let o,s=0,a=t.length-1;for(;s<a;){let l=Math.floor((s+a)/2);o=i(t[l]),o[n]+o[r]<e[n]?s=l+1:a=l}return s}function IZ(e){let t=e.orientation,n=e.targetNodes,r=e.labels,i=e.container,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kZ;const s=[],a="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],h=d.textBounds,p=d.node;if(h[a]<i[a]||h[a]+h[l]>i[a]+i[l])return!1;for(let e=o(h,s,a,l,c);e<s.length;e++)if(jK(h,s[e].textBounds))return!1;const f=o(h,n,a,l,u),m=h[a]+h[l];for(let e=f;e<n.length;e++){const t=n[e].node;if(m<t.localBounds[a])break;if(jK(h,t.localBounds)&&p!==t)return!1}return s.push(r[t]),!0}}function RZ(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function _Z(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function DZ(e){return x$(x$({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 AZ(e,t,n){return n?e.width>=t.height:e.width>=t.width}function PZ(e,t,n){return n?e.height>=t.width:e.height>=t.height}function LZ(e,t,n,r,i){let o,s;return"v"===e?(o=r||i||AZ(t,n,!0),s=PZ(t,n,!r)):(o=AZ(t,n),s=i||PZ(t,n,!1)),o&&s}function TZ(e,t,n,r){return e+.5*t+(r-.5)*(t-n)-.5*n}function OZ(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 AZ(e,t,n.rotate)&&PZ(e,t,n.rotate)}(e,i,n))return!1;const o=.5*i.height;return n.rotate?(r.x=TZ(e.x,e.width,i.height,n.align)+o,r.y=TZ(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=TZ(e.x,e.width,i.width,n.align),r.y=TZ(e.y,e.height,i.height,n.justify)+o),r}function qZ(e){let t=e.bar,n=e.view,r=e.direction,i=e.position,o=e.padding,s=void 0===o?4:o,a=e.measured;const l={};if(m$(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,s=void 0===o?4:o,a=n.left,l=void 0===a?4:a,c=n.right,u=void 0===c?4:c,d="function"==typeof l?l(t):l,h="function"==typeof u?u(t):u,p="function"==typeof i?i(t):i,f="function"==typeof s?s(t):s;e.x+=d,e.width-=d+h,e.y+=p,e.height-=p+f}(l,a,s),l}function NZ(e){let t,n,r,i,o,s=e.direction,a=e.fitsHorizontally,l=e.measured,c=e.node,u=e.orientation,d=e.placementSettings,h=e.rect,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qZ;const f=[],m="h"===u?"width":"height";for(o=0;o<d.length;o++)if(r=d[o],i=p({bar:c.localBounds,view:h,direction:s,position:r.position,padding:r.padding,measured:l}),f.push(i),t=!o||i[m]>t[m]?i:t,LZ(u,i,l,a,r.overflow)){n=i;break}return n||(n=t,o=f.indexOf(n)),r=d[o],{bounds:n,placement:r}}function jZ(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const o=i.top,s=void 0===o?4:o,a=i.bottom,l=void 0===a?4:a,c=i.left,u=void 0===c?4:c,d=i.right,h=void 0===d?4:d,p="function"==typeof u?u(t):u,f="function"==typeof h?h(t):h,m="function"==typeof s?s(t):s,g="function"==typeof l?l(t):l,y=e.x+e.dx,v=e.y+e.dy,b=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)-p-S,y:(n?v:v-w)-m-S,width:x+(p+f)-S,height:b+(m+g)-S}}function zZ(e){let t=e.chart,n=e.targetNodes,r=e.rect,i=e.fitsHorizontally,o=e.collectiveOrientation,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NZ,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:OZ,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:IZ;const c=[],u={container:r,targetNodes:n,labels:[],orientation:o};let d,h,p,f,m,g,y,v,b,x,w,S,C,E;for(let e=0,l=n.length;e<l;e++){g=null,h=n[e],p=h.node,C=RZ(p,t),b=h.direction,E="left"===b||"right"===b?"h":"v";for(let t=0;t<h.texts.length;t++){if(f=h.texts[t],!_Z(f))continue;x=h.labelSettings[t],v=h.measurements[t],S=x.placements;const n=s({direction:b,fitsHorizontally:i,lblStngs:x,measured:v,node:p,orientation:E,placements:S,placementSettings:h.placementSettings[t],rect:r});if(g=n.bounds,w=n.placement,g&&w){var M;m=w.justify;const t="function"==typeof x.linkData?x.linkData(C,e):void 0,n="function"==typeof w.overflow?w.overflow(C,e):w.overflow;"up"===b&&(m=1-m),"opposite"===w.position&&(m=1-m),"left"===b&&(m=1-m);const r=!("h"===o||i);if(d=a(g,f,{justify:"h"===E?w.align:m,align:"h"===E?m:w.align,fontSize:x.fontSize,fontFamily:x.fontFamily,textMetrics:v,rotate:r,overflow:!!n,dock:null!==(M=x.dock)&&void 0!==M?M:"left"}),d){const n=jZ(d,v,r,g,w.padding);y="function"==typeof w.fill?w.fill(x$(x$({},C),{},{textBounds:n}),e):w.fill,d.fill=y,void 0!==t&&(d.data=t),"object"==typeof w.background&&(d.backgroundColor="function"==typeof w.background.fill?w.background.fill(x$(x$({},C),{},{textBounds:n}),e):w.background.fill,void 0!==d.backgroundColor&&(d.backgroundBounds=jZ(d,v,r,g,w.background.padding))),c.push(d),u.labels.push({node:p,textBounds:n})}}}}const k=c.filter(l(u));return[...k.filter(e=>void 0!==e.backgroundBounds).map(DZ),...k]}function FZ(e){const t=2*Math.PI;return(e%t+t)%t}function WZ(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function $Z(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function BZ(e,t,n){let r=t.x,i=t.y;if(r*r+i*i>e*e)return null;let o=Math.sin(n),s=Math.cos(n),a=r*s-i*o,l=e*e-a*a;if(l<0)return null;let c=Math.sqrt(l);return{x:a*s+o*c,y:-a*o+s*c}}function VZ(e){let t,n,r=e.radius,i=e.size,o=e.angle,s=i.width,a=i.height,l={x:s/2,y:a/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=BZ(r,l,o),!t)return null;t.y*=-1,n={x:-s,y:0};break;case 1:if(t=BZ(r,l,Math.PI-o),!t)return null;n={x:-s,y:-a};break;case 2:if(t=BZ(r,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-a};break;case 3:if(t=BZ(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:s,height:a}}function HZ(e){let t=e.slice,n=e.measured,r=e.padding,i=t.start,o=t.end,s=t.innerRadius,a=t.outerRadius,l=a-s-2*r,c=o-i;if(c<Math.PI){let e=(n.height/2+r)/Math.tan(c/2);e>s&&(l=a-e-2*r)}if(l<0||l<n.minReqWidth)return null;const u=FZ((i+o)/2);let d=a-r,h={x:Math.sin(u)*d,y:-Math.cos(u)*d,width:l,height:n.height};return u<Math.PI?(h.angle=u-Math.PI/2,h.anchor="end"):(h.angle=u+Math.PI/2,h.anchor="start"),h}function GZ(e){let t=e.context,n=e.node,r=e.bounds;let i=n.desc.slice;const o=FZ((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 UZ(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function YZ(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 KZ(e){let t,n,r=e.slice,i=e.direction,o=e.position,s=e.padding,a=e.measured,l=e.view,c=e.context,u=e.store,d=r.start,h=r.end,p=r.innerRadius,f=r.offset;switch(o){case"into":t="rotate"===i?HZ({slice:r,measured:a,padding:s}):function(e){let t=e.slice,n=e.padding,r=e.measured,i=t.start,o=t.end,s=t.innerRadius,a=t.outerRadius;const l=FZ((i+o)/2);let c=VZ({radius:a,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",WK(c,{x1:0,y1:0,x2:Math.sin(i)*a,y2:-Math.cos(i)*a})||WK(c,{x1:0,y1:0,x2:Math.sin(o)*a,y2:-Math.cos(o)*a})||PK({cx:0,cy:0,r:s},c)?null:(WZ(c,n),c)):null}({slice:r,measured:a,padding:s});break;case"inside":n={start:d,end:h,innerRadius:0,outerRadius:p},t="rotate"===i?HZ({slice:n,measured:a,padding:s}):function(e){let t=e.slice,n=e.padding,r=e.measured,i=e.store;const o=t.start,s=t.end,a=t.outerRadius,l=FZ((o+s)/2);let c=VZ({radius:a,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",WZ(c,n),i.insideLabelBounds.some(e=>jK(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:a,padding:s,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,s=t.end,a=t.outerRadius,l=t.offset,c=a+r,u=s-o;if(u<Math.PI&&(n.height/2+r)/Math.tan(u/2)>c)return null;const d=FZ((o+s)/2);let h=Math.sin(d)*c,p=-Math.cos(d)*c,f=n.width+1,m=d%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){let e=p<0?i.y:i.y+i.height,t=Math.abs(e-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*r-a;t<f&&(f=t)}if(Math.sin(m)>.001){let e=h<0?i.x:i.x+i.width,t=Math.abs(e-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*r-a;t<f&&(f=t)}if(f<=0||f<n.minReqWidth)return null;let g={x:h,y:p,width:f,height:n.height};return d<Math.PI?(g.angle=d-Math.PI/2,g.anchor="start"):(g.angle=d+Math.PI/2,g.anchor="end"),g}({slice:r,measured:a,padding:s,view:l}):function(e){let t=e.slice,n=e.measured,r=e.padding,i=e.view,o=e.context,s=t.start,a=t.end,l=t.outerRadius,c=t.offset;const u=FZ((s+a)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.q4maxY<0;default:return!0}}(o,Math.floor(u/(Math.PI/2)),i))return null;let d=l+r+n.height/2,h=Math.sin(u)*d,p=-Math.cos(u)*d,f=n.width+1;if(u<Math.PI){let e=Math.abs(i.x+i.width-(h+c.x));e<f&&(f=e)}else{let e=Math.abs(i.x-(h+c.x));e<f&&(f=e)}if(f<n.minReqWidth)return null;let m={x:h,y:p,width:f,height:n.height};return u<Math.PI?m.anchor="start":m.anchor="end",m}({slice:r,measured:a,padding:s,view:l,context:c});break;default:throw new Error("not implemented")}return t&&(t.x+=f.x,t.y+=f.y,"outside"===o&&"rotate"!==i&&function(e,t,n){const r=n.start,i=n.end,o=n.offset,s=n.outerRadius,a=FZ((r+i)/2);switch(Math.floor(a/(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=s+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*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=s+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*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=s+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*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=s+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}}}(t,c,r)),t}function XZ(e){let t=e.context,n=e.direction,r=e.measured,i=e.node,o=e.placementSettings,s=e.rect,a=e.store,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:KZ;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,slice:i.desc.slice,view:s,direction:n,position:c.position,measured:r,padding:c.padding,store:a});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function JZ(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 ZZ=/\n+|\r+|\r\n/,QZ=/\s/,eQ=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function tQ(e){return"string"==typeof e?-1!==e.search(ZZ):-1!==String(e).search(ZZ)}function nQ(e){return-1!==e.search(QZ)}function rQ(e){return-1!==e.search(eQ)}function iQ(e,t,n){return Math.max(t,Math.min(n,e))}function oQ(){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,s=e.measureText,a=void 0===s?e=>({width:e.length,height:1}):s,l=e.mandatoryBreakIdentifiers,c=void 0===l?[tQ]:l,u=e.noBreakAllowedIdentifiers,d=void 0===u?[]:u,h=e.suppressIdentifier,p=void 0===h?[nQ,tQ,e=>""===e]:h,f=e.hyphenationIdentifiers,m=void 0===f?[rQ]:f;const g=String(t).split(r);!function(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}(g);const y=g.length,v=o?e=>e>=0:e=>e<y;let b=o?y:-1;function x(e){const t=iQ(e,0,y-1),n=g[t],r=a(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:p.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?b--:b++:b=iQ(e,0,y-1),v(b)?x(b):{done:!0}},peek:x,length:y}}const sQ="…",aQ=/^\s*\d+(\.\d+)?px\s*$/i;function lQ(e){return"string"===typeof e&&aQ.test(e)}function cQ(e){const t=e["font-size"]||e.fontSize;return lQ(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function uQ(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const r=cQ(e);return Math.max(1,Math.min(Math.floor(t/r),n))}function dQ(e,t){return{lines:[],line:"",width:0,maxLines:uQ(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function hQ(e){e.lines.push(e.line),e.line="",e.width=0}function pQ(e,t){e.line+=t.value,e.width+=t.width}function fQ(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 mQ(e,t,n){const r=oQ({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?fQ(e,t,r):t,hQ(e),pQ(e,t)):pQ(e,t)}}function gQ(e,t){const n=oQ({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),r=dQ(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){hQ(r),i=!1;break}1===e.breakOpportunity?hQ(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?r.width+=e.width:(e=r.hyphens.enabled?fQ(r,e,n):e,hQ(r),pQ(r,e)):pQ(r,e)}return{lines:r.lines,reduced:i}}function yQ(e,t){const n=oQ({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),r=dQ(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){hQ(r),i=!1;break}1===e.breakOpportunity?hQ(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?hQ(r):e.width>r.maxWidth?mQ(r,e,t):(hQ(r),pQ(r,e)):pQ(r,e)}return{lines:r.lines,reduced:i}}function vQ(e){return{"break-all":gQ,"break-word":yQ}[e.wordBreak]}function bQ(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const r=vQ(n);if(!r)return;const i=e(n);if(i.width>n.maxWidth||tQ(n.text)){const o=(cQ(n)-i.height)/2,s=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((s,a)=>{const l=m$({},t);l.text=s,l._lineBreak=!0,o+=n,e.reduced&&a===e.lines.length-1?l.text+=sQ:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=r,o+=n,i.children.push(l)}),i}(s,n,o,i.height)}}}}function xQ(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 s=t({text:i,fontSize:r,fontFamily:n}).width;if(s<=o)return i;let a=0,l=i.length-1;for(;a<=l;){let e=Math.floor((a+l)/2);s=t({text:i.substr(0,e)+sQ,fontSize:r,fontFamily:n}).width,s<=o?a=e+1:l=e-1}return i.substr(0,l)+sQ}function wQ(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 SQ={},CQ={},EQ={fontSize:void 0,fontFamily:void 0};let MQ;function kQ(e,t){return!e&&!t||e===t}function IQ(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 CQ[o]&&(MQ=MQ||document.createElement("canvas").getContext("2d"),function(e){let t=e.fontWeight,n=e.fontSize,r=e.fontFamily;kQ(EQ.fontWeight,t)&&kQ(EQ.fontSize,n)&&kQ(EQ.fontFamily,r)||(MQ.font=[t,n,r].filter(e=>!!e).join(" "),EQ.fontWeight=t,EQ.fontSize=n,EQ.fontFamily=r)}({fontWeight:n,fontSize:r,fontFamily:i}),CQ[o]=MQ.measureText(t).width),CQ[o]}function RQ(e){return"number"!=typeof SQ[e]&&(SQ[e]=function(e){if(lQ(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),SQ[e]}function _Q(e){let t=e.text,n=e.fontWeight,r=e.fontSize;return{width:IQ({text:t,fontWeight:n,fontSize:r,fontFamily:e.fontFamily}),height:RQ(r)}}function DQ(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_Q;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),s=e.x||0,a=e.y||0,l=e.dx||0,c={x:0,y:a+((e.dy||0)+wQ(e))-.75*i.height,width:o,height:i.height},u=e["text-anchor"]||e.anchor;return c.x="middle"===u?s+l-o/2:"end"===u?s+l-o:s+l,c}function AQ(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_Q;const n=vQ(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||tQ(e.text))){const o=n(e,e=>t({text:e,fontFamily:i,fontSize:r})),s=m$({},e);let a=0,l="";for(let e=0,n=o.lines.length;e<n;e++){let s=o.lines[e];s+=e===n-1&&o.reduced?sQ:"";const c=t({text:s,fontSize:r,fontFamily:i}).width;c>=a&&(a=c,l=s)}s.text=l;const c=DQ(s,t);return c.height=cQ(e)*o.lines.length,c}return DQ(e,t)}function PQ(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function LQ(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 TQ(e){return{type:"circle",bounds:{cx:e.cx,cy:e.cy,r:e.r}}}function OQ(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 s=0!==r?r:i;return TQ({cx:o.x,cy:o.y,r:s})}(e.desc.slice):"circle"===e.type?TQ(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var qQ={bar:function(e){let t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,s=e.style,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zZ;const l=m$({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},s.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map(e=>m$({},l,t,e)),u=t.labels.map(e=>e.placements.map(n=>m$({},l,t,e,n))),d=function(e){let t=e.nodes,n=e.rect,r=e.chart,i=e.labelSettings,o=e.placementSettings,s=e.settings,a=e.renderer;const l={},c=[];let u,d,h,p,f,m,g,y=!0,v=!1;for(let e=0;e<t.length;e++){if(d=t[e],p=d.localBounds,!jK(p,n))continue;let b=RZ(d,r);u={node:d,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<i.length;t++)m=i[t],h="function"==typeof m.label?m.label(b,e):void 0,_Z(h)&&(g="function"==typeof s.direction?s.direction(b,e):s.direction||"up",v=v||"left"===g||"right"===g,l.fontFamily=m.fontFamily,l.fontSize="".concat(m.fontSize,"px"),l.text=h,f=a.measureText(l),u.measurements.push(f),u.texts.push(h),u.labelSettings.push(m),u.placementSettings.push(o[t]),u.direction=g,y=y&&f.width<=p.width-8);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:v}}({nodes:r,chart:n,renderer:o,settings:t,rect:i,labelSettings:c,placementSettings:u}),h=d.fitsHorizontally,p=d.hasHorizontalDirection,f=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:p?"h":"v"}),g="h"===m?"y":"x",y="h"===m?"height":"width";return f.sort((e,t)=>e.node.localBounds[g]+e.node.localBounds[y]-(t.node.localBounds[g]+t.node.localBounds[y])),a({chart:n,targetNodes:f,stngs:t,rect:i,fitsHorizontally:h,collectiveOrientation:m})},slice:function(e){let t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,s=e.style,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:XZ,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:YZ;const c=m$({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},s.label);c.fontSize=parseInt(c.fontSize,10);const u=t.labels.map(e=>m$({},c,t,e)),d=t.labels.map(e=>e.placements.map(n=>m$({},c,t,e,n))),h=[],p={insideLabelBounds:[]};r=function(e){const t=[],n=[],r=[],i=[];for(let o=0;o<e.length;++o){const s=e[o].desc.slice,a=FZ((s.start+s.end)/2);switch(Math.floor(a/(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)=>FZ((e.desc.slice.start+e.desc.slice.end)/2)-FZ((t.desc.slice.start+t.desc.slice.end)/2),s=(e,t)=>o(t,e);return t.sort(s),n.sort(o),r.sort(s),i.sort(o),t.concat(n,i,r)}(r);const f={};for(let e=0,t=r.length;e<t;e++){const t=r[e],s=UZ(t,n);for(let n=0;n<u.length;n++){const r=u[n],c="function"==typeof r.label?r.label(s,e):"";if(!c)continue;const m="function"==typeof r.direction?r.direction(s,e):r.direction||"horizontal",g="function"==typeof r.linkData?r.linkData(s,e):void 0,y=JZ(c,r,o),v=a({context:f,direction:m,lblStngs:r,measured:y,node:t,placementSettings:d[n],rect:i,store:p}),b=v.bounds,x=v.placement;if(b&&x){if("outside"===x.position&&"rotate"!==m){GZ({context:f,node:t,bounds:b});if(!EK($Z(b),i))continue}const n="function"==typeof x.fill?x.fill(s,e):x.fill,o=l(b,c,{fill:n,fontSize:r.fontSize,fontFamily:r.fontFamily,textMetrics:y});o&&(void 0!==g&&(o.data=g),h.push(o),b.line&&(b.line.stroke=n,h.push(b.line)))}}}return h},rows:function(e){let t=e.settings,n=e.chart,r=e.nodes,i=e.renderer,o=e.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:LQ;const a=m$({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);a.fontSize=parseInt(a.fontSize,10);const l=m$({},a,t),c=t.labels.map(e=>m$({},l,e)),u={},d=[];for(let e=0,t=r.length;e<t;e++){let t=r[e],o=PQ(t,n),a=OQ(t),h=a.type,p=a.bounds;if(!p)continue;let f,m=0,g=[],y=[],v="circle"===h?2*p.r*.9:p.height;for(m+=l.padding,f=0;f<c.length;f++){let t=c[f],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>v)break;y.push(n),g.push(r)}const b=f,x=Math.max(0,v-m);let w;for(w="circle"===h?p.cy-.9*p.r:p.y,w+=l.justify*x+l.padding,f=0;f<b;f++){let t,n=c[f];if("circle"===h){let e=Math.max(Math.abs(w-p.cy),Math.abs(w+g[f].height-p.cy)),n=Math.sqrt(p.r*p.r-e*e);t={x:p.cx-n+l.padding,y:w,width:2*n-2*l.padding,height:g[f].height}}else t={x:p.x+l.padding,y:w,width:p.width-2*l.padding,height:g[f].height};w+=g[f].height+l.padding;let r="function"==typeof n.fill?n.fill(o,e):n.fill;const a="function"==typeof n.linkData?n.linkData(o,e):void 0;let u=s(t,y[f],{fill:r,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:g[f]});if(u){if(u.text&&u.text!==sQ){const e=xQ(u,i.measureText);if(sQ===e)continue;u.ellipsed=e}void 0!==a&&(u.data=a),d.push(u)}}}return d}};const NQ={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach(e=>{e.strategy&&qQ[e.strategy.type]&&e.component&&t.push(...function(e,t){let n=e.chart,r=e.source,i=e.rect,o=e.renderer,s=e.style;if(!n.component(r.component))return[];const a=n.findShapes(r.selector).filter(e=>e.key===r.component);return t({chart:n,settings:r.strategy.settings,nodes:a,rect:{x:0,y:0,width:i.width,height:i.height},renderer:o,style:s})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:e,style:this.style},qQ[e.strategy.type]))}),t}};const jQ={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 zQ(e){let t=e.x,n=void 0===t?0:t,r=e.y,i=e.item,o=e.globalMetrics,s=e.createSymbol,a=e.direction,l=void 0===a?"ltr":a,c=i.label.displayObject,u=i.label.bounds,d=i.symbol.meta;const h="rtl"===l;let p={x:h?n+o.maxLabelBounds.width:n+o.maxSymbolSize+o.spacing,y:r,width:o.maxLabelBounds.width,height:Math.max(o.maxSymbolSize,o.maxLabelBounds.height)},f=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:h?n+o.maxLabelBounds.width+o.spacing:n,y:r,width:o.maxSymbolSize,height:p.height},d.size,{align:void 0===d.align?.5:d.align,justify:void 0===d.justify?.5:d.justify});const m=s(m$({},d,f));return delete m.collider,c.anchor=h?"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)}(p,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:p}}function FQ(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 WQ(e,t){let n,r,i,o,s=t.onScroll,a=void 0===s?()=>{}:s,l=null,c=0;const u={itemize:t=>{n=function(e,t){let n,r,i=e.resolved,o=e.dock,s=[],a=i.items.items,l=i.symbols.items,c=i.labels.items,u=0,d=0,h=0;for(let e=0;e<a.length;e++){if(!1===a[e].show)continue;const i=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=m$({},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)}},s.push(r),u=Math.max(l[e].size,u),d=Math.max(r.label.bounds.width,d),h=Math.max(r.label.bounds.height,h)}return{items:s,globalMetrics:{spacing:8,maxSymbolSize:u,maxItemBounds:{height:Math.max(u,h),width:u+8+d},maxLabelBounds:{width:d,height:h}},layout:{margin:{vertical:void 0!==i.layout.item.vertical?i.layout.item.vertical:4,horizontal:void 0!==i.layout.item.horizontal?i.layout.item.horizontal:4},mode:i.layout.item.mode,size:i.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:i.layout.item.direction,scrollOffset:i.layout.item.scrollOffset}}}(t,e.renderer),l=isNaN(n.layout.scrollOffset)?l:n.layout.scrollOffset},getItemsToRender:t=>{i=t.viewRect,c=u.getContentOverflow(i);const s=u.extent();l=Math.max(0,Math.min(l,c)),o=m$({},i);const a="horizontal"===u.orientation()?"x":"y";return o[a]-=l,o["x"===a?"width":"height"]=s,function(e,t,n){let r=e.viewRect,i=n.itemized,o=n.create,s=void 0===o?zQ:o,a=n.parallels,l=n.createSymbol;const c=i.layout.direction,u=i.globalMetrics,d=i.items,h="horizontal"===i.layout.orientation;let p=0;const f=[],m=u.maxItemBounds.height,g=u.maxItemBounds.width,y=i.layout.margin.vertical+m,v=i.layout.margin.horizontal+g;let b=t.x,x=t.y,w=r.x-t.x;for(let e=0;e<d.length;e++){let n=s({y:x,x:"rtl"===c?r.x+w+r.width-g-(b-t.x):b,item:d[e],globalMetrics:u,direction:c,createSymbol:l});if((h&&b>=r.x-g||!h&&x>=r.y-m)&&f.push(n.item),p++,p>=a?(p=0,h?(b+=v,x=t.y):(x+=y,b=t.x)):h?x+=y:b+=v,!h&&x>r.y+r.height)break;if(h&&b>r.x+r.width)break}return f}(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",s=n.globalMetrics.maxItemBounds[i]*r+(r-1)*n.layout.margin[o];let a=Math.ceil(s/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]));a=Math.min(a,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(a,l))}(e,t,n),r),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return FQ(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,FQ(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,a())},offset:()=>l,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>FQ(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 $Q(e){return Object.keys(e).filter(t=>e[t]).join(" ")}const BQ={up:"▲",right:"▶",down:"▼",left:"◀"};function VQ(e,t){let n=t.size,r=t.isActive,i=t.direction,o=t.nav,s={},a="";const l=t.attrs;o&&o.button&&("function"==typeof o.button.class?s=o.button.class({direction:i}):o.button.class&&(s=o.button.class),"function"==typeof o.button.content&&(a=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(s).length||(c.border="0",c.background="none"),(!r||o&&o.disabled)&&(l.disabled="disabled"),e("button",m$({class:$Q(s),style:c},l),[a||e("span",{style:{pointerEvents:"none"}},[BQ[i]])])}function HQ(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 s=e.renderArgs[0],a="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void e.render([]);const d=a?["right","left"]:["down","up"];l&&a&&d.reverse();const h=[s("div",{style:{position:"relative",display:"flex","flex-direction":a?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!a?"rtl":"ltr"},[VQ(s,{size:32,isActive:c,direction:d[0],attrs:{"data-action":"next","data-component-key":r.settings.key},nav:n.navigation}),VQ(s,{size:32,isActive:u,direction:d[1],attrs:{"data-action":"prev","data-component-key":r.settings.key},nav:n.navigation})])];e.render(h)}(n.renderer,r,t,e),extent:()=>32,spread:()=>64};return n}function GQ(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=m$({},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(m$({},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 UQ(e,t,n,r){let i,o,s,a=r.itemRenderer,l=r.navigationRenderer,c=r.titleRenderer,u=r.isPreliminary,d=void 0!==u&&u,h=0;const p={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(i={x:p.x,y:p.y,width:p.width,height:c.spread()},"horizontal"===n){i={x:p.x,y:p.y,width:c.extent(),height:c.spread()};const e=p.width-i.width-(i.width?t.spacing:0),n=p.height;a.parallelize(e,d?void 0:n);const r=a.extent()>e?l.extent():0,u=a.spread(),f=r?l.spread():0;o={x:i.x+i.width+(i.width?t.spacing:0),y:p.y+Math.max(0,(f-u)/2),width:p.width-r-i.width-(r?t.spacing:0)-(i.width?t.spacing:0),height:n},s={x:o.x+o.width+(r?t.spacing:0),y:p.y,width:r,height:p.height},i.y=o.y;"rtl"===a.direction()&&(s.x=p.x,o.x=s.x+s.width+(s.width?t.spacing:0),i.x=o.x+o.width+(i.width?t.spacing:0)),h=Math.max(i.height,f,a.spread())}else{const e=p.height-i.height-(i.height?t.spacing:0),n=p.width;a.parallelize(e,d?void 0:n);const r=a.extent()>e?l.extent():0;s={x:p.x,y:p.y+p.height-r,width:p.width,height:r},o={x:p.x,y:i.y+i.height+(i.height?t.spacing:0),width:p.width,height:p.height-i.height-(i.height?t.spacing:0)-s.height-(s.height?t.spacing:0)},h=Math.max(c.extent(),r?l.spread():0,a.spread())}return o=m$({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),s.x+=e.x,s.y+=e.y,i.x+=e.x,i.y+=e.y,{title:m$({},e,i),content:m$({},e,o),navigation:m$({},e,s),orientation:n,preferredSize:h}}function YQ(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?m$({},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:m$(!0,{},jQ.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:jQ.layout,settings:e.settings.settings.layout}),s=e.resolver.resolve({data:n,defaults:m$(!0,{},jQ.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),a=m$(!0,{},(e.settings.settings.item||{}).shape);void 0===a.fill&&e.settings.scale&&(a.fill={scale:e.settings.scale});const l=e.resolver.resolve({data:n,defaults:m$(!0,{},jQ.item.shape,e.style.item.shape),settings:a}),c=e.resolver.resolve({data:n,defaults:m$(!0,{},{show:jQ.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:s,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 KQ(e){const t=e.rect,n=e.settings,r=e.state,i=e.itemRenderer,o=e.navigationRenderer,s=e.titleRenderer,a=n.layout.dock,l="top"===a||"bottom"===a?"horizontal":"vertical",c=UQ(t,r.display,l,{itemRenderer:i,navigationRenderer:o,titleRenderer:s});e.renderer.size(c.content);let u=i.getItemsToRender({viewRect:m$({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:i}),s.render({rect:c.title}),e.state.views={layout:c},u}const XQ={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=KQ(this);this.update(e)},this.itemRenderer=WQ(this,{onScroll:this.onScroll}),this.navigationRenderer=HQ(this),this.titleRenderer=GQ(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),YQ(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,s=UQ(t.inner,o,i,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=s.preferredSize,n+=o.spacing,n}(this,e)},beforeUpdate(){YQ(this)},render(){return KQ(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 JQ(e,t){let n=0;const r=e.state.isVertical?"justify":"align",i=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",s=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[s](),n*=Math.min(1,Math.max(e.stgns[r],0)),t[i]+=n}function ZQ(e,t,n){const r=n[e];return"object"==typeof r?-1!==r.valid.indexOf(t)?t:r.default:n.default}function QQ(e){return ZQ(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 e0(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 t0(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),s=function(e){return ZQ(e.layout.dock,e.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"})}(e.settings);if(void 0===n.text){const e=i.data().fields;n.text=e&&e[0]?e[0].title():""}const a=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),l=e.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),c={isVertical:t,nodes:[],title:{anchor:QQ(e.settings),textMetrics:a,textBounds:l,requiredWidth:()=>{if(!n.show)return 0;let e=l.width,r=n.maxLengthPx;return t||(e+=n.padding,r+=n.padding),Math.min(e,r,c.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let e=l.height;return t&&(e+=n.padding),Math.min(e,c.rect.height)}},ticks:{values:o,anchor:s,length:Math.min(Math.max(...o.map(e=>e.textMetrics.width)),e.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===s?Math.max(...c.ticks.values.map(e=>e.textMetrics.height))+e.stgns.tick.padding:0,height:Math.max(...o.map(e=>e.textMetrics.height))},legend:{fillScale:r,majorScale:i,length:()=>{const n=t?"height":"width",r=t?"requiredHeight":"requiredWidth",i=Math.min(c.rect[n],c.rect[n]*e.stgns.length)-c.title[r]();return Math.max(0,Math.min(i,e.stgns.maxLengthPx))}}};return c}const n0={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=e0(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=t0(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=t0(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=e0(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,s=t.rect.y,a="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,s+=t.title.textMetrics.height,s+=i?t.rect.height-t.title.textBounds.height:0,a="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,s+=t.title.textMetrics.height,s+=i?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=r?t.rect.width:0,s+=t.title.textMetrics.height,a=r?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(s,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:a,title:n.title.text};return JQ(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,s=i.y,a=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&&(s+=n.rect.height-r.size),"top"===n.title.anchor?s+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());const c={type:"rect",x:o,y:s,width:a,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return JQ(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"},s=n.ticks.values.map(s=>{let a=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=t.y+t.height*s.pos,u=0===s.pos?"text-before-edge":"text-after-edge"):a=t.x+t.width*s.pos,"right"===n.ticks.anchor?(a=t.x+r.size+r.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(a=t.x-r.tick.padding,i="end"):"top"===n.ticks.anchor?(l=t.y-r.tick.padding,c-=.25*s.textMetrics.height,i=0===s.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+r.tick.padding,c=.8*s.textMetrics.height,i=0===s.pos?"start":"end",o.y=t.y+t.height),{type:"text",x:a,y:l,dx:0,dy:c,text:s.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:s.label,baseline:u}});return{type:"container",id:"legend-seq-ticks",children:[...s,o]}}(this,n),i={id:"legend-seq-target",type:"container",children:[n,r]};this.state.nodes.push(i)},render(){return this.state.nodes}};const r0={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 i0(e,t){let n=t.generatorType,r=t.item,i=t.data,o=t.major,s=t.minor,a=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:s,layerObj:a,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 o0(e){const t=function(e){let t=e.data,n=e.stngs,r=e.rect,i=e.resolver,o=e.style,s=e.domain;const a=r.width,l=r.height,c=i.resolve({data:t,defaults:r0.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:a,minor:"vertical"===n.orientation?a:l}}),u=!n.connect&&s.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),d={};let h=0;for(let e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(u){const e=d[n]?d[n].items[d[n].items.length-1]:null,r=e?s.indexOf(e.data.major?e.data.major.value:e.data.value):null;e&&s.indexOf(t.data.major?t.data.major.value:t.data.value)-1!==r&&d[n].items.push({dummy:!0})}d[n]=d[n]||{order:h++,id:n,items:[],dataItems:[],consumableData:{}},d[n].dataItems.push(t.data),d[n].items.push(t)}const p=Object.keys(d).map(e=>(d[e].consumableData=x$({points:d[e].dataItems},d[e].dataItems[0]),d[e])),f={items:p.map(e=>e.consumableData)},m=n.layers||{};return{coordinates:c,metaLayers:p,layers:i.resolve({data:f,defaults:{curve:r0.layers.curve,show:r0.layers.show},settings:{curve:m.curve,show:m.show}}),lines:i.resolve({data:f,defaults:m$({},r0.layers.line,o.line),settings:m.line}),areas:i.resolve({data:f,defaults:m$({},r0.layers.area,o.area),settings:m.area})}}(e),n=t.metaLayers,r=t.coordinates,i=t.layers,o=t.lines,s=t.areas,a=[];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,h;for(let n=0;n<t.items.length;n++){if(d=t.items[n],h=d.data,!d.dummy){if(isNaN(d.major))continue;e.missingMinor0&&(d.minor0=r.settings.minor.scale?r.settings.minor.scale(h.minor0?h.minor0.value:0):0),isNaN(d.minor)||c.push(d.minor),l.data.push(d.data)}u.push(d)}const p=c.sort((e,t)=>e-t)[Math.floor((c.length-1)/2)];a.push({layerObj:l,lineObj:o.items[n],areaObj:s.items[n],median:p,points:u,consumableData:t.consumableData})}),a}const s0={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,s=o0({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=s.map(e=>({id:e.layerObj.id,data:e.layerObj.data})).sort(this.stngs.layers.sort).map(e=>e.id);s.sort((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id))}else s.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 s=[],a=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"},h={size:n,p:"x"};if("vertical"===o.orientation){const e=m$(!0,{},h);h=m$(!0,{},d),d=m$(!0,{},e)}a.area&&!1!==c.show&&s.push(i0(u,{data:e.consumableData,item:c,generatorType:"area",major:h,minor:d,layerObj:l,stngs:o})),t&&!1!==t.show&&(s.push(i0(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"1"),major:h,minor:d,layerObj:l,stngs:o},"none")),!i&&a.area&&!1!==c.show&&!1!==t.showMinor0&&s.push(i0(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"0"),major:h,minor:d,layerObj:l,stngs:o},"none")))}),s}(s,{width:r,height:i,missingMinor0:o,stngs:this.stngs})}};function a0(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,s=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(s,e.rect.height)):s}}function l0(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function c0(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 u0={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=a0(this,e,!1);FK({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=function(e){return e.settings.brush.components.map(e=>({key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"}))}(this.settings),this.state.start=a0(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=a0(this,e),function(e){if(e.state.active){const t=l0(e,e.state.start),n=l0(e,e.state.end),r=e.chart.shapesAt(c0(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(r,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([m$({type:"rect"},c0(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 d0(e,t,n){let r=n.renderer,i=n.style,o=n.props,s=n.h;const a=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})}(s,e,i,o),c=s("div",{dir:o.direction,class:$Q(m$({"pic-tooltip":!0},a.tooltip)),style:m$({position:"relative",display:"inline-block"},t.computedTooltipStyle)},s("div",{style:i.content,class:$Q(m$({"pic-tooltip-content":!0},a.content))},l),s("div",{class:$Q(m$({"pic-tooltip-arrow":!0},a.arrow)),style:m$({},i.arrow,i["arrow-".concat(t.dock)],t.computedArrowStyle)}));return r.render(c),r.element().children[0]}function h0(e){let t=e.defaultDuration,n=e.defaultDelay,r=null,i=null,o=!1;const s=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}(),a=function(){},l=()=>{r=null,i=null,o=!1,s.set("fulfilled")};return a.invoke=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;r&&(clearTimeout(r),s.set("debounced")),s.set("pending"),r=setTimeout(()=>{e(),o=!0,r=null,s.set("active")},c),a>0&&(i&&clearTimeout(i),i=setTimeout(l,a+Math.max(c,0)))},a.clear=()=>{o?s.set("cancelled"):r&&(clearTimeout(r),s.set("rejected")),i&&clearTimeout(i),r=null,i=null,o=!1},a.on=(e,t)=>{s.on(e,t)},a.destroy=()=>{a.clear(),s.destroy()},a}function p0(){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 f0(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 m0(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 g0(e,t,n,r,i,o){const s=t+o.x,a=n+o.y,l=i;return!(s<0||a<0)&&!(s+r>e.width||a+l>e.height)}function y0(e){let t=e.area,n=e.vx,r=e.vy,i=e.width,o=e.height,s=e.offset;const a=n+s.x,l=r+s.y,c=i,u=o;let d=a<0?-a:0,h=l<0?-l:0;return d+=a+c>t.width?-(a+c-t.width):0,h+=l+u>t.height?-(l+u-t.height):0,{x:d,y:h}}function v0(e){let t=e.options,n=e.pointer,r=e.width,i=e.height,o=e.dockOrder,s=e.x,a=e.y;const l=n.targetBounds,c=p0(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(s,"px"),top:"".concat(a,"px"),transform:u},computedArrowStyle:m0(t.offset)[t.dock],dock:t.dock};const d={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},h=f0(r,i,t.offset),p=[],f="target"===t.area?s:l.left+s,m="target"===t.area?a:l.top+a;for(let e=0;e<o.length;e+=1){const n=o[e],l=y0({area:d,vx:f,vy:m,width:r,height:i,offset:h[n]}),u={left:"".concat(s,"px"),top:"".concat(a,"px"),transform:c[n]},g=m0(t.offset)[n];0!==l.x&&(u.width="".concat(r-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(s+l.x,"px"),g.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:g,dock:n,rect:{width:r,height:i}};if(0===l.x&&0===l.y)return y;y.offset=l,p.push(y)}return p.sort((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x)),p[0]}function b0(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 m$({scaleRatio:i.scaleRatio},i.computedInner)}const x0={bounds:function(e){let t=e.resources,n=e.nodes,r=e.pointer,i=e.width,o=e.height,s=e.options;const a=r.targetBounds,l=t.getNodeBoundsRelativeToTarget(n[0]),c=l.x,u=l.y,d=l.width,h=l.height,p={left:{x:c,y:u+h/2},right:{x:c+d,y:u+h/2},top:{x:c+d/2,y:u},bottom:{x:c+d/2,y:u+h},inside:{x:c+d/2,y:u+h/2}},f=p0(s.offset),m=f[s.dock];if(m)return{computedTooltipStyle:{left:"".concat(p[s.dock].x,"px"),top:"".concat(p[s.dock].y,"px"),transform:m},computedArrowStyle:m0(s.offset)[s.dock],dock:s.dock};const g={width:"target"===s.area?a.width:window.innerWidth,height:"target"===s.area?a.height:window.innerHeight},y=f0(i,o,s.offset),v=["top","left","right","bottom","inside"];for(let e=0;e<v.length;e+=1){const t=v[e];if(g0(g,"target"===s.area?p[t].x:a.left+p[t].x,"target"===s.area?p[t].y:a.top+p[t].y,i,o,y[t]))return{computedTooltipStyle:{left:"".concat(p[t].x,"px"),top:"".concat(p[t].y,"px"),transform:f[t]},computedArrowStyle:m0(s.offset)[t],dock:t}}const b=function(e){let t=e.options,n=e.docks,r=e.dockOffsets,i=e.targetBounds,o=e.area,s=e.width;const a="top",l="target"===t.area?n[a].x:i.left+n[a].x,c=("target"===t.area?n[a].y:(i.top,n[a].y),r[a]),u=l+c.x,d=(c.y,s);let h=n.top.x;return u<0&&u+d>o.width||(u<0?h-=u:u+d>o.width&&(h-=u+d-o.width)),h}({options:s,docks:p,dockOffsets:y,targetBounds:a,area:g,width:i});return{computedTooltipStyle:{left:"".concat(b,"px"),top:"".concat(p.top.y,"px"),transform:f.top},computedArrowStyle:m0(s.offset+b-p.top.x,s.offset).top,dock:"top"}},pointer:function(e){let t=e.options,n=e.pointer,r=e.width,i=e.height;return v0({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,s=e.resources;const a=o[0],l=n.dx,c=n.dy,u=s.getComponentBoundsFromNode(a),d=l+u.x+u.width/2,h=c+u.y+u.height/2,p=a.desc.slice,f=p.start,m=p.end,g=p.outerRadius,y=(f+m)/2-Math.PI/2,v=2*Math.PI,b=(y%v+v)%v;let x=["top","left","right","bottom"];return"auto"===t.dock&&(x=b<=Math.PI/4||b>=7*Math.PI/4?["right","top","bottom","left"]:b<=3*Math.PI/4?["bottom","left","right","top"]:b<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),v0({x:d+g*u.scaleRatio.x*Math.cos(b),y:h+g*u.scaleRatio.y*Math.sin(b),pointer:n,width:r,height:i,options:t,dockOrder:x})}};function w0(e,t){let n=e.width,r=e.height,i=t.chart,o=t.state,s=t.props;const a={resources:{formatter:i.formatter,scale:i.scale,component:i.component,getComponentBoundsFromNode:e=>b0(e,o.pointer,i),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const r=b0(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 s.placement;if("object"===l&&"function"==typeof s.placement.fn)return s.placement.fn(a);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=m$(c,s.placement(a))),"object"===l&&x0[s.placement.type]?c=m$(c,s.placement):"string"===l&&x0[s.placement]&&(c=m$(c,{type:s.placement})),a.options=c;const u=x0[c.type](a);let d=a.resources.getComponentBoundsFromNode(a.nodes[0]),h=d.x,p=d.y,f=d.width,m=d.height;return h+=a.pointer.dx,f+=h,p+=a.pointer.dy,m+=p,u.computedTooltipStyle.left="".concat(Math.min(Math.max(0,h,parseFloat(u.computedTooltipStyle.left)),f),"px"),u.computedTooltipStyle.top="".concat(Math.min(Math.max(0,p,parseFloat(u.computedTooltipStyle.top)),m),"px"),u}let S0;function C0(){S0=null}const E0={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 M0={require:["chart","renderer"],defaultSettings:{settings:E0,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 s=n.element.getBoundingClientRect(),a=r.targetElement.getBoundingClientRect(),l=i,c=o,u=s.left-a.left,d=s.top-a.top,h=i-s.left,p=o-s.top;return i-=a.left,o-=a.top,{x:i,y:o,dx:u,dy:d,cx:h,cy:p,clientX:l,clientY:c,targetBounds:a,chartBounds:s}}(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=h0({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",()=>{!function(e){S0&&S0!==e&&S0()}(t),S0=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,m$({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,m$({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),S0===t&&(S0=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(),C0()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),C0()},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 s={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:r,h:o},a=[];return e.forEach(e=>{if("function"==typeof i.extract){const t=m$({node:e},s);a.push(i.extract(t))}}),a}(e,this),n=w0(d0(t,{},this).getBoundingClientRect(),this);this.state.tooltipElm=d0(t,n,this)}};const k0={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()}},I0={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},R0=/([astvzqmhlc])([^astvzqmhlc]*)/gi,_0=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function D0(e){const t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(R0,(e,n,r)=>{const i=function(e){const t=e.match(_0);return t?t.map(Number):[]}(r);let o=n.toLowerCase(),s=n;if("m"===o&&i.length>2&&(t.push([s,...i.splice(0,2)]),o="l",s="m"===s?"l":"L"),i.length<I0[o])return"";for(t.push([s,...i.splice(0,I0[o])]);i.length>=I0[o]&&i.length&&I0[o];)t.push([s,...i.splice(0,I0[o])]);return""}),t}const A0=2*Math.PI;function P0(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function L0(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 T0(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 s=P0(e,t),a=P0(t,n),l=P0(n,r),c={x:L0(.5,e.x,t.x,n.x,r.x),y:L0(.5,e.y,t.y,n.y,r.y)},u=P0(s,a),d=P0(a,l);return T0(e,s,u,c,i,o-1),T0(c,d,l,r,i,o-1),i}function O0(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 T0(e,r.cp1,r.cp2,n)}function q0(e,t,n){const r=[],i=!!e[4],o=!!e[5],s=e[3];let a,l,c,u,d=e[6],h=e[7],p=e[1],f=e[2];if("a"===e[0]&&(d+=t,h+=n),t===h&&n===h)return r;if(!p||!f)return r.push({x:d,y:h}),r;var m=function(e,t,n,r,i,o,s,a,l){let c,u,d,h,p,f;const m=eK(n%360),g=Math.cos(m),y=Math.sin(m),v=(a-o)/2,b=(l-s)/2,x=g*v+y*b,w=g*b-y*v;f=x**2/(e=Math.abs(e))**2+w**2/(t=Math.abs(t))**2,f>1&&(f=Math.sqrt(f),e*=f,t*=f);const S=e*w,C=t*x,E=S**2+C**2,M=(e*t)**2-E;let k=Math.sqrt(Math.max(M/E,0));r===i&&(k=-k);const I=k*(S/t),R=k*(-C/e);h=g*I-y*R+(a+o)/2,p=y*I+g*R+(l+s)/2;const _=(x-I)/e,D=(w-R)/t,A=(-x-I)/e,P=(-w-R)/t;return c=Math.atan2(D,_),c+=c<0?A0:0,u=Math.atan2(P,A),u+=u<0?A0:0,d=u-c,!i&&c<u?d-=A0:i&&u<c&&(d+=A0),d%=A0,{startAngle:c,sweepAngle:d,cx:h,cy:p,rx:e,ry:t}}(p,f,s,i,o,d,h,t,n);a=m.cx,l=m.cy,p=m.rx,f=m.ry,c=m.sweepAngle,u=m.startAngle;const g=Math.abs(c*Math.sqrt((p**2+f**2)/2)),y=Math.ceil(g/10),v=c/y;for(let e=1;e<=y;e++){const t=(u+v*e)%A0,n=Math.cos(t),i=Math.sin(t);r.push({x:a+n*p+-i*n,y:l+i*f+n*i})}return r}function N0(e){const t=D0(e),n=[],r=[];let i=0,o=0,s=null,a=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&&(s=null,a=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(...q0(u,i,o)),i+=u[6],o+=u[7];break;case"A":r.push(...q0(u,i,o)),i=u[6],o=u[7];break;case"c":r.push(...T0({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})),s=u[3]+i,a=u[4]+o,i+=u[5],o+=u[6];break;case"C":r.push(...T0({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),s=u[3],a=u[4],i=u[5],o=u[6];break;case"s":null!==s&&null!==s||(s=i,a=o),r.push(...T0({x:i,y:o},{x:2*i-s,y:2*o-a},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),s=u[1]+i,a=u[2]+o,i+=u[3],o+=u[4];break;case"S":null!==s&&null!==s||(s=i,a=o),r.push(...T0({x:i,y:o},{x:2*i-s,y:2*o-a},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),s=u[1],a=u[2],i=u[3],o=u[4];break;case"Q":r.push(...O0({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(...O0({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(...O0({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(...O0({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 j0={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=>{N0(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 z0=[function(e){e.component("box",FX),e.component("box-marker",FX)},function(e){e.component("point",YX),e.component("point-marker",YX)},function(e){e.component("pie",ZX)},function(e){e.component("grid-line",rJ)},function(e){e.component("ref-line",fJ)},function(e){e.component("axis",BJ)},function(e){e.component("container",VJ)},function(e){e.component("text",UJ)},function(e){e.component("scrollbar",XJ)},function(e){e.component("brush-range",dZ),e.component("brush-area-dir",mZ)},function(e){e.component("range",bZ)},function(e){e.component("brush-lasso",MZ)},function(e){e.component("labels",NQ)},function(e){e.component("legend-cat",XQ)},function(e){e.component("legend-seq",n0)},function(e){e.component("line",s0)},function(e){e.component("brush-area",u0)},function(e){e.component("tooltip",M0)},function(e){e.component("debug-collider",k0)},function(e){e.component("debug-path-to-points",j0)}];let F0=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 W0{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,s=void 0===o?0:o,a=e.height,l=void 0===a?0:a,c=e.minWidth,u=void 0===c?0:c,d=e.minHeight,h=void 0===d?0:d;this.set({x:n,y:i,width:s,height:l,minWidth:u,minHeight:h})}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,s=void 0===o?0:o,a=e.height,l=void 0===a?0:a,c=e.minWidth,u=void 0===c?0:c,d=e.minHeight,h=void 0===d?0:d;this.type="rect",s>=0?(this.x=n,this.width=Math.max(s,u)):(this.x=n+Math.min(s,-u),this.width=-Math.min(s,-u)),l>=0?(this.y=i,this.height=Math.max(l,h)):(this.y=i+Math.min(l,-h),this.height=-Math.min(l,-h))}containsPoint(e){return FK(this,e)}intersectsLine(e){return WK(this,_$(e))}intersectsRect(e){return jK(this,R$(e))}intersectsCircle(e){return PK(e,this)}intersectsPolygon(e){return NK(e,this)}intersectsGeoPolygon(e){return KK(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 $0{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,s=void 0===o?0:o,a=e.minRadius,l=void 0===a?0:a;this.set({cx:n,cy:i,r:s,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,s=void 0===o?0:o,a=e.minRadius,l=void 0===a?0:a;this.type="circle",this.cx=n,this.cy=i,this.r=Math.max(s,l),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return AK(this,e)}intersectsLine(e){return LK(this,_$(e))}intersectsRect(e){return PK(this,R$(e))}intersectsCircle(e){return n=e,!IK(t=this)&&!IK(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return TK(this,e)}intersectsGeoPolygon(e){return GK(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class B0{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,s=void 0===o?0:o,a=e.y2,l=void 0===a?0:a,c=e.tolerance,u=void 0===c?0:c;this.set({x1:n,y1:i,x2:s,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,s=void 0===o?0:o,a=e.y2,l=void 0===a?0:a,c=e.tolerance,u=void 0===c?0:c;this.type="line",this.x1=n,this.y1=i,this.x2=s,this.y2=l,this.tolerance=Math.max(0,Math.round(u)),this.vectors=this.points(),this.zeroSize=n===s&&i===l}containsPoint(e){if(this.tolerance>0){return LK({cx:e.x,cy:e.y,r:this.tolerance},this)}return BK(this,e)}intersectsLine(e){return $K(this,_$(e))}intersectsRect(e){return WK(R$(e),this)}intersectsCircle(e){return LK(e,this)}intersectsPolygon(e){return qK(e,this)}intersectsGeoPolygon(e){return YK(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class V0{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 OK(this,e)}intersectsCircle(e){return TK(e,this)}intersectsLine(e){return qK(this,_$(e))}intersectsRect(e){return NK(this,R$(e))}intersectsPolygon(e){return VK(this,e)}intersectsGeoPolygon(e){return HK(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 H0(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new V0(...t)}function G0(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function U0(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 Y0{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++)U0(this.vertices[e]),this.vertices[e].length>2&&G0(this.vertices[e]),this.polygons[e]=H0({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 UK(this,e)}intersectsCircle(e){return GK(e,this)}intersectsLine(e){return YK(this,_$(e))}intersectsRect(e){return KK(this,R$(e))}intersectsPolygon(e){return HK(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!jK(n,r)&&(zK(r,n)?DK(t,e):DK(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 K0(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Y0(...t)}function X0(e,t){return e.x!==t.x||e.y!==t.y}class J0{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++)X0(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=>BK(t,e))}intersectsCircle(e){return this.segments.some(t=>LK(e,t))}intersectsLine(e){const t=_$(e);return this.segments.some(e=>$K(e,t))}intersectsRect(e){const t=R$(e);return this.segments.some(e=>WK(t,e))}intersectsPolygon(e){return this.segments.some(t=>qK(e,t))}intersectsGeoPolygon(e){return this.segments.some(t=>YK(e,t))}points(){return this._points}}const Z0=qB();function Q0(e,t){return Z0.get(e)(t)}Z0.add("rect",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new W0(...t)}),Z0.add("circle",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new $0(...t)}),Z0.add("line",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new B0(...t)}),Z0.add("polygon",H0),Z0.add("geopolygon",K0),Z0.add("polyline",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new J0(...t)});class e1{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=Q0(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 t1{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new t1).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 t1&&(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],s=this._elements[2][0],a=this._elements[2][1],l=this._elements[2][2],c=0;return c=e*i*l+t*o*s+n*r*a-n*i*s-t*r*l-e*o*a,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],s=this._elements[1][2],a=this._elements[2][0],l=this._elements[2][1],c=this._elements[2][2];return this._elements=[[o*c-s*l,r*l-n*c,n*s-r*o],[s*a-i*c,t*c-r*a,r*i-t*s],[i*l-o*a,a*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,s=this._elements,a=[];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]*s[n][r];a.push({x:o[0],y:o[1]})}return a}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 n1=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function r1(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 i1(e,t){const n=t.args[0],r=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,r)}function o1(e,t){const n=t.args[0],r=isNaN(t.args[1])?0:t.args[1];e.translate(n,r)}function s1(e,t){t.args.length>=6&&e.transform(...t.args)}function a1(e,t){const n=function(e){let t,n=[];for(;null!==(t=n1.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?r1(t,r):"scale"===r.cmd?i1(t,r):"matrix"===r.cmd?s1(t,r):"translate"===r.cmd&&o1(t,r)}const l1={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},c1={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 u1(e,t){if(!t||!t.length||!e||"function"!=typeof c1[e.type])return[];switch(e.type){case"type":case"tag":return c1[e.type](e.value,t);case"attr":return c1[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return c1[e.type](t);default:return[]}}var d1={find:function(e,t){const n=[],r=[];let i,o;if(t.isBranch){let s;i=function(e){const t=[];let n,r,i,o;return e.split(/\s*,\s*/).forEach(e=>{e=e.trim(),n=[];const s=t=>{i=e.match(l1[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(l1).forEach(s),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++){s=i[e];const t=[];let n=o.slice(),a=!1;s.reverse().forEach(e=>{if(" "===e.type)return t.push(n),n=o.slice(),void(a=!1);n=u1(e,n),a=!0}),a&&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 h1(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=R$(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=_$(i),o.type=r;else if("polygon"===r||"polyline"===r){o={type:"path",d:ZY(i,"polygon"===r)}}else if("geopolygon"===r){let e="";for(let t=0;t<i.length;t++)e+=ZY(i[t],!0);o={type:"path",d:e}}return o}class p1{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=>h1(e,t,n))}:h1(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map(e=>new p1(e)),this._parent=()=>e.parent?new p1(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,s=t.top;i-=r,o-=void 0===s?0:s}return n.x+=i,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function f1(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new p1(...t)}class m1{constructor(e){this._node=f1(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 g1(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new m1(...t)}function y1(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=g1(n);const e=n.parent;e&&"stage"!==e.type&&y1(e,t.parent)}}function v1(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))?K0(n):H0(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=g1(i);return y1(i,e),e}}return null}(e,t,r):function(e,t,n){if(e.collider[t](n)){const t=g1(e);return y1(e,t),t}return null}(e,t,r)}function b1(e,t,n,r){const i=e.length;for(let o=0;o<i;o++){const i=e[o],s=v1(i,t,r);s&&n.push(s),!i.children||s||i.collider||b1(i.children,t,n,r)}}function x1(e,t,n){const r=e.length;for(let i=0;i<r;i++){const r=e[i];if(null!==v1(r,t,n))return!0;if(r.children&&!r.collider)return x1(r.children,t,n)}return!1}function w1(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(D$(e)){case"circle":return n.cx=e.cx*t,n.cy=e.cy*t,n.r=e.r,["intersectsCircle",n];case"rect":return n=I$(e).map(e=>iK(e,t)),["intersectsRect",n];case"line":return n=k$(e).map(e=>iK(e,t)),["intersectsLine",n];case"point":return n=iK(e,t),["containsPoint",n];case"polygon":return n.vertices=e.vertices.map(e=>iK(e,t)),["intersectsPolygon",n];case"geopolygon":return n.vertices=e.vertices.map(e=>e.map(e=>iK(e,t))),["intersectsGeoPolygon",n];default:return[]}}function S1(e,t){const n=w$(w1(t,e.dpi),2),r=n[0],i=n[1],o=[];return r&&(b1([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 C1(e,t){const n=w$(w1(t,e.dpi),2);return x1([e],n[0],n[1])}class E1 extends F0{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 s,a;s=this.attrs,a=e,Object.keys(JY).forEach(e=>{const t=a[e];void 0!==t&&(s[JY[e]]=t)}),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=m$(!0,{},n)),"string"==typeof r&&(this.tag=r),"string"==typeof i&&(this.strokeReference=i),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return d1.find(e,this).map(e=>f1(e))}getItemsFrom(e){return S1(this,e)}containsPoint(e){return C1(this,e)}intersectsLine(e){return C1(this,e)}intersectsRect(e){return C1(this,e)}intersectsCircle(e){return C1(this,e)}intersectsPolygon(e){return C1(this,e)}intersectsGeoPolygon(e){return C1(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new t1;void 0!==this.attrs.transform&&a1(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new t1;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 e1(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=Q0("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=Q0(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class M1 extends F0{addChild(e){if(!(e&&e instanceof F0))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 k1=M1.prototype;class I1 extends E1{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=m$({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=w$(e.bounds(t),3),i=r[0],o=r[2],s=i.x,a=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)?s:Math.min(s,n.x),n.y=isNaN(n.y)?a:Math.min(a,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]=m$({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=k1.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=m$({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=k1.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=m$({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(k1.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=m$(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(k1.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=m$(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function R1(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new I1(...t)}class _1 extends I1{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const D1=M1.prototype,A1=["x1","x2","y1","y2","id","offset","style"];class P1 extends E1{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=A1.length;r!==i;r++)n=A1[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return D1.addChild.call(this,e)}addChildren(e){return D1.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 D1.removeChild.call(this,e),this}removeChildren(e){return D1.removeChildren.call(this,e),this}}function L1(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new P1(...t)}const T1=M1.prototype,O1=["patternUnits","x","y","width","height","id"];class q1 extends E1{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=O1.length;r!==i;r++)n=O1[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return T1.addChild.call(this,e)}addChildren(e){return T1.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 T1.removeChild.call(this,e),this}removeChildren(e){return T1.removeChildren.call(this,e),this}}class N1 extends E1{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,s=void 0===o?0:o,a=e.height,l=void 0===a?0:a,c=e.rx,u=void 0===c?0:c,d=e.ry,h=void 0===d?0:d,p=e.collider,f=m$({type:"rect",x:n,y:i,width:s,height:l},p);super.set(e),s>=0?(this.attrs.x=n,this.attrs.width=s):(this.attrs.x=n+s,this.attrs.width=-s),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),h>0&&(this.attrs.ry=h),this.collider=f,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=I$(this.attrs),n=w$(M$(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t),4),r=n[0],i=n[1],o=n[2],s=n[3];return this.__boundingRect[e]={x:r,y:i,width:o-r,height:s-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 j1 extends E1{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,s=void 0===o?0:o,a=e.collider,l=m$({type:"circle",cx:n,cy:i,r:s},a);super.set(e),this.attrs.cx=n,this.attrs.cy=i,this.attrs.r=s,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,s=n-i,a=r-o;let l=2*i,c=2*o,u=[{x:s,y:a},{x:s+l,y:a},{x:s+l,y:a+c},{x:s,y:a+c}];if(e&&this.modelViewMatrix){u=this.modelViewMatrix.transformPoints(u);const t=w$(M$(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 z1 extends E1{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,s=void 0===o?0:o,a=e.y2,l=void 0===a?0:a,c=e.collider;super.set(e),this.attrs.x1=n,this.attrs.y1=i,this.attrs.x2=s,this.attrs.y2=l;const u={type:"line",x1:n,y1:i,x2:s,y2:l};this.collider=m$(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=k$(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const n=w$(M$(t),4),r=n[0],i=n[1],o=n[2],s=n[3],a=r!==o||i!==s;return this.__boundingRect[e]={x:r,y:i,width:a?Math.max(1,o-r):0,height:a?Math.max(1,s-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 F1=Math.PI/2;function W1(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function $1(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const B1={step:function(e){return new _B(e,.5)},stepAfter:function(e){return new _B(e,1)},stepBefore:function(e){return new _B(e,0)},linear:aB,basis:function(e){return new fB(e)},cardinal:yB.tension(0),catmullRom:bB,monotonex:function(e){return new EB(e)},monotoney:function(e){return new MB(e)},natural:function(e){return new IB(e)}};function V1(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 H1 extends E1{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=iB();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,s=e.generatorType,a=uB(),l=o.coordinates?o.coordinates.defined:null;a[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(B1["monotone"===r.curve?"monotone".concat(t.p):r.curve]),l?a.defined(e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined):a.defined(e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor));const c=o.connect?i.filter(a.defined()):i,u=("area"===s?a:a[s]())(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=N0(this.attrs.d),this.segments.length>1&&this.segments.every(e=>V1(e)))return void(this.collider=m$({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach(t=>{if(t.length<=1);else if(V1(t))this.collider=m$({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 s=e[n-1],a=e[n],l=e[n+1],c=W1(a,s),u=W1(a,l),d=(c+u)/2,h=d+Math.PI,p=Math.max(d,h),f=Math.min(d,h),m=c>u;if(1===n){const e=W1(s,a);r.push($1(s,e-F1,t)),i.unshift($1(s,e+F1,t))}const g=m?p:f,y=m?f:p;if(r.push($1(a,g,t)),i.unshift($1(a,y,t)),n===o-1){const e=W1(l,a);r.push($1(l,e+F1,t)),i.unshift($1(l,e-F1,t))}}return{type:"polygon",vertices:[...r,...i]}}(t,n,e.collider)}else this.collider=m$({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:N0(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=w$(M$(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 G1(e){let t=e.data,n=e._boundingRect,r=e._textBoundsFn;return null!=t&&(n||r)}let U1=class extends E1{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,s=void 0===o?0:o,a=e.dy,l=void 0===a?0:a,c=e.textBoundsFn,u=e.text,d=e.title,h=e.collider,p=e.boundingRect,f=e.ellipsed;super.set(e),this.attrs.x=n,this.attrs.y=i,this.attrs.dx=s,this.attrs.dy=l,this.attrs.text=u,void 0!==d&&(this.attrs.title=String(d)),"object"==typeof p?this._textBoundsFn=()=>p:"function"==typeof c&&(this._textBoundsFn=c),"string"==typeof f&&(this.ellipsed=f),this.collider=m$({type:G1(this)?"bounds":null},h),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=I$(e),r=w$(M$(t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n),4),i=r[0],o=r[1],s=r[2],a=r[3];return this.__boundingRect[t]={x:i,y:o,width:s-i,height:a-o},this.__boundingRect[t]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}};class Y1 extends E1{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,s=void 0===o?0:o,a=e.height,l=void 0===a?0:a,c=e.rx,u=void 0===c?0:c,d=e.ry,h=void 0===d?0:d,p=e.src,f=e.collider,m=e.cx,g=void 0===m?0:m,y=e.cy,v=void 0===y?0:y,b=e.r,x=void 0===b?0:b,w=e.opacity,S=e.imageScalingFactor,C=e.imagePosition,E=e.symbol;let M;M="circle"===e.symbol?m$({type:"circle",cx:g,cy:v,r:x},f):m$({type:"bounds",x:n,y:i,width:s,height:l},f),super.set(e),s>=0?(this.attrs.x=n,this.attrs.width=s):(this.attrs.x=n+s,this.attrs.width=-s),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),h>0&&(this.attrs.ry=h),p&&(this.attrs.src=p),this.attrs.r=x,this.attrs.cx=g,this.attrs.cy=v,this.attrs.opacity=void 0!==w?w:1,this.attrs.imageScalingFactor=void 0!==S?S:1,this.attrs.imagePosition=C||"center-center",this.attrs.symbol=E||"rectangle",this.collider=M,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?m$(this.collider,{type:"circle",cx:e.cx,cy:e.cy,r:e.r}):m$(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=I$(this.attrs),n=w$(M$(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t),4),r=n[0],i=n[1],o=n[2],s=n[3];return this.__boundingRect[e]={x:r,y:i,width:o-r,height:s-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,s=2*n,a=[{x:r,y:i},{x:r+o,y:i},{x:r+o,y:i+s},{x:r,y:i+s}];if(e&&this.modelViewMatrix){a=this.modelViewMatrix.transformPoints(a);const t=w$(M$(a),4),n=t[0],r=t[1];o=t[2]-n,s=t[3]-r,this.__bounds[e]=[{x:n,y:r},{x:n+o,y:r},{x:n+o,y:r+s},{x:n,y:r+s}]}else this.__bounds[e]=a;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 K1=qB();function X1(e,t){return K1.get(e)(t)}K1.add("rect",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new N1(...t)}),K1.add("circle",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new j1(...t)}),K1.add("text",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new U1(...t)}),K1.add("line",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new z1(...t)}),K1.add("path",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new H1(...t)}),K1.add("stage",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new _1(...t)}),K1.add("container",R1),K1.add("defs",R1),K1.add("linearGradient",L1),K1.add("radialGradient",L1),K1.add("conicGradient",L1),K1.add("stop",L1),K1.add("pattern",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new q1(...t)}),K1.add("image",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Y1(...t)});const J1=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 s="";for(let t=0;t<e.length;t++)s=e[t],void 0!==i[s]&&(o[s]=i[s]);return m$(o,r),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function Z1(e,t){if(Array.isArray(t))for(let n=0,r=t.length;n<r;n++)t[n](e)}function Q1(e,t,n){e.node=n[t],e.index=t}function e2(e,t,n,r){let i=!1;const o={siblings:e,node:null,index:0};for(let s=0,a=e.length;s<a;s++){if(Q1(o,s,e),Z1(o,r.create),i="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,i)continue;o.node=J1.save(o.node);const a=X1(o.node.type,o.node);a&&(o.node.transform&&(n.save(),a1(o.node.transform,n)),n.isIdentity()||(a.modelViewMatrix=n.clone()),t.addChild(a),o.node.children&&e2(o.node.children,a,n,r),o.node.transform&&n.restore()),J1.restore()}}function t2(e){let t=e.items,n=e.stage,r=e.dpi,i=e.on,o=void 0===i?{}:i;return n||(n=X1("stage",r)),e2(t,n,new t1,o),n}function n2(e,t,n){const r=n.orientation,i=n.degree,o=n.stops,s=void 0===o?[]:o;let a=null;if("radial"===r){const n=t.boundingRect();a=e.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else if("conic"===r){const t=n.startAngle||0,r=n.x||0,i=n.y||0;a=e.createConicGradient(t,r,i)}else{const r=tK(i);["x1","x2","y1","y2"].forEach(e=>{e in n&&(r[e]=n[e])});const o=t.boundingRect();a=e.createLinearGradient(o.x+r.x1*o.width,o.y+r.y1*o.height,o.x+r.x2*o.width,o.y+r.y2*o.height)}for(let e=0,t=s.length;e<t;e++){let t=s[e];a.addColorStop(t.offset,t.color)}return a}function r2(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 i2(){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,s=e.margin,a=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!==s&&(l.margin.left=isNaN(s.left)?0:s.left,l.margin.top=isNaN(s.top)?0:s.top),"object"==typeof a&&["left","right","top","bottom"].forEach(e=>{!isNaN(a[e])&&a[e]>0&&(l.edgeBleed[e]=a[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 o2(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:_Q,textBounds:AQ,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function s2(e){return t=>{let n=t.node;"text"!==n.type||null==n.data||n.textBoundsFn||(n.textBoundsFn=e.textBounds)}}const a2=200,l2=200;class c2{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*a2,height:n.computedPhysical.height+2*l2},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 u2=qB();function d2(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function h2(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function p2(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function f2(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 s=o[0],a=o[1],l=o[2];if(s in t.attrs&&!(a in r)&&e[a]!==t.attrs[s]){const n=l?l(t.attrs[s]):t.attrs[s];"function"==typeof e[a]?e[a](n):e[a]=n}}for(let t=0,n=i.length;t<n;t++){const n=i[t];e[n]=r[n]}}function m2(e,t,n,r){for(let i=0,o=e.length;i<o;i++){let o=e[i],s={};t.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?s.fillStyle=n2(t,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(s.fillStyle=r.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?s.strokeStyle=n2(t,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(s.strokeStyle=r.patterns.create(o.attrs.stroke))),f2(t,o,n,s),o.modelViewMatrix&&p2(o.modelViewMatrix.elements,t),u2.has(o.type)&&u2.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&&m2(o.children,t,n,r),t.restore()}}function g2(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t2;const r={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let i,o=!1,s=i2();const a=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",d2]];let l;const c=o2();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 c2(e)),n.appendChild(e),e),c.getScene=r=>{const i=h2(t&&t.getContext()||e.getContext("2d")),o=s.scaleRatio.x,a=s.scaleRatio.y,l={type:"container",children:r,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*i*o,", ").concat(s.edgeBleed.top*i*a,")"):""};return 1===i&&1===o&&1===a||(l.transform+="scale(".concat(i*o,", ").concat(i*a,")")),n({items:[l],dpi:i,on:{create:[bQ(c.measureText),s2(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]||r2(e,t,n),r[i]):r2(e,t,n)},clear(){r={}}}}(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),d=h2(u),h=t&&r.transform();if(h)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:h}),t.apply(),!0;o&&(e.style.left="".concat(s.computedPhysical.x,"px"),e.style.top="".concat(s.computedPhysical.y,"px"),e.style.width="".concat(s.computedPhysical.width,"px"),e.style.height="".concat(s.computedPhysical.height,"px"),e.width=Math.round(s.computedPhysical.width*d),e.height=Math.round(s.computedPhysical.height*d),t&&t.updateSize({rect:s,dpiRatio:d,canvasBufferSize:r.canvasBufferSize}));const p=c.getScene(n),f=!i||!p.equals(i);l.clear();const m=o||f,g="function"==typeof r.progressive&&r.progressive();return m&&(g&&!g.isFirst||c.clear(),m2(p.children,u,a,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,g&&!g.isFirst&&p.children.unshift(...i.children),i=p,m},c.itemsAt=e=>i?i.getItemsFrom(e):[],c.findShapes=e=>i?i.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),i=null,c),c.size=e=>{if(e){const t=i2(e);JSON.stringify(s)!==JSON.stringify(t)&&(o=!0,s=t)}return s},c.destroy=()=>{e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),i=null},c}function y2(e,t){u2.add(e,t)}function v2(e,t){return Math.max(0,Math.min(e,t))}const b2=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),x2=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),w2=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function S2(e){return b2.test(e)}function C2(e){return x2.test(e)||w2.test(e)}function E2(e){let t,n,r=e?e.length:0;for(t=0;t<r;t++){if(n=e[t],S2(n))return"ltr";if(C2(n))return"rtl"}return"ltr"}const M2={start:"end",end:"start",center:"center",middle:"middle"};function k2(e,t){return"rtl"===t?M2[e]:e}function I2(e,t){if(I2.cache[e])return void t(I2.cache[e]);const n=new Image;n.src=e,n.onload=()=>{I2.cache[e]=n,t(n)},n.onerror=e=>{console.error("Image load error",e)}}function R2(e,t){const n=[];let r;const i=[],o=[],s=[];let a,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),a=e.map(c),l=t.map(c);for(let e=0,r=t.length;e<r;e++){-1===a.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]):s.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=R2([],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=R2(s[e].children||[],o[e].content.children||[]),o[e].object=s[e].object,o[e].children=o[e].diff.items;return r=o.concat(n),n.isTree=!0,i.isTree=!0,o.isTree=!0,s.isTree=!0,r.isTree=!0,{added:n,updatedNew:o,updatedOld:s,removed:i,items:r}}function _2(e,t,n){for(let r=0,i=e.length;r<i;r++)e[r].object=n(e[r].content.type,t)}function D2(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 A2(e,t,n,r){let i;for(let o=0,s=e.length;o<s;o++)i=e[o],null!==i.object&&void 0!==i.object&&(n(i.object,i.content),i.diff&&(_2(i.diff.added,i.object,t),D2(i.diff.removed,r),A2(i.diff.items,t,n,r)))}function P2(e,t,n,r,i,o){const s=R2(e,t);return _2(s.added,n,r),D2(s.removed,o),A2(s.items,r,i,o),s.items}I2.cache={},y2("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,s){o=v2(r/2,o>0?o:s),s=v2(i/2,s>0?s:o),e.moveTo(t,n+s),e.lineTo(t,n+i-s),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-s),e.lineTo(t+r,n+s),e.quadraticCurveTo(t+r,n,t+r-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+s)}(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()}),y2("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()}),y2("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()}),y2("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)}),y2("text",function(e,t){let n=t.g,r=t.ellipsed,i=t.doStroke;const o=r||xQ(e,_Q);n.font=[e["font-style"],e["font-weight"],e["font-size"],e["font-family"]].filter(e=>!!e).join(" ");const s=E2(e.text);n.canvas.dir!==s&&(n.canvas.dir=s);const a=k2("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);a&&n.textAlign!==a&&(n.textAlign=a);const l=wQ(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)}),y2("image",function(e,t){let n=t.g;const r=n.canvas,i=n.getTransform(),o=window.devicePixelRatio||1,s=r.clientWidth*o,a=r.clientHeight*o;r.width===s&&r.height===a||(r.width=s,r.height=a),I2(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,s=i-e.height/2;n.save(),n.beginPath(),n.arc(r,i,e.r,0,2*Math.PI),n.clip(),n.drawImage(t,o,s,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 L2="http://www.w3.org/2000/svg",T2=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(L2,"container"===e?"g":e);return t.appendChild(n),n},O2=e=>{e.parentNode&&e.parentNode.removeChild(e)};function q2(e){let t=e.element,n=e.attrs;return function(){const e=n.width,r=n.height,i=n.imagePosition,o=n.imageScalingFactor,s=n.symbol;let a=n.x,l=void 0===a?0:a,c=n.y,u=void 0===c?0:c,d=e>0?e:this.naturalWidth,h=r>0?r:this.naturalHeight;switch(o&&(d*=o,h*=o),i){case"top-center":u-=h/2;break;case"center-left":l-=d/2;break;case"center-right":l+=d/2;break;case"top-left":l-=d/2,u-=h/2;break;case"top-right":l+=d/2,u-=h/2;break;case"bottom-left":l-=d/2,u+=h/2;break;case"bottom-right":l+=d/2,u+=h/2;break;case"bottom-center":u+=h/2}if(t.setAttribute("width",d),t.setAttribute("height",h),t.setAttribute("x",l-d/2),t.setAttribute("y",u-h/2),t.setAttribute("preserveAspectRatio","none"),"circle"===s){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(L2,"defs"),e.firstChild),r=document.createElementNS(L2,"clipPath");r.setAttribute("id",n);const i=document.createElementNS(L2,"circle");i.setAttribute("cx",l),i.setAttribute("cy",u),i.setAttribute("r",Math.min(d,h)/2),r.appendChild(i),t.appendChild(r)}t.setAttribute("clip-path","url(#".concat(n,")"))}}}const N2=(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||xQ(t.attrs,_Q);const n=E2(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",k2(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(L2,"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=q2({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?wQ(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 j2{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 z2(){return new j2(P2,T2,N2,O2)}function F2(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 W2(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L2,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t2;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:z2)();let r,i,o,s=!1,a=i2();const l={transform:void 0,disableScreenReader:!1},c=o2(),u={type:"defs",children:[]},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F2,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(s=>{let a="";const l=o[s],c=t(l),u="picasso-pattern-".concat(r,"-").concat(c);if("undefined"!=typeof window&&(a=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(s,"Reference")]="url('".concat(a,"#").concat(u,"')")})},clear(){n={}}};return i}(u.children),h=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F2,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",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=t(i[o]),l="picasso-gradient-".concat(r,"-").concat(a);if(!n[a]){let t=i[o],r=t.orientation,s=t.degree,c=t.stops,u=void 0===c?[]:c,d={};void 0===s&&(s=90),"radial"===r?d.type="radialGradient":(d=tK(s),["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[a]=l}return"url('".concat(s,"#").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=a.scaleRatio.x,r=a.scaleRatio.y,i={type:"container",children:Array.isArray(e)?[...e,u]:e,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*n,", ").concat(a.edgeBleed.top*r,")"):""};return 1===n&&1===r||(i.transform+="scale(".concat(n,", ").concat(r,")")),t({items:[i],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},h.onCreate,d.onCreate,bQ(c.measureText),s2(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,s=t.horizontalMoving,a=t.verticalMoving;return i.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(r,", ").concat(o,", ").concat(s,", ").concat(a,")"),!0}i.style.transform="";l.disableScreenReader&&r.setAttribute("aria-hidden",!0),s&&(r.style.left="".concat(a.computedPhysical.x,"px"),r.style.top="".concat(a.computedPhysical.y,"px"),r.setAttribute("width",a.computedPhysical.width),r.setAttribute("height",a.computedPhysical.height)),h.clear(),d.clear(),u.children.length=0;const p=c.getScene(e),f=!o||!p.equals(o),m=s||f;return m&&(c.clear(),n.render(p.children,i)),s=!1,o=p,m},c.itemsAt=e=>o?o.getItemsFrom(e):[],c.findShapes=e=>o?o.findShapes(e):[],c.clear=()=>{if(!i)return c;o=null;const e=i.cloneNode(!1);return r.replaceChild(e,i),i=e,c},c.destroy=()=>{r&&r.parentNode&&r.parentNode.removeChild(r),r=null,i=null},c.size=e=>{if(e){const t=i2(e);JSON.stringify(a)!==JSON.stringify(t)&&(s=!0,a=t)}return a},c}var $2,B2,V2,H2,G2,U2,Y2,K2={},X2=[],J2=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Z2(e,t){for(var n in t)e[n]=t[n];return e}function Q2(e){var t=e.parentNode;t&&t.removeChild(e)}function e5(e,t,n){var r,i,o,s={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?$2.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return t5(e,s,r,i,null)}function t5(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?++V2:i};return null==i&&null!=B2.vnode&&B2.vnode(o),o}function n5(e){return e.children}function r5(e,t){this.props=e,this.context=t}function i5(e,t){if(null==t)return e.__?i5(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?i5(e):null}function o5(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 o5(e)}}function s5(e){(!e.__d&&(e.__d=!0)&&H2.push(e)&&!a5.__r++||G2!==B2.debounceRendering)&&((G2=B2.debounceRendering)||U2)(a5)}function a5(){var e,t,n,r,i,o,s,a;for(H2.sort(Y2);e=H2.shift();)e.__d&&(t=H2.length,r=void 0,i=void 0,s=(o=(n=e).__v).__e,(a=n.__P)&&(r=[],(i=Z2({},o)).__v=o.__v+1,g5(a,o,i,n.__n,void 0!==a.ownerSVGElement,null!=o.__h?[s]:null,r,null==s?i5(o):s,o.__h),y5(r,o),o.__e!=s&&o5(o)),H2.length>t&&H2.sort(Y2));a5.__r=0}function l5(e,t,n,r,i,o,s,a,l,c){var u,d,h,p,f,m,g,y=r&&r.__k||X2,v=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(p=n.__k[u]=null==(p=t[u])||"boolean"==typeof p||"function"==typeof p?null:"string"==typeof p||"number"==typeof p||"bigint"==typeof p?t5(null,p,null,null,p):Array.isArray(p)?t5(n5,{children:p},null,null,null):p.__b>0?t5(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)){if(p.__=n,p.__b=n.__b+1,null===(h=y[u])||h&&p.key==h.key&&p.type===h.type)y[u]=void 0;else for(d=0;d<v;d++){if((h=y[d])&&p.key==h.key&&p.type===h.type){y[d]=void 0;break}h=null}g5(e,p,h=h||K2,i,o,s,a,l,c),f=p.__e,(d=p.ref)&&h.ref!=d&&(g||(g=[]),h.ref&&g.push(h.ref,null,p),g.push(d,p.__c||f,p)),null!=f?(null==m&&(m=f),"function"==typeof p.type&&p.__k===h.__k?p.__d=l=c5(p,l,e):l=u5(e,p,h,y,f,l),"function"==typeof n.type&&(n.__d=l)):l&&h.__e==l&&l.parentNode!=e&&(l=i5(h))}for(n.__e=m,u=v;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=d5(r).nextSibling),x5(y[u],y[u]));if(g)for(u=0;u<g.length;u++)b5(g[u],g[++u],g[++u])}function c5(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?c5(r,t,n):u5(n,r,r,i,r.__e,t));return t}function u5(e,t,n,r,i,o){var s,a,l;if(void 0!==t.__d)s=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),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<r.length;l+=1)if(a==i)break e;e.insertBefore(i,o),s=o}return void 0!==s?s:i.nextSibling}function d5(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=d5(n)))return r;return null}function h5(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||J2.test(t)?n:n+"px"}function p5(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||h5(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||h5(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?m5:f5,o):e.removeEventListener(t,o?m5:f5,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 f5(e){return this.l[e.type+!1](B2.event?B2.event(e):e)}function m5(e){return this.l[e.type+!0](B2.event?B2.event(e):e)}function g5(e,t,n,r,i,o,s,a,l){var c,u,d,h,p,f,m,g,y,v,b,x,w,S,C,E=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(c=B2.__b)&&c(t);try{e:if("function"==typeof E){if(g=t.props,y=(c=E.contextType)&&r[c.__c],v=c?y?y.props.value:c.__:r,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in E&&E.prototype.render?t.__c=u=new E(g,v):(t.__c=u=new r5(g,v),u.constructor=E,u.render=w5),y&&y.sub(u),u.props=g,u.state||(u.state={}),u.context=v,u.__n=r,d=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=E.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=Z2({},u.__s)),Z2(u.__s,E.getDerivedStateFromProps(g,u.__s))),h=u.props,p=u.state,u.__v=t,d)null==E.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==E.getDerivedStateFromProps&&g!==h&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,v),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,v)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(e){e&&(e.__=t)}),b=0;b<u._sb.length;b++)u.__h.push(u._sb[b]);u._sb=[],u.__h.length&&s.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,v),null!=u.componentDidUpdate&&u.__h.push(function(){u.componentDidUpdate(h,p,f)})}if(u.context=v,u.props=g,u.__P=e,x=B2.__r,w=0,"prototype"in E&&E.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=Z2(Z2({},r),u.getChildContext())),d||null==u.getSnapshotBeforeUpdate||(f=u.getSnapshotBeforeUpdate(h,p)),C=null!=c&&c.type===n5&&null==c.key?c.props.children:c,l5(e,Array.isArray(C)?C:[C],t,n,r,i,o,s,a,l),u.base=t.__e,t.__h=null,u.__h.length&&s.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=v5(n.__e,t,n,r,i,o,s,l);(c=B2.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=a,t.__h=!!l,o[o.indexOf(a)]=null),B2.__e(e,t,n)}}function y5(e,t){B2.__c&&B2.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){B2.__e(e,t.__v)}})}function v5(e,t,n,r,i,o,s,a){var l,c,u,d=n.props,h=t.props,p=t.type,f=0;if("svg"===p&&(i=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&"setAttribute"in l==!!p&&(p?l.localName===p:3===l.nodeType)){e=l,o[f]=null;break}if(null==e){if(null===p)return document.createTextNode(h);e=i?document.createElementNS("http://www.w3.org/2000/svg",p):document.createElement(p,h.is&&h),o=null,a=!1}if(null===p)d===h||a&&e.data===h||(e.data=h);else{if(o=o&&$2.call(e.childNodes),c=(d=n.props||K2).dangerouslySetInnerHTML,u=h.dangerouslySetInnerHTML,!a){if(null!=o)for(d={},f=0;f<e.attributes.length;f++)d[e.attributes[f].name]=e.attributes[f].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||p5(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]||p5(e,o,t[o],n[o],r)}(e,h,d,i,a),u)t.__k=[];else if(f=t.props.children,l5(e,Array.isArray(f)?f:[f],t,n,r,i&&"foreignObject"!==p,o,s,o?o[0]:n.__k&&i5(n,0),a),null!=o)for(f=o.length;f--;)null!=o[f]&&Q2(o[f]);a||("value"in h&&void 0!==(f=h.value)&&(f!==e.value||"progress"===p&&!f||"option"===p&&f!==d.value)&&p5(e,"value",f,d.value,!1),"checked"in h&&void 0!==(f=h.checked)&&f!==e.checked&&p5(e,"checked",f,d.checked,!1))}return e}function b5(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){B2.__e(e,n)}}function x5(e,t,n){var r,i;if(B2.unmount&&B2.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||b5(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){B2.__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]&&x5(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||Q2(e.__e),e.__=e.__e=e.__d=void 0}function w5(e,t,n){return this.constructor(e,n)}function S5(){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=i2();const o={transform:void 0,disableScreenReader:!1},s=o2();return s.element=()=>n,s.root=()=>n,s.settings=e=>(e&&Object.keys(o).forEach(t=>{void 0!==e[t]&&(o[t]=e[t])}),o),s.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),s.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,s=t.horizontalMoving,a=t.verticalMoving;return n.style.transform="matrix(".concat(e,", ").concat(r,", ").concat(i,", ").concat(o,", ").concat(s,", ").concat(a,")"),!0}n.style.transform="";let s;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"),s=Array.isArray(e)?e5("div",null,e):e,r=function(e,t,n){var r,i,o;B2.__&&B2.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],g5(t,e=(!r&&n||t).__k=e5(n5,null,[e]),i||K2,K2,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?$2.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),y5(o,e)}(s,n,r),!0},s.renderArgs=[e5],s.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;r=null}return s},s.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,r=null},s.size=e=>(e&&(i=i2(e)),i),s}$2=X2.slice,B2={__e:function(e,t,n,r){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},V2=0,r5.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Z2({},this.state),"function"==typeof e&&(e=e(Z2({},n),this.props)),e&&Z2(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),s5(this))},r5.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),s5(this))},r5.prototype.render=n5,H2=[],U2="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Y2=function(e,t){return e.__v.__b-t.__v.__b},a5.__r=0;var C5=[function(e){e.renderer("svg",W2)},function(e){e.renderer("canvas",g2)},function(e){e.renderer("dom",S5)}];const E5={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const M5=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?E5.OFF:t,r=e.pipe,i=void 0===r?console:r,o=n;const s={[E5.OFF]:()=>{},[E5.ERROR]:function(){return i.error(...arguments)},[E5.WARN]:function(){return i.warn(...arguments)},[E5.INFO]:function(){return i.info(...arguments)},[E5.DEBUG]:function(){return i.log(...arguments)}},a=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];(s[e]||s[E5.DEBUG])(...n)}};return{log:a,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a(E5.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a(E5.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a(E5.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a(E5.DEBUG,...t)},level:e=>("number"==typeof e&&(o=e),o),LOG_LEVEL:E5}}(t.logger),i={component:qB(n.component,"component",r),data:qB(n.data,"data",r),formatter:qB(n.formatter,"formatter",r),interaction:qB(n.interaction,"interaction",r),renderer:EX(n.renderer),scale:qB(n.scale,"scale",r),symbol:qB(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:m$({},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=>CX(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=g$,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:MX,data:DX,formatter:sG,interaction:AX,renderer:EX(),scale:aY,symbol:pK});z0.forEach(M5.use),C5.forEach(M5.use),[].forEach(M5.use);const k5=M5();k5.use(s$),k5.renderer.prio(["canvas"]);const I5=(e,t)=>e&&"center"!==e&&"rtl"===t?Pj(e):e,R5=({cell:e,representation:t,textStyle:n,imageContainerHorizontalAlignment:r})=>{const{imageBox:i}=t,{styleService:{grid:{lineClamp:o}}}=eO(),{direction:s}=YT();return co.jsxs("div",{style:{display:"grid",gridTemplateColumns:`${i?.width??24}px 1fr`,maxHeight:"fit-content",alignItems:"center",justifyContent:"flex-start",boxSizing:"border-box"},children:[co.jsx("div",{"data-key":"image-container--partial-image",style:{display:"flex",flexDirection:"column",justifyContent:Vj(e),alignItems:I5(r,s),overflow:"hidden",boxSizing:"border-box",border:"4px solid transparent",width:i?.width??24,height:"100%"},children:co.jsx(uz,{representation:t,textStyle:n})}),co.jsx(Bz,{padding:4/(o<=2?2:1),alignSelf:Vj(e,!0),children:!!t.labelStructure&&lz(t.labelStructure)})]})},_5=({suffix:e,delimeter:t})=>` ${e?t:""} ${e}`,D5=({href:e,text:t,labelStructure:n,interactions:r,color:i})=>co.jsxs("span",{children:[co.jsx(Pu,{...gF({href:e,text:t,interactions:r,color:i}),children:n?.maskedValue?n.maskedValue:n?.originalValue}),!!n&&_5(n)]}),A5=({children:e,textStyle:t,shouldEnableStickyText:n})=>co.jsx("span",{style:{...t,border:"4px solid transparent",boxSizing:"border-box",...n&&{alignSelf:"flex-start",position:"sticky",top:0}},children:e}),P5=({isLeftColumn:e,styleService:t,cell:n,isIndentModeEnabled:r})=>e?r?t.grid.lineClamp:Math.max(t.grid.lineClamp,n.leafCount*t.grid.lineClamp):t.grid.columnLineClamp,L5=({cell:e,isCellSelected:t,isLeftColumn:n})=>{const{direction:r}=YT(),{isActive:i}=Wj(),{layoutService:o,styleService:s}=eO(),{env:a,interactions:l}=JT(),c=n&&o.isIndentModeEnabled;let u;if(u=a.flags.isEnabled("VNA-670-SEPARATE_NULL_VALUE_STYLING")&&e.isNull?o.getDimensionNullValueText():e.isNull?vP:n?(e=>{const{representation:{text:t,labelStructure:n}}=e;if(e.isNull)return vP;if(!n||!n.originalValue)return t;const{originalValue:r,maskedValue:i,suffix:o,delimeter:s}=n;return`${0!==i.length?i:r} ${o?s:""} ${o}`.trim()})(e):e.representation.text,e.isEmpty)return null;const d=(({cell:e,styleService:t,isCellSelected:n,isLeftColumn:r,isIndentModeEnabled:i})=>({...TP,...OP(P5({cell:e,isLeftColumn:r,styleService:t,isIndentModeEnabled:i})),color:Kj({cell:e,styleService:t,isCellSelected:n}),fontWeight:Xj({cell:e,styleService:t}),fontStyle:Jj({cell:e,styleService:t}),textDecoration:Zj({cell:e,styleService:t}),fontFamily:t.dimensionValues.fontFamily,fontSize:t.dimensionValues.fontSize}))({cell:e,styleService:s,isCellSelected:t,isLeftColumn:n,isIndentModeEnabled:o.isIndentModeEnabled});if(e.representation.type===KA.Image&&!e.isTotal&&!e.isNull){const{labelStructure:t}=e.representation,i=n&&t&&t.suffix?R5:dz;return co.jsx(i,{cell:e,representation:e.representation,leafCount:e.leafCount,textStyle:d,isLeftColumn:n,canExpandOrCollapse:e.ref.qCanCollapse||e.ref.qCanExpand,imageContainerHorizontalAlignment:hF(e,o,n,r)})}if(e.representation.type===KA.Link&&!i&&!e.isTotal&&!e.isNull){const t=n&&e.representation.labelStructure?D5:yF;u=co.jsx(t,{text:e.representation.text,labelStructure:e.representation.labelStructure,href:e.representation.url,interactions:l,color:e.expressionColor.color})}return co.jsx(A5,{shouldEnableStickyText:c,textStyle:{...d,...e.representation.type===KA.Image&&e.isNull?{alignSelf:Vj(e)}:{}},children:u})},T5=({index:e,style:t,data:n})=>{const{styleService:r,layoutService:i}=eO(),{isSelected:o}=Wj(),{isLeftColumn:s=!1,showLastBorder:a,itemCount:l,isLast:c,totalDividerIndex:u}=n,{isAdjustingWidth:d,setIsAdjustingWidth:h}=Dz([n]),p=dF(e,n),f=s?e===l-1:c,m=s?c:e===l-1,g=rj(p,u,i.isIndentModeEnabled);if(void 0===p){const{background:n}=r.dimensionValues;return co.jsx(oj,{style:{...t,background:n},index:e,isLastRow:f,isLastColumn:m,showLastBorder:a,isLeftColumn:s,showTotalCellDivider:g})}const y=o(p);return co.jsxs(fF,{reactWindowStyle:t,isLeftColumn:s,isLastRow:f,isLastColumn:m,isCellSelected:y,showTotalCellDivider:g,cell:p,data:n,isAdjustingWidth:d,index:e,children:[co.jsxs(sj,{verticalAlign:Vj(p),width:aj(p.representation),right:p.isLeftColumn?void 0:4,isLeftColumn:s,children:[co.jsx(nz,{isLeftColumn:s,isCellSelected:y,cell:p}),co.jsx(L5,{isLeftColumn:s,isCellSelected:y,cell:p})]}),co.jsx(Lz,{cellInfo:{...p,columnWidthLocation:p.isPseudoDimension?nP.Measures:nP.Dimension},columnWidth:t.width,isLastColumn:m,setIsAdjustingWidth:h})]})};var O5=t.memo(T5,FN);const q5=({list:e,listValues:t,isLastRow:n,getRightGridColumnWidth:r})=>i=>{const o=n?e[i]:t.at(i);return o&&0===i&&o.x>0?(o.leafCount+o.x+o.distanceToNextCell)*r():!n&&o?(o.leafCount+o.distanceToNextCell)*r():r(o?.x??i)},N5=(e,t,n,r)=>{const i=Object.values(e);let o,s=i.length;return r&&(s=n,o=t/s),{itemCount:s,estimatedItemSize:o,listValues:i}},j5=(e,t)=>n=>{e.current&&(e.current[t]=n)},z5={display:"flex",height:"fit-content",borderWidth:"1px 0px 0px 0px",...PP},F5={overflow:"hidden",willChange:"auto",flexShrink:0},W5=({leftGridRef:e,width:t,height:n,columnWidths:r,showLastBorder:i})=>{const{pageInfo:o,direction:s}=YT(),{layoutService:a,styleService:{contentCellHeight:l,grid:{divider:c}}}=eO(),{qSize:u}=a.layout.qHyperCube,{gridSectionsData:{leftDimensionData:d},visibleDimensionsInfo:{visibleLeftDimensionInfo:h}}=xq();uF(e,d),cF(e,t,n,l);const p=o.rowsOnCurrentPage*l,f={...z5,borderColor:c,width:r.reduce((e,t)=>e+t,0)};return co.jsx("div",{style:f,"data-section-id":"LEFT_GRID",children:d.grid.map((t,c)=>{const f=c===d.columnCount-1,m=oO(h[c]),{itemCount:g,estimatedItemSize:y,listValues:v}=N5(t,p,o.rowsOnCurrentPage,f),b=a.isIndentModeEnabled?()=>l:((e,t,n,r,i)=>o=>{const s=r?e[o]:t.at(o);if(s&&0===o&&s.pageY>0)return(s.leafCount+s.pageY+s.distanceToNextCell)*n;if(s&&s.leafCount>0){const e=s.y===i-s.leafCount;return(s.leafCount-(e?s.ref.qUp:0)+s.distanceToNextCell)*n}return n})(t,v,l,f,u.qcy);return co.jsx(qN,{ref:j5(e,c),style:{...F5,flexGrow:f?1:0,direction:s},height:n,width:r[c],itemCount:g,itemSize:b,layout:"vertical",itemData:{list:t,isLeftColumn:!0,isLast:f,itemCount:g,showLastBorder:i,listValues:v,totalDividerIndex:d.totalDividerIndex},itemKey:Ez,estimatedItemSize:y,children:O5},m)})})};var $5=y(W5);const B5={overflow:"hidden",willChange:"auto"},V5=e=>({...PP,borderWidth:"rtl"===e?"0px 1px 0px 0px":"0px 0px 0px 1px"}),H5=({topGridRef:e,rowHightCallback:t,width:n,height:r,showLastBorder:i,getRightGridColumnWidth:o})=>{const{direction:s}=YT(),{layoutService:a,styleService:{grid:{divider:l},headerCellHeight:c}}=eO(),{gridSectionsData:{headersData:u,topDimensionData:d}}=xq(),h={...V5(s),borderColor:l,height:r};uF(e,d),cF(e,n,r,c);const p=a.size.x*o();return 0===d.rowCount?co.jsx("div",{style:{width:n,height:r,...V5(s)}}):co.jsx("div",{style:h,"data-section-id":"TOP_GRID",children:d.grid.map((r,l)=>{const c=l===d.rowCount-1,{itemCount:h,estimatedItemSize:f,listValues:m}=N5(r,p,a.size.x,c),g=(({layoutService:e,headersData:t,topRowIndex:n})=>{const r=t.data.at(n);if(void 0===r)return;const i=t.size.x-1,o=oF({layoutService:e,headersData:t,topRowIndex:n})?0:i,s=r.at(o),a=Array.isArray(s)?s.at(i):s;return a?e.getDimensionInfo(a.dimensionInfoIndex):void 0})({layoutService:a,headersData:u,topRowIndex:l}),y=g?oO(g):`empty ${l}`;return co.jsx(qN,{ref:j5(e,l),style:B5,height:t(),width:n,itemCount:h,itemSize:q5({list:r,listValues:m,isLastRow:c,getRightGridColumnWidth:o}),layout:"horizontal",itemData:{list:r,isLast:c,itemCount:h,showLastBorder:i,listValues:m,totalDividerIndex:d.totalDividerIndex},itemKey:Ez,estimatedItemSize:f,direction:s,children:O5},y)})})};var G5=y(H5);const U5=()=>co.jsx(Y5,{}),Y5=()=>{const{styleService:{headerCellHeight:e,contentCellHeight:t}}=eO(),n=eN(),r=(()=>{const{model:e}=JT(),t=Dp(Df),n=d(async(n,r)=>{if(!e)throw new Error("No Model provided!");const{qReverseSort:i,dimensionInfoIndex:o,sortDirection:s}=n,a=[];if(r===s)return!1;a.push({qPath:`/qHyperCubeDef/qDimensions/${o}/qDef/qReverseSort`,qOp:"Replace",qValue:(!i).toString()});try{return await e.applyPatches(a,!0),!0}catch(e){return t.error({msg:"Error while applying patch",payload:e}),!1}},[e,t]);return n})(),{gridSectionsWrapperRefs:{headerGridWrapperRef:i,topGridWrapperRef:o,leftGridWrapperRef:s,dataGridWrapperRef:a},gridRefs:{topGridRef:l,leftGridRef:u,dataGridRef:h},scrollDirectionRefs:{verticalScrollDirection:p,horizontalScrollDirection:f},scrollbarsDimensions:{verticalScrollbarWidth:m,horizontalScrollbarHeight:g,resetHorizontalScrollbarHeight:y},scrollToCoordCallBack:v}=Qq(),{leftGridWidth:b,leftGridFullWidth:x,leftGridColumnWidths:w,rightGridFullWidth:S,showLastRightBorder:C,getRightGridColumnWidth:E,getHeaderCellsIconsVisibilityStatus:M,overrideLeftGridWidth:k}=function({tableWidth:e,verticalScrollbarWidth:t,resetHorizontalScrollbarHeight:n}){const{layoutService:r,styleService:i}=eO(),{gridSectionsData:{headersData:o}}=xq(),{measureText:s}=cL(i.header,{allowLineBreaks:!1}),a=$q({tableWidth:e}),l=Bq({tableWidth:e,verticalScrollbarWidth:t,leftGridWidth:a.leftGridWidth}),u=Math.min(a.leftGridFullWidth,e-l.rightGridWidth-1),h=u+l.rightGridFullWidth+1<e,p=d((e,t,n="")=>{let i=e;r.isIndentModeEnabled&&(i=1,1===o.size.x&&(i=0));const l=a.leftGridColumnWidths[i];let c=!1,u=!1,d=s(n)+Iq;return t&&d+kq<=l&&(u=!0,d+=kq),d+kq<=l&&(c=!0),{shouldShowMenuIcon:c,shouldShowLockIcon:u}},[a.leftGridColumnWidths,s,r.isIndentModeEnabled,o.size.x]);return c(()=>{const e=u===a.leftGridFullWidth,t=l.rightGridWidth===l.rightGridFullWidth;e&&t&&n()},[n,u,a.leftGridFullWidth,l.rightGridWidth,l.rightGridFullWidth]),{...a,leftGridWidth:u,...l,showLastRightBorder:h,getHeaderCellsIconsVisibilityStatus:p}}({tableWidth:n.width,verticalScrollbarWidth:m,resetHorizontalScrollbarHeight:y}),{gridScaffoldDimensions:I,headerGridDims:R,topGridDims:_,leftGridDims:D,dataGridDims:A,metadata:{everyThingFitsInTableRectHeight:P,scrollbarsVisibilityStatus:L}}=(({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:n,leftGridOriginalWidth:r,rightGridOriginalWidth:i},scrollBarsDimensions:{verticalScrollbarWidth:o,horizontalScrollbarHeight:s}})=>{const a=eN(),{pageInfo:l}=YT(),{gridSectionsData:{headersData:c,topDimensionData:u}}=xq(),d=Math.min(a.height*Rq,Math.max(a.height*Rq-25,a.height-t-s)),h=l.rowsOnCurrentPage*t,p=Math.max(c.size.y,u.rowCount,1),f=e*p,m=e*p,g=n,y=a.width-g,v=Math.min(d,f,m),{availableHeight:b,everyThingFitsInTableRectHeight:x,everyThingFitsInTableRectWidth:w}=((e,t,n)=>{const r=t+1+n+o<=a.width,i=e+1+h+s,l=i-a.height<s||i<=a.height;return{availableHeight:l?i:a.height,everyThingFitsInTableRectHeight:l,everyThingFitsInTableRectWidth:r}})(v,g,y),S=b-d,C=Math.max(S,b-v),E=Math.min(C,h),M=Math.min(C,h),k=f+1+h,{visibilityStatus:I,metadata:{hasLeftGridOverflowX:R,hasDataGridOverflowX:_}}=(e=>{const{gridScaffold:{X_AXIS:{leftSectionWidth:t,rightSectionWidth:n},Y_AXIS:{topSectionHeight:r,bottomSectionHeight:i}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:o,rightSectionFullWidth:s},Y_AXIS:{topSectionFullHeight:a,bottomSectionFullHeight:l}}}=e,c=a>r,u=o>t,d=s>n,h=l>i;return{visibilityStatus:{topGrid:{overflowX:"hidden",overflowY:c?"scroll":"hidden"},leftGrid:{overflowX:u?"scroll":"hidden",overflowY:"hidden"},dataGrid:{overflowX:d?"scroll":"hidden",overflowY:h?"scroll":"hidden"}},metadata:{hasTopGridOverflowY:c,hasLeftGridOverflowX:u,hasDataGridOverflowX:d,hasDataGridOverflowY:h}}})({gridScaffold:{X_AXIS:{leftSectionWidth:g,rightSectionWidth:y},Y_AXIS:{topSectionHeight:v,bottomSectionHeight:C}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:r,rightSectionFullWidth:i},Y_AXIS:{topSectionFullHeight:m,bottomSectionFullHeight:k-m}}});return{gridScaffoldDimensions:{width:a.width,height:a.height,gridTemplateColumns:`${g}px ${y}px`,gridTemplateRows:`${v}px ${C}px`},headerGridDims:{width:-1,height:v},topGridDims:{fullSizeWrapper:{width:i-o+(_?o:0),height:m},stickyWrapper:{width:y-1-o,height:-1},self:{width:Math.min(i,y-(w?1:0)-o),height:m}},leftGridDims:{fullSizeWrapper:{width:g,height:k-m+(!R&&_?s:0)},stickyWrapper:{width:g,height:C-1-s},self:{width:g,height:Math.max(t,E-(x?0:s-1))}},dataGridDims:{fullSizeWrapper:{width:i-o+(_?o:0),height:k-m+(!_&&R?s:0)},stickyWrapper:{width:y-1-o,height:C-1-s},self:{width:Math.min(i,y-(w?1:0)-o),height:Math.max(t,M-(x?0:s-1))}},metadata:{everyThingFitsInTableRectHeight:x,scrollbarsVisibilityStatus:I}}})({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:b,leftGridOriginalWidth:x,rightGridOriginalWidth:S},scrollBarsDimensions:{verticalScrollbarWidth:m,horizontalScrollbarHeight:g}}),T=d(()=>e,[e]),O=d(()=>t,[t]),{env:q}=JT(),N=Ap(GT),j=Ap(BT),z=q.flags.isEnabled("VNA-639-KEYBOARD_NAV_VIRTUALIZED_PIVOT_TABLE");return c(()=>z?(N({HEADER:i.current,TOP:o.current,LEFT:s.current,DATA:a.current}),j(()=>v),()=>{N({HEADER:null,TOP:null,LEFT:null,DATA:null}),j(()=>null)}):()=>{},[z,N,i,o,s,a,j,v]),(()=>{const{downloadService:e}=eO();c(()=>{e.notifyIsDoneRendering()})})(),co.jsxs(nN,{style:I,children:[co.jsx("div",{style:{overflow:"hidden"},ref:i,children:co.jsx(lF,{tableWidth:n.width,leftGridWidth:b,columnWidths:w,getHeaderCellsIconsVisibilityStatus:M,rowHight:e,height:R.height,changeSortOrder:r,overrideLeftGridWidth:k})}),co.jsx(oN,{style:L.topGrid,origin:iP.TopGrid,ref:o,children:co.jsx(tN,{style:_.fullSizeWrapper,children:co.jsx(sN,{style:_.stickyWrapper,children:co.jsx(G5,{topGridRef:l,rowHightCallback:T,..._.self,showLastBorder:{right:C,bottom:!1},getRightGridColumnWidth:E})})})}),co.jsx(oN,{style:L.leftGrid,origin:iP.LeftGrid,ref:s,children:co.jsx(tN,{style:D.fullSizeWrapper,children:co.jsx(sN,{style:D.stickyWrapper,children:co.jsx($5,{leftGridRef:u,...D.self,columnWidths:w,showLastBorder:{right:!1,bottom:P}})})})}),co.jsx(oN,{style:L.dataGrid,origin:iP.DataGrid,ref:a,children:co.jsx(tN,{style:A.fullSizeWrapper,children:co.jsx(sN,{style:A.stickyWrapper,children:co.jsx(Rz,{dataGridRef:h,rowHightCallback:O,...A.self,showLastBorder:{right:C,bottom:P},getRightGridColumnWidth:E,verticalScrollDirection:p,horizontalScrollDirection:f})})})})]})},K5=ka("div")({"& .sn-copy-cell:focus-visible":{outline:"none",boxShadow:"0 0 0 2px #177fe6 inset, 0 0 0 3px #fff inset"}}),X5=()=>{const{keyboard:e,theme:t,interactions:n,translator:r,env:i}=JT(),{pageInfo:o,updatePageInfo:a,rect:l}=YT(),{layoutService:u}=eO(),{handleKeyDown:d}=Eq(),{layout:h,hasData:p}=u,f=s(null),m=Ap(GT),g=i.flags.isEnabled("VNA-639-KEYBOARD_NAV_VIRTUALIZED_PIVOT_TABLE");return c(()=>g?(m({WRAPPER:f.current}),()=>{m({WRAPPER:null})}):()=>{},[g,m]),co.jsxs(K5,{ref:f,onKeyDown:g?d:void 0,children:[p?co.jsx(U5,{}):null,co.jsx(Mq,{}),co.jsx(jT,{paginationNeeded:o.shouldShowPagination,handleChangePage:e=>{a({page:e})},pageInfo:o,totalRowCount:o.totalRowCount,totalColumnCount:0,totalPages:o.totalPages,keyboard:e,translator:r,theme:t,interactions:n,rect:l,layout:h})]})};const J5=(e,{selections:n,baseObjects:r,coreServices:i,nebulaObjects:o},s)=>{const a=function(e){const t=qh();return t?.components?.MuiTable?.styleOverrides&&(t.components.MuiTable.styleOverrides.root={}),la({...t,direction:e})}(r.direction);e.render(co.jsx(t.StrictMode,{children:co.jsx(Ep,{store:s,children:co.jsx(Ra,{theme:a,children:co.jsx(ZT,{...o,children:co.jsx(KT,{...r,children:co.jsx($j,{selections:n,children:co.jsx(tO,{...i,children:co.jsx(wq,{children:co.jsx(X5,{})})})})})})})})}))};var Z5=function(e){return e.FontSize="fontSize",e.FontFamily="fontFamily",e.FontColor="fontColor",e.FontStyle="fontStyle",e.Background="background",e.LineClamp="lineClamp",e.ColumnLineClamp="columnLineClamp",e.Border="border",e.Divider="divider",e}(Z5||{}),Q5=function(e){return e.Dimension="object.pivotTableV2.dimension",e.Measure="object.pivotTableV2.measure",e.Total="object.pivotTableV2.total",e.Null="object.pivotTableV2.null",e.Grid="object.pivotTableV2",e}(Q5||{}),e3=function(e){return e.Grid="grid",e.Divider="grid.divider",e.LabelName="label.name",e.LabelValue="label.value",e}(e3||{}),t3=function(e){return e.FontSize="fontSize",e.FontFamily="fontFamily",e.FontColor="color",e.BackgroundColor="backgroundColor",e.LineClamp="lineClamp",e.ColumnLineClamp="columnLineClamp",e.BorderColor="borderColor",e}(t3||{});const n3=e=>e?`${parseInt(e,10)}px`:void 0,r3=(e,t)=>{if(t){const n=e.getColorPickerColor(t);return"none"===n?_P.Transparent:n}},i3=(e,t)=>+(parseInt(e,10)*yP*t+8).toFixed(2),o3=(e,t)=>void 0===e?t:e.some(e=>"bold"===e)?mP:"normal",s3=e=>e?.some(e=>"italic"===e)?"italic":"normal",a3=e=>e?.some(e=>"underline"===e)?"underline":"none",l3=document.createElement("textarea");function c3(e){l3.value=e,document.body.appendChild(l3),l3.select(),l3.setSelectionRange(0,l3.value.length),document.execCommand("copy"),document.body.removeChild(l3)}l3.style.position="absolute",l3.style.left="-9999px",l3.setAttribute("readonly","");function u3(e){L?.((t,n)=>{const r=n.target,i=r?.closest(`.${ZI}`);i?.title&&t.addItem({translation:"contextMenu.copyCellValue",icon:"lui-icon lui-icon--copy",tid:"copy-cell-context-item",id:"copy-cell-context-item",select:()=>{(e=>{const t=e.title;t&&(navigator.clipboard?.writeText?navigator.clipboard.writeText(t).catch(()=>{c3(t)}):c3(t))})(i)}}),e?.forEach(e=>{e(t,n,i)})})}const d3=({model:e,layoutService:t,effectivePropertiesService:n,translator:r,env:i})=>{const o=k(()=>Rf(i,{tag:"sn-pivot-table"}),[i]);return JP((i,s,a)=>{if(!e||n.qAlwaysFullyExpanded)return;const l=e,c=i.addItem({translation:"Object.PivotTable.ContextMenu.ExpandCollapse",tid:"expand-collapse-group",id:"expand-collapse-group"}),{qEffectiveDimensionName:u,label:d}=((e,t)=>{const n=((e,t)=>{const n=e?.getAttribute("data-dimension-info-index");if("string"==typeof n)return t.getDimensionInfo(+n)})(e,t);return"object"==typeof n?{qEffectiveDimensionName:n.qEffectiveDimensionName,label:n.qFallbackTitle}:{qEffectiveDimensionName:void 0,label:void 0}})(a,t);c.addItem(((e,t)=>({icon:"lui-icon lui-icon--plus",translation:"Object.PivotTable.ContextMenu.ExpandAll",tid:"expand-all",select:async()=>{try{await e.expandTop(nO,0,0,!0),await e.expandLeft(nO,0,0,!0)}catch(e){t.error({msg:"Failed to expand all",payload:e})}}}))(l,o)),"string"==typeof u&&c.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:n,label:r,translator:i,logToSentry:o})=>({icon:"lui-icon lui-icon--plus",translation:i.get("SNPivotTable.ContextMenu.ExpandDimension",[r??""]),tid:"expand-dimension",id:"expand-dimension",select:Uz({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n,action:Vz.Expand,logToSentry:o})}))({model:l,effectivePropertiesService:n,qEffectiveDimensionName:u,label:d,translator:r,logToSentry:o})),c.addItem(((e,t)=>({icon:"lui-icon lui-icon--minus",translation:"Object.PivotTable.ContextMenu.CollapseAll",tid:"collapse-all",select:async()=>{try{await e.collapseTop(nO,0,0,!0),await e.collapseLeft(nO,0,0,!0)}catch(e){t.error({msg:"Failed to collapse all",payload:e})}}}))(l,o)),"string"==typeof u&&c.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:n,label:r,translator:i,logToSentry:o})=>({icon:"lui-icon lui-icon--minus",translation:i.get("SNPivotTable.ContextMenu.CollapseDimension",[r??""]),tid:"collapse-dimension",id:"collapse-dimension",select:Uz({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n,action:Vz.Collapse,logToSentry:o})}))({model:l,effectivePropertiesService:n,qEffectiveDimensionName:u,label:d,translator:r,logToSentry:o}))},[e,t,n,o])},h3=(e,t)=>k(()=>(({layout:e})=>{const{qHyperCube:t,nullValueRepresentation:n,snapshotData:r}=e,{qNoOfLeftDims:i,qEffectiveInterColumnSortOrder:o,qMeasureInfo:s,qDimensionInfo:a}=t,l=!!r,c=r?.content?.rowsPerPage??15e3,u={x:Math.min(e.qHyperCube.qSize.qcx,gP),y:Math.min(e.qHyperCube.qSize.qcy,c)},d=o.slice(0,i),h=e=>d.some(t=>t===e),p=h(rO),f=new Map(o.map(e=>[a[e]??rO,e])),m=s.filter(e=>7005!==e.qError?.qErrorCode);return{layout:e,getNullValueText:()=>n?.text??vP,getDimensionNullValueText:()=>n?.dimensionText??vP,getMeasureInfoIndexFromCellIndex:(e,t=!1)=>{if(p)return 0;const n=e%m.length;return t?n:s.findIndex(e=>e===m[n])},getDimensionInfo:e=>e===rO?void 0:a.at(e),getDimensionInfoIndex:e=>f.get(e)??-1,size:u,isSnapshot:l,hasLimitedData:!l&&u.x<e.qHyperCube.qSize.qcx,hasData:u.x>0&&u.y>0,hasLeftDimensions:0!==e.qHyperCube.qNoOfLeftDims,hasPseudoDimOnLeft:p,leftDimensionInfoIndexes:d,isLeftDimension:h,triggerdByExpandOrCollapse:!!e.qHyperCube.qLastExpandedPos,visibleMeasureInfo:m,isIndentModeEnabled:Boolean(e.qHyperCube.qIndentMode),indentModeColumnWidth:e.qHyperCube.indentModeColumnWidth??{type:nR.Auto,pixels:tR.PixelsDefault,percentage:tR.PercentageDefault},searchSortFromDimension:"inherit"===e.search?.sorting}})({layout:e}),[e,t]),p3=({model:e,layoutService:t,viewService:n,pageInfo:r,rect:i})=>{const{layout:o,isSnapshot:s,triggerdByExpandOrCollapse:a}=t,l=(e=>{const t=QP(e);return t.current=e,t})(fq(i));return oL(async()=>{const{qHyperCube:t}=o,{maxNumberOfVisibleRows:i,maxNumberOfVisibleColumns:c}=l.current;if(s)return o.snapshotData?.content?.qPivotDataPages??[];if(void 0!==e&&"getHyperCubePivotData"in e&&(((e,t,n,r)=>!!e&&(t.gridColumnStartIndex+t.gridWidth>=r||t.gridRowStartIndex+t.gridHeight>=n))(a,n,i,c)||((e,t,n,r)=>{const{qHyperCube:{qPivotDataPages:i,qSize:o}}=e,{qTop:s,qWidth:a,qHeight:l}=i[0]?.qArea??{qTop:0,qWidth:0,qHeight:0};return s<t.page*t.rowsPerPage||a<Math.min(r,o.qcx)||l<Math.min(n,o.qcy)})(o,r,i,c))){const t=((e,t,n,r,i,o)=>{const s=r.page*r.rowsPerPage,a=Math.min(s+r.rowsPerPage,n.qcy),l=Math.min(gP,n.qcx);if(n.qcy<s)return null;let c=0,u=s;if(e){c=t.gridColumnStartIndex,u=s+t.gridRowStartIndex;const e=u+t.gridHeight,n=t.gridColumnStartIndex+t.gridWidth;e>a&&(u=Math.max(0,a-i)),n>l&&(c=Math.max(0,l-o))}return{qLeft:c,qTop:u,qWidth:Math.min(l-c,o),qHeight:Math.min(a-u,i)}})(a,n,o.qHyperCube.qSize,r,i,c);return t?e.getHyperCubePivotData(nO,mq(t)):[]}return t.qPivotDataPages},[o,s,e,n,r.page,r.rowsPerPage,l,a])},f3=({rowsPerPage:e,totalRowCount:t,page:n})=>Math.min(e,t-n*e),m3=(e,t,n=15e3)=>({rowsPerPage:n,totalPages:Math.max(1,Math.ceil(e/n)),totalRowCount:e,rowsOnCurrentPage:f3({rowsPerPage:n,totalRowCount:e,page:t})}),g3=15,y3=({layoutService:e,viewService:t,rect:n,model:r,pageInfo:i})=>{const{freeResize:o}=I();return T(async e=>{const o=e;if(!o.snapshotData||!r||o.snapshotData.content)return o;if("getHyperCubePivotData"in r){const{scrollTop:e,scrollLeft:s,leftGridScrollLeft:a,topGridScrollTop:l}=t,c=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:s}=e,a=t.page*t.rowsPerPage,l=Math.max(r-g3,0),c=Math.max(a+i-g3,a,0),u=gP-l,d=a+t.rowsOnCurrentPage-c;if((e=>0===e.gridWidth&&0===e.gridHeight)(e)){const{maxNumberOfVisibleColumns:e,maxNumberOfVisibleRows:t}=fq(n);return{qLeft:l,qTop:c,qWidth:Math.min(u,e+30),qHeight:Math.min(d,t+30)}}return{qLeft:l,qTop:c,qWidth:Math.min(u,o+30),qHeight:Math.min(d,s+30)}})(t,i,n),u=mq(c),d={qLeft:0,qTop:i.page*i.rowsPerPage,qWidth:1,qHeight:1};o.snapshotData.content={qPivotDataPages:await r.getHyperCubePivotData(nO,[d,...u]),scrollTop:e,scrollLeft:s,leftGridScrollLeft:a,topGridScrollTop:l,page:i.page,rowsPerPage:i.rowsPerPage},o.snapshotData.object={...o.snapshotData.object,size:{...o.snapshotData.object?.size,w:n.width,h:n.height}}}return o}),O(()=>({getViewState:()=>((e,t)=>({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,leftGridScrollLeft:e.leftGridScrollLeft,topGridScrollTop:e.topGridScrollTop,renderPage:t.page}))(t,i)}),[t]),e.layout.snapshotData?.content&&!o?{left:n.left,top:n.top,width:e.layout.snapshotData.object.size.w,height:e.layout.snapshotData.object.size.h}:n};var v3={SNPivotTable_ContextMenu_CollapseDimension:{id:"SNPivotTable.ContextMenu.CollapseDimension",locale:{"de-DE":"{0} reduzieren","en-US":"Collapse {0}","es-ES":"Contraer {0}","fr-FR":"Réduire {0}","it-IT":"Comprimi {0}","ja-JP":"{0} を折りたたむ","ko-KR":"{0} 축소","nl-NL":"{0} samenvouwen","pl-PL":"Zwiń {0}","pt-BR":"Recolher {0}","ru-RU":"Свернуть {0}","sv-SE":"Dölj {0}","tr-TR":"{0} öğelerini daralt","zh-CN":"折叠 {0}","zh-TW":"收合 {0}"}},SNPivotTable_ContextMenu_ExpandDimension:{id:"SNPivotTable.ContextMenu.ExpandDimension",locale:{"de-DE":"{0} erweitern","en-US":"Expand {0}","es-ES":"Expandir {0}","fr-FR":"Développer {0}","it-IT":"Espandi {0}","ja-JP":"{0} を展開","ko-KR":"{0} 확장","nl-NL":"{0} uitvouwen","pl-PL":"Rozwiń {0}","pt-BR":"Expandir {0}","ru-RU":"Развернуть {0}","sv-SE":"Visa {0}","tr-TR":"{0} öğelerini genişlet","zh-CN":"展开 {0}","zh-TW":"展開 {0}"}},SNPivotTable_IndentMode_Rows:{id:"SNPivotTable.IndentMode.Rows",locale:{"de-DE":"Zeilen","en-US":"Rows","es-ES":"Filas","fr-FR":"Lignes","it-IT":"Righe","ja-JP":"行","ko-KR":"행","nl-NL":"Rijen","pl-PL":"Wiersze","pt-BR":"Linhas","ru-RU":"Строки","sv-SE":"Rader","tr-TR":"Satırlar","zh-CN":"行","zh-TW":"列"}},SNPivotTable_LimitedData:{id:"SNPivotTable.LimitedData",locale:{"de-DE":"* Derzeit wird eine begrenzte Anzahl Spalten angezeigt","en-US":"* Currently showing a limited number of columns","es-ES":"* Actualmente mostrando un número limitado de columnas","fr-FR":"*Affichage actuel d'un nombre limité de colonnes","it-IT":"* Attualmente visualizzato un numero limitato di colonne","ja-JP":"* 現在、限られた列の数を表示","ko-KR":"* 현재 제한된 수의 열만 표시","nl-NL":"* Op dit moment wordt slechts een beperkt aantal kolommen getoond","pl-PL":"* Obecnie wyświetlana jest ograniczona liczba kolumn","pt-BR":"* Atualmente mostrando um número limitado de colunas","ru-RU":"* В настоящее время отображается ограниченное количество столбцов","sv-SE":"* Visar för närvarande ett begränsat antal kolumner","tr-TR":"*Şu anda sınırlı sayıda sütun gösteriliyor","zh-CN":"* 当前显示的列数有限","zh-TW":"* 目前顯示有限欄數"}},SNPivotTable_NoData:{id:"SNPivotTable.NoData",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, weil es keine Werte enthält.","en-US":"The chart is not displayed because it contains no values.","es-ES":"El gráfico no se muestra porque no contiene valores.","fr-FR":"Le graphique n'est pas affiché, car il ne contient aucune valeur.","it-IT":"Il grafico non è visualizzato poiché non contiene alcun valore.","ja-JP":"チャートには値が含まれていないため、チャートは表示されません。","ko-KR":"차트에 값이 없으므로 차트가 표시되지 않습니다.","nl-NL":"Het diagram wordt niet weergegeven omdat deze geen waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ nie zawiera wartości.","pt-BR":"O gráfico não foi exibido porque não contém valores.","ru-RU":"Диаграмма не отображается, так как не содержит значений.","sv-SE":"Diagrammet visas inte eftersom det inte innehåller några värden.","tr-TR":"Değer içermemesi nedeniyle grafik görüntülenmiyor.","zh-CN":"图表未显示,因为它不包含任何值。","zh-TW":"系統不會顯示圖表,因為這沒有包含任何值。"}}};const b3=()=>{const e=q(),t=e.language();return k(()=>{!function(e){const t="SNPivotTable_LimitedData";e.get(t)===t&&Object.keys(v3).forEach(t=>{e.add(v3[t])})}(e)},[e]),{translator:e,language:t}},x3=e=>{const t=k(()=>wp(),[]);t.set(_f,e);const{flags:n}=e,r=N(),i=(e=>{const t=k(()=>hL.createRoot(e),[e]);return D(()=>()=>{t.unmount()},[t]),t})(r),o=j(),s=z(),a=F(),l=W(),c=$(),u=(()=>{const{viewState:e}=I(),t=QP(new Set),n=void 0!==window.qlikprinting,{promise:r,resolve:i}=k(()=>XP(),[]),o=JP(e=>{t.current.add(e)},[t]),s=JP(yD(async()=>{await Promise.all(t.current),t.current.clear(),i()},1e3),[i,t]);return R(async()=>{await r},[r]),k(()=>({viewState:e,isDownloadedAsPDForImage:n,notifyIsDoneRendering:s,waitForPromise:o}),[s,n,e,o])})(),d=((e,t)=>{const[n]=oL(async()=>{if(void 0!==e&&!t.snapshotData&&"getEffectiveProperties"in e)return{...await e.getEffectiveProperties()}},[e,t]),r=k(()=>{const e=void 0!==n?.qHyperCubeDef.qSortbyYValue&&1===Math.abs(n.qHyperCubeDef.qSortbyYValue),t=n?.qHyperCubeDef.qDimensions.map(e=>e.qDef?.qSortCriterias)??[];return{qAlwaysFullyExpanded:n?.qHyperCubeDef.qAlwaysFullyExpanded??!1,qExpansionState:n?.qHyperCubeDef.qExpansionState,isSortedByFirstMeasure:e,getSortCriteriaForDimension:e=>t[e]}},[n]);return r})(s,o),h=h3(o,n),p=(e=>{const t=P();return{...t,select:!!t.active&&!!t.select&&!e,active:!!t.active&&!e,scroll:!!t.active}})(h.isSnapshot),f=B(),m=iL(o,r),{translator:g,language:y}=b3(),{pageInfo:v,updatePageInfo:b}=((e,t)=>{const{size:n,layout:{qHyperCube:{qSize:r}}}=e,i=t.isDownloadedAsPDForImage||e.isSnapshot,o=(e=>e.layout.snapshotData?.content?.rowsPerPage)(e),[s,a]=_(()=>{const s=((e,t)=>t.isDownloadedAsPDForImage?t.viewState?.renderPage??0:e.isSnapshot?e.layout.snapshotData?.content?.page??0:0)(e,t);return{page:s,shouldShowPagination:r.qcy>n.y&&!i,...m3(r.qcy,s,o)}}),l=e.layout.qHyperCube.qSize.qcy;return D(()=>{a(t=>({...t,...m3(l,t.page,o),shouldShowPagination:l>e.size.y&&!i}))},[l,e.size.y,a,i,o]),D(()=>{const{page:e,totalPages:t}=s;if(e+1>t){const e=t-1,n=f3({...s,page:e});a({...s,page:e,rowsOnCurrentPage:n})}},[s]),{pageInfo:s,updatePageInfo:e=>{a({...s,...e,rowsOnCurrentPage:f3({...s,...e})})}}})(h,u),x=((e,t,n)=>k(()=>((e,t)=>{if(e.isDownloadedAsPDForImage){const{viewState:t}=e;return{gridColumnStartIndex:0,gridRowStartIndex:0,gridWidth:0,gridHeight:0,scrollTop:t?.scrollTop??0,scrollLeft:t?.scrollLeft??0,leftGridScrollLeft:t?.leftGridScrollLeft??0,topGridScrollTop:t?.topGridScrollTop??0}}return{gridColumnStartIndex:0,gridRowStartIndex:0,gridWidth:0,gridHeight:0,scrollTop:t?.content?.scrollTop??0,scrollLeft:t?.content?.scrollLeft??0,leftGridScrollLeft:t?.content?.leftGridScrollLeft??0,topGridScrollTop:t?.content?.topGridScrollTop??0}})(n,t.snapshotData),[n,e.page,t.snapshotData]))(v,o,u),w=y3({rect:V(),layoutService:h,viewService:x,model:s,pageInfo:v}),[S,C]=p3({model:s,layoutService:h,viewService:x,pageInfo:v,rect:w}),E=k(()=>((e,t,n)=>{const r=n.isEnabled("VNA-670-SEPARATE_NULL_VALUE_STYLING"),i=t.layout.components?.find(e=>"theme"===e.key),o=i?.header,s=i?.dimensionValues,a=i?.measureValues,l=i?.measureLabels,c=i?.totalValues,u=i?.nullValues,d=(r?i?.dimensionNullValues:void 0)??u,h=i?.grid,p=(t,n,r)=>e.getStyle(t,n,r),f=+(h?.[Z5.LineClamp]??p(Q5.Grid,e3.Grid,t3.LineClamp)??1),m=+(h?.[Z5.ColumnLineClamp]??p(Q5.Grid,e3.Grid,t3.ColumnLineClamp)??1),g=r3(e,o?.[Z5.Background])??p(Q5.Dimension,e3.LabelName,t3.BackgroundColor)??_P.Transparent,y={header:{fontSize:n3(o?.[Z5.FontSize])??p(Q5.Dimension,e3.LabelName,t3.FontSize)??pP,fontFamily:o?.[Z5.FontFamily]??p(Q5.Dimension,e3.LabelName,t3.FontFamily)??fP,fontWeight:o3(o?.[Z5.FontStyle],mP),fontStyle:s3(o?.[Z5.FontStyle]),textDecoration:a3(o?.[Z5.FontStyle]),color:r3(e,o?.[Z5.FontColor])??p(Q5.Dimension,e3.LabelName,t3.FontColor)??HR.TEXT,background:g,hoverBackground:RD(g,rR),activeBackground:RD(g,iR)},dimensionValues:{fontSize:n3(s?.[Z5.FontSize])??p(Q5.Dimension,e3.LabelValue,t3.FontSize)??pP,fontFamily:s?.[Z5.FontFamily]??p(Q5.Dimension,e3.LabelValue,t3.FontFamily)??fP,fontWeight:o3(s?.[Z5.FontStyle],void 0),fontStyle:s3(s?.[Z5.FontStyle]),textDecoration:a3(s?.[Z5.FontStyle]),color:r3(e,s?.[Z5.FontColor])??p(Q5.Dimension,e3.LabelValue,t3.FontColor)??HR.TEXT,background:r3(e,s?.[Z5.Background])??p(Q5.Dimension,e3.LabelValue,t3.BackgroundColor)??_P.Transparent},measureValues:{fontSize:n3(a?.[Z5.FontSize])??p(Q5.Measure,e3.LabelValue,t3.FontSize)??pP,fontFamily:a?.[Z5.FontFamily]??p(Q5.Measure,e3.LabelValue,t3.FontFamily)??fP,fontWeight:o3(a?.[Z5.FontStyle],"normal"),fontStyle:s3(a?.[Z5.FontStyle]),textDecoration:a3(a?.[Z5.FontStyle]),color:r3(e,a?.[Z5.FontColor])??p(Q5.Measure,e3.LabelValue,t3.FontColor)??_P.FontSecondary,background:r3(e,a?.[Z5.Background])??p(Q5.Measure,e3.LabelValue,t3.BackgroundColor)??_P.Transparent},measureLabels:{fontWeight:o3(l?.[Z5.FontStyle],"normal"),fontStyle:s3(l?.[Z5.FontStyle]),textDecoration:a3(l?.[Z5.FontStyle]),color:r3(e,l?.[Z5.FontColor])??p(Q5.Measure,e3.LabelName,t3.FontColor)??_P.FontSecondary,background:r3(e,l?.[Z5.Background])??p(Q5.Measure,e3.LabelName,t3.BackgroundColor)??_P.Transparent},totalValues:{fontWeight:o3(c?.[Z5.FontStyle],mP),fontStyle:s3(c?.[Z5.FontStyle]),textDecoration:a3(c?.[Z5.FontStyle]),color:r3(e,c?.[Z5.FontColor])??p(Q5.Total,e3.LabelValue,t3.FontColor)??HR.TEXT,background:r3(e,c?.[Z5.Background])??p(Q5.Total,e3.LabelValue,t3.BackgroundColor)??_P.Transparent},dimensionNull:{fontWeight:o3(d?.[Z5.FontStyle],"normal"),fontStyle:s3(d?.[Z5.FontStyle]),textDecoration:a3(d?.[Z5.FontStyle]),color:r3(e,d?.[Z5.FontColor])??p(Q5.Null,e3.LabelValue,t3.FontColor)??HR.TEXT,background:r3(e,d?.[Z5.Background])??p(Q5.Null,e3.LabelValue,t3.BackgroundColor)??_P.NullValueBackground},nullValues:{fontWeight:o3(u?.[Z5.FontStyle],"normal"),fontStyle:s3(u?.[Z5.FontStyle]),textDecoration:a3(u?.[Z5.FontStyle]),color:r3(e,u?.[Z5.FontColor])??p(Q5.Null,e3.LabelValue,t3.FontColor)??HR.TEXT,background:r3(e,u?.[Z5.Background])??p(Q5.Null,e3.LabelValue,t3.BackgroundColor)??_P.NullValueBackground},grid:{columnLineClamp:m,lineClamp:f,border:r3(e,h?.[Z5.Border])??p(Q5.Grid,e3.Grid,t3.BorderColor)??_P.DividerLight,divider:r3(e,h?.[Z5.Divider])??p(Q5.Grid,e3.Divider,t3.BorderColor)??_P.DividerDark,background:r3(e,h?.[Z5.Background])??p(Q5.Grid,e3.Grid,t3.BackgroundColor)??_P.Transparent},selectedColors:ID(e)};return y.headerCellHeight=Math.max(i3(y.header.fontSize,m),i3(y.dimensionValues.fontSize,m),32),y.contentCellHeight=Math.max(i3(y.measureValues.fontSize,f),i3(y.dimensionValues.fontSize,f),24),y.dimensionValueTextHeight=i3(y.dimensionValues.fontSize,1),y})(m,h,n),[m,h,n]),M=((e,t,n)=>{const[,r,i]=oL(async()=>{const t=c_(),n=e.getStyle("","","fontFamily"),r=e.getStyle("object","label.name","fontFamily"),i=e.getStyle("object","label.value","fontFamily"),o=e.getStyle("","","fontFamilies")??[];return Promise.all([...t,...o,n,r,i,pL].filter(e=>void 0!==e).map(async e=>{await document.fonts.load(`600 12px ${e}`),await document.fonts.load(`12px ${e}`)}))},[t,e,n]);return i?(console.warn("Failed to load fonts:",i),!0):!r})(m,o,e),{direction:A}=I();u3([d3({model:s,layoutService:h,effectivePropertiesService:d,translator:g,env:e})]),D(()=>{!C&&s&&!!S&&M&&J5(i,{selections:f,baseObjects:{rect:w,pageInfo:v,qPivotDataPages:S,updatePageInfo:b,direction:A},nebulaObjects:{env:e,app:a,model:s,embed:l,theme:m,keyboard:c,translator:g,interactions:p},coreServices:{styleService:E,viewService:x,layoutService:h,downloadService:u,effectivePropertiesService:d}},t)},[s,a,w,p,f,x,h,u,C,S,E,i,M,g,y,v,b,d,l,c,m,e,A,t])},w3={version:"7.57.0",qHyperCubeDef:{qAlwaysFullyExpanded:!1,qDimensions:[],qMeasures:[],qMode:"P",qSuppressMissing:!0,qSuppressZero:!1,qShowTotalsAbove:!0,qInitialDataFetch:[{qTop:0,qLeft:0,qWidth:50,qHeight:50}],qIndentMode:!1},showTitles:!0,title:"",subtitle:"",footnote:"",nullValueRepresentation:{text:"-"},components:[]};function S3(e){return{qae:{properties:{initial:{...w3,qHyperCubeDef:{...w3.qHyperCubeDef,qIndentMode:!1}}},data:qA(e)},ext:KP(e),component(){x3(e)}}}export{S3 as default};
92
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,d,h=e.length,p=e.search(/[0-9\-\+#]/),f=p>0?e.substring(0,p):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=h-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,h):"";if(n=(t="-"===(e=e.substring(p,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)c[0]="0"+c[0];else 0===+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(d=t[0]).length%l,h=d.length,b=0;b<h;b++)m+=d.charAt(b),!((b-y+1)%l)&&b<h-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),f+(n?"-":"")+r+x}});function mW(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const gW={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"},yW=/%\)?$/,vW=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,bW=/^\(oct\)/i,xW=/^\(dec\)/i,wW=/^\(hex\)/i,SW=/^\(bin\)/i,CW=/^\(rom\)/i,EW=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,MW=/#|0/g;function kW(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 IW(e,t,n){let r;return vW.test(t)?e=kW(e,Number(/\d{2}/.exec(t)[0]),t,n):bW.test(t)?e=kW(e,8,t,n):xW.test(t)?e=kW(e,10,t,n):wW.test(t)?e=kW(e,16,t,n):SW.test(t)?e=kW(e,2,t,n):CW.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,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<s.length;n++)if(s[n]<=i){r+=a[n],i-=s[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}function RW(e,t,n){const r=mW(e);return n?r:new RegExp(r||"",t)}function _W(e,t,n,r){let i,o,s,a,l,c,u,d,h,p=e.pattern;var f,m;r&&(e.abbreviate=!0),f=t,(m=n)&&(m=mW(m)),f&&(f=mW(f)),h=new RegExp("(?:[#0]+".concat(f,")?[#0]+(?:").concat(m,"[#0]+)?")),s=p.match(h),s=s?s[0]:"",a=s?p.substr(0,p.indexOf(s)):p,l=s?p.substring(p.indexOf(s)+s.length):"",s||(s=p?"#":"##########"),t&&t===n&&(i=s.split(n),o=i.pop(),s=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(RW(c,"g"),t)),u=n,n=".",u&&(s=s.replace(RW(u,"g"),n)),d=s.match(/#/g),d=d?d.length:0;const g=p.split(u);let y;g[1]&&(y=g[1].match(MW)),e.prefix=a||"",e.postfix=l||"",e.pattern=p,e.maxPrecision=y?y.length:2,e.percentage=yW.test(p),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(RW(t,null,!0),"|").concat(RW(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class DW{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 gW;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 DW(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],EW.test(e[0])&&(r.positive.isFunctional=!0),e[1]?EW.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?EW.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||_W(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&_W(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&_W(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,s,a,l,c,u=this._prepared,d="",h="",p=e;if(isNaN(e))return"".concat(p);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=IW(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let r,i,o=t[0];for(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(r=t[a-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(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=fW(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(a=i.length;a<n;a++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),h=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),a=0;a<t;a++)l+="#";e=fW(l,e)}e=e.replace(u.numericRegex,e=>e===s?u.groupTemp:e===o?u.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+h+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function AW(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,s=t.toKey,a=void 0===s?e=>e:s;let l,c,u=Object.create(null),d=Object.create(null),h=0,p=0;return l=o?function(){return c=a(...arguments),l.has(c)?l.get(c):l.set(c,e(...arguments))}:t=>(c=a(t),l.has(c)?l.get(c):l.set(c,e(t))),l.set=(e,t)=>(h>=r&&(delete u[d[p]],delete d[p],h--,p++),u[e]=t,d[h]=e,h++,t),l.get=e=>u[e],l.has=e=>e in u,l.clear=()=>{u=Object.create(null),d=Object.create(null),h=0,p=0},l.size=()=>h,l}function PW(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 DW(...t)}(i,e,t,n,r),s=AW(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,r){return s.clear(),o.format(t,e,n,r)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const LW="D",TW="T",OW="TS",qW="IV",NW=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],jW=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],zW=["January","February","March","April","May","June","July","August","September","October","November","December"],FW=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function WW(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function $W(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function BW(e,t){let n,r=function(e){const t=e,n=24*$W(t),r=60*$W(n),i=60*$W(r),o=1e3*$W(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,s=r.m,a=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:s,s:a,f:l,t:u}}class VW{constructor(e,t,n){const r=e||{};if(r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:NW,qDayNames:jW,qLongMonthNames:zW,qMonthNames:FW}),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={[TW]:r.qTimeFmt||"hh:mm:ss",[LW]:r.qDateFmt||"YYYY-MM-DD",[OW]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new VW(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=BW(e,t));const i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:WW("".concat(t.year).slice(-2),2),YYY:WW("".concat(t.year).slice(-3),3),def:e=>WW("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:WW("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:WW("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>WW("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>WW("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>WW("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>WW("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const s=new RegExp(o.join("|"),"g"),a=t.replace(s,e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r});return a}}function HW(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new VW(...t)}function GW(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=HW(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=AW(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==qW?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=HW(i,e,t),r=AW(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 UW(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.meta,r=t.id,i=t.key,o=t.localeInfo,s=t.fieldExtractor,a=t.value,l=t.type,c=t.sourceField;const u=a||("dimension"===l?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),d="dimension"===l?"first":"avg",h=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return GW(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",s=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(i,"##"),o="U"),PW(n,r,i,o,t)}(n,o),p="dimension"===l?"first":(e,t)=>h(t),f={id:()=>r,key:()=>i,raw:()=>n,title:()=>n.qFallbackTitle||n.label,type:()=>l,origin:()=>c,items:()=>(e||(e=s(f)),e),min:()=>n.qMin,max:()=>n.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:d,reduceLabel:p,formatter:()=>h,tags:()=>n.qTags};return f}function YW(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const s="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),a={instance:UW(AF({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},i))};return a.attrDims=YW("qAttrDimInfo",t,n,s,AF({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=YW("qAttrExprInfo",t,n,s,AF({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=YW("qMeasureInfo",t,n,s,AF({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a})}function KW(){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:[]},s=n;if(!s)throw new Error('Missing "data" input');if(!s.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const a=KW.util,l={cache:o,cube:s,localeInfo:i.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:i.virtualFields},c={key:()=>t,raw:()=>s,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,a),hierarchy:e=>l.hierarchy(e,c,o,a),_cache:()=>o};"K"===s.qMode||"T"===s.qMode||!s.qMode&&s.qNodesOnDim?(l.extractor=pW,l.hierarchy=hW,l.pages="K"===s.qMode?s.qStackedDataPages:s.qTreeDataPages):"S"===s.qMode?(l.extractor=OF,l.pages=s.qDataPages,l.hierarchy=hW):l.extractor=()=>[],l.fieldExtractor=e=>l.extractor({field:e},c,o,a);const u="S"===s.qMode?e=>e.qElemNumber:void 0,d="S"===s.qMode?e=>e.qNum:void 0;o.wrappedFields.push(...YW("qDimensionInfo",s,t,"",AF({},l,{value:u,type:"dimension"}))),o.wrappedFields.push(...YW("qMeasureInfo",s,t,"",AF({},l,{value:d,type:"measure"}))),o.fields=o.wrappedFields.map(e=>e.instance);const h=e=>{e.forEach(e=>{o.allFields.push(e.instance),h(e.measures),h(e.attrDims),h(e.attrExps)})};return h(o.wrappedFields),(i.virtualFields||[]).forEach(e=>{const n=c.field(e.from),r=UW(wF({meta:n.raw(),id:"".concat(t,"/").concat(e.key),sourceField:n,fieldExtractor:e=>l.extractor({field:e},c,o,a),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 XW=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],JW=/\/qDimensionInfo(?:\/(\d+))?/,ZW=/\/qMeasureInfo\/(\d+)/,QW=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,e$=/\/qAttrExprInfo\/(\d+)/,t$=/\/?qHyperCube/,n$=/\/?qTreeData/,r$=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),i$=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function o$(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],s={},a=e.isActive();let l=!1;if(e.brushes().forEach(e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",s=e=>e;t$.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=r$):n$.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=i$);let a=!0;if(JW.test(e)&&(r=+JW.exec(e)[1]),ZW.test(e)&&(i=+ZW.exec(e)[1]),QW.test(e)){i=-1,r=0;const e=+QW.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),a=!1}if(e$.test(e)){const e=i;if(t){i=0;const s=ZF(o,t);i+=(s.qMeasureInfo||[]).length,r>-1?(i=s.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=s.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=s.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+e$.exec(n)[1]}else r>-1?(r=-1,i=+e$.exec(n)[1]):i+=+e$.exec(n)[1]+1}return XW.forEach(e=>{let t=SF(e,2),r=t[0],i=t[1];n=n.replace(r,i)}),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach(e=>s.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach(e=>s.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach(e=>s.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,a=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));(0===o||a>=o)&&o>-1?n.forEach(e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})}):n.forEach(e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})}),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map(e=>+e).filter(e=>!isNaN(e)),l=!!s.selectHyperCubeCells.values.length);else{const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}}),!l&&a)return[{method:"resetMadeSelections",params:[]}];var c;s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]});return s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o}function s$(e){KW.util=e.data("matrix").util,e.data("q",KW),e.formatter("q-number",PW),e.formatter("q-time",GW)}s$.qBrushHelper=o$,s$.selections=o$;var a$=Object.prototype.hasOwnProperty,l$=Object.prototype.toString,c$=Object.defineProperty,u$=Object.getOwnPropertyDescriptor,d$=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===l$.call(e)},h$=function(e){if(!e||"[object Object]"!==l$.call(e))return!1;var t,n=a$.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&a$.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||a$.call(e,t)},p$=function(e,t){c$&&"__proto__"===t.name?c$(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},f$=function(e,t){if("__proto__"===t){if(!a$.call(e,t))return;if(u$)return u$(e,t).value}return e[t]},m$=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=f$(a,n),a!==(i=f$(t,n))&&(u&&i&&(h$(i)||(o=d$(i)))?(o?(o=!1,s=r&&d$(r)?r:[]):s=r&&h$(r)?r:{},p$(a,{name:n,newValue:e(u,s,i)})):void 0!==i&&p$(a,{name:n,newValue:i}));return a},g$="2.11.7";function y$(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 v$(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 b$(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 x$(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b$(Object(n),!0).forEach(function(t){v$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function w$(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,s,a=[],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)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return y$(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)?y$(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 S$(e){return!!e.changedTouches}function C$(e){return"number"==typeof e&&!isNaN(e)}function E$(e){return"number"!=typeof e||isNaN(e)}function M$(e){const t=e.length;let n=NaN,r=NaN,i=NaN,o=NaN;for(let s=0;s<t;s++)n=isNaN(n)?e[s].x:Math.min(n,e[s].x),r=isNaN(r)?e[s].x:Math.max(r,e[s].x),i=isNaN(i)?e[s].y:Math.min(i,e[s].y),o=isNaN(o)?e[s].y:Math.max(o,e[s].y);return[n,i,r,o]}function k$(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function I$(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 R$(e){const t=w$(M$(e),4),n=t[0],r=t[1];return{x:n,y:r,width:t[2]-n,height:t[3]-r}}function _$(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function D$(e){const t=e||{},n=t.x,r=t.y,i=t.width,o=t.height,s=t.x1,a=t.x2,l=t.y1,c=t.y2,u=t.cx,d=t.cy,h=t.r,p=t.vertices;return C$(u)&&C$(d)&&C$(h)?"circle":C$(s)&&C$(a)&&C$(l)&&C$(c)?"line":C$(n)&&C$(r)&&C$(i)&&C$(o)?"rect":C$(n)&&C$(r)?"point":Array.isArray(p)?p.every(e=>Array.isArray(e))?"geopolygon":"polygon":null}function A$(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}function P$(e){return function(){return e}}const L$=Math.abs,T$=Math.atan2,O$=Math.cos,q$=Math.max,N$=Math.min,j$=Math.sin,z$=Math.sqrt,F$=1e-12,W$=Math.PI,$$=W$/2,B$=2*W$;function V$(e){return e>=1?$$:e<=-1?-$$:Math.asin(e)}const H$=Math.PI,G$=2*H$,U$=1e-6,Y$=G$-U$;function K$(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class X${constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?K$:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return K$;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,s=this._y1,a=n-e,l=r-t,c=o-e,u=s-t,d=c*c+u*u;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(d>U$)if(Math.abs(u*a-l*c)>U$&&i){let h=n-o,p=r-s,f=a*a+l*l,m=h*h+p*p,g=Math.sqrt(f),y=Math.sqrt(d),v=i*Math.tan((H$-Math.acos((f+d-m)/(2*g*y)))/2),b=v/y,x=v/g;Math.abs(b-1)>U$&&this._append`L${e+b*c},${t+b*u}`,this._append`A${i},${i},0,0,${+(u*h>c*p)},${this._x1=e+x*a},${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 s=n*Math.cos(r),a=n*Math.sin(r),l=e+s,c=t+a,u=1^o,d=o?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>U$||Math.abs(this._y1-c)>U$)&&this._append`L${l},${c}`,n&&(d<0&&(d=d%G$+G$),d>Y$?this._append`A${n},${n},0,1,${u},${e-s},${t-a}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:d>U$&&this._append`A${n},${n},0,${+(d>=H$)},${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 J$(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 X$(t)}function Z$(e){return e.innerRadius}function Q$(e){return e.outerRadius}function eB(e){return e.startAngle}function tB(e){return e.endAngle}function nB(e){return e&&e.padAngle}function rB(e,t,n,r,i,o,s){var a=e-n,l=t-r,c=(s?o:-o)/z$(a*a+l*l),u=c*l,d=-c*a,h=e+u,p=t+d,f=n+u,m=r+d,g=(h+f)/2,y=(p+m)/2,v=f-h,b=m-p,x=v*v+b*b,w=i-o,S=h*m-f*p,C=(b<0?-1:1)*z$(q$(0,w*w*x-S*S)),E=(S*b-v*C)/x,M=(-S*v-b*C)/x,k=(S*b+v*C)/x,I=(-S*v+b*C)/x,R=E-g,_=M-y,D=k-g,A=I-y;return R*R+_*_>D*D+A*A&&(E=k,M=I),{cx:E,cy:M,x01:-u,y01:-d,x11:E*(i/w-1),y11:M*(i/w-1)}}function iB(){var e=Z$,t=Q$,n=P$(0),r=null,i=eB,o=tB,s=nB,a=null,l=J$(c);function c(){var c,u,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=i.apply(this,arguments)-$$,f=o.apply(this,arguments)-$$,m=L$(f-p),g=f>p;if(a||(a=c=l()),h<d&&(u=h,h=d,d=u),h>F$)if(m>B$-F$)a.moveTo(h*O$(p),h*j$(p)),a.arc(0,0,h,p,f,!g),d>F$&&(a.moveTo(d*O$(f),d*j$(f)),a.arc(0,0,d,f,p,g));else{var y,v,b=p,x=f,w=p,S=f,C=m,E=m,M=s.apply(this,arguments)/2,k=M>F$&&(r?+r.apply(this,arguments):z$(d*d+h*h)),I=N$(L$(h-d)/2,+n.apply(this,arguments)),R=I,_=I;if(k>F$){var D=V$(k/d*j$(M)),A=V$(k/h*j$(M));(C-=2*D)>F$?(w+=D*=g?1:-1,S-=D):(C=0,w=S=(p+f)/2),(E-=2*A)>F$?(b+=A*=g?1:-1,x-=A):(E=0,b=x=(p+f)/2)}var P=h*O$(b),L=h*j$(b),T=d*O$(S),O=d*j$(S);if(I>F$){var q,N=h*O$(x),j=h*j$(x),z=d*O$(w),F=d*j$(w);if(m<W$)if(q=function(e,t,n,r,i,o,s,a){var l=n-e,c=r-t,u=s-i,d=a-o,h=d*l-u*c;if(!(h*h<F$))return[e+(h=(u*(t-o)-d*(e-i))/h)*l,t+h*c]}(P,L,z,F,N,j,T,O)){var W=P-q[0],$=L-q[1],B=N-q[0],V=j-q[1],H=1/j$(function(e){return e>1?0:e<-1?W$:Math.acos(e)}((W*B+$*V)/(z$(W*W+$*$)*z$(B*B+V*V)))/2),G=z$(q[0]*q[0]+q[1]*q[1]);R=N$(I,(d-G)/(H-1)),_=N$(I,(h-G)/(H+1))}else R=_=0}E>F$?_>F$?(y=rB(z,F,P,L,h,_,g),v=rB(N,j,T,O,h,_,g),a.moveTo(y.cx+y.x01,y.cy+y.y01),_<I?a.arc(y.cx,y.cy,_,T$(y.y01,y.x01),T$(v.y01,v.x01),!g):(a.arc(y.cx,y.cy,_,T$(y.y01,y.x01),T$(y.y11,y.x11),!g),a.arc(0,0,h,T$(y.cy+y.y11,y.cx+y.x11),T$(v.cy+v.y11,v.cx+v.x11),!g),a.arc(v.cx,v.cy,_,T$(v.y11,v.x11),T$(v.y01,v.x01),!g))):(a.moveTo(P,L),a.arc(0,0,h,b,x,!g)):a.moveTo(P,L),d>F$&&C>F$?R>F$?(y=rB(T,O,N,j,d,-R,g),v=rB(P,L,z,F,d,-R,g),a.lineTo(y.cx+y.x01,y.cy+y.y01),R<I?a.arc(y.cx,y.cy,R,T$(y.y01,y.x01),T$(v.y01,v.x01),!g):(a.arc(y.cx,y.cy,R,T$(y.y01,y.x01),T$(y.y11,y.x11),!g),a.arc(0,0,d,T$(y.cy+y.y11,y.cx+y.x11),T$(v.cy+v.y11,v.cx+v.x11),g),a.arc(v.cx,v.cy,R,T$(v.y11,v.x11),T$(v.y01,v.x01),!g))):a.arc(0,0,d,S,w,g):a.lineTo(T,O)}else a.moveTo(0,0);if(a.closePath(),c)return a=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-W$/2;return[O$(r)*n,j$(r)*n]},c.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:P$(+t),c):e},c.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:P$(+e),c):t},c.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:P$(+e),c):n},c.padRadius=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:P$(+e),c):r},c.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:P$(+e),c):i},c.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:P$(+e),c):o},c.padAngle=function(e){return arguments.length?(s="function"==typeof e?e:P$(+e),c):s},c.context=function(e){return arguments.length?(a=null==e?null:e,c):a},c}function oB(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function sB(e){this._context=e}function aB(e){return new sB(e)}function lB(e){return e[0]}function cB(e){return e[1]}function uB(e,t,n){var r=null,i=P$(!0),o=null,s=aB,a=null,l=J$(c);function c(c){var u,d,h,p,f,m=(c=oB(c)).length,g=!1,y=new Array(m),v=new Array(m);for(null==o&&(a=s(f=l())),u=0;u<=m;++u){if(!(u<m&&i(p=c[u],u,c))===g)if(g=!g)d=u,a.areaStart(),a.lineStart();else{for(a.lineEnd(),a.lineStart(),h=u-1;h>=d;--h)a.point(y[h],v[h]);a.lineEnd(),a.areaEnd()}g&&(y[u]=+e(p,u,c),v[u]=+t(p,u,c),a.point(r?+r(p,u,c):y[u],n?+n(p,u,c):v[u]))}if(f)return a=null,f+""||null}function u(){return function(e,t){var n=P$(!0),r=null,i=aB,o=null,s=J$(a);function a(a){var l,c,u,d=(a=oB(a)).length,h=!1;for(null==r&&(o=i(u=s())),l=0;l<=d;++l)!(l<d&&n(c=a[l],l,a))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+e(c,l,a),+t(c,l,a));if(u)return o=null,u+""||null}return e="function"==typeof e?e:void 0===e?lB:P$(e),t="function"==typeof t?t:void 0===t?cB:P$(t),a.x=function(t){return arguments.length?(e="function"==typeof t?t:P$(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:P$(+e),a):t},a.defined=function(e){return arguments.length?(n="function"==typeof e?e:P$(!!e),a):n},a.curve=function(e){return arguments.length?(i=e,null!=r&&(o=i(r)),a):i},a.context=function(e){return arguments.length?(null==e?r=o=null:o=i(r=e),a):r},a}().defined(i).curve(s).context(o)}return e="function"==typeof e?e:void 0===e?lB:P$(+e),t="function"==typeof t?t:P$(void 0===t?0:+t),n="function"==typeof n?n:void 0===n?cB:P$(+n),c.x=function(t){return arguments.length?(e="function"==typeof t?t:P$(+t),r=null,c):e},c.x0=function(t){return arguments.length?(e="function"==typeof t?t:P$(+t),c):e},c.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:P$(+e),c):r},c.y=function(e){return arguments.length?(t="function"==typeof e?e:P$(+e),n=null,c):t},c.y0=function(e){return arguments.length?(t="function"==typeof e?e:P$(+e),c):t},c.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:P$(+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:P$(!!e),c):i},c.curve=function(e){return arguments.length?(s=e,null!=o&&(a=s(o)),c):s},c.context=function(e){return arguments.length?(null==e?o=a=null:a=s(o=e),c):o},c}function dB(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function hB(e){return e}function pB(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 fB(e){this._context=e}function mB(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 gB(e,t){this._context=e,this._k=(1-t)/6}sB.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)}}},fB.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:pB(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:pB(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},gB.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:mB(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:mB(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 yB=function e(t){function n(e){return new gB(e,t)}return n.tension=function(t){return e(+t)},n}(0);function vB(e,t){this._context=e,this._alpha=t}vB.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,s=e._y2;if(e._l01_a>F$){var a=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*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>F$){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,s=(s*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,o,s,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 bB=function e(t){function n(e){return t?new vB(e,t):new gB(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function xB(e){return e<0?-1:1}function wB(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),a=(o*i+s*r)/(r+i);return(xB(o)+xB(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(a))||0}function SB(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function CB(e,t,n){var r=e._x0,i=e._y0,o=e._x1,s=e._y1,a=(o-r)/3;e._context.bezierCurveTo(r+a,i+a*t,o-a,s-a*n,o,s)}function EB(e){this._context=e}function MB(e){this._context=new kB(e)}function kB(e){this._context=e}function IB(e){this._context=e}function RB(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),s=new Array(r);for(i[0]=0,o[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,o[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,o[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/o[t-1],o[t]-=n,s[t]-=n*s[t-1];for(i[r-1]=s[r-1]/o[r-1],t=r-2;t>=0;--t)i[t]=(s[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 _B(e,t){this._context=e,this._t=t}function DB(e,t){if((i=e.length)>1)for(var n,r,i,o=1,s=e[t[0]],a=s.length;o<i;++o)for(r=s,s=e[t[o]],n=0;n<a;++n)s[n][1]+=s[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function AB(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function PB(e,t){return e[t]}function LB(e){const t=[];return t.key=e,t}function TB(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 OB(e){for(var t,n=0,r=-1,i=e.length;++r<i;)(t=+e[r][1])&&(n+=t);return n}function qB(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 s(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 a(e){return i[e]||o.get(e)}function l(e,i){if(void 0!==i)return s(e,i);const o=a(e);return r&&void 0===o&&r.warn("".concat(e," does not exist in ").concat(n," registry")),o||a(t)}return t=o.default(),l.add=s,l.get=a,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=s,l}function NB(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 jB(e){return(e=NB(Math.abs(e)))?e[1]:NaN}EB.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:CB(this,this._t0,SB(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,CB(this,SB(this,n=wB(this,e,t)),n);break;default:CB(this,this._t0,n=wB(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(MB.prototype=Object.create(EB.prototype)).point=function(e,t){EB.prototype.point.call(this,t,e)},kB.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)}},IB.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=RB(e),i=RB(t),o=0,s=1;s<n;++o,++s)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[s],t[s]);(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)}},_B.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 zB,FB=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function WB(e){if(!(t=FB.exec(e)))throw new Error("invalid format: "+e);var t;return new $B({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 $B(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 BB(e,t){var n=NB(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")}WB.prototype=$B.prototype,$B.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 VB={"%":(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)=>BB(100*e,t),r:BB,s:function(e,t){var n=NB(e,t);if(!n)return zB=void 0,e.toPrecision(t);var r=n[0],i=n[1],o=i-(zB=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,s=r.length;return o===s?r:o>s?r+new Array(o-s+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+NB(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function HB(e){return e}var GB,UB,YB,KB=Array.prototype.map,XB=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function JB(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?HB:(t=KB.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],s=0,a=t[0],l=0;i>0&&a>0&&(l+a+1>r&&(a=Math.max(1,r-l)),o.push(e.substring(i-=a,i+a)),!((l+=a+1)>r));)a=t[s=(s+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",s=void 0===e.decimal?".":e.decimal+"",a=void 0===e.numerals?HB:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(KB.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=WB(e)).fill,d=e.align,h=e.sign,p=e.symbol,f=e.zero,m=e.width,g=e.comma,y=e.precision,v=e.trim,b=e.type;"n"===b?(g=!0,b="g"):VB[b]||(void 0===y&&(y=12),v=!0,b="g"),(f||"0"===n&&"="===d)&&(f=!0,n="0",d="=");var x=(t&&void 0!==t.prefix?t.prefix:"")+("$"===p?i:"#"===p&&/[boxX]/.test(b)?"0"+b.toLowerCase():""),w=("$"===p?o:/[%p]/.test(b)?l:"")+(t&&void 0!==t.suffix?t.suffix:""),S=VB[b],C=/[defgprs%]/.test(b);function E(e){var t,i,o,l=x,p=w;if("c"===b)p=S(e)+p,e="";else{var E=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:S(Math.abs(e),y),v&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),E&&0===+e&&"+"!==h&&(E=!1),l=(E?"("===h?h:c:"-"===h||"("===h?"":h)+l,p=("s"!==b||isNaN(e)||void 0===zB?"":XB[8+zB/3])+p+(E&&"("===h?")":""),C)for(t=-1,i=e.length;++t<i;)if(48>(o=e.charCodeAt(t))||o>57){p=(46===o?s+e.slice(t+1):e.slice(t))+p,e=e.slice(0,t);break}}g&&!f&&(e=r(e,1/0));var M=l.length+e.length+p.length,k=M<m?new Array(m-M+1).join(n):"";switch(g&&f&&(e=r(k+e,k.length?m-p.length:1/0),k=""),d){case"<":e=l+e+p+k;break;case"=":e=l+k+e+p;break;case"^":e=k.slice(0,M=k.length>>1)+l+e+p+k.slice(M);break;default:e=k+l+e+p}return a(e)}return y=void 0===y?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),E.toString=function(){return e+""},E}return{format:d,formatPrefix:function(e,t){var n=3*Math.max(-8,Math.min(8,Math.floor(jB(t)/3))),r=Math.pow(10,-n),i=d(((e=WB(e)).type="f",e),{suffix:XB[8+n/3]});return function(e){return i(r*e)}}}}!function(e){GB=JB(e),UB=GB.format,YB=GB.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const ZB=new Date,QB=new Date;function eV(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 s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;let a;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<r);return s},i.filter=n=>eV(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)=>(ZB.setTime(+t),QB.setTime(+r),e(ZB),e(QB),Math.floor(n(ZB,QB))),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 tV=6e4,nV=864e5,rV=6048e5,iV=eV(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*tV)/nV,e=>e.getDate()-1);iV.range;const oV=eV(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/nV,e=>e.getUTCDate()-1);oV.range;const sV=eV(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/nV,e=>Math.floor(e/nV));function aV(e){return eV(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())*tV)/rV)}sV.range;const lV=aV(0),cV=aV(1),uV=aV(2),dV=aV(3),hV=aV(4),pV=aV(5),fV=aV(6);function mV(e){return eV(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)/rV)}lV.range,cV.range,uV.range,dV.range,hV.range,pV.range,fV.range;const gV=mV(0),yV=mV(1),vV=mV(2),bV=mV(3),xV=mV(4),wV=mV(5),SV=mV(6);gV.range,yV.range,vV.range,bV.range,xV.range,wV.range,SV.range;const CV=eV(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());CV.every=e=>isFinite(e=Math.floor(e))&&e>0?eV(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,CV.range;const EV=eV(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 MV(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function kV(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function IV(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=MV,n=(t,n)=>MV(e(t),n),r=(t,n)=>e(t)-n):(t=e===MV||e===kV?e:RV,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const s=i(e,t,n,o-1);return s>n&&r(e[s-1],t)>-r(e[s],t)?s-1:s},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 RV(){return 0}EV.every=e=>isFinite(e=Math.floor(e))&&e>0?eV(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,EV.range;const _V=IV(MV).right;IV(function(e){return null===e?NaN:+e}).center;var DV=_V;class AV extends Map{constructor(e,t=LV){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(PV(this,e))}has(e){return super.has(PV(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 PV({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function LV(e){return null!==e&&"object"==typeof e?e.valueOf():e}const TV=Math.sqrt(50),OV=Math.sqrt(10),qV=Math.sqrt(2);function NV(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),s=o>=TV?10:o>=OV?5:o>=qV?2:1;let a,l,c;return i<0?(c=Math.pow(10,-i)/s,a=Math.round(e*c),l=Math.round(t*c),a/c<e&&++a,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*s,a=Math.round(e/c),l=Math.round(t/c),a*c<e&&++a,l*c>t&&--l),l<a&&.5<=n&&n<2?NV(e,t,2*n):[a,l,c]}function jV(e,t,n){return NV(e=+e,t=+t,n=+n)[2]}function zV(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 FV(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 WV(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function $V(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,s=e.shortDays,a=e.months,l=e.shortMonths,c=KV(i),u=XV(i),d=KV(o),h=XV(o),p=KV(s),f=XV(s),m=KV(a),g=XV(a),y=KV(l),v=XV(l),b={a:function(e){return s[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return a[e.getMonth()]},c:null,d:yH,e:yH,f:SH,g:LH,G:OH,H:vH,I:bH,j:xH,L:wH,m:CH,M:EH,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:iG,s:oG,S:MH,u:kH,U:IH,V:_H,w:DH,W:AH,x:null,X:null,y:PH,Y:TH,Z:qH,"%":rG},x={a:function(e){return s[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return a[e.getUTCMonth()]},c:null,d:NH,e:NH,f:$H,g:QH,G:tG,H:jH,I:zH,j:FH,L:WH,m:BH,M:VH,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:iG,s:oG,S:HH,u:GH,U:UH,V:KH,w:XH,W:JH,x:null,X:null,y:ZH,Y:eG,Z:nG,"%":rG},w={a:function(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return E(e,t,n,r)},d:aH,e:aH,f:pH,g:rH,G:nH,H:cH,I:cH,j:lH,L:hH,m:sH,M:uH,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:oH,Q:mH,s:gH,S:dH,u:ZV,U:QV,V:eH,w:JV,W:tH,x:function(e,t,r){return E(e,n,t,r)},X:function(e,t,n){return E(e,r,t,n)},y:rH,Y:nH,Z:iH,"%":fH};function S(e,t){return function(n){var r,i,o,s=[],a=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++a<c;)37===e.charCodeAt(a)&&(s.push(e.slice(l,a)),null!=(i=BV[r=e.charAt(++a)])?r=e.charAt(++a):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),s.push(r),l=a+1);return s.push(e.slice(l,a)),s.join("")}}function C(e,t){return function(n){var r,i,o=WV(1900,void 0,1);if(E(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=FV(WV(o.y,0,1))).getUTCDay(),r=i>4||0===i?yV.ceil(r):yV(r),r=oV.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=zV(WV(o.y,0,1))).getDay(),r=i>4||0===i?cV.ceil(r):cV(r),r=iV.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?FV(WV(o.y,0,1)).getUTCDay():zV(WV(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,FV(o)):zV(o)}}function E(e,t,n,r){for(var i,o,s=0,a=t.length,l=n.length;s<a;){if(r>=l)return-1;if(37===(i=t.charCodeAt(s++))){if(i=t.charAt(s++),!(o=w[i in BV?t.charAt(s++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=S(n,b),b.X=S(r,b),b.c=S(t,b),x.x=S(n,x),x.X=S(r,x),x.c=S(t,x),{format:function(e){var t=S(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=C(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+="",!0);return t.toString=function(){return e},t}}}var BV={"-":"",_:" ",0:"0"},VV=/^\s*\d+/,HV=/^%/,GV=/[\\^$*+?|[\]().{}]/g;function UV(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 YV(e){return e.replace(GV,"\\$&")}function KV(e){return new RegExp("^(?:"+e.map(YV).join("|")+")","i")}function XV(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function JV(e,t,n){var r=VV.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function ZV(e,t,n){var r=VV.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function QV(e,t,n){var r=VV.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function eH(e,t,n){var r=VV.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function tH(e,t,n){var r=VV.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function nH(e,t,n){var r=VV.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function rH(e,t,n){var r=VV.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function iH(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 oH(e,t,n){var r=VV.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function sH(e,t,n){var r=VV.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function aH(e,t,n){var r=VV.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function lH(e,t,n){var r=VV.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function cH(e,t,n){var r=VV.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function uH(e,t,n){var r=VV.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function dH(e,t,n){var r=VV.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function hH(e,t,n){var r=VV.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function pH(e,t,n){var r=VV.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function fH(e,t,n){var r=HV.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function mH(e,t,n){var r=VV.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function gH(e,t,n){var r=VV.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function yH(e,t){return UV(e.getDate(),t,2)}function vH(e,t){return UV(e.getHours(),t,2)}function bH(e,t){return UV(e.getHours()%12||12,t,2)}function xH(e,t){return UV(1+iV.count(CV(e),e),t,3)}function wH(e,t){return UV(e.getMilliseconds(),t,3)}function SH(e,t){return wH(e,t)+"000"}function CH(e,t){return UV(e.getMonth()+1,t,2)}function EH(e,t){return UV(e.getMinutes(),t,2)}function MH(e,t){return UV(e.getSeconds(),t,2)}function kH(e){var t=e.getDay();return 0===t?7:t}function IH(e,t){return UV(lV.count(CV(e)-1,e),t,2)}function RH(e){var t=e.getDay();return t>=4||0===t?hV(e):hV.ceil(e)}function _H(e,t){return e=RH(e),UV(hV.count(CV(e),e)+(4===CV(e).getDay()),t,2)}function DH(e){return e.getDay()}function AH(e,t){return UV(cV.count(CV(e)-1,e),t,2)}function PH(e,t){return UV(e.getFullYear()%100,t,2)}function LH(e,t){return UV((e=RH(e)).getFullYear()%100,t,2)}function TH(e,t){return UV(e.getFullYear()%1e4,t,4)}function OH(e,t){var n=e.getDay();return UV((e=n>=4||0===n?hV(e):hV.ceil(e)).getFullYear()%1e4,t,4)}function qH(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+UV(t/60|0,"0",2)+UV(t%60,"0",2)}function NH(e,t){return UV(e.getUTCDate(),t,2)}function jH(e,t){return UV(e.getUTCHours(),t,2)}function zH(e,t){return UV(e.getUTCHours()%12||12,t,2)}function FH(e,t){return UV(1+oV.count(EV(e),e),t,3)}function WH(e,t){return UV(e.getUTCMilliseconds(),t,3)}function $H(e,t){return WH(e,t)+"000"}function BH(e,t){return UV(e.getUTCMonth()+1,t,2)}function VH(e,t){return UV(e.getUTCMinutes(),t,2)}function HH(e,t){return UV(e.getUTCSeconds(),t,2)}function GH(e){var t=e.getUTCDay();return 0===t?7:t}function UH(e,t){return UV(gV.count(EV(e)-1,e),t,2)}function YH(e){var t=e.getUTCDay();return t>=4||0===t?xV(e):xV.ceil(e)}function KH(e,t){return e=YH(e),UV(xV.count(EV(e),e)+(4===EV(e).getUTCDay()),t,2)}function XH(e){return e.getUTCDay()}function JH(e,t){return UV(yV.count(EV(e)-1,e),t,2)}function ZH(e,t){return UV(e.getUTCFullYear()%100,t,2)}function QH(e,t){return UV((e=YH(e)).getUTCFullYear()%100,t,2)}function eG(e,t){return UV(e.getUTCFullYear()%1e4,t,4)}function tG(e,t){var n=e.getUTCDay();return UV((e=n>=4||0===n?xV(e):xV.ceil(e)).getUTCFullYear()%1e4,t,4)}function nG(){return"+0000"}function rG(){return"%"}function iG(e){return+e}function oG(e){return Math.floor(+e/1e3)}const sG=qB();sG("d3-number",function(e,t,n){let r,i;function o(e){return i(e)}function s(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return r=JB(t),i=r.format(e),this},s(),o.format=function(e,i,o,a){return(o||a)&&(t=o,n=a,s()),r.format(e)(i)},o.pattern=function(t){return t&&(e=t,i=r.format(t)),e},o}),sG("d3-time",function(e){let t=$V({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=$V(...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 aG={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 sG(t.type||"d3-number")(t.format||"")})(e)};function lG(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.id,r=void 0===n?aG.id:n,i=t.key,o=void 0===i?aG.key:i,s=t.min,a=void 0===s?aG.min:s,l=t.max,c=void 0===l?aG.max:l,u=t.type,d=void 0===u?aG.type:u,h=t.tags,p=void 0===h?aG.tags:h,f=t.title,m=void 0===f?aG.title:f,g=t.values,y=void 0===g?aG.values:g,v=t.value,b=void 0===v?aG.value:v,x=t.label,w=void 0===x?aG.label:x,S=t.formatter,C=void 0===S?aG.formatter:S;return{id:()=>r(e),key:()=>o(e),raw:()=>e,tags:()=>p(e),type:()=>d(e),min:()=>a(e),max:()=>c(e),title:()=>m(e),items:()=>y(e),formatter:()=>C(e),value:b,label:w}}const cG=e=>e.filter(e=>"number"==typeof e&&!isNaN(e)),uG=e=>e.reduce((e,t)=>e+t,0),dG={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=cG(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=cG(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=cG(e);return t.length?t.reduce((e,t)=>e+t,0):NaN},avg:e=>{const t=cG(e),n=t.length;return n?uG(t)/n:NaN}};function hG(e,t,n,r){const i={},o=r.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach(s=>{const a=n[s],l=i[s]={};-1!==["number","string","boolean"].indexOf(typeof a)?(l.type="primitive",l.value=a):"function"==typeof a?(l.type="function",l.value=a,l.label=a,l.field=o):"object"==typeof a&&(a.fields?l.fields=a.fields.map(n=>hG(e,t,{main:n},r).main):void 0!==a.field?(l.type="field",l.field=t.field(a.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 a.filter&&(l.filter=a.filter),void 0!==a.value&&(l.value=a.value),void 0!==a.label&&(l.label=a.label),"function"==typeof a.reduce?l.reduce=a.reduce:a.reduce?l.reduce=dG[a.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?dG[l.field.reduce]:l.field.reduce),"function"==typeof a.reduceLabel?l.reduceLabel=a.reduceLabel:a.reduceLabel?l.reduceLabel=dG[a.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?dG[l.field.reduceLabel]:l.field.reduceLabel))}),i}function pG(e,t){const n=hG(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{}).main;return{props:hG(e,t,e.props||{},n),main:n}}function fG(e,t,n,r){const i=Array(e.length),o=Array(e.length);let s;for(let t=0;t<e.length;t++)s=r?e[t][r]:e[t],i[t]=s.value,o[t]=s.label;const a=t.reduce,l=t.reduceLabel,c=a?a(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 mG(e,t){let n=t.main,r=t.propsArr,i=t.props,o=[];const s=n.field.formatter(),a={};return r.forEach(e=>{a[e]=i[e].field?i[e].field.formatter():e=>e}),o.push(...e.map(e=>{const t=fG(e.items,n,s);return r.forEach(n=>{t[n]=fG(e.items,i[n],a[n],n)}),t})),o}function gG(e){let t=e.cfg,n=e.itemData,r=e.obj,i=e.target,o=e.tracker;const s="function"===e.trackType?t.trackBy(n):n[t.trackBy];let a=o[s];a||(a=o[s]={items:[],id:s},i.push(a)),a.items.push(r)}function yG(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 vG(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 bG={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 s=0;s<n;++s){const n=e[t[s]][i],a=n[1]-n[0];a>=0?(n[0]=r,r+=a,n[1]=r):a<0?(n[1]=o,o+=a,n[0]=o):n[0]=r}}},none:DB,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 s=0,a=0;s<n;++s)a+=e[s][r][1]||0;i[r][1]+=i[r][0]=-a/2}DB(e,t)}},expand:function(e,t){if((r=e.length)>0){for(var n,r,i,o=0,s=e[0].length;o<s;++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}DB(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,s=1;s<r;++s){for(var a=0,l=0,c=0;a<i;++a){for(var u=e[t[a]],d=u[s][1]||0,h=(d-(u[s-1][1]||0))/2,p=0;p<a;++p){var f=e[t[p]];h+=(f[s][1]||0)-(f[s-1][1]||0)}l+=d,c+=h*d}n[s-1][1]+=n[s-1][0]=o,l&&(o-=c/l)}n[s-1][1]+=n[s-1][0]=o,DB(e,t)}}},xG={ascending:function(e){var t=e.map(OB);return AB(e).sort(function(e,n){return t[e]-t[n]})},insideout:function(e){var t,n,r=e.length,i=e.map(OB),o=function(e){var t=e.map(TB);return AB(e).sort(function(e,n){return t[e]-t[n]})}(e),s=0,a=0,l=[],c=[];for(t=0;t<r;++t)n=o[t],s<a?(s+=i[n],l.push(n)):(a+=i[n],c.push(n));return c.reverse().concat(l)},none:AB,reverse:function(e){return AB(e).reverse()}};function wG(e,t,n,r){const i=r||e.items,o={},s=t.stackKey,a=t.value,l=t.startProp||"start",c=t.endProp||"end",u=t.offset||"none",d=t.order||"none",h=t.valueRef||"";let p=0,f={};for(let e=0;e<i.length;e++){let t=i[e],n=h?t[h]:null;if(n&&n.source){let e="".concat(n.source.key||"","/").concat(n.source.field);f[e]||(f[e]=n.source)}let r=s(t);o[r]=o[r]||{items:[]},o[r].items.push(t),p=Math.max(p,o[r].items.length)}const m=Array.apply(null,{length:p}).map(Number.call,Number),g=Object.keys(o).map(e=>o[e].items),y=function(){var e=P$([]),t=AB,n=DB,r=PB;function i(i){var o,s,a=Array.from(e.apply(this,arguments),LB),l=a.length,c=-1;for(const e of i)for(o=0,++c;o<l;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,s=oB(t(a));o<l;++o)a[s[o]].index=o;return n(a,s),a}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:P$(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r="function"==typeof e?e:P$(+e),i):r},i.order=function(e){return arguments.length?(t=null==e?AB:"function"==typeof e?e:P$(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?DB:e,i):n},i}().keys(m).value((e,t)=>e[t]?a(e[t]):0).order(xG[d]).offset(bG[u]);let v=y(g),b=[];for(let e=0;e<v.length;e++){let t=v[e];for(let e=0;e<t.length;e++){let n=t[e],r=t[e].data[t.key];r&&(r[l]={value:n[0]},r[c]={value:n[1]},b.push(n[0],n[1]))}}let x=Object.keys(f).map(e=>{let t=n(f[e].key);return t?t.field(f[e].field):null}).filter(e=>!!e);const w=lG({title:x.map(e=>e.title()).join(", "),min:vG(b),max:yG(b),type:"measure",formatter:x[0]?x[0].formatter:void 0});e.fields.push(w)}function SG(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=x$({},t.collection(e.collection));else{const i=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),s=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(s(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),s=t.label||(e=>e),n.value=o),n.items=t.items().map(t=>({value:o(t),label:String(s(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});wG(n,e.stack,t.dataset,i)}):wG(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 CG(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:SG;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 EG(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const MG=Symbol("implicit");function kG(){var e=new AV,t=[],n=[],r=MG;function i(i){let o=e.get(i);if(void 0===o){if(r!==MG)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 AV;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 kG(t,n).unknown(r)},EG.apply(i,arguments),i}function IG(){var e,t,n=kG().unknown(void 0),r=n.domain,i=n.range,o=0,s=1,a=!1,l=0,c=0,u=.5;function d(){var n=r().length,d=s<o,h=d?s:o,p=d?o:s;e=(p-h)/Math.max(1,n-l+2*c),a&&(e=Math.floor(e)),h+=(p-h-e*(n-l))*u,t=e*(1-l),a&&(h=Math.round(h),t=Math.round(t));var f=function(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r<i;)o[r]=e+r*n;return o}(n).map(function(t){return h+e*t});return i(d?f.reverse():f)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),d()):r()},n.range=function(e){return arguments.length?([o,s]=e,o=+o,s=+s,d()):[o,s]},n.rangeRound=function(e){return[o,s]=e,o=+o,s=+s,a=!0,d()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(a=!!e,d()):a},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 IG(r(),[o,s]).round(a).paddingInner(l).paddingOuter(c).align(u)},EG.apply(d(),arguments)}function RG(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function _G(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function DG(){}var AG=.7,PG=1/AG,LG="\\s*([+-]?\\d+)\\s*",TG="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",OG="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qG=/^#([0-9a-f]{3,8})$/,NG=new RegExp(`^rgb\\(${LG},${LG},${LG}\\)$`),jG=new RegExp(`^rgb\\(${OG},${OG},${OG}\\)$`),zG=new RegExp(`^rgba\\(${LG},${LG},${LG},${TG}\\)$`),FG=new RegExp(`^rgba\\(${OG},${OG},${OG},${TG}\\)$`),WG=new RegExp(`^hsl\\(${TG},${OG},${OG}\\)$`),$G=new RegExp(`^hsla\\(${TG},${OG},${OG},${TG}\\)$`),BG={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 VG(){return this.rgb().formatHex()}function HG(){return this.rgb().formatRgb()}function GG(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=qG.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?UG(t):3===n?new XG(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?YG(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?YG(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=NG.exec(e))?new XG(t[1],t[2],t[3],1):(t=jG.exec(e))?new XG(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=zG.exec(e))?YG(t[1],t[2],t[3],t[4]):(t=FG.exec(e))?YG(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=WG.exec(e))?nU(t[1],t[2]/100,t[3]/100,1):(t=$G.exec(e))?nU(t[1],t[2]/100,t[3]/100,t[4]):BG.hasOwnProperty(e)?UG(BG[e]):"transparent"===e?new XG(NaN,NaN,NaN,0):null}function UG(e){return new XG(e>>16&255,e>>8&255,255&e,1)}function YG(e,t,n,r){return r<=0&&(e=t=n=NaN),new XG(e,t,n,r)}function KG(e,t,n,r){return 1===arguments.length?function(e){return e instanceof DG||(e=GG(e)),e?new XG((e=e.rgb()).r,e.g,e.b,e.opacity):new XG}(e):new XG(e,t,n,null==r?1:r)}function XG(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function JG(){return`#${tU(this.r)}${tU(this.g)}${tU(this.b)}`}function ZG(){const e=QG(this.opacity);return`${1===e?"rgb(":"rgba("}${eU(this.r)}, ${eU(this.g)}, ${eU(this.b)}${1===e?")":`, ${e})`}`}function QG(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function eU(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function tU(e){return((e=eU(e))<16?"0":"")+e.toString(16)}function nU(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new iU(e,t,n,r)}function rU(e){if(e instanceof iU)return new iU(e.h,e.s,e.l,e.opacity);if(e instanceof DG||(e=GG(e)),!e)return new iU;if(e instanceof iU)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new iU(s,a,l,e.opacity)}function iU(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function oU(e){return(e=(e||0)%360)<0?e+360:e}function sU(e){return Math.max(0,Math.min(1,e||0))}function aU(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}RG(DG,GG,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:VG,formatHex:VG,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return rU(this).formatHsl()},formatRgb:HG,toString:HG}),RG(XG,KG,_G(DG,{brighter(e){return e=null==e?PG:Math.pow(PG,e),new XG(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?AG:Math.pow(AG,e),new XG(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new XG(eU(this.r),eU(this.g),eU(this.b),QG(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:JG,formatHex:JG,formatHex8:function(){return`#${tU(this.r)}${tU(this.g)}${tU(this.b)}${tU(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ZG,toString:ZG})),RG(iU,function(e,t,n,r){return 1===arguments.length?rU(e):new iU(e,t,n,null==r?1:r)},_G(DG,{brighter(e){return e=null==e?PG:Math.pow(PG,e),new iU(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?AG:Math.pow(AG,e),new iU(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 XG(aU(e>=240?e-240:e+120,i,r),aU(e,i,r),aU(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new iU(oU(this.h),sU(this.s),sU(this.l),QG(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=QG(this.opacity);return`${1===e?"hsl(":"hsla("}${oU(this.h)}, ${100*sU(this.s)}%, ${100*sU(this.l)}%${1===e?")":`, ${e})`}`}}));var lU=e=>()=>e;function cU(e){return 1===(e=+e)?uU: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):lU(isNaN(t)?n:t)}}function uU(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):lU(isNaN(e)?t:e)}var dU=function e(t){var n=cU(t);function r(e,t){var r=n((e=KG(e)).r,(t=KG(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=uU(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1);function hU(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 pU(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),s=new Array(r);for(n=0;n<i;++n)o[n]=xU(e[n],t[n]);for(;n<r;++n)s[n]=t[n];return function(e){for(n=0;n<i;++n)s[n]=o[n](e);return s}}function fU(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function mU(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function gU(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]=xU(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var yU=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,vU=new RegExp(yU.source,"g");function bU(e,t){var n,r,i,o=yU.lastIndex=vU.lastIndex=0,s=-1,a=[],l=[];for(e+="",t+="";(n=yU.exec(e))&&(r=vU.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),a[s]?a[s]+=i:a[++s]=i),(n=n[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,l.push({i:s,x:mU(n,r)})),o=vU.lastIndex;return o<t.length&&(i=t.slice(o),a[s]?a[s]+=i:a[++s]=i),a.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)a[(n=l[r]).i]=n.x(e);return a.join("")})}function xU(e,t){var n,r=typeof t;return null==t||"boolean"===r?lU(t):("number"===r?mU:"string"===r?(n=GG(t))?(t=n,dU):bU:t instanceof GG?dU:t instanceof Date?fU:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?hU:Array.isArray(t)?pU:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?gU:mU)(e,t)}function wU(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function SU(e){return+e}var CU=[0,1];function EU(e){return e}function MU(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function kU(e,t,n){var r=e[0],i=e[1],o=t[0],s=t[1];return i<r?(r=MU(i,r),o=n(s,o)):(r=MU(r,i),o=n(o,s)),function(e){return o(r(e))}}function IU(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=MU(e[s],e[s+1]),o[s]=n(t[s],t[s+1]);return function(t){var n=DV(e,t,1,r)-1;return o[n](i[n](t))}}function RU(){var e,t,n,r,i,o,s=CU,a=CU,l=xU,c=EU;function u(){var e=Math.min(s.length,a.length);return c!==EU&&(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))}}(s[0],s[e-1])),r=e>2?IU:kU,i=o=null,d}function d(t){return null==t||isNaN(t=+t)?n:(i||(i=r(s.map(e),a,l)))(e(c(t)))}return d.invert=function(n){return c(t((o||(o=r(a,s.map(e),mU)))(n)))},d.domain=function(e){return arguments.length?(s=Array.from(e,SU),u()):s.slice()},d.range=function(e){return arguments.length?(a=Array.from(e),u()):a.slice()},d.rangeRound=function(e){return a=Array.from(e),l=wU,u()},d.clamp=function(e){return arguments.length?(c=!!e||EU,u()):c!==EU},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 _U(e,t,n,r){var i,o=function(e,t,n){n=+n;const r=(t=+t)<(e=+e),i=r?jV(t,e,n):jV(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}(e,t,n);switch((r=WB(null==r?",f":r)).type){case"s":var s=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(jB(t)/3)))-jB(Math.abs(e)))}(o,s))||(r.precision=i),YB(r,s);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,jB(t)-jB(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,-jB(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return UB(r)}function DU(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,s]=r?NV(t,e,n):NV(e,t,n);if(!(o>=i))return[];const a=o-i+1,l=new Array(a);if(r)if(s<0)for(let e=0;e<a;++e)l[e]=(o-e)/-s;else for(let e=0;e<a;++e)l[e]=(o-e)*s;else if(s<0)for(let e=0;e<a;++e)l[e]=(i+e)/-s;else for(let e=0;e<a;++e)l[e]=(i+e)*s;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return _U(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),s=0,a=o.length-1,l=o[s],c=o[a],u=10;for(c<l&&(i=l,l=c,c=i,i=s,s=a,a=i);u-- >0;){if((i=jV(l,c,n))===r)return o[s]=l,o[a]=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 AU(){var e=RU()(EU,EU);return e.copy=function(){return t=e,AU().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},EG.apply(e,arguments),DU(e)}function PU(){var e,t=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[DV(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 PU().domain(t).range(n).unknown(e)},EG.apply(i,arguments)}function LU(e){return void 0===e?e=>e:t=>e(t)}function TU(e){return Math.max(0,Math.min(1,e))}function OU(e){return"object"==typeof e}function qU(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 NU(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],s=e[i+1];0===i&&o!==n.start()?(r.push(...qU(t,o,s)),o-=s-o,s=e[i],r.push(...qU(t,o,s))):i===e.length-1&&s!==n.end()?(s=o+(o-e[i-1]),r.push(...qU(t,o,s))):r.push(...qU(t,o,s))}return r.filter(e=>e>=n.min()&&e<=n.max())}function jU(e){let t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,s=void 0===o?100:o,a=e.formatter,l=void 0===a?void 0:a;const c=E$(s)||E$(t)?2:Math.max(t/s,2),u=Math.min(1e3,Math.round(c));let d=n.ticks(u);d.length<=1&&(d=n.ticks(u+1));const h=i>0?NU(d,i,n):d;h.sort((e,t)=>e-t);const p=h.map(LU(l));return h.map((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:p[t],value:e,isMinor:-1===d.indexOf(e)}})}function zU(e){let t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,s=void 0===o?100:o,a=e.formatter,l=void 0===a?void 0:a;const c=E$(s)||E$(t)?2:Math.max(t/s,2),u=Math.min(1e3,Math.round(c)),d=u>10?10:u;n.nice(d);const h=n.ticks(u),p=i>0?NU(h,i,n):h;p.sort((e,t)=>e-t);const f=p.map(LU(l));return p.map((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:f[t],value:e,isMinor:-1===h.indexOf(e)}})}function FU(e){let t,n=e.settings,r=e.scale,i=e.distance,o=e.formatter,s=void 0===o?e=>e:o;const a=n.minorTicks&&!E$(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?!E$(e.value):!E$(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)=>(OU(e)?e.value:e)-(OU(t)?t.value:t)).filter((e,t,r)=>{const i=OU(e)?e.value:e;return i<=n.max()&&i>=n.min()&&r.indexOf(e)===t}).map(e=>{const t=OU(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)?TU(n(e.start)):o,end:t&&!isNaN(e.end)?TU(n(e.end)):o}})}({values:e,scale:r.copy(),formatter:s})}else if(E$(n.ticks.count)){t=(n.ticks.tight?zU:jU)({distance:i,minorCount:a,unitDivider:n.ticks.distance,scale:r,formatter:s}),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,s)}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:a,scale:r.copy(),formatter:s})}return t}function WU(){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 $U={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},BU={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},VU={count:NaN};function HU(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 GU(){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=AU(),i={instance:null,invert:!1},o={data:t,resources:n},s=WU(e,$U,o);let a;function l(e){return E$(e)?NaN:r(e)}s.ticks=WU(e.ticks,BU,o),s.minorTicks=WU(e.minorTicks,VU,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 a},l.clearTicksCache=function(){return a=void 0,this},l.ticks=function(e){return null!==e&&"object"==typeof e?(e.settings=e.settings||{},e.settings=m$(!0,{},s,e.settings),e.scale=l,a=FU(e),a):(a=r.ticks(e),a)},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,s=l(e+i);n.push(o,o),r.push(s,s)}return n.pop(),l.domain(n),l.range(r),l},l.copy=function(){const i=GU(e,t,n);return i.domain(l.domain()),i.range(l.range()),i.clamp(r.clamp()),i},l.norm=function(e){return HU(i,l),i.instance(e)},l.normInvert=function(e){return HU(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}}(s,t?t.fields:[]),u=c.mini,d=c.maxi;return l.domain([u,d]),l.range(s.invert?[1,0]:[0,1]),i.invert=s.invert,l}const UU={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function YU(){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=WU(e,UU,n),i=t.items||[],o={},s=[],a=[];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=()=>a,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 s=t(e);return{position:s+o/2,label:"".concat(i[n]),data:r?r[n]:void 0,start:s,end:s+o}})}(t,n.trackBy)}}const c=IG();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 s=c.copy();s.type=c.type,l(s,e);const a=o*n/t,u=(1-a)*c.align();return s.range(r.invert?[a+u,u]:[u,a+u]),s};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=m$({datum:i[e]},n),r=u(t,e);-1===s.indexOf(r)&&(s.push(r),a.push(d(t,e)),o[r]=e)}return c.domain(s),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 KU={depth:0};function XU(e,t,n){return e.ancestors().map(e=>t(m$({datum:e.data},n))).reverse().slice(1).toString()}const JU=e=>e.min(),ZU=e=>e.max();function QU(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(JU).filter(C$);i=e.length?Math.min(...e):i}if(!r){const e=t.map(ZU).filter(C$);o=e.length?Math.max(...e):o}}return[i,o]}const eY={domain:[],range:[],invert:!1,min:NaN,max:NaN};function tY(){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=GU(e,t,n).clamp(!0).interpolate(dU),i=WU(e,eY,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,s=Array.isArray(i.range)&&i.range.length,a=r;m$(!0,a,r);const l=w$(QU(i,t?t.fields:[]),2),c=l[0],u=l[1],d=o?i.domain.length:-1,h=n.theme?n.theme.palette("sequential",d>0?d:2):[],p=s?i.range:h;return a.range(i.invert?p.slice().reverse():p.slice()),a.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}(a.range(),c,u)),a}const nY={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function rY(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}const iY={domain:[],range:[]};const oY={domain:[],range:[],unknown:void 0},sY={domain:[],range:[],override:!1};const aY=qB();function lY(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=SG(r,t,n);let o,s=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"===s&&(s=i.fields&&i.fields[0]&&"dimension"===i.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(s)&&(o=n.scale.get(s),o=o(e,i,{theme:n.theme,logger:n.logger}),o.type=s),o}aY("linear",GU),aY("band",YU),aY("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=WU(t,UU,i);o.ticks=WU(t.ticks,KU,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 s=YU(o);const a=function(e,t,n){const r=t.ticks.depth,i=t.value,o=t.label,s=[],a=[],l={},c=[];let u=0;if(!e)return{values:s,labels:a,items:l,ticks:c};e.eachAfter(e=>{if(e.depth>0){const t=XU(e,i,n),d=e.leaves()||[e],h=i(m$({datum:e.data},n)),p=o(m$({datum:e.data},n)),f=Array.isArray(e.children),m={key:t,count:d.length,value:h,label:p,leftEdge:XU(d[0],i,n),rightEdge:XU(d[Math.max(d.length-1,0)],i,n),node:e};f?(s.push("SPACER_".concat(u,"_SPACER")),u++):(s.push(t),a.push(p)),(r<=0&&!f||e.depth===r)&&c.push(m),l[t]=m}});const d=e.height-1;return d>0&&s.splice(-d),{values:s,labels:a,items:l,ticks:c}}(n.root,o,i),l=a.values,c=a.labels,u=a.items,d=a.ticks,h=function(e){const t=String(e),n=u[t];return s(n?o.invert?n.rightEdge:n.leftEdge:t)};m$(!0,h,s),h.bandwidth=function(e){const t=u[String(e)],n=s.bandwidth();if(t&&!t.isLeaf){const e=h(t.leftEdge),r=h(t.rightEdge);return Math.abs(e-r)+n}return n},h.step=function(e){const t=u[String(e)],n=t?t.count:1;let r=s.step();return r*=n,r},h.data=()=>n,h.datum=e=>{const t=u[String(e)];return t?t.node.data:null},h.copy=()=>e(t,n,r),h.labels=()=>c,h.ticks=()=>d.map(e=>{const t=h(e.key),n=h.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}});const p=s.pxScale;return h.pxScale=function(e){return s=p(e),h},h.domain(l),h}),aY("sequential-color",tY),aY("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=PU(),i=WU(e,nY,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,s=Array.isArray(i.range)&&i.range.length;function a(e){return E$(e)?NaN:r(e)}Object.keys(r).forEach(e=>a[e]=r[e]);const l=w$(QU(i,t.fields),2),c=l[0],u=l[1],d=o?i.domain.length:-1,h=n.theme?n.theme.palette("sequential",d>0?d:2):[];let p=s?i.range:h,f=[];return f=o?i.domain:i.nice?function(e,t,n){const r=2===e.length?10:Math.max(1,e.length),i=AU().domain([t,n]).nice(r).ticks(r);if(!e||!e.length)return i;const o=Math.max(0,e.length-1);for(;i.length>o;)i[0]-t<=n-i[i.length-1]?i.shift():i.pop();return i}(p,c,u):[c+(u-c)/2],p.length>f.length+1?f=function(e,t,n){const r=e.length;if(2===r)return[t+(n-t)/2];const i=[],o=(n-t)/r;for(let e=1;e<r;e++)i.push(t+o*e);return i}(p,c,u):p.length<f.length+1&&(p=function(e,t,n,r){n=e[0],r=e&&e.length>=2?e[e.length-1]:r;const i=tY().domain([n,r]).range(t);return[n,...rY(e),r].map(e=>i(e))}(f,p,c,u)),a.data=()=>t,a.range(i.invert?p.slice().reverse():p),a.domain(f),a}),aY("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=kG(),i={data:t,resources:n},o=WU(e,iY,i),s="function"==typeof e.value?e.value:e=>e.datum.value,a="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=m$({datum:l[e]},i),n=s(t,e);-1===u.indexOf(n)&&(u.push(n),d.push(a(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=WU(e,oY,{data:t,resources:n});let s;if(o.explicit=WU(e.explicit,sY,{data:t,resources:n}),s=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/s.length);for(let e=1;e<i+1;e*=2)s=s.concat(s);if(o.explicit.override)for(let r=0;r<t.length;r++){const i=e.indexOf(t[r]);i>-1&&(s[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&&s.splice(n,0,t[2])})}s.length=e.length}return r.range(s),r});var cY={};function uY(){uY.init.call(this)}cY.isObject=function(e){return"object"==typeof e&&null!==e},cY.isNumber=function(e){return"number"==typeof e},cY.isUndefined=function(e){return void 0===e},cY.isFunction=function(e){return"function"==typeof e};var dY=uY;uY.EventEmitter=uY,uY.prototype._events=void 0,uY.prototype._maxListeners=void 0,uY.defaultMaxListeners=10,uY.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},uY.prototype.setMaxListeners=function(e){if(!cY.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},uY.prototype.emit=function(e){var t,n,r,i,o,s;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],cY.isUndefined(n))return!1;if(cY.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(cY.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(s=n.slice()).length,o=0;o<r;o++)s[o].apply(this,i)}return!0},uY.prototype.addListener=function(e,t){var n;if(!cY.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,cY.isFunction(t.listener)?t.listener:t),this._events[e]?cY.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,cY.isObject(this._events[e])&&!this._events[e].warned)&&((n=cY.isUndefined(this._maxListeners)?uY.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,cY.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),cY.isFunction(console.trace)&&console.trace()));return this},uY.prototype.on=uY.prototype.addListener,uY.prototype.once=function(e,t){if(!cY.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},uY.prototype.removeListener=function(e,t){var n,r,i,o;if(!cY.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||cY.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(cY.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},uY.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],cY.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},uY.prototype.listeners=function(e){return this._events&&this._events[e]?cY.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},uY.listenerCount=function(e,t){return e._events&&e._events[t]?cY.isFunction(e._events[t])?1:e._events[t].length:0};var hY={mixin:e=>(Object.keys(dY.prototype).forEach(t=>{e[t]=dY.prototype[t]}),dY.init(e),e)};function pY(){let e=0,t=0,n=0,r=0;n=n||e;const i={move(e){this.moveTo(n+e)},moveTo(o){const s=Math.max(e,Math.min(t-r,o));n!==s&&(n=s,i.emit("update"))},update(o){let s=!1;var a=o.min;e=void 0===a?e:a;var l=o.max;t=void 0===l?t:l,void 0!==o.viewSize&&o.viewSize!==r&&(r=o.viewSize,s=!0);const c=Math.max(e,Math.min(t-r,n));n!==c&&(n=c,s=!0),s&&i.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:r})};return hY.mixin(i),i}function fY(e,t){const n=e.min||0,r=e.max||0,i=e.viewSize||0,o=t||pY();return o.update({min:n,max:r,viewSize:i}),o}function mY(e,t){return e<=t}function gY(e,t){return e<t}function yY(e,t,n){let r=0;for(;r<e.length&&t>e[r];)++r;return e[r]===t&&n&&++r,r}function vY(){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?mY:gY,t=void 0===o||o?mY:gY},i.add=e=>{let t=e.min,n=e.max;const i=yY(r,t),o=yY(r,n,!0),s=[i,o-i];i%2==0&&s.push(t),o%2==0&&s.push(n);const a=r.join(",");r.splice(...s);return a!==r.join(",")},i.remove=e=>{let t=e.min,n=e.max;const i=yY(r,t),o=yY(r,n,!0),s=[i,o-i];i%2==1&&s.push(t),o%2==1&&s.push(n);const a=r.join(",");r.splice(...s);return a!==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=yY(r,t,!0),o=yY(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 bY(){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 xY={key:void 0,includeMin:!0,includeMax:!0};function wY(e){let t=e.items,n=e.collection,r=e.vc;const i={},o=[];let s,a;for(let e=0,o=t.length;e<o;e++){s=t[e].key,n[s]||(n[s]=r()),a=t[e].values||[t[e].value];for(let e=0;e<a.length;e++)n[s].add(a[e])&&(i[s]=i[s]||[],i[s].push(a[e]))}const l=Object.keys(i);for(let e=0,t=l.length;e<t;e++)s=l[e],o.push({id:s,values:i[s]});return o}function SY(e){let t=e.items,n=e.collection;const r={},i=[];let o,s;for(let e=0,i=t.length;e<i;e++)if(o=t[e].key,n[o]){s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[o].remove(s[e])&&(r[o]=r[o]||[],r[o].push(s[e]))}const a=Object.keys(r);for(let e=0,t=a.length;e<t;e++)o=a[e],i.push({id:o,values:r[o]});return i}function CY(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 EY(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 MY(e,t){const n=[],r=Object.keys(e);let i,o;const s=e=>-1===t[i].indexOf(e);for(let a=0,l=r.length;a<l;a++)i=r[a],t[i]?(o=e[i].filter(s),o.length&&n.push({id:i,values:o})):n.push({id:i,values:e[i]});return n}function kY(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?m$({},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 IY(e){return e.replace(/(-[a-z])/g,e=>e.toUpperCase().replace("-",""))}function RY(e){return e.replace(/([A-Z])/g,e=>"-".concat(e.toLowerCase()))}function _Y(e,t,n){let r=n.ranges,i=n.interceptors,o=n.rc,s=n.aliases,a=n.rangeConfig;const l=kY(i["".concat(t,"Ranges")],e,s);let c=!1;return l.forEach(e=>{const n=e.key;if(r[n]||(r[n]=o(a.sources[n]||a.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 DY(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vc,n=void 0===t?bY:t,r=e.rc,i=void 0===r?vY:r,o=!1,s={},a={},l={},c={sources:{},default:m$({},xY)};const u={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},d=()=>{const e={values:{},ranges:{}};return Object.keys(a).forEach(t=>{e.values[t]=a[t].values()}),Object.keys(s).forEach(t=>{e.ranges[t]=s[t].ranges()}),e},h={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}))}},p={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(c={sources:{},default:m$({},xY)},e.ranges.forEach(e=>{const t={};Object.keys(xY).filter(e=>"key"!==e).forEach(n=>{t[n]=void 0!==e[n]?e[n]:xY[n]}),void 0!==e.key?c.sources[e.key]=t:c.default=t}),Object.keys(s).forEach(e=>s[e].configure(c.sources[e]||c.default)),p.emit("update",[],[]))},link:e=>{if(p===e)throw new Error("Can't link to self");h.ls.push(e),e._state(d())},_state:e=>{if(!e)return d();if(e.values){const t=[];Object.keys(e.values).forEach(n=>{a[n]&&e.values[n].join(";")===a[n].toString()||t.push({key:n,values:e.values[n]})}),Object.keys(a).forEach(n=>{e.values[n]||t.push({key:n,values:[]})}),t.length&&p.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach(n=>{s[n]&&e.ranges[n].join(";")===s[n].toString()||t.push({key:n,ranges:e.ranges[n]})}),Object.keys(s).forEach(n=>{e.ranges[n]||t.push({key:n,ranges:[]})}),t.length&&p.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];p.emit("start",...t),h.start()}},end:function(){if(o){o=!1,s={},a={};for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];p.emit("end",...t),h.end()}},isActive:()=>o,clear:()=>{const e=p.brushes().filter(e=>"value"===e.type&&e.brush.values().length).map(e=>({id:e.id,values:e.brush.values()})),t=Object.keys(s).length>0||e.length;s={},a={},t&&(p.emit("update",[],e),h.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(s).map(e=>({type:"range",id:e,brush:s[e]}))),e=e.concat(Object.keys(a).map(e=>({type:"value",id:e,brush:a[e]}))),e},addValue:(e,t)=>{p.addValues([{key:e,value:t}])},addValues:e=>{const t=kY(u.addValues,e,l),r=wY({vc:n,collection:a,items:t});p.emit("add-values",t),r.length&&(o||(o=!0,p.emit("start")),p.emit("update",r,[]),h.updateValues())}};return p.setValues=e=>{const t=kY(u.setValues,e,l),r=function(e){let t=e.items,n=e.vCollection,r=e.vc;const i={},o=CY(t);let s,a=[],l=[];const c={},u=Object.keys(n);for(let e=0,t=u.length;e<t;e++)s=u[e],c[s]=n[s].values().slice(),delete n[s];const d=e=>{n[s]&&n[s].contains(e)||EY({key:s,value:e,collection:n,obj:i,fn:r})},h=Object.keys(o);for(let e=0,t=h.length;e<t;e++)s=h[e],o[s].forEach(d);return l=MY(c,i),a=MY(i,c),[a,l]}({items:t,vCollection:a,vc:n});p.emit("set-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,p.emit("start")),p.emit("update",r[0],r[1]),h.updateValues())},p.removeValue=(e,t)=>{p.removeValues([{key:e,value:t}])},p.removeValues=e=>{const t=kY(u.removeValues,e,l),n=SY({collection:a,items:t});p.emit("remove-values",t),n.length&&(p.emit("update",[],n),h.updateValues())},p.addAndRemoveValues=(e,t)=>{const r=kY(u.addValues,e,l),i=kY(u.removeValues,t,l),s=wY({vc:n,collection:a,items:r}),c=SY({collection:a,items:i});p.emit("add-values",r),p.emit("remove-values",i),(s.length||c.length)&&(o||(o=!0,p.emit("start")),p.emit("update",s,c),h.updateValues())},p.toggleValue=(e,t)=>{p.toggleValues([{key:e,value:t}])},p.toggleValues=e=>{const t=kY(u.toggleValues,e,l),r=function(e){let t=e.items,n=e.values,r=e.vc;const i={},o={},s=[],a=[],l=CY(t);let c,u,d;const h=Object.keys(l);for(let e=0,t=h.length;e<t;e++){c=h[e],d=l[c];for(let e=0,t=d.length;e<t;e++)u=d[e],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):EY({key:c,value:u,collection:n,obj:i,fn:r})}const p=Object.keys(i);for(let e=0,t=p.length;e<t;e++)c=p[e],s.push({id:c,values:i[c]});const f=Object.keys(o);for(let e=0,t=f.length;e<t;e++)c=f[e],a.push({id:c,values:o[c]});return[s,a]}({items:t,values:a,vc:n});p.emit("toggle-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,p.emit("start")),p.emit("update",r[0],r[1]),h.updateValues())},p.containsValue=(e,t)=>{let n=l[e]||e;return!!a[n]&&a[n].contains(t)},p.addRange=(e,t)=>{p.addRanges([{key:e,range:t}])},p.addRanges=e=>{_Y(e,"add",{ranges:s,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),h.updateRanges())},p.removeRange=(e,t)=>{p.removeRanges([{key:e,range:t}])},p.removeRanges=e=>{_Y(e,"remove",{ranges:s,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),h.updateRanges())},p.setRange=(e,t)=>{p.setRanges([{key:e,range:t}])},p.setRanges=e=>{_Y(e,"set",{ranges:s,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),h.updateRanges())},p.toggleRange=(e,t)=>{p.toggleRanges([{key:e,range:t}])},p.toggleRanges=e=>{_Y(e,"toggle",{ranges:s,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),h.updateRanges())},p.containsRangeValue=(e,t)=>{let n=l[e]||e;return!!s[n]&&s[n].containsValue(t)},p.containsRange=(e,t)=>{let n=l[e]||e;return!!s[n]&&s[n].containsRange(t)},p.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,s[u]?r[t].bool=Array.isArray(d)?s[u].containsRange({min:d[0],max:d[1]}):s[u].containsValue(d):a[u]&&a[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)},p.intercept=(e,t)=>{const n=IY(e);u[n]&&u[n].push(t)},p.removeInterceptor=(e,t)=>{const n=IY(e);if(!u[n])return;const r=u[n].indexOf(t);-1!==r&&u[n].splice(r,1)},p.removeAllInterceptors=e=>{const t=[];if(e){const n=IY(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:RY(e),handlers:u[e]})});t.forEach(e=>{e.handlers.slice().forEach(t=>p.removeInterceptor(e.name,t))})},p.addKeyAlias=(e,t)=>{l[e]=t},p.removeKeyAlias=e=>{delete l[e]},hY.mixin(p),p}function AY(e){return e*e*e}function PY(e){return--e*e*e+1}function LY(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}qB();const TY=["stroke","fill","color","backgroundColor","thumbColor"];function OY(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 s;for(s=0;s<r;++s)i[s]=qY(e[s],t[s]);for(;s<n;++s)o[s]=t[s];return function(e){for(s=0;s<r;++s)o[s]=i[s](e);return o}}function qY(e,t,n){const r=typeof t;let i;return null==t||"boolean"===r?function(e){return()=>e}(t):("number"===r?mU:"string"===r?(i=GG(t))&&TY.includes(n)?(t=i,dU):bU:t instanceof GG?dU:t instanceof Date?fU:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?hU:Array.isArray(t)?OY:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?NY:mU)(e,t)}function NY(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]=qY(e[i],t[i],i):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}function jY(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}const zY={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},FY=/^\$/;function WY(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function $Y(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 BY(e,t){return e.pxScale?e.pxScale(t):e}const VY={normalizeSettings:function(e,t,n){const r=m$({},e),i=m$({},t);return Object.keys(r).forEach(e=>{i[e]={};const o=r[e],s=typeof o;if("function"==typeof o)i[e].fn=o;else if(WY(o)){let n=t[e];"string"==typeof n&&FY.test(n)&&(n=zY[n]);const r=typeof n;i[e]="undefined"===r||r===s?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&&FY.test(n)?i[e]=zY[n]:i[e]=n}),i},resolveForItem:function(e,t,n){const r={},i=Object.keys(t),o=i.length,s=e.datum,a=e.datum;for(let l=0;l<o;l++){const o=i[l],c=t[o],u="object"==typeof a&&void 0!==c,d=u&&"string"==typeof c.ref,h=u&&o in a,p=d?a[c.ref]:h?a[o]:s;WY(c)?r[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),r[o]=c.fn.call(null,e,n)):u&&c.scale&&p?(r[o]=c.scale(p.value),c.scale.bandwidth&&(r[o]+=c.scale.bandwidth()/2)):d&&p?r[o]=p.value:c.fn?r[o]=c.fn.call(null,e,n):r[o]=c}return r},updateScaleSize:$Y};function HY(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((e,t)=>Array.isArray(t.children)?(e.push(...HY(t.children)),e):(e.push(t),e),[])}function GY(e,t){let n=t.context,r=t.data,i=t.style,o=t.filter,s=t.mode;const a=e.chart.brush(n),l=r,c=i.active||{},u=i.inactive||{},d=[];Object.keys(c).forEach(e=>{d.push(e)}),Object.keys(u).forEach(e=>{-1===d.indexOf(e)&&d.push(e)});const h=[];let p=!1;const f=()=>{let t=HY(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=()=>{const e=f(),t=e.length;let n,r=!1;const i="function"==typeof l?l({brush:a}):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=a.containsMappedData(n,i,s),o=h.indexOf(e[r]);let l=!1;t&&-1===o?(h.push(e[r]),l=!0):t||-1===o||(h.splice(o,1),l=!0),e[r].needToUpdate=l||p,e[r].isActive=t}for(let i=0;i<t;i++)if(n=e[i].data,n){if(e[i].needToUpdate){const t=m$({},e[i],e[i].__style),n=e[i].isActive;d.forEach(r=>{e[i][r]=n&&r in c?"function"==typeof c[r]?c[r].call(null,t,h):c[r]:!n&&r in u?"function"==typeof u[r]?u[r].call(null,t,h):u[r]:e[i].__style[r]}),r=!0}delete e[i].needToUpdate}return p=!1,r},g=function(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1}).suppressRender,n=f(),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])}));p=!0,h.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=f(),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);h.length=0,t||e.renderer.render(e.nodes)},v=()=>{if(m()){const t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return a.on("start",g),a.on("end",y),a.on("update",v),{isActive:()=>a.isActive(),update:()=>{h.length=0,p=!0,m()},cleanUp:function(){a.removeListener("start",g),a.removeListener("end",y),a.removeListener("update",v)}}}function UY(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 s={items:[],actionFn:"toggleRanges"},a={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(s.actionFn="".concat(n,"Ranges"),a.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]},s.items.push(e)):(e.value=t.value,a.items.push(e))}})}i.contexts.forEach(e=>{s.items.length?r.brush(e)[s.actionFn](s.items):r.brush(e)[a.actionFn](a.items)})}({dataPoints:o,action:n,chart:r,trigger:i})}function YY(e){let t=e.collisions,n=e.t,r=e.config,i=e.action,o=[],s=!1;t.length>0&&(o=t,s=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));const a=o.map(e=>e.node);return UY({nodes:a,action:i,chart:r.chart,data:r.data,trigger:n}),s}function KY(e,t,n){const r=n.element().getBoundingClientRect();let i=S$(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&&S$(e)?i={cx:i.x,cy:i.y,r:t.touchRadius}:t.mouseRadius>0&&!S$(e)&&(i={cx:i.x,cy:i.y,r:t.mouseRadius}),n.itemsAt(i))}function XY(e,t,n){return e?"function"==typeof e?e(t):e:n}const JY={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 ZY(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 QY(e,t,n,r){const i=n/2,o=e-r/2,s=t-r/2,a=e-i,l=t-i;return[{x:o,y:s},{x:o,y:l},{x:o+r,y:l},{x:o+r,y:s},{x:a+n,y:s},{x:a+n,y:s+r},{x:o+r,y:s+r},{x:o+r,y:l+n},{x:o,y:l+n},{x:o,y:s+r},{x:a,y:s+r},{x:a,y:s}]}function eK(e){return-e/180*Math.PI}function tK(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}}(eK(e))}function nK(e,t){return{x:e.x+t.x,y:e.y+t.y}}function rK(e,t){return{x:e.x-t.x,y:e.y-t.y}}function iK(e,t){return{x:e.x*t,y:e.y*t}}function oK(e,t){return e.x-t.x}function sK(e,t){return e.y-t.y}function aK(e,t){return oK(e,t)**2+sK(e,t)**2}function lK(e,t){return Math.sqrt(aK(e,t))}function cK(e,t){return e.x*t.x+e.y*t.y}function uK(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=rK(e,n);return nK({x:r*o.x-i*o.y,y:i*o.x+r*o.y},n)}const dK={up:0,down:180,left:90,right:-90};function hK(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 pK=qB();pK.add("circle",function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}}),pK.add("diamond",function(e){const t=e.size,n=e.x-t/2,r=e.y-t/2;return{type:"path",fill:"black",d:ZY([{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}])}}),pK.add("saltire",function(e){const t=eK(45),n=e.size/2,r=isNaN(e.width)?n/2:e.width,i=Math.min(r,n);let o=e.size;const s=Math.sin(Math.asin(-t))*(i/2);o+=2*(n/Math.sin(-t)-n),o-=2*s;const a={x:e.x,y:e.y},l=QY(e.x,e.y,o,i).map(e=>uK(e,t,a));return{type:"path",fill:"black",d:ZY(l)}}),pK.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}}),pK.add("triangle",function(e){const t=e.size,n={x:e.x,y:e.y},r=dK[e.direction]||0,i=t/2,o=e.x-i,s=e.y-i;let a=[{x:o,y:s+t},{x:o+i,y:s},{x:o+t,y:s+t},{x:o,y:s+t}];const l=eK(r);return a=a.map(e=>uK(e,l,n)),{type:"path",fill:"black",d:ZY(a)}}),pK.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:hK(e)}}),pK.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,s=isNaN(e.startAngle)?90:e.startAngle,a=360/i;for(let t=1;t<=i;t++){const i=a*t+s,l=eK(i),c=eK(i+a/2),u=Math.sin(l),d=Math.cos(l),h=Math.sin(c),p=Math.cos(c);n.push({x:e.x+d*r,y:e.y+u*r}),n.push({x:e.x+p*o,y:e.y+h*o})}return{type:"path",fill:"black",d:ZY(n)}}),pK.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 s=1;s<=r;s++){const r=eK(i*s+o),a=Math.sin(r),l=Math.cos(r);t.push({x:e.x+l*n,y:e.y+a*n})}return{type:"path",fill:"black",d:ZY(t)}}),pK.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:ZY(QY(t,n,e.size,o))}}),pK.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=eK(90);o=o.map(n=>uK(n,e,t))}const s=R$(o);return s.type="rect",s.fill="black",s}),pK.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}}),pK.add("image",function(e){const t=e.x,n=e.y,r=e.imageSettings||{},i=r.width,o=r.height,s=r.imageSrc,a=r.position;return{type:"image",x:t,y:n,width:i,height:o,src:s,symbol:r.symbol,r:10,cx:0,cy:0,imageScalingFactor:r.imageScalingFactor,imagePosition:a}});const fK=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pK;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!==JY[n]&&"transform"!==n&&(e[n]=t[n])})}(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function mK(){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,s=e.prioOrder,a=void 0===s?0:s,l=e.preferredSize,c=void 0===l?0:l,u=e.minimumLayoutMode,d=e.show,h=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?(a=e,this):"function"==typeof a?a(t):a},minimumLayoutMode(e){return void 0!==e?(u=e,this):"function"==typeof u?u(t):u},show(e){return void 0!==e?(h=e,this):"function"==typeof h?h(t):h}}}function gK(e,t,n){const r=t.require,i=void 0===r?[]:r,o=t.mediator||{},s=n.settings,a=n.formatter,l=n.scale,c=n.data,u=n.renderer,d=n.chart,h=n.dockConfig,p=n.mediator,f=n.instance,m=n.rect,g=n.style,y=n.registries,v=n.resolver,b=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:s}),Object.defineProperty(e,"data",{get:c}),Object.defineProperty(e,"formatter",{get:a}),Object.defineProperty(e,"scale",{get:l}),Object.defineProperty(e,"mediator",{get:p}),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:h}):"instance"===t?Object.defineProperty(e,"instance",{get:f}):"update"===t&&b?Object.defineProperty(e,"update",{get:b}):"resolver"===t?Object.defineProperty(e,"resolver",{get:v}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:w})}),Object.keys(o).forEach(t=>{e.mediator.on(t,o[t].bind(e))})}function yK(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 vK(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 bK(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,s=t.chart,a=t.container,l=t.mediator,c=t.registries,u=t.theme,d=t.renderer,h=hY.mixin({});let p,f,m,g,y,v=t.settings||{},b=m$(!0,{},r,v),x=[],w=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:VY,n={};return{resolve:function(r){let i=r.data,o=r.settings,s=r.defaults,a=void 0===s?{}:s,l=r.scaled;const c=n.norm=t.normalizeSettings(o,a,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:s}),S=!1;const C={nodes:[],chart:s,config:b.brush||{},renderer:null},E={tap:[],over:[]},M=[],k={},I=m$({},v);function R(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!==v[t];let s;for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return i&&("function"==typeof e[t]?s=e[t].call(k,...l):r&&(s=e[t])),o&&("function"==typeof v[t]?s=v[t].call(I,...l):r&&(s=v[t])),i||o||(s=n.call(k,...l)),s}}const _=R("preferredSize",()=>0,!0),D=R("resize",e=>e.inner),A=R("created"),P=R("beforeMount"),L=R("mounted"),T=R("beforeUnmount"),O=R("beforeUpdate"),q=R("updated"),N=R("beforeRender"),j=R("beforeDestroy"),z=R("destroyed"),F=e.render,W=()=>{b.brush&&(b.brush.consume||[]).forEach(e=>{e.context&&e.style&&M.push(GY(C,e))})},$=()=>{b.brush&&(b.brush.trigger||[]).forEach(e=>{"over"===e.on?E.over.push(e):E.tap.push(e)})};Object.defineProperty(C,"data",{get:()=>x});const B=b.renderer||e.renderer,V=B?d||c.renderer(B)():d||c.renderer()();"function"==typeof V.settings&&V.settings(b.rendererSettings),C.renderer=V;const H={resources:s.logger?{logger:s.logger()}:{}};let G=mK(yK(b,_,s.logger()),H);const U=e=>{e.key=b.key,e.element=V.element()},Y=()=>{};Y.dockConfig=()=>G,Y.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(v=e.settings,b=m$(!0,{},r,e.settings),G=mK(yK(b,_,s.logger()),H),C.config=b.brush||{}),b.scale&&(p=s.scale(b.scale)),b.data){const e=b.rendererSettings,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=SG(b.data,{dataset:s.dataset,collection:s.dataCollection},{logger:s.logger()},s.dataCollection);t?t.isFirst?(x=n,x.items&&(x.items=[...n.items])):x.items&&(x.items=[...x.items,...n.items||[]]):x=n}else x=p?p.data():[];"string"==typeof b.formatter||"object"==typeof b.formatter?f=s.formatter(b.formatter):p&&p.data().fields&&(f=p.data().fields[0].formatter()),y=u.style(b.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=D({inner:e,outer:t});g=n?V.size(n):V.size(e),I.rect=m$(!0,{computedPhysical:g.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),g=m$(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},g)},Y.getRect=()=>I.rect;const K=()=>{const e=V.renderArgs?V.renderArgs.slice(0):[],t=b.rendererSettings;let n=x;const r="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return x.items&&r&&(n=x$(x$({},x),{},{items:x.items.slice(r.start,r.end)})),e.push({data:n}),e};let X,J,Z;function Q(e){const t=b.rendererSettings,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?C.nodes=[...e||[]]:C.nodes&&(C.nodes=[...C.nodes,...e||[]]):C.nodes=e}Y.beforeMount=P,Y.beforeRender=()=>{N({size:g})},Y.render=()=>{const e=F.call(k,...K());Q(e),V.render(e),X=e,J=I.rect.computed},Y.hide=()=>{Y.unmount(),V.size({x:0,y:0,width:0,height:0}),V.clear()},Y.beforeUpdate=()=>{O({settings:b,data:x})},Y.update=()=>{Z&&Z.stop();const e=b,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(k,...K());Q(i),M.forEach(e=>e.cleanUp()),M.length=0,E.tap=[],E.over=[],n&&(W(),$()),M.forEach(e=>{e.isActive()&&e.update()}),X&&r&&("function"==typeof r.enabled?r.enabled():r.enabled)?(r.compensateForLayoutChanges&&r.compensateForLayoutChanges({currentNodes:X,currentRect:I.rect.computed,previousRect:J}),Z=function(e,t,n,r){let i,o=e.old,s=e.current,a=t.renderer,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},d={nodes:[],ips:[]},h=[],p=null;const f=n.trackBy||jY,m={start(){let e={};if(o.forEach((t,n)=>{let r=f(t,n);e[r]=t}),s.forEach((t,n)=>{let r=f(t,n);if(e[r]){if("path"===t.type&&t.points&&t.points.length>0&&"trend"!==t.data.source.key){const n=function(e,t){const n=e.points.filter(e=>!e.dummy),r=t.points.filter(e=>!e.dummy),i=r.map(e=>e.data.major.value),o=n.filter(e=>i.includes(e.data.major.value)).map(e=>e.data.major.value),s=n.filter(e=>o.includes(e.data.major.value)),a=r.filter(e=>o.includes(e.data.major.value));return{old:s,current:a}}(e[r],t);d.ips.push(NY(m$({},e[r],{points:n.old}),m$({},t,{points:n.current}))),l.push(m$({},e[r],{commonPoints:n.old}))}else d.ips.push(NY(e[r],t)),l.push(e[r]);d.nodes.push(t),e[r]=!1}else c.nodes.push(t),c.ips.push(NY(m$({},t,{r:.001,opacity:0}),t))}),Object.keys(e).forEach(t=>{e[t]&&(u.nodes.push(e[t]),u.ips.push(NY(e[t],m$({},e[t],{r:1e-4,opacity:0}))))}),h.push({name:"exiting",easing:AY,duration:200,tweens:u.ips,nodes:[...l]}),h.push({name:"updating",easing:LY,duration:400,tweens:d.ips,nodes:[]}),h.push({name:"entering",easing:PY,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"),s=o.isInit,a=o.shouldBeRemoved;!1===s?(r.setValue("animations.updatingStageMeta.shouldBeRemoved",0===i),r.setValue("animations.updatingStageMeta.isInit",!0)):r.setValue("animations.updatingStageMeta.shouldBeRemoved",a&&0===i)}h.length&&(p=a.getScene(s),h[0].started=Date.now(),"undefined"!=typeof window&&(i=window.requestAnimationFrame(m.tick)))},tick(){let e=h[0];e||m.stop(),e.started||(e.started=Date.now());let t=(Date.now()-e.started)/e.duration,o=[],s=e.tweens.map(n=>n(e.easing(Math.min(1,t))));const l=n.adjustTweenedNodes;if(l&&l(s),o.push(...s),o.push(...e.nodes),a.render(o),t>=1){h.shift();const e=r.getValue("animations.updatingStageMeta"),t=e.isInit,n=e.shouldBeRemoved;h.length?"updating"===h[0].name&&n&&h.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 p}};return m}({old:X,current:i},{renderer:V},r,s.storage),Z.start()):V.render(i),X=i,J=I.rect.computed,V.setKey&&"string"==typeof v.key&&V.setKey(v.key)},Y.updated=q,Y.destroy=()=>{Y.unmount(),j(m),V.destroy(),z(),m=null};const ee=e=>{C.nodes=e,M.forEach(e=>{e.isActive()&&e.update()}),V.render(e)};return gK(k,e,{settings:()=>b,data:()=>x,scale:()=>p,formatter:()=>f,renderer:()=>V,chart:()=>s,dockConfig:()=>G,mediator:()=>l,instance:()=>I,rect:()=>I.rect,style:()=>y,update:()=>ee,registries:()=>c,resolver:()=>w,symbol:()=>fK(c.symbol)}),gK(I,v,{settings:()=>b,data:()=>x,scale:()=>p,formatter:()=>f,renderer:()=>V,chart:()=>s,dockConfig:()=>G,mediator:()=>l,style:()=>y,_DO_NOT_USE_getInfo:o.bind(k),isVisible:()=>S}),Y.getBrushedShapes=function(e,t,n){const r=[];if(b.brush&&b.brush.consume){const i=s.brush(e),o=V.findShapes("*");b.brush.consume.filter(t=>t.context===e).forEach(e=>{for(let s=0;s<o.length;s++){const a=o[s];a.data&&i.containsMappedData(a.data,n||e.data,t)&&(U(a),r.push(a),o.splice(s,1),s--)}})}return r},Y.findShapes=e=>{var t;const n=(null!==(t=Z)&&void 0!==t&&t.inProgress()?Z.targetScene:V).findShapes(e);for(let e=0,t=n.length;e<t;e++)U(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++)U(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:[];UY({nodes:e,action:t.action||"toggle",trigger:t,chart:s,data:C.data})},Y.mount=()=>{m=V.element&&V.element()?m:V.appendTo(a),V.setKey&&"string"==typeof v.key&&V.setKey(v.key),b.brush&&(W(),$()),vK(I,h,v),vK(k,h,e),S=!0},Y.mounted=()=>L(m),Y.unmount=()=>{[I,k].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,h)}),E.tap=[],E.over=[],M.forEach(e=>{e.cleanUp()}),M.length=0,T(),S=!1},Y.onBrushTap=e=>{E.tap.forEach(t=>{(function(e){let t=e.e,n=e.t,r=e.config;return YY({collisions:KY(t,n,r.renderer),t:n,config:r,action:XY(n.action,t,"toggle")})})({e:e,t:t,config:C})&&"stop"===t.globalPropagation&&s.toggleBrushing(!0)})},Y.onBrushOver=e=>{E.over.forEach(t=>{(function(e){let t=e.e,n=e.t,r=e.config;return YY({collisions:KY(t,n,r.renderer),t:n,config:r,action:XY(n.action,t,"set")})})({e:e,t:t,config:C})&&"stop"===t.globalPropagation&&s.toggleBrushing(!0)})},Y.def=k,Y.ctx=I,Y.renderer=()=>V,Y.set({settings:v}),A(),Y}const xK=["__proto__","constructor","prototype"];function wK(e){const t=m$(!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(xK.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 SK(e,t,n){const r=nK(function(e,t){const n=cK(e,t)/cK(t,t)||1;return{x:t.x*n,y:t.y*n}}(rK(n,e),rK(t,e)),e);return r}function CK(e,t,n){return lK(e,n)+lK(t,n)-lK(e,t)<1e-12}function EK(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 MK(e){return e.x1===e.x2&&e.y1===e.y2}function kK(e){return e.width<=0||e.height<=0}function IK(e){return e.r<=0}function RK(e){return e.edges.length<=2}function _K(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=qK(e,_$(t.edges[r])),!0===n)return!0;return!1}function DK(e,t){let n=!1;const r=t.numPolygons,i=t.polygons;for(let t=0;t<r;t++){if(n=HK(e,i[t]),!0===n)return!0}return!1}function AK(e,t){if(IK(e))return!1;return aK({x:e.cx,y:e.cy},t)<=e.r**2}function PK(e,t){if(kK(t)||IK(e))return!1;const n=t.width/2,r=t.height/2,i=t.x+n,o=t.y+r,s=e.r,a=e.cx,l=e.cy,c=Math.abs(a-i),u=Math.abs(l-o);if(c>n+s||u>r+s)return!1;if(c<=n||u<=r)return!0;return(c-n)**2+(u-r)**2<=s**2}function LK(e,t){if(IK(e)||MK(t))return!1;const n=w$(k$(t),2),r=n[0],i=n[1];if(AK(e,r)||AK(e,i))return!0;const o={x:e.cx,y:e.cy},s=SK(r,i,o);return aK(s,o)<=e.r**2&&CK(r,i,s)}function TK(e,t){if(RK(t)||IK(e))return!1;if(OK(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let r=0;r<n;r++){if(LK(e,_$(t.edges[r])))return!0}return!1}function OK(e,t){if(RK(e)||!FK(e.boundingRect(),t))return!1;const n=t.x,r=t.y,i=e.vertices;let o,s,a,l,c;for(o=!1,l=-1,s=i.length,a=s-1;++l<s;a=l){if(i[l].x===n&&i[l].y===r)return!0;if(i[l].y===i[a].y&&i[l].y===r&&(n-i[l].x)*(n-i[a].x)<=0)return!0;if(i[l].y<r&&r<=i[a].y||i[a].y<r&&r<=i[l].y){if(c=(i[a].x-i[l].x)*(r-i[l].y)/(i[a].y-i[l].y)+i[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function qK(e,t){if(RK(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if($K(t,_$(e.edges[n])))return!0}const n=w$(k$(t),2),r=n[0],i=n[1];return OK(e,r)||OK(e,i)}function NK(e,t){if(RK(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(WK(t,_$(e.edges[n])))return!0}const n=w$(I$(t),4),r=n[0],i=n[1],o=n[2],s=n[3];return OK(e,r)||OK(e,i)||OK(e,o)||OK(e,s)}function jK(e,t){return!kK(e)&&!kK(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 zK(e,t){if(kK(e)||kK(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=>FK(e,t))}function FK(e,t){return!kK(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function WK(e,t){if(MK(t)||kK(e))return!1;const n=w$(k$(t),2),r=n[0],i=n[1];if(FK(e,r)||FK(e,i))return!0;const o=I$(e);let s=o.length;for(let e=0;e<s;e++){if($K(_$([o[e],o[3!==e?e+1:0]]),t))return!0}return!1}function $K(e,t){const n=w$(k$(e),2),r=n[0],i=n[1],o=w$(k$(t),2),s=o[0],a=o[1],l=oK(i,r),c=sK(i,r),u=oK(a,s),d=sK(a,s),h=oK(r,s),p=sK(r,s);let f=d*l-u*c;const m=u*p-d*h,g=l*p-c*h;let y,v;if(0===l&&0===c)return!1;if(0===u&&0===d)return!1;if(0===f){if(0===m&&0===g){if(0===l){if(0===c)return r.x===i.x&&r.y===i.y;y=sK(s,r)/c,v=sK(a,r)/c}else y=(s.x-r.x)/l,v=(a.x-r.x)/l;return!(y<0&&v<0||y>1&&v>1)}return!1}const b=m/f;return f=g/f,b>=0&&b<=1&&f>=0&&f<=1}function BK(e,t){if(MK(e))return!1;const n=w$(k$(e),2);return CK(n[0],n[1],t)}function VK(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!jK(n,r)&&(zK(n,r)?_K(e,t):_K(t,e))}function HK(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!jK(n,r)&&(zK(r,n)?function(e,t){let n=!1;const r=e.numPolygons,i=e.polygons;for(let e=0;e<r;e++)if(n=VK(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=YK(e,_$(t.edges[r])),!0===n)return!0;return!1}(e,t))}function GK(e,t){if(IK(e))return!1;if(UK(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(LK(e,_$(n.edges[t])))return!0}}return!1}function UK(e,t){if(!FK(e.boundingRect(),t))return!1;const n=t.x,r=t.y,i=e.numPolygons;let o,s,a,l,c,u,d=!1;for(s=0;s<i;s++)for(o=e.vertices[s],c=-1,a=o.length,l=a-1;++c<a;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 YK(e,t){const n=w$(k$(t),2),r=n[0],i=n[1];if(UK(e,r)||UK(e,i))return!0;const o=e.numPolygons,s=e.polygons;for(let e=0;e<o;e++){const n=s[e];for(let e=0,r=n.edges.length;e<r;e++){if($K(t,_$(n.edges[e])))return!0}}return!1}function KK(e,t){const n=w$(I$(t),4),r=n[0],i=n[1],o=n[2],s=n[3];if(UK(e,r)||UK(e,i)||UK(e,o)||UK(e,s))return!0;const a=e.numPolygons,l=e.polygons;for(let e=0;e<a;e++){const n=l[e];for(let e=0,r=n.edges.length;e<r;e++){if(WK(t,_$(n.edges[e])))return!0}}return!1}const XK=/^\$/,JK="@extend";function ZK(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function QK(e,t,n){if("string"==typeof e){let r=t[e];return-1!==n.indexOf(e)&&ZK(e),XK.test(r)?(n.push(e),QK(r,t,n)):r}let r=e;const i=m$(!0,{},t,e),o={};if(e[JK]){const o=e[JK];-1!==n.indexOf(o)&&ZK(o);let s=n.slice();s.push(o),r=m$(!0,{},QK(i[o],t,s),e)}return Object.keys(r).forEach(e=>{let t=n.slice();if(e===JK||XK.test(e))return;o[e]=r[e];let s=o[e];XK.test(s)&&s in i?(-1!==n.indexOf(s)&&ZK(s),t.push(s),s=i[s],"object"==typeof s||XK.test(s)&&s in i?o[e]=QK(s,i,t):o[e]=s):"object"==typeof s&&(o[e]=QK(s,i,t))}),o}function eX(e,t){return QK(e,t,[])}function tX(){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=>eX(e,n),setStyle:t=>{n=m$({},e,t)}};return r(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),i}function nX(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 rX(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return m$(!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 iX(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 oX(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 sX(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 aX(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 lX(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 cX(e,t,n,r,i){const o=m$({},t),s=m$({},n);sX(o,r),aX(s,r),lX(e,o,s);const a=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!!a&&(sX(t,r),aX(n,r),!0)}function uX(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 dX(e){return R$([].concat(...e.map(I$)))}function hX(e){let t=e.visible,n=e.layoutRect,r=e.reducedRect,i=e.containerRect,o=e.translation;const s=iX(r.x,r.y,r.width,r.height),a=iX(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=s.width,t.x=n.x,c.x=s.x,t.y=c.y=s.y-e.cachedSize,s.y-=e.cachedSize,s.height+=e.cachedSize;break;case"bottom":t.x=n.x,c.x=s.x,t.y=c.y=s.y+s.height,t.width=n.width,c.width=s.width,t.height=c.height=e.cachedSize,s.height+=e.cachedSize;break;case"left":t.x=c.x=a.x-e.cachedSize,t.y=n.y,c.y=a.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=a.height,a.x-=e.cachedSize,a.width+=e.cachedSize;break;case"right":t.x=c.x=a.x+a.width,t.y=n.y,c.y=a.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=a.height,a.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=dX(n.map(e=>e.outerRect)),c=dX(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 s=e?"height":"width",a=(r[s]-n[s]*i.x)*n.align;o.left=e?0:a,o.top=e?a: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=uX(c),t.edgeBleed=e.edgeBleed,t.computed=uX(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 pX(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 fX(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 mX(e){let t=rX(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),nX(r),nX(n),{logicalContainerRect:r,containerRect:n}}(e,t),i=r.logicalContainerRect,o=r.containerRect,s=function(e,t,n){const r=[],i=[];for(let o=0;o<e.length;++o){const s=e[o];fX(s);let a=s.dockConfig;const l=s.key,c=a.dock(),u=/@/.test(c)?c.split(",").map(e=>e.replace(/^\s*@/,"")):[];pX(t,a,n)?r.push({comp:s,key:l,config:a,referencedDocks:u}):i.push({comp:s,key:l,config:a,referencedDocks:u})}return[r,i]}(n,t,i),a=w$(s,2),l=a[0],c=a[1],u=function(e){let t=e.layoutRect,n=e.visible,r=e.hidden,i=e.settings;const o=iX(t.x,t.y,t.width,t.height),s={left:0,right:0,top:0,bottom:0},a=n.slice();a.sort((e,t)=>e.config.prioOrder()-t.config.prioOrder());for(let e=0;e<a.length;++e){const n=a[e];oX(n,o,t),cX(t,o,s,n,i)||(r.push(a.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!==a.indexOf(e));return n.length=0,n.push(...l),lX(t,o,s),o}({layoutRect:i,visible:l,hidden:c,settings:t}),d=hX({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=iX();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=rX(e)},n}const gX=(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},yX=e=>null==e?void 0:e.map(e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(x$(x$({},n),{},{children:yX(e.children)}))}}),vX=(e,t)=>({visible:[],hidden:t,ordered:[]}),bX=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(x$(x$({},t),{},{children:yX(e.children)}))}}),o=e=>n[e.index],s=null!==(r=e(t,i))&&void 0!==r?r:{},a=s.visible,l=void 0===a?i:a,c=s.hidden,u=void 0===c?[]:c,d=s.ordered,h=void 0===d?l:d;return{visible:l.map(o),hidden:u.map(o),ordered:h.map(o)}},xX=e=>"function"==typeof e?bX(e):(e=>{const t=mX(e);return bX((e,n)=>t.layout(e,n))})(e);function wX(e,t,n){const r=t.left-n.left,i=t.top-n.top,o=D$(e),s=m$(!0,{},e);switch(o){case"circle":s.cx+=r,s.cy+=i;break;case"polygon":for(let e=0,t=s.vertices.length;e<t;e++){const t=s.vertices[e];t.x+=r,t.y+=i}break;case"geopolygon":for(let e=0;e<s.vertices.length;e++){const t=s.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":s.x1+=r,s.y1+=i,s.x2+=r,s.y2+=i;break;case"point":case"rect":s.x+=r,s.y+=i}return s}function SX(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 CX(e,t){let n=e.element,r=e.data,i=void 0===r?[]:r,o=e.settings,s=void 0===o?{}:o,a=e.on,l=void 0===a?{}:a;const c=t.registries,u=t.logger,d=tX(t.style,t.palettes),h=[],p=m$({},e),f=function(){const e={};return hY.mixin(e),e}();let m=[],g=null,y=null,v=null,b=[],x=()=>{},w=()=>{};const S={};let C=!1;const E=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},s=e=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)},a=(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&&a(r.children,i.components):(e.splice(n,1),s(r),r.children&&a(r.children,[]),r.instance.destroy())}},l=e=>{let t=e.compList,n=e.data,r=e.excludeFromUpdate,i=e.formatters,s=e.scales;return e.settingsList.map(e=>{const a=gX(t,e.key);return r.indexOf(e.key)>-1?(delete a.updateWith,a):a?(e.rendererSettings&&"function"==typeof a.instance.renderer().settings&&a.instance.renderer().settings(e.rendererSettings),e.rendererSettings&&"function"==typeof e.rendererSettings.transform&&e.rendererSettings.transform()?(a.applyTransform=!0,a):(a.updateWith={formatters:i,scales:s,data:n,settings:e},e.components&&(a.children=l({compList:a.children||[],data:n,excludeFromUpdate:r,formatters:i,scales:s,settingsList:e.components})),a)):o(e)}).filter(e=>!!e)},c=e=>{let t=e.components,n=e.hidden,r=e.layoutFn,i=e.ordered,o=e.rect,s=e.visible;const a=r(o,t),l=a.visible,u=a.hidden,d=a.ordered;s.push(...l),n.push(...u),i.push(...d),l.forEach(e=>{if(e.children){var t,r;const o=xX(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:s})}}),u.forEach(e=>{e.children&&c({components:e.children,hidden:n,layoutFn:vX,ordered:i,rect:null,visible:s})})};return n.destroy=()=>{r.forEach(e=>e.instance.destroy()),r=[],i=[]},n.findComponentByKey=e=>gX(r,e),n.forEach=e=>{r.forEach(e)},n.layout=e=>{let t=e.layoutSettings,n=e.rect;const r=[],o=[],s=[],a=xX(t);return c({components:i,hidden:o,layoutFn:a,ordered:s,rect:n,visible:r}),{visible:r,hidden:o,ordered:s}},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,s=e.scales;a(i,t),i=l({compList:i,data:n,excludeFromUpdate:r,formatters:o,scales:s,settingsList:t})},n}({createComponent:e=>{if(!c.component.has(e.type))return u.warn("Unknown component: ".concat(e.type)),!1;return{instance:bK(c.component(e.type),{settings:e,chart:p,mediator:f,registries:c,theme:d,container:n}),settings:m$(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function M(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,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];return i=r?e[t].call(p,...s):n.call(p,...s),i}}const k=()=>{let e;s.dockLayout?(u.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=s.dockLayout):e=s.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 E.layout({layoutSettings:e,rect:t})},I=M("created"),R=M("beforeMount"),_=M("mounted"),D=M("beforeUpdate"),A=M("updated"),P=M("beforeRender"),L=M("beforeDestroy"),T=M("destroyed"),O=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,s=void 0===o?{}:o,a=t.scroll,l=void 0===a?{}:a;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 s=o({key:n,data:e.data,config:e.config});i[n]=s}}),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]:SG;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=m$(r,{fields:e}))}return r}}(t.collections,{dataset:x},{logger:u});const h={theme:d,logger:u};g=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:lY;const i={};return{get(o){let s;return"string"==typeof o&&e[o]?s=o:"object"==typeof o&&"scale"in o&&e[o.scale]&&(s=o.scale),s?(i[s]=i[s]||r(e[s],t,n),i[s]):r(o,t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(s,{dataset:x,collection:w},x$(x$({},h),{},{scale:c.scale})),y=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:CG;const i={};return{get(o){let s;return"string"==typeof o&&e[o]?s=o:"object"==typeof o&&"formatter"in o&&e[o.formatter]?s=o.formatter:"object"==typeof o&&"type"in o&&e[o.type]&&(s=o.type),s?(i[s]=i[s]||r(e[s],t,n),i[s]):r(o||{},t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(i,{dataset:x,collection:w},x$(x$({},h),{},{formatter:c.formatter})),v=function(e,t){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=fY(e[r],t?t[r]:null));return n}(l,v)};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);b.forEach(e=>{e.key&&-1!==r.indexOf(e.key)?t[e.key]=e:e.destroy()}),b=e.map(e=>{const r=e.key&&t[e.key]?t[e.key]:c.interaction(e.type)(p,f,n);return r.set(e),r})}const N=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},s=[];return m.forEach(e=>{const t=e.instance.getRect();FK(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)&&s.push(e)}),s},j=()=>{if(h.length||!n)return;Object.keys(l).forEach(e=>{const t=l[e].bind(p);n.addEventListener(e,t),h.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=N(e)},r=t=>{const n=e.comps||N(t);if(!n.every(e=>e.instance.def.disableTriggers)&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=S$(e),r=n?e.changedTouches[0]:e,i=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(r.clientX-t.x),s=isNaN(t.y)?0:Math.abs(r.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&s<=12&&i<=300}(t,e)))for(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),C){C=!1;break}}},i=[];i.push({key:"mousedown",listener:t}),i.push({key:"mouseup",listener:r}),function(e){return"ontouchstart"in e&&"ontouchend"in e||navigator.maxTouchPoints>1}(n)&&(i.push({key:"touchstart",listener:t}),i.push({key:"touchend",listener:r})),i.push({key:"mousemove",listener:e=>{const t=N(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),C){C=!1;break}}}}),i.forEach(e=>{n.addEventListener(e.key,e.listener),h.push(e)})},z=()=>{h.forEach(e=>{let t=e.key,r=e.listener;return n.removeEventListener(t,r)}),h.length=0},F=()=>{n.innerHTML="",(()=>{const e=s.components,t=void 0===e?[]:e;P(),O(i,s),E.set({components:t});const r=k(),o=r.visible,a=r.hidden,l=r.ordered;m=o,a.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}),SX(n,l)})(),j(),q(s.interactions)};return p.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&&(s=e.settings,q(e.settings.interactions)),D(),O(i,s);const r=s,o=r.formatters,a=r.scales,l=r.components,c=void 0===l?[]:l;E.update({components:c,data:i,excludeFromUpdate:n,formatters:o,scales:a}),E.forEach(e=>{e.updateWith&&e.instance.set(e.updateWith)}),E.forEach(e=>{e.updateWith&&e.instance.beforeUpdate()}),k()},p.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 a;e.data&&(i=e.data),e.settings&&(s=e.settings,q(e.settings.interactions)),D(),O(i,s,{partialData:t});const l=s,c=l.formatters,u=l.scales,d=l.components,h=void 0===d?[]:d;E.update({components:h,data:i,excludeFromUpdate:o,formatters:c,scales:u}),E.forEach(e=>{e.updateWith&&e.instance.set(e.updateWith)}),E.forEach(e=>{e.updateWith&&e.instance.beforeUpdate()});const p=[],f=[];let g;if(t)E.forEach(e=>{(e.updateWith||e.applyTransform)&&e.visible&&p.push(e)}),g=p;else{const e=k(),t=e.visible,n=e.hidden,r=e.ordered;m=t,g=t,a=r,t.forEach(e=>{e.updateWith&&e.visible?p.push(e):f.push(e)}),n.forEach(e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1})}f.forEach(e=>e.instance.beforeMount()),f.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||SX(n,a),f.forEach(e=>e.instance.mounted()),p.forEach(e=>e.instance.updated()),m.forEach(e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1}),A()},p.destroy=()=>{L(),E.destroy(),z(),q(),delete p.update,delete p.destroy,T()},p.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},p.findShapes=e=>{let t=[];return m.forEach(n=>{const r=n.instance.findShapes(e);t=[...t,...r]}),t},p.componentsFromPoint=e=>N(e).map(e=>e.instance.ctx),p.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 s=o[n],a=wX(e,i,s.instance.renderer().element().getBoundingClientRect()),l=s.instance.shapesAt(a,s.opts),c=l.length>0&&"stop"===t.propagation;if(r=[...r,...l],r.length>0&&c)return r}return r},p.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])})}},p.scroll=function(){return function(e,t){return t[e]||(t[e]=pY()),t[e]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",v)},p.dataset=e=>x(e),p.dataCollection=e=>w(e),p.scales=function(){return g.all()},p.formatters=function(){return y.all()},p.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return S[e]||(S[e]=DY()),S[e]},p.scale=function(e){return g.get(e)},p.formatter=function(e){return y.get(e)},p.toggleBrushing=function(e){C=void 0!==e?e:!C},p.component=e=>{const t=E.findComponentByKey(e);return null==t?void 0:t.instance.ctx},p.logger=()=>u,p.theme=()=>d,p.storage=wK({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(p,"interactions",{get:()=>({instances:b,on(){j(),b.forEach(e=>e.on())},off(){z(),b.forEach(e=>e.off())}})}),I(),n&&(R(),F(),_(n),p.element=n),p}const EX=e=>{let t=qB(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var MX=qB();function kX(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 IX=e=>e.filter(e=>"number"==typeof e&&!isNaN(e));const RX=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 s=",";if(n&&n.parse&&n.parse.delimiter)s=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){s=n;break}}else n.test(i)&&(s=n)}}return r.map(e=>e.split(s))})({data:n,config:i})),Array.isArray(o)&&function(e){let t,n=e.source,r=e.data,i=e.cache,o=e.config,s=r;const a=o&&o.parse;Array.isArray(r[0])?a&&!1===a.headers?t=r[0].map((e,t)=>t):(t=r[0],s=r.slice(1)):t=Object.keys(r[0]);const l=!!a&&"function"==typeof a.row&&a.row;let c,u=t;u=a&&"function"==typeof a.fields?a.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<s.length;e++){const t=l?l(s[e],e,u):s[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=IX(t),o=r.length>0,s=o?"measure":"dimension",a=o?Math.min(...r):NaN,l=o?Math.max(...r):NaN;i.fields.push(lG(m$({source:n,key:e,title:u[e].title,values:t,min:a,max:l,type:s},u[e]),{value:u[e].value,label:u[e].label}))}}({data:o,cache:r,source:t,config:i})};function _X(){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=pG(e,t),s=o.props,a=o.main,l=Object.keys(s),c=!!e.trackBy,u=typeof e.trackBy,d={},h=[],p=n.items(),f=[];for(let t=0;t<p.length;t++){const n=p[t];if(a.filter&&!a.filter(n))continue;const r=kX(a,n,{key:i});l.forEach(e=>{const o=s[e];let a=o.field?o.field.items()[t]:n;r[e]=kX(o,a,{key:i})}),c&&gG({cfg:e,itemData:n,obj:r,target:h,tracker:d,trackType:u}),f.push(r)}r=c?[...r,...mG(h,{main:a,propsArr:l,props:s})]:[...r,...f]}}),r}(e,o),hierarchy:()=>null};return RX({key:t,data:n,config:r,cache:i}),o}_X.util={normalizeConfig:pG,collect:mG,track:gG};const DX=qB();DX.default("matrix"),DX("matrix",_X),DX("default",_X);const AX=qB();function PX(e,t,n){return Math.max(e,Math.min(t,n))}function LX(e){let t=e.item,n=e.value,r=e.boxCenter,i=e.rendWidth,o=e.rendHeight,s="x",a="y",l=i,c=o,u=n<.5?90:-90;return e.flipXY&&(s="y",a="x",l=o,c=i,u=n<.5?180:0),(0,e.symbol)(m$({},t.oob,{[s]:r*l,[a]:Math.max(t.oob.size/2,Math.min(n*c,c-t.oob.size/2)),startAngle:u}))}function TX(e){let t=e.item,n=e.boxWidth,r=e.boxPadding,i=e.rendWidth,o=e.rendHeight,s="x",a="y",l="width",c="height",u=i,d=o;e.flipXY&&(s="y",a="x",l="height",c="width",u=o,d=i);const h=function(e){let t=e.start,n=e.end,r=e.minPx,i=void 0===r?.1:r,o=e.maxPx,s=void 0===o?1:o;const a=Math.max(t,n),l=Math.min(t,n),c=PX(-.1,1.2,a),u=PX(-.1,1.2,l),d=c*s-u*s,h=Math.max(i,d),p=(h-d)/2;return{actualDiff:h,startModifier:p,actualLow:u*s-p}}({start:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:d}),p=h.actualDiff,f=h.actualLow;return m$({},t.box,{type:"rect",[s]:(r+t.major)*u,[a]:f,[c]:p,[l]:n*u,data:t.data||{},collider:{type:null}})}function OX(e){let t=e.item,n=e.from,r=e.to,i=e.boxCenter,o=e.rendWidth,s=e.rendHeight,a="x1",l="y1",c="x2",u="y2",d=o,h=s;return e.flipXY&&(a="y1",l="x1",c="y2",u="x2",d=s,h=o),m$({},t.line,{type:"line",[u]:Math.floor(n*h),[a]:i*d,[l]:Math.floor(r*h),[c]:i*d,data:t.data||{},collider:{type:null}})}function qX(e){let t=e.item,n=e.key,r=e.position,i=e.width,o=e.boxCenter,s=e.rendWidth,a=e.rendHeight,l="x1",c="y1",u="x2",d="y2",h=s,p=a;e.flipXY&&(l="y1",c="x1",u="y2",d="x2",h=a,p=s);const f=i/2;return m$({type:"line"},t[n],{[c]:Math.floor(r*p),[l]:(o-f)*h,[d]:Math.floor(r*p),[u]:(o+f)*h,r:f*h,cx:o*h,cy:r*p,width:i*h,data:t.data||{},collider:{type:null}})}function NX(e,t,n){const r=t.box,i=r.width,o=r.maxWidthPx,s=r.minWidthPx,a=e>=0?1:-1;let l=Math.min(a*e*i,isNaN(o)?n:o/n);return l=isNaN(s)?l:Math.max(s/n,l),l*a}AX("native",function(e,t,n){let r,i,o={chart:e,mediator:t,element:n},s=[],a=!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),s.push({key:e,listener:t})})}function c(){s.forEach(e=>{let t=e.key,r=e.listener;n.removeEventListener(t,r)}),s=[]}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(),a&&l()},off(){a=!1,c()},on(){a=!0,0===s.length&&l()},destroy(){c(),o=null,r=null}}});const jX={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}},zX=Object.keys(jX),FX={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,s=this.style,a=this.resolver,l=this.symbol,c=zX.filter(e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show),u={};c.forEach(e=>u[e]=jX[e]);const d=function(e){let t=e.keys,n=e.data,r=e.defaultSettings,i=e.style,o=e.settings,s=e.width,a=e.height,l=e.resolver;const c=m$(!0,{},r||{},i||{}),u={major:"horizontal"===o.orientation?a:s,minor:"horizontal"===o.orientation?s:a},d=o.major;let h;h="object"==typeof d&&"object"==typeof d.ref&&void 0!==d.ref.start&&void 0!==d.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:m$(!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:m$(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:u,defaults:{major:.5},settings:{major:o.major}});const p=o.minor||{},f={};["start","end","min","max","med"].forEach(e=>{(p[e]||n.items&&n.items.length&&n.items[0][e])&&(f[e]={scale:p.scale,ref:e})});let m,g={major:h,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:m$(!0,{},f,p)})};for(let e=0,r=t.length;e<r;e++)o[m]&&!1===o[m].show||(m=t[e],g[m]=l.resolve({data:n,defaults:c[m],settings:o[m],scaled:u}));return g}({keys:c,data:t,defaultSettings:u,style:s,settings:this.settings.settings,width:r,height:i,resolver:a});d.settings,d.items;const h=function(e){let t=e.width,n=e.height,r=e.flipXY,i=e.resolved,o=e.keys,s=e.symbol;const a=[],l=i.major.items;if(!l.length)return a;const c=t,u=n,d=r?n:t,h=i.major.settings,p=["start","end","min","max","med"].filter(e=>void 0!==i.minor.settings[e]),f=p.length,m=o.filter(e=>"oob"!==e);let g,y,v,b,x,w,S,C,E;const M=o?o.length:0,k=m?m.length:0;function I(){S?g.push(LX({item:v,value:0,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:s})):C&&g.push(LX({item:v,value:1,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r,symbol:s}))}const R={box:function(){v.box&&C$(v.start)&&C$(v.end)&&g.push(TX({item:v,boxWidth:b,boxPadding:x,rendWidth:c,rendHeight:u,flipXY:r}))},line:function(){C$(v.min)&&C$(v.start)&&g.push(OX({item:v,from:v.min,to:v.start,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),C$(v.max)&&C$(v.end)&&g.push(OX({item:v,from:v.max,to:v.end,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},median:function(){v.median&&C$(v.med)&&g.push(qX({item:v,key:"median",position:v.med,width:b,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))},whisker:function(){if(v.whisker){const e=b*v.whisker.width;C$(v.min)&&g.push(qX({item:v,key:"whisker",position:v.min,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r})),C$(v.max)&&g.push(qX({item:v,key:"whisker",position:v.max,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:r}))}}};function _(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let r=0;r<f;r++)e=v[p[r]],C$(e)&&(t<e&&(t=e),n>e&&(n=e));S=t<0&&t!==-Number.MAX_VALUE,C=n>1&&n!==Number.MAX_VALUE,E=S||C}for(let e=0,t=l.length;e<t;e++){g=[],y=null;const t=l[e],n=t.data;let r=null,s=null;void 0!==h.binStart?(r=t.binStart,s=t.binEnd,y=h.binStart.scale):(y=h.major.scale,r=y?t.major:0);let c=0;y?y.bandwidth?(c=y.bandwidth(),r-=c/2):c=s-r:c=1,v=m$({},{major:r,majorEnd:s},i.minor.items[e]);for(let t=0;t<M;t++)v[o[t]]=i[o[t]].items[e];if(b=NX(c,v,d),x=(c-b)/2,w=x+v.major+b/2,_(),E)v.oob&&I();else for(let e=0;e<k;e++)v[m[e]]&&!1===v[m[e]].show||R[m[e]]();const u={type:"container",data:n,collider:{type:"bounds"},children:g};a.push(u)}return a}({width:r,height:i,flipXY:o,resolved:d,keys:c,symbol:l});return h}};const WX={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},$X=/px$/,BX={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},VX={imageSrc:void 0,imageScalingFactor:void 0,position:"center-center",symbol:"rectangle",width:void 0,height:void 0},HX={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function GX(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 UX(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,s=$X.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);E$(s)&&(t=WX,s=n.min+t.size*(n.max-n.min));const a=function(e){let t=BX.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=w$(a,2),c=l[0],u=x$(x$({},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,s)),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 YX={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:m$({},BX,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,s=m$({},HX,this.settings.settings.sizeLimits),a=n.items;a.length>0&&"image"===a[0].shape&&t.items.forEach((e,t)=>{a[t].imageSettings=m$({},VX,this.settings.settings.imageSettings)});const l=function(e,t,n,r,i){const o=GX(e?e.scale:void 0,n),s=GX(t?t.scale:void 0,r);let a=Math.min(o.value*i[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],s.value*i[s.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*i[o.isBandwidth?"minRelDiscrete":"minRelExtent"],s.value*i[s.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(a)),maxGlobal:i.maxPx,minGlobal:i.minPx}}(n.settings.x,n.settings.y,i,o,s);return UX(a,this.rect,l,this.settings.shapeFn||this.symbol)}};const KX={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function XX(e,t,n,r){let i=t.x,o=t.y,s=t.width,a=t.height;const l=iB(),c={x:i+s/2,y:o+a/2},u=Math.min(s,a)/2,d=Math.min(s,a)/2,h=d/100;return e.map((e,t)=>{const i=n[t];i.type="path";const o=d*i.outerRadius,s=u*i.innerRadius,a=h*i.cornerRadius;l.innerRadius(s),l.outerRadius(o),l.cornerRadius(a),i.arcDatum=e;const p=l.centroid(e),f=i.offset?function(e,t,n,r){let i=w$(e,2),o=i[0],s=i[1];const a=Math.sqrt(o*o+s*s);o/=a,s/=a;const l=n-r;return{x:o*t*l,y:s*t*l}}(p,i.offset,o,s):{x:0,y:0};return i.transform="translate(".concat(f.x,", ").concat(f.y,") translate(").concat(c.x,", ").concat(c.y,")"),i.desc={share:e.value/r,slice:{start:e.startAngle,end:e.endAngle,innerRadius:s,outerRadius:o,cornerRadius:a,offset:{x:c.x+f.x,y:c.y+f.y}}},i})}function JX(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const ZX={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:m$({},KX,this.style.slice),settings:i.slice}).items;let s=0;for(let e=0,t=o.length;e<t;e++){const t=JX(i,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),r.push(o[e]),s+=t)}const a=function(){var e=hB,t=dB,n=null,r=P$(0),i=P$(B$),o=P$(0);function s(s){var a,l,c,u,d,h=(s=oB(s)).length,p=0,f=new Array(h),m=new Array(h),g=+r.apply(this,arguments),y=Math.min(B$,Math.max(-B$,i.apply(this,arguments)-g)),v=Math.min(Math.abs(y)/h,o.apply(this,arguments)),b=v*(y<0?-1:1);for(a=0;a<h;++a)(d=m[f[a]=a]=+e(s[a],a,s))>0&&(p+=d);for(null!=t?f.sort(function(e,n){return t(m[e],m[n])}):null!=n&&f.sort(function(e,t){return n(s[e],s[t])}),a=0,c=p?(y-h*b)/p:0;a<h;++a,g=u)l=f[a],u=g+((d=m[l])>0?d*c:0)+b,m[l]={data:s[l],index:a,value:d,startAngle:g,endAngle:u,padAngle:v};return m}return s.value=function(t){return arguments.length?(e="function"==typeof t?t:P$(+t),s):e},s.sortValues=function(e){return arguments.length?(t=e,n=null,s):t},s.sort=function(e){return arguments.length?(n=e,t=null,s):n},s.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:P$(+e),s):r},s.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:P$(+e),s):i},s.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:P$(+e),s):o},s}().sortValues(null);a.startAngle(i.startAngle),a.endAngle(i.endAngle),a.padAngle(i.padAngle);return XX(a(n),m$({},this.rect,{x:0,y:0}),r,s)}};const QX=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 eJ{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[eJ.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 s=eJ.evaluateKey(o,n),a=this.transposeCoordinate(s,e[o],n);t[s]=a}}return r&&QX(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 tJ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new eJ(...t)}function nJ(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const rJ={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=tJ(),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,$Y(this,"x",this.rect.width),$Y(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=m$({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=m$({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=nJ(this.x,this.rect.width),this.lines.y=nJ(this.y,this.rect.height),this.lines.y=this.lines.y.map(e=>m$(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 iJ(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 oJ(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 sJ(e,t,n){return e<t||e>n}function aJ(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 lJ(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 cJ(e){var t,n;let r=e.chart,i=e.blueprint,o=e.renderer,s=e.p,a=e.settings,l=e.items,c=e.slopeLine,u=!0,d=!1,h=!1,p=!1,f=!1,m=m$(!0,{},a.style.line,s.line||{}),g=m$(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},a.style.label||{},{fill: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:s.valueInfo?s.valueInfo.id:s.value}):i.processItem({type:"line",x1:s.position,y1:0,x2:s.position,y2:1,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:s.flipXY||!1,value:s.valueInfo?s.valueInfo.id:s.value}),s.label&&!1!==s.label.show&&(null==c||!c.slope||0===c.slope)){const e=m$(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},a.style.label||{},{fill:m.stroke},s.label);let t,n={width:0,height:0},c="";t=aJ(s,r),!1!==s.label.showValue&&(t?c=" (".concat(t(s.value),")"):s.scale&&(c=" (".concat(s.value,")"))),c&&(n=o.measureText({text:c,fontFamily:e.fontFamily,fontSize:e.fontSize}));let d=o.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),g={width:d.width+n.width,height:Math.max(d.height,n.height)},y=e.padding,v=lJ(s.flipXY?e.vAlign:e.align),b=lJ(s.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=s.flipXY?w:x,C=s.flipXY?x:w;if(h=i.processItem({fn:t=>{let n=t.width,r=t.height,o=s.position*n-(s.flipXY?w:x)*(1-v);o=s.flipXY?o:Math.max(o,0);return{type:"rect",x:o,y:Math.max(Math.abs(b*r-C*b),0),width:s.flipXY?S:Math.min(S,i.width-o),height:C,stroke:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.background.opacity}},flipXY:s.flipXY||!1}),h.x<-1||h.x+h.width>i.width+1||h.y<-1||h.y+h.height>i.height+1)h=void 0;else{p={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:h.x+y,y:h.y+h.height/2+g.height/3,maxWidth:h.width-2*y-n.width,anchor:"start"},c&&(f={type:"text",text:c||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:p.x+3+(h.width-(n.width+2*y)),y:p.y});for(let e=0,t=l.length;e<t;e++){let t=l[e];"rect"===t.type?jK(h,t)&&(u=!1):"line"===t.type&&s.flipXY===t.flipXY&&WK(h,t)&&(u=!1)}}}if(d&&l.push(d),c&&0!==c.slope&&(!1!==(null===(t=c.label)||void 0===t?void 0:t.show)||!1!==(null===(n=c.label)||void 0===n?void 0:n.showValue))){var y,v,b;let e,t;const n=120;let a=!1!==(null===(y=c.label)||void 0===y?void 0:y.show)?null===(v=c.label)||void 0===v?void 0:v.text:"";if(!1!==(null===(b=c.label)||void 0===b?void 0:b.showValue)){var x;const t=aJ(s,r),n=t?t(c.value):c.value;e="(".concat(c.slope,"x + ").concat(n,")"),a+=null!==(x=c.label)&&void 0!==x&&x.text?" ".concat(e):e}if(a.length>1){var w,S,C;const e=o.measureText({text:a,fontFamily:g.fontFamily,fontSize:g.fontSize});e.width=e.width>n?n:e.width;const s=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===s||c.isRtl?g.padding:3*g.padding,h=void 0!==s||c.slope>0?3*g.padding:g.padding,p=function(e,t,n,r,i,o){let s=0;if(void 0!==n){if(n<.8)return s=e.slope<0||e.isRtl?3*o.padding:2*o.padding,e.isRtl,n*i.width+s;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,s,e,i,g),f=Math.min(d.y1,d.y2);null!==(w=c.label)&&void 0!==w&&w.stroke&&(t={type:"rect",x:c.isRtl?Math.max(p,u)-2:Math.max(p,u)+2,y:Math.abs(Math.max(f,h)-e.height),rx:3,ry:3,width:e.width+g.padding,height:e.height-2,stroke:m.stroke,fill:m.stroke});const y={type:"text",text:a,fill:null!==(S=null===(C=c.label)||void 0===C?void 0:C.stroke)&&void 0!==S?S:m.stroke,opacity:g.opacity,fontFamily:g.fontFamily,fontSize:g.fontSize,x:t?t.x+2:Math.max(p,u)+2,y:t?t.y+e.height-g.padding:Math.abs(Math.max(f,h)-g.padding/2),anchor:"start",title:a,maxWidth:n,width:e.width};(function(e,t,n,r,i){for(let o=0,s=e.length;o<s;o++){const s=e[o];if("text"===(null==s?void 0:s.type)&&Math.abs(s.x-t.x)<Math.max(s.width+r,t.width+r)&&Math.abs(s.y-t.y)<n.height+i)return!0}return!1})(l,y,e,u,h)||(t&&l.push(t),l.push(y))}}u&&h&&p&&(l.push(h,p),f&&l.push(f))}function uJ(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function dJ(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function hJ(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 pJ(e,t){return e&&t&&Math.abs(e.x-t.x)<1e-15&&Math.abs(e.y-t.y)<1e-15}const fJ={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=tJ(),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(dJ).map(e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=hJ(t,e.value);return m$(e,{scale:t,position:n})}return m$(e,{position:e.value})}),this.lines.y=this.lines.y.filter(dJ).map(e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=hJ(t,e.value);return m$(e,{scale:t,position:n,flipXY:!0})}return m$(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(uJ(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(uJ(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(),s=e.max(),a=n.min(),l=n.max();i=x$(x$({},r),{},{x1:void 0,y1:void 0,x2:void 0,y2:void 0});const c=o*r.slope+r.value,u=s*r.slope+r.value,d=(a-r.value)/r.slope,h=(l-r.value)/r.slope;let p=[];sJ(c,a,l)||(p[0]={x:hJ(e,o),y:hJ(n,c)}),sJ(d,o,s)||(p[1]={x:hJ(e,d),y:1}),sJ(u,a,l)||(p[2]={x:hJ(e,s),y:hJ(n,u)}),sJ(h,o,s)||(p[3]={x:hJ(e,h),y:0});const f=p.filter(e=>!!e).length;if(f>2&&function(e){pJ(e[0],e[1])&&(e[1]=void 0),pJ(e[1],e[2])&&(e[2]=void 0),pJ(e[2],e[3])&&(e[3]=void 0),pJ(e[3],e[0])&&(e[3]=void 0)}(p),p=p.filter(e=>!!e),p.length<2)return void t["y".concat(c>l?0:1)].push(uJ(r));i.x1=p[0].x,i.y1=p[0].y,i.x2=p[1].x,i.y2=p[1].y}else i=void 0;cJ({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 s=r.style.oob||{};for(let e=0,r=o.length;e<r;e++){const r=o[e],a=n[r];if(a.length>0){let e=r.charAt(1),n="y"===r.charAt(0),o=s.padding.x+s.width,l=s.padding.y+s.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"===s.type?{type:"path",d:iJ(n?d:u,n?u:d,s.width,c),x:u,y:d,stroke:s.stroke,fill:s.fill,strokeWidth:s.strokeWidth||0}:{type:"circle",cx:u,cy:d,r:s.width,stroke:s.stroke,fill:s.fill,strokeWidth:s.strokeWidth||0,opacity:s.opacity,data:a}},flipXY:n}),d=u.cx||u.x,h=u.cy||u.y;const p=a.map(e=>e.label?"".concat(e.label," (").concat(e.value,")"):"(".concat(e.value,")")),f=p.reduce((e,t,n)=>0===n?t:"".concat(e,"\n\n").concat(t),"");let m={type:"text",text:a.length||"",title:f,x:d-.4*s.width,y:h+.4*s.width,fontFamily:s.text.fontFamily,fontSize:"".concat(1.3*s.width,"px"),stroke:s.text.stroke,fill:s.text.fill,strokeWidth:s.text.strokeWidth||0,opacity:s.text.opacity},g={type:"path",d:oJ(d,h,s.width,c),x:d,y:h,stroke:s.triangle.stroke,fill:s.triangle.fill,strokeWidth:s.triangle.strokeWidth||0,opacity:s.triangle.opacity};i.push(u,m,g)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function mJ(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){m$(e,t.style)}(t,e),t}function gJ(e){return"string"==typeof e||"number"==typeof e?e:"-"}function yJ(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,s="end"===t.anchor&&r<0,a="start"===t.anchor&&r>=0,l=t.boundingRect.y+(a||s?t.boundingRect.height:0),c=[{x:t.x-i,y:l},{x:t.x+i,y:l}].map(e=>uK(e,r,{x:t.x,y:t.y})),u={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},d={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},h=r>=0?[u,d]:[d,u];c.push(...h),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const r=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:r,y:0,width:r<0?n.stepSize+r:n.stepSize,height:n.innerRect.height}}else{const r=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:r,width:n.innerRect.width,height:r<0?n.stepSize+r:n.stepSize}}const r=t.collider;r.x=Math.max(r.x,0),r.y=Math.max(r.y,0);const i=r.x+r.width-(n.outerRect.x+n.outerRect.width);r.width=i>0?r.width-i:r.width;const o=r.y+r.height-(n.outerRect.y+n.outerRect.height);r.height=o>0?r.height-o:r.height}(e,t,n)}function vJ(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 bJ(e,t){var n,r;const i={type:"text",text:gJ(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)+vJ(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)+vJ(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,s=e.x+i;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):s>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,s=e.y+i;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):s>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),yJ(e,i,t),i}function xJ(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){m$(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 wJ(e){return!e.isMinor&&e.position>=0&&e.position<=1}function SJ(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,s=t.map(e=>e.label).map(e=>"".concat(e.slice(0,1)).concat(e.length>1?"…":"")).map(n).map(e=>e.width);for(let e=0;e<t.length;++e){const n=t[e];if(i*o*Math.abs(n.start-n.end)<s[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 CJ(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 EJ(e){let t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,s=e.settings,a=e.state,l=0;const c={left:0,top:0,right:0,bottom:0},u=s.labels,d=u.maxLengthPx,h=u.minLengthPx;if(s.labels.show){const e=s.align,u="top"===e||"bottom"===e,p=u?n.inner.width:n.inner.height,f=o.ticks({settings:s,distance:p,formatter:r}).filter(wJ),m=e=>{const t=i({text:e,fontSize:s.labels.fontSize,fontFamily:s.labels.fontFamily});return t.width=CJ({value:t.width,maxValue:d,minValue:h}),t};if(t&&u&&"auto"===s.labels.mode&&(!function(e){let t=e.majorTicks,n=e.measure,r=e.rect,i=e.state,o=e.settings;const s=o.labels.maxGlyphCount,a="layered"===i.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=r.width;let d=0,h=0;if(isNaN(s))for(let e=0;e<t.length;e++){const r=t[e],i=r.label,o=n(i).width*(i.length>1?l:1);if(h=a*u*Math.abs(r.start-r.end),o+c>h)return!0}else{const e=t.reduce((e,t)=>Math.min(Math.abs(t.start-t.end),e),1/0);if(h=a*u*e,d=n("M").width*l*s,d+c>h)return!0}return!1}({majorTicks:f,measure:m,rect:n.inner,state:a,settings:s})?a.labels.activeMode="horizontal":a.labels.activeMode="tilted"),!s.labels.filterOverlapping&&"tilted"!==a.labels.activeMode&&SJ({rect:n.inner,state:a,majorTicks:f,measure:m,horizontal:u})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let g,y;if("tilted"===a.labels.activeMode){const e=Math.abs(s.labels.tiltAngle)*(Math.PI/180);g=t=>CJ({value:t.width,maxValue:d,minValue:h})*Math.sin(e)+t.height*Math.cos(e)}else g=u?e=>e.height:e=>CJ({value:e.width,maxValue:d,minValue:h});if(u&&"tilted"!==a.labels.activeMode)y=["M"];else if(isNaN(s.labels.maxGlyphCount))y=f.map(e=>e.label);else{let e="";for(let t=0;t<s.labels.maxGlyphCount;t++)e+="M";y=[e]}const v=y.map(m),b=v.map(g),x=Math.max(...b,0);if(l+=x,l+=s.labels.margin,"layered"===a.labels.activeMode&&(l*=2),"tilted"===a.labels.activeMode){const e="bottom"===s.align==s.labels.tiltAngle>=0,t=Math.abs(s.labels.tiltAngle)*(Math.PI/180),r=(x-m("M").height*Math.cos(t))/Math.sin(t),i=e=>Math.min(r,e.width)*Math.cos(t)+e.height,o=(t,r)=>{const i=f[r]?f[r].position:0;return e?t-i*n.inner.width:t-(1-i)*n.inner.width},a=Math.min(s.labels.maxEdgeBleed,Math.max(...v.map(i).map(o),0))+s.paddingEnd;if(c[e?"left":"right"]=a,!s.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 s=Math.abs(o),a=1/(Math.min(r.outer.width-i,r.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(s*(Math.PI/180))/a}({majorTicks:f,measureText:m,rect:n,bleedSize:a,angle:s.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const MJ=(e,t,n)=>e.width*Math.abs(t.position-n.position);function kJ(e){let t=e.layered,n=e.major,r=e.innerRect,i=e.outerRect,o=e.tick,s=e.index;const a=t?2:1,l=n[s-a],c=n[s+a],u=l?MJ(r,o,l)/2-2:1/0,d=c?MJ(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,s=n.width-t.width-o,a=t.width-t.width*r.position+s,l=2*Math.min(i,a),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,s=t.width*r.position+o,a=2*Math.min(i,s),l=0===r.position?t.width/2-2:0;return Math.max(i,a,l)})({innerRect:r,outerRect:i,tick:o,nextWidth:d})}function IJ(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){m$(e,t.style)}(o,e),o}function RJ(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function _J(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,s=t.endAngle,a=t.tickSize,l=s-o;let c=s-e.position*l;c-=Math.PI/2;const u=RJ(r.cx,r.cy,i+a,c),d=RJ(r.cx,r.cy,i,c),h={type:"line",x1:u.x,y1:u.y,x2:d.x,y2:d.y,value:e.value};return function(e,t){const n=x$({},t.style);m$(e,n)}(h,t),h}function DJ(e){return"string"==typeof e||"number"==typeof e?e:"-"}function AJ(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 PJ(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,s=t.endAngle,a=t.tickSize,l=s-o,c=.2;let u,d;u="top"===t.align||"bottom"===t.align?s-e.position*l:o+e.position*l,d=u<-.2&&u>-Math.PI+c?"left":u>.2&&u<Math.PI-c?"right":"center",u-=Math.PI/2;const h=function(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}(r.cx,r.cy,i+a+6,u);let p;p="left"===d?"end":"right"===d?"start":"middle";const f={type:"text",text:DJ(e.label),align:d,x:h.x,y:h.y,maxHeight:t.maxHeight,maxWidth:AJ(t,d,h),anchor:p,baseline:"middle"};return function(e,t){["fill","fontSize","fontFamily"].forEach(n=>{e[n]=t.style[n]})}(f,t),function(e,t){e.boundingRect=t.textBounds(e)}(f,t),function(e,t,n){let r,i;const o=parseFloat(n.fontSize)||0;r=t.y-o/2,i=e.innerRect.height-(t.y+o/2),(r<0||i<0)&&(n.text="")}(t,h,f),f}function LJ(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 TJ(e){let t=0;return t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function OJ(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=LJ(e)+e.labels.margin,t}function qJ(e,t){return e.map(e=>xJ(e,t))}function NJ(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function jJ(e){let t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.scale,o=e.tilted,s=e.layered,a=e.tick;const l=t.height,c=NJ(i,a),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=r.width-OJ(n)-n.paddingEnd;else if(s)u.width=c*r.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(r.height-OJ(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*r.width;return u.width=CJ({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function zJ(e){let t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.outerRect,o=e.tilted,s=e.layered,a=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-OJ(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);d.width=(r.height-OJ(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else d.width=kJ({layered:s,major:c,innerRect:r,outerRect:i,tick:a,index:l});return d.width=CJ({value:d.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),d}function FJ(e){let t;function n(){return t=zJ,n}function r(){return t=jJ,r}function i(e){let n=e.settings,r=e.scale,i=e.innerRect,o=e.outerRect,s=e.measureText,a=e.ticks,l=e.state,c=e.textBounds;const u=[],d=function(e){return e.filter(e=>!e.isMinor)}(a),h=function(e){return e.filter(e=>e.isMinor)}(a),p={innerRect:i,align:n.align,outerRect:o},f="tilted"===l.labels.activeMode,m="layered"===l.labels.activeMode;let g;if(n.arc&&(p.startAngle=n.arc.startAngle,p.endAngle=n.arc.endAngle,p.radius=n.arc.radius),n.line.show&&(p.style=n.line,p.padding=n.paddingStart,n.arc?u.push(IJ(p)):u.push(mJ(p))),n.ticks.show&&(p.style=n.ticks,p.tickSize=n.ticks.tickSize,p.padding=LJ(n),n.arc?(p.padding=TJ(n),g=function(e,t){return e.map(e=>_J(e,t))}(d,p)):g=qJ(d,p)),n.labels.show){const e=OJ(n);p.style=n.labels,p.padding=e,p.tilted=f,p.layered=m,p.angle=n.labels.tiltAngle,p.paddingEnd=n.paddingEnd,p.textBounds=c;const a=(e,a)=>{p.textRect=function(e){let t=e.style;return(0,e.measureText)({text:e.tick.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:s,style:p.style});const l=t({textMetrics:p.textRect,settings:n,innerRect:i,outerRect:o,scale:r,tilted:f,layered:m,tick:e,major:d,index:a});p.maxWidth=l.width,p.maxHeight=l.height,p.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)*NJ(n,i)}({innerRect:i,scale:r,settings:n,tick:e})};let l=[];n.arc?(p.padding=function(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=TJ(e)+e.labels.margin,t}(n),l=function(e,t,n){return e.map((e,r)=>{n(e,r);const i=PJ(e,t);return i.data=e.data,i})}(d,p,a)):l=!m||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map((e,r)=>{n(e,r);const i=bJ(e,t);return i.data=e.data,i})}(d,p,a):function(e,t,n,r){const i=t.padding,o=OJ(n);return e.map((e,s)=>{r(e,s);const a=o+t.maxHeight+n.labels.margin;t.layer=s%2,t.padding=s%2==0?i:a;const l=bJ(e,t);return l.data=e.data,l})}(d,p,n,a),n.labels.filterOverlapping&&function(e,t,n){let r=(t,n)=>jK(A$(1,e[t].boundingRect),A$(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);r=(n,r)=>{const i=1/Math.abs(e[n].x-e[r].x),o=Math.sin(t*(Math.PI/180))/i;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let i=n+1;i<=Math.min(n+5,n+(e.length-1));i++)e[n]&&e[i]&&r(n,i)&&(i===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(i,1),t&&t.splice(i,1)),i--,n--)}(l,g,p),u.push(...l)}return n.minorTicks&&n.minorTicks.show&&h.length>0&&(p.style=n.minorTicks,p.tickSize=n.minorTicks.tickSize,p.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...qJ(h,p))),g&&u.push(...g),u}return n.build=i,r.build=i,e?r():n()}const WJ={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"},$J={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 BJ={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=m$(!0,{},t.isDiscrete?WJ:$J,n),o=m$(!0,{},i,r.settings),s=r.layout.dock||t.defaultDock;o.dock=s,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,s),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const a=o.paddingStart,l=o.paddingEnd;return o.paddingStart="function"==typeof a?a.call(null):a,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=FJ(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=BY(r,i);const o=function(e){let t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,s=e.settings,a=0;const l=EJ({isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:s,state:e.state}),c=l.size,u=l.edgeBleed;if(a+=c,l.isToLarge)return{size:a};if(s.ticks.show&&(a+=s.ticks.margin,a+=s.ticks.tickSize),s.minorTicks&&s.minorTicks.show){const e=s.minorTicks.margin+s.minorTicks.tickSize;e>a&&(a=e)}if(s.line.show){const e=s.line.strokeWidth/2;a+=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}}(s.align)]=Math.ceil(e)}return a+=s.paddingStart,a+=s.paddingEnd,{size:a,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=m$({},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 m$(this.state.innerRect,r),m$(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=BY(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})),QX.multiple(t),t}};const VJ={render:()=>[]};function HJ(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 GJ(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 UJ={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=HJ(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,s=e.style;const a={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:GJ(r,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};m$(a,s.text);const l=o(a);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)),a.x=e,a.y="top"===r?i.height-n.paddingStart:n.paddingStart+l.height,a.dy="top"===r?-l.height/6:-l.height/3,a.maxWidth=.8*i.width}else{let e=i.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=i.height-n.paddingStart),a.y=e,a.x="left"===r?i.width-n.paddingStart:n.paddingStart,a.dx="left"===r?-l.height/3:l.height/3;const t="left"===r?270:90;a.transform="rotate(".concat(t,", ").concat(a.x+a.dx,", ").concat(a.y+a.dy,")"),a.maxWidth=.8*i.height}return isNaN(n.maxLengthPx)||(a.maxWidth=Math.min(a.maxWidth,n.maxLengthPx)),a}({title:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),r},beforeUpdate(e){e.settings&&(m$(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=HJ(t,n,this.scale)}};function YJ(e,t){const n=e.settings.layout.dock,r=e.settings.settings.invert,i="top"===n||"bottom"===n,o=i?"width":"height",s=e.rect[o],a=e.chart.scroll(e.settings.scroll);let l;{let e=t[i?"x":"y"];r&&(e=s-e);const n=a.getState();l={startOffset:e,startScroll:n.start,swipe:!1};const o=e/s*(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=s-t),!l.swipe){if(Math.abs(l.startOffset-t)<=1)return;l.swipe=!0}const n=a.getState(),o=(t-l.startOffset)/s*(n.max-n.min),c=l.startScroll+o;a.moveTo(c)},end:e=>{let t=e[i?"x":"y"];r&&(t=s-t);const n=a.getState();if(l.swipe){const e=(t-l.startOffset)/s*(n.max-n.min),r=l.startScroll+e;a.moveTo(r)}else{const e=t/s*(n.max-n.min)+n.min-n.viewSize/2;a.moveTo(e)}}}}function KJ(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const XJ={require:["chart","renderer"],on:{panStart(e){const t=KJ(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=YJ(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=KJ(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=KJ(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=KJ(e,this.renderer);YJ(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],s=this.chart.scroll(this.settings.scroll).getState();let a=o*(s.start-s.min)/(s.max-s.min);const l=o*s.viewSize/(s.max-s.min);return n&&(a=o-a-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(a,"px"),[r?"top":"left"]:"25%",[r?"height":"width"]:"50%",[i]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function JJ(e){let t=e.h,n=e.isVertical,r=e.value,i=e.pos,o=e.align,s=e.borderHit,a=e.state,l=e.idx;const c="end"!==o,u=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let d=0,h="100%",p="100%";return a.targetRect&&"start"===a.settings.bubbles.align?(h="".concat(a.targetRect.x+a.targetRect.width,"px"),p="".concat(a.targetRect.y+a.targetRect.height,"px")):a.targetRect&&"end"===a.settings.bubbles.align&&(d=n?a.targetRect.x:a.targetRect.y,h="".concat(a.rect.width-d,"px"),p="".concat(a.rect.height-d,"px")),c||(i-=s),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=a.style.line.stroke,e.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":r,"data-key":[a.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(s,"px"):p,width:n?h:"".concat(s,"px"),pointerEvents:"auto"}},[t("div",{style:m$({backgroundColor:a.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function ZJ(e){let t=e.h,n=e.isVertical,r=e.label,i=e.otherValue,o=e.rangeIdx,s=e.idx,a=e.pos,l=e.align,c=e.state,u=e.value;const d="end"!==l,h="outside"===c.settings.bubbles.placement;let p,f="none";n?(p=d?"left":"right",h&&(f=d?"translate(-100%, 0px)":"translate(100%, 0px)")):(p=d?"top":"bottom",h&&(f=d?"translate(0px, -100%)":"translate(0px, 100%)"));let m=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===s;const g={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let y=c.style.bubble.stroke;const v=m?t("input",{type:"text",value:u,style:x$(x$({},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,s].join("-"),"data-other-value":i,"data-idx":o,"data-bidx":s,style:g},[r]);return t("div",{style:{position:"absolute",[p]:"0",[n?"top":"left"]:"".concat(a,"px"),transform:f}},[v])}function QJ(e){let t=e.h,n=e.isVertical,r=e.top,i=e.height,o=e.color,s=e.on,a=e.opacity;return t("div",m$({style:{backgroundColor:o,opacity:a,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"}},s),[])}function eZ(e){let t=e.borderHit,n=e.els,r=e.isVertical,i=e.state,o=e.vStart,s=e.vEnd,a=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(s)*i.size:s,h=Math.abs(u-d),p=Math.min(u,d)+l,f=p+h;if(i.targetRect){const e=i.targetFillRect||i.targetRect,t=r?e.height:e.width,a=c?i.scale.norm(o)*t:o,l=c?i.scale.norm(s)*t:s,u=Math.abs(a-l),d=Math.min(a,l),h={h:i.h,isVertical:r,top:d,height:u,color:i.style.target.fill,opacity:i.style.target.opacity};i.style.target.opacity<.8&&(h.on={onmouseover(e){e.srcElement.style.opacity=i.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=i.style.target.opacity}}),n.push(i.h("div",{style:{position:"absolute",left:"".concat(e.x,"px"),top:"".concat(e.y,"px"),height:"".concat(e.height,"px"),width:"".concat(e.width,"px")}},[QJ(h)]))}const m=u<d?o:s,g=u<d?s:o,y=w$(c?i.scale.domain():[Math.min(o,s),Math.max(o,s)],2),v=y[0],b=y[1],x=m+1e-5>=v&&m-1e-5<=b,w=g-1e-5<=b&&g+1e-5>=v;x&&n.push(JJ({h:i.h,isVertical:r,borderHit:t,value:m,pos:p,align:"start",state:i,idx:a})),w&&n.push(JJ({h:i.h,isVertical:r,borderHit:t,value:g,pos:f,align:"end",state:i,idx:a}));const S=i.settings.bubbles;if(S&&S.show){S.fontSize,S.fontFamily,S.fill;const e=[o,s];x&&n.push(ZJ({h:i.h,isVertical:r,align:S.align,rangeIdx:a,idx:0,otherValue:g,value:m,label:"".concat(i.format(m,e)),pos:p,state:i})),w&&n.push(ZJ({h:i.h,isVertical:r,align:S.align,rangeIdx:a,idx:1,otherValue:m,value:g,label:"".concat(i.format(g,e)),pos:f,state:i}))}}function tZ(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 nZ(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach((r,i)=>{e.active&&i===e.active.idx||eZ({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=tZ(e);r=e.active.start+t,i=e.active.end+t}eZ({borderHit:5,els:t,isVertical:n,state:e,vStart:r,vEnd:i,idx:e.active.idx})}return t}function rZ(e){return{min:e.scale.min(),max:e.scale.max()}}function iZ(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function oZ(e,t,n){let r,i,o=e.ranges,s=-1;for(r=0;r<o.length;r++){if(o[r].min<=t&&t<=o[r].max){s=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===s&&o.length&&r>=o.length&&(n.min=o[o.length-1].max),-1!==s&&(i={idx:s,start:o[s].min,end:o[s].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=i}function sZ(e){e.renderer.render(nZ(e))}function aZ(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 lZ(e,t){let n,r=1/0;const i=t.domain(),o=t.bandwidth()/2;for(let s=0;s<i.length;++s){const a=Math.abs(e-o-t(i[s]));a<r&&(r=a,n=i[s])}return n}function cZ(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function uZ(e){const t=e.reduce((e,t)=>(e.push(...I$(t.bounds)),e),[]);return R$(t)}const dZ={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=aZ(this.state,this.state.brushInstance),this.state.active=null,sZ(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=BY(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=uZ(i);if(t.size=r[0===e.state.direction?"height":"width"],t.scale=BY(e.chart.scale(n.scale),t.size),t.targetRect=r,o.length>0){const e=uZ(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(),s=e.scale.max();i[t]={min:Math.max(o,Math.min(n,r)),max:Math.min(s,Math.max(n,r))},e.ranges[t]=x$({},i[t]);const a=e.scale.data();a&&a.fields&&a.fields.forEach(t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),i)})}(this.state,e,t,n),this.emit("bubbleEnd"),sZ(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,sZ(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=GU(),this.state.scale.data=i.data,this.state.format||(this.state.format=(e,t)=>cZ(i.range(),t)?function(e,t){const n=t.ticks(),r=t.domain().indexOf(lZ(e,t));return-1!==r?n[r].label:"-"}(e,i):"-"),this.state.fauxBrushInstance=DY(),this.state.findValues=e=>function(e,t){const n=t.domain(),r=t.range(),i=[];return e.forEach(e=>{if(!cZ(r,[e.min,e.max]))return;const o=n.indexOf(lZ(e.min,t)),s=n.indexOf(lZ(e.max,t));i.push.apply(i,n.slice(Math.min(o,s),Math.max(o,s)+1))}),i}(e,i);return this.state.ranges=aZ(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[nZ(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 s=n.center.x-n.deltaX,a=n.center.y-n.deltaY;let l=document.elementFromPoint(s,a);r.element().contains(l)||(l=null);const c={started:!0};t.offset=m$({},r.element().getBoundingClientRect());const u=s-t.offset.left,d=a-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=i(t,t.fauxBrushInstance||t.brushInstance);const h=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],p=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];c.current=t.scale.normInvert(p/t.size),c.start=t.scale.normInvert(h/t.size);let f=t.ranges;const m=rZ(t);let g,y,v=-1;if(l&&l.hasAttribute("data-idx"))v=parseInt(l.getAttribute("data-idx"),10),m.min=v>0?f[v-1].max:m.min,m.max=v+1<f.length?f[v+1].min:m.max;else{for(g=0;g<f.length;g++){if(f[g].min<=c.start&&c.start<=f[g].max){v=g,m.min=g?f[g-1].max:m.min,m.max=g+1<f.length?f[g+1].min:m.max;break}if(c.start<f[g].min){m.max=f[g].min,m.min=g?f[g-1].max:m.min;break}}-1===v&&f.length&&g>=f.length&&(m.min=f[f.length-1].max)}if(-1!==v||t.multi||(c.ranges=[],m.min=t.scale.min(),m.max=t.scale.max()),-1!==v)if(y={idx:v,start:f[v].min,end:f[v].max,limitLow:m.min,limitHigh:m.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{let e=t.scale.norm(y.start)*t.size,n=t.scale.norm(y.end)*t.size;Math.abs(h-e)<=o?(c.start=y.end,y.mode="modify"):Math.abs(h-n)<=o&&(c.start=y.start,y.mode="modify")}else y={idx:-1,start:c.start,end:c.current,limitLow:m.min,limitHigh:m.max,mode:"current"};c.active=y,"modify"!==y.mode&&t.targetRect&&!FK(t.targetRect,{x:u,y:d})||Object.keys(c).forEach(e=>t[e]=c[e])}({e:e,state:this.state,renderer:this.renderer,ranges:aZ,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=rZ(e);oZ(e,e.current,n)}(this.state,aZ),sZ(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=tZ(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=aZ(e,e.fauxBrushInstance),i=e.findValues(r),o=e.findValues(t),s=o.filter(e=>-1===i.indexOf(e)),a=i.filter(e=>-1===o.indexOf(e)),l=s.map(e=>({key:n.id(),value:e})),c=a.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),sZ(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;sZ(this.state);const o=i.querySelector("input");o.focus(),o.select()}};function hZ(e){e.renderer.render(nZ(e))}function pZ(e){return e.rc.ranges()}function fZ(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 mZ={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),s=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=s?{x:s.x0-this.rect.x,y:s.y0-this.rect.y,width:s.x1-s.x0,height:s.y1-s.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=n,this.state.settings=t,this.state.offset=i,this.state.rc=vY(),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},s=e.chart.shapesAt(o,e.settings.brush);if(0===s.length)return"-";const a=s.reduce((n,i)=>{const o=n.bounds,s=i.bounds;return t===r?o[e.cssCoord.coord]<=s[e.cssCoord.coord]?n:i:o[e.cssCoord.coord]+o[e.cssCoord.area]>=s[e.cssCoord.coord]+s[e.cssCoord.area]?n:i}),l=e.settings.brush.components.reduce((e,t)=>e.key===a.key?e:t);return"function"==typeof e.settings.bubbles.label?e.settings.bubbles.label(a.data):Array.isArray(l.data)&&l.data.length?a.data[l.data[0]].label:a.data&&a.data.label?a.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 s=n.center.x-n.deltaX,a=n.center.y-n.deltaY;let l=document.elementFromPoint(s,a);r.element().contains(l)||(l=null);const c={started:!0};t.offset=r.element().getBoundingClientRect(),t.ranges=i(t);const u=s-t.offset.left,d=a-t.offset.top,h=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],p=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];let f=p,m=h;c.start=h,c.current=p;let g=t.ranges;const y=iZ(t);let v,b,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),y.min=x>0?g[x-1].max:y.min,y.max=x+1<g.length?g[x+1].min:y.max;else{for(v=0;v<g.length;v++){if(g[v].min<=m&&m<=g[v].max){x=v,y.min=v?g[v-1].max:y.min,y.max=v+1<g.length?g[v+1].min:y.max;break}if(m<g[v].min){y.max=g[v].min,y.min=v?g[v-1].max:y.min;break}}-1===x&&g.length&&v>=g.length&&(y.min=g[g.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(b={idx:x,start:g[x].min,end:g[x].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),b.mode="modify";else{let e=b.start,t=b.end;Math.abs(h-e)<=o?(c.start=b.end,b.mode="modify"):Math.abs(h-t)<=o&&(c.start=b.start,b.mode="modify")}else b={idx:-1,start:m,end:f,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=b,"modify"!==b.mode&&t.targetRect&&!FK(t.targetRect,{x:u,y:d})||Object.keys(c).forEach(e=>t[e]=c[e])}({e:e,state:this.state,renderer:this.renderer,ranges:pZ,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=iZ(e);oZ(e,e.current,n)}(this.state,pZ),hZ(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=tZ(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,...fZ(e,t)]}),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),hZ(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function gZ(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,s=e.scale(i.max)*n,a=Math.min(o,s),l=Math.abs(o-s);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:a,width:t?r:l,y:t?a:0,height:t?l:r}})}function yZ(e,t,n,r){function i(){!function(e){e.renderer.render(gZ(e))}(e)}function o(){!function(e){e.renderer.render(gZ(e))}(e)}function s(){!function(e){e.renderer.render(gZ(e))}(e)}e.brush=t,t&&(t.on("start",i),t.on("update",o),t.on("end",s),e.start=i,e.update=o,e.end=s,e.brush=t,e.scale=n,e.renderer=r)}function vZ(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 bZ={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=BY(this.chart.scale(e.scale),r);return vZ(this.state),yZ(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,gZ(this.state)},beforeDestroy(){vZ(this.state)}};function xZ(e,t){const n=t.center.x,r=t.center.y;return{x:n-e.left,y:r-e.top}}function wZ(e,t,n){return aK(e,t.points[0])<n.settings.snapIndicator.threshold**2}function SZ(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 CZ(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 EZ(e,t){e.snapIndicator.visible=t}const MZ={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart(e){this.start(e)},lassoEnd(e){this.end(e)},lassoMove(e){this.move(e)},lassoCancel(){this.cancel()}},created(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start(e){var t;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(e,t){const n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=function(e){return e.settings.brush.components.map(e=>({key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"}))}(this.settings);const n=xZ(this.state.rendererBounds,e);SZ(this.state,n),CZ({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=xZ(this.state.rendererBounds,e);wZ(t,this.state,this.settings)?EZ(this.state,!0):EZ(this.state,!1),SZ(this.state,t),CZ({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;EZ(this.state,!1);wZ(xZ(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 kZ(e,t,n,r,i){let o,s=0,a=t.length-1;for(;s<a;){let l=Math.floor((s+a)/2);o=i(t[l]),o[n]+o[r]<e[n]?s=l+1:a=l}return s}function IZ(e){let t=e.orientation,n=e.targetNodes,r=e.labels,i=e.container,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kZ;const s=[],a="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],h=d.textBounds,p=d.node;if(h[a]<i[a]||h[a]+h[l]>i[a]+i[l])return!1;for(let e=o(h,s,a,l,c);e<s.length;e++)if(jK(h,s[e].textBounds))return!1;const f=o(h,n,a,l,u),m=h[a]+h[l];for(let e=f;e<n.length;e++){const t=n[e].node;if(m<t.localBounds[a])break;if(jK(h,t.localBounds)&&p!==t)return!1}return s.push(r[t]),!0}}function RZ(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function _Z(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function DZ(e){return x$(x$({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 AZ(e,t,n){return n?e.width>=t.height:e.width>=t.width}function PZ(e,t,n){return n?e.height>=t.width:e.height>=t.height}function LZ(e,t,n,r,i){let o,s;return"v"===e?(o=r||i||AZ(t,n,!0),s=PZ(t,n,!r)):(o=AZ(t,n),s=i||PZ(t,n,!1)),o&&s}function TZ(e,t,n,r){return e+.5*t+(r-.5)*(t-n)-.5*n}function OZ(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 AZ(e,t,n.rotate)&&PZ(e,t,n.rotate)}(e,i,n))return!1;const o=.5*i.height;return n.rotate?(r.x=TZ(e.x,e.width,i.height,n.align)+o,r.y=TZ(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=TZ(e.x,e.width,i.width,n.align),r.y=TZ(e.y,e.height,i.height,n.justify)+o),r}function qZ(e){let t=e.bar,n=e.view,r=e.direction,i=e.position,o=e.padding,s=void 0===o?4:o,a=e.measured;const l={};if(m$(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,s=void 0===o?4:o,a=n.left,l=void 0===a?4:a,c=n.right,u=void 0===c?4:c,d="function"==typeof l?l(t):l,h="function"==typeof u?u(t):u,p="function"==typeof i?i(t):i,f="function"==typeof s?s(t):s;e.x+=d,e.width-=d+h,e.y+=p,e.height-=p+f}(l,a,s),l}function NZ(e){let t,n,r,i,o,s=e.direction,a=e.fitsHorizontally,l=e.measured,c=e.node,u=e.orientation,d=e.placementSettings,h=e.rect,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qZ;const f=[],m="h"===u?"width":"height";for(o=0;o<d.length;o++)if(r=d[o],i=p({bar:c.localBounds,view:h,direction:s,position:r.position,padding:r.padding,measured:l}),f.push(i),t=!o||i[m]>t[m]?i:t,LZ(u,i,l,a,r.overflow)){n=i;break}return n||(n=t,o=f.indexOf(n)),r=d[o],{bounds:n,placement:r}}function jZ(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const o=i.top,s=void 0===o?4:o,a=i.bottom,l=void 0===a?4:a,c=i.left,u=void 0===c?4:c,d=i.right,h=void 0===d?4:d,p="function"==typeof u?u(t):u,f="function"==typeof h?h(t):h,m="function"==typeof s?s(t):s,g="function"==typeof l?l(t):l,y=e.x+e.dx,v=e.y+e.dy,b=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)-p-S,y:(n?v:v-w)-m-S,width:x+(p+f)-S,height:b+(m+g)-S}}function zZ(e){let t=e.chart,n=e.targetNodes,r=e.rect,i=e.fitsHorizontally,o=e.collectiveOrientation,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NZ,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:OZ,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:IZ;const c=[],u={container:r,targetNodes:n,labels:[],orientation:o};let d,h,p,f,m,g,y,v,b,x,w,S,C,E;for(let e=0,l=n.length;e<l;e++){g=null,h=n[e],p=h.node,C=RZ(p,t),b=h.direction,E="left"===b||"right"===b?"h":"v";for(let t=0;t<h.texts.length;t++){if(f=h.texts[t],!_Z(f))continue;x=h.labelSettings[t],v=h.measurements[t],S=x.placements;const n=s({direction:b,fitsHorizontally:i,lblStngs:x,measured:v,node:p,orientation:E,placements:S,placementSettings:h.placementSettings[t],rect:r});if(g=n.bounds,w=n.placement,g&&w){var M;m=w.justify;const t="function"==typeof x.linkData?x.linkData(C,e):void 0,n="function"==typeof w.overflow?w.overflow(C,e):w.overflow;"up"===b&&(m=1-m),"opposite"===w.position&&(m=1-m),"left"===b&&(m=1-m);const r=!("h"===o||i);if(d=a(g,f,{justify:"h"===E?w.align:m,align:"h"===E?m:w.align,fontSize:x.fontSize,fontFamily:x.fontFamily,textMetrics:v,rotate:r,overflow:!!n,dock:null!==(M=x.dock)&&void 0!==M?M:"left"}),d){const n=jZ(d,v,r,g,w.padding);y="function"==typeof w.fill?w.fill(x$(x$({},C),{},{textBounds:n}),e):w.fill,d.fill=y,void 0!==t&&(d.data=t),"object"==typeof w.background&&(d.backgroundColor="function"==typeof w.background.fill?w.background.fill(x$(x$({},C),{},{textBounds:n}),e):w.background.fill,void 0!==d.backgroundColor&&(d.backgroundBounds=jZ(d,v,r,g,w.background.padding))),c.push(d),u.labels.push({node:p,textBounds:n})}}}}const k=c.filter(l(u));return[...k.filter(e=>void 0!==e.backgroundBounds).map(DZ),...k]}function FZ(e){const t=2*Math.PI;return(e%t+t)%t}function WZ(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function $Z(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function BZ(e,t,n){let r=t.x,i=t.y;if(r*r+i*i>e*e)return null;let o=Math.sin(n),s=Math.cos(n),a=r*s-i*o,l=e*e-a*a;if(l<0)return null;let c=Math.sqrt(l);return{x:a*s+o*c,y:-a*o+s*c}}function VZ(e){let t,n,r=e.radius,i=e.size,o=e.angle,s=i.width,a=i.height,l={x:s/2,y:a/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=BZ(r,l,o),!t)return null;t.y*=-1,n={x:-s,y:0};break;case 1:if(t=BZ(r,l,Math.PI-o),!t)return null;n={x:-s,y:-a};break;case 2:if(t=BZ(r,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-a};break;case 3:if(t=BZ(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:s,height:a}}function HZ(e){let t=e.slice,n=e.measured,r=e.padding,i=t.start,o=t.end,s=t.innerRadius,a=t.outerRadius,l=a-s-2*r,c=o-i;if(c<Math.PI){let e=(n.height/2+r)/Math.tan(c/2);e>s&&(l=a-e-2*r)}if(l<0||l<n.minReqWidth)return null;const u=FZ((i+o)/2);let d=a-r,h={x:Math.sin(u)*d,y:-Math.cos(u)*d,width:l,height:n.height};return u<Math.PI?(h.angle=u-Math.PI/2,h.anchor="end"):(h.angle=u+Math.PI/2,h.anchor="start"),h}function GZ(e){let t=e.context,n=e.node,r=e.bounds;let i=n.desc.slice;const o=FZ((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 UZ(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function YZ(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 KZ(e){let t,n,r=e.slice,i=e.direction,o=e.position,s=e.padding,a=e.measured,l=e.view,c=e.context,u=e.store,d=r.start,h=r.end,p=r.innerRadius,f=r.offset;switch(o){case"into":t="rotate"===i?HZ({slice:r,measured:a,padding:s}):function(e){let t=e.slice,n=e.padding,r=e.measured,i=t.start,o=t.end,s=t.innerRadius,a=t.outerRadius;const l=FZ((i+o)/2);let c=VZ({radius:a,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",WK(c,{x1:0,y1:0,x2:Math.sin(i)*a,y2:-Math.cos(i)*a})||WK(c,{x1:0,y1:0,x2:Math.sin(o)*a,y2:-Math.cos(o)*a})||PK({cx:0,cy:0,r:s},c)?null:(WZ(c,n),c)):null}({slice:r,measured:a,padding:s});break;case"inside":n={start:d,end:h,innerRadius:0,outerRadius:p},t="rotate"===i?HZ({slice:n,measured:a,padding:s}):function(e){let t=e.slice,n=e.padding,r=e.measured,i=e.store;const o=t.start,s=t.end,a=t.outerRadius,l=FZ((o+s)/2);let c=VZ({radius:a,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",WZ(c,n),i.insideLabelBounds.some(e=>jK(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:a,padding:s,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,s=t.end,a=t.outerRadius,l=t.offset,c=a+r,u=s-o;if(u<Math.PI&&(n.height/2+r)/Math.tan(u/2)>c)return null;const d=FZ((o+s)/2);let h=Math.sin(d)*c,p=-Math.cos(d)*c,f=n.width+1,m=d%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){let e=p<0?i.y:i.y+i.height,t=Math.abs(e-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*r-a;t<f&&(f=t)}if(Math.sin(m)>.001){let e=h<0?i.x:i.x+i.width,t=Math.abs(e-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*r-a;t<f&&(f=t)}if(f<=0||f<n.minReqWidth)return null;let g={x:h,y:p,width:f,height:n.height};return d<Math.PI?(g.angle=d-Math.PI/2,g.anchor="start"):(g.angle=d+Math.PI/2,g.anchor="end"),g}({slice:r,measured:a,padding:s,view:l}):function(e){let t=e.slice,n=e.measured,r=e.padding,i=e.view,o=e.context,s=t.start,a=t.end,l=t.outerRadius,c=t.offset;const u=FZ((s+a)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.q4maxY<0;default:return!0}}(o,Math.floor(u/(Math.PI/2)),i))return null;let d=l+r+n.height/2,h=Math.sin(u)*d,p=-Math.cos(u)*d,f=n.width+1;if(u<Math.PI){let e=Math.abs(i.x+i.width-(h+c.x));e<f&&(f=e)}else{let e=Math.abs(i.x-(h+c.x));e<f&&(f=e)}if(f<n.minReqWidth)return null;let m={x:h,y:p,width:f,height:n.height};return u<Math.PI?m.anchor="start":m.anchor="end",m}({slice:r,measured:a,padding:s,view:l,context:c});break;default:throw new Error("not implemented")}return t&&(t.x+=f.x,t.y+=f.y,"outside"===o&&"rotate"!==i&&function(e,t,n){const r=n.start,i=n.end,o=n.offset,s=n.outerRadius,a=FZ((r+i)/2);switch(Math.floor(a/(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=s+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*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=s+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*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=s+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*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=s+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(a)*t,y2:o.y-Math.cos(a)*t,strokeWidth:1}}}}}(t,c,r)),t}function XZ(e){let t=e.context,n=e.direction,r=e.measured,i=e.node,o=e.placementSettings,s=e.rect,a=e.store,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:KZ;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,slice:i.desc.slice,view:s,direction:n,position:c.position,measured:r,padding:c.padding,store:a});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function JZ(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 ZZ=/\n+|\r+|\r\n/,QZ=/\s/,eQ=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function tQ(e){return"string"==typeof e?-1!==e.search(ZZ):-1!==String(e).search(ZZ)}function nQ(e){return-1!==e.search(QZ)}function rQ(e){return-1!==e.search(eQ)}function iQ(e,t,n){return Math.max(t,Math.min(n,e))}function oQ(){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,s=e.measureText,a=void 0===s?e=>({width:e.length,height:1}):s,l=e.mandatoryBreakIdentifiers,c=void 0===l?[tQ]:l,u=e.noBreakAllowedIdentifiers,d=void 0===u?[]:u,h=e.suppressIdentifier,p=void 0===h?[nQ,tQ,e=>""===e]:h,f=e.hyphenationIdentifiers,m=void 0===f?[rQ]:f;const g=String(t).split(r);!function(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}(g);const y=g.length,v=o?e=>e>=0:e=>e<y;let b=o?y:-1;function x(e){const t=iQ(e,0,y-1),n=g[t],r=a(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:p.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?b--:b++:b=iQ(e,0,y-1),v(b)?x(b):{done:!0}},peek:x,length:y}}const sQ="…",aQ=/^\s*\d+(\.\d+)?px\s*$/i;function lQ(e){return"string"===typeof e&&aQ.test(e)}function cQ(e){const t=e["font-size"]||e.fontSize;return lQ(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function uQ(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const r=cQ(e);return Math.max(1,Math.min(Math.floor(t/r),n))}function dQ(e,t){return{lines:[],line:"",width:0,maxLines:uQ(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function hQ(e){e.lines.push(e.line),e.line="",e.width=0}function pQ(e,t){e.line+=t.value,e.width+=t.width}function fQ(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 mQ(e,t,n){const r=oQ({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?fQ(e,t,r):t,hQ(e),pQ(e,t)):pQ(e,t)}}function gQ(e,t){const n=oQ({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),r=dQ(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){hQ(r),i=!1;break}1===e.breakOpportunity?hQ(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?r.width+=e.width:(e=r.hyphens.enabled?fQ(r,e,n):e,hQ(r),pQ(r,e)):pQ(r,e)}return{lines:r.lines,reduced:i}}function yQ(e,t){const n=oQ({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),r=dQ(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){hQ(r),i=!1;break}1===e.breakOpportunity?hQ(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?hQ(r):e.width>r.maxWidth?mQ(r,e,t):(hQ(r),pQ(r,e)):pQ(r,e)}return{lines:r.lines,reduced:i}}function vQ(e){return{"break-all":gQ,"break-word":yQ}[e.wordBreak]}function bQ(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const r=vQ(n);if(!r)return;const i=e(n);if(i.width>n.maxWidth||tQ(n.text)){const o=(cQ(n)-i.height)/2,s=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((s,a)=>{const l=m$({},t);l.text=s,l._lineBreak=!0,o+=n,e.reduced&&a===e.lines.length-1?l.text+=sQ:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=r,o+=n,i.children.push(l)}),i}(s,n,o,i.height)}}}}function xQ(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 s=t({text:i,fontSize:r,fontFamily:n}).width;if(s<=o)return i;let a=0,l=i.length-1;for(;a<=l;){let e=Math.floor((a+l)/2);s=t({text:i.substr(0,e)+sQ,fontSize:r,fontFamily:n}).width,s<=o?a=e+1:l=e-1}return i.substr(0,l)+sQ}function wQ(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 SQ={},CQ={},EQ={fontSize:void 0,fontFamily:void 0};let MQ;function kQ(e,t){return!e&&!t||e===t}function IQ(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 CQ[o]&&(MQ=MQ||document.createElement("canvas").getContext("2d"),function(e){let t=e.fontWeight,n=e.fontSize,r=e.fontFamily;kQ(EQ.fontWeight,t)&&kQ(EQ.fontSize,n)&&kQ(EQ.fontFamily,r)||(MQ.font=[t,n,r].filter(e=>!!e).join(" "),EQ.fontWeight=t,EQ.fontSize=n,EQ.fontFamily=r)}({fontWeight:n,fontSize:r,fontFamily:i}),CQ[o]=MQ.measureText(t).width),CQ[o]}function RQ(e){return"number"!=typeof SQ[e]&&(SQ[e]=function(e){if(lQ(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),SQ[e]}function _Q(e){let t=e.text,n=e.fontWeight,r=e.fontSize;return{width:IQ({text:t,fontWeight:n,fontSize:r,fontFamily:e.fontFamily}),height:RQ(r)}}function DQ(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_Q;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),s=e.x||0,a=e.y||0,l=e.dx||0,c={x:0,y:a+((e.dy||0)+wQ(e))-.75*i.height,width:o,height:i.height},u=e["text-anchor"]||e.anchor;return c.x="middle"===u?s+l-o/2:"end"===u?s+l-o:s+l,c}function AQ(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_Q;const n=vQ(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||tQ(e.text))){const o=n(e,e=>t({text:e,fontFamily:i,fontSize:r})),s=m$({},e);let a=0,l="";for(let e=0,n=o.lines.length;e<n;e++){let s=o.lines[e];s+=e===n-1&&o.reduced?sQ:"";const c=t({text:s,fontSize:r,fontFamily:i}).width;c>=a&&(a=c,l=s)}s.text=l;const c=DQ(s,t);return c.height=cQ(e)*o.lines.length,c}return DQ(e,t)}function PQ(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function LQ(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 TQ(e){return{type:"circle",bounds:{cx:e.cx,cy:e.cy,r:e.r}}}function OQ(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 s=0!==r?r:i;return TQ({cx:o.x,cy:o.y,r:s})}(e.desc.slice):"circle"===e.type?TQ(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var qQ={bar:function(e){let t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,s=e.style,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zZ;const l=m$({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},s.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map(e=>m$({},l,t,e)),u=t.labels.map(e=>e.placements.map(n=>m$({},l,t,e,n))),d=function(e){let t=e.nodes,n=e.rect,r=e.chart,i=e.labelSettings,o=e.placementSettings,s=e.settings,a=e.renderer;const l={},c=[];let u,d,h,p,f,m,g,y=!0,v=!1;for(let e=0;e<t.length;e++){if(d=t[e],p=d.localBounds,!jK(p,n))continue;let b=RZ(d,r);u={node:d,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<i.length;t++)m=i[t],h="function"==typeof m.label?m.label(b,e):void 0,_Z(h)&&(g="function"==typeof s.direction?s.direction(b,e):s.direction||"up",v=v||"left"===g||"right"===g,l.fontFamily=m.fontFamily,l.fontSize="".concat(m.fontSize,"px"),l.text=h,f=a.measureText(l),u.measurements.push(f),u.texts.push(h),u.labelSettings.push(m),u.placementSettings.push(o[t]),u.direction=g,y=y&&f.width<=p.width-8);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:v}}({nodes:r,chart:n,renderer:o,settings:t,rect:i,labelSettings:c,placementSettings:u}),h=d.fitsHorizontally,p=d.hasHorizontalDirection,f=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:p?"h":"v"}),g="h"===m?"y":"x",y="h"===m?"height":"width";return f.sort((e,t)=>e.node.localBounds[g]+e.node.localBounds[y]-(t.node.localBounds[g]+t.node.localBounds[y])),a({chart:n,targetNodes:f,stngs:t,rect:i,fitsHorizontally:h,collectiveOrientation:m})},slice:function(e){let t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,s=e.style,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:XZ,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:YZ;const c=m$({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},s.label);c.fontSize=parseInt(c.fontSize,10);const u=t.labels.map(e=>m$({},c,t,e)),d=t.labels.map(e=>e.placements.map(n=>m$({},c,t,e,n))),h=[],p={insideLabelBounds:[]};r=function(e){const t=[],n=[],r=[],i=[];for(let o=0;o<e.length;++o){const s=e[o].desc.slice,a=FZ((s.start+s.end)/2);switch(Math.floor(a/(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)=>FZ((e.desc.slice.start+e.desc.slice.end)/2)-FZ((t.desc.slice.start+t.desc.slice.end)/2),s=(e,t)=>o(t,e);return t.sort(s),n.sort(o),r.sort(s),i.sort(o),t.concat(n,i,r)}(r);const f={};for(let e=0,t=r.length;e<t;e++){const t=r[e],s=UZ(t,n);for(let n=0;n<u.length;n++){const r=u[n],c="function"==typeof r.label?r.label(s,e):"";if(!c)continue;const m="function"==typeof r.direction?r.direction(s,e):r.direction||"horizontal",g="function"==typeof r.linkData?r.linkData(s,e):void 0,y=JZ(c,r,o),v=a({context:f,direction:m,lblStngs:r,measured:y,node:t,placementSettings:d[n],rect:i,store:p}),b=v.bounds,x=v.placement;if(b&&x){if("outside"===x.position&&"rotate"!==m){GZ({context:f,node:t,bounds:b});if(!EK($Z(b),i))continue}const n="function"==typeof x.fill?x.fill(s,e):x.fill,o=l(b,c,{fill:n,fontSize:r.fontSize,fontFamily:r.fontFamily,textMetrics:y});o&&(void 0!==g&&(o.data=g),h.push(o),b.line&&(b.line.stroke=n,h.push(b.line)))}}}return h},rows:function(e){let t=e.settings,n=e.chart,r=e.nodes,i=e.renderer,o=e.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:LQ;const a=m$({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);a.fontSize=parseInt(a.fontSize,10);const l=m$({},a,t),c=t.labels.map(e=>m$({},l,e)),u={},d=[];for(let e=0,t=r.length;e<t;e++){let t=r[e],o=PQ(t,n),a=OQ(t),h=a.type,p=a.bounds;if(!p)continue;let f,m=0,g=[],y=[],v="circle"===h?2*p.r*.9:p.height;for(m+=l.padding,f=0;f<c.length;f++){let t=c[f],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>v)break;y.push(n),g.push(r)}const b=f,x=Math.max(0,v-m);let w;for(w="circle"===h?p.cy-.9*p.r:p.y,w+=l.justify*x+l.padding,f=0;f<b;f++){let t,n=c[f];if("circle"===h){let e=Math.max(Math.abs(w-p.cy),Math.abs(w+g[f].height-p.cy)),n=Math.sqrt(p.r*p.r-e*e);t={x:p.cx-n+l.padding,y:w,width:2*n-2*l.padding,height:g[f].height}}else t={x:p.x+l.padding,y:w,width:p.width-2*l.padding,height:g[f].height};w+=g[f].height+l.padding;let r="function"==typeof n.fill?n.fill(o,e):n.fill;const a="function"==typeof n.linkData?n.linkData(o,e):void 0;let u=s(t,y[f],{fill:r,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:g[f]});if(u){if(u.text&&u.text!==sQ){const e=xQ(u,i.measureText);if(sQ===e)continue;u.ellipsed=e}void 0!==a&&(u.data=a),d.push(u)}}}return d}};const NQ={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach(e=>{e.strategy&&qQ[e.strategy.type]&&e.component&&t.push(...function(e,t){let n=e.chart,r=e.source,i=e.rect,o=e.renderer,s=e.style;if(!n.component(r.component))return[];const a=n.findShapes(r.selector).filter(e=>e.key===r.component);return t({chart:n,settings:r.strategy.settings,nodes:a,rect:{x:0,y:0,width:i.width,height:i.height},renderer:o,style:s})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:e,style:this.style},qQ[e.strategy.type]))}),t}};const jQ={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 zQ(e){let t=e.x,n=void 0===t?0:t,r=e.y,i=e.item,o=e.globalMetrics,s=e.createSymbol,a=e.direction,l=void 0===a?"ltr":a,c=i.label.displayObject,u=i.label.bounds,d=i.symbol.meta;const h="rtl"===l;let p={x:h?n+o.maxLabelBounds.width:n+o.maxSymbolSize+o.spacing,y:r,width:o.maxLabelBounds.width,height:Math.max(o.maxSymbolSize,o.maxLabelBounds.height)},f=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:h?n+o.maxLabelBounds.width+o.spacing:n,y:r,width:o.maxSymbolSize,height:p.height},d.size,{align:void 0===d.align?.5:d.align,justify:void 0===d.justify?.5:d.justify});const m=s(m$({},d,f));return delete m.collider,c.anchor=h?"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)}(p,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:p}}function FQ(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 WQ(e,t){let n,r,i,o,s=t.onScroll,a=void 0===s?()=>{}:s,l=null,c=0;const u={itemize:t=>{n=function(e,t){let n,r,i=e.resolved,o=e.dock,s=[],a=i.items.items,l=i.symbols.items,c=i.labels.items,u=0,d=0,h=0;for(let e=0;e<a.length;e++){if(!1===a[e].show)continue;const i=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=m$({},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)}},s.push(r),u=Math.max(l[e].size,u),d=Math.max(r.label.bounds.width,d),h=Math.max(r.label.bounds.height,h)}return{items:s,globalMetrics:{spacing:8,maxSymbolSize:u,maxItemBounds:{height:Math.max(u,h),width:u+8+d},maxLabelBounds:{width:d,height:h}},layout:{margin:{vertical:void 0!==i.layout.item.vertical?i.layout.item.vertical:4,horizontal:void 0!==i.layout.item.horizontal?i.layout.item.horizontal:4},mode:i.layout.item.mode,size:i.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:i.layout.item.direction,scrollOffset:i.layout.item.scrollOffset}}}(t,e.renderer),l=isNaN(n.layout.scrollOffset)?l:n.layout.scrollOffset},getItemsToRender:t=>{i=t.viewRect,c=u.getContentOverflow(i);const s=u.extent();l=Math.max(0,Math.min(l,c)),o=m$({},i);const a="horizontal"===u.orientation()?"x":"y";return o[a]-=l,o["x"===a?"width":"height"]=s,function(e,t,n){let r=e.viewRect,i=n.itemized,o=n.create,s=void 0===o?zQ:o,a=n.parallels,l=n.createSymbol;const c=i.layout.direction,u=i.globalMetrics,d=i.items,h="horizontal"===i.layout.orientation;let p=0;const f=[],m=u.maxItemBounds.height,g=u.maxItemBounds.width,y=i.layout.margin.vertical+m,v=i.layout.margin.horizontal+g;let b=t.x,x=t.y,w=r.x-t.x;for(let e=0;e<d.length;e++){let n=s({y:x,x:"rtl"===c?r.x+w+r.width-g-(b-t.x):b,item:d[e],globalMetrics:u,direction:c,createSymbol:l});if((h&&b>=r.x-g||!h&&x>=r.y-m)&&f.push(n.item),p++,p>=a?(p=0,h?(b+=v,x=t.y):(x+=y,b=t.x)):h?x+=y:b+=v,!h&&x>r.y+r.height)break;if(h&&b>r.x+r.width)break}return f}(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",s=n.globalMetrics.maxItemBounds[i]*r+(r-1)*n.layout.margin[o];let a=Math.ceil(s/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]));a=Math.min(a,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(a,l))}(e,t,n),r),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return FQ(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,FQ(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,a())},offset:()=>l,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>FQ(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 $Q(e){return Object.keys(e).filter(t=>e[t]).join(" ")}const BQ={up:"▲",right:"▶",down:"▼",left:"◀"};function VQ(e,t){let n=t.size,r=t.isActive,i=t.direction,o=t.nav,s={},a="";const l=t.attrs;o&&o.button&&("function"==typeof o.button.class?s=o.button.class({direction:i}):o.button.class&&(s=o.button.class),"function"==typeof o.button.content&&(a=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(s).length||(c.border="0",c.background="none"),(!r||o&&o.disabled)&&(l.disabled="disabled"),e("button",m$({class:$Q(s),style:c},l),[a||e("span",{style:{pointerEvents:"none"}},[BQ[i]])])}function HQ(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 s=e.renderArgs[0],a="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void e.render([]);const d=a?["right","left"]:["down","up"];l&&a&&d.reverse();const h=[s("div",{style:{position:"relative",display:"flex","flex-direction":a?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!a?"rtl":"ltr"},[VQ(s,{size:32,isActive:c,direction:d[0],attrs:{"data-action":"next","data-component-key":r.settings.key},nav:n.navigation}),VQ(s,{size:32,isActive:u,direction:d[1],attrs:{"data-action":"prev","data-component-key":r.settings.key},nav:n.navigation})])];e.render(h)}(n.renderer,r,t,e),extent:()=>32,spread:()=>64};return n}function GQ(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=m$({},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(m$({},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 UQ(e,t,n,r){let i,o,s,a=r.itemRenderer,l=r.navigationRenderer,c=r.titleRenderer,u=r.isPreliminary,d=void 0!==u&&u,h=0;const p={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(i={x:p.x,y:p.y,width:p.width,height:c.spread()},"horizontal"===n){i={x:p.x,y:p.y,width:c.extent(),height:c.spread()};const e=p.width-i.width-(i.width?t.spacing:0),n=p.height;a.parallelize(e,d?void 0:n);const r=a.extent()>e?l.extent():0,u=a.spread(),f=r?l.spread():0;o={x:i.x+i.width+(i.width?t.spacing:0),y:p.y+Math.max(0,(f-u)/2),width:p.width-r-i.width-(r?t.spacing:0)-(i.width?t.spacing:0),height:n},s={x:o.x+o.width+(r?t.spacing:0),y:p.y,width:r,height:p.height},i.y=o.y;"rtl"===a.direction()&&(s.x=p.x,o.x=s.x+s.width+(s.width?t.spacing:0),i.x=o.x+o.width+(i.width?t.spacing:0)),h=Math.max(i.height,f,a.spread())}else{const e=p.height-i.height-(i.height?t.spacing:0),n=p.width;a.parallelize(e,d?void 0:n);const r=a.extent()>e?l.extent():0;s={x:p.x,y:p.y+p.height-r,width:p.width,height:r},o={x:p.x,y:i.y+i.height+(i.height?t.spacing:0),width:p.width,height:p.height-i.height-(i.height?t.spacing:0)-s.height-(s.height?t.spacing:0)},h=Math.max(c.extent(),r?l.spread():0,a.spread())}return o=m$({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),s.x+=e.x,s.y+=e.y,i.x+=e.x,i.y+=e.y,{title:m$({},e,i),content:m$({},e,o),navigation:m$({},e,s),orientation:n,preferredSize:h}}function YQ(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?m$({},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:m$(!0,{},jQ.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:jQ.layout,settings:e.settings.settings.layout}),s=e.resolver.resolve({data:n,defaults:m$(!0,{},jQ.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),a=m$(!0,{},(e.settings.settings.item||{}).shape);void 0===a.fill&&e.settings.scale&&(a.fill={scale:e.settings.scale});const l=e.resolver.resolve({data:n,defaults:m$(!0,{},jQ.item.shape,e.style.item.shape),settings:a}),c=e.resolver.resolve({data:n,defaults:m$(!0,{},{show:jQ.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:s,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 KQ(e){const t=e.rect,n=e.settings,r=e.state,i=e.itemRenderer,o=e.navigationRenderer,s=e.titleRenderer,a=n.layout.dock,l="top"===a||"bottom"===a?"horizontal":"vertical",c=UQ(t,r.display,l,{itemRenderer:i,navigationRenderer:o,titleRenderer:s});e.renderer.size(c.content);let u=i.getItemsToRender({viewRect:m$({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:i}),s.render({rect:c.title}),e.state.views={layout:c},u}const XQ={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=KQ(this);this.update(e)},this.itemRenderer=WQ(this,{onScroll:this.onScroll}),this.navigationRenderer=HQ(this),this.titleRenderer=GQ(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),YQ(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,s=UQ(t.inner,o,i,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=s.preferredSize,n+=o.spacing,n}(this,e)},beforeUpdate(){YQ(this)},render(){return KQ(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 JQ(e,t){let n=0;const r=e.state.isVertical?"justify":"align",i=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",s=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[s](),n*=Math.min(1,Math.max(e.stgns[r],0)),t[i]+=n}function ZQ(e,t,n){const r=n[e];return"object"==typeof r?-1!==r.valid.indexOf(t)?t:r.default:n.default}function QQ(e){return ZQ(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 e0(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 t0(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),s=function(e){return ZQ(e.layout.dock,e.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"})}(e.settings);if(void 0===n.text){const e=i.data().fields;n.text=e&&e[0]?e[0].title():""}const a=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),l=e.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),c={isVertical:t,nodes:[],title:{anchor:QQ(e.settings),textMetrics:a,textBounds:l,requiredWidth:()=>{if(!n.show)return 0;let e=l.width,r=n.maxLengthPx;return t||(e+=n.padding,r+=n.padding),Math.min(e,r,c.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let e=l.height;return t&&(e+=n.padding),Math.min(e,c.rect.height)}},ticks:{values:o,anchor:s,length:Math.min(Math.max(...o.map(e=>e.textMetrics.width)),e.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===s?Math.max(...c.ticks.values.map(e=>e.textMetrics.height))+e.stgns.tick.padding:0,height:Math.max(...o.map(e=>e.textMetrics.height))},legend:{fillScale:r,majorScale:i,length:()=>{const n=t?"height":"width",r=t?"requiredHeight":"requiredWidth",i=Math.min(c.rect[n],c.rect[n]*e.stgns.length)-c.title[r]();return Math.max(0,Math.min(i,e.stgns.maxLengthPx))}}};return c}const n0={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=e0(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=t0(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=t0(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=e0(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,s=t.rect.y,a="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,s+=t.title.textMetrics.height,s+=i?t.rect.height-t.title.textBounds.height:0,a="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,s+=t.title.textMetrics.height,s+=i?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=r?t.rect.width:0,s+=t.title.textMetrics.height,a=r?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(s,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:a,title:n.title.text};return JQ(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,s=i.y,a=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&&(s+=n.rect.height-r.size),"top"===n.title.anchor?s+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());const c={type:"rect",x:o,y:s,width:a,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return JQ(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"},s=n.ticks.values.map(s=>{let a=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=t.y+t.height*s.pos,u=0===s.pos?"text-before-edge":"text-after-edge"):a=t.x+t.width*s.pos,"right"===n.ticks.anchor?(a=t.x+r.size+r.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(a=t.x-r.tick.padding,i="end"):"top"===n.ticks.anchor?(l=t.y-r.tick.padding,c-=.25*s.textMetrics.height,i=0===s.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+r.tick.padding,c=.8*s.textMetrics.height,i=0===s.pos?"start":"end",o.y=t.y+t.height),{type:"text",x:a,y:l,dx:0,dy:c,text:s.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:s.label,baseline:u}});return{type:"container",id:"legend-seq-ticks",children:[...s,o]}}(this,n),i={id:"legend-seq-target",type:"container",children:[n,r]};this.state.nodes.push(i)},render(){return this.state.nodes}};const r0={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 i0(e,t){let n=t.generatorType,r=t.item,i=t.data,o=t.major,s=t.minor,a=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:s,layerObj:a,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 o0(e){const t=function(e){let t=e.data,n=e.stngs,r=e.rect,i=e.resolver,o=e.style,s=e.domain;const a=r.width,l=r.height,c=i.resolve({data:t,defaults:r0.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:a,minor:"vertical"===n.orientation?a:l}}),u=!n.connect&&s.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),d={};let h=0;for(let e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(u){const e=d[n]?d[n].items[d[n].items.length-1]:null,r=e?s.indexOf(e.data.major?e.data.major.value:e.data.value):null;e&&s.indexOf(t.data.major?t.data.major.value:t.data.value)-1!==r&&d[n].items.push({dummy:!0})}d[n]=d[n]||{order:h++,id:n,items:[],dataItems:[],consumableData:{}},d[n].dataItems.push(t.data),d[n].items.push(t)}const p=Object.keys(d).map(e=>(d[e].consumableData=x$({points:d[e].dataItems},d[e].dataItems[0]),d[e])),f={items:p.map(e=>e.consumableData)},m=n.layers||{};return{coordinates:c,metaLayers:p,layers:i.resolve({data:f,defaults:{curve:r0.layers.curve,show:r0.layers.show},settings:{curve:m.curve,show:m.show}}),lines:i.resolve({data:f,defaults:m$({},r0.layers.line,o.line),settings:m.line}),areas:i.resolve({data:f,defaults:m$({},r0.layers.area,o.area),settings:m.area})}}(e),n=t.metaLayers,r=t.coordinates,i=t.layers,o=t.lines,s=t.areas,a=[];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,h;for(let n=0;n<t.items.length;n++){if(d=t.items[n],h=d.data,!d.dummy){if(isNaN(d.major))continue;e.missingMinor0&&(d.minor0=r.settings.minor.scale?r.settings.minor.scale(h.minor0?h.minor0.value:0):0),isNaN(d.minor)||c.push(d.minor),l.data.push(d.data)}u.push(d)}const p=c.sort((e,t)=>e-t)[Math.floor((c.length-1)/2)];a.push({layerObj:l,lineObj:o.items[n],areaObj:s.items[n],median:p,points:u,consumableData:t.consumableData})}),a}const s0={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,s=o0({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=s.map(e=>({id:e.layerObj.id,data:e.layerObj.data})).sort(this.stngs.layers.sort).map(e=>e.id);s.sort((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id))}else s.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 s=[],a=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"},h={size:n,p:"x"};if("vertical"===o.orientation){const e=m$(!0,{},h);h=m$(!0,{},d),d=m$(!0,{},e)}a.area&&!1!==c.show&&s.push(i0(u,{data:e.consumableData,item:c,generatorType:"area",major:h,minor:d,layerObj:l,stngs:o})),t&&!1!==t.show&&(s.push(i0(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"1"),major:h,minor:d,layerObj:l,stngs:o},"none")),!i&&a.area&&!1!==c.show&&!1!==t.showMinor0&&s.push(i0(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"0"),major:h,minor:d,layerObj:l,stngs:o},"none")))}),s}(s,{width:r,height:i,missingMinor0:o,stngs:this.stngs})}};function a0(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,s=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(s,e.rect.height)):s}}function l0(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function c0(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 u0={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=a0(this,e,!1);FK({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=function(e){return e.settings.brush.components.map(e=>({key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"}))}(this.settings),this.state.start=a0(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=a0(this,e),function(e){if(e.state.active){const t=l0(e,e.state.start),n=l0(e,e.state.end),r=e.chart.shapesAt(c0(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(r,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([m$({type:"rect"},c0(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 d0(e,t,n){let r=n.renderer,i=n.style,o=n.props,s=n.h;const a=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})}(s,e,i,o),c=s("div",{dir:o.direction,class:$Q(m$({"pic-tooltip":!0},a.tooltip)),style:m$({position:"relative",display:"inline-block"},t.computedTooltipStyle)},s("div",{style:i.content,class:$Q(m$({"pic-tooltip-content":!0},a.content))},l),s("div",{class:$Q(m$({"pic-tooltip-arrow":!0},a.arrow)),style:m$({},i.arrow,i["arrow-".concat(t.dock)],t.computedArrowStyle)}));return r.render(c),r.element().children[0]}function h0(e){let t=e.defaultDuration,n=e.defaultDelay,r=null,i=null,o=!1;const s=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}(),a=function(){},l=()=>{r=null,i=null,o=!1,s.set("fulfilled")};return a.invoke=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;r&&(clearTimeout(r),s.set("debounced")),s.set("pending"),r=setTimeout(()=>{e(),o=!0,r=null,s.set("active")},c),a>0&&(i&&clearTimeout(i),i=setTimeout(l,a+Math.max(c,0)))},a.clear=()=>{o?s.set("cancelled"):r&&(clearTimeout(r),s.set("rejected")),i&&clearTimeout(i),r=null,i=null,o=!1},a.on=(e,t)=>{s.on(e,t)},a.destroy=()=>{a.clear(),s.destroy()},a}function p0(){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 f0(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 m0(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 g0(e,t,n,r,i,o){const s=t+o.x,a=n+o.y,l=i;return!(s<0||a<0)&&!(s+r>e.width||a+l>e.height)}function y0(e){let t=e.area,n=e.vx,r=e.vy,i=e.width,o=e.height,s=e.offset;const a=n+s.x,l=r+s.y,c=i,u=o;let d=a<0?-a:0,h=l<0?-l:0;return d+=a+c>t.width?-(a+c-t.width):0,h+=l+u>t.height?-(l+u-t.height):0,{x:d,y:h}}function v0(e){let t=e.options,n=e.pointer,r=e.width,i=e.height,o=e.dockOrder,s=e.x,a=e.y;const l=n.targetBounds,c=p0(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(s,"px"),top:"".concat(a,"px"),transform:u},computedArrowStyle:m0(t.offset)[t.dock],dock:t.dock};const d={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},h=f0(r,i,t.offset),p=[],f="target"===t.area?s:l.left+s,m="target"===t.area?a:l.top+a;for(let e=0;e<o.length;e+=1){const n=o[e],l=y0({area:d,vx:f,vy:m,width:r,height:i,offset:h[n]}),u={left:"".concat(s,"px"),top:"".concat(a,"px"),transform:c[n]},g=m0(t.offset)[n];0!==l.x&&(u.width="".concat(r-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(s+l.x,"px"),g.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:g,dock:n,rect:{width:r,height:i}};if(0===l.x&&0===l.y)return y;y.offset=l,p.push(y)}return p.sort((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x)),p[0]}function b0(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 m$({scaleRatio:i.scaleRatio},i.computedInner)}const x0={bounds:function(e){let t=e.resources,n=e.nodes,r=e.pointer,i=e.width,o=e.height,s=e.options;const a=r.targetBounds,l=t.getNodeBoundsRelativeToTarget(n[0]),c=l.x,u=l.y,d=l.width,h=l.height,p={left:{x:c,y:u+h/2},right:{x:c+d,y:u+h/2},top:{x:c+d/2,y:u},bottom:{x:c+d/2,y:u+h},inside:{x:c+d/2,y:u+h/2}},f=p0(s.offset),m=f[s.dock];if(m)return{computedTooltipStyle:{left:"".concat(p[s.dock].x,"px"),top:"".concat(p[s.dock].y,"px"),transform:m},computedArrowStyle:m0(s.offset)[s.dock],dock:s.dock};const g={width:"target"===s.area?a.width:window.innerWidth,height:"target"===s.area?a.height:window.innerHeight},y=f0(i,o,s.offset),v=["top","left","right","bottom","inside"];for(let e=0;e<v.length;e+=1){const t=v[e];if(g0(g,"target"===s.area?p[t].x:a.left+p[t].x,"target"===s.area?p[t].y:a.top+p[t].y,i,o,y[t]))return{computedTooltipStyle:{left:"".concat(p[t].x,"px"),top:"".concat(p[t].y,"px"),transform:f[t]},computedArrowStyle:m0(s.offset)[t],dock:t}}const b=function(e){let t=e.options,n=e.docks,r=e.dockOffsets,i=e.targetBounds,o=e.area,s=e.width;const a="top",l="target"===t.area?n[a].x:i.left+n[a].x,c=("target"===t.area?n[a].y:(i.top,n[a].y),r[a]),u=l+c.x,d=(c.y,s);let h=n.top.x;return u<0&&u+d>o.width||(u<0?h-=u:u+d>o.width&&(h-=u+d-o.width)),h}({options:s,docks:p,dockOffsets:y,targetBounds:a,area:g,width:i});return{computedTooltipStyle:{left:"".concat(b,"px"),top:"".concat(p.top.y,"px"),transform:f.top},computedArrowStyle:m0(s.offset+b-p.top.x,s.offset).top,dock:"top"}},pointer:function(e){let t=e.options,n=e.pointer,r=e.width,i=e.height;return v0({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,s=e.resources;const a=o[0],l=n.dx,c=n.dy,u=s.getComponentBoundsFromNode(a),d=l+u.x+u.width/2,h=c+u.y+u.height/2,p=a.desc.slice,f=p.start,m=p.end,g=p.outerRadius,y=(f+m)/2-Math.PI/2,v=2*Math.PI,b=(y%v+v)%v;let x=["top","left","right","bottom"];return"auto"===t.dock&&(x=b<=Math.PI/4||b>=7*Math.PI/4?["right","top","bottom","left"]:b<=3*Math.PI/4?["bottom","left","right","top"]:b<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),v0({x:d+g*u.scaleRatio.x*Math.cos(b),y:h+g*u.scaleRatio.y*Math.sin(b),pointer:n,width:r,height:i,options:t,dockOrder:x})}};function w0(e,t){let n=e.width,r=e.height,i=t.chart,o=t.state,s=t.props;const a={resources:{formatter:i.formatter,scale:i.scale,component:i.component,getComponentBoundsFromNode:e=>b0(e,o.pointer,i),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const r=b0(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 s.placement;if("object"===l&&"function"==typeof s.placement.fn)return s.placement.fn(a);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=m$(c,s.placement(a))),"object"===l&&x0[s.placement.type]?c=m$(c,s.placement):"string"===l&&x0[s.placement]&&(c=m$(c,{type:s.placement})),a.options=c;const u=x0[c.type](a);let d=a.resources.getComponentBoundsFromNode(a.nodes[0]),h=d.x,p=d.y,f=d.width,m=d.height;return h+=a.pointer.dx,f+=h,p+=a.pointer.dy,m+=p,u.computedTooltipStyle.left="".concat(Math.min(Math.max(0,h,parseFloat(u.computedTooltipStyle.left)),f),"px"),u.computedTooltipStyle.top="".concat(Math.min(Math.max(0,p,parseFloat(u.computedTooltipStyle.top)),m),"px"),u}let S0;function C0(){S0=null}const E0={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 M0={require:["chart","renderer"],defaultSettings:{settings:E0,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 s=n.element.getBoundingClientRect(),a=r.targetElement.getBoundingClientRect(),l=i,c=o,u=s.left-a.left,d=s.top-a.top,h=i-s.left,p=o-s.top;return i-=a.left,o-=a.top,{x:i,y:o,dx:u,dy:d,cx:h,cy:p,clientX:l,clientY:c,targetBounds:a,chartBounds:s}}(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=h0({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",()=>{!function(e){S0&&S0!==e&&S0()}(t),S0=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,m$({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,m$({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),S0===t&&(S0=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(),C0()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),C0()},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 s={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:r,h:o},a=[];return e.forEach(e=>{if("function"==typeof i.extract){const t=m$({node:e},s);a.push(i.extract(t))}}),a}(e,this),n=w0(d0(t,{},this).getBoundingClientRect(),this);this.state.tooltipElm=d0(t,n,this)}};const k0={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()}},I0={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},R0=/([astvzqmhlc])([^astvzqmhlc]*)/gi,_0=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function D0(e){const t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(R0,(e,n,r)=>{const i=function(e){const t=e.match(_0);return t?t.map(Number):[]}(r);let o=n.toLowerCase(),s=n;if("m"===o&&i.length>2&&(t.push([s,...i.splice(0,2)]),o="l",s="m"===s?"l":"L"),i.length<I0[o])return"";for(t.push([s,...i.splice(0,I0[o])]);i.length>=I0[o]&&i.length&&I0[o];)t.push([s,...i.splice(0,I0[o])]);return""}),t}const A0=2*Math.PI;function P0(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function L0(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 T0(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 s=P0(e,t),a=P0(t,n),l=P0(n,r),c={x:L0(.5,e.x,t.x,n.x,r.x),y:L0(.5,e.y,t.y,n.y,r.y)},u=P0(s,a),d=P0(a,l);return T0(e,s,u,c,i,o-1),T0(c,d,l,r,i,o-1),i}function O0(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 T0(e,r.cp1,r.cp2,n)}function q0(e,t,n){const r=[],i=!!e[4],o=!!e[5],s=e[3];let a,l,c,u,d=e[6],h=e[7],p=e[1],f=e[2];if("a"===e[0]&&(d+=t,h+=n),t===h&&n===h)return r;if(!p||!f)return r.push({x:d,y:h}),r;var m=function(e,t,n,r,i,o,s,a,l){let c,u,d,h,p,f;const m=eK(n%360),g=Math.cos(m),y=Math.sin(m),v=(a-o)/2,b=(l-s)/2,x=g*v+y*b,w=g*b-y*v;f=x**2/(e=Math.abs(e))**2+w**2/(t=Math.abs(t))**2,f>1&&(f=Math.sqrt(f),e*=f,t*=f);const S=e*w,C=t*x,E=S**2+C**2,M=(e*t)**2-E;let k=Math.sqrt(Math.max(M/E,0));r===i&&(k=-k);const I=k*(S/t),R=k*(-C/e);h=g*I-y*R+(a+o)/2,p=y*I+g*R+(l+s)/2;const _=(x-I)/e,D=(w-R)/t,A=(-x-I)/e,P=(-w-R)/t;return c=Math.atan2(D,_),c+=c<0?A0:0,u=Math.atan2(P,A),u+=u<0?A0:0,d=u-c,!i&&c<u?d-=A0:i&&u<c&&(d+=A0),d%=A0,{startAngle:c,sweepAngle:d,cx:h,cy:p,rx:e,ry:t}}(p,f,s,i,o,d,h,t,n);a=m.cx,l=m.cy,p=m.rx,f=m.ry,c=m.sweepAngle,u=m.startAngle;const g=Math.abs(c*Math.sqrt((p**2+f**2)/2)),y=Math.ceil(g/10),v=c/y;for(let e=1;e<=y;e++){const t=(u+v*e)%A0,n=Math.cos(t),i=Math.sin(t);r.push({x:a+n*p+-i*n,y:l+i*f+n*i})}return r}function N0(e){const t=D0(e),n=[],r=[];let i=0,o=0,s=null,a=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&&(s=null,a=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(...q0(u,i,o)),i+=u[6],o+=u[7];break;case"A":r.push(...q0(u,i,o)),i=u[6],o=u[7];break;case"c":r.push(...T0({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})),s=u[3]+i,a=u[4]+o,i+=u[5],o+=u[6];break;case"C":r.push(...T0({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),s=u[3],a=u[4],i=u[5],o=u[6];break;case"s":null!==s&&null!==s||(s=i,a=o),r.push(...T0({x:i,y:o},{x:2*i-s,y:2*o-a},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),s=u[1]+i,a=u[2]+o,i+=u[3],o+=u[4];break;case"S":null!==s&&null!==s||(s=i,a=o),r.push(...T0({x:i,y:o},{x:2*i-s,y:2*o-a},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),s=u[1],a=u[2],i=u[3],o=u[4];break;case"Q":r.push(...O0({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(...O0({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(...O0({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(...O0({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 j0={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=>{N0(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 z0=[function(e){e.component("box",FX),e.component("box-marker",FX)},function(e){e.component("point",YX),e.component("point-marker",YX)},function(e){e.component("pie",ZX)},function(e){e.component("grid-line",rJ)},function(e){e.component("ref-line",fJ)},function(e){e.component("axis",BJ)},function(e){e.component("container",VJ)},function(e){e.component("text",UJ)},function(e){e.component("scrollbar",XJ)},function(e){e.component("brush-range",dZ),e.component("brush-area-dir",mZ)},function(e){e.component("range",bZ)},function(e){e.component("brush-lasso",MZ)},function(e){e.component("labels",NQ)},function(e){e.component("legend-cat",XQ)},function(e){e.component("legend-seq",n0)},function(e){e.component("line",s0)},function(e){e.component("brush-area",u0)},function(e){e.component("tooltip",M0)},function(e){e.component("debug-collider",k0)},function(e){e.component("debug-path-to-points",j0)}];let F0=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 W0{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,s=void 0===o?0:o,a=e.height,l=void 0===a?0:a,c=e.minWidth,u=void 0===c?0:c,d=e.minHeight,h=void 0===d?0:d;this.set({x:n,y:i,width:s,height:l,minWidth:u,minHeight:h})}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,s=void 0===o?0:o,a=e.height,l=void 0===a?0:a,c=e.minWidth,u=void 0===c?0:c,d=e.minHeight,h=void 0===d?0:d;this.type="rect",s>=0?(this.x=n,this.width=Math.max(s,u)):(this.x=n+Math.min(s,-u),this.width=-Math.min(s,-u)),l>=0?(this.y=i,this.height=Math.max(l,h)):(this.y=i+Math.min(l,-h),this.height=-Math.min(l,-h))}containsPoint(e){return FK(this,e)}intersectsLine(e){return WK(this,_$(e))}intersectsRect(e){return jK(this,R$(e))}intersectsCircle(e){return PK(e,this)}intersectsPolygon(e){return NK(e,this)}intersectsGeoPolygon(e){return KK(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 $0{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,s=void 0===o?0:o,a=e.minRadius,l=void 0===a?0:a;this.set({cx:n,cy:i,r:s,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,s=void 0===o?0:o,a=e.minRadius,l=void 0===a?0:a;this.type="circle",this.cx=n,this.cy=i,this.r=Math.max(s,l),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return AK(this,e)}intersectsLine(e){return LK(this,_$(e))}intersectsRect(e){return PK(this,R$(e))}intersectsCircle(e){return n=e,!IK(t=this)&&!IK(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return TK(this,e)}intersectsGeoPolygon(e){return GK(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class B0{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,s=void 0===o?0:o,a=e.y2,l=void 0===a?0:a,c=e.tolerance,u=void 0===c?0:c;this.set({x1:n,y1:i,x2:s,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,s=void 0===o?0:o,a=e.y2,l=void 0===a?0:a,c=e.tolerance,u=void 0===c?0:c;this.type="line",this.x1=n,this.y1=i,this.x2=s,this.y2=l,this.tolerance=Math.max(0,Math.round(u)),this.vectors=this.points(),this.zeroSize=n===s&&i===l}containsPoint(e){if(this.tolerance>0){return LK({cx:e.x,cy:e.y,r:this.tolerance},this)}return BK(this,e)}intersectsLine(e){return $K(this,_$(e))}intersectsRect(e){return WK(R$(e),this)}intersectsCircle(e){return LK(e,this)}intersectsPolygon(e){return qK(e,this)}intersectsGeoPolygon(e){return YK(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class V0{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 OK(this,e)}intersectsCircle(e){return TK(e,this)}intersectsLine(e){return qK(this,_$(e))}intersectsRect(e){return NK(this,R$(e))}intersectsPolygon(e){return VK(this,e)}intersectsGeoPolygon(e){return HK(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 H0(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new V0(...t)}function G0(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function U0(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 Y0{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++)U0(this.vertices[e]),this.vertices[e].length>2&&G0(this.vertices[e]),this.polygons[e]=H0({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 UK(this,e)}intersectsCircle(e){return GK(e,this)}intersectsLine(e){return YK(this,_$(e))}intersectsRect(e){return KK(this,R$(e))}intersectsPolygon(e){return HK(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!jK(n,r)&&(zK(r,n)?DK(t,e):DK(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 K0(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Y0(...t)}function X0(e,t){return e.x!==t.x||e.y!==t.y}class J0{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++)X0(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=>BK(t,e))}intersectsCircle(e){return this.segments.some(t=>LK(e,t))}intersectsLine(e){const t=_$(e);return this.segments.some(e=>$K(e,t))}intersectsRect(e){const t=R$(e);return this.segments.some(e=>WK(t,e))}intersectsPolygon(e){return this.segments.some(t=>qK(e,t))}intersectsGeoPolygon(e){return this.segments.some(t=>YK(e,t))}points(){return this._points}}const Z0=qB();function Q0(e,t){return Z0.get(e)(t)}Z0.add("rect",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new W0(...t)}),Z0.add("circle",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new $0(...t)}),Z0.add("line",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new B0(...t)}),Z0.add("polygon",H0),Z0.add("geopolygon",K0),Z0.add("polyline",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new J0(...t)});class e1{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=Q0(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 t1{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new t1).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 t1&&(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],s=this._elements[2][0],a=this._elements[2][1],l=this._elements[2][2],c=0;return c=e*i*l+t*o*s+n*r*a-n*i*s-t*r*l-e*o*a,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],s=this._elements[1][2],a=this._elements[2][0],l=this._elements[2][1],c=this._elements[2][2];return this._elements=[[o*c-s*l,r*l-n*c,n*s-r*o],[s*a-i*c,t*c-r*a,r*i-t*s],[i*l-o*a,a*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,s=this._elements,a=[];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]*s[n][r];a.push({x:o[0],y:o[1]})}return a}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 n1=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function r1(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 i1(e,t){const n=t.args[0],r=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,r)}function o1(e,t){const n=t.args[0],r=isNaN(t.args[1])?0:t.args[1];e.translate(n,r)}function s1(e,t){t.args.length>=6&&e.transform(...t.args)}function a1(e,t){const n=function(e){let t,n=[];for(;null!==(t=n1.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?r1(t,r):"scale"===r.cmd?i1(t,r):"matrix"===r.cmd?s1(t,r):"translate"===r.cmd&&o1(t,r)}const l1={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},c1={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 u1(e,t){if(!t||!t.length||!e||"function"!=typeof c1[e.type])return[];switch(e.type){case"type":case"tag":return c1[e.type](e.value,t);case"attr":return c1[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return c1[e.type](t);default:return[]}}var d1={find:function(e,t){const n=[],r=[];let i,o;if(t.isBranch){let s;i=function(e){const t=[];let n,r,i,o;return e.split(/\s*,\s*/).forEach(e=>{e=e.trim(),n=[];const s=t=>{i=e.match(l1[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(l1).forEach(s),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++){s=i[e];const t=[];let n=o.slice(),a=!1;s.reverse().forEach(e=>{if(" "===e.type)return t.push(n),n=o.slice(),void(a=!1);n=u1(e,n),a=!0}),a&&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 h1(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=R$(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=_$(i),o.type=r;else if("polygon"===r||"polyline"===r){o={type:"path",d:ZY(i,"polygon"===r)}}else if("geopolygon"===r){let e="";for(let t=0;t<i.length;t++)e+=ZY(i[t],!0);o={type:"path",d:e}}return o}class p1{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=>h1(e,t,n))}:h1(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map(e=>new p1(e)),this._parent=()=>e.parent?new p1(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,s=t.top;i-=r,o-=void 0===s?0:s}return n.x+=i,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function f1(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new p1(...t)}class m1{constructor(e){this._node=f1(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 g1(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new m1(...t)}function y1(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=g1(n);const e=n.parent;e&&"stage"!==e.type&&y1(e,t.parent)}}function v1(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))?K0(n):H0(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=g1(i);return y1(i,e),e}}return null}(e,t,r):function(e,t,n){if(e.collider[t](n)){const t=g1(e);return y1(e,t),t}return null}(e,t,r)}function b1(e,t,n,r){const i=e.length;for(let o=0;o<i;o++){const i=e[o],s=v1(i,t,r);s&&n.push(s),!i.children||s||i.collider||b1(i.children,t,n,r)}}function x1(e,t,n){const r=e.length;for(let i=0;i<r;i++){const r=e[i];if(null!==v1(r,t,n))return!0;if(r.children&&!r.collider)return x1(r.children,t,n)}return!1}function w1(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(D$(e)){case"circle":return n.cx=e.cx*t,n.cy=e.cy*t,n.r=e.r,["intersectsCircle",n];case"rect":return n=I$(e).map(e=>iK(e,t)),["intersectsRect",n];case"line":return n=k$(e).map(e=>iK(e,t)),["intersectsLine",n];case"point":return n=iK(e,t),["containsPoint",n];case"polygon":return n.vertices=e.vertices.map(e=>iK(e,t)),["intersectsPolygon",n];case"geopolygon":return n.vertices=e.vertices.map(e=>e.map(e=>iK(e,t))),["intersectsGeoPolygon",n];default:return[]}}function S1(e,t){const n=w$(w1(t,e.dpi),2),r=n[0],i=n[1],o=[];return r&&(b1([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 C1(e,t){const n=w$(w1(t,e.dpi),2);return x1([e],n[0],n[1])}class E1 extends F0{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 s,a;s=this.attrs,a=e,Object.keys(JY).forEach(e=>{const t=a[e];void 0!==t&&(s[JY[e]]=t)}),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=m$(!0,{},n)),"string"==typeof r&&(this.tag=r),"string"==typeof i&&(this.strokeReference=i),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return d1.find(e,this).map(e=>f1(e))}getItemsFrom(e){return S1(this,e)}containsPoint(e){return C1(this,e)}intersectsLine(e){return C1(this,e)}intersectsRect(e){return C1(this,e)}intersectsCircle(e){return C1(this,e)}intersectsPolygon(e){return C1(this,e)}intersectsGeoPolygon(e){return C1(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new t1;void 0!==this.attrs.transform&&a1(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new t1;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 e1(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=Q0("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=Q0(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class M1 extends F0{addChild(e){if(!(e&&e instanceof F0))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 k1=M1.prototype;class I1 extends E1{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=m$({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=w$(e.bounds(t),3),i=r[0],o=r[2],s=i.x,a=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)?s:Math.min(s,n.x),n.y=isNaN(n.y)?a:Math.min(a,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]=m$({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=k1.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=m$({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=k1.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=m$({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(k1.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=m$(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(k1.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=m$(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function R1(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new I1(...t)}class _1 extends I1{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const D1=M1.prototype,A1=["x1","x2","y1","y2","id","offset","style"];class P1 extends E1{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=A1.length;r!==i;r++)n=A1[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return D1.addChild.call(this,e)}addChildren(e){return D1.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 D1.removeChild.call(this,e),this}removeChildren(e){return D1.removeChildren.call(this,e),this}}function L1(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new P1(...t)}const T1=M1.prototype,O1=["patternUnits","x","y","width","height","id"];class q1 extends E1{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=O1.length;r!==i;r++)n=O1[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return T1.addChild.call(this,e)}addChildren(e){return T1.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 T1.removeChild.call(this,e),this}removeChildren(e){return T1.removeChildren.call(this,e),this}}class N1 extends E1{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,s=void 0===o?0:o,a=e.height,l=void 0===a?0:a,c=e.rx,u=void 0===c?0:c,d=e.ry,h=void 0===d?0:d,p=e.collider,f=m$({type:"rect",x:n,y:i,width:s,height:l},p);super.set(e),s>=0?(this.attrs.x=n,this.attrs.width=s):(this.attrs.x=n+s,this.attrs.width=-s),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),h>0&&(this.attrs.ry=h),this.collider=f,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=I$(this.attrs),n=w$(M$(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t),4),r=n[0],i=n[1],o=n[2],s=n[3];return this.__boundingRect[e]={x:r,y:i,width:o-r,height:s-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 j1 extends E1{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,s=void 0===o?0:o,a=e.collider,l=m$({type:"circle",cx:n,cy:i,r:s},a);super.set(e),this.attrs.cx=n,this.attrs.cy=i,this.attrs.r=s,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,s=n-i,a=r-o;let l=2*i,c=2*o,u=[{x:s,y:a},{x:s+l,y:a},{x:s+l,y:a+c},{x:s,y:a+c}];if(e&&this.modelViewMatrix){u=this.modelViewMatrix.transformPoints(u);const t=w$(M$(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 z1 extends E1{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,s=void 0===o?0:o,a=e.y2,l=void 0===a?0:a,c=e.collider;super.set(e),this.attrs.x1=n,this.attrs.y1=i,this.attrs.x2=s,this.attrs.y2=l;const u={type:"line",x1:n,y1:i,x2:s,y2:l};this.collider=m$(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=k$(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const n=w$(M$(t),4),r=n[0],i=n[1],o=n[2],s=n[3],a=r!==o||i!==s;return this.__boundingRect[e]={x:r,y:i,width:a?Math.max(1,o-r):0,height:a?Math.max(1,s-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 F1=Math.PI/2;function W1(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function $1(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const B1={step:function(e){return new _B(e,.5)},stepAfter:function(e){return new _B(e,1)},stepBefore:function(e){return new _B(e,0)},linear:aB,basis:function(e){return new fB(e)},cardinal:yB.tension(0),catmullRom:bB,monotonex:function(e){return new EB(e)},monotoney:function(e){return new MB(e)},natural:function(e){return new IB(e)}};function V1(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 H1 extends E1{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=iB();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,s=e.generatorType,a=uB(),l=o.coordinates?o.coordinates.defined:null;a[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(B1["monotone"===r.curve?"monotone".concat(t.p):r.curve]),l?a.defined(e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined):a.defined(e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor));const c=o.connect?i.filter(a.defined()):i,u=("area"===s?a:a[s]())(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=N0(this.attrs.d),this.segments.length>1&&this.segments.every(e=>V1(e)))return void(this.collider=m$({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach(t=>{if(t.length<=1);else if(V1(t))this.collider=m$({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 s=e[n-1],a=e[n],l=e[n+1],c=W1(a,s),u=W1(a,l),d=(c+u)/2,h=d+Math.PI,p=Math.max(d,h),f=Math.min(d,h),m=c>u;if(1===n){const e=W1(s,a);r.push($1(s,e-F1,t)),i.unshift($1(s,e+F1,t))}const g=m?p:f,y=m?f:p;if(r.push($1(a,g,t)),i.unshift($1(a,y,t)),n===o-1){const e=W1(l,a);r.push($1(l,e+F1,t)),i.unshift($1(l,e-F1,t))}}return{type:"polygon",vertices:[...r,...i]}}(t,n,e.collider)}else this.collider=m$({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:N0(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=w$(M$(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 G1(e){let t=e.data,n=e._boundingRect,r=e._textBoundsFn;return null!=t&&(n||r)}let U1=class extends E1{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,s=void 0===o?0:o,a=e.dy,l=void 0===a?0:a,c=e.textBoundsFn,u=e.text,d=e.title,h=e.collider,p=e.boundingRect,f=e.ellipsed;super.set(e),this.attrs.x=n,this.attrs.y=i,this.attrs.dx=s,this.attrs.dy=l,this.attrs.text=u,void 0!==d&&(this.attrs.title=String(d)),"object"==typeof p?this._textBoundsFn=()=>p:"function"==typeof c&&(this._textBoundsFn=c),"string"==typeof f&&(this.ellipsed=f),this.collider=m$({type:G1(this)?"bounds":null},h),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=I$(e),r=w$(M$(t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n),4),i=r[0],o=r[1],s=r[2],a=r[3];return this.__boundingRect[t]={x:i,y:o,width:s-i,height:a-o},this.__boundingRect[t]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}};class Y1 extends E1{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,s=void 0===o?0:o,a=e.height,l=void 0===a?0:a,c=e.rx,u=void 0===c?0:c,d=e.ry,h=void 0===d?0:d,p=e.src,f=e.collider,m=e.cx,g=void 0===m?0:m,y=e.cy,v=void 0===y?0:y,b=e.r,x=void 0===b?0:b,w=e.opacity,S=e.imageScalingFactor,C=e.imagePosition,E=e.symbol;let M;M="circle"===e.symbol?m$({type:"circle",cx:g,cy:v,r:x},f):m$({type:"bounds",x:n,y:i,width:s,height:l},f),super.set(e),s>=0?(this.attrs.x=n,this.attrs.width=s):(this.attrs.x=n+s,this.attrs.width=-s),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),h>0&&(this.attrs.ry=h),p&&(this.attrs.src=p),this.attrs.r=x,this.attrs.cx=g,this.attrs.cy=v,this.attrs.opacity=void 0!==w?w:1,this.attrs.imageScalingFactor=void 0!==S?S:1,this.attrs.imagePosition=C||"center-center",this.attrs.symbol=E||"rectangle",this.collider=M,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?m$(this.collider,{type:"circle",cx:e.cx,cy:e.cy,r:e.r}):m$(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=I$(this.attrs),n=w$(M$(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t),4),r=n[0],i=n[1],o=n[2],s=n[3];return this.__boundingRect[e]={x:r,y:i,width:o-r,height:s-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,s=2*n,a=[{x:r,y:i},{x:r+o,y:i},{x:r+o,y:i+s},{x:r,y:i+s}];if(e&&this.modelViewMatrix){a=this.modelViewMatrix.transformPoints(a);const t=w$(M$(a),4),n=t[0],r=t[1];o=t[2]-n,s=t[3]-r,this.__bounds[e]=[{x:n,y:r},{x:n+o,y:r},{x:n+o,y:r+s},{x:n,y:r+s}]}else this.__bounds[e]=a;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 K1=qB();function X1(e,t){return K1.get(e)(t)}K1.add("rect",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new N1(...t)}),K1.add("circle",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new j1(...t)}),K1.add("text",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new U1(...t)}),K1.add("line",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new z1(...t)}),K1.add("path",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new H1(...t)}),K1.add("stage",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new _1(...t)}),K1.add("container",R1),K1.add("defs",R1),K1.add("linearGradient",L1),K1.add("radialGradient",L1),K1.add("conicGradient",L1),K1.add("stop",L1),K1.add("pattern",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new q1(...t)}),K1.add("image",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Y1(...t)});const J1=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 s="";for(let t=0;t<e.length;t++)s=e[t],void 0!==i[s]&&(o[s]=i[s]);return m$(o,r),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function Z1(e,t){if(Array.isArray(t))for(let n=0,r=t.length;n<r;n++)t[n](e)}function Q1(e,t,n){e.node=n[t],e.index=t}function e2(e,t,n,r){let i=!1;const o={siblings:e,node:null,index:0};for(let s=0,a=e.length;s<a;s++){if(Q1(o,s,e),Z1(o,r.create),i="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,i)continue;o.node=J1.save(o.node);const a=X1(o.node.type,o.node);a&&(o.node.transform&&(n.save(),a1(o.node.transform,n)),n.isIdentity()||(a.modelViewMatrix=n.clone()),t.addChild(a),o.node.children&&e2(o.node.children,a,n,r),o.node.transform&&n.restore()),J1.restore()}}function t2(e){let t=e.items,n=e.stage,r=e.dpi,i=e.on,o=void 0===i?{}:i;return n||(n=X1("stage",r)),e2(t,n,new t1,o),n}function n2(e,t,n){const r=n.orientation,i=n.degree,o=n.stops,s=void 0===o?[]:o;let a=null;if("radial"===r){const n=t.boundingRect();a=e.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else if("conic"===r){const t=n.startAngle||0,r=n.x||0,i=n.y||0;a=e.createConicGradient(t,r,i)}else{const r=tK(i);["x1","x2","y1","y2"].forEach(e=>{e in n&&(r[e]=n[e])});const o=t.boundingRect();a=e.createLinearGradient(o.x+r.x1*o.width,o.y+r.y1*o.height,o.x+r.x2*o.width,o.y+r.y2*o.height)}for(let e=0,t=s.length;e<t;e++){let t=s[e];a.addColorStop(t.offset,t.color)}return a}function r2(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 i2(){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,s=e.margin,a=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!==s&&(l.margin.left=isNaN(s.left)?0:s.left,l.margin.top=isNaN(s.top)?0:s.top),"object"==typeof a&&["left","right","top","bottom"].forEach(e=>{!isNaN(a[e])&&a[e]>0&&(l.edgeBleed[e]=a[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 o2(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:_Q,textBounds:AQ,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function s2(e){return t=>{let n=t.node;"text"!==n.type||null==n.data||n.textBoundsFn||(n.textBoundsFn=e.textBounds)}}const a2=200,l2=200;class c2{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*a2,height:n.computedPhysical.height+2*l2},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 u2=qB();function d2(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function h2(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function p2(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function f2(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 s=o[0],a=o[1],l=o[2];if(s in t.attrs&&!(a in r)&&e[a]!==t.attrs[s]){const n=l?l(t.attrs[s]):t.attrs[s];"function"==typeof e[a]?e[a](n):e[a]=n}}for(let t=0,n=i.length;t<n;t++){const n=i[t];e[n]=r[n]}}function m2(e,t,n,r){for(let i=0,o=e.length;i<o;i++){let o=e[i],s={};t.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?s.fillStyle=n2(t,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(s.fillStyle=r.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?s.strokeStyle=n2(t,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(s.strokeStyle=r.patterns.create(o.attrs.stroke))),f2(t,o,n,s),o.modelViewMatrix&&p2(o.modelViewMatrix.elements,t),u2.has(o.type)&&u2.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&&m2(o.children,t,n,r),t.restore()}}function g2(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t2;const r={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let i,o=!1,s=i2();const a=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",d2]];let l;const c=o2();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 c2(e)),n.appendChild(e),e),c.getScene=r=>{const i=h2(t&&t.getContext()||e.getContext("2d")),o=s.scaleRatio.x,a=s.scaleRatio.y,l={type:"container",children:r,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*i*o,", ").concat(s.edgeBleed.top*i*a,")"):""};return 1===i&&1===o&&1===a||(l.transform+="scale(".concat(i*o,", ").concat(i*a,")")),n({items:[l],dpi:i,on:{create:[bQ(c.measureText),s2(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]||r2(e,t,n),r[i]):r2(e,t,n)},clear(){r={}}}}(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),d=h2(u),h=t&&r.transform();if(h)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:h}),t.apply(),!0;o&&(e.style.left="".concat(s.computedPhysical.x,"px"),e.style.top="".concat(s.computedPhysical.y,"px"),e.style.width="".concat(s.computedPhysical.width,"px"),e.style.height="".concat(s.computedPhysical.height,"px"),e.width=Math.round(s.computedPhysical.width*d),e.height=Math.round(s.computedPhysical.height*d),t&&t.updateSize({rect:s,dpiRatio:d,canvasBufferSize:r.canvasBufferSize}));const p=c.getScene(n),f=!i||!p.equals(i);l.clear();const m=o||f,g="function"==typeof r.progressive&&r.progressive();return m&&(g&&!g.isFirst||c.clear(),m2(p.children,u,a,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,g&&!g.isFirst&&p.children.unshift(...i.children),i=p,m},c.itemsAt=e=>i?i.getItemsFrom(e):[],c.findShapes=e=>i?i.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),i=null,c),c.size=e=>{if(e){const t=i2(e);JSON.stringify(s)!==JSON.stringify(t)&&(o=!0,s=t)}return s},c.destroy=()=>{e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),i=null},c}function y2(e,t){u2.add(e,t)}function v2(e,t){return Math.max(0,Math.min(e,t))}const b2=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),x2=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),w2=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function S2(e){return b2.test(e)}function C2(e){return x2.test(e)||w2.test(e)}function E2(e){let t,n,r=e?e.length:0;for(t=0;t<r;t++){if(n=e[t],S2(n))return"ltr";if(C2(n))return"rtl"}return"ltr"}const M2={start:"end",end:"start",center:"center",middle:"middle"};function k2(e,t){return"rtl"===t?M2[e]:e}function I2(e,t){if(I2.cache[e])return void t(I2.cache[e]);const n=new Image;n.src=e,n.onload=()=>{I2.cache[e]=n,t(n)},n.onerror=e=>{console.error("Image load error",e)}}function R2(e,t){const n=[];let r;const i=[],o=[],s=[];let a,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),a=e.map(c),l=t.map(c);for(let e=0,r=t.length;e<r;e++){-1===a.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]):s.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=R2([],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=R2(s[e].children||[],o[e].content.children||[]),o[e].object=s[e].object,o[e].children=o[e].diff.items;return r=o.concat(n),n.isTree=!0,i.isTree=!0,o.isTree=!0,s.isTree=!0,r.isTree=!0,{added:n,updatedNew:o,updatedOld:s,removed:i,items:r}}function _2(e,t,n){for(let r=0,i=e.length;r<i;r++)e[r].object=n(e[r].content.type,t)}function D2(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 A2(e,t,n,r){let i;for(let o=0,s=e.length;o<s;o++)i=e[o],null!==i.object&&void 0!==i.object&&(n(i.object,i.content),i.diff&&(_2(i.diff.added,i.object,t),D2(i.diff.removed,r),A2(i.diff.items,t,n,r)))}function P2(e,t,n,r,i,o){const s=R2(e,t);return _2(s.added,n,r),D2(s.removed,o),A2(s.items,r,i,o),s.items}I2.cache={},y2("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,s){o=v2(r/2,o>0?o:s),s=v2(i/2,s>0?s:o),e.moveTo(t,n+s),e.lineTo(t,n+i-s),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-s),e.lineTo(t+r,n+s),e.quadraticCurveTo(t+r,n,t+r-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+s)}(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()}),y2("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()}),y2("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()}),y2("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)}),y2("text",function(e,t){let n=t.g,r=t.ellipsed,i=t.doStroke;const o=r||xQ(e,_Q);n.font=[e["font-style"],e["font-weight"],e["font-size"],e["font-family"]].filter(e=>!!e).join(" ");const s=E2(e.text);n.canvas.dir!==s&&(n.canvas.dir=s);const a=k2("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);a&&n.textAlign!==a&&(n.textAlign=a);const l=wQ(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)}),y2("image",function(e,t){let n=t.g;const r=n.canvas,i=n.getTransform(),o=window.devicePixelRatio||1,s=r.clientWidth*o,a=r.clientHeight*o;r.width===s&&r.height===a||(r.width=s,r.height=a),I2(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,s=i-e.height/2;n.save(),n.beginPath(),n.arc(r,i,e.r,0,2*Math.PI),n.clip(),n.drawImage(t,o,s,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 L2="http://www.w3.org/2000/svg",T2=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(L2,"container"===e?"g":e);return t.appendChild(n),n},O2=e=>{e.parentNode&&e.parentNode.removeChild(e)};function q2(e){let t=e.element,n=e.attrs;return function(){const e=n.width,r=n.height,i=n.imagePosition,o=n.imageScalingFactor,s=n.symbol;let a=n.x,l=void 0===a?0:a,c=n.y,u=void 0===c?0:c,d=e>0?e:this.naturalWidth,h=r>0?r:this.naturalHeight;switch(o&&(d*=o,h*=o),i){case"top-center":u-=h/2;break;case"center-left":l-=d/2;break;case"center-right":l+=d/2;break;case"top-left":l-=d/2,u-=h/2;break;case"top-right":l+=d/2,u-=h/2;break;case"bottom-left":l-=d/2,u+=h/2;break;case"bottom-right":l+=d/2,u+=h/2;break;case"bottom-center":u+=h/2}if(t.setAttribute("width",d),t.setAttribute("height",h),t.setAttribute("x",l-d/2),t.setAttribute("y",u-h/2),t.setAttribute("preserveAspectRatio","none"),"circle"===s){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(L2,"defs"),e.firstChild),r=document.createElementNS(L2,"clipPath");r.setAttribute("id",n);const i=document.createElementNS(L2,"circle");i.setAttribute("cx",l),i.setAttribute("cy",u),i.setAttribute("r",Math.min(d,h)/2),r.appendChild(i),t.appendChild(r)}t.setAttribute("clip-path","url(#".concat(n,")"))}}}const N2=(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||xQ(t.attrs,_Q);const n=E2(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",k2(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(L2,"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=q2({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?wQ(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 j2{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 z2(){return new j2(P2,T2,N2,O2)}function F2(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 W2(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L2,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t2;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:z2)();let r,i,o,s=!1,a=i2();const l={transform:void 0,disableScreenReader:!1},c=o2(),u={type:"defs",children:[]},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F2,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(s=>{let a="";const l=o[s],c=t(l),u="picasso-pattern-".concat(r,"-").concat(c);if("undefined"!=typeof window&&(a=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(s,"Reference")]="url('".concat(a,"#").concat(u,"')")})},clear(){n={}}};return i}(u.children),h=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F2,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",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=t(i[o]),l="picasso-gradient-".concat(r,"-").concat(a);if(!n[a]){let t=i[o],r=t.orientation,s=t.degree,c=t.stops,u=void 0===c?[]:c,d={};void 0===s&&(s=90),"radial"===r?d.type="radialGradient":(d=tK(s),["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[a]=l}return"url('".concat(s,"#").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=a.scaleRatio.x,r=a.scaleRatio.y,i={type:"container",children:Array.isArray(e)?[...e,u]:e,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*n,", ").concat(a.edgeBleed.top*r,")"):""};return 1===n&&1===r||(i.transform+="scale(".concat(n,", ").concat(r,")")),t({items:[i],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},h.onCreate,d.onCreate,bQ(c.measureText),s2(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,s=t.horizontalMoving,a=t.verticalMoving;return i.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(r,", ").concat(o,", ").concat(s,", ").concat(a,")"),!0}i.style.transform="";l.disableScreenReader&&r.setAttribute("aria-hidden",!0),s&&(r.style.left="".concat(a.computedPhysical.x,"px"),r.style.top="".concat(a.computedPhysical.y,"px"),r.setAttribute("width",a.computedPhysical.width),r.setAttribute("height",a.computedPhysical.height)),h.clear(),d.clear(),u.children.length=0;const p=c.getScene(e),f=!o||!p.equals(o),m=s||f;return m&&(c.clear(),n.render(p.children,i)),s=!1,o=p,m},c.itemsAt=e=>o?o.getItemsFrom(e):[],c.findShapes=e=>o?o.findShapes(e):[],c.clear=()=>{if(!i)return c;o=null;const e=i.cloneNode(!1);return r.replaceChild(e,i),i=e,c},c.destroy=()=>{r&&r.parentNode&&r.parentNode.removeChild(r),r=null,i=null},c.size=e=>{if(e){const t=i2(e);JSON.stringify(a)!==JSON.stringify(t)&&(s=!0,a=t)}return a},c}var $2,B2,V2,H2,G2,U2,Y2,K2={},X2=[],J2=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Z2(e,t){for(var n in t)e[n]=t[n];return e}function Q2(e){var t=e.parentNode;t&&t.removeChild(e)}function e5(e,t,n){var r,i,o,s={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?$2.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===s[o]&&(s[o]=e.defaultProps[o]);return t5(e,s,r,i,null)}function t5(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?++V2:i};return null==i&&null!=B2.vnode&&B2.vnode(o),o}function n5(e){return e.children}function r5(e,t){this.props=e,this.context=t}function i5(e,t){if(null==t)return e.__?i5(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?i5(e):null}function o5(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 o5(e)}}function s5(e){(!e.__d&&(e.__d=!0)&&H2.push(e)&&!a5.__r++||G2!==B2.debounceRendering)&&((G2=B2.debounceRendering)||U2)(a5)}function a5(){var e,t,n,r,i,o,s,a;for(H2.sort(Y2);e=H2.shift();)e.__d&&(t=H2.length,r=void 0,i=void 0,s=(o=(n=e).__v).__e,(a=n.__P)&&(r=[],(i=Z2({},o)).__v=o.__v+1,g5(a,o,i,n.__n,void 0!==a.ownerSVGElement,null!=o.__h?[s]:null,r,null==s?i5(o):s,o.__h),y5(r,o),o.__e!=s&&o5(o)),H2.length>t&&H2.sort(Y2));a5.__r=0}function l5(e,t,n,r,i,o,s,a,l,c){var u,d,h,p,f,m,g,y=r&&r.__k||X2,v=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(p=n.__k[u]=null==(p=t[u])||"boolean"==typeof p||"function"==typeof p?null:"string"==typeof p||"number"==typeof p||"bigint"==typeof p?t5(null,p,null,null,p):Array.isArray(p)?t5(n5,{children:p},null,null,null):p.__b>0?t5(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)){if(p.__=n,p.__b=n.__b+1,null===(h=y[u])||h&&p.key==h.key&&p.type===h.type)y[u]=void 0;else for(d=0;d<v;d++){if((h=y[d])&&p.key==h.key&&p.type===h.type){y[d]=void 0;break}h=null}g5(e,p,h=h||K2,i,o,s,a,l,c),f=p.__e,(d=p.ref)&&h.ref!=d&&(g||(g=[]),h.ref&&g.push(h.ref,null,p),g.push(d,p.__c||f,p)),null!=f?(null==m&&(m=f),"function"==typeof p.type&&p.__k===h.__k?p.__d=l=c5(p,l,e):l=u5(e,p,h,y,f,l),"function"==typeof n.type&&(n.__d=l)):l&&h.__e==l&&l.parentNode!=e&&(l=i5(h))}for(n.__e=m,u=v;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=d5(r).nextSibling),x5(y[u],y[u]));if(g)for(u=0;u<g.length;u++)b5(g[u],g[++u],g[++u])}function c5(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?c5(r,t,n):u5(n,r,r,i,r.__e,t));return t}function u5(e,t,n,r,i,o){var s,a,l;if(void 0!==t.__d)s=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),s=null;else{for(a=o,l=0;(a=a.nextSibling)&&l<r.length;l+=1)if(a==i)break e;e.insertBefore(i,o),s=o}return void 0!==s?s:i.nextSibling}function d5(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=d5(n)))return r;return null}function h5(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||J2.test(t)?n:n+"px"}function p5(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||h5(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||h5(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?m5:f5,o):e.removeEventListener(t,o?m5:f5,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 f5(e){return this.l[e.type+!1](B2.event?B2.event(e):e)}function m5(e){return this.l[e.type+!0](B2.event?B2.event(e):e)}function g5(e,t,n,r,i,o,s,a,l){var c,u,d,h,p,f,m,g,y,v,b,x,w,S,C,E=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,a=t.__e=n.__e,t.__h=null,o=[a]),(c=B2.__b)&&c(t);try{e:if("function"==typeof E){if(g=t.props,y=(c=E.contextType)&&r[c.__c],v=c?y?y.props.value:c.__:r,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in E&&E.prototype.render?t.__c=u=new E(g,v):(t.__c=u=new r5(g,v),u.constructor=E,u.render=w5),y&&y.sub(u),u.props=g,u.state||(u.state={}),u.context=v,u.__n=r,d=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=E.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=Z2({},u.__s)),Z2(u.__s,E.getDerivedStateFromProps(g,u.__s))),h=u.props,p=u.state,u.__v=t,d)null==E.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==E.getDerivedStateFromProps&&g!==h&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,v),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,v)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(e){e&&(e.__=t)}),b=0;b<u._sb.length;b++)u.__h.push(u._sb[b]);u._sb=[],u.__h.length&&s.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,v),null!=u.componentDidUpdate&&u.__h.push(function(){u.componentDidUpdate(h,p,f)})}if(u.context=v,u.props=g,u.__P=e,x=B2.__r,w=0,"prototype"in E&&E.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=Z2(Z2({},r),u.getChildContext())),d||null==u.getSnapshotBeforeUpdate||(f=u.getSnapshotBeforeUpdate(h,p)),C=null!=c&&c.type===n5&&null==c.key?c.props.children:c,l5(e,Array.isArray(C)?C:[C],t,n,r,i,o,s,a,l),u.base=t.__e,t.__h=null,u.__h.length&&s.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=v5(n.__e,t,n,r,i,o,s,l);(c=B2.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=a,t.__h=!!l,o[o.indexOf(a)]=null),B2.__e(e,t,n)}}function y5(e,t){B2.__c&&B2.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){B2.__e(e,t.__v)}})}function v5(e,t,n,r,i,o,s,a){var l,c,u,d=n.props,h=t.props,p=t.type,f=0;if("svg"===p&&(i=!0),null!=o)for(;f<o.length;f++)if((l=o[f])&&"setAttribute"in l==!!p&&(p?l.localName===p:3===l.nodeType)){e=l,o[f]=null;break}if(null==e){if(null===p)return document.createTextNode(h);e=i?document.createElementNS("http://www.w3.org/2000/svg",p):document.createElement(p,h.is&&h),o=null,a=!1}if(null===p)d===h||a&&e.data===h||(e.data=h);else{if(o=o&&$2.call(e.childNodes),c=(d=n.props||K2).dangerouslySetInnerHTML,u=h.dangerouslySetInnerHTML,!a){if(null!=o)for(d={},f=0;f<e.attributes.length;f++)d[e.attributes[f].name]=e.attributes[f].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||p5(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]||p5(e,o,t[o],n[o],r)}(e,h,d,i,a),u)t.__k=[];else if(f=t.props.children,l5(e,Array.isArray(f)?f:[f],t,n,r,i&&"foreignObject"!==p,o,s,o?o[0]:n.__k&&i5(n,0),a),null!=o)for(f=o.length;f--;)null!=o[f]&&Q2(o[f]);a||("value"in h&&void 0!==(f=h.value)&&(f!==e.value||"progress"===p&&!f||"option"===p&&f!==d.value)&&p5(e,"value",f,d.value,!1),"checked"in h&&void 0!==(f=h.checked)&&f!==e.checked&&p5(e,"checked",f,d.checked,!1))}return e}function b5(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){B2.__e(e,n)}}function x5(e,t,n){var r,i;if(B2.unmount&&B2.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||b5(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){B2.__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]&&x5(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||Q2(e.__e),e.__=e.__e=e.__d=void 0}function w5(e,t,n){return this.constructor(e,n)}function S5(){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=i2();const o={transform:void 0,disableScreenReader:!1},s=o2();return s.element=()=>n,s.root=()=>n,s.settings=e=>(e&&Object.keys(o).forEach(t=>{void 0!==e[t]&&(o[t]=e[t])}),o),s.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),s.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,s=t.horizontalMoving,a=t.verticalMoving;return n.style.transform="matrix(".concat(e,", ").concat(r,", ").concat(i,", ").concat(o,", ").concat(s,", ").concat(a,")"),!0}n.style.transform="";let s;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"),s=Array.isArray(e)?e5("div",null,e):e,r=function(e,t,n){var r,i,o;B2.__&&B2.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],g5(t,e=(!r&&n||t).__k=e5(n5,null,[e]),i||K2,K2,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?$2.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),y5(o,e)}(s,n,r),!0},s.renderArgs=[e5],s.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;r=null}return s},s.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,r=null},s.size=e=>(e&&(i=i2(e)),i),s}$2=X2.slice,B2={__e:function(e,t,n,r){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},V2=0,r5.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Z2({},this.state),"function"==typeof e&&(e=e(Z2({},n),this.props)),e&&Z2(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),s5(this))},r5.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),s5(this))},r5.prototype.render=n5,H2=[],U2="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Y2=function(e,t){return e.__v.__b-t.__v.__b},a5.__r=0;var C5=[function(e){e.renderer("svg",W2)},function(e){e.renderer("canvas",g2)},function(e){e.renderer("dom",S5)}];const E5={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const M5=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?E5.OFF:t,r=e.pipe,i=void 0===r?console:r,o=n;const s={[E5.OFF]:()=>{},[E5.ERROR]:function(){return i.error(...arguments)},[E5.WARN]:function(){return i.warn(...arguments)},[E5.INFO]:function(){return i.info(...arguments)},[E5.DEBUG]:function(){return i.log(...arguments)}},a=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];(s[e]||s[E5.DEBUG])(...n)}};return{log:a,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a(E5.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a(E5.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a(E5.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a(E5.DEBUG,...t)},level:e=>("number"==typeof e&&(o=e),o),LOG_LEVEL:E5}}(t.logger),i={component:qB(n.component,"component",r),data:qB(n.data,"data",r),formatter:qB(n.formatter,"formatter",r),interaction:qB(n.interaction,"interaction",r),renderer:EX(n.renderer),scale:qB(n.scale,"scale",r),symbol:qB(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:m$({},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=>CX(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=g$,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:MX,data:DX,formatter:sG,interaction:AX,renderer:EX(),scale:aY,symbol:pK});z0.forEach(M5.use),C5.forEach(M5.use),[].forEach(M5.use);const k5=M5();k5.use(s$),k5.renderer.prio(["canvas"]);const I5=(e,t)=>e&&"center"!==e&&"rtl"===t?Pj(e):e,R5=({cell:e,representation:t,textStyle:n,imageContainerHorizontalAlignment:r})=>{const{imageBox:i}=t,{styleService:{grid:{lineClamp:o}}}=eO(),{direction:s}=YT();return co.jsxs("div",{style:{display:"grid",gridTemplateColumns:`${i?.width??24}px 1fr`,maxHeight:"fit-content",alignItems:"center",justifyContent:"flex-start",boxSizing:"border-box"},children:[co.jsx("div",{"data-key":"image-container--partial-image",style:{display:"flex",flexDirection:"column",justifyContent:Vj(e),alignItems:I5(r,s),overflow:"hidden",boxSizing:"border-box",border:"4px solid transparent",width:i?.width??24,height:"100%"},children:co.jsx(uz,{representation:t,textStyle:n})}),co.jsx(Bz,{padding:4/(o<=2?2:1),alignSelf:Vj(e,!0),children:!!t.labelStructure&&lz(t.labelStructure)})]})},_5=({suffix:e,delimeter:t})=>` ${e?t:""} ${e}`,D5=({href:e,text:t,labelStructure:n,interactions:r,color:i})=>co.jsxs("span",{children:[co.jsx(Pu,{...gF({href:e,text:t,interactions:r,color:i}),children:n?.maskedValue?n.maskedValue:n?.originalValue}),!!n&&_5(n)]}),A5=({children:e,textStyle:t,shouldEnableStickyText:n})=>co.jsx("span",{style:{...t,border:"4px solid transparent",boxSizing:"border-box",...n&&{alignSelf:"flex-start",position:"sticky",top:0}},children:e}),P5=({isLeftColumn:e,styleService:t,cell:n,isIndentModeEnabled:r})=>e?r?t.grid.lineClamp:Math.max(t.grid.lineClamp,n.leafCount*t.grid.lineClamp):t.grid.columnLineClamp,L5=({cell:e,isCellSelected:t,isLeftColumn:n})=>{const{direction:r}=YT(),{isActive:i}=Wj(),{layoutService:o,styleService:s}=eO(),{env:a,interactions:l}=JT(),c=n&&o.isIndentModeEnabled;let u;if(u=a.flags.isEnabled("VNA-670-SEPARATE_NULL_VALUE_STYLING")&&e.isNull?o.getDimensionNullValueText():e.isNull?vP:n?(e=>{const{representation:{text:t,labelStructure:n}}=e;if(e.isNull)return vP;if(!n||!n.originalValue)return t;const{originalValue:r,maskedValue:i,suffix:o,delimeter:s}=n;return`${0!==i.length?i:r} ${o?s:""} ${o}`.trim()})(e):e.representation.text,e.isEmpty)return null;const d=(({cell:e,styleService:t,isCellSelected:n,isLeftColumn:r,isIndentModeEnabled:i})=>({...TP,...OP(P5({cell:e,isLeftColumn:r,styleService:t,isIndentModeEnabled:i})),color:Kj({cell:e,styleService:t,isCellSelected:n}),fontWeight:Xj({cell:e,styleService:t}),fontStyle:Jj({cell:e,styleService:t}),textDecoration:Zj({cell:e,styleService:t}),fontFamily:t.dimensionValues.fontFamily,fontSize:t.dimensionValues.fontSize}))({cell:e,styleService:s,isCellSelected:t,isLeftColumn:n,isIndentModeEnabled:o.isIndentModeEnabled});if(e.representation.type===KA.Image&&!e.isTotal&&!e.isNull){const{labelStructure:t}=e.representation,i=n&&t&&t.suffix?R5:dz;return co.jsx(i,{cell:e,representation:e.representation,leafCount:e.leafCount,textStyle:d,isLeftColumn:n,canExpandOrCollapse:e.ref.qCanCollapse||e.ref.qCanExpand,imageContainerHorizontalAlignment:hF(e,o,n,r)})}if(e.representation.type===KA.Link&&!i&&!e.isTotal&&!e.isNull){const t=n&&e.representation.labelStructure?D5:yF;u=co.jsx(t,{text:e.representation.text,labelStructure:e.representation.labelStructure,href:e.representation.url,interactions:l,color:e.expressionColor.color})}return co.jsx(A5,{shouldEnableStickyText:c,textStyle:{...d,...e.representation.type===KA.Image&&e.isNull?{alignSelf:Vj(e)}:{}},children:u})},T5=({index:e,style:t,data:n})=>{const{styleService:r,layoutService:i}=eO(),{isSelected:o}=Wj(),{isLeftColumn:s=!1,showLastBorder:a,itemCount:l,isLast:c,totalDividerIndex:u}=n,{isAdjustingWidth:d,setIsAdjustingWidth:h}=Dz([n]),p=dF(e,n),f=s?e===l-1:c,m=s?c:e===l-1,g=rj(p,u,i.isIndentModeEnabled);if(void 0===p){const{background:n}=r.dimensionValues;return co.jsx(oj,{style:{...t,background:n},index:e,isLastRow:f,isLastColumn:m,showLastBorder:a,isLeftColumn:s,showTotalCellDivider:g})}const y=o(p);return co.jsxs(fF,{reactWindowStyle:t,isLeftColumn:s,isLastRow:f,isLastColumn:m,isCellSelected:y,showTotalCellDivider:g,cell:p,data:n,isAdjustingWidth:d,index:e,children:[co.jsxs(sj,{verticalAlign:Vj(p),width:aj(p.representation),right:p.isLeftColumn?void 0:4,isLeftColumn:s,children:[co.jsx(nz,{isLeftColumn:s,isCellSelected:y,cell:p}),co.jsx(L5,{isLeftColumn:s,isCellSelected:y,cell:p})]}),co.jsx(Lz,{cellInfo:{...p,columnWidthLocation:p.isPseudoDimension?nP.Measures:nP.Dimension},columnWidth:t.width,isLastColumn:m,setIsAdjustingWidth:h})]})};var O5=t.memo(T5,FN);const q5=({list:e,listValues:t,isLastRow:n,getRightGridColumnWidth:r})=>i=>{const o=n?e[i]:t.at(i);return o&&0===i&&o.x>0?(o.leafCount+o.x+o.distanceToNextCell)*r():!n&&o?(o.leafCount+o.distanceToNextCell)*r():r(o?.x??i)},N5=(e,t,n,r)=>{const i=Object.values(e);let o,s=i.length;return r&&(s=n,o=t/s),{itemCount:s,estimatedItemSize:o,listValues:i}},j5=(e,t)=>n=>{e.current&&(e.current[t]=n)},z5={display:"flex",height:"fit-content",borderWidth:"1px 0px 0px 0px",...PP},F5={overflow:"hidden",willChange:"auto",flexShrink:0},W5=({leftGridRef:e,width:t,height:n,columnWidths:r,showLastBorder:i})=>{const{pageInfo:o,direction:s}=YT(),{layoutService:a,styleService:{contentCellHeight:l,grid:{divider:c}}}=eO(),{qSize:u}=a.layout.qHyperCube,{gridSectionsData:{leftDimensionData:d},visibleDimensionsInfo:{visibleLeftDimensionInfo:h}}=xq();uF(e,d),cF(e,t,n,l);const p=o.rowsOnCurrentPage*l,f={...z5,borderColor:c,width:r.reduce((e,t)=>e+t,0)};return co.jsx("div",{style:f,"data-section-id":"LEFT_GRID",children:d.grid.map((t,c)=>{const f=c===d.columnCount-1,m=oO(h[c]),{itemCount:g,estimatedItemSize:y,listValues:v}=N5(t,p,o.rowsOnCurrentPage,f),b=a.isIndentModeEnabled?()=>l:((e,t,n,r,i)=>o=>{const s=r?e[o]:t.at(o);if(s&&0===o&&s.pageY>0)return(s.leafCount+s.pageY+s.distanceToNextCell)*n;if(s&&s.leafCount>0){const e=s.y===i-s.leafCount;return(s.leafCount-(e?s.ref.qUp:0)+s.distanceToNextCell)*n}return n})(t,v,l,f,u.qcy);return co.jsx(qN,{ref:j5(e,c),style:{...F5,flexGrow:f?1:0,direction:s},height:n,width:r[c],itemCount:g,itemSize:b,layout:"vertical",itemData:{list:t,isLeftColumn:!0,isLast:f,itemCount:g,showLastBorder:i,listValues:v,totalDividerIndex:d.totalDividerIndex},itemKey:Ez,estimatedItemSize:y,children:O5},m)})})};var $5=y(W5);const B5={overflow:"hidden",willChange:"auto"},V5=e=>({...PP,borderWidth:"rtl"===e?"0px 1px 0px 0px":"0px 0px 0px 1px"}),H5=({topGridRef:e,rowHightCallback:t,width:n,height:r,showLastBorder:i,getRightGridColumnWidth:o})=>{const{direction:s}=YT(),{layoutService:a,styleService:{grid:{divider:l},headerCellHeight:c}}=eO(),{gridSectionsData:{headersData:u,topDimensionData:d}}=xq(),h={...V5(s),borderColor:l,height:r};uF(e,d),cF(e,n,r,c);const p=a.size.x*o();return 0===d.rowCount?co.jsx("div",{style:{width:n,height:r,...V5(s)}}):co.jsx("div",{style:h,"data-section-id":"TOP_GRID",children:d.grid.map((r,l)=>{const c=l===d.rowCount-1,{itemCount:h,estimatedItemSize:f,listValues:m}=N5(r,p,a.size.x,c),g=(({layoutService:e,headersData:t,topRowIndex:n})=>{const r=t.data.at(n);if(void 0===r)return;const i=t.size.x-1,o=oF({layoutService:e,headersData:t,topRowIndex:n})?0:i,s=r.at(o),a=Array.isArray(s)?s.at(i):s;return a?e.getDimensionInfo(a.dimensionInfoIndex):void 0})({layoutService:a,headersData:u,topRowIndex:l}),y=g?oO(g):`empty ${l}`;return co.jsx(qN,{ref:j5(e,l),style:B5,height:t(),width:n,itemCount:h,itemSize:q5({list:r,listValues:m,isLastRow:c,getRightGridColumnWidth:o}),layout:"horizontal",itemData:{list:r,isLast:c,itemCount:h,showLastBorder:i,listValues:m,totalDividerIndex:d.totalDividerIndex},itemKey:Ez,estimatedItemSize:f,direction:s,children:O5},y)})})};var G5=y(H5);const U5=()=>co.jsx(Y5,{}),Y5=()=>{const{styleService:{headerCellHeight:e,contentCellHeight:t}}=eO(),n=eN(),r=(()=>{const{model:e}=JT(),t=Dp(Df),n=d(async(n,r)=>{if(!e)throw new Error("No Model provided!");const{qReverseSort:i,dimensionInfoIndex:o,sortDirection:s}=n,a=[];if(r===s)return!1;a.push({qPath:`/qHyperCubeDef/qDimensions/${o}/qDef/qReverseSort`,qOp:"Replace",qValue:(!i).toString()});try{return await e.applyPatches(a,!0),!0}catch(e){return t.error({msg:"Error while applying patch",payload:e}),!1}},[e,t]);return n})(),{gridSectionsWrapperRefs:{headerGridWrapperRef:i,topGridWrapperRef:o,leftGridWrapperRef:s,dataGridWrapperRef:a},gridRefs:{topGridRef:l,leftGridRef:u,dataGridRef:h},scrollDirectionRefs:{verticalScrollDirection:p,horizontalScrollDirection:f},scrollbarsDimensions:{verticalScrollbarWidth:m,horizontalScrollbarHeight:g,resetHorizontalScrollbarHeight:y},scrollToCoordCallBack:v}=Qq(),{leftGridWidth:b,leftGridFullWidth:x,leftGridColumnWidths:w,rightGridFullWidth:S,showLastRightBorder:C,getRightGridColumnWidth:E,getHeaderCellsIconsVisibilityStatus:M,overrideLeftGridWidth:k}=function({tableWidth:e,verticalScrollbarWidth:t,resetHorizontalScrollbarHeight:n}){const{layoutService:r,styleService:i}=eO(),{gridSectionsData:{headersData:o}}=xq(),{measureText:s}=cL(i.header,{allowLineBreaks:!1}),a=$q({tableWidth:e}),l=Bq({tableWidth:e,verticalScrollbarWidth:t,leftGridWidth:a.leftGridWidth}),u=Math.min(a.leftGridFullWidth,e-l.rightGridWidth-1),h=u+l.rightGridFullWidth+1<e,p=d((e,t,n="")=>{let i=e;r.isIndentModeEnabled&&(i=1,1===o.size.x&&(i=0));const l=a.leftGridColumnWidths[i];let c=!1,u=!1,d=s(n)+Iq;return t&&d+kq<=l&&(u=!0,d+=kq),d+kq<=l&&(c=!0),{shouldShowMenuIcon:c,shouldShowLockIcon:u}},[a.leftGridColumnWidths,s,r.isIndentModeEnabled,o.size.x]);return c(()=>{const e=u===a.leftGridFullWidth,t=l.rightGridWidth===l.rightGridFullWidth;e&&t&&n()},[n,u,a.leftGridFullWidth,l.rightGridWidth,l.rightGridFullWidth]),{...a,leftGridWidth:u,...l,showLastRightBorder:h,getHeaderCellsIconsVisibilityStatus:p}}({tableWidth:n.width,verticalScrollbarWidth:m,resetHorizontalScrollbarHeight:y}),{gridScaffoldDimensions:I,headerGridDims:R,topGridDims:_,leftGridDims:D,dataGridDims:A,metadata:{everyThingFitsInTableRectHeight:P,scrollbarsVisibilityStatus:L}}=(({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:n,leftGridOriginalWidth:r,rightGridOriginalWidth:i},scrollBarsDimensions:{verticalScrollbarWidth:o,horizontalScrollbarHeight:s}})=>{const a=eN(),{pageInfo:l}=YT(),{gridSectionsData:{headersData:c,topDimensionData:u}}=xq(),d=Math.min(a.height*Rq,Math.max(a.height*Rq-25,a.height-t-s)),h=l.rowsOnCurrentPage*t,p=Math.max(c.size.y,u.rowCount,1),f=e*p,m=e*p,g=n,y=a.width-g,v=Math.min(d,f,m),{availableHeight:b,everyThingFitsInTableRectHeight:x,everyThingFitsInTableRectWidth:w}=((e,t,n)=>{const r=t+1+n+o<=a.width,i=e+1+h+s,l=i-a.height<s||i<=a.height;return{availableHeight:l?i:a.height,everyThingFitsInTableRectHeight:l,everyThingFitsInTableRectWidth:r}})(v,g,y),S=b-d,C=Math.max(S,b-v),E=Math.min(C,h),M=Math.min(C,h),k=f+1+h,{visibilityStatus:I,metadata:{hasLeftGridOverflowX:R,hasDataGridOverflowX:_}}=(e=>{const{gridScaffold:{X_AXIS:{leftSectionWidth:t,rightSectionWidth:n},Y_AXIS:{topSectionHeight:r,bottomSectionHeight:i}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:o,rightSectionFullWidth:s},Y_AXIS:{topSectionFullHeight:a,bottomSectionFullHeight:l}}}=e,c=a>r,u=o>t,d=s>n,h=l>i;return{visibilityStatus:{topGrid:{overflowX:"hidden",overflowY:c?"scroll":"hidden"},leftGrid:{overflowX:u?"scroll":"hidden",overflowY:"hidden"},dataGrid:{overflowX:d?"scroll":"hidden",overflowY:h?"scroll":"hidden"}},metadata:{hasTopGridOverflowY:c,hasLeftGridOverflowX:u,hasDataGridOverflowX:d,hasDataGridOverflowY:h}}})({gridScaffold:{X_AXIS:{leftSectionWidth:g,rightSectionWidth:y},Y_AXIS:{topSectionHeight:v,bottomSectionHeight:C}},gridOriginalWidth:{X_AXIS:{leftSectionFullWidth:r,rightSectionFullWidth:i},Y_AXIS:{topSectionFullHeight:m,bottomSectionFullHeight:k-m}}});return{gridScaffoldDimensions:{width:a.width,height:a.height,gridTemplateColumns:`${g}px ${y}px`,gridTemplateRows:`${v}px ${C}px`},headerGridDims:{width:-1,height:v},topGridDims:{fullSizeWrapper:{width:i-o+(_?o:0),height:m},stickyWrapper:{width:y-1-o,height:-1},self:{width:Math.min(i,y-(w?1:0)-o),height:m}},leftGridDims:{fullSizeWrapper:{width:g,height:k-m+(!R&&_?s:0)},stickyWrapper:{width:g,height:C-1-s},self:{width:g,height:Math.max(t,E-(x?0:s-1))}},dataGridDims:{fullSizeWrapper:{width:i-o+(_?o:0),height:k-m+(!_&&R?s:0)},stickyWrapper:{width:y-1-o,height:C-1-s},self:{width:Math.min(i,y-(w?1:0)-o),height:Math.max(t,M-(x?0:s-1))}},metadata:{everyThingFitsInTableRectHeight:x,scrollbarsVisibilityStatus:I}}})({cellHeights:{headerCellHeight:e,contentCellHeight:t},horizontalWidths:{leftGridWidth:b,leftGridOriginalWidth:x,rightGridOriginalWidth:S},scrollBarsDimensions:{verticalScrollbarWidth:m,horizontalScrollbarHeight:g}}),T=d(()=>e,[e]),O=d(()=>t,[t]),{env:q}=JT(),N=Ap(GT),j=Ap(BT),z=q.flags.isEnabled("VNA-639-KEYBOARD_NAV_VIRTUALIZED_PIVOT_TABLE");return c(()=>z?(N({HEADER:i.current,TOP:o.current,LEFT:s.current,DATA:a.current}),j(()=>v),()=>{N({HEADER:null,TOP:null,LEFT:null,DATA:null}),j(()=>null)}):()=>{},[z,N,i,o,s,a,j,v]),(()=>{const{downloadService:e}=eO();c(()=>{e.notifyIsDoneRendering()})})(),co.jsxs(nN,{style:I,children:[co.jsx("div",{style:{overflow:"hidden"},ref:i,children:co.jsx(lF,{tableWidth:n.width,leftGridWidth:b,columnWidths:w,getHeaderCellsIconsVisibilityStatus:M,rowHight:e,height:R.height,changeSortOrder:r,overrideLeftGridWidth:k})}),co.jsx(oN,{style:L.topGrid,origin:iP.TopGrid,ref:o,children:co.jsx(tN,{style:_.fullSizeWrapper,children:co.jsx(sN,{style:_.stickyWrapper,children:co.jsx(G5,{topGridRef:l,rowHightCallback:T,..._.self,showLastBorder:{right:C,bottom:!1},getRightGridColumnWidth:E})})})}),co.jsx(oN,{style:L.leftGrid,origin:iP.LeftGrid,ref:s,children:co.jsx(tN,{style:D.fullSizeWrapper,children:co.jsx(sN,{style:D.stickyWrapper,children:co.jsx($5,{leftGridRef:u,...D.self,columnWidths:w,showLastBorder:{right:!1,bottom:P}})})})}),co.jsx(oN,{style:L.dataGrid,origin:iP.DataGrid,ref:a,children:co.jsx(tN,{style:A.fullSizeWrapper,children:co.jsx(sN,{style:A.stickyWrapper,children:co.jsx(Rz,{dataGridRef:h,rowHightCallback:O,...A.self,showLastBorder:{right:C,bottom:P},getRightGridColumnWidth:E,verticalScrollDirection:p,horizontalScrollDirection:f})})})})]})},K5=ka("div")({"& .sn-copy-cell:focus-visible":{outline:"none",boxShadow:"0 0 0 2px #177fe6 inset, 0 0 0 3px #fff inset"}}),X5=()=>{const{keyboard:e,theme:t,interactions:n,translator:r,env:i}=JT(),{pageInfo:o,updatePageInfo:a,rect:l}=YT(),{layoutService:u}=eO(),{handleKeyDown:d}=Eq(),{layout:h,hasData:p}=u,f=s(null),m=Ap(GT),g=i.flags.isEnabled("VNA-639-KEYBOARD_NAV_VIRTUALIZED_PIVOT_TABLE");return c(()=>g?(m({WRAPPER:f.current}),()=>{m({WRAPPER:null})}):()=>{},[g,m]),co.jsxs(K5,{ref:f,onKeyDown:g?d:void 0,children:[p?co.jsx(U5,{}):null,co.jsx(Mq,{}),co.jsx(jT,{paginationNeeded:o.shouldShowPagination,handleChangePage:e=>{a({page:e})},pageInfo:o,totalRowCount:o.totalRowCount,totalColumnCount:0,totalPages:o.totalPages,keyboard:e,translator:r,theme:t,interactions:n,rect:l,layout:h})]})};const J5=(e,{selections:n,baseObjects:r,coreServices:i,nebulaObjects:o},s)=>{const a=function(e){const t=qh();return t?.components?.MuiTable?.styleOverrides&&(t.components.MuiTable.styleOverrides.root={}),la({...t,direction:e})}(r.direction);e.render(co.jsx(t.StrictMode,{children:co.jsx(Ep,{store:s,children:co.jsx(Ra,{theme:a,children:co.jsx(ZT,{...o,children:co.jsx(KT,{...r,children:co.jsx($j,{selections:n,children:co.jsx(tO,{...i,children:co.jsx(wq,{children:co.jsx(X5,{})})})})})})})})}))};var Z5=function(e){return e.FontSize="fontSize",e.FontFamily="fontFamily",e.FontColor="fontColor",e.FontStyle="fontStyle",e.Background="background",e.LineClamp="lineClamp",e.ColumnLineClamp="columnLineClamp",e.Border="border",e.Divider="divider",e}(Z5||{}),Q5=function(e){return e.Dimension="object.pivotTableV2.dimension",e.Measure="object.pivotTableV2.measure",e.Total="object.pivotTableV2.total",e.Null="object.pivotTableV2.null",e.Grid="object.pivotTableV2",e}(Q5||{}),e3=function(e){return e.Grid="grid",e.Divider="grid.divider",e.LabelName="label.name",e.LabelValue="label.value",e}(e3||{}),t3=function(e){return e.FontSize="fontSize",e.FontFamily="fontFamily",e.FontColor="color",e.BackgroundColor="backgroundColor",e.LineClamp="lineClamp",e.ColumnLineClamp="columnLineClamp",e.BorderColor="borderColor",e}(t3||{});const n3=e=>e?`${parseInt(e,10)}px`:void 0,r3=(e,t)=>{if(t){const n=e.getColorPickerColor(t);return"none"===n?_P.Transparent:n}},i3=(e,t)=>+(parseInt(e,10)*yP*t+8).toFixed(2),o3=(e,t)=>void 0===e?t:e.some(e=>"bold"===e)?mP:"normal",s3=e=>e?.some(e=>"italic"===e)?"italic":"normal",a3=e=>e?.some(e=>"underline"===e)?"underline":"none",l3=document.createElement("textarea");function c3(e){l3.value=e,document.body.appendChild(l3),l3.select(),l3.setSelectionRange(0,l3.value.length),document.execCommand("copy"),document.body.removeChild(l3)}l3.style.position="absolute",l3.style.left="-9999px",l3.setAttribute("readonly","");function u3(e){L?.((t,n)=>{const r=n.target,i=r?.closest(`.${ZI}`);i?.title&&t.addItem({translation:"contextMenu.copyCellValue",icon:"lui-icon lui-icon--copy",tid:"copy-cell-context-item",id:"copy-cell-context-item",select:()=>{(e=>{const t=e.title;t&&(navigator.clipboard?.writeText?navigator.clipboard.writeText(t).catch(()=>{c3(t)}):c3(t))})(i)}}),e?.forEach(e=>{e(t,n,i)})})}const d3=({model:e,layoutService:t,effectivePropertiesService:n,translator:r,env:i})=>{const o=k(()=>Rf(i,{tag:"sn-pivot-table"}),[i]);return JP((i,s,a)=>{if(!e||n.qAlwaysFullyExpanded)return;const l=e,c=i.addItem({translation:"Object.PivotTable.ContextMenu.ExpandCollapse",tid:"expand-collapse-group",id:"expand-collapse-group"}),{qEffectiveDimensionName:u,label:d}=((e,t)=>{const n=((e,t)=>{const n=e?.getAttribute("data-dimension-info-index");if("string"==typeof n)return t.getDimensionInfo(+n)})(e,t);return"object"==typeof n?{qEffectiveDimensionName:n.qEffectiveDimensionName,label:n.qFallbackTitle}:{qEffectiveDimensionName:void 0,label:void 0}})(a,t);c.addItem(((e,t)=>({icon:"lui-icon lui-icon--plus",translation:"Object.PivotTable.ContextMenu.ExpandAll",tid:"expand-all",select:async()=>{try{await e.expandTop(nO,0,0,!0),await e.expandLeft(nO,0,0,!0)}catch(e){t.error({msg:"Failed to expand all",payload:e})}}}))(l,o)),"string"==typeof u&&c.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:n,label:r,translator:i,logToSentry:o})=>({icon:"lui-icon lui-icon--plus",translation:i.get("SNPivotTable.ContextMenu.ExpandDimension",[r??""]),tid:"expand-dimension",id:"expand-dimension",select:Uz({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n,action:Vz.Expand,logToSentry:o})}))({model:l,effectivePropertiesService:n,qEffectiveDimensionName:u,label:d,translator:r,logToSentry:o})),c.addItem(((e,t)=>({icon:"lui-icon lui-icon--minus",translation:"Object.PivotTable.ContextMenu.CollapseAll",tid:"collapse-all",select:async()=>{try{await e.collapseTop(nO,0,0,!0),await e.collapseLeft(nO,0,0,!0)}catch(e){t.error({msg:"Failed to collapse all",payload:e})}}}))(l,o)),"string"==typeof u&&c.addItem((({model:e,effectivePropertiesService:t,qEffectiveDimensionName:n,label:r,translator:i,logToSentry:o})=>({icon:"lui-icon lui-icon--minus",translation:i.get("SNPivotTable.ContextMenu.CollapseDimension",[r??""]),tid:"collapse-dimension",id:"collapse-dimension",select:Uz({model:e,qExpansionState:t.qExpansionState,qEffectiveDimensionName:n,action:Vz.Collapse,logToSentry:o})}))({model:l,effectivePropertiesService:n,qEffectiveDimensionName:u,label:d,translator:r,logToSentry:o}))},[e,t,n,o])},h3=(e,t)=>k(()=>(({layout:e})=>{const{qHyperCube:t,nullValueRepresentation:n,snapshotData:r}=e,{qNoOfLeftDims:i,qEffectiveInterColumnSortOrder:o,qMeasureInfo:s,qDimensionInfo:a}=t,l=!!r,c=r?.content?.rowsPerPage??15e3,u={x:Math.min(e.qHyperCube.qSize.qcx,gP),y:Math.min(e.qHyperCube.qSize.qcy,c)},d=o.slice(0,i),h=e=>d.some(t=>t===e),p=h(rO),f=new Map(o.map(e=>[a[e]??rO,e])),m=s.filter(e=>7005!==e.qError?.qErrorCode);return{layout:e,getNullValueText:()=>n?.text??vP,getDimensionNullValueText:()=>n?.dimensionText??vP,getMeasureInfoIndexFromCellIndex:(e,t=!1)=>{if(p)return 0;const n=e%m.length;return t?n:s.findIndex(e=>e===m[n])},getDimensionInfo:e=>e===rO?void 0:a.at(e),getDimensionInfoIndex:e=>f.get(e)??-1,size:u,isSnapshot:l,hasLimitedData:!l&&u.x<e.qHyperCube.qSize.qcx,hasData:u.x>0&&u.y>0,hasLeftDimensions:0!==e.qHyperCube.qNoOfLeftDims,hasPseudoDimOnLeft:p,leftDimensionInfoIndexes:d,isLeftDimension:h,triggerdByExpandOrCollapse:!!e.qHyperCube.qLastExpandedPos,visibleMeasureInfo:m,isIndentModeEnabled:Boolean(e.qHyperCube.qIndentMode),indentModeColumnWidth:e.qHyperCube.indentModeColumnWidth??{type:nR.Auto,pixels:tR.PixelsDefault,percentage:tR.PercentageDefault},searchSortFromDimension:"inherit"===e.search?.sorting}})({layout:e}),[e,t]),p3=({model:e,layoutService:t,viewService:n,pageInfo:r,rect:i})=>{const{layout:o,isSnapshot:s,triggerdByExpandOrCollapse:a}=t,l=(e=>{const t=QP(e);return t.current=e,t})(fq(i));return oL(async()=>{const{qHyperCube:t}=o,{maxNumberOfVisibleRows:i,maxNumberOfVisibleColumns:c}=l.current;if(s)return o.snapshotData?.content?.qPivotDataPages??[];if(void 0!==e&&"getHyperCubePivotData"in e&&(((e,t,n,r)=>!!e&&(t.gridColumnStartIndex+t.gridWidth>=r||t.gridRowStartIndex+t.gridHeight>=n))(a,n,i,c)||((e,t,n,r)=>{const{qHyperCube:{qPivotDataPages:i,qSize:o}}=e,{qTop:s,qWidth:a,qHeight:l}=i[0]?.qArea??{qTop:0,qWidth:0,qHeight:0};return s<t.page*t.rowsPerPage||a<Math.min(r,o.qcx)||l<Math.min(n,o.qcy)})(o,r,i,c))){const t=((e,t,n,r,i,o)=>{const s=r.page*r.rowsPerPage,a=Math.min(s+r.rowsPerPage,n.qcy),l=Math.min(gP,n.qcx);if(n.qcy<s)return null;let c=0,u=s;if(e){c=t.gridColumnStartIndex,u=s+t.gridRowStartIndex;const e=u+t.gridHeight,n=t.gridColumnStartIndex+t.gridWidth;e>a&&(u=Math.max(0,a-i)),n>l&&(c=Math.max(0,l-o))}return{qLeft:c,qTop:u,qWidth:Math.min(l-c,o),qHeight:Math.min(a-u,i)}})(a,n,o.qHyperCube.qSize,r,i,c);return t?e.getHyperCubePivotData(nO,mq(t)):[]}return t.qPivotDataPages},[o,s,e,n,r.page,r.rowsPerPage,l,a])},f3=({rowsPerPage:e,totalRowCount:t,page:n})=>Math.min(e,t-n*e),m3=(e,t,n=15e3)=>({rowsPerPage:n,totalPages:Math.max(1,Math.ceil(e/n)),totalRowCount:e,rowsOnCurrentPage:f3({rowsPerPage:n,totalRowCount:e,page:t})}),g3=15,y3=({layoutService:e,viewService:t,rect:n,model:r,pageInfo:i})=>{const{freeResize:o}=I();return T(async e=>{const o=e;if(!o.snapshotData||!r||o.snapshotData.content)return o;if("getHyperCubePivotData"in r){const{scrollTop:e,scrollLeft:s,leftGridScrollLeft:a,topGridScrollTop:l}=t,c=((e,t,n)=>{const{gridColumnStartIndex:r,gridRowStartIndex:i,gridWidth:o,gridHeight:s}=e,a=t.page*t.rowsPerPage,l=Math.max(r-g3,0),c=Math.max(a+i-g3,a,0),u=gP-l,d=a+t.rowsOnCurrentPage-c;if((e=>0===e.gridWidth&&0===e.gridHeight)(e)){const{maxNumberOfVisibleColumns:e,maxNumberOfVisibleRows:t}=fq(n);return{qLeft:l,qTop:c,qWidth:Math.min(u,e+30),qHeight:Math.min(d,t+30)}}return{qLeft:l,qTop:c,qWidth:Math.min(u,o+30),qHeight:Math.min(d,s+30)}})(t,i,n),u=mq(c),d={qLeft:0,qTop:i.page*i.rowsPerPage,qWidth:1,qHeight:1};o.snapshotData.content={qPivotDataPages:await r.getHyperCubePivotData(nO,[d,...u]),scrollTop:e,scrollLeft:s,leftGridScrollLeft:a,topGridScrollTop:l,page:i.page,rowsPerPage:i.rowsPerPage},o.snapshotData.object={...o.snapshotData.object,size:{...o.snapshotData.object?.size,w:n.width,h:n.height}}}return o}),O(()=>({getViewState:()=>((e,t)=>({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,leftGridScrollLeft:e.leftGridScrollLeft,topGridScrollTop:e.topGridScrollTop,renderPage:t.page}))(t,i)}),[t]),e.layout.snapshotData?.content&&!o?{left:n.left,top:n.top,width:e.layout.snapshotData.object.size.w,height:e.layout.snapshotData.object.size.h}:n};var v3={SNPivotTable_ContextMenu_CollapseDimension:{id:"SNPivotTable.ContextMenu.CollapseDimension",locale:{"de-DE":"{0} reduzieren","en-US":"Collapse {0}","es-ES":"Contraer {0}","fr-FR":"Réduire {0}","it-IT":"Comprimi {0}","ja-JP":"{0} を折りたたむ","ko-KR":"{0} 축소","nl-NL":"{0} samenvouwen","pl-PL":"Zwiń {0}","pt-BR":"Recolher {0}","ru-RU":"Свернуть {0}","sv-SE":"Dölj {0}","tr-TR":"{0} öğelerini daralt","zh-CN":"折叠 {0}","zh-TW":"收合 {0}"}},SNPivotTable_ContextMenu_ExpandDimension:{id:"SNPivotTable.ContextMenu.ExpandDimension",locale:{"de-DE":"{0} erweitern","en-US":"Expand {0}","es-ES":"Expandir {0}","fr-FR":"Développer {0}","it-IT":"Espandi {0}","ja-JP":"{0} を展開","ko-KR":"{0} 확장","nl-NL":"{0} uitvouwen","pl-PL":"Rozwiń {0}","pt-BR":"Expandir {0}","ru-RU":"Развернуть {0}","sv-SE":"Visa {0}","tr-TR":"{0} öğelerini genişlet","zh-CN":"展开 {0}","zh-TW":"展開 {0}"}},SNPivotTable_IndentMode_Rows:{id:"SNPivotTable.IndentMode.Rows",locale:{"de-DE":"Zeilen","en-US":"Rows","es-ES":"Filas","fr-FR":"Lignes","it-IT":"Righe","ja-JP":"行","ko-KR":"행","nl-NL":"Rijen","pl-PL":"Wiersze","pt-BR":"Linhas","ru-RU":"Строки","sv-SE":"Rader","tr-TR":"Satırlar","zh-CN":"行","zh-TW":"列"}},SNPivotTable_LimitedData:{id:"SNPivotTable.LimitedData",locale:{"de-DE":"* Derzeit wird eine begrenzte Anzahl Spalten angezeigt","en-US":"* Currently showing a limited number of columns","es-ES":"* Actualmente mostrando un número limitado de columnas","fr-FR":"*Affichage actuel d'un nombre limité de colonnes","it-IT":"* Attualmente visualizzato un numero limitato di colonne","ja-JP":"* 現在、限られた列の数を表示","ko-KR":"* 현재 제한된 수의 열만 표시","nl-NL":"* Op dit moment wordt slechts een beperkt aantal kolommen getoond","pl-PL":"* Obecnie wyświetlana jest ograniczona liczba kolumn","pt-BR":"* Atualmente mostrando um número limitado de colunas","ru-RU":"* В настоящее время отображается ограниченное количество столбцов","sv-SE":"* Visar för närvarande ett begränsat antal kolumner","tr-TR":"*Şu anda sınırlı sayıda sütun gösteriliyor","zh-CN":"* 当前显示的列数有限","zh-TW":"* 目前顯示有限欄數"}},SNPivotTable_NoData:{id:"SNPivotTable.NoData",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, weil es keine Werte enthält.","en-US":"The chart is not displayed because it contains no values.","es-ES":"El gráfico no se muestra porque no contiene valores.","fr-FR":"Le graphique n'est pas affiché, car il ne contient aucune valeur.","it-IT":"Il grafico non è visualizzato poiché non contiene alcun valore.","ja-JP":"チャートには値が含まれていないため、チャートは表示されません。","ko-KR":"차트에 값이 없으므로 차트가 표시되지 않습니다.","nl-NL":"Het diagram wordt niet weergegeven omdat deze geen waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ nie zawiera wartości.","pt-BR":"O gráfico não foi exibido porque não contém valores.","ru-RU":"Диаграмма не отображается, так как не содержит значений.","sv-SE":"Diagrammet visas inte eftersom det inte innehåller några värden.","tr-TR":"Değer içermemesi nedeniyle grafik görüntülenmiyor.","zh-CN":"图表未显示,因为它不包含任何值。","zh-TW":"系統不會顯示圖表,因為這沒有包含任何值。"}}};const b3=()=>{const e=q(),t=e.language();return k(()=>{!function(e){const t="SNPivotTable_LimitedData";e.get(t)===t&&Object.keys(v3).forEach(t=>{e.add(v3[t])})}(e)},[e]),{translator:e,language:t}},x3=e=>{const t=k(()=>wp(),[]);t.set(_f,e);const{flags:n}=e,r=N(),i=(e=>{const t=k(()=>hL.createRoot(e),[e]);return D(()=>()=>{t.unmount()},[t]),t})(r),o=j(),s=z(),a=F(),l=W(),c=$(),u=(()=>{const{viewState:e}=I(),t=QP(new Set),n=void 0!==window.qlikprinting,{promise:r,resolve:i}=k(()=>XP(),[]),o=JP(e=>{t.current.add(e)},[t]),s=JP(yD(async()=>{await Promise.all(t.current),t.current.clear(),i()},1e3),[i,t]);return R(async()=>{await r},[r]),k(()=>({viewState:e,isDownloadedAsPDForImage:n,notifyIsDoneRendering:s,waitForPromise:o}),[s,n,e,o])})(),d=((e,t)=>{const[n]=oL(async()=>{if(void 0!==e&&!t.snapshotData&&"getEffectiveProperties"in e)return{...await e.getEffectiveProperties()}},[e,t]),r=k(()=>{const e=void 0!==n?.qHyperCubeDef.qSortbyYValue&&1===Math.abs(n.qHyperCubeDef.qSortbyYValue),t=n?.qHyperCubeDef.qDimensions.map(e=>e.qDef?.qSortCriterias)??[];return{qAlwaysFullyExpanded:n?.qHyperCubeDef.qAlwaysFullyExpanded??!1,qExpansionState:n?.qHyperCubeDef.qExpansionState,isSortedByFirstMeasure:e,getSortCriteriaForDimension:e=>t[e]}},[n]);return r})(s,o),h=h3(o,n),p=(e=>{const t=P();return{...t,select:!!t.active&&!!t.select&&!e,active:!!t.active&&!e,scroll:!!t.active}})(h.isSnapshot),f=B(),m=iL(o,r),{translator:g,language:y}=b3(),{pageInfo:v,updatePageInfo:b}=((e,t)=>{const{size:n,layout:{qHyperCube:{qSize:r}}}=e,i=t.isDownloadedAsPDForImage||e.isSnapshot,o=(e=>e.layout.snapshotData?.content?.rowsPerPage)(e),[s,a]=_(()=>{const s=((e,t)=>t.isDownloadedAsPDForImage?t.viewState?.renderPage??0:e.isSnapshot?e.layout.snapshotData?.content?.page??0:0)(e,t);return{page:s,shouldShowPagination:r.qcy>n.y&&!i,...m3(r.qcy,s,o)}}),l=e.layout.qHyperCube.qSize.qcy;return D(()=>{a(t=>({...t,...m3(l,t.page,o),shouldShowPagination:l>e.size.y&&!i}))},[l,e.size.y,a,i,o]),D(()=>{const{page:e,totalPages:t}=s;if(e+1>t){const e=t-1,n=f3({...s,page:e});a({...s,page:e,rowsOnCurrentPage:n})}},[s]),{pageInfo:s,updatePageInfo:e=>{a({...s,...e,rowsOnCurrentPage:f3({...s,...e})})}}})(h,u),x=((e,t,n)=>k(()=>((e,t)=>{if(e.isDownloadedAsPDForImage){const{viewState:t}=e;return{gridColumnStartIndex:0,gridRowStartIndex:0,gridWidth:0,gridHeight:0,scrollTop:t?.scrollTop??0,scrollLeft:t?.scrollLeft??0,leftGridScrollLeft:t?.leftGridScrollLeft??0,topGridScrollTop:t?.topGridScrollTop??0}}return{gridColumnStartIndex:0,gridRowStartIndex:0,gridWidth:0,gridHeight:0,scrollTop:t?.content?.scrollTop??0,scrollLeft:t?.content?.scrollLeft??0,leftGridScrollLeft:t?.content?.leftGridScrollLeft??0,topGridScrollTop:t?.content?.topGridScrollTop??0}})(n,t.snapshotData),[n,e.page,t.snapshotData]))(v,o,u),w=y3({rect:V(),layoutService:h,viewService:x,model:s,pageInfo:v}),[S,C]=p3({model:s,layoutService:h,viewService:x,pageInfo:v,rect:w}),E=k(()=>((e,t,n)=>{const r=n.isEnabled("VNA-670-SEPARATE_NULL_VALUE_STYLING"),i=t.layout.components?.find(e=>"theme"===e.key),o=i?.header,s=i?.dimensionValues,a=i?.measureValues,l=i?.measureLabels,c=i?.totalValues,u=i?.nullValues,d=(r?i?.dimensionNullValues:void 0)??u,h=i?.grid,p=(t,n,r)=>e.getStyle(t,n,r),f=+(h?.[Z5.LineClamp]??p(Q5.Grid,e3.Grid,t3.LineClamp)??1),m=+(h?.[Z5.ColumnLineClamp]??p(Q5.Grid,e3.Grid,t3.ColumnLineClamp)??1),g=r3(e,o?.[Z5.Background])??p(Q5.Dimension,e3.LabelName,t3.BackgroundColor)??_P.Transparent,y={header:{fontSize:n3(o?.[Z5.FontSize])??p(Q5.Dimension,e3.LabelName,t3.FontSize)??pP,fontFamily:o?.[Z5.FontFamily]??p(Q5.Dimension,e3.LabelName,t3.FontFamily)??fP,fontWeight:o3(o?.[Z5.FontStyle],mP),fontStyle:s3(o?.[Z5.FontStyle]),textDecoration:a3(o?.[Z5.FontStyle]),color:r3(e,o?.[Z5.FontColor])??p(Q5.Dimension,e3.LabelName,t3.FontColor)??HR.TEXT,background:g,hoverBackground:RD(g,rR),activeBackground:RD(g,iR)},dimensionValues:{fontSize:n3(s?.[Z5.FontSize])??p(Q5.Dimension,e3.LabelValue,t3.FontSize)??pP,fontFamily:s?.[Z5.FontFamily]??p(Q5.Dimension,e3.LabelValue,t3.FontFamily)??fP,fontWeight:o3(s?.[Z5.FontStyle],void 0),fontStyle:s3(s?.[Z5.FontStyle]),textDecoration:a3(s?.[Z5.FontStyle]),color:r3(e,s?.[Z5.FontColor])??p(Q5.Dimension,e3.LabelValue,t3.FontColor)??HR.TEXT,background:r3(e,s?.[Z5.Background])??p(Q5.Dimension,e3.LabelValue,t3.BackgroundColor)??_P.Transparent},measureValues:{fontSize:n3(a?.[Z5.FontSize])??p(Q5.Measure,e3.LabelValue,t3.FontSize)??pP,fontFamily:a?.[Z5.FontFamily]??p(Q5.Measure,e3.LabelValue,t3.FontFamily)??fP,fontWeight:o3(a?.[Z5.FontStyle],"normal"),fontStyle:s3(a?.[Z5.FontStyle]),textDecoration:a3(a?.[Z5.FontStyle]),color:r3(e,a?.[Z5.FontColor])??p(Q5.Measure,e3.LabelValue,t3.FontColor)??_P.FontSecondary,background:r3(e,a?.[Z5.Background])??p(Q5.Measure,e3.LabelValue,t3.BackgroundColor)??_P.Transparent},measureLabels:{fontWeight:o3(l?.[Z5.FontStyle],"normal"),fontStyle:s3(l?.[Z5.FontStyle]),textDecoration:a3(l?.[Z5.FontStyle]),color:r3(e,l?.[Z5.FontColor])??p(Q5.Measure,e3.LabelName,t3.FontColor)??_P.FontSecondary,background:r3(e,l?.[Z5.Background])??p(Q5.Measure,e3.LabelName,t3.BackgroundColor)??_P.Transparent},totalValues:{fontWeight:o3(c?.[Z5.FontStyle],mP),fontStyle:s3(c?.[Z5.FontStyle]),textDecoration:a3(c?.[Z5.FontStyle]),color:r3(e,c?.[Z5.FontColor])??p(Q5.Total,e3.LabelValue,t3.FontColor)??HR.TEXT,background:r3(e,c?.[Z5.Background])??p(Q5.Total,e3.LabelValue,t3.BackgroundColor)??_P.Transparent},dimensionNull:{fontWeight:o3(d?.[Z5.FontStyle],"normal"),fontStyle:s3(d?.[Z5.FontStyle]),textDecoration:a3(d?.[Z5.FontStyle]),color:r3(e,d?.[Z5.FontColor])??p(Q5.Null,e3.LabelValue,t3.FontColor)??HR.TEXT,background:r3(e,d?.[Z5.Background])??p(Q5.Null,e3.LabelValue,t3.BackgroundColor)??_P.NullValueBackground},nullValues:{fontWeight:o3(u?.[Z5.FontStyle],"normal"),fontStyle:s3(u?.[Z5.FontStyle]),textDecoration:a3(u?.[Z5.FontStyle]),color:r3(e,u?.[Z5.FontColor])??p(Q5.Null,e3.LabelValue,t3.FontColor)??HR.TEXT,background:r3(e,u?.[Z5.Background])??p(Q5.Null,e3.LabelValue,t3.BackgroundColor)??_P.NullValueBackground},grid:{columnLineClamp:m,lineClamp:f,border:r3(e,h?.[Z5.Border])??p(Q5.Grid,e3.Grid,t3.BorderColor)??_P.DividerLight,divider:r3(e,h?.[Z5.Divider])??p(Q5.Grid,e3.Divider,t3.BorderColor)??_P.DividerDark,background:r3(e,h?.[Z5.Background])??p(Q5.Grid,e3.Grid,t3.BackgroundColor)??_P.Transparent},selectedColors:ID(e)};return y.headerCellHeight=Math.max(i3(y.header.fontSize,m),i3(y.dimensionValues.fontSize,m),32),y.contentCellHeight=Math.max(i3(y.measureValues.fontSize,f),i3(y.dimensionValues.fontSize,f),24),y.dimensionValueTextHeight=i3(y.dimensionValues.fontSize,1),y})(m,h,n),[m,h,n]),M=((e,t,n)=>{const[,r,i]=oL(async()=>{const t=c_(),n=e.getStyle("","","fontFamily"),r=e.getStyle("object","label.name","fontFamily"),i=e.getStyle("object","label.value","fontFamily"),o=e.getStyle("","","fontFamilies")??[];return Promise.all([...t,...o,n,r,i,pL].filter(e=>void 0!==e).map(async e=>{await document.fonts.load(`600 12px ${e}`),await document.fonts.load(`12px ${e}`)}))},[t,e,n]);return i?(console.warn("Failed to load fonts:",i),!0):!r})(m,o,e),{direction:A}=I();u3([d3({model:s,layoutService:h,effectivePropertiesService:d,translator:g,env:e})]),D(()=>{!C&&s&&!!S&&M&&J5(i,{selections:f,baseObjects:{rect:w,pageInfo:v,qPivotDataPages:S,updatePageInfo:b,direction:A},nebulaObjects:{env:e,app:a,model:s,embed:l,theme:m,keyboard:c,translator:g,interactions:p},coreServices:{styleService:E,viewService:x,layoutService:h,downloadService:u,effectivePropertiesService:d}},t)},[s,a,w,p,f,x,h,u,C,S,E,i,M,g,y,v,b,d,l,c,m,e,A,t])},w3={version:"7.59.0",qHyperCubeDef:{qAlwaysFullyExpanded:!1,qDimensions:[],qMeasures:[],qMode:"P",qSuppressMissing:!0,qSuppressZero:!1,qShowTotalsAbove:!0,qInitialDataFetch:[{qTop:0,qLeft:0,qWidth:50,qHeight:50}],qIndentMode:!1},showTitles:!0,title:"",subtitle:"",footnote:"",nullValueRepresentation:{text:"-"},components:[]};function S3(e){return{qae:{properties:{initial:{...w3,qHyperCubeDef:{...w3.qHyperCubeDef,qIndentMode:!1}}},data:qA(e)},ext:KP(e),component(){x3(e)}}}export{S3 as default};