@watermarkinsights/ripple 3.36.0 → 3.37.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 (221) hide show
  1. package/dist/cjs/{chartFunctions-41c67866.js → chartFunctions-4d828b26.js} +2 -2
  2. package/dist/cjs/{functions-45f36418.js → functions-0c27162e.js} +38 -22
  3. package/dist/{esm/global-1dca883b.js → cjs/global-a2ca8069.js} +13 -3
  4. package/dist/cjs/{index-670c5d2a.js → index-fae02cd7.js} +386 -8
  5. package/dist/cjs/{intl-a84cd5ef.js → intl-022a42a1.js} +1 -1
  6. package/dist/cjs/loader.cjs.js +3 -3
  7. package/dist/cjs/priv-chart-popover.cjs.entry.js +2 -2
  8. package/dist/cjs/priv-datepicker.cjs.entry.js +2 -2
  9. package/dist/cjs/priv-navigator-button.cjs.entry.js +1 -1
  10. package/dist/cjs/priv-navigator-item.cjs.entry.js +1 -1
  11. package/dist/cjs/ripple.cjs.js +3 -3
  12. package/dist/cjs/wm-action-menu_2.cjs.entry.js +2 -2
  13. package/dist/cjs/wm-button.cjs.entry.js +2 -2
  14. package/dist/cjs/wm-chart-slice.cjs.entry.js +1 -1
  15. package/dist/cjs/wm-chart.cjs.entry.js +4 -4
  16. package/dist/cjs/wm-datepicker.cjs.entry.js +2 -2
  17. package/dist/cjs/wm-file-list.cjs.entry.js +1 -1
  18. package/dist/cjs/wm-file.cjs.entry.js +2 -2
  19. package/dist/cjs/wm-input.cjs.entry.js +3 -3
  20. package/dist/cjs/wm-line-chart.cjs.entry.js +4 -4
  21. package/dist/cjs/wm-modal-footer.cjs.entry.js +13 -16
  22. package/dist/cjs/wm-modal-header.cjs.entry.js +8 -18
  23. package/dist/cjs/wm-modal.cjs.entry.js +27 -58
  24. package/dist/cjs/wm-navigation_3.cjs.entry.js +3 -3
  25. package/dist/cjs/wm-navigator.cjs.entry.js +2 -2
  26. package/dist/cjs/wm-network-uploader.cjs.entry.js +3 -3
  27. package/dist/cjs/wm-option_2.cjs.entry.js +3 -3
  28. package/dist/cjs/wm-pagination.cjs.entry.js +2 -2
  29. package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +3 -3
  30. package/dist/cjs/wm-search.cjs.entry.js +3 -3
  31. package/dist/cjs/wm-snackbar.cjs.entry.js +3 -3
  32. package/dist/cjs/wm-tab-item_3.cjs.entry.js +2 -2
  33. package/dist/cjs/wm-tag-input-row.cjs.entry.js +1 -1
  34. package/dist/cjs/wm-tag-input.cjs.entry.js +3 -3
  35. package/dist/cjs/wm-timepicker.cjs.entry.js +2 -2
  36. package/dist/cjs/wm-toggletip.cjs.entry.js +2 -2
  37. package/dist/cjs/wm-uploader.cjs.entry.js +3 -3
  38. package/dist/cjs/wm-wrapper.cjs.entry.js +1 -1
  39. package/dist/collection/components/wm-modal/wm-modal-footer.css +1 -1
  40. package/dist/collection/components/wm-modal/wm-modal-footer.js +11 -14
  41. package/dist/collection/components/wm-modal/wm-modal-header.css +1 -1
  42. package/dist/collection/components/wm-modal/wm-modal-header.js +4 -14
  43. package/dist/collection/components/wm-modal/wm-modal.css +27 -65
  44. package/dist/collection/components/wm-modal/wm-modal.js +24 -71
  45. package/dist/collection/components/wm-modal/wm-modal.spec.js +0 -28
  46. package/dist/collection/global/functions.js +38 -22
  47. package/dist/collection/global/global.js +10 -2
  48. package/dist/esm/{chartFunctions-e539d991.js → chartFunctions-f4f3252e.js} +2 -2
  49. package/dist/esm/{functions-7fc7cf30.js → functions-d52b728c.js} +39 -23
  50. package/dist/{cjs/global-c795cff3.js → esm/global-06801d00.js} +11 -5
  51. package/dist/esm/{index-294d486f.js → index-7e11ea42.js} +386 -8
  52. package/dist/esm/{intl-f0475a8e.js → intl-9809c77c.js} +1 -1
  53. package/dist/esm/loader.js +4 -4
  54. package/dist/esm/polyfills/core-js.js +0 -0
  55. package/dist/esm/polyfills/dom.js +0 -0
  56. package/dist/esm/polyfills/es5-html-element.js +0 -0
  57. package/dist/esm/polyfills/index.js +0 -0
  58. package/dist/esm/polyfills/system.js +0 -0
  59. package/dist/esm/priv-chart-popover.entry.js +2 -2
  60. package/dist/esm/priv-datepicker.entry.js +2 -2
  61. package/dist/esm/priv-navigator-button.entry.js +1 -1
  62. package/dist/esm/priv-navigator-item.entry.js +1 -1
  63. package/dist/esm/ripple.js +4 -4
  64. package/dist/esm/wm-action-menu_2.entry.js +2 -2
  65. package/dist/esm/wm-button.entry.js +2 -2
  66. package/dist/esm/wm-chart-slice.entry.js +1 -1
  67. package/dist/esm/wm-chart.entry.js +4 -4
  68. package/dist/esm/wm-datepicker.entry.js +2 -2
  69. package/dist/esm/wm-file-list.entry.js +1 -1
  70. package/dist/esm/wm-file.entry.js +2 -2
  71. package/dist/esm/wm-input.entry.js +3 -3
  72. package/dist/esm/wm-line-chart.entry.js +4 -4
  73. package/dist/esm/wm-modal-footer.entry.js +13 -16
  74. package/dist/esm/wm-modal-header.entry.js +8 -18
  75. package/dist/esm/wm-modal.entry.js +27 -58
  76. package/dist/esm/wm-navigation_3.entry.js +3 -3
  77. package/dist/esm/wm-navigator.entry.js +2 -2
  78. package/dist/esm/wm-network-uploader.entry.js +3 -3
  79. package/dist/esm/wm-option_2.entry.js +3 -3
  80. package/dist/esm/wm-pagination.entry.js +2 -2
  81. package/dist/esm/wm-progress-indicator_3.entry.js +3 -3
  82. package/dist/esm/wm-search.entry.js +3 -3
  83. package/dist/esm/wm-snackbar.entry.js +3 -3
  84. package/dist/esm/wm-tab-item_3.entry.js +2 -2
  85. package/dist/esm/wm-tag-input-row.entry.js +1 -1
  86. package/dist/esm/wm-tag-input.entry.js +3 -3
  87. package/dist/esm/wm-timepicker.entry.js +2 -2
  88. package/dist/esm/wm-toggletip.entry.js +2 -2
  89. package/dist/esm/wm-uploader.entry.js +3 -3
  90. package/dist/esm/wm-wrapper.entry.js +1 -1
  91. package/dist/esm-es5/{chartFunctions-e539d991.js → chartFunctions-f4f3252e.js} +1 -1
  92. package/dist/esm-es5/{functions-7fc7cf30.js → functions-d52b728c.js} +1 -1
  93. package/dist/esm-es5/{global-1dca883b.js → global-06801d00.js} +1 -1
  94. package/dist/esm-es5/index-7e11ea42.js +2 -0
  95. package/dist/esm-es5/{intl-f0475a8e.js → intl-9809c77c.js} +1 -1
  96. package/dist/esm-es5/loader.js +1 -1
  97. package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
  98. package/dist/esm-es5/priv-datepicker.entry.js +1 -1
  99. package/dist/esm-es5/priv-navigator-button.entry.js +1 -1
  100. package/dist/esm-es5/priv-navigator-item.entry.js +1 -1
  101. package/dist/esm-es5/ripple.js +1 -1
  102. package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
  103. package/dist/esm-es5/wm-button.entry.js +1 -1
  104. package/dist/esm-es5/wm-chart-slice.entry.js +1 -1
  105. package/dist/esm-es5/wm-chart.entry.js +1 -1
  106. package/dist/esm-es5/wm-datepicker.entry.js +1 -1
  107. package/dist/esm-es5/wm-file-list.entry.js +1 -1
  108. package/dist/esm-es5/wm-file.entry.js +1 -1
  109. package/dist/esm-es5/wm-input.entry.js +1 -1
  110. package/dist/esm-es5/wm-line-chart.entry.js +1 -1
  111. package/dist/esm-es5/wm-modal-footer.entry.js +1 -1
  112. package/dist/esm-es5/wm-modal-header.entry.js +1 -1
  113. package/dist/esm-es5/wm-modal.entry.js +1 -1
  114. package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
  115. package/dist/esm-es5/wm-navigator.entry.js +1 -1
  116. package/dist/esm-es5/wm-network-uploader.entry.js +1 -1
  117. package/dist/esm-es5/wm-option_2.entry.js +1 -1
  118. package/dist/esm-es5/wm-pagination.entry.js +1 -1
  119. package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
  120. package/dist/esm-es5/wm-search.entry.js +1 -1
  121. package/dist/esm-es5/wm-snackbar.entry.js +1 -1
  122. package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
  123. package/dist/esm-es5/wm-tag-input-row.entry.js +1 -1
  124. package/dist/esm-es5/wm-tag-input.entry.js +1 -1
  125. package/dist/esm-es5/wm-timepicker.entry.js +1 -1
  126. package/dist/esm-es5/wm-toggletip.entry.js +1 -1
  127. package/dist/esm-es5/wm-uploader.entry.js +1 -1
  128. package/dist/esm-es5/wm-wrapper.entry.js +1 -1
  129. package/dist/ripple/p-0631be01.system.entry.js +1 -0
  130. package/dist/ripple/{p-a6317ac6.entry.js → p-06871476.entry.js} +1 -1
  131. package/dist/ripple/{p-5e109597.entry.js → p-0d9f70ab.entry.js} +1 -1
  132. package/dist/ripple/{p-6639cf6c.entry.js → p-11763c02.entry.js} +1 -1
  133. package/dist/ripple/p-185c3645.entry.js +1 -0
  134. package/dist/ripple/{p-42cd9ae6.entry.js → p-19773c40.entry.js} +1 -1
  135. package/dist/ripple/{p-69c802aa.entry.js → p-198f596b.entry.js} +1 -1
  136. package/dist/ripple/{p-2bbf689a.system.entry.js → p-20df08be.system.entry.js} +1 -1
  137. package/dist/ripple/p-24d9f6fe.entry.js +1 -0
  138. package/dist/ripple/p-25c1bd67.system.entry.js +1 -0
  139. package/dist/ripple/{p-77ea81c7.system.entry.js → p-26031cd0.system.entry.js} +1 -1
  140. package/dist/ripple/{p-936e078c.system.js → p-27efb4d0.system.js} +1 -1
  141. package/dist/ripple/{p-766a4a70.system.entry.js → p-2acf8af1.system.entry.js} +1 -1
  142. package/dist/ripple/{p-1cb7bdc5.entry.js → p-2ebac749.entry.js} +1 -1
  143. package/dist/ripple/p-30bf24f8.system.js +2 -0
  144. package/dist/ripple/{p-bde26da9.system.entry.js → p-3248c0fa.system.entry.js} +1 -1
  145. package/dist/ripple/p-364753eb.js +1 -0
  146. package/dist/ripple/p-39e17683.system.js +1 -0
  147. package/dist/ripple/{p-935eafa7.system.entry.js → p-3b50511c.system.entry.js} +1 -1
  148. package/dist/ripple/p-3c80bf67.entry.js +1 -0
  149. package/dist/ripple/{p-6f36e973.entry.js → p-3ec4ae19.entry.js} +1 -1
  150. package/dist/ripple/p-42aeb9bb.js +1 -0
  151. package/dist/ripple/{p-5d78937a.entry.js → p-4b59b16a.entry.js} +1 -1
  152. package/dist/ripple/{p-770f02d4.entry.js → p-50623da2.entry.js} +1 -1
  153. package/dist/ripple/p-50be6128.system.entry.js +1 -0
  154. package/dist/ripple/{p-f3ff86da.entry.js → p-535e7286.entry.js} +1 -1
  155. package/dist/ripple/{p-cabf1867.system.entry.js → p-53f5e969.system.entry.js} +1 -1
  156. package/dist/ripple/{p-0412d22d.system.entry.js → p-56d64283.system.entry.js} +1 -1
  157. package/dist/ripple/{p-d9268ba1.system.entry.js → p-5c1b2132.system.entry.js} +1 -1
  158. package/dist/ripple/{p-29960160.system.entry.js → p-5d592297.system.entry.js} +1 -1
  159. package/dist/ripple/{p-d4ebbe84.system.js → p-5e55eb56.system.js} +1 -1
  160. package/dist/ripple/{p-0872dd92.entry.js → p-697ba13b.entry.js} +1 -1
  161. package/dist/ripple/{p-b22858cd.entry.js → p-725c757a.entry.js} +1 -1
  162. package/dist/ripple/{p-24ac418e.system.entry.js → p-74a92541.system.entry.js} +1 -1
  163. package/dist/ripple/{p-fcbd4194.entry.js → p-7962f562.entry.js} +1 -1
  164. package/dist/ripple/{p-cd67e184.entry.js → p-7f722888.entry.js} +1 -1
  165. package/dist/ripple/{p-08e0007e.system.entry.js → p-80ca72ff.system.entry.js} +1 -1
  166. package/dist/ripple/{p-53b84f6d.entry.js → p-84e55d9e.entry.js} +1 -1
  167. package/dist/ripple/{p-0730d70d.system.entry.js → p-89bf36c8.system.entry.js} +1 -1
  168. package/dist/ripple/p-8ea68cb3.system.entry.js +1 -0
  169. package/dist/ripple/{p-7b91eba4.system.entry.js → p-8f273c5b.system.entry.js} +1 -1
  170. package/dist/ripple/{p-a7a9c931.entry.js → p-9cb8f41b.entry.js} +1 -1
  171. package/dist/ripple/{p-23a5adae.entry.js → p-9e29176c.entry.js} +1 -1
  172. package/dist/ripple/{p-6cc52a23.system.entry.js → p-a1e95b05.system.entry.js} +1 -1
  173. package/dist/ripple/{p-38b67301.entry.js → p-a52c5a1c.entry.js} +1 -1
  174. package/dist/ripple/{p-71ecba7e.system.entry.js → p-aae11e37.system.entry.js} +1 -1
  175. package/dist/ripple/{p-b111bc7d.entry.js → p-adf76148.entry.js} +1 -1
  176. package/dist/ripple/{p-765b53d8.system.entry.js → p-ae97bf6c.system.entry.js} +1 -1
  177. package/dist/ripple/p-b5bedd63.js +2 -0
  178. package/dist/ripple/{p-00850d97.entry.js → p-b982a342.entry.js} +1 -1
  179. package/dist/ripple/{p-e4f352fe.system.js → p-ba31d982.system.js} +1 -1
  180. package/dist/ripple/p-c1857a16.entry.js +1 -0
  181. package/dist/ripple/{p-d601c5a1.entry.js → p-c32d10f7.entry.js} +1 -1
  182. package/dist/ripple/{p-a9012b82.system.entry.js → p-c3915cfe.system.entry.js} +1 -1
  183. package/dist/ripple/{p-4d5e075b.system.entry.js → p-cab12cec.system.entry.js} +1 -1
  184. package/dist/ripple/{p-2b378ac6.js → p-cd7cc5c6.js} +1 -1
  185. package/dist/ripple/{p-0a846e45.entry.js → p-d72b00a0.entry.js} +1 -1
  186. package/dist/ripple/{p-f1aed810.system.entry.js → p-d8de670a.system.entry.js} +1 -1
  187. package/dist/ripple/{p-68f11410.entry.js → p-da01c531.entry.js} +1 -1
  188. package/dist/ripple/{p-4a58b0ff.system.entry.js → p-dd01929e.system.entry.js} +1 -1
  189. package/dist/ripple/{p-5da6b9ff.system.entry.js → p-e0f270e2.system.entry.js} +1 -1
  190. package/dist/ripple/{p-64abb6d9.system.entry.js → p-e882a31f.system.entry.js} +1 -1
  191. package/dist/ripple/{p-c459ef8e.entry.js → p-ec13e325.entry.js} +1 -1
  192. package/dist/ripple/{p-dc069d46.entry.js → p-ed3e41ed.entry.js} +1 -1
  193. package/dist/ripple/{p-458c1c0b.system.entry.js → p-f635c1ec.system.entry.js} +1 -1
  194. package/dist/ripple/{p-eb0d569a.system.entry.js → p-f865899a.system.entry.js} +1 -1
  195. package/dist/ripple/{p-fd0fc5e1.system.entry.js → p-f9539737.system.entry.js} +1 -1
  196. package/dist/ripple/{p-6628e036.system.entry.js → p-fbb44f76.system.entry.js} +1 -1
  197. package/dist/ripple/{p-74880dac.system.entry.js → p-fcdd9e03.system.entry.js} +1 -1
  198. package/dist/ripple/{p-1a7b1578.system.js → p-fd354e00.system.js} +1 -1
  199. package/dist/ripple/{p-6546dda7.entry.js → p-fd91cd58.entry.js} +1 -1
  200. package/dist/ripple/{p-f9e942f6.entry.js → p-fea4bc00.entry.js} +1 -1
  201. package/dist/ripple/{p-20495238.js → p-ff888d78.js} +1 -1
  202. package/dist/ripple/ripple.esm.js +1 -1
  203. package/dist/ripple/ripple.js +1 -1
  204. package/dist/types/components/wm-modal/wm-modal-footer.d.ts +0 -1
  205. package/dist/types/components/wm-modal/wm-modal-header.d.ts +0 -1
  206. package/dist/types/components/wm-modal/wm-modal.d.ts +4 -10
  207. package/package.json +1 -1
  208. package/dist/esm-es5/index-294d486f.js +0 -2
  209. package/dist/ripple/p-11b416c7.js +0 -2
  210. package/dist/ripple/p-16708229.js +0 -1
  211. package/dist/ripple/p-212d0c64.entry.js +0 -1
  212. package/dist/ripple/p-2b59a09f.entry.js +0 -1
  213. package/dist/ripple/p-4418858d.entry.js +0 -1
  214. package/dist/ripple/p-56747d40.system.entry.js +0 -1
  215. package/dist/ripple/p-5e005259.system.entry.js +0 -1
  216. package/dist/ripple/p-63466d04.entry.js +0 -1
  217. package/dist/ripple/p-89bc016a.js +0 -1
  218. package/dist/ripple/p-8a38e526.system.js +0 -1
  219. package/dist/ripple/p-8c6ffd70.system.entry.js +0 -1
  220. package/dist/ripple/p-c467a1e1.system.js +0 -2
  221. package/dist/ripple/p-c5942ad6.system.entry.js +0 -1
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, g as getElement } from './index-294d486f.js';
1
+ import { r as registerInstance, c as createEvent, g as getElement } from './index-7e11ea42.js';
2
2
 
3
3
  const Wrapper = class {
4
4
  constructor(hostRef) {
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,r,a){function o(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function s(e){try{l(a.next(e))}catch(e){n(e)}}function i(e){try{l(a["throw"](e))}catch(e){n(e)}}function l(e){e.done?r(e.value):o(e.value).then(s,i)}l((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},a,o,n,s;return s={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function i(e){return function(t){return l([e,t])}}function l(i){if(a)throw new TypeError("Generator is already executing.");while(s&&(s=0,i[0]&&(r=0)),r)try{if(a=1,o&&(n=i[0]&2?o["return"]:i[0]?o["throw"]||((n=o["return"])&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;if(o=0,n)i=[i[0]&2,n.value];switch(i[0]){case 0:case 1:n=i;break;case 4:r.label++;return{value:i[1],done:false};case 5:r.label++;o=i[1];i=[0];continue;case 7:i=r.ops.pop();r.trys.pop();continue;default:if(!(n=r.trys,n=n.length>0&&n[n.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!n||i[1]>n[0]&&i[1]<n[3])){r.label=i[1];break}if(i[0]===6&&r.label<n[1]){r.label=n[1];n=i;break}if(n&&r.label<n[2]){r.label=n[2];r.ops.push(i);break}if(n[2])r.ops.pop();r.trys.pop();continue}i=t.call(e,r)}catch(e){i=[6,e];o=0}finally{a=n=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,o=t.length,n;a<o;a++){if(n||!(a in t)){if(!n)n=Array.prototype.slice.call(t,0,a);n[a]=t[a]}}return e.concat(n||Array.prototype.slice.call(t))};import{h}from"./index-294d486f.js";import{i as intl,c as checkForActiveElInShadow,e as getPosition,f as findParentWithScrollbar,d as debounce}from"./functions-7fc7cf30.js";var colors={salmon:"#ff5f4e",cyan:"#19a1a9",forest:"#088000",sleet:"#7f97ad",midnight:"#2e1b46",lavender:"#8b86ca",periwinkle:"#575195",gray:"#6b6b6b"};var allChartsDetails={doughnut:{size:155,colors:[colors.forest,colors.gray],thickness:.73,padding:25,category:"doughnut"},doughnut0:{size:155,colors:[colors.forest,colors.gray],thickness:.73,padding:25,category:"doughnut"},doughnut1:{size:130,colors:[colors.lavender,colors.midnight,colors.gray],thickness:.5,padding:90,category:"doughnut"},doughnut2:{size:130,colors:[colors.cyan,colors.salmon,colors.gray],thickness:.5,padding:90,category:"doughnut"},doughnut2b:{size:130,colors:[colors.periwinkle,colors.cyan,colors.salmon,colors.gray],thickness:.5,padding:90,category:"doughnut"},doughnut3:{size:130,colors:[colors.lavender,colors.midnight,"#0089e4",colors.forest,"#ea8500","#d54f41","#146ca9"],thickness:.5,padding:90,category:"doughnut"},bar:{size:350,colors:[colors.forest,colors.gray],padding:0,category:"stackedBar"},bar1:{size:350,colors:[colors.forest,colors.gray],padding:0,category:"stackedBar"},bar2:{size:400,colors:[colors.gray,colors.periwinkle,colors.cyan,colors.salmon],padding:0,category:"stackedBar"},bar2b:{size:400,colors:[colors.gray,colors.periwinkle,colors.midnight,colors.cyan,colors.salmon],padding:0,category:"stackedBar"},bar3:{size:300,colors:["#0d696e",colors.cyan,"#8e4129",colors.salmon],padding:0,category:"stackedBar"},bar4:{size:400,colors:[colors.salmon,colors.cyan,colors.periwinkle],padding:0,category:"stackedBar"},bar5:{size:400,colors:[colors.gray,colors.lavender,colors.midnight,"#0089e4",colors.forest,"#ea8500","#d54f41","#146ca9"],padding:0,category:"stackedBar"},bar6:{size:400,colors:[colors.lavender],padding:0,category:"simpleBar"},bar7:{size:400,colors:[colors.periwinkle,colors.cyan,colors.salmon,colors.gray],padding:0,category:"simpleBar"}};function showValue(e){return e==="percentage"||e==="amount"?"show-values":""}var textHiddenMessage=intl.formatMessage({id:"chart.hiddenValues",defaultMessage:"Values are not shown when too close to each other.",description:"Text displayed when a chart has some values hidden"});var seeDetailsMessage=intl.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 abbrNumber(e){return e>999||e<-999?Math.round(e/100)/10+"K":e}function amountToPercent(e,t,r){return r?Math.round(e*100/t):Math.round(e*1e4/t)/100}function amountToDegree(e,t){return e*360/t}function toFixed(e){return parseFloat((Math.floor(e*100)/100).toFixed(2))}function polarToCartesian(e,t,r,a){var o=toFixed(e+e*t*Math.cos(Math.PI*r/180));var n=toFixed(e+e*t*Math.sin(Math.PI*r/180));if(a!==undefined){var s=toFixed(e+e*t*Math.cos(Math.PI*a/180));var i=toFixed(e+e*t*Math.sin(Math.PI*a/180));return{x1:o,y1:n,x2:s,y2:i}}return{x:o,y:n}}function getArc(e,t,r,a,o){var n=toFixed(o/2*e);return"A ".concat(n,", ").concat(n," 0 ").concat(t," ").concat(toFixed(r),", ").concat(toFixed(a))}function scale(e,t,r,a,o){var n=(e-t)*(o-a)/(r-t)+a;return n<a?a:n>o?o:n}function minSpacing(e){return scale(e,300,900,70,150)}function getMaxTicks(e){return Math.round(e/minSpacing(e))}function getInterval(e,t){var r=e/t;var a=Math.pow(10,Math.floor(Math.log10(r)));var o=r/a;var n;if(o>5){n=10*a}else if(o>3){n=5*a}else if(o>2){n=3*a}else if(o>1.5){n=2*a}else if(o>1){n=1.5*a}else{n=a}return n}function handleSliceKeyDown(e){if(this.popoverEl&&this.popoverEl.open&&e.key==="Enter"){var t=this.popoverEl.querySelector("button");t&&t.click()}}function handleSliceClick(e,t){if(this.popoverEl&&!this.isTabbing){t.coords={x:e.clientX,y:e.clientY};openPopover.call(this,t)}}function handleSliceFocus(e,t){if(this.popoverEl&&this.isTabbing){t.coords=getPosition(e.target);openPopover.call(this,t)}}function handleChartKeydown(e){switch(e.key){case"ArrowUp":case"ArrowLeft":e.preventDefault();this.isTabbing=true;focusPrevious.call(this);break;case"ArrowRight":case"ArrowDown":e.preventDefault();this.isTabbing=true;focusNext.call(this);break;case"Tab":exitChart.call(this);break;case"Escape":this.popoverEl.open=false;this.userIsNavigating=false;break}}function openPopover(e){var t=this;if(!!this.popoverEl&&!!e.title&&!!e.text){this.popoverEl.popoverTitle=e.title;this.popoverEl.popoverText=e.text;this.popoverEl.buttonText=e.buttonText;this.popoverEl.coords=e.coords;this.popoverEl.sliceRef=e.sliceRef;window.setTimeout((function(){if(t.popoverEl){t.popoverEl.open=true}}),30);var r=debounce((function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){this.popoverEl.open=false;return[2]}))}))}),10);document.addEventListener("scroll",(function(){r()}));var a=findParentWithScrollbar(this.el);if(!!a){a.addEventListener("scroll",(function(){r()}))}}}function focusNext(){var e=checkForActiveElInShadow(document.activeElement);var t=(this.sliceEls.indexOf(e)+1)%this.sliceEls.length;focusSlice.call(this,t)}function focusPrevious(){if(this.sliceEls){var e=checkForActiveElInShadow(document.activeElement);var t=this.sliceEls.indexOf(e);if(t===-1){t=0}else if(t===0){t=this.sliceEls.length-1}else{t-=1}focusSlice.call(this,t)}}function focusSlice(e){var t=this;if(this.sliceEls&&this.el){this.userIsNavigating=true;if(this.popoverEl){this.popoverEl.open=false}this.componentWrapperEl.tabIndex=-1;this.el.focusable=false;this.sliceEls.map((function(e){e.tabIndex=-1;e.focusable=false}));this.sliceEls[e].tabIndex=0;this.sliceEls[e].focusable=true;this.sliceEls[e].focus();window.setTimeout((function(){if(t.popoverEl){t.popoverEl.open=true}}),10)}}function exitChart(){var e=this;this.sliceEls&&this.sliceEls.map((function(e){e.tabIndex=-1;e.focusable=false}));this.userIsNavigating=false;window.setTimeout((function(){e.componentWrapperEl.tabIndex=0;e.el.focusable=true;if(e.popoverEl){e.popoverEl.open=false}}),100)}function getDetails(e){return __awaiter(this,void 0,void 0,(function(){var t,r;var a=this;return __generator(this,(function(o){this.slicesDetails=[];t=0;r=Array.from(this.el.children);this.total=r.reduce((function(e,t){return e+=parseInt(t.getAttribute("amount")||"0")}),0);r.forEach((function(r,o){var n=parseInt(r.getAttribute("amount")||"0");var s=amountToPercent(n,a.total,true);var i=o;if(e==="bar5"){i=a.notStartedColor?o:o+1}if(e==="bar6"){i=0}var l=allChartsDetails[e].colors[i];var c={amount:n,perc:s,legend:r.getAttribute("legend"),color:l||colors.gray,offset:t,id:"".concat(a.uid,"-").concat(o+1),title:r.getAttribute("popover-title"),text:r.getAttribute("popover-text"),buttonText:r.getAttribute("popover-button-text"),sliceRef:r,inSmallCluster:false};t+=n;a.slicesDetails.push(c)}));return[2]}))}))}function sortSlicesDetails(e,t){var r=__spreadArray([],e,true).sort((function(e,t){return e.amount===t.amount?0:e.amount>t.amount?-1:1}));var a=0;r.forEach((function(e,o){var n=r[o===0?r.length-1:o-1];var s=r[o===r.length-1?0:o+1];var i=amountToPercent(n.amount,t,true);var l=amountToPercent(s.amount,t,true);e.offset=a;a+=e.amount;e.inSmallCluster=isInSmallCluster(i,e.perc,e.amount,l)}));return r}function isInSmallCluster(e,t,r,a){var o=t<4;var n=e<5;var s=a<5;var i=o&&(n||s);var l=t===0&&r>0;if(l&&(a<8||e<8)){i=true}return i}function getPathData(e,t,r){var a=amountToDegree(t,this.total)-90;var o=e/this.total*360;var n=a+o;var s=o>180?"1 1":"0 1";var i=o>180?"1 0":"0 0";var l=this.chartDetails.size/2;var c=this.chartDetails.thickness;var u=1;var h=r==="doughnut0"||r==="doughnut";var d=1.5;var f=h?2.25:3;if(o===360){n-=.01}var p=polarToCartesian(l,u,a+d,n);var g=polarToCartesian(l,c,a+f,n);var v="M ".concat(p.x1,", ").concat(p.y1," ");var m=getArc(u,s,p.x2,p.y2,this.chartDetails.size);var b=" L ".concat(g.x2,", ").concat(g.y2," ");var y=getArc(c,i,g.x1,g.y1,this.chartDetails.size);return v+m+b+y+" z"}function renderInstructionsText(){var e=intl.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 h("div",{id:"chart-instructions"},e)}function renderFilter(){return h("defs",null,h("filter",{id:"wmHoverDropShadow"},h("feGaussianBlur",{stdDeviation:"3"}),h("feOffset",{result:"offsetblur"}),h("feFlood",{"flood-color":"#333"}),h("feComposite",{operator:"in",in2:"offsetblur"}),h("feMerge",null,h("feMergeNode",null),h("feMergeNode",{in:"SourceGraphic"}))))}function renderDoughnut(e){var t=this;var r=this.chartDetails.size+this.chartDetails.padding;var a=e==="doughnut0"||e==="doughnut";var o=a?this.slicesDetails:sortSlicesDetails(this.slicesDetails,this.total);return h("div",{class:"chart-wrapper doughnut-wrapper"},h("svg",{width:r+"px",height:r+"px",id:"graphic-".concat(this.uid),class:"doughnut-svg"},renderFilter(),o.map((function(r){return renderPath.call(t,r,e)})),a?h("text",{class:"value",x:"50%",y:"50%","font-size":"1.5rem","font-weight":"500","text-anchor":"middle","dominant-baseline":"middle"},amountToPercent(o[0].amount,this.total,true)+"%"):h("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")"),"text-anchor":"middle","dominant-baseline":"middle"},o.map((function(e){return e.amount>0&&!e.inSmallCluster?renderDoughnutText.call(t,e):""})))))}function renderPath(e,t){var r=this;return h("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")")},h("path",{id:e.id,class:"segment doughnut-segment",fill:e.amount?e.color:"transparent",d:getPathData.call(this,e.amount,e.offset,t),onClick:function(t){return handleSliceClick.call(r,t,e)},onFocus:function(t){return handleSliceFocus.call(r,t,e)},onKeyDown:function(e){return handleSliceKeyDown.call(r,e)},role:"img","aria-label":e.legend}))}function renderDoughnutText(e){var t=amountToDegree(e.offset+e.amount/2,this.total);var r=polarToCartesian(this.chartDetails.size/2,1.4,t-90),a=r.x,o=r.y;return h("text",{class:"value",x:a+"px",y:o+"px"},"".concat(e.perc>0?e.perc:"<1","%"))}function renderStackedBar(e){var t=this;var r=e==="bar1"||e==="bar";return h("div",{class:"chart-wrapper bar-wrapper"},r?h("div",{class:"single-perc"},amountToPercent(this.slicesDetails[0].amount,this.total,true)+"%"):"",this.chartType==="bar3"&&this.drawAxis(),h("div",{class:"inner-stacked-bar-wrapper ".concat(showValue(this.tempValueFormat))},!r?h("div",{class:"values"},this.slicesDetails.map((function(e,r){return t.renderBarText(e,r)}))):"",h("div",{class:"stacked-bar-segments-wrapper"},this.slicesDetails.map((function(e,r){return renderStackedBarSegment.call(t,e,r)}))),r?renderCompletionMessage.call(this):""))}function renderStackedBarSegment(e,t){var r=this;var a=t!==this.slicesDetails.length-1;var o="calc(".concat(amountToPercent(e.amount,this.total,false),"%").concat(a?" - 2px":"",")");return h("div",{class:"segment stacked-bar-segment ".concat(amountToPercent(e.amount,this.total,false)===0?"zero":""),style:{backgroundColor:e.color,width:o},onClick:function(t){return handleSliceClick.call(r,t,e)},onFocus:function(t){return handleSliceFocus.call(r,t,e)},onKeyDown:function(e){return handleSliceKeyDown.call(r,e)}},h("span",{class:"sr-only"},e.legend))}function renderSimpleBar(e){var t=this;var r=this.slicesDetails.map((function(e){return e.amount})).reduce((function(e,t){return e>t?e:t}));var a=parseInt(getComputedStyle(this.el).getPropertyValue("--labelWidth"),10);var o=48;var n=this.el.getBoundingClientRect().width;var s=n-a-o;var i=getMaxTicks(s);var l=getInterval(r,i);var c=i*l;var u=Math.floor((c-r)/l);i-=u;this.el.style.setProperty("--backgroundSize",100/i+"%");this.el.style.setProperty("--labelWidth",this.labelWidth);if(e==="bar7"&&!this.showBarLegend){this.el.style.setProperty("--labelWidth","0px")}var d=[];this.slicesDetails.forEach((function(a){a.legend&&d.push(renderSimpleBarLegend(a.legend,t.showBarLegend,e));d.push(renderSimpleBarItem.call(t,a,l,i,r))}));var f=[];for(var p=1;p<=i;p++){var g=abbrNumber(p*l);f.push(h("div",{class:"tick"},h("span",null,g)))}var v=e==="bar6"&&this.showGrid&&this.el.getBoundingClientRect().width>300;return h("div",{class:"chart-wrapper simple-bar-wrapper"},h("div",{class:"chart ".concat(showValue(this.tempValueFormat))},v&&h("div",{class:"gridlines"}),h("div",{class:"rows"},d)),v&&h("div",{class:"x-axis","aria-hidden":"true"},h("div",{class:"zero"},h("span",null,"0")),f))}function renderSimpleBarLegend(e,t,r){var a=r==="bar7"&&!t?" hidden":"";return h("label",{class:"label".concat(a)},e)}function renderSimpleBarItem(e,t,r,a){var o=this;var n=this.currentChartType==="bar6"?t*r:a;var s=amountToPercent(e.amount,n,false);var i=s?s+"%":"1px";var l=abbrNumber(e.amount);var c=this.tempValueFormat==="amount"?l:"";if(this.currentChartType==="bar6"&&this.tempValueFormat==="percentage"){c=e.amount+"%"}else if(this.currentChartType==="bar7"&&this.tempValueFormat==="percentage"){c=(this.total===0?"0":amountToPercent(e.amount,this.total,true))+"%"}return h("div",{class:"bar segment",style:{backgroundColor:e.color,width:i},onClick:function(t){return handleSliceClick.call(o,t,e)},onFocus:function(t){return handleSliceFocus.call(o,t,e)},onKeyDown:function(e){return handleSliceKeyDown.call(o,e)}},h("div",{class:"value"},c))}function renderLegend(e){if(this.showLegend){var t=!this.chartDetails.isBar&&this.slicesDetails.reduce((function(e,t){return e=t.inSmallCluster?true:e}),false);return h("div",{class:"legend-wrapper"},h("div",{class:"legend ".concat(e," ").concat(this.mode==="bar"?"--top":"--bottom"),"aria-hidden":"true"},this.slicesDetails.map((function(e){if(!!e.amount||!!e.legend){return renderLegendItem({key:e.legend,color:e.color})}}))),t&&renderHiddenValuesMessage())}}function renderLegendItem(e){return h("div",{class:"legend-item"},h("div",{class:"legend-color",style:{backgroundColor:e.color}}),h("div",{class:"legend-text"},e.key))}function renderCompletionMessage(){if(this.completionMessage){return h("div",{class:"completion-message"},this.completionMessage)}}function renderHiddenValuesMessage(){return h("div",{class:"hidden-values-warning"},textHiddenMessage,h("br",null),seeDetailsMessage)}export{allChartsDetails as a,amountToPercent as b,renderStackedBar as c,renderDoughnut as d,renderInstructionsText as e,renderLegend as f,getDetails as g,handleChartKeydown as h,renderCompletionMessage as i,renderHiddenValuesMessage as j,exitChart as k,renderLegendItem as l,abbrNumber as m,getInterval as n,renderSimpleBar as r};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,r,a){function o(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function s(e){try{l(a.next(e))}catch(e){n(e)}}function i(e){try{l(a["throw"](e))}catch(e){n(e)}}function l(e){e.done?r(e.value):o(e.value).then(s,i)}l((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},a,o,n,s;return s={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function i(e){return function(t){return l([e,t])}}function l(i){if(a)throw new TypeError("Generator is already executing.");while(s&&(s=0,i[0]&&(r=0)),r)try{if(a=1,o&&(n=i[0]&2?o["return"]:i[0]?o["throw"]||((n=o["return"])&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;if(o=0,n)i=[i[0]&2,n.value];switch(i[0]){case 0:case 1:n=i;break;case 4:r.label++;return{value:i[1],done:false};case 5:r.label++;o=i[1];i=[0];continue;case 7:i=r.ops.pop();r.trys.pop();continue;default:if(!(n=r.trys,n=n.length>0&&n[n.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!n||i[1]>n[0]&&i[1]<n[3])){r.label=i[1];break}if(i[0]===6&&r.label<n[1]){r.label=n[1];n=i;break}if(n&&r.label<n[2]){r.label=n[2];r.ops.push(i);break}if(n[2])r.ops.pop();r.trys.pop();continue}i=t.call(e,r)}catch(e){i=[6,e];o=0}finally{a=n=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,o=t.length,n;a<o;a++){if(n||!(a in t)){if(!n)n=Array.prototype.slice.call(t,0,a);n[a]=t[a]}}return e.concat(n||Array.prototype.slice.call(t))};import{h}from"./index-7e11ea42.js";import{i as intl,c as getPosition,f as findParentWithScrollbar,e as checkForActiveElInShadow,d as debounce}from"./functions-d52b728c.js";var colors={salmon:"#ff5f4e",cyan:"#19a1a9",forest:"#088000",sleet:"#7f97ad",midnight:"#2e1b46",lavender:"#8b86ca",periwinkle:"#575195",gray:"#6b6b6b"};var allChartsDetails={doughnut:{size:155,colors:[colors.forest,colors.gray],thickness:.73,padding:25,category:"doughnut"},doughnut0:{size:155,colors:[colors.forest,colors.gray],thickness:.73,padding:25,category:"doughnut"},doughnut1:{size:130,colors:[colors.lavender,colors.midnight,colors.gray],thickness:.5,padding:90,category:"doughnut"},doughnut2:{size:130,colors:[colors.cyan,colors.salmon,colors.gray],thickness:.5,padding:90,category:"doughnut"},doughnut2b:{size:130,colors:[colors.periwinkle,colors.cyan,colors.salmon,colors.gray],thickness:.5,padding:90,category:"doughnut"},doughnut3:{size:130,colors:[colors.lavender,colors.midnight,"#0089e4",colors.forest,"#ea8500","#d54f41","#146ca9"],thickness:.5,padding:90,category:"doughnut"},bar:{size:350,colors:[colors.forest,colors.gray],padding:0,category:"stackedBar"},bar1:{size:350,colors:[colors.forest,colors.gray],padding:0,category:"stackedBar"},bar2:{size:400,colors:[colors.gray,colors.periwinkle,colors.cyan,colors.salmon],padding:0,category:"stackedBar"},bar2b:{size:400,colors:[colors.gray,colors.periwinkle,colors.midnight,colors.cyan,colors.salmon],padding:0,category:"stackedBar"},bar3:{size:300,colors:["#0d696e",colors.cyan,"#8e4129",colors.salmon],padding:0,category:"stackedBar"},bar4:{size:400,colors:[colors.salmon,colors.cyan,colors.periwinkle],padding:0,category:"stackedBar"},bar5:{size:400,colors:[colors.gray,colors.lavender,colors.midnight,"#0089e4",colors.forest,"#ea8500","#d54f41","#146ca9"],padding:0,category:"stackedBar"},bar6:{size:400,colors:[colors.lavender],padding:0,category:"simpleBar"},bar7:{size:400,colors:[colors.periwinkle,colors.cyan,colors.salmon,colors.gray],padding:0,category:"simpleBar"}};function showValue(e){return e==="percentage"||e==="amount"?"show-values":""}var textHiddenMessage=intl.formatMessage({id:"chart.hiddenValues",defaultMessage:"Values are not shown when too close to each other.",description:"Text displayed when a chart has some values hidden"});var seeDetailsMessage=intl.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 abbrNumber(e){return e>999||e<-999?Math.round(e/100)/10+"K":e}function amountToPercent(e,t,r){return r?Math.round(e*100/t):Math.round(e*1e4/t)/100}function amountToDegree(e,t){return e*360/t}function toFixed(e){return parseFloat((Math.floor(e*100)/100).toFixed(2))}function polarToCartesian(e,t,r,a){var o=toFixed(e+e*t*Math.cos(Math.PI*r/180));var n=toFixed(e+e*t*Math.sin(Math.PI*r/180));if(a!==undefined){var s=toFixed(e+e*t*Math.cos(Math.PI*a/180));var i=toFixed(e+e*t*Math.sin(Math.PI*a/180));return{x1:o,y1:n,x2:s,y2:i}}return{x:o,y:n}}function getArc(e,t,r,a,o){var n=toFixed(o/2*e);return"A ".concat(n,", ").concat(n," 0 ").concat(t," ").concat(toFixed(r),", ").concat(toFixed(a))}function scale(e,t,r,a,o){var n=(e-t)*(o-a)/(r-t)+a;return n<a?a:n>o?o:n}function minSpacing(e){return scale(e,300,900,70,150)}function getMaxTicks(e){return Math.round(e/minSpacing(e))}function getInterval(e,t){var r=e/t;var a=Math.pow(10,Math.floor(Math.log10(r)));var o=r/a;var n;if(o>5){n=10*a}else if(o>3){n=5*a}else if(o>2){n=3*a}else if(o>1.5){n=2*a}else if(o>1){n=1.5*a}else{n=a}return n}function handleSliceKeyDown(e){if(this.popoverEl&&this.popoverEl.open&&e.key==="Enter"){var t=this.popoverEl.querySelector("button");t&&t.click()}}function handleSliceClick(e,t){if(this.popoverEl&&!this.isTabbing){t.coords={x:e.clientX,y:e.clientY};openPopover.call(this,t)}}function handleSliceFocus(e,t){if(this.popoverEl&&this.isTabbing){t.coords=getPosition(e.target);openPopover.call(this,t)}}function handleChartKeydown(e){switch(e.key){case"ArrowUp":case"ArrowLeft":e.preventDefault();this.isTabbing=true;focusPrevious.call(this);break;case"ArrowRight":case"ArrowDown":e.preventDefault();this.isTabbing=true;focusNext.call(this);break;case"Tab":exitChart.call(this);break;case"Escape":this.popoverEl.open=false;this.userIsNavigating=false;break}}function openPopover(e){var t=this;if(!!this.popoverEl&&!!e.title&&!!e.text){this.popoverEl.popoverTitle=e.title;this.popoverEl.popoverText=e.text;this.popoverEl.buttonText=e.buttonText;this.popoverEl.coords=e.coords;this.popoverEl.sliceRef=e.sliceRef;window.setTimeout((function(){if(t.popoverEl){t.popoverEl.open=true}}),30);var r=debounce((function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(e){this.popoverEl.open=false;return[2]}))}))}),10);document.addEventListener("scroll",(function(){r()}));var a=findParentWithScrollbar(this.el);if(!!a){a.addEventListener("scroll",(function(){r()}))}}}function focusNext(){var e=checkForActiveElInShadow(document.activeElement);var t=(this.sliceEls.indexOf(e)+1)%this.sliceEls.length;focusSlice.call(this,t)}function focusPrevious(){if(this.sliceEls){var e=checkForActiveElInShadow(document.activeElement);var t=this.sliceEls.indexOf(e);if(t===-1){t=0}else if(t===0){t=this.sliceEls.length-1}else{t-=1}focusSlice.call(this,t)}}function focusSlice(e){var t=this;if(this.sliceEls&&this.el){this.userIsNavigating=true;if(this.popoverEl){this.popoverEl.open=false}this.componentWrapperEl.tabIndex=-1;this.el.focusable=false;this.sliceEls.map((function(e){e.tabIndex=-1;e.focusable=false}));this.sliceEls[e].tabIndex=0;this.sliceEls[e].focusable=true;this.sliceEls[e].focus();window.setTimeout((function(){if(t.popoverEl){t.popoverEl.open=true}}),10)}}function exitChart(){var e=this;this.sliceEls&&this.sliceEls.map((function(e){e.tabIndex=-1;e.focusable=false}));this.userIsNavigating=false;window.setTimeout((function(){e.componentWrapperEl.tabIndex=0;e.el.focusable=true;if(e.popoverEl){e.popoverEl.open=false}}),100)}function getDetails(e){return __awaiter(this,void 0,void 0,(function(){var t,r;var a=this;return __generator(this,(function(o){this.slicesDetails=[];t=0;r=Array.from(this.el.children);this.total=r.reduce((function(e,t){return e+=parseInt(t.getAttribute("amount")||"0")}),0);r.forEach((function(r,o){var n=parseInt(r.getAttribute("amount")||"0");var s=amountToPercent(n,a.total,true);var i=o;if(e==="bar5"){i=a.notStartedColor?o:o+1}if(e==="bar6"){i=0}var l=allChartsDetails[e].colors[i];var c={amount:n,perc:s,legend:r.getAttribute("legend"),color:l||colors.gray,offset:t,id:"".concat(a.uid,"-").concat(o+1),title:r.getAttribute("popover-title"),text:r.getAttribute("popover-text"),buttonText:r.getAttribute("popover-button-text"),sliceRef:r,inSmallCluster:false};t+=n;a.slicesDetails.push(c)}));return[2]}))}))}function sortSlicesDetails(e,t){var r=__spreadArray([],e,true).sort((function(e,t){return e.amount===t.amount?0:e.amount>t.amount?-1:1}));var a=0;r.forEach((function(e,o){var n=r[o===0?r.length-1:o-1];var s=r[o===r.length-1?0:o+1];var i=amountToPercent(n.amount,t,true);var l=amountToPercent(s.amount,t,true);e.offset=a;a+=e.amount;e.inSmallCluster=isInSmallCluster(i,e.perc,e.amount,l)}));return r}function isInSmallCluster(e,t,r,a){var o=t<4;var n=e<5;var s=a<5;var i=o&&(n||s);var l=t===0&&r>0;if(l&&(a<8||e<8)){i=true}return i}function getPathData(e,t,r){var a=amountToDegree(t,this.total)-90;var o=e/this.total*360;var n=a+o;var s=o>180?"1 1":"0 1";var i=o>180?"1 0":"0 0";var l=this.chartDetails.size/2;var c=this.chartDetails.thickness;var u=1;var h=r==="doughnut0"||r==="doughnut";var d=1.5;var f=h?2.25:3;if(o===360){n-=.01}var p=polarToCartesian(l,u,a+d,n);var g=polarToCartesian(l,c,a+f,n);var v="M ".concat(p.x1,", ").concat(p.y1," ");var m=getArc(u,s,p.x2,p.y2,this.chartDetails.size);var b=" L ".concat(g.x2,", ").concat(g.y2," ");var y=getArc(c,i,g.x1,g.y1,this.chartDetails.size);return v+m+b+y+" z"}function renderInstructionsText(){var e=intl.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 h("div",{id:"chart-instructions"},e)}function renderFilter(){return h("defs",null,h("filter",{id:"wmHoverDropShadow"},h("feGaussianBlur",{stdDeviation:"3"}),h("feOffset",{result:"offsetblur"}),h("feFlood",{"flood-color":"#333"}),h("feComposite",{operator:"in",in2:"offsetblur"}),h("feMerge",null,h("feMergeNode",null),h("feMergeNode",{in:"SourceGraphic"}))))}function renderDoughnut(e){var t=this;var r=this.chartDetails.size+this.chartDetails.padding;var a=e==="doughnut0"||e==="doughnut";var o=a?this.slicesDetails:sortSlicesDetails(this.slicesDetails,this.total);return h("div",{class:"chart-wrapper doughnut-wrapper"},h("svg",{width:r+"px",height:r+"px",id:"graphic-".concat(this.uid),class:"doughnut-svg"},renderFilter(),o.map((function(r){return renderPath.call(t,r,e)})),a?h("text",{class:"value",x:"50%",y:"50%","font-size":"1.5rem","font-weight":"500","text-anchor":"middle","dominant-baseline":"middle"},amountToPercent(o[0].amount,this.total,true)+"%"):h("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")"),"text-anchor":"middle","dominant-baseline":"middle"},o.map((function(e){return e.amount>0&&!e.inSmallCluster?renderDoughnutText.call(t,e):""})))))}function renderPath(e,t){var r=this;return h("g",{transform:"translate(".concat(this.chartDetails.padding/2,", ").concat(this.chartDetails.padding/2,")")},h("path",{id:e.id,class:"segment doughnut-segment",fill:e.amount?e.color:"transparent",d:getPathData.call(this,e.amount,e.offset,t),onClick:function(t){return handleSliceClick.call(r,t,e)},onFocus:function(t){return handleSliceFocus.call(r,t,e)},onKeyDown:function(e){return handleSliceKeyDown.call(r,e)},role:"img","aria-label":e.legend}))}function renderDoughnutText(e){var t=amountToDegree(e.offset+e.amount/2,this.total);var r=polarToCartesian(this.chartDetails.size/2,1.4,t-90),a=r.x,o=r.y;return h("text",{class:"value",x:a+"px",y:o+"px"},"".concat(e.perc>0?e.perc:"<1","%"))}function renderStackedBar(e){var t=this;var r=e==="bar1"||e==="bar";return h("div",{class:"chart-wrapper bar-wrapper"},r?h("div",{class:"single-perc"},amountToPercent(this.slicesDetails[0].amount,this.total,true)+"%"):"",this.chartType==="bar3"&&this.drawAxis(),h("div",{class:"inner-stacked-bar-wrapper ".concat(showValue(this.tempValueFormat))},!r?h("div",{class:"values"},this.slicesDetails.map((function(e,r){return t.renderBarText(e,r)}))):"",h("div",{class:"stacked-bar-segments-wrapper"},this.slicesDetails.map((function(e,r){return renderStackedBarSegment.call(t,e,r)}))),r?renderCompletionMessage.call(this):""))}function renderStackedBarSegment(e,t){var r=this;var a=t!==this.slicesDetails.length-1;var o="calc(".concat(amountToPercent(e.amount,this.total,false),"%").concat(a?" - 2px":"",")");return h("div",{class:"segment stacked-bar-segment ".concat(amountToPercent(e.amount,this.total,false)===0?"zero":""),style:{backgroundColor:e.color,width:o},onClick:function(t){return handleSliceClick.call(r,t,e)},onFocus:function(t){return handleSliceFocus.call(r,t,e)},onKeyDown:function(e){return handleSliceKeyDown.call(r,e)}},h("span",{class:"sr-only"},e.legend))}function renderSimpleBar(e){var t=this;var r=this.slicesDetails.map((function(e){return e.amount})).reduce((function(e,t){return e>t?e:t}));var a=parseInt(getComputedStyle(this.el).getPropertyValue("--labelWidth"),10);var o=48;var n=this.el.getBoundingClientRect().width;var s=n-a-o;var i=getMaxTicks(s);var l=getInterval(r,i);var c=i*l;var u=Math.floor((c-r)/l);i-=u;this.el.style.setProperty("--backgroundSize",100/i+"%");this.el.style.setProperty("--labelWidth",this.labelWidth);if(e==="bar7"&&!this.showBarLegend){this.el.style.setProperty("--labelWidth","0px")}var d=[];this.slicesDetails.forEach((function(a){a.legend&&d.push(renderSimpleBarLegend(a.legend,t.showBarLegend,e));d.push(renderSimpleBarItem.call(t,a,l,i,r))}));var f=[];for(var p=1;p<=i;p++){var g=abbrNumber(p*l);f.push(h("div",{class:"tick"},h("span",null,g)))}var v=e==="bar6"&&this.showGrid&&this.el.getBoundingClientRect().width>300;return h("div",{class:"chart-wrapper simple-bar-wrapper"},h("div",{class:"chart ".concat(showValue(this.tempValueFormat))},v&&h("div",{class:"gridlines"}),h("div",{class:"rows"},d)),v&&h("div",{class:"x-axis","aria-hidden":"true"},h("div",{class:"zero"},h("span",null,"0")),f))}function renderSimpleBarLegend(e,t,r){var a=r==="bar7"&&!t?" hidden":"";return h("label",{class:"label".concat(a)},e)}function renderSimpleBarItem(e,t,r,a){var o=this;var n=this.currentChartType==="bar6"?t*r:a;var s=amountToPercent(e.amount,n,false);var i=s?s+"%":"1px";var l=abbrNumber(e.amount);var c=this.tempValueFormat==="amount"?l:"";if(this.currentChartType==="bar6"&&this.tempValueFormat==="percentage"){c=e.amount+"%"}else if(this.currentChartType==="bar7"&&this.tempValueFormat==="percentage"){c=(this.total===0?"0":amountToPercent(e.amount,this.total,true))+"%"}return h("div",{class:"bar segment",style:{backgroundColor:e.color,width:i},onClick:function(t){return handleSliceClick.call(o,t,e)},onFocus:function(t){return handleSliceFocus.call(o,t,e)},onKeyDown:function(e){return handleSliceKeyDown.call(o,e)}},h("div",{class:"value"},c))}function renderLegend(e){if(this.showLegend){var t=!this.chartDetails.isBar&&this.slicesDetails.reduce((function(e,t){return e=t.inSmallCluster?true:e}),false);return h("div",{class:"legend-wrapper"},h("div",{class:"legend ".concat(e," ").concat(this.mode==="bar"?"--top":"--bottom"),"aria-hidden":"true"},this.slicesDetails.map((function(e){if(!!e.amount||!!e.legend){return renderLegendItem({key:e.legend,color:e.color})}}))),t&&renderHiddenValuesMessage())}}function renderLegendItem(e){return h("div",{class:"legend-item"},h("div",{class:"legend-color",style:{backgroundColor:e.color}}),h("div",{class:"legend-text"},e.key))}function renderCompletionMessage(){if(this.completionMessage){return h("div",{class:"completion-message"},this.completionMessage)}}function renderHiddenValuesMessage(){return h("div",{class:"hidden-values-warning"},textHiddenMessage,h("br",null),seeDetailsMessage)}export{allChartsDetails as a,amountToPercent as b,renderStackedBar as c,renderDoughnut as d,renderInstructionsText as e,renderLegend as f,getDetails as g,handleChartKeydown as h,renderCompletionMessage as i,renderHiddenValuesMessage as j,exitChart as k,renderLegendItem as l,abbrNumber as m,getInterval as n,renderSimpleBar as r};