@watermarkinsights/ripple 6.0.0-alpha.5 → 6.0.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.
Files changed (136) hide show
  1. package/dist/cjs/{app-globals-NRWMAMhK.js → app-globals-Cmmdko_0.js} +1 -1
  2. package/dist/cjs/{chartFunctions-BPhH6tzQ.js → chartFunctions-D9F6i6V7.js} +1 -1
  3. package/dist/cjs/{index-Be663BXr.js → index-DAPkdu9y.js} +1 -1
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/priv-calendar.cjs.entry.js +1 -1
  6. package/dist/cjs/priv-chart-popover-old.cjs.entry.js +1 -1
  7. package/dist/cjs/priv-chart-popover_2.cjs.entry.js +1 -1
  8. package/dist/cjs/priv-navigator-button.cjs.entry.js +1 -1
  9. package/dist/cjs/priv-navigator-item.cjs.entry.js +1 -1
  10. package/dist/cjs/priv-option-list.cjs.entry.js +1 -1
  11. package/dist/cjs/ripple.cjs.js +2 -2
  12. package/dist/cjs/wm-action-menu_2.cjs.entry.js +1 -1
  13. package/dist/cjs/wm-button.cjs.entry.js +1 -1
  14. package/dist/cjs/wm-chart-bar.cjs.entry.js +2 -2
  15. package/dist/cjs/wm-chart-column.cjs.entry.js +2 -2
  16. package/dist/cjs/wm-chart-slice.cjs.entry.js +1 -1
  17. package/dist/cjs/wm-chart-stack.cjs.entry.js +2 -2
  18. package/dist/cjs/wm-chart.cjs.entry.js +2 -2
  19. package/dist/cjs/wm-date-range.cjs.entry.js +1 -1
  20. package/dist/cjs/wm-datepicker.cjs.entry.js +1 -1
  21. package/dist/cjs/wm-file-list.cjs.entry.js +1 -1
  22. package/dist/cjs/wm-file.cjs.entry.js +1 -1
  23. package/dist/cjs/wm-flyout.cjs.entry.js +1 -1
  24. package/dist/cjs/wm-input.cjs.entry.js +1 -1
  25. package/dist/cjs/wm-line-chart.cjs.entry.js +2 -2
  26. package/dist/cjs/wm-modal-pss_3.cjs.entry.js +1 -1
  27. package/dist/cjs/wm-modal_3.cjs.entry.js +1 -1
  28. package/dist/cjs/wm-navigation_3.cjs.entry.js +1 -1
  29. package/dist/cjs/wm-navigator.cjs.entry.js +1 -1
  30. package/dist/cjs/wm-nested-select.cjs.entry.js +1 -1
  31. package/dist/cjs/wm-optgroup.cjs.entry.js +1 -1
  32. package/dist/cjs/wm-option_2.cjs.entry.js +1 -1
  33. package/dist/cjs/wm-pagination.cjs.entry.js +1 -1
  34. package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +2 -2
  35. package/dist/cjs/wm-search.cjs.entry.js +1 -1
  36. package/dist/cjs/wm-snackbar.cjs.entry.js +1 -1
  37. package/dist/cjs/wm-tab-item_3.cjs.entry.js +1 -1
  38. package/dist/cjs/wm-tag-input.cjs.entry.js +1 -1
  39. package/dist/cjs/wm-tag-option.cjs.entry.js +1 -1
  40. package/dist/cjs/wm-textarea.cjs.entry.js +1 -1
  41. package/dist/cjs/wm-timepicker.cjs.entry.js +1 -1
  42. package/dist/cjs/wm-toggletip.cjs.entry.js +1 -1
  43. package/dist/cjs/wm-uploader.cjs.entry.js +1 -1
  44. package/dist/cjs/wm-wrapper.cjs.entry.js +1 -1
  45. package/dist/components/index.js +1 -1
  46. package/dist/docs/docs.json +1 -1
  47. package/dist/esm/{app-globals-BwSky9hq.js → app-globals-j8Ye4TR-.js} +1 -1
  48. package/dist/esm/{chartFunctions-CBFSkEpu.js → chartFunctions-C432YRnh.js} +1 -1
  49. package/dist/esm/{index-8QjlUh79.js → index-BTga6wIq.js} +1 -1
  50. package/dist/esm/loader.js +3 -3
  51. package/dist/esm/priv-calendar.entry.js +1 -1
  52. package/dist/esm/priv-chart-popover-old.entry.js +1 -1
  53. package/dist/esm/priv-chart-popover_2.entry.js +1 -1
  54. package/dist/esm/priv-navigator-button.entry.js +1 -1
  55. package/dist/esm/priv-navigator-item.entry.js +1 -1
  56. package/dist/esm/priv-option-list.entry.js +1 -1
  57. package/dist/esm/ripple.js +3 -3
  58. package/dist/esm/wm-action-menu_2.entry.js +1 -1
  59. package/dist/esm/wm-button.entry.js +1 -1
  60. package/dist/esm/wm-chart-bar.entry.js +2 -2
  61. package/dist/esm/wm-chart-column.entry.js +2 -2
  62. package/dist/esm/wm-chart-slice.entry.js +1 -1
  63. package/dist/esm/wm-chart-stack.entry.js +2 -2
  64. package/dist/esm/wm-chart.entry.js +2 -2
  65. package/dist/esm/wm-date-range.entry.js +1 -1
  66. package/dist/esm/wm-datepicker.entry.js +1 -1
  67. package/dist/esm/wm-file-list.entry.js +1 -1
  68. package/dist/esm/wm-file.entry.js +1 -1
  69. package/dist/esm/wm-flyout.entry.js +1 -1
  70. package/dist/esm/wm-input.entry.js +1 -1
  71. package/dist/esm/wm-line-chart.entry.js +2 -2
  72. package/dist/esm/wm-modal-pss_3.entry.js +1 -1
  73. package/dist/esm/wm-modal_3.entry.js +1 -1
  74. package/dist/esm/wm-navigation_3.entry.js +1 -1
  75. package/dist/esm/wm-navigator.entry.js +1 -1
  76. package/dist/esm/wm-nested-select.entry.js +1 -1
  77. package/dist/esm/wm-optgroup.entry.js +1 -1
  78. package/dist/esm/wm-option_2.entry.js +1 -1
  79. package/dist/esm/wm-pagination.entry.js +1 -1
  80. package/dist/esm/wm-progress-indicator_3.entry.js +2 -2
  81. package/dist/esm/wm-search.entry.js +1 -1
  82. package/dist/esm/wm-snackbar.entry.js +1 -1
  83. package/dist/esm/wm-tab-item_3.entry.js +1 -1
  84. package/dist/esm/wm-tag-input.entry.js +1 -1
  85. package/dist/esm/wm-tag-option.entry.js +1 -1
  86. package/dist/esm/wm-textarea.entry.js +1 -1
  87. package/dist/esm/wm-timepicker.entry.js +1 -1
  88. package/dist/esm/wm-toggletip.entry.js +1 -1
  89. package/dist/esm/wm-uploader.entry.js +1 -1
  90. package/dist/esm/wm-wrapper.entry.js +1 -1
  91. package/dist/ripple/{p-634781cb.entry.js → p-026a0c9c.entry.js} +1 -1
  92. package/dist/ripple/{p-415bfd08.entry.js → p-02cf97ae.entry.js} +1 -1
  93. package/dist/ripple/{p-900b60e8.entry.js → p-05993b67.entry.js} +1 -1
  94. package/dist/ripple/{p-c5c07087.entry.js → p-073e11bf.entry.js} +1 -1
  95. package/dist/ripple/{p-65229d30.entry.js → p-089ee1cc.entry.js} +1 -1
  96. package/dist/ripple/{p-0fc2db79.entry.js → p-0ff81ada.entry.js} +1 -1
  97. package/dist/ripple/{p-a8eb03a6.entry.js → p-199334d2.entry.js} +1 -1
  98. package/dist/ripple/{p-a040916d.entry.js → p-1e02787b.entry.js} +1 -1
  99. package/dist/ripple/{p-cce590b8.entry.js → p-2461dbe3.entry.js} +1 -1
  100. package/dist/ripple/{p-9860770c.entry.js → p-3b6b346f.entry.js} +1 -1
  101. package/dist/ripple/{p-919bf3f0.entry.js → p-41a66715.entry.js} +1 -1
  102. package/dist/ripple/{p-706439d8.entry.js → p-4908bd6a.entry.js} +1 -1
  103. package/dist/ripple/{p-1c7a09b4.entry.js → p-509feeaa.entry.js} +1 -1
  104. package/dist/ripple/{p-b79db61d.entry.js → p-5829ff7b.entry.js} +1 -1
  105. package/dist/ripple/{p-fb81ce92.entry.js → p-5a498c14.entry.js} +1 -1
  106. package/dist/ripple/{p-d71014a4.entry.js → p-5adbd23e.entry.js} +1 -1
  107. package/dist/ripple/{p-9310790e.entry.js → p-62c81d6b.entry.js} +1 -1
  108. package/dist/ripple/{p-6bc1a3cc.entry.js → p-678999d9.entry.js} +1 -1
  109. package/dist/ripple/{p-28039c47.entry.js → p-6a3c0b76.entry.js} +1 -1
  110. package/dist/ripple/{p-ede8568d.entry.js → p-6c377aa3.entry.js} +1 -1
  111. package/dist/ripple/{p-abd99ab9.entry.js → p-738de402.entry.js} +1 -1
  112. package/dist/ripple/{p-dc3440cf.entry.js → p-7ab16c20.entry.js} +1 -1
  113. package/dist/ripple/{p-a11d126a.entry.js → p-7c91ccac.entry.js} +1 -1
  114. package/dist/ripple/{p-94c4b55a.entry.js → p-83b3a4c0.entry.js} +1 -1
  115. package/dist/ripple/{p-513fb700.entry.js → p-97a12c5e.entry.js} +1 -1
  116. package/dist/ripple/{p-0dc7e0c1.entry.js → p-9d923890.entry.js} +1 -1
  117. package/dist/ripple/p-BTga6wIq.js +3 -0
  118. package/dist/ripple/{p-Di2B5GfE.js → p-BuXCv5ds.js} +1 -1
  119. package/dist/ripple/p-C2GgfujY.js +1 -0
  120. package/dist/ripple/{p-12713967.entry.js → p-a01f2397.entry.js} +1 -1
  121. package/dist/ripple/{p-f30c02a6.entry.js → p-ab6ea384.entry.js} +1 -1
  122. package/dist/ripple/{p-5b6caee4.entry.js → p-b98b4a6d.entry.js} +1 -1
  123. package/dist/ripple/{p-b3f04fe6.entry.js → p-bd776386.entry.js} +1 -1
  124. package/dist/ripple/{p-d09e4b5f.entry.js → p-c3c3f4f0.entry.js} +1 -1
  125. package/dist/ripple/{p-973f281f.entry.js → p-d51a724c.entry.js} +1 -1
  126. package/dist/ripple/{p-e59148d1.entry.js → p-e120f81a.entry.js} +1 -1
  127. package/dist/ripple/{p-a1b20e12.entry.js → p-e6fd6c63.entry.js} +1 -1
  128. package/dist/ripple/{p-660bed82.entry.js → p-ea30a5a3.entry.js} +1 -1
  129. package/dist/ripple/{p-7c7307e2.entry.js → p-eda2d1a1.entry.js} +1 -1
  130. package/dist/ripple/{p-ca22f630.entry.js → p-eeb85972.entry.js} +1 -1
  131. package/dist/ripple/{p-a581ea0f.entry.js → p-f62c8612.entry.js} +1 -1
  132. package/dist/ripple/{p-382ccd7c.entry.js → p-fc243b8a.entry.js} +1 -1
  133. package/dist/ripple/ripple.esm.js +1 -1
  134. package/package.json +1 -1
  135. package/dist/ripple/p-8QjlUh79.js +0 -3
  136. package/dist/ripple/p-DmMRZfLg.js +0 -1
@@ -1 +1 @@
1
- import{h as t}from"./p-8QjlUh79.js";import{i as s,s as e,c as i,a as n}from"./p-BhI1sXbu.js";const a="#ff5f4e",r="#19a1a9",o="#088000",h="#2e1b46",c="#8b86ca",u="#575195",l="#6b6b6b",d={doughnut:{size:155,colors:[o,l],thickness:.73,padding:25,category:"doughnut"},doughnut1:{size:130,colors:[c,h,l],thickness:.5,padding:90,category:"doughnut"},doughnut2:{size:130,colors:[u,r,h,a,l],thickness:.5,padding:90,category:"doughnut"},doughnut3:{size:130,colors:[c,h,"#0089e4",o,"#ea8500","#d54f41","#146ca9"],thickness:.5,padding:90,category:"doughnut"},bar:{size:350,colors:[o,l],padding:0,category:"stackedBar"},bar2:{size:400,colors:[l,c,u,h,r,a],padding:0,category:"stackedBar"},bar3:{size:300,colors:["#0d696e",r,"#8e4129",a],padding:0,category:"stackedBar"},bar4:{size:400,colors:[a,r,u],padding:0,category:"stackedBar"},bar5:{size:400,colors:[l,c,h,"#0089e4",o,"#ea8500","#d54f41","#146ca9"],padding:0,category:"stackedBar"},bar6:{size:400,colors:[c],padding:0,category:"simpleBar"},bar7:{size:400,colors:[u,r,a,l],padding:0,category:"simpleBar"}};function f(t){return"percentage"===t||"amount"===t?"show-values":""}const p=s.formatMessage({id:"chart.hiddenValues",defaultMessage:"Values are hidden when too close together.",description:"Text displayed when a chart has some values hidden"}),g=s.formatMessage({id:"chart.clickToSeeDetails",defaultMessage:"Click or use arrow keys to see details.",description:"Text displayed, guiding user to interact to see more details."});function b(t){return t>999||t<-999?Math.round(t/100)/10+"K":t}function m(t,s,e){return e?Math.round(100*t/s):Math.round(1e4*t/s)/100}function v(t,s){return 360*t/s}function x(t){return parseFloat((Math.floor(100*t)/100).toFixed(2))}function w(t,s,e,i){var n=x(t+t*s*Math.cos(Math.PI*e/180)),a=x(t+t*s*Math.sin(Math.PI*e/180));return void 0!==i?{x1:n,y1:a,x2:x(t+t*s*Math.cos(Math.PI*i/180)),y2:x(t+t*s*Math.sin(Math.PI*i/180))}:{x:n,y:a}}function $(t,s,e,i,n){var a=x(n/2*t);return`A ${a}, ${a} 0 ${s} ${x(e)}, ${x(i)}`}function M(t){return Math.round(t/function(t){return function(t){let s=80*(t-300)/600+70;return s<70?70:s>150?150:s}(t)}(t))}function k(t,s){const e=t/s,i=10**Math.floor(Math.log10(e)),n=e/i;let a;return a=n>5?10*i:n>3?5*i:n>2?3*i:n>1.5?2*i:n>1?1.5*i:i,a}function y(t){if(this.popoverEl&&this.popoverEl.open&&"Enter"===t.key){const t=this.popoverEl.querySelector("button");t&&t.click()}}function z(t,s){this.popoverEl&&!this.isTabbing&&(this.componentWrapperEl.classList.toggle("interactive-popover",!!s.buttonText),s.coords={x:t.clientX,y:t.clientY},B(this.popoverEl,s),O(Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex")),s))}function A(t,s){this.popoverEl&&this.isTabbing&&(this.componentWrapperEl.classList.toggle("interactive-popover",!!s.buttonText),this.focusedSliceId=s.id,s.coords=n(t.target),s.coords.x=s.coords.x+30,s.coords.y=s.coords.y+30,B(this.popoverEl,s),O(Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex")),s))}function C(t){switch(t.key){case"ArrowUp":case"ArrowLeft":t.preventDefault(),this.isTabbing=!0,T.call(this);break;case"ArrowRight":case"ArrowDown":t.preventDefault(),this.isTabbing=!0,I.call(this);break;case"Tab":j.call(this);break;case"Escape":this.popoverEl.open=!1,this.userIsNavigating=!1}}function B(t,s){t.open=!1,s.title&&s.text&&(t.sliceDetails=Object.assign({},s),window.setTimeout((()=>t.open=!0),30))}function I(){const t=i(document.activeElement),s=(this.sliceEls.indexOf(t)+1)%this.sliceEls.length;S.call(this,s)}function T(){if(this.sliceEls){const t=i(document.activeElement);let s=this.sliceEls.indexOf(t);-1===s?s=0:0===s?s=this.sliceEls.length-1:s-=1,S.call(this,s)}}function S(t){this.sliceEls&&this.el&&(this.userIsNavigating=!0,this.componentWrapperEl.tabIndex=-1,this.el.focusable=!1,this.sliceEls.map((t=>{t.tabIndex=-1,t.focusable=!1})),this.sliceEls[t].tabIndex=0,this.sliceEls[t].focusable=!0,this.sliceEls[t].focus(),this.focusedSliceId=this.sliceEls[t].id,window.setTimeout((()=>{this.popoverEl&&(this.popoverEl.open=!0)}),10))}function j(){this.focusedSliceId=void 0,this.sliceEls&&this.sliceEls.map((t=>{t.tabIndex=-1,t.focusable=!1})),this.userIsNavigating=!1,window.setTimeout((()=>{this.componentWrapperEl.tabIndex=0,this.el.focusable=!0,this.popoverEl&&(this.popoverEl.open=!1)}),100)}function D(t,s,e){const i=t[s];return null!=i&&""!==i?String(i):t.getAttribute(e)}async function F(t){this.slicesDetails=[];let s=0;const e=Array.from(this.el.children);this.total=e.reduce(((t,s)=>t+parseInt(D(s,"amount","amount")||"0")),0);let i=[...d[t].colors];"bar2"===this.chartType&&(e.length<=5&&i.splice(1,1),e.length<=4&&i.splice(2,1)),"bar3"===t&&2===e.length&&(i=[i[1],i[3]]),"doughnut2"===t&&e.length<5&&(i.splice(2,1),e.length<4&&i.shift()),"bar5"!==t||this.notStartedColor||i.shift();let n=0;e.forEach(((e,a)=>{const r=D(e,"amount","amount");if(null==r)return;const o=parseInt(r||"0"),h=m(o,this.total,!0);let c=a;"bar6"===t&&(c=0);const u={amount:o,visualAmount:o,perc:h,legend:D(e,"legend","legend"),color:i[c]||l,offset:s,id:`${this.uid}-${n+1}`,title:D(e,"popoverTitle","popover-title"),text:D(e,"popoverText","popover-text"),buttonText:D(e,"popoverButtonText","popover-button-text"),sliceRef:e,inSmallCluster:!1,index:n};s+=o,this.slicesDetails.push(u),n++}))}function K(t,s,e){const i=v(s,this.total)-90,n=t/this.total*360;let a=i+n;const r=n>180?"1 1":"0 1",o=n>180?"1 0":"0 0",h=this.chartDetails.size/2,c=this.chartDetails.thickness,u="doughnut"===e?2.25:3;360===n&&(a-=.01);const l=w(h,1,i+1.5,a),d=w(h,c,i+u,a);return`M ${l.x1}, ${l.y1} `+$(1,r,l.x2,l.y2,this.chartDetails.size)+` L ${d.x2}, ${d.y2} `+$(c,o,d.x1,d.y1,this.chartDetails.size)+" z"}function N(){const e=s.formatMessage({id:"chart.instructions",defaultMessage:"Use arrow keys to browse elements, press Tab to exit.",description:"For screen readers only, instructions on how to interact with the chart component"});return t("div",{id:"chart-instructions"},e)}function H(s){const e=this.chartDetails.size+this.chartDetails.padding,i="doughnut"===s;let n=i?this.slicesDetails:function(t,s){let e=[...t].sort(((t,s)=>t.amount===s.amount?0:t.amount>s.amount?-1:1)),i=0;return e.filter((t=>t.amount>0)).forEach(((t,n)=>{const a=e[n===e.length-1?0:n+1],r=m(e[0===n?e.length-1:n-1].amount,s,!0),o=m(a.amount,s,!0),h=0===t.perc?8:5;t.inSmallCluster=t.perc<4&&(r<h||o<h),t.offset=i,i+=t.amount})),e}(this.slicesDetails,this.total);n=function(t,s,e){const i=s.map((t=>v(t.amount,e)));if(i.some((t=>0!==t&&t<7))){const t=i.map((t=>0==t?t:Math.max(t,7))),n=t.reduce(((t,s)=>t+(s>7&&0!==s?s:0)),0),a=360-t.reduce(((t,s)=>t+(s>7&&0!==s?0:s)),0),r=(n-a)/a,o=t.map((t=>t>7?t-r*t:0==t?0:7));let h=0;s=s.map(((t,s)=>{const i=o[s]/360*e,n=h;return h+=i,Object.assign(Object.assign({},t),{visualAmount:i,offset:n})}))}return s}(0,n,this.total);const a=n[0].amount;let r=m(a,this.total,!0);return 0===r&&a>0?r="<1%":100===r&&a<this.total?r=">99%":r+="%",t("div",{class:"chart-wrapper doughnut-wrapper"},t("svg",{width:e+"px",height:e+"px",id:`graphic-${this.uid}`,class:"doughnut-svg"},t("defs",null,t("filter",{id:"wmHoverDropShadow"},t("feGaussianBlur",{stdDeviation:"3"}),t("feOffset",{result:"offsetblur"}),t("feFlood",{"flood-color":"#333"}),t("feComposite",{operator:"in",in2:"offsetblur"}),t("feMerge",null,t("feMergeNode",null),t("feMergeNode",{in:"SourceGraphic"})))),n.map((t=>W.call(this,t,s))),q.call(this),i?t("text",{class:"value",x:"50%",y:"50%","font-size":"1.5rem","font-weight":"500","text-anchor":"middle","dominant-baseline":"middle"},r):t("g",{transform:`translate(${this.chartDetails.padding/2}, ${this.chartDetails.padding/2})`,"text-anchor":"middle","dominant-baseline":"middle"},n.map((t=>t.amount>0&&!t.inSmallCluster?E.call(this,t):"")))))}function O(t,s){t.forEach((t=>{t.dataset.segmentindex&&parseInt(t.dataset.segmentindex)!==s.index?t.classList.add("faded"):t.classList.remove("faded")}))}function U(t){t.forEach((t=>{t.classList.remove("faded")}))}function W(s,e){const i=m(s.amount,this.total,!0)+"%";return!isNaN(s.amount)&&t("g",{transform:`translate(${this.chartDetails.padding/2}, ${this.chartDetails.padding/2})`},t("path",{id:s.id,class:"segment doughnut-segment",fill:s.visualAmount?s.color:"transparent",d:K.call(this,s.visualAmount,s.offset,e),onClick:t=>z.call(this,t,s),onFocus:t=>A.call(this,t,s),onKeyDown:t=>y.call(this,t),role:"img","aria-label":`${s.legend}, ${i}`,"data-segmentindex":s.index}))}function q(){return this.isTabbing?t("g",{transform:`translate(${this.chartDetails.padding/2}, ${this.chartDetails.padding/2})`},t("use",{tabindex:-1,id:"kfbg1",xlinkHref:`#${this.focusedSliceId}`}),t("use",{tabindex:-1,id:"kfstroke",xlinkHref:`#${this.focusedSliceId}`}),t("use",{tabindex:-1,id:"kfbg2",xlinkHref:`#${this.focusedSliceId}`})):""}function E(s){const e=v(s.offset+s.visualAmount/2,this.total);let i,{x:n,y:a}=w(this.chartDetails.size/2,1.4,e-90);return i=0===s.perc&&s.amount>0?"<1%":100===s.perc&&s.amount<this.total?">99%":s.perc+"%",t("text",{class:"value",x:n+"px",y:a+"px","data-segmentindex":s.index},i)}function G(s){const e="bar"===s,i=this.el.shadowRoot.querySelectorAll(".value");return i.length>0&&requestAnimationFrame((()=>{let t=[],s=!1;i.forEach((e=>{e.classList.remove("hidden");const i=parseInt(e.dataset.value);if(t.length>0&&0!=i){const n=e.getBoundingClientRect().left-4;t.forEach((t=>{const a=parseInt(t.dataset.value);t.getBoundingClientRect().right>n&&((i<a?e:t).classList.add("hidden"),s=!0)}))}!e.classList.contains("hidden")&&i>0&&t.push(e)})),(this.isBar||this.isDoughnut)&&this.showHiddenValuesMessage(s)})),t("div",{class:"chart-wrapper bar-wrapper"},e?t("div",{class:"single-perc"},m(this.slicesDetails[0].amount,this.total,!0)+"%"):"","bar3"===this.chartType&&this.drawAxis(),t("div",{class:`inner-stacked-bar-wrapper ${f(this.valueFormat)}`},e?"":t("div",{class:`values ${this.valueFormat}`},this.slicesDetails.map((t=>this.renderBarText(t,5)))),t("div",{class:"stacked-bar-segments-wrapper"},this.slicesDetails.map((t=>L.call(this,t,5)))),e?J.call(this):""),"bar3"===this.chartType?t("div",{class:"bar3-axis-label","aria-hidden":"true"},t("span",null,"0%"),t("span",null,"100%")):"")}function L(s,e){const i=m(s.amount,this.total,!1),n=this.el.shadowRoot.querySelector(".stacked-bar-segments-wrapper"),a=i/100*(n?n.offsetWidth:this.el.offsetWidth)>=e,r=a||0==s.amount?`${i}%`:`${e}px`;let o="";return"percentage"==this.valueFormat?o=`${m(s.amount,this.total,!0)} %`:"amount"==this.valueFormat&&(o=s.amount.toString()),t("div",{class:`segment stacked-bar-segment ${0===m(s.amount,this.total,!1)?"zero":""} ${a?"":"fixed-width"}`,style:{backgroundColor:s.color,width:r},onClick:t=>z.call(this,t,s),onFocus:t=>A.call(this,t,s),onKeyDown:t=>y.call(this,t),"data-segmentindex":s.index},t("span",{class:"sr-only"},`${s.legend} ${o}`))}function R(s){const i=this.slicesDetails.map((t=>t.amount)).reduce(((t,s)=>t>s?t:s)),n=parseInt(getComputedStyle(this.el).getPropertyValue("--labelWidth"),10);let a=M(this.el.getBoundingClientRect().width-n-48),r=k(i,a);const o=Math.floor((a*r-i)/r);a-=o,this.el.style.setProperty("--backgroundSize",100/a+"%"),this.el.style.setProperty("--labelWidth",this.labelWidth),"bar7"!==s||this.showBarLegend||this.el.style.setProperty("--labelWidth","0px");const h=[];this.slicesDetails.forEach((e=>{e.legend&&h.push(function(s,e,i){return t("label",{class:`label${"bar7"!==i||e?"":" hidden"}`},s)}(e.legend,this.showBarLegend,s)),h.push(V.call(this,e,r,a,i))}));const c=[];for(let s=1;s<=a;s++){const i=b(e(s,r));c.push(t("div",{class:"tick"},t("span",null,i)))}const u="bar6"===s&&this.showGrid&&this.el.getBoundingClientRect().width>300;return t("div",{class:"chart-wrapper simple-bar-wrapper"},t("div",{class:`chart ${f(this.valueFormat)}`},u&&t("div",{class:"gridlines"}),t("div",{class:"rows"},h)),u&&t("div",{class:"x-axis","aria-hidden":"true"},t("div",{class:"zero"},t("span",null,"0")),c))}function V(s,e,i,n){const a=m(s.amount,"bar6"===this.currentChartType?e*i:n,!1),r=a?a+"%":"1px",o=b(s.amount);let h="amount"===this.valueFormat?o:"";return"bar6"===this.currentChartType&&"percentage"===this.valueFormat?h=s.amount+"%":"bar7"===this.currentChartType&&"percentage"===this.valueFormat&&(h=(0===this.total?"0":m(s.amount,this.total,!0))+"%"),t("div",{class:"bar segment",style:{backgroundColor:s.color,width:r},onClick:t=>z.call(this,t,s),onFocus:t=>A.call(this,t,s),onKeyDown:t=>y.call(this,t),"data-segmentindex":s.index},t("div",{class:"value"},h))}function Q(s){if(this.showLegend){const e=this.slicesDetails.reduce(((t,s)=>!!s.inSmallCluster||t),!1);return this.isDoughnut&&this.showHiddenValuesMessage(e),t("div",{class:"legend-wrapper"},t("div",{class:`legend ${s} ${"bar"===this.mode?"--top":"--bottom"}`,"aria-hidden":"true"},this.slicesDetails.map((t=>{const s="amount"==this.printModeFormat?`${t.amount}/${this.total}`:`${m(t.amount,this.total,!0)}%`;if(t.amount||t.legend)return X.call(this,{key:t.legend,color:t.color},s,t)}))),this.isDoughnut&&!this.printMode&&P())}}function X(s,e="",i=null){const n=t=>{i&&(i.coords={x:t.clientX,y:t.clientY},B(this.popoverEl,i),O(Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex")),i))};return t("div",{class:"legend-item",onClick:t=>n(t),"data-segmentindex":i?i.index:null},t("div",{class:"legend-color",style:{backgroundColor:s.color}}),t("div",{class:"legend-text"},s.key,e&&t("span",{class:"print-value "+(this.printMode?"force-visible":"")},": ",e)))}function J(){if(this.completionMessage)return t("div",{class:"completion-message"},this.completionMessage)}function P(){return t("div",{class:"hidden-values-warning hidden"},p,t("br",null),g)}function Y(t,s,e,i=0){switch(e){case"amount":return t.toFixed(i);case"percentage":const e=t/s*100;return t>0&&e<1?"<1%":e>99&&t!==s?">99%":`${Math.round(e).toFixed(0)}%`;default:return""}}function Z(t,s=[1,1.5,2,2.5,3,5,10]){const e=t/Math.pow(10,Math.floor(Math.log10(t)));return s.some((t=>Math.abs(e-t)<1e-4))}function _(t){if(0===t||!Number.isFinite(t))return 0;let s=Math.abs(t);for(let t=0;t<=15;t++){const e=Math.round(s),i=1e-9;if(Math.abs(s-e)<i)return t;s*=10}return 2}function tt(t){if(0===t||!Number.isFinite(t))return 0;const s=Math.abs(t);let e=s;return s>=1e6?e=s/1e6:s>=1e3&&(e=s/1e3),Math.max(_(s),_(e))}function st(t,s){const e=void 0!==s;if(t>=1e6){const i=t/1e6;return e?`${i.toFixed(s)}M`:`${i.toFixed(t%1e6==0?0:1)}M`}if(t>=1e3){const i=t/1e3;return e?`${i.toFixed(s)}K`:`${i.toFixed(t%1e3==0?0:1)}K`}return e?t.toFixed(s):t.toString()}function et(t,s){for(let e=t;e>=1;e--){const t=s/e;if(Z(t))return{numIntervals:e,interval:t}}return{numIntervals:1,interval:s}}function it(t){if(t<=0)return 0;const s=[1,1.5,2,2.5,3,5,10],e=Math.pow(10,Math.floor(Math.log10(t))),i=t/e;for(const t of s)if(t>=i)return t*e;return 10*e}function nt(t){const s=new Set,e=[];return t.forEach((t=>{t.forEach((t=>{s.has(t.barLegend)||(s.add(t.barLegend),e.push(t))}))})),e}function at(t){const s=new Map;return t.forEach((t=>{var e;let i=null!==(e=t.groupName)&&void 0!==e?e:null;s.has(i)||s.set(i,[]),s.get(i).push(t)})),s}function rt(t){const s=[...t],e=[];s.forEach((t=>{t.groupName&&!e.includes(t.groupName)&&e.push(t.groupName)}));const i=s.filter((t=>t.groupName===e[0])).map((t=>t.barLegend));return s.sort(((t,s)=>{const n=e.indexOf(t.groupName||""),a=e.indexOf(s.groupName||"");return n!==a?n-a:i.indexOf(t.barLegend)-i.indexOf(s.barLegend)}))}export{d as a,m as b,R as c,G as d,H as e,N as f,F as g,C as h,Q as i,P as j,j as k,Y as l,it as m,nt as n,at as o,et as p,st as q,U as r,rt as s,M as t,tt as u,k as v,J as w,X as x}
1
+ import{h as t}from"./p-BTga6wIq.js";import{i as s,s as e,c as i,a as n}from"./p-BhI1sXbu.js";const a="#ff5f4e",r="#19a1a9",o="#088000",h="#2e1b46",c="#8b86ca",u="#575195",l="#6b6b6b",d={doughnut:{size:155,colors:[o,l],thickness:.73,padding:25,category:"doughnut"},doughnut1:{size:130,colors:[c,h,l],thickness:.5,padding:90,category:"doughnut"},doughnut2:{size:130,colors:[u,r,h,a,l],thickness:.5,padding:90,category:"doughnut"},doughnut3:{size:130,colors:[c,h,"#0089e4",o,"#ea8500","#d54f41","#146ca9"],thickness:.5,padding:90,category:"doughnut"},bar:{size:350,colors:[o,l],padding:0,category:"stackedBar"},bar2:{size:400,colors:[l,c,u,h,r,a],padding:0,category:"stackedBar"},bar3:{size:300,colors:["#0d696e",r,"#8e4129",a],padding:0,category:"stackedBar"},bar4:{size:400,colors:[a,r,u],padding:0,category:"stackedBar"},bar5:{size:400,colors:[l,c,h,"#0089e4",o,"#ea8500","#d54f41","#146ca9"],padding:0,category:"stackedBar"},bar6:{size:400,colors:[c],padding:0,category:"simpleBar"},bar7:{size:400,colors:[u,r,a,l],padding:0,category:"simpleBar"}};function f(t){return"percentage"===t||"amount"===t?"show-values":""}const p=s.formatMessage({id:"chart.hiddenValues",defaultMessage:"Values are hidden when too close together.",description:"Text displayed when a chart has some values hidden"}),g=s.formatMessage({id:"chart.clickToSeeDetails",defaultMessage:"Click or use arrow keys to see details.",description:"Text displayed, guiding user to interact to see more details."});function b(t){return t>999||t<-999?Math.round(t/100)/10+"K":t}function m(t,s,e){return e?Math.round(100*t/s):Math.round(1e4*t/s)/100}function v(t,s){return 360*t/s}function x(t){return parseFloat((Math.floor(100*t)/100).toFixed(2))}function w(t,s,e,i){var n=x(t+t*s*Math.cos(Math.PI*e/180)),a=x(t+t*s*Math.sin(Math.PI*e/180));return void 0!==i?{x1:n,y1:a,x2:x(t+t*s*Math.cos(Math.PI*i/180)),y2:x(t+t*s*Math.sin(Math.PI*i/180))}:{x:n,y:a}}function $(t,s,e,i,n){var a=x(n/2*t);return`A ${a}, ${a} 0 ${s} ${x(e)}, ${x(i)}`}function M(t){return Math.round(t/function(t){return function(t){let s=80*(t-300)/600+70;return s<70?70:s>150?150:s}(t)}(t))}function k(t,s){const e=t/s,i=10**Math.floor(Math.log10(e)),n=e/i;let a;return a=n>5?10*i:n>3?5*i:n>2?3*i:n>1.5?2*i:n>1?1.5*i:i,a}function y(t){if(this.popoverEl&&this.popoverEl.open&&"Enter"===t.key){const t=this.popoverEl.querySelector("button");t&&t.click()}}function z(t,s){this.popoverEl&&!this.isTabbing&&(this.componentWrapperEl.classList.toggle("interactive-popover",!!s.buttonText),s.coords={x:t.clientX,y:t.clientY},C(this.popoverEl,s),O(Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex")),s))}function A(t,s){this.popoverEl&&this.isTabbing&&(this.componentWrapperEl.classList.toggle("interactive-popover",!!s.buttonText),this.focusedSliceId=s.id,s.coords=n(t.target),s.coords.x=s.coords.x+30,s.coords.y=s.coords.y+30,C(this.popoverEl,s),O(Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex")),s))}function B(t){switch(t.key){case"ArrowUp":case"ArrowLeft":t.preventDefault(),this.isTabbing=!0,T.call(this);break;case"ArrowRight":case"ArrowDown":t.preventDefault(),this.isTabbing=!0,I.call(this);break;case"Tab":D.call(this);break;case"Escape":this.popoverEl.open=!1,this.userIsNavigating=!1}}function C(t,s){t.open=!1,s.title&&s.text&&(t.sliceDetails=Object.assign({},s),window.setTimeout((()=>t.open=!0),30))}function I(){const t=i(document.activeElement),s=(this.sliceEls.indexOf(t)+1)%this.sliceEls.length;S.call(this,s)}function T(){if(this.sliceEls){const t=i(document.activeElement);let s=this.sliceEls.indexOf(t);-1===s?s=0:0===s?s=this.sliceEls.length-1:s-=1,S.call(this,s)}}function S(t){this.sliceEls&&this.el&&(this.userIsNavigating=!0,this.componentWrapperEl.tabIndex=-1,this.el.focusable=!1,this.sliceEls.map((t=>{t.tabIndex=-1,t.focusable=!1})),this.sliceEls[t].tabIndex=0,this.sliceEls[t].focusable=!0,this.sliceEls[t].focus(),this.focusedSliceId=this.sliceEls[t].id,window.setTimeout((()=>{this.popoverEl&&(this.popoverEl.open=!0)}),10))}function D(){this.focusedSliceId=void 0,this.sliceEls&&this.sliceEls.map((t=>{t.tabIndex=-1,t.focusable=!1})),this.userIsNavigating=!1,window.setTimeout((()=>{this.componentWrapperEl.tabIndex=0,this.el.focusable=!0,this.popoverEl&&(this.popoverEl.open=!1)}),100)}function F(t,s,e){const i=t[s];return null!=i&&""!==i?String(i):t.getAttribute(e)}async function j(t){this.slicesDetails=[];let s=0;const e=Array.from(this.el.children);this.total=e.reduce(((t,s)=>t+parseInt(F(s,"amount","amount")||"0")),0);let i=[...d[t].colors];"bar2"===this.chartType&&(e.length<=5&&i.splice(1,1),e.length<=4&&i.splice(2,1)),"bar3"===t&&2===e.length&&(i=[i[1],i[3]]),"doughnut2"===t&&e.length<5&&(i.splice(2,1),e.length<4&&i.shift()),"bar5"!==t||this.notStartedColor||i.shift();let n=0;e.forEach(((e,a)=>{const r=F(e,"amount","amount");if(null==r)return;const o=parseInt(r||"0"),h=m(o,this.total,!0);let c=a;"bar6"===t&&(c=0);const u={amount:o,visualAmount:o,perc:h,legend:F(e,"legend","legend"),color:i[c]||l,offset:s,id:`${this.uid}-${n+1}`,title:F(e,"popoverTitle","popover-title"),text:F(e,"popoverText","popover-text"),buttonText:F(e,"popoverButtonText","popover-button-text"),sliceRef:e,inSmallCluster:!1,index:n};s+=o,this.slicesDetails.push(u),n++}))}function K(t,s,e){const i=v(s,this.total)-90,n=t/this.total*360;let a=i+n;const r=n>180?"1 1":"0 1",o=n>180?"1 0":"0 0",h=this.chartDetails.size/2,c=this.chartDetails.thickness,u="doughnut"===e?2.25:3;360===n&&(a-=.01);const l=w(h,1,i+1.5,a),d=w(h,c,i+u,a);return`M ${l.x1}, ${l.y1} `+$(1,r,l.x2,l.y2,this.chartDetails.size)+` L ${d.x2}, ${d.y2} `+$(c,o,d.x1,d.y1,this.chartDetails.size)+" z"}function N(){const e=s.formatMessage({id:"chart.instructions",defaultMessage:"Use arrow keys to browse elements, press Tab to exit.",description:"For screen readers only, instructions on how to interact with the chart component"});return t("div",{id:"chart-instructions"},e)}function H(s){const e=this.chartDetails.size+this.chartDetails.padding,i="doughnut"===s;let n=i?this.slicesDetails:function(t,s){let e=[...t].sort(((t,s)=>t.amount===s.amount?0:t.amount>s.amount?-1:1)),i=0;return e.filter((t=>t.amount>0)).forEach(((t,n)=>{const a=e[n===e.length-1?0:n+1],r=m(e[0===n?e.length-1:n-1].amount,s,!0),o=m(a.amount,s,!0),h=0===t.perc?8:5;t.inSmallCluster=t.perc<4&&(r<h||o<h),t.offset=i,i+=t.amount})),e}(this.slicesDetails,this.total);n=function(t,s,e){const i=s.map((t=>v(t.amount,e)));if(i.some((t=>0!==t&&t<7))){const t=i.map((t=>0==t?t:Math.max(t,7))),n=t.reduce(((t,s)=>t+(s>7&&0!==s?s:0)),0),a=360-t.reduce(((t,s)=>t+(s>7&&0!==s?0:s)),0),r=(n-a)/a,o=t.map((t=>t>7?t-r*t:0==t?0:7));let h=0;s=s.map(((t,s)=>{const i=o[s]/360*e,n=h;return h+=i,Object.assign(Object.assign({},t),{visualAmount:i,offset:n})}))}return s}(0,n,this.total);const a=n[0].amount;let r=m(a,this.total,!0);return 0===r&&a>0?r="<1%":100===r&&a<this.total?r=">99%":r+="%",t("div",{class:"chart-wrapper doughnut-wrapper"},t("svg",{width:e+"px",height:e+"px",id:`graphic-${this.uid}`,class:"doughnut-svg"},t("defs",null,t("filter",{id:"wmHoverDropShadow"},t("feGaussianBlur",{stdDeviation:"3"}),t("feOffset",{result:"offsetblur"}),t("feFlood",{"flood-color":"#333"}),t("feComposite",{operator:"in",in2:"offsetblur"}),t("feMerge",null,t("feMergeNode",null),t("feMergeNode",{in:"SourceGraphic"})))),n.map((t=>W.call(this,t,s))),E.call(this),i?t("text",{class:"value",x:"50%",y:"50%","font-size":"1.5rem","font-weight":"500","text-anchor":"middle","dominant-baseline":"middle"},r):t("g",{transform:`translate(${this.chartDetails.padding/2}, ${this.chartDetails.padding/2})`,"text-anchor":"middle","dominant-baseline":"middle"},n.map((t=>t.amount>0&&!t.inSmallCluster?G.call(this,t):"")))))}function O(t,s){t.forEach((t=>{t.dataset.segmentindex&&parseInt(t.dataset.segmentindex)!==s.index?t.classList.add("faded"):t.classList.remove("faded")}))}function q(t){t.forEach((t=>{t.classList.remove("faded")}))}function W(s,e){const i=m(s.amount,this.total,!0)+"%";return!isNaN(s.amount)&&t("g",{transform:`translate(${this.chartDetails.padding/2}, ${this.chartDetails.padding/2})`},t("path",{id:s.id,class:"segment doughnut-segment",fill:s.visualAmount?s.color:"transparent",d:K.call(this,s.visualAmount,s.offset,e),onClick:t=>z.call(this,t,s),onFocus:t=>A.call(this,t,s),onKeyDown:t=>y.call(this,t),role:"img","aria-label":`${s.legend}, ${i}`,"data-segmentindex":s.index}))}function E(){return this.isTabbing?t("g",{transform:`translate(${this.chartDetails.padding/2}, ${this.chartDetails.padding/2})`},t("use",{tabindex:-1,id:"kfbg1",xlinkHref:`#${this.focusedSliceId}`}),t("use",{tabindex:-1,id:"kfstroke",xlinkHref:`#${this.focusedSliceId}`}),t("use",{tabindex:-1,id:"kfbg2",xlinkHref:`#${this.focusedSliceId}`})):""}function G(s){const e=v(s.offset+s.visualAmount/2,this.total);let i,{x:n,y:a}=w(this.chartDetails.size/2,1.4,e-90);return i=0===s.perc&&s.amount>0?"<1%":100===s.perc&&s.amount<this.total?">99%":s.perc+"%",t("text",{class:"value",x:n+"px",y:a+"px","data-segmentindex":s.index},i)}function L(s){const e="bar"===s,i=this.el.shadowRoot.querySelectorAll(".value");return i.length>0&&requestAnimationFrame((()=>{let t=[],s=!1;i.forEach((e=>{e.classList.remove("hidden");const i=parseInt(e.dataset.value);if(t.length>0&&0!=i){const n=e.getBoundingClientRect().left-4;t.forEach((t=>{const a=parseInt(t.dataset.value);t.getBoundingClientRect().right>n&&((i<a?e:t).classList.add("hidden"),s=!0)}))}!e.classList.contains("hidden")&&i>0&&t.push(e)})),(this.isBar||this.isDoughnut)&&this.showHiddenValuesMessage(s)})),t("div",{class:"chart-wrapper bar-wrapper"},e?t("div",{class:"single-perc"},m(this.slicesDetails[0].amount,this.total,!0)+"%"):"","bar3"===this.chartType&&this.drawAxis(),t("div",{class:`inner-stacked-bar-wrapper ${f(this.valueFormat)}`},e?"":t("div",{class:`values ${this.valueFormat}`},this.slicesDetails.map((t=>this.renderBarText(t,5)))),t("div",{class:"stacked-bar-segments-wrapper"},this.slicesDetails.map((t=>R.call(this,t,5)))),e?P.call(this):""),"bar3"===this.chartType?t("div",{class:"bar3-axis-label","aria-hidden":"true"},t("span",null,"0%"),t("span",null,"100%")):"")}function R(s,e){const i=m(s.amount,this.total,!1),n=this.el.shadowRoot.querySelector(".stacked-bar-segments-wrapper"),a=i/100*(n?n.offsetWidth:this.el.offsetWidth)>=e,r=a||0==s.amount?`${i}%`:`${e}px`;let o="";return"percentage"==this.valueFormat?o=`${m(s.amount,this.total,!0)} %`:"amount"==this.valueFormat&&(o=s.amount.toString()),t("div",{class:`segment stacked-bar-segment ${0===m(s.amount,this.total,!1)?"zero":""} ${a?"":"fixed-width"}`,style:{backgroundColor:s.color,width:r},onClick:t=>z.call(this,t,s),onFocus:t=>A.call(this,t,s),onKeyDown:t=>y.call(this,t),"data-segmentindex":s.index},t("span",{class:"sr-only"},`${s.legend} ${o}`))}function U(s){const i=this.slicesDetails.map((t=>t.amount)).reduce(((t,s)=>t>s?t:s)),n=parseInt(getComputedStyle(this.el).getPropertyValue("--labelWidth"),10);let a=M(this.el.getBoundingClientRect().width-n-48),r=k(i,a);const o=Math.floor((a*r-i)/r);a-=o,this.el.style.setProperty("--backgroundSize",100/a+"%"),this.el.style.setProperty("--labelWidth",this.labelWidth),"bar7"!==s||this.showBarLegend||this.el.style.setProperty("--labelWidth","0px");const h=[];this.slicesDetails.forEach((e=>{e.legend&&h.push(function(s,e,i){return t("label",{class:`label${"bar7"!==i||e?"":" hidden"}`},s)}(e.legend,this.showBarLegend,s)),h.push(V.call(this,e,r,a,i))}));const c=[];for(let s=1;s<=a;s++){const i=b(e(s,r));c.push(t("div",{class:"tick"},t("span",null,i)))}const u="bar6"===s&&this.showGrid&&this.el.getBoundingClientRect().width>300;return t("div",{class:"chart-wrapper simple-bar-wrapper"},t("div",{class:`chart ${f(this.valueFormat)}`},u&&t("div",{class:"gridlines"}),t("div",{class:"rows"},h)),u&&t("div",{class:"x-axis","aria-hidden":"true"},t("div",{class:"zero"},t("span",null,"0")),c))}function V(s,e,i,n){const a=m(s.amount,"bar6"===this.currentChartType?e*i:n,!1),r=a?a+"%":"1px",o=b(s.amount);let h="amount"===this.valueFormat?o:"";return"bar6"===this.currentChartType&&"percentage"===this.valueFormat?h=s.amount+"%":"bar7"===this.currentChartType&&"percentage"===this.valueFormat&&(h=(0===this.total?"0":m(s.amount,this.total,!0))+"%"),t("div",{class:"bar segment",style:{backgroundColor:s.color,width:r},onClick:t=>z.call(this,t,s),onFocus:t=>A.call(this,t,s),onKeyDown:t=>y.call(this,t),"data-segmentindex":s.index},t("div",{class:"value"},h))}function X(s){if(this.showLegend){const e=this.slicesDetails.reduce(((t,s)=>!!s.inSmallCluster||t),!1);return this.isDoughnut&&this.showHiddenValuesMessage(e),t("div",{class:"legend-wrapper"},t("div",{class:`legend ${s} ${"bar"===this.mode?"--top":"--bottom"}`,"aria-hidden":"true"},this.slicesDetails.map((t=>{const s="amount"==this.printModeFormat?`${t.amount}/${this.total}`:`${m(t.amount,this.total,!0)}%`;if(t.amount||t.legend)return J.call(this,{key:t.legend,color:t.color},s,t)}))),this.isDoughnut&&!this.printMode&&Q())}}function J(s,e="",i=null){const n=t=>{i&&(i.coords={x:t.clientX,y:t.clientY},C(this.popoverEl,i),O(Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex")),i))};return t("div",{class:"legend-item",onClick:t=>n(t),"data-segmentindex":i?i.index:null},t("div",{class:"legend-color",style:{backgroundColor:s.color}}),t("div",{class:"legend-text"},s.key,e&&t("span",{class:"print-value "+(this.printMode?"force-visible":"")},": ",e)))}function P(){if(this.completionMessage)return t("div",{class:"completion-message"},this.completionMessage)}function Q(){return t("div",{class:"hidden-values-warning hidden"},p,t("br",null),g)}function Y(t,s,e,i=0){switch(e){case"amount":return t.toFixed(i);case"percentage":const e=t/s*100;return t>0&&e<1?"<1%":e>99&&t!==s?">99%":`${Math.round(e).toFixed(0)}%`;default:return""}}function Z(t,s=[1,1.5,2,2.5,3,5,10]){const e=t/Math.pow(10,Math.floor(Math.log10(t)));return s.some((t=>Math.abs(e-t)<1e-4))}function _(t){if(0===t||!Number.isFinite(t))return 0;let s=Math.abs(t);for(let t=0;t<=15;t++){const e=Math.round(s),i=1e-9;if(Math.abs(s-e)<i)return t;s*=10}return 2}function tt(t){if(0===t||!Number.isFinite(t))return 0;const s=Math.abs(t);let e=s;return s>=1e6?e=s/1e6:s>=1e3&&(e=s/1e3),Math.max(_(s),_(e))}function st(t,s){const e=void 0!==s;if(t>=1e6){const i=t/1e6;return e?`${i.toFixed(s)}M`:`${i.toFixed(t%1e6==0?0:1)}M`}if(t>=1e3){const i=t/1e3;return e?`${i.toFixed(s)}K`:`${i.toFixed(t%1e3==0?0:1)}K`}return e?t.toFixed(s):t.toString()}function et(t,s){for(let e=t;e>=1;e--){const t=s/e;if(Z(t))return{numIntervals:e,interval:t}}return{numIntervals:1,interval:s}}function it(t){if(t<=0)return 0;const s=[1,1.5,2,2.5,3,5,10],e=Math.pow(10,Math.floor(Math.log10(t))),i=t/e;for(const t of s)if(t>=i)return t*e;return 10*e}function nt(t){const s=new Set,e=[];return t.forEach((t=>{t.forEach((t=>{s.has(t.barLegend)||(s.add(t.barLegend),e.push(t))}))})),e}function at(t){const s=new Map;return t.forEach((t=>{var e;let i=null!==(e=t.groupName)&&void 0!==e?e:null;s.has(i)||s.set(i,[]),s.get(i).push(t)})),s}function rt(t){const s=[...t],e=[];s.forEach((t=>{t.groupName&&!e.includes(t.groupName)&&e.push(t.groupName)}));const i=s.filter((t=>t.groupName===e[0])).map((t=>t.barLegend));return s.sort(((t,s)=>{const n=e.indexOf(t.groupName||""),a=e.indexOf(s.groupName||"");return n!==a?n-a:i.indexOf(t.barLegend)-i.indexOf(s.barLegend)}))}export{d as a,m as b,U as c,L as d,H as e,N as f,j as g,B as h,X as i,Q as j,D as k,Y as l,it as m,nt as n,at as o,et as p,st as q,q as r,rt as s,M as t,tt as u,k as v,P as w,J as x}
@@ -0,0 +1 @@
1
+ import{g as o}from"./p-BTga6wIq.js";const s=o||(()=>{});export{s as g}